aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAugust Skare <post@augustskare.no>2018-11-13 16:52:41 +0800
committerAugust Skare <post@augustskare.no>2018-11-13 16:52:41 +0800
commite43988aa44225ef66c95d0b26764de57b3d26c3a (patch)
tree5f2bdff05e3e6a336b600bcb7a766da4793afc76
parentee91f56bbe69534885da47f58a81302bf3c37f28 (diff)
parentc41622c20aea8ba89dc9899ff8b3ab6f22f53503 (diff)
downloaddexon-sol-tools-e43988aa44225ef66c95d0b26764de57b3d26c3a.tar
dexon-sol-tools-e43988aa44225ef66c95d0b26764de57b3d26c3a.tar.gz
dexon-sol-tools-e43988aa44225ef66c95d0b26764de57b3d26c3a.tar.bz2
dexon-sol-tools-e43988aa44225ef66c95d0b26764de57b3d26c3a.tar.lz
dexon-sol-tools-e43988aa44225ef66c95d0b26764de57b3d26c3a.tar.xz
dexon-sol-tools-e43988aa44225ef66c95d0b26764de57b3d26c3a.tar.zst
dexon-sol-tools-e43988aa44225ef66c95d0b26764de57b3d26c3a.zip
Merge branch 'development' into dev-tools-pages
-rw-r--r--.circleci/config.yml698
-rw-r--r--.gitattributes6
-rw-r--r--.gitignore27
-rw-r--r--.prettierignore25
-rw-r--r--CODEOWNERS29
-rw-r--r--README.md81
-rw-r--r--package.json21
-rw-r--r--packages/0x.js/CHANGELOG.json25
-rw-r--r--packages/0x.js/CHANGELOG.md15
-rw-r--r--packages/0x.js/README.md2
-rw-r--r--packages/0x.js/package.json41
-rw-r--r--packages/0x.js/src/globals.d.ts6
-rw-r--r--packages/0x.js/src/index.ts37
-rw-r--r--packages/0x.js/tslint.json2
-rw-r--r--packages/0x.js/typedoc-tsconfig.json2
-rw-r--r--packages/abi-gen-wrappers/CHANGELOG.json29
-rw-r--r--packages/abi-gen-wrappers/CHANGELOG.md18
-rw-r--r--packages/abi-gen-wrappers/README.md73
-rw-r--r--packages/abi-gen-wrappers/package.json48
-rw-r--r--packages/abi-gen-wrappers/src/generated-wrappers/asset_proxy_owner.ts1876
-rw-r--r--packages/abi-gen-wrappers/src/generated-wrappers/dummy_erc20_token.ts1044
-rw-r--r--packages/abi-gen-wrappers/src/generated-wrappers/dummy_erc721_token.ts1326
-rw-r--r--packages/abi-gen-wrappers/src/generated-wrappers/erc20_proxy.ts649
-rw-r--r--packages/abi-gen-wrappers/src/generated-wrappers/erc20_token.ts556
-rw-r--r--packages/abi-gen-wrappers/src/generated-wrappers/erc721_proxy.ts649
-rw-r--r--packages/abi-gen-wrappers/src/generated-wrappers/erc721_token.ts893
-rw-r--r--packages/abi-gen-wrappers/src/generated-wrappers/exchange.ts3072
-rw-r--r--packages/abi-gen-wrappers/src/generated-wrappers/forwarder.ts730
-rw-r--r--packages/abi-gen-wrappers/src/generated-wrappers/i_validator.ts108
-rw-r--r--packages/abi-gen-wrappers/src/generated-wrappers/i_wallet.ts103
-rw-r--r--packages/abi-gen-wrappers/src/generated-wrappers/order_validator.ts357
-rw-r--r--packages/abi-gen-wrappers/src/generated-wrappers/weth9.ts835
-rw-r--r--packages/abi-gen-wrappers/src/generated-wrappers/zrx_token.ts646
-rw-r--r--packages/abi-gen-wrappers/src/index.ts14
-rw-r--r--packages/abi-gen-wrappers/tsconfig.json (renamed from packages/sra-report/tsconfig.json)2
-rw-r--r--packages/abi-gen-wrappers/tslint.json3
-rw-r--r--packages/abi-gen/CHANGELOG.json18
-rw-r--r--packages/abi-gen/CHANGELOG.md10
-rw-r--r--packages/abi-gen/README.md6
-rw-r--r--packages/abi-gen/package.json15
-rw-r--r--packages/abi-gen/src/index.ts2
-rw-r--r--packages/abi-gen/tslint.json2
-rw-r--r--packages/assert/CHANGELOG.json18
-rw-r--r--packages/assert/CHANGELOG.md10
-rw-r--r--packages/assert/README.md12
-rw-r--r--packages/assert/package.json15
-rw-r--r--packages/assert/src/index.ts4
-rw-r--r--packages/assert/test/assert_test.ts4
-rw-r--r--packages/assert/tslint.json2
-rw-r--r--packages/asset-buyer/CHANGELOG.json61
-rw-r--r--packages/asset-buyer/CHANGELOG.md19
-rw-r--r--packages/asset-buyer/README.md14
-rw-r--r--packages/asset-buyer/package.json42
-rw-r--r--packages/asset-buyer/src/asset_buyer.ts116
-rw-r--r--packages/asset-buyer/src/constants.ts14
-rw-r--r--packages/asset-buyer/src/index.ts13
-rw-r--r--packages/asset-buyer/src/order_providers/basic_order_provider.ts13
-rw-r--r--packages/asset-buyer/src/order_providers/standard_relayer_api_order_provider.ts40
-rw-r--r--packages/asset-buyer/src/types.ts11
-rw-r--r--packages/asset-buyer/src/utils/assert.ts21
-rw-r--r--packages/asset-buyer/src/utils/asset_data_utils.ts24
-rw-r--r--packages/asset-buyer/src/utils/buy_quote_calculator.ts122
-rw-r--r--packages/asset-buyer/src/utils/order_provider_response_processor.ts15
-rw-r--r--packages/asset-buyer/src/utils/order_utils.ts72
-rw-r--r--packages/asset-buyer/test/buy_quote_calculator_test.ts16
-rw-r--r--packages/asset-buyer/tslint.json2
-rw-r--r--packages/base-contract/CHANGELOG.json18
-rw-r--r--packages/base-contract/CHANGELOG.md10
-rw-r--r--packages/base-contract/README.md12
-rw-r--r--packages/base-contract/package.json17
-rw-r--r--packages/base-contract/src/index.ts7
-rw-r--r--packages/base-contract/test/utils_test.ts2
-rw-r--r--packages/base-contract/tslint.json2
-rw-r--r--packages/connect/CHANGELOG.json18
-rw-r--r--packages/connect/CHANGELOG.md10
-rw-r--r--packages/connect/README.md10
-rw-r--r--packages/connect/package.json22
-rw-r--r--packages/connect/src/http_client.ts8
-rw-r--r--packages/connect/src/index.ts2
-rw-r--r--packages/connect/src/types.ts2
-rw-r--r--packages/connect/src/utils/assert.ts10
-rw-r--r--packages/connect/src/utils/orders_channel_message_parser.ts6
-rw-r--r--packages/connect/src/utils/relayer_response_json_parsers.ts8
-rw-r--r--packages/connect/src/utils/type_converters.ts4
-rw-r--r--packages/connect/src/ws_orders_channel.ts2
-rw-r--r--packages/connect/test/fixtures/standard_relayer_api/asset_pairs.ts4
-rw-r--r--packages/connect/test/fixtures/standard_relayer_api/fee_recipients.ts2
-rw-r--r--packages/connect/test/fixtures/standard_relayer_api/order/0xabc67323774bdbd24d94f977fa9ac94a50f016026fd13f42990861238897721f.ts2
-rw-r--r--packages/connect/test/fixtures/standard_relayer_api/order_config.ts4
-rw-r--r--packages/connect/test/fixtures/standard_relayer_api/orderbook.ts4
-rw-r--r--packages/connect/test/fixtures/standard_relayer_api/orders.ts4
-rw-r--r--packages/connect/test/http_client_test.ts2
-rw-r--r--packages/connect/tslint.json2
-rw-r--r--packages/contract-addresses/CHANGELOG.json30
-rw-r--r--packages/contract-addresses/CHANGELOG.md18
-rw-r--r--packages/contract-addresses/README.md68
-rw-r--r--packages/contract-addresses/package.json37
-rw-r--r--packages/contract-addresses/src/index.ts66
-rw-r--r--packages/contract-addresses/tsconfig.json8
-rw-r--r--packages/contract-addresses/tslint.json3
-rw-r--r--packages/contract-artifacts/CHANGELOG.json30
-rw-r--r--packages/contract-artifacts/CHANGELOG.md18
-rw-r--r--packages/contract-artifacts/README.md67
-rw-r--r--packages/contract-artifacts/artifacts/AssetProxyOwner.json (renamed from packages/migrations/artifacts/2.0.0-trimmed/AssetProxyOwner.json)27
-rw-r--r--packages/contract-artifacts/artifacts/DummyERC20Token.json (renamed from packages/migrations/artifacts/2.0.0-trimmed/DummyERC20Token.json)19
-rw-r--r--packages/contract-artifacts/artifacts/DummyERC721Token.json (renamed from packages/migrations/artifacts/2.0.0-trimmed/DummyERC721Token.json)0
-rw-r--r--packages/contract-artifacts/artifacts/ERC20Proxy.json (renamed from packages/migrations/artifacts/2.0.0-trimmed/ERC20Proxy.json)23
-rw-r--r--packages/contract-artifacts/artifacts/ERC20Token.json (renamed from packages/migrations/artifacts/2.0.0-trimmed/ERC20Token.json)0
-rw-r--r--packages/contract-artifacts/artifacts/ERC721Proxy.json (renamed from packages/migrations/artifacts/2.0.0-trimmed/ERC721Proxy.json)23
-rw-r--r--packages/contract-artifacts/artifacts/ERC721Token.json (renamed from packages/migrations/artifacts/2.0.0-trimmed/ERC721Token.json)0
-rw-r--r--packages/contract-artifacts/artifacts/Exchange.json (renamed from packages/migrations/artifacts/2.0.0-trimmed/Exchange.json)23
-rw-r--r--packages/contract-artifacts/artifacts/Forwarder.json447
-rw-r--r--packages/contract-artifacts/artifacts/IValidator.json (renamed from packages/migrations/artifacts/2.0.0-trimmed/IValidator.json)0
-rw-r--r--packages/contract-artifacts/artifacts/IWallet.json (renamed from packages/migrations/artifacts/2.0.0-trimmed/IWallet.json)0
-rw-r--r--packages/contract-artifacts/artifacts/OrderValidator.json (renamed from packages/migrations/artifacts/2.0.0-trimmed/OrderValidator.json)27
-rw-r--r--packages/contract-artifacts/artifacts/WETH9.json (renamed from packages/migrations/artifacts/2.0.0-trimmed/WETH9.json)23
-rw-r--r--packages/contract-artifacts/artifacts/ZRXToken.json (renamed from packages/migrations/artifacts/2.0.0-trimmed/ZRXToken.json)23
-rw-r--r--packages/contract-artifacts/package.json33
-rw-r--r--packages/contract-artifacts/src/index.ts31
-rw-r--r--packages/contract-artifacts/tsconfig.json25
-rw-r--r--packages/contract-artifacts/tslint.json3
-rw-r--r--packages/contract-wrappers/CHANGELOG.json76
-rw-r--r--packages/contract-wrappers/CHANGELOG.md19
-rw-r--r--packages/contract-wrappers/README.md12
-rw-r--r--packages/contract-wrappers/package.json49
-rw-r--r--packages/contract-wrappers/src/abstract/abstract_balance_and_proxy_allowance_lazy_store.ts2
-rw-r--r--packages/contract-wrappers/src/artifacts.ts27
-rw-r--r--packages/contract-wrappers/src/contract_wrappers.ts91
-rw-r--r--packages/contract-wrappers/src/contract_wrappers/contract_wrapper.ts67
-rw-r--r--packages/contract-wrappers/src/contract_wrappers/erc20_proxy_wrapper.ts55
-rw-r--r--packages/contract-wrappers/src/contract_wrappers/erc20_token_wrapper.ts48
-rw-r--r--packages/contract-wrappers/src/contract_wrappers/erc721_proxy_wrapper.ts55
-rw-r--r--packages/contract-wrappers/src/contract_wrappers/erc721_token_wrapper.ts52
-rw-r--r--packages/contract-wrappers/src/contract_wrappers/ether_token_wrapper.ts53
-rw-r--r--packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts104
-rw-r--r--packages/contract-wrappers/src/contract_wrappers/forwarder_wrapper.ts107
-rw-r--r--packages/contract-wrappers/src/contract_wrappers/order_validator_wrapper.ts36
-rw-r--r--packages/contract-wrappers/src/fetchers/asset_balance_and_proxy_allowance_fetcher.ts6
-rw-r--r--packages/contract-wrappers/src/fetchers/order_filled_cancelled_fetcher.ts18
-rw-r--r--packages/contract-wrappers/src/globals.d.ts6
-rw-r--r--packages/contract-wrappers/src/index.ts66
-rw-r--r--packages/contract-wrappers/src/schemas/contract_wrappers_config_schema.ts22
-rw-r--r--packages/contract-wrappers/src/schemas/contract_wrappers_private_network_config_schema.ts36
-rw-r--r--packages/contract-wrappers/src/schemas/contract_wrappers_public_network_config_schema.ts44
-rw-r--r--packages/contract-wrappers/src/schemas/validate_order_fillable_opts_schema.ts7
-rw-r--r--packages/contract-wrappers/src/types.ts45
-rw-r--r--packages/contract-wrappers/src/utils/assert.ts12
-rw-r--r--packages/contract-wrappers/src/utils/calldata_optimization_utils.ts2
-rw-r--r--packages/contract-wrappers/src/utils/constants.ts3
-rw-r--r--packages/contract-wrappers/src/utils/contract_addresses.ts15
-rw-r--r--packages/contract-wrappers/src/utils/decorators.ts14
-rw-r--r--packages/contract-wrappers/src/utils/exchange_transfer_simulator.ts4
-rw-r--r--packages/contract-wrappers/src/utils/transaction_encoder.ts12
-rw-r--r--packages/contract-wrappers/src/utils/utils.ts8
-rw-r--r--packages/contract-wrappers/test/artifacts_test.ts43
-rw-r--r--packages/contract-wrappers/test/calldata_optimization_utils_test.ts2
-rw-r--r--packages/contract-wrappers/test/erc20_proxy_wrapper_test.ts10
-rw-r--r--packages/contract-wrappers/test/erc20_wrapper_test.ts67
-rw-r--r--packages/contract-wrappers/test/erc721_proxy_wrapper_test.ts10
-rw-r--r--packages/contract-wrappers/test/erc721_wrapper_test.ts40
-rw-r--r--packages/contract-wrappers/test/ether_token_wrapper_test.ts40
-rw-r--r--packages/contract-wrappers/test/exchange_wrapper_test.ts62
-rw-r--r--packages/contract-wrappers/test/forwarder_wrapper_test.ts38
-rw-r--r--packages/contract-wrappers/test/global_hooks.ts13
-rw-r--r--packages/contract-wrappers/test/order_validator_wrapper_test.ts36
-rw-r--r--packages/contract-wrappers/test/revert_validation_test.ts51
-rw-r--r--packages/contract-wrappers/test/subscription_test.ts24
-rw-r--r--packages/contract-wrappers/test/transaction_encoder_test.ts30
-rw-r--r--packages/contract-wrappers/test/utils/constants.ts2
-rw-r--r--packages/contract-wrappers/test/utils/migrate.ts18
-rw-r--r--packages/contract-wrappers/test/utils/token_utils.ts24
-rw-r--r--packages/contract-wrappers/test/utils/web3_wrapper.ts4
-rw-r--r--packages/contract-wrappers/tslint.json2
-rw-r--r--packages/contract_templates/README.md4
-rw-r--r--packages/contract_templates/contract.handlebars6
-rw-r--r--packages/contracts/.solhintignore3
-rw-r--r--packages/contracts/CHANGELOG.json115
-rw-r--r--packages/contracts/README.md26
-rw-r--r--packages/contracts/compiler.json5
-rw-r--r--packages/contracts/contracts/examples/ExchangeWrapper/ExchangeWrapper.sol (renamed from packages/contracts/src/2.0.0/examples/ExchangeWrapper/ExchangeWrapper.sol)0
-rw-r--r--packages/contracts/contracts/examples/Validator/Validator.sol (renamed from packages/contracts/src/2.0.0/examples/Validator/Validator.sol)0
-rw-r--r--packages/contracts/contracts/examples/Wallet/Wallet.sol (renamed from packages/contracts/src/2.0.0/examples/Wallet/Wallet.sol)0
-rw-r--r--packages/contracts/contracts/examples/Whitelist/Whitelist.sol (renamed from packages/contracts/src/2.0.0/examples/Whitelist/Whitelist.sol)0
-rw-r--r--packages/contracts/contracts/extensions/Forwarder/Forwarder.sol (renamed from packages/contracts/src/2.0.0/extensions/Forwarder/Forwarder.sol)0
-rw-r--r--packages/contracts/contracts/extensions/Forwarder/MixinAssets.sol (renamed from packages/contracts/src/2.0.0/extensions/Forwarder/MixinAssets.sol)0
-rw-r--r--packages/contracts/contracts/extensions/Forwarder/MixinExchangeWrapper.sol (renamed from packages/contracts/src/2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol)12
-rw-r--r--packages/contracts/contracts/extensions/Forwarder/MixinForwarderCore.sol (renamed from packages/contracts/src/2.0.0/extensions/Forwarder/MixinForwarderCore.sol)0
-rw-r--r--packages/contracts/contracts/extensions/Forwarder/MixinWeth.sol (renamed from packages/contracts/src/2.0.0/extensions/Forwarder/MixinWeth.sol)0
-rw-r--r--packages/contracts/contracts/extensions/Forwarder/interfaces/IAssets.sol (renamed from packages/contracts/src/2.0.0/extensions/Forwarder/interfaces/IAssets.sol)0
-rw-r--r--packages/contracts/contracts/extensions/Forwarder/interfaces/IForwarder.sol (renamed from packages/contracts/src/2.0.0/extensions/Forwarder/interfaces/IForwarder.sol)0
-rw-r--r--packages/contracts/contracts/extensions/Forwarder/interfaces/IForwarderCore.sol (renamed from packages/contracts/src/2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol)0
-rw-r--r--packages/contracts/contracts/extensions/Forwarder/libs/LibConstants.sol (renamed from packages/contracts/src/2.0.0/extensions/Forwarder/libs/LibConstants.sol)0
-rw-r--r--packages/contracts/contracts/extensions/Forwarder/libs/LibForwarderErrors.sol (renamed from packages/contracts/src/2.0.0/extensions/Forwarder/libs/LibForwarderErrors.sol)0
-rw-r--r--packages/contracts/contracts/extensions/Forwarder/mixins/MAssets.sol (renamed from packages/contracts/src/2.0.0/extensions/Forwarder/mixins/MAssets.sol)0
-rw-r--r--packages/contracts/contracts/extensions/Forwarder/mixins/MExchangeWrapper.sol (renamed from packages/contracts/src/2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol)0
-rw-r--r--packages/contracts/contracts/extensions/Forwarder/mixins/MWeth.sol (renamed from packages/contracts/src/2.0.0/extensions/Forwarder/mixins/MWeth.sol)0
-rw-r--r--packages/contracts/contracts/extensions/OrderValidator/OrderValidator.sol (renamed from packages/contracts/src/2.0.0/extensions/OrderValidator/OrderValidator.sol)0
-rw-r--r--packages/contracts/contracts/multisig/MultiSigWallet.sol (renamed from packages/contracts/src/2.0.0/multisig/MultiSigWallet.sol)0
-rw-r--r--packages/contracts/contracts/multisig/MultiSigWalletWithTimeLock.sol (renamed from packages/contracts/src/2.0.0/multisig/MultiSigWalletWithTimeLock.sol)0
-rw-r--r--packages/contracts/contracts/protocol/AssetProxy/ERC20Proxy.sol (renamed from packages/contracts/src/2.0.0/protocol/AssetProxy/ERC20Proxy.sol)0
-rw-r--r--packages/contracts/contracts/protocol/AssetProxy/ERC721Proxy.sol (renamed from packages/contracts/src/2.0.0/protocol/AssetProxy/ERC721Proxy.sol)0
-rw-r--r--packages/contracts/contracts/protocol/AssetProxy/MixinAuthorizable.sol (renamed from packages/contracts/src/2.0.0/protocol/AssetProxy/MixinAuthorizable.sol)0
-rw-r--r--packages/contracts/contracts/protocol/AssetProxy/interfaces/IAssetData.sol (renamed from packages/contracts/src/2.0.0/protocol/AssetProxy/interfaces/IAssetData.sol)0
-rw-r--r--packages/contracts/contracts/protocol/AssetProxy/interfaces/IAssetProxy.sol (renamed from packages/contracts/src/2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol)0
-rw-r--r--packages/contracts/contracts/protocol/AssetProxy/interfaces/IAuthorizable.sol (renamed from packages/contracts/src/2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol)0
-rw-r--r--packages/contracts/contracts/protocol/AssetProxy/libs/LibAssetProxyErrors.sol (renamed from packages/contracts/src/2.0.0/protocol/AssetProxy/libs/LibAssetProxyErrors.sol)0
-rw-r--r--packages/contracts/contracts/protocol/AssetProxy/mixins/MAuthorizable.sol (renamed from packages/contracts/src/2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol)0
-rw-r--r--packages/contracts/contracts/protocol/AssetProxyOwner/AssetProxyOwner.sol (renamed from packages/contracts/src/2.0.0/protocol/AssetProxyOwner/AssetProxyOwner.sol)0
-rw-r--r--packages/contracts/contracts/protocol/Exchange/Exchange.sol (renamed from packages/contracts/src/2.0.0/protocol/Exchange/Exchange.sol)0
-rw-r--r--packages/contracts/contracts/protocol/Exchange/MixinAssetProxyDispatcher.sol (renamed from packages/contracts/src/2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol)0
-rw-r--r--packages/contracts/contracts/protocol/Exchange/MixinExchangeCore.sol (renamed from packages/contracts/src/2.0.0/protocol/Exchange/MixinExchangeCore.sol)0
-rw-r--r--packages/contracts/contracts/protocol/Exchange/MixinMatchOrders.sol (renamed from packages/contracts/src/2.0.0/protocol/Exchange/MixinMatchOrders.sol)0
-rw-r--r--packages/contracts/contracts/protocol/Exchange/MixinSignatureValidator.sol (renamed from packages/contracts/src/2.0.0/protocol/Exchange/MixinSignatureValidator.sol)0
-rw-r--r--packages/contracts/contracts/protocol/Exchange/MixinTransactions.sol (renamed from packages/contracts/src/2.0.0/protocol/Exchange/MixinTransactions.sol)0
-rw-r--r--packages/contracts/contracts/protocol/Exchange/MixinWrapperFunctions.sol (renamed from packages/contracts/src/2.0.0/protocol/Exchange/MixinWrapperFunctions.sol)0
-rw-r--r--packages/contracts/contracts/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol (renamed from packages/contracts/src/2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol)0
-rw-r--r--packages/contracts/contracts/protocol/Exchange/interfaces/IExchange.sol (renamed from packages/contracts/src/2.0.0/protocol/Exchange/interfaces/IExchange.sol)0
-rw-r--r--packages/contracts/contracts/protocol/Exchange/interfaces/IExchangeCore.sol (renamed from packages/contracts/src/2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol)0
-rw-r--r--packages/contracts/contracts/protocol/Exchange/interfaces/IMatchOrders.sol (renamed from packages/contracts/src/2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol)0
-rw-r--r--packages/contracts/contracts/protocol/Exchange/interfaces/ISignatureValidator.sol (renamed from packages/contracts/src/2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol)0
-rw-r--r--packages/contracts/contracts/protocol/Exchange/interfaces/ITransactions.sol (renamed from packages/contracts/src/2.0.0/protocol/Exchange/interfaces/ITransactions.sol)0
-rw-r--r--packages/contracts/contracts/protocol/Exchange/interfaces/IValidator.sol (renamed from packages/contracts/src/2.0.0/protocol/Exchange/interfaces/IValidator.sol)0
-rw-r--r--packages/contracts/contracts/protocol/Exchange/interfaces/IWallet.sol (renamed from packages/contracts/src/2.0.0/protocol/Exchange/interfaces/IWallet.sol)0
-rw-r--r--packages/contracts/contracts/protocol/Exchange/interfaces/IWrapperFunctions.sol (renamed from packages/contracts/src/2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol)0
-rw-r--r--packages/contracts/contracts/protocol/Exchange/libs/LibAbiEncoder.sol (renamed from packages/contracts/src/2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol)0
-rw-r--r--packages/contracts/contracts/protocol/Exchange/libs/LibConstants.sol (renamed from packages/contracts/src/2.0.0/protocol/Exchange/libs/LibConstants.sol)0
-rw-r--r--packages/contracts/contracts/protocol/Exchange/libs/LibEIP712.sol (renamed from packages/contracts/src/2.0.0/protocol/Exchange/libs/LibEIP712.sol)0
-rw-r--r--packages/contracts/contracts/protocol/Exchange/libs/LibExchangeErrors.sol (renamed from packages/contracts/src/2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol)0
-rw-r--r--packages/contracts/contracts/protocol/Exchange/libs/LibFillResults.sol (renamed from packages/contracts/src/2.0.0/protocol/Exchange/libs/LibFillResults.sol)0
-rw-r--r--packages/contracts/contracts/protocol/Exchange/libs/LibMath.sol (renamed from packages/contracts/src/2.0.0/protocol/Exchange/libs/LibMath.sol)0
-rw-r--r--packages/contracts/contracts/protocol/Exchange/libs/LibOrder.sol (renamed from packages/contracts/src/2.0.0/protocol/Exchange/libs/LibOrder.sol)0
-rw-r--r--packages/contracts/contracts/protocol/Exchange/mixins/MAssetProxyDispatcher.sol (renamed from packages/contracts/src/2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol)0
-rw-r--r--packages/contracts/contracts/protocol/Exchange/mixins/MExchangeCore.sol (renamed from packages/contracts/src/2.0.0/protocol/Exchange/mixins/MExchangeCore.sol)0
-rw-r--r--packages/contracts/contracts/protocol/Exchange/mixins/MMatchOrders.sol (renamed from packages/contracts/src/2.0.0/protocol/Exchange/mixins/MMatchOrders.sol)0
-rw-r--r--packages/contracts/contracts/protocol/Exchange/mixins/MSignatureValidator.sol (renamed from packages/contracts/src/2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol)0
-rw-r--r--packages/contracts/contracts/protocol/Exchange/mixins/MTransactions.sol (renamed from packages/contracts/src/2.0.0/protocol/Exchange/mixins/MTransactions.sol)0
-rw-r--r--packages/contracts/contracts/protocol/Exchange/mixins/MWrapperFunctions.sol (renamed from packages/contracts/src/2.0.0/protocol/Exchange/mixins/MWrapperFunctions.sol)0
-rw-r--r--packages/contracts/contracts/test/DummyERC20Token/DummyERC20Token.sol (renamed from packages/contracts/src/2.0.0/test/DummyERC20Token/DummyERC20Token.sol)0
-rw-r--r--packages/contracts/contracts/test/DummyERC20Token/DummyMultipleReturnERC20Token.sol (renamed from packages/contracts/src/2.0.0/test/DummyERC20Token/DummyMultipleReturnERC20Token.sol)0
-rw-r--r--packages/contracts/contracts/test/DummyERC20Token/DummyNoReturnERC20Token.sol (renamed from packages/contracts/src/2.0.0/test/DummyERC20Token/DummyNoReturnERC20Token.sol)0
-rw-r--r--packages/contracts/contracts/test/DummyERC721Receiver/DummyERC721Receiver.sol (renamed from packages/contracts/src/2.0.0/test/DummyERC721Receiver/DummyERC721Receiver.sol)0
-rw-r--r--packages/contracts/contracts/test/DummyERC721Receiver/InvalidERC721Receiver.sol (renamed from packages/contracts/src/2.0.0/test/DummyERC721Receiver/InvalidERC721Receiver.sol)0
-rw-r--r--packages/contracts/contracts/test/DummyERC721Token/DummyERC721Token.sol (renamed from packages/contracts/src/2.0.0/test/DummyERC721Token/DummyERC721Token.sol)0
-rw-r--r--packages/contracts/contracts/test/ReentrantERC20Token/ReentrantERC20Token.sol (renamed from packages/contracts/src/2.0.0/test/ReentrantERC20Token/ReentrantERC20Token.sol)0
-rw-r--r--packages/contracts/contracts/test/TestAssetProxyDispatcher/TestAssetProxyDispatcher.sol (renamed from packages/contracts/src/2.0.0/test/TestAssetProxyDispatcher/TestAssetProxyDispatcher.sol)0
-rw-r--r--packages/contracts/contracts/test/TestAssetProxyOwner/TestAssetProxyOwner.sol (renamed from packages/contracts/src/2.0.0/test/TestAssetProxyOwner/TestAssetProxyOwner.sol)0
-rw-r--r--packages/contracts/contracts/test/TestConstants/TestConstants.sol (renamed from packages/contracts/src/2.0.0/test/TestConstants/TestConstants.sol)0
-rw-r--r--packages/contracts/contracts/test/TestExchangeInternals/TestExchangeInternals.sol (renamed from packages/contracts/src/2.0.0/test/TestExchangeInternals/TestExchangeInternals.sol)0
-rw-r--r--packages/contracts/contracts/test/TestLibBytes/TestLibBytes.sol (renamed from packages/contracts/src/2.0.0/test/TestLibBytes/TestLibBytes.sol)0
-rw-r--r--packages/contracts/contracts/test/TestLibs/TestLibs.sol (renamed from packages/contracts/src/2.0.0/test/TestLibs/TestLibs.sol)0
-rw-r--r--packages/contracts/contracts/test/TestSignatureValidator/TestSignatureValidator.sol (renamed from packages/contracts/src/2.0.0/test/TestSignatureValidator/TestSignatureValidator.sol)0
-rw-r--r--packages/contracts/contracts/test/TestStaticCallReceiver/TestStaticCallReceiver.sol (renamed from packages/contracts/src/2.0.0/test/TestStaticCallReceiver/TestStaticCallReceiver.sol)0
-rw-r--r--packages/contracts/contracts/tokens/ERC20Token/ERC20Token.sol (renamed from packages/contracts/src/2.0.0/tokens/ERC20Token/ERC20Token.sol)0
-rw-r--r--packages/contracts/contracts/tokens/ERC20Token/IERC20Token.sol (renamed from packages/contracts/src/2.0.0/tokens/ERC20Token/IERC20Token.sol)0
-rw-r--r--packages/contracts/contracts/tokens/ERC20Token/MintableERC20Token.sol (renamed from packages/contracts/src/2.0.0/tokens/ERC20Token/MintableERC20Token.sol)0
-rw-r--r--packages/contracts/contracts/tokens/ERC20Token/UnlimitedAllowanceERC20Token.sol (renamed from packages/contracts/src/2.0.0/tokens/ERC20Token/UnlimitedAllowanceERC20Token.sol)0
-rw-r--r--packages/contracts/contracts/tokens/ERC721Token/ERC721Token.sol (renamed from packages/contracts/src/2.0.0/tokens/ERC721Token/ERC721Token.sol)0
-rw-r--r--packages/contracts/contracts/tokens/ERC721Token/IERC721Receiver.sol (renamed from packages/contracts/src/2.0.0/tokens/ERC721Token/IERC721Receiver.sol)0
-rw-r--r--packages/contracts/contracts/tokens/ERC721Token/IERC721Token.sol (renamed from packages/contracts/src/2.0.0/tokens/ERC721Token/IERC721Token.sol)0
-rw-r--r--packages/contracts/contracts/tokens/ERC721Token/MintableERC721Token.sol (renamed from packages/contracts/src/2.0.0/tokens/ERC721Token/MintableERC721Token.sol)0
-rw-r--r--packages/contracts/contracts/tokens/EtherToken/IEtherToken.sol (renamed from packages/contracts/src/2.0.0/tokens/EtherToken/IEtherToken.sol)0
-rw-r--r--packages/contracts/contracts/tokens/EtherToken/WETH9.sol (renamed from packages/contracts/src/2.0.0/tokens/EtherToken/WETH9.sol)0
-rw-r--r--packages/contracts/contracts/tokens/ZRXToken/ERC20Token_v1.sol (renamed from packages/contracts/src/1.0.0/ERC20Token/ERC20Token_v1.sol)2
-rw-r--r--packages/contracts/contracts/tokens/ZRXToken/Token_v1.sol (renamed from packages/contracts/src/1.0.0/Token/Token_v1.sol)0
-rw-r--r--packages/contracts/contracts/tokens/ZRXToken/UnlimitedAllowanceToken_v1.sol (renamed from packages/contracts/src/1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol)2
-rw-r--r--packages/contracts/contracts/tokens/ZRXToken/ZRXToken.sol (renamed from packages/contracts/src/2.0.0/tokens/ZRXToken/ZRXToken.sol)2
-rw-r--r--packages/contracts/contracts/utils/LibBytes/LibBytes.sol (renamed from packages/contracts/src/2.0.0/utils/LibBytes/LibBytes.sol)0
-rw-r--r--packages/contracts/contracts/utils/Ownable/IOwnable.sol (renamed from packages/contracts/src/2.0.0/utils/Ownable/IOwnable.sol)0
-rw-r--r--packages/contracts/contracts/utils/Ownable/Ownable.sol (renamed from packages/contracts/src/2.0.0/utils/Ownable/Ownable.sol)0
-rw-r--r--packages/contracts/contracts/utils/ReentrancyGuard/ReentrancyGuard.sol (renamed from packages/contracts/src/2.0.0/utils/ReentrancyGuard/ReentrancyGuard.sol)0
-rw-r--r--packages/contracts/contracts/utils/SafeMath/SafeMath.sol (renamed from packages/contracts/src/2.0.0/utils/SafeMath/SafeMath.sol)0
-rw-r--r--packages/contracts/globals.d.ts6
-rw-r--r--packages/contracts/package.json49
-rw-r--r--packages/contracts/src/1.0.0/Arbitrage/Arbitrage.sol114
-rw-r--r--packages/contracts/src/1.0.0/EtherDelta/AccountLevels.sol11
-rw-r--r--packages/contracts/src/1.0.0/EtherDelta/EtherDelta.sol168
-rw-r--r--packages/contracts/src/1.0.0/Exchange/Exchange_v1.sol602
-rw-r--r--packages/contracts/src/1.0.0/Exchange/IExchange_v1.sol226
-rw-r--r--packages/contracts/src/1.0.0/MultiSigWalletWithTImeLockExceptRemoveAuthorizedAddress/MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress.sol82
-rw-r--r--packages/contracts/src/1.0.0/Ownable/IOwnable_v1.sol18
-rw-r--r--packages/contracts/src/1.0.0/Ownable/Ownable_v1.sol27
-rw-r--r--packages/contracts/src/1.0.0/SafeMath/SafeMath_v1.sol73
-rw-r--r--packages/contracts/src/1.0.0/TokenRegistry/ITokenRegistery.sol195
-rw-r--r--packages/contracts/src/1.0.0/TokenRegistry/TokenRegistry.sol308
-rw-r--r--packages/contracts/src/1.0.0/TokenTransferProxy/TokenTransferProxy_v1.sol115
-rw-r--r--packages/contracts/src/artifacts/index.ts79
-rw-r--r--packages/contracts/src/wrappers/index.ts34
-rw-r--r--packages/contracts/test/asset_proxy/authorizable.ts10
-rw-r--r--packages/contracts/test/asset_proxy/proxies.ts26
-rw-r--r--packages/contracts/test/exchange/core.ts31
-rw-r--r--packages/contracts/test/exchange/dispatcher.ts18
-rw-r--r--packages/contracts/test/exchange/fill_order.ts2
-rw-r--r--packages/contracts/test/exchange/internal.ts10
-rw-r--r--packages/contracts/test/exchange/libs.ts14
-rw-r--r--packages/contracts/test/exchange/match_orders.ts26
-rw-r--r--packages/contracts/test/exchange/signature_validator.ts16
-rw-r--r--packages/contracts/test/exchange/transactions.ts20
-rw-r--r--packages/contracts/test/exchange/wrapper.ts24
-rw-r--r--packages/contracts/test/extensions/forwarder.ts289
-rw-r--r--packages/contracts/test/extensions/order_validator.ts22
-rw-r--r--packages/contracts/test/global_hooks.ts2
-rw-r--r--packages/contracts/test/libraries/lib_bytes.ts12
-rw-r--r--packages/contracts/test/multisig/asset_proxy_owner.ts14
-rw-r--r--packages/contracts/test/multisig/multi_sig_with_time_lock.ts12
-rw-r--r--packages/contracts/test/token_registry.ts255
-rw-r--r--packages/contracts/test/tokens/erc721_token.ts14
-rw-r--r--packages/contracts/test/tokens/unlimited_allowance_token.ts10
-rw-r--r--packages/contracts/test/tokens/weth9.ts (renamed from packages/contracts/test/tokens/ether_token.ts)12
-rw-r--r--packages/contracts/test/tokens/zrx_token.ts12
-rw-r--r--packages/contracts/test/tutorials/arbitrage.ts6
-rw-r--r--packages/contracts/test/utils/address_utils.ts4
-rw-r--r--packages/contracts/test/utils/artifacts.ts69
-rw-r--r--packages/contracts/test/utils/assertions.ts6
-rw-r--r--packages/contracts/test/utils/asset_wrapper.ts6
-rw-r--r--packages/contracts/test/utils/combinatorial_utils.ts2
-rw-r--r--packages/contracts/test/utils/constants.ts4
-rw-r--r--packages/contracts/test/utils/coverage.ts4
-rw-r--r--packages/contracts/test/utils/erc20_wrapper.ts12
-rw-r--r--packages/contracts/test/utils/erc721_wrapper.ts12
-rw-r--r--packages/contracts/test/utils/exchange_wrapper.ts14
-rw-r--r--packages/contracts/test/utils/fill_order_combinatorial_utils.ts16
-rw-r--r--packages/contracts/test/utils/formatters.ts4
-rw-r--r--packages/contracts/test/utils/forwarder_wrapper.ts17
-rw-r--r--packages/contracts/test/utils/log_decoder.ts7
-rw-r--r--packages/contracts/test/utils/match_order_tester.ts6
-rw-r--r--packages/contracts/test/utils/multi_sig_wrapper.ts8
-rw-r--r--packages/contracts/test/utils/order_factory.ts6
-rw-r--r--packages/contracts/test/utils/order_factory_from_scenario.ts8
-rw-r--r--packages/contracts/test/utils/order_utils.ts4
-rw-r--r--packages/contracts/test/utils/profiler.ts4
-rw-r--r--packages/contracts/test/utils/revert_trace.ts4
-rw-r--r--packages/contracts/test/utils/signing_utils.ts2
-rw-r--r--packages/contracts/test/utils/simple_asset_balance_and_proxy_allowance_fetcher.ts4
-rw-r--r--packages/contracts/test/utils/simple_order_filled_cancelled_fetcher.ts15
-rw-r--r--packages/contracts/test/utils/token_registry_wrapper.ts66
-rw-r--r--packages/contracts/test/utils/transaction_factory.ts6
-rw-r--r--packages/contracts/test/utils/type_encoding_utils.ts2
-rw-r--r--packages/contracts/test/utils/types.ts4
-rw-r--r--packages/contracts/test/utils/web3_wrapper.ts8
-rw-r--r--packages/contracts/tsconfig.json48
-rw-r--r--packages/contracts/tslint.json2
-rw-r--r--packages/dev-tools-pages/README.md2
-rw-r--r--packages/dev-tools-pages/package.json9
-rw-r--r--packages/dev-tools-pages/tslint.json2
-rw-r--r--packages/dev-utils/CHANGELOG.json19
-rw-r--r--packages/dev-utils/CHANGELOG.md10
-rw-r--r--packages/dev-utils/README.md8
-rw-r--r--packages/dev-utils/package.json24
-rw-r--r--packages/dev-utils/src/blockchain_lifecycle.ts4
-rw-r--r--packages/dev-utils/src/callback_error_reporter.ts2
-rw-r--r--packages/dev-utils/src/web3_factory.ts2
-rw-r--r--packages/dev-utils/test/blockchain_lifecycle_test.ts2
-rw-r--r--packages/dev-utils/test/rpc_test.ts2
-rw-r--r--packages/dev-utils/tslint.json2
-rw-r--r--packages/ethereum-types/CHANGELOG.json20
-rw-r--r--packages/ethereum-types/CHANGELOG.md16
-rw-r--r--packages/ethereum-types/package.json7
-rw-r--r--packages/ethereum-types/src/index.ts16
-rw-r--r--packages/ethereum-types/tslint.json2
-rw-r--r--packages/fill-scenarios/CHANGELOG.json19
-rw-r--r--packages/fill-scenarios/CHANGELOG.md10
-rw-r--r--packages/fill-scenarios/README.md10
-rw-r--r--packages/fill-scenarios/package.json36
-rw-r--r--packages/fill-scenarios/src/artifacts.ts11
-rw-r--r--packages/fill-scenarios/src/fill_scenarios.ts16
-rw-r--r--packages/fill-scenarios/src/globals.d.ts6
-rw-r--r--packages/fill-scenarios/tslint.json2
-rw-r--r--packages/instant/.dogfood.discharge.json13
-rw-r--r--packages/instant/.staging.discharge.json13
-rw-r--r--packages/instant/README.md34
-rw-r--r--packages/instant/package.json37
-rw-r--r--packages/instant/public/external.css25
-rw-r--r--packages/instant/public/index.html108
-rw-r--r--packages/instant/src/components/amount_input.tsx47
-rw-r--r--packages/instant/src/components/amount_placeholder.tsx32
-rw-r--r--packages/instant/src/components/animations/full_rotation.tsx24
-rw-r--r--packages/instant/src/components/animations/position_animation.tsx110
-rw-r--r--packages/instant/src/components/animations/pulse.tsx15
-rw-r--r--packages/instant/src/components/animations/slide_animation.tsx26
-rw-r--r--packages/instant/src/components/buy_button.tsx106
-rw-r--r--packages/instant/src/components/buy_order_progress.tsx35
-rw-r--r--packages/instant/src/components/buy_order_state_buttons.tsx71
-rw-r--r--packages/instant/src/components/css_reset.tsx32
-rw-r--r--packages/instant/src/components/erc20_asset_amount_input.tsx161
-rw-r--r--packages/instant/src/components/erc20_token_selector.tsx111
-rw-r--r--packages/instant/src/components/instant_heading.tsx162
-rw-r--r--packages/instant/src/components/order_details.tsx156
-rw-r--r--packages/instant/src/components/payment_method.tsx45
-rw-r--r--packages/instant/src/components/payment_method_dropdown.tsx44
-rw-r--r--packages/instant/src/components/placing_order_button.tsx16
-rw-r--r--packages/instant/src/components/scaling_amount_input.tsx83
-rw-r--r--packages/instant/src/components/scaling_input.tsx173
-rw-r--r--packages/instant/src/components/search_input.tsx29
-rw-r--r--packages/instant/src/components/secondary_button.tsx28
-rw-r--r--packages/instant/src/components/sliding_error.tsx95
-rw-r--r--packages/instant/src/components/sliding_panel.tsx77
-rw-r--r--packages/instant/src/components/time_counter.tsx78
-rw-r--r--packages/instant/src/components/timed_progress_bar.tsx80
-rw-r--r--packages/instant/src/components/ui/button.tsx62
-rw-r--r--packages/instant/src/components/ui/circle.tsx27
-rw-r--r--packages/instant/src/components/ui/container.tsx87
-rw-r--r--packages/instant/src/components/ui/dropdown.tsx134
-rw-r--r--packages/instant/src/components/ui/flex.tsx36
-rw-r--r--packages/instant/src/components/ui/icon.tsx123
-rw-r--r--packages/instant/src/components/ui/index.ts5
-rw-r--r--packages/instant/src/components/ui/input.tsx32
-rw-r--r--packages/instant/src/components/ui/overlay.tsx39
-rw-r--r--packages/instant/src/components/ui/spinner.tsx30
-rw-r--r--packages/instant/src/components/ui/text.tsx65
-rw-r--r--packages/instant/src/components/zero_ex_instant.tsx26
-rw-r--r--packages/instant/src/components/zero_ex_instant_container.tsx84
-rw-r--r--packages/instant/src/components/zero_ex_instant_overlay.tsx40
-rw-r--r--packages/instant/src/components/zero_ex_instant_provider.tsx149
-rw-r--r--packages/instant/src/constants.ts35
-rw-r--r--packages/instant/src/containers/available_erc20_token_selector.ts45
-rw-r--r--packages/instant/src/containers/latest_buy_quote_order_details.ts30
-rw-r--r--packages/instant/src/containers/latest_error.tsx60
-rw-r--r--packages/instant/src/containers/selected_asset_amount_input.tsx36
-rw-r--r--packages/instant/src/containers/selected_asset_buy_order_progress.ts13
-rw-r--r--packages/instant/src/containers/selected_asset_buy_order_state_buttons.ts104
-rw-r--r--packages/instant/src/containers/selected_asset_instant_heading.ts34
-rw-r--r--packages/instant/src/containers/selected_asset_theme_provider.ts32
-rw-r--r--packages/instant/src/containers/selected_erc20_asset_amount_input.ts116
-rw-r--r--packages/instant/src/data/asset_data_network_mapping.ts66
-rw-r--r--packages/instant/src/data/asset_meta_data_map.ts85
-rw-r--r--packages/instant/src/index.ts1
-rw-r--r--packages/instant/src/index.umd.ts56
-rw-r--r--packages/instant/src/redux/actions.ts69
-rw-r--r--packages/instant/src/redux/async_data.ts103
-rw-r--r--packages/instant/src/redux/reducer.ts270
-rw-r--r--packages/instant/src/redux/store.ts12
-rw-r--r--packages/instant/src/style/fonts.ts10
-rw-r--r--packages/instant/src/style/media.ts51
-rw-r--r--packages/instant/src/style/theme.ts23
-rw-r--r--packages/instant/src/style/util.ts2
-rw-r--r--packages/instant/src/style/z_index.ts9
-rw-r--r--packages/instant/src/types.ts130
-rw-r--r--packages/instant/src/util/address.ts6
-rw-r--r--packages/instant/src/util/assert.ts55
-rw-r--r--packages/instant/src/util/asset.ts111
-rw-r--r--packages/instant/src/util/asset_buyer_factory.ts17
-rw-r--r--packages/instant/src/util/buy_quote_updater.ts59
-rw-r--r--packages/instant/src/util/coinbase_api.ts11
-rw-r--r--packages/instant/src/util/error_flasher.ts26
-rw-r--r--packages/instant/src/util/etherscan.ts31
-rw-r--r--packages/instant/src/util/format.ts56
-rw-r--r--packages/instant/src/util/gas_price_estimator.ts62
-rw-r--r--packages/instant/src/util/heartbeater.ts35
-rw-r--r--packages/instant/src/util/heartbeater_factory.ts22
-rw-r--r--packages/instant/src/util/maybe_big_number.ts25
-rw-r--r--packages/instant/src/util/provider_factory.ts34
-rw-r--r--packages/instant/src/util/provider_state_factory.ts63
-rw-r--r--packages/instant/src/util/time.ts39
-rw-r--r--packages/instant/src/util/util.ts5
-rw-r--r--packages/instant/test/components/zero_ex_instant.test.tsx12
-rw-r--r--packages/instant/test/util/asset.test.ts48
-rw-r--r--packages/instant/test/util/format.test.ts97
-rw-r--r--packages/instant/test/util/time.test.ts48
-rw-r--r--packages/instant/tslint.json5
-rw-r--r--packages/json-schemas/CHANGELOG.json22
-rw-r--r--packages/json-schemas/CHANGELOG.md10
-rw-r--r--packages/json-schemas/README.md14
-rw-r--r--packages/json-schemas/package.json15
-rw-r--r--packages/json-schemas/schemas/address_schema.json5
-rw-r--r--packages/json-schemas/schemas/basic_type_schemas.ts17
-rw-r--r--packages/json-schemas/schemas/block_param_schema.json11
-rw-r--r--packages/json-schemas/schemas/block_range_schema.json8
-rw-r--r--packages/json-schemas/schemas/block_range_schema.ts20
-rw-r--r--packages/json-schemas/schemas/call_data_schema.json27
-rw-r--r--packages/json-schemas/schemas/call_data_schema.ts27
-rw-r--r--packages/json-schemas/schemas/ec_signature_parameter_schema.json5
-rw-r--r--packages/json-schemas/schemas/ec_signature_schema.json14
-rw-r--r--packages/json-schemas/schemas/ec_signature_schema.ts20
-rw-r--r--packages/json-schemas/schemas/eip712_typed_data.ts28
-rw-r--r--packages/json-schemas/schemas/eip712_typed_data_schema.json28
-rw-r--r--packages/json-schemas/schemas/hex_schema.json5
-rw-r--r--packages/json-schemas/schemas/index_filter_values_schema.json7
-rw-r--r--packages/json-schemas/schemas/index_filter_values_schema.ts7
-rw-r--r--packages/json-schemas/schemas/js_number.json5
-rw-r--r--packages/json-schemas/schemas/number_schema.json5
-rw-r--r--packages/json-schemas/schemas/order_cancel_schema.json12
-rw-r--r--packages/json-schemas/schemas/order_cancel_schema.ts12
-rw-r--r--packages/json-schemas/schemas/order_fill_or_kill_requests_schema.json12
-rw-r--r--packages/json-schemas/schemas/order_fill_or_kill_requests_schema.ts12
-rw-r--r--packages/json-schemas/schemas/order_fill_requests_schema.json12
-rw-r--r--packages/json-schemas/schemas/order_fill_requests_schema.ts12
-rw-r--r--packages/json-schemas/schemas/order_hash_schema.json5
-rw-r--r--packages/json-schemas/schemas/order_hash_schema.ts5
-rw-r--r--packages/json-schemas/schemas/order_schema.json34
-rw-r--r--packages/json-schemas/schemas/order_schemas.ts47
-rw-r--r--packages/json-schemas/schemas/orders_schema.json5
-rw-r--r--packages/json-schemas/schemas/orders_schema.ts5
-rw-r--r--packages/json-schemas/schemas/paginated_collection_schema.json10
-rw-r--r--packages/json-schemas/schemas/paginated_collection_schema.ts10
-rw-r--r--packages/json-schemas/schemas/relayer_api_asset_data_pairs_response_schema.json13
-rw-r--r--packages/json-schemas/schemas/relayer_api_asset_data_pairs_schema.json12
-rw-r--r--packages/json-schemas/schemas/relayer_api_asset_data_trade_info_schema.json11
-rw-r--r--packages/json-schemas/schemas/relayer_api_asset_pairs_response_schema.ts38
-rw-r--r--packages/json-schemas/schemas/relayer_api_error_response_schema.json21
-rw-r--r--packages/json-schemas/schemas/relayer_api_error_response_schema.ts21
-rw-r--r--packages/json-schemas/schemas/relayer_api_fee_recipients_response_schema.json16
-rw-r--r--packages/json-schemas/schemas/relayer_api_fee_recipients_response_schema.ts16
-rw-r--r--packages/json-schemas/schemas/relayer_api_order_config_payload_schema.json24
-rw-r--r--packages/json-schemas/schemas/relayer_api_order_config_payload_schema.ts24
-rw-r--r--packages/json-schemas/schemas/relayer_api_order_config_response_schema.json11
-rw-r--r--packages/json-schemas/schemas/relayer_api_order_config_response_schema.ts11
-rw-r--r--packages/json-schemas/schemas/relayer_api_order_schema.json9
-rw-r--r--packages/json-schemas/schemas/relayer_api_order_schema.ts9
-rw-r--r--packages/json-schemas/schemas/relayer_api_orderbook_response_schema.json9
-rw-r--r--packages/json-schemas/schemas/relayer_api_orderbook_response_schema.ts9
-rw-r--r--packages/json-schemas/schemas/relayer_api_orders_channel_subscribe_payload_schema.json14
-rw-r--r--packages/json-schemas/schemas/relayer_api_orders_channel_subscribe_schema.json11
-rw-r--r--packages/json-schemas/schemas/relayer_api_orders_channel_subscribe_schema.ts26
-rw-r--r--packages/json-schemas/schemas/relayer_api_orders_channel_update_response_schema.json11
-rw-r--r--packages/json-schemas/schemas/relayer_api_orders_channel_update_response_schema.ts11
-rw-r--r--packages/json-schemas/schemas/relayer_api_orders_response_schema.json13
-rw-r--r--packages/json-schemas/schemas/relayer_api_orders_response_schema.ts13
-rw-r--r--packages/json-schemas/schemas/relayer_api_orders_schema.json5
-rw-r--r--packages/json-schemas/schemas/relayer_api_orders_schema.ts5
-rw-r--r--packages/json-schemas/schemas/signed_order_schema.json12
-rw-r--r--packages/json-schemas/schemas/signed_orders_schema.json5
-rw-r--r--packages/json-schemas/schemas/signed_orders_schema.ts5
-rw-r--r--packages/json-schemas/schemas/token_schema.json11
-rw-r--r--packages/json-schemas/schemas/token_schema.ts11
-rw-r--r--packages/json-schemas/schemas/tx_data_schema.json26
-rw-r--r--packages/json-schemas/schemas/tx_data_schema.ts32
-rw-r--r--packages/json-schemas/schemas/whole_number_schema.json5
-rw-r--r--packages/json-schemas/schemas/zero_ex_transaction_schema.json10
-rw-r--r--packages/json-schemas/schemas/zero_ex_transaction_schema.ts10
-rw-r--r--packages/json-schemas/src/globals.d.ts6
-rw-r--r--packages/json-schemas/src/schemas.ts76
-rw-r--r--packages/json-schemas/test/schema_test.ts14
-rw-r--r--packages/json-schemas/tsconfig.json45
-rw-r--r--packages/json-schemas/tslint.json2
-rw-r--r--packages/metacoin/README.md6
-rw-r--r--packages/metacoin/package.json30
-rw-r--r--packages/metacoin/test/global_hooks.ts2
-rw-r--r--packages/metacoin/test/metacoin_test.ts4
-rw-r--r--packages/metacoin/test/utils/config.ts2
-rw-r--r--packages/metacoin/test/utils/coverage.ts4
-rw-r--r--packages/metacoin/test/utils/profiler.ts4
-rw-r--r--packages/metacoin/test/utils/web3_wrapper.ts8
-rw-r--r--packages/metacoin/tsconfig.json4
-rw-r--r--packages/metacoin/tslint.json2
-rw-r--r--packages/migrations/.gitignore1
-rw-r--r--packages/migrations/CHANGELOG.json20
-rw-r--r--packages/migrations/CHANGELOG.md10
-rw-r--r--packages/migrations/README.md31
-rw-r--r--packages/migrations/artifacts/1.0.0/DummyERC20Token.json375
-rw-r--r--packages/migrations/artifacts/1.0.0/Exchange_v1.json678
-rw-r--r--packages/migrations/artifacts/1.0.0/MultiSigWallet.json580
-rw-r--r--packages/migrations/artifacts/1.0.0/MultiSigWalletWithTimeLock.json664
-rw-r--r--packages/migrations/artifacts/1.0.0/MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress.json725
-rw-r--r--packages/migrations/artifacts/1.0.0/TokenRegistry.json600
-rw-r--r--packages/migrations/artifacts/1.0.0/TokenTransferProxy_v1.json236
-rw-r--r--packages/migrations/artifacts/1.0.0/WETH9.json332
-rw-r--r--packages/migrations/artifacts/1.0.0/ZRXToken.json288
-rw-r--r--packages/migrations/artifacts/2.0.0-testnet/AssetProxyOwner.json1012
-rw-r--r--packages/migrations/artifacts/2.0.0-testnet/DummyERC20Token.json641
-rw-r--r--packages/migrations/artifacts/2.0.0-testnet/DummyERC721Token.json672
-rw-r--r--packages/migrations/artifacts/2.0.0-testnet/ERC20Proxy.json508
-rw-r--r--packages/migrations/artifacts/2.0.0-testnet/ERC20Token.json486
-rw-r--r--packages/migrations/artifacts/2.0.0-testnet/ERC721Proxy.json508
-rw-r--r--packages/migrations/artifacts/2.0.0-testnet/ERC721Token.json565
-rw-r--r--packages/migrations/artifacts/2.0.0-testnet/Exchange.json2294
-rw-r--r--packages/migrations/artifacts/2.0.0-testnet/Forwarder.json761
-rw-r--r--packages/migrations/artifacts/2.0.0-testnet/IValidator.json320
-rw-r--r--packages/migrations/artifacts/2.0.0-testnet/IWallet.json316
-rw-r--r--packages/migrations/artifacts/2.0.0-testnet/OrderValidator.json885
-rw-r--r--packages/migrations/artifacts/2.0.0-testnet/WETH9.json346
-rw-r--r--packages/migrations/artifacts/2.0.0-testnet/ZRXToken.json10041
-rw-r--r--packages/migrations/artifacts/2.0.0-trimmed/Forwarder.json473
-rw-r--r--packages/migrations/artifacts/2.0.0/AssetProxyOwner.json985
-rw-r--r--packages/migrations/artifacts/2.0.0/DummyERC20Token.json641
-rw-r--r--packages/migrations/artifacts/2.0.0/DummyERC721Token.json672
-rw-r--r--packages/migrations/artifacts/2.0.0/ERC20Proxy.json481
-rw-r--r--packages/migrations/artifacts/2.0.0/ERC20Token.json486
-rw-r--r--packages/migrations/artifacts/2.0.0/ERC721Proxy.json481
-rw-r--r--packages/migrations/artifacts/2.0.0/ERC721Token.json565
-rw-r--r--packages/migrations/artifacts/2.0.0/Exchange.json2262
-rw-r--r--packages/migrations/artifacts/2.0.0/Forwarder.json734
-rw-r--r--packages/migrations/artifacts/2.0.0/IValidator.json320
-rw-r--r--packages/migrations/artifacts/2.0.0/IWallet.json316
-rw-r--r--packages/migrations/artifacts/2.0.0/OrderValidator.json858
-rw-r--r--packages/migrations/artifacts/2.0.0/WETH9.json351
-rw-r--r--packages/migrations/artifacts/2.0.0/ZRXToken.json10046
-rw-r--r--packages/migrations/compiler.json20
-rw-r--r--packages/migrations/package.json53
-rw-r--r--packages/migrations/src/1.0.0/artifacts.ts21
-rw-r--r--packages/migrations/src/1.0.0/migration.ts142
-rw-r--r--packages/migrations/src/2.0.0/artifacts.ts25
-rw-r--r--packages/migrations/src/2.0.0/migration.ts150
-rw-r--r--packages/migrations/src/globals.d.ts6
-rw-r--r--packages/migrations/src/index.ts3
-rw-r--r--packages/migrations/src/migrate.ts43
-rw-r--r--packages/migrations/src/migration.ts175
-rw-r--r--packages/migrations/src/types.ts2
-rw-r--r--packages/migrations/src/utils/artifact_writer.ts26
-rw-r--r--packages/migrations/src/utils/constants.ts2
-rw-r--r--packages/migrations/src/utils/provider_factory.ts2
-rw-r--r--packages/migrations/src/utils/token_info.ts2
-rw-r--r--packages/migrations/tslint.json2
-rw-r--r--packages/monorepo-scripts/CHANGELOG.json17
-rw-r--r--packages/monorepo-scripts/README.md4
-rw-r--r--packages/monorepo-scripts/package.json8
-rw-r--r--packages/monorepo-scripts/src/doc_gen_configs.ts16
-rw-r--r--packages/monorepo-scripts/src/find_unused_dependencies.ts2
-rw-r--r--packages/monorepo-scripts/src/prepublish_checks.ts2
-rw-r--r--packages/monorepo-scripts/src/publish.ts20
-rw-r--r--packages/monorepo-scripts/src/publish_release_notes.ts4
-rw-r--r--packages/monorepo-scripts/src/test_installation.ts21
-rw-r--r--packages/monorepo-scripts/src/utils/changelog_utils.ts3
-rw-r--r--packages/monorepo-scripts/src/utils/doc_generate_and_upload_utils.ts17
-rw-r--r--packages/monorepo-scripts/src/utils/github_release_utils.ts20
-rw-r--r--packages/monorepo-scripts/src/utils/utils.ts2
-rw-r--r--packages/order-utils/CHANGELOG.json41
-rw-r--r--packages/order-utils/CHANGELOG.md13
-rw-r--r--packages/order-utils/README.md10
-rw-r--r--packages/order-utils/package.json39
-rw-r--r--packages/order-utils/src/abstract/abstract_balance_and_proxy_allowance_fetcher.ts2
-rw-r--r--packages/order-utils/src/abstract/abstract_balance_and_proxy_allowance_lazy_store.ts2
-rw-r--r--packages/order-utils/src/abstract/abstract_order_filled_cancelled_fetcher.ts5
-rw-r--r--packages/order-utils/src/abstract/abstract_order_filled_cancelled_lazy_store.ts5
-rw-r--r--packages/order-utils/src/artifacts.ts14
-rw-r--r--packages/order-utils/src/assert.ts10
-rw-r--r--packages/order-utils/src/asset_data_utils.ts6
-rw-r--r--packages/order-utils/src/constants.ts2
-rw-r--r--packages/order-utils/src/eip712_utils.ts6
-rw-r--r--packages/order-utils/src/exchange_transfer_simulator.ts4
-rw-r--r--packages/order-utils/src/globals.d.ts6
-rw-r--r--packages/order-utils/src/index.ts4
-rw-r--r--packages/order-utils/src/market_utils.ts6
-rw-r--r--packages/order-utils/src/order_factory.ts4
-rw-r--r--packages/order-utils/src/order_hash.ts6
-rw-r--r--packages/order-utils/src/order_state_utils.ts8
-rw-r--r--packages/order-utils/src/order_validation_utils.ts211
-rw-r--r--packages/order-utils/src/parsing_utils.ts2
-rw-r--r--packages/order-utils/src/rate_utils.ts6
-rw-r--r--packages/order-utils/src/remaining_fillable_calculator.ts2
-rw-r--r--packages/order-utils/src/salt.ts2
-rw-r--r--packages/order-utils/src/signature_utils.ts12
-rw-r--r--packages/order-utils/src/sorting_utils.ts6
-rw-r--r--packages/order-utils/src/store/balance_and_proxy_allowance_lazy_store.ts4
-rw-r--r--packages/order-utils/src/store/order_filled_cancelled_lazy_store.ts9
-rw-r--r--packages/order-utils/src/types.ts10
-rw-r--r--packages/order-utils/src/utils.ts2
-rw-r--r--packages/order-utils/test/asset_data_utils_test.ts50
-rw-r--r--packages/order-utils/test/eip712_utils_test.ts2
-rw-r--r--packages/order-utils/test/exchange_transfer_simulator_test.ts12
-rw-r--r--packages/order-utils/test/market_utils_test.ts2
-rw-r--r--packages/order-utils/test/order_hash_test.ts4
-rw-r--r--packages/order-utils/test/order_state_utils_test.ts5
-rw-r--r--packages/order-utils/test/order_validation_utils_test.ts2
-rw-r--r--packages/order-utils/test/rate_utils_test.ts2
-rw-r--r--packages/order-utils/test/remaining_fillable_calculator_test.ts6
-rw-r--r--packages/order-utils/test/signature_utils_test.ts4
-rw-r--r--packages/order-utils/test/sorting_utils_test.ts2
-rw-r--r--packages/order-utils/test/utils/simple_erc20_balance_and_proxy_allowance_fetcher.ts5
-rw-r--r--packages/order-utils/test/utils/test_order_factory.ts2
-rw-r--r--packages/order-utils/test/utils/web3_wrapper.ts4
-rw-r--r--packages/order-utils/tslint.json2
-rw-r--r--packages/order-watcher/.npmignore1
-rw-r--r--packages/order-watcher/CHANGELOG.json24
-rw-r--r--packages/order-watcher/CHANGELOG.md11
-rw-r--r--packages/order-watcher/README.md10
-rw-r--r--packages/order-watcher/package.json53
-rw-r--r--packages/order-watcher/src/artifacts.ts13
-rw-r--r--packages/order-watcher/src/globals.d.ts6
-rw-r--r--packages/order-watcher/src/index.ts6
-rw-r--r--packages/order-watcher/src/order_watcher/collision_resistant_abi_decoder.ts2
-rw-r--r--packages/order-watcher/src/order_watcher/dependent_order_hashes_tracker.ts6
-rw-r--r--packages/order-watcher/src/order_watcher/event_watcher.ts4
-rw-r--r--packages/order-watcher/src/order_watcher/expiration_watcher.ts2
-rw-r--r--packages/order-watcher/src/order_watcher/order_watcher.ts33
-rw-r--r--packages/order-watcher/src/types.ts2
-rw-r--r--packages/order-watcher/src/utils/assert.ts10
-rw-r--r--packages/order-watcher/src/utils/utils.ts2
-rw-r--r--packages/order-watcher/test/expiration_watcher_test.ts31
-rw-r--r--packages/order-watcher/test/global_hooks.ts13
-rw-r--r--packages/order-watcher/test/order_watcher_test.ts57
-rw-r--r--packages/order-watcher/test/utils/migrate.ts18
-rw-r--r--packages/order-watcher/test/utils/token_utils.ts34
-rw-r--r--packages/order-watcher/test/utils/web3_wrapper.ts4
-rw-r--r--packages/order-watcher/tslint.json2
-rw-r--r--packages/react-docs/CHANGELOG.json18
-rw-r--r--packages/react-docs/CHANGELOG.md10
-rw-r--r--packages/react-docs/README.md10
-rw-r--r--packages/react-docs/package.json23
-rw-r--r--packages/react-docs/src/components/badge.tsx2
-rw-r--r--packages/react-docs/src/components/comment.tsx4
-rw-r--r--packages/react-docs/src/components/custom_enum.tsx4
-rw-r--r--packages/react-docs/src/components/doc_reference.tsx (renamed from packages/react-docs/src/components/documentation.tsx)191
-rw-r--r--packages/react-docs/src/components/event_definition.tsx4
-rw-r--r--packages/react-docs/src/components/interface.tsx2
-rw-r--r--packages/react-docs/src/components/property_block.tsx4
-rw-r--r--packages/react-docs/src/components/signature.tsx2
-rw-r--r--packages/react-docs/src/components/signature_block.tsx12
-rw-r--r--packages/react-docs/src/components/source_link.tsx10
-rw-r--r--packages/react-docs/src/components/type.tsx77
-rw-r--r--packages/react-docs/src/components/type_definition.tsx7
-rw-r--r--packages/react-docs/src/docs_info.ts70
-rw-r--r--packages/react-docs/src/index.ts4
-rw-r--r--packages/react-docs/src/utils/typedoc_utils.ts14
-rw-r--r--packages/react-docs/tslint.json2
-rw-r--r--packages/react-shared/CHANGELOG.json22
-rw-r--r--packages/react-shared/CHANGELOG.md12
-rw-r--r--packages/react-shared/README.md10
-rw-r--r--packages/react-shared/package.json20
-rw-r--r--packages/react-shared/src/components/anchor_title.tsx76
-rw-r--r--packages/react-shared/src/components/link.tsx145
-rw-r--r--packages/react-shared/src/components/markdown_paragraph_block.tsx10
-rw-r--r--packages/react-shared/src/components/markdown_section.tsx38
-rw-r--r--packages/react-shared/src/components/nested_sidebar_menu.tsx149
-rw-r--r--packages/react-shared/src/components/version_drop_down.tsx37
-rw-r--r--packages/react-shared/src/index.ts4
-rw-r--r--packages/react-shared/src/types.ts16
-rw-r--r--packages/react-shared/src/utils/colors.ts10
-rw-r--r--packages/react-shared/src/utils/constants.ts3
-rw-r--r--packages/react-shared/tslint.json2
-rw-r--r--packages/sol-compiler/CHANGELOG.json18
-rw-r--r--packages/sol-compiler/CHANGELOG.md10
-rw-r--r--packages/sol-compiler/README.md16
-rw-r--r--packages/sol-compiler/package.json28
-rw-r--r--packages/sol-compiler/src/cli.ts2
-rw-r--r--packages/sol-compiler/src/compiler.ts6
-rw-r--r--packages/sol-compiler/src/utils/compiler.ts4
-rw-r--r--packages/sol-compiler/src/utils/encoder.ts6
-rw-r--r--packages/sol-compiler/src/utils/fs_wrapper.ts2
-rw-r--r--packages/sol-compiler/test/util/constants.ts2
-rw-r--r--packages/sol-compiler/test/util/provider.ts2
-rw-r--r--packages/sol-compiler/tslint.json2
-rw-r--r--packages/sol-cov/CHANGELOG.json19
-rw-r--r--packages/sol-cov/CHANGELOG.md10
-rw-r--r--packages/sol-cov/README.md12
-rw-r--r--packages/sol-cov/package.json26
-rw-r--r--packages/sol-cov/src/artifact_adapters/sol_compiler_artifact_adapter.ts2
-rw-r--r--packages/sol-cov/src/artifact_adapters/truffle_artifact_adapter.ts2
-rw-r--r--packages/sol-cov/src/index.ts2
-rw-r--r--packages/sol-cov/src/revert_trace.ts2
-rw-r--r--packages/sol-cov/src/trace.ts2
-rw-r--r--packages/sol-cov/src/trace_collection_subprovider.ts6
-rw-r--r--packages/sol-cov/src/trace_collector.ts2
-rw-r--r--packages/sol-cov/src/utils.ts2
-rw-r--r--packages/sol-cov/tslint.json2
-rw-r--r--packages/sol-doc/CHANGELOG.json18
-rw-r--r--packages/sol-doc/CHANGELOG.md8
-rw-r--r--packages/sol-doc/package.json16
-rw-r--r--packages/sol-doc/src/cli.ts2
-rw-r--r--packages/sol-doc/src/sol_doc.ts18
-rw-r--r--packages/sol-doc/test/solidity_doc_generator_test.ts2
-rw-r--r--packages/sol-doc/tslint.json2
-rw-r--r--packages/sol-resolver/CHANGELOG.json18
-rw-r--r--packages/sol-resolver/CHANGELOG.md10
-rw-r--r--packages/sol-resolver/README.md12
-rw-r--r--packages/sol-resolver/package.json13
-rw-r--r--packages/sol-resolver/tslint.json2
-rw-r--r--packages/sra-report/.npmignore6
-rw-r--r--packages/sra-report/CHANGELOG.json289
-rw-r--r--packages/sra-report/CHANGELOG.md132
-rw-r--r--packages/sra-report/README.md138
-rwxr-xr-xpackages/sra-report/bin/sra-report.js2
-rw-r--r--packages/sra-report/package.json73
-rw-r--r--packages/sra-report/postman_collections/sra_report.postman_collection.json910
-rw-r--r--packages/sra-report/src/contract_addresses/kovan_addresses.ts5
-rw-r--r--packages/sra-report/src/contract_addresses/mainnet_addresses.ts5
-rw-r--r--packages/sra-report/src/contract_addresses/rinkeby_addresses.ts5
-rw-r--r--packages/sra-report/src/contract_addresses/ropsten_addresses.ts5
-rw-r--r--packages/sra-report/src/globals.d.ts4
-rw-r--r--packages/sra-report/src/index.ts111
-rw-r--r--packages/sra-report/src/postman_environment_factory.ts144
-rw-r--r--packages/sra-report/src/utils.ts6
-rw-r--r--packages/sra-report/test/environments/postman_environment.json223
-rw-r--r--packages/sra-report/test/fixtures/v0/token_pairs/default_request.json3698
-rw-r--r--packages/sra-report/test/fixtures/v0/token_pairs/malformed.json30
-rw-r--r--packages/sra-report/test/fixtures/v0/token_pairs/token_a_and_token_b_params.json16
-rw-r--r--packages/sra-report/test/fixtures/v0/token_pairs/token_a_param.json1864
-rw-r--r--packages/sra-report/test/fixtures/v0/token_pairs/token_b_param.json1864
-rw-r--r--packages/sra-report/test/postman_collection_v0_test.ts76
-rw-r--r--packages/sra-report/test/test_runner.ts143
-rw-r--r--packages/sra-report/tslint.json3
-rw-r--r--packages/sra-spec/CHANGELOG.json19
-rw-r--r--packages/sra-spec/CHANGELOG.md10
-rw-r--r--packages/sra-spec/README.md8
-rw-r--r--packages/sra-spec/package.json12
-rw-r--r--packages/sra-spec/src/json-schemas.ts8
-rw-r--r--packages/sra-spec/src/md/introduction.md4
-rw-r--r--packages/sra-spec/tslint.json2
-rw-r--r--packages/subproviders/CHANGELOG.json16
-rw-r--r--packages/subproviders/CHANGELOG.md12
-rw-r--r--packages/subproviders/README.md10
-rw-r--r--packages/subproviders/package.json27
-rw-r--r--packages/subproviders/src/index.ts9
-rw-r--r--packages/subproviders/src/subproviders/base_wallet_subprovider.ts4
-rw-r--r--packages/subproviders/src/subproviders/eth_lightwallet_subprovider.ts2
-rw-r--r--packages/subproviders/src/subproviders/ledger.ts4
-rw-r--r--packages/subproviders/src/subproviders/metamask_subprovider.ts2
-rw-r--r--packages/subproviders/src/subproviders/mnemonic_wallet.ts6
-rw-r--r--packages/subproviders/src/subproviders/private_key_wallet.ts6
-rw-r--r--packages/subproviders/src/subproviders/redundant_subprovider.ts2
-rw-r--r--packages/subproviders/src/subproviders/rpc_subprovider.ts6
-rw-r--r--packages/subproviders/src/subproviders/signer.ts2
-rw-r--r--packages/subproviders/src/subproviders/subprovider.ts2
-rw-r--r--packages/subproviders/src/types.ts2
-rw-r--r--packages/subproviders/test/integration/ledger_subprovider_test.ts4
-rw-r--r--packages/subproviders/test/unit/nonce_tracker_subprovider_test.ts2
-rw-r--r--packages/subproviders/test/unit/redundant_rpc_subprovider_test.ts2
-rw-r--r--packages/subproviders/test/utils/report_callback_errors.ts2
-rw-r--r--packages/subproviders/tslint.json2
-rw-r--r--packages/testnet-faucets/README.md6
-rw-r--r--packages/testnet-faucets/package.json20
-rw-r--r--packages/testnet-faucets/src/ts/dispatch_queue.ts2
-rw-r--r--packages/testnet-faucets/src/ts/dispense_asset_tasks.ts4
-rw-r--r--packages/testnet-faucets/src/ts/error_reporter.ts2
-rw-r--r--packages/testnet-faucets/src/ts/handler.ts13
-rw-r--r--packages/testnet-faucets/src/ts/parameter_transformer.ts2
-rw-r--r--packages/testnet-faucets/tslint.json2
-rw-r--r--packages/tslint-config/CHANGELOG.json18
-rw-r--r--packages/tslint-config/CHANGELOG.md10
-rw-r--r--packages/tslint-config/README.md10
-rw-r--r--packages/tslint-config/package.json7
-rw-r--r--packages/types/CHANGELOG.json16
-rw-r--r--packages/types/CHANGELOG.md12
-rw-r--r--packages/types/README.md12
-rw-r--r--packages/types/package.json11
-rw-r--r--packages/types/src/index.ts6
-rw-r--r--packages/types/tslint.json2
-rw-r--r--packages/typescript-typings/CHANGELOG.json18
-rw-r--r--packages/typescript-typings/CHANGELOG.md10
-rw-r--r--packages/typescript-typings/README.md10
-rw-r--r--packages/typescript-typings/package.json7
-rw-r--r--packages/utils/CHANGELOG.json18
-rw-r--r--packages/utils/CHANGELOG.md10
-rw-r--r--packages/utils/README.md12
-rw-r--r--packages/utils/package.json15
-rw-r--r--packages/utils/src/abi_decoder.ts10
-rw-r--r--packages/utils/src/configured_bignumber.ts23
-rw-r--r--packages/utils/src/sign_typed_data_utils.ts2
-rw-r--r--packages/utils/tslint.json2
-rw-r--r--packages/web3-wrapper/CHANGELOG.json14
-rw-r--r--packages/web3-wrapper/CHANGELOG.md13
-rw-r--r--packages/web3-wrapper/README.md10
-rw-r--r--packages/web3-wrapper/package.json21
-rw-r--r--packages/web3-wrapper/src/index.ts2
-rw-r--r--packages/web3-wrapper/src/marshaller.ts2
-rw-r--r--packages/web3-wrapper/src/utils.ts2
-rw-r--r--packages/web3-wrapper/src/web3_wrapper.ts22
-rw-r--r--packages/web3-wrapper/tslint.json2
-rw-r--r--packages/website/README.md4
-rw-r--r--packages/website/less/all.less13
-rw-r--r--packages/website/md/docs/asset_buyer/installation.md17
-rw-r--r--packages/website/md/docs/asset_buyer/introduction.md1
-rw-r--r--packages/website/md/docs/asset_buyer/usage.md39
-rw-r--r--packages/website/md/docs/connect/1/installation.md (renamed from packages/website/md/docs/connect/1.0.0/installation.md)0
-rw-r--r--packages/website/md/docs/connect/1/introduction.md (renamed from packages/website/md/docs/connect/1.0.0/introduction.md)0
-rw-r--r--packages/website/md/docs/connect/2/introduction.md (renamed from packages/website/md/docs/connect/2.0.0/introduction.md)0
-rw-r--r--packages/website/md/docs/connect/3/installation.md15
-rw-r--r--packages/website/md/docs/contract_wrappers/1/installation.md (renamed from packages/website/md/docs/contract_wrappers/installation.md)0
-rw-r--r--packages/website/md/docs/contract_wrappers/1/introduction.md (renamed from packages/website/md/docs/contract_wrappers/introduction.md)0
-rw-r--r--packages/website/md/docs/contract_wrappers/2/installation.md11
-rw-r--r--packages/website/md/docs/json_schemas/1/installation.md (renamed from packages/website/md/docs/json_schemas/1.0.0/installation.md)0
-rw-r--r--packages/website/md/docs/json_schemas/1/introduction.md (renamed from packages/website/md/docs/json_schemas/1.0.0/introduction.md)0
-rw-r--r--packages/website/md/docs/json_schemas/1/schemas.md (renamed from packages/website/md/docs/json_schemas/1.0.0/schemas.md)0
-rw-r--r--packages/website/md/docs/json_schemas/1/usage.md (renamed from packages/website/md/docs/json_schemas/1.0.0/usage.md)0
-rw-r--r--packages/website/md/docs/json_schemas/2.0.0/schemas.md28
-rw-r--r--packages/website/md/docs/json_schemas/2/schemas.md40
-rw-r--r--packages/website/md/docs/json_schemas/3/installation.md17
-rw-r--r--packages/website/md/docs/json_schemas/3/introduction.md3
-rw-r--r--packages/website/md/docs/json_schemas/3/schemas.md41
-rw-r--r--packages/website/md/docs/json_schemas/3/usage.md14
-rw-r--r--packages/website/md/docs/order_utils/1/installation.md (renamed from packages/website/md/docs/order_utils/1.0.0/installation.md)0
-rw-r--r--packages/website/md/docs/order_utils/1/introduction.md (renamed from packages/website/md/docs/order_utils/1.0.0/introduction.md)0
-rw-r--r--packages/website/md/docs/order_utils/2/installation.md17
-rw-r--r--packages/website/md/docs/order_utils/2/introduction.md1
-rw-r--r--packages/website/md/docs/order_watcher/1/installation.md (renamed from packages/website/md/docs/order_watcher/installation.md)0
-rw-r--r--packages/website/md/docs/order_watcher/1/introduction.md (renamed from packages/website/md/docs/order_watcher/introduction.md)0
-rw-r--r--packages/website/md/docs/order_watcher/2/installation.md17
-rw-r--r--packages/website/md/docs/order_watcher/2/introduction.md1
-rw-r--r--packages/website/md/docs/smart_contracts/1/introduction.md (renamed from packages/website/md/docs/smart_contracts/1.0.0/introduction.md)0
-rw-r--r--packages/website/md/docs/smart_contracts/2/introduction.md (renamed from packages/website/md/docs/smart_contracts/2.0.0/introduction.md)0
-rw-r--r--packages/website/md/docs/sol-compiler/1/installation.md (renamed from packages/website/md/docs/sol-compiler/installation.md)0
-rw-r--r--packages/website/md/docs/sol-compiler/1/introduction.md (renamed from packages/website/md/docs/sol-compiler/introduction.md)0
-rw-r--r--packages/website/md/docs/sol-compiler/1/usage.md (renamed from packages/website/md/docs/sol-compiler/usage.md)0
-rw-r--r--packages/website/md/docs/sol-compiler/2/installation.md23
-rw-r--r--packages/website/md/docs/sol-compiler/2/usage.md24
-rw-r--r--packages/website/md/docs/sol_cov/1/installation.md (renamed from packages/website/md/docs/sol_cov/installation.md)0
-rw-r--r--packages/website/md/docs/sol_cov/1/introduction.md (renamed from packages/website/md/docs/sol_cov/introduction.md)0
-rw-r--r--packages/website/md/docs/sol_cov/1/usage.md (renamed from packages/website/md/docs/sol_cov/usage.md)0
-rw-r--r--packages/website/md/docs/sol_cov/2/installation.md17
-rw-r--r--packages/website/md/docs/sol_cov/2/introduction.md1
-rw-r--r--packages/website/md/docs/sol_cov/2/usage.md62
-rw-r--r--packages/website/md/docs/subproviders/1/installation.md (renamed from packages/website/md/docs/subproviders/installation.md)0
-rw-r--r--packages/website/md/docs/subproviders/1/introduction.md (renamed from packages/website/md/docs/subproviders/introduction.md)0
-rw-r--r--packages/website/md/docs/subproviders/1/ledger_node_hid.md (renamed from packages/website/md/docs/subproviders/ledger_node_hid.md)0
-rw-r--r--packages/website/md/docs/subproviders/2/installation.md15
-rw-r--r--packages/website/md/docs/web3_wrapper/1/installation.md (renamed from packages/website/md/docs/web3_wrapper/installation.md)0
-rw-r--r--packages/website/md/docs/web3_wrapper/1/introduction.md (renamed from packages/website/md/docs/web3_wrapper/introduction.md)0
-rw-r--r--packages/website/md/docs/web3_wrapper/2/installation.md25
-rw-r--r--packages/website/package.json43
-rw-r--r--packages/website/public/css/basscss_responsive_custom.css12
-rw-r--r--packages/website/public/images/developers/tutorials/0x_order_basics.svg1
-rw-r--r--packages/website/public/images/developers/tutorials/build_a_relayer.svg3
-rw-r--r--packages/website/public/images/developers/tutorials/build_a_trading_bot.svg6
-rw-r--r--packages/website/public/images/developers/tutorials/develop_on_ethereum.svg4
-rw-r--r--packages/website/public/images/developers/tutorials/use_shared_liquidity.svg3
-rw-r--r--packages/website/public/images/docs_logo.svg24
-rw-r--r--packages/website/public/images/landing/0x_homepage.svg57
-rw-r--r--packages/website/translations/chinese.json21
-rw-r--r--packages/website/translations/english.json22
-rw-r--r--packages/website/translations/korean.json21
-rw-r--r--packages/website/translations/russian.json21
-rw-r--r--packages/website/translations/spanish.json21
-rw-r--r--packages/website/ts/blockchain.ts173
-rw-r--r--packages/website/ts/blockchain_watcher.ts4
-rw-r--r--packages/website/ts/components/dialogs/blockchain_err_dialog.tsx2
-rw-r--r--packages/website/ts/components/dialogs/eth_weth_conversion_dialog.tsx4
-rw-r--r--packages/website/ts/components/dialogs/ledger_config_dialog.tsx8
-rw-r--r--packages/website/ts/components/dialogs/portal_disclaimer_dialog.tsx2
-rw-r--r--packages/website/ts/components/dialogs/send_dialog.tsx2
-rw-r--r--packages/website/ts/components/dialogs/u2f_not_supported_dialog.tsx2
-rw-r--r--packages/website/ts/components/documentation/docs_logo.tsx20
-rw-r--r--packages/website/ts/components/documentation/docs_top_bar.tsx108
-rw-r--r--packages/website/ts/components/documentation/overview_content.tsx134
-rw-r--r--packages/website/ts/components/documentation/sidebar_header.tsx57
-rw-r--r--packages/website/ts/components/documentation/tutorial_button.tsx59
-rw-r--r--packages/website/ts/components/documentation/version_drop_down.tsx80
-rw-r--r--packages/website/ts/components/dropdowns/developers_drop_down.tsx162
-rw-r--r--packages/website/ts/components/dropdowns/network_drop_down.tsx2
-rw-r--r--packages/website/ts/components/eth_weth_conversion_button.tsx4
-rw-r--r--packages/website/ts/components/eth_wrappers.tsx8
-rw-r--r--packages/website/ts/components/fill_order.tsx16
-rw-r--r--packages/website/ts/components/fill_order_json.tsx4
-rw-r--r--packages/website/ts/components/fill_warning_dialog.tsx2
-rw-r--r--packages/website/ts/components/flash_messages/asset_send_completed.tsx6
-rw-r--r--packages/website/ts/components/flash_messages/transaction_submitted.tsx2
-rw-r--r--packages/website/ts/components/footer.tsx110
-rw-r--r--packages/website/ts/components/forms/subscribe_form.tsx2
-rw-r--r--packages/website/ts/components/generate_order/asset_picker.tsx2
-rw-r--r--packages/website/ts/components/generate_order/generate_order_form.tsx8
-rw-r--r--packages/website/ts/components/generate_order/new_token_form.tsx2
-rw-r--r--packages/website/ts/components/inputs/address_input.tsx4
-rw-r--r--packages/website/ts/components/inputs/allowance_state_toggle.tsx6
-rw-r--r--packages/website/ts/components/inputs/balance_bounded_input.tsx4
-rw-r--r--packages/website/ts/components/inputs/eth_amount_input.tsx4
-rw-r--r--packages/website/ts/components/inputs/expiration_input.tsx2
-rw-r--r--packages/website/ts/components/inputs/hash_input.tsx8
-rw-r--r--packages/website/ts/components/inputs/token_amount_input.tsx10
-rw-r--r--packages/website/ts/components/inputs/token_input.tsx2
-rw-r--r--packages/website/ts/components/nested_sidebar_menu.tsx92
-rw-r--r--packages/website/ts/components/onboarding/add_eth_onboarding_step.tsx2
-rw-r--r--packages/website/ts/components/onboarding/install_wallet_onboarding_step.tsx2
-rw-r--r--packages/website/ts/components/onboarding/onboarding_card.tsx2
-rw-r--r--packages/website/ts/components/onboarding/portal_onboarding_flow.tsx2
-rw-r--r--packages/website/ts/components/onboarding/wrap_eth_onboarding_step.tsx4
-rw-r--r--packages/website/ts/components/order_json.tsx2
-rw-r--r--packages/website/ts/components/portal/back_button.tsx6
-rw-r--r--packages/website/ts/components/portal/drawer_menu.tsx4
-rw-r--r--packages/website/ts/components/portal/menu.tsx8
-rw-r--r--packages/website/ts/components/portal/portal.tsx40
-rw-r--r--packages/website/ts/components/portal/text_header.tsx2
-rw-r--r--packages/website/ts/components/relayer_index/relayer_grid_tile.tsx48
-rw-r--r--packages/website/ts/components/relayer_index/relayer_index.tsx23
-rw-r--r--packages/website/ts/components/relayer_index/relayer_top_tokens.tsx2
-rw-r--r--packages/website/ts/components/send_button.tsx2
-rw-r--r--packages/website/ts/components/sidebar_header.tsx35
-rw-r--r--packages/website/ts/components/token_balances.tsx10
-rw-r--r--packages/website/ts/components/top_bar/provider_display.tsx2
-rw-r--r--packages/website/ts/components/top_bar/top_bar.tsx281
-rw-r--r--packages/website/ts/components/top_bar/top_bar_menu_item.tsx23
-rw-r--r--packages/website/ts/components/track_token_confirmation.tsx2
-rw-r--r--packages/website/ts/components/trade_history/trade_history_item.tsx6
-rw-r--r--packages/website/ts/components/ui/alert.tsx2
-rw-r--r--packages/website/ts/components/ui/allowance_state_view.tsx2
-rw-r--r--packages/website/ts/components/ui/balance.tsx2
-rw-r--r--packages/website/ts/components/ui/button.tsx9
-rw-r--r--packages/website/ts/components/ui/container.tsx4
-rw-r--r--packages/website/ts/components/ui/copy_icon.tsx4
-rw-r--r--packages/website/ts/components/ui/custom_menu_item.tsx (renamed from packages/website/ts/components/ui/menu_item.tsx)15
-rw-r--r--packages/website/ts/components/ui/drop_down.tsx12
-rw-r--r--packages/website/ts/components/ui/ethereum_address.tsx4
-rw-r--r--packages/website/ts/components/ui/etherscan_icon.tsx4
-rw-r--r--packages/website/ts/components/ui/fake_text_field.tsx2
-rw-r--r--packages/website/ts/components/ui/help_tooltip.tsx2
-rw-r--r--packages/website/ts/components/ui/icon_button.tsx2
-rw-r--r--packages/website/ts/components/ui/identicon.tsx2
-rw-r--r--packages/website/ts/components/ui/input.tsx2
-rw-r--r--packages/website/ts/components/ui/input_label.tsx2
-rw-r--r--packages/website/ts/components/ui/lifecycle_raised_button.tsx4
-rw-r--r--packages/website/ts/components/ui/party.tsx4
-rw-r--r--packages/website/ts/components/ui/pointer.tsx2
-rw-r--r--packages/website/ts/components/ui/required_label.tsx2
-rw-r--r--packages/website/ts/components/ui/simple_menu.tsx4
-rw-r--r--packages/website/ts/components/ui/spinner.tsx2
-rw-r--r--packages/website/ts/components/ui/swap_icon.tsx2
-rw-r--r--packages/website/ts/components/ui/text.tsx6
-rw-r--r--packages/website/ts/components/visual_order.tsx2
-rw-r--r--packages/website/ts/components/wallet/wallet.tsx6
-rw-r--r--packages/website/ts/components/wallet/wrap_ether_item.tsx6
-rw-r--r--packages/website/ts/containers/asset_buyer_documentation.ts71
-rw-r--r--packages/website/ts/containers/connect_documentation.ts30
-rw-r--r--packages/website/ts/containers/contract_wrappers_documentation.ts24
-rw-r--r--packages/website/ts/containers/docs_home.ts31
-rw-r--r--packages/website/ts/containers/ethereum_types_documentation.ts10
-rw-r--r--packages/website/ts/containers/generate_order_form.ts2
-rw-r--r--packages/website/ts/containers/inputs/eth_amount_input.ts4
-rw-r--r--packages/website/ts/containers/json_schemas_documentation.ts56
-rw-r--r--packages/website/ts/containers/order_utils_documentation.ts25
-rw-r--r--packages/website/ts/containers/order_watcher_documentation.ts25
-rw-r--r--packages/website/ts/containers/portal.ts2
-rw-r--r--packages/website/ts/containers/portal_onboarding_flow.ts2
-rw-r--r--packages/website/ts/containers/smart_contracts_documentation.ts16
-rw-r--r--packages/website/ts/containers/sol_compiler_documentation.ts31
-rw-r--r--packages/website/ts/containers/sol_cov_documentation.ts32
-rw-r--r--packages/website/ts/containers/subproviders_documentation.ts30
-rw-r--r--packages/website/ts/containers/web3_wrapper_documentation.ts28
-rw-r--r--packages/website/ts/containers/wiki.ts3
-rw-r--r--packages/website/ts/containers/zero_ex_js_documentation.ts31
-rw-r--r--packages/website/ts/index.tsx10
-rw-r--r--packages/website/ts/local_storage/trade_history_storage.tsx4
-rw-r--r--packages/website/ts/pages/about/about.tsx8
-rw-r--r--packages/website/ts/pages/about/profile.tsx2
-rw-r--r--packages/website/ts/pages/documentation/developers_page.tsx202
-rw-r--r--packages/website/ts/pages/documentation/doc_page.tsx113
-rw-r--r--packages/website/ts/pages/documentation/docs_home.tsx385
-rw-r--r--packages/website/ts/pages/faq/faq.tsx2
-rw-r--r--packages/website/ts/pages/faq/question.tsx2
-rw-r--r--packages/website/ts/pages/fullscreen_message.tsx2
-rw-r--r--packages/website/ts/pages/jobs/jobs.tsx2
-rw-r--r--packages/website/ts/pages/jobs/join_0x.tsx2
-rw-r--r--packages/website/ts/pages/landing/landing.tsx17
-rw-r--r--packages/website/ts/pages/wiki/wiki.tsx233
-rw-r--r--packages/website/ts/redux/dispatcher.ts2
-rw-r--r--packages/website/ts/redux/reducer.ts4
-rw-r--r--packages/website/ts/schemas/validator.ts2
-rw-r--r--packages/website/ts/style/colors.ts2
-rw-r--r--packages/website/ts/types.ts48
-rw-r--r--packages/website/ts/utils/analytics.ts4
-rw-r--r--packages/website/ts/utils/constants.ts31
-rw-r--r--packages/website/ts/utils/doc_utils.ts6
-rw-r--r--packages/website/ts/utils/error_reporter.ts4
-rw-r--r--packages/website/ts/utils/fake_token_registry.ts879
-rw-r--r--packages/website/ts/utils/fetch_utils.ts2
-rw-r--r--packages/website/ts/utils/mui_theme.ts2
-rw-r--r--packages/website/ts/utils/order_parser.ts4
-rw-r--r--packages/website/ts/utils/token_address_overrides.ts2
-rw-r--r--packages/website/ts/utils/translate.ts17
-rw-r--r--packages/website/ts/utils/utils.ts25
-rw-r--r--packages/website/tsconfig.json4
-rw-r--r--packages/website/tslint.json2
-rw-r--r--python-packages/order_utils/LICENSE13
-rw-r--r--python-packages/order_utils/README.md45
-rwxr-xr-x[-rw-r--r--]python-packages/order_utils/setup.py140
-rw-r--r--python-packages/order_utils/src/conf.py10
-rw-r--r--python-packages/order_utils/src/doc_static/.gitkeep (renamed from packages/sra-report/coverage/.gitkeep)0
-rw-r--r--python-packages/order_utils/src/doc_templates/.gitkeep (renamed from python-packages/order_utils/src/zero_ex/py.typed)0
-rw-r--r--python-packages/order_utils/src/index.rst14
-rw-r--r--python-packages/order_utils/src/zero_ex/__init__.py1
-rw-r--r--python-packages/order_utils/src/zero_ex/contract_artifacts/__init__.py1
l---------python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts1
-rw-r--r--python-packages/order_utils/src/zero_ex/dev_utils/__init__.py1
-rw-r--r--python-packages/order_utils/src/zero_ex/dev_utils/abi_utils.py102
-rw-r--r--python-packages/order_utils/src/zero_ex/dev_utils/type_assertions.py58
-rw-r--r--python-packages/order_utils/src/zero_ex/order_utils/__init__.py12
-rw-r--r--python-packages/order_utils/src/zero_ex/order_utils/asset_data_utils.py143
-rw-r--r--python-packages/order_utils/src/zero_ex/order_utils/py.typed0
-rw-r--r--python-packages/order_utils/src/zero_ex/order_utils/signature_utils.py91
-rw-r--r--python-packages/order_utils/stubs/distutils/__init__.pyi0
-rw-r--r--python-packages/order_utils/stubs/distutils/command/__init__.pyi0
-rw-r--r--python-packages/order_utils/stubs/distutils/command/clean.pyi7
-rw-r--r--python-packages/order_utils/stubs/pytest/__init__.pyi0
-rw-r--r--python-packages/order_utils/stubs/pytest/raises.pyi1
-rw-r--r--python-packages/order_utils/stubs/setuptools/__init__.pyi8
-rw-r--r--python-packages/order_utils/stubs/setuptools/command/__init__.pyi0
-rw-r--r--python-packages/order_utils/stubs/setuptools/command/test.pyi3
-rw-r--r--python-packages/order_utils/stubs/web3/__init__.pyi26
-rw-r--r--python-packages/order_utils/stubs/web3/exceptions.pyi2
-rw-r--r--python-packages/order_utils/stubs/web3/utils/__init__.pyi0
-rw-r--r--python-packages/order_utils/stubs/web3/utils/datatypes.pyi3
-rw-r--r--python-packages/order_utils/test/test_abi_utils.py53
-rw-r--r--python-packages/order_utils/test/test_asset_data_utils.py72
-rw-r--r--python-packages/order_utils/test/test_doctest.py20
-rw-r--r--python-packages/order_utils/test/test_signature_utils.py130
-rw-r--r--python-packages/order_utils/tox.ini13
-rw-r--r--readthedocs.yaml7
-rw-r--r--requirements.readthedocs.txt1
-rw-r--r--tsconfig.json6
-rw-r--r--typedoc-tsconfig.json3
-rw-r--r--yarn.lock2229
1087 files changed, 30200 insertions, 62833 deletions
diff --git a/.circleci/config.yml b/.circleci/config.yml
index 876b861d3..0ab512f58 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -1,357 +1,353 @@
version: 2
jobs:
- build:
- resource_class: medium+
- docker:
- - image: circleci/node:9
- environment:
- CONTRACTS_COMMIT_HASH: '9ed05f5'
- working_directory: ~/repo
- steps:
- - checkout
- - run: echo 'export PATH=$HOME/CIRCLE_PROJECT_REPONAME/node_modules/.bin:$PATH' >> $BASH_ENV
- - run:
- name: install-yarn
- command: sudo npm install --global yarn@1.9.4
- - run:
- name: yarn
- command: yarn --frozen-lockfile install || yarn --frozen-lockfile install
- - run: yarn build:ci:no_website
- - save_cache:
- key: repo-{{ .Environment.CIRCLE_SHA1 }}
- paths:
- - ~/repo
- build-website:
- resource_class: medium+
- docker:
- - image: circleci/node:9
- working_directory: ~/repo
- steps:
- - restore_cache:
- keys:
- - repo-{{ .Environment.CIRCLE_SHA1 }}
- - run: cd packages/website && yarn build
- test-contracts-ganache:
- docker:
- - image: circleci/node:9
- working_directory: ~/repo
- steps:
- - restore_cache:
- keys:
- - repo-{{ .Environment.CIRCLE_SHA1 }}
- - run: yarn wsrun test:circleci contracts
- test-contracts-geth:
- docker:
- - image: circleci/node:9
- - image: 0xorg/devnet
- working_directory: ~/repo
- steps:
- - restore_cache:
- keys:
- - repo-{{ .Environment.CIRCLE_SHA1 }}
- # HACK(albrow): we need to sleep 10 seconds to ensure the devnet is
- # initialized
- - run: sleep 10 && TEST_PROVIDER=geth yarn wsrun test contracts
- test-publish:
- resource_class: medium+
- docker:
- - image: circleci/node:9
- - image: 0xorg/verdaccio
- working_directory: ~/repo
- steps:
- - restore_cache:
- keys:
- - repo-{{ .Environment.CIRCLE_SHA1 }}
- - run: yarn test:publish:circleci
- test-doc-generation:
- docker:
- - image: circleci/node:9
- working_directory: ~/repo
- steps:
- - restore_cache:
- keys:
- - repo-{{ .Environment.CIRCLE_SHA1 }}
- - run: yarn test:generate_docs:circleci
- test-rest:
- docker:
- - image: circleci/node:9
- working_directory: ~/repo
- steps:
- - restore_cache:
- keys:
- - repo-{{ .Environment.CIRCLE_SHA1 }}
- - run: yarn wsrun test:circleci @0xproject/abi-gen
- - run: yarn wsrun test:circleci @0xproject/assert
- - run: yarn wsrun test:circleci @0xproject/base-contract
- - run: yarn wsrun test:circleci @0xproject/connect
- - run: yarn wsrun test:circleci @0xproject/contract-wrappers
- - run: yarn wsrun test:circleci @0xproject/dev-utils
- - run: yarn wsrun test:circleci @0xproject/json-schemas
- - run: yarn wsrun test:circleci @0xproject/metacoin
- - run: yarn wsrun test:circleci @0xproject/order-utils
- - run: yarn wsrun test:circleci @0xproject/order-watcher
- - run: yarn wsrun test:circleci @0xproject/sol-compiler
- - run: yarn wsrun test:circleci @0xproject/sol-cov
- - run: yarn wsrun test:circleci @0xproject/sol-doc
- - run: yarn wsrun test:circleci @0xproject/sra-report
- - run: yarn wsrun test:circleci @0xproject/subproviders
- - run: yarn wsrun test:circleci @0xproject/web3-wrapper
- - run: yarn wsrun test:circleci @0xproject/utils
- - save_cache:
- key: coverage-abi-gen-{{ .Environment.CIRCLE_SHA1 }}
- paths:
- - ~/repo/packages/abi-gen/coverage/lcov.info
- - save_cache:
- key: coverage-assert-{{ .Environment.CIRCLE_SHA1 }}
- paths:
- - ~/repo/packages/assert/coverage/lcov.info
- - save_cache:
- key: coverage-base-contract-{{ .Environment.CIRCLE_SHA1 }}
- paths:
- - ~/repo/packages/base-contract/coverage/lcov.info
- - save_cache:
- key: coverage-connect-{{ .Environment.CIRCLE_SHA1 }}
- paths:
- - ~/repo/packages/connect/coverage/lcov.info
- - save_cache:
- key: coverage-contract-wrappers-{{ .Environment.CIRCLE_SHA1 }}
- paths:
- - ~/repo/packages/contract-wrappers/coverage/lcov.info
- - save_cache:
- key: coverage-dev-utils-{{ .Environment.CIRCLE_SHA1 }}
- paths:
- - ~/repo/packages/dev-utils/coverage/lcov.info
- - save_cache:
- key: coverage-json-schemas-{{ .Environment.CIRCLE_SHA1 }}
- paths:
- - ~/repo/packages/json-schemas/coverage/lcov.info
- - save_cache:
- key: coverage-metacoin-{{ .Environment.CIRCLE_SHA1 }}
- paths:
- - ~/repo/packages/metacoin/coverage/lcov.info
- - save_cache:
- key: coverage-order-utils-{{ .Environment.CIRCLE_SHA1 }}
- paths:
- - ~/repo/packages/order-utils/coverage/lcov.info
- - save_cache:
- key: coverage-order-watcher-{{ .Environment.CIRCLE_SHA1 }}
- paths:
- - ~/repo/packages/order-watcher/coverage/lcov.info
- - save_cache:
- key: coverage-sol-compiler-{{ .Environment.CIRCLE_SHA1 }}
- paths:
- - ~/repo/packages/sol-compiler/coverage/lcov.info
- - save_cache:
- key: coverage-sol-cov-{{ .Environment.CIRCLE_SHA1 }}
- paths:
- - ~/repo/packages/sol-cov/coverage/lcov.info
- - save_cache:
- key: coverage-sol-doc-{{ .Environment.CIRCLE_SHA1 }}
- paths:
- - ~/repo/packages/sol-doc/coverage/lcov.info
- - save_cache:
- key: coverage-sra-report-{{ .Environment.CIRCLE_SHA1 }}
- paths:
- - ~/repo/packages/sra-report/coverage/lcov.info
- - save_cache:
- key: coverage-subproviders-{{ .Environment.CIRCLE_SHA1 }}
- paths:
- - ~/repo/packages/subproviders/coverage/lcov.info
- - save_cache:
- key: coverage-web3-wrapper-{{ .Environment.CIRCLE_SHA1 }}
- paths:
- - ~/repo/packages/web3-wrapper/coverage/lcov.info
- test-python:
- working_directory: ~/repo
- docker:
- - image: circleci/python
- steps:
- - checkout
- - run: sudo chown -R circleci:circleci /usr/local/bin
- - run: sudo chown -R circleci:circleci /usr/local/lib/python3.7/site-packages
- - restore_cache:
- key: deps9-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
- - run:
- command: |
- cd python-packages/order_utils
- python -m ensurepip
- python -m pip install -e .[dev]
- - save_cache:
- key: deps9-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
- paths:
- - "/usr/local/bin"
- - "/usr/local/lib/python3.7/site-packages"
- - ".eggs"
- - ".mypy_cache"
- - ".pytest_cache"
- - ".tox"
- - run:
- command: |
- cd python-packages/order_utils
- coverage run setup.py test
- - save_cache:
- key: coverage-python-order-utils-{{ .Environment.CIRCLE_SHA1 }}
- paths:
- - ~/repo/python-packages/order_utils/.coverage
- test-rest-python:
- working_directory: ~/repo
- docker:
- - image: circleci/python
- steps:
- - checkout
- - run: sudo chown -R circleci:circleci /usr/local/bin
- - run: sudo chown -R circleci:circleci /usr/local/lib/python3.7/site-packages
- - restore_cache:
- key: deps9-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
- - run:
- command: |
- cd python-packages/order_utils
- python -m ensurepip
- python -m pip install -e .[dev]
- - save_cache:
- key: deps9-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
- paths:
- - "/usr/local/bin"
- - "/usr/local/lib/python3.7/site-packages"
- - ".eggs"
- - ".mypy_cache"
- - ".pytest_cache"
- - ".tox"
- - run:
- command: |
- cd python-packages/order_utils
- tox
- static-tests-python:
- working_directory: ~/repo
- docker:
- - image: circleci/python
- steps:
- - checkout
- - run: sudo chown -R circleci:circleci /usr/local/bin
- - run: sudo chown -R circleci:circleci /usr/local/lib/python3.7/site-packages
- - restore_cache:
- key: deps9-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
- - run:
- command: |
- cd python-packages/order_utils
- python -m ensurepip
- python -m pip install -e .[dev]
- - save_cache:
- key: deps9-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
- paths:
- - "/usr/local/bin"
- - "/usr/local/lib/python3.7/site-packages"
- - run:
- command: |
- cd python-packages/order_utils
- python setup.py lint
- static-tests:
- working_directory: ~/repo
- docker:
- - image: circleci/node:9
- steps:
- - restore_cache:
- keys:
- - repo-{{ .Environment.CIRCLE_SHA1 }}
- - run: yarn lerna run lint
- - run: yarn prettier:ci
- - run: cd packages/0x.js && yarn build:umd:prod
- - run: yarn bundlewatch
- submit-coverage:
- docker:
- - image: circleci/node:9
- working_directory: ~/repo
- steps:
- - restore_cache:
- keys:
- - repo-{{ .Environment.CIRCLE_SHA1 }}
- - restore_cache:
- keys:
- - coverage-abi-gen-{{ .Environment.CIRCLE_SHA1 }}
- - restore_cache:
- keys:
- - coverage-assert-{{ .Environment.CIRCLE_SHA1 }}
- - restore_cache:
- keys:
- - coverage-base-contract-{{ .Environment.CIRCLE_SHA1 }}
- - restore_cache:
- keys:
- - coverage-connect-{{ .Environment.CIRCLE_SHA1 }}
- - restore_cache:
- keys:
- - coverage-contract-wrappers-{{ .Environment.CIRCLE_SHA1 }}
- - restore_cache:
- keys:
- - coverage-dev-utils-{{ .Environment.CIRCLE_SHA1 }}
- - restore_cache:
- keys:
- - coverage-json-schemas-{{ .Environment.CIRCLE_SHA1 }}
- - restore_cache:
- keys:
- - coverage-metacoin-{{ .Environment.CIRCLE_SHA1 }}
- - restore_cache:
- keys:
- - coverage-order-utils-{{ .Environment.CIRCLE_SHA1 }}
- - restore_cache:
- keys:
- - coverage-order-watcher-{{ .Environment.CIRCLE_SHA1 }}
- - restore_cache:
- keys:
- - coverage-sol-compiler-{{ .Environment.CIRCLE_SHA1 }}
- - restore_cache:
- keys:
- - coverage-sol-cov-{{ .Environment.CIRCLE_SHA1 }}
- - restore_cache:
- keys:
- - coverage-sol-doc-{{ .Environment.CIRCLE_SHA1 }}
- - restore_cache:
- keys:
- - coverage-sra-report-{{ .Environment.CIRCLE_SHA1 }}
- - restore_cache:
- keys:
- - coverage-subproviders-{{ .Environment.CIRCLE_SHA1 }}
- - restore_cache:
- keys:
- - coverage-web3-wrapper-{{ .Environment.CIRCLE_SHA1 }}
- - restore_cache:
- keys:
- - coverage-contracts-{{ .Environment.CIRCLE_SHA1 }}
- - restore_cache:
- keys:
- - coverage-python-order-utils-{{ .Environment.CIRCLE_SHA1 }}
- - run: yarn report_coverage
+ build:
+ resource_class: medium+
+ docker:
+ - image: circleci/node:9
+ environment:
+ CONTRACTS_COMMIT_HASH: '9ed05f5'
+ working_directory: ~/repo
+ steps:
+ - checkout
+ - run: echo 'export PATH=$HOME/CIRCLE_PROJECT_REPONAME/node_modules/.bin:$PATH' >> $BASH_ENV
+ - run:
+ name: install-yarn
+ command: sudo npm install --global yarn@1.9.4
+ - run:
+ name: yarn
+ command: yarn --frozen-lockfile install || yarn --frozen-lockfile install
+ - run: yarn build:ci:no_website
+ - save_cache:
+ key: repo-{{ .Environment.CIRCLE_SHA1 }}
+ paths:
+ - ~/repo
+ build-website:
+ resource_class: medium+
+ docker:
+ - image: circleci/node:9
+ working_directory: ~/repo
+ steps:
+ - restore_cache:
+ keys:
+ - repo-{{ .Environment.CIRCLE_SHA1 }}
+ - run: cd packages/website && yarn build:prod
+ test-contracts-ganache:
+ docker:
+ - image: circleci/node:9
+ working_directory: ~/repo
+ steps:
+ - restore_cache:
+ keys:
+ - repo-{{ .Environment.CIRCLE_SHA1 }}
+ - run: yarn wsrun test:circleci contracts
+ test-contracts-geth:
+ docker:
+ - image: circleci/node:9
+ - image: 0xorg/devnet
+ working_directory: ~/repo
+ steps:
+ - restore_cache:
+ keys:
+ - repo-{{ .Environment.CIRCLE_SHA1 }}
+ # HACK(albrow): we need to sleep 10 seconds to ensure the devnet is
+ # initialized
+ - run: sleep 10 && TEST_PROVIDER=geth yarn wsrun test contracts
+ test-publish:
+ resource_class: medium+
+ docker:
+ - image: circleci/node:9
+ - image: 0xorg/verdaccio
+ working_directory: ~/repo
+ steps:
+ - restore_cache:
+ keys:
+ - repo-{{ .Environment.CIRCLE_SHA1 }}
+ - run: yarn test:publish:circleci
+ test-doc-generation:
+ docker:
+ - image: circleci/node:9
+ working_directory: ~/repo
+ steps:
+ - restore_cache:
+ keys:
+ - repo-{{ .Environment.CIRCLE_SHA1 }}
+ - run: yarn test:generate_docs:circleci
+ test-rest:
+ docker:
+ - image: circleci/node:9
+ working_directory: ~/repo
+ steps:
+ - restore_cache:
+ keys:
+ - repo-{{ .Environment.CIRCLE_SHA1 }}
+ - run: yarn wsrun test:circleci @0x/abi-gen
+ - run: yarn wsrun test:circleci @0x/assert
+ - run: yarn wsrun test:circleci @0x/base-contract
+ - run: yarn wsrun test:circleci @0x/connect
+ - run: yarn wsrun test:circleci @0x/contract-wrappers
+ - run: yarn wsrun test:circleci @0x/dev-utils
+ - run: yarn wsrun test:circleci @0x/json-schemas
+ - run: yarn wsrun test:circleci @0x/metacoin
+ - run: yarn wsrun test:circleci @0x/order-utils
+ - run: yarn wsrun test:circleci @0x/order-watcher
+ - run: yarn wsrun test:circleci @0x/sol-compiler
+ - run: yarn wsrun test:circleci @0x/sol-cov
+ - run: yarn wsrun test:circleci @0x/sol-doc
+ - run: yarn wsrun test:circleci @0x/subproviders
+ - run: yarn wsrun test:circleci @0x/web3-wrapper
+ - run: yarn wsrun test:circleci @0x/utils
+ - run: yarn wsrun test:circleci @0x/instant
+ - save_cache:
+ key: coverage-abi-gen-{{ .Environment.CIRCLE_SHA1 }}
+ paths:
+ - ~/repo/packages/abi-gen/coverage/lcov.info
+ - save_cache:
+ key: coverage-assert-{{ .Environment.CIRCLE_SHA1 }}
+ paths:
+ - ~/repo/packages/assert/coverage/lcov.info
+ - save_cache:
+ key: coverage-base-contract-{{ .Environment.CIRCLE_SHA1 }}
+ paths:
+ - ~/repo/packages/base-contract/coverage/lcov.info
+ - save_cache:
+ key: coverage-connect-{{ .Environment.CIRCLE_SHA1 }}
+ paths:
+ - ~/repo/packages/connect/coverage/lcov.info
+ - save_cache:
+ key: coverage-contract-wrappers-{{ .Environment.CIRCLE_SHA1 }}
+ paths:
+ - ~/repo/packages/contract-wrappers/coverage/lcov.info
+ - save_cache:
+ key: coverage-dev-utils-{{ .Environment.CIRCLE_SHA1 }}
+ paths:
+ - ~/repo/packages/dev-utils/coverage/lcov.info
+ - save_cache:
+ key: coverage-json-schemas-{{ .Environment.CIRCLE_SHA1 }}
+ paths:
+ - ~/repo/packages/json-schemas/coverage/lcov.info
+ - save_cache:
+ key: coverage-metacoin-{{ .Environment.CIRCLE_SHA1 }}
+ paths:
+ - ~/repo/packages/metacoin/coverage/lcov.info
+ - save_cache:
+ key: coverage-order-utils-{{ .Environment.CIRCLE_SHA1 }}
+ paths:
+ - ~/repo/packages/order-utils/coverage/lcov.info
+ - save_cache:
+ key: coverage-order-watcher-{{ .Environment.CIRCLE_SHA1 }}
+ paths:
+ - ~/repo/packages/order-watcher/coverage/lcov.info
+ - save_cache:
+ key: coverage-sol-compiler-{{ .Environment.CIRCLE_SHA1 }}
+ paths:
+ - ~/repo/packages/sol-compiler/coverage/lcov.info
+ - save_cache:
+ key: coverage-sol-cov-{{ .Environment.CIRCLE_SHA1 }}
+ paths:
+ - ~/repo/packages/sol-cov/coverage/lcov.info
+ - save_cache:
+ key: coverage-sol-doc-{{ .Environment.CIRCLE_SHA1 }}
+ paths:
+ - ~/repo/packages/sol-doc/coverage/lcov.info
+ - save_cache:
+ key: coverage-subproviders-{{ .Environment.CIRCLE_SHA1 }}
+ paths:
+ - ~/repo/packages/subproviders/coverage/lcov.info
+ - save_cache:
+ key: coverage-web3-wrapper-{{ .Environment.CIRCLE_SHA1 }}
+ paths:
+ - ~/repo/packages/web3-wrapper/coverage/lcov.info
+ test-python:
+ working_directory: ~/repo
+ docker:
+ - image: circleci/python
+ - image: 0xorg/ganache-cli
+ command: |
+ ganache-cli --gasLimit 10000000 --noVMErrorsOnRPCResponse --db /snapshot --noVMErrorsOnRPCResponse -p 8545 --networkId 50 -m "concert load couple harbor equip island argue ramp clarify fence smart topic"
+ steps:
+ - checkout
+ - run: sudo chown -R circleci:circleci /usr/local/bin
+ - run: sudo chown -R circleci:circleci /usr/local/lib/python3.7/site-packages
+ - restore_cache:
+ key: deps9-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
+ - run:
+ command: |
+ cd python-packages/order_utils
+ python -m ensurepip
+ python -m pip install -e .[dev]
+ - save_cache:
+ key: deps9-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
+ paths:
+ - '/usr/local/bin'
+ - '/usr/local/lib/python3.7/site-packages'
+ - '.eggs'
+ - '.mypy_cache'
+ - '.pytest_cache'
+ - '.tox'
+ - run:
+ command: |
+ cd python-packages/order_utils
+ coverage run setup.py test
+ - save_cache:
+ key: coverage-python-order-utils-{{ .Environment.CIRCLE_SHA1 }}
+ paths:
+ - ~/repo/python-packages/order_utils/.coverage
+ test-rest-python:
+ working_directory: ~/repo
+ docker:
+ - image: circleci/python
+ steps:
+ - checkout
+ - run: sudo chown -R circleci:circleci /usr/local/bin
+ - run: sudo chown -R circleci:circleci /usr/local/lib/python3.7/site-packages
+ - restore_cache:
+ key: deps9-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
+ - run:
+ command: |
+ cd python-packages/order_utils
+ python -m ensurepip
+ python -m pip install -e .[dev]
+ - save_cache:
+ key: deps9-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
+ paths:
+ - '/usr/local/bin'
+ - '/usr/local/lib/python3.7/site-packages'
+ - '.eggs'
+ - '.mypy_cache'
+ - '.pytest_cache'
+ - '.tox'
+ - run:
+ command: |
+ cd python-packages/order_utils
+ tox
+ static-tests-python:
+ working_directory: ~/repo
+ docker:
+ - image: circleci/python
+ steps:
+ - checkout
+ - run: sudo chown -R circleci:circleci /usr/local/bin
+ - run: sudo chown -R circleci:circleci /usr/local/lib/python3.7/site-packages
+ - restore_cache:
+ key: deps9-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
+ - run:
+ command: |
+ cd python-packages/order_utils
+ python -m ensurepip
+ python -m pip install -e .[dev]
+ - save_cache:
+ key: deps9-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
+ paths:
+ - '/usr/local/bin'
+ - '/usr/local/lib/python3.7/site-packages'
+ - run:
+ command: |
+ cd python-packages/order_utils
+ python setup.py lint
+ static-tests:
+ working_directory: ~/repo
+ docker:
+ - image: circleci/node:9
+ steps:
+ - restore_cache:
+ keys:
+ - repo-{{ .Environment.CIRCLE_SHA1 }}
+ - run: yarn lerna run lint
+ - run: yarn prettier:ci
+ - run: cd packages/0x.js && yarn build:umd:prod
+ - run: yarn bundlewatch
+ submit-coverage:
+ docker:
+ - image: circleci/node:9
+ working_directory: ~/repo
+ steps:
+ - restore_cache:
+ keys:
+ - repo-{{ .Environment.CIRCLE_SHA1 }}
+ - restore_cache:
+ keys:
+ - coverage-abi-gen-{{ .Environment.CIRCLE_SHA1 }}
+ - restore_cache:
+ keys:
+ - coverage-assert-{{ .Environment.CIRCLE_SHA1 }}
+ - restore_cache:
+ keys:
+ - coverage-base-contract-{{ .Environment.CIRCLE_SHA1 }}
+ - restore_cache:
+ keys:
+ - coverage-connect-{{ .Environment.CIRCLE_SHA1 }}
+ - restore_cache:
+ keys:
+ - coverage-contract-wrappers-{{ .Environment.CIRCLE_SHA1 }}
+ - restore_cache:
+ keys:
+ - coverage-dev-utils-{{ .Environment.CIRCLE_SHA1 }}
+ - restore_cache:
+ keys:
+ - coverage-json-schemas-{{ .Environment.CIRCLE_SHA1 }}
+ - restore_cache:
+ keys:
+ - coverage-metacoin-{{ .Environment.CIRCLE_SHA1 }}
+ - restore_cache:
+ keys:
+ - coverage-order-utils-{{ .Environment.CIRCLE_SHA1 }}
+ - restore_cache:
+ keys:
+ - coverage-order-watcher-{{ .Environment.CIRCLE_SHA1 }}
+ - restore_cache:
+ keys:
+ - coverage-sol-compiler-{{ .Environment.CIRCLE_SHA1 }}
+ - restore_cache:
+ keys:
+ - coverage-sol-cov-{{ .Environment.CIRCLE_SHA1 }}
+ - restore_cache:
+ keys:
+ - coverage-sol-doc-{{ .Environment.CIRCLE_SHA1 }}
+ - restore_cache:
+ keys:
+ - coverage-subproviders-{{ .Environment.CIRCLE_SHA1 }}
+ - restore_cache:
+ keys:
+ - coverage-web3-wrapper-{{ .Environment.CIRCLE_SHA1 }}
+ - restore_cache:
+ keys:
+ - coverage-contracts-{{ .Environment.CIRCLE_SHA1 }}
+ - restore_cache:
+ keys:
+ - coverage-python-order-utils-{{ .Environment.CIRCLE_SHA1 }}
+ - run: yarn report_coverage
workflows:
- version: 2
- main:
- jobs:
- - build
- - build-website:
- requires:
+ version: 2
+ main:
+ jobs:
- build
- - test-contracts-ganache:
- requires:
- - build
- - test-contracts-geth:
- requires:
- - build
- - test-rest:
- requires:
- - build
- - static-tests:
- requires:
- - build
- - test-publish:
- requires:
- - build
- - test-doc-generation:
- requires:
- - build
- - submit-coverage:
- requires:
- - test-rest
+ - build-website:
+ requires:
+ - build
+ - test-contracts-ganache:
+ requires:
+ - build
+ - test-contracts-geth:
+ requires:
+ - build
+ - test-rest:
+ requires:
+ - build
+ - static-tests:
+ requires:
+ - build
+ - test-publish:
+ requires:
+ - build
+ - test-doc-generation:
+ requires:
+ - build
+ - submit-coverage:
+ requires:
+ - test-rest
+ - test-python
- test-python
- - test-python
- - static-tests-python
- # skip python tox run for now, as we don't yet have multiple test environments to support.
- #- test-rest-python
+ - static-tests-python
+ # skip python tox run for now, as we don't yet have multiple test environments to support.
+ #- test-rest-python
diff --git a/.gitattributes b/.gitattributes
index 52031de51..f885b0127 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1 +1,7 @@
*.sol linguist-language=Solidity
+
+# Automatically collapse generated files in GitHub.
+*.svg linguist-generated
+packages/contract-artifacts/artifacts/*json linguist-generated
+packages/abi-gen-wrappers/wrappers/*.ts liguist-generated
+
diff --git a/.gitignore b/.gitignore
index 6143dedb0..9e43f20b0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -79,30 +79,14 @@ packages/react-docs/example/public/bundle*
packages/testnet-faucets/server/
# generated contract artifacts/
+packages/contracts/generated-artifacts/
packages/sol-cov/test/fixtures/artifacts/
packages/metacoin/artifacts/
-packages/order-watcher/test/artifacts/
-packages/contract-wrappers/test/artifacts/
-packages/contract-wrappers/src/artifacts/
-packages/order-watcher/src/artifacts/
-packages/0x.js/src/artifacts/
-packages/order-utils/src/artifacts/
-
-# unstable generated contract artifacts:
-packages/migrations/artifacts/development/
-
-# generated contract watcher
-packages/0x.js/src/generated_contract_wrappers/
-packages/contracts/generated_contract_wrappers/
-packages/contract-wrappers/src/contract_wrappers/generated/
+
+# generated contract wrappers
+packages/abi-gen-wrappers/wrappers
+packages/contracts/generated-wrappers/
packages/metacoin/src/contract_wrappers
-packages/fill-scenarios/src/generated_contract_wrappers/
-packages/order-watcher/src/generated_contract_wrappers/
-packages/order-utils/src/generated_contract_wrappers/
-packages/migrations/src/1.0.0/contract_wrappers
-packages/migrations/src/2.0.0-testnet/contract_wrappers
-packages/migrations/src/2.0.0/contract_wrappers
-packages/migrations/src/development/contract_wrappers
# solc-bin in sol-compiler
packages/sol-compiler/solc_bin/
@@ -115,6 +99,7 @@ packages/*/scripts/
.mypy_cache
.tox
python-packages/*/build
+python-packages/*/dist
__pycache__
python-packages/*/src/*.egg-info
python-packages/*/.coverage
diff --git a/.prettierignore b/.prettierignore
index 5d3e33770..7ef0f6735 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -1,27 +1,14 @@
lib
.nyc_output
-/packages/contract-wrappers/src/contract_wrappers/generated/
+/packages/contracts/generated-wrappers
+/packages/contracts/generated-artifacts
+/packages/abi-gen-wrappers/src/generated-wrappers
+/packages/contract-artifacts/artifacts
+/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts
+/packages/json-schemas/schemas
/packages/metacoin/src/contract_wrappers
-/packages/0x.js/src/generated_contract_wrappers/
-/packages/contracts/generated_contract_wrappers/
-/packages/fill-scenarios/src/generated_contract_wrappers/
-/packages/order-watcher/src/generated_contract_wrappers/
-/packages/order-utils/src/generated_contract_wrappers/
-/packages/migrations/src/1.0.0/contract_wrappers
-/packages/migrations/src/2.0.0-testnet/contract_wrappers
-/packages/migrations/src/2.0.0/contract_wrappers
-/packages/0x.js/src/artifacts
-/packages/contracts/src/artifacts
-/packages/contract-wrappers/src/artifacts
-/packages/order-watcher/src/artifacts
/packages/metacoin/artifacts
/packages/sra-spec/public/
-/packages/contract-wrappers/test/artifacts
-/packages/order-watcher/test/artifacts
-/packages/migrations/artifacts/1.0.0
-/packages/migrations/artifacts/2.0.0-testnet
-/packages/migrations/artifacts/2.0.0
-/packages/migrations/artifacts/development
package.json
scripts/postpublish_utils.js
packages/sol-cov/test/fixtures/artifacts
diff --git a/CODEOWNERS b/CODEOWNERS
index 9f9ba666e..3cf75fb2d 100644
--- a/CODEOWNERS
+++ b/CODEOWNERS
@@ -5,4 +5,31 @@
# https://git-scm.com/docs/gitignore#_pattern_format
# Website
-packages/website/ @BMillman19 @fragosti
+packages/asset-buyer/ @BMillman19 @fragosti @steveklebanoff
+packages/instant/ @BMillman19 @fragosti @steveklebanoff
+packages/website/ @BMillman19 @fragosti @fabioberger @steveklebanoff
+
+# Dev tools & setup
+.circleci/ @LogvinovLeon
+packages/abi-gen/ @LogvinovLeon
+packages/base-contract/ @LogvinovLeon
+packages/connect/ @fragosti
+packages/contract_templates/ @LogvinovLeon
+packages/contract-addresses/ @albrow
+packages/contract-artifacts/ @albrow
+packages/dev-utils/ @LogvinovLeon @fabioberger
+packages/devnet/ @albrow
+packages/ethereum-types/ @LogvinovLeon
+packages/metacoin/ @LogvinovLeon
+packages/monorepo-scripts/ @fabioberger
+packages/order-utils/ @fabioberger @LogvinovLeon
+packages/sol-compiler/ @LogvinovLeon
+packages/sol-cov/ @LogvinovLeon
+packages/sol-resolver/ @LogvinovLeon
+packages/subproviders/ @fabioberger @dekz
+packages/verdaccio/ @albrow
+packages/web3-wrapper/ @LogvinovLeon @fabioberger
+python-packages/ @feuGeneA
+
+# Protocol/smart contracts
+packages/contracts/test/ @albrow
diff --git a/README.md b/README.md
index d850d5703..5ceae41ba 100644
--- a/README.md
+++ b/README.md
@@ -20,39 +20,46 @@ If you're developing on 0x now or are interested in using 0x infrastructure in t
### Published Packages
-| Package | Version | Description |
-| --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
-| [`0x.js`](/packages/0x.js) | [![npm](https://img.shields.io/npm/v/0x.js.svg)](https://www.npmjs.com/package/0x.js) | A Javascript library for interacting with the 0x protocol |
-| [`@0xproject/abi-gen`](/packages/abi-gen) | [![npm](https://img.shields.io/npm/v/@0xproject/abi-gen.svg)](https://www.npmjs.com/package/@0xproject/abi-gen) | Tool to generate TS wrappers from smart contract ABIs |
-| [`@0xproject/assert`](/packages/assert) | [![npm](https://img.shields.io/npm/v/@0xproject/assert.svg)](https://www.npmjs.com/package/@0xproject/assert) | Type and schema assertions used by our packages |
-| [`@0xproject/asset-buyer`](/packages/asset-buyer) | [![npm](https://img.shields.io/npm/v/@0xproject/asset-buyer.svg)](https://www.npmjs.com/package/@0xproject/asset-buyer) | Convenience package for discovering and buying assets with Ether. |
-| [`@0xproject/base-contract`](/packages/base-contract) | [![npm](https://img.shields.io/npm/v/@0xproject/base-contract.svg)](https://www.npmjs.com/package/@0xproject/base-contract) | BaseContract used by auto-generated `abi-gen` wrapper contracts |
-| [`@0xproject/connect`](/packages/connect) | [![npm](https://img.shields.io/npm/v/@0xproject/connect.svg)](https://www.npmjs.com/package/@0xproject/connect) | A Javascript library for interacting with the Standard Relayer API |
-| [`@0xproject/dev-utils`](/packages/dev-utils) | [![npm](https://img.shields.io/npm/v/@0xproject/dev-utils.svg)](https://www.npmjs.com/package/@0xproject/dev-utils) | Dev utils to be shared across 0x projects and packages |
-| [`@0xproject/json-schemas`](/packages/json-schemas) | [![npm](https://img.shields.io/npm/v/@0xproject/json-schemas.svg)](https://www.npmjs.com/package/@0xproject/json-schemas) | 0x-related json schemas |
-| [`@0xproject/monorepo-scripts`](/packages/monorepo-scripts) | [![npm](https://img.shields.io/npm/v/@0xproject/monorepo-scripts.svg)](https://www.npmjs.com/package/@0xproject/monorepo-scripts) | Monorepo scripts |
-| [`@0xproject/order-utils`](/packages/order-utils) | [![npm](https://img.shields.io/npm/v/@0xproject/order-utils.svg)](https://www.npmjs.com/package/@0xproject/order-utils) | A set of utilities for generating, parsing, signing and validating 0x orders. |
-| [`@0xproject/react-docs`](/packages/react-docs) | [![npm](https://img.shields.io/npm/v/@0xproject/react-docs.svg)](https://www.npmjs.com/package/@0xproject/react-docs) | React documentation component for rendering TypeDoc & Doxity generated JSON |
-| [`@0xproject/react-shared`](/packages/react-shared) | [![npm](https://img.shields.io/npm/v/@0xproject/react-shared.svg)](https://www.npmjs.com/package/@0xproject/react-shared) | 0x shared react components |
-| [`@0xproject/sol-compiler`](/packages/sol-compiler) | [![npm](https://img.shields.io/npm/v/@0xproject/sol-compiler.svg)](https://www.npmjs.com/package/@0xproject/sol-compiler) | A thin wrapper around Solc.js that outputs artifacts, resolves imports, only re-compiles when needed, and other niceties. |
-| [`@0xproject/sol-cov`](/packages/sol-cov) | [![npm](https://img.shields.io/npm/v/@0xproject/sol-cov.svg)](https://www.npmjs.com/package/@0xproject/sol-cov) | Solidity test coverage tool |
-| [`@0xproject/sra-spec`](/packages/sra-spec) | [![npm](https://img.shields.io/npm/v/@0xproject/sra-spec.svg)](https://www.npmjs.com/package/@0xproject/sra-spec) | OpenAPI specification for the standard relayer API |
-| [`@0xproject/sra-report`](/packages/sra-report) | [![npm](https://img.shields.io/npm/v/@0xproject/sra-report.svg)](https://www.npmjs.com/package/@0xproject/sra-report) | Generate reports for standard relayer API compliance |
-| [`@0xproject/subproviders`](/packages/subproviders) | [![npm](https://img.shields.io/npm/v/@0xproject/subproviders.svg)](https://www.npmjs.com/package/@0xproject/subproviders) | Useful web3 subproviders (e.g LedgerSubprovider) |
-| [`@0xproject/tslint-config`](/packages/tslint-config) | [![npm](https://img.shields.io/npm/v/@0xproject/tslint-config.svg)](https://www.npmjs.com/package/@0xproject/tslint-config) | Custom 0x development TSLint rules |
-| [`@0xproject/types`](/packages/types) | [![npm](https://img.shields.io/npm/v/@0xproject/types.svg)](https://www.npmjs.com/package/@0xproject/types) | Shared type declarations |
-| [`@0xproject/typescript-typings`](/packages/typescript-typings) | [![npm](https://img.shields.io/npm/v/@0xproject/typescript-typings.svg)](https://www.npmjs.com/package/@0xproject/typescript-typings) | Repository of types for external packages |
-| [`@0xproject/utils`](/packages/utils) | [![npm](https://img.shields.io/npm/v/@0xproject/utils.svg)](https://www.npmjs.com/package/@0xproject/utils) | Shared utilities |
-| [`@0xproject/web3-wrapper`](/packages/web3-wrapper) | [![npm](https://img.shields.io/npm/v/@0xproject/web3-wrapper.svg)](https://www.npmjs.com/package/@0xproject/web3-wrapper) | Web3 wrapper |
+| Package | Version | Description |
+| -------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
+| [`0x.js`](/packages/0x.js) | [![npm](https://img.shields.io/npm/v/0x.js.svg)](https://www.npmjs.com/package/0x.js) | A Javascript library for interacting with the 0x protocol |
+| [`@0x/abi-gen`](/packages/abi-gen) | [![npm](https://img.shields.io/npm/v/@0x/abi-gen.svg)](https://www.npmjs.com/package/@0x/abi-gen) | Tool to generate TS wrappers from smart contract ABIs |
+| [`@0x/abi-gen-wrappers`](/packages/abi-gen-wrappers) | [![npm](https://img.shields.io/npm/v/@0x/abi-gen-wrappers.svg)](https://www.npmjs.com/package/@0x/abi-gen-wrappers) | Low-level 0x smart contract wrappers generated using @0x/abi-gen |
+| [`@0x/assert`](/packages/assert) | [![npm](https://img.shields.io/npm/v/@0x/assert.svg)](https://www.npmjs.com/package/@0x/assert) | Type and schema assertions used by our packages |
+| [`@0x/asset-buyer`](/packages/asset-buyer) | [![npm](https://img.shields.io/npm/v/@0x/asset-buyer.svg)](https://www.npmjs.com/package/@0x/asset-buyer) | Convenience package for discovering and buying assets with Ether |
+| [`@0x/base-contract`](/packages/base-contract) | [![npm](https://img.shields.io/npm/v/@0x/base-contract.svg)](https://www.npmjs.com/package/@0x/base-contract) | BaseContract used by auto-generated `abi-gen` wrapper contracts |
+| [`@0x/connect`](/packages/connect) | [![npm](https://img.shields.io/npm/v/@0x/connect.svg)](https://www.npmjs.com/package/@0x/connect) | A Javascript library for interacting with the Standard Relayer API |
+| [`@0x/contract-addresses`](/packages/contract-addresses) | [![npm](https://img.shields.io/npm/v/@0x/contract-addresses.svg)](https://www.npmjs.com/package/@0x/contract-addresses) | Used to get known addresses of deployed 0x contracts |
+| [`@0x/contract-artifacts`](/packages/contract-artifacts) | [![npm](https://img.shields.io/npm/v/@0x/contract-artifacts.svg)](https://www.npmjs.com/package/@0x/contract-artifacts) | 0x smart contract compilation artifacts |
+| [`@0x/contract-wrappers`](/packages/contract-wrappers) | [![npm](https://img.shields.io/npm/v/@0x/contract-wrappers.svg)](https://www.npmjs.com/package/@0x/contract-wrappers) | Smart TS wrappers for 0x smart contracts |
+| [`@0x/dev-utils`](/packages/dev-utils) | [![npm](https://img.shields.io/npm/v/@0x/dev-utils.svg)](https://www.npmjs.com/package/@0x/dev-utils) | Dev utils to be shared across 0x projects and packages |
+| [`@0x/fill-scenarios`](/packages/fill-scenarios) | [![npm](https://img.shields.io/npm/v/@0x/fill-scenarios.svg)](https://www.npmjs.com/package/@0x/fill-scenarios) | 0x order fill scenario generation |
+| [`@0x/json-schemas`](/packages/json-schemas) | [![npm](https://img.shields.io/npm/v/@0x/json-schemas.svg)](https://www.npmjs.com/package/@0x/json-schemas) | 0x-related json schemas |
+| [`@0x/migrations`](/packages/migrations) | [![npm](https://img.shields.io/npm/v/@0x/migrations.svg)](https://www.npmjs.com/package/@0x/migrations) | 0x smart contract migrations |
+| [`@0x/order-utils`](/packages/order-utils) | [![npm](https://img.shields.io/npm/v/@0x/order-utils.svg)](https://www.npmjs.com/package/@0x/order-utils) | A set of utilities for generating, parsing, signing and validating 0x orders |
+| [`@0x/order-watcher`](/packages/order-watcher) | [![npm](https://img.shields.io/npm/v/@0x/order-watcher.svg)](https://www.npmjs.com/package/@0x/order-watcher) | An order watcher daemon that watches for order validity |
+| [`@0x/react-docs`](/packages/react-docs) | [![npm](https://img.shields.io/npm/v/@0x/react-docs.svg)](https://www.npmjs.com/package/@0x/react-docs) | React documentation component for rendering TypeDoc & Doxity generated JSON |
+| [`@0x/react-shared`](/packages/react-shared) | [![npm](https://img.shields.io/npm/v/@0x/react-shared.svg)](https://www.npmjs.com/package/@0x/react-shared) | 0x shared react components |
+| [`@0x/sol-compiler`](/packages/sol-compiler) | [![npm](https://img.shields.io/npm/v/@0x/sol-compiler.svg)](https://www.npmjs.com/package/@0x/sol-compiler) | A thin wrapper around Solc.js that outputs artifacts, resolves imports, only re-compiles when needed, and other niceties |
+| [`@0x/sol-cov`](/packages/sol-cov) | [![npm](https://img.shields.io/npm/v/@0x/sol-cov.svg)](https://www.npmjs.com/package/@0x/sol-cov) | Solidity test coverage tool |
+| [`@0x/sol-doc`](/packages/sol-doc) | [![npm](https://img.shields.io/npm/v/@0x/sol-doc.svg)](https://www.npmjs.com/package/@0x/sol-doc) | Solidity documentation generator |
+| [`@0x/sol-resolver`](/packages/sol-resolver) | [![npm](https://img.shields.io/npm/v/@0x/sol-resolver.svg)](https://www.npmjs.com/package/@0x/sol-resolver) | Import resolver for smart contracts dependencies |
+| [`@0x/sra-spec`](/packages/sra-spec) | [![npm](https://img.shields.io/npm/v/@0x/sra-spec.svg)](https://www.npmjs.com/package/@0x/sra-spec) | OpenAPI specification for the standard relayer API |
+| [`@0x/subproviders`](/packages/subproviders) | [![npm](https://img.shields.io/npm/v/@0x/subproviders.svg)](https://www.npmjs.com/package/@0x/subproviders) | Useful web3 subproviders (e.g. LedgerSubprovider) |
+| [`@0x/tslint-config`](/packages/tslint-config) | [![npm](https://img.shields.io/npm/v/@0x/tslint-config.svg)](https://www.npmjs.com/package/@0x/tslint-config) | Custom 0x development TSLint rules |
+| [`@0x/types`](/packages/types) | [![npm](https://img.shields.io/npm/v/@0x/types.svg)](https://www.npmjs.com/package/@0x/types) | Shared type declarations |
+| [`@0x/typescript-typings`](/packages/typescript-typings) | [![npm](https://img.shields.io/npm/v/@0x/typescript-typings.svg)](https://www.npmjs.com/package/@0x/typescript-typings) | Repository of types for external packages |
+| [`@0x/utils`](/packages/utils) | [![npm](https://img.shields.io/npm/v/@0x/utils.svg)](https://www.npmjs.com/package/@0x/utils) | Shared utilities |
+| [`@0x/web3-wrapper`](/packages/web3-wrapper) | [![npm](https://img.shields.io/npm/v/@0x/web3-wrapper.svg)](https://www.npmjs.com/package/@0x/web3-wrapper) | Web3 wrapper |
### Private Packages
-| Package | Description |
-| --------------------------------------------------------------- | ---------------------------------------------------------------- |
-| [`@0xproject/contracts`](/packages/contracts) | 0x solidity smart contracts & tests |
-| [`@0xproject/react-docs-example`](/packages/react-docs-example) | Example documentation site created with `@0xproject/react-docs` |
-| [`@0xproject/testnet-faucets`](/packages/testnet-faucets) | A faucet micro-service that dispenses test ERC20 tokens or Ether |
-| [`@0xproject/website`](/packages/website) | 0x website & Portal DApp |
+| Package | Description |
+| -------------------------------------------------------- | ---------------------------------------------------------------- |
+| [`@0x/contracts`](/packages/contracts) | 0x solidity smart contracts & tests |
+| [`@0x/react-docs-example`](/packages/react-docs-example) | Example documentation site created with `@0x/react-docs` |
+| [`@0x/testnet-faucets`](/packages/testnet-faucets) | A faucet micro-service that dispenses test ERC20 tokens or Ether |
+| [`@0x/website`](/packages/website) | 0x website & Portal DApp |
## Usage
@@ -71,10 +78,10 @@ Dedicated documentation pages:
Node version >= 6.12 is required.
Most of the packages require additional typings for external dependencies.
-You can include those by prepending the `@0xproject/typescript-typings` package to your [`typeRoots`](http://www.typescriptlang.org/docs/handbook/tsconfig-json.html) config.
+You can include those by prepending the `@0x/typescript-typings` package to your [`typeRoots`](http://www.typescriptlang.org/docs/handbook/tsconfig-json.html) config.
```json
-"typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"],
+"typeRoots": ["node_modules/@0x/typescript-typings/types", "node_modules/@types"],
```
## Contributing
@@ -87,6 +94,10 @@ We strongly recommend that the community help us make improvements and determine
Make sure you are using Yarn v1.9.4. To install using brew:
+```bash
+brew install yarn@1.9.4
+```
+
Then install dependencies
```bash
@@ -104,7 +115,7 @@ yarn build
To build a specific package:
```bash
-PKG=@0xproject/web3-wrapper yarn build
+PKG=@0x/web3-wrapper yarn build
```
### Watch
@@ -121,7 +132,7 @@ To watch a specific package and all it's dependent packages:
PKG=[NPM_PACKAGE_NAME] yarn watch
e.g
-PKG=@0xproject/web3-wrapper yarn watch
+PKG=@0x/web3-wrapper yarn watch
```
### Clean
@@ -177,5 +188,5 @@ yarn test
Run a specific package's test:
```bash
-PKG=@0xproject/web3-wrapper yarn test
+PKG=@0x/web3-wrapper yarn test
```
diff --git a/package.json b/package.json
index e6ae0ebde..e598ac2d3 100644
--- a/package.json
+++ b/package.json
@@ -14,7 +14,6 @@
"report_coverage": "lcov-result-merger './{packages/*/coverage/lcov.info,python-packages/*/.coverage}' | coveralls",
"test:installation": "node ./packages/monorepo-scripts/lib/test_installation.js",
"test:installation:local": "IS_LOCAL_PUBLISH=true node ./packages/monorepo-scripts/lib/test_installation.js",
- "test:publish:circleci:comment": "HACK(albrow) We need an automated way to login to npm and echo+sleep piped to stdin was the only way I could find to do it.",
"test:publish:circleci": "yarn npm-cli-login -u test -p test -e test@example.com -r http://localhost:4873 && IS_LOCAL_PUBLISH=true run-s script:publish test:installation:local",
"run:publish": "run-s install:all build:monorepo_scripts script:prepublish_checks rebuild:no_website script:publish",
"run:publish:local": "IS_LOCAL_PUBLISH=true yarn run:publish",
@@ -24,9 +23,9 @@
"wsrun": "wsrun",
"lerna": "lerna",
"build": "wsrun build $PKG --fast-exit -r --stages",
- "build:no_website": "wsrun build $PKG --fast-exit -r --stages --exclude @0xproject/website",
- "build:ci:no_website": "wsrun build:ci $PKG --fast-exit -r --stages --exclude @0xproject/website",
- "build:monorepo_scripts": "PKG=@0xproject/monorepo-scripts yarn build",
+ "build:no_website": "wsrun build $PKG --fast-exit -r --stages --exclude @0x/website",
+ "build:ci:no_website": "wsrun build:ci $PKG --fast-exit -r --stages --exclude @0x/website",
+ "build:monorepo_scripts": "PKG=@0x/monorepo-scripts yarn build",
"build:ts": "tsc -b",
"watch:ts": "tsc -b -w",
"clean": "wsrun clean $PKG --fast-exit -r --parallel",
@@ -41,9 +40,9 @@
},
"config": {
"mnemonic": "concert load couple harbor equip island argue ramp clarify fence smart topic",
- "packagesWithDocPages": "0x.js connect json-schemas subproviders web3-wrapper contract-wrappers order-utils order-watcher sol-compiler sol-cov ethereum-types"
+ "packagesWithDocPages": "0x.js connect json-schemas subproviders web3-wrapper contract-wrappers order-utils order-watcher sol-compiler sol-cov ethereum-types asset-buyer"
},
- "bundlewatch" : {
+ "bundlewatch": {
"files": [
{
"path": "packages/0x.js/_bundles/index.min.js",
@@ -51,22 +50,26 @@
},
{
"path": "packages/instant/public/main.bundle.js",
- "maxSize": "350kB"
+ "maxSize": "1000kB"
}
],
"ci": {
- "trackBranches": ["master", "development"],
+ "trackBranches": [
+ "master",
+ "development"
+ ],
"repoBranchBase": "development"
}
},
"devDependencies": {
"@0x-lerna-fork/lerna": "3.0.0-beta.25",
+ "@0xproject/npm-cli-login": "^0.0.11",
"async-child-process": "^1.1.1",
"bundlewatch": "^0.2.1",
"coveralls": "^3.0.0",
"ganache-cli": "6.1.8",
"lcov-result-merger": "^3.0.0",
- "npm-cli-login": "^0.0.10",
+ "lerna": "^3.0.0-beta.25",
"npm-run-all": "^4.1.2",
"prettier": "^1.11.1",
"source-map-support": "^0.5.6",
diff --git a/packages/0x.js/CHANGELOG.json b/packages/0x.js/CHANGELOG.json
index 6dfcc3d33..7d9cb8312 100644
--- a/packages/0x.js/CHANGELOG.json
+++ b/packages/0x.js/CHANGELOG.json
@@ -1,5 +1,14 @@
[
{
+ "version": "2.0.1",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ],
+ "timestamp": 1541740904
+ },
+ {
"version": "2.0.0",
"changes": [
{
@@ -15,8 +24,22 @@
"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",
+ "pr": 1105
+ },
+ {
+ "note": "Make web3-provider-engine types a 'dependency' so it's available to users of the library",
+ "pr": 1105
+ },
+ {
+ "note": "Export new `AssetData` type from types",
+ "pr": 1131
}
- ]
+ ],
+ "timestamp": 1539871071
},
{
"version": "1.0.8",
diff --git a/packages/0x.js/CHANGELOG.md b/packages/0x.js/CHANGELOG.md
index 27702413d..d312b2c9b 100644
--- a/packages/0x.js/CHANGELOG.md
+++ b/packages/0x.js/CHANGELOG.md
@@ -5,6 +5,19 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
+## v2.0.1 - _November 9, 2018_
+
+ * Dependencies updated
+
+## v2.0.0 - _October 18, 2018_
+
+ * Add support for `eth_signTypedData`. (#1102)
+ * Added `MetamaskSubprovider` to handle inconsistencies in Metamask's signing JSON RPC endpoints. (#1102)
+ * Removed `SignerType` (including `SignerType.Metamask`). Please use the `MetamaskSubprovider` to wrap `web3.currentProvider`. (#1102)
+ * Updated to use new modularized artifacts and the latest version of @0xproject/contract-wrappers (#1105)
+ * Make web3-provider-engine types a 'dependency' so it's available to users of the library (#1105)
+ * Export new `AssetData` type from types (#1131)
+
## v1.0.8 - _October 4, 2018_
* Dependencies updated
@@ -49,7 +62,7 @@ CHANGELOG
* 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` (#963)
-## v1.0.1-rc.3 - _August 13, 2018_
+## v1.0.1-rc.3 - _August 14, 2018_
* Dependencies updated
* Update ecSignOrderHashAsync to return the signature as a string for immediate use in contracts (#914)
diff --git a/packages/0x.js/README.md b/packages/0x.js/README.md
index 329037324..5b7a2308c 100644
--- a/packages/0x.js/README.md
+++ b/packages/0x.js/README.md
@@ -33,7 +33,7 @@ If your project is in [TypeScript](https://www.typescriptlang.org/), add the fol
```json
"compilerOptions": {
- "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"],
+ "typeRoots": ["node_modules/@0x/typescript-typings/types", "node_modules/@types"],
}
```
diff --git a/packages/0x.js/package.json b/packages/0x.js/package.json
index 1a57edd45..38478980f 100644
--- a/packages/0x.js/package.json
+++ b/packages/0x.js/package.json
@@ -1,6 +1,6 @@
{
"name": "0x.js",
- "version": "1.0.8",
+ "version": "2.0.1",
"engines": {
"node": ">=6.12"
},
@@ -18,7 +18,7 @@
"build": "yarn build:all",
"build:ci": "yarn build:commonjs",
"build:all": "run-p build:umd:prod build:commonjs",
- "lint": "tslint --project . --exclude **/src/generated_contract_wrappers/**/*",
+ "lint": "tslint --format stylish --project .",
"test:circleci": "run-s test:coverage",
"rebuild_and_test": "run-s build test",
"test:coverage": "nyc npm run test --all && yarn coverage:report:lcov",
@@ -42,16 +42,16 @@
},
"license": "Apache-2.0",
"devDependencies": {
- "@0xproject/abi-gen": "^1.0.13",
- "@0xproject/dev-utils": "^1.0.12",
- "@0xproject/migrations": "^1.0.14",
- "@0xproject/monorepo-scripts": "^1.0.11",
- "@0xproject/tslint-config": "^1.0.8",
+ "@0x/abi-gen": "^1.0.15",
+ "@0x/abi-gen-wrappers": "^1.0.2",
+ "@0x/contract-addresses": "^1.1.0",
+ "@0x/dev-utils": "^1.0.14",
+ "@0x/migrations": "^2.0.1",
+ "@0x/tslint-config": "^1.0.10",
"@types/lodash": "4.14.104",
"@types/mocha": "^2.2.42",
"@types/node": "*",
"@types/sinon": "^2.2.2",
- "@types/web3-provider-engine": "^14.0.0",
"awesome-typescript-loader": "^5.2.1",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
@@ -67,23 +67,24 @@
"sinon": "^4.0.0",
"source-map-support": "^0.5.0",
"tslint": "5.11.0",
- "typedoc": "0.12.0",
+ "typedoc": "0.13.0",
"typescript": "3.0.1",
"uglifyjs-webpack-plugin": "^2.0.1",
"webpack": "^4.20.2"
},
"dependencies": {
- "@0xproject/assert": "^1.0.13",
- "@0xproject/base-contract": "^3.0.1",
- "@0xproject/contract-wrappers": "^2.0.2",
- "@0xproject/order-utils": "^1.0.7",
- "@0xproject/order-watcher": "^2.1.1",
- "@0xproject/subproviders": "^2.0.7",
- "@0xproject/types": "^1.1.4",
- "@0xproject/typescript-typings": "^3.0.2",
- "@0xproject/utils": "^2.0.2",
- "@0xproject/web3-wrapper": "^3.0.3",
- "ethereum-types": "^1.0.11",
+ "@0x/assert": "^1.0.15",
+ "@0x/base-contract": "^3.0.3",
+ "@0x/contract-wrappers": "^3.0.1",
+ "@0x/order-utils": "^2.0.1",
+ "@0x/order-watcher": "^2.2.1",
+ "@0x/subproviders": "^2.1.1",
+ "@0x/types": "^1.2.1",
+ "@0x/typescript-typings": "^3.0.4",
+ "@0x/utils": "^2.0.4",
+ "@0x/web3-wrapper": "^3.1.1",
+ "@types/web3-provider-engine": "^14.0.0",
+ "ethereum-types": "^1.1.2",
"ethers": "~4.0.4",
"lodash": "^4.17.5",
"web3-provider-engine": "14.0.6"
diff --git a/packages/0x.js/src/globals.d.ts b/packages/0x.js/src/globals.d.ts
deleted file mode 100644
index 94e63a32d..000000000
--- a/packages/0x.js/src/globals.d.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-declare module '*.json' {
- const json: any;
- /* tslint:disable */
- export default json;
- /* tslint:enable */
-}
diff --git a/packages/0x.js/src/index.ts b/packages/0x.js/src/index.ts
index 6eb1fd8ee..2df360b96 100644
--- a/packages/0x.js/src/index.ts
+++ b/packages/0x.js/src/index.ts
@@ -1,4 +1,6 @@
-export { assetDataUtils, signatureUtils, generatePseudoRandomSalt, orderHashUtils } from '@0xproject/order-utils';
+export { ContractAddresses } from '@0x/contract-addresses';
+
+export { assetDataUtils, signatureUtils, generatePseudoRandomSalt, orderHashUtils } from '@0x/order-utils';
export {
ContractWrappers,
@@ -18,6 +20,16 @@ export {
TransactionOpts,
OrderStatus,
OrderInfo,
+ EventCallback,
+ DecodedLogEvent,
+ TransactionEncoder,
+ BalanceAndAllowance,
+ OrderAndTraderInfo,
+ TraderInfo,
+ ValidateOrderFillableOpts,
+} from '@0x/contract-wrappers';
+
+export {
WETH9Events,
WETH9WithdrawalEventArgs,
WETH9ApprovalEventArgs,
@@ -38,18 +50,11 @@ export {
ExchangeSignatureValidatorApprovalEventArgs,
ExchangeFillEventArgs,
ExchangeCancelEventArgs,
- ExchangeEvents,
- EventCallback,
- DecodedLogEvent,
ExchangeEventArgs,
- TransactionEncoder,
- BalanceAndAllowance,
- OrderAndTraderInfo,
- TraderInfo,
- ValidateOrderFillableOpts,
-} from '@0xproject/contract-wrappers';
+ ExchangeEvents,
+} from '@0x/abi-gen-wrappers';
-export { OrderWatcher, OnOrderStateChangeCallback, OrderWatcherConfig } from '@0xproject/order-watcher';
+export { OrderWatcher, OnOrderStateChangeCallback, OrderWatcherConfig } from '@0x/order-watcher';
export import Web3ProviderEngine = require('web3-provider-engine');
@@ -59,11 +64,11 @@ export {
JSONRPCRequestPayloadWithMethod,
ErrorCallback,
MetamaskSubprovider,
-} from '@0xproject/subproviders';
+} from '@0x/subproviders';
-export { AbiDecoder } from '@0xproject/utils';
+export { AbiDecoder } from '@0x/utils';
-export { BigNumber } from '@0xproject/utils';
+export { BigNumber } from '@0x/utils';
export {
ExchangeContractErrs,
@@ -74,11 +79,13 @@ export {
OrderStateInvalid,
OrderState,
AssetProxyId,
+ AssetData,
ERC20AssetData,
ERC721AssetData,
SignatureType,
OrderRelevantState,
-} from '@0xproject/types';
+ Stats,
+} from '@0x/types';
export {
BlockParamLiteral,
diff --git a/packages/0x.js/tslint.json b/packages/0x.js/tslint.json
index ffaefe83a..dd9053357 100644
--- a/packages/0x.js/tslint.json
+++ b/packages/0x.js/tslint.json
@@ -1,3 +1,3 @@
{
- "extends": ["@0xproject/tslint-config"]
+ "extends": ["@0x/tslint-config"]
}
diff --git a/packages/0x.js/typedoc-tsconfig.json b/packages/0x.js/typedoc-tsconfig.json
index c9b0af1ae..a4c669cb6 100644
--- a/packages/0x.js/typedoc-tsconfig.json
+++ b/packages/0x.js/typedoc-tsconfig.json
@@ -3,5 +3,5 @@
"compilerOptions": {
"outDir": "lib"
},
- "include": ["./src/**/*", "./test/**/*"]
+ "include": ["./src/**/*"]
}
diff --git a/packages/abi-gen-wrappers/CHANGELOG.json b/packages/abi-gen-wrappers/CHANGELOG.json
new file mode 100644
index 000000000..c3273536b
--- /dev/null
+++ b/packages/abi-gen-wrappers/CHANGELOG.json
@@ -0,0 +1,29 @@
+[
+ {
+ "version": "1.0.2",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ],
+ "timestamp": 1541740904
+ },
+ {
+ "timestamp": 1539871071,
+ "version": "1.0.1",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
+ "version": "1.0.0",
+ "changes": [
+ {
+ "pr": 1105,
+ "note": "Initial release"
+ }
+ ]
+ }
+]
diff --git a/packages/abi-gen-wrappers/CHANGELOG.md b/packages/abi-gen-wrappers/CHANGELOG.md
new file mode 100644
index 000000000..18bd28cb8
--- /dev/null
+++ b/packages/abi-gen-wrappers/CHANGELOG.md
@@ -0,0 +1,18 @@
+<!--
+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.2 - _November 9, 2018_
+
+ * Dependencies updated
+
+## v1.0.1 - _October 18, 2018_
+
+ * Dependencies updated
+
+## v1.0.0 - _Invalid date_
+
+ * Initial release (#1105)
diff --git a/packages/abi-gen-wrappers/README.md b/packages/abi-gen-wrappers/README.md
new file mode 100644
index 000000000..bcf58ae06
--- /dev/null
+++ b/packages/abi-gen-wrappers/README.md
@@ -0,0 +1,73 @@
+## @0x/abi-gen-wrappers
+
+Low-level 0x smart contract wrappers generated using @0x/abi-gen. These
+low-level wrappers are imported by other packages in the 0x monorepo and
+application developers are not expected to import this package directly.
+
+You may also be interested in the
+[@0x/contract-wrappers](../contract-wrappers/README.md) package which
+includes some higher-level features.
+
+## Installation
+
+```bash
+yarn add @0x/abi-gen-wrappers
+```
+
+**Import**
+
+```typescript
+import * as wrappers from '@0x/abi-gen-wrappers';
+```
+
+or
+
+```javascript
+var wrappers = require('@0x/abi-gen-wrappers');
+```
+
+## Contributing
+
+We welcome improvements and fixes from the wider community! To report bugs within this package, please create an issue in this repository.
+
+Please read our [contribution guidelines](../../CONTRIBUTING.md) before getting started.
+
+### Install dependencies
+
+If you don't have yarn workspaces enabled (Yarn < v1.0) - enable them:
+
+```bash
+yarn config set workspaces-experimental true
+```
+
+Then install dependencies
+
+```bash
+yarn install
+```
+
+### Build
+
+To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
+
+```bash
+PKG=@0x/abi-gen-wrappers yarn build
+```
+
+### Clean
+
+```bash
+yarn clean
+```
+
+### Lint
+
+```bash
+yarn lint
+```
+
+### Run Tests
+
+```bash
+yarn test
+```
diff --git a/packages/abi-gen-wrappers/package.json b/packages/abi-gen-wrappers/package.json
new file mode 100644
index 000000000..a4316449f
--- /dev/null
+++ b/packages/abi-gen-wrappers/package.json
@@ -0,0 +1,48 @@
+{
+ "name": "@0x/abi-gen-wrappers",
+ "version": "1.0.2",
+ "engines": {
+ "node": ">=6.12"
+ },
+ "description": "Low-level 0x smart contract wrappers generated using @0x/abi-gen",
+ "main": "lib/src/index.js",
+ "directories": {
+ "test": "test"
+ },
+ "scripts": {
+ "build": "yarn pre_build && tsc -b",
+ "build:ci": "yarn build",
+ "lint": "tslint --format stylish --project .",
+ "pre_build": "yarn generate_contract_wrappers",
+ "clean": "shx rm -rf lib wrappers",
+ "generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/generated-wrappers --backend ethers"
+ },
+ "config": {
+ "abis": "../contract-artifacts/artifacts/@(AssetProxyOwner|DummyERC20Token|DummyERC721Token|ERC20Proxy|ERC20Token|ERC721Proxy|ERC721Token|Exchange|Forwarder|IValidator|IWallet|OrderValidator|WETH9|ZRXToken).json"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/0xProject/0x-monorepo.git"
+ },
+ "license": "Apache-2.0",
+ "bugs": {
+ "url": "https://github.com/0xProject/0x-monorepo/issues"
+ },
+ "homepage": "https://github.com/0xProject/0x-monorepo/packages/abi-gen-wrappers/README.md",
+ "devDependencies": {
+ "@0x/abi-gen": "^1.0.15",
+ "@0x/tslint-config": "^1.0.10",
+ "@0x/utils": "^2.0.4",
+ "@0x/web3-wrapper": "^3.1.1",
+ "ethereum-types": "^1.1.2",
+ "ethers": "~4.0.4",
+ "lodash": "^4.17.5",
+ "shx": "^0.2.2"
+ },
+ "dependencies": {
+ "@0x/base-contract": "^3.0.3"
+ },
+ "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
new file mode 100644
index 000000000..8ca70e026
--- /dev/null
+++ b/packages/abi-gen-wrappers/src/generated-wrappers/asset_proxy_owner.ts
@@ -0,0 +1,1876 @@
+// 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 { Web3Wrapper } from '@0x/web3-wrapper';
+import * as ethers from 'ethers';
+import * as _ from 'lodash';
+// tslint:enable:no-unused-variable
+
+export type AssetProxyOwnerEventArgs =
+ | AssetProxyOwnerAssetProxyRegistrationEventArgs
+ | AssetProxyOwnerConfirmationTimeSetEventArgs
+ | AssetProxyOwnerTimeLockChangeEventArgs
+ | AssetProxyOwnerConfirmationEventArgs
+ | AssetProxyOwnerRevocationEventArgs
+ | AssetProxyOwnerSubmissionEventArgs
+ | AssetProxyOwnerExecutionEventArgs
+ | AssetProxyOwnerExecutionFailureEventArgs
+ | AssetProxyOwnerDepositEventArgs
+ | AssetProxyOwnerOwnerAdditionEventArgs
+ | AssetProxyOwnerOwnerRemovalEventArgs
+ | AssetProxyOwnerRequirementChangeEventArgs;
+
+export enum AssetProxyOwnerEvents {
+ AssetProxyRegistration = 'AssetProxyRegistration',
+ ConfirmationTimeSet = 'ConfirmationTimeSet',
+ TimeLockChange = 'TimeLockChange',
+ Confirmation = 'Confirmation',
+ Revocation = 'Revocation',
+ Submission = 'Submission',
+ Execution = 'Execution',
+ ExecutionFailure = 'ExecutionFailure',
+ Deposit = 'Deposit',
+ OwnerAddition = 'OwnerAddition',
+ OwnerRemoval = 'OwnerRemoval',
+ RequirementChange = 'RequirementChange',
+}
+
+export interface AssetProxyOwnerAssetProxyRegistrationEventArgs extends DecodedLogArgs {
+ assetProxyContract: string;
+ isRegistered: boolean;
+}
+
+export interface AssetProxyOwnerConfirmationTimeSetEventArgs extends DecodedLogArgs {
+ transactionId: BigNumber;
+ confirmationTime: BigNumber;
+}
+
+export interface AssetProxyOwnerTimeLockChangeEventArgs extends DecodedLogArgs {
+ secondsTimeLocked: BigNumber;
+}
+
+export interface AssetProxyOwnerConfirmationEventArgs extends DecodedLogArgs {
+ sender: string;
+ transactionId: BigNumber;
+}
+
+export interface AssetProxyOwnerRevocationEventArgs extends DecodedLogArgs {
+ sender: string;
+ transactionId: BigNumber;
+}
+
+export interface AssetProxyOwnerSubmissionEventArgs extends DecodedLogArgs {
+ transactionId: BigNumber;
+}
+
+export interface AssetProxyOwnerExecutionEventArgs extends DecodedLogArgs {
+ transactionId: BigNumber;
+}
+
+export interface AssetProxyOwnerExecutionFailureEventArgs extends DecodedLogArgs {
+ transactionId: BigNumber;
+}
+
+export interface AssetProxyOwnerDepositEventArgs extends DecodedLogArgs {
+ sender: string;
+ value: BigNumber;
+}
+
+export interface AssetProxyOwnerOwnerAdditionEventArgs extends DecodedLogArgs {
+ owner: string;
+}
+
+export interface AssetProxyOwnerOwnerRemovalEventArgs extends DecodedLogArgs {
+ owner: string;
+}
+
+export interface AssetProxyOwnerRequirementChangeEventArgs extends DecodedLogArgs {
+ required: BigNumber;
+}
+
+
+/* istanbul ignore next */
+// tslint:disable:no-parameter-reassignment
+// tslint:disable-next-line:class-name
+export class AssetProxyOwnerContract extends BaseContract {
+ public owners = {
+ async callAsync(
+ index_0: BigNumber,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public removeOwner = {
+ async sendTransactionAsync(
+ owner: string,
+ 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 txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.removeOwner.estimateGasAsync.bind(
+ self,
+ owner
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ owner: string,
+ 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 txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ 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
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ owner: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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;
+ },
+ };
+ public revokeConfirmation = {
+ async sendTransactionAsync(
+ transactionId: BigNumber,
+ 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 txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.revokeConfirmation.estimateGasAsync.bind(
+ self,
+ transactionId
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ transactionId: BigNumber,
+ 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 txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ 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
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ transactionId: BigNumber,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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;
+ },
+ };
+ public isOwner = {
+ async callAsync(
+ index_0: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public confirmations = {
+ async callAsync(
+ index_0: BigNumber,
+ index_1: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ index_1
+ ]);
+ 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);
+ 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];
+ },
+ };
+ public executeRemoveAuthorizedAddressAtIndex = {
+ async sendTransactionAsync(
+ transactionId: BigNumber,
+ 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 txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.executeRemoveAuthorizedAddressAtIndex.estimateGasAsync.bind(
+ self,
+ transactionId
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ transactionId: BigNumber,
+ 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 txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ 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
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ transactionId: BigNumber,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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;
+ },
+ };
+ public secondsTimeLocked = {
+ async callAsync(
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public getTransactionCount = {
+ async callAsync(
+ pending: boolean,
+ executed: boolean,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ executed
+ ]);
+ 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);
+ 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];
+ },
+ };
+ public registerAssetProxy = {
+ async sendTransactionAsync(
+ assetProxyContract: string,
+ isRegistered: boolean,
+ 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,
+ isRegistered
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.registerAssetProxy.estimateGasAsync.bind(
+ self,
+ assetProxyContract,
+ isRegistered
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ assetProxyContract: string,
+ isRegistered: boolean,
+ 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,
+ isRegistered
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ assetProxyContract: string,
+ 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,
+ isRegistered
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ assetProxyContract: string,
+ isRegistered: boolean,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ isRegistered
+ ]);
+ 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);
+ 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;
+ },
+ };
+ public addOwner = {
+ async sendTransactionAsync(
+ owner: string,
+ 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 txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.addOwner.estimateGasAsync.bind(
+ self,
+ owner
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ owner: string,
+ 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 txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ 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
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ owner: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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;
+ },
+ };
+ public isConfirmed = {
+ async callAsync(
+ transactionId: BigNumber,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public changeTimeLock = {
+ async sendTransactionAsync(
+ _secondsTimeLocked: BigNumber,
+ 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 txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.changeTimeLock.estimateGasAsync.bind(
+ self,
+ _secondsTimeLocked
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ _secondsTimeLocked: BigNumber,
+ 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 txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ _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
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ _secondsTimeLocked: BigNumber,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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;
+ },
+ };
+ public isAssetProxyRegistered = {
+ async callAsync(
+ index_0: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public getConfirmationCount = {
+ async callAsync(
+ transactionId: BigNumber,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public transactions = {
+ async callAsync(
+ index_0: BigNumber,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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;
+ },
+ };
+ public getOwners = {
+ async callAsync(
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public getTransactionIds = {
+ async callAsync(
+ from: BigNumber,
+ to: BigNumber,
+ pending: boolean,
+ executed: boolean,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ to,
+ pending,
+ executed
+ ]);
+ 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);
+ 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];
+ },
+ };
+ public getConfirmations = {
+ async callAsync(
+ transactionId: BigNumber,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public transactionCount = {
+ async callAsync(
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public changeRequirement = {
+ async sendTransactionAsync(
+ _required: BigNumber,
+ 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 txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.changeRequirement.estimateGasAsync.bind(
+ self,
+ _required
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ _required: BigNumber,
+ 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 txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ _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
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ _required: BigNumber,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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;
+ },
+ };
+ public confirmTransaction = {
+ async sendTransactionAsync(
+ transactionId: BigNumber,
+ 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 txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.confirmTransaction.estimateGasAsync.bind(
+ self,
+ transactionId
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ transactionId: BigNumber,
+ 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 txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ 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
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ transactionId: BigNumber,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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;
+ },
+ };
+ public submitTransaction = {
+ async sendTransactionAsync(
+ destination: string,
+ value: BigNumber,
+ data: string,
+ 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,
+ value,
+ data
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.submitTransaction.estimateGasAsync.bind(
+ self,
+ destination,
+ value,
+ data
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ destination: string,
+ value: BigNumber,
+ data: string,
+ 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,
+ value,
+ data
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ destination: string,
+ value: BigNumber,
+ 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,
+ value,
+ data
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ destination: string,
+ value: BigNumber,
+ data: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ value,
+ data
+ ]);
+ 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);
+ 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];
+ },
+ };
+ public confirmationTimes = {
+ async callAsync(
+ index_0: BigNumber,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public MAX_OWNER_COUNT = {
+ async callAsync(
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public required = {
+ async callAsync(
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public replaceOwner = {
+ async sendTransactionAsync(
+ owner: string,
+ newOwner: string,
+ 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,
+ newOwner
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.replaceOwner.estimateGasAsync.bind(
+ self,
+ owner,
+ newOwner
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ owner: string,
+ newOwner: string,
+ 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,
+ 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(
+ owner: string,
+ 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,
+ newOwner
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ owner: string,
+ newOwner: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ 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);
+ 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;
+ },
+ };
+ public executeTransaction = {
+ async sendTransactionAsync(
+ transactionId: BigNumber,
+ 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 txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.executeTransaction.estimateGasAsync.bind(
+ self,
+ transactionId
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ transactionId: BigNumber,
+ 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 txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ 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
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ transactionId: BigNumber,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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;
+ },
+ };
+ public static async deployFrom0xArtifactAsync(
+ artifact: ContractArtifact,
+ provider: Provider,
+ txDefaults: Partial<TxData>,
+ _owners: string[],
+ _assetProxyContracts: string[],
+ _required: BigNumber,
+ _secondsTimeLocked: BigNumber,
+ ): Promise<AssetProxyOwnerContract> {
+ 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 AssetProxyOwnerContract.deployAsync(bytecode, abi, provider, txDefaults, _owners,
+_assetProxyContracts,
+_required,
+_secondsTimeLocked
+);
+ }
+ public static async deployAsync(
+ bytecode: string,
+ abi: ContractAbi,
+ provider: Provider,
+ txDefaults: Partial<TxData>,
+ _owners: string[],
+ _assetProxyContracts: string[],
+ _required: BigNumber,
+ _secondsTimeLocked: BigNumber,
+ ): Promise<AssetProxyOwnerContract> {
+ const constructorAbi = BaseContract._lookupConstructorAbi(abi);
+ [_owners,
+_assetProxyContracts,
+_required,
+_secondsTimeLocked
+] = BaseContract._formatABIDataItemList(
+ constructorAbi.inputs,
+ [_owners,
+_assetProxyContracts,
+_required,
+_secondsTimeLocked
+],
+ BaseContract._bigNumberToString,
+ );
+ const iface = new ethers.utils.Interface(abi);
+ const deployInfo = iface.deployFunction;
+ const txData = deployInfo.encode(bytecode, [_owners,
+_assetProxyContracts,
+_required,
+_secondsTimeLocked
+]);
+ 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(`AssetProxyOwner successfully deployed at ${txReceipt.contractAddress}`);
+ const contractInstance = new AssetProxyOwnerContract(abi, txReceipt.contractAddress as string, provider, txDefaults);
+ contractInstance.constructorArgs = [_owners,
+_assetProxyContracts,
+_required,
+_secondsTimeLocked
+];
+ return contractInstance;
+ }
+ constructor(abi: ContractAbi, address: string, provider: Provider, txDefaults?: Partial<TxData>) {
+ super('AssetProxyOwner', abi, address, provider, txDefaults);
+ classUtils.bindAll(this, ['_ethersInterfacesByFunctionSignature', '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
new file mode 100644
index 000000000..1efeeed0a
--- /dev/null
+++ b/packages/abi-gen-wrappers/src/generated-wrappers/dummy_erc20_token.ts
@@ -0,0 +1,1044 @@
+// 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 { Web3Wrapper } from '@0x/web3-wrapper';
+import * as ethers from 'ethers';
+import * as _ from 'lodash';
+// tslint:enable:no-unused-variable
+
+export type DummyERC20TokenEventArgs =
+ | DummyERC20TokenTransferEventArgs
+ | DummyERC20TokenApprovalEventArgs;
+
+export enum DummyERC20TokenEvents {
+ Transfer = 'Transfer',
+ Approval = 'Approval',
+}
+
+export interface DummyERC20TokenTransferEventArgs extends DecodedLogArgs {
+ _from: string;
+ _to: string;
+ _value: BigNumber;
+}
+
+export interface DummyERC20TokenApprovalEventArgs extends DecodedLogArgs {
+ _owner: string;
+ _spender: string;
+ _value: BigNumber;
+}
+
+
+/* istanbul ignore next */
+// tslint:disable:no-parameter-reassignment
+// tslint:disable-next-line:class-name
+export class DummyERC20TokenContract extends BaseContract {
+ public name = {
+ async callAsync(
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public approve = {
+ async sendTransactionAsync(
+ _spender: string,
+ _value: BigNumber,
+ 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,
+ _value
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.approve.estimateGasAsync.bind(
+ self,
+ _spender,
+ _value
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ _spender: string,
+ _value: BigNumber,
+ 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,
+ _value
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ _spender: string,
+ _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,
+ _value
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ _spender: string,
+ _value: BigNumber,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ _value
+ ]);
+ 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);
+ 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];
+ },
+ };
+ public totalSupply = {
+ async callAsync(
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public transferFrom = {
+ async sendTransactionAsync(
+ _from: string,
+ _to: string,
+ _value: BigNumber,
+ 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,
+ _to,
+ _value
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.transferFrom.estimateGasAsync.bind(
+ self,
+ _from,
+ _to,
+ _value
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ _from: string,
+ _to: string,
+ _value: BigNumber,
+ 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,
+ _to,
+ _value
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ _from: string,
+ _to: string,
+ _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,
+ _to,
+ _value
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ _from: string,
+ _to: string,
+ _value: BigNumber,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ _to,
+ _value
+ ]);
+ 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);
+ 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];
+ },
+ };
+ public decimals = {
+ async callAsync(
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public balanceOf = {
+ async callAsync(
+ _owner: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public owner = {
+ async callAsync(
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public symbol = {
+ async callAsync(
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public mint = {
+ async sendTransactionAsync(
+ _value: BigNumber,
+ 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 txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.mint.estimateGasAsync.bind(
+ self,
+ _value
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ _value: BigNumber,
+ 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 txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ _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
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ _value: BigNumber,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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;
+ },
+ };
+ public transfer = {
+ async sendTransactionAsync(
+ _to: string,
+ _value: BigNumber,
+ 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,
+ _value
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.transfer.estimateGasAsync.bind(
+ self,
+ _to,
+ _value
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ _to: string,
+ _value: BigNumber,
+ 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,
+ _value
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ _to: string,
+ _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,
+ _value
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ _to: string,
+ _value: BigNumber,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ _value
+ ]);
+ 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);
+ 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];
+ },
+ };
+ public allowance = {
+ async callAsync(
+ _owner: string,
+ _spender: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ _spender
+ ]);
+ 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);
+ 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];
+ },
+ };
+ public setBalance = {
+ async sendTransactionAsync(
+ _target: string,
+ _value: BigNumber,
+ 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,
+ _value
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.setBalance.estimateGasAsync.bind(
+ self,
+ _target,
+ _value
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ _target: string,
+ _value: BigNumber,
+ 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,
+ _value
+ ]);
+ 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,
+ _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,
+ _value
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ _target: string,
+ _value: BigNumber,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ _value
+ ]);
+ 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);
+ 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;
+ },
+ };
+ public transferOwnership = {
+ async sendTransactionAsync(
+ newOwner: string,
+ 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 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 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 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 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
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ newOwner: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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;
+ },
+ };
+ public MAX_MINT_AMOUNT = {
+ async callAsync(
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public static async deployFrom0xArtifactAsync(
+ artifact: ContractArtifact,
+ provider: Provider,
+ txDefaults: Partial<TxData>,
+ _name: string,
+ _symbol: string,
+ _decimals: BigNumber,
+ _totalSupply: BigNumber,
+ ): Promise<DummyERC20TokenContract> {
+ 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 DummyERC20TokenContract.deployAsync(bytecode, abi, provider, txDefaults, _name,
+_symbol,
+_decimals,
+_totalSupply
+);
+ }
+ public static async deployAsync(
+ bytecode: string,
+ abi: ContractAbi,
+ provider: Provider,
+ txDefaults: Partial<TxData>,
+ _name: string,
+ _symbol: string,
+ _decimals: BigNumber,
+ _totalSupply: BigNumber,
+ ): Promise<DummyERC20TokenContract> {
+ const constructorAbi = BaseContract._lookupConstructorAbi(abi);
+ [_name,
+_symbol,
+_decimals,
+_totalSupply
+] = BaseContract._formatABIDataItemList(
+ constructorAbi.inputs,
+ [_name,
+_symbol,
+_decimals,
+_totalSupply
+],
+ BaseContract._bigNumberToString,
+ );
+ const iface = new ethers.utils.Interface(abi);
+ const deployInfo = iface.deployFunction;
+ const txData = deployInfo.encode(bytecode, [_name,
+_symbol,
+_decimals,
+_totalSupply
+]);
+ 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(`DummyERC20Token successfully deployed at ${txReceipt.contractAddress}`);
+ const contractInstance = new DummyERC20TokenContract(abi, txReceipt.contractAddress as string, provider, txDefaults);
+ contractInstance.constructorArgs = [_name,
+_symbol,
+_decimals,
+_totalSupply
+];
+ return contractInstance;
+ }
+ constructor(abi: ContractAbi, address: string, provider: Provider, txDefaults?: Partial<TxData>) {
+ super('DummyERC20Token', abi, address, provider, txDefaults);
+ classUtils.bindAll(this, ['_ethersInterfacesByFunctionSignature', '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
new file mode 100644
index 000000000..cc5f9679f
--- /dev/null
+++ b/packages/abi-gen-wrappers/src/generated-wrappers/dummy_erc721_token.ts
@@ -0,0 +1,1326 @@
+// 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 { Web3Wrapper } from '@0x/web3-wrapper';
+import * as ethers from 'ethers';
+import * as _ from 'lodash';
+// tslint:enable:no-unused-variable
+
+export type DummyERC721TokenEventArgs =
+ | DummyERC721TokenTransferEventArgs
+ | DummyERC721TokenApprovalEventArgs
+ | DummyERC721TokenApprovalForAllEventArgs;
+
+export enum DummyERC721TokenEvents {
+ Transfer = 'Transfer',
+ Approval = 'Approval',
+ ApprovalForAll = 'ApprovalForAll',
+}
+
+export interface DummyERC721TokenTransferEventArgs extends DecodedLogArgs {
+ _from: string;
+ _to: string;
+ _tokenId: BigNumber;
+}
+
+export interface DummyERC721TokenApprovalEventArgs extends DecodedLogArgs {
+ _owner: string;
+ _approved: string;
+ _tokenId: BigNumber;
+}
+
+export interface DummyERC721TokenApprovalForAllEventArgs extends DecodedLogArgs {
+ _owner: string;
+ _operator: string;
+ _approved: boolean;
+}
+
+
+/* istanbul ignore next */
+// tslint:disable:no-parameter-reassignment
+// tslint:disable-next-line:class-name
+export class DummyERC721TokenContract extends BaseContract {
+ public name = {
+ async callAsync(
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public getApproved = {
+ async callAsync(
+ _tokenId: BigNumber,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public approve = {
+ async sendTransactionAsync(
+ _approved: string,
+ _tokenId: BigNumber,
+ 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,
+ _tokenId
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.approve.estimateGasAsync.bind(
+ self,
+ _approved,
+ _tokenId
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ _approved: string,
+ _tokenId: BigNumber,
+ 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,
+ _tokenId
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ _approved: string,
+ _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,
+ _tokenId
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ _approved: string,
+ _tokenId: BigNumber,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ _tokenId
+ ]);
+ 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);
+ 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;
+ },
+ };
+ public transferFrom = {
+ async sendTransactionAsync(
+ _from: string,
+ _to: string,
+ _tokenId: BigNumber,
+ 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,
+ _to,
+ _tokenId
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.transferFrom.estimateGasAsync.bind(
+ self,
+ _from,
+ _to,
+ _tokenId
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ _from: string,
+ _to: string,
+ _tokenId: BigNumber,
+ 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,
+ _to,
+ _tokenId
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ _from: string,
+ _to: string,
+ _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,
+ _to,
+ _tokenId
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ _from: string,
+ _to: string,
+ _tokenId: BigNumber,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ _to,
+ _tokenId
+ ]);
+ 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);
+ 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;
+ },
+ };
+ public mint = {
+ async sendTransactionAsync(
+ _to: string,
+ _tokenId: BigNumber,
+ 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,
+ _tokenId
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.mint.estimateGasAsync.bind(
+ self,
+ _to,
+ _tokenId
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ _to: string,
+ _tokenId: BigNumber,
+ 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,
+ _tokenId
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ _to: string,
+ _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,
+ _tokenId
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ _to: string,
+ _tokenId: BigNumber,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ _tokenId
+ ]);
+ 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);
+ 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;
+ },
+ };
+ public safeTransferFrom1 = {
+ async sendTransactionAsync(
+ _from: string,
+ _to: string,
+ _tokenId: BigNumber,
+ 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,
+ _to,
+ _tokenId
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.safeTransferFrom1.estimateGasAsync.bind(
+ self,
+ _from,
+ _to,
+ _tokenId
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ _from: string,
+ _to: string,
+ _tokenId: BigNumber,
+ 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,
+ _to,
+ _tokenId
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ _from: string,
+ _to: string,
+ _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,
+ _to,
+ _tokenId
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ _from: string,
+ _to: string,
+ _tokenId: BigNumber,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ _to,
+ _tokenId
+ ]);
+ 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);
+ 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;
+ },
+ };
+ public ownerOf = {
+ async callAsync(
+ _tokenId: BigNumber,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public balanceOf = {
+ async callAsync(
+ _owner: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public owner = {
+ async callAsync(
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public symbol = {
+ async callAsync(
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public burn = {
+ async sendTransactionAsync(
+ _owner: string,
+ _tokenId: BigNumber,
+ 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,
+ _tokenId
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.burn.estimateGasAsync.bind(
+ self,
+ _owner,
+ _tokenId
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ _owner: string,
+ _tokenId: BigNumber,
+ 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,
+ _tokenId
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ _owner: string,
+ _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,
+ _tokenId
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ _owner: string,
+ _tokenId: BigNumber,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ _tokenId
+ ]);
+ 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);
+ 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;
+ },
+ };
+ public setApprovalForAll = {
+ async sendTransactionAsync(
+ _operator: string,
+ _approved: boolean,
+ 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,
+ _approved
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.setApprovalForAll.estimateGasAsync.bind(
+ self,
+ _operator,
+ _approved
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ _operator: string,
+ _approved: boolean,
+ 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,
+ _approved
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ _operator: string,
+ _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,
+ _approved
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ _operator: string,
+ _approved: boolean,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ _approved
+ ]);
+ 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);
+ 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;
+ },
+ };
+ public safeTransferFrom2 = {
+ async sendTransactionAsync(
+ _from: string,
+ _to: string,
+ _tokenId: BigNumber,
+ _data: string,
+ 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,
+ _to,
+ _tokenId,
+ _data
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.safeTransferFrom2.estimateGasAsync.bind(
+ self,
+ _from,
+ _to,
+ _tokenId,
+ _data
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ _from: string,
+ _to: string,
+ _tokenId: BigNumber,
+ _data: string,
+ 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,
+ _to,
+ _tokenId,
+ _data
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ _from: string,
+ _to: string,
+ _tokenId: BigNumber,
+ _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,
+ _to,
+ _tokenId,
+ _data
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ _from: string,
+ _to: string,
+ _tokenId: BigNumber,
+ _data: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ _to,
+ _tokenId,
+ _data
+ ]);
+ 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);
+ 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;
+ },
+ };
+ public isApprovedForAll = {
+ async callAsync(
+ _owner: string,
+ _operator: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ _operator
+ ]);
+ 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);
+ 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];
+ },
+ };
+ public transferOwnership = {
+ async sendTransactionAsync(
+ newOwner: string,
+ 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 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 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 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 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
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ newOwner: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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;
+ },
+ };
+ public static async deployFrom0xArtifactAsync(
+ artifact: ContractArtifact,
+ provider: Provider,
+ txDefaults: Partial<TxData>,
+ _name: string,
+ _symbol: string,
+ ): Promise<DummyERC721TokenContract> {
+ 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 DummyERC721TokenContract.deployAsync(bytecode, abi, provider, txDefaults, _name,
+_symbol
+);
+ }
+ public static async deployAsync(
+ bytecode: string,
+ abi: ContractAbi,
+ provider: Provider,
+ txDefaults: Partial<TxData>,
+ _name: string,
+ _symbol: string,
+ ): Promise<DummyERC721TokenContract> {
+ const constructorAbi = BaseContract._lookupConstructorAbi(abi);
+ [_name,
+_symbol
+] = BaseContract._formatABIDataItemList(
+ constructorAbi.inputs,
+ [_name,
+_symbol
+],
+ BaseContract._bigNumberToString,
+ );
+ const iface = new ethers.utils.Interface(abi);
+ const deployInfo = iface.deployFunction;
+ const txData = deployInfo.encode(bytecode, [_name,
+_symbol
+]);
+ 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(`DummyERC721Token successfully deployed at ${txReceipt.contractAddress}`);
+ const contractInstance = new DummyERC721TokenContract(abi, txReceipt.contractAddress as string, provider, txDefaults);
+ contractInstance.constructorArgs = [_name,
+_symbol
+];
+ return contractInstance;
+ }
+ constructor(abi: ContractAbi, address: string, provider: Provider, txDefaults?: Partial<TxData>) {
+ super('DummyERC721Token', abi, address, provider, txDefaults);
+ classUtils.bindAll(this, ['_ethersInterfacesByFunctionSignature', '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
new file mode 100644
index 000000000..ab207b38e
--- /dev/null
+++ b/packages/abi-gen-wrappers/src/generated-wrappers/erc20_proxy.ts
@@ -0,0 +1,649 @@
+// 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 { Web3Wrapper } from '@0x/web3-wrapper';
+import * as ethers from 'ethers';
+import * as _ from 'lodash';
+// tslint:enable:no-unused-variable
+
+export type ERC20ProxyEventArgs =
+ | ERC20ProxyAuthorizedAddressAddedEventArgs
+ | ERC20ProxyAuthorizedAddressRemovedEventArgs;
+
+export enum ERC20ProxyEvents {
+ AuthorizedAddressAdded = 'AuthorizedAddressAdded',
+ AuthorizedAddressRemoved = 'AuthorizedAddressRemoved',
+}
+
+export interface ERC20ProxyAuthorizedAddressAddedEventArgs extends DecodedLogArgs {
+ target: string;
+ caller: string;
+}
+
+export interface ERC20ProxyAuthorizedAddressRemovedEventArgs extends DecodedLogArgs {
+ target: string;
+ caller: string;
+}
+
+
+/* istanbul ignore next */
+// tslint:disable:no-parameter-reassignment
+// tslint:disable-next-line:class-name
+export class ERC20ProxyContract extends BaseContract {
+ public addAuthorizedAddress = {
+ async sendTransactionAsync(
+ target: string,
+ 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 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 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 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 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
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ target: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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;
+ },
+ };
+ public authorities = {
+ async callAsync(
+ index_0: BigNumber,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public removeAuthorizedAddress = {
+ async sendTransactionAsync(
+ target: string,
+ 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 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 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 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 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
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ target: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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;
+ },
+ };
+ public owner = {
+ async callAsync(
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public removeAuthorizedAddressAtIndex = {
+ async sendTransactionAsync(
+ target: string,
+ index: BigNumber,
+ 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,
+ 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 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,
+ 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 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,
+ index
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ target: string,
+ index: BigNumber,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ 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);
+ 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;
+ },
+ };
+ public getProxyId = {
+ async callAsync(
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public authorized = {
+ async callAsync(
+ index_0: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public getAuthorizedAddresses = {
+ async callAsync(
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public transferOwnership = {
+ async sendTransactionAsync(
+ newOwner: string,
+ 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 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 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 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 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
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ newOwner: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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;
+ },
+ };
+ public static async deployFrom0xArtifactAsync(
+ artifact: ContractArtifact,
+ provider: Provider,
+ txDefaults: Partial<TxData>,
+ ): Promise<ERC20ProxyContract> {
+ 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 ERC20ProxyContract.deployAsync(bytecode, abi, provider, txDefaults, );
+ }
+ public static async deployAsync(
+ bytecode: string,
+ abi: ContractAbi,
+ provider: Provider,
+ txDefaults: Partial<TxData>,
+ ): Promise<ERC20ProxyContract> {
+ 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(`ERC20Proxy successfully deployed at ${txReceipt.contractAddress}`);
+ const contractInstance = new ERC20ProxyContract(abi, txReceipt.contractAddress as string, provider, txDefaults);
+ contractInstance.constructorArgs = [];
+ return contractInstance;
+ }
+ constructor(abi: ContractAbi, address: string, provider: Provider, txDefaults?: Partial<TxData>) {
+ super('ERC20Proxy', abi, address, provider, txDefaults);
+ classUtils.bindAll(this, ['_ethersInterfacesByFunctionSignature', '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
new file mode 100644
index 000000000..8ee563b7e
--- /dev/null
+++ b/packages/abi-gen-wrappers/src/generated-wrappers/erc20_token.ts
@@ -0,0 +1,556 @@
+// 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 { Web3Wrapper } from '@0x/web3-wrapper';
+import * as ethers from 'ethers';
+import * as _ from 'lodash';
+// tslint:enable:no-unused-variable
+
+export type ERC20TokenEventArgs =
+ | ERC20TokenTransferEventArgs
+ | ERC20TokenApprovalEventArgs;
+
+export enum ERC20TokenEvents {
+ Transfer = 'Transfer',
+ Approval = 'Approval',
+}
+
+export interface ERC20TokenTransferEventArgs extends DecodedLogArgs {
+ _from: string;
+ _to: string;
+ _value: BigNumber;
+}
+
+export interface ERC20TokenApprovalEventArgs extends DecodedLogArgs {
+ _owner: string;
+ _spender: string;
+ _value: BigNumber;
+}
+
+
+/* istanbul ignore next */
+// tslint:disable:no-parameter-reassignment
+// tslint:disable-next-line:class-name
+export class ERC20TokenContract extends BaseContract {
+ public approve = {
+ async sendTransactionAsync(
+ _spender: string,
+ _value: BigNumber,
+ 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,
+ _value
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.approve.estimateGasAsync.bind(
+ self,
+ _spender,
+ _value
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ _spender: string,
+ _value: BigNumber,
+ 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,
+ _value
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ _spender: string,
+ _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,
+ _value
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ _spender: string,
+ _value: BigNumber,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ _value
+ ]);
+ 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);
+ 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];
+ },
+ };
+ public totalSupply = {
+ async callAsync(
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public transferFrom = {
+ async sendTransactionAsync(
+ _from: string,
+ _to: string,
+ _value: BigNumber,
+ 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,
+ _to,
+ _value
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.transferFrom.estimateGasAsync.bind(
+ self,
+ _from,
+ _to,
+ _value
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ _from: string,
+ _to: string,
+ _value: BigNumber,
+ 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,
+ _to,
+ _value
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ _from: string,
+ _to: string,
+ _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,
+ _to,
+ _value
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ _from: string,
+ _to: string,
+ _value: BigNumber,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ _to,
+ _value
+ ]);
+ 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);
+ 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];
+ },
+ };
+ public balanceOf = {
+ async callAsync(
+ _owner: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public transfer = {
+ async sendTransactionAsync(
+ _to: string,
+ _value: BigNumber,
+ 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,
+ _value
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.transfer.estimateGasAsync.bind(
+ self,
+ _to,
+ _value
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ _to: string,
+ _value: BigNumber,
+ 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,
+ _value
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ _to: string,
+ _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,
+ _value
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ _to: string,
+ _value: BigNumber,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ _value
+ ]);
+ 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);
+ 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];
+ },
+ };
+ public allowance = {
+ async callAsync(
+ _owner: string,
+ _spender: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ _spender
+ ]);
+ 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);
+ 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];
+ },
+ };
+ public static async deployFrom0xArtifactAsync(
+ artifact: ContractArtifact,
+ provider: Provider,
+ txDefaults: Partial<TxData>,
+ ): Promise<ERC20TokenContract> {
+ 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 ERC20TokenContract.deployAsync(bytecode, abi, provider, txDefaults, );
+ }
+ public static async deployAsync(
+ bytecode: string,
+ abi: ContractAbi,
+ provider: Provider,
+ txDefaults: Partial<TxData>,
+ ): Promise<ERC20TokenContract> {
+ 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(`ERC20Token successfully deployed at ${txReceipt.contractAddress}`);
+ const contractInstance = new ERC20TokenContract(abi, txReceipt.contractAddress as string, provider, txDefaults);
+ contractInstance.constructorArgs = [];
+ return contractInstance;
+ }
+ constructor(abi: ContractAbi, address: string, provider: Provider, txDefaults?: Partial<TxData>) {
+ super('ERC20Token', abi, address, provider, txDefaults);
+ classUtils.bindAll(this, ['_ethersInterfacesByFunctionSignature', '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
new file mode 100644
index 000000000..691c55578
--- /dev/null
+++ b/packages/abi-gen-wrappers/src/generated-wrappers/erc721_proxy.ts
@@ -0,0 +1,649 @@
+// 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 { Web3Wrapper } from '@0x/web3-wrapper';
+import * as ethers from 'ethers';
+import * as _ from 'lodash';
+// tslint:enable:no-unused-variable
+
+export type ERC721ProxyEventArgs =
+ | ERC721ProxyAuthorizedAddressAddedEventArgs
+ | ERC721ProxyAuthorizedAddressRemovedEventArgs;
+
+export enum ERC721ProxyEvents {
+ AuthorizedAddressAdded = 'AuthorizedAddressAdded',
+ AuthorizedAddressRemoved = 'AuthorizedAddressRemoved',
+}
+
+export interface ERC721ProxyAuthorizedAddressAddedEventArgs extends DecodedLogArgs {
+ target: string;
+ caller: string;
+}
+
+export interface ERC721ProxyAuthorizedAddressRemovedEventArgs extends DecodedLogArgs {
+ target: string;
+ caller: string;
+}
+
+
+/* istanbul ignore next */
+// tslint:disable:no-parameter-reassignment
+// tslint:disable-next-line:class-name
+export class ERC721ProxyContract extends BaseContract {
+ public addAuthorizedAddress = {
+ async sendTransactionAsync(
+ target: string,
+ 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 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 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 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 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
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ target: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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;
+ },
+ };
+ public authorities = {
+ async callAsync(
+ index_0: BigNumber,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public removeAuthorizedAddress = {
+ async sendTransactionAsync(
+ target: string,
+ 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 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 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 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 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
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ target: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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;
+ },
+ };
+ public owner = {
+ async callAsync(
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public removeAuthorizedAddressAtIndex = {
+ async sendTransactionAsync(
+ target: string,
+ index: BigNumber,
+ 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,
+ 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 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,
+ 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 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,
+ index
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ target: string,
+ index: BigNumber,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ 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);
+ 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;
+ },
+ };
+ public getProxyId = {
+ async callAsync(
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public authorized = {
+ async callAsync(
+ index_0: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public getAuthorizedAddresses = {
+ async callAsync(
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public transferOwnership = {
+ async sendTransactionAsync(
+ newOwner: string,
+ 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 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 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 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 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
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ newOwner: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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;
+ },
+ };
+ public static async deployFrom0xArtifactAsync(
+ artifact: ContractArtifact,
+ provider: Provider,
+ txDefaults: Partial<TxData>,
+ ): Promise<ERC721ProxyContract> {
+ 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 ERC721ProxyContract.deployAsync(bytecode, abi, provider, txDefaults, );
+ }
+ public static async deployAsync(
+ bytecode: string,
+ abi: ContractAbi,
+ provider: Provider,
+ txDefaults: Partial<TxData>,
+ ): Promise<ERC721ProxyContract> {
+ 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(`ERC721Proxy successfully deployed at ${txReceipt.contractAddress}`);
+ const contractInstance = new ERC721ProxyContract(abi, txReceipt.contractAddress as string, provider, txDefaults);
+ contractInstance.constructorArgs = [];
+ return contractInstance;
+ }
+ constructor(abi: ContractAbi, address: string, provider: Provider, txDefaults?: Partial<TxData>) {
+ super('ERC721Proxy', abi, address, provider, txDefaults);
+ classUtils.bindAll(this, ['_ethersInterfacesByFunctionSignature', '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
new file mode 100644
index 000000000..d1a2d5670
--- /dev/null
+++ b/packages/abi-gen-wrappers/src/generated-wrappers/erc721_token.ts
@@ -0,0 +1,893 @@
+// 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 { Web3Wrapper } from '@0x/web3-wrapper';
+import * as ethers from 'ethers';
+import * as _ from 'lodash';
+// tslint:enable:no-unused-variable
+
+export type ERC721TokenEventArgs =
+ | ERC721TokenTransferEventArgs
+ | ERC721TokenApprovalEventArgs
+ | ERC721TokenApprovalForAllEventArgs;
+
+export enum ERC721TokenEvents {
+ Transfer = 'Transfer',
+ Approval = 'Approval',
+ ApprovalForAll = 'ApprovalForAll',
+}
+
+export interface ERC721TokenTransferEventArgs extends DecodedLogArgs {
+ _from: string;
+ _to: string;
+ _tokenId: BigNumber;
+}
+
+export interface ERC721TokenApprovalEventArgs extends DecodedLogArgs {
+ _owner: string;
+ _approved: string;
+ _tokenId: BigNumber;
+}
+
+export interface ERC721TokenApprovalForAllEventArgs extends DecodedLogArgs {
+ _owner: string;
+ _operator: string;
+ _approved: boolean;
+}
+
+
+/* istanbul ignore next */
+// tslint:disable:no-parameter-reassignment
+// tslint:disable-next-line:class-name
+export class ERC721TokenContract extends BaseContract {
+ public getApproved = {
+ async callAsync(
+ _tokenId: BigNumber,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public approve = {
+ async sendTransactionAsync(
+ _approved: string,
+ _tokenId: BigNumber,
+ 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,
+ _tokenId
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.approve.estimateGasAsync.bind(
+ self,
+ _approved,
+ _tokenId
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ _approved: string,
+ _tokenId: BigNumber,
+ 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,
+ _tokenId
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ _approved: string,
+ _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,
+ _tokenId
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ _approved: string,
+ _tokenId: BigNumber,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ _tokenId
+ ]);
+ 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);
+ 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;
+ },
+ };
+ public transferFrom = {
+ async sendTransactionAsync(
+ _from: string,
+ _to: string,
+ _tokenId: BigNumber,
+ 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,
+ _to,
+ _tokenId
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.transferFrom.estimateGasAsync.bind(
+ self,
+ _from,
+ _to,
+ _tokenId
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ _from: string,
+ _to: string,
+ _tokenId: BigNumber,
+ 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,
+ _to,
+ _tokenId
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ _from: string,
+ _to: string,
+ _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,
+ _to,
+ _tokenId
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ _from: string,
+ _to: string,
+ _tokenId: BigNumber,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ _to,
+ _tokenId
+ ]);
+ 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);
+ 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;
+ },
+ };
+ public safeTransferFrom1 = {
+ async sendTransactionAsync(
+ _from: string,
+ _to: string,
+ _tokenId: BigNumber,
+ 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,
+ _to,
+ _tokenId
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.safeTransferFrom1.estimateGasAsync.bind(
+ self,
+ _from,
+ _to,
+ _tokenId
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ _from: string,
+ _to: string,
+ _tokenId: BigNumber,
+ 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,
+ _to,
+ _tokenId
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ _from: string,
+ _to: string,
+ _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,
+ _to,
+ _tokenId
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ _from: string,
+ _to: string,
+ _tokenId: BigNumber,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ _to,
+ _tokenId
+ ]);
+ 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);
+ 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;
+ },
+ };
+ public ownerOf = {
+ async callAsync(
+ _tokenId: BigNumber,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public balanceOf = {
+ async callAsync(
+ _owner: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public setApprovalForAll = {
+ async sendTransactionAsync(
+ _operator: string,
+ _approved: boolean,
+ 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,
+ _approved
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.setApprovalForAll.estimateGasAsync.bind(
+ self,
+ _operator,
+ _approved
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ _operator: string,
+ _approved: boolean,
+ 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,
+ _approved
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ _operator: string,
+ _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,
+ _approved
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ _operator: string,
+ _approved: boolean,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ _approved
+ ]);
+ 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);
+ 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;
+ },
+ };
+ public safeTransferFrom2 = {
+ async sendTransactionAsync(
+ _from: string,
+ _to: string,
+ _tokenId: BigNumber,
+ _data: string,
+ 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,
+ _to,
+ _tokenId,
+ _data
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.safeTransferFrom2.estimateGasAsync.bind(
+ self,
+ _from,
+ _to,
+ _tokenId,
+ _data
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ _from: string,
+ _to: string,
+ _tokenId: BigNumber,
+ _data: string,
+ 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,
+ _to,
+ _tokenId,
+ _data
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ _from: string,
+ _to: string,
+ _tokenId: BigNumber,
+ _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,
+ _to,
+ _tokenId,
+ _data
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ _from: string,
+ _to: string,
+ _tokenId: BigNumber,
+ _data: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ _to,
+ _tokenId,
+ _data
+ ]);
+ 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);
+ 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;
+ },
+ };
+ public isApprovedForAll = {
+ async callAsync(
+ _owner: string,
+ _operator: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ _operator
+ ]);
+ 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);
+ 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];
+ },
+ };
+ public static async deployFrom0xArtifactAsync(
+ artifact: ContractArtifact,
+ provider: Provider,
+ txDefaults: Partial<TxData>,
+ ): Promise<ERC721TokenContract> {
+ 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 ERC721TokenContract.deployAsync(bytecode, abi, provider, txDefaults, );
+ }
+ public static async deployAsync(
+ bytecode: string,
+ abi: ContractAbi,
+ provider: Provider,
+ txDefaults: Partial<TxData>,
+ ): Promise<ERC721TokenContract> {
+ 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(`ERC721Token successfully deployed at ${txReceipt.contractAddress}`);
+ const contractInstance = new ERC721TokenContract(abi, txReceipt.contractAddress as string, provider, txDefaults);
+ contractInstance.constructorArgs = [];
+ return contractInstance;
+ }
+ constructor(abi: ContractAbi, address: string, provider: Provider, txDefaults?: Partial<TxData>) {
+ super('ERC721Token', abi, address, provider, txDefaults);
+ classUtils.bindAll(this, ['_ethersInterfacesByFunctionSignature', '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
new file mode 100644
index 000000000..ffd498055
--- /dev/null
+++ b/packages/abi-gen-wrappers/src/generated-wrappers/exchange.ts
@@ -0,0 +1,3072 @@
+// 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 { Web3Wrapper } from '@0x/web3-wrapper';
+import * as ethers from 'ethers';
+import * as _ from 'lodash';
+// tslint:enable:no-unused-variable
+
+export type ExchangeEventArgs =
+ | ExchangeSignatureValidatorApprovalEventArgs
+ | ExchangeFillEventArgs
+ | ExchangeCancelEventArgs
+ | ExchangeCancelUpToEventArgs
+ | ExchangeAssetProxyRegisteredEventArgs;
+
+export enum ExchangeEvents {
+ SignatureValidatorApproval = 'SignatureValidatorApproval',
+ Fill = 'Fill',
+ Cancel = 'Cancel',
+ CancelUpTo = 'CancelUpTo',
+ AssetProxyRegistered = 'AssetProxyRegistered',
+}
+
+export interface ExchangeSignatureValidatorApprovalEventArgs extends DecodedLogArgs {
+ signerAddress: string;
+ validatorAddress: string;
+ approved: boolean;
+}
+
+export interface ExchangeFillEventArgs extends DecodedLogArgs {
+ makerAddress: string;
+ feeRecipientAddress: string;
+ takerAddress: string;
+ senderAddress: string;
+ makerAssetFilledAmount: BigNumber;
+ takerAssetFilledAmount: BigNumber;
+ makerFeePaid: BigNumber;
+ takerFeePaid: BigNumber;
+ orderHash: string;
+ makerAssetData: string;
+ takerAssetData: string;
+}
+
+export interface ExchangeCancelEventArgs extends DecodedLogArgs {
+ makerAddress: string;
+ feeRecipientAddress: string;
+ senderAddress: string;
+ orderHash: string;
+ makerAssetData: string;
+ takerAssetData: string;
+}
+
+export interface ExchangeCancelUpToEventArgs extends DecodedLogArgs {
+ makerAddress: string;
+ senderAddress: string;
+ orderEpoch: BigNumber;
+}
+
+export interface ExchangeAssetProxyRegisteredEventArgs extends DecodedLogArgs {
+ id: string;
+ assetProxy: string;
+}
+
+
+/* istanbul ignore next */
+// tslint:disable:no-parameter-reassignment
+// tslint:disable-next-line:class-name
+export class ExchangeContract extends BaseContract {
+ public filled = {
+ async callAsync(
+ index_0: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public batchFillOrders = {
+ async sendTransactionAsync(
+ 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}>,
+ takerAssetFillAmounts: BigNumber[],
+ signatures: string[],
+ 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,
+ takerAssetFillAmounts,
+ signatures
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.batchFillOrders.estimateGasAsync.bind(
+ self,
+ orders,
+ takerAssetFillAmounts,
+ signatures
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ 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}>,
+ takerAssetFillAmounts: BigNumber[],
+ signatures: string[],
+ 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,
+ takerAssetFillAmounts,
+ signatures
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ 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}>,
+ takerAssetFillAmounts: BigNumber[],
+ 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,
+ takerAssetFillAmounts,
+ signatures
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ 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}>,
+ takerAssetFillAmounts: BigNumber[],
+ signatures: string[],
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ takerAssetFillAmounts,
+ signatures
+ ]);
+ 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);
+ 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];
+ },
+ };
+ public cancelled = {
+ async callAsync(
+ index_0: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public preSign = {
+ async sendTransactionAsync(
+ hash: string,
+ signerAddress: string,
+ signature: string,
+ 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,
+ signerAddress,
+ signature
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.preSign.estimateGasAsync.bind(
+ self,
+ hash,
+ signerAddress,
+ signature
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ hash: string,
+ signerAddress: string,
+ signature: string,
+ 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,
+ signerAddress,
+ signature
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ hash: string,
+ signerAddress: string,
+ 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,
+ signerAddress,
+ signature
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ hash: string,
+ signerAddress: string,
+ signature: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ signerAddress,
+ signature
+ ]);
+ 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);
+ 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;
+ },
+ };
+ public matchOrders = {
+ async sendTransactionAsync(
+ leftOrder: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
+ rightOrder: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
+ leftSignature: string,
+ rightSignature: string,
+ 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,
+ rightOrder,
+ leftSignature,
+ rightSignature
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.matchOrders.estimateGasAsync.bind(
+ self,
+ leftOrder,
+ rightOrder,
+ leftSignature,
+ rightSignature
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ leftOrder: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
+ rightOrder: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
+ leftSignature: string,
+ rightSignature: string,
+ 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,
+ rightOrder,
+ leftSignature,
+ rightSignature
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ leftOrder: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
+ rightOrder: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
+ leftSignature: string,
+ 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,
+ rightOrder,
+ leftSignature,
+ rightSignature
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ leftOrder: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
+ rightOrder: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
+ leftSignature: string,
+ rightSignature: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ rightOrder,
+ leftSignature,
+ rightSignature
+ ]);
+ 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);
+ 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];
+ },
+ };
+ public fillOrderNoThrow = {
+ async sendTransactionAsync(
+ 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},
+ takerAssetFillAmount: BigNumber,
+ signature: string,
+ 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,
+ takerAssetFillAmount,
+ signature
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.fillOrderNoThrow.estimateGasAsync.bind(
+ self,
+ order,
+ takerAssetFillAmount,
+ signature
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ 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},
+ takerAssetFillAmount: BigNumber,
+ signature: string,
+ 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,
+ takerAssetFillAmount,
+ signature
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ 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},
+ takerAssetFillAmount: BigNumber,
+ 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,
+ takerAssetFillAmount,
+ signature
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ 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},
+ takerAssetFillAmount: BigNumber,
+ signature: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ takerAssetFillAmount,
+ signature
+ ]);
+ 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);
+ 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];
+ },
+ };
+ public assetProxies = {
+ async callAsync(
+ index_0: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public batchCancelOrders = {
+ async sendTransactionAsync(
+ 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}>,
+ 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 txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.batchCancelOrders.estimateGasAsync.bind(
+ self,
+ orders
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ 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}>,
+ 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 txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ 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
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ 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}>,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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;
+ },
+ };
+ public batchFillOrKillOrders = {
+ async sendTransactionAsync(
+ 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}>,
+ takerAssetFillAmounts: BigNumber[],
+ signatures: string[],
+ 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,
+ takerAssetFillAmounts,
+ signatures
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.batchFillOrKillOrders.estimateGasAsync.bind(
+ self,
+ orders,
+ takerAssetFillAmounts,
+ signatures
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ 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}>,
+ takerAssetFillAmounts: BigNumber[],
+ signatures: string[],
+ 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,
+ takerAssetFillAmounts,
+ signatures
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ 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}>,
+ takerAssetFillAmounts: BigNumber[],
+ 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,
+ takerAssetFillAmounts,
+ signatures
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ 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}>,
+ takerAssetFillAmounts: BigNumber[],
+ signatures: string[],
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ takerAssetFillAmounts,
+ signatures
+ ]);
+ 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);
+ 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];
+ },
+ };
+ public cancelOrdersUpTo = {
+ async sendTransactionAsync(
+ targetOrderEpoch: BigNumber,
+ 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 txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.cancelOrdersUpTo.estimateGasAsync.bind(
+ self,
+ targetOrderEpoch
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ targetOrderEpoch: BigNumber,
+ 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 txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ 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
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ targetOrderEpoch: BigNumber,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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;
+ },
+ };
+ public batchFillOrdersNoThrow = {
+ async sendTransactionAsync(
+ 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}>,
+ takerAssetFillAmounts: BigNumber[],
+ signatures: string[],
+ 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,
+ takerAssetFillAmounts,
+ signatures
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.batchFillOrdersNoThrow.estimateGasAsync.bind(
+ self,
+ orders,
+ takerAssetFillAmounts,
+ signatures
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ 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}>,
+ takerAssetFillAmounts: BigNumber[],
+ signatures: string[],
+ 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,
+ takerAssetFillAmounts,
+ signatures
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ 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}>,
+ takerAssetFillAmounts: BigNumber[],
+ 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,
+ takerAssetFillAmounts,
+ signatures
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ 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}>,
+ takerAssetFillAmounts: BigNumber[],
+ signatures: string[],
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ takerAssetFillAmounts,
+ signatures
+ ]);
+ 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);
+ 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];
+ },
+ };
+ public getAssetProxy = {
+ async callAsync(
+ assetProxyId: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public transactions = {
+ async callAsync(
+ index_0: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public fillOrKillOrder = {
+ async sendTransactionAsync(
+ 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},
+ takerAssetFillAmount: BigNumber,
+ signature: string,
+ 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,
+ takerAssetFillAmount,
+ signature
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.fillOrKillOrder.estimateGasAsync.bind(
+ self,
+ order,
+ takerAssetFillAmount,
+ signature
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ 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},
+ takerAssetFillAmount: BigNumber,
+ signature: string,
+ 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,
+ takerAssetFillAmount,
+ signature
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ 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},
+ takerAssetFillAmount: BigNumber,
+ 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,
+ takerAssetFillAmount,
+ signature
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ 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},
+ takerAssetFillAmount: BigNumber,
+ signature: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ takerAssetFillAmount,
+ signature
+ ]);
+ 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);
+ 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];
+ },
+ };
+ public setSignatureValidatorApproval = {
+ async sendTransactionAsync(
+ validatorAddress: string,
+ approval: boolean,
+ 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,
+ approval
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.setSignatureValidatorApproval.estimateGasAsync.bind(
+ self,
+ validatorAddress,
+ approval
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ validatorAddress: string,
+ approval: boolean,
+ 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,
+ approval
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ validatorAddress: string,
+ 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,
+ approval
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ validatorAddress: string,
+ approval: boolean,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ approval
+ ]);
+ 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);
+ 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;
+ },
+ };
+ public allowedValidators = {
+ async callAsync(
+ index_0: string,
+ index_1: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ index_1
+ ]);
+ 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);
+ 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];
+ },
+ };
+ public marketSellOrders = {
+ async sendTransactionAsync(
+ 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}>,
+ takerAssetFillAmount: BigNumber,
+ signatures: string[],
+ 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,
+ takerAssetFillAmount,
+ signatures
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.marketSellOrders.estimateGasAsync.bind(
+ self,
+ orders,
+ takerAssetFillAmount,
+ signatures
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ 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}>,
+ takerAssetFillAmount: BigNumber,
+ signatures: string[],
+ 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,
+ takerAssetFillAmount,
+ signatures
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ 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}>,
+ takerAssetFillAmount: BigNumber,
+ 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,
+ takerAssetFillAmount,
+ signatures
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ 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}>,
+ takerAssetFillAmount: BigNumber,
+ signatures: string[],
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ takerAssetFillAmount,
+ signatures
+ ]);
+ 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);
+ 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];
+ },
+ };
+ public getOrdersInfo = {
+ async callAsync(
+ 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}>,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public preSigned = {
+ async callAsync(
+ index_0: string,
+ index_1: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ index_1
+ ]);
+ 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);
+ 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];
+ },
+ };
+ public owner = {
+ async callAsync(
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public isValidSignature = {
+ async callAsync(
+ hash: string,
+ signerAddress: string,
+ signature: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ signerAddress,
+ signature
+ ]);
+ 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);
+ 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];
+ },
+ };
+ public marketBuyOrdersNoThrow = {
+ async sendTransactionAsync(
+ 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}>,
+ makerAssetFillAmount: BigNumber,
+ signatures: string[],
+ 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,
+ makerAssetFillAmount,
+ signatures
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.marketBuyOrdersNoThrow.estimateGasAsync.bind(
+ self,
+ orders,
+ makerAssetFillAmount,
+ signatures
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ 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}>,
+ makerAssetFillAmount: BigNumber,
+ signatures: string[],
+ 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,
+ makerAssetFillAmount,
+ signatures
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ 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}>,
+ makerAssetFillAmount: BigNumber,
+ 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,
+ makerAssetFillAmount,
+ signatures
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ 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}>,
+ makerAssetFillAmount: BigNumber,
+ signatures: string[],
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ makerAssetFillAmount,
+ signatures
+ ]);
+ 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);
+ 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];
+ },
+ };
+ public fillOrder = {
+ async sendTransactionAsync(
+ 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},
+ takerAssetFillAmount: BigNumber,
+ signature: string,
+ 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,
+ takerAssetFillAmount,
+ signature
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.fillOrder.estimateGasAsync.bind(
+ self,
+ order,
+ takerAssetFillAmount,
+ signature
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ 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},
+ takerAssetFillAmount: BigNumber,
+ signature: string,
+ 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,
+ takerAssetFillAmount,
+ signature
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ 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},
+ takerAssetFillAmount: BigNumber,
+ 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,
+ takerAssetFillAmount,
+ signature
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ 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},
+ takerAssetFillAmount: BigNumber,
+ signature: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ takerAssetFillAmount,
+ signature
+ ]);
+ 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);
+ 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];
+ },
+ };
+ public executeTransaction = {
+ async sendTransactionAsync(
+ salt: BigNumber,
+ signerAddress: string,
+ data: string,
+ signature: string,
+ 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,
+ signerAddress,
+ data,
+ signature
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.executeTransaction.estimateGasAsync.bind(
+ self,
+ salt,
+ signerAddress,
+ data,
+ signature
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ salt: BigNumber,
+ signerAddress: string,
+ data: string,
+ signature: string,
+ 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,
+ signerAddress,
+ data,
+ signature
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ salt: BigNumber,
+ signerAddress: string,
+ data: string,
+ 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,
+ signerAddress,
+ data,
+ signature
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ salt: BigNumber,
+ signerAddress: string,
+ data: string,
+ signature: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ signerAddress,
+ data,
+ signature
+ ]);
+ 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);
+ 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;
+ },
+ };
+ public registerAssetProxy = {
+ async sendTransactionAsync(
+ assetProxy: string,
+ 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 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 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 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 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
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ assetProxy: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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;
+ },
+ };
+ public getOrderInfo = {
+ async callAsync(
+ 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},
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public cancelOrder = {
+ async sendTransactionAsync(
+ 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},
+ 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 txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.cancelOrder.estimateGasAsync.bind(
+ self,
+ order
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ 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},
+ 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 txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ 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
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ 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},
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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;
+ },
+ };
+ public orderEpoch = {
+ async callAsync(
+ index_0: string,
+ index_1: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ index_1
+ ]);
+ 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);
+ 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];
+ },
+ };
+ public ZRX_ASSET_DATA = {
+ async callAsync(
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public marketSellOrdersNoThrow = {
+ async sendTransactionAsync(
+ 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}>,
+ takerAssetFillAmount: BigNumber,
+ signatures: string[],
+ 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,
+ takerAssetFillAmount,
+ signatures
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.marketSellOrdersNoThrow.estimateGasAsync.bind(
+ self,
+ orders,
+ takerAssetFillAmount,
+ signatures
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ 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}>,
+ takerAssetFillAmount: BigNumber,
+ signatures: string[],
+ 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,
+ takerAssetFillAmount,
+ signatures
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ 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}>,
+ takerAssetFillAmount: BigNumber,
+ 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,
+ takerAssetFillAmount,
+ signatures
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ 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}>,
+ takerAssetFillAmount: BigNumber,
+ signatures: string[],
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ takerAssetFillAmount,
+ signatures
+ ]);
+ 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);
+ 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];
+ },
+ };
+ public EIP712_DOMAIN_HASH = {
+ async callAsync(
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public marketBuyOrders = {
+ async sendTransactionAsync(
+ 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}>,
+ makerAssetFillAmount: BigNumber,
+ signatures: string[],
+ 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,
+ makerAssetFillAmount,
+ signatures
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.marketBuyOrders.estimateGasAsync.bind(
+ self,
+ orders,
+ makerAssetFillAmount,
+ signatures
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ 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}>,
+ makerAssetFillAmount: BigNumber,
+ signatures: string[],
+ 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,
+ makerAssetFillAmount,
+ signatures
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ 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}>,
+ makerAssetFillAmount: BigNumber,
+ 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,
+ makerAssetFillAmount,
+ signatures
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ 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}>,
+ makerAssetFillAmount: BigNumber,
+ signatures: string[],
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ makerAssetFillAmount,
+ signatures
+ ]);
+ 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);
+ 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];
+ },
+ };
+ public currentContextAddress = {
+ async callAsync(
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public transferOwnership = {
+ async sendTransactionAsync(
+ newOwner: string,
+ 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 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 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 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 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
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ newOwner: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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;
+ },
+ };
+ public VERSION = {
+ async callAsync(
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public static async deployFrom0xArtifactAsync(
+ artifact: ContractArtifact,
+ provider: Provider,
+ txDefaults: Partial<TxData>,
+ ): Promise<ExchangeContract> {
+ 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 ExchangeContract.deployAsync(bytecode, abi, provider, txDefaults, );
+ }
+ public static async deployAsync(
+ bytecode: string,
+ abi: ContractAbi,
+ provider: Provider,
+ txDefaults: Partial<TxData>,
+ ): Promise<ExchangeContract> {
+ 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(`Exchange successfully deployed at ${txReceipt.contractAddress}`);
+ const contractInstance = new ExchangeContract(abi, txReceipt.contractAddress as string, provider, txDefaults);
+ contractInstance.constructorArgs = [];
+ return contractInstance;
+ }
+ constructor(abi: ContractAbi, address: string, provider: Provider, txDefaults?: Partial<TxData>) {
+ super('Exchange', abi, address, provider, txDefaults);
+ classUtils.bindAll(this, ['_ethersInterfacesByFunctionSignature', '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
new file mode 100644
index 000000000..80bbc52c7
--- /dev/null
+++ b/packages/abi-gen-wrappers/src/generated-wrappers/forwarder.ts
@@ -0,0 +1,730 @@
+// 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 { Web3Wrapper } from '@0x/web3-wrapper';
+import * as ethers from 'ethers';
+import * as _ from 'lodash';
+// tslint:enable:no-unused-variable
+
+
+/* istanbul ignore next */
+// tslint:disable:no-parameter-reassignment
+// tslint:disable-next-line:class-name
+export class ForwarderContract extends BaseContract {
+ public marketBuyOrdersWithEth = {
+ async sendTransactionAsync(
+ 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}>,
+ makerAssetFillAmount: BigNumber,
+ signatures: string[],
+ feeOrders: 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}>,
+ feeSignatures: string[],
+ feePercentage: BigNumber,
+ feeRecipient: string,
+ 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,
+ makerAssetFillAmount,
+ signatures,
+ feeOrders,
+ feeSignatures,
+ feePercentage,
+ feeRecipient
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.marketBuyOrdersWithEth.estimateGasAsync.bind(
+ self,
+ orders,
+ makerAssetFillAmount,
+ signatures,
+ feeOrders,
+ feeSignatures,
+ feePercentage,
+ feeRecipient
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ 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}>,
+ makerAssetFillAmount: BigNumber,
+ signatures: string[],
+ feeOrders: 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}>,
+ feeSignatures: string[],
+ feePercentage: BigNumber,
+ feeRecipient: string,
+ 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,
+ makerAssetFillAmount,
+ signatures,
+ feeOrders,
+ feeSignatures,
+ feePercentage,
+ feeRecipient
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ 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}>,
+ makerAssetFillAmount: BigNumber,
+ signatures: string[],
+ feeOrders: 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}>,
+ feeSignatures: string[],
+ feePercentage: BigNumber,
+ 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,
+ makerAssetFillAmount,
+ signatures,
+ feeOrders,
+ feeSignatures,
+ feePercentage,
+ feeRecipient
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ 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}>,
+ makerAssetFillAmount: BigNumber,
+ signatures: string[],
+ feeOrders: 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}>,
+ feeSignatures: string[],
+ feePercentage: BigNumber,
+ feeRecipient: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ makerAssetFillAmount,
+ signatures,
+ feeOrders,
+ feeSignatures,
+ feePercentage,
+ feeRecipient
+ ]);
+ 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);
+ 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;
+ },
+ };
+ public withdrawAsset = {
+ async sendTransactionAsync(
+ assetData: string,
+ amount: BigNumber,
+ 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,
+ amount
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.withdrawAsset.estimateGasAsync.bind(
+ self,
+ assetData,
+ amount
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ assetData: string,
+ amount: BigNumber,
+ 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,
+ amount
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ assetData: string,
+ 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,
+ amount
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ assetData: string,
+ amount: BigNumber,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ amount
+ ]);
+ 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);
+ 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;
+ },
+ };
+ public owner = {
+ async callAsync(
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public marketSellOrdersWithEth = {
+ async sendTransactionAsync(
+ 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}>,
+ signatures: string[],
+ feeOrders: 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}>,
+ feeSignatures: string[],
+ feePercentage: BigNumber,
+ feeRecipient: string,
+ 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,
+ signatures,
+ feeOrders,
+ feeSignatures,
+ feePercentage,
+ feeRecipient
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.marketSellOrdersWithEth.estimateGasAsync.bind(
+ self,
+ orders,
+ signatures,
+ feeOrders,
+ feeSignatures,
+ feePercentage,
+ feeRecipient
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ 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}>,
+ signatures: string[],
+ feeOrders: 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}>,
+ feeSignatures: string[],
+ feePercentage: BigNumber,
+ feeRecipient: string,
+ 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,
+ signatures,
+ feeOrders,
+ feeSignatures,
+ feePercentage,
+ feeRecipient
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ 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}>,
+ signatures: string[],
+ feeOrders: 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}>,
+ feeSignatures: string[],
+ feePercentage: BigNumber,
+ 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,
+ signatures,
+ feeOrders,
+ feeSignatures,
+ feePercentage,
+ feeRecipient
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ 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}>,
+ signatures: string[],
+ feeOrders: 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}>,
+ feeSignatures: string[],
+ feePercentage: BigNumber,
+ feeRecipient: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ signatures,
+ feeOrders,
+ feeSignatures,
+ feePercentage,
+ feeRecipient
+ ]);
+ 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);
+ 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;
+ },
+ };
+ public transferOwnership = {
+ async sendTransactionAsync(
+ newOwner: string,
+ 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 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 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 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 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
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ newOwner: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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;
+ },
+ };
+ public static async deployFrom0xArtifactAsync(
+ artifact: ContractArtifact,
+ provider: Provider,
+ txDefaults: Partial<TxData>,
+ _exchange: string,
+ _zrxAssetData: string,
+ _wethAssetData: string,
+ ): Promise<ForwarderContract> {
+ 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 ForwarderContract.deployAsync(bytecode, abi, provider, txDefaults, _exchange,
+_zrxAssetData,
+_wethAssetData
+);
+ }
+ public static async deployAsync(
+ bytecode: string,
+ abi: ContractAbi,
+ provider: Provider,
+ txDefaults: Partial<TxData>,
+ _exchange: string,
+ _zrxAssetData: string,
+ _wethAssetData: string,
+ ): Promise<ForwarderContract> {
+ const constructorAbi = BaseContract._lookupConstructorAbi(abi);
+ [_exchange,
+_zrxAssetData,
+_wethAssetData
+] = BaseContract._formatABIDataItemList(
+ constructorAbi.inputs,
+ [_exchange,
+_zrxAssetData,
+_wethAssetData
+],
+ BaseContract._bigNumberToString,
+ );
+ const iface = new ethers.utils.Interface(abi);
+ const deployInfo = iface.deployFunction;
+ const txData = deployInfo.encode(bytecode, [_exchange,
+_zrxAssetData,
+_wethAssetData
+]);
+ 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(`Forwarder successfully deployed at ${txReceipt.contractAddress}`);
+ const contractInstance = new ForwarderContract(abi, txReceipt.contractAddress as string, provider, txDefaults);
+ contractInstance.constructorArgs = [_exchange,
+_zrxAssetData,
+_wethAssetData
+];
+ return contractInstance;
+ }
+ constructor(abi: ContractAbi, address: string, provider: Provider, txDefaults?: Partial<TxData>) {
+ super('Forwarder', abi, address, provider, txDefaults);
+ classUtils.bindAll(this, ['_ethersInterfacesByFunctionSignature', '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
new file mode 100644
index 000000000..203a66b6d
--- /dev/null
+++ b/packages/abi-gen-wrappers/src/generated-wrappers/i_validator.ts
@@ -0,0 +1,108 @@
+// 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 { Web3Wrapper } from '@0x/web3-wrapper';
+import * as ethers from 'ethers';
+import * as _ from 'lodash';
+// tslint:enable:no-unused-variable
+
+
+/* istanbul ignore next */
+// tslint:disable:no-parameter-reassignment
+// tslint:disable-next-line:class-name
+export class IValidatorContract extends BaseContract {
+ public isValidSignature = {
+ async callAsync(
+ hash: string,
+ signerAddress: string,
+ signature: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ signerAddress,
+ signature
+ ]);
+ 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);
+ 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];
+ },
+ };
+ public static async deployFrom0xArtifactAsync(
+ artifact: ContractArtifact,
+ provider: Provider,
+ txDefaults: Partial<TxData>,
+ ): Promise<IValidatorContract> {
+ 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 IValidatorContract.deployAsync(bytecode, abi, provider, txDefaults, );
+ }
+ public static async deployAsync(
+ bytecode: string,
+ abi: ContractAbi,
+ provider: Provider,
+ txDefaults: Partial<TxData>,
+ ): Promise<IValidatorContract> {
+ 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(`IValidator successfully deployed at ${txReceipt.contractAddress}`);
+ const contractInstance = new IValidatorContract(abi, txReceipt.contractAddress as string, provider, txDefaults);
+ contractInstance.constructorArgs = [];
+ return contractInstance;
+ }
+ constructor(abi: ContractAbi, address: string, provider: Provider, txDefaults?: Partial<TxData>) {
+ super('IValidator', abi, address, provider, txDefaults);
+ classUtils.bindAll(this, ['_ethersInterfacesByFunctionSignature', '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
new file mode 100644
index 000000000..99809a049
--- /dev/null
+++ b/packages/abi-gen-wrappers/src/generated-wrappers/i_wallet.ts
@@ -0,0 +1,103 @@
+// 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 { Web3Wrapper } from '@0x/web3-wrapper';
+import * as ethers from 'ethers';
+import * as _ from 'lodash';
+// tslint:enable:no-unused-variable
+
+
+/* istanbul ignore next */
+// tslint:disable:no-parameter-reassignment
+// tslint:disable-next-line:class-name
+export class IWalletContract extends BaseContract {
+ public isValidSignature = {
+ async callAsync(
+ hash: string,
+ signature: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ signature
+ ]);
+ 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);
+ 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];
+ },
+ };
+ public static async deployFrom0xArtifactAsync(
+ artifact: ContractArtifact,
+ provider: Provider,
+ txDefaults: Partial<TxData>,
+ ): Promise<IWalletContract> {
+ 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 IWalletContract.deployAsync(bytecode, abi, provider, txDefaults, );
+ }
+ public static async deployAsync(
+ bytecode: string,
+ abi: ContractAbi,
+ provider: Provider,
+ txDefaults: Partial<TxData>,
+ ): Promise<IWalletContract> {
+ 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(`IWallet successfully deployed at ${txReceipt.contractAddress}`);
+ const contractInstance = new IWalletContract(abi, txReceipt.contractAddress as string, provider, txDefaults);
+ contractInstance.constructorArgs = [];
+ return contractInstance;
+ }
+ constructor(abi: ContractAbi, address: string, provider: Provider, txDefaults?: Partial<TxData>) {
+ super('IWallet', abi, address, provider, txDefaults);
+ classUtils.bindAll(this, ['_ethersInterfacesByFunctionSignature', '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
new file mode 100644
index 000000000..38233af3f
--- /dev/null
+++ b/packages/abi-gen-wrappers/src/generated-wrappers/order_validator.ts
@@ -0,0 +1,357 @@
+// 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 { Web3Wrapper } from '@0x/web3-wrapper';
+import * as ethers from 'ethers';
+import * as _ from 'lodash';
+// tslint:enable:no-unused-variable
+
+
+/* istanbul ignore next */
+// tslint:disable:no-parameter-reassignment
+// tslint:disable-next-line:class-name
+export class OrderValidatorContract extends BaseContract {
+ public getOrderAndTraderInfo = {
+ async callAsync(
+ 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},
+ takerAddress: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ takerAddress
+ ]);
+ 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);
+ 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;
+ },
+ };
+ public getBalanceAndAllowance = {
+ async callAsync(
+ target: string,
+ assetData: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ assetData
+ ]);
+ 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);
+ 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;
+ },
+ };
+ public getOrdersAndTradersInfo = {
+ async callAsync(
+ 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}>,
+ takerAddresses: string[],
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ takerAddresses
+ ]);
+ 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);
+ 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;
+ },
+ };
+ public getTradersInfo = {
+ async callAsync(
+ 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}>,
+ takerAddresses: string[],
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ takerAddresses
+ ]);
+ 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);
+ 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];
+ },
+ };
+ public getERC721TokenOwner = {
+ async callAsync(
+ token: string,
+ tokenId: BigNumber,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ tokenId
+ ]);
+ 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);
+ 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];
+ },
+ };
+ public getBalancesAndAllowances = {
+ async callAsync(
+ target: string,
+ assetData: string[],
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ assetData
+ ]);
+ 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);
+ 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;
+ },
+ };
+ public getTraderInfo = {
+ async callAsync(
+ 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},
+ takerAddress: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ takerAddress
+ ]);
+ 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);
+ 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];
+ },
+ };
+ public static async deployFrom0xArtifactAsync(
+ artifact: ContractArtifact,
+ provider: Provider,
+ txDefaults: Partial<TxData>,
+ _exchange: string,
+ _zrxAssetData: string,
+ ): Promise<OrderValidatorContract> {
+ 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 OrderValidatorContract.deployAsync(bytecode, abi, provider, txDefaults, _exchange,
+_zrxAssetData
+);
+ }
+ public static async deployAsync(
+ bytecode: string,
+ abi: ContractAbi,
+ provider: Provider,
+ txDefaults: Partial<TxData>,
+ _exchange: string,
+ _zrxAssetData: string,
+ ): Promise<OrderValidatorContract> {
+ const constructorAbi = BaseContract._lookupConstructorAbi(abi);
+ [_exchange,
+_zrxAssetData
+] = BaseContract._formatABIDataItemList(
+ constructorAbi.inputs,
+ [_exchange,
+_zrxAssetData
+],
+ BaseContract._bigNumberToString,
+ );
+ const iface = new ethers.utils.Interface(abi);
+ const deployInfo = iface.deployFunction;
+ const txData = deployInfo.encode(bytecode, [_exchange,
+_zrxAssetData
+]);
+ 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(`OrderValidator successfully deployed at ${txReceipt.contractAddress}`);
+ const contractInstance = new OrderValidatorContract(abi, txReceipt.contractAddress as string, provider, txDefaults);
+ contractInstance.constructorArgs = [_exchange,
+_zrxAssetData
+];
+ return contractInstance;
+ }
+ constructor(abi: ContractAbi, address: string, provider: Provider, txDefaults?: Partial<TxData>) {
+ super('OrderValidator', abi, address, provider, txDefaults);
+ classUtils.bindAll(this, ['_ethersInterfacesByFunctionSignature', '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
new file mode 100644
index 000000000..86d1031db
--- /dev/null
+++ b/packages/abi-gen-wrappers/src/generated-wrappers/weth9.ts
@@ -0,0 +1,835 @@
+// 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 { Web3Wrapper } from '@0x/web3-wrapper';
+import * as ethers from 'ethers';
+import * as _ from 'lodash';
+// tslint:enable:no-unused-variable
+
+export type WETH9EventArgs =
+ | WETH9ApprovalEventArgs
+ | WETH9TransferEventArgs
+ | WETH9DepositEventArgs
+ | WETH9WithdrawalEventArgs;
+
+export enum WETH9Events {
+ Approval = 'Approval',
+ Transfer = 'Transfer',
+ Deposit = 'Deposit',
+ Withdrawal = 'Withdrawal',
+}
+
+export interface WETH9ApprovalEventArgs extends DecodedLogArgs {
+ _owner: string;
+ _spender: string;
+ _value: BigNumber;
+}
+
+export interface WETH9TransferEventArgs extends DecodedLogArgs {
+ _from: string;
+ _to: string;
+ _value: BigNumber;
+}
+
+export interface WETH9DepositEventArgs extends DecodedLogArgs {
+ _owner: string;
+ _value: BigNumber;
+}
+
+export interface WETH9WithdrawalEventArgs extends DecodedLogArgs {
+ _owner: string;
+ _value: BigNumber;
+}
+
+
+/* istanbul ignore next */
+// tslint:disable:no-parameter-reassignment
+// tslint:disable-next-line:class-name
+export class WETH9Contract extends BaseContract {
+ public name = {
+ async callAsync(
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public approve = {
+ async sendTransactionAsync(
+ guy: string,
+ wad: BigNumber,
+ 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,
+ wad
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.approve.estimateGasAsync.bind(
+ self,
+ guy,
+ wad
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ guy: string,
+ wad: BigNumber,
+ 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,
+ wad
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ guy: string,
+ 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,
+ wad
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ guy: string,
+ wad: BigNumber,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ wad
+ ]);
+ 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);
+ 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];
+ },
+ };
+ public totalSupply = {
+ async callAsync(
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public transferFrom = {
+ async sendTransactionAsync(
+ src: string,
+ dst: string,
+ wad: BigNumber,
+ 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,
+ dst,
+ wad
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.transferFrom.estimateGasAsync.bind(
+ self,
+ src,
+ dst,
+ wad
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ src: string,
+ dst: string,
+ wad: BigNumber,
+ 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,
+ dst,
+ wad
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ src: string,
+ dst: string,
+ 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,
+ dst,
+ wad
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ src: string,
+ dst: string,
+ wad: BigNumber,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ dst,
+ wad
+ ]);
+ 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);
+ 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];
+ },
+ };
+ public withdraw = {
+ async sendTransactionAsync(
+ wad: BigNumber,
+ 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 txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.withdraw.estimateGasAsync.bind(
+ self,
+ wad
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ wad: BigNumber,
+ 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 txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ 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
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ wad: BigNumber,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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;
+ },
+ };
+ public decimals = {
+ async callAsync(
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public balanceOf = {
+ async callAsync(
+ index_0: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public symbol = {
+ async callAsync(
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public transfer = {
+ async sendTransactionAsync(
+ dst: string,
+ wad: BigNumber,
+ 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,
+ wad
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.transfer.estimateGasAsync.bind(
+ self,
+ dst,
+ wad
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ dst: string,
+ wad: BigNumber,
+ 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,
+ wad
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ dst: string,
+ 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,
+ wad
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ dst: string,
+ wad: BigNumber,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ wad
+ ]);
+ 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);
+ 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];
+ },
+ };
+ public deposit = {
+ async sendTransactionAsync(
+ 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 txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.deposit.estimateGasAsync.bind(
+ self,
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ 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 txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ 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([]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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;
+ },
+ };
+ public allowance = {
+ async callAsync(
+ index_0: string,
+ index_1: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ index_1
+ ]);
+ 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);
+ 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];
+ },
+ };
+ public static async deployFrom0xArtifactAsync(
+ artifact: ContractArtifact,
+ provider: Provider,
+ txDefaults: Partial<TxData>,
+ ): Promise<WETH9Contract> {
+ 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 WETH9Contract.deployAsync(bytecode, abi, provider, txDefaults, );
+ }
+ public static async deployAsync(
+ bytecode: string,
+ abi: ContractAbi,
+ provider: Provider,
+ txDefaults: Partial<TxData>,
+ ): Promise<WETH9Contract> {
+ 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(`WETH9 successfully deployed at ${txReceipt.contractAddress}`);
+ const contractInstance = new WETH9Contract(abi, txReceipt.contractAddress as string, provider, txDefaults);
+ contractInstance.constructorArgs = [];
+ return contractInstance;
+ }
+ constructor(abi: ContractAbi, address: string, provider: Provider, txDefaults?: Partial<TxData>) {
+ super('WETH9', abi, address, provider, txDefaults);
+ classUtils.bindAll(this, ['_ethersInterfacesByFunctionSignature', '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
new file mode 100644
index 000000000..98079e77b
--- /dev/null
+++ b/packages/abi-gen-wrappers/src/generated-wrappers/zrx_token.ts
@@ -0,0 +1,646 @@
+// 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 { Web3Wrapper } from '@0x/web3-wrapper';
+import * as ethers from 'ethers';
+import * as _ from 'lodash';
+// tslint:enable:no-unused-variable
+
+export type ZRXTokenEventArgs =
+ | ZRXTokenTransferEventArgs
+ | ZRXTokenApprovalEventArgs;
+
+export enum ZRXTokenEvents {
+ Transfer = 'Transfer',
+ Approval = 'Approval',
+}
+
+export interface ZRXTokenTransferEventArgs extends DecodedLogArgs {
+ _from: string;
+ _to: string;
+ _value: BigNumber;
+}
+
+export interface ZRXTokenApprovalEventArgs extends DecodedLogArgs {
+ _owner: string;
+ _spender: string;
+ _value: BigNumber;
+}
+
+
+/* istanbul ignore next */
+// tslint:disable:no-parameter-reassignment
+// tslint:disable-next-line:class-name
+export class ZRXTokenContract extends BaseContract {
+ public name = {
+ async callAsync(
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public approve = {
+ async sendTransactionAsync(
+ _spender: string,
+ _value: BigNumber,
+ 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,
+ _value
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.approve.estimateGasAsync.bind(
+ self,
+ _spender,
+ _value
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ _spender: string,
+ _value: BigNumber,
+ 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,
+ _value
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ _spender: string,
+ _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,
+ _value
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ _spender: string,
+ _value: BigNumber,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ _value
+ ]);
+ 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);
+ 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];
+ },
+ };
+ public totalSupply = {
+ async callAsync(
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public transferFrom = {
+ async sendTransactionAsync(
+ _from: string,
+ _to: string,
+ _value: BigNumber,
+ 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,
+ _to,
+ _value
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.transferFrom.estimateGasAsync.bind(
+ self,
+ _from,
+ _to,
+ _value
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ _from: string,
+ _to: string,
+ _value: BigNumber,
+ 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,
+ _to,
+ _value
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ _from: string,
+ _to: string,
+ _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,
+ _to,
+ _value
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ _from: string,
+ _to: string,
+ _value: BigNumber,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ _to,
+ _value
+ ]);
+ 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);
+ 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];
+ },
+ };
+ public decimals = {
+ async callAsync(
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public balanceOf = {
+ async callAsync(
+ _owner: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public symbol = {
+ async callAsync(
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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 callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ 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];
+ },
+ };
+ public transfer = {
+ async sendTransactionAsync(
+ _to: string,
+ _value: BigNumber,
+ 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,
+ _value
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.transfer.estimateGasAsync.bind(
+ self,
+ _to,
+ _value
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ _to: string,
+ _value: BigNumber,
+ 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,
+ _value
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ _to: string,
+ _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,
+ _value
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ _to: string,
+ _value: BigNumber,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ _value
+ ]);
+ 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);
+ 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];
+ },
+ };
+ public allowance = {
+ async callAsync(
+ _owner: string,
+ _spender: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): 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,
+ _spender
+ ]);
+ 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);
+ 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];
+ },
+ };
+ public static async deployFrom0xArtifactAsync(
+ artifact: ContractArtifact,
+ provider: Provider,
+ txDefaults: Partial<TxData>,
+ ): Promise<ZRXTokenContract> {
+ 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 ZRXTokenContract.deployAsync(bytecode, abi, provider, txDefaults, );
+ }
+ public static async deployAsync(
+ bytecode: string,
+ abi: ContractAbi,
+ provider: Provider,
+ txDefaults: Partial<TxData>,
+ ): Promise<ZRXTokenContract> {
+ 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(`ZRXToken successfully deployed at ${txReceipt.contractAddress}`);
+ const contractInstance = new ZRXTokenContract(abi, txReceipt.contractAddress as string, provider, txDefaults);
+ contractInstance.constructorArgs = [];
+ return contractInstance;
+ }
+ constructor(abi: ContractAbi, address: string, provider: Provider, txDefaults?: Partial<TxData>) {
+ super('ZRXToken', abi, address, provider, txDefaults);
+ classUtils.bindAll(this, ['_ethersInterfacesByFunctionSignature', '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
new file mode 100644
index 000000000..de418214b
--- /dev/null
+++ b/packages/abi-gen-wrappers/src/index.ts
@@ -0,0 +1,14 @@
+export * from './generated-wrappers/asset_proxy_owner';
+export * from './generated-wrappers/dummy_erc20_token';
+export * from './generated-wrappers/dummy_erc721_token';
+export * from './generated-wrappers/erc20_proxy';
+export * from './generated-wrappers/erc20_token';
+export * from './generated-wrappers/erc721_proxy';
+export * from './generated-wrappers/erc721_token';
+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/order_validator';
+export * from './generated-wrappers/weth9';
+export * from './generated-wrappers/zrx_token';
diff --git a/packages/sra-report/tsconfig.json b/packages/abi-gen-wrappers/tsconfig.json
index 2ee711adc..233008d61 100644
--- a/packages/sra-report/tsconfig.json
+++ b/packages/abi-gen-wrappers/tsconfig.json
@@ -4,5 +4,5 @@
"outDir": "lib",
"rootDir": "."
},
- "include": ["./src/**/*", "./test/**/*"]
+ "include": ["./src/**/*"]
}
diff --git a/packages/abi-gen-wrappers/tslint.json b/packages/abi-gen-wrappers/tslint.json
new file mode 100644
index 000000000..dd9053357
--- /dev/null
+++ b/packages/abi-gen-wrappers/tslint.json
@@ -0,0 +1,3 @@
+{
+ "extends": ["@0x/tslint-config"]
+}
diff --git a/packages/abi-gen/CHANGELOG.json b/packages/abi-gen/CHANGELOG.json
index d5e0f9469..658a997f4 100644
--- a/packages/abi-gen/CHANGELOG.json
+++ b/packages/abi-gen/CHANGELOG.json
@@ -1,5 +1,23 @@
[
{
+ "version": "1.0.15",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ],
+ "timestamp": 1541740904
+ },
+ {
+ "timestamp": 1539871071,
+ "version": "1.0.14",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
"version": "1.0.13",
"changes": [
{
diff --git a/packages/abi-gen/CHANGELOG.md b/packages/abi-gen/CHANGELOG.md
index ed955a051..21fda1656 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.15 - _November 9, 2018_
+
+ * Dependencies updated
+
+## v1.0.14 - _October 18, 2018_
+
+ * Dependencies updated
+
## v1.0.13 - _October 4, 2018_
* Dependencies updated
@@ -37,7 +45,7 @@ CHANGELOG
* Dependencies updated
-## v1.0.5 - _August 13, 2018_
+## v1.0.5 - _August 14, 2018_
* Dependencies updated
diff --git a/packages/abi-gen/README.md b/packages/abi-gen/README.md
index b6dd37cd1..20b9d4f30 100644
--- a/packages/abi-gen/README.md
+++ b/packages/abi-gen/README.md
@@ -8,7 +8,7 @@ You can write your custom handlebars templates which will allow you to seamlessl
## Installation
-`yarn add -g @0xproject/abi-gen`
+`yarn add -g @0x/abi-gen`
## Usage
@@ -82,13 +82,13 @@ yarn install
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
```bash
-PKG=@0xproject/abi-gen yarn build
+PKG=@0x/abi-gen yarn build
```
Or continuously rebuild on change:
```bash
-PKG=@0xproject/abi-gen yarn watch
+PKG=@0x/abi-gen yarn watch
```
### Clean
diff --git a/packages/abi-gen/package.json b/packages/abi-gen/package.json
index d6cd80978..5367c9c29 100644
--- a/packages/abi-gen/package.json
+++ b/packages/abi-gen/package.json
@@ -1,6 +1,6 @@
{
- "name": "@0xproject/abi-gen",
- "version": "1.0.13",
+ "name": "@0x/abi-gen",
+ "version": "1.0.15",
"engines": {
"node": ">=6.12"
},
@@ -8,7 +8,7 @@
"main": "lib/src/index.js",
"types": "lib/src/index.d.ts",
"scripts": {
- "lint": "tslint --project .",
+ "lint": "tslint --format stylish --project .",
"clean": "shx rm -rf lib",
"build": "tsc -b",
"build:ci": "yarn build",
@@ -31,10 +31,10 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/abi-gen/README.md",
"dependencies": {
- "@0xproject/typescript-typings": "^3.0.2",
- "@0xproject/utils": "^2.0.2",
+ "@0x/typescript-typings": "^3.0.4",
+ "@0x/utils": "^2.0.4",
"chalk": "^2.3.0",
- "ethereum-types": "^1.0.11",
+ "ethereum-types": "^1.1.2",
"glob": "^7.1.2",
"handlebars": "^4.0.11",
"lodash": "^4.17.5",
@@ -45,7 +45,7 @@
"yargs": "^10.0.3"
},
"devDependencies": {
- "@0xproject/tslint-config": "^1.0.8",
+ "@0x/tslint-config": "^1.0.10",
"@types/glob": "5.0.35",
"@types/handlebars": "^4.0.36",
"@types/mkdirp": "^0.5.1",
@@ -54,7 +54,6 @@
"@types/tmp": "^0.0.33",
"@types/yargs": "^10.0.0",
"chai": "^4.1.2",
- "copyfiles": "^2.0.0",
"dirty-chai": "^2.0.1",
"make-promises-safe": "^1.1.0",
"mocha": "^5.2.0",
diff --git a/packages/abi-gen/src/index.ts b/packages/abi-gen/src/index.ts
index f5283b97a..5bad920ca 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 '@0xproject/utils';
+import { abiUtils, logUtils } from '@0x/utils';
import chalk from 'chalk';
import { AbiDefinition, ConstructorAbi, EventAbi, MethodAbi } from 'ethereum-types';
import { sync as globSync } from 'glob';
diff --git a/packages/abi-gen/tslint.json b/packages/abi-gen/tslint.json
index ffaefe83a..dd9053357 100644
--- a/packages/abi-gen/tslint.json
+++ b/packages/abi-gen/tslint.json
@@ -1,3 +1,3 @@
{
- "extends": ["@0xproject/tslint-config"]
+ "extends": ["@0x/tslint-config"]
}
diff --git a/packages/assert/CHANGELOG.json b/packages/assert/CHANGELOG.json
index ec84f099e..82c0938cf 100644
--- a/packages/assert/CHANGELOG.json
+++ b/packages/assert/CHANGELOG.json
@@ -1,5 +1,23 @@
[
{
+ "version": "1.0.15",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ],
+ "timestamp": 1541740904
+ },
+ {
+ "timestamp": 1539871071,
+ "version": "1.0.14",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
"version": "1.0.13",
"changes": [
{
diff --git a/packages/assert/CHANGELOG.md b/packages/assert/CHANGELOG.md
index b9f097c4e..7d0895eca 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.15 - _November 9, 2018_
+
+ * Dependencies updated
+
+## v1.0.14 - _October 18, 2018_
+
+ * Dependencies updated
+
## v1.0.13 - _October 4, 2018_
* Dependencies updated
@@ -37,7 +45,7 @@ CHANGELOG
* Dependencies updated
-## v1.0.5 - _August 13, 2018_
+## v1.0.5 - _August 14, 2018_
* Dependencies updated
diff --git a/packages/assert/README.md b/packages/assert/README.md
index 1f2139d47..647586f15 100644
--- a/packages/assert/README.md
+++ b/packages/assert/README.md
@@ -1,17 +1,17 @@
-## @0xproject/assert
+## @0x/assert
Standard type and schema assertions to be used across all 0x projects and packages
## Installation
```bash
-yarn add @0xproject/assert
+yarn add @0x/assert
```
## Usage
```typescript
-import { assert } from '@0xproject/assert';
+import { assert } from '@0x/assert';
assert.isValidBaseUnitAmount('baseUnitAmount', baseUnitAmount);
```
@@ -20,7 +20,7 @@ If your project is in [TypeScript](https://www.typescriptlang.org/), add the fol
```json
"compilerOptions": {
- "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"],
+ "typeRoots": ["node_modules/@0x/typescript-typings/types", "node_modules/@types"],
}
```
@@ -49,13 +49,13 @@ yarn install
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
```bash
-PKG=@0xproject/assert yarn build
+PKG=@0x/assert yarn build
```
Or continuously rebuild on change:
```bash
-PKG=@0xproject/assert yarn watch
+PKG=@0x/assert yarn watch
```
### Clean
diff --git a/packages/assert/package.json b/packages/assert/package.json
index 795010cd0..cc2fdaae9 100644
--- a/packages/assert/package.json
+++ b/packages/assert/package.json
@@ -1,6 +1,6 @@
{
- "name": "@0xproject/assert",
- "version": "1.0.13",
+ "name": "@0x/assert",
+ "version": "1.0.15",
"engines": {
"node": ">=6.12"
},
@@ -11,7 +11,7 @@
"build": "tsc -b",
"build:ci": "yarn build",
"clean": "shx rm -rf lib test_temp",
- "lint": "tslint --project .",
+ "lint": "tslint --format stylish --project .",
"run_mocha": "mocha --require source-map-support/register --require make-promises-safe lib/test/**/*_test.js --exit",
"test": "yarn run_mocha",
"rebuild_and_test": "run-s clean build test",
@@ -29,12 +29,11 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/assert/README.md",
"devDependencies": {
- "@0xproject/tslint-config": "^1.0.8",
+ "@0x/tslint-config": "^1.0.10",
"@types/lodash": "4.14.104",
"@types/mocha": "^2.2.42",
"@types/valid-url": "^1.0.2",
"chai": "^4.0.1",
- "copyfiles": "^2.0.0",
"dirty-chai": "^2.0.1",
"make-promises-safe": "^1.1.0",
"mocha": "^4.1.0",
@@ -45,9 +44,9 @@
"typescript": "3.0.1"
},
"dependencies": {
- "@0xproject/json-schemas": "^1.0.7",
- "@0xproject/typescript-typings": "^3.0.2",
- "@0xproject/utils": "^2.0.2",
+ "@0x/json-schemas": "^2.0.1",
+ "@0x/typescript-typings": "^3.0.4",
+ "@0x/utils": "^2.0.4",
"lodash": "^4.17.5",
"valid-url": "^1.0.9"
},
diff --git a/packages/assert/src/index.ts b/packages/assert/src/index.ts
index ccf2c9ad8..2d28d51e1 100644
--- a/packages/assert/src/index.ts
+++ b/packages/assert/src/index.ts
@@ -1,5 +1,5 @@
-import { Schema, SchemaValidator } from '@0xproject/json-schemas';
-import { addressUtils, BigNumber } from '@0xproject/utils';
+import { Schema, SchemaValidator } from '@0x/json-schemas';
+import { addressUtils, BigNumber } from '@0x/utils';
import * as _ from 'lodash';
import * as validUrl from 'valid-url';
diff --git a/packages/assert/test/assert_test.ts b/packages/assert/test/assert_test.ts
index cbbfe39db..9266496ac 100644
--- a/packages/assert/test/assert_test.ts
+++ b/packages/assert/test/assert_test.ts
@@ -1,5 +1,5 @@
-import { schemas } from '@0xproject/json-schemas';
-import { BigNumber } from '@0xproject/utils';
+import { schemas } from '@0x/json-schemas';
+import { BigNumber } from '@0x/utils';
import * as chai from 'chai';
import * as dirtyChai from 'dirty-chai';
import 'mocha';
diff --git a/packages/assert/tslint.json b/packages/assert/tslint.json
index ffaefe83a..dd9053357 100644
--- a/packages/assert/tslint.json
+++ b/packages/assert/tslint.json
@@ -1,3 +1,3 @@
{
- "extends": ["@0xproject/tslint-config"]
+ "extends": ["@0x/tslint-config"]
}
diff --git a/packages/asset-buyer/CHANGELOG.json b/packages/asset-buyer/CHANGELOG.json
index dbb801b69..df4531063 100644
--- a/packages/asset-buyer/CHANGELOG.json
+++ b/packages/asset-buyer/CHANGELOG.json
@@ -1,11 +1,70 @@
[
{
+ "version": "2.2.0",
+ "changes": [
+ {
+ "note": "`getAssetBuyerForProvidedOrders` factory function now takes 3 args instead of 4",
+ "pr": 1187
+ },
+ {
+ "note":
+ "the `OrderProvider` now requires a new method `getAvailableMakerAssetDatasAsync` and the `StandardRelayerAPIOrderProvider` requires the network id at init.",
+ "pr": 1203
+ },
+ {
+ "note": "No longer require that provided orders all have the same maker and taker asset data",
+ "pr": 1197
+ },
+ {
+ "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",
+ "pr": 1207
+ },
+ {
+ "note": "Lower default expiry buffer from 5 minutes to 2 minutes",
+ "pr": 1217
+ }
+ ],
+ "timestamp": 1541740904
+ },
+ {
"version": "2.1.0",
"changes": [
{
"note": "Add `gasLimit` and `gasPrice` as optional properties on `BuyQuoteExecutionOpts`"
+ },
+ {
+ "note": "Export `BuyQuoteInfo` type",
+ "pr": 1131
+ },
+ {
+ "note":
+ "Updated to use new modularized artifacts and the latest version of @0xproject/contract-wrappers",
+ "pr": 1105
+ },
+ {
+ "note": "Add `gasLimit` and `gasPrice` as optional properties on `BuyQuoteExecutionOpts`",
+ "pr": 1116
+ },
+ {
+ "note": "Add `docs:json` command to package.json",
+ "pr": 1139
+ },
+ {
+ "note": "Add missing types to public interface",
+ "pr": 1139
+ },
+ {
+ "note": "Throw `SignatureRequestDenied` and `TransactionValueTooLow` errors when executing buy",
+ "pr": 1147
}
- ]
+ ],
+ "timestamp": 1539871071
},
{
"version": "2.0.0",
diff --git a/packages/asset-buyer/CHANGELOG.md b/packages/asset-buyer/CHANGELOG.md
index 65d190a2d..d6220767e 100644
--- a/packages/asset-buyer/CHANGELOG.md
+++ b/packages/asset-buyer/CHANGELOG.md
@@ -5,6 +5,25 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
+## v2.2.0 - _November 9, 2018_
+
+ * `getAssetBuyerForProvidedOrders` factory function now takes 3 args instead of 4 (#1187)
+ * the `OrderProvider` now requires a new method `getAvailableMakerAssetDatasAsync` and the `StandardRelayerAPIOrderProvider` requires the network id at init. (#1203)
+ * No longer require that provided orders all have the same maker and taker asset data (#1197)
+ * Fix bug where `BuyQuoteInfo` objects could return `totalEthAmount` and `feeEthAmount` that were not whole numbers (#1207)
+ * Fix bug where default values for `AssetBuyer` public facing methods could get overriden by `undefined` values (#1207)
+ * Lower default expiry buffer from 5 minutes to 2 minutes (#1217)
+
+## v2.1.0 - _October 18, 2018_
+
+ * Add `gasLimit` and `gasPrice` as optional properties on `BuyQuoteExecutionOpts`
+ * Export `BuyQuoteInfo` type (#1131)
+ * Updated to use new modularized artifacts and the latest version of @0xproject/contract-wrappers (#1105)
+ * Add `gasLimit` and `gasPrice` as optional properties on `BuyQuoteExecutionOpts` (#1116)
+ * Add `docs:json` command to package.json (#1139)
+ * Add missing types to public interface (#1139)
+ * Throw `SignatureRequestDenied` and `TransactionValueTooLow` errors when executing buy (#1147)
+
## v2.0.0 - _October 4, 2018_
* Expand AssetBuyer to work with multiple assets at once (#1086)
diff --git a/packages/asset-buyer/README.md b/packages/asset-buyer/README.md
index 81c7e1e85..383a3836a 100644
--- a/packages/asset-buyer/README.md
+++ b/packages/asset-buyer/README.md
@@ -1,4 +1,4 @@
-## @0xproject/asset-buyer
+## @0x/asset-buyer
**Warning: In Beta, has not been extensively tested.**
@@ -9,26 +9,26 @@ In its more advanced and useful form, it integrates with the [Standard Relayer A
## Installation
```bash
-yarn add @0xproject/asset-buyer
+yarn add @0x/asset-buyer
```
**Import**
```typescript
-import { AssetBuyer } from '@0xproject/asset-buyer';
+import { AssetBuyer } from '@0x/asset-buyer';
```
or
```javascript
-var AssetBuyer = require('@0xproject/asset-buyer').AssetBuyer;
+var AssetBuyer = require('@0x/asset-buyer').AssetBuyer;
```
If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`:
```json
"compilerOptions": {
- "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"],
+ "typeRoots": ["node_modules/@0x/typescript-typings/types", "node_modules/@types"],
}
```
@@ -57,13 +57,13 @@ yarn install
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
```bash
-PKG=@0xproject/asset-buyer yarn build
+PKG=@0x/asset-buyer yarn build
```
Or continuously rebuild on change:
```bash
-PKG=@0xproject/asset-buyer yarn watch
+PKG=@0x/asset-buyer yarn watch
```
### Clean
diff --git a/packages/asset-buyer/package.json b/packages/asset-buyer/package.json
index 291342169..fc2414952 100644
--- a/packages/asset-buyer/package.json
+++ b/packages/asset-buyer/package.json
@@ -1,6 +1,6 @@
{
- "name": "@0xproject/asset-buyer",
- "version": "2.0.0",
+ "name": "@0x/asset-buyer",
+ "version": "2.2.0",
"engines": {
"node": ">=6.12"
},
@@ -8,18 +8,17 @@
"main": "lib/src/index.js",
"types": "lib/src/index.d.ts",
"scripts": {
- "watch_without_deps": "tsc -w",
- "lint": "tslint --project .",
+ "build": "yarn tsc -b",
+ "build:ci": "yarn build",
+ "lint": "tslint --format stylish --project .",
"test": "yarn run_mocha",
"rebuild_and_test": "run-s clean build test",
"test:coverage": "nyc npm run test --all && yarn coverage:report:lcov",
"coverage:report:lcov": "nyc report --reporter=text-lcov > coverage/lcov.info",
"test:circleci": "yarn test:coverage",
"run_mocha": "mocha --require source-map-support/register --require make-promises-safe lib/test/**/*_test.js --exit",
- "clean": "shx rm -rf lib test_temp scripts",
- "build": "tsc && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts",
- "build:ci": "yarn build",
- "manual:postpublish": "yarn build; node ./scripts/postpublish.js"
+ "clean": "shx rm -rf lib test_temp",
+ "docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --tsconfig typedoc-tsconfig.json --json $JSON_FILE_PATH $PROJECT_FILES"
},
"config": {
"postpublish": {
@@ -37,28 +36,27 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/asset-buyer/README.md",
"dependencies": {
- "@0xproject/assert": "^1.0.13",
- "@0xproject/connect": "^3.0.1",
- "@0xproject/contract-wrappers": "^2.0.2",
- "@0xproject/json-schemas": "^1.0.7",
- "@0xproject/order-utils": "^1.0.7",
- "@0xproject/subproviders": "^2.0.7",
- "@0xproject/types": "^1.1.4",
- "@0xproject/typescript-typings": "^3.0.2",
- "@0xproject/utils": "^2.0.2",
- "@0xproject/web3-wrapper": "^3.0.3",
- "ethereum-types": "^1.0.11",
+ "@0x/assert": "^1.0.15",
+ "@0x/connect": "^3.0.3",
+ "@0x/contract-wrappers": "^3.0.1",
+ "@0x/json-schemas": "^2.0.1",
+ "@0x/order-utils": "^2.0.1",
+ "@0x/subproviders": "^2.1.1",
+ "@0x/types": "^1.2.1",
+ "@0x/typescript-typings": "^3.0.4",
+ "@0x/utils": "^2.0.4",
+ "@0x/web3-wrapper": "^3.1.1",
+ "ethereum-types": "^1.1.2",
"lodash": "^4.17.10"
},
"devDependencies": {
- "@0xproject/tslint-config": "^1.0.8",
+ "@0x/tslint-config": "^1.0.10",
"@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",
- "copyfiles": "^1.2.0",
"dirty-chai": "^2.0.1",
"make-promises-safe": "^1.1.0",
"mocha": "^4.1.0",
@@ -66,7 +64,7 @@
"nyc": "^11.0.1",
"shx": "^0.2.2",
"tslint": "5.11.0",
- "typedoc": "0.12.0",
+ "typedoc": "0.13.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 50343efde..934410c55 100644
--- a/packages/asset-buyer/src/asset_buyer.ts
+++ b/packages/asset-buyer/src/asset_buyer.ts
@@ -1,9 +1,9 @@
-import { ContractWrappers } from '@0xproject/contract-wrappers';
-import { schemas } from '@0xproject/json-schemas';
-import { SignedOrder } from '@0xproject/order-utils';
-import { ObjectMap } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { ContractWrappers, ContractWrappersError, ForwarderWrapperError } from '@0x/contract-wrappers';
+import { schemas } from '@0x/json-schemas';
+import { SignedOrder } from '@0x/order-utils';
+import { ObjectMap } from '@0x/types';
+import { BigNumber } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import { Provider } from 'ethereum-types';
import * as _ from 'lodash';
@@ -52,16 +52,12 @@ export class AssetBuyer {
public static getAssetBuyerForProvidedOrders(
provider: Provider,
orders: SignedOrder[],
- feeOrders: SignedOrder[] = [],
options: Partial<AssetBuyerOpts> = {},
): AssetBuyer {
assert.isWeb3Provider('provider', provider);
assert.doesConformToSchema('orders', orders, schemas.signedOrdersSchema);
- assert.doesConformToSchema('feeOrders', feeOrders, schemas.signedOrdersSchema);
- assert.areValidProvidedOrders('orders', orders);
- assert.areValidProvidedOrders('feeOrders', feeOrders);
assert.assert(orders.length !== 0, `Expected orders to contain at least one order`);
- const orderProvider = new BasicOrderProvider(_.concat(orders, feeOrders));
+ const orderProvider = new BasicOrderProvider(orders);
const assetBuyer = new AssetBuyer(provider, orderProvider, options);
return assetBuyer;
}
@@ -80,7 +76,8 @@ export class AssetBuyer {
): AssetBuyer {
assert.isWeb3Provider('provider', provider);
assert.isWebUri('sraApiUrl', sraApiUrl);
- const orderProvider = new StandardRelayerAPIOrderProvider(sraApiUrl);
+ const networkId = options.networkId || constants.DEFAULT_ASSET_BUYER_OPTS.networkId;
+ const orderProvider = new StandardRelayerAPIOrderProvider(sraApiUrl, networkId);
const assetBuyer = new AssetBuyer(provider, orderProvider, options);
return assetBuyer;
}
@@ -93,10 +90,11 @@ export class AssetBuyer {
* @return An instance of AssetBuyer
*/
constructor(provider: Provider, orderProvider: OrderProvider, options: Partial<AssetBuyerOpts> = {}) {
- const { networkId, orderRefreshIntervalMs, expiryBufferSeconds } = {
- ...constants.DEFAULT_ASSET_BUYER_OPTS,
- ...options,
- };
+ const { networkId, orderRefreshIntervalMs, expiryBufferSeconds } = _.merge(
+ {},
+ constants.DEFAULT_ASSET_BUYER_OPTS,
+ options,
+ );
assert.isWeb3Provider('provider', provider);
assert.isValidOrderProvider('orderProvider', orderProvider);
assert.isNumber('networkId', networkId);
@@ -125,19 +123,25 @@ export class AssetBuyer {
assetBuyAmount: BigNumber,
options: Partial<BuyQuoteRequestOpts> = {},
): Promise<BuyQuote> {
- const { feePercentage, shouldForceOrderRefresh, slippagePercentage } = {
- ...constants.DEFAULT_BUY_QUOTE_REQUEST_OPTS,
- ...options,
- };
+ const { feePercentage, shouldForceOrderRefresh, slippagePercentage } = _.merge(
+ {},
+ constants.DEFAULT_BUY_QUOTE_REQUEST_OPTS,
+ options,
+ );
assert.isString('assetData', assetData);
assert.isBigNumber('assetBuyAmount', assetBuyAmount);
assert.isValidPercentage('feePercentage', feePercentage);
assert.isBoolean('shouldForceOrderRefresh', shouldForceOrderRefresh);
assert.isNumber('slippagePercentage', slippagePercentage);
const zrxTokenAssetData = this._getZrxTokenAssetDataOrThrow();
+ const isMakerAssetZrxToken = assetData === zrxTokenAssetData;
+ // 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(zrxTokenAssetData, shouldForceOrderRefresh),
+ isMakerAssetZrxToken
+ ? Promise.resolve(constants.EMPTY_ORDERS_AND_FILLABLE_AMOUNTS)
+ : this._getOrdersAndFillableAmountsAsync(zrxTokenAssetData, shouldForceOrderRefresh),
shouldForceOrderRefresh,
]);
if (ordersAndFillableAmounts.orders.length === 0) {
@@ -149,6 +153,7 @@ export class AssetBuyer {
assetBuyAmount,
feePercentage,
slippagePercentage,
+ isMakerAssetZrxToken,
);
return buyQuote;
}
@@ -183,10 +188,11 @@ export class AssetBuyer {
buyQuote: BuyQuote,
options: Partial<BuyQuoteExecutionOpts> = {},
): Promise<string> {
- const { ethAmount, takerAddress, feeRecipient, gasLimit, gasPrice } = {
- ...constants.DEFAULT_BUY_QUOTE_EXECUTION_OPTS,
- ...options,
- };
+ const { ethAmount, takerAddress, feeRecipient, gasLimit, gasPrice } = _.merge(
+ {},
+ constants.DEFAULT_BUY_QUOTE_EXECUTION_OPTS,
+ options,
+ );
assert.isValidBuyQuote('buyQuote', buyQuote);
if (!_.isUndefined(ethAmount)) {
assert.isBigNumber('ethAmount', ethAmount);
@@ -195,6 +201,12 @@ export class AssetBuyer {
assert.isETHAddressHex('takerAddress', takerAddress);
}
assert.isETHAddressHex('feeRecipient', feeRecipient);
+ if (!_.isUndefined(gasLimit)) {
+ assert.isNumber('gasLimit', gasLimit);
+ }
+ if (!_.isUndefined(gasPrice)) {
+ assert.isBigNumber('gasPrice', gasPrice);
+ }
const { orders, feeOrders, feePercentage, assetBuyAmount, worstCaseQuoteInfo } = buyQuote;
// if no takerAddress is provided, try to get one from the provider
let finalTakerAddress;
@@ -210,21 +222,41 @@ export class AssetBuyer {
throw new Error(AssetBuyerError.NoAddressAvailable);
}
}
- // if no ethAmount is provided, default to the worst ethAmount from buyQuote
- const txHash = await this._contractWrappers.forwarder.marketBuyOrdersWithEthAsync(
- orders,
- assetBuyAmount,
- finalTakerAddress,
- ethAmount || worstCaseQuoteInfo.totalEthAmount,
- feeOrders,
- feePercentage,
- feeRecipient,
- {
- gasLimit,
- gasPrice,
- },
- );
- return txHash;
+ try {
+ // if no ethAmount is provided, default to the worst ethAmount from buyQuote
+ const txHash = await this._contractWrappers.forwarder.marketBuyOrdersWithEthAsync(
+ orders,
+ assetBuyAmount,
+ finalTakerAddress,
+ ethAmount || worstCaseQuoteInfo.totalEthAmount,
+ feeOrders,
+ feePercentage,
+ feeRecipient,
+ {
+ gasLimit,
+ gasPrice,
+ shouldValidate: true,
+ },
+ );
+ return txHash;
+ } catch (err) {
+ if (_.includes(err.message, ContractWrappersError.SignatureRequestDenied)) {
+ throw new Error(AssetBuyerError.SignatureRequestDenied);
+ } else if (_.includes(err.message, ForwarderWrapperError.CompleteFillFailed)) {
+ throw new Error(AssetBuyerError.TransactionValueTooLow);
+ } else {
+ throw err;
+ }
+ }
+ }
+ /**
+ * Get the asset data of all assets that are purchaseable with ether token (wETH) in the order provider passed in at init.
+ *
+ * @return An array of asset data strings that can be purchased using wETH.
+ */
+ public async getAvailableAssetDatasAsync(): Promise<string[]> {
+ const etherTokenAssetData = this._getEtherTokenAssetDataOrThrow();
+ return this.orderProvider.getAvailableMakerAssetDatasAsync(etherTokenAssetData);
}
/**
* Grab orders from the map, if there is a miss or it is time to refresh, fetch and process the orders
@@ -283,13 +315,13 @@ export class AssetBuyer {
* Will throw if WETH does not exist for the current network.
*/
private _getEtherTokenAssetDataOrThrow(): string {
- return assetDataUtils.getEtherTokenAssetDataOrThrow(this._contractWrappers);
+ return assetDataUtils.getEtherTokenAssetData(this._contractWrappers);
}
/**
* Get the assetData that represents the ZRX token.
* Will throw if ZRX does not exist for the current network.
*/
private _getZrxTokenAssetDataOrThrow(): string {
- return assetDataUtils.getZrxTokenAssetDataOrThrow(this._contractWrappers);
+ return this._contractWrappers.exchange.getZRXAssetData();
}
}
diff --git a/packages/asset-buyer/src/constants.ts b/packages/asset-buyer/src/constants.ts
index e095dee06..c0e1bf27d 100644
--- a/packages/asset-buyer/src/constants.ts
+++ b/packages/asset-buyer/src/constants.ts
@@ -1,6 +1,7 @@
-import { BigNumber } from '@0xproject/utils';
+import { SignedOrder } from '@0x/types';
+import { BigNumber } from '@0x/utils';
-import { AssetBuyerOpts, BuyQuoteExecutionOpts, BuyQuoteRequestOpts } from './types';
+import { AssetBuyerOpts, BuyQuoteExecutionOpts, BuyQuoteRequestOpts, OrdersAndFillableAmounts } from './types';
const NULL_ADDRESS = '0x0000000000000000000000000000000000000000';
const MAINNET_NETWORK_ID = 1;
@@ -8,7 +9,7 @@ const MAINNET_NETWORK_ID = 1;
const DEFAULT_ASSET_BUYER_OPTS: AssetBuyerOpts = {
networkId: MAINNET_NETWORK_ID,
orderRefreshIntervalMs: 10000, // 10 seconds
- expiryBufferSeconds: 300, // 5 minutes
+ expiryBufferSeconds: 120, // 2 minutes
};
const DEFAULT_BUY_QUOTE_REQUEST_OPTS: BuyQuoteRequestOpts = {
@@ -22,6 +23,11 @@ const DEFAULT_BUY_QUOTE_EXECUTION_OPTS: BuyQuoteExecutionOpts = {
feeRecipient: NULL_ADDRESS,
};
+const EMPTY_ORDERS_AND_FILLABLE_AMOUNTS: OrdersAndFillableAmounts = {
+ orders: [] as SignedOrder[],
+ remainingFillableMakerAssetAmounts: [] as BigNumber[],
+};
+
export const constants = {
ZERO_AMOUNT: new BigNumber(0),
NULL_ADDRESS,
@@ -30,5 +36,5 @@ export const constants = {
DEFAULT_ASSET_BUYER_OPTS,
DEFAULT_BUY_QUOTE_EXECUTION_OPTS,
DEFAULT_BUY_QUOTE_REQUEST_OPTS,
- MAX_PER_PAGE: 10000,
+ EMPTY_ORDERS_AND_FILLABLE_AMOUNTS,
};
diff --git a/packages/asset-buyer/src/index.ts b/packages/asset-buyer/src/index.ts
index 2da2724d7..8418edb42 100644
--- a/packages/asset-buyer/src/index.ts
+++ b/packages/asset-buyer/src/index.ts
@@ -1,6 +1,12 @@
-export { Provider } from 'ethereum-types';
-export { SignedOrder } from '@0xproject/types';
-export { BigNumber } from '@0xproject/utils';
+export {
+ JSONRPCRequestPayload,
+ JSONRPCResponsePayload,
+ JSONRPCResponseError,
+ JSONRPCErrorCallback,
+ Provider,
+} from 'ethereum-types';
+export { SignedOrder } from '@0x/types';
+export { BigNumber } from '@0x/utils';
export { AssetBuyer } from './asset_buyer';
export { BasicOrderProvider } from './order_providers/basic_order_provider';
@@ -10,6 +16,7 @@ export {
AssetBuyerOpts,
BuyQuote,
BuyQuoteExecutionOpts,
+ BuyQuoteInfo,
BuyQuoteRequestOpts,
OrderProvider,
OrderProviderRequest,
diff --git a/packages/asset-buyer/src/order_providers/basic_order_provider.ts b/packages/asset-buyer/src/order_providers/basic_order_provider.ts
index 9bb2d90ac..76685f27a 100644
--- a/packages/asset-buyer/src/order_providers/basic_order_provider.ts
+++ b/packages/asset-buyer/src/order_providers/basic_order_provider.ts
@@ -1,5 +1,5 @@
-import { schemas } from '@0xproject/json-schemas';
-import { SignedOrder } from '@0xproject/types';
+import { schemas } from '@0x/json-schemas';
+import { SignedOrder } from '@0x/types';
import * as _ from 'lodash';
import { OrderProvider, OrderProviderRequest, OrderProviderResponse } from '../types';
@@ -29,4 +29,13 @@ export class BasicOrderProvider implements OrderProvider {
});
return { orders };
}
+ /**
+ * Given a taker asset data string, return all availabled paired maker asset data strings.
+ * @param takerAssetData A string representing the taker asset data.
+ * @return An array of asset data strings that can be purchased using takerAssetData.
+ */
+ public async getAvailableMakerAssetDatasAsync(takerAssetData: string): Promise<string[]> {
+ const ordersWithTakerAssetData = _.filter(this.orders, { takerAssetData });
+ return _.map(ordersWithTakerAssetData, order => order.makerAssetData);
+ }
}
diff --git a/packages/asset-buyer/src/order_providers/standard_relayer_api_order_provider.ts b/packages/asset-buyer/src/order_providers/standard_relayer_api_order_provider.ts
index 31942c25b..be1fc55d6 100644
--- a/packages/asset-buyer/src/order_providers/standard_relayer_api_order_provider.ts
+++ b/packages/asset-buyer/src/order_providers/standard_relayer_api_order_provider.ts
@@ -1,5 +1,5 @@
-import { HttpClient } from '@0xproject/connect';
-import { APIOrder, OrderbookResponse } from '@0xproject/types';
+import { HttpClient } from '@0x/connect';
+import { APIOrder, AssetPairsResponse, OrderbookResponse } from '@0x/types';
import * as _ from 'lodash';
import {
@@ -14,6 +14,7 @@ import { orderUtils } from '../utils/order_utils';
export class StandardRelayerAPIOrderProvider implements OrderProvider {
public readonly apiUrl: string;
+ public readonly networkId: number;
private readonly _sraClient: HttpClient;
/**
* Given an array of APIOrder objects from a standard relayer api, return an array
@@ -30,7 +31,7 @@ export class StandardRelayerAPIOrderProvider implements OrderProvider {
'remainingTakerAssetAmount',
order.takerAssetAmount,
);
- const remainingFillableMakerAssetAmount = orderUtils.calculateRemainingMakerAssetAmount(
+ const remainingFillableMakerAssetAmount = orderUtils.getRemainingMakerAmount(
order,
remainingFillableTakerAssetAmount,
);
@@ -44,12 +45,15 @@ export class StandardRelayerAPIOrderProvider implements OrderProvider {
}
/**
* Instantiates a new StandardRelayerAPIOrderProvider instance
- * @param apiUrl The standard relayer API base HTTP url you would like to source orders from.
+ * @param apiUrl The standard relayer API base HTTP url you would like to source orders from.
+ * @param networkId The ethereum network id.
* @return An instance of StandardRelayerAPIOrderProvider
*/
- constructor(apiUrl: string) {
+ constructor(apiUrl: string, networkId: number) {
assert.isWebUri('apiUrl', apiUrl);
+ assert.isNumber('networkId', networkId);
this.apiUrl = apiUrl;
+ this.networkId = networkId;
this._sraClient = new HttpClient(apiUrl);
}
/**
@@ -59,9 +63,9 @@ export class StandardRelayerAPIOrderProvider implements OrderProvider {
*/
public async getOrdersAsync(orderProviderRequest: OrderProviderRequest): Promise<OrderProviderResponse> {
assert.isValidOrderProviderRequest('orderProviderRequest', orderProviderRequest);
- const { makerAssetData, takerAssetData, networkId } = orderProviderRequest;
+ const { makerAssetData, takerAssetData } = orderProviderRequest;
const orderbookRequest = { baseAssetData: makerAssetData, quoteAssetData: takerAssetData };
- const requestOpts = { networkId };
+ const requestOpts = { networkId: this.networkId };
let orderbook: OrderbookResponse;
try {
orderbook = await this._sraClient.getOrderbookAsync(orderbookRequest, requestOpts);
@@ -76,4 +80,26 @@ export class StandardRelayerAPIOrderProvider implements OrderProvider {
orders,
};
}
+ /**
+ * Given a taker asset data string, return all availabled paired maker asset data strings.
+ * @param takerAssetData A string representing the taker asset data.
+ * @return An array of asset data strings that can be purchased using takerAssetData.
+ */
+ public async getAvailableMakerAssetDatasAsync(takerAssetData: string): Promise<string[]> {
+ // Return a maximum of 1000 asset datas
+ const maxPerPage = 1000;
+ const requestOpts = { networkId: this.networkId, perPage: maxPerPage };
+ const assetPairsRequest = { assetDataA: takerAssetData };
+ const fullRequest = {
+ ...requestOpts,
+ ...assetPairsRequest,
+ };
+ let response: AssetPairsResponse;
+ try {
+ response = await this._sraClient.getAssetPairsAsync(fullRequest);
+ } catch (err) {
+ throw new Error(AssetBuyerError.StandardRelayerApiError);
+ }
+ return _.map(response.records, item => item.assetDataB.assetData);
+ }
}
diff --git a/packages/asset-buyer/src/types.ts b/packages/asset-buyer/src/types.ts
index 6218f4ba4..3f1e6ff21 100644
--- a/packages/asset-buyer/src/types.ts
+++ b/packages/asset-buyer/src/types.ts
@@ -1,5 +1,5 @@
-import { SignedOrder } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
+import { SignedOrder } from '@0x/types';
+import { BigNumber } from '@0x/utils';
/**
* makerAssetData: The assetData representing the desired makerAsset.
@@ -9,7 +9,6 @@ import { BigNumber } from '@0xproject/utils';
export interface OrderProviderRequest {
makerAssetData: string;
takerAssetData: string;
- networkId: number;
}
/**
@@ -27,10 +26,12 @@ export interface SignedOrderWithRemainingFillableMakerAssetAmount extends Signed
remainingFillableMakerAssetAmount?: BigNumber;
}
/**
- * Given an OrderProviderRequest, get an OrderProviderResponse.
+ * gerOrdersAsync: Given an OrderProviderRequest, get an OrderProviderResponse.
+ * getAvailableMakerAssetDatasAsync: Given a taker asset data string, return all availabled paired maker asset data strings.
*/
export interface OrderProvider {
getOrdersAsync: (orderProviderRequest: OrderProviderRequest) => Promise<OrderProviderResponse>;
+ getAvailableMakerAssetDatasAsync: (takerAssetData: string) => Promise<string[]>;
}
/**
@@ -112,6 +113,8 @@ export enum AssetBuyerError {
NoAddressAvailable = 'NO_ADDRESS_AVAILABLE',
InvalidOrderProviderResponse = 'INVALID_ORDER_PROVIDER_RESPONSE',
AssetUnavailable = 'ASSET_UNAVAILABLE',
+ SignatureRequestDenied = 'SIGNATURE_REQUEST_DENIED',
+ TransactionValueTooLow = 'TRANSACTION_VALUE_TOO_LOW',
}
export interface OrdersAndFillableAmounts {
diff --git a/packages/asset-buyer/src/utils/assert.ts b/packages/asset-buyer/src/utils/assert.ts
index d43b71fee..2466f53a4 100644
--- a/packages/asset-buyer/src/utils/assert.ts
+++ b/packages/asset-buyer/src/utils/assert.ts
@@ -1,6 +1,5 @@
-import { assert as sharedAssert } from '@0xproject/assert';
-import { schemas } from '@0xproject/json-schemas';
-import { SignedOrder } from '@0xproject/types';
+import { assert as sharedAssert } from '@0x/assert';
+import { schemas } from '@0x/json-schemas';
import * as _ from 'lodash';
import { BuyQuote, BuyQuoteInfo, OrderProvider, OrderProviderRequest } from '../types';
@@ -29,22 +28,6 @@ export const assert = {
isValidOrderProviderRequest(variableName: string, orderFetcherRequest: OrderProviderRequest): void {
sharedAssert.isHexString(`${variableName}.makerAssetData`, orderFetcherRequest.makerAssetData);
sharedAssert.isHexString(`${variableName}.takerAssetData`, orderFetcherRequest.takerAssetData);
- sharedAssert.isNumber(`${variableName}.networkId`, orderFetcherRequest.networkId);
- },
- areValidProvidedOrders(variableName: string, orders: SignedOrder[]): void {
- if (orders.length === 0) {
- return;
- }
- const makerAssetData = orders[0].makerAssetData;
- const takerAssetData = orders[0].takerAssetData;
- const filteredOrders = _.filter(
- orders,
- order => order.makerAssetData === makerAssetData && order.takerAssetData === takerAssetData,
- );
- sharedAssert.assert(
- orders.length === filteredOrders.length,
- `Expected all orders in ${variableName} to have the same makerAssetData and takerAssetData.`,
- );
},
isValidPercentage(variableName: string, percentage: number): void {
assert.isNumber(variableName, percentage);
diff --git a/packages/asset-buyer/src/utils/asset_data_utils.ts b/packages/asset-buyer/src/utils/asset_data_utils.ts
index d05ff2504..70f646902 100644
--- a/packages/asset-buyer/src/utils/asset_data_utils.ts
+++ b/packages/asset-buyer/src/utils/asset_data_utils.ts
@@ -1,26 +1,12 @@
-import { ContractWrappers } from '@0xproject/contract-wrappers';
-import { assetDataUtils as sharedAssetDataUtils } from '@0xproject/order-utils';
+import { ContractWrappers } from '@0x/contract-wrappers';
+import { assetDataUtils as sharedAssetDataUtils } from '@0x/order-utils';
import * as _ from 'lodash';
-import { AssetBuyerError } from '../types';
-
export const assetDataUtils = {
...sharedAssetDataUtils,
- getEtherTokenAssetDataOrThrow(contractWrappers: ContractWrappers): string {
- const etherTokenAddressIfExists = contractWrappers.etherToken.getContractAddressIfExists();
- if (_.isUndefined(etherTokenAddressIfExists)) {
- throw new Error(AssetBuyerError.NoEtherTokenContractFound);
- }
- const etherTokenAssetData = sharedAssetDataUtils.encodeERC20AssetData(etherTokenAddressIfExists);
+ getEtherTokenAssetData(contractWrappers: ContractWrappers): string {
+ const etherTokenAddress = contractWrappers.forwarder.etherTokenAddress;
+ const etherTokenAssetData = sharedAssetDataUtils.encodeERC20AssetData(etherTokenAddress);
return etherTokenAssetData;
},
- getZrxTokenAssetDataOrThrow(contractWrappers: ContractWrappers): string {
- let zrxTokenAssetData: string;
- try {
- zrxTokenAssetData = contractWrappers.exchange.getZRXAssetData();
- } catch (err) {
- throw new Error(AssetBuyerError.NoZrxTokenContractFound);
- }
- return zrxTokenAssetData;
- },
};
diff --git a/packages/asset-buyer/src/utils/buy_quote_calculator.ts b/packages/asset-buyer/src/utils/buy_quote_calculator.ts
index a1d334eef..6a67ed1ed 100644
--- a/packages/asset-buyer/src/utils/buy_quote_calculator.ts
+++ b/packages/asset-buyer/src/utils/buy_quote_calculator.ts
@@ -1,10 +1,12 @@
-import { marketUtils, rateUtils } from '@0xproject/order-utils';
-import { BigNumber } from '@0xproject/utils';
+import { marketUtils, SignedOrder } from '@0x/order-utils';
+import { BigNumber } from '@0x/utils';
import * as _ from 'lodash';
import { constants } from '../constants';
import { AssetBuyerError, BuyQuote, BuyQuoteInfo, OrdersAndFillableAmounts } from '../types';
+import { orderUtils } from './order_utils';
+
// Calculates a buy quote for orders that have WETH as the takerAsset
export const buyQuoteCalculator = {
calculate(
@@ -13,6 +15,7 @@ export const buyQuoteCalculator = {
assetBuyAmount: BigNumber,
feePercentage: number,
slippagePercentage: number,
+ isMakerAssetZrxToken: boolean,
): BuyQuote {
const orders = ordersAndFillableAmounts.orders;
const remainingFillableMakerAssetAmounts = ordersAndFillableAmounts.remainingFillableMakerAssetAmounts;
@@ -32,22 +35,31 @@ export const buyQuoteCalculator = {
if (remainingFillAmount.gt(constants.ZERO_AMOUNT)) {
throw new Error(AssetBuyerError.InsufficientAssetLiquidity);
}
+ // if we are not buying ZRX:
// given the orders calculated above, find the fee-orders that cover the desired assetBuyAmount (with slippage)
// TODO(bmillman): optimization
// update this logic to find the minimum amount of feeOrders to cover the worst case as opposed to
// finding order that cover all fees, this will help with estimating ETH and minimizing gas usage
- const {
- resultFeeOrders,
- remainingFeeAmount,
- feeOrdersRemainingFillableMakerAssetAmounts,
- } = marketUtils.findFeeOrdersThatCoverFeesForTargetOrders(resultOrders, feeOrders, {
- remainingFillableMakerAssetAmounts: ordersRemainingFillableMakerAssetAmounts,
- remainingFillableFeeAmounts,
- });
- // if we do not have enough feeOrders to cover the fees, throw
- if (remainingFeeAmount.gt(constants.ZERO_AMOUNT)) {
- throw new Error(AssetBuyerError.InsufficientZrxLiquidity);
+ let resultFeeOrders = [] as SignedOrder[];
+ let feeOrdersRemainingFillableMakerAssetAmounts = [] as BigNumber[];
+ if (!isMakerAssetZrxToken) {
+ const feeOrdersAndRemainingFeeAmount = marketUtils.findFeeOrdersThatCoverFeesForTargetOrders(
+ resultOrders,
+ feeOrders,
+ {
+ remainingFillableMakerAssetAmounts: ordersRemainingFillableMakerAssetAmounts,
+ remainingFillableFeeAmounts,
+ },
+ );
+ // if we do not have enough feeOrders to cover the fees, throw
+ if (feeOrdersAndRemainingFeeAmount.remainingFeeAmount.gt(constants.ZERO_AMOUNT)) {
+ throw new Error(AssetBuyerError.InsufficientZrxLiquidity);
+ }
+ resultFeeOrders = feeOrdersAndRemainingFeeAmount.resultFeeOrders;
+ feeOrdersRemainingFillableMakerAssetAmounts =
+ feeOrdersAndRemainingFeeAmount.feeOrdersRemainingFillableMakerAssetAmounts;
}
+
// assetData information for the result
const assetData = orders[0].makerAssetData;
// compile the resulting trimmed set of orders for makerAsset and feeOrders that are needed for assetBuyAmount
@@ -64,6 +76,7 @@ export const buyQuoteCalculator = {
trimmedFeeOrdersAndFillableAmounts,
assetBuyAmount,
feePercentage,
+ isMakerAssetZrxToken,
);
// in order to calculate the maxRate, reverse the ordersAndFillableAmounts such that they are sorted from worst rate to best rate
const worstCaseQuoteInfo = calculateQuoteInfo(
@@ -71,6 +84,7 @@ export const buyQuoteCalculator = {
reverseOrdersAndFillableAmounts(trimmedFeeOrdersAndFillableAmounts),
assetBuyAmount,
feePercentage,
+ isMakerAssetZrxToken,
);
return {
assetData,
@@ -89,22 +103,30 @@ function calculateQuoteInfo(
feeOrdersAndFillableAmounts: OrdersAndFillableAmounts,
assetBuyAmount: BigNumber,
feePercentage: number,
+ isMakerAssetZrxToken: boolean,
): BuyQuoteInfo {
// find the total eth and zrx needed to buy assetAmount from the resultOrders from left to right
- const [ethAmountToBuyAsset, zrxAmountToBuyAsset] = findEthAndZrxAmountNeededToBuyAsset(
- ordersAndFillableAmounts,
- assetBuyAmount,
- );
- // find the total eth needed to buy fees
- const ethAmountToBuyFees = findEthAmountNeededToBuyFees(feeOrdersAndFillableAmounts, zrxAmountToBuyAsset);
- const affiliateFeeEthAmount = ethAmountToBuyAsset.mul(feePercentage);
- const totalEthAmountWithoutAffiliateFee = ethAmountToBuyAsset.plus(ethAmountToBuyFees);
- const totalEthAmount = totalEthAmountWithoutAffiliateFee.plus(affiliateFeeEthAmount);
+ let ethAmountToBuyAsset = constants.ZERO_AMOUNT;
+ let ethAmountToBuyZrx = constants.ZERO_AMOUNT;
+ if (isMakerAssetZrxToken) {
+ ethAmountToBuyAsset = findEthAmountNeededToBuyZrx(ordersAndFillableAmounts, assetBuyAmount);
+ } else {
+ // find eth and zrx amounts needed to buy
+ const ethAndZrxAmountToBuyAsset = findEthAndZrxAmountNeededToBuyAsset(ordersAndFillableAmounts, assetBuyAmount);
+ ethAmountToBuyAsset = ethAndZrxAmountToBuyAsset[0];
+ const zrxAmountToBuyAsset = ethAndZrxAmountToBuyAsset[1];
+ // find eth amount needed to buy zrx
+ ethAmountToBuyZrx = findEthAmountNeededToBuyZrx(feeOrdersAndFillableAmounts, zrxAmountToBuyAsset);
+ }
+ /// find the eth amount needed to buy the affiliate fee
+ const ethAmountToBuyAffiliateFee = ethAmountToBuyAsset.mul(feePercentage).ceil();
+ const totalEthAmountWithoutAffiliateFee = ethAmountToBuyAsset.plus(ethAmountToBuyZrx);
+ const ethAmountTotal = totalEthAmountWithoutAffiliateFee.plus(ethAmountToBuyAffiliateFee);
// divide into the assetBuyAmount in order to find rate of makerAsset / WETH
const ethPerAssetPrice = totalEthAmountWithoutAffiliateFee.div(assetBuyAmount);
return {
- totalEthAmount,
- feeEthAmount: affiliateFeeEthAmount,
+ totalEthAmount: ethAmountTotal,
+ feeEthAmount: ethAmountToBuyAffiliateFee,
ethPerAssetPrice,
};
}
@@ -119,29 +141,38 @@ function reverseOrdersAndFillableAmounts(ordersAndFillableAmounts: OrdersAndFill
};
}
-function findEthAmountNeededToBuyFees(
+function findEthAmountNeededToBuyZrx(
feeOrdersAndFillableAmounts: OrdersAndFillableAmounts,
- feeAmount: BigNumber,
+ zrxBuyAmount: BigNumber,
): BigNumber {
const { orders, remainingFillableMakerAssetAmounts } = feeOrdersAndFillableAmounts;
const result = _.reduce(
orders,
(acc, order, index) => {
+ const { totalEthAmount, remainingZrxBuyAmount } = acc;
const remainingFillableMakerAssetAmount = remainingFillableMakerAssetAmounts[index];
- const amountToFill = BigNumber.min(acc.remainingFeeAmount, remainingFillableMakerAssetAmount);
- const feeAdjustedRate = rateUtils.getFeeAdjustedRateOfFeeOrder(order);
- const ethAmountForThisOrder = feeAdjustedRate.mul(amountToFill);
+ const makerFillAmount = BigNumber.min(remainingZrxBuyAmount, remainingFillableMakerAssetAmount);
+ const [takerFillAmount, adjustedMakerFillAmount] = orderUtils.getTakerFillAmountForFeeOrder(
+ order,
+ makerFillAmount,
+ );
+ const extraFeeAmount = remainingFillableMakerAssetAmount.greaterThanOrEqualTo(adjustedMakerFillAmount)
+ ? constants.ZERO_AMOUNT
+ : adjustedMakerFillAmount.sub(makerFillAmount);
return {
- ethAmount: acc.ethAmount.plus(ethAmountForThisOrder),
- remainingFeeAmount: BigNumber.max(constants.ZERO_AMOUNT, acc.remainingFeeAmount.minus(amountToFill)),
+ totalEthAmount: totalEthAmount.plus(takerFillAmount),
+ remainingZrxBuyAmount: BigNumber.max(
+ constants.ZERO_AMOUNT,
+ remainingZrxBuyAmount.minus(makerFillAmount).plus(extraFeeAmount),
+ ),
};
},
{
- ethAmount: constants.ZERO_AMOUNT,
- remainingFeeAmount: feeAmount,
+ totalEthAmount: constants.ZERO_AMOUNT,
+ remainingZrxBuyAmount: zrxBuyAmount,
},
);
- return result.ethAmount;
+ return result.totalEthAmount;
}
function findEthAndZrxAmountNeededToBuyAsset(
@@ -152,28 +183,25 @@ function findEthAndZrxAmountNeededToBuyAsset(
const result = _.reduce(
orders,
(acc, order, index) => {
+ const { totalEthAmount, totalZrxAmount, remainingAssetBuyAmount } = acc;
const remainingFillableMakerAssetAmount = remainingFillableMakerAssetAmounts[index];
- const amountToFill = BigNumber.min(acc.remainingAssetBuyAmount, remainingFillableMakerAssetAmount);
- // find the amount of eth required to fill amountToFill (amountToFill / makerAssetAmount) * takerAssetAmount
- const ethAmountForThisOrder = amountToFill
- .mul(order.takerAssetAmount)
- .dividedToIntegerBy(order.makerAssetAmount);
- // find the amount of zrx required to fill fees for amountToFill (amountToFill / makerAssetAmount) * takerFee
- const zrxAmountForThisOrder = amountToFill.mul(order.takerFee).dividedToIntegerBy(order.makerAssetAmount);
+ const makerFillAmount = BigNumber.min(acc.remainingAssetBuyAmount, remainingFillableMakerAssetAmount);
+ const takerFillAmount = orderUtils.getTakerFillAmount(order, makerFillAmount);
+ const takerFeeAmount = orderUtils.getTakerFeeAmount(order, takerFillAmount);
return {
- ethAmount: acc.ethAmount.plus(ethAmountForThisOrder),
- zrxAmount: acc.zrxAmount.plus(zrxAmountForThisOrder),
+ totalEthAmount: totalEthAmount.plus(takerFillAmount),
+ totalZrxAmount: totalZrxAmount.plus(takerFeeAmount),
remainingAssetBuyAmount: BigNumber.max(
constants.ZERO_AMOUNT,
- acc.remainingAssetBuyAmount.minus(amountToFill),
+ remainingAssetBuyAmount.minus(makerFillAmount),
),
};
},
{
- ethAmount: constants.ZERO_AMOUNT,
- zrxAmount: constants.ZERO_AMOUNT,
+ totalEthAmount: constants.ZERO_AMOUNT,
+ totalZrxAmount: constants.ZERO_AMOUNT,
remainingAssetBuyAmount: assetBuyAmount,
},
);
- return [result.ethAmount, result.zrxAmount];
+ return [result.totalEthAmount, result.totalZrxAmount];
}
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 74eec162d..28f684f3c 100644
--- a/packages/asset-buyer/src/utils/order_provider_response_processor.ts
+++ b/packages/asset-buyer/src/utils/order_provider_response_processor.ts
@@ -1,8 +1,8 @@
-import { OrderAndTraderInfo, OrderStatus, OrderValidatorWrapper } from '@0xproject/contract-wrappers';
-import { sortingUtils } from '@0xproject/order-utils';
-import { RemainingFillableCalculator } from '@0xproject/order-utils/lib/src/remaining_fillable_calculator';
-import { SignedOrder } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
+import { OrderAndTraderInfo, OrderStatus, OrderValidatorWrapper } from '@0x/contract-wrappers';
+import { sortingUtils } from '@0x/order-utils';
+import { RemainingFillableCalculator } from '@0x/order-utils/lib/src/remaining_fillable_calculator';
+import { SignedOrder } from '@0x/types';
+import { BigNumber } from '@0x/utils';
import * as _ from 'lodash';
import { constants } from '../constants';
@@ -110,10 +110,7 @@ function getValidOrdersWithRemainingFillableMakerAssetAmountsFromOnChain(
traderInfo.makerZrxBalance,
]);
const remainingTakerAssetAmount = order.takerAssetAmount.minus(orderInfo.orderTakerAssetFilledAmount);
- const remainingMakerAssetAmount = orderUtils.calculateRemainingMakerAssetAmount(
- order,
- remainingTakerAssetAmount,
- );
+ const remainingMakerAssetAmount = orderUtils.getRemainingMakerAmount(order, remainingTakerAssetAmount);
const remainingFillableCalculator = new RemainingFillableCalculator(
order.makerFee,
order.makerAssetAmount,
diff --git a/packages/asset-buyer/src/utils/order_utils.ts b/packages/asset-buyer/src/utils/order_utils.ts
index cfc13a8a1..1cc2cf95f 100644
--- a/packages/asset-buyer/src/utils/order_utils.ts
+++ b/packages/asset-buyer/src/utils/order_utils.ts
@@ -1,5 +1,5 @@
-import { SignedOrder } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
+import { SignedOrder } from '@0x/types';
+import { BigNumber } from '@0x/utils';
import { constants } from '../constants';
@@ -12,19 +12,63 @@ export const orderUtils = {
const currentUnixTimestampSec = new BigNumber(Date.now() / millisecondsInSecond).round();
return order.expirationTimeSeconds.lessThan(currentUnixTimestampSec.plus(secondsFromNow));
},
- calculateRemainingMakerAssetAmount(order: SignedOrder, remainingTakerAssetAmount: BigNumber): BigNumber {
- if (remainingTakerAssetAmount.eq(0)) {
- return constants.ZERO_AMOUNT;
- }
- return remainingTakerAssetAmount.times(order.makerAssetAmount).dividedToIntegerBy(order.takerAssetAmount);
- },
- calculateRemainingTakerAssetAmount(order: SignedOrder, remainingMakerAssetAmount: BigNumber): BigNumber {
- if (remainingMakerAssetAmount.eq(0)) {
- return constants.ZERO_AMOUNT;
- }
- return remainingMakerAssetAmount.times(order.takerAssetAmount).dividedToIntegerBy(order.makerAssetAmount);
- },
isOpenOrder(order: SignedOrder): boolean {
return order.takerAddress === constants.NULL_ADDRESS;
},
+ // given a remaining amount of takerAsset, calculate how much makerAsset is available
+ getRemainingMakerAmount(order: SignedOrder, remainingTakerAmount: BigNumber): BigNumber {
+ const remainingMakerAmount = remainingTakerAmount
+ .times(order.makerAssetAmount)
+ .div(order.takerAssetAmount)
+ .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)
+ .div(order.makerAssetAmount)
+ .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)
+ .div(order.takerAssetAmount)
+ .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)
+ .div(order.takerAssetAmount)
+ .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)
+ .div(order.makerAssetAmount)
+ .floor();
+ return makerFeeAmount;
+ },
+ // given a desired amount of ZRX from a fee order, calculate how much takerAsset is required to fill that amount
+ // also calculate how much ZRX needs to be bought in order fill the desired amount + takerFee
+ 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();
+ // The amount that we buy will be greater than makerFillAmount, since we buy some amount for fees.
+ const adjustedMakerFillAmount = orderUtils.getMakerFillAmount(order, adjustedTakerFillAmount);
+ return [adjustedTakerFillAmount, adjustedMakerFillAmount];
+ },
};
diff --git a/packages/asset-buyer/test/buy_quote_calculator_test.ts b/packages/asset-buyer/test/buy_quote_calculator_test.ts
index fda6958cd..0ea371982 100644
--- a/packages/asset-buyer/test/buy_quote_calculator_test.ts
+++ b/packages/asset-buyer/test/buy_quote_calculator_test.ts
@@ -1,5 +1,5 @@
-import { orderFactory } from '@0xproject/order-utils/lib/src/order_factory';
-import { BigNumber } from '@0xproject/utils';
+import { orderFactory } from '@0x/order-utils/lib/src/order_factory';
+import { BigNumber } from '@0x/utils';
import * as chai from 'chai';
import * as _ from 'lodash';
import 'mocha';
@@ -49,9 +49,9 @@ describe('buyQuoteCalculator', () => {
remainingFillableMakerAssetAmounts: [smallFeeOrder.makerAssetAmount],
};
const largeFeeOrder = orderFactory.createSignedOrderFromPartial({
- makerAssetAmount: new BigNumber(110),
+ makerAssetAmount: new BigNumber(113),
takerAssetAmount: new BigNumber(200),
- takerFee: new BigNumber(10),
+ takerFee: new BigNumber(11),
});
allFeeOrdersAndFillableAmounts = {
orders: [smallFeeOrder, largeFeeOrder],
@@ -70,6 +70,7 @@ describe('buyQuoteCalculator', () => {
new BigNumber(500),
0,
0,
+ false,
),
).to.throw(AssetBuyerError.InsufficientAssetLiquidity);
});
@@ -82,6 +83,7 @@ describe('buyQuoteCalculator', () => {
new BigNumber(300),
0,
0,
+ false,
),
).to.throw(AssetBuyerError.InsufficientZrxLiquidity);
});
@@ -97,6 +99,7 @@ describe('buyQuoteCalculator', () => {
assetBuyAmount,
feePercentage,
slippagePercentage,
+ false,
);
// test if orders are correct
expect(buyQuote.orders).to.deep.equal([ordersAndFillableAmounts.orders[0]]);
@@ -134,6 +137,7 @@ describe('buyQuoteCalculator', () => {
assetBuyAmount,
feePercentage,
slippagePercentage,
+ false,
);
// test if orders are correct
expect(buyQuote.orders).to.deep.equal(ordersAndFillableAmounts.orders);
@@ -149,9 +153,9 @@ describe('buyQuoteCalculator', () => {
expect(buyQuote.bestCaseQuoteInfo.feeEthAmount).to.bignumber.equal(expectedFeeEthAmount);
expect(buyQuote.bestCaseQuoteInfo.totalEthAmount).to.bignumber.equal(expectedTotalEthAmount);
expect(buyQuote.bestCaseQuoteInfo.ethPerAssetPrice).to.bignumber.equal(expectedEthPerAssetPrice);
- // 100 eth to fill the first order + 200 eth for fees
+ // 100 eth to fill the first order + 208 eth for fees
const expectedWorstEthAmountForAsset = new BigNumber(100);
- const expectedWorstEthAmountForZrxFees = new BigNumber(200);
+ const expectedWorstEthAmountForZrxFees = new BigNumber(208);
const expectedWorstFillEthAmount = expectedWorstEthAmountForAsset.plus(expectedWorstEthAmountForZrxFees);
const expectedWorstFeeEthAmount = expectedWorstEthAmountForAsset.mul(feePercentage);
const expectedWorstTotalEthAmount = expectedWorstFillEthAmount.plus(expectedWorstFeeEthAmount);
diff --git a/packages/asset-buyer/tslint.json b/packages/asset-buyer/tslint.json
index ffaefe83a..dd9053357 100644
--- a/packages/asset-buyer/tslint.json
+++ b/packages/asset-buyer/tslint.json
@@ -1,3 +1,3 @@
{
- "extends": ["@0xproject/tslint-config"]
+ "extends": ["@0x/tslint-config"]
}
diff --git a/packages/base-contract/CHANGELOG.json b/packages/base-contract/CHANGELOG.json
index eca1717d5..f8a1051d6 100644
--- a/packages/base-contract/CHANGELOG.json
+++ b/packages/base-contract/CHANGELOG.json
@@ -1,5 +1,23 @@
[
{
+ "version": "3.0.3",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ],
+ "timestamp": 1541740904
+ },
+ {
+ "timestamp": 1539871071,
+ "version": "3.0.2",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
"version": "3.0.1",
"changes": [
{
diff --git a/packages/base-contract/CHANGELOG.md b/packages/base-contract/CHANGELOG.md
index 114cac90f..d544f4f99 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.3 - _November 9, 2018_
+
+ * Dependencies updated
+
+## v3.0.2 - _October 18, 2018_
+
+ * Dependencies updated
+
## v3.0.1 - _October 4, 2018_
* Dependencies updated
@@ -38,7 +46,7 @@ CHANGELOG
* Dependencies updated
-## v2.0.0-rc.1 - _August 13, 2018_
+## v2.0.0-rc.1 - _August 14, 2018_
* Added strict encoding/decoding checks for sendTransaction and call (#915)
diff --git a/packages/base-contract/README.md b/packages/base-contract/README.md
index 4f2426c2e..b6ea05b74 100644
--- a/packages/base-contract/README.md
+++ b/packages/base-contract/README.md
@@ -1,25 +1,25 @@
-## @0xproject/base-contract
+## @0x/base-contract
BaseContract to derive all auto-generated wrappers from
## Installation
```bash
-yarn add @0xproject/base-contract
+yarn add @0x/base-contract
```
If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`:
```json
"compilerOptions": {
- "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"],
+ "typeRoots": ["node_modules/@0x/typescript-typings/types", "node_modules/@types"],
}
```
## Usage
```javascript
-import { BaseContract } from '@0xproject/base-contract';
+import { BaseContract } from '@0x/base-contract';
```
## Contributing
@@ -47,13 +47,13 @@ yarn install
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
```bash
-PKG=@0xproject/base-contract yarn build
+PKG=@0x/base-contract yarn build
```
Or continuously rebuild on change:
```bash
-PKG=@0xproject/base-contract yarn watch
+PKG=@0x/base-contract yarn watch
```
### Lint
diff --git a/packages/base-contract/package.json b/packages/base-contract/package.json
index 4ee471219..efa4a5c81 100644
--- a/packages/base-contract/package.json
+++ b/packages/base-contract/package.json
@@ -1,6 +1,6 @@
{
- "name": "@0xproject/base-contract",
- "version": "3.0.1",
+ "name": "@0x/base-contract",
+ "version": "3.0.3",
"engines": {
"node": ">=6.12"
},
@@ -17,7 +17,7 @@
"run_mocha": "mocha --require source-map-support/register --require make-promises-safe lib/test/**/*_test.js --bail --exit",
"test:coverage": "nyc npm run test --all && yarn coverage:report:lcov",
"coverage:report:lcov": "nyc report --reporter=text-lcov > coverage/lcov.info",
- "lint": "tslint --project . --exclude **/src/contract_wrappers/**/*"
+ "lint": "tslint --format stylish --project ."
},
"license": "Apache-2.0",
"repository": {
@@ -29,10 +29,9 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/base-contract/README.md",
"devDependencies": {
- "@0xproject/tslint-config": "^1.0.8",
+ "@0x/tslint-config": "^1.0.10",
"@types/lodash": "4.14.104",
"chai": "^4.0.1",
- "copyfiles": "^2.0.0",
"make-promises-safe": "^1.1.0",
"mocha": "^4.1.0",
"npm-run-all": "^4.1.2",
@@ -41,10 +40,10 @@
"typescript": "3.0.1"
},
"dependencies": {
- "@0xproject/typescript-typings": "^3.0.2",
- "@0xproject/utils": "^2.0.2",
- "@0xproject/web3-wrapper": "^3.0.3",
- "ethereum-types": "^1.0.11",
+ "@0x/typescript-typings": "^3.0.4",
+ "@0x/utils": "^2.0.4",
+ "@0x/web3-wrapper": "^3.1.1",
+ "ethereum-types": "^1.1.2",
"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 a8e4ad2e2..fbb8478b7 100644
--- a/packages/base-contract/src/index.ts
+++ b/packages/base-contract/src/index.ts
@@ -1,5 +1,5 @@
-import { abiUtils, BigNumber } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { abiUtils, BigNumber } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import {
AbiDefinition,
AbiType,
@@ -129,7 +129,8 @@ export class BaseContract {
if (abiDefinition.type !== AbiType.Function) {
return false;
}
- const abiFunctionSignature = abiUtils.getFunctionSignature(abiDefinition);
+ // tslint:disable-next-line:no-unnecessary-type-assertion
+ const abiFunctionSignature = abiUtils.getFunctionSignature(abiDefinition as MethodAbi);
if (abiFunctionSignature === functionSignature) {
return true;
}
diff --git a/packages/base-contract/test/utils_test.ts b/packages/base-contract/test/utils_test.ts
index c083704f4..0608b72a2 100644
--- a/packages/base-contract/test/utils_test.ts
+++ b/packages/base-contract/test/utils_test.ts
@@ -1,4 +1,4 @@
-import { BigNumber } from '@0xproject/utils';
+import { BigNumber } from '@0x/utils';
import * as chai from 'chai';
import 'mocha';
diff --git a/packages/base-contract/tslint.json b/packages/base-contract/tslint.json
index ffaefe83a..dd9053357 100644
--- a/packages/base-contract/tslint.json
+++ b/packages/base-contract/tslint.json
@@ -1,3 +1,3 @@
{
- "extends": ["@0xproject/tslint-config"]
+ "extends": ["@0x/tslint-config"]
}
diff --git a/packages/connect/CHANGELOG.json b/packages/connect/CHANGELOG.json
index 04488504d..52ad9d575 100644
--- a/packages/connect/CHANGELOG.json
+++ b/packages/connect/CHANGELOG.json
@@ -1,5 +1,23 @@
[
{
+ "version": "3.0.3",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ],
+ "timestamp": 1541740904
+ },
+ {
+ "timestamp": 1539871071,
+ "version": "3.0.2",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
"version": "3.0.1",
"changes": [
{
diff --git a/packages/connect/CHANGELOG.md b/packages/connect/CHANGELOG.md
index 16e35a0d5..8e38e16de 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.3 - _November 9, 2018_
+
+ * Dependencies updated
+
+## v3.0.2 - _October 18, 2018_
+
+ * Dependencies updated
+
## v3.0.1 - _October 4, 2018_
* Dependencies updated
@@ -42,7 +50,7 @@ CHANGELOG
* Updated for SRA v2 (#974)
* Stopped exporting `Order` type (#924)
-## v1.0.5 - _August 13, 2018_
+## v1.0.5 - _August 14, 2018_
* Dependencies updated
diff --git a/packages/connect/README.md b/packages/connect/README.md
index 9d8cb9215..6d3ee66a0 100644
--- a/packages/connect/README.md
+++ b/packages/connect/README.md
@@ -1,18 +1,18 @@
-## @0xproject/connect
+## @0x/connect
This repository contains a Javascript library that makes it easy to interact with Relayers that conform to the [Standard Relayer API](https://github.com/0xProject/standard-relayer-api)
## Installation
```bash
-yarn add @0xproject/connect
+yarn add @0x/connect
```
If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`:
```json
"compilerOptions": {
- "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"],
+ "typeRoots": ["node_modules/@0x/typescript-typings/types", "node_modules/@types"],
}
```
@@ -46,13 +46,13 @@ yarn install
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
```bash
-PKG=@0xproject/connect yarn build
+PKG=@0x/connect yarn build
```
Or continuously rebuild on change:
```bash
-PKG=@0xproject/connect yarn watch
+PKG=@0x/connect yarn watch
```
### Clean
diff --git a/packages/connect/package.json b/packages/connect/package.json
index e47ca3b79..527ac5bdc 100644
--- a/packages/connect/package.json
+++ b/packages/connect/package.json
@@ -1,6 +1,6 @@
{
- "name": "@0xproject/connect",
- "version": "3.0.1",
+ "name": "@0x/connect",
+ "version": "3.0.3",
"engines": {
"node": ">=6.12"
},
@@ -19,7 +19,7 @@
"build:ci": "yarn build",
"clean": "shx rm -rf lib test_temp generated_docs",
"copy_test_fixtures": "copyfiles -u 2 './test/fixtures/**/*.json' ./lib/test/fixtures",
- "lint": "tslint --project .",
+ "lint": "tslint --format stylish --project .",
"run_mocha": "mocha --require source-map-support/register --require make-promises-safe lib/test/**/*_test.js --exit",
"test": "run-s copy_test_fixtures run_mocha",
"rebuild_and_test": "run-s clean build test",
@@ -44,12 +44,12 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/connect/README.md",
"dependencies": {
- "@0xproject/assert": "^1.0.13",
- "@0xproject/json-schemas": "^1.0.7",
- "@0xproject/order-utils": "^1.0.7",
- "@0xproject/types": "^1.1.4",
- "@0xproject/typescript-typings": "^3.0.2",
- "@0xproject/utils": "^2.0.2",
+ "@0x/assert": "^1.0.15",
+ "@0x/json-schemas": "^2.0.1",
+ "@0x/order-utils": "^2.0.1",
+ "@0x/types": "^1.2.1",
+ "@0x/typescript-typings": "^3.0.4",
+ "@0x/utils": "^2.0.4",
"lodash": "^4.17.5",
"query-string": "^5.0.1",
"sinon": "^4.0.0",
@@ -57,7 +57,7 @@
"websocket": "^1.0.25"
},
"devDependencies": {
- "@0xproject/tslint-config": "^1.0.8",
+ "@0x/tslint-config": "^1.0.10",
"@types/fetch-mock": "^6.0.3",
"@types/lodash": "4.14.104",
"@types/mocha": "^2.2.42",
@@ -77,7 +77,7 @@
"nyc": "^11.0.1",
"shx": "^0.2.2",
"tslint": "5.11.0",
- "typedoc": "0.12.0",
+ "typedoc": "0.13.0",
"typescript": "3.0.1"
},
"publishConfig": {
diff --git a/packages/connect/src/http_client.ts b/packages/connect/src/http_client.ts
index bbd0d2042..b6c031fa8 100644
--- a/packages/connect/src/http_client.ts
+++ b/packages/connect/src/http_client.ts
@@ -1,5 +1,5 @@
-import { assert } from '@0xproject/assert';
-import { schemas } from '@0xproject/json-schemas';
+import { assert } from '@0x/assert';
+import { schemas } from '@0x/json-schemas';
import {
APIOrder,
AssetPairsRequestOpts,
@@ -14,8 +14,8 @@ import {
PagedRequestOpts,
RequestOpts,
SignedOrder,
-} from '@0xproject/types';
-import { fetchAsync } from '@0xproject/utils';
+} from '@0x/types';
+import { fetchAsync } from '@0x/utils';
import * as _ from 'lodash';
import * as queryString from 'query-string';
diff --git a/packages/connect/src/index.ts b/packages/connect/src/index.ts
index 0ec5a0f68..f319d63cb 100644
--- a/packages/connect/src/index.ts
+++ b/packages/connect/src/index.ts
@@ -17,4 +17,4 @@ export {
PaginatedCollection,
RequestOpts,
SignedOrder,
-} from '@0xproject/types';
+} from '@0x/types';
diff --git a/packages/connect/src/types.ts b/packages/connect/src/types.ts
index 4bb0ae534..08a4506ac 100644
--- a/packages/connect/src/types.ts
+++ b/packages/connect/src/types.ts
@@ -12,7 +12,7 @@ import {
PagedRequestOpts,
PaginatedCollection,
SignedOrder,
-} from '@0xproject/types';
+} from '@0x/types';
export interface Client {
getAssetPairsAsync: (
diff --git a/packages/connect/src/utils/assert.ts b/packages/connect/src/utils/assert.ts
index 3d8f1c799..de7536ffe 100644
--- a/packages/connect/src/utils/assert.ts
+++ b/packages/connect/src/utils/assert.ts
@@ -1,11 +1,11 @@
-import { assert as sharedAssert } from '@0xproject/assert';
+import { assert as sharedAssert } from '@0x/assert';
// HACK: We need those two unused imports because they're actually used by sharedAssert which gets injected here
// tslint:disable-next-line:no-unused-variable
-import { Schema, schemas } from '@0xproject/json-schemas';
+import { Schema, schemas } from '@0x/json-schemas';
// tslint:disable-next-line:no-unused-variable
-import { ECSignature } from '@0xproject/types';
+import { ECSignature } from '@0x/types';
// tslint:disable-next-line:no-unused-variable
-import { BigNumber } from '@0xproject/utils';
+import { BigNumber } from '@0x/utils';
import * as _ from 'lodash';
export const assert = {
@@ -14,7 +14,7 @@ export const assert = {
sharedAssert.doesConformToSchema(
variableName,
subscriptionOpts,
- schemas.relayerApiOrdersChannelSubscribePayload,
+ schemas.relayerApiOrdersChannelSubscribePayloadSchema,
);
},
isOrdersChannelHandler(variableName: string, handler: any): void {
diff --git a/packages/connect/src/utils/orders_channel_message_parser.ts b/packages/connect/src/utils/orders_channel_message_parser.ts
index 943d7802e..1306a74b1 100644
--- a/packages/connect/src/utils/orders_channel_message_parser.ts
+++ b/packages/connect/src/utils/orders_channel_message_parser.ts
@@ -1,8 +1,8 @@
-import { assert } from '@0xproject/assert';
-import { schemas } from '@0xproject/json-schemas';
+import { assert } from '@0x/assert';
+import { schemas } from '@0x/json-schemas';
import * as _ from 'lodash';
-import { OrdersChannelMessage, OrdersChannelMessageTypes } from '@0xproject/types';
+import { OrdersChannelMessage, OrdersChannelMessageTypes } from '@0x/types';
import { relayerResponseJsonParsers } from './relayer_response_json_parsers';
diff --git a/packages/connect/src/utils/relayer_response_json_parsers.ts b/packages/connect/src/utils/relayer_response_json_parsers.ts
index 356e2dde6..2b1a658d1 100644
--- a/packages/connect/src/utils/relayer_response_json_parsers.ts
+++ b/packages/connect/src/utils/relayer_response_json_parsers.ts
@@ -1,6 +1,6 @@
-import { assert } from '@0xproject/assert';
-import { schemas } from '@0xproject/json-schemas';
-import { orderParsingUtils } from '@0xproject/order-utils';
+import { assert } from '@0x/assert';
+import { schemas } from '@0x/json-schemas';
+import { orderParsingUtils } from '@0x/order-utils';
import {
APIOrder,
@@ -9,7 +9,7 @@ import {
OrderbookResponse,
OrderConfigResponse,
OrdersResponse,
-} from '@0xproject/types';
+} from '@0x/types';
import { typeConverters } from './type_converters';
diff --git a/packages/connect/src/utils/type_converters.ts b/packages/connect/src/utils/type_converters.ts
index 99760cf74..b262a516b 100644
--- a/packages/connect/src/utils/type_converters.ts
+++ b/packages/connect/src/utils/type_converters.ts
@@ -1,7 +1,7 @@
-import { orderParsingUtils } from '@0xproject/order-utils';
+import { orderParsingUtils } from '@0x/order-utils';
import * as _ from 'lodash';
-import { APIOrder } from '@0xproject/types';
+import { APIOrder } from '@0x/types';
export const typeConverters = {
convertOrderbookStringFieldsToBigNumber(orderbook: any): any {
diff --git a/packages/connect/src/ws_orders_channel.ts b/packages/connect/src/ws_orders_channel.ts
index bf5e8508d..70a357c61 100644
--- a/packages/connect/src/ws_orders_channel.ts
+++ b/packages/connect/src/ws_orders_channel.ts
@@ -1,4 +1,4 @@
-import { OrdersChannelMessageTypes, OrdersChannelSubscriptionOpts } from '@0xproject/types';
+import { OrdersChannelMessageTypes, OrdersChannelSubscriptionOpts } from '@0x/types';
import * as _ from 'lodash';
import { v4 as uuid } from 'uuid';
import * as WebSocket from 'websocket';
diff --git a/packages/connect/test/fixtures/standard_relayer_api/asset_pairs.ts b/packages/connect/test/fixtures/standard_relayer_api/asset_pairs.ts
index 27216e421..3ceeffdc8 100644
--- a/packages/connect/test/fixtures/standard_relayer_api/asset_pairs.ts
+++ b/packages/connect/test/fixtures/standard_relayer_api/asset_pairs.ts
@@ -1,6 +1,6 @@
-import { BigNumber } from '@0xproject/utils';
+import { BigNumber } from '@0x/utils';
-import { AssetPairsResponse } from '@0xproject/types';
+import { AssetPairsResponse } from '@0x/types';
export const assetDataPairsResponse: AssetPairsResponse = {
total: 43,
diff --git a/packages/connect/test/fixtures/standard_relayer_api/fee_recipients.ts b/packages/connect/test/fixtures/standard_relayer_api/fee_recipients.ts
index 6f544e9d3..694433128 100644
--- a/packages/connect/test/fixtures/standard_relayer_api/fee_recipients.ts
+++ b/packages/connect/test/fixtures/standard_relayer_api/fee_recipients.ts
@@ -1,4 +1,4 @@
-import { FeeRecipientsResponse } from '@0xproject/types';
+import { FeeRecipientsResponse } from '@0x/types';
export const feeRecipientsResponse: FeeRecipientsResponse = {
total: 3,
diff --git a/packages/connect/test/fixtures/standard_relayer_api/order/0xabc67323774bdbd24d94f977fa9ac94a50f016026fd13f42990861238897721f.ts b/packages/connect/test/fixtures/standard_relayer_api/order/0xabc67323774bdbd24d94f977fa9ac94a50f016026fd13f42990861238897721f.ts
index c8a669b3b..3d2fbdba8 100644
--- a/packages/connect/test/fixtures/standard_relayer_api/order/0xabc67323774bdbd24d94f977fa9ac94a50f016026fd13f42990861238897721f.ts
+++ b/packages/connect/test/fixtures/standard_relayer_api/order/0xabc67323774bdbd24d94f977fa9ac94a50f016026fd13f42990861238897721f.ts
@@ -1,4 +1,4 @@
-import { BigNumber } from '@0xproject/utils';
+import { BigNumber } from '@0x/utils';
export const orderResponse = {
order: {
diff --git a/packages/connect/test/fixtures/standard_relayer_api/order_config.ts b/packages/connect/test/fixtures/standard_relayer_api/order_config.ts
index 56a4ac550..2290c39c0 100644
--- a/packages/connect/test/fixtures/standard_relayer_api/order_config.ts
+++ b/packages/connect/test/fixtures/standard_relayer_api/order_config.ts
@@ -1,6 +1,6 @@
-import { BigNumber } from '@0xproject/utils';
+import { BigNumber } from '@0x/utils';
-import { OrderConfigResponse } from '@0xproject/types';
+import { OrderConfigResponse } from '@0x/types';
export const orderConfigResponse: OrderConfigResponse = {
senderAddress: '0xa2b31dacf30a9c50ca473337c01d8a201ae33e32',
diff --git a/packages/connect/test/fixtures/standard_relayer_api/orderbook.ts b/packages/connect/test/fixtures/standard_relayer_api/orderbook.ts
index 21d51da74..de2d4eaea 100644
--- a/packages/connect/test/fixtures/standard_relayer_api/orderbook.ts
+++ b/packages/connect/test/fixtures/standard_relayer_api/orderbook.ts
@@ -1,6 +1,6 @@
-import { BigNumber } from '@0xproject/utils';
+import { BigNumber } from '@0x/utils';
-import { OrderbookResponse } from '@0xproject/types';
+import { OrderbookResponse } from '@0x/types';
export const orderbookResponse: OrderbookResponse = {
bids: {
diff --git a/packages/connect/test/fixtures/standard_relayer_api/orders.ts b/packages/connect/test/fixtures/standard_relayer_api/orders.ts
index fb85990d0..ed1f588df 100644
--- a/packages/connect/test/fixtures/standard_relayer_api/orders.ts
+++ b/packages/connect/test/fixtures/standard_relayer_api/orders.ts
@@ -1,6 +1,6 @@
-import { BigNumber } from '@0xproject/utils';
+import { BigNumber } from '@0x/utils';
-import { OrdersResponse } from '@0xproject/types';
+import { OrdersResponse } from '@0x/types';
export const ordersResponse: OrdersResponse = {
total: 984,
diff --git a/packages/connect/test/http_client_test.ts b/packages/connect/test/http_client_test.ts
index e9fc9372e..f799ca849 100644
--- a/packages/connect/test/http_client_test.ts
+++ b/packages/connect/test/http_client_test.ts
@@ -1,4 +1,4 @@
-import { BigNumber } from '@0xproject/utils';
+import { BigNumber } from '@0x/utils';
import * as chai from 'chai';
import * as chaiAsPromised from 'chai-as-promised';
import * as dirtyChai from 'dirty-chai';
diff --git a/packages/connect/tslint.json b/packages/connect/tslint.json
index ffaefe83a..dd9053357 100644
--- a/packages/connect/tslint.json
+++ b/packages/connect/tslint.json
@@ -1,3 +1,3 @@
{
- "extends": ["@0xproject/tslint-config"]
+ "extends": ["@0x/tslint-config"]
}
diff --git a/packages/contract-addresses/CHANGELOG.json b/packages/contract-addresses/CHANGELOG.json
new file mode 100644
index 000000000..307d73545
--- /dev/null
+++ b/packages/contract-addresses/CHANGELOG.json
@@ -0,0 +1,30 @@
+[
+ {
+ "version": "1.1.0",
+ "changes": [
+ {
+ "pr": 1192,
+ "note": "Update Forwarder addresses"
+ }
+ ],
+ "timestamp": 1541740904
+ },
+ {
+ "version": "1.0.1",
+ "changes": [
+ {
+ "pr": 1105,
+ "note": "Initial release"
+ }
+ ],
+ "timestamp": 1539871071
+ },
+ {
+ "version": "1.0.0",
+ "changes": [
+ {
+ "note": "Unpublished Package"
+ }
+ ]
+ }
+]
diff --git a/packages/contract-addresses/CHANGELOG.md b/packages/contract-addresses/CHANGELOG.md
new file mode 100644
index 000000000..20e52cd8b
--- /dev/null
+++ b/packages/contract-addresses/CHANGELOG.md
@@ -0,0 +1,18 @@
+<!--
+changelogUtils.file is auto-generated using the monorepo-scripts package. Don't edit directly.
+Edit the package's CHANGELOG.json file only.
+-->
+
+CHANGELOG
+
+## v1.1.0 - _November 9, 2018_
+
+ * Update Forwarder addresses (#1192)
+
+## v1.0.1 - _October 18, 2018_
+
+ * Initial release (#1105)
+
+## v1.0.0 - _Invalid date_
+
+ * Unpublished Package
diff --git a/packages/contract-addresses/README.md b/packages/contract-addresses/README.md
new file mode 100644
index 000000000..a4040cb54
--- /dev/null
+++ b/packages/contract-addresses/README.md
@@ -0,0 +1,68 @@
+## @0x/contract-addresses
+
+A tiny utility library for getting known deployed contract addresses for a
+particular network.
+
+## Installation
+
+```bash
+yarn add @0x/contract-addresses
+```
+
+**Import**
+
+```typescript
+import { getContractAddressesForNetworkOrThrow } from '@0x/contract-addresses';
+```
+
+or
+
+```javascript
+var getContractAddressesForNetworkOrThrow = require('@0x/contract-addresses').getContractAddressesForNetworkOrThrow;
+```
+
+## Contributing
+
+We welcome improvements and fixes from the wider community! To report bugs within this package, please create an issue in this repository.
+
+Please read our [contribution guidelines](../../CONTRIBUTING.md) before getting started.
+
+### Install dependencies
+
+If you don't have yarn workspaces enabled (Yarn < v1.0) - enable them:
+
+```bash
+yarn config set workspaces-experimental true
+```
+
+Then install dependencies
+
+```bash
+yarn install
+```
+
+### Build
+
+To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
+
+```bash
+PKG=@0x/contract-addresses yarn build
+```
+
+### Clean
+
+```bash
+yarn clean
+```
+
+### Lint
+
+```bash
+yarn lint
+```
+
+### Run Tests
+
+```bash
+yarn test
+```
diff --git a/packages/contract-addresses/package.json b/packages/contract-addresses/package.json
new file mode 100644
index 000000000..47258edef
--- /dev/null
+++ b/packages/contract-addresses/package.json
@@ -0,0 +1,37 @@
+{
+ "name": "@0x/contract-addresses",
+ "version": "1.1.0",
+ "engines": {
+ "node": ">=6.12"
+ },
+ "description": "Used to get known addresses of deployed 0x contracts",
+ "main": "lib/src/index.js",
+ "directories": {
+ "test": "test"
+ },
+ "scripts": {
+ "build": "yarn tsc -b",
+ "build:ci": "yarn build",
+ "clean": "shx rm -rf lib"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/0xProject/0x-monorepo.git"
+ },
+ "license": "Apache-2.0",
+ "bugs": {
+ "url": "https://github.com/0xProject/0x-monorepo/issues"
+ },
+ "homepage": "https://github.com/0xProject/0x-monorepo/packages/contract-addresses/README.md",
+ "devDependencies": {
+ "@types/lodash": "4.14.104",
+ "shx": "^0.2.2",
+ "typescript": "3.0.1"
+ },
+ "dependencies": {
+ "lodash": "^4.17.5"
+ },
+ "publishConfig": {
+ "access": "public"
+ }
+}
diff --git a/packages/contract-addresses/src/index.ts b/packages/contract-addresses/src/index.ts
new file mode 100644
index 000000000..f5fd8d0be
--- /dev/null
+++ b/packages/contract-addresses/src/index.ts
@@ -0,0 +1,66 @@
+import * as _ from 'lodash';
+
+export interface ContractAddresses {
+ erc20Proxy: string;
+ erc721Proxy: string;
+ zrxToken: string;
+ etherToken: string;
+ exchange: string;
+ assetProxyOwner: string;
+ forwarder: string;
+ orderValidator: string;
+}
+
+export enum NetworkId {
+ Mainnet = 1,
+ Ropsten = 3,
+ Kovan = 42,
+}
+
+const networkToAddresses: { [networkId: number]: ContractAddresses } = {
+ 1: {
+ erc20Proxy: '0x2240dab907db71e64d3e0dba4800c83b5c502d4e',
+ erc721Proxy: '0x208e41fb445f1bb1b6780d58356e81405f3e6127',
+ zrxToken: '0xe41d2489571d322189246dafa5ebde1f4699f498',
+ etherToken: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
+ exchange: '0x4f833a24e1f95d70f028921e27040ca56e09ab0b',
+ assetProxyOwner: '0x17992e4ffb22730138e4b62aaa6367fa9d3699a6',
+ forwarder: '0x5468a1dc173652ee28d249c271fa9933144746b1',
+ orderValidator: '0x9463e518dea6810309563c81d5266c1b1d149138',
+ },
+ 3: {
+ erc20Proxy: '0xb1408f4c245a23c31b98d2c626777d4c0d766caa',
+ erc721Proxy: '0xe654aac058bfbf9f83fcaee7793311dd82f6ddb4',
+ zrxToken: '0xff67881f8d12f372d91baae9752eb3631ff0ed00',
+ etherToken: '0xc778417e063141139fce010982780140aa0cd5ab',
+ exchange: '0x4530c0483a1633c7a1c97d2c53721caff2caaaaf',
+ assetProxyOwner: '0xf5fa5b5fed2727a0e44ac67f6772e97977aa358b',
+ forwarder: '0x2240dab907db71e64d3e0dba4800c83b5c502d4e',
+ orderValidator: '0x90431a90516ab49af23a0530e04e8c7836e7122f',
+ },
+ 42: {
+ erc20Proxy: '0xf1ec01d6236d3cd881a0bf0130ea25fe4234003e',
+ erc721Proxy: '0x2a9127c745688a165106c11cd4d647d2220af821',
+ zrxToken: '0x2002d3812f58e35f0ea1ffbf80a75a38c32175fa',
+ etherToken: '0xd0a1e359811322d97991e03f863a0c30c2cf029c',
+ exchange: '0x35dd2932454449b14cee11a94d3674a936d5d7b2',
+ assetProxyOwner: '0x2c824d2882baa668e0d5202b1e7f2922278703f8',
+ forwarder: '0x17992e4ffb22730138e4b62aaa6367fa9d3699a6',
+ orderValidator: '0xb389da3d204b412df2f75c6afb3d0a7ce0bc283d',
+ },
+};
+
+/**
+ * Used to get addresses of contracts that have been deployed to either the
+ * Ethereum mainnet or a supported testnet. Throws if there are no known
+ * contracts deployed on the corresponding network.
+ * @param networkId The desired networkId.
+ * @returns The set of addresses for contracts which have been deployed on the
+ * given networkId.
+ */
+export function getContractAddressesForNetworkOrThrow(networkId: NetworkId): ContractAddresses {
+ if (_.isUndefined(networkToAddresses[networkId])) {
+ throw new Error(`Unknown network id (${networkId}). No known 0x contracts have been deployed on this network.`);
+ }
+ return networkToAddresses[networkId];
+}
diff --git a/packages/contract-addresses/tsconfig.json b/packages/contract-addresses/tsconfig.json
new file mode 100644
index 000000000..233008d61
--- /dev/null
+++ b/packages/contract-addresses/tsconfig.json
@@ -0,0 +1,8 @@
+{
+ "extends": "../../tsconfig",
+ "compilerOptions": {
+ "outDir": "lib",
+ "rootDir": "."
+ },
+ "include": ["./src/**/*"]
+}
diff --git a/packages/contract-addresses/tslint.json b/packages/contract-addresses/tslint.json
new file mode 100644
index 000000000..dd9053357
--- /dev/null
+++ b/packages/contract-addresses/tslint.json
@@ -0,0 +1,3 @@
+{
+ "extends": ["@0x/tslint-config"]
+}
diff --git a/packages/contract-artifacts/CHANGELOG.json b/packages/contract-artifacts/CHANGELOG.json
new file mode 100644
index 000000000..8833255ed
--- /dev/null
+++ b/packages/contract-artifacts/CHANGELOG.json
@@ -0,0 +1,30 @@
+[
+ {
+ "version": "1.1.0",
+ "changes": [
+ {
+ "pr": 1192,
+ "note": "Update Forwarder artifact"
+ }
+ ],
+ "timestamp": 1541740904
+ },
+ {
+ "version": "1.0.1",
+ "changes": [
+ {
+ "pr": 1105,
+ "note": "Initial release"
+ }
+ ],
+ "timestamp": 1539871071
+ },
+ {
+ "version": "1.0.0",
+ "changes": [
+ {
+ "note": "Unpublished Package"
+ }
+ ]
+ }
+]
diff --git a/packages/contract-artifacts/CHANGELOG.md b/packages/contract-artifacts/CHANGELOG.md
new file mode 100644
index 000000000..b3c399985
--- /dev/null
+++ b/packages/contract-artifacts/CHANGELOG.md
@@ -0,0 +1,18 @@
+<!--
+changelogUtils.file is auto-generated using the monorepo-scripts package. Don't edit directly.
+Edit the package's CHANGELOG.json file only.
+-->
+
+CHANGELOG
+
+## v1.1.0 - _November 9, 2018_
+
+ * Update Forwarder artifact (#1192)
+
+## v1.0.1 - _October 18, 2018_
+
+ * Initial release (#1105)
+
+## v1.0.0 - _Invalid date_
+
+ * Unpublished Package
diff --git a/packages/contract-artifacts/README.md b/packages/contract-artifacts/README.md
new file mode 100644
index 000000000..5a382c308
--- /dev/null
+++ b/packages/contract-artifacts/README.md
@@ -0,0 +1,67 @@
+## @0x/contract-artifacts
+
+Smart contract compilation artifacts for the latest version of the 0x Protocol.
+
+## Installation
+
+```bash
+yarn add @0x/contract-artifacts
+```
+
+**Import**
+
+```typescript
+import * as artifacts from '@0x/contract-artifacts';
+```
+
+or
+
+```javascript
+var artifacts = require('@0x/contract-artifacts');
+```
+
+## Contributing
+
+We welcome improvements and fixes from the wider community! To report bugs within this package, please create an issue in this repository.
+
+Please read our [contribution guidelines](../../CONTRIBUTING.md) before getting started.
+
+### Install dependencies
+
+If you don't have yarn workspaces enabled (Yarn < v1.0) - enable them:
+
+```bash
+yarn config set workspaces-experimental true
+```
+
+Then install dependencies
+
+```bash
+yarn install
+```
+
+### Build
+
+To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
+
+```bash
+PKG=@0x/contract-artifacts yarn build
+```
+
+### Clean
+
+```bash
+yarn clean
+```
+
+### Lint
+
+```bash
+yarn lint
+```
+
+### Run Tests
+
+```bash
+yarn test
+```
diff --git a/packages/migrations/artifacts/2.0.0-trimmed/AssetProxyOwner.json b/packages/contract-artifacts/artifacts/AssetProxyOwner.json
index a9e97c572..e5fad3aef 100644
--- a/packages/migrations/artifacts/2.0.0-trimmed/AssetProxyOwner.json
+++ b/packages/contract-artifacts/artifacts/AssetProxyOwner.json
@@ -695,30 +695,5 @@
}
}
},
- "networks": {
- "1": {
- "address": "0x17992e4ffb22730138e4b62aaa6367fa9d3699a6",
- "links": {},
- "constructorArgs":
- "[[\"0x257619b7155d247e43c8b6d90c8c17278ae481f0\",\"0x5ee2a00f8f01d099451844af7f894f26a57fcbf2\",\"0x894d623e0e0e8ed12c4a73dada999e275684a37d\"],[\"0x2240dab907db71e64d3e0dba4800c83b5c502d4e\",\"0x208e41fb445f1bb1b6780d58356e81405f3e6127\"],\"2\",\"1209600\"]"
- },
- "3": {
- "address": "0xf5fa5b5fed2727a0e44ac67f6772e97977aa358b",
- "links": {},
- "constructorArgs":
- "[[\"0x9df8137872ac09a8fee71d0da5c7539923fb9bf0\",\"0xcf34d44db312d188789f43a63d11cf2bebb4da15\",\"0x73fd50f2a6beac9cdac9fe87ef68a18edc415831\"],[\"0xb1408f4c245a23c31b98d2c626777d4c0d766caa\",\"0xe654aac058bfbf9f83fcaee7793311dd82f6ddb4\"],\"1\",\"0\"]"
- },
- "42": {
- "address": "0x2c824d2882baa668e0d5202b1e7f2922278703f8",
- "links": {},
- "constructorArgs":
- "[[\"0x9df8137872ac09a8fee71d0da5c7539923fb9bf0\",\"0xcf34d44db312d188789f43a63d11cf2bebb4da15\",\"0x73fd50f2a6beac9cdac9fe87ef68a18edc415831\"],[\"0xf1ec01d6236d3cd881a0bf0130ea25fe4234003e\",\"0x2a9127c745688a165106c11cd4d647d2220af821\"],\"1\",\"0\"]"
- },
- "50": {
- "address": "0x34d402f14d58e001d8efbe6585051bf9706aa064",
- "links": {},
- "constructorArgs":
- "[[\"0x9df8137872ac09a8fee71d0da5c7539923fb9bf0\",\"0xcf34d44db312d188789f43a63d11cf2bebb4da15\",\"0x73fd50f2a6beac9cdac9fe87ef68a18edc415831\"],[\"0x1dc4c1cefef38a777b15aa20260a54e584b16c48\",\"0x1d7022f5b17d2f8b695918fb48fa1089c9f85401\"],\"1\",\"0\"]"
- }
- }
+ "networks": {}
}
diff --git a/packages/migrations/artifacts/2.0.0-trimmed/DummyERC20Token.json b/packages/contract-artifacts/artifacts/DummyERC20Token.json
index 1a5b796b9..7b8e7c3a8 100644
--- a/packages/migrations/artifacts/2.0.0-trimmed/DummyERC20Token.json
+++ b/packages/contract-artifacts/artifacts/DummyERC20Token.json
@@ -324,22 +324,5 @@
}
}
},
- "networks": {
- "3": {
- "address": "0xff67881f8d12f372d91baae9752eb3631ff0ed00",
- "links": {},
- "constructorArgs": "[\"0x Protocol Token\",\"ZRX\",\"18\",\"1000000000000000000000000000\"]"
- },
- "42": {
- "address": "0x2002d3812f58e35f0ea1ffbf80a75a38c32175fa",
- "links": {},
- "constructorArgs": "[\"0x Protocol Token\",\"ZRX\",\"18\",\"1000000000000000000000000000\"]"
- },
- "50": {
- "address": "0x871dd7c2b4b25e1aa18728e9d5f2af4c4e431f5c",
- "links": {},
- "constructorArgs":
- "[\"0x Protocol Token\",\"ZRX\",\"18\",\"115792089237316195423570985008687907853269984665640564039457584007913129639935\"]"
- }
- }
+ "networks": {}
}
diff --git a/packages/migrations/artifacts/2.0.0-trimmed/DummyERC721Token.json b/packages/contract-artifacts/artifacts/DummyERC721Token.json
index 7472a5a03..7472a5a03 100644
--- a/packages/migrations/artifacts/2.0.0-trimmed/DummyERC721Token.json
+++ b/packages/contract-artifacts/artifacts/DummyERC721Token.json
diff --git a/packages/migrations/artifacts/2.0.0-trimmed/ERC20Proxy.json b/packages/contract-artifacts/artifacts/ERC20Proxy.json
index 59531be20..33af866e7 100644
--- a/packages/migrations/artifacts/2.0.0-trimmed/ERC20Proxy.json
+++ b/packages/contract-artifacts/artifacts/ERC20Proxy.json
@@ -191,26 +191,5 @@
}
}
},
- "networks": {
- "1": {
- "address": "0x2240dab907db71e64d3e0dba4800c83b5c502d4e",
- "links": {},
- "constructorArgs": "[]"
- },
- "3": {
- "address": "0xb1408f4c245a23c31b98d2c626777d4c0d766caa",
- "links": {},
- "constructorArgs": "[]"
- },
- "42": {
- "address": "0xf1ec01d6236d3cd881a0bf0130ea25fe4234003e",
- "links": {},
- "constructorArgs": "[]"
- },
- "50": {
- "address": "0x1dc4c1cefef38a777b15aa20260a54e584b16c48",
- "links": {},
- "constructorArgs": "[]"
- }
- }
+ "networks": {}
}
diff --git a/packages/migrations/artifacts/2.0.0-trimmed/ERC20Token.json b/packages/contract-artifacts/artifacts/ERC20Token.json
index d89d08a77..d89d08a77 100644
--- a/packages/migrations/artifacts/2.0.0-trimmed/ERC20Token.json
+++ b/packages/contract-artifacts/artifacts/ERC20Token.json
diff --git a/packages/migrations/artifacts/2.0.0-trimmed/ERC721Proxy.json b/packages/contract-artifacts/artifacts/ERC721Proxy.json
index 44614fa1f..db01e40f0 100644
--- a/packages/migrations/artifacts/2.0.0-trimmed/ERC721Proxy.json
+++ b/packages/contract-artifacts/artifacts/ERC721Proxy.json
@@ -191,26 +191,5 @@
}
}
},
- "networks": {
- "1": {
- "address": "0x208e41fb445f1bb1b6780d58356e81405f3e6127",
- "links": {},
- "constructorArgs": "[]"
- },
- "3": {
- "address": "0xe654aac058bfbf9f83fcaee7793311dd82f6ddb4",
- "links": {},
- "constructorArgs": "[]"
- },
- "42": {
- "address": "0x2a9127c745688a165106c11cd4d647d2220af821",
- "links": {},
- "constructorArgs": "[]"
- },
- "50": {
- "address": "0x1d7022f5b17d2f8b695918fb48fa1089c9f85401",
- "links": {},
- "constructorArgs": "[]"
- }
- }
+ "networks": {}
}
diff --git a/packages/migrations/artifacts/2.0.0-trimmed/ERC721Token.json b/packages/contract-artifacts/artifacts/ERC721Token.json
index d189090e8..d189090e8 100644
--- a/packages/migrations/artifacts/2.0.0-trimmed/ERC721Token.json
+++ b/packages/contract-artifacts/artifacts/ERC721Token.json
diff --git a/packages/migrations/artifacts/2.0.0-trimmed/Exchange.json b/packages/contract-artifacts/artifacts/Exchange.json
index 3eb231c7a..893bc5eae 100644
--- a/packages/migrations/artifacts/2.0.0-trimmed/Exchange.json
+++ b/packages/contract-artifacts/artifacts/Exchange.json
@@ -1972,26 +1972,5 @@
}
}
},
- "networks": {
- "1": {
- "address": "0x4f833a24e1f95d70f028921e27040ca56e09ab0b",
- "links": {},
- "constructorArgs": "[]"
- },
- "3": {
- "address": "0x4530c0483a1633c7a1c97d2c53721caff2caaaaf",
- "links": {},
- "constructorArgs": "[\"0xf47261b0000000000000000000000000ff67881f8d12f372d91baae9752eb3631ff0ed00\"]"
- },
- "42": {
- "address": "0x35dd2932454449b14cee11a94d3674a936d5d7b2",
- "links": {},
- "constructorArgs": "[\"0xf47261b00000000000000000000000002002d3812f58e35f0ea1ffbf80a75a38c32175fa\"]"
- },
- "50": {
- "address": "0x48bacb9266a570d521063ef5dd96e61686dbe788",
- "links": {},
- "constructorArgs": "[\"0xf47261b0000000000000000000000000871dd7c2b4b25e1aa18728e9d5f2af4c4e431f5c\"]"
- }
- }
+ "networks": {}
}
diff --git a/packages/contract-artifacts/artifacts/Forwarder.json b/packages/contract-artifacts/artifacts/Forwarder.json
new file mode 100644
index 000000000..a7bd62f8e
--- /dev/null
+++ b/packages/contract-artifacts/artifacts/Forwarder.json
@@ -0,0 +1,447 @@
+{
+ "schemaVersion": "2.0.0",
+ "contractName": "Forwarder",
+ "compilerOutput": {
+ "abi": [
+ {
+ "constant": false,
+ "inputs": [
+ {
+ "components": [
+ {
+ "name": "makerAddress",
+ "type": "address"
+ },
+ {
+ "name": "takerAddress",
+ "type": "address"
+ },
+ {
+ "name": "feeRecipientAddress",
+ "type": "address"
+ },
+ {
+ "name": "senderAddress",
+ "type": "address"
+ },
+ {
+ "name": "makerAssetAmount",
+ "type": "uint256"
+ },
+ {
+ "name": "takerAssetAmount",
+ "type": "uint256"
+ },
+ {
+ "name": "makerFee",
+ "type": "uint256"
+ },
+ {
+ "name": "takerFee",
+ "type": "uint256"
+ },
+ {
+ "name": "expirationTimeSeconds",
+ "type": "uint256"
+ },
+ {
+ "name": "salt",
+ "type": "uint256"
+ },
+ {
+ "name": "makerAssetData",
+ "type": "bytes"
+ },
+ {
+ "name": "takerAssetData",
+ "type": "bytes"
+ }
+ ],
+ "name": "orders",
+ "type": "tuple[]"
+ },
+ {
+ "name": "makerAssetFillAmount",
+ "type": "uint256"
+ },
+ {
+ "name": "signatures",
+ "type": "bytes[]"
+ },
+ {
+ "components": [
+ {
+ "name": "makerAddress",
+ "type": "address"
+ },
+ {
+ "name": "takerAddress",
+ "type": "address"
+ },
+ {
+ "name": "feeRecipientAddress",
+ "type": "address"
+ },
+ {
+ "name": "senderAddress",
+ "type": "address"
+ },
+ {
+ "name": "makerAssetAmount",
+ "type": "uint256"
+ },
+ {
+ "name": "takerAssetAmount",
+ "type": "uint256"
+ },
+ {
+ "name": "makerFee",
+ "type": "uint256"
+ },
+ {
+ "name": "takerFee",
+ "type": "uint256"
+ },
+ {
+ "name": "expirationTimeSeconds",
+ "type": "uint256"
+ },
+ {
+ "name": "salt",
+ "type": "uint256"
+ },
+ {
+ "name": "makerAssetData",
+ "type": "bytes"
+ },
+ {
+ "name": "takerAssetData",
+ "type": "bytes"
+ }
+ ],
+ "name": "feeOrders",
+ "type": "tuple[]"
+ },
+ {
+ "name": "feeSignatures",
+ "type": "bytes[]"
+ },
+ {
+ "name": "feePercentage",
+ "type": "uint256"
+ },
+ {
+ "name": "feeRecipient",
+ "type": "address"
+ }
+ ],
+ "name": "marketBuyOrdersWithEth",
+ "outputs": [
+ {
+ "components": [
+ {
+ "name": "makerAssetFilledAmount",
+ "type": "uint256"
+ },
+ {
+ "name": "takerAssetFilledAmount",
+ "type": "uint256"
+ },
+ {
+ "name": "makerFeePaid",
+ "type": "uint256"
+ },
+ {
+ "name": "takerFeePaid",
+ "type": "uint256"
+ }
+ ],
+ "name": "orderFillResults",
+ "type": "tuple"
+ },
+ {
+ "components": [
+ {
+ "name": "makerAssetFilledAmount",
+ "type": "uint256"
+ },
+ {
+ "name": "takerAssetFilledAmount",
+ "type": "uint256"
+ },
+ {
+ "name": "makerFeePaid",
+ "type": "uint256"
+ },
+ {
+ "name": "takerFeePaid",
+ "type": "uint256"
+ }
+ ],
+ "name": "feeOrderFillResults",
+ "type": "tuple"
+ }
+ ],
+ "payable": true,
+ "stateMutability": "payable",
+ "type": "function"
+ },
+ {
+ "constant": false,
+ "inputs": [
+ {
+ "name": "assetData",
+ "type": "bytes"
+ },
+ {
+ "name": "amount",
+ "type": "uint256"
+ }
+ ],
+ "name": "withdrawAsset",
+ "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": [
+ {
+ "components": [
+ {
+ "name": "makerAddress",
+ "type": "address"
+ },
+ {
+ "name": "takerAddress",
+ "type": "address"
+ },
+ {
+ "name": "feeRecipientAddress",
+ "type": "address"
+ },
+ {
+ "name": "senderAddress",
+ "type": "address"
+ },
+ {
+ "name": "makerAssetAmount",
+ "type": "uint256"
+ },
+ {
+ "name": "takerAssetAmount",
+ "type": "uint256"
+ },
+ {
+ "name": "makerFee",
+ "type": "uint256"
+ },
+ {
+ "name": "takerFee",
+ "type": "uint256"
+ },
+ {
+ "name": "expirationTimeSeconds",
+ "type": "uint256"
+ },
+ {
+ "name": "salt",
+ "type": "uint256"
+ },
+ {
+ "name": "makerAssetData",
+ "type": "bytes"
+ },
+ {
+ "name": "takerAssetData",
+ "type": "bytes"
+ }
+ ],
+ "name": "orders",
+ "type": "tuple[]"
+ },
+ {
+ "name": "signatures",
+ "type": "bytes[]"
+ },
+ {
+ "components": [
+ {
+ "name": "makerAddress",
+ "type": "address"
+ },
+ {
+ "name": "takerAddress",
+ "type": "address"
+ },
+ {
+ "name": "feeRecipientAddress",
+ "type": "address"
+ },
+ {
+ "name": "senderAddress",
+ "type": "address"
+ },
+ {
+ "name": "makerAssetAmount",
+ "type": "uint256"
+ },
+ {
+ "name": "takerAssetAmount",
+ "type": "uint256"
+ },
+ {
+ "name": "makerFee",
+ "type": "uint256"
+ },
+ {
+ "name": "takerFee",
+ "type": "uint256"
+ },
+ {
+ "name": "expirationTimeSeconds",
+ "type": "uint256"
+ },
+ {
+ "name": "salt",
+ "type": "uint256"
+ },
+ {
+ "name": "makerAssetData",
+ "type": "bytes"
+ },
+ {
+ "name": "takerAssetData",
+ "type": "bytes"
+ }
+ ],
+ "name": "feeOrders",
+ "type": "tuple[]"
+ },
+ {
+ "name": "feeSignatures",
+ "type": "bytes[]"
+ },
+ {
+ "name": "feePercentage",
+ "type": "uint256"
+ },
+ {
+ "name": "feeRecipient",
+ "type": "address"
+ }
+ ],
+ "name": "marketSellOrdersWithEth",
+ "outputs": [
+ {
+ "components": [
+ {
+ "name": "makerAssetFilledAmount",
+ "type": "uint256"
+ },
+ {
+ "name": "takerAssetFilledAmount",
+ "type": "uint256"
+ },
+ {
+ "name": "makerFeePaid",
+ "type": "uint256"
+ },
+ {
+ "name": "takerFeePaid",
+ "type": "uint256"
+ }
+ ],
+ "name": "orderFillResults",
+ "type": "tuple"
+ },
+ {
+ "components": [
+ {
+ "name": "makerAssetFilledAmount",
+ "type": "uint256"
+ },
+ {
+ "name": "takerAssetFilledAmount",
+ "type": "uint256"
+ },
+ {
+ "name": "makerFeePaid",
+ "type": "uint256"
+ },
+ {
+ "name": "takerFeePaid",
+ "type": "uint256"
+ }
+ ],
+ "name": "feeOrderFillResults",
+ "type": "tuple"
+ }
+ ],
+ "payable": true,
+ "stateMutability": "payable",
+ "type": "function"
+ },
+ {
+ "constant": false,
+ "inputs": [
+ {
+ "name": "newOwner",
+ "type": "address"
+ }
+ ],
+ "name": "transferOwnership",
+ "outputs": [],
+ "payable": false,
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "name": "_exchange",
+ "type": "address"
+ },
+ {
+ "name": "_zrxAssetData",
+ "type": "bytes"
+ },
+ {
+ "name": "_wethAssetData",
+ "type": "bytes"
+ }
+ ],
+ "payable": false,
+ "stateMutability": "nonpayable",
+ "type": "constructor"
+ },
+ {
+ "payable": true,
+ "stateMutability": "payable",
+ "type": "fallback"
+ }
+ ],
+ "evm": {
+ "bytecode": {
+ "linkReferences": {},
+ "object": "0x60806040523480156200001157600080fd5b5060405162002d2c38038062002d2c83398101806040526200003791908101906200051d565b6000805433600160a060020a031991821617825560018054909116600160a060020a0386161790558251849084908490849081906200007e906004906020870190620003d0565b50825162000094906005906020860190620003d0565b50620000b0836010640100000000620019476200036f82021704565b9150620000cd846010640100000000620019476200036f82021704565b60028054600160a060020a03948516600160a060020a031991821617909155600380549285169290911691909117905550600154604080517f4552433230546f6b656e28616464726573732900000000000000000000000000815290519081900360130181207f6070410800000000000000000000000000000000000000000000000000000000825291909216945063607041089350620001739250906004016200068e565b602060405180830381600087803b1580156200018e57600080fd5b505af1158015620001a3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250620001c99190810190620004f4565b9050600160a060020a038116151562000219576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200021090620006b0565b60405180910390fd5b6002546040517f095ea7b3000000000000000000000000000000000000000000000000000000008152600160a060020a039091169063095ea7b39062000268908490600019906004016200066f565b602060405180830381600087803b1580156200028357600080fd5b505af115801562000298573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250620002be9190810190620005a1565b506003546040517f095ea7b3000000000000000000000000000000000000000000000000000000008152600160a060020a039091169063095ea7b3906200030e908490600019906004016200066f565b602060405180830381600087803b1580156200032957600080fd5b505af11580156200033e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250620003649190810190620005a1565b50505050506200077a565b600081601401835110151515620003b4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040162000210906200069e565b506014818301810151910190600160a060020a03165b92915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200041357805160ff191683800117855562000443565b8280016001018555821562000443579182015b828111156200044357825182559160200191906001019062000426565b506200045192915062000455565b5090565b6200047291905b808211156200045157600081556001016200045c565b90565b600062000483825162000711565b9392505050565b600062000483825162000742565b6000601f82018313620004aa57600080fd5b8151620004c1620004bb82620006e9565b620006c2565b91508082526020830160208301858383011115620004de57600080fd5b620004eb83828462000747565b50505092915050565b6000602082840312156200050757600080fd5b600062000515848462000475565b949350505050565b6000806000606084860312156200053357600080fd5b600062000541868662000475565b93505060208401516001604060020a038111156200055e57600080fd5b6200056c8682870162000498565b92505060408401516001604060020a038111156200058957600080fd5b620005978682870162000498565b9150509250925092565b600060208284031215620005b457600080fd5b60006200051584846200048a565b620005cd8162000711565b82525050565b620005cd816200071d565b602681527f475245415445525f4f525f455155414c5f544f5f32305f4c454e4754485f524560208201527f5155495245440000000000000000000000000000000000000000000000000000604082015260600190565b601881527f554e524547495354455245445f41535345545f50524f58590000000000000000602082015260400190565b620005cd8162000472565b604081016200067f8285620005c2565b62000483602083018462000664565b60208101620003ca8284620005d3565b60208082528101620003ca81620005de565b60208082528101620003ca8162000634565b6040518181016001604060020a0381118282101715620006e157600080fd5b604052919050565b60006001604060020a038211156200070057600080fd5b506020601f91909101601f19160190565b600160a060020a031690565b7fffffffff000000000000000000000000000000000000000000000000000000001690565b151590565b60005b83811015620007645781810151838201526020016200074a565b8381111562000774576000848401525b50505050565b6125a2806200078a6000396000f30060806040526004361061006c5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166318978e8281146100c8578063630f1e6c146100f25780638da5cb5b146101125780639395525c14610134578063f2fde38b14610147575b60025473ffffffffffffffffffffffffffffffffffffffff1633146100c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612388565b60405180910390fd5b005b6100db6100d6366004611df1565b610167565b6040516100e9929190612488565b60405180910390f35b3480156100fe57600080fd5b506100c661010d366004611eec565b6102f7565b34801561011e57600080fd5b50610127610388565b6040516100e99190612337565b6100db610142366004611d0b565b6103a4565b34801561015357600080fd5b506100c6610162366004611ce5565b61050a565b61016f6119fa565b6101776119fa565b6000806101826105bb565b60048054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610100600188161502019095169490940493840181900481028201810190925282815261025c939092909183018282801561022d5780601f106102025761010080835404028352916020019161022d565b820191906000526020600020905b81548152906001019060200180831161021057829003601f168201915b50505050508c600081518110151561024157fe5b6020908102909101015161014001519063ffffffff61069616565b156102875761026c8b8b8b6107c3565b935061028084600001518560600151610ac1565b90506102ae565b6102928b8b8b610b03565b9350836060015191506102a68883896107c3565b845190935090505b6102c2846020015184602001518888610d15565b6102e98b60008151811015156102d457fe5b90602001906020020151610140015182610f29565b505097509795505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610348576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612438565b61038383838080601f01602080910402602001604051908101604052809392919081815260200183838082843750879450610f299350505050565b505050565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b6103ac6119fa565b6103b46119fa565b60008060006103c16105bb565b60048054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101006001881615020190951694909404938401819004810282018101909252828152610441939092909183018282801561022d5780601f106102025761010080835404028352916020019161022d565b156104925761046a670de0b6b3a7640000610464670de0b6b3a76400008a611045565b3461108f565b92506104778b848c6110e7565b945061048b85600001518660600151610ac1565b90506104d6565b6104ad670d2f13f7789f0000670de0b6b3a76400003461108f565b92506104ba8b848c6110e7565b9450846060015191506104ce89838a6107c3565b855190945090505b6104ea856020015185602001518989610d15565b6104fc8b60008151811015156102d457fe5b505050965096945050505050565b60005473ffffffffffffffffffffffffffffffffffffffff16331461055b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612438565b73ffffffffffffffffffffffffffffffffffffffff8116156105b857600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83161790555b50565b600034116105f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612398565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0e30db0346040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004016000604051808303818588803b15801561067b57600080fd5b505af115801561068f573d6000803e3d6000fd5b5050505050565b6000815183511480156107ba5750816040518082805190602001908083835b602083106106f257805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016106b5565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0180199092169116179052604051919093018190038120885190955088945090928392508401908083835b6020831061078757805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161074a565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060001916145b90505b92915050565b6107cb6119fa565b60608060008060008060006107de6119fa565b8a15156107ea57610ab2565b6004805460408051602060026001851615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f8101849004840282018401909252818152929183018282801561088e5780601f106108635761010080835404028352916020019161088e565b820191906000526020600020905b81548152906001019060200180831161087157829003601f168201915b505060058054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101006001881615020190951694909404938401819004810282018101909252828152969e509194509250840190508282801561093d5780601f106109125761010080835404028352916020019161093d565b820191906000526020600020905b81548152906001019060200180831161092057829003601f168201915b50505050509650600095508b519450600093505b838514610a7857878c8581518110151561096757fe5b6020908102909101015161014001528b5187908d908690811061098657fe5b60209081029091010151610160015261099f8b87610ac1565b9250610a068c858151811015156109b257fe5b9060200190602002015160a00151610a008e878151811015156109d157fe5b90602001906020020151608001518f888151811015156109ed57fe5b9060200190602002015160e00151610ac1565b8561128b565b9150610a418c85815181101515610a1957fe5b90602001906020020151838c87815181101515610a3257fe5b906020019060200201516112e6565b9050610a4d898261135e565b610a5f89600001518a60600151610ac1565b95508a8610610a6d57610a78565b600190930192610951565b8a861015610ab2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612418565b50505050505050509392505050565b600082821115610afd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123b8565b50900390565b610b0b6119fa565b606080600080600080610b1c6119fa565b60008b6000815181101515610b2d57fe5b6020908102919091018101516101400151600580546040805160026001841615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190931692909204601f8101869004860283018601909152808252929b5092909190830182828015610be55780601f10610bba57610100808354040283529160200191610be5565b820191906000526020600020905b815481529060010190602001808311610bc857829003601f168201915b505050505096508b519550600094505b848614610cdb57878c86815181101515610c0b57fe5b6020908102909101015161014001528b5187908d9087908110610c2a57fe5b6020908102909101015161016001528851610c46908c90610ac1565b9350610c898c86815181101515610c5957fe5b9060200190602002015160a001518d87815181101515610c7557fe5b90602001906020020151608001518661128b565b9250610cb58c86815181101515610c9c57fe5b90602001906020020151848c88815181101515610a3257fe5b9150610cc1898361135e565b5087518a8110610cd057610cdb565b600190940193610bf5565b8a811015610ab2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612418565b600080808066b1a2bc2ec50000861115610d5b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612448565b610d658888611045565b935034841115610da1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123a8565b610dab3485610ac1565b9250610dc086670de0b6b3a76400008a61108f565b915082821115610dfc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612428565b6000831115610f1f576002546040517f2e1a7d4d00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911690632e1a7d4d90610e5b9086906004016124a4565b600060405180830381600087803b158015610e7557600080fd5b505af1158015610e89573d6000803e3d6000fd5b505050506000821115610edb5760405173ffffffffffffffffffffffffffffffffffffffff86169083156108fc029084906000818181858888f19350505050158015610ed9573d6000803e3d6000fd5b505b610ee58383610ac1565b90506000811115610f1f57604051339082156108fc029083906000818181858888f19350505050158015610f1d573d6000803e3d6000fd5b505b5050505050505050565b6000610f3b838263ffffffff6113c016565b604080517f4552433230546f6b656e28616464726573732900000000000000000000000000815290519081900360130190209091507fffffffff0000000000000000000000000000000000000000000000000000000080831691161415610fab57610fa6838361142d565b610383565b604080517f455243373231546f6b656e28616464726573732c75696e7432353629000000008152905190819003601c0190207fffffffff000000000000000000000000000000000000000000000000000000008281169116141561101357610fa6838361161b565b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123f8565b600082820183811015611084576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123e8565b8091505b5092915050565b60008083116110ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123d8565b6110dd6110d78584611703565b8461175e565b90505b9392505050565b6110ef6119fa565b60608060008060006110ff6119fa565b89600081518110151561110e57fe5b6020908102919091018101516101400151600580546040805160026001841615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190931692909204601f8101869004860283018601909152808252929950929091908301828280156111c65780601f1061119b576101008083540402835291602001916111c6565b820191906000526020600020905b8154815290600101906020018083116111a957829003601f168201915b5050505050945089519350600092505b82841461127e57858a848151811015156111ec57fe5b602090810290910101516101400152895185908b908590811061120b57fe5b90602001906020020151610160018190525061122b898860200151610ac1565b91506112578a8481518110151561123e57fe5b90602001906020020151838a86815181101515610a3257fe5b9050611263878261135e565b602087015189116112735761127e565b6001909201916111d6565b5050505050509392505050565b60008083116112c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123d8565b6110dd6110d76112d68685611703565b6112e1866001610ac1565b611045565b6112ee6119fa565b606060006112fd868686611775565b600154815191935073ffffffffffffffffffffffffffffffffffffffff1691506080908390602082016000855af1801561135457825184526020830151602085015260408301516040850152606083015160608501525b5050509392505050565b8151815161136c9190611045565b8252602080830151908201516113829190611045565b60208301526040808301519082015161139b9190611045565b6040830152606080830151908201516113b49190611045565b60609092019190915250565b600081600401835110151515611402576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612468565b5001602001517fffffffff000000000000000000000000000000000000000000000000000000001690565b60008061144184601063ffffffff61194716565b604080517f7472616e7366657228616464726573732c75696e7432353629000000000000008152905190819003601901812091935073ffffffffffffffffffffffffffffffffffffffff8416919061149f903390879060240161236d565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009094169390931783525181519192909182919080838360005b8381101561154357818101518382015260200161152b565b50505050905090810190601f1680156115705780820380516001836020036101000a031916815260200191505b509150506000604051808303816000865af1925050508015156115bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612408565b3d156115dc575060003d602014156115dc5760206000803e506000515b801515611615576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612408565b50505050565b60008060018314611658576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612478565b61166984601063ffffffff61194716565b915061167c84602463ffffffff6119a816565b6040517f23b872dd00000000000000000000000000000000000000000000000000000000815290915073ffffffffffffffffffffffffffffffffffffffff8316906323b872dd906116d590309033908690600401612345565b600060405180830381600087803b1580156116ef57600080fd5b505af1158015610f1f573d6000803e3d6000fd5b6000808315156117165760009150611088565b5082820282848281151561172657fe5b0414611084576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123e8565b600080828481151561176c57fe5b04949350505050565b604080517fb4be83d5000000000000000000000000000000000000000000000000000000006020808301919091526060602483018181528751608485019081528884015160a48601529488015160c48501529087015160e4840152608087015161010484015260a087015161012484015260c087015161014484015260e08701516101648401526101008701516101848401526101208701516101a4840152610140870180516101c485019081526101608901516101e4860152610180905251805161020485018190529394919384936044870192849261022489019291820191601f82010460005b8181101561187c57835185526020948501949093019260010161185e565b50505050818103610160808401919091528a0151805180835260209283019291820191601f82010460005b818110156118c55783518552602094850194909301926001016118a7565b50505089845250848103602093840190815288518083529093918201918981019190601f82010460005b8181101561190d5783518552602094850194909301926001016118ef565b5050507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08883030188525060405250505050509392505050565b600081601401835110151515611989576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612458565b50016014015173ffffffffffffffffffffffffffffffffffffffff1690565b60006107ba83836000816020018351101515156119f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123c8565b50016020015190565b608060405190810160405280600081526020016000815260200160008152602001600081525090565b60006107ba8235612540565b6000601f82018313611a4057600080fd5b8135611a53611a4e826124d9565b6124b2565b81815260209384019390925082018360005b83811015611a915781358601611a7b8882611b41565b8452506020928301929190910190600101611a65565b5050505092915050565b6000601f82018313611aac57600080fd5b8135611aba611a4e826124d9565b81815260209384019390925082018360005b83811015611a915781358601611ae28882611b90565b8452506020928301929190910190600101611acc565b600080601f83018413611b0a57600080fd5b50813567ffffffffffffffff811115611b2257600080fd5b602083019150836001820283011115611b3a57600080fd5b9250929050565b6000601f82018313611b5257600080fd5b8135611b60611a4e826124fa565b91508082526020830160208301858383011115611b7c57600080fd5b611b8783828461255c565b50505092915050565b60006101808284031215611ba357600080fd5b611bae6101806124b2565b90506000611bbc8484611a23565b8252506020611bcd84848301611a23565b6020830152506040611be184828501611a23565b6040830152506060611bf584828501611a23565b6060830152506080611c0984828501611cd9565b60808301525060a0611c1d84828501611cd9565b60a08301525060c0611c3184828501611cd9565b60c08301525060e0611c4584828501611cd9565b60e083015250610100611c5a84828501611cd9565b61010083015250610120611c7084828501611cd9565b6101208301525061014082013567ffffffffffffffff811115611c9257600080fd5b611c9e84828501611b41565b6101408301525061016082013567ffffffffffffffff811115611cc057600080fd5b611ccc84828501611b41565b6101608301525092915050565b60006107ba8235612559565b600060208284031215611cf757600080fd5b6000611d038484611a23565b949350505050565b60008060008060008060c08789031215611d2457600080fd5b863567ffffffffffffffff811115611d3b57600080fd5b611d4789828a01611a9b565b965050602087013567ffffffffffffffff811115611d6457600080fd5b611d7089828a01611a2f565b955050604087013567ffffffffffffffff811115611d8d57600080fd5b611d9989828a01611a9b565b945050606087013567ffffffffffffffff811115611db657600080fd5b611dc289828a01611a2f565b9350506080611dd389828a01611cd9565b92505060a0611de489828a01611a23565b9150509295509295509295565b600080600080600080600060e0888a031215611e0c57600080fd5b873567ffffffffffffffff811115611e2357600080fd5b611e2f8a828b01611a9b565b9750506020611e408a828b01611cd9565b965050604088013567ffffffffffffffff811115611e5d57600080fd5b611e698a828b01611a2f565b955050606088013567ffffffffffffffff811115611e8657600080fd5b611e928a828b01611a9b565b945050608088013567ffffffffffffffff811115611eaf57600080fd5b611ebb8a828b01611a2f565b93505060a0611ecc8a828b01611cd9565b92505060c0611edd8a828b01611a23565b91505092959891949750929550565b600080600060408486031215611f0157600080fd5b833567ffffffffffffffff811115611f1857600080fd5b611f2486828701611af8565b93509350506020611f3786828701611cd9565b9150509250925092565b611f4a81612540565b82525050565b602381527f44454641554c545f46554e4354494f4e5f574554485f434f4e54524143545f4f60208201527f4e4c590000000000000000000000000000000000000000000000000000000000604082015260600190565b601181527f494e56414c49445f4d53475f56414c5545000000000000000000000000000000602082015260400190565b600d81527f4f564552534f4c445f5745544800000000000000000000000000000000000000602082015260400190565b601181527f55494e543235365f554e444552464c4f57000000000000000000000000000000602082015260400190565b602681527f475245415445525f4f525f455155414c5f544f5f33325f4c454e4754485f524560208201527f5155495245440000000000000000000000000000000000000000000000000000604082015260600190565b601081527f4449564953494f4e5f42595f5a45524f00000000000000000000000000000000602082015260400190565b601081527f55494e543235365f4f564552464c4f5700000000000000000000000000000000602082015260400190565b601781527f554e535550504f525445445f41535345545f50524f5859000000000000000000602082015260400190565b600f81527f5452414e534645525f4641494c45440000000000000000000000000000000000602082015260400190565b601481527f434f4d504c4554455f46494c4c5f4641494c4544000000000000000000000000602082015260400190565b601a81527f494e53554646494349454e545f4554485f52454d41494e494e47000000000000602082015260400190565b601381527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000602082015260400190565b601881527f4645455f50455243454e544147455f544f4f5f4c415247450000000000000000602082015260400190565b602681527f475245415445525f4f525f455155414c5f544f5f32305f4c454e4754485f524560208201527f5155495245440000000000000000000000000000000000000000000000000000604082015260600190565b602581527f475245415445525f4f525f455155414c5f544f5f345f4c454e4754485f52455160208201527f5549524544000000000000000000000000000000000000000000000000000000604082015260600190565b600e81527f494e56414c49445f414d4f554e54000000000000000000000000000000000000602082015260400190565b805160808301906122f9848261232e565b50602082015161230c602085018261232e565b50604082015161231f604085018261232e565b50606082015161161560608501825b611f4a81612559565b602081016107bd8284611f41565b606081016123538286611f41565b6123606020830185611f41565b611d03604083018461232e565b6040810161237b8285611f41565b6110e0602083018461232e565b602080825281016107bd81611f50565b602080825281016107bd81611fa6565b602080825281016107bd81611fd6565b602080825281016107bd81612006565b602080825281016107bd81612036565b602080825281016107bd8161208c565b602080825281016107bd816120bc565b602080825281016107bd816120ec565b602080825281016107bd8161211c565b602080825281016107bd8161214c565b602080825281016107bd8161217c565b602080825281016107bd816121ac565b602080825281016107bd816121dc565b602080825281016107bd8161220c565b602080825281016107bd81612262565b602080825281016107bd816122b8565b610100810161249782856122e8565b6110e060808301846122e8565b602081016107bd828461232e565b60405181810167ffffffffffffffff811182821017156124d157600080fd5b604052919050565b600067ffffffffffffffff8211156124f057600080fd5b5060209081020190565b600067ffffffffffffffff82111561251157600080fd5b506020601f919091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0160190565b73ffffffffffffffffffffffffffffffffffffffff1690565b90565b828183375060009101525600a265627a7a72305820d9f418f11e0f91f06f6f9d22924be0add925495eeb76a6388b5417adb505eeb36c6578706572696d656e74616cf50037"
+ }
+ }
+ },
+ "networks": {}
+} \ No newline at end of file
diff --git a/packages/migrations/artifacts/2.0.0-trimmed/IValidator.json b/packages/contract-artifacts/artifacts/IValidator.json
index 8ca99f261..8ca99f261 100644
--- a/packages/migrations/artifacts/2.0.0-trimmed/IValidator.json
+++ b/packages/contract-artifacts/artifacts/IValidator.json
diff --git a/packages/migrations/artifacts/2.0.0-trimmed/IWallet.json b/packages/contract-artifacts/artifacts/IWallet.json
index 2a8f975cc..2a8f975cc 100644
--- a/packages/migrations/artifacts/2.0.0-trimmed/IWallet.json
+++ b/packages/contract-artifacts/artifacts/IWallet.json
diff --git a/packages/migrations/artifacts/2.0.0-trimmed/OrderValidator.json b/packages/contract-artifacts/artifacts/OrderValidator.json
index 85032bbeb..90a92e7cb 100644
--- a/packages/migrations/artifacts/2.0.0-trimmed/OrderValidator.json
+++ b/packages/contract-artifacts/artifacts/OrderValidator.json
@@ -568,30 +568,5 @@
}
}
},
- "networks": {
- "1": {
- "address": "0x9463e518dea6810309563c81d5266c1b1d149138",
- "links": {},
- "constructorArgs":
- "[\"0x4f833a24e1f95d70f028921e27040ca56e09ab0b\",\"0xf47261b0000000000000000000000000e41d2489571d322189246dafa5ebde1f4699f498\"]"
- },
- "3": {
- "address": "0x90431a90516ab49af23a0530e04e8c7836e7122f",
- "links": {},
- "constructorArgs":
- "[\"0x4530c0483a1633c7a1c97d2c53721caff2caaaaf\",\"0xf47261b0000000000000000000000000ff67881f8d12f372d91baae9752eb3631ff0ed00\"]"
- },
- "42": {
- "address": "0xb389da3d204b412df2f75c6afb3d0a7ce0bc283d",
- "links": {},
- "constructorArgs":
- "[\"0x35dd2932454449b14cee11a94d3674a936d5d7b2\",\"0xf47261b00000000000000000000000002002d3812f58e35f0ea1ffbf80a75a38c32175fa\"]"
- },
- "50": {
- "address": "0xe86bb98fcf9bff3512c74589b78fb168200cc546",
- "links": {},
- "constructorArgs":
- "[\"0x48bacb9266a570d521063ef5dd96e61686dbe788\",\"0xf47261b0000000000000000000000000871dd7c2b4b25e1aa18728e9d5f2af4c4e431f5c\"]"
- }
- }
+ "networks": {}
}
diff --git a/packages/migrations/artifacts/2.0.0-trimmed/WETH9.json b/packages/contract-artifacts/artifacts/WETH9.json
index cd2d83104..e6ce25f7d 100644
--- a/packages/migrations/artifacts/2.0.0-trimmed/WETH9.json
+++ b/packages/contract-artifacts/artifacts/WETH9.json
@@ -289,26 +289,5 @@
}
}
},
- "networks": {
- "1": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "links": {},
- "constructorArgs": "[]"
- },
- "3": {
- "address": "0xc778417e063141139fce010982780140aa0cd5ab",
- "links": {},
- "constructorArgs": "[]"
- },
- "42": {
- "address": "0xd0a1e359811322d97991e03f863a0c30c2cf029c",
- "links": {},
- "constructorArgs": "[]"
- },
- "50": {
- "address": "0x0b1ba0af832d7c05fd64161e0db78e85978e8082",
- "links": {},
- "constructorArgs": "[]"
- }
- }
+ "networks": {}
}
diff --git a/packages/migrations/artifacts/2.0.0-trimmed/ZRXToken.json b/packages/contract-artifacts/artifacts/ZRXToken.json
index c2053578f..29bb55824 100644
--- a/packages/migrations/artifacts/2.0.0-trimmed/ZRXToken.json
+++ b/packages/contract-artifacts/artifacts/ZRXToken.json
@@ -223,26 +223,5 @@
}
}
},
- "networks": {
- "1": {
- "address": "0xe41d2489571d322189246dafa5ebde1f4699f498",
- "links": {},
- "constructorArgs": "[]"
- },
- "3": {
- "address": "0xff67881f8d12f372d91baae9752eb3631ff0ed00",
- "links": {},
- "constructorArgs": "[\"0x Protocol Token\",\"ZRX\",\"18\",\"1000000000000000000000000000\"]"
- },
- "42": {
- "address": "0x2002d3812f58e35f0ea1ffbf80a75a38c32175fa",
- "links": {},
- "constructorArgs": "[\"0x Protocol Token\",\"ZRX\",\"18\",\"1000000000000000000000000000\"]"
- },
- "50": {
- "address": "0x871dd7c2b4b25e1aa18728e9d5f2af4c4e431f5c",
- "links": {},
- "constructorArgs": "[]"
- }
- }
+ "networks": {}
}
diff --git a/packages/contract-artifacts/package.json b/packages/contract-artifacts/package.json
new file mode 100644
index 000000000..9c25e3ac5
--- /dev/null
+++ b/packages/contract-artifacts/package.json
@@ -0,0 +1,33 @@
+{
+ "name": "@0x/contract-artifacts",
+ "version": "1.1.0",
+ "engines": {
+ "node": ">=6.12"
+ },
+ "description": "0x smart contract compilation artifacts",
+ "main": "lib/src/index.js",
+ "directories": {
+ "test": "test"
+ },
+ "scripts": {
+ "build": "yarn tsc -b",
+ "build:ci": "yarn build",
+ "clean": "shx rm -rf lib"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/0xProject/0x-monorepo.git"
+ },
+ "license": "Apache-2.0",
+ "bugs": {
+ "url": "https://github.com/0xProject/0x-monorepo/issues"
+ },
+ "homepage": "https://github.com/0xProject/0x-monorepo/packages/contract-artifacts/README.md",
+ "devDependencies": {
+ "shx": "^0.2.2",
+ "typescript": "3.0.1"
+ },
+ "publishConfig": {
+ "access": "public"
+ }
+}
diff --git a/packages/contract-artifacts/src/index.ts b/packages/contract-artifacts/src/index.ts
new file mode 100644
index 000000000..f30276dd9
--- /dev/null
+++ b/packages/contract-artifacts/src/index.ts
@@ -0,0 +1,31 @@
+import * as AssetProxyOwner from '../artifacts/AssetProxyOwner.json';
+import * as DummyERC20Token from '../artifacts/DummyERC20Token.json';
+import * as DummyERC721Token from '../artifacts/DummyERC721Token.json';
+import * as ERC20Proxy from '../artifacts/ERC20Proxy.json';
+import * as ERC20Token from '../artifacts/ERC20Token.json';
+import * as ERC721Proxy from '../artifacts/ERC721Proxy.json';
+import * as ERC721Token from '../artifacts/ERC721Token.json';
+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 OrderValidator from '../artifacts/OrderValidator.json';
+import * as WETH9 from '../artifacts/WETH9.json';
+import * as ZRXToken from '../artifacts/ZRXToken.json';
+
+export {
+ AssetProxyOwner,
+ DummyERC20Token,
+ DummyERC721Token,
+ ERC20Proxy,
+ ERC20Token,
+ ERC721Proxy,
+ ERC721Token,
+ Exchange,
+ Forwarder,
+ IValidator,
+ IWallet,
+ OrderValidator,
+ WETH9,
+ ZRXToken,
+};
diff --git a/packages/contract-artifacts/tsconfig.json b/packages/contract-artifacts/tsconfig.json
new file mode 100644
index 000000000..cce086209
--- /dev/null
+++ b/packages/contract-artifacts/tsconfig.json
@@ -0,0 +1,25 @@
+{
+ "extends": "../../tsconfig",
+ "compilerOptions": {
+ "outDir": "lib",
+ "rootDir": ".",
+ "resolveJsonModule": true
+ },
+ "include": ["./src/**/*"],
+ "files": [
+ "./artifacts/AssetProxyOwner.json",
+ "./artifacts/DummyERC20Token.json",
+ "./artifacts/DummyERC721Token.json",
+ "./artifacts/ERC20Proxy.json",
+ "./artifacts/ERC20Token.json",
+ "./artifacts/ERC721Proxy.json",
+ "./artifacts/ERC721Token.json",
+ "./artifacts/Exchange.json",
+ "./artifacts/Forwarder.json",
+ "./artifacts/IValidator.json",
+ "./artifacts/IWallet.json",
+ "./artifacts/OrderValidator.json",
+ "./artifacts/WETH9.json",
+ "./artifacts/ZRXToken.json"
+ ]
+}
diff --git a/packages/contract-artifacts/tslint.json b/packages/contract-artifacts/tslint.json
new file mode 100644
index 000000000..dd9053357
--- /dev/null
+++ b/packages/contract-artifacts/tslint.json
@@ -0,0 +1,3 @@
+{
+ "extends": ["@0x/tslint-config"]
+}
diff --git a/packages/contract-wrappers/CHANGELOG.json b/packages/contract-wrappers/CHANGELOG.json
index 0770b6c0d..0ab5e5d08 100644
--- a/packages/contract-wrappers/CHANGELOG.json
+++ b/packages/contract-wrappers/CHANGELOG.json
@@ -1,13 +1,85 @@
[
{
- "version": "2.1.0",
+ "version": "4.0.0",
"changes": [
{
- "note": "Add optional validation to the forwarder wrapper methods"
+ "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",
+ "pr": 1235
+ },
+ {
+ "note":
+ "Throw previously swallowed network errors when calling `validateOrderFillableOrThrowAsync` (see issue: #1218)",
+ "pr": 1235
}
]
},
{
+ "version": "3.0.1",
+ "changes": [
+ {
+ "note": "Fix bug in `ForwarderWrapper` where `feeRecipientAddress` was not correctly normalized.",
+ "pr": 1178
+ }
+ ],
+ "timestamp": 1541740904
+ },
+ {
+ "version": "3.0.0",
+ "changes": [
+ {
+ "note": "Add optional validation to the forwarder wrapper methods"
+ },
+ {
+ "note": "Updated to use new modularized artifacts.",
+ "pr": 1105
+ },
+ {
+ "note": "Top-level `ContractWrappers` class has a new optional `contractAddresses` parameter.",
+ "pr": 1105
+ },
+ {
+ "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()`).",
+ "pr": 1105
+ },
+ {
+ "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.",
+ "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.",
+ "pr": 1105
+ },
+ {
+ "note": "Add `ForwarderWrapperError` to public interface",
+ "pr": 1147
+ },
+ {
+ "note": "Add `ContractWrapperError.SignatureRequestDenied` to public interface",
+ "pr": 1147
+ }
+ ],
+ "timestamp": 1539871071
+ },
+ {
"version": "2.0.2",
"changes": [
{
diff --git a/packages/contract-wrappers/CHANGELOG.md b/packages/contract-wrappers/CHANGELOG.md
index 60675ddbe..1fe903dd9 100644
--- a/packages/contract-wrappers/CHANGELOG.md
+++ b/packages/contract-wrappers/CHANGELOG.md
@@ -5,6 +5,23 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
+## v3.0.1 - _November 9, 2018_
+
+ * Fix bug in `ForwarderWrapper` where `feeRecipientAddress` was not correctly normalized. (#1178)
+
+## v3.0.0 - _October 18, 2018_
+
+ * Add optional validation to the forwarder wrapper methods
+ * Updated to use new modularized artifacts. (#1105)
+ * Top-level `ContractWrappers` class has a new optional `contractAddresses` parameter. (#1105)
+ * Default contract addresses are no longer stored in artifacts and are instead loaded from the `@0xproject/contract-addresses` package. (#1105)
+ * 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()`). (#1105)
+ * Removed `setProvider` method in top-level `ContractWrapper` class and added new `unsubscribeAll` method. (#1105)
+ * 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. (#1105)
+ * 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. (#1105)
+ * Add `ForwarderWrapperError` to public interface (#1147)
+ * Add `ContractWrapperError.SignatureRequestDenied` to public interface (#1147)
+
## v2.0.2 - _October 4, 2018_
* Dependencies updated
@@ -51,7 +68,7 @@ CHANGELOG
* Remove superfluous exported types: `ContractEvent`, `Token`, `OrderFillRequest`, `ContractEventArgs`, `LogEvent`, `OnOrderStateChangeCallback`, `ECSignature`, `OrderStateValid`, `OrderStateInvalid`, `OrderState`, `FilterObject`, `TransactionReceipt` & `TransactionReceiptWithDecodedLogs` (#924)
* Added Transaction Encoder for use with 0x Exchange executeTransaction (#975)
-## v1.0.1-rc.3 - _August 13, 2018_
+## v1.0.1-rc.3 - _August 14, 2018_
* Added strict encoding/decoding checks for sendTransaction and call (#915)
* Add ForwarderWrapper (#934)
diff --git a/packages/contract-wrappers/README.md b/packages/contract-wrappers/README.md
index 6153f798e..36f2f48fb 100644
--- a/packages/contract-wrappers/README.md
+++ b/packages/contract-wrappers/README.md
@@ -1,4 +1,4 @@
-## @0xproject/contract-wrappers
+## @0x/contract-wrappers
Smart TS wrappers for 0x smart contracts. The wrappers have simplified interfaces, perform client-side validation on transactions and throw helpful error messages.
@@ -9,20 +9,20 @@ Smart TS wrappers for 0x smart contracts. The wrappers have simplified interface
**Install**
```bash
-npm install @0xproject/contract-wrappers --save
+npm install @0x/contract-wrappers --save
```
**Import**
```javascript
-import { ContractWrappers } from '@0xproject/contract-wrappers';
+import { ContractWrappers } from '@0x/contract-wrappers';
```
If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`:
```json
"compilerOptions": {
- "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"],
+ "typeRoots": ["node_modules/@0x/typescript-typings/types", "node_modules/@types"],
}
```
@@ -51,13 +51,13 @@ yarn install
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
```bash
-PKG=@0xproject/contract-wrappers yarn build
+PKG=@0x/contract-wrappers yarn build
```
Or continuously rebuild on change:
```bash
-PKG=@0xproject/contract-wrappers yarn watch
+PKG=@0x/contract-wrappers yarn watch
```
```bash
diff --git a/packages/contract-wrappers/package.json b/packages/contract-wrappers/package.json
index 35f27d77c..cb69bbd33 100644
--- a/packages/contract-wrappers/package.json
+++ b/packages/contract-wrappers/package.json
@@ -1,6 +1,6 @@
{
- "name": "@0xproject/contract-wrappers",
- "version": "2.0.2",
+ "name": "@0x/contract-wrappers",
+ "version": "3.0.1",
"description": "Smart TS wrappers for 0x smart contracts",
"keywords": [
"0xproject",
@@ -11,24 +11,19 @@
"main": "lib/src/index.js",
"types": "lib/src/index.d.ts",
"scripts": {
- "build": "yarn pre_build && tsc -b",
+ "build": "tsc -b",
"build:ci": "yarn build",
- "pre_build": "run-s update_artifacts generate_contract_wrappers copy_artifacts",
- "generate_contract_wrappers": "abi-gen --abis 'src/artifacts/@(Exchange|DummyERC20Token|DummyERC721Token|ZRXToken|ERC20Token|ERC721Token|WETH9|ERC20Proxy|ERC721Proxy|Forwarder|OrderValidator).json' --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/contract_wrappers/generated --backend ethers",
- "lint": "tslint --project . --exclude **/src/contract_wrappers/**/* --exclude **/lib/**/*",
+ "lint": "tslint --format stylish --project . --exclude **/lib/**/*",
"test:circleci": "run-s test:coverage",
"test": "yarn run_mocha",
"rebuild_and_test": "run-s build test",
"test:coverage": "nyc npm run test --all && yarn coverage:report:lcov",
"coverage:report:lcov": "nyc report --reporter=text-lcov > coverage/lcov.info",
- "update_artifacts": "for i in ${npm_package_config_contracts_v2}; do copyfiles -u 4 ../migrations/artifacts/2.0.0-trimmed/$i.json src/artifacts; done;",
- "copy_artifacts": "copyfiles -u 2 './src/artifacts/**/*.json' ./lib/src/artifacts",
- "clean": "shx rm -rf _bundles lib test_temp test/artifacts src/contract_wrappers/generated src/artifacts generated_docs",
+ "clean": "shx rm -rf _bundles lib test_temp generated_docs",
"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": {
- "contracts_v2": "AssetProxyOwner Exchange ERC20Proxy ERC20Token ERC721Proxy ERC721Token WETH9 ZRXToken Forwarder OrderValidator DummyERC20Token DummyERC721Token",
"postpublish": {
"assets": []
}
@@ -42,11 +37,10 @@
"node": ">=6.0.0"
},
"devDependencies": {
- "@0xproject/abi-gen": "^1.0.13",
- "@0xproject/dev-utils": "^1.0.12",
- "@0xproject/migrations": "^1.0.14",
- "@0xproject/subproviders": "^2.0.7",
- "@0xproject/tslint-config": "^1.0.8",
+ "@0x/dev-utils": "^1.0.14",
+ "@0x/migrations": "^2.0.1",
+ "@0x/subproviders": "^2.1.1",
+ "@0x/tslint-config": "^1.0.10",
"@types/lodash": "4.14.104",
"@types/mocha": "^2.2.42",
"@types/node": "*",
@@ -56,7 +50,6 @@
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
"chai-bignumber": "^2.0.1",
- "copyfiles": "^2.0.0",
"dirty-chai": "^2.0.1",
"make-promises-safe": "^1.1.0",
"mocha": "^4.1.0",
@@ -67,21 +60,23 @@
"sinon": "^4.0.0",
"source-map-support": "^0.5.0",
"tslint": "5.11.0",
- "typedoc": "0.12.0",
+ "typedoc": "0.13.0",
"typescript": "3.0.1",
"web3-provider-engine": "14.0.6"
},
"dependencies": {
- "@0xproject/assert": "^1.0.13",
- "@0xproject/base-contract": "^3.0.1",
- "@0xproject/fill-scenarios": "^1.0.7",
- "@0xproject/json-schemas": "^1.0.7",
- "@0xproject/order-utils": "^1.0.7",
- "@0xproject/types": "^1.1.4",
- "@0xproject/typescript-typings": "^3.0.2",
- "@0xproject/utils": "^2.0.2",
- "@0xproject/web3-wrapper": "^3.0.3",
- "ethereum-types": "^1.0.11",
+ "@0x/abi-gen-wrappers": "^1.0.2",
+ "@0x/assert": "^1.0.15",
+ "@0x/contract-addresses": "^1.1.0",
+ "@0x/contract-artifacts": "^1.1.0",
+ "@0x/fill-scenarios": "^1.0.9",
+ "@0x/json-schemas": "^2.0.1",
+ "@0x/order-utils": "^2.0.1",
+ "@0x/types": "^1.2.1",
+ "@0x/typescript-typings": "^3.0.4",
+ "@0x/utils": "^2.0.4",
+ "@0x/web3-wrapper": "^3.1.1",
+ "ethereum-types": "^1.1.2",
"ethereumjs-blockstream": "6.0.0",
"ethereumjs-util": "^5.1.1",
"ethers": "~4.0.4",
diff --git a/packages/contract-wrappers/src/abstract/abstract_balance_and_proxy_allowance_lazy_store.ts b/packages/contract-wrappers/src/abstract/abstract_balance_and_proxy_allowance_lazy_store.ts
index 1f139f1ef..b095c8e79 100644
--- a/packages/contract-wrappers/src/abstract/abstract_balance_and_proxy_allowance_lazy_store.ts
+++ b/packages/contract-wrappers/src/abstract/abstract_balance_and_proxy_allowance_lazy_store.ts
@@ -1,4 +1,4 @@
-import { BigNumber } from '@0xproject/utils';
+import { BigNumber } from '@0x/utils';
export abstract class AbstractBalanceAndProxyAllowanceLazyStore {
public abstract async getBalanceAsync(tokenAddress: string, userAddress: string): Promise<BigNumber>;
diff --git a/packages/contract-wrappers/src/artifacts.ts b/packages/contract-wrappers/src/artifacts.ts
deleted file mode 100644
index 925f34162..000000000
--- a/packages/contract-wrappers/src/artifacts.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-import { ContractArtifact } from 'ethereum-types';
-
-import * as DummyERC20Token from './artifacts/DummyERC20Token.json';
-import * as DummyERC721Token from './artifacts/DummyERC721Token.json';
-import * as ERC20Proxy from './artifacts/ERC20Proxy.json';
-import * as ERC20Token from './artifacts/ERC20Token.json';
-import * as ERC721Proxy from './artifacts/ERC721Proxy.json';
-import * as ERC721Token from './artifacts/ERC721Token.json';
-import * as Exchange from './artifacts/Exchange.json';
-import * as Forwarder from './artifacts/Forwarder.json';
-import * as OrderValidator from './artifacts/OrderValidator.json';
-import * as EtherToken from './artifacts/WETH9.json';
-import * as ZRXToken from './artifacts/ZRXToken.json';
-
-export const artifacts = {
- ZRXToken: (ZRXToken as any) as ContractArtifact,
- DummyERC20Token: (DummyERC20Token as any) as ContractArtifact,
- DummyERC721Token: (DummyERC721Token as any) as ContractArtifact,
- ERC20Token: (ERC20Token as any) as ContractArtifact,
- ERC721Token: (ERC721Token as any) as ContractArtifact,
- Exchange: (Exchange as any) as ContractArtifact,
- EtherToken: (EtherToken as any) as ContractArtifact,
- ERC20Proxy: (ERC20Proxy as any) as ContractArtifact,
- ERC721Proxy: (ERC721Proxy as any) as ContractArtifact,
- Forwarder: (Forwarder as any) as ContractArtifact,
- OrderValidator: (OrderValidator as any) as ContractArtifact,
-};
diff --git a/packages/contract-wrappers/src/contract_wrappers.ts b/packages/contract-wrappers/src/contract_wrappers.ts
index 89402029b..0c535bd5c 100644
--- a/packages/contract-wrappers/src/contract_wrappers.ts
+++ b/packages/contract-wrappers/src/contract_wrappers.ts
@@ -1,10 +1,17 @@
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import {
+ ERC20Proxy,
+ ERC20Token,
+ ERC721Proxy,
+ ERC721Token,
+ Exchange,
+ Forwarder,
+ OrderValidator,
+ WETH9,
+} from '@0x/contract-artifacts';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import { Provider } from 'ethereum-types';
import * as _ from 'lodash';
-import { constants } from './utils/constants';
-
-import { artifacts } from './artifacts';
import { ERC20ProxyWrapper } from './contract_wrappers/erc20_proxy_wrapper';
import { ERC20TokenWrapper } from './contract_wrappers/erc20_token_wrapper';
import { ERC721ProxyWrapper } from './contract_wrappers/erc721_proxy_wrapper';
@@ -14,10 +21,11 @@ import { ExchangeWrapper } from './contract_wrappers/exchange_wrapper';
import { ForwarderWrapper } from './contract_wrappers/forwarder_wrapper';
import { OrderValidatorWrapper } from './contract_wrappers/order_validator_wrapper';
import { ContractWrappersConfigSchema } from './schemas/contract_wrappers_config_schema';
-import { contractWrappersPrivateNetworkConfigSchema } from './schemas/contract_wrappers_private_network_config_schema';
-import { contractWrappersPublicNetworkConfigSchema } from './schemas/contract_wrappers_public_network_config_schema';
import { ContractWrappersConfig } from './types';
import { assert } from './utils/assert';
+import { constants } from './utils/constants';
+import { _getDefaultContractAddresses } from './utils/contract_addresses';
+
/**
* The ContractWrappers class contains smart contract wrappers helpful when building on 0x protocol.
*/
@@ -61,35 +69,39 @@ export class ContractWrappers {
private readonly _web3Wrapper: Web3Wrapper;
/**
* Instantiates a new ContractWrappers instance.
- * @param provider The Provider instance you would like the 0x.js library to use for interacting with
+ * @param provider The Provider instance you would like the contract-wrappers library to use for interacting with
* the Ethereum network.
* @param config The configuration object. Look up the type for the description.
* @return An instance of the ContractWrappers class.
*/
constructor(provider: Provider, config: ContractWrappersConfig) {
assert.isWeb3Provider('provider', provider);
- assert.doesConformToSchema('config', config, ContractWrappersConfigSchema, [
- contractWrappersPrivateNetworkConfigSchema,
- contractWrappersPublicNetworkConfigSchema,
- ]);
- const artifactJSONs = _.values(artifacts);
- const abiArrays = _.map(artifactJSONs, artifact => artifact.compilerOutput.abi);
+ assert.doesConformToSchema('config', config, ContractWrappersConfigSchema);
const txDefaults = {
gasPrice: config.gasPrice,
};
this._web3Wrapper = new Web3Wrapper(provider, txDefaults);
- _.forEach(abiArrays, abi => {
- this._web3Wrapper.abiDecoder.addABI(abi);
+ const artifactsArray = [
+ ERC20Proxy,
+ ERC20Token,
+ ERC721Proxy,
+ ERC721Token,
+ Exchange,
+ Forwarder,
+ OrderValidator,
+ WETH9,
+ ];
+ _.forEach(artifactsArray, artifact => {
+ this._web3Wrapper.abiDecoder.addABI(artifact.compilerOutput.abi);
});
const blockPollingIntervalMs = _.isUndefined(config.blockPollingIntervalMs)
? constants.DEFAULT_BLOCK_POLLING_INTERVAL
: config.blockPollingIntervalMs;
- this.erc20Proxy = new ERC20ProxyWrapper(this._web3Wrapper, config.networkId, config.erc20ProxyContractAddress);
- this.erc721Proxy = new ERC721ProxyWrapper(
- this._web3Wrapper,
- config.networkId,
- config.erc721ProxyContractAddress,
- );
+ const contractAddresses = _.isUndefined(config.contractAddresses)
+ ? _getDefaultContractAddresses(config.networkId)
+ : config.contractAddresses;
+ this.erc20Proxy = new ERC20ProxyWrapper(this._web3Wrapper, config.networkId, contractAddresses.erc20Proxy);
+ this.erc721Proxy = new ERC721ProxyWrapper(this._web3Wrapper, config.networkId, contractAddresses.erc721Proxy);
this.erc20Token = new ERC20TokenWrapper(
this._web3Wrapper,
config.networkId,
@@ -113,37 +125,34 @@ export class ContractWrappers {
config.networkId,
this.erc20Token,
this.erc721Token,
- config.exchangeContractAddress,
- config.zrxContractAddress,
+ contractAddresses.exchange,
+ contractAddresses.zrxToken,
blockPollingIntervalMs,
);
this.forwarder = new ForwarderWrapper(
this._web3Wrapper,
config.networkId,
- config.forwarderContractAddress,
- config.zrxContractAddress,
+ contractAddresses.forwarder,
+ contractAddresses.zrxToken,
+ contractAddresses.etherToken,
+ );
+ this.orderValidator = new OrderValidatorWrapper(
+ this._web3Wrapper,
+ config.networkId,
+ contractAddresses.orderValidator,
);
- this.orderValidator = new OrderValidatorWrapper(this._web3Wrapper, config.networkId);
}
/**
- * Sets a new web3 provider for 0x.js. Updating the provider will stop all
- * subscriptions so you will need to re-subscribe to all events relevant to your app after this call.
- * @param provider The Web3Provider you would like the 0x.js library to use from now on.
- * @param networkId The id of the network your provider is connected to
+ * Unsubscribes from all subscriptions for all contracts.
*/
- public setProvider(provider: Provider, networkId: number): void {
- this._web3Wrapper.setProvider(provider);
- (this.exchange as any)._invalidateContractInstances();
- (this.exchange as any)._setNetworkId(networkId);
- (this.erc20Token as any)._invalidateContractInstances();
- (this.erc20Token as any)._setNetworkId(networkId);
- (this.erc20Proxy as any)._invalidateContractInstance();
- (this.erc20Proxy as any)._setNetworkId(networkId);
- (this.etherToken as any)._invalidateContractInstance();
- (this.etherToken as any)._setNetworkId(networkId);
+ public unsubscribeAll(): void {
+ this.exchange.unsubscribeAll();
+ this.erc20Token.unsubscribeAll();
+ this.erc721Token.unsubscribeAll();
+ this.etherToken.unsubscribeAll();
}
/**
- * Get the provider instance currently used by 0x.js
+ * Get the provider instance currently used by contract-wrappers
* @return Web3 provider instance
*/
public getProvider(): Provider {
diff --git a/packages/contract-wrappers/src/contract_wrappers/contract_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/contract_wrapper.ts
index f7a89e3be..749aaae10 100644
--- a/packages/contract-wrappers/src/contract_wrappers/contract_wrapper.ts
+++ b/packages/contract-wrappers/src/contract_wrappers/contract_wrapper.ts
@@ -1,9 +1,8 @@
-import { AbiDecoder, intervalUtils, logUtils } from '@0xproject/utils';
-import { marshaller, Web3Wrapper } from '@0xproject/web3-wrapper';
+import { AbiDecoder, intervalUtils, logUtils } from '@0x/utils';
+import { marshaller, Web3Wrapper } from '@0x/web3-wrapper';
import {
BlockParamLiteral,
ContractAbi,
- ContractArtifact,
FilterObject,
LogEntry,
LogWithDecodedArgs,
@@ -24,27 +23,15 @@ import {
import { constants } from '../utils/constants';
import { filterUtils } from '../utils/filter_utils';
-const CONTRACT_NAME_TO_NOT_FOUND_ERROR: {
- [contractName: string]: ContractWrappersError;
-} = {
- ZRX: ContractWrappersError.ZRXContractDoesNotExist,
- EtherToken: ContractWrappersError.EtherTokenContractDoesNotExist,
- ERC20Token: ContractWrappersError.ERC20TokenContractDoesNotExist,
- ERC20Proxy: ContractWrappersError.ERC20ProxyContractDoesNotExist,
- ERC721Token: ContractWrappersError.ERC721TokenContractDoesNotExist,
- ERC721Proxy: ContractWrappersError.ERC721ProxyContractDoesNotExist,
- Exchange: ContractWrappersError.ExchangeContractDoesNotExist,
-};
-
export abstract class ContractWrapper {
public abstract abi: ContractAbi;
- protected _web3Wrapper: Web3Wrapper;
protected _networkId: number;
+ protected _web3Wrapper: Web3Wrapper;
private _blockAndLogStreamerIfExists: BlockAndLogStreamer<Block, Log> | undefined;
- private _blockPollingIntervalMs: number;
+ private readonly _blockPollingIntervalMs: number;
private _blockAndLogStreamIntervalIfExists?: NodeJS.Timer;
- private _filters: { [filterToken: string]: FilterObject };
- private _filterCallbacks: {
+ private readonly _filters: { [filterToken: string]: FilterObject };
+ private readonly _filterCallbacks: {
[filterToken: string]: EventCallback<ContractEventArgs>;
};
private _onLogAddedSubscriptionToken: string | undefined;
@@ -124,40 +111,6 @@ export abstract class ContractWrapper {
const logWithDecodedArgs = abiDecoder.tryToDecodeLogOrNoop(log);
return logWithDecodedArgs;
}
- protected async _getContractAbiAndAddressFromArtifactsAsync(
- artifact: ContractArtifact,
- addressIfExists?: string,
- ): Promise<[ContractAbi, string]> {
- let contractAddress: string;
- if (_.isUndefined(addressIfExists)) {
- if (_.isUndefined(artifact.networks[this._networkId])) {
- throw new Error(ContractWrappersError.ContractNotDeployedOnNetwork);
- }
- contractAddress = artifact.networks[this._networkId].address.toLowerCase();
- } else {
- contractAddress = addressIfExists;
- }
- const doesContractExist = await this._web3Wrapper.doesContractExistAtAddressAsync(contractAddress);
- if (!doesContractExist) {
- throw new Error(CONTRACT_NAME_TO_NOT_FOUND_ERROR[artifact.contractName]);
- }
- const abiAndAddress: [ContractAbi, string] = [artifact.compilerOutput.abi, contractAddress];
- return abiAndAddress;
- }
- protected _getContractAddress(artifact: ContractArtifact, addressIfExists?: string): string {
- if (_.isUndefined(addressIfExists)) {
- if (_.isUndefined(artifact.networks[this._networkId])) {
- throw new Error(ContractWrappersError.ContractNotDeployedOnNetwork);
- }
- const contractAddress = artifact.networks[this._networkId].address;
- if (_.isUndefined(contractAddress)) {
- throw new Error(CONTRACT_NAME_TO_NOT_FOUND_ERROR[artifact.contractName]);
- }
- return contractAddress;
- } else {
- return addressIfExists;
- }
- }
private _onLogStateChanged<ArgsType extends ContractEventArgs>(isRemoved: boolean, rawLog: RawLogEntry): void {
const log: LogEntry = marshaller.unmarshalLog(rawLog);
_.forEach(this._filters, (filter: FilterObject, filterToken: string) => {
@@ -222,14 +175,6 @@ export abstract class ContractWrapper {
});
return logs as RawLogEntry[];
}
- // HACK: This should be a package-scoped method (which doesn't exist in TS)
- // We don't want this method available in the public interface for all classes
- // who inherit from ContractWrapper, and it is only used by the internal implementation
- // of those higher classes.
- // tslint:disable-next-line:no-unused-variable
- private _setNetworkId(networkId: number): void {
- this._networkId = networkId;
- }
private _stopBlockAndLogStream(): void {
if (_.isUndefined(this._blockAndLogStreamerIfExists)) {
throw new Error(ContractWrappersError.SubscriptionNotFound);
diff --git a/packages/contract-wrappers/src/contract_wrappers/erc20_proxy_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/erc20_proxy_wrapper.ts
index ff027d78a..45460bd6d 100644
--- a/packages/contract-wrappers/src/contract_wrappers/erc20_proxy_wrapper.ts
+++ b/packages/contract-wrappers/src/contract_wrappers/erc20_proxy_wrapper.ts
@@ -1,38 +1,42 @@
-import { AssetProxyId } from '@0xproject/types';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { ERC20ProxyContract } from '@0x/abi-gen-wrappers';
+import { ERC20Proxy } from '@0x/contract-artifacts';
+import { AssetProxyId } from '@0x/types';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import { ContractAbi } from 'ethereum-types';
import * as _ from 'lodash';
-import { artifacts } from '../artifacts';
import { assert } from '../utils/assert';
+import { _getDefaultContractAddresses } from '../utils/contract_addresses';
import { ContractWrapper } from './contract_wrapper';
-import { ERC20ProxyContract } from './generated/erc20_proxy';
/**
* This class includes the functionality related to interacting with the ERC20Proxy contract.
*/
export class ERC20ProxyWrapper extends ContractWrapper {
- public abi: ContractAbi = artifacts.ERC20Proxy.compilerOutput.abi;
+ public abi: ContractAbi = ERC20Proxy.compilerOutput.abi;
+ public address: string;
private _erc20ProxyContractIfExists?: ERC20ProxyContract;
- private _contractAddressIfExists?: string;
/**
* Instantiate ERC20ProxyWrapper
* @param web3Wrapper Web3Wrapper instance to use
* @param networkId Desired networkId
- * @param contractAddressIfExists The contract address to use. This is usually pulled from
- * the artifacts but needs to be specified when using with your own custom testnet.
+ * @param address The address of the ERC20Proxy contract. If undefined, will
+ * default to the known address corresponding to the networkId.
*/
- constructor(web3Wrapper: Web3Wrapper, networkId: number, contractAddressIfExists?: string) {
+ constructor(web3Wrapper: Web3Wrapper, networkId: number, address?: string) {
super(web3Wrapper, networkId);
- this._contractAddressIfExists = contractAddressIfExists;
+ this.address = _.isUndefined(address) ? _getDefaultContractAddresses(networkId).erc20Proxy : address;
}
/**
* Get the 4 bytes ID of this asset proxy
* @return Proxy id
*/
public async getProxyIdAsync(): Promise<AssetProxyId> {
- const ERC20ProxyContractInstance = await this._getERC20ProxyContractAsync();
+ const ERC20ProxyContractInstance = this._getERC20ProxyContract();
+ // Note(albrow): Below is a TSLint false positive. Code won't compile if
+ // you remove the type assertion.
+ /* tslint:disable-next-line:no-unnecessary-type-assertion */
const proxyId = (await ERC20ProxyContractInstance.getProxyId.callAsync()) as AssetProxyId;
return proxyId;
}
@@ -44,7 +48,7 @@ export class ERC20ProxyWrapper extends ContractWrapper {
public async isAuthorizedAsync(exchangeContractAddress: string): Promise<boolean> {
assert.isETHAddressHex('exchangeContractAddress', exchangeContractAddress);
const normalizedExchangeContractAddress = exchangeContractAddress.toLowerCase();
- const ERC20ProxyContractInstance = await this._getERC20ProxyContractAsync();
+ const ERC20ProxyContractInstance = this._getERC20ProxyContract();
const isAuthorized = await ERC20ProxyContractInstance.authorized.callAsync(normalizedExchangeContractAddress);
return isAuthorized;
}
@@ -53,36 +57,17 @@ export class ERC20ProxyWrapper extends ContractWrapper {
* @return The list of authorized addresses.
*/
public async getAuthorizedAddressesAsync(): Promise<string[]> {
- const ERC20ProxyContractInstance = await this._getERC20ProxyContractAsync();
+ const ERC20ProxyContractInstance = this._getERC20ProxyContract();
const authorizedAddresses = await ERC20ProxyContractInstance.getAuthorizedAddresses.callAsync();
return authorizedAddresses;
}
- /**
- * Retrieves the Ethereum address of the ERC20Proxy contract deployed on the network
- * that the user-passed web3 provider is connected to.
- * @returns The Ethereum address of the ERC20Proxy contract being used.
- */
- public getContractAddress(): string {
- const contractAddress = this._getContractAddress(artifacts.ERC20Proxy, this._contractAddressIfExists);
- return contractAddress;
- }
- // HACK: We don't want this method to be visible to the other units within that package but not to the end user.
- // TS doesn't give that possibility and therefore we make it private and access it over an any cast. Because of that tslint sees it as unused.
- // tslint:disable-next-line:no-unused-variable
- private _invalidateContractInstance(): void {
- delete this._erc20ProxyContractIfExists;
- }
- private async _getERC20ProxyContractAsync(): Promise<ERC20ProxyContract> {
+ private _getERC20ProxyContract(): ERC20ProxyContract {
if (!_.isUndefined(this._erc20ProxyContractIfExists)) {
return this._erc20ProxyContractIfExists;
}
- const [abi, address] = await this._getContractAbiAndAddressFromArtifactsAsync(
- artifacts.ERC20Proxy,
- this._contractAddressIfExists,
- );
const contractInstance = new ERC20ProxyContract(
- abi,
- address,
+ this.abi,
+ this.address,
this._web3Wrapper.getProvider(),
this._web3Wrapper.getContractDefaults(),
);
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 4625cef6a..5e0ec1951 100644
--- a/packages/contract-wrappers/src/contract_wrappers/erc20_token_wrapper.ts
+++ b/packages/contract-wrappers/src/contract_wrappers/erc20_token_wrapper.ts
@@ -1,10 +1,11 @@
-import { schemas } from '@0xproject/json-schemas';
-import { BigNumber } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { ERC20TokenContract, ERC20TokenEventArgs, ERC20TokenEvents } from '@0x/abi-gen-wrappers';
+import { ERC20Token } from '@0x/contract-artifacts';
+import { schemas } from '@0x/json-schemas';
+import { BigNumber } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import { ContractAbi, LogWithDecodedArgs } from 'ethereum-types';
import * as _ from 'lodash';
-import { artifacts } from '../artifacts';
import { methodOptsSchema } from '../schemas/method_opts_schema';
import { txOptsSchema } from '../schemas/tx_opts_schema';
import {
@@ -17,12 +18,10 @@ import {
} from '../types';
import { assert } from '../utils/assert';
import { constants } from '../utils/constants';
+import { utils } from '../utils/utils';
import { ContractWrapper } from './contract_wrapper';
import { ERC20ProxyWrapper } from './erc20_proxy_wrapper';
-import { ERC20TokenContract, ERC20TokenEventArgs, ERC20TokenEvents } from './generated/erc20_token';
-
-const removeUndefinedProperties = _.pickBy;
/**
* This class includes all the functionality related to interacting with ERC20 token contracts.
@@ -30,10 +29,10 @@ const removeUndefinedProperties = _.pickBy;
* to the 0x ERC20 Proxy smart contract.
*/
export class ERC20TokenWrapper extends ContractWrapper {
- public abi: ContractAbi = artifacts.ERC20Token.compilerOutput.abi;
+ public abi: ContractAbi = ERC20Token.compilerOutput.abi;
public UNLIMITED_ALLOWANCE_IN_BASE_UNITS = constants.UNLIMITED_ALLOWANCE_IN_BASE_UNITS;
- private _tokenContractsByAddress: { [address: string]: ERC20TokenContract };
- private _erc20ProxyWrapper: ERC20ProxyWrapper;
+ private readonly _tokenContractsByAddress: { [address: string]: ERC20TokenContract };
+ private readonly _erc20ProxyWrapper: ERC20ProxyWrapper;
/**
* Instantiate ERC20TokenWrapper
* @param web3Wrapper Web3Wrapper instance to use
@@ -108,7 +107,7 @@ export class ERC20TokenWrapper extends ContractWrapper {
const txHash = await tokenContract.approve.sendTransactionAsync(
normalizedSpenderAddress,
amountInBaseUnits,
- removeUndefinedProperties({
+ utils.removeUndefinedProperties({
from: normalizedOwnerAddress,
gas: txOpts.gasLimit,
gasPrice: txOpts.gasPrice,
@@ -189,7 +188,7 @@ export class ERC20TokenWrapper extends ContractWrapper {
ownerAddress: string,
methodOpts: MethodOpts = {},
): Promise<BigNumber> {
- const proxyAddress = this._erc20ProxyWrapper.getContractAddress();
+ const proxyAddress = this._erc20ProxyWrapper.address;
const allowanceInBaseUnits = await this.getAllowanceAsync(tokenAddress, ownerAddress, proxyAddress, methodOpts);
return allowanceInBaseUnits;
}
@@ -209,7 +208,7 @@ export class ERC20TokenWrapper extends ContractWrapper {
amountInBaseUnits: BigNumber,
txOpts: TransactionOpts = {},
): Promise<string> {
- const proxyAddress = this._erc20ProxyWrapper.getContractAddress();
+ const proxyAddress = this._erc20ProxyWrapper.address;
const txHash = await this.setAllowanceAsync(
tokenAddress,
ownerAddress,
@@ -278,7 +277,7 @@ export class ERC20TokenWrapper extends ContractWrapper {
const txHash = await tokenContract.transfer.sendTransactionAsync(
normalizedToAddress,
amountInBaseUnits,
- removeUndefinedProperties({
+ utils.removeUndefinedProperties({
from: normalizedFromAddress,
gas: txOpts.gasLimit,
gasPrice: txOpts.gasPrice,
@@ -339,7 +338,7 @@ export class ERC20TokenWrapper extends ContractWrapper {
normalizedFromAddress,
normalizedToAddress,
amountInBaseUnits,
- removeUndefinedProperties({
+ utils.removeUndefinedProperties({
from: normalizedSenderAddress,
gas: txOpts.gasLimit,
gasPrice: txOpts.gasPrice,
@@ -373,7 +372,7 @@ export class ERC20TokenWrapper extends ContractWrapper {
normalizedTokenAddress,
eventName,
indexFilterValues,
- artifacts.ERC20Token.compilerOutput.abi,
+ ERC20Token.compilerOutput.abi,
callback,
isVerbose,
);
@@ -418,30 +417,19 @@ export class ERC20TokenWrapper extends ContractWrapper {
eventName,
blockRange,
indexFilterValues,
- artifacts.ERC20Token.compilerOutput.abi,
+ ERC20Token.compilerOutput.abi,
);
return logs;
}
- // HACK: We don't want this method to be visible to the other units within that package but not to the end user.
- // TS doesn't give that possibility and therefore we make it private and access it over an any cast. Because of that tslint sees it as unused.
- // tslint:disable-next-line:no-unused-variable
- private _invalidateContractInstances(): void {
- this.unsubscribeAll();
- this._tokenContractsByAddress = {};
- }
private async _getTokenContractAsync(tokenAddress: string): Promise<ERC20TokenContract> {
const normalizedTokenAddress = tokenAddress.toLowerCase();
let tokenContract = this._tokenContractsByAddress[normalizedTokenAddress];
if (!_.isUndefined(tokenContract)) {
return tokenContract;
}
- const [abi, address] = await this._getContractAbiAndAddressFromArtifactsAsync(
- artifacts.ERC20Token,
- normalizedTokenAddress,
- );
const contractInstance = new ERC20TokenContract(
- abi,
- address,
+ this.abi,
+ normalizedTokenAddress,
this._web3Wrapper.getProvider(),
this._web3Wrapper.getContractDefaults(),
);
diff --git a/packages/contract-wrappers/src/contract_wrappers/erc721_proxy_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/erc721_proxy_wrapper.ts
index 933c1dc27..12758e191 100644
--- a/packages/contract-wrappers/src/contract_wrappers/erc721_proxy_wrapper.ts
+++ b/packages/contract-wrappers/src/contract_wrappers/erc721_proxy_wrapper.ts
@@ -1,38 +1,42 @@
-import { AssetProxyId } from '@0xproject/types';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { ERC721ProxyContract } from '@0x/abi-gen-wrappers';
+import { ERC721Proxy } from '@0x/contract-artifacts';
+import { AssetProxyId } from '@0x/types';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import { ContractAbi } from 'ethereum-types';
import * as _ from 'lodash';
-import { artifacts } from '../artifacts';
import { assert } from '../utils/assert';
+import { _getDefaultContractAddresses } from '../utils/contract_addresses';
import { ContractWrapper } from './contract_wrapper';
-import { ERC721ProxyContract } from './generated/erc721_proxy';
/**
* This class includes the functionality related to interacting with the ERC721Proxy contract.
*/
export class ERC721ProxyWrapper extends ContractWrapper {
- public abi: ContractAbi = artifacts.ERC20Proxy.compilerOutput.abi;
+ public abi: ContractAbi = ERC721Proxy.compilerOutput.abi;
+ public address: string;
private _erc721ProxyContractIfExists?: ERC721ProxyContract;
- private _contractAddressIfExists?: string;
/**
* Instantiate ERC721ProxyWrapper
* @param web3Wrapper Web3Wrapper instance to use
* @param networkId Desired networkId
- * @param contractAddressIfExists The contract address to use. This is usually pulled from
- * the artifacts but needs to be specified when using with your own custom testnet.
+ * @param address The address of the ERC721Proxy contract. If undefined,
+ * will default to the known address corresponding to the networkId.
*/
- constructor(web3Wrapper: Web3Wrapper, networkId: number, contractAddressIfExists?: string) {
+ constructor(web3Wrapper: Web3Wrapper, networkId: number, address?: string) {
super(web3Wrapper, networkId);
- this._contractAddressIfExists = contractAddressIfExists;
+ this.address = _.isUndefined(address) ? _getDefaultContractAddresses(networkId).erc721Proxy : address;
}
/**
* Get the 4 bytes ID of this asset proxy
* @return Proxy id
*/
public async getProxyIdAsync(): Promise<AssetProxyId> {
- const ERC721ProxyContractInstance = await this._getERC721ProxyContractAsync();
+ const ERC721ProxyContractInstance = await this._getERC721ProxyContract();
+ // Note(albrow): Below is a TSLint false positive. Code won't compile if
+ // you remove the type assertion.
+ /* tslint:disable-next-line:no-unnecessary-type-assertion */
const proxyId = (await ERC721ProxyContractInstance.getProxyId.callAsync()) as AssetProxyId;
return proxyId;
}
@@ -44,7 +48,7 @@ export class ERC721ProxyWrapper extends ContractWrapper {
public async isAuthorizedAsync(exchangeContractAddress: string): Promise<boolean> {
assert.isETHAddressHex('exchangeContractAddress', exchangeContractAddress);
const normalizedExchangeContractAddress = exchangeContractAddress.toLowerCase();
- const ERC721ProxyContractInstance = await this._getERC721ProxyContractAsync();
+ const ERC721ProxyContractInstance = await this._getERC721ProxyContract();
const isAuthorized = await ERC721ProxyContractInstance.authorized.callAsync(normalizedExchangeContractAddress);
return isAuthorized;
}
@@ -53,36 +57,17 @@ export class ERC721ProxyWrapper extends ContractWrapper {
* @return The list of authorized addresses.
*/
public async getAuthorizedAddressesAsync(): Promise<string[]> {
- const ERC721ProxyContractInstance = await this._getERC721ProxyContractAsync();
+ const ERC721ProxyContractInstance = await this._getERC721ProxyContract();
const authorizedAddresses = await ERC721ProxyContractInstance.getAuthorizedAddresses.callAsync();
return authorizedAddresses;
}
- /**
- * Retrieves the Ethereum address of the ERC721Proxy contract deployed on the network
- * that the user-passed web3 provider is connected to.
- * @returns The Ethereum address of the ERC721Proxy contract being used.
- */
- public getContractAddress(): string {
- const contractAddress = this._getContractAddress(artifacts.ERC721Proxy, this._contractAddressIfExists);
- return contractAddress;
- }
- // HACK: We don't want this method to be visible to the other units within that package but not to the end user.
- // TS doesn't give that possibility and therefore we make it private and access it over an any cast. Because of that tslint sees it as unused.
- // tslint:disable-next-line:no-unused-variable
- private _invalidateContractInstance(): void {
- delete this._erc721ProxyContractIfExists;
- }
- private async _getERC721ProxyContractAsync(): Promise<ERC721ProxyContract> {
+ private _getERC721ProxyContract(): ERC721ProxyContract {
if (!_.isUndefined(this._erc721ProxyContractIfExists)) {
return this._erc721ProxyContractIfExists;
}
- const [abi, address] = await this._getContractAbiAndAddressFromArtifactsAsync(
- artifacts.ERC721Proxy,
- this._contractAddressIfExists,
- );
const contractInstance = new ERC721ProxyContract(
- abi,
- address,
+ this.abi,
+ this.address,
this._web3Wrapper.getProvider(),
this._web3Wrapper.getContractDefaults(),
);
diff --git a/packages/contract-wrappers/src/contract_wrappers/erc721_token_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/erc721_token_wrapper.ts
index 590dbbf74..1610af47b 100644
--- a/packages/contract-wrappers/src/contract_wrappers/erc721_token_wrapper.ts
+++ b/packages/contract-wrappers/src/contract_wrappers/erc721_token_wrapper.ts
@@ -1,10 +1,11 @@
-import { schemas } from '@0xproject/json-schemas';
-import { BigNumber } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { ERC721TokenContract, ERC721TokenEventArgs, ERC721TokenEvents } from '@0x/abi-gen-wrappers';
+import { ERC721Token } from '@0x/contract-artifacts';
+import { schemas } from '@0x/json-schemas';
+import { BigNumber } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import { ContractAbi, LogWithDecodedArgs } from 'ethereum-types';
import * as _ from 'lodash';
-import { artifacts } from '../artifacts';
import { methodOptsSchema } from '../schemas/method_opts_schema';
import { txOptsSchema } from '../schemas/tx_opts_schema';
import {
@@ -17,12 +18,10 @@ import {
} from '../types';
import { assert } from '../utils/assert';
import { constants } from '../utils/constants';
+import { utils } from '../utils/utils';
import { ContractWrapper } from './contract_wrapper';
import { ERC721ProxyWrapper } from './erc721_proxy_wrapper';
-import { ERC721TokenContract, ERC721TokenEventArgs, ERC721TokenEvents } from './generated/erc721_token';
-
-const removeUndefinedProperties = _.pickBy;
/**
* This class includes all the functionality related to interacting with ERC721 token contracts.
@@ -30,9 +29,9 @@ const removeUndefinedProperties = _.pickBy;
* to the 0x ERC721 Proxy smart contract.
*/
export class ERC721TokenWrapper extends ContractWrapper {
- public abi: ContractAbi = artifacts.ERC721Token.compilerOutput.abi;
- private _tokenContractsByAddress: { [address: string]: ERC721TokenContract };
- private _erc721ProxyWrapper: ERC721ProxyWrapper;
+ public abi: ContractAbi = ERC721Token.compilerOutput.abi;
+ private readonly _tokenContractsByAddress: { [address: string]: ERC721TokenContract };
+ private readonly _erc721ProxyWrapper: ERC721ProxyWrapper;
/**
* Instantiate ERC721TokenWrapper
* @param web3Wrapper Web3Wrapper instance to use
@@ -150,7 +149,7 @@ export class ERC721TokenWrapper extends ContractWrapper {
ownerAddress: string,
methodOpts: MethodOpts = {},
): Promise<boolean> {
- const proxyAddress = this._erc721ProxyWrapper.getContractAddress();
+ const proxyAddress = this._erc721ProxyWrapper.address;
const isProxyApprovedForAll = await this.isApprovedForAllAsync(
tokenAddress,
ownerAddress,
@@ -199,7 +198,7 @@ export class ERC721TokenWrapper extends ContractWrapper {
tokenId: BigNumber,
methodOpts: MethodOpts = {},
): Promise<boolean> {
- const proxyAddress = this._erc721ProxyWrapper.getContractAddress();
+ const proxyAddress = this._erc721ProxyWrapper.address;
const approvedAddress = await this.getApprovedIfExistsAsync(tokenAddress, tokenId, methodOpts);
const isProxyApproved = approvedAddress === proxyAddress;
return isProxyApproved;
@@ -235,7 +234,7 @@ export class ERC721TokenWrapper extends ContractWrapper {
const txHash = await tokenContract.setApprovalForAll.sendTransactionAsync(
normalizedOperatorAddress,
isApproved,
- removeUndefinedProperties({
+ utils.removeUndefinedProperties({
gas: txOpts.gasLimit,
gasPrice: txOpts.gasPrice,
from: normalizedOwnerAddress,
@@ -260,7 +259,7 @@ export class ERC721TokenWrapper extends ContractWrapper {
isApproved: boolean,
txOpts: TransactionOpts = {},
): Promise<string> {
- const proxyAddress = this._erc721ProxyWrapper.getContractAddress();
+ const proxyAddress = this._erc721ProxyWrapper.address;
const txHash = await this.setApprovalForAllAsync(tokenAddress, ownerAddress, proxyAddress, isApproved, txOpts);
return txHash;
}
@@ -295,7 +294,7 @@ export class ERC721TokenWrapper extends ContractWrapper {
const txHash = await tokenContract.approve.sendTransactionAsync(
normalizedApprovedAddress,
tokenId,
- removeUndefinedProperties({
+ utils.removeUndefinedProperties({
gas: txOpts.gasLimit,
gasPrice: txOpts.gasPrice,
from: tokenOwnerAddress,
@@ -318,7 +317,7 @@ export class ERC721TokenWrapper extends ContractWrapper {
tokenId: BigNumber,
txOpts: TransactionOpts = {},
): Promise<string> {
- const proxyAddress = this._erc721ProxyWrapper.getContractAddress();
+ const proxyAddress = this._erc721ProxyWrapper.address;
const txHash = await this.setApprovalAsync(tokenAddress, proxyAddress, tokenId, txOpts);
return txHash;
}
@@ -366,7 +365,7 @@ export class ERC721TokenWrapper extends ContractWrapper {
ownerAddress,
normalizedReceiverAddress,
tokenId,
- removeUndefinedProperties({
+ utils.removeUndefinedProperties({
gas: txOpts.gasLimit,
gasPrice: txOpts.gasPrice,
from: normalizedSenderAddress,
@@ -400,7 +399,7 @@ export class ERC721TokenWrapper extends ContractWrapper {
normalizedTokenAddress,
eventName,
indexFilterValues,
- artifacts.ERC721Token.compilerOutput.abi,
+ ERC721Token.compilerOutput.abi,
callback,
isVerbose,
);
@@ -445,30 +444,19 @@ export class ERC721TokenWrapper extends ContractWrapper {
eventName,
blockRange,
indexFilterValues,
- artifacts.ERC721Token.compilerOutput.abi,
+ ERC721Token.compilerOutput.abi,
);
return logs;
}
- // HACK: We don't want this method to be visible to the other units within that package but not to the end user.
- // TS doesn't give that possibility and therefore we make it private and access it over an any cast. Because of that tslint sees it as unused.
- // tslint:disable-next-line:no-unused-variable
- private _invalidateContractInstances(): void {
- this.unsubscribeAll();
- this._tokenContractsByAddress = {};
- }
private async _getTokenContractAsync(tokenAddress: string): Promise<ERC721TokenContract> {
const normalizedTokenAddress = tokenAddress.toLowerCase();
let tokenContract = this._tokenContractsByAddress[normalizedTokenAddress];
if (!_.isUndefined(tokenContract)) {
return tokenContract;
}
- const [abi, address] = await this._getContractAbiAndAddressFromArtifactsAsync(
- artifacts.ERC721Token,
- normalizedTokenAddress,
- );
const contractInstance = new ERC721TokenContract(
- abi,
- address,
+ this.abi,
+ normalizedTokenAddress,
this._web3Wrapper.getProvider(),
this._web3Wrapper.getContractDefaults(),
);
diff --git a/packages/contract-wrappers/src/contract_wrappers/ether_token_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/ether_token_wrapper.ts
index 1ac01812e..913c47cf7 100644
--- a/packages/contract-wrappers/src/contract_wrappers/ether_token_wrapper.ts
+++ b/packages/contract-wrappers/src/contract_wrappers/ether_token_wrapper.ts
@@ -1,29 +1,28 @@
-import { schemas } from '@0xproject/json-schemas';
-import { BigNumber } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { WETH9Contract, WETH9EventArgs, WETH9Events } from '@0x/abi-gen-wrappers';
+import { WETH9 } from '@0x/contract-artifacts';
+import { schemas } from '@0x/json-schemas';
+import { BigNumber } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import { ContractAbi, LogWithDecodedArgs } from 'ethereum-types';
import * as _ from 'lodash';
-import { artifacts } from '../artifacts';
import { BlockRange, ContractWrappersError, EventCallback, IndexedFilterValues, TransactionOpts } from '../types';
import { assert } from '../utils/assert';
+import { utils } from '../utils/utils';
import { ContractWrapper } from './contract_wrapper';
import { ERC20TokenWrapper } from './erc20_token_wrapper';
-import { WETH9Contract, WETH9EventArgs, WETH9Events } from './generated/weth9';
-
-const removeUndefinedProperties = _.pickBy;
/**
* This class includes all the functionality related to interacting with a wrapped Ether ERC20 token contract.
* The caller can convert ETH into the equivalent number of wrapped ETH ERC20 tokens and back.
*/
export class EtherTokenWrapper extends ContractWrapper {
- public abi: ContractAbi = artifacts.EtherToken.compilerOutput.abi;
- private _etherTokenContractsByAddress: {
+ public abi: ContractAbi = WETH9.compilerOutput.abi;
+ private readonly _etherTokenContractsByAddress: {
[address: string]: WETH9Contract;
} = {};
- private _erc20TokenWrapper: ERC20TokenWrapper;
+ private readonly _erc20TokenWrapper: ERC20TokenWrapper;
/**
* Instantiate EtherTokenWrapper.
* @param web3Wrapper Web3Wrapper instance to use
@@ -67,7 +66,7 @@ export class EtherTokenWrapper extends ContractWrapper {
const wethContract = await this._getEtherTokenContractAsync(normalizedEtherTokenAddress);
const txHash = await wethContract.deposit.sendTransactionAsync(
- removeUndefinedProperties({
+ utils.removeUndefinedProperties({
from: normalizedDepositorAddress,
value: amountInWei,
gas: txOpts.gasLimit,
@@ -109,7 +108,7 @@ export class EtherTokenWrapper extends ContractWrapper {
const wethContract = await this._getEtherTokenContractAsync(normalizedEtherTokenAddress);
const txHash = await wethContract.withdraw.sendTransactionAsync(
amountInWei,
- removeUndefinedProperties({
+ utils.removeUndefinedProperties({
from: normalizedWithdrawerAddress,
gas: txOpts.gasLimit,
gasPrice: txOpts.gasPrice,
@@ -142,7 +141,7 @@ export class EtherTokenWrapper extends ContractWrapper {
eventName,
blockRange,
indexFilterValues,
- artifacts.EtherToken.compilerOutput.abi,
+ WETH9.compilerOutput.abi,
);
return logs;
}
@@ -172,7 +171,7 @@ export class EtherTokenWrapper extends ContractWrapper {
normalizedEtherTokenAddress,
eventName,
indexFilterValues,
- artifacts.EtherToken.compilerOutput.abi,
+ WETH9.compilerOutput.abi,
callback,
isVerbose,
);
@@ -192,36 +191,14 @@ export class EtherTokenWrapper extends ContractWrapper {
public unsubscribeAll(): void {
super._unsubscribeAll();
}
- /**
- * Retrieves the Ethereum address of the EtherToken contract deployed on the network
- * that the user-passed web3 provider is connected to. If it's not Kovan, Ropsten, Rinkeby, Mainnet or TestRPC
- * (networkId: 50), it will return undefined (e.g a private network).
- * @returns The Ethereum address of the EtherToken contract or undefined.
- */
- public getContractAddressIfExists(): string | undefined {
- const networkSpecificArtifact = artifacts.EtherToken.networks[this._networkId];
- const contractAddressIfExists = _.isUndefined(networkSpecificArtifact)
- ? undefined
- : networkSpecificArtifact.address;
- return contractAddressIfExists;
- }
- // tslint:disable-next-line:no-unused-variable
- private _invalidateContractInstance(): void {
- this.unsubscribeAll();
- this._etherTokenContractsByAddress = {};
- }
private async _getEtherTokenContractAsync(etherTokenAddress: string): Promise<WETH9Contract> {
let etherTokenContract = this._etherTokenContractsByAddress[etherTokenAddress];
if (!_.isUndefined(etherTokenContract)) {
return etherTokenContract;
}
- const [abi, address] = await this._getContractAbiAndAddressFromArtifactsAsync(
- artifacts.EtherToken,
- etherTokenAddress,
- );
const contractInstance = new WETH9Contract(
- abi,
- address,
+ this.abi,
+ etherTokenAddress,
this._web3Wrapper.getProvider(),
this._web3Wrapper.getContractDefaults(),
);
diff --git a/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts
index dc9ffcbf7..c76e51eee 100644
--- a/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts
+++ b/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts
@@ -1,22 +1,24 @@
-import { schemas } from '@0xproject/json-schemas';
+import { ExchangeContract, ExchangeEventArgs, ExchangeEvents } from '@0x/abi-gen-wrappers';
+import { Exchange } from '@0x/contract-artifacts';
+import { schemas } from '@0x/json-schemas';
import {
assetDataUtils,
BalanceAndProxyAllowanceLazyStore,
ExchangeTransferSimulator,
OrderValidationUtils,
-} from '@0xproject/order-utils';
-import { AssetProxyId, Order, SignedOrder } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+} from '@0x/order-utils';
+import { AssetProxyId, Order, SignedOrder } from '@0x/types';
+import { BigNumber } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import { BlockParamLiteral, ContractAbi, LogWithDecodedArgs } from 'ethereum-types';
import * as _ from 'lodash';
-import { artifacts } from '../artifacts';
import { AssetBalanceAndProxyAllowanceFetcher } from '../fetchers/asset_balance_and_proxy_allowance_fetcher';
import { OrderFilledCancelledFetcher } from '../fetchers/order_filled_cancelled_fetcher';
import { methodOptsSchema } from '../schemas/method_opts_schema';
import { orderTxOptsSchema } from '../schemas/order_tx_opts_schema';
import { txOptsSchema } from '../schemas/tx_opts_schema';
+import { validateOrderFillableOptsSchema } from '../schemas/validate_order_fillable_opts_schema';
import {
BlockRange,
EventCallback,
@@ -24,54 +26,58 @@ import {
IndexedFilterValues,
MethodOpts,
OrderInfo,
- OrderStatus,
OrderTransactionOpts,
ValidateOrderFillableOpts,
} from '../types';
import { assert } from '../utils/assert';
+import { _getDefaultContractAddresses } from '../utils/contract_addresses';
import { decorators } from '../utils/decorators';
import { TransactionEncoder } from '../utils/transaction_encoder';
import { ContractWrapper } from './contract_wrapper';
import { ERC20TokenWrapper } from './erc20_token_wrapper';
import { ERC721TokenWrapper } from './erc721_token_wrapper';
-import { ExchangeContract, ExchangeEventArgs, ExchangeEvents } from './generated/exchange';
/**
* This class includes all the functionality related to calling methods, sending transactions and subscribing to
* events of the 0x V2 Exchange smart contract.
*/
export class ExchangeWrapper extends ContractWrapper {
- public abi: ContractAbi = artifacts.Exchange.compilerOutput.abi;
+ public abi: ContractAbi = Exchange.compilerOutput.abi;
+ public address: string;
+ public zrxTokenAddress: string;
private _exchangeContractIfExists?: ExchangeContract;
- private _erc721TokenWrapper: ERC721TokenWrapper;
- private _erc20TokenWrapper: ERC20TokenWrapper;
- private _contractAddressIfExists?: string;
- private _zrxContractAddressIfExists?: string;
+ private readonly _erc721TokenWrapper: ERC721TokenWrapper;
+ private readonly _erc20TokenWrapper: ERC20TokenWrapper;
/**
* Instantiate ExchangeWrapper
- * @param web3Wrapper Web3Wrapper instance to use
- * @param networkId Desired networkId
- * @param contractAddressIfExists The exchange contract address to use. This is usually pulled from
- * the artifacts but needs to be specified when using with your own custom testnet.
- * @param zrxContractAddressIfExists The ZRXToken contract address to use. This is usually pulled from
- * the artifacts but needs to be specified when using with your own custom testnet.
- * @param blockPollingIntervalMs The block polling interval to use for active subscriptions
+ * @param web3Wrapper Web3Wrapper instance to use.
+ * @param networkId Desired networkId.
+ * @param erc20TokenWrapper ERC20TokenWrapper instance to use.
+ * @param erc721TokenWrapper ERC721TokenWrapper instance to use.
+ * @param address The address of the Exchange contract. If undefined, will
+ * default to the known address corresponding to the networkId.
+ * @param zrxTokenAddress The address of the ZRXToken contract. If
+ * undefined, will default to the known address corresponding to the
+ * networkId.
+ * @param blockPollingIntervalMs The block polling interval to use for active subscriptions.
*/
constructor(
web3Wrapper: Web3Wrapper,
networkId: number,
erc20TokenWrapper: ERC20TokenWrapper,
erc721TokenWrapper: ERC721TokenWrapper,
- contractAddressIfExists?: string,
- zrxContractAddressIfExists?: string,
+ address?: string,
+ zrxTokenAddress?: string,
blockPollingIntervalMs?: number,
) {
super(web3Wrapper, networkId, blockPollingIntervalMs);
this._erc20TokenWrapper = erc20TokenWrapper;
this._erc721TokenWrapper = erc721TokenWrapper;
- this._contractAddressIfExists = contractAddressIfExists;
- this._zrxContractAddressIfExists = zrxContractAddressIfExists;
+ this.address = _.isUndefined(address) ? _getDefaultContractAddresses(networkId).exchange : address;
+ this.zrxTokenAddress = _.isUndefined(zrxTokenAddress)
+ ? _getDefaultContractAddresses(networkId).zrxToken
+ : zrxTokenAddress;
}
/**
* Retrieve the address of an asset proxy by signature.
@@ -1051,12 +1057,11 @@ export class ExchangeWrapper extends ContractWrapper {
assert.doesBelongToStringEnum('eventName', eventName, ExchangeEvents);
assert.doesConformToSchema('indexFilterValues', indexFilterValues, schemas.indexFilterValuesSchema);
assert.isFunction('callback', callback);
- const exchangeContractAddress = this.getContractAddress();
const subscriptionToken = this._subscribe<ArgsType>(
- exchangeContractAddress,
+ this.address,
eventName,
indexFilterValues,
- artifacts.Exchange.compilerOutput.abi,
+ Exchange.compilerOutput.abi,
callback,
isVerbose,
);
@@ -1091,13 +1096,12 @@ export class ExchangeWrapper extends ContractWrapper {
assert.doesBelongToStringEnum('eventName', eventName, ExchangeEvents);
assert.doesConformToSchema('blockRange', blockRange, schemas.blockRangeSchema);
assert.doesConformToSchema('indexFilterValues', indexFilterValues, schemas.indexFilterValuesSchema);
- const exchangeContractAddress = this.getContractAddress();
const logs = await this._getLogsAsync<ArgsType>(
- exchangeContractAddress,
+ this.address,
eventName,
blockRange,
indexFilterValues,
- artifacts.Exchange.compilerOutput.abi,
+ Exchange.compilerOutput.abi,
);
return logs;
}
@@ -1111,6 +1115,9 @@ export class ExchangeWrapper extends ContractWrapper {
signedOrder: SignedOrder,
opts: ValidateOrderFillableOpts = {},
): Promise<void> {
+ assert.doesConformToSchema('signedOrder', signedOrder, schemas.signedOrderSchema);
+ assert.doesConformToSchema('opts', opts, validateOrderFillableOptsSchema);
+
const balanceAllowanceFetcher = new AssetBalanceAndProxyAllowanceFetcher(
this._erc20TokenWrapper,
this._erc721TokenWrapper,
@@ -1121,7 +1128,7 @@ export class ExchangeWrapper extends ContractWrapper {
const expectedFillTakerTokenAmountIfExists = opts.expectedFillTakerTokenAmount;
const filledCancelledFetcher = new OrderFilledCancelledFetcher(this, BlockParamLiteral.Latest);
- const orderValidationUtils = new OrderValidationUtils(filledCancelledFetcher);
+ const orderValidationUtils = new OrderValidationUtils(filledCancelledFetcher, this._web3Wrapper.getProvider());
await orderValidationUtils.validateOrderFillableOrThrowAsync(
exchangeTradeSimulator,
signedOrder,
@@ -1149,7 +1156,7 @@ export class ExchangeWrapper extends ContractWrapper {
const exchangeTradeSimulator = new ExchangeTransferSimulator(balanceAllowanceStore);
const filledCancelledFetcher = new OrderFilledCancelledFetcher(this, BlockParamLiteral.Latest);
- const orderValidationUtils = new OrderValidationUtils(filledCancelledFetcher);
+ const orderValidationUtils = new OrderValidationUtils(filledCancelledFetcher, this._web3Wrapper.getProvider());
await orderValidationUtils.validateFillOrderThrowIfInvalidAsync(
exchangeTradeSimulator,
this._web3Wrapper.getProvider(),
@@ -1160,29 +1167,11 @@ export class ExchangeWrapper extends ContractWrapper {
);
}
/**
- * Retrieves the Ethereum address of the Exchange contract deployed on the network
- * that the user-passed web3 provider is connected to.
- * @returns The Ethereum address of the Exchange contract being used.
- */
- public getContractAddress(): string {
- const contractAddress = this._getContractAddress(artifacts.Exchange, this._contractAddressIfExists);
- return contractAddress;
- }
- /**
- * Returns the ZRX token address used by the exchange contract.
- * @return Address of ZRX token
- */
- public getZRXTokenAddress(): string {
- const contractAddress = this._getContractAddress(artifacts.ZRXToken, this._zrxContractAddressIfExists);
- return contractAddress;
- }
- /**
* Returns the ZRX asset data used by the exchange contract.
* @return ZRX asset data
*/
public getZRXAssetData(): string {
- const zrxTokenAddress = this.getZRXTokenAddress();
- const zrxAssetData = assetDataUtils.encodeERC20AssetData(zrxTokenAddress);
+ const zrxAssetData = assetDataUtils.encodeERC20AssetData(this.zrxTokenAddress);
return zrxAssetData;
}
/**
@@ -1195,23 +1184,14 @@ export class ExchangeWrapper extends ContractWrapper {
const encoder = new TransactionEncoder(exchangeInstance);
return encoder;
}
- // tslint:disable:no-unused-variable
- private _invalidateContractInstances(): void {
- this.unsubscribeAll();
- delete this._exchangeContractIfExists;
- }
// tslint:enable:no-unused-variable
private async _getExchangeContractAsync(): Promise<ExchangeContract> {
if (!_.isUndefined(this._exchangeContractIfExists)) {
return this._exchangeContractIfExists;
}
- const [abi, address] = await this._getContractAbiAndAddressFromArtifactsAsync(
- artifacts.Exchange,
- this._contractAddressIfExists,
- );
const contractInstance = new ExchangeContract(
- abi,
- address,
+ this.abi,
+ this.address,
this._web3Wrapper.getProvider(),
this._web3Wrapper.getContractDefaults(),
);
diff --git a/packages/contract-wrappers/src/contract_wrappers/forwarder_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/forwarder_wrapper.ts
index c19edf188..80742e030 100644
--- a/packages/contract-wrappers/src/contract_wrappers/forwarder_wrapper.ts
+++ b/packages/contract-wrappers/src/contract_wrappers/forwarder_wrapper.ts
@@ -1,40 +1,62 @@
-import { schemas } from '@0xproject/json-schemas';
-import { AssetProxyId, SignedOrder } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { ForwarderContract } from '@0x/abi-gen-wrappers';
+import { Forwarder } from '@0x/contract-artifacts';
+import { schemas } from '@0x/json-schemas';
+import { SignedOrder } from '@0x/types';
+import { BigNumber } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import { ContractAbi } from 'ethereum-types';
import * as _ from 'lodash';
-import { artifacts } from '../artifacts';
import { orderTxOptsSchema } from '../schemas/order_tx_opts_schema';
import { txOptsSchema } from '../schemas/tx_opts_schema';
import { OrderTransactionOpts } from '../types';
import { assert } from '../utils/assert';
import { calldataOptimizationUtils } from '../utils/calldata_optimization_utils';
import { constants } from '../utils/constants';
+import { _getDefaultContractAddresses } from '../utils/contract_addresses';
import { decorators } from '../utils/decorators';
import { utils } from '../utils/utils';
import { ContractWrapper } from './contract_wrapper';
-import { ForwarderContract } from './generated/forwarder';
/**
* This class includes the functionality related to interacting with the Forwarder contract.
*/
export class ForwarderWrapper extends ContractWrapper {
- public abi: ContractAbi = artifacts.Forwarder.compilerOutput.abi;
+ public abi: ContractAbi = Forwarder.compilerOutput.abi;
+ public address: string;
+ public zrxTokenAddress: string;
+ public etherTokenAddress: string;
private _forwarderContractIfExists?: ForwarderContract;
- private _contractAddressIfExists?: string;
- private _zrxContractAddressIfExists?: string;
+
+ /**
+ * Instantiate ForwarderWrapper
+ * @param web3Wrapper Web3Wrapper instance to use.
+ * @param networkId Desired networkId.
+ * @param address The address of the Exchange contract. If undefined, will
+ * default to the known address corresponding to the networkId.
+ * @param zrxTokenAddress The address of the ZRXToken contract. If
+ * undefined, will default to the known address corresponding to the
+ * networkId.
+ * @param etherTokenAddress The address of a WETH (Ether token) contract. If
+ * undefined, will default to the known address corresponding to the
+ * networkId.
+ */
constructor(
web3Wrapper: Web3Wrapper,
networkId: number,
- contractAddressIfExists?: string,
- zrxContractAddressIfExists?: string,
+ address?: string,
+ zrxTokenAddress?: string,
+ etherTokenAddress?: string,
) {
super(web3Wrapper, networkId);
- this._contractAddressIfExists = contractAddressIfExists;
- this._zrxContractAddressIfExists = zrxContractAddressIfExists;
+ this.address = _.isUndefined(address) ? _getDefaultContractAddresses(networkId).exchange : address;
+ this.zrxTokenAddress = _.isUndefined(zrxTokenAddress)
+ ? _getDefaultContractAddresses(networkId).zrxToken
+ : zrxTokenAddress;
+ this.etherTokenAddress = _.isUndefined(etherTokenAddress)
+ ? _getDefaultContractAddresses(networkId).etherToken
+ : etherTokenAddress;
}
/**
* Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.
@@ -73,12 +95,8 @@ export class ForwarderWrapper extends ContractWrapper {
assert.isETHAddressHex('feeRecipientAddress', feeRecipientAddress);
assert.doesConformToSchema('orderTransactionOpts', orderTransactionOpts, orderTxOptsSchema, [txOptsSchema]);
// other assertions
- assert.ordersCanBeUsedForForwarderContract(signedOrders, this.getEtherTokenAddress());
- assert.feeOrdersCanBeUsedForForwarderContract(
- signedFeeOrders,
- this.getZRXTokenAddress(),
- this.getEtherTokenAddress(),
- );
+ assert.ordersCanBeUsedForForwarderContract(signedOrders, this.etherTokenAddress);
+ assert.feeOrdersCanBeUsedForForwarderContract(signedFeeOrders, this.zrxTokenAddress, this.etherTokenAddress);
// format feePercentage
const formattedFeePercentage = utils.numberPercentageToEtherTokenAmountPercentage(feePercentage);
// lowercase input addresses
@@ -100,7 +118,7 @@ export class ForwarderWrapper extends ContractWrapper {
optimizedFeeOrders,
feeSignatures,
formattedFeePercentage,
- feeRecipientAddress,
+ normalizedFeeRecipientAddress,
{
value: ethAmount,
from: normalizedTakerAddress,
@@ -165,12 +183,8 @@ export class ForwarderWrapper extends ContractWrapper {
assert.isETHAddressHex('feeRecipientAddress', feeRecipientAddress);
assert.doesConformToSchema('orderTransactionOpts', orderTransactionOpts, orderTxOptsSchema, [txOptsSchema]);
// other assertions
- assert.ordersCanBeUsedForForwarderContract(signedOrders, this.getEtherTokenAddress());
- assert.feeOrdersCanBeUsedForForwarderContract(
- signedFeeOrders,
- this.getZRXTokenAddress(),
- this.getEtherTokenAddress(),
- );
+ assert.ordersCanBeUsedForForwarderContract(signedOrders, this.etherTokenAddress);
+ assert.feeOrdersCanBeUsedForForwarderContract(signedFeeOrders, this.zrxTokenAddress, this.etherTokenAddress);
// format feePercentage
const formattedFeePercentage = utils.numberPercentageToEtherTokenAmountPercentage(feePercentage);
// lowercase input addresses
@@ -193,7 +207,7 @@ export class ForwarderWrapper extends ContractWrapper {
optimizedFeeOrders,
feeSignatures,
formattedFeePercentage,
- feeRecipientAddress,
+ normalizedFeeRecipientAddress,
{
value: ethAmount,
from: normalizedTakerAddress,
@@ -220,48 +234,13 @@ export class ForwarderWrapper extends ContractWrapper {
);
return txHash;
}
- /**
- * Retrieves the Ethereum address of the Forwarder contract deployed on the network
- * that the user-passed web3 provider is connected to.
- * @returns The Ethereum address of the Forwarder contract being used.
- */
- public getContractAddress(): string {
- const contractAddress = this._getContractAddress(artifacts.Forwarder, this._contractAddressIfExists);
- return contractAddress;
- }
- /**
- * Returns the ZRX token address used by the forwarder contract.
- * @return Address of ZRX token
- */
- public getZRXTokenAddress(): string {
- const contractAddress = this._getContractAddress(artifacts.ZRXToken, this._zrxContractAddressIfExists);
- return contractAddress;
- }
- /**
- * Returns the Ether token address used by the forwarder contract.
- * @return Address of Ether token
- */
- public getEtherTokenAddress(): string {
- const contractAddress = this._getContractAddress(artifacts.EtherToken);
- return contractAddress;
- }
- // HACK: We don't want this method to be visible to the other units within that package but not to the end user.
- // TS doesn't give that possibility and therefore we make it private and access it over an any cast. Because of that tslint sees it as unused.
- // tslint:disable-next-line:no-unused-variable
- private _invalidateContractInstance(): void {
- delete this._forwarderContractIfExists;
- }
private async _getForwarderContractAsync(): Promise<ForwarderContract> {
if (!_.isUndefined(this._forwarderContractIfExists)) {
return this._forwarderContractIfExists;
}
- const [abi, address] = await this._getContractAbiAndAddressFromArtifactsAsync(
- artifacts.Forwarder,
- this._contractAddressIfExists,
- );
const contractInstance = new ForwarderContract(
- abi,
- address,
+ this.abi,
+ this.address,
this._web3Wrapper.getProvider(),
this._web3Wrapper.getContractDefaults(),
);
diff --git a/packages/contract-wrappers/src/contract_wrappers/order_validator_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/order_validator_wrapper.ts
index 1da88f624..c186e080e 100644
--- a/packages/contract-wrappers/src/contract_wrappers/order_validator_wrapper.ts
+++ b/packages/contract-wrappers/src/contract_wrappers/order_validator_wrapper.ts
@@ -1,30 +1,35 @@
-import { schemas } from '@0xproject/json-schemas';
-import { SignedOrder } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { OrderValidatorContract } from '@0x/abi-gen-wrappers';
+import { OrderValidator } from '@0x/contract-artifacts';
+import { schemas } from '@0x/json-schemas';
+import { SignedOrder } from '@0x/types';
+import { BigNumber } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import { ContractAbi } from 'ethereum-types';
import * as _ from 'lodash';
-import { artifacts } from '../artifacts';
import { BalanceAndAllowance, OrderAndTraderInfo, TraderInfo } from '../types';
import { assert } from '../utils/assert';
+import { _getDefaultContractAddresses } from '../utils/contract_addresses';
import { ContractWrapper } from './contract_wrapper';
-import { OrderValidatorContract } from './generated/order_validator';
/**
* This class includes the functionality related to interacting with the OrderValidator contract.
*/
export class OrderValidatorWrapper extends ContractWrapper {
- public abi: ContractAbi = artifacts.OrderValidator.compilerOutput.abi;
+ public abi: ContractAbi = OrderValidator.compilerOutput.abi;
+ public address: string;
private _orderValidatorContractIfExists?: OrderValidatorContract;
/**
* Instantiate OrderValidatorWrapper
- * @param web3Wrapper Web3Wrapper instance to use
- * @param networkId Desired networkId
+ * @param web3Wrapper Web3Wrapper instance to use.
+ * @param networkId Desired networkId.
+ * @param address The address of the OrderValidator contract. If undefined,
+ * will default to the known address corresponding to the networkId.
*/
- constructor(web3Wrapper: Web3Wrapper, networkId: number) {
+ constructor(web3Wrapper: Web3Wrapper, networkId: number, address?: string) {
super(web3Wrapper, networkId);
+ this.address = _.isUndefined(address) ? _getDefaultContractAddresses(networkId).exchange : address;
}
/**
* Get an object conforming to OrderAndTraderInfo containing on-chain information of the provided order and address
@@ -164,20 +169,13 @@ export class OrderValidatorWrapper extends ContractWrapper {
const result = await OrderValidatorContractInstance.getERC721TokenOwner.callAsync(tokenAddress, tokenId);
return result;
}
- // HACK: We don't want this method to be visible to the other units within that package but not to the end user.
- // TS doesn't give that possibility and therefore we make it private and access it over an any cast. Because of that tslint sees it as unused.
- // tslint:disable-next-line:no-unused-variable
- private _invalidateContractInstance(): void {
- delete this._orderValidatorContractIfExists;
- }
private async _getOrderValidatorContractAsync(): Promise<OrderValidatorContract> {
if (!_.isUndefined(this._orderValidatorContractIfExists)) {
return this._orderValidatorContractIfExists;
}
- const [abi, address] = await this._getContractAbiAndAddressFromArtifactsAsync(artifacts.OrderValidator);
const contractInstance = new OrderValidatorContract(
- abi,
- address,
+ this.abi,
+ this.address,
this._web3Wrapper.getProvider(),
this._web3Wrapper.getContractDefaults(),
);
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 023cd5ac3..d10cffe57 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
@@ -1,7 +1,7 @@
// tslint:disable:no-unnecessary-type-assertion
-import { AbstractBalanceAndProxyAllowanceFetcher, assetDataUtils } from '@0xproject/order-utils';
-import { AssetProxyId, ERC20AssetData, ERC721AssetData } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
+import { AbstractBalanceAndProxyAllowanceFetcher, assetDataUtils } from '@0x/order-utils';
+import { AssetProxyId, ERC20AssetData, ERC721AssetData } from '@0x/types';
+import { BigNumber } from '@0x/utils';
import { BlockParamLiteral } from 'ethereum-types';
import { ERC20TokenWrapper } from '../contract_wrappers/erc20_token_wrapper';
diff --git a/packages/contract-wrappers/src/fetchers/order_filled_cancelled_fetcher.ts b/packages/contract-wrappers/src/fetchers/order_filled_cancelled_fetcher.ts
index 7a252aed3..5d350916c 100644
--- a/packages/contract-wrappers/src/fetchers/order_filled_cancelled_fetcher.ts
+++ b/packages/contract-wrappers/src/fetchers/order_filled_cancelled_fetcher.ts
@@ -1,6 +1,7 @@
// tslint:disable:no-unnecessary-type-assertion
-import { AbstractOrderFilledCancelledFetcher } from '@0xproject/order-utils';
-import { BigNumber } from '@0xproject/utils';
+import { AbstractOrderFilledCancelledFetcher, orderHashUtils } from '@0x/order-utils';
+import { SignedOrder } from '@0x/types';
+import { BigNumber } from '@0x/utils';
import { BlockParamLiteral } from 'ethereum-types';
import { ExchangeWrapper } from '../contract_wrappers/exchange_wrapper';
@@ -18,9 +19,18 @@ export class OrderFilledCancelledFetcher implements AbstractOrderFilledCancelled
});
return filledTakerAmount;
}
- public async isOrderCancelledAsync(orderHash: string): Promise<boolean> {
+ public async isOrderCancelledAsync(signedOrder: SignedOrder): Promise<boolean> {
+ const orderHash = orderHashUtils.getOrderHashHex(signedOrder);
const isCancelled = await this._exchange.isCancelledAsync(orderHash);
- return isCancelled;
+ const orderEpoch = await this._exchange.getOrderEpochAsync(
+ signedOrder.makerAddress,
+ signedOrder.senderAddress,
+ {
+ defaultBlock: this._stateLayer,
+ },
+ );
+ const isCancelledByOrderEpoch = orderEpoch > signedOrder.salt;
+ return isCancelled || isCancelledByOrderEpoch;
}
public getZRXAssetData(): string {
const zrxAssetData = this._exchange.getZRXAssetData();
diff --git a/packages/contract-wrappers/src/globals.d.ts b/packages/contract-wrappers/src/globals.d.ts
deleted file mode 100644
index 94e63a32d..000000000
--- a/packages/contract-wrappers/src/globals.d.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-declare module '*.json' {
- const json: any;
- /* tslint:disable */
- export default json;
- /* tslint:enable */
-}
diff --git a/packages/contract-wrappers/src/index.ts b/packages/contract-wrappers/src/index.ts
index e8a53170e..d66ff5c9c 100644
--- a/packages/contract-wrappers/src/index.ts
+++ b/packages/contract-wrappers/src/index.ts
@@ -1,3 +1,30 @@
+export { ContractAddresses } from '@0x/contract-addresses';
+
+export {
+ WETH9Events,
+ WETH9WithdrawalEventArgs,
+ WETH9ApprovalEventArgs,
+ WETH9EventArgs,
+ WETH9DepositEventArgs,
+ WETH9TransferEventArgs,
+ ERC20TokenTransferEventArgs,
+ ERC20TokenApprovalEventArgs,
+ ERC20TokenEvents,
+ ERC20TokenEventArgs,
+ ERC721TokenApprovalEventArgs,
+ ERC721TokenApprovalForAllEventArgs,
+ ERC721TokenTransferEventArgs,
+ ERC721TokenEvents,
+ ERC721TokenEventArgs,
+ ExchangeCancelUpToEventArgs,
+ ExchangeAssetProxyRegisteredEventArgs,
+ ExchangeSignatureValidatorApprovalEventArgs,
+ ExchangeFillEventArgs,
+ ExchangeCancelEventArgs,
+ ExchangeEventArgs,
+ ExchangeEvents,
+} from '@0x/abi-gen-wrappers';
+
export { ContractWrappers } from './contract_wrappers';
export { ERC20TokenWrapper } from './contract_wrappers/erc20_token_wrapper';
export { ERC721TokenWrapper } from './contract_wrappers/erc721_token_wrapper';
@@ -12,6 +39,7 @@ export { TransactionEncoder } from './utils/transaction_encoder';
export {
ContractWrappersError,
+ ForwarderWrapperError,
IndexedFilterValues,
BlockRange,
ContractWrappersConfig,
@@ -28,7 +56,7 @@ export {
ValidateOrderFillableOpts,
} from './types';
-export { Order, SignedOrder, AssetProxyId } from '@0xproject/types';
+export { Order, SignedOrder, AssetProxyId } from '@0x/types';
export {
BlockParamLiteral,
@@ -54,41 +82,7 @@ export {
StateMutability,
} from 'ethereum-types';
-export {
- WETH9Events,
- WETH9WithdrawalEventArgs,
- WETH9ApprovalEventArgs,
- WETH9EventArgs,
- WETH9DepositEventArgs,
- WETH9TransferEventArgs,
-} from './contract_wrappers/generated/weth9';
-
-export {
- ERC20TokenTransferEventArgs,
- ERC20TokenApprovalEventArgs,
- ERC20TokenEvents,
- ERC20TokenEventArgs,
-} from './contract_wrappers/generated/erc20_token';
-
-export {
- ERC721TokenApprovalEventArgs,
- ERC721TokenApprovalForAllEventArgs,
- ERC721TokenTransferEventArgs,
- ERC721TokenEvents,
- ERC721TokenEventArgs,
-} from './contract_wrappers/generated/erc721_token';
-
-export {
- ExchangeCancelUpToEventArgs,
- ExchangeAssetProxyRegisteredEventArgs,
- ExchangeSignatureValidatorApprovalEventArgs,
- ExchangeFillEventArgs,
- ExchangeCancelEventArgs,
- ExchangeEventArgs,
- ExchangeEvents,
-} from './contract_wrappers/generated/exchange';
-
-export { AbstractBalanceAndProxyAllowanceFetcher, AbstractOrderFilledCancelledFetcher } from '@0xproject/order-utils';
+export { AbstractBalanceAndProxyAllowanceFetcher, AbstractOrderFilledCancelledFetcher } from '@0x/order-utils';
export { AssetBalanceAndProxyAllowanceFetcher } from './fetchers/asset_balance_and_proxy_allowance_fetcher';
export { OrderFilledCancelledFetcher } from './fetchers/order_filled_cancelled_fetcher';
diff --git a/packages/contract-wrappers/src/schemas/contract_wrappers_config_schema.ts b/packages/contract-wrappers/src/schemas/contract_wrappers_config_schema.ts
index ac248b2d4..ae1ce668c 100644
--- a/packages/contract-wrappers/src/schemas/contract_wrappers_config_schema.ts
+++ b/packages/contract-wrappers/src/schemas/contract_wrappers_config_schema.ts
@@ -1,5 +1,25 @@
export const ContractWrappersConfigSchema = {
id: '/ContractWrappersConfig',
- oneOf: [{ $ref: '/ZeroExContractPrivateNetworkConfig' }, { $ref: '/ZeroExContractPublicNetworkConfig' }],
+ properties: {
+ networkId: {
+ type: 'number',
+ },
+ gasPrice: { $ref: '/numberSchema' },
+ contractAddresses: {
+ type: 'object',
+ properties: {
+ erc20Proxy: { $ref: '/addressSchema' },
+ erc721Proxy: { $ref: '/addressSchema' },
+ zrxToken: { $ref: '/addressSchema' },
+ etherToken: { $ref: '/addressSchema' },
+ exchange: { $ref: '/addressSchema' },
+ assetProxyOwner: { $ref: '/addressSchema' },
+ forwarder: { $ref: '/addressSchema' },
+ orderValidator: { $ref: '/addressSchema' },
+ },
+ },
+ blockPollingIntervalMs: { type: 'number' },
+ },
type: 'object',
+ required: ['networkId'],
};
diff --git a/packages/contract-wrappers/src/schemas/contract_wrappers_private_network_config_schema.ts b/packages/contract-wrappers/src/schemas/contract_wrappers_private_network_config_schema.ts
deleted file mode 100644
index 904690ae7..000000000
--- a/packages/contract-wrappers/src/schemas/contract_wrappers_private_network_config_schema.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-export const contractWrappersPrivateNetworkConfigSchema = {
- id: '/ZeroExContractPrivateNetworkConfig',
- properties: {
- networkId: {
- type: 'number',
- minimum: 1,
- },
- gasPrice: { $ref: '/numberSchema' },
- zrxContractAddress: { $ref: '/addressSchema' },
- exchangeContractAddress: { $ref: '/addressSchema' },
- erc20ProxyContractAddress: { $ref: '/addressSchema' },
- erc721ProxyContractAddress: { $ref: '/addressSchema' },
- blockPollingIntervalMs: { type: 'number' },
- orderWatcherConfig: {
- type: 'object',
- properties: {
- pollingIntervalMs: {
- type: 'number',
- minimum: 0,
- },
- numConfirmations: {
- type: 'number',
- minimum: 0,
- },
- },
- },
- },
- type: 'object',
- required: [
- 'networkId',
- 'zrxContractAddress',
- 'exchangeContractAddress',
- 'erc20ProxyContractAddress',
- 'erc721ProxyContractAddress',
- ],
-};
diff --git a/packages/contract-wrappers/src/schemas/contract_wrappers_public_network_config_schema.ts b/packages/contract-wrappers/src/schemas/contract_wrappers_public_network_config_schema.ts
deleted file mode 100644
index 5cd008ae0..000000000
--- a/packages/contract-wrappers/src/schemas/contract_wrappers_public_network_config_schema.ts
+++ /dev/null
@@ -1,44 +0,0 @@
-const networkNameToId: { [networkName: string]: number } = {
- mainnet: 1,
- ropsten: 3,
- rinkeby: 4,
- kovan: 42,
- ganache: 50,
-};
-
-export const contractWrappersPublicNetworkConfigSchema = {
- id: '/ZeroExContractPublicNetworkConfig',
- properties: {
- networkId: {
- type: 'number',
- enum: [
- networkNameToId.mainnet,
- networkNameToId.kovan,
- networkNameToId.ropsten,
- networkNameToId.rinkeby,
- networkNameToId.ganache,
- ],
- },
- gasPrice: { $ref: '/numberSchema' },
- zrxContractAddress: { $ref: '/addressSchema' },
- exchangeContractAddress: { $ref: '/addressSchema' },
- erc20ProxyContractAddress: { $ref: '/addressSchema' },
- erc721ProxyContractAddress: { $ref: '/addressSchema' },
- blockPollingIntervalMs: { type: 'number' },
- orderWatcherConfig: {
- type: 'object',
- properties: {
- pollingIntervalMs: {
- type: 'number',
- minimum: 0,
- },
- numConfirmations: {
- type: 'number',
- minimum: 0,
- },
- },
- },
- },
- type: 'object',
- required: ['networkId'],
-};
diff --git a/packages/contract-wrappers/src/schemas/validate_order_fillable_opts_schema.ts b/packages/contract-wrappers/src/schemas/validate_order_fillable_opts_schema.ts
new file mode 100644
index 000000000..2e111af04
--- /dev/null
+++ b/packages/contract-wrappers/src/schemas/validate_order_fillable_opts_schema.ts
@@ -0,0 +1,7 @@
+export const validateOrderFillableOptsSchema = {
+ id: '/ValidateOrderFillableOpts',
+ properties: {
+ expectedFillTakerTokenAmount: { $ref: '/wholeNumberSchema' },
+ },
+ type: 'object',
+};
diff --git a/packages/contract-wrappers/src/types.ts b/packages/contract-wrappers/src/types.ts
index e0b12b7c9..5a5bdd530 100644
--- a/packages/contract-wrappers/src/types.ts
+++ b/packages/contract-wrappers/src/types.ts
@@ -1,25 +1,28 @@
-import { BigNumber } from '@0xproject/utils';
+import {
+ ERC20TokenEventArgs,
+ ERC20TokenEvents,
+ ERC721TokenEventArgs,
+ ERC721TokenEvents,
+ ExchangeEventArgs,
+ ExchangeEvents,
+ WETH9EventArgs,
+ WETH9Events,
+} from '@0x/abi-gen-wrappers';
+import { ContractAddresses } from '@0x/contract-addresses';
+import { OrderState, SignedOrder } from '@0x/types';
+import { BigNumber } from '@0x/utils';
-import { OrderState, SignedOrder } from '@0xproject/types';
import { BlockParam, ContractEventArg, DecodedLogArgs, LogEntryEvent, LogWithDecodedArgs } from 'ethereum-types';
-import { ERC20TokenEventArgs, ERC20TokenEvents } from './contract_wrappers/generated/erc20_token';
-import { ERC721TokenEventArgs, ERC721TokenEvents } from './contract_wrappers/generated/erc721_token';
-import { ExchangeEventArgs, ExchangeEvents } from './contract_wrappers/generated/exchange';
-import { WETH9EventArgs, WETH9Events } from './contract_wrappers/generated/weth9';
-
export enum ExchangeWrapperError {
AssetDataMismatch = 'ASSET_DATA_MISMATCH',
}
+export enum ForwarderWrapperError {
+ CompleteFillFailed = 'COMPLETE_FILL_FAILED',
+}
+
export enum ContractWrappersError {
- ExchangeContractDoesNotExist = 'EXCHANGE_CONTRACT_DOES_NOT_EXIST',
- ZRXContractDoesNotExist = 'ZRX_CONTRACT_DOES_NOT_EXIST',
- EtherTokenContractDoesNotExist = 'ETHER_TOKEN_CONTRACT_DOES_NOT_EXIST',
- ERC20ProxyContractDoesNotExist = 'ERC20_PROXY_CONTRACT_DOES_NOT_EXIST',
- ERC721ProxyContractDoesNotExist = 'ERC721_PROXY_CONTRACT_DOES_NOT_EXIST',
- ERC20TokenContractDoesNotExist = 'ERC20_TOKEN_CONTRACT_DOES_NOT_EXIST',
- ERC721TokenContractDoesNotExist = 'ERC721_TOKEN_CONTRACT_DOES_NOT_EXIST',
ContractNotDeployedOnNetwork = 'CONTRACT_NOT_DEPLOYED_ON_NETWORK',
InsufficientAllowanceForTransfer = 'INSUFFICIENT_ALLOWANCE_FOR_TRANSFER',
InsufficientBalanceForTransfer = 'INSUFFICIENT_BALANCE_FOR_TRANSFER',
@@ -31,6 +34,7 @@ export enum ContractWrappersError {
SubscriptionAlreadyPresent = 'SUBSCRIPTION_ALREADY_PRESENT',
ERC721OwnerNotFound = 'ERC_721_OWNER_NOT_FOUND',
ERC721NoApproval = 'ERC_721_NO_APPROVAL',
+ SignatureRequestDenied = 'SIGNATURE_REQUEST_DENIED',
}
export enum InternalContractWrappersError {
@@ -105,22 +109,13 @@ export type SyncMethod = (...args: any[]) => any;
/**
* networkId: The id of the underlying ethereum network your provider is connected to. (1-mainnet, 3-ropsten, 4-rinkeby, 42-kovan, 50-testrpc)
* gasPrice: Gas price to use with every transaction
- * exchangeContractAddress: The address of an exchange contract to use
- * zrxContractAddress: The address of the ZRX contract to use
- * erc20ProxyContractAddress: The address of the erc20 token transfer proxy contract to use
- * erc721ProxyContractAddress: The address of the erc721 token transfer proxy contract to use
- * forwarderContractAddress: The address of the forwarder contract to use
- * orderWatcherConfig: All the configs related to the orderWatcher
+ * contractAddresses: The address of all contracts to use. Defaults to the known addresses based on networkId.
* blockPollingIntervalMs: The interval to use for block polling in event watching methods (defaults to 1000)
*/
export interface ContractWrappersConfig {
networkId: number;
gasPrice?: BigNumber;
- exchangeContractAddress?: string;
- zrxContractAddress?: string;
- erc20ProxyContractAddress?: string;
- erc721ProxyContractAddress?: string;
- forwarderContractAddress?: string;
+ contractAddresses?: ContractAddresses;
blockPollingIntervalMs?: number;
}
diff --git a/packages/contract-wrappers/src/utils/assert.ts b/packages/contract-wrappers/src/utils/assert.ts
index 30726c546..3f02ed052 100644
--- a/packages/contract-wrappers/src/utils/assert.ts
+++ b/packages/contract-wrappers/src/utils/assert.ts
@@ -1,10 +1,10 @@
-import { assert as sharedAssert } from '@0xproject/assert';
+import { assert as sharedAssert } from '@0x/assert';
// HACK: We need those two unused imports because they're actually used by sharedAssert which gets injected here
-import { Schema } from '@0xproject/json-schemas'; // tslint:disable-line:no-unused-variable
-import { assetDataUtils, signatureUtils } from '@0xproject/order-utils';
-import { Order } from '@0xproject/types'; // tslint:disable-line:no-unused-variable
-import { BigNumber } from '@0xproject/utils'; // tslint:disable-line:no-unused-variable
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { Schema } from '@0x/json-schemas'; // tslint:disable-line:no-unused-variable
+import { assetDataUtils, signatureUtils } from '@0x/order-utils';
+import { Order } from '@0x/types'; // tslint:disable-line:no-unused-variable
+import { BigNumber } from '@0x/utils'; // tslint:disable-line:no-unused-variable
+import { Web3Wrapper } from '@0x/web3-wrapper';
import { Provider } from 'ethereum-types';
import * as _ from 'lodash';
diff --git a/packages/contract-wrappers/src/utils/calldata_optimization_utils.ts b/packages/contract-wrappers/src/utils/calldata_optimization_utils.ts
index 3172cf531..bee7acaa7 100644
--- a/packages/contract-wrappers/src/utils/calldata_optimization_utils.ts
+++ b/packages/contract-wrappers/src/utils/calldata_optimization_utils.ts
@@ -1,4 +1,4 @@
-import { SignedOrder } from '@0xproject/types';
+import { SignedOrder } from '@0x/types';
import * as _ from 'lodash';
import { constants } from './constants';
diff --git a/packages/contract-wrappers/src/utils/constants.ts b/packages/contract-wrappers/src/utils/constants.ts
index 78441decf..c587ba526 100644
--- a/packages/contract-wrappers/src/utils/constants.ts
+++ b/packages/contract-wrappers/src/utils/constants.ts
@@ -1,4 +1,4 @@
-import { BigNumber } from '@0xproject/utils';
+import { BigNumber } from '@0x/utils';
export const constants = {
NULL_ADDRESS: '0x0000000000000000000000000000000000000000',
@@ -14,4 +14,5 @@ export const constants = {
ZERO_AMOUNT: new BigNumber(0),
ONE_AMOUNT: new BigNumber(1),
ETHER_TOKEN_DECIMALS: 18,
+ USER_DENIED_SIGNATURE_PATTERN: 'User denied transaction signature',
};
diff --git a/packages/contract-wrappers/src/utils/contract_addresses.ts b/packages/contract-wrappers/src/utils/contract_addresses.ts
new file mode 100644
index 000000000..dc156e017
--- /dev/null
+++ b/packages/contract-wrappers/src/utils/contract_addresses.ts
@@ -0,0 +1,15 @@
+import { ContractAddresses, getContractAddressesForNetworkOrThrow, NetworkId } from '@0x/contract-addresses';
+import * as _ from 'lodash';
+
+/**
+ * Returns the default contract addresses for the given networkId or throws with
+ * a context-specific error message if the networkId is not recognized.
+ */
+export function _getDefaultContractAddresses(networkId: number): ContractAddresses {
+ if (!(networkId in NetworkId)) {
+ throw new Error(
+ `No default contract addresses found for the given network id (${networkId}). If you want to use ContractWrappers on this network, you must manually pass in the contract address(es) to the constructor.`,
+ );
+ }
+ return getContractAddressesForNetworkOrThrow(networkId);
+}
diff --git a/packages/contract-wrappers/src/utils/decorators.ts b/packages/contract-wrappers/src/utils/decorators.ts
index e17246015..a4207ae4c 100644
--- a/packages/contract-wrappers/src/utils/decorators.ts
+++ b/packages/contract-wrappers/src/utils/decorators.ts
@@ -29,6 +29,14 @@ const schemaErrorTransformer = (error: Error) => {
return error;
};
+const signatureRequestErrorTransformer = (error: Error) => {
+ if (_.includes(error.message, constants.USER_DENIED_SIGNATURE_PATTERN)) {
+ const errMsg = ContractWrappersError.SignatureRequestDenied;
+ return new Error(errMsg);
+ }
+ return error;
+};
+
/**
* Source: https://stackoverflow.com/a/29837695/3546986
*/
@@ -87,7 +95,11 @@ const syncErrorHandlerFactory = (errorTransformer: ErrorTransformer) => {
};
// _.flow(f, g) = f ∘ g
-const zeroExErrorTransformer = _.flow(schemaErrorTransformer, contractCallErrorTransformer);
+const zeroExErrorTransformer = _.flow(
+ schemaErrorTransformer,
+ contractCallErrorTransformer,
+ signatureRequestErrorTransformer,
+);
export const decorators = {
asyncZeroExErrorHandler: asyncErrorHandlerFactory(zeroExErrorTransformer),
diff --git a/packages/contract-wrappers/src/utils/exchange_transfer_simulator.ts b/packages/contract-wrappers/src/utils/exchange_transfer_simulator.ts
index a7c4a238f..f374d509b 100644
--- a/packages/contract-wrappers/src/utils/exchange_transfer_simulator.ts
+++ b/packages/contract-wrappers/src/utils/exchange_transfer_simulator.ts
@@ -1,5 +1,5 @@
-import { ExchangeContractErrs } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
+import { ExchangeContractErrs } from '@0x/types';
+import { BigNumber } from '@0x/utils';
import { AbstractBalanceAndProxyAllowanceLazyStore } from '../abstract/abstract_balance_and_proxy_allowance_lazy_store';
import { TradeSide, TransferType } from '../types';
diff --git a/packages/contract-wrappers/src/utils/transaction_encoder.ts b/packages/contract-wrappers/src/utils/transaction_encoder.ts
index 33086944b..0cf08a8fe 100644
--- a/packages/contract-wrappers/src/utils/transaction_encoder.ts
+++ b/packages/contract-wrappers/src/utils/transaction_encoder.ts
@@ -1,10 +1,10 @@
-import { schemas } from '@0xproject/json-schemas';
-import { eip712Utils } from '@0xproject/order-utils';
-import { Order, SignedOrder } from '@0xproject/types';
-import { BigNumber, signTypedDataUtils } from '@0xproject/utils';
-import _ = require('lodash');
+import { ExchangeContract } from '@0x/abi-gen-wrappers';
-import { ExchangeContract } from '../contract_wrappers/generated/exchange';
+import { schemas } from '@0x/json-schemas';
+import { eip712Utils } from '@0x/order-utils';
+import { Order, SignedOrder } from '@0x/types';
+import { BigNumber, signTypedDataUtils } from '@0x/utils';
+import _ = require('lodash');
import { assert } from './assert';
diff --git a/packages/contract-wrappers/src/utils/utils.ts b/packages/contract-wrappers/src/utils/utils.ts
index f7949ec34..0b3270e78 100644
--- a/packages/contract-wrappers/src/utils/utils.ts
+++ b/packages/contract-wrappers/src/utils/utils.ts
@@ -1,5 +1,6 @@
-import { BigNumber } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { BigNumber } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
+import * as _ from 'lodash';
import { constants } from './constants';
@@ -14,4 +15,7 @@ export const utils = {
numberPercentageToEtherTokenAmountPercentage(percentage: number): BigNumber {
return Web3Wrapper.toBaseUnitAmount(constants.ONE_AMOUNT, constants.ETHER_TOKEN_DECIMALS).mul(percentage);
},
+ removeUndefinedProperties<T extends object>(obj: T): Partial<T> {
+ return _.pickBy(obj);
+ },
};
diff --git a/packages/contract-wrappers/test/artifacts_test.ts b/packages/contract-wrappers/test/artifacts_test.ts
deleted file mode 100644
index c05d513b3..000000000
--- a/packages/contract-wrappers/test/artifacts_test.ts
+++ /dev/null
@@ -1,43 +0,0 @@
-import { web3Factory } from '@0xproject/dev-utils';
-
-import { ContractWrappers } from '../src';
-
-import { chaiSetup } from './utils/chai_setup';
-import { constants } from './utils/constants';
-
-chaiSetup.configure();
-
-// Those tests are slower cause they're talking to a remote node
-const TIMEOUT = 10000;
-
-// TODO: Re-enable those tests after final kovan and ropsten deployments are done.
-describe.skip('Artifacts', () => {
- describe('contracts are deployed on kovan', () => {
- const kovanRpcUrl = constants.KOVAN_RPC_URL;
- const provider = web3Factory.getRpcProvider({ rpcUrl: kovanRpcUrl });
- const config = {
- networkId: constants.KOVAN_NETWORK_ID,
- };
- const contractWrappers = new ContractWrappers(provider, config);
- it('erc20 proxy contract is deployed', async () => {
- await (contractWrappers.erc20Proxy as any)._getTokenTransferProxyContractAsync();
- }).timeout(TIMEOUT);
- it('erc721 proxy contract is deployed', async () => {
- await (contractWrappers.erc721Proxy as any)._getTokenTransferProxyContractAsync();
- }).timeout(TIMEOUT);
- });
- describe('contracts are deployed on ropsten', () => {
- const ropstenRpcUrl = constants.ROPSTEN_RPC_URL;
- const provider = web3Factory.getRpcProvider({ rpcUrl: ropstenRpcUrl });
- const config = {
- networkId: constants.ROPSTEN_NETWORK_ID,
- };
- const contractWrappers = new ContractWrappers(provider, config);
- it('erc20 proxy contract is deployed', async () => {
- await (contractWrappers.erc20Proxy as any)._getTokenTransferProxyContractAsync();
- }).timeout(TIMEOUT);
- it('erc721 proxy contract is deployed', async () => {
- await (contractWrappers.erc721Proxy as any)._getTokenTransferProxyContractAsync();
- }).timeout(TIMEOUT);
- });
-});
diff --git a/packages/contract-wrappers/test/calldata_optimization_utils_test.ts b/packages/contract-wrappers/test/calldata_optimization_utils_test.ts
index 94e55bffa..6cb8a669e 100644
--- a/packages/contract-wrappers/test/calldata_optimization_utils_test.ts
+++ b/packages/contract-wrappers/test/calldata_optimization_utils_test.ts
@@ -1,4 +1,4 @@
-import { orderFactory } from '@0xproject/order-utils/lib/src/order_factory';
+import { orderFactory } from '@0x/order-utils/lib/src/order_factory';
import * as chai from 'chai';
import * as _ from 'lodash';
import 'mocha';
diff --git a/packages/contract-wrappers/test/erc20_proxy_wrapper_test.ts b/packages/contract-wrappers/test/erc20_proxy_wrapper_test.ts
index 6bf9f1e25..d8dfa4204 100644
--- a/packages/contract-wrappers/test/erc20_proxy_wrapper_test.ts
+++ b/packages/contract-wrappers/test/erc20_proxy_wrapper_test.ts
@@ -4,6 +4,7 @@ import { ContractWrappers } from '../src';
import { chaiSetup } from './utils/chai_setup';
import { constants } from './utils/constants';
+import { migrateOnceAsync } from './utils/migrate';
import { provider } from './utils/web3_wrapper';
chaiSetup.configure();
@@ -11,10 +12,13 @@ const expect = chai.expect;
describe('ERC20ProxyWrapper', () => {
let contractWrappers: ContractWrappers;
- const config = {
- networkId: constants.TESTRPC_NETWORK_ID,
- };
before(async () => {
+ const contractAddresses = await migrateOnceAsync();
+ const config = {
+ networkId: constants.TESTRPC_NETWORK_ID,
+ contractAddresses,
+ blockPollingIntervalMs: 10,
+ };
contractWrappers = new ContractWrappers(provider, config);
});
describe('#isAuthorizedAsync', () => {
diff --git a/packages/contract-wrappers/test/erc20_wrapper_test.ts b/packages/contract-wrappers/test/erc20_wrapper_test.ts
index fde587dec..15d3a9ead 100644
--- a/packages/contract-wrappers/test/erc20_wrapper_test.ts
+++ b/packages/contract-wrappers/test/erc20_wrapper_test.ts
@@ -1,7 +1,8 @@
-import { BlockchainLifecycle, callbackErrorReporter } from '@0xproject/dev-utils';
-import { EmptyWalletSubprovider, Web3ProviderEngine } from '@0xproject/subproviders';
-import { DoneCallback } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
+import { ContractAddresses } from '@0x/contract-addresses';
+import { BlockchainLifecycle, callbackErrorReporter } from '@0x/dev-utils';
+import { EmptyWalletSubprovider, Web3ProviderEngine } from '@0x/subproviders';
+import { DoneCallback } from '@0x/types';
+import { BigNumber } from '@0x/utils';
import * as chai from 'chai';
import { Provider } from 'ethereum-types';
import 'mocha';
@@ -10,16 +11,17 @@ import {
BlockParamLiteral,
BlockRange,
ContractWrappers,
+ ContractWrappersConfig,
ContractWrappersError,
+ DecodedLogEvent,
ERC20TokenApprovalEventArgs,
ERC20TokenEvents,
ERC20TokenTransferEventArgs,
} from '../src';
-import { DecodedLogEvent } from '../src/types';
-
import { chaiSetup } from './utils/chai_setup';
import { constants } from './utils/constants';
+import { migrateOnceAsync } from './utils/migrate';
import { tokenUtils } from './utils/token_utils';
import { provider, web3Wrapper } from './utils/web3_wrapper';
@@ -29,14 +31,20 @@ const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
describe('ERC20Wrapper', () => {
let contractWrappers: ContractWrappers;
+ let contractAddresses: ContractAddresses;
let userAddresses: string[];
let tokens: string[];
let coinbase: string;
let addressWithoutFunds: string;
- const config = {
- networkId: constants.TESTRPC_NETWORK_ID,
- };
+ let config: ContractWrappersConfig;
+
before(async () => {
+ contractAddresses = await migrateOnceAsync();
+ config = {
+ networkId: constants.TESTRPC_NETWORK_ID,
+ contractAddresses,
+ blockPollingIntervalMs: 10,
+ };
contractWrappers = new ContractWrappers(provider, config);
userAddresses = await web3Wrapper.getAvailableAddressesAsync();
tokens = tokenUtils.getDummyERC20TokenAddresses();
@@ -72,19 +80,6 @@ describe('ERC20Wrapper', () => {
contractWrappers.erc20Token.transferAsync(tokenAddress, fromAddress, toAddress, transferAmount),
).to.be.rejectedWith(ContractWrappersError.InsufficientBalanceForTransfer);
});
- it('should throw a CONTRACT_DOES_NOT_EXIST error for a non-existent token contract', async () => {
- const nonExistentTokenAddress = '0x9dd402f14d67e001d8efbe6583e51bf9706aa065';
- const fromAddress = coinbase;
- const toAddress = coinbase;
- return expect(
- contractWrappers.erc20Token.transferAsync(
- nonExistentTokenAddress,
- fromAddress,
- toAddress,
- transferAmount,
- ),
- ).to.be.rejectedWith(ContractWrappersError.ERC20TokenContractDoesNotExist);
- });
});
describe('#transferFromAsync', () => {
let tokenAddress: string;
@@ -189,19 +184,6 @@ describe('ERC20Wrapper', () => {
const postBalance = await contractWrappers.erc20Token.getBalanceAsync(tokenAddress, toAddress);
return expect(postBalance).to.be.bignumber.equal(transferAmount);
});
- it('should throw a CONTRACT_DOES_NOT_EXIST error for a non-existent token contract', async () => {
- const fromAddress = coinbase;
- const nonExistentTokenAddress = '0x9dd402f14d67e001d8efbe6583e51bf9706aa065';
- return expect(
- contractWrappers.erc20Token.transferFromAsync(
- nonExistentTokenAddress,
- fromAddress,
- toAddress,
- senderAddress,
- new BigNumber(42),
- ),
- ).to.be.rejectedWith(ContractWrappersError.ERC20TokenContractDoesNotExist);
- });
});
describe('#getBalanceAsync', () => {
describe('With provider with accounts', () => {
@@ -212,13 +194,6 @@ describe('ERC20Wrapper', () => {
const expectedBalance = new BigNumber('1000000000000000000000000000');
return expect(balance).to.be.bignumber.equal(expectedBalance);
});
- it('should throw a CONTRACT_DOES_NOT_EXIST error for a non-existent token contract', async () => {
- const nonExistentTokenAddress = '0x9dd402f14d67e001d8efbe6583e51bf9706aa065';
- const ownerAddress = coinbase;
- return expect(
- contractWrappers.erc20Token.getBalanceAsync(nonExistentTokenAddress, ownerAddress),
- ).to.be.rejectedWith(ContractWrappersError.ERC20TokenContractDoesNotExist);
- });
it('should return a balance of 0 for a non-existent owner address', async () => {
const tokenAddress = tokens[0];
const nonExistentOwner = '0x198c6ad858f213fb31b6fe809e25040e6b964593';
@@ -294,7 +269,7 @@ describe('ERC20Wrapper', () => {
});
it('should reduce the gas cost for transfers including tokens with unlimited allowance support', async () => {
const transferAmount = new BigNumber(5);
- const zrxAddress = tokenUtils.getProtocolTokenAddress();
+ const zrxAddress = contractAddresses.zrxToken;
const [, userWithNormalAllowance, userWithUnlimitedAllowance] = userAddresses;
await contractWrappers.erc20Token.setAllowanceAsync(
zrxAddress,
@@ -525,7 +500,7 @@ describe('ERC20Wrapper', () => {
);
})().catch(done);
});
- it('Outstanding subscriptions are cancelled when contractWrappers.setProvider called', (done: DoneCallback) => {
+ it('Outstanding subscriptions are cancelled when contractWrappers.unsubscribeAll called', (done: DoneCallback) => {
(async () => {
const callbackNeverToBeCalled = callbackErrorReporter.reportNodeCallbackErrors(done)(
(_logEvent: DecodedLogEvent<ERC20TokenApprovalEventArgs>) => {
@@ -539,7 +514,7 @@ describe('ERC20Wrapper', () => {
callbackNeverToBeCalled,
);
const callbackToBeCalled = callbackErrorReporter.reportNodeCallbackErrors(done)();
- contractWrappers.setProvider(provider, constants.TESTRPC_NETWORK_ID);
+ contractWrappers.unsubscribeAll();
contractWrappers.erc20Token.subscribe(
tokenAddress,
ERC20TokenEvents.Transfer,
@@ -588,7 +563,7 @@ describe('ERC20Wrapper', () => {
let txHash: string;
before(() => {
tokenAddress = tokens[0];
- tokenTransferProxyAddress = contractWrappers.erc20Proxy.getContractAddress();
+ tokenTransferProxyAddress = contractWrappers.erc20Proxy.address;
});
it('should get logs with decoded args emitted by Approval', async () => {
txHash = await contractWrappers.erc20Token.setUnlimitedProxyAllowanceAsync(tokenAddress, coinbase);
diff --git a/packages/contract-wrappers/test/erc721_proxy_wrapper_test.ts b/packages/contract-wrappers/test/erc721_proxy_wrapper_test.ts
index 9473d930b..9b0fe8817 100644
--- a/packages/contract-wrappers/test/erc721_proxy_wrapper_test.ts
+++ b/packages/contract-wrappers/test/erc721_proxy_wrapper_test.ts
@@ -4,6 +4,7 @@ import { ContractWrappers } from '../src';
import { chaiSetup } from './utils/chai_setup';
import { constants } from './utils/constants';
+import { migrateOnceAsync } from './utils/migrate';
import { provider } from './utils/web3_wrapper';
chaiSetup.configure();
@@ -11,10 +12,13 @@ const expect = chai.expect;
describe('ERC721ProxyWrapper', () => {
let contractWrappers: ContractWrappers;
- const config = {
- networkId: constants.TESTRPC_NETWORK_ID,
- };
before(async () => {
+ const contractAddresses = await migrateOnceAsync();
+ const config = {
+ networkId: constants.TESTRPC_NETWORK_ID,
+ contractAddresses,
+ blockPollingIntervalMs: 10,
+ };
contractWrappers = new ContractWrappers(provider, config);
});
describe('#isAuthorizedAsync', () => {
diff --git a/packages/contract-wrappers/test/erc721_wrapper_test.ts b/packages/contract-wrappers/test/erc721_wrapper_test.ts
index 10bac6086..a7f1e4c41 100644
--- a/packages/contract-wrappers/test/erc721_wrapper_test.ts
+++ b/packages/contract-wrappers/test/erc721_wrapper_test.ts
@@ -1,7 +1,7 @@
-import { BlockchainLifecycle, callbackErrorReporter } from '@0xproject/dev-utils';
-import { EmptyWalletSubprovider, Web3ProviderEngine } from '@0xproject/subproviders';
-import { DoneCallback } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
+import { BlockchainLifecycle, callbackErrorReporter } from '@0x/dev-utils';
+import { EmptyWalletSubprovider, Web3ProviderEngine } from '@0x/subproviders';
+import { DoneCallback } from '@0x/types';
+import { BigNumber } from '@0x/utils';
import * as chai from 'chai';
import { Provider } from 'ethereum-types';
import 'mocha';
@@ -10,16 +10,18 @@ import {
BlockParamLiteral,
BlockRange,
ContractWrappers,
+ ContractWrappersConfig,
ContractWrappersError,
+ DecodedLogEvent,
ERC721TokenApprovalEventArgs,
ERC721TokenApprovalForAllEventArgs,
ERC721TokenEvents,
ERC721TokenTransferEventArgs,
} from '../src';
-import { DecodedLogEvent } from '../src/types';
import { chaiSetup } from './utils/chai_setup';
import { constants } from './utils/constants';
+import { migrateOnceAsync } from './utils/migrate';
import { tokenUtils } from './utils/token_utils';
import { provider, web3Wrapper } from './utils/web3_wrapper';
@@ -37,10 +39,15 @@ describe('ERC721Wrapper', () => {
let operatorAddress: string;
let approvedAddress: string;
let receiverAddress: string;
- const config = {
- networkId: constants.TESTRPC_NETWORK_ID,
- };
+ let config: ContractWrappersConfig;
+
before(async () => {
+ const contractAddresses = await migrateOnceAsync();
+ config = {
+ networkId: constants.TESTRPC_NETWORK_ID,
+ contractAddresses,
+ blockPollingIntervalMs: 10,
+ };
contractWrappers = new ContractWrappers(provider, config);
userAddresses = await web3Wrapper.getAvailableAddressesAsync();
tokens = tokenUtils.getDummyERC721TokenAddresses();
@@ -108,12 +115,6 @@ describe('ERC721Wrapper', () => {
tokenCount = await contractWrappers.erc721Token.getTokenCountAsync(tokenAddress, ownerAddress);
expect(tokenCount).to.be.bignumber.equal(1);
});
- it('should throw a CONTRACT_DOES_NOT_EXIST error for a non-existent token contract', async () => {
- const nonExistentTokenAddress = '0x9dd402f14d67e001d8efbe6583e51bf9706aa065';
- return expect(
- contractWrappers.erc721Token.getTokenCountAsync(nonExistentTokenAddress, ownerAddress),
- ).to.be.rejectedWith(ContractWrappersError.ERC721TokenContractDoesNotExist);
- });
it('should return a balance of 0 for a non-existent owner address', async () => {
const nonExistentOwner = '0x198c6ad858f213fb31b6fe809e25040e6b964593';
const balance = await contractWrappers.erc721Token.getTokenCountAsync(tokenAddress, nonExistentOwner);
@@ -142,13 +143,6 @@ describe('ERC721Wrapper', () => {
const tokenOwner = await contractWrappers.erc721Token.getOwnerOfAsync(tokenAddress, tokenId);
expect(tokenOwner).to.be.bignumber.equal(ownerAddress);
});
- it('should throw a CONTRACT_DOES_NOT_EXIST error for a non-existent token contract', async () => {
- const nonExistentTokenAddress = '0x9dd402f14d67e001d8efbe6583e51bf9706aa065';
- const fakeTokenId = new BigNumber(42);
- return expect(
- contractWrappers.erc721Token.getOwnerOfAsync(nonExistentTokenAddress, fakeTokenId),
- ).to.be.rejectedWith(ContractWrappersError.ERC721TokenContractDoesNotExist);
- });
it('should return undefined not 0 for a non-existent ERC721', async () => {
const fakeTokenId = new BigNumber(42);
return expect(contractWrappers.erc721Token.getOwnerOfAsync(tokenAddress, fakeTokenId)).to.be.rejectedWith(
@@ -319,7 +313,7 @@ describe('ERC721Wrapper', () => {
);
})().catch(done);
});
- it('Outstanding subscriptions are cancelled when contractWrappers.setProvider called', (done: DoneCallback) => {
+ it('Outstanding subscriptions are cancelled when contractWrappers.unsubscribeAll called', (done: DoneCallback) => {
(async () => {
const callbackNeverToBeCalled = callbackErrorReporter.reportNodeCallbackErrors(done)(
(logEvent: DecodedLogEvent<ERC721TokenApprovalEventArgs>) => {
@@ -333,7 +327,7 @@ describe('ERC721Wrapper', () => {
callbackNeverToBeCalled,
);
const callbackToBeCalled = callbackErrorReporter.reportNodeCallbackErrors(done)();
- contractWrappers.setProvider(provider, constants.TESTRPC_NETWORK_ID);
+ contractWrappers.unsubscribeAll();
contractWrappers.erc721Token.subscribe(
tokenAddress,
ERC721TokenEvents.Approval,
diff --git a/packages/contract-wrappers/test/ether_token_wrapper_test.ts b/packages/contract-wrappers/test/ether_token_wrapper_test.ts
index c48fc224f..e3efef19d 100644
--- a/packages/contract-wrappers/test/ether_token_wrapper_test.ts
+++ b/packages/contract-wrappers/test/ether_token_wrapper_test.ts
@@ -1,7 +1,8 @@
-import { BlockchainLifecycle, callbackErrorReporter } from '@0xproject/dev-utils';
-import { DoneCallback } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { ContractAddresses } from '@0x/contract-addresses';
+import { BlockchainLifecycle, callbackErrorReporter } from '@0x/dev-utils';
+import { DoneCallback } from '@0x/types';
+import { BigNumber } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import * as chai from 'chai';
import 'mocha';
@@ -16,12 +17,11 @@ import {
WETH9TransferEventArgs,
WETH9WithdrawalEventArgs,
} from '../src';
-
import { DecodedLogEvent } from '../src/types';
import { chaiSetup } from './utils/chai_setup';
import { constants } from './utils/constants';
-import { tokenUtils } from './utils/token_utils';
+import { migrateOnceAsync } from './utils/migrate';
import { provider, web3Wrapper } from './utils/web3_wrapper';
chaiSetup.configure();
@@ -36,6 +36,7 @@ const MAX_REASONABLE_GAS_COST_IN_WEI = 62517;
describe('EtherTokenWrapper', () => {
let contractWrappers: ContractWrappers;
+ let contractAddresses: ContractAddresses;
let userAddresses: string[];
let addressWithETH: string;
let wethContractAddress: string;
@@ -43,19 +44,22 @@ describe('EtherTokenWrapper', () => {
const decimalPlaces = 7;
let addressWithoutFunds: string;
const gasPrice = new BigNumber(1);
- const zeroExConfig = {
- gasPrice,
- networkId: constants.TESTRPC_NETWORK_ID,
- };
const transferAmount = new BigNumber(42);
const allowanceAmount = new BigNumber(42);
const depositAmount = new BigNumber(42);
const withdrawalAmount = new BigNumber(42);
before(async () => {
- contractWrappers = new ContractWrappers(provider, zeroExConfig);
+ contractAddresses = await migrateOnceAsync();
+ const config = {
+ gasPrice,
+ networkId: constants.TESTRPC_NETWORK_ID,
+ contractAddresses,
+ blockPollingIntervalMs: 10,
+ };
+ contractWrappers = new ContractWrappers(provider, config);
userAddresses = await web3Wrapper.getAvailableAddressesAsync();
addressWithETH = userAddresses[0];
- wethContractAddress = contractWrappers.etherToken.getContractAddressIfExists() as string;
+ wethContractAddress = contractAddresses.etherToken;
depositWeiAmount = Web3Wrapper.toWei(new BigNumber(5));
addressWithoutFunds = userAddresses[1];
});
@@ -67,7 +71,7 @@ describe('EtherTokenWrapper', () => {
});
describe('#getContractAddressIfExists', async () => {
it('should return contract address if connected to a known network', () => {
- const contractAddressIfExists = contractWrappers.etherToken.getContractAddressIfExists();
+ const contractAddressIfExists = contractAddresses.etherToken;
expect(contractAddressIfExists).to.not.be.undefined();
});
it('should throw if connected to a private network and contract addresses are not specified', () => {
@@ -172,7 +176,7 @@ describe('EtherTokenWrapper', () => {
const indexFilterValues = {};
let etherTokenAddress: string;
before(async () => {
- etherTokenAddress = tokenUtils.getWethTokenAddress();
+ etherTokenAddress = contractAddresses.etherToken;
});
afterEach(() => {
contractWrappers.etherToken.unsubscribeAll();
@@ -279,7 +283,7 @@ describe('EtherTokenWrapper', () => {
await contractWrappers.etherToken.withdrawAsync(etherTokenAddress, withdrawalAmount, addressWithETH);
})().catch(done);
});
- it('should cancel outstanding subscriptions when ZeroEx.setProvider is called', (done: DoneCallback) => {
+ it('should cancel outstanding subscriptions when contractWrappers.unsubscribeAll is called', (done: DoneCallback) => {
(async () => {
const callbackNeverToBeCalled = callbackErrorReporter.reportNodeCallbackErrors(done)(
(_logEvent: DecodedLogEvent<WETH9ApprovalEventArgs>) => {
@@ -293,7 +297,7 @@ describe('EtherTokenWrapper', () => {
callbackNeverToBeCalled,
);
const callbackToBeCalled = callbackErrorReporter.reportNodeCallbackErrors(done)();
- contractWrappers.setProvider(provider, constants.TESTRPC_NETWORK_ID);
+ contractWrappers.unsubscribeAll();
await contractWrappers.etherToken.depositAsync(etherTokenAddress, transferAmount, addressWithETH);
contractWrappers.etherToken.subscribe(
etherTokenAddress,
@@ -341,8 +345,8 @@ describe('EtherTokenWrapper', () => {
let txHash: string;
before(async () => {
addressWithETH = userAddresses[0];
- etherTokenAddress = tokenUtils.getWethTokenAddress();
- erc20ProxyAddress = contractWrappers.erc20Proxy.getContractAddress();
+ etherTokenAddress = contractAddresses.etherToken;
+ erc20ProxyAddress = contractWrappers.erc20Proxy.address;
// Start the block range after all migrations to avoid unexpected logs
const currentBlock: number = await web3Wrapper.getBlockNumberAsync();
const fromBlock = currentBlock + 1;
diff --git a/packages/contract-wrappers/test/exchange_wrapper_test.ts b/packages/contract-wrappers/test/exchange_wrapper_test.ts
index b3bd7c633..73ce6c743 100644
--- a/packages/contract-wrappers/test/exchange_wrapper_test.ts
+++ b/packages/contract-wrappers/test/exchange_wrapper_test.ts
@@ -1,8 +1,8 @@
-import { BlockchainLifecycle, callbackErrorReporter } from '@0xproject/dev-utils';
-import { FillScenarios } from '@0xproject/fill-scenarios';
-import { assetDataUtils, orderHashUtils } from '@0xproject/order-utils';
-import { DoneCallback, SignedOrder } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
+import { BlockchainLifecycle, callbackErrorReporter } from '@0x/dev-utils';
+import { FillScenarios } from '@0x/fill-scenarios';
+import { assetDataUtils, orderHashUtils } from '@0x/order-utils';
+import { DoneCallback, RevertReason, SignedOrder } from '@0x/types';
+import { BigNumber } from '@0x/utils';
import * as chai from 'chai';
import { BlockParamLiteral } from 'ethereum-types';
import 'mocha';
@@ -12,6 +12,7 @@ import { DecodedLogEvent } from '../src/types';
import { chaiSetup } from './utils/chai_setup';
import { constants } from './utils/constants';
+import { migrateOnceAsync } from './utils/migrate';
import { tokenUtils } from './utils/token_utils';
import { provider, web3Wrapper } from './utils/web3_wrapper';
@@ -27,37 +28,38 @@ describe('ExchangeWrapper', () => {
let exchangeContractAddress: string;
let makerTokenAddress: string;
let takerTokenAddress: string;
- let coinbase: string;
let makerAddress: string;
let anotherMakerAddress: string;
let takerAddress: string;
let makerAssetData: string;
let takerAssetData: string;
- let feeRecipient: string;
let txHash: string;
const fillableAmount = new BigNumber(5);
const takerTokenFillAmount = new BigNumber(5);
let signedOrder: SignedOrder;
let anotherSignedOrder: SignedOrder;
- const config = {
- networkId: constants.TESTRPC_NETWORK_ID,
- blockPollingIntervalMs: 0,
- };
+
before(async () => {
+ const contractAddresses = await migrateOnceAsync();
await blockchainLifecycle.startAsync();
+ const config = {
+ networkId: constants.TESTRPC_NETWORK_ID,
+ contractAddresses,
+ blockPollingIntervalMs: 10,
+ };
contractWrappers = new ContractWrappers(provider, config);
- exchangeContractAddress = contractWrappers.exchange.getContractAddress();
+ exchangeContractAddress = contractWrappers.exchange.address;
userAddresses = await web3Wrapper.getAvailableAddressesAsync();
- zrxTokenAddress = tokenUtils.getProtocolTokenAddress();
+ zrxTokenAddress = contractWrappers.exchange.zrxTokenAddress;
fillScenarios = new FillScenarios(
provider,
userAddresses,
zrxTokenAddress,
exchangeContractAddress,
- contractWrappers.erc20Proxy.getContractAddress(),
- contractWrappers.erc721Proxy.getContractAddress(),
+ contractWrappers.erc20Proxy.address,
+ contractWrappers.erc721Proxy.address,
);
- [coinbase, makerAddress, takerAddress, feeRecipient, anotherMakerAddress] = userAddresses;
+ [, makerAddress, takerAddress, , anotherMakerAddress] = userAddresses;
[makerTokenAddress, takerTokenAddress] = tokenUtils.getDummyERC20TokenAddresses();
[makerAssetData, takerAssetData] = [
assetDataUtils.encodeERC20AssetData(makerTokenAddress),
@@ -280,6 +282,19 @@ describe('ExchangeWrapper', () => {
expect(ordersInfo[1].orderHash).to.be.equal(anotherOrderHash);
});
});
+ describe('#validateOrderFillableOrThrowAsync', () => {
+ it('should throw if signature is invalid', async () => {
+ const signedOrderWithInvalidSignature = {
+ ...signedOrder,
+ signature:
+ '0x1b61a3ed31b43c8780e905a260a35faefcc527be7516aa11c0256729b5b351bc3340349190569279751135161d22529dc25add4f6069af05be04cacbda2ace225403',
+ };
+
+ expect(
+ contractWrappers.exchange.validateOrderFillableOrThrowAsync(signedOrderWithInvalidSignature),
+ ).to.eventually.to.be.rejectedWith(RevertReason.InvalidOrderSignature);
+ });
+ });
describe('#isValidSignature', () => {
it('should check if the signature is valid', async () => {
const orderHash = orderHashUtils.getOrderHashHex(signedOrder);
@@ -329,11 +344,11 @@ describe('ExchangeWrapper', () => {
it('should fill or kill a valid order', async () => {
const erc20ProxyId = await contractWrappers.erc20Proxy.getProxyIdAsync();
const erc20ProxyAddressById = await contractWrappers.exchange.getAssetProxyBySignatureAsync(erc20ProxyId);
- const erc20ProxyAddress = contractWrappers.erc20Proxy.getContractAddress();
+ const erc20ProxyAddress = contractWrappers.erc20Proxy.address;
expect(erc20ProxyAddressById).to.be.equal(erc20ProxyAddress);
const erc721ProxyId = await contractWrappers.erc721Proxy.getProxyIdAsync();
const erc721ProxyAddressById = await contractWrappers.exchange.getAssetProxyBySignatureAsync(erc721ProxyId);
- const erc721ProxyAddress = contractWrappers.erc721Proxy.getContractAddress();
+ const erc721ProxyAddress = contractWrappers.erc721Proxy.address;
expect(erc721ProxyAddressById).to.be.equal(erc721ProxyAddress);
});
});
@@ -408,7 +423,7 @@ describe('ExchangeWrapper', () => {
await contractWrappers.exchange.cancelOrderAsync(signedOrder);
})().catch(done);
});
- it('Outstanding subscriptions are cancelled when contractWrappers.setProvider called', (done: DoneCallback) => {
+ it('Outstanding subscriptions are cancelled when contractWrappers.unsubscribeAll called', (done: DoneCallback) => {
(async () => {
const callbackNeverToBeCalled = callbackErrorReporter.reportNodeCallbackErrors(done)(
(logEvent: DecodedLogEvent<ExchangeFillEventArgs>) => {
@@ -417,7 +432,7 @@ describe('ExchangeWrapper', () => {
);
contractWrappers.exchange.subscribe(ExchangeEvents.Fill, indexFilterValues, callbackNeverToBeCalled);
- contractWrappers.setProvider(provider, constants.TESTRPC_NETWORK_ID);
+ contractWrappers.unsubscribeAll();
const callback = callbackErrorReporter.reportNodeCallbackErrors(done)(
(logEvent: DecodedLogEvent<ExchangeFillEventArgs>) => {
@@ -454,13 +469,6 @@ describe('ExchangeWrapper', () => {
})().catch(done);
});
});
- describe('#getZRXTokenAddressAsync', () => {
- it('gets the same token as is in token registry', () => {
- const zrxAddressFromExchangeWrapper = contractWrappers.exchange.getZRXTokenAddress();
- const zrxAddress = tokenUtils.getProtocolTokenAddress();
- expect(zrxAddressFromExchangeWrapper).to.equal(zrxAddress);
- });
- });
describe('#getLogsAsync', () => {
const blockRange = {
fromBlock: 0,
diff --git a/packages/contract-wrappers/test/forwarder_wrapper_test.ts b/packages/contract-wrappers/test/forwarder_wrapper_test.ts
index 4329e8770..ff4ff8b67 100644
--- a/packages/contract-wrappers/test/forwarder_wrapper_test.ts
+++ b/packages/contract-wrappers/test/forwarder_wrapper_test.ts
@@ -1,8 +1,8 @@
-import { BlockchainLifecycle } from '@0xproject/dev-utils';
-import { FillScenarios } from '@0xproject/fill-scenarios';
-import { assetDataUtils } from '@0xproject/order-utils';
-import { SignedOrder } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
+import { BlockchainLifecycle } from '@0x/dev-utils';
+import { FillScenarios } from '@0x/fill-scenarios';
+import { assetDataUtils } from '@0x/order-utils';
+import { SignedOrder } from '@0x/types';
+import { BigNumber } from '@0x/utils';
import * as chai from 'chai';
import 'mocha';
@@ -10,6 +10,7 @@ import { ContractWrappers, OrderStatus } from '../src';
import { chaiSetup } from './utils/chai_setup';
import { constants } from './utils/constants';
+import { migrateOnceAsync } from './utils/migrate';
import { tokenUtils } from './utils/token_utils';
import { provider, web3Wrapper } from './utils/web3_wrapper';
@@ -19,21 +20,14 @@ const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
// tslint:disable:custom-no-magic-numbers
describe('ForwarderWrapper', () => {
- const contractWrappersConfig = {
- networkId: constants.TESTRPC_NETWORK_ID,
- blockPollingIntervalMs: 0,
- };
const fillableAmount = new BigNumber(5);
let contractWrappers: ContractWrappers;
let fillScenarios: FillScenarios;
let exchangeContractAddress: string;
let zrxTokenAddress: string;
let userAddresses: string[];
- let coinbase: string;
let makerAddress: string;
let takerAddress: string;
- let feeRecipient: string;
- let anotherMakerAddress: string;
let makerTokenAddress: string;
let takerTokenAddress: string;
let makerAssetData: string;
@@ -41,22 +35,28 @@ describe('ForwarderWrapper', () => {
let signedOrder: SignedOrder;
let anotherSignedOrder: SignedOrder;
before(async () => {
+ const contractAddresses = await migrateOnceAsync();
await blockchainLifecycle.startAsync();
- contractWrappers = new ContractWrappers(provider, contractWrappersConfig);
- exchangeContractAddress = contractWrappers.exchange.getContractAddress();
+ const config = {
+ networkId: constants.TESTRPC_NETWORK_ID,
+ contractAddresses,
+ blockPollingIntervalMs: 10,
+ };
+ contractWrappers = new ContractWrappers(provider, config);
+ exchangeContractAddress = contractWrappers.exchange.address;
userAddresses = await web3Wrapper.getAvailableAddressesAsync();
- zrxTokenAddress = tokenUtils.getProtocolTokenAddress();
+ zrxTokenAddress = contractWrappers.exchange.zrxTokenAddress;
fillScenarios = new FillScenarios(
provider,
userAddresses,
zrxTokenAddress,
exchangeContractAddress,
- contractWrappers.erc20Proxy.getContractAddress(),
- contractWrappers.erc721Proxy.getContractAddress(),
+ contractWrappers.erc20Proxy.address,
+ contractWrappers.erc721Proxy.address,
);
- [coinbase, makerAddress, takerAddress, feeRecipient, anotherMakerAddress] = userAddresses;
+ [, makerAddress, takerAddress] = userAddresses;
[makerTokenAddress] = tokenUtils.getDummyERC20TokenAddresses();
- takerTokenAddress = tokenUtils.getWethTokenAddress();
+ takerTokenAddress = contractWrappers.forwarder.etherTokenAddress;
[makerAssetData, takerAssetData] = [
assetDataUtils.encodeERC20AssetData(makerTokenAddress),
assetDataUtils.encodeERC20AssetData(takerTokenAddress),
diff --git a/packages/contract-wrappers/test/global_hooks.ts b/packages/contract-wrappers/test/global_hooks.ts
index 8731318e7..e23739b59 100644
--- a/packages/contract-wrappers/test/global_hooks.ts
+++ b/packages/contract-wrappers/test/global_hooks.ts
@@ -1,17 +1,6 @@
-import { devConstants } from '@0xproject/dev-utils';
-import { runV2MigrationsAsync } from '@0xproject/migrations';
-
-import { provider } from './utils/web3_wrapper';
-
-before('migrate contracts', async function(): Promise<void> {
+before('set up mocha', async function(): Promise<void> {
// HACK: Since the migrations take longer then our global mocha timeout limit
// we manually increase it for this before hook.
const mochaTestTimeoutMs = 50000;
this.timeout(mochaTestTimeoutMs); // tslint:disable-line:no-invalid-this
- const txDefaults = {
- gas: devConstants.GAS_LIMIT,
- from: devConstants.TESTRPC_FIRST_ADDRESS,
- };
- const artifactsDir = `src/artifacts`;
- await runV2MigrationsAsync(provider, artifactsDir, txDefaults);
});
diff --git a/packages/contract-wrappers/test/order_validator_wrapper_test.ts b/packages/contract-wrappers/test/order_validator_wrapper_test.ts
index baac3eeee..da3f99e72 100644
--- a/packages/contract-wrappers/test/order_validator_wrapper_test.ts
+++ b/packages/contract-wrappers/test/order_validator_wrapper_test.ts
@@ -1,8 +1,9 @@
-import { BlockchainLifecycle } from '@0xproject/dev-utils';
-import { FillScenarios } from '@0xproject/fill-scenarios';
-import { assetDataUtils } from '@0xproject/order-utils';
-import { SignedOrder } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
+import { ContractAddresses } from '@0x/contract-addresses';
+import { BlockchainLifecycle } from '@0x/dev-utils';
+import { FillScenarios } from '@0x/fill-scenarios';
+import { assetDataUtils } from '@0x/order-utils';
+import { SignedOrder } from '@0x/types';
+import { BigNumber } from '@0x/utils';
import * as chai from 'chai';
import * as _ from 'lodash';
import 'mocha';
@@ -12,6 +13,7 @@ import { OrderInfo, TraderInfo } from '../src/types';
import { chaiSetup } from './utils/chai_setup';
import { constants } from './utils/constants';
+import { migrateOnceAsync } from './utils/migrate';
import { tokenUtils } from './utils/token_utils';
import { provider, web3Wrapper } from './utils/web3_wrapper';
@@ -20,10 +22,6 @@ const expect = chai.expect;
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
describe('OrderValidator', () => {
- const contractWrappersConfig = {
- networkId: constants.TESTRPC_NETWORK_ID,
- blockPollingIntervalMs: 0,
- };
const fillableAmount = new BigNumber(5);
let contractWrappers: ContractWrappers;
let fillScenarios: FillScenarios;
@@ -42,24 +40,32 @@ describe('OrderValidator', () => {
let takerAssetData: string;
let signedOrder: SignedOrder;
let anotherSignedOrder: SignedOrder;
+ let contractAddresses: ContractAddresses;
+
before(async () => {
+ contractAddresses = await migrateOnceAsync();
await blockchainLifecycle.startAsync();
- contractWrappers = new ContractWrappers(provider, contractWrappersConfig);
- exchangeContractAddress = contractWrappers.exchange.getContractAddress();
+ const config = {
+ networkId: constants.TESTRPC_NETWORK_ID,
+ contractAddresses,
+ blockPollingIntervalMs: 10,
+ };
+ contractWrappers = new ContractWrappers(provider, config);
+ exchangeContractAddress = contractWrappers.exchange.address;
userAddresses = await web3Wrapper.getAvailableAddressesAsync();
- zrxTokenAddress = tokenUtils.getProtocolTokenAddress();
+ zrxTokenAddress = contractWrappers.exchange.zrxTokenAddress;
zrxTokenAssetData = assetDataUtils.encodeERC20AssetData(zrxTokenAddress);
fillScenarios = new FillScenarios(
provider,
userAddresses,
zrxTokenAddress,
exchangeContractAddress,
- contractWrappers.erc20Proxy.getContractAddress(),
- contractWrappers.erc721Proxy.getContractAddress(),
+ contractWrappers.erc20Proxy.address,
+ contractWrappers.erc721Proxy.address,
);
[coinbase, makerAddress, takerAddress, feeRecipient, anotherMakerAddress] = userAddresses;
[makerTokenAddress] = tokenUtils.getDummyERC20TokenAddresses();
- takerTokenAddress = tokenUtils.getWethTokenAddress();
+ takerTokenAddress = contractAddresses.etherToken;
[makerAssetData, takerAssetData] = [
assetDataUtils.encodeERC20AssetData(makerTokenAddress),
assetDataUtils.encodeERC20AssetData(takerTokenAddress),
diff --git a/packages/contract-wrappers/test/revert_validation_test.ts b/packages/contract-wrappers/test/revert_validation_test.ts
index da011c1d7..efd5dd61f 100644
--- a/packages/contract-wrappers/test/revert_validation_test.ts
+++ b/packages/contract-wrappers/test/revert_validation_test.ts
@@ -1,10 +1,10 @@
-import { BlockchainLifecycle, devConstants, web3Factory } from '@0xproject/dev-utils';
-import { FillScenarios } from '@0xproject/fill-scenarios';
-import { runV2MigrationsAsync } from '@0xproject/migrations';
-import { assetDataUtils } from '@0xproject/order-utils';
-import { SignedOrder } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { BlockchainLifecycle, devConstants, web3Factory } from '@0x/dev-utils';
+import { FillScenarios } from '@0x/fill-scenarios';
+import { runMigrationsAsync } from '@0x/migrations';
+import { assetDataUtils } from '@0x/order-utils';
+import { SignedOrder } from '@0x/types';
+import { BigNumber } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import * as chai from 'chai';
import 'mocha';
@@ -20,28 +20,19 @@ const expect = chai.expect;
describe('Revert Validation ExchangeWrapper', () => {
let contractWrappers: ContractWrappers;
let userAddresses: string[];
- let zrxTokenAddress: string;
let fillScenarios: FillScenarios;
- let exchangeContractAddress: string;
let makerTokenAddress: string;
let takerTokenAddress: string;
- let coinbase: string;
let makerAddress: string;
- let anotherMakerAddress: string;
let takerAddress: string;
let makerAssetData: string;
let takerAssetData: string;
- let feeRecipient: string;
let txHash: string;
let blockchainLifecycle: BlockchainLifecycle;
let web3Wrapper: Web3Wrapper;
const fillableAmount = new BigNumber(5);
const takerTokenFillAmount = new BigNumber(5);
let signedOrder: SignedOrder;
- const config = {
- networkId: constants.TESTRPC_NETWORK_ID,
- blockPollingIntervalMs: 0,
- };
before(async () => {
// vmErrorsOnRPCResponse is useful for quick feedback and testing during development
// but is not the default behaviour in production. Here we ensure our failure cases
@@ -52,29 +43,31 @@ describe('Revert Validation ExchangeWrapper', () => {
});
web3Wrapper = new Web3Wrapper(provider);
blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
+ // Re-deploy the artifacts in this provider, rather than in the default provider exposed in
+ // the beforeAll hook. This is due to the fact that the default provider enabled vmErrorsOnRPCResponse
+ // and we are explicity testing with vmErrorsOnRPCResponse disabled.
const txDefaults = {
gas: devConstants.GAS_LIMIT,
from: devConstants.TESTRPC_FIRST_ADDRESS,
};
- const artifactsDir = `src/artifacts`;
- // Re-deploy the artifacts in this provider, rather than in the default provider exposed in
- // the beforeAll hook. This is due to the fact that the default provider enabled vmErrorsOnRPCResponse
- // and we are explicity testing with vmErrorsOnRPCResponse disabled.
- await runV2MigrationsAsync(provider, artifactsDir, txDefaults);
await blockchainLifecycle.startAsync();
+ const contractAddresses = await runMigrationsAsync(provider, txDefaults);
+ const config = {
+ networkId: constants.TESTRPC_NETWORK_ID,
+ contractAddresses,
+ blockPollingIntervalMs: 10,
+ };
contractWrappers = new ContractWrappers(provider, config);
- exchangeContractAddress = contractWrappers.exchange.getContractAddress();
userAddresses = await web3Wrapper.getAvailableAddressesAsync();
- zrxTokenAddress = tokenUtils.getProtocolTokenAddress();
fillScenarios = new FillScenarios(
provider,
userAddresses,
- zrxTokenAddress,
- exchangeContractAddress,
- contractWrappers.erc20Proxy.getContractAddress(),
- contractWrappers.erc721Proxy.getContractAddress(),
+ contractAddresses.zrxToken,
+ contractAddresses.exchange,
+ contractAddresses.erc20Proxy,
+ contractAddresses.erc721Proxy,
);
- [coinbase, makerAddress, takerAddress, feeRecipient, anotherMakerAddress] = userAddresses;
+ [, makerAddress, takerAddress] = userAddresses;
[makerTokenAddress, takerTokenAddress] = tokenUtils.getDummyERC20TokenAddresses();
[makerAssetData, takerAssetData] = [
assetDataUtils.encodeERC20AssetData(makerTokenAddress),
@@ -112,7 +105,7 @@ describe('Revert Validation ExchangeWrapper', () => {
makerTokenBalance,
);
await web3Wrapper.awaitTransactionSuccessAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS);
- expect(
+ return expect(
contractWrappers.exchange.fillOrderAsync(signedOrder, takerTokenFillAmount, takerAddress, {
shouldValidate: true,
}),
diff --git a/packages/contract-wrappers/test/subscription_test.ts b/packages/contract-wrappers/test/subscription_test.ts
index 6ec7519fe..0fa6af40d 100644
--- a/packages/contract-wrappers/test/subscription_test.ts
+++ b/packages/contract-wrappers/test/subscription_test.ts
@@ -1,14 +1,20 @@
-import { BlockchainLifecycle } from '@0xproject/dev-utils';
-import { DoneCallback } from '@0xproject/types';
+import { BlockchainLifecycle } from '@0x/dev-utils';
+import { DoneCallback } from '@0x/types';
import * as _ from 'lodash';
import 'mocha';
import * as Sinon from 'sinon';
-import { ContractWrappers, ERC20TokenApprovalEventArgs, ERC20TokenEvents } from '../src';
-import { DecodedLogEvent } from '../src/types';
+import {
+ ContractWrappers,
+ ContractWrappersConfig,
+ DecodedLogEvent,
+ ERC20TokenApprovalEventArgs,
+ ERC20TokenEvents,
+} from '../src';
import { chaiSetup } from './utils/chai_setup';
import { constants } from './utils/constants';
+import { migrateOnceAsync } from './utils/migrate';
import { tokenUtils } from './utils/token_utils';
import { provider, web3Wrapper } from './utils/web3_wrapper';
@@ -17,10 +23,14 @@ const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
describe('SubscriptionTest', () => {
let contractWrappers: ContractWrappers;
- const config = {
- networkId: constants.TESTRPC_NETWORK_ID,
- };
+ let config: ContractWrappersConfig;
+
before(async () => {
+ const contractAddresses = await migrateOnceAsync();
+ config = {
+ networkId: constants.TESTRPC_NETWORK_ID,
+ contractAddresses,
+ };
contractWrappers = new ContractWrappers(provider, config);
});
beforeEach(async () => {
diff --git a/packages/contract-wrappers/test/transaction_encoder_test.ts b/packages/contract-wrappers/test/transaction_encoder_test.ts
index 9da8fe2ca..ef9eb2cf3 100644
--- a/packages/contract-wrappers/test/transaction_encoder_test.ts
+++ b/packages/contract-wrappers/test/transaction_encoder_test.ts
@@ -1,14 +1,15 @@
-import { BlockchainLifecycle } from '@0xproject/dev-utils';
-import { FillScenarios } from '@0xproject/fill-scenarios';
-import { assetDataUtils, generatePseudoRandomSalt, orderHashUtils, signatureUtils } from '@0xproject/order-utils';
-import { SignedOrder } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
+import { BlockchainLifecycle } from '@0x/dev-utils';
+import { FillScenarios } from '@0x/fill-scenarios';
+import { assetDataUtils, generatePseudoRandomSalt, orderHashUtils, signatureUtils } from '@0x/order-utils';
+import { SignedOrder } from '@0x/types';
+import { BigNumber } from '@0x/utils';
import 'mocha';
import { ContractWrappers } from '../src';
import { TransactionEncoder } from '../src/utils/transaction_encoder';
import { constants } from './utils/constants';
+import { migrateOnceAsync } from './utils/migrate';
import { tokenUtils } from './utils/token_utils';
import { provider, web3Wrapper } from './utils/web3_wrapper';
@@ -31,23 +32,26 @@ describe('TransactionEncoder', () => {
const fillableAmount = new BigNumber(5);
const takerTokenFillAmount = new BigNumber(5);
let signedOrder: SignedOrder;
- const config = {
- networkId: constants.TESTRPC_NETWORK_ID,
- blockPollingIntervalMs: 0,
- };
+
before(async () => {
+ const contractAddresses = await migrateOnceAsync();
await blockchainLifecycle.startAsync();
+ const config = {
+ networkId: constants.TESTRPC_NETWORK_ID,
+ contractAddresses,
+ blockPollingIntervalMs: 10,
+ };
contractWrappers = new ContractWrappers(provider, config);
- exchangeContractAddress = contractWrappers.exchange.getContractAddress();
+ exchangeContractAddress = contractWrappers.exchange.address;
userAddresses = await web3Wrapper.getAvailableAddressesAsync();
- const zrxTokenAddress = tokenUtils.getProtocolTokenAddress();
+ const zrxTokenAddress = contractWrappers.exchange.zrxTokenAddress;
fillScenarios = new FillScenarios(
provider,
userAddresses,
zrxTokenAddress,
exchangeContractAddress,
- contractWrappers.erc20Proxy.getContractAddress(),
- contractWrappers.erc721Proxy.getContractAddress(),
+ contractWrappers.erc20Proxy.address,
+ contractWrappers.erc721Proxy.address,
);
[coinbase, makerAddress, takerAddress, senderAddress] = userAddresses;
[makerTokenAddress, takerTokenAddress] = tokenUtils.getDummyERC20TokenAddresses();
diff --git a/packages/contract-wrappers/test/utils/constants.ts b/packages/contract-wrappers/test/utils/constants.ts
index f38728b77..ca6c574e4 100644
--- a/packages/contract-wrappers/test/utils/constants.ts
+++ b/packages/contract-wrappers/test/utils/constants.ts
@@ -1,4 +1,4 @@
-import { BigNumber } from '@0xproject/utils';
+import { BigNumber } from '@0x/utils';
export const constants = {
NULL_ADDRESS: '0x0000000000000000000000000000000000000000',
diff --git a/packages/contract-wrappers/test/utils/migrate.ts b/packages/contract-wrappers/test/utils/migrate.ts
new file mode 100644
index 000000000..665ce0faa
--- /dev/null
+++ b/packages/contract-wrappers/test/utils/migrate.ts
@@ -0,0 +1,18 @@
+import { ContractAddresses } from '@0x/contract-addresses';
+import { devConstants } from '@0x/dev-utils';
+import { runMigrationsOnceAsync } from '@0x/migrations';
+
+import { provider } from './web3_wrapper';
+
+/**
+ * Configures and runs the migrations exactly once. Any subsequent times this is
+ * called, it returns the cached addresses.
+ * @returns The addresses of contracts that were deployed during the migrations.
+ */
+export async function migrateOnceAsync(): Promise<ContractAddresses> {
+ const txDefaults = {
+ gas: devConstants.GAS_LIMIT,
+ from: devConstants.TESTRPC_FIRST_ADDRESS,
+ };
+ return runMigrationsOnceAsync(provider, txDefaults);
+}
diff --git a/packages/contract-wrappers/test/utils/token_utils.ts b/packages/contract-wrappers/test/utils/token_utils.ts
index 06a82ff6e..f8a88637f 100644
--- a/packages/contract-wrappers/test/utils/token_utils.ts
+++ b/packages/contract-wrappers/test/utils/token_utils.ts
@@ -1,14 +1,13 @@
-import { generatePseudoRandomSalt } from '@0xproject/order-utils';
-import { BigNumber } from '@0xproject/utils';
+import { DummyERC721TokenContract } from '@0x/abi-gen-wrappers';
+import { DummyERC721Token } from '@0x/contract-artifacts';
+import { generatePseudoRandomSalt } from '@0x/order-utils';
+import { BigNumber } from '@0x/utils';
-import { artifacts } from '../../src/artifacts';
-import { DummyERC721TokenContract } from '../../src/contract_wrappers/generated/dummy_erc721_token';
-
-import { constants } from './constants';
import { provider, txDefaults, web3Wrapper } from './web3_wrapper';
// Those addresses come from migrations. They're deterministic so it's relatively safe to hard-code them here.
// 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',
@@ -20,12 +19,6 @@ const DUMMY_ERC_20_ADRESSES = [
const DUMMY_ERC_721_ADRESSES = ['0x131855dda0aaff096f6854854c55a4debf61077a'];
export const tokenUtils = {
- getProtocolTokenAddress(): string {
- return artifacts.ZRXToken.networks[constants.TESTRPC_NETWORK_ID].address;
- },
- getWethTokenAddress(): string {
- return artifacts.EtherToken.networks[constants.TESTRPC_NETWORK_ID].address;
- },
getDummyERC20TokenAddresses(): string[] {
return DUMMY_ERC_20_ADRESSES;
},
@@ -33,12 +26,7 @@ export const tokenUtils = {
return DUMMY_ERC_721_ADRESSES;
},
async mintDummyERC721Async(address: string, tokenOwner: string): Promise<BigNumber> {
- const erc721 = new DummyERC721TokenContract(
- artifacts.DummyERC721Token.compilerOutput.abi,
- address,
- provider,
- txDefaults,
- );
+ const erc721 = new DummyERC721TokenContract(DummyERC721Token.compilerOutput.abi, address, provider, txDefaults);
const tokenId = generatePseudoRandomSalt();
const txHash = await erc721.mint.sendTransactionAsync(tokenOwner, tokenId);
web3Wrapper.awaitTransactionSuccessAsync(txHash);
diff --git a/packages/contract-wrappers/test/utils/web3_wrapper.ts b/packages/contract-wrappers/test/utils/web3_wrapper.ts
index 02c8c5918..4e86ebeba 100644
--- a/packages/contract-wrappers/test/utils/web3_wrapper.ts
+++ b/packages/contract-wrappers/test/utils/web3_wrapper.ts
@@ -1,5 +1,5 @@
-import { devConstants, web3Factory } from '@0xproject/dev-utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { devConstants, web3Factory } from '@0x/dev-utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import { Provider } from 'ethereum-types';
const txDefaults = {
diff --git a/packages/contract-wrappers/tslint.json b/packages/contract-wrappers/tslint.json
index ffaefe83a..dd9053357 100644
--- a/packages/contract-wrappers/tslint.json
+++ b/packages/contract-wrappers/tslint.json
@@ -1,3 +1,3 @@
{
- "extends": ["@0xproject/tslint-config"]
+ "extends": ["@0x/tslint-config"]
}
diff --git a/packages/contract_templates/README.md b/packages/contract_templates/README.md
index e5f4b09d1..c6cc3b1b3 100644
--- a/packages/contract_templates/README.md
+++ b/packages/contract_templates/README.md
@@ -2,7 +2,7 @@ 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 @0xproject/base-contract @0xproject/sol-compiler @0xproject/utils @0xproject/web3-wrapper ethereum-types ethers lodash`
+* 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:
@@ -10,7 +10,7 @@ To successfully compile the generated TypeScript contract wrappers, you must:
"compilerOptions": {
"lib": ["ES2015"],
"typeRoots": [
- "node_modules/@0xproject/typescript-typings/types",
+ "node_modules/@0x/typescript-typings/types",
"node_modules/@types"
]
}
diff --git a/packages/contract_templates/contract.handlebars b/packages/contract_templates/contract.handlebars
index 41e5c8630..9c1952ed4 100644
--- a/packages/contract_templates/contract.handlebars
+++ b/packages/contract_templates/contract.handlebars
@@ -1,10 +1,10 @@
// 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 '@0xproject/base-contract';
+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 '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { BigNumber, classUtils, logUtils } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import * as ethers from 'ethers';
import * as _ from 'lodash';
// tslint:enable:no-unused-variable
diff --git a/packages/contracts/.solhintignore b/packages/contracts/.solhintignore
new file mode 100644
index 000000000..1e33ec53b
--- /dev/null
+++ b/packages/contracts/.solhintignore
@@ -0,0 +1,3 @@
+contracts/tokens/ZRXToken/ERC20Token_v1.sol
+contracts/tokens/ZRXToken/Token_v1.sol
+contracts/tokens/ZRXToken/UnlimitedAllowanceToken_v1.sol
diff --git a/packages/contracts/CHANGELOG.json b/packages/contracts/CHANGELOG.json
new file mode 100644
index 000000000..3f57a33d6
--- /dev/null
+++ b/packages/contracts/CHANGELOG.json
@@ -0,0 +1,115 @@
+[
+ {
+ "name": "Forwarder",
+ "version": "1.1.0",
+ "changes": [
+ {
+ "note": "Round up when calculating remaining amounts in marketBuy functions",
+ "pr": 1162,
+ "networks": {
+ "1": "0x5468a1dc173652ee28d249c271fa9933144746b1",
+ "3": "0x2240dab907db71e64d3e0dba4800c83b5c502d4e",
+ "42": "0x17992e4ffb22730138e4b62aaa6367fa9d3699a6"
+ }
+ }
+ ]
+ },
+ {
+ "name": "Forwarder",
+ "version": "1.0.0",
+ "changes": [
+ {
+ "note": "protocol v2 deploy",
+ "networks": {
+ "1": "0x7afc2d5107af94c462a194d2c21b5bdd238709d6",
+ "3": "0x3983e204b12b3c02fb0638caf2cd406a62e0ead3",
+ "42": "0xd85e2fa7e7e252b27b01bf0d65c946959d2f45b8"
+ }
+ }
+ ]
+ },
+ {
+ "name": "OrderValidator",
+ "version": "1.0.0",
+ "changes": [
+ {
+ "note": "protocol v2 deploy",
+ "networks": {
+ "1": "0x9463e518dea6810309563c81d5266c1b1d149138",
+ "3": "0x90431a90516ab49af23a0530e04e8c7836e7122f",
+ "42": "0xb389da3d204b412df2f75c6afb3d0a7ce0bc283d"
+ }
+ }
+ ]
+ },
+ {
+ "name": "Exchange",
+ "version": "2.0.0",
+ "changes": [
+ {
+ "note": "protocol v2 deploy",
+ "networks": {
+ "1": "0x4f833a24e1f95d70f028921e27040ca56e09ab0b",
+ "3": "0x4530c0483a1633c7a1c97d2c53721caff2caaaaf",
+ "42": "0x35dd2932454449b14cee11a94d3674a936d5d7b2"
+ }
+ }
+ ]
+ },
+ {
+ "name": "ERC20Proxy",
+ "version": "1.0.0",
+ "changes": [
+ {
+ "note": "protocol v2 deploy",
+ "networks": {
+ "1": "0x2240dab907db71e64d3e0dba4800c83b5c502d4e",
+ "3": "0xb1408f4c245a23c31b98d2c626777d4c0d766caa",
+ "42": "0xf1ec01d6236d3cd881a0bf0130ea25fe4234003e"
+ }
+ }
+ ]
+ },
+ {
+ "name": "ERC721Proxy",
+ "version": "1.0.0",
+ "changes": [
+ {
+ "note": "protocol v2 deploy",
+ "networks": {
+ "1": "0x208e41fb445f1bb1b6780d58356e81405f3e6127",
+ "3": "0xe654aac058bfbf9f83fcaee7793311dd82f6ddb4",
+ "42": "0x2a9127c745688a165106c11cd4d647d2220af821"
+ }
+ }
+ ]
+ },
+ {
+ "name": "AssetProxyOwner",
+ "version": "1.0.0",
+ "changes": [
+ {
+ "note": "protocol v2 deploy",
+ "networks": {
+ "1": "0x17992e4ffb22730138e4b62aaa6367fa9d3699a6",
+ "3": "0xf5fa5b5fed2727a0e44ac67f6772e97977aa358b",
+ "42": "0x2c824d2882baa668e0d5202b1e7f2922278703f8"
+ }
+ }
+ ]
+ },
+ {
+ "name": "ZRXToken",
+ "version": "1.0.0",
+ "changes": [
+ {
+ "note": "protocol v1 deploy",
+ "networks": {
+ "1": "0xe41d2489571d322189246dafa5ebde1f4699f498",
+ "3": "0xff67881f8d12f372d91baae9752eb3631ff0ed00",
+ "42": "0x2002d3812f58e35f0ea1ffbf80a75a38c32175fa"
+ }
+ }
+ ]
+ }
+]
diff --git a/packages/contracts/README.md b/packages/contracts/README.md
index 33cbdae26..97a2816ff 100644
--- a/packages/contracts/README.md
+++ b/packages/contracts/README.md
@@ -1,32 +1,26 @@
## Contracts
-Smart contracts that implement the 0x protocol. Addresses of the deployed contracts can be found [here](https://0xproject.com/wiki#Deployed-Addresses).
+Smart contracts that implement the 0x protocol. Addresses of the deployed contracts can be found in the 0x [wiki](https://0xproject.com/wiki#Deployed-Addresses) or the [CHANGELOG](./CHANGELOG.json) of this package.
## Usage
-### 2.0.0
+Contracts that make up and interact with version 2.0.0 of the protocol can be found in the [contracts](./contracts) directory. The contents of this directory are broken down into the following subdirectories:
-Contracts that make up and interact with version 2.0.0 of the protocol can be found in the `src/2.0.0` directory. The contents of this directory are broken down into the following subdirectories:
-
-* protocol
+* [protocol](./contracts/protocol)
* This directory contains the contracts that make up version 2.0.0. A full specification can be found [here](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md).
-* extensions
+* [extensions](./contracts/extensions)
* This directory contains contracts that interact with the 2.0.0 contracts and will be used in production, such as the [Forwarder](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/forwarder-specification.md) contract.
-* examples
+* [examples](./contracts/examples)
* This directory contains example implementations of contracts that interact with the protocol but are _not_ intended for use in production. Examples include [filter](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md#filter-contracts) contracts, a [Wallet](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md#wallet) contract, and a [Validator](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md#validator) contract, among others.
-* tokens
+* [tokens](./contracts/tokens)
* This directory contains implementations of different tokens and token standards, including [wETH](https://weth.io/), ZRX, [ERC20](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md), and [ERC721](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md).
-* multisig
+* [multisig](./contracts/multisig)
* This directory contains the [Gnosis MultiSigWallet](https://github.com/gnosis/MultiSigWallet) and a custom extension that adds a timelock to transactions within the MultiSigWallet.
-* utils
+* [utils](./contracts/utils)
* This directory contains libraries and utils that are shared across all of the other directories.
-* test
+* [test](./contracts/test)
* This directory contains mocks and other contracts that are used solely for testing contracts within the other directories.
-### 1.0.0
-
-Contracts that make up version 1.0.0 of the protocol can be found in `src/1.0.0`. These contracts are considered deprecated and will have limited support going forward.
-
## Bug bounty
A bug bounty for the 2.0.0 contracts is ongoing! Instructions can be found [here](https://0xproject.com/wiki#Bug-Bounty).
@@ -107,7 +101,7 @@ TEST_PROVIDER=geth yarn test
###### Code coverage
-In order to see the Solidity code coverage output generated by `@0xproject/sol-cov`, run:
+In order to see the Solidity code coverage output generated by `@0x/sol-cov`, run:
```
yarn test:coverage
diff --git a/packages/contracts/compiler.json b/packages/contracts/compiler.json
index 559b7cd1f..af3980b4e 100644
--- a/packages/contracts/compiler.json
+++ b/packages/contracts/compiler.json
@@ -1,6 +1,6 @@
{
- "artifactsDir": "../migrations/artifacts/development",
- "contractsDir": "src/",
+ "artifactsDir": "./generated-artifacts",
+ "contractsDir": "./contracts",
"compilerSettings": {
"optimizer": {
"enabled": true,
@@ -50,7 +50,6 @@
"TestExchangeInternals",
"TestSignatureValidator",
"TestStaticCallReceiver",
- "TokenRegistry",
"Validator",
"Wallet",
"WETH9",
diff --git a/packages/contracts/src/2.0.0/examples/ExchangeWrapper/ExchangeWrapper.sol b/packages/contracts/contracts/examples/ExchangeWrapper/ExchangeWrapper.sol
index 2fa0e3c5e..2fa0e3c5e 100644
--- a/packages/contracts/src/2.0.0/examples/ExchangeWrapper/ExchangeWrapper.sol
+++ b/packages/contracts/contracts/examples/ExchangeWrapper/ExchangeWrapper.sol
diff --git a/packages/contracts/src/2.0.0/examples/Validator/Validator.sol b/packages/contracts/contracts/examples/Validator/Validator.sol
index 72ed528ba..72ed528ba 100644
--- a/packages/contracts/src/2.0.0/examples/Validator/Validator.sol
+++ b/packages/contracts/contracts/examples/Validator/Validator.sol
diff --git a/packages/contracts/src/2.0.0/examples/Wallet/Wallet.sol b/packages/contracts/contracts/examples/Wallet/Wallet.sol
index b75021a31..b75021a31 100644
--- a/packages/contracts/src/2.0.0/examples/Wallet/Wallet.sol
+++ b/packages/contracts/contracts/examples/Wallet/Wallet.sol
diff --git a/packages/contracts/src/2.0.0/examples/Whitelist/Whitelist.sol b/packages/contracts/contracts/examples/Whitelist/Whitelist.sol
index e4e25038c..e4e25038c 100644
--- a/packages/contracts/src/2.0.0/examples/Whitelist/Whitelist.sol
+++ b/packages/contracts/contracts/examples/Whitelist/Whitelist.sol
diff --git a/packages/contracts/src/2.0.0/extensions/Forwarder/Forwarder.sol b/packages/contracts/contracts/extensions/Forwarder/Forwarder.sol
index 94dec40ed..94dec40ed 100644
--- a/packages/contracts/src/2.0.0/extensions/Forwarder/Forwarder.sol
+++ b/packages/contracts/contracts/extensions/Forwarder/Forwarder.sol
diff --git a/packages/contracts/src/2.0.0/extensions/Forwarder/MixinAssets.sol b/packages/contracts/contracts/extensions/Forwarder/MixinAssets.sol
index 43efb5ff3..43efb5ff3 100644
--- a/packages/contracts/src/2.0.0/extensions/Forwarder/MixinAssets.sol
+++ b/packages/contracts/contracts/extensions/Forwarder/MixinAssets.sol
diff --git a/packages/contracts/src/2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol b/packages/contracts/contracts/extensions/Forwarder/MixinExchangeWrapper.sol
index fea9a53c2..4991c0ea5 100644
--- a/packages/contracts/src/2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol
+++ b/packages/contracts/contracts/extensions/Forwarder/MixinExchangeWrapper.sol
@@ -155,8 +155,10 @@ contract MixinExchangeWrapper is
uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);
// Convert the remaining amount of makerAsset to buy into remaining amount
- // of takerAsset to sell, assuming entire amount can be sold in the current order
- uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(
+ // of takerAsset to sell, assuming entire amount can be sold in the current order.
+ // We round up because the exchange rate computed by fillOrder rounds in favor
+ // of the Maker. In this case we want to overestimate the amount of takerAsset.
+ uint256 remainingTakerAssetFillAmount = getPartialAmountCeil(
orders[i].takerAssetAmount,
orders[i].makerAssetAmount,
remainingMakerAssetFillAmount
@@ -224,7 +226,9 @@ contract MixinExchangeWrapper is
// Convert the remaining amount of ZRX to buy into remaining amount
// of WETH to sell, assuming entire amount can be sold in the current order.
- uint256 remainingWethSellAmount = getPartialAmountFloor(
+ // We round up because the exchange rate computed by fillOrder rounds in favor
+ // of the Maker. In this case we want to overestimate the amount of takerAsset.
+ uint256 remainingWethSellAmount = getPartialAmountCeil(
orders[i].takerAssetAmount,
safeSub(orders[i].makerAssetAmount, orders[i].takerFee), // our exchange rate after fees
remainingZrxBuyAmount
@@ -233,7 +237,7 @@ contract MixinExchangeWrapper is
// Attempt to sell the remaining amount of WETH.
FillResults memory singleFillResult = fillOrderNoThrow(
orders[i],
- safeAdd(remainingWethSellAmount, 1), // we add 1 wei to the fill amount to make up for rounding errors
+ remainingWethSellAmount,
signatures[i]
);
diff --git a/packages/contracts/src/2.0.0/extensions/Forwarder/MixinForwarderCore.sol b/packages/contracts/contracts/extensions/Forwarder/MixinForwarderCore.sol
index 54487f726..54487f726 100644
--- a/packages/contracts/src/2.0.0/extensions/Forwarder/MixinForwarderCore.sol
+++ b/packages/contracts/contracts/extensions/Forwarder/MixinForwarderCore.sol
diff --git a/packages/contracts/src/2.0.0/extensions/Forwarder/MixinWeth.sol b/packages/contracts/contracts/extensions/Forwarder/MixinWeth.sol
index d2814a49b..d2814a49b 100644
--- a/packages/contracts/src/2.0.0/extensions/Forwarder/MixinWeth.sol
+++ b/packages/contracts/contracts/extensions/Forwarder/MixinWeth.sol
diff --git a/packages/contracts/src/2.0.0/extensions/Forwarder/interfaces/IAssets.sol b/packages/contracts/contracts/extensions/Forwarder/interfaces/IAssets.sol
index 1e034c003..1e034c003 100644
--- a/packages/contracts/src/2.0.0/extensions/Forwarder/interfaces/IAssets.sol
+++ b/packages/contracts/contracts/extensions/Forwarder/interfaces/IAssets.sol
diff --git a/packages/contracts/src/2.0.0/extensions/Forwarder/interfaces/IForwarder.sol b/packages/contracts/contracts/extensions/Forwarder/interfaces/IForwarder.sol
index f5a26e2ba..f5a26e2ba 100644
--- a/packages/contracts/src/2.0.0/extensions/Forwarder/interfaces/IForwarder.sol
+++ b/packages/contracts/contracts/extensions/Forwarder/interfaces/IForwarder.sol
diff --git a/packages/contracts/src/2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol b/packages/contracts/contracts/extensions/Forwarder/interfaces/IForwarderCore.sol
index 74c7da01d..74c7da01d 100644
--- a/packages/contracts/src/2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol
+++ b/packages/contracts/contracts/extensions/Forwarder/interfaces/IForwarderCore.sol
diff --git a/packages/contracts/src/2.0.0/extensions/Forwarder/libs/LibConstants.sol b/packages/contracts/contracts/extensions/Forwarder/libs/LibConstants.sol
index 704e42ce3..704e42ce3 100644
--- a/packages/contracts/src/2.0.0/extensions/Forwarder/libs/LibConstants.sol
+++ b/packages/contracts/contracts/extensions/Forwarder/libs/LibConstants.sol
diff --git a/packages/contracts/src/2.0.0/extensions/Forwarder/libs/LibForwarderErrors.sol b/packages/contracts/contracts/extensions/Forwarder/libs/LibForwarderErrors.sol
index fb3ade1db..fb3ade1db 100644
--- a/packages/contracts/src/2.0.0/extensions/Forwarder/libs/LibForwarderErrors.sol
+++ b/packages/contracts/contracts/extensions/Forwarder/libs/LibForwarderErrors.sol
diff --git a/packages/contracts/src/2.0.0/extensions/Forwarder/mixins/MAssets.sol b/packages/contracts/contracts/extensions/Forwarder/mixins/MAssets.sol
index 9e7f80d97..9e7f80d97 100644
--- a/packages/contracts/src/2.0.0/extensions/Forwarder/mixins/MAssets.sol
+++ b/packages/contracts/contracts/extensions/Forwarder/mixins/MAssets.sol
diff --git a/packages/contracts/src/2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol b/packages/contracts/contracts/extensions/Forwarder/mixins/MExchangeWrapper.sol
index 13c26b03a..13c26b03a 100644
--- a/packages/contracts/src/2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol
+++ b/packages/contracts/contracts/extensions/Forwarder/mixins/MExchangeWrapper.sol
diff --git a/packages/contracts/src/2.0.0/extensions/Forwarder/mixins/MWeth.sol b/packages/contracts/contracts/extensions/Forwarder/mixins/MWeth.sol
index 88e77be4e..88e77be4e 100644
--- a/packages/contracts/src/2.0.0/extensions/Forwarder/mixins/MWeth.sol
+++ b/packages/contracts/contracts/extensions/Forwarder/mixins/MWeth.sol
diff --git a/packages/contracts/src/2.0.0/extensions/OrderValidator/OrderValidator.sol b/packages/contracts/contracts/extensions/OrderValidator/OrderValidator.sol
index 8bfde3847..8bfde3847 100644
--- a/packages/contracts/src/2.0.0/extensions/OrderValidator/OrderValidator.sol
+++ b/packages/contracts/contracts/extensions/OrderValidator/OrderValidator.sol
diff --git a/packages/contracts/src/2.0.0/multisig/MultiSigWallet.sol b/packages/contracts/contracts/multisig/MultiSigWallet.sol
index 516e7391c..516e7391c 100644
--- a/packages/contracts/src/2.0.0/multisig/MultiSigWallet.sol
+++ b/packages/contracts/contracts/multisig/MultiSigWallet.sol
diff --git a/packages/contracts/src/2.0.0/multisig/MultiSigWalletWithTimeLock.sol b/packages/contracts/contracts/multisig/MultiSigWalletWithTimeLock.sol
index 9513d3b30..9513d3b30 100644
--- a/packages/contracts/src/2.0.0/multisig/MultiSigWalletWithTimeLock.sol
+++ b/packages/contracts/contracts/multisig/MultiSigWalletWithTimeLock.sol
diff --git a/packages/contracts/src/2.0.0/protocol/AssetProxy/ERC20Proxy.sol b/packages/contracts/contracts/protocol/AssetProxy/ERC20Proxy.sol
index 258443bca..258443bca 100644
--- a/packages/contracts/src/2.0.0/protocol/AssetProxy/ERC20Proxy.sol
+++ b/packages/contracts/contracts/protocol/AssetProxy/ERC20Proxy.sol
diff --git a/packages/contracts/src/2.0.0/protocol/AssetProxy/ERC721Proxy.sol b/packages/contracts/contracts/protocol/AssetProxy/ERC721Proxy.sol
index 65b664b8b..65b664b8b 100644
--- a/packages/contracts/src/2.0.0/protocol/AssetProxy/ERC721Proxy.sol
+++ b/packages/contracts/contracts/protocol/AssetProxy/ERC721Proxy.sol
diff --git a/packages/contracts/src/2.0.0/protocol/AssetProxy/MixinAuthorizable.sol b/packages/contracts/contracts/protocol/AssetProxy/MixinAuthorizable.sol
index fe9bbf848..fe9bbf848 100644
--- a/packages/contracts/src/2.0.0/protocol/AssetProxy/MixinAuthorizable.sol
+++ b/packages/contracts/contracts/protocol/AssetProxy/MixinAuthorizable.sol
diff --git a/packages/contracts/src/2.0.0/protocol/AssetProxy/interfaces/IAssetData.sol b/packages/contracts/contracts/protocol/AssetProxy/interfaces/IAssetData.sol
index 3e76e38dd..3e76e38dd 100644
--- a/packages/contracts/src/2.0.0/protocol/AssetProxy/interfaces/IAssetData.sol
+++ b/packages/contracts/contracts/protocol/AssetProxy/interfaces/IAssetData.sol
diff --git a/packages/contracts/src/2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol b/packages/contracts/contracts/protocol/AssetProxy/interfaces/IAssetProxy.sol
index b25d2d75a..b25d2d75a 100644
--- a/packages/contracts/src/2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol
+++ b/packages/contracts/contracts/protocol/AssetProxy/interfaces/IAssetProxy.sol
diff --git a/packages/contracts/src/2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol b/packages/contracts/contracts/protocol/AssetProxy/interfaces/IAuthorizable.sol
index ba1d4aa77..ba1d4aa77 100644
--- a/packages/contracts/src/2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol
+++ b/packages/contracts/contracts/protocol/AssetProxy/interfaces/IAuthorizable.sol
diff --git a/packages/contracts/src/2.0.0/protocol/AssetProxy/libs/LibAssetProxyErrors.sol b/packages/contracts/contracts/protocol/AssetProxy/libs/LibAssetProxyErrors.sol
index 1d9a70cc1..1d9a70cc1 100644
--- a/packages/contracts/src/2.0.0/protocol/AssetProxy/libs/LibAssetProxyErrors.sol
+++ b/packages/contracts/contracts/protocol/AssetProxy/libs/LibAssetProxyErrors.sol
diff --git a/packages/contracts/src/2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol b/packages/contracts/contracts/protocol/AssetProxy/mixins/MAuthorizable.sol
index d63fb7f6d..d63fb7f6d 100644
--- a/packages/contracts/src/2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol
+++ b/packages/contracts/contracts/protocol/AssetProxy/mixins/MAuthorizable.sol
diff --git a/packages/contracts/src/2.0.0/protocol/AssetProxyOwner/AssetProxyOwner.sol b/packages/contracts/contracts/protocol/AssetProxyOwner/AssetProxyOwner.sol
index edb788fab..edb788fab 100644
--- a/packages/contracts/src/2.0.0/protocol/AssetProxyOwner/AssetProxyOwner.sol
+++ b/packages/contracts/contracts/protocol/AssetProxyOwner/AssetProxyOwner.sol
diff --git a/packages/contracts/src/2.0.0/protocol/Exchange/Exchange.sol b/packages/contracts/contracts/protocol/Exchange/Exchange.sol
index ead36009f..ead36009f 100644
--- a/packages/contracts/src/2.0.0/protocol/Exchange/Exchange.sol
+++ b/packages/contracts/contracts/protocol/Exchange/Exchange.sol
diff --git a/packages/contracts/src/2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol b/packages/contracts/contracts/protocol/Exchange/MixinAssetProxyDispatcher.sol
index 87b09b6b3..87b09b6b3 100644
--- a/packages/contracts/src/2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol
+++ b/packages/contracts/contracts/protocol/Exchange/MixinAssetProxyDispatcher.sol
diff --git a/packages/contracts/src/2.0.0/protocol/Exchange/MixinExchangeCore.sol b/packages/contracts/contracts/protocol/Exchange/MixinExchangeCore.sol
index 736dcd0b1..736dcd0b1 100644
--- a/packages/contracts/src/2.0.0/protocol/Exchange/MixinExchangeCore.sol
+++ b/packages/contracts/contracts/protocol/Exchange/MixinExchangeCore.sol
diff --git a/packages/contracts/src/2.0.0/protocol/Exchange/MixinMatchOrders.sol b/packages/contracts/contracts/protocol/Exchange/MixinMatchOrders.sol
index b4f6bdb26..b4f6bdb26 100644
--- a/packages/contracts/src/2.0.0/protocol/Exchange/MixinMatchOrders.sol
+++ b/packages/contracts/contracts/protocol/Exchange/MixinMatchOrders.sol
diff --git a/packages/contracts/src/2.0.0/protocol/Exchange/MixinSignatureValidator.sol b/packages/contracts/contracts/protocol/Exchange/MixinSignatureValidator.sol
index 176e28351..176e28351 100644
--- a/packages/contracts/src/2.0.0/protocol/Exchange/MixinSignatureValidator.sol
+++ b/packages/contracts/contracts/protocol/Exchange/MixinSignatureValidator.sol
diff --git a/packages/contracts/src/2.0.0/protocol/Exchange/MixinTransactions.sol b/packages/contracts/contracts/protocol/Exchange/MixinTransactions.sol
index 3a76ca202..3a76ca202 100644
--- a/packages/contracts/src/2.0.0/protocol/Exchange/MixinTransactions.sol
+++ b/packages/contracts/contracts/protocol/Exchange/MixinTransactions.sol
diff --git a/packages/contracts/src/2.0.0/protocol/Exchange/MixinWrapperFunctions.sol b/packages/contracts/contracts/protocol/Exchange/MixinWrapperFunctions.sol
index cddff0e5f..cddff0e5f 100644
--- a/packages/contracts/src/2.0.0/protocol/Exchange/MixinWrapperFunctions.sol
+++ b/packages/contracts/contracts/protocol/Exchange/MixinWrapperFunctions.sol
diff --git a/packages/contracts/src/2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol b/packages/contracts/contracts/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol
index 8db8d6f6c..8db8d6f6c 100644
--- a/packages/contracts/src/2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol
+++ b/packages/contracts/contracts/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol
diff --git a/packages/contracts/src/2.0.0/protocol/Exchange/interfaces/IExchange.sol b/packages/contracts/contracts/protocol/Exchange/interfaces/IExchange.sol
index b92abba04..b92abba04 100644
--- a/packages/contracts/src/2.0.0/protocol/Exchange/interfaces/IExchange.sol
+++ b/packages/contracts/contracts/protocol/Exchange/interfaces/IExchange.sol
diff --git a/packages/contracts/src/2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol b/packages/contracts/contracts/protocol/Exchange/interfaces/IExchangeCore.sol
index 9995e0385..9995e0385 100644
--- a/packages/contracts/src/2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol
+++ b/packages/contracts/contracts/protocol/Exchange/interfaces/IExchangeCore.sol
diff --git a/packages/contracts/src/2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol b/packages/contracts/contracts/protocol/Exchange/interfaces/IMatchOrders.sol
index 73447f3ae..73447f3ae 100644
--- a/packages/contracts/src/2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol
+++ b/packages/contracts/contracts/protocol/Exchange/interfaces/IMatchOrders.sol
diff --git a/packages/contracts/src/2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol b/packages/contracts/contracts/protocol/Exchange/interfaces/ISignatureValidator.sol
index 1fd0eccf0..1fd0eccf0 100644
--- a/packages/contracts/src/2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol
+++ b/packages/contracts/contracts/protocol/Exchange/interfaces/ISignatureValidator.sol
diff --git a/packages/contracts/src/2.0.0/protocol/Exchange/interfaces/ITransactions.sol b/packages/contracts/contracts/protocol/Exchange/interfaces/ITransactions.sol
index 4446c55ce..4446c55ce 100644
--- a/packages/contracts/src/2.0.0/protocol/Exchange/interfaces/ITransactions.sol
+++ b/packages/contracts/contracts/protocol/Exchange/interfaces/ITransactions.sol
diff --git a/packages/contracts/src/2.0.0/protocol/Exchange/interfaces/IValidator.sol b/packages/contracts/contracts/protocol/Exchange/interfaces/IValidator.sol
index 2dd69100c..2dd69100c 100644
--- a/packages/contracts/src/2.0.0/protocol/Exchange/interfaces/IValidator.sol
+++ b/packages/contracts/contracts/protocol/Exchange/interfaces/IValidator.sol
diff --git a/packages/contracts/src/2.0.0/protocol/Exchange/interfaces/IWallet.sol b/packages/contracts/contracts/protocol/Exchange/interfaces/IWallet.sol
index c97161ca6..c97161ca6 100644
--- a/packages/contracts/src/2.0.0/protocol/Exchange/interfaces/IWallet.sol
+++ b/packages/contracts/contracts/protocol/Exchange/interfaces/IWallet.sol
diff --git a/packages/contracts/src/2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol b/packages/contracts/contracts/protocol/Exchange/interfaces/IWrapperFunctions.sol
index 56a533646..56a533646 100644
--- a/packages/contracts/src/2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol
+++ b/packages/contracts/contracts/protocol/Exchange/interfaces/IWrapperFunctions.sol
diff --git a/packages/contracts/src/2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol b/packages/contracts/contracts/protocol/Exchange/libs/LibAbiEncoder.sol
index 4aad37709..4aad37709 100644
--- a/packages/contracts/src/2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol
+++ b/packages/contracts/contracts/protocol/Exchange/libs/LibAbiEncoder.sol
diff --git a/packages/contracts/src/2.0.0/protocol/Exchange/libs/LibConstants.sol b/packages/contracts/contracts/protocol/Exchange/libs/LibConstants.sol
index 8d2732cd3..8d2732cd3 100644
--- a/packages/contracts/src/2.0.0/protocol/Exchange/libs/LibConstants.sol
+++ b/packages/contracts/contracts/protocol/Exchange/libs/LibConstants.sol
diff --git a/packages/contracts/src/2.0.0/protocol/Exchange/libs/LibEIP712.sol b/packages/contracts/contracts/protocol/Exchange/libs/LibEIP712.sol
index 203edc1fd..203edc1fd 100644
--- a/packages/contracts/src/2.0.0/protocol/Exchange/libs/LibEIP712.sol
+++ b/packages/contracts/contracts/protocol/Exchange/libs/LibEIP712.sol
diff --git a/packages/contracts/src/2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol b/packages/contracts/contracts/protocol/Exchange/libs/LibExchangeErrors.sol
index a0f75bc06..a0f75bc06 100644
--- a/packages/contracts/src/2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol
+++ b/packages/contracts/contracts/protocol/Exchange/libs/LibExchangeErrors.sol
diff --git a/packages/contracts/src/2.0.0/protocol/Exchange/libs/LibFillResults.sol b/packages/contracts/contracts/protocol/Exchange/libs/LibFillResults.sol
index 659ae9a69..659ae9a69 100644
--- a/packages/contracts/src/2.0.0/protocol/Exchange/libs/LibFillResults.sol
+++ b/packages/contracts/contracts/protocol/Exchange/libs/LibFillResults.sol
diff --git a/packages/contracts/src/2.0.0/protocol/Exchange/libs/LibMath.sol b/packages/contracts/contracts/protocol/Exchange/libs/LibMath.sol
index c0b85ea10..c0b85ea10 100644
--- a/packages/contracts/src/2.0.0/protocol/Exchange/libs/LibMath.sol
+++ b/packages/contracts/contracts/protocol/Exchange/libs/LibMath.sol
diff --git a/packages/contracts/src/2.0.0/protocol/Exchange/libs/LibOrder.sol b/packages/contracts/contracts/protocol/Exchange/libs/LibOrder.sol
index 0fe7c2161..0fe7c2161 100644
--- a/packages/contracts/src/2.0.0/protocol/Exchange/libs/LibOrder.sol
+++ b/packages/contracts/contracts/protocol/Exchange/libs/LibOrder.sol
diff --git a/packages/contracts/src/2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol b/packages/contracts/contracts/protocol/Exchange/mixins/MAssetProxyDispatcher.sol
index 0ddfca270..0ddfca270 100644
--- a/packages/contracts/src/2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol
+++ b/packages/contracts/contracts/protocol/Exchange/mixins/MAssetProxyDispatcher.sol
diff --git a/packages/contracts/src/2.0.0/protocol/Exchange/mixins/MExchangeCore.sol b/packages/contracts/contracts/protocol/Exchange/mixins/MExchangeCore.sol
index 742499568..742499568 100644
--- a/packages/contracts/src/2.0.0/protocol/Exchange/mixins/MExchangeCore.sol
+++ b/packages/contracts/contracts/protocol/Exchange/mixins/MExchangeCore.sol
diff --git a/packages/contracts/src/2.0.0/protocol/Exchange/mixins/MMatchOrders.sol b/packages/contracts/contracts/protocol/Exchange/mixins/MMatchOrders.sol
index 96fa34bc0..96fa34bc0 100644
--- a/packages/contracts/src/2.0.0/protocol/Exchange/mixins/MMatchOrders.sol
+++ b/packages/contracts/contracts/protocol/Exchange/mixins/MMatchOrders.sol
diff --git a/packages/contracts/src/2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol b/packages/contracts/contracts/protocol/Exchange/mixins/MSignatureValidator.sol
index 1fe88b908..1fe88b908 100644
--- a/packages/contracts/src/2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol
+++ b/packages/contracts/contracts/protocol/Exchange/mixins/MSignatureValidator.sol
diff --git a/packages/contracts/src/2.0.0/protocol/Exchange/mixins/MTransactions.sol b/packages/contracts/contracts/protocol/Exchange/mixins/MTransactions.sol
index 4f61a4945..4f61a4945 100644
--- a/packages/contracts/src/2.0.0/protocol/Exchange/mixins/MTransactions.sol
+++ b/packages/contracts/contracts/protocol/Exchange/mixins/MTransactions.sol
diff --git a/packages/contracts/src/2.0.0/protocol/Exchange/mixins/MWrapperFunctions.sol b/packages/contracts/contracts/protocol/Exchange/mixins/MWrapperFunctions.sol
index 4adfbde01..4adfbde01 100644
--- a/packages/contracts/src/2.0.0/protocol/Exchange/mixins/MWrapperFunctions.sol
+++ b/packages/contracts/contracts/protocol/Exchange/mixins/MWrapperFunctions.sol
diff --git a/packages/contracts/src/2.0.0/test/DummyERC20Token/DummyERC20Token.sol b/packages/contracts/contracts/test/DummyERC20Token/DummyERC20Token.sol
index 412c5d1ad..412c5d1ad 100644
--- a/packages/contracts/src/2.0.0/test/DummyERC20Token/DummyERC20Token.sol
+++ b/packages/contracts/contracts/test/DummyERC20Token/DummyERC20Token.sol
diff --git a/packages/contracts/src/2.0.0/test/DummyERC20Token/DummyMultipleReturnERC20Token.sol b/packages/contracts/contracts/test/DummyERC20Token/DummyMultipleReturnERC20Token.sol
index 733d4437e..733d4437e 100644
--- a/packages/contracts/src/2.0.0/test/DummyERC20Token/DummyMultipleReturnERC20Token.sol
+++ b/packages/contracts/contracts/test/DummyERC20Token/DummyMultipleReturnERC20Token.sol
diff --git a/packages/contracts/src/2.0.0/test/DummyERC20Token/DummyNoReturnERC20Token.sol b/packages/contracts/contracts/test/DummyERC20Token/DummyNoReturnERC20Token.sol
index e16825a16..e16825a16 100644
--- a/packages/contracts/src/2.0.0/test/DummyERC20Token/DummyNoReturnERC20Token.sol
+++ b/packages/contracts/contracts/test/DummyERC20Token/DummyNoReturnERC20Token.sol
diff --git a/packages/contracts/src/2.0.0/test/DummyERC721Receiver/DummyERC721Receiver.sol b/packages/contracts/contracts/test/DummyERC721Receiver/DummyERC721Receiver.sol
index 6c8371559..6c8371559 100644
--- a/packages/contracts/src/2.0.0/test/DummyERC721Receiver/DummyERC721Receiver.sol
+++ b/packages/contracts/contracts/test/DummyERC721Receiver/DummyERC721Receiver.sol
diff --git a/packages/contracts/src/2.0.0/test/DummyERC721Receiver/InvalidERC721Receiver.sol b/packages/contracts/contracts/test/DummyERC721Receiver/InvalidERC721Receiver.sol
index 309633bf5..309633bf5 100644
--- a/packages/contracts/src/2.0.0/test/DummyERC721Receiver/InvalidERC721Receiver.sol
+++ b/packages/contracts/contracts/test/DummyERC721Receiver/InvalidERC721Receiver.sol
diff --git a/packages/contracts/src/2.0.0/test/DummyERC721Token/DummyERC721Token.sol b/packages/contracts/contracts/test/DummyERC721Token/DummyERC721Token.sol
index ac9068d1d..ac9068d1d 100644
--- a/packages/contracts/src/2.0.0/test/DummyERC721Token/DummyERC721Token.sol
+++ b/packages/contracts/contracts/test/DummyERC721Token/DummyERC721Token.sol
diff --git a/packages/contracts/src/2.0.0/test/ReentrantERC20Token/ReentrantERC20Token.sol b/packages/contracts/contracts/test/ReentrantERC20Token/ReentrantERC20Token.sol
index 99dd47a78..99dd47a78 100644
--- a/packages/contracts/src/2.0.0/test/ReentrantERC20Token/ReentrantERC20Token.sol
+++ b/packages/contracts/contracts/test/ReentrantERC20Token/ReentrantERC20Token.sol
diff --git a/packages/contracts/src/2.0.0/test/TestAssetProxyDispatcher/TestAssetProxyDispatcher.sol b/packages/contracts/contracts/test/TestAssetProxyDispatcher/TestAssetProxyDispatcher.sol
index ad71fc9a1..ad71fc9a1 100644
--- a/packages/contracts/src/2.0.0/test/TestAssetProxyDispatcher/TestAssetProxyDispatcher.sol
+++ b/packages/contracts/contracts/test/TestAssetProxyDispatcher/TestAssetProxyDispatcher.sol
diff --git a/packages/contracts/src/2.0.0/test/TestAssetProxyOwner/TestAssetProxyOwner.sol b/packages/contracts/contracts/test/TestAssetProxyOwner/TestAssetProxyOwner.sol
index 52c66cb56..52c66cb56 100644
--- a/packages/contracts/src/2.0.0/test/TestAssetProxyOwner/TestAssetProxyOwner.sol
+++ b/packages/contracts/contracts/test/TestAssetProxyOwner/TestAssetProxyOwner.sol
diff --git a/packages/contracts/src/2.0.0/test/TestConstants/TestConstants.sol b/packages/contracts/contracts/test/TestConstants/TestConstants.sol
index 1275d007b..1275d007b 100644
--- a/packages/contracts/src/2.0.0/test/TestConstants/TestConstants.sol
+++ b/packages/contracts/contracts/test/TestConstants/TestConstants.sol
diff --git a/packages/contracts/src/2.0.0/test/TestExchangeInternals/TestExchangeInternals.sol b/packages/contracts/contracts/test/TestExchangeInternals/TestExchangeInternals.sol
index 27187f8f8..27187f8f8 100644
--- a/packages/contracts/src/2.0.0/test/TestExchangeInternals/TestExchangeInternals.sol
+++ b/packages/contracts/contracts/test/TestExchangeInternals/TestExchangeInternals.sol
diff --git a/packages/contracts/src/2.0.0/test/TestLibBytes/TestLibBytes.sol b/packages/contracts/contracts/test/TestLibBytes/TestLibBytes.sol
index 00d861e61..00d861e61 100644
--- a/packages/contracts/src/2.0.0/test/TestLibBytes/TestLibBytes.sol
+++ b/packages/contracts/contracts/test/TestLibBytes/TestLibBytes.sol
diff --git a/packages/contracts/src/2.0.0/test/TestLibs/TestLibs.sol b/packages/contracts/contracts/test/TestLibs/TestLibs.sol
index a10f981fc..a10f981fc 100644
--- a/packages/contracts/src/2.0.0/test/TestLibs/TestLibs.sol
+++ b/packages/contracts/contracts/test/TestLibs/TestLibs.sol
diff --git a/packages/contracts/src/2.0.0/test/TestSignatureValidator/TestSignatureValidator.sol b/packages/contracts/contracts/test/TestSignatureValidator/TestSignatureValidator.sol
index ea3e2de59..ea3e2de59 100644
--- a/packages/contracts/src/2.0.0/test/TestSignatureValidator/TestSignatureValidator.sol
+++ b/packages/contracts/contracts/test/TestSignatureValidator/TestSignatureValidator.sol
diff --git a/packages/contracts/src/2.0.0/test/TestStaticCallReceiver/TestStaticCallReceiver.sol b/packages/contracts/contracts/test/TestStaticCallReceiver/TestStaticCallReceiver.sol
index 41aab01c8..41aab01c8 100644
--- a/packages/contracts/src/2.0.0/test/TestStaticCallReceiver/TestStaticCallReceiver.sol
+++ b/packages/contracts/contracts/test/TestStaticCallReceiver/TestStaticCallReceiver.sol
diff --git a/packages/contracts/src/2.0.0/tokens/ERC20Token/ERC20Token.sol b/packages/contracts/contracts/tokens/ERC20Token/ERC20Token.sol
index 725d304df..725d304df 100644
--- a/packages/contracts/src/2.0.0/tokens/ERC20Token/ERC20Token.sol
+++ b/packages/contracts/contracts/tokens/ERC20Token/ERC20Token.sol
diff --git a/packages/contracts/src/2.0.0/tokens/ERC20Token/IERC20Token.sol b/packages/contracts/contracts/tokens/ERC20Token/IERC20Token.sol
index 258d47393..258d47393 100644
--- a/packages/contracts/src/2.0.0/tokens/ERC20Token/IERC20Token.sol
+++ b/packages/contracts/contracts/tokens/ERC20Token/IERC20Token.sol
diff --git a/packages/contracts/src/2.0.0/tokens/ERC20Token/MintableERC20Token.sol b/packages/contracts/contracts/tokens/ERC20Token/MintableERC20Token.sol
index 9dc924422..9dc924422 100644
--- a/packages/contracts/src/2.0.0/tokens/ERC20Token/MintableERC20Token.sol
+++ b/packages/contracts/contracts/tokens/ERC20Token/MintableERC20Token.sol
diff --git a/packages/contracts/src/2.0.0/tokens/ERC20Token/UnlimitedAllowanceERC20Token.sol b/packages/contracts/contracts/tokens/ERC20Token/UnlimitedAllowanceERC20Token.sol
index 2e5bd4348..2e5bd4348 100644
--- a/packages/contracts/src/2.0.0/tokens/ERC20Token/UnlimitedAllowanceERC20Token.sol
+++ b/packages/contracts/contracts/tokens/ERC20Token/UnlimitedAllowanceERC20Token.sol
diff --git a/packages/contracts/src/2.0.0/tokens/ERC721Token/ERC721Token.sol b/packages/contracts/contracts/tokens/ERC721Token/ERC721Token.sol
index 530f080c0..530f080c0 100644
--- a/packages/contracts/src/2.0.0/tokens/ERC721Token/ERC721Token.sol
+++ b/packages/contracts/contracts/tokens/ERC721Token/ERC721Token.sol
diff --git a/packages/contracts/src/2.0.0/tokens/ERC721Token/IERC721Receiver.sol b/packages/contracts/contracts/tokens/ERC721Token/IERC721Receiver.sol
index 8e0e32ab2..8e0e32ab2 100644
--- a/packages/contracts/src/2.0.0/tokens/ERC721Token/IERC721Receiver.sol
+++ b/packages/contracts/contracts/tokens/ERC721Token/IERC721Receiver.sol
diff --git a/packages/contracts/src/2.0.0/tokens/ERC721Token/IERC721Token.sol b/packages/contracts/contracts/tokens/ERC721Token/IERC721Token.sol
index ac992c80d..ac992c80d 100644
--- a/packages/contracts/src/2.0.0/tokens/ERC721Token/IERC721Token.sol
+++ b/packages/contracts/contracts/tokens/ERC721Token/IERC721Token.sol
diff --git a/packages/contracts/src/2.0.0/tokens/ERC721Token/MintableERC721Token.sol b/packages/contracts/contracts/tokens/ERC721Token/MintableERC721Token.sol
index bc5cd2cc2..bc5cd2cc2 100644
--- a/packages/contracts/src/2.0.0/tokens/ERC721Token/MintableERC721Token.sol
+++ b/packages/contracts/contracts/tokens/ERC721Token/MintableERC721Token.sol
diff --git a/packages/contracts/src/2.0.0/tokens/EtherToken/IEtherToken.sol b/packages/contracts/contracts/tokens/EtherToken/IEtherToken.sol
index 9e2e68766..9e2e68766 100644
--- a/packages/contracts/src/2.0.0/tokens/EtherToken/IEtherToken.sol
+++ b/packages/contracts/contracts/tokens/EtherToken/IEtherToken.sol
diff --git a/packages/contracts/src/2.0.0/tokens/EtherToken/WETH9.sol b/packages/contracts/contracts/tokens/EtherToken/WETH9.sol
index 17876b86d..17876b86d 100644
--- a/packages/contracts/src/2.0.0/tokens/EtherToken/WETH9.sol
+++ b/packages/contracts/contracts/tokens/EtherToken/WETH9.sol
diff --git a/packages/contracts/src/1.0.0/ERC20Token/ERC20Token_v1.sol b/packages/contracts/contracts/tokens/ZRXToken/ERC20Token_v1.sol
index e05ee2d5e..4920c4aac 100644
--- a/packages/contracts/src/1.0.0/ERC20Token/ERC20Token_v1.sol
+++ b/packages/contracts/contracts/tokens/ZRXToken/ERC20Token_v1.sol
@@ -1,6 +1,6 @@
pragma solidity ^0.4.11;
-import { Token_v1 as Token } from "../Token/Token_v1.sol";
+import { Token_v1 as Token } from "./Token_v1.sol";
contract ERC20Token_v1 is Token {
diff --git a/packages/contracts/src/1.0.0/Token/Token_v1.sol b/packages/contracts/contracts/tokens/ZRXToken/Token_v1.sol
index de619fb7e..de619fb7e 100644
--- a/packages/contracts/src/1.0.0/Token/Token_v1.sol
+++ b/packages/contracts/contracts/tokens/ZRXToken/Token_v1.sol
diff --git a/packages/contracts/src/1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol b/packages/contracts/contracts/tokens/ZRXToken/UnlimitedAllowanceToken_v1.sol
index 46379c43d..bf1b0335a 100644
--- a/packages/contracts/src/1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol
+++ b/packages/contracts/contracts/tokens/ZRXToken/UnlimitedAllowanceToken_v1.sol
@@ -18,7 +18,7 @@
pragma solidity ^0.4.11;
-import { ERC20Token_v1 as ERC20Token } from "../ERC20Token/ERC20Token_v1.sol";
+import { ERC20Token_v1 as ERC20Token } from "./ERC20Token_v1.sol";
contract UnlimitedAllowanceToken_v1 is ERC20Token {
diff --git a/packages/contracts/src/2.0.0/tokens/ZRXToken/ZRXToken.sol b/packages/contracts/contracts/tokens/ZRXToken/ZRXToken.sol
index f4855759c..831e1822c 100644
--- a/packages/contracts/src/2.0.0/tokens/ZRXToken/ZRXToken.sol
+++ b/packages/contracts/contracts/tokens/ZRXToken/ZRXToken.sol
@@ -19,7 +19,7 @@
pragma solidity 0.4.11;
// solhint-disable-next-line max-line-length
-import { UnlimitedAllowanceToken_v1 as UnlimitedAllowanceToken } from "../../../1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol";
+import { UnlimitedAllowanceToken_v1 as UnlimitedAllowanceToken } from "./UnlimitedAllowanceToken_v1.sol";
contract ZRXToken is
diff --git a/packages/contracts/src/2.0.0/utils/LibBytes/LibBytes.sol b/packages/contracts/contracts/utils/LibBytes/LibBytes.sol
index 369f588ad..369f588ad 100644
--- a/packages/contracts/src/2.0.0/utils/LibBytes/LibBytes.sol
+++ b/packages/contracts/contracts/utils/LibBytes/LibBytes.sol
diff --git a/packages/contracts/src/2.0.0/utils/Ownable/IOwnable.sol b/packages/contracts/contracts/utils/Ownable/IOwnable.sol
index 5deb13497..5deb13497 100644
--- a/packages/contracts/src/2.0.0/utils/Ownable/IOwnable.sol
+++ b/packages/contracts/contracts/utils/Ownable/IOwnable.sol
diff --git a/packages/contracts/src/2.0.0/utils/Ownable/Ownable.sol b/packages/contracts/contracts/utils/Ownable/Ownable.sol
index 0c830be68..0c830be68 100644
--- a/packages/contracts/src/2.0.0/utils/Ownable/Ownable.sol
+++ b/packages/contracts/contracts/utils/Ownable/Ownable.sol
diff --git a/packages/contracts/src/2.0.0/utils/ReentrancyGuard/ReentrancyGuard.sol b/packages/contracts/contracts/utils/ReentrancyGuard/ReentrancyGuard.sol
index 9f98a7a16..9f98a7a16 100644
--- a/packages/contracts/src/2.0.0/utils/ReentrancyGuard/ReentrancyGuard.sol
+++ b/packages/contracts/contracts/utils/ReentrancyGuard/ReentrancyGuard.sol
diff --git a/packages/contracts/src/2.0.0/utils/SafeMath/SafeMath.sol b/packages/contracts/contracts/utils/SafeMath/SafeMath.sol
index 2855edb9d..2855edb9d 100644
--- a/packages/contracts/src/2.0.0/utils/SafeMath/SafeMath.sol
+++ b/packages/contracts/contracts/utils/SafeMath/SafeMath.sol
diff --git a/packages/contracts/globals.d.ts b/packages/contracts/globals.d.ts
deleted file mode 100644
index 94e63a32d..000000000
--- a/packages/contracts/globals.d.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-declare module '*.json' {
- const json: any;
- /* tslint:disable */
- export default json;
- /* tslint:enable */
-}
diff --git a/packages/contracts/package.json b/packages/contracts/package.json
index 01d04e645..bf9bb4826 100644
--- a/packages/contracts/package.json
+++ b/packages/contracts/package.json
@@ -1,39 +1,38 @@
{
"private": true,
"name": "contracts",
- "version": "2.1.49",
+ "version": "2.1.51",
"engines": {
"node": ">=6.12"
},
"description": "Smart contract components of 0x protocol",
- "main": "index.js",
+ "main": "lib/src/index.js",
"directories": {
"test": "test"
},
"scripts": {
"build": "yarn pre_build && tsc -b",
"build:ci": "yarn build",
- "pre_build": "run-s compile copy_artifacts generate_contract_wrappers",
- "copy_artifacts": "copyfiles -u 4 '../migrations/artifacts/development/**/*' ./lib/artifacts;",
+ "pre_build": "run-s compile generate_contract_wrappers",
"test": "yarn run_mocha",
"rebuild_and_test": "run-s build test",
"test:coverage": "SOLIDITY_COVERAGE=true run-s build run_mocha coverage:report:text coverage:report:lcov",
"test:profiler": "SOLIDITY_PROFILER=true run-s build run_mocha profiler:report:html",
"test:trace": "SOLIDITY_REVERT_TRACE=true run-s build run_mocha",
"run_mocha": "mocha --require source-map-support/register --require make-promises-safe 'lib/test/**/*.js' --timeout 100000 --bail --exit",
- "compile": "sol-compiler --contracts-dir src",
- "clean": "shx rm -rf lib generated_contract_wrappers",
- "generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output generated_contract_wrappers --backend ethers",
- "lint": "tslint --project . --exclude **/src/generated_contract_wrappers/**/* --exclude **/lib/**/* && yarn lint-contracts",
+ "compile": "sol-compiler --contracts-dir contracts",
+ "clean": "shx rm -rf lib generated-artifacts generated-wrappers",
+ "generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output generated-wrappers --backend ethers",
+ "lint": "tslint --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
"coverage:report:text": "istanbul report text",
"coverage:report:html": "istanbul report html && open coverage/index.html",
"profiler:report:html": "istanbul report html && open coverage/index.html",
"coverage:report:lcov": "istanbul report lcov",
"test:circleci": "yarn test",
- "lint-contracts": "solhint src/2.0.0/**/**/**/**/*.sol"
+ "lint-contracts": "solhint contracts/**/**/**/**/*.sol"
},
"config": {
- "abis": "../migrations/artifacts/development/@(AssetProxyOwner|DummyERC20Token|DummyERC721Receiver|DummyERC721Token|DummyMultipleReturnERC20Token|DummyNoReturnERC20Token|ERC20Proxy|ERC721Proxy|Forwarder|Exchange|ExchangeWrapper|IAssetData|IAssetProxy|InvalidERC721Receiver|MixinAuthorizable|MultiSigWallet|MultiSigWalletWithTimeLock|OrderValidator|ReentrantERC20Token|TestAssetProxyOwner|TestAssetProxyDispatcher|TestConstants|TestExchangeInternals|TestLibBytes|TestLibs|TestSignatureValidator|TestStaticCallReceiver|Validator|Wallet|TokenRegistry|Whitelist|WETH9|ZRXToken).json"
+ "abis": "generated-artifacts/@(AssetProxyOwner|DummyERC20Token|DummyERC721Receiver|DummyERC721Token|DummyMultipleReturnERC20Token|DummyNoReturnERC20Token|ERC20Token|ERC20Proxy|ERC721Token|ERC721Proxy|Forwarder|Exchange|ExchangeWrapper|IAssetData|IAssetProxy|InvalidERC721Receiver|MixinAuthorizable|MultiSigWallet|MultiSigWalletWithTimeLock|OrderValidator|ReentrantERC20Token|TestAssetProxyOwner|TestAssetProxyDispatcher|TestConstants|TestExchangeInternals|TestLibBytes|TestLibs|TestSignatureValidator|TestStaticCallReceiver|Validator|Wallet|Whitelist|WETH9|ZRXToken).json"
},
"repository": {
"type": "git",
@@ -46,12 +45,12 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/contracts/README.md",
"devDependencies": {
- "@0xproject/abi-gen": "^1.0.13",
- "@0xproject/dev-utils": "^1.0.12",
- "@0xproject/sol-compiler": "^1.1.7",
- "@0xproject/sol-cov": "^2.1.7",
- "@0xproject/subproviders": "^2.0.7",
- "@0xproject/tslint-config": "^1.0.8",
+ "@0x/abi-gen": "^1.0.15",
+ "@0x/dev-utils": "^1.0.14",
+ "@0x/sol-compiler": "^1.1.9",
+ "@0x/sol-cov": "^2.1.9",
+ "@0x/subproviders": "^2.1.1",
+ "@0x/tslint-config": "^1.0.10",
"@types/bn.js": "^4.11.0",
"@types/ethereumjs-abi": "^0.6.0",
"@types/lodash": "4.14.104",
@@ -60,7 +59,6 @@
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
"chai-bignumber": "^2.0.1",
- "copyfiles": "^2.0.0",
"dirty-chai": "^2.0.1",
"make-promises-safe": "^1.1.0",
"mocha": "^4.1.0",
@@ -73,19 +71,22 @@
"yargs": "^10.0.3"
},
"dependencies": {
- "@0xproject/base-contract": "^3.0.1",
- "@0xproject/order-utils": "^1.0.7",
- "@0xproject/types": "^1.1.4",
- "@0xproject/typescript-typings": "^3.0.2",
- "@0xproject/utils": "^2.0.2",
- "@0xproject/web3-wrapper": "^3.0.3",
+ "@0x/base-contract": "^3.0.3",
+ "@0x/order-utils": "^2.0.1",
+ "@0x/types": "^1.2.1",
+ "@0x/typescript-typings": "^3.0.4",
+ "@0x/utils": "^2.0.4",
+ "@0x/web3-wrapper": "^3.1.1",
"@types/js-combinatorics": "^0.5.29",
"bn.js": "^4.11.8",
- "ethereum-types": "^1.0.11",
+ "ethereum-types": "^1.1.2",
"ethereumjs-abi": "0.6.5",
"ethereumjs-util": "^5.1.1",
"ethers": "~4.0.4",
"js-combinatorics": "^0.5.3",
"lodash": "^4.17.5"
+ },
+ "publishConfig": {
+ "access": "public"
}
}
diff --git a/packages/contracts/src/1.0.0/Arbitrage/Arbitrage.sol b/packages/contracts/src/1.0.0/Arbitrage/Arbitrage.sol
deleted file mode 100644
index 5054afc2f..000000000
--- a/packages/contracts/src/1.0.0/Arbitrage/Arbitrage.sol
+++ /dev/null
@@ -1,114 +0,0 @@
-pragma solidity ^0.4.19;
-
-import { IExchange_v1 as Exchange } from "../Exchange/IExchange_v1.sol";
-import { EtherDelta } from "../EtherDelta/EtherDelta.sol";
-import { Ownable_v1 as Ownable } from "../Ownable/Ownable_v1.sol";
-import { IToken_v1 as Token } from "../Token/IToken_v1.sol";
-
-/// @title Arbitrage - Facilitates atomic arbitrage of ERC20 tokens between EtherDelta and 0x Exchange contract.
-/// @author Leonid Logvinov - <leo@0xProject.com>
-contract Arbitrage is Ownable {
-
- Exchange exchange;
- EtherDelta etherDelta;
- address proxyAddress;
-
- uint256 constant MAX_UINT = 2**256 - 1;
-
- function Arbitrage(address _exchangeAddress, address _etherDeltaAddress, address _proxyAddress) {
- exchange = Exchange(_exchangeAddress);
- etherDelta = EtherDelta(_etherDeltaAddress);
- proxyAddress = _proxyAddress;
- }
-
- /*
- * Makes token tradeable by setting an allowance for etherDelta and 0x proxy contract.
- * Also sets an allowance for the owner of the contracts therefore allowing to withdraw tokens.
- */
- function setAllowances(address tokenAddress) external onlyOwner {
- Token token = Token(tokenAddress);
- token.approve(address(etherDelta), MAX_UINT);
- token.approve(proxyAddress, MAX_UINT);
- token.approve(owner, MAX_UINT);
- }
-
- /*
- * Because of the limits on the number of local variables in Solidity we need to compress parameters while loosing
- * readability. Scheme of the parameter layout:
- *
- * addresses
- * 0..4 orderAddresses
- * 5 user
- *
- * values
- * 0..5 orderValues
- * 6 fillTakerTokenAmount
- * 7 amountGet
- * 8 amountGive
- * 9 expires
- * 10 nonce
- * 11 amount
-
- * signature
- * exchange then etherDelta
- */
- function makeAtomicTrade(
- address[6] addresses, uint[12] values,
- uint8[2] v, bytes32[2] r, bytes32[2] s
- ) external onlyOwner {
- makeExchangeTrade(addresses, values, v, r, s);
- makeEtherDeltaTrade(addresses, values, v, r, s);
- }
-
- function makeEtherDeltaTrade(
- address[6] addresses, uint[12] values,
- uint8[2] v, bytes32[2] r, bytes32[2] s
- ) internal {
- uint amount = values[11];
- etherDelta.depositToken(
- addresses[2], // tokenGet === makerToken
- values[7] // amountGet
- );
- etherDelta.trade(
- addresses[2], // tokenGet === makerToken
- values[7], // amountGet
- addresses[3], // tokenGive === takerToken
- values[8], // amountGive
- values[9], // expires
- values[10], // nonce
- addresses[5], // user
- v[1],
- r[1],
- s[1],
- amount
- );
- etherDelta.withdrawToken(
- addresses[3], // tokenGive === tokenToken
- values[8] // amountGive
- );
- }
-
- function makeExchangeTrade(
- address[6] addresses, uint[12] values,
- uint8[2] v, bytes32[2] r, bytes32[2] s
- ) internal {
- address[5] memory orderAddresses = [
- addresses[0], // maker
- addresses[1], // taker
- addresses[2], // makerToken
- addresses[3], // takerToken
- addresses[4] // feeRecepient
- ];
- uint[6] memory orderValues = [
- values[0], // makerTokenAmount
- values[1], // takerTokenAmount
- values[2], // makerFee
- values[3], // takerFee
- values[4], // expirationTimestampInSec
- values[5] // salt
- ];
- uint fillTakerTokenAmount = values[6]; // fillTakerTokenAmount
- // Execute Exchange trade. It either succeeds in full or fails and reverts all the changes.
- exchange.fillOrKillOrder(orderAddresses, orderValues, fillTakerTokenAmount, v[0], r[0], s[0]);
- }
-}
diff --git a/packages/contracts/src/1.0.0/EtherDelta/AccountLevels.sol b/packages/contracts/src/1.0.0/EtherDelta/AccountLevels.sol
deleted file mode 100644
index 8d7a930d3..000000000
--- a/packages/contracts/src/1.0.0/EtherDelta/AccountLevels.sol
+++ /dev/null
@@ -1,11 +0,0 @@
-pragma solidity ^0.4.19;
-
-contract AccountLevels {
- //given a user, returns an account level
- //0 = regular user (pays take fee and make fee)
- //1 = market maker silver (pays take fee, no make fee, gets rebate)
- //2 = market maker gold (pays take fee, no make fee, gets entire counterparty's take fee as rebate)
- function accountLevel(address user) constant returns(uint) {
- return 0;
- }
-}
diff --git a/packages/contracts/src/1.0.0/EtherDelta/EtherDelta.sol b/packages/contracts/src/1.0.0/EtherDelta/EtherDelta.sol
deleted file mode 100644
index fe599ca0a..000000000
--- a/packages/contracts/src/1.0.0/EtherDelta/EtherDelta.sol
+++ /dev/null
@@ -1,168 +0,0 @@
-pragma solidity ^0.4.19;
-
-import { SafeMath } from "../SafeMath/SafeMath_v1.sol";
-import { AccountLevels } from "./AccountLevels.sol";
-import { Token } from "../Token/Token_v1.sol";
-
-contract EtherDelta is SafeMath {
- address public admin; //the admin address
- address public feeAccount; //the account that will receive fees
- address public accountLevelsAddr; //the address of the AccountLevels contract
- uint public feeMake; //percentage times (1 ether)
- uint public feeTake; //percentage times (1 ether)
- uint public feeRebate; //percentage times (1 ether)
- mapping (address => mapping (address => uint)) public tokens; //mapping of token addresses to mapping of account balances (token=0 means Ether)
- mapping (address => mapping (bytes32 => bool)) public orders; //mapping of user accounts to mapping of order hashes to booleans (true = submitted by user, equivalent to offchain signature)
- mapping (address => mapping (bytes32 => uint)) public orderFills; //mapping of user accounts to mapping of order hashes to uints (amount of order that has been filled)
-
- event Order(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user);
- event Cancel(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user, uint8 v, bytes32 r, bytes32 s);
- event Trade(address tokenGet, uint amountGet, address tokenGive, uint amountGive, address get, address give);
- event Deposit(address token, address user, uint amount, uint balance);
- event Withdraw(address token, address user, uint amount, uint balance);
-
- function EtherDelta(address admin_, address feeAccount_, address accountLevelsAddr_, uint feeMake_, uint feeTake_, uint feeRebate_) {
- admin = admin_;
- feeAccount = feeAccount_;
- accountLevelsAddr = accountLevelsAddr_;
- feeMake = feeMake_;
- feeTake = feeTake_;
- feeRebate = feeRebate_;
- }
-
- function() {
- throw;
- }
-
- function changeAdmin(address admin_) {
- if (msg.sender != admin) throw;
- admin = admin_;
- }
-
- function changeAccountLevelsAddr(address accountLevelsAddr_) {
- if (msg.sender != admin) throw;
- accountLevelsAddr = accountLevelsAddr_;
- }
-
- function changeFeeAccount(address feeAccount_) {
- if (msg.sender != admin) throw;
- feeAccount = feeAccount_;
- }
-
- function changeFeeMake(uint feeMake_) {
- if (msg.sender != admin) throw;
- if (feeMake_ > feeMake) throw;
- feeMake = feeMake_;
- }
-
- function changeFeeTake(uint feeTake_) {
- if (msg.sender != admin) throw;
- if (feeTake_ > feeTake || feeTake_ < feeRebate) throw;
- feeTake = feeTake_;
- }
-
- function changeFeeRebate(uint feeRebate_) {
- if (msg.sender != admin) throw;
- if (feeRebate_ < feeRebate || feeRebate_ > feeTake) throw;
- feeRebate = feeRebate_;
- }
-
- function deposit() payable {
- tokens[0][msg.sender] = safeAdd(tokens[0][msg.sender], msg.value);
- Deposit(0, msg.sender, msg.value, tokens[0][msg.sender]);
- }
-
- function withdraw(uint amount) {
- if (tokens[0][msg.sender] < amount) throw;
- tokens[0][msg.sender] = safeSub(tokens[0][msg.sender], amount);
- if (!msg.sender.call.value(amount)()) throw;
- Withdraw(0, msg.sender, amount, tokens[0][msg.sender]);
- }
-
- function depositToken(address token, uint amount) {
- //remember to call Token(address).approve(this, amount) or this contract will not be able to do the transfer on your behalf.
- if (token==0) throw;
- if (!Token(token).transferFrom(msg.sender, this, amount)) throw;
- tokens[token][msg.sender] = safeAdd(tokens[token][msg.sender], amount);
- Deposit(token, msg.sender, amount, tokens[token][msg.sender]);
- }
-
- function withdrawToken(address token, uint amount) {
- if (token==0) throw;
- if (tokens[token][msg.sender] < amount) throw;
- tokens[token][msg.sender] = safeSub(tokens[token][msg.sender], amount);
- if (!Token(token).transfer(msg.sender, amount)) throw;
- Withdraw(token, msg.sender, amount, tokens[token][msg.sender]);
- }
-
- function balanceOf(address token, address user) constant returns (uint) {
- return tokens[token][user];
- }
-
- function order(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce) {
- bytes32 hash = sha256(this, tokenGet, amountGet, tokenGive, amountGive, expires, nonce);
- orders[msg.sender][hash] = true;
- Order(tokenGet, amountGet, tokenGive, amountGive, expires, nonce, msg.sender);
- }
-
- function trade(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user, uint8 v, bytes32 r, bytes32 s, uint amount) {
- //amount is in amountGet terms
- bytes32 hash = sha256(this, tokenGet, amountGet, tokenGive, amountGive, expires, nonce);
- if (!(
- (orders[user][hash] || ecrecover(sha3("\x19Ethereum Signed Message:\n32", hash),v,r,s) == user) &&
- block.number <= expires &&
- safeAdd(orderFills[user][hash], amount) <= amountGet
- )) throw;
- tradeBalances(tokenGet, amountGet, tokenGive, amountGive, user, amount);
- orderFills[user][hash] = safeAdd(orderFills[user][hash], amount);
- Trade(tokenGet, amount, tokenGive, amountGive * amount / amountGet, user, msg.sender);
- }
-
- function tradeBalances(address tokenGet, uint amountGet, address tokenGive, uint amountGive, address user, uint amount) private {
- uint feeMakeXfer = safeMul(amount, feeMake) / (1 ether);
- uint feeTakeXfer = safeMul(amount, feeTake) / (1 ether);
- uint feeRebateXfer = 0;
- if (accountLevelsAddr != 0x0) {
- uint accountLevel = AccountLevels(accountLevelsAddr).accountLevel(user);
- if (accountLevel==1) feeRebateXfer = safeMul(amount, feeRebate) / (1 ether);
- if (accountLevel==2) feeRebateXfer = feeTakeXfer;
- }
- tokens[tokenGet][msg.sender] = safeSub(tokens[tokenGet][msg.sender], safeAdd(amount, feeTakeXfer));
- tokens[tokenGet][user] = safeAdd(tokens[tokenGet][user], safeSub(safeAdd(amount, feeRebateXfer), feeMakeXfer));
- tokens[tokenGet][feeAccount] = safeAdd(tokens[tokenGet][feeAccount], safeSub(safeAdd(feeMakeXfer, feeTakeXfer), feeRebateXfer));
- tokens[tokenGive][user] = safeSub(tokens[tokenGive][user], safeMul(amountGive, amount) / amountGet);
- tokens[tokenGive][msg.sender] = safeAdd(tokens[tokenGive][msg.sender], safeMul(amountGive, amount) / amountGet);
- }
-
- function testTrade(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user, uint8 v, bytes32 r, bytes32 s, uint amount, address sender) constant returns(bool) {
- if (!(
- tokens[tokenGet][sender] >= amount &&
- availableVolume(tokenGet, amountGet, tokenGive, amountGive, expires, nonce, user, v, r, s) >= amount
- )) return false;
- return true;
- }
-
- function availableVolume(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user, uint8 v, bytes32 r, bytes32 s) constant returns(uint) {
- bytes32 hash = sha256(this, tokenGet, amountGet, tokenGive, amountGive, expires, nonce);
- if (!(
- (orders[user][hash] || ecrecover(sha3("\x19Ethereum Signed Message:\n32", hash),v,r,s) == user) &&
- block.number <= expires
- )) return 0;
- uint available1 = safeSub(amountGet, orderFills[user][hash]);
- uint available2 = safeMul(tokens[tokenGive][user], amountGet) / amountGive;
- if (available1<available2) return available1;
- return available2;
- }
-
- function amountFilled(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user, uint8 v, bytes32 r, bytes32 s) constant returns(uint) {
- bytes32 hash = sha256(this, tokenGet, amountGet, tokenGive, amountGive, expires, nonce);
- return orderFills[user][hash];
- }
-
- function cancelOrder(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, uint8 v, bytes32 r, bytes32 s) {
- bytes32 hash = sha256(this, tokenGet, amountGet, tokenGive, amountGive, expires, nonce);
- if (!(orders[msg.sender][hash] || ecrecover(sha3("\x19Ethereum Signed Message:\n32", hash),v,r,s) == msg.sender)) throw;
- orderFills[msg.sender][hash] = amountGet;
- Cancel(tokenGet, amountGet, tokenGive, amountGive, expires, nonce, msg.sender, v, r, s);
- }
-}
diff --git a/packages/contracts/src/1.0.0/Exchange/Exchange_v1.sol b/packages/contracts/src/1.0.0/Exchange/Exchange_v1.sol
deleted file mode 100644
index 3f8e7368d..000000000
--- a/packages/contracts/src/1.0.0/Exchange/Exchange_v1.sol
+++ /dev/null
@@ -1,602 +0,0 @@
-/*
-
- Copyright 2018 ZeroEx Intl.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-*/
-
-pragma solidity ^0.4.14;
-
-import { TokenTransferProxy_v1 as TokenTransferProxy } from "../TokenTransferProxy/TokenTransferProxy_v1.sol";
-import { Token_v1 as Token } from "../Token/Token_v1.sol";
-import { SafeMath_v1 as SafeMath } from "../SafeMath/SafeMath_v1.sol";
-
-/// @title Exchange - Facilitates exchange of ERC20 tokens.
-/// @author Amir Bandeali - <amir@0xProject.com>, Will Warren - <will@0xProject.com>
-contract Exchange_v1 is SafeMath {
-
- // Error Codes
- enum Errors {
- ORDER_EXPIRED, // Order has already expired
- ORDER_FULLY_FILLED_OR_CANCELLED, // Order has already been fully filled or cancelled
- ROUNDING_ERROR_TOO_LARGE, // Rounding error too large
- INSUFFICIENT_BALANCE_OR_ALLOWANCE // Insufficient balance or allowance for token transfer
- }
-
- string constant public VERSION = "1.0.0";
- uint16 constant public EXTERNAL_QUERY_GAS_LIMIT = 4999; // Changes to state require at least 5000 gas
-
- address public ZRX_TOKEN_CONTRACT;
- address public TOKEN_TRANSFER_PROXY_CONTRACT;
-
- // Mappings of orderHash => amounts of takerTokenAmount filled or cancelled.
- mapping (bytes32 => uint) public filled;
- mapping (bytes32 => uint) public cancelled;
-
- event LogFill(
- address indexed maker,
- address taker,
- address indexed feeRecipient,
- address makerToken,
- address takerToken,
- uint filledMakerTokenAmount,
- uint filledTakerTokenAmount,
- uint paidMakerFee,
- uint paidTakerFee,
- bytes32 indexed tokens, // keccak256(makerToken, takerToken), allows subscribing to a token pair
- bytes32 orderHash
- );
-
- event LogCancel(
- address indexed maker,
- address indexed feeRecipient,
- address makerToken,
- address takerToken,
- uint cancelledMakerTokenAmount,
- uint cancelledTakerTokenAmount,
- bytes32 indexed tokens,
- bytes32 orderHash
- );
-
- event LogError(uint8 indexed errorId, bytes32 indexed orderHash);
-
- struct Order {
- address maker;
- address taker;
- address makerToken;
- address takerToken;
- address feeRecipient;
- uint makerTokenAmount;
- uint takerTokenAmount;
- uint makerFee;
- uint takerFee;
- uint expirationTimestampInSec;
- bytes32 orderHash;
- }
-
- function Exchange_v1(address _zrxToken, address _tokenTransferProxy) {
- ZRX_TOKEN_CONTRACT = _zrxToken;
- TOKEN_TRANSFER_PROXY_CONTRACT = _tokenTransferProxy;
- }
-
- /*
- * Core exchange functions
- */
-
- /// @dev Fills the input order.
- /// @param orderAddresses Array of order's maker, taker, makerToken, takerToken, and feeRecipient.
- /// @param orderValues Array of order's makerTokenAmount, takerTokenAmount, makerFee, takerFee, expirationTimestampInSec, and salt.
- /// @param fillTakerTokenAmount Desired amount of takerToken to fill.
- /// @param shouldThrowOnInsufficientBalanceOrAllowance Test if transfer will fail before attempting.
- /// @param v ECDSA signature parameter v.
- /// @param r ECDSA signature parameters r.
- /// @param s ECDSA signature parameters s.
- /// @return Total amount of takerToken filled in trade.
- function fillOrder(
- address[5] orderAddresses,
- uint[6] orderValues,
- uint fillTakerTokenAmount,
- bool shouldThrowOnInsufficientBalanceOrAllowance,
- uint8 v,
- bytes32 r,
- bytes32 s)
- public
- returns (uint filledTakerTokenAmount)
- {
- Order memory order = Order({
- maker: orderAddresses[0],
- taker: orderAddresses[1],
- makerToken: orderAddresses[2],
- takerToken: orderAddresses[3],
- feeRecipient: orderAddresses[4],
- makerTokenAmount: orderValues[0],
- takerTokenAmount: orderValues[1],
- makerFee: orderValues[2],
- takerFee: orderValues[3],
- expirationTimestampInSec: orderValues[4],
- orderHash: getOrderHash(orderAddresses, orderValues)
- });
-
- require(order.taker == address(0) || order.taker == msg.sender);
- require(order.makerTokenAmount > 0 && order.takerTokenAmount > 0 && fillTakerTokenAmount > 0);
- require(isValidSignature(
- order.maker,
- order.orderHash,
- v,
- r,
- s
- ));
-
- if (block.timestamp >= order.expirationTimestampInSec) {
- LogError(uint8(Errors.ORDER_EXPIRED), order.orderHash);
- return 0;
- }
-
- uint remainingTakerTokenAmount = safeSub(order.takerTokenAmount, getUnavailableTakerTokenAmount(order.orderHash));
- filledTakerTokenAmount = min256(fillTakerTokenAmount, remainingTakerTokenAmount);
- if (filledTakerTokenAmount == 0) {
- LogError(uint8(Errors.ORDER_FULLY_FILLED_OR_CANCELLED), order.orderHash);
- return 0;
- }
-
- if (isRoundingError(filledTakerTokenAmount, order.takerTokenAmount, order.makerTokenAmount)) {
- LogError(uint8(Errors.ROUNDING_ERROR_TOO_LARGE), order.orderHash);
- return 0;
- }
-
- if (!shouldThrowOnInsufficientBalanceOrAllowance && !isTransferable(order, filledTakerTokenAmount)) {
- LogError(uint8(Errors.INSUFFICIENT_BALANCE_OR_ALLOWANCE), order.orderHash);
- return 0;
- }
-
- uint filledMakerTokenAmount = getPartialAmount(filledTakerTokenAmount, order.takerTokenAmount, order.makerTokenAmount);
- uint paidMakerFee;
- uint paidTakerFee;
- filled[order.orderHash] = safeAdd(filled[order.orderHash], filledTakerTokenAmount);
- require(transferViaTokenTransferProxy(
- order.makerToken,
- order.maker,
- msg.sender,
- filledMakerTokenAmount
- ));
- require(transferViaTokenTransferProxy(
- order.takerToken,
- msg.sender,
- order.maker,
- filledTakerTokenAmount
- ));
- if (order.feeRecipient != address(0)) {
- if (order.makerFee > 0) {
- paidMakerFee = getPartialAmount(filledTakerTokenAmount, order.takerTokenAmount, order.makerFee);
- require(transferViaTokenTransferProxy(
- ZRX_TOKEN_CONTRACT,
- order.maker,
- order.feeRecipient,
- paidMakerFee
- ));
- }
- if (order.takerFee > 0) {
- paidTakerFee = getPartialAmount(filledTakerTokenAmount, order.takerTokenAmount, order.takerFee);
- require(transferViaTokenTransferProxy(
- ZRX_TOKEN_CONTRACT,
- msg.sender,
- order.feeRecipient,
- paidTakerFee
- ));
- }
- }
-
- LogFill(
- order.maker,
- msg.sender,
- order.feeRecipient,
- order.makerToken,
- order.takerToken,
- filledMakerTokenAmount,
- filledTakerTokenAmount,
- paidMakerFee,
- paidTakerFee,
- keccak256(order.makerToken, order.takerToken),
- order.orderHash
- );
- return filledTakerTokenAmount;
- }
-
- /// @dev Cancels the input order.
- /// @param orderAddresses Array of order's maker, taker, makerToken, takerToken, and feeRecipient.
- /// @param orderValues Array of order's makerTokenAmount, takerTokenAmount, makerFee, takerFee, expirationTimestampInSec, and salt.
- /// @param cancelTakerTokenAmount Desired amount of takerToken to cancel in order.
- /// @return Amount of takerToken cancelled.
- function cancelOrder(
- address[5] orderAddresses,
- uint[6] orderValues,
- uint cancelTakerTokenAmount)
- public
- returns (uint)
- {
- Order memory order = Order({
- maker: orderAddresses[0],
- taker: orderAddresses[1],
- makerToken: orderAddresses[2],
- takerToken: orderAddresses[3],
- feeRecipient: orderAddresses[4],
- makerTokenAmount: orderValues[0],
- takerTokenAmount: orderValues[1],
- makerFee: orderValues[2],
- takerFee: orderValues[3],
- expirationTimestampInSec: orderValues[4],
- orderHash: getOrderHash(orderAddresses, orderValues)
- });
-
- require(order.maker == msg.sender);
- require(order.makerTokenAmount > 0 && order.takerTokenAmount > 0 && cancelTakerTokenAmount > 0);
-
- if (block.timestamp >= order.expirationTimestampInSec) {
- LogError(uint8(Errors.ORDER_EXPIRED), order.orderHash);
- return 0;
- }
-
- uint remainingTakerTokenAmount = safeSub(order.takerTokenAmount, getUnavailableTakerTokenAmount(order.orderHash));
- uint cancelledTakerTokenAmount = min256(cancelTakerTokenAmount, remainingTakerTokenAmount);
- if (cancelledTakerTokenAmount == 0) {
- LogError(uint8(Errors.ORDER_FULLY_FILLED_OR_CANCELLED), order.orderHash);
- return 0;
- }
-
- cancelled[order.orderHash] = safeAdd(cancelled[order.orderHash], cancelledTakerTokenAmount);
-
- LogCancel(
- order.maker,
- order.feeRecipient,
- order.makerToken,
- order.takerToken,
- getPartialAmount(cancelledTakerTokenAmount, order.takerTokenAmount, order.makerTokenAmount),
- cancelledTakerTokenAmount,
- keccak256(order.makerToken, order.takerToken),
- order.orderHash
- );
- return cancelledTakerTokenAmount;
- }
-
- /*
- * Wrapper functions
- */
-
- /// @dev Fills an order with specified parameters and ECDSA signature, throws if specified amount not filled entirely.
- /// @param orderAddresses Array of order's maker, taker, makerToken, takerToken, and feeRecipient.
- /// @param orderValues Array of order's makerTokenAmount, takerTokenAmount, makerFee, takerFee, expirationTimestampInSec, and salt.
- /// @param fillTakerTokenAmount Desired amount of takerToken to fill.
- /// @param v ECDSA signature parameter v.
- /// @param r ECDSA signature parameters r.
- /// @param s ECDSA signature parameters s.
- function fillOrKillOrder(
- address[5] orderAddresses,
- uint[6] orderValues,
- uint fillTakerTokenAmount,
- uint8 v,
- bytes32 r,
- bytes32 s)
- public
- {
- require(fillOrder(
- orderAddresses,
- orderValues,
- fillTakerTokenAmount,
- false,
- v,
- r,
- s
- ) == fillTakerTokenAmount);
- }
-
- /// @dev Synchronously executes multiple fill orders in a single transaction.
- /// @param orderAddresses Array of address arrays containing individual order addresses.
- /// @param orderValues Array of uint arrays containing individual order values.
- /// @param fillTakerTokenAmounts Array of desired amounts of takerToken to fill in orders.
- /// @param shouldThrowOnInsufficientBalanceOrAllowance Test if transfers will fail before attempting.
- /// @param v Array ECDSA signature v parameters.
- /// @param r Array of ECDSA signature r parameters.
- /// @param s Array of ECDSA signature s parameters.
- function batchFillOrders(
- address[5][] orderAddresses,
- uint[6][] orderValues,
- uint[] fillTakerTokenAmounts,
- bool shouldThrowOnInsufficientBalanceOrAllowance,
- uint8[] v,
- bytes32[] r,
- bytes32[] s)
- public
- {
- for (uint i = 0; i < orderAddresses.length; i++) {
- fillOrder(
- orderAddresses[i],
- orderValues[i],
- fillTakerTokenAmounts[i],
- shouldThrowOnInsufficientBalanceOrAllowance,
- v[i],
- r[i],
- s[i]
- );
- }
- }
-
- /// @dev Synchronously executes multiple fillOrKill orders in a single transaction.
- /// @param orderAddresses Array of address arrays containing individual order addresses.
- /// @param orderValues Array of uint arrays containing individual order values.
- /// @param fillTakerTokenAmounts Array of desired amounts of takerToken to fill in orders.
- /// @param v Array ECDSA signature v parameters.
- /// @param r Array of ECDSA signature r parameters.
- /// @param s Array of ECDSA signature s parameters.
- function batchFillOrKillOrders(
- address[5][] orderAddresses,
- uint[6][] orderValues,
- uint[] fillTakerTokenAmounts,
- uint8[] v,
- bytes32[] r,
- bytes32[] s)
- public
- {
- for (uint i = 0; i < orderAddresses.length; i++) {
- fillOrKillOrder(
- orderAddresses[i],
- orderValues[i],
- fillTakerTokenAmounts[i],
- v[i],
- r[i],
- s[i]
- );
- }
- }
-
- /// @dev Synchronously executes multiple fill orders in a single transaction until total fillTakerTokenAmount filled.
- /// @param orderAddresses Array of address arrays containing individual order addresses.
- /// @param orderValues Array of uint arrays containing individual order values.
- /// @param fillTakerTokenAmount Desired total amount of takerToken to fill in orders.
- /// @param shouldThrowOnInsufficientBalanceOrAllowance Test if transfers will fail before attempting.
- /// @param v Array ECDSA signature v parameters.
- /// @param r Array of ECDSA signature r parameters.
- /// @param s Array of ECDSA signature s parameters.
- /// @return Total amount of fillTakerTokenAmount filled in orders.
- function fillOrdersUpTo(
- address[5][] orderAddresses,
- uint[6][] orderValues,
- uint fillTakerTokenAmount,
- bool shouldThrowOnInsufficientBalanceOrAllowance,
- uint8[] v,
- bytes32[] r,
- bytes32[] s)
- public
- returns (uint)
- {
- uint filledTakerTokenAmount = 0;
- for (uint i = 0; i < orderAddresses.length; i++) {
- require(orderAddresses[i][3] == orderAddresses[0][3]); // takerToken must be the same for each order
- filledTakerTokenAmount = safeAdd(filledTakerTokenAmount, fillOrder(
- orderAddresses[i],
- orderValues[i],
- safeSub(fillTakerTokenAmount, filledTakerTokenAmount),
- shouldThrowOnInsufficientBalanceOrAllowance,
- v[i],
- r[i],
- s[i]
- ));
- if (filledTakerTokenAmount == fillTakerTokenAmount) break;
- }
- return filledTakerTokenAmount;
- }
-
- /// @dev Synchronously cancels multiple orders in a single transaction.
- /// @param orderAddresses Array of address arrays containing individual order addresses.
- /// @param orderValues Array of uint arrays containing individual order values.
- /// @param cancelTakerTokenAmounts Array of desired amounts of takerToken to cancel in orders.
- function batchCancelOrders(
- address[5][] orderAddresses,
- uint[6][] orderValues,
- uint[] cancelTakerTokenAmounts)
- public
- {
- for (uint i = 0; i < orderAddresses.length; i++) {
- cancelOrder(
- orderAddresses[i],
- orderValues[i],
- cancelTakerTokenAmounts[i]
- );
- }
- }
-
- /*
- * Constant public functions
- */
-
- /// @dev Calculates Keccak-256 hash of order with specified parameters.
- /// @param orderAddresses Array of order's maker, taker, makerToken, takerToken, and feeRecipient.
- /// @param orderValues Array of order's makerTokenAmount, takerTokenAmount, makerFee, takerFee, expirationTimestampInSec, and salt.
- /// @return Keccak-256 hash of order.
- function getOrderHash(address[5] orderAddresses, uint[6] orderValues)
- public
- constant
- returns (bytes32)
- {
- return keccak256(
- address(this),
- orderAddresses[0], // maker
- orderAddresses[1], // taker
- orderAddresses[2], // makerToken
- orderAddresses[3], // takerToken
- orderAddresses[4], // feeRecipient
- orderValues[0], // makerTokenAmount
- orderValues[1], // takerTokenAmount
- orderValues[2], // makerFee
- orderValues[3], // takerFee
- orderValues[4], // expirationTimestampInSec
- orderValues[5] // salt
- );
- }
-
- /// @dev Verifies that an order signature is valid.
- /// @param signer address of signer.
- /// @param hash Signed Keccak-256 hash.
- /// @param v ECDSA signature parameter v.
- /// @param r ECDSA signature parameters r.
- /// @param s ECDSA signature parameters s.
- /// @return Validity of order signature.
- function isValidSignature(
- address signer,
- bytes32 hash,
- uint8 v,
- bytes32 r,
- bytes32 s)
- public
- constant
- returns (bool)
- {
- return signer == ecrecover(
- keccak256("\x19Ethereum Signed Message:\n32", hash),
- v,
- r,
- s
- );
- }
-
- /// @dev Checks if rounding error > 0.1%.
- /// @param numerator Numerator.
- /// @param denominator Denominator.
- /// @param target Value to multiply with numerator/denominator.
- /// @return Rounding error is present.
- function isRoundingError(uint numerator, uint denominator, uint target)
- public
- constant
- returns (bool)
- {
- uint remainder = mulmod(target, numerator, denominator);
- if (remainder == 0) return false; // No rounding error.
-
- uint errPercentageTimes1000000 = safeDiv(
- safeMul(remainder, 1000000),
- safeMul(numerator, target)
- );
- return errPercentageTimes1000000 > 1000;
- }
-
- /// @dev Calculates partial value given a numerator and denominator.
- /// @param numerator Numerator.
- /// @param denominator Denominator.
- /// @param target Value to calculate partial of.
- /// @return Partial value of target.
- function getPartialAmount(uint numerator, uint denominator, uint target)
- public
- constant
- returns (uint)
- {
- return safeDiv(safeMul(numerator, target), denominator);
- }
-
- /// @dev Calculates the sum of values already filled and cancelled for a given order.
- /// @param orderHash The Keccak-256 hash of the given order.
- /// @return Sum of values already filled and cancelled.
- function getUnavailableTakerTokenAmount(bytes32 orderHash)
- public
- constant
- returns (uint)
- {
- return safeAdd(filled[orderHash], cancelled[orderHash]);
- }
-
-
- /*
- * Internal functions
- */
-
- /// @dev Transfers a token using TokenTransferProxy transferFrom function.
- /// @param token Address of token to transferFrom.
- /// @param from Address transfering token.
- /// @param to Address receiving token.
- /// @param value Amount of token to transfer.
- /// @return Success of token transfer.
- function transferViaTokenTransferProxy(
- address token,
- address from,
- address to,
- uint value)
- internal
- returns (bool)
- {
- return TokenTransferProxy(TOKEN_TRANSFER_PROXY_CONTRACT).transferFrom(token, from, to, value);
- }
-
- /// @dev Checks if any order transfers will fail.
- /// @param order Order struct of params that will be checked.
- /// @param fillTakerTokenAmount Desired amount of takerToken to fill.
- /// @return Predicted result of transfers.
- function isTransferable(Order order, uint fillTakerTokenAmount)
- internal
- constant // The called token contracts may attempt to change state, but will not be able to due to gas limits on getBalance and getAllowance.
- returns (bool)
- {
- address taker = msg.sender;
- uint fillMakerTokenAmount = getPartialAmount(fillTakerTokenAmount, order.takerTokenAmount, order.makerTokenAmount);
-
- if (order.feeRecipient != address(0)) {
- bool isMakerTokenZRX = order.makerToken == ZRX_TOKEN_CONTRACT;
- bool isTakerTokenZRX = order.takerToken == ZRX_TOKEN_CONTRACT;
- uint paidMakerFee = getPartialAmount(fillTakerTokenAmount, order.takerTokenAmount, order.makerFee);
- uint paidTakerFee = getPartialAmount(fillTakerTokenAmount, order.takerTokenAmount, order.takerFee);
- uint requiredMakerZRX = isMakerTokenZRX ? safeAdd(fillMakerTokenAmount, paidMakerFee) : paidMakerFee;
- uint requiredTakerZRX = isTakerTokenZRX ? safeAdd(fillTakerTokenAmount, paidTakerFee) : paidTakerFee;
-
- if ( getBalance(ZRX_TOKEN_CONTRACT, order.maker) < requiredMakerZRX
- || getAllowance(ZRX_TOKEN_CONTRACT, order.maker) < requiredMakerZRX
- || getBalance(ZRX_TOKEN_CONTRACT, taker) < requiredTakerZRX
- || getAllowance(ZRX_TOKEN_CONTRACT, taker) < requiredTakerZRX
- ) return false;
-
- if (!isMakerTokenZRX && ( getBalance(order.makerToken, order.maker) < fillMakerTokenAmount // Don't double check makerToken if ZRX
- || getAllowance(order.makerToken, order.maker) < fillMakerTokenAmount)
- ) return false;
- if (!isTakerTokenZRX && ( getBalance(order.takerToken, taker) < fillTakerTokenAmount // Don't double check takerToken if ZRX
- || getAllowance(order.takerToken, taker) < fillTakerTokenAmount)
- ) return false;
- } else if ( getBalance(order.makerToken, order.maker) < fillMakerTokenAmount
- || getAllowance(order.makerToken, order.maker) < fillMakerTokenAmount
- || getBalance(order.takerToken, taker) < fillTakerTokenAmount
- || getAllowance(order.takerToken, taker) < fillTakerTokenAmount
- ) return false;
-
- return true;
- }
-
- /// @dev Get token balance of an address.
- /// @param token Address of token.
- /// @param owner Address of owner.
- /// @return Token balance of owner.
- function getBalance(address token, address owner)
- internal
- constant // The called token contract may attempt to change state, but will not be able to due to an added gas limit.
- returns (uint)
- {
- return Token(token).balanceOf.gas(EXTERNAL_QUERY_GAS_LIMIT)(owner); // Limit gas to prevent reentrancy
- }
-
- /// @dev Get allowance of token given to TokenTransferProxy by an address.
- /// @param token Address of token.
- /// @param owner Address of owner.
- /// @return Allowance of token given to TokenTransferProxy by owner.
- function getAllowance(address token, address owner)
- internal
- constant // The called token contract may attempt to change state, but will not be able to due to an added gas limit.
- returns (uint)
- {
- return Token(token).allowance.gas(EXTERNAL_QUERY_GAS_LIMIT)(owner, TOKEN_TRANSFER_PROXY_CONTRACT); // Limit gas to prevent reentrancy
- }
-}
diff --git a/packages/contracts/src/1.0.0/Exchange/IExchange_v1.sol b/packages/contracts/src/1.0.0/Exchange/IExchange_v1.sol
deleted file mode 100644
index ec4bce7b0..000000000
--- a/packages/contracts/src/1.0.0/Exchange/IExchange_v1.sol
+++ /dev/null
@@ -1,226 +0,0 @@
-pragma solidity ^0.4.19;
-
-contract IExchange_v1 {
-
- // Error Codes
- enum Errors {
- ORDER_EXPIRED, // Order has already expired
- ORDER_FULLY_FILLED_OR_CANCELLED, // Order has already been fully filled or cancelled
- ROUNDING_ERROR_TOO_LARGE, // Rounding error too large
- INSUFFICIENT_BALANCE_OR_ALLOWANCE // Insufficient balance or allowance for token transfer
- }
-
- event LogError(uint8 indexed errorId, bytes32 indexed orderHash);
-
- event LogFill(
- address indexed maker,
- address taker,
- address indexed feeRecipient,
- address makerToken,
- address takerToken,
- uint filledMakerTokenAmount,
- uint filledTakerTokenAmount,
- uint paidMakerFee,
- uint paidTakerFee,
- bytes32 indexed tokens, // keccak256(makerToken, takerToken), allows subscribing to a token pair
- bytes32 orderHash
- );
-
- event LogCancel(
- address indexed maker,
- address indexed feeRecipient,
- address makerToken,
- address takerToken,
- uint cancelledMakerTokenAmount,
- uint cancelledTakerTokenAmount,
- bytes32 indexed tokens,
- bytes32 orderHash
- );
-
- function ZRX_TOKEN_CONTRACT()
- public view
- returns (address);
-
- function TOKEN_TRANSFER_PROXY_CONTRACT()
- public view
- returns (address);
-
- function EXTERNAL_QUERY_GAS_LIMIT()
- public view
- returns (uint16);
-
- function VERSION()
- public view
- returns (string);
-
- function filled(bytes32)
- public view
- returns (uint256);
-
- function cancelled(bytes32)
- public view
- returns (uint256);
-
- /// @dev Calculates the sum of values already filled and cancelled for a given order.
- /// @param orderHash The Keccak-256 hash of the given order.
- /// @return Sum of values already filled and cancelled.
- function getUnavailableTakerTokenAmount(bytes32 orderHash)
- public constant
- returns (uint);
-
- /// @dev Calculates partial value given a numerator and denominator.
- /// @param numerator Numerator.
- /// @param denominator Denominator.
- /// @param target Value to calculate partial of.
- /// @return Partial value of target.
- function getPartialAmount(uint numerator, uint denominator, uint target)
- public constant
- returns (uint);
-
- /// @dev Checks if rounding error > 0.1%.
- /// @param numerator Numerator.
- /// @param denominator Denominator.
- /// @param target Value to multiply with numerator/denominator.
- /// @return Rounding error is present.
- function isRoundingError(uint numerator, uint denominator, uint target)
- public constant
- returns (bool);
-
- /// @dev Calculates Keccak-256 hash of order with specified parameters.
- /// @param orderAddresses Array of order's maker, taker, makerToken, takerToken, and feeRecipient.
- /// @param orderValues Array of order's makerTokenAmount, takerTokenAmount, makerFee, takerFee, expirationTimestampInSec, and salt.
- /// @return Keccak-256 hash of order.
- function getOrderHash(address[5] orderAddresses, uint[6] orderValues)
- public
- constant
- returns (bytes32);
-
- /// @dev Verifies that an order signature is valid.
- /// @param signer address of signer.
- /// @param hash Signed Keccak-256 hash.
- /// @param v ECDSA signature parameter v.
- /// @param r ECDSA signature parameters r.
- /// @param s ECDSA signature parameters s.
- /// @return Validity of order signature.
- function isValidSignature(
- address signer,
- bytes32 hash,
- uint8 v,
- bytes32 r,
- bytes32 s)
- public constant
- returns (bool);
-
- /// @dev Fills the input order.
- /// @param orderAddresses Array of order's maker, taker, makerToken, takerToken, and feeRecipient.
- /// @param orderValues Array of order's makerTokenAmount, takerTokenAmount, makerFee, takerFee, expirationTimestampInSec, and salt.
- /// @param fillTakerTokenAmount Desired amount of takerToken to fill.
- /// @param shouldThrowOnInsufficientBalanceOrAllowance Test if transfer will fail before attempting.
- /// @param v ECDSA signature parameter v.
- /// @param r ECDSA signature parameters r.
- /// @param s ECDSA signature parameters s.
- /// @return Total amount of takerToken filled in trade.
- function fillOrder(
- address[5] orderAddresses,
- uint[6] orderValues,
- uint fillTakerTokenAmount,
- bool shouldThrowOnInsufficientBalanceOrAllowance,
- uint8 v,
- bytes32 r,
- bytes32 s)
- public
- returns (uint filledTakerTokenAmount);
-
- /// @dev Cancels the input order.
- /// @param orderAddresses Array of order's maker, taker, makerToken, takerToken, and feeRecipient.
- /// @param orderValues Array of order's makerTokenAmount, takerTokenAmount, makerFee, takerFee, expirationTimestampInSec, and salt.
- /// @param cancelTakerTokenAmount Desired amount of takerToken to cancel in order.
- /// @return Amount of takerToken cancelled.
- function cancelOrder(
- address[5] orderAddresses,
- uint[6] orderValues,
- uint cancelTakerTokenAmount)
- public
- returns (uint);
-
-
- /// @dev Fills an order with specified parameters and ECDSA signature, throws if specified amount not filled entirely.
- /// @param orderAddresses Array of order's maker, taker, makerToken, takerToken, and feeRecipient.
- /// @param orderValues Array of order's makerTokenAmount, takerTokenAmount, makerFee, takerFee, expirationTimestampInSec, and salt.
- /// @param fillTakerTokenAmount Desired amount of takerToken to fill.
- /// @param v ECDSA signature parameter v.
- /// @param r ECDSA signature parameters r.
- /// @param s ECDSA signature parameters s.
- function fillOrKillOrder(
- address[5] orderAddresses,
- uint[6] orderValues,
- uint fillTakerTokenAmount,
- uint8 v,
- bytes32 r,
- bytes32 s)
- public;
-
- /// @dev Synchronously executes multiple fill orders in a single transaction.
- /// @param orderAddresses Array of address arrays containing individual order addresses.
- /// @param orderValues Array of uint arrays containing individual order values.
- /// @param fillTakerTokenAmounts Array of desired amounts of takerToken to fill in orders.
- /// @param shouldThrowOnInsufficientBalanceOrAllowance Test if transfers will fail before attempting.
- /// @param v Array ECDSA signature v parameters.
- /// @param r Array of ECDSA signature r parameters.
- /// @param s Array of ECDSA signature s parameters.
- function batchFillOrders(
- address[5][] orderAddresses,
- uint[6][] orderValues,
- uint[] fillTakerTokenAmounts,
- bool shouldThrowOnInsufficientBalanceOrAllowance,
- uint8[] v,
- bytes32[] r,
- bytes32[] s)
- public;
-
- /// @dev Synchronously executes multiple fillOrKill orders in a single transaction.
- /// @param orderAddresses Array of address arrays containing individual order addresses.
- /// @param orderValues Array of uint arrays containing individual order values.
- /// @param fillTakerTokenAmounts Array of desired amounts of takerToken to fill in orders.
- /// @param v Array ECDSA signature v parameters.
- /// @param r Array of ECDSA signature r parameters.
- /// @param s Array of ECDSA signature s parameters.
- function batchFillOrKillOrders(
- address[5][] orderAddresses,
- uint[6][] orderValues,
- uint[] fillTakerTokenAmounts,
- uint8[] v,
- bytes32[] r,
- bytes32[] s)
- public;
-
- /// @dev Synchronously executes multiple fill orders in a single transaction until total fillTakerTokenAmount filled.
- /// @param orderAddresses Array of address arrays containing individual order addresses.
- /// @param orderValues Array of uint arrays containing individual order values.
- /// @param fillTakerTokenAmount Desired total amount of takerToken to fill in orders.
- /// @param shouldThrowOnInsufficientBalanceOrAllowance Test if transfers will fail before attempting.
- /// @param v Array ECDSA signature v parameters.
- /// @param r Array of ECDSA signature r parameters.
- /// @param s Array of ECDSA signature s parameters.
- /// @return Total amount of fillTakerTokenAmount filled in orders.
- function fillOrdersUpTo(
- address[5][] orderAddresses,
- uint[6][] orderValues,
- uint fillTakerTokenAmount,
- bool shouldThrowOnInsufficientBalanceOrAllowance,
- uint8[] v,
- bytes32[] r,
- bytes32[] s)
- public
- returns (uint);
-
- /// @dev Synchronously cancels multiple orders in a single transaction.
- /// @param orderAddresses Array of address arrays containing individual order addresses.
- /// @param orderValues Array of uint arrays containing individual order values.
- /// @param cancelTakerTokenAmounts Array of desired amounts of takerToken to cancel in orders.
- function batchCancelOrders(
- address[5][] orderAddresses,
- uint[6][] orderValues,
- uint[] cancelTakerTokenAmounts)
- public;
-}
diff --git a/packages/contracts/src/1.0.0/MultiSigWalletWithTImeLockExceptRemoveAuthorizedAddress/MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress.sol b/packages/contracts/src/1.0.0/MultiSigWalletWithTImeLockExceptRemoveAuthorizedAddress/MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress.sol
deleted file mode 100644
index aee722c53..000000000
--- a/packages/contracts/src/1.0.0/MultiSigWalletWithTImeLockExceptRemoveAuthorizedAddress/MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress.sol
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
-
- Copyright 2018 ZeroEx Intl.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-*/
-
-pragma solidity ^0.4.10;
-
-import "../../2.0.0/multisig/MultiSigWalletWithTimeLock.sol";
-
-contract MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress is MultiSigWalletWithTimeLock {
-
- address public TOKEN_TRANSFER_PROXY_CONTRACT;
-
- modifier validRemoveAuthorizedAddressTx(uint transactionId) {
- Transaction storage tx = transactions[transactionId];
- require(tx.destination == TOKEN_TRANSFER_PROXY_CONTRACT);
- require(isFunctionRemoveAuthorizedAddress(tx.data));
- _;
- }
-
- /// @dev Contract constructor sets initial owners, required number of confirmations, time lock, and tokenTransferProxy address.
- /// @param _owners List of initial owners.
- /// @param _required Number of required confirmations.
- /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.
- /// @param _tokenTransferProxy Address of TokenTransferProxy contract.
- function MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress(
- address[] _owners,
- uint _required,
- uint _secondsTimeLocked,
- address _tokenTransferProxy)
- public
- MultiSigWalletWithTimeLock(_owners, _required, _secondsTimeLocked)
- {
- TOKEN_TRANSFER_PROXY_CONTRACT = _tokenTransferProxy;
- }
-
- /// @dev Allows execution of removeAuthorizedAddress without time lock.
- /// @param transactionId Transaction ID.
- function executeRemoveAuthorizedAddress(uint transactionId)
- public
- notExecuted(transactionId)
- fullyConfirmed(transactionId)
- validRemoveAuthorizedAddressTx(transactionId)
- {
- Transaction storage tx = transactions[transactionId];
- tx.executed = true;
- if (tx.destination.call.value(tx.value)(tx.data))
- Execution(transactionId);
- else {
- ExecutionFailure(transactionId);
- tx.executed = false;
- }
- }
-
- /// @dev Compares first 4 bytes of byte array to removeAuthorizedAddress function signature.
- /// @param data Transaction data.
- /// @return Successful if data is a call to removeAuthorizedAddress.
- function isFunctionRemoveAuthorizedAddress(bytes data)
- public
- constant
- returns (bool)
- {
- bytes4 removeAuthorizedAddressSignature = bytes4(sha3("removeAuthorizedAddress(address)"));
- for (uint i = 0; i < 4; i++) {
- require(data[i] == removeAuthorizedAddressSignature[i]);
- }
- return true;
- }
-}
diff --git a/packages/contracts/src/1.0.0/Ownable/IOwnable_v1.sol b/packages/contracts/src/1.0.0/Ownable/IOwnable_v1.sol
deleted file mode 100644
index 7e22d544d..000000000
--- a/packages/contracts/src/1.0.0/Ownable/IOwnable_v1.sol
+++ /dev/null
@@ -1,18 +0,0 @@
-pragma solidity ^0.4.19;
-
-/*
- * Ownable
- *
- * Base contract with an owner.
- * Provides onlyOwner modifier, which prevents function from running if it is called by anyone other than the owner.
- */
-
-contract IOwnable_v1 {
-
- function owner()
- public view
- returns (address);
-
- function transferOwnership(address newOwner)
- public;
-}
diff --git a/packages/contracts/src/1.0.0/Ownable/Ownable_v1.sol b/packages/contracts/src/1.0.0/Ownable/Ownable_v1.sol
deleted file mode 100644
index c87438fa4..000000000
--- a/packages/contracts/src/1.0.0/Ownable/Ownable_v1.sol
+++ /dev/null
@@ -1,27 +0,0 @@
-pragma solidity ^0.4.11;
-
-/*
- * Ownable
- *
- * Base contract with an owner.
- * Provides onlyOwner modifier, which prevents function from running if it is called by anyone other than the owner.
- */
-
-contract Ownable_v1 {
- address public owner;
-
- function Ownable_v1() {
- owner = msg.sender;
- }
-
- modifier onlyOwner() {
- require(msg.sender == owner);
- _;
- }
-
- function transferOwnership(address newOwner) onlyOwner {
- if (newOwner != address(0)) {
- owner = newOwner;
- }
- }
-}
diff --git a/packages/contracts/src/1.0.0/SafeMath/SafeMath_v1.sol b/packages/contracts/src/1.0.0/SafeMath/SafeMath_v1.sol
deleted file mode 100644
index 341d611ec..000000000
--- a/packages/contracts/src/1.0.0/SafeMath/SafeMath_v1.sol
+++ /dev/null
@@ -1,73 +0,0 @@
-pragma solidity ^0.4.11;
-
-contract SafeMath_v1 {
- function safeMul(uint a, uint b)
- internal
- constant
- returns (uint256)
- {
- uint c = a * b;
- assert(a == 0 || c / a == b);
- return c;
- }
-
- function safeDiv(uint a, uint b)
- internal
- constant
- returns (uint256)
- {
- uint c = a / b;
- return c;
- }
-
- function safeSub(uint a, uint b)
- internal
- constant
- returns (uint256)
- {
- assert(b <= a);
- return a - b;
- }
-
- function safeAdd(uint a, uint b)
- internal
- constant
- returns (uint256)
- {
- uint c = a + b;
- assert(c >= a);
- return c;
- }
-
- function max64(uint64 a, uint64 b)
- internal
- constant
- returns (uint64)
- {
- return a >= b ? a : b;
- }
-
- function min64(uint64 a, uint64 b)
- internal
- constant
- returns (uint64)
- {
- return a < b ? a : b;
- }
-
- function max256(uint256 a, uint256 b)
- internal
- constant
- returns (uint256)
- {
- return a >= b ? a : b;
- }
-
- function min256(uint256 a, uint256 b)
- internal
- constant
- returns (uint256)
- {
- return a < b ? a : b;
- }
-}
diff --git a/packages/contracts/src/1.0.0/TokenRegistry/ITokenRegistery.sol b/packages/contracts/src/1.0.0/TokenRegistry/ITokenRegistery.sol
deleted file mode 100644
index b8bdaf3b9..000000000
--- a/packages/contracts/src/1.0.0/TokenRegistry/ITokenRegistery.sol
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
-
- Copyright 2018 ZeroEx Intl.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-*/
-
-pragma solidity ^0.4.21;
-
-import { IOwnable_v1 as IOwnable } from "../Ownable/IOwnable_v1.sol";
-
-/// @title Token Registry - Stores metadata associated with ERC20 tokens. See ERC22 https://github.com/ethereum/EIPs/issues/22
-/// @author Amir Bandeali - <amir@0xProject.com>, Will Warren - <will@0xProject.com>
-contract ITokenRegistery is IOwnable {
-
- event LogAddToken(
- address indexed token,
- string name,
- string symbol,
- uint8 decimals,
- bytes ipfsHash,
- bytes swarmHash
- );
-
- event LogRemoveToken(
- address indexed token,
- string name,
- string symbol,
- uint8 decimals,
- bytes ipfsHash,
- bytes swarmHash
- );
-
- event LogTokenNameChange(
- address indexed token,
- string oldName,
- string newName
- );
-
- event LogTokenSymbolChange(
- address indexed token,
- string oldSymbol,
- string newSymbol
- );
-
- event LogTokenIpfsHashChange(
- address indexed token,
- bytes oldIpfsHash,
- bytes newIpfsHash
- );
-
- event LogTokenSwarmHashChange(
- address indexed token,
- bytes oldSwarmHash,
- bytes newSwarmHash
- );
-
- function tokens(address tokenAddress)
- public view
- returns (
- address token,
- string name,
- string symbol,
- uint8 decimals,
- bytes ipfsHash,
- bytes swarmHash
- );
-
- function tokenAddresses(uint256 index)
- public view
- returns (address);
-
-
- /// @dev Allows owner to add a new token to the registry.
- /// @param _token Address of new token.
- /// @param _name Name of new token.
- /// @param _symbol Symbol for new token.
- /// @param _decimals Number of decimals, divisibility of new token.
- /// @param _ipfsHash IPFS hash of token icon.
- /// @param _swarmHash Swarm hash of token icon.
- function addToken(
- address _token,
- string _name,
- string _symbol,
- uint8 _decimals,
- bytes _ipfsHash,
- bytes _swarmHash)
- public;
-
- /// @dev Allows owner to remove an existing token from the registry.
- /// @param _token Address of existing token.
- function removeToken(address _token, uint _index)
- public;
-
- /// @dev Allows owner to modify an existing token's name.
- /// @param _token Address of existing token.
- /// @param _name New name.
- function setTokenName(address _token, string _name)
- public;
-
- /// @dev Allows owner to modify an existing token's symbol.
- /// @param _token Address of existing token.
- /// @param _symbol New symbol.
- function setTokenSymbol(address _token, string _symbol)
- public;
-
- /// @dev Allows owner to modify an existing token's IPFS hash.
- /// @param _token Address of existing token.
- /// @param _ipfsHash New IPFS hash.
- function setTokenIpfsHash(address _token, bytes _ipfsHash)
- public;
-
- /// @dev Allows owner to modify an existing token's Swarm hash.
- /// @param _token Address of existing token.
- /// @param _swarmHash New Swarm hash.
- function setTokenSwarmHash(address _token, bytes _swarmHash)
- public;
-
- /*
- * Web3 call functions
- */
-
- /// @dev Provides a registered token's address when given the token symbol.
- /// @param _symbol Symbol of registered token.
- /// @return Token's address.
- function getTokenAddressBySymbol(string _symbol)
- public constant
- returns (address);
-
- /// @dev Provides a registered token's address when given the token name.
- /// @param _name Name of registered token.
- /// @return Token's address.
- function getTokenAddressByName(string _name)
- public constant
- returns (address);
-
- /// @dev Provides a registered token's metadata, looked up by address.
- /// @param _token Address of registered token.
- /// @return Token metadata.
- function getTokenMetaData(address _token)
- public constant
- returns (
- address, //tokenAddress
- string, //name
- string, //symbol
- uint8, //decimals
- bytes, //ipfsHash
- bytes //swarmHash
- );
-
- /// @dev Provides a registered token's metadata, looked up by name.
- /// @param _name Name of registered token.
- /// @return Token metadata.
- function getTokenByName(string _name)
- public constant
- returns (
- address, //tokenAddress
- string, //name
- string, //symbol
- uint8, //decimals
- bytes, //ipfsHash
- bytes //swarmHash
- );
-
- /// @dev Provides a registered token's metadata, looked up by symbol.
- /// @param _symbol Symbol of registered token.
- /// @return Token metadata.
- function getTokenBySymbol(string _symbol)
- public constant
- returns (
- address, //tokenAddress
- string, //name
- string, //symbol
- uint8, //decimals
- bytes, //ipfsHash
- bytes //swarmHash
- );
-
- /// @dev Returns an array containing all token addresses.
- /// @return Array of token addresses.
- function getTokenAddresses()
- public constant
- returns (address[]);
-}
diff --git a/packages/contracts/src/1.0.0/TokenRegistry/TokenRegistry.sol b/packages/contracts/src/1.0.0/TokenRegistry/TokenRegistry.sol
deleted file mode 100644
index 7417a10a3..000000000
--- a/packages/contracts/src/1.0.0/TokenRegistry/TokenRegistry.sol
+++ /dev/null
@@ -1,308 +0,0 @@
-/*
-
- Copyright 2018 ZeroEx Intl.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-*/
-
-pragma solidity ^0.4.11;
-
-import { Ownable_v1 as Ownable } from "../Ownable/Ownable_v1.sol";
-
-/// @title Token Registry - Stores metadata associated with ERC20 tokens. See ERC22 https://github.com/ethereum/EIPs/issues/22
-/// @author Amir Bandeali - <amir@0xProject.com>, Will Warren - <will@0xProject.com>
-contract TokenRegistry is Ownable {
-
- event LogAddToken(
- address indexed token,
- string name,
- string symbol,
- uint8 decimals,
- bytes ipfsHash,
- bytes swarmHash
- );
-
- event LogRemoveToken(
- address indexed token,
- string name,
- string symbol,
- uint8 decimals,
- bytes ipfsHash,
- bytes swarmHash
- );
-
- event LogTokenNameChange(address indexed token, string oldName, string newName);
- event LogTokenSymbolChange(address indexed token, string oldSymbol, string newSymbol);
- event LogTokenIpfsHashChange(address indexed token, bytes oldIpfsHash, bytes newIpfsHash);
- event LogTokenSwarmHashChange(address indexed token, bytes oldSwarmHash, bytes newSwarmHash);
-
- mapping (address => TokenMetadata) public tokens;
- mapping (string => address) tokenBySymbol;
- mapping (string => address) tokenByName;
-
- address[] public tokenAddresses;
-
- struct TokenMetadata {
- address token;
- string name;
- string symbol;
- uint8 decimals;
- bytes ipfsHash;
- bytes swarmHash;
- }
-
- modifier tokenExists(address _token) {
- require(tokens[_token].token != address(0));
- _;
- }
-
- modifier tokenDoesNotExist(address _token) {
- require(tokens[_token].token == address(0));
- _;
- }
-
- modifier nameDoesNotExist(string _name) {
- require(tokenByName[_name] == address(0));
- _;
- }
-
- modifier symbolDoesNotExist(string _symbol) {
- require(tokenBySymbol[_symbol] == address(0));
- _;
- }
-
- modifier addressNotNull(address _address) {
- require(_address != address(0));
- _;
- }
-
-
- /// @dev Allows owner to add a new token to the registry.
- /// @param _token Address of new token.
- /// @param _name Name of new token.
- /// @param _symbol Symbol for new token.
- /// @param _decimals Number of decimals, divisibility of new token.
- /// @param _ipfsHash IPFS hash of token icon.
- /// @param _swarmHash Swarm hash of token icon.
- function addToken(
- address _token,
- string _name,
- string _symbol,
- uint8 _decimals,
- bytes _ipfsHash,
- bytes _swarmHash)
- public
- onlyOwner
- tokenDoesNotExist(_token)
- addressNotNull(_token)
- symbolDoesNotExist(_symbol)
- nameDoesNotExist(_name)
- {
- tokens[_token] = TokenMetadata({
- token: _token,
- name: _name,
- symbol: _symbol,
- decimals: _decimals,
- ipfsHash: _ipfsHash,
- swarmHash: _swarmHash
- });
- tokenAddresses.push(_token);
- tokenBySymbol[_symbol] = _token;
- tokenByName[_name] = _token;
- LogAddToken(
- _token,
- _name,
- _symbol,
- _decimals,
- _ipfsHash,
- _swarmHash
- );
- }
-
- /// @dev Allows owner to remove an existing token from the registry.
- /// @param _token Address of existing token.
- function removeToken(address _token, uint _index)
- public
- onlyOwner
- tokenExists(_token)
- {
- require(tokenAddresses[_index] == _token);
-
- tokenAddresses[_index] = tokenAddresses[tokenAddresses.length - 1];
- tokenAddresses.length -= 1;
-
- TokenMetadata storage token = tokens[_token];
- LogRemoveToken(
- token.token,
- token.name,
- token.symbol,
- token.decimals,
- token.ipfsHash,
- token.swarmHash
- );
- delete tokenBySymbol[token.symbol];
- delete tokenByName[token.name];
- delete tokens[_token];
- }
-
- /// @dev Allows owner to modify an existing token's name.
- /// @param _token Address of existing token.
- /// @param _name New name.
- function setTokenName(address _token, string _name)
- public
- onlyOwner
- tokenExists(_token)
- nameDoesNotExist(_name)
- {
- TokenMetadata storage token = tokens[_token];
- LogTokenNameChange(_token, token.name, _name);
- delete tokenByName[token.name];
- tokenByName[_name] = _token;
- token.name = _name;
- }
-
- /// @dev Allows owner to modify an existing token's symbol.
- /// @param _token Address of existing token.
- /// @param _symbol New symbol.
- function setTokenSymbol(address _token, string _symbol)
- public
- onlyOwner
- tokenExists(_token)
- symbolDoesNotExist(_symbol)
- {
- TokenMetadata storage token = tokens[_token];
- LogTokenSymbolChange(_token, token.symbol, _symbol);
- delete tokenBySymbol[token.symbol];
- tokenBySymbol[_symbol] = _token;
- token.symbol = _symbol;
- }
-
- /// @dev Allows owner to modify an existing token's IPFS hash.
- /// @param _token Address of existing token.
- /// @param _ipfsHash New IPFS hash.
- function setTokenIpfsHash(address _token, bytes _ipfsHash)
- public
- onlyOwner
- tokenExists(_token)
- {
- TokenMetadata storage token = tokens[_token];
- LogTokenIpfsHashChange(_token, token.ipfsHash, _ipfsHash);
- token.ipfsHash = _ipfsHash;
- }
-
- /// @dev Allows owner to modify an existing token's Swarm hash.
- /// @param _token Address of existing token.
- /// @param _swarmHash New Swarm hash.
- function setTokenSwarmHash(address _token, bytes _swarmHash)
- public
- onlyOwner
- tokenExists(_token)
- {
- TokenMetadata storage token = tokens[_token];
- LogTokenSwarmHashChange(_token, token.swarmHash, _swarmHash);
- token.swarmHash = _swarmHash;
- }
-
- /*
- * Web3 call functions
- */
-
- /// @dev Provides a registered token's address when given the token symbol.
- /// @param _symbol Symbol of registered token.
- /// @return Token's address.
- function getTokenAddressBySymbol(string _symbol) constant returns (address) {
- return tokenBySymbol[_symbol];
- }
-
- /// @dev Provides a registered token's address when given the token name.
- /// @param _name Name of registered token.
- /// @return Token's address.
- function getTokenAddressByName(string _name) constant returns (address) {
- return tokenByName[_name];
- }
-
- /// @dev Provides a registered token's metadata, looked up by address.
- /// @param _token Address of registered token.
- /// @return Token metadata.
- function getTokenMetaData(address _token)
- public
- constant
- returns (
- address, //tokenAddress
- string, //name
- string, //symbol
- uint8, //decimals
- bytes, //ipfsHash
- bytes //swarmHash
- )
- {
- TokenMetadata memory token = tokens[_token];
- return (
- token.token,
- token.name,
- token.symbol,
- token.decimals,
- token.ipfsHash,
- token.swarmHash
- );
- }
-
- /// @dev Provides a registered token's metadata, looked up by name.
- /// @param _name Name of registered token.
- /// @return Token metadata.
- function getTokenByName(string _name)
- public
- constant
- returns (
- address, //tokenAddress
- string, //name
- string, //symbol
- uint8, //decimals
- bytes, //ipfsHash
- bytes //swarmHash
- )
- {
- address _token = tokenByName[_name];
- return getTokenMetaData(_token);
- }
-
- /// @dev Provides a registered token's metadata, looked up by symbol.
- /// @param _symbol Symbol of registered token.
- /// @return Token metadata.
- function getTokenBySymbol(string _symbol)
- public
- constant
- returns (
- address, //tokenAddress
- string, //name
- string, //symbol
- uint8, //decimals
- bytes, //ipfsHash
- bytes //swarmHash
- )
- {
- address _token = tokenBySymbol[_symbol];
- return getTokenMetaData(_token);
- }
-
- /// @dev Returns an array containing all token addresses.
- /// @return Array of token addresses.
- function getTokenAddresses()
- public
- constant
- returns (address[])
- {
- return tokenAddresses;
- }
-}
diff --git a/packages/contracts/src/1.0.0/TokenTransferProxy/TokenTransferProxy_v1.sol b/packages/contracts/src/1.0.0/TokenTransferProxy/TokenTransferProxy_v1.sol
deleted file mode 100644
index e3659d8ba..000000000
--- a/packages/contracts/src/1.0.0/TokenTransferProxy/TokenTransferProxy_v1.sol
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
-
- Copyright 2018 ZeroEx Intl.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-*/
-
-pragma solidity ^0.4.11;
-
-import { Token_v1 as Token } from "../Token/Token_v1.sol";
-import { Ownable_v1 as Ownable } from "../Ownable/Ownable_v1.sol";
-
-/// @title TokenTransferProxy - Transfers tokens on behalf of contracts that have been approved via decentralized governance.
-/// @author Amir Bandeali - <amir@0xProject.com>, Will Warren - <will@0xProject.com>
-contract TokenTransferProxy_v1 is Ownable {
-
- /// @dev Only authorized addresses can invoke functions with this modifier.
- modifier onlyAuthorized {
- require(authorized[msg.sender]);
- _;
- }
-
- modifier targetAuthorized(address target) {
- require(authorized[target]);
- _;
- }
-
- modifier targetNotAuthorized(address target) {
- require(!authorized[target]);
- _;
- }
-
- mapping (address => bool) public authorized;
- address[] public authorities;
-
- event LogAuthorizedAddressAdded(address indexed target, address indexed caller);
- event LogAuthorizedAddressRemoved(address indexed target, address indexed caller);
-
- /*
- * Public functions
- */
-
- /// @dev Authorizes an address.
- /// @param target Address to authorize.
- function addAuthorizedAddress(address target)
- public
- onlyOwner
- targetNotAuthorized(target)
- {
- authorized[target] = true;
- authorities.push(target);
- LogAuthorizedAddressAdded(target, msg.sender);
- }
-
- /// @dev Removes authorizion of an address.
- /// @param target Address to remove authorization from.
- function removeAuthorizedAddress(address target)
- public
- onlyOwner
- targetAuthorized(target)
- {
- delete authorized[target];
- for (uint i = 0; i < authorities.length; i++) {
- if (authorities[i] == target) {
- authorities[i] = authorities[authorities.length - 1];
- authorities.length -= 1;
- break;
- }
- }
- LogAuthorizedAddressRemoved(target, msg.sender);
- }
-
- /// @dev Calls into ERC20 Token contract, invoking transferFrom.
- /// @param token Address of token to transfer.
- /// @param from Address to transfer token from.
- /// @param to Address to transfer token to.
- /// @param value Amount of token to transfer.
- /// @return Success of transfer.
- function transferFrom(
- address token,
- address from,
- address to,
- uint value)
- public
- onlyAuthorized
- returns (bool)
- {
- return Token(token).transferFrom(from, to, value);
- }
-
- /*
- * Public constant functions
- */
-
- /// @dev Gets all authorized addresses.
- /// @return Array of authorized addresses.
- function getAuthorizedAddresses()
- public
- constant
- returns (address[])
- {
- return authorities;
- }
-}
diff --git a/packages/contracts/src/artifacts/index.ts b/packages/contracts/src/artifacts/index.ts
new file mode 100644
index 000000000..c30972a91
--- /dev/null
+++ b/packages/contracts/src/artifacts/index.ts
@@ -0,0 +1,79 @@
+import { ContractArtifact } from 'ethereum-types';
+
+import * as AssetProxyOwner from '../../generated-artifacts/AssetProxyOwner.json';
+import * as DummyERC20Token from '../../generated-artifacts/DummyERC20Token.json';
+import * as DummyERC721Receiver from '../../generated-artifacts/DummyERC721Receiver.json';
+import * as DummyERC721Token from '../../generated-artifacts/DummyERC721Token.json';
+import * as DummyMultipleReturnERC20Token from '../../generated-artifacts/DummyMultipleReturnERC20Token.json';
+import * as DummyNoReturnERC20Token from '../../generated-artifacts/DummyNoReturnERC20Token.json';
+import * as ERC20Proxy from '../../generated-artifacts/ERC20Proxy.json';
+import * as ERC20Token from '../../generated-artifacts/ERC20Token.json';
+import * as ERC721Proxy from '../../generated-artifacts/ERC721Proxy.json';
+import * as ERC721Token from '../../generated-artifacts/ERC721Token.json';
+import * as Exchange from '../../generated-artifacts/Exchange.json';
+import * as ExchangeWrapper from '../../generated-artifacts/ExchangeWrapper.json';
+import * as Forwarder from '../../generated-artifacts/Forwarder.json';
+import * as IAssetData from '../../generated-artifacts/IAssetData.json';
+import * as IAssetProxy from '../../generated-artifacts/IAssetProxy.json';
+import * as InvalidERC721Receiver from '../../generated-artifacts/InvalidERC721Receiver.json';
+import * as IValidator from '../../generated-artifacts/IValidator.json';
+import * as IWallet from '../../generated-artifacts/IWallet.json';
+import * as MixinAuthorizable from '../../generated-artifacts/MixinAuthorizable.json';
+import * as MultiSigWallet from '../../generated-artifacts/MultiSigWallet.json';
+import * as MultiSigWalletWithTimeLock from '../../generated-artifacts/MultiSigWalletWithTimeLock.json';
+import * as OrderValidator from '../../generated-artifacts/OrderValidator.json';
+import * as ReentrantERC20Token from '../../generated-artifacts/ReentrantERC20Token.json';
+import * as TestAssetProxyDispatcher from '../../generated-artifacts/TestAssetProxyDispatcher.json';
+import * as TestAssetProxyOwner from '../../generated-artifacts/TestAssetProxyOwner.json';
+import * as TestConstants from '../../generated-artifacts/TestConstants.json';
+import * as TestExchangeInternals from '../../generated-artifacts/TestExchangeInternals.json';
+import * as TestLibBytes from '../../generated-artifacts/TestLibBytes.json';
+import * as TestLibs from '../../generated-artifacts/TestLibs.json';
+import * as TestSignatureValidator from '../../generated-artifacts/TestSignatureValidator.json';
+import * as TestStaticCallReceiver from '../../generated-artifacts/TestStaticCallReceiver.json';
+import * as Validator from '../../generated-artifacts/Validator.json';
+import * as Wallet from '../../generated-artifacts/Wallet.json';
+import * as WETH9 from '../../generated-artifacts/WETH9.json';
+import * as Whitelist from '../../generated-artifacts/Whitelist.json';
+import * as ZRXToken from '../../generated-artifacts/ZRXToken.json';
+
+export const artifacts = {
+ AssetProxyOwner: AssetProxyOwner as ContractArtifact,
+ DummyERC20Token: DummyERC20Token as ContractArtifact,
+ DummyERC721Receiver: DummyERC721Receiver as ContractArtifact,
+ DummyERC721Token: DummyERC721Token as ContractArtifact,
+ DummyMultipleReturnERC20Token: DummyMultipleReturnERC20Token as ContractArtifact,
+ DummyNoReturnERC20Token: DummyNoReturnERC20Token as ContractArtifact,
+ ERC20Proxy: ERC20Proxy as ContractArtifact,
+ ERC20Token: ERC20Token as ContractArtifact,
+ ERC721Proxy: ERC721Proxy as ContractArtifact,
+ ERC721Token: ERC721Token as ContractArtifact,
+ Exchange: Exchange as ContractArtifact,
+ ExchangeWrapper: ExchangeWrapper as ContractArtifact,
+ Forwarder: Forwarder as ContractArtifact,
+ IAssetData: IAssetData as ContractArtifact,
+ IAssetProxy: IAssetProxy as ContractArtifact,
+ IValidator: IValidator as ContractArtifact,
+ IWallet: IWallet as ContractArtifact,
+ InvalidERC721Receiver: InvalidERC721Receiver as ContractArtifact,
+ MixinAuthorizable: MixinAuthorizable as ContractArtifact,
+ MultiSigWallet: MultiSigWallet as ContractArtifact,
+ MultiSigWalletWithTimeLock: MultiSigWalletWithTimeLock as ContractArtifact,
+ OrderValidator: OrderValidator as ContractArtifact,
+ ReentrantERC20Token: ReentrantERC20Token as ContractArtifact,
+ TestAssetProxyDispatcher: TestAssetProxyDispatcher as ContractArtifact,
+ TestAssetProxyOwner: TestAssetProxyOwner as ContractArtifact,
+ TestConstants: TestConstants as ContractArtifact,
+ TestExchangeInternals: TestExchangeInternals as ContractArtifact,
+ TestLibBytes: TestLibBytes as ContractArtifact,
+ TestLibs: TestLibs as ContractArtifact,
+ TestSignatureValidator: TestSignatureValidator as ContractArtifact,
+ TestStaticCallReceiver: TestStaticCallReceiver as ContractArtifact,
+ Validator: Validator as ContractArtifact,
+ WETH9: WETH9 as ContractArtifact,
+ Wallet: Wallet as ContractArtifact,
+ Whitelist: Whitelist as ContractArtifact,
+ // Note(albrow): "as any" hack still required here because ZRXToken does not
+ // conform to the v2 artifact type.
+ ZRXToken: (ZRXToken as any) as ContractArtifact,
+};
diff --git a/packages/contracts/src/wrappers/index.ts b/packages/contracts/src/wrappers/index.ts
new file mode 100644
index 000000000..9ca676b56
--- /dev/null
+++ b/packages/contracts/src/wrappers/index.ts
@@ -0,0 +1,34 @@
+export * from '../../generated-wrappers/asset_proxy_owner';
+export * from '../../generated-wrappers/dummy_erc20_token';
+export * from '../../generated-wrappers/dummy_erc721_receiver';
+export * from '../../generated-wrappers/dummy_erc721_token';
+export * from '../../generated-wrappers/dummy_multiple_return_erc20_token';
+export * from '../../generated-wrappers/dummy_no_return_erc20_token';
+export * from '../../generated-wrappers/erc20_proxy';
+export * from '../../generated-wrappers/erc721_proxy';
+export * from '../../generated-wrappers/erc20_token';
+export * from '../../generated-wrappers/erc721_token';
+export * from '../../generated-wrappers/exchange';
+export * from '../../generated-wrappers/exchange_wrapper';
+export * from '../../generated-wrappers/forwarder';
+export * from '../../generated-wrappers/i_asset_data';
+export * from '../../generated-wrappers/i_asset_proxy';
+export * from '../../generated-wrappers/invalid_erc721_receiver';
+export * from '../../generated-wrappers/mixin_authorizable';
+export * from '../../generated-wrappers/multi_sig_wallet';
+export * from '../../generated-wrappers/multi_sig_wallet_with_time_lock';
+export * from '../../generated-wrappers/order_validator';
+export * from '../../generated-wrappers/reentrant_erc20_token';
+export * from '../../generated-wrappers/test_asset_proxy_dispatcher';
+export * from '../../generated-wrappers/test_asset_proxy_owner';
+export * from '../../generated-wrappers/test_constants';
+export * from '../../generated-wrappers/test_exchange_internals';
+export * from '../../generated-wrappers/test_lib_bytes';
+export * from '../../generated-wrappers/test_libs';
+export * from '../../generated-wrappers/test_signature_validator';
+export * from '../../generated-wrappers/test_static_call_receiver';
+export * from '../../generated-wrappers/validator';
+export * from '../../generated-wrappers/wallet';
+export * from '../../generated-wrappers/weth9';
+export * from '../../generated-wrappers/whitelist';
+export * from '../../generated-wrappers/zrx_token';
diff --git a/packages/contracts/test/asset_proxy/authorizable.ts b/packages/contracts/test/asset_proxy/authorizable.ts
index 0c0da46b3..e21af9b81 100644
--- a/packages/contracts/test/asset_proxy/authorizable.ts
+++ b/packages/contracts/test/asset_proxy/authorizable.ts
@@ -1,11 +1,11 @@
-import { BlockchainLifecycle } from '@0xproject/dev-utils';
-import { RevertReason } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
+import { BlockchainLifecycle } from '@0x/dev-utils';
+import { RevertReason } from '@0x/types';
+import { BigNumber } from '@0x/utils';
import * as chai from 'chai';
import * as _ from 'lodash';
-import { MixinAuthorizableContract } from '../../generated_contract_wrappers/mixin_authorizable';
-import { artifacts } from '../utils/artifacts';
+import { MixinAuthorizableContract } from '../../generated-wrappers/mixin_authorizable';
+import { artifacts } from '../../src/artifacts';
import { expectTransactionFailedAsync } from '../utils/assertions';
import { chaiSetup } from '../utils/chai_setup';
import { constants } from '../utils/constants';
diff --git a/packages/contracts/test/asset_proxy/proxies.ts b/packages/contracts/test/asset_proxy/proxies.ts
index 4d70031d1..b8305993e 100644
--- a/packages/contracts/test/asset_proxy/proxies.ts
+++ b/packages/contracts/test/asset_proxy/proxies.ts
@@ -1,19 +1,19 @@
-import { BlockchainLifecycle } from '@0xproject/dev-utils';
-import { assetDataUtils } from '@0xproject/order-utils';
-import { RevertReason } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
+import { BlockchainLifecycle } from '@0x/dev-utils';
+import { assetDataUtils } from '@0x/order-utils';
+import { RevertReason } from '@0x/types';
+import { BigNumber } from '@0x/utils';
import * as chai from 'chai';
import * as _ from 'lodash';
-import { DummyERC20TokenContract } from '../../generated_contract_wrappers/dummy_erc20_token';
-import { DummyERC721ReceiverContract } from '../../generated_contract_wrappers/dummy_erc721_receiver';
-import { DummyERC721TokenContract } from '../../generated_contract_wrappers/dummy_erc721_token';
-import { DummyMultipleReturnERC20TokenContract } from '../../generated_contract_wrappers/dummy_multiple_return_erc20_token';
-import { DummyNoReturnERC20TokenContract } from '../../generated_contract_wrappers/dummy_no_return_erc20_token';
-import { ERC20ProxyContract } from '../../generated_contract_wrappers/erc20_proxy';
-import { ERC721ProxyContract } from '../../generated_contract_wrappers/erc721_proxy';
-import { IAssetProxyContract } from '../../generated_contract_wrappers/i_asset_proxy';
-import { artifacts } from '../utils/artifacts';
+import { DummyERC20TokenContract } from '../../generated-wrappers/dummy_erc20_token';
+import { DummyERC721ReceiverContract } from '../../generated-wrappers/dummy_erc721_receiver';
+import { DummyERC721TokenContract } from '../../generated-wrappers/dummy_erc721_token';
+import { DummyMultipleReturnERC20TokenContract } from '../../generated-wrappers/dummy_multiple_return_erc20_token';
+import { DummyNoReturnERC20TokenContract } from '../../generated-wrappers/dummy_no_return_erc20_token';
+import { ERC20ProxyContract } from '../../generated-wrappers/erc20_proxy';
+import { ERC721ProxyContract } from '../../generated-wrappers/erc721_proxy';
+import { IAssetProxyContract } from '../../generated-wrappers/i_asset_proxy';
+import { artifacts } from '../../src/artifacts';
import { expectTransactionFailedAsync, expectTransactionFailedWithoutReasonAsync } from '../utils/assertions';
import { chaiSetup } from '../utils/chai_setup';
import { constants } from '../utils/constants';
diff --git a/packages/contracts/test/exchange/core.ts b/packages/contracts/test/exchange/core.ts
index acb99eed1..fc8dc5346 100644
--- a/packages/contracts/test/exchange/core.ts
+++ b/packages/contracts/test/exchange/core.ts
@@ -1,25 +1,22 @@
-import { BlockchainLifecycle } from '@0xproject/dev-utils';
-import { assetDataUtils, orderHashUtils } from '@0xproject/order-utils';
-import { RevertReason, SignatureType, SignedOrder } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { BlockchainLifecycle } from '@0x/dev-utils';
+import { assetDataUtils, orderHashUtils } from '@0x/order-utils';
+import { RevertReason, SignatureType, SignedOrder } from '@0x/types';
+import { BigNumber } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import * as chai from 'chai';
import { LogWithDecodedArgs } from 'ethereum-types';
import ethUtil = require('ethereumjs-util');
import * as _ from 'lodash';
-import {
- DummyERC20TokenContract,
- DummyERC20TokenTransferEventArgs,
-} from '../../generated_contract_wrappers/dummy_erc20_token';
-import { DummyERC721TokenContract } from '../../generated_contract_wrappers/dummy_erc721_token';
-import { DummyNoReturnERC20TokenContract } from '../../generated_contract_wrappers/dummy_no_return_erc20_token';
-import { ERC20ProxyContract } from '../../generated_contract_wrappers/erc20_proxy';
-import { ERC721ProxyContract } from '../../generated_contract_wrappers/erc721_proxy';
-import { ExchangeCancelEventArgs, ExchangeContract } from '../../generated_contract_wrappers/exchange';
-import { ReentrantERC20TokenContract } from '../../generated_contract_wrappers/reentrant_erc20_token';
-import { TestStaticCallReceiverContract } from '../../generated_contract_wrappers/test_static_call_receiver';
-import { artifacts } from '../utils/artifacts';
+import { DummyERC20TokenContract, DummyERC20TokenTransferEventArgs } from '../../generated-wrappers/dummy_erc20_token';
+import { DummyERC721TokenContract } from '../../generated-wrappers/dummy_erc721_token';
+import { DummyNoReturnERC20TokenContract } from '../../generated-wrappers/dummy_no_return_erc20_token';
+import { ERC20ProxyContract } from '../../generated-wrappers/erc20_proxy';
+import { ERC721ProxyContract } from '../../generated-wrappers/erc721_proxy';
+import { ExchangeCancelEventArgs, ExchangeContract } from '../../generated-wrappers/exchange';
+import { ReentrantERC20TokenContract } from '../../generated-wrappers/reentrant_erc20_token';
+import { TestStaticCallReceiverContract } from '../../generated-wrappers/test_static_call_receiver';
+import { artifacts } from '../../src/artifacts';
import { expectTransactionFailedAsync } from '../utils/assertions';
import { getLatestBlockTimestampAsync, increaseTimeAndMineBlockAsync } from '../utils/block_timestamp';
import { chaiSetup } from '../utils/chai_setup';
diff --git a/packages/contracts/test/exchange/dispatcher.ts b/packages/contracts/test/exchange/dispatcher.ts
index a8ae897a8..3d3aa42c2 100644
--- a/packages/contracts/test/exchange/dispatcher.ts
+++ b/packages/contracts/test/exchange/dispatcher.ts
@@ -1,19 +1,19 @@
-import { BlockchainLifecycle } from '@0xproject/dev-utils';
-import { assetDataUtils } from '@0xproject/order-utils';
-import { AssetProxyId, RevertReason } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
+import { BlockchainLifecycle } from '@0x/dev-utils';
+import { assetDataUtils } from '@0x/order-utils';
+import { AssetProxyId, RevertReason } from '@0x/types';
+import { BigNumber } from '@0x/utils';
import * as chai from 'chai';
import { LogWithDecodedArgs } from 'ethereum-types';
import * as _ from 'lodash';
-import { DummyERC20TokenContract } from '../../generated_contract_wrappers/dummy_erc20_token';
-import { ERC20ProxyContract } from '../../generated_contract_wrappers/erc20_proxy';
-import { ERC721ProxyContract } from '../../generated_contract_wrappers/erc721_proxy';
+import { DummyERC20TokenContract } from '../../generated-wrappers/dummy_erc20_token';
+import { ERC20ProxyContract } from '../../generated-wrappers/erc20_proxy';
+import { ERC721ProxyContract } from '../../generated-wrappers/erc721_proxy';
import {
TestAssetProxyDispatcherAssetProxyRegisteredEventArgs,
TestAssetProxyDispatcherContract,
-} from '../../generated_contract_wrappers/test_asset_proxy_dispatcher';
-import { artifacts } from '../utils/artifacts';
+} from '../../generated-wrappers/test_asset_proxy_dispatcher';
+import { artifacts } from '../../src/artifacts';
import { expectTransactionFailedAsync } from '../utils/assertions';
import { chaiSetup } from '../utils/chai_setup';
import { constants } from '../utils/constants';
diff --git a/packages/contracts/test/exchange/fill_order.ts b/packages/contracts/test/exchange/fill_order.ts
index b1e08324f..37efaad2b 100644
--- a/packages/contracts/test/exchange/fill_order.ts
+++ b/packages/contracts/test/exchange/fill_order.ts
@@ -1,4 +1,4 @@
-import { BlockchainLifecycle } from '@0xproject/dev-utils';
+import { BlockchainLifecycle } from '@0x/dev-utils';
import * as _ from 'lodash';
import { chaiSetup } from '../utils/chai_setup';
diff --git a/packages/contracts/test/exchange/internal.ts b/packages/contracts/test/exchange/internal.ts
index 156e086af..109be29c6 100644
--- a/packages/contracts/test/exchange/internal.ts
+++ b/packages/contracts/test/exchange/internal.ts
@@ -1,11 +1,11 @@
-import { BlockchainLifecycle } from '@0xproject/dev-utils';
-import { Order, RevertReason, SignedOrder } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
+import { BlockchainLifecycle } from '@0x/dev-utils';
+import { Order, RevertReason, SignedOrder } from '@0x/types';
+import { BigNumber } from '@0x/utils';
import * as chai from 'chai';
import * as _ from 'lodash';
-import { TestExchangeInternalsContract } from '../../generated_contract_wrappers/test_exchange_internals';
-import { artifacts } from '../utils/artifacts';
+import { TestExchangeInternalsContract } from '../../generated-wrappers/test_exchange_internals';
+import { artifacts } from '../../src/artifacts';
import { getRevertReasonOrErrorMessageForSendTransactionAsync } from '../utils/assertions';
import { chaiSetup } from '../utils/chai_setup';
import { bytes32Values, testCombinatoriallyWithReferenceFuncAsync, uint256Values } from '../utils/combinatorial_utils';
diff --git a/packages/contracts/test/exchange/libs.ts b/packages/contracts/test/exchange/libs.ts
index 049b7f37a..503ef0e0f 100644
--- a/packages/contracts/test/exchange/libs.ts
+++ b/packages/contracts/test/exchange/libs.ts
@@ -1,13 +1,13 @@
-import { BlockchainLifecycle } from '@0xproject/dev-utils';
-import { assetDataUtils, orderHashUtils } from '@0xproject/order-utils';
-import { SignedOrder } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
+import { BlockchainLifecycle } from '@0x/dev-utils';
+import { assetDataUtils, orderHashUtils } from '@0x/order-utils';
+import { SignedOrder } from '@0x/types';
+import { BigNumber } from '@0x/utils';
import * as chai from 'chai';
-import { TestConstantsContract } from '../../generated_contract_wrappers/test_constants';
-import { TestLibsContract } from '../../generated_contract_wrappers/test_libs';
+import { TestConstantsContract } from '../../generated-wrappers/test_constants';
+import { TestLibsContract } from '../../generated-wrappers/test_libs';
+import { artifacts } from '../../src/artifacts';
import { addressUtils } from '../utils/address_utils';
-import { artifacts } from '../utils/artifacts';
import { chaiSetup } from '../utils/chai_setup';
import { constants } from '../utils/constants';
import { OrderFactory } from '../utils/order_factory';
diff --git a/packages/contracts/test/exchange/match_orders.ts b/packages/contracts/test/exchange/match_orders.ts
index c6e7b494f..eea9992d9 100644
--- a/packages/contracts/test/exchange/match_orders.ts
+++ b/packages/contracts/test/exchange/match_orders.ts
@@ -1,19 +1,19 @@
-import { BlockchainLifecycle } from '@0xproject/dev-utils';
-import { assetDataUtils } from '@0xproject/order-utils';
-import { RevertReason } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { BlockchainLifecycle } from '@0x/dev-utils';
+import { assetDataUtils } from '@0x/order-utils';
+import { RevertReason } from '@0x/types';
+import { BigNumber } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import * as chai from 'chai';
import * as _ from 'lodash';
-import { DummyERC20TokenContract } from '../../generated_contract_wrappers/dummy_erc20_token';
-import { DummyERC721TokenContract } from '../../generated_contract_wrappers/dummy_erc721_token';
-import { ERC20ProxyContract } from '../../generated_contract_wrappers/erc20_proxy';
-import { ERC721ProxyContract } from '../../generated_contract_wrappers/erc721_proxy';
-import { ExchangeContract } from '../../generated_contract_wrappers/exchange';
-import { ReentrantERC20TokenContract } from '../../generated_contract_wrappers/reentrant_erc20_token';
-import { TestExchangeInternalsContract } from '../../generated_contract_wrappers/test_exchange_internals';
-import { artifacts } from '../utils/artifacts';
+import { DummyERC20TokenContract } from '../../generated-wrappers/dummy_erc20_token';
+import { DummyERC721TokenContract } from '../../generated-wrappers/dummy_erc721_token';
+import { ERC20ProxyContract } from '../../generated-wrappers/erc20_proxy';
+import { ERC721ProxyContract } from '../../generated-wrappers/erc721_proxy';
+import { ExchangeContract } from '../../generated-wrappers/exchange';
+import { ReentrantERC20TokenContract } from '../../generated-wrappers/reentrant_erc20_token';
+import { TestExchangeInternalsContract } from '../../generated-wrappers/test_exchange_internals';
+import { artifacts } from '../../src/artifacts';
import { expectTransactionFailedAsync } from '../utils/assertions';
import { chaiSetup } from '../utils/chai_setup';
import { constants } from '../utils/constants';
diff --git a/packages/contracts/test/exchange/signature_validator.ts b/packages/contracts/test/exchange/signature_validator.ts
index 192ed3ca9..756c72766 100644
--- a/packages/contracts/test/exchange/signature_validator.ts
+++ b/packages/contracts/test/exchange/signature_validator.ts
@@ -1,6 +1,6 @@
-import { BlockchainLifecycle } from '@0xproject/dev-utils';
-import { assetDataUtils, orderHashUtils, signatureUtils } from '@0xproject/order-utils';
-import { RevertReason, SignatureType, SignedOrder } from '@0xproject/types';
+import { BlockchainLifecycle } from '@0x/dev-utils';
+import { assetDataUtils, orderHashUtils, signatureUtils } from '@0x/order-utils';
+import { RevertReason, SignatureType, SignedOrder } from '@0x/types';
import * as chai from 'chai';
import { LogWithDecodedArgs } from 'ethereum-types';
import ethUtil = require('ethereumjs-util');
@@ -8,12 +8,12 @@ import ethUtil = require('ethereumjs-util');
import {
TestSignatureValidatorContract,
TestSignatureValidatorSignatureValidatorApprovalEventArgs,
-} from '../../generated_contract_wrappers/test_signature_validator';
-import { TestStaticCallReceiverContract } from '../../generated_contract_wrappers/test_static_call_receiver';
-import { ValidatorContract } from '../../generated_contract_wrappers/validator';
-import { WalletContract } from '../../generated_contract_wrappers/wallet';
+} from '../../generated-wrappers/test_signature_validator';
+import { TestStaticCallReceiverContract } from '../../generated-wrappers/test_static_call_receiver';
+import { ValidatorContract } from '../../generated-wrappers/validator';
+import { WalletContract } from '../../generated-wrappers/wallet';
+import { artifacts } from '../../src/artifacts';
import { addressUtils } from '../utils/address_utils';
-import { artifacts } from '../utils/artifacts';
import { expectContractCallFailedAsync } from '../utils/assertions';
import { chaiSetup } from '../utils/chai_setup';
import { constants } from '../utils/constants';
diff --git a/packages/contracts/test/exchange/transactions.ts b/packages/contracts/test/exchange/transactions.ts
index 2bdd96b16..1b5eef295 100644
--- a/packages/contracts/test/exchange/transactions.ts
+++ b/packages/contracts/test/exchange/transactions.ts
@@ -1,16 +1,16 @@
-import { BlockchainLifecycle } from '@0xproject/dev-utils';
-import { assetDataUtils, generatePseudoRandomSalt } from '@0xproject/order-utils';
-import { OrderWithoutExchangeAddress, RevertReason, SignedOrder } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
+import { BlockchainLifecycle } from '@0x/dev-utils';
+import { assetDataUtils, generatePseudoRandomSalt } from '@0x/order-utils';
+import { OrderWithoutExchangeAddress, RevertReason, SignedOrder } from '@0x/types';
+import { BigNumber } from '@0x/utils';
import * as chai from 'chai';
import * as _ from 'lodash';
-import { DummyERC20TokenContract } from '../../generated_contract_wrappers/dummy_erc20_token';
-import { ERC20ProxyContract } from '../../generated_contract_wrappers/erc20_proxy';
-import { ExchangeContract } from '../../generated_contract_wrappers/exchange';
-import { ExchangeWrapperContract } from '../../generated_contract_wrappers/exchange_wrapper';
-import { WhitelistContract } from '../../generated_contract_wrappers/whitelist';
-import { artifacts } from '../utils/artifacts';
+import { DummyERC20TokenContract } from '../../generated-wrappers/dummy_erc20_token';
+import { ERC20ProxyContract } from '../../generated-wrappers/erc20_proxy';
+import { ExchangeContract } from '../../generated-wrappers/exchange';
+import { ExchangeWrapperContract } from '../../generated-wrappers/exchange_wrapper';
+import { WhitelistContract } from '../../generated-wrappers/whitelist';
+import { artifacts } from '../../src/artifacts';
import { expectTransactionFailedAsync } from '../utils/assertions';
import { chaiSetup } from '../utils/chai_setup';
import { constants } from '../utils/constants';
diff --git a/packages/contracts/test/exchange/wrapper.ts b/packages/contracts/test/exchange/wrapper.ts
index aadb5ab59..6b660aac5 100644
--- a/packages/contracts/test/exchange/wrapper.ts
+++ b/packages/contracts/test/exchange/wrapper.ts
@@ -1,18 +1,18 @@
-import { BlockchainLifecycle } from '@0xproject/dev-utils';
-import { assetDataUtils, orderHashUtils } from '@0xproject/order-utils';
-import { RevertReason, SignedOrder } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { BlockchainLifecycle } from '@0x/dev-utils';
+import { assetDataUtils, orderHashUtils } from '@0x/order-utils';
+import { RevertReason, SignedOrder } from '@0x/types';
+import { BigNumber } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import * as chai from 'chai';
import * as _ from 'lodash';
-import { DummyERC20TokenContract } from '../../generated_contract_wrappers/dummy_erc20_token';
-import { DummyERC721TokenContract } from '../../generated_contract_wrappers/dummy_erc721_token';
-import { ERC20ProxyContract } from '../../generated_contract_wrappers/erc20_proxy';
-import { ERC721ProxyContract } from '../../generated_contract_wrappers/erc721_proxy';
-import { ExchangeContract } from '../../generated_contract_wrappers/exchange';
-import { ReentrantERC20TokenContract } from '../../generated_contract_wrappers/reentrant_erc20_token';
-import { artifacts } from '../utils/artifacts';
+import { DummyERC20TokenContract } from '../../generated-wrappers/dummy_erc20_token';
+import { DummyERC721TokenContract } from '../../generated-wrappers/dummy_erc721_token';
+import { ERC20ProxyContract } from '../../generated-wrappers/erc20_proxy';
+import { ERC721ProxyContract } from '../../generated-wrappers/erc721_proxy';
+import { ExchangeContract } from '../../generated-wrappers/exchange';
+import { ReentrantERC20TokenContract } from '../../generated-wrappers/reentrant_erc20_token';
+import { artifacts } from '../../src/artifacts';
import { expectTransactionFailedAsync } from '../utils/assertions';
import { getLatestBlockTimestampAsync, increaseTimeAndMineBlockAsync } from '../utils/block_timestamp';
import { chaiSetup } from '../utils/chai_setup';
diff --git a/packages/contracts/test/extensions/forwarder.ts b/packages/contracts/test/extensions/forwarder.ts
index 8424d01fd..c006be0fe 100644
--- a/packages/contracts/test/extensions/forwarder.ts
+++ b/packages/contracts/test/extensions/forwarder.ts
@@ -1,17 +1,17 @@
-import { BlockchainLifecycle } from '@0xproject/dev-utils';
-import { assetDataUtils } from '@0xproject/order-utils';
-import { RevertReason, SignedOrder } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { BlockchainLifecycle } from '@0x/dev-utils';
+import { assetDataUtils } from '@0x/order-utils';
+import { RevertReason, SignedOrder } from '@0x/types';
+import { BigNumber } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import * as chai from 'chai';
import { TransactionReceiptWithDecodedLogs } from 'ethereum-types';
-import { DummyERC20TokenContract } from '../../generated_contract_wrappers/dummy_erc20_token';
-import { DummyERC721TokenContract } from '../../generated_contract_wrappers/dummy_erc721_token';
-import { ExchangeContract } from '../../generated_contract_wrappers/exchange';
-import { ForwarderContract } from '../../generated_contract_wrappers/forwarder';
-import { WETH9Contract } from '../../generated_contract_wrappers/weth9';
-import { artifacts } from '../utils/artifacts';
+import { DummyERC20TokenContract } from '../../generated-wrappers/dummy_erc20_token';
+import { DummyERC721TokenContract } from '../../generated-wrappers/dummy_erc721_token';
+import { ExchangeContract } from '../../generated-wrappers/exchange';
+import { ForwarderContract } from '../../generated-wrappers/forwarder';
+import { WETH9Contract } from '../../generated-wrappers/weth9';
+import { artifacts } from '../../src/artifacts';
import {
expectContractCreationFailedAsync,
expectTransactionFailedAsync,
@@ -45,6 +45,7 @@ describe(ContractName.Forwarder, () => {
let weth: DummyERC20TokenContract;
let zrxToken: DummyERC20TokenContract;
+ let erc20TokenA: DummyERC20TokenContract;
let erc721Token: DummyERC721TokenContract;
let forwarderContract: ForwarderContract;
let wethContract: WETH9Contract;
@@ -77,7 +78,6 @@ describe(ContractName.Forwarder, () => {
erc20Wrapper = new ERC20Wrapper(provider, usedAddresses, owner);
const numDummyErc20ToDeploy = 3;
- let erc20TokenA;
[erc20TokenA, zrxToken] = await erc20Wrapper.deployDummyTokensAsync(
numDummyErc20ToDeploy,
constants.DUMMY_TOKEN_DECIMALS,
@@ -91,7 +91,7 @@ describe(ContractName.Forwarder, () => {
const erc721Balances = await erc721Wrapper.getBalancesAsync();
erc721MakerAssetIds = erc721Balances[makerAddress][erc721Token.address];
- wethContract = await WETH9Contract.deployFrom0xArtifactAsync(artifacts.EtherToken, provider, txDefaults);
+ wethContract = await WETH9Contract.deployFrom0xArtifactAsync(artifacts.WETH9, provider, txDefaults);
weth = new DummyERC20TokenContract(wethContract.abi, wethContract.address, provider);
erc20Wrapper.addDummyTokenContract(weth);
@@ -902,6 +902,269 @@ describe(ContractName.Forwarder, () => {
);
expect(forwarderEthBalance).to.be.bignumber.equal(constants.ZERO_AMOUNT);
});
+ it('Should buy slightly greater MakerAsset when exchange rate is rounded', async () => {
+ // The 0x Protocol contracts round the exchange rate in favor of the Maker.
+ // In this case, the taker must round up how much they're going to spend, which
+ // in turn increases the amount of MakerAsset being purchased.
+ // Example:
+ // The taker wants to buy 5 units of the MakerAsset at a rate of 3M/2T.
+ // For every 2 units of TakerAsset, the taker will receive 3 units of MakerAsset.
+ // To purchase 5 units, the taker must spend 10/3 = 3.33 units of TakerAssset.
+ // However, the Taker can only spend whole units.
+ // Spending floor(10/3) = 3 units will yield a profit of Floor(3*3/2) = Floor(4.5) = 4 units of MakerAsset.
+ // Spending ceil(10/3) = 4 units will yield a profit of Floor(4*3/2) = 6 units of MakerAsset.
+ //
+ // The forwarding contract will opt for the second option, which overbuys, to ensure the taker
+ // receives at least the amount of MakerAsset they requested.
+ //
+ // Construct test case using values from example above
+ orderWithoutFee = await orderFactory.newSignedOrderAsync({
+ makerAssetAmount: new BigNumber('30'),
+ takerAssetAmount: new BigNumber('20'),
+ makerAssetData: assetDataUtils.encodeERC20AssetData(erc20TokenA.address),
+ takerAssetData: assetDataUtils.encodeERC20AssetData(weth.address),
+ makerFee: new BigNumber(0),
+ takerFee: new BigNumber(0),
+ });
+ const ordersWithoutFee = [orderWithoutFee];
+ const feeOrders: SignedOrder[] = [];
+ const desiredMakerAssetFillAmount = new BigNumber('5');
+ const makerAssetFillAmount = new BigNumber('6');
+ const ethValue = new BigNumber('4');
+ // Execute test case
+ tx = await forwarderWrapper.marketBuyOrdersWithEthAsync(
+ ordersWithoutFee,
+ feeOrders,
+ desiredMakerAssetFillAmount,
+ {
+ value: ethValue,
+ from: takerAddress,
+ },
+ );
+ // Fetch end balances and construct expected outputs
+ const takerEthBalanceAfter = await web3Wrapper.getBalanceInWeiAsync(takerAddress);
+ const forwarderEthBalance = await web3Wrapper.getBalanceInWeiAsync(forwarderContract.address);
+ const newBalances = await erc20Wrapper.getBalancesAsync();
+ const primaryTakerAssetFillAmount = ethValue;
+ const totalEthSpent = primaryTakerAssetFillAmount.plus(gasPrice.times(tx.gasUsed));
+ // Validate test case
+ expect(makerAssetFillAmount).to.be.bignumber.greaterThan(desiredMakerAssetFillAmount);
+ expect(takerEthBalanceAfter).to.be.bignumber.equal(takerEthBalanceBefore.minus(totalEthSpent));
+ expect(newBalances[makerAddress][defaultMakerAssetAddress]).to.be.bignumber.equal(
+ erc20Balances[makerAddress][defaultMakerAssetAddress].minus(makerAssetFillAmount),
+ );
+ expect(newBalances[takerAddress][defaultMakerAssetAddress]).to.be.bignumber.equal(
+ erc20Balances[takerAddress][defaultMakerAssetAddress].plus(makerAssetFillAmount),
+ );
+ expect(newBalances[makerAddress][weth.address]).to.be.bignumber.equal(
+ erc20Balances[makerAddress][weth.address].plus(primaryTakerAssetFillAmount),
+ );
+ expect(newBalances[forwarderContract.address][weth.address]).to.be.bignumber.equal(constants.ZERO_AMOUNT);
+ expect(newBalances[forwarderContract.address][defaultMakerAssetAddress]).to.be.bignumber.equal(
+ constants.ZERO_AMOUNT,
+ );
+ expect(forwarderEthBalance).to.be.bignumber.equal(constants.ZERO_AMOUNT);
+ });
+ it('Should buy slightly greater MakerAsset when exchange rate is rounded, and MakerAsset is ZRX', async () => {
+ // See the test case above for a detailed description of this case.
+ // The difference here is that the MakerAsset is ZRX. We expect the same result as above,
+ // but this tests a different code path.
+ //
+ // Construct test case using values from example above
+ orderWithoutFee = await orderFactory.newSignedOrderAsync({
+ makerAssetAmount: new BigNumber('30'),
+ takerAssetAmount: new BigNumber('20'),
+ makerAssetData: zrxAssetData,
+ takerAssetData: assetDataUtils.encodeERC20AssetData(weth.address),
+ makerFee: new BigNumber(0),
+ takerFee: new BigNumber(0),
+ });
+ const ordersWithoutFee = [orderWithoutFee];
+ const feeOrders: SignedOrder[] = [];
+ const desiredMakerAssetFillAmount = new BigNumber('5');
+ const makerAssetFillAmount = new BigNumber('6');
+ const ethValue = new BigNumber('4');
+ // Execute test case
+ tx = await forwarderWrapper.marketBuyOrdersWithEthAsync(
+ ordersWithoutFee,
+ feeOrders,
+ desiredMakerAssetFillAmount,
+ {
+ value: ethValue,
+ from: takerAddress,
+ },
+ );
+ // Fetch end balances and construct expected outputs
+ const takerEthBalanceAfter = await web3Wrapper.getBalanceInWeiAsync(takerAddress);
+ const forwarderEthBalance = await web3Wrapper.getBalanceInWeiAsync(forwarderContract.address);
+ const newBalances = await erc20Wrapper.getBalancesAsync();
+ const primaryTakerAssetFillAmount = ethValue;
+ const totalEthSpent = primaryTakerAssetFillAmount.plus(gasPrice.times(tx.gasUsed));
+ // Validate test case
+ expect(makerAssetFillAmount).to.be.bignumber.greaterThan(desiredMakerAssetFillAmount);
+ expect(takerEthBalanceAfter).to.be.bignumber.equal(takerEthBalanceBefore.minus(totalEthSpent));
+ expect(newBalances[makerAddress][zrxToken.address]).to.be.bignumber.equal(
+ erc20Balances[makerAddress][zrxToken.address].minus(makerAssetFillAmount),
+ );
+ expect(newBalances[takerAddress][zrxToken.address]).to.be.bignumber.equal(
+ erc20Balances[takerAddress][zrxToken.address].plus(makerAssetFillAmount),
+ );
+ expect(newBalances[makerAddress][weth.address]).to.be.bignumber.equal(
+ erc20Balances[makerAddress][weth.address].plus(primaryTakerAssetFillAmount),
+ );
+ expect(newBalances[forwarderContract.address][weth.address]).to.be.bignumber.equal(constants.ZERO_AMOUNT);
+ expect(forwarderEthBalance).to.be.bignumber.equal(constants.ZERO_AMOUNT);
+ });
+ it('Should buy slightly greater MakerAsset when exchange rate is rounded (Regression Test)', async () => {
+ // Order taken from a transaction on mainnet that failed due to a rounding error.
+ orderWithoutFee = await orderFactory.newSignedOrderAsync({
+ makerAssetAmount: new BigNumber('268166666666666666666'),
+ takerAssetAmount: new BigNumber('219090625878836371'),
+ makerAssetData: assetDataUtils.encodeERC20AssetData(erc20TokenA.address),
+ takerAssetData: assetDataUtils.encodeERC20AssetData(weth.address),
+ makerFee: new BigNumber(0),
+ takerFee: new BigNumber(0),
+ });
+ const ordersWithoutFee = [orderWithoutFee];
+ const feeOrders: SignedOrder[] = [];
+ // The taker will receive more than the desired amount of makerAsset due to rounding
+ const desiredMakerAssetFillAmount = new BigNumber('5000000000000000000');
+ const ethValue = new BigNumber('4084971271824171');
+ const makerAssetFillAmount = ethValue
+ .times(orderWithoutFee.makerAssetAmount)
+ .dividedToIntegerBy(orderWithoutFee.takerAssetAmount);
+ // Execute test case
+ tx = await forwarderWrapper.marketBuyOrdersWithEthAsync(
+ ordersWithoutFee,
+ feeOrders,
+ desiredMakerAssetFillAmount,
+ {
+ value: ethValue,
+ from: takerAddress,
+ },
+ );
+ // Fetch end balances and construct expected outputs
+ const takerEthBalanceAfter = await web3Wrapper.getBalanceInWeiAsync(takerAddress);
+ const forwarderEthBalance = await web3Wrapper.getBalanceInWeiAsync(forwarderContract.address);
+ const newBalances = await erc20Wrapper.getBalancesAsync();
+ const primaryTakerAssetFillAmount = ethValue;
+ const totalEthSpent = primaryTakerAssetFillAmount.plus(gasPrice.times(tx.gasUsed));
+ // Validate test case
+ expect(makerAssetFillAmount).to.be.bignumber.greaterThan(desiredMakerAssetFillAmount);
+ expect(takerEthBalanceAfter).to.be.bignumber.equal(takerEthBalanceBefore.minus(totalEthSpent));
+ expect(newBalances[makerAddress][defaultMakerAssetAddress]).to.be.bignumber.equal(
+ erc20Balances[makerAddress][defaultMakerAssetAddress].minus(makerAssetFillAmount),
+ );
+ expect(newBalances[takerAddress][defaultMakerAssetAddress]).to.be.bignumber.equal(
+ erc20Balances[takerAddress][defaultMakerAssetAddress].plus(makerAssetFillAmount),
+ );
+ expect(newBalances[makerAddress][weth.address]).to.be.bignumber.equal(
+ erc20Balances[makerAddress][weth.address].plus(primaryTakerAssetFillAmount),
+ );
+ expect(newBalances[forwarderContract.address][weth.address]).to.be.bignumber.equal(constants.ZERO_AMOUNT);
+ expect(newBalances[forwarderContract.address][defaultMakerAssetAddress]).to.be.bignumber.equal(
+ constants.ZERO_AMOUNT,
+ );
+ expect(forwarderEthBalance).to.be.bignumber.equal(constants.ZERO_AMOUNT);
+ });
+ it('Should buy slightly greater MakerAsset when exchange rate is rounded, and MakerAsset is ZRX (Regression Test)', async () => {
+ // Order taken from a transaction on mainnet that failed due to a rounding error.
+ orderWithoutFee = await orderFactory.newSignedOrderAsync({
+ makerAssetAmount: new BigNumber('268166666666666666666'),
+ takerAssetAmount: new BigNumber('219090625878836371'),
+ makerAssetData: zrxAssetData,
+ takerAssetData: assetDataUtils.encodeERC20AssetData(weth.address),
+ makerFee: new BigNumber(0),
+ takerFee: new BigNumber(0),
+ });
+ const ordersWithoutFee = [orderWithoutFee];
+ const feeOrders: SignedOrder[] = [];
+ // The taker will receive more than the desired amount of makerAsset due to rounding
+ const desiredMakerAssetFillAmount = new BigNumber('5000000000000000000');
+ const ethValue = new BigNumber('4084971271824171');
+ const makerAssetFillAmount = ethValue
+ .times(orderWithoutFee.makerAssetAmount)
+ .dividedToIntegerBy(orderWithoutFee.takerAssetAmount);
+ // Execute test case
+ tx = await forwarderWrapper.marketBuyOrdersWithEthAsync(
+ ordersWithoutFee,
+ feeOrders,
+ desiredMakerAssetFillAmount,
+ {
+ value: ethValue,
+ from: takerAddress,
+ },
+ );
+ // Fetch end balances and construct expected outputs
+ const takerEthBalanceAfter = await web3Wrapper.getBalanceInWeiAsync(takerAddress);
+ const forwarderEthBalance = await web3Wrapper.getBalanceInWeiAsync(forwarderContract.address);
+ const newBalances = await erc20Wrapper.getBalancesAsync();
+ const primaryTakerAssetFillAmount = ethValue;
+ const totalEthSpent = primaryTakerAssetFillAmount.plus(gasPrice.times(tx.gasUsed));
+ // Validate test case
+ expect(makerAssetFillAmount).to.be.bignumber.greaterThan(desiredMakerAssetFillAmount);
+ expect(takerEthBalanceAfter).to.be.bignumber.equal(takerEthBalanceBefore.minus(totalEthSpent));
+ expect(newBalances[makerAddress][zrxToken.address]).to.be.bignumber.equal(
+ erc20Balances[makerAddress][zrxToken.address].minus(makerAssetFillAmount),
+ );
+ expect(newBalances[takerAddress][zrxToken.address]).to.be.bignumber.equal(
+ erc20Balances[takerAddress][zrxToken.address].plus(makerAssetFillAmount),
+ );
+ expect(newBalances[makerAddress][weth.address]).to.be.bignumber.equal(
+ erc20Balances[makerAddress][weth.address].plus(primaryTakerAssetFillAmount),
+ );
+ expect(newBalances[forwarderContract.address][weth.address]).to.be.bignumber.equal(constants.ZERO_AMOUNT);
+ expect(forwarderEthBalance).to.be.bignumber.equal(constants.ZERO_AMOUNT);
+ });
+ it('Should buy correct MakerAsset when exchange rate is NOT rounded, and MakerAsset is ZRX (Regression Test)', async () => {
+ // An extra unit of TakerAsset was sent to the exchange contract to account for rounding errors, in Forwarder v1.
+ // Specifically, the takerFillAmount was calculated using Floor(desiredMakerAmount * exchangeRate) + 1
+ // We have since changed this to be Ceil(desiredMakerAmount * exchangeRate)
+ // These calculations produce different results when `desiredMakerAmount * exchangeRate` is an integer.
+ //
+ // This test verifies that `ceil` is sufficient:
+ // Let TakerAssetAmount = MakerAssetAmount * 2
+ // -> exchangeRate = TakerAssetAmount / MakerAssetAmount = (2*MakerAssetAmount)/MakerAssetAmount = 2
+ // .: desiredMakerAmount * exchangeRate is an integer.
+ //
+ // Construct test case using values from example above
+ orderWithoutFee = await orderFactory.newSignedOrderAsync({
+ makerAssetAmount: new BigNumber('30'),
+ takerAssetAmount: new BigNumber('60'),
+ makerAssetData: zrxAssetData,
+ takerAssetData: assetDataUtils.encodeERC20AssetData(weth.address),
+ makerFee: new BigNumber(0),
+ takerFee: new BigNumber(0),
+ });
+ const ordersWithoutFee = [orderWithoutFee];
+ const feeOrders: SignedOrder[] = [];
+ const makerAssetFillAmount = new BigNumber('5');
+ const ethValue = new BigNumber('10');
+ // Execute test case
+ tx = await forwarderWrapper.marketBuyOrdersWithEthAsync(ordersWithoutFee, feeOrders, makerAssetFillAmount, {
+ value: ethValue,
+ from: takerAddress,
+ });
+ // Fetch end balances and construct expected outputs
+ const takerEthBalanceAfter = await web3Wrapper.getBalanceInWeiAsync(takerAddress);
+ const forwarderEthBalance = await web3Wrapper.getBalanceInWeiAsync(forwarderContract.address);
+ const newBalances = await erc20Wrapper.getBalancesAsync();
+ const primaryTakerAssetFillAmount = ethValue;
+ const totalEthSpent = primaryTakerAssetFillAmount.plus(gasPrice.times(tx.gasUsed));
+ // Validate test case
+ expect(takerEthBalanceAfter).to.be.bignumber.equal(takerEthBalanceBefore.minus(totalEthSpent));
+ expect(newBalances[makerAddress][zrxToken.address]).to.be.bignumber.equal(
+ erc20Balances[makerAddress][zrxToken.address].minus(makerAssetFillAmount),
+ );
+ expect(newBalances[takerAddress][zrxToken.address]).to.be.bignumber.equal(
+ erc20Balances[takerAddress][zrxToken.address].plus(makerAssetFillAmount),
+ );
+ expect(newBalances[makerAddress][weth.address]).to.be.bignumber.equal(
+ erc20Balances[makerAddress][weth.address].plus(primaryTakerAssetFillAmount),
+ );
+ expect(newBalances[forwarderContract.address][weth.address]).to.be.bignumber.equal(constants.ZERO_AMOUNT);
+ expect(forwarderEthBalance).to.be.bignumber.equal(constants.ZERO_AMOUNT);
+ });
});
describe('marketBuyOrdersWithEth with extra fees', () => {
it('should buy an asset and send fee to feeRecipient', async () => {
diff --git a/packages/contracts/test/extensions/order_validator.ts b/packages/contracts/test/extensions/order_validator.ts
index 3a57cfc37..37bd1b0e2 100644
--- a/packages/contracts/test/extensions/order_validator.ts
+++ b/packages/contracts/test/extensions/order_validator.ts
@@ -1,17 +1,17 @@
-import { BlockchainLifecycle } from '@0xproject/dev-utils';
-import { assetDataUtils, orderHashUtils } from '@0xproject/order-utils';
-import { SignedOrder } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
+import { BlockchainLifecycle } from '@0x/dev-utils';
+import { assetDataUtils, orderHashUtils } from '@0x/order-utils';
+import { SignedOrder } from '@0x/types';
+import { BigNumber } from '@0x/utils';
import * as chai from 'chai';
import * as _ from 'lodash';
-import { DummyERC20TokenContract } from '../../generated_contract_wrappers/dummy_erc20_token';
-import { DummyERC721TokenContract } from '../../generated_contract_wrappers/dummy_erc721_token';
-import { ERC20ProxyContract } from '../../generated_contract_wrappers/erc20_proxy';
-import { ERC721ProxyContract } from '../../generated_contract_wrappers/erc721_proxy';
-import { ExchangeContract } from '../../generated_contract_wrappers/exchange';
-import { OrderValidatorContract } from '../../generated_contract_wrappers/order_validator';
-import { artifacts } from '../utils/artifacts';
+import { DummyERC20TokenContract } from '../../generated-wrappers/dummy_erc20_token';
+import { DummyERC721TokenContract } from '../../generated-wrappers/dummy_erc721_token';
+import { ERC20ProxyContract } from '../../generated-wrappers/erc20_proxy';
+import { ERC721ProxyContract } from '../../generated-wrappers/erc721_proxy';
+import { ExchangeContract } from '../../generated-wrappers/exchange';
+import { OrderValidatorContract } from '../../generated-wrappers/order_validator';
+import { artifacts } from '../../src/artifacts';
import { chaiSetup } from '../utils/chai_setup';
import { constants } from '../utils/constants';
import { ERC20Wrapper } from '../utils/erc20_wrapper';
diff --git a/packages/contracts/test/global_hooks.ts b/packages/contracts/test/global_hooks.ts
index cf7c52efd..2e9ac9e21 100644
--- a/packages/contracts/test/global_hooks.ts
+++ b/packages/contracts/test/global_hooks.ts
@@ -1,4 +1,4 @@
-import { env, EnvVars } from '@0xproject/dev-utils';
+import { env, EnvVars } from '@0x/dev-utils';
import { coverage } from './utils/coverage';
import { profiler } from './utils/profiler';
diff --git a/packages/contracts/test/libraries/lib_bytes.ts b/packages/contracts/test/libraries/lib_bytes.ts
index 13640a761..b1a389f00 100644
--- a/packages/contracts/test/libraries/lib_bytes.ts
+++ b/packages/contracts/test/libraries/lib_bytes.ts
@@ -1,14 +1,14 @@
-import { BlockchainLifecycle } from '@0xproject/dev-utils';
-import { generatePseudoRandomSalt } from '@0xproject/order-utils';
-import { RevertReason } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
+import { BlockchainLifecycle } from '@0x/dev-utils';
+import { generatePseudoRandomSalt } from '@0x/order-utils';
+import { RevertReason } from '@0x/types';
+import { BigNumber } from '@0x/utils';
import BN = require('bn.js');
import * as chai from 'chai';
import ethUtil = require('ethereumjs-util');
import * as _ from 'lodash';
-import { TestLibBytesContract } from '../../generated_contract_wrappers/test_lib_bytes';
-import { artifacts } from '../utils/artifacts';
+import { TestLibBytesContract } from '../../generated-wrappers/test_lib_bytes';
+import { artifacts } from '../../src/artifacts';
import { expectContractCallFailedAsync } from '../utils/assertions';
import { chaiSetup } from '../utils/chai_setup';
import { constants } from '../utils/constants';
diff --git a/packages/contracts/test/multisig/asset_proxy_owner.ts b/packages/contracts/test/multisig/asset_proxy_owner.ts
index 299707512..087152316 100644
--- a/packages/contracts/test/multisig/asset_proxy_owner.ts
+++ b/packages/contracts/test/multisig/asset_proxy_owner.ts
@@ -1,6 +1,6 @@
-import { BlockchainLifecycle } from '@0xproject/dev-utils';
-import { RevertReason } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
+import { BlockchainLifecycle } from '@0x/dev-utils';
+import { RevertReason } from '@0x/types';
+import { BigNumber } from '@0x/utils';
import * as chai from 'chai';
import { LogWithDecodedArgs } from 'ethereum-types';
@@ -10,10 +10,10 @@ import {
AssetProxyOwnerExecutionEventArgs,
AssetProxyOwnerExecutionFailureEventArgs,
AssetProxyOwnerSubmissionEventArgs,
-} from '../../generated_contract_wrappers/asset_proxy_owner';
-import { MixinAuthorizableContract } from '../../generated_contract_wrappers/mixin_authorizable';
-import { TestAssetProxyOwnerContract } from '../../generated_contract_wrappers/test_asset_proxy_owner';
-import { artifacts } from '../utils/artifacts';
+} from '../../generated-wrappers/asset_proxy_owner';
+import { MixinAuthorizableContract } from '../../generated-wrappers/mixin_authorizable';
+import { TestAssetProxyOwnerContract } from '../../generated-wrappers/test_asset_proxy_owner';
+import { artifacts } from '../../src/artifacts';
import {
expectContractCallFailedAsync,
expectContractCreationFailedAsync,
diff --git a/packages/contracts/test/multisig/multi_sig_with_time_lock.ts b/packages/contracts/test/multisig/multi_sig_with_time_lock.ts
index 0b17c298b..1c0cb0515 100644
--- a/packages/contracts/test/multisig/multi_sig_with_time_lock.ts
+++ b/packages/contracts/test/multisig/multi_sig_with_time_lock.ts
@@ -1,11 +1,11 @@
-import { BlockchainLifecycle } from '@0xproject/dev-utils';
-import { RevertReason } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
+import { BlockchainLifecycle } from '@0x/dev-utils';
+import { RevertReason } from '@0x/types';
+import { BigNumber } from '@0x/utils';
import * as chai from 'chai';
import { LogWithDecodedArgs } from 'ethereum-types';
import * as _ from 'lodash';
-import { DummyERC20TokenContract } from '../../generated_contract_wrappers/dummy_erc20_token';
+import { DummyERC20TokenContract } from '../../generated-wrappers/dummy_erc20_token';
import {
MultiSigWalletWithTimeLockConfirmationEventArgs,
MultiSigWalletWithTimeLockConfirmationTimeSetEventArgs,
@@ -13,8 +13,8 @@ import {
MultiSigWalletWithTimeLockExecutionEventArgs,
MultiSigWalletWithTimeLockExecutionFailureEventArgs,
MultiSigWalletWithTimeLockSubmissionEventArgs,
-} from '../../generated_contract_wrappers/multi_sig_wallet_with_time_lock';
-import { artifacts } from '../utils/artifacts';
+} from '../../generated-wrappers/multi_sig_wallet_with_time_lock';
+import { artifacts } from '../../src/artifacts';
import { expectTransactionFailedAsync, expectTransactionFailedWithoutReasonAsync } from '../utils/assertions';
import { increaseTimeAndMineBlockAsync } from '../utils/block_timestamp';
import { chaiSetup } from '../utils/chai_setup';
diff --git a/packages/contracts/test/token_registry.ts b/packages/contracts/test/token_registry.ts
deleted file mode 100644
index 7cc43be9b..000000000
--- a/packages/contracts/test/token_registry.ts
+++ /dev/null
@@ -1,255 +0,0 @@
-import { BlockchainLifecycle } from '@0xproject/dev-utils';
-import { BigNumber, NULL_BYTES } from '@0xproject/utils';
-import * as chai from 'chai';
-import ethUtil = require('ethereumjs-util');
-import * as _ from 'lodash';
-
-import { TokenRegistryContract } from '../generated_contract_wrappers/token_registry';
-
-import { artifacts } from './utils/artifacts';
-import { expectTransactionFailedWithoutReasonAsync } from './utils/assertions';
-import { chaiSetup } from './utils/chai_setup';
-import { constants } from './utils/constants';
-import { TokenRegWrapper } from './utils/token_registry_wrapper';
-import { provider, txDefaults, web3Wrapper } from './utils/web3_wrapper';
-
-chaiSetup.configure();
-const expect = chai.expect;
-const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
-
-describe('TokenRegistry', () => {
- let owner: string;
- let notOwner: string;
- let tokenReg: TokenRegistryContract;
- let tokenRegWrapper: TokenRegWrapper;
-
- before(async () => {
- await blockchainLifecycle.startAsync();
- });
- after(async () => {
- await blockchainLifecycle.revertAsync();
- });
- before(async () => {
- const accounts = await web3Wrapper.getAvailableAddressesAsync();
- owner = accounts[0];
- notOwner = accounts[1];
- tokenReg = await TokenRegistryContract.deployFrom0xArtifactAsync(artifacts.TokenRegistry, provider, txDefaults);
- tokenRegWrapper = new TokenRegWrapper(tokenReg, provider);
- });
- beforeEach(async () => {
- await blockchainLifecycle.startAsync();
- });
- afterEach(async () => {
- await blockchainLifecycle.revertAsync();
- });
-
- const tokenAddress1 = `0x${ethUtil.setLength(ethUtil.toBuffer('0x1'), 20, false).toString('hex')}`;
- const tokenAddress2 = `0x${ethUtil.setLength(ethUtil.toBuffer('0x2'), 20, false).toString('hex')}`;
-
- const token1 = {
- address: tokenAddress1,
- name: 'testToken1',
- symbol: 'TT1',
- decimals: 18,
- ipfsHash: `0x${ethUtil.sha3('ipfs1').toString('hex')}`,
- swarmHash: `0x${ethUtil.sha3('swarm1').toString('hex')}`,
- };
-
- const token2 = {
- address: tokenAddress2,
- name: 'testToken2',
- symbol: 'TT2',
- decimals: 18,
- ipfsHash: `0x${ethUtil.sha3('ipfs2').toString('hex')}`,
- swarmHash: `0x${ethUtil.sha3('swarm2').toString('hex')}`,
- };
-
- const nullToken = {
- address: constants.NULL_ADDRESS,
- name: '',
- symbol: '',
- decimals: 0,
- ipfsHash: NULL_BYTES,
- swarmHash: NULL_BYTES,
- };
-
- describe('addToken', () => {
- it('should throw when not called by owner', async () => {
- return expectTransactionFailedWithoutReasonAsync(tokenRegWrapper.addTokenAsync(token1, notOwner));
- });
-
- it('should add token metadata when called by owner', async () => {
- await tokenRegWrapper.addTokenAsync(token1, owner);
- const tokenData = await tokenRegWrapper.getTokenMetaDataAsync(token1.address);
- expect(tokenData).to.be.deep.equal(token1);
- });
-
- it('should throw if token already exists', async () => {
- await tokenRegWrapper.addTokenAsync(token1, owner);
-
- return expectTransactionFailedWithoutReasonAsync(tokenRegWrapper.addTokenAsync(token1, owner));
- });
-
- it('should throw if token address is null', async () => {
- return expectTransactionFailedWithoutReasonAsync(tokenRegWrapper.addTokenAsync(nullToken, owner));
- });
-
- it('should throw if name already exists', async () => {
- await tokenRegWrapper.addTokenAsync(token1, owner);
- const duplicateNameToken = _.assign({}, token2, { name: token1.name });
-
- return expectTransactionFailedWithoutReasonAsync(tokenRegWrapper.addTokenAsync(duplicateNameToken, owner));
- });
-
- it('should throw if symbol already exists', async () => {
- await tokenRegWrapper.addTokenAsync(token1, owner);
- const duplicateSymbolToken = _.assign({}, token2, {
- symbol: token1.symbol,
- });
-
- return expectTransactionFailedWithoutReasonAsync(
- tokenRegWrapper.addTokenAsync(duplicateSymbolToken, owner),
- );
- });
- });
-
- describe('after addToken', () => {
- beforeEach(async () => {
- await tokenRegWrapper.addTokenAsync(token1, owner);
- });
-
- describe('getTokenByName', () => {
- it('should return token metadata when given the token name', async () => {
- const tokenData = await tokenRegWrapper.getTokenByNameAsync(token1.name);
- expect(tokenData).to.be.deep.equal(token1);
- });
- });
-
- describe('getTokenBySymbol', () => {
- it('should return token metadata when given the token symbol', async () => {
- const tokenData = await tokenRegWrapper.getTokenBySymbolAsync(token1.symbol);
- expect(tokenData).to.be.deep.equal(token1);
- });
- });
-
- describe('setTokenName', () => {
- it('should throw when not called by owner', async () => {
- return expectTransactionFailedWithoutReasonAsync(
- tokenReg.setTokenName.sendTransactionAsync(token1.address, token2.name, { from: notOwner }),
- );
- });
-
- it('should change the token name when called by owner', async () => {
- await web3Wrapper.awaitTransactionSuccessAsync(
- await tokenReg.setTokenName.sendTransactionAsync(token1.address, token2.name, {
- from: owner,
- }),
- constants.AWAIT_TRANSACTION_MINED_MS,
- );
- const [newData, oldData] = await Promise.all([
- tokenRegWrapper.getTokenByNameAsync(token2.name),
- tokenRegWrapper.getTokenByNameAsync(token1.name),
- ]);
-
- const expectedNewData = _.assign({}, token1, { name: token2.name });
- const expectedOldData = nullToken;
- expect(newData).to.be.deep.equal(expectedNewData);
- expect(oldData).to.be.deep.equal(expectedOldData);
- });
-
- it('should throw if the name already exists', async () => {
- await tokenRegWrapper.addTokenAsync(token2, owner);
-
- return expectTransactionFailedWithoutReasonAsync(
- tokenReg.setTokenName.sendTransactionAsync(token1.address, token2.name, { from: owner }),
- );
- });
-
- it('should throw if token does not exist', async () => {
- return expectTransactionFailedWithoutReasonAsync(
- tokenReg.setTokenName.sendTransactionAsync(nullToken.address, token2.name, { from: owner }),
- );
- });
- });
-
- describe('setTokenSymbol', () => {
- it('should throw when not called by owner', async () => {
- return expectTransactionFailedWithoutReasonAsync(
- tokenReg.setTokenSymbol.sendTransactionAsync(token1.address, token2.symbol, {
- from: notOwner,
- }),
- );
- });
-
- it('should change the token symbol when called by owner', async () => {
- await web3Wrapper.awaitTransactionSuccessAsync(
- await tokenReg.setTokenSymbol.sendTransactionAsync(token1.address, token2.symbol, { from: owner }),
- constants.AWAIT_TRANSACTION_MINED_MS,
- );
- const [newData, oldData] = await Promise.all([
- tokenRegWrapper.getTokenBySymbolAsync(token2.symbol),
- tokenRegWrapper.getTokenBySymbolAsync(token1.symbol),
- ]);
-
- const expectedNewData = _.assign({}, token1, { symbol: token2.symbol });
- const expectedOldData = nullToken;
- expect(newData).to.be.deep.equal(expectedNewData);
- expect(oldData).to.be.deep.equal(expectedOldData);
- });
-
- it('should throw if the symbol already exists', async () => {
- await tokenRegWrapper.addTokenAsync(token2, owner);
-
- return expectTransactionFailedWithoutReasonAsync(
- tokenReg.setTokenSymbol.sendTransactionAsync(token1.address, token2.symbol, {
- from: owner,
- }),
- );
- });
-
- it('should throw if token does not exist', async () => {
- return expectTransactionFailedWithoutReasonAsync(
- tokenReg.setTokenSymbol.sendTransactionAsync(nullToken.address, token2.symbol, {
- from: owner,
- }),
- );
- });
- });
-
- describe('removeToken', () => {
- it('should throw if not called by owner', async () => {
- const index = new BigNumber(0);
- return expectTransactionFailedWithoutReasonAsync(
- tokenReg.removeToken.sendTransactionAsync(token1.address, index, { from: notOwner }),
- );
- });
-
- it('should remove token metadata when called by owner', async () => {
- const index = new BigNumber(0);
- await web3Wrapper.awaitTransactionSuccessAsync(
- await tokenReg.removeToken.sendTransactionAsync(token1.address, index, {
- from: owner,
- }),
- constants.AWAIT_TRANSACTION_MINED_MS,
- );
- const tokenData = await tokenRegWrapper.getTokenMetaDataAsync(token1.address);
- expect(tokenData).to.be.deep.equal(nullToken);
- });
-
- it('should throw if token does not exist', async () => {
- const index = new BigNumber(0);
- return expectTransactionFailedWithoutReasonAsync(
- tokenReg.removeToken.sendTransactionAsync(nullToken.address, index, { from: owner }),
- );
- });
-
- it('should throw if token at given index does not match address', async () => {
- await tokenRegWrapper.addTokenAsync(token2, owner);
- const incorrectIndex = new BigNumber(0);
- return expectTransactionFailedWithoutReasonAsync(
- tokenReg.removeToken.sendTransactionAsync(token2.address, incorrectIndex, { from: owner }),
- );
- });
- });
- });
-});
diff --git a/packages/contracts/test/tokens/erc721_token.ts b/packages/contracts/test/tokens/erc721_token.ts
index e61fd7d51..72407748f 100644
--- a/packages/contracts/test/tokens/erc721_token.ts
+++ b/packages/contracts/test/tokens/erc721_token.ts
@@ -1,19 +1,19 @@
-import { BlockchainLifecycle } from '@0xproject/dev-utils';
-import { RevertReason } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
+import { BlockchainLifecycle } from '@0x/dev-utils';
+import { RevertReason } from '@0x/types';
+import { BigNumber } from '@0x/utils';
import * as chai from 'chai';
import { LogWithDecodedArgs } from 'ethereum-types';
import {
DummyERC721ReceiverContract,
DummyERC721ReceiverTokenReceivedEventArgs,
-} from '../../generated_contract_wrappers/dummy_erc721_receiver';
+} from '../../generated-wrappers/dummy_erc721_receiver';
import {
DummyERC721TokenContract,
DummyERC721TokenTransferEventArgs,
-} from '../../generated_contract_wrappers/dummy_erc721_token';
-import { InvalidERC721ReceiverContract } from '../../generated_contract_wrappers/invalid_erc721_receiver';
-import { artifacts } from '../utils/artifacts';
+} from '../../generated-wrappers/dummy_erc721_token';
+import { InvalidERC721ReceiverContract } from '../../generated-wrappers/invalid_erc721_receiver';
+import { artifacts } from '../../src/artifacts';
import { expectTransactionFailedAsync, expectTransactionFailedWithoutReasonAsync } from '../utils/assertions';
import { chaiSetup } from '../utils/chai_setup';
import { constants } from '../utils/constants';
diff --git a/packages/contracts/test/tokens/unlimited_allowance_token.ts b/packages/contracts/test/tokens/unlimited_allowance_token.ts
index 63680fe9b..ea5a50522 100644
--- a/packages/contracts/test/tokens/unlimited_allowance_token.ts
+++ b/packages/contracts/test/tokens/unlimited_allowance_token.ts
@@ -1,10 +1,10 @@
-import { BlockchainLifecycle } from '@0xproject/dev-utils';
-import { RevertReason } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
+import { BlockchainLifecycle } from '@0x/dev-utils';
+import { RevertReason } from '@0x/types';
+import { BigNumber } from '@0x/utils';
import * as chai from 'chai';
-import { DummyERC20TokenContract } from '../../generated_contract_wrappers/dummy_erc20_token';
-import { artifacts } from '../utils/artifacts';
+import { DummyERC20TokenContract } from '../../generated-wrappers/dummy_erc20_token';
+import { artifacts } from '../../src/artifacts';
import { expectContractCallFailedAsync } from '../utils/assertions';
import { chaiSetup } from '../utils/chai_setup';
import { constants } from '../utils/constants';
diff --git a/packages/contracts/test/tokens/ether_token.ts b/packages/contracts/test/tokens/weth9.ts
index a104fc915..9a31dc3f2 100644
--- a/packages/contracts/test/tokens/ether_token.ts
+++ b/packages/contracts/test/tokens/weth9.ts
@@ -1,10 +1,10 @@
-import { BlockchainLifecycle } from '@0xproject/dev-utils';
-import { BigNumber } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { BlockchainLifecycle } from '@0x/dev-utils';
+import { BigNumber } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import * as chai from 'chai';
-import { WETH9Contract } from '../../generated_contract_wrappers/weth9';
-import { artifacts } from '../utils/artifacts';
+import { WETH9Contract } from '../../generated-wrappers/weth9';
+import { artifacts } from '../../src/artifacts';
import { expectInsufficientFundsAsync, expectTransactionFailedWithoutReasonAsync } from '../utils/assertions';
import { chaiSetup } from '../utils/chai_setup';
import { constants } from '../utils/constants';
@@ -29,7 +29,7 @@ describe('EtherToken', () => {
const accounts = await web3Wrapper.getAvailableAddressesAsync();
account = accounts[0];
- etherToken = await WETH9Contract.deployFrom0xArtifactAsync(artifacts.EtherToken, provider, {
+ etherToken = await WETH9Contract.deployFrom0xArtifactAsync(artifacts.WETH9, provider, {
gasPrice,
...txDefaults,
});
diff --git a/packages/contracts/test/tokens/zrx_token.ts b/packages/contracts/test/tokens/zrx_token.ts
index a0d77c924..cab62c205 100644
--- a/packages/contracts/test/tokens/zrx_token.ts
+++ b/packages/contracts/test/tokens/zrx_token.ts
@@ -1,10 +1,10 @@
-import { BlockchainLifecycle } from '@0xproject/dev-utils';
-import { BigNumber } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { BlockchainLifecycle } from '@0x/dev-utils';
+import { BigNumber } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import * as chai from 'chai';
-import { ZRXTokenContract } from '../../generated_contract_wrappers/zrx_token';
-import { artifacts } from '../utils/artifacts';
+import { ZRXTokenContract } from '../../generated-wrappers/zrx_token';
+import { artifacts } from '../../src/artifacts';
import { chaiSetup } from '../utils/chai_setup';
import { constants } from '../utils/constants';
import { provider, txDefaults, web3Wrapper } from '../utils/web3_wrapper';
@@ -29,7 +29,7 @@ describe('ZRXToken', () => {
const accounts = await web3Wrapper.getAvailableAddressesAsync();
owner = accounts[0];
spender = accounts[1];
- zrxToken = await ZRXTokenContract.deployFrom0xArtifactAsync(artifacts.ZRX, provider, txDefaults);
+ zrxToken = await ZRXTokenContract.deployFrom0xArtifactAsync(artifacts.ZRXToken, provider, txDefaults);
MAX_UINT = constants.UNLIMITED_ALLOWANCE_IN_BASE_UNITS;
});
beforeEach(async () => {
diff --git a/packages/contracts/test/tutorials/arbitrage.ts b/packages/contracts/test/tutorials/arbitrage.ts
index 6851483cc..78e0bc238 100644
--- a/packages/contracts/test/tutorials/arbitrage.ts
+++ b/packages/contracts/test/tutorials/arbitrage.ts
@@ -1,8 +1,8 @@
// import { ECSignature, SignedOrder, ZeroEx } from '0x.js';
-// import { BlockchainLifecycle, devConstants, web3Factory } from '@0xproject/dev-utils';
+// import { BlockchainLifecycle, devConstants, web3Factory } from '@0x/dev-utils';
// import { ExchangeContractErrs } from 'ethereum-types';
-// import { BigNumber } from '@0xproject/utils';
-// import { Web3Wrapper } from '@0xproject/web3-wrapper';
+// import { BigNumber } from '@0x/utils';
+// import { Web3Wrapper } from '@0x/web3-wrapper';
// import * as chai from 'chai';
// import ethUtil = require('ethereumjs-util');
// import * as Web3 from 'web3';
diff --git a/packages/contracts/test/utils/address_utils.ts b/packages/contracts/test/utils/address_utils.ts
index 3cf8ec786..634da0c16 100644
--- a/packages/contracts/test/utils/address_utils.ts
+++ b/packages/contracts/test/utils/address_utils.ts
@@ -1,5 +1,5 @@
-import { generatePseudoRandomSalt } from '@0xproject/order-utils';
-import { crypto } from '@0xproject/order-utils/lib/src/crypto';
+import { generatePseudoRandomSalt } from '@0x/order-utils';
+import { crypto } from '@0x/order-utils/lib/src/crypto';
export const addressUtils = {
generatePseudoRandomAddress(): string {
diff --git a/packages/contracts/test/utils/artifacts.ts b/packages/contracts/test/utils/artifacts.ts
deleted file mode 100644
index 53f2a4e4e..000000000
--- a/packages/contracts/test/utils/artifacts.ts
+++ /dev/null
@@ -1,69 +0,0 @@
-import { ContractArtifact } from 'ethereum-types';
-
-import * as AssetProxyOwner from '../../artifacts/AssetProxyOwner.json';
-import * as DummyERC20Token from '../../artifacts/DummyERC20Token.json';
-import * as DummyERC721Receiver from '../../artifacts/DummyERC721Receiver.json';
-import * as DummyERC721Token from '../../artifacts/DummyERC721Token.json';
-import * as DummyMultipleReturnERC20Token from '../../artifacts/DummyMultipleReturnERC20Token.json';
-import * as DummyNoReturnERC20Token from '../../artifacts/DummyNoReturnERC20Token.json';
-import * as ERC20Proxy from '../../artifacts/ERC20Proxy.json';
-import * as ERC721Proxy from '../../artifacts/ERC721Proxy.json';
-import * as Exchange from '../../artifacts/Exchange.json';
-import * as ExchangeWrapper from '../../artifacts/ExchangeWrapper.json';
-import * as Forwarder from '../../artifacts/Forwarder.json';
-import * as IAssetProxy from '../../artifacts/IAssetProxy.json';
-import * as InvalidERC721Receiver from '../../artifacts/InvalidERC721Receiver.json';
-import * as MixinAuthorizable from '../../artifacts/MixinAuthorizable.json';
-import * as MultiSigWallet from '../../artifacts/MultiSigWallet.json';
-import * as MultiSigWalletWithTimeLock from '../../artifacts/MultiSigWalletWithTimeLock.json';
-import * as OrderValidator from '../../artifacts/OrderValidator.json';
-import * as ReentrantERC20Token from '../../artifacts/ReentrantERC20Token.json';
-import * as TestAssetProxyDispatcher from '../../artifacts/TestAssetProxyDispatcher.json';
-import * as TestAssetProxyOwner from '../../artifacts/TestAssetProxyOwner.json';
-import * as TestConstants from '../../artifacts/TestConstants.json';
-import * as TestExchangeInternals from '../../artifacts/TestExchangeInternals.json';
-import * as TestLibBytes from '../../artifacts/TestLibBytes.json';
-import * as TestLibs from '../../artifacts/TestLibs.json';
-import * as TestSignatureValidator from '../../artifacts/TestSignatureValidator.json';
-import * as TestStaticCallReceiver from '../../artifacts/TestStaticCallReceiver.json';
-import * as TokenRegistry from '../../artifacts/TokenRegistry.json';
-import * as Validator from '../../artifacts/Validator.json';
-import * as Wallet from '../../artifacts/Wallet.json';
-import * as EtherToken from '../../artifacts/WETH9.json';
-import * as Whitelist from '../../artifacts/Whitelist.json';
-import * as ZRX from '../../artifacts/ZRXToken.json';
-
-export const artifacts = {
- AssetProxyOwner: (AssetProxyOwner as any) as ContractArtifact,
- DummyERC20Token: (DummyERC20Token as any) as ContractArtifact,
- DummyERC721Receiver: (DummyERC721Receiver as any) as ContractArtifact,
- DummyERC721Token: (DummyERC721Token as any) as ContractArtifact,
- DummyMultipleReturnERC20Token: (DummyMultipleReturnERC20Token as any) as ContractArtifact,
- DummyNoReturnERC20Token: (DummyNoReturnERC20Token as any) as ContractArtifact,
- ERC20Proxy: (ERC20Proxy as any) as ContractArtifact,
- ERC721Proxy: (ERC721Proxy as any) as ContractArtifact,
- Exchange: (Exchange as any) as ContractArtifact,
- ExchangeWrapper: (ExchangeWrapper as any) as ContractArtifact,
- EtherToken: (EtherToken as any) as ContractArtifact,
- Forwarder: (Forwarder as any) as ContractArtifact,
- IAssetProxy: (IAssetProxy as any) as ContractArtifact,
- InvalidERC721Receiver: (InvalidERC721Receiver as any) as ContractArtifact,
- MixinAuthorizable: (MixinAuthorizable as any) as ContractArtifact,
- MultiSigWallet: (MultiSigWallet as any) as ContractArtifact,
- MultiSigWalletWithTimeLock: (MultiSigWalletWithTimeLock as any) as ContractArtifact,
- OrderValidator: (OrderValidator as any) as ContractArtifact,
- ReentrantERC20Token: (ReentrantERC20Token as any) as ContractArtifact,
- TestAssetProxyOwner: (TestAssetProxyOwner as any) as ContractArtifact,
- TestAssetProxyDispatcher: (TestAssetProxyDispatcher as any) as ContractArtifact,
- TestConstants: (TestConstants as any) as ContractArtifact,
- TestLibBytes: (TestLibBytes as any) as ContractArtifact,
- TestLibs: (TestLibs as any) as ContractArtifact,
- TestExchangeInternals: (TestExchangeInternals as any) as ContractArtifact,
- TestSignatureValidator: (TestSignatureValidator as any) as ContractArtifact,
- TestStaticCallReceiver: (TestStaticCallReceiver as any) as ContractArtifact,
- Validator: (Validator as any) as ContractArtifact,
- Wallet: (Wallet as any) as ContractArtifact,
- TokenRegistry: (TokenRegistry as any) as ContractArtifact,
- Whitelist: (Whitelist as any) as ContractArtifact,
- ZRX: (ZRX as any) as ContractArtifact,
-};
diff --git a/packages/contracts/test/utils/assertions.ts b/packages/contracts/test/utils/assertions.ts
index 3361a751a..5b1cedfcc 100644
--- a/packages/contracts/test/utils/assertions.ts
+++ b/packages/contracts/test/utils/assertions.ts
@@ -1,6 +1,6 @@
-import { RevertReason } from '@0xproject/types';
-import { logUtils } from '@0xproject/utils';
-import { NodeType } from '@0xproject/web3-wrapper';
+import { RevertReason } from '@0x/types';
+import { logUtils } from '@0x/utils';
+import { NodeType } from '@0x/web3-wrapper';
import * as chai from 'chai';
import { TransactionReceipt, TransactionReceiptStatus, TransactionReceiptWithDecodedLogs } from 'ethereum-types';
import * as _ from 'lodash';
diff --git a/packages/contracts/test/utils/asset_wrapper.ts b/packages/contracts/test/utils/asset_wrapper.ts
index e3a4800c6..4e7696066 100644
--- a/packages/contracts/test/utils/asset_wrapper.ts
+++ b/packages/contracts/test/utils/asset_wrapper.ts
@@ -1,6 +1,6 @@
-import { assetDataUtils } from '@0xproject/order-utils';
-import { AssetProxyId } from '@0xproject/types';
-import { BigNumber, errorUtils } from '@0xproject/utils';
+import { assetDataUtils } from '@0x/order-utils';
+import { AssetProxyId } from '@0x/types';
+import { BigNumber, errorUtils } from '@0x/utils';
import * as _ from 'lodash';
import { AbstractAssetWrapper } from './abstract_asset_wrapper';
diff --git a/packages/contracts/test/utils/combinatorial_utils.ts b/packages/contracts/test/utils/combinatorial_utils.ts
index d72b41f8a..bb1b55b4d 100644
--- a/packages/contracts/test/utils/combinatorial_utils.ts
+++ b/packages/contracts/test/utils/combinatorial_utils.ts
@@ -1,4 +1,4 @@
-import { BigNumber } from '@0xproject/utils';
+import { BigNumber } from '@0x/utils';
import * as combinatorics from 'js-combinatorics';
import { testWithReferenceFuncAsync } from './test_with_reference';
diff --git a/packages/contracts/test/utils/constants.ts b/packages/contracts/test/utils/constants.ts
index b9ba8ccb9..cd21330e9 100644
--- a/packages/contracts/test/utils/constants.ts
+++ b/packages/contracts/test/utils/constants.ts
@@ -1,5 +1,5 @@
-import { BigNumber } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { BigNumber } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import * as ethUtil from 'ethereumjs-util';
import * as _ from 'lodash';
diff --git a/packages/contracts/test/utils/coverage.ts b/packages/contracts/test/utils/coverage.ts
index de29a3ecc..5becfa1b6 100644
--- a/packages/contracts/test/utils/coverage.ts
+++ b/packages/contracts/test/utils/coverage.ts
@@ -1,5 +1,5 @@
-import { devConstants } from '@0xproject/dev-utils';
-import { CoverageSubprovider, SolCompilerArtifactAdapter } from '@0xproject/sol-cov';
+import { devConstants } from '@0x/dev-utils';
+import { CoverageSubprovider, SolCompilerArtifactAdapter } from '@0x/sol-cov';
import * as _ from 'lodash';
let coverageSubprovider: CoverageSubprovider;
diff --git a/packages/contracts/test/utils/erc20_wrapper.ts b/packages/contracts/test/utils/erc20_wrapper.ts
index 526ffe9f8..c281a2abf 100644
--- a/packages/contracts/test/utils/erc20_wrapper.ts
+++ b/packages/contracts/test/utils/erc20_wrapper.ts
@@ -1,13 +1,13 @@
-import { assetDataUtils } from '@0xproject/order-utils';
-import { BigNumber } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { assetDataUtils } from '@0x/order-utils';
+import { BigNumber } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import { Provider } from 'ethereum-types';
import * as _ from 'lodash';
-import { DummyERC20TokenContract } from '../../generated_contract_wrappers/dummy_erc20_token';
-import { ERC20ProxyContract } from '../../generated_contract_wrappers/erc20_proxy';
+import { DummyERC20TokenContract } from '../../generated-wrappers/dummy_erc20_token';
+import { ERC20ProxyContract } from '../../generated-wrappers/erc20_proxy';
+import { artifacts } from '../../src/artifacts';
-import { artifacts } from './artifacts';
import { constants } from './constants';
import { ERC20BalancesByOwner } from './types';
import { txDefaults } from './web3_wrapper';
diff --git a/packages/contracts/test/utils/erc721_wrapper.ts b/packages/contracts/test/utils/erc721_wrapper.ts
index 743d10706..3ef4e701d 100644
--- a/packages/contracts/test/utils/erc721_wrapper.ts
+++ b/packages/contracts/test/utils/erc721_wrapper.ts
@@ -1,13 +1,13 @@
-import { generatePseudoRandomSalt } from '@0xproject/order-utils';
-import { BigNumber } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { generatePseudoRandomSalt } from '@0x/order-utils';
+import { BigNumber } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import { Provider } from 'ethereum-types';
import * as _ from 'lodash';
-import { DummyERC721TokenContract } from '../../generated_contract_wrappers/dummy_erc721_token';
-import { ERC721ProxyContract } from '../../generated_contract_wrappers/erc721_proxy';
+import { DummyERC721TokenContract } from '../../generated-wrappers/dummy_erc721_token';
+import { ERC721ProxyContract } from '../../generated-wrappers/erc721_proxy';
+import { artifacts } from '../../src/artifacts';
-import { artifacts } from './artifacts';
import { constants } from './constants';
import { ERC721TokenIdsByOwner } from './types';
import { txDefaults } from './web3_wrapper';
diff --git a/packages/contracts/test/utils/exchange_wrapper.ts b/packages/contracts/test/utils/exchange_wrapper.ts
index 619d43994..c28989d3f 100644
--- a/packages/contracts/test/utils/exchange_wrapper.ts
+++ b/packages/contracts/test/utils/exchange_wrapper.ts
@@ -1,9 +1,9 @@
-import { SignedOrder } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { SignedOrder } from '@0x/types';
+import { BigNumber } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import { Provider, TransactionReceiptWithDecodedLogs } from 'ethereum-types';
-import { ExchangeContract } from '../../generated_contract_wrappers/exchange';
+import { ExchangeContract } from '../../generated-wrappers/exchange';
import { formatters } from './formatters';
import { LogDecoder } from './log_decoder';
@@ -212,13 +212,17 @@ export class ExchangeWrapper {
return tx;
}
public async getTakerAssetFilledAmountAsync(orderHashHex: string): Promise<BigNumber> {
- const filledAmount = new BigNumber(await this._exchange.filled.callAsync(orderHashHex));
+ const filledAmount = await this._exchange.filled.callAsync(orderHashHex);
return filledAmount;
}
public async isCancelledAsync(orderHashHex: string): Promise<boolean> {
const isCancelled = await this._exchange.cancelled.callAsync(orderHashHex);
return isCancelled;
}
+ public async getOrderEpochAsync(makerAddress: string, senderAddress: string): Promise<BigNumber> {
+ const orderEpoch = await this._exchange.orderEpoch.callAsync(makerAddress, senderAddress);
+ return orderEpoch;
+ }
public async getOrderInfoAsync(signedOrder: SignedOrder): Promise<OrderInfo> {
const orderInfo = (await this._exchange.getOrderInfo.callAsync(signedOrder)) as OrderInfo;
return orderInfo;
diff --git a/packages/contracts/test/utils/fill_order_combinatorial_utils.ts b/packages/contracts/test/utils/fill_order_combinatorial_utils.ts
index 92d0f4003..8046771f9 100644
--- a/packages/contracts/test/utils/fill_order_combinatorial_utils.ts
+++ b/packages/contracts/test/utils/fill_order_combinatorial_utils.ts
@@ -5,19 +5,19 @@ import {
orderHashUtils,
OrderStateUtils,
OrderValidationUtils,
-} from '@0xproject/order-utils';
-import { AssetProxyId, RevertReason, SignatureType, SignedOrder } from '@0xproject/types';
-import { BigNumber, errorUtils, logUtils } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+} from '@0x/order-utils';
+import { AssetProxyId, RevertReason, SignatureType, SignedOrder } from '@0x/types';
+import { BigNumber, errorUtils, logUtils } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import * as chai from 'chai';
import { LogWithDecodedArgs, Provider, TxData } from 'ethereum-types';
import * as _ from 'lodash';
import 'make-promises-safe';
-import { ExchangeContract, ExchangeFillEventArgs } from '../../generated_contract_wrappers/exchange';
-import { TestLibsContract } from '../../generated_contract_wrappers/test_libs';
+import { ExchangeContract, ExchangeFillEventArgs } from '../../generated-wrappers/exchange';
+import { TestLibsContract } from '../../generated-wrappers/test_libs';
+import { artifacts } from '../../src/artifacts';
-import { artifacts } from './artifacts';
import { expectTransactionFailedAsync } from './assertions';
import { AssetWrapper } from './asset_wrapper';
import { chaiSetup } from './chai_setup';
@@ -392,7 +392,7 @@ export class FillOrderCombinatorialUtils {
);
// 5. If I fill it by X, what are the resulting balances/allowances/filled amounts expected?
- const orderValidationUtils = new OrderValidationUtils(orderFilledCancelledFetcher);
+ const orderValidationUtils = new OrderValidationUtils(orderFilledCancelledFetcher, provider);
const lazyStore = new BalanceAndProxyAllowanceLazyStore(balanceAndProxyAllowanceFetcher);
const exchangeTransferSimulator = new ExchangeTransferSimulator(lazyStore);
diff --git a/packages/contracts/test/utils/formatters.ts b/packages/contracts/test/utils/formatters.ts
index 32e4787d6..813eb45db 100644
--- a/packages/contracts/test/utils/formatters.ts
+++ b/packages/contracts/test/utils/formatters.ts
@@ -1,5 +1,5 @@
-import { SignedOrder } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
+import { SignedOrder } from '@0x/types';
+import { BigNumber } from '@0x/utils';
import * as _ from 'lodash';
import { constants } from './constants';
diff --git a/packages/contracts/test/utils/forwarder_wrapper.ts b/packages/contracts/test/utils/forwarder_wrapper.ts
index de247a878..a0bfcfe1d 100644
--- a/packages/contracts/test/utils/forwarder_wrapper.ts
+++ b/packages/contracts/test/utils/forwarder_wrapper.ts
@@ -1,10 +1,10 @@
-import { SignedOrder } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { SignedOrder } from '@0x/types';
+import { BigNumber } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import { Provider, TransactionReceiptWithDecodedLogs, TxDataPayable } from 'ethereum-types';
import * as _ from 'lodash';
-import { ForwarderContract } from '../../generated_contract_wrappers/forwarder';
+import { ForwarderContract } from '../../generated-wrappers/forwarder';
import { constants } from './constants';
import { formatters } from './formatters';
@@ -26,9 +26,12 @@ export class ForwarderWrapper {
_.forEach(feeOrders, feeOrder => {
const feeAvailable = feeOrder.makerAssetAmount.minus(feeOrder.takerFee);
if (!remainingFeeAmount.isZero() && feeAvailable.gt(remainingFeeAmount)) {
- wethAmount = wethAmount
- .plus(feeOrder.takerAssetAmount.times(remainingFeeAmount).dividedToIntegerBy(feeAvailable))
- .plus(1);
+ wethAmount = wethAmount.plus(
+ feeOrder.takerAssetAmount
+ .times(remainingFeeAmount)
+ .dividedBy(feeAvailable)
+ .ceil(),
+ );
remainingFeeAmount = new BigNumber(0);
} else if (!remainingFeeAmount.isZero()) {
wethAmount = wethAmount.plus(feeOrder.takerAssetAmount);
diff --git a/packages/contracts/test/utils/log_decoder.ts b/packages/contracts/test/utils/log_decoder.ts
index 144a18dd1..05b0a9204 100644
--- a/packages/contracts/test/utils/log_decoder.ts
+++ b/packages/contracts/test/utils/log_decoder.ts
@@ -1,5 +1,5 @@
-import { AbiDecoder, BigNumber } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { AbiDecoder, BigNumber } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import {
AbiDefinition,
ContractArtifact,
@@ -11,7 +11,8 @@ import {
} from 'ethereum-types';
import * as _ from 'lodash';
-import { artifacts } from './artifacts';
+import { artifacts } from '../../src/artifacts';
+
import { constants } from './constants';
export class LogDecoder {
diff --git a/packages/contracts/test/utils/match_order_tester.ts b/packages/contracts/test/utils/match_order_tester.ts
index e0c55b834..6c2c84959 100644
--- a/packages/contracts/test/utils/match_order_tester.ts
+++ b/packages/contracts/test/utils/match_order_tester.ts
@@ -1,6 +1,6 @@
-import { assetDataUtils, orderHashUtils } from '@0xproject/order-utils';
-import { AssetProxyId, SignedOrder } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
+import { assetDataUtils, orderHashUtils } from '@0x/order-utils';
+import { AssetProxyId, SignedOrder } from '@0x/types';
+import { BigNumber } from '@0x/utils';
import * as chai from 'chai';
import * as _ from 'lodash';
diff --git a/packages/contracts/test/utils/multi_sig_wrapper.ts b/packages/contracts/test/utils/multi_sig_wrapper.ts
index e12a58695..74fd3b4d6 100644
--- a/packages/contracts/test/utils/multi_sig_wrapper.ts
+++ b/packages/contracts/test/utils/multi_sig_wrapper.ts
@@ -1,10 +1,10 @@
-import { BigNumber } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { BigNumber } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import { Provider, TransactionReceiptWithDecodedLogs } from 'ethereum-types';
import * as _ from 'lodash';
-import { AssetProxyOwnerContract } from '../../generated_contract_wrappers/asset_proxy_owner';
-import { MultiSigWalletContract } from '../../generated_contract_wrappers/multi_sig_wallet';
+import { AssetProxyOwnerContract } from '../../generated-wrappers/asset_proxy_owner';
+import { MultiSigWalletContract } from '../../generated-wrappers/multi_sig_wallet';
import { LogDecoder } from './log_decoder';
diff --git a/packages/contracts/test/utils/order_factory.ts b/packages/contracts/test/utils/order_factory.ts
index 63a893695..2449d1a8a 100644
--- a/packages/contracts/test/utils/order_factory.ts
+++ b/packages/contracts/test/utils/order_factory.ts
@@ -1,6 +1,6 @@
-import { generatePseudoRandomSalt, orderHashUtils } from '@0xproject/order-utils';
-import { Order, SignatureType, SignedOrder } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
+import { generatePseudoRandomSalt, orderHashUtils } from '@0x/order-utils';
+import { Order, SignatureType, SignedOrder } from '@0x/types';
+import { BigNumber } from '@0x/utils';
import { getLatestBlockTimestampAsync } from './block_timestamp';
import { constants } from './constants';
diff --git a/packages/contracts/test/utils/order_factory_from_scenario.ts b/packages/contracts/test/utils/order_factory_from_scenario.ts
index 8e04db588..60c8606c4 100644
--- a/packages/contracts/test/utils/order_factory_from_scenario.ts
+++ b/packages/contracts/test/utils/order_factory_from_scenario.ts
@@ -1,8 +1,8 @@
-import { assetDataUtils, generatePseudoRandomSalt } from '@0xproject/order-utils';
-import { Order } from '@0xproject/types';
-import { BigNumber, errorUtils } from '@0xproject/utils';
+import { assetDataUtils, generatePseudoRandomSalt } from '@0x/order-utils';
+import { Order } from '@0x/types';
+import { BigNumber, errorUtils } from '@0x/utils';
-import { DummyERC721TokenContract } from '../../generated_contract_wrappers/dummy_erc721_token';
+import { DummyERC721TokenContract } from '../../generated-wrappers/dummy_erc721_token';
import { constants } from './constants';
import {
diff --git a/packages/contracts/test/utils/order_utils.ts b/packages/contracts/test/utils/order_utils.ts
index 444e27c44..4f7a34011 100644
--- a/packages/contracts/test/utils/order_utils.ts
+++ b/packages/contracts/test/utils/order_utils.ts
@@ -1,5 +1,5 @@
-import { OrderWithoutExchangeAddress, SignedOrder } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
+import { OrderWithoutExchangeAddress, SignedOrder } from '@0x/types';
+import { BigNumber } from '@0x/utils';
import { constants } from './constants';
import { CancelOrder, MatchOrder } from './types';
diff --git a/packages/contracts/test/utils/profiler.ts b/packages/contracts/test/utils/profiler.ts
index 85ee24f22..2c7c1d66c 100644
--- a/packages/contracts/test/utils/profiler.ts
+++ b/packages/contracts/test/utils/profiler.ts
@@ -1,5 +1,5 @@
-import { devConstants } from '@0xproject/dev-utils';
-import { ProfilerSubprovider, SolCompilerArtifactAdapter } from '@0xproject/sol-cov';
+import { devConstants } from '@0x/dev-utils';
+import { ProfilerSubprovider, SolCompilerArtifactAdapter } from '@0x/sol-cov';
import * as _ from 'lodash';
let profilerSubprovider: ProfilerSubprovider;
diff --git a/packages/contracts/test/utils/revert_trace.ts b/packages/contracts/test/utils/revert_trace.ts
index 0bf8384bc..3f74fd28b 100644
--- a/packages/contracts/test/utils/revert_trace.ts
+++ b/packages/contracts/test/utils/revert_trace.ts
@@ -1,5 +1,5 @@
-import { devConstants } from '@0xproject/dev-utils';
-import { RevertTraceSubprovider, SolCompilerArtifactAdapter } from '@0xproject/sol-cov';
+import { devConstants } from '@0x/dev-utils';
+import { RevertTraceSubprovider, SolCompilerArtifactAdapter } from '@0x/sol-cov';
import * as _ from 'lodash';
let revertTraceSubprovider: RevertTraceSubprovider;
diff --git a/packages/contracts/test/utils/signing_utils.ts b/packages/contracts/test/utils/signing_utils.ts
index 9c711c72c..21f864bfa 100644
--- a/packages/contracts/test/utils/signing_utils.ts
+++ b/packages/contracts/test/utils/signing_utils.ts
@@ -1,4 +1,4 @@
-import { SignatureType } from '@0xproject/types';
+import { SignatureType } from '@0x/types';
import * as ethUtil from 'ethereumjs-util';
export const signingUtils = {
diff --git a/packages/contracts/test/utils/simple_asset_balance_and_proxy_allowance_fetcher.ts b/packages/contracts/test/utils/simple_asset_balance_and_proxy_allowance_fetcher.ts
index 598ee6d29..64b7dedbe 100644
--- a/packages/contracts/test/utils/simple_asset_balance_and_proxy_allowance_fetcher.ts
+++ b/packages/contracts/test/utils/simple_asset_balance_and_proxy_allowance_fetcher.ts
@@ -1,5 +1,5 @@
-import { AbstractBalanceAndProxyAllowanceFetcher } from '@0xproject/order-utils';
-import { BigNumber } from '@0xproject/utils';
+import { AbstractBalanceAndProxyAllowanceFetcher } from '@0x/order-utils';
+import { BigNumber } from '@0x/utils';
import { AssetWrapper } from './asset_wrapper';
diff --git a/packages/contracts/test/utils/simple_order_filled_cancelled_fetcher.ts b/packages/contracts/test/utils/simple_order_filled_cancelled_fetcher.ts
index ed69ecc63..af959e00e 100644
--- a/packages/contracts/test/utils/simple_order_filled_cancelled_fetcher.ts
+++ b/packages/contracts/test/utils/simple_order_filled_cancelled_fetcher.ts
@@ -1,5 +1,6 @@
-import { AbstractOrderFilledCancelledFetcher } from '@0xproject/order-utils';
-import { BigNumber } from '@0xproject/utils';
+import { AbstractOrderFilledCancelledFetcher, orderHashUtils } from '@0x/order-utils';
+import { SignedOrder } from '@0x/types';
+import { BigNumber } from '@0x/utils';
import { ExchangeWrapper } from './exchange_wrapper';
@@ -14,9 +15,15 @@ export class SimpleOrderFilledCancelledFetcher implements AbstractOrderFilledCan
const filledTakerAmount = new BigNumber(await this._exchangeWrapper.getTakerAssetFilledAmountAsync(orderHash));
return filledTakerAmount;
}
- public async isOrderCancelledAsync(orderHash: string): Promise<boolean> {
+ public async isOrderCancelledAsync(signedOrder: SignedOrder): Promise<boolean> {
+ const orderHash = orderHashUtils.getOrderHashHex(signedOrder);
const isCancelled = await this._exchangeWrapper.isCancelledAsync(orderHash);
- return isCancelled;
+ const orderEpoch = await this._exchangeWrapper.getOrderEpochAsync(
+ signedOrder.makerAddress,
+ signedOrder.senderAddress,
+ );
+ const isCancelledByOrderEpoch = orderEpoch > signedOrder.salt;
+ return isCancelled || isCancelledByOrderEpoch;
}
public getZRXAssetData(): string {
return this._zrxAssetData;
diff --git a/packages/contracts/test/utils/token_registry_wrapper.ts b/packages/contracts/test/utils/token_registry_wrapper.ts
deleted file mode 100644
index f1c40e8ff..000000000
--- a/packages/contracts/test/utils/token_registry_wrapper.ts
+++ /dev/null
@@ -1,66 +0,0 @@
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
-import { Provider } from 'ethereum-types';
-
-import { TokenRegistryContract } from '../../generated_contract_wrappers/token_registry';
-
-import { Token } from './types';
-
-import { constants } from './constants';
-
-export class TokenRegWrapper {
- private readonly _tokenReg: TokenRegistryContract;
- private readonly _web3Wrapper: Web3Wrapper;
- constructor(tokenRegContract: TokenRegistryContract, provider: Provider) {
- this._tokenReg = tokenRegContract;
- this._web3Wrapper = new Web3Wrapper(provider);
- }
- public async addTokenAsync(token: Token, from: string): Promise<string> {
- const txHash = await this._tokenReg.addToken.sendTransactionAsync(
- token.address as string,
- token.name,
- token.symbol,
- token.decimals,
- token.ipfsHash,
- token.swarmHash,
- { from },
- );
- await this._web3Wrapper.awaitTransactionSuccessAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS);
- return txHash;
- }
- public async getTokenMetaDataAsync(tokenAddress: string): Promise<Token> {
- const data = await this._tokenReg.getTokenMetaData.callAsync(tokenAddress);
- const token: Token = {
- address: data[0],
- name: data[1],
- symbol: data[2],
- decimals: data[3],
- ipfsHash: data[4],
- swarmHash: data[5],
- };
- return token;
- }
- public async getTokenByNameAsync(tokenName: string): Promise<Token> {
- const data = await this._tokenReg.getTokenByName.callAsync(tokenName);
- const token: Token = {
- address: data[0],
- name: data[1],
- symbol: data[2],
- decimals: data[3],
- ipfsHash: data[4],
- swarmHash: data[5],
- };
- return token;
- }
- public async getTokenBySymbolAsync(tokenSymbol: string): Promise<Token> {
- const data = await this._tokenReg.getTokenBySymbol.callAsync(tokenSymbol);
- const token: Token = {
- address: data[0],
- name: data[1],
- symbol: data[2],
- decimals: data[3],
- ipfsHash: data[4],
- swarmHash: data[5],
- };
- return token;
- }
-}
diff --git a/packages/contracts/test/utils/transaction_factory.ts b/packages/contracts/test/utils/transaction_factory.ts
index 9ed4c5a31..dbab3ade4 100644
--- a/packages/contracts/test/utils/transaction_factory.ts
+++ b/packages/contracts/test/utils/transaction_factory.ts
@@ -1,6 +1,6 @@
-import { eip712Utils, generatePseudoRandomSalt } from '@0xproject/order-utils';
-import { SignatureType } from '@0xproject/types';
-import { signTypedDataUtils } from '@0xproject/utils';
+import { eip712Utils, generatePseudoRandomSalt } from '@0x/order-utils';
+import { SignatureType } from '@0x/types';
+import { signTypedDataUtils } from '@0x/utils';
import * as ethUtil from 'ethereumjs-util';
import { signingUtils } from './signing_utils';
diff --git a/packages/contracts/test/utils/type_encoding_utils.ts b/packages/contracts/test/utils/type_encoding_utils.ts
index 75307b9bd..bfd9c9ef5 100644
--- a/packages/contracts/test/utils/type_encoding_utils.ts
+++ b/packages/contracts/test/utils/type_encoding_utils.ts
@@ -1,4 +1,4 @@
-import { BigNumber } from '@0xproject/utils';
+import { BigNumber } from '@0x/utils';
import BN = require('bn.js');
import ethUtil = require('ethereumjs-util');
diff --git a/packages/contracts/test/utils/types.ts b/packages/contracts/test/utils/types.ts
index 598fb5393..9fc9e1570 100644
--- a/packages/contracts/test/utils/types.ts
+++ b/packages/contracts/test/utils/types.ts
@@ -1,5 +1,5 @@
-import { OrderWithoutExchangeAddress } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
+import { OrderWithoutExchangeAddress } from '@0x/types';
+import { BigNumber } from '@0x/utils';
import { AbiDefinition } from 'ethereum-types';
export interface ERC20BalancesByOwner {
diff --git a/packages/contracts/test/utils/web3_wrapper.ts b/packages/contracts/test/utils/web3_wrapper.ts
index d1cd3d387..f7b1a732a 100644
--- a/packages/contracts/test/utils/web3_wrapper.ts
+++ b/packages/contracts/test/utils/web3_wrapper.ts
@@ -1,7 +1,7 @@
-import { devConstants, env, EnvVars, web3Factory } from '@0xproject/dev-utils';
-import { prependSubprovider, Web3ProviderEngine } from '@0xproject/subproviders';
-import { logUtils } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { devConstants, env, EnvVars, web3Factory } from '@0x/dev-utils';
+import { prependSubprovider, Web3ProviderEngine } from '@0x/subproviders';
+import { logUtils } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import * as _ from 'lodash';
import { coverage } from './coverage';
diff --git a/packages/contracts/tsconfig.json b/packages/contracts/tsconfig.json
index 5fd4c5331..8b29365cc 100644
--- a/packages/contracts/tsconfig.json
+++ b/packages/contracts/tsconfig.json
@@ -2,15 +2,47 @@
"extends": "../../tsconfig",
"compilerOptions": {
"outDir": "lib",
- "rootDir": "."
+ "rootDir": ".",
+ "resolveJsonModule": true
},
- "include": [
- "./globals.d.ts",
- "./generated_contract_wrappers",
- "./src/**/*",
- "./utils/**/*",
- "./test/**/*",
- "./migrations/**/*"
+ "include": ["./src/**/*", "./test/**/*", "./generated-wrappers/**/*"],
+ "files": [
+ "./generated-artifacts/AssetProxyOwner.json",
+ "./generated-artifacts/DummyERC20Token.json",
+ "./generated-artifacts/DummyERC721Receiver.json",
+ "./generated-artifacts/DummyERC721Token.json",
+ "./generated-artifacts/DummyMultipleReturnERC20Token.json",
+ "./generated-artifacts/DummyNoReturnERC20Token.json",
+ "./generated-artifacts/ERC20Proxy.json",
+ "./generated-artifacts/ERC20Token.json",
+ "./generated-artifacts/ERC721Proxy.json",
+ "./generated-artifacts/ERC721Token.json",
+ "./generated-artifacts/Exchange.json",
+ "./generated-artifacts/ExchangeWrapper.json",
+ "./generated-artifacts/Forwarder.json",
+ "./generated-artifacts/IAssetData.json",
+ "./generated-artifacts/IAssetProxy.json",
+ "./generated-artifacts/IValidator.json",
+ "./generated-artifacts/IWallet.json",
+ "./generated-artifacts/InvalidERC721Receiver.json",
+ "./generated-artifacts/MixinAuthorizable.json",
+ "./generated-artifacts/MultiSigWallet.json",
+ "./generated-artifacts/MultiSigWalletWithTimeLock.json",
+ "./generated-artifacts/OrderValidator.json",
+ "./generated-artifacts/ReentrantERC20Token.json",
+ "./generated-artifacts/TestAssetProxyDispatcher.json",
+ "./generated-artifacts/TestAssetProxyOwner.json",
+ "./generated-artifacts/TestConstants.json",
+ "./generated-artifacts/TestExchangeInternals.json",
+ "./generated-artifacts/TestLibBytes.json",
+ "./generated-artifacts/TestLibs.json",
+ "./generated-artifacts/TestSignatureValidator.json",
+ "./generated-artifacts/TestStaticCallReceiver.json",
+ "./generated-artifacts/Validator.json",
+ "./generated-artifacts/WETH9.json",
+ "./generated-artifacts/Wallet.json",
+ "./generated-artifacts/Whitelist.json",
+ "./generated-artifacts/ZRXToken.json"
],
"exclude": ["./deploy/solc/solc_bin"]
}
diff --git a/packages/contracts/tslint.json b/packages/contracts/tslint.json
index 1ab924e47..1bb3ac2a2 100644
--- a/packages/contracts/tslint.json
+++ b/packages/contracts/tslint.json
@@ -1,5 +1,5 @@
{
- "extends": ["@0xproject/tslint-config"],
+ "extends": ["@0x/tslint-config"],
"rules": {
"custom-no-magic-numbers": false
}
diff --git a/packages/dev-tools-pages/README.md b/packages/dev-tools-pages/README.md
index 39fe70a25..cbc459be7 100644
--- a/packages/dev-tools-pages/README.md
+++ b/packages/dev-tools-pages/README.md
@@ -19,7 +19,7 @@ yarn install
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
```bash
-PKG=@0xproject/dev-tools-pages yarn build
+PKG=@0x/dev-tools-pages yarn build
```
Note: Ignore the `WARNING in asset size limit` and `WARNING in entrypoint size limit` warnings.
diff --git a/packages/dev-tools-pages/package.json b/packages/dev-tools-pages/package.json
index 5acf471c6..48a4239a2 100644
--- a/packages/dev-tools-pages/package.json
+++ b/packages/dev-tools-pages/package.json
@@ -1,6 +1,6 @@
{
- "name": "@0xproject/dev-tools-pages",
- "version": "0.0.1",
+ "name": "@0x/dev-tools-pages",
+ "version": "0.0.3",
"engines": {
"node": ">=6.12"
},
@@ -11,13 +11,16 @@
"build:ci": "yarn build",
"build:dev": "../../node_modules/.bin/webpack --mode development",
"clean": "shx rm -f public/bundle*",
- "lint": "tslint --project . 'ts/**/*.ts' 'ts/**/*.tsx'",
+ "lint": "tslint --format stylish --project . 'ts/**/*.ts' 'ts/**/*.tsx'",
"dev": "webpack-dev-server --mode development --content-base public"
},
"license": "Apache-2.0",
"dependencies": {
"@0xproject/react-shared": "^1.0.15",
"highlight.js": "^9.13.1",
+ "@0x/react-shared": "^1.0.18",
+ "basscss": "^8.0.3",
+ "bowser": "^1.9.3",
"less": "^2.7.2",
"polished": "^1.9.2",
"react": "^16.5.2",
diff --git a/packages/dev-tools-pages/tslint.json b/packages/dev-tools-pages/tslint.json
index b55ffe90f..50f5be4f6 100644
--- a/packages/dev-tools-pages/tslint.json
+++ b/packages/dev-tools-pages/tslint.json
@@ -1,5 +1,5 @@
{
- "extends": ["@0xproject/tslint-config"],
+ "extends": ["@0x/tslint-config"],
"rules": {
"no-implicit-dependencies": false,
"no-object-literal-type-assertion": false,
diff --git a/packages/dev-utils/CHANGELOG.json b/packages/dev-utils/CHANGELOG.json
index d412d0afe..269cdc934 100644
--- a/packages/dev-utils/CHANGELOG.json
+++ b/packages/dev-utils/CHANGELOG.json
@@ -1,5 +1,24 @@
[
{
+ "version": "1.0.14",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ],
+ "timestamp": 1541740904
+ },
+ {
+ "version": "1.0.13",
+ "changes": [
+ {
+ "note": "Make web3-provider-engine types a 'dependency' so it's available to users of the library",
+ "pr": 1105
+ }
+ ],
+ "timestamp": 1539871071
+ },
+ {
"version": "1.0.12",
"changes": [
{
diff --git a/packages/dev-utils/CHANGELOG.md b/packages/dev-utils/CHANGELOG.md
index 00301d9c9..ee614a904 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.14 - _November 9, 2018_
+
+ * Dependencies updated
+
+## v1.0.13 - _October 18, 2018_
+
+ * Make web3-provider-engine types a 'dependency' so it's available to users of the library (#1105)
+
## v1.0.12 - _October 4, 2018_
* Dependencies updated
@@ -37,7 +45,7 @@ CHANGELOG
* Dependencies updated
-## v1.0.4 - _August 13, 2018_
+## v1.0.4 - _August 14, 2018_
* Dependencies updated
diff --git a/packages/dev-utils/README.md b/packages/dev-utils/README.md
index 1c3bd3a3f..73b0b8816 100644
--- a/packages/dev-utils/README.md
+++ b/packages/dev-utils/README.md
@@ -16,14 +16,14 @@ Boolean env variables should be either `true` or `false`. Defaults to `false` if
## Install
```bash
-yarn add @0xproject/dev-utils
+yarn add @0x/dev-utils
```
If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`:
```json
"compilerOptions": {
- "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"],
+ "typeRoots": ["node_modules/@0x/typescript-typings/types", "node_modules/@types"],
}
```
@@ -52,13 +52,13 @@ yarn install
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
```bash
-PKG=@0xproject/dev-utils yarn build
+PKG=@0x/dev-utils yarn build
```
Or continuously rebuild on change:
```bash
-PKG=@0xproject/dev-utils yarn watch
+PKG=@0x/dev-utils yarn watch
```
### Clean
diff --git a/packages/dev-utils/package.json b/packages/dev-utils/package.json
index c4298c2d2..e1b3201d3 100644
--- a/packages/dev-utils/package.json
+++ b/packages/dev-utils/package.json
@@ -1,6 +1,6 @@
{
- "name": "@0xproject/dev-utils",
- "version": "1.0.12",
+ "name": "@0x/dev-utils",
+ "version": "1.0.14",
"engines": {
"node": ">=6.12"
},
@@ -17,7 +17,7 @@
"test:coverage": "nyc npm run test --all && yarn coverage:report:lcov",
"coverage:report:lcov": "nyc report --reporter=text-lcov > coverage/lcov.info",
"clean": "shx rm -rf lib",
- "lint": "tslint --project ."
+ "lint": "tslint --format stylish --project ."
},
"license": "Apache-2.0",
"repository": {
@@ -29,11 +29,9 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/dev-utils/README.md",
"devDependencies": {
- "@0xproject/tslint-config": "^1.0.8",
+ "@0x/tslint-config": "^1.0.10",
"@types/lodash": "4.14.104",
"@types/mocha": "^2.2.42",
- "chai": "^4.0.1",
- "copyfiles": "^2.0.0",
"make-promises-safe": "^1.1.0",
"mocha": "^4.1.0",
"npm-run-all": "^4.1.2",
@@ -43,12 +41,14 @@
"typescript": "3.0.1"
},
"dependencies": {
- "@0xproject/subproviders": "^2.0.7",
- "@0xproject/types": "^1.1.4",
- "@0xproject/typescript-typings": "^3.0.2",
- "@0xproject/utils": "^2.0.2",
- "@0xproject/web3-wrapper": "^3.0.3",
- "ethereum-types": "^1.0.11",
+ "@0x/subproviders": "^2.1.1",
+ "@0x/types": "^1.2.1",
+ "@0x/typescript-typings": "^3.0.4",
+ "@0x/utils": "^2.0.4",
+ "@0x/web3-wrapper": "^3.1.1",
+ "@types/web3-provider-engine": "^14.0.0",
+ "chai": "^4.0.1",
+ "ethereum-types": "^1.1.2",
"lodash": "^4.17.5"
},
"publishConfig": {
diff --git a/packages/dev-utils/src/blockchain_lifecycle.ts b/packages/dev-utils/src/blockchain_lifecycle.ts
index a48cb0856..e9687787f 100644
--- a/packages/dev-utils/src/blockchain_lifecycle.ts
+++ b/packages/dev-utils/src/blockchain_lifecycle.ts
@@ -1,5 +1,5 @@
-import { logUtils } from '@0xproject/utils';
-import { NodeType, Web3Wrapper } from '@0xproject/web3-wrapper';
+import { logUtils } from '@0x/utils';
+import { NodeType, Web3Wrapper } from '@0x/web3-wrapper';
import * as _ from 'lodash';
// HACK(albrow): 🐉 We have to do this so that debug.setHead works correctly.
diff --git a/packages/dev-utils/src/callback_error_reporter.ts b/packages/dev-utils/src/callback_error_reporter.ts
index e69ce1c05..b993bf22a 100644
--- a/packages/dev-utils/src/callback_error_reporter.ts
+++ b/packages/dev-utils/src/callback_error_reporter.ts
@@ -1,7 +1,7 @@
import * as chai from 'chai';
import * as _ from 'lodash';
-import { DoneCallback } from '@0xproject/types';
+import { DoneCallback } from '@0x/types';
const expect = chai.expect;
diff --git a/packages/dev-utils/src/web3_factory.ts b/packages/dev-utils/src/web3_factory.ts
index 7c86d3df4..b22bcc88b 100644
--- a/packages/dev-utils/src/web3_factory.ts
+++ b/packages/dev-utils/src/web3_factory.ts
@@ -4,7 +4,7 @@ import {
GanacheSubprovider,
RPCSubprovider,
Web3ProviderEngine,
-} from '@0xproject/subproviders';
+} from '@0x/subproviders';
import * as fs from 'fs';
import * as _ from 'lodash';
diff --git a/packages/dev-utils/test/blockchain_lifecycle_test.ts b/packages/dev-utils/test/blockchain_lifecycle_test.ts
index 7d5e15fbe..d7e54f0e8 100644
--- a/packages/dev-utils/test/blockchain_lifecycle_test.ts
+++ b/packages/dev-utils/test/blockchain_lifecycle_test.ts
@@ -1,4 +1,4 @@
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import * as chai from 'chai';
import 'mocha';
diff --git a/packages/dev-utils/test/rpc_test.ts b/packages/dev-utils/test/rpc_test.ts
index dfbc0f7b2..f8cea4580 100644
--- a/packages/dev-utils/test/rpc_test.ts
+++ b/packages/dev-utils/test/rpc_test.ts
@@ -1,4 +1,4 @@
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import * as chai from 'chai';
import { BlockParamLiteral } from 'ethereum-types';
import 'mocha';
diff --git a/packages/dev-utils/tslint.json b/packages/dev-utils/tslint.json
index 015dce851..631f46bca 100644
--- a/packages/dev-utils/tslint.json
+++ b/packages/dev-utils/tslint.json
@@ -1,5 +1,5 @@
{
- "extends": ["@0xproject/tslint-config"],
+ "extends": ["@0x/tslint-config"],
"rules": {
"completed-docs": false
}
diff --git a/packages/ethereum-types/CHANGELOG.json b/packages/ethereum-types/CHANGELOG.json
index 60fb8c806..9db75ae9f 100644
--- a/packages/ethereum-types/CHANGELOG.json
+++ b/packages/ethereum-types/CHANGELOG.json
@@ -1,11 +1,29 @@
[
{
- "version": "1.1.0",
+ "version": "1.1.2",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ],
+ "timestamp": 1541740904
+ },
+ {
+ "version": "1.1.1",
"changes": [
{
"note": "Add `JSONRPCResponseError` and error field on `JSONRPCResponsePayload`.",
"pr": 1102
}
+ ],
+ "timestamp": 1539871071
+ },
+ {
+ "version": "1.1.0",
+ "changes": [
+ {
+ "note": "Unpublished package."
+ }
]
},
{
diff --git a/packages/ethereum-types/CHANGELOG.md b/packages/ethereum-types/CHANGELOG.md
index 6e1965964..6ad7b4cc6 100644
--- a/packages/ethereum-types/CHANGELOG.md
+++ b/packages/ethereum-types/CHANGELOG.md
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
+## v1.1.2 - _November 9, 2018_
+
+ * Dependencies updated
+
+## v1.1.1 - _October 18, 2018_
+
+ * Add `JSONRPCResponseError` and error field on `JSONRPCResponsePayload`. (#1102)
+
+## v1.1.0 - _Invalid date_
+
+ * Unpublished package.
+
## v1.0.11 - _October 4, 2018_
* Dependencies updated
@@ -33,7 +45,7 @@ CHANGELOG
* Dependencies updated
-## v1.0.4 - _August 13, 2018_
+## v1.0.4 - _August 14, 2018_
* Dependencies updated
@@ -55,6 +67,6 @@ CHANGELOG
* Add `TransactionReceiptStatus` type (#812)
* Add Artifact types: `CompilerSettings`, `CompilerOptions`, `OutputField` (#924)
-## v0.0.2 - _May 31, 2018_
+## v0.0.2 - _June 1, 2018_
* Initial publish (#642)
diff --git a/packages/ethereum-types/package.json b/packages/ethereum-types/package.json
index 26dd147ed..1630344db 100644
--- a/packages/ethereum-types/package.json
+++ b/packages/ethereum-types/package.json
@@ -1,6 +1,6 @@
{
"name": "ethereum-types",
- "version": "1.0.11",
+ "version": "1.1.2",
"engines": {
"node": ">=6.12"
},
@@ -11,7 +11,7 @@
"build": "tsc -b",
"build:ci": "yarn build",
"clean": "shx rm -rf lib generated_docs",
- "lint": "tslint --project .",
+ "lint": "tslint --format stylish --project .",
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --tsconfig typedoc-tsconfig.json --json $JSON_FILE_PATH $PROJECT_FILES"
},
"config": {
@@ -29,8 +29,7 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/ethereum-types/README.md",
"devDependencies": {
- "@0xproject/tslint-config": "^1.0.8",
- "copyfiles": "^2.0.0",
+ "@0x/tslint-config": "^1.0.10",
"make-promises-safe": "^1.1.0",
"shx": "^0.2.2",
"tslint": "5.11.0",
diff --git a/packages/ethereum-types/src/index.ts b/packages/ethereum-types/src/index.ts
index ddd472010..eff38711a 100644
--- a/packages/ethereum-types/src/index.ts
+++ b/packages/ethereum-types/src/index.ts
@@ -20,7 +20,9 @@ export type ConstructorStateMutability = 'nonpayable' | 'payable';
export type StateMutability = 'pure' | 'view' | ConstructorStateMutability;
export interface MethodAbi {
- type: 'function'; // We hardcode this here b/c doc pages cannot render an enum value
+ // Ideally this would be set to: `'function'` but then TS complains when artifacts are loaded
+ // from JSON files, and this value has type `string` not type `'function'`
+ type: string;
name: string;
inputs: DataItem[];
outputs: DataItem[];
@@ -30,14 +32,18 @@ export interface MethodAbi {
}
export interface ConstructorAbi {
- type: 'constructor'; // We hardcode this here b/c doc pages cannot render an enum value
+ // Ideally this would be set to: `'constructor'` but then TS complains when artifacts are loaded
+ // from JSON files, and this value has type `string` not type `'constructor'`
+ type: string;
inputs: DataItem[];
payable: boolean;
stateMutability: ConstructorStateMutability;
}
export interface FallbackAbi {
- type: 'fallback'; // We hardcode this here b/c doc pages cannot render an enum value
+ // Ideally this would be set to: `'fallback'` but then TS complains when artifacts are loaded
+ // from JSON files, and this value has type `string` not type `'fallback'`
+ type: string;
payable: boolean;
}
@@ -46,7 +52,9 @@ export interface EventParameter extends DataItem {
}
export interface EventAbi {
- type: 'event'; // We hardcode this here b/c doc pages cannot render an enum value
+ // Ideally this would be set to: `'event'` but then TS complains when artifacts are loaded
+ // from JSON files, and this value has type `string` not type `'event'`
+ type: string;
name: string;
inputs: EventParameter[];
anonymous: boolean;
diff --git a/packages/ethereum-types/tslint.json b/packages/ethereum-types/tslint.json
index ffaefe83a..dd9053357 100644
--- a/packages/ethereum-types/tslint.json
+++ b/packages/ethereum-types/tslint.json
@@ -1,3 +1,3 @@
{
- "extends": ["@0xproject/tslint-config"]
+ "extends": ["@0x/tslint-config"]
}
diff --git a/packages/fill-scenarios/CHANGELOG.json b/packages/fill-scenarios/CHANGELOG.json
index 78a51d265..8aa4e78d3 100644
--- a/packages/fill-scenarios/CHANGELOG.json
+++ b/packages/fill-scenarios/CHANGELOG.json
@@ -1,5 +1,24 @@
[
{
+ "version": "1.0.9",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ],
+ "timestamp": 1541740904
+ },
+ {
+ "version": "1.0.8",
+ "changes": [
+ {
+ "note": "Updated to use new @0xproject/contract-artifacts and @0xproject/abi-gen-wrappers packages",
+ "pr": 1105
+ }
+ ],
+ "timestamp": 1539871071
+ },
+ {
"version": "1.0.7",
"changes": [
{
diff --git a/packages/fill-scenarios/CHANGELOG.md b/packages/fill-scenarios/CHANGELOG.md
index bf6fcf13e..4ff28f82f 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.0.9 - _November 9, 2018_
+
+ * Dependencies updated
+
+## v1.0.8 - _October 18, 2018_
+
+ * Updated to use new @0xproject/contract-artifacts and @0xproject/abi-gen-wrappers packages (#1105)
+
## v1.0.7 - _October 4, 2018_
* Dependencies updated
@@ -41,7 +49,7 @@ CHANGELOG
* Dependencies updated
-## v1.0.1-rc.3 - _August 13, 2018_
+## v1.0.1-rc.3 - _August 14, 2018_
* Updated to use latest orderFactory interface, fixed `feeRecipient` spelling error in public interface (#936)
* Dependencies updated
diff --git a/packages/fill-scenarios/README.md b/packages/fill-scenarios/README.md
index 67df0941f..794b70e56 100644
--- a/packages/fill-scenarios/README.md
+++ b/packages/fill-scenarios/README.md
@@ -1,18 +1,18 @@
-## @0xproject/fill-scenarios
+## @0x/fill-scenarios
0x order fill scenario generator
## Installation
```bash
-yarn add @0xproject/fill-scenarios
+yarn add @0x/fill-scenarios
```
If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`:
```json
"compilerOptions": {
- "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"],
+ "typeRoots": ["node_modules/@0x/typescript-typings/types", "node_modules/@types"],
}
```
@@ -41,13 +41,13 @@ yarn install
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
```bash
-PKG=@0xproject/fill-scenarios yarn build
+PKG=@0x/fill-scenarios yarn build
```
Or continuously rebuild on change:
```bash
-PKG=@0xproject/fill-scenarios yarn watch
+PKG=@0x/fill-scenarios yarn watch
```
### Clean
diff --git a/packages/fill-scenarios/package.json b/packages/fill-scenarios/package.json
index dd6ede3e0..e9ca077fb 100644
--- a/packages/fill-scenarios/package.json
+++ b/packages/fill-scenarios/package.json
@@ -1,21 +1,14 @@
{
- "name": "@0xproject/fill-scenarios",
- "version": "1.0.7",
+ "name": "@0x/fill-scenarios",
+ "version": "1.0.9",
"description": "0x order fill scenario generator",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"scripts": {
- "build": "yarn pre_build && tsc -b",
+ "build": "yarn tsc -b",
"build:ci": "yarn build",
- "pre_build": "run-s update_artifacts generate_contract_wrappers",
- "update_artifacts": "for i in ${npm_package_config_contracts}; do copyfiles -u 4 ../migrations/artifacts/2.0.0-trimmed/$i.json lib/artifacts; done;",
- "generate_contract_wrappers": "abi-gen --abis 'lib/artifacts/@(Exchange|DummyERC20Token|DummyERC721Token).json' --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/generated_contract_wrappers --backend ethers",
- "copy_monorepo_scripts": "copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts",
"clean": "shx rm -rf lib src/generated_contract_wrappers",
- "lint": "tslint --project . --exclude **/src/generated_contract_wrappers/**/*"
- },
- "config": {
- "contracts": "Exchange DummyERC20Token DummyERC721Token"
+ "lint": "tslint --format stylish --project ."
},
"license": "Apache-2.0",
"repository": {
@@ -27,24 +20,23 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/fill-scenarios/README.md",
"devDependencies": {
- "@0xproject/abi-gen": "^1.0.13",
- "@0xproject/tslint-config": "^1.0.8",
+ "@0x/tslint-config": "^1.0.10",
"@types/lodash": "4.14.104",
- "copyfiles": "^2.0.0",
"make-promises-safe": "^1.1.0",
- "npm-run-all": "^4.1.2",
"shx": "^0.2.2",
"tslint": "5.11.0",
"typescript": "3.0.1"
},
"dependencies": {
- "@0xproject/base-contract": "^3.0.1",
- "@0xproject/order-utils": "^1.0.7",
- "@0xproject/types": "^1.1.4",
- "@0xproject/typescript-typings": "^3.0.2",
- "@0xproject/utils": "^2.0.2",
- "@0xproject/web3-wrapper": "^3.0.3",
- "ethereum-types": "^1.0.11",
+ "@0x/abi-gen-wrappers": "^1.0.2",
+ "@0x/base-contract": "^3.0.3",
+ "@0x/contract-artifacts": "^1.1.0",
+ "@0x/order-utils": "^2.0.1",
+ "@0x/types": "^1.2.1",
+ "@0x/typescript-typings": "^3.0.4",
+ "@0x/utils": "^2.0.4",
+ "@0x/web3-wrapper": "^3.1.1",
+ "ethereum-types": "^1.1.2",
"ethers": "~4.0.4",
"lodash": "^4.17.5"
},
diff --git a/packages/fill-scenarios/src/artifacts.ts b/packages/fill-scenarios/src/artifacts.ts
deleted file mode 100644
index b78ca0cc2..000000000
--- a/packages/fill-scenarios/src/artifacts.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import { ContractArtifact } from 'ethereum-types';
-
-import * as DummyERC20Token from './artifacts/DummyERC20Token.json';
-import * as DummyERC721Token from './artifacts/DummyERC721Token.json';
-import * as Exchange from './artifacts/Exchange.json';
-
-export const artifacts = {
- DummyERC20Token: (DummyERC20Token as any) as ContractArtifact,
- DummyERC721Token: (DummyERC721Token as any) as ContractArtifact,
- Exchange: (Exchange as any) as ContractArtifact,
-};
diff --git a/packages/fill-scenarios/src/fill_scenarios.ts b/packages/fill-scenarios/src/fill_scenarios.ts
index 604eeaffc..0154bcd0a 100644
--- a/packages/fill-scenarios/src/fill_scenarios.ts
+++ b/packages/fill-scenarios/src/fill_scenarios.ts
@@ -1,16 +1,14 @@
-import { assetDataUtils } from '@0xproject/order-utils';
-import { orderFactory } from '@0xproject/order-utils/lib/src/order_factory';
-import { AssetProxyId, ERC721AssetData, OrderWithoutExchangeAddress, SignedOrder } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { DummyERC20TokenContract, DummyERC721TokenContract, ExchangeContract } from '@0x/abi-gen-wrappers';
+import * as artifacts from '@0x/contract-artifacts';
+import { assetDataUtils } from '@0x/order-utils';
+import { orderFactory } from '@0x/order-utils/lib/src/order_factory';
+import { AssetProxyId, ERC721AssetData, OrderWithoutExchangeAddress, SignedOrder } from '@0x/types';
+import { BigNumber } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import { Provider } from 'ethereum-types';
import * as _ from 'lodash';
-import { artifacts } from './artifacts';
import { constants } from './constants';
-import { DummyERC20TokenContract } from './generated_contract_wrappers/dummy_erc20_token';
-import { DummyERC721TokenContract } from './generated_contract_wrappers/dummy_erc721_token';
-import { ExchangeContract } from './generated_contract_wrappers/exchange';
export class FillScenarios {
private readonly _web3Wrapper: Web3Wrapper;
diff --git a/packages/fill-scenarios/src/globals.d.ts b/packages/fill-scenarios/src/globals.d.ts
deleted file mode 100644
index 94e63a32d..000000000
--- a/packages/fill-scenarios/src/globals.d.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-declare module '*.json' {
- const json: any;
- /* tslint:disable */
- export default json;
- /* tslint:enable */
-}
diff --git a/packages/fill-scenarios/tslint.json b/packages/fill-scenarios/tslint.json
index ffaefe83a..dd9053357 100644
--- a/packages/fill-scenarios/tslint.json
+++ b/packages/fill-scenarios/tslint.json
@@ -1,3 +1,3 @@
{
- "extends": ["@0xproject/tslint-config"]
+ "extends": ["@0x/tslint-config"]
}
diff --git a/packages/instant/.dogfood.discharge.json b/packages/instant/.dogfood.discharge.json
new file mode 100644
index 000000000..9ade97d01
--- /dev/null
+++ b/packages/instant/.dogfood.discharge.json
@@ -0,0 +1,13 @@
+{
+ "domain": "0x-instant-dogfood",
+ "build_command": "yarn build:umd:prod",
+ "upload_directory": "public",
+ "index_key": "index.html",
+ "error_key": "index.html",
+ "trailing_slashes": true,
+ "cache": 3600,
+ "aws_profile": "default",
+ "aws_region": "us-east-1",
+ "cdn": false,
+ "dns_configured": true
+}
diff --git a/packages/instant/.staging.discharge.json b/packages/instant/.staging.discharge.json
new file mode 100644
index 000000000..1026b9986
--- /dev/null
+++ b/packages/instant/.staging.discharge.json
@@ -0,0 +1,13 @@
+{
+ "domain": "0x-instant-staging",
+ "build_command": "yarn build:umd:prod",
+ "upload_directory": "public",
+ "index_key": "index.html",
+ "error_key": "index.html",
+ "trailing_slashes": true,
+ "cache": 3600,
+ "aws_profile": "default",
+ "aws_region": "us-east-1",
+ "cdn": false,
+ "dns_configured": true
+}
diff --git a/packages/instant/README.md b/packages/instant/README.md
index 25aca9d3b..b83a10508 100644
--- a/packages/instant/README.md
+++ b/packages/instant/README.md
@@ -1,9 +1,9 @@
-## @0xproject/instant
+## @0x/instant
## Installation
```bash
-yarn add @0xproject/instant
+yarn add @0x/instant
```
**Import**
@@ -11,20 +11,20 @@ yarn add @0xproject/instant
**CommonJS module**
```typescript
-import { ZeroExInstant } from '@0xproject/instant';
+import { ZeroExInstant } from '@0x/instant';
```
or
```javascript
-var ZeroExInstant = require('@0xproject/instant').ZeroExInstant;
+var ZeroExInstant = require('@0x/instant').ZeroExInstant;
```
If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`:
```json
"compilerOptions": {
- "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"],
+ "typeRoots": ["node_modules/@0x/typescript-typings/types", "node_modules/@types"],
}
```
@@ -46,6 +46,26 @@ The package is also available as a UMD module named `zeroExInstant`.
</body>
```
+## Deploying
+
+You can deploy a work-in-progress version of 0x Instant at http://0x-instant-dogfood.s3-website-us-east-1.amazonaws.com for easy sharing.
+
+To build and deploy the site run
+
+```
+yarn deploy_dogfood
+```
+
+We also have a staging bucket that is to be updated less frequently can be used to share instant externally: http://0x-instant-staging.s3-website-us-east-1.amazonaws.com/
+
+To build and deploy to this bucket, run
+
+```
+yarn deploy_staging
+```
+
+**NOTE: On deploying the site, it will say the site is available at a non-existent URL. Please ignore and use the (now updated) URL above.**
+
## Contributing
We welcome improvements and fixes from the wider community! To report bugs within this package, please create an issue in this repository.
@@ -71,13 +91,13 @@ yarn install
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
```bash
-PKG=@0xproject/instant yarn build
+PKG=@0x/instant yarn build
```
Or continuously rebuild on change:
```bash
-PKG=@0xproject/instant yarn watch
+PKG=@0x/instant yarn watch
```
### Clean
diff --git a/packages/instant/package.json b/packages/instant/package.json
index ff40ba2ea..3c87743c1 100644
--- a/packages/instant/package.json
+++ b/packages/instant/package.json
@@ -1,6 +1,6 @@
{
- "name": "@0xproject/instant",
- "version": "0.0.2",
+ "name": "@0x/instant",
+ "version": "0.0.4",
"engines": {
"node": ">=6.12"
},
@@ -16,12 +16,14 @@
"build:ci": "yarn build",
"watch_without_deps": "tsc -w",
"dev": "webpack-dev-server --mode development",
- "lint": "tslint --project .",
+ "lint": "tslint --format stylish --project .",
"test": "jest",
"test:coverage": "jest --coverage",
"rebuild_and_test": "run-s clean build test",
"test:circleci": "yarn test:coverage",
"clean": "shx rm -rf lib coverage scripts",
+ "deploy_dogfood": "discharge deploy -c .dogfood.discharge.json",
+ "deploy_staging": "discharge deploy -c .staging.discharge.json",
"manual:postpublish": "yarn build; node ./scripts/postpublish.js"
},
"config": {
@@ -43,32 +45,41 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/instant/README.md",
"dependencies": {
- "@0xproject/asset-buyer": "^2.0.0",
- "@0xproject/types": "^1.1.4",
- "@0xproject/typescript-typings": "^2.0.2",
- "@0xproject/utils": "^2.0.2",
- "@0xproject/web3-wrapper": "^3.0.3",
- "ethereum-types": "^1.0.11",
+ "@0x/assert": "^1.0.15",
+ "@0x/asset-buyer": "^2.2.0",
+ "@0x/json-schemas": "^2.0.1",
+ "@0x/order-utils": "^2.0.1",
+ "@0x/subproviders": "^2.1.1",
+ "@0x/types": "^1.2.1",
+ "@0x/typescript-typings": "^3.0.4",
+ "@0x/utils": "^2.0.4",
+ "@0x/web3-wrapper": "^3.1.1",
+ "copy-to-clipboard": "^3.0.8",
+ "ethereum-types": "^1.1.2",
"lodash": "^4.17.10",
"polished": "^2.2.0",
"react": "^16.5.2",
"react-dom": "^16.5.2",
"react-redux": "^5.0.7",
"redux": "^4.0.0",
- "styled-components": "^3.4.9"
+ "redux-devtools-extension": "^2.13.5",
+ "styled-components": "^4.0.2",
+ "ts-optchain": "^0.1.1"
},
"devDependencies": {
- "@0xproject/tslint-config": "^1.0.8",
+ "@0x/tslint-config": "^1.0.10",
+ "@static/discharge": "https://github.com/0xProject/discharge.git",
"@types/enzyme": "^3.1.14",
"@types/enzyme-adapter-react-16": "^1.0.3",
+ "@types/jest": "^23.3.5",
"@types/lodash": "^4.14.116",
"@types/node": "*",
"@types/react": "^16.4.16",
"@types/react-dom": "^16.0.8",
"@types/react-redux": "^6.0.9",
"@types/redux": "^3.6.0",
+ "@types/styled-components": "^4.0.1",
"awesome-typescript-loader": "^5.2.1",
- "copyfiles": "^1.2.0",
"enzyme": "^3.6.0",
"enzyme-adapter-react-16": "^1.5.0",
"jest": "^23.6.0",
@@ -78,7 +89,7 @@
"shx": "^0.2.2",
"ts-jest": "^23.10.3",
"tslint": "5.11.0",
- "typedoc": "0.12.0",
+ "typedoc": "0.13.0",
"typescript": "3.0.1",
"webpack": "^4.20.2",
"webpack-cli": "^3.1.1",
diff --git a/packages/instant/public/external.css b/packages/instant/public/external.css
new file mode 100644
index 000000000..cab11112a
--- /dev/null
+++ b/packages/instant/public/external.css
@@ -0,0 +1,25 @@
+/*
+ CSS file meant to represent an external (integrators) stylesheet and
+ help ensure that instant looks consistent across environments.
+*/
+
+button {
+ font-size: 50px;
+ height: 200px;
+ background-color: red;
+}
+
+input {
+ padding: 100px;
+ font-size: 50px;
+ height: 100px;
+}
+
+div {
+ padding: 3px;
+}
+
+p {
+ background-color: green;
+ margin: 10px;
+}
diff --git a/packages/instant/public/index.html b/packages/instant/public/index.html
index fb041745e..f6c809e33 100644
--- a/packages/instant/public/index.html
+++ b/packages/instant/public/index.html
@@ -5,7 +5,10 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>0x Instant Dev Environment</title>
+ <link rel="stylesheet" href="/external.css">
<script type="text/javascript" src="/main.bundle.js" charset="utf-8"></script>
+ <script type="text/javascript" src="https://unpkg.com/jsuri@1.3.1/Uri.js" charset="utf-8"></script>
+ <script type="text/javascript" src="https://unpkg.com/bignumber.js@4.1.0/bignumber.js" charset="utf-8"></script>
<style>
#zeroExInstantContainer {
display: flex;
@@ -24,9 +27,110 @@
<body>
<div id="zeroExInstantContainer"></div>
<script>
- zeroExInstant.render({
-
+ const removeUndefined = (obj) => {
+ for (let k in obj) if (obj[k] === undefined) delete obj[k];
+ return obj;
+ }
+ BigNumber.config({
+ EXPONENTIAL_AT: 1000,
+ DECIMAL_PLACES: 78,
});
+ const providedOrders = [
+ // Order selling REP
+ {
+ senderAddress: '0x0000000000000000000000000000000000000000',
+ makerAddress: '0x34a745008a643eebc58920eaa29fb1165b4a288e',
+ takerAddress: '0x0000000000000000000000000000000000000000',
+ makerFee: new BigNumber('0'),
+ takerFee: new BigNumber('0'),
+ makerAssetAmount: new BigNumber('200000000000000000000'),
+ takerAssetAmount: new BigNumber('10000000000000000000'),
+ makerAssetData: '0xf47261b00000000000000000000000008cb3971b8eb709c14616bd556ff6683019e90d9c',
+ takerAssetData: '0xf47261b0000000000000000000000000d0a1e359811322d97991e03f863a0c30c2cf029c',
+ expirationTimeSeconds: new BigNumber('1601535600'),
+ feeRecipientAddress: '0x0000000000000000000000000000000000000000',
+ salt: new BigNumber('3101985707338942582579795423923841749956600670712030922928319824580764688653'),
+ signature: '0x1bd4d5686fea801fe33c68c4944356085e7e6cb553eb7073160abd815609f714e85fb47f44b7ffd0a2a1321ac40d72d55163869d0a50fdb5a402132150fe33a08403',
+ exchangeAddress: '0x35dd2932454449b14cee11a94d3674a936d5d7b2'
+ },
+ // Order selling ZRX
+ {
+ senderAddress: '0x0000000000000000000000000000000000000000',
+ makerAddress: '0x34a745008a643eebc58920eaa29fb1165b4a288e',
+ takerAddress: '0x0000000000000000000000000000000000000000',
+ makerFee: new BigNumber('0'),
+ takerFee: new BigNumber('0'),
+ makerAssetAmount: new BigNumber('300000000000000000000'),
+ takerAssetAmount: new BigNumber('31000000000000000000'),
+ makerAssetData: '0xf47261b00000000000000000000000002002d3812f58e35f0ea1ffbf80a75a38c32175fa',
+ takerAssetData: '0xf47261b0000000000000000000000000d0a1e359811322d97991e03f863a0c30c2cf029c',
+ expirationTimeSeconds: new BigNumber('2524636800'),
+ feeRecipientAddress: '0x0000000000000000000000000000000000000000',
+ salt: new BigNumber('64592004666704945574675477805199411288137454783320798602050822322450089238268'),
+ signature: '0x1c13cacddca8d7d8248e91f412377e68f8f1f9891a59a6c1b2eea9f7b33558c30c4fb86a448e08ab7def40a28fb3a3062dcb33bb3c45302447fce5c4288b7c7f5b03',
+ exchangeAddress: '0x35dd2932454449b14cee11a94d3674a936d5d7b2'
+ },
+ // Order selling GNT
+ {
+ senderAddress: '0x0000000000000000000000000000000000000000',
+ makerAddress: '0x34a745008a643eebc58920eaa29fb1165b4a288e',
+ takerAddress: '0x0000000000000000000000000000000000000000',
+ makerFee: new BigNumber('0'),
+ takerFee: new BigNumber('0'),
+ makerAssetAmount: new BigNumber('250000000000000000000'),
+ takerAssetAmount: new BigNumber('10000000000000000000'),
+ makerAssetData: '0xf47261b000000000000000000000000031fb614e223706f15d0d3c5f4b08bdf0d5c78623',
+ takerAssetData: '0xf47261b0000000000000000000000000d0a1e359811322d97991e03f863a0c30c2cf029c',
+ expirationTimeSeconds: new BigNumber('1601535600'),
+ feeRecipientAddress: '0x0000000000000000000000000000000000000000',
+ salt: new BigNumber('40204378562212615907903051460421336779451270522691667164301816101569427926606'),
+ signature: '0x1c788bf4b93769da1e8f195f52f0f59b4a298ac6da30cf6d05a87ed4be5ee974f61352ed1bc6a0844d0962b8c894c9ca08e452431255958a4e98dd93cbe1fbc73803',
+ exchangeAddress: '0x35dd2932454449b14cee11a94d3674a936d5d7b2'
+ },
+ // Order selling MKR
+ {
+ senderAddress: '0x0000000000000000000000000000000000000000',
+ makerAddress: '0x34a745008a643eebc58920eaa29fb1165b4a288e',
+ takerAddress: '0x0000000000000000000000000000000000000000',
+ makerFee: new BigNumber('0'),
+ takerFee: new BigNumber('0'),
+ makerAssetAmount: new BigNumber('200000000000000000000'),
+ takerAssetAmount: new BigNumber('5000000000000000000'),
+ makerAssetData: '0xf47261b00000000000000000000000007b6b10caa9e8e9552ba72638ea5b47c25afea1f3',
+ takerAssetData: '0xf47261b0000000000000000000000000d0a1e359811322d97991e03f863a0c30c2cf029c',
+ expirationTimeSeconds: new BigNumber('1601535600'),
+ feeRecipientAddress: '0x0000000000000000000000000000000000000000',
+ salt: new BigNumber('71338269924068280039932133924198049371838034090153601678083172009862985793828'),
+ signature: '0x1bb3151d57ee1e8fa697767ce83ee4ba77d1ceb8cc1e79c7d77126b3687517704c50c6b3d9cb42c7e7d4478d574b297dfbd1626c5c18a7bc9c2a792c4c07f0797c03',
+ exchangeAddress: '0x35dd2932454449b14cee11a94d3674a936d5d7b2'
+ }
+ ];
+ const queryParams = new Uri(window.location.search);
+ const renderOptionsDefaults = {
+ orderSource: 'https://api.radarrelay.com/0x/v2/',
+ onClose: () => { console.log('0x Instant Closed') }
+ }
+ const orderSourceOverride = queryParams.getQueryParamValue('orderSource');
+ const availableAssetDatasString = queryParams.getQueryParamValue('availableAssetDatas');
+ const feeRecipientOverride = queryParams.getQueryParamValue('feeRecipient');
+ const feePercentageOverride = +queryParams.getQueryParamValue('feePercentage');
+ let affiliateInfoOverride;
+ if (feeRecipientOverride !== undefined && feePercentageOverride !== undefined) {
+ affiliateInfoOverride = {
+ feeRecipient: feeRecipientOverride,
+ feePercentage: feePercentageOverride
+ };
+ }
+ const renderOptionsOverrides = {
+ orderSource: orderSourceOverride === 'provided' ? providedOrders : orderSourceOverride,
+ networkId: +queryParams.getQueryParamValue('networkId') || undefined,
+ defaultAssetBuyAmount: +queryParams.getQueryParamValue('defaultAssetBuyAmount') || undefined,
+ availableAssetDatas: availableAssetDatasString ? JSON.parse(availableAssetDatasString) : undefined,
+ defaultSelectedAssetData: queryParams.getQueryParamValue('defaultSelectedAssetData'),
+ affiliateInfo: affiliateInfoOverride,
+ }
+ const renderOptions = Object.assign({}, renderOptionsDefaults, removeUndefined(renderOptionsOverrides));
+ zeroExInstant.render(renderOptions);
</script>
</body>
diff --git a/packages/instant/src/components/amount_input.tsx b/packages/instant/src/components/amount_input.tsx
deleted file mode 100644
index 38810063d..000000000
--- a/packages/instant/src/components/amount_input.tsx
+++ /dev/null
@@ -1,47 +0,0 @@
-import { BigNumber } from '@0xproject/utils';
-import * as _ from 'lodash';
-import * as React from 'react';
-
-import { ColorOption } from '../style/theme';
-
-import { Container, Input } from './ui';
-
-export interface AmountInputProps {
- fontColor?: ColorOption;
- fontSize?: string;
- value?: BigNumber;
- onChange?: (value?: BigNumber) => void;
-}
-
-export class AmountInput extends React.Component<AmountInputProps> {
- public render(): React.ReactNode {
- const { fontColor, fontSize, value } = this.props;
- return (
- <Container borderBottom="1px solid rgba(255,255,255,0.3)" display="inline-block">
- <Input
- fontColor={fontColor}
- fontSize={fontSize}
- onChange={this._handleChange}
- value={!_.isUndefined(value) ? value.toString() : ''}
- placeholder="0.00"
- width="2em"
- />
- </Container>
- );
- }
- private readonly _handleChange = (event: React.ChangeEvent<HTMLInputElement>): void => {
- const value = event.target.value;
- let bigNumberValue;
- if (!_.isEmpty(value)) {
- try {
- bigNumberValue = new BigNumber(event.target.value);
- } catch {
- // We don't want to allow values that can't be a BigNumber, so don't even call onChange.
- return;
- }
- }
- if (!_.isUndefined(this.props.onChange)) {
- this.props.onChange(bigNumberValue);
- }
- };
-}
diff --git a/packages/instant/src/components/amount_placeholder.tsx b/packages/instant/src/components/amount_placeholder.tsx
new file mode 100644
index 000000000..29ce8fafb
--- /dev/null
+++ b/packages/instant/src/components/amount_placeholder.tsx
@@ -0,0 +1,32 @@
+import * as React from 'react';
+
+import { ColorOption } from '../style/theme';
+
+import { Pulse } from './animations/pulse';
+
+import { Text } from './ui/text';
+
+interface PlainPlaceholder {
+ color: ColorOption;
+}
+const PlainPlaceholder: React.StatelessComponent<PlainPlaceholder> = props => (
+ <Text fontWeight="bold" fontColor={props.color}>
+ &mdash;
+ </Text>
+);
+
+export interface AmountPlaceholderProps {
+ color: ColorOption;
+ isPulsating: boolean;
+}
+export const AmountPlaceholder: React.StatelessComponent<AmountPlaceholderProps> = props => {
+ if (props.isPulsating) {
+ return (
+ <Pulse>
+ <PlainPlaceholder color={props.color} />
+ </Pulse>
+ );
+ } else {
+ return <PlainPlaceholder color={props.color} />;
+ }
+};
diff --git a/packages/instant/src/components/animations/full_rotation.tsx b/packages/instant/src/components/animations/full_rotation.tsx
new file mode 100644
index 000000000..9adb565f9
--- /dev/null
+++ b/packages/instant/src/components/animations/full_rotation.tsx
@@ -0,0 +1,24 @@
+import { keyframes, styled } from '../../style/theme';
+
+interface FullRotationProps {
+ height: string;
+ width: string;
+}
+const rotatingKeyframes = keyframes`
+from {
+ transform: rotate(0deg);
+}
+
+to {
+ transform: rotate(360deg);
+}
+`;
+
+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
new file mode 100644
index 000000000..8b3b294b7
--- /dev/null
+++ b/packages/instant/src/components/animations/position_animation.tsx
@@ -0,0 +1,110 @@
+import { InterpolationValue } from 'styled-components';
+
+import { media, OptionallyScreenSpecific, stylesForMedia } from '../../style/media';
+import { css, keyframes, styled } from '../../style/theme';
+
+export interface TransitionInfo {
+ from: string;
+ to: string;
+}
+
+const generateTransitionInfoCss = (
+ key: keyof TransitionInfo,
+ top?: TransitionInfo,
+ bottom?: TransitionInfo,
+ left?: TransitionInfo,
+ right?: TransitionInfo,
+): string => {
+ const topStringIfExists = top ? `top: ${top[key]};` : '';
+ const bottomStringIfExists = bottom ? `bottom: ${bottom[key]};` : '';
+ const leftStringIfExists = left ? `left: ${left[key]};` : '';
+ const rightStringIfExists = right ? `right: ${right[key]};` : '';
+ return `
+ ${topStringIfExists}
+ ${bottomStringIfExists}
+ ${leftStringIfExists}
+ ${rightStringIfExists}
+ `;
+};
+
+const slideKeyframeGenerator = (
+ position: string,
+ top?: TransitionInfo,
+ bottom?: TransitionInfo,
+ left?: TransitionInfo,
+ right?: TransitionInfo,
+) => keyframes`
+ from {
+ position: ${position};
+ ${generateTransitionInfoCss('from', top, bottom, left, right)}
+ }
+
+ to {
+ position: ${position};
+ ${generateTransitionInfoCss('to', top, bottom, left, right)}
+ }
+`;
+
+export interface PositionAnimationSettings {
+ top?: TransitionInfo;
+ bottom?: TransitionInfo;
+ left?: TransitionInfo;
+ right?: TransitionInfo;
+ timingFunction: string;
+ duration?: string;
+ position?: string;
+}
+
+const generatePositionAnimationCss = (positionSettings: PositionAnimationSettings) => {
+ return css`
+ animation-name: ${slideKeyframeGenerator(
+ positionSettings.position || 'relative',
+ positionSettings.top,
+ positionSettings.bottom,
+ positionSettings.left,
+ positionSettings.right,
+ )};
+ animation-duration: ${positionSettings.duration || '0.3s'};
+ animation-timing-function: ${positionSettings.timingFunction};
+ animation-delay: 0s;
+ animation-iteration-count: 1;
+ animation-fill-mode: forwards;
+ position: ${positionSettings.position || 'relative'};
+ width: 100%;
+ `;
+};
+
+export interface PositionAnimationProps {
+ positionSettings: OptionallyScreenSpecific<PositionAnimationSettings>;
+ zIndex?: OptionallyScreenSpecific<number>;
+ height?: string;
+}
+
+const defaultAnimation = (positionSettings: OptionallyScreenSpecific<PositionAnimationSettings>) => {
+ const bestDefault = 'default' in positionSettings ? positionSettings.default : positionSettings;
+ return generatePositionAnimationCss(bestDefault);
+};
+const animationForSize = (
+ positionSettings: OptionallyScreenSpecific<PositionAnimationSettings>,
+ sizeKey: 'sm' | 'md' | 'lg',
+ mediaFn: (...args: any[]) => InterpolationValue[],
+) => {
+ // checking default makes sure we have a PositionAnimationSettings object
+ // and then we check to see if we have a setting for the specific `sizeKey`
+ const animationSettingsForSize = 'default' in positionSettings && positionSettings[sizeKey];
+ return animationSettingsForSize && mediaFn`${generatePositionAnimationCss(animationSettingsForSize)}`;
+};
+
+export const PositionAnimation =
+ styled.div <
+ PositionAnimationProps >
+ `
+ && {
+ ${props => props.zIndex && stylesForMedia<number>('z-index', props.zIndex)}
+ ${props => defaultAnimation(props.positionSettings)}
+ ${props => animationForSize(props.positionSettings, 'sm', media.small)}
+ ${props => animationForSize(props.positionSettings, 'md', media.medium)}
+ ${props => animationForSize(props.positionSettings, 'lg', media.large)}
+ ${props => (props.height ? `height: ${props.height};` : '')}
+ }
+`;
diff --git a/packages/instant/src/components/animations/pulse.tsx b/packages/instant/src/components/animations/pulse.tsx
new file mode 100644
index 000000000..01d6ea070
--- /dev/null
+++ b/packages/instant/src/components/animations/pulse.tsx
@@ -0,0 +1,15 @@
+import { keyframes, styled } from '../../style/theme';
+
+const pulsingKeyframes = keyframes`
+ 0%, 100% {
+ opacity: 0.2;
+ }
+ 50% {
+ opacity: 100;
+ }
+`;
+export const Pulse = styled.div`
+ animation-name: ${pulsingKeyframes}
+ animation-duration: 2s;
+ animation-iteration-count: infinite;
+`;
diff --git a/packages/instant/src/components/animations/slide_animation.tsx b/packages/instant/src/components/animations/slide_animation.tsx
new file mode 100644
index 000000000..9adb1c674
--- /dev/null
+++ b/packages/instant/src/components/animations/slide_animation.tsx
@@ -0,0 +1,26 @@
+import * as React from 'react';
+
+import { OptionallyScreenSpecific } from '../../style/media';
+
+import { PositionAnimation, PositionAnimationSettings } from './position_animation';
+
+export type SlideAnimationState = 'slidIn' | 'slidOut' | 'none';
+export interface SlideAnimationProps {
+ animationState: SlideAnimationState;
+ slideInSettings: OptionallyScreenSpecific<PositionAnimationSettings>;
+ slideOutSettings: OptionallyScreenSpecific<PositionAnimationSettings>;
+ zIndex?: OptionallyScreenSpecific<number>;
+ height?: string;
+}
+
+export const SlideAnimation: React.StatelessComponent<SlideAnimationProps> = props => {
+ if (props.animationState === 'none') {
+ return <React.Fragment>{props.children}</React.Fragment>;
+ }
+ const positionSettings = props.animationState === 'slidIn' ? props.slideInSettings : props.slideOutSettings;
+ return (
+ <PositionAnimation height={props.height} positionSettings={positionSettings} zIndex={props.zIndex}>
+ {props.children}
+ </PositionAnimation>
+ );
+};
diff --git a/packages/instant/src/components/buy_button.tsx b/packages/instant/src/components/buy_button.tsx
index 5a32b9575..877ab275c 100644
--- a/packages/instant/src/components/buy_button.tsx
+++ b/packages/instant/src/components/buy_button.tsx
@@ -1,19 +1,101 @@
+import { AssetBuyer, AssetBuyerError, BuyQuote } from '@0x/asset-buyer';
+import { BigNumber } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
+import * as _ from 'lodash';
import * as React from 'react';
+import { oc } from 'ts-optchain';
+import { WEB_3_WRAPPER_TRANSACTION_FAILED_ERROR_MSG_PREFIX } from '../constants';
import { ColorOption } from '../style/theme';
+import { AffiliateInfo, ZeroExInstantError } from '../types';
+import { gasPriceEstimator } from '../util/gas_price_estimator';
+import { util } from '../util/util';
-import { Button, Container, Text } from './ui';
+import { Button } from './ui/button';
-export interface BuyButtonProps {}
+export interface BuyButtonProps {
+ accountAddress?: string;
+ accountEthBalanceInWei?: BigNumber;
+ buyQuote?: BuyQuote;
+ assetBuyer: AssetBuyer;
+ web3Wrapper: Web3Wrapper;
+ affiliateInfo?: AffiliateInfo;
+ onValidationPending: (buyQuote: BuyQuote) => void;
+ onValidationFail: (buyQuote: BuyQuote, errorMessage: AssetBuyerError | ZeroExInstantError) => void;
+ onSignatureDenied: (buyQuote: BuyQuote) => void;
+ onBuyProcessing: (buyQuote: BuyQuote, txHash: string, startTimeUnix: number, expectedEndTimeUnix: number) => void;
+ onBuySuccess: (buyQuote: BuyQuote, txHash: string) => void;
+ onBuyFailure: (buyQuote: BuyQuote, txHash: string) => void;
+}
-export const BuyButton: React.StatelessComponent<BuyButtonProps> = props => (
- <Container padding="20px" width="100%">
- <Button width="100%">
- <Text fontColor={ColorOption.white} fontWeight={600} fontSize="20px">
+export class BuyButton extends React.Component<BuyButtonProps> {
+ public static defaultProps = {
+ onClick: util.boundNoop,
+ onBuySuccess: util.boundNoop,
+ onBuyFailure: util.boundNoop,
+ };
+ public render(): React.ReactNode {
+ const { buyQuote, accountAddress } = this.props;
+ const shouldDisableButton = _.isUndefined(buyQuote) || _.isUndefined(accountAddress);
+ return (
+ <Button
+ width="100%"
+ onClick={this._handleClick}
+ isDisabled={shouldDisableButton}
+ fontColor={ColorOption.white}
+ fontSize="20px"
+ >
Buy
- </Text>
- </Button>
- </Container>
-);
-
-BuyButton.displayName = 'BuyButton';
+ </Button>
+ );
+ }
+ private readonly _handleClick = async () => {
+ // The button is disabled when there is no buy quote anyway.
+ const { buyQuote, assetBuyer, affiliateInfo, accountAddress, accountEthBalanceInWei, web3Wrapper } = this.props;
+ if (_.isUndefined(buyQuote) || _.isUndefined(accountAddress)) {
+ return;
+ }
+ this.props.onValidationPending(buyQuote);
+ const ethNeededForBuy = buyQuote.worstCaseQuoteInfo.totalEthAmount;
+ // if we don't have a balance for the user, let the transaction through, it will be handled by the wallet
+ const hasSufficientEth = _.isUndefined(accountEthBalanceInWei) || accountEthBalanceInWei.gte(ethNeededForBuy);
+ if (!hasSufficientEth) {
+ this.props.onValidationFail(buyQuote, ZeroExInstantError.InsufficientETH);
+ return;
+ }
+ let txHash: string | undefined;
+ const gasInfo = await gasPriceEstimator.getGasInfoAsync();
+ const feeRecipient = oc(affiliateInfo).feeRecipient();
+ try {
+ txHash = await assetBuyer.executeBuyQuoteAsync(buyQuote, {
+ feeRecipient,
+ takerAddress: accountAddress,
+ gasPrice: gasInfo.gasPriceInWei,
+ });
+ } catch (e) {
+ if (e instanceof Error) {
+ if (e.message === AssetBuyerError.SignatureRequestDenied) {
+ this.props.onSignatureDenied(buyQuote);
+ return;
+ } else if (e.message === AssetBuyerError.TransactionValueTooLow) {
+ this.props.onValidationFail(buyQuote, AssetBuyerError.TransactionValueTooLow);
+ return;
+ }
+ }
+ throw e;
+ }
+ const startTimeUnix = new Date().getTime();
+ const expectedEndTimeUnix = startTimeUnix + gasInfo.estimatedTimeMs;
+ this.props.onBuyProcessing(buyQuote, txHash, startTimeUnix, expectedEndTimeUnix);
+ try {
+ await web3Wrapper.awaitTransactionSuccessAsync(txHash);
+ } catch (e) {
+ if (e instanceof Error && e.message.startsWith(WEB_3_WRAPPER_TRANSACTION_FAILED_ERROR_MSG_PREFIX)) {
+ this.props.onBuyFailure(buyQuote, txHash);
+ return;
+ }
+ throw e;
+ }
+ this.props.onBuySuccess(buyQuote, txHash);
+ };
+}
diff --git a/packages/instant/src/components/buy_order_progress.tsx b/packages/instant/src/components/buy_order_progress.tsx
new file mode 100644
index 000000000..bc7319423
--- /dev/null
+++ b/packages/instant/src/components/buy_order_progress.tsx
@@ -0,0 +1,35 @@
+import * as React from 'react';
+
+import { TimedProgressBar } from '../components/timed_progress_bar';
+
+import { TimeCounter } from '../components/time_counter';
+import { Container } from '../components/ui/container';
+import { OrderProcessState, OrderState } from '../types';
+
+export interface BuyOrderProgressProps {
+ buyOrderState: OrderState;
+}
+
+export const BuyOrderProgress: React.StatelessComponent<BuyOrderProgressProps> = props => {
+ const { buyOrderState } = props;
+
+ if (
+ buyOrderState.processState === OrderProcessState.Processing ||
+ buyOrderState.processState === OrderProcessState.Success ||
+ buyOrderState.processState === OrderProcessState.Failure
+ ) {
+ const progress = buyOrderState.progress;
+ const hasEnded = buyOrderState.processState !== OrderProcessState.Processing;
+ const expectedTimeMs = progress.expectedEndTimeUnix - progress.startTimeUnix;
+ return (
+ <Container padding="20px 20px 0px 20px" width="100%">
+ <Container marginBottom="5px">
+ <TimeCounter estimatedTimeMs={expectedTimeMs} hasEnded={hasEnded} key={progress.startTimeUnix} />
+ </Container>
+ <TimedProgressBar expectedTimeMs={expectedTimeMs} hasEnded={hasEnded} key={progress.startTimeUnix} />
+ </Container>
+ );
+ }
+
+ return null;
+};
diff --git a/packages/instant/src/components/buy_order_state_buttons.tsx b/packages/instant/src/components/buy_order_state_buttons.tsx
new file mode 100644
index 000000000..6041bf4f5
--- /dev/null
+++ b/packages/instant/src/components/buy_order_state_buttons.tsx
@@ -0,0 +1,71 @@
+import { AssetBuyer, AssetBuyerError, BuyQuote } from '@0x/asset-buyer';
+import { BigNumber } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
+import * as React from 'react';
+
+import { ColorOption } from '../style/theme';
+import { AffiliateInfo, OrderProcessState, ZeroExInstantError } from '../types';
+
+import { BuyButton } from './buy_button';
+import { PlacingOrderButton } from './placing_order_button';
+import { SecondaryButton } from './secondary_button';
+
+import { Button } from './ui/button';
+import { Flex } from './ui/flex';
+
+export interface BuyOrderStateButtonProps {
+ accountAddress?: string;
+ accountEthBalanceInWei?: BigNumber;
+ buyQuote?: BuyQuote;
+ buyOrderProcessingState: OrderProcessState;
+ assetBuyer: AssetBuyer;
+ web3Wrapper: Web3Wrapper;
+ affiliateInfo?: AffiliateInfo;
+ onViewTransaction: () => void;
+ onValidationPending: (buyQuote: BuyQuote) => void;
+ onValidationFail: (buyQuote: BuyQuote, errorMessage: AssetBuyerError | ZeroExInstantError) => void;
+ onSignatureDenied: (buyQuote: BuyQuote) => void;
+ onBuyProcessing: (buyQuote: BuyQuote, txHash: string, startTimeUnix: number, expectedEndTimeUnix: number) => void;
+ onBuySuccess: (buyQuote: BuyQuote, txHash: string) => void;
+ onBuyFailure: (buyQuote: BuyQuote, txHash: string) => void;
+ onRetry: () => void;
+}
+
+export const BuyOrderStateButtons: React.StatelessComponent<BuyOrderStateButtonProps> = props => {
+ if (props.buyOrderProcessingState === OrderProcessState.Failure) {
+ return (
+ <Flex justify="space-between">
+ <Button width="48%" onClick={props.onRetry} fontColor={ColorOption.white} fontSize="16px">
+ Back
+ </Button>
+ <SecondaryButton width="48%" onClick={props.onViewTransaction}>
+ Details
+ </SecondaryButton>
+ </Flex>
+ );
+ } else if (
+ props.buyOrderProcessingState === OrderProcessState.Success ||
+ props.buyOrderProcessingState === OrderProcessState.Processing
+ ) {
+ return <SecondaryButton onClick={props.onViewTransaction}>View Transaction</SecondaryButton>;
+ } else if (props.buyOrderProcessingState === OrderProcessState.Validating) {
+ return <PlacingOrderButton />;
+ }
+
+ return (
+ <BuyButton
+ accountAddress={props.accountAddress}
+ accountEthBalanceInWei={props.accountEthBalanceInWei}
+ buyQuote={props.buyQuote}
+ assetBuyer={props.assetBuyer}
+ web3Wrapper={props.web3Wrapper}
+ affiliateInfo={props.affiliateInfo}
+ onValidationPending={props.onValidationPending}
+ onValidationFail={props.onValidationFail}
+ onSignatureDenied={props.onSignatureDenied}
+ onBuyProcessing={props.onBuyProcessing}
+ onBuySuccess={props.onBuySuccess}
+ onBuyFailure={props.onBuyFailure}
+ />
+ );
+};
diff --git a/packages/instant/src/components/css_reset.tsx b/packages/instant/src/components/css_reset.tsx
new file mode 100644
index 000000000..0bef85389
--- /dev/null
+++ b/packages/instant/src/components/css_reset.tsx
@@ -0,0 +1,32 @@
+import { INJECTED_DIV_CLASS } from '../constants';
+import { createGlobalStyle } from '../style/theme';
+
+export interface CSSResetProps {}
+
+/*
+* 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,
+ canvas, caption, cite, code, col, colgroup, command, datalist, dd, del,
+ details, dialog, dfn, div, dl, dt, em, embed, fieldset, figure, form,
+ h1, h2, h3, h4, h5, h6, head, header, hgroup, hr, html, i, iframe, img,
+ input, ins, keygen, kbd, label, legend, li, map, mark, menu, meter, nav,
+ noscript, object, ol, optgroup, option, output, p, param, pre, progress,
+ q, rp, rt, ruby, samp, section, select, small, span, strong, sub, sup,
+ table, tbody, td, textarea, tfoot, th, thead, time, tr, ul, var, video {
+ background: transparent;
+ border: 0;
+ font-size: 100%;
+ font: inherit;
+ margin: 0;
+ outline: none;
+ padding: 0;
+ text-align: left;
+ text-decoration: none;
+ vertical-align: baseline;
+ }
+ }
+`;
diff --git a/packages/instant/src/components/erc20_asset_amount_input.tsx b/packages/instant/src/components/erc20_asset_amount_input.tsx
new file mode 100644
index 000000000..520ac33d5
--- /dev/null
+++ b/packages/instant/src/components/erc20_asset_amount_input.tsx
@@ -0,0 +1,161 @@
+import { BigNumber } from '@0x/utils';
+import * as _ from 'lodash';
+import * as React from 'react';
+
+import { ColorOption, transparentWhite } from '../style/theme';
+import { ERC20Asset, SimpleHandler } from '../types';
+import { assetUtils } from '../util/asset';
+import { util } from '../util/util';
+
+import { ScalingAmountInput } from './scaling_amount_input';
+
+import { Container } from './ui/container';
+import { Flex } from './ui/flex';
+import { Icon } from './ui/icon';
+import { Text } from './ui/text';
+
+// Asset amounts only apply to ERC20 assets
+export interface ERC20AssetAmountInputProps {
+ asset?: ERC20Asset;
+ value?: BigNumber;
+ onChange: (value?: BigNumber, asset?: ERC20Asset) => void;
+ onSelectAssetClick?: (asset?: ERC20Asset) => void;
+ startingFontSizePx: number;
+ fontColor?: ColorOption;
+ isDisabled: boolean;
+ numberOfAssetsAvailable?: number;
+}
+
+export interface ERC20AssetAmountInputState {
+ currentFontSizePx: number;
+}
+
+export class ERC20AssetAmountInput extends React.Component<ERC20AssetAmountInputProps, ERC20AssetAmountInputState> {
+ public static defaultProps = {
+ onChange: util.boundNoop,
+ isDisabled: false,
+ };
+ constructor(props: ERC20AssetAmountInputProps) {
+ super(props);
+ this.state = {
+ currentFontSizePx: props.startingFontSizePx,
+ };
+ }
+ public render(): React.ReactNode {
+ const { asset } = this.props;
+ return (
+ <Container whiteSpace="nowrap">
+ {_.isUndefined(asset) ? this._renderTokenSelectionContent() : this._renderContentForAsset(asset)}
+ </Container>
+ );
+ }
+ private readonly _renderContentForAsset = (asset: ERC20Asset): React.ReactNode => {
+ const { onChange, ...rest } = this.props;
+ const amountBorderBottom = this.props.isDisabled ? '' : `1px solid ${transparentWhite}`;
+ const onSymbolClick = this._generateSelectAssetClickHandler();
+ return (
+ <React.Fragment>
+ <Container borderBottom={amountBorderBottom} display="inline-block">
+ <ScalingAmountInput
+ {...rest}
+ textLengthThreshold={this._textLengthThresholdForAsset(asset)}
+ maxFontSizePx={this.props.startingFontSizePx}
+ onAmountChange={this._handleChange}
+ onFontSizeChange={this._handleFontSizeChange}
+ />
+ </Container>
+ <Container
+ display="inline-block"
+ marginLeft="8px"
+ title={assetUtils.bestNameForAsset(asset, undefined)}
+ >
+ <Flex inline={true}>
+ <Text
+ fontSize={`${this.state.currentFontSizePx}px`}
+ fontColor={ColorOption.white}
+ textTransform="uppercase"
+ onClick={onSymbolClick}
+ >
+ {assetUtils.formattedSymbolForAsset(asset)}
+ </Text>
+ {this._renderChevronIcon()}
+ </Flex>
+ </Container>
+ </React.Fragment>
+ );
+ };
+ private readonly _renderTokenSelectionContent = (): React.ReactNode => {
+ const { numberOfAssetsAvailable } = this.props;
+ let text = 'Select Token';
+ if (_.isUndefined(numberOfAssetsAvailable)) {
+ text = 'Loading...';
+ } else if (numberOfAssetsAvailable === 0) {
+ text = 'Assets Unavailable';
+ }
+ return (
+ <Flex>
+ <Text
+ fontSize="30px"
+ fontColor={ColorOption.white}
+ opacity={0.7}
+ fontWeight="500"
+ onClick={this._generateSelectAssetClickHandler()}
+ >
+ {text}
+ </Text>
+ {this._renderChevronIcon()}
+ </Flex>
+ );
+ };
+ private readonly _renderChevronIcon = (): React.ReactNode => {
+ if (!this._areMultipleAssetsAvailable()) {
+ return null;
+ }
+ return (
+ <Container marginLeft="5px">
+ <Icon icon="chevron" width={12} stroke={ColorOption.white} onClick={this._handleSelectAssetClick} />
+ </Container>
+ );
+ };
+ private readonly _handleChange = (value?: BigNumber): void => {
+ this.props.onChange(value, this.props.asset);
+ };
+ private readonly _handleFontSizeChange = (fontSizePx: number): void => {
+ this.setState({
+ currentFontSizePx: fontSizePx,
+ });
+ };
+ private readonly _generateSelectAssetClickHandler = (): SimpleHandler | undefined => {
+ // We don't want to allow opening the token selection panel if there are no assets.
+ // Since styles are inferred from the presence of a click handler, we want to return undefined
+ // instead of providing a noop.
+ if (!this._areMultipleAssetsAvailable() || _.isUndefined(this.props.onSelectAssetClick)) {
+ return undefined;
+ }
+ return this._handleSelectAssetClick;
+ };
+ private readonly _areMultipleAssetsAvailable = (): boolean => {
+ const { numberOfAssetsAvailable } = this.props;
+ return !_.isUndefined(numberOfAssetsAvailable) && numberOfAssetsAvailable > 1;
+ };
+ private readonly _handleSelectAssetClick = (): void => {
+ if (this.props.onSelectAssetClick) {
+ this.props.onSelectAssetClick();
+ }
+ };
+ // For assets with symbols of different length,
+ // start scaling the input at different character lengths
+ private readonly _textLengthThresholdForAsset = (asset?: ERC20Asset): number => {
+ if (_.isUndefined(asset)) {
+ return 3;
+ }
+ const symbol = asset.metaData.symbol;
+ if (symbol.length <= 3) {
+ return 5;
+ }
+ if (symbol.length === 5) {
+ return 3;
+ }
+ return 4;
+ };
+}
diff --git a/packages/instant/src/components/erc20_token_selector.tsx b/packages/instant/src/components/erc20_token_selector.tsx
new file mode 100644
index 000000000..3503ff31a
--- /dev/null
+++ b/packages/instant/src/components/erc20_token_selector.tsx
@@ -0,0 +1,111 @@
+import * as _ from 'lodash';
+import * as React from 'react';
+
+import { ColorOption } from '../style/theme';
+import { ERC20Asset } from '../types';
+import { assetUtils } from '../util/asset';
+
+import { SearchInput } from './search_input';
+
+import { Circle } from './ui/circle';
+import { Container } from './ui/container';
+import { Flex } from './ui/flex';
+import { Text } from './ui/text';
+
+export interface ERC20TokenSelectorProps {
+ tokens: ERC20Asset[];
+ onTokenSelect: (token: ERC20Asset) => void;
+}
+
+export interface ERC20TokenSelectorState {
+ searchQuery?: string;
+}
+
+export class ERC20TokenSelector extends React.Component<ERC20TokenSelectorProps> {
+ public state: ERC20TokenSelectorState = {
+ searchQuery: undefined,
+ };
+ public render(): React.ReactNode {
+ const { tokens, onTokenSelect } = this.props;
+ return (
+ <Container height="100%">
+ <SearchInput
+ placeholder="Search tokens..."
+ width="100%"
+ value={this.state.searchQuery}
+ onChange={this._handleSearchInputChange}
+ />
+ <Container overflow="scroll" height="calc(100% - 80px)" marginTop="10px">
+ {_.map(tokens, token => {
+ if (!this._isTokenQueryMatch(token)) {
+ return null;
+ }
+ return <TokenSelectorRow key={token.assetData} token={token} onClick={onTokenSelect} />;
+ })}
+ </Container>
+ </Container>
+ );
+ }
+ private readonly _handleSearchInputChange = (event: React.ChangeEvent<HTMLInputElement>): void => {
+ const searchQuery = event.target.value;
+ this.setState({
+ searchQuery,
+ });
+ };
+ private readonly _isTokenQueryMatch = (token: ERC20Asset): boolean => {
+ const { searchQuery } = this.state;
+ if (_.isUndefined(searchQuery)) {
+ return true;
+ }
+ const stringToSearch = `${token.metaData.name} ${token.metaData.symbol}`;
+ return _.includes(stringToSearch.toLowerCase(), searchQuery.toLowerCase());
+ };
+}
+
+interface TokenSelectorRowProps {
+ token: ERC20Asset;
+ onClick: (token: ERC20Asset) => void;
+}
+
+class TokenSelectorRow extends React.Component<TokenSelectorRowProps> {
+ public render(): React.ReactNode {
+ const { token } = this.props;
+ const displaySymbol = assetUtils.bestNameForAsset(token);
+ return (
+ <Container
+ padding="12px 0px"
+ borderBottom="1px solid"
+ borderColor={ColorOption.feintGrey}
+ backgroundColor={ColorOption.white}
+ width="100%"
+ onClick={this._handleClick}
+ darkenOnHover={true}
+ cursor="pointer"
+ >
+ <Container marginLeft="5px">
+ <Flex justify="flex-start">
+ <Container marginRight="10px">
+ <Circle diameter={30} rawColor={token.metaData.primaryColor}>
+ <Flex height="100%">
+ <Text fontColor={ColorOption.white} fontSize="8px">
+ {displaySymbol}
+ </Text>
+ </Flex>
+ </Circle>
+ </Container>
+ <Text fontSize="14px" fontWeight={700} fontColor={ColorOption.black}>
+ {displaySymbol}
+ </Text>
+ <Container margin="0px 5px">
+ <Text fontSize="14px"> - </Text>
+ </Container>
+ <Text fontSize="14px">{token.metaData.name}</Text>
+ </Flex>
+ </Container>
+ </Container>
+ );
+ }
+ private readonly _handleClick = (): void => {
+ this.props.onClick(this.props.token);
+ };
+}
diff --git a/packages/instant/src/components/instant_heading.tsx b/packages/instant/src/components/instant_heading.tsx
index be0414b8d..b07776b2c 100644
--- a/packages/instant/src/components/instant_heading.tsx
+++ b/packages/instant/src/components/instant_heading.tsx
@@ -1,45 +1,137 @@
+import { BigNumber } from '@0x/utils';
+import * as _ from 'lodash';
import * as React from 'react';
-import { SelectedAssetAmountInput } from '../containers/selected_asset_amount_input';
+import { SelectedERC20AssetAmountInput } from '../containers/selected_erc20_asset_amount_input';
import { ColorOption } from '../style/theme';
+import { AsyncProcessState, ERC20Asset, OrderProcessState, OrderState } from '../types';
+import { format } from '../util/format';
-import { Container, Flex, Text } from './ui';
+import { AmountPlaceholder } from './amount_placeholder';
+import { Container } from './ui/container';
+import { Flex } from './ui/flex';
+import { Icon } from './ui/icon';
+import { Spinner } from './ui/spinner';
+import { Text } from './ui/text';
-export interface InstantHeadingProps {}
+export interface InstantHeadingProps {
+ selectedAssetAmount?: BigNumber;
+ totalEthBaseAmount?: BigNumber;
+ ethUsdPrice?: BigNumber;
+ quoteRequestState: AsyncProcessState;
+ buyOrderState: OrderState;
+ onSelectAssetClick?: (asset?: ERC20Asset) => void;
+}
-export const InstantHeading: React.StatelessComponent<InstantHeadingProps> = props => (
- <Container backgroundColor={ColorOption.primaryColor} padding="20px" width="100%" borderRadius="3px 3px 0px 0px">
- <Container marginBottom="5px">
- <Text
- letterSpacing="1px"
- fontColor={ColorOption.white}
- opacity={0.7}
- fontWeight={500}
- textTransform="uppercase"
- fontSize="12px"
+const PLACEHOLDER_COLOR = ColorOption.white;
+const ICON_WIDTH = 34;
+const ICON_HEIGHT = 34;
+const ICON_COLOR = ColorOption.white;
+
+export class InstantHeading extends React.Component<InstantHeadingProps, {}> {
+ public render(): React.ReactNode {
+ const iconOrAmounts = this._renderIcon() || this._renderAmountsSection();
+ return (
+ <Container
+ backgroundColor={ColorOption.primaryColor}
+ padding="20px"
+ width="100%"
+ borderRadius="3px 3px 0px 0px"
>
- I want to buy
- </Text>
- </Container>
- <Flex direction="row" justify="space-between">
- <Container>
- <SelectedAssetAmountInput fontSize="45px" />
- <Container display="inline-block" marginLeft="10px">
- <Text fontSize="45px" fontColor={ColorOption.white} textTransform="uppercase">
- rep
- </Text>
- </Container>
- </Container>
- <Flex direction="column" justify="space-between">
<Container marginBottom="5px">
- <Text fontSize="16px" fontColor={ColorOption.white} fontWeight={500}>
- 0 ETH
+ <Text
+ letterSpacing="1px"
+ fontColor={ColorOption.white}
+ opacity={0.7}
+ fontWeight={500}
+ textTransform="uppercase"
+ fontSize="12px"
+ >
+ {this._renderTopText()}
</Text>
</Container>
- <Text fontSize="16px" fontColor={ColorOption.white} opacity={0.7}>
- $0.00
- </Text>
- </Flex>
- </Flex>
- </Container>
-);
+ <Flex direction="row" justify="space-between">
+ <Flex height="60px">
+ <SelectedERC20AssetAmountInput
+ startingFontSizePx={38}
+ onSelectAssetClick={this.props.onSelectAssetClick}
+ />
+ </Flex>
+ <Flex direction="column" justify="space-between">
+ {iconOrAmounts}
+ </Flex>
+ </Flex>
+ </Container>
+ );
+ }
+
+ private _renderAmountsSection(): React.ReactNode {
+ return (
+ <Container>
+ <Container marginBottom="5px">{this._renderPlaceholderOrAmount(this._renderEthAmount)}</Container>
+ <Container opacity={0.7}>{this._renderPlaceholderOrAmount(this._renderDollarAmount)}</Container>
+ </Container>
+ );
+ }
+
+ private _renderIcon(): React.ReactNode {
+ const processState = this.props.buyOrderState.processState;
+
+ if (processState === OrderProcessState.Failure) {
+ return <Icon icon="failed" width={ICON_WIDTH} height={ICON_HEIGHT} color={ICON_COLOR} />;
+ } else if (processState === OrderProcessState.Processing) {
+ return <Spinner widthPx={ICON_HEIGHT} heightPx={ICON_HEIGHT} />;
+ } else if (processState === OrderProcessState.Success) {
+ return <Icon icon="success" width={ICON_WIDTH} height={ICON_HEIGHT} color={ICON_COLOR} />;
+ }
+ return undefined;
+ }
+
+ private _renderTopText(): React.ReactNode {
+ const processState = this.props.buyOrderState.processState;
+ if (processState === OrderProcessState.Failure) {
+ return 'Order failed';
+ } else if (processState === OrderProcessState.Processing) {
+ return 'Processing Order...';
+ } else if (processState === OrderProcessState.Success) {
+ return 'Tokens received!';
+ }
+
+ return 'I want to buy';
+ }
+
+ private _renderPlaceholderOrAmount(amountFunction: () => React.ReactNode): React.ReactNode {
+ if (this.props.quoteRequestState === AsyncProcessState.Pending) {
+ return <AmountPlaceholder isPulsating={true} color={PLACEHOLDER_COLOR} />;
+ }
+ if (_.isUndefined(this.props.selectedAssetAmount)) {
+ return <AmountPlaceholder isPulsating={false} color={PLACEHOLDER_COLOR} />;
+ }
+ return amountFunction();
+ }
+
+ private readonly _renderEthAmount = (): React.ReactNode => {
+ return (
+ <Text fontSize="16px" fontColor={ColorOption.white} fontWeight={500}>
+ {format.ethBaseAmount(
+ this.props.totalEthBaseAmount,
+ 4,
+ <AmountPlaceholder isPulsating={false} color={PLACEHOLDER_COLOR} />,
+ )}
+ </Text>
+ );
+ };
+
+ private readonly _renderDollarAmount = (): React.ReactNode => {
+ return (
+ <Text fontSize="16px" fontColor={ColorOption.white}>
+ {format.ethBaseAmountInUsd(
+ this.props.totalEthBaseAmount,
+ this.props.ethUsdPrice,
+ 2,
+ <AmountPlaceholder isPulsating={false} color={ColorOption.white} />,
+ )}
+ </Text>
+ );
+ };
+}
diff --git a/packages/instant/src/components/order_details.tsx b/packages/instant/src/components/order_details.tsx
index dbf2c1f0b..9abd7137e 100644
--- a/packages/instant/src/components/order_details.tsx
+++ b/packages/instant/src/components/order_details.tsx
@@ -1,62 +1,118 @@
+import { BuyQuoteInfo } from '@0x/asset-buyer';
+import { BigNumber } from '@0x/utils';
+import * as _ from 'lodash';
import * as React from 'react';
+import { oc } from 'ts-optchain';
import { ColorOption } from '../style/theme';
+import { format } from '../util/format';
-import { Container, Flex, Text } from './ui';
+import { AmountPlaceholder } from './amount_placeholder';
-export interface OrderDetailsProps {}
+import { Container } from './ui/container';
+import { Flex } from './ui/flex';
+import { Text } from './ui/text';
-export const OrderDetails: React.StatelessComponent<OrderDetailsProps> = props => (
- <Container padding="20px" width="100%">
- <Container marginBottom="10px">
- <Text
- letterSpacing="1px"
- fontColor={ColorOption.primaryColor}
- fontWeight={600}
- textTransform="uppercase"
- fontSize="14px"
- >
- Order Details
- </Text>
- </Container>
- <OrderDetailsRow name="Token Price" primaryValue=".013 ETH" secondaryValue="$24.32" />
- <OrderDetailsRow name="Fee" primaryValue=".005 ETH" secondaryValue="$1.04" />
- <OrderDetailsRow name="Total Cost" primaryValue="1.66 ETH" secondaryValue="$589.56" shouldEmphasize={true} />
- </Container>
-);
-
-OrderDetails.displayName = 'OrderDetails';
+export interface OrderDetailsProps {
+ buyQuoteInfo?: BuyQuoteInfo;
+ ethUsdPrice?: BigNumber;
+ isLoading: boolean;
+}
+export class OrderDetails extends React.Component<OrderDetailsProps> {
+ public render(): React.ReactNode {
+ const { buyQuoteInfo, ethUsdPrice } = this.props;
+ const buyQuoteAccessor = oc(buyQuoteInfo);
+ const ethAssetPrice = buyQuoteAccessor.ethPerAssetPrice();
+ const ethTokenFee = buyQuoteAccessor.feeEthAmount();
+ const totalEthAmount = buyQuoteAccessor.totalEthAmount();
+ return (
+ <Container padding="20px" width="100%" flexGrow={1}>
+ <Container marginBottom="10px">
+ <Text
+ letterSpacing="1px"
+ fontColor={ColorOption.primaryColor}
+ fontWeight={600}
+ textTransform="uppercase"
+ fontSize="14px"
+ >
+ Order Details
+ </Text>
+ </Container>
+ <EthAmountRow
+ rowLabel="Token Price"
+ ethAmount={ethAssetPrice}
+ ethUsdPrice={ethUsdPrice}
+ isEthAmountInBaseUnits={false}
+ isLoading={this.props.isLoading}
+ />
+ <EthAmountRow
+ rowLabel="Fee"
+ ethAmount={ethTokenFee}
+ ethUsdPrice={ethUsdPrice}
+ isLoading={this.props.isLoading}
+ />
+ <EthAmountRow
+ rowLabel="Total Cost"
+ ethAmount={totalEthAmount}
+ ethUsdPrice={ethUsdPrice}
+ shouldEmphasize={true}
+ isLoading={this.props.isLoading}
+ />
+ </Container>
+ );
+ }
+}
-export interface OrderDetailsRowProps {
- name: string;
- primaryValue: string;
- secondaryValue: string;
+export interface EthAmountRowProps {
+ rowLabel: string;
+ ethAmount?: BigNumber;
+ isEthAmountInBaseUnits?: boolean;
+ ethUsdPrice?: BigNumber;
shouldEmphasize?: boolean;
+ isLoading: boolean;
}
-export const OrderDetailsRow: React.StatelessComponent<OrderDetailsRowProps> = props => {
- const fontWeight = props.shouldEmphasize ? 700 : 400;
- return (
- <Container padding="10px 0px" borderTop="1px dashed" borderColor={ColorOption.feintGrey}>
- <Flex justify="space-between">
- <Text fontWeight={fontWeight} fontColor={ColorOption.grey}>
- {props.name}
- </Text>
- <Container>
- <Container marginRight="3px" display="inline-block">
- <Text fontColor={ColorOption.lightGrey}>({props.secondaryValue}) </Text>
- </Container>
+export class EthAmountRow extends React.Component<EthAmountRowProps> {
+ public static defaultProps = {
+ shouldEmphasize: false,
+ isEthAmountInBaseUnits: true,
+ };
+ public render(): React.ReactNode {
+ const { rowLabel, ethAmount, isEthAmountInBaseUnits, shouldEmphasize, isLoading } = this.props;
+
+ const fontWeight = shouldEmphasize ? 700 : 400;
+ const ethFormatter = isEthAmountInBaseUnits ? format.ethBaseAmount : format.ethUnitAmount;
+ return (
+ <Container padding="10px 0px" borderTop="1px dashed" borderColor={ColorOption.feintGrey}>
+ <Flex justify="space-between">
<Text fontWeight={fontWeight} fontColor={ColorOption.grey}>
- {props.primaryValue}
+ {rowLabel}
</Text>
- </Container>
- </Flex>
- </Container>
- );
-};
-
-OrderDetailsRow.defaultProps = {
- shouldEmphasize: false,
-};
-
-OrderDetailsRow.displayName = 'OrderDetailsRow';
+ <Container>
+ {this._renderUsdSection()}
+ <Text fontWeight={fontWeight} fontColor={ColorOption.grey}>
+ {ethFormatter(
+ ethAmount,
+ 4,
+ <Container opacity={0.5}>
+ <AmountPlaceholder color={ColorOption.lightGrey} isPulsating={isLoading} />
+ </Container>,
+ )}
+ </Text>
+ </Container>
+ </Flex>
+ </Container>
+ );
+ }
+ private _renderUsdSection(): React.ReactNode {
+ const usdFormatter = this.props.isEthAmountInBaseUnits ? format.ethBaseAmountInUsd : format.ethUnitAmountInUsd;
+ const shouldHideUsdPriceSection = _.isUndefined(this.props.ethUsdPrice) || _.isUndefined(this.props.ethAmount);
+ return shouldHideUsdPriceSection ? null : (
+ <Container marginRight="3px" display="inline-block">
+ <Text fontColor={ColorOption.lightGrey}>
+ ({usdFormatter(this.props.ethAmount, this.props.ethUsdPrice)})
+ </Text>
+ </Container>
+ );
+ }
+}
diff --git a/packages/instant/src/components/payment_method.tsx b/packages/instant/src/components/payment_method.tsx
new file mode 100644
index 000000000..8c0b47d72
--- /dev/null
+++ b/packages/instant/src/components/payment_method.tsx
@@ -0,0 +1,45 @@
+import { BigNumber } from '@0x/utils';
+import * as _ from 'lodash';
+import * as React from 'react';
+
+import { ColorOption } from '../style/theme';
+import { Network } from '../types';
+
+import { PaymentMethodDropdown } from './payment_method_dropdown';
+import { Circle } from './ui/circle';
+import { Container } from './ui/container';
+import { Flex } from './ui/flex';
+import { Text } from './ui/text';
+
+export interface PaymentMethodProps {}
+
+export const PaymentMethod: React.StatelessComponent<PaymentMethodProps> = () => (
+ <Container padding="20px" width="100%">
+ <Container marginBottom="10px">
+ <Flex justify="space-between">
+ <Text
+ letterSpacing="1px"
+ fontColor={ColorOption.primaryColor}
+ fontWeight={600}
+ textTransform="uppercase"
+ fontSize="14px"
+ >
+ Payment Method
+ </Text>
+ <Flex>
+ <Circle color={ColorOption.green} diameter={8} />
+ <Container marginLeft="3px">
+ <Text fontColor={ColorOption.darkGrey} fontSize="12px">
+ MetaMask
+ </Text>
+ </Container>
+ </Flex>
+ </Flex>
+ </Container>
+ <PaymentMethodDropdown
+ accountAddress="0xa1b2c3d4e5f6g7h8j9k10"
+ accountEthBalanceInWei={new BigNumber(10500000000000000000)}
+ network={Network.Mainnet}
+ />
+ </Container>
+);
diff --git a/packages/instant/src/components/payment_method_dropdown.tsx b/packages/instant/src/components/payment_method_dropdown.tsx
new file mode 100644
index 000000000..bdce2a49d
--- /dev/null
+++ b/packages/instant/src/components/payment_method_dropdown.tsx
@@ -0,0 +1,44 @@
+import { BigNumber } from '@0x/utils';
+import copy from 'copy-to-clipboard';
+import * as React from 'react';
+
+import { Network } from '../types';
+import { etherscanUtil } from '../util/etherscan';
+import { format } from '../util/format';
+
+import { Dropdown, DropdownItemConfig } from './ui/dropdown';
+
+export interface PaymentMethodDropdownProps {
+ accountAddress: string;
+ accountEthBalanceInWei?: BigNumber;
+ network: Network;
+}
+
+export class PaymentMethodDropdown extends React.Component<PaymentMethodDropdownProps> {
+ public render(): React.ReactNode {
+ const { accountAddress, accountEthBalanceInWei } = this.props;
+ const value = format.ethAddress(accountAddress);
+ const label = format.ethBaseAmount(accountEthBalanceInWei, 4, '') as string;
+ return <Dropdown value={value} label={label} items={this._getDropdownItemConfigs()} />;
+ }
+ private readonly _getDropdownItemConfigs = (): DropdownItemConfig[] => {
+ const viewOnEtherscan = {
+ text: 'View on Etherscan',
+ onClick: this._handleEtherscanClick,
+ };
+ const copyAddressToClipboard = {
+ text: 'Copy address to clipboard',
+ onClick: this._handleCopyToClipboardClick,
+ };
+ return [viewOnEtherscan, copyAddressToClipboard];
+ };
+ private readonly _handleEtherscanClick = (): void => {
+ const { accountAddress, network } = this.props;
+ const etherscanUrl = etherscanUtil.getEtherScanEthAddressIfExists(accountAddress, network);
+ window.open(etherscanUrl, '_blank');
+ };
+ private readonly _handleCopyToClipboardClick = (): void => {
+ const { accountAddress } = this.props;
+ copy(accountAddress);
+ };
+}
diff --git a/packages/instant/src/components/placing_order_button.tsx b/packages/instant/src/components/placing_order_button.tsx
new file mode 100644
index 000000000..d774d7d27
--- /dev/null
+++ b/packages/instant/src/components/placing_order_button.tsx
@@ -0,0 +1,16 @@
+import * as React from 'react';
+
+import { ColorOption } from '../style/theme';
+
+import { Button } from './ui/button';
+import { Container } from './ui/container';
+import { Spinner } from './ui/spinner';
+
+export const PlacingOrderButton: React.StatelessComponent<{}> = props => (
+ <Button isDisabled={true} width="100%" fontColor={ColorOption.white} fontSize="20px">
+ <Container display="inline-block" position="relative" top="3px" marginRight="8px">
+ <Spinner widthPx={20} heightPx={20} />
+ </Container>
+ Placing Order&hellip;
+ </Button>
+);
diff --git a/packages/instant/src/components/scaling_amount_input.tsx b/packages/instant/src/components/scaling_amount_input.tsx
new file mode 100644
index 000000000..5dc719293
--- /dev/null
+++ b/packages/instant/src/components/scaling_amount_input.tsx
@@ -0,0 +1,83 @@
+import { BigNumber } from '@0x/utils';
+import * as _ from 'lodash';
+import * as React from 'react';
+
+import { Maybe } from '../types';
+
+import { ColorOption } from '../style/theme';
+import { maybeBigNumberUtil } from '../util/maybe_big_number';
+import { util } from '../util/util';
+
+import { ScalingInput } from './scaling_input';
+
+export interface ScalingAmountInputProps {
+ isDisabled: boolean;
+ maxFontSizePx: number;
+ textLengthThreshold: number;
+ fontColor?: ColorOption;
+ value?: BigNumber;
+ onAmountChange: (value?: BigNumber) => void;
+ onFontSizeChange: (fontSizePx: number) => void;
+}
+interface ScalingAmountInputState {
+ stringValue: string;
+}
+
+const { stringToMaybeBigNumber, areMaybeBigNumbersEqual } = maybeBigNumberUtil;
+export class ScalingAmountInput extends React.Component<ScalingAmountInputProps, ScalingAmountInputState> {
+ public static defaultProps = {
+ onAmountChange: util.boundNoop,
+ onFontSizeChange: util.boundNoop,
+ isDisabled: false,
+ };
+ public constructor(props: ScalingAmountInputProps) {
+ super(props);
+ this.state = {
+ stringValue: _.isUndefined(props.value) ? '' : props.value.toString(),
+ };
+ }
+ public componentDidUpdate(): void {
+ const parsedStateValue = stringToMaybeBigNumber(this.state.stringValue);
+ const currentValue = this.props.value;
+
+ if (!areMaybeBigNumbersEqual(parsedStateValue, currentValue)) {
+ // we somehow got into the state in which the value passed in and the string value
+ // in state have differed, reset state
+ // we dont expect to ever get into this state, but let's make sure
+ // we reset if we do since we're dealing with important numbers
+ this.setState({
+ stringValue: _.isUndefined(currentValue) ? '' : currentValue.toString(),
+ });
+ }
+ }
+
+ public render(): React.ReactNode {
+ const { textLengthThreshold, fontColor, maxFontSizePx, onFontSizeChange } = this.props;
+ return (
+ <ScalingInput
+ maxFontSizePx={maxFontSizePx}
+ textLengthThreshold={textLengthThreshold}
+ onFontSizeChange={onFontSizeChange}
+ fontColor={fontColor}
+ onChange={this._handleChange}
+ value={this.state.stringValue}
+ placeholder="0.00"
+ emptyInputWidthCh={3.5}
+ isDisabled={this.props.isDisabled}
+ />
+ );
+ }
+ private readonly _handleChange = (event: React.ChangeEvent<HTMLInputElement>): void => {
+ const sanitizedValue = event.target.value.replace(/[^0-9.]/g, ''); // only allow numbers and "."
+ this.setState({
+ stringValue: sanitizedValue,
+ });
+
+ // Trigger onAmountChange with a valid BigNumber, or undefined if the sanitizedValue is invalid or empty
+ const bigNumberValue: Maybe<BigNumber> = _.isEmpty(sanitizedValue)
+ ? undefined
+ : stringToMaybeBigNumber(sanitizedValue);
+
+ this.props.onAmountChange(bigNumberValue);
+ };
+}
diff --git a/packages/instant/src/components/scaling_input.tsx b/packages/instant/src/components/scaling_input.tsx
new file mode 100644
index 000000000..1abadb78b
--- /dev/null
+++ b/packages/instant/src/components/scaling_input.tsx
@@ -0,0 +1,173 @@
+import * as _ from 'lodash';
+import * as React from 'react';
+
+import { ColorOption } from '../style/theme';
+import { util } from '../util/util';
+
+import { Input } from './ui/input';
+
+export enum ScalingInputPhase {
+ FixedFontSize,
+ ScalingFontSize,
+}
+
+export interface ScalingSettings {
+ percentageToReduceFontSizePerCharacter: number;
+ constantPxToIncreaseWidthPerCharacter: number;
+}
+
+export interface ScalingInputProps {
+ textLengthThreshold: number;
+ maxFontSizePx: number;
+ value: string;
+ emptyInputWidthCh: number;
+ onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
+ onFontSizeChange: (fontSizePx: number) => void;
+ fontColor?: ColorOption;
+ placeholder?: string;
+ maxLength?: number;
+ scalingSettings: ScalingSettings;
+ isDisabled: boolean;
+}
+
+export interface ScalingInputState {
+ inputWidthPxAtPhaseChange?: number;
+}
+
+export interface ScalingInputSnapshot {
+ inputWidthPx: number;
+}
+
+// These are magic numbers that were determined experimentally.
+const defaultScalingSettings: ScalingSettings = {
+ percentageToReduceFontSizePerCharacter: 0.125,
+ constantPxToIncreaseWidthPerCharacter: 4,
+};
+
+export class ScalingInput extends React.Component<ScalingInputProps, ScalingInputState> {
+ public static defaultProps = {
+ onChange: util.boundNoop,
+ onFontSizeChange: util.boundNoop,
+ maxLength: 7,
+ scalingSettings: defaultScalingSettings,
+ isDisabled: false,
+ };
+ public state: ScalingInputState = {
+ inputWidthPxAtPhaseChange: undefined,
+ };
+ private readonly _inputRef = React.createRef<HTMLInputElement>();
+ public static getPhase(textLengthThreshold: number, value: string): ScalingInputPhase {
+ if (value.length <= textLengthThreshold) {
+ return ScalingInputPhase.FixedFontSize;
+ }
+ return ScalingInputPhase.ScalingFontSize;
+ }
+ public static getPhaseFromProps(props: ScalingInputProps): ScalingInputPhase {
+ const { value, textLengthThreshold } = props;
+ return ScalingInput.getPhase(textLengthThreshold, value);
+ }
+ public static calculateFontSize(
+ textLengthThreshold: number,
+ maxFontSizePx: number,
+ phase: ScalingInputPhase,
+ value: string,
+ percentageToReduceFontSizePerCharacter: number,
+ ): number {
+ if (phase !== ScalingInputPhase.ScalingFontSize) {
+ return maxFontSizePx;
+ }
+ const charactersOverMax = value.length - textLengthThreshold;
+ const scalingFactor = (1 - percentageToReduceFontSizePerCharacter) ** charactersOverMax;
+ const fontSize = scalingFactor * maxFontSizePx;
+ return fontSize;
+ }
+ public static calculateFontSizeFromProps(props: ScalingInputProps, phase: ScalingInputPhase): number {
+ const { textLengthThreshold, value, maxFontSizePx, scalingSettings } = props;
+ return ScalingInput.calculateFontSize(
+ textLengthThreshold,
+ maxFontSizePx,
+ phase,
+ value,
+ scalingSettings.percentageToReduceFontSizePerCharacter,
+ );
+ }
+ public getSnapshotBeforeUpdate(): ScalingInputSnapshot {
+ return {
+ inputWidthPx: this._getInputWidthInPx(),
+ };
+ }
+ public componentDidUpdate(
+ prevProps: ScalingInputProps,
+ prevState: ScalingInputState,
+ snapshot: ScalingInputSnapshot,
+ ): void {
+ const prevPhase = ScalingInput.getPhaseFromProps(prevProps);
+ const curPhase = ScalingInput.getPhaseFromProps(this.props);
+ // if we went from fixed to scaling, save the width from the transition
+ if (prevPhase !== ScalingInputPhase.ScalingFontSize && curPhase === ScalingInputPhase.ScalingFontSize) {
+ this.setState({
+ inputWidthPxAtPhaseChange: snapshot.inputWidthPx,
+ });
+ }
+ // if we went from scaling to fixed, revert back to scaling using `ch`
+ if (prevPhase === ScalingInputPhase.ScalingFontSize && curPhase !== ScalingInputPhase.ScalingFontSize) {
+ this.setState({
+ inputWidthPxAtPhaseChange: undefined,
+ });
+ }
+ const prevFontSize = ScalingInput.calculateFontSizeFromProps(prevProps, prevPhase);
+ const curFontSize = ScalingInput.calculateFontSizeFromProps(this.props, curPhase);
+ // If font size has changed, notify.
+ if (prevFontSize !== curFontSize) {
+ this.props.onFontSizeChange(curFontSize);
+ }
+ }
+ public render(): React.ReactNode {
+ const { isDisabled, fontColor, onChange, placeholder, value, maxLength } = this.props;
+ const phase = ScalingInput.getPhaseFromProps(this.props);
+ return (
+ <Input
+ ref={this._inputRef as any}
+ fontColor={fontColor}
+ onChange={onChange}
+ value={value}
+ placeholder={placeholder}
+ fontSize={`${this._calculateFontSize(phase)}px`}
+ width={this._calculateWidth(phase)}
+ maxLength={maxLength}
+ disabled={isDisabled}
+ />
+ );
+ }
+ private readonly _calculateWidth = (phase: ScalingInputPhase): string => {
+ const { value, textLengthThreshold, scalingSettings } = this.props;
+ if (_.isEmpty(value)) {
+ return `${this.props.emptyInputWidthCh}ch`;
+ }
+ switch (phase) {
+ case ScalingInputPhase.FixedFontSize:
+ return `${value.length}ch`;
+ case ScalingInputPhase.ScalingFontSize:
+ const { inputWidthPxAtPhaseChange } = this.state;
+ if (!_.isUndefined(inputWidthPxAtPhaseChange)) {
+ const charactersOverMax = value.length - textLengthThreshold;
+ const scalingAmount = scalingSettings.constantPxToIncreaseWidthPerCharacter * charactersOverMax;
+ const width = inputWidthPxAtPhaseChange + scalingAmount;
+ return `${width}px`;
+ }
+ return `${textLengthThreshold}ch`;
+ default:
+ return '1ch';
+ }
+ };
+ private readonly _calculateFontSize = (phase: ScalingInputPhase): number => {
+ return ScalingInput.calculateFontSizeFromProps(this.props, phase);
+ };
+ private readonly _getInputWidthInPx = (): number => {
+ const ref = this._inputRef.current;
+ if (!ref) {
+ return 0;
+ }
+ return ref.getBoundingClientRect().width;
+ };
+}
diff --git a/packages/instant/src/components/search_input.tsx b/packages/instant/src/components/search_input.tsx
new file mode 100644
index 000000000..3a693b9f8
--- /dev/null
+++ b/packages/instant/src/components/search_input.tsx
@@ -0,0 +1,29 @@
+import * as _ from 'lodash';
+import * as React from 'react';
+
+import { ColorOption } from '../style/theme';
+
+import { Container } from './ui/container';
+import { Flex } from './ui/flex';
+import { Icon } from './ui/icon';
+import { Input, InputProps } from './ui/input';
+
+export interface SearchInputProps extends InputProps {
+ backgroundColor?: ColorOption;
+}
+
+export const SearchInput: React.StatelessComponent<SearchInputProps> = props => (
+ <Container backgroundColor={props.backgroundColor} borderRadius="3px" padding=".5em .3em">
+ <Flex justify="flex-start" align="flex-end">
+ <Icon width={14} height={14} icon="search" color={ColorOption.lightGrey} padding="0px 12px" />
+ <Input {...props} fontSize="14px" fontColor={props.fontColor} />
+ </Flex>
+ </Container>
+);
+
+SearchInput.displayName = 'SearchInput';
+
+SearchInput.defaultProps = {
+ backgroundColor: ColorOption.lightestGrey,
+ fontColor: ColorOption.grey,
+};
diff --git a/packages/instant/src/components/secondary_button.tsx b/packages/instant/src/components/secondary_button.tsx
new file mode 100644
index 000000000..df0539606
--- /dev/null
+++ b/packages/instant/src/components/secondary_button.tsx
@@ -0,0 +1,28 @@
+import * as _ from 'lodash';
+import * as React from 'react';
+
+import { ColorOption } from '../style/theme';
+
+import { Button, ButtonProps } from './ui/button';
+
+export interface SecondaryButtonProps extends ButtonProps {}
+
+export const SecondaryButton: React.StatelessComponent<SecondaryButtonProps> = props => {
+ const buttonProps = _.omit(props, 'text');
+ return (
+ <Button
+ backgroundColor={ColorOption.white}
+ borderColor={ColorOption.lightGrey}
+ width={props.width}
+ onClick={props.onClick}
+ fontColor={ColorOption.primaryColor}
+ fontSize="16px"
+ {...buttonProps}
+ >
+ {props.children}
+ </Button>
+ );
+};
+SecondaryButton.defaultProps = {
+ width: '100%',
+};
diff --git a/packages/instant/src/components/sliding_error.tsx b/packages/instant/src/components/sliding_error.tsx
new file mode 100644
index 000000000..a8d4e391c
--- /dev/null
+++ b/packages/instant/src/components/sliding_error.tsx
@@ -0,0 +1,95 @@
+import * as React from 'react';
+
+import { ScreenSpecification } from '../style/media';
+import { ColorOption } from '../style/theme';
+import { zIndex } from '../style/z_index';
+
+import { PositionAnimationSettings } from './animations/position_animation';
+import { SlideAnimation, SlideAnimationState } from './animations/slide_animation';
+
+import { Container } from './ui/container';
+import { Flex } from './ui/flex';
+import { Text } from './ui/text';
+
+export interface ErrorProps {
+ icon: string;
+ message: string;
+}
+
+export const Error: React.StatelessComponent<ErrorProps> = props => (
+ <Container
+ padding="10px"
+ border={`1px solid ${ColorOption.darkOrange}`}
+ backgroundColor={ColorOption.lightOrange}
+ width="100%"
+ borderRadius="6px"
+ marginTop="10px"
+ marginBottom="10px"
+ >
+ <Flex justify="flex-start">
+ <Container marginRight="5px" display="inline" top="3px" position="relative">
+ <Text fontSize="20px">{props.icon}</Text>
+ </Container>
+ <Text fontWeight="500" fontColor={ColorOption.darkOrange}>
+ {props.message}
+ </Text>
+ </Flex>
+ </Container>
+);
+
+export interface SlidingErrorProps extends ErrorProps {
+ animationState: SlideAnimationState;
+}
+export const SlidingError: React.StatelessComponent<SlidingErrorProps> = props => {
+ const slideAmount = '120px';
+
+ const desktopSlideIn: PositionAnimationSettings = {
+ timingFunction: 'ease-in',
+ top: {
+ from: slideAmount,
+ to: '0px',
+ },
+ position: 'relative',
+ };
+ const desktopSlideOut: PositionAnimationSettings = {
+ timingFunction: 'cubic-bezier(0.25, 0.1, 0.25, 1)',
+ top: {
+ from: '0px',
+ to: slideAmount,
+ },
+ position: 'relative',
+ };
+
+ const mobileSlideIn: PositionAnimationSettings = {
+ duration: '0.5s',
+ timingFunction: 'ease-in',
+ top: { from: '-120px', to: '0px' },
+ position: 'fixed',
+ };
+ const moblieSlideOut: PositionAnimationSettings = {
+ duration: '0.5s',
+ timingFunction: 'ease-in',
+ top: { from: '0px', to: '-120px' },
+ position: 'fixed',
+ };
+
+ const slideUpSettings: ScreenSpecification<PositionAnimationSettings> = {
+ default: desktopSlideIn,
+ sm: mobileSlideIn,
+ };
+ const slideOutSettings: ScreenSpecification<PositionAnimationSettings> = {
+ default: desktopSlideOut,
+ sm: moblieSlideOut,
+ };
+
+ return (
+ <SlideAnimation
+ slideInSettings={slideUpSettings}
+ slideOutSettings={slideOutSettings}
+ zIndex={{ sm: zIndex.errorPopup, default: zIndex.errorPopBehind }}
+ animationState={props.animationState}
+ >
+ <Error icon={props.icon} message={props.message} />
+ </SlideAnimation>
+ );
+};
diff --git a/packages/instant/src/components/sliding_panel.tsx b/packages/instant/src/components/sliding_panel.tsx
new file mode 100644
index 000000000..9d16f9560
--- /dev/null
+++ b/packages/instant/src/components/sliding_panel.tsx
@@ -0,0 +1,77 @@
+import * as React from 'react';
+
+import { ColorOption } from '../style/theme';
+import { zIndex } from '../style/z_index';
+
+import { PositionAnimationSettings } from './animations/position_animation';
+import { SlideAnimation, SlideAnimationState } from './animations/slide_animation';
+
+import { Container } from './ui/container';
+import { Flex } from './ui/flex';
+import { Icon } from './ui/icon';
+import { Text } from './ui/text';
+
+export interface PanelProps {
+ title?: string;
+ onClose?: () => void;
+}
+
+export const Panel: React.StatelessComponent<PanelProps> = ({ title, children, onClose }) => (
+ <Container backgroundColor={ColorOption.white} width="100%" height="100%" zIndex={zIndex.panel} padding="20px">
+ <Flex justify="space-between">
+ {title && (
+ <Container marginTop="3px">
+ <Text fontColor={ColorOption.darkGrey} fontSize="18px" fontWeight="600" lineHeight="22px">
+ {title}
+ </Text>
+ </Container>
+ )}
+ <Container position="relative" bottom="7px">
+ <Icon width={12} color={ColorOption.lightGrey} icon="closeX" onClick={onClose} />
+ </Container>
+ </Flex>
+ <Container marginTop="10px" height="100%">
+ {children}
+ </Container>
+ </Container>
+);
+
+export interface SlidingPanelProps extends PanelProps {
+ animationState: SlideAnimationState;
+}
+
+export const SlidingPanel: React.StatelessComponent<SlidingPanelProps> = props => {
+ if (props.animationState === 'none') {
+ return null;
+ }
+ const { animationState, ...rest } = props;
+ const slideAmount = '100%';
+ const slideUpSettings: PositionAnimationSettings = {
+ duration: '0.3s',
+ timingFunction: 'ease-in-out',
+ top: {
+ from: slideAmount,
+ to: '0px',
+ },
+ position: 'absolute',
+ };
+ const slideDownSettings: PositionAnimationSettings = {
+ duration: '0.3s',
+ timingFunction: 'ease-out',
+ top: {
+ from: '0px',
+ to: slideAmount,
+ },
+ position: 'absolute',
+ };
+ return (
+ <SlideAnimation
+ slideInSettings={slideUpSettings}
+ slideOutSettings={slideDownSettings}
+ animationState={animationState}
+ height="100%"
+ >
+ <Panel {...rest} />
+ </SlideAnimation>
+ );
+};
diff --git a/packages/instant/src/components/time_counter.tsx b/packages/instant/src/components/time_counter.tsx
new file mode 100644
index 000000000..f9b68163c
--- /dev/null
+++ b/packages/instant/src/components/time_counter.tsx
@@ -0,0 +1,78 @@
+import * as React from 'react';
+
+import { ONE_SECOND_MS } from '../constants';
+import { ColorOption } from '../style/theme';
+import { timeUtil } from '../util/time';
+
+import { Container } from './ui/container';
+import { Flex } from './ui/flex';
+import { Text } from './ui/text';
+
+export interface TimeCounterProps {
+ estimatedTimeMs: number;
+ hasEnded: boolean;
+}
+interface TimeCounterState {
+ elapsedSeconds: number;
+}
+
+export class TimeCounter extends React.Component<TimeCounterProps, TimeCounterState> {
+ public state = {
+ elapsedSeconds: 0,
+ };
+ private _timerId?: number;
+
+ public componentDidMount(): void {
+ this._setupTimerBasedOnProps();
+ }
+
+ public componentWillUnmount(): void {
+ this._clearTimer();
+ }
+
+ public componentDidUpdate(prevProps: TimeCounterProps): void {
+ if (prevProps.hasEnded !== this.props.hasEnded) {
+ this._setupTimerBasedOnProps();
+ }
+ }
+
+ public render(): React.ReactNode {
+ const estimatedTimeSeconds = this.props.estimatedTimeMs / ONE_SECOND_MS;
+ return (
+ <Flex justify="space-between">
+ <Container>
+ <Container marginRight="5px" display="inline">
+ <Text fontWeight={600} fontColor={ColorOption.grey}>
+ Est. Time
+ </Text>
+ </Container>
+ <Text fontColor={ColorOption.grey}>
+ ({timeUtil.secondsToHumanDescription(estimatedTimeSeconds)})
+ </Text>
+ </Container>
+ <Text fontColor={ColorOption.grey}>
+ Time: {timeUtil.secondsToStopwatchTime(this.state.elapsedSeconds)}
+ </Text>
+ </Flex>
+ );
+ }
+
+ private _setupTimerBasedOnProps(): void {
+ this.props.hasEnded ? this._clearTimer() : this._newTimer();
+ }
+
+ private _newTimer(): void {
+ this._clearTimer();
+ this._timerId = window.setInterval(() => {
+ this.setState({
+ elapsedSeconds: this.state.elapsedSeconds + 1,
+ });
+ }, ONE_SECOND_MS);
+ }
+
+ private _clearTimer(): void {
+ if (this._timerId) {
+ window.clearInterval(this._timerId);
+ }
+ }
+}
diff --git a/packages/instant/src/components/timed_progress_bar.tsx b/packages/instant/src/components/timed_progress_bar.tsx
new file mode 100644
index 000000000..59aaa33a1
--- /dev/null
+++ b/packages/instant/src/components/timed_progress_bar.tsx
@@ -0,0 +1,80 @@
+import * as _ from 'lodash';
+import * as React from 'react';
+
+import { PROGRESS_FINISH_ANIMATION_TIME_MS, PROGRESS_STALL_AT_WIDTH } from '../constants';
+import { ColorOption, keyframes, styled } from '../style/theme';
+
+import { Container } from './ui/container';
+
+export interface TimedProgressBarProps {
+ expectedTimeMs: number;
+ hasEnded: boolean;
+}
+
+/**
+ * Timed Progress Bar
+ * Goes from 0% -> PROGRESS_STALL_AT_WIDTH over time of expectedTimeMs
+ * When hasEnded set to true, goes to 100% through animation of PROGRESS_FINISH_ANIMATION_TIME_MS length of time
+ */
+export class TimedProgressBar extends React.Component<TimedProgressBarProps, {}> {
+ private readonly _barRef = React.createRef<HTMLDivElement>();
+
+ public render(): React.ReactNode {
+ const timedProgressProps = this._calculateTimedProgressProps();
+ return (
+ <Container width="100%" backgroundColor={ColorOption.lightGrey} borderRadius="6px">
+ <TimedProgress {...timedProgressProps} ref={this._barRef as any} />
+ </Container>
+ );
+ }
+
+ private _calculateTimedProgressProps(): TimedProgressProps {
+ if (this.props.hasEnded) {
+ if (!this._barRef.current) {
+ throw new Error('ended but no reference');
+ }
+ const fromWidth = `${this._barRef.current.offsetWidth}px`;
+ return {
+ timeMs: PROGRESS_FINISH_ANIMATION_TIME_MS,
+ fromWidth,
+ toWidth: '100%',
+ };
+ }
+
+ return {
+ timeMs: this.props.expectedTimeMs,
+ fromWidth: '0px',
+ toWidth: PROGRESS_STALL_AT_WIDTH,
+ };
+ }
+}
+
+const expandingWidthKeyframes = (fromWidth: string, toWidth: string) => {
+ return keyframes`
+ from {
+ width: ${fromWidth};
+ }
+ to {
+ width: ${toWidth};
+ }
+ `;
+};
+
+interface TimedProgressProps {
+ timeMs: number;
+ fromWidth: string;
+ toWidth: string;
+}
+
+export const TimedProgress =
+ styled.div <
+ TimedProgressProps >
+ `
+ && {
+ background-color: ${props => props.theme[ColorOption.primaryColor]};
+ border-radius: 6px;
+ height: 6px;
+ animation: ${props => expandingWidthKeyframes(props.fromWidth, props.toWidth)}
+ ${props => props.timeMs}ms linear 1 forwards;
+ }
+`;
diff --git a/packages/instant/src/components/ui/button.tsx b/packages/instant/src/components/ui/button.tsx
index 1fcb2591c..b90221bf4 100644
--- a/packages/instant/src/components/ui/button.tsx
+++ b/packages/instant/src/components/ui/button.tsx
@@ -6,6 +6,8 @@ import { ColorOption, styled } from '../../style/theme';
export interface ButtonProps {
backgroundColor?: ColorOption;
borderColor?: ColorOption;
+ fontColor?: ColorOption;
+ fontSize?: string;
width?: string;
padding?: string;
type?: string;
@@ -24,37 +26,49 @@ const darkenOnHoverAmount = 0.1;
const darkenOnActiveAmount = 0.2;
const saturateOnFocusAmount = 0.2;
export const Button = styled(PlainButton)`
- cursor: ${props => (props.isDisabled ? 'default' : 'pointer')};
- transition: background-color, opacity 0.5s ease;
- padding: ${props => props.padding};
- border-radius: 3px;
- outline: none;
- width: ${props => props.width};
- background-color: ${props => (props.backgroundColor ? props.theme[props.backgroundColor] : 'none')};
- border: ${props => (props.borderColor ? `1px solid ${props.theme[props.borderColor]}` : 'none')};
- &:hover {
- background-color: ${props =>
- !props.isDisabled
- ? darken(darkenOnHoverAmount, props.theme[props.backgroundColor || 'white'])
- : ''} !important;
- }
- &:active {
- background-color: ${props =>
- !props.isDisabled ? darken(darkenOnActiveAmount, props.theme[props.backgroundColor || 'white']) : ''};
- }
- &:disabled {
- opacity: 0.5;
- }
- &:focus {
- background-color: ${props => saturate(saturateOnFocusAmount, props.theme[props.backgroundColor || 'white'])};
+ && {
+ all: initial;
+ box-sizing: border-box;
+ font-size: ${props => props.fontSize};
+ font-family: 'Inter UI', sans-serif;
+ font-weight: 600;
+ color: ${props => props.fontColor && props.theme[props.fontColor]};
+ cursor: ${props => (props.isDisabled ? 'default' : 'pointer')};
+ transition: background-color, opacity 0.5s ease;
+ padding: ${props => props.padding};
+ border-radius: 3px;
+ text-align: center;
+ outline: none;
+ width: ${props => props.width};
+ background-color: ${props => (props.backgroundColor ? props.theme[props.backgroundColor] : 'none')};
+ border: ${props => (props.borderColor ? `1px solid ${props.theme[props.borderColor]}` : 'none')};
+ &:hover {
+ background-color: ${props =>
+ !props.isDisabled
+ ? darken(darkenOnHoverAmount, props.theme[props.backgroundColor || 'white'])
+ : ''} !important;
+ }
+ &:active {
+ background-color: ${props =>
+ !props.isDisabled ? darken(darkenOnActiveAmount, props.theme[props.backgroundColor || 'white']) : ''};
+ }
+ &:disabled {
+ opacity: 0.5;
+ }
+ &:focus {
+ background-color: ${props =>
+ saturate(saturateOnFocusAmount, props.theme[props.backgroundColor || 'white'])};
+ }
}
`;
Button.defaultProps = {
backgroundColor: ColorOption.primaryColor,
+ borderColor: ColorOption.primaryColor,
width: 'auto',
isDisabled: false,
- padding: '1em 2.2em',
+ padding: '.6em 1.2em',
+ fontSize: '15px',
};
Button.displayName = 'Button';
diff --git a/packages/instant/src/components/ui/circle.tsx b/packages/instant/src/components/ui/circle.tsx
new file mode 100644
index 000000000..4f9f56f12
--- /dev/null
+++ b/packages/instant/src/components/ui/circle.tsx
@@ -0,0 +1,27 @@
+import { ColorOption, styled, Theme, withTheme } from '../../style/theme';
+
+export interface CircleProps {
+ diameter: number;
+ rawColor?: string;
+ color?: ColorOption;
+ theme: Theme;
+}
+
+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%;
+ }
+`,
+);
+
+Circle.displayName = 'Circle';
+
+Circle.defaultProps = {
+ color: ColorOption.white,
+};
diff --git a/packages/instant/src/components/ui/container.tsx b/packages/instant/src/components/ui/container.tsx
index c45f6e5e9..8aa5db9e5 100644
--- a/packages/instant/src/components/ui/container.tsx
+++ b/packages/instant/src/components/ui/container.tsx
@@ -1,16 +1,18 @@
-import * as React from 'react';
+import { darken } from 'polished';
+import { MediaChoice, stylesForMedia } from '../../style/media';
import { ColorOption, styled } from '../../style/theme';
import { cssRuleIfExists } from '../../style/util';
export interface ContainerProps {
- display?: string;
+ display?: MediaChoice;
position?: string;
top?: string;
right?: string;
bottom?: string;
left?: string;
- width?: string;
+ width?: MediaChoice;
+ height?: MediaChoice;
maxWidth?: string;
margin?: string;
marginTop?: string;
@@ -26,35 +28,60 @@ export interface ContainerProps {
className?: string;
backgroundColor?: ColorOption;
hasBoxShadow?: boolean;
+ zIndex?: number;
+ whiteSpace?: string;
+ opacity?: number;
+ cursor?: string;
+ overflow?: string;
+ darkenOnHover?: boolean;
+ boxShadowOnHover?: boolean;
+ flexGrow?: string | number;
}
-const PlainContainer: React.StatelessComponent<ContainerProps> = ({ children, className }) => (
- <div className={className}>{children}</div>
-);
-
-export const Container = styled(PlainContainer)`
- box-sizing: border-box;
- ${props => cssRuleIfExists(props, 'display')}
- ${props => cssRuleIfExists(props, 'position')}
- ${props => cssRuleIfExists(props, 'top')}
- ${props => cssRuleIfExists(props, 'right')}
- ${props => cssRuleIfExists(props, 'bottom')}
- ${props => cssRuleIfExists(props, 'left')}
- ${props => cssRuleIfExists(props, 'width')}
- ${props => cssRuleIfExists(props, 'max-width')}
- ${props => cssRuleIfExists(props, 'margin')}
- ${props => cssRuleIfExists(props, 'margin-top')}
- ${props => cssRuleIfExists(props, 'margin-right')}
- ${props => cssRuleIfExists(props, 'margin-bottom')}
- ${props => cssRuleIfExists(props, 'margin-left')}
- ${props => cssRuleIfExists(props, 'padding')}
- ${props => cssRuleIfExists(props, 'border-radius')}
- ${props => cssRuleIfExists(props, 'border')}
- ${props => cssRuleIfExists(props, 'border-top')}
- ${props => cssRuleIfExists(props, 'border-bottom')}
- ${props => (props.hasBoxShadow ? `box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.1)` : '')};
- background-color: ${props => (props.backgroundColor ? props.theme[props.backgroundColor] : 'none')};
- border-color: ${props => (props.borderColor ? props.theme[props.borderColor] : 'none')};
+export const Container =
+ styled.div <
+ ContainerProps >
+ `
+ && {
+ box-sizing: border-box;
+ ${props => cssRuleIfExists(props, 'flex-grow')}
+ ${props => cssRuleIfExists(props, 'position')}
+ ${props => cssRuleIfExists(props, 'top')}
+ ${props => cssRuleIfExists(props, 'right')}
+ ${props => cssRuleIfExists(props, 'bottom')}
+ ${props => cssRuleIfExists(props, 'left')}
+ ${props => cssRuleIfExists(props, 'max-width')}
+ ${props => cssRuleIfExists(props, 'margin')}
+ ${props => cssRuleIfExists(props, 'margin-top')}
+ ${props => cssRuleIfExists(props, 'margin-right')}
+ ${props => cssRuleIfExists(props, 'margin-bottom')}
+ ${props => cssRuleIfExists(props, 'margin-left')}
+ ${props => cssRuleIfExists(props, 'padding')}
+ ${props => cssRuleIfExists(props, 'border-radius')}
+ ${props => cssRuleIfExists(props, 'border')}
+ ${props => cssRuleIfExists(props, 'border-top')}
+ ${props => cssRuleIfExists(props, 'border-bottom')}
+ ${props => cssRuleIfExists(props, 'z-index')}
+ ${props => cssRuleIfExists(props, 'white-space')}
+ ${props => cssRuleIfExists(props, 'opacity')}
+ ${props => cssRuleIfExists(props, 'cursor')}
+ ${props => cssRuleIfExists(props, 'overflow')}
+ ${props => (props.hasBoxShadow ? `box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.1)` : '')};
+ ${props => props.display && stylesForMedia<string>('display', props.display)}
+ ${props => props.width && stylesForMedia<string>('width', props.width)}
+ ${props => props.height && stylesForMedia<string>('height', props.height)}
+ background-color: ${props => (props.backgroundColor ? props.theme[props.backgroundColor] : 'none')};
+ border-color: ${props => (props.borderColor ? props.theme[props.borderColor] : 'none')};
+ &:hover {
+ ${props =>
+ props.darkenOnHover
+ ? `background-color: ${
+ props.backgroundColor ? darken(0.05, props.theme[props.backgroundColor]) : 'none'
+ }`
+ : ''};
+ ${props => (props.boxShadowOnHover ? 'box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.1)' : '')};
+ }
+ }
`;
Container.defaultProps = {
diff --git a/packages/instant/src/components/ui/dropdown.tsx b/packages/instant/src/components/ui/dropdown.tsx
new file mode 100644
index 000000000..3a23f456d
--- /dev/null
+++ b/packages/instant/src/components/ui/dropdown.tsx
@@ -0,0 +1,134 @@
+import * as _ from 'lodash';
+import * as React from 'react';
+
+import { ColorOption, completelyTransparent } from '../../style/theme';
+import { zIndex } from '../../style/z_index';
+
+import { Container } from './container';
+import { Flex } from './flex';
+import { Icon } from './icon';
+import { Overlay } from './overlay';
+import { Text } from './text';
+
+export interface DropdownItemConfig {
+ text: string;
+ onClick?: () => void;
+}
+
+export interface DropdownProps {
+ value: string;
+ label?: string;
+ items: DropdownItemConfig[];
+}
+
+export interface DropdownState {
+ isOpen: boolean;
+}
+
+export class Dropdown extends React.Component<DropdownProps, DropdownState> {
+ public static defaultProps = {
+ items: [],
+ };
+ public state: DropdownState = {
+ isOpen: false,
+ };
+ public render(): React.ReactNode {
+ const { value, label, items } = this.props;
+ const { isOpen } = this.state;
+ const hasItems = !_.isEmpty(items);
+ const borderRadius = isOpen ? '4px 4px 0px 0px' : '4px';
+ return (
+ <React.Fragment>
+ {isOpen && (
+ <Overlay
+ zIndex={zIndex.dropdownItems - 1}
+ backgroundColor={completelyTransparent}
+ onClick={this._closeDropdown}
+ />
+ )}
+ <Container position="relative">
+ <Container
+ cursor={hasItems ? 'pointer' : undefined}
+ onClick={this._handleDropdownClick}
+ hasBoxShadow={isOpen}
+ boxShadowOnHover={true}
+ borderRadius={borderRadius}
+ border="1px solid"
+ borderColor={ColorOption.feintGrey}
+ padding="0.8em"
+ >
+ <Flex justify="space-between">
+ <Text fontSize="16px" fontColor={ColorOption.darkGrey}>
+ {value}
+ </Text>
+ <Container>
+ {label && (
+ <Text fontSize="16px" fontColor={ColorOption.lightGrey}>
+ {label}
+ </Text>
+ )}
+ {hasItems && (
+ <Container marginLeft="5px" display="inline-block" position="relative" bottom="2px">
+ <Icon padding="3px" icon="chevron" width={12} stroke={ColorOption.grey} />
+ </Container>
+ )}
+ </Container>
+ </Flex>
+ </Container>
+ {isOpen && (
+ <Container
+ width="100%"
+ position="absolute"
+ onClick={this._closeDropdown}
+ backgroundColor={ColorOption.white}
+ hasBoxShadow={true}
+ zIndex={zIndex.dropdownItems}
+ >
+ {_.map(items, (item, index) => (
+ <DropdownItem key={item.text} {...item} isLast={index === items.length - 1} />
+ ))}
+ </Container>
+ )}
+ </Container>
+ </React.Fragment>
+ );
+ }
+ private readonly _handleDropdownClick = (): void => {
+ if (_.isEmpty(this.props.items)) {
+ return;
+ }
+ this.setState({
+ isOpen: !this.state.isOpen,
+ });
+ };
+ private readonly _closeDropdown = (): void => {
+ this.setState({
+ isOpen: false,
+ });
+ };
+}
+
+export interface DropdownItemProps extends DropdownItemConfig {
+ text: string;
+ onClick?: () => void;
+ isLast: boolean;
+}
+
+export const DropdownItem: React.StatelessComponent<DropdownItemProps> = ({ text, onClick, isLast }) => (
+ <Container
+ onClick={onClick}
+ cursor="pointer"
+ darkenOnHover={true}
+ backgroundColor={ColorOption.white}
+ padding="0.8em"
+ borderTop="0"
+ border="1px solid"
+ borderRadius={isLast ? '0px 0px 4px 4px' : undefined}
+ width="100%"
+ borderColor={ColorOption.feintGrey}
+ >
+ <Text fontSize="14px" fontColor={ColorOption.darkGrey}>
+ {text}
+ </Text>
+ </Container>
+);
diff --git a/packages/instant/src/components/ui/flex.tsx b/packages/instant/src/components/ui/flex.tsx
index 327e91926..274c46b9e 100644
--- a/packages/instant/src/components/ui/flex.tsx
+++ b/packages/instant/src/components/ui/flex.tsx
@@ -1,5 +1,4 @@
-import * as React from 'react';
-
+import { MediaChoice, stylesForMedia } from '../../style/media';
import { ColorOption, styled } from '../../style/theme';
import { cssRuleIfExists } from '../../style/util';
@@ -8,23 +7,28 @@ export interface FlexProps {
flexWrap?: 'wrap' | 'nowrap';
justify?: 'flex-start' | 'center' | 'space-around' | 'space-between' | 'space-evenly' | 'flex-end';
align?: 'flex-start' | 'center' | 'space-around' | 'space-between' | 'space-evenly' | 'flex-end';
- width?: string;
+ width?: MediaChoice;
+ height?: MediaChoice;
backgroundColor?: ColorOption;
- className?: string;
+ inline?: boolean;
+ flexGrow?: number | string;
}
-const PlainFlex: React.StatelessComponent<FlexProps> = ({ children, className }) => (
- <div className={className}>{children}</div>
-);
-
-export const Flex = styled(PlainFlex)`
- display: flex;
- flex-direction: ${props => props.direction};
- flex-wrap: ${props => props.flexWrap};
- justify-content: ${props => props.justify};
- align-items: ${props => props.align};
- ${props => cssRuleIfExists(props, 'width')}
- background-color: ${props => (props.backgroundColor ? props.theme[props.backgroundColor] : 'none')};
+export const Flex =
+ styled.div <
+ FlexProps >
+ `
+ && {
+ display: ${props => (props.inline ? 'inline-flex' : 'flex')};
+ flex-direction: ${props => props.direction};
+ flex-wrap: ${props => props.flexWrap};
+ ${props => cssRuleIfExists(props, 'flexGrow')}
+ justify-content: ${props => props.justify};
+ align-items: ${props => props.align};
+ background-color: ${props => (props.backgroundColor ? props.theme[props.backgroundColor] : 'none')};
+ ${props => (props.width ? stylesForMedia('width', props.width) : '')}
+ ${props => (props.height ? stylesForMedia('height', props.height) : '')}
+ }
`;
Flex.defaultProps = {
diff --git a/packages/instant/src/components/ui/icon.tsx b/packages/instant/src/components/ui/icon.tsx
new file mode 100644
index 000000000..a88fa87dd
--- /dev/null
+++ b/packages/instant/src/components/ui/icon.tsx
@@ -0,0 +1,123 @@
+import * as _ from 'lodash';
+import * as React from 'react';
+
+import { ColorOption, styled, Theme, withTheme } from '../../style/theme';
+
+type svgRule = 'evenodd' | 'nonzero' | 'inherit';
+interface IconInfo {
+ viewBox: string;
+ path: string;
+ fillRule?: svgRule;
+ clipRule?: svgRule;
+ strokeOpacity?: number;
+ strokeWidth?: number;
+ strokeLinecap?: 'butt' | 'round' | 'square' | 'inherit';
+ strokeLinejoin?: 'miter' | 'round' | 'bevel' | 'inherit';
+}
+interface IconInfoMapping {
+ closeX: IconInfo;
+ failed: IconInfo;
+ success: IconInfo;
+ chevron: IconInfo;
+ search: IconInfo;
+}
+const ICONS: IconInfoMapping = {
+ closeX: {
+ viewBox: '0 0 11 11',
+ fillRule: 'evenodd',
+ clipRule: 'evenodd',
+ path:
+ 'M10.45 10.449C10.7539 10.1453 10.7539 9.65282 10.45 9.34909L6.60068 5.49999L10.45 1.65093C10.7538 1.3472 10.7538 0.854765 10.45 0.551038C10.1462 0.24731 9.65378 0.24731 9.34995 0.551038L5.50058 4.40006L1.65024 0.549939C1.34641 0.246212 0.853973 0.246212 0.550262 0.549939C0.246429 0.853667 0.246429 1.34611 0.550262 1.64983L4.40073 5.49995L0.55014 9.35019C0.246307 9.65392 0.246307 10.1464 0.55014 10.4501C0.853851 10.7538 1.34628 10.7538 1.65012 10.4501L5.5007 6.59987L9.35007 10.449C9.6539 10.7527 10.1463 10.7527 10.45 10.449Z',
+ },
+ failed: {
+ viewBox: '0 0 34 34',
+ fillRule: 'evenodd',
+ clipRule: 'evenodd',
+ path:
+ 'M6.65771 26.4362C9.21777 29.2406 12.9033 31 17 31C24.7319 31 31 24.7319 31 17C31 14.4468 30.3164 12.0531 29.1226 9.99219L6.65771 26.4362ZM4.88281 24.0173C3.68555 21.9542 3 19.5571 3 17C3 9.26807 9.26807 3 17 3C21.1006 3 24.7891 4.76294 27.3496 7.57214L4.88281 24.0173ZM0 17C0 26.3888 7.61133 34 17 34C26.3887 34 34 26.3888 34 17C34 7.61121 26.3887 0 17 0C7.61133 0 0 7.61121 0 17Z',
+ },
+ success: {
+ viewBox: '0 0 34 34',
+ fillRule: 'evenodd',
+ clipRule: 'evenodd',
+ path:
+ 'M17 34C26.3887 34 34 26.3888 34 17C34 7.61121 26.3887 0 17 0C7.61133 0 0 7.61121 0 17C0 26.3888 7.61133 34 17 34ZM25.7539 13.0977C26.2969 12.4718 26.2295 11.5244 25.6035 10.9817C24.9775 10.439 24.0303 10.5063 23.4878 11.1323L15.731 20.0771L12.3936 16.7438C11.8071 16.1583 10.8574 16.1589 10.272 16.7451C9.68652 17.3313 9.6875 18.281 10.2734 18.8665L14.75 23.3373L15.8887 24.4746L16.9434 23.2587L25.7539 13.0977Z',
+ },
+ chevron: {
+ viewBox: '0 0 12 7',
+ path: 'M11 1L6 6L1 1',
+ strokeOpacity: 0.5,
+ strokeWidth: 1.5,
+ strokeLinecap: 'round',
+ strokeLinejoin: 'round',
+ },
+ search: {
+ viewBox: '0 0 14 14',
+ fillRule: 'evenodd',
+ clipRule: 'evenodd',
+ path:
+ 'M8.39404 5.19727C8.39404 6.96289 6.96265 8.39453 5.19702 8.39453C3.4314 8.39453 2 6.96289 2 5.19727C2 3.43164 3.4314 2 5.19702 2C6.96265 2 8.39404 3.43164 8.39404 5.19727ZM8.09668 9.51074C7.26855 10.0684 6.27075 10.3945 5.19702 10.3945C2.3269 10.3945 0 8.06738 0 5.19727C0 2.32715 2.3269 0 5.19702 0C8.06738 0 10.394 2.32715 10.394 5.19727C10.394 6.27051 10.0686 7.26855 9.51074 8.09668L13.6997 12.2861L12.2854 13.7002L8.09668 9.51074Z',
+ },
+};
+
+export interface IconProps {
+ className?: string;
+ width: number;
+ height?: number;
+ color?: ColorOption;
+ stroke?: ColorOption;
+ icon: keyof IconInfoMapping;
+ onClick?: (event: React.MouseEvent<HTMLElement>) => void;
+ padding?: string;
+ theme: Theme;
+}
+const PlainIcon: React.StatelessComponent<IconProps> = props => {
+ const iconInfo = ICONS[props.icon];
+ const colorValue = _.isUndefined(props.color) ? undefined : props.theme[props.color];
+ const strokeValue = _.isUndefined(props.stroke) ? undefined : props.theme[props.stroke];
+ return (
+ <div onClick={props.onClick} className={props.className}>
+ <svg
+ width={props.width}
+ height={props.height}
+ viewBox={iconInfo.viewBox}
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ >
+ <path
+ d={iconInfo.path}
+ fill={colorValue}
+ fillRule={iconInfo.fillRule || 'nonzero'}
+ clipRule={iconInfo.clipRule || 'nonzero'}
+ stroke={strokeValue}
+ strokeOpacity={iconInfo.strokeOpacity}
+ strokeWidth={iconInfo.strokeWidth}
+ strokeLinecap={iconInfo.strokeLinecap}
+ strokeLinejoin={iconInfo.strokeLinejoin}
+ />
+ </svg>
+ </div>
+ );
+};
+
+export const Icon = withTheme(styled(PlainIcon)`
+ && {
+ display: inline-block;
+ ${props => (!_.isUndefined(props.onClick) ? 'cursor: pointer' : '')};
+ transition: opacity 0.5s ease;
+ padding: ${props => props.padding};
+ opacity: ${props => (!_.isUndefined(props.onClick) ? 0.7 : 1)};
+ &:hover {
+ opacity: 1;
+ }
+ &:active {
+ opacity: 1;
+ }
+ }
+`);
+
+Icon.defaultProps = {
+ padding: '0em 0em',
+};
+
+Icon.displayName = 'Icon';
diff --git a/packages/instant/src/components/ui/index.ts b/packages/instant/src/components/ui/index.ts
deleted file mode 100644
index bf5f6c700..000000000
--- a/packages/instant/src/components/ui/index.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-export { Text, Title } from './text';
-export { Button } from './button';
-export { Flex } from './flex';
-export { Container } from './container';
-export { Input } from './input';
diff --git a/packages/instant/src/components/ui/input.tsx b/packages/instant/src/components/ui/input.tsx
index f8c6b6ef6..2fb408db4 100644
--- a/packages/instant/src/components/ui/input.tsx
+++ b/packages/instant/src/components/ui/input.tsx
@@ -12,22 +12,24 @@ export interface InputProps {
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
}
-const PlainInput: React.StatelessComponent<InputProps> = ({ value, className, placeholder, onChange }) => (
- <input className={className} value={value} onChange={onChange} placeholder={placeholder} />
-);
-
-export const Input = styled(PlainInput)`
- font-size: ${props => props.fontSize};
- width: ${props => props.width};
- padding: 0.1em 0em;
- font-family: 'Inter UI';
- color: ${props => props.theme[props.fontColor || 'white']};
- background: transparent;
- outline: none;
- border: none;
- &::placeholder {
+export const Input =
+ styled.input <
+ InputProps >
+ `
+ && {
+ all: initial;
+ font-size: ${props => props.fontSize};
+ width: ${props => props.width};
+ padding: 0.1em 0em;
+ font-family: 'Inter UI';
color: ${props => props.theme[props.fontColor || 'white']};
- opacity: 0.5;
+ background: transparent;
+ outline: none;
+ border: none;
+ &::placeholder {
+ color: ${props => props.theme[props.fontColor || 'white']};
+ opacity: 0.5;
+ }
}
`;
diff --git a/packages/instant/src/components/ui/overlay.tsx b/packages/instant/src/components/ui/overlay.tsx
new file mode 100644
index 000000000..f67d6fb2f
--- /dev/null
+++ b/packages/instant/src/components/ui/overlay.tsx
@@ -0,0 +1,39 @@
+import * as _ from 'lodash';
+
+import { generateMediaWrapper, ScreenWidths } from '../../style/media';
+import { generateOverlayBlack, styled } from '../../style/theme';
+import { zIndex } from '../../style/z_index';
+
+export interface OverlayProps {
+ zIndex?: number;
+ backgroundColor?: string;
+ width?: string;
+ height?: string;
+ showMaxWidth?: ScreenWidths;
+}
+
+export const Overlay =
+ styled.div <
+ OverlayProps >
+ `
+ && {
+ position: fixed;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ z-index: ${props => props.zIndex}
+ background-color: ${props => props.backgroundColor};
+ ${props => props.width && `width: ${props.width};`}
+ ${props => props.height && `height: ${props.height};`}
+ display: ${props => (props.showMaxWidth ? 'none' : 'block')};
+ ${props => props.showMaxWidth && generateMediaWrapper(props.showMaxWidth)`display: block;`}
+ }
+`;
+
+Overlay.defaultProps = {
+ zIndex: zIndex.overlayDefault,
+ backgroundColor: generateOverlayBlack(0.6),
+};
+
+Overlay.displayName = 'Overlay';
diff --git a/packages/instant/src/components/ui/spinner.tsx b/packages/instant/src/components/ui/spinner.tsx
new file mode 100644
index 000000000..28ebc2598
--- /dev/null
+++ b/packages/instant/src/components/ui/spinner.tsx
@@ -0,0 +1,30 @@
+import * as React from 'react';
+
+import { FullRotation } from '../animations/full_rotation';
+
+export interface SpinnerProps {
+ widthPx: number;
+ heightPx: number;
+}
+export const Spinner: React.StatelessComponent<SpinnerProps> = props => {
+ return (
+ <FullRotation width={`${props.widthPx}px`} height={`${props.heightPx}px`}>
+ <svg
+ width={props.widthPx}
+ height={props.heightPx}
+ viewBox="0 0 34 34"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ >
+ <circle cx="17" cy="17" r="15" stroke="white" strokeOpacity="0.2" strokeWidth="4" />
+ <path
+ d="M17 32C25.2843 32 32 25.2843 32 17C32 8.71573 25.2843 2 17 2"
+ stroke="white"
+ strokeWidth="4"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ />
+ </svg>
+ </FullRotation>
+ );
+};
diff --git a/packages/instant/src/components/ui/text.tsx b/packages/instant/src/components/ui/text.tsx
index 9fb8ea26f..4fe429d25 100644
--- a/packages/instant/src/components/ui/text.tsx
+++ b/packages/instant/src/components/ui/text.tsx
@@ -18,40 +18,36 @@ export interface TextProps {
fontWeight?: number | string;
textDecorationLine?: string;
onClick?: (event: React.MouseEvent<HTMLElement>) => void;
- hoverColor?: string;
noWrap?: boolean;
display?: string;
}
-const PlainText: React.StatelessComponent<TextProps> = ({ children, className, onClick }) => (
- <div className={className} onClick={onClick}>
- {children}
- </div>
-);
-
const darkenOnHoverAmount = 0.3;
-export const Text = styled(PlainText)`
- font-family: ${props => props.fontFamily};
- font-style: ${props => props.fontStyle};
- font-weight: ${props => props.fontWeight};
- font-size: ${props => props.fontSize};
- opacity: ${props => props.opacity};
- text-decoration-line: ${props => props.textDecorationLine};
- ${props => (props.lineHeight ? `line-height: ${props.lineHeight}` : '')};
- ${props => (props.center ? 'text-align: center' : '')};
- color: ${props => props.fontColor && props.theme[props.fontColor]};
- ${props => (props.minHeight ? `min-height: ${props.minHeight}` : '')};
- ${props => (props.onClick ? 'cursor: pointer' : '')};
- transition: color 0.5s ease;
- ${props => (props.noWrap ? 'white-space: nowrap' : '')};
- ${props => (props.display ? `display: ${props.display}` : '')};
- ${props => (props.letterSpacing ? `letter-spacing: ${props.letterSpacing}` : '')};
- ${props => (props.textTransform ? `text-transform: ${props.textTransform}` : '')};
- &:hover {
- ${props =>
- props.onClick
- ? `color: ${props.hoverColor || darken(darkenOnHoverAmount, props.theme[props.fontColor || 'white'])}`
- : ''};
+export const Text =
+ styled.div <
+ TextProps >
+ `
+ && {
+ font-family: 'Inter UI', sans-serif;
+ font-style: ${props => props.fontStyle};
+ font-weight: ${props => props.fontWeight};
+ font-size: ${props => props.fontSize};
+ opacity: ${props => props.opacity};
+ text-decoration-line: ${props => props.textDecorationLine};
+ ${props => (props.lineHeight ? `line-height: ${props.lineHeight}` : '')};
+ ${props => (props.center ? 'text-align: center' : '')};
+ color: ${props => props.fontColor && props.theme[props.fontColor]};
+ ${props => (props.minHeight ? `min-height: ${props.minHeight}` : '')};
+ ${props => (props.onClick ? 'cursor: pointer' : '')};
+ transition: color 0.5s ease;
+ ${props => (props.noWrap ? 'white-space: nowrap' : '')};
+ ${props => (props.display ? `display: ${props.display}` : '')};
+ ${props => (props.letterSpacing ? `letter-spacing: ${props.letterSpacing}` : '')};
+ ${props => (props.textTransform ? `text-transform: ${props.textTransform}` : '')};
+ &:hover {
+ ${props =>
+ props.onClick ? `color: ${darken(darkenOnHoverAmount, props.theme[props.fontColor || 'white'])}` : ''};
+ }
}
`;
@@ -67,14 +63,3 @@ Text.defaultProps = {
};
Text.displayName = 'Text';
-
-export const Title: React.StatelessComponent<TextProps> = props => <Text {...props} />;
-
-Title.defaultProps = {
- fontSize: '20px',
- fontWeight: 600,
- opacity: 1,
- fontColor: ColorOption.primaryColor,
-};
-
-Title.displayName = 'Title';
diff --git a/packages/instant/src/components/zero_ex_instant.tsx b/packages/instant/src/components/zero_ex_instant.tsx
index 0e6230d1b..b945f9908 100644
--- a/packages/instant/src/components/zero_ex_instant.tsx
+++ b/packages/instant/src/components/zero_ex_instant.tsx
@@ -1,20 +1,18 @@
import * as React from 'react';
-import { Provider } from 'react-redux';
-import { store } from '../redux/store';
-import { fonts } from '../style/fonts';
-import { theme, ThemeProvider } from '../style/theme';
+import { INJECTED_DIV_CLASS } from '../constants';
import { ZeroExInstantContainer } from './zero_ex_instant_container';
+import { ZeroExInstantProvider, ZeroExInstantProviderProps } from './zero_ex_instant_provider';
-fonts.include();
+export type ZeroExInstantProps = ZeroExInstantProviderProps;
-export interface ZeroExInstantProps {}
-
-export const ZeroExInstant: React.StatelessComponent<ZeroExInstantProps> = () => (
- <Provider store={store}>
- <ThemeProvider theme={theme}>
- <ZeroExInstantContainer />
- </ThemeProvider>
- </Provider>
-);
+export const ZeroExInstant: React.StatelessComponent<ZeroExInstantProps> = props => {
+ return (
+ <div className={INJECTED_DIV_CLASS}>
+ <ZeroExInstantProvider {...props}>
+ <ZeroExInstantContainer />
+ </ZeroExInstantProvider>
+ </div>
+ );
+};
diff --git a/packages/instant/src/components/zero_ex_instant_container.tsx b/packages/instant/src/components/zero_ex_instant_container.tsx
index 716227b51..5748e064e 100644
--- a/packages/instant/src/components/zero_ex_instant_container.tsx
+++ b/packages/instant/src/components/zero_ex_instant_container.tsx
@@ -1,20 +1,78 @@
import * as React from 'react';
+import { AvailableERC20TokenSelector } from '../containers/available_erc20_token_selector';
+import { LatestBuyQuoteOrderDetails } from '../containers/latest_buy_quote_order_details';
+import { LatestError } from '../containers/latest_error';
+import { SelectedAssetBuyOrderProgress } from '../containers/selected_asset_buy_order_progress';
+import { SelectedAssetBuyOrderStateButtons } from '../containers/selected_asset_buy_order_state_buttons';
+import { SelectedAssetInstantHeading } from '../containers/selected_asset_instant_heading';
import { ColorOption } from '../style/theme';
+import { zIndex } from '../style/z_index';
-import { BuyButton } from './buy_button';
-import { InstantHeading } from './instant_heading';
-import { OrderDetails } from './order_details';
-import { Container, Flex } from './ui';
+import { SlideAnimationState } from './animations/slide_animation';
+import { CSSReset } from './css_reset';
+import { SlidingPanel } from './sliding_panel';
+import { Container } from './ui/container';
+import { Flex } from './ui/flex';
export interface ZeroExInstantContainerProps {}
+export interface ZeroExInstantContainerState {
+ tokenSelectionPanelAnimationState: SlideAnimationState;
+}
-export const ZeroExInstantContainer: React.StatelessComponent<ZeroExInstantContainerProps> = props => (
- <Container hasBoxShadow={true} width="350px" backgroundColor={ColorOption.white} borderRadius="3px">
- <Flex direction="column" justify="flex-start">
- <InstantHeading />
- <OrderDetails />
- <BuyButton />
- </Flex>
- </Container>
-);
+export class ZeroExInstantContainer extends React.Component<ZeroExInstantContainerProps, ZeroExInstantContainerState> {
+ public state = {
+ tokenSelectionPanelAnimationState: 'none' as SlideAnimationState,
+ };
+ public render(): React.ReactNode {
+ return (
+ <React.Fragment>
+ <CSSReset />
+ <Container
+ width={{ default: '350px', sm: '100%' }}
+ height={{ default: 'auto', sm: '100%' }}
+ position="relative"
+ >
+ <Container position="relative">
+ <LatestError />
+ </Container>
+ <Container
+ zIndex={zIndex.mainContainer}
+ position="relative"
+ backgroundColor={ColorOption.white}
+ borderRadius="3px"
+ hasBoxShadow={true}
+ overflow="hidden"
+ height="100%"
+ >
+ <Flex direction="column" justify="flex-start" height="100%">
+ <SelectedAssetInstantHeading onSelectAssetClick={this._handleSymbolClick} />
+ <SelectedAssetBuyOrderProgress />
+ <LatestBuyQuoteOrderDetails />
+ <Container padding="20px" width="100%">
+ <SelectedAssetBuyOrderStateButtons />
+ </Container>
+ </Flex>
+ <SlidingPanel
+ title="Select Token"
+ animationState={this.state.tokenSelectionPanelAnimationState}
+ onClose={this._handlePanelClose}
+ >
+ <AvailableERC20TokenSelector onTokenSelect={this._handlePanelClose} />
+ </SlidingPanel>
+ </Container>
+ </Container>
+ </React.Fragment>
+ );
+ }
+ private readonly _handleSymbolClick = (): void => {
+ this.setState({
+ tokenSelectionPanelAnimationState: 'slidIn',
+ });
+ };
+ private readonly _handlePanelClose = (): void => {
+ this.setState({
+ tokenSelectionPanelAnimationState: 'slidOut',
+ });
+ };
+}
diff --git a/packages/instant/src/components/zero_ex_instant_overlay.tsx b/packages/instant/src/components/zero_ex_instant_overlay.tsx
new file mode 100644
index 000000000..10438ab7a
--- /dev/null
+++ b/packages/instant/src/components/zero_ex_instant_overlay.tsx
@@ -0,0 +1,40 @@
+import * as React from 'react';
+
+import { ColorOption } from '../style/theme';
+
+import { Container } from './ui/container';
+import { Flex } from './ui/flex';
+import { Icon } from './ui/icon';
+import { Overlay } from './ui/overlay';
+import { ZeroExInstantContainer } from './zero_ex_instant_container';
+import { ZeroExInstantProvider, ZeroExInstantProviderProps } from './zero_ex_instant_provider';
+
+export interface ZeroExInstantOverlayProps extends ZeroExInstantProviderProps {
+ onClose?: () => void;
+ zIndex?: number;
+}
+
+export const ZeroExInstantOverlay: React.StatelessComponent<ZeroExInstantOverlayProps> = props => {
+ const { onClose, zIndex, ...rest } = props;
+ return (
+ <ZeroExInstantProvider {...rest}>
+ <Overlay zIndex={zIndex}>
+ <Flex height="100vh">
+ <Container position="absolute" top="0px" right="0px" display={{ default: 'initial', sm: 'none' }}>
+ <Icon
+ height={18}
+ width={18}
+ color={ColorOption.white}
+ icon="closeX"
+ onClick={onClose}
+ padding="2em 2em"
+ />
+ </Container>
+ <Container width={{ default: 'auto', sm: '100%' }} height={{ default: 'auto', sm: '100%' }}>
+ <ZeroExInstantContainer />
+ </Container>
+ </Flex>
+ </Overlay>
+ </ZeroExInstantProvider>
+ );
+};
diff --git a/packages/instant/src/components/zero_ex_instant_provider.tsx b/packages/instant/src/components/zero_ex_instant_provider.tsx
new file mode 100644
index 000000000..411f118cc
--- /dev/null
+++ b/packages/instant/src/components/zero_ex_instant_provider.tsx
@@ -0,0 +1,149 @@
+import { ObjectMap } from '@0x/types';
+import { BigNumber } from '@0x/utils';
+import { Provider } from 'ethereum-types';
+import * as _ from 'lodash';
+import * as React from 'react';
+import { Provider as ReduxProvider } from 'react-redux';
+
+import { ACCOUNT_UPDATE_INTERVAL_TIME_MS, BUY_QUOTE_UPDATE_INTERVAL_TIME_MS } from '../constants';
+import { SelectedAssetThemeProvider } from '../containers/selected_asset_theme_provider';
+import { asyncData } from '../redux/async_data';
+import { DEFAULT_STATE, DefaultState, State } from '../redux/reducer';
+import { store, Store } from '../redux/store';
+import { fonts } from '../style/fonts';
+import { AccountState, AffiliateInfo, AssetMetaData, Network, OrderSource } from '../types';
+import { assetUtils } from '../util/asset';
+import { errorFlasher } from '../util/error_flasher';
+import { gasPriceEstimator } from '../util/gas_price_estimator';
+import { Heartbeater } from '../util/heartbeater';
+import { generateAccountHeartbeater, generateBuyQuoteHeartbeater } from '../util/heartbeater_factory';
+import { providerStateFactory } from '../util/provider_state_factory';
+
+fonts.include();
+
+export type ZeroExInstantProviderProps = ZeroExInstantProviderRequiredProps &
+ Partial<ZeroExInstantProviderOptionalProps>;
+
+export interface ZeroExInstantProviderRequiredProps {
+ orderSource: OrderSource;
+}
+
+export interface ZeroExInstantProviderOptionalProps {
+ provider: Provider;
+ availableAssetDatas: string[];
+ defaultAssetBuyAmount: number;
+ defaultSelectedAssetData: string;
+ additionalAssetMetaDataMap: ObjectMap<AssetMetaData>;
+ networkId: Network;
+ affiliateInfo: AffiliateInfo;
+}
+
+export class ZeroExInstantProvider extends React.Component<ZeroExInstantProviderProps> {
+ private readonly _store: Store;
+ private _accountUpdateHeartbeat?: Heartbeater;
+ private _buyQuoteHeartbeat?: Heartbeater;
+
+ // TODO(fragosti): Write tests for this beast once we inject a provider.
+ private static _mergeDefaultStateWithProps(
+ props: ZeroExInstantProviderProps,
+ defaultState: DefaultState = DEFAULT_STATE,
+ ): State {
+ // use the networkId passed in with the props, otherwise default to that of the default state (1, mainnet)
+ const networkId = props.networkId || defaultState.network;
+ // construct the ProviderState
+ const providerState = providerStateFactory.getInitialProviderState(
+ props.orderSource,
+ networkId,
+ props.provider,
+ );
+ // merge the additional additionalAssetMetaDataMap with our default map
+ const completeAssetMetaDataMap = {
+ ...props.additionalAssetMetaDataMap,
+ ...defaultState.assetMetaDataMap,
+ };
+ // construct the final state
+ const storeStateFromProps: State = {
+ ...defaultState,
+ providerState,
+ network: networkId,
+ selectedAsset: _.isUndefined(props.defaultSelectedAssetData)
+ ? undefined
+ : assetUtils.createAssetFromAssetDataOrThrow(
+ props.defaultSelectedAssetData,
+ completeAssetMetaDataMap,
+ networkId,
+ ),
+ selectedAssetAmount: _.isUndefined(props.defaultAssetBuyAmount)
+ ? undefined
+ : new BigNumber(props.defaultAssetBuyAmount),
+ availableAssets: _.isUndefined(props.availableAssetDatas)
+ ? undefined
+ : assetUtils.createAssetsFromAssetDatas(props.availableAssetDatas, completeAssetMetaDataMap, networkId),
+ assetMetaDataMap: completeAssetMetaDataMap,
+ affiliateInfo: props.affiliateInfo,
+ };
+ return storeStateFromProps;
+ }
+ constructor(props: ZeroExInstantProviderProps) {
+ super(props);
+ const initialAppState = ZeroExInstantProvider._mergeDefaultStateWithProps(this.props);
+ this._store = store.create(initialAppState);
+ }
+ public componentDidMount(): void {
+ const state = this._store.getState();
+ // tslint:disable-next-line:no-floating-promises
+ asyncData.fetchEthPriceAndDispatchToStore(this._store);
+ // fetch available assets if none are specified
+ if (_.isUndefined(state.availableAssets)) {
+ // tslint:disable-next-line:no-floating-promises
+ asyncData.fetchAvailableAssetDatasAndDispatchToStore(this._store);
+ }
+ if (state.providerState.account.state !== AccountState.None) {
+ this._accountUpdateHeartbeat = generateAccountHeartbeater({
+ store: this._store,
+ shouldPerformImmediatelyOnStart: true,
+ });
+ this._accountUpdateHeartbeat.start(ACCOUNT_UPDATE_INTERVAL_TIME_MS);
+ }
+
+ this._buyQuoteHeartbeat = generateBuyQuoteHeartbeater({
+ store: this._store,
+ shouldPerformImmediatelyOnStart: false,
+ });
+ this._buyQuoteHeartbeat.start(BUY_QUOTE_UPDATE_INTERVAL_TIME_MS);
+ // tslint:disable-next-line:no-floating-promises
+ asyncData.fetchCurrentBuyQuoteAndDispatchToStore({ store: this._store, shouldSetPending: true });
+ // warm up the gas price estimator cache just in case we can't
+ // grab the gas price estimate when submitting the transaction
+ // tslint:disable-next-line:no-floating-promises
+ gasPriceEstimator.getGasInfoAsync();
+ // tslint:disable-next-line:no-floating-promises
+ this._flashErrorIfWrongNetwork();
+ }
+ public componentWillUnmount(): void {
+ if (this._accountUpdateHeartbeat) {
+ this._accountUpdateHeartbeat.stop();
+ }
+ if (this._buyQuoteHeartbeat) {
+ this._buyQuoteHeartbeat.stop();
+ }
+ }
+ public render(): React.ReactNode {
+ return (
+ <ReduxProvider store={this._store}>
+ <SelectedAssetThemeProvider>{this.props.children}</SelectedAssetThemeProvider>
+ </ReduxProvider>
+ );
+ }
+ private readonly _flashErrorIfWrongNetwork = async (): Promise<void> => {
+ const msToShowError = 30000; // 30 seconds
+ const state = this._store.getState();
+ const network = state.network;
+ const web3Wrapper = state.providerState.web3Wrapper;
+ const networkOfProvider = await web3Wrapper.getNetworkIdAsync();
+ if (network !== networkOfProvider) {
+ const errorMessage = `Wrong network detected. Try switching to ${Network[network]}.`;
+ errorFlasher.flashNewErrorMessage(this._store.dispatch, errorMessage, msToShowError);
+ }
+ };
+}
diff --git a/packages/instant/src/constants.ts b/packages/instant/src/constants.ts
new file mode 100644
index 000000000..110a8248a
--- /dev/null
+++ b/packages/instant/src/constants.ts
@@ -0,0 +1,35 @@
+import { BigNumber } from '@0x/utils';
+
+import { AccountNotReady, AccountState, Network } from './types';
+
+export const BIG_NUMBER_ZERO = new BigNumber(0);
+export const ETH_DECIMALS = 18;
+export const DEFAULT_ZERO_EX_CONTAINER_SELECTOR = '#zeroExInstantContainer';
+export const INJECTED_DIV_CLASS = 'zeroExInstantResetRoot';
+export const INJECTED_DIV_ID = 'zeroExInstant';
+export const WEB_3_WRAPPER_TRANSACTION_FAILED_ERROR_MSG_PREFIX = 'Transaction failed';
+export const GWEI_IN_WEI = new BigNumber(1000000000);
+export const ONE_SECOND_MS = 1000;
+export const ONE_MINUTE_MS = ONE_SECOND_MS * 60;
+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_ESTIMATED_TRANSACTION_TIME_MS = ONE_MINUTE_MS * 2;
+export const ETH_GAS_STATION_API_BASE_URL = 'https://ethgasstation.info';
+export const COINBASE_API_BASE_URL = 'https://api.coinbase.com/v2';
+export const PROGRESS_STALL_AT_WIDTH = '95%';
+export const PROGRESS_FINISH_ANIMATION_TIME_MS = 200;
+export const ETHEREUM_NODE_URL_BY_NETWORK = {
+ [Network.Mainnet]: 'https://mainnet.infura.io/',
+ [Network.Kovan]: 'https://kovan.infura.io/',
+};
+export const BLOCK_POLLING_INTERVAL_MS = 10000; // 10s
+export const NO_ACCOUNT: AccountNotReady = {
+ state: AccountState.None,
+};
+export const LOADING_ACCOUNT: AccountNotReady = {
+ state: AccountState.Loading,
+};
+export const LOCKED_ACCOUNT: AccountNotReady = {
+ state: AccountState.Locked,
+};
diff --git a/packages/instant/src/containers/available_erc20_token_selector.ts b/packages/instant/src/containers/available_erc20_token_selector.ts
new file mode 100644
index 000000000..4d4218d22
--- /dev/null
+++ b/packages/instant/src/containers/available_erc20_token_selector.ts
@@ -0,0 +1,45 @@
+import * as _ from 'lodash';
+import * as React from 'react';
+import { connect } from 'react-redux';
+import { Dispatch } from 'redux';
+
+import { State } from '../redux/reducer';
+import { ERC20Asset } from '../types';
+import { assetUtils } from '../util/asset';
+
+import { ERC20TokenSelector } from '../components/erc20_token_selector';
+import { Action, actions } from '../redux/actions';
+
+export interface AvailableERC20TokenSelectorProps {
+ onTokenSelect?: (token: ERC20Asset) => void;
+}
+
+interface ConnectedState {
+ tokens: ERC20Asset[];
+}
+
+interface ConnectedDispatch {
+ onTokenSelect: (token: ERC20Asset) => void;
+}
+
+const mapStateToProps = (state: State, _ownProps: AvailableERC20TokenSelectorProps): ConnectedState => ({
+ tokens: assetUtils.getERC20AssetsFromAssets(state.availableAssets || []),
+});
+
+const mapDispatchToProps = (
+ dispatch: Dispatch<Action>,
+ ownProps: AvailableERC20TokenSelectorProps,
+): ConnectedDispatch => ({
+ onTokenSelect: (token: ERC20Asset) => {
+ dispatch(actions.updateSelectedAsset(token));
+ dispatch(actions.resetAmount());
+ if (ownProps.onTokenSelect) {
+ ownProps.onTokenSelect(token);
+ }
+ },
+});
+
+export const AvailableERC20TokenSelector: React.ComponentClass<AvailableERC20TokenSelectorProps> = connect(
+ mapStateToProps,
+ mapDispatchToProps,
+)(ERC20TokenSelector);
diff --git a/packages/instant/src/containers/latest_buy_quote_order_details.ts b/packages/instant/src/containers/latest_buy_quote_order_details.ts
new file mode 100644
index 000000000..2b59ed3ae
--- /dev/null
+++ b/packages/instant/src/containers/latest_buy_quote_order_details.ts
@@ -0,0 +1,30 @@
+import { BuyQuoteInfo } from '@0x/asset-buyer';
+import { BigNumber } from '@0x/utils';
+import * as _ from 'lodash';
+import * as React from 'react';
+import { connect } from 'react-redux';
+import { oc } from 'ts-optchain';
+
+import { State } from '../redux/reducer';
+
+import { OrderDetails } from '../components/order_details';
+import { AsyncProcessState } from '../types';
+
+export interface LatestBuyQuoteOrderDetailsProps {}
+
+interface ConnectedState {
+ buyQuoteInfo?: BuyQuoteInfo;
+ ethUsdPrice?: BigNumber;
+ isLoading: boolean;
+}
+
+const mapStateToProps = (state: State, _ownProps: LatestBuyQuoteOrderDetailsProps): ConnectedState => ({
+ // use the worst case quote info
+ buyQuoteInfo: oc(state).latestBuyQuote.worstCaseQuoteInfo(),
+ ethUsdPrice: state.ethUsdPrice,
+ isLoading: state.quoteRequestState === AsyncProcessState.Pending,
+});
+
+export const LatestBuyQuoteOrderDetails: React.ComponentClass<LatestBuyQuoteOrderDetailsProps> = connect(
+ mapStateToProps,
+)(OrderDetails);
diff --git a/packages/instant/src/containers/latest_error.tsx b/packages/instant/src/containers/latest_error.tsx
new file mode 100644
index 000000000..c0da181f1
--- /dev/null
+++ b/packages/instant/src/containers/latest_error.tsx
@@ -0,0 +1,60 @@
+import * as React from 'react';
+
+import { connect } from 'react-redux';
+import { Dispatch } from 'redux';
+
+import { SlideAnimationState } from '../components/animations/slide_animation';
+import { SlidingError } from '../components/sliding_error';
+import { Overlay } from '../components/ui/overlay';
+import { Action } from '../redux/actions';
+import { State } from '../redux/reducer';
+import { ScreenWidths } from '../style/media';
+import { generateOverlayBlack } from '../style/theme';
+import { zIndex } from '../style/z_index';
+import { Asset, DisplayStatus, Omit } from '../types';
+import { errorFlasher } from '../util/error_flasher';
+
+export interface LatestErrorComponentProps {
+ asset?: Asset;
+ latestErrorMessage?: string;
+ animationState: SlideAnimationState;
+ shouldRenderOverlay: boolean;
+ onOverlayClick: () => void;
+}
+
+export const LatestErrorComponent: React.StatelessComponent<LatestErrorComponentProps> = props => {
+ if (!props.latestErrorMessage) {
+ return <div />;
+ }
+ return (
+ <React.Fragment>
+ <SlidingError animationState={props.animationState} icon="😢" message={props.latestErrorMessage} />
+ {props.shouldRenderOverlay && (
+ <Overlay
+ onClick={props.onOverlayClick}
+ zIndex={zIndex.containerOverlay}
+ showMaxWidth={ScreenWidths.Sm}
+ backgroundColor={generateOverlayBlack(0.4)}
+ />
+ )}
+ </React.Fragment>
+ );
+};
+
+export interface LatestErrorProps {}
+interface ConnectedState extends Omit<LatestErrorComponentProps, 'onOverlayClick'> {}
+const mapStateToProps = (state: State, _ownProps: LatestErrorProps): ConnectedState => ({
+ asset: state.selectedAsset,
+ latestErrorMessage: state.latestErrorMessage,
+ animationState: state.latestErrorDisplayStatus === DisplayStatus.Present ? 'slidIn' : 'slidOut',
+ shouldRenderOverlay: state.latestErrorDisplayStatus === DisplayStatus.Present,
+});
+
+type ConnectedDispatch = Pick<LatestErrorComponentProps, 'onOverlayClick'>;
+const mapDispatchToProps = (dispatch: Dispatch<Action>, _ownProps: LatestErrorProps): ConnectedDispatch => ({
+ onOverlayClick: () => {
+ errorFlasher.clearError(dispatch);
+ },
+});
+
+export const LatestError = connect(mapStateToProps, mapDispatchToProps)(LatestErrorComponent);
diff --git a/packages/instant/src/containers/selected_asset_amount_input.tsx b/packages/instant/src/containers/selected_asset_amount_input.tsx
deleted file mode 100644
index 800a4c568..000000000
--- a/packages/instant/src/containers/selected_asset_amount_input.tsx
+++ /dev/null
@@ -1,36 +0,0 @@
-import { BigNumber } from '@0xproject/utils';
-import * as React from 'react';
-import { connect } from 'react-redux';
-import { Dispatch } from 'redux';
-
-import { State } from '../redux/reducer';
-import { ColorOption } from '../style/theme';
-import { Action, ActionTypes } from '../types';
-
-import { AmountInput } from '../components/amount_input';
-
-export interface SelectedAssetAmountInputProps {
- fontColor?: ColorOption;
- fontSize?: string;
-}
-
-interface ConnectedState {
- value?: BigNumber;
-}
-
-interface ConnectedDispatch {
- onChange?: (value?: BigNumber) => void;
-}
-
-const mapStateToProps = (state: State, _ownProps: SelectedAssetAmountInputProps): ConnectedState => ({
- value: state.selectedAssetAmount,
-});
-
-const mapDispatchToProps = (dispatch: Dispatch<Action>): ConnectedDispatch => ({
- onChange: value => dispatch({ type: ActionTypes.UPDATE_SELECTED_ASSET_AMOUNT, data: value }),
-});
-
-export const SelectedAssetAmountInput: React.ComponentClass<SelectedAssetAmountInputProps> = connect(
- mapStateToProps,
- mapDispatchToProps,
-)(AmountInput);
diff --git a/packages/instant/src/containers/selected_asset_buy_order_progress.ts b/packages/instant/src/containers/selected_asset_buy_order_progress.ts
new file mode 100644
index 000000000..7c8c24676
--- /dev/null
+++ b/packages/instant/src/containers/selected_asset_buy_order_progress.ts
@@ -0,0 +1,13 @@
+import { connect } from 'react-redux';
+
+import { BuyOrderProgress } from '../components/buy_order_progress';
+import { State } from '../redux/reducer';
+import { OrderState } from '../types';
+
+interface ConnectedState {
+ buyOrderState: OrderState;
+}
+const mapStateToProps = (state: State, _ownProps: {}): ConnectedState => ({
+ buyOrderState: state.buyOrderState,
+});
+export const SelectedAssetBuyOrderProgress = connect(mapStateToProps)(BuyOrderProgress);
diff --git a/packages/instant/src/containers/selected_asset_buy_order_state_buttons.ts b/packages/instant/src/containers/selected_asset_buy_order_state_buttons.ts
new file mode 100644
index 000000000..610335243
--- /dev/null
+++ b/packages/instant/src/containers/selected_asset_buy_order_state_buttons.ts
@@ -0,0 +1,104 @@
+import { AssetBuyer, AssetBuyerError, BuyQuote } from '@0x/asset-buyer';
+import { BigNumber } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
+import * as _ from 'lodash';
+import * as React from 'react';
+import { connect } from 'react-redux';
+import { Dispatch } from 'redux';
+
+import { BuyOrderStateButtons } from '../components/buy_order_state_buttons';
+import { Action, actions } from '../redux/actions';
+import { State } from '../redux/reducer';
+import { AccountState, AffiliateInfo, OrderProcessState, ZeroExInstantError } from '../types';
+import { errorFlasher } from '../util/error_flasher';
+import { etherscanUtil } from '../util/etherscan';
+
+interface ConnectedState {
+ accountAddress?: string;
+ accountEthBalanceInWei?: BigNumber;
+ buyQuote?: BuyQuote;
+ buyOrderProcessingState: OrderProcessState;
+ assetBuyer: AssetBuyer;
+ web3Wrapper: Web3Wrapper;
+ affiliateInfo?: AffiliateInfo;
+ onViewTransaction: () => void;
+}
+
+interface ConnectedDispatch {
+ onValidationPending: (buyQuote: BuyQuote) => void;
+ onSignatureDenied: (buyQuote: BuyQuote) => void;
+ onBuyProcessing: (buyQuote: BuyQuote, txHash: string, startTimeUnix: number, expectedEndTimeUnix: number) => void;
+ onBuySuccess: (buyQuote: BuyQuote, txHash: string) => void;
+ onBuyFailure: (buyQuote: BuyQuote, txHash: string) => void;
+ onRetry: () => void;
+ onValidationFail: (buyQuote: BuyQuote, errorMessage: AssetBuyerError | ZeroExInstantError) => void;
+}
+export interface SelectedAssetBuyOrderStateButtons {}
+const mapStateToProps = (state: State, _ownProps: SelectedAssetBuyOrderStateButtons): ConnectedState => {
+ const assetBuyer = state.providerState.assetBuyer;
+ const web3Wrapper = state.providerState.web3Wrapper;
+ const account = state.providerState.account;
+ const accountAddress = account.state === AccountState.Ready ? account.address : undefined;
+ const accountEthBalanceInWei = account.state === AccountState.Ready ? account.ethBalanceInWei : undefined;
+ return {
+ accountAddress,
+ accountEthBalanceInWei,
+ buyOrderProcessingState: state.buyOrderState.processState,
+ assetBuyer,
+ web3Wrapper,
+ buyQuote: state.latestBuyQuote,
+ affiliateInfo: state.affiliateInfo,
+ onViewTransaction: () => {
+ if (
+ state.buyOrderState.processState === OrderProcessState.Processing ||
+ state.buyOrderState.processState === OrderProcessState.Success ||
+ state.buyOrderState.processState === OrderProcessState.Failure
+ ) {
+ const etherscanUrl = etherscanUtil.getEtherScanTxnAddressIfExists(
+ state.buyOrderState.txHash,
+ assetBuyer.networkId,
+ );
+ if (etherscanUrl) {
+ window.open(etherscanUrl, '_blank');
+ return;
+ }
+ }
+ },
+ };
+};
+
+const mapDispatchToProps = (
+ dispatch: Dispatch<Action>,
+ ownProps: SelectedAssetBuyOrderStateButtons,
+): ConnectedDispatch => ({
+ onValidationPending: (buyQuote: BuyQuote) => {
+ dispatch(actions.setBuyOrderStateValidating());
+ },
+ onBuyProcessing: (buyQuote: BuyQuote, txHash: string, startTimeUnix: number, expectedEndTimeUnix: number) => {
+ dispatch(actions.setBuyOrderStateProcessing(txHash, startTimeUnix, expectedEndTimeUnix));
+ },
+ onBuySuccess: (buyQuote: BuyQuote, txHash: string) => dispatch(actions.setBuyOrderStateSuccess(txHash)),
+ onBuyFailure: (buyQuote: BuyQuote, txHash: string) => dispatch(actions.setBuyOrderStateFailure(txHash)),
+ onSignatureDenied: () => {
+ dispatch(actions.resetAmount());
+ const errorMessage = 'You denied this transaction';
+ errorFlasher.flashNewErrorMessage(dispatch, errorMessage);
+ },
+ onValidationFail: (buyQuote, error) => {
+ dispatch(actions.setBuyOrderStateNone());
+ if (error === ZeroExInstantError.InsufficientETH) {
+ const errorMessage = "You don't have enough ETH";
+ errorFlasher.flashNewErrorMessage(dispatch, errorMessage);
+ } else {
+ errorFlasher.flashNewErrorMessage(dispatch);
+ }
+ },
+ onRetry: () => {
+ dispatch(actions.resetAmount());
+ },
+});
+
+export const SelectedAssetBuyOrderStateButtons: React.ComponentClass<SelectedAssetBuyOrderStateButtons> = connect(
+ mapStateToProps,
+ mapDispatchToProps,
+)(BuyOrderStateButtons);
diff --git a/packages/instant/src/containers/selected_asset_instant_heading.ts b/packages/instant/src/containers/selected_asset_instant_heading.ts
new file mode 100644
index 000000000..a407279e6
--- /dev/null
+++ b/packages/instant/src/containers/selected_asset_instant_heading.ts
@@ -0,0 +1,34 @@
+import { BigNumber } from '@0x/utils';
+import * as _ from 'lodash';
+import * as React from 'react';
+import { connect } from 'react-redux';
+import { oc } from 'ts-optchain';
+
+import { State } from '../redux/reducer';
+import { AsyncProcessState, ERC20Asset, OrderState } from '../types';
+
+import { InstantHeading } from '../components/instant_heading';
+
+export interface InstantHeadingProps {
+ onSelectAssetClick?: (asset?: ERC20Asset) => void;
+}
+
+interface ConnectedState {
+ selectedAssetAmount?: BigNumber;
+ totalEthBaseAmount?: BigNumber;
+ ethUsdPrice?: BigNumber;
+ quoteRequestState: AsyncProcessState;
+ buyOrderState: OrderState;
+}
+
+const mapStateToProps = (state: State, _ownProps: InstantHeadingProps): ConnectedState => ({
+ selectedAssetAmount: state.selectedAssetAmount,
+ totalEthBaseAmount: oc(state).latestBuyQuote.worstCaseQuoteInfo.totalEthAmount(),
+ ethUsdPrice: state.ethUsdPrice,
+ quoteRequestState: state.quoteRequestState,
+ buyOrderState: state.buyOrderState,
+});
+
+export const SelectedAssetInstantHeading: React.ComponentClass<InstantHeadingProps> = connect(mapStateToProps)(
+ InstantHeading,
+);
diff --git a/packages/instant/src/containers/selected_asset_theme_provider.ts b/packages/instant/src/containers/selected_asset_theme_provider.ts
new file mode 100644
index 000000000..6e6b83d73
--- /dev/null
+++ b/packages/instant/src/containers/selected_asset_theme_provider.ts
@@ -0,0 +1,32 @@
+import * as _ from 'lodash';
+import * as React from 'react';
+import { connect } from 'react-redux';
+
+import { State } from '../redux/reducer';
+import { Theme, theme as defaultTheme, ThemeProvider } from '../style/theme';
+import { Asset } from '../types';
+
+export interface SelectedAssetThemeProviderProps {}
+
+interface ConnectedState {
+ theme: Theme;
+}
+
+const getTheme = (asset?: Asset): Theme => {
+ if (!_.isUndefined(asset) && !_.isUndefined(asset.metaData.primaryColor)) {
+ return {
+ ...defaultTheme,
+ primaryColor: asset.metaData.primaryColor,
+ };
+ }
+ return defaultTheme;
+};
+
+const mapStateToProps = (state: State, _ownProps: SelectedAssetThemeProviderProps): ConnectedState => {
+ const theme = getTheme(state.selectedAsset);
+ return { theme };
+};
+
+export const SelectedAssetThemeProvider: React.ComponentClass<SelectedAssetThemeProviderProps> = connect(
+ mapStateToProps,
+)(ThemeProvider);
diff --git a/packages/instant/src/containers/selected_erc20_asset_amount_input.ts b/packages/instant/src/containers/selected_erc20_asset_amount_input.ts
new file mode 100644
index 000000000..93ff3db70
--- /dev/null
+++ b/packages/instant/src/containers/selected_erc20_asset_amount_input.ts
@@ -0,0 +1,116 @@
+import { AssetBuyer } from '@0x/asset-buyer';
+import { AssetProxyId } from '@0x/types';
+import { BigNumber } from '@0x/utils';
+import * as _ from 'lodash';
+import * as React from 'react';
+import { connect } from 'react-redux';
+import { Dispatch } from 'redux';
+
+import { ERC20AssetAmountInput } from '../components/erc20_asset_amount_input';
+import { Action, actions } from '../redux/actions';
+import { State } from '../redux/reducer';
+import { ColorOption } from '../style/theme';
+import { AffiliateInfo, ERC20Asset, OrderProcessState } from '../types';
+import { buyQuoteUpdater } from '../util/buy_quote_updater';
+
+export interface SelectedERC20AssetAmountInputProps {
+ fontColor?: ColorOption;
+ startingFontSizePx: number;
+ onSelectAssetClick?: (asset?: ERC20Asset) => void;
+}
+
+interface ConnectedState {
+ assetBuyer: AssetBuyer;
+ value?: BigNumber;
+ asset?: ERC20Asset;
+ isDisabled: boolean;
+ numberOfAssetsAvailable?: number;
+ affiliateInfo?: AffiliateInfo;
+}
+
+interface ConnectedDispatch {
+ updateBuyQuote: (
+ assetBuyer: AssetBuyer,
+ value?: BigNumber,
+ asset?: ERC20Asset,
+ affiliateInfo?: AffiliateInfo,
+ ) => void;
+}
+
+interface ConnectedProps {
+ value?: BigNumber;
+ asset?: ERC20Asset;
+ onChange: (value?: BigNumber, asset?: ERC20Asset) => void;
+ isDisabled: boolean;
+ numberOfAssetsAvailable?: number;
+}
+
+type FinalProps = ConnectedProps & SelectedERC20AssetAmountInputProps;
+
+const mapStateToProps = (state: State, _ownProps: SelectedERC20AssetAmountInputProps): ConnectedState => {
+ const processState = state.buyOrderState.processState;
+ const isEnabled = processState === OrderProcessState.None || processState === OrderProcessState.Failure;
+ const isDisabled = !isEnabled;
+ const selectedAsset =
+ !_.isUndefined(state.selectedAsset) && state.selectedAsset.metaData.assetProxyId === AssetProxyId.ERC20
+ ? (state.selectedAsset as ERC20Asset)
+ : undefined;
+ const numberOfAssetsAvailable = _.isUndefined(state.availableAssets) ? undefined : state.availableAssets.length;
+ const assetBuyer = state.providerState.assetBuyer;
+ return {
+ assetBuyer,
+ value: state.selectedAssetAmount,
+ asset: selectedAsset,
+ isDisabled,
+ numberOfAssetsAvailable,
+ affiliateInfo: state.affiliateInfo,
+ };
+};
+
+const debouncedUpdateBuyQuoteAsync = _.debounce(buyQuoteUpdater.updateBuyQuoteAsync.bind(buyQuoteUpdater), 200, {
+ trailing: true,
+}) as typeof buyQuoteUpdater.updateBuyQuoteAsync;
+
+const mapDispatchToProps = (
+ dispatch: Dispatch<Action>,
+ _ownProps: SelectedERC20AssetAmountInputProps,
+): ConnectedDispatch => ({
+ updateBuyQuote: (assetBuyer, value, asset, affiliateInfo) => {
+ // Update the input
+ dispatch(actions.updateSelectedAssetAmount(value));
+ // invalidate the last buy quote.
+ dispatch(actions.updateLatestBuyQuote(undefined));
+ // reset our buy state
+ dispatch(actions.setBuyOrderStateNone());
+
+ if (!_.isUndefined(value) && value.greaterThan(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
+ debouncedUpdateBuyQuoteAsync(assetBuyer, dispatch, asset, value, true, affiliateInfo);
+ }
+ },
+});
+
+const mergeProps = (
+ connectedState: ConnectedState,
+ connectedDispatch: ConnectedDispatch,
+ ownProps: SelectedERC20AssetAmountInputProps,
+): FinalProps => {
+ return {
+ ...ownProps,
+ asset: connectedState.asset,
+ value: connectedState.value,
+ onChange: (value, asset) => {
+ connectedDispatch.updateBuyQuote(connectedState.assetBuyer, value, asset, connectedState.affiliateInfo);
+ },
+ isDisabled: connectedState.isDisabled,
+ numberOfAssetsAvailable: connectedState.numberOfAssetsAvailable,
+ };
+};
+
+export const SelectedERC20AssetAmountInput: React.ComponentClass<SelectedERC20AssetAmountInputProps> = connect(
+ mapStateToProps,
+ mapDispatchToProps,
+ mergeProps,
+)(ERC20AssetAmountInput);
diff --git a/packages/instant/src/data/asset_data_network_mapping.ts b/packages/instant/src/data/asset_data_network_mapping.ts
new file mode 100644
index 000000000..4fd0a25ed
--- /dev/null
+++ b/packages/instant/src/data/asset_data_network_mapping.ts
@@ -0,0 +1,66 @@
+import * as _ from 'lodash';
+
+import { Network } from '../types';
+
+interface AssetDataByNetwork {
+ [Network.Kovan]?: string;
+ [Network.Mainnet]?: string;
+}
+
+export const assetDataNetworkMapping: AssetDataByNetwork[] = [
+ // ZRX
+ {
+ [Network.Mainnet]: '0xf47261b0000000000000000000000000e41d2489571d322189246dafa5ebde1f4699f498',
+ [Network.Kovan]: '0xf47261b00000000000000000000000002002d3812f58e35f0ea1ffbf80a75a38c32175fa',
+ },
+ // SPANK
+ {
+ [Network.Mainnet]: '0xf47261b000000000000000000000000042d6622dece394b54999fbd73d108123806f6a18',
+ [Network.Kovan]: '0xf47261b00000000000000000000000007c9eee8448f3a7d1193389652d863b27e543272d',
+ },
+ // OMG
+ {
+ [Network.Mainnet]: '0xf47261b0000000000000000000000000d26114cd6ee289accf82350c8d8487fedb8a0c07',
+ [Network.Kovan]: '0xf47261b000000000000000000000000046096d8ec059dbaae2950b30e01634ff0dc652ec',
+ },
+ // MKR
+ {
+ [Network.Mainnet]: '0xf47261b00000000000000000000000009f8f72aa9304c8b593d555f12ef6589cc3a579a2',
+ // 0x Kovan MKR
+ [Network.Kovan]: '0xf47261b00000000000000000000000007b6b10caa9e8e9552ba72638ea5b47c25afea1f3',
+ },
+ // BAT
+ {
+ [Network.Mainnet]: '0xf47261b00000000000000000000000000d8775f648430679a709e98d2b0cb6250d2887ef',
+ [Network.Kovan]: '0xf47261b0000000000000000000000000c87faa7a58f0adf306bad9e7d892fb045a20e5af',
+ },
+ // SNT
+ {
+ [Network.Mainnet]: '0xf47261b0000000000000000000000000744d70fdbe2ba4cf95131626614a1763df805b9e',
+ [Network.Kovan]: '0xf47261b00000000000000000000000009cfe76a718ea75e3e8ce4fc7ad0fef84be70919b',
+ },
+ // MANA
+ {
+ [Network.Mainnet]: '0xf47261b00000000000000000000000000f5d2fb29fb7d3cfee444a200298f468908cc942',
+ [Network.Kovan]: '0xf47261b0000000000000000000000000c64edfc78321673435fbeebdaaa7f9d755963542',
+ },
+ // GNT
+ {
+ [Network.Mainnet]: '0xf47261b0000000000000000000000000a74476443119a942de498590fe1f2454d7d4ac0d',
+ // 0x Kovan GNT
+ [Network.Kovan]: '0xf47261b000000000000000000000000031fb614e223706f15d0d3c5f4b08bdf0d5c78623',
+ },
+ // SUB
+ {
+ [Network.Mainnet]: '0xf47261b000000000000000000000000012480e24eb5bec1a9d4369cab6a80cad3c0a377a',
+ },
+ // Dentacoin
+ {
+ [Network.Mainnet]: '0xf47261b000000000000000000000000008d32b0da63e2C3bcF8019c9c5d849d7a9d791e6',
+ },
+ // REP
+ {
+ [Network.Kovan]: '0xf47261b00000000000000000000000008cb3971b8eb709c14616bd556ff6683019e90d9c',
+ [Network.Mainnet]: '0xf47261b00000000000000000000000001985365e9f78359a9b6ad760e32412f4a445e862',
+ },
+];
diff --git a/packages/instant/src/data/asset_meta_data_map.ts b/packages/instant/src/data/asset_meta_data_map.ts
new file mode 100644
index 000000000..970b6c383
--- /dev/null
+++ b/packages/instant/src/data/asset_meta_data_map.ts
@@ -0,0 +1,85 @@
+import { AssetProxyId, ObjectMap } from '@0x/types';
+
+import { AssetMetaData } from '../types';
+
+// Map from assetData string to AssetMetaData object
+// TODO: import this from somewhere else.
+export const assetMetaDataMap: ObjectMap<AssetMetaData> = {
+ '0xf47261b0000000000000000000000000e41d2489571d322189246dafa5ebde1f4699f498': {
+ assetProxyId: AssetProxyId.ERC20,
+ decimals: 18,
+ primaryColor: 'rgb(54, 50, 60)',
+ symbol: 'zrx',
+ name: '0x',
+ },
+ '0xf47261b000000000000000000000000042d6622dece394b54999fbd73d108123806f6a18': {
+ assetProxyId: AssetProxyId.ERC20,
+ decimals: 18,
+ primaryColor: '#ec3e6c',
+ symbol: 'spank',
+ name: 'Spank',
+ },
+ '0xf47261b0000000000000000000000000d26114cd6ee289accf82350c8d8487fedb8a0c07': {
+ assetProxyId: AssetProxyId.ERC20,
+ decimals: 18,
+ primaryColor: '#2e61ea',
+ symbol: 'omg',
+ name: 'OmiseGo',
+ },
+ '0xf47261b00000000000000000000000009f8f72aa9304c8b593d555f12ef6589cc3a579a2': {
+ assetProxyId: AssetProxyId.ERC20,
+ decimals: 18,
+ primaryColor: '#87e4ca',
+ symbol: 'mkr',
+ name: 'Maker',
+ },
+ '0xf47261b00000000000000000000000000d8775f648430679a709e98d2b0cb6250d2887ef': {
+ assetProxyId: AssetProxyId.ERC20,
+ decimals: 18,
+ primaryColor: '#9c326c',
+ symbol: 'bat',
+ name: 'Basic Attention Token',
+ },
+ '0xf47261b0000000000000000000000000744d70fdbe2ba4cf95131626614a1763df805b9e': {
+ assetProxyId: AssetProxyId.ERC20,
+ decimals: 18,
+ primaryColor: '#5663b0',
+ symbol: 'snt',
+ name: 'Status',
+ },
+ '0xf47261b00000000000000000000000000f5d2fb29fb7d3cfee444a200298f468908cc942': {
+ assetProxyId: AssetProxyId.ERC20,
+ decimals: 18,
+ primaryColor: '#f08839',
+ symbol: 'mana',
+ name: 'Decentraland',
+ },
+ '0xf47261b0000000000000000000000000a74476443119a942de498590fe1f2454d7d4ac0d': {
+ assetProxyId: AssetProxyId.ERC20,
+ decimals: 18,
+ primaryColor: '#263469',
+ symbol: 'gnt',
+ name: 'Golem',
+ },
+ '0xf47261b000000000000000000000000012480e24eb5bec1a9d4369cab6a80cad3c0a377a': {
+ assetProxyId: AssetProxyId.ERC20,
+ decimals: 18,
+ primaryColor: '#de5445',
+ symbol: 'sub',
+ name: 'Substratum',
+ },
+ '0xf47261b000000000000000000000000008d32b0da63e2C3bcF8019c9c5d849d7a9d791e6': {
+ assetProxyId: AssetProxyId.ERC20,
+ decimals: 18,
+ primaryColor: '#000',
+ symbol: 'dentacoin',
+ name: 'Dentacoin',
+ },
+ '0xf47261b00000000000000000000000001985365e9f78359a9b6ad760e32412f4a445e862': {
+ assetProxyId: AssetProxyId.ERC20,
+ decimals: 18,
+ primaryColor: '#512D80',
+ symbol: 'rep',
+ name: 'Augur',
+ },
+};
diff --git a/packages/instant/src/index.ts b/packages/instant/src/index.ts
index 54059cdad..6e611dae8 100644
--- a/packages/instant/src/index.ts
+++ b/packages/instant/src/index.ts
@@ -1 +1,2 @@
export { ZeroExInstant, ZeroExInstantProps } from './components/zero_ex_instant';
+export { ZeroExInstantOverlay, ZeroExInstantOverlayProps } from './components/zero_ex_instant_overlay';
diff --git a/packages/instant/src/index.umd.ts b/packages/instant/src/index.umd.ts
index d4eca177d..0274db30c 100644
--- a/packages/instant/src/index.umd.ts
+++ b/packages/instant/src/index.umd.ts
@@ -1,10 +1,56 @@
+import * as _ from 'lodash';
import * as React from 'react';
import * as ReactDOM from 'react-dom';
-import { ZeroExInstant } from './index';
+import { DEFAULT_ZERO_EX_CONTAINER_SELECTOR, INJECTED_DIV_CLASS, INJECTED_DIV_ID } from './constants';
+import { ZeroExInstantOverlay, ZeroExInstantOverlayProps } from './index';
+import { assert } from './util/assert';
-export interface ZeroExInstantOptions {}
-
-export const render = (props: ZeroExInstantOptions, selector: string = '#zeroExInstantContainer') => {
- ReactDOM.render(React.createElement(ZeroExInstant, props), document.querySelector(selector));
+export const render = (props: ZeroExInstantOverlayProps, selector: string = DEFAULT_ZERO_EX_CONTAINER_SELECTOR) => {
+ assert.isValidOrderSource('orderSource', props.orderSource);
+ if (!_.isUndefined(props.defaultSelectedAssetData)) {
+ assert.isHexString('defaultSelectedAssetData', props.defaultSelectedAssetData);
+ }
+ if (!_.isUndefined(props.additionalAssetMetaDataMap)) {
+ assert.isValidAssetMetaDataMap('props.additionalAssetMetaDataMap', props.additionalAssetMetaDataMap);
+ }
+ if (!_.isUndefined(props.defaultAssetBuyAmount)) {
+ assert.isNumber('props.defaultAssetBuyAmount', props.defaultAssetBuyAmount);
+ }
+ if (!_.isUndefined(props.networkId)) {
+ assert.isNumber('props.networkId', props.networkId);
+ }
+ if (!_.isUndefined(props.availableAssetDatas)) {
+ assert.areValidAssetDatas('availableAssetDatas', props.availableAssetDatas);
+ }
+ if (!_.isUndefined(props.onClose)) {
+ assert.isFunction('props.onClose', props.onClose);
+ }
+ if (!_.isUndefined(props.zIndex)) {
+ assert.isNumber('props.zIndex', props.zIndex);
+ }
+ if (!_.isUndefined(props.affiliateInfo)) {
+ assert.isValidAffiliateInfo('props.affiliateInfo', props.affiliateInfo);
+ }
+ if (!_.isUndefined(props.provider)) {
+ assert.isWeb3Provider('props.provider', props.provider);
+ }
+ assert.isString('selector', selector);
+ const appendToIfExists = document.querySelector(selector);
+ assert.assert(!_.isNull(appendToIfExists), `Could not find div with selector: ${selector}`);
+ const appendTo = appendToIfExists as Element;
+ const injectedDiv = document.createElement('div');
+ injectedDiv.setAttribute('id', INJECTED_DIV_ID);
+ injectedDiv.setAttribute('class', INJECTED_DIV_CLASS);
+ appendTo.appendChild(injectedDiv);
+ const instantOverlayProps = {
+ ...props,
+ onClose: () => {
+ appendTo.removeChild(injectedDiv);
+ if (!_.isUndefined(props.onClose)) {
+ props.onClose();
+ }
+ },
+ };
+ ReactDOM.render(React.createElement(ZeroExInstantOverlay, instantOverlayProps), injectedDiv);
};
diff --git a/packages/instant/src/redux/actions.ts b/packages/instant/src/redux/actions.ts
new file mode 100644
index 000000000..8947c6c97
--- /dev/null
+++ b/packages/instant/src/redux/actions.ts
@@ -0,0 +1,69 @@
+import { BuyQuote } from '@0x/asset-buyer';
+import { BigNumber } from '@0x/utils';
+import * as _ from 'lodash';
+
+import { ActionsUnion, AddressAndEthBalanceInWei, Asset } from '../types';
+
+export interface PlainAction<T extends string> {
+ type: T;
+}
+
+export interface ActionWithPayload<T extends string, P> extends PlainAction<T> {
+ data: P;
+}
+
+export type Action = ActionsUnion<typeof actions>;
+
+function createAction<T extends string>(type: T): PlainAction<T>;
+function createAction<T extends string, P>(type: T, data: P): ActionWithPayload<T, P>;
+function createAction<T extends string, P>(type: T, data?: P): PlainAction<T> | ActionWithPayload<T, P> {
+ return _.isUndefined(data) ? { type } : { type, data };
+}
+
+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_AMOUNT = 'UPDATE_SELECTED_ASSET_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',
+}
+
+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),
+ 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_AMOUNT, amount),
+ setBuyOrderStateNone: () => createAction(ActionTypes.SET_BUY_ORDER_STATE_NONE),
+ setBuyOrderStateValidating: () => createAction(ActionTypes.SET_BUY_ORDER_STATE_VALIDATING),
+ 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),
+};
diff --git a/packages/instant/src/redux/async_data.ts b/packages/instant/src/redux/async_data.ts
new file mode 100644
index 000000000..b920ac914
--- /dev/null
+++ b/packages/instant/src/redux/async_data.ts
@@ -0,0 +1,103 @@
+import { AssetProxyId } from '@0x/types';
+import * as _ from 'lodash';
+
+import { BIG_NUMBER_ZERO } from '../constants';
+import { AccountState, ERC20Asset, OrderProcessState } from '../types';
+import { assetUtils } from '../util/asset';
+import { buyQuoteUpdater } from '../util/buy_quote_updater';
+import { coinbaseApi } from '../util/coinbase_api';
+import { errorFlasher } from '../util/error_flasher';
+
+import { actions } from './actions';
+import { Store } from './store';
+
+export const asyncData = {
+ fetchEthPriceAndDispatchToStore: async (store: Store) => {
+ try {
+ const ethUsdPrice = await coinbaseApi.getEthUsdPrice();
+ store.dispatch(actions.updateEthUsdPrice(ethUsdPrice));
+ } catch (e) {
+ const errorMessage = 'Error fetching ETH/USD price';
+ errorFlasher.flashNewErrorMessage(store.dispatch, errorMessage);
+ store.dispatch(actions.updateEthUsdPrice(BIG_NUMBER_ZERO));
+ }
+ },
+ fetchAvailableAssetDatasAndDispatchToStore: async (store: Store) => {
+ const { providerState, assetMetaDataMap, network } = store.getState();
+ const assetBuyer = providerState.assetBuyer;
+ try {
+ const assetDatas = await assetBuyer.getAvailableAssetDatasAsync();
+ const assets = assetUtils.createAssetsFromAssetDatas(assetDatas, assetMetaDataMap, network);
+ store.dispatch(actions.setAvailableAssets(assets));
+ } catch (e) {
+ const errorMessage = 'Could not find any assets';
+ errorFlasher.flashNewErrorMessage(store.dispatch, errorMessage);
+ // On error, just specify that none are available
+ store.dispatch(actions.setAvailableAssets([]));
+ }
+ },
+ fetchAccountInfoAndDispatchToStore: async (options: { store: Store; shouldSetToLoading: boolean }) => {
+ const { store, shouldSetToLoading } = options;
+ const { providerState } = store.getState();
+ const web3Wrapper = providerState.web3Wrapper;
+ const provider = providerState.provider;
+ if (shouldSetToLoading && providerState.account.state !== AccountState.Loading) {
+ store.dispatch(actions.setAccountStateLoading());
+ }
+ let availableAddresses: string[];
+ try {
+ // TODO(bmillman): Add support at the web3Wrapper level for calling `eth_requestAccounts` instead of calling enable here
+ const isPrivacyModeEnabled = !_.isUndefined((provider as any).enable);
+ availableAddresses = isPrivacyModeEnabled
+ ? await (provider as any).enable()
+ : await web3Wrapper.getAvailableAddressesAsync();
+ } catch (e) {
+ store.dispatch(actions.setAccountStateLocked());
+ return;
+ }
+ if (!_.isEmpty(availableAddresses)) {
+ const activeAddress = availableAddresses[0];
+ store.dispatch(actions.setAccountStateReady(activeAddress));
+ // tslint:disable-next-line:no-floating-promises
+ asyncData.fetchAccountBalanceAndDispatchToStore(store);
+ } else {
+ store.dispatch(actions.setAccountStateLocked());
+ }
+ },
+ fetchAccountBalanceAndDispatchToStore: async (store: Store) => {
+ const { providerState } = store.getState();
+ const web3Wrapper = providerState.web3Wrapper;
+ const account = providerState.account;
+ if (account.state !== AccountState.Ready) {
+ return;
+ }
+ try {
+ const address = account.address;
+ const ethBalanceInWei = await web3Wrapper.getBalanceInWeiAsync(address);
+ store.dispatch(actions.updateAccountEthBalance({ address, ethBalanceInWei }));
+ } catch (e) {
+ // leave balance as is
+ return;
+ }
+ },
+ fetchCurrentBuyQuoteAndDispatchToStore: async (options: { store: Store; shouldSetPending: boolean }) => {
+ const { store, shouldSetPending } = options;
+ const { buyOrderState, providerState, selectedAsset, selectedAssetAmount, affiliateInfo } = store.getState();
+ const assetBuyer = providerState.assetBuyer;
+ if (
+ !_.isUndefined(selectedAssetAmount) &&
+ !_.isUndefined(selectedAsset) &&
+ buyOrderState.processState === OrderProcessState.None &&
+ selectedAsset.metaData.assetProxyId === AssetProxyId.ERC20
+ ) {
+ await buyQuoteUpdater.updateBuyQuoteAsync(
+ assetBuyer,
+ store.dispatch,
+ selectedAsset as ERC20Asset,
+ selectedAssetAmount,
+ shouldSetPending,
+ affiliateInfo,
+ );
+ }
+ },
+};
diff --git a/packages/instant/src/redux/reducer.ts b/packages/instant/src/redux/reducer.ts
index 5026895ae..ef46fdd9d 100644
--- a/packages/instant/src/redux/reducer.ts
+++ b/packages/instant/src/redux/reducer.ts
@@ -1,31 +1,257 @@
-import { BigNumber } from '@0xproject/utils';
+import { BuyQuote } from '@0x/asset-buyer';
+import { AssetProxyId, ObjectMap } from '@0x/types';
+import { BigNumber } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import * as _ from 'lodash';
-import { Action, ActionTypes } from '../types';
+import { LOADING_ACCOUNT, LOCKED_ACCOUNT } from '../constants';
+import { assetMetaDataMap } from '../data/asset_meta_data_map';
+import {
+ Account,
+ AccountReady,
+ AccountState,
+ AffiliateInfo,
+ Asset,
+ AssetMetaData,
+ AsyncProcessState,
+ DisplayStatus,
+ Network,
+ OrderProcessState,
+ OrderState,
+ ProviderState,
+} from '../types';
-export interface State {
- ethUsdPrice?: string;
- selectedAssetAmount?: BigNumber;
+import { Action, ActionTypes } from './actions';
+
+// State that is required and we have defaults for, before props are passed in
+export interface DefaultState {
+ network: Network;
+ assetMetaDataMap: ObjectMap<AssetMetaData>;
+ buyOrderState: OrderState;
+ latestErrorDisplayStatus: DisplayStatus;
+ quoteRequestState: AsyncProcessState;
+}
+
+// State that is required but needs to be derived from the props
+interface PropsDerivedState {
+ providerState: ProviderState;
}
-export const INITIAL_STATE: State = {
- ethUsdPrice: undefined,
- selectedAssetAmount: undefined,
+// State that is optional
+interface OptionalState {
+ selectedAsset: Asset;
+ availableAssets: Asset[];
+ selectedAssetAmount: BigNumber;
+ ethUsdPrice: BigNumber;
+ latestBuyQuote: BuyQuote;
+ latestErrorMessage: string;
+ affiliateInfo: AffiliateInfo;
+}
+
+export type State = DefaultState & PropsDerivedState & Partial<OptionalState>;
+
+export const DEFAULT_STATE: DefaultState = {
+ network: Network.Mainnet,
+ assetMetaDataMap,
+ buyOrderState: { processState: OrderProcessState.None },
+ latestErrorDisplayStatus: DisplayStatus.Hidden,
+ quoteRequestState: AsyncProcessState.None,
};
-export const reducer = (state: State = INITIAL_STATE, action: Action): State => {
- switch (action.type) {
- case ActionTypes.UPDATE_ETH_USD_PRICE:
- return {
- ...state,
- ethUsdPrice: action.data,
- };
- case ActionTypes.UPDATE_SELECTED_ASSET_AMOUNT:
- return {
- ...state,
- selectedAssetAmount: action.data,
- };
- default:
- return state;
+export const createReducer = (initialState: State) => {
+ const reducer = (state: State = initialState, action: Action): State => {
+ switch (action.type) {
+ case ActionTypes.SET_ACCOUNT_STATE_LOADING:
+ return reduceStateWithAccount(state, LOADING_ACCOUNT);
+ case ActionTypes.SET_ACCOUNT_STATE_LOCKED:
+ return reduceStateWithAccount(state, LOCKED_ACCOUNT);
+ case ActionTypes.SET_ACCOUNT_STATE_READY: {
+ const account: AccountReady = {
+ state: AccountState.Ready,
+ address: action.data,
+ };
+ return reduceStateWithAccount(state, account);
+ }
+ case ActionTypes.UPDATE_ACCOUNT_ETH_BALANCE: {
+ const { address, ethBalanceInWei } = action.data;
+ const currentAccount = state.providerState.account;
+ if (currentAccount.state !== AccountState.Ready || currentAccount.address !== address) {
+ return state;
+ } else {
+ const newAccount: AccountReady = {
+ ...currentAccount,
+ ethBalanceInWei,
+ };
+ return reduceStateWithAccount(state, newAccount);
+ }
+ }
+ case ActionTypes.UPDATE_ETH_USD_PRICE:
+ return {
+ ...state,
+ ethUsdPrice: action.data,
+ };
+ case ActionTypes.UPDATE_SELECTED_ASSET_AMOUNT:
+ return {
+ ...state,
+ selectedAssetAmount: action.data,
+ };
+ case ActionTypes.UPDATE_LATEST_BUY_QUOTE:
+ const newBuyQuoteIfExists = action.data;
+ const shouldUpdate =
+ _.isUndefined(newBuyQuoteIfExists) || doesBuyQuoteMatchState(newBuyQuoteIfExists, state);
+ if (shouldUpdate) {
+ return {
+ ...state,
+ latestBuyQuote: newBuyQuoteIfExists,
+ quoteRequestState: AsyncProcessState.Success,
+ };
+ } else {
+ return state;
+ }
+ case ActionTypes.SET_QUOTE_REQUEST_STATE_PENDING:
+ return {
+ ...state,
+ latestBuyQuote: undefined,
+ quoteRequestState: AsyncProcessState.Pending,
+ };
+ case ActionTypes.SET_QUOTE_REQUEST_STATE_FAILURE:
+ return {
+ ...state,
+ latestBuyQuote: undefined,
+ quoteRequestState: AsyncProcessState.Failure,
+ };
+ case ActionTypes.SET_BUY_ORDER_STATE_NONE:
+ return {
+ ...state,
+ buyOrderState: { processState: OrderProcessState.None },
+ };
+ case ActionTypes.SET_BUY_ORDER_STATE_VALIDATING:
+ return {
+ ...state,
+ buyOrderState: { processState: OrderProcessState.Validating },
+ };
+ case ActionTypes.SET_BUY_ORDER_STATE_PROCESSING:
+ const processingData = action.data;
+ const { startTimeUnix, expectedEndTimeUnix } = processingData;
+ return {
+ ...state,
+ buyOrderState: {
+ processState: OrderProcessState.Processing,
+ txHash: processingData.txHash,
+ progress: {
+ startTimeUnix,
+ expectedEndTimeUnix,
+ },
+ },
+ };
+ case ActionTypes.SET_BUY_ORDER_STATE_FAILURE:
+ const failureTxHash = action.data;
+ if ('txHash' in state.buyOrderState) {
+ if (state.buyOrderState.txHash === failureTxHash) {
+ const { txHash, progress } = state.buyOrderState;
+ return {
+ ...state,
+ buyOrderState: {
+ processState: OrderProcessState.Failure,
+ txHash,
+ progress,
+ },
+ };
+ }
+ }
+ return state;
+ case ActionTypes.SET_BUY_ORDER_STATE_SUCCESS:
+ const successTxHash = action.data;
+ if ('txHash' in state.buyOrderState) {
+ if (state.buyOrderState.txHash === successTxHash) {
+ const { txHash, progress } = state.buyOrderState;
+ return {
+ ...state,
+ buyOrderState: {
+ processState: OrderProcessState.Success,
+ txHash,
+ progress,
+ },
+ };
+ }
+ }
+ return state;
+ case ActionTypes.SET_ERROR_MESSAGE:
+ return {
+ ...state,
+ latestErrorMessage: action.data,
+ latestErrorDisplayStatus: DisplayStatus.Present,
+ };
+ case ActionTypes.HIDE_ERROR:
+ return {
+ ...state,
+ latestErrorDisplayStatus: DisplayStatus.Hidden,
+ };
+ case ActionTypes.CLEAR_ERROR:
+ return {
+ ...state,
+ latestErrorMessage: undefined,
+ latestErrorDisplayStatus: DisplayStatus.Hidden,
+ };
+ case ActionTypes.UPDATE_SELECTED_ASSET:
+ return {
+ ...state,
+ selectedAsset: action.data,
+ };
+ case ActionTypes.RESET_AMOUNT:
+ return {
+ ...state,
+ latestBuyQuote: undefined,
+ quoteRequestState: AsyncProcessState.None,
+ buyOrderState: { processState: OrderProcessState.None },
+ selectedAssetAmount: undefined,
+ };
+ case ActionTypes.SET_AVAILABLE_ASSETS:
+ return {
+ ...state,
+ availableAssets: action.data,
+ };
+ default:
+ return state;
+ }
+ };
+ return reducer;
+};
+
+const reduceStateWithAccount = (state: State, account: Account) => {
+ const oldProviderState = state.providerState;
+ const newProviderState: ProviderState = {
+ ...oldProviderState,
+ account,
+ };
+ return {
+ ...state,
+ providerState: newProviderState,
+ };
+};
+
+const doesBuyQuoteMatchState = (buyQuote: BuyQuote, state: State): boolean => {
+ const selectedAssetIfExists = state.selectedAsset;
+ const selectedAssetAmountIfExists = state.selectedAssetAmount;
+ // if no selectedAsset or selectedAssetAmount exists on the current state, return false
+ if (_.isUndefined(selectedAssetIfExists) || _.isUndefined(selectedAssetAmountIfExists)) {
+ return false;
+ }
+ // if buyQuote's assetData does not match that of the current selected asset, return false
+ if (selectedAssetIfExists.assetData !== buyQuote.assetData) {
+ return false;
+ }
+ // if ERC20 and buyQuote's assetBuyAmount does not match selectedAssetAmount, return false
+ // if ERC721, return true
+ const selectedAssetMetaData = selectedAssetIfExists.metaData;
+ if (selectedAssetMetaData.assetProxyId === AssetProxyId.ERC20) {
+ const selectedAssetAmountBaseUnits = Web3Wrapper.toBaseUnitAmount(
+ selectedAssetAmountIfExists,
+ selectedAssetMetaData.decimals,
+ );
+ const doesAssetAmountMatch = selectedAssetAmountBaseUnits.eq(buyQuote.assetBuyAmount);
+ return doesAssetAmountMatch;
+ } else {
+ return true;
}
};
diff --git a/packages/instant/src/redux/store.ts b/packages/instant/src/redux/store.ts
index fcd19f9a8..20710765d 100644
--- a/packages/instant/src/redux/store.ts
+++ b/packages/instant/src/redux/store.ts
@@ -1,6 +1,14 @@
import * as _ from 'lodash';
import { createStore, Store as ReduxStore } from 'redux';
+import { devToolsEnhancer } from 'redux-devtools-extension/developmentOnly';
-import { reducer, State } from './reducer';
+import { createReducer, State } from './reducer';
-export const store: ReduxStore<State> = createStore(reducer);
+export type Store = ReduxStore<State>;
+
+export const store = {
+ create: (initialState: State): Store => {
+ const reducer = createReducer(initialState);
+ return createStore(reducer, initialState, devToolsEnhancer({}));
+ },
+};
diff --git a/packages/instant/src/style/fonts.ts b/packages/instant/src/style/fonts.ts
index 975a30a61..92450502d 100644
--- a/packages/instant/src/style/fonts.ts
+++ b/packages/instant/src/style/fonts.ts
@@ -1,10 +1,10 @@
-import { injectGlobal } from './theme';
-
export const fonts = {
include: () => {
// Inject the inter-ui font into the page
- return injectGlobal`
- @import url('https://rsms.me/inter/inter-ui.css');
- `;
+ const appendTo = document.head || document.getElementsByTagName('head')[0] || document.body;
+ const style = document.createElement('style');
+ style.type = 'text/css';
+ style.appendChild(document.createTextNode(`@import url('https://rsms.me/inter/inter-ui.css')`));
+ appendTo.appendChild(style);
},
};
diff --git a/packages/instant/src/style/media.ts b/packages/instant/src/style/media.ts
new file mode 100644
index 000000000..bbf376694
--- /dev/null
+++ b/packages/instant/src/style/media.ts
@@ -0,0 +1,51 @@
+import { InterpolationValue } from 'styled-components';
+
+import { css } from './theme';
+
+export enum ScreenWidths {
+ Sm = 40,
+ Md = 52,
+ Lg = 64,
+}
+
+export const generateMediaWrapper = (screenWidth: ScreenWidths) => (...args: any[]) => css`
+ @media (max-width: ${screenWidth}em) {
+ ${css.apply(css, args)};
+ }
+`;
+
+export const media = {
+ small: generateMediaWrapper(ScreenWidths.Sm),
+ medium: generateMediaWrapper(ScreenWidths.Md),
+ large: generateMediaWrapper(ScreenWidths.Lg),
+};
+
+export interface ScreenSpecification<T> {
+ default: T;
+ sm?: T;
+ md?: T;
+ lg?: T;
+}
+export type OptionallyScreenSpecific<T> = T | ScreenSpecification<T>;
+export type MediaChoice = OptionallyScreenSpecific<string>;
+/**
+ * Given a css property name and a OptionallyScreenSpecific value,
+ * generates css properties with screen-specific viewport styling
+ */
+export function stylesForMedia<T extends string | number>(
+ cssPropertyName: string,
+ choice: OptionallyScreenSpecific<T>,
+): InterpolationValue[] {
+ if (typeof choice === 'object') {
+ return css`
+ ${cssPropertyName}: ${choice.default};
+ ${choice.lg && media.large`${cssPropertyName}: ${choice.lg}`}
+ ${choice.md && media.medium`${cssPropertyName}: ${choice.md}`}
+ ${choice.sm && media.small`${cssPropertyName}: ${choice.sm}`}
+ `;
+ } else {
+ return css`
+ ${cssPropertyName}: ${choice};
+ `;
+ }
+}
diff --git a/packages/instant/src/style/theme.ts b/packages/instant/src/style/theme.ts
index cf9da5378..1e9f55e00 100644
--- a/packages/instant/src/style/theme.ts
+++ b/packages/instant/src/style/theme.ts
@@ -1,6 +1,6 @@
import * as styledComponents from 'styled-components';
-const { default: styled, css, injectGlobal, keyframes, ThemeProvider } = styledComponents;
+const { default: styled, css, keyframes, withTheme, createGlobalStyle, ThemeProvider } = styledComponents;
export type Theme = { [key in ColorOption]: string };
@@ -10,18 +10,35 @@ export enum ColorOption {
lightGrey = 'lightGrey',
grey = 'grey',
feintGrey = 'feintGrey',
+ lightestGrey = 'lightestGrey',
darkGrey = 'darkGrey',
white = 'white',
+ lightOrange = 'lightOrange',
+ darkOrange = 'darkOrange',
+ green = 'green',
+ red = 'red',
}
export const theme: Theme = {
- primaryColor: '#512D80',
+ primaryColor: '#333',
black: 'black',
lightGrey: '#999999',
grey: '#666666',
feintGrey: '#DEDEDE',
+ lightestGrey: '#EEEEEE',
darkGrey: '#333333',
white: 'white',
+ lightOrange: '#F9F2ED',
+ darkOrange: '#F2994C',
+ green: '#3CB34F',
+ red: '#D00000',
};
-export { styled, css, injectGlobal, keyframes, ThemeProvider };
+export const transparentWhite = 'rgba(255,255,255,0.3)';
+export const completelyTransparent = 'rga(0, 0, 0, 0)';
+
+export const generateOverlayBlack = (opacity = 0.6) => {
+ return `rgba(0, 0, 0, ${opacity})`;
+};
+
+export { styled, css, keyframes, withTheme, createGlobalStyle, ThemeProvider };
diff --git a/packages/instant/src/style/util.ts b/packages/instant/src/style/util.ts
index c9df0f834..3e38c4a7d 100644
--- a/packages/instant/src/style/util.ts
+++ b/packages/instant/src/style/util.ts
@@ -1,4 +1,4 @@
-import { ObjectMap } from '@0xproject/types';
+import { ObjectMap } from '@0x/types';
import * as _ from 'lodash';
export const cssRuleIfExists = (props: ObjectMap<any>, rule: string): string => {
diff --git a/packages/instant/src/style/z_index.ts b/packages/instant/src/style/z_index.ts
new file mode 100644
index 000000000..ba2d27a17
--- /dev/null
+++ b/packages/instant/src/style/z_index.ts
@@ -0,0 +1,9 @@
+export const zIndex = {
+ errorPopBehind: 10,
+ mainContainer: 20,
+ dropdownItems: 30,
+ panel: 40,
+ containerOverlay: 45,
+ errorPopup: 50,
+ overlayDefault: 100,
+};
diff --git a/packages/instant/src/types.ts b/packages/instant/src/types.ts
index d150bd8ab..b43a82d46 100644
--- a/packages/instant/src/types.ts
+++ b/packages/instant/src/types.ts
@@ -1,9 +1,127 @@
-export enum ActionTypes {
- UPDATE_ETH_USD_PRICE,
- UPDATE_SELECTED_ASSET_AMOUNT,
+import { AssetBuyer, BigNumber } from '@0x/asset-buyer';
+import { AssetProxyId, ObjectMap, SignedOrder } from '@0x/types';
+import { Web3Wrapper } from '@0x/web3-wrapper';
+import { Provider } from 'ethereum-types';
+
+// Reusable
+export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
+export type Maybe<T> = T | undefined;
+export enum AsyncProcessState {
+ None = 'NONE',
+ Pending = 'PENDING',
+ Success = 'SUCCESS',
+ Failure = 'FAILURE',
+}
+
+export enum OrderProcessState {
+ None = 'NONE',
+ Validating = 'VALIDATING',
+ Processing = 'PROCESSING',
+ Success = 'SUCCESS',
+ Failure = 'FAILURE',
+}
+
+export interface SimulatedProgress {
+ startTimeUnix: number;
+ expectedEndTimeUnix: number;
+}
+
+interface OrderStatePreTx {
+ processState: OrderProcessState.None | OrderProcessState.Validating;
+}
+interface OrderStatePostTx {
+ processState: OrderProcessState.Processing | OrderProcessState.Success | OrderProcessState.Failure;
+ txHash: string;
+ progress: SimulatedProgress;
+}
+export type OrderState = OrderStatePreTx | OrderStatePostTx;
+
+export enum DisplayStatus {
+ Present,
+ Hidden,
+}
+
+export type FunctionType = (...args: any[]) => any;
+export type ActionCreatorsMapObject = ObjectMap<FunctionType>;
+export type ActionsUnion<A extends ActionCreatorsMapObject> = ReturnType<A[keyof A]>;
+
+export interface ERC20AssetMetaData {
+ assetProxyId: AssetProxyId.ERC20;
+ decimals: number;
+ primaryColor?: string;
+ symbol: string;
+ name: string;
+}
+
+export interface ERC721AssetMetaData {
+ assetProxyId: AssetProxyId.ERC721;
+ name: string;
+ imageUrl?: string;
+ primaryColor?: string;
+}
+
+export type AssetMetaData = ERC20AssetMetaData | ERC721AssetMetaData;
+
+export interface ERC20Asset {
+ assetData: string;
+ metaData: ERC20AssetMetaData;
+}
+
+export interface ERC721Asset {
+ assetData: string;
+ metaData: ERC721AssetMetaData;
+}
+
+export interface Asset {
+ assetData: string;
+ metaData: AssetMetaData;
+}
+
+export enum Network {
+ Kovan = 42,
+ Mainnet = 1,
+}
+
+export enum ZeroExInstantError {
+ AssetMetaDataNotAvailable = 'ASSET_META_DATA_NOT_AVAILABLE',
+ InsufficientETH = 'INSUFFICIENT_ETH',
+}
+
+export type SimpleHandler = () => void;
+
+export interface AffiliateInfo {
+ feeRecipient: string;
+ feePercentage: number;
}
-export interface Action {
- type: ActionTypes;
- data?: any;
+export interface ProviderState {
+ provider: Provider;
+ assetBuyer: AssetBuyer;
+ web3Wrapper: Web3Wrapper;
+ account: Account;
+}
+
+export enum AccountState {
+ None = 'NONE,',
+ Loading = 'LOADING',
+ Ready = 'READY',
+ Locked = 'LOCKED',
+}
+
+export interface AccountReady {
+ state: AccountState.Ready;
+ address: string;
+ ethBalanceInWei?: BigNumber;
+}
+export interface AccountNotReady {
+ state: AccountState.None | AccountState.Loading | AccountState.Locked;
+}
+
+export type Account = AccountReady | AccountNotReady;
+
+export type OrderSource = string | SignedOrder[];
+
+export interface AddressAndEthBalanceInWei {
+ address: string;
+ ethBalanceInWei: BigNumber;
}
diff --git a/packages/instant/src/util/address.ts b/packages/instant/src/util/address.ts
new file mode 100644
index 000000000..b21863a8e
--- /dev/null
+++ b/packages/instant/src/util/address.ts
@@ -0,0 +1,6 @@
+import { Web3Wrapper } from '@0x/web3-wrapper';
+
+export const getBestAddress = async (web3Wrapper: Web3Wrapper): Promise<string | undefined> => {
+ const addresses = await web3Wrapper.getAvailableAddressesAsync();
+ return addresses[0];
+};
diff --git a/packages/instant/src/util/assert.ts b/packages/instant/src/util/assert.ts
new file mode 100644
index 000000000..971c1eb96
--- /dev/null
+++ b/packages/instant/src/util/assert.ts
@@ -0,0 +1,55 @@
+import { assert as sharedAssert } from '@0x/assert';
+import { schemas } from '@0x/json-schemas';
+import { assetDataUtils } from '@0x/order-utils';
+import { AssetProxyId, ObjectMap, SignedOrder } from '@0x/types';
+import * as _ from 'lodash';
+
+import { AffiliateInfo, AssetMetaData } from '../types';
+
+export const assert = {
+ ...sharedAssert,
+ isValidOrderSource(variableName: string, orderSource: string | SignedOrder[]): void {
+ if (_.isString(orderSource)) {
+ sharedAssert.isUri(variableName, orderSource);
+ return;
+ }
+ sharedAssert.doesConformToSchema(variableName, orderSource, schemas.signedOrdersSchema);
+ },
+ areValidAssetDatas(variableName: string, assetDatas: string[]): void {
+ _.forEach(assetDatas, (assetData, index) => assert.isHexString(`${variableName}[${index}]`, assetData));
+ },
+ isValidAssetMetaDataMap(variableName: string, metaDataMap: ObjectMap<AssetMetaData>): void {
+ _.forEach(metaDataMap, (metaData, assetData) => {
+ assert.isHexString(`key ${assetData} of ${variableName}`, assetData);
+ assert.isValidAssetMetaData(`${variableName}.${assetData}`, metaData);
+ const assetDataProxyId = assetDataUtils.decodeAssetProxyId(assetData);
+ assert.assert(
+ metaData.assetProxyId === assetDataProxyId,
+ `Expected meta data for assetData ${assetData} to have asset proxy id of ${assetDataProxyId}, but instead got ${
+ metaData.assetProxyId
+ }`,
+ );
+ });
+ },
+ isValidAssetMetaData(variableName: string, metaData: AssetMetaData): void {
+ assert.isHexString(`${variableName}.assetProxyId`, metaData.assetProxyId);
+ if (!_.isUndefined(metaData.primaryColor)) {
+ assert.isString(`${variableName}.primaryColor`, metaData.primaryColor);
+ }
+ if (metaData.assetProxyId === AssetProxyId.ERC20) {
+ assert.isNumber(`${variableName}.decimals`, metaData.decimals);
+ assert.isString(`${variableName}.symbol`, metaData.symbol);
+ } else if (metaData.assetProxyId === AssetProxyId.ERC721) {
+ assert.isString(`${variableName}.name`, metaData.name);
+ assert.isUri(`${variableName}.imageUrl`, metaData.imageUrl);
+ }
+ },
+ isValidAffiliateInfo(variableName: string, affiliateInfo: AffiliateInfo): void {
+ assert.isETHAddressHex(`${variableName}.recipientAddress`, affiliateInfo.feeRecipient);
+ assert.isNumber(`${variableName}.percentage`, affiliateInfo.feePercentage);
+ assert.assert(
+ affiliateInfo.feePercentage >= 0 && affiliateInfo.feePercentage <= 0.05,
+ `Expected ${variableName}.percentage to be between 0 and 0.05, but is ${affiliateInfo.feePercentage}`,
+ );
+ },
+};
diff --git a/packages/instant/src/util/asset.ts b/packages/instant/src/util/asset.ts
new file mode 100644
index 000000000..fbfbb19f3
--- /dev/null
+++ b/packages/instant/src/util/asset.ts
@@ -0,0 +1,111 @@
+import { AssetProxyId, ObjectMap } from '@0x/types';
+import * as _ from 'lodash';
+
+import { assetDataNetworkMapping } from '../data/asset_data_network_mapping';
+import { Asset, AssetMetaData, ERC20Asset, Network, ZeroExInstantError } from '../types';
+
+export const assetUtils = {
+ createAssetsFromAssetDatas: (
+ assetDatas: string[],
+ assetMetaDataMap: ObjectMap<AssetMetaData>,
+ network: Network,
+ ): Asset[] => {
+ const arrayOfAssetOrUndefined = _.map(assetDatas, assetData =>
+ assetUtils.createAssetFromAssetDataIfExists(assetData, assetMetaDataMap, network),
+ );
+ return _.compact(arrayOfAssetOrUndefined);
+ },
+ createAssetFromAssetDataIfExists: (
+ assetData: string,
+ assetMetaDataMap: ObjectMap<AssetMetaData>,
+ network: Network,
+ ): Asset | undefined => {
+ const metaData = assetUtils.getMetaDataIfExists(assetData, assetMetaDataMap, network);
+ if (_.isUndefined(metaData)) {
+ return;
+ }
+ return {
+ assetData,
+ metaData,
+ };
+ },
+ createAssetFromAssetDataOrThrow: (
+ assetData: string,
+ assetMetaDataMap: ObjectMap<AssetMetaData>,
+ network: Network,
+ ): Asset => {
+ return {
+ assetData,
+ metaData: assetUtils.getMetaDataOrThrow(assetData, assetMetaDataMap, network),
+ };
+ },
+ getMetaDataOrThrow: (assetData: string, metaDataMap: ObjectMap<AssetMetaData>, network: Network): AssetMetaData => {
+ const metaDataIfExists = assetUtils.getMetaDataIfExists(assetData, metaDataMap, network);
+ if (_.isUndefined(metaDataIfExists)) {
+ throw new Error(ZeroExInstantError.AssetMetaDataNotAvailable);
+ }
+ return metaDataIfExists;
+ },
+ getMetaDataIfExists: (
+ assetData: string,
+ metaDataMap: ObjectMap<AssetMetaData>,
+ network: Network,
+ ): AssetMetaData | undefined => {
+ let mainnetAssetData: string | undefined = assetData;
+ if (network !== Network.Mainnet) {
+ const mainnetAssetDataIfExists = assetUtils.getAssociatedAssetDataIfExists(
+ assetData.toLowerCase(),
+ network,
+ );
+ // Just so we don't fail in the case where we are on a non-mainnet network,
+ // but pass in a valid mainnet assetData.
+ mainnetAssetData = mainnetAssetDataIfExists || assetData;
+ }
+ if (_.isUndefined(mainnetAssetData)) {
+ return;
+ }
+ const metaData = metaDataMap[mainnetAssetData.toLowerCase()];
+ if (_.isUndefined(metaData)) {
+ return;
+ }
+ return metaData;
+ },
+ bestNameForAsset: (asset?: Asset, defaultName: string = '???'): string => {
+ if (_.isUndefined(asset)) {
+ return defaultName;
+ }
+ const metaData = asset.metaData;
+ switch (metaData.assetProxyId) {
+ case AssetProxyId.ERC20:
+ return metaData.symbol.toUpperCase();
+ case AssetProxyId.ERC721:
+ return metaData.name;
+ default:
+ return defaultName;
+ }
+ },
+ formattedSymbolForAsset: (asset?: ERC20Asset, defaultName: string = '???'): string => {
+ if (_.isUndefined(asset)) {
+ return defaultName;
+ }
+ const symbol = asset.metaData.symbol;
+ if (symbol.length <= 5) {
+ return symbol;
+ }
+ return `${symbol.slice(0, 3)}…`;
+ },
+ getAssociatedAssetDataIfExists: (assetData: string, network: Network): string | undefined => {
+ const assetDataGroupIfExists = _.find(assetDataNetworkMapping, value => value[network] === assetData);
+ if (_.isUndefined(assetDataGroupIfExists)) {
+ return;
+ }
+ return assetDataGroupIfExists[Network.Mainnet];
+ },
+ getERC20AssetsFromAssets: (assets: Asset[]): ERC20Asset[] => {
+ const erc20sOrUndefined = _.map(
+ assets,
+ asset => (asset.metaData.assetProxyId === AssetProxyId.ERC20 ? (asset as ERC20Asset) : undefined),
+ );
+ return _.compact(erc20sOrUndefined);
+ },
+};
diff --git a/packages/instant/src/util/asset_buyer_factory.ts b/packages/instant/src/util/asset_buyer_factory.ts
new file mode 100644
index 000000000..5ba46223c
--- /dev/null
+++ b/packages/instant/src/util/asset_buyer_factory.ts
@@ -0,0 +1,17 @@
+import { AssetBuyer, AssetBuyerOpts } from '@0x/asset-buyer';
+import { Provider } from 'ethereum-types';
+import * as _ from 'lodash';
+
+import { Network, OrderSource } from '../types';
+
+export const assetBuyerFactory = {
+ getAssetBuyer: (provider: Provider, orderSource: OrderSource, network: Network): AssetBuyer => {
+ const assetBuyerOptions: Partial<AssetBuyerOpts> = {
+ networkId: network,
+ };
+ const assetBuyer = _.isString(orderSource)
+ ? AssetBuyer.getAssetBuyerForStandardRelayerAPIUrl(provider, orderSource, assetBuyerOptions)
+ : AssetBuyer.getAssetBuyerForProvidedOrders(provider, orderSource, assetBuyerOptions);
+ return assetBuyer;
+ },
+};
diff --git a/packages/instant/src/util/buy_quote_updater.ts b/packages/instant/src/util/buy_quote_updater.ts
new file mode 100644
index 000000000..c33e28f1c
--- /dev/null
+++ b/packages/instant/src/util/buy_quote_updater.ts
@@ -0,0 +1,59 @@
+import { AssetBuyer, AssetBuyerError, BuyQuote } from '@0x/asset-buyer';
+import { BigNumber } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
+import * as _ from 'lodash';
+import { Dispatch } from 'redux';
+import { oc } from 'ts-optchain';
+
+import { Action, actions } from '../redux/actions';
+import { AffiliateInfo, ERC20Asset } from '../types';
+import { assetUtils } from '../util/asset';
+import { errorFlasher } from '../util/error_flasher';
+
+export const buyQuoteUpdater = {
+ updateBuyQuoteAsync: async (
+ assetBuyer: AssetBuyer,
+ dispatch: Dispatch<Action>,
+ asset: ERC20Asset,
+ assetAmount: BigNumber,
+ setPending = true,
+ affiliateInfo?: AffiliateInfo,
+ ): Promise<void> => {
+ // get a new buy quote.
+ const baseUnitValue = Web3Wrapper.toBaseUnitAmount(assetAmount, asset.metaData.decimals);
+ if (setPending) {
+ // mark quote as pending
+ dispatch(actions.setQuoteRequestStatePending());
+ }
+ const feePercentage = oc(affiliateInfo).feePercentage();
+ let newBuyQuote: BuyQuote | undefined;
+ try {
+ newBuyQuote = await assetBuyer.getBuyQuoteAsync(asset.assetData, baseUnitValue, { feePercentage });
+ } catch (error) {
+ dispatch(actions.setQuoteRequestStateFailure());
+ let errorMessage;
+ if (error.message === AssetBuyerError.InsufficientAssetLiquidity) {
+ const assetName = assetUtils.bestNameForAsset(asset, 'of this asset');
+ errorMessage = `Not enough ${assetName} available`;
+ } else if (error.message === AssetBuyerError.InsufficientZrxLiquidity) {
+ errorMessage = 'Not enough ZRX available';
+ } else if (
+ error.message === AssetBuyerError.StandardRelayerApiError ||
+ error.message.startsWith(AssetBuyerError.AssetUnavailable)
+ ) {
+ const assetName = assetUtils.bestNameForAsset(asset, 'This asset');
+ errorMessage = `${assetName} is currently unavailable`;
+ }
+ if (!_.isUndefined(errorMessage)) {
+ errorFlasher.flashNewErrorMessage(dispatch, errorMessage);
+ } else {
+ throw error;
+ }
+ return;
+ }
+ // We have a successful new buy quote
+ errorFlasher.clearError(dispatch);
+ // invalidate the last buy quote.
+ dispatch(actions.updateLatestBuyQuote(newBuyQuote));
+ },
+};
diff --git a/packages/instant/src/util/coinbase_api.ts b/packages/instant/src/util/coinbase_api.ts
new file mode 100644
index 000000000..faac8d82d
--- /dev/null
+++ b/packages/instant/src/util/coinbase_api.ts
@@ -0,0 +1,11 @@
+import { BigNumber, fetchAsync } from '@0x/utils';
+
+import { COINBASE_API_BASE_URL } from '../constants';
+
+export const coinbaseApi = {
+ getEthUsdPrice: async (): Promise<BigNumber> => {
+ const res = await fetchAsync(`${COINBASE_API_BASE_URL}/prices/ETH-USD/buy`);
+ const resJson = await res.json();
+ return new BigNumber(resJson.data.amount);
+ },
+};
diff --git a/packages/instant/src/util/error_flasher.ts b/packages/instant/src/util/error_flasher.ts
new file mode 100644
index 000000000..068c12fe2
--- /dev/null
+++ b/packages/instant/src/util/error_flasher.ts
@@ -0,0 +1,26 @@
+import { Dispatch } from 'redux';
+
+import { Action, actions } from '../redux/actions';
+
+class ErrorFlasher {
+ private _timeoutId?: number;
+ public flashNewErrorMessage(dispatch: Dispatch<Action>, errorMessage?: string, delayMs: number = 7000): void {
+ this._clearTimeout();
+ // dispatch new message
+ dispatch(actions.setErrorMessage(errorMessage || 'Something went wrong...'));
+ this._timeoutId = window.setTimeout(() => {
+ dispatch(actions.hideError());
+ }, delayMs);
+ }
+ public clearError(dispatch: Dispatch<Action>): void {
+ this._clearTimeout();
+ dispatch(actions.hideError());
+ }
+ private _clearTimeout(): void {
+ if (this._timeoutId) {
+ window.clearTimeout(this._timeoutId);
+ }
+ }
+}
+
+export const errorFlasher = new ErrorFlasher();
diff --git a/packages/instant/src/util/etherscan.ts b/packages/instant/src/util/etherscan.ts
new file mode 100644
index 000000000..4d62c4d9f
--- /dev/null
+++ b/packages/instant/src/util/etherscan.ts
@@ -0,0 +1,31 @@
+import * as _ from 'lodash';
+
+import { Network } from '../types';
+
+const etherscanPrefix = (networkId: number): string | undefined => {
+ switch (networkId) {
+ case Network.Kovan:
+ return 'kovan.';
+ case Network.Mainnet:
+ return '';
+ default:
+ return undefined;
+ }
+};
+
+export const etherscanUtil = {
+ getEtherScanTxnAddressIfExists: (txHash: string, networkId: number) => {
+ const prefix = etherscanPrefix(networkId);
+ if (_.isUndefined(prefix)) {
+ return;
+ }
+ return `https://${prefix}etherscan.io/tx/${txHash}`;
+ },
+ getEtherScanEthAddressIfExists: (ethAddress: string, networkId: number) => {
+ const prefix = etherscanPrefix(networkId);
+ if (_.isUndefined(prefix)) {
+ return;
+ }
+ return `https://${prefix}etherscan.io/address/${ethAddress}`;
+ },
+};
diff --git a/packages/instant/src/util/format.ts b/packages/instant/src/util/format.ts
new file mode 100644
index 000000000..44661d697
--- /dev/null
+++ b/packages/instant/src/util/format.ts
@@ -0,0 +1,56 @@
+import { BigNumber } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
+import * as _ from 'lodash';
+
+import { ETH_DECIMALS } from '../constants';
+
+export const format = {
+ ethBaseAmount: (
+ ethBaseAmount?: BigNumber,
+ decimalPlaces: number = 4,
+ defaultText: React.ReactNode = '0 ETH',
+ ): React.ReactNode => {
+ if (_.isUndefined(ethBaseAmount)) {
+ return defaultText;
+ }
+ const ethUnitAmount = Web3Wrapper.toUnitAmount(ethBaseAmount, ETH_DECIMALS);
+ return format.ethUnitAmount(ethUnitAmount, decimalPlaces);
+ },
+ ethUnitAmount: (
+ ethUnitAmount?: BigNumber,
+ decimalPlaces: number = 4,
+ defaultText: React.ReactNode = '0 ETH',
+ ): React.ReactNode => {
+ if (_.isUndefined(ethUnitAmount)) {
+ return defaultText;
+ }
+ const roundedAmount = ethUnitAmount.round(decimalPlaces).toDigits(decimalPlaces);
+ return `${roundedAmount} ETH`;
+ },
+ ethBaseAmountInUsd: (
+ ethBaseAmount?: BigNumber,
+ ethUsdPrice?: BigNumber,
+ decimalPlaces: number = 2,
+ defaultText: React.ReactNode = '$0.00',
+ ): React.ReactNode => {
+ if (_.isUndefined(ethBaseAmount) || _.isUndefined(ethUsdPrice)) {
+ return defaultText;
+ }
+ const ethUnitAmount = Web3Wrapper.toUnitAmount(ethBaseAmount, ETH_DECIMALS);
+ return format.ethUnitAmountInUsd(ethUnitAmount, ethUsdPrice, decimalPlaces);
+ },
+ ethUnitAmountInUsd: (
+ ethUnitAmount?: BigNumber,
+ ethUsdPrice?: BigNumber,
+ decimalPlaces: number = 2,
+ defaultText: React.ReactNode = '$0.00',
+ ): React.ReactNode => {
+ if (_.isUndefined(ethUnitAmount) || _.isUndefined(ethUsdPrice)) {
+ return defaultText;
+ }
+ return `$${ethUnitAmount.mul(ethUsdPrice).toFixed(decimalPlaces)}`;
+ },
+ ethAddress: (address: string): string => {
+ return `0x${address.slice(2, 7)}…${address.slice(-5)}`;
+ },
+};
diff --git a/packages/instant/src/util/gas_price_estimator.ts b/packages/instant/src/util/gas_price_estimator.ts
new file mode 100644
index 000000000..6b15809a3
--- /dev/null
+++ b/packages/instant/src/util/gas_price_estimator.ts
@@ -0,0 +1,62 @@
+import { BigNumber, fetchAsync } from '@0x/utils';
+
+import {
+ DEFAULT_ESTIMATED_TRANSACTION_TIME_MS,
+ DEFAULT_GAS_PRICE,
+ ETH_GAS_STATION_API_BASE_URL,
+ GWEI_IN_WEI,
+} from '../constants';
+
+interface EthGasStationResult {
+ average: number;
+ fastestWait: number;
+ fastWait: number;
+ fast: number;
+ safeLowWait: number;
+ blockNum: number;
+ avgWait: number;
+ block_time: number;
+ speed: number;
+ fastest: number;
+ safeLow: number;
+}
+
+interface GasInfo {
+ gasPriceInWei: BigNumber;
+ estimatedTimeMs: number;
+}
+
+const fetchFastAmountInWeiAsync = async (): Promise<GasInfo> => {
+ const res = await fetchAsync(`${ETH_GAS_STATION_API_BASE_URL}/json/ethgasAPI.json`);
+ const gasInfo = (await res.json()) as EthGasStationResult;
+ // Eth Gas Station result is gwei * 10
+ 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 };
+};
+
+export class GasPriceEstimator {
+ private _lastFetched?: GasInfo;
+ public async getGasInfoAsync(): Promise<GasInfo> {
+ let fetchedAmount: GasInfo | undefined;
+ try {
+ fetchedAmount = await fetchFastAmountInWeiAsync();
+ } catch {
+ fetchedAmount = undefined;
+ }
+
+ if (fetchedAmount) {
+ this._lastFetched = fetchedAmount;
+ }
+
+ return (
+ fetchedAmount ||
+ this._lastFetched || {
+ gasPriceInWei: DEFAULT_GAS_PRICE,
+ estimatedTimeMs: DEFAULT_ESTIMATED_TRANSACTION_TIME_MS,
+ }
+ );
+ }
+}
+export const gasPriceEstimator = new GasPriceEstimator();
diff --git a/packages/instant/src/util/heartbeater.ts b/packages/instant/src/util/heartbeater.ts
new file mode 100644
index 000000000..e700d489e
--- /dev/null
+++ b/packages/instant/src/util/heartbeater.ts
@@ -0,0 +1,35 @@
+import { intervalUtils } from '@0x/utils';
+import * as _ from 'lodash';
+
+type HeartbeatableFunction = () => Promise<void>;
+export class Heartbeater {
+ private _intervalId?: NodeJS.Timer;
+ private readonly _performImmediatelyOnStart: boolean;
+ private readonly _performFunction: HeartbeatableFunction;
+
+ public constructor(performingFunctionAsync: HeartbeatableFunction, performImmediatelyOnStart: boolean) {
+ this._performFunction = performingFunctionAsync;
+ this._performImmediatelyOnStart = performImmediatelyOnStart;
+ }
+
+ public start(intervalTimeMs: number): void {
+ if (!_.isUndefined(this._intervalId)) {
+ throw new Error('Heartbeat is running, please stop before restarting');
+ }
+
+ if (this._performImmediatelyOnStart) {
+ // tslint:disable-next-line:no-floating-promises
+ this._performFunction();
+ }
+
+ // tslint:disable-next-line:no-unbound-method
+ this._intervalId = intervalUtils.setAsyncExcludingInterval(this._performFunction, intervalTimeMs, _.noop);
+ }
+
+ public stop(): void {
+ if (this._intervalId) {
+ intervalUtils.clearInterval(this._intervalId);
+ }
+ this._intervalId = undefined;
+ }
+}
diff --git a/packages/instant/src/util/heartbeater_factory.ts b/packages/instant/src/util/heartbeater_factory.ts
new file mode 100644
index 000000000..96a8ac4e6
--- /dev/null
+++ b/packages/instant/src/util/heartbeater_factory.ts
@@ -0,0 +1,22 @@
+import { asyncData } from '../redux/async_data';
+import { Store } from '../redux/store';
+
+import { Heartbeater } from './heartbeater';
+
+export interface HeartbeatFactoryOptions {
+ store: Store;
+ shouldPerformImmediatelyOnStart: boolean;
+}
+export const generateAccountHeartbeater = (options: HeartbeatFactoryOptions): Heartbeater => {
+ const { store, shouldPerformImmediatelyOnStart } = options;
+ return new Heartbeater(async () => {
+ await asyncData.fetchAccountInfoAndDispatchToStore({ store, shouldSetToLoading: false });
+ }, shouldPerformImmediatelyOnStart);
+};
+
+export const generateBuyQuoteHeartbeater = (options: HeartbeatFactoryOptions): Heartbeater => {
+ const { store, shouldPerformImmediatelyOnStart } = options;
+ return new Heartbeater(async () => {
+ await asyncData.fetchCurrentBuyQuoteAndDispatchToStore({ store, shouldSetPending: false });
+ }, shouldPerformImmediatelyOnStart);
+};
diff --git a/packages/instant/src/util/maybe_big_number.ts b/packages/instant/src/util/maybe_big_number.ts
new file mode 100644
index 000000000..9d3746e10
--- /dev/null
+++ b/packages/instant/src/util/maybe_big_number.ts
@@ -0,0 +1,25 @@
+import { BigNumber } from '@0x/utils';
+import * as _ from 'lodash';
+
+import { Maybe } from '../types';
+
+export const maybeBigNumberUtil = {
+ // converts a string to a Maybe<BigNumber>
+ // if string is a NaN, considered undefined
+ stringToMaybeBigNumber: (stringValue: string): Maybe<BigNumber> => {
+ let validBigNumber: BigNumber;
+ try {
+ validBigNumber = new BigNumber(stringValue);
+ } catch {
+ return undefined;
+ }
+
+ return validBigNumber.isNaN() ? undefined : validBigNumber;
+ },
+ areMaybeBigNumbersEqual: (val1: Maybe<BigNumber>, val2: Maybe<BigNumber>): boolean => {
+ if (!_.isUndefined(val1) && !_.isUndefined(val2)) {
+ return val1.equals(val2);
+ }
+ return _.isUndefined(val1) && _.isUndefined(val2);
+ },
+};
diff --git a/packages/instant/src/util/provider_factory.ts b/packages/instant/src/util/provider_factory.ts
new file mode 100644
index 000000000..603f7674d
--- /dev/null
+++ b/packages/instant/src/util/provider_factory.ts
@@ -0,0 +1,34 @@
+import { EmptyWalletSubprovider, RPCSubprovider, Web3ProviderEngine } from '@0x/subproviders';
+import { Provider } from 'ethereum-types';
+import * as _ from 'lodash';
+
+import { BLOCK_POLLING_INTERVAL_MS, ETHEREUM_NODE_URL_BY_NETWORK } from '../constants';
+import { Maybe, Network } from '../types';
+
+export const providerFactory = {
+ getInjectedProviderIfExists: (): Maybe<Provider> => {
+ const injectedProviderIfExists = (window as any).ethereum;
+ if (!_.isUndefined(injectedProviderIfExists)) {
+ return injectedProviderIfExists;
+ }
+ const injectedWeb3IfExists = (window as any).web3;
+ if (!_.isUndefined(injectedWeb3IfExists) && !_.isUndefined(injectedWeb3IfExists.currentProvider)) {
+ return injectedWeb3IfExists.currentProvider;
+ }
+ return undefined;
+ },
+ getFallbackNoSigningProvider: (network: Network): Provider => {
+ const providerEngine = new Web3ProviderEngine({
+ pollingInterval: BLOCK_POLLING_INTERVAL_MS,
+ });
+ // Intercept calls to `eth_accounts` and always return empty
+ providerEngine.addProvider(new EmptyWalletSubprovider());
+ // Construct an RPC subprovider, all data based requests will be sent via the RPCSubprovider
+ // TODO(bmillman): make this more resilient to infura failures
+ const rpcUrl = ETHEREUM_NODE_URL_BY_NETWORK[network];
+ providerEngine.addProvider(new RPCSubprovider(rpcUrl));
+ // // Start the Provider Engine
+ providerEngine.start();
+ return providerEngine;
+ },
+};
diff --git a/packages/instant/src/util/provider_state_factory.ts b/packages/instant/src/util/provider_state_factory.ts
new file mode 100644
index 000000000..3281f6bfb
--- /dev/null
+++ b/packages/instant/src/util/provider_state_factory.ts
@@ -0,0 +1,63 @@
+import { Web3Wrapper } from '@0x/web3-wrapper';
+import { Provider } from 'ethereum-types';
+import * as _ from 'lodash';
+
+import { LOADING_ACCOUNT, NO_ACCOUNT } from '../constants';
+import { Maybe, Network, OrderSource, ProviderState } from '../types';
+
+import { assetBuyerFactory } from './asset_buyer_factory';
+import { providerFactory } from './provider_factory';
+
+export const providerStateFactory = {
+ getInitialProviderState: (orderSource: OrderSource, network: Network, provider?: Provider): ProviderState => {
+ if (!_.isUndefined(provider)) {
+ return providerStateFactory.getInitialProviderStateFromProvider(orderSource, network, provider);
+ }
+ const providerStateFromWindowIfExits = providerStateFactory.getInitialProviderStateFromWindowIfExists(
+ orderSource,
+ network,
+ );
+ if (providerStateFromWindowIfExits) {
+ return providerStateFromWindowIfExits;
+ } else {
+ return providerStateFactory.getInitialProviderStateFallback(orderSource, network);
+ }
+ },
+ getInitialProviderStateFromProvider: (
+ orderSource: OrderSource,
+ network: Network,
+ provider: Provider,
+ ): ProviderState => {
+ const providerState: ProviderState = {
+ provider,
+ web3Wrapper: new Web3Wrapper(provider),
+ assetBuyer: assetBuyerFactory.getAssetBuyer(provider, orderSource, network),
+ account: LOADING_ACCOUNT,
+ };
+ return providerState;
+ },
+ getInitialProviderStateFromWindowIfExists: (orderSource: OrderSource, network: Network): Maybe<ProviderState> => {
+ const injectedProviderIfExists = providerFactory.getInjectedProviderIfExists();
+ if (!_.isUndefined(injectedProviderIfExists)) {
+ const providerState: ProviderState = {
+ provider: injectedProviderIfExists,
+ web3Wrapper: new Web3Wrapper(injectedProviderIfExists),
+ assetBuyer: assetBuyerFactory.getAssetBuyer(injectedProviderIfExists, orderSource, network),
+ account: LOADING_ACCOUNT,
+ };
+ return providerState;
+ } else {
+ return undefined;
+ }
+ },
+ getInitialProviderStateFallback: (orderSource: OrderSource, network: Network): ProviderState => {
+ const provider = providerFactory.getFallbackNoSigningProvider(network);
+ const providerState: ProviderState = {
+ provider,
+ web3Wrapper: new Web3Wrapper(provider),
+ assetBuyer: assetBuyerFactory.getAssetBuyer(provider, orderSource, network),
+ account: NO_ACCOUNT,
+ };
+ return providerState;
+ },
+};
diff --git a/packages/instant/src/util/time.ts b/packages/instant/src/util/time.ts
new file mode 100644
index 000000000..bfe69cad5
--- /dev/null
+++ b/packages/instant/src/util/time.ts
@@ -0,0 +1,39 @@
+const secondsToMinutesAndRemainingSeconds = (seconds: number): { minutes: number; remainingSeconds: number } => {
+ const minutes = Math.floor(seconds / 60);
+ const remainingSeconds = seconds - minutes * 60;
+
+ return {
+ minutes,
+ remainingSeconds,
+ };
+};
+
+const padZero = (aNumber: number): string => {
+ return aNumber < 10 ? `0${aNumber}` : aNumber.toString();
+};
+
+export const timeUtil = {
+ // converts seconds to human readable version of seconds or minutes
+ secondsToHumanDescription: (seconds: number): string => {
+ const { minutes, remainingSeconds } = secondsToMinutesAndRemainingSeconds(seconds);
+
+ if (minutes === 0) {
+ const suffix = seconds > 1 ? 's' : '';
+ return `${seconds} second${suffix}`;
+ }
+
+ const minuteSuffix = minutes > 1 ? 's' : '';
+ const minuteText = `${minutes} minute${minuteSuffix}`;
+
+ const secondsSuffix = remainingSeconds > 1 ? 's' : '';
+ const secondsText = remainingSeconds === 0 ? '' : ` ${remainingSeconds} second${secondsSuffix}`;
+
+ return `${minuteText}${secondsText}`;
+ },
+ // converts seconds to stopwatch time (i.e. 05:30 and 00:30)
+ // only goes up to minutes, not hours
+ secondsToStopwatchTime: (seconds: number): string => {
+ const { minutes, remainingSeconds } = secondsToMinutesAndRemainingSeconds(seconds);
+ return `${padZero(minutes)}:${padZero(remainingSeconds)}`;
+ },
+};
diff --git a/packages/instant/src/util/util.ts b/packages/instant/src/util/util.ts
new file mode 100644
index 000000000..232a86850
--- /dev/null
+++ b/packages/instant/src/util/util.ts
@@ -0,0 +1,5 @@
+import * as _ from 'lodash';
+
+export const util = {
+ boundNoop: _.noop.bind(_),
+};
diff --git a/packages/instant/test/components/zero_ex_instant.test.tsx b/packages/instant/test/components/zero_ex_instant.test.tsx
index 5858732cf..e373bb002 100644
--- a/packages/instant/test/components/zero_ex_instant.test.tsx
+++ b/packages/instant/test/components/zero_ex_instant.test.tsx
@@ -4,10 +4,12 @@ import * as React from 'react';
configure({ adapter: new Adapter() });
-import { ZeroExInstant } from '../../src';
-
-describe('<ZeroExInstant />', () => {
- it('shallow renders without crashing', () => {
- shallow(<ZeroExInstant />);
+// TODO: Write non-trivial tests.
+// At time of writing we cannot render ZeroExInstant
+// because we are looking for a provider on window.
+// But in the future it will be dependency injected.
+describe('<Test />', () => {
+ it('runs a test', () => {
+ shallow(<div />);
});
});
diff --git a/packages/instant/test/util/asset.test.ts b/packages/instant/test/util/asset.test.ts
new file mode 100644
index 000000000..4229b24ed
--- /dev/null
+++ b/packages/instant/test/util/asset.test.ts
@@ -0,0 +1,48 @@
+import { AssetProxyId, ObjectMap } from '@0x/types';
+
+import { Asset, AssetMetaData, ERC20AssetMetaData, Network, ZeroExInstantError } from '../../src/types';
+import { assetUtils } from '../../src/util/asset';
+
+const ZRX_ASSET_DATA = '0xf47261b0000000000000000000000000e41d2489571d322189246dafa5ebde1f4699f498';
+const ZRX_ASSET_DATA_KOVAN = '0xf47261b00000000000000000000000002002d3812f58e35f0ea1ffbf80a75a38c32175fa';
+const ZRX_META_DATA: ERC20AssetMetaData = {
+ assetProxyId: AssetProxyId.ERC20,
+ symbol: 'zrx',
+ decimals: 18,
+ name: '0x',
+};
+const ZRX_ASSET: Asset = {
+ assetData: ZRX_ASSET_DATA,
+ metaData: ZRX_META_DATA,
+};
+const META_DATA_MAP: ObjectMap<AssetMetaData> = {
+ [ZRX_ASSET_DATA]: ZRX_META_DATA,
+};
+
+describe('assetDataUtil', () => {
+ describe('bestNameForAsset', () => {
+ it('should return default string if assetData is undefined', () => {
+ expect(assetUtils.bestNameForAsset(undefined, 'xyz')).toEqual('xyz');
+ });
+ it('should return ZRX for ZRX assetData', () => {
+ expect(assetUtils.bestNameForAsset(ZRX_ASSET, 'mah default')).toEqual('ZRX');
+ });
+ });
+ describe('getMetaDataOrThrow', () => {
+ it('should return the metaData for the supplied mainnet asset data', () => {
+ expect(assetUtils.getMetaDataOrThrow(ZRX_ASSET_DATA, META_DATA_MAP, Network.Mainnet)).toEqual(
+ ZRX_META_DATA,
+ );
+ });
+ it('should return the metaData for the supplied non-mainnet asset data', () => {
+ expect(assetUtils.getMetaDataOrThrow(ZRX_ASSET_DATA_KOVAN, META_DATA_MAP, Network.Kovan)).toEqual(
+ ZRX_META_DATA,
+ );
+ });
+ it('should throw if the metaData for the asset is not available', () => {
+ expect(() =>
+ assetUtils.getMetaDataOrThrow('asset data we dont have', META_DATA_MAP, Network.Mainnet),
+ ).toThrowError(ZeroExInstantError.AssetMetaDataNotAvailable);
+ });
+ });
+});
diff --git a/packages/instant/test/util/format.test.ts b/packages/instant/test/util/format.test.ts
new file mode 100644
index 000000000..c346b7604
--- /dev/null
+++ b/packages/instant/test/util/format.test.ts
@@ -0,0 +1,97 @@
+import { BigNumber } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
+
+import { ETH_DECIMALS } from '../../src/constants';
+import { format } from '../../src/util/format';
+
+const BIG_NUMBER_ONE = new BigNumber(1);
+const BIG_NUMBER_DECIMAL = new BigNumber(0.432414);
+const BIG_NUMBER_IRRATIONAL = new BigNumber(5.3014059295032);
+const ONE_ETH_IN_BASE_UNITS = Web3Wrapper.toBaseUnitAmount(BIG_NUMBER_ONE, ETH_DECIMALS);
+const DECIMAL_ETH_IN_BASE_UNITS = Web3Wrapper.toBaseUnitAmount(BIG_NUMBER_DECIMAL, ETH_DECIMALS);
+const IRRATIONAL_ETH_IN_BASE_UNITS = Web3Wrapper.toBaseUnitAmount(BIG_NUMBER_IRRATIONAL, ETH_DECIMALS);
+const BIG_NUMBER_FAKE_ETH_USD_PRICE = new BigNumber(2.534);
+
+describe('format', () => {
+ describe('ethBaseAmount', () => {
+ it('converts 1 ETH in base units to the string `1 ETH`', () => {
+ expect(format.ethBaseAmount(ONE_ETH_IN_BASE_UNITS)).toBe('1 ETH');
+ });
+ it('converts .432414 ETH in base units to the string `.4324 ETH`', () => {
+ expect(format.ethBaseAmount(DECIMAL_ETH_IN_BASE_UNITS)).toBe('0.4324 ETH');
+ });
+ it('converts 5.3014059295032 ETH in base units to the string `5.301 ETH`', () => {
+ expect(format.ethBaseAmount(IRRATIONAL_ETH_IN_BASE_UNITS)).toBe('5.301 ETH');
+ });
+ it('returns defaultText param when ethBaseAmount is not defined', () => {
+ const defaultText = 'defaultText';
+ expect(format.ethBaseAmount(undefined, 4, defaultText)).toBe(defaultText);
+ });
+ it('it allows for configurable decimal places', () => {
+ expect(format.ethBaseAmount(DECIMAL_ETH_IN_BASE_UNITS, 2)).toBe('0.43 ETH');
+ });
+ });
+ describe('ethUnitAmount', () => {
+ it('converts BigNumber(1) to the string `1 ETH`', () => {
+ expect(format.ethUnitAmount(BIG_NUMBER_ONE)).toBe('1 ETH');
+ });
+ it('converts BigNumer(.432414) to the string `.4324 ETH`', () => {
+ expect(format.ethUnitAmount(BIG_NUMBER_DECIMAL)).toBe('0.4324 ETH');
+ });
+ it('converts BigNumber(5.3014059295032) to the string `5.301 ETH`', () => {
+ expect(format.ethUnitAmount(BIG_NUMBER_IRRATIONAL)).toBe('5.301 ETH');
+ });
+ it('returns defaultText param when ethUnitAmount is not defined', () => {
+ const defaultText = 'defaultText';
+ expect(format.ethUnitAmount(undefined, 4, defaultText)).toBe(defaultText);
+ expect(format.ethUnitAmount(BIG_NUMBER_ONE, 4, defaultText)).toBe('1 ETH');
+ });
+ it('it allows for configurable decimal places', () => {
+ expect(format.ethUnitAmount(BIG_NUMBER_DECIMAL, 2)).toBe('0.43 ETH');
+ });
+ });
+ describe('ethBaseAmountInUsd', () => {
+ it('correctly formats 1 ETH to usd according to some price', () => {
+ expect(format.ethBaseAmountInUsd(ONE_ETH_IN_BASE_UNITS, BIG_NUMBER_FAKE_ETH_USD_PRICE)).toBe('$2.53');
+ });
+ it('correctly formats .432414 ETH to usd according to some price', () => {
+ expect(format.ethBaseAmountInUsd(DECIMAL_ETH_IN_BASE_UNITS, BIG_NUMBER_FAKE_ETH_USD_PRICE)).toBe('$1.10');
+ });
+ it('correctly formats 5.3014059295032 ETH to usd according to some price', () => {
+ expect(format.ethBaseAmountInUsd(IRRATIONAL_ETH_IN_BASE_UNITS, BIG_NUMBER_FAKE_ETH_USD_PRICE)).toBe(
+ '$13.43',
+ );
+ });
+ it('returns defaultText param when ethBaseAmountInUsd or ethUsdPrice is not defined', () => {
+ const defaultText = 'defaultText';
+ expect(format.ethBaseAmountInUsd(undefined, undefined, 2, defaultText)).toBe(defaultText);
+ expect(format.ethBaseAmountInUsd(BIG_NUMBER_ONE, undefined, 2, defaultText)).toBe(defaultText);
+ expect(format.ethBaseAmountInUsd(undefined, BIG_NUMBER_ONE, 2, defaultText)).toBe(defaultText);
+ });
+ it('it allows for configurable decimal places', () => {
+ expect(format.ethBaseAmountInUsd(DECIMAL_ETH_IN_BASE_UNITS, BIG_NUMBER_FAKE_ETH_USD_PRICE, 4)).toBe(
+ '$1.0957',
+ );
+ });
+ });
+ describe('ethUnitAmountInUsd', () => {
+ it('correctly formats 1 ETH to usd according to some price', () => {
+ expect(format.ethUnitAmountInUsd(BIG_NUMBER_ONE, BIG_NUMBER_FAKE_ETH_USD_PRICE)).toBe('$2.53');
+ });
+ it('correctly formats .432414 ETH to usd according to some price', () => {
+ expect(format.ethUnitAmountInUsd(BIG_NUMBER_DECIMAL, BIG_NUMBER_FAKE_ETH_USD_PRICE)).toBe('$1.10');
+ });
+ it('correctly formats 5.3014059295032 ETH to usd according to some price', () => {
+ expect(format.ethUnitAmountInUsd(BIG_NUMBER_IRRATIONAL, BIG_NUMBER_FAKE_ETH_USD_PRICE)).toBe('$13.43');
+ });
+ it('returns defaultText param when ethUnitAmountInUsd or ethUsdPrice is not defined', () => {
+ const defaultText = 'defaultText';
+ expect(format.ethUnitAmountInUsd(undefined, undefined, 2, defaultText)).toBe(defaultText);
+ expect(format.ethUnitAmountInUsd(BIG_NUMBER_ONE, undefined, 2, defaultText)).toBe(defaultText);
+ expect(format.ethUnitAmountInUsd(undefined, BIG_NUMBER_ONE, 2, defaultText)).toBe(defaultText);
+ });
+ it('it allows for configurable decimal places', () => {
+ expect(format.ethUnitAmountInUsd(BIG_NUMBER_DECIMAL, BIG_NUMBER_FAKE_ETH_USD_PRICE, 4)).toBe('$1.0957');
+ });
+ });
+});
diff --git a/packages/instant/test/util/time.test.ts b/packages/instant/test/util/time.test.ts
new file mode 100644
index 000000000..fcb4e1875
--- /dev/null
+++ b/packages/instant/test/util/time.test.ts
@@ -0,0 +1,48 @@
+import { timeUtil } from '../../src/util/time';
+
+describe('timeUtil', () => {
+ describe('secondsToHumanDescription', () => {
+ const numsToResults: {
+ [aNumber: number]: string;
+ } = {
+ 1: '1 second',
+ 59: '59 seconds',
+ 60: '1 minute',
+ 119: '1 minute 59 seconds',
+ 120: '2 minutes',
+ 121: '2 minutes 1 second',
+ 122: '2 minutes 2 seconds',
+ };
+
+ const nums = Object.keys(numsToResults);
+ nums.forEach(aNum => {
+ const numInt = parseInt(aNum, 10);
+ it(`should work for ${aNum} seconds`, () => {
+ const expectedResult = numsToResults[numInt];
+ expect(timeUtil.secondsToHumanDescription(numInt)).toEqual(expectedResult);
+ });
+ });
+ });
+ describe('secondsToStopwatchTime', () => {
+ const numsToResults: {
+ [aNumber: number]: string;
+ } = {
+ 1: '00:01',
+ 59: '00:59',
+ 60: '01:00',
+ 119: '01:59',
+ 120: '02:00',
+ 121: '02:01',
+ 2701: '45:01',
+ };
+
+ const nums = Object.keys(numsToResults);
+ nums.forEach(aNum => {
+ const numInt = parseInt(aNum, 10);
+ it(`should work for ${aNum} seconds`, () => {
+ const expectedResult = numsToResults[numInt];
+ expect(timeUtil.secondsToStopwatchTime(numInt)).toEqual(expectedResult);
+ });
+ });
+ });
+});
diff --git a/packages/instant/tslint.json b/packages/instant/tslint.json
index f71532e5d..08b76be97 100644
--- a/packages/instant/tslint.json
+++ b/packages/instant/tslint.json
@@ -1,7 +1,8 @@
{
- "extends": ["@0xproject/tslint-config"],
+ "extends": ["@0x/tslint-config"],
"rules": {
"custom-no-magic-numbers": false,
- "semicolon": [true, "always", "ignore-bound-class-methods"]
+ "semicolon": [true, "always", "ignore-bound-class-methods"],
+ "max-classes-per-file": false
}
}
diff --git a/packages/json-schemas/CHANGELOG.json b/packages/json-schemas/CHANGELOG.json
index 53d929901..f25a487b8 100644
--- a/packages/json-schemas/CHANGELOG.json
+++ b/packages/json-schemas/CHANGELOG.json
@@ -1,5 +1,27 @@
[
{
+ "version": "2.0.1",
+ "changes": [
+ {
+ "note":
+ "Improve schemas by enforcing that amounts that must be whole numbers (e.g Order asset amounts) no longer allow decimal amounts",
+ "pr": 1173
+ }
+ ],
+ "timestamp": 1541740904
+ },
+ {
+ "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.",
+ "pr": 1145
+ }
+ ],
+ "timestamp": 1539871071
+ },
+ {
"timestamp": 1538693146,
"version": "1.0.7",
"changes": [
diff --git a/packages/json-schemas/CHANGELOG.md b/packages/json-schemas/CHANGELOG.md
index d9813053f..a1c784640 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.0.1 - _November 9, 2018_
+
+ * Improve schemas by enforcing that amounts that must be whole numbers (e.g Order asset amounts) no longer allow decimal amounts (#1173)
+
+## v2.0.0 - _October 18, 2018_
+
+ * Convert all schemas to JSON files so that they can be used with `json-schema` implemenations in other programming languages. (#1145)
+
## v1.0.7 - _October 4, 2018_
* Dependencies updated
@@ -41,7 +49,7 @@ CHANGELOG
* Update incorrect relayer api fee recipients response schema (#974)
-## v1.0.1-rc.4 - _August 13, 2018_
+## v1.0.1-rc.4 - _August 14, 2018_
* Allow for additional properties in txData schema (#938)
* Change hexSchema to match `0x` (#937)
diff --git a/packages/json-schemas/README.md b/packages/json-schemas/README.md
index ab57833be..f50382f4b 100644
--- a/packages/json-schemas/README.md
+++ b/packages/json-schemas/README.md
@@ -1,4 +1,4 @@
-## @0xproject/json-schemas
+## @0x/json-schemas
Contains 0x-related json schemas
@@ -7,26 +7,26 @@ Contains 0x-related json schemas
## Installation
```bash
-yarn add @0xproject/json-schemas
+yarn add @0x/json-schemas
```
**Import**
```typescript
-import { SchemaValidator, ValidatorResult, schemas } from '@0xproject/json-schemas';
+import { SchemaValidator, ValidatorResult, schemas } from '@0x/json-schemas';
```
or
```javascript
-var schemas = require('@0xproject/json-schemas').schemas;
+var schemas = require('@0x/json-schemas').schemas;
```
If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`:
```json
"compilerOptions": {
- "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"],
+ "typeRoots": ["node_modules/@0x/typescript-typings/types", "node_modules/@types"],
}
```
@@ -55,13 +55,13 @@ yarn install
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
```bash
-PKG=@0xproject/json-schemas yarn build
+PKG=@0x/json-schemas yarn build
```
Or continuously rebuild on change:
```bash
-PKG=@0xproject/json-schemas yarn watch
+PKG=@0x/json-schemas yarn watch
```
### Clean
diff --git a/packages/json-schemas/package.json b/packages/json-schemas/package.json
index 5f719d7f9..c87cbb65a 100644
--- a/packages/json-schemas/package.json
+++ b/packages/json-schemas/package.json
@@ -1,6 +1,6 @@
{
- "name": "@0xproject/json-schemas",
- "version": "1.0.7",
+ "name": "@0x/json-schemas",
+ "version": "2.0.1",
"engines": {
"node": ">=6.12"
},
@@ -10,7 +10,7 @@
"scripts": {
"build": "tsc -b",
"build:ci": "yarn build",
- "lint": "tslint --project .",
+ "lint": "tslint --format stylish --project . --exclude **/schemas/**/*",
"test": "yarn run_mocha",
"rebuild_and_test": "run-s clean build test",
"test:coverage": "nyc npm run test --all && yarn coverage:report:lcov",
@@ -39,19 +39,18 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/json-schemas/README.md",
"dependencies": {
- "@0xproject/typescript-typings": "^3.0.2",
+ "@0x/typescript-typings": "^3.0.4",
"@types/node": "*",
"jsonschema": "^1.2.0",
"lodash.values": "^4.3.0"
},
"devDependencies": {
- "@0xproject/tslint-config": "^1.0.8",
- "@0xproject/utils": "^2.0.2",
+ "@0x/tslint-config": "^1.0.10",
+ "@0x/utils": "^2.0.4",
"@types/lodash.foreach": "^4.5.3",
"@types/lodash.values": "^4.3.3",
"@types/mocha": "^2.2.42",
"chai": "^4.0.1",
- "copyfiles": "^2.0.0",
"dirty-chai": "^2.0.1",
"lodash.foreach": "^4.5.0",
"make-promises-safe": "^1.1.0",
@@ -60,7 +59,7 @@
"nyc": "^11.0.1",
"shx": "^0.2.2",
"tslint": "5.11.0",
- "typedoc": "0.12.0",
+ "typedoc": "0.13.0",
"typescript": "3.0.1"
},
"publishConfig": {
diff --git a/packages/json-schemas/schemas/address_schema.json b/packages/json-schemas/schemas/address_schema.json
new file mode 100644
index 000000000..0dc02d331
--- /dev/null
+++ b/packages/json-schemas/schemas/address_schema.json
@@ -0,0 +1,5 @@
+{
+ "id": "/addressSchema",
+ "type": "string",
+ "pattern": "^0x[0-9a-f]{40}$"
+}
diff --git a/packages/json-schemas/schemas/basic_type_schemas.ts b/packages/json-schemas/schemas/basic_type_schemas.ts
deleted file mode 100644
index a59afaef8..000000000
--- a/packages/json-schemas/schemas/basic_type_schemas.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-export const addressSchema = {
- id: '/addressSchema',
- type: 'string',
- pattern: '^0x[0-9a-f]{40}$',
-};
-
-export const hexSchema = {
- id: '/hexSchema',
- type: 'string',
- pattern: '^0x(([0-9a-f][0-9a-f])+)?$',
-};
-
-export const numberSchema = {
- id: '/numberSchema',
- type: 'string',
- pattern: '^\\d+(\\.\\d+)?$',
-};
diff --git a/packages/json-schemas/schemas/block_param_schema.json b/packages/json-schemas/schemas/block_param_schema.json
new file mode 100644
index 000000000..ed4dd1e87
--- /dev/null
+++ b/packages/json-schemas/schemas/block_param_schema.json
@@ -0,0 +1,11 @@
+{
+ "id": "/blockParamSchema",
+ "oneOf": [
+ {
+ "type": "number"
+ },
+ {
+ "enum": ["latest", "earliest", "pending"]
+ }
+ ]
+}
diff --git a/packages/json-schemas/schemas/block_range_schema.json b/packages/json-schemas/schemas/block_range_schema.json
new file mode 100644
index 000000000..b14294649
--- /dev/null
+++ b/packages/json-schemas/schemas/block_range_schema.json
@@ -0,0 +1,8 @@
+{
+ "id": "/blockRangeSchema",
+ "properties": {
+ "fromBlock": { "$ref": "/blockParamSchema" },
+ "toBlock": { "$ref": "/blockParamSchema" }
+ },
+ "type": "object"
+}
diff --git a/packages/json-schemas/schemas/block_range_schema.ts b/packages/json-schemas/schemas/block_range_schema.ts
deleted file mode 100644
index 9eb242fc6..000000000
--- a/packages/json-schemas/schemas/block_range_schema.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-export const blockParamSchema = {
- id: '/blockParamSchema',
- oneOf: [
- {
- type: 'number',
- },
- {
- enum: ['latest', 'earliest', 'pending'],
- },
- ],
-};
-
-export const blockRangeSchema = {
- id: '/blockRangeSchema',
- properties: {
- fromBlock: { $ref: '/blockParamSchema' },
- toBlock: { $ref: '/blockParamSchema' },
- },
- type: 'object',
-};
diff --git a/packages/json-schemas/schemas/call_data_schema.json b/packages/json-schemas/schemas/call_data_schema.json
new file mode 100644
index 000000000..c5972e8c1
--- /dev/null
+++ b/packages/json-schemas/schemas/call_data_schema.json
@@ -0,0 +1,27 @@
+{
+ "id": "/callDataSchema",
+ "properties": {
+ "from": { "$ref": "/addressSchema" },
+ "to": { "$ref": "/addressSchema" },
+ "value": {
+ "oneOf": [{ "$ref": "/numberSchema" }, { "$ref": "/jsNumber" }]
+ },
+ "gas": {
+ "oneOf": [{ "$ref": "/numberSchema" }, { "$ref": "/jsNumber" }]
+ },
+ "gasPrice": {
+ "oneOf": [{ "$ref": "/numberSchema" }, { "$ref": "/jsNumber" }]
+ },
+ "data": {
+ "type": "string",
+ "pattern": "^0x[0-9a-f]*$"
+ },
+ "nonce": {
+ "type": "number",
+ "minimum": 0
+ }
+ },
+ "required": [],
+ "type": "object",
+ "additionalProperties": false
+}
diff --git a/packages/json-schemas/schemas/call_data_schema.ts b/packages/json-schemas/schemas/call_data_schema.ts
deleted file mode 100644
index 4c77d9f9d..000000000
--- a/packages/json-schemas/schemas/call_data_schema.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-export const callDataSchema = {
- id: '/callDataSchema',
- properties: {
- from: { $ref: '/addressSchema' },
- to: { $ref: '/addressSchema' },
- value: {
- oneOf: [{ $ref: '/numberSchema' }, { $ref: '/jsNumber' }],
- },
- gas: {
- oneOf: [{ $ref: '/numberSchema' }, { $ref: '/jsNumber' }],
- },
- gasPrice: {
- oneOf: [{ $ref: '/numberSchema' }, { $ref: '/jsNumber' }],
- },
- data: {
- type: 'string',
- pattern: '^0x[0-9a-f]*$',
- },
- nonce: {
- type: 'number',
- minimum: 0,
- },
- },
- required: [],
- type: 'object',
- additionalProperties: false,
-};
diff --git a/packages/json-schemas/schemas/ec_signature_parameter_schema.json b/packages/json-schemas/schemas/ec_signature_parameter_schema.json
new file mode 100644
index 000000000..0c08ec240
--- /dev/null
+++ b/packages/json-schemas/schemas/ec_signature_parameter_schema.json
@@ -0,0 +1,5 @@
+{
+ "id": "/ecSignatureParameterSchema",
+ "type": "string",
+ "pattern": "^0[xX][0-9A-Fa-f]{64}$"
+}
diff --git a/packages/json-schemas/schemas/ec_signature_schema.json b/packages/json-schemas/schemas/ec_signature_schema.json
new file mode 100644
index 000000000..bc79ca5e9
--- /dev/null
+++ b/packages/json-schemas/schemas/ec_signature_schema.json
@@ -0,0 +1,14 @@
+{
+ "id": "/ECSignature",
+ "properties": {
+ "v": {
+ "type": "number",
+ "minimum": 27,
+ "maximum": 28
+ },
+ "r": { "$ref": "/ecSignatureParameterSchema" },
+ "s": { "$ref": "/ecSignatureParameterSchema" }
+ },
+ "required": ["v", "r", "s"],
+ "type": "object"
+}
diff --git a/packages/json-schemas/schemas/ec_signature_schema.ts b/packages/json-schemas/schemas/ec_signature_schema.ts
deleted file mode 100644
index c59532f09..000000000
--- a/packages/json-schemas/schemas/ec_signature_schema.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-export const ecSignatureParameterSchema = {
- id: '/ecSignatureParameterSchema',
- type: 'string',
- pattern: '^0[xX][0-9A-Fa-f]{64}$',
-};
-
-export const ecSignatureSchema = {
- id: '/ECSignature',
- properties: {
- v: {
- type: 'number',
- minimum: 27,
- maximum: 28,
- },
- r: { $ref: '/ecSignatureParameterSchema' },
- s: { $ref: '/ecSignatureParameterSchema' },
- },
- required: ['v', 'r', 's'],
- type: 'object',
-};
diff --git a/packages/json-schemas/schemas/eip712_typed_data.ts b/packages/json-schemas/schemas/eip712_typed_data.ts
deleted file mode 100644
index 31ad74610..000000000
--- a/packages/json-schemas/schemas/eip712_typed_data.ts
+++ /dev/null
@@ -1,28 +0,0 @@
-export const eip712TypedDataSchema = {
- id: '/eip712TypedData',
- type: 'object',
- properties: {
- types: {
- type: 'object',
- properties: {
- EIP712Domain: { type: 'array' },
- },
- additionalProperties: {
- type: 'array',
- items: {
- type: 'object',
- properties: {
- name: { type: 'string' },
- type: { type: 'string' },
- },
- required: ['name', 'type'],
- },
- },
- required: ['EIP712Domain'],
- },
- primaryType: { type: 'string' },
- domain: { type: 'object' },
- message: { type: 'object' },
- },
- required: ['types', 'primaryType', 'domain', 'message'],
-};
diff --git a/packages/json-schemas/schemas/eip712_typed_data_schema.json b/packages/json-schemas/schemas/eip712_typed_data_schema.json
new file mode 100644
index 000000000..8efd6de44
--- /dev/null
+++ b/packages/json-schemas/schemas/eip712_typed_data_schema.json
@@ -0,0 +1,28 @@
+{
+ "id": "/eip712TypedDataSchema",
+ "type": "object",
+ "properties": {
+ "types": {
+ "type": "object",
+ "properties": {
+ "EIP712Domain": { "type": "array" }
+ },
+ "additionalProperties": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "name": { "type": "string" },
+ "type": { "type": "string" }
+ },
+ "required": ["name", "type"]
+ }
+ },
+ "required": ["EIP712Domain"]
+ },
+ "primaryType": { "type": "string" },
+ "domain": { "type": "object" },
+ "message": { "type": "object" }
+ },
+ "required": ["types", "primaryType", "domain", "message"]
+}
diff --git a/packages/json-schemas/schemas/hex_schema.json b/packages/json-schemas/schemas/hex_schema.json
new file mode 100644
index 000000000..f37815d5b
--- /dev/null
+++ b/packages/json-schemas/schemas/hex_schema.json
@@ -0,0 +1,5 @@
+{
+ "id": "/hexSchema",
+ "type": "string",
+ "pattern": "^0x(([0-9a-f][0-9a-f])+)?$"
+}
diff --git a/packages/json-schemas/schemas/index_filter_values_schema.json b/packages/json-schemas/schemas/index_filter_values_schema.json
new file mode 100644
index 000000000..bec00d79e
--- /dev/null
+++ b/packages/json-schemas/schemas/index_filter_values_schema.json
@@ -0,0 +1,7 @@
+{
+ "id": "/indexFilterValuesSchema",
+ "additionalProperties": {
+ "oneOf": [{ "$ref": "/numberSchema" }, { "$ref": "/addressSchema" }, { "$ref": "/orderHashSchema" }]
+ },
+ "type": "object"
+}
diff --git a/packages/json-schemas/schemas/index_filter_values_schema.ts b/packages/json-schemas/schemas/index_filter_values_schema.ts
deleted file mode 100644
index f3c8cef68..000000000
--- a/packages/json-schemas/schemas/index_filter_values_schema.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-export const indexFilterValuesSchema = {
- id: '/indexFilterValuesSchema',
- additionalProperties: {
- oneOf: [{ $ref: '/numberSchema' }, { $ref: '/addressSchema' }, { $ref: '/orderHashSchema' }],
- },
- type: 'object',
-};
diff --git a/packages/json-schemas/schemas/js_number.json b/packages/json-schemas/schemas/js_number.json
new file mode 100644
index 000000000..6a72d92c0
--- /dev/null
+++ b/packages/json-schemas/schemas/js_number.json
@@ -0,0 +1,5 @@
+{
+ "id": "/jsNumber",
+ "type": "number",
+ "minimum": 0
+}
diff --git a/packages/json-schemas/schemas/number_schema.json b/packages/json-schemas/schemas/number_schema.json
new file mode 100644
index 000000000..a48f3e8cf
--- /dev/null
+++ b/packages/json-schemas/schemas/number_schema.json
@@ -0,0 +1,5 @@
+{
+ "id": "/numberSchema",
+ "type": "string",
+ "pattern": "^\\d+(\\.\\d+)?$"
+}
diff --git a/packages/json-schemas/schemas/order_cancel_schema.json b/packages/json-schemas/schemas/order_cancel_schema.json
new file mode 100644
index 000000000..8d0999941
--- /dev/null
+++ b/packages/json-schemas/schemas/order_cancel_schema.json
@@ -0,0 +1,12 @@
+{
+ "id": "/orderCancellationRequestsSchema",
+ "type": "array",
+ "items": {
+ "properties": {
+ "order": { "$ref": "/orderSchema" },
+ "takerTokenCancelAmount": { "$ref": "/wholeNumberSchema" }
+ },
+ "required": ["order", "takerTokenCancelAmount"],
+ "type": "object"
+ }
+}
diff --git a/packages/json-schemas/schemas/order_cancel_schema.ts b/packages/json-schemas/schemas/order_cancel_schema.ts
deleted file mode 100644
index e4edfbca9..000000000
--- a/packages/json-schemas/schemas/order_cancel_schema.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-export const orderCancellationRequestsSchema = {
- id: '/orderCancellationRequestsSchema',
- type: 'array',
- items: {
- properties: {
- order: { $ref: '/orderSchema' },
- takerTokenCancelAmount: { $ref: '/numberSchema' },
- },
- required: ['order', 'takerTokenCancelAmount'],
- type: 'object',
- },
-};
diff --git a/packages/json-schemas/schemas/order_fill_or_kill_requests_schema.json b/packages/json-schemas/schemas/order_fill_or_kill_requests_schema.json
new file mode 100644
index 000000000..73bbf20bb
--- /dev/null
+++ b/packages/json-schemas/schemas/order_fill_or_kill_requests_schema.json
@@ -0,0 +1,12 @@
+{
+ "id": "/orderFillOrKillRequestsSchema",
+ "type": "array",
+ "items": {
+ "properties": {
+ "signedOrder": { "$ref": "/signedOrderSchema" },
+ "fillTakerAmount": { "$ref": "/wholeNumberSchema" }
+ },
+ "required": ["signedOrder", "fillTakerAmount"],
+ "type": "object"
+ }
+}
diff --git a/packages/json-schemas/schemas/order_fill_or_kill_requests_schema.ts b/packages/json-schemas/schemas/order_fill_or_kill_requests_schema.ts
deleted file mode 100644
index e2c18ef0a..000000000
--- a/packages/json-schemas/schemas/order_fill_or_kill_requests_schema.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-export const orderFillOrKillRequestsSchema = {
- id: '/orderFillOrKillRequestsSchema',
- type: 'array',
- items: {
- properties: {
- signedOrder: { $ref: '/signedOrderSchema' },
- fillTakerAmount: { $ref: '/numberSchema' },
- },
- required: ['signedOrder', 'fillTakerAmount'],
- type: 'object',
- },
-};
diff --git a/packages/json-schemas/schemas/order_fill_requests_schema.json b/packages/json-schemas/schemas/order_fill_requests_schema.json
new file mode 100644
index 000000000..d06fb19a2
--- /dev/null
+++ b/packages/json-schemas/schemas/order_fill_requests_schema.json
@@ -0,0 +1,12 @@
+{
+ "id": "/orderFillRequestsSchema",
+ "type": "array",
+ "items": {
+ "properties": {
+ "signedOrder": { "$ref": "/signedOrderSchema" },
+ "takerTokenFillAmount": { "$ref": "/wholeNumberSchema" }
+ },
+ "required": ["signedOrder", "takerTokenFillAmount"],
+ "type": "object"
+ }
+}
diff --git a/packages/json-schemas/schemas/order_fill_requests_schema.ts b/packages/json-schemas/schemas/order_fill_requests_schema.ts
deleted file mode 100644
index ea8b35e54..000000000
--- a/packages/json-schemas/schemas/order_fill_requests_schema.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-export const orderFillRequestsSchema = {
- id: '/orderFillRequestsSchema',
- type: 'array',
- items: {
- properties: {
- signedOrder: { $ref: '/signedOrderSchema' },
- takerTokenFillAmount: { $ref: '/numberSchema' },
- },
- required: ['signedOrder', 'takerTokenFillAmount'],
- type: 'object',
- },
-};
diff --git a/packages/json-schemas/schemas/order_hash_schema.json b/packages/json-schemas/schemas/order_hash_schema.json
new file mode 100644
index 000000000..4a770579f
--- /dev/null
+++ b/packages/json-schemas/schemas/order_hash_schema.json
@@ -0,0 +1,5 @@
+{
+ "id": "/orderHashSchema",
+ "type": "string",
+ "pattern": "^0x[0-9a-fA-F]{64}$"
+}
diff --git a/packages/json-schemas/schemas/order_hash_schema.ts b/packages/json-schemas/schemas/order_hash_schema.ts
deleted file mode 100644
index 9773a88f9..000000000
--- a/packages/json-schemas/schemas/order_hash_schema.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-export const orderHashSchema = {
- id: '/orderHashSchema',
- type: 'string',
- pattern: '^0x[0-9a-fA-F]{64}$',
-};
diff --git a/packages/json-schemas/schemas/order_schema.json b/packages/json-schemas/schemas/order_schema.json
new file mode 100644
index 000000000..c70b9e2dd
--- /dev/null
+++ b/packages/json-schemas/schemas/order_schema.json
@@ -0,0 +1,34 @@
+{
+ "id": "/orderSchema",
+ "properties": {
+ "makerAddress": { "$ref": "/addressSchema" },
+ "takerAddress": { "$ref": "/addressSchema" },
+ "makerFee": { "$ref": "/wholeNumberSchema" },
+ "takerFee": { "$ref": "/wholeNumberSchema" },
+ "senderAddress": { "$ref": "/addressSchema" },
+ "makerAssetAmount": { "$ref": "/wholeNumberSchema" },
+ "takerAssetAmount": { "$ref": "/wholeNumberSchema" },
+ "makerAssetData": { "$ref": "/hexSchema" },
+ "takerAssetData": { "$ref": "/hexSchema" },
+ "salt": { "$ref": "/wholeNumberSchema" },
+ "exchangeAddress": { "$ref": "/addressSchema" },
+ "feeRecipientAddress": { "$ref": "/addressSchema" },
+ "expirationTimeSeconds": { "$ref": "/wholeNumberSchema" }
+ },
+ "required": [
+ "makerAddress",
+ "takerAddress",
+ "makerFee",
+ "takerFee",
+ "senderAddress",
+ "makerAssetAmount",
+ "takerAssetAmount",
+ "makerAssetData",
+ "takerAssetData",
+ "salt",
+ "exchangeAddress",
+ "feeRecipientAddress",
+ "expirationTimeSeconds"
+ ],
+ "type": "object"
+}
diff --git a/packages/json-schemas/schemas/order_schemas.ts b/packages/json-schemas/schemas/order_schemas.ts
deleted file mode 100644
index eb7fdaf5a..000000000
--- a/packages/json-schemas/schemas/order_schemas.ts
+++ /dev/null
@@ -1,47 +0,0 @@
-export const orderSchema = {
- id: '/orderSchema',
- properties: {
- makerAddress: { $ref: '/addressSchema' },
- takerAddress: { $ref: '/addressSchema' },
- makerFee: { $ref: '/numberSchema' },
- takerFee: { $ref: '/numberSchema' },
- senderAddress: { $ref: '/addressSchema' },
- makerAssetAmount: { $ref: '/numberSchema' },
- takerAssetAmount: { $ref: '/numberSchema' },
- makerAssetData: { $ref: '/hexSchema' },
- takerAssetData: { $ref: '/hexSchema' },
- salt: { $ref: '/numberSchema' },
- exchangeAddress: { $ref: '/addressSchema' },
- feeRecipientAddress: { $ref: '/addressSchema' },
- expirationTimeSeconds: { $ref: '/numberSchema' },
- },
- required: [
- 'makerAddress',
- 'takerAddress',
- 'makerFee',
- 'takerFee',
- 'senderAddress',
- 'makerAssetAmount',
- 'takerAssetAmount',
- 'makerAssetData',
- 'takerAssetData',
- 'salt',
- 'exchangeAddress',
- 'feeRecipientAddress',
- 'expirationTimeSeconds',
- ],
- type: 'object',
-};
-
-export const signedOrderSchema = {
- id: '/signedOrderSchema',
- allOf: [
- { $ref: '/orderSchema' },
- {
- properties: {
- signature: { $ref: '/hexSchema' },
- },
- required: ['signature'],
- },
- ],
-};
diff --git a/packages/json-schemas/schemas/orders_schema.json b/packages/json-schemas/schemas/orders_schema.json
new file mode 100644
index 000000000..1e1c6a875
--- /dev/null
+++ b/packages/json-schemas/schemas/orders_schema.json
@@ -0,0 +1,5 @@
+{
+ "id": "/ordersSchema",
+ "type": "array",
+ "items": { "$ref": "/orderSchema" }
+}
diff --git a/packages/json-schemas/schemas/orders_schema.ts b/packages/json-schemas/schemas/orders_schema.ts
deleted file mode 100644
index de0abcf00..000000000
--- a/packages/json-schemas/schemas/orders_schema.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-export const ordersSchema = {
- id: '/ordersSchema',
- type: 'array',
- items: { $ref: '/orderSchema' },
-};
diff --git a/packages/json-schemas/schemas/paginated_collection_schema.json b/packages/json-schemas/schemas/paginated_collection_schema.json
new file mode 100644
index 000000000..9dcedf5b4
--- /dev/null
+++ b/packages/json-schemas/schemas/paginated_collection_schema.json
@@ -0,0 +1,10 @@
+{
+ "id": "/paginatedCollectionSchema",
+ "type": "object",
+ "properties": {
+ "total": { "type": "number" },
+ "perPage": { "type": "number" },
+ "page": { "type": "number" }
+ },
+ "required": ["total", "perPage", "page"]
+}
diff --git a/packages/json-schemas/schemas/paginated_collection_schema.ts b/packages/json-schemas/schemas/paginated_collection_schema.ts
deleted file mode 100644
index 16044c70a..000000000
--- a/packages/json-schemas/schemas/paginated_collection_schema.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-export const paginatedCollectionSchema = {
- id: '/paginatedCollectionSchema',
- type: 'object',
- properties: {
- total: { type: 'number' },
- perPage: { type: 'number' },
- page: { type: 'number' },
- },
- required: ['total', 'perPage', 'page'],
-};
diff --git a/packages/json-schemas/schemas/relayer_api_asset_data_pairs_response_schema.json b/packages/json-schemas/schemas/relayer_api_asset_data_pairs_response_schema.json
new file mode 100644
index 000000000..d1150d3db
--- /dev/null
+++ b/packages/json-schemas/schemas/relayer_api_asset_data_pairs_response_schema.json
@@ -0,0 +1,13 @@
+{
+ "id": "/relayerApiAssetDataPairsResponseSchema",
+ "type": "object",
+ "allOf": [
+ { "$ref": "/paginatedCollectionSchema" },
+ {
+ "properties": {
+ "records": { "$ref": "/relayerApiAssetDataPairsSchema" }
+ },
+ "required": ["records"]
+ }
+ ]
+}
diff --git a/packages/json-schemas/schemas/relayer_api_asset_data_pairs_schema.json b/packages/json-schemas/schemas/relayer_api_asset_data_pairs_schema.json
new file mode 100644
index 000000000..62d4745b8
--- /dev/null
+++ b/packages/json-schemas/schemas/relayer_api_asset_data_pairs_schema.json
@@ -0,0 +1,12 @@
+{
+ "id": "/relayerApiAssetDataPairsSchema",
+ "type": "array",
+ "items": {
+ "properties": {
+ "assetDataA": { "$ref": "/relayerApiAssetDataTradeInfoSchema" },
+ "assetDataB": { "$ref": "/relayerApiAssetDataTradeInfoSchema" }
+ },
+ "required": ["assetDataA", "assetDataB"],
+ "type": "object"
+ }
+}
diff --git a/packages/json-schemas/schemas/relayer_api_asset_data_trade_info_schema.json b/packages/json-schemas/schemas/relayer_api_asset_data_trade_info_schema.json
new file mode 100644
index 000000000..e0f274c5d
--- /dev/null
+++ b/packages/json-schemas/schemas/relayer_api_asset_data_trade_info_schema.json
@@ -0,0 +1,11 @@
+{
+ "id": "/relayerApiAssetDataTradeInfoSchema",
+ "type": "object",
+ "properties": {
+ "assetData": { "$ref": "/hexSchema" },
+ "minAmount": { "$ref": "/wholeNumberSchema" },
+ "maxAmount": { "$ref": "/wholeNumberSchema" },
+ "precision": { "type": "number" }
+ },
+ "required": ["assetData"]
+}
diff --git a/packages/json-schemas/schemas/relayer_api_asset_pairs_response_schema.ts b/packages/json-schemas/schemas/relayer_api_asset_pairs_response_schema.ts
deleted file mode 100644
index c13396d29..000000000
--- a/packages/json-schemas/schemas/relayer_api_asset_pairs_response_schema.ts
+++ /dev/null
@@ -1,38 +0,0 @@
-export const relayerApiAssetDataPairsResponseSchema = {
- id: '/relayerApiAssetDataPairsResponseSchema',
- type: 'object',
- allOf: [
- { $ref: '/paginatedCollectionSchema' },
- {
- properties: {
- records: { $ref: '/relayerApiAssetDataPairsSchema' },
- },
- required: ['records'],
- },
- ],
-};
-
-export const relayerApiAssetDataPairsSchema = {
- id: '/relayerApiAssetDataPairsSchema',
- type: 'array',
- items: {
- properties: {
- assetDataA: { $ref: '/relayerApiAssetDataTradeInfoSchema' },
- assetDataB: { $ref: '/relayerApiAssetDataTradeInfoSchema' },
- },
- required: ['assetDataA', 'assetDataB'],
- type: 'object',
- },
-};
-
-export const relayerApiAssetDataTradeInfoSchema = {
- id: '/relayerApiAssetDataTradeInfoSchema',
- type: 'object',
- properties: {
- assetData: { $ref: '/hexSchema' },
- minAmount: { $ref: '/numberSchema' },
- maxAmount: { $ref: '/numberSchema' },
- precision: { type: 'number' },
- },
- required: ['assetData'],
-};
diff --git a/packages/json-schemas/schemas/relayer_api_error_response_schema.json b/packages/json-schemas/schemas/relayer_api_error_response_schema.json
new file mode 100644
index 000000000..be4659b0b
--- /dev/null
+++ b/packages/json-schemas/schemas/relayer_api_error_response_schema.json
@@ -0,0 +1,21 @@
+{
+ "id": "/relayerApiErrorResponseSchema",
+ "type": "object",
+ "properties": {
+ "code": { "type": "integer", "minimum": 100, "maximum": 103 },
+ "reason": { "type": "string" },
+ "validationErrors": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "field": { "type": "string" },
+ "code": { "type": "integer", "minimum": 1000, "maximum": 1006 },
+ "reason": { "type": "string" }
+ },
+ "required": ["field", "code", "reason"]
+ }
+ }
+ },
+ "required": ["code", "reason"]
+}
diff --git a/packages/json-schemas/schemas/relayer_api_error_response_schema.ts b/packages/json-schemas/schemas/relayer_api_error_response_schema.ts
deleted file mode 100644
index 79e33fc85..000000000
--- a/packages/json-schemas/schemas/relayer_api_error_response_schema.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-export const relayerApiErrorResponseSchema = {
- id: '/relayerApiErrorResponseSchema',
- type: 'object',
- properties: {
- code: { type: 'integer', minimum: 100, maximum: 103 },
- reason: { type: 'string' },
- validationErrors: {
- type: 'array',
- items: {
- type: 'object',
- properties: {
- field: { type: 'string' },
- code: { type: 'integer', minimum: 1000, maximum: 1006 },
- reason: { type: 'string' },
- },
- required: ['field', 'code', 'reason'],
- },
- },
- },
- required: ['code', 'reason'],
-};
diff --git a/packages/json-schemas/schemas/relayer_api_fee_recipients_response_schema.json b/packages/json-schemas/schemas/relayer_api_fee_recipients_response_schema.json
new file mode 100644
index 000000000..c73506dbb
--- /dev/null
+++ b/packages/json-schemas/schemas/relayer_api_fee_recipients_response_schema.json
@@ -0,0 +1,16 @@
+{
+ "id": "/relayerApiFeeRecipientsResponseSchema",
+ "type": "object",
+ "allOf": [
+ { "$ref": "/paginatedCollectionSchema" },
+ {
+ "properties": {
+ "records": {
+ "type": "array",
+ "items": { "$ref": "/addressSchema" }
+ }
+ },
+ "required": ["records"]
+ }
+ ]
+}
diff --git a/packages/json-schemas/schemas/relayer_api_fee_recipients_response_schema.ts b/packages/json-schemas/schemas/relayer_api_fee_recipients_response_schema.ts
deleted file mode 100644
index 5f6bc0530..000000000
--- a/packages/json-schemas/schemas/relayer_api_fee_recipients_response_schema.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-export const relayerApiFeeRecipientsResponseSchema = {
- id: '/relayerApiFeeRecipientsResponseSchema',
- type: 'object',
- allOf: [
- { $ref: '/paginatedCollectionSchema' },
- {
- properties: {
- records: {
- type: 'array',
- items: { $ref: '/addressSchema' },
- },
- },
- required: ['records'],
- },
- ],
-};
diff --git a/packages/json-schemas/schemas/relayer_api_order_config_payload_schema.json b/packages/json-schemas/schemas/relayer_api_order_config_payload_schema.json
new file mode 100644
index 000000000..f4583fc62
--- /dev/null
+++ b/packages/json-schemas/schemas/relayer_api_order_config_payload_schema.json
@@ -0,0 +1,24 @@
+{
+ "id": "/relayerApiOrderConfigPayloadSchema",
+ "type": "object",
+ "properties": {
+ "makerAddress": { "$ref": "/addressSchema" },
+ "takerAddress": { "$ref": "/addressSchema" },
+ "makerAssetAmount": { "$ref": "/wholeNumberSchema" },
+ "takerAssetAmount": { "$ref": "/wholeNumberSchema" },
+ "makerAssetData": { "$ref": "/hexSchema" },
+ "takerAssetData": { "$ref": "/hexSchema" },
+ "exchangeAddress": { "$ref": "/addressSchema" },
+ "expirationTimeSeconds": { "$ref": "/wholeNumberSchema" }
+ },
+ "required": [
+ "makerAddress",
+ "takerAddress",
+ "makerAssetAmount",
+ "takerAssetAmount",
+ "makerAssetData",
+ "takerAssetData",
+ "exchangeAddress",
+ "expirationTimeSeconds"
+ ]
+}
diff --git a/packages/json-schemas/schemas/relayer_api_order_config_payload_schema.ts b/packages/json-schemas/schemas/relayer_api_order_config_payload_schema.ts
deleted file mode 100644
index 8d1d408d6..000000000
--- a/packages/json-schemas/schemas/relayer_api_order_config_payload_schema.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-export const relayerApiOrderConfigPayloadSchema = {
- id: '/relayerApiOrderConfigPayloadSchema',
- type: 'object',
- properties: {
- makerAddress: { $ref: '/addressSchema' },
- takerAddress: { $ref: '/addressSchema' },
- makerAssetAmount: { $ref: '/numberSchema' },
- takerAssetAmount: { $ref: '/numberSchema' },
- makerAssetData: { $ref: '/hexSchema' },
- takerAssetData: { $ref: '/hexSchema' },
- exchangeAddress: { $ref: '/addressSchema' },
- expirationTimeSeconds: { $ref: '/numberSchema' },
- },
- required: [
- 'makerAddress',
- 'takerAddress',
- 'makerAssetAmount',
- 'takerAssetAmount',
- 'makerAssetData',
- 'takerAssetData',
- 'exchangeAddress',
- 'expirationTimeSeconds',
- ],
-};
diff --git a/packages/json-schemas/schemas/relayer_api_order_config_response_schema.json b/packages/json-schemas/schemas/relayer_api_order_config_response_schema.json
new file mode 100644
index 000000000..8193861e1
--- /dev/null
+++ b/packages/json-schemas/schemas/relayer_api_order_config_response_schema.json
@@ -0,0 +1,11 @@
+{
+ "id": "/relayerApiOrderConfigResponseSchema",
+ "type": "object",
+ "properties": {
+ "makerFee": { "$ref": "/wholeNumberSchema" },
+ "takerFee": { "$ref": "/wholeNumberSchema" },
+ "feeRecipientAddress": { "$ref": "/addressSchema" },
+ "senderAddress": { "$ref": "/addressSchema" }
+ },
+ "required": ["makerFee", "takerFee", "feeRecipientAddress", "senderAddress"]
+}
diff --git a/packages/json-schemas/schemas/relayer_api_order_config_response_schema.ts b/packages/json-schemas/schemas/relayer_api_order_config_response_schema.ts
deleted file mode 100644
index 390d0b262..000000000
--- a/packages/json-schemas/schemas/relayer_api_order_config_response_schema.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-export const relayerApiOrderConfigResponseSchema = {
- id: '/relayerApiOrderConfigResponseSchema',
- type: 'object',
- properties: {
- makerFee: { $ref: '/numberSchema' },
- takerFee: { $ref: '/numberSchema' },
- feeRecipientAddress: { $ref: '/addressSchema' },
- senderAddress: { $ref: '/addressSchema' },
- },
- required: ['makerFee', 'takerFee', 'feeRecipientAddress', 'senderAddress'],
-};
diff --git a/packages/json-schemas/schemas/relayer_api_order_schema.json b/packages/json-schemas/schemas/relayer_api_order_schema.json
new file mode 100644
index 000000000..e0f6539b9
--- /dev/null
+++ b/packages/json-schemas/schemas/relayer_api_order_schema.json
@@ -0,0 +1,9 @@
+{
+ "id": "/relayerApiOrderSchema",
+ "type": "object",
+ "properties": {
+ "order": { "$ref": "/orderSchema" },
+ "metaData": { "type": "object" }
+ },
+ "required": ["order", "metaData"]
+}
diff --git a/packages/json-schemas/schemas/relayer_api_order_schema.ts b/packages/json-schemas/schemas/relayer_api_order_schema.ts
deleted file mode 100644
index 3952e9683..000000000
--- a/packages/json-schemas/schemas/relayer_api_order_schema.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-export const relayerApiOrderSchema = {
- id: '/relayerApiOrderSchema',
- type: 'object',
- properties: {
- order: { $ref: '/orderSchema' },
- metaData: { type: 'object' },
- },
- required: ['order', 'metaData'],
-};
diff --git a/packages/json-schemas/schemas/relayer_api_orderbook_response_schema.json b/packages/json-schemas/schemas/relayer_api_orderbook_response_schema.json
new file mode 100644
index 000000000..b44f2a740
--- /dev/null
+++ b/packages/json-schemas/schemas/relayer_api_orderbook_response_schema.json
@@ -0,0 +1,9 @@
+{
+ "id": "/relayerApiOrderbookResponseSchema",
+ "type": "object",
+ "properties": {
+ "bids": { "$ref": "/relayerApiOrdersResponseSchema" },
+ "asks": { "$ref": "/relayerApiOrdersResponseSchema" }
+ },
+ "required": ["bids", "asks"]
+}
diff --git a/packages/json-schemas/schemas/relayer_api_orderbook_response_schema.ts b/packages/json-schemas/schemas/relayer_api_orderbook_response_schema.ts
deleted file mode 100644
index 7c0b8e0df..000000000
--- a/packages/json-schemas/schemas/relayer_api_orderbook_response_schema.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-export const relayerApiOrderbookResponseSchema = {
- id: '/relayerApiOrderbookResponseSchema',
- type: 'object',
- properties: {
- bids: { $ref: '/relayerApiOrdersResponseSchema' },
- asks: { $ref: '/relayerApiOrdersResponseSchema' },
- },
- required: ['bids', 'asks'],
-};
diff --git a/packages/json-schemas/schemas/relayer_api_orders_channel_subscribe_payload_schema.json b/packages/json-schemas/schemas/relayer_api_orders_channel_subscribe_payload_schema.json
new file mode 100644
index 000000000..274ef1625
--- /dev/null
+++ b/packages/json-schemas/schemas/relayer_api_orders_channel_subscribe_payload_schema.json
@@ -0,0 +1,14 @@
+{
+ "id": "/relayerApiOrdersChannelSubscribePayloadSchema",
+ "type": "object",
+ "properties": {
+ "makerAssetProxyId": { "$ref": "/hexSchema" },
+ "takerAssetProxyId": { "$ref": "/hexSchema" },
+ "networkId": { "type": "number" },
+ "makerAssetAddress": { "$ref": "/addressSchema" },
+ "takerAssetAddress": { "$ref": "/addressSchema" },
+ "makerAssetData": { "$ref": "/hexSchema" },
+ "takerAssetData": { "$ref": "/hexSchema" },
+ "traderAssetData": { "$ref": "/hexSchema" }
+ }
+}
diff --git a/packages/json-schemas/schemas/relayer_api_orders_channel_subscribe_schema.json b/packages/json-schemas/schemas/relayer_api_orders_channel_subscribe_schema.json
new file mode 100644
index 000000000..29561d09f
--- /dev/null
+++ b/packages/json-schemas/schemas/relayer_api_orders_channel_subscribe_schema.json
@@ -0,0 +1,11 @@
+{
+ "id": "/relayerApiOrdersChannelSubscribeSchema",
+ "type": "object",
+ "properties": {
+ "type": { "enum": ["subscribe"] },
+ "channel": { "enum": ["orders"] },
+ "requestId": { "type": "string" },
+ "payload": { "$ref": "/relayerApiOrdersChannelSubscribePayloadSchema" }
+ },
+ "required": ["type", "channel", "requestId"]
+}
diff --git a/packages/json-schemas/schemas/relayer_api_orders_channel_subscribe_schema.ts b/packages/json-schemas/schemas/relayer_api_orders_channel_subscribe_schema.ts
deleted file mode 100644
index a3b9b6d95..000000000
--- a/packages/json-schemas/schemas/relayer_api_orders_channel_subscribe_schema.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-export const relayerApiOrdersChannelSubscribeSchema = {
- id: '/relayerApiOrdersChannelSubscribeSchema',
- type: 'object',
- properties: {
- type: { enum: ['subscribe'] },
- channel: { enum: ['orders'] },
- requestId: { type: 'string' },
- payload: { $ref: '/relayerApiOrdersChannelSubscribePayload' },
- },
- required: ['type', 'channel', 'requestId'],
-};
-
-export const relayerApiOrdersChannelSubscribePayload = {
- id: '/relayerApiOrdersChannelSubscribePayload',
- type: 'object',
- properties: {
- makerAssetProxyId: { $ref: '/hexSchema' },
- takerAssetProxyId: { $ref: '/hexSchema' },
- networkId: { type: 'number' },
- makerAssetAddress: { $ref: '/addressSchema' },
- takerAssetAddress: { $ref: '/addressSchema' },
- makerAssetData: { $ref: '/hexSchema' },
- takerAssetData: { $ref: '/hexSchema' },
- traderAssetData: { $ref: '/hexSchema' },
- },
-};
diff --git a/packages/json-schemas/schemas/relayer_api_orders_channel_update_response_schema.json b/packages/json-schemas/schemas/relayer_api_orders_channel_update_response_schema.json
new file mode 100644
index 000000000..239e7c586
--- /dev/null
+++ b/packages/json-schemas/schemas/relayer_api_orders_channel_update_response_schema.json
@@ -0,0 +1,11 @@
+{
+ "id": "/relayerApiOrdersChannelUpdateSchema",
+ "type": "object",
+ "properties": {
+ "type": { "enum": ["update"] },
+ "channel": { "enum": ["orders"] },
+ "requestId": { "type": "string" },
+ "payload": { "$ref": "/relayerApiOrdersSchema" }
+ },
+ "required": ["type", "channel", "requestId"]
+}
diff --git a/packages/json-schemas/schemas/relayer_api_orders_channel_update_response_schema.ts b/packages/json-schemas/schemas/relayer_api_orders_channel_update_response_schema.ts
deleted file mode 100644
index 800b818e2..000000000
--- a/packages/json-schemas/schemas/relayer_api_orders_channel_update_response_schema.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-export const relayerApiOrdersChannelUpdateSchema = {
- id: '/relayerApiOrdersChannelUpdateSchema',
- type: 'object',
- properties: {
- type: { enum: ['update'] },
- channel: { enum: ['orders'] },
- requestId: { type: 'string' },
- payload: { $ref: '/relayerApiOrdersSchema' },
- },
- required: ['type', 'channel', 'requestId'],
-};
diff --git a/packages/json-schemas/schemas/relayer_api_orders_response_schema.json b/packages/json-schemas/schemas/relayer_api_orders_response_schema.json
new file mode 100644
index 000000000..a5023a3fc
--- /dev/null
+++ b/packages/json-schemas/schemas/relayer_api_orders_response_schema.json
@@ -0,0 +1,13 @@
+{
+ "id": "/relayerApiOrdersResponseSchema",
+ "type": "object",
+ "allOf": [
+ { "$ref": "/paginatedCollectionSchema" },
+ {
+ "properties": {
+ "records": { "$ref": "/relayerApiOrdersSchema" }
+ },
+ "required": ["records"]
+ }
+ ]
+}
diff --git a/packages/json-schemas/schemas/relayer_api_orders_response_schema.ts b/packages/json-schemas/schemas/relayer_api_orders_response_schema.ts
deleted file mode 100644
index c10d64ca9..000000000
--- a/packages/json-schemas/schemas/relayer_api_orders_response_schema.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-export const relayerApiOrdersResponseSchema = {
- id: '/relayerApiOrdersResponseSchema',
- type: 'object',
- allOf: [
- { $ref: '/paginatedCollectionSchema' },
- {
- properties: {
- records: { $ref: '/relayerApiOrdersSchema' },
- },
- required: ['records'],
- },
- ],
-};
diff --git a/packages/json-schemas/schemas/relayer_api_orders_schema.json b/packages/json-schemas/schemas/relayer_api_orders_schema.json
new file mode 100644
index 000000000..84e75cd04
--- /dev/null
+++ b/packages/json-schemas/schemas/relayer_api_orders_schema.json
@@ -0,0 +1,5 @@
+{
+ "id": "/relayerApiOrdersSchema",
+ "type": "array",
+ "items": { "$ref": "/relayerApiOrderSchema" }
+}
diff --git a/packages/json-schemas/schemas/relayer_api_orders_schema.ts b/packages/json-schemas/schemas/relayer_api_orders_schema.ts
deleted file mode 100644
index ba8ce4722..000000000
--- a/packages/json-schemas/schemas/relayer_api_orders_schema.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-export const relayerApiOrdersSchema = {
- id: '/relayerApiOrdersSchema',
- type: 'array',
- items: { $ref: '/relayerApiOrderSchema' },
-};
diff --git a/packages/json-schemas/schemas/signed_order_schema.json b/packages/json-schemas/schemas/signed_order_schema.json
new file mode 100644
index 000000000..137ae4a24
--- /dev/null
+++ b/packages/json-schemas/schemas/signed_order_schema.json
@@ -0,0 +1,12 @@
+{
+ "id": "/signedOrderSchema",
+ "allOf": [
+ { "$ref": "/orderSchema" },
+ {
+ "properties": {
+ "signature": { "$ref": "/hexSchema" }
+ },
+ "required": ["signature"]
+ }
+ ]
+}
diff --git a/packages/json-schemas/schemas/signed_orders_schema.json b/packages/json-schemas/schemas/signed_orders_schema.json
new file mode 100644
index 000000000..e7c3a0b6c
--- /dev/null
+++ b/packages/json-schemas/schemas/signed_orders_schema.json
@@ -0,0 +1,5 @@
+{
+ "id": "/signedOrdersSchema",
+ "type": "array",
+ "items": { "$ref": "/signedOrderSchema" }
+}
diff --git a/packages/json-schemas/schemas/signed_orders_schema.ts b/packages/json-schemas/schemas/signed_orders_schema.ts
deleted file mode 100644
index e2a5aeb56..000000000
--- a/packages/json-schemas/schemas/signed_orders_schema.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-export const signedOrdersSchema = {
- id: '/signedOrdersSchema',
- type: 'array',
- items: { $ref: '/signedOrderSchema' },
-};
diff --git a/packages/json-schemas/schemas/token_schema.json b/packages/json-schemas/schemas/token_schema.json
new file mode 100644
index 000000000..31e41c4b8
--- /dev/null
+++ b/packages/json-schemas/schemas/token_schema.json
@@ -0,0 +1,11 @@
+{
+ "id": "/tokenSchema",
+ "properties": {
+ "name": { "type": "string" },
+ "symbol": { "type": "string" },
+ "decimals": { "type": "number" },
+ "address": { "$ref": "/addressSchema" }
+ },
+ "required": ["name", "symbol", "decimals", "address"],
+ "type": "object"
+}
diff --git a/packages/json-schemas/schemas/token_schema.ts b/packages/json-schemas/schemas/token_schema.ts
deleted file mode 100644
index a0b1ae27f..000000000
--- a/packages/json-schemas/schemas/token_schema.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-export const tokenSchema = {
- id: '/tokenSchema',
- properties: {
- name: { type: 'string' },
- symbol: { type: 'string' },
- decimals: { type: 'number' },
- address: { $ref: '/addressSchema' },
- },
- required: ['name', 'symbol', 'decimals', 'address'],
- type: 'object',
-};
diff --git a/packages/json-schemas/schemas/tx_data_schema.json b/packages/json-schemas/schemas/tx_data_schema.json
new file mode 100644
index 000000000..4643521ce
--- /dev/null
+++ b/packages/json-schemas/schemas/tx_data_schema.json
@@ -0,0 +1,26 @@
+{
+ "id": "/txDataSchema",
+ "properties": {
+ "from": { "$ref": "/addressSchema" },
+ "to": { "$ref": "/addressSchema" },
+ "value": {
+ "oneOf": [{ "$ref": "/numberSchema" }, { "$ref": "/jsNumber" }]
+ },
+ "gas": {
+ "oneOf": [{ "$ref": "/numberSchema" }, { "$ref": "/jsNumber" }]
+ },
+ "gasPrice": {
+ "oneOf": [{ "$ref": "/numberSchema" }, { "$ref": "/jsNumber" }]
+ },
+ "data": {
+ "type": "string",
+ "pattern": "^0x[0-9a-f]*$"
+ },
+ "nonce": {
+ "type": "number",
+ "minimum": 0
+ }
+ },
+ "required": ["from"],
+ "type": "object"
+}
diff --git a/packages/json-schemas/schemas/tx_data_schema.ts b/packages/json-schemas/schemas/tx_data_schema.ts
deleted file mode 100644
index c57e18461..000000000
--- a/packages/json-schemas/schemas/tx_data_schema.ts
+++ /dev/null
@@ -1,32 +0,0 @@
-export const jsNumber = {
- id: '/jsNumber',
- type: 'number',
- minimum: 0,
-};
-
-export const txDataSchema = {
- id: '/txDataSchema',
- properties: {
- from: { $ref: '/addressSchema' },
- to: { $ref: '/addressSchema' },
- value: {
- oneOf: [{ $ref: '/numberSchema' }, { $ref: '/jsNumber' }],
- },
- gas: {
- oneOf: [{ $ref: '/numberSchema' }, { $ref: '/jsNumber' }],
- },
- gasPrice: {
- oneOf: [{ $ref: '/numberSchema' }, { $ref: '/jsNumber' }],
- },
- data: {
- type: 'string',
- pattern: '^0x[0-9a-f]*$',
- },
- nonce: {
- type: 'number',
- minimum: 0,
- },
- },
- required: ['from'],
- type: 'object',
-};
diff --git a/packages/json-schemas/schemas/whole_number_schema.json b/packages/json-schemas/schemas/whole_number_schema.json
new file mode 100644
index 000000000..944ce820e
--- /dev/null
+++ b/packages/json-schemas/schemas/whole_number_schema.json
@@ -0,0 +1,5 @@
+{
+ "id": "/wholeNumberSchema",
+ "type": "string",
+ "pattern": "^\\d+$"
+}
diff --git a/packages/json-schemas/schemas/zero_ex_transaction_schema.json b/packages/json-schemas/schemas/zero_ex_transaction_schema.json
new file mode 100644
index 000000000..0c714f14d
--- /dev/null
+++ b/packages/json-schemas/schemas/zero_ex_transaction_schema.json
@@ -0,0 +1,10 @@
+{
+ "id": "/zeroExTransactionSchema",
+ "properties": {
+ "data": { "$ref": "/hexSchema" },
+ "signerAddress": { "$ref": "/addressSchema" },
+ "salt": { "$ref": "/wholeNumberSchema" }
+ },
+ "required": ["data", "salt", "signerAddress"],
+ "type": "object"
+}
diff --git a/packages/json-schemas/schemas/zero_ex_transaction_schema.ts b/packages/json-schemas/schemas/zero_ex_transaction_schema.ts
deleted file mode 100644
index 7f729b724..000000000
--- a/packages/json-schemas/schemas/zero_ex_transaction_schema.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-export const zeroExTransactionSchema = {
- id: '/zeroExTransactionSchema',
- properties: {
- data: { $ref: '/hexSchema' },
- signerAddress: { $ref: '/addressSchema' },
- salt: { $ref: '/numberSchema' },
- },
- required: ['data', 'salt', 'signerAddress'],
- type: 'object',
-};
diff --git a/packages/json-schemas/src/globals.d.ts b/packages/json-schemas/src/globals.d.ts
deleted file mode 100644
index 94e63a32d..000000000
--- a/packages/json-schemas/src/globals.d.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-declare module '*.json' {
- const json: any;
- /* tslint:disable */
- export default json;
- /* tslint:enable */
-}
diff --git a/packages/json-schemas/src/schemas.ts b/packages/json-schemas/src/schemas.ts
index 4eb96092d..8ece5de75 100644
--- a/packages/json-schemas/src/schemas.ts
+++ b/packages/json-schemas/src/schemas.ts
@@ -1,38 +1,41 @@
-import { addressSchema, hexSchema, numberSchema } from '../schemas/basic_type_schemas';
-import { blockParamSchema, blockRangeSchema } from '../schemas/block_range_schema';
-import { callDataSchema } from '../schemas/call_data_schema';
-import { ecSignatureParameterSchema, ecSignatureSchema } from '../schemas/ec_signature_schema';
-import { eip712TypedDataSchema } from '../schemas/eip712_typed_data';
-import { indexFilterValuesSchema } from '../schemas/index_filter_values_schema';
-import { orderCancellationRequestsSchema } from '../schemas/order_cancel_schema';
-import { orderFillOrKillRequestsSchema } from '../schemas/order_fill_or_kill_requests_schema';
-import { orderFillRequestsSchema } from '../schemas/order_fill_requests_schema';
-import { orderHashSchema } from '../schemas/order_hash_schema';
-import { orderSchema, signedOrderSchema } from '../schemas/order_schemas';
-import { ordersSchema } from '../schemas/orders_schema';
-import { paginatedCollectionSchema } from '../schemas/paginated_collection_schema';
-import {
- relayerApiAssetDataPairsResponseSchema,
- relayerApiAssetDataPairsSchema,
- relayerApiAssetDataTradeInfoSchema,
-} from '../schemas/relayer_api_asset_pairs_response_schema';
-import { relayerApiErrorResponseSchema } from '../schemas/relayer_api_error_response_schema';
-import { relayerApiFeeRecipientsResponseSchema } from '../schemas/relayer_api_fee_recipients_response_schema';
-import { relayerApiOrderConfigPayloadSchema } from '../schemas/relayer_api_order_config_payload_schema';
-import { relayerApiOrderConfigResponseSchema } from '../schemas/relayer_api_order_config_response_schema';
-import { relayerApiOrderSchema } from '../schemas/relayer_api_order_schema';
-import { relayerApiOrderbookResponseSchema } from '../schemas/relayer_api_orderbook_response_schema';
-import {
- relayerApiOrdersChannelSubscribePayload,
- relayerApiOrdersChannelSubscribeSchema,
-} from '../schemas/relayer_api_orders_channel_subscribe_schema';
-import { relayerApiOrdersChannelUpdateSchema } from '../schemas/relayer_api_orders_channel_update_response_schema';
-import { relayerApiOrdersResponseSchema } from '../schemas/relayer_api_orders_response_schema';
-import { relayerApiOrdersSchema } from '../schemas/relayer_api_orders_schema';
-import { signedOrdersSchema } from '../schemas/signed_orders_schema';
-import { tokenSchema } from '../schemas/token_schema';
-import { jsNumber, txDataSchema } from '../schemas/tx_data_schema';
-import { zeroExTransactionSchema } from '../schemas/zero_ex_transaction_schema';
+import * as addressSchema from '../schemas/address_schema.json';
+import * as blockParamSchema from '../schemas/block_param_schema.json';
+import * as blockRangeSchema from '../schemas/block_range_schema.json';
+import * as callDataSchema from '../schemas/call_data_schema.json';
+import * as ecSignatureParameterSchema from '../schemas/ec_signature_parameter_schema.json';
+import * as ecSignatureSchema from '../schemas/ec_signature_schema.json';
+import * as eip712TypedDataSchema from '../schemas/eip712_typed_data_schema.json';
+import * as hexSchema from '../schemas/hex_schema.json';
+import * as indexFilterValuesSchema from '../schemas/index_filter_values_schema.json';
+import * as jsNumber from '../schemas/js_number.json';
+import * as numberSchema from '../schemas/number_schema.json';
+import * as orderCancellationRequestsSchema from '../schemas/order_cancel_schema.json';
+import * as orderFillOrKillRequestsSchema from '../schemas/order_fill_or_kill_requests_schema.json';
+import * as orderFillRequestsSchema from '../schemas/order_fill_requests_schema.json';
+import * as orderHashSchema from '../schemas/order_hash_schema.json';
+import * as orderSchema from '../schemas/order_schema.json';
+import * as ordersSchema from '../schemas/orders_schema.json';
+import * as paginatedCollectionSchema from '../schemas/paginated_collection_schema.json';
+import * as relayerApiAssetDataPairsResponseSchema from '../schemas/relayer_api_asset_data_pairs_response_schema.json';
+import * as relayerApiAssetDataPairsSchema from '../schemas/relayer_api_asset_data_pairs_schema.json';
+import * as relayerApiAssetDataTradeInfoSchema from '../schemas/relayer_api_asset_data_trade_info_schema.json';
+import * as relayerApiErrorResponseSchema from '../schemas/relayer_api_error_response_schema.json';
+import * as relayerApiFeeRecipientsResponseSchema from '../schemas/relayer_api_fee_recipients_response_schema.json';
+import * as relayerApiOrderConfigPayloadSchema from '../schemas/relayer_api_order_config_payload_schema.json';
+import * as relayerApiOrderConfigResponseSchema from '../schemas/relayer_api_order_config_response_schema.json';
+import * as relayerApiOrderSchema from '../schemas/relayer_api_order_schema.json';
+import * as relayerApiOrderbookResponseSchema from '../schemas/relayer_api_orderbook_response_schema.json';
+import * as relayerApiOrdersChannelSubscribePayloadSchema from '../schemas/relayer_api_orders_channel_subscribe_payload_schema.json';
+import * as relayerApiOrdersChannelSubscribeSchema from '../schemas/relayer_api_orders_channel_subscribe_schema.json';
+import * as relayerApiOrdersChannelUpdateSchema from '../schemas/relayer_api_orders_channel_update_response_schema.json';
+import * as relayerApiOrdersResponseSchema from '../schemas/relayer_api_orders_response_schema.json';
+import * as relayerApiOrdersSchema from '../schemas/relayer_api_orders_schema.json';
+import * as signedOrderSchema from '../schemas/signed_order_schema.json';
+import * as signedOrdersSchema from '../schemas/signed_orders_schema.json';
+import * as tokenSchema from '../schemas/token_schema.json';
+import * as txDataSchema from '../schemas/tx_data_schema.json';
+import * as wholeNumberSchema from '../schemas/whole_number_schema.json';
+import * as zeroExTransactionSchema from '../schemas/zero_ex_transaction_schema.json';
export const schemas = {
numberSchema,
@@ -67,9 +70,10 @@ export const schemas = {
relayerApiAssetDataPairsResponseSchema,
relayerApiAssetDataTradeInfoSchema,
relayerApiOrdersChannelSubscribeSchema,
- relayerApiOrdersChannelSubscribePayload,
+ relayerApiOrdersChannelSubscribePayloadSchema,
relayerApiOrdersChannelUpdateSchema,
relayerApiOrdersResponseSchema,
relayerApiAssetDataPairsSchema,
zeroExTransactionSchema,
+ wholeNumberSchema,
};
diff --git a/packages/json-schemas/test/schema_test.ts b/packages/json-schemas/test/schema_test.ts
index 4e0f66ef5..bfa2c5668 100644
--- a/packages/json-schemas/test/schema_test.ts
+++ b/packages/json-schemas/test/schema_test.ts
@@ -1,4 +1,4 @@
-import { BigNumber } from '@0xproject/utils';
+import { BigNumber } from '@0x/utils';
import * as chai from 'chai';
import * as dirtyChai from 'dirty-chai';
import forEach = require('lodash.foreach');
@@ -36,6 +36,7 @@ const {
relayerApiOrdersChannelUpdateSchema,
relayerApiOrdersResponseSchema,
relayerApiOrderSchema,
+ wholeNumberSchema,
} = schemas;
describe('Schema', () => {
@@ -73,6 +74,17 @@ describe('Schema', () => {
validateAgainstSchema(testCases, numberSchema, shouldFail);
});
});
+ describe('#wholeNumberSchema', () => {
+ it('should validate valid numbers', () => {
+ const testCases = ['5', '42', '0'];
+ validateAgainstSchema(testCases, wholeNumberSchema);
+ });
+ it('should fail for invalid numbers', () => {
+ const testCases = ['1.3', '0.2', '00.00', '.3', '1.', 'abacaba', 'и', '1..0'];
+ const shouldFail = true;
+ validateAgainstSchema(testCases, wholeNumberSchema, shouldFail);
+ });
+ });
describe('#addressSchema', () => {
it('should validate valid addresses', () => {
const testCases = ['0x8b0292b11a196601ed2ce54b665cafeca0347d42', NULL_ADDRESS];
diff --git a/packages/json-schemas/tsconfig.json b/packages/json-schemas/tsconfig.json
index 96bf8789e..7b14166c0 100644
--- a/packages/json-schemas/tsconfig.json
+++ b/packages/json-schemas/tsconfig.json
@@ -2,7 +2,48 @@
"extends": "../../tsconfig",
"compilerOptions": {
"outDir": "lib",
- "rootDir": "."
+ "rootDir": ".",
+ "resolveJsonModule": true
},
- "include": ["./src/**/*", "./test/**/*", "./schemas/**/*"]
+ "include": ["./src/**/*", "./test/**/*"],
+ "files": [
+ "./schemas/address_schema.json",
+ "./schemas/number_schema.json",
+ "./schemas/hex_schema.json",
+ "./schemas/block_param_schema.json",
+ "./schemas/block_range_schema.json",
+ "./schemas/call_data_schema.json",
+ "./schemas/ec_signature_parameter_schema.json",
+ "./schemas/ec_signature_schema.json",
+ "./schemas/eip712_typed_data_schema.json",
+ "./schemas/order_cancel_schema.json",
+ "./schemas/order_fill_or_kill_requests_schema.json",
+ "./schemas/order_fill_requests_schema.json",
+ "./schemas/order_hash_schema.json",
+ "./schemas/order_schema.json",
+ "./schemas/signed_order_schema.json",
+ "./schemas/orders_schema.json",
+ "./schemas/paginated_collection_schema.json",
+ "./schemas/relayer_api_asset_data_pairs_response_schema.json",
+ "./schemas/relayer_api_asset_data_pairs_schema.json",
+ "./schemas/relayer_api_asset_data_trade_info_schema.json",
+ "./schemas/relayer_api_error_response_schema.json",
+ "./schemas/relayer_api_fee_recipients_response_schema.json",
+ "./schemas/relayer_api_order_config_payload_schema.json",
+ "./schemas/relayer_api_order_config_response_schema.json",
+ "./schemas/relayer_api_order_schema.json",
+ "./schemas/relayer_api_orderbook_response_schema.json",
+ "./schemas/relayer_api_orders_channel_subscribe_payload_schema.json",
+ "./schemas/relayer_api_orders_channel_subscribe_schema.json",
+ "./schemas/relayer_api_orders_channel_update_response_schema.json",
+ "./schemas/relayer_api_orders_response_schema.json",
+ "./schemas/relayer_api_orders_schema.json",
+ "./schemas/signed_orders_schema.json",
+ "./schemas/token_schema.json",
+ "./schemas/js_number.json",
+ "./schemas/zero_ex_transaction_schema.json",
+ "./schemas/tx_data_schema.json",
+ "./schemas/index_filter_values_schema.json",
+ "./schemas/whole_number_schema.json"
+ ]
}
diff --git a/packages/json-schemas/tslint.json b/packages/json-schemas/tslint.json
index ffaefe83a..dd9053357 100644
--- a/packages/json-schemas/tslint.json
+++ b/packages/json-schemas/tslint.json
@@ -1,3 +1,3 @@
{
- "extends": ["@0xproject/tslint-config"]
+ "extends": ["@0x/tslint-config"]
}
diff --git a/packages/metacoin/README.md b/packages/metacoin/README.md
index 15816cc67..4f9609dde 100644
--- a/packages/metacoin/README.md
+++ b/packages/metacoin/README.md
@@ -1,4 +1,4 @@
-## @0xproject/metacoin
+## @0x/metacoin
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:
@@ -35,13 +35,13 @@ yarn install
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
```bash
-PKG=@0xproject/metacoin yarn build
+PKG=@0x/metacoin yarn build
```
Or continuously rebuild on change:
```bash
-PKG=@0xproject/metacoin yarn watch
+PKG=@0x/metacoin yarn watch
```
### Clean
diff --git a/packages/metacoin/package.json b/packages/metacoin/package.json
index 58fc0b848..35a0834f2 100644
--- a/packages/metacoin/package.json
+++ b/packages/metacoin/package.json
@@ -1,13 +1,13 @@
{
- "name": "@0xproject/metacoin",
- "version": "0.0.23",
+ "name": "@0x/metacoin",
+ "version": "0.0.25",
"engines": {
"node": ">=6.12"
},
"private": true,
"description": "Example solidity project using 0x dev tools",
"scripts": {
- "lint": "tslint --project . --exclude **/src/contract_wrappers/**/*",
+ "lint": "tslint --format stylish --project . --exclude **/src/contract_wrappers/**/*",
"build": "yarn pre_build && tsc -b",
"build:ci": "yarn build",
"pre_build": "run-s compile generate_contract_wrappers copy_artifacts",
@@ -29,25 +29,25 @@
"author": "",
"license": "Apache-2.0",
"dependencies": {
- "@0xproject/abi-gen": "^1.0.13",
- "@0xproject/base-contract": "^3.0.1",
- "@0xproject/sol-cov": "^2.1.7",
- "@0xproject/subproviders": "^2.0.7",
- "@0xproject/tslint-config": "^1.0.8",
- "@0xproject/types": "^1.1.4",
- "@0xproject/typescript-typings": "^3.0.2",
- "@0xproject/utils": "^2.0.2",
- "@0xproject/web3-wrapper": "^3.0.3",
+ "@0x/abi-gen": "^1.0.15",
+ "@0x/base-contract": "^3.0.3",
+ "@0x/sol-cov": "^2.1.9",
+ "@0x/subproviders": "^2.1.1",
+ "@0x/tslint-config": "^1.0.10",
+ "@0x/types": "^1.2.1",
+ "@0x/typescript-typings": "^3.0.4",
+ "@0x/utils": "^2.0.4",
+ "@0x/web3-wrapper": "^3.1.1",
"@types/mocha": "^5.2.2",
"copyfiles": "^2.0.0",
- "ethereum-types": "^1.0.11",
+ "ethereum-types": "^1.1.2",
"ethers": "~4.0.4",
"lodash": "^4.17.5",
"run-s": "^0.0.0"
},
"devDependencies": {
- "@0xproject/dev-utils": "^1.0.12",
- "@0xproject/sol-compiler": "^1.1.7",
+ "@0x/dev-utils": "^1.0.14",
+ "@0x/sol-compiler": "^1.1.9",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
"chai-bignumber": "^2.0.1",
diff --git a/packages/metacoin/test/global_hooks.ts b/packages/metacoin/test/global_hooks.ts
index 7328531e4..437061b46 100644
--- a/packages/metacoin/test/global_hooks.ts
+++ b/packages/metacoin/test/global_hooks.ts
@@ -1,4 +1,4 @@
-import { env, EnvVars } from '@0xproject/dev-utils';
+import { env, EnvVars } from '@0x/dev-utils';
import { coverage } from './utils/coverage';
import { profiler } from './utils/profiler';
diff --git a/packages/metacoin/test/metacoin_test.ts b/packages/metacoin/test/metacoin_test.ts
index 6c16a2d39..a8ba85814 100644
--- a/packages/metacoin/test/metacoin_test.ts
+++ b/packages/metacoin/test/metacoin_test.ts
@@ -1,5 +1,5 @@
-import { BlockchainLifecycle, devConstants } from '@0xproject/dev-utils';
-import { BigNumber } from '@0xproject/utils';
+import { BlockchainLifecycle, devConstants } from '@0x/dev-utils';
+import { BigNumber } from '@0x/utils';
import * as chai from 'chai';
import { ContractArtifact, LogWithDecodedArgs } from 'ethereum-types';
diff --git a/packages/metacoin/test/utils/config.ts b/packages/metacoin/test/utils/config.ts
index c26fe5f25..05f524d52 100644
--- a/packages/metacoin/test/utils/config.ts
+++ b/packages/metacoin/test/utils/config.ts
@@ -1,4 +1,4 @@
-import { devConstants } from '@0xproject/dev-utils';
+import { devConstants } from '@0x/dev-utils';
export const config = {
networkId: 50,
diff --git a/packages/metacoin/test/utils/coverage.ts b/packages/metacoin/test/utils/coverage.ts
index 945afb0a7..31275a163 100644
--- a/packages/metacoin/test/utils/coverage.ts
+++ b/packages/metacoin/test/utils/coverage.ts
@@ -1,5 +1,5 @@
-import { devConstants } from '@0xproject/dev-utils';
-import { CoverageSubprovider, SolCompilerArtifactAdapter } from '@0xproject/sol-cov';
+import { devConstants } from '@0x/dev-utils';
+import { CoverageSubprovider, SolCompilerArtifactAdapter } from '@0x/sol-cov';
import * as _ from 'lodash';
import { config } from './config';
diff --git a/packages/metacoin/test/utils/profiler.ts b/packages/metacoin/test/utils/profiler.ts
index 701337451..e7c373d20 100644
--- a/packages/metacoin/test/utils/profiler.ts
+++ b/packages/metacoin/test/utils/profiler.ts
@@ -1,5 +1,5 @@
-import { devConstants } from '@0xproject/dev-utils';
-import { ProfilerSubprovider, SolCompilerArtifactAdapter } from '@0xproject/sol-cov';
+import { devConstants } from '@0x/dev-utils';
+import { ProfilerSubprovider, SolCompilerArtifactAdapter } from '@0x/sol-cov';
import * as _ from 'lodash';
import { config } from './config';
diff --git a/packages/metacoin/test/utils/web3_wrapper.ts b/packages/metacoin/test/utils/web3_wrapper.ts
index 36bd6343f..258cf560f 100644
--- a/packages/metacoin/test/utils/web3_wrapper.ts
+++ b/packages/metacoin/test/utils/web3_wrapper.ts
@@ -1,7 +1,7 @@
-import { env, EnvVars } from '@0xproject/dev-utils';
-import { GanacheSubprovider, prependSubprovider, RPCSubprovider, Web3ProviderEngine } from '@0xproject/subproviders';
-import { errorUtils, logUtils } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { env, EnvVars } from '@0x/dev-utils';
+import { GanacheSubprovider, prependSubprovider, RPCSubprovider, Web3ProviderEngine } from '@0x/subproviders';
+import { errorUtils, logUtils } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import * as fs from 'fs';
import { config } from './config';
diff --git a/packages/metacoin/tsconfig.json b/packages/metacoin/tsconfig.json
index 3065396ff..163465cf5 100644
--- a/packages/metacoin/tsconfig.json
+++ b/packages/metacoin/tsconfig.json
@@ -5,10 +5,10 @@
"rootDir": ".",
"typeRoots": [
"comment: for building within 0x-monorepo:",
- "../../node_modules/@0xproject/typescript-typings/types",
+ "../../node_modules/@0x/typescript-typings/types",
"../../node_modules/@types",
"comment: for building in an isolated environment:",
- "node_modules/@0xproject/typescript-typings/types",
+ "node_modules/@0x/typescript-typings/types",
"node_modules/@types"
]
},
diff --git a/packages/metacoin/tslint.json b/packages/metacoin/tslint.json
index ffaefe83a..dd9053357 100644
--- a/packages/metacoin/tslint.json
+++ b/packages/metacoin/tslint.json
@@ -1,3 +1,3 @@
{
- "extends": ["@0xproject/tslint-config"]
+ "extends": ["@0x/tslint-config"]
}
diff --git a/packages/migrations/.gitignore b/packages/migrations/.gitignore
deleted file mode 100644
index dc4af7ced..000000000
--- a/packages/migrations/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-artifacts/development
diff --git a/packages/migrations/CHANGELOG.json b/packages/migrations/CHANGELOG.json
index 068fdc56f..b7128f8e1 100644
--- a/packages/migrations/CHANGELOG.json
+++ b/packages/migrations/CHANGELOG.json
@@ -1,5 +1,25 @@
[
{
+ "version": "2.0.1",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ],
+ "timestamp": 1541740904
+ },
+ {
+ "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.",
+ "pr": 1105
+ }
+ ],
+ "timestamp": 1539871071
+ },
+ {
"version": "1.0.14",
"changes": [
{
diff --git a/packages/migrations/CHANGELOG.md b/packages/migrations/CHANGELOG.md
index 81f9fabe3..387ae0abb 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.0.1 - _November 9, 2018_
+
+ * Dependencies updated
+
+## v2.0.0 - _October 18, 2018_
+
+ * 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. (#1105)
+
## v1.0.14 - _October 4, 2018_
* Dependencies updated
@@ -45,7 +53,7 @@ CHANGELOG
* Dependencies updated
-## v1.0.4 - _August 13, 2018_
+## v1.0.4 - _August 14, 2018_
* Dependencies updated
diff --git a/packages/migrations/README.md b/packages/migrations/README.md
index f4715cfa1..b90d730eb 100644
--- a/packages/migrations/README.md
+++ b/packages/migrations/README.md
@@ -27,13 +27,13 @@ yarn install
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
```bash
-PKG=@0xproject/migrations yarn build
+PKG=@0x/migrations yarn build
```
Or continuously rebuild on change:
```bash
-PKG=@0xproject/migrations yarn watch
+PKG=@0x/migrations yarn watch
```
### Clean
@@ -50,33 +50,10 @@ yarn lint
### Migrate
-#### V2-beta smart contracts
+#### V2 smart contracts
-In order to migrate the V2-beta 0x smart contracts to Kovan using a Ledger Nano S, run:
-
-```bash
-yarn migrate:v2-beta-testnet
-```
-
-**Note:** Ledger settings `contract data` must be `on`, and `browser support` must be set to `off`.
-
-Post-publish steps:
-
-1. Since we don't re-deploy the `WETH9` nor `ZRXToken` contracts, manually copy over the artifacts for them from `2.0.0` into `2.0.0-beta-testnet` and add the Kovan & ganache addresses to both of their `networks` sections.
-2. We now need to copy over the network `50` settings from the `2.0.0` artifacts to the `2.0.0-beta-testnet` artifacts for the newly deployed contracts (e.g `Exchange`, `ERC20Proxy`, `ERC721Proxy` and `AssetProxyOwner`)
-
-#### V2 (under development) smart contracts
-
-In order to migrate the V2 (under development) 0x smart contracts to TestRPC/Ganache running at `http://localhost:8545`, run:
+In order to migrate the V2 0x smart contracts to TestRPC/Ganache running at `http://localhost:8545`, run:
```bash
yarn migrate:v2
```
-
-#### V1 smart contracts
-
-In order to migrate the V1 0x smart contracts to TestRPC/Ganache running at `http://localhost:8545`, run:
-
-```bash
-yarn migrate:v1
-```
diff --git a/packages/migrations/artifacts/1.0.0/DummyERC20Token.json b/packages/migrations/artifacts/1.0.0/DummyERC20Token.json
deleted file mode 100644
index 3ac218e24..000000000
--- a/packages/migrations/artifacts/1.0.0/DummyERC20Token.json
+++ /dev/null
@@ -1,375 +0,0 @@
-{
- "schemaVersion": "2.0.0",
- "contractName": "DummyERC20Token",
- "compilerOutput": {
- "abi": [
- {
- "constant": true,
- "inputs": [],
- "name": "name",
- "outputs": [
- {
- "name": "",
- "type": "string"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_spender",
- "type": "address"
- },
- {
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "approve",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "totalSupply",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_from",
- "type": "address"
- },
- {
- "name": "_to",
- "type": "address"
- },
- {
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "transferFrom",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "decimals",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "_owner",
- "type": "address"
- }
- ],
- "name": "balanceOf",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "owner",
- "outputs": [
- {
- "name": "",
- "type": "address"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "symbol",
- "outputs": [
- {
- "name": "",
- "type": "string"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "mint",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_to",
- "type": "address"
- },
- {
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "transfer",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "_owner",
- "type": "address"
- },
- {
- "name": "_spender",
- "type": "address"
- }
- ],
- "name": "allowance",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_target",
- "type": "address"
- },
- {
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "setBalance",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "newOwner",
- "type": "address"
- }
- ],
- "name": "transferOwnership",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "inputs": [
- {
- "name": "_name",
- "type": "string"
- },
- {
- "name": "_symbol",
- "type": "string"
- },
- {
- "name": "_decimals",
- "type": "uint256"
- },
- {
- "name": "_totalSupply",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "constructor"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "_from",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "_to",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "Transfer",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "_owner",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "_spender",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "Approval",
- "type": "event"
- }
- ],
- "evm": {
- "bytecode": {
- "linkReferences": {},
- "object": "0x60806040523480156200001157600080fd5b506040516200193b3803806200193b833981018060405262000037919081019062000228565b33600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555083600490805190602001906200009092919062000105565b508260059080519060200190620000a992919062000105565b508160068190555080600281905550806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050505062000361565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200014857805160ff191683800117855562000179565b8280016001018555821562000179579182015b82811115620001785782518255916020019190600101906200015b565b5b5090506200018891906200018c565b5090565b620001b191905b80821115620001ad57600081600090555060010162000193565b5090565b90565b600082601f8301121515620001c857600080fd5b8151620001df620001d982620002f4565b620002c6565b91508082526020830160208301858383011115620001fc57600080fd5b620002098382846200032b565b50505092915050565b600062000220825162000321565b905092915050565b600080600080608085870312156200023f57600080fd5b600085015167ffffffffffffffff8111156200025a57600080fd5b6200026887828801620001b4565b945050602085015167ffffffffffffffff8111156200028657600080fd5b6200029487828801620001b4565b9350506040620002a78782880162000212565b9250506060620002ba8782880162000212565b91505092959194509250565b6000604051905081810181811067ffffffffffffffff82111715620002ea57600080fd5b8060405250919050565b600067ffffffffffffffff8211156200030c57600080fd5b601f19601f8301169050602081019050919050565b6000819050919050565b60005b838110156200034b5780820151818401526020810190506200032e565b838111156200035b576000848401525b50505050565b6115ca80620003716000396000f3006080604052600436106100c5576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100ca578063095ea7b3146100f557806318160ddd1461013257806323b872dd1461015d578063313ce5671461019a57806370a08231146101c55780638da5cb5b1461020257806395d89b411461022d578063a0712d6814610258578063a9059cbb14610281578063dd62ed3e146102be578063e30443bc146102fb578063f2fde38b14610324575b600080fd5b3480156100d657600080fd5b506100df61034d565b6040516100ec9190611464565b60405180910390f35b34801561010157600080fd5b5061011c600480360361011791908101906112ac565b6103eb565b6040516101299190611449565b60405180910390f35b34801561013e57600080fd5b506101476104dd565b60405161015491906114c6565b60405180910390f35b34801561016957600080fd5b50610184600480360361017f919081019061125d565b6104e3565b6040516101919190611449565b60405180910390f35b3480156101a657600080fd5b506101af6109cc565b6040516101bc91906114c6565b60405180910390f35b3480156101d157600080fd5b506101ec60048036036101e791908101906111f8565b6109d2565b6040516101f991906114c6565b60405180910390f35b34801561020e57600080fd5b50610217610a1a565b604051610224919061142e565b60405180910390f35b34801561023957600080fd5b50610242610a40565b60405161024f9190611464565b60405180910390f35b34801561026457600080fd5b5061027f600480360361027a91908101906112e8565b610ade565b005b34801561028d57600080fd5b506102a860048036036102a391908101906112ac565b610bcb565b6040516102b59190611449565b60405180910390f35b3480156102ca57600080fd5b506102e560048036036102e09190810190611221565b610eda565b6040516102f291906114c6565b60405180910390f35b34801561030757600080fd5b50610322600480360361031d91908101906112ac565b610f61565b005b34801561033057600080fd5b5061034b600480360361034691908101906111f8565b61108c565b005b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156103e35780601f106103b8576101008083540402835291602001916103e3565b820191906000526020600020905b8154815290600101906020018083116103c657829003601f168201915b505050505081565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516104cb91906114c6565b60405180910390a36001905092915050565b60025481565b600080600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015606060405190810160405280602a81526020017f496e73756666696369656e742062616c616e636520746f20636f6d706c65746581526020017f207472616e736665722e00000000000000000000000000000000000000000000815250901515610647576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161063e9190611464565b60405180910390fd5b5082811015606060405190810160405280602c81526020017f496e73756666696369656e7420616c6c6f77616e636520746f20636f6d706c6581526020017f7465207472616e736665722e00000000000000000000000000000000000000008152509015156106ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106e39190611464565b60405180910390fd5b506000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011015606060405190810160405280602581526020017f5472616e7366657220776f756c6420726573756c7420696e20616e206f76657281526020017f666c6f772e00000000000000000000000000000000000000000000000000000081525090151561080f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108069190611464565b60405180910390fd5b50826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81101561095b5782600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516109b891906114c6565b60405180910390a360019150509392505050565b60065481565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ad65780601f10610aab57610100808354040283529160200191610ad6565b820191906000526020600020905b815481529060010190602001808311610ab957829003601f168201915b505050505081565b68056bc75e2d631000008111151515610b2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b23906114a6565b60405180910390fd5b610b74816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611199565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610bc260025482611199565b60028190555050565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015606060405190810160405280602a81526020017f496e73756666696369656e742062616c616e636520746f20636f6d706c65746581526020017f207472616e736665722e00000000000000000000000000000000000000000000815250901515610caf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca69190611464565b60405180910390fd5b506000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011015606060405190810160405280602581526020017f5472616e7366657220776f756c6420726573756c7420696e20616e206f76657281526020017f666c6f772e000000000000000000000000000000000000000000000000000000815250901515610dd2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dc99190611464565b60405180910390fd5b50816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610ec891906114c6565b60405180910390a36001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ff5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fec90611486565b60405180910390fd5b610ffe836109d2565b9050808210156110285761101d60025461101883856111b7565b6111b7565b600281905550611044565b61103d60025461103884846111b7565b611199565b6002819055505b816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561111e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161111590611486565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415156111965780600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b60008082840190508381101515156111ad57fe5b8091505092915050565b60008282111515156111c557fe5b818303905092915050565b60006111dc8235611522565b905092915050565b60006111f08235611542565b905092915050565b60006020828403121561120a57600080fd5b6000611218848285016111d0565b91505092915050565b6000806040838503121561123457600080fd5b6000611242858286016111d0565b9250506020611253858286016111d0565b9150509250929050565b60008060006060848603121561127257600080fd5b6000611280868287016111d0565b9350506020611291868287016111d0565b92505060406112a2868287016111e4565b9150509250925092565b600080604083850312156112bf57600080fd5b60006112cd858286016111d0565b92505060206112de858286016111e4565b9150509250929050565b6000602082840312156112fa57600080fd5b6000611308848285016111e4565b91505092915050565b61131a816114ec565b82525050565b6113298161150c565b82525050565b600061133a826114e1565b80845261134e81602086016020860161154c565b6113578161157f565b602085010191505092915050565b6000603382527f4f6e6c7920636f6e7472616374206f776e657220697320616c6c6f776564207460208301527f6f2063616c6c2074686973206d6574686f642e000000000000000000000000006040830152606082019050919050565b6000603782527f4d696e74696e67206d6f7265207468616e20313030303030303030303030303060208301527f30303030303030206973206e6f7420616c6c6f7765642e0000000000000000006040830152606082019050919050565b61142881611518565b82525050565b60006020820190506114436000830184611311565b92915050565b600060208201905061145e6000830184611320565b92915050565b6000602082019050818103600083015261147e818461132f565b905092915050565b6000602082019050818103600083015261149f81611365565b9050919050565b600060208201905081810360008301526114bf816113c2565b9050919050565b60006020820190506114db600083018461141f565b92915050565b600081519050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60005b8381101561156a57808201518184015260208101905061154f565b83811115611579576000848401525b50505050565b6000601f19601f83011690509190505600a265627a7a723058208f9c89c6f85f64aec1e07cbf745526bbd793fd4abc535035dd77ee4efbc898c36c6578706572696d656e74616cf50037",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH3 0x11 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x40 MLOAD PUSH3 0x193B CODESIZE SUB DUP1 PUSH3 0x193B DUP4 CODECOPY DUP2 ADD DUP1 PUSH1 0x40 MSTORE PUSH3 0x37 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH3 0x228 JUMP JUMPDEST CALLER PUSH1 0x3 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP DUP4 PUSH1 0x4 SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH3 0x90 SWAP3 SWAP2 SWAP1 PUSH3 0x105 JUMP JUMPDEST POP DUP3 PUSH1 0x5 SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH3 0xA9 SWAP3 SWAP2 SWAP1 PUSH3 0x105 JUMP JUMPDEST POP DUP2 PUSH1 0x6 DUP2 SWAP1 SSTORE POP DUP1 PUSH1 0x2 DUP2 SWAP1 SSTORE POP DUP1 PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP POP POP POP POP PUSH3 0x361 JUMP JUMPDEST DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 PUSH1 0x1F ADD PUSH1 0x20 SWAP1 DIV DUP2 ADD SWAP3 DUP3 PUSH1 0x1F LT PUSH3 0x148 JUMPI DUP1 MLOAD PUSH1 0xFF NOT AND DUP4 DUP1 ADD OR DUP6 SSTORE PUSH3 0x179 JUMP JUMPDEST DUP3 DUP1 ADD PUSH1 0x1 ADD DUP6 SSTORE DUP3 ISZERO PUSH3 0x179 JUMPI SWAP2 DUP3 ADD JUMPDEST DUP3 DUP2 GT ISZERO PUSH3 0x178 JUMPI DUP3 MLOAD DUP3 SSTORE SWAP2 PUSH1 0x20 ADD SWAP2 SWAP1 PUSH1 0x1 ADD SWAP1 PUSH3 0x15B JUMP JUMPDEST JUMPDEST POP SWAP1 POP PUSH3 0x188 SWAP2 SWAP1 PUSH3 0x18C JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST PUSH3 0x1B1 SWAP2 SWAP1 JUMPDEST DUP1 DUP3 GT ISZERO PUSH3 0x1AD JUMPI PUSH1 0x0 DUP2 PUSH1 0x0 SWAP1 SSTORE POP PUSH1 0x1 ADD PUSH3 0x193 JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP3 PUSH1 0x1F DUP4 ADD SLT ISZERO ISZERO PUSH3 0x1C8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 MLOAD PUSH3 0x1DF PUSH3 0x1D9 DUP3 PUSH3 0x2F4 JUMP JUMPDEST PUSH3 0x2C6 JUMP JUMPDEST SWAP2 POP DUP1 DUP3 MSTORE PUSH1 0x20 DUP4 ADD PUSH1 0x20 DUP4 ADD DUP6 DUP4 DUP4 ADD GT ISZERO PUSH3 0x1FC JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH3 0x209 DUP4 DUP3 DUP5 PUSH3 0x32B JUMP JUMPDEST POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH3 0x220 DUP3 MLOAD PUSH3 0x321 JUMP JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x80 DUP6 DUP8 SUB SLT ISZERO PUSH3 0x23F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP6 ADD MLOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH3 0x25A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH3 0x268 DUP8 DUP3 DUP9 ADD PUSH3 0x1B4 JUMP JUMPDEST SWAP5 POP POP PUSH1 0x20 DUP6 ADD MLOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH3 0x286 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH3 0x294 DUP8 DUP3 DUP9 ADD PUSH3 0x1B4 JUMP JUMPDEST SWAP4 POP POP PUSH1 0x40 PUSH3 0x2A7 DUP8 DUP3 DUP9 ADD PUSH3 0x212 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x60 PUSH3 0x2BA DUP8 DUP3 DUP9 ADD PUSH3 0x212 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP6 SWAP2 SWAP5 POP SWAP3 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD SWAP1 POP DUP2 DUP2 ADD DUP2 DUP2 LT PUSH8 0xFFFFFFFFFFFFFFFF DUP3 GT OR ISZERO PUSH3 0x2EA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 PUSH1 0x40 MSTORE POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH8 0xFFFFFFFFFFFFFFFF DUP3 GT ISZERO PUSH3 0x30C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x1F NOT PUSH1 0x1F DUP4 ADD AND SWAP1 POP PUSH1 0x20 DUP2 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH3 0x34B JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH3 0x32E JUMP JUMPDEST DUP4 DUP2 GT ISZERO PUSH3 0x35B JUMPI PUSH1 0x0 DUP5 DUP5 ADD MSTORE JUMPDEST POP POP POP POP JUMP JUMPDEST PUSH2 0x15CA DUP1 PUSH3 0x371 PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN STOP PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0xC5 JUMPI PUSH1 0x0 CALLDATALOAD PUSH29 0x100000000000000000000000000000000000000000000000000000000 SWAP1 DIV PUSH4 0xFFFFFFFF AND DUP1 PUSH4 0x6FDDE03 EQ PUSH2 0xCA JUMPI DUP1 PUSH4 0x95EA7B3 EQ PUSH2 0xF5 JUMPI DUP1 PUSH4 0x18160DDD EQ PUSH2 0x132 JUMPI DUP1 PUSH4 0x23B872DD EQ PUSH2 0x15D JUMPI DUP1 PUSH4 0x313CE567 EQ PUSH2 0x19A JUMPI DUP1 PUSH4 0x70A08231 EQ PUSH2 0x1C5 JUMPI DUP1 PUSH4 0x8DA5CB5B EQ PUSH2 0x202 JUMPI DUP1 PUSH4 0x95D89B41 EQ PUSH2 0x22D JUMPI DUP1 PUSH4 0xA0712D68 EQ PUSH2 0x258 JUMPI DUP1 PUSH4 0xA9059CBB EQ PUSH2 0x281 JUMPI DUP1 PUSH4 0xDD62ED3E EQ PUSH2 0x2BE JUMPI DUP1 PUSH4 0xE30443BC EQ PUSH2 0x2FB JUMPI DUP1 PUSH4 0xF2FDE38B EQ PUSH2 0x324 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xD6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xDF PUSH2 0x34D JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xEC SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x101 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x11C PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x117 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x12AC JUMP JUMPDEST PUSH2 0x3EB JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x129 SWAP2 SWAP1 PUSH2 0x1449 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x13E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x147 PUSH2 0x4DD JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x154 SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x169 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x184 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x17F SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x125D JUMP JUMPDEST PUSH2 0x4E3 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x191 SWAP2 SWAP1 PUSH2 0x1449 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1A6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1AF PUSH2 0x9CC JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1BC SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1D1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1EC PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x1E7 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x11F8 JUMP JUMPDEST PUSH2 0x9D2 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1F9 SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x20E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x217 PUSH2 0xA1A JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x224 SWAP2 SWAP1 PUSH2 0x142E JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x239 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x242 PUSH2 0xA40 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x24F SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x264 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x27F PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x27A SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x12E8 JUMP JUMPDEST PUSH2 0xADE JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x28D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2A8 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x2A3 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x12AC JUMP JUMPDEST PUSH2 0xBCB JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x2B5 SWAP2 SWAP1 PUSH2 0x1449 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2CA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2E5 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x2E0 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x1221 JUMP JUMPDEST PUSH2 0xEDA JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x2F2 SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x307 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x322 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x31D SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x12AC JUMP JUMPDEST PUSH2 0xF61 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x330 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x34B PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x346 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x11F8 JUMP JUMPDEST PUSH2 0x108C JUMP JUMPDEST STOP JUMPDEST PUSH1 0x4 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x3E3 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x3B8 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x3E3 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x3C6 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP DUP2 JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x1 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x8C5BE1E5EBEC7D5BD14F71427D1E84F3DD0314C0F7B2291E5B200AC8C7C3B925 DUP5 PUSH1 0x40 MLOAD PUSH2 0x4CB SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x1 SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x2 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x1 PUSH1 0x0 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD SWAP1 POP DUP3 PUSH1 0x0 DUP1 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD LT ISZERO PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x2A DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x496E73756666696369656E742062616C616E636520746F20636F6D706C657465 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x207472616E736665722E00000000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 ISZERO ISZERO PUSH2 0x647 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x63E SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP DUP3 DUP2 LT ISZERO PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x2C DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x496E73756666696369656E7420616C6C6F77616E636520746F20636F6D706C65 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x7465207472616E736665722E0000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 ISZERO ISZERO PUSH2 0x6EC JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6E3 SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP PUSH1 0x0 DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD DUP4 PUSH1 0x0 DUP1 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD ADD LT ISZERO PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x25 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x5472616E7366657220776F756C6420726573756C7420696E20616E206F766572 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x666C6F772E000000000000000000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 ISZERO ISZERO PUSH2 0x80F JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x806 SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP DUP3 PUSH1 0x0 DUP1 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD ADD SWAP3 POP POP DUP2 SWAP1 SSTORE POP DUP3 PUSH1 0x0 DUP1 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD SUB SWAP3 POP POP DUP2 SWAP1 SSTORE POP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 LT ISZERO PUSH2 0x95B JUMPI DUP3 PUSH1 0x1 PUSH1 0x0 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD SUB SWAP3 POP POP DUP2 SWAP1 SSTORE POP JUMPDEST DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF DUP6 PUSH1 0x40 MLOAD PUSH2 0x9B8 SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x1 SWAP2 POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x6 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x3 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x5 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0xAD6 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0xAAB JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0xAD6 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0xAB9 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP DUP2 JUMP JUMPDEST PUSH9 0x56BC75E2D63100000 DUP2 GT ISZERO ISZERO ISZERO PUSH2 0xB2C JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xB23 SWAP1 PUSH2 0x14A6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0xB74 DUP2 PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD PUSH2 0x1199 JUMP JUMPDEST PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP PUSH2 0xBC2 PUSH1 0x2 SLOAD DUP3 PUSH2 0x1199 JUMP JUMPDEST PUSH1 0x2 DUP2 SWAP1 SSTORE POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD LT ISZERO PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x2A DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x496E73756666696369656E742062616C616E636520746F20636F6D706C657465 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x207472616E736665722E00000000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 ISZERO ISZERO PUSH2 0xCAF JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xCA6 SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP PUSH1 0x0 DUP1 DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD DUP3 PUSH1 0x0 DUP1 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD ADD LT ISZERO PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x25 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x5472616E7366657220776F756C6420726573756C7420696E20616E206F766572 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x666C6F772E000000000000000000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 ISZERO ISZERO PUSH2 0xDD2 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xDC9 SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP DUP2 PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD SUB SWAP3 POP POP DUP2 SWAP1 SSTORE POP DUP2 PUSH1 0x0 DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD ADD SWAP3 POP POP DUP2 SWAP1 SSTORE POP DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF DUP5 PUSH1 0x40 MLOAD PUSH2 0xEC8 SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x1 SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1 PUSH1 0x0 DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x3 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0xFF5 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xFEC SWAP1 PUSH2 0x1486 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0xFFE DUP4 PUSH2 0x9D2 JUMP JUMPDEST SWAP1 POP DUP1 DUP3 LT ISZERO PUSH2 0x1028 JUMPI PUSH2 0x101D PUSH1 0x2 SLOAD PUSH2 0x1018 DUP4 DUP6 PUSH2 0x11B7 JUMP JUMPDEST PUSH2 0x11B7 JUMP JUMPDEST PUSH1 0x2 DUP2 SWAP1 SSTORE POP PUSH2 0x1044 JUMP JUMPDEST PUSH2 0x103D PUSH1 0x2 SLOAD PUSH2 0x1038 DUP5 DUP5 PUSH2 0x11B7 JUMP JUMPDEST PUSH2 0x1199 JUMP JUMPDEST PUSH1 0x2 DUP2 SWAP1 SSTORE POP JUMPDEST DUP2 PUSH1 0x0 DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP POP POP POP JUMP JUMPDEST PUSH1 0x3 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x111E JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x1115 SWAP1 PUSH2 0x1486 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x1196 JUMPI DUP1 PUSH1 0x3 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP JUMPDEST POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP3 DUP5 ADD SWAP1 POP DUP4 DUP2 LT ISZERO ISZERO ISZERO PUSH2 0x11AD JUMPI INVALID JUMPDEST DUP1 SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 GT ISZERO ISZERO ISZERO PUSH2 0x11C5 JUMPI INVALID JUMPDEST DUP2 DUP4 SUB SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x11DC DUP3 CALLDATALOAD PUSH2 0x1522 JUMP JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x11F0 DUP3 CALLDATALOAD PUSH2 0x1542 JUMP JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x120A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1218 DUP5 DUP3 DUP6 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x1234 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1242 DUP6 DUP3 DUP7 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0x1253 DUP6 DUP3 DUP7 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x60 DUP5 DUP7 SUB SLT ISZERO PUSH2 0x1272 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1280 DUP7 DUP3 DUP8 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP4 POP POP PUSH1 0x20 PUSH2 0x1291 DUP7 DUP3 DUP8 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x40 PUSH2 0x12A2 DUP7 DUP3 DUP8 ADD PUSH2 0x11E4 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 POP SWAP3 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x12BF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x12CD DUP6 DUP3 DUP7 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0x12DE DUP6 DUP3 DUP7 ADD PUSH2 0x11E4 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x12FA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1308 DUP5 DUP3 DUP6 ADD PUSH2 0x11E4 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x131A DUP2 PUSH2 0x14EC JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH2 0x1329 DUP2 PUSH2 0x150C JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x133A DUP3 PUSH2 0x14E1 JUMP JUMPDEST DUP1 DUP5 MSTORE PUSH2 0x134E DUP2 PUSH1 0x20 DUP7 ADD PUSH1 0x20 DUP7 ADD PUSH2 0x154C JUMP JUMPDEST PUSH2 0x1357 DUP2 PUSH2 0x157F JUMP JUMPDEST PUSH1 0x20 DUP6 ADD ADD SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x33 DUP3 MSTORE PUSH32 0x4F6E6C7920636F6E7472616374206F776E657220697320616C6C6F7765642074 PUSH1 0x20 DUP4 ADD MSTORE PUSH32 0x6F2063616C6C2074686973206D6574686F642E00000000000000000000000000 PUSH1 0x40 DUP4 ADD MSTORE PUSH1 0x60 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x37 DUP3 MSTORE PUSH32 0x4D696E74696E67206D6F7265207468616E203130303030303030303030303030 PUSH1 0x20 DUP4 ADD MSTORE PUSH32 0x30303030303030206973206E6F7420616C6C6F7765642E000000000000000000 PUSH1 0x40 DUP4 ADD MSTORE PUSH1 0x60 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0x1428 DUP2 PUSH2 0x1518 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x1443 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x1311 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x145E PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x1320 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x147E DUP2 DUP5 PUSH2 0x132F JUMP JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x149F DUP2 PUSH2 0x1365 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x14BF DUP2 PUSH2 0x13C2 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x14DB PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x141F JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 ISZERO ISZERO SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x156A JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x154F JUMP JUMPDEST DUP4 DUP2 GT ISZERO PUSH2 0x1579 JUMPI PUSH1 0x0 DUP5 DUP5 ADD MSTORE JUMPDEST POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F NOT PUSH1 0x1F DUP4 ADD AND SWAP1 POP SWAP2 SWAP1 POP JUMP STOP LOG2 PUSH6 0x627A7A723058 KECCAK256 DUP16 SWAP13 DUP10 0xc6 0xf8 0x5f PUSH5 0xAEC1E07CBF PUSH21 0x5526BBD793FD4ABC535035DD77EE4EFBC898C36C65 PUSH25 0x706572696D656E74616CF50037000000000000000000000000 ",
- "sourceMap": "718:844:0:-;;;850:302;8:9:-1;5:2;;;30:1;27;20:12;5:2;850:302:0;;;;;;;;;;;;;;;;;;;;;;;;371:10:6;363:5;;:18;;;;;;;;;;;;;;;;;;1003:5:0;996:4;:12;;;;;;;;;;;;:::i;:::-;;1027:7;1018:6;:16;;;;;;;;;;;;:::i;:::-;;1055:9;1044:8;:20;;;;1088:12;1074:11;:26;;;;1133:12;1110:8;:20;1119:10;1110:20;;;;;;;;;;;;;;;:35;;;;850:302;;;;718:844;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;6:444:-1:-;;119:3;112:4;104:6;100:17;96:27;89:35;86:2;;;137:1;134;127:12;86:2;167:6;161:13;189:65;204:49;246:6;204:49;;;189:65;;;180:74;;274:6;267:5;260:21;310:4;302:6;298:17;343:4;336:5;332:16;378:3;369:6;364:3;360:16;357:25;354:2;;;395:1;392;385:12;354:2;405:39;437:6;432:3;427;405:39;;;79:371;;;;;;;;458:122;;536:39;567:6;561:13;536:39;;;527:48;;521:59;;;;;587:870;;;;;773:3;761:9;752:7;748:23;744:33;741:2;;;790:1;787;780:12;741:2;846:1;835:9;831:17;825:24;869:18;861:6;858:30;855:2;;;901:1;898;891:12;855:2;921:74;987:7;978:6;967:9;963:22;921:74;;;911:84;;804:197;1053:2;1042:9;1038:18;1032:25;1077:18;1069:6;1066:30;1063:2;;;1109:1;1106;1099:12;1063:2;1129:74;1195:7;1186:6;1175:9;1171:22;1129:74;;;1119:84;;1011:198;1240:2;1258:64;1314:7;1305:6;1294:9;1290:22;1258:64;;;1248:74;;1219:109;1359:2;1377:64;1433:7;1424:6;1413:9;1409:22;1377:64;;;1367:74;;1338:109;735:722;;;;;;;;1464:256;;1526:2;1520:9;1510:19;;1564:4;1556:6;1552:17;1663:6;1651:10;1648:22;1627:18;1615:10;1612:34;1609:62;1606:2;;;1684:1;1681;1674:12;1606:2;1704:10;1700:2;1693:22;1504:216;;;;;1727:259;;1871:18;1863:6;1860:30;1857:2;;;1903:1;1900;1893:12;1857:2;1947:4;1943:9;1936:4;1928:6;1924:17;1920:33;1912:41;;1976:4;1970;1966:15;1958:23;;1794:192;;;;1993:79;;2062:5;2051:16;;2045:27;;;;2080:268;2145:1;2152:101;2166:6;2163:1;2160:13;2152:101;;;2242:1;2237:3;2233:11;2227:18;2223:1;2218:3;2214:11;2207:39;2188:2;2185:1;2181:10;2176:15;;2152:101;;;2268:6;2265:1;2262:13;2259:2;;;2333:1;2324:6;2319:3;2315:16;2308:27;2259:2;2129:219;;;;;718:844:0;;;;;;;"
- },
- "deployedBytecode": {
- "linkReferences": {},
- "object": "0x6080604052600436106100c5576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100ca578063095ea7b3146100f557806318160ddd1461013257806323b872dd1461015d578063313ce5671461019a57806370a08231146101c55780638da5cb5b1461020257806395d89b411461022d578063a0712d6814610258578063a9059cbb14610281578063dd62ed3e146102be578063e30443bc146102fb578063f2fde38b14610324575b600080fd5b3480156100d657600080fd5b506100df61034d565b6040516100ec9190611464565b60405180910390f35b34801561010157600080fd5b5061011c600480360361011791908101906112ac565b6103eb565b6040516101299190611449565b60405180910390f35b34801561013e57600080fd5b506101476104dd565b60405161015491906114c6565b60405180910390f35b34801561016957600080fd5b50610184600480360361017f919081019061125d565b6104e3565b6040516101919190611449565b60405180910390f35b3480156101a657600080fd5b506101af6109cc565b6040516101bc91906114c6565b60405180910390f35b3480156101d157600080fd5b506101ec60048036036101e791908101906111f8565b6109d2565b6040516101f991906114c6565b60405180910390f35b34801561020e57600080fd5b50610217610a1a565b604051610224919061142e565b60405180910390f35b34801561023957600080fd5b50610242610a40565b60405161024f9190611464565b60405180910390f35b34801561026457600080fd5b5061027f600480360361027a91908101906112e8565b610ade565b005b34801561028d57600080fd5b506102a860048036036102a391908101906112ac565b610bcb565b6040516102b59190611449565b60405180910390f35b3480156102ca57600080fd5b506102e560048036036102e09190810190611221565b610eda565b6040516102f291906114c6565b60405180910390f35b34801561030757600080fd5b50610322600480360361031d91908101906112ac565b610f61565b005b34801561033057600080fd5b5061034b600480360361034691908101906111f8565b61108c565b005b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156103e35780601f106103b8576101008083540402835291602001916103e3565b820191906000526020600020905b8154815290600101906020018083116103c657829003601f168201915b505050505081565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516104cb91906114c6565b60405180910390a36001905092915050565b60025481565b600080600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015606060405190810160405280602a81526020017f496e73756666696369656e742062616c616e636520746f20636f6d706c65746581526020017f207472616e736665722e00000000000000000000000000000000000000000000815250901515610647576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161063e9190611464565b60405180910390fd5b5082811015606060405190810160405280602c81526020017f496e73756666696369656e7420616c6c6f77616e636520746f20636f6d706c6581526020017f7465207472616e736665722e00000000000000000000000000000000000000008152509015156106ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106e39190611464565b60405180910390fd5b506000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011015606060405190810160405280602581526020017f5472616e7366657220776f756c6420726573756c7420696e20616e206f76657281526020017f666c6f772e00000000000000000000000000000000000000000000000000000081525090151561080f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108069190611464565b60405180910390fd5b50826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81101561095b5782600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516109b891906114c6565b60405180910390a360019150509392505050565b60065481565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ad65780601f10610aab57610100808354040283529160200191610ad6565b820191906000526020600020905b815481529060010190602001808311610ab957829003601f168201915b505050505081565b68056bc75e2d631000008111151515610b2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b23906114a6565b60405180910390fd5b610b74816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611199565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610bc260025482611199565b60028190555050565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015606060405190810160405280602a81526020017f496e73756666696369656e742062616c616e636520746f20636f6d706c65746581526020017f207472616e736665722e00000000000000000000000000000000000000000000815250901515610caf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca69190611464565b60405180910390fd5b506000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011015606060405190810160405280602581526020017f5472616e7366657220776f756c6420726573756c7420696e20616e206f76657281526020017f666c6f772e000000000000000000000000000000000000000000000000000000815250901515610dd2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dc99190611464565b60405180910390fd5b50816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610ec891906114c6565b60405180910390a36001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ff5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fec90611486565b60405180910390fd5b610ffe836109d2565b9050808210156110285761101d60025461101883856111b7565b6111b7565b600281905550611044565b61103d60025461103884846111b7565b611199565b6002819055505b816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561111e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161111590611486565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415156111965780600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b60008082840190508381101515156111ad57fe5b8091505092915050565b60008282111515156111c557fe5b818303905092915050565b60006111dc8235611522565b905092915050565b60006111f08235611542565b905092915050565b60006020828403121561120a57600080fd5b6000611218848285016111d0565b91505092915050565b6000806040838503121561123457600080fd5b6000611242858286016111d0565b9250506020611253858286016111d0565b9150509250929050565b60008060006060848603121561127257600080fd5b6000611280868287016111d0565b9350506020611291868287016111d0565b92505060406112a2868287016111e4565b9150509250925092565b600080604083850312156112bf57600080fd5b60006112cd858286016111d0565b92505060206112de858286016111e4565b9150509250929050565b6000602082840312156112fa57600080fd5b6000611308848285016111e4565b91505092915050565b61131a816114ec565b82525050565b6113298161150c565b82525050565b600061133a826114e1565b80845261134e81602086016020860161154c565b6113578161157f565b602085010191505092915050565b6000603382527f4f6e6c7920636f6e7472616374206f776e657220697320616c6c6f776564207460208301527f6f2063616c6c2074686973206d6574686f642e000000000000000000000000006040830152606082019050919050565b6000603782527f4d696e74696e67206d6f7265207468616e20313030303030303030303030303060208301527f30303030303030206973206e6f7420616c6c6f7765642e0000000000000000006040830152606082019050919050565b61142881611518565b82525050565b60006020820190506114436000830184611311565b92915050565b600060208201905061145e6000830184611320565b92915050565b6000602082019050818103600083015261147e818461132f565b905092915050565b6000602082019050818103600083015261149f81611365565b9050919050565b600060208201905081810360008301526114bf816113c2565b9050919050565b60006020820190506114db600083018461141f565b92915050565b600081519050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60005b8381101561156a57808201518184015260208101905061154f565b83811115611579576000848401525b50505050565b6000601f19601f83011690509190505600a265627a7a723058208f9c89c6f85f64aec1e07cbf745526bbd793fd4abc535035dd77ee4efbc898c36c6578706572696d656e74616cf50037",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0xC5 JUMPI PUSH1 0x0 CALLDATALOAD PUSH29 0x100000000000000000000000000000000000000000000000000000000 SWAP1 DIV PUSH4 0xFFFFFFFF AND DUP1 PUSH4 0x6FDDE03 EQ PUSH2 0xCA JUMPI DUP1 PUSH4 0x95EA7B3 EQ PUSH2 0xF5 JUMPI DUP1 PUSH4 0x18160DDD EQ PUSH2 0x132 JUMPI DUP1 PUSH4 0x23B872DD EQ PUSH2 0x15D JUMPI DUP1 PUSH4 0x313CE567 EQ PUSH2 0x19A JUMPI DUP1 PUSH4 0x70A08231 EQ PUSH2 0x1C5 JUMPI DUP1 PUSH4 0x8DA5CB5B EQ PUSH2 0x202 JUMPI DUP1 PUSH4 0x95D89B41 EQ PUSH2 0x22D JUMPI DUP1 PUSH4 0xA0712D68 EQ PUSH2 0x258 JUMPI DUP1 PUSH4 0xA9059CBB EQ PUSH2 0x281 JUMPI DUP1 PUSH4 0xDD62ED3E EQ PUSH2 0x2BE JUMPI DUP1 PUSH4 0xE30443BC EQ PUSH2 0x2FB JUMPI DUP1 PUSH4 0xF2FDE38B EQ PUSH2 0x324 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xD6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xDF PUSH2 0x34D JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xEC SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x101 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x11C PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x117 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x12AC JUMP JUMPDEST PUSH2 0x3EB JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x129 SWAP2 SWAP1 PUSH2 0x1449 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x13E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x147 PUSH2 0x4DD JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x154 SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x169 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x184 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x17F SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x125D JUMP JUMPDEST PUSH2 0x4E3 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x191 SWAP2 SWAP1 PUSH2 0x1449 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1A6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1AF PUSH2 0x9CC JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1BC SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1D1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1EC PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x1E7 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x11F8 JUMP JUMPDEST PUSH2 0x9D2 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1F9 SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x20E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x217 PUSH2 0xA1A JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x224 SWAP2 SWAP1 PUSH2 0x142E JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x239 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x242 PUSH2 0xA40 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x24F SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x264 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x27F PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x27A SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x12E8 JUMP JUMPDEST PUSH2 0xADE JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x28D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2A8 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x2A3 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x12AC JUMP JUMPDEST PUSH2 0xBCB JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x2B5 SWAP2 SWAP1 PUSH2 0x1449 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2CA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2E5 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x2E0 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x1221 JUMP JUMPDEST PUSH2 0xEDA JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x2F2 SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x307 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x322 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x31D SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x12AC JUMP JUMPDEST PUSH2 0xF61 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x330 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x34B PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x346 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x11F8 JUMP JUMPDEST PUSH2 0x108C JUMP JUMPDEST STOP JUMPDEST PUSH1 0x4 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x3E3 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x3B8 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x3E3 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x3C6 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP DUP2 JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x1 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x8C5BE1E5EBEC7D5BD14F71427D1E84F3DD0314C0F7B2291E5B200AC8C7C3B925 DUP5 PUSH1 0x40 MLOAD PUSH2 0x4CB SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x1 SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x2 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x1 PUSH1 0x0 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD SWAP1 POP DUP3 PUSH1 0x0 DUP1 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD LT ISZERO PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x2A DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x496E73756666696369656E742062616C616E636520746F20636F6D706C657465 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x207472616E736665722E00000000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 ISZERO ISZERO PUSH2 0x647 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x63E SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP DUP3 DUP2 LT ISZERO PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x2C DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x496E73756666696369656E7420616C6C6F77616E636520746F20636F6D706C65 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x7465207472616E736665722E0000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 ISZERO ISZERO PUSH2 0x6EC JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6E3 SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP PUSH1 0x0 DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD DUP4 PUSH1 0x0 DUP1 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD ADD LT ISZERO PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x25 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x5472616E7366657220776F756C6420726573756C7420696E20616E206F766572 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x666C6F772E000000000000000000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 ISZERO ISZERO PUSH2 0x80F JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x806 SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP DUP3 PUSH1 0x0 DUP1 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD ADD SWAP3 POP POP DUP2 SWAP1 SSTORE POP DUP3 PUSH1 0x0 DUP1 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD SUB SWAP3 POP POP DUP2 SWAP1 SSTORE POP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 LT ISZERO PUSH2 0x95B JUMPI DUP3 PUSH1 0x1 PUSH1 0x0 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD SUB SWAP3 POP POP DUP2 SWAP1 SSTORE POP JUMPDEST DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF DUP6 PUSH1 0x40 MLOAD PUSH2 0x9B8 SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x1 SWAP2 POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x6 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x3 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x5 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0xAD6 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0xAAB JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0xAD6 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0xAB9 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP DUP2 JUMP JUMPDEST PUSH9 0x56BC75E2D63100000 DUP2 GT ISZERO ISZERO ISZERO PUSH2 0xB2C JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xB23 SWAP1 PUSH2 0x14A6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0xB74 DUP2 PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD PUSH2 0x1199 JUMP JUMPDEST PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP PUSH2 0xBC2 PUSH1 0x2 SLOAD DUP3 PUSH2 0x1199 JUMP JUMPDEST PUSH1 0x2 DUP2 SWAP1 SSTORE POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD LT ISZERO PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x2A DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x496E73756666696369656E742062616C616E636520746F20636F6D706C657465 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x207472616E736665722E00000000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 ISZERO ISZERO PUSH2 0xCAF JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xCA6 SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP PUSH1 0x0 DUP1 DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD DUP3 PUSH1 0x0 DUP1 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD ADD LT ISZERO PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x25 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x5472616E7366657220776F756C6420726573756C7420696E20616E206F766572 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x666C6F772E000000000000000000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 ISZERO ISZERO PUSH2 0xDD2 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xDC9 SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP DUP2 PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD SUB SWAP3 POP POP DUP2 SWAP1 SSTORE POP DUP2 PUSH1 0x0 DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD ADD SWAP3 POP POP DUP2 SWAP1 SSTORE POP DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF DUP5 PUSH1 0x40 MLOAD PUSH2 0xEC8 SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x1 SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1 PUSH1 0x0 DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x3 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0xFF5 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xFEC SWAP1 PUSH2 0x1486 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0xFFE DUP4 PUSH2 0x9D2 JUMP JUMPDEST SWAP1 POP DUP1 DUP3 LT ISZERO PUSH2 0x1028 JUMPI PUSH2 0x101D PUSH1 0x2 SLOAD PUSH2 0x1018 DUP4 DUP6 PUSH2 0x11B7 JUMP JUMPDEST PUSH2 0x11B7 JUMP JUMPDEST PUSH1 0x2 DUP2 SWAP1 SSTORE POP PUSH2 0x1044 JUMP JUMPDEST PUSH2 0x103D PUSH1 0x2 SLOAD PUSH2 0x1038 DUP5 DUP5 PUSH2 0x11B7 JUMP JUMPDEST PUSH2 0x1199 JUMP JUMPDEST PUSH1 0x2 DUP2 SWAP1 SSTORE POP JUMPDEST DUP2 PUSH1 0x0 DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP POP POP POP JUMP JUMPDEST PUSH1 0x3 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x111E JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x1115 SWAP1 PUSH2 0x1486 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x1196 JUMPI DUP1 PUSH1 0x3 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP JUMPDEST POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP3 DUP5 ADD SWAP1 POP DUP4 DUP2 LT ISZERO ISZERO ISZERO PUSH2 0x11AD JUMPI INVALID JUMPDEST DUP1 SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 GT ISZERO ISZERO ISZERO PUSH2 0x11C5 JUMPI INVALID JUMPDEST DUP2 DUP4 SUB SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x11DC DUP3 CALLDATALOAD PUSH2 0x1522 JUMP JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x11F0 DUP3 CALLDATALOAD PUSH2 0x1542 JUMP JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x120A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1218 DUP5 DUP3 DUP6 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x1234 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1242 DUP6 DUP3 DUP7 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0x1253 DUP6 DUP3 DUP7 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x60 DUP5 DUP7 SUB SLT ISZERO PUSH2 0x1272 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1280 DUP7 DUP3 DUP8 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP4 POP POP PUSH1 0x20 PUSH2 0x1291 DUP7 DUP3 DUP8 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x40 PUSH2 0x12A2 DUP7 DUP3 DUP8 ADD PUSH2 0x11E4 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 POP SWAP3 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x12BF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x12CD DUP6 DUP3 DUP7 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0x12DE DUP6 DUP3 DUP7 ADD PUSH2 0x11E4 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x12FA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1308 DUP5 DUP3 DUP6 ADD PUSH2 0x11E4 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x131A DUP2 PUSH2 0x14EC JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH2 0x1329 DUP2 PUSH2 0x150C JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x133A DUP3 PUSH2 0x14E1 JUMP JUMPDEST DUP1 DUP5 MSTORE PUSH2 0x134E DUP2 PUSH1 0x20 DUP7 ADD PUSH1 0x20 DUP7 ADD PUSH2 0x154C JUMP JUMPDEST PUSH2 0x1357 DUP2 PUSH2 0x157F JUMP JUMPDEST PUSH1 0x20 DUP6 ADD ADD SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x33 DUP3 MSTORE PUSH32 0x4F6E6C7920636F6E7472616374206F776E657220697320616C6C6F7765642074 PUSH1 0x20 DUP4 ADD MSTORE PUSH32 0x6F2063616C6C2074686973206D6574686F642E00000000000000000000000000 PUSH1 0x40 DUP4 ADD MSTORE PUSH1 0x60 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x37 DUP3 MSTORE PUSH32 0x4D696E74696E67206D6F7265207468616E203130303030303030303030303030 PUSH1 0x20 DUP4 ADD MSTORE PUSH32 0x30303030303030206973206E6F7420616C6C6F7765642E000000000000000000 PUSH1 0x40 DUP4 ADD MSTORE PUSH1 0x60 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0x1428 DUP2 PUSH2 0x1518 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x1443 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x1311 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x145E PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x1320 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x147E DUP2 DUP5 PUSH2 0x132F JUMP JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x149F DUP2 PUSH2 0x1365 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x14BF DUP2 PUSH2 0x13C2 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x14DB PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x141F JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 ISZERO ISZERO SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x156A JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x154F JUMP JUMPDEST DUP4 DUP2 GT ISZERO PUSH2 0x1579 JUMPI PUSH1 0x0 DUP5 DUP5 ADD MSTORE JUMPDEST POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F NOT PUSH1 0x1F DUP4 ADD AND SWAP1 POP SWAP2 SWAP1 POP JUMP STOP LOG2 PUSH6 0x627A7A723058 KECCAK256 DUP16 SWAP13 DUP10 0xc6 0xf8 0x5f PUSH5 0xAEC1E07CBF PUSH21 0x5526BBD793FD4ABC535035DD77EE4EFBC898C36C65 PUSH25 0x706572696D656E74616CF50037000000000000000000000000 ",
- "sourceMap": "718:844:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;770:18;;8:9:-1;5:2;;;30:1;27;20:12;5:2;770:18:0;;;;;;;;;;;;;;;;;;;;2171:222:2;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2171:222:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1073:26;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1073:26:2;;;;;;;;;;;;;;;;;;;;1108:697:4;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1108:697:4;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;820:23:0;;8:9:-1;5:2;;;30:1;27;20:12;5:2;820:23:0;;;;;;;;;;;;;;;;;;;;2399:125:2;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2399:125:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;292:20:6;;8:9:-1;5:2;;;30:1;27;20:12;5:2;292:20:6;;;;;;;;;;;;;;;;;;;;794::0;;8:9:-1;5:2;;;30:1;27;20:12;5:2;794:20:0;;;;;;;;;;;;;;;;;;;;905:321:1;;8:9:-1;5:2;;;30:1;27;20:12;5:2;905:321:1;;;;;;;;;;;;;;;;;;;1106:445:2;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1106:445:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2530:160;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2530:160:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1158:402:0;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1158:402:0;;;;;;;;;;;;;;;;;;;566:167:6;;8:9:-1;5:2;;;30:1;27;20:12;5:2;566:167:6;;;;;;;;;;;;;;;;;;;770:18:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;2171:222:2:-;2254:4;2306:6;2274:7;:19;2282:10;2274:19;;;;;;;;;;;;;;;:29;2294:8;2274:29;;;;;;;;;;;;;;;:38;;;;2348:8;2327:38;;2336:10;2327:38;;;2358:6;2327:38;;;;;;;;;;;;;;;2382:4;2375:11;;2171:222;;;;:::o;1073:26::-;;;;:::o;1108:697:4:-;1206:4;1226:17;1246:7;:14;1254:5;1246:14;;;;;;;;;;;;;;;:26;1261:10;1246:26;;;;;;;;;;;;;;;;1226:46;;1322:6;1303:8;:15;1312:5;1303:15;;;;;;;;;;;;;;;;:25;;1342:20;;;;;;;;;;;;;;;;;;;;;;;1282:90;;;;;;;;;;;;;;;;;;;;;;;;;;;1416:6;1403:9;:19;;1436:22;;;;;;;;;;;;;;;;;;;;;;;1382:86;;;;;;;;;;;;;;;;;;;;;;;;;;;1525:8;:13;1534:3;1525:13;;;;;;;;;;;;;;;;1515:6;1499:8;:13;1508:3;1499:13;;;;;;;;;;;;;;;;:22;:39;;1552:8;;;;;;;;;;;;;;;;;;;;;;;1478:92;;;;;;;;;;;;;;;;;;;;;;;;;;;1597:6;1580:8;:13;1589:3;1580:13;;;;;;;;;;;;;;;;:23;;;;;;;;;;;1632:6;1613:8;:15;1622:5;1613:15;;;;;;;;;;;;;;;;:25;;;;;;;;;;;762:10;1652:9;:20;1648:87;;;1718:6;1688:7;:14;1696:5;1688:14;;;;;;;;;;;;;;;:26;1703:10;1688:26;;;;;;;;;;;;;;;;:36;;;;;;;;;;;1648:87;1765:3;1749:28;;1758:5;1749:28;;;1770:6;1749:28;;;;;;;;;;;;;;;1794:4;1787:11;;1108:697;;;;;;:::o;820:23:0:-;;;;:::o;2399:125:2:-;2471:7;2501:8;:16;2510:6;2501:16;;;;;;;;;;;;;;;;2494:23;;2399:125;;;:::o;292:20:6:-;;;;;;;;;;;;;:::o;794::0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;905:321:1:-;995:21;985:6;:31;;964:133;;;;;;;;;;;;;;;;;;;;;;;;1130:37;1138:6;1146:8;:20;1155:10;1146:20;;;;;;;;;;;;;;;;1130:7;:37::i;:::-;1107:8;:20;1116:10;1107:20;;;;;;;;;;;;;;;:60;;;;1191:28;1199:11;;1212:6;1191:7;:28::i;:::-;1177:11;:42;;;;905:321;:::o;1106:445:2:-;1185:4;1250:6;1226:8;:20;1235:10;1226:20;;;;;;;;;;;;;;;;:30;;1270:20;;;;;;;;;;;;;;;;;;;;;;;1205:95;;;;;;;;;;;;;;;;;;;;;;;;;;;1357:8;:13;1366:3;1357:13;;;;;;;;;;;;;;;;1347:6;1331:8;:13;1340:3;1331:13;;;;;;;;;;;;;;;;:22;:39;;1384:8;;;;;;;;;;;;;;;;;;;;;;;1310:92;;;;;;;;;;;;;;;;;;;;;;;;;;;1436:6;1412:8;:20;1421:10;1412:20;;;;;;;;;;;;;;;;:30;;;;;;;;;;;1469:6;1452:8;:13;1461:3;1452:13;;;;;;;;;;;;;;;;:23;;;;;;;;;;;1511:3;1490:33;;1499:10;1490:33;;;1516:6;1490:33;;;;;;;;;;;;;;;1540:4;1533:11;;1106:445;;;;:::o;2530:160::-;2628:7;2658;:15;2666:6;2658:15;;;;;;;;;;;;;;;:25;2674:8;2658:25;;;;;;;;;;;;;;;;2651:32;;2530:160;;;;:::o;1158:402:0:-;1258:19;460:5:6;;;;;;;;;;;446:19;;:10;:19;;;425:117;;;;;;;;;;;;;;;;;;;;;;;;1280:18:0;1290:7;1280:9;:18::i;:::-;1258:40;;1321:11;1312:6;:20;1308:210;;;1362:50;1370:11;;1383:28;1391:11;1404:6;1383:7;:28::i;:::-;1362:7;:50::i;:::-;1348:11;:64;;;;1308:210;;;1457:50;1465:11;;1478:28;1486:6;1494:11;1478:7;:28::i;:::-;1457:7;:50::i;:::-;1443:11;:64;;;;1308:210;1547:6;1527:8;:17;1536:7;1527:17;;;;;;;;;;;;;;;:26;;;;1158:402;;;:::o;566:167:6:-;460:5;;;;;;;;;;;446:19;;:10;:19;;;425:117;;;;;;;;;;;;;;;;;;;;;;;;682:1;662:22;;:8;:22;;;;658:69;;;708:8;700:5;;:16;;;;;;;;;;;;;;;;;;658:69;566:167;:::o;570:166:7:-;650:7;673:6;686:1;682;:5;673:14;;709:1;704;:6;;697:14;;;;;;728:1;721:8;;570:166;;;;;:::o;418:146::-;498:7;533:1;528;:6;;521:14;;;;;;556:1;552;:5;545:12;;418:146;;;;:::o;5:118:-1:-;;72:46;110:6;97:20;72:46;;;63:55;;57:66;;;;;130:118;;197:46;235:6;222:20;197:46;;;188:55;;182:66;;;;;255:241;;359:2;347:9;338:7;334:23;330:32;327:2;;;375:1;372;365:12;327:2;410:1;427:53;472:7;463:6;452:9;448:22;427:53;;;417:63;;389:97;321:175;;;;;503:366;;;624:2;612:9;603:7;599:23;595:32;592:2;;;640:1;637;630:12;592:2;675:1;692:53;737:7;728:6;717:9;713:22;692:53;;;682:63;;654:97;782:2;800:53;845:7;836:6;825:9;821:22;800:53;;;790:63;;761:98;586:283;;;;;;876:491;;;;1014:2;1002:9;993:7;989:23;985:32;982:2;;;1030:1;1027;1020:12;982:2;1065:1;1082:53;1127:7;1118:6;1107:9;1103:22;1082:53;;;1072:63;;1044:97;1172:2;1190:53;1235:7;1226:6;1215:9;1211:22;1190:53;;;1180:63;;1151:98;1280:2;1298:53;1343:7;1334:6;1323:9;1319:22;1298:53;;;1288:63;;1259:98;976:391;;;;;;1374:366;;;1495:2;1483:9;1474:7;1470:23;1466:32;1463:2;;;1511:1;1508;1501:12;1463:2;1546:1;1563:53;1608:7;1599:6;1588:9;1584:22;1563:53;;;1553:63;;1525:97;1653:2;1671:53;1716:7;1707:6;1696:9;1692:22;1671:53;;;1661:63;;1632:98;1457:283;;;;;;1747:241;;1851:2;1839:9;1830:7;1826:23;1822:32;1819:2;;;1867:1;1864;1857:12;1819:2;1902:1;1919:53;1964:7;1955:6;1944:9;1940:22;1919:53;;;1909:63;;1881:97;1813:175;;;;;1995:110;2068:31;2093:5;2068:31;;;2063:3;2056:44;2050:55;;;2112:101;2179:28;2201:5;2179:28;;;2174:3;2167:41;2161:52;;;2220:292;;2318:35;2347:5;2318:35;;;2370:6;2365:3;2358:19;2382:63;2438:6;2431:4;2426:3;2422:14;2415:4;2408:5;2404:16;2382:63;;;2477:29;2499:6;2477:29;;;2470:4;2465:3;2461:14;2457:50;2450:57;;2298:214;;;;;;2520:397;;2675:2;2670:3;2663:15;2712:66;2707:2;2702:3;2698:12;2691:88;2813:66;2808:2;2803:3;2799:12;2792:88;2908:2;2903:3;2899:12;2892:19;;2656:261;;;;2926:397;;3081:2;3076:3;3069:15;3118:66;3113:2;3108:3;3104:12;3097:88;3219:66;3214:2;3209:3;3205:12;3198:88;3314:2;3309:3;3305:12;3298:19;;3062:261;;;;3331:110;3404:31;3429:5;3404:31;;;3399:3;3392:44;3386:55;;;3448:193;;3556:2;3545:9;3541:18;3533:26;;3570:61;3628:1;3617:9;3613:17;3604:6;3570:61;;;3527:114;;;;;3648:181;;3750:2;3739:9;3735:18;3727:26;;3764:55;3816:1;3805:9;3801:17;3792:6;3764:55;;;3721:108;;;;;3836:273;;3960:2;3949:9;3945:18;3937:26;;4010:9;4004:4;4000:20;3996:1;3985:9;3981:17;3974:47;4035:64;4094:4;4085:6;4035:64;;;4027:72;;3931:178;;;;;4116:387;;4297:2;4286:9;4282:18;4274:26;;4347:9;4341:4;4337:20;4333:1;4322:9;4318:17;4311:47;4372:121;4488:4;4372:121;;;4364:129;;4268:235;;;;4510:387;;4691:2;4680:9;4676:18;4668:26;;4741:9;4735:4;4731:20;4727:1;4716:9;4712:17;4705:47;4766:121;4882:4;4766:121;;;4758:129;;4662:235;;;;4904:193;;5012:2;5001:9;4997:18;4989:26;;5026:61;5084:1;5073:9;5069:17;5060:6;5026:61;;;4983:114;;;;;5104:88;;5181:5;5175:12;5165:22;;5159:33;;;;5199:128;;5279:42;5272:5;5268:54;5257:65;;5251:76;;;;5334:92;;5414:5;5407:13;5400:21;5389:32;;5383:43;;;;5433:79;;5502:5;5491:16;;5485:27;;;;5519:128;;5599:42;5592:5;5588:54;5577:65;;5571:76;;;;5654:79;;5723:5;5712:16;;5706:27;;;;5741:268;5806:1;5813:101;5827:6;5824:1;5821:13;5813:101;;;5903:1;5898:3;5894:11;5888:18;5884:1;5879:3;5875:11;5868:39;5849:2;5846:1;5842:10;5837:15;;5813:101;;;5929:6;5926:1;5923:13;5920:2;;;5994:1;5985:6;5980:3;5976:16;5969:27;5920:2;5790:219;;;;;6017:97;;6105:2;6101:7;6096:2;6089:5;6085:14;6081:28;6071:38;;6065:49;;;"
- }
- }
- },
- "sources": {
- "current/test/DummyERC20Token/DummyERC20Token.sol": {
- "id": 0
- },
- "current/test/Mintable/Mintable.sol": {
- "id": 1
- },
- "current/tokens/ERC20Token/ERC20Token.sol": {
- "id": 2
- },
- "current/tokens/ERC20Token/IERC20Token.sol": {
- "id": 3
- },
- "current/tokens/UnlimitedAllowanceToken/UnlimitedAllowanceToken.sol": {
- "id": 4
- },
- "current/utils/Ownable/IOwnable.sol": {
- "id": 5
- },
- "current/utils/Ownable/Ownable.sol": {
- "id": 6
- },
- "current/utils/SafeMath/SafeMath.sol": {
- "id": 7
- }
- },
- "sourceCodes": {
- "current/test/DummyERC20Token/DummyERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../Mintable/Mintable.sol\";\nimport \"../../utils/Ownable/Ownable.sol\";\n\ncontract DummyERC20Token is Mintable, Ownable {\n string public name;\n string public symbol;\n uint256 public decimals;\n\n constructor (\n string _name,\n string _symbol,\n uint256 _decimals,\n uint256 _totalSupply)\n public\n {\n name = _name;\n symbol = _symbol;\n decimals = _decimals;\n totalSupply = _totalSupply;\n balances[msg.sender] = _totalSupply;\n }\n\n function setBalance(address _target, uint256 _value)\n public\n onlyOwner\n {\n uint256 currBalance = balanceOf(_target);\n if (_value < currBalance) {\n totalSupply = safeSub(totalSupply, safeSub(currBalance, _value));\n } else {\n totalSupply = safeAdd(totalSupply, safeSub(_value, currBalance));\n }\n balances[_target] = _value;\n }\n}\n",
- "current/test/Mintable/Mintable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../tokens/UnlimitedAllowanceToken/UnlimitedAllowanceToken.sol\";\nimport \"../../utils/SafeMath/SafeMath.sol\";\n\n/*\n * Mintable\n * Base contract that creates a mintable UnlimitedAllowanceToken\n */\ncontract Mintable is UnlimitedAllowanceToken, SafeMath {\n function mint(uint256 _value)\n public\n {\n require(\n _value <= 100000000000000000000,\n \"Minting more than 100000000000000000000 is not allowed.\"\n );\n balances[msg.sender] = safeAdd(_value, balances[msg.sender]);\n totalSupply = safeAdd(totalSupply, _value);\n }\n}\n",
- "current/tokens/ERC20Token/ERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./IERC20Token.sol\";\n\ncontract ERC20Token is IERC20Token {\n\n string constant INSUFFICIENT_BALANCE = \"Insufficient balance to complete transfer.\";\n string constant INSUFFICIENT_ALLOWANCE = \"Insufficient allowance to complete transfer.\";\n string constant OVERFLOW = \"Transfer would result in an overflow.\";\n\n mapping (address => uint256) balances;\n mapping (address => mapping (address => uint256)) allowed;\n\n uint256 public totalSupply;\n\n function transfer(address _to, uint256 _value)\n public\n returns (bool)\n {\n require(\n balances[msg.sender] >= _value,\n INSUFFICIENT_BALANCE\n );\n require(\n balances[_to] + _value >= balances[_to],\n OVERFLOW\n );\n balances[msg.sender] -= _value;\n balances[_to] += _value;\n emit Transfer(msg.sender, _to, _value);\n return true;\n }\n\n function transferFrom(address _from, address _to, uint256 _value)\n public\n returns (bool)\n {\n require(\n balances[_from] >= _value,\n INSUFFICIENT_BALANCE\n );\n require(\n allowed[_from][msg.sender] >= _value,\n INSUFFICIENT_ALLOWANCE\n );\n require(\n balances[_to] + _value >= balances[_to],\n OVERFLOW\n );\n balances[_to] += _value;\n balances[_from] -= _value;\n allowed[_from][msg.sender] -= _value;\n emit Transfer(_from, _to, _value);\n return true;\n }\n\n function approve(address _spender, uint256 _value)\n public\n returns (bool)\n {\n allowed[msg.sender][_spender] = _value;\n emit Approval(msg.sender, _spender, _value);\n return true;\n }\n\n function balanceOf(address _owner)\n public view\n returns (uint256)\n {\n return balances[_owner];\n }\n\n function allowance(address _owner, address _spender)\n public\n view\n returns (uint256)\n {\n return allowed[_owner][_spender];\n }\n}\n\n",
- "current/tokens/ERC20Token/IERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.4.24;\npragma experimental ABIEncoderV2;\n\ncontract IERC20Token {\n\n /// @notice send `value` token to `to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return Whether the transfer was successful or not\n function transfer(address _to, uint256 _value)\n public\n returns (bool);\n\n /// @notice send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return Whether the transfer was successful or not\n function transferFrom(address _from, address _to, uint256 _value)\n public\n returns (bool);\n \n /// @notice `msg.sender` approves `_spender` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Whether the approval was successful or not\n function approve(address _spender, uint256 _value)\n public\n returns (bool);\n\n /// @param _owner The address from which the balance will be retrieved\n /// @return The balance\n function balanceOf(address _owner)\n public view\n returns (uint256);\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender)\n public view\n returns (uint256);\n\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 _value\n );\n \n event Approval(\n address indexed _owner,\n address indexed _spender,\n uint256 _value\n );\n}\n",
- "current/tokens/UnlimitedAllowanceToken/UnlimitedAllowanceToken.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../ERC20Token/ERC20Token.sol\";\n\ncontract UnlimitedAllowanceToken is ERC20Token {\n\n uint256 constant MAX_UINT = 2**256 - 1;\n\n /// @dev ERC20 transferFrom, modified such that an allowance of MAX_UINT represents an unlimited allowance. See https://github.com/ethereum/EIPs/issues/717\n /// @param _from Address to transfer from.\n /// @param _to Address to transfer to.\n /// @param _value Amount to transfer.\n /// @return Success of transfer.\n function transferFrom(address _from, address _to, uint256 _value)\n public\n returns (bool)\n {\n uint256 allowance = allowed[_from][msg.sender];\n require(\n balances[_from] >= _value,\n INSUFFICIENT_BALANCE\n );\n require(\n allowance >= _value,\n INSUFFICIENT_ALLOWANCE\n );\n require(\n balances[_to] + _value >= balances[_to],\n OVERFLOW\n );\n balances[_to] += _value;\n balances[_from] -= _value;\n if (allowance < MAX_UINT) {\n allowed[_from][msg.sender] -= _value;\n }\n emit Transfer(_from, _to, _value);\n return true;\n }\n}\n",
- "current/utils/Ownable/IOwnable.sol": "pragma solidity ^0.4.24;\npragma experimental ABIEncoderV2;\n\n/*\n * Ownable\n *\n * Base contract with an owner.\n * Provides onlyOwner modifier, which prevents function from running if it is called by anyone other than the owner.\n */\n\ncontract IOwnable {\n function transferOwnership(address newOwner)\n public;\n}\n",
- "current/utils/Ownable/Ownable.sol": "pragma solidity ^0.4.24;\npragma experimental ABIEncoderV2;\n\n/*\n * Ownable\n *\n * Base contract with an owner.\n * Provides onlyOwner modifier, which prevents function from running if it is called by anyone other than the owner.\n */\n\nimport \"./IOwnable.sol\";\n\ncontract Ownable is IOwnable {\n address public owner;\n\n constructor ()\n public\n {\n owner = msg.sender;\n }\n\n modifier onlyOwner() {\n require(\n msg.sender == owner,\n \"Only contract owner is allowed to call this method.\"\n );\n _;\n }\n\n function transferOwnership(address newOwner)\n public\n onlyOwner\n {\n if (newOwner != address(0)) {\n owner = newOwner;\n }\n }\n}\n",
- "current/utils/SafeMath/SafeMath.sol": "pragma solidity ^0.4.24;\npragma experimental ABIEncoderV2;\n\ncontract SafeMath {\n function safeMul(uint a, uint b)\n internal\n pure\n returns (uint256)\n {\n uint c = a * b;\n assert(a == 0 || c / a == b);\n return c;\n }\n\n function safeDiv(uint a, uint b)\n internal\n pure\n returns (uint256)\n {\n uint c = a / b;\n return c;\n }\n\n function safeSub(uint a, uint b)\n internal\n pure\n returns (uint256)\n {\n assert(b <= a);\n return a - b;\n }\n\n function safeAdd(uint a, uint b)\n internal\n pure\n returns (uint256)\n {\n uint c = a + b;\n assert(c >= a);\n return c;\n }\n\n function max64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n\n function max256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n}\n"
- },
- "sourceTreeHashHex": "0x4830433daa189b8c48beea455c8f20379bb7b5a33b1607b73e3938501a24bd2b",
- "compiler": {
- "name": "solc",
- "version": "0.4.24",
- "settings": {
- "outputSelection": {
- "*": {
- "*": [
- "abi",
- "evm.bytecode.object",
- "evm.bytecode.sourceMap",
- "evm.deployedBytecode.object",
- "evm.deployedBytecode.sourceMap"
- ]
- }
- }
- }
- },
- "networks": {}
-} \ No newline at end of file
diff --git a/packages/migrations/artifacts/1.0.0/Exchange_v1.json b/packages/migrations/artifacts/1.0.0/Exchange_v1.json
deleted file mode 100644
index 5d89765f0..000000000
--- a/packages/migrations/artifacts/1.0.0/Exchange_v1.json
+++ /dev/null
@@ -1,678 +0,0 @@
-{
- "schemaVersion": "2.0.0",
- "contractName": "Exchange_v1",
- "compilerOutput": {
- "abi": [
- {
- "constant": true,
- "inputs": [
- {
- "name": "numerator",
- "type": "uint256"
- },
- {
- "name": "denominator",
- "type": "uint256"
- },
- {
- "name": "target",
- "type": "uint256"
- }
- ],
- "name": "isRoundingError",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "",
- "type": "bytes32"
- }
- ],
- "name": "filled",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "",
- "type": "bytes32"
- }
- ],
- "name": "cancelled",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "orderAddresses",
- "type": "address[5][]"
- },
- {
- "name": "orderValues",
- "type": "uint256[6][]"
- },
- {
- "name": "fillTakerTokenAmount",
- "type": "uint256"
- },
- {
- "name": "shouldThrowOnInsufficientBalanceOrAllowance",
- "type": "bool"
- },
- {
- "name": "v",
- "type": "uint8[]"
- },
- {
- "name": "r",
- "type": "bytes32[]"
- },
- {
- "name": "s",
- "type": "bytes32[]"
- }
- ],
- "name": "fillOrdersUpTo",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "orderAddresses",
- "type": "address[5]"
- },
- {
- "name": "orderValues",
- "type": "uint256[6]"
- },
- {
- "name": "cancelTakerTokenAmount",
- "type": "uint256"
- }
- ],
- "name": "cancelOrder",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "ZRX_TOKEN_CONTRACT",
- "outputs": [
- {
- "name": "",
- "type": "address"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "orderAddresses",
- "type": "address[5][]"
- },
- {
- "name": "orderValues",
- "type": "uint256[6][]"
- },
- {
- "name": "fillTakerTokenAmounts",
- "type": "uint256[]"
- },
- {
- "name": "v",
- "type": "uint8[]"
- },
- {
- "name": "r",
- "type": "bytes32[]"
- },
- {
- "name": "s",
- "type": "bytes32[]"
- }
- ],
- "name": "batchFillOrKillOrders",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "orderAddresses",
- "type": "address[5]"
- },
- {
- "name": "orderValues",
- "type": "uint256[6]"
- },
- {
- "name": "fillTakerTokenAmount",
- "type": "uint256"
- },
- {
- "name": "v",
- "type": "uint8"
- },
- {
- "name": "r",
- "type": "bytes32"
- },
- {
- "name": "s",
- "type": "bytes32"
- }
- ],
- "name": "fillOrKillOrder",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "orderHash",
- "type": "bytes32"
- }
- ],
- "name": "getUnavailableTakerTokenAmount",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "signer",
- "type": "address"
- },
- {
- "name": "hash",
- "type": "bytes32"
- },
- {
- "name": "v",
- "type": "uint8"
- },
- {
- "name": "r",
- "type": "bytes32"
- },
- {
- "name": "s",
- "type": "bytes32"
- }
- ],
- "name": "isValidSignature",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "numerator",
- "type": "uint256"
- },
- {
- "name": "denominator",
- "type": "uint256"
- },
- {
- "name": "target",
- "type": "uint256"
- }
- ],
- "name": "getPartialAmount",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "TOKEN_TRANSFER_PROXY_CONTRACT",
- "outputs": [
- {
- "name": "",
- "type": "address"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "orderAddresses",
- "type": "address[5][]"
- },
- {
- "name": "orderValues",
- "type": "uint256[6][]"
- },
- {
- "name": "fillTakerTokenAmounts",
- "type": "uint256[]"
- },
- {
- "name": "shouldThrowOnInsufficientBalanceOrAllowance",
- "type": "bool"
- },
- {
- "name": "v",
- "type": "uint8[]"
- },
- {
- "name": "r",
- "type": "bytes32[]"
- },
- {
- "name": "s",
- "type": "bytes32[]"
- }
- ],
- "name": "batchFillOrders",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "orderAddresses",
- "type": "address[5][]"
- },
- {
- "name": "orderValues",
- "type": "uint256[6][]"
- },
- {
- "name": "cancelTakerTokenAmounts",
- "type": "uint256[]"
- }
- ],
- "name": "batchCancelOrders",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "orderAddresses",
- "type": "address[5]"
- },
- {
- "name": "orderValues",
- "type": "uint256[6]"
- },
- {
- "name": "fillTakerTokenAmount",
- "type": "uint256"
- },
- {
- "name": "shouldThrowOnInsufficientBalanceOrAllowance",
- "type": "bool"
- },
- {
- "name": "v",
- "type": "uint8"
- },
- {
- "name": "r",
- "type": "bytes32"
- },
- {
- "name": "s",
- "type": "bytes32"
- }
- ],
- "name": "fillOrder",
- "outputs": [
- {
- "name": "filledTakerTokenAmount",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "orderAddresses",
- "type": "address[5]"
- },
- {
- "name": "orderValues",
- "type": "uint256[6]"
- }
- ],
- "name": "getOrderHash",
- "outputs": [
- {
- "name": "",
- "type": "bytes32"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "EXTERNAL_QUERY_GAS_LIMIT",
- "outputs": [
- {
- "name": "",
- "type": "uint16"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "VERSION",
- "outputs": [
- {
- "name": "",
- "type": "string"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "inputs": [
- {
- "name": "_zrxToken",
- "type": "address"
- },
- {
- "name": "_tokenTransferProxy",
- "type": "address"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "constructor"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "maker",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "taker",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "feeRecipient",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "makerToken",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "takerToken",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "filledMakerTokenAmount",
- "type": "uint256"
- },
- {
- "indexed": false,
- "name": "filledTakerTokenAmount",
- "type": "uint256"
- },
- {
- "indexed": false,
- "name": "paidMakerFee",
- "type": "uint256"
- },
- {
- "indexed": false,
- "name": "paidTakerFee",
- "type": "uint256"
- },
- {
- "indexed": true,
- "name": "tokens",
- "type": "bytes32"
- },
- {
- "indexed": false,
- "name": "orderHash",
- "type": "bytes32"
- }
- ],
- "name": "LogFill",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "maker",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "feeRecipient",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "makerToken",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "takerToken",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "cancelledMakerTokenAmount",
- "type": "uint256"
- },
- {
- "indexed": false,
- "name": "cancelledTakerTokenAmount",
- "type": "uint256"
- },
- {
- "indexed": true,
- "name": "tokens",
- "type": "bytes32"
- },
- {
- "indexed": false,
- "name": "orderHash",
- "type": "bytes32"
- }
- ],
- "name": "LogCancel",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "errorId",
- "type": "uint8"
- },
- {
- "indexed": true,
- "name": "orderHash",
- "type": "bytes32"
- }
- ],
- "name": "LogError",
- "type": "event"
- }
- ],
- "evm": {
- "bytecode": {
- "linkReferences": {},
- "object": "0x608060405234801561001057600080fd5b50604051604080612d998339810180604052810190808051906020019092919080519060200190929190505050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050612cca806100cf6000396000f3006080604052600436106100fc576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806314df96ee14610101578063288cdc911461015a5780632ac126221461019f578063363349be146101e4578063394c21e7146103f85780633b30ba59146104975780634f150787146104ee578063741bcc931461071b5780637e9abb50146107cf5780638163681e1461081457806398024a8b146108a6578063add1cbc5146108fb578063b7b2c7d614610952578063baa0181d14610b8b578063bc61394a14610cef578063cfc4d0ec14610dc3578063f06bbf7514610e60578063ffa1ad7414610e93575b600080fd5b34801561010d57600080fd5b50610140600480360381019080803590602001909291908035906020019092919080359060200190929190505050610f23565b604051808215151515815260200191505060405180910390f35b34801561016657600080fd5b506101896004803603810190808035600019169060200190929190505050610f7b565b6040518082815260200191505060405180910390f35b3480156101ab57600080fd5b506101ce6004803603810190808035600019169060200190929190505050610f93565b6040518082815260200191505060405180910390f35b3480156101f057600080fd5b506103e260048036038101908080359060200190820180359060200190808060200260200160405190810160405280939291908181526020016000905b8282101561027257848483905060a00201600580602002604051908101604052809291908260056020028082843782019150505050508152602001906001019061022d565b5050505050919291929080359060200190820180359060200190808060200260200160405190810160405280939291908181526020016000905b828210156102f157848483905060c0020160068060200260405190810160405280929190826006602002808284378201915050505050815260200190600101906102ac565b5050505050919291929080359060200190929190803515159060200190929190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091929192908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290505050610fab565b6040518082815260200191505060405180910390f35b34801561040457600080fd5b506104816004803603810190808060a001906005806020026040519081016040528092919082600560200280828437820191505050505091929192908060c0019060068060200260405190810160405280929190826006602002808284378201915050505050919291929080359060200190929190505050611110565b6040518082815260200191505060405180910390f35b3480156104a357600080fd5b506104ac6115f8565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104fa57600080fd5b5061071960048036038101908080359060200190820180359060200190808060200260200160405190810160405280939291908181526020016000905b8282101561057c57848483905060a002016005806020026040519081016040528092919082600560200280828437820191505050505081526020019060010190610537565b5050505050919291929080359060200190820180359060200190808060200260200160405190810160405280939291908181526020016000905b828210156105fb57848483905060c0020160068060200260405190810160405280929190826006602002808284378201915050505050815260200190600101906105b6565b505050505091929192908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091929192908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929050505061161d565b005b34801561072757600080fd5b506107cd6004803603810190808060a001906005806020026040519081016040528092919082600560200280828437820191505050505091929192908060c0019060068060200260405190810160405280929190826006602002808284378201915050505050919291929080359060200190929190803560ff169060200190929190803560001916906020019092919080356000191690602001909291905050506116da565b005b3480156107db57600080fd5b506107fe60048036038101908080356000191690602001909291905050506116ff565b6040518082815260200191505060405180910390f35b34801561082057600080fd5b5061088c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035600019169060200190929190803560ff16906020019092919080356000191690602001909291908035600019169060200190929190505050611748565b604051808215151515815260200191505060405180910390f35b3480156108b257600080fd5b506108e5600480360381019080803590602001909291908035906020019092919080359060200190929190505050611849565b6040518082815260200191505060405180910390f35b34801561090757600080fd5b50610910611867565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561095e57600080fd5b50610b8960048036038101908080359060200190820180359060200190808060200260200160405190810160405280939291908181526020016000905b828210156109e057848483905060a00201600580602002604051908101604052809291908260056020028082843782019150505050508152602001906001019061099b565b5050505050919291929080359060200190820180359060200190808060200260200160405190810160405280939291908181526020016000905b82821015610a5f57848483905060c002016006806020026040519081016040528092919082600660200280828437820191505050505081526020019060010190610a1a565b505050505091929192908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929080351515906020019092919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091929192908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929050505061188d565b005b348015610b9757600080fd5b50610ced60048036038101908080359060200190820180359060200190808060200260200160405190810160405280939291908181526020016000905b82821015610c1957848483905060a002016005806020026040519081016040528092919082600560200280828437820191505050505081526020019060010190610bd4565b5050505050919291929080359060200190820180359060200190808060200260200160405190810160405280939291908181526020016000905b82821015610c9857848483905060c002016006806020026040519081016040528092919082600660200280828437820191505050505081526020019060010190610c53565b505050505091929192908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929050505061194d565b005b348015610cfb57600080fd5b50610dad6004803603810190808060a001906005806020026040519081016040528092919082600560200280828437820191505050505091929192908060c0019060068060200260405190810160405280929190826006602002808284378201915050505050919291929080359060200190929190803515159060200190929190803560ff169060200190929190803560001916906020019092919080356000191690602001909291905050506119c0565b6040518082815260200191505060405180910390f35b348015610dcf57600080fd5b50610e426004803603810190808060a001906005806020026040519081016040528092919082600560200280828437820191505050505091929192908060c00190600680602002604051908101604052809291908260066020028082843782019150505050509192919290505050612160565b60405180826000191660001916815260200191505060405180910390f35b348015610e6c57600080fd5b50610e7561240b565b604051808261ffff1661ffff16815260200191505060405180910390f35b348015610e9f57600080fd5b50610ea8612411565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610ee8578082015181840152602081019050610ecd565b50505050905090810190601f168015610f155780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b600080600084801515610f3257fe5b86850991506000821415610f495760009250610f72565b610f68610f5983620f424061244a565b610f63888761244a565b61247d565b90506103e8811192505b50509392505050565b60026020528060005260406000206000915090505481565b60036020528060005260406000206000915090505481565b6000806000809150600090505b895181101561110057896000815181101515610fd057fe5b906020019060200201516003600581101515610fe857fe5b602002015173ffffffffffffffffffffffffffffffffffffffff168a8281518110151561101157fe5b90602001906020020151600360058110151561102957fe5b602002015173ffffffffffffffffffffffffffffffffffffffff1614151561105057600080fd5b6110e4826110df8c8481518110151561106557fe5b906020019060200201518c8581518110151561107d57fe5b906020019060200201516110918d88612498565b8c8c888151811015156110a057fe5b906020019060200201518c898151811015156110b857fe5b906020019060200201518c8a8151811015156110d057fe5b906020019060200201516119c0565b6124b1565b9150878214156110f357611100565b8080600101915050610fb8565b8192505050979650505050505050565b600061111a612bd2565b6000806101606040519081016040528088600060058110151561113957fe5b602002015173ffffffffffffffffffffffffffffffffffffffff16815260200188600160058110151561116857fe5b602002015173ffffffffffffffffffffffffffffffffffffffff16815260200188600260058110151561119757fe5b602002015173ffffffffffffffffffffffffffffffffffffffff1681526020018860036005811015156111c657fe5b602002015173ffffffffffffffffffffffffffffffffffffffff1681526020018860046005811015156111f557fe5b602002015173ffffffffffffffffffffffffffffffffffffffff16815260200187600060068110151561122457fe5b6020020151815260200187600160068110151561123d57fe5b6020020151815260200187600260068110151561125657fe5b6020020151815260200187600360068110151561126f57fe5b6020020151815260200187600460068110151561128857fe5b6020020151815260200161129c8989612160565b6000191681525092503373ffffffffffffffffffffffffffffffffffffffff16836000015173ffffffffffffffffffffffffffffffffffffffff161415156112e357600080fd5b60008360a001511180156112fb575060008360c00151115b80156113075750600085115b151561131257600080fd5b8261012001514210151561136f57826101400151600019166000600381111561133757fe5b60ff167f36d86c59e00bd73dc19ba3adfe068e4b64ac7e92be35546adeddf1b956a87e9060405160405180910390a3600093506115ee565b61138a8360c001516113858561014001516116ff565b612498565b915061139685836124cf565b905060008114156113f05782610140015160001916600160038111156113b857fe5b60ff167f36d86c59e00bd73dc19ba3adfe068e4b64ac7e92be35546adeddf1b956a87e9060405160405180910390a3600093506115ee565b61141a600360008561014001516000191660001916815260200190815260200160002054826124b1565b60036000856101400151600019166000191681526020019081526020016000208190555082604001518360600151604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c0100000000000000000000000002815260140192505050604051809103902060001916836080015173ffffffffffffffffffffffffffffffffffffffff16846000015173ffffffffffffffffffffffffffffffffffffffff167f67d66f160bc93d925d05dae1794c90d2d6d6688b29b84ff069398a9b0458713186604001518760600151611552878a60c001518b60a00151611849565b878a6101400151604051808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200183815260200182600019166000191681526020019550505050505060405180910390a48093505b5050509392505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008090505b86518110156116d1576116c4878281518110151561163d57fe5b90602001906020020151878381518110151561165557fe5b90602001906020020151878481518110151561166d57fe5b90602001906020020151878581518110151561168557fe5b90602001906020020151878681518110151561169d57fe5b9060200190602002015187878151811015156116b557fe5b906020019060200201516116da565b8080600101915050611623565b50505050505050565b836116eb87878760008888886119c0565b1415156116f757600080fd5b505050505050565b600061174160026000846000191660001916815260200190815260200160002054600360008560001916600019168152602001908152602001600020546124b1565b9050919050565b600060018560405180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c0182600019166000191681526020019150506040518091039020858585604051600081526020016040526040518085600019166000191681526020018460ff1660ff1681526020018360001916600019168152602001826000191660001916815260200194505050505060206040516020810390808403906000865af1158015611806573d6000803e3d6000fd5b5050506020604051035173ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614905095945050505050565b600061185e611858858461244a565b8461247d565b90509392505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008090505b87518110156119435761193588828151811015156118ad57fe5b9060200190602002015188838151811015156118c557fe5b9060200190602002015188848151811015156118dd57fe5b906020019060200201518888868151811015156118f657fe5b90602001906020020151888781518110151561190e57fe5b90602001906020020151888881518110151561192657fe5b906020019060200201516119c0565b508080600101915050611893565b5050505050505050565b60008090505b83518110156119ba576119ac848281518110151561196d57fe5b90602001906020020151848381518110151561198557fe5b90602001906020020151848481518110151561199d57fe5b90602001906020020151611110565b508080600101915050611953565b50505050565b60006119ca612bd2565b600080600080610160604051908101604052808e60006005811015156119ec57fe5b602002015173ffffffffffffffffffffffffffffffffffffffff1681526020018e6001600581101515611a1b57fe5b602002015173ffffffffffffffffffffffffffffffffffffffff1681526020018e6002600581101515611a4a57fe5b602002015173ffffffffffffffffffffffffffffffffffffffff1681526020018e6003600581101515611a7957fe5b602002015173ffffffffffffffffffffffffffffffffffffffff1681526020018e6004600581101515611aa857fe5b602002015173ffffffffffffffffffffffffffffffffffffffff1681526020018d6000600681101515611ad757fe5b602002015181526020018d6001600681101515611af057fe5b602002015181526020018d6002600681101515611b0957fe5b602002015181526020018d6003600681101515611b2257fe5b602002015181526020018d6004600681101515611b3b57fe5b60200201518152602001611b4f8f8f612160565b600019168152509450600073ffffffffffffffffffffffffffffffffffffffff16856020015173ffffffffffffffffffffffffffffffffffffffff161480611bc657503373ffffffffffffffffffffffffffffffffffffffff16856020015173ffffffffffffffffffffffffffffffffffffffff16145b1515611bd157600080fd5b60008560a00151118015611be9575060008560c00151115b8015611bf5575060008b115b1515611c0057600080fd5b611c1685600001518661014001518b8b8b611748565b1515611c2157600080fd5b84610120015142101515611c7e578461014001516000191660006003811115611c4657fe5b60ff167f36d86c59e00bd73dc19ba3adfe068e4b64ac7e92be35546adeddf1b956a87e9060405160405180910390a360009550612150565b611c998560c00151611c948761014001516116ff565b612498565b9350611ca58b856124cf565b95506000861415611cff578461014001516000191660016003811115611cc757fe5b60ff167f36d86c59e00bd73dc19ba3adfe068e4b64ac7e92be35546adeddf1b956a87e9060405160405180910390a360009550612150565b611d12868660c001518760a00151610f23565b15611d66578461014001516000191660026003811115611d2e57fe5b60ff167f36d86c59e00bd73dc19ba3adfe068e4b64ac7e92be35546adeddf1b956a87e9060405160405180910390a360009550612150565b89158015611d7b5750611d7985876124e8565b155b15611dce5784610140015160001916600380811115611d9657fe5b60ff167f36d86c59e00bd73dc19ba3adfe068e4b64ac7e92be35546adeddf1b956a87e9060405160405180910390a360009550612150565b611de1868660c001518760a00151611849565b9250611e0d600260008761014001516000191660001916815260200190815260200160002054876124b1565b600260008761014001516000191660001916815260200190815260200160002081905550611e45856040015186600001513386612838565b1515611e5057600080fd5b611e64856060015133876000015189612838565b1515611e6f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16856080015173ffffffffffffffffffffffffffffffffffffffff16141515611f6e5760008560e001511115611f0c57611ec9868660c001518760e00151611849565b9150611f006000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff168660000151876080015185612838565b1515611f0b57600080fd5b5b60008561010001511115611f6d57611f2e868660c00151876101000151611849565b9050611f616000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1633876080015184612838565b1515611f6c57600080fd5b5b5b84604001518560600151604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c0100000000000000000000000002815260140192505050604051809103902060001916856080015173ffffffffffffffffffffffffffffffffffffffff16866000015173ffffffffffffffffffffffffffffffffffffffff167f0d0b9391970d9a25552f37d436d2aae2925e2bfe1b2a923754bada030c498cb33389604001518a60600151898d8a8a8f6101400151604051808973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200186815260200185815260200184815260200183815260200182600019166000191681526020019850505050505050505060405180910390a48595505b5050505050979650505050505050565b60003083600060058110151561217257fe5b602002015184600160058110151561218657fe5b602002015185600260058110151561219a57fe5b60200201518660036005811015156121ae57fe5b60200201518760046005811015156121c257fe5b60200201518760006006811015156121d657fe5b60200201518860016006811015156121ea57fe5b60200201518960026006811015156121fe57fe5b60200201518a600360068110151561221257fe5b60200201518b600460068110151561222657fe5b60200201518c600560068110151561223a57fe5b6020020151604051808d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018781526020018681526020018581526020018481526020018381526020018281526020019c505050505050505050505050506040518091039020905092915050565b61138781565b6040805190810160405280600581526020017f312e302e3000000000000000000000000000000000000000000000000000000081525081565b6000808284029050600084148061246b575082848281151561246857fe5b04145b151561247357fe5b8091505092915050565b600080828481151561248b57fe5b0490508091505092915050565b60008282111515156124a657fe5b818303905092915050565b60008082840190508381101515156124c557fe5b8091505092915050565b60008183106124de57816124e0565b825b905092915050565b600080600080600080600080600033975061250c8a8c60c001518d60a00151611849565b9650600073ffffffffffffffffffffffffffffffffffffffff168b6080015173ffffffffffffffffffffffffffffffffffffffff161415156127b9576000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168b6040015173ffffffffffffffffffffffffffffffffffffffff161495506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168b6060015173ffffffffffffffffffffffffffffffffffffffff161494506126078a8c60c001518d60e00151611849565b935061261d8a8c60c001518d6101000151611849565b92508561262a5783612635565b61263487856124b1565b5b915084612642578261264d565b61264c8a846124b1565b5b90508161267f6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff168d600001516129ac565b10806126b85750816126b66000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff168d60000151612a94565b105b806126ec5750806126ea6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff168a6129ac565b105b8061272057508061271e6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff168a612a94565b105b1561272e576000985061282a565b8515801561276757508661274a8c604001518d600001516129ac565b10806127665750866127648c604001518d60000151612a94565b105b5b15612775576000985061282a565b841580156127a657508961278d8c606001518a6129ac565b10806127a55750896127a38c606001518a612a94565b105b5b156127b4576000985061282a565b612825565b866127cc8c604001518d600001516129ac565b10806127e85750866127e68c604001518d60000151612a94565b105b806127ff5750896127fd8c606001518a6129ac565b105b806128165750896128148c606001518a612a94565b105b15612824576000985061282a565b5b600198505b505050505050505092915050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166315dacbea868686866040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001945050505050602060405180830381600087803b15801561296757600080fd5b505af115801561297b573d6000803e3d6000fd5b505050506040513d602081101561299157600080fd5b81019080805190602001909291905050509050949350505050565b60008273ffffffffffffffffffffffffffffffffffffffff166370a0823161138761ffff16846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600088803b158015612a5057600080fd5b5087f1158015612a64573d6000803e3d6000fd5b50505050506040513d6020811015612a7b57600080fd5b8101908080519060200190929190505050905092915050565b60008273ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e61138761ffff1684600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600088803b158015612b8e57600080fd5b5087f1158015612ba2573d6000803e3d6000fd5b50505050506040513d6020811015612bb957600080fd5b8101908080519060200190929190505050905092915050565b61016060405190810160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160008152602001600081526020016000815260200160008152602001600081526020016000801916815250905600a165627a7a723058203d2a5485da744cce47cf20cb3e00d3a32409b46698bfb0ea75bab61e857c14160029",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x40 MLOAD PUSH1 0x40 DUP1 PUSH2 0x2D99 DUP4 CODECOPY DUP2 ADD DUP1 PUSH1 0x40 MSTORE DUP2 ADD SWAP1 DUP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP DUP2 PUSH1 0x0 DUP1 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP DUP1 PUSH1 0x1 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP POP POP PUSH2 0x2CCA DUP1 PUSH2 0xCF PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN STOP PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0xFC JUMPI PUSH1 0x0 CALLDATALOAD PUSH29 0x100000000000000000000000000000000000000000000000000000000 SWAP1 DIV PUSH4 0xFFFFFFFF AND DUP1 PUSH4 0x14DF96EE EQ PUSH2 0x101 JUMPI DUP1 PUSH4 0x288CDC91 EQ PUSH2 0x15A JUMPI DUP1 PUSH4 0x2AC12622 EQ PUSH2 0x19F JUMPI DUP1 PUSH4 0x363349BE EQ PUSH2 0x1E4 JUMPI DUP1 PUSH4 0x394C21E7 EQ PUSH2 0x3F8 JUMPI DUP1 PUSH4 0x3B30BA59 EQ PUSH2 0x497 JUMPI DUP1 PUSH4 0x4F150787 EQ PUSH2 0x4EE JUMPI DUP1 PUSH4 0x741BCC93 EQ PUSH2 0x71B JUMPI DUP1 PUSH4 0x7E9ABB50 EQ PUSH2 0x7CF JUMPI DUP1 PUSH4 0x8163681E EQ PUSH2 0x814 JUMPI DUP1 PUSH4 0x98024A8B EQ PUSH2 0x8A6 JUMPI DUP1 PUSH4 0xADD1CBC5 EQ PUSH2 0x8FB JUMPI DUP1 PUSH4 0xB7B2C7D6 EQ PUSH2 0x952 JUMPI DUP1 PUSH4 0xBAA0181D EQ PUSH2 0xB8B JUMPI DUP1 PUSH4 0xBC61394A EQ PUSH2 0xCEF JUMPI DUP1 PUSH4 0xCFC4D0EC EQ PUSH2 0xDC3 JUMPI DUP1 PUSH4 0xF06BBF75 EQ PUSH2 0xE60 JUMPI DUP1 PUSH4 0xFFA1AD74 EQ PUSH2 0xE93 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x10D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x140 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xF23 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x166 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x189 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH1 0x0 NOT AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xF7B JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1AB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1CE PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH1 0x0 NOT AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xF93 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1F0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x3E2 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 SWAP1 JUMPDEST DUP3 DUP3 LT ISZERO PUSH2 0x272 JUMPI DUP5 DUP5 DUP4 SWAP1 POP PUSH1 0xA0 MUL ADD PUSH1 0x5 DUP1 PUSH1 0x20 MUL PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP3 PUSH1 0x5 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP DUP2 MSTORE PUSH1 0x20 ADD SWAP1 PUSH1 0x1 ADD SWAP1 PUSH2 0x22D JUMP JUMPDEST POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 SWAP1 JUMPDEST DUP3 DUP3 LT ISZERO PUSH2 0x2F1 JUMPI DUP5 DUP5 DUP4 SWAP1 POP PUSH1 0xC0 MUL ADD PUSH1 0x6 DUP1 PUSH1 0x20 MUL PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP3 PUSH1 0x6 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP DUP2 MSTORE PUSH1 0x20 ADD SWAP1 PUSH1 0x1 ADD SWAP1 PUSH2 0x2AC JUMP JUMPDEST POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD ISZERO ISZERO SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 POP POP POP PUSH2 0xFAB JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x404 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x481 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 PUSH1 0xA0 ADD SWAP1 PUSH1 0x5 DUP1 PUSH1 0x20 MUL PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP3 PUSH1 0x5 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 PUSH1 0xC0 ADD SWAP1 PUSH1 0x6 DUP1 PUSH1 0x20 MUL PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP3 PUSH1 0x6 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1110 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x4A3 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x4AC PUSH2 0x15F8 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x4FA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x719 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 SWAP1 JUMPDEST DUP3 DUP3 LT ISZERO PUSH2 0x57C JUMPI DUP5 DUP5 DUP4 SWAP1 POP PUSH1 0xA0 MUL ADD PUSH1 0x5 DUP1 PUSH1 0x20 MUL PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP3 PUSH1 0x5 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP DUP2 MSTORE PUSH1 0x20 ADD SWAP1 PUSH1 0x1 ADD SWAP1 PUSH2 0x537 JUMP JUMPDEST POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 SWAP1 JUMPDEST DUP3 DUP3 LT ISZERO PUSH2 0x5FB JUMPI DUP5 DUP5 DUP4 SWAP1 POP PUSH1 0xC0 MUL ADD PUSH1 0x6 DUP1 PUSH1 0x20 MUL PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP3 PUSH1 0x6 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP DUP2 MSTORE PUSH1 0x20 ADD SWAP1 PUSH1 0x1 ADD SWAP1 PUSH2 0x5B6 JUMP JUMPDEST POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 POP POP POP PUSH2 0x161D JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x727 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x7CD PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 PUSH1 0xA0 ADD SWAP1 PUSH1 0x5 DUP1 PUSH1 0x20 MUL PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP3 PUSH1 0x5 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 PUSH1 0xC0 ADD SWAP1 PUSH1 0x6 DUP1 PUSH1 0x20 MUL PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP3 PUSH1 0x6 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD PUSH1 0xFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD PUSH1 0x0 NOT AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD PUSH1 0x0 NOT AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x16DA JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x7DB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x7FE PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH1 0x0 NOT AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x16FF JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x820 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x88C PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD PUSH1 0x0 NOT AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD PUSH1 0xFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD PUSH1 0x0 NOT AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD PUSH1 0x0 NOT AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1748 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x8B2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x8E5 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1849 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x907 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x910 PUSH2 0x1867 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x95E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xB89 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 SWAP1 JUMPDEST DUP3 DUP3 LT ISZERO PUSH2 0x9E0 JUMPI DUP5 DUP5 DUP4 SWAP1 POP PUSH1 0xA0 MUL ADD PUSH1 0x5 DUP1 PUSH1 0x20 MUL PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP3 PUSH1 0x5 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP DUP2 MSTORE PUSH1 0x20 ADD SWAP1 PUSH1 0x1 ADD SWAP1 PUSH2 0x99B JUMP JUMPDEST POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 SWAP1 JUMPDEST DUP3 DUP3 LT ISZERO PUSH2 0xA5F JUMPI DUP5 DUP5 DUP4 SWAP1 POP PUSH1 0xC0 MUL ADD PUSH1 0x6 DUP1 PUSH1 0x20 MUL PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP3 PUSH1 0x6 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP DUP2 MSTORE PUSH1 0x20 ADD SWAP1 PUSH1 0x1 ADD SWAP1 PUSH2 0xA1A JUMP JUMPDEST POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD ISZERO ISZERO SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 POP POP POP PUSH2 0x188D JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xB97 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xCED PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 SWAP1 JUMPDEST DUP3 DUP3 LT ISZERO PUSH2 0xC19 JUMPI DUP5 DUP5 DUP4 SWAP1 POP PUSH1 0xA0 MUL ADD PUSH1 0x5 DUP1 PUSH1 0x20 MUL PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP3 PUSH1 0x5 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP DUP2 MSTORE PUSH1 0x20 ADD SWAP1 PUSH1 0x1 ADD SWAP1 PUSH2 0xBD4 JUMP JUMPDEST POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 SWAP1 JUMPDEST DUP3 DUP3 LT ISZERO PUSH2 0xC98 JUMPI DUP5 DUP5 DUP4 SWAP1 POP PUSH1 0xC0 MUL ADD PUSH1 0x6 DUP1 PUSH1 0x20 MUL PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP3 PUSH1 0x6 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP DUP2 MSTORE PUSH1 0x20 ADD SWAP1 PUSH1 0x1 ADD SWAP1 PUSH2 0xC53 JUMP JUMPDEST POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 POP POP POP PUSH2 0x194D JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xCFB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xDAD PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 PUSH1 0xA0 ADD SWAP1 PUSH1 0x5 DUP1 PUSH1 0x20 MUL PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP3 PUSH1 0x5 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 PUSH1 0xC0 ADD SWAP1 PUSH1 0x6 DUP1 PUSH1 0x20 MUL PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP3 PUSH1 0x6 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD ISZERO ISZERO SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD PUSH1 0xFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD PUSH1 0x0 NOT AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD PUSH1 0x0 NOT AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x19C0 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xDCF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xE42 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 PUSH1 0xA0 ADD SWAP1 PUSH1 0x5 DUP1 PUSH1 0x20 MUL PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP3 PUSH1 0x5 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 PUSH1 0xC0 ADD SWAP1 PUSH1 0x6 DUP1 PUSH1 0x20 MUL PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP3 PUSH1 0x6 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 POP POP POP PUSH2 0x2160 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 PUSH1 0x0 NOT AND PUSH1 0x0 NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xE6C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xE75 PUSH2 0x240B JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 PUSH2 0xFFFF AND PUSH2 0xFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xE9F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xEA8 PUSH2 0x2411 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE DUP4 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0xEE8 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0xECD JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0xF15 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP5 DUP1 ISZERO ISZERO PUSH2 0xF32 JUMPI INVALID JUMPDEST DUP7 DUP6 MULMOD SWAP2 POP PUSH1 0x0 DUP3 EQ ISZERO PUSH2 0xF49 JUMPI PUSH1 0x0 SWAP3 POP PUSH2 0xF72 JUMP JUMPDEST PUSH2 0xF68 PUSH2 0xF59 DUP4 PUSH3 0xF4240 PUSH2 0x244A JUMP JUMPDEST PUSH2 0xF63 DUP9 DUP8 PUSH2 0x244A JUMP JUMPDEST PUSH2 0x247D JUMP JUMPDEST SWAP1 POP PUSH2 0x3E8 DUP2 GT SWAP3 POP JUMPDEST POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x2 PUSH1 0x20 MSTORE DUP1 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP2 POP SWAP1 POP SLOAD DUP2 JUMP JUMPDEST PUSH1 0x3 PUSH1 0x20 MSTORE DUP1 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP2 POP SWAP1 POP SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 SWAP2 POP PUSH1 0x0 SWAP1 POP JUMPDEST DUP10 MLOAD DUP2 LT ISZERO PUSH2 0x1100 JUMPI DUP10 PUSH1 0x0 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xFD0 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH1 0x3 PUSH1 0x5 DUP2 LT ISZERO ISZERO PUSH2 0xFE8 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP11 DUP3 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1011 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH1 0x3 PUSH1 0x5 DUP2 LT ISZERO ISZERO PUSH2 0x1029 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x1050 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x10E4 DUP3 PUSH2 0x10DF DUP13 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1065 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP13 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x107D JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x1091 DUP14 DUP9 PUSH2 0x2498 JUMP JUMPDEST DUP13 DUP13 DUP9 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x10A0 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP13 DUP10 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x10B8 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP13 DUP11 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x10D0 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x19C0 JUMP JUMPDEST PUSH2 0x24B1 JUMP JUMPDEST SWAP2 POP DUP8 DUP3 EQ ISZERO PUSH2 0x10F3 JUMPI PUSH2 0x1100 JUMP JUMPDEST DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0xFB8 JUMP JUMPDEST DUP2 SWAP3 POP POP POP SWAP8 SWAP7 POP POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x111A PUSH2 0x2BD2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x160 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 DUP9 PUSH1 0x0 PUSH1 0x5 DUP2 LT ISZERO ISZERO PUSH2 0x1139 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP9 PUSH1 0x1 PUSH1 0x5 DUP2 LT ISZERO ISZERO PUSH2 0x1168 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP9 PUSH1 0x2 PUSH1 0x5 DUP2 LT ISZERO ISZERO PUSH2 0x1197 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP9 PUSH1 0x3 PUSH1 0x5 DUP2 LT ISZERO ISZERO PUSH2 0x11C6 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP9 PUSH1 0x4 PUSH1 0x5 DUP2 LT ISZERO ISZERO PUSH2 0x11F5 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP8 PUSH1 0x0 PUSH1 0x6 DUP2 LT ISZERO ISZERO PUSH2 0x1224 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD DUP2 MSTORE PUSH1 0x20 ADD DUP8 PUSH1 0x1 PUSH1 0x6 DUP2 LT ISZERO ISZERO PUSH2 0x123D JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD DUP2 MSTORE PUSH1 0x20 ADD DUP8 PUSH1 0x2 PUSH1 0x6 DUP2 LT ISZERO ISZERO PUSH2 0x1256 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD DUP2 MSTORE PUSH1 0x20 ADD DUP8 PUSH1 0x3 PUSH1 0x6 DUP2 LT ISZERO ISZERO PUSH2 0x126F JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD DUP2 MSTORE PUSH1 0x20 ADD DUP8 PUSH1 0x4 PUSH1 0x6 DUP2 LT ISZERO ISZERO PUSH2 0x1288 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD DUP2 MSTORE PUSH1 0x20 ADD PUSH2 0x129C DUP10 DUP10 PUSH2 0x2160 JUMP JUMPDEST PUSH1 0x0 NOT AND DUP2 MSTORE POP SWAP3 POP CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP4 PUSH1 0x0 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x12E3 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP4 PUSH1 0xA0 ADD MLOAD GT DUP1 ISZERO PUSH2 0x12FB JUMPI POP PUSH1 0x0 DUP4 PUSH1 0xC0 ADD MLOAD GT JUMPDEST DUP1 ISZERO PUSH2 0x1307 JUMPI POP PUSH1 0x0 DUP6 GT JUMPDEST ISZERO ISZERO PUSH2 0x1312 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 PUSH2 0x120 ADD MLOAD TIMESTAMP LT ISZERO ISZERO PUSH2 0x136F JUMPI DUP3 PUSH2 0x140 ADD MLOAD PUSH1 0x0 NOT AND PUSH1 0x0 PUSH1 0x3 DUP2 GT ISZERO PUSH2 0x1337 JUMPI INVALID JUMPDEST PUSH1 0xFF AND PUSH32 0x36D86C59E00BD73DC19BA3ADFE068E4B64AC7E92BE35546ADEDDF1B956A87E90 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x0 SWAP4 POP PUSH2 0x15EE JUMP JUMPDEST PUSH2 0x138A DUP4 PUSH1 0xC0 ADD MLOAD PUSH2 0x1385 DUP6 PUSH2 0x140 ADD MLOAD PUSH2 0x16FF JUMP JUMPDEST PUSH2 0x2498 JUMP JUMPDEST SWAP2 POP PUSH2 0x1396 DUP6 DUP4 PUSH2 0x24CF JUMP JUMPDEST SWAP1 POP PUSH1 0x0 DUP2 EQ ISZERO PUSH2 0x13F0 JUMPI DUP3 PUSH2 0x140 ADD MLOAD PUSH1 0x0 NOT AND PUSH1 0x1 PUSH1 0x3 DUP2 GT ISZERO PUSH2 0x13B8 JUMPI INVALID JUMPDEST PUSH1 0xFF AND PUSH32 0x36D86C59E00BD73DC19BA3ADFE068E4B64AC7E92BE35546ADEDDF1B956A87E90 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x0 SWAP4 POP PUSH2 0x15EE JUMP JUMPDEST PUSH2 0x141A PUSH1 0x3 PUSH1 0x0 DUP6 PUSH2 0x140 ADD MLOAD PUSH1 0x0 NOT AND PUSH1 0x0 NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD DUP3 PUSH2 0x24B1 JUMP JUMPDEST PUSH1 0x3 PUSH1 0x0 DUP6 PUSH2 0x140 ADD MLOAD PUSH1 0x0 NOT AND PUSH1 0x0 NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP DUP3 PUSH1 0x40 ADD MLOAD DUP4 PUSH1 0x60 ADD MLOAD PUSH1 0x40 MLOAD DUP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH13 0x1000000000000000000000000 MUL DUP2 MSTORE PUSH1 0x14 ADD DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH13 0x1000000000000000000000000 MUL DUP2 MSTORE PUSH1 0x14 ADD SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 KECCAK256 PUSH1 0x0 NOT AND DUP4 PUSH1 0x80 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP5 PUSH1 0x0 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x67D66F160BC93D925D05DAE1794C90D2D6D6688B29B84FF069398A9B04587131 DUP7 PUSH1 0x40 ADD MLOAD DUP8 PUSH1 0x60 ADD MLOAD PUSH2 0x1552 DUP8 DUP11 PUSH1 0xC0 ADD MLOAD DUP12 PUSH1 0xA0 ADD MLOAD PUSH2 0x1849 JUMP JUMPDEST DUP8 DUP11 PUSH2 0x140 ADD MLOAD PUSH1 0x40 MLOAD DUP1 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP5 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP2 MSTORE PUSH1 0x20 ADD DUP3 PUSH1 0x0 NOT AND PUSH1 0x0 NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP6 POP POP POP POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG4 DUP1 SWAP4 POP JUMPDEST POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 SWAP1 POP JUMPDEST DUP7 MLOAD DUP2 LT ISZERO PUSH2 0x16D1 JUMPI PUSH2 0x16C4 DUP8 DUP3 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x163D JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP8 DUP4 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1655 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP8 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x166D JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP8 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1685 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP8 DUP7 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x169D JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP8 DUP8 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x16B5 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x16DA JUMP JUMPDEST DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0x1623 JUMP JUMPDEST POP POP POP POP POP POP POP JUMP JUMPDEST DUP4 PUSH2 0x16EB DUP8 DUP8 DUP8 PUSH1 0x0 DUP9 DUP9 DUP9 PUSH2 0x19C0 JUMP JUMPDEST EQ ISZERO ISZERO PUSH2 0x16F7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x1741 PUSH1 0x2 PUSH1 0x0 DUP5 PUSH1 0x0 NOT AND PUSH1 0x0 NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD PUSH1 0x3 PUSH1 0x0 DUP6 PUSH1 0x0 NOT AND PUSH1 0x0 NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD PUSH2 0x24B1 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1 DUP6 PUSH1 0x40 MLOAD DUP1 DUP1 PUSH32 0x19457468657265756D205369676E6564204D6573736167653A0A333200000000 DUP2 MSTORE POP PUSH1 0x1C ADD DUP3 PUSH1 0x0 NOT AND PUSH1 0x0 NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 KECCAK256 DUP6 DUP6 DUP6 PUSH1 0x40 MLOAD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MSTORE PUSH1 0x40 MLOAD DUP1 DUP6 PUSH1 0x0 NOT AND PUSH1 0x0 NOT AND DUP2 MSTORE PUSH1 0x20 ADD DUP5 PUSH1 0xFF AND PUSH1 0xFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP4 PUSH1 0x0 NOT AND PUSH1 0x0 NOT AND DUP2 MSTORE PUSH1 0x20 ADD DUP3 PUSH1 0x0 NOT AND PUSH1 0x0 NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP5 POP POP POP POP POP PUSH1 0x20 PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 SUB SWAP1 DUP1 DUP5 SUB SWAP1 PUSH1 0x0 DUP7 GAS CALL ISZERO DUP1 ISZERO PUSH2 0x1806 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP PUSH1 0x20 PUSH1 0x40 MLOAD SUB MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ SWAP1 POP SWAP6 SWAP5 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x185E PUSH2 0x1858 DUP6 DUP5 PUSH2 0x244A JUMP JUMPDEST DUP5 PUSH2 0x247D JUMP JUMPDEST SWAP1 POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 SWAP1 POP JUMPDEST DUP8 MLOAD DUP2 LT ISZERO PUSH2 0x1943 JUMPI PUSH2 0x1935 DUP9 DUP3 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x18AD JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP9 DUP4 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x18C5 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP9 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x18DD JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP9 DUP9 DUP7 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x18F6 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP9 DUP8 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x190E JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP9 DUP9 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1926 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x19C0 JUMP JUMPDEST POP DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0x1893 JUMP JUMPDEST POP POP POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 SWAP1 POP JUMPDEST DUP4 MLOAD DUP2 LT ISZERO PUSH2 0x19BA JUMPI PUSH2 0x19AC DUP5 DUP3 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x196D JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP5 DUP4 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1985 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP5 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x199D JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x1110 JUMP JUMPDEST POP DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0x1953 JUMP JUMPDEST POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x19CA PUSH2 0x2BD2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH2 0x160 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 DUP15 PUSH1 0x0 PUSH1 0x5 DUP2 LT ISZERO ISZERO PUSH2 0x19EC JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP15 PUSH1 0x1 PUSH1 0x5 DUP2 LT ISZERO ISZERO PUSH2 0x1A1B JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP15 PUSH1 0x2 PUSH1 0x5 DUP2 LT ISZERO ISZERO PUSH2 0x1A4A JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP15 PUSH1 0x3 PUSH1 0x5 DUP2 LT ISZERO ISZERO PUSH2 0x1A79 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP15 PUSH1 0x4 PUSH1 0x5 DUP2 LT ISZERO ISZERO PUSH2 0x1AA8 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP14 PUSH1 0x0 PUSH1 0x6 DUP2 LT ISZERO ISZERO PUSH2 0x1AD7 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD DUP2 MSTORE PUSH1 0x20 ADD DUP14 PUSH1 0x1 PUSH1 0x6 DUP2 LT ISZERO ISZERO PUSH2 0x1AF0 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD DUP2 MSTORE PUSH1 0x20 ADD DUP14 PUSH1 0x2 PUSH1 0x6 DUP2 LT ISZERO ISZERO PUSH2 0x1B09 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD DUP2 MSTORE PUSH1 0x20 ADD DUP14 PUSH1 0x3 PUSH1 0x6 DUP2 LT ISZERO ISZERO PUSH2 0x1B22 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD DUP2 MSTORE PUSH1 0x20 ADD DUP14 PUSH1 0x4 PUSH1 0x6 DUP2 LT ISZERO ISZERO PUSH2 0x1B3B JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD DUP2 MSTORE PUSH1 0x20 ADD PUSH2 0x1B4F DUP16 DUP16 PUSH2 0x2160 JUMP JUMPDEST PUSH1 0x0 NOT AND DUP2 MSTORE POP SWAP5 POP PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP6 PUSH1 0x20 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ DUP1 PUSH2 0x1BC6 JUMPI POP CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP6 PUSH1 0x20 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ JUMPDEST ISZERO ISZERO PUSH2 0x1BD1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP6 PUSH1 0xA0 ADD MLOAD GT DUP1 ISZERO PUSH2 0x1BE9 JUMPI POP PUSH1 0x0 DUP6 PUSH1 0xC0 ADD MLOAD GT JUMPDEST DUP1 ISZERO PUSH2 0x1BF5 JUMPI POP PUSH1 0x0 DUP12 GT JUMPDEST ISZERO ISZERO PUSH2 0x1C00 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1C16 DUP6 PUSH1 0x0 ADD MLOAD DUP7 PUSH2 0x140 ADD MLOAD DUP12 DUP12 DUP12 PUSH2 0x1748 JUMP JUMPDEST ISZERO ISZERO PUSH2 0x1C21 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP5 PUSH2 0x120 ADD MLOAD TIMESTAMP LT ISZERO ISZERO PUSH2 0x1C7E JUMPI DUP5 PUSH2 0x140 ADD MLOAD PUSH1 0x0 NOT AND PUSH1 0x0 PUSH1 0x3 DUP2 GT ISZERO PUSH2 0x1C46 JUMPI INVALID JUMPDEST PUSH1 0xFF AND PUSH32 0x36D86C59E00BD73DC19BA3ADFE068E4B64AC7E92BE35546ADEDDF1B956A87E90 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x0 SWAP6 POP PUSH2 0x2150 JUMP JUMPDEST PUSH2 0x1C99 DUP6 PUSH1 0xC0 ADD MLOAD PUSH2 0x1C94 DUP8 PUSH2 0x140 ADD MLOAD PUSH2 0x16FF JUMP JUMPDEST PUSH2 0x2498 JUMP JUMPDEST SWAP4 POP PUSH2 0x1CA5 DUP12 DUP6 PUSH2 0x24CF JUMP JUMPDEST SWAP6 POP PUSH1 0x0 DUP7 EQ ISZERO PUSH2 0x1CFF JUMPI DUP5 PUSH2 0x140 ADD MLOAD PUSH1 0x0 NOT AND PUSH1 0x1 PUSH1 0x3 DUP2 GT ISZERO PUSH2 0x1CC7 JUMPI INVALID JUMPDEST PUSH1 0xFF AND PUSH32 0x36D86C59E00BD73DC19BA3ADFE068E4B64AC7E92BE35546ADEDDF1B956A87E90 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x0 SWAP6 POP PUSH2 0x2150 JUMP JUMPDEST PUSH2 0x1D12 DUP7 DUP7 PUSH1 0xC0 ADD MLOAD DUP8 PUSH1 0xA0 ADD MLOAD PUSH2 0xF23 JUMP JUMPDEST ISZERO PUSH2 0x1D66 JUMPI DUP5 PUSH2 0x140 ADD MLOAD PUSH1 0x0 NOT AND PUSH1 0x2 PUSH1 0x3 DUP2 GT ISZERO PUSH2 0x1D2E JUMPI INVALID JUMPDEST PUSH1 0xFF AND PUSH32 0x36D86C59E00BD73DC19BA3ADFE068E4B64AC7E92BE35546ADEDDF1B956A87E90 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x0 SWAP6 POP PUSH2 0x2150 JUMP JUMPDEST DUP10 ISZERO DUP1 ISZERO PUSH2 0x1D7B JUMPI POP PUSH2 0x1D79 DUP6 DUP8 PUSH2 0x24E8 JUMP JUMPDEST ISZERO JUMPDEST ISZERO PUSH2 0x1DCE JUMPI DUP5 PUSH2 0x140 ADD MLOAD PUSH1 0x0 NOT AND PUSH1 0x3 DUP1 DUP2 GT ISZERO PUSH2 0x1D96 JUMPI INVALID JUMPDEST PUSH1 0xFF AND PUSH32 0x36D86C59E00BD73DC19BA3ADFE068E4B64AC7E92BE35546ADEDDF1B956A87E90 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x0 SWAP6 POP PUSH2 0x2150 JUMP JUMPDEST PUSH2 0x1DE1 DUP7 DUP7 PUSH1 0xC0 ADD MLOAD DUP8 PUSH1 0xA0 ADD MLOAD PUSH2 0x1849 JUMP JUMPDEST SWAP3 POP PUSH2 0x1E0D PUSH1 0x2 PUSH1 0x0 DUP8 PUSH2 0x140 ADD MLOAD PUSH1 0x0 NOT AND PUSH1 0x0 NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD DUP8 PUSH2 0x24B1 JUMP JUMPDEST PUSH1 0x2 PUSH1 0x0 DUP8 PUSH2 0x140 ADD MLOAD PUSH1 0x0 NOT AND PUSH1 0x0 NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP PUSH2 0x1E45 DUP6 PUSH1 0x40 ADD MLOAD DUP7 PUSH1 0x0 ADD MLOAD CALLER DUP7 PUSH2 0x2838 JUMP JUMPDEST ISZERO ISZERO PUSH2 0x1E50 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1E64 DUP6 PUSH1 0x60 ADD MLOAD CALLER DUP8 PUSH1 0x0 ADD MLOAD DUP10 PUSH2 0x2838 JUMP JUMPDEST ISZERO ISZERO PUSH2 0x1E6F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP6 PUSH1 0x80 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x1F6E JUMPI PUSH1 0x0 DUP6 PUSH1 0xE0 ADD MLOAD GT ISZERO PUSH2 0x1F0C JUMPI PUSH2 0x1EC9 DUP7 DUP7 PUSH1 0xC0 ADD MLOAD DUP8 PUSH1 0xE0 ADD MLOAD PUSH2 0x1849 JUMP JUMPDEST SWAP2 POP PUSH2 0x1F00 PUSH1 0x0 DUP1 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP7 PUSH1 0x0 ADD MLOAD DUP8 PUSH1 0x80 ADD MLOAD DUP6 PUSH2 0x2838 JUMP JUMPDEST ISZERO ISZERO PUSH2 0x1F0B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST JUMPDEST PUSH1 0x0 DUP6 PUSH2 0x100 ADD MLOAD GT ISZERO PUSH2 0x1F6D JUMPI PUSH2 0x1F2E DUP7 DUP7 PUSH1 0xC0 ADD MLOAD DUP8 PUSH2 0x100 ADD MLOAD PUSH2 0x1849 JUMP JUMPDEST SWAP1 POP PUSH2 0x1F61 PUSH1 0x0 DUP1 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER DUP8 PUSH1 0x80 ADD MLOAD DUP5 PUSH2 0x2838 JUMP JUMPDEST ISZERO ISZERO PUSH2 0x1F6C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST JUMPDEST JUMPDEST DUP5 PUSH1 0x40 ADD MLOAD DUP6 PUSH1 0x60 ADD MLOAD PUSH1 0x40 MLOAD DUP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH13 0x1000000000000000000000000 MUL DUP2 MSTORE PUSH1 0x14 ADD DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH13 0x1000000000000000000000000 MUL DUP2 MSTORE PUSH1 0x14 ADD SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 KECCAK256 PUSH1 0x0 NOT AND DUP6 PUSH1 0x80 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP7 PUSH1 0x0 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xD0B9391970D9A25552F37D436D2AAE2925E2BFE1B2A923754BADA030C498CB3 CALLER DUP10 PUSH1 0x40 ADD MLOAD DUP11 PUSH1 0x60 ADD MLOAD DUP10 DUP14 DUP11 DUP11 DUP16 PUSH2 0x140 ADD MLOAD PUSH1 0x40 MLOAD DUP1 DUP10 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP9 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP7 DUP2 MSTORE PUSH1 0x20 ADD DUP6 DUP2 MSTORE PUSH1 0x20 ADD DUP5 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP2 MSTORE PUSH1 0x20 ADD DUP3 PUSH1 0x0 NOT AND PUSH1 0x0 NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP9 POP POP POP POP POP POP POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG4 DUP6 SWAP6 POP JUMPDEST POP POP POP POP POP SWAP8 SWAP7 POP POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 ADDRESS DUP4 PUSH1 0x0 PUSH1 0x5 DUP2 LT ISZERO ISZERO PUSH2 0x2172 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD DUP5 PUSH1 0x1 PUSH1 0x5 DUP2 LT ISZERO ISZERO PUSH2 0x2186 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD DUP6 PUSH1 0x2 PUSH1 0x5 DUP2 LT ISZERO ISZERO PUSH2 0x219A JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD DUP7 PUSH1 0x3 PUSH1 0x5 DUP2 LT ISZERO ISZERO PUSH2 0x21AE JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD DUP8 PUSH1 0x4 PUSH1 0x5 DUP2 LT ISZERO ISZERO PUSH2 0x21C2 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD DUP8 PUSH1 0x0 PUSH1 0x6 DUP2 LT ISZERO ISZERO PUSH2 0x21D6 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD DUP9 PUSH1 0x1 PUSH1 0x6 DUP2 LT ISZERO ISZERO PUSH2 0x21EA JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD DUP10 PUSH1 0x2 PUSH1 0x6 DUP2 LT ISZERO ISZERO PUSH2 0x21FE JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD DUP11 PUSH1 0x3 PUSH1 0x6 DUP2 LT ISZERO ISZERO PUSH2 0x2212 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD DUP12 PUSH1 0x4 PUSH1 0x6 DUP2 LT ISZERO ISZERO PUSH2 0x2226 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD DUP13 PUSH1 0x5 PUSH1 0x6 DUP2 LT ISZERO ISZERO PUSH2 0x223A JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD PUSH1 0x40 MLOAD DUP1 DUP14 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH13 0x1000000000000000000000000 MUL DUP2 MSTORE PUSH1 0x14 ADD DUP13 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH13 0x1000000000000000000000000 MUL DUP2 MSTORE PUSH1 0x14 ADD DUP12 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH13 0x1000000000000000000000000 MUL DUP2 MSTORE PUSH1 0x14 ADD DUP11 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH13 0x1000000000000000000000000 MUL DUP2 MSTORE PUSH1 0x14 ADD DUP10 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH13 0x1000000000000000000000000 MUL DUP2 MSTORE PUSH1 0x14 ADD DUP9 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH13 0x1000000000000000000000000 MUL DUP2 MSTORE PUSH1 0x14 ADD DUP8 DUP2 MSTORE PUSH1 0x20 ADD DUP7 DUP2 MSTORE PUSH1 0x20 ADD DUP6 DUP2 MSTORE PUSH1 0x20 ADD DUP5 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP13 POP POP POP POP POP POP POP POP POP POP POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 KECCAK256 SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x1387 DUP2 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x5 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x312E302E30000000000000000000000000000000000000000000000000000000 DUP2 MSTORE POP DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 DUP3 DUP5 MUL SWAP1 POP PUSH1 0x0 DUP5 EQ DUP1 PUSH2 0x246B JUMPI POP DUP3 DUP5 DUP3 DUP2 ISZERO ISZERO PUSH2 0x2468 JUMPI INVALID JUMPDEST DIV EQ JUMPDEST ISZERO ISZERO PUSH2 0x2473 JUMPI INVALID JUMPDEST DUP1 SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP3 DUP5 DUP2 ISZERO ISZERO PUSH2 0x248B JUMPI INVALID JUMPDEST DIV SWAP1 POP DUP1 SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 GT ISZERO ISZERO ISZERO PUSH2 0x24A6 JUMPI INVALID JUMPDEST DUP2 DUP4 SUB SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP3 DUP5 ADD SWAP1 POP DUP4 DUP2 LT ISZERO ISZERO ISZERO PUSH2 0x24C5 JUMPI INVALID JUMPDEST DUP1 SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 DUP4 LT PUSH2 0x24DE JUMPI DUP2 PUSH2 0x24E0 JUMP JUMPDEST DUP3 JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 CALLER SWAP8 POP PUSH2 0x250C DUP11 DUP13 PUSH1 0xC0 ADD MLOAD DUP14 PUSH1 0xA0 ADD MLOAD PUSH2 0x1849 JUMP JUMPDEST SWAP7 POP PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP12 PUSH1 0x80 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x27B9 JUMPI PUSH1 0x0 DUP1 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP12 PUSH1 0x40 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ SWAP6 POP PUSH1 0x0 DUP1 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP12 PUSH1 0x60 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ SWAP5 POP PUSH2 0x2607 DUP11 DUP13 PUSH1 0xC0 ADD MLOAD DUP14 PUSH1 0xE0 ADD MLOAD PUSH2 0x1849 JUMP JUMPDEST SWAP4 POP PUSH2 0x261D DUP11 DUP13 PUSH1 0xC0 ADD MLOAD DUP14 PUSH2 0x100 ADD MLOAD PUSH2 0x1849 JUMP JUMPDEST SWAP3 POP DUP6 PUSH2 0x262A JUMPI DUP4 PUSH2 0x2635 JUMP JUMPDEST PUSH2 0x2634 DUP8 DUP6 PUSH2 0x24B1 JUMP JUMPDEST JUMPDEST SWAP2 POP DUP5 PUSH2 0x2642 JUMPI DUP3 PUSH2 0x264D JUMP JUMPDEST PUSH2 0x264C DUP11 DUP5 PUSH2 0x24B1 JUMP JUMPDEST JUMPDEST SWAP1 POP DUP2 PUSH2 0x267F PUSH1 0x0 DUP1 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP14 PUSH1 0x0 ADD MLOAD PUSH2 0x29AC JUMP JUMPDEST LT DUP1 PUSH2 0x26B8 JUMPI POP DUP2 PUSH2 0x26B6 PUSH1 0x0 DUP1 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP14 PUSH1 0x0 ADD MLOAD PUSH2 0x2A94 JUMP JUMPDEST LT JUMPDEST DUP1 PUSH2 0x26EC JUMPI POP DUP1 PUSH2 0x26EA PUSH1 0x0 DUP1 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP11 PUSH2 0x29AC JUMP JUMPDEST LT JUMPDEST DUP1 PUSH2 0x2720 JUMPI POP DUP1 PUSH2 0x271E PUSH1 0x0 DUP1 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP11 PUSH2 0x2A94 JUMP JUMPDEST LT JUMPDEST ISZERO PUSH2 0x272E JUMPI PUSH1 0x0 SWAP9 POP PUSH2 0x282A JUMP JUMPDEST DUP6 ISZERO DUP1 ISZERO PUSH2 0x2767 JUMPI POP DUP7 PUSH2 0x274A DUP13 PUSH1 0x40 ADD MLOAD DUP14 PUSH1 0x0 ADD MLOAD PUSH2 0x29AC JUMP JUMPDEST LT DUP1 PUSH2 0x2766 JUMPI POP DUP7 PUSH2 0x2764 DUP13 PUSH1 0x40 ADD MLOAD DUP14 PUSH1 0x0 ADD MLOAD PUSH2 0x2A94 JUMP JUMPDEST LT JUMPDEST JUMPDEST ISZERO PUSH2 0x2775 JUMPI PUSH1 0x0 SWAP9 POP PUSH2 0x282A JUMP JUMPDEST DUP5 ISZERO DUP1 ISZERO PUSH2 0x27A6 JUMPI POP DUP10 PUSH2 0x278D DUP13 PUSH1 0x60 ADD MLOAD DUP11 PUSH2 0x29AC JUMP JUMPDEST LT DUP1 PUSH2 0x27A5 JUMPI POP DUP10 PUSH2 0x27A3 DUP13 PUSH1 0x60 ADD MLOAD DUP11 PUSH2 0x2A94 JUMP JUMPDEST LT JUMPDEST JUMPDEST ISZERO PUSH2 0x27B4 JUMPI PUSH1 0x0 SWAP9 POP PUSH2 0x282A JUMP JUMPDEST PUSH2 0x2825 JUMP JUMPDEST DUP7 PUSH2 0x27CC DUP13 PUSH1 0x40 ADD MLOAD DUP14 PUSH1 0x0 ADD MLOAD PUSH2 0x29AC JUMP JUMPDEST LT DUP1 PUSH2 0x27E8 JUMPI POP DUP7 PUSH2 0x27E6 DUP13 PUSH1 0x40 ADD MLOAD DUP14 PUSH1 0x0 ADD MLOAD PUSH2 0x2A94 JUMP JUMPDEST LT JUMPDEST DUP1 PUSH2 0x27FF JUMPI POP DUP10 PUSH2 0x27FD DUP13 PUSH1 0x60 ADD MLOAD DUP11 PUSH2 0x29AC JUMP JUMPDEST LT JUMPDEST DUP1 PUSH2 0x2816 JUMPI POP DUP10 PUSH2 0x2814 DUP13 PUSH1 0x60 ADD MLOAD DUP11 PUSH2 0x2A94 JUMP JUMPDEST LT JUMPDEST ISZERO PUSH2 0x2824 JUMPI PUSH1 0x0 SWAP9 POP PUSH2 0x282A JUMP JUMPDEST JUMPDEST PUSH1 0x1 SWAP9 POP JUMPDEST POP POP POP POP POP POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0x15DACBEA DUP7 DUP7 DUP7 DUP7 PUSH1 0x40 MLOAD DUP6 PUSH4 0xFFFFFFFF AND PUSH29 0x100000000000000000000000000000000000000000000000000000000 MUL DUP2 MSTORE PUSH1 0x4 ADD DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP5 POP POP POP POP POP PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x2967 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x297B JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x20 DUP2 LT ISZERO PUSH2 0x2991 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 ADD SWAP1 DUP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP SWAP1 POP SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0x70A08231 PUSH2 0x1387 PUSH2 0xFFFF AND DUP5 PUSH1 0x40 MLOAD DUP4 PUSH4 0xFFFFFFFF AND PUSH29 0x100000000000000000000000000000000000000000000000000000000 MUL DUP2 MSTORE PUSH1 0x4 ADD DUP1 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP9 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x2A50 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP DUP8 CALL ISZERO DUP1 ISZERO PUSH2 0x2A64 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x20 DUP2 LT ISZERO PUSH2 0x2A7B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 ADD SWAP1 DUP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0xDD62ED3E PUSH2 0x1387 PUSH2 0xFFFF AND DUP5 PUSH1 0x1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x40 MLOAD DUP5 PUSH4 0xFFFFFFFF AND PUSH29 0x100000000000000000000000000000000000000000000000000000000 MUL DUP2 MSTORE PUSH1 0x4 ADD DUP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP3 POP POP POP PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP9 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x2B8E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP DUP8 CALL ISZERO DUP1 ISZERO PUSH2 0x2BA2 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x20 DUP2 LT ISZERO PUSH2 0x2BB9 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 ADD SWAP1 DUP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x160 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP1 NOT AND DUP2 MSTORE POP SWAP1 JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 RETURNDATASIZE 0x2a SLOAD DUP6 0xda PUSH21 0x4CCE47CF20CB3E00D3A32409B46698BFB0EA75BAB6 0x1e DUP6 PUSH29 0x1416002900000000000000000000000000000000000000000000000000 ",
- "sourceMap": "993:22781:0:-;;;2960:177;8:9:-1;5:2;;;30:1;27;20:12;5:2;2960:177:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3060:9;3039:18;;:30;;;;;;;;;;;;;;;;;;3111:19;3079:29;;:51;;;;;;;;;;;;;;;;;;2960:177;;993:22781;;;;;;"
- },
- "deployedBytecode": {
- "linkReferences": {},
- "object": "0x6080604052600436106100fc576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806314df96ee14610101578063288cdc911461015a5780632ac126221461019f578063363349be146101e4578063394c21e7146103f85780633b30ba59146104975780634f150787146104ee578063741bcc931461071b5780637e9abb50146107cf5780638163681e1461081457806398024a8b146108a6578063add1cbc5146108fb578063b7b2c7d614610952578063baa0181d14610b8b578063bc61394a14610cef578063cfc4d0ec14610dc3578063f06bbf7514610e60578063ffa1ad7414610e93575b600080fd5b34801561010d57600080fd5b50610140600480360381019080803590602001909291908035906020019092919080359060200190929190505050610f23565b604051808215151515815260200191505060405180910390f35b34801561016657600080fd5b506101896004803603810190808035600019169060200190929190505050610f7b565b6040518082815260200191505060405180910390f35b3480156101ab57600080fd5b506101ce6004803603810190808035600019169060200190929190505050610f93565b6040518082815260200191505060405180910390f35b3480156101f057600080fd5b506103e260048036038101908080359060200190820180359060200190808060200260200160405190810160405280939291908181526020016000905b8282101561027257848483905060a00201600580602002604051908101604052809291908260056020028082843782019150505050508152602001906001019061022d565b5050505050919291929080359060200190820180359060200190808060200260200160405190810160405280939291908181526020016000905b828210156102f157848483905060c0020160068060200260405190810160405280929190826006602002808284378201915050505050815260200190600101906102ac565b5050505050919291929080359060200190929190803515159060200190929190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091929192908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290505050610fab565b6040518082815260200191505060405180910390f35b34801561040457600080fd5b506104816004803603810190808060a001906005806020026040519081016040528092919082600560200280828437820191505050505091929192908060c0019060068060200260405190810160405280929190826006602002808284378201915050505050919291929080359060200190929190505050611110565b6040518082815260200191505060405180910390f35b3480156104a357600080fd5b506104ac6115f8565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104fa57600080fd5b5061071960048036038101908080359060200190820180359060200190808060200260200160405190810160405280939291908181526020016000905b8282101561057c57848483905060a002016005806020026040519081016040528092919082600560200280828437820191505050505081526020019060010190610537565b5050505050919291929080359060200190820180359060200190808060200260200160405190810160405280939291908181526020016000905b828210156105fb57848483905060c0020160068060200260405190810160405280929190826006602002808284378201915050505050815260200190600101906105b6565b505050505091929192908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091929192908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929050505061161d565b005b34801561072757600080fd5b506107cd6004803603810190808060a001906005806020026040519081016040528092919082600560200280828437820191505050505091929192908060c0019060068060200260405190810160405280929190826006602002808284378201915050505050919291929080359060200190929190803560ff169060200190929190803560001916906020019092919080356000191690602001909291905050506116da565b005b3480156107db57600080fd5b506107fe60048036038101908080356000191690602001909291905050506116ff565b6040518082815260200191505060405180910390f35b34801561082057600080fd5b5061088c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035600019169060200190929190803560ff16906020019092919080356000191690602001909291908035600019169060200190929190505050611748565b604051808215151515815260200191505060405180910390f35b3480156108b257600080fd5b506108e5600480360381019080803590602001909291908035906020019092919080359060200190929190505050611849565b6040518082815260200191505060405180910390f35b34801561090757600080fd5b50610910611867565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561095e57600080fd5b50610b8960048036038101908080359060200190820180359060200190808060200260200160405190810160405280939291908181526020016000905b828210156109e057848483905060a00201600580602002604051908101604052809291908260056020028082843782019150505050508152602001906001019061099b565b5050505050919291929080359060200190820180359060200190808060200260200160405190810160405280939291908181526020016000905b82821015610a5f57848483905060c002016006806020026040519081016040528092919082600660200280828437820191505050505081526020019060010190610a1a565b505050505091929192908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929080351515906020019092919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091929192908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929050505061188d565b005b348015610b9757600080fd5b50610ced60048036038101908080359060200190820180359060200190808060200260200160405190810160405280939291908181526020016000905b82821015610c1957848483905060a002016005806020026040519081016040528092919082600560200280828437820191505050505081526020019060010190610bd4565b5050505050919291929080359060200190820180359060200190808060200260200160405190810160405280939291908181526020016000905b82821015610c9857848483905060c002016006806020026040519081016040528092919082600660200280828437820191505050505081526020019060010190610c53565b505050505091929192908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929050505061194d565b005b348015610cfb57600080fd5b50610dad6004803603810190808060a001906005806020026040519081016040528092919082600560200280828437820191505050505091929192908060c0019060068060200260405190810160405280929190826006602002808284378201915050505050919291929080359060200190929190803515159060200190929190803560ff169060200190929190803560001916906020019092919080356000191690602001909291905050506119c0565b6040518082815260200191505060405180910390f35b348015610dcf57600080fd5b50610e426004803603810190808060a001906005806020026040519081016040528092919082600560200280828437820191505050505091929192908060c00190600680602002604051908101604052809291908260066020028082843782019150505050509192919290505050612160565b60405180826000191660001916815260200191505060405180910390f35b348015610e6c57600080fd5b50610e7561240b565b604051808261ffff1661ffff16815260200191505060405180910390f35b348015610e9f57600080fd5b50610ea8612411565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610ee8578082015181840152602081019050610ecd565b50505050905090810190601f168015610f155780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b600080600084801515610f3257fe5b86850991506000821415610f495760009250610f72565b610f68610f5983620f424061244a565b610f63888761244a565b61247d565b90506103e8811192505b50509392505050565b60026020528060005260406000206000915090505481565b60036020528060005260406000206000915090505481565b6000806000809150600090505b895181101561110057896000815181101515610fd057fe5b906020019060200201516003600581101515610fe857fe5b602002015173ffffffffffffffffffffffffffffffffffffffff168a8281518110151561101157fe5b90602001906020020151600360058110151561102957fe5b602002015173ffffffffffffffffffffffffffffffffffffffff1614151561105057600080fd5b6110e4826110df8c8481518110151561106557fe5b906020019060200201518c8581518110151561107d57fe5b906020019060200201516110918d88612498565b8c8c888151811015156110a057fe5b906020019060200201518c898151811015156110b857fe5b906020019060200201518c8a8151811015156110d057fe5b906020019060200201516119c0565b6124b1565b9150878214156110f357611100565b8080600101915050610fb8565b8192505050979650505050505050565b600061111a612bd2565b6000806101606040519081016040528088600060058110151561113957fe5b602002015173ffffffffffffffffffffffffffffffffffffffff16815260200188600160058110151561116857fe5b602002015173ffffffffffffffffffffffffffffffffffffffff16815260200188600260058110151561119757fe5b602002015173ffffffffffffffffffffffffffffffffffffffff1681526020018860036005811015156111c657fe5b602002015173ffffffffffffffffffffffffffffffffffffffff1681526020018860046005811015156111f557fe5b602002015173ffffffffffffffffffffffffffffffffffffffff16815260200187600060068110151561122457fe5b6020020151815260200187600160068110151561123d57fe5b6020020151815260200187600260068110151561125657fe5b6020020151815260200187600360068110151561126f57fe5b6020020151815260200187600460068110151561128857fe5b6020020151815260200161129c8989612160565b6000191681525092503373ffffffffffffffffffffffffffffffffffffffff16836000015173ffffffffffffffffffffffffffffffffffffffff161415156112e357600080fd5b60008360a001511180156112fb575060008360c00151115b80156113075750600085115b151561131257600080fd5b8261012001514210151561136f57826101400151600019166000600381111561133757fe5b60ff167f36d86c59e00bd73dc19ba3adfe068e4b64ac7e92be35546adeddf1b956a87e9060405160405180910390a3600093506115ee565b61138a8360c001516113858561014001516116ff565b612498565b915061139685836124cf565b905060008114156113f05782610140015160001916600160038111156113b857fe5b60ff167f36d86c59e00bd73dc19ba3adfe068e4b64ac7e92be35546adeddf1b956a87e9060405160405180910390a3600093506115ee565b61141a600360008561014001516000191660001916815260200190815260200160002054826124b1565b60036000856101400151600019166000191681526020019081526020016000208190555082604001518360600151604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c0100000000000000000000000002815260140192505050604051809103902060001916836080015173ffffffffffffffffffffffffffffffffffffffff16846000015173ffffffffffffffffffffffffffffffffffffffff167f67d66f160bc93d925d05dae1794c90d2d6d6688b29b84ff069398a9b0458713186604001518760600151611552878a60c001518b60a00151611849565b878a6101400151604051808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200183815260200182600019166000191681526020019550505050505060405180910390a48093505b5050509392505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008090505b86518110156116d1576116c4878281518110151561163d57fe5b90602001906020020151878381518110151561165557fe5b90602001906020020151878481518110151561166d57fe5b90602001906020020151878581518110151561168557fe5b90602001906020020151878681518110151561169d57fe5b9060200190602002015187878151811015156116b557fe5b906020019060200201516116da565b8080600101915050611623565b50505050505050565b836116eb87878760008888886119c0565b1415156116f757600080fd5b505050505050565b600061174160026000846000191660001916815260200190815260200160002054600360008560001916600019168152602001908152602001600020546124b1565b9050919050565b600060018560405180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c0182600019166000191681526020019150506040518091039020858585604051600081526020016040526040518085600019166000191681526020018460ff1660ff1681526020018360001916600019168152602001826000191660001916815260200194505050505060206040516020810390808403906000865af1158015611806573d6000803e3d6000fd5b5050506020604051035173ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614905095945050505050565b600061185e611858858461244a565b8461247d565b90509392505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008090505b87518110156119435761193588828151811015156118ad57fe5b9060200190602002015188838151811015156118c557fe5b9060200190602002015188848151811015156118dd57fe5b906020019060200201518888868151811015156118f657fe5b90602001906020020151888781518110151561190e57fe5b90602001906020020151888881518110151561192657fe5b906020019060200201516119c0565b508080600101915050611893565b5050505050505050565b60008090505b83518110156119ba576119ac848281518110151561196d57fe5b90602001906020020151848381518110151561198557fe5b90602001906020020151848481518110151561199d57fe5b90602001906020020151611110565b508080600101915050611953565b50505050565b60006119ca612bd2565b600080600080610160604051908101604052808e60006005811015156119ec57fe5b602002015173ffffffffffffffffffffffffffffffffffffffff1681526020018e6001600581101515611a1b57fe5b602002015173ffffffffffffffffffffffffffffffffffffffff1681526020018e6002600581101515611a4a57fe5b602002015173ffffffffffffffffffffffffffffffffffffffff1681526020018e6003600581101515611a7957fe5b602002015173ffffffffffffffffffffffffffffffffffffffff1681526020018e6004600581101515611aa857fe5b602002015173ffffffffffffffffffffffffffffffffffffffff1681526020018d6000600681101515611ad757fe5b602002015181526020018d6001600681101515611af057fe5b602002015181526020018d6002600681101515611b0957fe5b602002015181526020018d6003600681101515611b2257fe5b602002015181526020018d6004600681101515611b3b57fe5b60200201518152602001611b4f8f8f612160565b600019168152509450600073ffffffffffffffffffffffffffffffffffffffff16856020015173ffffffffffffffffffffffffffffffffffffffff161480611bc657503373ffffffffffffffffffffffffffffffffffffffff16856020015173ffffffffffffffffffffffffffffffffffffffff16145b1515611bd157600080fd5b60008560a00151118015611be9575060008560c00151115b8015611bf5575060008b115b1515611c0057600080fd5b611c1685600001518661014001518b8b8b611748565b1515611c2157600080fd5b84610120015142101515611c7e578461014001516000191660006003811115611c4657fe5b60ff167f36d86c59e00bd73dc19ba3adfe068e4b64ac7e92be35546adeddf1b956a87e9060405160405180910390a360009550612150565b611c998560c00151611c948761014001516116ff565b612498565b9350611ca58b856124cf565b95506000861415611cff578461014001516000191660016003811115611cc757fe5b60ff167f36d86c59e00bd73dc19ba3adfe068e4b64ac7e92be35546adeddf1b956a87e9060405160405180910390a360009550612150565b611d12868660c001518760a00151610f23565b15611d66578461014001516000191660026003811115611d2e57fe5b60ff167f36d86c59e00bd73dc19ba3adfe068e4b64ac7e92be35546adeddf1b956a87e9060405160405180910390a360009550612150565b89158015611d7b5750611d7985876124e8565b155b15611dce5784610140015160001916600380811115611d9657fe5b60ff167f36d86c59e00bd73dc19ba3adfe068e4b64ac7e92be35546adeddf1b956a87e9060405160405180910390a360009550612150565b611de1868660c001518760a00151611849565b9250611e0d600260008761014001516000191660001916815260200190815260200160002054876124b1565b600260008761014001516000191660001916815260200190815260200160002081905550611e45856040015186600001513386612838565b1515611e5057600080fd5b611e64856060015133876000015189612838565b1515611e6f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16856080015173ffffffffffffffffffffffffffffffffffffffff16141515611f6e5760008560e001511115611f0c57611ec9868660c001518760e00151611849565b9150611f006000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff168660000151876080015185612838565b1515611f0b57600080fd5b5b60008561010001511115611f6d57611f2e868660c00151876101000151611849565b9050611f616000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1633876080015184612838565b1515611f6c57600080fd5b5b5b84604001518560600151604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c0100000000000000000000000002815260140192505050604051809103902060001916856080015173ffffffffffffffffffffffffffffffffffffffff16866000015173ffffffffffffffffffffffffffffffffffffffff167f0d0b9391970d9a25552f37d436d2aae2925e2bfe1b2a923754bada030c498cb33389604001518a60600151898d8a8a8f6101400151604051808973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200186815260200185815260200184815260200183815260200182600019166000191681526020019850505050505050505060405180910390a48595505b5050505050979650505050505050565b60003083600060058110151561217257fe5b602002015184600160058110151561218657fe5b602002015185600260058110151561219a57fe5b60200201518660036005811015156121ae57fe5b60200201518760046005811015156121c257fe5b60200201518760006006811015156121d657fe5b60200201518860016006811015156121ea57fe5b60200201518960026006811015156121fe57fe5b60200201518a600360068110151561221257fe5b60200201518b600460068110151561222657fe5b60200201518c600560068110151561223a57fe5b6020020151604051808d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018781526020018681526020018581526020018481526020018381526020018281526020019c505050505050505050505050506040518091039020905092915050565b61138781565b6040805190810160405280600581526020017f312e302e3000000000000000000000000000000000000000000000000000000081525081565b6000808284029050600084148061246b575082848281151561246857fe5b04145b151561247357fe5b8091505092915050565b600080828481151561248b57fe5b0490508091505092915050565b60008282111515156124a657fe5b818303905092915050565b60008082840190508381101515156124c557fe5b8091505092915050565b60008183106124de57816124e0565b825b905092915050565b600080600080600080600080600033975061250c8a8c60c001518d60a00151611849565b9650600073ffffffffffffffffffffffffffffffffffffffff168b6080015173ffffffffffffffffffffffffffffffffffffffff161415156127b9576000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168b6040015173ffffffffffffffffffffffffffffffffffffffff161495506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168b6060015173ffffffffffffffffffffffffffffffffffffffff161494506126078a8c60c001518d60e00151611849565b935061261d8a8c60c001518d6101000151611849565b92508561262a5783612635565b61263487856124b1565b5b915084612642578261264d565b61264c8a846124b1565b5b90508161267f6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff168d600001516129ac565b10806126b85750816126b66000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff168d60000151612a94565b105b806126ec5750806126ea6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff168a6129ac565b105b8061272057508061271e6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff168a612a94565b105b1561272e576000985061282a565b8515801561276757508661274a8c604001518d600001516129ac565b10806127665750866127648c604001518d60000151612a94565b105b5b15612775576000985061282a565b841580156127a657508961278d8c606001518a6129ac565b10806127a55750896127a38c606001518a612a94565b105b5b156127b4576000985061282a565b612825565b866127cc8c604001518d600001516129ac565b10806127e85750866127e68c604001518d60000151612a94565b105b806127ff5750896127fd8c606001518a6129ac565b105b806128165750896128148c606001518a612a94565b105b15612824576000985061282a565b5b600198505b505050505050505092915050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166315dacbea868686866040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001945050505050602060405180830381600087803b15801561296757600080fd5b505af115801561297b573d6000803e3d6000fd5b505050506040513d602081101561299157600080fd5b81019080805190602001909291905050509050949350505050565b60008273ffffffffffffffffffffffffffffffffffffffff166370a0823161138761ffff16846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600088803b158015612a5057600080fd5b5087f1158015612a64573d6000803e3d6000fd5b50505050506040513d6020811015612a7b57600080fd5b8101908080519060200190929190505050905092915050565b60008273ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e61138761ffff1684600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600088803b158015612b8e57600080fd5b5087f1158015612ba2573d6000803e3d6000fd5b50505050506040513d6020811015612bb957600080fd5b8101908080519060200190929190505050905092915050565b61016060405190810160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160008152602001600081526020016000815260200160008152602001600081526020016000801916815250905600a165627a7a723058203d2a5485da744cce47cf20cb3e00d3a32409b46698bfb0ea75bab61e857c14160029",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0xFC JUMPI PUSH1 0x0 CALLDATALOAD PUSH29 0x100000000000000000000000000000000000000000000000000000000 SWAP1 DIV PUSH4 0xFFFFFFFF AND DUP1 PUSH4 0x14DF96EE EQ PUSH2 0x101 JUMPI DUP1 PUSH4 0x288CDC91 EQ PUSH2 0x15A JUMPI DUP1 PUSH4 0x2AC12622 EQ PUSH2 0x19F JUMPI DUP1 PUSH4 0x363349BE EQ PUSH2 0x1E4 JUMPI DUP1 PUSH4 0x394C21E7 EQ PUSH2 0x3F8 JUMPI DUP1 PUSH4 0x3B30BA59 EQ PUSH2 0x497 JUMPI DUP1 PUSH4 0x4F150787 EQ PUSH2 0x4EE JUMPI DUP1 PUSH4 0x741BCC93 EQ PUSH2 0x71B JUMPI DUP1 PUSH4 0x7E9ABB50 EQ PUSH2 0x7CF JUMPI DUP1 PUSH4 0x8163681E EQ PUSH2 0x814 JUMPI DUP1 PUSH4 0x98024A8B EQ PUSH2 0x8A6 JUMPI DUP1 PUSH4 0xADD1CBC5 EQ PUSH2 0x8FB JUMPI DUP1 PUSH4 0xB7B2C7D6 EQ PUSH2 0x952 JUMPI DUP1 PUSH4 0xBAA0181D EQ PUSH2 0xB8B JUMPI DUP1 PUSH4 0xBC61394A EQ PUSH2 0xCEF JUMPI DUP1 PUSH4 0xCFC4D0EC EQ PUSH2 0xDC3 JUMPI DUP1 PUSH4 0xF06BBF75 EQ PUSH2 0xE60 JUMPI DUP1 PUSH4 0xFFA1AD74 EQ PUSH2 0xE93 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x10D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x140 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xF23 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x166 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x189 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH1 0x0 NOT AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xF7B JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1AB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1CE PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH1 0x0 NOT AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xF93 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1F0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x3E2 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 SWAP1 JUMPDEST DUP3 DUP3 LT ISZERO PUSH2 0x272 JUMPI DUP5 DUP5 DUP4 SWAP1 POP PUSH1 0xA0 MUL ADD PUSH1 0x5 DUP1 PUSH1 0x20 MUL PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP3 PUSH1 0x5 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP DUP2 MSTORE PUSH1 0x20 ADD SWAP1 PUSH1 0x1 ADD SWAP1 PUSH2 0x22D JUMP JUMPDEST POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 SWAP1 JUMPDEST DUP3 DUP3 LT ISZERO PUSH2 0x2F1 JUMPI DUP5 DUP5 DUP4 SWAP1 POP PUSH1 0xC0 MUL ADD PUSH1 0x6 DUP1 PUSH1 0x20 MUL PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP3 PUSH1 0x6 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP DUP2 MSTORE PUSH1 0x20 ADD SWAP1 PUSH1 0x1 ADD SWAP1 PUSH2 0x2AC JUMP JUMPDEST POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD ISZERO ISZERO SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 POP POP POP PUSH2 0xFAB JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x404 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x481 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 PUSH1 0xA0 ADD SWAP1 PUSH1 0x5 DUP1 PUSH1 0x20 MUL PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP3 PUSH1 0x5 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 PUSH1 0xC0 ADD SWAP1 PUSH1 0x6 DUP1 PUSH1 0x20 MUL PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP3 PUSH1 0x6 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1110 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x4A3 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x4AC PUSH2 0x15F8 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x4FA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x719 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 SWAP1 JUMPDEST DUP3 DUP3 LT ISZERO PUSH2 0x57C JUMPI DUP5 DUP5 DUP4 SWAP1 POP PUSH1 0xA0 MUL ADD PUSH1 0x5 DUP1 PUSH1 0x20 MUL PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP3 PUSH1 0x5 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP DUP2 MSTORE PUSH1 0x20 ADD SWAP1 PUSH1 0x1 ADD SWAP1 PUSH2 0x537 JUMP JUMPDEST POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 SWAP1 JUMPDEST DUP3 DUP3 LT ISZERO PUSH2 0x5FB JUMPI DUP5 DUP5 DUP4 SWAP1 POP PUSH1 0xC0 MUL ADD PUSH1 0x6 DUP1 PUSH1 0x20 MUL PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP3 PUSH1 0x6 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP DUP2 MSTORE PUSH1 0x20 ADD SWAP1 PUSH1 0x1 ADD SWAP1 PUSH2 0x5B6 JUMP JUMPDEST POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 POP POP POP PUSH2 0x161D JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x727 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x7CD PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 PUSH1 0xA0 ADD SWAP1 PUSH1 0x5 DUP1 PUSH1 0x20 MUL PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP3 PUSH1 0x5 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 PUSH1 0xC0 ADD SWAP1 PUSH1 0x6 DUP1 PUSH1 0x20 MUL PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP3 PUSH1 0x6 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD PUSH1 0xFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD PUSH1 0x0 NOT AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD PUSH1 0x0 NOT AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x16DA JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x7DB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x7FE PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH1 0x0 NOT AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x16FF JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x820 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x88C PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD PUSH1 0x0 NOT AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD PUSH1 0xFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD PUSH1 0x0 NOT AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD PUSH1 0x0 NOT AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1748 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x8B2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x8E5 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1849 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x907 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x910 PUSH2 0x1867 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x95E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xB89 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 SWAP1 JUMPDEST DUP3 DUP3 LT ISZERO PUSH2 0x9E0 JUMPI DUP5 DUP5 DUP4 SWAP1 POP PUSH1 0xA0 MUL ADD PUSH1 0x5 DUP1 PUSH1 0x20 MUL PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP3 PUSH1 0x5 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP DUP2 MSTORE PUSH1 0x20 ADD SWAP1 PUSH1 0x1 ADD SWAP1 PUSH2 0x99B JUMP JUMPDEST POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 SWAP1 JUMPDEST DUP3 DUP3 LT ISZERO PUSH2 0xA5F JUMPI DUP5 DUP5 DUP4 SWAP1 POP PUSH1 0xC0 MUL ADD PUSH1 0x6 DUP1 PUSH1 0x20 MUL PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP3 PUSH1 0x6 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP DUP2 MSTORE PUSH1 0x20 ADD SWAP1 PUSH1 0x1 ADD SWAP1 PUSH2 0xA1A JUMP JUMPDEST POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD ISZERO ISZERO SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 POP POP POP PUSH2 0x188D JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xB97 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xCED PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 SWAP1 JUMPDEST DUP3 DUP3 LT ISZERO PUSH2 0xC19 JUMPI DUP5 DUP5 DUP4 SWAP1 POP PUSH1 0xA0 MUL ADD PUSH1 0x5 DUP1 PUSH1 0x20 MUL PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP3 PUSH1 0x5 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP DUP2 MSTORE PUSH1 0x20 ADD SWAP1 PUSH1 0x1 ADD SWAP1 PUSH2 0xBD4 JUMP JUMPDEST POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 SWAP1 JUMPDEST DUP3 DUP3 LT ISZERO PUSH2 0xC98 JUMPI DUP5 DUP5 DUP4 SWAP1 POP PUSH1 0xC0 MUL ADD PUSH1 0x6 DUP1 PUSH1 0x20 MUL PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP3 PUSH1 0x6 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP DUP2 MSTORE PUSH1 0x20 ADD SWAP1 PUSH1 0x1 ADD SWAP1 PUSH2 0xC53 JUMP JUMPDEST POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 POP POP POP PUSH2 0x194D JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xCFB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xDAD PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 PUSH1 0xA0 ADD SWAP1 PUSH1 0x5 DUP1 PUSH1 0x20 MUL PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP3 PUSH1 0x5 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 PUSH1 0xC0 ADD SWAP1 PUSH1 0x6 DUP1 PUSH1 0x20 MUL PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP3 PUSH1 0x6 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD ISZERO ISZERO SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD PUSH1 0xFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD PUSH1 0x0 NOT AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD PUSH1 0x0 NOT AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x19C0 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xDCF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xE42 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 PUSH1 0xA0 ADD SWAP1 PUSH1 0x5 DUP1 PUSH1 0x20 MUL PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP3 PUSH1 0x5 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 PUSH1 0xC0 ADD SWAP1 PUSH1 0x6 DUP1 PUSH1 0x20 MUL PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP3 PUSH1 0x6 PUSH1 0x20 MUL DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 POP POP POP PUSH2 0x2160 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 PUSH1 0x0 NOT AND PUSH1 0x0 NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xE6C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xE75 PUSH2 0x240B JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 PUSH2 0xFFFF AND PUSH2 0xFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xE9F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xEA8 PUSH2 0x2411 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE DUP4 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0xEE8 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0xECD JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0xF15 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP5 DUP1 ISZERO ISZERO PUSH2 0xF32 JUMPI INVALID JUMPDEST DUP7 DUP6 MULMOD SWAP2 POP PUSH1 0x0 DUP3 EQ ISZERO PUSH2 0xF49 JUMPI PUSH1 0x0 SWAP3 POP PUSH2 0xF72 JUMP JUMPDEST PUSH2 0xF68 PUSH2 0xF59 DUP4 PUSH3 0xF4240 PUSH2 0x244A JUMP JUMPDEST PUSH2 0xF63 DUP9 DUP8 PUSH2 0x244A JUMP JUMPDEST PUSH2 0x247D JUMP JUMPDEST SWAP1 POP PUSH2 0x3E8 DUP2 GT SWAP3 POP JUMPDEST POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x2 PUSH1 0x20 MSTORE DUP1 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP2 POP SWAP1 POP SLOAD DUP2 JUMP JUMPDEST PUSH1 0x3 PUSH1 0x20 MSTORE DUP1 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP2 POP SWAP1 POP SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 SWAP2 POP PUSH1 0x0 SWAP1 POP JUMPDEST DUP10 MLOAD DUP2 LT ISZERO PUSH2 0x1100 JUMPI DUP10 PUSH1 0x0 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xFD0 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH1 0x3 PUSH1 0x5 DUP2 LT ISZERO ISZERO PUSH2 0xFE8 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP11 DUP3 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1011 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH1 0x3 PUSH1 0x5 DUP2 LT ISZERO ISZERO PUSH2 0x1029 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x1050 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x10E4 DUP3 PUSH2 0x10DF DUP13 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1065 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP13 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x107D JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x1091 DUP14 DUP9 PUSH2 0x2498 JUMP JUMPDEST DUP13 DUP13 DUP9 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x10A0 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP13 DUP10 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x10B8 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP13 DUP11 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x10D0 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x19C0 JUMP JUMPDEST PUSH2 0x24B1 JUMP JUMPDEST SWAP2 POP DUP8 DUP3 EQ ISZERO PUSH2 0x10F3 JUMPI PUSH2 0x1100 JUMP JUMPDEST DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0xFB8 JUMP JUMPDEST DUP2 SWAP3 POP POP POP SWAP8 SWAP7 POP POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x111A PUSH2 0x2BD2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x160 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 DUP9 PUSH1 0x0 PUSH1 0x5 DUP2 LT ISZERO ISZERO PUSH2 0x1139 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP9 PUSH1 0x1 PUSH1 0x5 DUP2 LT ISZERO ISZERO PUSH2 0x1168 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP9 PUSH1 0x2 PUSH1 0x5 DUP2 LT ISZERO ISZERO PUSH2 0x1197 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP9 PUSH1 0x3 PUSH1 0x5 DUP2 LT ISZERO ISZERO PUSH2 0x11C6 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP9 PUSH1 0x4 PUSH1 0x5 DUP2 LT ISZERO ISZERO PUSH2 0x11F5 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP8 PUSH1 0x0 PUSH1 0x6 DUP2 LT ISZERO ISZERO PUSH2 0x1224 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD DUP2 MSTORE PUSH1 0x20 ADD DUP8 PUSH1 0x1 PUSH1 0x6 DUP2 LT ISZERO ISZERO PUSH2 0x123D JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD DUP2 MSTORE PUSH1 0x20 ADD DUP8 PUSH1 0x2 PUSH1 0x6 DUP2 LT ISZERO ISZERO PUSH2 0x1256 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD DUP2 MSTORE PUSH1 0x20 ADD DUP8 PUSH1 0x3 PUSH1 0x6 DUP2 LT ISZERO ISZERO PUSH2 0x126F JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD DUP2 MSTORE PUSH1 0x20 ADD DUP8 PUSH1 0x4 PUSH1 0x6 DUP2 LT ISZERO ISZERO PUSH2 0x1288 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD DUP2 MSTORE PUSH1 0x20 ADD PUSH2 0x129C DUP10 DUP10 PUSH2 0x2160 JUMP JUMPDEST PUSH1 0x0 NOT AND DUP2 MSTORE POP SWAP3 POP CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP4 PUSH1 0x0 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x12E3 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP4 PUSH1 0xA0 ADD MLOAD GT DUP1 ISZERO PUSH2 0x12FB JUMPI POP PUSH1 0x0 DUP4 PUSH1 0xC0 ADD MLOAD GT JUMPDEST DUP1 ISZERO PUSH2 0x1307 JUMPI POP PUSH1 0x0 DUP6 GT JUMPDEST ISZERO ISZERO PUSH2 0x1312 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 PUSH2 0x120 ADD MLOAD TIMESTAMP LT ISZERO ISZERO PUSH2 0x136F JUMPI DUP3 PUSH2 0x140 ADD MLOAD PUSH1 0x0 NOT AND PUSH1 0x0 PUSH1 0x3 DUP2 GT ISZERO PUSH2 0x1337 JUMPI INVALID JUMPDEST PUSH1 0xFF AND PUSH32 0x36D86C59E00BD73DC19BA3ADFE068E4B64AC7E92BE35546ADEDDF1B956A87E90 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x0 SWAP4 POP PUSH2 0x15EE JUMP JUMPDEST PUSH2 0x138A DUP4 PUSH1 0xC0 ADD MLOAD PUSH2 0x1385 DUP6 PUSH2 0x140 ADD MLOAD PUSH2 0x16FF JUMP JUMPDEST PUSH2 0x2498 JUMP JUMPDEST SWAP2 POP PUSH2 0x1396 DUP6 DUP4 PUSH2 0x24CF JUMP JUMPDEST SWAP1 POP PUSH1 0x0 DUP2 EQ ISZERO PUSH2 0x13F0 JUMPI DUP3 PUSH2 0x140 ADD MLOAD PUSH1 0x0 NOT AND PUSH1 0x1 PUSH1 0x3 DUP2 GT ISZERO PUSH2 0x13B8 JUMPI INVALID JUMPDEST PUSH1 0xFF AND PUSH32 0x36D86C59E00BD73DC19BA3ADFE068E4B64AC7E92BE35546ADEDDF1B956A87E90 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x0 SWAP4 POP PUSH2 0x15EE JUMP JUMPDEST PUSH2 0x141A PUSH1 0x3 PUSH1 0x0 DUP6 PUSH2 0x140 ADD MLOAD PUSH1 0x0 NOT AND PUSH1 0x0 NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD DUP3 PUSH2 0x24B1 JUMP JUMPDEST PUSH1 0x3 PUSH1 0x0 DUP6 PUSH2 0x140 ADD MLOAD PUSH1 0x0 NOT AND PUSH1 0x0 NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP DUP3 PUSH1 0x40 ADD MLOAD DUP4 PUSH1 0x60 ADD MLOAD PUSH1 0x40 MLOAD DUP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH13 0x1000000000000000000000000 MUL DUP2 MSTORE PUSH1 0x14 ADD DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH13 0x1000000000000000000000000 MUL DUP2 MSTORE PUSH1 0x14 ADD SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 KECCAK256 PUSH1 0x0 NOT AND DUP4 PUSH1 0x80 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP5 PUSH1 0x0 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x67D66F160BC93D925D05DAE1794C90D2D6D6688B29B84FF069398A9B04587131 DUP7 PUSH1 0x40 ADD MLOAD DUP8 PUSH1 0x60 ADD MLOAD PUSH2 0x1552 DUP8 DUP11 PUSH1 0xC0 ADD MLOAD DUP12 PUSH1 0xA0 ADD MLOAD PUSH2 0x1849 JUMP JUMPDEST DUP8 DUP11 PUSH2 0x140 ADD MLOAD PUSH1 0x40 MLOAD DUP1 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP5 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP2 MSTORE PUSH1 0x20 ADD DUP3 PUSH1 0x0 NOT AND PUSH1 0x0 NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP6 POP POP POP POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG4 DUP1 SWAP4 POP JUMPDEST POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 SWAP1 POP JUMPDEST DUP7 MLOAD DUP2 LT ISZERO PUSH2 0x16D1 JUMPI PUSH2 0x16C4 DUP8 DUP3 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x163D JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP8 DUP4 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1655 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP8 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x166D JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP8 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1685 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP8 DUP7 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x169D JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP8 DUP8 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x16B5 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x16DA JUMP JUMPDEST DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0x1623 JUMP JUMPDEST POP POP POP POP POP POP POP JUMP JUMPDEST DUP4 PUSH2 0x16EB DUP8 DUP8 DUP8 PUSH1 0x0 DUP9 DUP9 DUP9 PUSH2 0x19C0 JUMP JUMPDEST EQ ISZERO ISZERO PUSH2 0x16F7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x1741 PUSH1 0x2 PUSH1 0x0 DUP5 PUSH1 0x0 NOT AND PUSH1 0x0 NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD PUSH1 0x3 PUSH1 0x0 DUP6 PUSH1 0x0 NOT AND PUSH1 0x0 NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD PUSH2 0x24B1 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1 DUP6 PUSH1 0x40 MLOAD DUP1 DUP1 PUSH32 0x19457468657265756D205369676E6564204D6573736167653A0A333200000000 DUP2 MSTORE POP PUSH1 0x1C ADD DUP3 PUSH1 0x0 NOT AND PUSH1 0x0 NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 KECCAK256 DUP6 DUP6 DUP6 PUSH1 0x40 MLOAD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MSTORE PUSH1 0x40 MLOAD DUP1 DUP6 PUSH1 0x0 NOT AND PUSH1 0x0 NOT AND DUP2 MSTORE PUSH1 0x20 ADD DUP5 PUSH1 0xFF AND PUSH1 0xFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP4 PUSH1 0x0 NOT AND PUSH1 0x0 NOT AND DUP2 MSTORE PUSH1 0x20 ADD DUP3 PUSH1 0x0 NOT AND PUSH1 0x0 NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP5 POP POP POP POP POP PUSH1 0x20 PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 SUB SWAP1 DUP1 DUP5 SUB SWAP1 PUSH1 0x0 DUP7 GAS CALL ISZERO DUP1 ISZERO PUSH2 0x1806 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP PUSH1 0x20 PUSH1 0x40 MLOAD SUB MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ SWAP1 POP SWAP6 SWAP5 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x185E PUSH2 0x1858 DUP6 DUP5 PUSH2 0x244A JUMP JUMPDEST DUP5 PUSH2 0x247D JUMP JUMPDEST SWAP1 POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 SWAP1 POP JUMPDEST DUP8 MLOAD DUP2 LT ISZERO PUSH2 0x1943 JUMPI PUSH2 0x1935 DUP9 DUP3 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x18AD JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP9 DUP4 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x18C5 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP9 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x18DD JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP9 DUP9 DUP7 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x18F6 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP9 DUP8 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x190E JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP9 DUP9 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1926 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x19C0 JUMP JUMPDEST POP DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0x1893 JUMP JUMPDEST POP POP POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 SWAP1 POP JUMPDEST DUP4 MLOAD DUP2 LT ISZERO PUSH2 0x19BA JUMPI PUSH2 0x19AC DUP5 DUP3 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x196D JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP5 DUP4 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1985 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP5 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x199D JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x1110 JUMP JUMPDEST POP DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0x1953 JUMP JUMPDEST POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x19CA PUSH2 0x2BD2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH2 0x160 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 DUP15 PUSH1 0x0 PUSH1 0x5 DUP2 LT ISZERO ISZERO PUSH2 0x19EC JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP15 PUSH1 0x1 PUSH1 0x5 DUP2 LT ISZERO ISZERO PUSH2 0x1A1B JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP15 PUSH1 0x2 PUSH1 0x5 DUP2 LT ISZERO ISZERO PUSH2 0x1A4A JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP15 PUSH1 0x3 PUSH1 0x5 DUP2 LT ISZERO ISZERO PUSH2 0x1A79 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP15 PUSH1 0x4 PUSH1 0x5 DUP2 LT ISZERO ISZERO PUSH2 0x1AA8 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP14 PUSH1 0x0 PUSH1 0x6 DUP2 LT ISZERO ISZERO PUSH2 0x1AD7 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD DUP2 MSTORE PUSH1 0x20 ADD DUP14 PUSH1 0x1 PUSH1 0x6 DUP2 LT ISZERO ISZERO PUSH2 0x1AF0 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD DUP2 MSTORE PUSH1 0x20 ADD DUP14 PUSH1 0x2 PUSH1 0x6 DUP2 LT ISZERO ISZERO PUSH2 0x1B09 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD DUP2 MSTORE PUSH1 0x20 ADD DUP14 PUSH1 0x3 PUSH1 0x6 DUP2 LT ISZERO ISZERO PUSH2 0x1B22 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD DUP2 MSTORE PUSH1 0x20 ADD DUP14 PUSH1 0x4 PUSH1 0x6 DUP2 LT ISZERO ISZERO PUSH2 0x1B3B JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD DUP2 MSTORE PUSH1 0x20 ADD PUSH2 0x1B4F DUP16 DUP16 PUSH2 0x2160 JUMP JUMPDEST PUSH1 0x0 NOT AND DUP2 MSTORE POP SWAP5 POP PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP6 PUSH1 0x20 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ DUP1 PUSH2 0x1BC6 JUMPI POP CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP6 PUSH1 0x20 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ JUMPDEST ISZERO ISZERO PUSH2 0x1BD1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP6 PUSH1 0xA0 ADD MLOAD GT DUP1 ISZERO PUSH2 0x1BE9 JUMPI POP PUSH1 0x0 DUP6 PUSH1 0xC0 ADD MLOAD GT JUMPDEST DUP1 ISZERO PUSH2 0x1BF5 JUMPI POP PUSH1 0x0 DUP12 GT JUMPDEST ISZERO ISZERO PUSH2 0x1C00 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1C16 DUP6 PUSH1 0x0 ADD MLOAD DUP7 PUSH2 0x140 ADD MLOAD DUP12 DUP12 DUP12 PUSH2 0x1748 JUMP JUMPDEST ISZERO ISZERO PUSH2 0x1C21 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP5 PUSH2 0x120 ADD MLOAD TIMESTAMP LT ISZERO ISZERO PUSH2 0x1C7E JUMPI DUP5 PUSH2 0x140 ADD MLOAD PUSH1 0x0 NOT AND PUSH1 0x0 PUSH1 0x3 DUP2 GT ISZERO PUSH2 0x1C46 JUMPI INVALID JUMPDEST PUSH1 0xFF AND PUSH32 0x36D86C59E00BD73DC19BA3ADFE068E4B64AC7E92BE35546ADEDDF1B956A87E90 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x0 SWAP6 POP PUSH2 0x2150 JUMP JUMPDEST PUSH2 0x1C99 DUP6 PUSH1 0xC0 ADD MLOAD PUSH2 0x1C94 DUP8 PUSH2 0x140 ADD MLOAD PUSH2 0x16FF JUMP JUMPDEST PUSH2 0x2498 JUMP JUMPDEST SWAP4 POP PUSH2 0x1CA5 DUP12 DUP6 PUSH2 0x24CF JUMP JUMPDEST SWAP6 POP PUSH1 0x0 DUP7 EQ ISZERO PUSH2 0x1CFF JUMPI DUP5 PUSH2 0x140 ADD MLOAD PUSH1 0x0 NOT AND PUSH1 0x1 PUSH1 0x3 DUP2 GT ISZERO PUSH2 0x1CC7 JUMPI INVALID JUMPDEST PUSH1 0xFF AND PUSH32 0x36D86C59E00BD73DC19BA3ADFE068E4B64AC7E92BE35546ADEDDF1B956A87E90 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x0 SWAP6 POP PUSH2 0x2150 JUMP JUMPDEST PUSH2 0x1D12 DUP7 DUP7 PUSH1 0xC0 ADD MLOAD DUP8 PUSH1 0xA0 ADD MLOAD PUSH2 0xF23 JUMP JUMPDEST ISZERO PUSH2 0x1D66 JUMPI DUP5 PUSH2 0x140 ADD MLOAD PUSH1 0x0 NOT AND PUSH1 0x2 PUSH1 0x3 DUP2 GT ISZERO PUSH2 0x1D2E JUMPI INVALID JUMPDEST PUSH1 0xFF AND PUSH32 0x36D86C59E00BD73DC19BA3ADFE068E4B64AC7E92BE35546ADEDDF1B956A87E90 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x0 SWAP6 POP PUSH2 0x2150 JUMP JUMPDEST DUP10 ISZERO DUP1 ISZERO PUSH2 0x1D7B JUMPI POP PUSH2 0x1D79 DUP6 DUP8 PUSH2 0x24E8 JUMP JUMPDEST ISZERO JUMPDEST ISZERO PUSH2 0x1DCE JUMPI DUP5 PUSH2 0x140 ADD MLOAD PUSH1 0x0 NOT AND PUSH1 0x3 DUP1 DUP2 GT ISZERO PUSH2 0x1D96 JUMPI INVALID JUMPDEST PUSH1 0xFF AND PUSH32 0x36D86C59E00BD73DC19BA3ADFE068E4B64AC7E92BE35546ADEDDF1B956A87E90 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x0 SWAP6 POP PUSH2 0x2150 JUMP JUMPDEST PUSH2 0x1DE1 DUP7 DUP7 PUSH1 0xC0 ADD MLOAD DUP8 PUSH1 0xA0 ADD MLOAD PUSH2 0x1849 JUMP JUMPDEST SWAP3 POP PUSH2 0x1E0D PUSH1 0x2 PUSH1 0x0 DUP8 PUSH2 0x140 ADD MLOAD PUSH1 0x0 NOT AND PUSH1 0x0 NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD DUP8 PUSH2 0x24B1 JUMP JUMPDEST PUSH1 0x2 PUSH1 0x0 DUP8 PUSH2 0x140 ADD MLOAD PUSH1 0x0 NOT AND PUSH1 0x0 NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP PUSH2 0x1E45 DUP6 PUSH1 0x40 ADD MLOAD DUP7 PUSH1 0x0 ADD MLOAD CALLER DUP7 PUSH2 0x2838 JUMP JUMPDEST ISZERO ISZERO PUSH2 0x1E50 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1E64 DUP6 PUSH1 0x60 ADD MLOAD CALLER DUP8 PUSH1 0x0 ADD MLOAD DUP10 PUSH2 0x2838 JUMP JUMPDEST ISZERO ISZERO PUSH2 0x1E6F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP6 PUSH1 0x80 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x1F6E JUMPI PUSH1 0x0 DUP6 PUSH1 0xE0 ADD MLOAD GT ISZERO PUSH2 0x1F0C JUMPI PUSH2 0x1EC9 DUP7 DUP7 PUSH1 0xC0 ADD MLOAD DUP8 PUSH1 0xE0 ADD MLOAD PUSH2 0x1849 JUMP JUMPDEST SWAP2 POP PUSH2 0x1F00 PUSH1 0x0 DUP1 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP7 PUSH1 0x0 ADD MLOAD DUP8 PUSH1 0x80 ADD MLOAD DUP6 PUSH2 0x2838 JUMP JUMPDEST ISZERO ISZERO PUSH2 0x1F0B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST JUMPDEST PUSH1 0x0 DUP6 PUSH2 0x100 ADD MLOAD GT ISZERO PUSH2 0x1F6D JUMPI PUSH2 0x1F2E DUP7 DUP7 PUSH1 0xC0 ADD MLOAD DUP8 PUSH2 0x100 ADD MLOAD PUSH2 0x1849 JUMP JUMPDEST SWAP1 POP PUSH2 0x1F61 PUSH1 0x0 DUP1 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER DUP8 PUSH1 0x80 ADD MLOAD DUP5 PUSH2 0x2838 JUMP JUMPDEST ISZERO ISZERO PUSH2 0x1F6C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST JUMPDEST JUMPDEST DUP5 PUSH1 0x40 ADD MLOAD DUP6 PUSH1 0x60 ADD MLOAD PUSH1 0x40 MLOAD DUP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH13 0x1000000000000000000000000 MUL DUP2 MSTORE PUSH1 0x14 ADD DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH13 0x1000000000000000000000000 MUL DUP2 MSTORE PUSH1 0x14 ADD SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 KECCAK256 PUSH1 0x0 NOT AND DUP6 PUSH1 0x80 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP7 PUSH1 0x0 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xD0B9391970D9A25552F37D436D2AAE2925E2BFE1B2A923754BADA030C498CB3 CALLER DUP10 PUSH1 0x40 ADD MLOAD DUP11 PUSH1 0x60 ADD MLOAD DUP10 DUP14 DUP11 DUP11 DUP16 PUSH2 0x140 ADD MLOAD PUSH1 0x40 MLOAD DUP1 DUP10 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP9 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP7 DUP2 MSTORE PUSH1 0x20 ADD DUP6 DUP2 MSTORE PUSH1 0x20 ADD DUP5 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP2 MSTORE PUSH1 0x20 ADD DUP3 PUSH1 0x0 NOT AND PUSH1 0x0 NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP9 POP POP POP POP POP POP POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG4 DUP6 SWAP6 POP JUMPDEST POP POP POP POP POP SWAP8 SWAP7 POP POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 ADDRESS DUP4 PUSH1 0x0 PUSH1 0x5 DUP2 LT ISZERO ISZERO PUSH2 0x2172 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD DUP5 PUSH1 0x1 PUSH1 0x5 DUP2 LT ISZERO ISZERO PUSH2 0x2186 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD DUP6 PUSH1 0x2 PUSH1 0x5 DUP2 LT ISZERO ISZERO PUSH2 0x219A JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD DUP7 PUSH1 0x3 PUSH1 0x5 DUP2 LT ISZERO ISZERO PUSH2 0x21AE JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD DUP8 PUSH1 0x4 PUSH1 0x5 DUP2 LT ISZERO ISZERO PUSH2 0x21C2 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD DUP8 PUSH1 0x0 PUSH1 0x6 DUP2 LT ISZERO ISZERO PUSH2 0x21D6 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD DUP9 PUSH1 0x1 PUSH1 0x6 DUP2 LT ISZERO ISZERO PUSH2 0x21EA JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD DUP10 PUSH1 0x2 PUSH1 0x6 DUP2 LT ISZERO ISZERO PUSH2 0x21FE JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD DUP11 PUSH1 0x3 PUSH1 0x6 DUP2 LT ISZERO ISZERO PUSH2 0x2212 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD DUP12 PUSH1 0x4 PUSH1 0x6 DUP2 LT ISZERO ISZERO PUSH2 0x2226 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD DUP13 PUSH1 0x5 PUSH1 0x6 DUP2 LT ISZERO ISZERO PUSH2 0x223A JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD PUSH1 0x40 MLOAD DUP1 DUP14 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH13 0x1000000000000000000000000 MUL DUP2 MSTORE PUSH1 0x14 ADD DUP13 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH13 0x1000000000000000000000000 MUL DUP2 MSTORE PUSH1 0x14 ADD DUP12 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH13 0x1000000000000000000000000 MUL DUP2 MSTORE PUSH1 0x14 ADD DUP11 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH13 0x1000000000000000000000000 MUL DUP2 MSTORE PUSH1 0x14 ADD DUP10 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH13 0x1000000000000000000000000 MUL DUP2 MSTORE PUSH1 0x14 ADD DUP9 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH13 0x1000000000000000000000000 MUL DUP2 MSTORE PUSH1 0x14 ADD DUP8 DUP2 MSTORE PUSH1 0x20 ADD DUP7 DUP2 MSTORE PUSH1 0x20 ADD DUP6 DUP2 MSTORE PUSH1 0x20 ADD DUP5 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP13 POP POP POP POP POP POP POP POP POP POP POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 KECCAK256 SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x1387 DUP2 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x5 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x312E302E30000000000000000000000000000000000000000000000000000000 DUP2 MSTORE POP DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 DUP3 DUP5 MUL SWAP1 POP PUSH1 0x0 DUP5 EQ DUP1 PUSH2 0x246B JUMPI POP DUP3 DUP5 DUP3 DUP2 ISZERO ISZERO PUSH2 0x2468 JUMPI INVALID JUMPDEST DIV EQ JUMPDEST ISZERO ISZERO PUSH2 0x2473 JUMPI INVALID JUMPDEST DUP1 SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP3 DUP5 DUP2 ISZERO ISZERO PUSH2 0x248B JUMPI INVALID JUMPDEST DIV SWAP1 POP DUP1 SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 GT ISZERO ISZERO ISZERO PUSH2 0x24A6 JUMPI INVALID JUMPDEST DUP2 DUP4 SUB SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP3 DUP5 ADD SWAP1 POP DUP4 DUP2 LT ISZERO ISZERO ISZERO PUSH2 0x24C5 JUMPI INVALID JUMPDEST DUP1 SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 DUP4 LT PUSH2 0x24DE JUMPI DUP2 PUSH2 0x24E0 JUMP JUMPDEST DUP3 JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 CALLER SWAP8 POP PUSH2 0x250C DUP11 DUP13 PUSH1 0xC0 ADD MLOAD DUP14 PUSH1 0xA0 ADD MLOAD PUSH2 0x1849 JUMP JUMPDEST SWAP7 POP PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP12 PUSH1 0x80 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x27B9 JUMPI PUSH1 0x0 DUP1 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP12 PUSH1 0x40 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ SWAP6 POP PUSH1 0x0 DUP1 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP12 PUSH1 0x60 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ SWAP5 POP PUSH2 0x2607 DUP11 DUP13 PUSH1 0xC0 ADD MLOAD DUP14 PUSH1 0xE0 ADD MLOAD PUSH2 0x1849 JUMP JUMPDEST SWAP4 POP PUSH2 0x261D DUP11 DUP13 PUSH1 0xC0 ADD MLOAD DUP14 PUSH2 0x100 ADD MLOAD PUSH2 0x1849 JUMP JUMPDEST SWAP3 POP DUP6 PUSH2 0x262A JUMPI DUP4 PUSH2 0x2635 JUMP JUMPDEST PUSH2 0x2634 DUP8 DUP6 PUSH2 0x24B1 JUMP JUMPDEST JUMPDEST SWAP2 POP DUP5 PUSH2 0x2642 JUMPI DUP3 PUSH2 0x264D JUMP JUMPDEST PUSH2 0x264C DUP11 DUP5 PUSH2 0x24B1 JUMP JUMPDEST JUMPDEST SWAP1 POP DUP2 PUSH2 0x267F PUSH1 0x0 DUP1 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP14 PUSH1 0x0 ADD MLOAD PUSH2 0x29AC JUMP JUMPDEST LT DUP1 PUSH2 0x26B8 JUMPI POP DUP2 PUSH2 0x26B6 PUSH1 0x0 DUP1 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP14 PUSH1 0x0 ADD MLOAD PUSH2 0x2A94 JUMP JUMPDEST LT JUMPDEST DUP1 PUSH2 0x26EC JUMPI POP DUP1 PUSH2 0x26EA PUSH1 0x0 DUP1 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP11 PUSH2 0x29AC JUMP JUMPDEST LT JUMPDEST DUP1 PUSH2 0x2720 JUMPI POP DUP1 PUSH2 0x271E PUSH1 0x0 DUP1 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP11 PUSH2 0x2A94 JUMP JUMPDEST LT JUMPDEST ISZERO PUSH2 0x272E JUMPI PUSH1 0x0 SWAP9 POP PUSH2 0x282A JUMP JUMPDEST DUP6 ISZERO DUP1 ISZERO PUSH2 0x2767 JUMPI POP DUP7 PUSH2 0x274A DUP13 PUSH1 0x40 ADD MLOAD DUP14 PUSH1 0x0 ADD MLOAD PUSH2 0x29AC JUMP JUMPDEST LT DUP1 PUSH2 0x2766 JUMPI POP DUP7 PUSH2 0x2764 DUP13 PUSH1 0x40 ADD MLOAD DUP14 PUSH1 0x0 ADD MLOAD PUSH2 0x2A94 JUMP JUMPDEST LT JUMPDEST JUMPDEST ISZERO PUSH2 0x2775 JUMPI PUSH1 0x0 SWAP9 POP PUSH2 0x282A JUMP JUMPDEST DUP5 ISZERO DUP1 ISZERO PUSH2 0x27A6 JUMPI POP DUP10 PUSH2 0x278D DUP13 PUSH1 0x60 ADD MLOAD DUP11 PUSH2 0x29AC JUMP JUMPDEST LT DUP1 PUSH2 0x27A5 JUMPI POP DUP10 PUSH2 0x27A3 DUP13 PUSH1 0x60 ADD MLOAD DUP11 PUSH2 0x2A94 JUMP JUMPDEST LT JUMPDEST JUMPDEST ISZERO PUSH2 0x27B4 JUMPI PUSH1 0x0 SWAP9 POP PUSH2 0x282A JUMP JUMPDEST PUSH2 0x2825 JUMP JUMPDEST DUP7 PUSH2 0x27CC DUP13 PUSH1 0x40 ADD MLOAD DUP14 PUSH1 0x0 ADD MLOAD PUSH2 0x29AC JUMP JUMPDEST LT DUP1 PUSH2 0x27E8 JUMPI POP DUP7 PUSH2 0x27E6 DUP13 PUSH1 0x40 ADD MLOAD DUP14 PUSH1 0x0 ADD MLOAD PUSH2 0x2A94 JUMP JUMPDEST LT JUMPDEST DUP1 PUSH2 0x27FF JUMPI POP DUP10 PUSH2 0x27FD DUP13 PUSH1 0x60 ADD MLOAD DUP11 PUSH2 0x29AC JUMP JUMPDEST LT JUMPDEST DUP1 PUSH2 0x2816 JUMPI POP DUP10 PUSH2 0x2814 DUP13 PUSH1 0x60 ADD MLOAD DUP11 PUSH2 0x2A94 JUMP JUMPDEST LT JUMPDEST ISZERO PUSH2 0x2824 JUMPI PUSH1 0x0 SWAP9 POP PUSH2 0x282A JUMP JUMPDEST JUMPDEST PUSH1 0x1 SWAP9 POP JUMPDEST POP POP POP POP POP POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0x15DACBEA DUP7 DUP7 DUP7 DUP7 PUSH1 0x40 MLOAD DUP6 PUSH4 0xFFFFFFFF AND PUSH29 0x100000000000000000000000000000000000000000000000000000000 MUL DUP2 MSTORE PUSH1 0x4 ADD DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP5 POP POP POP POP POP PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x2967 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x297B JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x20 DUP2 LT ISZERO PUSH2 0x2991 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 ADD SWAP1 DUP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP SWAP1 POP SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0x70A08231 PUSH2 0x1387 PUSH2 0xFFFF AND DUP5 PUSH1 0x40 MLOAD DUP4 PUSH4 0xFFFFFFFF AND PUSH29 0x100000000000000000000000000000000000000000000000000000000 MUL DUP2 MSTORE PUSH1 0x4 ADD DUP1 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP9 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x2A50 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP DUP8 CALL ISZERO DUP1 ISZERO PUSH2 0x2A64 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x20 DUP2 LT ISZERO PUSH2 0x2A7B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 ADD SWAP1 DUP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0xDD62ED3E PUSH2 0x1387 PUSH2 0xFFFF AND DUP5 PUSH1 0x1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x40 MLOAD DUP5 PUSH4 0xFFFFFFFF AND PUSH29 0x100000000000000000000000000000000000000000000000000000000 MUL DUP2 MSTORE PUSH1 0x4 ADD DUP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP3 POP POP POP PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP9 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x2B8E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP DUP8 CALL ISZERO DUP1 ISZERO PUSH2 0x2BA2 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x20 DUP2 LT ISZERO PUSH2 0x2BB9 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 ADD SWAP1 DUP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x160 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP1 NOT AND DUP2 MSTORE POP SWAP1 JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 RETURNDATASIZE 0x2a SLOAD DUP6 0xda PUSH21 0x4CCE47CF20CB3E00D3A32409B46698BFB0EA75BAB6 0x1e DUP6 PUSH29 0x1416002900000000000000000000000000000000000000000000000000 ",
- "sourceMap": "993:22781:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;18080:458;;8:9:-1;5:2;;;30:1;27;20:12;5:2;18080:458:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1737:39;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1737:39:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1782:42;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1782:42:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;14315:989;;8:9:-1;5:2;;;30:1;27;20:12;5:2;14315:989:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8303:1942;;8:9:-1;5:2;;;30:1;27;20:12;5:2;8303:1942:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1566:33;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1566:33:0;;;;;;;;;;;;;;;;;;;;;;;;;;;13066:512;;8:9:-1;5:2;;;30:1;27;20:12;5:2;13066:512:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10866:419;;8:9:-1;5:2;;;30:1;27;20:12;5:2;10866:419:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;19212:190;;8:9:-1;5:2;;;30:1;27;20:12;5:2;19212:190:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;17491:350;;8:9:-1;5:2;;;30:1;27;20:12;5:2;17491:350:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;18787:204;;8:9:-1;5:2;;;30:1;27;20:12;5:2;18787:204:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1605:44;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1605:44:0;;;;;;;;;;;;;;;;;;;;;;;;;;;11916:619;;8:9:-1;5:2;;;30:1;27;20:12;5:2;11916:619:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;15662:381;;8:9:-1;5:2;;;30:1;27;20:12;5:2;15662:381:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3842:4043;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3842:4043:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;16453:706;;8:9:-1;5:2;;;30:1;27;20:12;5:2;16453:706:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1456:54;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1456:54:0;;;;;;;;;;;;;;;;;;;;;;;;;;;1410:40;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1410:40:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;1410:40:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;18080:458;18201:4;18221:14;18351:30;18264:11;18238:38;;;;;;;18253:9;18245:6;18238:38;18221:55;;18303:1;18290:9;:14;18286:32;;;18313:5;18306:12;;;;18286:32;18384:98;18405:27;18413:9;18424:7;18405;:27::i;:::-;18446:26;18454:9;18465:6;18446:7;:26::i;:::-;18384:7;:98::i;:::-;18351:131;;18527:4;18499:25;:32;18492:39;;18080:458;;;;;;;;:::o;1737:39::-;;;;;;;;;;;;;;;;;:::o;1782:42::-;;;;;;;;;;;;;;;;;:::o;14315:989::-;14594:4;14614:27;14660:6;14644:1;14614:31;;14669:1;14660:10;;14655:604;14676:14;:21;14672:1;:25;14655:604;;;14750:14;14765:1;14750:17;;;;;;;;;;;;;;;;;;14768:1;14750:20;;;;;;;;;;;;;14726:44;;:14;14741:1;14726:17;;;;;;;;;;;;;;;;;;14744:1;14726:20;;;;;;;;;;;;;:44;;;14718:53;;;;;;;;14856:321;14864:22;14888:288;14915:14;14930:1;14915:17;;;;;;;;;;;;;;;;;;14950:11;14962:1;14950:14;;;;;;;;;;;;;;;;;;14982:53;14990:20;15012:22;14982:7;:53::i;:::-;15053:43;15114:1;15116;15114:4;;;;;;;;;;;;;;;;;;15136:1;15138;15136:4;;;;;;;;;;;;;;;;;;15158:1;15160;15158:4;;;;;;;;;;;;;;;;;;14888:9;:288::i;:::-;14856:7;:321::i;:::-;14831:346;;15221:20;15195:22;:46;15191:57;;;15243:5;;15191:57;14699:3;;;;;;;14655:604;;;15275:22;15268:29;;14315:989;;;;;;;;;;;:::o;8303:1942::-;8458:4;8478:18;;:::i;:::-;9338:30;9461;8499:512;;;;;;;;;8526:14;8541:1;8526:17;;;;;;;;;;;;;8499:512;;;;;;8564:14;8579:1;8564:17;;;;;;;;;;;;;8499:512;;;;;;8607:14;8622:1;8607:17;;;;;;;;;;;;;8499:512;;;;;;8650:14;8665:1;8650:17;;;;;;;;;;;;;8499:512;;;;;;8695:14;8710:1;8695:17;;;;;;;;;;;;;8499:512;;;;;;8744:11;8756:1;8744:14;;;;;;;;;;;;;8499:512;;;;8790:11;8802:1;8790:14;;;;;;;;;;;;;8499:512;;;;8828:11;8840:1;8828:14;;;;;;;;;;;;;8499:512;;;;8866:11;8878:1;8866:14;;;;;;;;;;;;;8499:512;;;;8920:11;8932:1;8920:14;;;;;;;;;;;;;8499:512;;;;8959:41;8972:14;8988:11;8959:12;:41::i;:::-;8499:512;;;;;;8478:533;;9045:10;9030:25;;:5;:11;;;:25;;;9022:34;;;;;;;;9099:1;9074:5;:22;;;:26;:56;;;;;9129:1;9104:5;:22;;;:26;9074:56;:86;;;;;9159:1;9134:22;:26;9074:86;9066:95;;;;;;;;9195:5;:30;;;9176:15;:49;;9172:156;;;9279:5;:15;;;9241:54;;;9256:20;9250:27;;;;;;;;9241:54;;;;;;;;;;;;9316:1;9309:8;;;;9172:156;9371:80;9379:5;:22;;;9403:47;9434:5;:15;;;9403:30;:47::i;:::-;9371:7;:80::i;:::-;9338:113;;9494:57;9501:22;9525:25;9494:6;:57::i;:::-;9461:90;;9594:1;9565:25;:30;9561:155;;;9667:5;:15;;;9611:72;;;9626:38;9620:45;;;;;;;;9611:72;;;;;;;;;;;;9704:1;9697:8;;;;9561:155;9755:62;9763:9;:26;9773:5;:15;;;9763:26;;;;;;;;;;;;;;;;;;9791:25;9755:7;:62::i;:::-;9726:9;:26;9736:5;:15;;;9726:26;;;;;;;;;;;;;;;;;:91;;;;10122:5;:16;;;10140:5;:16;;;10112:45;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9828:368;;;9876:5;:18;;;9828:368;;9851:5;:11;;;9828:368;;;9908:5;:16;;;9938:5;:16;;;9968:91;9985:25;10012:5;:22;;;10036:5;:22;;;9968:16;:91::i;:::-;10073:25;10171:5;:15;;;9828:368;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10213:25;10206:32;;8303:1942;;;;;;;;;:::o;1566:33::-;;;;;;;;;;;;;:::o;13066:512::-;13299:6;13308:1;13299:10;;13294:278;13315:14;:21;13311:1;:25;13294:278;;;13357:204;13390:14;13405:1;13390:17;;;;;;;;;;;;;;;;;;13425:11;13437:1;13425:14;;;;;;;;;;;;;;;;;;13457:21;13479:1;13457:24;;;;;;;;;;;;;;;;;;13499:1;13501;13499:4;;;;;;;;;;;;;;;;;;13521:1;13523;13521:4;;;;;;;;;;;;;;;;;;13543:1;13545;13543:4;;;;;;;;;;;;;;;;;;13357:15;:204::i;:::-;13338:3;;;;;;;13294:278;;;13066:512;;;;;;;:::o;10866:419::-;11257:20;11083:170;11106:14;11134:11;11159:20;11193:5;11212:1;11227;11242;11083:9;:170::i;:::-;:194;11075:203;;;;;;;;10866:419;;;;;;:::o;19212:190::-;19320:4;19347:48;19355:6;:17;19362:9;19355:17;;;;;;;;;;;;;;;;;;19374:9;:20;19384:9;19374:20;;;;;;;;;;;;;;;;;;19347:7;:48::i;:::-;19340:55;;19212:190;;;:::o;17491:350::-;17668:4;17705:129;17774:4;17728:51;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;17793:1;17808;17823;17705:129;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;17705:129:0;;;;;;;;17695:139;;:6;:139;;;17688:146;;17491:350;;;;;;;:::o;18787:204::-;18909:4;18936:48;18944:26;18952:9;18963:6;18944:7;:26::i;:::-;18972:11;18936:7;:48::i;:::-;18929:55;;18787:204;;;;;:::o;1605:44::-;;;;;;;;;;;;;:::o;11916:619::-;12201:6;12210:1;12201:10;;12196:333;12217:14;:21;12213:1;:25;12196:333;;;12259:259;12286:14;12301:1;12286:17;;;;;;;;;;;;;;;;;;12321:11;12333:1;12321:14;;;;;;;;;;;;;;;;;;12353:21;12375:1;12353:24;;;;;;;;;;;;;;;;;;12395:43;12456:1;12458;12456:4;;;;;;;;;;;;;;;;;;12478:1;12480;12478:4;;;;;;;;;;;;;;;;;;12500:1;12502;12500:4;;;;;;;;;;;;;;;;;;12259:9;:259::i;:::-;;12240:3;;;;;;;12196:333;;;11916:619;;;;;;;;:::o;15662:381::-;15832:6;15841:1;15832:10;;15827:210;15848:14;:21;15844:1;:25;15827:210;;;15890:136;15919:14;15934:1;15919:17;;;;;;;;;;;;;;;;;;15954:11;15966:1;15954:14;;;;;;;;;;;;;;;;;;15986:23;16010:1;15986:26;;;;;;;;;;;;;;;;;;15890:11;:136::i;:::-;;15871:3;;;;;;;15827:210;;;15662:381;;;;:::o;3842:4043::-;4124:27;4167:18;;:::i;:::-;5198:30;6019:27;6147:17;6174;4188:512;;;;;;;;;4215:14;4230:1;4215:17;;;;;;;;;;;;;4188:512;;;;;;4253:14;4268:1;4253:17;;;;;;;;;;;;;4188:512;;;;;;4296:14;4311:1;4296:17;;;;;;;;;;;;;4188:512;;;;;;4339:14;4354:1;4339:17;;;;;;;;;;;;;4188:512;;;;;;4384:14;4399:1;4384:17;;;;;;;;;;;;;4188:512;;;;;;4433:11;4445:1;4433:14;;;;;;;;;;;;;4188:512;;;;4479:11;4491:1;4479:14;;;;;;;;;;;;;4188:512;;;;4517:11;4529:1;4517:14;;;;;;;;;;;;;4188:512;;;;4555:11;4567:1;4555:14;;;;;;;;;;;;;4188:512;;;;4609:11;4621:1;4609:14;;;;;;;;;;;;;4188:512;;;;4648:41;4661:14;4677:11;4648:12;:41::i;:::-;4188:512;;;;;;4167:533;;4742:1;4719:25;;:5;:11;;;:25;;;:54;;;;4763:10;4748:25;;:5;:11;;;:25;;;4719:54;4711:63;;;;;;;;4817:1;4792:5;:22;;;:26;:56;;;;;4847:1;4822:5;:22;;;:26;4792:56;:84;;;;;4875:1;4852:20;:24;4792:84;4784:93;;;;;;;;4895:125;4925:5;:11;;;4950:5;:15;;;4979:1;4994;5009;4895:16;:125::i;:::-;4887:134;;;;;;;;5055:5;:30;;;5036:15;:49;;5032:156;;;5139:5;:15;;;5101:54;;;5116:20;5110:27;;;;;;;;5101:54;;;;;;;;;;;;5176:1;5169:8;;;;5032:156;5231:80;5239:5;:22;;;5263:47;5294:5;:15;;;5263:30;:47::i;:::-;5231:7;:80::i;:::-;5198:113;;5346:55;5353:20;5375:25;5346:6;:55::i;:::-;5321:80;;5441:1;5415:22;:27;5411:152;;;5514:5;:15;;;5458:72;;;5473:38;5467:45;;;;;;;;5458:72;;;;;;;;;;;;5551:1;5544:8;;;;5411:152;5577:87;5593:22;5617:5;:22;;;5641:5;:22;;;5577:15;:87::i;:::-;5573:205;;;5729:5;:15;;;5680:65;;;5695:31;5689:38;;;;;;;;5680:65;;;;;;;;;;;;5766:1;5759:8;;;;5573:205;5793:43;5792:44;:94;;;;;5841:45;5856:5;5863:22;5841:14;:45::i;:::-;5840:46;5792:94;5788:221;;;5960:5;:15;;;5902:74;;;5917:40;5911:47;;;;;;;;5902:74;;;;;;;;;;;;5997:1;5990:8;;;;5788:221;6049:88;6066:22;6090:5;:22;;;6114:5;:22;;;6049:16;:88::i;:::-;6019:118;;6227:56;6235:6;:23;6242:5;:15;;;6235:23;;;;;;;;;;;;;;;;;;6260:22;6227:7;:56::i;:::-;6201:6;:23;6208:5;:15;;;6201:23;;;;;;;;;;;;;;;;;:82;;;;6301:154;6344:5;:16;;;6374:5;:11;;;6399:10;6423:22;6301:29;:154::i;:::-;6293:163;;;;;;;;6474:154;6517:5;:16;;;6547:10;6571:5;:11;;;6596:22;6474:29;:154::i;:::-;6466:163;;;;;;;;6673:1;6643:32;;:5;:18;;;:32;;;;6639:820;;;6712:1;6695:5;:14;;;:18;6691:373;;;6748:80;6765:22;6789:5;:22;;;6813:5;:14;;;6748:16;:80::i;:::-;6733:95;;6854:194;6905:18;;;;;;;;;;;6945:5;:11;;;6978:5;:18;;;7018:12;6854:29;:194::i;:::-;6846:203;;;;;;;;6691:373;7098:1;7081:5;:14;;;:18;7077:372;;;7134:80;7151:22;7175:5;:22;;;7199:5;:14;;;7134:16;:80::i;:::-;7119:95;;7240:193;7291:18;;;;;;;;;;;7331:10;7363:5;:18;;;7403:12;7240:29;:193::i;:::-;7232:202;;;;;;;;7077:372;6639:820;7765:5;:16;;;7783:5;:16;;;7755:45;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7469:370;;;7539:5;:18;;;7469:370;;7490:5;:11;;;7469:370;;;7515:10;7571:5;:16;;;7601:5;:16;;;7631:22;7667;7703:12;7729;7814:5;:15;;;7469:370;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7856:22;7849:29;;3842:4043;;;;;;;;;;;;;;;:::o;16453:706::-;16572:7;16633:4;16652:14;16667:1;16652:17;;;;;;;;;;;;;16692:14;16707:1;16692:17;;;;;;;;;;;;;16732:14;16747:1;16732:17;;;;;;;;;;;;;16777:14;16792:1;16777:17;;;;;;;;;;;;;16822:14;16837:1;16822:17;;;;;;;;;;;;;16869:11;16881:1;16869:14;;;;;;;;;;;;;16920:11;16932:1;16920:14;;;;;;;;;;;;;16971:11;16983:1;16971:14;;;;;;;;;;;;;17014:11;17026:1;17014:14;;;;;;;;;;;;;17057:11;17069:1;17057:14;;;;;;;;;;;;;17116:11;17128:1;17116:14;;;;;;;;;;;;;16602:550;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;16595:557;;16453:706;;;;:::o;1456:54::-;1506:4;1456:54;:::o;1410:40::-;;;;;;;;;;;;;;;;;;;;:::o;53:184:2:-;137:7;160:6;173:1;169;:5;160:14;;196:1;191;:6;:20;;;;210:1;205;201;:5;;;;;;;;:10;191:20;184:28;;;;;;229:1;222:8;;53:184;;;;;:::o;243:146::-;327:7;350:6;363:1;359;:5;;;;;;;;350:14;;381:1;374:8;;243:146;;;;;:::o;395:150::-;479:7;514:1;509;:6;;502:14;;;;;;537:1;533;:5;526:12;;395:150;;;;:::o;551:170::-;635:7;658:6;671:1;667;:5;658:14;;694:1;689;:6;;682:14;;;;;;713:1;706:8;;551:170;;;;;:::o;1156:139::-;1245:7;1279:1;1275;:5;:13;;1287:1;1275:13;;;1283:1;1275:13;1268:20;;1156:139;;;;:::o;20292:2363:0:-;20541:4;20561:13;20597:25;20774:20;20849;20924:17;21036;21148:21;21262;20577:10;20561:26;;20625:86;20642:20;20664:5;:22;;;20688:5;:22;;;20625:16;:86::i;:::-;20597:114;;20756:1;20726:32;;:5;:18;;;:32;;;;20722:1904;;;20817:18;;;;;;;;;;;20797:38;;:5;:16;;;:38;;;20774:61;;20892:18;;;;;;;;;;;20872:38;;:5;:16;;;:38;;;20849:61;;20944:78;20961:20;20983:5;:22;;;21007:5;:14;;;20944:16;:78::i;:::-;20924:98;;21056:78;21073:20;21095:5;:22;;;21119:5;:14;;;21056:16;:78::i;:::-;21036:98;;21172:15;:76;;21236:12;21172:76;;;21190:43;21198:20;21220:12;21190:7;:43::i;:::-;21172:76;21148:100;;21286:15;:76;;21350:12;21286:76;;;21304:43;21312:20;21334:12;21304:7;:43::i;:::-;21286:76;21262:100;;21430:16;21384:43;21395:18;;;;;;;;;;;21415:5;:11;;;21384:10;:43::i;:::-;:62;:146;;;;21514:16;21466:45;21479:18;;;;;;;;;;;21499:5;:11;;;21466:12;:45::i;:::-;:64;21384:146;:222;;;;21590:16;21550:37;21561:18;;;;;;;;;;;21581:5;21550:10;:37::i;:::-;:56;21384:222;:300;;;;21668:16;21626:39;21639:18;;;;;;;;;;;21659:5;21626:12;:39::i;:::-;:58;21384:300;21377:334;;;21706:5;21699:12;;;;21377:334;21731:15;21730:16;:236;;;;;21798:20;21754:41;21765:5;:16;;;21783:5;:11;;;21754:10;:41::i;:::-;:64;:211;;;;21945:20;21899:43;21912:5;:16;;;21930:5;:11;;;21899:12;:43::i;:::-;:66;21754:211;21730:236;21726:267;;;21988:5;21981:12;;;;21726:267;22012:15;22011:16;:224;;;;;22073:20;22035:35;22046:5;:16;;;22064:5;22035:10;:35::i;:::-;:58;:199;;;;22214:20;22174:37;22187:5;:16;;;22205:5;22174:12;:37::i;:::-;:60;22035:199;22011:224;22007:255;;;22257:5;22250:12;;;;22007:255;20722:1904;;;22330:20;22286:41;22297:5;:16;;;22315:5;:11;;;22286:10;:41::i;:::-;:64;:153;;;;22419:20;22373:43;22386:5;:16;;;22404:5;:11;;;22373:12;:43::i;:::-;:66;22286:153;:234;;;;22500:20;22462:35;22473:5;:16;;;22491:5;22462:10;:35::i;:::-;:58;22286:234;:317;;;;22583:20;22543:37;22556:5;:16;;;22574:5;22543:12;:37::i;:::-;:60;22286:317;22279:347;;;22621:5;22614:12;;;;22279:347;20722:1904;22644:4;22637:11;;20292:2363;;;;;;;;;;;;;:::o;19766:279::-;19925:4;19971:29;;;;;;;;;;;19952:62;;;20015:5;20022:4;20028:2;20032:5;19952:86;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;19952:86:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;19952:86:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;19952:86:0;;;;;;;;;;;;;;;;19945:93;;19766:279;;;;;;:::o;22825:339::-;23036:4;23069:5;23063:22;;;1506:4;23063:52;;23116:5;23063:59;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;23063:59:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;23063:59:0;;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;23063:59:0;;;;;;;;;;;;;;;;23056:66;;22825:339;;;;:::o;23400:372::-;23613:4;23646:5;23640:22;;;1506:4;23640:52;;23693:5;23700:29;;;;;;;;;;;23640:90;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;23640:90:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;23640:90:0;;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;23640:90:0;;;;;;;;;;;;;;;;23633:97;;23400:372;;;;:::o;993:22781::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o"
- }
- }
- },
- "sources": {
- "previous/Exchange/Exchange_v1.sol": {
- "id": 0
- },
- "previous/Ownable/Ownable_v1.sol": {
- "id": 1
- },
- "previous/SafeMath/SafeMath_v1.sol": {
- "id": 2
- },
- "previous/Token/Token_v1.sol": {
- "id": 3
- },
- "previous/TokenTransferProxy/TokenTransferProxy_v1.sol": {
- "id": 4
- }
- },
- "sourceCodes": {
- "previous/Exchange/Exchange_v1.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.4.14;\n\nimport { TokenTransferProxy_v1 as TokenTransferProxy } from \"../TokenTransferProxy/TokenTransferProxy_v1.sol\";\nimport { Token_v1 as Token } from \"../Token/Token_v1.sol\";\nimport { SafeMath_v1 as SafeMath } from \"../SafeMath/SafeMath_v1.sol\";\n\n/// @title Exchange - Facilitates exchange of ERC20 tokens.\n/// @author Amir Bandeali - <amir@0xProject.com>, Will Warren - <will@0xProject.com>\ncontract Exchange_v1 is SafeMath {\n\n // Error Codes\n enum Errors {\n ORDER_EXPIRED, // Order has already expired\n ORDER_FULLY_FILLED_OR_CANCELLED, // Order has already been fully filled or cancelled\n ROUNDING_ERROR_TOO_LARGE, // Rounding error too large\n INSUFFICIENT_BALANCE_OR_ALLOWANCE // Insufficient balance or allowance for token transfer\n }\n\n string constant public VERSION = \"1.0.0\";\n uint16 constant public EXTERNAL_QUERY_GAS_LIMIT = 4999; // Changes to state require at least 5000 gas\n\n address public ZRX_TOKEN_CONTRACT;\n address public TOKEN_TRANSFER_PROXY_CONTRACT;\n\n // Mappings of orderHash => amounts of takerTokenAmount filled or cancelled.\n mapping (bytes32 => uint) public filled;\n mapping (bytes32 => uint) public cancelled;\n\n event LogFill(\n address indexed maker,\n address taker,\n address indexed feeRecipient,\n address makerToken,\n address takerToken,\n uint filledMakerTokenAmount,\n uint filledTakerTokenAmount,\n uint paidMakerFee,\n uint paidTakerFee,\n bytes32 indexed tokens, // keccak256(makerToken, takerToken), allows subscribing to a token pair\n bytes32 orderHash\n );\n\n event LogCancel(\n address indexed maker,\n address indexed feeRecipient,\n address makerToken,\n address takerToken,\n uint cancelledMakerTokenAmount,\n uint cancelledTakerTokenAmount,\n bytes32 indexed tokens,\n bytes32 orderHash\n );\n\n event LogError(uint8 indexed errorId, bytes32 indexed orderHash);\n\n struct Order {\n address maker;\n address taker;\n address makerToken;\n address takerToken;\n address feeRecipient;\n uint makerTokenAmount;\n uint takerTokenAmount;\n uint makerFee;\n uint takerFee;\n uint expirationTimestampInSec;\n bytes32 orderHash;\n }\n\n function Exchange_v1(address _zrxToken, address _tokenTransferProxy) {\n ZRX_TOKEN_CONTRACT = _zrxToken;\n TOKEN_TRANSFER_PROXY_CONTRACT = _tokenTransferProxy;\n }\n\n /*\n * Core exchange functions\n */\n\n /// @dev Fills the input order.\n /// @param orderAddresses Array of order's maker, taker, makerToken, takerToken, and feeRecipient.\n /// @param orderValues Array of order's makerTokenAmount, takerTokenAmount, makerFee, takerFee, expirationTimestampInSec, and salt.\n /// @param fillTakerTokenAmount Desired amount of takerToken to fill.\n /// @param shouldThrowOnInsufficientBalanceOrAllowance Test if transfer will fail before attempting.\n /// @param v ECDSA signature parameter v.\n /// @param r ECDSA signature parameters r.\n /// @param s ECDSA signature parameters s.\n /// @return Total amount of takerToken filled in trade.\n function fillOrder(\n address[5] orderAddresses,\n uint[6] orderValues,\n uint fillTakerTokenAmount,\n bool shouldThrowOnInsufficientBalanceOrAllowance,\n uint8 v,\n bytes32 r,\n bytes32 s)\n public\n returns (uint filledTakerTokenAmount)\n {\n Order memory order = Order({\n maker: orderAddresses[0],\n taker: orderAddresses[1],\n makerToken: orderAddresses[2],\n takerToken: orderAddresses[3],\n feeRecipient: orderAddresses[4],\n makerTokenAmount: orderValues[0],\n takerTokenAmount: orderValues[1],\n makerFee: orderValues[2],\n takerFee: orderValues[3],\n expirationTimestampInSec: orderValues[4],\n orderHash: getOrderHash(orderAddresses, orderValues)\n });\n\n require(order.taker == address(0) || order.taker == msg.sender);\n require(order.makerTokenAmount > 0 && order.takerTokenAmount > 0 && fillTakerTokenAmount > 0);\n require(isValidSignature(\n order.maker,\n order.orderHash,\n v,\n r,\n s\n ));\n\n if (block.timestamp >= order.expirationTimestampInSec) {\n LogError(uint8(Errors.ORDER_EXPIRED), order.orderHash);\n return 0;\n }\n\n uint remainingTakerTokenAmount = safeSub(order.takerTokenAmount, getUnavailableTakerTokenAmount(order.orderHash));\n filledTakerTokenAmount = min256(fillTakerTokenAmount, remainingTakerTokenAmount);\n if (filledTakerTokenAmount == 0) {\n LogError(uint8(Errors.ORDER_FULLY_FILLED_OR_CANCELLED), order.orderHash);\n return 0;\n }\n\n if (isRoundingError(filledTakerTokenAmount, order.takerTokenAmount, order.makerTokenAmount)) {\n LogError(uint8(Errors.ROUNDING_ERROR_TOO_LARGE), order.orderHash);\n return 0;\n }\n\n if (!shouldThrowOnInsufficientBalanceOrAllowance && !isTransferable(order, filledTakerTokenAmount)) {\n LogError(uint8(Errors.INSUFFICIENT_BALANCE_OR_ALLOWANCE), order.orderHash);\n return 0;\n }\n\n uint filledMakerTokenAmount = getPartialAmount(filledTakerTokenAmount, order.takerTokenAmount, order.makerTokenAmount);\n uint paidMakerFee;\n uint paidTakerFee;\n filled[order.orderHash] = safeAdd(filled[order.orderHash], filledTakerTokenAmount);\n require(transferViaTokenTransferProxy(\n order.makerToken,\n order.maker,\n msg.sender,\n filledMakerTokenAmount\n ));\n require(transferViaTokenTransferProxy(\n order.takerToken,\n msg.sender,\n order.maker,\n filledTakerTokenAmount\n ));\n if (order.feeRecipient != address(0)) {\n if (order.makerFee > 0) {\n paidMakerFee = getPartialAmount(filledTakerTokenAmount, order.takerTokenAmount, order.makerFee);\n require(transferViaTokenTransferProxy(\n ZRX_TOKEN_CONTRACT,\n order.maker,\n order.feeRecipient,\n paidMakerFee\n ));\n }\n if (order.takerFee > 0) {\n paidTakerFee = getPartialAmount(filledTakerTokenAmount, order.takerTokenAmount, order.takerFee);\n require(transferViaTokenTransferProxy(\n ZRX_TOKEN_CONTRACT,\n msg.sender,\n order.feeRecipient,\n paidTakerFee\n ));\n }\n }\n\n LogFill(\n order.maker,\n msg.sender,\n order.feeRecipient,\n order.makerToken,\n order.takerToken,\n filledMakerTokenAmount,\n filledTakerTokenAmount,\n paidMakerFee,\n paidTakerFee,\n keccak256(order.makerToken, order.takerToken),\n order.orderHash\n );\n return filledTakerTokenAmount;\n }\n\n /// @dev Cancels the input order.\n /// @param orderAddresses Array of order's maker, taker, makerToken, takerToken, and feeRecipient.\n /// @param orderValues Array of order's makerTokenAmount, takerTokenAmount, makerFee, takerFee, expirationTimestampInSec, and salt.\n /// @param cancelTakerTokenAmount Desired amount of takerToken to cancel in order.\n /// @return Amount of takerToken cancelled.\n function cancelOrder(\n address[5] orderAddresses,\n uint[6] orderValues,\n uint cancelTakerTokenAmount)\n public\n returns (uint)\n {\n Order memory order = Order({\n maker: orderAddresses[0],\n taker: orderAddresses[1],\n makerToken: orderAddresses[2],\n takerToken: orderAddresses[3],\n feeRecipient: orderAddresses[4],\n makerTokenAmount: orderValues[0],\n takerTokenAmount: orderValues[1],\n makerFee: orderValues[2],\n takerFee: orderValues[3],\n expirationTimestampInSec: orderValues[4],\n orderHash: getOrderHash(orderAddresses, orderValues)\n });\n\n require(order.maker == msg.sender);\n require(order.makerTokenAmount > 0 && order.takerTokenAmount > 0 && cancelTakerTokenAmount > 0);\n\n if (block.timestamp >= order.expirationTimestampInSec) {\n LogError(uint8(Errors.ORDER_EXPIRED), order.orderHash);\n return 0;\n }\n\n uint remainingTakerTokenAmount = safeSub(order.takerTokenAmount, getUnavailableTakerTokenAmount(order.orderHash));\n uint cancelledTakerTokenAmount = min256(cancelTakerTokenAmount, remainingTakerTokenAmount);\n if (cancelledTakerTokenAmount == 0) {\n LogError(uint8(Errors.ORDER_FULLY_FILLED_OR_CANCELLED), order.orderHash);\n return 0;\n }\n\n cancelled[order.orderHash] = safeAdd(cancelled[order.orderHash], cancelledTakerTokenAmount);\n\n LogCancel(\n order.maker,\n order.feeRecipient,\n order.makerToken,\n order.takerToken,\n getPartialAmount(cancelledTakerTokenAmount, order.takerTokenAmount, order.makerTokenAmount),\n cancelledTakerTokenAmount,\n keccak256(order.makerToken, order.takerToken),\n order.orderHash\n );\n return cancelledTakerTokenAmount;\n }\n\n /*\n * Wrapper functions\n */\n\n /// @dev Fills an order with specified parameters and ECDSA signature, throws if specified amount not filled entirely.\n /// @param orderAddresses Array of order's maker, taker, makerToken, takerToken, and feeRecipient.\n /// @param orderValues Array of order's makerTokenAmount, takerTokenAmount, makerFee, takerFee, expirationTimestampInSec, and salt.\n /// @param fillTakerTokenAmount Desired amount of takerToken to fill.\n /// @param v ECDSA signature parameter v.\n /// @param r ECDSA signature parameters r.\n /// @param s ECDSA signature parameters s.\n function fillOrKillOrder(\n address[5] orderAddresses,\n uint[6] orderValues,\n uint fillTakerTokenAmount,\n uint8 v,\n bytes32 r,\n bytes32 s)\n public\n {\n require(fillOrder(\n orderAddresses,\n orderValues,\n fillTakerTokenAmount,\n false,\n v,\n r,\n s\n ) == fillTakerTokenAmount);\n }\n\n /// @dev Synchronously executes multiple fill orders in a single transaction.\n /// @param orderAddresses Array of address arrays containing individual order addresses.\n /// @param orderValues Array of uint arrays containing individual order values.\n /// @param fillTakerTokenAmounts Array of desired amounts of takerToken to fill in orders.\n /// @param shouldThrowOnInsufficientBalanceOrAllowance Test if transfers will fail before attempting.\n /// @param v Array ECDSA signature v parameters.\n /// @param r Array of ECDSA signature r parameters.\n /// @param s Array of ECDSA signature s parameters.\n function batchFillOrders(\n address[5][] orderAddresses,\n uint[6][] orderValues,\n uint[] fillTakerTokenAmounts,\n bool shouldThrowOnInsufficientBalanceOrAllowance,\n uint8[] v,\n bytes32[] r,\n bytes32[] s)\n public\n {\n for (uint i = 0; i < orderAddresses.length; i++) {\n fillOrder(\n orderAddresses[i],\n orderValues[i],\n fillTakerTokenAmounts[i],\n shouldThrowOnInsufficientBalanceOrAllowance,\n v[i],\n r[i],\n s[i]\n );\n }\n }\n\n /// @dev Synchronously executes multiple fillOrKill orders in a single transaction.\n /// @param orderAddresses Array of address arrays containing individual order addresses.\n /// @param orderValues Array of uint arrays containing individual order values.\n /// @param fillTakerTokenAmounts Array of desired amounts of takerToken to fill in orders.\n /// @param v Array ECDSA signature v parameters.\n /// @param r Array of ECDSA signature r parameters.\n /// @param s Array of ECDSA signature s parameters.\n function batchFillOrKillOrders(\n address[5][] orderAddresses,\n uint[6][] orderValues,\n uint[] fillTakerTokenAmounts,\n uint8[] v,\n bytes32[] r,\n bytes32[] s)\n public\n {\n for (uint i = 0; i < orderAddresses.length; i++) {\n fillOrKillOrder(\n orderAddresses[i],\n orderValues[i],\n fillTakerTokenAmounts[i],\n v[i],\n r[i],\n s[i]\n );\n }\n }\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total fillTakerTokenAmount filled.\n /// @param orderAddresses Array of address arrays containing individual order addresses.\n /// @param orderValues Array of uint arrays containing individual order values.\n /// @param fillTakerTokenAmount Desired total amount of takerToken to fill in orders.\n /// @param shouldThrowOnInsufficientBalanceOrAllowance Test if transfers will fail before attempting.\n /// @param v Array ECDSA signature v parameters.\n /// @param r Array of ECDSA signature r parameters.\n /// @param s Array of ECDSA signature s parameters.\n /// @return Total amount of fillTakerTokenAmount filled in orders.\n function fillOrdersUpTo(\n address[5][] orderAddresses,\n uint[6][] orderValues,\n uint fillTakerTokenAmount,\n bool shouldThrowOnInsufficientBalanceOrAllowance,\n uint8[] v,\n bytes32[] r,\n bytes32[] s)\n public\n returns (uint)\n {\n uint filledTakerTokenAmount = 0;\n for (uint i = 0; i < orderAddresses.length; i++) {\n require(orderAddresses[i][3] == orderAddresses[0][3]); // takerToken must be the same for each order\n filledTakerTokenAmount = safeAdd(filledTakerTokenAmount, fillOrder(\n orderAddresses[i],\n orderValues[i],\n safeSub(fillTakerTokenAmount, filledTakerTokenAmount),\n shouldThrowOnInsufficientBalanceOrAllowance,\n v[i],\n r[i],\n s[i]\n ));\n if (filledTakerTokenAmount == fillTakerTokenAmount) break;\n }\n return filledTakerTokenAmount;\n }\n\n /// @dev Synchronously cancels multiple orders in a single transaction.\n /// @param orderAddresses Array of address arrays containing individual order addresses.\n /// @param orderValues Array of uint arrays containing individual order values.\n /// @param cancelTakerTokenAmounts Array of desired amounts of takerToken to cancel in orders.\n function batchCancelOrders(\n address[5][] orderAddresses,\n uint[6][] orderValues,\n uint[] cancelTakerTokenAmounts)\n public\n {\n for (uint i = 0; i < orderAddresses.length; i++) {\n cancelOrder(\n orderAddresses[i],\n orderValues[i],\n cancelTakerTokenAmounts[i]\n );\n }\n }\n\n /*\n * Constant public functions\n */\n\n /// @dev Calculates Keccak-256 hash of order with specified parameters.\n /// @param orderAddresses Array of order's maker, taker, makerToken, takerToken, and feeRecipient.\n /// @param orderValues Array of order's makerTokenAmount, takerTokenAmount, makerFee, takerFee, expirationTimestampInSec, and salt.\n /// @return Keccak-256 hash of order.\n function getOrderHash(address[5] orderAddresses, uint[6] orderValues)\n public\n constant\n returns (bytes32)\n {\n return keccak256(\n address(this),\n orderAddresses[0], // maker\n orderAddresses[1], // taker\n orderAddresses[2], // makerToken\n orderAddresses[3], // takerToken\n orderAddresses[4], // feeRecipient\n orderValues[0], // makerTokenAmount\n orderValues[1], // takerTokenAmount\n orderValues[2], // makerFee\n orderValues[3], // takerFee\n orderValues[4], // expirationTimestampInSec\n orderValues[5] // salt\n );\n }\n\n /// @dev Verifies that an order signature is valid.\n /// @param signer address of signer.\n /// @param hash Signed Keccak-256 hash.\n /// @param v ECDSA signature parameter v.\n /// @param r ECDSA signature parameters r.\n /// @param s ECDSA signature parameters s.\n /// @return Validity of order signature.\n function isValidSignature(\n address signer,\n bytes32 hash,\n uint8 v,\n bytes32 r,\n bytes32 s)\n public\n constant\n returns (bool)\n {\n return signer == ecrecover(\n keccak256(\"\\x19Ethereum Signed Message:\\n32\", hash),\n v,\n r,\n s\n );\n }\n\n /// @dev Checks if rounding error > 0.1%.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to multiply with numerator/denominator.\n /// @return Rounding error is present.\n function isRoundingError(uint numerator, uint denominator, uint target)\n public\n constant\n returns (bool)\n {\n uint remainder = mulmod(target, numerator, denominator);\n if (remainder == 0) return false; // No rounding error.\n\n uint errPercentageTimes1000000 = safeDiv(\n safeMul(remainder, 1000000),\n safeMul(numerator, target)\n );\n return errPercentageTimes1000000 > 1000;\n }\n\n /// @dev Calculates partial value given a numerator and denominator.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target.\n function getPartialAmount(uint numerator, uint denominator, uint target)\n public\n constant\n returns (uint)\n {\n return safeDiv(safeMul(numerator, target), denominator);\n }\n\n /// @dev Calculates the sum of values already filled and cancelled for a given order.\n /// @param orderHash The Keccak-256 hash of the given order.\n /// @return Sum of values already filled and cancelled.\n function getUnavailableTakerTokenAmount(bytes32 orderHash)\n public\n constant\n returns (uint)\n {\n return safeAdd(filled[orderHash], cancelled[orderHash]);\n }\n\n\n /*\n * Internal functions\n */\n\n /// @dev Transfers a token using TokenTransferProxy transferFrom function.\n /// @param token Address of token to transferFrom.\n /// @param from Address transfering token.\n /// @param to Address receiving token.\n /// @param value Amount of token to transfer.\n /// @return Success of token transfer.\n function transferViaTokenTransferProxy(\n address token,\n address from,\n address to,\n uint value)\n internal\n returns (bool)\n {\n return TokenTransferProxy(TOKEN_TRANSFER_PROXY_CONTRACT).transferFrom(token, from, to, value);\n }\n\n /// @dev Checks if any order transfers will fail.\n /// @param order Order struct of params that will be checked.\n /// @param fillTakerTokenAmount Desired amount of takerToken to fill.\n /// @return Predicted result of transfers.\n function isTransferable(Order order, uint fillTakerTokenAmount)\n internal\n constant // The called token contracts may attempt to change state, but will not be able to due to gas limits on getBalance and getAllowance.\n returns (bool)\n {\n address taker = msg.sender;\n uint fillMakerTokenAmount = getPartialAmount(fillTakerTokenAmount, order.takerTokenAmount, order.makerTokenAmount);\n\n if (order.feeRecipient != address(0)) {\n bool isMakerTokenZRX = order.makerToken == ZRX_TOKEN_CONTRACT;\n bool isTakerTokenZRX = order.takerToken == ZRX_TOKEN_CONTRACT;\n uint paidMakerFee = getPartialAmount(fillTakerTokenAmount, order.takerTokenAmount, order.makerFee);\n uint paidTakerFee = getPartialAmount(fillTakerTokenAmount, order.takerTokenAmount, order.takerFee);\n uint requiredMakerZRX = isMakerTokenZRX ? safeAdd(fillMakerTokenAmount, paidMakerFee) : paidMakerFee;\n uint requiredTakerZRX = isTakerTokenZRX ? safeAdd(fillTakerTokenAmount, paidTakerFee) : paidTakerFee;\n\n if ( getBalance(ZRX_TOKEN_CONTRACT, order.maker) < requiredMakerZRX\n || getAllowance(ZRX_TOKEN_CONTRACT, order.maker) < requiredMakerZRX\n || getBalance(ZRX_TOKEN_CONTRACT, taker) < requiredTakerZRX\n || getAllowance(ZRX_TOKEN_CONTRACT, taker) < requiredTakerZRX\n ) return false;\n\n if (!isMakerTokenZRX && ( getBalance(order.makerToken, order.maker) < fillMakerTokenAmount // Don't double check makerToken if ZRX\n || getAllowance(order.makerToken, order.maker) < fillMakerTokenAmount)\n ) return false;\n if (!isTakerTokenZRX && ( getBalance(order.takerToken, taker) < fillTakerTokenAmount // Don't double check takerToken if ZRX\n || getAllowance(order.takerToken, taker) < fillTakerTokenAmount)\n ) return false;\n } else if ( getBalance(order.makerToken, order.maker) < fillMakerTokenAmount\n || getAllowance(order.makerToken, order.maker) < fillMakerTokenAmount\n || getBalance(order.takerToken, taker) < fillTakerTokenAmount\n || getAllowance(order.takerToken, taker) < fillTakerTokenAmount\n ) return false;\n\n return true;\n }\n\n /// @dev Get token balance of an address.\n /// @param token Address of token.\n /// @param owner Address of owner.\n /// @return Token balance of owner.\n function getBalance(address token, address owner)\n internal\n constant // The called token contract may attempt to change state, but will not be able to due to an added gas limit.\n returns (uint)\n {\n return Token(token).balanceOf.gas(EXTERNAL_QUERY_GAS_LIMIT)(owner); // Limit gas to prevent reentrancy\n }\n\n /// @dev Get allowance of token given to TokenTransferProxy by an address.\n /// @param token Address of token.\n /// @param owner Address of owner.\n /// @return Allowance of token given to TokenTransferProxy by owner.\n function getAllowance(address token, address owner)\n internal\n constant // The called token contract may attempt to change state, but will not be able to due to an added gas limit.\n returns (uint)\n {\n return Token(token).allowance.gas(EXTERNAL_QUERY_GAS_LIMIT)(owner, TOKEN_TRANSFER_PROXY_CONTRACT); // Limit gas to prevent reentrancy\n }\n}\n",
- "previous/Ownable/Ownable_v1.sol": "pragma solidity ^0.4.11;\n\n/*\n * Ownable\n *\n * Base contract with an owner.\n * Provides onlyOwner modifier, which prevents function from running if it is called by anyone other than the owner.\n */\n\ncontract Ownable_v1 {\n address public owner;\n\n function Ownable_v1() {\n owner = msg.sender;\n }\n\n modifier onlyOwner() {\n require(msg.sender == owner);\n _;\n }\n\n function transferOwnership(address newOwner) onlyOwner {\n if (newOwner != address(0)) {\n owner = newOwner;\n }\n }\n}\n",
- "previous/SafeMath/SafeMath_v1.sol": "pragma solidity ^0.4.11;\n\ncontract SafeMath_v1 {\n function safeMul(uint a, uint b)\n internal\n constant\n returns (uint256)\n {\n uint c = a * b;\n assert(a == 0 || c / a == b);\n return c;\n }\n\n function safeDiv(uint a, uint b)\n internal\n constant\n returns (uint256)\n {\n uint c = a / b;\n return c;\n }\n\n function safeSub(uint a, uint b)\n internal\n constant\n returns (uint256)\n {\n assert(b <= a);\n return a - b;\n }\n\n function safeAdd(uint a, uint b)\n internal\n constant\n returns (uint256)\n {\n uint c = a + b;\n assert(c >= a);\n return c;\n }\n\n function max64(uint64 a, uint64 b)\n internal\n constant\n returns (uint64)\n {\n return a >= b ? a : b;\n }\n\n function min64(uint64 a, uint64 b)\n internal\n constant\n returns (uint64)\n {\n return a < b ? a : b;\n }\n\n function max256(uint256 a, uint256 b)\n internal\n constant\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min256(uint256 a, uint256 b)\n internal\n constant\n returns (uint256)\n {\n return a < b ? a : b;\n }\n}\n",
- "previous/Token/Token_v1.sol": "pragma solidity ^0.4.11;\n\ncontract Token_v1 {\n\n /// @return total amount of tokens\n function totalSupply() constant returns (uint supply) {}\n\n /// @param _owner The address from which the balance will be retrieved\n /// @return The balance\n function balanceOf(address _owner) constant returns (uint balance) {}\n\n /// @notice send `_value` token to `_to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return Whether the transfer was successful or not\n function transfer(address _to, uint _value) returns (bool success) {}\n\n /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return Whether the transfer was successful or not\n function transferFrom(address _from, address _to, uint _value) returns (bool success) {}\n\n /// @notice `msg.sender` approves `_addr` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Whether the approval was successful or not\n function approve(address _spender, uint _value) returns (bool success) {}\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender) constant returns (uint remaining) {}\n\n event Transfer(address indexed _from, address indexed _to, uint _value);\n event Approval(address indexed _owner, address indexed _spender, uint _value);\n}\n\n",
- "previous/TokenTransferProxy/TokenTransferProxy_v1.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.4.11;\n\nimport { Token_v1 as Token } from \"../Token/Token_v1.sol\";\nimport { Ownable_v1 as Ownable } from \"../Ownable/Ownable_v1.sol\";\n\n/// @title TokenTransferProxy - Transfers tokens on behalf of contracts that have been approved via decentralized governance.\n/// @author Amir Bandeali - <amir@0xProject.com>, Will Warren - <will@0xProject.com>\ncontract TokenTransferProxy_v1 is Ownable {\n\n /// @dev Only authorized addresses can invoke functions with this modifier.\n modifier onlyAuthorized {\n require(authorized[msg.sender]);\n _;\n }\n\n modifier targetAuthorized(address target) {\n require(authorized[target]);\n _;\n }\n\n modifier targetNotAuthorized(address target) {\n require(!authorized[target]);\n _;\n }\n\n mapping (address => bool) public authorized;\n address[] public authorities;\n\n event LogAuthorizedAddressAdded(address indexed target, address indexed caller);\n event LogAuthorizedAddressRemoved(address indexed target, address indexed caller);\n\n /*\n * Public functions\n */\n\n /// @dev Authorizes an address.\n /// @param target Address to authorize.\n function addAuthorizedAddress(address target)\n public\n onlyOwner\n targetNotAuthorized(target)\n {\n authorized[target] = true;\n authorities.push(target);\n LogAuthorizedAddressAdded(target, msg.sender);\n }\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n function removeAuthorizedAddress(address target)\n public\n onlyOwner\n targetAuthorized(target)\n {\n delete authorized[target];\n for (uint i = 0; i < authorities.length; i++) {\n if (authorities[i] == target) {\n authorities[i] = authorities[authorities.length - 1];\n authorities.length -= 1;\n break;\n }\n }\n LogAuthorizedAddressRemoved(target, msg.sender);\n }\n\n /// @dev Calls into ERC20 Token contract, invoking transferFrom.\n /// @param token Address of token to transfer.\n /// @param from Address to transfer token from.\n /// @param to Address to transfer token to.\n /// @param value Amount of token to transfer.\n /// @return Success of transfer.\n function transferFrom(\n address token,\n address from,\n address to,\n uint value)\n public\n onlyAuthorized\n returns (bool)\n {\n return Token(token).transferFrom(from, to, value);\n }\n\n /*\n * Public constant functions\n */\n\n /// @dev Gets all authorized addresses.\n /// @return Array of authorized addresses.\n function getAuthorizedAddresses()\n public\n constant\n returns (address[])\n {\n return authorities;\n }\n}\n"
- },
- "sourceTreeHashHex": "0xea4f765b6f4c7e5edd71d47b3d5c04db5d2ad5b4412f743cfd0c85a55fa42585",
- "compiler": {
- "name": "solc",
- "version": "0.4.23",
- "settings": {
- "outputSelection": {
- "*": {
- "*": [
- "abi",
- "evm.bytecode.object",
- "evm.bytecode.sourceMap",
- "evm.deployedBytecode.object",
- "evm.deployedBytecode.sourceMap"
- ]
- }
- }
- }
- },
- "networks": {
- "50": {
- "address": "0x48bacb9266a570d521063ef5dd96e61686dbe788",
- "links": {},
- "constructorArgs": "[\"0x1d7022f5b17d2f8b695918fb48fa1089c9f85401\",\"0x1dc4c1cefef38a777b15aa20260a54e584b16c48\"]"
- }
- }
-} \ No newline at end of file
diff --git a/packages/migrations/artifacts/1.0.0/MultiSigWallet.json b/packages/migrations/artifacts/1.0.0/MultiSigWallet.json
deleted file mode 100644
index 474225616..000000000
--- a/packages/migrations/artifacts/1.0.0/MultiSigWallet.json
+++ /dev/null
@@ -1,580 +0,0 @@
-{
- "schemaVersion": "2.0.0",
- "contractName": "MultiSigWallet",
- "compilerOutput": {
- "abi": [
- {
- "constant": true,
- "inputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "name": "owners",
- "outputs": [
- {
- "name": "",
- "type": "address"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "owner",
- "type": "address"
- }
- ],
- "name": "removeOwner",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "revokeConfirmation",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "",
- "type": "address"
- }
- ],
- "name": "isOwner",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "",
- "type": "uint256"
- },
- {
- "name": "",
- "type": "address"
- }
- ],
- "name": "confirmations",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "pending",
- "type": "bool"
- },
- {
- "name": "executed",
- "type": "bool"
- }
- ],
- "name": "getTransactionCount",
- "outputs": [
- {
- "name": "count",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "owner",
- "type": "address"
- }
- ],
- "name": "addOwner",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "isConfirmed",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "getConfirmationCount",
- "outputs": [
- {
- "name": "count",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "name": "transactions",
- "outputs": [
- {
- "name": "destination",
- "type": "address"
- },
- {
- "name": "value",
- "type": "uint256"
- },
- {
- "name": "data",
- "type": "bytes"
- },
- {
- "name": "executed",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "getOwners",
- "outputs": [
- {
- "name": "",
- "type": "address[]"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "from",
- "type": "uint256"
- },
- {
- "name": "to",
- "type": "uint256"
- },
- {
- "name": "pending",
- "type": "bool"
- },
- {
- "name": "executed",
- "type": "bool"
- }
- ],
- "name": "getTransactionIds",
- "outputs": [
- {
- "name": "_transactionIds",
- "type": "uint256[]"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "getConfirmations",
- "outputs": [
- {
- "name": "_confirmations",
- "type": "address[]"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "transactionCount",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_required",
- "type": "uint256"
- }
- ],
- "name": "changeRequirement",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "confirmTransaction",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "destination",
- "type": "address"
- },
- {
- "name": "value",
- "type": "uint256"
- },
- {
- "name": "data",
- "type": "bytes"
- }
- ],
- "name": "submitTransaction",
- "outputs": [
- {
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "MAX_OWNER_COUNT",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "required",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "owner",
- "type": "address"
- },
- {
- "name": "newOwner",
- "type": "address"
- }
- ],
- "name": "replaceOwner",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "executeTransaction",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "inputs": [
- {
- "name": "_owners",
- "type": "address[]"
- },
- {
- "name": "_required",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "constructor"
- },
- {
- "payable": true,
- "stateMutability": "payable",
- "type": "fallback"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "sender",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "Confirmation",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "sender",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "Revocation",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "Submission",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "Execution",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "ExecutionFailure",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "sender",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "value",
- "type": "uint256"
- }
- ],
- "name": "Deposit",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "owner",
- "type": "address"
- }
- ],
- "name": "OwnerAddition",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "owner",
- "type": "address"
- }
- ],
- "name": "OwnerRemoval",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": false,
- "name": "required",
- "type": "uint256"
- }
- ],
- "name": "RequirementChange",
- "type": "event"
- }
- ],
- "evm": {
- "bytecode": {
- "linkReferences": {},
- "object": "0x60806040523480156200001157600080fd5b5060405162002385380380620023858339810180604052810190808051820192919060200180519060200190929190505050600082518260328211806200005757508181115b80620000635750600081145b806200006f5750600082145b156200007a57600080fd5b600092505b8451831015620001b1576002600086858151811015156200009c57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680620001285750600085848151811015156200010657fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff16145b156200013357600080fd5b60016002600087868151811015156200014857fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555082806001019350506200007f565b8460039080519060200190620001c9929190620001dc565b50836004819055505050505050620002b1565b82805482825590600052602060002090810192821562000258579160200282015b82811115620002575782518260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555091602001919060010190620001fd565b5b5090506200026791906200026b565b5090565b620002ae91905b80821115620002aa57600081816101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690555060010162000272565b5090565b90565b6120c480620002c16000396000f30060806040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063025e7c2714610177578063173825d9146101e457806320ea8d86146102275780632f54bf6e146102545780633411c81c146102af57806354741525146103145780637065cb4814610363578063784547a7146103a65780638b51d13f146103eb5780639ace38c21461042c578063a0e67e2b14610517578063a8abe69a14610583578063b5dc40c314610627578063b77bf600146106a9578063ba51a6df146106d4578063c01a8c8414610701578063c64274741461072e578063d74f8edd146107d5578063dc8452cd14610800578063e20056e61461082b578063ee22610b1461088e575b6000341115610175573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a25b005b34801561018357600080fd5b506101a2600480360381019080803590602001909291905050506108bb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156101f057600080fd5b50610225600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108f9565b005b34801561023357600080fd5b5061025260048036038101908080359060200190929190505050610b92565b005b34801561026057600080fd5b50610295600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d38565b604051808215151515815260200191505060405180910390f35b3480156102bb57600080fd5b506102fa60048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d58565b604051808215151515815260200191505060405180910390f35b34801561032057600080fd5b5061034d600480360381019080803515159060200190929190803515159060200190929190505050610d87565b6040518082815260200191505060405180910390f35b34801561036f57600080fd5b506103a4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e19565b005b3480156103b257600080fd5b506103d160048036038101908080359060200190929190505050611012565b604051808215151515815260200191505060405180910390f35b3480156103f757600080fd5b50610416600480360381019080803590602001909291905050506110f7565b6040518082815260200191505060405180910390f35b34801561043857600080fd5b50610457600480360381019080803590602001909291905050506111c2565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018060200183151515158152602001828103825284818151815260200191508051906020019080838360005b838110156104d95780820151818401526020810190506104be565b50505050905090810190601f1680156105065780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b34801561052357600080fd5b5061052c6112b7565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561056f578082015181840152602081019050610554565b505050509050019250505060405180910390f35b34801561058f57600080fd5b506105d06004803603810190808035906020019092919080359060200190929190803515159060200190929190803515159060200190929190505050611345565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156106135780820151818401526020810190506105f8565b505050509050019250505060405180910390f35b34801561063357600080fd5b50610652600480360381019080803590602001909291905050506114b6565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561069557808201518184015260208101905061067a565b505050509050019250505060405180910390f35b3480156106b557600080fd5b506106be6116f3565b6040518082815260200191505060405180910390f35b3480156106e057600080fd5b506106ff600480360381019080803590602001909291905050506116f9565b005b34801561070d57600080fd5b5061072c600480360381019080803590602001909291905050506117ab565b005b34801561073a57600080fd5b506107bf600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050611984565b6040518082815260200191505060405180910390f35b3480156107e157600080fd5b506107ea6119a3565b6040518082815260200191505060405180910390f35b34801561080c57600080fd5b506108156119a8565b6040518082815260200191505060405180910390f35b34801561083757600080fd5b5061088c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119ae565b005b34801561089a57600080fd5b506108b960048036038101908080359060200190929190505050611cc1565b005b6003818154811015156108ca57fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561093557600080fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561098e57600080fd5b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600091505b600160038054905003821015610b13578273ffffffffffffffffffffffffffffffffffffffff16600383815481101515610a2157fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610b06576003600160038054905003815481101515610a7f57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600383815481101515610ab957fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610b13565b81806001019250506109eb565b6001600381818054905003915081610b2b9190611fc7565b506003805490506004541115610b4a57610b496003805490506116f9565b5b8273ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a2505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610beb57600080fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610c5657600080fd5b8360008082815260200190815260200160002060030160009054906101000a900460ff1615610c8457600080fd5b60006001600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e960405160405180910390a35050505050565b60026020528060005260406000206000915054906101000a900460ff1681565b60016020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b600080600090505b600554811015610e1257838015610dc6575060008082815260200190815260200160002060030160009054906101000a900460ff16155b80610df95750828015610df8575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b15610e05576001820191505b8080600101915050610d8f565b5092915050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e5357600080fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610eab57600080fd5b8160008173ffffffffffffffffffffffffffffffffffffffff161415610ed057600080fd5b6001600380549050016004546032821180610eea57508181115b80610ef55750600081145b80610f005750600082145b15610f0a57600080fd5b6001600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060038590806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508473ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b6000806000809150600090505b6003805490508110156110ef5760016000858152602001908152602001600020600060038381548110151561105057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156110cf576001820191505b6004548214156110e257600192506110f0565b808060010191505061101f565b5b5050919050565b600080600090505b6003805490508110156111bc5760016000848152602001908152602001600020600060038381548110151561113057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156111af576001820191505b80806001019150506110ff565b50919050565b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806001015490806002018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561129a5780601f1061126f5761010080835404028352916020019161129a565b820191906000526020600020905b81548152906001019060200180831161127d57829003601f168201915b5050505050908060030160009054906101000a900460ff16905084565b6060600380548060200260200160405190810160405280929190818152602001828054801561133b57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116112f1575b5050505050905090565b60608060008060055460405190808252806020026020018201604052801561137c5781602001602082028038833980820191505090505b50925060009150600090505b600554811015611428578580156113bf575060008082815260200190815260200160002060030160009054906101000a900460ff16155b806113f257508480156113f1575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b1561141b5780838381518110151561140657fe5b90602001906020020181815250506001820191505b8080600101915050611388565b8787036040519080825280602002602001820160405280156114595781602001602082028038833980820191505090505b5093508790505b868110156114ab57828181518110151561147657fe5b906020019060200201518489830381518110151561149057fe5b90602001906020020181815250508080600101915050611460565b505050949350505050565b6060806000806003805490506040519080825280602002602001820160405280156114f05781602001602082028038833980820191505090505b50925060009150600090505b60038054905081101561163d5760016000868152602001908152602001600020600060038381548110151561152d57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611630576003818154811015156115b457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683838151811015156115ed57fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001820191505b80806001019150506114fc565b8160405190808252806020026020018201604052801561166c5781602001602082028038833980820191505090505b509350600090505b818110156116eb57828181518110151561168a57fe5b9060200190602002015184828151811015156116a257fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050611674565b505050919050565b60055481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561173357600080fd5b60038054905081603282118061174857508181115b806117535750600081145b8061175e5750600082145b1561176857600080fd5b826004819055507fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a836040518082815260200191505060405180910390a1505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561180457600080fd5b81600080600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561185e57600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156118c857600080fd5b600180600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef60405160405180910390a361197d85611cc1565b5050505050565b6000611991848484611e77565b905061199c816117ab565b9392505050565b603281565b60045481565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156119ea57600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611a4357600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611a9b57600080fd5b600092505b600380549050831015611b84578473ffffffffffffffffffffffffffffffffffffffff16600384815481101515611ad357fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611b775783600384815481101515611b2a57fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611b84565b8280600101935050611aa0565b6000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508473ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a28373ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b60008160008082815260200190815260200160002060030160009054906101000a900460ff1615611cf157600080fd5b611cfa83611012565b15611e7257600080848152602001908152602001600020915060018260030160006101000a81548160ff0219169083151502179055508160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168260010154836002016040518082805460018160011615610100020316600290048015611dd95780601f10611dae57610100808354040283529160200191611dd9565b820191906000526020600020905b815481529060010190602001808311611dbc57829003601f168201915b505091505060006040518083038185875af19250505015611e2657827f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a2611e71565b827f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260008260030160006101000a81548160ff0219169083151502179055505b5b505050565b60008360008173ffffffffffffffffffffffffffffffffffffffff161415611e9e57600080fd5b60055491506080604051908101604052808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020016000151581525060008084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101556040820151816002019080519060200190611f5d929190611ff3565b5060608201518160030160006101000a81548160ff0219169083151502179055509050506001600560008282540192505081905550817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a2509392505050565b815481835581811115611fee57818360005260206000209182019101611fed9190612073565b5b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061203457805160ff1916838001178555612062565b82800160010185558215612062579182015b82811115612061578251825591602001919060010190612046565b5b50905061206f9190612073565b5090565b61209591905b80821115612091576000816000905550600101612079565b5090565b905600a165627a7a723058207800b1106b9c71e8a3e2369242d49547e78fd5ea65974850f4a1feca5658efbd0029",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH3 0x11 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x40 MLOAD PUSH3 0x2385 CODESIZE SUB DUP1 PUSH3 0x2385 DUP4 CODECOPY DUP2 ADD DUP1 PUSH1 0x40 MSTORE DUP2 ADD SWAP1 DUP1 DUP1 MLOAD DUP3 ADD SWAP3 SWAP2 SWAP1 PUSH1 0x20 ADD DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH1 0x0 DUP3 MLOAD DUP3 PUSH1 0x32 DUP3 GT DUP1 PUSH3 0x57 JUMPI POP DUP2 DUP2 GT JUMPDEST DUP1 PUSH3 0x63 JUMPI POP PUSH1 0x0 DUP2 EQ JUMPDEST DUP1 PUSH3 0x6F JUMPI POP PUSH1 0x0 DUP3 EQ JUMPDEST ISZERO PUSH3 0x7A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 SWAP3 POP JUMPDEST DUP5 MLOAD DUP4 LT ISZERO PUSH3 0x1B1 JUMPI PUSH1 0x2 PUSH1 0x0 DUP7 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH3 0x9C JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND DUP1 PUSH3 0x128 JUMPI POP PUSH1 0x0 DUP6 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH3 0x106 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ JUMPDEST ISZERO PUSH3 0x133 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x1 PUSH1 0x2 PUSH1 0x0 DUP8 DUP7 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH3 0x148 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP DUP3 DUP1 PUSH1 0x1 ADD SWAP4 POP POP PUSH3 0x7F JUMP JUMPDEST DUP5 PUSH1 0x3 SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH3 0x1C9 SWAP3 SWAP2 SWAP1 PUSH3 0x1DC JUMP JUMPDEST POP DUP4 PUSH1 0x4 DUP2 SWAP1 SSTORE POP POP POP POP POP POP PUSH3 0x2B1 JUMP JUMPDEST DUP3 DUP1 SLOAD DUP3 DUP3 SSTORE SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 DUP2 ADD SWAP3 DUP3 ISZERO PUSH3 0x258 JUMPI SWAP2 PUSH1 0x20 MUL DUP3 ADD JUMPDEST DUP3 DUP2 GT ISZERO PUSH3 0x257 JUMPI DUP3 MLOAD DUP3 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP SWAP2 PUSH1 0x20 ADD SWAP2 SWAP1 PUSH1 0x1 ADD SWAP1 PUSH3 0x1FD JUMP JUMPDEST JUMPDEST POP SWAP1 POP PUSH3 0x267 SWAP2 SWAP1 PUSH3 0x26B JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST PUSH3 0x2AE SWAP2 SWAP1 JUMPDEST DUP1 DUP3 GT ISZERO PUSH3 0x2AA JUMPI PUSH1 0x0 DUP2 DUP2 PUSH2 0x100 EXP DUP2 SLOAD SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 SSTORE POP PUSH1 0x1 ADD PUSH3 0x272 JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST SWAP1 JUMP JUMPDEST PUSH2 0x20C4 DUP1 PUSH3 0x2C1 PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN STOP PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x11D JUMPI PUSH1 0x0 CALLDATALOAD PUSH29 0x100000000000000000000000000000000000000000000000000000000 SWAP1 DIV PUSH4 0xFFFFFFFF AND DUP1 PUSH4 0x25E7C27 EQ PUSH2 0x177 JUMPI DUP1 PUSH4 0x173825D9 EQ PUSH2 0x1E4 JUMPI DUP1 PUSH4 0x20EA8D86 EQ PUSH2 0x227 JUMPI DUP1 PUSH4 0x2F54BF6E EQ PUSH2 0x254 JUMPI DUP1 PUSH4 0x3411C81C EQ PUSH2 0x2AF JUMPI DUP1 PUSH4 0x54741525 EQ PUSH2 0x314 JUMPI DUP1 PUSH4 0x7065CB48 EQ PUSH2 0x363 JUMPI DUP1 PUSH4 0x784547A7 EQ PUSH2 0x3A6 JUMPI DUP1 PUSH4 0x8B51D13F EQ PUSH2 0x3EB JUMPI DUP1 PUSH4 0x9ACE38C2 EQ PUSH2 0x42C JUMPI DUP1 PUSH4 0xA0E67E2B EQ PUSH2 0x517 JUMPI DUP1 PUSH4 0xA8ABE69A EQ PUSH2 0x583 JUMPI DUP1 PUSH4 0xB5DC40C3 EQ PUSH2 0x627 JUMPI DUP1 PUSH4 0xB77BF600 EQ PUSH2 0x6A9 JUMPI DUP1 PUSH4 0xBA51A6DF EQ PUSH2 0x6D4 JUMPI DUP1 PUSH4 0xC01A8C84 EQ PUSH2 0x701 JUMPI DUP1 PUSH4 0xC6427474 EQ PUSH2 0x72E JUMPI DUP1 PUSH4 0xD74F8EDD EQ PUSH2 0x7D5 JUMPI DUP1 PUSH4 0xDC8452CD EQ PUSH2 0x800 JUMPI DUP1 PUSH4 0xE20056E6 EQ PUSH2 0x82B JUMPI DUP1 PUSH4 0xEE22610B EQ PUSH2 0x88E JUMPI JUMPDEST PUSH1 0x0 CALLVALUE GT ISZERO PUSH2 0x175 JUMPI CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xE1FFFCC4923D04B559F4D29A8BFC6CDA04EB5B0D3C460751C2402C5C5CC9109C CALLVALUE PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x183 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1A2 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x8BB JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1F0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x225 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x8F9 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x233 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x252 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xB92 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x260 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x295 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xD38 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2BB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2FA PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xD58 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x320 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x34D PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD ISZERO ISZERO SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD ISZERO ISZERO SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xD87 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x36F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x3A4 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xE19 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3B2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x3D1 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1012 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3F7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x416 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x10F7 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x438 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x457 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x11C2 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP5 DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP4 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE DUP5 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x4D9 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x4BE JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x506 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP6 POP POP POP POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x523 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x52C PUSH2 0x12B7 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE DUP4 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x56F JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x554 JUMP JUMPDEST POP POP POP POP SWAP1 POP ADD SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x58F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x5D0 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD ISZERO ISZERO SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD ISZERO ISZERO SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1345 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE DUP4 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x613 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x5F8 JUMP JUMPDEST POP POP POP POP SWAP1 POP ADD SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x633 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x652 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x14B6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE DUP4 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x695 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x67A JUMP JUMPDEST POP POP POP POP SWAP1 POP ADD SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x6B5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x6BE PUSH2 0x16F3 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x6E0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x6FF PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x16F9 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x70D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x72C PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x17AB JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x73A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x7BF PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 POP POP POP PUSH2 0x1984 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x7E1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x7EA PUSH2 0x19A3 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x80C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x815 PUSH2 0x19A8 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x837 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x88C PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x19AE JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x89A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x8B9 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1CC1 JUMP JUMPDEST STOP JUMPDEST PUSH1 0x3 DUP2 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x8CA JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP2 POP SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 ADDRESS PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x935 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 PUSH1 0x2 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO ISZERO PUSH2 0x98E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH1 0x2 PUSH1 0x0 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP PUSH1 0x0 SWAP2 POP JUMPDEST PUSH1 0x1 PUSH1 0x3 DUP1 SLOAD SWAP1 POP SUB DUP3 LT ISZERO PUSH2 0xB13 JUMPI DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x3 DUP4 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0xA21 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0xB06 JUMPI PUSH1 0x3 PUSH1 0x1 PUSH1 0x3 DUP1 SLOAD SWAP1 POP SUB DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0xA7F JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x3 DUP4 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0xAB9 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH2 0xB13 JUMP JUMPDEST DUP2 DUP1 PUSH1 0x1 ADD SWAP3 POP POP PUSH2 0x9EB JUMP JUMPDEST PUSH1 0x1 PUSH1 0x3 DUP2 DUP2 DUP1 SLOAD SWAP1 POP SUB SWAP2 POP DUP2 PUSH2 0xB2B SWAP2 SWAP1 PUSH2 0x1FC7 JUMP JUMPDEST POP PUSH1 0x3 DUP1 SLOAD SWAP1 POP PUSH1 0x4 SLOAD GT ISZERO PUSH2 0xB4A JUMPI PUSH2 0xB49 PUSH1 0x3 DUP1 SLOAD SWAP1 POP PUSH2 0x16F9 JUMP JUMPDEST JUMPDEST DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x8001553A916EF2F495D26A907CC54D96ED840D7BDA71E73194BF5A9DF7A76B90 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 POP POP POP JUMP JUMPDEST CALLER PUSH1 0x2 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO ISZERO PUSH2 0xBEB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLER PUSH1 0x1 PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO ISZERO PUSH2 0xC56 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP4 PUSH1 0x0 DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0xC84 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH1 0x1 PUSH1 0x0 DUP8 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP DUP5 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xF6A317157440607F36269043EB55F1287A5A19BA2216AFEAB88CD46CBCFB88E9 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x2 PUSH1 0x20 MSTORE DUP1 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP2 POP SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x20 MSTORE DUP2 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x20 MSTORE DUP1 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP2 POP SWAP2 POP SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 POP JUMPDEST PUSH1 0x5 SLOAD DUP2 LT ISZERO PUSH2 0xE12 JUMPI DUP4 DUP1 ISZERO PUSH2 0xDC6 JUMPI POP PUSH1 0x0 DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO JUMPDEST DUP1 PUSH2 0xDF9 JUMPI POP DUP3 DUP1 ISZERO PUSH2 0xDF8 JUMPI POP PUSH1 0x0 DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND JUMPDEST JUMPDEST ISZERO PUSH2 0xE05 JUMPI PUSH1 0x1 DUP3 ADD SWAP2 POP JUMPDEST DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0xD8F JUMP JUMPDEST POP SWAP3 SWAP2 POP POP JUMP JUMPDEST ADDRESS PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0xE53 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 PUSH1 0x2 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0xEAB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 PUSH1 0x0 DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0xED0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x1 PUSH1 0x3 DUP1 SLOAD SWAP1 POP ADD PUSH1 0x4 SLOAD PUSH1 0x32 DUP3 GT DUP1 PUSH2 0xEEA JUMPI POP DUP2 DUP2 GT JUMPDEST DUP1 PUSH2 0xEF5 JUMPI POP PUSH1 0x0 DUP2 EQ JUMPDEST DUP1 PUSH2 0xF00 JUMPI POP PUSH1 0x0 DUP3 EQ JUMPDEST ISZERO PUSH2 0xF0A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x1 PUSH1 0x2 PUSH1 0x0 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP PUSH1 0x3 DUP6 SWAP1 DUP1 PUSH1 0x1 DUP2 SLOAD ADD DUP1 DUP3 SSTORE DUP1 SWAP2 POP POP SWAP1 PUSH1 0x1 DUP3 SUB SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SWAP2 SWAP3 SWAP1 SWAP2 SWAP1 SWAP2 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP POP DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xF39E6E1EB0EDCF53C221607B54B00CD28F3196FED0A24994DC308B8F611B682D PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 SWAP2 POP PUSH1 0x0 SWAP1 POP JUMPDEST PUSH1 0x3 DUP1 SLOAD SWAP1 POP DUP2 LT ISZERO PUSH2 0x10EF JUMPI PUSH1 0x1 PUSH1 0x0 DUP6 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH1 0x3 DUP4 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1050 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0x10CF JUMPI PUSH1 0x1 DUP3 ADD SWAP2 POP JUMPDEST PUSH1 0x4 SLOAD DUP3 EQ ISZERO PUSH2 0x10E2 JUMPI PUSH1 0x1 SWAP3 POP PUSH2 0x10F0 JUMP JUMPDEST DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0x101F JUMP JUMPDEST JUMPDEST POP POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 POP JUMPDEST PUSH1 0x3 DUP1 SLOAD SWAP1 POP DUP2 LT ISZERO PUSH2 0x11BC JUMPI PUSH1 0x1 PUSH1 0x0 DUP5 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH1 0x3 DUP4 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1130 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0x11AF JUMPI PUSH1 0x1 DUP3 ADD SWAP2 POP JUMPDEST DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0x10FF JUMP JUMPDEST POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 MSTORE DUP1 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP2 POP SWAP1 POP DUP1 PUSH1 0x0 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 DUP1 PUSH1 0x1 ADD SLOAD SWAP1 DUP1 PUSH1 0x2 ADD DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x129A JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x126F JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x129A JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x127D JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP1 DUP1 PUSH1 0x3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND SWAP1 POP DUP5 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x3 DUP1 SLOAD DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD DUP1 ISZERO PUSH2 0x133B JUMPI PUSH1 0x20 MUL DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 PUSH1 0x1 ADD SWAP1 DUP1 DUP4 GT PUSH2 0x12F1 JUMPI JUMPDEST POP POP POP POP POP SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x60 DUP1 PUSH1 0x0 DUP1 PUSH1 0x5 SLOAD PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x137C JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CODESIZE DUP4 CODECOPY DUP1 DUP3 ADD SWAP2 POP POP SWAP1 POP JUMPDEST POP SWAP3 POP PUSH1 0x0 SWAP2 POP PUSH1 0x0 SWAP1 POP JUMPDEST PUSH1 0x5 SLOAD DUP2 LT ISZERO PUSH2 0x1428 JUMPI DUP6 DUP1 ISZERO PUSH2 0x13BF JUMPI POP PUSH1 0x0 DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO JUMPDEST DUP1 PUSH2 0x13F2 JUMPI POP DUP5 DUP1 ISZERO PUSH2 0x13F1 JUMPI POP PUSH1 0x0 DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND JUMPDEST JUMPDEST ISZERO PUSH2 0x141B JUMPI DUP1 DUP4 DUP4 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1406 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD DUP2 DUP2 MSTORE POP POP PUSH1 0x1 DUP3 ADD SWAP2 POP JUMPDEST DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0x1388 JUMP JUMPDEST DUP8 DUP8 SUB PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x1459 JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CODESIZE DUP4 CODECOPY DUP1 DUP3 ADD SWAP2 POP POP SWAP1 POP JUMPDEST POP SWAP4 POP DUP8 SWAP1 POP JUMPDEST DUP7 DUP2 LT ISZERO PUSH2 0x14AB JUMPI DUP3 DUP2 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1476 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP5 DUP10 DUP4 SUB DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1490 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD DUP2 DUP2 MSTORE POP POP DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0x1460 JUMP JUMPDEST POP POP POP SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x60 DUP1 PUSH1 0x0 DUP1 PUSH1 0x3 DUP1 SLOAD SWAP1 POP PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x14F0 JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CODESIZE DUP4 CODECOPY DUP1 DUP3 ADD SWAP2 POP POP SWAP1 POP JUMPDEST POP SWAP3 POP PUSH1 0x0 SWAP2 POP PUSH1 0x0 SWAP1 POP JUMPDEST PUSH1 0x3 DUP1 SLOAD SWAP1 POP DUP2 LT ISZERO PUSH2 0x163D JUMPI PUSH1 0x1 PUSH1 0x0 DUP7 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH1 0x3 DUP4 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x152D JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0x1630 JUMPI PUSH1 0x3 DUP2 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x15B4 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP4 DUP4 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x15ED JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE POP POP PUSH1 0x1 DUP3 ADD SWAP2 POP JUMPDEST DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0x14FC JUMP JUMPDEST DUP2 PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x166C JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CODESIZE DUP4 CODECOPY DUP1 DUP3 ADD SWAP2 POP POP SWAP1 POP JUMPDEST POP SWAP4 POP PUSH1 0x0 SWAP1 POP JUMPDEST DUP2 DUP2 LT ISZERO PUSH2 0x16EB JUMPI DUP3 DUP2 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x168A JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP5 DUP3 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x16A2 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE POP POP DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0x1674 JUMP JUMPDEST POP POP POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x5 SLOAD DUP2 JUMP JUMPDEST ADDRESS PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x1733 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x3 DUP1 SLOAD SWAP1 POP DUP2 PUSH1 0x32 DUP3 GT DUP1 PUSH2 0x1748 JUMPI POP DUP2 DUP2 GT JUMPDEST DUP1 PUSH2 0x1753 JUMPI POP PUSH1 0x0 DUP2 EQ JUMPDEST DUP1 PUSH2 0x175E JUMPI POP PUSH1 0x0 DUP3 EQ JUMPDEST ISZERO PUSH2 0x1768 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 PUSH1 0x4 DUP2 SWAP1 SSTORE POP PUSH32 0xA3F1EE9126A074D9326C682F561767F710E927FAA811F7A99829D49DC421797A DUP4 PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG1 POP POP POP JUMP JUMPDEST CALLER PUSH1 0x2 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO ISZERO PUSH2 0x1804 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 PUSH1 0x0 DUP1 PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0x185E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 CALLER PUSH1 0x1 PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0x18C8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x1 DUP1 PUSH1 0x0 DUP8 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP DUP5 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x4A504A94899432A9846E1AA406DCEB1BCFD538BB839071D49D1E5E23F5BE30EF PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH2 0x197D DUP6 PUSH2 0x1CC1 JUMP JUMPDEST POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x1991 DUP5 DUP5 DUP5 PUSH2 0x1E77 JUMP JUMPDEST SWAP1 POP PUSH2 0x199C DUP2 PUSH2 0x17AB JUMP JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x32 DUP2 JUMP JUMPDEST PUSH1 0x4 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 ADDRESS PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x19EA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 PUSH1 0x2 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO ISZERO PUSH2 0x1A43 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 PUSH1 0x2 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0x1A9B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 SWAP3 POP JUMPDEST PUSH1 0x3 DUP1 SLOAD SWAP1 POP DUP4 LT ISZERO PUSH2 0x1B84 JUMPI DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x3 DUP5 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1AD3 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0x1B77 JUMPI DUP4 PUSH1 0x3 DUP5 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1B2A JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH2 0x1B84 JUMP JUMPDEST DUP3 DUP1 PUSH1 0x1 ADD SWAP4 POP POP PUSH2 0x1AA0 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x2 PUSH1 0x0 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP PUSH1 0x1 PUSH1 0x2 PUSH1 0x0 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x8001553A916EF2F495D26A907CC54D96ED840D7BDA71E73194BF5A9DF7A76B90 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xF39E6E1EB0EDCF53C221607B54B00CD28F3196FED0A24994DC308B8F611B682D PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x0 DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0x1CF1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1CFA DUP4 PUSH2 0x1012 JUMP JUMPDEST ISZERO PUSH2 0x1E72 JUMPI PUSH1 0x0 DUP1 DUP5 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SWAP2 POP PUSH1 0x1 DUP3 PUSH1 0x3 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP DUP2 PUSH1 0x0 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP3 PUSH1 0x1 ADD SLOAD DUP4 PUSH1 0x2 ADD PUSH1 0x40 MLOAD DUP1 DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x1DD9 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x1DAE JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x1DD9 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x1DBC JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP SWAP2 POP POP PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP6 DUP8 GAS CALL SWAP3 POP POP POP ISZERO PUSH2 0x1E26 JUMPI DUP3 PUSH32 0x33E13ECB54C3076D8E8BB8C2881800A4D972B792045FFAE98FDF46DF365FED75 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 PUSH2 0x1E71 JUMP JUMPDEST DUP3 PUSH32 0x526441BB6C1ABA3C9A4A6CA1D6545DA9C2333C8C48343EF398EB858D72B79236 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 PUSH1 0x0 DUP3 PUSH1 0x3 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP JUMPDEST JUMPDEST POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP4 PUSH1 0x0 DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0x1E9E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x5 SLOAD SWAP2 POP PUSH1 0x80 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP6 DUP2 MSTORE PUSH1 0x20 ADD DUP5 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 ISZERO ISZERO DUP2 MSTORE POP PUSH1 0x0 DUP1 DUP5 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 ADD MLOAD DUP2 PUSH1 0x0 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH1 0x20 DUP3 ADD MLOAD DUP2 PUSH1 0x1 ADD SSTORE PUSH1 0x40 DUP3 ADD MLOAD DUP2 PUSH1 0x2 ADD SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH2 0x1F5D SWAP3 SWAP2 SWAP1 PUSH2 0x1FF3 JUMP JUMPDEST POP PUSH1 0x60 DUP3 ADD MLOAD DUP2 PUSH1 0x3 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP SWAP1 POP POP PUSH1 0x1 PUSH1 0x5 PUSH1 0x0 DUP3 DUP3 SLOAD ADD SWAP3 POP POP DUP2 SWAP1 SSTORE POP DUP2 PUSH32 0xC0BA8FE4B176C1714197D43B9CC6BCF797A4A7461C5FE8D0EF6E184AE7601E51 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST DUP2 SLOAD DUP2 DUP4 SSTORE DUP2 DUP2 GT ISZERO PUSH2 0x1FEE JUMPI DUP2 DUP4 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP2 DUP3 ADD SWAP2 ADD PUSH2 0x1FED SWAP2 SWAP1 PUSH2 0x2073 JUMP JUMPDEST JUMPDEST POP POP POP JUMP JUMPDEST DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 PUSH1 0x1F ADD PUSH1 0x20 SWAP1 DIV DUP2 ADD SWAP3 DUP3 PUSH1 0x1F LT PUSH2 0x2034 JUMPI DUP1 MLOAD PUSH1 0xFF NOT AND DUP4 DUP1 ADD OR DUP6 SSTORE PUSH2 0x2062 JUMP JUMPDEST DUP3 DUP1 ADD PUSH1 0x1 ADD DUP6 SSTORE DUP3 ISZERO PUSH2 0x2062 JUMPI SWAP2 DUP3 ADD JUMPDEST DUP3 DUP2 GT ISZERO PUSH2 0x2061 JUMPI DUP3 MLOAD DUP3 SSTORE SWAP2 PUSH1 0x20 ADD SWAP2 SWAP1 PUSH1 0x1 ADD SWAP1 PUSH2 0x2046 JUMP JUMPDEST JUMPDEST POP SWAP1 POP PUSH2 0x206F SWAP2 SWAP1 PUSH2 0x2073 JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST PUSH2 0x2095 SWAP2 SWAP1 JUMPDEST DUP1 DUP3 GT ISZERO PUSH2 0x2091 JUMPI PUSH1 0x0 DUP2 PUSH1 0x0 SWAP1 SSTORE POP PUSH1 0x1 ADD PUSH2 0x2079 JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST SWAP1 JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 PUSH25 0xB1106B9C71E8A3E2369242D49547E78FD5EA65974850F4A1 INVALID 0xca JUMP PC 0xef 0xbd STOP 0x29 ",
- "sourceMap": "186:11249:0:-;;;2814:370;8:9:-1;5:2;;;30:1;27;20:12;5:2;2814:370:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2959:6;2913:7;:14;2929:9;256:2;2236:10;:28;:66;;;;2292:10;2280:9;:22;2236:66;:96;;;;2331:1;2318:9;:14;2236:96;:127;;;;2362:1;2348:10;:15;2236:127;2229:153;;;2377:5;;;2229:153;2966:1;2959:8;;2954:168;2971:7;:14;2969:1;:16;2954:168;;;3010:7;:19;3018:7;3026:1;3018:10;;;;;;;;;;;;;;;;;;3010:19;;;;;;;;;;;;;;;;;;;;;;;;;:38;;;;3047:1;3033:7;3041:1;3033:10;;;;;;;;;;;;;;;;;;:15;;;3010:38;3006:65;;;3066:5;;;3006:65;3107:4;3085:7;:19;3093:7;3101:1;3093:10;;;;;;;;;;;;;;;;;;3085:19;;;;;;;;;;;;;;;;:26;;;;;;;;;;;;;;;;;;2987:3;;;;;;;2954:168;;;3140:7;3131:6;:16;;;;;;;;;;;;:::i;:::-;;3168:9;3157:8;:20;;;;2814:370;;;;;186:11249;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;"
- },
- "deployedBytecode": {
- "linkReferences": {},
- "object": "0x60806040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063025e7c2714610177578063173825d9146101e457806320ea8d86146102275780632f54bf6e146102545780633411c81c146102af57806354741525146103145780637065cb4814610363578063784547a7146103a65780638b51d13f146103eb5780639ace38c21461042c578063a0e67e2b14610517578063a8abe69a14610583578063b5dc40c314610627578063b77bf600146106a9578063ba51a6df146106d4578063c01a8c8414610701578063c64274741461072e578063d74f8edd146107d5578063dc8452cd14610800578063e20056e61461082b578063ee22610b1461088e575b6000341115610175573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a25b005b34801561018357600080fd5b506101a2600480360381019080803590602001909291905050506108bb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156101f057600080fd5b50610225600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108f9565b005b34801561023357600080fd5b5061025260048036038101908080359060200190929190505050610b92565b005b34801561026057600080fd5b50610295600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d38565b604051808215151515815260200191505060405180910390f35b3480156102bb57600080fd5b506102fa60048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d58565b604051808215151515815260200191505060405180910390f35b34801561032057600080fd5b5061034d600480360381019080803515159060200190929190803515159060200190929190505050610d87565b6040518082815260200191505060405180910390f35b34801561036f57600080fd5b506103a4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e19565b005b3480156103b257600080fd5b506103d160048036038101908080359060200190929190505050611012565b604051808215151515815260200191505060405180910390f35b3480156103f757600080fd5b50610416600480360381019080803590602001909291905050506110f7565b6040518082815260200191505060405180910390f35b34801561043857600080fd5b50610457600480360381019080803590602001909291905050506111c2565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018060200183151515158152602001828103825284818151815260200191508051906020019080838360005b838110156104d95780820151818401526020810190506104be565b50505050905090810190601f1680156105065780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b34801561052357600080fd5b5061052c6112b7565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561056f578082015181840152602081019050610554565b505050509050019250505060405180910390f35b34801561058f57600080fd5b506105d06004803603810190808035906020019092919080359060200190929190803515159060200190929190803515159060200190929190505050611345565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156106135780820151818401526020810190506105f8565b505050509050019250505060405180910390f35b34801561063357600080fd5b50610652600480360381019080803590602001909291905050506114b6565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561069557808201518184015260208101905061067a565b505050509050019250505060405180910390f35b3480156106b557600080fd5b506106be6116f3565b6040518082815260200191505060405180910390f35b3480156106e057600080fd5b506106ff600480360381019080803590602001909291905050506116f9565b005b34801561070d57600080fd5b5061072c600480360381019080803590602001909291905050506117ab565b005b34801561073a57600080fd5b506107bf600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050611984565b6040518082815260200191505060405180910390f35b3480156107e157600080fd5b506107ea6119a3565b6040518082815260200191505060405180910390f35b34801561080c57600080fd5b506108156119a8565b6040518082815260200191505060405180910390f35b34801561083757600080fd5b5061088c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119ae565b005b34801561089a57600080fd5b506108b960048036038101908080359060200190929190505050611cc1565b005b6003818154811015156108ca57fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561093557600080fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561098e57600080fd5b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600091505b600160038054905003821015610b13578273ffffffffffffffffffffffffffffffffffffffff16600383815481101515610a2157fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610b06576003600160038054905003815481101515610a7f57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600383815481101515610ab957fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610b13565b81806001019250506109eb565b6001600381818054905003915081610b2b9190611fc7565b506003805490506004541115610b4a57610b496003805490506116f9565b5b8273ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a2505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610beb57600080fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610c5657600080fd5b8360008082815260200190815260200160002060030160009054906101000a900460ff1615610c8457600080fd5b60006001600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e960405160405180910390a35050505050565b60026020528060005260406000206000915054906101000a900460ff1681565b60016020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b600080600090505b600554811015610e1257838015610dc6575060008082815260200190815260200160002060030160009054906101000a900460ff16155b80610df95750828015610df8575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b15610e05576001820191505b8080600101915050610d8f565b5092915050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e5357600080fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610eab57600080fd5b8160008173ffffffffffffffffffffffffffffffffffffffff161415610ed057600080fd5b6001600380549050016004546032821180610eea57508181115b80610ef55750600081145b80610f005750600082145b15610f0a57600080fd5b6001600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060038590806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508473ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b6000806000809150600090505b6003805490508110156110ef5760016000858152602001908152602001600020600060038381548110151561105057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156110cf576001820191505b6004548214156110e257600192506110f0565b808060010191505061101f565b5b5050919050565b600080600090505b6003805490508110156111bc5760016000848152602001908152602001600020600060038381548110151561113057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156111af576001820191505b80806001019150506110ff565b50919050565b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806001015490806002018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561129a5780601f1061126f5761010080835404028352916020019161129a565b820191906000526020600020905b81548152906001019060200180831161127d57829003601f168201915b5050505050908060030160009054906101000a900460ff16905084565b6060600380548060200260200160405190810160405280929190818152602001828054801561133b57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116112f1575b5050505050905090565b60608060008060055460405190808252806020026020018201604052801561137c5781602001602082028038833980820191505090505b50925060009150600090505b600554811015611428578580156113bf575060008082815260200190815260200160002060030160009054906101000a900460ff16155b806113f257508480156113f1575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b1561141b5780838381518110151561140657fe5b90602001906020020181815250506001820191505b8080600101915050611388565b8787036040519080825280602002602001820160405280156114595781602001602082028038833980820191505090505b5093508790505b868110156114ab57828181518110151561147657fe5b906020019060200201518489830381518110151561149057fe5b90602001906020020181815250508080600101915050611460565b505050949350505050565b6060806000806003805490506040519080825280602002602001820160405280156114f05781602001602082028038833980820191505090505b50925060009150600090505b60038054905081101561163d5760016000868152602001908152602001600020600060038381548110151561152d57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611630576003818154811015156115b457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683838151811015156115ed57fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001820191505b80806001019150506114fc565b8160405190808252806020026020018201604052801561166c5781602001602082028038833980820191505090505b509350600090505b818110156116eb57828181518110151561168a57fe5b9060200190602002015184828151811015156116a257fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050611674565b505050919050565b60055481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561173357600080fd5b60038054905081603282118061174857508181115b806117535750600081145b8061175e5750600082145b1561176857600080fd5b826004819055507fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a836040518082815260200191505060405180910390a1505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561180457600080fd5b81600080600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561185e57600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156118c857600080fd5b600180600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef60405160405180910390a361197d85611cc1565b5050505050565b6000611991848484611e77565b905061199c816117ab565b9392505050565b603281565b60045481565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156119ea57600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611a4357600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611a9b57600080fd5b600092505b600380549050831015611b84578473ffffffffffffffffffffffffffffffffffffffff16600384815481101515611ad357fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611b775783600384815481101515611b2a57fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611b84565b8280600101935050611aa0565b6000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508473ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a28373ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b60008160008082815260200190815260200160002060030160009054906101000a900460ff1615611cf157600080fd5b611cfa83611012565b15611e7257600080848152602001908152602001600020915060018260030160006101000a81548160ff0219169083151502179055508160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168260010154836002016040518082805460018160011615610100020316600290048015611dd95780601f10611dae57610100808354040283529160200191611dd9565b820191906000526020600020905b815481529060010190602001808311611dbc57829003601f168201915b505091505060006040518083038185875af19250505015611e2657827f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a2611e71565b827f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260008260030160006101000a81548160ff0219169083151502179055505b5b505050565b60008360008173ffffffffffffffffffffffffffffffffffffffff161415611e9e57600080fd5b60055491506080604051908101604052808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020016000151581525060008084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101556040820151816002019080519060200190611f5d929190611ff3565b5060608201518160030160006101000a81548160ff0219169083151502179055509050506001600560008282540192505081905550817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a2509392505050565b815481835581811115611fee57818360005260206000209182019101611fed9190612073565b5b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061203457805160ff1916838001178555612062565b82800160010185558215612062579182015b82811115612061578251825591602001919060010190612046565b5b50905061206f9190612073565b5090565b61209591905b80821115612091576000816000905550600101612079565b5090565b905600a165627a7a723058207800b1106b9c71e8a3e2369242d49547e78fd5ea65974850f4a1feca5658efbd0029",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x11D JUMPI PUSH1 0x0 CALLDATALOAD PUSH29 0x100000000000000000000000000000000000000000000000000000000 SWAP1 DIV PUSH4 0xFFFFFFFF AND DUP1 PUSH4 0x25E7C27 EQ PUSH2 0x177 JUMPI DUP1 PUSH4 0x173825D9 EQ PUSH2 0x1E4 JUMPI DUP1 PUSH4 0x20EA8D86 EQ PUSH2 0x227 JUMPI DUP1 PUSH4 0x2F54BF6E EQ PUSH2 0x254 JUMPI DUP1 PUSH4 0x3411C81C EQ PUSH2 0x2AF JUMPI DUP1 PUSH4 0x54741525 EQ PUSH2 0x314 JUMPI DUP1 PUSH4 0x7065CB48 EQ PUSH2 0x363 JUMPI DUP1 PUSH4 0x784547A7 EQ PUSH2 0x3A6 JUMPI DUP1 PUSH4 0x8B51D13F EQ PUSH2 0x3EB JUMPI DUP1 PUSH4 0x9ACE38C2 EQ PUSH2 0x42C JUMPI DUP1 PUSH4 0xA0E67E2B EQ PUSH2 0x517 JUMPI DUP1 PUSH4 0xA8ABE69A EQ PUSH2 0x583 JUMPI DUP1 PUSH4 0xB5DC40C3 EQ PUSH2 0x627 JUMPI DUP1 PUSH4 0xB77BF600 EQ PUSH2 0x6A9 JUMPI DUP1 PUSH4 0xBA51A6DF EQ PUSH2 0x6D4 JUMPI DUP1 PUSH4 0xC01A8C84 EQ PUSH2 0x701 JUMPI DUP1 PUSH4 0xC6427474 EQ PUSH2 0x72E JUMPI DUP1 PUSH4 0xD74F8EDD EQ PUSH2 0x7D5 JUMPI DUP1 PUSH4 0xDC8452CD EQ PUSH2 0x800 JUMPI DUP1 PUSH4 0xE20056E6 EQ PUSH2 0x82B JUMPI DUP1 PUSH4 0xEE22610B EQ PUSH2 0x88E JUMPI JUMPDEST PUSH1 0x0 CALLVALUE GT ISZERO PUSH2 0x175 JUMPI CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xE1FFFCC4923D04B559F4D29A8BFC6CDA04EB5B0D3C460751C2402C5C5CC9109C CALLVALUE PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x183 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1A2 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x8BB JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1F0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x225 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x8F9 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x233 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x252 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xB92 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x260 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x295 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xD38 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2BB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2FA PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xD58 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x320 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x34D PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD ISZERO ISZERO SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD ISZERO ISZERO SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xD87 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x36F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x3A4 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xE19 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3B2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x3D1 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1012 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3F7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x416 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x10F7 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x438 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x457 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x11C2 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP5 DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP4 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE DUP5 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x4D9 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x4BE JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x506 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP6 POP POP POP POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x523 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x52C PUSH2 0x12B7 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE DUP4 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x56F JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x554 JUMP JUMPDEST POP POP POP POP SWAP1 POP ADD SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x58F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x5D0 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD ISZERO ISZERO SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD ISZERO ISZERO SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1345 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE DUP4 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x613 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x5F8 JUMP JUMPDEST POP POP POP POP SWAP1 POP ADD SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x633 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x652 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x14B6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE DUP4 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x695 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x67A JUMP JUMPDEST POP POP POP POP SWAP1 POP ADD SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x6B5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x6BE PUSH2 0x16F3 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x6E0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x6FF PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x16F9 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x70D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x72C PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x17AB JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x73A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x7BF PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 POP POP POP PUSH2 0x1984 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x7E1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x7EA PUSH2 0x19A3 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x80C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x815 PUSH2 0x19A8 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x837 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x88C PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x19AE JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x89A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x8B9 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1CC1 JUMP JUMPDEST STOP JUMPDEST PUSH1 0x3 DUP2 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x8CA JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP2 POP SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 ADDRESS PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x935 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 PUSH1 0x2 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO ISZERO PUSH2 0x98E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH1 0x2 PUSH1 0x0 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP PUSH1 0x0 SWAP2 POP JUMPDEST PUSH1 0x1 PUSH1 0x3 DUP1 SLOAD SWAP1 POP SUB DUP3 LT ISZERO PUSH2 0xB13 JUMPI DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x3 DUP4 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0xA21 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0xB06 JUMPI PUSH1 0x3 PUSH1 0x1 PUSH1 0x3 DUP1 SLOAD SWAP1 POP SUB DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0xA7F JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x3 DUP4 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0xAB9 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH2 0xB13 JUMP JUMPDEST DUP2 DUP1 PUSH1 0x1 ADD SWAP3 POP POP PUSH2 0x9EB JUMP JUMPDEST PUSH1 0x1 PUSH1 0x3 DUP2 DUP2 DUP1 SLOAD SWAP1 POP SUB SWAP2 POP DUP2 PUSH2 0xB2B SWAP2 SWAP1 PUSH2 0x1FC7 JUMP JUMPDEST POP PUSH1 0x3 DUP1 SLOAD SWAP1 POP PUSH1 0x4 SLOAD GT ISZERO PUSH2 0xB4A JUMPI PUSH2 0xB49 PUSH1 0x3 DUP1 SLOAD SWAP1 POP PUSH2 0x16F9 JUMP JUMPDEST JUMPDEST DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x8001553A916EF2F495D26A907CC54D96ED840D7BDA71E73194BF5A9DF7A76B90 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 POP POP POP JUMP JUMPDEST CALLER PUSH1 0x2 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO ISZERO PUSH2 0xBEB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLER PUSH1 0x1 PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO ISZERO PUSH2 0xC56 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP4 PUSH1 0x0 DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0xC84 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH1 0x1 PUSH1 0x0 DUP8 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP DUP5 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xF6A317157440607F36269043EB55F1287A5A19BA2216AFEAB88CD46CBCFB88E9 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x2 PUSH1 0x20 MSTORE DUP1 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP2 POP SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x20 MSTORE DUP2 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x20 MSTORE DUP1 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP2 POP SWAP2 POP SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 POP JUMPDEST PUSH1 0x5 SLOAD DUP2 LT ISZERO PUSH2 0xE12 JUMPI DUP4 DUP1 ISZERO PUSH2 0xDC6 JUMPI POP PUSH1 0x0 DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO JUMPDEST DUP1 PUSH2 0xDF9 JUMPI POP DUP3 DUP1 ISZERO PUSH2 0xDF8 JUMPI POP PUSH1 0x0 DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND JUMPDEST JUMPDEST ISZERO PUSH2 0xE05 JUMPI PUSH1 0x1 DUP3 ADD SWAP2 POP JUMPDEST DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0xD8F JUMP JUMPDEST POP SWAP3 SWAP2 POP POP JUMP JUMPDEST ADDRESS PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0xE53 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 PUSH1 0x2 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0xEAB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 PUSH1 0x0 DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0xED0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x1 PUSH1 0x3 DUP1 SLOAD SWAP1 POP ADD PUSH1 0x4 SLOAD PUSH1 0x32 DUP3 GT DUP1 PUSH2 0xEEA JUMPI POP DUP2 DUP2 GT JUMPDEST DUP1 PUSH2 0xEF5 JUMPI POP PUSH1 0x0 DUP2 EQ JUMPDEST DUP1 PUSH2 0xF00 JUMPI POP PUSH1 0x0 DUP3 EQ JUMPDEST ISZERO PUSH2 0xF0A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x1 PUSH1 0x2 PUSH1 0x0 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP PUSH1 0x3 DUP6 SWAP1 DUP1 PUSH1 0x1 DUP2 SLOAD ADD DUP1 DUP3 SSTORE DUP1 SWAP2 POP POP SWAP1 PUSH1 0x1 DUP3 SUB SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SWAP2 SWAP3 SWAP1 SWAP2 SWAP1 SWAP2 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP POP DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xF39E6E1EB0EDCF53C221607B54B00CD28F3196FED0A24994DC308B8F611B682D PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 SWAP2 POP PUSH1 0x0 SWAP1 POP JUMPDEST PUSH1 0x3 DUP1 SLOAD SWAP1 POP DUP2 LT ISZERO PUSH2 0x10EF JUMPI PUSH1 0x1 PUSH1 0x0 DUP6 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH1 0x3 DUP4 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1050 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0x10CF JUMPI PUSH1 0x1 DUP3 ADD SWAP2 POP JUMPDEST PUSH1 0x4 SLOAD DUP3 EQ ISZERO PUSH2 0x10E2 JUMPI PUSH1 0x1 SWAP3 POP PUSH2 0x10F0 JUMP JUMPDEST DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0x101F JUMP JUMPDEST JUMPDEST POP POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 POP JUMPDEST PUSH1 0x3 DUP1 SLOAD SWAP1 POP DUP2 LT ISZERO PUSH2 0x11BC JUMPI PUSH1 0x1 PUSH1 0x0 DUP5 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH1 0x3 DUP4 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1130 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0x11AF JUMPI PUSH1 0x1 DUP3 ADD SWAP2 POP JUMPDEST DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0x10FF JUMP JUMPDEST POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 MSTORE DUP1 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP2 POP SWAP1 POP DUP1 PUSH1 0x0 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 DUP1 PUSH1 0x1 ADD SLOAD SWAP1 DUP1 PUSH1 0x2 ADD DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x129A JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x126F JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x129A JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x127D JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP1 DUP1 PUSH1 0x3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND SWAP1 POP DUP5 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x3 DUP1 SLOAD DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD DUP1 ISZERO PUSH2 0x133B JUMPI PUSH1 0x20 MUL DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 PUSH1 0x1 ADD SWAP1 DUP1 DUP4 GT PUSH2 0x12F1 JUMPI JUMPDEST POP POP POP POP POP SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x60 DUP1 PUSH1 0x0 DUP1 PUSH1 0x5 SLOAD PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x137C JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CODESIZE DUP4 CODECOPY DUP1 DUP3 ADD SWAP2 POP POP SWAP1 POP JUMPDEST POP SWAP3 POP PUSH1 0x0 SWAP2 POP PUSH1 0x0 SWAP1 POP JUMPDEST PUSH1 0x5 SLOAD DUP2 LT ISZERO PUSH2 0x1428 JUMPI DUP6 DUP1 ISZERO PUSH2 0x13BF JUMPI POP PUSH1 0x0 DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO JUMPDEST DUP1 PUSH2 0x13F2 JUMPI POP DUP5 DUP1 ISZERO PUSH2 0x13F1 JUMPI POP PUSH1 0x0 DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND JUMPDEST JUMPDEST ISZERO PUSH2 0x141B JUMPI DUP1 DUP4 DUP4 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1406 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD DUP2 DUP2 MSTORE POP POP PUSH1 0x1 DUP3 ADD SWAP2 POP JUMPDEST DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0x1388 JUMP JUMPDEST DUP8 DUP8 SUB PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x1459 JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CODESIZE DUP4 CODECOPY DUP1 DUP3 ADD SWAP2 POP POP SWAP1 POP JUMPDEST POP SWAP4 POP DUP8 SWAP1 POP JUMPDEST DUP7 DUP2 LT ISZERO PUSH2 0x14AB JUMPI DUP3 DUP2 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1476 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP5 DUP10 DUP4 SUB DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1490 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD DUP2 DUP2 MSTORE POP POP DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0x1460 JUMP JUMPDEST POP POP POP SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x60 DUP1 PUSH1 0x0 DUP1 PUSH1 0x3 DUP1 SLOAD SWAP1 POP PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x14F0 JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CODESIZE DUP4 CODECOPY DUP1 DUP3 ADD SWAP2 POP POP SWAP1 POP JUMPDEST POP SWAP3 POP PUSH1 0x0 SWAP2 POP PUSH1 0x0 SWAP1 POP JUMPDEST PUSH1 0x3 DUP1 SLOAD SWAP1 POP DUP2 LT ISZERO PUSH2 0x163D JUMPI PUSH1 0x1 PUSH1 0x0 DUP7 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH1 0x3 DUP4 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x152D JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0x1630 JUMPI PUSH1 0x3 DUP2 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x15B4 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP4 DUP4 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x15ED JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE POP POP PUSH1 0x1 DUP3 ADD SWAP2 POP JUMPDEST DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0x14FC JUMP JUMPDEST DUP2 PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x166C JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CODESIZE DUP4 CODECOPY DUP1 DUP3 ADD SWAP2 POP POP SWAP1 POP JUMPDEST POP SWAP4 POP PUSH1 0x0 SWAP1 POP JUMPDEST DUP2 DUP2 LT ISZERO PUSH2 0x16EB JUMPI DUP3 DUP2 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x168A JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP5 DUP3 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x16A2 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE POP POP DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0x1674 JUMP JUMPDEST POP POP POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x5 SLOAD DUP2 JUMP JUMPDEST ADDRESS PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x1733 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x3 DUP1 SLOAD SWAP1 POP DUP2 PUSH1 0x32 DUP3 GT DUP1 PUSH2 0x1748 JUMPI POP DUP2 DUP2 GT JUMPDEST DUP1 PUSH2 0x1753 JUMPI POP PUSH1 0x0 DUP2 EQ JUMPDEST DUP1 PUSH2 0x175E JUMPI POP PUSH1 0x0 DUP3 EQ JUMPDEST ISZERO PUSH2 0x1768 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 PUSH1 0x4 DUP2 SWAP1 SSTORE POP PUSH32 0xA3F1EE9126A074D9326C682F561767F710E927FAA811F7A99829D49DC421797A DUP4 PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG1 POP POP POP JUMP JUMPDEST CALLER PUSH1 0x2 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO ISZERO PUSH2 0x1804 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 PUSH1 0x0 DUP1 PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0x185E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 CALLER PUSH1 0x1 PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0x18C8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x1 DUP1 PUSH1 0x0 DUP8 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP DUP5 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x4A504A94899432A9846E1AA406DCEB1BCFD538BB839071D49D1E5E23F5BE30EF PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH2 0x197D DUP6 PUSH2 0x1CC1 JUMP JUMPDEST POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x1991 DUP5 DUP5 DUP5 PUSH2 0x1E77 JUMP JUMPDEST SWAP1 POP PUSH2 0x199C DUP2 PUSH2 0x17AB JUMP JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x32 DUP2 JUMP JUMPDEST PUSH1 0x4 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 ADDRESS PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x19EA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 PUSH1 0x2 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO ISZERO PUSH2 0x1A43 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 PUSH1 0x2 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0x1A9B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 SWAP3 POP JUMPDEST PUSH1 0x3 DUP1 SLOAD SWAP1 POP DUP4 LT ISZERO PUSH2 0x1B84 JUMPI DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x3 DUP5 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1AD3 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0x1B77 JUMPI DUP4 PUSH1 0x3 DUP5 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1B2A JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH2 0x1B84 JUMP JUMPDEST DUP3 DUP1 PUSH1 0x1 ADD SWAP4 POP POP PUSH2 0x1AA0 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x2 PUSH1 0x0 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP PUSH1 0x1 PUSH1 0x2 PUSH1 0x0 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x8001553A916EF2F495D26A907CC54D96ED840D7BDA71E73194BF5A9DF7A76B90 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xF39E6E1EB0EDCF53C221607B54B00CD28F3196FED0A24994DC308B8F611B682D PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x0 DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0x1CF1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1CFA DUP4 PUSH2 0x1012 JUMP JUMPDEST ISZERO PUSH2 0x1E72 JUMPI PUSH1 0x0 DUP1 DUP5 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SWAP2 POP PUSH1 0x1 DUP3 PUSH1 0x3 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP DUP2 PUSH1 0x0 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP3 PUSH1 0x1 ADD SLOAD DUP4 PUSH1 0x2 ADD PUSH1 0x40 MLOAD DUP1 DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x1DD9 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x1DAE JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x1DD9 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x1DBC JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP SWAP2 POP POP PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP6 DUP8 GAS CALL SWAP3 POP POP POP ISZERO PUSH2 0x1E26 JUMPI DUP3 PUSH32 0x33E13ECB54C3076D8E8BB8C2881800A4D972B792045FFAE98FDF46DF365FED75 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 PUSH2 0x1E71 JUMP JUMPDEST DUP3 PUSH32 0x526441BB6C1ABA3C9A4A6CA1D6545DA9C2333C8C48343EF398EB858D72B79236 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 PUSH1 0x0 DUP3 PUSH1 0x3 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP JUMPDEST JUMPDEST POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP4 PUSH1 0x0 DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0x1E9E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x5 SLOAD SWAP2 POP PUSH1 0x80 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP6 DUP2 MSTORE PUSH1 0x20 ADD DUP5 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 ISZERO ISZERO DUP2 MSTORE POP PUSH1 0x0 DUP1 DUP5 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 ADD MLOAD DUP2 PUSH1 0x0 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH1 0x20 DUP3 ADD MLOAD DUP2 PUSH1 0x1 ADD SSTORE PUSH1 0x40 DUP3 ADD MLOAD DUP2 PUSH1 0x2 ADD SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH2 0x1F5D SWAP3 SWAP2 SWAP1 PUSH2 0x1FF3 JUMP JUMPDEST POP PUSH1 0x60 DUP3 ADD MLOAD DUP2 PUSH1 0x3 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP SWAP1 POP POP PUSH1 0x1 PUSH1 0x5 PUSH1 0x0 DUP3 DUP3 SLOAD ADD SWAP3 POP POP DUP2 SWAP1 SSTORE POP DUP2 PUSH32 0xC0BA8FE4B176C1714197D43B9CC6BCF797A4A7461C5FE8D0EF6E184AE7601E51 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST DUP2 SLOAD DUP2 DUP4 SSTORE DUP2 DUP2 GT ISZERO PUSH2 0x1FEE JUMPI DUP2 DUP4 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP2 DUP3 ADD SWAP2 ADD PUSH2 0x1FED SWAP2 SWAP1 PUSH2 0x2073 JUMP JUMPDEST JUMPDEST POP POP POP JUMP JUMPDEST DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 PUSH1 0x1F ADD PUSH1 0x20 SWAP1 DIV DUP2 ADD SWAP3 DUP3 PUSH1 0x1F LT PUSH2 0x2034 JUMPI DUP1 MLOAD PUSH1 0xFF NOT AND DUP4 DUP1 ADD OR DUP6 SSTORE PUSH2 0x2062 JUMP JUMPDEST DUP3 DUP1 ADD PUSH1 0x1 ADD DUP6 SSTORE DUP3 ISZERO PUSH2 0x2062 JUMPI SWAP2 DUP3 ADD JUMPDEST DUP3 DUP2 GT ISZERO PUSH2 0x2061 JUMPI DUP3 MLOAD DUP3 SSTORE SWAP2 PUSH1 0x20 ADD SWAP2 SWAP1 PUSH1 0x1 ADD SWAP1 PUSH2 0x2046 JUMP JUMPDEST JUMPDEST POP SWAP1 POP PUSH2 0x206F SWAP2 SWAP1 PUSH2 0x2073 JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST PUSH2 0x2095 SWAP2 SWAP1 JUMPDEST DUP1 DUP3 GT ISZERO PUSH2 0x2091 JUMPI PUSH1 0x0 DUP2 PUSH1 0x0 SWAP1 SSTORE POP PUSH1 0x1 ADD PUSH2 0x2079 JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST SWAP1 JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 PUSH25 0xB1106B9C71E8A3E2369242D49547E78FD5EA65974850F4A1 INVALID 0xca JUMP PC 0xef 0xbd STOP 0x29 ",
- "sourceMap": "186:11249:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2519:1;2507:9;:13;2503:61;;;2542:10;2534:30;;;2554:9;2534:30;;;;;;;;;;;;;;;;;;2503:61;186:11249;936:23;;8:9:-1;5:2;;;30:1;27;20:12;5:2;936:23:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3711:460;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3711:460:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;6274:291;;8:9:-1;5:2;;;30:1;27;20:12;5:2;6274:291:0;;;;;;;;;;;;;;;;;;;;;;;;;;890:40;;8:9:-1;5:2;;;30:1;27;20:12;5:2;890:40:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;820:64;;8:9:-1;5:2;;;30:1;27;20:12;5:2;820:64:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9136:319;;8:9:-1;5:2;;;30:1;27;20:12;5:2;9136:319:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3311:277;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3311:277:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;7304:337;;8:9:-1;5:2;;;30:1;27;20:12;5:2;7304:337:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8622:252;;8:9:-1;5:2;;;30:1;27;20:12;5:2;8622:252:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;765:49;;8:9:-1;5:2;;;30:1;27;20:12;5:2;765:49:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;765:49:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9539:115;;8:9:-1;5:2;;;30:1;27;20:12;5:2;9539:115:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;9539:115:0;;;;;;;;;;;;;;;;;10757:676;;8:9:-1;5:2;;;30:1;27;20:12;5:2;10757:676:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;10757:676:0;;;;;;;;;;;;;;;;;9833:575;;8:9:-1;5:2;;;30:1;27;20:12;5:2;9833:575:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;9833:575:0;;;;;;;;;;;;;;;;;991:28;;8:9:-1;5:2;;;30:1;27;20:12;5:2;991:28:0;;;;;;;;;;;;;;;;;;;;;;;4990:207;;8:9:-1;5:2;;;30:1;27;20:12;5:2;4990:207:0;;;;;;;;;;;;;;;;;;;;;;;;;;5806:344;;8:9:-1;5:2;;;30:1;27;20:12;5:2;5806:344:0;;;;;;;;;;;;;;;;;;;;;;;;;;5456:244;;8:9:-1;5:2;;;30:1;27;20:12;5:2;5456:244:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;217:41;;8:9:-1;5:2;;;30:1;27;20:12;5:2;217:41:0;;;;;;;;;;;;;;;;;;;;;;;965:20;;8:9:-1;5:2;;;30:1;27;20:12;5:2;965:20:0;;;;;;;;;;;;;;;;;;;;;;;4370:449;;8:9:-1;5:2;;;30:1;27;20:12;5:2;4370:449:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6679:474;;8:9:-1;5:2;;;30:1;27;20:12;5:2;6679:474:0;;;;;;;;;;;;;;;;;;;;;;;;;;936:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;3711:460::-;3859:6;1208:4;1186:27;;:10;:27;;;;1182:50;;;1227:5;;;1182:50;3801:5;1420:7;:14;1428:5;1420:14;;;;;;;;;;;;;;;;;;;;;;;;;1419:15;1415:38;;;1448:5;;;1415:38;3839:5;3822:7;:14;3830:5;3822:14;;;;;;;;;;;;;;;;:22;;;;;;;;;;;;;;;;;;3866:1;3859:8;;3854:170;3887:1;3871:6;:13;;;;:17;3869:1;:19;3854:170;;;3924:5;3911:18;;:6;3918:1;3911:9;;;;;;;;;;;;;;;;;;;;;;;;;;;:18;;;3907:117;;;3961:6;3984:1;3968:6;:13;;;;:17;3961:25;;;;;;;;;;;;;;;;;;;;;;;;;;;3949:6;3956:1;3949:9;;;;;;;;;;;;;;;;;;:37;;;;;;;;;;;;;;;;;;4004:5;;3907:117;3890:3;;;;;;;3854:170;;;4050:1;4033:6;:18;;;;;;;;;;;;;;:::i;:::-;;4076:6;:13;;;;4065:8;;:24;4061:74;;;4103:32;4121:6;:13;;;;4103:17;:32::i;:::-;4061:74;4158:5;4145:19;;;;;;;;;;;;1242:1;3711:460;;:::o;6274:291::-;6357:10;1420:7;:14;1428:5;1420:14;;;;;;;;;;;;;;;;;;;;;;;;;1419:15;1415:38;;;1448:5;;;1415:38;6387:13;6402:10;1694:13;:28;1708:13;1694:28;;;;;;;;;;;:35;1723:5;1694:35;;;;;;;;;;;;;;;;;;;;;;;;;1693:36;1689:59;;;1743:5;;;1689:59;6434:13;1976:12;:27;1989:13;1976:27;;;;;;;;;;;:36;;;;;;;;;;;;1972:59;;;2026:5;;;1972:59;6506:5;6463:13;:28;6477:13;6463:28;;;;;;;;;;;:40;6492:10;6463:40;;;;;;;;;;;;;;;;:48;;;;;;;;;;;;;;;;;;6544:13;6532:10;6521:37;;;;;;;;;;;;1758:1;1463;;6274:291;;:::o;890:40::-;;;;;;;;;;;;;;;;;;;;;;:::o;820:64::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;9136:319::-;9243:10;9274:6;9281:1;9274:8;;9269:179;9286:16;;9284:1;:18;9269:179;;;9328:7;:36;;;;;9340:12;:15;9353:1;9340:15;;;;;;;;;;;:24;;;;;;;;;;;;9339:25;9328:36;:92;;;;9384:8;:36;;;;;9396:12;:15;9409:1;9396:15;;;;;;;;;;;:24;;;;;;;;;;;;9384:36;9328:92;9321:127;;;9447:1;9438:10;;;;9321:127;9304:3;;;;;;;9269:179;;;9136:319;;;;;:::o;3311:277::-;1208:4;1186:27;;:10;:27;;;;1182:50;;;1227:5;;;1182:50;3404:5;1312:7;:14;1320:5;1312:14;;;;;;;;;;;;;;;;;;;;;;;;;1308:37;;;1340:5;;;1308:37;3427:5;2116:1;2104:8;:13;;;2100:36;;;2131:5;;;2100:36;3475:1;3459:6;:13;;;;:17;3478:8;;256:2;2236:10;:28;:66;;;;2292:10;2280:9;:22;2236:66;:96;;;;2331:1;2318:9;:14;2236:96;:127;;;;2362:1;2348:10;:15;2236:127;2229:153;;;2377:5;;;2229:153;3519:4;3502:7;:14;3510:5;3502:14;;;;;;;;;;;;;;;;:21;;;;;;;;;;;;;;;;;;3533:6;3545:5;3533:18;;39:1:-1;33:3;27:10;23:18;57:10;52:3;45:23;79:10;72:17;;0:93;3533:18:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3575:5;3561:20;;;;;;;;;;;;2146:1;;1355;1242;3311:277;:::o;7304:337::-;7394:4;7414:10;7443:6;7427:1;7414:14;;7450:1;7443:8;;7438:197;7455:6;:13;;;;7453:1;:15;7438:197;;;7493:13;:28;7507:13;7493:28;;;;;;;;;;;:39;7522:6;7529:1;7522:9;;;;;;;;;;;;;;;;;;;;;;;;;;;7493:39;;;;;;;;;;;;;;;;;;;;;;;;;7489:71;;;7559:1;7550:10;;;;7489:71;7587:8;;7578:5;:17;7574:50;;;7620:4;7613:11;;;;7574:50;7470:3;;;;;;;7438:197;;;7304:337;;;;;;:::o;8622:252::-;8721:10;8752:6;8759:1;8752:8;;8747:120;8764:6;:13;;;;8762:1;:15;8747:120;;;8800:13;:28;8814:13;8800:28;;;;;;;;;;;:39;8829:6;8836:1;8829:9;;;;;;;;;;;;;;;;;;;;;;;;;;;8800:39;;;;;;;;;;;;;;;;;;;;;;;;;8796:71;;;8866:1;8857:10;;;;8796:71;8779:3;;;;;;;8747:120;;;8622:252;;;;:::o;765:49::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;9539:115::-;9609:9;9641:6;9634:13;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9539:115;:::o;10757:676::-;10882:22;10920:32;10993:10;11017:6;10966:16;;10955:28;;;;;;;;;;;;;;;;;;;;;;29:2:-1;21:6;17:15;117:4;105:10;97:6;88:34;148:4;140:6;136:17;126:27;;0:157;10955:28:0;;;;10920:63;;11006:1;10993:14;;11040:1;11038:3;;11033:250;11045:16;;11043:1;:18;11033:250;;;11087:7;:36;;;;;11099:12;:15;11112:1;11099:15;;;;;;;;;;;:24;;;;;;;;;;;;11098:25;11087:36;:92;;;;11143:8;:36;;;;;11155:12;:15;11168:1;11155:15;;;;;;;;;;;:24;;;;;;;;;;;;11143:36;11087:92;11080:203;;;11239:1;11211:18;11230:5;11211:25;;;;;;;;;;;;;;;;;:29;;;;;11267:1;11258:10;;;;11080:203;11063:3;;;;;;;11033:250;;;11326:4;11321:2;:9;11310:21;;;;;;;;;;;;;;;;;;;;;;29:2:-1;21:6;17:15;117:4;105:10;97:6;88:34;148:4;140:6;136:17;126:27;;0:157;11310:21:0;;;;11292:39;;11348:4;11346:6;;11341:85;11356:2;11354:1;:4;11341:85;;;11405:18;11424:1;11405:21;;;;;;;;;;;;;;;;;;11377:15;11397:4;11393:1;:8;11377:25;;;;;;;;;;;;;;;;;:49;;;;;11360:3;;;;;;;11341:85;;;10757:676;;;;;;;;;:::o;9833:575::-;9928:24;9968:34;10043:10;10067:6;10019;:13;;;;10005:28;;;;;;;;;;;;;;;;;;;;;;29:2:-1;21:6;17:15;117:4;105:10;97:6;88:34;148:4;140:6;136:17;126:27;;0:157;10005:28:0;;;;9968:65;;10056:1;10043:14;;10090:1;10088:3;;10083:186;10095:6;:13;;;;10093:1;:15;10083:186;;;10131:13;:28;10145:13;10131:28;;;;;;;;;;;:39;10160:6;10167:1;10160:9;;;;;;;;;;;;;;;;;;;;;;;;;;;10131:39;;;;;;;;;;;;;;;;;;;;;;;;;10127:142;;;10217:6;10224:1;10217:9;;;;;;;;;;;;;;;;;;;;;;;;;;;10190:17;10208:5;10190:24;;;;;;;;;;;;;;;;;:36;;;;;;;;;;;10253:1;10244:10;;;;10127:142;10110:3;;;;;;;10083:186;;;10309:5;10295:20;;;;;;;;;;;;;;;;;;;;;;29:2:-1;21:6;17:15;117:4;105:10;97:6;88:34;148:4;140:6;136:17;126:27;;0:157;10295:20:0;;;;10278:37;;10332:1;10330:3;;10325:76;10337:5;10335:1;:7;10325:76;;;10381:17;10399:1;10381:20;;;;;;;;;;;;;;;;;;10361:14;10376:1;10361:17;;;;;;;;;;;;;;;;;:40;;;;;;;;;;;10344:3;;;;;;;10325:76;;;9833:575;;;;;;:::o;991:28::-;;;;:::o;4990:207::-;1208:4;1186:27;;:10;:27;;;;1182:50;;;1227:5;;;1182:50;5092:6;:13;;;;5107:9;256:2;2236:10;:28;:66;;;;2292:10;2280:9;:22;2236:66;:96;;;;2331:1;2318:9;:14;2236:96;:127;;;;2362:1;2348:10;:15;2236:127;2229:153;;;2377:5;;;2229:153;5143:9;5132:8;:20;;;;5162:28;5180:9;5162:28;;;;;;;;;;;;;;;;;;1242:1;;4990:207;:::o;5806:344::-;5889:10;1420:7;:14;1428:5;1420:14;;;;;;;;;;;;;;;;;;;;;;;;;1419:15;1415:38;;;1448:5;;;1415:38;5927:13;1581:1;1538:12;:27;1551:13;1538:27;;;;;;;;;;;:39;;;;;;;;;;;;:44;;;1534:67;;;1596:5;;;1534:67;5963:13;5978:10;1843:13;:28;1857:13;1843:28;;;;;;;;;;;:35;1872:5;1843:35;;;;;;;;;;;;;;;;;;;;;;;;;1839:58;;;1892:5;;;1839:58;6047:4;6004:13;:28;6018:13;6004:28;;;;;;;;;;;:40;6033:10;6004:40;;;;;;;;;;;;;;;;:47;;;;;;;;;;;;;;;;;;6086:13;6074:10;6061:39;;;;;;;;;;;;6110:33;6129:13;6110:18;:33::i;:::-;1611:1;;1463;5806:344;;:::o;5456:244::-;5560:18;5610:40;5625:11;5638:5;5645:4;5610:14;:40::i;:::-;5594:56;;5660:33;5679:13;5660:18;:33::i;:::-;5456:244;;;;;:::o;217:41::-;256:2;217:41;:::o;965:20::-;;;;:::o;4370:449::-;4541:6;1208:4;1186:27;;:10;:27;;;;1182:50;;;1227:5;;;1182:50;4479:5;1420:7;:14;1428:5;1420:14;;;;;;;;;;;;;;;;;;;;;;;;;1419:15;1415:38;;;1448:5;;;1415:38;4512:8;1312:7;:14;1320:5;1312:14;;;;;;;;;;;;;;;;;;;;;;;;;1308:37;;;1340:5;;;1308:37;4548:1;4541:8;;4536:149;4553:6;:13;;;;4551:1;:15;4536:149;;;4602:5;4589:18;;:6;4596:1;4589:9;;;;;;;;;;;;;;;;;;;;;;;;;;;:18;;;4585:100;;;4639:8;4627:6;4634:1;4627:9;;;;;;;;;;;;;;;;;;:20;;;;;;;;;;;;;;;;;;4665:5;;4585:100;4568:3;;;;;;;4536:149;;;4711:5;4694:7;:14;4702:5;4694:14;;;;;;;;;;;;;;;;:22;;;;;;;;;;;;;;;;;;4746:4;4726:7;:17;4734:8;4726:17;;;;;;;;;;;;;;;;:24;;;;;;;;;;;;;;;;;;4773:5;4760:19;;;;;;;;;;;;4803:8;4789:23;;;;;;;;;;;;1463:1;1242;4370:449;;;:::o;6679:474::-;6837:14;6762:13;1976:12;:27;1989:13;1976:27;;;;;;;;;;;:36;;;;;;;;;;;;1972:59;;;2026:5;;;1972:59;6795:26;6807:13;6795:11;:26::i;:::-;6791:356;;;6854:12;:27;6867:13;6854:27;;;;;;;;;;;6837:44;;6909:4;6895:2;:11;;;:18;;;;;;;;;;;;;;;;;;6931:2;:14;;;;;;;;;;;;:19;;6957:2;:8;;;6967:2;:7;;6931:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6927:210;;;7003:13;6993:24;;;;;;;;;;6927:210;;;7071:13;7054:31;;;;;;;;;;7117:5;7103:2;:11;;;:19;;;;;;;;;;;;;;;;;;6927:210;6791:356;6679:474;;;:::o;7974:451::-;8106:18;8076:11;2116:1;2104:8;:13;;;2100:36;;;2131:5;;;2100:36;8156:16;;8140:32;;8212:140;;;;;;;;;8251:11;8212:140;;;;;;8283:5;8212:140;;;;8308:4;8212:140;;;;8336:5;8212:140;;;;;8182:12;:27;8195:13;8182:27;;;;;;;;;;;:170;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8382:1;8362:16;;:21;;;;;;;;;;;8404:13;8393:25;;;;;;;;;;7974:451;;;;;;:::o;186:11249::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o"
- }
- }
- },
- "sources": {
- "current/multisig/MultiSigWallet/MultiSigWallet.sol": {
- "id": 0
- }
- },
- "sourceCodes": {
- "current/multisig/MultiSigWallet/MultiSigWallet.sol": "pragma solidity ^0.4.10;\n\n/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.\n/// @author Stefan George - <stefan.george@consensys.net>\ncontract MultiSigWallet {\n\n uint constant public MAX_OWNER_COUNT = 50;\n\n event Confirmation(address indexed sender, uint indexed transactionId);\n event Revocation(address indexed sender, uint indexed transactionId);\n event Submission(uint indexed transactionId);\n event Execution(uint indexed transactionId);\n event ExecutionFailure(uint indexed transactionId);\n event Deposit(address indexed sender, uint value);\n event OwnerAddition(address indexed owner);\n event OwnerRemoval(address indexed owner);\n event RequirementChange(uint required);\n\n mapping (uint => Transaction) public transactions;\n mapping (uint => mapping (address => bool)) public confirmations;\n mapping (address => bool) public isOwner;\n address[] public owners;\n uint public required;\n uint public transactionCount;\n\n struct Transaction {\n address destination;\n uint value;\n bytes data;\n bool executed;\n }\n\n modifier onlyWallet() {\n if (msg.sender != address(this))\n throw;\n _;\n }\n\n modifier ownerDoesNotExist(address owner) {\n if (isOwner[owner])\n throw;\n _;\n }\n\n modifier ownerExists(address owner) {\n if (!isOwner[owner])\n throw;\n _;\n }\n\n modifier transactionExists(uint transactionId) {\n if (transactions[transactionId].destination == 0)\n throw;\n _;\n }\n\n modifier confirmed(uint transactionId, address owner) {\n if (!confirmations[transactionId][owner])\n throw;\n _;\n }\n\n modifier notConfirmed(uint transactionId, address owner) {\n if (confirmations[transactionId][owner])\n throw;\n _;\n }\n\n modifier notExecuted(uint transactionId) {\n if (transactions[transactionId].executed)\n throw;\n _;\n }\n\n modifier notNull(address _address) {\n if (_address == 0)\n throw;\n _;\n }\n\n modifier validRequirement(uint ownerCount, uint _required) {\n if ( ownerCount > MAX_OWNER_COUNT\n || _required > ownerCount\n || _required == 0\n || ownerCount == 0)\n throw;\n _;\n }\n\n /// @dev Fallback function allows to deposit ether.\n function()\n payable\n {\n if (msg.value > 0)\n Deposit(msg.sender, msg.value);\n }\n\n /*\n * Public functions\n */\n /// @dev Contract constructor sets initial owners and required number of confirmations.\n /// @param _owners List of initial owners.\n /// @param _required Number of required confirmations.\n function MultiSigWallet(address[] _owners, uint _required)\n public\n validRequirement(_owners.length, _required)\n {\n for (uint i=0; i<_owners.length; i++) {\n if (isOwner[_owners[i]] || _owners[i] == 0)\n throw;\n isOwner[_owners[i]] = true;\n }\n owners = _owners;\n required = _required;\n }\n\n /// @dev Allows to add a new owner. Transaction has to be sent by wallet.\n /// @param owner Address of new owner.\n function addOwner(address owner)\n public\n onlyWallet\n ownerDoesNotExist(owner)\n notNull(owner)\n validRequirement(owners.length + 1, required)\n {\n isOwner[owner] = true;\n owners.push(owner);\n OwnerAddition(owner);\n }\n\n /// @dev Allows to remove an owner. Transaction has to be sent by wallet.\n /// @param owner Address of owner.\n function removeOwner(address owner)\n public\n onlyWallet\n ownerExists(owner)\n {\n isOwner[owner] = false;\n for (uint i=0; i<owners.length - 1; i++)\n if (owners[i] == owner) {\n owners[i] = owners[owners.length - 1];\n break;\n }\n owners.length -= 1;\n if (required > owners.length)\n changeRequirement(owners.length);\n OwnerRemoval(owner);\n }\n\n /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet.\n /// @param owner Address of owner to be replaced.\n /// @param owner Address of new owner.\n function replaceOwner(address owner, address newOwner)\n public\n onlyWallet\n ownerExists(owner)\n ownerDoesNotExist(newOwner)\n {\n for (uint i=0; i<owners.length; i++)\n if (owners[i] == owner) {\n owners[i] = newOwner;\n break;\n }\n isOwner[owner] = false;\n isOwner[newOwner] = true;\n OwnerRemoval(owner);\n OwnerAddition(newOwner);\n }\n\n /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet.\n /// @param _required Number of required confirmations.\n function changeRequirement(uint _required)\n public\n onlyWallet\n validRequirement(owners.length, _required)\n {\n required = _required;\n RequirementChange(_required);\n }\n\n /// @dev Allows an owner to submit and confirm a transaction.\n /// @param destination Transaction target address.\n /// @param value Transaction ether value.\n /// @param data Transaction data payload.\n /// @return Returns transaction ID.\n function submitTransaction(address destination, uint value, bytes data)\n public\n returns (uint transactionId)\n {\n transactionId = addTransaction(destination, value, data);\n confirmTransaction(transactionId);\n }\n\n /// @dev Allows an owner to confirm a transaction.\n /// @param transactionId Transaction ID.\n function confirmTransaction(uint transactionId)\n public\n ownerExists(msg.sender)\n transactionExists(transactionId)\n notConfirmed(transactionId, msg.sender)\n {\n confirmations[transactionId][msg.sender] = true;\n Confirmation(msg.sender, transactionId);\n executeTransaction(transactionId);\n }\n\n /// @dev Allows an owner to revoke a confirmation for a transaction.\n /// @param transactionId Transaction ID.\n function revokeConfirmation(uint transactionId)\n public\n ownerExists(msg.sender)\n confirmed(transactionId, msg.sender)\n notExecuted(transactionId)\n {\n confirmations[transactionId][msg.sender] = false;\n Revocation(msg.sender, transactionId);\n }\n\n /// @dev Allows anyone to execute a confirmed transaction.\n /// @param transactionId Transaction ID.\n function executeTransaction(uint transactionId)\n public\n notExecuted(transactionId)\n {\n if (isConfirmed(transactionId)) {\n Transaction tx = transactions[transactionId];\n tx.executed = true;\n if (tx.destination.call.value(tx.value)(tx.data))\n Execution(transactionId);\n else {\n ExecutionFailure(transactionId);\n tx.executed = false;\n }\n }\n }\n\n /// @dev Returns the confirmation status of a transaction.\n /// @param transactionId Transaction ID.\n /// @return Confirmation status.\n function isConfirmed(uint transactionId)\n public\n constant\n returns (bool)\n {\n uint count = 0;\n for (uint i=0; i<owners.length; i++) {\n if (confirmations[transactionId][owners[i]])\n count += 1;\n if (count == required)\n return true;\n }\n }\n\n /*\n * Internal functions\n */\n /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet.\n /// @param destination Transaction target address.\n /// @param value Transaction ether value.\n /// @param data Transaction data payload.\n /// @return Returns transaction ID.\n function addTransaction(address destination, uint value, bytes data)\n internal\n notNull(destination)\n returns (uint transactionId)\n {\n transactionId = transactionCount;\n transactions[transactionId] = Transaction({\n destination: destination,\n value: value,\n data: data,\n executed: false\n });\n transactionCount += 1;\n Submission(transactionId);\n }\n\n /*\n * Web3 call functions\n */\n /// @dev Returns number of confirmations of a transaction.\n /// @param transactionId Transaction ID.\n /// @return Number of confirmations.\n function getConfirmationCount(uint transactionId)\n public\n constant\n returns (uint count)\n {\n for (uint i=0; i<owners.length; i++)\n if (confirmations[transactionId][owners[i]])\n count += 1;\n }\n\n /// @dev Returns total number of transactions after filers are applied.\n /// @param pending Include pending transactions.\n /// @param executed Include executed transactions.\n /// @return Total number of transactions after filters are applied.\n function getTransactionCount(bool pending, bool executed)\n public\n constant\n returns (uint count)\n {\n for (uint i=0; i<transactionCount; i++)\n if ( pending && !transactions[i].executed\n || executed && transactions[i].executed)\n count += 1;\n }\n\n /// @dev Returns list of owners.\n /// @return List of owner addresses.\n function getOwners()\n public\n constant\n returns (address[])\n {\n return owners;\n }\n\n /// @dev Returns array with owner addresses, which confirmed transaction.\n /// @param transactionId Transaction ID.\n /// @return Returns array of owner addresses.\n function getConfirmations(uint transactionId)\n public\n constant\n returns (address[] _confirmations)\n {\n address[] memory confirmationsTemp = new address[](owners.length);\n uint count = 0;\n uint i;\n for (i=0; i<owners.length; i++)\n if (confirmations[transactionId][owners[i]]) {\n confirmationsTemp[count] = owners[i];\n count += 1;\n }\n _confirmations = new address[](count);\n for (i=0; i<count; i++)\n _confirmations[i] = confirmationsTemp[i];\n }\n\n /// @dev Returns list of transaction IDs in defined range.\n /// @param from Index start position of transaction array.\n /// @param to Index end position of transaction array.\n /// @param pending Include pending transactions.\n /// @param executed Include executed transactions.\n /// @return Returns array of transaction IDs.\n function getTransactionIds(uint from, uint to, bool pending, bool executed)\n public\n constant\n returns (uint[] _transactionIds)\n {\n uint[] memory transactionIdsTemp = new uint[](transactionCount);\n uint count = 0;\n uint i;\n for (i=0; i<transactionCount; i++)\n if ( pending && !transactions[i].executed\n || executed && transactions[i].executed)\n {\n transactionIdsTemp[count] = i;\n count += 1;\n }\n _transactionIds = new uint[](to - from);\n for (i=from; i<to; i++)\n _transactionIds[i - from] = transactionIdsTemp[i];\n }\n}\n"
- },
- "sourceTreeHashHex": "0xe4dcaad5ebc708ef4258ff1a4152c7b94956a61f99db39fb7ae3003cc7087234",
- "compiler": {
- "name": "solc",
- "version": "0.4.23",
- "settings": {
- "outputSelection": {
- "*": {
- "*": [
- "abi",
- "evm.bytecode.object",
- "evm.bytecode.sourceMap",
- "evm.deployedBytecode.object",
- "evm.deployedBytecode.sourceMap"
- ]
- }
- }
- }
- },
- "networks": {}
-} \ No newline at end of file
diff --git a/packages/migrations/artifacts/1.0.0/MultiSigWalletWithTimeLock.json b/packages/migrations/artifacts/1.0.0/MultiSigWalletWithTimeLock.json
deleted file mode 100644
index 89345817b..000000000
--- a/packages/migrations/artifacts/1.0.0/MultiSigWalletWithTimeLock.json
+++ /dev/null
@@ -1,664 +0,0 @@
-{
- "schemaVersion": "2.0.0",
- "contractName": "MultiSigWalletWithTimeLock",
- "compilerOutput": {
- "abi": [
- {
- "constant": true,
- "inputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "name": "owners",
- "outputs": [
- {
- "name": "",
- "type": "address"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "owner",
- "type": "address"
- }
- ],
- "name": "removeOwner",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "revokeConfirmation",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "",
- "type": "address"
- }
- ],
- "name": "isOwner",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "",
- "type": "uint256"
- },
- {
- "name": "",
- "type": "address"
- }
- ],
- "name": "confirmations",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "secondsTimeLocked",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "pending",
- "type": "bool"
- },
- {
- "name": "executed",
- "type": "bool"
- }
- ],
- "name": "getTransactionCount",
- "outputs": [
- {
- "name": "count",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "owner",
- "type": "address"
- }
- ],
- "name": "addOwner",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "isConfirmed",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_secondsTimeLocked",
- "type": "uint256"
- }
- ],
- "name": "changeTimeLock",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "getConfirmationCount",
- "outputs": [
- {
- "name": "count",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "name": "transactions",
- "outputs": [
- {
- "name": "destination",
- "type": "address"
- },
- {
- "name": "value",
- "type": "uint256"
- },
- {
- "name": "data",
- "type": "bytes"
- },
- {
- "name": "executed",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "getOwners",
- "outputs": [
- {
- "name": "",
- "type": "address[]"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "from",
- "type": "uint256"
- },
- {
- "name": "to",
- "type": "uint256"
- },
- {
- "name": "pending",
- "type": "bool"
- },
- {
- "name": "executed",
- "type": "bool"
- }
- ],
- "name": "getTransactionIds",
- "outputs": [
- {
- "name": "_transactionIds",
- "type": "uint256[]"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "getConfirmations",
- "outputs": [
- {
- "name": "_confirmations",
- "type": "address[]"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "transactionCount",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_required",
- "type": "uint256"
- }
- ],
- "name": "changeRequirement",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "confirmTransaction",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "destination",
- "type": "address"
- },
- {
- "name": "value",
- "type": "uint256"
- },
- {
- "name": "data",
- "type": "bytes"
- }
- ],
- "name": "submitTransaction",
- "outputs": [
- {
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "name": "confirmationTimes",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "MAX_OWNER_COUNT",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "required",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "owner",
- "type": "address"
- },
- {
- "name": "newOwner",
- "type": "address"
- }
- ],
- "name": "replaceOwner",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "executeTransaction",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "inputs": [
- {
- "name": "_owners",
- "type": "address[]"
- },
- {
- "name": "_required",
- "type": "uint256"
- },
- {
- "name": "_secondsTimeLocked",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "constructor"
- },
- {
- "payable": true,
- "stateMutability": "payable",
- "type": "fallback"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "transactionId",
- "type": "uint256"
- },
- {
- "indexed": false,
- "name": "confirmationTime",
- "type": "uint256"
- }
- ],
- "name": "ConfirmationTimeSet",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": false,
- "name": "secondsTimeLocked",
- "type": "uint256"
- }
- ],
- "name": "TimeLockChange",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "sender",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "Confirmation",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "sender",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "Revocation",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "Submission",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "Execution",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "ExecutionFailure",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "sender",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "value",
- "type": "uint256"
- }
- ],
- "name": "Deposit",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "owner",
- "type": "address"
- }
- ],
- "name": "OwnerAddition",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "owner",
- "type": "address"
- }
- ],
- "name": "OwnerRemoval",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": false,
- "name": "required",
- "type": "uint256"
- }
- ],
- "name": "RequirementChange",
- "type": "event"
- }
- ],
- "evm": {
- "bytecode": {
- "linkReferences": {},
- "object": "0x60806040523480156200001157600080fd5b50604051620025af380380620025af8339810180604052810190808051820192919060200180519060200190929190805190602001909291905050508282600082518260328211806200006357508181115b806200006f5750600081145b806200007b5750600082145b156200008657600080fd5b600092505b8451831015620001bd57600260008685815181101515620000a857fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680620001345750600085848151811015156200011257fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff16145b156200013f57600080fd5b60016002600087868151811015156200015457fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555082806001019350506200008b565b8460039080519060200190620001d5929190620001f2565b5083600481905550505050505080600681905550505050620002c7565b8280548282559060005260206000209081019282156200026e579160200282015b828111156200026d5782518260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509160200191906001019062000213565b5b5090506200027d919062000281565b5090565b620002c491905b80821115620002c057600081816101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690555060010162000288565b5090565b90565b6122d880620002d76000396000f30060806040526004361061013e576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063025e7c2714610198578063173825d91461020557806320ea8d86146102485780632f54bf6e146102755780633411c81c146102d057806337bd78a01461033557806354741525146103605780637065cb48146103af578063784547a7146103f25780637ad28c51146104375780638b51d13f146104645780639ace38c2146104a5578063a0e67e2b14610590578063a8abe69a146105fc578063b5dc40c3146106a0578063b77bf60014610722578063ba51a6df1461074d578063c01a8c841461077a578063c6427474146107a7578063d38f2d821461084e578063d74f8edd1461088f578063dc8452cd146108ba578063e20056e6146108e5578063ee22610b14610948575b6000341115610196573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a25b005b3480156101a457600080fd5b506101c360048036038101908080359060200190929190505050610975565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561021157600080fd5b50610246600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109b3565b005b34801561025457600080fd5b5061027360048036038101908080359060200190929190505050610c4c565b005b34801561028157600080fd5b506102b6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e09565b604051808215151515815260200191505060405180910390f35b3480156102dc57600080fd5b5061031b60048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e29565b604051808215151515815260200191505060405180910390f35b34801561034157600080fd5b5061034a610e58565b6040518082815260200191505060405180910390f35b34801561036c57600080fd5b50610399600480360381019080803515159060200190929190803515159060200190929190505050610e5e565b6040518082815260200191505060405180910390f35b3480156103bb57600080fd5b506103f0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ef0565b005b3480156103fe57600080fd5b5061041d600480360381019080803590602001909291905050506110e9565b604051808215151515815260200191505060405180910390f35b34801561044357600080fd5b50610462600480360381019080803590602001909291905050506111ce565b005b34801561047057600080fd5b5061048f60048036038101908080359060200190929190505050611249565b6040518082815260200191505060405180910390f35b3480156104b157600080fd5b506104d060048036038101908080359060200190929190505050611314565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018060200183151515158152602001828103825284818151815260200191508051906020019080838360005b83811015610552578082015181840152602081019050610537565b50505050905090810190601f16801561057f5780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b34801561059c57600080fd5b506105a5611409565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156105e85780820151818401526020810190506105cd565b505050509050019250505060405180910390f35b34801561060857600080fd5b506106496004803603810190808035906020019092919080359060200190929190803515159060200190929190803515159060200190929190505050611497565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561068c578082015181840152602081019050610671565b505050509050019250505060405180910390f35b3480156106ac57600080fd5b506106cb60048036038101908080359060200190929190505050611608565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561070e5780820151818401526020810190506106f3565b505050509050019250505060405180910390f35b34801561072e57600080fd5b50610737611845565b6040518082815260200191505060405180910390f35b34801561075957600080fd5b506107786004803603810190808035906020019092919050505061184b565b005b34801561078657600080fd5b506107a5600480360381019080803590602001909291905050506118fd565b005b3480156107b357600080fd5b50610838600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050611afd565b6040518082815260200191505060405180910390f35b34801561085a57600080fd5b5061087960048036038101908080359060200190929190505050611b1c565b6040518082815260200191505060405180910390f35b34801561089b57600080fd5b506108a4611b34565b6040518082815260200191505060405180910390f35b3480156108c657600080fd5b506108cf611b39565b6040518082815260200191505060405180910390f35b3480156108f157600080fd5b50610946600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b3f565b005b34801561095457600080fd5b5061097360048036038101908080359060200190929190505050611e52565b005b60038181548110151561098457fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156109ef57600080fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610a4857600080fd5b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600091505b600160038054905003821015610bcd578273ffffffffffffffffffffffffffffffffffffffff16600383815481101515610adb57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610bc0576003600160038054905003815481101515610b3957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600383815481101515610b7357fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610bcd565b8180600101925050610aa5565b6001600381818054905003915081610be591906121db565b506003805490506004541115610c0457610c0360038054905061184b565b5b8273ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a2505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610ca557600080fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610d1057600080fd5b8360008082815260200190815260200160002060030160009054906101000a900460ff1615610d3e57600080fd5b84610d48816110e9565b151515610d5457600080fd5b60006001600088815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550853373ffffffffffffffffffffffffffffffffffffffff167ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e960405160405180910390a3505050505050565b60026020528060005260406000206000915054906101000a900460ff1681565b60016020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b60065481565b600080600090505b600554811015610ee957838015610e9d575060008082815260200190815260200160002060030160009054906101000a900460ff16155b80610ed05750828015610ecf575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b15610edc576001820191505b8080600101915050610e66565b5092915050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f2a57600080fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610f8257600080fd5b8160008173ffffffffffffffffffffffffffffffffffffffff161415610fa757600080fd5b6001600380549050016004546032821180610fc157508181115b80610fcc5750600081145b80610fd75750600082145b15610fe157600080fd5b6001600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060038590806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508473ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b6000806000809150600090505b6003805490508110156111c65760016000858152602001908152602001600020600060038381548110151561112757fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156111a6576001820191505b6004548214156111b957600192506111c7565b80806001019150506110f6565b5b5050919050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561120857600080fd5b806006819055507fd1c9101a34feff75cccef14a28785a0279cb0b49c1f321f21f5f422e746b4377816040518082815260200191505060405180910390a150565b600080600090505b60038054905081101561130e5760016000848152602001908152602001600020600060038381548110151561128257fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611301576001820191505b8080600101915050611251565b50919050565b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806001015490806002018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156113ec5780601f106113c1576101008083540402835291602001916113ec565b820191906000526020600020905b8154815290600101906020018083116113cf57829003601f168201915b5050505050908060030160009054906101000a900460ff16905084565b6060600380548060200260200160405190810160405280929190818152602001828054801561148d57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311611443575b5050505050905090565b6060806000806005546040519080825280602002602001820160405280156114ce5781602001602082028038833980820191505090505b50925060009150600090505b60055481101561157a57858015611511575060008082815260200190815260200160002060030160009054906101000a900460ff16155b806115445750848015611543575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b1561156d5780838381518110151561155857fe5b90602001906020020181815250506001820191505b80806001019150506114da565b8787036040519080825280602002602001820160405280156115ab5781602001602082028038833980820191505090505b5093508790505b868110156115fd5782818151811015156115c857fe5b90602001906020020151848983038151811015156115e257fe5b906020019060200201818152505080806001019150506115b2565b505050949350505050565b6060806000806003805490506040519080825280602002602001820160405280156116425781602001602082028038833980820191505090505b50925060009150600090505b60038054905081101561178f5760016000868152602001908152602001600020600060038381548110151561167f57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156117825760038181548110151561170657fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16838381518110151561173f57fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001820191505b808060010191505061164e565b816040519080825280602002602001820160405280156117be5781602001602082028038833980820191505090505b509350600090505b8181101561183d5782818151811015156117dc57fe5b9060200190602002015184828151811015156117f457fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505080806001019150506117c6565b505050919050565b60055481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561188557600080fd5b60038054905081603282118061189a57508181115b806118a55750600081145b806118b05750600082145b156118ba57600080fd5b826004819055507fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a836040518082815260200191505060405180910390a1505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561195657600080fd5b81600080600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156119b057600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611a1a57600080fd5b84611a24816110e9565b151515611a3057600080fd5b600180600088815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550853373ffffffffffffffffffffffffffffffffffffffff167f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef60405160405180910390a3611ae5866110e9565b15611af557611af48642612037565b5b505050505050565b6000611b0a84848461208b565b9050611b15816118fd565b9392505050565b60076020528060005260406000206000915090505481565b603281565b60045481565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611b7b57600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611bd457600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611c2c57600080fd5b600092505b600380549050831015611d15578473ffffffffffffffffffffffffffffffffffffffff16600384815481101515611c6457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611d085783600384815481101515611cbb57fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611d15565b8280600101935050611c31565b6000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508473ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a28373ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b60008160008082815260200190815260200160002060030160009054906101000a900460ff1615611e8257600080fd5b82611e8c816110e9565b1515611e9757600080fd5b836006546007600083815260200190815260200160002054014210151515611ebe57600080fd5b600080868152602001908152602001600020935060018460030160006101000a81548160ff0219169083151502179055508360000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168460010154856002016040518082805460018160011615610100020316600290048015611f985780601f10611f6d57610100808354040283529160200191611f98565b820191906000526020600020905b815481529060010190602001808311611f7b57829003601f168201915b505091505060006040518083038185875af19250505015611fe557847f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a2612030565b847f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260008460030160006101000a81548160ff0219169083151502179055505b5050505050565b806007600084815260200190815260200160002081905550817f0b237afe65f1514fd7ea3f923ea4fe792bdd07000a912b6cd1602a8e7f573c8d826040518082815260200191505060405180910390a25050565b60008360008173ffffffffffffffffffffffffffffffffffffffff1614156120b257600080fd5b60055491506080604051908101604052808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020016000151581525060008084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101556040820151816002019080519060200190612171929190612207565b5060608201518160030160006101000a81548160ff0219169083151502179055509050506001600560008282540192505081905550817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a2509392505050565b815481835581811115612202578183600052602060002091820191016122019190612287565b5b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061224857805160ff1916838001178555612276565b82800160010185558215612276579182015b8281111561227557825182559160200191906001019061225a565b5b5090506122839190612287565b5090565b6122a991905b808211156122a557600081600090555060010161228d565b5090565b905600a165627a7a723058202f1c20164401b86f77a2783be7a520331c1545ffca80947f1ae34489f487a9d60029",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH3 0x11 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x40 MLOAD PUSH3 0x25AF CODESIZE SUB DUP1 PUSH3 0x25AF DUP4 CODECOPY DUP2 ADD DUP1 PUSH1 0x40 MSTORE DUP2 ADD SWAP1 DUP1 DUP1 MLOAD DUP3 ADD SWAP3 SWAP2 SWAP1 PUSH1 0x20 ADD DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP DUP3 DUP3 PUSH1 0x0 DUP3 MLOAD DUP3 PUSH1 0x32 DUP3 GT DUP1 PUSH3 0x63 JUMPI POP DUP2 DUP2 GT JUMPDEST DUP1 PUSH3 0x6F JUMPI POP PUSH1 0x0 DUP2 EQ JUMPDEST DUP1 PUSH3 0x7B JUMPI POP PUSH1 0x0 DUP3 EQ JUMPDEST ISZERO PUSH3 0x86 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 SWAP3 POP JUMPDEST DUP5 MLOAD DUP4 LT ISZERO PUSH3 0x1BD JUMPI PUSH1 0x2 PUSH1 0x0 DUP7 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH3 0xA8 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND DUP1 PUSH3 0x134 JUMPI POP PUSH1 0x0 DUP6 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH3 0x112 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ JUMPDEST ISZERO PUSH3 0x13F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x1 PUSH1 0x2 PUSH1 0x0 DUP8 DUP7 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH3 0x154 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP DUP3 DUP1 PUSH1 0x1 ADD SWAP4 POP POP PUSH3 0x8B JUMP JUMPDEST DUP5 PUSH1 0x3 SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH3 0x1D5 SWAP3 SWAP2 SWAP1 PUSH3 0x1F2 JUMP JUMPDEST POP DUP4 PUSH1 0x4 DUP2 SWAP1 SSTORE POP POP POP POP POP POP DUP1 PUSH1 0x6 DUP2 SWAP1 SSTORE POP POP POP POP PUSH3 0x2C7 JUMP JUMPDEST DUP3 DUP1 SLOAD DUP3 DUP3 SSTORE SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 DUP2 ADD SWAP3 DUP3 ISZERO PUSH3 0x26E JUMPI SWAP2 PUSH1 0x20 MUL DUP3 ADD JUMPDEST DUP3 DUP2 GT ISZERO PUSH3 0x26D JUMPI DUP3 MLOAD DUP3 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP SWAP2 PUSH1 0x20 ADD SWAP2 SWAP1 PUSH1 0x1 ADD SWAP1 PUSH3 0x213 JUMP JUMPDEST JUMPDEST POP SWAP1 POP PUSH3 0x27D SWAP2 SWAP1 PUSH3 0x281 JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST PUSH3 0x2C4 SWAP2 SWAP1 JUMPDEST DUP1 DUP3 GT ISZERO PUSH3 0x2C0 JUMPI PUSH1 0x0 DUP2 DUP2 PUSH2 0x100 EXP DUP2 SLOAD SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 SSTORE POP PUSH1 0x1 ADD PUSH3 0x288 JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST SWAP1 JUMP JUMPDEST PUSH2 0x22D8 DUP1 PUSH3 0x2D7 PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN STOP PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x13E JUMPI PUSH1 0x0 CALLDATALOAD PUSH29 0x100000000000000000000000000000000000000000000000000000000 SWAP1 DIV PUSH4 0xFFFFFFFF AND DUP1 PUSH4 0x25E7C27 EQ PUSH2 0x198 JUMPI DUP1 PUSH4 0x173825D9 EQ PUSH2 0x205 JUMPI DUP1 PUSH4 0x20EA8D86 EQ PUSH2 0x248 JUMPI DUP1 PUSH4 0x2F54BF6E EQ PUSH2 0x275 JUMPI DUP1 PUSH4 0x3411C81C EQ PUSH2 0x2D0 JUMPI DUP1 PUSH4 0x37BD78A0 EQ PUSH2 0x335 JUMPI DUP1 PUSH4 0x54741525 EQ PUSH2 0x360 JUMPI DUP1 PUSH4 0x7065CB48 EQ PUSH2 0x3AF JUMPI DUP1 PUSH4 0x784547A7 EQ PUSH2 0x3F2 JUMPI DUP1 PUSH4 0x7AD28C51 EQ PUSH2 0x437 JUMPI DUP1 PUSH4 0x8B51D13F EQ PUSH2 0x464 JUMPI DUP1 PUSH4 0x9ACE38C2 EQ PUSH2 0x4A5 JUMPI DUP1 PUSH4 0xA0E67E2B EQ PUSH2 0x590 JUMPI DUP1 PUSH4 0xA8ABE69A EQ PUSH2 0x5FC JUMPI DUP1 PUSH4 0xB5DC40C3 EQ PUSH2 0x6A0 JUMPI DUP1 PUSH4 0xB77BF600 EQ PUSH2 0x722 JUMPI DUP1 PUSH4 0xBA51A6DF EQ PUSH2 0x74D JUMPI DUP1 PUSH4 0xC01A8C84 EQ PUSH2 0x77A JUMPI DUP1 PUSH4 0xC6427474 EQ PUSH2 0x7A7 JUMPI DUP1 PUSH4 0xD38F2D82 EQ PUSH2 0x84E JUMPI DUP1 PUSH4 0xD74F8EDD EQ PUSH2 0x88F JUMPI DUP1 PUSH4 0xDC8452CD EQ PUSH2 0x8BA JUMPI DUP1 PUSH4 0xE20056E6 EQ PUSH2 0x8E5 JUMPI DUP1 PUSH4 0xEE22610B EQ PUSH2 0x948 JUMPI JUMPDEST PUSH1 0x0 CALLVALUE GT ISZERO PUSH2 0x196 JUMPI CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xE1FFFCC4923D04B559F4D29A8BFC6CDA04EB5B0D3C460751C2402C5C5CC9109C CALLVALUE PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1A4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1C3 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x975 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x211 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x246 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x9B3 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x254 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x273 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xC4C JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x281 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2B6 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xE09 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2DC JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x31B PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xE29 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x341 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x34A PUSH2 0xE58 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x36C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x399 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD ISZERO ISZERO SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD ISZERO ISZERO SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xE5E JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3BB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x3F0 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xEF0 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3FE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x41D PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x10E9 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x443 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x462 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x11CE JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x470 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x48F PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1249 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x4B1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x4D0 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1314 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP5 DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP4 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE DUP5 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x552 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x537 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x57F JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP6 POP POP POP POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x59C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x5A5 PUSH2 0x1409 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE DUP4 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x5E8 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x5CD JUMP JUMPDEST POP POP POP POP SWAP1 POP ADD SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x608 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x649 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD ISZERO ISZERO SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD ISZERO ISZERO SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1497 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE DUP4 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x68C JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x671 JUMP JUMPDEST POP POP POP POP SWAP1 POP ADD SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x6AC JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x6CB PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1608 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE DUP4 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x70E JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x6F3 JUMP JUMPDEST POP POP POP POP SWAP1 POP ADD SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x72E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x737 PUSH2 0x1845 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x759 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x778 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x184B JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x786 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x7A5 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x18FD JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x7B3 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x838 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 POP POP POP PUSH2 0x1AFD JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x85A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x879 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1B1C JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x89B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x8A4 PUSH2 0x1B34 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x8C6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x8CF PUSH2 0x1B39 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x8F1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x946 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1B3F JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x954 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x973 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1E52 JUMP JUMPDEST STOP JUMPDEST PUSH1 0x3 DUP2 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x984 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP2 POP SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 ADDRESS PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x9EF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 PUSH1 0x2 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO ISZERO PUSH2 0xA48 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH1 0x2 PUSH1 0x0 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP PUSH1 0x0 SWAP2 POP JUMPDEST PUSH1 0x1 PUSH1 0x3 DUP1 SLOAD SWAP1 POP SUB DUP3 LT ISZERO PUSH2 0xBCD JUMPI DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x3 DUP4 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0xADB JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0xBC0 JUMPI PUSH1 0x3 PUSH1 0x1 PUSH1 0x3 DUP1 SLOAD SWAP1 POP SUB DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0xB39 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x3 DUP4 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0xB73 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH2 0xBCD JUMP JUMPDEST DUP2 DUP1 PUSH1 0x1 ADD SWAP3 POP POP PUSH2 0xAA5 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x3 DUP2 DUP2 DUP1 SLOAD SWAP1 POP SUB SWAP2 POP DUP2 PUSH2 0xBE5 SWAP2 SWAP1 PUSH2 0x21DB JUMP JUMPDEST POP PUSH1 0x3 DUP1 SLOAD SWAP1 POP PUSH1 0x4 SLOAD GT ISZERO PUSH2 0xC04 JUMPI PUSH2 0xC03 PUSH1 0x3 DUP1 SLOAD SWAP1 POP PUSH2 0x184B JUMP JUMPDEST JUMPDEST DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x8001553A916EF2F495D26A907CC54D96ED840D7BDA71E73194BF5A9DF7A76B90 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 POP POP POP JUMP JUMPDEST CALLER PUSH1 0x2 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO ISZERO PUSH2 0xCA5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLER PUSH1 0x1 PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO ISZERO PUSH2 0xD10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP4 PUSH1 0x0 DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0xD3E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP5 PUSH2 0xD48 DUP2 PUSH2 0x10E9 JUMP JUMPDEST ISZERO ISZERO ISZERO PUSH2 0xD54 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH1 0x1 PUSH1 0x0 DUP9 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP DUP6 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xF6A317157440607F36269043EB55F1287A5A19BA2216AFEAB88CD46CBCFB88E9 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x2 PUSH1 0x20 MSTORE DUP1 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP2 POP SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x20 MSTORE DUP2 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x20 MSTORE DUP1 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP2 POP SWAP2 POP SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH1 0x6 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 POP JUMPDEST PUSH1 0x5 SLOAD DUP2 LT ISZERO PUSH2 0xEE9 JUMPI DUP4 DUP1 ISZERO PUSH2 0xE9D JUMPI POP PUSH1 0x0 DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO JUMPDEST DUP1 PUSH2 0xED0 JUMPI POP DUP3 DUP1 ISZERO PUSH2 0xECF JUMPI POP PUSH1 0x0 DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND JUMPDEST JUMPDEST ISZERO PUSH2 0xEDC JUMPI PUSH1 0x1 DUP3 ADD SWAP2 POP JUMPDEST DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0xE66 JUMP JUMPDEST POP SWAP3 SWAP2 POP POP JUMP JUMPDEST ADDRESS PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0xF2A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 PUSH1 0x2 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0xF82 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 PUSH1 0x0 DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0xFA7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x1 PUSH1 0x3 DUP1 SLOAD SWAP1 POP ADD PUSH1 0x4 SLOAD PUSH1 0x32 DUP3 GT DUP1 PUSH2 0xFC1 JUMPI POP DUP2 DUP2 GT JUMPDEST DUP1 PUSH2 0xFCC JUMPI POP PUSH1 0x0 DUP2 EQ JUMPDEST DUP1 PUSH2 0xFD7 JUMPI POP PUSH1 0x0 DUP3 EQ JUMPDEST ISZERO PUSH2 0xFE1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x1 PUSH1 0x2 PUSH1 0x0 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP PUSH1 0x3 DUP6 SWAP1 DUP1 PUSH1 0x1 DUP2 SLOAD ADD DUP1 DUP3 SSTORE DUP1 SWAP2 POP POP SWAP1 PUSH1 0x1 DUP3 SUB SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SWAP2 SWAP3 SWAP1 SWAP2 SWAP1 SWAP2 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP POP DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xF39E6E1EB0EDCF53C221607B54B00CD28F3196FED0A24994DC308B8F611B682D PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 SWAP2 POP PUSH1 0x0 SWAP1 POP JUMPDEST PUSH1 0x3 DUP1 SLOAD SWAP1 POP DUP2 LT ISZERO PUSH2 0x11C6 JUMPI PUSH1 0x1 PUSH1 0x0 DUP6 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH1 0x3 DUP4 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1127 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0x11A6 JUMPI PUSH1 0x1 DUP3 ADD SWAP2 POP JUMPDEST PUSH1 0x4 SLOAD DUP3 EQ ISZERO PUSH2 0x11B9 JUMPI PUSH1 0x1 SWAP3 POP PUSH2 0x11C7 JUMP JUMPDEST DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0x10F6 JUMP JUMPDEST JUMPDEST POP POP SWAP2 SWAP1 POP JUMP JUMPDEST ADDRESS PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x1208 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 PUSH1 0x6 DUP2 SWAP1 SSTORE POP PUSH32 0xD1C9101A34FEFF75CCCEF14A28785A0279CB0B49C1F321F21F5F422E746B4377 DUP2 PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 POP JUMPDEST PUSH1 0x3 DUP1 SLOAD SWAP1 POP DUP2 LT ISZERO PUSH2 0x130E JUMPI PUSH1 0x1 PUSH1 0x0 DUP5 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH1 0x3 DUP4 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1282 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0x1301 JUMPI PUSH1 0x1 DUP3 ADD SWAP2 POP JUMPDEST DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0x1251 JUMP JUMPDEST POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 MSTORE DUP1 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP2 POP SWAP1 POP DUP1 PUSH1 0x0 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 DUP1 PUSH1 0x1 ADD SLOAD SWAP1 DUP1 PUSH1 0x2 ADD DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x13EC JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x13C1 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x13EC JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x13CF JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP1 DUP1 PUSH1 0x3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND SWAP1 POP DUP5 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x3 DUP1 SLOAD DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD DUP1 ISZERO PUSH2 0x148D JUMPI PUSH1 0x20 MUL DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 PUSH1 0x1 ADD SWAP1 DUP1 DUP4 GT PUSH2 0x1443 JUMPI JUMPDEST POP POP POP POP POP SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x60 DUP1 PUSH1 0x0 DUP1 PUSH1 0x5 SLOAD PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x14CE JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CODESIZE DUP4 CODECOPY DUP1 DUP3 ADD SWAP2 POP POP SWAP1 POP JUMPDEST POP SWAP3 POP PUSH1 0x0 SWAP2 POP PUSH1 0x0 SWAP1 POP JUMPDEST PUSH1 0x5 SLOAD DUP2 LT ISZERO PUSH2 0x157A JUMPI DUP6 DUP1 ISZERO PUSH2 0x1511 JUMPI POP PUSH1 0x0 DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO JUMPDEST DUP1 PUSH2 0x1544 JUMPI POP DUP5 DUP1 ISZERO PUSH2 0x1543 JUMPI POP PUSH1 0x0 DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND JUMPDEST JUMPDEST ISZERO PUSH2 0x156D JUMPI DUP1 DUP4 DUP4 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1558 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD DUP2 DUP2 MSTORE POP POP PUSH1 0x1 DUP3 ADD SWAP2 POP JUMPDEST DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0x14DA JUMP JUMPDEST DUP8 DUP8 SUB PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x15AB JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CODESIZE DUP4 CODECOPY DUP1 DUP3 ADD SWAP2 POP POP SWAP1 POP JUMPDEST POP SWAP4 POP DUP8 SWAP1 POP JUMPDEST DUP7 DUP2 LT ISZERO PUSH2 0x15FD JUMPI DUP3 DUP2 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x15C8 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP5 DUP10 DUP4 SUB DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x15E2 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD DUP2 DUP2 MSTORE POP POP DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0x15B2 JUMP JUMPDEST POP POP POP SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x60 DUP1 PUSH1 0x0 DUP1 PUSH1 0x3 DUP1 SLOAD SWAP1 POP PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x1642 JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CODESIZE DUP4 CODECOPY DUP1 DUP3 ADD SWAP2 POP POP SWAP1 POP JUMPDEST POP SWAP3 POP PUSH1 0x0 SWAP2 POP PUSH1 0x0 SWAP1 POP JUMPDEST PUSH1 0x3 DUP1 SLOAD SWAP1 POP DUP2 LT ISZERO PUSH2 0x178F JUMPI PUSH1 0x1 PUSH1 0x0 DUP7 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH1 0x3 DUP4 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x167F JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0x1782 JUMPI PUSH1 0x3 DUP2 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1706 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP4 DUP4 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x173F JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE POP POP PUSH1 0x1 DUP3 ADD SWAP2 POP JUMPDEST DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0x164E JUMP JUMPDEST DUP2 PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x17BE JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CODESIZE DUP4 CODECOPY DUP1 DUP3 ADD SWAP2 POP POP SWAP1 POP JUMPDEST POP SWAP4 POP PUSH1 0x0 SWAP1 POP JUMPDEST DUP2 DUP2 LT ISZERO PUSH2 0x183D JUMPI DUP3 DUP2 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x17DC JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP5 DUP3 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x17F4 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE POP POP DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0x17C6 JUMP JUMPDEST POP POP POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x5 SLOAD DUP2 JUMP JUMPDEST ADDRESS PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x1885 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x3 DUP1 SLOAD SWAP1 POP DUP2 PUSH1 0x32 DUP3 GT DUP1 PUSH2 0x189A JUMPI POP DUP2 DUP2 GT JUMPDEST DUP1 PUSH2 0x18A5 JUMPI POP PUSH1 0x0 DUP2 EQ JUMPDEST DUP1 PUSH2 0x18B0 JUMPI POP PUSH1 0x0 DUP3 EQ JUMPDEST ISZERO PUSH2 0x18BA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 PUSH1 0x4 DUP2 SWAP1 SSTORE POP PUSH32 0xA3F1EE9126A074D9326C682F561767F710E927FAA811F7A99829D49DC421797A DUP4 PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG1 POP POP POP JUMP JUMPDEST CALLER PUSH1 0x2 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO ISZERO PUSH2 0x1956 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 PUSH1 0x0 DUP1 PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0x19B0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 CALLER PUSH1 0x1 PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0x1A1A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP5 PUSH2 0x1A24 DUP2 PUSH2 0x10E9 JUMP JUMPDEST ISZERO ISZERO ISZERO PUSH2 0x1A30 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x1 DUP1 PUSH1 0x0 DUP9 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP DUP6 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x4A504A94899432A9846E1AA406DCEB1BCFD538BB839071D49D1E5E23F5BE30EF PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH2 0x1AE5 DUP7 PUSH2 0x10E9 JUMP JUMPDEST ISZERO PUSH2 0x1AF5 JUMPI PUSH2 0x1AF4 DUP7 TIMESTAMP PUSH2 0x2037 JUMP JUMPDEST JUMPDEST POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x1B0A DUP5 DUP5 DUP5 PUSH2 0x208B JUMP JUMPDEST SWAP1 POP PUSH2 0x1B15 DUP2 PUSH2 0x18FD JUMP JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x7 PUSH1 0x20 MSTORE DUP1 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP2 POP SWAP1 POP SLOAD DUP2 JUMP JUMPDEST PUSH1 0x32 DUP2 JUMP JUMPDEST PUSH1 0x4 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 ADDRESS PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x1B7B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 PUSH1 0x2 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO ISZERO PUSH2 0x1BD4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 PUSH1 0x2 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0x1C2C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 SWAP3 POP JUMPDEST PUSH1 0x3 DUP1 SLOAD SWAP1 POP DUP4 LT ISZERO PUSH2 0x1D15 JUMPI DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x3 DUP5 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1C64 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0x1D08 JUMPI DUP4 PUSH1 0x3 DUP5 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1CBB JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH2 0x1D15 JUMP JUMPDEST DUP3 DUP1 PUSH1 0x1 ADD SWAP4 POP POP PUSH2 0x1C31 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x2 PUSH1 0x0 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP PUSH1 0x1 PUSH1 0x2 PUSH1 0x0 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x8001553A916EF2F495D26A907CC54D96ED840D7BDA71E73194BF5A9DF7A76B90 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xF39E6E1EB0EDCF53C221607B54B00CD28F3196FED0A24994DC308B8F611B682D PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x0 DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0x1E82 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 PUSH2 0x1E8C DUP2 PUSH2 0x10E9 JUMP JUMPDEST ISZERO ISZERO PUSH2 0x1E97 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP4 PUSH1 0x6 SLOAD PUSH1 0x7 PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD ADD TIMESTAMP LT ISZERO ISZERO ISZERO PUSH2 0x1EBE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP1 DUP7 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SWAP4 POP PUSH1 0x1 DUP5 PUSH1 0x3 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP DUP4 PUSH1 0x0 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP5 PUSH1 0x1 ADD SLOAD DUP6 PUSH1 0x2 ADD PUSH1 0x40 MLOAD DUP1 DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x1F98 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x1F6D JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x1F98 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x1F7B JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP SWAP2 POP POP PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP6 DUP8 GAS CALL SWAP3 POP POP POP ISZERO PUSH2 0x1FE5 JUMPI DUP5 PUSH32 0x33E13ECB54C3076D8E8BB8C2881800A4D972B792045FFAE98FDF46DF365FED75 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 PUSH2 0x2030 JUMP JUMPDEST DUP5 PUSH32 0x526441BB6C1ABA3C9A4A6CA1D6545DA9C2333C8C48343EF398EB858D72B79236 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 PUSH1 0x0 DUP5 PUSH1 0x3 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP JUMPDEST POP POP POP POP POP JUMP JUMPDEST DUP1 PUSH1 0x7 PUSH1 0x0 DUP5 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP DUP2 PUSH32 0xB237AFE65F1514FD7EA3F923EA4FE792BDD07000A912B6CD1602A8E7F573C8D DUP3 PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP4 PUSH1 0x0 DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0x20B2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x5 SLOAD SWAP2 POP PUSH1 0x80 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP6 DUP2 MSTORE PUSH1 0x20 ADD DUP5 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 ISZERO ISZERO DUP2 MSTORE POP PUSH1 0x0 DUP1 DUP5 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 ADD MLOAD DUP2 PUSH1 0x0 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH1 0x20 DUP3 ADD MLOAD DUP2 PUSH1 0x1 ADD SSTORE PUSH1 0x40 DUP3 ADD MLOAD DUP2 PUSH1 0x2 ADD SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH2 0x2171 SWAP3 SWAP2 SWAP1 PUSH2 0x2207 JUMP JUMPDEST POP PUSH1 0x60 DUP3 ADD MLOAD DUP2 PUSH1 0x3 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP SWAP1 POP POP PUSH1 0x1 PUSH1 0x5 PUSH1 0x0 DUP3 DUP3 SLOAD ADD SWAP3 POP POP DUP2 SWAP1 SSTORE POP DUP2 PUSH32 0xC0BA8FE4B176C1714197D43B9CC6BCF797A4A7461C5FE8D0EF6E184AE7601E51 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST DUP2 SLOAD DUP2 DUP4 SSTORE DUP2 DUP2 GT ISZERO PUSH2 0x2202 JUMPI DUP2 DUP4 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP2 DUP3 ADD SWAP2 ADD PUSH2 0x2201 SWAP2 SWAP1 PUSH2 0x2287 JUMP JUMPDEST JUMPDEST POP POP POP JUMP JUMPDEST DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 PUSH1 0x1F ADD PUSH1 0x20 SWAP1 DIV DUP2 ADD SWAP3 DUP3 PUSH1 0x1F LT PUSH2 0x2248 JUMPI DUP1 MLOAD PUSH1 0xFF NOT AND DUP4 DUP1 ADD OR DUP6 SSTORE PUSH2 0x2276 JUMP JUMPDEST DUP3 DUP1 ADD PUSH1 0x1 ADD DUP6 SSTORE DUP3 ISZERO PUSH2 0x2276 JUMPI SWAP2 DUP3 ADD JUMPDEST DUP3 DUP2 GT ISZERO PUSH2 0x2275 JUMPI DUP3 MLOAD DUP3 SSTORE SWAP2 PUSH1 0x20 ADD SWAP2 SWAP1 PUSH1 0x1 ADD SWAP1 PUSH2 0x225A JUMP JUMPDEST JUMPDEST POP SWAP1 POP PUSH2 0x2283 SWAP2 SWAP1 PUSH2 0x2287 JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST PUSH2 0x22A9 SWAP2 SWAP1 JUMPDEST DUP1 DUP3 GT ISZERO PUSH2 0x22A5 JUMPI PUSH1 0x0 DUP2 PUSH1 0x0 SWAP1 SSTORE POP PUSH1 0x1 ADD PUSH2 0x228D JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST SWAP1 JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 0x2f SHR KECCAK256 AND DIFFICULTY ADD 0xb8 PUSH16 0x77A2783BE7A520331C1545FFCA80947F BYTE 0xe3 DIFFICULTY DUP10 DELEGATECALL DUP8 0xa9 0xd6 STOP 0x29 ",
- "sourceMap": "855:3594:1:-;;;1904:213;8:9:-1;5:2;;;30:1;27;20:12;5:2;1904:213:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2038:7;2047:9;2959:6:0;2913:7;:14;2929:9;256:2;2236:10;:28;:66;;;;2292:10;2280:9;:22;2236:66;:96;;;;2331:1;2318:9;:14;2236:96;:127;;;;2362:1;2348:10;:15;2236:127;2229:153;;;2377:5;;;2229:153;2966:1;2959:8;;2954:168;2971:7;:14;2969:1;:16;2954:168;;;3010:7;:19;3018:7;3026:1;3018:10;;;;;;;;;;;;;;;;;;3010:19;;;;;;;;;;;;;;;;;;;;;;;;;:38;;;;3047:1;3033:7;3041:1;3033:10;;;;;;;;;;;;;;;;;;:15;;;3010:38;3006:65;;;3066:5;;;3006:65;3107:4;3085:7;:19;3093:7;3101:1;3093:10;;;;;;;;;;;;;;;;;;3085:19;;;;;;;;;;;;;;;;:26;;;;;;;;;;;;;;;;;;2987:3;;;;;;;2954:168;;;3140:7;3131:6;:16;;;;;;;;;;;;:::i;:::-;;3168:9;3157:8;:20;;;;2814:370;;;;;2092:18:1;2072:17;:38;;;;1904:213;;;855:3594;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;"
- },
- "deployedBytecode": {
- "linkReferences": {},
- "object": "0x60806040526004361061013e576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063025e7c2714610198578063173825d91461020557806320ea8d86146102485780632f54bf6e146102755780633411c81c146102d057806337bd78a01461033557806354741525146103605780637065cb48146103af578063784547a7146103f25780637ad28c51146104375780638b51d13f146104645780639ace38c2146104a5578063a0e67e2b14610590578063a8abe69a146105fc578063b5dc40c3146106a0578063b77bf60014610722578063ba51a6df1461074d578063c01a8c841461077a578063c6427474146107a7578063d38f2d821461084e578063d74f8edd1461088f578063dc8452cd146108ba578063e20056e6146108e5578063ee22610b14610948575b6000341115610196573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a25b005b3480156101a457600080fd5b506101c360048036038101908080359060200190929190505050610975565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561021157600080fd5b50610246600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109b3565b005b34801561025457600080fd5b5061027360048036038101908080359060200190929190505050610c4c565b005b34801561028157600080fd5b506102b6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e09565b604051808215151515815260200191505060405180910390f35b3480156102dc57600080fd5b5061031b60048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e29565b604051808215151515815260200191505060405180910390f35b34801561034157600080fd5b5061034a610e58565b6040518082815260200191505060405180910390f35b34801561036c57600080fd5b50610399600480360381019080803515159060200190929190803515159060200190929190505050610e5e565b6040518082815260200191505060405180910390f35b3480156103bb57600080fd5b506103f0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ef0565b005b3480156103fe57600080fd5b5061041d600480360381019080803590602001909291905050506110e9565b604051808215151515815260200191505060405180910390f35b34801561044357600080fd5b50610462600480360381019080803590602001909291905050506111ce565b005b34801561047057600080fd5b5061048f60048036038101908080359060200190929190505050611249565b6040518082815260200191505060405180910390f35b3480156104b157600080fd5b506104d060048036038101908080359060200190929190505050611314565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018060200183151515158152602001828103825284818151815260200191508051906020019080838360005b83811015610552578082015181840152602081019050610537565b50505050905090810190601f16801561057f5780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b34801561059c57600080fd5b506105a5611409565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156105e85780820151818401526020810190506105cd565b505050509050019250505060405180910390f35b34801561060857600080fd5b506106496004803603810190808035906020019092919080359060200190929190803515159060200190929190803515159060200190929190505050611497565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561068c578082015181840152602081019050610671565b505050509050019250505060405180910390f35b3480156106ac57600080fd5b506106cb60048036038101908080359060200190929190505050611608565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561070e5780820151818401526020810190506106f3565b505050509050019250505060405180910390f35b34801561072e57600080fd5b50610737611845565b6040518082815260200191505060405180910390f35b34801561075957600080fd5b506107786004803603810190808035906020019092919050505061184b565b005b34801561078657600080fd5b506107a5600480360381019080803590602001909291905050506118fd565b005b3480156107b357600080fd5b50610838600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050611afd565b6040518082815260200191505060405180910390f35b34801561085a57600080fd5b5061087960048036038101908080359060200190929190505050611b1c565b6040518082815260200191505060405180910390f35b34801561089b57600080fd5b506108a4611b34565b6040518082815260200191505060405180910390f35b3480156108c657600080fd5b506108cf611b39565b6040518082815260200191505060405180910390f35b3480156108f157600080fd5b50610946600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b3f565b005b34801561095457600080fd5b5061097360048036038101908080359060200190929190505050611e52565b005b60038181548110151561098457fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156109ef57600080fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610a4857600080fd5b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600091505b600160038054905003821015610bcd578273ffffffffffffffffffffffffffffffffffffffff16600383815481101515610adb57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610bc0576003600160038054905003815481101515610b3957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600383815481101515610b7357fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610bcd565b8180600101925050610aa5565b6001600381818054905003915081610be591906121db565b506003805490506004541115610c0457610c0360038054905061184b565b5b8273ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a2505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610ca557600080fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610d1057600080fd5b8360008082815260200190815260200160002060030160009054906101000a900460ff1615610d3e57600080fd5b84610d48816110e9565b151515610d5457600080fd5b60006001600088815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550853373ffffffffffffffffffffffffffffffffffffffff167ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e960405160405180910390a3505050505050565b60026020528060005260406000206000915054906101000a900460ff1681565b60016020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b60065481565b600080600090505b600554811015610ee957838015610e9d575060008082815260200190815260200160002060030160009054906101000a900460ff16155b80610ed05750828015610ecf575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b15610edc576001820191505b8080600101915050610e66565b5092915050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f2a57600080fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610f8257600080fd5b8160008173ffffffffffffffffffffffffffffffffffffffff161415610fa757600080fd5b6001600380549050016004546032821180610fc157508181115b80610fcc5750600081145b80610fd75750600082145b15610fe157600080fd5b6001600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060038590806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508473ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b6000806000809150600090505b6003805490508110156111c65760016000858152602001908152602001600020600060038381548110151561112757fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156111a6576001820191505b6004548214156111b957600192506111c7565b80806001019150506110f6565b5b5050919050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561120857600080fd5b806006819055507fd1c9101a34feff75cccef14a28785a0279cb0b49c1f321f21f5f422e746b4377816040518082815260200191505060405180910390a150565b600080600090505b60038054905081101561130e5760016000848152602001908152602001600020600060038381548110151561128257fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611301576001820191505b8080600101915050611251565b50919050565b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806001015490806002018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156113ec5780601f106113c1576101008083540402835291602001916113ec565b820191906000526020600020905b8154815290600101906020018083116113cf57829003601f168201915b5050505050908060030160009054906101000a900460ff16905084565b6060600380548060200260200160405190810160405280929190818152602001828054801561148d57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311611443575b5050505050905090565b6060806000806005546040519080825280602002602001820160405280156114ce5781602001602082028038833980820191505090505b50925060009150600090505b60055481101561157a57858015611511575060008082815260200190815260200160002060030160009054906101000a900460ff16155b806115445750848015611543575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b1561156d5780838381518110151561155857fe5b90602001906020020181815250506001820191505b80806001019150506114da565b8787036040519080825280602002602001820160405280156115ab5781602001602082028038833980820191505090505b5093508790505b868110156115fd5782818151811015156115c857fe5b90602001906020020151848983038151811015156115e257fe5b906020019060200201818152505080806001019150506115b2565b505050949350505050565b6060806000806003805490506040519080825280602002602001820160405280156116425781602001602082028038833980820191505090505b50925060009150600090505b60038054905081101561178f5760016000868152602001908152602001600020600060038381548110151561167f57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156117825760038181548110151561170657fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16838381518110151561173f57fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001820191505b808060010191505061164e565b816040519080825280602002602001820160405280156117be5781602001602082028038833980820191505090505b509350600090505b8181101561183d5782818151811015156117dc57fe5b9060200190602002015184828151811015156117f457fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505080806001019150506117c6565b505050919050565b60055481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561188557600080fd5b60038054905081603282118061189a57508181115b806118a55750600081145b806118b05750600082145b156118ba57600080fd5b826004819055507fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a836040518082815260200191505060405180910390a1505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561195657600080fd5b81600080600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156119b057600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611a1a57600080fd5b84611a24816110e9565b151515611a3057600080fd5b600180600088815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550853373ffffffffffffffffffffffffffffffffffffffff167f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef60405160405180910390a3611ae5866110e9565b15611af557611af48642612037565b5b505050505050565b6000611b0a84848461208b565b9050611b15816118fd565b9392505050565b60076020528060005260406000206000915090505481565b603281565b60045481565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611b7b57600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611bd457600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611c2c57600080fd5b600092505b600380549050831015611d15578473ffffffffffffffffffffffffffffffffffffffff16600384815481101515611c6457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611d085783600384815481101515611cbb57fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611d15565b8280600101935050611c31565b6000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508473ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a28373ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b60008160008082815260200190815260200160002060030160009054906101000a900460ff1615611e8257600080fd5b82611e8c816110e9565b1515611e9757600080fd5b836006546007600083815260200190815260200160002054014210151515611ebe57600080fd5b600080868152602001908152602001600020935060018460030160006101000a81548160ff0219169083151502179055508360000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168460010154856002016040518082805460018160011615610100020316600290048015611f985780601f10611f6d57610100808354040283529160200191611f98565b820191906000526020600020905b815481529060010190602001808311611f7b57829003601f168201915b505091505060006040518083038185875af19250505015611fe557847f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a2612030565b847f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260008460030160006101000a81548160ff0219169083151502179055505b5050505050565b806007600084815260200190815260200160002081905550817f0b237afe65f1514fd7ea3f923ea4fe792bdd07000a912b6cd1602a8e7f573c8d826040518082815260200191505060405180910390a25050565b60008360008173ffffffffffffffffffffffffffffffffffffffff1614156120b257600080fd5b60055491506080604051908101604052808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020016000151581525060008084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101556040820151816002019080519060200190612171929190612207565b5060608201518160030160006101000a81548160ff0219169083151502179055509050506001600560008282540192505081905550817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a2509392505050565b815481835581811115612202578183600052602060002091820191016122019190612287565b5b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061224857805160ff1916838001178555612276565b82800160010185558215612276579182015b8281111561227557825182559160200191906001019061225a565b5b5090506122839190612287565b5090565b6122a991905b808211156122a557600081600090555060010161228d565b5090565b905600a165627a7a723058202f1c20164401b86f77a2783be7a520331c1545ffca80947f1ae34489f487a9d60029",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x13E JUMPI PUSH1 0x0 CALLDATALOAD PUSH29 0x100000000000000000000000000000000000000000000000000000000 SWAP1 DIV PUSH4 0xFFFFFFFF AND DUP1 PUSH4 0x25E7C27 EQ PUSH2 0x198 JUMPI DUP1 PUSH4 0x173825D9 EQ PUSH2 0x205 JUMPI DUP1 PUSH4 0x20EA8D86 EQ PUSH2 0x248 JUMPI DUP1 PUSH4 0x2F54BF6E EQ PUSH2 0x275 JUMPI DUP1 PUSH4 0x3411C81C EQ PUSH2 0x2D0 JUMPI DUP1 PUSH4 0x37BD78A0 EQ PUSH2 0x335 JUMPI DUP1 PUSH4 0x54741525 EQ PUSH2 0x360 JUMPI DUP1 PUSH4 0x7065CB48 EQ PUSH2 0x3AF JUMPI DUP1 PUSH4 0x784547A7 EQ PUSH2 0x3F2 JUMPI DUP1 PUSH4 0x7AD28C51 EQ PUSH2 0x437 JUMPI DUP1 PUSH4 0x8B51D13F EQ PUSH2 0x464 JUMPI DUP1 PUSH4 0x9ACE38C2 EQ PUSH2 0x4A5 JUMPI DUP1 PUSH4 0xA0E67E2B EQ PUSH2 0x590 JUMPI DUP1 PUSH4 0xA8ABE69A EQ PUSH2 0x5FC JUMPI DUP1 PUSH4 0xB5DC40C3 EQ PUSH2 0x6A0 JUMPI DUP1 PUSH4 0xB77BF600 EQ PUSH2 0x722 JUMPI DUP1 PUSH4 0xBA51A6DF EQ PUSH2 0x74D JUMPI DUP1 PUSH4 0xC01A8C84 EQ PUSH2 0x77A JUMPI DUP1 PUSH4 0xC6427474 EQ PUSH2 0x7A7 JUMPI DUP1 PUSH4 0xD38F2D82 EQ PUSH2 0x84E JUMPI DUP1 PUSH4 0xD74F8EDD EQ PUSH2 0x88F JUMPI DUP1 PUSH4 0xDC8452CD EQ PUSH2 0x8BA JUMPI DUP1 PUSH4 0xE20056E6 EQ PUSH2 0x8E5 JUMPI DUP1 PUSH4 0xEE22610B EQ PUSH2 0x948 JUMPI JUMPDEST PUSH1 0x0 CALLVALUE GT ISZERO PUSH2 0x196 JUMPI CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xE1FFFCC4923D04B559F4D29A8BFC6CDA04EB5B0D3C460751C2402C5C5CC9109C CALLVALUE PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1A4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1C3 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x975 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x211 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x246 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x9B3 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x254 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x273 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xC4C JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x281 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2B6 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xE09 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2DC JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x31B PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xE29 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x341 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x34A PUSH2 0xE58 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x36C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x399 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD ISZERO ISZERO SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD ISZERO ISZERO SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xE5E JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3BB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x3F0 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xEF0 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3FE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x41D PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x10E9 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x443 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x462 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x11CE JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x470 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x48F PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1249 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x4B1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x4D0 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1314 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP5 DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP4 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE DUP5 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x552 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x537 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x57F JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP6 POP POP POP POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x59C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x5A5 PUSH2 0x1409 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE DUP4 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x5E8 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x5CD JUMP JUMPDEST POP POP POP POP SWAP1 POP ADD SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x608 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x649 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD ISZERO ISZERO SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD ISZERO ISZERO SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1497 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE DUP4 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x68C JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x671 JUMP JUMPDEST POP POP POP POP SWAP1 POP ADD SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x6AC JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x6CB PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1608 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE DUP4 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x70E JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x6F3 JUMP JUMPDEST POP POP POP POP SWAP1 POP ADD SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x72E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x737 PUSH2 0x1845 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x759 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x778 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x184B JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x786 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x7A5 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x18FD JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x7B3 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x838 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 POP POP POP PUSH2 0x1AFD JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x85A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x879 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1B1C JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x89B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x8A4 PUSH2 0x1B34 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x8C6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x8CF PUSH2 0x1B39 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x8F1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x946 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1B3F JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x954 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x973 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1E52 JUMP JUMPDEST STOP JUMPDEST PUSH1 0x3 DUP2 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x984 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP2 POP SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 ADDRESS PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x9EF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 PUSH1 0x2 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO ISZERO PUSH2 0xA48 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH1 0x2 PUSH1 0x0 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP PUSH1 0x0 SWAP2 POP JUMPDEST PUSH1 0x1 PUSH1 0x3 DUP1 SLOAD SWAP1 POP SUB DUP3 LT ISZERO PUSH2 0xBCD JUMPI DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x3 DUP4 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0xADB JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0xBC0 JUMPI PUSH1 0x3 PUSH1 0x1 PUSH1 0x3 DUP1 SLOAD SWAP1 POP SUB DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0xB39 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x3 DUP4 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0xB73 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH2 0xBCD JUMP JUMPDEST DUP2 DUP1 PUSH1 0x1 ADD SWAP3 POP POP PUSH2 0xAA5 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x3 DUP2 DUP2 DUP1 SLOAD SWAP1 POP SUB SWAP2 POP DUP2 PUSH2 0xBE5 SWAP2 SWAP1 PUSH2 0x21DB JUMP JUMPDEST POP PUSH1 0x3 DUP1 SLOAD SWAP1 POP PUSH1 0x4 SLOAD GT ISZERO PUSH2 0xC04 JUMPI PUSH2 0xC03 PUSH1 0x3 DUP1 SLOAD SWAP1 POP PUSH2 0x184B JUMP JUMPDEST JUMPDEST DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x8001553A916EF2F495D26A907CC54D96ED840D7BDA71E73194BF5A9DF7A76B90 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 POP POP POP JUMP JUMPDEST CALLER PUSH1 0x2 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO ISZERO PUSH2 0xCA5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLER PUSH1 0x1 PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO ISZERO PUSH2 0xD10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP4 PUSH1 0x0 DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0xD3E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP5 PUSH2 0xD48 DUP2 PUSH2 0x10E9 JUMP JUMPDEST ISZERO ISZERO ISZERO PUSH2 0xD54 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH1 0x1 PUSH1 0x0 DUP9 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP DUP6 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xF6A317157440607F36269043EB55F1287A5A19BA2216AFEAB88CD46CBCFB88E9 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x2 PUSH1 0x20 MSTORE DUP1 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP2 POP SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x20 MSTORE DUP2 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x20 MSTORE DUP1 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP2 POP SWAP2 POP SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH1 0x6 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 POP JUMPDEST PUSH1 0x5 SLOAD DUP2 LT ISZERO PUSH2 0xEE9 JUMPI DUP4 DUP1 ISZERO PUSH2 0xE9D JUMPI POP PUSH1 0x0 DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO JUMPDEST DUP1 PUSH2 0xED0 JUMPI POP DUP3 DUP1 ISZERO PUSH2 0xECF JUMPI POP PUSH1 0x0 DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND JUMPDEST JUMPDEST ISZERO PUSH2 0xEDC JUMPI PUSH1 0x1 DUP3 ADD SWAP2 POP JUMPDEST DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0xE66 JUMP JUMPDEST POP SWAP3 SWAP2 POP POP JUMP JUMPDEST ADDRESS PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0xF2A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 PUSH1 0x2 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0xF82 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 PUSH1 0x0 DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0xFA7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x1 PUSH1 0x3 DUP1 SLOAD SWAP1 POP ADD PUSH1 0x4 SLOAD PUSH1 0x32 DUP3 GT DUP1 PUSH2 0xFC1 JUMPI POP DUP2 DUP2 GT JUMPDEST DUP1 PUSH2 0xFCC JUMPI POP PUSH1 0x0 DUP2 EQ JUMPDEST DUP1 PUSH2 0xFD7 JUMPI POP PUSH1 0x0 DUP3 EQ JUMPDEST ISZERO PUSH2 0xFE1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x1 PUSH1 0x2 PUSH1 0x0 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP PUSH1 0x3 DUP6 SWAP1 DUP1 PUSH1 0x1 DUP2 SLOAD ADD DUP1 DUP3 SSTORE DUP1 SWAP2 POP POP SWAP1 PUSH1 0x1 DUP3 SUB SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SWAP2 SWAP3 SWAP1 SWAP2 SWAP1 SWAP2 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP POP DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xF39E6E1EB0EDCF53C221607B54B00CD28F3196FED0A24994DC308B8F611B682D PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 SWAP2 POP PUSH1 0x0 SWAP1 POP JUMPDEST PUSH1 0x3 DUP1 SLOAD SWAP1 POP DUP2 LT ISZERO PUSH2 0x11C6 JUMPI PUSH1 0x1 PUSH1 0x0 DUP6 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH1 0x3 DUP4 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1127 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0x11A6 JUMPI PUSH1 0x1 DUP3 ADD SWAP2 POP JUMPDEST PUSH1 0x4 SLOAD DUP3 EQ ISZERO PUSH2 0x11B9 JUMPI PUSH1 0x1 SWAP3 POP PUSH2 0x11C7 JUMP JUMPDEST DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0x10F6 JUMP JUMPDEST JUMPDEST POP POP SWAP2 SWAP1 POP JUMP JUMPDEST ADDRESS PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x1208 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 PUSH1 0x6 DUP2 SWAP1 SSTORE POP PUSH32 0xD1C9101A34FEFF75CCCEF14A28785A0279CB0B49C1F321F21F5F422E746B4377 DUP2 PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 POP JUMPDEST PUSH1 0x3 DUP1 SLOAD SWAP1 POP DUP2 LT ISZERO PUSH2 0x130E JUMPI PUSH1 0x1 PUSH1 0x0 DUP5 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH1 0x3 DUP4 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1282 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0x1301 JUMPI PUSH1 0x1 DUP3 ADD SWAP2 POP JUMPDEST DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0x1251 JUMP JUMPDEST POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 MSTORE DUP1 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP2 POP SWAP1 POP DUP1 PUSH1 0x0 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 DUP1 PUSH1 0x1 ADD SLOAD SWAP1 DUP1 PUSH1 0x2 ADD DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x13EC JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x13C1 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x13EC JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x13CF JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP1 DUP1 PUSH1 0x3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND SWAP1 POP DUP5 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x3 DUP1 SLOAD DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD DUP1 ISZERO PUSH2 0x148D JUMPI PUSH1 0x20 MUL DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 PUSH1 0x1 ADD SWAP1 DUP1 DUP4 GT PUSH2 0x1443 JUMPI JUMPDEST POP POP POP POP POP SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x60 DUP1 PUSH1 0x0 DUP1 PUSH1 0x5 SLOAD PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x14CE JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CODESIZE DUP4 CODECOPY DUP1 DUP3 ADD SWAP2 POP POP SWAP1 POP JUMPDEST POP SWAP3 POP PUSH1 0x0 SWAP2 POP PUSH1 0x0 SWAP1 POP JUMPDEST PUSH1 0x5 SLOAD DUP2 LT ISZERO PUSH2 0x157A JUMPI DUP6 DUP1 ISZERO PUSH2 0x1511 JUMPI POP PUSH1 0x0 DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO JUMPDEST DUP1 PUSH2 0x1544 JUMPI POP DUP5 DUP1 ISZERO PUSH2 0x1543 JUMPI POP PUSH1 0x0 DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND JUMPDEST JUMPDEST ISZERO PUSH2 0x156D JUMPI DUP1 DUP4 DUP4 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1558 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD DUP2 DUP2 MSTORE POP POP PUSH1 0x1 DUP3 ADD SWAP2 POP JUMPDEST DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0x14DA JUMP JUMPDEST DUP8 DUP8 SUB PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x15AB JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CODESIZE DUP4 CODECOPY DUP1 DUP3 ADD SWAP2 POP POP SWAP1 POP JUMPDEST POP SWAP4 POP DUP8 SWAP1 POP JUMPDEST DUP7 DUP2 LT ISZERO PUSH2 0x15FD JUMPI DUP3 DUP2 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x15C8 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP5 DUP10 DUP4 SUB DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x15E2 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD DUP2 DUP2 MSTORE POP POP DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0x15B2 JUMP JUMPDEST POP POP POP SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x60 DUP1 PUSH1 0x0 DUP1 PUSH1 0x3 DUP1 SLOAD SWAP1 POP PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x1642 JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CODESIZE DUP4 CODECOPY DUP1 DUP3 ADD SWAP2 POP POP SWAP1 POP JUMPDEST POP SWAP3 POP PUSH1 0x0 SWAP2 POP PUSH1 0x0 SWAP1 POP JUMPDEST PUSH1 0x3 DUP1 SLOAD SWAP1 POP DUP2 LT ISZERO PUSH2 0x178F JUMPI PUSH1 0x1 PUSH1 0x0 DUP7 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH1 0x3 DUP4 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x167F JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0x1782 JUMPI PUSH1 0x3 DUP2 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1706 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP4 DUP4 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x173F JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE POP POP PUSH1 0x1 DUP3 ADD SWAP2 POP JUMPDEST DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0x164E JUMP JUMPDEST DUP2 PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x17BE JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CODESIZE DUP4 CODECOPY DUP1 DUP3 ADD SWAP2 POP POP SWAP1 POP JUMPDEST POP SWAP4 POP PUSH1 0x0 SWAP1 POP JUMPDEST DUP2 DUP2 LT ISZERO PUSH2 0x183D JUMPI DUP3 DUP2 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x17DC JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP5 DUP3 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x17F4 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE POP POP DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0x17C6 JUMP JUMPDEST POP POP POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x5 SLOAD DUP2 JUMP JUMPDEST ADDRESS PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x1885 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x3 DUP1 SLOAD SWAP1 POP DUP2 PUSH1 0x32 DUP3 GT DUP1 PUSH2 0x189A JUMPI POP DUP2 DUP2 GT JUMPDEST DUP1 PUSH2 0x18A5 JUMPI POP PUSH1 0x0 DUP2 EQ JUMPDEST DUP1 PUSH2 0x18B0 JUMPI POP PUSH1 0x0 DUP3 EQ JUMPDEST ISZERO PUSH2 0x18BA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 PUSH1 0x4 DUP2 SWAP1 SSTORE POP PUSH32 0xA3F1EE9126A074D9326C682F561767F710E927FAA811F7A99829D49DC421797A DUP4 PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG1 POP POP POP JUMP JUMPDEST CALLER PUSH1 0x2 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO ISZERO PUSH2 0x1956 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 PUSH1 0x0 DUP1 PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0x19B0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 CALLER PUSH1 0x1 PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0x1A1A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP5 PUSH2 0x1A24 DUP2 PUSH2 0x10E9 JUMP JUMPDEST ISZERO ISZERO ISZERO PUSH2 0x1A30 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x1 DUP1 PUSH1 0x0 DUP9 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP DUP6 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x4A504A94899432A9846E1AA406DCEB1BCFD538BB839071D49D1E5E23F5BE30EF PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH2 0x1AE5 DUP7 PUSH2 0x10E9 JUMP JUMPDEST ISZERO PUSH2 0x1AF5 JUMPI PUSH2 0x1AF4 DUP7 TIMESTAMP PUSH2 0x2037 JUMP JUMPDEST JUMPDEST POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x1B0A DUP5 DUP5 DUP5 PUSH2 0x208B JUMP JUMPDEST SWAP1 POP PUSH2 0x1B15 DUP2 PUSH2 0x18FD JUMP JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x7 PUSH1 0x20 MSTORE DUP1 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP2 POP SWAP1 POP SLOAD DUP2 JUMP JUMPDEST PUSH1 0x32 DUP2 JUMP JUMPDEST PUSH1 0x4 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 ADDRESS PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x1B7B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 PUSH1 0x2 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO ISZERO PUSH2 0x1BD4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 PUSH1 0x2 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0x1C2C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 SWAP3 POP JUMPDEST PUSH1 0x3 DUP1 SLOAD SWAP1 POP DUP4 LT ISZERO PUSH2 0x1D15 JUMPI DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x3 DUP5 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1C64 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0x1D08 JUMPI DUP4 PUSH1 0x3 DUP5 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1CBB JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH2 0x1D15 JUMP JUMPDEST DUP3 DUP1 PUSH1 0x1 ADD SWAP4 POP POP PUSH2 0x1C31 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x2 PUSH1 0x0 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP PUSH1 0x1 PUSH1 0x2 PUSH1 0x0 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x8001553A916EF2F495D26A907CC54D96ED840D7BDA71E73194BF5A9DF7A76B90 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xF39E6E1EB0EDCF53C221607B54B00CD28F3196FED0A24994DC308B8F611B682D PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x0 DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0x1E82 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 PUSH2 0x1E8C DUP2 PUSH2 0x10E9 JUMP JUMPDEST ISZERO ISZERO PUSH2 0x1E97 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP4 PUSH1 0x6 SLOAD PUSH1 0x7 PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD ADD TIMESTAMP LT ISZERO ISZERO ISZERO PUSH2 0x1EBE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP1 DUP7 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SWAP4 POP PUSH1 0x1 DUP5 PUSH1 0x3 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP DUP4 PUSH1 0x0 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP5 PUSH1 0x1 ADD SLOAD DUP6 PUSH1 0x2 ADD PUSH1 0x40 MLOAD DUP1 DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x1F98 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x1F6D JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x1F98 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x1F7B JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP SWAP2 POP POP PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP6 DUP8 GAS CALL SWAP3 POP POP POP ISZERO PUSH2 0x1FE5 JUMPI DUP5 PUSH32 0x33E13ECB54C3076D8E8BB8C2881800A4D972B792045FFAE98FDF46DF365FED75 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 PUSH2 0x2030 JUMP JUMPDEST DUP5 PUSH32 0x526441BB6C1ABA3C9A4A6CA1D6545DA9C2333C8C48343EF398EB858D72B79236 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 PUSH1 0x0 DUP5 PUSH1 0x3 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP JUMPDEST POP POP POP POP POP JUMP JUMPDEST DUP1 PUSH1 0x7 PUSH1 0x0 DUP5 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP DUP2 PUSH32 0xB237AFE65F1514FD7EA3F923EA4FE792BDD07000A912B6CD1602A8E7F573C8D DUP3 PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP4 PUSH1 0x0 DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0x20B2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x5 SLOAD SWAP2 POP PUSH1 0x80 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP6 DUP2 MSTORE PUSH1 0x20 ADD DUP5 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 ISZERO ISZERO DUP2 MSTORE POP PUSH1 0x0 DUP1 DUP5 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 ADD MLOAD DUP2 PUSH1 0x0 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH1 0x20 DUP3 ADD MLOAD DUP2 PUSH1 0x1 ADD SSTORE PUSH1 0x40 DUP3 ADD MLOAD DUP2 PUSH1 0x2 ADD SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH2 0x2171 SWAP3 SWAP2 SWAP1 PUSH2 0x2207 JUMP JUMPDEST POP PUSH1 0x60 DUP3 ADD MLOAD DUP2 PUSH1 0x3 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP SWAP1 POP POP PUSH1 0x1 PUSH1 0x5 PUSH1 0x0 DUP3 DUP3 SLOAD ADD SWAP3 POP POP DUP2 SWAP1 SSTORE POP DUP2 PUSH32 0xC0BA8FE4B176C1714197D43B9CC6BCF797A4A7461C5FE8D0EF6E184AE7601E51 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST DUP2 SLOAD DUP2 DUP4 SSTORE DUP2 DUP2 GT ISZERO PUSH2 0x2202 JUMPI DUP2 DUP4 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP2 DUP3 ADD SWAP2 ADD PUSH2 0x2201 SWAP2 SWAP1 PUSH2 0x2287 JUMP JUMPDEST JUMPDEST POP POP POP JUMP JUMPDEST DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 PUSH1 0x1F ADD PUSH1 0x20 SWAP1 DIV DUP2 ADD SWAP3 DUP3 PUSH1 0x1F LT PUSH2 0x2248 JUMPI DUP1 MLOAD PUSH1 0xFF NOT AND DUP4 DUP1 ADD OR DUP6 SSTORE PUSH2 0x2276 JUMP JUMPDEST DUP3 DUP1 ADD PUSH1 0x1 ADD DUP6 SSTORE DUP3 ISZERO PUSH2 0x2276 JUMPI SWAP2 DUP3 ADD JUMPDEST DUP3 DUP2 GT ISZERO PUSH2 0x2275 JUMPI DUP3 MLOAD DUP3 SSTORE SWAP2 PUSH1 0x20 ADD SWAP2 SWAP1 PUSH1 0x1 ADD SWAP1 PUSH2 0x225A JUMP JUMPDEST JUMPDEST POP SWAP1 POP PUSH2 0x2283 SWAP2 SWAP1 PUSH2 0x2287 JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST PUSH2 0x22A9 SWAP2 SWAP1 JUMPDEST DUP1 DUP3 GT ISZERO PUSH2 0x22A5 JUMPI PUSH1 0x0 DUP2 PUSH1 0x0 SWAP1 SSTORE POP PUSH1 0x1 ADD PUSH2 0x228D JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST SWAP1 JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 0x2f SHR KECCAK256 AND DIFFICULTY ADD 0xb8 PUSH16 0x77A2783BE7A520331C1545FFCA80947F BYTE 0xe3 DIFFICULTY DUP10 DELEGATECALL DUP8 0xa9 0xd6 STOP 0x29 ",
- "sourceMap": "855:3594:1:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2519:1:0;2507:9;:13;2503:61;;;2542:10;2534:30;;;2554:9;2534:30;;;;;;;;;;;;;;;;;;2503:61;855:3594:1;936:23:0;;8:9:-1;5:2;;;30:1;27;20:12;5:2;936:23:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3711:460;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3711:460:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;3196:332:1;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3196:332:1;;;;;;;;;;;;;;;;;;;;;;;;;;890:40:0;;8:9:-1;5:2;;;30:1;27;20:12;5:2;890:40:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;820:64;;8:9:-1;5:2;;;30:1;27;20:12;5:2;820:64:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1049:29:1;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1049:29:1;;;;;;;;;;;;;;;;;;;;;;;9136:319:0;;8:9:-1;5:2;;;30:1;27;20:12;5:2;9136:319:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3311:277;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3311:277:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;7304:337;;8:9:-1;5:2;;;30:1;27;20:12;5:2;7304:337:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2321:186:1;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2321:186:1;;;;;;;;;;;;;;;;;;;;;;;;;;8622:252:0;;8:9:-1;5:2;;;30:1;27;20:12;5:2;8622:252:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;765:49;;8:9:-1;5:2;;;30:1;27;20:12;5:2;765:49:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;765:49:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9539:115;;8:9:-1;5:2;;;30:1;27;20:12;5:2;9539:115:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;9539:115:0;;;;;;;;;;;;;;;;;10757:676;;8:9:-1;5:2;;;30:1;27;20:12;5:2;10757:676:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;10757:676:0;;;;;;;;;;;;;;;;;9833:575;;8:9:-1;5:2;;;30:1;27;20:12;5:2;9833:575:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;9833:575:0;;;;;;;;;;;;;;;;;991:28;;8:9:-1;5:2;;;30:1;27;20:12;5:2;991:28:0;;;;;;;;;;;;;;;;;;;;;;;4990:207;;8:9:-1;5:2;;;30:1;27;20:12;5:2;4990:207:0;;;;;;;;;;;;;;;;;;;;;;;;;;2613:459:1;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2613:459:1;;;;;;;;;;;;;;;;;;;;;;;;;;5456:244:0;;8:9:-1;5:2;;;30:1;27;20:12;5:2;5456:244:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1085:47:1;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1085:47:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;217:41:0;;8:9:-1;5:2;;;30:1;27;20:12;5:2;217:41:0;;;;;;;;;;;;;;;;;;;;;;;965:20;;8:9:-1;5:2;;;30:1;27;20:12;5:2;965:20:0;;;;;;;;;;;;;;;;;;;;;;;4370:449;;8:9:-1;5:2;;;30:1;27;20:12;5:2;4370:449:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3642:472:1;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3642:472:1;;;;;;;;;;;;;;;;;;;;;;;;;;936:23:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;3711:460::-;3859:6;1208:4;1186:27;;:10;:27;;;;1182:50;;;1227:5;;;1182:50;3801:5;1420:7;:14;1428:5;1420:14;;;;;;;;;;;;;;;;;;;;;;;;;1419:15;1415:38;;;1448:5;;;1415:38;3839:5;3822:7;:14;3830:5;3822:14;;;;;;;;;;;;;;;;:22;;;;;;;;;;;;;;;;;;3866:1;3859:8;;3854:170;3887:1;3871:6;:13;;;;:17;3869:1;:19;3854:170;;;3924:5;3911:18;;:6;3918:1;3911:9;;;;;;;;;;;;;;;;;;;;;;;;;;;:18;;;3907:117;;;3961:6;3984:1;3968:6;:13;;;;:17;3961:25;;;;;;;;;;;;;;;;;;;;;;;;;;;3949:6;3956:1;3949:9;;;;;;;;;;;;;;;;;;:37;;;;;;;;;;;;;;;;;;4004:5;;3907:117;3890:3;;;;;;;3854:170;;;4050:1;4033:6;:18;;;;;;;;;;;;;;:::i;:::-;;4076:6;:13;;;;4065:8;;:24;4061:74;;;4103:32;4121:6;:13;;;;4103:17;:32::i;:::-;4061:74;4158:5;4145:19;;;;;;;;;;;;1242:1;3711:460;;:::o;3196:332:1:-;3279:10;1420:7:0;:14;1428:5;1420:14;;;;;;;;;;;;;;;;;;;;;;;;;1419:15;1415:38;;;1448:5;;;1415:38;3309:13:1;3324:10;1694:13:0;:28;1708:13;1694:28;;;;;;;;;;;:35;1723:5;1694:35;;;;;;;;;;;;;;;;;;;;;;;;;1693:36;1689:59;;;1743:5;;;1689:59;3356:13:1;1976:12:0;:27;1989:13;1976:27;;;;;;;;;;;:36;;;;;;;;;;;;1972:59;;;2026:5;;;1972:59;3397:13:1;1205:26;1217:13;1205:11;:26::i;:::-;1204:27;1196:36;;;;;;;;3469:5;3426:13;:28;3440:13;3426:28;;;;;;;;;;;:40;3455:10;3426:40;;;;;;;;;;;;;;;;:48;;;;;;;;;;;;;;;;;;3507:13;3495:10;3484:37;;;;;;;;;;;;2041:1:0;1758;1463;;3196:332:1;;:::o;890:40:0:-;;;;;;;;;;;;;;;;;;;;;;:::o;820:64::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;1049:29:1:-;;;;:::o;9136:319:0:-;9243:10;9274:6;9281:1;9274:8;;9269:179;9286:16;;9284:1;:18;9269:179;;;9328:7;:36;;;;;9340:12;:15;9353:1;9340:15;;;;;;;;;;;:24;;;;;;;;;;;;9339:25;9328:36;:92;;;;9384:8;:36;;;;;9396:12;:15;9409:1;9396:15;;;;;;;;;;;:24;;;;;;;;;;;;9384:36;9328:92;9321:127;;;9447:1;9438:10;;;;9321:127;9304:3;;;;;;;9269:179;;;9136:319;;;;;:::o;3311:277::-;1208:4;1186:27;;:10;:27;;;;1182:50;;;1227:5;;;1182:50;3404:5;1312:7;:14;1320:5;1312:14;;;;;;;;;;;;;;;;;;;;;;;;;1308:37;;;1340:5;;;1308:37;3427:5;2116:1;2104:8;:13;;;2100:36;;;2131:5;;;2100:36;3475:1;3459:6;:13;;;;:17;3478:8;;256:2;2236:10;:28;:66;;;;2292:10;2280:9;:22;2236:66;:96;;;;2331:1;2318:9;:14;2236:96;:127;;;;2362:1;2348:10;:15;2236:127;2229:153;;;2377:5;;;2229:153;3519:4;3502:7;:14;3510:5;3502:14;;;;;;;;;;;;;;;;:21;;;;;;;;;;;;;;;;;;3533:6;3545:5;3533:18;;39:1:-1;33:3;27:10;23:18;57:10;52:3;45:23;79:10;72:17;;0:93;3533:18:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3575:5;3561:20;;;;;;;;;;;;2146:1;;1355;1242;3311:277;:::o;7304:337::-;7394:4;7414:10;7443:6;7427:1;7414:14;;7450:1;7443:8;;7438:197;7455:6;:13;;;;7453:1;:15;7438:197;;;7493:13;:28;7507:13;7493:28;;;;;;;;;;;:39;7522:6;7529:1;7522:9;;;;;;;;;;;;;;;;;;;;;;;;;;;7493:39;;;;;;;;;;;;;;;;;;;;;;;;;7489:71;;;7559:1;7550:10;;;;7489:71;7587:8;;7578:5;:17;7574:50;;;7620:4;7613:11;;;;7574:50;7470:3;;;;;;;7438:197;;;7304:337;;;;;;:::o;2321:186:1:-;1208:4:0;1186:27;;:10;:27;;;;1182:50;;;1227:5;;;1182:50;2438:18:1;2418:17;:38;;;;2466:34;2481:18;2466:34;;;;;;;;;;;;;;;;;;2321:186;:::o;8622:252:0:-;8721:10;8752:6;8759:1;8752:8;;8747:120;8764:6;:13;;;;8762:1;:15;8747:120;;;8800:13;:28;8814:13;8800:28;;;;;;;;;;;:39;8829:6;8836:1;8829:9;;;;;;;;;;;;;;;;;;;;;;;;;;;8800:39;;;;;;;;;;;;;;;;;;;;;;;;;8796:71;;;8866:1;8857:10;;;;8796:71;8779:3;;;;;;;8747:120;;;8622:252;;;;:::o;765:49::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;9539:115::-;9609:9;9641:6;9634:13;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9539:115;:::o;10757:676::-;10882:22;10920:32;10993:10;11017:6;10966:16;;10955:28;;;;;;;;;;;;;;;;;;;;;;29:2:-1;21:6;17:15;117:4;105:10;97:6;88:34;148:4;140:6;136:17;126:27;;0:157;10955:28:0;;;;10920:63;;11006:1;10993:14;;11040:1;11038:3;;11033:250;11045:16;;11043:1;:18;11033:250;;;11087:7;:36;;;;;11099:12;:15;11112:1;11099:15;;;;;;;;;;;:24;;;;;;;;;;;;11098:25;11087:36;:92;;;;11143:8;:36;;;;;11155:12;:15;11168:1;11155:15;;;;;;;;;;;:24;;;;;;;;;;;;11143:36;11087:92;11080:203;;;11239:1;11211:18;11230:5;11211:25;;;;;;;;;;;;;;;;;:29;;;;;11267:1;11258:10;;;;11080:203;11063:3;;;;;;;11033:250;;;11326:4;11321:2;:9;11310:21;;;;;;;;;;;;;;;;;;;;;;29:2:-1;21:6;17:15;117:4;105:10;97:6;88:34;148:4;140:6;136:17;126:27;;0:157;11310:21:0;;;;11292:39;;11348:4;11346:6;;11341:85;11356:2;11354:1;:4;11341:85;;;11405:18;11424:1;11405:21;;;;;;;;;;;;;;;;;;11377:15;11397:4;11393:1;:8;11377:25;;;;;;;;;;;;;;;;;:49;;;;;11360:3;;;;;;;11341:85;;;10757:676;;;;;;;;;:::o;9833:575::-;9928:24;9968:34;10043:10;10067:6;10019;:13;;;;10005:28;;;;;;;;;;;;;;;;;;;;;;29:2:-1;21:6;17:15;117:4;105:10;97:6;88:34;148:4;140:6;136:17;126:27;;0:157;10005:28:0;;;;9968:65;;10056:1;10043:14;;10090:1;10088:3;;10083:186;10095:6;:13;;;;10093:1;:15;10083:186;;;10131:13;:28;10145:13;10131:28;;;;;;;;;;;:39;10160:6;10167:1;10160:9;;;;;;;;;;;;;;;;;;;;;;;;;;;10131:39;;;;;;;;;;;;;;;;;;;;;;;;;10127:142;;;10217:6;10224:1;10217:9;;;;;;;;;;;;;;;;;;;;;;;;;;;10190:17;10208:5;10190:24;;;;;;;;;;;;;;;;;:36;;;;;;;;;;;10253:1;10244:10;;;;10127:142;10110:3;;;;;;;10083:186;;;10309:5;10295:20;;;;;;;;;;;;;;;;;;;;;;29:2:-1;21:6;17:15;117:4;105:10;97:6;88:34;148:4;140:6;136:17;126:27;;0:157;10295:20:0;;;;10278:37;;10332:1;10330:3;;10325:76;10337:5;10335:1;:7;10325:76;;;10381:17;10399:1;10381:20;;;;;;;;;;;;;;;;;;10361:14;10376:1;10361:17;;;;;;;;;;;;;;;;;:40;;;;;;;;;;;10344:3;;;;;;;10325:76;;;9833:575;;;;;;:::o;991:28::-;;;;:::o;4990:207::-;1208:4;1186:27;;:10;:27;;;;1182:50;;;1227:5;;;1182:50;5092:6;:13;;;;5107:9;256:2;2236:10;:28;:66;;;;2292:10;2280:9;:22;2236:66;:96;;;;2331:1;2318:9;:14;2236:96;:127;;;;2362:1;2348:10;:15;2236:127;2229:153;;;2377:5;;;2229:153;5143:9;5132:8;:20;;;;5162:28;5180:9;5162:28;;;;;;;;;;;;;;;;;;1242:1;;4990:207;:::o;2613:459:1:-;2696:10;1420:7:0;:14;1428:5;1420:14;;;;;;;;;;;;;;;;;;;;;;;;;1419:15;1415:38;;;1448:5;;;1415:38;2734:13:1;1581:1:0;1538:12;:27;1551:13;1538:27;;;;;;;;;;;:39;;;;;;;;;;;;:44;;;1534:67;;;1596:5;;;1534:67;2770:13:1;2785:10;1843:13:0;:28;1857:13;1843:28;;;;;;;;;;;:35;1872:5;1843:35;;;;;;;;;;;;;;;;;;;;;;;;;1839:58;;;1892:5;;;1839:58;2823:13:1;1205:26;1217:13;1205:11;:26::i;:::-;1204:27;1196:36;;;;;;;;2895:4;2852:13;:28;2866:13;2852:28;;;;;;;;;;;:40;2881:10;2852:40;;;;;;;;;;;;;;;;:47;;;;;;;;;;;;;;;;;;2934:13;2922:10;2909:39;;;;;;;;;;;;2962:26;2974:13;2962:11;:26::i;:::-;2958:108;;;3004:51;3024:13;3039:15;3004:19;:51::i;:::-;2958:108;1907:1:0;1611;;1463;2613:459:1;;:::o;5456:244:0:-;5560:18;5610:40;5625:11;5638:5;5645:4;5610:14;:40::i;:::-;5594:56;;5660:33;5679:13;5660:18;:33::i;:::-;5456:244;;;;;:::o;1085:47:1:-;;;;;;;;;;;;;;;;;:::o;217:41:0:-;256:2;217:41;:::o;965:20::-;;;;:::o;4370:449::-;4541:6;1208:4;1186:27;;:10;:27;;;;1182:50;;;1227:5;;;1182:50;4479:5;1420:7;:14;1428:5;1420:14;;;;;;;;;;;;;;;;;;;;;;;;;1419:15;1415:38;;;1448:5;;;1415:38;4512:8;1312:7;:14;1320:5;1312:14;;;;;;;;;;;;;;;;;;;;;;;;;1308:37;;;1340:5;;;1308:37;4548:1;4541:8;;4536:149;4553:6;:13;;;;4551:1;:15;4536:149;;;4602:5;4589:18;;:6;4596:1;4589:9;;;;;;;;;;;;;;;;;;;;;;;;;;;:18;;;4585:100;;;4639:8;4627:6;4634:1;4627:9;;;;;;;;;;;;;;;;;;:20;;;;;;;;;;;;;;;;;;4665:5;;4585:100;4568:3;;;;;;;4536:149;;;4711:5;4694:7;:14;4702:5;4694:14;;;;;;;;;;;;;;;;:22;;;;;;;;;;;;;;;;;;4746:4;4726:7;:17;4734:8;4726:17;;;;;;;;;;;;;;;;:24;;;;;;;;;;;;;;;;;;4773:5;4760:19;;;;;;;;;;;;4803:8;4789:23;;;;;;;;;;;;1463:1;1242;4370:449;;;:::o;3642:472:1:-;3828:22;3725:13;1976:12:0;:27;1989:13;1976:27;;;;;;;;;;;:36;;;;;;;;;;;;1972:59;;;2026:5;;;1972:59;3763:13:1;1318:26;1330:13;1318:11;:26::i;:::-;1310:35;;;;;;;;3799:13;1483:17;;1448;:32;1466:13;1448:32;;;;;;;;;;;;:52;1429:15;:71;;1421:80;;;;;;;;3853:12;:27;3866:13;3853:27;;;;;;;;;;;3828:52;;3904:4;3890:2;:11;;;:18;;;;;;;;;;;;;;;;;;3922:2;:14;;;;;;;;;;;;:19;;3948:2;:8;;;3958:2;:7;;3922:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3918:190;;;3990:13;3980:24;;;;;;;;;;3918:190;;;4050:13;4033:31;;;;;;;;;;4092:5;4078:2;:11;;;:19;;;;;;;;;;;;;;;;;;3918:190;1355:1;2041::0;3642:472:1;;;:::o;4224:223::-;4362:16;4327:17;:32;4345:13;4327:32;;;;;;;;;;;:51;;;;4408:13;4388:52;4423:16;4388:52;;;;;;;;;;;;;;;;;;4224:223;;:::o;7974:451:0:-;8106:18;8076:11;2116:1;2104:8;:13;;;2100:36;;;2131:5;;;2100:36;8156:16;;8140:32;;8212:140;;;;;;;;;8251:11;8212:140;;;;;;8283:5;8212:140;;;;8308:4;8212:140;;;;8336:5;8212:140;;;;;8182:12;:27;8195:13;8182:27;;;;;;;;;;;:170;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8382:1;8362:16;;:21;;;;;;;;;;;8404:13;8393:25;;;;;;;;;;7974:451;;;;;;:::o;855:3594:1:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o"
- }
- }
- },
- "sources": {
- "current/multisig/MultiSigWallet/MultiSigWallet.sol": {
- "id": 0
- },
- "current/multisig/MultiSigWalletWithTimeLock/MultiSigWalletWithTimeLock.sol": {
- "id": 1
- }
- },
- "sourceCodes": {
- "current/multisig/MultiSigWallet/MultiSigWallet.sol": "pragma solidity ^0.4.10;\n\n/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.\n/// @author Stefan George - <stefan.george@consensys.net>\ncontract MultiSigWallet {\n\n uint constant public MAX_OWNER_COUNT = 50;\n\n event Confirmation(address indexed sender, uint indexed transactionId);\n event Revocation(address indexed sender, uint indexed transactionId);\n event Submission(uint indexed transactionId);\n event Execution(uint indexed transactionId);\n event ExecutionFailure(uint indexed transactionId);\n event Deposit(address indexed sender, uint value);\n event OwnerAddition(address indexed owner);\n event OwnerRemoval(address indexed owner);\n event RequirementChange(uint required);\n\n mapping (uint => Transaction) public transactions;\n mapping (uint => mapping (address => bool)) public confirmations;\n mapping (address => bool) public isOwner;\n address[] public owners;\n uint public required;\n uint public transactionCount;\n\n struct Transaction {\n address destination;\n uint value;\n bytes data;\n bool executed;\n }\n\n modifier onlyWallet() {\n if (msg.sender != address(this))\n throw;\n _;\n }\n\n modifier ownerDoesNotExist(address owner) {\n if (isOwner[owner])\n throw;\n _;\n }\n\n modifier ownerExists(address owner) {\n if (!isOwner[owner])\n throw;\n _;\n }\n\n modifier transactionExists(uint transactionId) {\n if (transactions[transactionId].destination == 0)\n throw;\n _;\n }\n\n modifier confirmed(uint transactionId, address owner) {\n if (!confirmations[transactionId][owner])\n throw;\n _;\n }\n\n modifier notConfirmed(uint transactionId, address owner) {\n if (confirmations[transactionId][owner])\n throw;\n _;\n }\n\n modifier notExecuted(uint transactionId) {\n if (transactions[transactionId].executed)\n throw;\n _;\n }\n\n modifier notNull(address _address) {\n if (_address == 0)\n throw;\n _;\n }\n\n modifier validRequirement(uint ownerCount, uint _required) {\n if ( ownerCount > MAX_OWNER_COUNT\n || _required > ownerCount\n || _required == 0\n || ownerCount == 0)\n throw;\n _;\n }\n\n /// @dev Fallback function allows to deposit ether.\n function()\n payable\n {\n if (msg.value > 0)\n Deposit(msg.sender, msg.value);\n }\n\n /*\n * Public functions\n */\n /// @dev Contract constructor sets initial owners and required number of confirmations.\n /// @param _owners List of initial owners.\n /// @param _required Number of required confirmations.\n function MultiSigWallet(address[] _owners, uint _required)\n public\n validRequirement(_owners.length, _required)\n {\n for (uint i=0; i<_owners.length; i++) {\n if (isOwner[_owners[i]] || _owners[i] == 0)\n throw;\n isOwner[_owners[i]] = true;\n }\n owners = _owners;\n required = _required;\n }\n\n /// @dev Allows to add a new owner. Transaction has to be sent by wallet.\n /// @param owner Address of new owner.\n function addOwner(address owner)\n public\n onlyWallet\n ownerDoesNotExist(owner)\n notNull(owner)\n validRequirement(owners.length + 1, required)\n {\n isOwner[owner] = true;\n owners.push(owner);\n OwnerAddition(owner);\n }\n\n /// @dev Allows to remove an owner. Transaction has to be sent by wallet.\n /// @param owner Address of owner.\n function removeOwner(address owner)\n public\n onlyWallet\n ownerExists(owner)\n {\n isOwner[owner] = false;\n for (uint i=0; i<owners.length - 1; i++)\n if (owners[i] == owner) {\n owners[i] = owners[owners.length - 1];\n break;\n }\n owners.length -= 1;\n if (required > owners.length)\n changeRequirement(owners.length);\n OwnerRemoval(owner);\n }\n\n /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet.\n /// @param owner Address of owner to be replaced.\n /// @param owner Address of new owner.\n function replaceOwner(address owner, address newOwner)\n public\n onlyWallet\n ownerExists(owner)\n ownerDoesNotExist(newOwner)\n {\n for (uint i=0; i<owners.length; i++)\n if (owners[i] == owner) {\n owners[i] = newOwner;\n break;\n }\n isOwner[owner] = false;\n isOwner[newOwner] = true;\n OwnerRemoval(owner);\n OwnerAddition(newOwner);\n }\n\n /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet.\n /// @param _required Number of required confirmations.\n function changeRequirement(uint _required)\n public\n onlyWallet\n validRequirement(owners.length, _required)\n {\n required = _required;\n RequirementChange(_required);\n }\n\n /// @dev Allows an owner to submit and confirm a transaction.\n /// @param destination Transaction target address.\n /// @param value Transaction ether value.\n /// @param data Transaction data payload.\n /// @return Returns transaction ID.\n function submitTransaction(address destination, uint value, bytes data)\n public\n returns (uint transactionId)\n {\n transactionId = addTransaction(destination, value, data);\n confirmTransaction(transactionId);\n }\n\n /// @dev Allows an owner to confirm a transaction.\n /// @param transactionId Transaction ID.\n function confirmTransaction(uint transactionId)\n public\n ownerExists(msg.sender)\n transactionExists(transactionId)\n notConfirmed(transactionId, msg.sender)\n {\n confirmations[transactionId][msg.sender] = true;\n Confirmation(msg.sender, transactionId);\n executeTransaction(transactionId);\n }\n\n /// @dev Allows an owner to revoke a confirmation for a transaction.\n /// @param transactionId Transaction ID.\n function revokeConfirmation(uint transactionId)\n public\n ownerExists(msg.sender)\n confirmed(transactionId, msg.sender)\n notExecuted(transactionId)\n {\n confirmations[transactionId][msg.sender] = false;\n Revocation(msg.sender, transactionId);\n }\n\n /// @dev Allows anyone to execute a confirmed transaction.\n /// @param transactionId Transaction ID.\n function executeTransaction(uint transactionId)\n public\n notExecuted(transactionId)\n {\n if (isConfirmed(transactionId)) {\n Transaction tx = transactions[transactionId];\n tx.executed = true;\n if (tx.destination.call.value(tx.value)(tx.data))\n Execution(transactionId);\n else {\n ExecutionFailure(transactionId);\n tx.executed = false;\n }\n }\n }\n\n /// @dev Returns the confirmation status of a transaction.\n /// @param transactionId Transaction ID.\n /// @return Confirmation status.\n function isConfirmed(uint transactionId)\n public\n constant\n returns (bool)\n {\n uint count = 0;\n for (uint i=0; i<owners.length; i++) {\n if (confirmations[transactionId][owners[i]])\n count += 1;\n if (count == required)\n return true;\n }\n }\n\n /*\n * Internal functions\n */\n /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet.\n /// @param destination Transaction target address.\n /// @param value Transaction ether value.\n /// @param data Transaction data payload.\n /// @return Returns transaction ID.\n function addTransaction(address destination, uint value, bytes data)\n internal\n notNull(destination)\n returns (uint transactionId)\n {\n transactionId = transactionCount;\n transactions[transactionId] = Transaction({\n destination: destination,\n value: value,\n data: data,\n executed: false\n });\n transactionCount += 1;\n Submission(transactionId);\n }\n\n /*\n * Web3 call functions\n */\n /// @dev Returns number of confirmations of a transaction.\n /// @param transactionId Transaction ID.\n /// @return Number of confirmations.\n function getConfirmationCount(uint transactionId)\n public\n constant\n returns (uint count)\n {\n for (uint i=0; i<owners.length; i++)\n if (confirmations[transactionId][owners[i]])\n count += 1;\n }\n\n /// @dev Returns total number of transactions after filers are applied.\n /// @param pending Include pending transactions.\n /// @param executed Include executed transactions.\n /// @return Total number of transactions after filters are applied.\n function getTransactionCount(bool pending, bool executed)\n public\n constant\n returns (uint count)\n {\n for (uint i=0; i<transactionCount; i++)\n if ( pending && !transactions[i].executed\n || executed && transactions[i].executed)\n count += 1;\n }\n\n /// @dev Returns list of owners.\n /// @return List of owner addresses.\n function getOwners()\n public\n constant\n returns (address[])\n {\n return owners;\n }\n\n /// @dev Returns array with owner addresses, which confirmed transaction.\n /// @param transactionId Transaction ID.\n /// @return Returns array of owner addresses.\n function getConfirmations(uint transactionId)\n public\n constant\n returns (address[] _confirmations)\n {\n address[] memory confirmationsTemp = new address[](owners.length);\n uint count = 0;\n uint i;\n for (i=0; i<owners.length; i++)\n if (confirmations[transactionId][owners[i]]) {\n confirmationsTemp[count] = owners[i];\n count += 1;\n }\n _confirmations = new address[](count);\n for (i=0; i<count; i++)\n _confirmations[i] = confirmationsTemp[i];\n }\n\n /// @dev Returns list of transaction IDs in defined range.\n /// @param from Index start position of transaction array.\n /// @param to Index end position of transaction array.\n /// @param pending Include pending transactions.\n /// @param executed Include executed transactions.\n /// @return Returns array of transaction IDs.\n function getTransactionIds(uint from, uint to, bool pending, bool executed)\n public\n constant\n returns (uint[] _transactionIds)\n {\n uint[] memory transactionIdsTemp = new uint[](transactionCount);\n uint count = 0;\n uint i;\n for (i=0; i<transactionCount; i++)\n if ( pending && !transactions[i].executed\n || executed && transactions[i].executed)\n {\n transactionIdsTemp[count] = i;\n count += 1;\n }\n _transactionIds = new uint[](to - from);\n for (i=from; i<to; i++)\n _transactionIds[i - from] = transactionIdsTemp[i];\n }\n}\n",
- "current/multisig/MultiSigWalletWithTimeLock/MultiSigWalletWithTimeLock.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.4.10;\n\nimport { MultiSigWallet } from \"../MultiSigWallet/MultiSigWallet.sol\";\n\n/// @title Multisignature wallet with time lock- Allows multiple parties to execute a transaction after a time lock has passed.\n/// @author Amir Bandeali - <amir@0xProject.com>\ncontract MultiSigWalletWithTimeLock is MultiSigWallet {\n\n event ConfirmationTimeSet(uint indexed transactionId, uint confirmationTime);\n event TimeLockChange(uint secondsTimeLocked);\n\n uint public secondsTimeLocked;\n\n mapping (uint => uint) public confirmationTimes;\n\n modifier notFullyConfirmed(uint transactionId) {\n require(!isConfirmed(transactionId));\n _;\n }\n\n modifier fullyConfirmed(uint transactionId) {\n require(isConfirmed(transactionId));\n _;\n }\n\n modifier pastTimeLock(uint transactionId) {\n require(block.timestamp >= confirmationTimes[transactionId] + secondsTimeLocked);\n _;\n }\n\n /*\n * Public functions\n */\n\n /// @dev Contract constructor sets initial owners, required number of confirmations, and time lock.\n /// @param _owners List of initial owners.\n /// @param _required Number of required confirmations.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n function MultiSigWalletWithTimeLock(address[] _owners, uint _required, uint _secondsTimeLocked)\n public\n MultiSigWallet(_owners, _required)\n {\n secondsTimeLocked = _secondsTimeLocked;\n }\n\n /// @dev Changes the duration of the time lock for transactions.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n function changeTimeLock(uint _secondsTimeLocked)\n public\n onlyWallet\n {\n secondsTimeLocked = _secondsTimeLocked;\n TimeLockChange(_secondsTimeLocked);\n }\n\n /// @dev Allows an owner to confirm a transaction.\n /// @param transactionId Transaction ID.\n function confirmTransaction(uint transactionId)\n public\n ownerExists(msg.sender)\n transactionExists(transactionId)\n notConfirmed(transactionId, msg.sender)\n notFullyConfirmed(transactionId)\n {\n confirmations[transactionId][msg.sender] = true;\n Confirmation(msg.sender, transactionId);\n if (isConfirmed(transactionId)) {\n setConfirmationTime(transactionId, block.timestamp);\n }\n }\n\n /// @dev Allows an owner to revoke a confirmation for a transaction.\n /// @param transactionId Transaction ID.\n function revokeConfirmation(uint transactionId)\n public\n ownerExists(msg.sender)\n confirmed(transactionId, msg.sender)\n notExecuted(transactionId)\n notFullyConfirmed(transactionId)\n {\n confirmations[transactionId][msg.sender] = false;\n Revocation(msg.sender, transactionId);\n }\n\n /// @dev Allows anyone to execute a confirmed transaction.\n /// @param transactionId Transaction ID.\n function executeTransaction(uint transactionId)\n public\n notExecuted(transactionId)\n fullyConfirmed(transactionId)\n pastTimeLock(transactionId)\n {\n Transaction storage tx = transactions[transactionId];\n tx.executed = true;\n if (tx.destination.call.value(tx.value)(tx.data))\n Execution(transactionId);\n else {\n ExecutionFailure(transactionId);\n tx.executed = false;\n }\n }\n\n /*\n * Internal functions\n */\n\n /// @dev Sets the time of when a submission first passed.\n function setConfirmationTime(uint transactionId, uint confirmationTime)\n internal\n {\n confirmationTimes[transactionId] = confirmationTime;\n ConfirmationTimeSet(transactionId, confirmationTime);\n }\n}\n"
- },
- "sourceTreeHashHex": "0xc72f66ef783226ce3add07370d926054508b0a3ae4a30e0773524310ddcdb9f8",
- "compiler": {
- "name": "solc",
- "version": "0.4.23",
- "settings": {
- "outputSelection": {
- "*": {
- "*": [
- "abi",
- "evm.bytecode.object",
- "evm.bytecode.sourceMap",
- "evm.deployedBytecode.object",
- "evm.deployedBytecode.sourceMap"
- ]
- }
- }
- }
- },
- "networks": {}
-} \ No newline at end of file
diff --git a/packages/migrations/artifacts/1.0.0/MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress.json b/packages/migrations/artifacts/1.0.0/MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress.json
deleted file mode 100644
index 367f0ba07..000000000
--- a/packages/migrations/artifacts/1.0.0/MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress.json
+++ /dev/null
@@ -1,725 +0,0 @@
-{
- "schemaVersion": "2.0.0",
- "contractName": "MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress",
- "compilerOutput": {
- "abi": [
- {
- "constant": true,
- "inputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "name": "owners",
- "outputs": [
- {
- "name": "",
- "type": "address"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "owner",
- "type": "address"
- }
- ],
- "name": "removeOwner",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "revokeConfirmation",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "",
- "type": "address"
- }
- ],
- "name": "isOwner",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "",
- "type": "uint256"
- },
- {
- "name": "",
- "type": "address"
- }
- ],
- "name": "confirmations",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "secondsTimeLocked",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "pending",
- "type": "bool"
- },
- {
- "name": "executed",
- "type": "bool"
- }
- ],
- "name": "getTransactionCount",
- "outputs": [
- {
- "name": "count",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "data",
- "type": "bytes"
- }
- ],
- "name": "isFunctionRemoveAuthorizedAddress",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "executeRemoveAuthorizedAddress",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "owner",
- "type": "address"
- }
- ],
- "name": "addOwner",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "isConfirmed",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_secondsTimeLocked",
- "type": "uint256"
- }
- ],
- "name": "changeTimeLock",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "getConfirmationCount",
- "outputs": [
- {
- "name": "count",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "name": "transactions",
- "outputs": [
- {
- "name": "destination",
- "type": "address"
- },
- {
- "name": "value",
- "type": "uint256"
- },
- {
- "name": "data",
- "type": "bytes"
- },
- {
- "name": "executed",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "getOwners",
- "outputs": [
- {
- "name": "",
- "type": "address[]"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "from",
- "type": "uint256"
- },
- {
- "name": "to",
- "type": "uint256"
- },
- {
- "name": "pending",
- "type": "bool"
- },
- {
- "name": "executed",
- "type": "bool"
- }
- ],
- "name": "getTransactionIds",
- "outputs": [
- {
- "name": "_transactionIds",
- "type": "uint256[]"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "TOKEN_TRANSFER_PROXY_CONTRACT",
- "outputs": [
- {
- "name": "",
- "type": "address"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "getConfirmations",
- "outputs": [
- {
- "name": "_confirmations",
- "type": "address[]"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "transactionCount",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_required",
- "type": "uint256"
- }
- ],
- "name": "changeRequirement",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "confirmTransaction",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "destination",
- "type": "address"
- },
- {
- "name": "value",
- "type": "uint256"
- },
- {
- "name": "data",
- "type": "bytes"
- }
- ],
- "name": "submitTransaction",
- "outputs": [
- {
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "name": "confirmationTimes",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "MAX_OWNER_COUNT",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "required",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "owner",
- "type": "address"
- },
- {
- "name": "newOwner",
- "type": "address"
- }
- ],
- "name": "replaceOwner",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "executeTransaction",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "inputs": [
- {
- "name": "_owners",
- "type": "address[]"
- },
- {
- "name": "_required",
- "type": "uint256"
- },
- {
- "name": "_secondsTimeLocked",
- "type": "uint256"
- },
- {
- "name": "_tokenTransferProxy",
- "type": "address"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "constructor"
- },
- {
- "payable": true,
- "stateMutability": "payable",
- "type": "fallback"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "transactionId",
- "type": "uint256"
- },
- {
- "indexed": false,
- "name": "confirmationTime",
- "type": "uint256"
- }
- ],
- "name": "ConfirmationTimeSet",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": false,
- "name": "secondsTimeLocked",
- "type": "uint256"
- }
- ],
- "name": "TimeLockChange",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "sender",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "Confirmation",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "sender",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "Revocation",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "Submission",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "Execution",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "ExecutionFailure",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "sender",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "value",
- "type": "uint256"
- }
- ],
- "name": "Deposit",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "owner",
- "type": "address"
- }
- ],
- "name": "OwnerAddition",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "owner",
- "type": "address"
- }
- ],
- "name": "OwnerRemoval",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": false,
- "name": "required",
- "type": "uint256"
- }
- ],
- "name": "RequirementChange",
- "type": "event"
- }
- ],
- "evm": {
- "bytecode": {
- "linkReferences": {},
- "object": "0x60806040523480156200001157600080fd5b5060405162002b9038038062002b90833981018060405281019080805182019291906020018051906020019092919080519060200190929190805190602001909291905050508383838282600082518260328211806200007057508181115b806200007c5750600081145b80620000885750600082145b156200009357600080fd5b600092505b8451831015620001ca57600260008685815181101515620000b557fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680620001415750600085848151811015156200011f57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff16145b156200014c57600080fd5b60016002600087868151811015156200016157fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550828060010193505062000098565b8460039080519060200190620001e292919062000244565b508360048190555050505050508060068190555050505080600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050505062000319565b828054828255906000526020600020908101928215620002c0579160200282015b82811115620002bf5782518260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509160200191906001019062000265565b5b509050620002cf9190620002d3565b5090565b6200031691905b808211156200031257600081816101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905550600101620002da565b5090565b90565b61286780620003296000396000f30060806040526004361061015f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063025e7c27146101b9578063173825d91461022657806320ea8d86146102695780632f54bf6e146102965780633411c81c146102f157806337bd78a0146103565780635474152514610381578063553a48fd146103d05780635711b311146104515780637065cb481461047e578063784547a7146104c15780637ad28c51146105065780638b51d13f146105335780639ace38c214610574578063a0e67e2b1461065f578063a8abe69a146106cb578063add1cbc51461076f578063b5dc40c3146107c6578063b77bf60014610848578063ba51a6df14610873578063c01a8c84146108a0578063c6427474146108cd578063d38f2d8214610974578063d74f8edd146109b5578063dc8452cd146109e0578063e20056e614610a0b578063ee22610b14610a6e575b60003411156101b7573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a25b005b3480156101c557600080fd5b506101e460048036038101908080359060200190929190505050610a9b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561023257600080fd5b50610267600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ad9565b005b34801561027557600080fd5b5061029460048036038101908080359060200190929190505050610d72565b005b3480156102a257600080fd5b506102d7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f2f565b604051808215151515815260200191505060405180910390f35b3480156102fd57600080fd5b5061033c60048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f4f565b604051808215151515815260200191505060405180910390f35b34801561036257600080fd5b5061036b610f7e565b6040518082815260200191505060405180910390f35b34801561038d57600080fd5b506103ba600480360381019080803515159060200190929190803515159060200190929190505050610f84565b6040518082815260200191505060405180910390f35b3480156103dc57600080fd5b50610437600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050611016565b604051808215151515815260200191505060405180910390f35b34801561045d57600080fd5b5061047c60048036038101908080359060200190929190505050611153565b005b34801561048a57600080fd5b506104bf600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611459565b005b3480156104cd57600080fd5b506104ec60048036038101908080359060200190929190505050611652565b604051808215151515815260200191505060405180910390f35b34801561051257600080fd5b5061053160048036038101908080359060200190929190505050611737565b005b34801561053f57600080fd5b5061055e600480360381019080803590602001909291905050506117b2565b6040518082815260200191505060405180910390f35b34801561058057600080fd5b5061059f6004803603810190808035906020019092919050505061187d565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018060200183151515158152602001828103825284818151815260200191508051906020019080838360005b83811015610621578082015181840152602081019050610606565b50505050905090810190601f16801561064e5780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b34801561066b57600080fd5b50610674611972565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156106b757808201518184015260208101905061069c565b505050509050019250505060405180910390f35b3480156106d757600080fd5b506107186004803603810190808035906020019092919080359060200190929190803515159060200190929190803515159060200190929190505050611a00565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561075b578082015181840152602081019050610740565b505050509050019250505060405180910390f35b34801561077b57600080fd5b50610784611b71565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156107d257600080fd5b506107f160048036038101908080359060200190929190505050611b97565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610834578082015181840152602081019050610819565b505050509050019250505060405180910390f35b34801561085457600080fd5b5061085d611dd4565b6040518082815260200191505060405180910390f35b34801561087f57600080fd5b5061089e60048036038101908080359060200190929190505050611dda565b005b3480156108ac57600080fd5b506108cb60048036038101908080359060200190929190505050611e8c565b005b3480156108d957600080fd5b5061095e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061208c565b6040518082815260200191505060405180910390f35b34801561098057600080fd5b5061099f600480360381019080803590602001909291905050506120ab565b6040518082815260200191505060405180910390f35b3480156109c157600080fd5b506109ca6120c3565b6040518082815260200191505060405180910390f35b3480156109ec57600080fd5b506109f56120c8565b6040518082815260200191505060405180910390f35b348015610a1757600080fd5b50610a6c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506120ce565b005b348015610a7a57600080fd5b50610a99600480360381019080803590602001909291905050506123e1565b005b600381815481101515610aaa57fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b1557600080fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610b6e57600080fd5b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600091505b600160038054905003821015610cf3578273ffffffffffffffffffffffffffffffffffffffff16600383815481101515610c0157fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610ce6576003600160038054905003815481101515610c5f57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600383815481101515610c9957fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cf3565b8180600101925050610bcb565b6001600381818054905003915081610d0b919061276a565b506003805490506004541115610d2a57610d29600380549050611dda565b5b8273ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a2505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610dcb57600080fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610e3657600080fd5b8360008082815260200190815260200160002060030160009054906101000a900460ff1615610e6457600080fd5b84610e6e81611652565b151515610e7a57600080fd5b60006001600088815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550853373ffffffffffffffffffffffffffffffffffffffff167ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e960405160405180910390a3505050505050565b60026020528060005260406000206000915054906101000a900460ff1681565b60016020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b60065481565b600080600090505b60055481101561100f57838015610fc3575060008082815260200190815260200160002060030160009054906101000a900460ff16155b80610ff65750828015610ff5575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b15611002576001820191505b8080600101915050610f8c565b5092915050565b600080600060405180807f72656d6f7665417574686f72697a656441646472657373286164647265737329815250602001905060405180910390209150600090505b600481101561114857818160048110151561106f57fe5b1a7f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191684828151811015156110c257fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614151561113b57600080fd5b8080600101915050611058565b600192505050919050565b60008160008082815260200190815260200160002060030160009054906101000a900460ff161561118357600080fd5b8261118d81611652565b151561119857600080fd5b8360008060008381526020019081526020016000209050600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561122f57600080fd5b6112d4816002018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156112ca5780601f1061129f576101008083540402835291602001916112ca565b820191906000526020600020905b8154815290600101906020018083116112ad57829003601f168201915b5050505050611016565b15156112df57600080fd5b600080878152602001908152602001600020945060018560030160006101000a81548160ff0219169083151502179055508460000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1685600101548660020160405180828054600181600116156101000203166002900480156113b95780601f1061138e576101008083540402835291602001916113b9565b820191906000526020600020905b81548152906001019060200180831161139c57829003601f168201915b505091505060006040518083038185875af1925050501561140657857f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a2611451565b857f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260008560030160006101000a81548160ff0219169083151502179055505b505050505050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561149357600080fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156114eb57600080fd5b8160008173ffffffffffffffffffffffffffffffffffffffff16141561151057600080fd5b600160038054905001600454603282118061152a57508181115b806115355750600081145b806115405750600082145b1561154a57600080fd5b6001600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060038590806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508473ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b6000806000809150600090505b60038054905081101561172f5760016000858152602001908152602001600020600060038381548110151561169057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561170f576001820191505b6004548214156117225760019250611730565b808060010191505061165f565b5b5050919050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561177157600080fd5b806006819055507fd1c9101a34feff75cccef14a28785a0279cb0b49c1f321f21f5f422e746b4377816040518082815260200191505060405180910390a150565b600080600090505b600380549050811015611877576001600084815260200190815260200160002060006003838154811015156117eb57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561186a576001820191505b80806001019150506117ba565b50919050565b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806001015490806002018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156119555780601f1061192a57610100808354040283529160200191611955565b820191906000526020600020905b81548152906001019060200180831161193857829003601f168201915b5050505050908060030160009054906101000a900460ff16905084565b606060038054806020026020016040519081016040528092919081815260200182805480156119f657602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116119ac575b5050505050905090565b606080600080600554604051908082528060200260200182016040528015611a375781602001602082028038833980820191505090505b50925060009150600090505b600554811015611ae357858015611a7a575060008082815260200190815260200160002060030160009054906101000a900460ff16155b80611aad5750848015611aac575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b15611ad657808383815181101515611ac157fe5b90602001906020020181815250506001820191505b8080600101915050611a43565b878703604051908082528060200260200182016040528015611b145781602001602082028038833980820191505090505b5093508790505b86811015611b66578281815181101515611b3157fe5b9060200190602002015184898303815181101515611b4b57fe5b90602001906020020181815250508080600101915050611b1b565b505050949350505050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606080600080600380549050604051908082528060200260200182016040528015611bd15781602001602082028038833980820191505090505b50925060009150600090505b600380549050811015611d1e57600160008681526020019081526020016000206000600383815481101515611c0e57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611d1157600381815481101515611c9557fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168383815181101515611cce57fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001820191505b8080600101915050611bdd565b81604051908082528060200260200182016040528015611d4d5781602001602082028038833980820191505090505b509350600090505b81811015611dcc578281815181101515611d6b57fe5b906020019060200201518482815181101515611d8357fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050611d55565b505050919050565b60055481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e1457600080fd5b600380549050816032821180611e2957508181115b80611e345750600081145b80611e3f5750600082145b15611e4957600080fd5b826004819055507fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a836040518082815260200191505060405180910390a1505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611ee557600080fd5b81600080600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611f3f57600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611fa957600080fd5b84611fb381611652565b151515611fbf57600080fd5b600180600088815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550853373ffffffffffffffffffffffffffffffffffffffff167f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef60405160405180910390a361207486611652565b156120845761208386426125c6565b5b505050505050565b600061209984848461261a565b90506120a481611e8c565b9392505050565b60076020528060005260406000206000915090505481565b603281565b60045481565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561210a57600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561216357600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156121bb57600080fd5b600092505b6003805490508310156122a4578473ffffffffffffffffffffffffffffffffffffffff166003848154811015156121f357fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415612297578360038481548110151561224a57fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506122a4565b82806001019350506121c0565b6000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508473ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a28373ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b60008160008082815260200190815260200160002060030160009054906101000a900460ff161561241157600080fd5b8261241b81611652565b151561242657600080fd5b83600654600760008381526020019081526020016000205401421015151561244d57600080fd5b600080868152602001908152602001600020935060018460030160006101000a81548160ff0219169083151502179055508360000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1684600101548560020160405180828054600181600116156101000203166002900480156125275780601f106124fc57610100808354040283529160200191612527565b820191906000526020600020905b81548152906001019060200180831161250a57829003601f168201915b505091505060006040518083038185875af1925050501561257457847f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a26125bf565b847f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260008460030160006101000a81548160ff0219169083151502179055505b5050505050565b806007600084815260200190815260200160002081905550817f0b237afe65f1514fd7ea3f923ea4fe792bdd07000a912b6cd1602a8e7f573c8d826040518082815260200191505060405180910390a25050565b60008360008173ffffffffffffffffffffffffffffffffffffffff16141561264157600080fd5b60055491506080604051908101604052808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020016000151581525060008084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101556040820151816002019080519060200190612700929190612796565b5060608201518160030160006101000a81548160ff0219169083151502179055509050506001600560008282540192505081905550817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a2509392505050565b815481835581811115612791578183600052602060002091820191016127909190612816565b5b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106127d757805160ff1916838001178555612805565b82800160010185558215612805579182015b828111156128045782518255916020019190600101906127e9565b5b5090506128129190612816565b5090565b61283891905b8082111561283457600081600090555060010161281c565b5090565b905600a165627a7a723058205b3170311683dd42d70d319dd5251070967966a260fd2e2f3fcfdfe5074872320029",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH3 0x11 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x40 MLOAD PUSH3 0x2B90 CODESIZE SUB DUP1 PUSH3 0x2B90 DUP4 CODECOPY DUP2 ADD DUP1 PUSH1 0x40 MSTORE DUP2 ADD SWAP1 DUP1 DUP1 MLOAD DUP3 ADD SWAP3 SWAP2 SWAP1 PUSH1 0x20 ADD DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP DUP4 DUP4 DUP4 DUP3 DUP3 PUSH1 0x0 DUP3 MLOAD DUP3 PUSH1 0x32 DUP3 GT DUP1 PUSH3 0x70 JUMPI POP DUP2 DUP2 GT JUMPDEST DUP1 PUSH3 0x7C JUMPI POP PUSH1 0x0 DUP2 EQ JUMPDEST DUP1 PUSH3 0x88 JUMPI POP PUSH1 0x0 DUP3 EQ JUMPDEST ISZERO PUSH3 0x93 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 SWAP3 POP JUMPDEST DUP5 MLOAD DUP4 LT ISZERO PUSH3 0x1CA JUMPI PUSH1 0x2 PUSH1 0x0 DUP7 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH3 0xB5 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND DUP1 PUSH3 0x141 JUMPI POP PUSH1 0x0 DUP6 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH3 0x11F JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ JUMPDEST ISZERO PUSH3 0x14C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x1 PUSH1 0x2 PUSH1 0x0 DUP8 DUP7 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH3 0x161 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP DUP3 DUP1 PUSH1 0x1 ADD SWAP4 POP POP PUSH3 0x98 JUMP JUMPDEST DUP5 PUSH1 0x3 SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH3 0x1E2 SWAP3 SWAP2 SWAP1 PUSH3 0x244 JUMP JUMPDEST POP DUP4 PUSH1 0x4 DUP2 SWAP1 SSTORE POP POP POP POP POP POP DUP1 PUSH1 0x6 DUP2 SWAP1 SSTORE POP POP POP POP DUP1 PUSH1 0x8 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP POP POP POP POP PUSH3 0x319 JUMP JUMPDEST DUP3 DUP1 SLOAD DUP3 DUP3 SSTORE SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 DUP2 ADD SWAP3 DUP3 ISZERO PUSH3 0x2C0 JUMPI SWAP2 PUSH1 0x20 MUL DUP3 ADD JUMPDEST DUP3 DUP2 GT ISZERO PUSH3 0x2BF JUMPI DUP3 MLOAD DUP3 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP SWAP2 PUSH1 0x20 ADD SWAP2 SWAP1 PUSH1 0x1 ADD SWAP1 PUSH3 0x265 JUMP JUMPDEST JUMPDEST POP SWAP1 POP PUSH3 0x2CF SWAP2 SWAP1 PUSH3 0x2D3 JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST PUSH3 0x316 SWAP2 SWAP1 JUMPDEST DUP1 DUP3 GT ISZERO PUSH3 0x312 JUMPI PUSH1 0x0 DUP2 DUP2 PUSH2 0x100 EXP DUP2 SLOAD SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 SSTORE POP PUSH1 0x1 ADD PUSH3 0x2DA JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST SWAP1 JUMP JUMPDEST PUSH2 0x2867 DUP1 PUSH3 0x329 PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN STOP PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x15F JUMPI PUSH1 0x0 CALLDATALOAD PUSH29 0x100000000000000000000000000000000000000000000000000000000 SWAP1 DIV PUSH4 0xFFFFFFFF AND DUP1 PUSH4 0x25E7C27 EQ PUSH2 0x1B9 JUMPI DUP1 PUSH4 0x173825D9 EQ PUSH2 0x226 JUMPI DUP1 PUSH4 0x20EA8D86 EQ PUSH2 0x269 JUMPI DUP1 PUSH4 0x2F54BF6E EQ PUSH2 0x296 JUMPI DUP1 PUSH4 0x3411C81C EQ PUSH2 0x2F1 JUMPI DUP1 PUSH4 0x37BD78A0 EQ PUSH2 0x356 JUMPI DUP1 PUSH4 0x54741525 EQ PUSH2 0x381 JUMPI DUP1 PUSH4 0x553A48FD EQ PUSH2 0x3D0 JUMPI DUP1 PUSH4 0x5711B311 EQ PUSH2 0x451 JUMPI DUP1 PUSH4 0x7065CB48 EQ PUSH2 0x47E JUMPI DUP1 PUSH4 0x784547A7 EQ PUSH2 0x4C1 JUMPI DUP1 PUSH4 0x7AD28C51 EQ PUSH2 0x506 JUMPI DUP1 PUSH4 0x8B51D13F EQ PUSH2 0x533 JUMPI DUP1 PUSH4 0x9ACE38C2 EQ PUSH2 0x574 JUMPI DUP1 PUSH4 0xA0E67E2B EQ PUSH2 0x65F JUMPI DUP1 PUSH4 0xA8ABE69A EQ PUSH2 0x6CB JUMPI DUP1 PUSH4 0xADD1CBC5 EQ PUSH2 0x76F JUMPI DUP1 PUSH4 0xB5DC40C3 EQ PUSH2 0x7C6 JUMPI DUP1 PUSH4 0xB77BF600 EQ PUSH2 0x848 JUMPI DUP1 PUSH4 0xBA51A6DF EQ PUSH2 0x873 JUMPI DUP1 PUSH4 0xC01A8C84 EQ PUSH2 0x8A0 JUMPI DUP1 PUSH4 0xC6427474 EQ PUSH2 0x8CD JUMPI DUP1 PUSH4 0xD38F2D82 EQ PUSH2 0x974 JUMPI DUP1 PUSH4 0xD74F8EDD EQ PUSH2 0x9B5 JUMPI DUP1 PUSH4 0xDC8452CD EQ PUSH2 0x9E0 JUMPI DUP1 PUSH4 0xE20056E6 EQ PUSH2 0xA0B JUMPI DUP1 PUSH4 0xEE22610B EQ PUSH2 0xA6E JUMPI JUMPDEST PUSH1 0x0 CALLVALUE GT ISZERO PUSH2 0x1B7 JUMPI CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xE1FFFCC4923D04B559F4D29A8BFC6CDA04EB5B0D3C460751C2402C5C5CC9109C CALLVALUE PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1C5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1E4 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xA9B JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x232 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x267 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xAD9 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x275 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x294 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xD72 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2A2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2D7 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xF2F JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2FD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x33C PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xF4F JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x362 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x36B PUSH2 0xF7E JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x38D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x3BA PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD ISZERO ISZERO SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD ISZERO ISZERO SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xF84 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3DC JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x437 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 POP POP POP PUSH2 0x1016 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x45D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x47C PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1153 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x48A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x4BF PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1459 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x4CD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x4EC PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1652 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x512 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x531 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1737 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x53F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x55E PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x17B2 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x580 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x59F PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x187D JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP5 DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP4 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE DUP5 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x621 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x606 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x64E JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP6 POP POP POP POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x66B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x674 PUSH2 0x1972 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE DUP4 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x6B7 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x69C JUMP JUMPDEST POP POP POP POP SWAP1 POP ADD SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x6D7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x718 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD ISZERO ISZERO SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD ISZERO ISZERO SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1A00 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE DUP4 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x75B JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x740 JUMP JUMPDEST POP POP POP POP SWAP1 POP ADD SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x77B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x784 PUSH2 0x1B71 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x7D2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x7F1 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1B97 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE DUP4 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x834 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x819 JUMP JUMPDEST POP POP POP POP SWAP1 POP ADD SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x854 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x85D PUSH2 0x1DD4 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x87F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x89E PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1DDA JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x8AC JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x8CB PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1E8C JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x8D9 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x95E PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 POP POP POP PUSH2 0x208C JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x980 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x99F PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x20AB JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x9C1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x9CA PUSH2 0x20C3 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x9EC JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x9F5 PUSH2 0x20C8 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xA17 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xA6C PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x20CE JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xA7A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xA99 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x23E1 JUMP JUMPDEST STOP JUMPDEST PUSH1 0x3 DUP2 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0xAAA JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP2 POP SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 ADDRESS PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0xB15 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 PUSH1 0x2 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO ISZERO PUSH2 0xB6E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH1 0x2 PUSH1 0x0 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP PUSH1 0x0 SWAP2 POP JUMPDEST PUSH1 0x1 PUSH1 0x3 DUP1 SLOAD SWAP1 POP SUB DUP3 LT ISZERO PUSH2 0xCF3 JUMPI DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x3 DUP4 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0xC01 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0xCE6 JUMPI PUSH1 0x3 PUSH1 0x1 PUSH1 0x3 DUP1 SLOAD SWAP1 POP SUB DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0xC5F JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x3 DUP4 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0xC99 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH2 0xCF3 JUMP JUMPDEST DUP2 DUP1 PUSH1 0x1 ADD SWAP3 POP POP PUSH2 0xBCB JUMP JUMPDEST PUSH1 0x1 PUSH1 0x3 DUP2 DUP2 DUP1 SLOAD SWAP1 POP SUB SWAP2 POP DUP2 PUSH2 0xD0B SWAP2 SWAP1 PUSH2 0x276A JUMP JUMPDEST POP PUSH1 0x3 DUP1 SLOAD SWAP1 POP PUSH1 0x4 SLOAD GT ISZERO PUSH2 0xD2A JUMPI PUSH2 0xD29 PUSH1 0x3 DUP1 SLOAD SWAP1 POP PUSH2 0x1DDA JUMP JUMPDEST JUMPDEST DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x8001553A916EF2F495D26A907CC54D96ED840D7BDA71E73194BF5A9DF7A76B90 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 POP POP POP JUMP JUMPDEST CALLER PUSH1 0x2 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO ISZERO PUSH2 0xDCB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLER PUSH1 0x1 PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO ISZERO PUSH2 0xE36 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP4 PUSH1 0x0 DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0xE64 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP5 PUSH2 0xE6E DUP2 PUSH2 0x1652 JUMP JUMPDEST ISZERO ISZERO ISZERO PUSH2 0xE7A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH1 0x1 PUSH1 0x0 DUP9 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP DUP6 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xF6A317157440607F36269043EB55F1287A5A19BA2216AFEAB88CD46CBCFB88E9 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x2 PUSH1 0x20 MSTORE DUP1 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP2 POP SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x20 MSTORE DUP2 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x20 MSTORE DUP1 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP2 POP SWAP2 POP SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH1 0x6 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 POP JUMPDEST PUSH1 0x5 SLOAD DUP2 LT ISZERO PUSH2 0x100F JUMPI DUP4 DUP1 ISZERO PUSH2 0xFC3 JUMPI POP PUSH1 0x0 DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO JUMPDEST DUP1 PUSH2 0xFF6 JUMPI POP DUP3 DUP1 ISZERO PUSH2 0xFF5 JUMPI POP PUSH1 0x0 DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND JUMPDEST JUMPDEST ISZERO PUSH2 0x1002 JUMPI PUSH1 0x1 DUP3 ADD SWAP2 POP JUMPDEST DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0xF8C JUMP JUMPDEST POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP1 PUSH32 0x72656D6F7665417574686F72697A656441646472657373286164647265737329 DUP2 MSTORE POP PUSH1 0x20 ADD SWAP1 POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 KECCAK256 SWAP2 POP PUSH1 0x0 SWAP1 POP JUMPDEST PUSH1 0x4 DUP2 LT ISZERO PUSH2 0x1148 JUMPI DUP2 DUP2 PUSH1 0x4 DUP2 LT ISZERO ISZERO PUSH2 0x106F JUMPI INVALID JUMPDEST BYTE PUSH32 0x100000000000000000000000000000000000000000000000000000000000000 MUL PUSH31 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF NOT AND DUP5 DUP3 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x10C2 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD ADD MLOAD PUSH32 0x100000000000000000000000000000000000000000000000000000000000000 SWAP1 DIV PUSH32 0x100000000000000000000000000000000000000000000000000000000000000 MUL PUSH31 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF NOT AND EQ ISZERO ISZERO PUSH2 0x113B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0x1058 JUMP JUMPDEST PUSH1 0x1 SWAP3 POP POP POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x0 DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0x1183 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 PUSH2 0x118D DUP2 PUSH2 0x1652 JUMP JUMPDEST ISZERO ISZERO PUSH2 0x1198 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP4 PUSH1 0x0 DUP1 PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SWAP1 POP PUSH1 0x8 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 PUSH1 0x0 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x122F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x12D4 DUP2 PUSH1 0x2 ADD DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x12CA JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x129F JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x12CA JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x12AD JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP PUSH2 0x1016 JUMP JUMPDEST ISZERO ISZERO PUSH2 0x12DF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP1 DUP8 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SWAP5 POP PUSH1 0x1 DUP6 PUSH1 0x3 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP DUP5 PUSH1 0x0 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP6 PUSH1 0x1 ADD SLOAD DUP7 PUSH1 0x2 ADD PUSH1 0x40 MLOAD DUP1 DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x13B9 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x138E JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x13B9 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x139C JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP SWAP2 POP POP PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP6 DUP8 GAS CALL SWAP3 POP POP POP ISZERO PUSH2 0x1406 JUMPI DUP6 PUSH32 0x33E13ECB54C3076D8E8BB8C2881800A4D972B792045FFAE98FDF46DF365FED75 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 PUSH2 0x1451 JUMP JUMPDEST DUP6 PUSH32 0x526441BB6C1ABA3C9A4A6CA1D6545DA9C2333C8C48343EF398EB858D72B79236 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 PUSH1 0x0 DUP6 PUSH1 0x3 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP JUMPDEST POP POP POP POP POP POP JUMP JUMPDEST ADDRESS PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x1493 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 PUSH1 0x2 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0x14EB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 PUSH1 0x0 DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0x1510 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x1 PUSH1 0x3 DUP1 SLOAD SWAP1 POP ADD PUSH1 0x4 SLOAD PUSH1 0x32 DUP3 GT DUP1 PUSH2 0x152A JUMPI POP DUP2 DUP2 GT JUMPDEST DUP1 PUSH2 0x1535 JUMPI POP PUSH1 0x0 DUP2 EQ JUMPDEST DUP1 PUSH2 0x1540 JUMPI POP PUSH1 0x0 DUP3 EQ JUMPDEST ISZERO PUSH2 0x154A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x1 PUSH1 0x2 PUSH1 0x0 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP PUSH1 0x3 DUP6 SWAP1 DUP1 PUSH1 0x1 DUP2 SLOAD ADD DUP1 DUP3 SSTORE DUP1 SWAP2 POP POP SWAP1 PUSH1 0x1 DUP3 SUB SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SWAP2 SWAP3 SWAP1 SWAP2 SWAP1 SWAP2 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP POP DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xF39E6E1EB0EDCF53C221607B54B00CD28F3196FED0A24994DC308B8F611B682D PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 SWAP2 POP PUSH1 0x0 SWAP1 POP JUMPDEST PUSH1 0x3 DUP1 SLOAD SWAP1 POP DUP2 LT ISZERO PUSH2 0x172F JUMPI PUSH1 0x1 PUSH1 0x0 DUP6 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH1 0x3 DUP4 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1690 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0x170F JUMPI PUSH1 0x1 DUP3 ADD SWAP2 POP JUMPDEST PUSH1 0x4 SLOAD DUP3 EQ ISZERO PUSH2 0x1722 JUMPI PUSH1 0x1 SWAP3 POP PUSH2 0x1730 JUMP JUMPDEST DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0x165F JUMP JUMPDEST JUMPDEST POP POP SWAP2 SWAP1 POP JUMP JUMPDEST ADDRESS PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x1771 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 PUSH1 0x6 DUP2 SWAP1 SSTORE POP PUSH32 0xD1C9101A34FEFF75CCCEF14A28785A0279CB0B49C1F321F21F5F422E746B4377 DUP2 PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 POP JUMPDEST PUSH1 0x3 DUP1 SLOAD SWAP1 POP DUP2 LT ISZERO PUSH2 0x1877 JUMPI PUSH1 0x1 PUSH1 0x0 DUP5 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH1 0x3 DUP4 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x17EB JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0x186A JUMPI PUSH1 0x1 DUP3 ADD SWAP2 POP JUMPDEST DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0x17BA JUMP JUMPDEST POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 MSTORE DUP1 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP2 POP SWAP1 POP DUP1 PUSH1 0x0 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 DUP1 PUSH1 0x1 ADD SLOAD SWAP1 DUP1 PUSH1 0x2 ADD DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x1955 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x192A JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x1955 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x1938 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP1 DUP1 PUSH1 0x3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND SWAP1 POP DUP5 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x3 DUP1 SLOAD DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD DUP1 ISZERO PUSH2 0x19F6 JUMPI PUSH1 0x20 MUL DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 PUSH1 0x1 ADD SWAP1 DUP1 DUP4 GT PUSH2 0x19AC JUMPI JUMPDEST POP POP POP POP POP SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x60 DUP1 PUSH1 0x0 DUP1 PUSH1 0x5 SLOAD PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x1A37 JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CODESIZE DUP4 CODECOPY DUP1 DUP3 ADD SWAP2 POP POP SWAP1 POP JUMPDEST POP SWAP3 POP PUSH1 0x0 SWAP2 POP PUSH1 0x0 SWAP1 POP JUMPDEST PUSH1 0x5 SLOAD DUP2 LT ISZERO PUSH2 0x1AE3 JUMPI DUP6 DUP1 ISZERO PUSH2 0x1A7A JUMPI POP PUSH1 0x0 DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO JUMPDEST DUP1 PUSH2 0x1AAD JUMPI POP DUP5 DUP1 ISZERO PUSH2 0x1AAC JUMPI POP PUSH1 0x0 DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND JUMPDEST JUMPDEST ISZERO PUSH2 0x1AD6 JUMPI DUP1 DUP4 DUP4 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1AC1 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD DUP2 DUP2 MSTORE POP POP PUSH1 0x1 DUP3 ADD SWAP2 POP JUMPDEST DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0x1A43 JUMP JUMPDEST DUP8 DUP8 SUB PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x1B14 JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CODESIZE DUP4 CODECOPY DUP1 DUP3 ADD SWAP2 POP POP SWAP1 POP JUMPDEST POP SWAP4 POP DUP8 SWAP1 POP JUMPDEST DUP7 DUP2 LT ISZERO PUSH2 0x1B66 JUMPI DUP3 DUP2 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1B31 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP5 DUP10 DUP4 SUB DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1B4B JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD DUP2 DUP2 MSTORE POP POP DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0x1B1B JUMP JUMPDEST POP POP POP SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x8 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x60 DUP1 PUSH1 0x0 DUP1 PUSH1 0x3 DUP1 SLOAD SWAP1 POP PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x1BD1 JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CODESIZE DUP4 CODECOPY DUP1 DUP3 ADD SWAP2 POP POP SWAP1 POP JUMPDEST POP SWAP3 POP PUSH1 0x0 SWAP2 POP PUSH1 0x0 SWAP1 POP JUMPDEST PUSH1 0x3 DUP1 SLOAD SWAP1 POP DUP2 LT ISZERO PUSH2 0x1D1E JUMPI PUSH1 0x1 PUSH1 0x0 DUP7 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH1 0x3 DUP4 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1C0E JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0x1D11 JUMPI PUSH1 0x3 DUP2 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1C95 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP4 DUP4 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1CCE JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE POP POP PUSH1 0x1 DUP3 ADD SWAP2 POP JUMPDEST DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0x1BDD JUMP JUMPDEST DUP2 PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x1D4D JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CODESIZE DUP4 CODECOPY DUP1 DUP3 ADD SWAP2 POP POP SWAP1 POP JUMPDEST POP SWAP4 POP PUSH1 0x0 SWAP1 POP JUMPDEST DUP2 DUP2 LT ISZERO PUSH2 0x1DCC JUMPI DUP3 DUP2 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1D6B JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP5 DUP3 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1D83 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE POP POP DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0x1D55 JUMP JUMPDEST POP POP POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x5 SLOAD DUP2 JUMP JUMPDEST ADDRESS PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x1E14 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x3 DUP1 SLOAD SWAP1 POP DUP2 PUSH1 0x32 DUP3 GT DUP1 PUSH2 0x1E29 JUMPI POP DUP2 DUP2 GT JUMPDEST DUP1 PUSH2 0x1E34 JUMPI POP PUSH1 0x0 DUP2 EQ JUMPDEST DUP1 PUSH2 0x1E3F JUMPI POP PUSH1 0x0 DUP3 EQ JUMPDEST ISZERO PUSH2 0x1E49 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 PUSH1 0x4 DUP2 SWAP1 SSTORE POP PUSH32 0xA3F1EE9126A074D9326C682F561767F710E927FAA811F7A99829D49DC421797A DUP4 PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG1 POP POP POP JUMP JUMPDEST CALLER PUSH1 0x2 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO ISZERO PUSH2 0x1EE5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 PUSH1 0x0 DUP1 PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0x1F3F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 CALLER PUSH1 0x1 PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0x1FA9 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP5 PUSH2 0x1FB3 DUP2 PUSH2 0x1652 JUMP JUMPDEST ISZERO ISZERO ISZERO PUSH2 0x1FBF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x1 DUP1 PUSH1 0x0 DUP9 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP DUP6 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x4A504A94899432A9846E1AA406DCEB1BCFD538BB839071D49D1E5E23F5BE30EF PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH2 0x2074 DUP7 PUSH2 0x1652 JUMP JUMPDEST ISZERO PUSH2 0x2084 JUMPI PUSH2 0x2083 DUP7 TIMESTAMP PUSH2 0x25C6 JUMP JUMPDEST JUMPDEST POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x2099 DUP5 DUP5 DUP5 PUSH2 0x261A JUMP JUMPDEST SWAP1 POP PUSH2 0x20A4 DUP2 PUSH2 0x1E8C JUMP JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x7 PUSH1 0x20 MSTORE DUP1 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP2 POP SWAP1 POP SLOAD DUP2 JUMP JUMPDEST PUSH1 0x32 DUP2 JUMP JUMPDEST PUSH1 0x4 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 ADDRESS PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x210A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 PUSH1 0x2 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO ISZERO PUSH2 0x2163 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 PUSH1 0x2 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0x21BB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 SWAP3 POP JUMPDEST PUSH1 0x3 DUP1 SLOAD SWAP1 POP DUP4 LT ISZERO PUSH2 0x22A4 JUMPI DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x3 DUP5 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x21F3 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0x2297 JUMPI DUP4 PUSH1 0x3 DUP5 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x224A JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH2 0x22A4 JUMP JUMPDEST DUP3 DUP1 PUSH1 0x1 ADD SWAP4 POP POP PUSH2 0x21C0 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x2 PUSH1 0x0 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP PUSH1 0x1 PUSH1 0x2 PUSH1 0x0 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x8001553A916EF2F495D26A907CC54D96ED840D7BDA71E73194BF5A9DF7A76B90 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xF39E6E1EB0EDCF53C221607B54B00CD28F3196FED0A24994DC308B8F611B682D PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x0 DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0x2411 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 PUSH2 0x241B DUP2 PUSH2 0x1652 JUMP JUMPDEST ISZERO ISZERO PUSH2 0x2426 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP4 PUSH1 0x6 SLOAD PUSH1 0x7 PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD ADD TIMESTAMP LT ISZERO ISZERO ISZERO PUSH2 0x244D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP1 DUP7 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SWAP4 POP PUSH1 0x1 DUP5 PUSH1 0x3 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP DUP4 PUSH1 0x0 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP5 PUSH1 0x1 ADD SLOAD DUP6 PUSH1 0x2 ADD PUSH1 0x40 MLOAD DUP1 DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x2527 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x24FC JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x2527 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x250A JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP SWAP2 POP POP PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP6 DUP8 GAS CALL SWAP3 POP POP POP ISZERO PUSH2 0x2574 JUMPI DUP5 PUSH32 0x33E13ECB54C3076D8E8BB8C2881800A4D972B792045FFAE98FDF46DF365FED75 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 PUSH2 0x25BF JUMP JUMPDEST DUP5 PUSH32 0x526441BB6C1ABA3C9A4A6CA1D6545DA9C2333C8C48343EF398EB858D72B79236 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 PUSH1 0x0 DUP5 PUSH1 0x3 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP JUMPDEST POP POP POP POP POP JUMP JUMPDEST DUP1 PUSH1 0x7 PUSH1 0x0 DUP5 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP DUP2 PUSH32 0xB237AFE65F1514FD7EA3F923EA4FE792BDD07000A912B6CD1602A8E7F573C8D DUP3 PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP4 PUSH1 0x0 DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0x2641 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x5 SLOAD SWAP2 POP PUSH1 0x80 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP6 DUP2 MSTORE PUSH1 0x20 ADD DUP5 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 ISZERO ISZERO DUP2 MSTORE POP PUSH1 0x0 DUP1 DUP5 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 ADD MLOAD DUP2 PUSH1 0x0 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH1 0x20 DUP3 ADD MLOAD DUP2 PUSH1 0x1 ADD SSTORE PUSH1 0x40 DUP3 ADD MLOAD DUP2 PUSH1 0x2 ADD SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH2 0x2700 SWAP3 SWAP2 SWAP1 PUSH2 0x2796 JUMP JUMPDEST POP PUSH1 0x60 DUP3 ADD MLOAD DUP2 PUSH1 0x3 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP SWAP1 POP POP PUSH1 0x1 PUSH1 0x5 PUSH1 0x0 DUP3 DUP3 SLOAD ADD SWAP3 POP POP DUP2 SWAP1 SSTORE POP DUP2 PUSH32 0xC0BA8FE4B176C1714197D43B9CC6BCF797A4A7461C5FE8D0EF6E184AE7601E51 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST DUP2 SLOAD DUP2 DUP4 SSTORE DUP2 DUP2 GT ISZERO PUSH2 0x2791 JUMPI DUP2 DUP4 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP2 DUP3 ADD SWAP2 ADD PUSH2 0x2790 SWAP2 SWAP1 PUSH2 0x2816 JUMP JUMPDEST JUMPDEST POP POP POP JUMP JUMPDEST DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 PUSH1 0x1F ADD PUSH1 0x20 SWAP1 DIV DUP2 ADD SWAP3 DUP3 PUSH1 0x1F LT PUSH2 0x27D7 JUMPI DUP1 MLOAD PUSH1 0xFF NOT AND DUP4 DUP1 ADD OR DUP6 SSTORE PUSH2 0x2805 JUMP JUMPDEST DUP3 DUP1 ADD PUSH1 0x1 ADD DUP6 SSTORE DUP3 ISZERO PUSH2 0x2805 JUMPI SWAP2 DUP3 ADD JUMPDEST DUP3 DUP2 GT ISZERO PUSH2 0x2804 JUMPI DUP3 MLOAD DUP3 SSTORE SWAP2 PUSH1 0x20 ADD SWAP2 SWAP1 PUSH1 0x1 ADD SWAP1 PUSH2 0x27E9 JUMP JUMPDEST JUMPDEST POP SWAP1 POP PUSH2 0x2812 SWAP2 SWAP1 PUSH2 0x2816 JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST PUSH2 0x2838 SWAP2 SWAP1 JUMPDEST DUP1 DUP3 GT ISZERO PUSH2 0x2834 JUMPI PUSH1 0x0 DUP2 PUSH1 0x0 SWAP1 SSTORE POP PUSH1 0x1 ADD PUSH2 0x281C JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST SWAP1 JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 JUMPDEST BALANCE PUSH17 0x311683DD42D70D319DD5251070967966A2 PUSH1 0xFD 0x2e 0x2f 0x3f 0xcf 0xdf 0xe5 SMOD 0x48 PUSH19 0x32002900000000000000000000000000000000 ",
- "sourceMap": "698:2422:2:-;;;1566:349;8:9:-1;5:2;;;30:1;27;20:12;5:2;1566:349:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1803:7;1812:9;1823:18;2038:7:1;2047:9;2959:6:0;2913:7;:14;2929:9;256:2;2236:10;:28;:66;;;;2292:10;2280:9;:22;2236:66;:96;;;;2331:1;2318:9;:14;2236:96;:127;;;;2362:1;2348:10;:15;2236:127;2229:153;;;2377:5;;;2229:153;2966:1;2959:8;;2954:168;2971:7;:14;2969:1;:16;2954:168;;;3010:7;:19;3018:7;3026:1;3018:10;;;;;;;;;;;;;;;;;;3010:19;;;;;;;;;;;;;;;;;;;;;;;;;:38;;;;3047:1;3033:7;3041:1;3033:10;;;;;;;;;;;;;;;;;;:15;;;3010:38;3006:65;;;3066:5;;;3006:65;3107:4;3085:7;:19;3093:7;3101:1;3093:10;;;;;;;;;;;;;;;;;;3085:19;;;;;;;;;;;;;;;;:26;;;;;;;;;;;;;;;;;;2987:3;;;;;;;2954:168;;;3140:7;3131:6;:16;;;;;;;;;;;;:::i;:::-;;3168:9;3157:8;:20;;;;2814:370;;;;;2092:18:1;2072:17;:38;;;;1904:213;;;1889:19:2;1857:29;;:51;;;;;;;;;;;;;;;;;;1566:349;;;;698:2422;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;"
- },
- "deployedBytecode": {
- "linkReferences": {},
- "object": "0x60806040526004361061015f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063025e7c27146101b9578063173825d91461022657806320ea8d86146102695780632f54bf6e146102965780633411c81c146102f157806337bd78a0146103565780635474152514610381578063553a48fd146103d05780635711b311146104515780637065cb481461047e578063784547a7146104c15780637ad28c51146105065780638b51d13f146105335780639ace38c214610574578063a0e67e2b1461065f578063a8abe69a146106cb578063add1cbc51461076f578063b5dc40c3146107c6578063b77bf60014610848578063ba51a6df14610873578063c01a8c84146108a0578063c6427474146108cd578063d38f2d8214610974578063d74f8edd146109b5578063dc8452cd146109e0578063e20056e614610a0b578063ee22610b14610a6e575b60003411156101b7573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a25b005b3480156101c557600080fd5b506101e460048036038101908080359060200190929190505050610a9b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561023257600080fd5b50610267600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ad9565b005b34801561027557600080fd5b5061029460048036038101908080359060200190929190505050610d72565b005b3480156102a257600080fd5b506102d7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f2f565b604051808215151515815260200191505060405180910390f35b3480156102fd57600080fd5b5061033c60048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f4f565b604051808215151515815260200191505060405180910390f35b34801561036257600080fd5b5061036b610f7e565b6040518082815260200191505060405180910390f35b34801561038d57600080fd5b506103ba600480360381019080803515159060200190929190803515159060200190929190505050610f84565b6040518082815260200191505060405180910390f35b3480156103dc57600080fd5b50610437600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050611016565b604051808215151515815260200191505060405180910390f35b34801561045d57600080fd5b5061047c60048036038101908080359060200190929190505050611153565b005b34801561048a57600080fd5b506104bf600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611459565b005b3480156104cd57600080fd5b506104ec60048036038101908080359060200190929190505050611652565b604051808215151515815260200191505060405180910390f35b34801561051257600080fd5b5061053160048036038101908080359060200190929190505050611737565b005b34801561053f57600080fd5b5061055e600480360381019080803590602001909291905050506117b2565b6040518082815260200191505060405180910390f35b34801561058057600080fd5b5061059f6004803603810190808035906020019092919050505061187d565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018060200183151515158152602001828103825284818151815260200191508051906020019080838360005b83811015610621578082015181840152602081019050610606565b50505050905090810190601f16801561064e5780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b34801561066b57600080fd5b50610674611972565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156106b757808201518184015260208101905061069c565b505050509050019250505060405180910390f35b3480156106d757600080fd5b506107186004803603810190808035906020019092919080359060200190929190803515159060200190929190803515159060200190929190505050611a00565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561075b578082015181840152602081019050610740565b505050509050019250505060405180910390f35b34801561077b57600080fd5b50610784611b71565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156107d257600080fd5b506107f160048036038101908080359060200190929190505050611b97565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610834578082015181840152602081019050610819565b505050509050019250505060405180910390f35b34801561085457600080fd5b5061085d611dd4565b6040518082815260200191505060405180910390f35b34801561087f57600080fd5b5061089e60048036038101908080359060200190929190505050611dda565b005b3480156108ac57600080fd5b506108cb60048036038101908080359060200190929190505050611e8c565b005b3480156108d957600080fd5b5061095e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061208c565b6040518082815260200191505060405180910390f35b34801561098057600080fd5b5061099f600480360381019080803590602001909291905050506120ab565b6040518082815260200191505060405180910390f35b3480156109c157600080fd5b506109ca6120c3565b6040518082815260200191505060405180910390f35b3480156109ec57600080fd5b506109f56120c8565b6040518082815260200191505060405180910390f35b348015610a1757600080fd5b50610a6c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506120ce565b005b348015610a7a57600080fd5b50610a99600480360381019080803590602001909291905050506123e1565b005b600381815481101515610aaa57fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b1557600080fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610b6e57600080fd5b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600091505b600160038054905003821015610cf3578273ffffffffffffffffffffffffffffffffffffffff16600383815481101515610c0157fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610ce6576003600160038054905003815481101515610c5f57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600383815481101515610c9957fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cf3565b8180600101925050610bcb565b6001600381818054905003915081610d0b919061276a565b506003805490506004541115610d2a57610d29600380549050611dda565b5b8273ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a2505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610dcb57600080fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610e3657600080fd5b8360008082815260200190815260200160002060030160009054906101000a900460ff1615610e6457600080fd5b84610e6e81611652565b151515610e7a57600080fd5b60006001600088815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550853373ffffffffffffffffffffffffffffffffffffffff167ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e960405160405180910390a3505050505050565b60026020528060005260406000206000915054906101000a900460ff1681565b60016020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b60065481565b600080600090505b60055481101561100f57838015610fc3575060008082815260200190815260200160002060030160009054906101000a900460ff16155b80610ff65750828015610ff5575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b15611002576001820191505b8080600101915050610f8c565b5092915050565b600080600060405180807f72656d6f7665417574686f72697a656441646472657373286164647265737329815250602001905060405180910390209150600090505b600481101561114857818160048110151561106f57fe5b1a7f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191684828151811015156110c257fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614151561113b57600080fd5b8080600101915050611058565b600192505050919050565b60008160008082815260200190815260200160002060030160009054906101000a900460ff161561118357600080fd5b8261118d81611652565b151561119857600080fd5b8360008060008381526020019081526020016000209050600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561122f57600080fd5b6112d4816002018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156112ca5780601f1061129f576101008083540402835291602001916112ca565b820191906000526020600020905b8154815290600101906020018083116112ad57829003601f168201915b5050505050611016565b15156112df57600080fd5b600080878152602001908152602001600020945060018560030160006101000a81548160ff0219169083151502179055508460000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1685600101548660020160405180828054600181600116156101000203166002900480156113b95780601f1061138e576101008083540402835291602001916113b9565b820191906000526020600020905b81548152906001019060200180831161139c57829003601f168201915b505091505060006040518083038185875af1925050501561140657857f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a2611451565b857f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260008560030160006101000a81548160ff0219169083151502179055505b505050505050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561149357600080fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156114eb57600080fd5b8160008173ffffffffffffffffffffffffffffffffffffffff16141561151057600080fd5b600160038054905001600454603282118061152a57508181115b806115355750600081145b806115405750600082145b1561154a57600080fd5b6001600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060038590806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508473ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b6000806000809150600090505b60038054905081101561172f5760016000858152602001908152602001600020600060038381548110151561169057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561170f576001820191505b6004548214156117225760019250611730565b808060010191505061165f565b5b5050919050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561177157600080fd5b806006819055507fd1c9101a34feff75cccef14a28785a0279cb0b49c1f321f21f5f422e746b4377816040518082815260200191505060405180910390a150565b600080600090505b600380549050811015611877576001600084815260200190815260200160002060006003838154811015156117eb57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561186a576001820191505b80806001019150506117ba565b50919050565b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806001015490806002018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156119555780601f1061192a57610100808354040283529160200191611955565b820191906000526020600020905b81548152906001019060200180831161193857829003601f168201915b5050505050908060030160009054906101000a900460ff16905084565b606060038054806020026020016040519081016040528092919081815260200182805480156119f657602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116119ac575b5050505050905090565b606080600080600554604051908082528060200260200182016040528015611a375781602001602082028038833980820191505090505b50925060009150600090505b600554811015611ae357858015611a7a575060008082815260200190815260200160002060030160009054906101000a900460ff16155b80611aad5750848015611aac575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b15611ad657808383815181101515611ac157fe5b90602001906020020181815250506001820191505b8080600101915050611a43565b878703604051908082528060200260200182016040528015611b145781602001602082028038833980820191505090505b5093508790505b86811015611b66578281815181101515611b3157fe5b9060200190602002015184898303815181101515611b4b57fe5b90602001906020020181815250508080600101915050611b1b565b505050949350505050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606080600080600380549050604051908082528060200260200182016040528015611bd15781602001602082028038833980820191505090505b50925060009150600090505b600380549050811015611d1e57600160008681526020019081526020016000206000600383815481101515611c0e57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611d1157600381815481101515611c9557fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168383815181101515611cce57fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001820191505b8080600101915050611bdd565b81604051908082528060200260200182016040528015611d4d5781602001602082028038833980820191505090505b509350600090505b81811015611dcc578281815181101515611d6b57fe5b906020019060200201518482815181101515611d8357fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050611d55565b505050919050565b60055481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e1457600080fd5b600380549050816032821180611e2957508181115b80611e345750600081145b80611e3f5750600082145b15611e4957600080fd5b826004819055507fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a836040518082815260200191505060405180910390a1505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611ee557600080fd5b81600080600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611f3f57600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611fa957600080fd5b84611fb381611652565b151515611fbf57600080fd5b600180600088815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550853373ffffffffffffffffffffffffffffffffffffffff167f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef60405160405180910390a361207486611652565b156120845761208386426125c6565b5b505050505050565b600061209984848461261a565b90506120a481611e8c565b9392505050565b60076020528060005260406000206000915090505481565b603281565b60045481565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561210a57600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561216357600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156121bb57600080fd5b600092505b6003805490508310156122a4578473ffffffffffffffffffffffffffffffffffffffff166003848154811015156121f357fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415612297578360038481548110151561224a57fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506122a4565b82806001019350506121c0565b6000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508473ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a28373ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b60008160008082815260200190815260200160002060030160009054906101000a900460ff161561241157600080fd5b8261241b81611652565b151561242657600080fd5b83600654600760008381526020019081526020016000205401421015151561244d57600080fd5b600080868152602001908152602001600020935060018460030160006101000a81548160ff0219169083151502179055508360000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1684600101548560020160405180828054600181600116156101000203166002900480156125275780601f106124fc57610100808354040283529160200191612527565b820191906000526020600020905b81548152906001019060200180831161250a57829003601f168201915b505091505060006040518083038185875af1925050501561257457847f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a26125bf565b847f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260008460030160006101000a81548160ff0219169083151502179055505b5050505050565b806007600084815260200190815260200160002081905550817f0b237afe65f1514fd7ea3f923ea4fe792bdd07000a912b6cd1602a8e7f573c8d826040518082815260200191505060405180910390a25050565b60008360008173ffffffffffffffffffffffffffffffffffffffff16141561264157600080fd5b60055491506080604051908101604052808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020016000151581525060008084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101556040820151816002019080519060200190612700929190612796565b5060608201518160030160006101000a81548160ff0219169083151502179055509050506001600560008282540192505081905550817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a2509392505050565b815481835581811115612791578183600052602060002091820191016127909190612816565b5b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106127d757805160ff1916838001178555612805565b82800160010185558215612805579182015b828111156128045782518255916020019190600101906127e9565b5b5090506128129190612816565b5090565b61283891905b8082111561283457600081600090555060010161281c565b5090565b905600a165627a7a723058205b3170311683dd42d70d319dd5251070967966a260fd2e2f3fcfdfe5074872320029",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x15F JUMPI PUSH1 0x0 CALLDATALOAD PUSH29 0x100000000000000000000000000000000000000000000000000000000 SWAP1 DIV PUSH4 0xFFFFFFFF AND DUP1 PUSH4 0x25E7C27 EQ PUSH2 0x1B9 JUMPI DUP1 PUSH4 0x173825D9 EQ PUSH2 0x226 JUMPI DUP1 PUSH4 0x20EA8D86 EQ PUSH2 0x269 JUMPI DUP1 PUSH4 0x2F54BF6E EQ PUSH2 0x296 JUMPI DUP1 PUSH4 0x3411C81C EQ PUSH2 0x2F1 JUMPI DUP1 PUSH4 0x37BD78A0 EQ PUSH2 0x356 JUMPI DUP1 PUSH4 0x54741525 EQ PUSH2 0x381 JUMPI DUP1 PUSH4 0x553A48FD EQ PUSH2 0x3D0 JUMPI DUP1 PUSH4 0x5711B311 EQ PUSH2 0x451 JUMPI DUP1 PUSH4 0x7065CB48 EQ PUSH2 0x47E JUMPI DUP1 PUSH4 0x784547A7 EQ PUSH2 0x4C1 JUMPI DUP1 PUSH4 0x7AD28C51 EQ PUSH2 0x506 JUMPI DUP1 PUSH4 0x8B51D13F EQ PUSH2 0x533 JUMPI DUP1 PUSH4 0x9ACE38C2 EQ PUSH2 0x574 JUMPI DUP1 PUSH4 0xA0E67E2B EQ PUSH2 0x65F JUMPI DUP1 PUSH4 0xA8ABE69A EQ PUSH2 0x6CB JUMPI DUP1 PUSH4 0xADD1CBC5 EQ PUSH2 0x76F JUMPI DUP1 PUSH4 0xB5DC40C3 EQ PUSH2 0x7C6 JUMPI DUP1 PUSH4 0xB77BF600 EQ PUSH2 0x848 JUMPI DUP1 PUSH4 0xBA51A6DF EQ PUSH2 0x873 JUMPI DUP1 PUSH4 0xC01A8C84 EQ PUSH2 0x8A0 JUMPI DUP1 PUSH4 0xC6427474 EQ PUSH2 0x8CD JUMPI DUP1 PUSH4 0xD38F2D82 EQ PUSH2 0x974 JUMPI DUP1 PUSH4 0xD74F8EDD EQ PUSH2 0x9B5 JUMPI DUP1 PUSH4 0xDC8452CD EQ PUSH2 0x9E0 JUMPI DUP1 PUSH4 0xE20056E6 EQ PUSH2 0xA0B JUMPI DUP1 PUSH4 0xEE22610B EQ PUSH2 0xA6E JUMPI JUMPDEST PUSH1 0x0 CALLVALUE GT ISZERO PUSH2 0x1B7 JUMPI CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xE1FFFCC4923D04B559F4D29A8BFC6CDA04EB5B0D3C460751C2402C5C5CC9109C CALLVALUE PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1C5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1E4 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xA9B JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x232 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x267 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xAD9 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x275 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x294 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xD72 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2A2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2D7 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xF2F JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2FD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x33C PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xF4F JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x362 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x36B PUSH2 0xF7E JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x38D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x3BA PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD ISZERO ISZERO SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD ISZERO ISZERO SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xF84 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3DC JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x437 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 POP POP POP PUSH2 0x1016 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x45D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x47C PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1153 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x48A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x4BF PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1459 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x4CD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x4EC PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1652 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x512 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x531 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1737 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x53F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x55E PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x17B2 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x580 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x59F PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x187D JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP5 DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP4 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE DUP5 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x621 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x606 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x64E JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP6 POP POP POP POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x66B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x674 PUSH2 0x1972 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE DUP4 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x6B7 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x69C JUMP JUMPDEST POP POP POP POP SWAP1 POP ADD SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x6D7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x718 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD ISZERO ISZERO SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD ISZERO ISZERO SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1A00 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE DUP4 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x75B JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x740 JUMP JUMPDEST POP POP POP POP SWAP1 POP ADD SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x77B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x784 PUSH2 0x1B71 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x7D2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x7F1 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1B97 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE DUP4 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x834 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x819 JUMP JUMPDEST POP POP POP POP SWAP1 POP ADD SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x854 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x85D PUSH2 0x1DD4 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x87F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x89E PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1DDA JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x8AC JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x8CB PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1E8C JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x8D9 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x95E PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 POP POP POP PUSH2 0x208C JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x980 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x99F PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x20AB JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x9C1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x9CA PUSH2 0x20C3 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x9EC JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x9F5 PUSH2 0x20C8 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xA17 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xA6C PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x20CE JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xA7A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xA99 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x23E1 JUMP JUMPDEST STOP JUMPDEST PUSH1 0x3 DUP2 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0xAAA JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP2 POP SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 ADDRESS PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0xB15 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 PUSH1 0x2 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO ISZERO PUSH2 0xB6E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH1 0x2 PUSH1 0x0 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP PUSH1 0x0 SWAP2 POP JUMPDEST PUSH1 0x1 PUSH1 0x3 DUP1 SLOAD SWAP1 POP SUB DUP3 LT ISZERO PUSH2 0xCF3 JUMPI DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x3 DUP4 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0xC01 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0xCE6 JUMPI PUSH1 0x3 PUSH1 0x1 PUSH1 0x3 DUP1 SLOAD SWAP1 POP SUB DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0xC5F JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x3 DUP4 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0xC99 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH2 0xCF3 JUMP JUMPDEST DUP2 DUP1 PUSH1 0x1 ADD SWAP3 POP POP PUSH2 0xBCB JUMP JUMPDEST PUSH1 0x1 PUSH1 0x3 DUP2 DUP2 DUP1 SLOAD SWAP1 POP SUB SWAP2 POP DUP2 PUSH2 0xD0B SWAP2 SWAP1 PUSH2 0x276A JUMP JUMPDEST POP PUSH1 0x3 DUP1 SLOAD SWAP1 POP PUSH1 0x4 SLOAD GT ISZERO PUSH2 0xD2A JUMPI PUSH2 0xD29 PUSH1 0x3 DUP1 SLOAD SWAP1 POP PUSH2 0x1DDA JUMP JUMPDEST JUMPDEST DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x8001553A916EF2F495D26A907CC54D96ED840D7BDA71E73194BF5A9DF7A76B90 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 POP POP POP JUMP JUMPDEST CALLER PUSH1 0x2 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO ISZERO PUSH2 0xDCB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLER PUSH1 0x1 PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO ISZERO PUSH2 0xE36 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP4 PUSH1 0x0 DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0xE64 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP5 PUSH2 0xE6E DUP2 PUSH2 0x1652 JUMP JUMPDEST ISZERO ISZERO ISZERO PUSH2 0xE7A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH1 0x1 PUSH1 0x0 DUP9 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP DUP6 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xF6A317157440607F36269043EB55F1287A5A19BA2216AFEAB88CD46CBCFB88E9 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x2 PUSH1 0x20 MSTORE DUP1 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP2 POP SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x20 MSTORE DUP2 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x20 MSTORE DUP1 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP2 POP SWAP2 POP SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH1 0x6 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 POP JUMPDEST PUSH1 0x5 SLOAD DUP2 LT ISZERO PUSH2 0x100F JUMPI DUP4 DUP1 ISZERO PUSH2 0xFC3 JUMPI POP PUSH1 0x0 DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO JUMPDEST DUP1 PUSH2 0xFF6 JUMPI POP DUP3 DUP1 ISZERO PUSH2 0xFF5 JUMPI POP PUSH1 0x0 DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND JUMPDEST JUMPDEST ISZERO PUSH2 0x1002 JUMPI PUSH1 0x1 DUP3 ADD SWAP2 POP JUMPDEST DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0xF8C JUMP JUMPDEST POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP1 PUSH32 0x72656D6F7665417574686F72697A656441646472657373286164647265737329 DUP2 MSTORE POP PUSH1 0x20 ADD SWAP1 POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 KECCAK256 SWAP2 POP PUSH1 0x0 SWAP1 POP JUMPDEST PUSH1 0x4 DUP2 LT ISZERO PUSH2 0x1148 JUMPI DUP2 DUP2 PUSH1 0x4 DUP2 LT ISZERO ISZERO PUSH2 0x106F JUMPI INVALID JUMPDEST BYTE PUSH32 0x100000000000000000000000000000000000000000000000000000000000000 MUL PUSH31 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF NOT AND DUP5 DUP3 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x10C2 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD ADD MLOAD PUSH32 0x100000000000000000000000000000000000000000000000000000000000000 SWAP1 DIV PUSH32 0x100000000000000000000000000000000000000000000000000000000000000 MUL PUSH31 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF NOT AND EQ ISZERO ISZERO PUSH2 0x113B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0x1058 JUMP JUMPDEST PUSH1 0x1 SWAP3 POP POP POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x0 DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0x1183 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 PUSH2 0x118D DUP2 PUSH2 0x1652 JUMP JUMPDEST ISZERO ISZERO PUSH2 0x1198 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP4 PUSH1 0x0 DUP1 PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SWAP1 POP PUSH1 0x8 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 PUSH1 0x0 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x122F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x12D4 DUP2 PUSH1 0x2 ADD DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x12CA JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x129F JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x12CA JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x12AD JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP PUSH2 0x1016 JUMP JUMPDEST ISZERO ISZERO PUSH2 0x12DF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP1 DUP8 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SWAP5 POP PUSH1 0x1 DUP6 PUSH1 0x3 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP DUP5 PUSH1 0x0 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP6 PUSH1 0x1 ADD SLOAD DUP7 PUSH1 0x2 ADD PUSH1 0x40 MLOAD DUP1 DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x13B9 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x138E JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x13B9 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x139C JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP SWAP2 POP POP PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP6 DUP8 GAS CALL SWAP3 POP POP POP ISZERO PUSH2 0x1406 JUMPI DUP6 PUSH32 0x33E13ECB54C3076D8E8BB8C2881800A4D972B792045FFAE98FDF46DF365FED75 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 PUSH2 0x1451 JUMP JUMPDEST DUP6 PUSH32 0x526441BB6C1ABA3C9A4A6CA1D6545DA9C2333C8C48343EF398EB858D72B79236 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 PUSH1 0x0 DUP6 PUSH1 0x3 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP JUMPDEST POP POP POP POP POP POP JUMP JUMPDEST ADDRESS PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x1493 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 PUSH1 0x2 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0x14EB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 PUSH1 0x0 DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0x1510 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x1 PUSH1 0x3 DUP1 SLOAD SWAP1 POP ADD PUSH1 0x4 SLOAD PUSH1 0x32 DUP3 GT DUP1 PUSH2 0x152A JUMPI POP DUP2 DUP2 GT JUMPDEST DUP1 PUSH2 0x1535 JUMPI POP PUSH1 0x0 DUP2 EQ JUMPDEST DUP1 PUSH2 0x1540 JUMPI POP PUSH1 0x0 DUP3 EQ JUMPDEST ISZERO PUSH2 0x154A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x1 PUSH1 0x2 PUSH1 0x0 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP PUSH1 0x3 DUP6 SWAP1 DUP1 PUSH1 0x1 DUP2 SLOAD ADD DUP1 DUP3 SSTORE DUP1 SWAP2 POP POP SWAP1 PUSH1 0x1 DUP3 SUB SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SWAP2 SWAP3 SWAP1 SWAP2 SWAP1 SWAP2 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP POP DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xF39E6E1EB0EDCF53C221607B54B00CD28F3196FED0A24994DC308B8F611B682D PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 SWAP2 POP PUSH1 0x0 SWAP1 POP JUMPDEST PUSH1 0x3 DUP1 SLOAD SWAP1 POP DUP2 LT ISZERO PUSH2 0x172F JUMPI PUSH1 0x1 PUSH1 0x0 DUP6 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH1 0x3 DUP4 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1690 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0x170F JUMPI PUSH1 0x1 DUP3 ADD SWAP2 POP JUMPDEST PUSH1 0x4 SLOAD DUP3 EQ ISZERO PUSH2 0x1722 JUMPI PUSH1 0x1 SWAP3 POP PUSH2 0x1730 JUMP JUMPDEST DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0x165F JUMP JUMPDEST JUMPDEST POP POP SWAP2 SWAP1 POP JUMP JUMPDEST ADDRESS PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x1771 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 PUSH1 0x6 DUP2 SWAP1 SSTORE POP PUSH32 0xD1C9101A34FEFF75CCCEF14A28785A0279CB0B49C1F321F21F5F422E746B4377 DUP2 PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 POP JUMPDEST PUSH1 0x3 DUP1 SLOAD SWAP1 POP DUP2 LT ISZERO PUSH2 0x1877 JUMPI PUSH1 0x1 PUSH1 0x0 DUP5 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH1 0x3 DUP4 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x17EB JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0x186A JUMPI PUSH1 0x1 DUP3 ADD SWAP2 POP JUMPDEST DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0x17BA JUMP JUMPDEST POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 MSTORE DUP1 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP2 POP SWAP1 POP DUP1 PUSH1 0x0 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 DUP1 PUSH1 0x1 ADD SLOAD SWAP1 DUP1 PUSH1 0x2 ADD DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x1955 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x192A JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x1955 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x1938 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP1 DUP1 PUSH1 0x3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND SWAP1 POP DUP5 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x3 DUP1 SLOAD DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD DUP1 ISZERO PUSH2 0x19F6 JUMPI PUSH1 0x20 MUL DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 PUSH1 0x1 ADD SWAP1 DUP1 DUP4 GT PUSH2 0x19AC JUMPI JUMPDEST POP POP POP POP POP SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x60 DUP1 PUSH1 0x0 DUP1 PUSH1 0x5 SLOAD PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x1A37 JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CODESIZE DUP4 CODECOPY DUP1 DUP3 ADD SWAP2 POP POP SWAP1 POP JUMPDEST POP SWAP3 POP PUSH1 0x0 SWAP2 POP PUSH1 0x0 SWAP1 POP JUMPDEST PUSH1 0x5 SLOAD DUP2 LT ISZERO PUSH2 0x1AE3 JUMPI DUP6 DUP1 ISZERO PUSH2 0x1A7A JUMPI POP PUSH1 0x0 DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO JUMPDEST DUP1 PUSH2 0x1AAD JUMPI POP DUP5 DUP1 ISZERO PUSH2 0x1AAC JUMPI POP PUSH1 0x0 DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND JUMPDEST JUMPDEST ISZERO PUSH2 0x1AD6 JUMPI DUP1 DUP4 DUP4 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1AC1 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD DUP2 DUP2 MSTORE POP POP PUSH1 0x1 DUP3 ADD SWAP2 POP JUMPDEST DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0x1A43 JUMP JUMPDEST DUP8 DUP8 SUB PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x1B14 JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CODESIZE DUP4 CODECOPY DUP1 DUP3 ADD SWAP2 POP POP SWAP1 POP JUMPDEST POP SWAP4 POP DUP8 SWAP1 POP JUMPDEST DUP7 DUP2 LT ISZERO PUSH2 0x1B66 JUMPI DUP3 DUP2 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1B31 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP5 DUP10 DUP4 SUB DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1B4B JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD DUP2 DUP2 MSTORE POP POP DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0x1B1B JUMP JUMPDEST POP POP POP SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x8 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x60 DUP1 PUSH1 0x0 DUP1 PUSH1 0x3 DUP1 SLOAD SWAP1 POP PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x1BD1 JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CODESIZE DUP4 CODECOPY DUP1 DUP3 ADD SWAP2 POP POP SWAP1 POP JUMPDEST POP SWAP3 POP PUSH1 0x0 SWAP2 POP PUSH1 0x0 SWAP1 POP JUMPDEST PUSH1 0x3 DUP1 SLOAD SWAP1 POP DUP2 LT ISZERO PUSH2 0x1D1E JUMPI PUSH1 0x1 PUSH1 0x0 DUP7 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH1 0x3 DUP4 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1C0E JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0x1D11 JUMPI PUSH1 0x3 DUP2 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1C95 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP4 DUP4 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1CCE JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE POP POP PUSH1 0x1 DUP3 ADD SWAP2 POP JUMPDEST DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0x1BDD JUMP JUMPDEST DUP2 PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x1D4D JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CODESIZE DUP4 CODECOPY DUP1 DUP3 ADD SWAP2 POP POP SWAP1 POP JUMPDEST POP SWAP4 POP PUSH1 0x0 SWAP1 POP JUMPDEST DUP2 DUP2 LT ISZERO PUSH2 0x1DCC JUMPI DUP3 DUP2 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1D6B JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP5 DUP3 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1D83 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE POP POP DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0x1D55 JUMP JUMPDEST POP POP POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x5 SLOAD DUP2 JUMP JUMPDEST ADDRESS PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x1E14 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x3 DUP1 SLOAD SWAP1 POP DUP2 PUSH1 0x32 DUP3 GT DUP1 PUSH2 0x1E29 JUMPI POP DUP2 DUP2 GT JUMPDEST DUP1 PUSH2 0x1E34 JUMPI POP PUSH1 0x0 DUP2 EQ JUMPDEST DUP1 PUSH2 0x1E3F JUMPI POP PUSH1 0x0 DUP3 EQ JUMPDEST ISZERO PUSH2 0x1E49 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 PUSH1 0x4 DUP2 SWAP1 SSTORE POP PUSH32 0xA3F1EE9126A074D9326C682F561767F710E927FAA811F7A99829D49DC421797A DUP4 PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG1 POP POP POP JUMP JUMPDEST CALLER PUSH1 0x2 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO ISZERO PUSH2 0x1EE5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 PUSH1 0x0 DUP1 PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0x1F3F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 CALLER PUSH1 0x1 PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0x1FA9 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP5 PUSH2 0x1FB3 DUP2 PUSH2 0x1652 JUMP JUMPDEST ISZERO ISZERO ISZERO PUSH2 0x1FBF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x1 DUP1 PUSH1 0x0 DUP9 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP DUP6 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x4A504A94899432A9846E1AA406DCEB1BCFD538BB839071D49D1E5E23F5BE30EF PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH2 0x2074 DUP7 PUSH2 0x1652 JUMP JUMPDEST ISZERO PUSH2 0x2084 JUMPI PUSH2 0x2083 DUP7 TIMESTAMP PUSH2 0x25C6 JUMP JUMPDEST JUMPDEST POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x2099 DUP5 DUP5 DUP5 PUSH2 0x261A JUMP JUMPDEST SWAP1 POP PUSH2 0x20A4 DUP2 PUSH2 0x1E8C JUMP JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x7 PUSH1 0x20 MSTORE DUP1 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP2 POP SWAP1 POP SLOAD DUP2 JUMP JUMPDEST PUSH1 0x32 DUP2 JUMP JUMPDEST PUSH1 0x4 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 ADDRESS PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x210A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 PUSH1 0x2 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO ISZERO PUSH2 0x2163 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 PUSH1 0x2 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0x21BB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 SWAP3 POP JUMPDEST PUSH1 0x3 DUP1 SLOAD SWAP1 POP DUP4 LT ISZERO PUSH2 0x22A4 JUMPI DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x3 DUP5 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x21F3 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0x2297 JUMPI DUP4 PUSH1 0x3 DUP5 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x224A JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH2 0x22A4 JUMP JUMPDEST DUP3 DUP1 PUSH1 0x1 ADD SWAP4 POP POP PUSH2 0x21C0 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x2 PUSH1 0x0 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP PUSH1 0x1 PUSH1 0x2 PUSH1 0x0 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x8001553A916EF2F495D26A907CC54D96ED840D7BDA71E73194BF5A9DF7A76B90 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xF39E6E1EB0EDCF53C221607B54B00CD28F3196FED0A24994DC308B8F611B682D PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x0 DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0x2411 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 PUSH2 0x241B DUP2 PUSH2 0x1652 JUMP JUMPDEST ISZERO ISZERO PUSH2 0x2426 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP4 PUSH1 0x6 SLOAD PUSH1 0x7 PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD ADD TIMESTAMP LT ISZERO ISZERO ISZERO PUSH2 0x244D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP1 DUP7 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SWAP4 POP PUSH1 0x1 DUP5 PUSH1 0x3 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP DUP4 PUSH1 0x0 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP5 PUSH1 0x1 ADD SLOAD DUP6 PUSH1 0x2 ADD PUSH1 0x40 MLOAD DUP1 DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x2527 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x24FC JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x2527 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x250A JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP SWAP2 POP POP PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP6 DUP8 GAS CALL SWAP3 POP POP POP ISZERO PUSH2 0x2574 JUMPI DUP5 PUSH32 0x33E13ECB54C3076D8E8BB8C2881800A4D972B792045FFAE98FDF46DF365FED75 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 PUSH2 0x25BF JUMP JUMPDEST DUP5 PUSH32 0x526441BB6C1ABA3C9A4A6CA1D6545DA9C2333C8C48343EF398EB858D72B79236 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 PUSH1 0x0 DUP5 PUSH1 0x3 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP JUMPDEST POP POP POP POP POP JUMP JUMPDEST DUP1 PUSH1 0x7 PUSH1 0x0 DUP5 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP DUP2 PUSH32 0xB237AFE65F1514FD7EA3F923EA4FE792BDD07000A912B6CD1602A8E7F573C8D DUP3 PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP4 PUSH1 0x0 DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0x2641 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x5 SLOAD SWAP2 POP PUSH1 0x80 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP6 DUP2 MSTORE PUSH1 0x20 ADD DUP5 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 ISZERO ISZERO DUP2 MSTORE POP PUSH1 0x0 DUP1 DUP5 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 ADD MLOAD DUP2 PUSH1 0x0 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH1 0x20 DUP3 ADD MLOAD DUP2 PUSH1 0x1 ADD SSTORE PUSH1 0x40 DUP3 ADD MLOAD DUP2 PUSH1 0x2 ADD SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH2 0x2700 SWAP3 SWAP2 SWAP1 PUSH2 0x2796 JUMP JUMPDEST POP PUSH1 0x60 DUP3 ADD MLOAD DUP2 PUSH1 0x3 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP SWAP1 POP POP PUSH1 0x1 PUSH1 0x5 PUSH1 0x0 DUP3 DUP3 SLOAD ADD SWAP3 POP POP DUP2 SWAP1 SSTORE POP DUP2 PUSH32 0xC0BA8FE4B176C1714197D43B9CC6BCF797A4A7461C5FE8D0EF6E184AE7601E51 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST DUP2 SLOAD DUP2 DUP4 SSTORE DUP2 DUP2 GT ISZERO PUSH2 0x2791 JUMPI DUP2 DUP4 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP2 DUP3 ADD SWAP2 ADD PUSH2 0x2790 SWAP2 SWAP1 PUSH2 0x2816 JUMP JUMPDEST JUMPDEST POP POP POP JUMP JUMPDEST DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 PUSH1 0x1F ADD PUSH1 0x20 SWAP1 DIV DUP2 ADD SWAP3 DUP3 PUSH1 0x1F LT PUSH2 0x27D7 JUMPI DUP1 MLOAD PUSH1 0xFF NOT AND DUP4 DUP1 ADD OR DUP6 SSTORE PUSH2 0x2805 JUMP JUMPDEST DUP3 DUP1 ADD PUSH1 0x1 ADD DUP6 SSTORE DUP3 ISZERO PUSH2 0x2805 JUMPI SWAP2 DUP3 ADD JUMPDEST DUP3 DUP2 GT ISZERO PUSH2 0x2804 JUMPI DUP3 MLOAD DUP3 SSTORE SWAP2 PUSH1 0x20 ADD SWAP2 SWAP1 PUSH1 0x1 ADD SWAP1 PUSH2 0x27E9 JUMP JUMPDEST JUMPDEST POP SWAP1 POP PUSH2 0x2812 SWAP2 SWAP1 PUSH2 0x2816 JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST PUSH2 0x2838 SWAP2 SWAP1 JUMPDEST DUP1 DUP3 GT ISZERO PUSH2 0x2834 JUMPI PUSH1 0x0 DUP2 PUSH1 0x0 SWAP1 SSTORE POP PUSH1 0x1 ADD PUSH2 0x281C JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST SWAP1 JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 JUMPDEST BALANCE PUSH17 0x311683DD42D70D319DD5251070967966A2 PUSH1 0xFD 0x2e 0x2f 0x3f 0xcf 0xdf 0xe5 SMOD 0x48 PUSH19 0x32002900000000000000000000000000000000 ",
- "sourceMap": "698:2422:2:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2519:1:0;2507:9;:13;2503:61;;;2542:10;2534:30;;;2554:9;2534:30;;;;;;;;;;;;;;;;;;2503:61;698:2422:2;936:23:0;;8:9:-1;5:2;;;30:1;27;20:12;5:2;936:23:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3711:460;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3711:460:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;3196:332:1;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3196:332:1;;;;;;;;;;;;;;;;;;;;;;;;;;890:40:0;;8:9:-1;5:2;;;30:1;27;20:12;5:2;890:40:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;820:64;;8:9:-1;5:2;;;30:1;27;20:12;5:2;820:64:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1049:29:1;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1049:29:1;;;;;;;;;;;;;;;;;;;;;;;9136:319:0;;8:9:-1;5:2;;;30:1;27;20:12;5:2;9136:319:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2758:360:2;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2758:360:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2042:502;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2042:502:2;;;;;;;;;;;;;;;;;;;;;;;;;;3311:277:0;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3311:277:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;7304:337;;8:9:-1;5:2;;;30:1;27;20:12;5:2;7304:337:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2321:186:1;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2321:186:1;;;;;;;;;;;;;;;;;;;;;;;;;;8622:252:0;;8:9:-1;5:2;;;30:1;27;20:12;5:2;8622:252:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;765:49;;8:9:-1;5:2;;;30:1;27;20:12;5:2;765:49:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;765:49:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9539:115;;8:9:-1;5:2;;;30:1;27;20:12;5:2;9539:115:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;9539:115:0;;;;;;;;;;;;;;;;;10757:676;;8:9:-1;5:2;;;30:1;27;20:12;5:2;10757:676:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;10757:676:0;;;;;;;;;;;;;;;;;800:44:2;;8:9:-1;5:2;;;30:1;27;20:12;5:2;800:44:2;;;;;;;;;;;;;;;;;;;;;;;;;;;9833:575:0;;8:9:-1;5:2;;;30:1;27;20:12;5:2;9833:575:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;9833:575:0;;;;;;;;;;;;;;;;;991:28;;8:9:-1;5:2;;;30:1;27;20:12;5:2;991:28:0;;;;;;;;;;;;;;;;;;;;;;;4990:207;;8:9:-1;5:2;;;30:1;27;20:12;5:2;4990:207:0;;;;;;;;;;;;;;;;;;;;;;;;;;2613:459:1;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2613:459:1;;;;;;;;;;;;;;;;;;;;;;;;;;5456:244:0;;8:9:-1;5:2;;;30:1;27;20:12;5:2;5456:244:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1085:47:1;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1085:47:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;217:41:0;;8:9:-1;5:2;;;30:1;27;20:12;5:2;217:41:0;;;;;;;;;;;;;;;;;;;;;;;965:20;;8:9:-1;5:2;;;30:1;27;20:12;5:2;965:20:0;;;;;;;;;;;;;;;;;;;;;;;4370:449;;8:9:-1;5:2;;;30:1;27;20:12;5:2;4370:449:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3642:472:1;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3642:472:1;;;;;;;;;;;;;;;;;;;;;;;;;;936:23:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;3711:460::-;3859:6;1208:4;1186:27;;:10;:27;;;;1182:50;;;1227:5;;;1182:50;3801:5;1420:7;:14;1428:5;1420:14;;;;;;;;;;;;;;;;;;;;;;;;;1419:15;1415:38;;;1448:5;;;1415:38;3839:5;3822:7;:14;3830:5;3822:14;;;;;;;;;;;;;;;;:22;;;;;;;;;;;;;;;;;;3866:1;3859:8;;3854:170;3887:1;3871:6;:13;;;;:17;3869:1;:19;3854:170;;;3924:5;3911:18;;:6;3918:1;3911:9;;;;;;;;;;;;;;;;;;;;;;;;;;;:18;;;3907:117;;;3961:6;3984:1;3968:6;:13;;;;:17;3961:25;;;;;;;;;;;;;;;;;;;;;;;;;;;3949:6;3956:1;3949:9;;;;;;;;;;;;;;;;;;:37;;;;;;;;;;;;;;;;;;4004:5;;3907:117;3890:3;;;;;;;3854:170;;;4050:1;4033:6;:18;;;;;;;;;;;;;;:::i;:::-;;4076:6;:13;;;;4065:8;;:24;4061:74;;;4103:32;4121:6;:13;;;;4103:17;:32::i;:::-;4061:74;4158:5;4145:19;;;;;;;;;;;;1242:1;3711:460;;:::o;3196:332:1:-;3279:10;1420:7:0;:14;1428:5;1420:14;;;;;;;;;;;;;;;;;;;;;;;;;1419:15;1415:38;;;1448:5;;;1415:38;3309:13:1;3324:10;1694:13:0;:28;1708:13;1694:28;;;;;;;;;;;:35;1723:5;1694:35;;;;;;;;;;;;;;;;;;;;;;;;;1693:36;1689:59;;;1743:5;;;1689:59;3356:13:1;1976:12:0;:27;1989:13;1976:27;;;;;;;;;;;:36;;;;;;;;;;;;1972:59;;;2026:5;;;1972:59;3397:13:1;1205:26;1217:13;1205:11;:26::i;:::-;1204:27;1196:36;;;;;;;;3469:5;3426:13;:28;3440:13;3426:28;;;;;;;;;;;:40;3455:10;3426:40;;;;;;;;;;;;;;;;:48;;;;;;;;;;;;;;;;;;3507:13;3495:10;3484:37;;;;;;;;;;;;2041:1:0;1758;1463;;3196:332:1;;:::o;890:40:0:-;;;;;;;;;;;;;;;;;;;;;;:::o;820:64::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;1049:29:1:-;;;;:::o;9136:319:0:-;9243:10;9274:6;9281:1;9274:8;;9269:179;9286:16;;9284:1;:18;9269:179;;;9328:7;:36;;;;;9340:12;:15;9353:1;9340:15;;;;;;;;;;;:24;;;;;;;;;;;;9339:25;9328:36;:92;;;;9384:8;:36;;;;;9396:12;:15;9409:1;9396:15;;;;;;;;;;;:24;;;;;;;;;;;;9384:36;9328:92;9321:127;;;9447:1;9438:10;;;;9321:127;9304:3;;;;;;;9269:179;;;9136:319;;;;;:::o;2758:360:2:-;2862:4;2882:39;2987:6;2931:40;;;;;;;;;;;;;;;;;;;2882:90;;2996:1;2987:10;;2982:109;3003:1;2999;:5;2982:109;;;3044:32;3077:1;3044:35;;;;;;;;;;;;3033:46;;;:4;3038:1;3033:7;;;;;;;;;;;;;;;;;;;;:46;;;;3025:55;;;;;;;;3006:3;;;;;;;2982:109;;;3107:4;3100:11;;2758:360;;;;;:::o;2042:502::-;2258:22;2137:13;1976:12:0;:27;1989:13;1976:27;;;;;;;;;;;:36;;;;;;;;;;;;1972:59;;;2026:5;;;1972:59;2175:13:2;1318:26:1;1330:13;1318:11;:26::i;:::-;1310:35;;;;;;;;2229:13:2;921:22;946:12;:27;959:13;946:27;;;;;;;;;;;921:52;;1009:29;;;;;;;;;;;991:47;;:2;:14;;;;;;;;;;;;:47;;;983:56;;;;;;;;1057:42;1091:2;:7;;1057:42;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:33;:42::i;:::-;1049:51;;;;;;;;2283:12;:27;2296:13;2283:27;;;;;;;;;;;2258:52;;2334:4;2320:2;:11;;;:18;;;;;;;;;;;;;;;;;;2352:2;:14;;;;;;;;;;;;:19;;2378:2;:8;;;2388:2;:7;;2352:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2348:190;;;2420:13;2410:24;;;;;;;;;;2348:190;;;2480:13;2463:31;;;;;;;;;;2522:5;2508:2;:11;;;:19;;;;;;;;;;;;;;;;;;2348:190;1355:1:1;;2041::0;2042:502:2;;;:::o;3311:277:0:-;1208:4;1186:27;;:10;:27;;;;1182:50;;;1227:5;;;1182:50;3404:5;1312:7;:14;1320:5;1312:14;;;;;;;;;;;;;;;;;;;;;;;;;1308:37;;;1340:5;;;1308:37;3427:5;2116:1;2104:8;:13;;;2100:36;;;2131:5;;;2100:36;3475:1;3459:6;:13;;;;:17;3478:8;;256:2;2236:10;:28;:66;;;;2292:10;2280:9;:22;2236:66;:96;;;;2331:1;2318:9;:14;2236:96;:127;;;;2362:1;2348:10;:15;2236:127;2229:153;;;2377:5;;;2229:153;3519:4;3502:7;:14;3510:5;3502:14;;;;;;;;;;;;;;;;:21;;;;;;;;;;;;;;;;;;3533:6;3545:5;3533:18;;39:1:-1;33:3;27:10;23:18;57:10;52:3;45:23;79:10;72:17;;0:93;3533:18:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3575:5;3561:20;;;;;;;;;;;;2146:1;;1355;1242;3311:277;:::o;7304:337::-;7394:4;7414:10;7443:6;7427:1;7414:14;;7450:1;7443:8;;7438:197;7455:6;:13;;;;7453:1;:15;7438:197;;;7493:13;:28;7507:13;7493:28;;;;;;;;;;;:39;7522:6;7529:1;7522:9;;;;;;;;;;;;;;;;;;;;;;;;;;;7493:39;;;;;;;;;;;;;;;;;;;;;;;;;7489:71;;;7559:1;7550:10;;;;7489:71;7587:8;;7578:5;:17;7574:50;;;7620:4;7613:11;;;;7574:50;7470:3;;;;;;;7438:197;;;7304:337;;;;;;:::o;2321:186:1:-;1208:4:0;1186:27;;:10;:27;;;;1182:50;;;1227:5;;;1182:50;2438:18:1;2418:17;:38;;;;2466:34;2481:18;2466:34;;;;;;;;;;;;;;;;;;2321:186;:::o;8622:252:0:-;8721:10;8752:6;8759:1;8752:8;;8747:120;8764:6;:13;;;;8762:1;:15;8747:120;;;8800:13;:28;8814:13;8800:28;;;;;;;;;;;:39;8829:6;8836:1;8829:9;;;;;;;;;;;;;;;;;;;;;;;;;;;8800:39;;;;;;;;;;;;;;;;;;;;;;;;;8796:71;;;8866:1;8857:10;;;;8796:71;8779:3;;;;;;;8747:120;;;8622:252;;;;:::o;765:49::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;9539:115::-;9609:9;9641:6;9634:13;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9539:115;:::o;10757:676::-;10882:22;10920:32;10993:10;11017:6;10966:16;;10955:28;;;;;;;;;;;;;;;;;;;;;;29:2:-1;21:6;17:15;117:4;105:10;97:6;88:34;148:4;140:6;136:17;126:27;;0:157;10955:28:0;;;;10920:63;;11006:1;10993:14;;11040:1;11038:3;;11033:250;11045:16;;11043:1;:18;11033:250;;;11087:7;:36;;;;;11099:12;:15;11112:1;11099:15;;;;;;;;;;;:24;;;;;;;;;;;;11098:25;11087:36;:92;;;;11143:8;:36;;;;;11155:12;:15;11168:1;11155:15;;;;;;;;;;;:24;;;;;;;;;;;;11143:36;11087:92;11080:203;;;11239:1;11211:18;11230:5;11211:25;;;;;;;;;;;;;;;;;:29;;;;;11267:1;11258:10;;;;11080:203;11063:3;;;;;;;11033:250;;;11326:4;11321:2;:9;11310:21;;;;;;;;;;;;;;;;;;;;;;29:2:-1;21:6;17:15;117:4;105:10;97:6;88:34;148:4;140:6;136:17;126:27;;0:157;11310:21:0;;;;11292:39;;11348:4;11346:6;;11341:85;11356:2;11354:1;:4;11341:85;;;11405:18;11424:1;11405:21;;;;;;;;;;;;;;;;;;11377:15;11397:4;11393:1;:8;11377:25;;;;;;;;;;;;;;;;;:49;;;;;11360:3;;;;;;;11341:85;;;10757:676;;;;;;;;;:::o;800:44:2:-;;;;;;;;;;;;;:::o;9833:575:0:-;9928:24;9968:34;10043:10;10067:6;10019;:13;;;;10005:28;;;;;;;;;;;;;;;;;;;;;;29:2:-1;21:6;17:15;117:4;105:10;97:6;88:34;148:4;140:6;136:17;126:27;;0:157;10005:28:0;;;;9968:65;;10056:1;10043:14;;10090:1;10088:3;;10083:186;10095:6;:13;;;;10093:1;:15;10083:186;;;10131:13;:28;10145:13;10131:28;;;;;;;;;;;:39;10160:6;10167:1;10160:9;;;;;;;;;;;;;;;;;;;;;;;;;;;10131:39;;;;;;;;;;;;;;;;;;;;;;;;;10127:142;;;10217:6;10224:1;10217:9;;;;;;;;;;;;;;;;;;;;;;;;;;;10190:17;10208:5;10190:24;;;;;;;;;;;;;;;;;:36;;;;;;;;;;;10253:1;10244:10;;;;10127:142;10110:3;;;;;;;10083:186;;;10309:5;10295:20;;;;;;;;;;;;;;;;;;;;;;29:2:-1;21:6;17:15;117:4;105:10;97:6;88:34;148:4;140:6;136:17;126:27;;0:157;10295:20:0;;;;10278:37;;10332:1;10330:3;;10325:76;10337:5;10335:1;:7;10325:76;;;10381:17;10399:1;10381:20;;;;;;;;;;;;;;;;;;10361:14;10376:1;10361:17;;;;;;;;;;;;;;;;;:40;;;;;;;;;;;10344:3;;;;;;;10325:76;;;9833:575;;;;;;:::o;991:28::-;;;;:::o;4990:207::-;1208:4;1186:27;;:10;:27;;;;1182:50;;;1227:5;;;1182:50;5092:6;:13;;;;5107:9;256:2;2236:10;:28;:66;;;;2292:10;2280:9;:22;2236:66;:96;;;;2331:1;2318:9;:14;2236:96;:127;;;;2362:1;2348:10;:15;2236:127;2229:153;;;2377:5;;;2229:153;5143:9;5132:8;:20;;;;5162:28;5180:9;5162:28;;;;;;;;;;;;;;;;;;1242:1;;4990:207;:::o;2613:459:1:-;2696:10;1420:7:0;:14;1428:5;1420:14;;;;;;;;;;;;;;;;;;;;;;;;;1419:15;1415:38;;;1448:5;;;1415:38;2734:13:1;1581:1:0;1538:12;:27;1551:13;1538:27;;;;;;;;;;;:39;;;;;;;;;;;;:44;;;1534:67;;;1596:5;;;1534:67;2770:13:1;2785:10;1843:13:0;:28;1857:13;1843:28;;;;;;;;;;;:35;1872:5;1843:35;;;;;;;;;;;;;;;;;;;;;;;;;1839:58;;;1892:5;;;1839:58;2823:13:1;1205:26;1217:13;1205:11;:26::i;:::-;1204:27;1196:36;;;;;;;;2895:4;2852:13;:28;2866:13;2852:28;;;;;;;;;;;:40;2881:10;2852:40;;;;;;;;;;;;;;;;:47;;;;;;;;;;;;;;;;;;2934:13;2922:10;2909:39;;;;;;;;;;;;2962:26;2974:13;2962:11;:26::i;:::-;2958:108;;;3004:51;3024:13;3039:15;3004:19;:51::i;:::-;2958:108;1907:1:0;1611;;1463;2613:459:1;;:::o;5456:244:0:-;5560:18;5610:40;5625:11;5638:5;5645:4;5610:14;:40::i;:::-;5594:56;;5660:33;5679:13;5660:18;:33::i;:::-;5456:244;;;;;:::o;1085:47:1:-;;;;;;;;;;;;;;;;;:::o;217:41:0:-;256:2;217:41;:::o;965:20::-;;;;:::o;4370:449::-;4541:6;1208:4;1186:27;;:10;:27;;;;1182:50;;;1227:5;;;1182:50;4479:5;1420:7;:14;1428:5;1420:14;;;;;;;;;;;;;;;;;;;;;;;;;1419:15;1415:38;;;1448:5;;;1415:38;4512:8;1312:7;:14;1320:5;1312:14;;;;;;;;;;;;;;;;;;;;;;;;;1308:37;;;1340:5;;;1308:37;4548:1;4541:8;;4536:149;4553:6;:13;;;;4551:1;:15;4536:149;;;4602:5;4589:18;;:6;4596:1;4589:9;;;;;;;;;;;;;;;;;;;;;;;;;;;:18;;;4585:100;;;4639:8;4627:6;4634:1;4627:9;;;;;;;;;;;;;;;;;;:20;;;;;;;;;;;;;;;;;;4665:5;;4585:100;4568:3;;;;;;;4536:149;;;4711:5;4694:7;:14;4702:5;4694:14;;;;;;;;;;;;;;;;:22;;;;;;;;;;;;;;;;;;4746:4;4726:7;:17;4734:8;4726:17;;;;;;;;;;;;;;;;:24;;;;;;;;;;;;;;;;;;4773:5;4760:19;;;;;;;;;;;;4803:8;4789:23;;;;;;;;;;;;1463:1;1242;4370:449;;;:::o;3642:472:1:-;3828:22;3725:13;1976:12:0;:27;1989:13;1976:27;;;;;;;;;;;:36;;;;;;;;;;;;1972:59;;;2026:5;;;1972:59;3763:13:1;1318:26;1330:13;1318:11;:26::i;:::-;1310:35;;;;;;;;3799:13;1483:17;;1448;:32;1466:13;1448:32;;;;;;;;;;;;:52;1429:15;:71;;1421:80;;;;;;;;3853:12;:27;3866:13;3853:27;;;;;;;;;;;3828:52;;3904:4;3890:2;:11;;;:18;;;;;;;;;;;;;;;;;;3922:2;:14;;;;;;;;;;;;:19;;3948:2;:8;;;3958:2;:7;;3922:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3918:190;;;3990:13;3980:24;;;;;;;;;;3918:190;;;4050:13;4033:31;;;;;;;;;;4092:5;4078:2;:11;;;:19;;;;;;;;;;;;;;;;;;3918:190;1355:1;2041::0;3642:472:1;;;:::o;4224:223::-;4362:16;4327:17;:32;4345:13;4327:32;;;;;;;;;;;:51;;;;4408:13;4388:52;4423:16;4388:52;;;;;;;;;;;;;;;;;;4224:223;;:::o;7974:451:0:-;8106:18;8076:11;2116:1;2104:8;:13;;;2100:36;;;2131:5;;;2100:36;8156:16;;8140:32;;8212:140;;;;;;;;;8251:11;8212:140;;;;;;8283:5;8212:140;;;;8308:4;8212:140;;;;8336:5;8212:140;;;;;8182:12;:27;8195:13;8182:27;;;;;;;;;;;:170;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8382:1;8362:16;;:21;;;;;;;;;;;8404:13;8393:25;;;;;;;;;;7974:451;;;;;;:::o;698:2422:2:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o"
- }
- }
- },
- "sources": {
- "current/multisig/MultiSigWallet/MultiSigWallet.sol": {
- "id": 0
- },
- "current/multisig/MultiSigWalletWithTimeLock/MultiSigWalletWithTimeLock.sol": {
- "id": 1
- },
- "previous/MultiSigWalletWithTImeLockExceptRemoveAuthorizedAddress/MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress.sol": {
- "id": 2
- }
- },
- "sourceCodes": {
- "current/multisig/MultiSigWallet/MultiSigWallet.sol": "pragma solidity ^0.4.10;\n\n/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.\n/// @author Stefan George - <stefan.george@consensys.net>\ncontract MultiSigWallet {\n\n uint constant public MAX_OWNER_COUNT = 50;\n\n event Confirmation(address indexed sender, uint indexed transactionId);\n event Revocation(address indexed sender, uint indexed transactionId);\n event Submission(uint indexed transactionId);\n event Execution(uint indexed transactionId);\n event ExecutionFailure(uint indexed transactionId);\n event Deposit(address indexed sender, uint value);\n event OwnerAddition(address indexed owner);\n event OwnerRemoval(address indexed owner);\n event RequirementChange(uint required);\n\n mapping (uint => Transaction) public transactions;\n mapping (uint => mapping (address => bool)) public confirmations;\n mapping (address => bool) public isOwner;\n address[] public owners;\n uint public required;\n uint public transactionCount;\n\n struct Transaction {\n address destination;\n uint value;\n bytes data;\n bool executed;\n }\n\n modifier onlyWallet() {\n if (msg.sender != address(this))\n throw;\n _;\n }\n\n modifier ownerDoesNotExist(address owner) {\n if (isOwner[owner])\n throw;\n _;\n }\n\n modifier ownerExists(address owner) {\n if (!isOwner[owner])\n throw;\n _;\n }\n\n modifier transactionExists(uint transactionId) {\n if (transactions[transactionId].destination == 0)\n throw;\n _;\n }\n\n modifier confirmed(uint transactionId, address owner) {\n if (!confirmations[transactionId][owner])\n throw;\n _;\n }\n\n modifier notConfirmed(uint transactionId, address owner) {\n if (confirmations[transactionId][owner])\n throw;\n _;\n }\n\n modifier notExecuted(uint transactionId) {\n if (transactions[transactionId].executed)\n throw;\n _;\n }\n\n modifier notNull(address _address) {\n if (_address == 0)\n throw;\n _;\n }\n\n modifier validRequirement(uint ownerCount, uint _required) {\n if ( ownerCount > MAX_OWNER_COUNT\n || _required > ownerCount\n || _required == 0\n || ownerCount == 0)\n throw;\n _;\n }\n\n /// @dev Fallback function allows to deposit ether.\n function()\n payable\n {\n if (msg.value > 0)\n Deposit(msg.sender, msg.value);\n }\n\n /*\n * Public functions\n */\n /// @dev Contract constructor sets initial owners and required number of confirmations.\n /// @param _owners List of initial owners.\n /// @param _required Number of required confirmations.\n function MultiSigWallet(address[] _owners, uint _required)\n public\n validRequirement(_owners.length, _required)\n {\n for (uint i=0; i<_owners.length; i++) {\n if (isOwner[_owners[i]] || _owners[i] == 0)\n throw;\n isOwner[_owners[i]] = true;\n }\n owners = _owners;\n required = _required;\n }\n\n /// @dev Allows to add a new owner. Transaction has to be sent by wallet.\n /// @param owner Address of new owner.\n function addOwner(address owner)\n public\n onlyWallet\n ownerDoesNotExist(owner)\n notNull(owner)\n validRequirement(owners.length + 1, required)\n {\n isOwner[owner] = true;\n owners.push(owner);\n OwnerAddition(owner);\n }\n\n /// @dev Allows to remove an owner. Transaction has to be sent by wallet.\n /// @param owner Address of owner.\n function removeOwner(address owner)\n public\n onlyWallet\n ownerExists(owner)\n {\n isOwner[owner] = false;\n for (uint i=0; i<owners.length - 1; i++)\n if (owners[i] == owner) {\n owners[i] = owners[owners.length - 1];\n break;\n }\n owners.length -= 1;\n if (required > owners.length)\n changeRequirement(owners.length);\n OwnerRemoval(owner);\n }\n\n /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet.\n /// @param owner Address of owner to be replaced.\n /// @param owner Address of new owner.\n function replaceOwner(address owner, address newOwner)\n public\n onlyWallet\n ownerExists(owner)\n ownerDoesNotExist(newOwner)\n {\n for (uint i=0; i<owners.length; i++)\n if (owners[i] == owner) {\n owners[i] = newOwner;\n break;\n }\n isOwner[owner] = false;\n isOwner[newOwner] = true;\n OwnerRemoval(owner);\n OwnerAddition(newOwner);\n }\n\n /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet.\n /// @param _required Number of required confirmations.\n function changeRequirement(uint _required)\n public\n onlyWallet\n validRequirement(owners.length, _required)\n {\n required = _required;\n RequirementChange(_required);\n }\n\n /// @dev Allows an owner to submit and confirm a transaction.\n /// @param destination Transaction target address.\n /// @param value Transaction ether value.\n /// @param data Transaction data payload.\n /// @return Returns transaction ID.\n function submitTransaction(address destination, uint value, bytes data)\n public\n returns (uint transactionId)\n {\n transactionId = addTransaction(destination, value, data);\n confirmTransaction(transactionId);\n }\n\n /// @dev Allows an owner to confirm a transaction.\n /// @param transactionId Transaction ID.\n function confirmTransaction(uint transactionId)\n public\n ownerExists(msg.sender)\n transactionExists(transactionId)\n notConfirmed(transactionId, msg.sender)\n {\n confirmations[transactionId][msg.sender] = true;\n Confirmation(msg.sender, transactionId);\n executeTransaction(transactionId);\n }\n\n /// @dev Allows an owner to revoke a confirmation for a transaction.\n /// @param transactionId Transaction ID.\n function revokeConfirmation(uint transactionId)\n public\n ownerExists(msg.sender)\n confirmed(transactionId, msg.sender)\n notExecuted(transactionId)\n {\n confirmations[transactionId][msg.sender] = false;\n Revocation(msg.sender, transactionId);\n }\n\n /// @dev Allows anyone to execute a confirmed transaction.\n /// @param transactionId Transaction ID.\n function executeTransaction(uint transactionId)\n public\n notExecuted(transactionId)\n {\n if (isConfirmed(transactionId)) {\n Transaction tx = transactions[transactionId];\n tx.executed = true;\n if (tx.destination.call.value(tx.value)(tx.data))\n Execution(transactionId);\n else {\n ExecutionFailure(transactionId);\n tx.executed = false;\n }\n }\n }\n\n /// @dev Returns the confirmation status of a transaction.\n /// @param transactionId Transaction ID.\n /// @return Confirmation status.\n function isConfirmed(uint transactionId)\n public\n constant\n returns (bool)\n {\n uint count = 0;\n for (uint i=0; i<owners.length; i++) {\n if (confirmations[transactionId][owners[i]])\n count += 1;\n if (count == required)\n return true;\n }\n }\n\n /*\n * Internal functions\n */\n /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet.\n /// @param destination Transaction target address.\n /// @param value Transaction ether value.\n /// @param data Transaction data payload.\n /// @return Returns transaction ID.\n function addTransaction(address destination, uint value, bytes data)\n internal\n notNull(destination)\n returns (uint transactionId)\n {\n transactionId = transactionCount;\n transactions[transactionId] = Transaction({\n destination: destination,\n value: value,\n data: data,\n executed: false\n });\n transactionCount += 1;\n Submission(transactionId);\n }\n\n /*\n * Web3 call functions\n */\n /// @dev Returns number of confirmations of a transaction.\n /// @param transactionId Transaction ID.\n /// @return Number of confirmations.\n function getConfirmationCount(uint transactionId)\n public\n constant\n returns (uint count)\n {\n for (uint i=0; i<owners.length; i++)\n if (confirmations[transactionId][owners[i]])\n count += 1;\n }\n\n /// @dev Returns total number of transactions after filers are applied.\n /// @param pending Include pending transactions.\n /// @param executed Include executed transactions.\n /// @return Total number of transactions after filters are applied.\n function getTransactionCount(bool pending, bool executed)\n public\n constant\n returns (uint count)\n {\n for (uint i=0; i<transactionCount; i++)\n if ( pending && !transactions[i].executed\n || executed && transactions[i].executed)\n count += 1;\n }\n\n /// @dev Returns list of owners.\n /// @return List of owner addresses.\n function getOwners()\n public\n constant\n returns (address[])\n {\n return owners;\n }\n\n /// @dev Returns array with owner addresses, which confirmed transaction.\n /// @param transactionId Transaction ID.\n /// @return Returns array of owner addresses.\n function getConfirmations(uint transactionId)\n public\n constant\n returns (address[] _confirmations)\n {\n address[] memory confirmationsTemp = new address[](owners.length);\n uint count = 0;\n uint i;\n for (i=0; i<owners.length; i++)\n if (confirmations[transactionId][owners[i]]) {\n confirmationsTemp[count] = owners[i];\n count += 1;\n }\n _confirmations = new address[](count);\n for (i=0; i<count; i++)\n _confirmations[i] = confirmationsTemp[i];\n }\n\n /// @dev Returns list of transaction IDs in defined range.\n /// @param from Index start position of transaction array.\n /// @param to Index end position of transaction array.\n /// @param pending Include pending transactions.\n /// @param executed Include executed transactions.\n /// @return Returns array of transaction IDs.\n function getTransactionIds(uint from, uint to, bool pending, bool executed)\n public\n constant\n returns (uint[] _transactionIds)\n {\n uint[] memory transactionIdsTemp = new uint[](transactionCount);\n uint count = 0;\n uint i;\n for (i=0; i<transactionCount; i++)\n if ( pending && !transactions[i].executed\n || executed && transactions[i].executed)\n {\n transactionIdsTemp[count] = i;\n count += 1;\n }\n _transactionIds = new uint[](to - from);\n for (i=from; i<to; i++)\n _transactionIds[i - from] = transactionIdsTemp[i];\n }\n}\n",
- "current/multisig/MultiSigWalletWithTimeLock/MultiSigWalletWithTimeLock.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.4.10;\n\nimport { MultiSigWallet } from \"../MultiSigWallet/MultiSigWallet.sol\";\n\n/// @title Multisignature wallet with time lock- Allows multiple parties to execute a transaction after a time lock has passed.\n/// @author Amir Bandeali - <amir@0xProject.com>\ncontract MultiSigWalletWithTimeLock is MultiSigWallet {\n\n event ConfirmationTimeSet(uint indexed transactionId, uint confirmationTime);\n event TimeLockChange(uint secondsTimeLocked);\n\n uint public secondsTimeLocked;\n\n mapping (uint => uint) public confirmationTimes;\n\n modifier notFullyConfirmed(uint transactionId) {\n require(!isConfirmed(transactionId));\n _;\n }\n\n modifier fullyConfirmed(uint transactionId) {\n require(isConfirmed(transactionId));\n _;\n }\n\n modifier pastTimeLock(uint transactionId) {\n require(block.timestamp >= confirmationTimes[transactionId] + secondsTimeLocked);\n _;\n }\n\n /*\n * Public functions\n */\n\n /// @dev Contract constructor sets initial owners, required number of confirmations, and time lock.\n /// @param _owners List of initial owners.\n /// @param _required Number of required confirmations.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n function MultiSigWalletWithTimeLock(address[] _owners, uint _required, uint _secondsTimeLocked)\n public\n MultiSigWallet(_owners, _required)\n {\n secondsTimeLocked = _secondsTimeLocked;\n }\n\n /// @dev Changes the duration of the time lock for transactions.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n function changeTimeLock(uint _secondsTimeLocked)\n public\n onlyWallet\n {\n secondsTimeLocked = _secondsTimeLocked;\n TimeLockChange(_secondsTimeLocked);\n }\n\n /// @dev Allows an owner to confirm a transaction.\n /// @param transactionId Transaction ID.\n function confirmTransaction(uint transactionId)\n public\n ownerExists(msg.sender)\n transactionExists(transactionId)\n notConfirmed(transactionId, msg.sender)\n notFullyConfirmed(transactionId)\n {\n confirmations[transactionId][msg.sender] = true;\n Confirmation(msg.sender, transactionId);\n if (isConfirmed(transactionId)) {\n setConfirmationTime(transactionId, block.timestamp);\n }\n }\n\n /// @dev Allows an owner to revoke a confirmation for a transaction.\n /// @param transactionId Transaction ID.\n function revokeConfirmation(uint transactionId)\n public\n ownerExists(msg.sender)\n confirmed(transactionId, msg.sender)\n notExecuted(transactionId)\n notFullyConfirmed(transactionId)\n {\n confirmations[transactionId][msg.sender] = false;\n Revocation(msg.sender, transactionId);\n }\n\n /// @dev Allows anyone to execute a confirmed transaction.\n /// @param transactionId Transaction ID.\n function executeTransaction(uint transactionId)\n public\n notExecuted(transactionId)\n fullyConfirmed(transactionId)\n pastTimeLock(transactionId)\n {\n Transaction storage tx = transactions[transactionId];\n tx.executed = true;\n if (tx.destination.call.value(tx.value)(tx.data))\n Execution(transactionId);\n else {\n ExecutionFailure(transactionId);\n tx.executed = false;\n }\n }\n\n /*\n * Internal functions\n */\n\n /// @dev Sets the time of when a submission first passed.\n function setConfirmationTime(uint transactionId, uint confirmationTime)\n internal\n {\n confirmationTimes[transactionId] = confirmationTime;\n ConfirmationTimeSet(transactionId, confirmationTime);\n }\n}\n",
- "previous/MultiSigWalletWithTImeLockExceptRemoveAuthorizedAddress/MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress.sol": "/*\n\n Copyright 2017 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.4.10;\n\nimport \"../../current/multisig/MultiSigWalletWithTimeLock/MultiSigWalletWithTimeLock.sol\";\n\ncontract MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress is MultiSigWalletWithTimeLock {\n\n address public TOKEN_TRANSFER_PROXY_CONTRACT;\n\n modifier validRemoveAuthorizedAddressTx(uint transactionId) {\n Transaction storage tx = transactions[transactionId];\n require(tx.destination == TOKEN_TRANSFER_PROXY_CONTRACT);\n require(isFunctionRemoveAuthorizedAddress(tx.data));\n _;\n }\n\n /// @dev Contract constructor sets initial owners, required number of confirmations, time lock, and tokenTransferProxy address.\n /// @param _owners List of initial owners.\n /// @param _required Number of required confirmations.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n /// @param _tokenTransferProxy Address of TokenTransferProxy contract.\n function MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress(\n address[] _owners,\n uint _required,\n uint _secondsTimeLocked,\n address _tokenTransferProxy)\n public\n MultiSigWalletWithTimeLock(_owners, _required, _secondsTimeLocked)\n {\n TOKEN_TRANSFER_PROXY_CONTRACT = _tokenTransferProxy;\n }\n\n /// @dev Allows execution of removeAuthorizedAddress without time lock.\n /// @param transactionId Transaction ID.\n function executeRemoveAuthorizedAddress(uint transactionId)\n public\n notExecuted(transactionId)\n fullyConfirmed(transactionId)\n validRemoveAuthorizedAddressTx(transactionId)\n {\n Transaction storage tx = transactions[transactionId];\n tx.executed = true;\n if (tx.destination.call.value(tx.value)(tx.data))\n Execution(transactionId);\n else {\n ExecutionFailure(transactionId);\n tx.executed = false;\n }\n }\n\n /// @dev Compares first 4 bytes of byte array to removeAuthorizedAddress function signature.\n /// @param data Transaction data.\n /// @return Successful if data is a call to removeAuthorizedAddress.\n function isFunctionRemoveAuthorizedAddress(bytes data)\n public\n constant\n returns (bool)\n {\n bytes4 removeAuthorizedAddressSignature = bytes4(sha3(\"removeAuthorizedAddress(address)\"));\n for (uint i = 0; i < 4; i++) {\n require(data[i] == removeAuthorizedAddressSignature[i]);\n }\n return true;\n }\n}"
- },
- "sourceTreeHashHex": "0x25d91d4bcf6839a2bd776dd9169a3eac2062224b73bea074046888f19a7f52a4",
- "compiler": {
- "name": "solc",
- "version": "0.4.23",
- "settings": {
- "outputSelection": {
- "*": {
- "*": [
- "abi",
- "evm.bytecode.object",
- "evm.bytecode.sourceMap",
- "evm.deployedBytecode.object",
- "evm.deployedBytecode.sourceMap"
- ]
- }
- }
- }
- },
- "networks": {
- "50": {
- "address": "0x34d402f14d58e001d8efbe6585051bf9706aa064",
- "links": {},
- "constructorArgs": "[[\"0x5409ed021d9299bf6814279a6a1411a7e866a631\",\"0x6ecbe1db9ef729cbe972c83fb886247691fb6beb\"],\"2\",\"0\",\"0x1dc4c1cefef38a777b15aa20260a54e584b16c48\"]"
- }
- }
-} \ No newline at end of file
diff --git a/packages/migrations/artifacts/1.0.0/TokenRegistry.json b/packages/migrations/artifacts/1.0.0/TokenRegistry.json
deleted file mode 100644
index aebb7c48a..000000000
--- a/packages/migrations/artifacts/1.0.0/TokenRegistry.json
+++ /dev/null
@@ -1,600 +0,0 @@
-{
- "schemaVersion": "2.0.0",
- "contractName": "TokenRegistry",
- "compilerOutput": {
- "abi": [
- {
- "constant": false,
- "inputs": [
- {
- "name": "_token",
- "type": "address"
- },
- {
- "name": "_index",
- "type": "uint256"
- }
- ],
- "name": "removeToken",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "_name",
- "type": "string"
- }
- ],
- "name": "getTokenAddressByName",
- "outputs": [
- {
- "name": "",
- "type": "address"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "_symbol",
- "type": "string"
- }
- ],
- "name": "getTokenAddressBySymbol",
- "outputs": [
- {
- "name": "",
- "type": "address"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_token",
- "type": "address"
- },
- {
- "name": "_swarmHash",
- "type": "bytes"
- }
- ],
- "name": "setTokenSwarmHash",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "_token",
- "type": "address"
- }
- ],
- "name": "getTokenMetaData",
- "outputs": [
- {
- "name": "",
- "type": "address"
- },
- {
- "name": "",
- "type": "string"
- },
- {
- "name": "",
- "type": "string"
- },
- {
- "name": "",
- "type": "uint8"
- },
- {
- "name": "",
- "type": "bytes"
- },
- {
- "name": "",
- "type": "bytes"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "owner",
- "outputs": [
- {
- "name": "",
- "type": "address"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_token",
- "type": "address"
- },
- {
- "name": "_name",
- "type": "string"
- },
- {
- "name": "_symbol",
- "type": "string"
- },
- {
- "name": "_decimals",
- "type": "uint8"
- },
- {
- "name": "_ipfsHash",
- "type": "bytes"
- },
- {
- "name": "_swarmHash",
- "type": "bytes"
- }
- ],
- "name": "addToken",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_token",
- "type": "address"
- },
- {
- "name": "_name",
- "type": "string"
- }
- ],
- "name": "setTokenName",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "",
- "type": "address"
- }
- ],
- "name": "tokens",
- "outputs": [
- {
- "name": "token",
- "type": "address"
- },
- {
- "name": "name",
- "type": "string"
- },
- {
- "name": "symbol",
- "type": "string"
- },
- {
- "name": "decimals",
- "type": "uint8"
- },
- {
- "name": "ipfsHash",
- "type": "bytes"
- },
- {
- "name": "swarmHash",
- "type": "bytes"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "name": "tokenAddresses",
- "outputs": [
- {
- "name": "",
- "type": "address"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "_name",
- "type": "string"
- }
- ],
- "name": "getTokenByName",
- "outputs": [
- {
- "name": "",
- "type": "address"
- },
- {
- "name": "",
- "type": "string"
- },
- {
- "name": "",
- "type": "string"
- },
- {
- "name": "",
- "type": "uint8"
- },
- {
- "name": "",
- "type": "bytes"
- },
- {
- "name": "",
- "type": "bytes"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "getTokenAddresses",
- "outputs": [
- {
- "name": "",
- "type": "address[]"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_token",
- "type": "address"
- },
- {
- "name": "_ipfsHash",
- "type": "bytes"
- }
- ],
- "name": "setTokenIpfsHash",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "_symbol",
- "type": "string"
- }
- ],
- "name": "getTokenBySymbol",
- "outputs": [
- {
- "name": "",
- "type": "address"
- },
- {
- "name": "",
- "type": "string"
- },
- {
- "name": "",
- "type": "string"
- },
- {
- "name": "",
- "type": "uint8"
- },
- {
- "name": "",
- "type": "bytes"
- },
- {
- "name": "",
- "type": "bytes"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_token",
- "type": "address"
- },
- {
- "name": "_symbol",
- "type": "string"
- }
- ],
- "name": "setTokenSymbol",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "newOwner",
- "type": "address"
- }
- ],
- "name": "transferOwnership",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "token",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "name",
- "type": "string"
- },
- {
- "indexed": false,
- "name": "symbol",
- "type": "string"
- },
- {
- "indexed": false,
- "name": "decimals",
- "type": "uint8"
- },
- {
- "indexed": false,
- "name": "ipfsHash",
- "type": "bytes"
- },
- {
- "indexed": false,
- "name": "swarmHash",
- "type": "bytes"
- }
- ],
- "name": "LogAddToken",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "token",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "name",
- "type": "string"
- },
- {
- "indexed": false,
- "name": "symbol",
- "type": "string"
- },
- {
- "indexed": false,
- "name": "decimals",
- "type": "uint8"
- },
- {
- "indexed": false,
- "name": "ipfsHash",
- "type": "bytes"
- },
- {
- "indexed": false,
- "name": "swarmHash",
- "type": "bytes"
- }
- ],
- "name": "LogRemoveToken",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "token",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "oldName",
- "type": "string"
- },
- {
- "indexed": false,
- "name": "newName",
- "type": "string"
- }
- ],
- "name": "LogTokenNameChange",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "token",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "oldSymbol",
- "type": "string"
- },
- {
- "indexed": false,
- "name": "newSymbol",
- "type": "string"
- }
- ],
- "name": "LogTokenSymbolChange",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "token",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "oldIpfsHash",
- "type": "bytes"
- },
- {
- "indexed": false,
- "name": "newIpfsHash",
- "type": "bytes"
- }
- ],
- "name": "LogTokenIpfsHashChange",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "token",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "oldSwarmHash",
- "type": "bytes"
- },
- {
- "indexed": false,
- "name": "newSwarmHash",
- "type": "bytes"
- }
- ],
- "name": "LogTokenSwarmHashChange",
- "type": "event"
- }
- ],
- "evm": {
- "bytecode": {
- "linkReferences": {},
- "object": "0x6080604052336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550613c80806100536000396000f3006080604052600436106100e6576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806313baf1e6146100eb5780632fbfeba9146101385780633550b6d9146101e1578063563188201461028a5780637abccac9146103135780638da5cb5b14610553578063a880319d146105aa578063c370c86d14610712578063e48603391461079b578063e5df8b84146109db578063e73fc0c314610a48578063ee8c24b814610cae578063eef05f6514610d1a578063efa74f1f14610da3578063f036417f14611009578063f2fde38b14611092575b600080fd5b3480156100f757600080fd5b50610136600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110d5565b005b34801561014457600080fd5b5061019f600480360381019080803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506117e5565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156101ed57600080fd5b50610248600480360381019080803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061187a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561029657600080fd5b50610311600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061190f565b005b34801561031f57600080fd5b50610354600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611bab565b604051808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001806020018660ff1660ff168152602001806020018060200185810385528a818151815260200191508051906020019080838360005b838110156103de5780820151818401526020810190506103c3565b50505050905090810190601f16801561040b5780820380516001836020036101000a031916815260200191505b50858103845289818151815260200191508051906020019080838360005b83811015610444578082015181840152602081019050610429565b50505050905090810190601f1680156104715780820380516001836020036101000a031916815260200191505b50858103835287818151815260200191508051906020019080838360005b838110156104aa57808201518184015260208101905061048f565b50505050905090810190601f1680156104d75780820380516001836020036101000a031916815260200191505b50858103825286818151815260200191508051906020019080838360005b838110156105105780820151818401526020810190506104f5565b50505050905090810190601f16801561053d5780820380516001836020036101000a031916815260200191505b509a505050505050505050505060405180910390f35b34801561055f57600080fd5b50610568611f45565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105b657600080fd5b50610710600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803560ff169060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050611f6a565b005b34801561071e57600080fd5b50610799600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050612761565b005b3480156107a757600080fd5b506107dc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612c06565b604051808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001806020018660ff1660ff168152602001806020018060200185810385528a818151815260200191508051906020019080838360005b8381101561086657808201518184015260208101905061084b565b50505050905090810190601f1680156108935780820380516001836020036101000a031916815260200191505b50858103845289818151815260200191508051906020019080838360005b838110156108cc5780820151818401526020810190506108b1565b50505050905090810190601f1680156108f95780820380516001836020036101000a031916815260200191505b50858103835287818151815260200191508051906020019080838360005b83811015610932578082015181840152602081019050610917565b50505050905090810190601f16801561095f5780820380516001836020036101000a031916815260200191505b50858103825286818151815260200191508051906020019080838360005b8381101561099857808201518184015260208101905061097d565b50505050905090810190601f1680156109c55780820380516001836020036101000a031916815260200191505b509a505050505050505050505060405180910390f35b3480156109e757600080fd5b50610a0660048036038101908080359060200190929190505050612ecf565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610a5457600080fd5b50610aaf600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050612f0d565b604051808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001806020018660ff1660ff168152602001806020018060200185810385528a818151815260200191508051906020019080838360005b83811015610b39578082015181840152602081019050610b1e565b50505050905090810190601f168015610b665780820380516001836020036101000a031916815260200191505b50858103845289818151815260200191508051906020019080838360005b83811015610b9f578082015181840152602081019050610b84565b50505050905090810190601f168015610bcc5780820380516001836020036101000a031916815260200191505b50858103835287818151815260200191508051906020019080838360005b83811015610c05578082015181840152602081019050610bea565b50505050905090810190601f168015610c325780820380516001836020036101000a031916815260200191505b50858103825286818151815260200191508051906020019080838360005b83811015610c6b578082015181840152602081019050610c50565b50505050905090810190601f168015610c985780820380516001836020036101000a031916815260200191505b509a505050505050505050505060405180910390f35b348015610cba57600080fd5b50610cc3612fc6565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610d06578082015181840152602081019050610ceb565b505050509050019250505060405180910390f35b348015610d2657600080fd5b50610da1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050613054565b005b348015610daf57600080fd5b50610e0a600480360381019080803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506132f0565b604051808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001806020018660ff1660ff168152602001806020018060200185810385528a818151815260200191508051906020019080838360005b83811015610e94578082015181840152602081019050610e79565b50505050905090810190601f168015610ec15780820380516001836020036101000a031916815260200191505b50858103845289818151815260200191508051906020019080838360005b83811015610efa578082015181840152602081019050610edf565b50505050905090810190601f168015610f275780820380516001836020036101000a031916815260200191505b50858103835287818151815260200191508051906020019080838360005b83811015610f60578082015181840152602081019050610f45565b50505050905090810190601f168015610f8d5780820380516001836020036101000a031916815260200191505b50858103825286818151815260200191508051906020019080838360005b83811015610fc6578082015181840152602081019050610fab565b50505050905090810190601f168015610ff35780820380516001836020036101000a031916815260200191505b509a505050505050505050505060405180910390f35b34801561101557600080fd5b50611090600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506133a9565b005b34801561109e57600080fd5b506110d3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061384e565b005b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561113257600080fd5b82600073ffffffffffffffffffffffffffffffffffffffff16600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515156111d157600080fd5b8373ffffffffffffffffffffffffffffffffffffffff166004848154811015156111f757fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561124457600080fd5b600460016004805490500381548110151561125b57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660048481548110151561129557fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060016004818180549050039150816112f59190613923565b50600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002091508160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f32c54f1e2ea75844ded7517e7dbcd3895da7cd0c28f9ab9f9cf6ecf5f83762c683600101846002018560030160009054906101000a900460ff1686600401876005016040518080602001806020018660ff1660ff168152602001806020018060200185810385528a8181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156114565780601f1061142b57610100808354040283529160200191611456565b820191906000526020600020905b81548152906001019060200180831161143957829003601f168201915b50508581038452898181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156114d95780601f106114ae576101008083540402835291602001916114d9565b820191906000526020600020905b8154815290600101906020018083116114bc57829003601f168201915b505085810383528781815460018160011615610100020316600290048152602001915080546001816001161561010002031660029004801561155c5780601f106115315761010080835404028352916020019161155c565b820191906000526020600020905b81548152906001019060200180831161153f57829003601f168201915b50508581038252868181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156115df5780601f106115b4576101008083540402835291602001916115df565b820191906000526020600020905b8154815290600101906020018083116115c257829003601f168201915b5050995050505050505050505060405180910390a260028260020160405180828054600181600116156101000203166002900480156116555780601f10611633576101008083540402835291820191611655565b820191906000526020600020905b815481529060010190602001808311611641575b5050915050908152602001604051809103902060006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905560038260010160405180828054600181600116156101000203166002900480156116ec5780601f106116ca5761010080835404028352918201916116ec565b820191906000526020600020905b8154815290600101906020018083116116d8575b5050915050908152602001604051809103902060006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055600182016000611799919061394f565b6002820160006117a9919061394f565b6003820160006101000a81549060ff02191690556004820160006117cd9190613997565b6005820160006117dd9190613997565b505050505050565b60006003826040518082805190602001908083835b60208310151561181f57805182526020820191506020810190506020830392506117fa565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60006002826040518082805190602001908083835b6020831015156118b4578051825260208201915060208101905060208303925061188f565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561196c57600080fd5b82600073ffffffffffffffffffffffffffffffffffffffff16600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151515611a0b57600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002091508373ffffffffffffffffffffffffffffffffffffffff167fc3168fdc13112e44a031057dbf6c609b33353addb4d8037d24543e22cbfe2acd8360050185604051808060200180602001838103835285818154600181600116156101000203166002900481526020019150805460018160011615610100020316600290048015611b165780601f10611aeb57610100808354040283529160200191611b16565b820191906000526020600020905b815481529060010190602001808311611af957829003601f168201915b5050838103825284818151815260200191508051906020019080838360005b83811015611b50578082015181840152602081019050611b35565b50505050905090810190601f168015611b7d5780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a282826005019080519060200190611ba49291906139df565b5050505050565b60006060806000606080611bbd613a5f565b600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060c060405190810160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600182018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611cf75780601f10611ccc57610100808354040283529160200191611cf7565b820191906000526020600020905b815481529060010190602001808311611cda57829003601f168201915b50505050508152602001600282018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611d995780601f10611d6e57610100808354040283529160200191611d99565b820191906000526020600020905b815481529060010190602001808311611d7c57829003601f168201915b505050505081526020016003820160009054906101000a900460ff1660ff1660ff168152602001600482018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611e585780601f10611e2d57610100808354040283529160200191611e58565b820191906000526020600020905b815481529060010190602001808311611e3b57829003601f168201915b50505050508152602001600582018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611efa5780601f10611ecf57610100808354040283529160200191611efa565b820191906000526020600020905b815481529060010190602001808311611edd57829003601f168201915b5050505050815250509050806000015181602001518260400151836060015184608001518560a001518494508393508191508090509650965096509650965096505091939550919395565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611fc557600080fd5b85600073ffffffffffffffffffffffffffffffffffffffff16600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561206357600080fd5b86600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156120a057600080fd5b85600073ffffffffffffffffffffffffffffffffffffffff166002826040518082805190602001908083835b6020831015156120f157805182526020820191506020810190506020830392506120cc565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561216757600080fd5b87600073ffffffffffffffffffffffffffffffffffffffff166003826040518082805190602001908083835b6020831015156121b85780518252602082019150602081019050602083039250612193565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561222e57600080fd5b60c0604051908101604052808b73ffffffffffffffffffffffffffffffffffffffff1681526020018a81526020018981526020018860ff16815260200187815260200186815250600160008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001019080519060200190612317929190613aaf565b506040820151816002019080519060200190612334929190613aaf565b5060608201518160030160006101000a81548160ff021916908360ff1602179055506080820151816004019080519060200190612372929190613b2f565b5060a082015181600501908051906020019061238f929190613b2f565b5090505060048a90806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050896002896040518082805190602001908083835b602083101515612432578051825260208201915060208101905060208303925061240d565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508960038a6040518082805190602001908083835b6020831015156124dc57805182526020820191506020810190506020830392506124b7565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508973ffffffffffffffffffffffffffffffffffffffff167fd8d928b0b50ca11d9dc273236b46f3526515b03602f71f3a6af4f45bd9fa91448a8a8a8a8a6040518080602001806020018660ff1660ff168152602001806020018060200185810385528a818151815260200191508051906020019080838360005b838110156125e25780820151818401526020810190506125c7565b50505050905090810190601f16801561260f5780820380516001836020036101000a031916815260200191505b50858103845289818151815260200191508051906020019080838360005b8381101561264857808201518184015260208101905061262d565b50505050905090810190601f1680156126755780820380516001836020036101000a031916815260200191505b50858103835287818151815260200191508051906020019080838360005b838110156126ae578082015181840152602081019050612693565b50505050905090810190601f1680156126db5780820380516001836020036101000a031916815260200191505b50858103825286818151815260200191508051906020019080838360005b838110156127145780820151818401526020810190506126f9565b50505050905090810190601f1680156127415780820380516001836020036101000a031916815260200191505b50995050505050505050505060405180910390a250505050505050505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156127be57600080fd5b82600073ffffffffffffffffffffffffffffffffffffffff16600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561285d57600080fd5b82600073ffffffffffffffffffffffffffffffffffffffff166003826040518082805190602001908083835b6020831015156128ae5780518252602082019150602081019050602083039250612889565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561292457600080fd5b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002092508473ffffffffffffffffffffffffffffffffffffffff167f4a6dbfc867b179991dec22ff19960f0a94d8d9d891fc556f547764670340e8ae8460010186604051808060200180602001838103835285818154600181600116156101000203166002900481526020019150805460018160011615610100020316600290048015612a2f5780601f10612a0457610100808354040283529160200191612a2f565b820191906000526020600020905b815481529060010190602001808311612a1257829003601f168201915b5050838103825284818151815260200191508051906020019080838360005b83811015612a69578082015181840152602081019050612a4e565b50505050905090810190601f168015612a965780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a26003836001016040518082805460018160011615610100020316600290048015612b065780601f10612ae4576101008083540402835291820191612b06565b820191906000526020600020905b815481529060010190602001808311612af2575b5050915050908152602001604051809103902060006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055846003856040518082805190602001908083835b602083101515612b755780518252602082019150602081019050602083039250612b50565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555083836001019080519060200190612bfe929190613baf565b505050505050565b60016020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806001018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612cd85780601f10612cad57610100808354040283529160200191612cd8565b820191906000526020600020905b815481529060010190602001808311612cbb57829003601f168201915b505050505090806002018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612d765780601f10612d4b57610100808354040283529160200191612d76565b820191906000526020600020905b815481529060010190602001808311612d5957829003601f168201915b5050505050908060030160009054906101000a900460ff1690806004018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612e275780601f10612dfc57610100808354040283529160200191612e27565b820191906000526020600020905b815481529060010190602001808311612e0a57829003601f168201915b505050505090806005018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612ec55780601f10612e9a57610100808354040283529160200191612ec5565b820191906000526020600020905b815481529060010190602001808311612ea857829003601f168201915b5050505050905086565b600481815481101515612ede57fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000606080600060608060006003886040518082805190602001908083835b602083101515612f515780518252602082019150602081019050602083039250612f2c565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050612fb081611bab565b9650965096509650965096505091939550919395565b6060600480548060200260200160405190810160405280929190818152602001828054801561304a57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311613000575b5050505050905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156130b157600080fd5b82600073ffffffffffffffffffffffffffffffffffffffff16600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561315057600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002091508373ffffffffffffffffffffffffffffffffffffffff167f5b19f79ac4e8cfa820815502e11615f1a449e28155dc289ec5cac1a11f908694836004018560405180806020018060200183810383528581815460018160011615610100020316600290048152602001915080546001816001161561010002031660029004801561325b5780601f106132305761010080835404028352916020019161325b565b820191906000526020600020905b81548152906001019060200180831161323e57829003601f168201915b5050838103825284818151815260200191508051906020019080838360005b8381101561329557808201518184015260208101905061327a565b50505050905090810190601f1680156132c25780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a2828260040190805190602001906132e99291906139df565b5050505050565b6000606080600060608060006002886040518082805190602001908083835b602083101515613334578051825260208201915060208101905060208303925061330f565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905061339381611bab565b9650965096509650965096505091939550919395565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561340657600080fd5b82600073ffffffffffffffffffffffffffffffffffffffff16600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515156134a557600080fd5b82600073ffffffffffffffffffffffffffffffffffffffff166002826040518082805190602001908083835b6020831015156134f657805182526020820191506020810190506020830392506134d1565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561356c57600080fd5b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002092508473ffffffffffffffffffffffffffffffffffffffff167f53d878a6530e56c9bc96548fa0a8cae4f1d1f49c86b0e934c086b992ebb6998f84600201866040518080602001806020018381038352858181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156136775780601f1061364c57610100808354040283529160200191613677565b820191906000526020600020905b81548152906001019060200180831161365a57829003601f168201915b5050838103825284818151815260200191508051906020019080838360005b838110156136b1578082015181840152602081019050613696565b50505050905090810190601f1680156136de5780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a2600283600201604051808280546001816001161561010002031660029004801561374e5780601f1061372c57610100808354040283529182019161374e565b820191906000526020600020905b81548152906001019060200180831161373a575b5050915050908152602001604051809103902060006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055846002856040518082805190602001908083835b6020831015156137bd5780518252602082019150602081019050602083039250613798565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555083836002019080519060200190613846929190613baf565b505050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156138a957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151561392057806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b81548183558181111561394a578183600052602060002091820191016139499190613c2f565b5b505050565b50805460018160011615610100020316600290046000825580601f106139755750613994565b601f0160209004906000526020600020908101906139939190613c2f565b5b50565b50805460018160011615610100020316600290046000825580601f106139bd57506139dc565b601f0160209004906000526020600020908101906139db9190613c2f565b5b50565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10613a2057805160ff1916838001178555613a4e565b82800160010185558215613a4e579182015b82811115613a4d578251825591602001919060010190613a32565b5b509050613a5b9190613c2f565b5090565b60c060405190810160405280600073ffffffffffffffffffffffffffffffffffffffff1681526020016060815260200160608152602001600060ff16815260200160608152602001606081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10613af057805160ff1916838001178555613b1e565b82800160010185558215613b1e579182015b82811115613b1d578251825591602001919060010190613b02565b5b509050613b2b9190613c2f565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10613b7057805160ff1916838001178555613b9e565b82800160010185558215613b9e579182015b82811115613b9d578251825591602001919060010190613b82565b5b509050613bab9190613c2f565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10613bf057805160ff1916838001178555613c1e565b82800160010185558215613c1e579182015b82811115613c1d578251825591602001919060010190613c02565b5b509050613c2b9190613c2f565b5090565b613c5191905b80821115613c4d576000816000905550600101613c35565b5090565b905600a165627a7a72305820d84e18f5e2a4225b867b811a1b72127ed7ad24cf5341436b1f500232eac44bc80029",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLER PUSH1 0x0 DUP1 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH2 0x3C80 DUP1 PUSH2 0x53 PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN STOP PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0xE6 JUMPI PUSH1 0x0 CALLDATALOAD PUSH29 0x100000000000000000000000000000000000000000000000000000000 SWAP1 DIV PUSH4 0xFFFFFFFF AND DUP1 PUSH4 0x13BAF1E6 EQ PUSH2 0xEB JUMPI DUP1 PUSH4 0x2FBFEBA9 EQ PUSH2 0x138 JUMPI DUP1 PUSH4 0x3550B6D9 EQ PUSH2 0x1E1 JUMPI DUP1 PUSH4 0x56318820 EQ PUSH2 0x28A JUMPI DUP1 PUSH4 0x7ABCCAC9 EQ PUSH2 0x313 JUMPI DUP1 PUSH4 0x8DA5CB5B EQ PUSH2 0x553 JUMPI DUP1 PUSH4 0xA880319D EQ PUSH2 0x5AA JUMPI DUP1 PUSH4 0xC370C86D EQ PUSH2 0x712 JUMPI DUP1 PUSH4 0xE4860339 EQ PUSH2 0x79B JUMPI DUP1 PUSH4 0xE5DF8B84 EQ PUSH2 0x9DB JUMPI DUP1 PUSH4 0xE73FC0C3 EQ PUSH2 0xA48 JUMPI DUP1 PUSH4 0xEE8C24B8 EQ PUSH2 0xCAE JUMPI DUP1 PUSH4 0xEEF05F65 EQ PUSH2 0xD1A JUMPI DUP1 PUSH4 0xEFA74F1F EQ PUSH2 0xDA3 JUMPI DUP1 PUSH4 0xF036417F EQ PUSH2 0x1009 JUMPI DUP1 PUSH4 0xF2FDE38B EQ PUSH2 0x1092 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xF7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x136 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x10D5 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x144 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19F PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 POP POP POP PUSH2 0x17E5 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1ED JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x248 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 POP POP POP PUSH2 0x187A JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x296 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x311 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 POP POP POP PUSH2 0x190F JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x31F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x354 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1BAB JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP7 PUSH1 0xFF AND PUSH1 0xFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP6 DUP2 SUB DUP6 MSTORE DUP11 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x3DE JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x3C3 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x40B JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP DUP6 DUP2 SUB DUP5 MSTORE DUP10 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x444 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x429 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x471 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP DUP6 DUP2 SUB DUP4 MSTORE DUP8 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x4AA JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x48F JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x4D7 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP DUP6 DUP2 SUB DUP3 MSTORE DUP7 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x510 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x4F5 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x53D JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP11 POP POP POP POP POP POP POP POP POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x55F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x568 PUSH2 0x1F45 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x5B6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x710 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD PUSH1 0xFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 POP POP POP PUSH2 0x1F6A JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x71E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x799 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 POP POP POP PUSH2 0x2761 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x7A7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x7DC PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x2C06 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP7 PUSH1 0xFF AND PUSH1 0xFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP6 DUP2 SUB DUP6 MSTORE DUP11 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x866 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x84B JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x893 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP DUP6 DUP2 SUB DUP5 MSTORE DUP10 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x8CC JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x8B1 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x8F9 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP DUP6 DUP2 SUB DUP4 MSTORE DUP8 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x932 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x917 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x95F JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP DUP6 DUP2 SUB DUP3 MSTORE DUP7 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x998 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x97D JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x9C5 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP11 POP POP POP POP POP POP POP POP POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x9E7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xA06 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x2ECF JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xA54 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xAAF PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 POP POP POP PUSH2 0x2F0D JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP7 PUSH1 0xFF AND PUSH1 0xFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP6 DUP2 SUB DUP6 MSTORE DUP11 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0xB39 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0xB1E JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0xB66 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP DUP6 DUP2 SUB DUP5 MSTORE DUP10 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0xB9F JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0xB84 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0xBCC JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP DUP6 DUP2 SUB DUP4 MSTORE DUP8 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0xC05 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0xBEA JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0xC32 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP DUP6 DUP2 SUB DUP3 MSTORE DUP7 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0xC6B JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0xC50 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0xC98 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP11 POP POP POP POP POP POP POP POP POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xCBA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xCC3 PUSH2 0x2FC6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE DUP4 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0xD06 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0xCEB JUMP JUMPDEST POP POP POP POP SWAP1 POP ADD SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xD26 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xDA1 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 POP POP POP PUSH2 0x3054 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xDAF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xE0A PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 POP POP POP PUSH2 0x32F0 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP7 PUSH1 0xFF AND PUSH1 0xFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP6 DUP2 SUB DUP6 MSTORE DUP11 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0xE94 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0xE79 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0xEC1 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP DUP6 DUP2 SUB DUP5 MSTORE DUP10 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0xEFA JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0xEDF JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0xF27 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP DUP6 DUP2 SUB DUP4 MSTORE DUP8 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0xF60 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0xF45 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0xF8D JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP DUP6 DUP2 SUB DUP3 MSTORE DUP7 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0xFC6 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0xFAB JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0xFF3 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP11 POP POP POP POP POP POP POP POP POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1015 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1090 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 POP POP POP PUSH2 0x33A9 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x109E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x10D3 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x384E JUMP JUMPDEST STOP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x1132 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x1 PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO ISZERO PUSH2 0x11D1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x4 DUP5 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x11F7 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x1244 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x4 PUSH1 0x1 PUSH1 0x4 DUP1 SLOAD SWAP1 POP SUB DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x125B JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x4 DUP5 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1295 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH1 0x1 PUSH1 0x4 DUP2 DUP2 DUP1 SLOAD SWAP1 POP SUB SWAP2 POP DUP2 PUSH2 0x12F5 SWAP2 SWAP1 PUSH2 0x3923 JUMP JUMPDEST POP PUSH1 0x1 PUSH1 0x0 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SWAP2 POP DUP2 PUSH1 0x0 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x32C54F1E2EA75844DED7517E7DBCD3895DA7CD0C28F9AB9F9CF6ECF5F83762C6 DUP4 PUSH1 0x1 ADD DUP5 PUSH1 0x2 ADD DUP6 PUSH1 0x3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND DUP7 PUSH1 0x4 ADD DUP8 PUSH1 0x5 ADD PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP7 PUSH1 0xFF AND PUSH1 0xFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP6 DUP2 SUB DUP6 MSTORE DUP11 DUP2 DUP2 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x1456 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x142B JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x1456 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x1439 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP DUP6 DUP2 SUB DUP5 MSTORE DUP10 DUP2 DUP2 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x14D9 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x14AE JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x14D9 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x14BC JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP DUP6 DUP2 SUB DUP4 MSTORE DUP8 DUP2 DUP2 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x155C JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x1531 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x155C JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x153F JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP DUP6 DUP2 SUB DUP3 MSTORE DUP7 DUP2 DUP2 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x15DF JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x15B4 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x15DF JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x15C2 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP SWAP10 POP POP POP POP POP POP POP POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 PUSH1 0x2 DUP3 PUSH1 0x2 ADD PUSH1 0x40 MLOAD DUP1 DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x1655 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x1633 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 DUP3 ADD SWAP2 PUSH2 0x1655 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x1641 JUMPI JUMPDEST POP POP SWAP2 POP POP SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 SSTORE PUSH1 0x3 DUP3 PUSH1 0x1 ADD PUSH1 0x40 MLOAD DUP1 DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x16EC JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x16CA JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 DUP3 ADD SWAP2 PUSH2 0x16EC JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x16D8 JUMPI JUMPDEST POP POP SWAP2 POP POP SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 SSTORE PUSH1 0x1 PUSH1 0x0 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP1 DUP3 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 SSTORE PUSH1 0x1 DUP3 ADD PUSH1 0x0 PUSH2 0x1799 SWAP2 SWAP1 PUSH2 0x394F JUMP JUMPDEST PUSH1 0x2 DUP3 ADD PUSH1 0x0 PUSH2 0x17A9 SWAP2 SWAP1 PUSH2 0x394F JUMP JUMPDEST PUSH1 0x3 DUP3 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD SWAP1 PUSH1 0xFF MUL NOT AND SWAP1 SSTORE PUSH1 0x4 DUP3 ADD PUSH1 0x0 PUSH2 0x17CD SWAP2 SWAP1 PUSH2 0x3997 JUMP JUMPDEST PUSH1 0x5 DUP3 ADD PUSH1 0x0 PUSH2 0x17DD SWAP2 SWAP1 PUSH2 0x3997 JUMP JUMPDEST POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x3 DUP3 PUSH1 0x40 MLOAD DUP1 DUP3 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT ISZERO ISZERO PUSH2 0x181F JUMPI DUP1 MLOAD DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP2 POP PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH1 0x20 DUP4 SUB SWAP3 POP PUSH2 0x17FA JUMP JUMPDEST PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB DUP1 NOT DUP3 MLOAD AND DUP2 DUP5 MLOAD AND DUP1 DUP3 OR DUP6 MSTORE POP POP POP POP POP POP SWAP1 POP ADD SWAP2 POP POP SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x2 DUP3 PUSH1 0x40 MLOAD DUP1 DUP3 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT ISZERO ISZERO PUSH2 0x18B4 JUMPI DUP1 MLOAD DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP2 POP PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH1 0x20 DUP4 SUB SWAP3 POP PUSH2 0x188F JUMP JUMPDEST PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB DUP1 NOT DUP3 MLOAD AND DUP2 DUP5 MLOAD AND DUP1 DUP3 OR DUP6 MSTORE POP POP POP POP POP POP SWAP1 POP ADD SWAP2 POP POP SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x196C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x1 PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO ISZERO PUSH2 0x1A0B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x1 PUSH1 0x0 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SWAP2 POP DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xC3168FDC13112E44A031057DBF6C609B33353ADDB4D8037D24543E22CBFE2ACD DUP4 PUSH1 0x5 ADD DUP6 PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP4 DUP2 SUB DUP4 MSTORE DUP6 DUP2 DUP2 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x1B16 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x1AEB JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x1B16 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x1AF9 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP DUP4 DUP2 SUB DUP3 MSTORE DUP5 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x1B50 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x1B35 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x1B7D JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP5 POP POP POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 DUP3 DUP3 PUSH1 0x5 ADD SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH2 0x1BA4 SWAP3 SWAP2 SWAP1 PUSH2 0x39DF JUMP JUMPDEST POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x60 DUP1 PUSH1 0x0 PUSH1 0x60 DUP1 PUSH2 0x1BBD PUSH2 0x3A5F JUMP JUMPDEST PUSH1 0x1 PUSH1 0x0 DUP10 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0xC0 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE SWAP1 DUP2 PUSH1 0x0 DUP3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x1 DUP3 ADD DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x1CF7 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x1CCC JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x1CF7 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x1CDA JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x2 DUP3 ADD DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x1D99 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x1D6E JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x1D99 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x1D7C JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x3 DUP3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND PUSH1 0xFF AND PUSH1 0xFF AND DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x4 DUP3 ADD DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x1E58 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x1E2D JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x1E58 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x1E3B JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x5 DUP3 ADD DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x1EFA JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x1ECF JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x1EFA JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x1EDD JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP DUP2 MSTORE POP POP SWAP1 POP DUP1 PUSH1 0x0 ADD MLOAD DUP2 PUSH1 0x20 ADD MLOAD DUP3 PUSH1 0x40 ADD MLOAD DUP4 PUSH1 0x60 ADD MLOAD DUP5 PUSH1 0x80 ADD MLOAD DUP6 PUSH1 0xA0 ADD MLOAD DUP5 SWAP5 POP DUP4 SWAP4 POP DUP2 SWAP2 POP DUP1 SWAP1 POP SWAP7 POP SWAP7 POP SWAP7 POP SWAP7 POP SWAP7 POP SWAP7 POP POP SWAP2 SWAP4 SWAP6 POP SWAP2 SWAP4 SWAP6 JUMP JUMPDEST PUSH1 0x0 DUP1 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x1FC5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP6 PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x1 PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x2063 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP7 PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO ISZERO PUSH2 0x20A0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP6 PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x2 DUP3 PUSH1 0x40 MLOAD DUP1 DUP3 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT ISZERO ISZERO PUSH2 0x20F1 JUMPI DUP1 MLOAD DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP2 POP PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH1 0x20 DUP4 SUB SWAP3 POP PUSH2 0x20CC JUMP JUMPDEST PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB DUP1 NOT DUP3 MLOAD AND DUP2 DUP5 MLOAD AND DUP1 DUP3 OR DUP6 MSTORE POP POP POP POP POP POP SWAP1 POP ADD SWAP2 POP POP SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x2167 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP8 PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x3 DUP3 PUSH1 0x40 MLOAD DUP1 DUP3 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT ISZERO ISZERO PUSH2 0x21B8 JUMPI DUP1 MLOAD DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP2 POP PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH1 0x20 DUP4 SUB SWAP3 POP PUSH2 0x2193 JUMP JUMPDEST PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB DUP1 NOT DUP3 MLOAD AND DUP2 DUP5 MLOAD AND DUP1 DUP3 OR DUP6 MSTORE POP POP POP POP POP POP SWAP1 POP ADD SWAP2 POP POP SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x222E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0xC0 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 DUP12 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP11 DUP2 MSTORE PUSH1 0x20 ADD DUP10 DUP2 MSTORE PUSH1 0x20 ADD DUP9 PUSH1 0xFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP8 DUP2 MSTORE PUSH1 0x20 ADD DUP7 DUP2 MSTORE POP PUSH1 0x1 PUSH1 0x0 DUP13 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 ADD MLOAD DUP2 PUSH1 0x0 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH1 0x20 DUP3 ADD MLOAD DUP2 PUSH1 0x1 ADD SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH2 0x2317 SWAP3 SWAP2 SWAP1 PUSH2 0x3AAF JUMP JUMPDEST POP PUSH1 0x40 DUP3 ADD MLOAD DUP2 PUSH1 0x2 ADD SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH2 0x2334 SWAP3 SWAP2 SWAP1 PUSH2 0x3AAF JUMP JUMPDEST POP PUSH1 0x60 DUP3 ADD MLOAD DUP2 PUSH1 0x3 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 PUSH1 0xFF AND MUL OR SWAP1 SSTORE POP PUSH1 0x80 DUP3 ADD MLOAD DUP2 PUSH1 0x4 ADD SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH2 0x2372 SWAP3 SWAP2 SWAP1 PUSH2 0x3B2F JUMP JUMPDEST POP PUSH1 0xA0 DUP3 ADD MLOAD DUP2 PUSH1 0x5 ADD SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH2 0x238F SWAP3 SWAP2 SWAP1 PUSH2 0x3B2F JUMP JUMPDEST POP SWAP1 POP POP PUSH1 0x4 DUP11 SWAP1 DUP1 PUSH1 0x1 DUP2 SLOAD ADD DUP1 DUP3 SSTORE DUP1 SWAP2 POP POP SWAP1 PUSH1 0x1 DUP3 SUB SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SWAP2 SWAP3 SWAP1 SWAP2 SWAP1 SWAP2 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP POP DUP10 PUSH1 0x2 DUP10 PUSH1 0x40 MLOAD DUP1 DUP3 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT ISZERO ISZERO PUSH2 0x2432 JUMPI DUP1 MLOAD DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP2 POP PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH1 0x20 DUP4 SUB SWAP3 POP PUSH2 0x240D JUMP JUMPDEST PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB DUP1 NOT DUP3 MLOAD AND DUP2 DUP5 MLOAD AND DUP1 DUP3 OR DUP6 MSTORE POP POP POP POP POP POP SWAP1 POP ADD SWAP2 POP POP SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP DUP10 PUSH1 0x3 DUP11 PUSH1 0x40 MLOAD DUP1 DUP3 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT ISZERO ISZERO PUSH2 0x24DC JUMPI DUP1 MLOAD DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP2 POP PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH1 0x20 DUP4 SUB SWAP3 POP PUSH2 0x24B7 JUMP JUMPDEST PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB DUP1 NOT DUP3 MLOAD AND DUP2 DUP5 MLOAD AND DUP1 DUP3 OR DUP6 MSTORE POP POP POP POP POP POP SWAP1 POP ADD SWAP2 POP POP SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP DUP10 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xD8D928B0B50CA11D9DC273236B46F3526515B03602F71F3A6AF4F45BD9FA9144 DUP11 DUP11 DUP11 DUP11 DUP11 PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP7 PUSH1 0xFF AND PUSH1 0xFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP6 DUP2 SUB DUP6 MSTORE DUP11 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x25E2 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x25C7 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x260F JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP DUP6 DUP2 SUB DUP5 MSTORE DUP10 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x2648 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x262D JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x2675 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP DUP6 DUP2 SUB DUP4 MSTORE DUP8 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x26AE JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x2693 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x26DB JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP DUP6 DUP2 SUB DUP3 MSTORE DUP7 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x2714 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x26F9 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x2741 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP10 POP POP POP POP POP POP POP POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 POP POP POP POP POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x27BE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x1 PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO ISZERO PUSH2 0x285D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x3 DUP3 PUSH1 0x40 MLOAD DUP1 DUP3 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT ISZERO ISZERO PUSH2 0x28AE JUMPI DUP1 MLOAD DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP2 POP PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH1 0x20 DUP4 SUB SWAP3 POP PUSH2 0x2889 JUMP JUMPDEST PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB DUP1 NOT DUP3 MLOAD AND DUP2 DUP5 MLOAD AND DUP1 DUP3 OR DUP6 MSTORE POP POP POP POP POP POP SWAP1 POP ADD SWAP2 POP POP SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x2924 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x1 PUSH1 0x0 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SWAP3 POP DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x4A6DBFC867B179991DEC22FF19960F0A94D8D9D891FC556F547764670340E8AE DUP5 PUSH1 0x1 ADD DUP7 PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP4 DUP2 SUB DUP4 MSTORE DUP6 DUP2 DUP2 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x2A2F JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x2A04 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x2A2F JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x2A12 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP DUP4 DUP2 SUB DUP3 MSTORE DUP5 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x2A69 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x2A4E JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x2A96 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP5 POP POP POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 PUSH1 0x3 DUP4 PUSH1 0x1 ADD PUSH1 0x40 MLOAD DUP1 DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x2B06 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x2AE4 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 DUP3 ADD SWAP2 PUSH2 0x2B06 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x2AF2 JUMPI JUMPDEST POP POP SWAP2 POP POP SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 SSTORE DUP5 PUSH1 0x3 DUP6 PUSH1 0x40 MLOAD DUP1 DUP3 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT ISZERO ISZERO PUSH2 0x2B75 JUMPI DUP1 MLOAD DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP2 POP PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH1 0x20 DUP4 SUB SWAP3 POP PUSH2 0x2B50 JUMP JUMPDEST PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB DUP1 NOT DUP3 MLOAD AND DUP2 DUP5 MLOAD AND DUP1 DUP3 OR DUP6 MSTORE POP POP POP POP POP POP SWAP1 POP ADD SWAP2 POP POP SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP DUP4 DUP4 PUSH1 0x1 ADD SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH2 0x2BFE SWAP3 SWAP2 SWAP1 PUSH2 0x3BAF JUMP JUMPDEST POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x1 PUSH1 0x20 MSTORE DUP1 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP2 POP SWAP1 POP DUP1 PUSH1 0x0 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 DUP1 PUSH1 0x1 ADD DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x2CD8 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x2CAD JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x2CD8 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x2CBB JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP1 DUP1 PUSH1 0x2 ADD DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x2D76 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x2D4B JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x2D76 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x2D59 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP1 DUP1 PUSH1 0x3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND SWAP1 DUP1 PUSH1 0x4 ADD DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x2E27 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x2DFC JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x2E27 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x2E0A JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP1 DUP1 PUSH1 0x5 ADD DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x2EC5 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x2E9A JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x2EC5 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x2EA8 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP1 POP DUP7 JUMP JUMPDEST PUSH1 0x4 DUP2 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x2EDE JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP2 POP SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x60 DUP1 PUSH1 0x0 PUSH1 0x60 DUP1 PUSH1 0x0 PUSH1 0x3 DUP9 PUSH1 0x40 MLOAD DUP1 DUP3 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT ISZERO ISZERO PUSH2 0x2F51 JUMPI DUP1 MLOAD DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP2 POP PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH1 0x20 DUP4 SUB SWAP3 POP PUSH2 0x2F2C JUMP JUMPDEST PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB DUP1 NOT DUP3 MLOAD AND DUP2 DUP5 MLOAD AND DUP1 DUP3 OR DUP6 MSTORE POP POP POP POP POP POP SWAP1 POP ADD SWAP2 POP POP SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 POP PUSH2 0x2FB0 DUP2 PUSH2 0x1BAB JUMP JUMPDEST SWAP7 POP SWAP7 POP SWAP7 POP SWAP7 POP SWAP7 POP SWAP7 POP POP SWAP2 SWAP4 SWAP6 POP SWAP2 SWAP4 SWAP6 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x4 DUP1 SLOAD DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD DUP1 ISZERO PUSH2 0x304A JUMPI PUSH1 0x20 MUL DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 PUSH1 0x1 ADD SWAP1 DUP1 DUP4 GT PUSH2 0x3000 JUMPI JUMPDEST POP POP POP POP POP SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x30B1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x1 PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO ISZERO PUSH2 0x3150 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x1 PUSH1 0x0 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SWAP2 POP DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x5B19F79AC4E8CFA820815502E11615F1A449E28155DC289EC5CAC1A11F908694 DUP4 PUSH1 0x4 ADD DUP6 PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP4 DUP2 SUB DUP4 MSTORE DUP6 DUP2 DUP2 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x325B JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x3230 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x325B JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x323E JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP DUP4 DUP2 SUB DUP3 MSTORE DUP5 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x3295 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x327A JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x32C2 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP5 POP POP POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 DUP3 DUP3 PUSH1 0x4 ADD SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH2 0x32E9 SWAP3 SWAP2 SWAP1 PUSH2 0x39DF JUMP JUMPDEST POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x60 DUP1 PUSH1 0x0 PUSH1 0x60 DUP1 PUSH1 0x0 PUSH1 0x2 DUP9 PUSH1 0x40 MLOAD DUP1 DUP3 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT ISZERO ISZERO PUSH2 0x3334 JUMPI DUP1 MLOAD DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP2 POP PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH1 0x20 DUP4 SUB SWAP3 POP PUSH2 0x330F JUMP JUMPDEST PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB DUP1 NOT DUP3 MLOAD AND DUP2 DUP5 MLOAD AND DUP1 DUP3 OR DUP6 MSTORE POP POP POP POP POP POP SWAP1 POP ADD SWAP2 POP POP SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 POP PUSH2 0x3393 DUP2 PUSH2 0x1BAB JUMP JUMPDEST SWAP7 POP SWAP7 POP SWAP7 POP SWAP7 POP SWAP7 POP SWAP7 POP POP SWAP2 SWAP4 SWAP6 POP SWAP2 SWAP4 SWAP6 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x3406 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x1 PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO ISZERO PUSH2 0x34A5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x2 DUP3 PUSH1 0x40 MLOAD DUP1 DUP3 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT ISZERO ISZERO PUSH2 0x34F6 JUMPI DUP1 MLOAD DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP2 POP PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH1 0x20 DUP4 SUB SWAP3 POP PUSH2 0x34D1 JUMP JUMPDEST PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB DUP1 NOT DUP3 MLOAD AND DUP2 DUP5 MLOAD AND DUP1 DUP3 OR DUP6 MSTORE POP POP POP POP POP POP SWAP1 POP ADD SWAP2 POP POP SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x356C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x1 PUSH1 0x0 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SWAP3 POP DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x53D878A6530E56C9BC96548FA0A8CAE4F1D1F49C86B0E934C086B992EBB6998F DUP5 PUSH1 0x2 ADD DUP7 PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP4 DUP2 SUB DUP4 MSTORE DUP6 DUP2 DUP2 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x3677 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x364C JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x3677 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x365A JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP DUP4 DUP2 SUB DUP3 MSTORE DUP5 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x36B1 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x3696 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x36DE JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP5 POP POP POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 PUSH1 0x2 DUP4 PUSH1 0x2 ADD PUSH1 0x40 MLOAD DUP1 DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x374E JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x372C JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 DUP3 ADD SWAP2 PUSH2 0x374E JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x373A JUMPI JUMPDEST POP POP SWAP2 POP POP SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 SSTORE DUP5 PUSH1 0x2 DUP6 PUSH1 0x40 MLOAD DUP1 DUP3 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT ISZERO ISZERO PUSH2 0x37BD JUMPI DUP1 MLOAD DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP2 POP PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH1 0x20 DUP4 SUB SWAP3 POP PUSH2 0x3798 JUMP JUMPDEST PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB DUP1 NOT DUP3 MLOAD AND DUP2 DUP5 MLOAD AND DUP1 DUP3 OR DUP6 MSTORE POP POP POP POP POP POP SWAP1 POP ADD SWAP2 POP POP SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP DUP4 DUP4 PUSH1 0x2 ADD SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH2 0x3846 SWAP3 SWAP2 SWAP1 PUSH2 0x3BAF JUMP JUMPDEST POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x38A9 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x3920 JUMPI DUP1 PUSH1 0x0 DUP1 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP JUMPDEST POP JUMP JUMPDEST DUP2 SLOAD DUP2 DUP4 SSTORE DUP2 DUP2 GT ISZERO PUSH2 0x394A JUMPI DUP2 DUP4 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP2 DUP3 ADD SWAP2 ADD PUSH2 0x3949 SWAP2 SWAP1 PUSH2 0x3C2F JUMP JUMPDEST JUMPDEST POP POP POP JUMP JUMPDEST POP DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV PUSH1 0x0 DUP3 SSTORE DUP1 PUSH1 0x1F LT PUSH2 0x3975 JUMPI POP PUSH2 0x3994 JUMP JUMPDEST PUSH1 0x1F ADD PUSH1 0x20 SWAP1 DIV SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 DUP2 ADD SWAP1 PUSH2 0x3993 SWAP2 SWAP1 PUSH2 0x3C2F JUMP JUMPDEST JUMPDEST POP JUMP JUMPDEST POP DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV PUSH1 0x0 DUP3 SSTORE DUP1 PUSH1 0x1F LT PUSH2 0x39BD JUMPI POP PUSH2 0x39DC JUMP JUMPDEST PUSH1 0x1F ADD PUSH1 0x20 SWAP1 DIV SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 DUP2 ADD SWAP1 PUSH2 0x39DB SWAP2 SWAP1 PUSH2 0x3C2F JUMP JUMPDEST JUMPDEST POP JUMP JUMPDEST DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 PUSH1 0x1F ADD PUSH1 0x20 SWAP1 DIV DUP2 ADD SWAP3 DUP3 PUSH1 0x1F LT PUSH2 0x3A20 JUMPI DUP1 MLOAD PUSH1 0xFF NOT AND DUP4 DUP1 ADD OR DUP6 SSTORE PUSH2 0x3A4E JUMP JUMPDEST DUP3 DUP1 ADD PUSH1 0x1 ADD DUP6 SSTORE DUP3 ISZERO PUSH2 0x3A4E JUMPI SWAP2 DUP3 ADD JUMPDEST DUP3 DUP2 GT ISZERO PUSH2 0x3A4D JUMPI DUP3 MLOAD DUP3 SSTORE SWAP2 PUSH1 0x20 ADD SWAP2 SWAP1 PUSH1 0x1 ADD SWAP1 PUSH2 0x3A32 JUMP JUMPDEST JUMPDEST POP SWAP1 POP PUSH2 0x3A5B SWAP2 SWAP1 PUSH2 0x3C2F JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST PUSH1 0xC0 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x60 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x60 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 PUSH1 0xFF AND DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x60 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x60 DUP2 MSTORE POP SWAP1 JUMP JUMPDEST DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 PUSH1 0x1F ADD PUSH1 0x20 SWAP1 DIV DUP2 ADD SWAP3 DUP3 PUSH1 0x1F LT PUSH2 0x3AF0 JUMPI DUP1 MLOAD PUSH1 0xFF NOT AND DUP4 DUP1 ADD OR DUP6 SSTORE PUSH2 0x3B1E JUMP JUMPDEST DUP3 DUP1 ADD PUSH1 0x1 ADD DUP6 SSTORE DUP3 ISZERO PUSH2 0x3B1E JUMPI SWAP2 DUP3 ADD JUMPDEST DUP3 DUP2 GT ISZERO PUSH2 0x3B1D JUMPI DUP3 MLOAD DUP3 SSTORE SWAP2 PUSH1 0x20 ADD SWAP2 SWAP1 PUSH1 0x1 ADD SWAP1 PUSH2 0x3B02 JUMP JUMPDEST JUMPDEST POP SWAP1 POP PUSH2 0x3B2B SWAP2 SWAP1 PUSH2 0x3C2F JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 PUSH1 0x1F ADD PUSH1 0x20 SWAP1 DIV DUP2 ADD SWAP3 DUP3 PUSH1 0x1F LT PUSH2 0x3B70 JUMPI DUP1 MLOAD PUSH1 0xFF NOT AND DUP4 DUP1 ADD OR DUP6 SSTORE PUSH2 0x3B9E JUMP JUMPDEST DUP3 DUP1 ADD PUSH1 0x1 ADD DUP6 SSTORE DUP3 ISZERO PUSH2 0x3B9E JUMPI SWAP2 DUP3 ADD JUMPDEST DUP3 DUP2 GT ISZERO PUSH2 0x3B9D JUMPI DUP3 MLOAD DUP3 SSTORE SWAP2 PUSH1 0x20 ADD SWAP2 SWAP1 PUSH1 0x1 ADD SWAP1 PUSH2 0x3B82 JUMP JUMPDEST JUMPDEST POP SWAP1 POP PUSH2 0x3BAB SWAP2 SWAP1 PUSH2 0x3C2F JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 PUSH1 0x1F ADD PUSH1 0x20 SWAP1 DIV DUP2 ADD SWAP3 DUP3 PUSH1 0x1F LT PUSH2 0x3BF0 JUMPI DUP1 MLOAD PUSH1 0xFF NOT AND DUP4 DUP1 ADD OR DUP6 SSTORE PUSH2 0x3C1E JUMP JUMPDEST DUP3 DUP1 ADD PUSH1 0x1 ADD DUP6 SSTORE DUP3 ISZERO PUSH2 0x3C1E JUMPI SWAP2 DUP3 ADD JUMPDEST DUP3 DUP2 GT ISZERO PUSH2 0x3C1D JUMPI DUP3 MLOAD DUP3 SSTORE SWAP2 PUSH1 0x20 ADD SWAP2 SWAP1 PUSH1 0x1 ADD SWAP1 PUSH2 0x3C02 JUMP JUMPDEST JUMPDEST POP SWAP1 POP PUSH2 0x3C2B SWAP2 SWAP1 PUSH2 0x3C2F JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST PUSH2 0x3C51 SWAP2 SWAP1 JUMPDEST DUP1 DUP3 GT ISZERO PUSH2 0x3C4D JUMPI PUSH1 0x0 DUP2 PUSH1 0x0 SWAP1 SSTORE POP PUSH1 0x1 ADD PUSH2 0x3C35 JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST SWAP1 JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 0xd8 0x4e XOR 0xf5 0xe2 LOG4 0x22 JUMPDEST DUP7 PUSH28 0x811A1B72127ED7AD24CF5341436B1F500232EAC44BC8002900000000 ",
- "sourceMap": "886:8364:1:-;;;290:10:0;282:5;;:18;;;;;;;;;;;;;;;;;;886:8364:1;;;;;;"
- },
- "deployedBytecode": {
- "linkReferences": {},
- "object": "0x6080604052600436106100e6576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806313baf1e6146100eb5780632fbfeba9146101385780633550b6d9146101e1578063563188201461028a5780637abccac9146103135780638da5cb5b14610553578063a880319d146105aa578063c370c86d14610712578063e48603391461079b578063e5df8b84146109db578063e73fc0c314610a48578063ee8c24b814610cae578063eef05f6514610d1a578063efa74f1f14610da3578063f036417f14611009578063f2fde38b14611092575b600080fd5b3480156100f757600080fd5b50610136600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110d5565b005b34801561014457600080fd5b5061019f600480360381019080803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506117e5565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156101ed57600080fd5b50610248600480360381019080803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061187a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561029657600080fd5b50610311600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061190f565b005b34801561031f57600080fd5b50610354600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611bab565b604051808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001806020018660ff1660ff168152602001806020018060200185810385528a818151815260200191508051906020019080838360005b838110156103de5780820151818401526020810190506103c3565b50505050905090810190601f16801561040b5780820380516001836020036101000a031916815260200191505b50858103845289818151815260200191508051906020019080838360005b83811015610444578082015181840152602081019050610429565b50505050905090810190601f1680156104715780820380516001836020036101000a031916815260200191505b50858103835287818151815260200191508051906020019080838360005b838110156104aa57808201518184015260208101905061048f565b50505050905090810190601f1680156104d75780820380516001836020036101000a031916815260200191505b50858103825286818151815260200191508051906020019080838360005b838110156105105780820151818401526020810190506104f5565b50505050905090810190601f16801561053d5780820380516001836020036101000a031916815260200191505b509a505050505050505050505060405180910390f35b34801561055f57600080fd5b50610568611f45565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105b657600080fd5b50610710600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803560ff169060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050611f6a565b005b34801561071e57600080fd5b50610799600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050612761565b005b3480156107a757600080fd5b506107dc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612c06565b604051808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001806020018660ff1660ff168152602001806020018060200185810385528a818151815260200191508051906020019080838360005b8381101561086657808201518184015260208101905061084b565b50505050905090810190601f1680156108935780820380516001836020036101000a031916815260200191505b50858103845289818151815260200191508051906020019080838360005b838110156108cc5780820151818401526020810190506108b1565b50505050905090810190601f1680156108f95780820380516001836020036101000a031916815260200191505b50858103835287818151815260200191508051906020019080838360005b83811015610932578082015181840152602081019050610917565b50505050905090810190601f16801561095f5780820380516001836020036101000a031916815260200191505b50858103825286818151815260200191508051906020019080838360005b8381101561099857808201518184015260208101905061097d565b50505050905090810190601f1680156109c55780820380516001836020036101000a031916815260200191505b509a505050505050505050505060405180910390f35b3480156109e757600080fd5b50610a0660048036038101908080359060200190929190505050612ecf565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610a5457600080fd5b50610aaf600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050612f0d565b604051808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001806020018660ff1660ff168152602001806020018060200185810385528a818151815260200191508051906020019080838360005b83811015610b39578082015181840152602081019050610b1e565b50505050905090810190601f168015610b665780820380516001836020036101000a031916815260200191505b50858103845289818151815260200191508051906020019080838360005b83811015610b9f578082015181840152602081019050610b84565b50505050905090810190601f168015610bcc5780820380516001836020036101000a031916815260200191505b50858103835287818151815260200191508051906020019080838360005b83811015610c05578082015181840152602081019050610bea565b50505050905090810190601f168015610c325780820380516001836020036101000a031916815260200191505b50858103825286818151815260200191508051906020019080838360005b83811015610c6b578082015181840152602081019050610c50565b50505050905090810190601f168015610c985780820380516001836020036101000a031916815260200191505b509a505050505050505050505060405180910390f35b348015610cba57600080fd5b50610cc3612fc6565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610d06578082015181840152602081019050610ceb565b505050509050019250505060405180910390f35b348015610d2657600080fd5b50610da1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050613054565b005b348015610daf57600080fd5b50610e0a600480360381019080803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506132f0565b604051808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001806020018660ff1660ff168152602001806020018060200185810385528a818151815260200191508051906020019080838360005b83811015610e94578082015181840152602081019050610e79565b50505050905090810190601f168015610ec15780820380516001836020036101000a031916815260200191505b50858103845289818151815260200191508051906020019080838360005b83811015610efa578082015181840152602081019050610edf565b50505050905090810190601f168015610f275780820380516001836020036101000a031916815260200191505b50858103835287818151815260200191508051906020019080838360005b83811015610f60578082015181840152602081019050610f45565b50505050905090810190601f168015610f8d5780820380516001836020036101000a031916815260200191505b50858103825286818151815260200191508051906020019080838360005b83811015610fc6578082015181840152602081019050610fab565b50505050905090810190601f168015610ff35780820380516001836020036101000a031916815260200191505b509a505050505050505050505060405180910390f35b34801561101557600080fd5b50611090600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506133a9565b005b34801561109e57600080fd5b506110d3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061384e565b005b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561113257600080fd5b82600073ffffffffffffffffffffffffffffffffffffffff16600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515156111d157600080fd5b8373ffffffffffffffffffffffffffffffffffffffff166004848154811015156111f757fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561124457600080fd5b600460016004805490500381548110151561125b57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660048481548110151561129557fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060016004818180549050039150816112f59190613923565b50600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002091508160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f32c54f1e2ea75844ded7517e7dbcd3895da7cd0c28f9ab9f9cf6ecf5f83762c683600101846002018560030160009054906101000a900460ff1686600401876005016040518080602001806020018660ff1660ff168152602001806020018060200185810385528a8181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156114565780601f1061142b57610100808354040283529160200191611456565b820191906000526020600020905b81548152906001019060200180831161143957829003601f168201915b50508581038452898181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156114d95780601f106114ae576101008083540402835291602001916114d9565b820191906000526020600020905b8154815290600101906020018083116114bc57829003601f168201915b505085810383528781815460018160011615610100020316600290048152602001915080546001816001161561010002031660029004801561155c5780601f106115315761010080835404028352916020019161155c565b820191906000526020600020905b81548152906001019060200180831161153f57829003601f168201915b50508581038252868181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156115df5780601f106115b4576101008083540402835291602001916115df565b820191906000526020600020905b8154815290600101906020018083116115c257829003601f168201915b5050995050505050505050505060405180910390a260028260020160405180828054600181600116156101000203166002900480156116555780601f10611633576101008083540402835291820191611655565b820191906000526020600020905b815481529060010190602001808311611641575b5050915050908152602001604051809103902060006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905560038260010160405180828054600181600116156101000203166002900480156116ec5780601f106116ca5761010080835404028352918201916116ec565b820191906000526020600020905b8154815290600101906020018083116116d8575b5050915050908152602001604051809103902060006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055600182016000611799919061394f565b6002820160006117a9919061394f565b6003820160006101000a81549060ff02191690556004820160006117cd9190613997565b6005820160006117dd9190613997565b505050505050565b60006003826040518082805190602001908083835b60208310151561181f57805182526020820191506020810190506020830392506117fa565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60006002826040518082805190602001908083835b6020831015156118b4578051825260208201915060208101905060208303925061188f565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561196c57600080fd5b82600073ffffffffffffffffffffffffffffffffffffffff16600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151515611a0b57600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002091508373ffffffffffffffffffffffffffffffffffffffff167fc3168fdc13112e44a031057dbf6c609b33353addb4d8037d24543e22cbfe2acd8360050185604051808060200180602001838103835285818154600181600116156101000203166002900481526020019150805460018160011615610100020316600290048015611b165780601f10611aeb57610100808354040283529160200191611b16565b820191906000526020600020905b815481529060010190602001808311611af957829003601f168201915b5050838103825284818151815260200191508051906020019080838360005b83811015611b50578082015181840152602081019050611b35565b50505050905090810190601f168015611b7d5780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a282826005019080519060200190611ba49291906139df565b5050505050565b60006060806000606080611bbd613a5f565b600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060c060405190810160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600182018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611cf75780601f10611ccc57610100808354040283529160200191611cf7565b820191906000526020600020905b815481529060010190602001808311611cda57829003601f168201915b50505050508152602001600282018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611d995780601f10611d6e57610100808354040283529160200191611d99565b820191906000526020600020905b815481529060010190602001808311611d7c57829003601f168201915b505050505081526020016003820160009054906101000a900460ff1660ff1660ff168152602001600482018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611e585780601f10611e2d57610100808354040283529160200191611e58565b820191906000526020600020905b815481529060010190602001808311611e3b57829003601f168201915b50505050508152602001600582018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611efa5780601f10611ecf57610100808354040283529160200191611efa565b820191906000526020600020905b815481529060010190602001808311611edd57829003601f168201915b5050505050815250509050806000015181602001518260400151836060015184608001518560a001518494508393508191508090509650965096509650965096505091939550919395565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611fc557600080fd5b85600073ffffffffffffffffffffffffffffffffffffffff16600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561206357600080fd5b86600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156120a057600080fd5b85600073ffffffffffffffffffffffffffffffffffffffff166002826040518082805190602001908083835b6020831015156120f157805182526020820191506020810190506020830392506120cc565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561216757600080fd5b87600073ffffffffffffffffffffffffffffffffffffffff166003826040518082805190602001908083835b6020831015156121b85780518252602082019150602081019050602083039250612193565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561222e57600080fd5b60c0604051908101604052808b73ffffffffffffffffffffffffffffffffffffffff1681526020018a81526020018981526020018860ff16815260200187815260200186815250600160008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001019080519060200190612317929190613aaf565b506040820151816002019080519060200190612334929190613aaf565b5060608201518160030160006101000a81548160ff021916908360ff1602179055506080820151816004019080519060200190612372929190613b2f565b5060a082015181600501908051906020019061238f929190613b2f565b5090505060048a90806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050896002896040518082805190602001908083835b602083101515612432578051825260208201915060208101905060208303925061240d565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508960038a6040518082805190602001908083835b6020831015156124dc57805182526020820191506020810190506020830392506124b7565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508973ffffffffffffffffffffffffffffffffffffffff167fd8d928b0b50ca11d9dc273236b46f3526515b03602f71f3a6af4f45bd9fa91448a8a8a8a8a6040518080602001806020018660ff1660ff168152602001806020018060200185810385528a818151815260200191508051906020019080838360005b838110156125e25780820151818401526020810190506125c7565b50505050905090810190601f16801561260f5780820380516001836020036101000a031916815260200191505b50858103845289818151815260200191508051906020019080838360005b8381101561264857808201518184015260208101905061262d565b50505050905090810190601f1680156126755780820380516001836020036101000a031916815260200191505b50858103835287818151815260200191508051906020019080838360005b838110156126ae578082015181840152602081019050612693565b50505050905090810190601f1680156126db5780820380516001836020036101000a031916815260200191505b50858103825286818151815260200191508051906020019080838360005b838110156127145780820151818401526020810190506126f9565b50505050905090810190601f1680156127415780820380516001836020036101000a031916815260200191505b50995050505050505050505060405180910390a250505050505050505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156127be57600080fd5b82600073ffffffffffffffffffffffffffffffffffffffff16600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561285d57600080fd5b82600073ffffffffffffffffffffffffffffffffffffffff166003826040518082805190602001908083835b6020831015156128ae5780518252602082019150602081019050602083039250612889565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561292457600080fd5b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002092508473ffffffffffffffffffffffffffffffffffffffff167f4a6dbfc867b179991dec22ff19960f0a94d8d9d891fc556f547764670340e8ae8460010186604051808060200180602001838103835285818154600181600116156101000203166002900481526020019150805460018160011615610100020316600290048015612a2f5780601f10612a0457610100808354040283529160200191612a2f565b820191906000526020600020905b815481529060010190602001808311612a1257829003601f168201915b5050838103825284818151815260200191508051906020019080838360005b83811015612a69578082015181840152602081019050612a4e565b50505050905090810190601f168015612a965780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a26003836001016040518082805460018160011615610100020316600290048015612b065780601f10612ae4576101008083540402835291820191612b06565b820191906000526020600020905b815481529060010190602001808311612af2575b5050915050908152602001604051809103902060006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055846003856040518082805190602001908083835b602083101515612b755780518252602082019150602081019050602083039250612b50565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555083836001019080519060200190612bfe929190613baf565b505050505050565b60016020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806001018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612cd85780601f10612cad57610100808354040283529160200191612cd8565b820191906000526020600020905b815481529060010190602001808311612cbb57829003601f168201915b505050505090806002018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612d765780601f10612d4b57610100808354040283529160200191612d76565b820191906000526020600020905b815481529060010190602001808311612d5957829003601f168201915b5050505050908060030160009054906101000a900460ff1690806004018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612e275780601f10612dfc57610100808354040283529160200191612e27565b820191906000526020600020905b815481529060010190602001808311612e0a57829003601f168201915b505050505090806005018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612ec55780601f10612e9a57610100808354040283529160200191612ec5565b820191906000526020600020905b815481529060010190602001808311612ea857829003601f168201915b5050505050905086565b600481815481101515612ede57fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000606080600060608060006003886040518082805190602001908083835b602083101515612f515780518252602082019150602081019050602083039250612f2c565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050612fb081611bab565b9650965096509650965096505091939550919395565b6060600480548060200260200160405190810160405280929190818152602001828054801561304a57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311613000575b5050505050905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156130b157600080fd5b82600073ffffffffffffffffffffffffffffffffffffffff16600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561315057600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002091508373ffffffffffffffffffffffffffffffffffffffff167f5b19f79ac4e8cfa820815502e11615f1a449e28155dc289ec5cac1a11f908694836004018560405180806020018060200183810383528581815460018160011615610100020316600290048152602001915080546001816001161561010002031660029004801561325b5780601f106132305761010080835404028352916020019161325b565b820191906000526020600020905b81548152906001019060200180831161323e57829003601f168201915b5050838103825284818151815260200191508051906020019080838360005b8381101561329557808201518184015260208101905061327a565b50505050905090810190601f1680156132c25780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a2828260040190805190602001906132e99291906139df565b5050505050565b6000606080600060608060006002886040518082805190602001908083835b602083101515613334578051825260208201915060208101905060208303925061330f565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905061339381611bab565b9650965096509650965096505091939550919395565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561340657600080fd5b82600073ffffffffffffffffffffffffffffffffffffffff16600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515156134a557600080fd5b82600073ffffffffffffffffffffffffffffffffffffffff166002826040518082805190602001908083835b6020831015156134f657805182526020820191506020810190506020830392506134d1565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561356c57600080fd5b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002092508473ffffffffffffffffffffffffffffffffffffffff167f53d878a6530e56c9bc96548fa0a8cae4f1d1f49c86b0e934c086b992ebb6998f84600201866040518080602001806020018381038352858181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156136775780601f1061364c57610100808354040283529160200191613677565b820191906000526020600020905b81548152906001019060200180831161365a57829003601f168201915b5050838103825284818151815260200191508051906020019080838360005b838110156136b1578082015181840152602081019050613696565b50505050905090810190601f1680156136de5780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a2600283600201604051808280546001816001161561010002031660029004801561374e5780601f1061372c57610100808354040283529182019161374e565b820191906000526020600020905b81548152906001019060200180831161373a575b5050915050908152602001604051809103902060006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055846002856040518082805190602001908083835b6020831015156137bd5780518252602082019150602081019050602083039250613798565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555083836002019080519060200190613846929190613baf565b505050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156138a957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151561392057806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b81548183558181111561394a578183600052602060002091820191016139499190613c2f565b5b505050565b50805460018160011615610100020316600290046000825580601f106139755750613994565b601f0160209004906000526020600020908101906139939190613c2f565b5b50565b50805460018160011615610100020316600290046000825580601f106139bd57506139dc565b601f0160209004906000526020600020908101906139db9190613c2f565b5b50565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10613a2057805160ff1916838001178555613a4e565b82800160010185558215613a4e579182015b82811115613a4d578251825591602001919060010190613a32565b5b509050613a5b9190613c2f565b5090565b60c060405190810160405280600073ffffffffffffffffffffffffffffffffffffffff1681526020016060815260200160608152602001600060ff16815260200160608152602001606081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10613af057805160ff1916838001178555613b1e565b82800160010185558215613b1e579182015b82811115613b1d578251825591602001919060010190613b02565b5b509050613b2b9190613c2f565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10613b7057805160ff1916838001178555613b9e565b82800160010185558215613b9e579182015b82811115613b9d578251825591602001919060010190613b82565b5b509050613bab9190613c2f565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10613bf057805160ff1916838001178555613c1e565b82800160010185558215613c1e579182015b82811115613c1d578251825591602001919060010190613c02565b5b509050613c2b9190613c2f565b5090565b613c5191905b80821115613c4d576000816000905550600101613c35565b5090565b905600a165627a7a72305820d84e18f5e2a4225b867b811a1b72127ed7ad24cf5341436b1f500232eac44bc80029",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0xE6 JUMPI PUSH1 0x0 CALLDATALOAD PUSH29 0x100000000000000000000000000000000000000000000000000000000 SWAP1 DIV PUSH4 0xFFFFFFFF AND DUP1 PUSH4 0x13BAF1E6 EQ PUSH2 0xEB JUMPI DUP1 PUSH4 0x2FBFEBA9 EQ PUSH2 0x138 JUMPI DUP1 PUSH4 0x3550B6D9 EQ PUSH2 0x1E1 JUMPI DUP1 PUSH4 0x56318820 EQ PUSH2 0x28A JUMPI DUP1 PUSH4 0x7ABCCAC9 EQ PUSH2 0x313 JUMPI DUP1 PUSH4 0x8DA5CB5B EQ PUSH2 0x553 JUMPI DUP1 PUSH4 0xA880319D EQ PUSH2 0x5AA JUMPI DUP1 PUSH4 0xC370C86D EQ PUSH2 0x712 JUMPI DUP1 PUSH4 0xE4860339 EQ PUSH2 0x79B JUMPI DUP1 PUSH4 0xE5DF8B84 EQ PUSH2 0x9DB JUMPI DUP1 PUSH4 0xE73FC0C3 EQ PUSH2 0xA48 JUMPI DUP1 PUSH4 0xEE8C24B8 EQ PUSH2 0xCAE JUMPI DUP1 PUSH4 0xEEF05F65 EQ PUSH2 0xD1A JUMPI DUP1 PUSH4 0xEFA74F1F EQ PUSH2 0xDA3 JUMPI DUP1 PUSH4 0xF036417F EQ PUSH2 0x1009 JUMPI DUP1 PUSH4 0xF2FDE38B EQ PUSH2 0x1092 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xF7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x136 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x10D5 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x144 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19F PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 POP POP POP PUSH2 0x17E5 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1ED JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x248 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 POP POP POP PUSH2 0x187A JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x296 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x311 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 POP POP POP PUSH2 0x190F JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x31F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x354 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1BAB JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP7 PUSH1 0xFF AND PUSH1 0xFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP6 DUP2 SUB DUP6 MSTORE DUP11 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x3DE JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x3C3 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x40B JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP DUP6 DUP2 SUB DUP5 MSTORE DUP10 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x444 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x429 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x471 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP DUP6 DUP2 SUB DUP4 MSTORE DUP8 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x4AA JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x48F JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x4D7 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP DUP6 DUP2 SUB DUP3 MSTORE DUP7 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x510 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x4F5 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x53D JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP11 POP POP POP POP POP POP POP POP POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x55F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x568 PUSH2 0x1F45 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x5B6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x710 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD PUSH1 0xFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 POP POP POP PUSH2 0x1F6A JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x71E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x799 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 POP POP POP PUSH2 0x2761 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x7A7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x7DC PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x2C06 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP7 PUSH1 0xFF AND PUSH1 0xFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP6 DUP2 SUB DUP6 MSTORE DUP11 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x866 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x84B JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x893 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP DUP6 DUP2 SUB DUP5 MSTORE DUP10 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x8CC JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x8B1 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x8F9 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP DUP6 DUP2 SUB DUP4 MSTORE DUP8 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x932 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x917 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x95F JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP DUP6 DUP2 SUB DUP3 MSTORE DUP7 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x998 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x97D JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x9C5 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP11 POP POP POP POP POP POP POP POP POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x9E7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xA06 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x2ECF JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xA54 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xAAF PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 POP POP POP PUSH2 0x2F0D JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP7 PUSH1 0xFF AND PUSH1 0xFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP6 DUP2 SUB DUP6 MSTORE DUP11 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0xB39 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0xB1E JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0xB66 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP DUP6 DUP2 SUB DUP5 MSTORE DUP10 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0xB9F JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0xB84 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0xBCC JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP DUP6 DUP2 SUB DUP4 MSTORE DUP8 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0xC05 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0xBEA JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0xC32 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP DUP6 DUP2 SUB DUP3 MSTORE DUP7 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0xC6B JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0xC50 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0xC98 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP11 POP POP POP POP POP POP POP POP POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xCBA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xCC3 PUSH2 0x2FC6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE DUP4 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0xD06 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0xCEB JUMP JUMPDEST POP POP POP POP SWAP1 POP ADD SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xD26 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xDA1 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 POP POP POP PUSH2 0x3054 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xDAF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xE0A PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 POP POP POP PUSH2 0x32F0 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP7 PUSH1 0xFF AND PUSH1 0xFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP6 DUP2 SUB DUP6 MSTORE DUP11 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0xE94 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0xE79 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0xEC1 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP DUP6 DUP2 SUB DUP5 MSTORE DUP10 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0xEFA JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0xEDF JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0xF27 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP DUP6 DUP2 SUB DUP4 MSTORE DUP8 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0xF60 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0xF45 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0xF8D JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP DUP6 DUP2 SUB DUP3 MSTORE DUP7 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0xFC6 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0xFAB JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0xFF3 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP11 POP POP POP POP POP POP POP POP POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1015 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1090 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 POP POP POP PUSH2 0x33A9 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x109E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x10D3 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x384E JUMP JUMPDEST STOP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x1132 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x1 PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO ISZERO PUSH2 0x11D1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x4 DUP5 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x11F7 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x1244 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x4 PUSH1 0x1 PUSH1 0x4 DUP1 SLOAD SWAP1 POP SUB DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x125B JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x4 DUP5 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1295 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH1 0x1 PUSH1 0x4 DUP2 DUP2 DUP1 SLOAD SWAP1 POP SUB SWAP2 POP DUP2 PUSH2 0x12F5 SWAP2 SWAP1 PUSH2 0x3923 JUMP JUMPDEST POP PUSH1 0x1 PUSH1 0x0 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SWAP2 POP DUP2 PUSH1 0x0 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x32C54F1E2EA75844DED7517E7DBCD3895DA7CD0C28F9AB9F9CF6ECF5F83762C6 DUP4 PUSH1 0x1 ADD DUP5 PUSH1 0x2 ADD DUP6 PUSH1 0x3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND DUP7 PUSH1 0x4 ADD DUP8 PUSH1 0x5 ADD PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP7 PUSH1 0xFF AND PUSH1 0xFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP6 DUP2 SUB DUP6 MSTORE DUP11 DUP2 DUP2 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x1456 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x142B JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x1456 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x1439 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP DUP6 DUP2 SUB DUP5 MSTORE DUP10 DUP2 DUP2 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x14D9 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x14AE JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x14D9 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x14BC JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP DUP6 DUP2 SUB DUP4 MSTORE DUP8 DUP2 DUP2 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x155C JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x1531 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x155C JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x153F JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP DUP6 DUP2 SUB DUP3 MSTORE DUP7 DUP2 DUP2 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x15DF JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x15B4 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x15DF JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x15C2 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP SWAP10 POP POP POP POP POP POP POP POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 PUSH1 0x2 DUP3 PUSH1 0x2 ADD PUSH1 0x40 MLOAD DUP1 DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x1655 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x1633 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 DUP3 ADD SWAP2 PUSH2 0x1655 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x1641 JUMPI JUMPDEST POP POP SWAP2 POP POP SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 SSTORE PUSH1 0x3 DUP3 PUSH1 0x1 ADD PUSH1 0x40 MLOAD DUP1 DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x16EC JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x16CA JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 DUP3 ADD SWAP2 PUSH2 0x16EC JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x16D8 JUMPI JUMPDEST POP POP SWAP2 POP POP SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 SSTORE PUSH1 0x1 PUSH1 0x0 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP1 DUP3 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 SSTORE PUSH1 0x1 DUP3 ADD PUSH1 0x0 PUSH2 0x1799 SWAP2 SWAP1 PUSH2 0x394F JUMP JUMPDEST PUSH1 0x2 DUP3 ADD PUSH1 0x0 PUSH2 0x17A9 SWAP2 SWAP1 PUSH2 0x394F JUMP JUMPDEST PUSH1 0x3 DUP3 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD SWAP1 PUSH1 0xFF MUL NOT AND SWAP1 SSTORE PUSH1 0x4 DUP3 ADD PUSH1 0x0 PUSH2 0x17CD SWAP2 SWAP1 PUSH2 0x3997 JUMP JUMPDEST PUSH1 0x5 DUP3 ADD PUSH1 0x0 PUSH2 0x17DD SWAP2 SWAP1 PUSH2 0x3997 JUMP JUMPDEST POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x3 DUP3 PUSH1 0x40 MLOAD DUP1 DUP3 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT ISZERO ISZERO PUSH2 0x181F JUMPI DUP1 MLOAD DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP2 POP PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH1 0x20 DUP4 SUB SWAP3 POP PUSH2 0x17FA JUMP JUMPDEST PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB DUP1 NOT DUP3 MLOAD AND DUP2 DUP5 MLOAD AND DUP1 DUP3 OR DUP6 MSTORE POP POP POP POP POP POP SWAP1 POP ADD SWAP2 POP POP SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x2 DUP3 PUSH1 0x40 MLOAD DUP1 DUP3 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT ISZERO ISZERO PUSH2 0x18B4 JUMPI DUP1 MLOAD DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP2 POP PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH1 0x20 DUP4 SUB SWAP3 POP PUSH2 0x188F JUMP JUMPDEST PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB DUP1 NOT DUP3 MLOAD AND DUP2 DUP5 MLOAD AND DUP1 DUP3 OR DUP6 MSTORE POP POP POP POP POP POP SWAP1 POP ADD SWAP2 POP POP SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x196C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x1 PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO ISZERO PUSH2 0x1A0B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x1 PUSH1 0x0 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SWAP2 POP DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xC3168FDC13112E44A031057DBF6C609B33353ADDB4D8037D24543E22CBFE2ACD DUP4 PUSH1 0x5 ADD DUP6 PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP4 DUP2 SUB DUP4 MSTORE DUP6 DUP2 DUP2 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x1B16 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x1AEB JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x1B16 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x1AF9 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP DUP4 DUP2 SUB DUP3 MSTORE DUP5 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x1B50 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x1B35 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x1B7D JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP5 POP POP POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 DUP3 DUP3 PUSH1 0x5 ADD SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH2 0x1BA4 SWAP3 SWAP2 SWAP1 PUSH2 0x39DF JUMP JUMPDEST POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x60 DUP1 PUSH1 0x0 PUSH1 0x60 DUP1 PUSH2 0x1BBD PUSH2 0x3A5F JUMP JUMPDEST PUSH1 0x1 PUSH1 0x0 DUP10 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0xC0 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE SWAP1 DUP2 PUSH1 0x0 DUP3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x1 DUP3 ADD DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x1CF7 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x1CCC JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x1CF7 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x1CDA JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x2 DUP3 ADD DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x1D99 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x1D6E JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x1D99 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x1D7C JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x3 DUP3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND PUSH1 0xFF AND PUSH1 0xFF AND DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x4 DUP3 ADD DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x1E58 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x1E2D JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x1E58 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x1E3B JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x5 DUP3 ADD DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x1EFA JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x1ECF JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x1EFA JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x1EDD JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP DUP2 MSTORE POP POP SWAP1 POP DUP1 PUSH1 0x0 ADD MLOAD DUP2 PUSH1 0x20 ADD MLOAD DUP3 PUSH1 0x40 ADD MLOAD DUP4 PUSH1 0x60 ADD MLOAD DUP5 PUSH1 0x80 ADD MLOAD DUP6 PUSH1 0xA0 ADD MLOAD DUP5 SWAP5 POP DUP4 SWAP4 POP DUP2 SWAP2 POP DUP1 SWAP1 POP SWAP7 POP SWAP7 POP SWAP7 POP SWAP7 POP SWAP7 POP SWAP7 POP POP SWAP2 SWAP4 SWAP6 POP SWAP2 SWAP4 SWAP6 JUMP JUMPDEST PUSH1 0x0 DUP1 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x1FC5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP6 PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x1 PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x2063 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP7 PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO ISZERO PUSH2 0x20A0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP6 PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x2 DUP3 PUSH1 0x40 MLOAD DUP1 DUP3 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT ISZERO ISZERO PUSH2 0x20F1 JUMPI DUP1 MLOAD DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP2 POP PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH1 0x20 DUP4 SUB SWAP3 POP PUSH2 0x20CC JUMP JUMPDEST PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB DUP1 NOT DUP3 MLOAD AND DUP2 DUP5 MLOAD AND DUP1 DUP3 OR DUP6 MSTORE POP POP POP POP POP POP SWAP1 POP ADD SWAP2 POP POP SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x2167 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP8 PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x3 DUP3 PUSH1 0x40 MLOAD DUP1 DUP3 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT ISZERO ISZERO PUSH2 0x21B8 JUMPI DUP1 MLOAD DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP2 POP PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH1 0x20 DUP4 SUB SWAP3 POP PUSH2 0x2193 JUMP JUMPDEST PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB DUP1 NOT DUP3 MLOAD AND DUP2 DUP5 MLOAD AND DUP1 DUP3 OR DUP6 MSTORE POP POP POP POP POP POP SWAP1 POP ADD SWAP2 POP POP SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x222E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0xC0 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 DUP12 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP11 DUP2 MSTORE PUSH1 0x20 ADD DUP10 DUP2 MSTORE PUSH1 0x20 ADD DUP9 PUSH1 0xFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP8 DUP2 MSTORE PUSH1 0x20 ADD DUP7 DUP2 MSTORE POP PUSH1 0x1 PUSH1 0x0 DUP13 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 ADD MLOAD DUP2 PUSH1 0x0 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH1 0x20 DUP3 ADD MLOAD DUP2 PUSH1 0x1 ADD SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH2 0x2317 SWAP3 SWAP2 SWAP1 PUSH2 0x3AAF JUMP JUMPDEST POP PUSH1 0x40 DUP3 ADD MLOAD DUP2 PUSH1 0x2 ADD SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH2 0x2334 SWAP3 SWAP2 SWAP1 PUSH2 0x3AAF JUMP JUMPDEST POP PUSH1 0x60 DUP3 ADD MLOAD DUP2 PUSH1 0x3 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 PUSH1 0xFF AND MUL OR SWAP1 SSTORE POP PUSH1 0x80 DUP3 ADD MLOAD DUP2 PUSH1 0x4 ADD SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH2 0x2372 SWAP3 SWAP2 SWAP1 PUSH2 0x3B2F JUMP JUMPDEST POP PUSH1 0xA0 DUP3 ADD MLOAD DUP2 PUSH1 0x5 ADD SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH2 0x238F SWAP3 SWAP2 SWAP1 PUSH2 0x3B2F JUMP JUMPDEST POP SWAP1 POP POP PUSH1 0x4 DUP11 SWAP1 DUP1 PUSH1 0x1 DUP2 SLOAD ADD DUP1 DUP3 SSTORE DUP1 SWAP2 POP POP SWAP1 PUSH1 0x1 DUP3 SUB SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SWAP2 SWAP3 SWAP1 SWAP2 SWAP1 SWAP2 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP POP DUP10 PUSH1 0x2 DUP10 PUSH1 0x40 MLOAD DUP1 DUP3 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT ISZERO ISZERO PUSH2 0x2432 JUMPI DUP1 MLOAD DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP2 POP PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH1 0x20 DUP4 SUB SWAP3 POP PUSH2 0x240D JUMP JUMPDEST PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB DUP1 NOT DUP3 MLOAD AND DUP2 DUP5 MLOAD AND DUP1 DUP3 OR DUP6 MSTORE POP POP POP POP POP POP SWAP1 POP ADD SWAP2 POP POP SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP DUP10 PUSH1 0x3 DUP11 PUSH1 0x40 MLOAD DUP1 DUP3 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT ISZERO ISZERO PUSH2 0x24DC JUMPI DUP1 MLOAD DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP2 POP PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH1 0x20 DUP4 SUB SWAP3 POP PUSH2 0x24B7 JUMP JUMPDEST PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB DUP1 NOT DUP3 MLOAD AND DUP2 DUP5 MLOAD AND DUP1 DUP3 OR DUP6 MSTORE POP POP POP POP POP POP SWAP1 POP ADD SWAP2 POP POP SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP DUP10 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xD8D928B0B50CA11D9DC273236B46F3526515B03602F71F3A6AF4F45BD9FA9144 DUP11 DUP11 DUP11 DUP11 DUP11 PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP7 PUSH1 0xFF AND PUSH1 0xFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP6 DUP2 SUB DUP6 MSTORE DUP11 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x25E2 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x25C7 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x260F JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP DUP6 DUP2 SUB DUP5 MSTORE DUP10 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x2648 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x262D JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x2675 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP DUP6 DUP2 SUB DUP4 MSTORE DUP8 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x26AE JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x2693 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x26DB JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP DUP6 DUP2 SUB DUP3 MSTORE DUP7 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x2714 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x26F9 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x2741 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP10 POP POP POP POP POP POP POP POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 POP POP POP POP POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x27BE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x1 PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO ISZERO PUSH2 0x285D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x3 DUP3 PUSH1 0x40 MLOAD DUP1 DUP3 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT ISZERO ISZERO PUSH2 0x28AE JUMPI DUP1 MLOAD DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP2 POP PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH1 0x20 DUP4 SUB SWAP3 POP PUSH2 0x2889 JUMP JUMPDEST PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB DUP1 NOT DUP3 MLOAD AND DUP2 DUP5 MLOAD AND DUP1 DUP3 OR DUP6 MSTORE POP POP POP POP POP POP SWAP1 POP ADD SWAP2 POP POP SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x2924 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x1 PUSH1 0x0 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SWAP3 POP DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x4A6DBFC867B179991DEC22FF19960F0A94D8D9D891FC556F547764670340E8AE DUP5 PUSH1 0x1 ADD DUP7 PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP4 DUP2 SUB DUP4 MSTORE DUP6 DUP2 DUP2 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x2A2F JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x2A04 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x2A2F JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x2A12 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP DUP4 DUP2 SUB DUP3 MSTORE DUP5 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x2A69 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x2A4E JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x2A96 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP5 POP POP POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 PUSH1 0x3 DUP4 PUSH1 0x1 ADD PUSH1 0x40 MLOAD DUP1 DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x2B06 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x2AE4 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 DUP3 ADD SWAP2 PUSH2 0x2B06 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x2AF2 JUMPI JUMPDEST POP POP SWAP2 POP POP SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 SSTORE DUP5 PUSH1 0x3 DUP6 PUSH1 0x40 MLOAD DUP1 DUP3 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT ISZERO ISZERO PUSH2 0x2B75 JUMPI DUP1 MLOAD DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP2 POP PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH1 0x20 DUP4 SUB SWAP3 POP PUSH2 0x2B50 JUMP JUMPDEST PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB DUP1 NOT DUP3 MLOAD AND DUP2 DUP5 MLOAD AND DUP1 DUP3 OR DUP6 MSTORE POP POP POP POP POP POP SWAP1 POP ADD SWAP2 POP POP SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP DUP4 DUP4 PUSH1 0x1 ADD SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH2 0x2BFE SWAP3 SWAP2 SWAP1 PUSH2 0x3BAF JUMP JUMPDEST POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x1 PUSH1 0x20 MSTORE DUP1 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP2 POP SWAP1 POP DUP1 PUSH1 0x0 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 DUP1 PUSH1 0x1 ADD DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x2CD8 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x2CAD JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x2CD8 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x2CBB JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP1 DUP1 PUSH1 0x2 ADD DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x2D76 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x2D4B JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x2D76 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x2D59 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP1 DUP1 PUSH1 0x3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND SWAP1 DUP1 PUSH1 0x4 ADD DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x2E27 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x2DFC JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x2E27 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x2E0A JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP1 DUP1 PUSH1 0x5 ADD DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x2EC5 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x2E9A JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x2EC5 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x2EA8 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP1 POP DUP7 JUMP JUMPDEST PUSH1 0x4 DUP2 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x2EDE JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP2 POP SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x60 DUP1 PUSH1 0x0 PUSH1 0x60 DUP1 PUSH1 0x0 PUSH1 0x3 DUP9 PUSH1 0x40 MLOAD DUP1 DUP3 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT ISZERO ISZERO PUSH2 0x2F51 JUMPI DUP1 MLOAD DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP2 POP PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH1 0x20 DUP4 SUB SWAP3 POP PUSH2 0x2F2C JUMP JUMPDEST PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB DUP1 NOT DUP3 MLOAD AND DUP2 DUP5 MLOAD AND DUP1 DUP3 OR DUP6 MSTORE POP POP POP POP POP POP SWAP1 POP ADD SWAP2 POP POP SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 POP PUSH2 0x2FB0 DUP2 PUSH2 0x1BAB JUMP JUMPDEST SWAP7 POP SWAP7 POP SWAP7 POP SWAP7 POP SWAP7 POP SWAP7 POP POP SWAP2 SWAP4 SWAP6 POP SWAP2 SWAP4 SWAP6 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x4 DUP1 SLOAD DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD DUP1 ISZERO PUSH2 0x304A JUMPI PUSH1 0x20 MUL DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 PUSH1 0x1 ADD SWAP1 DUP1 DUP4 GT PUSH2 0x3000 JUMPI JUMPDEST POP POP POP POP POP SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x30B1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x1 PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO ISZERO PUSH2 0x3150 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x1 PUSH1 0x0 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SWAP2 POP DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x5B19F79AC4E8CFA820815502E11615F1A449E28155DC289EC5CAC1A11F908694 DUP4 PUSH1 0x4 ADD DUP6 PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP4 DUP2 SUB DUP4 MSTORE DUP6 DUP2 DUP2 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x325B JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x3230 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x325B JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x323E JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP DUP4 DUP2 SUB DUP3 MSTORE DUP5 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x3295 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x327A JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x32C2 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP5 POP POP POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 DUP3 DUP3 PUSH1 0x4 ADD SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH2 0x32E9 SWAP3 SWAP2 SWAP1 PUSH2 0x39DF JUMP JUMPDEST POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x60 DUP1 PUSH1 0x0 PUSH1 0x60 DUP1 PUSH1 0x0 PUSH1 0x2 DUP9 PUSH1 0x40 MLOAD DUP1 DUP3 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT ISZERO ISZERO PUSH2 0x3334 JUMPI DUP1 MLOAD DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP2 POP PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH1 0x20 DUP4 SUB SWAP3 POP PUSH2 0x330F JUMP JUMPDEST PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB DUP1 NOT DUP3 MLOAD AND DUP2 DUP5 MLOAD AND DUP1 DUP3 OR DUP6 MSTORE POP POP POP POP POP POP SWAP1 POP ADD SWAP2 POP POP SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 POP PUSH2 0x3393 DUP2 PUSH2 0x1BAB JUMP JUMPDEST SWAP7 POP SWAP7 POP SWAP7 POP SWAP7 POP SWAP7 POP SWAP7 POP POP SWAP2 SWAP4 SWAP6 POP SWAP2 SWAP4 SWAP6 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x3406 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x1 PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO ISZERO PUSH2 0x34A5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x2 DUP3 PUSH1 0x40 MLOAD DUP1 DUP3 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT ISZERO ISZERO PUSH2 0x34F6 JUMPI DUP1 MLOAD DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP2 POP PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH1 0x20 DUP4 SUB SWAP3 POP PUSH2 0x34D1 JUMP JUMPDEST PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB DUP1 NOT DUP3 MLOAD AND DUP2 DUP5 MLOAD AND DUP1 DUP3 OR DUP6 MSTORE POP POP POP POP POP POP SWAP1 POP ADD SWAP2 POP POP SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x356C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x1 PUSH1 0x0 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SWAP3 POP DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x53D878A6530E56C9BC96548FA0A8CAE4F1D1F49C86B0E934C086B992EBB6998F DUP5 PUSH1 0x2 ADD DUP7 PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP4 DUP2 SUB DUP4 MSTORE DUP6 DUP2 DUP2 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x3677 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x364C JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x3677 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x365A JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP DUP4 DUP2 SUB DUP3 MSTORE DUP5 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x36B1 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x3696 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x36DE JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP5 POP POP POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 PUSH1 0x2 DUP4 PUSH1 0x2 ADD PUSH1 0x40 MLOAD DUP1 DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x374E JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x372C JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 DUP3 ADD SWAP2 PUSH2 0x374E JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x373A JUMPI JUMPDEST POP POP SWAP2 POP POP SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 SSTORE DUP5 PUSH1 0x2 DUP6 PUSH1 0x40 MLOAD DUP1 DUP3 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT ISZERO ISZERO PUSH2 0x37BD JUMPI DUP1 MLOAD DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP2 POP PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH1 0x20 DUP4 SUB SWAP3 POP PUSH2 0x3798 JUMP JUMPDEST PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB DUP1 NOT DUP3 MLOAD AND DUP2 DUP5 MLOAD AND DUP1 DUP3 OR DUP6 MSTORE POP POP POP POP POP POP SWAP1 POP ADD SWAP2 POP POP SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP DUP4 DUP4 PUSH1 0x2 ADD SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH2 0x3846 SWAP3 SWAP2 SWAP1 PUSH2 0x3BAF JUMP JUMPDEST POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x38A9 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x3920 JUMPI DUP1 PUSH1 0x0 DUP1 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP JUMPDEST POP JUMP JUMPDEST DUP2 SLOAD DUP2 DUP4 SSTORE DUP2 DUP2 GT ISZERO PUSH2 0x394A JUMPI DUP2 DUP4 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP2 DUP3 ADD SWAP2 ADD PUSH2 0x3949 SWAP2 SWAP1 PUSH2 0x3C2F JUMP JUMPDEST JUMPDEST POP POP POP JUMP JUMPDEST POP DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV PUSH1 0x0 DUP3 SSTORE DUP1 PUSH1 0x1F LT PUSH2 0x3975 JUMPI POP PUSH2 0x3994 JUMP JUMPDEST PUSH1 0x1F ADD PUSH1 0x20 SWAP1 DIV SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 DUP2 ADD SWAP1 PUSH2 0x3993 SWAP2 SWAP1 PUSH2 0x3C2F JUMP JUMPDEST JUMPDEST POP JUMP JUMPDEST POP DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV PUSH1 0x0 DUP3 SSTORE DUP1 PUSH1 0x1F LT PUSH2 0x39BD JUMPI POP PUSH2 0x39DC JUMP JUMPDEST PUSH1 0x1F ADD PUSH1 0x20 SWAP1 DIV SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 DUP2 ADD SWAP1 PUSH2 0x39DB SWAP2 SWAP1 PUSH2 0x3C2F JUMP JUMPDEST JUMPDEST POP JUMP JUMPDEST DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 PUSH1 0x1F ADD PUSH1 0x20 SWAP1 DIV DUP2 ADD SWAP3 DUP3 PUSH1 0x1F LT PUSH2 0x3A20 JUMPI DUP1 MLOAD PUSH1 0xFF NOT AND DUP4 DUP1 ADD OR DUP6 SSTORE PUSH2 0x3A4E JUMP JUMPDEST DUP3 DUP1 ADD PUSH1 0x1 ADD DUP6 SSTORE DUP3 ISZERO PUSH2 0x3A4E JUMPI SWAP2 DUP3 ADD JUMPDEST DUP3 DUP2 GT ISZERO PUSH2 0x3A4D JUMPI DUP3 MLOAD DUP3 SSTORE SWAP2 PUSH1 0x20 ADD SWAP2 SWAP1 PUSH1 0x1 ADD SWAP1 PUSH2 0x3A32 JUMP JUMPDEST JUMPDEST POP SWAP1 POP PUSH2 0x3A5B SWAP2 SWAP1 PUSH2 0x3C2F JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST PUSH1 0xC0 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x60 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x60 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 PUSH1 0xFF AND DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x60 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x60 DUP2 MSTORE POP SWAP1 JUMP JUMPDEST DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 PUSH1 0x1F ADD PUSH1 0x20 SWAP1 DIV DUP2 ADD SWAP3 DUP3 PUSH1 0x1F LT PUSH2 0x3AF0 JUMPI DUP1 MLOAD PUSH1 0xFF NOT AND DUP4 DUP1 ADD OR DUP6 SSTORE PUSH2 0x3B1E JUMP JUMPDEST DUP3 DUP1 ADD PUSH1 0x1 ADD DUP6 SSTORE DUP3 ISZERO PUSH2 0x3B1E JUMPI SWAP2 DUP3 ADD JUMPDEST DUP3 DUP2 GT ISZERO PUSH2 0x3B1D JUMPI DUP3 MLOAD DUP3 SSTORE SWAP2 PUSH1 0x20 ADD SWAP2 SWAP1 PUSH1 0x1 ADD SWAP1 PUSH2 0x3B02 JUMP JUMPDEST JUMPDEST POP SWAP1 POP PUSH2 0x3B2B SWAP2 SWAP1 PUSH2 0x3C2F JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 PUSH1 0x1F ADD PUSH1 0x20 SWAP1 DIV DUP2 ADD SWAP3 DUP3 PUSH1 0x1F LT PUSH2 0x3B70 JUMPI DUP1 MLOAD PUSH1 0xFF NOT AND DUP4 DUP1 ADD OR DUP6 SSTORE PUSH2 0x3B9E JUMP JUMPDEST DUP3 DUP1 ADD PUSH1 0x1 ADD DUP6 SSTORE DUP3 ISZERO PUSH2 0x3B9E JUMPI SWAP2 DUP3 ADD JUMPDEST DUP3 DUP2 GT ISZERO PUSH2 0x3B9D JUMPI DUP3 MLOAD DUP3 SSTORE SWAP2 PUSH1 0x20 ADD SWAP2 SWAP1 PUSH1 0x1 ADD SWAP1 PUSH2 0x3B82 JUMP JUMPDEST JUMPDEST POP SWAP1 POP PUSH2 0x3BAB SWAP2 SWAP1 PUSH2 0x3C2F JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 PUSH1 0x1F ADD PUSH1 0x20 SWAP1 DIV DUP2 ADD SWAP3 DUP3 PUSH1 0x1F LT PUSH2 0x3BF0 JUMPI DUP1 MLOAD PUSH1 0xFF NOT AND DUP4 DUP1 ADD OR DUP6 SSTORE PUSH2 0x3C1E JUMP JUMPDEST DUP3 DUP1 ADD PUSH1 0x1 ADD DUP6 SSTORE DUP3 ISZERO PUSH2 0x3C1E JUMPI SWAP2 DUP3 ADD JUMPDEST DUP3 DUP2 GT ISZERO PUSH2 0x3C1D JUMPI DUP3 MLOAD DUP3 SSTORE SWAP2 PUSH1 0x20 ADD SWAP2 SWAP1 PUSH1 0x1 ADD SWAP1 PUSH2 0x3C02 JUMP JUMPDEST JUMPDEST POP SWAP1 POP PUSH2 0x3C2B SWAP2 SWAP1 PUSH2 0x3C2F JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST PUSH2 0x3C51 SWAP2 SWAP1 JUMPDEST DUP1 DUP3 GT ISZERO PUSH2 0x3C4D JUMPI PUSH1 0x0 DUP2 PUSH1 0x0 SWAP1 SSTORE POP PUSH1 0x1 ADD PUSH2 0x3C35 JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST SWAP1 JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 0xd8 0x4e XOR 0xf5 0xe2 LOG4 0x22 JUMPDEST DUP7 PUSH28 0x811A1B72127ED7AD24CF5341436B1F500232EAC44BC8002900000000 ",
- "sourceMap": "886:8364:1:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3940:650;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3940:650:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7067:114;;8:9:-1;5:2;;;30:1;27;20:12;5:2;7067:114:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6781:122;;8:9:-1;5:2;;;30:1;27;20:12;5:2;6781:122:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6273:295;;8:9:-1;5:2;;;30:1;27;20:12;5:2;6273:295:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7345:550;;8:9:-1;5:2;;;30:1;27;20:12;5:2;7345:550:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;7345:550:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;7345:550:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;7345:550:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;7345:550:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;223:20:0;;8:9:-1;5:2;;;30:1;27;20:12;5:2;223:20:0;;;;;;;;;;;;;;;;;;;;;;;;;;;2960:852:1;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2960:852:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4738:370;;8:9:-1;5:2;;;30:1;27;20:12;5:2;4738:370:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1656:48;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1656:48:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;1656:48:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;1656:48:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;1656:48:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;1656:48:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1803:31;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1803:31:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8052:392;;8:9:-1;5:2;;;30:1;27;20:12;5:2;8052:392:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;8052:392:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;8052:392:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;8052:392:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;8052:392:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9117:131;;8:9:-1;5:2;;;30:1;27;20:12;5:2;9117:131:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;9117:131:1;;;;;;;;;;;;;;;;;5820:288;;8:9:-1;5:2;;;30:1;27;20:12;5:2;5820:288:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8607:400;;8:9:-1;5:2;;;30:1;27;20:12;5:2;8607:400:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;8607:400:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;8607:400:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;8607:400:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;8607:400:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5262:396;;8:9:-1;5:2;;;30:1;27;20:12;5:2;5262:396:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;396:140:0;;8:9:-1;5:2;;;30:1;27;20:12;5:2;396:140:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;3940:650:1;4230:27;366:5:0;;;;;;;;;;;352:19;;:10;:19;;;344:28;;;;;;;;4043:6:1;2102:1;2070:34;;:6;:14;2077:6;2070:14;;;;;;;;;;;;;;;:20;;;;;;;;;;;;:34;;;;2062:43;;;;;;;;4099:6;4073:32;;:14;4088:6;4073:22;;;;;;;;;;;;;;;;;;;;;;;;;;;:32;;;4065:41;;;;;;;;4142:14;4181:1;4157:14;:21;;;;:25;4142:41;;;;;;;;;;;;;;;;;;;;;;;;;;;4117:14;4132:6;4117:22;;;;;;;;;;;;;;;;;;:66;;;;;;;;;;;;;;;;;;4218:1;4193:14;:26;;;;;;;;;;;;;;:::i;:::-;;4260:6;:14;4267:6;4260:14;;;;;;;;;;;;;;;4230:44;;4312:5;:11;;;;;;;;;;;;4284:184;;;4337:5;:10;;4361:5;:12;;4387:5;:14;;;;;;;;;;;;4415:5;:14;;4443:5;:15;;4284:184;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4485:13;4499:5;:12;;4485:27;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4478:34;;;;;;;;;;;4529:11;4541:5;:10;;4529:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4522:30;;;;;;;;;;;4569:6;:14;4576:6;4569:14;;;;;;;;;;;;;;;;4562:21;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;:::i;:::-;;;382:1:0;3940:650:1;;;:::o;7067:114::-;7130:7;7156:11;7168:5;7156:18;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;51:19;36:153;;;182:3;176:10;171:3;164:23;98:2;93:3;89:12;82:19;;123:2;118:3;114:12;107:19;;148:2;143:3;139:12;132:19;;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;7156:18:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7149:25;;7067:114;;;:::o;6781:122::-;6848:7;6874:13;6888:7;6874:22;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;51:19;36:153;;;182:3;176:10;171:3;164:23;98:2;93:3;89:12;82:19;;123:2;118:3;114:12;107:19;;148:2;143:3;139:12;132:19;;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;6874:22:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6867:29;;6781:122;;;:::o;6273:295::-;6409:27;366:5:0;;;;;;;;;;;352:19;;:10;:19;;;344:28;;;;;;;;6387:6:1;2102:1;2070:34;;:6;:14;2077:6;2070:14;;;;;;;;;;;;;;;:20;;;;;;;;;;;;:34;;;;2062:43;;;;;;;;6439:6;:14;6446:6;6439:14;;;;;;;;;;;;;;;6409:44;;6487:6;6463:60;;;6495:5;:15;;6512:10;6463:60;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;6463:60:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6551:10;6533:5;:15;;:28;;;;;;;;;;;;:::i;:::-;;382:1:0;6273:295:1;;;:::o;7345:550::-;7449:7;7486:6;7515;7546:5;7579;7612;7658:26;;:::i;:::-;7687:6;:14;7694:6;7687:14;;;;;;;;;;;;;;;7658:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7732:5;:11;;;7757:5;:10;;;7781:5;:12;;;7807:5;:14;;;7835:5;:14;;;7863:5;:15;;;7711:177;;;;;;;;;;;;;;;;;;;;;;;;7345:550;;;;;;;;:::o;223:20:0:-;;;;;;;;;;;;;:::o;2960:852:1:-;366:5:0;;;;;;;;;;;352:19;;:10;:19;;;344:28;;;;;;;;3184:6:1;2222:1;2190:34;;:6;:14;2197:6;2190:14;;;;;;;;;;;;;;;:20;;;;;;;;;;;;:34;;;2182:43;;;;;;;;3215:6;2567:1;2547:22;;:8;:22;;;;2539:31;;;;;;;;3250:7;2460:1;2426:36;;:13;2440:7;2426:22;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;51:19;36:153;;;182:3;176:10;171:3;164:23;98:2;93:3;89:12;82:19;;123:2;118:3;114:12;107:19;;148:2;143:3;139:12;132:19;;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;2426:22:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:36;;;2418:45;;;;;;;;3284:5;2337:1;2307:32;;:11;2319:5;2307:18;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;51:19;36:153;;;182:3;176:10;171:3;164:23;98:2;93:3;89:12;82:19;;123:2;118:3;114:12;107:19;;148:2;143:3;139:12;132:19;;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;2307:18:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:32;;;2299:41;;;;;;;;3322:207;;;;;;;;;3357:6;3322:207;;;;;;3383:5;3322:207;;;;3410:7;3322:207;;;;3441:9;3322:207;;;;;;3474:9;3322:207;;;;3508:10;3322:207;;;3305:6;:14;3312:6;3305:14;;;;;;;;;;;;;;;:224;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;3539:14;3559:6;3539:27;;39:1:-1;33:3;27:10;23:18;57:10;52:3;45:23;79:10;72:17;;0:93;3539:27:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3601:6;3576:13;3590:7;3576:22;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;51:19;36:153;;;182:3;176:10;171:3;164:23;98:2;93:3;89:12;82:19;;123:2;118:3;114:12;107:19;;148:2;143:3;139:12;132:19;;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;3576:22:1;;;;;;;;;;;;;;;;;;;;;;:31;;;;;;;;;;;;;;;;;;3638:6;3617:11;3629:5;3617:18;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;51:19;36:153;;;182:3;176:10;171:3;164:23;98:2;93:3;89:12;82:19;;123:2;118:3;114:12;107:19;;148:2;143:3;139:12;132:19;;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;3617:18:1;;;;;;;;;;;;;;;;;;;;;;:27;;;;;;;;;;;;;;;;;;3679:6;3654:151;;;3699:5;3718:7;3739:9;3762;3785:10;3654:151;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;3654:151:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;3654:151:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;3654:151:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;3654:151:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2473:1;2580;2235;382::0;2960:852:1;;;;;;:::o;4738:370::-;4897:27;366:5:0;;;;;;;;;;;352:19;;:10;:19;;;344:28;;;;;;;;4843:6:1;2102:1;2070:34;;:6;:14;2077:6;2070:14;;;;;;;;;;;;;;;:20;;;;;;;;;;;;:34;;;;2062:43;;;;;;;;4876:5;2337:1;2307:32;;:11;2319:5;2307:18;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;51:19;36:153;;;182:3;176:10;171:3;164:23;98:2;93:3;89:12;82:19;;123:2;118:3;114:12;107:19;;148:2;143:3;139:12;132:19;;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;2307:18:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:32;;;2299:41;;;;;;;;4927:6;:14;4934:6;4927:14;;;;;;;;;;;;;;;4897:44;;4970:6;4951:45;;;4978:5;:10;;4990:5;4951:45;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;4951:45:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5013:11;5025:5;:10;;5013:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5006:30;;;;;;;;;;;5067:6;5046:11;5058:5;5046:18;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;51:19;36:153;;;182:3;176:10;171:3;164:23;98:2;93:3;89:12;82:19;;123:2;118:3;114:12;107:19;;148:2;143:3;139:12;132:19;;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;5046:18:1;;;;;;;;;;;;;;;;;;;;;;:27;;;;;;;;;;;;;;;;;;5096:5;5083;:10;;:18;;;;;;;;;;;;:::i;:::-;;2115:1;382::0;4738:370:1;;;:::o;1656:48::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;1803:31::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;8052:392::-;8152:7;8189:6;8218;8249:5;8282;8315;8361:14;8378:11;8390:5;8378:18;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;51:19;36:153;;;182:3;176:10;171:3;164:23;98:2;93:3;89:12;82:19;;123:2;118:3;114:12;107:19;;148:2;143:3;139:12;132:19;;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;8378:18:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8361:35;;8413:24;8430:6;8413:16;:24::i;:::-;8406:31;;;;;;;;;;;;8052:392;;;;;;;;:::o;9117:131::-;9195:9;9227:14;9220:21;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9117:131;:::o;5820:288::-;5954:27;366:5:0;;;;;;;;;;;352:19;;:10;:19;;;344:28;;;;;;;;5932:6:1;2102:1;2070:34;;:6;:14;2077:6;2070:14;;;;;;;;;;;;;;;:20;;;;;;;;;;;;:34;;;;2062:43;;;;;;;;5984:6;:14;5991:6;5984:14;;;;;;;;;;;;;;;5954:44;;6031:6;6008:57;;;6039:5;:14;;6055:9;6008:57;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;6008:57:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6092:9;6075:5;:14;;:26;;;;;;;;;;;;:::i;:::-;;382:1:0;5820:288:1;;;:::o;8607:400::-;8711:7;8748:6;8777;8808:5;8841;8874;8920:14;8937:13;8951:7;8937:22;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;51:19;36:153;;;182:3;176:10;171:3;164:23;98:2;93:3;89:12;82:19;;123:2;118:3;114:12;107:19;;148:2;143:3;139:12;132:19;;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;8937:22:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8920:39;;8976:24;8993:6;8976:16;:24::i;:::-;8969:31;;;;;;;;;;;;8607:400;;;;;;;;:::o;5262:396::-;5429:27;366:5:0;;;;;;;;;;;352:19;;:10;:19;;;344:28;;;;;;;;5371:6:1;2102:1;2070:34;;:6;:14;2077:6;2070:14;;;;;;;;;;;;;;;:20;;;;;;;;;;;;:34;;;;2062:43;;;;;;;;5406:7;2460:1;2426:36;;:13;2440:7;2426:22;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;51:19;36:153;;;182:3;176:10;171:3;164:23;98:2;93:3;89:12;82:19;;123:2;118:3;114:12;107:19;;148:2;143:3;139:12;132:19;;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;2426:22:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:36;;;2418:45;;;;;;;;5459:6;:14;5466:6;5459:14;;;;;;;;;;;;;;;5429:44;;5504:6;5483:51;;;5512:5;:12;;5526:7;5483:51;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;5483:51:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5551:13;5565:5;:12;;5551:27;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5544:34;;;;;;;;;;;5613:6;5588:13;5602:7;5588:22;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;51:19;36:153;;;182:3;176:10;171:3;164:23;98:2;93:3;89:12;82:19;;123:2;118:3;114:12;107:19;;148:2;143:3;139:12;132:19;;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;5588:22:1;;;;;;;;;;;;;;;;;;;;;;:31;;;;;;;;;;;;;;;;;;5644:7;5629:5;:12;;:22;;;;;;;;;;;;:::i;:::-;;2115:1;382::0;5262:396:1;;;:::o;396:140:0:-;366:5;;;;;;;;;;;352:19;;:10;:19;;;344:28;;;;;;;;485:1;465:22;;:8;:22;;;;461:69;;;511:8;503:5;;:16;;;;;;;;;;;;;;;;;;461:69;396:140;:::o;886:8364:1:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o"
- }
- }
- },
- "sources": {
- "previous/Ownable/Ownable_v1.sol": {
- "id": 0
- },
- "previous/TokenRegistry/TokenRegistry.sol": {
- "id": 1
- }
- },
- "sourceCodes": {
- "previous/Ownable/Ownable_v1.sol": "pragma solidity ^0.4.11;\n\n/*\n * Ownable\n *\n * Base contract with an owner.\n * Provides onlyOwner modifier, which prevents function from running if it is called by anyone other than the owner.\n */\n\ncontract Ownable_v1 {\n address public owner;\n\n function Ownable_v1() {\n owner = msg.sender;\n }\n\n modifier onlyOwner() {\n require(msg.sender == owner);\n _;\n }\n\n function transferOwnership(address newOwner) onlyOwner {\n if (newOwner != address(0)) {\n owner = newOwner;\n }\n }\n}\n",
- "previous/TokenRegistry/TokenRegistry.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.4.11;\n\nimport { Ownable_v1 as Ownable } from \"../Ownable/Ownable_v1.sol\";\n\n/// @title Token Registry - Stores metadata associated with ERC20 tokens. See ERC22 https://github.com/ethereum/EIPs/issues/22\n/// @author Amir Bandeali - <amir@0xProject.com>, Will Warren - <will@0xProject.com>\ncontract TokenRegistry is Ownable {\n\n event LogAddToken(\n address indexed token,\n string name,\n string symbol,\n uint8 decimals,\n bytes ipfsHash,\n bytes swarmHash\n );\n\n event LogRemoveToken(\n address indexed token,\n string name,\n string symbol,\n uint8 decimals,\n bytes ipfsHash,\n bytes swarmHash\n );\n\n event LogTokenNameChange(address indexed token, string oldName, string newName);\n event LogTokenSymbolChange(address indexed token, string oldSymbol, string newSymbol);\n event LogTokenIpfsHashChange(address indexed token, bytes oldIpfsHash, bytes newIpfsHash);\n event LogTokenSwarmHashChange(address indexed token, bytes oldSwarmHash, bytes newSwarmHash);\n\n mapping (address => TokenMetadata) public tokens;\n mapping (string => address) tokenBySymbol;\n mapping (string => address) tokenByName;\n\n address[] public tokenAddresses;\n\n struct TokenMetadata {\n address token;\n string name;\n string symbol;\n uint8 decimals;\n bytes ipfsHash;\n bytes swarmHash;\n }\n\n modifier tokenExists(address _token) {\n require(tokens[_token].token != address(0));\n _;\n }\n\n modifier tokenDoesNotExist(address _token) {\n require(tokens[_token].token == address(0));\n _;\n }\n\n modifier nameDoesNotExist(string _name) {\n require(tokenByName[_name] == address(0));\n _;\n }\n\n modifier symbolDoesNotExist(string _symbol) {\n require(tokenBySymbol[_symbol] == address(0));\n _;\n }\n\n modifier addressNotNull(address _address) {\n require(_address != address(0));\n _;\n }\n\n\n /// @dev Allows owner to add a new token to the registry.\n /// @param _token Address of new token.\n /// @param _name Name of new token.\n /// @param _symbol Symbol for new token.\n /// @param _decimals Number of decimals, divisibility of new token.\n /// @param _ipfsHash IPFS hash of token icon.\n /// @param _swarmHash Swarm hash of token icon.\n function addToken(\n address _token,\n string _name,\n string _symbol,\n uint8 _decimals,\n bytes _ipfsHash,\n bytes _swarmHash)\n public\n onlyOwner\n tokenDoesNotExist(_token)\n addressNotNull(_token)\n symbolDoesNotExist(_symbol)\n nameDoesNotExist(_name)\n {\n tokens[_token] = TokenMetadata({\n token: _token,\n name: _name,\n symbol: _symbol,\n decimals: _decimals,\n ipfsHash: _ipfsHash,\n swarmHash: _swarmHash\n });\n tokenAddresses.push(_token);\n tokenBySymbol[_symbol] = _token;\n tokenByName[_name] = _token;\n LogAddToken(\n _token,\n _name,\n _symbol,\n _decimals,\n _ipfsHash,\n _swarmHash\n );\n }\n\n /// @dev Allows owner to remove an existing token from the registry.\n /// @param _token Address of existing token.\n function removeToken(address _token, uint _index)\n public\n onlyOwner\n tokenExists(_token)\n {\n require(tokenAddresses[_index] == _token);\n\n tokenAddresses[_index] = tokenAddresses[tokenAddresses.length - 1];\n tokenAddresses.length -= 1;\n\n TokenMetadata storage token = tokens[_token];\n LogRemoveToken(\n token.token,\n token.name,\n token.symbol,\n token.decimals,\n token.ipfsHash,\n token.swarmHash\n );\n delete tokenBySymbol[token.symbol];\n delete tokenByName[token.name];\n delete tokens[_token];\n }\n\n /// @dev Allows owner to modify an existing token's name.\n /// @param _token Address of existing token.\n /// @param _name New name.\n function setTokenName(address _token, string _name)\n public\n onlyOwner\n tokenExists(_token)\n nameDoesNotExist(_name)\n {\n TokenMetadata storage token = tokens[_token];\n LogTokenNameChange(_token, token.name, _name);\n delete tokenByName[token.name];\n tokenByName[_name] = _token;\n token.name = _name;\n }\n\n /// @dev Allows owner to modify an existing token's symbol.\n /// @param _token Address of existing token.\n /// @param _symbol New symbol.\n function setTokenSymbol(address _token, string _symbol)\n public\n onlyOwner\n tokenExists(_token)\n symbolDoesNotExist(_symbol)\n {\n TokenMetadata storage token = tokens[_token];\n LogTokenSymbolChange(_token, token.symbol, _symbol);\n delete tokenBySymbol[token.symbol];\n tokenBySymbol[_symbol] = _token;\n token.symbol = _symbol;\n }\n\n /// @dev Allows owner to modify an existing token's IPFS hash.\n /// @param _token Address of existing token.\n /// @param _ipfsHash New IPFS hash.\n function setTokenIpfsHash(address _token, bytes _ipfsHash)\n public\n onlyOwner\n tokenExists(_token)\n {\n TokenMetadata storage token = tokens[_token];\n LogTokenIpfsHashChange(_token, token.ipfsHash, _ipfsHash);\n token.ipfsHash = _ipfsHash;\n }\n\n /// @dev Allows owner to modify an existing token's Swarm hash.\n /// @param _token Address of existing token.\n /// @param _swarmHash New Swarm hash.\n function setTokenSwarmHash(address _token, bytes _swarmHash)\n public\n onlyOwner\n tokenExists(_token)\n {\n TokenMetadata storage token = tokens[_token];\n LogTokenSwarmHashChange(_token, token.swarmHash, _swarmHash);\n token.swarmHash = _swarmHash;\n }\n\n /*\n * Web3 call functions\n */\n\n /// @dev Provides a registered token's address when given the token symbol.\n /// @param _symbol Symbol of registered token.\n /// @return Token's address.\n function getTokenAddressBySymbol(string _symbol) constant returns (address) {\n return tokenBySymbol[_symbol];\n }\n\n /// @dev Provides a registered token's address when given the token name.\n /// @param _name Name of registered token.\n /// @return Token's address.\n function getTokenAddressByName(string _name) constant returns (address) {\n return tokenByName[_name];\n }\n\n /// @dev Provides a registered token's metadata, looked up by address.\n /// @param _token Address of registered token.\n /// @return Token metadata.\n function getTokenMetaData(address _token)\n public\n constant\n returns (\n address, //tokenAddress\n string, //name\n string, //symbol\n uint8, //decimals\n bytes, //ipfsHash\n bytes //swarmHash\n )\n {\n TokenMetadata memory token = tokens[_token];\n return (\n token.token,\n token.name,\n token.symbol,\n token.decimals,\n token.ipfsHash,\n token.swarmHash\n );\n }\n\n /// @dev Provides a registered token's metadata, looked up by name.\n /// @param _name Name of registered token.\n /// @return Token metadata.\n function getTokenByName(string _name)\n public\n constant\n returns (\n address, //tokenAddress\n string, //name\n string, //symbol\n uint8, //decimals\n bytes, //ipfsHash\n bytes //swarmHash\n )\n {\n address _token = tokenByName[_name];\n return getTokenMetaData(_token);\n }\n\n /// @dev Provides a registered token's metadata, looked up by symbol.\n /// @param _symbol Symbol of registered token.\n /// @return Token metadata.\n function getTokenBySymbol(string _symbol)\n public\n constant\n returns (\n address, //tokenAddress\n string, //name\n string, //symbol\n uint8, //decimals\n bytes, //ipfsHash\n bytes //swarmHash\n )\n {\n address _token = tokenBySymbol[_symbol];\n return getTokenMetaData(_token);\n }\n\n /// @dev Returns an array containing all token addresses.\n /// @return Array of token addresses.\n function getTokenAddresses()\n public\n constant\n returns (address[])\n {\n return tokenAddresses;\n }\n}\n"
- },
- "sourceTreeHashHex": "0x63a45b019e6836d66dc6b82f872f30b7cb9375dca2fd0b2e5975a1ceb586a40f",
- "compiler": {
- "name": "solc",
- "version": "0.4.23",
- "settings": {
- "outputSelection": {
- "*": {
- "*": [
- "abi",
- "evm.bytecode.object",
- "evm.bytecode.sourceMap",
- "evm.deployedBytecode.object",
- "evm.deployedBytecode.sourceMap"
- ]
- }
- }
- }
- },
- "networks": {
- "50": {
- "address": "0x0b1ba0af832d7c05fd64161e0db78e85978e8082",
- "links": {},
- "constructorArgs": "[]"
- }
- }
-} \ No newline at end of file
diff --git a/packages/migrations/artifacts/1.0.0/TokenTransferProxy_v1.json b/packages/migrations/artifacts/1.0.0/TokenTransferProxy_v1.json
deleted file mode 100644
index 4cea4801a..000000000
--- a/packages/migrations/artifacts/1.0.0/TokenTransferProxy_v1.json
+++ /dev/null
@@ -1,236 +0,0 @@
-{
- "schemaVersion": "2.0.0",
- "contractName": "TokenTransferProxy_v1",
- "compilerOutput": {
- "abi": [
- {
- "constant": false,
- "inputs": [
- {
- "name": "token",
- "type": "address"
- },
- {
- "name": "from",
- "type": "address"
- },
- {
- "name": "to",
- "type": "address"
- },
- {
- "name": "value",
- "type": "uint256"
- }
- ],
- "name": "transferFrom",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "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": 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": true,
- "inputs": [
- {
- "name": "",
- "type": "address"
- }
- ],
- "name": "authorized",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "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"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "target",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "caller",
- "type": "address"
- }
- ],
- "name": "LogAuthorizedAddressAdded",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "target",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "caller",
- "type": "address"
- }
- ],
- "name": "LogAuthorizedAddressRemoved",
- "type": "event"
- }
- ],
- "evm": {
- "bytecode": {
- "linkReferences": {},
- "object": "0x6080604052336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610bdc806100536000396000f30060806040526004361061008e576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806315dacbea1461009357806342f1181e14610138578063494503d41461017b57806370712939146101e85780638da5cb5b1461022b578063b918161114610282578063d39de6e9146102dd578063f2fde38b14610349575b600080fd5b34801561009f57600080fd5b5061011e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061038c565b604051808215151515815260200191505060405180910390f35b34801561014457600080fd5b50610179600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610502565b005b34801561018757600080fd5b506101a6600480360381019080803590602001909291905050506106d2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156101f457600080fd5b50610229600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610710565b005b34801561023757600080fd5b506102406109b7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561028e57600080fd5b506102c3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109dc565b604051808215151515815260200191505060405180910390f35b3480156102e957600080fd5b506102f26109fc565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561033557808201518184015260208101905061031a565b505050509050019250505060405180910390f35b34801561035557600080fd5b5061038a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a8a565b005b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156103e657600080fd5b8473ffffffffffffffffffffffffffffffffffffffff166323b872dd8585856040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1580156104bd57600080fd5b505af11580156104d1573d6000803e3d6000fd5b505050506040513d60208110156104e757600080fd5b81019080805190602001909291905050509050949350505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561055d57600080fd5b80600160008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156105b757600080fd5b60018060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060028290806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550503373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f94bb87f4c15c4587ff559a7584006fa01ddf9299359be6b512b94527aa961aca60405160405180910390a35050565b6002818154811015156106e157fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561076d57600080fd5b81600160008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156107c657600080fd5b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff0219169055600091505b600280549050821015610958578273ffffffffffffffffffffffffffffffffffffffff1660028381548110151561084d57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561094b5760026001600280549050038154811015156108ab57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166002838154811015156108e557fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060016002818180549050039150816109459190610b5f565b50610958565b818060010192505061081a565b3373ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167ff5b347a1e40749dd050f5f07fbdbeb7e3efa9756903044dd29401fd1d4bb4a1c60405160405180910390a3505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60016020528060005260406000206000915054906101000a900460ff1681565b60606002805480602002602001604051908101604052809291908181526020018280548015610a8057602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311610a36575b5050505050905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ae557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515610b5c57806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b815481835581811115610b8657818360005260206000209182019101610b859190610b8b565b5b505050565b610bad91905b80821115610ba9576000816000905550600101610b91565b5090565b905600a165627a7a7230582023b41e8c3699cfeed714357f50f8f8caed14f2a0ac409b12b137198d0895e0dc0029",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLER PUSH1 0x0 DUP1 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH2 0xBDC DUP1 PUSH2 0x53 PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN STOP PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x8E JUMPI PUSH1 0x0 CALLDATALOAD PUSH29 0x100000000000000000000000000000000000000000000000000000000 SWAP1 DIV PUSH4 0xFFFFFFFF AND DUP1 PUSH4 0x15DACBEA EQ PUSH2 0x93 JUMPI DUP1 PUSH4 0x42F1181E EQ PUSH2 0x138 JUMPI DUP1 PUSH4 0x494503D4 EQ PUSH2 0x17B JUMPI DUP1 PUSH4 0x70712939 EQ PUSH2 0x1E8 JUMPI DUP1 PUSH4 0x8DA5CB5B EQ PUSH2 0x22B JUMPI DUP1 PUSH4 0xB9181611 EQ PUSH2 0x282 JUMPI DUP1 PUSH4 0xD39DE6E9 EQ PUSH2 0x2DD JUMPI DUP1 PUSH4 0xF2FDE38B EQ PUSH2 0x349 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x9F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x11E PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x38C JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x144 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x179 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x502 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x187 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1A6 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x6D2 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1F4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x229 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x710 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x237 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x240 PUSH2 0x9B7 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x28E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2C3 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x9DC JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2E9 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2F2 PUSH2 0x9FC JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE DUP4 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x335 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x31A JUMP JUMPDEST POP POP POP POP SWAP1 POP ADD SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x355 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x38A PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xA8A JUMP JUMPDEST STOP JUMPDEST PUSH1 0x0 PUSH1 0x1 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO ISZERO PUSH2 0x3E6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0x23B872DD DUP6 DUP6 DUP6 PUSH1 0x40 MLOAD DUP5 PUSH4 0xFFFFFFFF AND PUSH29 0x100000000000000000000000000000000000000000000000000000000 MUL DUP2 MSTORE PUSH1 0x4 ADD DUP1 DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP4 POP POP POP POP PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x4BD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x4D1 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x20 DUP2 LT ISZERO PUSH2 0x4E7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 ADD SWAP1 DUP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP SWAP1 POP SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x55D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 PUSH1 0x1 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO ISZERO ISZERO PUSH2 0x5B7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x1 DUP1 PUSH1 0x0 DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP PUSH1 0x2 DUP3 SWAP1 DUP1 PUSH1 0x1 DUP2 SLOAD ADD DUP1 DUP3 SSTORE DUP1 SWAP2 POP POP SWAP1 PUSH1 0x1 DUP3 SUB SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SWAP2 SWAP3 SWAP1 SWAP2 SWAP1 SWAP2 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP POP CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x94BB87F4C15C4587FF559A7584006FA01DDF9299359BE6B512B94527AA961ACA PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 POP POP JUMP JUMPDEST PUSH1 0x2 DUP2 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x6E1 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP2 POP SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x76D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 PUSH1 0x1 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO ISZERO PUSH2 0x7C6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x1 PUSH1 0x0 DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD SWAP1 PUSH1 0xFF MUL NOT AND SWAP1 SSTORE PUSH1 0x0 SWAP2 POP JUMPDEST PUSH1 0x2 DUP1 SLOAD SWAP1 POP DUP3 LT ISZERO PUSH2 0x958 JUMPI DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x2 DUP4 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x84D JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0x94B JUMPI PUSH1 0x2 PUSH1 0x1 PUSH1 0x2 DUP1 SLOAD SWAP1 POP SUB DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x8AB JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x2 DUP4 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x8E5 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH1 0x1 PUSH1 0x2 DUP2 DUP2 DUP1 SLOAD SWAP1 POP SUB SWAP2 POP DUP2 PUSH2 0x945 SWAP2 SWAP1 PUSH2 0xB5F JUMP JUMPDEST POP PUSH2 0x958 JUMP JUMPDEST DUP2 DUP1 PUSH1 0x1 ADD SWAP3 POP POP PUSH2 0x81A JUMP JUMPDEST CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xF5B347A1E40749DD050F5F07FBDBEB7E3EFA9756903044DD29401FD1D4BB4A1C PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x20 MSTORE DUP1 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP2 POP SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x2 DUP1 SLOAD DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD DUP1 ISZERO PUSH2 0xA80 JUMPI PUSH1 0x20 MUL DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 PUSH1 0x1 ADD SWAP1 DUP1 DUP4 GT PUSH2 0xA36 JUMPI JUMPDEST POP POP POP POP POP SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0xAE5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0xB5C JUMPI DUP1 PUSH1 0x0 DUP1 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP JUMPDEST POP JUMP JUMPDEST DUP2 SLOAD DUP2 DUP4 SSTORE DUP2 DUP2 GT ISZERO PUSH2 0xB86 JUMPI DUP2 DUP4 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP2 DUP3 ADD SWAP2 ADD PUSH2 0xB85 SWAP2 SWAP1 PUSH2 0xB8B JUMP JUMPDEST JUMPDEST POP POP POP JUMP JUMPDEST PUSH2 0xBAD SWAP2 SWAP1 JUMPDEST DUP1 DUP3 GT ISZERO PUSH2 0xBA9 JUMPI PUSH1 0x0 DUP2 PUSH1 0x0 SWAP1 SSTORE POP PUSH1 0x1 ADD PUSH2 0xB91 JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST SWAP1 JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 0x23 0xb4 0x1e DUP13 CALLDATASIZE SWAP10 0xcf 0xee 0xd7 EQ CALLDATALOAD PUSH32 0x50F8F8CAED14F2A0AC409B12B137198D0895E0DC002900000000000000000000 ",
- "sourceMap": "944:2478:2:-;;;290:10:0;282:5;;:18;;;;;;;;;;;;;;;;;;944:2478:2;;;;;;"
- },
- "deployedBytecode": {
- "linkReferences": {},
- "object": "0x60806040526004361061008e576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806315dacbea1461009357806342f1181e14610138578063494503d41461017b57806370712939146101e85780638da5cb5b1461022b578063b918161114610282578063d39de6e9146102dd578063f2fde38b14610349575b600080fd5b34801561009f57600080fd5b5061011e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061038c565b604051808215151515815260200191505060405180910390f35b34801561014457600080fd5b50610179600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610502565b005b34801561018757600080fd5b506101a6600480360381019080803590602001909291905050506106d2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156101f457600080fd5b50610229600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610710565b005b34801561023757600080fd5b506102406109b7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561028e57600080fd5b506102c3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109dc565b604051808215151515815260200191505060405180910390f35b3480156102e957600080fd5b506102f26109fc565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561033557808201518184015260208101905061031a565b505050509050019250505060405180910390f35b34801561035557600080fd5b5061038a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a8a565b005b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156103e657600080fd5b8473ffffffffffffffffffffffffffffffffffffffff166323b872dd8585856040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1580156104bd57600080fd5b505af11580156104d1573d6000803e3d6000fd5b505050506040513d60208110156104e757600080fd5b81019080805190602001909291905050509050949350505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561055d57600080fd5b80600160008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156105b757600080fd5b60018060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060028290806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550503373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f94bb87f4c15c4587ff559a7584006fa01ddf9299359be6b512b94527aa961aca60405160405180910390a35050565b6002818154811015156106e157fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561076d57600080fd5b81600160008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156107c657600080fd5b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff0219169055600091505b600280549050821015610958578273ffffffffffffffffffffffffffffffffffffffff1660028381548110151561084d57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561094b5760026001600280549050038154811015156108ab57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166002838154811015156108e557fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060016002818180549050039150816109459190610b5f565b50610958565b818060010192505061081a565b3373ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167ff5b347a1e40749dd050f5f07fbdbeb7e3efa9756903044dd29401fd1d4bb4a1c60405160405180910390a3505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60016020528060005260406000206000915054906101000a900460ff1681565b60606002805480602002602001604051908101604052809291908181526020018280548015610a8057602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311610a36575b5050505050905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ae557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515610b5c57806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b815481835581811115610b8657818360005260206000209182019101610b859190610b8b565b5b505050565b610bad91905b80821115610ba9576000816000905550600101610b91565b5090565b905600a165627a7a7230582023b41e8c3699cfeed714357f50f8f8caed14f2a0ac409b12b137198d0895e0dc0029",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x8E JUMPI PUSH1 0x0 CALLDATALOAD PUSH29 0x100000000000000000000000000000000000000000000000000000000 SWAP1 DIV PUSH4 0xFFFFFFFF AND DUP1 PUSH4 0x15DACBEA EQ PUSH2 0x93 JUMPI DUP1 PUSH4 0x42F1181E EQ PUSH2 0x138 JUMPI DUP1 PUSH4 0x494503D4 EQ PUSH2 0x17B JUMPI DUP1 PUSH4 0x70712939 EQ PUSH2 0x1E8 JUMPI DUP1 PUSH4 0x8DA5CB5B EQ PUSH2 0x22B JUMPI DUP1 PUSH4 0xB9181611 EQ PUSH2 0x282 JUMPI DUP1 PUSH4 0xD39DE6E9 EQ PUSH2 0x2DD JUMPI DUP1 PUSH4 0xF2FDE38B EQ PUSH2 0x349 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x9F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x11E PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x38C JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x144 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x179 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x502 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x187 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1A6 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x6D2 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1F4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x229 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x710 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x237 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x240 PUSH2 0x9B7 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x28E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2C3 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x9DC JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2E9 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2F2 PUSH2 0x9FC JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE DUP4 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x335 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x31A JUMP JUMPDEST POP POP POP POP SWAP1 POP ADD SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x355 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x38A PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xA8A JUMP JUMPDEST STOP JUMPDEST PUSH1 0x0 PUSH1 0x1 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO ISZERO PUSH2 0x3E6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0x23B872DD DUP6 DUP6 DUP6 PUSH1 0x40 MLOAD DUP5 PUSH4 0xFFFFFFFF AND PUSH29 0x100000000000000000000000000000000000000000000000000000000 MUL DUP2 MSTORE PUSH1 0x4 ADD DUP1 DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP4 POP POP POP POP PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x4BD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x4D1 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x20 DUP2 LT ISZERO PUSH2 0x4E7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 ADD SWAP1 DUP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP SWAP1 POP SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x55D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 PUSH1 0x1 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO ISZERO ISZERO PUSH2 0x5B7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x1 DUP1 PUSH1 0x0 DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP PUSH1 0x2 DUP3 SWAP1 DUP1 PUSH1 0x1 DUP2 SLOAD ADD DUP1 DUP3 SSTORE DUP1 SWAP2 POP POP SWAP1 PUSH1 0x1 DUP3 SUB SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SWAP2 SWAP3 SWAP1 SWAP2 SWAP1 SWAP2 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP POP CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x94BB87F4C15C4587FF559A7584006FA01DDF9299359BE6B512B94527AA961ACA PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 POP POP JUMP JUMPDEST PUSH1 0x2 DUP2 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x6E1 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP2 POP SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x76D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 PUSH1 0x1 PUSH1 0x0 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO ISZERO PUSH2 0x7C6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x1 PUSH1 0x0 DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD SWAP1 PUSH1 0xFF MUL NOT AND SWAP1 SSTORE PUSH1 0x0 SWAP2 POP JUMPDEST PUSH1 0x2 DUP1 SLOAD SWAP1 POP DUP3 LT ISZERO PUSH2 0x958 JUMPI DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x2 DUP4 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x84D JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0x94B JUMPI PUSH1 0x2 PUSH1 0x1 PUSH1 0x2 DUP1 SLOAD SWAP1 POP SUB DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x8AB JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x2 DUP4 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x8E5 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH1 0x1 PUSH1 0x2 DUP2 DUP2 DUP1 SLOAD SWAP1 POP SUB SWAP2 POP DUP2 PUSH2 0x945 SWAP2 SWAP1 PUSH2 0xB5F JUMP JUMPDEST POP PUSH2 0x958 JUMP JUMPDEST DUP2 DUP1 PUSH1 0x1 ADD SWAP3 POP POP PUSH2 0x81A JUMP JUMPDEST CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xF5B347A1E40749DD050F5F07FBDBEB7E3EFA9756903044DD29401FD1D4BB4A1C PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x20 MSTORE DUP1 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP2 POP SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x2 DUP1 SLOAD DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD DUP1 ISZERO PUSH2 0xA80 JUMPI PUSH1 0x20 MUL DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 PUSH1 0x1 ADD SWAP1 DUP1 DUP4 GT PUSH2 0xA36 JUMPI JUMPDEST POP POP POP POP POP SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0xAE5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0xB5C JUMPI DUP1 PUSH1 0x0 DUP1 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP JUMPDEST POP JUMP JUMPDEST DUP2 SLOAD DUP2 DUP4 SSTORE DUP2 DUP2 GT ISZERO PUSH2 0xB86 JUMPI DUP2 DUP4 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP2 DUP3 ADD SWAP2 ADD PUSH2 0xB85 SWAP2 SWAP1 PUSH2 0xB8B JUMP JUMPDEST JUMPDEST POP POP POP JUMP JUMPDEST PUSH2 0xBAD SWAP2 SWAP1 JUMPDEST DUP1 DUP3 GT ISZERO PUSH2 0xBA9 JUMPI PUSH1 0x0 DUP2 PUSH1 0x0 SWAP1 SSTORE POP PUSH1 0x1 ADD PUSH2 0xB91 JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST SWAP1 JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 0x23 0xb4 0x1e DUP13 CALLDATASIZE SWAP10 0xcf 0xee 0xd7 EQ CALLDATALOAD PUSH32 0x50F8F8CAED14F2A0AC409B12B137198D0895E0DC002900000000000000000000 ",
- "sourceMap": "944:2478:2:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2902:239;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2902:239:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1749:250;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1749:250:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;1421:28;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1421:28:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2113:476;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2113:476:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;223:20:0;;8:9:-1;5:2;;;30:1;27;20:12;5:2;223:20:0;;;;;;;;;;;;;;;;;;;;;;;;;;;1372:43:2;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1372:43:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3287:133;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3287:133:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;3287:133:2;;;;;;;;;;;;;;;;;396:140:0;;8:9:-1;5:2;;;30:1;27;20:12;5:2;396:140:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;2902:239:2;3065:4;1115:10;:22;1126:10;1115:22;;;;;;;;;;;;;;;;;;;;;;;;;1107:31;;;;;;;;3098:5;3092:25;;;3118:4;3124:2;3128:5;3092:42;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3092:42:2;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3092:42:2;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;3092:42:2;;;;;;;;;;;;;;;;3085:49;;2902:239;;;;;;:::o;1749:250::-;366:5:0;;;;;;;;;;;352:19;;:10;:19;;;344:28;;;;;;;;1856:6:2;1329:10;:18;1340:6;1329:18;;;;;;;;;;;;;;;;;;;;;;;;;1328:19;1320:28;;;;;;;;1899:4;1878:10;:18;1889:6;1878:18;;;;;;;;;;;;;;;;:25;;;;;;;;;;;;;;;;;;1913:11;1930:6;1913:24;;39:1:-1;33:3;27:10;23:18;57:10;52:3;45:23;79:10;72:17;;0:93;1913:24:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1981:10;1947:45;;1973:6;1947:45;;;;;;;;;;;;382:1:0;1749:250:2;:::o;1421:28::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;2113:476::-;2282:6;366:5:0;;;;;;;;;;;352:19;;:10;:19;;;344:28;;;;;;;;2220:6:2;1222:10;:18;1233:6;1222:18;;;;;;;;;;;;;;;;;;;;;;;;;1214:27;;;;;;;;2249:10;:18;2260:6;2249:18;;;;;;;;;;;;;;;;2242:25;;;;;;;;;;;2291:1;2282:10;;2277:249;2298:11;:18;;;;2294:1;:22;2277:249;;;2359:6;2341:24;;:11;2353:1;2341:14;;;;;;;;;;;;;;;;;;;;;;;;;;;:24;;;2337:179;;;2402:11;2435:1;2414:11;:18;;;;:22;2402:35;;;;;;;;;;;;;;;;;;;;;;;;;;;2385:11;2397:1;2385:14;;;;;;;;;;;;;;;;;;:52;;;;;;;;;;;;;;;;;;2477:1;2455:11;:23;;;;;;;;;;;;;;:::i;:::-;;2496:5;;2337:179;2318:3;;;;;;;2277:249;;;2571:10;2535:47;;2563:6;2535:47;;;;;;;;;;;;382:1:0;2113:476:2;;:::o;223:20:0:-;;;;;;;;;;;;;:::o;1372:43:2:-;;;;;;;;;;;;;;;;;;;;;;:::o;3287:133::-;3370:9;3402:11;3395:18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3287:133;:::o;396:140:0:-;366:5;;;;;;;;;;;352:19;;:10;:19;;;344:28;;;;;;;;485:1;465:22;;:8;:22;;;;461:69;;;511:8;503:5;;:16;;;;;;;;;;;;;;;;;;461:69;396:140;:::o;944:2478:2:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o"
- }
- }
- },
- "sources": {
- "previous/Ownable/Ownable_v1.sol": {
- "id": 0
- },
- "previous/Token/Token_v1.sol": {
- "id": 1
- },
- "previous/TokenTransferProxy/TokenTransferProxy_v1.sol": {
- "id": 2
- }
- },
- "sourceCodes": {
- "previous/Ownable/Ownable_v1.sol": "pragma solidity ^0.4.11;\n\n/*\n * Ownable\n *\n * Base contract with an owner.\n * Provides onlyOwner modifier, which prevents function from running if it is called by anyone other than the owner.\n */\n\ncontract Ownable_v1 {\n address public owner;\n\n function Ownable_v1() {\n owner = msg.sender;\n }\n\n modifier onlyOwner() {\n require(msg.sender == owner);\n _;\n }\n\n function transferOwnership(address newOwner) onlyOwner {\n if (newOwner != address(0)) {\n owner = newOwner;\n }\n }\n}\n",
- "previous/Token/Token_v1.sol": "pragma solidity ^0.4.11;\n\ncontract Token_v1 {\n\n /// @return total amount of tokens\n function totalSupply() constant returns (uint supply) {}\n\n /// @param _owner The address from which the balance will be retrieved\n /// @return The balance\n function balanceOf(address _owner) constant returns (uint balance) {}\n\n /// @notice send `_value` token to `_to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return Whether the transfer was successful or not\n function transfer(address _to, uint _value) returns (bool success) {}\n\n /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return Whether the transfer was successful or not\n function transferFrom(address _from, address _to, uint _value) returns (bool success) {}\n\n /// @notice `msg.sender` approves `_addr` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Whether the approval was successful or not\n function approve(address _spender, uint _value) returns (bool success) {}\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender) constant returns (uint remaining) {}\n\n event Transfer(address indexed _from, address indexed _to, uint _value);\n event Approval(address indexed _owner, address indexed _spender, uint _value);\n}\n\n",
- "previous/TokenTransferProxy/TokenTransferProxy_v1.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.4.11;\n\nimport { Token_v1 as Token } from \"../Token/Token_v1.sol\";\nimport { Ownable_v1 as Ownable } from \"../Ownable/Ownable_v1.sol\";\n\n/// @title TokenTransferProxy - Transfers tokens on behalf of contracts that have been approved via decentralized governance.\n/// @author Amir Bandeali - <amir@0xProject.com>, Will Warren - <will@0xProject.com>\ncontract TokenTransferProxy_v1 is Ownable {\n\n /// @dev Only authorized addresses can invoke functions with this modifier.\n modifier onlyAuthorized {\n require(authorized[msg.sender]);\n _;\n }\n\n modifier targetAuthorized(address target) {\n require(authorized[target]);\n _;\n }\n\n modifier targetNotAuthorized(address target) {\n require(!authorized[target]);\n _;\n }\n\n mapping (address => bool) public authorized;\n address[] public authorities;\n\n event LogAuthorizedAddressAdded(address indexed target, address indexed caller);\n event LogAuthorizedAddressRemoved(address indexed target, address indexed caller);\n\n /*\n * Public functions\n */\n\n /// @dev Authorizes an address.\n /// @param target Address to authorize.\n function addAuthorizedAddress(address target)\n public\n onlyOwner\n targetNotAuthorized(target)\n {\n authorized[target] = true;\n authorities.push(target);\n LogAuthorizedAddressAdded(target, msg.sender);\n }\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n function removeAuthorizedAddress(address target)\n public\n onlyOwner\n targetAuthorized(target)\n {\n delete authorized[target];\n for (uint i = 0; i < authorities.length; i++) {\n if (authorities[i] == target) {\n authorities[i] = authorities[authorities.length - 1];\n authorities.length -= 1;\n break;\n }\n }\n LogAuthorizedAddressRemoved(target, msg.sender);\n }\n\n /// @dev Calls into ERC20 Token contract, invoking transferFrom.\n /// @param token Address of token to transfer.\n /// @param from Address to transfer token from.\n /// @param to Address to transfer token to.\n /// @param value Amount of token to transfer.\n /// @return Success of transfer.\n function transferFrom(\n address token,\n address from,\n address to,\n uint value)\n public\n onlyAuthorized\n returns (bool)\n {\n return Token(token).transferFrom(from, to, value);\n }\n\n /*\n * Public constant functions\n */\n\n /// @dev Gets all authorized addresses.\n /// @return Array of authorized addresses.\n function getAuthorizedAddresses()\n public\n constant\n returns (address[])\n {\n return authorities;\n }\n}\n"
- },
- "sourceTreeHashHex": "0xfd74ea4e3996cd1614eabbb4e39605e9ba33e07f4a259c7a25fcf7b78f0930ed",
- "compiler": {
- "name": "solc",
- "version": "0.4.23",
- "settings": {
- "outputSelection": {
- "*": {
- "*": [
- "abi",
- "evm.bytecode.object",
- "evm.bytecode.sourceMap",
- "evm.deployedBytecode.object",
- "evm.deployedBytecode.sourceMap"
- ]
- }
- }
- }
- },
- "networks": {
- "50": {
- "address": "0x1dc4c1cefef38a777b15aa20260a54e584b16c48",
- "links": {},
- "constructorArgs": "[]"
- }
- }
-} \ No newline at end of file
diff --git a/packages/migrations/artifacts/1.0.0/WETH9.json b/packages/migrations/artifacts/1.0.0/WETH9.json
deleted file mode 100644
index 493fae7e5..000000000
--- a/packages/migrations/artifacts/1.0.0/WETH9.json
+++ /dev/null
@@ -1,332 +0,0 @@
-{
- "schemaVersion": "2.0.0",
- "contractName": "WETH9",
- "compilerOutput": {
- "abi": [
- {
- "constant": true,
- "inputs": [],
- "name": "name",
- "outputs": [
- {
- "name": "",
- "type": "string"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "guy",
- "type": "address"
- },
- {
- "name": "wad",
- "type": "uint256"
- }
- ],
- "name": "approve",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "totalSupply",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "src",
- "type": "address"
- },
- {
- "name": "dst",
- "type": "address"
- },
- {
- "name": "wad",
- "type": "uint256"
- }
- ],
- "name": "transferFrom",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "wad",
- "type": "uint256"
- }
- ],
- "name": "withdraw",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "decimals",
- "outputs": [
- {
- "name": "",
- "type": "uint8"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "",
- "type": "address"
- }
- ],
- "name": "balanceOf",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "symbol",
- "outputs": [
- {
- "name": "",
- "type": "string"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "dst",
- "type": "address"
- },
- {
- "name": "wad",
- "type": "uint256"
- }
- ],
- "name": "transfer",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [],
- "name": "deposit",
- "outputs": [],
- "payable": true,
- "stateMutability": "payable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "",
- "type": "address"
- },
- {
- "name": "",
- "type": "address"
- }
- ],
- "name": "allowance",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "payable": true,
- "stateMutability": "payable",
- "type": "fallback"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "src",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "guy",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "wad",
- "type": "uint256"
- }
- ],
- "name": "Approval",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "src",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "dst",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "wad",
- "type": "uint256"
- }
- ],
- "name": "Transfer",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "dst",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "wad",
- "type": "uint256"
- }
- ],
- "name": "Deposit",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "src",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "wad",
- "type": "uint256"
- }
- ],
- "name": "Withdrawal",
- "type": "event"
- }
- ],
- "evm": {
- "bytecode": {
- "linkReferences": {},
- "object": "0x60806040526040805190810160405280600d81526020017f57726170706564204574686572000000000000000000000000000000000000008152506000908051906020019061004f9291906100ca565b506040805190810160405280600481526020017f57455448000000000000000000000000000000000000000000000000000000008152506001908051906020019061009b9291906100ca565b506012600260006101000a81548160ff021916908360ff1602179055503480156100c457600080fd5b5061016f565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061010b57805160ff1916838001178555610139565b82800160010185558215610139579182015b8281111561013857825182559160200191906001019061011d565b5b509050610146919061014a565b5090565b61016c91905b80821115610168576000816000905550600101610150565b5090565b90565b610c848061017e6000396000f3006080604052600436106100af576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100b9578063095ea7b31461014957806318160ddd146101ae57806323b872dd146101d95780632e1a7d4d1461025e578063313ce5671461028b57806370a08231146102bc57806395d89b4114610313578063a9059cbb146103a3578063d0e30db014610408578063dd62ed3e14610412575b6100b7610489565b005b3480156100c557600080fd5b506100ce610526565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561010e5780820151818401526020810190506100f3565b50505050905090810190601f16801561013b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015557600080fd5b50610194600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105c4565b604051808215151515815260200191505060405180910390f35b3480156101ba57600080fd5b506101c36106b6565b6040518082815260200191505060405180910390f35b3480156101e557600080fd5b50610244600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106d5565b604051808215151515815260200191505060405180910390f35b34801561026a57600080fd5b5061028960048036038101908080359060200190929190505050610a22565b005b34801561029757600080fd5b506102a0610b55565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102c857600080fd5b506102fd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b68565b6040518082815260200191505060405180910390f35b34801561031f57600080fd5b50610328610b80565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561036857808201518184015260208101905061034d565b50505050905090810190601f1680156103955780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156103af57600080fd5b506103ee600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c1e565b604051808215151515815260200191505060405180910390f35b610410610489565b005b34801561041e57600080fd5b50610473600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c33565b6040518082815260200191505060405180910390f35b34600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055503373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a2565b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105bc5780601f10610591576101008083540402835291602001916105bc565b820191906000526020600020905b81548152906001019060200180831161059f57829003601f168201915b505050505081565b600081600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60003073ffffffffffffffffffffffffffffffffffffffff1631905090565b600081600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561072557600080fd5b3373ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141580156107fd57507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b156109185781600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561088d57600080fd5b81600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b81600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b80600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610a7057600080fd5b80600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610b03573d6000803e3d6000fd5b503373ffffffffffffffffffffffffffffffffffffffff167f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65826040518082815260200191505060405180910390a250565b600260009054906101000a900460ff1681565b60036020528060005260406000206000915090505481565b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c165780601f10610beb57610100808354040283529160200191610c16565b820191906000526020600020905b815481529060010190602001808311610bf957829003601f168201915b505050505081565b6000610c2b3384846106d5565b905092915050565b60046020528160005260406000206020528060005260406000206000915091505054815600a165627a7a72305820f807d6d272ac434b0d6824e59082e62805442ec433029fe320e7d691f701e0e70029",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x40 DUP1 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0xD DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x5772617070656420457468657200000000000000000000000000000000000000 DUP2 MSTORE POP PUSH1 0x0 SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH2 0x4F SWAP3 SWAP2 SWAP1 PUSH2 0xCA JUMP JUMPDEST POP PUSH1 0x40 DUP1 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x4 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x5745544800000000000000000000000000000000000000000000000000000000 DUP2 MSTORE POP PUSH1 0x1 SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH2 0x9B SWAP3 SWAP2 SWAP1 PUSH2 0xCA JUMP JUMPDEST POP PUSH1 0x12 PUSH1 0x2 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 PUSH1 0xFF AND MUL OR SWAP1 SSTORE POP CALLVALUE DUP1 ISZERO PUSH2 0xC4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x16F JUMP JUMPDEST DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 PUSH1 0x1F ADD PUSH1 0x20 SWAP1 DIV DUP2 ADD SWAP3 DUP3 PUSH1 0x1F LT PUSH2 0x10B JUMPI DUP1 MLOAD PUSH1 0xFF NOT AND DUP4 DUP1 ADD OR DUP6 SSTORE PUSH2 0x139 JUMP JUMPDEST DUP3 DUP1 ADD PUSH1 0x1 ADD DUP6 SSTORE DUP3 ISZERO PUSH2 0x139 JUMPI SWAP2 DUP3 ADD JUMPDEST DUP3 DUP2 GT ISZERO PUSH2 0x138 JUMPI DUP3 MLOAD DUP3 SSTORE SWAP2 PUSH1 0x20 ADD SWAP2 SWAP1 PUSH1 0x1 ADD SWAP1 PUSH2 0x11D JUMP JUMPDEST JUMPDEST POP SWAP1 POP PUSH2 0x146 SWAP2 SWAP1 PUSH2 0x14A JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST PUSH2 0x16C SWAP2 SWAP1 JUMPDEST DUP1 DUP3 GT ISZERO PUSH2 0x168 JUMPI PUSH1 0x0 DUP2 PUSH1 0x0 SWAP1 SSTORE POP PUSH1 0x1 ADD PUSH2 0x150 JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST SWAP1 JUMP JUMPDEST PUSH2 0xC84 DUP1 PUSH2 0x17E PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN STOP PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0xAF JUMPI PUSH1 0x0 CALLDATALOAD PUSH29 0x100000000000000000000000000000000000000000000000000000000 SWAP1 DIV PUSH4 0xFFFFFFFF AND DUP1 PUSH4 0x6FDDE03 EQ PUSH2 0xB9 JUMPI DUP1 PUSH4 0x95EA7B3 EQ PUSH2 0x149 JUMPI DUP1 PUSH4 0x18160DDD EQ PUSH2 0x1AE JUMPI DUP1 PUSH4 0x23B872DD EQ PUSH2 0x1D9 JUMPI DUP1 PUSH4 0x2E1A7D4D EQ PUSH2 0x25E JUMPI DUP1 PUSH4 0x313CE567 EQ PUSH2 0x28B JUMPI DUP1 PUSH4 0x70A08231 EQ PUSH2 0x2BC JUMPI DUP1 PUSH4 0x95D89B41 EQ PUSH2 0x313 JUMPI DUP1 PUSH4 0xA9059CBB EQ PUSH2 0x3A3 JUMPI DUP1 PUSH4 0xD0E30DB0 EQ PUSH2 0x408 JUMPI DUP1 PUSH4 0xDD62ED3E EQ PUSH2 0x412 JUMPI JUMPDEST PUSH2 0xB7 PUSH2 0x489 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xC5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xCE PUSH2 0x526 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE DUP4 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x10E JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0xF3 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x13B JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x155 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x194 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x5C4 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1BA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1C3 PUSH2 0x6B6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1E5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x244 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x6D5 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x26A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x289 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xA22 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x297 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2A0 PUSH2 0xB55 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 PUSH1 0xFF AND PUSH1 0xFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2C8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2FD PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xB68 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x31F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x328 PUSH2 0xB80 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE DUP4 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x368 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x34D JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x395 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3AF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x3EE PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xC1E JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x410 PUSH2 0x489 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x41E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x473 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xC33 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE PUSH1 0x3 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD ADD SWAP3 POP POP DUP2 SWAP1 SSTORE POP CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xE1FFFCC4923D04B559F4D29A8BFC6CDA04EB5B0D3C460751C2402C5C5CC9109C CALLVALUE PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x5BC JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x591 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x5BC JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x59F JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP DUP2 JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x4 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x8C5BE1E5EBEC7D5BD14F71427D1E84F3DD0314C0F7B2291E5B200AC8C7C3B925 DUP5 PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x1 SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 ADDRESS PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND BALANCE SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x3 PUSH1 0x0 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD LT ISZERO ISZERO ISZERO PUSH2 0x725 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO DUP1 ISZERO PUSH2 0x7FD JUMPI POP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 PUSH1 0x0 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD EQ ISZERO JUMPDEST ISZERO PUSH2 0x918 JUMPI DUP2 PUSH1 0x4 PUSH1 0x0 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD LT ISZERO ISZERO ISZERO PUSH2 0x88D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 PUSH1 0x4 PUSH1 0x0 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD SUB SWAP3 POP POP DUP2 SWAP1 SSTORE POP JUMPDEST DUP2 PUSH1 0x3 PUSH1 0x0 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD SUB SWAP3 POP POP DUP2 SWAP1 SSTORE POP DUP2 PUSH1 0x3 PUSH1 0x0 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD ADD SWAP3 POP POP DUP2 SWAP1 SSTORE POP DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF DUP5 PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x1 SWAP1 POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST DUP1 PUSH1 0x3 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD LT ISZERO ISZERO ISZERO PUSH2 0xA70 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 PUSH1 0x3 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD SUB SWAP3 POP POP DUP2 SWAP1 SSTORE POP CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH2 0x8FC DUP3 SWAP1 DUP2 ISZERO MUL SWAP1 PUSH1 0x40 MLOAD PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP6 DUP9 DUP9 CALL SWAP4 POP POP POP POP ISZERO DUP1 ISZERO PUSH2 0xB03 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x7FCF532C15F0A6DB0BD6D0E038BEA71D30D808C7D98CB3BF7268A95BF5081B65 DUP3 PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 POP JUMP JUMPDEST PUSH1 0x2 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH1 0x3 PUSH1 0x20 MSTORE DUP1 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP2 POP SWAP1 POP SLOAD DUP2 JUMP JUMPDEST PUSH1 0x1 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0xC16 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0xBEB JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0xC16 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0xBF9 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP DUP2 JUMP JUMPDEST PUSH1 0x0 PUSH2 0xC2B CALLER DUP5 DUP5 PUSH2 0x6D5 JUMP JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x4 PUSH1 0x20 MSTORE DUP2 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x20 MSTORE DUP1 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP2 POP SWAP2 POP POP SLOAD DUP2 JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 0xf8 SMOD 0xd6 0xd2 PUSH19 0xAC434B0D6824E59082E62805442EC433029FE3 KECCAK256 0xe7 0xd6 SWAP2 0xf7 ADD 0xe0 0xe7 STOP 0x29 ",
- "sourceMap": "712:1778:0:-;;;733:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;779:31;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;841:2;816:27;;;;;;;;;;;;;;;;;;;;712:1778;8:9:-1;5:2;;;30:1;27;20:12;5:2;712:1778:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;"
- },
- "deployedBytecode": {
- "linkReferences": {},
- "object": "0x6080604052600436106100af576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100b9578063095ea7b31461014957806318160ddd146101ae57806323b872dd146101d95780632e1a7d4d1461025e578063313ce5671461028b57806370a08231146102bc57806395d89b4114610313578063a9059cbb146103a3578063d0e30db014610408578063dd62ed3e14610412575b6100b7610489565b005b3480156100c557600080fd5b506100ce610526565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561010e5780820151818401526020810190506100f3565b50505050905090810190601f16801561013b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015557600080fd5b50610194600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105c4565b604051808215151515815260200191505060405180910390f35b3480156101ba57600080fd5b506101c36106b6565b6040518082815260200191505060405180910390f35b3480156101e557600080fd5b50610244600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106d5565b604051808215151515815260200191505060405180910390f35b34801561026a57600080fd5b5061028960048036038101908080359060200190929190505050610a22565b005b34801561029757600080fd5b506102a0610b55565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102c857600080fd5b506102fd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b68565b6040518082815260200191505060405180910390f35b34801561031f57600080fd5b50610328610b80565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561036857808201518184015260208101905061034d565b50505050905090810190601f1680156103955780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156103af57600080fd5b506103ee600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c1e565b604051808215151515815260200191505060405180910390f35b610410610489565b005b34801561041e57600080fd5b50610473600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c33565b6040518082815260200191505060405180910390f35b34600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055503373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a2565b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105bc5780601f10610591576101008083540402835291602001916105bc565b820191906000526020600020905b81548152906001019060200180831161059f57829003601f168201915b505050505081565b600081600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60003073ffffffffffffffffffffffffffffffffffffffff1631905090565b600081600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561072557600080fd5b3373ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141580156107fd57507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b156109185781600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561088d57600080fd5b81600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b81600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b80600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610a7057600080fd5b80600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610b03573d6000803e3d6000fd5b503373ffffffffffffffffffffffffffffffffffffffff167f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65826040518082815260200191505060405180910390a250565b600260009054906101000a900460ff1681565b60036020528060005260406000206000915090505481565b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c165780601f10610beb57610100808354040283529160200191610c16565b820191906000526020600020905b815481529060010190602001808311610bf957829003601f168201915b505050505081565b6000610c2b3384846106d5565b905092915050565b60046020528160005260406000206020528060005260406000206000915091505054815600a165627a7a72305820f807d6d272ac434b0d6824e59082e62805442ec433029fe320e7d691f701e0e70029",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0xAF JUMPI PUSH1 0x0 CALLDATALOAD PUSH29 0x100000000000000000000000000000000000000000000000000000000 SWAP1 DIV PUSH4 0xFFFFFFFF AND DUP1 PUSH4 0x6FDDE03 EQ PUSH2 0xB9 JUMPI DUP1 PUSH4 0x95EA7B3 EQ PUSH2 0x149 JUMPI DUP1 PUSH4 0x18160DDD EQ PUSH2 0x1AE JUMPI DUP1 PUSH4 0x23B872DD EQ PUSH2 0x1D9 JUMPI DUP1 PUSH4 0x2E1A7D4D EQ PUSH2 0x25E JUMPI DUP1 PUSH4 0x313CE567 EQ PUSH2 0x28B JUMPI DUP1 PUSH4 0x70A08231 EQ PUSH2 0x2BC JUMPI DUP1 PUSH4 0x95D89B41 EQ PUSH2 0x313 JUMPI DUP1 PUSH4 0xA9059CBB EQ PUSH2 0x3A3 JUMPI DUP1 PUSH4 0xD0E30DB0 EQ PUSH2 0x408 JUMPI DUP1 PUSH4 0xDD62ED3E EQ PUSH2 0x412 JUMPI JUMPDEST PUSH2 0xB7 PUSH2 0x489 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xC5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xCE PUSH2 0x526 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE DUP4 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x10E JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0xF3 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x13B JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x155 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x194 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x5C4 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1BA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1C3 PUSH2 0x6B6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1E5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x244 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x6D5 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x26A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x289 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xA22 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x297 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2A0 PUSH2 0xB55 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 PUSH1 0xFF AND PUSH1 0xFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2C8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2FD PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xB68 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x31F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x328 PUSH2 0xB80 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE DUP4 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x368 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x34D JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x395 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3AF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x3EE PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xC1E JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x410 PUSH2 0x489 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x41E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x473 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xC33 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE PUSH1 0x3 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD ADD SWAP3 POP POP DUP2 SWAP1 SSTORE POP CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xE1FFFCC4923D04B559F4D29A8BFC6CDA04EB5B0D3C460751C2402C5C5CC9109C CALLVALUE PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x5BC JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x591 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x5BC JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x59F JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP DUP2 JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x4 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x8C5BE1E5EBEC7D5BD14F71427D1E84F3DD0314C0F7B2291E5B200AC8C7C3B925 DUP5 PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x1 SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 ADDRESS PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND BALANCE SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x3 PUSH1 0x0 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD LT ISZERO ISZERO ISZERO PUSH2 0x725 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO DUP1 ISZERO PUSH2 0x7FD JUMPI POP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 PUSH1 0x0 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD EQ ISZERO JUMPDEST ISZERO PUSH2 0x918 JUMPI DUP2 PUSH1 0x4 PUSH1 0x0 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD LT ISZERO ISZERO ISZERO PUSH2 0x88D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 PUSH1 0x4 PUSH1 0x0 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD SUB SWAP3 POP POP DUP2 SWAP1 SSTORE POP JUMPDEST DUP2 PUSH1 0x3 PUSH1 0x0 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD SUB SWAP3 POP POP DUP2 SWAP1 SSTORE POP DUP2 PUSH1 0x3 PUSH1 0x0 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD ADD SWAP3 POP POP DUP2 SWAP1 SSTORE POP DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF DUP5 PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x1 SWAP1 POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST DUP1 PUSH1 0x3 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD LT ISZERO ISZERO ISZERO PUSH2 0xA70 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 PUSH1 0x3 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD SUB SWAP3 POP POP DUP2 SWAP1 SSTORE POP CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH2 0x8FC DUP3 SWAP1 DUP2 ISZERO MUL SWAP1 PUSH1 0x40 MLOAD PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP6 DUP9 DUP9 CALL SWAP4 POP POP POP POP ISZERO DUP1 ISZERO PUSH2 0xB03 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x7FCF532C15F0A6DB0BD6D0E038BEA71D30D808C7D98CB3BF7268A95BF5081B65 DUP3 PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 POP JUMP JUMPDEST PUSH1 0x2 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH1 0x3 PUSH1 0x20 MSTORE DUP1 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP2 POP SWAP1 POP SLOAD DUP2 JUMP JUMPDEST PUSH1 0x1 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0xC16 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0xBEB JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0xC16 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0xBF9 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP DUP2 JUMP JUMPDEST PUSH1 0x0 PUSH2 0xC2B CALLER DUP5 DUP5 PUSH2 0x6D5 JUMP JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x4 PUSH1 0x20 MSTORE DUP2 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x20 MSTORE DUP1 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP2 POP SWAP2 POP POP SLOAD DUP2 JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 0xf8 SMOD 0xd6 0xd2 PUSH19 0xAC434B0D6824E59082E62805442EC433029FE3 KECCAK256 0xe7 0xd6 SWAP2 0xf7 ADD 0xe0 0xe7 STOP 0x29 ",
- "sourceMap": "712:1778:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1281:9;:7;:9::i;:::-;712:1778;733:40;;8:9:-1;5:2;;;30:1;27;20:12;5:2;733:40:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;733:40:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1728:172;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1728:172:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1636:86;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1636:86:0;;;;;;;;;;;;;;;;;;;;;;;2033:455;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2033:455:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1432:198;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1432:198:0;;;;;;;;;;;;;;;;;;;;;;;;;;816:27;;8:9:-1;5:2;;;30:1;27;20:12;5:2;816:27:0;;;;;;;;;;;;;;;;;;;;;;;;;;;1102:65;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1102:65:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;779:31;;8:9:-1;5:2;;;30:1;27;20:12;5:2;779:31:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;779:31:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1906:121;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1906:121:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1302:125;;;;;;1173:65;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1173:65:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1302:125;1371:9;1346;:21;1356:10;1346:21;;;;;;;;;;;;;;;;:34;;;;;;;;;;;1398:10;1390:30;;;1410:9;1390:30;;;;;;;;;;;;;;;;;;1302:125::o;733:40::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;1728:172::-;1784:4;1829:3;1800:9;:21;1810:10;1800:21;;;;;;;;;;;;;;;:26;1822:3;1800:26;;;;;;;;;;;;;;;:32;;;;1863:3;1842:30;;1851:10;1842:30;;;1868:3;1842:30;;;;;;;;;;;;;;;;;;1889:4;1882:11;;1728:172;;;;:::o;1636:86::-;1680:4;1703;:12;;;1696:19;;1636:86;:::o;2033:455::-;2123:4;2169:3;2151:9;:14;2161:3;2151:14;;;;;;;;;;;;;;;;:21;;2143:30;;;;;;;;2195:10;2188:17;;:3;:17;;;;:59;;;;;2244:2;2209:9;:14;2219:3;2209:14;;;;;;;;;;;;;;;:26;2224:10;2209:26;;;;;;;;;;;;;;;;:38;;2188:59;2184:179;;;2301:3;2271:9;:14;2281:3;2271:14;;;;;;;;;;;;;;;:26;2286:10;2271:26;;;;;;;;;;;;;;;;:33;;2263:42;;;;;;;;2349:3;2319:9;:14;2329:3;2319:14;;;;;;;;;;;;;;;:26;2334:10;2319:26;;;;;;;;;;;;;;;;:33;;;;;;;;;;;2184:179;2391:3;2373:9;:14;2383:3;2373:14;;;;;;;;;;;;;;;;:21;;;;;;;;;;;2422:3;2404:9;:14;2414:3;2404:14;;;;;;;;;;;;;;;;:21;;;;;;;;;;;2450:3;2436:23;;2445:3;2436:23;;;2455:3;2436:23;;;;;;;;;;;;;;;;;;2477:4;2470:11;;2033:455;;;;;:::o;1432:198::-;1510:3;1485:9;:21;1495:10;1485:21;;;;;;;;;;;;;;;;:28;;1477:37;;;;;;;;1549:3;1524:9;:21;1534:10;1524:21;;;;;;;;;;;;;;;;:28;;;;;;;;;;;1562:10;:19;;:24;1582:3;1562:24;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1562:24:0;1607:10;1596:27;;;1619:3;1596:27;;;;;;;;;;;;;;;;;;1432:198;:::o;816:27::-;;;;;;;;;;;;;:::o;1102:65::-;;;;;;;;;;;;;;;;;:::o;779:31::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;1906:121::-;1963:4;1986:34;1999:10;2011:3;2016;1986:12;:34::i;:::-;1979:41;;1906:121;;;;:::o;1173:65::-;;;;;;;;;;;;;;;;;;;;;;;;;;:::o"
- }
- }
- },
- "sources": {
- "current/tokens/WETH9/WETH9.sol": {
- "id": 0
- }
- },
- "sourceCodes": {
- "current/tokens/WETH9/WETH9.sol": "// Copyright (C) 2015, 2016, 2017 Dapphub\n\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see <http://www.gnu.org/licenses/>.\n\npragma solidity ^0.4.18;\n\ncontract WETH9 {\n string public name = \"Wrapped Ether\";\n string public symbol = \"WETH\";\n uint8 public decimals = 18;\n\n event Approval(address indexed src, address indexed guy, uint wad);\n event Transfer(address indexed src, address indexed dst, uint wad);\n event Deposit(address indexed dst, uint wad);\n event Withdrawal(address indexed src, uint wad);\n\n mapping (address => uint) public balanceOf;\n mapping (address => mapping (address => uint)) public allowance;\n\n function() public payable {\n deposit();\n }\n function deposit() public payable {\n balanceOf[msg.sender] += msg.value;\n Deposit(msg.sender, msg.value);\n }\n function withdraw(uint wad) public {\n require(balanceOf[msg.sender] >= wad);\n balanceOf[msg.sender] -= wad;\n msg.sender.transfer(wad);\n Withdrawal(msg.sender, wad);\n }\n\n function totalSupply() public view returns (uint) {\n return this.balance;\n }\n\n function approve(address guy, uint wad) public returns (bool) {\n allowance[msg.sender][guy] = wad;\n Approval(msg.sender, guy, wad);\n return true;\n }\n\n function transfer(address dst, uint wad) public returns (bool) {\n return transferFrom(msg.sender, dst, wad);\n }\n\n function transferFrom(address src, address dst, uint wad)\n public\n returns (bool)\n {\n require(balanceOf[src] >= wad);\n\n if (src != msg.sender && allowance[src][msg.sender] != uint(-1)) {\n require(allowance[src][msg.sender] >= wad);\n allowance[src][msg.sender] -= wad;\n }\n\n balanceOf[src] -= wad;\n balanceOf[dst] += wad;\n\n Transfer(src, dst, wad);\n\n return true;\n }\n}\n\n\n/*\n GNU GENERAL PUBLIC LICENSE\n Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n Preamble\n\n The GNU General Public License is a free, copyleft license for\nsoftware and other kinds of works.\n\n The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works. By contrast,\nthe GNU General Public License is intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users. We, the Free Software Foundation, use the\nGNU General Public License for most of our software; it applies also to\nany other work released this way by its authors. You can apply it to\nyour programs, too.\n\n When we speak of free software, we are referring to freedom, not\nprice. Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n To protect your rights, we need to prevent others from denying you\nthese rights or asking you to surrender the rights. Therefore, you have\ncertain responsibilities if you distribute copies of the software, or if\nyou modify it: responsibilities to respect the freedom of others.\n\n For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must pass on to the recipients the same\nfreedoms that you received. You must make sure that they, too, receive\nor can get the source code. And you must show them these terms so they\nknow their rights.\n\n Developers that use the GNU GPL protect your rights with two steps:\n(1) assert copyright on the software, and (2) offer you this License\ngiving you legal permission to copy, distribute and/or modify it.\n\n For the developers' and authors' protection, the GPL clearly explains\nthat there is no warranty for this free software. For both users' and\nauthors' sake, the GPL requires that modified versions be marked as\nchanged, so that their problems will not be attributed erroneously to\nauthors of previous versions.\n\n Some devices are designed to deny users access to install or run\nmodified versions of the software inside them, although the manufacturer\ncan do so. This is fundamentally incompatible with the aim of\nprotecting users' freedom to change the software. The systematic\npattern of such abuse occurs in the area of products for individuals to\nuse, which is precisely where it is most unacceptable. Therefore, we\nhave designed this version of the GPL to prohibit the practice for those\nproducts. If such problems arise substantially in other domains, we\nstand ready to extend this provision to those domains in future versions\nof the GPL, as needed to protect the freedom of users.\n\n Finally, every program is threatened constantly by software patents.\nStates should not allow patents to restrict development and use of\nsoftware on general-purpose computers, but in those that do, we wish to\navoid the special danger that patents applied to a free program could\nmake it effectively proprietary. To prevent this, the GPL assures that\npatents cannot be used to render the program non-free.\n\n The precise terms and conditions for copying, distribution and\nmodification follow.\n\n TERMS AND CONDITIONS\n\n 0. Definitions.\n\n \"This License\" refers to version 3 of the GNU General Public License.\n\n \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n \"The Program\" refers to any copyrightable work licensed under this\nLicense. Each licensee is addressed as \"you\". \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy. The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy. Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies. Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License. If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n 1. Source Code.\n\n The \"source code\" for a work means the preferred form of the work\nfor making modifications to it. \"Object code\" means any non-source\nform of a work.\n\n A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form. A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities. However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work. For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n The Corresponding Source for a work in source code form is that\nsame work.\n\n 2. Basic Permissions.\n\n All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met. This License explicitly affirms your unlimited\npermission to run the unmodified Program. The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work. This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force. You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright. Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n Conveying under any other circumstances is permitted solely under\nthe conditions stated below. Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n 3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n 4. Conveying Verbatim Copies.\n\n You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n 5. Conveying Modified Source Versions.\n\n You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n a) The work must carry prominent notices stating that you modified\n it, and giving a relevant date.\n\n b) The work must carry prominent notices stating that it is\n released under this License and any conditions added under section\n 7. This requirement modifies the requirement in section 4 to\n \"keep intact all notices\".\n\n c) You must license the entire work, as a whole, under this\n License to anyone who comes into possession of a copy. This\n License will therefore apply, along with any applicable section 7\n additional terms, to the whole of the work, and all its parts,\n regardless of how they are packaged. This License gives no\n permission to license the work in any other way, but it does not\n invalidate such permission if you have separately received it.\n\n d) If the work has interactive user interfaces, each must display\n Appropriate Legal Notices; however, if the Program has interactive\n interfaces that do not display Appropriate Legal Notices, your\n work need not make them do so.\n\n A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit. Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n 6. Conveying Non-Source Forms.\n\n You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n a) Convey the object code in, or embodied in, a physical product\n (including a physical distribution medium), accompanied by the\n Corresponding Source fixed on a durable physical medium\n customarily used for software interchange.\n\n b) Convey the object code in, or embodied in, a physical product\n (including a physical distribution medium), accompanied by a\n written offer, valid for at least three years and valid for as\n long as you offer spare parts or customer support for that product\n model, to give anyone who possesses the object code either (1) a\n copy of the Corresponding Source for all the software in the\n product that is covered by this License, on a durable physical\n medium customarily used for software interchange, for a price no\n more than your reasonable cost of physically performing this\n conveying of source, or (2) access to copy the\n Corresponding Source from a network server at no charge.\n\n c) Convey individual copies of the object code with a copy of the\n written offer to provide the Corresponding Source. This\n alternative is allowed only occasionally and noncommercially, and\n only if you received the object code with such an offer, in accord\n with subsection 6b.\n\n d) Convey the object code by offering access from a designated\n place (gratis or for a charge), and offer equivalent access to the\n Corresponding Source in the same way through the same place at no\n further charge. You need not require recipients to copy the\n Corresponding Source along with the object code. If the place to\n copy the object code is a network server, the Corresponding Source\n may be on a different server (operated by you or a third party)\n that supports equivalent copying facilities, provided you maintain\n clear directions next to the object code saying where to find the\n Corresponding Source. Regardless of what server hosts the\n Corresponding Source, you remain obligated to ensure that it is\n available for as long as needed to satisfy these requirements.\n\n e) Convey the object code using peer-to-peer transmission, provided\n you inform other peers where the object code and Corresponding\n Source of the work are being offered to the general public at no\n charge under subsection 6d.\n\n A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling. In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage. For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product. A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source. The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information. But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed. Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n 7. Additional Terms.\n\n \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law. If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit. (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.) You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n a) Disclaiming warranty or limiting liability differently from the\n terms of sections 15 and 16 of this License; or\n\n b) Requiring preservation of specified reasonable legal notices or\n author attributions in that material or in the Appropriate Legal\n Notices displayed by works containing it; or\n\n c) Prohibiting misrepresentation of the origin of that material, or\n requiring that modified versions of such material be marked in\n reasonable ways as different from the original version; or\n\n d) Limiting the use for publicity purposes of names of licensors or\n authors of the material; or\n\n e) Declining to grant rights under trademark law for use of some\n trade names, trademarks, or service marks; or\n\n f) Requiring indemnification of licensors and authors of that\n material by anyone who conveys the material (or modified versions of\n it) with contractual assumptions of liability to the recipient, for\n any liability that these contractual assumptions directly impose on\n those licensors and authors.\n\n All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10. If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term. If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n 8. Termination.\n\n You may not propagate or modify a covered work except as expressly\nprovided under this License. Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License. If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n 9. Acceptance Not Required for Having Copies.\n\n You are not required to accept this License in order to receive or\nrun a copy of the Program. Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance. However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work. These actions infringe copyright if you do\nnot accept this License. Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n 10. Automatic Licensing of Downstream Recipients.\n\n Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License. You are not responsible\nfor enforcing compliance by third parties with this License.\n\n An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations. If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License. For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n 11. Patents.\n\n A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based. The\nwork thus licensed is called the contributor's \"contributor version\".\n\n A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version. For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement). To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients. \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License. You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n 12. No Surrender of Others' Freedom.\n\n If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License. If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all. For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n 13. Use with the GNU Affero General Public License.\n\n Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU Affero General Public License into a single\ncombined work, and to convey the resulting work. The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the special requirements of the GNU Affero General Public License,\nsection 13, concerning interaction through a network will apply to the\ncombination as such.\n\n 14. Revised Versions of this License.\n\n The Free Software Foundation may publish revised and/or new versions of\nthe GNU General Public License from time to time. Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n Each version is given a distinguishing version number. If the\nProgram specifies that a certain numbered version of the GNU General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation. If the Program does not specify a version number of the\nGNU General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n If the Program specifies that a proxy can decide which future\nversions of the GNU General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n Later license versions may give you additional or different\npermissions. However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n 15. Disclaimer of Warranty.\n\n THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n 16. Limitation of Liability.\n\n IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n 17. Interpretation of Sections 15 and 16.\n\n If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n END OF TERMS AND CONDITIONS\n\n How to Apply These Terms to Your New Programs\n\n If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n To do so, attach the following notices to the program. It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n <one line to give the program's name and a brief idea of what it does.>\n Copyright (C) <year> <name of author>\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program. If not, see <http://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n If the program does terminal interaction, make it output a short\nnotice like this when it starts in an interactive mode:\n\n <program> Copyright (C) <year> <name of author>\n This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n This is free software, and you are welcome to redistribute it\n under certain conditions; type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' should show the appropriate\nparts of the General Public License. Of course, your program's commands\nmight be different; for a GUI interface, you would use an \"about box\".\n\n You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU GPL, see\n<http://www.gnu.org/licenses/>.\n\n The GNU General Public License does not permit incorporating your program\ninto proprietary programs. If your program is a subroutine library, you\nmay consider it more useful to permit linking proprietary applications with\nthe library. If this is what you want to do, use the GNU Lesser General\nPublic License instead of this License. But first, please read\n<http://www.gnu.org/philosophy/why-not-lgpl.html>.\n\n*/\n"
- },
- "sourceTreeHashHex": "0xce985174db1a24d312c0d544abb926a9b107bd9abd6424288a8e54a16d3e006b",
- "compiler": {
- "name": "solc",
- "version": "0.4.23",
- "settings": {
- "outputSelection": {
- "*": {
- "*": [
- "abi",
- "evm.bytecode.object",
- "evm.bytecode.sourceMap",
- "evm.deployedBytecode.object",
- "evm.deployedBytecode.sourceMap"
- ]
- }
- }
- }
- },
- "networks": {
- "50": {
- "address": "0x871dd7c2b4b25e1aa18728e9d5f2af4c4e431f5c",
- "links": {},
- "constructorArgs": "[]"
- }
- }
-} \ No newline at end of file
diff --git a/packages/migrations/artifacts/1.0.0/ZRXToken.json b/packages/migrations/artifacts/1.0.0/ZRXToken.json
deleted file mode 100644
index 089d16845..000000000
--- a/packages/migrations/artifacts/1.0.0/ZRXToken.json
+++ /dev/null
@@ -1,288 +0,0 @@
-{
- "schemaVersion": "2.0.0",
- "contractName": "ZRXToken",
- "compilerOutput": {
- "abi": [
- {
- "constant": true,
- "inputs": [],
- "name": "name",
- "outputs": [
- {
- "name": "",
- "type": "string"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_spender",
- "type": "address"
- },
- {
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "approve",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "totalSupply",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_from",
- "type": "address"
- },
- {
- "name": "_to",
- "type": "address"
- },
- {
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "transferFrom",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "decimals",
- "outputs": [
- {
- "name": "",
- "type": "uint8"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "_owner",
- "type": "address"
- }
- ],
- "name": "balanceOf",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "symbol",
- "outputs": [
- {
- "name": "",
- "type": "string"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_to",
- "type": "address"
- },
- {
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "transfer",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "_owner",
- "type": "address"
- },
- {
- "name": "_spender",
- "type": "address"
- }
- ],
- "name": "allowance",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "inputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "constructor"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "_from",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "_to",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "Transfer",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "_owner",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "_spender",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "Approval",
- "type": "event"
- }
- ],
- "evm": {
- "bytecode": {
- "linkReferences": {},
- "object": "0x60806040526b033b2e3c9fd0803ce800000060035534801561002057600080fd5b506003546000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610baa806100756000396000f300608060405260043610610099576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461009e578063095ea7b31461012e57806318160ddd1461019357806323b872dd146101be578063313ce5671461024357806370a082311461027457806395d89b41146102cb578063a9059cbb1461035b578063dd62ed3e146103c0575b600080fd5b3480156100aa57600080fd5b506100b3610437565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f35780820151818401526020810190506100d8565b50505050905090810190601f1680156101205780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561013a57600080fd5b50610179600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610470565b604051808215151515815260200191505060405180910390f35b34801561019f57600080fd5b506101a8610562565b6040518082815260200191505060405180910390f35b3480156101ca57600080fd5b50610229600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610568565b604051808215151515815260200191505060405180910390f35b34801561024f57600080fd5b5061025861088d565b604051808260ff1660ff16815260200191505060405180910390f35b34801561028057600080fd5b506102b5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610892565b6040518082815260200191505060405180910390f35b3480156102d757600080fd5b506102e06108da565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610320578082015181840152602081019050610305565b50505050905090810190601f16801561034d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561036757600080fd5b506103a6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610913565b604051808215151515815260200191505060405180910390f35b3480156103cc57600080fd5b50610421600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610af7565b6040518082815260200191505060405180910390f35b6040805190810160405280601181526020017f30782050726f746f636f6c20546f6b656e00000000000000000000000000000081525081565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60035481565b600080600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101580156106385750828110155b80156106c257506000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540110155b1561088057826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8110156108125782600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150610885565b600091505b509392505050565b601281565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6040805190810160405280600381526020017f5a5258000000000000000000000000000000000000000000000000000000000081525081565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101580156109e157506000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540110155b15610aec57816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050610af1565b600090505b92915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050929150505600a165627a7a7230582089db9c211e5af04f1310094c249a407cffeb6a192146db670149095578ff11390029",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH12 0x33B2E3C9FD0803CE8000000 PUSH1 0x3 SSTORE CALLVALUE DUP1 ISZERO PUSH2 0x20 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x3 SLOAD PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP PUSH2 0xBAA DUP1 PUSH2 0x75 PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN STOP PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x99 JUMPI PUSH1 0x0 CALLDATALOAD PUSH29 0x100000000000000000000000000000000000000000000000000000000 SWAP1 DIV PUSH4 0xFFFFFFFF AND DUP1 PUSH4 0x6FDDE03 EQ PUSH2 0x9E JUMPI DUP1 PUSH4 0x95EA7B3 EQ PUSH2 0x12E JUMPI DUP1 PUSH4 0x18160DDD EQ PUSH2 0x193 JUMPI DUP1 PUSH4 0x23B872DD EQ PUSH2 0x1BE JUMPI DUP1 PUSH4 0x313CE567 EQ PUSH2 0x243 JUMPI DUP1 PUSH4 0x70A08231 EQ PUSH2 0x274 JUMPI DUP1 PUSH4 0x95D89B41 EQ PUSH2 0x2CB JUMPI DUP1 PUSH4 0xA9059CBB EQ PUSH2 0x35B JUMPI DUP1 PUSH4 0xDD62ED3E EQ PUSH2 0x3C0 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xAA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xB3 PUSH2 0x437 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE DUP4 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0xF3 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0xD8 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x120 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x13A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x179 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x470 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x19F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1A8 PUSH2 0x562 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1CA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x229 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x568 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x24F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x258 PUSH2 0x88D JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 PUSH1 0xFF AND PUSH1 0xFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x280 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2B5 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x892 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2D7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2E0 PUSH2 0x8DA JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE DUP4 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x320 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x305 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x34D JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x367 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x3A6 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x913 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3CC JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x421 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xAF7 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x11 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x30782050726F746F636F6C20546F6B656E000000000000000000000000000000 DUP2 MSTORE POP DUP2 JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x1 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x8C5BE1E5EBEC7D5BD14F71427D1E84F3DD0314C0F7B2291E5B200AC8C7C3B925 DUP5 PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x1 SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x3 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x1 PUSH1 0x0 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD SWAP1 POP DUP3 PUSH1 0x0 DUP1 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD LT ISZERO DUP1 ISZERO PUSH2 0x638 JUMPI POP DUP3 DUP2 LT ISZERO JUMPDEST DUP1 ISZERO PUSH2 0x6C2 JUMPI POP PUSH1 0x0 DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD DUP4 PUSH1 0x0 DUP1 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD ADD LT ISZERO JUMPDEST ISZERO PUSH2 0x880 JUMPI DUP3 PUSH1 0x0 DUP1 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD ADD SWAP3 POP POP DUP2 SWAP1 SSTORE POP DUP3 PUSH1 0x0 DUP1 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD SUB SWAP3 POP POP DUP2 SWAP1 SSTORE POP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 LT ISZERO PUSH2 0x812 JUMPI DUP3 PUSH1 0x1 PUSH1 0x0 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD SUB SWAP3 POP POP DUP2 SWAP1 SSTORE POP JUMPDEST DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF DUP6 PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x1 SWAP2 POP PUSH2 0x885 JUMP JUMPDEST PUSH1 0x0 SWAP2 POP JUMPDEST POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x12 DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x3 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x5A52580000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE POP DUP2 JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD LT ISZERO DUP1 ISZERO PUSH2 0x9E1 JUMPI POP PUSH1 0x0 DUP1 DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD DUP3 PUSH1 0x0 DUP1 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD ADD LT ISZERO JUMPDEST ISZERO PUSH2 0xAEC JUMPI DUP2 PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD SUB SWAP3 POP POP DUP2 SWAP1 SSTORE POP DUP2 PUSH1 0x0 DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD ADD SWAP3 POP POP DUP2 SWAP1 SSTORE POP DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF DUP5 PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x1 SWAP1 POP PUSH2 0xAF1 JUMP JUMPDEST PUSH1 0x0 SWAP1 POP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1 PUSH1 0x0 DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD SWAP1 POP SWAP3 SWAP2 POP POP JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 DUP10 0xdb SWAP13 0x21 0x1e GAS CREATE 0x4f SGT LT MULMOD 0x4c 0x24 SWAP11 BLOCKHASH PUSH29 0xFFEB6A192146DB670149095578FF113900290000000000000000000000 ",
- "sourceMap": "753:342:0:-;;;872:6;846:32;;1022:71;8:9:-1;5:2;;;30:1;27;20:12;5:2;1022:71:0;1075:11;;1052:8;:20;1061:10;1052:20;;;;;;;;;;;;;;;:34;;;;753:342;;;;;;"
- },
- "deployedBytecode": {
- "linkReferences": {},
- "object": "0x608060405260043610610099576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461009e578063095ea7b31461012e57806318160ddd1461019357806323b872dd146101be578063313ce5671461024357806370a082311461027457806395d89b41146102cb578063a9059cbb1461035b578063dd62ed3e146103c0575b600080fd5b3480156100aa57600080fd5b506100b3610437565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f35780820151818401526020810190506100d8565b50505050905090810190601f1680156101205780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561013a57600080fd5b50610179600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610470565b604051808215151515815260200191505060405180910390f35b34801561019f57600080fd5b506101a8610562565b6040518082815260200191505060405180910390f35b3480156101ca57600080fd5b50610229600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610568565b604051808215151515815260200191505060405180910390f35b34801561024f57600080fd5b5061025861088d565b604051808260ff1660ff16815260200191505060405180910390f35b34801561028057600080fd5b506102b5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610892565b6040518082815260200191505060405180910390f35b3480156102d757600080fd5b506102e06108da565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610320578082015181840152602081019050610305565b50505050905090810190601f16801561034d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561036757600080fd5b506103a6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610913565b604051808215151515815260200191505060405180910390f35b3480156103cc57600080fd5b50610421600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610af7565b6040518082815260200191505060405180910390f35b6040805190810160405280601181526020017f30782050726f746f636f6c20546f6b656e00000000000000000000000000000081525081565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60035481565b600080600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101580156106385750828110155b80156106c257506000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540110155b1561088057826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8110156108125782600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150610885565b600091505b509392505050565b601281565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6040805190810160405280600381526020017f5a5258000000000000000000000000000000000000000000000000000000000081525081565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101580156109e157506000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540110155b15610aec57816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050610af1565b600090505b92915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050929150505600a165627a7a7230582089db9c211e5af04f1310094c249a407cffeb6a192146db670149095578ff11390029",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x99 JUMPI PUSH1 0x0 CALLDATALOAD PUSH29 0x100000000000000000000000000000000000000000000000000000000 SWAP1 DIV PUSH4 0xFFFFFFFF AND DUP1 PUSH4 0x6FDDE03 EQ PUSH2 0x9E JUMPI DUP1 PUSH4 0x95EA7B3 EQ PUSH2 0x12E JUMPI DUP1 PUSH4 0x18160DDD EQ PUSH2 0x193 JUMPI DUP1 PUSH4 0x23B872DD EQ PUSH2 0x1BE JUMPI DUP1 PUSH4 0x313CE567 EQ PUSH2 0x243 JUMPI DUP1 PUSH4 0x70A08231 EQ PUSH2 0x274 JUMPI DUP1 PUSH4 0x95D89B41 EQ PUSH2 0x2CB JUMPI DUP1 PUSH4 0xA9059CBB EQ PUSH2 0x35B JUMPI DUP1 PUSH4 0xDD62ED3E EQ PUSH2 0x3C0 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xAA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xB3 PUSH2 0x437 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE DUP4 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0xF3 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0xD8 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x120 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x13A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x179 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x470 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x19F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1A8 PUSH2 0x562 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1CA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x229 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x568 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x24F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x258 PUSH2 0x88D JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 PUSH1 0xFF AND PUSH1 0xFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x280 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2B5 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x892 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2D7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2E0 PUSH2 0x8DA JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE DUP4 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x320 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x305 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x34D JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x367 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x3A6 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x913 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3CC JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x421 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xAF7 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x11 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x30782050726F746F636F6C20546F6B656E000000000000000000000000000000 DUP2 MSTORE POP DUP2 JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x1 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x8C5BE1E5EBEC7D5BD14F71427D1E84F3DD0314C0F7B2291E5B200AC8C7C3B925 DUP5 PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x1 SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x3 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x1 PUSH1 0x0 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD SWAP1 POP DUP3 PUSH1 0x0 DUP1 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD LT ISZERO DUP1 ISZERO PUSH2 0x638 JUMPI POP DUP3 DUP2 LT ISZERO JUMPDEST DUP1 ISZERO PUSH2 0x6C2 JUMPI POP PUSH1 0x0 DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD DUP4 PUSH1 0x0 DUP1 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD ADD LT ISZERO JUMPDEST ISZERO PUSH2 0x880 JUMPI DUP3 PUSH1 0x0 DUP1 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD ADD SWAP3 POP POP DUP2 SWAP1 SSTORE POP DUP3 PUSH1 0x0 DUP1 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD SUB SWAP3 POP POP DUP2 SWAP1 SSTORE POP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 LT ISZERO PUSH2 0x812 JUMPI DUP3 PUSH1 0x1 PUSH1 0x0 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD SUB SWAP3 POP POP DUP2 SWAP1 SSTORE POP JUMPDEST DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF DUP6 PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x1 SWAP2 POP PUSH2 0x885 JUMP JUMPDEST PUSH1 0x0 SWAP2 POP JUMPDEST POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x12 DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x3 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x5A52580000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE POP DUP2 JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD LT ISZERO DUP1 ISZERO PUSH2 0x9E1 JUMPI POP PUSH1 0x0 DUP1 DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD DUP3 PUSH1 0x0 DUP1 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD ADD LT ISZERO JUMPDEST ISZERO PUSH2 0xAEC JUMPI DUP2 PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD SUB SWAP3 POP POP DUP2 SWAP1 SSTORE POP DUP2 PUSH1 0x0 DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD ADD SWAP3 POP POP DUP2 SWAP1 SSTORE POP DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF DUP5 PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x1 SWAP1 POP PUSH2 0xAF1 JUMP JUMPDEST PUSH1 0x0 SWAP1 POP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1 PUSH1 0x0 DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD SWAP1 POP SWAP3 SWAP2 POP POP JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 DUP10 0xdb SWAP13 0x21 0x1e GAS CREATE 0x4f SGT LT MULMOD 0x4c 0x24 SWAP11 BLOCKHASH PUSH29 0xFFEB6A192146DB670149095578FF113900290000000000000000000000 ",
- "sourceMap": "753:342:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;923:49;;8:9:-1;5:2;;;30:1;27;20:12;5:2;923:49:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;923:49:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1087:187:1;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1087:187:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;846:32:0;;8:9:-1;5:2;;;30:1;27;20:12;5:2;846:32:0;;;;;;;;;;;;;;;;;;;;;;;1066:609:3;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1066:609:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;805:35:0;;8:9:-1;5:2;;;30:1;27;20:12;5:2;805:35:0;;;;;;;;;;;;;;;;;;;;;;;;;;;982:99:1;;8:9:-1;5:2;;;30:1;27;20:12;5:2;982:99:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;978:37:0;;8:9:-1;5:2;;;30:1;27;20:12;5:2;978:37:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;978:37:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;125:410:1;;8:9:-1;5:2;;;30:1;27;20:12;5:2;125:410:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1280:126;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1280:126:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;923:49:0;;;;;;;;;;;;;;;;;;;;:::o;1087:187:1:-;1144:4;1192:6;1160:7;:19;1168:10;1160:19;;;;;;;;;;;;;;;:29;1180:8;1160:29;;;;;;;;;;;;;;;:38;;;;1229:8;1208:38;;1217:10;1208:38;;;1239:6;1208:38;;;;;;;;;;;;;;;;;;1263:4;1256:11;;1087:187;;;;:::o;846:32:0:-;;;;:::o;1066:609:3:-;1161:4;1181:14;1198:7;:14;1206:5;1198:14;;;;;;;;;;;;;;;:26;1213:10;1198:26;;;;;;;;;;;;;;;;1181:43;;1257:6;1238:8;:15;1247:5;1238:15;;;;;;;;;;;;;;;;:25;;:60;;;;;1292:6;1279:9;:19;;1238:60;:115;;;;;1340:8;:13;1349:3;1340:13;;;;;;;;;;;;;;;;1330:6;1314:8;:13;1323:3;1314:13;;;;;;;;;;;;;;;;:22;:39;;1238:115;1234:435;;;1395:6;1378:8;:13;1387:3;1378:13;;;;;;;;;;;;;;;;:23;;;;;;;;;;;1434:6;1415:8;:15;1424:5;1415:15;;;;;;;;;;;;;;;;:25;;;;;;;;;;;768:10;1458:9;:20;1454:95;;;1528:6;1498:7;:14;1506:5;1498:14;;;;;;;;;;;;;;;:26;1513:10;1498:26;;;;;;;;;;;;;;;;:36;;;;;;;;;;;1454:95;1578:3;1562:28;;1571:5;1562:28;;;1583:6;1562:28;;;;;;;;;;;;;;;;;;1611:4;1604:11;;;;1234:435;1653:5;1646:12;;1066:609;;;;;;;:::o;805:35:0:-;838:2;805:35;:::o;982:99:1:-;1035:4;1058:8;:16;1067:6;1058:16;;;;;;;;;;;;;;;;1051:23;;982:99;;;:::o;978:37:0:-;;;;;;;;;;;;;;;;;;;;:::o;125:410:1:-;178:4;291:6;267:8;:20;276:10;267:20;;;;;;;;;;;;;;;;:30;;:73;;;;;327:8;:13;336:3;327:13;;;;;;;;;;;;;;;;317:6;301:8;:13;310:3;301:13;;;;;;;;;;;;;;;;:22;:39;;267:73;263:266;;;380:6;356:8;:20;365:10;356:20;;;;;;;;;;;;;;;;:30;;;;;;;;;;;417:6;400:8;:13;409:3;400:13;;;;;;;;;;;;;;;;:23;;;;;;;;;;;458:3;437:33;;446:10;437:33;;;463:6;437:33;;;;;;;;;;;;;;;;;;491:4;484:11;;;;263:266;521:5;514:12;;125:410;;;;;:::o;1280:126::-;1351:4;1374:7;:15;1382:6;1374:15;;;;;;;;;;;;;;;:25;1390:8;1374:25;;;;;;;;;;;;;;;;1367:32;;1280:126;;;;:::o"
- }
- }
- },
- "sources": {
- "current/tokens/ZRXToken/ZRXToken.sol": {
- "id": 0
- },
- "previous/ERC20Token/ERC20Token_v1.sol": {
- "id": 1
- },
- "previous/Token/Token_v1.sol": {
- "id": 2
- },
- "previous/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol": {
- "id": 3
- }
- },
- "sourceCodes": {
- "current/tokens/ZRXToken/ZRXToken.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.4.11;\n\nimport { UnlimitedAllowanceToken_v1 as UnlimitedAllowanceToken } from \"../../../previous/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\";\n\ncontract ZRXToken is UnlimitedAllowanceToken {\n\n uint8 constant public decimals = 18;\n uint public totalSupply = 10**27; // 1 billion tokens, 18 decimal places\n string constant public name = \"0x Protocol Token\";\n string constant public symbol = \"ZRX\";\n\n function ZRXToken() {\n balances[msg.sender] = totalSupply;\n }\n}\n",
- "previous/ERC20Token/ERC20Token_v1.sol": "pragma solidity ^0.4.11;\n\nimport { Token_v1 as Token } from \"../Token/Token_v1.sol\";\n\ncontract ERC20Token_v1 is Token {\n\n function transfer(address _to, uint _value) returns (bool) {\n //Default assumes totalSupply can't be over max (2^256 - 1).\n if (balances[msg.sender] >= _value && balances[_to] + _value >= balances[_to]) {\n balances[msg.sender] -= _value;\n balances[_to] += _value;\n Transfer(msg.sender, _to, _value);\n return true;\n } else { return false; }\n }\n\n function transferFrom(address _from, address _to, uint _value) returns (bool) {\n if (balances[_from] >= _value && allowed[_from][msg.sender] >= _value && balances[_to] + _value >= balances[_to]) {\n balances[_to] += _value;\n balances[_from] -= _value;\n allowed[_from][msg.sender] -= _value;\n Transfer(_from, _to, _value);\n return true;\n } else { return false; }\n }\n\n function balanceOf(address _owner) constant returns (uint) {\n return balances[_owner];\n }\n\n function approve(address _spender, uint _value) returns (bool) {\n allowed[msg.sender][_spender] = _value;\n Approval(msg.sender, _spender, _value);\n return true;\n }\n\n function allowance(address _owner, address _spender) constant returns (uint) {\n return allowed[_owner][_spender];\n }\n\n mapping (address => uint) balances;\n mapping (address => mapping (address => uint)) allowed;\n uint public totalSupply;\n}\n",
- "previous/Token/Token_v1.sol": "pragma solidity ^0.4.11;\n\ncontract Token_v1 {\n\n /// @return total amount of tokens\n function totalSupply() constant returns (uint supply) {}\n\n /// @param _owner The address from which the balance will be retrieved\n /// @return The balance\n function balanceOf(address _owner) constant returns (uint balance) {}\n\n /// @notice send `_value` token to `_to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return Whether the transfer was successful or not\n function transfer(address _to, uint _value) returns (bool success) {}\n\n /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return Whether the transfer was successful or not\n function transferFrom(address _from, address _to, uint _value) returns (bool success) {}\n\n /// @notice `msg.sender` approves `_addr` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Whether the approval was successful or not\n function approve(address _spender, uint _value) returns (bool success) {}\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender) constant returns (uint remaining) {}\n\n event Transfer(address indexed _from, address indexed _to, uint _value);\n event Approval(address indexed _owner, address indexed _spender, uint _value);\n}\n\n",
- "previous/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.4.11;\n\nimport { ERC20Token_v1 as ERC20Token } from \"../ERC20Token/ERC20Token_v1.sol\";\n\ncontract UnlimitedAllowanceToken_v1 is ERC20Token {\n\n uint constant MAX_UINT = 2**256 - 1;\n\n /// @dev ERC20 transferFrom, modified such that an allowance of MAX_UINT represents an unlimited allowance.\n /// @param _from Address to transfer from.\n /// @param _to Address to transfer to.\n /// @param _value Amount to transfer.\n /// @return Success of transfer.\n function transferFrom(address _from, address _to, uint _value)\n public\n returns (bool)\n {\n uint allowance = allowed[_from][msg.sender];\n if (balances[_from] >= _value\n && allowance >= _value\n && balances[_to] + _value >= balances[_to]\n ) {\n balances[_to] += _value;\n balances[_from] -= _value;\n if (allowance < MAX_UINT) {\n allowed[_from][msg.sender] -= _value;\n }\n Transfer(_from, _to, _value);\n return true;\n } else {\n return false;\n }\n }\n}\n"
- },
- "sourceTreeHashHex": "0xbaaa4c45ee7e505106ec3f265920d9be632c2dec05ba8ea8e7e7404805ee62a5",
- "compiler": {
- "name": "solc",
- "version": "0.4.23",
- "settings": {
- "outputSelection": {
- "*": {
- "*": [
- "abi",
- "evm.bytecode.object",
- "evm.bytecode.sourceMap",
- "evm.deployedBytecode.object",
- "evm.deployedBytecode.sourceMap"
- ]
- }
- }
- }
- },
- "networks": {
- "50": {
- "address": "0x1d7022f5b17d2f8b695918fb48fa1089c9f85401",
- "links": {},
- "constructorArgs": "[]"
- }
- }
-} \ No newline at end of file
diff --git a/packages/migrations/artifacts/2.0.0-testnet/AssetProxyOwner.json b/packages/migrations/artifacts/2.0.0-testnet/AssetProxyOwner.json
deleted file mode 100644
index 86fc10924..000000000
--- a/packages/migrations/artifacts/2.0.0-testnet/AssetProxyOwner.json
+++ /dev/null
@@ -1,1012 +0,0 @@
-{
- "schemaVersion": "2.0.0",
- "contractName": "AssetProxyOwner",
- "compilerOutput": {
- "abi": [
- {
- "constant": true,
- "inputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "name": "owners",
- "outputs": [
- {
- "name": "",
- "type": "address"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "owner",
- "type": "address"
- }
- ],
- "name": "removeOwner",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "revokeConfirmation",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "",
- "type": "address"
- }
- ],
- "name": "isOwner",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "",
- "type": "uint256"
- },
- {
- "name": "",
- "type": "address"
- }
- ],
- "name": "confirmations",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "executeRemoveAuthorizedAddressAtIndex",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "secondsTimeLocked",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "pending",
- "type": "bool"
- },
- {
- "name": "executed",
- "type": "bool"
- }
- ],
- "name": "getTransactionCount",
- "outputs": [
- {
- "name": "count",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "assetProxyContract",
- "type": "address"
- },
- {
- "name": "isRegistered",
- "type": "bool"
- }
- ],
- "name": "registerAssetProxy",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "owner",
- "type": "address"
- }
- ],
- "name": "addOwner",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "isConfirmed",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_secondsTimeLocked",
- "type": "uint256"
- }
- ],
- "name": "changeTimeLock",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "",
- "type": "address"
- }
- ],
- "name": "isAssetProxyRegistered",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "getConfirmationCount",
- "outputs": [
- {
- "name": "count",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "name": "transactions",
- "outputs": [
- {
- "name": "destination",
- "type": "address"
- },
- {
- "name": "value",
- "type": "uint256"
- },
- {
- "name": "data",
- "type": "bytes"
- },
- {
- "name": "executed",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "getOwners",
- "outputs": [
- {
- "name": "",
- "type": "address[]"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "from",
- "type": "uint256"
- },
- {
- "name": "to",
- "type": "uint256"
- },
- {
- "name": "pending",
- "type": "bool"
- },
- {
- "name": "executed",
- "type": "bool"
- }
- ],
- "name": "getTransactionIds",
- "outputs": [
- {
- "name": "_transactionIds",
- "type": "uint256[]"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "getConfirmations",
- "outputs": [
- {
- "name": "_confirmations",
- "type": "address[]"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "transactionCount",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_required",
- "type": "uint256"
- }
- ],
- "name": "changeRequirement",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "confirmTransaction",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "destination",
- "type": "address"
- },
- {
- "name": "value",
- "type": "uint256"
- },
- {
- "name": "data",
- "type": "bytes"
- }
- ],
- "name": "submitTransaction",
- "outputs": [
- {
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "name": "confirmationTimes",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "MAX_OWNER_COUNT",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "required",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "owner",
- "type": "address"
- },
- {
- "name": "newOwner",
- "type": "address"
- }
- ],
- "name": "replaceOwner",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "executeTransaction",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "inputs": [
- {
- "name": "_owners",
- "type": "address[]"
- },
- {
- "name": "_assetProxyContracts",
- "type": "address[]"
- },
- {
- "name": "_required",
- "type": "uint256"
- },
- {
- "name": "_secondsTimeLocked",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "constructor"
- },
- {
- "payable": true,
- "stateMutability": "payable",
- "type": "fallback"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": false,
- "name": "assetProxyContract",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "isRegistered",
- "type": "bool"
- }
- ],
- "name": "AssetProxyRegistration",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "transactionId",
- "type": "uint256"
- },
- {
- "indexed": false,
- "name": "confirmationTime",
- "type": "uint256"
- }
- ],
- "name": "ConfirmationTimeSet",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": false,
- "name": "secondsTimeLocked",
- "type": "uint256"
- }
- ],
- "name": "TimeLockChange",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "sender",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "Confirmation",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "sender",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "Revocation",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "Submission",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "Execution",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "ExecutionFailure",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "sender",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "value",
- "type": "uint256"
- }
- ],
- "name": "Deposit",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "owner",
- "type": "address"
- }
- ],
- "name": "OwnerAddition",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "owner",
- "type": "address"
- }
- ],
- "name": "OwnerRemoval",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": false,
- "name": "required",
- "type": "uint256"
- }
- ],
- "name": "RequirementChange",
- "type": "event"
- }
- ],
- "evm": {
- "bytecode": {
- "linkReferences": {},
- "object": "0x60806040523480156200001157600080fd5b50604051620024633803806200246383398101604090815281516020830151918301516060840151918401805190949390930192909190600090819086908590859083908390869082603282118015906200006c5750818111155b80156200007857508015155b80156200008457508115155b15156200009057600080fd5b600092505b84518310156200016857600260008685815181101515620000b257fe5b6020908102909101810151600160a060020a031682528101919091526040016000205460ff161580156200010857508483815181101515620000f057fe5b90602001906020020151600160a060020a0316600014155b15156200011457600080fd5b60016002600087868151811015156200012957fe5b602090810291909101810151600160a060020a03168252810191909152604001600020805460ff19169115159190911790556001929092019162000095565b84516200017d9060039060208801906200026c565b50505060049190915550506006555060009250505b845182101562000260578482815181101515620001ab57fe5b602090810290910101519050600160a060020a03811615156200022f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f494e56414c49445f41535345545f50524f585900000000000000000000000000604482015290519081900360640190fd5b600160a060020a0381166000908152600860205260409020805460ff19166001908117909155919091019062000192565b50505050505062000300565b828054828255906000526020600020908101928215620002c4579160200282015b82811115620002c45782518254600160a060020a031916600160a060020a039091161782556020909201916001909101906200028d565b50620002d2929150620002d6565b5090565b620002fd91905b80821115620002d2578054600160a060020a0319168155600101620002dd565b90565b61215380620003106000396000f30060806040526004361061015e5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663025e7c2781146101a0578063173825d9146101e157806320ea8d861461020f5780632f54bf6e146102275780633411c81c146102695780633589b35c1461029a57806337bd78a0146102b257806354741525146102d95780635a1a66af146102f85780637065cb481461032b578063784547a7146103595780637ad28c511461037157806383250f79146103895780638b51d13f146103b75780639ace38c2146103cf578063a0e67e2b146104a4578063a8abe69a14610509578063b5dc40c31461052e578063b77bf60014610546578063ba51a6df1461055b578063c01a8c8414610573578063c64274741461058b578063d38f2d8214610601578063d74f8edd14610619578063dc8452cd1461062e578063e20056e614610643578063ee22610b14610677575b600034111561019e5760408051348152905133917fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c919081900360200190a25b005b3480156101ac57600080fd5b506101b860043561068f565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b3480156101ed57600080fd5b5061019e73ffffffffffffffffffffffffffffffffffffffff600435166106c4565b34801561021b57600080fd5b5061019e60043561091b565b34801561023357600080fd5b5061025573ffffffffffffffffffffffffffffffffffffffff600435166109f3565b604080519115158252519081900360200190f35b34801561027557600080fd5b5061025560043573ffffffffffffffffffffffffffffffffffffffff60243516610a08565b3480156102a657600080fd5b5061019e600435610a28565b3480156102be57600080fd5b506102c7610eda565b60408051918252519081900360200190f35b3480156102e557600080fd5b506102c760043515156024351515610ee0565b34801561030457600080fd5b5061019e73ffffffffffffffffffffffffffffffffffffffff600435166024351515610f4c565b34801561033757600080fd5b5061019e73ffffffffffffffffffffffffffffffffffffffff6004351661100b565b34801561036557600080fd5b50610255600435611180565b34801561037d57600080fd5b5061019e600435611211565b34801561039557600080fd5b5061025573ffffffffffffffffffffffffffffffffffffffff60043516611258565b3480156103c357600080fd5b506102c760043561126d565b3480156103db57600080fd5b506103e76004356112e9565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018060200183151515158152602001828103825284818151815260200191508051906020019080838360005b8381101561046657818101518382015260200161044e565b50505050905090810190601f1680156104935780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b3480156104b057600080fd5b506104b96113d2565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156104f55781810151838201526020016104dd565b505050509050019250505060405180910390f35b34801561051557600080fd5b506104b960043560243560443515156064351515611442565b34801561053a57600080fd5b506104b960043561157b565b34801561055257600080fd5b506102c7611728565b34801561056757600080fd5b5061019e60043561172e565b34801561057f57600080fd5b5061019e6004356117ad565b34801561059757600080fd5b50604080516020600460443581810135601f81018490048402850184019095528484526102c794823573ffffffffffffffffffffffffffffffffffffffff169460248035953695946064949201919081908401838280828437509497506119219650505050505050565b34801561060d57600080fd5b506102c7600435611940565b34801561062557600080fd5b506102c7611952565b34801561063a57600080fd5b506102c7611957565b34801561064f57600080fd5b5061019e73ffffffffffffffffffffffffffffffffffffffff6004358116906024351661195d565b34801561068357600080fd5b5061019e600435611b6d565b600380548290811061069d57fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b60003330146106d257600080fd5b73ffffffffffffffffffffffffffffffffffffffff8216600090815260026020526040902054829060ff16151561070857600080fd5b73ffffffffffffffffffffffffffffffffffffffff8316600090815260026020526040812080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905591505b6003547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0182101561088b578273ffffffffffffffffffffffffffffffffffffffff166003838154811015156107a857fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16141561088057600380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff810190811061080057fe5b6000918252602090912001546003805473ffffffffffffffffffffffffffffffffffffffff909216918490811061083357fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061088b565b600190910190610756565b600380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01906108bc9082612066565b5060035460045411156108d5576003546108d59061172e565b60405173ffffffffffffffffffffffffffffffffffffffff8416907f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9090600090a2505050565b3360008181526002602052604090205460ff16151561093957600080fd5b60008281526001602090815260408083203380855292529091205483919060ff16151561096557600080fd5b600084815260208190526040902060030154849060ff161561098657600080fd5b600085815260016020908152604080832033808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690555187927ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e991a35050505050565b60026020526000908152604090205460ff1681565b600160209081526000928352604080842090915290825290205460ff1681565b600081815260208190526040812060030154829060ff1615610a4957600080fd5b82610a5381611180565b1515610ac057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f54585f4e4f545f46554c4c595f434f4e4649524d454400000000000000000000604482015290519081900360640190fd5b600084815260208181526040808320805473ffffffffffffffffffffffffffffffffffffffff16845260089092529091205485919060ff161515610b6557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f554e524547495354455245445f41535345545f50524f58590000000000000000604482015290519081900360640190fd5b604080517f72656d6f7665417574686f72697a6564416464726573734174496e646578286181527f6464726573732c75696e74323536290000000000000000000000000000000000602080830191909152825191829003602f01822060028086018054601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61010060018416150201909116929092049182018490048402850184019095528084527fffffffff0000000000000000000000000000000000000000000000000000000090911693610ca193600093909290830182828015610c8e5780601f10610c6357610100808354040283529160200191610c8e565b820191906000526020600020905b815481529060010190602001808311610c7157829003601f168201915b5050505050611dfd90919063ffffffff16565b7fffffffff000000000000000000000000000000000000000000000000000000001614610d2f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f494e56414c49445f46554e4354494f4e5f53454c4543544f5200000000000000604482015290519081900360640190fd5b600086815260208181526040918290206003810180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001908117909155815481830154600280850180548851601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff97831615610100029790970190911692909204948501879004870282018701909752838152939a50610e479573ffffffffffffffffffffffffffffffffffffffff90921694909391908390830182828015610e3d5780601f10610e1257610100808354040283529160200191610e3d565b820191906000526020600020905b815481529060010190602001808311610e2057829003601f168201915b5050505050611ec5565b15610e7c5760405186907f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7590600090a2610ed2565b60405186907f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923690600090a26003850180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690555b505050505050565b60065481565b6000805b600554811015610f4557838015610f0d575060008181526020819052604090206003015460ff16155b80610f315750828015610f31575060008181526020819052604090206003015460ff165b15610f3d576001820191505b600101610ee4565b5092915050565b333014610f5857600080fd5b8173ffffffffffffffffffffffffffffffffffffffff81161515610f7b57600080fd5b73ffffffffffffffffffffffffffffffffffffffff831660008181526008602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001686151590811790915582519384529083015280517fdaef8ff7dc66c5e34eb9c338aab679d9f427f89868d9228494455a4d982eb2b09281900390910190a1505050565b33301461101757600080fd5b73ffffffffffffffffffffffffffffffffffffffff8116600090815260026020526040902054819060ff161561104c57600080fd5b8173ffffffffffffffffffffffffffffffffffffffff8116151561106f57600080fd5b6003805490506001016004546032821115801561108c5750818111155b801561109757508015155b80156110a257508115155b15156110ad57600080fd5b73ffffffffffffffffffffffffffffffffffffffff851660008181526002602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600190811790915560038054918201815583527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001684179055517ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d9190a25050505050565b600080805b60035481101561120a57600084815260016020526040812060038054919291849081106111ae57fe5b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff16835282019290925260400190205460ff16156111ef576001820191505b600454821415611202576001925061120a565b600101611185565b5050919050565b33301461121d57600080fd5b60068190556040805182815290517fd1c9101a34feff75cccef14a28785a0279cb0b49c1f321f21f5f422e746b43779181900360200190a150565b60086020526000908152604090205460ff1681565b6000805b6003548110156112e3576000838152600160205260408120600380549192918490811061129a57fe5b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff16835282019290925260400190205460ff16156112db576001820191505b600101611271565b50919050565b60006020818152918152604090819020805460018083015460028085018054875161010095821615959095027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff011691909104601f810188900488028401880190965285835273ffffffffffffffffffffffffffffffffffffffff909316959094919291908301828280156113bf5780601f10611394576101008083540402835291602001916113bf565b820191906000526020600020905b8154815290600101906020018083116113a257829003601f168201915b5050506003909301549192505060ff1684565b6060600380548060200260200160405190810160405280929190818152602001828054801561143757602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff16815260019091019060200180831161140c575b505050505090505b90565b606080600080600554604051908082528060200260200182016040528015611474578160200160208202803883390190505b50925060009150600090505b6005548110156114fb578580156114a9575060008181526020819052604090206003015460ff16155b806114cd57508480156114cd575060008181526020819052604090206003015460ff165b156114f3578083838151811015156114e157fe5b60209081029091010152600191909101905b600101611480565b878703604051908082528060200260200182016040528015611527578160200160208202803883390190505b5093508790505b8681101561157057828181518110151561154457fe5b906020019060200201518489830381518110151561155e57fe5b6020908102909101015260010161152e565b505050949350505050565b6060806000806003805490506040519080825280602002602001820160405280156115b0578160200160208202803883390190505b50925060009150600090505b60035481101561169457600085815260016020526040812060038054919291849081106115e557fe5b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff16835282019290925260400190205460ff161561168c57600380548290811061162d57fe5b600091825260209091200154835173ffffffffffffffffffffffffffffffffffffffff9091169084908490811061166057fe5b73ffffffffffffffffffffffffffffffffffffffff909216602092830290910190910152600191909101905b6001016115bc565b816040519080825280602002602001820160405280156116be578160200160208202803883390190505b509350600090505b818110156117205782818151811015156116dc57fe5b9060200190602002015184828151811015156116f457fe5b73ffffffffffffffffffffffffffffffffffffffff9092166020928302909101909101526001016116c6565b505050919050565b60055481565b33301461173a57600080fd5b600354816032821180159061174f5750818111155b801561175a57508015155b801561176557508115155b151561177057600080fd5b60048390556040805184815290517fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a9181900360200190a1505050565b3360008181526002602052604090205460ff1615156117cb57600080fd5b600082815260208190526040902054829073ffffffffffffffffffffffffffffffffffffffff1615156117fd57600080fd5b60008381526001602090815260408083203380855292529091205484919060ff161561182857600080fd5b8461183281611180565b1561189e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f54585f46554c4c595f434f4e4649524d45440000000000000000000000000000604482015290519081900360640190fd5b600086815260016020818152604080842033808652925280842080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016909317909255905188927f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef91a361191286611180565b15610ed257610ed28642611ee8565b600061192e848484611f33565b9050611939816117ad565b9392505050565b60076020526000908152604090205481565b603281565b60045481565b600033301461196b57600080fd5b73ffffffffffffffffffffffffffffffffffffffff8316600090815260026020526040902054839060ff1615156119a157600080fd5b73ffffffffffffffffffffffffffffffffffffffff8316600090815260026020526040902054839060ff16156119d657600080fd5b600092505b600354831015611a9b578473ffffffffffffffffffffffffffffffffffffffff16600384815481101515611a0b57fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff161415611a905783600384815481101515611a4357fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611a9b565b6001909201916119db565b73ffffffffffffffffffffffffffffffffffffffff80861660008181526002602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0090811690915593881682528082208054909416600117909355915190917f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9091a260405173ffffffffffffffffffffffffffffffffffffffff8516907ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d90600090a25050505050565b600081815260208190526040812060030154829060ff1615611b8e57600080fd5b82611b9881611180565b1515611c0557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f54585f4e4f545f46554c4c595f434f4e4649524d454400000000000000000000604482015290519081900360640190fd5b600654600085815260076020526040902054859101421015611c8857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f54494d455f4c4f434b5f494e434f4d504c455445000000000000000000000000604482015290519081900360640190fd5b600085815260208181526040918290206003810180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001908117909155815481830154600280850180548851601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff97831615610100029790970190911692909204948501879004870282018701909752838152939950611d6b9573ffffffffffffffffffffffffffffffffffffffff90921694909391908390830182828015610e3d5780601f10610e1257610100808354040283529160200191610e3d565b15611da05760405185907f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7590600090a2611df6565b60405185907f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923690600090a26003840180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690555b5050505050565b600081600401835110151515611e9a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f475245415445525f4f525f455155414c5f544f5f345f4c454e4754485f52455160448201527f5549524544000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b5001602001517fffffffff000000000000000000000000000000000000000000000000000000001690565b6000806040516020840160008287838a8c6187965a03f198975050505050505050565b6000828152600760209081526040918290208390558151838152915184927f0b237afe65f1514fd7ea3f923ea4fe792bdd07000a912b6cd1602a8e7f573c8d92908290030190a25050565b60008373ffffffffffffffffffffffffffffffffffffffff81161515611f5857600080fd5b6005546040805160808101825273ffffffffffffffffffffffffffffffffffffffff8881168252602080830189815283850189815260006060860181905287815280845295909520845181547fffffffffffffffffffffffff00000000000000000000000000000000000000001694169390931783555160018301559251805194965091939092611ff092600285019291019061208f565b5060609190910151600390910180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001691151591909117905560058054600101905560405182907fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5190600090a2509392505050565b81548183558181111561208a5760008381526020902061208a91810190830161210d565b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106120d057805160ff19168380011785556120fd565b828001600101855582156120fd579182015b828111156120fd5782518255916020019190600101906120e2565b5061210992915061210d565b5090565b61143f91905b8082111561210957600081556001016121135600a165627a7a72305820528db33b34dd3d87f92765da5fac3e1e5d1b9239353f6405405ca9bfc9cee8db0029",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH3 0x11 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x40 MLOAD PUSH3 0x2463 CODESIZE SUB DUP1 PUSH3 0x2463 DUP4 CODECOPY DUP2 ADD PUSH1 0x40 SWAP1 DUP2 MSTORE DUP2 MLOAD PUSH1 0x20 DUP4 ADD MLOAD SWAP2 DUP4 ADD MLOAD PUSH1 0x60 DUP5 ADD MLOAD SWAP2 DUP5 ADD DUP1 MLOAD SWAP1 SWAP5 SWAP4 SWAP1 SWAP4 ADD SWAP3 SWAP1 SWAP2 SWAP1 PUSH1 0x0 SWAP1 DUP2 SWAP1 DUP7 SWAP1 DUP6 SWAP1 DUP6 SWAP1 DUP4 SWAP1 DUP4 SWAP1 DUP7 SWAP1 DUP3 PUSH1 0x32 DUP3 GT DUP1 ISZERO SWAP1 PUSH3 0x6C JUMPI POP DUP2 DUP2 GT ISZERO JUMPDEST DUP1 ISZERO PUSH3 0x78 JUMPI POP DUP1 ISZERO ISZERO JUMPDEST DUP1 ISZERO PUSH3 0x84 JUMPI POP DUP2 ISZERO ISZERO JUMPDEST ISZERO ISZERO PUSH3 0x90 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 SWAP3 POP JUMPDEST DUP5 MLOAD DUP4 LT ISZERO PUSH3 0x168 JUMPI PUSH1 0x2 PUSH1 0x0 DUP7 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH3 0xB2 JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD DUP2 ADD MLOAD PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB AND DUP3 MSTORE DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x40 ADD PUSH1 0x0 KECCAK256 SLOAD PUSH1 0xFF AND ISZERO DUP1 ISZERO PUSH3 0x108 JUMPI POP DUP5 DUP4 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH3 0xF0 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB AND PUSH1 0x0 EQ ISZERO JUMPDEST ISZERO ISZERO PUSH3 0x114 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x1 PUSH1 0x2 PUSH1 0x0 DUP8 DUP7 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH3 0x129 JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP2 SWAP1 SWAP2 ADD DUP2 ADD MLOAD PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB AND DUP3 MSTORE DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x40 ADD PUSH1 0x0 KECCAK256 DUP1 SLOAD PUSH1 0xFF NOT AND SWAP2 ISZERO ISZERO SWAP2 SWAP1 SWAP2 OR SWAP1 SSTORE PUSH1 0x1 SWAP3 SWAP1 SWAP3 ADD SWAP2 PUSH3 0x95 JUMP JUMPDEST DUP5 MLOAD PUSH3 0x17D SWAP1 PUSH1 0x3 SWAP1 PUSH1 0x20 DUP9 ADD SWAP1 PUSH3 0x26C JUMP JUMPDEST POP POP POP PUSH1 0x4 SWAP2 SWAP1 SWAP2 SSTORE POP POP PUSH1 0x6 SSTORE POP PUSH1 0x0 SWAP3 POP POP JUMPDEST DUP5 MLOAD DUP3 LT ISZERO PUSH3 0x260 JUMPI DUP5 DUP3 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH3 0x1AB JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD MLOAD SWAP1 POP PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB DUP2 AND ISZERO ISZERO PUSH3 0x22F JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x494E56414C49445F41535345545F50524F585900000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB DUP2 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x8 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 DUP1 SLOAD PUSH1 0xFF NOT AND PUSH1 0x1 SWAP1 DUP2 OR SWAP1 SWAP2 SSTORE SWAP2 SWAP1 SWAP2 ADD SWAP1 PUSH3 0x192 JUMP JUMPDEST POP POP POP POP POP POP PUSH3 0x300 JUMP JUMPDEST DUP3 DUP1 SLOAD DUP3 DUP3 SSTORE SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 DUP2 ADD SWAP3 DUP3 ISZERO PUSH3 0x2C4 JUMPI SWAP2 PUSH1 0x20 MUL DUP3 ADD JUMPDEST DUP3 DUP2 GT ISZERO PUSH3 0x2C4 JUMPI DUP3 MLOAD DUP3 SLOAD PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB NOT AND PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB SWAP1 SWAP2 AND OR DUP3 SSTORE PUSH1 0x20 SWAP1 SWAP3 ADD SWAP2 PUSH1 0x1 SWAP1 SWAP2 ADD SWAP1 PUSH3 0x28D JUMP JUMPDEST POP PUSH3 0x2D2 SWAP3 SWAP2 POP PUSH3 0x2D6 JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST PUSH3 0x2FD SWAP2 SWAP1 JUMPDEST DUP1 DUP3 GT ISZERO PUSH3 0x2D2 JUMPI DUP1 SLOAD PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB NOT AND DUP2 SSTORE PUSH1 0x1 ADD PUSH3 0x2DD JUMP JUMPDEST SWAP1 JUMP JUMPDEST PUSH2 0x2153 DUP1 PUSH3 0x310 PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN STOP PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x15E JUMPI PUSH4 0xFFFFFFFF PUSH29 0x100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD DIV AND PUSH4 0x25E7C27 DUP2 EQ PUSH2 0x1A0 JUMPI DUP1 PUSH4 0x173825D9 EQ PUSH2 0x1E1 JUMPI DUP1 PUSH4 0x20EA8D86 EQ PUSH2 0x20F JUMPI DUP1 PUSH4 0x2F54BF6E EQ PUSH2 0x227 JUMPI DUP1 PUSH4 0x3411C81C EQ PUSH2 0x269 JUMPI DUP1 PUSH4 0x3589B35C EQ PUSH2 0x29A JUMPI DUP1 PUSH4 0x37BD78A0 EQ PUSH2 0x2B2 JUMPI DUP1 PUSH4 0x54741525 EQ PUSH2 0x2D9 JUMPI DUP1 PUSH4 0x5A1A66AF EQ PUSH2 0x2F8 JUMPI DUP1 PUSH4 0x7065CB48 EQ PUSH2 0x32B JUMPI DUP1 PUSH4 0x784547A7 EQ PUSH2 0x359 JUMPI DUP1 PUSH4 0x7AD28C51 EQ PUSH2 0x371 JUMPI DUP1 PUSH4 0x83250F79 EQ PUSH2 0x389 JUMPI DUP1 PUSH4 0x8B51D13F EQ PUSH2 0x3B7 JUMPI DUP1 PUSH4 0x9ACE38C2 EQ PUSH2 0x3CF JUMPI DUP1 PUSH4 0xA0E67E2B EQ PUSH2 0x4A4 JUMPI DUP1 PUSH4 0xA8ABE69A EQ PUSH2 0x509 JUMPI DUP1 PUSH4 0xB5DC40C3 EQ PUSH2 0x52E JUMPI DUP1 PUSH4 0xB77BF600 EQ PUSH2 0x546 JUMPI DUP1 PUSH4 0xBA51A6DF EQ PUSH2 0x55B JUMPI DUP1 PUSH4 0xC01A8C84 EQ PUSH2 0x573 JUMPI DUP1 PUSH4 0xC6427474 EQ PUSH2 0x58B JUMPI DUP1 PUSH4 0xD38F2D82 EQ PUSH2 0x601 JUMPI DUP1 PUSH4 0xD74F8EDD EQ PUSH2 0x619 JUMPI DUP1 PUSH4 0xDC8452CD EQ PUSH2 0x62E JUMPI DUP1 PUSH4 0xE20056E6 EQ PUSH2 0x643 JUMPI DUP1 PUSH4 0xEE22610B EQ PUSH2 0x677 JUMPI JUMPDEST PUSH1 0x0 CALLVALUE GT ISZERO PUSH2 0x19E JUMPI PUSH1 0x40 DUP1 MLOAD CALLVALUE DUP2 MSTORE SWAP1 MLOAD CALLER SWAP2 PUSH32 0xE1FFFCC4923D04B559F4D29A8BFC6CDA04EB5B0D3C460751C2402C5C5CC9109C SWAP2 SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 LOG2 JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1AC JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1B8 PUSH1 0x4 CALLDATALOAD PUSH2 0x68F JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1ED JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19E PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x6C4 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x21B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19E PUSH1 0x4 CALLDATALOAD PUSH2 0x91B JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x233 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x255 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x9F3 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 ISZERO ISZERO DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x275 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x255 PUSH1 0x4 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x24 CALLDATALOAD AND PUSH2 0xA08 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2A6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19E PUSH1 0x4 CALLDATALOAD PUSH2 0xA28 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2BE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2C7 PUSH2 0xEDA JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2E5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2C7 PUSH1 0x4 CALLDATALOAD ISZERO ISZERO PUSH1 0x24 CALLDATALOAD ISZERO ISZERO PUSH2 0xEE0 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x304 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19E PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD ISZERO ISZERO PUSH2 0xF4C JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x337 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19E PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x100B JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x365 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x255 PUSH1 0x4 CALLDATALOAD PUSH2 0x1180 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x37D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19E PUSH1 0x4 CALLDATALOAD PUSH2 0x1211 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x395 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x255 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x1258 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3C3 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2C7 PUSH1 0x4 CALLDATALOAD PUSH2 0x126D JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3DB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x3E7 PUSH1 0x4 CALLDATALOAD PUSH2 0x12E9 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP5 DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP4 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE DUP5 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x466 JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH2 0x44E JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x493 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP6 POP POP POP POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x4B0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x4B9 PUSH2 0x13D2 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 DUP1 DUP3 MSTORE DUP4 MLOAD DUP2 DUP4 ADD MSTORE DUP4 MLOAD SWAP2 SWAP3 DUP4 SWAP3 SWAP1 DUP4 ADD SWAP2 DUP6 DUP2 ADD SWAP2 MUL DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x4F5 JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH2 0x4DD JUMP JUMPDEST POP POP POP POP SWAP1 POP ADD SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x515 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x4B9 PUSH1 0x4 CALLDATALOAD PUSH1 0x24 CALLDATALOAD PUSH1 0x44 CALLDATALOAD ISZERO ISZERO PUSH1 0x64 CALLDATALOAD ISZERO ISZERO PUSH2 0x1442 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x53A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x4B9 PUSH1 0x4 CALLDATALOAD PUSH2 0x157B JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x552 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2C7 PUSH2 0x1728 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x567 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19E PUSH1 0x4 CALLDATALOAD PUSH2 0x172E JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x57F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19E PUSH1 0x4 CALLDATALOAD PUSH2 0x17AD JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x597 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 PUSH1 0x4 PUSH1 0x44 CALLDATALOAD DUP2 DUP2 ADD CALLDATALOAD PUSH1 0x1F DUP2 ADD DUP5 SWAP1 DIV DUP5 MUL DUP6 ADD DUP5 ADD SWAP1 SWAP6 MSTORE DUP5 DUP5 MSTORE PUSH2 0x2C7 SWAP5 DUP3 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP5 PUSH1 0x24 DUP1 CALLDATALOAD SWAP6 CALLDATASIZE SWAP6 SWAP5 PUSH1 0x64 SWAP5 SWAP3 ADD SWAP2 SWAP1 DUP2 SWAP1 DUP5 ADD DUP4 DUP3 DUP1 DUP3 DUP5 CALLDATACOPY POP SWAP5 SWAP8 POP PUSH2 0x1921 SWAP7 POP POP POP POP POP POP POP JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x60D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2C7 PUSH1 0x4 CALLDATALOAD PUSH2 0x1940 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x625 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2C7 PUSH2 0x1952 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x63A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2C7 PUSH2 0x1957 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x64F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19E PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH2 0x195D JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x683 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19E PUSH1 0x4 CALLDATALOAD PUSH2 0x1B6D JUMP JUMPDEST PUSH1 0x3 DUP1 SLOAD DUP3 SWAP1 DUP2 LT PUSH2 0x69D JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 POP DUP2 JUMP JUMPDEST PUSH1 0x0 CALLER ADDRESS EQ PUSH2 0x6D2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP3 SWAP1 PUSH1 0xFF AND ISZERO ISZERO PUSH2 0x708 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 DUP2 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE SWAP2 POP JUMPDEST PUSH1 0x3 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD DUP3 LT ISZERO PUSH2 0x88B JUMPI DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x3 DUP4 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x7A8 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0x880 JUMPI PUSH1 0x3 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 ADD SWAP1 DUP2 LT PUSH2 0x800 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH1 0x3 DUP1 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND SWAP2 DUP5 SWAP1 DUP2 LT PUSH2 0x833 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH2 0x88B JUMP JUMPDEST PUSH1 0x1 SWAP1 SWAP2 ADD SWAP1 PUSH2 0x756 JUMP JUMPDEST PUSH1 0x3 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 PUSH2 0x8BC SWAP1 DUP3 PUSH2 0x2066 JUMP JUMPDEST POP PUSH1 0x3 SLOAD PUSH1 0x4 SLOAD GT ISZERO PUSH2 0x8D5 JUMPI PUSH1 0x3 SLOAD PUSH2 0x8D5 SWAP1 PUSH2 0x172E JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND SWAP1 PUSH32 0x8001553A916EF2F495D26A907CC54D96ED840D7BDA71E73194BF5A9DF7A76B90 SWAP1 PUSH1 0x0 SWAP1 LOG2 POP POP POP JUMP JUMPDEST CALLER PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND ISZERO ISZERO PUSH2 0x939 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP3 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 CALLER DUP1 DUP6 MSTORE SWAP3 MSTORE SWAP1 SWAP2 KECCAK256 SLOAD DUP4 SWAP2 SWAP1 PUSH1 0xFF AND ISZERO ISZERO PUSH2 0x965 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP5 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x3 ADD SLOAD DUP5 SWAP1 PUSH1 0xFF AND ISZERO PUSH2 0x986 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP6 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 CALLER DUP1 DUP6 MSTORE SWAP3 MSTORE DUP1 DUP4 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE MLOAD DUP8 SWAP3 PUSH32 0xF6A317157440607F36269043EB55F1287A5A19BA2216AFEAB88CD46CBCFB88E9 SWAP2 LOG3 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x0 SWAP3 DUP4 MSTORE PUSH1 0x40 DUP1 DUP5 KECCAK256 SWAP1 SWAP2 MSTORE SWAP1 DUP3 MSTORE SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 DUP2 KECCAK256 PUSH1 0x3 ADD SLOAD DUP3 SWAP1 PUSH1 0xFF AND ISZERO PUSH2 0xA49 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 PUSH2 0xA53 DUP2 PUSH2 0x1180 JUMP JUMPDEST ISZERO ISZERO PUSH2 0xAC0 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x16 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x54585F4E4F545F46554C4C595F434F4E4649524D454400000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x0 DUP5 DUP2 MSTORE PUSH1 0x20 DUP2 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 DUP1 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP5 MSTORE PUSH1 0x8 SWAP1 SWAP3 MSTORE SWAP1 SWAP2 KECCAK256 SLOAD DUP6 SWAP2 SWAP1 PUSH1 0xFF AND ISZERO ISZERO PUSH2 0xB65 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x18 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x554E524547495354455245445F41535345545F50524F58590000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0x72656D6F7665417574686F72697A6564416464726573734174496E6465782861 DUP2 MSTORE PUSH32 0x6464726573732C75696E74323536290000000000000000000000000000000000 PUSH1 0x20 DUP1 DUP4 ADD SWAP2 SWAP1 SWAP2 MSTORE DUP3 MLOAD SWAP2 DUP3 SWAP1 SUB PUSH1 0x2F ADD DUP3 KECCAK256 PUSH1 0x2 DUP1 DUP7 ADD DUP1 SLOAD PUSH1 0x1F PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH2 0x100 PUSH1 0x1 DUP5 AND ISZERO MUL ADD SWAP1 SWAP2 AND SWAP3 SWAP1 SWAP3 DIV SWAP2 DUP3 ADD DUP5 SWAP1 DIV DUP5 MUL DUP6 ADD DUP5 ADD SWAP1 SWAP6 MSTORE DUP1 DUP5 MSTORE PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 SWAP1 SWAP2 AND SWAP4 PUSH2 0xCA1 SWAP4 PUSH1 0x0 SWAP4 SWAP1 SWAP3 SWAP1 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0xC8E JUMPI DUP1 PUSH1 0x1F LT PUSH2 0xC63 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0xC8E JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0xC71 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP PUSH2 0x1DFD SWAP1 SWAP2 SWAP1 PUSH4 0xFFFFFFFF AND JUMP JUMPDEST PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 AND EQ PUSH2 0xD2F JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x19 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x494E56414C49445F46554E4354494F4E5F53454C4543544F5200000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x0 DUP7 DUP2 MSTORE PUSH1 0x20 DUP2 DUP2 MSTORE PUSH1 0x40 SWAP2 DUP3 SWAP1 KECCAK256 PUSH1 0x3 DUP2 ADD DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 SWAP1 DUP2 OR SWAP1 SWAP2 SSTORE DUP2 SLOAD DUP2 DUP4 ADD SLOAD PUSH1 0x2 DUP1 DUP6 ADD DUP1 SLOAD DUP9 MLOAD PUSH1 0x1F PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP8 DUP4 AND ISZERO PUSH2 0x100 MUL SWAP8 SWAP1 SWAP8 ADD SWAP1 SWAP2 AND SWAP3 SWAP1 SWAP3 DIV SWAP5 DUP6 ADD DUP8 SWAP1 DIV DUP8 MUL DUP3 ADD DUP8 ADD SWAP1 SWAP8 MSTORE DUP4 DUP2 MSTORE SWAP4 SWAP11 POP PUSH2 0xE47 SWAP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND SWAP5 SWAP1 SWAP4 SWAP2 SWAP1 DUP4 SWAP1 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0xE3D JUMPI DUP1 PUSH1 0x1F LT PUSH2 0xE12 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0xE3D JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0xE20 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP PUSH2 0x1EC5 JUMP JUMPDEST ISZERO PUSH2 0xE7C JUMPI PUSH1 0x40 MLOAD DUP7 SWAP1 PUSH32 0x33E13ECB54C3076D8E8BB8C2881800A4D972B792045FFAE98FDF46DF365FED75 SWAP1 PUSH1 0x0 SWAP1 LOG2 PUSH2 0xED2 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP7 SWAP1 PUSH32 0x526441BB6C1ABA3C9A4A6CA1D6545DA9C2333C8C48343EF398EB858D72B79236 SWAP1 PUSH1 0x0 SWAP1 LOG2 PUSH1 0x3 DUP6 ADD DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE JUMPDEST POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x6 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 JUMPDEST PUSH1 0x5 SLOAD DUP2 LT ISZERO PUSH2 0xF45 JUMPI DUP4 DUP1 ISZERO PUSH2 0xF0D JUMPI POP PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x3 ADD SLOAD PUSH1 0xFF AND ISZERO JUMPDEST DUP1 PUSH2 0xF31 JUMPI POP DUP3 DUP1 ISZERO PUSH2 0xF31 JUMPI POP PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x3 ADD SLOAD PUSH1 0xFF AND JUMPDEST ISZERO PUSH2 0xF3D JUMPI PUSH1 0x1 DUP3 ADD SWAP2 POP JUMPDEST PUSH1 0x1 ADD PUSH2 0xEE4 JUMP JUMPDEST POP SWAP3 SWAP2 POP POP JUMP JUMPDEST CALLER ADDRESS EQ PUSH2 0xF58 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND ISZERO ISZERO PUSH2 0xF7B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x8 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP2 DUP3 SWAP1 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND DUP7 ISZERO ISZERO SWAP1 DUP2 OR SWAP1 SWAP2 SSTORE DUP3 MLOAD SWAP4 DUP5 MSTORE SWAP1 DUP4 ADD MSTORE DUP1 MLOAD PUSH32 0xDAEF8FF7DC66C5E34EB9C338AAB679D9F427F89868D9228494455A4D982EB2B0 SWAP3 DUP2 SWAP1 SUB SWAP1 SWAP2 ADD SWAP1 LOG1 POP POP POP JUMP JUMPDEST CALLER ADDRESS EQ PUSH2 0x1017 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP2 SWAP1 PUSH1 0xFF AND ISZERO PUSH2 0x104C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND ISZERO ISZERO PUSH2 0x106F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x3 DUP1 SLOAD SWAP1 POP PUSH1 0x1 ADD PUSH1 0x4 SLOAD PUSH1 0x32 DUP3 GT ISZERO DUP1 ISZERO PUSH2 0x108C JUMPI POP DUP2 DUP2 GT ISZERO JUMPDEST DUP1 ISZERO PUSH2 0x1097 JUMPI POP DUP1 ISZERO ISZERO JUMPDEST DUP1 ISZERO PUSH2 0x10A2 JUMPI POP DUP2 ISZERO ISZERO JUMPDEST ISZERO ISZERO PUSH2 0x10AD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP6 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 SWAP1 DUP2 OR SWAP1 SWAP2 SSTORE PUSH1 0x3 DUP1 SLOAD SWAP2 DUP3 ADD DUP2 SSTORE DUP4 MSTORE PUSH32 0xC2575A0E9E593C00F959F8C92F12DB2869C3395A3B0502D05E2516446F71F85B ADD DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND DUP5 OR SWAP1 SSTORE MLOAD PUSH32 0xF39E6E1EB0EDCF53C221607B54B00CD28F3196FED0A24994DC308B8F611B682D SWAP2 SWAP1 LOG2 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP1 JUMPDEST PUSH1 0x3 SLOAD DUP2 LT ISZERO PUSH2 0x120A JUMPI PUSH1 0x0 DUP5 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 DUP2 KECCAK256 PUSH1 0x3 DUP1 SLOAD SWAP2 SWAP3 SWAP2 DUP5 SWAP1 DUP2 LT PUSH2 0x11AE JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 DUP1 DUP4 KECCAK256 SWAP1 SWAP2 ADD SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP4 MSTORE DUP3 ADD SWAP3 SWAP1 SWAP3 MSTORE PUSH1 0x40 ADD SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x11EF JUMPI PUSH1 0x1 DUP3 ADD SWAP2 POP JUMPDEST PUSH1 0x4 SLOAD DUP3 EQ ISZERO PUSH2 0x1202 JUMPI PUSH1 0x1 SWAP3 POP PUSH2 0x120A JUMP JUMPDEST PUSH1 0x1 ADD PUSH2 0x1185 JUMP JUMPDEST POP POP SWAP2 SWAP1 POP JUMP JUMPDEST CALLER ADDRESS EQ PUSH2 0x121D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x6 DUP2 SWAP1 SSTORE PUSH1 0x40 DUP1 MLOAD DUP3 DUP2 MSTORE SWAP1 MLOAD PUSH32 0xD1C9101A34FEFF75CCCEF14A28785A0279CB0B49C1F321F21F5F422E746B4377 SWAP2 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 LOG1 POP JUMP JUMPDEST PUSH1 0x8 PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 JUMPDEST PUSH1 0x3 SLOAD DUP2 LT ISZERO PUSH2 0x12E3 JUMPI PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 DUP2 KECCAK256 PUSH1 0x3 DUP1 SLOAD SWAP2 SWAP3 SWAP2 DUP5 SWAP1 DUP2 LT PUSH2 0x129A JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 DUP1 DUP4 KECCAK256 SWAP1 SWAP2 ADD SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP4 MSTORE DUP3 ADD SWAP3 SWAP1 SWAP3 MSTORE PUSH1 0x40 ADD SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x12DB JUMPI PUSH1 0x1 DUP3 ADD SWAP2 POP JUMPDEST PUSH1 0x1 ADD PUSH2 0x1271 JUMP JUMPDEST POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP2 DUP2 MSTORE SWAP2 DUP2 MSTORE PUSH1 0x40 SWAP1 DUP2 SWAP1 KECCAK256 DUP1 SLOAD PUSH1 0x1 DUP1 DUP4 ADD SLOAD PUSH1 0x2 DUP1 DUP6 ADD DUP1 SLOAD DUP8 MLOAD PUSH2 0x100 SWAP6 DUP3 AND ISZERO SWAP6 SWAP1 SWAP6 MUL PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD AND SWAP2 SWAP1 SWAP2 DIV PUSH1 0x1F DUP2 ADD DUP9 SWAP1 DIV DUP9 MUL DUP5 ADD DUP9 ADD SWAP1 SWAP7 MSTORE DUP6 DUP4 MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP4 AND SWAP6 SWAP1 SWAP5 SWAP2 SWAP3 SWAP2 SWAP1 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0x13BF JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x1394 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x13BF JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x13A2 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP PUSH1 0x3 SWAP1 SWAP4 ADD SLOAD SWAP2 SWAP3 POP POP PUSH1 0xFF AND DUP5 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x3 DUP1 SLOAD DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD DUP1 ISZERO PUSH2 0x1437 JUMPI PUSH1 0x20 MUL DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x1 SWAP1 SWAP2 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x140C JUMPI JUMPDEST POP POP POP POP POP SWAP1 POP JUMPDEST SWAP1 JUMP JUMPDEST PUSH1 0x60 DUP1 PUSH1 0x0 DUP1 PUSH1 0x5 SLOAD PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x1474 JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CODESIZE DUP4 CODECOPY ADD SWAP1 POP JUMPDEST POP SWAP3 POP PUSH1 0x0 SWAP2 POP PUSH1 0x0 SWAP1 POP JUMPDEST PUSH1 0x5 SLOAD DUP2 LT ISZERO PUSH2 0x14FB JUMPI DUP6 DUP1 ISZERO PUSH2 0x14A9 JUMPI POP PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x3 ADD SLOAD PUSH1 0xFF AND ISZERO JUMPDEST DUP1 PUSH2 0x14CD JUMPI POP DUP5 DUP1 ISZERO PUSH2 0x14CD JUMPI POP PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x3 ADD SLOAD PUSH1 0xFF AND JUMPDEST ISZERO PUSH2 0x14F3 JUMPI DUP1 DUP4 DUP4 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x14E1 JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD MSTORE PUSH1 0x1 SWAP2 SWAP1 SWAP2 ADD SWAP1 JUMPDEST PUSH1 0x1 ADD PUSH2 0x1480 JUMP JUMPDEST DUP8 DUP8 SUB PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x1527 JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CODESIZE DUP4 CODECOPY ADD SWAP1 POP JUMPDEST POP SWAP4 POP DUP8 SWAP1 POP JUMPDEST DUP7 DUP2 LT ISZERO PUSH2 0x1570 JUMPI DUP3 DUP2 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1544 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP5 DUP10 DUP4 SUB DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x155E JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD MSTORE PUSH1 0x1 ADD PUSH2 0x152E JUMP JUMPDEST POP POP POP SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x60 DUP1 PUSH1 0x0 DUP1 PUSH1 0x3 DUP1 SLOAD SWAP1 POP PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x15B0 JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CODESIZE DUP4 CODECOPY ADD SWAP1 POP JUMPDEST POP SWAP3 POP PUSH1 0x0 SWAP2 POP PUSH1 0x0 SWAP1 POP JUMPDEST PUSH1 0x3 SLOAD DUP2 LT ISZERO PUSH2 0x1694 JUMPI PUSH1 0x0 DUP6 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 DUP2 KECCAK256 PUSH1 0x3 DUP1 SLOAD SWAP2 SWAP3 SWAP2 DUP5 SWAP1 DUP2 LT PUSH2 0x15E5 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 DUP1 DUP4 KECCAK256 SWAP1 SWAP2 ADD SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP4 MSTORE DUP3 ADD SWAP3 SWAP1 SWAP3 MSTORE PUSH1 0x40 ADD SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x168C JUMPI PUSH1 0x3 DUP1 SLOAD DUP3 SWAP1 DUP2 LT PUSH2 0x162D JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD DUP4 MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP2 AND SWAP1 DUP5 SWAP1 DUP5 SWAP1 DUP2 LT PUSH2 0x1660 JUMPI INVALID JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND PUSH1 0x20 SWAP3 DUP4 MUL SWAP1 SWAP2 ADD SWAP1 SWAP2 ADD MSTORE PUSH1 0x1 SWAP2 SWAP1 SWAP2 ADD SWAP1 JUMPDEST PUSH1 0x1 ADD PUSH2 0x15BC JUMP JUMPDEST DUP2 PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x16BE JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CODESIZE DUP4 CODECOPY ADD SWAP1 POP JUMPDEST POP SWAP4 POP PUSH1 0x0 SWAP1 POP JUMPDEST DUP2 DUP2 LT ISZERO PUSH2 0x1720 JUMPI DUP3 DUP2 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x16DC JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP5 DUP3 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x16F4 JUMPI INVALID JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND PUSH1 0x20 SWAP3 DUP4 MUL SWAP1 SWAP2 ADD SWAP1 SWAP2 ADD MSTORE PUSH1 0x1 ADD PUSH2 0x16C6 JUMP JUMPDEST POP POP POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x5 SLOAD DUP2 JUMP JUMPDEST CALLER ADDRESS EQ PUSH2 0x173A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x3 SLOAD DUP2 PUSH1 0x32 DUP3 GT DUP1 ISZERO SWAP1 PUSH2 0x174F JUMPI POP DUP2 DUP2 GT ISZERO JUMPDEST DUP1 ISZERO PUSH2 0x175A JUMPI POP DUP1 ISZERO ISZERO JUMPDEST DUP1 ISZERO PUSH2 0x1765 JUMPI POP DUP2 ISZERO ISZERO JUMPDEST ISZERO ISZERO PUSH2 0x1770 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x4 DUP4 SWAP1 SSTORE PUSH1 0x40 DUP1 MLOAD DUP5 DUP2 MSTORE SWAP1 MLOAD PUSH32 0xA3F1EE9126A074D9326C682F561767F710E927FAA811F7A99829D49DC421797A SWAP2 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 LOG1 POP POP POP JUMP JUMPDEST CALLER PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND ISZERO ISZERO PUSH2 0x17CB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP3 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP3 SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND ISZERO ISZERO PUSH2 0x17FD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 CALLER DUP1 DUP6 MSTORE SWAP3 MSTORE SWAP1 SWAP2 KECCAK256 SLOAD DUP5 SWAP2 SWAP1 PUSH1 0xFF AND ISZERO PUSH2 0x1828 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP5 PUSH2 0x1832 DUP2 PUSH2 0x1180 JUMP JUMPDEST ISZERO PUSH2 0x189E JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x12 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x54585F46554C4C595F434F4E4649524D45440000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x0 DUP7 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 DUP2 DUP2 MSTORE PUSH1 0x40 DUP1 DUP5 KECCAK256 CALLER DUP1 DUP7 MSTORE SWAP3 MSTORE DUP1 DUP5 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SWAP4 OR SWAP1 SWAP3 SSTORE SWAP1 MLOAD DUP9 SWAP3 PUSH32 0x4A504A94899432A9846E1AA406DCEB1BCFD538BB839071D49D1E5E23F5BE30EF SWAP2 LOG3 PUSH2 0x1912 DUP7 PUSH2 0x1180 JUMP JUMPDEST ISZERO PUSH2 0xED2 JUMPI PUSH2 0xED2 DUP7 TIMESTAMP PUSH2 0x1EE8 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x192E DUP5 DUP5 DUP5 PUSH2 0x1F33 JUMP JUMPDEST SWAP1 POP PUSH2 0x1939 DUP2 PUSH2 0x17AD JUMP JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x7 PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x32 DUP2 JUMP JUMPDEST PUSH1 0x4 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 CALLER ADDRESS EQ PUSH2 0x196B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP4 SWAP1 PUSH1 0xFF AND ISZERO ISZERO PUSH2 0x19A1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP4 SWAP1 PUSH1 0xFF AND ISZERO PUSH2 0x19D6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 SWAP3 POP JUMPDEST PUSH1 0x3 SLOAD DUP4 LT ISZERO PUSH2 0x1A9B JUMPI DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x3 DUP5 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1A0B JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0x1A90 JUMPI DUP4 PUSH1 0x3 DUP5 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1A43 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH2 0x1A9B JUMP JUMPDEST PUSH1 0x1 SWAP1 SWAP3 ADD SWAP2 PUSH2 0x19DB JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP7 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 SWAP1 DUP2 AND SWAP1 SWAP2 SSTORE SWAP4 DUP9 AND DUP3 MSTORE DUP1 DUP3 KECCAK256 DUP1 SLOAD SWAP1 SWAP5 AND PUSH1 0x1 OR SWAP1 SWAP4 SSTORE SWAP2 MLOAD SWAP1 SWAP2 PUSH32 0x8001553A916EF2F495D26A907CC54D96ED840D7BDA71E73194BF5A9DF7A76B90 SWAP2 LOG2 PUSH1 0x40 MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP6 AND SWAP1 PUSH32 0xF39E6E1EB0EDCF53C221607B54B00CD28F3196FED0A24994DC308B8F611B682D SWAP1 PUSH1 0x0 SWAP1 LOG2 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 DUP2 KECCAK256 PUSH1 0x3 ADD SLOAD DUP3 SWAP1 PUSH1 0xFF AND ISZERO PUSH2 0x1B8E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 PUSH2 0x1B98 DUP2 PUSH2 0x1180 JUMP JUMPDEST ISZERO ISZERO PUSH2 0x1C05 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x16 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x54585F4E4F545F46554C4C595F434F4E4649524D454400000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x6 SLOAD PUSH1 0x0 DUP6 DUP2 MSTORE PUSH1 0x7 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP6 SWAP2 ADD TIMESTAMP LT ISZERO PUSH2 0x1C88 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x14 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x54494D455F4C4F434B5F494E434F4D504C455445000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x0 DUP6 DUP2 MSTORE PUSH1 0x20 DUP2 DUP2 MSTORE PUSH1 0x40 SWAP2 DUP3 SWAP1 KECCAK256 PUSH1 0x3 DUP2 ADD DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 SWAP1 DUP2 OR SWAP1 SWAP2 SSTORE DUP2 SLOAD DUP2 DUP4 ADD SLOAD PUSH1 0x2 DUP1 DUP6 ADD DUP1 SLOAD DUP9 MLOAD PUSH1 0x1F PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP8 DUP4 AND ISZERO PUSH2 0x100 MUL SWAP8 SWAP1 SWAP8 ADD SWAP1 SWAP2 AND SWAP3 SWAP1 SWAP3 DIV SWAP5 DUP6 ADD DUP8 SWAP1 DIV DUP8 MUL DUP3 ADD DUP8 ADD SWAP1 SWAP8 MSTORE DUP4 DUP2 MSTORE SWAP4 SWAP10 POP PUSH2 0x1D6B SWAP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND SWAP5 SWAP1 SWAP4 SWAP2 SWAP1 DUP4 SWAP1 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0xE3D JUMPI DUP1 PUSH1 0x1F LT PUSH2 0xE12 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0xE3D JUMP JUMPDEST ISZERO PUSH2 0x1DA0 JUMPI PUSH1 0x40 MLOAD DUP6 SWAP1 PUSH32 0x33E13ECB54C3076D8E8BB8C2881800A4D972B792045FFAE98FDF46DF365FED75 SWAP1 PUSH1 0x0 SWAP1 LOG2 PUSH2 0x1DF6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP6 SWAP1 PUSH32 0x526441BB6C1ABA3C9A4A6CA1D6545DA9C2333C8C48343EF398EB858D72B79236 SWAP1 PUSH1 0x0 SWAP1 LOG2 PUSH1 0x3 DUP5 ADD DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE JUMPDEST POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x4 ADD DUP4 MLOAD LT ISZERO ISZERO ISZERO PUSH2 0x1E9A JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x25 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x475245415445525F4F525F455155414C5F544F5F345F4C454E4754485F524551 PUSH1 0x44 DUP3 ADD MSTORE PUSH32 0x5549524544000000000000000000000000000000000000000000000000000000 PUSH1 0x64 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x84 ADD SWAP1 REVERT JUMPDEST POP ADD PUSH1 0x20 ADD MLOAD PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 AND SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 MLOAD PUSH1 0x20 DUP5 ADD PUSH1 0x0 DUP3 DUP8 DUP4 DUP11 DUP13 PUSH2 0x8796 GAS SUB CALL SWAP9 SWAP8 POP POP POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP2 MSTORE PUSH1 0x7 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP2 DUP3 SWAP1 KECCAK256 DUP4 SWAP1 SSTORE DUP2 MLOAD DUP4 DUP2 MSTORE SWAP2 MLOAD DUP5 SWAP3 PUSH32 0xB237AFE65F1514FD7EA3F923EA4FE792BDD07000A912B6CD1602A8E7F573C8D SWAP3 SWAP1 DUP3 SWAP1 SUB ADD SWAP1 LOG2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND ISZERO ISZERO PUSH2 0x1F58 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x5 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x80 DUP2 ADD DUP3 MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP9 DUP2 AND DUP3 MSTORE PUSH1 0x20 DUP1 DUP4 ADD DUP10 DUP2 MSTORE DUP4 DUP6 ADD DUP10 DUP2 MSTORE PUSH1 0x0 PUSH1 0x60 DUP7 ADD DUP2 SWAP1 MSTORE DUP8 DUP2 MSTORE DUP1 DUP5 MSTORE SWAP6 SWAP1 SWAP6 KECCAK256 DUP5 MLOAD DUP2 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND SWAP5 AND SWAP4 SWAP1 SWAP4 OR DUP4 SSTORE MLOAD PUSH1 0x1 DUP4 ADD SSTORE SWAP3 MLOAD DUP1 MLOAD SWAP5 SWAP7 POP SWAP2 SWAP4 SWAP1 SWAP3 PUSH2 0x1FF0 SWAP3 PUSH1 0x2 DUP6 ADD SWAP3 SWAP2 ADD SWAP1 PUSH2 0x208F JUMP JUMPDEST POP PUSH1 0x60 SWAP2 SWAP1 SWAP2 ADD MLOAD PUSH1 0x3 SWAP1 SWAP2 ADD DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP2 ISZERO ISZERO SWAP2 SWAP1 SWAP2 OR SWAP1 SSTORE PUSH1 0x5 DUP1 SLOAD PUSH1 0x1 ADD SWAP1 SSTORE PUSH1 0x40 MLOAD DUP3 SWAP1 PUSH32 0xC0BA8FE4B176C1714197D43B9CC6BCF797A4A7461C5FE8D0EF6E184AE7601E51 SWAP1 PUSH1 0x0 SWAP1 LOG2 POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST DUP2 SLOAD DUP2 DUP4 SSTORE DUP2 DUP2 GT ISZERO PUSH2 0x208A JUMPI PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x20 SWAP1 KECCAK256 PUSH2 0x208A SWAP2 DUP2 ADD SWAP1 DUP4 ADD PUSH2 0x210D JUMP JUMPDEST POP POP POP JUMP JUMPDEST DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 PUSH1 0x1F ADD PUSH1 0x20 SWAP1 DIV DUP2 ADD SWAP3 DUP3 PUSH1 0x1F LT PUSH2 0x20D0 JUMPI DUP1 MLOAD PUSH1 0xFF NOT AND DUP4 DUP1 ADD OR DUP6 SSTORE PUSH2 0x20FD JUMP JUMPDEST DUP3 DUP1 ADD PUSH1 0x1 ADD DUP6 SSTORE DUP3 ISZERO PUSH2 0x20FD JUMPI SWAP2 DUP3 ADD JUMPDEST DUP3 DUP2 GT ISZERO PUSH2 0x20FD JUMPI DUP3 MLOAD DUP3 SSTORE SWAP2 PUSH1 0x20 ADD SWAP2 SWAP1 PUSH1 0x1 ADD SWAP1 PUSH2 0x20E2 JUMP JUMPDEST POP PUSH2 0x2109 SWAP3 SWAP2 POP PUSH2 0x210D JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST PUSH2 0x143F SWAP2 SWAP1 JUMPDEST DUP1 DUP3 GT ISZERO PUSH2 0x2109 JUMPI PUSH1 0x0 DUP2 SSTORE PUSH1 0x1 ADD PUSH2 0x2113 JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 MSTORE DUP14 0xb3 EXTCODESIZE CALLVALUE 0xdd RETURNDATASIZE DUP8 0xf9 0x27 PUSH6 0xDA5FAC3E1E5D SHL SWAP3 CODECOPY CALLDATALOAD 0x3f PUSH5 0x5405CA9BF 0xc9 0xce 0xe8 0xdb STOP 0x29 ",
- "sourceMap": "707:3438:20:-;;;2298:571;8:9:-1;5:2;;;30:1;27;20:12;5:2;2298:571:20;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2934:14:12;;2298:571:20;;;;;;;;;;2570:9;;;;2298:571;;;;;;;;;;2570:9;;2298:571;839:2:12;2273:29;;;;;:68;;;2331:10;2318:9;:23;;2273:68;:98;;;;-1:-1:-1;2357:14:12;;;2273:98;:129;;;;-1:-1:-1;2387:15:12;;;2273:129;2265:138;;;;;;;;2987:1;2980:8;;2975:151;2992:7;:14;2990:1;:16;2975:151;;;3036:7;:19;3044:7;3052:1;3044:10;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;3036:19:12;;;;;;;;;;;-1:-1:-1;3036:19:12;;;;3035:20;:39;;;;;3059:7;3067:1;3059:10;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;3059:15:12;3073:1;3059:15;;3035:39;3027:48;;;;;;;;3111:4;3089:7;:19;3097:7;3105:1;3097:10;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;3089:19:12;;;;;;;;;;;-1:-1:-1;3089:19:12;:26;;-1:-1:-1;;3089:26:12;;;;;;;;;;-1:-1:-1;3008:3:12;;;;;2975:151;;;3135:16;;;;:6;;:16;;;;;:::i;:::-;-1:-1:-1;;;3161:8:12;:20;;;;-1:-1:-1;;2245:17:13;:38;-1:-1:-1;;;;;2565:298:20;2589:20;:27;2585:1;:31;2565:298;;;2658:20;2679:1;2658:23;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;2720:24:20;;;;2695:102;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;2811:34:20;;;;;;:22;:34;;;;;:41;;-1:-1:-1;;2811:41:20;2848:4;2811:41;;;;;;2618:3;;;;;2565:298;;;2298:571;;;;;;707:3438;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;707:3438:20;-1:-1:-1;;;;;707:3438:20;;;;;;;;;;;-1:-1:-1;707:3438:20;;;;;;;-1:-1:-1;707:3438:20;;;-1:-1:-1;707:3438:20;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;-1:-1:-1;;;;;;707:3438:20;;;;;;;;;:::o;:::-;;;;;;;"
- },
- "deployedBytecode": {
- "linkReferences": {},
- "object": "0x60806040526004361061015e5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663025e7c2781146101a0578063173825d9146101e157806320ea8d861461020f5780632f54bf6e146102275780633411c81c146102695780633589b35c1461029a57806337bd78a0146102b257806354741525146102d95780635a1a66af146102f85780637065cb481461032b578063784547a7146103595780637ad28c511461037157806383250f79146103895780638b51d13f146103b75780639ace38c2146103cf578063a0e67e2b146104a4578063a8abe69a14610509578063b5dc40c31461052e578063b77bf60014610546578063ba51a6df1461055b578063c01a8c8414610573578063c64274741461058b578063d38f2d8214610601578063d74f8edd14610619578063dc8452cd1461062e578063e20056e614610643578063ee22610b14610677575b600034111561019e5760408051348152905133917fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c919081900360200190a25b005b3480156101ac57600080fd5b506101b860043561068f565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b3480156101ed57600080fd5b5061019e73ffffffffffffffffffffffffffffffffffffffff600435166106c4565b34801561021b57600080fd5b5061019e60043561091b565b34801561023357600080fd5b5061025573ffffffffffffffffffffffffffffffffffffffff600435166109f3565b604080519115158252519081900360200190f35b34801561027557600080fd5b5061025560043573ffffffffffffffffffffffffffffffffffffffff60243516610a08565b3480156102a657600080fd5b5061019e600435610a28565b3480156102be57600080fd5b506102c7610eda565b60408051918252519081900360200190f35b3480156102e557600080fd5b506102c760043515156024351515610ee0565b34801561030457600080fd5b5061019e73ffffffffffffffffffffffffffffffffffffffff600435166024351515610f4c565b34801561033757600080fd5b5061019e73ffffffffffffffffffffffffffffffffffffffff6004351661100b565b34801561036557600080fd5b50610255600435611180565b34801561037d57600080fd5b5061019e600435611211565b34801561039557600080fd5b5061025573ffffffffffffffffffffffffffffffffffffffff60043516611258565b3480156103c357600080fd5b506102c760043561126d565b3480156103db57600080fd5b506103e76004356112e9565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018060200183151515158152602001828103825284818151815260200191508051906020019080838360005b8381101561046657818101518382015260200161044e565b50505050905090810190601f1680156104935780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b3480156104b057600080fd5b506104b96113d2565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156104f55781810151838201526020016104dd565b505050509050019250505060405180910390f35b34801561051557600080fd5b506104b960043560243560443515156064351515611442565b34801561053a57600080fd5b506104b960043561157b565b34801561055257600080fd5b506102c7611728565b34801561056757600080fd5b5061019e60043561172e565b34801561057f57600080fd5b5061019e6004356117ad565b34801561059757600080fd5b50604080516020600460443581810135601f81018490048402850184019095528484526102c794823573ffffffffffffffffffffffffffffffffffffffff169460248035953695946064949201919081908401838280828437509497506119219650505050505050565b34801561060d57600080fd5b506102c7600435611940565b34801561062557600080fd5b506102c7611952565b34801561063a57600080fd5b506102c7611957565b34801561064f57600080fd5b5061019e73ffffffffffffffffffffffffffffffffffffffff6004358116906024351661195d565b34801561068357600080fd5b5061019e600435611b6d565b600380548290811061069d57fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b60003330146106d257600080fd5b73ffffffffffffffffffffffffffffffffffffffff8216600090815260026020526040902054829060ff16151561070857600080fd5b73ffffffffffffffffffffffffffffffffffffffff8316600090815260026020526040812080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905591505b6003547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0182101561088b578273ffffffffffffffffffffffffffffffffffffffff166003838154811015156107a857fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16141561088057600380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff810190811061080057fe5b6000918252602090912001546003805473ffffffffffffffffffffffffffffffffffffffff909216918490811061083357fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061088b565b600190910190610756565b600380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01906108bc9082612066565b5060035460045411156108d5576003546108d59061172e565b60405173ffffffffffffffffffffffffffffffffffffffff8416907f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9090600090a2505050565b3360008181526002602052604090205460ff16151561093957600080fd5b60008281526001602090815260408083203380855292529091205483919060ff16151561096557600080fd5b600084815260208190526040902060030154849060ff161561098657600080fd5b600085815260016020908152604080832033808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690555187927ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e991a35050505050565b60026020526000908152604090205460ff1681565b600160209081526000928352604080842090915290825290205460ff1681565b600081815260208190526040812060030154829060ff1615610a4957600080fd5b82610a5381611180565b1515610ac057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f54585f4e4f545f46554c4c595f434f4e4649524d454400000000000000000000604482015290519081900360640190fd5b600084815260208181526040808320805473ffffffffffffffffffffffffffffffffffffffff16845260089092529091205485919060ff161515610b6557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f554e524547495354455245445f41535345545f50524f58590000000000000000604482015290519081900360640190fd5b604080517f72656d6f7665417574686f72697a6564416464726573734174496e646578286181527f6464726573732c75696e74323536290000000000000000000000000000000000602080830191909152825191829003602f01822060028086018054601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61010060018416150201909116929092049182018490048402850184019095528084527fffffffff0000000000000000000000000000000000000000000000000000000090911693610ca193600093909290830182828015610c8e5780601f10610c6357610100808354040283529160200191610c8e565b820191906000526020600020905b815481529060010190602001808311610c7157829003601f168201915b5050505050611dfd90919063ffffffff16565b7fffffffff000000000000000000000000000000000000000000000000000000001614610d2f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f494e56414c49445f46554e4354494f4e5f53454c4543544f5200000000000000604482015290519081900360640190fd5b600086815260208181526040918290206003810180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001908117909155815481830154600280850180548851601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff97831615610100029790970190911692909204948501879004870282018701909752838152939a50610e479573ffffffffffffffffffffffffffffffffffffffff90921694909391908390830182828015610e3d5780601f10610e1257610100808354040283529160200191610e3d565b820191906000526020600020905b815481529060010190602001808311610e2057829003601f168201915b5050505050611ec5565b15610e7c5760405186907f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7590600090a2610ed2565b60405186907f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923690600090a26003850180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690555b505050505050565b60065481565b6000805b600554811015610f4557838015610f0d575060008181526020819052604090206003015460ff16155b80610f315750828015610f31575060008181526020819052604090206003015460ff165b15610f3d576001820191505b600101610ee4565b5092915050565b333014610f5857600080fd5b8173ffffffffffffffffffffffffffffffffffffffff81161515610f7b57600080fd5b73ffffffffffffffffffffffffffffffffffffffff831660008181526008602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001686151590811790915582519384529083015280517fdaef8ff7dc66c5e34eb9c338aab679d9f427f89868d9228494455a4d982eb2b09281900390910190a1505050565b33301461101757600080fd5b73ffffffffffffffffffffffffffffffffffffffff8116600090815260026020526040902054819060ff161561104c57600080fd5b8173ffffffffffffffffffffffffffffffffffffffff8116151561106f57600080fd5b6003805490506001016004546032821115801561108c5750818111155b801561109757508015155b80156110a257508115155b15156110ad57600080fd5b73ffffffffffffffffffffffffffffffffffffffff851660008181526002602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600190811790915560038054918201815583527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001684179055517ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d9190a25050505050565b600080805b60035481101561120a57600084815260016020526040812060038054919291849081106111ae57fe5b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff16835282019290925260400190205460ff16156111ef576001820191505b600454821415611202576001925061120a565b600101611185565b5050919050565b33301461121d57600080fd5b60068190556040805182815290517fd1c9101a34feff75cccef14a28785a0279cb0b49c1f321f21f5f422e746b43779181900360200190a150565b60086020526000908152604090205460ff1681565b6000805b6003548110156112e3576000838152600160205260408120600380549192918490811061129a57fe5b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff16835282019290925260400190205460ff16156112db576001820191505b600101611271565b50919050565b60006020818152918152604090819020805460018083015460028085018054875161010095821615959095027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff011691909104601f810188900488028401880190965285835273ffffffffffffffffffffffffffffffffffffffff909316959094919291908301828280156113bf5780601f10611394576101008083540402835291602001916113bf565b820191906000526020600020905b8154815290600101906020018083116113a257829003601f168201915b5050506003909301549192505060ff1684565b6060600380548060200260200160405190810160405280929190818152602001828054801561143757602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff16815260019091019060200180831161140c575b505050505090505b90565b606080600080600554604051908082528060200260200182016040528015611474578160200160208202803883390190505b50925060009150600090505b6005548110156114fb578580156114a9575060008181526020819052604090206003015460ff16155b806114cd57508480156114cd575060008181526020819052604090206003015460ff165b156114f3578083838151811015156114e157fe5b60209081029091010152600191909101905b600101611480565b878703604051908082528060200260200182016040528015611527578160200160208202803883390190505b5093508790505b8681101561157057828181518110151561154457fe5b906020019060200201518489830381518110151561155e57fe5b6020908102909101015260010161152e565b505050949350505050565b6060806000806003805490506040519080825280602002602001820160405280156115b0578160200160208202803883390190505b50925060009150600090505b60035481101561169457600085815260016020526040812060038054919291849081106115e557fe5b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff16835282019290925260400190205460ff161561168c57600380548290811061162d57fe5b600091825260209091200154835173ffffffffffffffffffffffffffffffffffffffff9091169084908490811061166057fe5b73ffffffffffffffffffffffffffffffffffffffff909216602092830290910190910152600191909101905b6001016115bc565b816040519080825280602002602001820160405280156116be578160200160208202803883390190505b509350600090505b818110156117205782818151811015156116dc57fe5b9060200190602002015184828151811015156116f457fe5b73ffffffffffffffffffffffffffffffffffffffff9092166020928302909101909101526001016116c6565b505050919050565b60055481565b33301461173a57600080fd5b600354816032821180159061174f5750818111155b801561175a57508015155b801561176557508115155b151561177057600080fd5b60048390556040805184815290517fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a9181900360200190a1505050565b3360008181526002602052604090205460ff1615156117cb57600080fd5b600082815260208190526040902054829073ffffffffffffffffffffffffffffffffffffffff1615156117fd57600080fd5b60008381526001602090815260408083203380855292529091205484919060ff161561182857600080fd5b8461183281611180565b1561189e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f54585f46554c4c595f434f4e4649524d45440000000000000000000000000000604482015290519081900360640190fd5b600086815260016020818152604080842033808652925280842080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016909317909255905188927f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef91a361191286611180565b15610ed257610ed28642611ee8565b600061192e848484611f33565b9050611939816117ad565b9392505050565b60076020526000908152604090205481565b603281565b60045481565b600033301461196b57600080fd5b73ffffffffffffffffffffffffffffffffffffffff8316600090815260026020526040902054839060ff1615156119a157600080fd5b73ffffffffffffffffffffffffffffffffffffffff8316600090815260026020526040902054839060ff16156119d657600080fd5b600092505b600354831015611a9b578473ffffffffffffffffffffffffffffffffffffffff16600384815481101515611a0b57fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff161415611a905783600384815481101515611a4357fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611a9b565b6001909201916119db565b73ffffffffffffffffffffffffffffffffffffffff80861660008181526002602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0090811690915593881682528082208054909416600117909355915190917f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9091a260405173ffffffffffffffffffffffffffffffffffffffff8516907ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d90600090a25050505050565b600081815260208190526040812060030154829060ff1615611b8e57600080fd5b82611b9881611180565b1515611c0557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f54585f4e4f545f46554c4c595f434f4e4649524d454400000000000000000000604482015290519081900360640190fd5b600654600085815260076020526040902054859101421015611c8857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f54494d455f4c4f434b5f494e434f4d504c455445000000000000000000000000604482015290519081900360640190fd5b600085815260208181526040918290206003810180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001908117909155815481830154600280850180548851601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff97831615610100029790970190911692909204948501879004870282018701909752838152939950611d6b9573ffffffffffffffffffffffffffffffffffffffff90921694909391908390830182828015610e3d5780601f10610e1257610100808354040283529160200191610e3d565b15611da05760405185907f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7590600090a2611df6565b60405185907f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923690600090a26003840180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690555b5050505050565b600081600401835110151515611e9a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f475245415445525f4f525f455155414c5f544f5f345f4c454e4754485f52455160448201527f5549524544000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b5001602001517fffffffff000000000000000000000000000000000000000000000000000000001690565b6000806040516020840160008287838a8c6187965a03f198975050505050505050565b6000828152600760209081526040918290208390558151838152915184927f0b237afe65f1514fd7ea3f923ea4fe792bdd07000a912b6cd1602a8e7f573c8d92908290030190a25050565b60008373ffffffffffffffffffffffffffffffffffffffff81161515611f5857600080fd5b6005546040805160808101825273ffffffffffffffffffffffffffffffffffffffff8881168252602080830189815283850189815260006060860181905287815280845295909520845181547fffffffffffffffffffffffff00000000000000000000000000000000000000001694169390931783555160018301559251805194965091939092611ff092600285019291019061208f565b5060609190910151600390910180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001691151591909117905560058054600101905560405182907fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5190600090a2509392505050565b81548183558181111561208a5760008381526020902061208a91810190830161210d565b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106120d057805160ff19168380011785556120fd565b828001600101855582156120fd579182015b828111156120fd5782518255916020019190600101906120e2565b5061210992915061210d565b5090565b61143f91905b8082111561210957600081556001016121135600a165627a7a72305820528db33b34dd3d87f92765da5fac3e1e5d1b9239353f6405405ca9bfc9cee8db0029",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x15E JUMPI PUSH4 0xFFFFFFFF PUSH29 0x100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD DIV AND PUSH4 0x25E7C27 DUP2 EQ PUSH2 0x1A0 JUMPI DUP1 PUSH4 0x173825D9 EQ PUSH2 0x1E1 JUMPI DUP1 PUSH4 0x20EA8D86 EQ PUSH2 0x20F JUMPI DUP1 PUSH4 0x2F54BF6E EQ PUSH2 0x227 JUMPI DUP1 PUSH4 0x3411C81C EQ PUSH2 0x269 JUMPI DUP1 PUSH4 0x3589B35C EQ PUSH2 0x29A JUMPI DUP1 PUSH4 0x37BD78A0 EQ PUSH2 0x2B2 JUMPI DUP1 PUSH4 0x54741525 EQ PUSH2 0x2D9 JUMPI DUP1 PUSH4 0x5A1A66AF EQ PUSH2 0x2F8 JUMPI DUP1 PUSH4 0x7065CB48 EQ PUSH2 0x32B JUMPI DUP1 PUSH4 0x784547A7 EQ PUSH2 0x359 JUMPI DUP1 PUSH4 0x7AD28C51 EQ PUSH2 0x371 JUMPI DUP1 PUSH4 0x83250F79 EQ PUSH2 0x389 JUMPI DUP1 PUSH4 0x8B51D13F EQ PUSH2 0x3B7 JUMPI DUP1 PUSH4 0x9ACE38C2 EQ PUSH2 0x3CF JUMPI DUP1 PUSH4 0xA0E67E2B EQ PUSH2 0x4A4 JUMPI DUP1 PUSH4 0xA8ABE69A EQ PUSH2 0x509 JUMPI DUP1 PUSH4 0xB5DC40C3 EQ PUSH2 0x52E JUMPI DUP1 PUSH4 0xB77BF600 EQ PUSH2 0x546 JUMPI DUP1 PUSH4 0xBA51A6DF EQ PUSH2 0x55B JUMPI DUP1 PUSH4 0xC01A8C84 EQ PUSH2 0x573 JUMPI DUP1 PUSH4 0xC6427474 EQ PUSH2 0x58B JUMPI DUP1 PUSH4 0xD38F2D82 EQ PUSH2 0x601 JUMPI DUP1 PUSH4 0xD74F8EDD EQ PUSH2 0x619 JUMPI DUP1 PUSH4 0xDC8452CD EQ PUSH2 0x62E JUMPI DUP1 PUSH4 0xE20056E6 EQ PUSH2 0x643 JUMPI DUP1 PUSH4 0xEE22610B EQ PUSH2 0x677 JUMPI JUMPDEST PUSH1 0x0 CALLVALUE GT ISZERO PUSH2 0x19E JUMPI PUSH1 0x40 DUP1 MLOAD CALLVALUE DUP2 MSTORE SWAP1 MLOAD CALLER SWAP2 PUSH32 0xE1FFFCC4923D04B559F4D29A8BFC6CDA04EB5B0D3C460751C2402C5C5CC9109C SWAP2 SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 LOG2 JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1AC JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1B8 PUSH1 0x4 CALLDATALOAD PUSH2 0x68F JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1ED JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19E PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x6C4 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x21B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19E PUSH1 0x4 CALLDATALOAD PUSH2 0x91B JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x233 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x255 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x9F3 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 ISZERO ISZERO DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x275 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x255 PUSH1 0x4 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x24 CALLDATALOAD AND PUSH2 0xA08 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2A6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19E PUSH1 0x4 CALLDATALOAD PUSH2 0xA28 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2BE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2C7 PUSH2 0xEDA JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2E5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2C7 PUSH1 0x4 CALLDATALOAD ISZERO ISZERO PUSH1 0x24 CALLDATALOAD ISZERO ISZERO PUSH2 0xEE0 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x304 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19E PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD ISZERO ISZERO PUSH2 0xF4C JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x337 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19E PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x100B JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x365 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x255 PUSH1 0x4 CALLDATALOAD PUSH2 0x1180 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x37D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19E PUSH1 0x4 CALLDATALOAD PUSH2 0x1211 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x395 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x255 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x1258 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3C3 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2C7 PUSH1 0x4 CALLDATALOAD PUSH2 0x126D JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3DB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x3E7 PUSH1 0x4 CALLDATALOAD PUSH2 0x12E9 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP5 DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP4 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE DUP5 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x466 JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH2 0x44E JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x493 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP6 POP POP POP POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x4B0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x4B9 PUSH2 0x13D2 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 DUP1 DUP3 MSTORE DUP4 MLOAD DUP2 DUP4 ADD MSTORE DUP4 MLOAD SWAP2 SWAP3 DUP4 SWAP3 SWAP1 DUP4 ADD SWAP2 DUP6 DUP2 ADD SWAP2 MUL DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x4F5 JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH2 0x4DD JUMP JUMPDEST POP POP POP POP SWAP1 POP ADD SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x515 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x4B9 PUSH1 0x4 CALLDATALOAD PUSH1 0x24 CALLDATALOAD PUSH1 0x44 CALLDATALOAD ISZERO ISZERO PUSH1 0x64 CALLDATALOAD ISZERO ISZERO PUSH2 0x1442 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x53A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x4B9 PUSH1 0x4 CALLDATALOAD PUSH2 0x157B JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x552 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2C7 PUSH2 0x1728 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x567 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19E PUSH1 0x4 CALLDATALOAD PUSH2 0x172E JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x57F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19E PUSH1 0x4 CALLDATALOAD PUSH2 0x17AD JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x597 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 PUSH1 0x4 PUSH1 0x44 CALLDATALOAD DUP2 DUP2 ADD CALLDATALOAD PUSH1 0x1F DUP2 ADD DUP5 SWAP1 DIV DUP5 MUL DUP6 ADD DUP5 ADD SWAP1 SWAP6 MSTORE DUP5 DUP5 MSTORE PUSH2 0x2C7 SWAP5 DUP3 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP5 PUSH1 0x24 DUP1 CALLDATALOAD SWAP6 CALLDATASIZE SWAP6 SWAP5 PUSH1 0x64 SWAP5 SWAP3 ADD SWAP2 SWAP1 DUP2 SWAP1 DUP5 ADD DUP4 DUP3 DUP1 DUP3 DUP5 CALLDATACOPY POP SWAP5 SWAP8 POP PUSH2 0x1921 SWAP7 POP POP POP POP POP POP POP JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x60D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2C7 PUSH1 0x4 CALLDATALOAD PUSH2 0x1940 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x625 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2C7 PUSH2 0x1952 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x63A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2C7 PUSH2 0x1957 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x64F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19E PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH2 0x195D JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x683 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19E PUSH1 0x4 CALLDATALOAD PUSH2 0x1B6D JUMP JUMPDEST PUSH1 0x3 DUP1 SLOAD DUP3 SWAP1 DUP2 LT PUSH2 0x69D JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 POP DUP2 JUMP JUMPDEST PUSH1 0x0 CALLER ADDRESS EQ PUSH2 0x6D2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP3 SWAP1 PUSH1 0xFF AND ISZERO ISZERO PUSH2 0x708 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 DUP2 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE SWAP2 POP JUMPDEST PUSH1 0x3 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD DUP3 LT ISZERO PUSH2 0x88B JUMPI DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x3 DUP4 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x7A8 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0x880 JUMPI PUSH1 0x3 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 ADD SWAP1 DUP2 LT PUSH2 0x800 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH1 0x3 DUP1 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND SWAP2 DUP5 SWAP1 DUP2 LT PUSH2 0x833 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH2 0x88B JUMP JUMPDEST PUSH1 0x1 SWAP1 SWAP2 ADD SWAP1 PUSH2 0x756 JUMP JUMPDEST PUSH1 0x3 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 PUSH2 0x8BC SWAP1 DUP3 PUSH2 0x2066 JUMP JUMPDEST POP PUSH1 0x3 SLOAD PUSH1 0x4 SLOAD GT ISZERO PUSH2 0x8D5 JUMPI PUSH1 0x3 SLOAD PUSH2 0x8D5 SWAP1 PUSH2 0x172E JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND SWAP1 PUSH32 0x8001553A916EF2F495D26A907CC54D96ED840D7BDA71E73194BF5A9DF7A76B90 SWAP1 PUSH1 0x0 SWAP1 LOG2 POP POP POP JUMP JUMPDEST CALLER PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND ISZERO ISZERO PUSH2 0x939 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP3 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 CALLER DUP1 DUP6 MSTORE SWAP3 MSTORE SWAP1 SWAP2 KECCAK256 SLOAD DUP4 SWAP2 SWAP1 PUSH1 0xFF AND ISZERO ISZERO PUSH2 0x965 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP5 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x3 ADD SLOAD DUP5 SWAP1 PUSH1 0xFF AND ISZERO PUSH2 0x986 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP6 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 CALLER DUP1 DUP6 MSTORE SWAP3 MSTORE DUP1 DUP4 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE MLOAD DUP8 SWAP3 PUSH32 0xF6A317157440607F36269043EB55F1287A5A19BA2216AFEAB88CD46CBCFB88E9 SWAP2 LOG3 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x0 SWAP3 DUP4 MSTORE PUSH1 0x40 DUP1 DUP5 KECCAK256 SWAP1 SWAP2 MSTORE SWAP1 DUP3 MSTORE SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 DUP2 KECCAK256 PUSH1 0x3 ADD SLOAD DUP3 SWAP1 PUSH1 0xFF AND ISZERO PUSH2 0xA49 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 PUSH2 0xA53 DUP2 PUSH2 0x1180 JUMP JUMPDEST ISZERO ISZERO PUSH2 0xAC0 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x16 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x54585F4E4F545F46554C4C595F434F4E4649524D454400000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x0 DUP5 DUP2 MSTORE PUSH1 0x20 DUP2 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 DUP1 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP5 MSTORE PUSH1 0x8 SWAP1 SWAP3 MSTORE SWAP1 SWAP2 KECCAK256 SLOAD DUP6 SWAP2 SWAP1 PUSH1 0xFF AND ISZERO ISZERO PUSH2 0xB65 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x18 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x554E524547495354455245445F41535345545F50524F58590000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0x72656D6F7665417574686F72697A6564416464726573734174496E6465782861 DUP2 MSTORE PUSH32 0x6464726573732C75696E74323536290000000000000000000000000000000000 PUSH1 0x20 DUP1 DUP4 ADD SWAP2 SWAP1 SWAP2 MSTORE DUP3 MLOAD SWAP2 DUP3 SWAP1 SUB PUSH1 0x2F ADD DUP3 KECCAK256 PUSH1 0x2 DUP1 DUP7 ADD DUP1 SLOAD PUSH1 0x1F PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH2 0x100 PUSH1 0x1 DUP5 AND ISZERO MUL ADD SWAP1 SWAP2 AND SWAP3 SWAP1 SWAP3 DIV SWAP2 DUP3 ADD DUP5 SWAP1 DIV DUP5 MUL DUP6 ADD DUP5 ADD SWAP1 SWAP6 MSTORE DUP1 DUP5 MSTORE PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 SWAP1 SWAP2 AND SWAP4 PUSH2 0xCA1 SWAP4 PUSH1 0x0 SWAP4 SWAP1 SWAP3 SWAP1 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0xC8E JUMPI DUP1 PUSH1 0x1F LT PUSH2 0xC63 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0xC8E JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0xC71 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP PUSH2 0x1DFD SWAP1 SWAP2 SWAP1 PUSH4 0xFFFFFFFF AND JUMP JUMPDEST PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 AND EQ PUSH2 0xD2F JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x19 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x494E56414C49445F46554E4354494F4E5F53454C4543544F5200000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x0 DUP7 DUP2 MSTORE PUSH1 0x20 DUP2 DUP2 MSTORE PUSH1 0x40 SWAP2 DUP3 SWAP1 KECCAK256 PUSH1 0x3 DUP2 ADD DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 SWAP1 DUP2 OR SWAP1 SWAP2 SSTORE DUP2 SLOAD DUP2 DUP4 ADD SLOAD PUSH1 0x2 DUP1 DUP6 ADD DUP1 SLOAD DUP9 MLOAD PUSH1 0x1F PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP8 DUP4 AND ISZERO PUSH2 0x100 MUL SWAP8 SWAP1 SWAP8 ADD SWAP1 SWAP2 AND SWAP3 SWAP1 SWAP3 DIV SWAP5 DUP6 ADD DUP8 SWAP1 DIV DUP8 MUL DUP3 ADD DUP8 ADD SWAP1 SWAP8 MSTORE DUP4 DUP2 MSTORE SWAP4 SWAP11 POP PUSH2 0xE47 SWAP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND SWAP5 SWAP1 SWAP4 SWAP2 SWAP1 DUP4 SWAP1 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0xE3D JUMPI DUP1 PUSH1 0x1F LT PUSH2 0xE12 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0xE3D JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0xE20 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP PUSH2 0x1EC5 JUMP JUMPDEST ISZERO PUSH2 0xE7C JUMPI PUSH1 0x40 MLOAD DUP7 SWAP1 PUSH32 0x33E13ECB54C3076D8E8BB8C2881800A4D972B792045FFAE98FDF46DF365FED75 SWAP1 PUSH1 0x0 SWAP1 LOG2 PUSH2 0xED2 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP7 SWAP1 PUSH32 0x526441BB6C1ABA3C9A4A6CA1D6545DA9C2333C8C48343EF398EB858D72B79236 SWAP1 PUSH1 0x0 SWAP1 LOG2 PUSH1 0x3 DUP6 ADD DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE JUMPDEST POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x6 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 JUMPDEST PUSH1 0x5 SLOAD DUP2 LT ISZERO PUSH2 0xF45 JUMPI DUP4 DUP1 ISZERO PUSH2 0xF0D JUMPI POP PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x3 ADD SLOAD PUSH1 0xFF AND ISZERO JUMPDEST DUP1 PUSH2 0xF31 JUMPI POP DUP3 DUP1 ISZERO PUSH2 0xF31 JUMPI POP PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x3 ADD SLOAD PUSH1 0xFF AND JUMPDEST ISZERO PUSH2 0xF3D JUMPI PUSH1 0x1 DUP3 ADD SWAP2 POP JUMPDEST PUSH1 0x1 ADD PUSH2 0xEE4 JUMP JUMPDEST POP SWAP3 SWAP2 POP POP JUMP JUMPDEST CALLER ADDRESS EQ PUSH2 0xF58 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND ISZERO ISZERO PUSH2 0xF7B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x8 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP2 DUP3 SWAP1 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND DUP7 ISZERO ISZERO SWAP1 DUP2 OR SWAP1 SWAP2 SSTORE DUP3 MLOAD SWAP4 DUP5 MSTORE SWAP1 DUP4 ADD MSTORE DUP1 MLOAD PUSH32 0xDAEF8FF7DC66C5E34EB9C338AAB679D9F427F89868D9228494455A4D982EB2B0 SWAP3 DUP2 SWAP1 SUB SWAP1 SWAP2 ADD SWAP1 LOG1 POP POP POP JUMP JUMPDEST CALLER ADDRESS EQ PUSH2 0x1017 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP2 SWAP1 PUSH1 0xFF AND ISZERO PUSH2 0x104C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND ISZERO ISZERO PUSH2 0x106F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x3 DUP1 SLOAD SWAP1 POP PUSH1 0x1 ADD PUSH1 0x4 SLOAD PUSH1 0x32 DUP3 GT ISZERO DUP1 ISZERO PUSH2 0x108C JUMPI POP DUP2 DUP2 GT ISZERO JUMPDEST DUP1 ISZERO PUSH2 0x1097 JUMPI POP DUP1 ISZERO ISZERO JUMPDEST DUP1 ISZERO PUSH2 0x10A2 JUMPI POP DUP2 ISZERO ISZERO JUMPDEST ISZERO ISZERO PUSH2 0x10AD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP6 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 SWAP1 DUP2 OR SWAP1 SWAP2 SSTORE PUSH1 0x3 DUP1 SLOAD SWAP2 DUP3 ADD DUP2 SSTORE DUP4 MSTORE PUSH32 0xC2575A0E9E593C00F959F8C92F12DB2869C3395A3B0502D05E2516446F71F85B ADD DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND DUP5 OR SWAP1 SSTORE MLOAD PUSH32 0xF39E6E1EB0EDCF53C221607B54B00CD28F3196FED0A24994DC308B8F611B682D SWAP2 SWAP1 LOG2 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP1 JUMPDEST PUSH1 0x3 SLOAD DUP2 LT ISZERO PUSH2 0x120A JUMPI PUSH1 0x0 DUP5 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 DUP2 KECCAK256 PUSH1 0x3 DUP1 SLOAD SWAP2 SWAP3 SWAP2 DUP5 SWAP1 DUP2 LT PUSH2 0x11AE JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 DUP1 DUP4 KECCAK256 SWAP1 SWAP2 ADD SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP4 MSTORE DUP3 ADD SWAP3 SWAP1 SWAP3 MSTORE PUSH1 0x40 ADD SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x11EF JUMPI PUSH1 0x1 DUP3 ADD SWAP2 POP JUMPDEST PUSH1 0x4 SLOAD DUP3 EQ ISZERO PUSH2 0x1202 JUMPI PUSH1 0x1 SWAP3 POP PUSH2 0x120A JUMP JUMPDEST PUSH1 0x1 ADD PUSH2 0x1185 JUMP JUMPDEST POP POP SWAP2 SWAP1 POP JUMP JUMPDEST CALLER ADDRESS EQ PUSH2 0x121D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x6 DUP2 SWAP1 SSTORE PUSH1 0x40 DUP1 MLOAD DUP3 DUP2 MSTORE SWAP1 MLOAD PUSH32 0xD1C9101A34FEFF75CCCEF14A28785A0279CB0B49C1F321F21F5F422E746B4377 SWAP2 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 LOG1 POP JUMP JUMPDEST PUSH1 0x8 PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 JUMPDEST PUSH1 0x3 SLOAD DUP2 LT ISZERO PUSH2 0x12E3 JUMPI PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 DUP2 KECCAK256 PUSH1 0x3 DUP1 SLOAD SWAP2 SWAP3 SWAP2 DUP5 SWAP1 DUP2 LT PUSH2 0x129A JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 DUP1 DUP4 KECCAK256 SWAP1 SWAP2 ADD SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP4 MSTORE DUP3 ADD SWAP3 SWAP1 SWAP3 MSTORE PUSH1 0x40 ADD SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x12DB JUMPI PUSH1 0x1 DUP3 ADD SWAP2 POP JUMPDEST PUSH1 0x1 ADD PUSH2 0x1271 JUMP JUMPDEST POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP2 DUP2 MSTORE SWAP2 DUP2 MSTORE PUSH1 0x40 SWAP1 DUP2 SWAP1 KECCAK256 DUP1 SLOAD PUSH1 0x1 DUP1 DUP4 ADD SLOAD PUSH1 0x2 DUP1 DUP6 ADD DUP1 SLOAD DUP8 MLOAD PUSH2 0x100 SWAP6 DUP3 AND ISZERO SWAP6 SWAP1 SWAP6 MUL PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD AND SWAP2 SWAP1 SWAP2 DIV PUSH1 0x1F DUP2 ADD DUP9 SWAP1 DIV DUP9 MUL DUP5 ADD DUP9 ADD SWAP1 SWAP7 MSTORE DUP6 DUP4 MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP4 AND SWAP6 SWAP1 SWAP5 SWAP2 SWAP3 SWAP2 SWAP1 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0x13BF JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x1394 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x13BF JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x13A2 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP PUSH1 0x3 SWAP1 SWAP4 ADD SLOAD SWAP2 SWAP3 POP POP PUSH1 0xFF AND DUP5 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x3 DUP1 SLOAD DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD DUP1 ISZERO PUSH2 0x1437 JUMPI PUSH1 0x20 MUL DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x1 SWAP1 SWAP2 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x140C JUMPI JUMPDEST POP POP POP POP POP SWAP1 POP JUMPDEST SWAP1 JUMP JUMPDEST PUSH1 0x60 DUP1 PUSH1 0x0 DUP1 PUSH1 0x5 SLOAD PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x1474 JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CODESIZE DUP4 CODECOPY ADD SWAP1 POP JUMPDEST POP SWAP3 POP PUSH1 0x0 SWAP2 POP PUSH1 0x0 SWAP1 POP JUMPDEST PUSH1 0x5 SLOAD DUP2 LT ISZERO PUSH2 0x14FB JUMPI DUP6 DUP1 ISZERO PUSH2 0x14A9 JUMPI POP PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x3 ADD SLOAD PUSH1 0xFF AND ISZERO JUMPDEST DUP1 PUSH2 0x14CD JUMPI POP DUP5 DUP1 ISZERO PUSH2 0x14CD JUMPI POP PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x3 ADD SLOAD PUSH1 0xFF AND JUMPDEST ISZERO PUSH2 0x14F3 JUMPI DUP1 DUP4 DUP4 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x14E1 JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD MSTORE PUSH1 0x1 SWAP2 SWAP1 SWAP2 ADD SWAP1 JUMPDEST PUSH1 0x1 ADD PUSH2 0x1480 JUMP JUMPDEST DUP8 DUP8 SUB PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x1527 JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CODESIZE DUP4 CODECOPY ADD SWAP1 POP JUMPDEST POP SWAP4 POP DUP8 SWAP1 POP JUMPDEST DUP7 DUP2 LT ISZERO PUSH2 0x1570 JUMPI DUP3 DUP2 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1544 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP5 DUP10 DUP4 SUB DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x155E JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD MSTORE PUSH1 0x1 ADD PUSH2 0x152E JUMP JUMPDEST POP POP POP SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x60 DUP1 PUSH1 0x0 DUP1 PUSH1 0x3 DUP1 SLOAD SWAP1 POP PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x15B0 JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CODESIZE DUP4 CODECOPY ADD SWAP1 POP JUMPDEST POP SWAP3 POP PUSH1 0x0 SWAP2 POP PUSH1 0x0 SWAP1 POP JUMPDEST PUSH1 0x3 SLOAD DUP2 LT ISZERO PUSH2 0x1694 JUMPI PUSH1 0x0 DUP6 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 DUP2 KECCAK256 PUSH1 0x3 DUP1 SLOAD SWAP2 SWAP3 SWAP2 DUP5 SWAP1 DUP2 LT PUSH2 0x15E5 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 DUP1 DUP4 KECCAK256 SWAP1 SWAP2 ADD SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP4 MSTORE DUP3 ADD SWAP3 SWAP1 SWAP3 MSTORE PUSH1 0x40 ADD SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x168C JUMPI PUSH1 0x3 DUP1 SLOAD DUP3 SWAP1 DUP2 LT PUSH2 0x162D JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD DUP4 MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP2 AND SWAP1 DUP5 SWAP1 DUP5 SWAP1 DUP2 LT PUSH2 0x1660 JUMPI INVALID JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND PUSH1 0x20 SWAP3 DUP4 MUL SWAP1 SWAP2 ADD SWAP1 SWAP2 ADD MSTORE PUSH1 0x1 SWAP2 SWAP1 SWAP2 ADD SWAP1 JUMPDEST PUSH1 0x1 ADD PUSH2 0x15BC JUMP JUMPDEST DUP2 PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x16BE JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CODESIZE DUP4 CODECOPY ADD SWAP1 POP JUMPDEST POP SWAP4 POP PUSH1 0x0 SWAP1 POP JUMPDEST DUP2 DUP2 LT ISZERO PUSH2 0x1720 JUMPI DUP3 DUP2 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x16DC JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP5 DUP3 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x16F4 JUMPI INVALID JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND PUSH1 0x20 SWAP3 DUP4 MUL SWAP1 SWAP2 ADD SWAP1 SWAP2 ADD MSTORE PUSH1 0x1 ADD PUSH2 0x16C6 JUMP JUMPDEST POP POP POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x5 SLOAD DUP2 JUMP JUMPDEST CALLER ADDRESS EQ PUSH2 0x173A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x3 SLOAD DUP2 PUSH1 0x32 DUP3 GT DUP1 ISZERO SWAP1 PUSH2 0x174F JUMPI POP DUP2 DUP2 GT ISZERO JUMPDEST DUP1 ISZERO PUSH2 0x175A JUMPI POP DUP1 ISZERO ISZERO JUMPDEST DUP1 ISZERO PUSH2 0x1765 JUMPI POP DUP2 ISZERO ISZERO JUMPDEST ISZERO ISZERO PUSH2 0x1770 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x4 DUP4 SWAP1 SSTORE PUSH1 0x40 DUP1 MLOAD DUP5 DUP2 MSTORE SWAP1 MLOAD PUSH32 0xA3F1EE9126A074D9326C682F561767F710E927FAA811F7A99829D49DC421797A SWAP2 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 LOG1 POP POP POP JUMP JUMPDEST CALLER PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND ISZERO ISZERO PUSH2 0x17CB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP3 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP3 SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND ISZERO ISZERO PUSH2 0x17FD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 CALLER DUP1 DUP6 MSTORE SWAP3 MSTORE SWAP1 SWAP2 KECCAK256 SLOAD DUP5 SWAP2 SWAP1 PUSH1 0xFF AND ISZERO PUSH2 0x1828 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP5 PUSH2 0x1832 DUP2 PUSH2 0x1180 JUMP JUMPDEST ISZERO PUSH2 0x189E JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x12 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x54585F46554C4C595F434F4E4649524D45440000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x0 DUP7 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 DUP2 DUP2 MSTORE PUSH1 0x40 DUP1 DUP5 KECCAK256 CALLER DUP1 DUP7 MSTORE SWAP3 MSTORE DUP1 DUP5 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SWAP4 OR SWAP1 SWAP3 SSTORE SWAP1 MLOAD DUP9 SWAP3 PUSH32 0x4A504A94899432A9846E1AA406DCEB1BCFD538BB839071D49D1E5E23F5BE30EF SWAP2 LOG3 PUSH2 0x1912 DUP7 PUSH2 0x1180 JUMP JUMPDEST ISZERO PUSH2 0xED2 JUMPI PUSH2 0xED2 DUP7 TIMESTAMP PUSH2 0x1EE8 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x192E DUP5 DUP5 DUP5 PUSH2 0x1F33 JUMP JUMPDEST SWAP1 POP PUSH2 0x1939 DUP2 PUSH2 0x17AD JUMP JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x7 PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x32 DUP2 JUMP JUMPDEST PUSH1 0x4 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 CALLER ADDRESS EQ PUSH2 0x196B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP4 SWAP1 PUSH1 0xFF AND ISZERO ISZERO PUSH2 0x19A1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP4 SWAP1 PUSH1 0xFF AND ISZERO PUSH2 0x19D6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 SWAP3 POP JUMPDEST PUSH1 0x3 SLOAD DUP4 LT ISZERO PUSH2 0x1A9B JUMPI DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x3 DUP5 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1A0B JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0x1A90 JUMPI DUP4 PUSH1 0x3 DUP5 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1A43 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH2 0x1A9B JUMP JUMPDEST PUSH1 0x1 SWAP1 SWAP3 ADD SWAP2 PUSH2 0x19DB JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP7 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 SWAP1 DUP2 AND SWAP1 SWAP2 SSTORE SWAP4 DUP9 AND DUP3 MSTORE DUP1 DUP3 KECCAK256 DUP1 SLOAD SWAP1 SWAP5 AND PUSH1 0x1 OR SWAP1 SWAP4 SSTORE SWAP2 MLOAD SWAP1 SWAP2 PUSH32 0x8001553A916EF2F495D26A907CC54D96ED840D7BDA71E73194BF5A9DF7A76B90 SWAP2 LOG2 PUSH1 0x40 MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP6 AND SWAP1 PUSH32 0xF39E6E1EB0EDCF53C221607B54B00CD28F3196FED0A24994DC308B8F611B682D SWAP1 PUSH1 0x0 SWAP1 LOG2 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 DUP2 KECCAK256 PUSH1 0x3 ADD SLOAD DUP3 SWAP1 PUSH1 0xFF AND ISZERO PUSH2 0x1B8E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 PUSH2 0x1B98 DUP2 PUSH2 0x1180 JUMP JUMPDEST ISZERO ISZERO PUSH2 0x1C05 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x16 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x54585F4E4F545F46554C4C595F434F4E4649524D454400000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x6 SLOAD PUSH1 0x0 DUP6 DUP2 MSTORE PUSH1 0x7 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP6 SWAP2 ADD TIMESTAMP LT ISZERO PUSH2 0x1C88 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x14 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x54494D455F4C4F434B5F494E434F4D504C455445000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x0 DUP6 DUP2 MSTORE PUSH1 0x20 DUP2 DUP2 MSTORE PUSH1 0x40 SWAP2 DUP3 SWAP1 KECCAK256 PUSH1 0x3 DUP2 ADD DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 SWAP1 DUP2 OR SWAP1 SWAP2 SSTORE DUP2 SLOAD DUP2 DUP4 ADD SLOAD PUSH1 0x2 DUP1 DUP6 ADD DUP1 SLOAD DUP9 MLOAD PUSH1 0x1F PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP8 DUP4 AND ISZERO PUSH2 0x100 MUL SWAP8 SWAP1 SWAP8 ADD SWAP1 SWAP2 AND SWAP3 SWAP1 SWAP3 DIV SWAP5 DUP6 ADD DUP8 SWAP1 DIV DUP8 MUL DUP3 ADD DUP8 ADD SWAP1 SWAP8 MSTORE DUP4 DUP2 MSTORE SWAP4 SWAP10 POP PUSH2 0x1D6B SWAP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND SWAP5 SWAP1 SWAP4 SWAP2 SWAP1 DUP4 SWAP1 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0xE3D JUMPI DUP1 PUSH1 0x1F LT PUSH2 0xE12 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0xE3D JUMP JUMPDEST ISZERO PUSH2 0x1DA0 JUMPI PUSH1 0x40 MLOAD DUP6 SWAP1 PUSH32 0x33E13ECB54C3076D8E8BB8C2881800A4D972B792045FFAE98FDF46DF365FED75 SWAP1 PUSH1 0x0 SWAP1 LOG2 PUSH2 0x1DF6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP6 SWAP1 PUSH32 0x526441BB6C1ABA3C9A4A6CA1D6545DA9C2333C8C48343EF398EB858D72B79236 SWAP1 PUSH1 0x0 SWAP1 LOG2 PUSH1 0x3 DUP5 ADD DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE JUMPDEST POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x4 ADD DUP4 MLOAD LT ISZERO ISZERO ISZERO PUSH2 0x1E9A JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x25 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x475245415445525F4F525F455155414C5F544F5F345F4C454E4754485F524551 PUSH1 0x44 DUP3 ADD MSTORE PUSH32 0x5549524544000000000000000000000000000000000000000000000000000000 PUSH1 0x64 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x84 ADD SWAP1 REVERT JUMPDEST POP ADD PUSH1 0x20 ADD MLOAD PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 AND SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 MLOAD PUSH1 0x20 DUP5 ADD PUSH1 0x0 DUP3 DUP8 DUP4 DUP11 DUP13 PUSH2 0x8796 GAS SUB CALL SWAP9 SWAP8 POP POP POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP2 MSTORE PUSH1 0x7 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP2 DUP3 SWAP1 KECCAK256 DUP4 SWAP1 SSTORE DUP2 MLOAD DUP4 DUP2 MSTORE SWAP2 MLOAD DUP5 SWAP3 PUSH32 0xB237AFE65F1514FD7EA3F923EA4FE792BDD07000A912B6CD1602A8E7F573C8D SWAP3 SWAP1 DUP3 SWAP1 SUB ADD SWAP1 LOG2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND ISZERO ISZERO PUSH2 0x1F58 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x5 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x80 DUP2 ADD DUP3 MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP9 DUP2 AND DUP3 MSTORE PUSH1 0x20 DUP1 DUP4 ADD DUP10 DUP2 MSTORE DUP4 DUP6 ADD DUP10 DUP2 MSTORE PUSH1 0x0 PUSH1 0x60 DUP7 ADD DUP2 SWAP1 MSTORE DUP8 DUP2 MSTORE DUP1 DUP5 MSTORE SWAP6 SWAP1 SWAP6 KECCAK256 DUP5 MLOAD DUP2 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND SWAP5 AND SWAP4 SWAP1 SWAP4 OR DUP4 SSTORE MLOAD PUSH1 0x1 DUP4 ADD SSTORE SWAP3 MLOAD DUP1 MLOAD SWAP5 SWAP7 POP SWAP2 SWAP4 SWAP1 SWAP3 PUSH2 0x1FF0 SWAP3 PUSH1 0x2 DUP6 ADD SWAP3 SWAP2 ADD SWAP1 PUSH2 0x208F JUMP JUMPDEST POP PUSH1 0x60 SWAP2 SWAP1 SWAP2 ADD MLOAD PUSH1 0x3 SWAP1 SWAP2 ADD DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP2 ISZERO ISZERO SWAP2 SWAP1 SWAP2 OR SWAP1 SSTORE PUSH1 0x5 DUP1 SLOAD PUSH1 0x1 ADD SWAP1 SSTORE PUSH1 0x40 MLOAD DUP3 SWAP1 PUSH32 0xC0BA8FE4B176C1714197D43B9CC6BCF797A4A7461C5FE8D0EF6E184AE7601E51 SWAP1 PUSH1 0x0 SWAP1 LOG2 POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST DUP2 SLOAD DUP2 DUP4 SSTORE DUP2 DUP2 GT ISZERO PUSH2 0x208A JUMPI PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x20 SWAP1 KECCAK256 PUSH2 0x208A SWAP2 DUP2 ADD SWAP1 DUP4 ADD PUSH2 0x210D JUMP JUMPDEST POP POP POP JUMP JUMPDEST DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 PUSH1 0x1F ADD PUSH1 0x20 SWAP1 DIV DUP2 ADD SWAP3 DUP3 PUSH1 0x1F LT PUSH2 0x20D0 JUMPI DUP1 MLOAD PUSH1 0xFF NOT AND DUP4 DUP1 ADD OR DUP6 SSTORE PUSH2 0x20FD JUMP JUMPDEST DUP3 DUP1 ADD PUSH1 0x1 ADD DUP6 SSTORE DUP3 ISZERO PUSH2 0x20FD JUMPI SWAP2 DUP3 ADD JUMPDEST DUP3 DUP2 GT ISZERO PUSH2 0x20FD JUMPI DUP3 MLOAD DUP3 SSTORE SWAP2 PUSH1 0x20 ADD SWAP2 SWAP1 PUSH1 0x1 ADD SWAP1 PUSH2 0x20E2 JUMP JUMPDEST POP PUSH2 0x2109 SWAP3 SWAP2 POP PUSH2 0x210D JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST PUSH2 0x143F SWAP2 SWAP1 JUMPDEST DUP1 DUP3 GT ISZERO PUSH2 0x2109 JUMPI PUSH1 0x0 DUP2 SSTORE PUSH1 0x1 ADD PUSH2 0x2113 JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 MSTORE DUP14 0xb3 EXTCODESIZE CALLVALUE 0xdd RETURNDATASIZE DUP8 0xf9 0x27 PUSH6 0xDA5FAC3E1E5D SHL SWAP3 CODECOPY CALLDATALOAD 0x3f PUSH5 0x5405CA9BF 0xc9 0xce 0xe8 0xdb STOP 0x29 ",
- "sourceMap": "707:3438:20:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2540:1:12;2528:9;:13;2524:61;;;2555:30;;;2575:9;2555:30;;;;2563:10;;2555:30;;;;;;;;;;2524:61;707:3438:20;1050:23:12;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1050:23:12;;;;;;;;;;;;;;;;;;;;;;;;3715:460;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;3715:460:12;;;;;;;6281:291;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;6281:291:12;;;;;1004:40;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1004:40:12;;;;;;;;;;;;;;;;;;;;;;;;;934:64;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;934:64:12;;;;;;;;;3583:560:20;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;3583:560:20;;;;;1057:32:13;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1057:32:13;;;;;;;;;;;;;;;;;;;;10535:319:12;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;10535:319:12;;;;;;;;;;;3153:294:20;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;3153:294:20;;;;;;;;;;;3315:277:12;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;3315:277:12;;;;;;;8703:337;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;8703:337:12;;;;;2494:194:13;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2494:194:13;;;;;1055:55:20;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1055:55:20;;;;;;;10021:252:12;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;10021:252:12;;;;;879:49;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;879:49:12;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;879:49:12;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10938:115;;8:9:-1;5:2;;;30:1;27;20:12;5:2;10938:115:12;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:100:-1;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;10938:115:12;;;;;;;;;;;;;;;;;12156:676;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;12156:676:12;;;;;;;;;;;;;;;11232:575;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;11232:575:12;;;;;1105:28;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1105:28:12;;;;4997:207;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;4997:207:12;;;;;2794:467:13;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2794:467:13;;;;;5463:244:12;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;5463:244:12;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;5463:244:12;;-1:-1:-1;5463:244:12;;-1:-1:-1;;;;;;;5463:244:12;1096:53:13;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1096:53:13;;;;;800:41:12;;8:9:-1;5:2;;;30:1;27;20:12;5:2;800:41:12;;;;1079:20;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1079:20:12;;;;4377:449;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;4377:449:12;;;;;;;;;;;;3375:516:13;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;3375:516:13;;;;;1050:23:12;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1050:23:12;:::o;3715:460::-;3863:6;1337:10;1359:4;1337:27;1329:36;;;;;;1543:14;;;;;;;:7;:14;;;;;;3805:5;;1543:14;;1535:23;;;;;;;;3826:14;;;3843:5;3826:14;;;:7;:14;;;;;:22;;;;;;3843:5;-1:-1:-1;3858:170:12;3875:6;:13;:17;;3873:19;;3858:170;;;3928:5;3915:18;;:6;3922:1;3915:9;;;;;;;;;;;;;;;;;;;;;;:18;3911:117;;;3965:6;3972:13;;:17;;;;3965:25;;;;;;;;;;;;;;;;3953:6;:9;;3965:25;;;;;3960:1;;3953:9;;;;;;;;;;;;;;:37;;;;;;;;;;;;;;;;;;4008:5;;3911:117;3894:3;;;;;3858:170;;;4037:6;:18;;;;;;;;;:::i;:::-;-1:-1:-1;4080:6:12;:13;4069:8;;:24;4065:74;;;4125:6;:13;4107:32;;:17;:32::i;:::-;4149:19;;;;;;;;;;;1375:1;3715:460;;:::o;6281:291::-;6364:10;1543:14;;;;:7;:14;;;;;;;;1535:23;;;;;;;;1788:28;;;;:13;:28;;;;;;;;6409:10;1788:35;;;;;;;;;6394:13;;6409:10;1788:35;;1780:44;;;;;;;;2044:12;:27;;;;;;;;;;:36;;;6441:13;;2044:36;;2043:37;2035:46;;;;;;6513:5;6470:28;;;:13;:28;;;;;;;;6499:10;6470:40;;;;;;;;:48;;;;;;6528:37;6484:13;;6528:37;;;1834:1;1568;;6281:291;;:::o;1004:40::-;;;;;;;;;;;;;;;:::o;934:64::-;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;3583:560:20:-;3816:23;2044:27:12;;;;;;;;;;:36;;;3688:13:20;;2044:36:12;;2043:37;2035:46;;;;;;3726:13:20;1410:26:13;1422:13;1410:11;:26::i;:::-;1389:95;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1492:23:20;1518:27;;;;;;;;;;;1599:15;;;;1576:39;;:22;:39;;;;;;;3787:13;;1518:27;1576:39;;1555:110;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1195:60;;;;;;;;;;;;;;;;;;;;;;;;;1696:8;;;;:19;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:69;;;;;:22;;-1:-1:-1;;1195:60:20;;1696:19;;;:8;:19;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:22;;;;:::i;:::-;:69;;;1675:141;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3842:12;:27;;;;;;;;;;;;3879:12;;;:19;;;;3894:4;3879:19;;;;;;3926:15;;3943:9;;;;3954:8;;;;:15;;3912:68;;;3954:15;;;;;3879:19;3954:15;;;;;;;;;;;;3912:68;;;;;;;;;;;;;;;;;;3842:27;;-1:-1:-1;3912:68:20;;3926:15;;;;;3943:9;;3912:68;3954:8;:15;;3912:68;;3954:8;:15;3912:68;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:13;:68::i;:::-;3908:229;;;4001:24;;4011:13;;4001:24;;;;;3908:229;;;4061:31;;4078:13;;4061:31;;;;;4106:12;;;:20;;;;;;3908:229;1494:1:13;;2091::12;3583:560:20;;;:::o;1057:32:13:-;;;;:::o;10535:319:12:-;10642:10;;10668:179;10685:16;;10683:1;:18;10668:179;;;10727:7;:36;;;;-1:-1:-1;10739:12:12;:15;;;;;;;;;;:24;;;;;10738:25;10727:36;:92;;;;10783:8;:36;;;;-1:-1:-1;10795:12:12;:15;;;;;;;;;;:24;;;;;10783:36;10720:127;;;10846:1;10837:10;;;;10720:127;10703:3;;10668:179;;;10535:319;;;;;:::o;3153:294:20:-;1337:10:12;1359:4;1337:27;1329:36;;;;;;3278:18:20;2158:13:12;;;;;2150:22;;;;;;3312:42:20;;;;;;;:22;:42;;;;;;;;;:57;;;;;;;;;;;;;3384:56;;;;;;;;;;;;;;;;;;;;;1375:1:12;3153:294:20;;:::o;3315:277:12:-;1337:10;1359:4;1337:27;1329:36;;;;;;1450:14;;;;;;;:7;:14;;;;;;3408:5;;1450:14;;1449:15;1441:24;;;;;;3431:5;2158:13;;;;;2150:22;;;;;;3463:6;:13;;;;3479:1;3463:17;3482:8;;839:2;2273:10;:29;;:68;;;;;2331:10;2318:9;:23;;2273:68;:98;;;;-1:-1:-1;2357:14:12;;;2273:98;:129;;;;-1:-1:-1;2387:15:12;;;2273:129;2265:138;;;;;;;;3506:14;;;;;;;:7;:14;;;;;;:21;;;;3523:4;3506:21;;;;;;3537:6;27:10:-1;;23:18;;;45:23;;3537:18:12;;;;;;;;;;;;3565:20;;;3506:14;3565:20;2182:1;;1475;1375;3315:277;:::o;8703:337::-;8793:4;;;8837:197;8854:6;:13;8852:15;;8837:197;;;8892:28;;;;:13;:28;;;;;8921:6;:9;;8892:28;;;8928:1;;8921:9;;;;;;;;;;;;;;;;;;;;8892:39;;;;;;;;;;;;;;;8888:71;;;8958:1;8949:10;;;;8888:71;8986:8;;8977:5;:17;8973:50;;;9019:4;9012:11;;;;8973:50;8869:3;;8837:197;;;8703:337;;;;;:::o;2494:194:13:-;1337:10:12;1359:4;1337:27;1329:36;;;;;;2594:17:13;:38;;;2647:34;;;;;;;;;;;;;;;;;2494:194;:::o;1055:55:20:-;;;;;;;;;;;;;;;:::o;10021:252:12:-;10120:10;;10146:120;10163:6;:13;10161:15;;10146:120;;;10199:28;;;;:13;:28;;;;;10228:6;:9;;10199:28;;;10235:1;;10228:9;;;;;;;;;;;;;;;;;;;;10199:39;;;;;;;;;;;;;;;10195:71;;;10265:1;10256:10;;;;10195:71;10178:3;;10146:120;;;10021:252;;;;:::o;879:49::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;879:49:12;;;;;;;-1:-1:-1;;879:49:12;;;:::o;10938:115::-;11008:9;11040:6;11033:13;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10938:115;;:::o;12156:676::-;12281:22;12319:32;12392:10;12416:6;12365:16;;12354:28;;;;;;;;;;;;;;;;;;;;;;29:2:-1;21:6;17:15;117:4;105:10;97:6;88:34;136:17;;-1:-1;12354:28:12;;12319:63;;12405:1;12392:14;;12439:1;12437:3;;12432:250;12444:16;;12442:1;:18;12432:250;;;12486:7;:36;;;;-1:-1:-1;12498:12:12;:15;;;;;;;;;;:24;;;;;12497:25;12486:36;:92;;;;12542:8;:36;;;;-1:-1:-1;12554:12:12;:15;;;;;;;;;;:24;;;;;12542:36;12479:203;;;12638:1;12610:18;12629:5;12610:25;;;;;;;;;;;;;;;;;;:29;12666:1;12657:10;;;;;12479:203;12462:3;;12432:250;;;12725:4;12720:2;:9;12709:21;;;;;;;;;;;;;;;;;;;;;;29:2:-1;21:6;17:15;117:4;105:10;97:6;88:34;136:17;;-1:-1;12709:21:12;;12691:39;;12747:4;12745:6;;12740:85;12755:2;12753:1;:4;12740:85;;;12804:18;12823:1;12804:21;;;;;;;;;;;;;;;;;;12776:15;12796:4;12792:1;:8;12776:25;;;;;;;;;;;;;;;;;;:49;12759:3;;12740:85;;;12156:676;;;;;;;;;:::o;11232:575::-;11327:24;11367:34;11442:10;11466:6;11418;:13;;;;11404:28;;;;;;;;;;;;;;;;;;;;;;29:2:-1;21:6;17:15;117:4;105:10;97:6;88:34;136:17;;-1:-1;11404:28:12;;11367:65;;11455:1;11442:14;;11489:1;11487:3;;11482:186;11494:6;:13;11492:15;;11482:186;;;11530:28;;;;:13;:28;;;;;11559:6;:9;;11530:28;;;11566:1;;11559:9;;;;;;;;;;;;;;;;;;;;11530:39;;;;;;;;;;;;;;;11526:142;;;11616:6;:9;;11623:1;;11616:9;;;;;;;;;;;;;;;;11589:24;;11616:9;;;;;11589:17;;11607:5;;11589:24;;;;;;:36;;;;:24;;;;;;;;;;:36;11652:1;11643:10;;;;;11526:142;11509:3;;11482:186;;;11708:5;11694:20;;;;;;;;;;;;;;;;;;;;;;29:2:-1;21:6;17:15;117:4;105:10;97:6;88:34;136:17;;-1:-1;11694:20:12;;11677:37;;11731:1;11729:3;;11724:76;11736:5;11734:1;:7;11724:76;;;11780:17;11798:1;11780:20;;;;;;;;;;;;;;;;;;11760:14;11775:1;11760:17;;;;;;;;;;:40;;;;:17;;;;;;;;;;:40;11743:3;;11724:76;;;11232:575;;;;;;:::o;1105:28::-;;;;:::o;4997:207::-;1337:10;1359:4;1337:27;1329:36;;;;;;5099:6;:13;5114:9;839:2;2273:29;;;;;:68;;;2331:10;2318:9;:23;;2273:68;:98;;;;-1:-1:-1;2357:14:12;;;2273:98;:129;;;;-1:-1:-1;2387:15:12;;;2273:129;2265:138;;;;;;;;5139:8;:20;;;5169:28;;;;;;;;;;;;;;;;;1375:1;;4997:207;:::o;2794:467:13:-;2880:10;1543:14:12;;;;:7;:14;;;;;;;;1535:23;;;;;;;;1647:12;:27;;;;;;;;;;:39;2918:13:13;;1647:39:12;;:44;;1639:53;;;;;;1924:28;;;;:13;:28;;;;;;;;2969:10:13;1924:35:12;;;;;;;;;2954:13:13;;2969:10;1924:35:12;;1923:36;1915:45;;;;;;3007:13:13;1238:26;1250:13;1238:11;:26::i;:::-;1237:27;1216:92;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3036:28;;;;3079:4;3036:28;;;;;;;;3065:10;3036:40;;;;;;;;:47;;;;;;;;;;3098:39;;3050:13;;3098:39;;;3151:26;3163:13;3151:11;:26::i;:::-;3147:108;;;3193:51;3213:13;3228:15;3193:19;:51::i;5463:244:12:-;5567:18;5617:40;5632:11;5645:5;5652:4;5617:14;:40::i;:::-;5601:56;;5667:33;5686:13;5667:18;:33::i;:::-;5463:244;;;;;:::o;1096:53:13:-;;;;;;;;;;;;;:::o;800:41:12:-;839:2;800:41;:::o;1079:20::-;;;;:::o;4377:449::-;4548:6;1337:10;1359:4;1337:27;1329:36;;;;;;1543:14;;;;;;;:7;:14;;;;;;4486:5;;1543:14;;1535:23;;;;;;;;1450:14;;;;;;;:7;:14;;;;;;4519:8;;1450:14;;1449:15;1441:24;;;;;;4555:1;4548:8;;4543:149;4560:6;:13;4558:15;;4543:149;;;4609:5;4596:18;;:6;4603:1;4596:9;;;;;;;;;;;;;;;;;;;;;;:18;4592:100;;;4646:8;4634:6;4641:1;4634:9;;;;;;;;;;;;;;;;;;:20;;;;;;;;;;;;;;;;;;4672:5;;4592:100;4575:3;;;;;4543:149;;;4701:14;;;;4718:5;4701:14;;;:7;:14;;;;;;:22;;;;;;;;;4733:17;;;;;;;;:24;;;;;4701:22;4733:24;;;;4767:19;;4701:14;;4767:19;;;4796:23;;;;;;;;;;;1568:1;1375;4377:449;;;:::o;3375:516:13:-;3564:23;2044:27:12;;;;;;;;;;:36;;;3461:13:13;;2044:36:12;;2043:37;2035:46;;;;;;3499:13:13;1410:26;1422:13;1410:11;:26::i;:::-;1389:95;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1638:17;;1603:32;;;;:17;:32;;;;;;3535:13;;1603:52;1584:15;:71;;1563:138;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3590:12;:27;;;;;;;;;;;;3627:12;;;:19;;;;3642:4;3627:19;;;;;;3674:15;;3691:9;;;;3702:8;;;;:15;;3660:68;;;3702:15;;;;;3627:19;3702:15;;;;;;;;;;;;3660:68;;;;;;;;;;;;;;;;;;3590:27;;-1:-1:-1;3660:68:13;;3674:15;;;;;3691:9;;3660:68;3702:8;:15;;3660:68;;3702:8;:15;3660:68;;;;;;;;;;;;;;;;;;;;;;;;3656:229;;;3749:24;;3759:13;;3749:24;;;;;3656:229;;;3809:31;;3826:13;;3809:31;;;;;3854:12;;;:20;;;;;;3656:229;1494:1;2091::12;3375:516:13;;;:::o;15593:687:61:-;15713:13;15775:5;15783:1;15775:9;15763:1;:8;:21;;15742:105;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;16021:13:61;15924:2;16021:13;16015:20;16174:66;16162:79;;15593:687::o;7449:1103:12:-;7552:4;7568:11;7627:4;7621:11;7760:2;7754:4;7750:13;8425:1;8406;8298:10;8279:1;8256:5;8227:11;7882:5;7877:3;7873:15;7851:662;7841:672;7449:1103;-1:-1:-1;;;;;;;;7449:1103:12:o;3959:234:13:-;4068:32;;;;:17;:32;;;;;;;;;:51;;;4134:52;;;;;;;4086:13;;4134:52;;;;;;;;;3959:234;;:::o;9373:451:12:-;9505:18;9475:11;2158:13;;;;;2150:22;;;;;;9555:16;;9611:140;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;9611:140:12;;;;;;9581:27;;;;;;;;;;:170;;;;;;;;;;;;;;;-1:-1:-1;9581:170:12;;;;;;;9555:16;;-1:-1:-1;9611:140:12;;9581:27;;:170;;;;;;;;;;:::i;:::-;-1:-1:-1;9581:170:12;;;;;;;;;;;;;;;;;;;;;;;9761:16;:21;;-1:-1:-1;9761:21:12;;;9792:25;;9803:13;;9792:25;;-1:-1:-1;;9792:25:12;9373:451;;;;;;:::o;707:3438:20:-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;707:3438:20;;;-1:-1:-1;707:3438:20;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;"
- }
- }
- },
- "sources": {
- "2.0.0/extensions/Forwarder/Forwarder.sol": {
- "id": 0
- },
- "2.0.0/extensions/Forwarder/MixinAssets.sol": {
- "id": 1
- },
- "2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol": {
- "id": 2
- },
- "2.0.0/extensions/Forwarder/MixinForwarderCore.sol": {
- "id": 3
- },
- "2.0.0/extensions/Forwarder/MixinWeth.sol": {
- "id": 4
- },
- "2.0.0/extensions/Forwarder/interfaces/IAssets.sol": {
- "id": 5
- },
- "2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol": {
- "id": 6
- },
- "2.0.0/extensions/Forwarder/libs/LibConstants.sol": {
- "id": 7
- },
- "2.0.0/extensions/Forwarder/mixins/MAssets.sol": {
- "id": 8
- },
- "2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol": {
- "id": 9
- },
- "2.0.0/extensions/Forwarder/mixins/MWeth.sol": {
- "id": 10
- },
- "2.0.0/extensions/OrderValidator/OrderValidator.sol": {
- "id": 11
- },
- "2.0.0/multisig/MultiSigWallet.sol": {
- "id": 12
- },
- "2.0.0/multisig/MultiSigWalletWithTimeLock.sol": {
- "id": 13
- },
- "2.0.0/protocol/AssetProxy/ERC20Proxy.sol": {
- "id": 14
- },
- "2.0.0/protocol/AssetProxy/ERC721Proxy.sol": {
- "id": 15
- },
- "2.0.0/protocol/AssetProxy/MixinAuthorizable.sol": {
- "id": 16
- },
- "2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol": {
- "id": 17
- },
- "2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol": {
- "id": 18
- },
- "2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol": {
- "id": 19
- },
- "2.0.0/protocol/AssetProxyOwner/AssetProxyOwner.sol": {
- "id": 20
- },
- "2.0.0/protocol/Exchange/Exchange.sol": {
- "id": 21
- },
- "2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol": {
- "id": 22
- },
- "2.0.0/protocol/Exchange/MixinExchangeCore.sol": {
- "id": 23
- },
- "2.0.0/protocol/Exchange/MixinMatchOrders.sol": {
- "id": 24
- },
- "2.0.0/protocol/Exchange/MixinSignatureValidator.sol": {
- "id": 25
- },
- "2.0.0/protocol/Exchange/MixinTransactions.sol": {
- "id": 26
- },
- "2.0.0/protocol/Exchange/MixinWrapperFunctions.sol": {
- "id": 27
- },
- "2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol": {
- "id": 28
- },
- "2.0.0/protocol/Exchange/interfaces/IExchange.sol": {
- "id": 29
- },
- "2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol": {
- "id": 30
- },
- "2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol": {
- "id": 31
- },
- "2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol": {
- "id": 32
- },
- "2.0.0/protocol/Exchange/interfaces/ITransactions.sol": {
- "id": 33
- },
- "2.0.0/protocol/Exchange/interfaces/IValidator.sol": {
- "id": 34
- },
- "2.0.0/protocol/Exchange/interfaces/IWallet.sol": {
- "id": 35
- },
- "2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol": {
- "id": 36
- },
- "2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol": {
- "id": 37
- },
- "2.0.0/protocol/Exchange/libs/LibConstants.sol": {
- "id": 38
- },
- "2.0.0/protocol/Exchange/libs/LibEIP712.sol": {
- "id": 39
- },
- "2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol": {
- "id": 40
- },
- "2.0.0/protocol/Exchange/libs/LibFillResults.sol": {
- "id": 41
- },
- "2.0.0/protocol/Exchange/libs/LibMath.sol": {
- "id": 42
- },
- "2.0.0/protocol/Exchange/libs/LibOrder.sol": {
- "id": 43
- },
- "2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol": {
- "id": 44
- },
- "2.0.0/protocol/Exchange/mixins/MExchangeCore.sol": {
- "id": 45
- },
- "2.0.0/protocol/Exchange/mixins/MMatchOrders.sol": {
- "id": 46
- },
- "2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol": {
- "id": 47
- },
- "2.0.0/protocol/Exchange/mixins/MTransactions.sol": {
- "id": 48
- },
- "2.0.0/protocol/Exchange/mixins/MWrapperFunctions.sol": {
- "id": 49
- },
- "2.0.0/test/DummyERC20Token/DummyERC20Token.sol": {
- "id": 50
- },
- "2.0.0/test/DummyERC721Token/DummyERC721Token.sol": {
- "id": 51
- },
- "2.0.0/tokens/ERC20Token/ERC20Token.sol": {
- "id": 52
- },
- "2.0.0/tokens/ERC20Token/IERC20Token.sol": {
- "id": 53
- },
- "2.0.0/tokens/ERC20Token/MintableERC20Token.sol": {
- "id": 54
- },
- "2.0.0/tokens/ERC20Token/UnlimitedAllowanceERC20Token.sol": {
- "id": 55
- },
- "2.0.0/tokens/ERC721Token/ERC721Token.sol": {
- "id": 56
- },
- "2.0.0/tokens/ERC721Token/IERC721Receiver.sol": {
- "id": 57
- },
- "2.0.0/tokens/ERC721Token/IERC721Token.sol": {
- "id": 58
- },
- "2.0.0/tokens/ERC721Token/MintableERC721Token.sol": {
- "id": 59
- },
- "2.0.0/tokens/EtherToken/IEtherToken.sol": {
- "id": 60
- },
- "2.0.0/utils/LibBytes/LibBytes.sol": {
- "id": 61
- },
- "2.0.0/utils/Ownable/IOwnable.sol": {
- "id": 62
- },
- "2.0.0/utils/Ownable/Ownable.sol": {
- "id": 63
- },
- "2.0.0/utils/ReentrancyGuard/ReentrancyGuard.sol": {
- "id": 64
- },
- "2.0.0/utils/SafeMath/SafeMath.sol": {
- "id": 65
- }
- },
- "sourceCodes": {
- "2.0.0/extensions/Forwarder/Forwarder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./MixinWeth.sol\";\nimport \"./MixinForwarderCore.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./MixinAssets.sol\";\nimport \"./MixinExchangeWrapper.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract Forwarder is\n LibConstants,\n MixinWeth,\n MixinAssets,\n MixinExchangeWrapper,\n MixinForwarderCore\n{\n constructor (\n address _exchange,\n bytes memory _zrxAssetData,\n bytes memory _wethAssetData\n )\n public\n LibConstants(\n _exchange,\n _zrxAssetData,\n _wethAssetData\n )\n MixinForwarderCore()\n {}\n}\n",
- "2.0.0/extensions/Forwarder/MixinAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"../../tokens/ERC20Token/IERC20Token.sol\";\nimport \"../../tokens/ERC721Token/IERC721Token.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MAssets.sol\";\n\n\ncontract MixinAssets is\n Ownable,\n LibConstants,\n MAssets\n{\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_TRANSFER_SELECTOR = bytes4(keccak256(\"transfer(address,uint256)\"));\n\n /// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to \n /// function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be\n /// used to withdraw assets that were accidentally sent to this contract.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of ERC20 token to withdraw.\n function withdrawAsset(\n bytes assetData,\n uint256 amount\n )\n external\n onlyOwner\n {\n transferAssetToSender(assetData, amount);\n }\n\n /// @dev Transfers given amount of asset to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferAssetToSender(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n bytes4 proxyId = assetData.readBytes4(0);\n\n if (proxyId == ERC20_DATA_ID) {\n transferERC20Token(assetData, amount);\n } else if (proxyId == ERC721_DATA_ID) {\n transferERC721Token(assetData, amount);\n } else {\n revert(\"UNSUPPORTED_ASSET_PROXY\");\n }\n }\n\n /// @dev Decodes ERC20 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC20Token(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n address token = assetData.readAddress(16);\n\n // Transfer tokens.\n // We do a raw call so we can check the success separate\n // from the return data.\n bool success = token.call(abi.encodeWithSelector(\n ERC20_TRANSFER_SELECTOR,\n msg.sender,\n amount\n ));\n require(\n success,\n \"TRANSFER_FAILED\"\n );\n \n // Check return data.\n // If there is no return data, we assume the token incorrectly\n // does not return a bool. In this case we expect it to revert\n // on failure, which was handled above.\n // If the token does return data, we require that it is a single\n // value that evaluates to true.\n assembly {\n if returndatasize {\n success := 0\n if eq(returndatasize, 32) {\n // First 64 bytes of memory are reserved scratch space\n returndatacopy(0, 0, 32)\n success := mload(0)\n }\n }\n }\n require(\n success,\n \"TRANSFER_FAILED\"\n );\n }\n\n /// @dev Decodes ERC721 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC721Token(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n require(\n amount == 1,\n \"INVALID_AMOUNT\"\n );\n // Decode asset data.\n address token = assetData.readAddress(16);\n uint256 tokenId = assetData.readUint256(36);\n\n // Perform transfer.\n IERC721Token(token).transferFrom(\n address(this),\n msg.sender,\n tokenId\n );\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MExchangeWrapper.sol\";\nimport \"../../protocol/Exchange/libs/LibAbiEncoder.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../protocol/Exchange/libs/LibFillResults.sol\";\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\n\n\ncontract MixinExchangeWrapper is\n LibAbiEncoder,\n LibFillResults,\n LibMath,\n LibConstants,\n MExchangeWrapper\n{\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n // ABI encode calldata for `fillOrder`\n bytes memory fillOrderCalldata = abiEncodeFillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n\n address exchange = address(EXCHANGE);\n\n // Call `fillOrder` and handle any exceptions gracefully\n assembly {\n let success := call(\n gas, // forward all gas\n exchange, // call address of Exchange contract\n 0, // transfer 0 wei\n add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes)\n mload(fillOrderCalldata), // length of input\n fillOrderCalldata, // write output over input\n 128 // output size is 128 bytes\n )\n if success {\n mstore(fillResults, mload(fillOrderCalldata))\n mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32)))\n mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64)))\n mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96)))\n }\n }\n // fillResults values will be 0 by default if call was unsuccessful\n return fillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of WETH has been sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param wethSellAmount Desired amount of WETH to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellWeth(\n LibOrder.Order[] memory orders,\n uint256 wethSellAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // We assume that asset being sold by taker is WETH for each order.\n orders[i].makerAssetData = makerAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of WETH to sell\n uint256 remainingTakerAssetFillAmount = safeSub(wethSellAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of WETH\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= wethSellAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// The asset being sold by taker must always be WETH.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyExactAmountWithWeth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // We assume that asset being sold by taker is WETH for each order.\n orders[i].makerAssetData = makerAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n uint256 makerAssetFilledAmount = totalFillResults.makerAssetFilledAmount;\n if (makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n\n require(\n makerAssetFilledAmount >= makerAssetFillAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return totalFillResults;\n }\n\n /// @dev Buys zrxBuyAmount of ZRX fee tokens, taking into account ZRX fees for each order. This will guarantee\n /// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues).\n /// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX\n /// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases.\n /// The asset being sold by taker must always be WETH. \n /// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset.\n /// @param zrxBuyAmount Desired amount of ZRX to buy.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return totalFillResults Amounts filled and fees paid by maker and taker.\n function marketBuyExactZrxWithWeth(\n LibOrder.Order[] memory orders,\n uint256 zrxBuyAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n // Do nothing if zrxBuyAmount == 0\n if (zrxBuyAmount == 0) {\n return totalFillResults;\n }\n\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n uint256 zrxPurchased = 0;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // All of these are ZRX/WETH, so we can drop the respective assetData from calldata.\n orders[i].makerAssetData = zrxAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of ZRX to buy.\n uint256 remainingZrxBuyAmount = safeSub(zrxBuyAmount, zrxPurchased);\n\n // Convert the remaining amount of ZRX to buy into remaining amount\n // of WETH to sell, assuming entire amount can be sold in the current order.\n uint256 remainingWethSellAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n safeSub(orders[i].makerAssetAmount, orders[i].takerFee), // our exchange rate after fees \n remainingZrxBuyAmount\n );\n\n // Attempt to sell the remaining amount of WETH.\n FillResults memory singleFillResult = fillOrderNoThrow(\n orders[i],\n safeAdd(remainingWethSellAmount, 1), // we add 1 wei to the fill amount to make up for rounding errors\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker.\n addFillResults(totalFillResults, singleFillResult);\n zrxPurchased = safeSub(totalFillResults.makerAssetFilledAmount, totalFillResults.takerFeePaid);\n\n // Stop execution if the entire amount of ZRX has been bought.\n if (zrxPurchased >= zrxBuyAmount) {\n break;\n }\n }\n\n require(\n zrxPurchased >= zrxBuyAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return totalFillResults;\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinForwarderCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MWeth.sol\";\nimport \"./mixins/MAssets.sol\";\nimport \"./mixins/MExchangeWrapper.sol\";\nimport \"./interfaces/IForwarderCore.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../protocol/Exchange/libs/LibFillResults.sol\";\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\n\n\ncontract MixinForwarderCore is\n LibFillResults,\n LibMath,\n LibConstants,\n MWeth,\n MAssets,\n MExchangeWrapper,\n IForwarderCore\n{\n using LibBytes for bytes;\n\n /// @dev Constructor approves ERC20 proxy to transfer ZRX and WETH on this contract's behalf.\n constructor ()\n public\n {\n address proxyAddress = EXCHANGE.getAssetProxy(ERC20_DATA_ID);\n require(\n proxyAddress != address(0),\n \"UNREGISTERED_ASSET_PROXY\"\n );\n ETHER_TOKEN.approve(proxyAddress, MAX_UINT);\n ZRX_TOKEN.approve(proxyAddress, MAX_UINT);\n }\n\n /// @dev Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketSellOrdersWithEth(\n LibOrder.Order[] memory orders,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n FillResults memory orderFillResults,\n FillResults memory feeOrderFillResults\n )\n {\n // Convert ETH to WETH.\n convertEthToWeth();\n\n uint256 wethSellAmount;\n uint256 zrxBuyAmount;\n uint256 makerAssetAmountPurchased;\n if (orders[0].makerAssetData.equals(ZRX_ASSET_DATA)) {\n // Calculate amount of WETH that won't be spent on ETH fees.\n wethSellAmount = getPartialAmountFloor(\n PERCENTAGE_DENOMINATOR,\n safeAdd(PERCENTAGE_DENOMINATOR, feePercentage),\n msg.value\n );\n // Market sell available WETH.\n // ZRX fees are paid with this contract's balance.\n orderFillResults = marketSellWeth(\n orders,\n wethSellAmount,\n signatures\n );\n // The fee amount must be deducted from the amount transfered back to sender.\n makerAssetAmountPurchased = safeSub(orderFillResults.makerAssetFilledAmount, orderFillResults.takerFeePaid);\n } else {\n // 5% of WETH is reserved for filling feeOrders and paying feeRecipient.\n wethSellAmount = getPartialAmountFloor(\n MAX_WETH_FILL_PERCENTAGE,\n PERCENTAGE_DENOMINATOR,\n msg.value\n );\n // Market sell 95% of WETH.\n // ZRX fees are payed with this contract's balance.\n orderFillResults = marketSellWeth(\n orders,\n wethSellAmount,\n signatures\n );\n // Buy back all ZRX spent on fees.\n zrxBuyAmount = orderFillResults.takerFeePaid;\n feeOrderFillResults = marketBuyExactZrxWithWeth(\n feeOrders,\n zrxBuyAmount,\n feeSignatures\n );\n makerAssetAmountPurchased = orderFillResults.makerAssetFilledAmount;\n }\n\n // Transfer feePercentage of total ETH spent on primary orders to feeRecipient.\n // Refund remaining ETH to msg.sender.\n transferEthFeeAndRefund(\n orderFillResults.takerAssetFilledAmount,\n feeOrderFillResults.takerAssetFilledAmount,\n feePercentage,\n feeRecipient\n );\n\n // Transfer purchased assets to msg.sender.\n transferAssetToSender(orders[0].makerAssetData, makerAssetAmountPurchased);\n }\n\n /// @dev Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param makerAssetFillAmount Desired amount of makerAsset to purchase.\n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketBuyOrdersWithEth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n FillResults memory orderFillResults,\n FillResults memory feeOrderFillResults\n )\n {\n // Convert ETH to WETH.\n convertEthToWeth();\n\n uint256 zrxBuyAmount;\n uint256 makerAssetAmountPurchased;\n if (orders[0].makerAssetData.equals(ZRX_ASSET_DATA)) {\n // If the makerAsset is ZRX, it is not necessary to pay fees out of this\n // contracts's ZRX balance because fees are factored into the price of the order.\n orderFillResults = marketBuyExactZrxWithWeth(\n orders,\n makerAssetFillAmount,\n signatures\n );\n // The fee amount must be deducted from the amount transfered back to sender.\n makerAssetAmountPurchased = safeSub(orderFillResults.makerAssetFilledAmount, orderFillResults.takerFeePaid);\n } else {\n // Attemp to purchase desired amount of makerAsset.\n // ZRX fees are payed with this contract's balance.\n orderFillResults = marketBuyExactAmountWithWeth(\n orders,\n makerAssetFillAmount,\n signatures\n );\n // Buy back all ZRX spent on fees.\n zrxBuyAmount = orderFillResults.takerFeePaid;\n feeOrderFillResults = marketBuyExactZrxWithWeth(\n feeOrders,\n zrxBuyAmount,\n feeSignatures\n );\n makerAssetAmountPurchased = orderFillResults.makerAssetFilledAmount;\n }\n\n // Transfer feePercentage of total ETH spent on primary orders to feeRecipient.\n // Refund remaining ETH to msg.sender.\n transferEthFeeAndRefund(\n orderFillResults.takerAssetFilledAmount,\n feeOrderFillResults.takerAssetFilledAmount,\n feePercentage,\n feeRecipient\n );\n\n // Transfer purchased assets to msg.sender.\n transferAssetToSender(orders[0].makerAssetData, makerAssetAmountPurchased);\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinWeth.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MWeth.sol\";\n\n\ncontract MixinWeth is\n LibMath,\n LibConstants,\n MWeth\n{\n /// @dev Default payabale function, this allows us to withdraw WETH\n function ()\n public\n payable\n {\n require(\n msg.sender == address(ETHER_TOKEN),\n \"DEFAULT_FUNCTION_WETH_CONTRACT_ONLY\"\n );\n }\n\n /// @dev Converts message call's ETH value into WETH.\n function convertEthToWeth()\n internal\n {\n require(\n msg.value > 0,\n \"INVALID_MSG_VALUE\"\n );\n ETHER_TOKEN.deposit.value(msg.value)();\n }\n\n /// @dev Transfers feePercentage of WETH spent on primary orders to feeRecipient.\n /// Refunds any excess ETH to msg.sender.\n /// @param wethSoldExcludingFeeOrders Amount of WETH sold when filling primary orders.\n /// @param wethSoldForZrx Amount of WETH sold when purchasing ZRX required for primary order fees.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n function transferEthFeeAndRefund(\n uint256 wethSoldExcludingFeeOrders,\n uint256 wethSoldForZrx,\n uint256 feePercentage,\n address feeRecipient\n )\n internal\n {\n // Ensure feePercentage is less than 5%.\n require(\n feePercentage <= MAX_FEE_PERCENTAGE,\n \"FEE_PERCENTAGE_TOO_LARGE\"\n );\n\n // Ensure that no extra WETH owned by this contract has been sold.\n uint256 wethSold = safeAdd(wethSoldExcludingFeeOrders, wethSoldForZrx);\n require(\n wethSold <= msg.value,\n \"OVERSOLD_WETH\"\n );\n\n // Calculate amount of WETH that hasn't been sold.\n uint256 wethRemaining = safeSub(msg.value, wethSold);\n\n // Calculate ETH fee to pay to feeRecipient.\n uint256 ethFee = getPartialAmountFloor(\n feePercentage,\n PERCENTAGE_DENOMINATOR,\n wethSoldExcludingFeeOrders\n );\n\n // Ensure fee is less than amount of WETH remaining.\n require(\n ethFee <= wethRemaining,\n \"INSUFFICIENT_ETH_REMAINING\"\n );\n \n // Do nothing if no WETH remaining\n if (wethRemaining > 0) {\n // Convert remaining WETH to ETH\n ETHER_TOKEN.withdraw(wethRemaining);\n\n // Pay ETH to feeRecipient\n if (ethFee > 0) {\n feeRecipient.transfer(ethFee);\n }\n\n // Refund remaining ETH to msg.sender.\n uint256 ethRefund = safeSub(wethRemaining, ethFee);\n if (ethRefund > 0) {\n msg.sender.transfer(ethRefund);\n }\n }\n }\n}\n",
- "2.0.0/extensions/Forwarder/interfaces/IAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IAssets {\n\n /// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to \n /// function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be\n /// used to withdraw assets that were accidentally sent to this contract.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of ERC20 token to withdraw.\n function withdrawAsset(\n bytes assetData,\n uint256 amount\n )\n external;\n}\n",
- "2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../../protocol/Exchange/libs/LibFillResults.sol\";\n\n\ncontract IForwarderCore {\n\n /// @dev Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketSellOrdersWithEth(\n LibOrder.Order[] memory orders,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n LibFillResults.FillResults memory orderFillResults,\n LibFillResults.FillResults memory feeOrderFillResults\n );\n\n /// @dev Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param makerAssetFillAmount Desired amount of makerAsset to purchase.\n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketBuyOrdersWithEth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n LibFillResults.FillResults memory orderFillResults,\n LibFillResults.FillResults memory feeOrderFillResults\n );\n}\n",
- "2.0.0/extensions/Forwarder/libs/LibConstants.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/LibBytes/LibBytes.sol\";\nimport \"../../../protocol/Exchange/interfaces/IExchange.sol\";\nimport \"../../../tokens/EtherToken/IEtherToken.sol\";\nimport \"../../../tokens/ERC20Token/IERC20Token.sol\";\n\n\ncontract LibConstants {\n\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n uint256 constant internal MAX_UINT = 2**256 - 1;\n uint256 constant internal PERCENTAGE_DENOMINATOR = 10**18; \n uint256 constant internal MAX_FEE_PERCENTAGE = 5 * PERCENTAGE_DENOMINATOR / 100; // 5%\n uint256 constant internal MAX_WETH_FILL_PERCENTAGE = 95 * PERCENTAGE_DENOMINATOR / 100; // 95%\n \n // solhint-disable var-name-mixedcase\n IExchange internal EXCHANGE;\n IEtherToken internal ETHER_TOKEN;\n IERC20Token internal ZRX_TOKEN;\n bytes internal ZRX_ASSET_DATA;\n bytes internal WETH_ASSET_DATA;\n // solhint-enable var-name-mixedcase\n\n constructor (\n address _exchange,\n bytes memory _zrxAssetData,\n bytes memory _wethAssetData\n )\n public\n {\n EXCHANGE = IExchange(_exchange);\n ZRX_ASSET_DATA = _zrxAssetData;\n WETH_ASSET_DATA = _wethAssetData;\n\n address etherToken = _wethAssetData.readAddress(16);\n address zrxToken = _zrxAssetData.readAddress(16);\n ETHER_TOKEN = IEtherToken(etherToken);\n ZRX_TOKEN = IERC20Token(zrxToken);\n }\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAssets.sol\";\n\n\ncontract MAssets is\n IAssets\n{\n /// @dev Transfers given amount of asset to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferAssetToSender(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n\n /// @dev Decodes ERC20 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC20Token(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n\n /// @dev Decodes ERC721 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC721Token(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../../protocol/Exchange/libs/LibFillResults.sol\";\n\n\ncontract MExchangeWrapper {\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of WETH has been sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param wethSellAmount Desired amount of WETH to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellWeth(\n LibOrder.Order[] memory orders,\n uint256 wethSellAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// The asset being sold by taker must always be WETH.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyExactAmountWithWeth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Buys zrxBuyAmount of ZRX fee tokens, taking into account ZRX fees for each order. This will guarantee\n /// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues).\n /// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX\n /// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases.\n /// The asset being sold by taker must always be WETH. \n /// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset.\n /// @param zrxBuyAmount Desired amount of ZRX to buy.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return totalFillResults Amounts filled and fees paid by maker and taker.\n function marketBuyExactZrxWithWeth(\n LibOrder.Order[] memory orders,\n uint256 zrxBuyAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MWeth.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract MWeth {\n\n /// @dev Converts message call's ETH value into WETH.\n function convertEthToWeth()\n internal;\n\n /// @dev Transfers feePercentage of WETH spent on primary orders to feeRecipient.\n /// Refunds any excess ETH to msg.sender.\n /// @param wethSoldExcludingFeeOrders Amount of WETH sold when filling primary orders.\n /// @param wethSoldForZrx Amount of WETH sold when purchasing ZRX required for primary order fees.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n function transferEthFeeAndRefund(\n uint256 wethSoldExcludingFeeOrders,\n uint256 wethSoldForZrx,\n uint256 feePercentage,\n address feeRecipient\n )\n internal;\n}\n",
- "2.0.0/extensions/OrderValidator/OrderValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../protocol/Exchange/interfaces/IExchange.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../tokens/ERC20Token/IERC20Token.sol\";\nimport \"../../tokens/ERC721Token/IERC721Token.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\n\n\ncontract OrderValidator {\n\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n\n struct TraderInfo {\n uint256 makerBalance; // Maker's balance of makerAsset\n uint256 makerAllowance; // Maker's allowance to corresponding AssetProxy\n uint256 takerBalance; // Taker's balance of takerAsset\n uint256 takerAllowance; // Taker's allowance to corresponding AssetProxy\n uint256 makerZrxBalance; // Maker's balance of ZRX\n uint256 makerZrxAllowance; // Maker's allowance of ZRX to ERC20Proxy\n uint256 takerZrxBalance; // Taker's balance of ZRX\n uint256 takerZrxAllowance; // Taker's allowance of ZRX to ERC20Proxy\n }\n\n // solhint-disable var-name-mixedcase\n IExchange internal EXCHANGE;\n bytes internal ZRX_ASSET_DATA;\n // solhint-enable var-name-mixedcase\n\n constructor (address _exchange, bytes memory _zrxAssetData)\n public\n {\n EXCHANGE = IExchange(_exchange);\n ZRX_ASSET_DATA = _zrxAssetData;\n }\n\n /// @dev Fetches information for order and maker/taker of order.\n /// @param order The order structure.\n /// @param takerAddress Address that will be filling the order.\n /// @return OrderInfo and TraderInfo instances for given order.\n function getOrderAndTraderInfo(LibOrder.Order memory order, address takerAddress)\n public\n view\n returns (LibOrder.OrderInfo memory orderInfo, TraderInfo memory traderInfo)\n {\n orderInfo = EXCHANGE.getOrderInfo(order);\n traderInfo = getTraderInfo(order, takerAddress);\n return (orderInfo, traderInfo);\n }\n\n /// @dev Fetches information for all passed in orders and the makers/takers of each order.\n /// @param orders Array of order specifications.\n /// @param takerAddresses Array of taker addresses corresponding to each order.\n /// @return Arrays of OrderInfo and TraderInfo instances that correspond to each order.\n function getOrdersAndTradersInfo(LibOrder.Order[] memory orders, address[] memory takerAddresses)\n public\n view\n returns (LibOrder.OrderInfo[] memory ordersInfo, TraderInfo[] memory tradersInfo)\n {\n ordersInfo = EXCHANGE.getOrdersInfo(orders);\n tradersInfo = getTradersInfo(orders, takerAddresses);\n return (ordersInfo, tradersInfo);\n }\n\n /// @dev Fetches balance and allowances for maker and taker of order.\n /// @param order The order structure.\n /// @param takerAddress Address that will be filling the order.\n /// @return Balances and allowances of maker and taker of order.\n function getTraderInfo(LibOrder.Order memory order, address takerAddress)\n public\n view\n returns (TraderInfo memory traderInfo)\n {\n (traderInfo.makerBalance, traderInfo.makerAllowance) = getBalanceAndAllowance(order.makerAddress, order.makerAssetData);\n (traderInfo.takerBalance, traderInfo.takerAllowance) = getBalanceAndAllowance(takerAddress, order.takerAssetData);\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n (traderInfo.makerZrxBalance, traderInfo.makerZrxAllowance) = getBalanceAndAllowance(order.makerAddress, zrxAssetData);\n (traderInfo.takerZrxBalance, traderInfo.takerZrxAllowance) = getBalanceAndAllowance(takerAddress, zrxAssetData);\n return traderInfo;\n }\n\n /// @dev Fetches balances and allowances of maker and taker for each provided order.\n /// @param orders Array of order specifications.\n /// @param takerAddresses Array of taker addresses corresponding to each order.\n /// @return Array of balances and allowances for maker and taker of each order.\n function getTradersInfo(LibOrder.Order[] memory orders, address[] memory takerAddresses)\n public\n view\n returns (TraderInfo[] memory)\n {\n uint256 ordersLength = orders.length;\n TraderInfo[] memory tradersInfo = new TraderInfo[](ordersLength);\n for (uint256 i = 0; i != ordersLength; i++) {\n tradersInfo[i] = getTraderInfo(orders[i], takerAddresses[i]);\n }\n return tradersInfo;\n }\n\n /// @dev Fetches token balances and allowances of an address to given assetProxy. Supports ERC20 and ERC721.\n /// @param target Address to fetch balances and allowances of.\n /// @param assetData Encoded data that can be decoded by a specified proxy contract when transferring asset.\n /// @return Balance of asset and allowance set to given proxy of asset.\n /// For ERC721 tokens, these values will always be 1 or 0.\n function getBalanceAndAllowance(address target, bytes memory assetData)\n public\n view\n returns (uint256 balance, uint256 allowance)\n {\n bytes4 assetProxyId = assetData.readBytes4(0);\n address token = assetData.readAddress(16);\n address assetProxy = EXCHANGE.getAssetProxy(assetProxyId);\n\n if (assetProxyId == ERC20_DATA_ID) {\n // Query balance\n balance = IERC20Token(token).balanceOf(target);\n\n // Query allowance\n allowance = IERC20Token(token).allowance(target, assetProxy);\n } else if (assetProxyId == ERC721_DATA_ID) {\n uint256 tokenId = assetData.readUint256(36);\n\n // Query owner of tokenId\n address owner = getERC721TokenOwner(token, tokenId);\n\n // Set balance to 1 if tokenId is owned by target\n balance = target == owner ? 1 : 0;\n\n // Check if ERC721Proxy is approved to spend tokenId\n bool isApproved = IERC721Token(token).isApprovedForAll(target, assetProxy) || IERC721Token(token).getApproved(tokenId) == assetProxy;\n \n // Set alowance to 1 if ERC721Proxy is approved to spend tokenId\n allowance = isApproved ? 1 : 0;\n } else {\n revert(\"UNSUPPORTED_ASSET_PROXY\");\n }\n return (balance, allowance);\n }\n\n /// @dev Fetches token balances and allowances of an address for each given assetProxy. Supports ERC20 and ERC721.\n /// @param target Address to fetch balances and allowances of.\n /// @param assetData Array of encoded byte arrays that can be decoded by a specified proxy contract when transferring asset.\n /// @return Balances and allowances of assets.\n /// For ERC721 tokens, these values will always be 1 or 0.\n function getBalancesAndAllowances(address target, bytes[] memory assetData)\n public\n view\n returns (uint256[] memory, uint256[] memory)\n {\n uint256 length = assetData.length;\n uint256[] memory balances = new uint256[](length);\n uint256[] memory allowances = new uint256[](length);\n for (uint256 i = 0; i != length; i++) {\n (balances[i], allowances[i]) = getBalanceAndAllowance(target, assetData[i]);\n }\n return (balances, allowances);\n }\n\n /// @dev Calls `token.ownerOf(tokenId)`, but returns a null owner instead of reverting on an unowned token.\n /// @param token Address of ERC721 token.\n /// @param tokenId The identifier for the specific NFT.\n /// @return Owner of tokenId or null address if unowned.\n function getERC721TokenOwner(address token, uint256 tokenId)\n public\n view\n returns (address owner)\n {\n assembly {\n // load free memory pointer\n let cdStart := mload(64)\n\n // bytes4(keccak256(ownerOf(uint256))) = 0x6352211e\n mstore(cdStart, 0x6352211e00000000000000000000000000000000000000000000000000000000)\n mstore(add(cdStart, 4), tokenId)\n\n // staticcall `ownerOf(tokenId)`\n // `ownerOf` will revert if tokenId is not owned\n let success := staticcall(\n gas, // forward all gas\n token, // call token contract\n cdStart, // start of calldata\n 36, // length of input is 36 bytes\n cdStart, // write output over input\n 32 // size of output is 32 bytes\n )\n\n // Success implies that tokenId is owned\n // Copy owner from return data if successful\n if success {\n owner := mload(cdStart)\n } \n }\n\n // Owner initialized to address(0), no need to modify if call is unsuccessful\n return owner;\n }\n}\n",
- "2.0.0/multisig/MultiSigWallet.sol": "// solhint-disable\npragma solidity ^0.4.15;\n\n\n/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.\n/// @author Stefan George - <stefan.george@consensys.net>\ncontract MultiSigWallet {\n\n /*\n * Events\n */\n event Confirmation(address indexed sender, uint indexed transactionId);\n event Revocation(address indexed sender, uint indexed transactionId);\n event Submission(uint indexed transactionId);\n event Execution(uint indexed transactionId);\n event ExecutionFailure(uint indexed transactionId);\n event Deposit(address indexed sender, uint value);\n event OwnerAddition(address indexed owner);\n event OwnerRemoval(address indexed owner);\n event RequirementChange(uint required);\n\n /*\n * Constants\n */\n uint constant public MAX_OWNER_COUNT = 50;\n\n /*\n * Storage\n */\n mapping (uint => Transaction) public transactions;\n mapping (uint => mapping (address => bool)) public confirmations;\n mapping (address => bool) public isOwner;\n address[] public owners;\n uint public required;\n uint public transactionCount;\n\n struct Transaction {\n address destination;\n uint value;\n bytes data;\n bool executed;\n }\n\n /*\n * Modifiers\n */\n modifier onlyWallet() {\n require(msg.sender == address(this));\n _;\n }\n\n modifier ownerDoesNotExist(address owner) {\n require(!isOwner[owner]);\n _;\n }\n\n modifier ownerExists(address owner) {\n require(isOwner[owner]);\n _;\n }\n\n modifier transactionExists(uint transactionId) {\n require(transactions[transactionId].destination != 0);\n _;\n }\n\n modifier confirmed(uint transactionId, address owner) {\n require(confirmations[transactionId][owner]);\n _;\n }\n\n modifier notConfirmed(uint transactionId, address owner) {\n require(!confirmations[transactionId][owner]);\n _;\n }\n\n modifier notExecuted(uint transactionId) {\n require(!transactions[transactionId].executed);\n _;\n }\n\n modifier notNull(address _address) {\n require(_address != 0);\n _;\n }\n\n modifier validRequirement(uint ownerCount, uint _required) {\n require(ownerCount <= MAX_OWNER_COUNT\n && _required <= ownerCount\n && _required != 0\n && ownerCount != 0);\n _;\n }\n\n /// @dev Fallback function allows to deposit ether.\n function()\n payable\n {\n if (msg.value > 0)\n Deposit(msg.sender, msg.value);\n }\n\n /*\n * Public functions\n */\n /// @dev Contract constructor sets initial owners and required number of confirmations.\n /// @param _owners List of initial owners.\n /// @param _required Number of required confirmations.\n function MultiSigWallet(address[] _owners, uint _required)\n public\n validRequirement(_owners.length, _required)\n {\n for (uint i=0; i<_owners.length; i++) {\n require(!isOwner[_owners[i]] && _owners[i] != 0);\n isOwner[_owners[i]] = true;\n }\n owners = _owners;\n required = _required;\n }\n\n /// @dev Allows to add a new owner. Transaction has to be sent by wallet.\n /// @param owner Address of new owner.\n function addOwner(address owner)\n public\n onlyWallet\n ownerDoesNotExist(owner)\n notNull(owner)\n validRequirement(owners.length + 1, required)\n {\n isOwner[owner] = true;\n owners.push(owner);\n OwnerAddition(owner);\n }\n\n /// @dev Allows to remove an owner. Transaction has to be sent by wallet.\n /// @param owner Address of owner.\n function removeOwner(address owner)\n public\n onlyWallet\n ownerExists(owner)\n {\n isOwner[owner] = false;\n for (uint i=0; i<owners.length - 1; i++)\n if (owners[i] == owner) {\n owners[i] = owners[owners.length - 1];\n break;\n }\n owners.length -= 1;\n if (required > owners.length)\n changeRequirement(owners.length);\n OwnerRemoval(owner);\n }\n\n /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet.\n /// @param owner Address of owner to be replaced.\n /// @param newOwner Address of new owner.\n function replaceOwner(address owner, address newOwner)\n public\n onlyWallet\n ownerExists(owner)\n ownerDoesNotExist(newOwner)\n {\n for (uint i=0; i<owners.length; i++)\n if (owners[i] == owner) {\n owners[i] = newOwner;\n break;\n }\n isOwner[owner] = false;\n isOwner[newOwner] = true;\n OwnerRemoval(owner);\n OwnerAddition(newOwner);\n }\n\n /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet.\n /// @param _required Number of required confirmations.\n function changeRequirement(uint _required)\n public\n onlyWallet\n validRequirement(owners.length, _required)\n {\n required = _required;\n RequirementChange(_required);\n }\n\n /// @dev Allows an owner to submit and confirm a transaction.\n /// @param destination Transaction target address.\n /// @param value Transaction ether value.\n /// @param data Transaction data payload.\n /// @return Returns transaction ID.\n function submitTransaction(address destination, uint value, bytes data)\n public\n returns (uint transactionId)\n {\n transactionId = addTransaction(destination, value, data);\n confirmTransaction(transactionId);\n }\n\n /// @dev Allows an owner to confirm a transaction.\n /// @param transactionId Transaction ID.\n function confirmTransaction(uint transactionId)\n public\n ownerExists(msg.sender)\n transactionExists(transactionId)\n notConfirmed(transactionId, msg.sender)\n {\n confirmations[transactionId][msg.sender] = true;\n Confirmation(msg.sender, transactionId);\n executeTransaction(transactionId);\n }\n\n /// @dev Allows an owner to revoke a confirmation for a transaction.\n /// @param transactionId Transaction ID.\n function revokeConfirmation(uint transactionId)\n public\n ownerExists(msg.sender)\n confirmed(transactionId, msg.sender)\n notExecuted(transactionId)\n {\n confirmations[transactionId][msg.sender] = false;\n Revocation(msg.sender, transactionId);\n }\n\n /// @dev Allows anyone to execute a confirmed transaction.\n /// @param transactionId Transaction ID.\n function executeTransaction(uint transactionId)\n public\n ownerExists(msg.sender)\n confirmed(transactionId, msg.sender)\n notExecuted(transactionId)\n {\n if (isConfirmed(transactionId)) {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data))\n Execution(transactionId);\n else {\n ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n }\n\n // call has been separated into its own function in order to take advantage\n // of the Solidity's code generator to produce a loop that copies tx.data into memory.\n function external_call(address destination, uint value, uint dataLength, bytes data) internal returns (bool) {\n bool result;\n assembly {\n let x := mload(0x40) // \"Allocate\" memory for output (0x40 is where \"free memory\" pointer is stored by convention)\n let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that\n result := call(\n sub(gas, 34710), // 34710 is the value that solidity is currently emitting\n // It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) +\n // callNewAccountGas (25000, in case the destination address does not exist and needs creating)\n destination,\n value,\n d,\n dataLength, // Size of the input (in bytes) - this is what fixes the padding problem\n x,\n 0 // Output is ignored, therefore the output size is zero\n )\n }\n return result;\n }\n\n /// @dev Returns the confirmation status of a transaction.\n /// @param transactionId Transaction ID.\n /// @return Confirmation status.\n function isConfirmed(uint transactionId)\n public\n constant\n returns (bool)\n {\n uint count = 0;\n for (uint i=0; i<owners.length; i++) {\n if (confirmations[transactionId][owners[i]])\n count += 1;\n if (count == required)\n return true;\n }\n }\n\n /*\n * Internal functions\n */\n /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet.\n /// @param destination Transaction target address.\n /// @param value Transaction ether value.\n /// @param data Transaction data payload.\n /// @return Returns transaction ID.\n function addTransaction(address destination, uint value, bytes data)\n internal\n notNull(destination)\n returns (uint transactionId)\n {\n transactionId = transactionCount;\n transactions[transactionId] = Transaction({\n destination: destination,\n value: value,\n data: data,\n executed: false\n });\n transactionCount += 1;\n Submission(transactionId);\n }\n\n /*\n * Web3 call functions\n */\n /// @dev Returns number of confirmations of a transaction.\n /// @param transactionId Transaction ID.\n /// @return Number of confirmations.\n function getConfirmationCount(uint transactionId)\n public\n constant\n returns (uint count)\n {\n for (uint i=0; i<owners.length; i++)\n if (confirmations[transactionId][owners[i]])\n count += 1;\n }\n\n /// @dev Returns total number of transactions after filers are applied.\n /// @param pending Include pending transactions.\n /// @param executed Include executed transactions.\n /// @return Total number of transactions after filters are applied.\n function getTransactionCount(bool pending, bool executed)\n public\n constant\n returns (uint count)\n {\n for (uint i=0; i<transactionCount; i++)\n if ( pending && !transactions[i].executed\n || executed && transactions[i].executed)\n count += 1;\n }\n\n /// @dev Returns list of owners.\n /// @return List of owner addresses.\n function getOwners()\n public\n constant\n returns (address[])\n {\n return owners;\n }\n\n /// @dev Returns array with owner addresses, which confirmed transaction.\n /// @param transactionId Transaction ID.\n /// @return Returns array of owner addresses.\n function getConfirmations(uint transactionId)\n public\n constant\n returns (address[] _confirmations)\n {\n address[] memory confirmationsTemp = new address[](owners.length);\n uint count = 0;\n uint i;\n for (i=0; i<owners.length; i++)\n if (confirmations[transactionId][owners[i]]) {\n confirmationsTemp[count] = owners[i];\n count += 1;\n }\n _confirmations = new address[](count);\n for (i=0; i<count; i++)\n _confirmations[i] = confirmationsTemp[i];\n }\n\n /// @dev Returns list of transaction IDs in defined range.\n /// @param from Index start position of transaction array.\n /// @param to Index end position of transaction array.\n /// @param pending Include pending transactions.\n /// @param executed Include executed transactions.\n /// @return Returns array of transaction IDs.\n function getTransactionIds(uint from, uint to, bool pending, bool executed)\n public\n constant\n returns (uint[] _transactionIds)\n {\n uint[] memory transactionIdsTemp = new uint[](transactionCount);\n uint count = 0;\n uint i;\n for (i=0; i<transactionCount; i++)\n if ( pending && !transactions[i].executed\n || executed && transactions[i].executed)\n {\n transactionIdsTemp[count] = i;\n count += 1;\n }\n _transactionIds = new uint[](to - from);\n for (i=from; i<to; i++)\n _transactionIds[i - from] = transactionIdsTemp[i];\n }\n}",
- "2.0.0/multisig/MultiSigWalletWithTimeLock.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MultiSigWallet.sol\";\n\n\n/// @title Multisignature wallet with time lock- Allows multiple parties to execute a transaction after a time lock has passed.\n/// @author Amir Bandeali - <amir@0xProject.com>\n// solhint-disable not-rely-on-time\ncontract MultiSigWalletWithTimeLock is\n MultiSigWallet\n{\n event ConfirmationTimeSet(uint256 indexed transactionId, uint256 confirmationTime);\n event TimeLockChange(uint256 secondsTimeLocked);\n\n uint256 public secondsTimeLocked;\n\n mapping (uint256 => uint256) public confirmationTimes;\n\n modifier notFullyConfirmed(uint256 transactionId) {\n require(\n !isConfirmed(transactionId),\n \"TX_FULLY_CONFIRMED\"\n );\n _;\n }\n\n modifier fullyConfirmed(uint256 transactionId) {\n require(\n isConfirmed(transactionId),\n \"TX_NOT_FULLY_CONFIRMED\"\n );\n _;\n }\n\n modifier pastTimeLock(uint256 transactionId) {\n require(\n block.timestamp >= confirmationTimes[transactionId] + secondsTimeLocked,\n \"TIME_LOCK_INCOMPLETE\"\n );\n _;\n }\n\n /// @dev Contract constructor sets initial owners, required number of confirmations, and time lock.\n /// @param _owners List of initial owners.\n /// @param _required Number of required confirmations.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n constructor (\n address[] _owners,\n uint256 _required,\n uint256 _secondsTimeLocked\n )\n public\n MultiSigWallet(_owners, _required)\n {\n secondsTimeLocked = _secondsTimeLocked;\n }\n\n /// @dev Changes the duration of the time lock for transactions.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n function changeTimeLock(uint256 _secondsTimeLocked)\n public\n onlyWallet\n {\n secondsTimeLocked = _secondsTimeLocked;\n emit TimeLockChange(_secondsTimeLocked);\n }\n\n /// @dev Allows an owner to confirm a transaction.\n /// @param transactionId Transaction ID.\n function confirmTransaction(uint256 transactionId)\n public\n ownerExists(msg.sender)\n transactionExists(transactionId)\n notConfirmed(transactionId, msg.sender)\n notFullyConfirmed(transactionId)\n {\n confirmations[transactionId][msg.sender] = true;\n emit Confirmation(msg.sender, transactionId);\n if (isConfirmed(transactionId)) {\n setConfirmationTime(transactionId, block.timestamp);\n }\n }\n\n /// @dev Allows anyone to execute a confirmed transaction.\n /// @param transactionId Transaction ID.\n function executeTransaction(uint256 transactionId)\n public\n notExecuted(transactionId)\n fullyConfirmed(transactionId)\n pastTimeLock(transactionId)\n {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) {\n emit Execution(transactionId);\n } else {\n emit ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n\n /// @dev Sets the time of when a submission first passed.\n function setConfirmationTime(uint256 transactionId, uint256 confirmationTime)\n internal\n {\n confirmationTimes[transactionId] = confirmationTime;\n emit ConfirmationTimeSet(transactionId, confirmationTime);\n }\n}\n",
- "2.0.0/protocol/AssetProxy/ERC20Proxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MixinAuthorizable.sol\";\n\n\ncontract ERC20Proxy is\n MixinAuthorizable\n{\n // Id of this proxy.\n bytes4 constant internal PROXY_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n \n // solhint-disable-next-line payable-fallback\n function () \n external\n {\n assembly {\n // The first 4 bytes of calldata holds the function selector\n let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)\n\n // `transferFrom` will be called with the following parameters:\n // assetData Encoded byte array.\n // from Address to transfer asset from.\n // to Address to transfer asset to.\n // amount Amount of asset to transfer.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {\n\n // To lookup a value in a mapping, we load from the storage location keccak256(k, p),\n // where k is the key left padded to 32 bytes and p is the storage slot\n let start := mload(64)\n mstore(start, and(caller, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(start, 32), authorized_slot)\n\n // Revert if authorized[msg.sender] == false\n if iszero(sload(keccak256(start, 64))) {\n // Revert with `Error(\"SENDER_NOT_AUTHORIZED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // `transferFrom`.\n // The function is marked `external`, so no abi decodeding is done for\n // us. Instead, we expect the `calldata` memory to contain the\n // following:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n //\n // (*): offset is computed from start of function parameters, so offset\n // by an additional 4 bytes in the calldata.\n //\n // (**): see table below to compute length of assetData Contents\n //\n // WARNING: The ABIv2 specification allows additional padding between\n // the Params and Data section. This will result in a larger\n // offset to assetData.\n\n // Asset data itself is encoded as follows:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 1 * 32 | function parameters: |\n // | | 4 | 12 + 20 | 1. token address |\n\n // We construct calldata for the `token.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 4 | | 1. from |\n // | | 36 | | 2. to |\n // | | 68 | | 3. amount |\n\n /////// Read token address from calldata ///////\n // * The token address is stored in `assetData`.\n //\n // * The \"offset to assetData\" is stored at offset 4 in the calldata (table 1).\n // [assetDataOffsetFromParams = calldataload(4)]\n //\n // * Notes that the \"offset to assetData\" is relative to the \"Params\" area of calldata;\n // add 4 bytes to account for the length of the \"Header\" area (table 1).\n // [assetDataOffsetFromHeader = assetDataOffsetFromParams + 4]\n //\n // * The \"token address\" is offset 32+4=36 bytes into \"assetData\" (tables 1 & 2).\n // [tokenOffset = assetDataOffsetFromHeader + 36 = calldataload(4) + 4 + 36]\n let token := calldataload(add(calldataload(4), 40))\n \n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFrom` selector.\n // Any trailing data in transferFromSelector will be\n // overwritten in the next `mstore` call.\n mstore(0, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // We copy the fields `from`, `to` and `amount` in bulk\n // from our own calldata to the new calldata.\n calldatacopy(4, 36, 96)\n\n /////// Call `token.transferFrom` using the calldata ///////\n let success := call(\n gas, // forward all gas\n token, // call address of token contract\n 0, // don't send any ETH\n 0, // pointer to start of input\n 100, // length of input\n 0, // write output over input\n 32 // output size should be 32 bytes\n )\n\n /////// Check return data. ///////\n // If there is no return data, we assume the token incorrectly\n // does not return a bool. In this case we expect it to revert\n // on failure, which was handled above.\n // If the token does return data, we require that it is a single\n // nonzero 32 bytes value.\n // So the transfer succeeded if the call succeeded and either\n // returned nothing, or returned a non-zero 32 byte value. \n success := and(success, or(\n iszero(returndatasize),\n and(\n eq(returndatasize, 32),\n gt(mload(0), 0)\n )\n ))\n if success {\n return(0, 0)\n }\n \n // Revert with `Error(\"TRANSFER_FAILED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // Revert if undefined function is called\n revert(0, 0)\n }\n }\n\n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4)\n {\n return PROXY_ID;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/ERC721Proxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MixinAuthorizable.sol\";\n\n\ncontract ERC721Proxy is\n MixinAuthorizable\n{\n // Id of this proxy.\n bytes4 constant internal PROXY_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n\n // solhint-disable-next-line payable-fallback\n function () \n external\n {\n assembly {\n // The first 4 bytes of calldata holds the function selector\n let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)\n\n // `transferFrom` will be called with the following parameters:\n // assetData Encoded byte array.\n // from Address to transfer asset from.\n // to Address to transfer asset to.\n // amount Amount of asset to transfer.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {\n\n // To lookup a value in a mapping, we load from the storage location keccak256(k, p),\n // where k is the key left padded to 32 bytes and p is the storage slot\n let start := mload(64)\n mstore(start, and(caller, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(start, 32), authorized_slot)\n\n // Revert if authorized[msg.sender] == false\n if iszero(sload(keccak256(start, 64))) {\n // Revert with `Error(\"SENDER_NOT_AUTHORIZED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // `transferFrom`.\n // The function is marked `external`, so no abi decodeding is done for\n // us. Instead, we expect the `calldata` memory to contain the\n // following:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n //\n // (*): offset is computed from start of function parameters, so offset\n // by an additional 4 bytes in the calldata.\n //\n // (**): see table below to compute length of assetData Contents\n //\n // WARNING: The ABIv2 specification allows additional padding between\n // the Params and Data section. This will result in a larger\n // offset to assetData.\n\n // Asset data itself is encoded as follows:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 2 * 32 | function parameters: |\n // | | 4 | 12 + 20 | 1. token address |\n // | | 36 | | 2. tokenId |\n \n // We construct calldata for the `token.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n // \n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 4 | | 1. from |\n // | | 36 | | 2. to |\n // | | 68 | | 3. tokenId |\n\n // There exists only 1 of each token.\n // require(amount == 1, \"INVALID_AMOUNT\")\n if sub(calldataload(100), 1) {\n // Revert with `Error(\"INVALID_AMOUNT\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000e494e56414c49445f414d4f554e540000000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFrom` selector.\n // Any trailing data in transferFromSelector will be\n // overwritten in the next `mstore` call.\n mstore(0, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // We copy the fields `from` and `to` in bulk\n // from our own calldata to the new calldata.\n calldatacopy(4, 36, 64)\n\n // Copy `tokenId` field from our own calldata to the new calldata.\n let assetDataOffset := calldataload(4)\n calldatacopy(68, add(assetDataOffset, 72), 32)\n\n /////// Call `token.transferFrom` using the calldata ///////\n let token := calldataload(add(assetDataOffset, 40))\n let success := call(\n gas, // forward all gas\n token, // call address of token contract\n 0, // don't send any ETH\n 0, // pointer to start of input\n 100, // length of input\n 0, // write output to null\n 0 // output size is 0 bytes\n )\n if success {\n return(0, 0)\n }\n \n // Revert with `Error(\"TRANSFER_FAILED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // Revert if undefined function is called\n revert(0, 0)\n }\n }\n\n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4)\n {\n return PROXY_ID;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/MixinAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"./mixins/MAuthorizable.sol\";\n\n\ncontract MixinAuthorizable is\n Ownable,\n MAuthorizable\n{\n /// @dev Only authorized addresses can invoke functions with this modifier.\n modifier onlyAuthorized {\n require(\n authorized[msg.sender],\n \"SENDER_NOT_AUTHORIZED\"\n );\n _;\n }\n\n mapping (address => bool) public authorized;\n address[] public authorities;\n\n /// @dev Authorizes an address.\n /// @param target Address to authorize.\n function addAuthorizedAddress(address target)\n external\n onlyOwner\n {\n require(\n !authorized[target],\n \"TARGET_ALREADY_AUTHORIZED\"\n );\n\n authorized[target] = true;\n authorities.push(target);\n emit AuthorizedAddressAdded(target, msg.sender);\n }\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n function removeAuthorizedAddress(address target)\n external\n onlyOwner\n {\n require(\n authorized[target],\n \"TARGET_NOT_AUTHORIZED\"\n );\n\n delete authorized[target];\n for (uint256 i = 0; i < authorities.length; i++) {\n if (authorities[i] == target) {\n authorities[i] = authorities[authorities.length - 1];\n authorities.length -= 1;\n break;\n }\n }\n emit AuthorizedAddressRemoved(target, msg.sender);\n }\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n /// @param index Index of target in authorities array.\n function removeAuthorizedAddressAtIndex(\n address target,\n uint256 index\n )\n external\n onlyOwner\n {\n require(\n authorized[target],\n \"TARGET_NOT_AUTHORIZED\"\n );\n require(\n index < authorities.length,\n \"INDEX_OUT_OF_BOUNDS\"\n );\n require(\n authorities[index] == target,\n \"AUTHORIZED_ADDRESS_MISMATCH\"\n );\n\n delete authorized[target];\n authorities[index] = authorities[authorities.length - 1];\n authorities.length -= 1;\n emit AuthorizedAddressRemoved(target, msg.sender);\n }\n\n /// @dev Gets all authorized addresses.\n /// @return Array of authorized addresses.\n function getAuthorizedAddresses()\n external\n view\n returns (address[] memory)\n {\n return authorities;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IAuthorizable.sol\";\n\n\ncontract IAssetProxy is\n IAuthorizable\n{\n /// @dev Transfers assets. Either succeeds or throws.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param from Address to transfer asset from.\n /// @param to Address to transfer asset to.\n /// @param amount Amount of asset to transfer.\n function transferFrom(\n bytes assetData,\n address from,\n address to,\n uint256 amount\n )\n external;\n \n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4);\n}\n",
- "2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/Ownable/IOwnable.sol\";\n\n\ncontract IAuthorizable is\n IOwnable\n{\n /// @dev Authorizes an address.\n /// @param target Address to authorize.\n function addAuthorizedAddress(address target)\n external;\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n function removeAuthorizedAddress(address target)\n external;\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n /// @param index Index of target in authorities array.\n function removeAuthorizedAddressAtIndex(\n address target,\n uint256 index\n )\n external;\n \n /// @dev Gets all authorized addresses.\n /// @return Array of authorized addresses.\n function getAuthorizedAddresses()\n external\n view\n returns (address[] memory);\n}\n",
- "2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAuthorizable.sol\";\n\n\ncontract MAuthorizable is\n IAuthorizable\n{\n // Event logged when a new address is authorized.\n event AuthorizedAddressAdded(\n address indexed target,\n address indexed caller\n );\n\n // Event logged when a currently authorized address is unauthorized.\n event AuthorizedAddressRemoved(\n address indexed target,\n address indexed caller\n );\n\n /// @dev Only authorized addresses can invoke functions with this modifier.\n modifier onlyAuthorized { revert(); _; }\n}\n",
- "2.0.0/protocol/AssetProxyOwner/AssetProxyOwner.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../multisig/MultiSigWalletWithTimeLock.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\n\n\ncontract AssetProxyOwner is\n MultiSigWalletWithTimeLock\n{\n using LibBytes for bytes;\n\n event AssetProxyRegistration(address assetProxyContract, bool isRegistered);\n\n // Mapping of AssetProxy contract address =>\n // if this contract is allowed to call the AssetProxy's `removeAuthorizedAddressAtIndex` method without a time lock.\n mapping (address => bool) public isAssetProxyRegistered;\n\n bytes4 constant internal REMOVE_AUTHORIZED_ADDRESS_AT_INDEX_SELECTOR = bytes4(keccak256(\"removeAuthorizedAddressAtIndex(address,uint256)\"));\n\n /// @dev Function will revert if the transaction does not call `removeAuthorizedAddressAtIndex`\n /// on an approved AssetProxy contract.\n modifier validRemoveAuthorizedAddressAtIndexTx(uint256 transactionId) {\n Transaction storage txn = transactions[transactionId];\n require(\n isAssetProxyRegistered[txn.destination],\n \"UNREGISTERED_ASSET_PROXY\"\n );\n require(\n txn.data.readBytes4(0) == REMOVE_AUTHORIZED_ADDRESS_AT_INDEX_SELECTOR,\n \"INVALID_FUNCTION_SELECTOR\"\n );\n _;\n }\n\n /// @dev Contract constructor sets initial owners, required number of confirmations,\n /// time lock, and list of AssetProxy addresses.\n /// @param _owners List of initial owners.\n /// @param _assetProxyContracts Array of AssetProxy contract addresses.\n /// @param _required Number of required confirmations.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n constructor (\n address[] memory _owners,\n address[] memory _assetProxyContracts,\n uint256 _required,\n uint256 _secondsTimeLocked\n )\n public\n MultiSigWalletWithTimeLock(_owners, _required, _secondsTimeLocked)\n {\n for (uint256 i = 0; i < _assetProxyContracts.length; i++) {\n address assetProxy = _assetProxyContracts[i];\n require(\n assetProxy != address(0),\n \"INVALID_ASSET_PROXY\"\n );\n isAssetProxyRegistered[assetProxy] = true;\n }\n }\n\n /// @dev Registers or deregisters an AssetProxy to be able to execute\n /// `removeAuthorizedAddressAtIndex` without a timelock.\n /// @param assetProxyContract Address of AssetProxy contract.\n /// @param isRegistered Status of approval for AssetProxy contract.\n function registerAssetProxy(address assetProxyContract, bool isRegistered)\n public\n onlyWallet\n notNull(assetProxyContract)\n {\n isAssetProxyRegistered[assetProxyContract] = isRegistered;\n emit AssetProxyRegistration(assetProxyContract, isRegistered);\n }\n\n /// @dev Allows execution of `removeAuthorizedAddressAtIndex` without time lock.\n /// @param transactionId Transaction ID.\n function executeRemoveAuthorizedAddressAtIndex(uint256 transactionId)\n public\n notExecuted(transactionId)\n fullyConfirmed(transactionId)\n validRemoveAuthorizedAddressAtIndexTx(transactionId)\n {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) {\n emit Execution(transactionId);\n } else {\n emit ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/Exchange.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./MixinExchangeCore.sol\";\nimport \"./MixinSignatureValidator.sol\";\nimport \"./MixinWrapperFunctions.sol\";\nimport \"./MixinAssetProxyDispatcher.sol\";\nimport \"./MixinTransactions.sol\";\nimport \"./MixinMatchOrders.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract Exchange is\n MixinExchangeCore,\n MixinMatchOrders,\n MixinSignatureValidator,\n MixinTransactions,\n MixinAssetProxyDispatcher,\n MixinWrapperFunctions\n{\n string constant public VERSION = \"2.0.1-alpha\";\n\n // Mixins are instantiated in the order they are inherited\n constructor (bytes memory _zrxAssetData)\n public\n LibConstants(_zrxAssetData) // @TODO: Remove when we deploy.\n MixinExchangeCore()\n MixinMatchOrders()\n MixinSignatureValidator()\n MixinTransactions()\n MixinAssetProxyDispatcher()\n MixinWrapperFunctions()\n {}\n}\n",
- "2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\nimport \"../AssetProxy/interfaces/IAssetProxy.sol\";\n\n\ncontract MixinAssetProxyDispatcher is\n Ownable,\n MAssetProxyDispatcher\n{\n // Mapping from Asset Proxy Id's to their respective Asset Proxy\n mapping (bytes4 => IAssetProxy) public assetProxies;\n\n /// @dev Registers an asset proxy to its asset proxy id.\n /// Once an asset proxy is registered, it cannot be unregistered.\n /// @param assetProxy Address of new asset proxy to register.\n function registerAssetProxy(address assetProxy)\n external\n onlyOwner\n {\n IAssetProxy assetProxyContract = IAssetProxy(assetProxy);\n\n // Ensure that no asset proxy exists with current id.\n bytes4 assetProxyId = assetProxyContract.getProxyId();\n address currentAssetProxy = assetProxies[assetProxyId];\n require(\n currentAssetProxy == address(0),\n \"ASSET_PROXY_ALREADY_EXISTS\"\n );\n\n // Add asset proxy and log registration.\n assetProxies[assetProxyId] = assetProxyContract;\n emit AssetProxyRegistered(\n assetProxyId,\n assetProxy\n );\n }\n\n /// @dev Gets an asset proxy.\n /// @param assetProxyId Id of the asset proxy.\n /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered.\n function getAssetProxy(bytes4 assetProxyId)\n external\n view\n returns (address)\n {\n return assetProxies[assetProxyId];\n }\n\n /// @dev Forwards arguments to assetProxy and calls `transferFrom`. Either succeeds or throws.\n /// @param assetData Byte array encoded for the asset.\n /// @param from Address to transfer token from.\n /// @param to Address to transfer token to.\n /// @param amount Amount of token to transfer.\n function dispatchTransferFrom(\n bytes memory assetData,\n address from,\n address to,\n uint256 amount\n )\n internal\n {\n // Do nothing if no amount should be transferred.\n if (amount > 0 && from != to) {\n // Ensure assetData length is valid\n require(\n assetData.length > 3,\n \"LENGTH_GREATER_THAN_3_REQUIRED\"\n );\n \n // Lookup assetProxy. We do not use `LibBytes.readBytes4` for gas efficiency reasons.\n bytes4 assetProxyId;\n assembly {\n assetProxyId := and(mload(\n add(assetData, 32)),\n 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000\n )\n }\n address assetProxy = assetProxies[assetProxyId];\n\n // Ensure that assetProxy exists\n require(\n assetProxy != address(0),\n \"ASSET_PROXY_DOES_NOT_EXIST\"\n );\n \n // We construct calldata for the `assetProxy.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n // \n // | Area | Offset | Length | Contents |\n // | -------- |--------|---------|-------------------------------------------- |\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n\n assembly {\n /////// Setup State ///////\n // `cdStart` is the start of the calldata for `assetProxy.transferFrom` (equal to free memory ptr).\n let cdStart := mload(64)\n // `dataAreaLength` is the total number of words needed to store `assetData`\n // As-per the ABI spec, this value is padded up to the nearest multiple of 32,\n // and includes 32-bytes for length.\n let dataAreaLength := and(add(mload(assetData), 63), 0xFFFFFFFFFFFE0)\n // `cdEnd` is the end of the calldata for `assetProxy.transferFrom`.\n let cdEnd := add(cdStart, add(132, dataAreaLength))\n\n \n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFromSelector`.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n mstore(cdStart, 0xa85e59e400000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // Each parameter is padded to 32-bytes. The entire Params Area is 128 bytes.\n // Notes:\n // 1. The offset to `assetData` is the length of the Params Area (128 bytes).\n // 2. A 20-byte mask is applied to addresses to zero-out the unused bytes.\n mstore(add(cdStart, 4), 128)\n mstore(add(cdStart, 36), and(from, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(cdStart, 68), and(to, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(cdStart, 100), amount)\n \n /////// Setup Data Area ///////\n // This area holds `assetData`.\n let dataArea := add(cdStart, 132)\n // solhint-disable-next-line no-empty-blocks\n for {} lt(dataArea, cdEnd) {} {\n mstore(dataArea, mload(assetData))\n dataArea := add(dataArea, 32)\n assetData := add(assetData, 32)\n }\n\n /////// Call `assetProxy.transferFrom` using the constructed calldata ///////\n let success := call(\n gas, // forward all gas\n assetProxy, // call address of asset proxy\n 0, // don't send any ETH\n cdStart, // pointer to start of input\n sub(cdEnd, cdStart), // length of input \n cdStart, // write output over input\n 512 // reserve 512 bytes for output\n )\n if iszero(success) {\n revert(cdStart, returndatasize())\n }\n }\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\n\n\ncontract MixinExchangeCore is\n ReentrancyGuard,\n LibConstants,\n LibMath,\n LibOrder,\n LibFillResults,\n MAssetProxyDispatcher,\n MExchangeCore,\n MSignatureValidator,\n MTransactions\n{\n // Mapping of orderHash => amount of takerAsset already bought by maker\n mapping (bytes32 => uint256) public filled;\n\n // Mapping of orderHash => cancelled\n mapping (bytes32 => bool) public cancelled;\n\n // Mapping of makerAddress => senderAddress => lowest salt an order can have in order to be fillable\n // Orders with specified senderAddress and with a salt less than their epoch are considered cancelled\n mapping (address => mapping (address => uint256)) public orderEpoch;\n\n /// @dev Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch\n /// and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress).\n /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled.\n function cancelOrdersUpTo(uint256 targetOrderEpoch)\n external\n nonReentrant\n {\n address makerAddress = getCurrentContextAddress();\n // If this function is called via `executeTransaction`, we only update the orderEpoch for the makerAddress/msg.sender combination.\n // This allows external filter contracts to add rules to how orders are cancelled via this function.\n address senderAddress = makerAddress == msg.sender ? address(0) : msg.sender;\n\n // orderEpoch is initialized to 0, so to cancelUpTo we need salt + 1\n uint256 newOrderEpoch = targetOrderEpoch + 1; \n uint256 oldOrderEpoch = orderEpoch[makerAddress][senderAddress];\n\n // Ensure orderEpoch is monotonically increasing\n require(\n newOrderEpoch > oldOrderEpoch, \n \"INVALID_NEW_ORDER_EPOCH\"\n );\n\n // Update orderEpoch\n orderEpoch[makerAddress][senderAddress] = newOrderEpoch;\n emit CancelUpTo(\n makerAddress,\n senderAddress,\n newOrderEpoch\n );\n }\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrder(\n Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n nonReentrant\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n return fillResults;\n }\n\n /// @dev After calling, the order can not be filled anymore.\n /// Throws if order is invalid or sender does not have permission to cancel.\n /// @param order Order to cancel. Order must be OrderStatus.FILLABLE.\n function cancelOrder(Order memory order)\n public\n nonReentrant\n {\n cancelOrderInternal(order);\n }\n\n /// @dev Gets information about an order: status, hash, and amount filled.\n /// @param order Order to gather information on.\n /// @return OrderInfo Information about the order and its state.\n /// See LibOrder.OrderInfo for a complete description.\n function getOrderInfo(Order memory order)\n public\n view\n returns (OrderInfo memory orderInfo)\n {\n // Compute the order hash\n orderInfo.orderHash = getOrderHash(order);\n\n // Fetch filled amount\n orderInfo.orderTakerAssetFilledAmount = filled[orderInfo.orderHash];\n\n // If order.makerAssetAmount is zero, we also reject the order.\n // While the Exchange contract handles them correctly, they create\n // edge cases in the supporting infrastructure because they have\n // an 'infinite' price when computed by a simple division.\n if (order.makerAssetAmount == 0) {\n orderInfo.orderStatus = uint8(OrderStatus.INVALID_MAKER_ASSET_AMOUNT);\n return orderInfo;\n }\n\n // If order.takerAssetAmount is zero, then the order will always\n // be considered filled because 0 == takerAssetAmount == orderTakerAssetFilledAmount\n // Instead of distinguishing between unfilled and filled zero taker\n // amount orders, we choose not to support them.\n if (order.takerAssetAmount == 0) {\n orderInfo.orderStatus = uint8(OrderStatus.INVALID_TAKER_ASSET_AMOUNT);\n return orderInfo;\n }\n\n // Validate order availability\n if (orderInfo.orderTakerAssetFilledAmount >= order.takerAssetAmount) {\n orderInfo.orderStatus = uint8(OrderStatus.FULLY_FILLED);\n return orderInfo;\n }\n\n // Validate order expiration\n // solhint-disable-next-line not-rely-on-time\n if (block.timestamp >= order.expirationTimeSeconds) {\n orderInfo.orderStatus = uint8(OrderStatus.EXPIRED);\n return orderInfo;\n }\n\n // Check if order has been cancelled\n if (cancelled[orderInfo.orderHash]) {\n orderInfo.orderStatus = uint8(OrderStatus.CANCELLED);\n return orderInfo;\n }\n if (orderEpoch[order.makerAddress][order.senderAddress] > order.salt) {\n orderInfo.orderStatus = uint8(OrderStatus.CANCELLED);\n return orderInfo;\n }\n\n // All other statuses are ruled out: order is Fillable\n orderInfo.orderStatus = uint8(OrderStatus.FILLABLE);\n return orderInfo;\n }\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderInternal(\n Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n // Fetch order info\n OrderInfo memory orderInfo = getOrderInfo(order);\n\n // Fetch taker address\n address takerAddress = getCurrentContextAddress();\n \n // Assert that the order is fillable by taker\n assertFillableOrder(\n order,\n orderInfo,\n takerAddress,\n signature\n );\n \n // Get amount of takerAsset to fill\n uint256 remainingTakerAssetAmount = safeSub(order.takerAssetAmount, orderInfo.orderTakerAssetFilledAmount);\n uint256 takerAssetFilledAmount = min256(takerAssetFillAmount, remainingTakerAssetAmount);\n\n // Validate context\n assertValidFill(\n order,\n orderInfo,\n takerAssetFillAmount,\n takerAssetFilledAmount,\n fillResults.makerAssetFilledAmount\n );\n\n // Compute proportional fill amounts\n fillResults = calculateFillResults(order, takerAssetFilledAmount);\n\n // Update exchange internal state\n updateFilledState(\n order,\n takerAddress,\n orderInfo.orderHash,\n orderInfo.orderTakerAssetFilledAmount,\n fillResults\n );\n \n // Settle order\n settleOrder(\n order,\n takerAddress,\n fillResults\n );\n\n return fillResults;\n }\n\n /// @dev After calling, the order can not be filled anymore.\n /// Throws if order is invalid or sender does not have permission to cancel.\n /// @param order Order to cancel. Order must be OrderStatus.FILLABLE.\n function cancelOrderInternal(Order memory order)\n internal\n {\n // Fetch current order status\n OrderInfo memory orderInfo = getOrderInfo(order);\n\n // Validate context\n assertValidCancel(order, orderInfo);\n\n // Perform cancel\n updateCancelledState(order, orderInfo.orderHash);\n }\n\n /// @dev Updates state with results of a fill order.\n /// @param order that was filled.\n /// @param takerAddress Address of taker who filled the order.\n /// @param orderTakerAssetFilledAmount Amount of order already filled.\n function updateFilledState(\n Order memory order,\n address takerAddress,\n bytes32 orderHash,\n uint256 orderTakerAssetFilledAmount,\n FillResults memory fillResults\n )\n internal\n {\n // Update state\n filled[orderHash] = safeAdd(orderTakerAssetFilledAmount, fillResults.takerAssetFilledAmount);\n\n // Log order\n emit Fill(\n order.makerAddress,\n order.feeRecipientAddress,\n takerAddress,\n msg.sender,\n fillResults.makerAssetFilledAmount,\n fillResults.takerAssetFilledAmount,\n fillResults.makerFeePaid,\n fillResults.takerFeePaid,\n orderHash,\n order.makerAssetData,\n order.takerAssetData\n );\n }\n\n /// @dev Updates state with results of cancelling an order.\n /// State is only updated if the order is currently fillable.\n /// Otherwise, updating state would have no effect.\n /// @param order that was cancelled.\n /// @param orderHash Hash of order that was cancelled.\n function updateCancelledState(\n Order memory order,\n bytes32 orderHash\n )\n internal\n {\n // Perform cancel\n cancelled[orderHash] = true;\n\n // Log cancel\n emit Cancel(\n order.makerAddress,\n order.feeRecipientAddress,\n msg.sender,\n orderHash,\n order.makerAssetData,\n order.takerAssetData\n );\n }\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAddress Address of order taker.\n /// @param signature Proof that the orders was created by its maker.\n function assertFillableOrder(\n Order memory order,\n OrderInfo memory orderInfo,\n address takerAddress,\n bytes memory signature\n )\n internal\n view\n {\n // An order can only be filled if its status is FILLABLE.\n require(\n orderInfo.orderStatus == uint8(OrderStatus.FILLABLE),\n \"ORDER_UNFILLABLE\"\n );\n \n // Validate sender is allowed to fill this order\n if (order.senderAddress != address(0)) {\n require(\n order.senderAddress == msg.sender,\n \"INVALID_SENDER\"\n );\n }\n \n // Validate taker is allowed to fill this order\n if (order.takerAddress != address(0)) {\n require(\n order.takerAddress == takerAddress,\n \"INVALID_TAKER\"\n );\n }\n \n // Validate Maker signature (check only if first time seen)\n if (orderInfo.orderTakerAssetFilledAmount == 0) {\n require(\n isValidSignature(\n orderInfo.orderHash,\n order.makerAddress,\n signature\n ),\n \"INVALID_ORDER_SIGNATURE\"\n );\n }\n }\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAssetFillAmount Desired amount of order to fill by taker.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @param makerAssetFilledAmount Amount of makerAsset that will be transfered.\n function assertValidFill(\n Order memory order,\n OrderInfo memory orderInfo,\n uint256 takerAssetFillAmount, // TODO: use FillResults\n uint256 takerAssetFilledAmount,\n uint256 makerAssetFilledAmount\n )\n internal\n view\n {\n // Revert if fill amount is invalid\n // TODO: reconsider necessity for v2.1\n require(\n takerAssetFillAmount != 0,\n \"INVALID_TAKER_AMOUNT\"\n );\n \n // Make sure taker does not pay more than desired amount\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n takerAssetFilledAmount <= takerAssetFillAmount,\n \"TAKER_OVERPAY\"\n );\n \n // Make sure order is not overfilled\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n safeAdd(orderInfo.orderTakerAssetFilledAmount, takerAssetFilledAmount) <= order.takerAssetAmount,\n \"ORDER_OVERFILL\"\n );\n \n // Make sure order is filled at acceptable price.\n // The order has an implied price from the makers perspective:\n // order price = order.makerAssetAmount / order.takerAssetAmount\n // i.e. the number of makerAsset maker is paying per takerAsset. The\n // maker is guaranteed to get this price or a better (lower) one. The\n // actual price maker is getting in this fill is:\n // fill price = makerAssetFilledAmount / takerAssetFilledAmount\n // We need `fill price <= order price` for the fill to be fair to maker.\n // This amounts to:\n // makerAssetFilledAmount order.makerAssetAmount\n // ------------------------ <= -----------------------\n // takerAssetFilledAmount order.takerAssetAmount\n // or, equivalently:\n // makerAssetFilledAmount * order.takerAssetAmount <=\n // order.makerAssetAmount * takerAssetFilledAmount\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n safeMul(makerAssetFilledAmount, order.takerAssetAmount)\n <= \n safeMul(order.makerAssetAmount, takerAssetFilledAmount),\n \"INVALID_FILL_PRICE\"\n );\n }\n\n /// @dev Validates context for cancelOrder. Succeeds or throws.\n /// @param order to be cancelled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n function assertValidCancel(\n Order memory order,\n OrderInfo memory orderInfo\n )\n internal\n view\n {\n // Ensure order is valid\n // An order can only be cancelled if its status is FILLABLE.\n require(\n orderInfo.orderStatus == uint8(OrderStatus.FILLABLE),\n \"ORDER_UNFILLABLE\"\n );\n\n // Validate sender is allowed to cancel this order\n if (order.senderAddress != address(0)) {\n require(\n order.senderAddress == msg.sender,\n \"INVALID_SENDER\"\n );\n }\n\n // Validate transaction signed by maker\n address makerAddress = getCurrentContextAddress();\n require(\n order.makerAddress == makerAddress,\n \"INVALID_MAKER\"\n );\n }\n\n /// @dev Calculates amounts filled and fees paid by maker and taker.\n /// @param order to be filled.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function calculateFillResults(\n Order memory order,\n uint256 takerAssetFilledAmount\n )\n internal\n pure\n returns (FillResults memory fillResults)\n {\n // Compute proportional transfer amounts\n fillResults.takerAssetFilledAmount = takerAssetFilledAmount;\n fillResults.makerAssetFilledAmount = safeGetPartialAmountFloor(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.makerAssetAmount\n );\n fillResults.makerFeePaid = safeGetPartialAmountFloor(\n fillResults.makerAssetFilledAmount,\n order.makerAssetAmount,\n order.makerFee\n );\n fillResults.takerFeePaid = safeGetPartialAmountFloor(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.takerFee\n );\n\n return fillResults;\n }\n\n /// @dev Settles an order by transferring assets between counterparties.\n /// @param order Order struct containing order specifications.\n /// @param takerAddress Address selling takerAsset and buying makerAsset.\n /// @param fillResults Amounts to be filled and fees paid by maker and taker.\n function settleOrder(\n LibOrder.Order memory order,\n address takerAddress,\n LibFillResults.FillResults memory fillResults\n )\n private\n {\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n dispatchTransferFrom(\n order.makerAssetData,\n order.makerAddress,\n takerAddress,\n fillResults.makerAssetFilledAmount\n );\n dispatchTransferFrom(\n order.takerAssetData,\n takerAddress,\n order.makerAddress,\n fillResults.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n zrxAssetData,\n order.makerAddress,\n order.feeRecipientAddress,\n fillResults.makerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n order.feeRecipientAddress,\n fillResults.takerFeePaid\n );\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinMatchOrders.sol": "/*\n Copyright 2018 ZeroEx Intl.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n http://www.apache.org/licenses/LICENSE-2.0\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MMatchOrders.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\n\n\ncontract MixinMatchOrders is\n ReentrancyGuard,\n LibConstants,\n LibMath,\n MAssetProxyDispatcher,\n MExchangeCore,\n MMatchOrders,\n MTransactions\n{\n /// @dev Match two complementary orders that have a profitable spread.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the left order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftSignature Proof that order was created by the left maker.\n /// @param rightSignature Proof that order was created by the right maker.\n /// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.\n function matchOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n bytes memory leftSignature,\n bytes memory rightSignature\n )\n public\n nonReentrant\n returns (LibFillResults.MatchedFillResults memory matchedFillResults)\n {\n // We assume that rightOrder.takerAssetData == leftOrder.makerAssetData and rightOrder.makerAssetData == leftOrder.takerAssetData.\n // If this assumption isn't true, the match will fail at signature validation.\n rightOrder.makerAssetData = leftOrder.takerAssetData;\n rightOrder.takerAssetData = leftOrder.makerAssetData;\n\n // Get left & right order info\n LibOrder.OrderInfo memory leftOrderInfo = getOrderInfo(leftOrder);\n LibOrder.OrderInfo memory rightOrderInfo = getOrderInfo(rightOrder);\n\n // Fetch taker address\n address takerAddress = getCurrentContextAddress();\n \n // Either our context is valid or we revert\n assertFillableOrder(\n leftOrder,\n leftOrderInfo,\n takerAddress,\n leftSignature\n );\n assertFillableOrder(\n rightOrder,\n rightOrderInfo,\n takerAddress,\n rightSignature\n );\n assertValidMatch(leftOrder, rightOrder);\n\n // Compute proportional fill amounts\n matchedFillResults = calculateMatchedFillResults(\n leftOrder,\n rightOrder,\n leftOrderInfo.orderTakerAssetFilledAmount,\n rightOrderInfo.orderTakerAssetFilledAmount\n );\n\n // Validate fill contexts\n assertValidFill(\n leftOrder,\n leftOrderInfo,\n matchedFillResults.left.takerAssetFilledAmount,\n matchedFillResults.left.takerAssetFilledAmount,\n matchedFillResults.left.makerAssetFilledAmount\n );\n assertValidFill(\n rightOrder,\n rightOrderInfo,\n matchedFillResults.right.takerAssetFilledAmount,\n matchedFillResults.right.takerAssetFilledAmount,\n matchedFillResults.right.makerAssetFilledAmount\n );\n \n // Update exchange state\n updateFilledState(\n leftOrder,\n takerAddress,\n leftOrderInfo.orderHash,\n leftOrderInfo.orderTakerAssetFilledAmount,\n matchedFillResults.left\n );\n updateFilledState(\n rightOrder,\n takerAddress,\n rightOrderInfo.orderHash,\n rightOrderInfo.orderTakerAssetFilledAmount,\n matchedFillResults.right\n );\n\n // Settle matched orders. Succeeds or throws.\n settleMatchedOrders(\n leftOrder,\n rightOrder,\n takerAddress,\n matchedFillResults\n );\n\n return matchedFillResults;\n }\n\n /// @dev Validates context for matchOrders. Succeeds or throws.\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n function assertValidMatch(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder\n )\n internal\n pure\n {\n // Make sure there is a profitable spread.\n // There is a profitable spread iff the cost per unit bought (OrderA.MakerAmount/OrderA.TakerAmount) for each order is greater\n // than the profit per unit sold of the matched order (OrderB.TakerAmount/OrderB.MakerAmount).\n // This is satisfied by the equations below:\n // <leftOrder.makerAssetAmount> / <leftOrder.takerAssetAmount> >= <rightOrder.takerAssetAmount> / <rightOrder.makerAssetAmount>\n // AND\n // <rightOrder.makerAssetAmount> / <rightOrder.takerAssetAmount> >= <leftOrder.takerAssetAmount> / <leftOrder.makerAssetAmount>\n // These equations can be combined to get the following:\n require(\n safeMul(leftOrder.makerAssetAmount, rightOrder.makerAssetAmount) >=\n safeMul(leftOrder.takerAssetAmount, rightOrder.takerAssetAmount),\n \"NEGATIVE_SPREAD_REQUIRED\"\n );\n }\n\n /// @dev Calculates fill amounts for the matched orders.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the leftOrder order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftOrderTakerAssetFilledAmount Amount of left order already filled.\n /// @param rightOrderTakerAssetFilledAmount Amount of right order already filled.\n /// @param matchedFillResults Amounts to fill and fees to pay by maker and taker of matched orders.\n function calculateMatchedFillResults(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n uint256 leftOrderTakerAssetFilledAmount,\n uint256 rightOrderTakerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.MatchedFillResults memory matchedFillResults)\n {\n // Derive maker asset amounts for left & right orders, given store taker assert amounts\n uint256 leftTakerAssetAmountRemaining = safeSub(leftOrder.takerAssetAmount, leftOrderTakerAssetFilledAmount);\n uint256 leftMakerAssetAmountRemaining = safeGetPartialAmountFloor(\n leftOrder.makerAssetAmount,\n leftOrder.takerAssetAmount,\n leftTakerAssetAmountRemaining\n );\n uint256 rightTakerAssetAmountRemaining = safeSub(rightOrder.takerAssetAmount, rightOrderTakerAssetFilledAmount);\n uint256 rightMakerAssetAmountRemaining = safeGetPartialAmountFloor(\n rightOrder.makerAssetAmount,\n rightOrder.takerAssetAmount,\n rightTakerAssetAmountRemaining\n );\n\n // Calculate fill results for maker and taker assets: at least one order will be fully filled.\n // The maximum amount the left maker can buy is `leftTakerAssetAmountRemaining`\n // The maximum amount the right maker can sell is `rightMakerAssetAmountRemaining`\n // We have two distinct cases for calculating the fill results:\n // Case 1.\n // If the left maker can buy more than the right maker can sell, then only the right order is fully filled.\n // If the left maker can buy exactly what the right maker can sell, then both orders are fully filled.\n // Case 2.\n // If the left maker cannot buy more than the right maker can sell, then only the left order is fully filled.\n if (leftTakerAssetAmountRemaining >= rightMakerAssetAmountRemaining) {\n // Case 1: Right order is fully filled\n matchedFillResults.right.makerAssetFilledAmount = rightMakerAssetAmountRemaining;\n matchedFillResults.right.takerAssetFilledAmount = rightTakerAssetAmountRemaining;\n matchedFillResults.left.takerAssetFilledAmount = matchedFillResults.right.makerAssetFilledAmount;\n // Round down to ensure the maker's exchange rate does not exceed the price specified by the order. \n // We favor the maker when the exchange rate must be rounded.\n matchedFillResults.left.makerAssetFilledAmount = safeGetPartialAmountFloor(\n leftOrder.makerAssetAmount,\n leftOrder.takerAssetAmount,\n matchedFillResults.left.takerAssetFilledAmount\n );\n } else {\n // Case 2: Left order is fully filled\n matchedFillResults.left.makerAssetFilledAmount = leftMakerAssetAmountRemaining;\n matchedFillResults.left.takerAssetFilledAmount = leftTakerAssetAmountRemaining;\n matchedFillResults.right.makerAssetFilledAmount = matchedFillResults.left.takerAssetFilledAmount;\n // Round up to ensure the maker's exchange rate does not exceed the price specified by the order.\n // We favor the maker when the exchange rate must be rounded.\n matchedFillResults.right.takerAssetFilledAmount = safeGetPartialAmountCeil(\n rightOrder.takerAssetAmount,\n rightOrder.makerAssetAmount,\n matchedFillResults.right.makerAssetFilledAmount\n );\n }\n\n // Calculate amount given to taker\n matchedFillResults.leftMakerAssetSpreadAmount = safeSub(\n matchedFillResults.left.makerAssetFilledAmount,\n matchedFillResults.right.takerAssetFilledAmount\n );\n\n // Compute fees for left order\n matchedFillResults.left.makerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.left.makerAssetFilledAmount,\n leftOrder.makerAssetAmount,\n leftOrder.makerFee\n );\n matchedFillResults.left.takerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.left.takerAssetFilledAmount,\n leftOrder.takerAssetAmount,\n leftOrder.takerFee\n );\n\n // Compute fees for right order\n matchedFillResults.right.makerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.right.makerAssetFilledAmount,\n rightOrder.makerAssetAmount,\n rightOrder.makerFee\n );\n matchedFillResults.right.takerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.right.takerAssetFilledAmount,\n rightOrder.takerAssetAmount,\n rightOrder.takerFee\n );\n\n // Return fill results\n return matchedFillResults;\n }\n\n /// @dev Settles matched order by transferring appropriate funds between order makers, taker, and fee recipient.\n /// @param leftOrder First matched order.\n /// @param rightOrder Second matched order.\n /// @param takerAddress Address that matched the orders. The taker receives the spread between orders as profit.\n /// @param matchedFillResults Struct holding amounts to transfer between makers, taker, and fee recipients.\n function settleMatchedOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n address takerAddress,\n LibFillResults.MatchedFillResults memory matchedFillResults\n )\n private\n {\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n // Order makers and taker\n dispatchTransferFrom(\n leftOrder.makerAssetData,\n leftOrder.makerAddress,\n rightOrder.makerAddress,\n matchedFillResults.right.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n rightOrder.makerAssetData,\n rightOrder.makerAddress,\n leftOrder.makerAddress,\n matchedFillResults.left.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n leftOrder.makerAssetData,\n leftOrder.makerAddress,\n takerAddress,\n matchedFillResults.leftMakerAssetSpreadAmount\n );\n\n // Maker fees\n dispatchTransferFrom(\n zrxAssetData,\n leftOrder.makerAddress,\n leftOrder.feeRecipientAddress,\n matchedFillResults.left.makerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n rightOrder.makerAddress,\n rightOrder.feeRecipientAddress,\n matchedFillResults.right.makerFeePaid\n );\n\n // Taker fees\n if (leftOrder.feeRecipientAddress == rightOrder.feeRecipientAddress) {\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n leftOrder.feeRecipientAddress,\n safeAdd(\n matchedFillResults.left.takerFeePaid,\n matchedFillResults.right.takerFeePaid\n )\n );\n } else {\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n leftOrder.feeRecipientAddress,\n matchedFillResults.left.takerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n rightOrder.feeRecipientAddress,\n matchedFillResults.right.takerFeePaid\n );\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinSignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./interfaces/IWallet.sol\";\nimport \"./interfaces/IValidator.sol\";\n\n\ncontract MixinSignatureValidator is\n ReentrancyGuard,\n MSignatureValidator,\n MTransactions\n{\n using LibBytes for bytes;\n \n // Mapping of hash => signer => signed\n mapping (bytes32 => mapping (address => bool)) public preSigned;\n\n // Mapping of signer => validator => approved\n mapping (address => mapping (address => bool)) public allowedValidators;\n\n /// @dev Approves a hash on-chain using any valid signature type.\n /// After presigning a hash, the preSign signature type will become valid for that hash and signer.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n function preSign(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external\n {\n if (signerAddress != msg.sender) {\n require(\n isValidSignature(\n hash,\n signerAddress,\n signature\n ),\n \"INVALID_SIGNATURE\"\n );\n }\n preSigned[hash][signerAddress] = true;\n }\n\n /// @dev Approves/unnapproves a Validator contract to verify signatures on signer's behalf.\n /// @param validatorAddress Address of Validator contract.\n /// @param approval Approval or disapproval of Validator contract.\n function setSignatureValidatorApproval(\n address validatorAddress,\n bool approval\n )\n external\n nonReentrant\n {\n address signerAddress = getCurrentContextAddress();\n allowedValidators[signerAddress][validatorAddress] = approval;\n emit SignatureValidatorApproval(\n signerAddress,\n validatorAddress,\n approval\n );\n }\n\n /// @dev Verifies that a hash has been signed by the given signer.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes memory signature\n )\n public\n view\n returns (bool isValid)\n {\n require(\n signature.length > 0,\n \"LENGTH_GREATER_THAN_0_REQUIRED\"\n );\n\n // Pop last byte off of signature byte array.\n uint8 signatureTypeRaw = uint8(signature.popLastByte());\n\n // Ensure signature is supported\n require(\n signatureTypeRaw < uint8(SignatureType.NSignatureTypes),\n \"SIGNATURE_UNSUPPORTED\"\n );\n\n SignatureType signatureType = SignatureType(signatureTypeRaw);\n\n // Variables are not scoped in Solidity.\n uint8 v;\n bytes32 r;\n bytes32 s;\n address recovered;\n\n // Always illegal signature.\n // This is always an implicit option since a signer can create a\n // signature array with invalid type or length. We may as well make\n // it an explicit option. This aids testing and analysis. It is\n // also the initialization value for the enum type.\n if (signatureType == SignatureType.Illegal) {\n revert(\"SIGNATURE_ILLEGAL\");\n\n // Always invalid signature.\n // Like Illegal, this is always implicitly available and therefore\n // offered explicitly. It can be implicitly created by providing\n // a correctly formatted but incorrect signature.\n } else if (signatureType == SignatureType.Invalid) {\n require(\n signature.length == 0,\n \"LENGTH_0_REQUIRED\"\n );\n isValid = false;\n return isValid;\n\n // Signature using EIP712\n } else if (signatureType == SignatureType.EIP712) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n hash,\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n\n // Signed using web3.eth_sign\n } else if (signatureType == SignatureType.EthSign) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n keccak256(abi.encodePacked(\n \"\\x19Ethereum Signed Message:\\n32\",\n hash\n )),\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n\n // Signature verified by wallet contract.\n // If used with an order, the maker of the order is the wallet contract.\n } else if (signatureType == SignatureType.Wallet) {\n isValid = isValidWalletSignature(\n hash,\n signerAddress,\n signature\n );\n return isValid;\n\n // Signature verified by validator contract.\n // If used with an order, the maker of the order can still be an EOA.\n // A signature using this type should be encoded as:\n // | Offset | Length | Contents |\n // | 0x00 | x | Signature to validate |\n // | 0x00 + x | 20 | Address of validator contract |\n // | 0x14 + x | 1 | Signature type is always \"\\x06\" |\n } else if (signatureType == SignatureType.Validator) {\n // Pop last 20 bytes off of signature byte array.\n address validatorAddress = signature.popLast20Bytes();\n \n // Ensure signer has approved validator.\n if (!allowedValidators[signerAddress][validatorAddress]) {\n return false;\n }\n isValid = isValidValidatorSignature(\n validatorAddress,\n hash,\n signerAddress,\n signature\n );\n return isValid;\n\n // Signer signed hash previously using the preSign function.\n } else if (signatureType == SignatureType.PreSigned) {\n isValid = preSigned[hash][signerAddress];\n return isValid;\n }\n\n // Anything else is illegal (We do not return false because\n // the signature may actually be valid, just not in a format\n // that we currently support. In this case returning false\n // may lead the caller to incorrectly believe that the\n // signature was invalid.)\n revert(\"SIGNATURE_UNSUPPORTED\");\n }\n\n /// @dev Verifies signature using logic defined by Wallet contract.\n /// @param hash Any 32 byte hash.\n /// @param walletAddress Address that should have signed the given hash\n /// and defines its own signature verification method.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if signature is valid for given wallet..\n function isValidWalletSignature(\n bytes32 hash,\n address walletAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid)\n {\n bytes memory calldata = abi.encodeWithSelector(\n IWallet(walletAddress).isValidSignature.selector,\n hash,\n signature\n );\n assembly {\n let cdStart := add(calldata, 32)\n let success := staticcall(\n gas, // forward all gas\n walletAddress, // address of Wallet contract\n cdStart, // pointer to start of input\n mload(calldata), // length of input\n cdStart, // write output over input\n 32 // output size is 32 bytes\n )\n\n switch success\n case 0 {\n // Revert with `Error(\"WALLET_ERROR\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000c57414c4c45545f4552524f5200000000000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n case 1 {\n // Signature is valid if call did not revert and returned true\n isValid := mload(cdStart)\n }\n }\n return isValid;\n }\n\n /// @dev Verifies signature using logic defined by Validator contract.\n /// @param validatorAddress Address of validator contract.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidValidatorSignature(\n address validatorAddress,\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid)\n {\n bytes memory calldata = abi.encodeWithSelector(\n IValidator(signerAddress).isValidSignature.selector,\n hash,\n signerAddress,\n signature\n );\n assembly {\n let cdStart := add(calldata, 32)\n let success := staticcall(\n gas, // forward all gas\n validatorAddress, // address of Validator contract\n cdStart, // pointer to start of input\n mload(calldata), // length of input\n cdStart, // write output over input\n 32 // output size is 32 bytes\n )\n\n switch success\n case 0 {\n // Revert with `Error(\"VALIDATOR_ERROR\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f56414c494441544f525f4552524f5200000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n case 1 {\n // Signature is valid if call did not revert and returned true\n isValid := mload(cdStart)\n }\n }\n return isValid;\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinTransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\nimport \"./libs/LibExchangeErrors.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./libs/LibEIP712.sol\";\n\n\ncontract MixinTransactions is\n LibEIP712,\n MSignatureValidator,\n MTransactions\n{\n // Mapping of transaction hash => executed\n // This prevents transactions from being executed more than once.\n mapping (bytes32 => bool) public transactions;\n\n // Address of current transaction signer\n address public currentContextAddress;\n\n /// @dev Executes an exchange method call in the context of signer.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @param signature Proof of signer transaction by signer.\n function executeTransaction(\n uint256 salt,\n address signerAddress,\n bytes data,\n bytes signature\n )\n external\n {\n // Prevent reentrancy\n require(\n currentContextAddress == address(0),\n \"REENTRANCY_ILLEGAL\"\n );\n\n bytes32 transactionHash = hashEIP712Message(hashZeroExTransaction(\n salt,\n signerAddress,\n data\n ));\n\n // Validate transaction has not been executed\n require(\n !transactions[transactionHash],\n \"INVALID_TX_HASH\"\n );\n\n // Transaction always valid if signer is sender of transaction\n if (signerAddress != msg.sender) {\n // Validate signature\n require(\n isValidSignature(\n transactionHash,\n signerAddress,\n signature\n ),\n \"INVALID_TX_SIGNATURE\"\n );\n\n // Set the current transaction signer\n currentContextAddress = signerAddress;\n }\n\n // Execute transaction\n transactions[transactionHash] = true;\n require(\n address(this).delegatecall(data),\n \"FAILED_EXECUTION\"\n );\n\n // Reset current transaction signer if it was previously updated\n if (signerAddress != msg.sender) {\n currentContextAddress = address(0);\n }\n }\n\n /// @dev Calculates EIP712 hash of the Transaction.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @return EIP712 hash of the Transaction.\n function hashZeroExTransaction(\n uint256 salt,\n address signerAddress,\n bytes memory data\n )\n internal\n pure\n returns (bytes32 result)\n {\n bytes32 schemaHash = EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH;\n bytes32 dataHash = keccak256(data);\n\n // Assembly for more efficiently computing:\n // keccak256(abi.encodePacked(\n // EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH,\n // salt,\n // bytes32(signerAddress),\n // keccak256(data)\n // ));\n\n assembly {\n // Load free memory pointer\n let memPtr := mload(64)\n\n mstore(memPtr, schemaHash) // hash of schema\n mstore(add(memPtr, 32), salt) // salt\n mstore(add(memPtr, 64), and(signerAddress, 0xffffffffffffffffffffffffffffffffffffffff)) // signerAddress\n mstore(add(memPtr, 96), dataHash) // hash of data\n\n // Compute hash\n result := keccak256(memPtr, 128)\n }\n return result;\n }\n\n /// @dev The current function will be called in the context of this address (either 0x transaction signer or `msg.sender`).\n /// If calling a fill function, this address will represent the taker.\n /// If calling a cancel function, this address will represent the maker.\n /// @return Signer of 0x transaction if entry point is `executeTransaction`.\n /// `msg.sender` if entry point is any other function.\n function getCurrentContextAddress()\n internal\n view\n returns (address)\n {\n address currentContextAddress_ = currentContextAddress;\n address contextAddress = currentContextAddress_ == address(0) ? msg.sender : currentContextAddress_;\n return contextAddress;\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./libs/LibAbiEncoder.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MWrapperFunctions.sol\";\n\n\ncontract MixinWrapperFunctions is\n ReentrancyGuard,\n LibMath,\n LibFillResults,\n LibAbiEncoder,\n MExchangeCore,\n MWrapperFunctions\n{\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n nonReentrant\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrKillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n return fillResults;\n }\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (FillResults memory fillResults)\n {\n // ABI encode calldata for `fillOrder`\n bytes memory fillOrderCalldata = abiEncodeFillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n\n // Delegate to `fillOrder` and handle any exceptions gracefully\n assembly {\n let success := delegatecall(\n gas, // forward all gas\n address, // call address of this contract\n add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes)\n mload(fillOrderCalldata), // length of input\n fillOrderCalldata, // write output over input\n 128 // output size is 128 bytes\n )\n if success {\n mstore(fillResults, mload(fillOrderCalldata))\n mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32)))\n mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64)))\n mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96)))\n }\n }\n // fillResults values will be 0 by default if call was unsuccessful\n return fillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrKill.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrKillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrKillOrderInternal(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrders(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n bytes memory takerAssetData = orders[0].takerAssetData;\n \n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being sold by taker is the same for each order.\n // Rather than passing this in as calldata, we use the takerAssetData from the first order in all later orders.\n orders[i].takerAssetData = takerAssetData;\n\n // Calculate the remaining amount of takerAsset to sell\n uint256 remainingTakerAssetFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= takerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory takerAssetData = orders[0].takerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being sold by taker is the same for each order.\n // Rather than passing this in as calldata, we use the takerAssetData from the first order in all later orders.\n orders[i].takerAssetData = takerAssetData;\n\n // Calculate the remaining amount of takerAsset to sell\n uint256 remainingTakerAssetFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= takerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerAsset is bought by taker.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrders(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // Rather than passing this in as calldata, we copy the makerAssetData from the first order onto all later orders.\n orders[i].makerAssetData = makerAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n if (totalFillResults.makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // Rather than passing this in as calldata, we copy the makerAssetData from the first order onto all later orders.\n orders[i].makerAssetData = makerAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n if (totalFillResults.makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously cancels multiple orders in a single transaction.\n /// @param orders Array of order specifications.\n function batchCancelOrders(LibOrder.Order[] memory orders)\n public\n nonReentrant\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n cancelOrderInternal(orders[i]);\n }\n }\n\n /// @dev Fetches information for all passed in orders.\n /// @param orders Array of order specifications.\n /// @return Array of OrderInfo instances that correspond to each order.\n function getOrdersInfo(LibOrder.Order[] memory orders)\n public\n view\n returns (LibOrder.OrderInfo[] memory)\n {\n uint256 ordersLength = orders.length;\n LibOrder.OrderInfo[] memory ordersInfo = new LibOrder.OrderInfo[](ordersLength);\n for (uint256 i = 0; i != ordersLength; i++) {\n ordersInfo[i] = getOrderInfo(orders[i]);\n }\n return ordersInfo;\n }\n\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n require(\n fillResults.takerAssetFilledAmount == takerAssetFillAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return fillResults;\n }\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IAssetProxyDispatcher {\n\n /// @dev Registers an asset proxy to its asset proxy id.\n /// Once an asset proxy is registered, it cannot be unregistered.\n /// @param assetProxy Address of new asset proxy to register.\n function registerAssetProxy(address assetProxy)\n external;\n\n /// @dev Gets an asset proxy.\n /// @param assetProxyId Id of the asset proxy.\n /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered.\n function getAssetProxy(bytes4 assetProxyId)\n external\n view\n returns (address);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IExchange.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./IExchangeCore.sol\";\nimport \"./IMatchOrders.sol\";\nimport \"./ISignatureValidator.sol\";\nimport \"./ITransactions.sol\";\nimport \"./IAssetProxyDispatcher.sol\";\nimport \"./IWrapperFunctions.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract IExchange is\n IExchangeCore,\n IMatchOrders,\n ISignatureValidator,\n ITransactions,\n IAssetProxyDispatcher,\n IWrapperFunctions\n{}\n",
- "2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IExchangeCore {\n\n /// @dev Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch\n /// and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress).\n /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled.\n function cancelOrdersUpTo(uint256 targetOrderEpoch)\n external;\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev After calling, the order can not be filled anymore.\n /// @param order Order struct containing order specifications.\n function cancelOrder(LibOrder.Order memory order)\n public;\n\n /// @dev Gets information about an order: status, hash, and amount filled.\n /// @param order Order to gather information on.\n /// @return OrderInfo Information about the order and its state.\n /// See LibOrder.OrderInfo for a complete description.\n function getOrderInfo(LibOrder.Order memory order)\n public\n view\n returns (LibOrder.OrderInfo memory orderInfo);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IMatchOrders {\n\n /// @dev Match two complementary orders that have a profitable spread.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the left order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftSignature Proof that order was created by the left maker.\n /// @param rightSignature Proof that order was created by the right maker.\n /// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.\n function matchOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n bytes memory leftSignature,\n bytes memory rightSignature\n )\n public\n returns (LibFillResults.MatchedFillResults memory matchedFillResults);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract ISignatureValidator {\n\n /// @dev Approves a hash on-chain using any valid signature type.\n /// After presigning a hash, the preSign signature type will become valid for that hash and signer.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n function preSign(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external;\n \n /// @dev Approves/unnapproves a Validator contract to verify signatures on signer's behalf.\n /// @param validatorAddress Address of Validator contract.\n /// @param approval Approval or disapproval of Validator contract.\n function setSignatureValidatorApproval(\n address validatorAddress,\n bool approval\n )\n external;\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signerAddress Address of signer.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes memory signature\n )\n public\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/ITransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\n\ncontract ITransactions {\n\n /// @dev Executes an exchange method call in the context of signer.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @param signature Proof of signer transaction by signer.\n function executeTransaction(\n uint256 salt,\n address signerAddress,\n bytes data,\n bytes signature\n )\n external;\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IValidator {\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IWallet.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IWallet {\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n bytes signature\n )\n external\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IWrapperFunctions {\n\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrKill.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrKillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrders(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerAsset is bought by taker.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrders(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously cancels multiple orders in a single transaction.\n /// @param orders Array of order specifications.\n function batchCancelOrders(LibOrder.Order[] memory orders)\n public;\n\n /// @dev Fetches information for all passed in orders\n /// @param orders Array of order specifications.\n /// @return Array of OrderInfo instances that correspond to each order.\n function getOrdersInfo(LibOrder.Order[] memory orders)\n public\n view\n returns (LibOrder.OrderInfo[] memory);\n}\n",
- "2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./LibOrder.sol\";\n\n\ncontract LibAbiEncoder {\n\n /// @dev ABI encodes calldata for `fillOrder`.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return ABI encoded calldata for `fillOrder`.\n function abiEncodeFillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n pure\n returns (bytes memory fillOrderCalldata)\n {\n // We need to call MExchangeCore.fillOrder using a delegatecall in\n // assembly so that we can intercept a call that throws. For this, we\n // need the input encoded in memory in the Ethereum ABIv2 format [1].\n\n // | Area | Offset | Length | Contents |\n // | -------- |--------|---------|-------------------------------------------- |\n // | Header | 0x00 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 0x00 | | 1. offset to order (*) |\n // | | 0x20 | | 2. takerAssetFillAmount |\n // | | 0x40 | | 3. offset to signature (*) |\n // | Data | | 12 * 32 | order: |\n // | | 0x000 | | 1. senderAddress |\n // | | 0x020 | | 2. makerAddress |\n // | | 0x040 | | 3. takerAddress |\n // | | 0x060 | | 4. feeRecipientAddress |\n // | | 0x080 | | 5. makerAssetAmount |\n // | | 0x0A0 | | 6. takerAssetAmount |\n // | | 0x0C0 | | 7. makerFeeAmount |\n // | | 0x0E0 | | 8. takerFeeAmount |\n // | | 0x100 | | 9. expirationTimeSeconds |\n // | | 0x120 | | 10. salt |\n // | | 0x140 | | 11. Offset to makerAssetData (*) |\n // | | 0x160 | | 12. Offset to takerAssetData (*) |\n // | | 0x180 | 32 | makerAssetData Length |\n // | | 0x1A0 | ** | makerAssetData Contents |\n // | | 0x1C0 | 32 | takerAssetData Length |\n // | | 0x1E0 | ** | takerAssetData Contents |\n // | | 0x200 | 32 | signature Length |\n // | | 0x220 | ** | signature Contents |\n\n // * Offsets are calculated from the beginning of the current area: Header, Params, Data:\n // An offset stored in the Params area is calculated from the beginning of the Params section.\n // An offset stored in the Data area is calculated from the beginning of the Data section.\n\n // ** The length of dynamic array contents are stored in the field immediately preceeding the contents.\n\n // [1]: https://solidity.readthedocs.io/en/develop/abi-spec.html\n\n assembly {\n\n // Areas below may use the following variables:\n // 1. <area>Start -- Start of this area in memory\n // 2. <area>End -- End of this area in memory. This value may\n // be precomputed (before writing contents),\n // or it may be computed as contents are written.\n // 3. <area>Offset -- Current offset into area. If an area's End\n // is precomputed, this variable tracks the\n // offsets of contents as they are written.\n\n /////// Setup Header Area ///////\n // Load free memory pointer\n fillOrderCalldata := mload(0x40)\n // bytes4(keccak256(\"fillOrder((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),uint256,bytes)\"))\n // = 0xb4be83d5\n // Leave 0x20 bytes to store the length\n mstore(add(fillOrderCalldata, 0x20), 0xb4be83d500000000000000000000000000000000000000000000000000000000)\n let headerAreaEnd := add(fillOrderCalldata, 0x24)\n\n /////// Setup Params Area ///////\n // This area is preallocated and written to later.\n // This is because we need to fill in offsets that have not yet been calculated.\n let paramsAreaStart := headerAreaEnd\n let paramsAreaEnd := add(paramsAreaStart, 0x60)\n let paramsAreaOffset := paramsAreaStart\n\n /////// Setup Data Area ///////\n let dataAreaStart := paramsAreaEnd\n let dataAreaEnd := dataAreaStart\n\n // Offset from the source data we're reading from\n let sourceOffset := order\n // arrayLenBytes and arrayLenWords track the length of a dynamically-allocated bytes array.\n let arrayLenBytes := 0\n let arrayLenWords := 0\n\n /////// Write order Struct ///////\n // Write memory location of Order, relative to the start of the\n // parameter list, then increment the paramsAreaOffset respectively.\n mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))\n paramsAreaOffset := add(paramsAreaOffset, 0x20)\n\n // Write values for each field in the order\n // It would be nice to use a loop, but we save on gas by writing\n // the stores sequentially.\n mstore(dataAreaEnd, mload(sourceOffset)) // makerAddress\n mstore(add(dataAreaEnd, 0x20), mload(add(sourceOffset, 0x20))) // takerAddress\n mstore(add(dataAreaEnd, 0x40), mload(add(sourceOffset, 0x40))) // feeRecipientAddress\n mstore(add(dataAreaEnd, 0x60), mload(add(sourceOffset, 0x60))) // senderAddress\n mstore(add(dataAreaEnd, 0x80), mload(add(sourceOffset, 0x80))) // makerAssetAmount\n mstore(add(dataAreaEnd, 0xA0), mload(add(sourceOffset, 0xA0))) // takerAssetAmount\n mstore(add(dataAreaEnd, 0xC0), mload(add(sourceOffset, 0xC0))) // makerFeeAmount\n mstore(add(dataAreaEnd, 0xE0), mload(add(sourceOffset, 0xE0))) // takerFeeAmount\n mstore(add(dataAreaEnd, 0x100), mload(add(sourceOffset, 0x100))) // expirationTimeSeconds\n mstore(add(dataAreaEnd, 0x120), mload(add(sourceOffset, 0x120))) // salt\n mstore(add(dataAreaEnd, 0x140), mload(add(sourceOffset, 0x140))) // Offset to makerAssetData\n mstore(add(dataAreaEnd, 0x160), mload(add(sourceOffset, 0x160))) // Offset to takerAssetData\n dataAreaEnd := add(dataAreaEnd, 0x180)\n sourceOffset := add(sourceOffset, 0x180)\n\n // Write offset to <order.makerAssetData>\n mstore(add(dataAreaStart, mul(10, 0x20)), sub(dataAreaEnd, dataAreaStart))\n\n // Calculate length of <order.makerAssetData>\n sourceOffset := mload(add(order, 0x140)) // makerAssetData\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of <order.makerAssetData>\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of <order.makerAssetData>\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n // Write offset to <order.takerAssetData>\n mstore(add(dataAreaStart, mul(11, 0x20)), sub(dataAreaEnd, dataAreaStart))\n\n // Calculate length of <order.takerAssetData>\n sourceOffset := mload(add(order, 0x160)) // takerAssetData\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of <order.takerAssetData>\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of <order.takerAssetData>\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n /////// Write takerAssetFillAmount ///////\n mstore(paramsAreaOffset, takerAssetFillAmount)\n paramsAreaOffset := add(paramsAreaOffset, 0x20)\n\n /////// Write signature ///////\n // Write offset to paramsArea\n mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))\n\n // Calculate length of signature\n sourceOffset := signature\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of signature\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of signature\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n // Set length of calldata\n mstore(fillOrderCalldata, sub(dataAreaEnd, add(fillOrderCalldata, 0x20)))\n\n // Increment free memory pointer\n mstore(0x40, dataAreaEnd)\n }\n\n return fillOrderCalldata;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibConstants.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\n// solhint-disable max-line-length\ncontract LibConstants {\n \n // Asset data for ZRX token. Used for fee transfers.\n // @TODO: Hardcode constant when we deploy. Currently \n // not constant to make testing easier.\n\n // The proxyId for ZRX_ASSET_DATA is bytes4(keccak256(\"ERC20Token(address)\")) = 0xf47261b0\n \n // Kovan ZRX address is 0x6ff6c0ff1d68b964901f986d4c9fa3ac68346570.\n // The ABI encoded proxyId and address is 0xf47261b00000000000000000000000006ff6c0ff1d68b964901f986d4c9fa3ac68346570\n // bytes constant public ZRX_ASSET_DATA = \"\\xf4\\x72\\x61\\xb0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x6f\\xf6\\xc0\\xff\\x1d\\x68\\xb9\\x64\\x90\\x1f\\x98\\x6d\\x4c\\x9f\\xa3\\xac\\x68\\x34\\x65\\x70\";\n \n // Mainnet ZRX address is 0xe41d2489571d322189246dafa5ebde1f4699f498.\n // The ABI encoded proxyId and address is 0xf47261b0000000000000000000000000e41d2489571d322189246dafa5ebde1f4699f498\n // bytes constant public ZRX_ASSET_DATA = \"\\xf4\\x72\\x61\\xb0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xe4\\x1d\\x24\\x89\\x57\\x1d\\x32\\x21\\x89\\x24\\x6d\\xaf\\xa5\\xeb\\xde\\x1f\\x46\\x99\\xf4\\x98\";\n \n // solhint-disable-next-line var-name-mixedcase\n bytes public ZRX_ASSET_DATA;\n\n // @TODO: Remove when we deploy.\n constructor (bytes memory zrxAssetData)\n public\n {\n ZRX_ASSET_DATA = zrxAssetData;\n }\n}\n// solhint-enable max-line-length\n",
- "2.0.0/protocol/Exchange/libs/LibEIP712.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract LibEIP712 {\n\n // EIP191 header for EIP712 prefix\n string constant internal EIP191_HEADER = \"\\x19\\x01\";\n\n // EIP712 Domain Name value\n string constant internal EIP712_DOMAIN_NAME = \"0x Protocol\";\n\n // EIP712 Domain Version value\n string constant internal EIP712_DOMAIN_VERSION = \"2\";\n\n // Hash of the EIP712 Domain Separator Schema\n bytes32 constant internal EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"EIP712Domain(\",\n \"string name,\",\n \"string version,\",\n \"address verifyingContract\",\n \")\"\n ));\n\n // Hash of the EIP712 Domain Separator data\n // solhint-disable-next-line var-name-mixedcase\n bytes32 public EIP712_DOMAIN_HASH;\n\n constructor ()\n public\n {\n EIP712_DOMAIN_HASH = keccak256(abi.encodePacked(\n EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH,\n keccak256(bytes(EIP712_DOMAIN_NAME)),\n keccak256(bytes(EIP712_DOMAIN_VERSION)),\n bytes32(address(this))\n ));\n }\n\n /// @dev Calculates EIP712 encoding for a hash struct in this EIP712 Domain.\n /// @param hashStruct The EIP712 hash struct.\n /// @return EIP712 hash applied to this EIP712 Domain.\n function hashEIP712Message(bytes32 hashStruct)\n internal\n view\n returns (bytes32 result)\n {\n bytes32 eip712DomainHash = EIP712_DOMAIN_HASH;\n\n // Assembly for more efficient computing:\n // keccak256(abi.encodePacked(\n // EIP191_HEADER,\n // EIP712_DOMAIN_HASH,\n // hashStruct \n // ));\n\n assembly {\n // Load free memory pointer\n let memPtr := mload(64)\n\n mstore(memPtr, 0x1901000000000000000000000000000000000000000000000000000000000000) // EIP191 header\n mstore(add(memPtr, 2), eip712DomainHash) // EIP712 domain hash\n mstore(add(memPtr, 34), hashStruct) // Hash of struct\n\n // Compute hash\n result := keccak256(memPtr, 66)\n }\n return result;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\n// solhint-disable\npragma solidity 0.4.24;\n\n\n/// @dev This contract documents the revert reasons used in the Exchange contract.\n/// This contract is intended to serve as a reference, but is not actually used for efficiency reasons.\ncontract LibExchangeErrors {\n\n /// Order validation errors ///\n string constant ORDER_UNFILLABLE = \"ORDER_UNFILLABLE\"; // Order cannot be filled.\n string constant INVALID_MAKER = \"INVALID_MAKER\"; // Invalid makerAddress.\n string constant INVALID_TAKER = \"INVALID_TAKER\"; // Invalid takerAddress.\n string constant INVALID_SENDER = \"INVALID_SENDER\"; // Invalid `msg.sender`.\n string constant INVALID_ORDER_SIGNATURE = \"INVALID_ORDER_SIGNATURE\"; // Signature validation failed. \n \n /// fillOrder validation errors ///\n string constant INVALID_TAKER_AMOUNT = \"INVALID_TAKER_AMOUNT\"; // takerAssetFillAmount cannot equal 0.\n string constant ROUNDING_ERROR = \"ROUNDING_ERROR\"; // Rounding error greater than 0.1% of takerAssetFillAmount. \n \n /// Signature validation errors ///\n string constant INVALID_SIGNATURE = \"INVALID_SIGNATURE\"; // Signature validation failed. \n string constant SIGNATURE_ILLEGAL = \"SIGNATURE_ILLEGAL\"; // Signature type is illegal.\n string constant SIGNATURE_UNSUPPORTED = \"SIGNATURE_UNSUPPORTED\"; // Signature type unsupported.\n \n /// cancelOrdersUptTo errors ///\n string constant INVALID_NEW_ORDER_EPOCH = \"INVALID_NEW_ORDER_EPOCH\"; // Specified salt must be greater than or equal to existing orderEpoch.\n\n /// fillOrKillOrder errors ///\n string constant COMPLETE_FILL_FAILED = \"COMPLETE_FILL_FAILED\"; // Desired takerAssetFillAmount could not be completely filled. \n\n /// matchOrders errors ///\n string constant NEGATIVE_SPREAD_REQUIRED = \"NEGATIVE_SPREAD_REQUIRED\"; // Matched orders must have a negative spread.\n\n /// Transaction errors ///\n string constant REENTRANCY_ILLEGAL = \"REENTRANCY_ILLEGAL\"; // Recursive reentrancy is not allowed. \n string constant INVALID_TX_HASH = \"INVALID_TX_HASH\"; // Transaction has already been executed. \n string constant INVALID_TX_SIGNATURE = \"INVALID_TX_SIGNATURE\"; // Signature validation failed. \n string constant FAILED_EXECUTION = \"FAILED_EXECUTION\"; // Transaction execution failed. \n \n /// registerAssetProxy errors ///\n string constant ASSET_PROXY_ALREADY_EXISTS = \"ASSET_PROXY_ALREADY_EXISTS\"; // AssetProxy with same id already exists.\n\n /// dispatchTransferFrom errors ///\n string constant ASSET_PROXY_DOES_NOT_EXIST = \"ASSET_PROXY_DOES_NOT_EXIST\"; // No assetProxy registered at given id.\n string constant TRANSFER_FAILED = \"TRANSFER_FAILED\"; // Asset transfer unsuccesful.\n\n /// Length validation errors ///\n string constant LENGTH_GREATER_THAN_0_REQUIRED = \"LENGTH_GREATER_THAN_0_REQUIRED\"; // Byte array must have a length greater than 0.\n string constant LENGTH_GREATER_THAN_3_REQUIRED = \"LENGTH_GREATER_THAN_3_REQUIRED\"; // Byte array must have a length greater than 3.\n string constant LENGTH_0_REQUIRED = \"LENGTH_0_REQUIRED\"; // Byte array must have a length of 0.\n string constant LENGTH_65_REQUIRED = \"LENGTH_65_REQUIRED\"; // Byte array must have a length of 65.\n}\n",
- "2.0.0/protocol/Exchange/libs/LibFillResults.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract LibFillResults is\n SafeMath\n{\n struct FillResults {\n uint256 makerAssetFilledAmount; // Total amount of makerAsset(s) filled.\n uint256 takerAssetFilledAmount; // Total amount of takerAsset(s) filled.\n uint256 makerFeePaid; // Total amount of ZRX paid by maker(s) to feeRecipient(s).\n uint256 takerFeePaid; // Total amount of ZRX paid by taker to feeRecipients(s).\n }\n\n struct MatchedFillResults {\n FillResults left; // Amounts filled and fees paid of left order.\n FillResults right; // Amounts filled and fees paid of right order.\n uint256 leftMakerAssetSpreadAmount; // Spread between price of left and right order, denominated in the left order's makerAsset, paid to taker.\n }\n\n /// @dev Adds properties of both FillResults instances.\n /// Modifies the first FillResults instance specified.\n /// @param totalFillResults Fill results instance that will be added onto.\n /// @param singleFillResults Fill results instance that will be added to totalFillResults.\n function addFillResults(FillResults memory totalFillResults, FillResults memory singleFillResults)\n internal\n pure\n {\n totalFillResults.makerAssetFilledAmount = safeAdd(totalFillResults.makerAssetFilledAmount, singleFillResults.makerAssetFilledAmount);\n totalFillResults.takerAssetFilledAmount = safeAdd(totalFillResults.takerAssetFilledAmount, singleFillResults.takerAssetFilledAmount);\n totalFillResults.makerFeePaid = safeAdd(totalFillResults.makerFeePaid, singleFillResults.makerFeePaid);\n totalFillResults.takerFeePaid = safeAdd(totalFillResults.takerFeePaid, singleFillResults.takerFeePaid);\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibMath.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract LibMath is\n SafeMath\n{\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// Reverts if rounding error is >= 0.1%\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded down.\n function safeGetPartialAmountFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n require(\n !isRoundingErrorFloor(\n numerator,\n denominator,\n target\n ),\n \"ROUNDING_ERROR\"\n );\n \n partialAmount = safeDiv(\n safeMul(numerator, target),\n denominator\n );\n return partialAmount;\n }\n\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// Reverts if rounding error is >= 0.1%\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded up.\n function safeGetPartialAmountCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n require(\n !isRoundingErrorCeil(\n numerator,\n denominator,\n target\n ),\n \"ROUNDING_ERROR\"\n );\n \n // safeDiv computes `floor(a / b)`. We use the identity (a, b integer):\n // ceil(a / b) = floor((a + b - 1) / b)\n // To implement `ceil(a / b)` using safeDiv.\n partialAmount = safeDiv(\n safeAdd(\n safeMul(numerator, target),\n safeSub(denominator, 1)\n ),\n denominator\n );\n return partialAmount;\n }\n\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded down.\n function getPartialAmountFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n partialAmount = safeDiv(\n safeMul(numerator, target),\n denominator\n );\n return partialAmount;\n }\n \n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded up.\n function getPartialAmountCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n // safeDiv computes `floor(a / b)`. We use the identity (a, b integer):\n // ceil(a / b) = floor((a + b - 1) / b)\n // To implement `ceil(a / b)` using safeDiv.\n partialAmount = safeDiv(\n safeAdd(\n safeMul(numerator, target),\n safeSub(denominator, 1)\n ),\n denominator\n );\n return partialAmount;\n }\n \n /// @dev Checks if rounding error >= 0.1% when rounding down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to multiply with numerator/denominator.\n /// @return Rounding error is present.\n function isRoundingErrorFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (bool isError)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n \n // The absolute rounding error is the difference between the rounded\n // value and the ideal value. The relative rounding error is the\n // absolute rounding error divided by the absolute value of the\n // ideal value. This is undefined when the ideal value is zero.\n //\n // The ideal value is `numerator * target / denominator`.\n // Let's call `numerator * target % denominator` the remainder.\n // The absolute error is `remainder / denominator`.\n //\n // When the ideal value is zero, we require the absolute error to\n // be zero. Fortunately, this is always the case. The ideal value is\n // zero iff `numerator == 0` and/or `target == 0`. In this case the\n // remainder and absolute error are also zero. \n if (target == 0 || numerator == 0) {\n return false;\n }\n \n // Otherwise, we want the relative rounding error to be strictly\n // less than 0.1%.\n // The relative error is `remainder / (numerator * target)`.\n // We want the relative error less than 1 / 1000:\n // remainder / (numerator * denominator) < 1 / 1000\n // or equivalently:\n // 1000 * remainder < numerator * target\n // so we have a rounding error iff:\n // 1000 * remainder >= numerator * target\n uint256 remainder = mulmod(\n target,\n numerator,\n denominator\n );\n isError = safeMul(1000, remainder) >= safeMul(numerator, target);\n return isError;\n }\n \n /// @dev Checks if rounding error >= 0.1% when rounding up.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to multiply with numerator/denominator.\n /// @return Rounding error is present.\n function isRoundingErrorCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (bool isError)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n \n // See the comments in `isRoundingError`.\n if (target == 0 || numerator == 0) {\n // When either is zero, the ideal value and rounded value are zero\n // and there is no rounding error. (Although the relative error\n // is undefined.)\n return false;\n }\n // Compute remainder as before\n uint256 remainder = mulmod(\n target,\n numerator,\n denominator\n );\n remainder = safeSub(denominator, remainder) % denominator;\n isError = safeMul(1000, remainder) >= safeMul(numerator, target);\n return isError;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibOrder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./LibEIP712.sol\";\n\n\ncontract LibOrder is\n LibEIP712\n{\n // Hash for the EIP712 Order Schema\n bytes32 constant internal EIP712_ORDER_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"Order(\",\n \"address makerAddress,\",\n \"address takerAddress,\",\n \"address feeRecipientAddress,\",\n \"address senderAddress,\",\n \"uint256 makerAssetAmount,\",\n \"uint256 takerAssetAmount,\",\n \"uint256 makerFee,\",\n \"uint256 takerFee,\",\n \"uint256 expirationTimeSeconds,\",\n \"uint256 salt,\",\n \"bytes makerAssetData,\",\n \"bytes takerAssetData\",\n \")\"\n ));\n\n // A valid order remains fillable until it is expired, fully filled, or cancelled.\n // An order's state is unaffected by external factors, like account balances.\n enum OrderStatus {\n INVALID, // Default value\n INVALID_MAKER_ASSET_AMOUNT, // Order does not have a valid maker asset amount\n INVALID_TAKER_ASSET_AMOUNT, // Order does not have a valid taker asset amount\n FILLABLE, // Order is fillable\n EXPIRED, // Order has already expired\n FULLY_FILLED, // Order is fully filled\n CANCELLED // Order has been cancelled\n }\n\n // solhint-disable max-line-length\n struct Order {\n address makerAddress; // Address that created the order. \n address takerAddress; // Address that is allowed to fill the order. If set to 0, any address is allowed to fill the order. \n address feeRecipientAddress; // Address that will recieve fees when order is filled. \n address senderAddress; // Address that is allowed to call Exchange contract methods that affect this order. If set to 0, any address is allowed to call these methods.\n uint256 makerAssetAmount; // Amount of makerAsset being offered by maker. Must be greater than 0. \n uint256 takerAssetAmount; // Amount of takerAsset being bid on by maker. Must be greater than 0. \n uint256 makerFee; // Amount of ZRX paid to feeRecipient by maker when order is filled. If set to 0, no transfer of ZRX from maker to feeRecipient will be attempted.\n uint256 takerFee; // Amount of ZRX paid to feeRecipient by taker when order is filled. If set to 0, no transfer of ZRX from taker to feeRecipient will be attempted.\n uint256 expirationTimeSeconds; // Timestamp in seconds at which order expires. \n uint256 salt; // Arbitrary number to facilitate uniqueness of the order's hash. \n bytes makerAssetData; // Encoded data that can be decoded by a specified proxy contract when transferring makerAsset. The last byte references the id of this proxy.\n bytes takerAssetData; // Encoded data that can be decoded by a specified proxy contract when transferring takerAsset. The last byte references the id of this proxy.\n }\n // solhint-enable max-line-length\n\n struct OrderInfo {\n uint8 orderStatus; // Status that describes order's validity and fillability.\n bytes32 orderHash; // EIP712 hash of the order (see LibOrder.getOrderHash).\n uint256 orderTakerAssetFilledAmount; // Amount of order that has already been filled.\n }\n\n /// @dev Calculates Keccak-256 hash of the order.\n /// @param order The order structure.\n /// @return Keccak-256 EIP712 hash of the order.\n function getOrderHash(Order memory order)\n internal\n view\n returns (bytes32 orderHash)\n {\n orderHash = hashEIP712Message(hashOrder(order));\n return orderHash;\n }\n\n /// @dev Calculates EIP712 hash of the order.\n /// @param order The order structure.\n /// @return EIP712 hash of the order.\n function hashOrder(Order memory order)\n internal\n pure\n returns (bytes32 result)\n {\n bytes32 schemaHash = EIP712_ORDER_SCHEMA_HASH;\n bytes32 makerAssetDataHash = keccak256(order.makerAssetData);\n bytes32 takerAssetDataHash = keccak256(order.takerAssetData);\n\n // Assembly for more efficiently computing:\n // keccak256(abi.encodePacked(\n // EIP712_ORDER_SCHEMA_HASH,\n // bytes32(order.makerAddress),\n // bytes32(order.takerAddress),\n // bytes32(order.feeRecipientAddress),\n // bytes32(order.senderAddress),\n // order.makerAssetAmount,\n // order.takerAssetAmount,\n // order.makerFee,\n // order.takerFee,\n // order.expirationTimeSeconds,\n // order.salt,\n // keccak256(order.makerAssetData),\n // keccak256(order.takerAssetData)\n // ));\n\n assembly {\n // Calculate memory addresses that will be swapped out before hashing\n let pos1 := sub(order, 32)\n let pos2 := add(order, 320)\n let pos3 := add(order, 352)\n\n // Backup\n let temp1 := mload(pos1)\n let temp2 := mload(pos2)\n let temp3 := mload(pos3)\n \n // Hash in place\n mstore(pos1, schemaHash)\n mstore(pos2, makerAssetDataHash)\n mstore(pos3, takerAssetDataHash)\n result := keccak256(pos1, 416)\n \n // Restore\n mstore(pos1, temp1)\n mstore(pos2, temp2)\n mstore(pos3, temp3)\n }\n return result;\n }\n}\n",
- "2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAssetProxyDispatcher.sol\";\n\n\ncontract MAssetProxyDispatcher is\n IAssetProxyDispatcher\n{\n // Logs registration of new asset proxy\n event AssetProxyRegistered(\n bytes4 id, // Id of new registered AssetProxy.\n address assetProxy // Address of new registered AssetProxy.\n );\n\n /// @dev Forwards arguments to assetProxy and calls `transferFrom`. Either succeeds or throws.\n /// @param assetData Byte array encoded for the asset.\n /// @param from Address to transfer token from.\n /// @param to Address to transfer token to.\n /// @param amount Amount of token to transfer.\n function dispatchTransferFrom(\n bytes memory assetData,\n address from,\n address to,\n uint256 amount\n )\n internal;\n}\n",
- "2.0.0/protocol/Exchange/mixins/MExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IExchangeCore.sol\";\n\n\ncontract MExchangeCore is\n IExchangeCore\n{\n // Fill event is emitted whenever an order is filled.\n event Fill(\n address indexed makerAddress, // Address that created the order. \n address indexed feeRecipientAddress, // Address that received fees.\n address takerAddress, // Address that filled the order.\n address senderAddress, // Address that called the Exchange contract (msg.sender).\n uint256 makerAssetFilledAmount, // Amount of makerAsset sold by maker and bought by taker. \n uint256 takerAssetFilledAmount, // Amount of takerAsset sold by taker and bought by maker.\n uint256 makerFeePaid, // Amount of ZRX paid to feeRecipient by maker.\n uint256 takerFeePaid, // Amount of ZRX paid to feeRecipient by taker.\n bytes32 indexed orderHash, // EIP712 hash of order (see LibOrder.getOrderHash).\n bytes makerAssetData, // Encoded data specific to makerAsset. \n bytes takerAssetData // Encoded data specific to takerAsset.\n );\n\n // Cancel event is emitted whenever an individual order is cancelled.\n event Cancel(\n address indexed makerAddress, // Address that created the order. \n address indexed feeRecipientAddress, // Address that would have recieved fees if order was filled. \n address senderAddress, // Address that called the Exchange contract (msg.sender).\n bytes32 indexed orderHash, // EIP712 hash of order (see LibOrder.getOrderHash).\n bytes makerAssetData, // Encoded data specific to makerAsset. \n bytes takerAssetData // Encoded data specific to takerAsset.\n );\n\n // CancelUpTo event is emitted whenever `cancelOrdersUpTo` is executed succesfully.\n event CancelUpTo(\n address indexed makerAddress, // Orders cancelled must have been created by this address.\n address indexed senderAddress, // Orders cancelled must have a `senderAddress` equal to this address.\n uint256 orderEpoch // Orders with specified makerAddress and senderAddress with a salt less than this value are considered cancelled.\n );\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev After calling, the order can not be filled anymore.\n /// @param order Order struct containing order specifications.\n function cancelOrderInternal(LibOrder.Order memory order)\n internal;\n\n /// @dev Updates state with results of a fill order.\n /// @param order that was filled.\n /// @param takerAddress Address of taker who filled the order.\n /// @param orderTakerAssetFilledAmount Amount of order already filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function updateFilledState(\n LibOrder.Order memory order,\n address takerAddress,\n bytes32 orderHash,\n uint256 orderTakerAssetFilledAmount,\n LibFillResults.FillResults memory fillResults\n )\n internal;\n\n /// @dev Updates state with results of cancelling an order.\n /// State is only updated if the order is currently fillable.\n /// Otherwise, updating state would have no effect.\n /// @param order that was cancelled.\n /// @param orderHash Hash of order that was cancelled.\n function updateCancelledState(\n LibOrder.Order memory order,\n bytes32 orderHash\n )\n internal;\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAddress Address of order taker.\n /// @param signature Proof that the orders was created by its maker.\n function assertFillableOrder(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo,\n address takerAddress,\n bytes memory signature\n )\n internal\n view;\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo Status, orderHash, and amount already filled of order.\n /// @param takerAssetFillAmount Desired amount of order to fill by taker.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @param makerAssetFilledAmount Amount of makerAsset that will be transfered.\n function assertValidFill(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo,\n uint256 takerAssetFillAmount,\n uint256 takerAssetFilledAmount,\n uint256 makerAssetFilledAmount\n )\n internal\n view;\n\n /// @dev Validates context for cancelOrder. Succeeds or throws.\n /// @param order to be cancelled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n function assertValidCancel(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo\n )\n internal\n view;\n\n /// @dev Calculates amounts filled and fees paid by maker and taker.\n /// @param order to be filled.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function calculateFillResults(\n LibOrder.Order memory order,\n uint256 takerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.FillResults memory fillResults);\n\n}\n",
- "2.0.0/protocol/Exchange/mixins/MMatchOrders.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IMatchOrders.sol\";\n\n\ncontract MMatchOrders is\n IMatchOrders\n{\n /// @dev Validates context for matchOrders. Succeeds or throws.\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n function assertValidMatch(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder\n )\n internal\n pure;\n\n /// @dev Calculates fill amounts for the matched orders.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the leftOrder order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftOrderTakerAssetFilledAmount Amount of left order already filled.\n /// @param rightOrderTakerAssetFilledAmount Amount of right order already filled.\n /// @param matchedFillResults Amounts to fill and fees to pay by maker and taker of matched orders.\n function calculateMatchedFillResults(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n uint256 leftOrderTakerAssetFilledAmount,\n uint256 rightOrderTakerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.MatchedFillResults memory matchedFillResults);\n\n}\n",
- "2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/ISignatureValidator.sol\";\n\n\ncontract MSignatureValidator is\n ISignatureValidator\n{\n event SignatureValidatorApproval(\n address indexed signerAddress, // Address that approves or disapproves a contract to verify signatures.\n address indexed validatorAddress, // Address of signature validator contract.\n bool approved // Approval or disapproval of validator contract.\n );\n\n // Allowed signature types.\n enum SignatureType {\n Illegal, // 0x00, default value\n Invalid, // 0x01\n EIP712, // 0x02\n EthSign, // 0x03\n Wallet, // 0x04\n Validator, // 0x05\n PreSigned, // 0x06\n NSignatureTypes // 0x07, number of signature types. Always leave at end.\n }\n\n /// @dev Verifies signature using logic defined by Wallet contract.\n /// @param hash Any 32 byte hash.\n /// @param walletAddress Address that should have signed the given hash\n /// and defines its own signature verification method.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidWalletSignature(\n bytes32 hash,\n address walletAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid);\n\n /// @dev Verifies signature using logic defined by Validator contract.\n /// @param validatorAddress Address of validator contract.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidValidatorSignature(\n address validatorAddress,\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/mixins/MTransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\nimport \"../interfaces/ITransactions.sol\";\n\n\ncontract MTransactions is\n ITransactions\n{\n // Hash for the EIP712 ZeroEx Transaction Schema\n bytes32 constant internal EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"ZeroExTransaction(\",\n \"uint256 salt,\",\n \"address signerAddress,\",\n \"bytes data\",\n \")\"\n ));\n\n /// @dev Calculates EIP712 hash of the Transaction.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @return EIP712 hash of the Transaction.\n function hashZeroExTransaction(\n uint256 salt,\n address signerAddress,\n bytes memory data\n )\n internal\n pure\n returns (bytes32 result);\n\n /// @dev The current function will be called in the context of this address (either 0x transaction signer or `msg.sender`).\n /// If calling a fill function, this address will represent the taker.\n /// If calling a cancel function, this address will represent the maker.\n /// @return Signer of 0x transaction if entry point is `executeTransaction`.\n /// `msg.sender` if entry point is any other function.\n function getCurrentContextAddress()\n internal\n view\n returns (address);\n}\n",
- "2.0.0/protocol/Exchange/mixins/MWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IWrapperFunctions.sol\";\n\n\ncontract MWrapperFunctions is \n IWrapperFunctions\n{\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n}\n",
- "2.0.0/test/DummyERC20Token/DummyERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"../../tokens/ERC20Token/MintableERC20Token.sol\";\n\n\ncontract DummyERC20Token is \n Ownable,\n MintableERC20Token\n{\n string public name;\n string public symbol;\n uint256 public decimals;\n uint256 public constant MAX_MINT_AMOUNT = 10000000000000000000000;\n\n constructor (\n string _name,\n string _symbol,\n uint256 _decimals,\n uint256 _totalSupply\n )\n public\n {\n name = _name;\n symbol = _symbol;\n decimals = _decimals;\n _totalSupply = _totalSupply;\n balances[msg.sender] = _totalSupply;\n }\n\n /// @dev Sets the balance of target address\n /// @param _target Address or which balance will be updated\n /// @param _value New balance of target address\n function setBalance(address _target, uint256 _value)\n external\n onlyOwner\n {\n uint256 currBalance = balances[_target];\n if (_value < currBalance) {\n _totalSupply = safeSub(_totalSupply, safeSub(currBalance, _value));\n } else {\n _totalSupply = safeAdd(_totalSupply, safeSub(_value, currBalance));\n }\n balances[_target] = _value;\n }\n\n /// @dev Mints new tokens for sender\n /// @param _value Amount of tokens to mint\n function mint(uint256 _value)\n external\n {\n require(\n _value <= MAX_MINT_AMOUNT,\n \"VALUE_TOO_LARGE\"\n );\n\n _mint(msg.sender, _value);\n }\n}\n",
- "2.0.0/test/DummyERC721Token/DummyERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../tokens/ERC721Token/MintableERC721Token.sol\";\nimport \"../../utils/Ownable/Ownable.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract DummyERC721Token is\n Ownable,\n MintableERC721Token\n{\n string public name;\n string public symbol;\n\n constructor (\n string _name,\n string _symbol\n )\n public\n {\n name = _name;\n symbol = _symbol;\n }\n\n /// @dev Function to mint a new token\n /// Reverts if the given token ID already exists\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _tokenId ID of the token to be minted by the msg.sender \n function mint(address _to, uint256 _tokenId)\n external\n {\n _mint(_to, _tokenId);\n }\n\n /// @dev Function to burn a token\n /// Reverts if the given token ID doesn't exist or not called by contract owner\n /// @param _owner Owner of token with given token ID\n /// @param _tokenId ID of the token to be burned by the msg.sender\n function burn(address _owner, uint256 _tokenId)\n external\n onlyOwner\n {\n _burn(_owner, _tokenId);\n }\n}\n",
- "2.0.0/tokens/ERC20Token/ERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IERC20Token.sol\";\n\n\ncontract ERC20Token is\n IERC20Token\n{\n mapping (address => uint256) internal balances;\n mapping (address => mapping (address => uint256)) internal allowed;\n\n uint256 internal _totalSupply;\n\n /// @dev send `value` token to `to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transfer(address _to, uint256 _value)\n external\n returns (bool)\n {\n require(\n balances[msg.sender] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[msg.sender] -= _value;\n balances[_to] += _value;\n\n emit Transfer(\n msg.sender,\n _to,\n _value\n );\n\n return true;\n }\n\n /// @dev send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool)\n {\n require(\n balances[_from] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n allowed[_from][msg.sender] >= _value,\n \"ERC20_INSUFFICIENT_ALLOWANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[_to] += _value;\n balances[_from] -= _value;\n allowed[_from][msg.sender] -= _value;\n \n emit Transfer(\n _from,\n _to,\n _value\n );\n \n return true;\n }\n\n /// @dev `msg.sender` approves `_spender` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Always true if the call has enough gas to complete execution\n function approve(address _spender, uint256 _value)\n external\n returns (bool)\n {\n allowed[msg.sender][_spender] = _value;\n emit Approval(\n msg.sender,\n _spender,\n _value\n );\n return true;\n }\n\n /// @dev Query total supply of token\n /// @return Total supply of token\n function totalSupply()\n external\n view\n returns (uint256)\n {\n return _totalSupply;\n }\n\n /// @dev Query the balance of owner\n /// @param _owner The address from which the balance will be retrieved\n /// @return Balance of owner\n function balanceOf(address _owner)\n external\n view\n returns (uint256)\n {\n return balances[_owner];\n }\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender)\n external\n view\n returns (uint256)\n {\n return allowed[_owner][_spender];\n }\n}\n",
- "2.0.0/tokens/ERC20Token/IERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC20Token {\n\n // solhint-disable no-simple-event-func-name\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 _value\n );\n\n event Approval(\n address indexed _owner,\n address indexed _spender,\n uint256 _value\n );\n\n /// @dev send `value` token to `to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transfer(address _to, uint256 _value)\n external\n returns (bool);\n\n /// @dev send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool);\n \n /// @dev `msg.sender` approves `_spender` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Always true if the call has enough gas to complete execution\n function approve(address _spender, uint256 _value)\n external\n returns (bool);\n\n /// @dev Query total supply of token\n /// @return Total supply of token\n function totalSupply()\n external\n view\n returns (uint256);\n \n /// @param _owner The address from which the balance will be retrieved\n /// @return Balance of owner\n function balanceOf(address _owner)\n external\n view\n returns (uint256);\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender)\n external\n view\n returns (uint256);\n}\n",
- "2.0.0/tokens/ERC20Token/MintableERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/SafeMath/SafeMath.sol\";\nimport \"./UnlimitedAllowanceERC20Token.sol\";\n\n\ncontract MintableERC20Token is \n SafeMath,\n UnlimitedAllowanceERC20Token\n{\n /// @dev Mints new tokens\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _value Amount of tokens to mint\n function _mint(address _to, uint256 _value)\n internal\n {\n balances[_to] = safeAdd(_value, balances[_to]);\n _totalSupply = safeAdd(_totalSupply, _value);\n\n emit Transfer(\n address(0),\n _to,\n _value\n );\n }\n\n /// @dev Mints new tokens\n /// @param _owner Owner of tokens that will be burned\n /// @param _value Amount of tokens to burn\n function _burn(address _owner, uint256 _value)\n internal\n {\n balances[_owner] = safeSub(balances[_owner], _value);\n _totalSupply = safeSub(_totalSupply, _value);\n\n emit Transfer(\n _owner,\n address(0),\n _value\n );\n }\n}\n",
- "2.0.0/tokens/ERC20Token/UnlimitedAllowanceERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../ERC20Token/ERC20Token.sol\";\n\n\ncontract UnlimitedAllowanceERC20Token is\n ERC20Token\n{\n uint256 constant internal MAX_UINT = 2**256 - 1;\n\n /// @dev ERC20 transferFrom, modified such that an allowance of MAX_UINT represents an unlimited allowance. See https://github.com/ethereum/EIPs/issues/717\n /// @param _from Address to transfer from.\n /// @param _to Address to transfer to.\n /// @param _value Amount to transfer.\n /// @return Success of transfer.\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool)\n {\n uint256 allowance = allowed[_from][msg.sender];\n require(\n balances[_from] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n allowance >= _value,\n \"ERC20_INSUFFICIENT_ALLOWANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[_to] += _value;\n balances[_from] -= _value;\n if (allowance < MAX_UINT) {\n allowed[_from][msg.sender] -= _value;\n }\n\n emit Transfer(\n _from,\n _to,\n _value\n );\n\n return true;\n }\n}\n",
- "2.0.0/tokens/ERC721Token/ERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IERC721Token.sol\";\nimport \"./IERC721Receiver.sol\";\nimport \"../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract ERC721Token is\n IERC721Token,\n SafeMath\n{\n // Function selector for ERC721Receiver.onERC721Received\n // 0x150b7a02\n bytes4 constant internal ERC721_RECEIVED = bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"));\n\n // Mapping of tokenId => owner\n mapping (uint256 => address) internal owners;\n\n // Mapping of tokenId => approved address\n mapping (uint256 => address) internal approvals;\n\n // Mapping of owner => number of tokens owned\n mapping (address => uint256) internal balances;\n\n // Mapping of owner => operator => approved\n mapping (address => mapping (address => bool)) internal operatorApprovals;\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT. When transfer is complete, this function\n /// checks if `_to` is a smart contract (code size > 0). If so, it calls\n /// `onERC721Received` on `_to` and throws if the return value is not\n /// `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n /// @param _data Additional data with no specified format, sent in call to `_to`\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId,\n bytes _data\n )\n external\n {\n transferFrom(\n _from,\n _to,\n _tokenId\n );\n\n uint256 receiverCodeSize;\n assembly {\n receiverCodeSize := extcodesize(_to)\n }\n if (receiverCodeSize > 0) {\n bytes4 selector = IERC721Receiver(_to).onERC721Received(\n msg.sender,\n _from,\n _tokenId,\n _data\n );\n require(\n selector == ERC721_RECEIVED,\n \"ERC721_INVALID_SELECTOR\"\n );\n }\n }\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev This works identically to the other function with an extra data parameter,\n /// except this function just sets data to \"\".\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n external\n {\n transferFrom(\n _from,\n _to,\n _tokenId\n );\n\n uint256 receiverCodeSize;\n assembly {\n receiverCodeSize := extcodesize(_to)\n }\n if (receiverCodeSize > 0) {\n bytes4 selector = IERC721Receiver(_to).onERC721Received(\n msg.sender,\n _from,\n _tokenId,\n \"\"\n );\n require(\n selector == ERC721_RECEIVED,\n \"ERC721_INVALID_SELECTOR\"\n );\n }\n }\n\n /// @notice Change or reaffirm the approved address for an NFT\n /// @dev The zero address indicates there is no approved address.\n /// Throws unless `msg.sender` is the current NFT owner, or an authorized\n /// operator of the current owner.\n /// @param _approved The new approved NFT controller\n /// @param _tokenId The NFT to approve\n function approve(address _approved, uint256 _tokenId)\n external\n {\n address owner = ownerOf(_tokenId);\n require(\n msg.sender == owner || isApprovedForAll(owner, msg.sender),\n \"ERC721_INVALID_SENDER\"\n );\n\n approvals[_tokenId] = _approved;\n emit Approval(\n owner,\n _approved,\n _tokenId\n );\n }\n\n /// @notice Enable or disable approval for a third party (\"operator\") to manage\n /// all of `msg.sender`'s assets\n /// @dev Emits the ApprovalForAll event. The contract MUST allow\n /// multiple operators per owner.\n /// @param _operator Address to add to the set of authorized operators\n /// @param _approved True if the operator is approved, false to revoke approval\n function setApprovalForAll(address _operator, bool _approved)\n external\n {\n operatorApprovals[msg.sender][_operator] = _approved;\n emit ApprovalForAll(\n msg.sender,\n _operator,\n _approved\n );\n }\n \n /// @notice Count all NFTs assigned to an owner\n /// @dev NFTs assigned to the zero address are considered invalid, and this\n /// function throws for queries about the zero address.\n /// @param _owner An address for whom to query the balance\n /// @return The number of NFTs owned by `_owner`, possibly zero\n function balanceOf(address _owner)\n external\n view\n returns (uint256)\n {\n require(\n _owner != address(0),\n \"ERC721_ZERO_OWNER\"\n );\n return balances[_owner];\n }\n\n /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE\n /// TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE\n /// THEY MAY BE PERMANENTLY LOST\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function transferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n public\n {\n require(\n _to != address(0),\n \"ERC721_ZERO_TO_ADDRESS\"\n );\n\n address owner = ownerOf(_tokenId);\n require(\n _from == owner,\n \"ERC721_OWNER_MISMATCH\"\n );\n\n address spender = msg.sender;\n address approvedAddress = getApproved(_tokenId);\n require(\n spender == owner ||\n isApprovedForAll(owner, spender) ||\n approvedAddress == spender,\n \"ERC721_INVALID_SPENDER\"\n );\n\n if (approvedAddress != address(0)) {\n approvals[_tokenId] = address(0);\n }\n\n owners[_tokenId] = _to;\n balances[_from] = safeSub(balances[_from], 1);\n balances[_to] = safeAdd(balances[_to], 1);\n \n emit Transfer(\n _from,\n _to,\n _tokenId\n );\n }\n\n /// @notice Find the owner of an NFT\n /// @dev NFTs assigned to zero address are considered invalid, and queries\n /// about them do throw.\n /// @param _tokenId The identifier for an NFT\n /// @return The address of the owner of the NFT\n function ownerOf(uint256 _tokenId)\n public\n view\n returns (address)\n {\n address owner = owners[_tokenId];\n require(\n owner != address(0),\n \"ERC721_ZERO_OWNER\"\n );\n return owner;\n }\n\n /// @notice Get the approved address for a single NFT\n /// @dev Throws if `_tokenId` is not a valid NFT.\n /// @param _tokenId The NFT to find the approved address for\n /// @return The approved address for this NFT, or the zero address if there is none\n function getApproved(uint256 _tokenId)\n public\n view\n returns (address)\n {\n return approvals[_tokenId];\n }\n\n /// @notice Query if an address is an authorized operator for another address\n /// @param _owner The address that owns the NFTs\n /// @param _operator The address that acts on behalf of the owner\n /// @return True if `_operator` is an approved operator for `_owner`, false otherwise\n function isApprovedForAll(address _owner, address _operator)\n public\n view\n returns (bool)\n {\n return operatorApprovals[_owner][_operator];\n }\n}\n",
- "2.0.0/tokens/ERC721Token/IERC721Receiver.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC721Receiver {\n\n /// @notice Handle the receipt of an NFT\n /// @dev The ERC721 smart contract calls this function on the recipient\n /// after a `transfer`. This function MAY throw to revert and reject the\n /// transfer. Return of other than the magic value MUST result in the\n /// transaction being reverted.\n /// Note: the contract address is always the message sender.\n /// @param _operator The address which called `safeTransferFrom` function\n /// @param _from The address which previously owned the token\n /// @param _tokenId The NFT identifier which is being transferred\n /// @param _data Additional data with no specified format\n /// @return `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`\n /// unless throwing\n function onERC721Received(\n address _operator,\n address _from,\n uint256 _tokenId,\n bytes _data\n )\n external\n returns (bytes4);\n}\n",
- "2.0.0/tokens/ERC721Token/IERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC721Token {\n\n /// @dev This emits when ownership of any NFT changes by any mechanism.\n /// This event emits when NFTs are created (`from` == 0) and destroyed\n /// (`to` == 0). Exception: during contract creation, any number of NFTs\n /// may be created and assigned without emitting Transfer. At the time of\n /// any transfer, the approved address for that NFT (if any) is reset to none.\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 indexed _tokenId\n );\n\n /// @dev This emits when the approved address for an NFT is changed or\n /// reaffirmed. The zero address indicates there is no approved address.\n /// When a Transfer event emits, this also indicates that the approved\n /// address for that NFT (if any) is reset to none.\n event Approval(\n address indexed _owner,\n address indexed _approved,\n uint256 indexed _tokenId\n );\n\n /// @dev This emits when an operator is enabled or disabled for an owner.\n /// The operator can manage all NFTs of the owner.\n event ApprovalForAll(\n address indexed _owner,\n address indexed _operator,\n bool _approved\n );\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// perator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT. When transfer is complete, this function\n /// checks if `_to` is a smart contract (code size > 0). If so, it calls\n /// `onERC721Received` on `_to` and throws if the return value is not\n /// `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n /// @param _data Additional data with no specified format, sent in call to `_to`\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId,\n bytes _data\n )\n external;\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev This works identically to the other function with an extra data parameter,\n /// except this function just sets data to \"\".\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n external;\n\n /// @notice Change or reaffirm the approved address for an NFT\n /// @dev The zero address indicates there is no approved address.\n /// Throws unless `msg.sender` is the current NFT owner, or an authorized\n /// operator of the current owner.\n /// @param _approved The new approved NFT controller\n /// @param _tokenId The NFT to approve\n function approve(address _approved, uint256 _tokenId)\n external;\n\n /// @notice Enable or disable approval for a third party (\"operator\") to manage\n /// all of `msg.sender`'s assets\n /// @dev Emits the ApprovalForAll event. The contract MUST allow\n /// multiple operators per owner.\n /// @param _operator Address to add to the set of authorized operators\n /// @param _approved True if the operator is approved, false to revoke approval\n function setApprovalForAll(address _operator, bool _approved)\n external;\n\n /// @notice Count all NFTs assigned to an owner\n /// @dev NFTs assigned to the zero address are considered invalid, and this\n /// function throws for queries about the zero address.\n /// @param _owner An address for whom to query the balance\n /// @return The number of NFTs owned by `_owner`, possibly zero\n function balanceOf(address _owner)\n external\n view\n returns (uint256);\n\n /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE\n /// TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE\n /// THEY MAY BE PERMANENTLY LOST\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function transferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n public;\n\n /// @notice Find the owner of an NFT\n /// @dev NFTs assigned to zero address are considered invalid, and queries\n /// about them do throw.\n /// @param _tokenId The identifier for an NFT\n /// @return The address of the owner of the NFT\n function ownerOf(uint256 _tokenId)\n public\n view\n returns (address);\n\n /// @notice Get the approved address for a single NFT\n /// @dev Throws if `_tokenId` is not a valid NFT.\n /// @param _tokenId The NFT to find the approved address for\n /// @return The approved address for this NFT, or the zero address if there is none\n function getApproved(uint256 _tokenId) \n public\n view\n returns (address);\n \n /// @notice Query if an address is an authorized operator for another address\n /// @param _owner The address that owns the NFTs\n /// @param _operator The address that acts on behalf of the owner\n /// @return True if `_operator` is an approved operator for `_owner`, false otherwise\n function isApprovedForAll(address _owner, address _operator)\n public\n view\n returns (bool);\n}\n",
- "2.0.0/tokens/ERC721Token/MintableERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./ERC721Token.sol\";\n\n\ncontract MintableERC721Token is\n ERC721Token\n{\n /// @dev Function to mint a new token\n /// Reverts if the given token ID already exists\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _tokenId ID of the token to be minted by the msg.sender \n function _mint(address _to, uint256 _tokenId)\n internal\n {\n require(\n _to != address(0),\n \"ERC721_ZERO_TO_ADDRESS\"\n );\n\n address owner = owners[_tokenId];\n require(\n owner == address(0),\n \"ERC721_OWNER_ALREADY_EXISTS\"\n );\n\n owners[_tokenId] = _to;\n balances[_to] = safeAdd(balances[_to], 1);\n\n emit Transfer(\n address(0),\n _to,\n _tokenId\n );\n }\n\n /// @dev Function to burn a token\n /// Reverts if the given token ID doesn't exist\n /// @param _owner Owner of token with given token ID\n /// @param _tokenId ID of the token to be burned by the msg.sender\n function _burn(address _owner, uint256 _tokenId)\n internal\n {\n require(\n _owner != address(0),\n \"ERC721_ZERO_OWNER_ADDRESS\"\n );\n\n address owner = owners[_tokenId];\n require(\n owner == _owner,\n \"ERC721_OWNER_MISMATCH\"\n );\n\n owners[_tokenId] = address(0);\n balances[_owner] = safeSub(balances[_owner], 1);\n\n emit Transfer(\n _owner,\n address(0),\n _tokenId\n );\n }\n}\n",
- "2.0.0/tokens/EtherToken/IEtherToken.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../ERC20Token/IERC20Token.sol\";\n\n\ncontract IEtherToken is\n IERC20Token\n{\n function deposit()\n public\n payable;\n \n function withdraw(uint256 amount)\n public;\n}\n",
- "2.0.0/utils/LibBytes/LibBytes.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\nlibrary LibBytes {\n\n using LibBytes for bytes;\n\n /// @dev Gets the memory address for a byte array.\n /// @param input Byte array to lookup.\n /// @return memoryAddress Memory address of byte array. This\n /// points to the header of the byte array which contains\n /// the length.\n function rawAddress(bytes memory input)\n internal\n pure\n returns (uint256 memoryAddress)\n {\n assembly {\n memoryAddress := input\n }\n return memoryAddress;\n }\n \n /// @dev Gets the memory address for the contents of a byte array.\n /// @param input Byte array to lookup.\n /// @return memoryAddress Memory address of the contents of the byte array.\n function contentAddress(bytes memory input)\n internal\n pure\n returns (uint256 memoryAddress)\n {\n assembly {\n memoryAddress := add(input, 32)\n }\n return memoryAddress;\n }\n\n /// @dev Copies `length` bytes from memory location `source` to `dest`.\n /// @param dest memory address to copy bytes to.\n /// @param source memory address to copy bytes from.\n /// @param length number of bytes to copy.\n function memCopy(\n uint256 dest,\n uint256 source,\n uint256 length\n )\n internal\n pure\n {\n if (length < 32) {\n // Handle a partial word by reading destination and masking\n // off the bits we are interested in.\n // This correctly handles overlap, zero lengths and source == dest\n assembly {\n let mask := sub(exp(256, sub(32, length)), 1)\n let s := and(mload(source), not(mask))\n let d := and(mload(dest), mask)\n mstore(dest, or(s, d))\n }\n } else {\n // Skip the O(length) loop when source == dest.\n if (source == dest) {\n return;\n }\n\n // For large copies we copy whole words at a time. The final\n // word is aligned to the end of the range (instead of after the\n // previous) to handle partial words. So a copy will look like this:\n //\n // ####\n // ####\n // ####\n // ####\n //\n // We handle overlap in the source and destination range by\n // changing the copying direction. This prevents us from\n // overwriting parts of source that we still need to copy.\n //\n // This correctly handles source == dest\n //\n if (source > dest) {\n assembly {\n // We subtract 32 from `sEnd` and `dEnd` because it\n // is easier to compare with in the loop, and these\n // are also the addresses we need for copying the\n // last bytes.\n length := sub(length, 32)\n let sEnd := add(source, length)\n let dEnd := add(dest, length)\n\n // Remember the last 32 bytes of source\n // This needs to be done here and not after the loop\n // because we may have overwritten the last bytes in\n // source already due to overlap.\n let last := mload(sEnd)\n\n // Copy whole words front to back\n // Note: the first check is always true,\n // this could have been a do-while loop.\n // solhint-disable-next-line no-empty-blocks\n for {} lt(source, sEnd) {} {\n mstore(dest, mload(source))\n source := add(source, 32)\n dest := add(dest, 32)\n }\n \n // Write the last 32 bytes\n mstore(dEnd, last)\n }\n } else {\n assembly {\n // We subtract 32 from `sEnd` and `dEnd` because those\n // are the starting points when copying a word at the end.\n length := sub(length, 32)\n let sEnd := add(source, length)\n let dEnd := add(dest, length)\n\n // Remember the first 32 bytes of source\n // This needs to be done here and not after the loop\n // because we may have overwritten the first bytes in\n // source already due to overlap.\n let first := mload(source)\n\n // Copy whole words back to front\n // We use a signed comparisson here to allow dEnd to become\n // negative (happens when source and dest < 32). Valid\n // addresses in local memory will never be larger than\n // 2**255, so they can be safely re-interpreted as signed.\n // Note: the first check is always true,\n // this could have been a do-while loop.\n // solhint-disable-next-line no-empty-blocks\n for {} slt(dest, dEnd) {} {\n mstore(dEnd, mload(sEnd))\n sEnd := sub(sEnd, 32)\n dEnd := sub(dEnd, 32)\n }\n \n // Write the first 32 bytes\n mstore(dest, first)\n }\n }\n }\n }\n\n /// @dev Returns a slices from a byte array.\n /// @param b The byte array to take a slice from.\n /// @param from The starting index for the slice (inclusive).\n /// @param to The final index for the slice (exclusive).\n /// @return result The slice containing bytes at indices [from, to)\n function slice(\n bytes memory b,\n uint256 from,\n uint256 to\n )\n internal\n pure\n returns (bytes memory result)\n {\n require(\n from <= to,\n \"FROM_LESS_THAN_TO_REQUIRED\"\n );\n require(\n to < b.length,\n \"TO_LESS_THAN_LENGTH_REQUIRED\"\n );\n \n // Create a new bytes structure and copy contents\n result = new bytes(to - from);\n memCopy(\n result.contentAddress(),\n b.contentAddress() + from,\n result.length\n );\n return result;\n }\n \n /// @dev Returns a slice from a byte array without preserving the input.\n /// @param b The byte array to take a slice from. Will be destroyed in the process.\n /// @param from The starting index for the slice (inclusive).\n /// @param to The final index for the slice (exclusive).\n /// @return result The slice containing bytes at indices [from, to)\n /// @dev When `from == 0`, the original array will match the slice. In other cases its state will be corrupted.\n function sliceDestructive(\n bytes memory b,\n uint256 from,\n uint256 to\n )\n internal\n pure\n returns (bytes memory result)\n {\n require(\n from <= to,\n \"FROM_LESS_THAN_TO_REQUIRED\"\n );\n require(\n to < b.length,\n \"TO_LESS_THAN_LENGTH_REQUIRED\"\n );\n \n // Create a new bytes structure around [from, to) in-place.\n assembly {\n result := add(b, from)\n mstore(result, sub(to, from))\n }\n return result;\n }\n\n /// @dev Pops the last byte off of a byte array by modifying its length.\n /// @param b Byte array that will be modified.\n /// @return The byte that was popped off.\n function popLastByte(bytes memory b)\n internal\n pure\n returns (bytes1 result)\n {\n require(\n b.length > 0,\n \"GREATER_THAN_ZERO_LENGTH_REQUIRED\"\n );\n\n // Store last byte.\n result = b[b.length - 1];\n\n assembly {\n // Decrement length of byte array.\n let newLen := sub(mload(b), 1)\n mstore(b, newLen)\n }\n return result;\n }\n\n /// @dev Pops the last 20 bytes off of a byte array by modifying its length.\n /// @param b Byte array that will be modified.\n /// @return The 20 byte address that was popped off.\n function popLast20Bytes(bytes memory b)\n internal\n pure\n returns (address result)\n {\n require(\n b.length >= 20,\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Store last 20 bytes.\n result = readAddress(b, b.length - 20);\n\n assembly {\n // Subtract 20 from byte array length.\n let newLen := sub(mload(b), 20)\n mstore(b, newLen)\n }\n return result;\n }\n\n /// @dev Tests equality of two byte arrays.\n /// @param lhs First byte array to compare.\n /// @param rhs Second byte array to compare.\n /// @return True if arrays are the same. False otherwise.\n function equals(\n bytes memory lhs,\n bytes memory rhs\n )\n internal\n pure\n returns (bool equal)\n {\n // Keccak gas cost is 30 + numWords * 6. This is a cheap way to compare.\n // We early exit on unequal lengths, but keccak would also correctly\n // handle this.\n return lhs.length == rhs.length && keccak256(lhs) == keccak256(rhs);\n }\n\n /// @dev Reads an address from a position in a byte array.\n /// @param b Byte array containing an address.\n /// @param index Index in byte array of address.\n /// @return address from byte array.\n function readAddress(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (address result)\n {\n require(\n b.length >= index + 20, // 20 is length of address\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Add offset to index:\n // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)\n // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)\n index += 20;\n\n // Read address from array memory\n assembly {\n // 1. Add index to address of bytes array\n // 2. Load 32-byte word from memory\n // 3. Apply 20-byte mask to obtain address\n result := and(mload(add(b, index)), 0xffffffffffffffffffffffffffffffffffffffff)\n }\n return result;\n }\n\n /// @dev Writes an address into a specific position in a byte array.\n /// @param b Byte array to insert address into.\n /// @param index Index in byte array of address.\n /// @param input Address to put into byte array.\n function writeAddress(\n bytes memory b,\n uint256 index,\n address input\n )\n internal\n pure\n {\n require(\n b.length >= index + 20, // 20 is length of address\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Add offset to index:\n // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)\n // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)\n index += 20;\n\n // Store address into array memory\n assembly {\n // The address occupies 20 bytes and mstore stores 32 bytes.\n // First fetch the 32-byte word where we'll be storing the address, then\n // apply a mask so we have only the bytes in the word that the address will not occupy.\n // Then combine these bytes with the address and store the 32 bytes back to memory with mstore.\n\n // 1. Add index to address of bytes array\n // 2. Load 32-byte word from memory\n // 3. Apply 12-byte mask to obtain extra bytes occupying word of memory where we'll store the address\n let neighbors := and(\n mload(add(b, index)),\n 0xffffffffffffffffffffffff0000000000000000000000000000000000000000\n )\n \n // Make sure input address is clean.\n // (Solidity does not guarantee this)\n input := and(input, 0xffffffffffffffffffffffffffffffffffffffff)\n\n // Store the neighbors and address into memory\n mstore(add(b, index), xor(input, neighbors))\n }\n }\n\n /// @dev Reads a bytes32 value from a position in a byte array.\n /// @param b Byte array containing a bytes32 value.\n /// @param index Index in byte array of bytes32 value.\n /// @return bytes32 value from byte array.\n function readBytes32(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes32 result)\n {\n require(\n b.length >= index + 32,\n \"GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 256 bit length parameter\n index += 32;\n\n // Read the bytes32 from array memory\n assembly {\n result := mload(add(b, index))\n }\n return result;\n }\n\n /// @dev Writes a bytes32 into a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input bytes32 to put into byte array.\n function writeBytes32(\n bytes memory b,\n uint256 index,\n bytes32 input\n )\n internal\n pure\n {\n require(\n b.length >= index + 32,\n \"GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 256 bit length parameter\n index += 32;\n\n // Read the bytes32 from array memory\n assembly {\n mstore(add(b, index), input)\n }\n }\n\n /// @dev Reads a uint256 value from a position in a byte array.\n /// @param b Byte array containing a uint256 value.\n /// @param index Index in byte array of uint256 value.\n /// @return uint256 value from byte array.\n function readUint256(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (uint256 result)\n {\n result = uint256(readBytes32(b, index));\n return result;\n }\n\n /// @dev Writes a uint256 into a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input uint256 to put into byte array.\n function writeUint256(\n bytes memory b,\n uint256 index,\n uint256 input\n )\n internal\n pure\n {\n writeBytes32(b, index, bytes32(input));\n }\n\n /// @dev Reads an unpadded bytes4 value from a position in a byte array.\n /// @param b Byte array containing a bytes4 value.\n /// @param index Index in byte array of bytes4 value.\n /// @return bytes4 value from byte array.\n function readBytes4(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes4 result)\n {\n require(\n b.length >= index + 4,\n \"GREATER_OR_EQUAL_TO_4_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 32 byte length field\n index += 32;\n\n // Read the bytes4 from array memory\n assembly {\n result := mload(add(b, index))\n // Solidity does not require us to clean the trailing bytes.\n // We do it anyway\n result := and(result, 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000)\n }\n return result;\n }\n\n /// @dev Reads nested bytes from a specific position.\n /// @dev NOTE: the returned value overlaps with the input value.\n /// Both should be treated as immutable.\n /// @param b Byte array containing nested bytes.\n /// @param index Index of nested bytes.\n /// @return result Nested bytes.\n function readBytesWithLength(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes memory result)\n {\n // Read length of nested bytes\n uint256 nestedBytesLength = readUint256(b, index);\n index += 32;\n\n // Assert length of <b> is valid, given\n // length of nested bytes\n require(\n b.length >= index + nestedBytesLength,\n \"GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED\"\n );\n \n // Return a pointer to the byte array as it exists inside `b`\n assembly {\n result := add(b, index)\n }\n return result;\n }\n\n /// @dev Inserts bytes at a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input bytes to insert.\n function writeBytesWithLength(\n bytes memory b,\n uint256 index,\n bytes memory input\n )\n internal\n pure\n {\n // Assert length of <b> is valid, given\n // length of input\n require(\n b.length >= index + 32 + input.length, // 32 bytes to store length\n \"GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED\"\n );\n\n // Copy <input> into <b>\n memCopy(\n b.contentAddress() + index,\n input.rawAddress(), // includes length of <input>\n input.length + 32 // +32 bytes to store <input> length\n );\n }\n\n /// @dev Performs a deep copy of a byte array onto another byte array of greater than or equal length.\n /// @param dest Byte array that will be overwritten with source bytes.\n /// @param source Byte array to copy onto dest bytes.\n function deepCopyBytes(\n bytes memory dest,\n bytes memory source\n )\n internal\n pure\n {\n uint256 sourceLen = source.length;\n // Dest length must be >= source length, or some bytes would not be copied.\n require(\n dest.length >= sourceLen,\n \"GREATER_OR_EQUAL_TO_SOURCE_BYTES_LENGTH_REQUIRED\"\n );\n memCopy(\n dest.contentAddress(),\n source.contentAddress(),\n sourceLen\n );\n }\n}\n",
- "2.0.0/utils/Ownable/IOwnable.sol": "pragma solidity 0.4.24;\n\n\ncontract IOwnable {\n\n function transferOwnership(address newOwner)\n public;\n}\n",
- "2.0.0/utils/Ownable/Ownable.sol": "pragma solidity 0.4.24;\n\nimport \"./IOwnable.sol\";\n\n\ncontract Ownable is\n IOwnable\n{\n address public owner;\n\n constructor ()\n public\n {\n owner = msg.sender;\n }\n\n modifier onlyOwner() {\n require(\n msg.sender == owner,\n \"ONLY_CONTRACT_OWNER\"\n );\n _;\n }\n\n function transferOwnership(address newOwner)\n public\n onlyOwner\n {\n if (newOwner != address(0)) {\n owner = newOwner;\n }\n }\n}\n",
- "2.0.0/utils/ReentrancyGuard/ReentrancyGuard.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract ReentrancyGuard {\n\n // Locked state of mutex\n bool private locked = false;\n\n /// @dev Functions with this modifer cannot be reentered. The mutex will be locked\n /// before function execution and unlocked after.\n modifier nonReentrant() {\n // Ensure mutex is unlocked\n require(\n !locked,\n \"REENTRANCY_ILLEGAL\"\n );\n\n // Lock mutex before function call\n locked = true;\n\n // Perform function call\n _;\n\n // Unlock mutex after function call\n locked = false;\n }\n}\n",
- "2.0.0/utils/SafeMath/SafeMath.sol": "pragma solidity 0.4.24;\n\n\ncontract SafeMath {\n\n function safeMul(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n if (a == 0) {\n return 0;\n }\n uint256 c = a * b;\n require(\n c / a == b,\n \"UINT256_OVERFLOW\"\n );\n return c;\n }\n\n function safeDiv(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n uint256 c = a / b;\n return c;\n }\n\n function safeSub(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n require(\n b <= a,\n \"UINT256_UNDERFLOW\"\n );\n return a - b;\n }\n\n function safeAdd(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n uint256 c = a + b;\n require(\n c >= a,\n \"UINT256_OVERFLOW\"\n );\n return c;\n }\n\n function max64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n\n function max256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n}\n"
- },
- "sourceTreeHashHex": "0xc1a03719bb35a579c3db5156280faf7fea3944100a90a5b2abe1840a4bcfea20",
- "compiler": {
- "name": "solc",
- "version": "soljson-v0.4.24+commit.e67f0147.js",
- "settings": {
- "optimizer": {
- "enabled": true,
- "runs": 1000000
- },
- "outputSelection": {
- "*": {
- "*": [
- "abi",
- "evm.bytecode.object",
- "evm.bytecode.sourceMap",
- "evm.deployedBytecode.object",
- "evm.deployedBytecode.sourceMap"
- ]
- }
- }
- }
- },
- "networks": {
- "3": {
- "address": "0xf5fa5b5fed2727a0e44ac67f6772e97977aa358b",
- "links": {},
- "constructorArgs": "[[\"0x9df8137872ac09a8fee71d0da5c7539923fb9bf0\",\"0xcf34d44db312d188789f43a63d11cf2bebb4da15\",\"0x73fd50f2a6beac9cdac9fe87ef68a18edc415831\"],[\"0xb1408f4c245a23c31b98d2c626777d4c0d766caa\",\"0xe654aac058bfbf9f83fcaee7793311dd82f6ddb4\"],\"1\",\"0\"]"
- },
- "42": {
- "address": "0x2c824d2882baa668e0d5202b1e7f2922278703f8",
- "links": {},
- "constructorArgs": "[[\"0x9df8137872ac09a8fee71d0da5c7539923fb9bf0\",\"0xcf34d44db312d188789f43a63d11cf2bebb4da15\",\"0x73fd50f2a6beac9cdac9fe87ef68a18edc415831\"],[\"0xf1ec01d6236d3cd881a0bf0130ea25fe4234003e\",\"0x2a9127c745688a165106c11cd4d647d2220af821\"],\"1\",\"0\"]"
- },
- "50": {
- "address": "0x34d402f14d58e001d8efbe6585051bf9706aa064",
- "links": {},
- "constructorArgs": "[[\"0x9df8137872ac09a8fee71d0da5c7539923fb9bf0\",\"0xcf34d44db312d188789f43a63d11cf2bebb4da15\",\"0x73fd50f2a6beac9cdac9fe87ef68a18edc415831\"],[\"0x1dc4c1cefef38a777b15aa20260a54e584b16c48\",\"0x1d7022f5b17d2f8b695918fb48fa1089c9f85401\"],\"1\",\"0\"]"
- }
- }
-}
diff --git a/packages/migrations/artifacts/2.0.0-testnet/DummyERC20Token.json b/packages/migrations/artifacts/2.0.0-testnet/DummyERC20Token.json
deleted file mode 100644
index e0c5eb5dd..000000000
--- a/packages/migrations/artifacts/2.0.0-testnet/DummyERC20Token.json
+++ /dev/null
@@ -1,641 +0,0 @@
-{
- "schemaVersion": "2.0.0",
- "contractName": "DummyERC20Token",
- "compilerOutput": {
- "abi": [
- {
- "constant": true,
- "inputs": [],
- "name": "name",
- "outputs": [
- {
- "name": "",
- "type": "string"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_spender",
- "type": "address"
- },
- {
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "approve",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "totalSupply",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_from",
- "type": "address"
- },
- {
- "name": "_to",
- "type": "address"
- },
- {
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "transferFrom",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "decimals",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "_owner",
- "type": "address"
- }
- ],
- "name": "balanceOf",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "owner",
- "outputs": [
- {
- "name": "",
- "type": "address"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "symbol",
- "outputs": [
- {
- "name": "",
- "type": "string"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "mint",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_to",
- "type": "address"
- },
- {
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "transfer",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "_owner",
- "type": "address"
- },
- {
- "name": "_spender",
- "type": "address"
- }
- ],
- "name": "allowance",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_target",
- "type": "address"
- },
- {
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "setBalance",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "newOwner",
- "type": "address"
- }
- ],
- "name": "transferOwnership",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "MAX_MINT_AMOUNT",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "inputs": [
- {
- "name": "_name",
- "type": "string"
- },
- {
- "name": "_symbol",
- "type": "string"
- },
- {
- "name": "_decimals",
- "type": "uint256"
- },
- {
- "name": "_totalSupply",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "constructor"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "_from",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "_to",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "Transfer",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "_owner",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "_spender",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "Approval",
- "type": "event"
- }
- ],
- "evm": {
- "bytecode": {
- "linkReferences": {},
- "object": "0x608060405234801561001057600080fd5b5060405162000fa438038062000fa4833981016040908152815160208084015192840151606085015160008054600160a060020a031916331790559285018051909594909401939092916100699160049187019061009c565b50825161007d90600590602086019061009c565b5060069190915533600090815260016020526040902055506101379050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106100dd57805160ff191683800117855561010a565b8280016001018555821561010a579182015b8281111561010a5782518255916020019190600101906100ef565b5061011692915061011a565b5090565b61013491905b808211156101165760008155600101610120565b90565b610e5d80620001476000396000f3006080604052600436106100cf5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100d4578063095ea7b31461015e57806318160ddd146101a357806323b872dd146101ca578063313ce5671461020157806370a08231146102165780638da5cb5b1461024457806395d89b4114610282578063a0712d6814610297578063a9059cbb146102b1578063dd62ed3e146102e2578063e30443bc14610316578063f2fde38b14610347578063fa9b701814610375575b600080fd5b3480156100e057600080fd5b506100e961038a565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561012357818101518382015260200161010b565b50505050905090810190601f1680156101505780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561016a57600080fd5b5061018f73ffffffffffffffffffffffffffffffffffffffff60043516602435610436565b604080519115158252519081900360200190f35b3480156101af57600080fd5b506101b86104a9565b60408051918252519081900360200190f35b3480156101d657600080fd5b5061018f73ffffffffffffffffffffffffffffffffffffffff600435811690602435166044356104af565b34801561020d57600080fd5b506101b861076b565b34801561022257600080fd5b506101b873ffffffffffffffffffffffffffffffffffffffff60043516610771565b34801561025057600080fd5b50610259610799565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b34801561028e57600080fd5b506100e96107b5565b3480156102a357600080fd5b506102af60043561082e565b005b3480156102bd57600080fd5b5061018f73ffffffffffffffffffffffffffffffffffffffff600435166024356108b4565b3480156102ee57600080fd5b506101b873ffffffffffffffffffffffffffffffffffffffff60043581169060243516610a43565b34801561032257600080fd5b506102af73ffffffffffffffffffffffffffffffffffffffff60043516602435610a7b565b34801561035357600080fd5b506102af73ffffffffffffffffffffffffffffffffffffffff60043516610b91565b34801561038157600080fd5b506101b8610c78565b6004805460408051602060026001851615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f8101849004840282018401909252818152929183018282801561042e5780601f106104035761010080835404028352916020019161042e565b820191906000526020600020905b81548152906001019060200180831161041157829003601f168201915b505050505081565b33600081815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60035490565b73ffffffffffffffffffffffffffffffffffffffff83166000818152600260209081526040808320338452825280832054938352600190915281205490919083111561055c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f45524332305f494e53554646494349454e545f42414c414e4345000000000000604482015290519081900360640190fd5b828110156105cb57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f45524332305f494e53554646494349454e545f414c4c4f57414e434500000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8416600090815260016020526040902054838101101561066157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f55494e543235365f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff808516600090815260016020526040808220805487019055918716815220805484900390557fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8110156106fb5773ffffffffffffffffffffffffffffffffffffffff851660009081526002602090815260408083203384529091529020805484900390555b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3506001949350505050565b60065481565b73ffffffffffffffffffffffffffffffffffffffff1660009081526001602052604090205490565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b6005805460408051602060026001851615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f8101849004840282018401909252818152929183018282801561042e5780601f106104035761010080835404028352916020019161042e565b69021e19e0c9bab24000008111156108a757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f56414c55455f544f4f5f4c415247450000000000000000000000000000000000604482015290519081900360640190fd5b6108b13382610c86565b50565b3360009081526001602052604081205482111561093257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f45524332305f494e53554646494349454e545f42414c414e4345000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff831660009081526001602052604090205482810110156109c857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f55494e543235365f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b3360008181526001602090815260408083208054879003905573ffffffffffffffffffffffffffffffffffffffff871680845292819020805487019055805186815290519293927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a350600192915050565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260026020908152604080832093909416825291909152205490565b6000805473ffffffffffffffffffffffffffffffffffffffff163314610b0257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b5073ffffffffffffffffffffffffffffffffffffffff821660009081526001602052604090205480821015610b4e57610b46600354610b418385610d3f565b610d3f565b600355610b67565b610b63600354610b5e8484610d3f565b610db6565b6003555b5073ffffffffffffffffffffffffffffffffffffffff909116600090815260016020526040902055565b60005473ffffffffffffffffffffffffffffffffffffffff163314610c1757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8116156108b1576000805473ffffffffffffffffffffffffffffffffffffffff83167fffffffffffffffffffffffff000000000000000000000000000000000000000090911617905550565b69021e19e0c9bab240000081565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260016020526040902054610cb7908290610db6565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260016020526040902055600354610cea9082610db6565b60035560408051828152905173ffffffffffffffffffffffffffffffffffffffff8416916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b600082821115610db057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f55494e543235365f554e444552464c4f57000000000000000000000000000000604482015290519081900360640190fd5b50900390565b600082820183811015610e2a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f55494e543235365f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b93925050505600a165627a7a72305820bf15f8b157047a3248e2c7bf50ad7dd5d360d0bb36a780e3bad9229fc4bad5d20029",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x40 MLOAD PUSH3 0xFA4 CODESIZE SUB DUP1 PUSH3 0xFA4 DUP4 CODECOPY DUP2 ADD PUSH1 0x40 SWAP1 DUP2 MSTORE DUP2 MLOAD PUSH1 0x20 DUP1 DUP5 ADD MLOAD SWAP3 DUP5 ADD MLOAD PUSH1 0x60 DUP6 ADD MLOAD PUSH1 0x0 DUP1 SLOAD PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB NOT AND CALLER OR SWAP1 SSTORE SWAP3 DUP6 ADD DUP1 MLOAD SWAP1 SWAP6 SWAP5 SWAP1 SWAP5 ADD SWAP4 SWAP1 SWAP3 SWAP2 PUSH2 0x69 SWAP2 PUSH1 0x4 SWAP2 DUP8 ADD SWAP1 PUSH2 0x9C JUMP JUMPDEST POP DUP3 MLOAD PUSH2 0x7D SWAP1 PUSH1 0x5 SWAP1 PUSH1 0x20 DUP7 ADD SWAP1 PUSH2 0x9C JUMP JUMPDEST POP PUSH1 0x6 SWAP2 SWAP1 SWAP2 SSTORE CALLER PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SSTORE POP PUSH2 0x137 SWAP1 POP JUMP JUMPDEST DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 PUSH1 0x1F ADD PUSH1 0x20 SWAP1 DIV DUP2 ADD SWAP3 DUP3 PUSH1 0x1F LT PUSH2 0xDD JUMPI DUP1 MLOAD PUSH1 0xFF NOT AND DUP4 DUP1 ADD OR DUP6 SSTORE PUSH2 0x10A JUMP JUMPDEST DUP3 DUP1 ADD PUSH1 0x1 ADD DUP6 SSTORE DUP3 ISZERO PUSH2 0x10A JUMPI SWAP2 DUP3 ADD JUMPDEST DUP3 DUP2 GT ISZERO PUSH2 0x10A JUMPI DUP3 MLOAD DUP3 SSTORE SWAP2 PUSH1 0x20 ADD SWAP2 SWAP1 PUSH1 0x1 ADD SWAP1 PUSH2 0xEF JUMP JUMPDEST POP PUSH2 0x116 SWAP3 SWAP2 POP PUSH2 0x11A JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST PUSH2 0x134 SWAP2 SWAP1 JUMPDEST DUP1 DUP3 GT ISZERO PUSH2 0x116 JUMPI PUSH1 0x0 DUP2 SSTORE PUSH1 0x1 ADD PUSH2 0x120 JUMP JUMPDEST SWAP1 JUMP JUMPDEST PUSH2 0xE5D DUP1 PUSH3 0x147 PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN STOP PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0xCF JUMPI PUSH4 0xFFFFFFFF PUSH29 0x100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD DIV AND PUSH4 0x6FDDE03 DUP2 EQ PUSH2 0xD4 JUMPI DUP1 PUSH4 0x95EA7B3 EQ PUSH2 0x15E JUMPI DUP1 PUSH4 0x18160DDD EQ PUSH2 0x1A3 JUMPI DUP1 PUSH4 0x23B872DD EQ PUSH2 0x1CA JUMPI DUP1 PUSH4 0x313CE567 EQ PUSH2 0x201 JUMPI DUP1 PUSH4 0x70A08231 EQ PUSH2 0x216 JUMPI DUP1 PUSH4 0x8DA5CB5B EQ PUSH2 0x244 JUMPI DUP1 PUSH4 0x95D89B41 EQ PUSH2 0x282 JUMPI DUP1 PUSH4 0xA0712D68 EQ PUSH2 0x297 JUMPI DUP1 PUSH4 0xA9059CBB EQ PUSH2 0x2B1 JUMPI DUP1 PUSH4 0xDD62ED3E EQ PUSH2 0x2E2 JUMPI DUP1 PUSH4 0xE30443BC EQ PUSH2 0x316 JUMPI DUP1 PUSH4 0xF2FDE38B EQ PUSH2 0x347 JUMPI DUP1 PUSH4 0xFA9B7018 EQ PUSH2 0x375 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xE0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xE9 PUSH2 0x38A JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 DUP1 DUP3 MSTORE DUP4 MLOAD DUP2 DUP4 ADD MSTORE DUP4 MLOAD SWAP2 SWAP3 DUP4 SWAP3 SWAP1 DUP4 ADD SWAP2 DUP6 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x123 JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH2 0x10B JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x150 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x16A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x18F PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x436 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 ISZERO ISZERO DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1AF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1B8 PUSH2 0x4A9 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1D6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x18F PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH1 0x44 CALLDATALOAD PUSH2 0x4AF JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x20D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1B8 PUSH2 0x76B JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x222 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1B8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x771 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x250 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x259 PUSH2 0x799 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x28E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xE9 PUSH2 0x7B5 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2A3 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2AF PUSH1 0x4 CALLDATALOAD PUSH2 0x82E JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2BD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x18F PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x8B4 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2EE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1B8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH2 0xA43 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x322 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2AF PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0xA7B JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x353 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2AF PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0xB91 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x381 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1B8 PUSH2 0xC78 JUMP JUMPDEST PUSH1 0x4 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 PUSH1 0x2 PUSH1 0x1 DUP6 AND ISZERO PUSH2 0x100 MUL PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 SWAP5 AND SWAP4 SWAP1 SWAP4 DIV PUSH1 0x1F DUP2 ADD DUP5 SWAP1 DIV DUP5 MUL DUP3 ADD DUP5 ADD SWAP1 SWAP3 MSTORE DUP2 DUP2 MSTORE SWAP3 SWAP2 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0x42E JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x403 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x42E JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x411 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP DUP2 JUMP JUMPDEST CALLER PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 AND DUP1 DUP6 MSTORE SWAP1 DUP4 MSTORE DUP2 DUP5 KECCAK256 DUP7 SWAP1 SSTORE DUP2 MLOAD DUP7 DUP2 MSTORE SWAP2 MLOAD SWAP4 SWAP5 SWAP1 SWAP4 SWAP1 SWAP3 PUSH32 0x8C5BE1E5EBEC7D5BD14F71427D1E84F3DD0314C0F7B2291E5B200AC8C7C3B925 SWAP3 DUP3 SWAP1 SUB ADD SWAP1 LOG3 POP PUSH1 0x1 SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x3 SLOAD SWAP1 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 CALLER DUP5 MSTORE DUP3 MSTORE DUP1 DUP4 KECCAK256 SLOAD SWAP4 DUP4 MSTORE PUSH1 0x1 SWAP1 SWAP2 MSTORE DUP2 KECCAK256 SLOAD SWAP1 SWAP2 SWAP1 DUP4 GT ISZERO PUSH2 0x55C JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x1A PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x45524332305F494E53554646494349454E545F42414C414E4345000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST DUP3 DUP2 LT ISZERO PUSH2 0x5CB JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x1C PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x45524332305F494E53554646494349454E545F414C4C4F57414E434500000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP4 DUP2 ADD LT ISZERO PUSH2 0x661 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x10 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x55494E543235365F4F564552464C4F5700000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP6 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 DUP1 SLOAD DUP8 ADD SWAP1 SSTORE SWAP2 DUP8 AND DUP2 MSTORE KECCAK256 DUP1 SLOAD DUP5 SWAP1 SUB SWAP1 SSTORE PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 LT ISZERO PUSH2 0x6FB JUMPI PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP6 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 CALLER DUP5 MSTORE SWAP1 SWAP2 MSTORE SWAP1 KECCAK256 DUP1 SLOAD DUP5 SWAP1 SUB SWAP1 SSTORE JUMPDEST DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF DUP6 PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 POP PUSH1 0x1 SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x6 SLOAD DUP2 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x5 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 PUSH1 0x2 PUSH1 0x1 DUP6 AND ISZERO PUSH2 0x100 MUL PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 SWAP5 AND SWAP4 SWAP1 SWAP4 DIV PUSH1 0x1F DUP2 ADD DUP5 SWAP1 DIV DUP5 MUL DUP3 ADD DUP5 ADD SWAP1 SWAP3 MSTORE DUP2 DUP2 MSTORE SWAP3 SWAP2 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0x42E JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x403 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x42E JUMP JUMPDEST PUSH10 0x21E19E0C9BAB2400000 DUP2 GT ISZERO PUSH2 0x8A7 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0xF PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x56414C55455F544F4F5F4C415247450000000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH2 0x8B1 CALLER DUP3 PUSH2 0xC86 JUMP JUMPDEST POP JUMP JUMPDEST CALLER PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 DUP2 KECCAK256 SLOAD DUP3 GT ISZERO PUSH2 0x932 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x1A PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x45524332305F494E53554646494349454E545F42414C414E4345000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP3 DUP2 ADD LT ISZERO PUSH2 0x9C8 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x10 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x55494E543235365F4F564552464C4F5700000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST CALLER PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 DUP1 SLOAD DUP8 SWAP1 SUB SWAP1 SSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 AND DUP1 DUP5 MSTORE SWAP3 DUP2 SWAP1 KECCAK256 DUP1 SLOAD DUP8 ADD SWAP1 SSTORE DUP1 MLOAD DUP7 DUP2 MSTORE SWAP1 MLOAD SWAP3 SWAP4 SWAP3 PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF SWAP3 SWAP2 DUP2 SWAP1 SUB SWAP1 SWAP2 ADD SWAP1 LOG3 POP PUSH1 0x1 SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP2 DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 SWAP4 SWAP1 SWAP5 AND DUP3 MSTORE SWAP2 SWAP1 SWAP2 MSTORE KECCAK256 SLOAD SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0xB02 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP1 DUP3 LT ISZERO PUSH2 0xB4E JUMPI PUSH2 0xB46 PUSH1 0x3 SLOAD PUSH2 0xB41 DUP4 DUP6 PUSH2 0xD3F JUMP JUMPDEST PUSH2 0xD3F JUMP JUMPDEST PUSH1 0x3 SSTORE PUSH2 0xB67 JUMP JUMPDEST PUSH2 0xB63 PUSH1 0x3 SLOAD PUSH2 0xB5E DUP5 DUP5 PUSH2 0xD3F JUMP JUMPDEST PUSH2 0xDB6 JUMP JUMPDEST PUSH1 0x3 SSTORE JUMPDEST POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP2 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SSTORE JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0xC17 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND ISZERO PUSH2 0x8B1 JUMPI PUSH1 0x0 DUP1 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 SWAP1 SWAP2 AND OR SWAP1 SSTORE POP JUMP JUMPDEST PUSH10 0x21E19E0C9BAB2400000 DUP2 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH2 0xCB7 SWAP1 DUP3 SWAP1 PUSH2 0xDB6 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SSTORE PUSH1 0x3 SLOAD PUSH2 0xCEA SWAP1 DUP3 PUSH2 0xDB6 JUMP JUMPDEST PUSH1 0x3 SSTORE PUSH1 0x40 DUP1 MLOAD DUP3 DUP2 MSTORE SWAP1 MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND SWAP2 PUSH1 0x0 SWAP2 PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF SWAP2 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 LOG3 POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 GT ISZERO PUSH2 0xDB0 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x11 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x55494E543235365F554E444552464C4F57000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP SWAP1 SUB SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 ADD DUP4 DUP2 LT ISZERO PUSH2 0xE2A JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x10 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x55494E543235365F4F564552464C4F5700000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST SWAP4 SWAP3 POP POP POP JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 0xbf ISZERO 0xf8 0xb1 JUMPI DIV PUSH27 0x3248E2C7BF50AD7DD5D360D0BB36A780E3BAD9229FC4BAD5D20029 ",
- "sourceMap": "706:1394:50:-;;;928:308;8:9:-1;5:2;;;30:1;27;20:12;5:2;928:308:50;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;162:5:63;:18;;-1:-1:-1;;;;;;162:18:63;170:10;162:18;;;928:308:50;;;1079:12;;928:308;;;;;;;;;;1079:12;;:4;;:12;;;;:::i;:::-;-1:-1:-1;1101:16:50;;;;:6;;:16;;;;;:::i;:::-;-1:-1:-1;1127:8:50;:20;;;;1203:10;1194:20;;;;:8;:20;;;;;:35;-1:-1:-1;706:1394:50;;-1:-1:-1;706:1394:50;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;706:1394:50;;;-1:-1:-1;706:1394:50;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;"
- },
- "deployedBytecode": {
- "linkReferences": {},
- "object": "0x6080604052600436106100cf5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100d4578063095ea7b31461015e57806318160ddd146101a357806323b872dd146101ca578063313ce5671461020157806370a08231146102165780638da5cb5b1461024457806395d89b4114610282578063a0712d6814610297578063a9059cbb146102b1578063dd62ed3e146102e2578063e30443bc14610316578063f2fde38b14610347578063fa9b701814610375575b600080fd5b3480156100e057600080fd5b506100e961038a565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561012357818101518382015260200161010b565b50505050905090810190601f1680156101505780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561016a57600080fd5b5061018f73ffffffffffffffffffffffffffffffffffffffff60043516602435610436565b604080519115158252519081900360200190f35b3480156101af57600080fd5b506101b86104a9565b60408051918252519081900360200190f35b3480156101d657600080fd5b5061018f73ffffffffffffffffffffffffffffffffffffffff600435811690602435166044356104af565b34801561020d57600080fd5b506101b861076b565b34801561022257600080fd5b506101b873ffffffffffffffffffffffffffffffffffffffff60043516610771565b34801561025057600080fd5b50610259610799565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b34801561028e57600080fd5b506100e96107b5565b3480156102a357600080fd5b506102af60043561082e565b005b3480156102bd57600080fd5b5061018f73ffffffffffffffffffffffffffffffffffffffff600435166024356108b4565b3480156102ee57600080fd5b506101b873ffffffffffffffffffffffffffffffffffffffff60043581169060243516610a43565b34801561032257600080fd5b506102af73ffffffffffffffffffffffffffffffffffffffff60043516602435610a7b565b34801561035357600080fd5b506102af73ffffffffffffffffffffffffffffffffffffffff60043516610b91565b34801561038157600080fd5b506101b8610c78565b6004805460408051602060026001851615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f8101849004840282018401909252818152929183018282801561042e5780601f106104035761010080835404028352916020019161042e565b820191906000526020600020905b81548152906001019060200180831161041157829003601f168201915b505050505081565b33600081815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60035490565b73ffffffffffffffffffffffffffffffffffffffff83166000818152600260209081526040808320338452825280832054938352600190915281205490919083111561055c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f45524332305f494e53554646494349454e545f42414c414e4345000000000000604482015290519081900360640190fd5b828110156105cb57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f45524332305f494e53554646494349454e545f414c4c4f57414e434500000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8416600090815260016020526040902054838101101561066157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f55494e543235365f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff808516600090815260016020526040808220805487019055918716815220805484900390557fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8110156106fb5773ffffffffffffffffffffffffffffffffffffffff851660009081526002602090815260408083203384529091529020805484900390555b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3506001949350505050565b60065481565b73ffffffffffffffffffffffffffffffffffffffff1660009081526001602052604090205490565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b6005805460408051602060026001851615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f8101849004840282018401909252818152929183018282801561042e5780601f106104035761010080835404028352916020019161042e565b69021e19e0c9bab24000008111156108a757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f56414c55455f544f4f5f4c415247450000000000000000000000000000000000604482015290519081900360640190fd5b6108b13382610c86565b50565b3360009081526001602052604081205482111561093257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f45524332305f494e53554646494349454e545f42414c414e4345000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff831660009081526001602052604090205482810110156109c857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f55494e543235365f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b3360008181526001602090815260408083208054879003905573ffffffffffffffffffffffffffffffffffffffff871680845292819020805487019055805186815290519293927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a350600192915050565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260026020908152604080832093909416825291909152205490565b6000805473ffffffffffffffffffffffffffffffffffffffff163314610b0257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b5073ffffffffffffffffffffffffffffffffffffffff821660009081526001602052604090205480821015610b4e57610b46600354610b418385610d3f565b610d3f565b600355610b67565b610b63600354610b5e8484610d3f565b610db6565b6003555b5073ffffffffffffffffffffffffffffffffffffffff909116600090815260016020526040902055565b60005473ffffffffffffffffffffffffffffffffffffffff163314610c1757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8116156108b1576000805473ffffffffffffffffffffffffffffffffffffffff83167fffffffffffffffffffffffff000000000000000000000000000000000000000090911617905550565b69021e19e0c9bab240000081565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260016020526040902054610cb7908290610db6565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260016020526040902055600354610cea9082610db6565b60035560408051828152905173ffffffffffffffffffffffffffffffffffffffff8416916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b600082821115610db057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f55494e543235365f554e444552464c4f57000000000000000000000000000000604482015290519081900360640190fd5b50900390565b600082820183811015610e2a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f55494e543235365f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b93925050505600a165627a7a72305820bf15f8b157047a3248e2c7bf50ad7dd5d360d0bb36a780e3bad9229fc4bad5d20029",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0xCF JUMPI PUSH4 0xFFFFFFFF PUSH29 0x100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD DIV AND PUSH4 0x6FDDE03 DUP2 EQ PUSH2 0xD4 JUMPI DUP1 PUSH4 0x95EA7B3 EQ PUSH2 0x15E JUMPI DUP1 PUSH4 0x18160DDD EQ PUSH2 0x1A3 JUMPI DUP1 PUSH4 0x23B872DD EQ PUSH2 0x1CA JUMPI DUP1 PUSH4 0x313CE567 EQ PUSH2 0x201 JUMPI DUP1 PUSH4 0x70A08231 EQ PUSH2 0x216 JUMPI DUP1 PUSH4 0x8DA5CB5B EQ PUSH2 0x244 JUMPI DUP1 PUSH4 0x95D89B41 EQ PUSH2 0x282 JUMPI DUP1 PUSH4 0xA0712D68 EQ PUSH2 0x297 JUMPI DUP1 PUSH4 0xA9059CBB EQ PUSH2 0x2B1 JUMPI DUP1 PUSH4 0xDD62ED3E EQ PUSH2 0x2E2 JUMPI DUP1 PUSH4 0xE30443BC EQ PUSH2 0x316 JUMPI DUP1 PUSH4 0xF2FDE38B EQ PUSH2 0x347 JUMPI DUP1 PUSH4 0xFA9B7018 EQ PUSH2 0x375 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xE0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xE9 PUSH2 0x38A JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 DUP1 DUP3 MSTORE DUP4 MLOAD DUP2 DUP4 ADD MSTORE DUP4 MLOAD SWAP2 SWAP3 DUP4 SWAP3 SWAP1 DUP4 ADD SWAP2 DUP6 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x123 JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH2 0x10B JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x150 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x16A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x18F PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x436 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 ISZERO ISZERO DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1AF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1B8 PUSH2 0x4A9 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1D6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x18F PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH1 0x44 CALLDATALOAD PUSH2 0x4AF JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x20D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1B8 PUSH2 0x76B JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x222 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1B8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x771 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x250 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x259 PUSH2 0x799 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x28E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xE9 PUSH2 0x7B5 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2A3 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2AF PUSH1 0x4 CALLDATALOAD PUSH2 0x82E JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2BD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x18F PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x8B4 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2EE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1B8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH2 0xA43 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x322 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2AF PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0xA7B JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x353 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2AF PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0xB91 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x381 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1B8 PUSH2 0xC78 JUMP JUMPDEST PUSH1 0x4 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 PUSH1 0x2 PUSH1 0x1 DUP6 AND ISZERO PUSH2 0x100 MUL PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 SWAP5 AND SWAP4 SWAP1 SWAP4 DIV PUSH1 0x1F DUP2 ADD DUP5 SWAP1 DIV DUP5 MUL DUP3 ADD DUP5 ADD SWAP1 SWAP3 MSTORE DUP2 DUP2 MSTORE SWAP3 SWAP2 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0x42E JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x403 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x42E JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x411 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP DUP2 JUMP JUMPDEST CALLER PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 AND DUP1 DUP6 MSTORE SWAP1 DUP4 MSTORE DUP2 DUP5 KECCAK256 DUP7 SWAP1 SSTORE DUP2 MLOAD DUP7 DUP2 MSTORE SWAP2 MLOAD SWAP4 SWAP5 SWAP1 SWAP4 SWAP1 SWAP3 PUSH32 0x8C5BE1E5EBEC7D5BD14F71427D1E84F3DD0314C0F7B2291E5B200AC8C7C3B925 SWAP3 DUP3 SWAP1 SUB ADD SWAP1 LOG3 POP PUSH1 0x1 SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x3 SLOAD SWAP1 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 CALLER DUP5 MSTORE DUP3 MSTORE DUP1 DUP4 KECCAK256 SLOAD SWAP4 DUP4 MSTORE PUSH1 0x1 SWAP1 SWAP2 MSTORE DUP2 KECCAK256 SLOAD SWAP1 SWAP2 SWAP1 DUP4 GT ISZERO PUSH2 0x55C JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x1A PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x45524332305F494E53554646494349454E545F42414C414E4345000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST DUP3 DUP2 LT ISZERO PUSH2 0x5CB JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x1C PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x45524332305F494E53554646494349454E545F414C4C4F57414E434500000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP4 DUP2 ADD LT ISZERO PUSH2 0x661 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x10 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x55494E543235365F4F564552464C4F5700000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP6 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 DUP1 SLOAD DUP8 ADD SWAP1 SSTORE SWAP2 DUP8 AND DUP2 MSTORE KECCAK256 DUP1 SLOAD DUP5 SWAP1 SUB SWAP1 SSTORE PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 LT ISZERO PUSH2 0x6FB JUMPI PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP6 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 CALLER DUP5 MSTORE SWAP1 SWAP2 MSTORE SWAP1 KECCAK256 DUP1 SLOAD DUP5 SWAP1 SUB SWAP1 SSTORE JUMPDEST DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF DUP6 PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 POP PUSH1 0x1 SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x6 SLOAD DUP2 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x5 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 PUSH1 0x2 PUSH1 0x1 DUP6 AND ISZERO PUSH2 0x100 MUL PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 SWAP5 AND SWAP4 SWAP1 SWAP4 DIV PUSH1 0x1F DUP2 ADD DUP5 SWAP1 DIV DUP5 MUL DUP3 ADD DUP5 ADD SWAP1 SWAP3 MSTORE DUP2 DUP2 MSTORE SWAP3 SWAP2 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0x42E JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x403 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x42E JUMP JUMPDEST PUSH10 0x21E19E0C9BAB2400000 DUP2 GT ISZERO PUSH2 0x8A7 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0xF PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x56414C55455F544F4F5F4C415247450000000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH2 0x8B1 CALLER DUP3 PUSH2 0xC86 JUMP JUMPDEST POP JUMP JUMPDEST CALLER PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 DUP2 KECCAK256 SLOAD DUP3 GT ISZERO PUSH2 0x932 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x1A PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x45524332305F494E53554646494349454E545F42414C414E4345000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP3 DUP2 ADD LT ISZERO PUSH2 0x9C8 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x10 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x55494E543235365F4F564552464C4F5700000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST CALLER PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 DUP1 SLOAD DUP8 SWAP1 SUB SWAP1 SSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 AND DUP1 DUP5 MSTORE SWAP3 DUP2 SWAP1 KECCAK256 DUP1 SLOAD DUP8 ADD SWAP1 SSTORE DUP1 MLOAD DUP7 DUP2 MSTORE SWAP1 MLOAD SWAP3 SWAP4 SWAP3 PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF SWAP3 SWAP2 DUP2 SWAP1 SUB SWAP1 SWAP2 ADD SWAP1 LOG3 POP PUSH1 0x1 SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP2 DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 SWAP4 SWAP1 SWAP5 AND DUP3 MSTORE SWAP2 SWAP1 SWAP2 MSTORE KECCAK256 SLOAD SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0xB02 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP1 DUP3 LT ISZERO PUSH2 0xB4E JUMPI PUSH2 0xB46 PUSH1 0x3 SLOAD PUSH2 0xB41 DUP4 DUP6 PUSH2 0xD3F JUMP JUMPDEST PUSH2 0xD3F JUMP JUMPDEST PUSH1 0x3 SSTORE PUSH2 0xB67 JUMP JUMPDEST PUSH2 0xB63 PUSH1 0x3 SLOAD PUSH2 0xB5E DUP5 DUP5 PUSH2 0xD3F JUMP JUMPDEST PUSH2 0xDB6 JUMP JUMPDEST PUSH1 0x3 SSTORE JUMPDEST POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP2 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SSTORE JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0xC17 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND ISZERO PUSH2 0x8B1 JUMPI PUSH1 0x0 DUP1 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 SWAP1 SWAP2 AND OR SWAP1 SSTORE POP JUMP JUMPDEST PUSH10 0x21E19E0C9BAB2400000 DUP2 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH2 0xCB7 SWAP1 DUP3 SWAP1 PUSH2 0xDB6 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SSTORE PUSH1 0x3 SLOAD PUSH2 0xCEA SWAP1 DUP3 PUSH2 0xDB6 JUMP JUMPDEST PUSH1 0x3 SSTORE PUSH1 0x40 DUP1 MLOAD DUP3 DUP2 MSTORE SWAP1 MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND SWAP2 PUSH1 0x0 SWAP2 PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF SWAP2 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 LOG3 POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 GT ISZERO PUSH2 0xDB0 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x11 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x55494E543235365F554E444552464C4F57000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP SWAP1 SUB SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 ADD DUP4 DUP2 LT ISZERO PUSH2 0xE2A JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x10 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x55494E543235365F4F564552464C4F5700000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST SWAP4 SWAP3 POP POP POP JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 0xbf ISZERO 0xf8 0xb1 JUMPI DIV PUSH27 0x3248E2C7BF50AD7DD5D360D0BB36A780E3BAD9229FC4BAD5D20029 ",
- "sourceMap": "706:1394:50:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;777:18;;8:9:-1;5:2;;;30:1;27;20:12;5:2;777:18:50;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:100:-1;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;777:18:50;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2896:270:52;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2896:270:52;;;;;;;;;;;;;;;;;;;;;;;;;;;3251:119;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3251:119:52;;;;;;;;;;;;;;;;;;;;1091:804:55;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1091:804:55;;;;;;;;;;;;;;827:23:50;;8:9:-1;5:2;;;30:1;27;20:12;5:2;827:23:50;;;;3524:135:52;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;3524:135:52;;;;;;;91:20:63;;8:9:-1;5:2;;;30:1;27;20:12;5:2;91:20:63;;;;;;;;;;;;;;;;;;;;;;;801::50;;8:9:-1;5:2;;;30:1;27;20:12;5:2;801:20:50;;;;1907:191;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1907:191:50;;;;;;;1055:514:52;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1055:514:52;;;;;;;;;3867:162;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;3867:162:52;;;;;;;;;;;;1406:407:50;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1406:407:50;;;;;;;;;333:167:63;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;333:167:63;;;;;;;856:65:50;;8:9:-1;5:2;;;30:1;27;20:12;5:2;856:65:50;;;;777:18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;2896:270:52:-;3009:10;2981:4;3001:19;;;:7;:19;;;;;;;;;:29;;;;;;;;;;;:38;;;3054:84;;;;;;;2981:4;;3001:29;;3009:10;;3054:84;;;;;;;;-1:-1:-1;3155:4:52;2896:270;;;;:::o;3251:119::-;3351:12;;3251:119;:::o;1091:804:55:-;1261:14;;;1221:4;1261:14;;;:7;:14;;;;;;;;1276:10;1261:26;;;;;;;;1318:15;;;:8;:15;;;;;;1221:4;;1261:26;1318:25;-1:-1:-1;1318:25:55;1297:98;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1426:19;;;;1405:94;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1556:13;;;;;;;:8;:13;;;;;;1530:22;;;:39;;1509:102;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1622:13;;;;;;;;:8;:13;;;;;;:23;;;;;;1655:15;;;;;;:25;;;;;;;745:10;1694:20;;1690:87;;;1730:14;;;;;;;:7;:14;;;;;;;;1745:10;1730:26;;;;;;;:36;;;;;;;1690:87;1833:3;1792:74;;1814:5;1792:74;;;1850:6;1792:74;;;;;;;;;;;;;;;;;;-1:-1:-1;1884:4:55;;1091:804;-1:-1:-1;;;;1091:804:55:o;827:23:50:-;;;;:::o;3524:135:52:-;3636:16;;3606:7;3636:16;;;:8;:16;;;;;;;3524:135::o;91:20:63:-;;;;;;:::o;801::50:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1907:191;898:23;1989:25;;;1968:87;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2066:25;2072:10;2084:6;2066:5;:25::i;:::-;1907:191;:::o;1055:514:52:-;1186:10;1136:4;1177:20;;;:8;:20;;;;;;:30;-1:-1:-1;1177:30:52;1156:103;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1316:13;;;;;;;:8;:13;;;;;;1290:22;;;:39;;1269:102;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1391:10;1382:20;;;;:8;:20;;;;;;;;:30;;;;;;;:20;1422:13;;;;;;;;;:23;;;;;;1461:79;;;;;;;1422:13;;1391:10;1461:79;;;;;;;;;;;-1:-1:-1;1558:4:52;1055:514;;;;:::o;3867:162::-;3997:15;;;;3967:7;3997:15;;;:7;:15;;;;;;;;:25;;;;;;;;;;;;;3867:162::o;1406:407:50:-;1508:19;259:5:63;;;;245:10;:19;224:85;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1530:17:50;;;;;;;:8;:17;;;;;;1561:20;;;1557:214;;;1612:51;1620:12;;1634:28;1642:11;1655:6;1634:7;:28::i;:::-;1612:7;:51::i;:::-;1597:12;:66;1557:214;;;1709:51;1717:12;;1731:28;1739:6;1747:11;1731:7;:28::i;:::-;1709:7;:51::i;:::-;1694:12;:66;1557:214;-1:-1:-1;1780:17:50;;;;;;;;:8;:17;;;;;:26;1406:407::o;333:167:63:-;259:5;;;;245:10;:19;224:85;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;429:22;;;;425:69;;467:5;:16;;;;;;;;;;;;333:167;:::o;856:65:50:-;898:23;856:65;:::o;935:277:54:-;1042:13;;;;;;;:8;:13;;;;;;1026:30;;1034:6;;1026:7;:30::i;:::-;1010:13;;;;;;;:8;:13;;;;;:46;1089:12;;1081:29;;1103:6;1081:7;:29::i;:::-;1066:12;:44;1126:79;;;;;;;;;;;;1156:1;;1126:79;;;;;;;;;935:277;;:::o;502:208:65:-;588:7;632:6;;;;611:70;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;698:5:65;;;502:208::o;716:230::-;802:7;837:5;;;873:6;;;;852:69;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;938:1;716:230;-1:-1:-1;;;716:230:65:o"
- }
- }
- },
- "sources": {
- "2.0.0/extensions/Forwarder/Forwarder.sol": {
- "id": 0
- },
- "2.0.0/extensions/Forwarder/MixinAssets.sol": {
- "id": 1
- },
- "2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol": {
- "id": 2
- },
- "2.0.0/extensions/Forwarder/MixinForwarderCore.sol": {
- "id": 3
- },
- "2.0.0/extensions/Forwarder/MixinWeth.sol": {
- "id": 4
- },
- "2.0.0/extensions/Forwarder/interfaces/IAssets.sol": {
- "id": 5
- },
- "2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol": {
- "id": 6
- },
- "2.0.0/extensions/Forwarder/libs/LibConstants.sol": {
- "id": 7
- },
- "2.0.0/extensions/Forwarder/mixins/MAssets.sol": {
- "id": 8
- },
- "2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol": {
- "id": 9
- },
- "2.0.0/extensions/Forwarder/mixins/MWeth.sol": {
- "id": 10
- },
- "2.0.0/extensions/OrderValidator/OrderValidator.sol": {
- "id": 11
- },
- "2.0.0/multisig/MultiSigWallet.sol": {
- "id": 12
- },
- "2.0.0/multisig/MultiSigWalletWithTimeLock.sol": {
- "id": 13
- },
- "2.0.0/protocol/AssetProxy/ERC20Proxy.sol": {
- "id": 14
- },
- "2.0.0/protocol/AssetProxy/ERC721Proxy.sol": {
- "id": 15
- },
- "2.0.0/protocol/AssetProxy/MixinAuthorizable.sol": {
- "id": 16
- },
- "2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol": {
- "id": 17
- },
- "2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol": {
- "id": 18
- },
- "2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol": {
- "id": 19
- },
- "2.0.0/protocol/AssetProxyOwner/AssetProxyOwner.sol": {
- "id": 20
- },
- "2.0.0/protocol/Exchange/Exchange.sol": {
- "id": 21
- },
- "2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol": {
- "id": 22
- },
- "2.0.0/protocol/Exchange/MixinExchangeCore.sol": {
- "id": 23
- },
- "2.0.0/protocol/Exchange/MixinMatchOrders.sol": {
- "id": 24
- },
- "2.0.0/protocol/Exchange/MixinSignatureValidator.sol": {
- "id": 25
- },
- "2.0.0/protocol/Exchange/MixinTransactions.sol": {
- "id": 26
- },
- "2.0.0/protocol/Exchange/MixinWrapperFunctions.sol": {
- "id": 27
- },
- "2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol": {
- "id": 28
- },
- "2.0.0/protocol/Exchange/interfaces/IExchange.sol": {
- "id": 29
- },
- "2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol": {
- "id": 30
- },
- "2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol": {
- "id": 31
- },
- "2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol": {
- "id": 32
- },
- "2.0.0/protocol/Exchange/interfaces/ITransactions.sol": {
- "id": 33
- },
- "2.0.0/protocol/Exchange/interfaces/IValidator.sol": {
- "id": 34
- },
- "2.0.0/protocol/Exchange/interfaces/IWallet.sol": {
- "id": 35
- },
- "2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol": {
- "id": 36
- },
- "2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol": {
- "id": 37
- },
- "2.0.0/protocol/Exchange/libs/LibConstants.sol": {
- "id": 38
- },
- "2.0.0/protocol/Exchange/libs/LibEIP712.sol": {
- "id": 39
- },
- "2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol": {
- "id": 40
- },
- "2.0.0/protocol/Exchange/libs/LibFillResults.sol": {
- "id": 41
- },
- "2.0.0/protocol/Exchange/libs/LibMath.sol": {
- "id": 42
- },
- "2.0.0/protocol/Exchange/libs/LibOrder.sol": {
- "id": 43
- },
- "2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol": {
- "id": 44
- },
- "2.0.0/protocol/Exchange/mixins/MExchangeCore.sol": {
- "id": 45
- },
- "2.0.0/protocol/Exchange/mixins/MMatchOrders.sol": {
- "id": 46
- },
- "2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol": {
- "id": 47
- },
- "2.0.0/protocol/Exchange/mixins/MTransactions.sol": {
- "id": 48
- },
- "2.0.0/protocol/Exchange/mixins/MWrapperFunctions.sol": {
- "id": 49
- },
- "2.0.0/test/DummyERC20Token/DummyERC20Token.sol": {
- "id": 50
- },
- "2.0.0/test/DummyERC721Token/DummyERC721Token.sol": {
- "id": 51
- },
- "2.0.0/tokens/ERC20Token/ERC20Token.sol": {
- "id": 52
- },
- "2.0.0/tokens/ERC20Token/IERC20Token.sol": {
- "id": 53
- },
- "2.0.0/tokens/ERC20Token/MintableERC20Token.sol": {
- "id": 54
- },
- "2.0.0/tokens/ERC20Token/UnlimitedAllowanceERC20Token.sol": {
- "id": 55
- },
- "2.0.0/tokens/ERC721Token/ERC721Token.sol": {
- "id": 56
- },
- "2.0.0/tokens/ERC721Token/IERC721Receiver.sol": {
- "id": 57
- },
- "2.0.0/tokens/ERC721Token/IERC721Token.sol": {
- "id": 58
- },
- "2.0.0/tokens/ERC721Token/MintableERC721Token.sol": {
- "id": 59
- },
- "2.0.0/tokens/EtherToken/IEtherToken.sol": {
- "id": 60
- },
- "2.0.0/utils/LibBytes/LibBytes.sol": {
- "id": 61
- },
- "2.0.0/utils/Ownable/IOwnable.sol": {
- "id": 62
- },
- "2.0.0/utils/Ownable/Ownable.sol": {
- "id": 63
- },
- "2.0.0/utils/ReentrancyGuard/ReentrancyGuard.sol": {
- "id": 64
- },
- "2.0.0/utils/SafeMath/SafeMath.sol": {
- "id": 65
- }
- },
- "sourceCodes": {
- "2.0.0/extensions/Forwarder/Forwarder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./MixinWeth.sol\";\nimport \"./MixinForwarderCore.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./MixinAssets.sol\";\nimport \"./MixinExchangeWrapper.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract Forwarder is\n LibConstants,\n MixinWeth,\n MixinAssets,\n MixinExchangeWrapper,\n MixinForwarderCore\n{\n constructor (\n address _exchange,\n bytes memory _zrxAssetData,\n bytes memory _wethAssetData\n )\n public\n LibConstants(\n _exchange,\n _zrxAssetData,\n _wethAssetData\n )\n MixinForwarderCore()\n {}\n}\n",
- "2.0.0/extensions/Forwarder/MixinAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"../../tokens/ERC20Token/IERC20Token.sol\";\nimport \"../../tokens/ERC721Token/IERC721Token.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MAssets.sol\";\n\n\ncontract MixinAssets is\n Ownable,\n LibConstants,\n MAssets\n{\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_TRANSFER_SELECTOR = bytes4(keccak256(\"transfer(address,uint256)\"));\n\n /// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to \n /// function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be\n /// used to withdraw assets that were accidentally sent to this contract.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of ERC20 token to withdraw.\n function withdrawAsset(\n bytes assetData,\n uint256 amount\n )\n external\n onlyOwner\n {\n transferAssetToSender(assetData, amount);\n }\n\n /// @dev Transfers given amount of asset to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferAssetToSender(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n bytes4 proxyId = assetData.readBytes4(0);\n\n if (proxyId == ERC20_DATA_ID) {\n transferERC20Token(assetData, amount);\n } else if (proxyId == ERC721_DATA_ID) {\n transferERC721Token(assetData, amount);\n } else {\n revert(\"UNSUPPORTED_ASSET_PROXY\");\n }\n }\n\n /// @dev Decodes ERC20 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC20Token(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n address token = assetData.readAddress(16);\n\n // Transfer tokens.\n // We do a raw call so we can check the success separate\n // from the return data.\n bool success = token.call(abi.encodeWithSelector(\n ERC20_TRANSFER_SELECTOR,\n msg.sender,\n amount\n ));\n require(\n success,\n \"TRANSFER_FAILED\"\n );\n \n // Check return data.\n // If there is no return data, we assume the token incorrectly\n // does not return a bool. In this case we expect it to revert\n // on failure, which was handled above.\n // If the token does return data, we require that it is a single\n // value that evaluates to true.\n assembly {\n if returndatasize {\n success := 0\n if eq(returndatasize, 32) {\n // First 64 bytes of memory are reserved scratch space\n returndatacopy(0, 0, 32)\n success := mload(0)\n }\n }\n }\n require(\n success,\n \"TRANSFER_FAILED\"\n );\n }\n\n /// @dev Decodes ERC721 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC721Token(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n require(\n amount == 1,\n \"INVALID_AMOUNT\"\n );\n // Decode asset data.\n address token = assetData.readAddress(16);\n uint256 tokenId = assetData.readUint256(36);\n\n // Perform transfer.\n IERC721Token(token).transferFrom(\n address(this),\n msg.sender,\n tokenId\n );\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MExchangeWrapper.sol\";\nimport \"../../protocol/Exchange/libs/LibAbiEncoder.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../protocol/Exchange/libs/LibFillResults.sol\";\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\n\n\ncontract MixinExchangeWrapper is\n LibAbiEncoder,\n LibFillResults,\n LibMath,\n LibConstants,\n MExchangeWrapper\n{\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n // ABI encode calldata for `fillOrder`\n bytes memory fillOrderCalldata = abiEncodeFillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n\n address exchange = address(EXCHANGE);\n\n // Call `fillOrder` and handle any exceptions gracefully\n assembly {\n let success := call(\n gas, // forward all gas\n exchange, // call address of Exchange contract\n 0, // transfer 0 wei\n add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes)\n mload(fillOrderCalldata), // length of input\n fillOrderCalldata, // write output over input\n 128 // output size is 128 bytes\n )\n if success {\n mstore(fillResults, mload(fillOrderCalldata))\n mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32)))\n mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64)))\n mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96)))\n }\n }\n // fillResults values will be 0 by default if call was unsuccessful\n return fillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of WETH has been sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param wethSellAmount Desired amount of WETH to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellWeth(\n LibOrder.Order[] memory orders,\n uint256 wethSellAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // We assume that asset being sold by taker is WETH for each order.\n orders[i].makerAssetData = makerAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of WETH to sell\n uint256 remainingTakerAssetFillAmount = safeSub(wethSellAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of WETH\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= wethSellAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// The asset being sold by taker must always be WETH.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyExactAmountWithWeth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // We assume that asset being sold by taker is WETH for each order.\n orders[i].makerAssetData = makerAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n uint256 makerAssetFilledAmount = totalFillResults.makerAssetFilledAmount;\n if (makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n\n require(\n makerAssetFilledAmount >= makerAssetFillAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return totalFillResults;\n }\n\n /// @dev Buys zrxBuyAmount of ZRX fee tokens, taking into account ZRX fees for each order. This will guarantee\n /// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues).\n /// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX\n /// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases.\n /// The asset being sold by taker must always be WETH. \n /// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset.\n /// @param zrxBuyAmount Desired amount of ZRX to buy.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return totalFillResults Amounts filled and fees paid by maker and taker.\n function marketBuyExactZrxWithWeth(\n LibOrder.Order[] memory orders,\n uint256 zrxBuyAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n // Do nothing if zrxBuyAmount == 0\n if (zrxBuyAmount == 0) {\n return totalFillResults;\n }\n\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n uint256 zrxPurchased = 0;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // All of these are ZRX/WETH, so we can drop the respective assetData from calldata.\n orders[i].makerAssetData = zrxAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of ZRX to buy.\n uint256 remainingZrxBuyAmount = safeSub(zrxBuyAmount, zrxPurchased);\n\n // Convert the remaining amount of ZRX to buy into remaining amount\n // of WETH to sell, assuming entire amount can be sold in the current order.\n uint256 remainingWethSellAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n safeSub(orders[i].makerAssetAmount, orders[i].takerFee), // our exchange rate after fees \n remainingZrxBuyAmount\n );\n\n // Attempt to sell the remaining amount of WETH.\n FillResults memory singleFillResult = fillOrderNoThrow(\n orders[i],\n safeAdd(remainingWethSellAmount, 1), // we add 1 wei to the fill amount to make up for rounding errors\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker.\n addFillResults(totalFillResults, singleFillResult);\n zrxPurchased = safeSub(totalFillResults.makerAssetFilledAmount, totalFillResults.takerFeePaid);\n\n // Stop execution if the entire amount of ZRX has been bought.\n if (zrxPurchased >= zrxBuyAmount) {\n break;\n }\n }\n\n require(\n zrxPurchased >= zrxBuyAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return totalFillResults;\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinForwarderCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MWeth.sol\";\nimport \"./mixins/MAssets.sol\";\nimport \"./mixins/MExchangeWrapper.sol\";\nimport \"./interfaces/IForwarderCore.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../protocol/Exchange/libs/LibFillResults.sol\";\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\n\n\ncontract MixinForwarderCore is\n LibFillResults,\n LibMath,\n LibConstants,\n MWeth,\n MAssets,\n MExchangeWrapper,\n IForwarderCore\n{\n using LibBytes for bytes;\n\n /// @dev Constructor approves ERC20 proxy to transfer ZRX and WETH on this contract's behalf.\n constructor ()\n public\n {\n address proxyAddress = EXCHANGE.getAssetProxy(ERC20_DATA_ID);\n require(\n proxyAddress != address(0),\n \"UNREGISTERED_ASSET_PROXY\"\n );\n ETHER_TOKEN.approve(proxyAddress, MAX_UINT);\n ZRX_TOKEN.approve(proxyAddress, MAX_UINT);\n }\n\n /// @dev Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketSellOrdersWithEth(\n LibOrder.Order[] memory orders,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n FillResults memory orderFillResults,\n FillResults memory feeOrderFillResults\n )\n {\n // Convert ETH to WETH.\n convertEthToWeth();\n\n uint256 wethSellAmount;\n uint256 zrxBuyAmount;\n uint256 makerAssetAmountPurchased;\n if (orders[0].makerAssetData.equals(ZRX_ASSET_DATA)) {\n // Calculate amount of WETH that won't be spent on ETH fees.\n wethSellAmount = getPartialAmountFloor(\n PERCENTAGE_DENOMINATOR,\n safeAdd(PERCENTAGE_DENOMINATOR, feePercentage),\n msg.value\n );\n // Market sell available WETH.\n // ZRX fees are paid with this contract's balance.\n orderFillResults = marketSellWeth(\n orders,\n wethSellAmount,\n signatures\n );\n // The fee amount must be deducted from the amount transfered back to sender.\n makerAssetAmountPurchased = safeSub(orderFillResults.makerAssetFilledAmount, orderFillResults.takerFeePaid);\n } else {\n // 5% of WETH is reserved for filling feeOrders and paying feeRecipient.\n wethSellAmount = getPartialAmountFloor(\n MAX_WETH_FILL_PERCENTAGE,\n PERCENTAGE_DENOMINATOR,\n msg.value\n );\n // Market sell 95% of WETH.\n // ZRX fees are payed with this contract's balance.\n orderFillResults = marketSellWeth(\n orders,\n wethSellAmount,\n signatures\n );\n // Buy back all ZRX spent on fees.\n zrxBuyAmount = orderFillResults.takerFeePaid;\n feeOrderFillResults = marketBuyExactZrxWithWeth(\n feeOrders,\n zrxBuyAmount,\n feeSignatures\n );\n makerAssetAmountPurchased = orderFillResults.makerAssetFilledAmount;\n }\n\n // Transfer feePercentage of total ETH spent on primary orders to feeRecipient.\n // Refund remaining ETH to msg.sender.\n transferEthFeeAndRefund(\n orderFillResults.takerAssetFilledAmount,\n feeOrderFillResults.takerAssetFilledAmount,\n feePercentage,\n feeRecipient\n );\n\n // Transfer purchased assets to msg.sender.\n transferAssetToSender(orders[0].makerAssetData, makerAssetAmountPurchased);\n }\n\n /// @dev Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param makerAssetFillAmount Desired amount of makerAsset to purchase.\n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketBuyOrdersWithEth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n FillResults memory orderFillResults,\n FillResults memory feeOrderFillResults\n )\n {\n // Convert ETH to WETH.\n convertEthToWeth();\n\n uint256 zrxBuyAmount;\n uint256 makerAssetAmountPurchased;\n if (orders[0].makerAssetData.equals(ZRX_ASSET_DATA)) {\n // If the makerAsset is ZRX, it is not necessary to pay fees out of this\n // contracts's ZRX balance because fees are factored into the price of the order.\n orderFillResults = marketBuyExactZrxWithWeth(\n orders,\n makerAssetFillAmount,\n signatures\n );\n // The fee amount must be deducted from the amount transfered back to sender.\n makerAssetAmountPurchased = safeSub(orderFillResults.makerAssetFilledAmount, orderFillResults.takerFeePaid);\n } else {\n // Attemp to purchase desired amount of makerAsset.\n // ZRX fees are payed with this contract's balance.\n orderFillResults = marketBuyExactAmountWithWeth(\n orders,\n makerAssetFillAmount,\n signatures\n );\n // Buy back all ZRX spent on fees.\n zrxBuyAmount = orderFillResults.takerFeePaid;\n feeOrderFillResults = marketBuyExactZrxWithWeth(\n feeOrders,\n zrxBuyAmount,\n feeSignatures\n );\n makerAssetAmountPurchased = orderFillResults.makerAssetFilledAmount;\n }\n\n // Transfer feePercentage of total ETH spent on primary orders to feeRecipient.\n // Refund remaining ETH to msg.sender.\n transferEthFeeAndRefund(\n orderFillResults.takerAssetFilledAmount,\n feeOrderFillResults.takerAssetFilledAmount,\n feePercentage,\n feeRecipient\n );\n\n // Transfer purchased assets to msg.sender.\n transferAssetToSender(orders[0].makerAssetData, makerAssetAmountPurchased);\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinWeth.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MWeth.sol\";\n\n\ncontract MixinWeth is\n LibMath,\n LibConstants,\n MWeth\n{\n /// @dev Default payabale function, this allows us to withdraw WETH\n function ()\n public\n payable\n {\n require(\n msg.sender == address(ETHER_TOKEN),\n \"DEFAULT_FUNCTION_WETH_CONTRACT_ONLY\"\n );\n }\n\n /// @dev Converts message call's ETH value into WETH.\n function convertEthToWeth()\n internal\n {\n require(\n msg.value > 0,\n \"INVALID_MSG_VALUE\"\n );\n ETHER_TOKEN.deposit.value(msg.value)();\n }\n\n /// @dev Transfers feePercentage of WETH spent on primary orders to feeRecipient.\n /// Refunds any excess ETH to msg.sender.\n /// @param wethSoldExcludingFeeOrders Amount of WETH sold when filling primary orders.\n /// @param wethSoldForZrx Amount of WETH sold when purchasing ZRX required for primary order fees.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n function transferEthFeeAndRefund(\n uint256 wethSoldExcludingFeeOrders,\n uint256 wethSoldForZrx,\n uint256 feePercentage,\n address feeRecipient\n )\n internal\n {\n // Ensure feePercentage is less than 5%.\n require(\n feePercentage <= MAX_FEE_PERCENTAGE,\n \"FEE_PERCENTAGE_TOO_LARGE\"\n );\n\n // Ensure that no extra WETH owned by this contract has been sold.\n uint256 wethSold = safeAdd(wethSoldExcludingFeeOrders, wethSoldForZrx);\n require(\n wethSold <= msg.value,\n \"OVERSOLD_WETH\"\n );\n\n // Calculate amount of WETH that hasn't been sold.\n uint256 wethRemaining = safeSub(msg.value, wethSold);\n\n // Calculate ETH fee to pay to feeRecipient.\n uint256 ethFee = getPartialAmountFloor(\n feePercentage,\n PERCENTAGE_DENOMINATOR,\n wethSoldExcludingFeeOrders\n );\n\n // Ensure fee is less than amount of WETH remaining.\n require(\n ethFee <= wethRemaining,\n \"INSUFFICIENT_ETH_REMAINING\"\n );\n \n // Do nothing if no WETH remaining\n if (wethRemaining > 0) {\n // Convert remaining WETH to ETH\n ETHER_TOKEN.withdraw(wethRemaining);\n\n // Pay ETH to feeRecipient\n if (ethFee > 0) {\n feeRecipient.transfer(ethFee);\n }\n\n // Refund remaining ETH to msg.sender.\n uint256 ethRefund = safeSub(wethRemaining, ethFee);\n if (ethRefund > 0) {\n msg.sender.transfer(ethRefund);\n }\n }\n }\n}\n",
- "2.0.0/extensions/Forwarder/interfaces/IAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IAssets {\n\n /// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to \n /// function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be\n /// used to withdraw assets that were accidentally sent to this contract.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of ERC20 token to withdraw.\n function withdrawAsset(\n bytes assetData,\n uint256 amount\n )\n external;\n}\n",
- "2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../../protocol/Exchange/libs/LibFillResults.sol\";\n\n\ncontract IForwarderCore {\n\n /// @dev Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketSellOrdersWithEth(\n LibOrder.Order[] memory orders,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n LibFillResults.FillResults memory orderFillResults,\n LibFillResults.FillResults memory feeOrderFillResults\n );\n\n /// @dev Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param makerAssetFillAmount Desired amount of makerAsset to purchase.\n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketBuyOrdersWithEth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n LibFillResults.FillResults memory orderFillResults,\n LibFillResults.FillResults memory feeOrderFillResults\n );\n}\n",
- "2.0.0/extensions/Forwarder/libs/LibConstants.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/LibBytes/LibBytes.sol\";\nimport \"../../../protocol/Exchange/interfaces/IExchange.sol\";\nimport \"../../../tokens/EtherToken/IEtherToken.sol\";\nimport \"../../../tokens/ERC20Token/IERC20Token.sol\";\n\n\ncontract LibConstants {\n\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n uint256 constant internal MAX_UINT = 2**256 - 1;\n uint256 constant internal PERCENTAGE_DENOMINATOR = 10**18; \n uint256 constant internal MAX_FEE_PERCENTAGE = 5 * PERCENTAGE_DENOMINATOR / 100; // 5%\n uint256 constant internal MAX_WETH_FILL_PERCENTAGE = 95 * PERCENTAGE_DENOMINATOR / 100; // 95%\n \n // solhint-disable var-name-mixedcase\n IExchange internal EXCHANGE;\n IEtherToken internal ETHER_TOKEN;\n IERC20Token internal ZRX_TOKEN;\n bytes internal ZRX_ASSET_DATA;\n bytes internal WETH_ASSET_DATA;\n // solhint-enable var-name-mixedcase\n\n constructor (\n address _exchange,\n bytes memory _zrxAssetData,\n bytes memory _wethAssetData\n )\n public\n {\n EXCHANGE = IExchange(_exchange);\n ZRX_ASSET_DATA = _zrxAssetData;\n WETH_ASSET_DATA = _wethAssetData;\n\n address etherToken = _wethAssetData.readAddress(16);\n address zrxToken = _zrxAssetData.readAddress(16);\n ETHER_TOKEN = IEtherToken(etherToken);\n ZRX_TOKEN = IERC20Token(zrxToken);\n }\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAssets.sol\";\n\n\ncontract MAssets is\n IAssets\n{\n /// @dev Transfers given amount of asset to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferAssetToSender(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n\n /// @dev Decodes ERC20 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC20Token(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n\n /// @dev Decodes ERC721 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC721Token(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../../protocol/Exchange/libs/LibFillResults.sol\";\n\n\ncontract MExchangeWrapper {\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of WETH has been sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param wethSellAmount Desired amount of WETH to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellWeth(\n LibOrder.Order[] memory orders,\n uint256 wethSellAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// The asset being sold by taker must always be WETH.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyExactAmountWithWeth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Buys zrxBuyAmount of ZRX fee tokens, taking into account ZRX fees for each order. This will guarantee\n /// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues).\n /// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX\n /// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases.\n /// The asset being sold by taker must always be WETH. \n /// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset.\n /// @param zrxBuyAmount Desired amount of ZRX to buy.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return totalFillResults Amounts filled and fees paid by maker and taker.\n function marketBuyExactZrxWithWeth(\n LibOrder.Order[] memory orders,\n uint256 zrxBuyAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MWeth.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract MWeth {\n\n /// @dev Converts message call's ETH value into WETH.\n function convertEthToWeth()\n internal;\n\n /// @dev Transfers feePercentage of WETH spent on primary orders to feeRecipient.\n /// Refunds any excess ETH to msg.sender.\n /// @param wethSoldExcludingFeeOrders Amount of WETH sold when filling primary orders.\n /// @param wethSoldForZrx Amount of WETH sold when purchasing ZRX required for primary order fees.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n function transferEthFeeAndRefund(\n uint256 wethSoldExcludingFeeOrders,\n uint256 wethSoldForZrx,\n uint256 feePercentage,\n address feeRecipient\n )\n internal;\n}\n",
- "2.0.0/extensions/OrderValidator/OrderValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../protocol/Exchange/interfaces/IExchange.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../tokens/ERC20Token/IERC20Token.sol\";\nimport \"../../tokens/ERC721Token/IERC721Token.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\n\n\ncontract OrderValidator {\n\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n\n struct TraderInfo {\n uint256 makerBalance; // Maker's balance of makerAsset\n uint256 makerAllowance; // Maker's allowance to corresponding AssetProxy\n uint256 takerBalance; // Taker's balance of takerAsset\n uint256 takerAllowance; // Taker's allowance to corresponding AssetProxy\n uint256 makerZrxBalance; // Maker's balance of ZRX\n uint256 makerZrxAllowance; // Maker's allowance of ZRX to ERC20Proxy\n uint256 takerZrxBalance; // Taker's balance of ZRX\n uint256 takerZrxAllowance; // Taker's allowance of ZRX to ERC20Proxy\n }\n\n // solhint-disable var-name-mixedcase\n IExchange internal EXCHANGE;\n bytes internal ZRX_ASSET_DATA;\n // solhint-enable var-name-mixedcase\n\n constructor (address _exchange, bytes memory _zrxAssetData)\n public\n {\n EXCHANGE = IExchange(_exchange);\n ZRX_ASSET_DATA = _zrxAssetData;\n }\n\n /// @dev Fetches information for order and maker/taker of order.\n /// @param order The order structure.\n /// @param takerAddress Address that will be filling the order.\n /// @return OrderInfo and TraderInfo instances for given order.\n function getOrderAndTraderInfo(LibOrder.Order memory order, address takerAddress)\n public\n view\n returns (LibOrder.OrderInfo memory orderInfo, TraderInfo memory traderInfo)\n {\n orderInfo = EXCHANGE.getOrderInfo(order);\n traderInfo = getTraderInfo(order, takerAddress);\n return (orderInfo, traderInfo);\n }\n\n /// @dev Fetches information for all passed in orders and the makers/takers of each order.\n /// @param orders Array of order specifications.\n /// @param takerAddresses Array of taker addresses corresponding to each order.\n /// @return Arrays of OrderInfo and TraderInfo instances that correspond to each order.\n function getOrdersAndTradersInfo(LibOrder.Order[] memory orders, address[] memory takerAddresses)\n public\n view\n returns (LibOrder.OrderInfo[] memory ordersInfo, TraderInfo[] memory tradersInfo)\n {\n ordersInfo = EXCHANGE.getOrdersInfo(orders);\n tradersInfo = getTradersInfo(orders, takerAddresses);\n return (ordersInfo, tradersInfo);\n }\n\n /// @dev Fetches balance and allowances for maker and taker of order.\n /// @param order The order structure.\n /// @param takerAddress Address that will be filling the order.\n /// @return Balances and allowances of maker and taker of order.\n function getTraderInfo(LibOrder.Order memory order, address takerAddress)\n public\n view\n returns (TraderInfo memory traderInfo)\n {\n (traderInfo.makerBalance, traderInfo.makerAllowance) = getBalanceAndAllowance(order.makerAddress, order.makerAssetData);\n (traderInfo.takerBalance, traderInfo.takerAllowance) = getBalanceAndAllowance(takerAddress, order.takerAssetData);\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n (traderInfo.makerZrxBalance, traderInfo.makerZrxAllowance) = getBalanceAndAllowance(order.makerAddress, zrxAssetData);\n (traderInfo.takerZrxBalance, traderInfo.takerZrxAllowance) = getBalanceAndAllowance(takerAddress, zrxAssetData);\n return traderInfo;\n }\n\n /// @dev Fetches balances and allowances of maker and taker for each provided order.\n /// @param orders Array of order specifications.\n /// @param takerAddresses Array of taker addresses corresponding to each order.\n /// @return Array of balances and allowances for maker and taker of each order.\n function getTradersInfo(LibOrder.Order[] memory orders, address[] memory takerAddresses)\n public\n view\n returns (TraderInfo[] memory)\n {\n uint256 ordersLength = orders.length;\n TraderInfo[] memory tradersInfo = new TraderInfo[](ordersLength);\n for (uint256 i = 0; i != ordersLength; i++) {\n tradersInfo[i] = getTraderInfo(orders[i], takerAddresses[i]);\n }\n return tradersInfo;\n }\n\n /// @dev Fetches token balances and allowances of an address to given assetProxy. Supports ERC20 and ERC721.\n /// @param target Address to fetch balances and allowances of.\n /// @param assetData Encoded data that can be decoded by a specified proxy contract when transferring asset.\n /// @return Balance of asset and allowance set to given proxy of asset.\n /// For ERC721 tokens, these values will always be 1 or 0.\n function getBalanceAndAllowance(address target, bytes memory assetData)\n public\n view\n returns (uint256 balance, uint256 allowance)\n {\n bytes4 assetProxyId = assetData.readBytes4(0);\n address token = assetData.readAddress(16);\n address assetProxy = EXCHANGE.getAssetProxy(assetProxyId);\n\n if (assetProxyId == ERC20_DATA_ID) {\n // Query balance\n balance = IERC20Token(token).balanceOf(target);\n\n // Query allowance\n allowance = IERC20Token(token).allowance(target, assetProxy);\n } else if (assetProxyId == ERC721_DATA_ID) {\n uint256 tokenId = assetData.readUint256(36);\n\n // Query owner of tokenId\n address owner = getERC721TokenOwner(token, tokenId);\n\n // Set balance to 1 if tokenId is owned by target\n balance = target == owner ? 1 : 0;\n\n // Check if ERC721Proxy is approved to spend tokenId\n bool isApproved = IERC721Token(token).isApprovedForAll(target, assetProxy) || IERC721Token(token).getApproved(tokenId) == assetProxy;\n \n // Set alowance to 1 if ERC721Proxy is approved to spend tokenId\n allowance = isApproved ? 1 : 0;\n } else {\n revert(\"UNSUPPORTED_ASSET_PROXY\");\n }\n return (balance, allowance);\n }\n\n /// @dev Fetches token balances and allowances of an address for each given assetProxy. Supports ERC20 and ERC721.\n /// @param target Address to fetch balances and allowances of.\n /// @param assetData Array of encoded byte arrays that can be decoded by a specified proxy contract when transferring asset.\n /// @return Balances and allowances of assets.\n /// For ERC721 tokens, these values will always be 1 or 0.\n function getBalancesAndAllowances(address target, bytes[] memory assetData)\n public\n view\n returns (uint256[] memory, uint256[] memory)\n {\n uint256 length = assetData.length;\n uint256[] memory balances = new uint256[](length);\n uint256[] memory allowances = new uint256[](length);\n for (uint256 i = 0; i != length; i++) {\n (balances[i], allowances[i]) = getBalanceAndAllowance(target, assetData[i]);\n }\n return (balances, allowances);\n }\n\n /// @dev Calls `token.ownerOf(tokenId)`, but returns a null owner instead of reverting on an unowned token.\n /// @param token Address of ERC721 token.\n /// @param tokenId The identifier for the specific NFT.\n /// @return Owner of tokenId or null address if unowned.\n function getERC721TokenOwner(address token, uint256 tokenId)\n public\n view\n returns (address owner)\n {\n assembly {\n // load free memory pointer\n let cdStart := mload(64)\n\n // bytes4(keccak256(ownerOf(uint256))) = 0x6352211e\n mstore(cdStart, 0x6352211e00000000000000000000000000000000000000000000000000000000)\n mstore(add(cdStart, 4), tokenId)\n\n // staticcall `ownerOf(tokenId)`\n // `ownerOf` will revert if tokenId is not owned\n let success := staticcall(\n gas, // forward all gas\n token, // call token contract\n cdStart, // start of calldata\n 36, // length of input is 36 bytes\n cdStart, // write output over input\n 32 // size of output is 32 bytes\n )\n\n // Success implies that tokenId is owned\n // Copy owner from return data if successful\n if success {\n owner := mload(cdStart)\n } \n }\n\n // Owner initialized to address(0), no need to modify if call is unsuccessful\n return owner;\n }\n}\n",
- "2.0.0/multisig/MultiSigWallet.sol": "// solhint-disable\npragma solidity ^0.4.15;\n\n\n/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.\n/// @author Stefan George - <stefan.george@consensys.net>\ncontract MultiSigWallet {\n\n /*\n * Events\n */\n event Confirmation(address indexed sender, uint indexed transactionId);\n event Revocation(address indexed sender, uint indexed transactionId);\n event Submission(uint indexed transactionId);\n event Execution(uint indexed transactionId);\n event ExecutionFailure(uint indexed transactionId);\n event Deposit(address indexed sender, uint value);\n event OwnerAddition(address indexed owner);\n event OwnerRemoval(address indexed owner);\n event RequirementChange(uint required);\n\n /*\n * Constants\n */\n uint constant public MAX_OWNER_COUNT = 50;\n\n /*\n * Storage\n */\n mapping (uint => Transaction) public transactions;\n mapping (uint => mapping (address => bool)) public confirmations;\n mapping (address => bool) public isOwner;\n address[] public owners;\n uint public required;\n uint public transactionCount;\n\n struct Transaction {\n address destination;\n uint value;\n bytes data;\n bool executed;\n }\n\n /*\n * Modifiers\n */\n modifier onlyWallet() {\n require(msg.sender == address(this));\n _;\n }\n\n modifier ownerDoesNotExist(address owner) {\n require(!isOwner[owner]);\n _;\n }\n\n modifier ownerExists(address owner) {\n require(isOwner[owner]);\n _;\n }\n\n modifier transactionExists(uint transactionId) {\n require(transactions[transactionId].destination != 0);\n _;\n }\n\n modifier confirmed(uint transactionId, address owner) {\n require(confirmations[transactionId][owner]);\n _;\n }\n\n modifier notConfirmed(uint transactionId, address owner) {\n require(!confirmations[transactionId][owner]);\n _;\n }\n\n modifier notExecuted(uint transactionId) {\n require(!transactions[transactionId].executed);\n _;\n }\n\n modifier notNull(address _address) {\n require(_address != 0);\n _;\n }\n\n modifier validRequirement(uint ownerCount, uint _required) {\n require(ownerCount <= MAX_OWNER_COUNT\n && _required <= ownerCount\n && _required != 0\n && ownerCount != 0);\n _;\n }\n\n /// @dev Fallback function allows to deposit ether.\n function()\n payable\n {\n if (msg.value > 0)\n Deposit(msg.sender, msg.value);\n }\n\n /*\n * Public functions\n */\n /// @dev Contract constructor sets initial owners and required number of confirmations.\n /// @param _owners List of initial owners.\n /// @param _required Number of required confirmations.\n function MultiSigWallet(address[] _owners, uint _required)\n public\n validRequirement(_owners.length, _required)\n {\n for (uint i=0; i<_owners.length; i++) {\n require(!isOwner[_owners[i]] && _owners[i] != 0);\n isOwner[_owners[i]] = true;\n }\n owners = _owners;\n required = _required;\n }\n\n /// @dev Allows to add a new owner. Transaction has to be sent by wallet.\n /// @param owner Address of new owner.\n function addOwner(address owner)\n public\n onlyWallet\n ownerDoesNotExist(owner)\n notNull(owner)\n validRequirement(owners.length + 1, required)\n {\n isOwner[owner] = true;\n owners.push(owner);\n OwnerAddition(owner);\n }\n\n /// @dev Allows to remove an owner. Transaction has to be sent by wallet.\n /// @param owner Address of owner.\n function removeOwner(address owner)\n public\n onlyWallet\n ownerExists(owner)\n {\n isOwner[owner] = false;\n for (uint i=0; i<owners.length - 1; i++)\n if (owners[i] == owner) {\n owners[i] = owners[owners.length - 1];\n break;\n }\n owners.length -= 1;\n if (required > owners.length)\n changeRequirement(owners.length);\n OwnerRemoval(owner);\n }\n\n /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet.\n /// @param owner Address of owner to be replaced.\n /// @param newOwner Address of new owner.\n function replaceOwner(address owner, address newOwner)\n public\n onlyWallet\n ownerExists(owner)\n ownerDoesNotExist(newOwner)\n {\n for (uint i=0; i<owners.length; i++)\n if (owners[i] == owner) {\n owners[i] = newOwner;\n break;\n }\n isOwner[owner] = false;\n isOwner[newOwner] = true;\n OwnerRemoval(owner);\n OwnerAddition(newOwner);\n }\n\n /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet.\n /// @param _required Number of required confirmations.\n function changeRequirement(uint _required)\n public\n onlyWallet\n validRequirement(owners.length, _required)\n {\n required = _required;\n RequirementChange(_required);\n }\n\n /// @dev Allows an owner to submit and confirm a transaction.\n /// @param destination Transaction target address.\n /// @param value Transaction ether value.\n /// @param data Transaction data payload.\n /// @return Returns transaction ID.\n function submitTransaction(address destination, uint value, bytes data)\n public\n returns (uint transactionId)\n {\n transactionId = addTransaction(destination, value, data);\n confirmTransaction(transactionId);\n }\n\n /// @dev Allows an owner to confirm a transaction.\n /// @param transactionId Transaction ID.\n function confirmTransaction(uint transactionId)\n public\n ownerExists(msg.sender)\n transactionExists(transactionId)\n notConfirmed(transactionId, msg.sender)\n {\n confirmations[transactionId][msg.sender] = true;\n Confirmation(msg.sender, transactionId);\n executeTransaction(transactionId);\n }\n\n /// @dev Allows an owner to revoke a confirmation for a transaction.\n /// @param transactionId Transaction ID.\n function revokeConfirmation(uint transactionId)\n public\n ownerExists(msg.sender)\n confirmed(transactionId, msg.sender)\n notExecuted(transactionId)\n {\n confirmations[transactionId][msg.sender] = false;\n Revocation(msg.sender, transactionId);\n }\n\n /// @dev Allows anyone to execute a confirmed transaction.\n /// @param transactionId Transaction ID.\n function executeTransaction(uint transactionId)\n public\n ownerExists(msg.sender)\n confirmed(transactionId, msg.sender)\n notExecuted(transactionId)\n {\n if (isConfirmed(transactionId)) {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data))\n Execution(transactionId);\n else {\n ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n }\n\n // call has been separated into its own function in order to take advantage\n // of the Solidity's code generator to produce a loop that copies tx.data into memory.\n function external_call(address destination, uint value, uint dataLength, bytes data) internal returns (bool) {\n bool result;\n assembly {\n let x := mload(0x40) // \"Allocate\" memory for output (0x40 is where \"free memory\" pointer is stored by convention)\n let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that\n result := call(\n sub(gas, 34710), // 34710 is the value that solidity is currently emitting\n // It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) +\n // callNewAccountGas (25000, in case the destination address does not exist and needs creating)\n destination,\n value,\n d,\n dataLength, // Size of the input (in bytes) - this is what fixes the padding problem\n x,\n 0 // Output is ignored, therefore the output size is zero\n )\n }\n return result;\n }\n\n /// @dev Returns the confirmation status of a transaction.\n /// @param transactionId Transaction ID.\n /// @return Confirmation status.\n function isConfirmed(uint transactionId)\n public\n constant\n returns (bool)\n {\n uint count = 0;\n for (uint i=0; i<owners.length; i++) {\n if (confirmations[transactionId][owners[i]])\n count += 1;\n if (count == required)\n return true;\n }\n }\n\n /*\n * Internal functions\n */\n /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet.\n /// @param destination Transaction target address.\n /// @param value Transaction ether value.\n /// @param data Transaction data payload.\n /// @return Returns transaction ID.\n function addTransaction(address destination, uint value, bytes data)\n internal\n notNull(destination)\n returns (uint transactionId)\n {\n transactionId = transactionCount;\n transactions[transactionId] = Transaction({\n destination: destination,\n value: value,\n data: data,\n executed: false\n });\n transactionCount += 1;\n Submission(transactionId);\n }\n\n /*\n * Web3 call functions\n */\n /// @dev Returns number of confirmations of a transaction.\n /// @param transactionId Transaction ID.\n /// @return Number of confirmations.\n function getConfirmationCount(uint transactionId)\n public\n constant\n returns (uint count)\n {\n for (uint i=0; i<owners.length; i++)\n if (confirmations[transactionId][owners[i]])\n count += 1;\n }\n\n /// @dev Returns total number of transactions after filers are applied.\n /// @param pending Include pending transactions.\n /// @param executed Include executed transactions.\n /// @return Total number of transactions after filters are applied.\n function getTransactionCount(bool pending, bool executed)\n public\n constant\n returns (uint count)\n {\n for (uint i=0; i<transactionCount; i++)\n if ( pending && !transactions[i].executed\n || executed && transactions[i].executed)\n count += 1;\n }\n\n /// @dev Returns list of owners.\n /// @return List of owner addresses.\n function getOwners()\n public\n constant\n returns (address[])\n {\n return owners;\n }\n\n /// @dev Returns array with owner addresses, which confirmed transaction.\n /// @param transactionId Transaction ID.\n /// @return Returns array of owner addresses.\n function getConfirmations(uint transactionId)\n public\n constant\n returns (address[] _confirmations)\n {\n address[] memory confirmationsTemp = new address[](owners.length);\n uint count = 0;\n uint i;\n for (i=0; i<owners.length; i++)\n if (confirmations[transactionId][owners[i]]) {\n confirmationsTemp[count] = owners[i];\n count += 1;\n }\n _confirmations = new address[](count);\n for (i=0; i<count; i++)\n _confirmations[i] = confirmationsTemp[i];\n }\n\n /// @dev Returns list of transaction IDs in defined range.\n /// @param from Index start position of transaction array.\n /// @param to Index end position of transaction array.\n /// @param pending Include pending transactions.\n /// @param executed Include executed transactions.\n /// @return Returns array of transaction IDs.\n function getTransactionIds(uint from, uint to, bool pending, bool executed)\n public\n constant\n returns (uint[] _transactionIds)\n {\n uint[] memory transactionIdsTemp = new uint[](transactionCount);\n uint count = 0;\n uint i;\n for (i=0; i<transactionCount; i++)\n if ( pending && !transactions[i].executed\n || executed && transactions[i].executed)\n {\n transactionIdsTemp[count] = i;\n count += 1;\n }\n _transactionIds = new uint[](to - from);\n for (i=from; i<to; i++)\n _transactionIds[i - from] = transactionIdsTemp[i];\n }\n}",
- "2.0.0/multisig/MultiSigWalletWithTimeLock.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MultiSigWallet.sol\";\n\n\n/// @title Multisignature wallet with time lock- Allows multiple parties to execute a transaction after a time lock has passed.\n/// @author Amir Bandeali - <amir@0xProject.com>\n// solhint-disable not-rely-on-time\ncontract MultiSigWalletWithTimeLock is\n MultiSigWallet\n{\n event ConfirmationTimeSet(uint256 indexed transactionId, uint256 confirmationTime);\n event TimeLockChange(uint256 secondsTimeLocked);\n\n uint256 public secondsTimeLocked;\n\n mapping (uint256 => uint256) public confirmationTimes;\n\n modifier notFullyConfirmed(uint256 transactionId) {\n require(\n !isConfirmed(transactionId),\n \"TX_FULLY_CONFIRMED\"\n );\n _;\n }\n\n modifier fullyConfirmed(uint256 transactionId) {\n require(\n isConfirmed(transactionId),\n \"TX_NOT_FULLY_CONFIRMED\"\n );\n _;\n }\n\n modifier pastTimeLock(uint256 transactionId) {\n require(\n block.timestamp >= confirmationTimes[transactionId] + secondsTimeLocked,\n \"TIME_LOCK_INCOMPLETE\"\n );\n _;\n }\n\n /// @dev Contract constructor sets initial owners, required number of confirmations, and time lock.\n /// @param _owners List of initial owners.\n /// @param _required Number of required confirmations.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n constructor (\n address[] _owners,\n uint256 _required,\n uint256 _secondsTimeLocked\n )\n public\n MultiSigWallet(_owners, _required)\n {\n secondsTimeLocked = _secondsTimeLocked;\n }\n\n /// @dev Changes the duration of the time lock for transactions.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n function changeTimeLock(uint256 _secondsTimeLocked)\n public\n onlyWallet\n {\n secondsTimeLocked = _secondsTimeLocked;\n emit TimeLockChange(_secondsTimeLocked);\n }\n\n /// @dev Allows an owner to confirm a transaction.\n /// @param transactionId Transaction ID.\n function confirmTransaction(uint256 transactionId)\n public\n ownerExists(msg.sender)\n transactionExists(transactionId)\n notConfirmed(transactionId, msg.sender)\n notFullyConfirmed(transactionId)\n {\n confirmations[transactionId][msg.sender] = true;\n emit Confirmation(msg.sender, transactionId);\n if (isConfirmed(transactionId)) {\n setConfirmationTime(transactionId, block.timestamp);\n }\n }\n\n /// @dev Allows anyone to execute a confirmed transaction.\n /// @param transactionId Transaction ID.\n function executeTransaction(uint256 transactionId)\n public\n notExecuted(transactionId)\n fullyConfirmed(transactionId)\n pastTimeLock(transactionId)\n {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) {\n emit Execution(transactionId);\n } else {\n emit ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n\n /// @dev Sets the time of when a submission first passed.\n function setConfirmationTime(uint256 transactionId, uint256 confirmationTime)\n internal\n {\n confirmationTimes[transactionId] = confirmationTime;\n emit ConfirmationTimeSet(transactionId, confirmationTime);\n }\n}\n",
- "2.0.0/protocol/AssetProxy/ERC20Proxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MixinAuthorizable.sol\";\n\n\ncontract ERC20Proxy is\n MixinAuthorizable\n{\n // Id of this proxy.\n bytes4 constant internal PROXY_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n \n // solhint-disable-next-line payable-fallback\n function () \n external\n {\n assembly {\n // The first 4 bytes of calldata holds the function selector\n let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)\n\n // `transferFrom` will be called with the following parameters:\n // assetData Encoded byte array.\n // from Address to transfer asset from.\n // to Address to transfer asset to.\n // amount Amount of asset to transfer.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {\n\n // To lookup a value in a mapping, we load from the storage location keccak256(k, p),\n // where k is the key left padded to 32 bytes and p is the storage slot\n let start := mload(64)\n mstore(start, and(caller, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(start, 32), authorized_slot)\n\n // Revert if authorized[msg.sender] == false\n if iszero(sload(keccak256(start, 64))) {\n // Revert with `Error(\"SENDER_NOT_AUTHORIZED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // `transferFrom`.\n // The function is marked `external`, so no abi decodeding is done for\n // us. Instead, we expect the `calldata` memory to contain the\n // following:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n //\n // (*): offset is computed from start of function parameters, so offset\n // by an additional 4 bytes in the calldata.\n //\n // (**): see table below to compute length of assetData Contents\n //\n // WARNING: The ABIv2 specification allows additional padding between\n // the Params and Data section. This will result in a larger\n // offset to assetData.\n\n // Asset data itself is encoded as follows:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 1 * 32 | function parameters: |\n // | | 4 | 12 + 20 | 1. token address |\n\n // We construct calldata for the `token.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 4 | | 1. from |\n // | | 36 | | 2. to |\n // | | 68 | | 3. amount |\n\n /////// Read token address from calldata ///////\n // * The token address is stored in `assetData`.\n //\n // * The \"offset to assetData\" is stored at offset 4 in the calldata (table 1).\n // [assetDataOffsetFromParams = calldataload(4)]\n //\n // * Notes that the \"offset to assetData\" is relative to the \"Params\" area of calldata;\n // add 4 bytes to account for the length of the \"Header\" area (table 1).\n // [assetDataOffsetFromHeader = assetDataOffsetFromParams + 4]\n //\n // * The \"token address\" is offset 32+4=36 bytes into \"assetData\" (tables 1 & 2).\n // [tokenOffset = assetDataOffsetFromHeader + 36 = calldataload(4) + 4 + 36]\n let token := calldataload(add(calldataload(4), 40))\n \n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFrom` selector.\n // Any trailing data in transferFromSelector will be\n // overwritten in the next `mstore` call.\n mstore(0, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // We copy the fields `from`, `to` and `amount` in bulk\n // from our own calldata to the new calldata.\n calldatacopy(4, 36, 96)\n\n /////// Call `token.transferFrom` using the calldata ///////\n let success := call(\n gas, // forward all gas\n token, // call address of token contract\n 0, // don't send any ETH\n 0, // pointer to start of input\n 100, // length of input\n 0, // write output over input\n 32 // output size should be 32 bytes\n )\n\n /////// Check return data. ///////\n // If there is no return data, we assume the token incorrectly\n // does not return a bool. In this case we expect it to revert\n // on failure, which was handled above.\n // If the token does return data, we require that it is a single\n // nonzero 32 bytes value.\n // So the transfer succeeded if the call succeeded and either\n // returned nothing, or returned a non-zero 32 byte value. \n success := and(success, or(\n iszero(returndatasize),\n and(\n eq(returndatasize, 32),\n gt(mload(0), 0)\n )\n ))\n if success {\n return(0, 0)\n }\n \n // Revert with `Error(\"TRANSFER_FAILED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // Revert if undefined function is called\n revert(0, 0)\n }\n }\n\n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4)\n {\n return PROXY_ID;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/ERC721Proxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MixinAuthorizable.sol\";\n\n\ncontract ERC721Proxy is\n MixinAuthorizable\n{\n // Id of this proxy.\n bytes4 constant internal PROXY_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n\n // solhint-disable-next-line payable-fallback\n function () \n external\n {\n assembly {\n // The first 4 bytes of calldata holds the function selector\n let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)\n\n // `transferFrom` will be called with the following parameters:\n // assetData Encoded byte array.\n // from Address to transfer asset from.\n // to Address to transfer asset to.\n // amount Amount of asset to transfer.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {\n\n // To lookup a value in a mapping, we load from the storage location keccak256(k, p),\n // where k is the key left padded to 32 bytes and p is the storage slot\n let start := mload(64)\n mstore(start, and(caller, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(start, 32), authorized_slot)\n\n // Revert if authorized[msg.sender] == false\n if iszero(sload(keccak256(start, 64))) {\n // Revert with `Error(\"SENDER_NOT_AUTHORIZED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // `transferFrom`.\n // The function is marked `external`, so no abi decodeding is done for\n // us. Instead, we expect the `calldata` memory to contain the\n // following:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n //\n // (*): offset is computed from start of function parameters, so offset\n // by an additional 4 bytes in the calldata.\n //\n // (**): see table below to compute length of assetData Contents\n //\n // WARNING: The ABIv2 specification allows additional padding between\n // the Params and Data section. This will result in a larger\n // offset to assetData.\n\n // Asset data itself is encoded as follows:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 2 * 32 | function parameters: |\n // | | 4 | 12 + 20 | 1. token address |\n // | | 36 | | 2. tokenId |\n \n // We construct calldata for the `token.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n // \n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 4 | | 1. from |\n // | | 36 | | 2. to |\n // | | 68 | | 3. tokenId |\n\n // There exists only 1 of each token.\n // require(amount == 1, \"INVALID_AMOUNT\")\n if sub(calldataload(100), 1) {\n // Revert with `Error(\"INVALID_AMOUNT\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000e494e56414c49445f414d4f554e540000000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFrom` selector.\n // Any trailing data in transferFromSelector will be\n // overwritten in the next `mstore` call.\n mstore(0, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // We copy the fields `from` and `to` in bulk\n // from our own calldata to the new calldata.\n calldatacopy(4, 36, 64)\n\n // Copy `tokenId` field from our own calldata to the new calldata.\n let assetDataOffset := calldataload(4)\n calldatacopy(68, add(assetDataOffset, 72), 32)\n\n /////// Call `token.transferFrom` using the calldata ///////\n let token := calldataload(add(assetDataOffset, 40))\n let success := call(\n gas, // forward all gas\n token, // call address of token contract\n 0, // don't send any ETH\n 0, // pointer to start of input\n 100, // length of input\n 0, // write output to null\n 0 // output size is 0 bytes\n )\n if success {\n return(0, 0)\n }\n \n // Revert with `Error(\"TRANSFER_FAILED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // Revert if undefined function is called\n revert(0, 0)\n }\n }\n\n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4)\n {\n return PROXY_ID;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/MixinAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"./mixins/MAuthorizable.sol\";\n\n\ncontract MixinAuthorizable is\n Ownable,\n MAuthorizable\n{\n /// @dev Only authorized addresses can invoke functions with this modifier.\n modifier onlyAuthorized {\n require(\n authorized[msg.sender],\n \"SENDER_NOT_AUTHORIZED\"\n );\n _;\n }\n\n mapping (address => bool) public authorized;\n address[] public authorities;\n\n /// @dev Authorizes an address.\n /// @param target Address to authorize.\n function addAuthorizedAddress(address target)\n external\n onlyOwner\n {\n require(\n !authorized[target],\n \"TARGET_ALREADY_AUTHORIZED\"\n );\n\n authorized[target] = true;\n authorities.push(target);\n emit AuthorizedAddressAdded(target, msg.sender);\n }\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n function removeAuthorizedAddress(address target)\n external\n onlyOwner\n {\n require(\n authorized[target],\n \"TARGET_NOT_AUTHORIZED\"\n );\n\n delete authorized[target];\n for (uint256 i = 0; i < authorities.length; i++) {\n if (authorities[i] == target) {\n authorities[i] = authorities[authorities.length - 1];\n authorities.length -= 1;\n break;\n }\n }\n emit AuthorizedAddressRemoved(target, msg.sender);\n }\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n /// @param index Index of target in authorities array.\n function removeAuthorizedAddressAtIndex(\n address target,\n uint256 index\n )\n external\n onlyOwner\n {\n require(\n authorized[target],\n \"TARGET_NOT_AUTHORIZED\"\n );\n require(\n index < authorities.length,\n \"INDEX_OUT_OF_BOUNDS\"\n );\n require(\n authorities[index] == target,\n \"AUTHORIZED_ADDRESS_MISMATCH\"\n );\n\n delete authorized[target];\n authorities[index] = authorities[authorities.length - 1];\n authorities.length -= 1;\n emit AuthorizedAddressRemoved(target, msg.sender);\n }\n\n /// @dev Gets all authorized addresses.\n /// @return Array of authorized addresses.\n function getAuthorizedAddresses()\n external\n view\n returns (address[] memory)\n {\n return authorities;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IAuthorizable.sol\";\n\n\ncontract IAssetProxy is\n IAuthorizable\n{\n /// @dev Transfers assets. Either succeeds or throws.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param from Address to transfer asset from.\n /// @param to Address to transfer asset to.\n /// @param amount Amount of asset to transfer.\n function transferFrom(\n bytes assetData,\n address from,\n address to,\n uint256 amount\n )\n external;\n \n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4);\n}\n",
- "2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/Ownable/IOwnable.sol\";\n\n\ncontract IAuthorizable is\n IOwnable\n{\n /// @dev Authorizes an address.\n /// @param target Address to authorize.\n function addAuthorizedAddress(address target)\n external;\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n function removeAuthorizedAddress(address target)\n external;\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n /// @param index Index of target in authorities array.\n function removeAuthorizedAddressAtIndex(\n address target,\n uint256 index\n )\n external;\n \n /// @dev Gets all authorized addresses.\n /// @return Array of authorized addresses.\n function getAuthorizedAddresses()\n external\n view\n returns (address[] memory);\n}\n",
- "2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAuthorizable.sol\";\n\n\ncontract MAuthorizable is\n IAuthorizable\n{\n // Event logged when a new address is authorized.\n event AuthorizedAddressAdded(\n address indexed target,\n address indexed caller\n );\n\n // Event logged when a currently authorized address is unauthorized.\n event AuthorizedAddressRemoved(\n address indexed target,\n address indexed caller\n );\n\n /// @dev Only authorized addresses can invoke functions with this modifier.\n modifier onlyAuthorized { revert(); _; }\n}\n",
- "2.0.0/protocol/AssetProxyOwner/AssetProxyOwner.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../multisig/MultiSigWalletWithTimeLock.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\n\n\ncontract AssetProxyOwner is\n MultiSigWalletWithTimeLock\n{\n using LibBytes for bytes;\n\n event AssetProxyRegistration(address assetProxyContract, bool isRegistered);\n\n // Mapping of AssetProxy contract address =>\n // if this contract is allowed to call the AssetProxy's `removeAuthorizedAddressAtIndex` method without a time lock.\n mapping (address => bool) public isAssetProxyRegistered;\n\n bytes4 constant internal REMOVE_AUTHORIZED_ADDRESS_AT_INDEX_SELECTOR = bytes4(keccak256(\"removeAuthorizedAddressAtIndex(address,uint256)\"));\n\n /// @dev Function will revert if the transaction does not call `removeAuthorizedAddressAtIndex`\n /// on an approved AssetProxy contract.\n modifier validRemoveAuthorizedAddressAtIndexTx(uint256 transactionId) {\n Transaction storage txn = transactions[transactionId];\n require(\n isAssetProxyRegistered[txn.destination],\n \"UNREGISTERED_ASSET_PROXY\"\n );\n require(\n txn.data.readBytes4(0) == REMOVE_AUTHORIZED_ADDRESS_AT_INDEX_SELECTOR,\n \"INVALID_FUNCTION_SELECTOR\"\n );\n _;\n }\n\n /// @dev Contract constructor sets initial owners, required number of confirmations,\n /// time lock, and list of AssetProxy addresses.\n /// @param _owners List of initial owners.\n /// @param _assetProxyContracts Array of AssetProxy contract addresses.\n /// @param _required Number of required confirmations.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n constructor (\n address[] memory _owners,\n address[] memory _assetProxyContracts,\n uint256 _required,\n uint256 _secondsTimeLocked\n )\n public\n MultiSigWalletWithTimeLock(_owners, _required, _secondsTimeLocked)\n {\n for (uint256 i = 0; i < _assetProxyContracts.length; i++) {\n address assetProxy = _assetProxyContracts[i];\n require(\n assetProxy != address(0),\n \"INVALID_ASSET_PROXY\"\n );\n isAssetProxyRegistered[assetProxy] = true;\n }\n }\n\n /// @dev Registers or deregisters an AssetProxy to be able to execute\n /// `removeAuthorizedAddressAtIndex` without a timelock.\n /// @param assetProxyContract Address of AssetProxy contract.\n /// @param isRegistered Status of approval for AssetProxy contract.\n function registerAssetProxy(address assetProxyContract, bool isRegistered)\n public\n onlyWallet\n notNull(assetProxyContract)\n {\n isAssetProxyRegistered[assetProxyContract] = isRegistered;\n emit AssetProxyRegistration(assetProxyContract, isRegistered);\n }\n\n /// @dev Allows execution of `removeAuthorizedAddressAtIndex` without time lock.\n /// @param transactionId Transaction ID.\n function executeRemoveAuthorizedAddressAtIndex(uint256 transactionId)\n public\n notExecuted(transactionId)\n fullyConfirmed(transactionId)\n validRemoveAuthorizedAddressAtIndexTx(transactionId)\n {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) {\n emit Execution(transactionId);\n } else {\n emit ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/Exchange.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./MixinExchangeCore.sol\";\nimport \"./MixinSignatureValidator.sol\";\nimport \"./MixinWrapperFunctions.sol\";\nimport \"./MixinAssetProxyDispatcher.sol\";\nimport \"./MixinTransactions.sol\";\nimport \"./MixinMatchOrders.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract Exchange is\n MixinExchangeCore,\n MixinMatchOrders,\n MixinSignatureValidator,\n MixinTransactions,\n MixinAssetProxyDispatcher,\n MixinWrapperFunctions\n{\n string constant public VERSION = \"2.0.1-alpha\";\n\n // Mixins are instantiated in the order they are inherited\n constructor (bytes memory _zrxAssetData)\n public\n LibConstants(_zrxAssetData) // @TODO: Remove when we deploy.\n MixinExchangeCore()\n MixinMatchOrders()\n MixinSignatureValidator()\n MixinTransactions()\n MixinAssetProxyDispatcher()\n MixinWrapperFunctions()\n {}\n}\n",
- "2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\nimport \"../AssetProxy/interfaces/IAssetProxy.sol\";\n\n\ncontract MixinAssetProxyDispatcher is\n Ownable,\n MAssetProxyDispatcher\n{\n // Mapping from Asset Proxy Id's to their respective Asset Proxy\n mapping (bytes4 => IAssetProxy) public assetProxies;\n\n /// @dev Registers an asset proxy to its asset proxy id.\n /// Once an asset proxy is registered, it cannot be unregistered.\n /// @param assetProxy Address of new asset proxy to register.\n function registerAssetProxy(address assetProxy)\n external\n onlyOwner\n {\n IAssetProxy assetProxyContract = IAssetProxy(assetProxy);\n\n // Ensure that no asset proxy exists with current id.\n bytes4 assetProxyId = assetProxyContract.getProxyId();\n address currentAssetProxy = assetProxies[assetProxyId];\n require(\n currentAssetProxy == address(0),\n \"ASSET_PROXY_ALREADY_EXISTS\"\n );\n\n // Add asset proxy and log registration.\n assetProxies[assetProxyId] = assetProxyContract;\n emit AssetProxyRegistered(\n assetProxyId,\n assetProxy\n );\n }\n\n /// @dev Gets an asset proxy.\n /// @param assetProxyId Id of the asset proxy.\n /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered.\n function getAssetProxy(bytes4 assetProxyId)\n external\n view\n returns (address)\n {\n return assetProxies[assetProxyId];\n }\n\n /// @dev Forwards arguments to assetProxy and calls `transferFrom`. Either succeeds or throws.\n /// @param assetData Byte array encoded for the asset.\n /// @param from Address to transfer token from.\n /// @param to Address to transfer token to.\n /// @param amount Amount of token to transfer.\n function dispatchTransferFrom(\n bytes memory assetData,\n address from,\n address to,\n uint256 amount\n )\n internal\n {\n // Do nothing if no amount should be transferred.\n if (amount > 0 && from != to) {\n // Ensure assetData length is valid\n require(\n assetData.length > 3,\n \"LENGTH_GREATER_THAN_3_REQUIRED\"\n );\n \n // Lookup assetProxy. We do not use `LibBytes.readBytes4` for gas efficiency reasons.\n bytes4 assetProxyId;\n assembly {\n assetProxyId := and(mload(\n add(assetData, 32)),\n 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000\n )\n }\n address assetProxy = assetProxies[assetProxyId];\n\n // Ensure that assetProxy exists\n require(\n assetProxy != address(0),\n \"ASSET_PROXY_DOES_NOT_EXIST\"\n );\n \n // We construct calldata for the `assetProxy.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n // \n // | Area | Offset | Length | Contents |\n // | -------- |--------|---------|-------------------------------------------- |\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n\n assembly {\n /////// Setup State ///////\n // `cdStart` is the start of the calldata for `assetProxy.transferFrom` (equal to free memory ptr).\n let cdStart := mload(64)\n // `dataAreaLength` is the total number of words needed to store `assetData`\n // As-per the ABI spec, this value is padded up to the nearest multiple of 32,\n // and includes 32-bytes for length.\n let dataAreaLength := and(add(mload(assetData), 63), 0xFFFFFFFFFFFE0)\n // `cdEnd` is the end of the calldata for `assetProxy.transferFrom`.\n let cdEnd := add(cdStart, add(132, dataAreaLength))\n\n \n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFromSelector`.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n mstore(cdStart, 0xa85e59e400000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // Each parameter is padded to 32-bytes. The entire Params Area is 128 bytes.\n // Notes:\n // 1. The offset to `assetData` is the length of the Params Area (128 bytes).\n // 2. A 20-byte mask is applied to addresses to zero-out the unused bytes.\n mstore(add(cdStart, 4), 128)\n mstore(add(cdStart, 36), and(from, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(cdStart, 68), and(to, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(cdStart, 100), amount)\n \n /////// Setup Data Area ///////\n // This area holds `assetData`.\n let dataArea := add(cdStart, 132)\n // solhint-disable-next-line no-empty-blocks\n for {} lt(dataArea, cdEnd) {} {\n mstore(dataArea, mload(assetData))\n dataArea := add(dataArea, 32)\n assetData := add(assetData, 32)\n }\n\n /////// Call `assetProxy.transferFrom` using the constructed calldata ///////\n let success := call(\n gas, // forward all gas\n assetProxy, // call address of asset proxy\n 0, // don't send any ETH\n cdStart, // pointer to start of input\n sub(cdEnd, cdStart), // length of input \n cdStart, // write output over input\n 512 // reserve 512 bytes for output\n )\n if iszero(success) {\n revert(cdStart, returndatasize())\n }\n }\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\n\n\ncontract MixinExchangeCore is\n ReentrancyGuard,\n LibConstants,\n LibMath,\n LibOrder,\n LibFillResults,\n MAssetProxyDispatcher,\n MExchangeCore,\n MSignatureValidator,\n MTransactions\n{\n // Mapping of orderHash => amount of takerAsset already bought by maker\n mapping (bytes32 => uint256) public filled;\n\n // Mapping of orderHash => cancelled\n mapping (bytes32 => bool) public cancelled;\n\n // Mapping of makerAddress => senderAddress => lowest salt an order can have in order to be fillable\n // Orders with specified senderAddress and with a salt less than their epoch are considered cancelled\n mapping (address => mapping (address => uint256)) public orderEpoch;\n\n /// @dev Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch\n /// and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress).\n /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled.\n function cancelOrdersUpTo(uint256 targetOrderEpoch)\n external\n nonReentrant\n {\n address makerAddress = getCurrentContextAddress();\n // If this function is called via `executeTransaction`, we only update the orderEpoch for the makerAddress/msg.sender combination.\n // This allows external filter contracts to add rules to how orders are cancelled via this function.\n address senderAddress = makerAddress == msg.sender ? address(0) : msg.sender;\n\n // orderEpoch is initialized to 0, so to cancelUpTo we need salt + 1\n uint256 newOrderEpoch = targetOrderEpoch + 1; \n uint256 oldOrderEpoch = orderEpoch[makerAddress][senderAddress];\n\n // Ensure orderEpoch is monotonically increasing\n require(\n newOrderEpoch > oldOrderEpoch, \n \"INVALID_NEW_ORDER_EPOCH\"\n );\n\n // Update orderEpoch\n orderEpoch[makerAddress][senderAddress] = newOrderEpoch;\n emit CancelUpTo(\n makerAddress,\n senderAddress,\n newOrderEpoch\n );\n }\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrder(\n Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n nonReentrant\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n return fillResults;\n }\n\n /// @dev After calling, the order can not be filled anymore.\n /// Throws if order is invalid or sender does not have permission to cancel.\n /// @param order Order to cancel. Order must be OrderStatus.FILLABLE.\n function cancelOrder(Order memory order)\n public\n nonReentrant\n {\n cancelOrderInternal(order);\n }\n\n /// @dev Gets information about an order: status, hash, and amount filled.\n /// @param order Order to gather information on.\n /// @return OrderInfo Information about the order and its state.\n /// See LibOrder.OrderInfo for a complete description.\n function getOrderInfo(Order memory order)\n public\n view\n returns (OrderInfo memory orderInfo)\n {\n // Compute the order hash\n orderInfo.orderHash = getOrderHash(order);\n\n // Fetch filled amount\n orderInfo.orderTakerAssetFilledAmount = filled[orderInfo.orderHash];\n\n // If order.makerAssetAmount is zero, we also reject the order.\n // While the Exchange contract handles them correctly, they create\n // edge cases in the supporting infrastructure because they have\n // an 'infinite' price when computed by a simple division.\n if (order.makerAssetAmount == 0) {\n orderInfo.orderStatus = uint8(OrderStatus.INVALID_MAKER_ASSET_AMOUNT);\n return orderInfo;\n }\n\n // If order.takerAssetAmount is zero, then the order will always\n // be considered filled because 0 == takerAssetAmount == orderTakerAssetFilledAmount\n // Instead of distinguishing between unfilled and filled zero taker\n // amount orders, we choose not to support them.\n if (order.takerAssetAmount == 0) {\n orderInfo.orderStatus = uint8(OrderStatus.INVALID_TAKER_ASSET_AMOUNT);\n return orderInfo;\n }\n\n // Validate order availability\n if (orderInfo.orderTakerAssetFilledAmount >= order.takerAssetAmount) {\n orderInfo.orderStatus = uint8(OrderStatus.FULLY_FILLED);\n return orderInfo;\n }\n\n // Validate order expiration\n // solhint-disable-next-line not-rely-on-time\n if (block.timestamp >= order.expirationTimeSeconds) {\n orderInfo.orderStatus = uint8(OrderStatus.EXPIRED);\n return orderInfo;\n }\n\n // Check if order has been cancelled\n if (cancelled[orderInfo.orderHash]) {\n orderInfo.orderStatus = uint8(OrderStatus.CANCELLED);\n return orderInfo;\n }\n if (orderEpoch[order.makerAddress][order.senderAddress] > order.salt) {\n orderInfo.orderStatus = uint8(OrderStatus.CANCELLED);\n return orderInfo;\n }\n\n // All other statuses are ruled out: order is Fillable\n orderInfo.orderStatus = uint8(OrderStatus.FILLABLE);\n return orderInfo;\n }\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderInternal(\n Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n // Fetch order info\n OrderInfo memory orderInfo = getOrderInfo(order);\n\n // Fetch taker address\n address takerAddress = getCurrentContextAddress();\n \n // Assert that the order is fillable by taker\n assertFillableOrder(\n order,\n orderInfo,\n takerAddress,\n signature\n );\n \n // Get amount of takerAsset to fill\n uint256 remainingTakerAssetAmount = safeSub(order.takerAssetAmount, orderInfo.orderTakerAssetFilledAmount);\n uint256 takerAssetFilledAmount = min256(takerAssetFillAmount, remainingTakerAssetAmount);\n\n // Validate context\n assertValidFill(\n order,\n orderInfo,\n takerAssetFillAmount,\n takerAssetFilledAmount,\n fillResults.makerAssetFilledAmount\n );\n\n // Compute proportional fill amounts\n fillResults = calculateFillResults(order, takerAssetFilledAmount);\n\n // Update exchange internal state\n updateFilledState(\n order,\n takerAddress,\n orderInfo.orderHash,\n orderInfo.orderTakerAssetFilledAmount,\n fillResults\n );\n \n // Settle order\n settleOrder(\n order,\n takerAddress,\n fillResults\n );\n\n return fillResults;\n }\n\n /// @dev After calling, the order can not be filled anymore.\n /// Throws if order is invalid or sender does not have permission to cancel.\n /// @param order Order to cancel. Order must be OrderStatus.FILLABLE.\n function cancelOrderInternal(Order memory order)\n internal\n {\n // Fetch current order status\n OrderInfo memory orderInfo = getOrderInfo(order);\n\n // Validate context\n assertValidCancel(order, orderInfo);\n\n // Perform cancel\n updateCancelledState(order, orderInfo.orderHash);\n }\n\n /// @dev Updates state with results of a fill order.\n /// @param order that was filled.\n /// @param takerAddress Address of taker who filled the order.\n /// @param orderTakerAssetFilledAmount Amount of order already filled.\n function updateFilledState(\n Order memory order,\n address takerAddress,\n bytes32 orderHash,\n uint256 orderTakerAssetFilledAmount,\n FillResults memory fillResults\n )\n internal\n {\n // Update state\n filled[orderHash] = safeAdd(orderTakerAssetFilledAmount, fillResults.takerAssetFilledAmount);\n\n // Log order\n emit Fill(\n order.makerAddress,\n order.feeRecipientAddress,\n takerAddress,\n msg.sender,\n fillResults.makerAssetFilledAmount,\n fillResults.takerAssetFilledAmount,\n fillResults.makerFeePaid,\n fillResults.takerFeePaid,\n orderHash,\n order.makerAssetData,\n order.takerAssetData\n );\n }\n\n /// @dev Updates state with results of cancelling an order.\n /// State is only updated if the order is currently fillable.\n /// Otherwise, updating state would have no effect.\n /// @param order that was cancelled.\n /// @param orderHash Hash of order that was cancelled.\n function updateCancelledState(\n Order memory order,\n bytes32 orderHash\n )\n internal\n {\n // Perform cancel\n cancelled[orderHash] = true;\n\n // Log cancel\n emit Cancel(\n order.makerAddress,\n order.feeRecipientAddress,\n msg.sender,\n orderHash,\n order.makerAssetData,\n order.takerAssetData\n );\n }\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAddress Address of order taker.\n /// @param signature Proof that the orders was created by its maker.\n function assertFillableOrder(\n Order memory order,\n OrderInfo memory orderInfo,\n address takerAddress,\n bytes memory signature\n )\n internal\n view\n {\n // An order can only be filled if its status is FILLABLE.\n require(\n orderInfo.orderStatus == uint8(OrderStatus.FILLABLE),\n \"ORDER_UNFILLABLE\"\n );\n \n // Validate sender is allowed to fill this order\n if (order.senderAddress != address(0)) {\n require(\n order.senderAddress == msg.sender,\n \"INVALID_SENDER\"\n );\n }\n \n // Validate taker is allowed to fill this order\n if (order.takerAddress != address(0)) {\n require(\n order.takerAddress == takerAddress,\n \"INVALID_TAKER\"\n );\n }\n \n // Validate Maker signature (check only if first time seen)\n if (orderInfo.orderTakerAssetFilledAmount == 0) {\n require(\n isValidSignature(\n orderInfo.orderHash,\n order.makerAddress,\n signature\n ),\n \"INVALID_ORDER_SIGNATURE\"\n );\n }\n }\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAssetFillAmount Desired amount of order to fill by taker.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @param makerAssetFilledAmount Amount of makerAsset that will be transfered.\n function assertValidFill(\n Order memory order,\n OrderInfo memory orderInfo,\n uint256 takerAssetFillAmount, // TODO: use FillResults\n uint256 takerAssetFilledAmount,\n uint256 makerAssetFilledAmount\n )\n internal\n view\n {\n // Revert if fill amount is invalid\n // TODO: reconsider necessity for v2.1\n require(\n takerAssetFillAmount != 0,\n \"INVALID_TAKER_AMOUNT\"\n );\n \n // Make sure taker does not pay more than desired amount\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n takerAssetFilledAmount <= takerAssetFillAmount,\n \"TAKER_OVERPAY\"\n );\n \n // Make sure order is not overfilled\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n safeAdd(orderInfo.orderTakerAssetFilledAmount, takerAssetFilledAmount) <= order.takerAssetAmount,\n \"ORDER_OVERFILL\"\n );\n \n // Make sure order is filled at acceptable price.\n // The order has an implied price from the makers perspective:\n // order price = order.makerAssetAmount / order.takerAssetAmount\n // i.e. the number of makerAsset maker is paying per takerAsset. The\n // maker is guaranteed to get this price or a better (lower) one. The\n // actual price maker is getting in this fill is:\n // fill price = makerAssetFilledAmount / takerAssetFilledAmount\n // We need `fill price <= order price` for the fill to be fair to maker.\n // This amounts to:\n // makerAssetFilledAmount order.makerAssetAmount\n // ------------------------ <= -----------------------\n // takerAssetFilledAmount order.takerAssetAmount\n // or, equivalently:\n // makerAssetFilledAmount * order.takerAssetAmount <=\n // order.makerAssetAmount * takerAssetFilledAmount\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n safeMul(makerAssetFilledAmount, order.takerAssetAmount)\n <= \n safeMul(order.makerAssetAmount, takerAssetFilledAmount),\n \"INVALID_FILL_PRICE\"\n );\n }\n\n /// @dev Validates context for cancelOrder. Succeeds or throws.\n /// @param order to be cancelled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n function assertValidCancel(\n Order memory order,\n OrderInfo memory orderInfo\n )\n internal\n view\n {\n // Ensure order is valid\n // An order can only be cancelled if its status is FILLABLE.\n require(\n orderInfo.orderStatus == uint8(OrderStatus.FILLABLE),\n \"ORDER_UNFILLABLE\"\n );\n\n // Validate sender is allowed to cancel this order\n if (order.senderAddress != address(0)) {\n require(\n order.senderAddress == msg.sender,\n \"INVALID_SENDER\"\n );\n }\n\n // Validate transaction signed by maker\n address makerAddress = getCurrentContextAddress();\n require(\n order.makerAddress == makerAddress,\n \"INVALID_MAKER\"\n );\n }\n\n /// @dev Calculates amounts filled and fees paid by maker and taker.\n /// @param order to be filled.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function calculateFillResults(\n Order memory order,\n uint256 takerAssetFilledAmount\n )\n internal\n pure\n returns (FillResults memory fillResults)\n {\n // Compute proportional transfer amounts\n fillResults.takerAssetFilledAmount = takerAssetFilledAmount;\n fillResults.makerAssetFilledAmount = safeGetPartialAmountFloor(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.makerAssetAmount\n );\n fillResults.makerFeePaid = safeGetPartialAmountFloor(\n fillResults.makerAssetFilledAmount,\n order.makerAssetAmount,\n order.makerFee\n );\n fillResults.takerFeePaid = safeGetPartialAmountFloor(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.takerFee\n );\n\n return fillResults;\n }\n\n /// @dev Settles an order by transferring assets between counterparties.\n /// @param order Order struct containing order specifications.\n /// @param takerAddress Address selling takerAsset and buying makerAsset.\n /// @param fillResults Amounts to be filled and fees paid by maker and taker.\n function settleOrder(\n LibOrder.Order memory order,\n address takerAddress,\n LibFillResults.FillResults memory fillResults\n )\n private\n {\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n dispatchTransferFrom(\n order.makerAssetData,\n order.makerAddress,\n takerAddress,\n fillResults.makerAssetFilledAmount\n );\n dispatchTransferFrom(\n order.takerAssetData,\n takerAddress,\n order.makerAddress,\n fillResults.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n zrxAssetData,\n order.makerAddress,\n order.feeRecipientAddress,\n fillResults.makerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n order.feeRecipientAddress,\n fillResults.takerFeePaid\n );\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinMatchOrders.sol": "/*\n Copyright 2018 ZeroEx Intl.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n http://www.apache.org/licenses/LICENSE-2.0\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MMatchOrders.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\n\n\ncontract MixinMatchOrders is\n ReentrancyGuard,\n LibConstants,\n LibMath,\n MAssetProxyDispatcher,\n MExchangeCore,\n MMatchOrders,\n MTransactions\n{\n /// @dev Match two complementary orders that have a profitable spread.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the left order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftSignature Proof that order was created by the left maker.\n /// @param rightSignature Proof that order was created by the right maker.\n /// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.\n function matchOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n bytes memory leftSignature,\n bytes memory rightSignature\n )\n public\n nonReentrant\n returns (LibFillResults.MatchedFillResults memory matchedFillResults)\n {\n // We assume that rightOrder.takerAssetData == leftOrder.makerAssetData and rightOrder.makerAssetData == leftOrder.takerAssetData.\n // If this assumption isn't true, the match will fail at signature validation.\n rightOrder.makerAssetData = leftOrder.takerAssetData;\n rightOrder.takerAssetData = leftOrder.makerAssetData;\n\n // Get left & right order info\n LibOrder.OrderInfo memory leftOrderInfo = getOrderInfo(leftOrder);\n LibOrder.OrderInfo memory rightOrderInfo = getOrderInfo(rightOrder);\n\n // Fetch taker address\n address takerAddress = getCurrentContextAddress();\n \n // Either our context is valid or we revert\n assertFillableOrder(\n leftOrder,\n leftOrderInfo,\n takerAddress,\n leftSignature\n );\n assertFillableOrder(\n rightOrder,\n rightOrderInfo,\n takerAddress,\n rightSignature\n );\n assertValidMatch(leftOrder, rightOrder);\n\n // Compute proportional fill amounts\n matchedFillResults = calculateMatchedFillResults(\n leftOrder,\n rightOrder,\n leftOrderInfo.orderTakerAssetFilledAmount,\n rightOrderInfo.orderTakerAssetFilledAmount\n );\n\n // Validate fill contexts\n assertValidFill(\n leftOrder,\n leftOrderInfo,\n matchedFillResults.left.takerAssetFilledAmount,\n matchedFillResults.left.takerAssetFilledAmount,\n matchedFillResults.left.makerAssetFilledAmount\n );\n assertValidFill(\n rightOrder,\n rightOrderInfo,\n matchedFillResults.right.takerAssetFilledAmount,\n matchedFillResults.right.takerAssetFilledAmount,\n matchedFillResults.right.makerAssetFilledAmount\n );\n \n // Update exchange state\n updateFilledState(\n leftOrder,\n takerAddress,\n leftOrderInfo.orderHash,\n leftOrderInfo.orderTakerAssetFilledAmount,\n matchedFillResults.left\n );\n updateFilledState(\n rightOrder,\n takerAddress,\n rightOrderInfo.orderHash,\n rightOrderInfo.orderTakerAssetFilledAmount,\n matchedFillResults.right\n );\n\n // Settle matched orders. Succeeds or throws.\n settleMatchedOrders(\n leftOrder,\n rightOrder,\n takerAddress,\n matchedFillResults\n );\n\n return matchedFillResults;\n }\n\n /// @dev Validates context for matchOrders. Succeeds or throws.\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n function assertValidMatch(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder\n )\n internal\n pure\n {\n // Make sure there is a profitable spread.\n // There is a profitable spread iff the cost per unit bought (OrderA.MakerAmount/OrderA.TakerAmount) for each order is greater\n // than the profit per unit sold of the matched order (OrderB.TakerAmount/OrderB.MakerAmount).\n // This is satisfied by the equations below:\n // <leftOrder.makerAssetAmount> / <leftOrder.takerAssetAmount> >= <rightOrder.takerAssetAmount> / <rightOrder.makerAssetAmount>\n // AND\n // <rightOrder.makerAssetAmount> / <rightOrder.takerAssetAmount> >= <leftOrder.takerAssetAmount> / <leftOrder.makerAssetAmount>\n // These equations can be combined to get the following:\n require(\n safeMul(leftOrder.makerAssetAmount, rightOrder.makerAssetAmount) >=\n safeMul(leftOrder.takerAssetAmount, rightOrder.takerAssetAmount),\n \"NEGATIVE_SPREAD_REQUIRED\"\n );\n }\n\n /// @dev Calculates fill amounts for the matched orders.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the leftOrder order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftOrderTakerAssetFilledAmount Amount of left order already filled.\n /// @param rightOrderTakerAssetFilledAmount Amount of right order already filled.\n /// @param matchedFillResults Amounts to fill and fees to pay by maker and taker of matched orders.\n function calculateMatchedFillResults(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n uint256 leftOrderTakerAssetFilledAmount,\n uint256 rightOrderTakerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.MatchedFillResults memory matchedFillResults)\n {\n // Derive maker asset amounts for left & right orders, given store taker assert amounts\n uint256 leftTakerAssetAmountRemaining = safeSub(leftOrder.takerAssetAmount, leftOrderTakerAssetFilledAmount);\n uint256 leftMakerAssetAmountRemaining = safeGetPartialAmountFloor(\n leftOrder.makerAssetAmount,\n leftOrder.takerAssetAmount,\n leftTakerAssetAmountRemaining\n );\n uint256 rightTakerAssetAmountRemaining = safeSub(rightOrder.takerAssetAmount, rightOrderTakerAssetFilledAmount);\n uint256 rightMakerAssetAmountRemaining = safeGetPartialAmountFloor(\n rightOrder.makerAssetAmount,\n rightOrder.takerAssetAmount,\n rightTakerAssetAmountRemaining\n );\n\n // Calculate fill results for maker and taker assets: at least one order will be fully filled.\n // The maximum amount the left maker can buy is `leftTakerAssetAmountRemaining`\n // The maximum amount the right maker can sell is `rightMakerAssetAmountRemaining`\n // We have two distinct cases for calculating the fill results:\n // Case 1.\n // If the left maker can buy more than the right maker can sell, then only the right order is fully filled.\n // If the left maker can buy exactly what the right maker can sell, then both orders are fully filled.\n // Case 2.\n // If the left maker cannot buy more than the right maker can sell, then only the left order is fully filled.\n if (leftTakerAssetAmountRemaining >= rightMakerAssetAmountRemaining) {\n // Case 1: Right order is fully filled\n matchedFillResults.right.makerAssetFilledAmount = rightMakerAssetAmountRemaining;\n matchedFillResults.right.takerAssetFilledAmount = rightTakerAssetAmountRemaining;\n matchedFillResults.left.takerAssetFilledAmount = matchedFillResults.right.makerAssetFilledAmount;\n // Round down to ensure the maker's exchange rate does not exceed the price specified by the order. \n // We favor the maker when the exchange rate must be rounded.\n matchedFillResults.left.makerAssetFilledAmount = safeGetPartialAmountFloor(\n leftOrder.makerAssetAmount,\n leftOrder.takerAssetAmount,\n matchedFillResults.left.takerAssetFilledAmount\n );\n } else {\n // Case 2: Left order is fully filled\n matchedFillResults.left.makerAssetFilledAmount = leftMakerAssetAmountRemaining;\n matchedFillResults.left.takerAssetFilledAmount = leftTakerAssetAmountRemaining;\n matchedFillResults.right.makerAssetFilledAmount = matchedFillResults.left.takerAssetFilledAmount;\n // Round up to ensure the maker's exchange rate does not exceed the price specified by the order.\n // We favor the maker when the exchange rate must be rounded.\n matchedFillResults.right.takerAssetFilledAmount = safeGetPartialAmountCeil(\n rightOrder.takerAssetAmount,\n rightOrder.makerAssetAmount,\n matchedFillResults.right.makerAssetFilledAmount\n );\n }\n\n // Calculate amount given to taker\n matchedFillResults.leftMakerAssetSpreadAmount = safeSub(\n matchedFillResults.left.makerAssetFilledAmount,\n matchedFillResults.right.takerAssetFilledAmount\n );\n\n // Compute fees for left order\n matchedFillResults.left.makerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.left.makerAssetFilledAmount,\n leftOrder.makerAssetAmount,\n leftOrder.makerFee\n );\n matchedFillResults.left.takerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.left.takerAssetFilledAmount,\n leftOrder.takerAssetAmount,\n leftOrder.takerFee\n );\n\n // Compute fees for right order\n matchedFillResults.right.makerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.right.makerAssetFilledAmount,\n rightOrder.makerAssetAmount,\n rightOrder.makerFee\n );\n matchedFillResults.right.takerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.right.takerAssetFilledAmount,\n rightOrder.takerAssetAmount,\n rightOrder.takerFee\n );\n\n // Return fill results\n return matchedFillResults;\n }\n\n /// @dev Settles matched order by transferring appropriate funds between order makers, taker, and fee recipient.\n /// @param leftOrder First matched order.\n /// @param rightOrder Second matched order.\n /// @param takerAddress Address that matched the orders. The taker receives the spread between orders as profit.\n /// @param matchedFillResults Struct holding amounts to transfer between makers, taker, and fee recipients.\n function settleMatchedOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n address takerAddress,\n LibFillResults.MatchedFillResults memory matchedFillResults\n )\n private\n {\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n // Order makers and taker\n dispatchTransferFrom(\n leftOrder.makerAssetData,\n leftOrder.makerAddress,\n rightOrder.makerAddress,\n matchedFillResults.right.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n rightOrder.makerAssetData,\n rightOrder.makerAddress,\n leftOrder.makerAddress,\n matchedFillResults.left.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n leftOrder.makerAssetData,\n leftOrder.makerAddress,\n takerAddress,\n matchedFillResults.leftMakerAssetSpreadAmount\n );\n\n // Maker fees\n dispatchTransferFrom(\n zrxAssetData,\n leftOrder.makerAddress,\n leftOrder.feeRecipientAddress,\n matchedFillResults.left.makerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n rightOrder.makerAddress,\n rightOrder.feeRecipientAddress,\n matchedFillResults.right.makerFeePaid\n );\n\n // Taker fees\n if (leftOrder.feeRecipientAddress == rightOrder.feeRecipientAddress) {\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n leftOrder.feeRecipientAddress,\n safeAdd(\n matchedFillResults.left.takerFeePaid,\n matchedFillResults.right.takerFeePaid\n )\n );\n } else {\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n leftOrder.feeRecipientAddress,\n matchedFillResults.left.takerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n rightOrder.feeRecipientAddress,\n matchedFillResults.right.takerFeePaid\n );\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinSignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./interfaces/IWallet.sol\";\nimport \"./interfaces/IValidator.sol\";\n\n\ncontract MixinSignatureValidator is\n ReentrancyGuard,\n MSignatureValidator,\n MTransactions\n{\n using LibBytes for bytes;\n \n // Mapping of hash => signer => signed\n mapping (bytes32 => mapping (address => bool)) public preSigned;\n\n // Mapping of signer => validator => approved\n mapping (address => mapping (address => bool)) public allowedValidators;\n\n /// @dev Approves a hash on-chain using any valid signature type.\n /// After presigning a hash, the preSign signature type will become valid for that hash and signer.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n function preSign(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external\n {\n if (signerAddress != msg.sender) {\n require(\n isValidSignature(\n hash,\n signerAddress,\n signature\n ),\n \"INVALID_SIGNATURE\"\n );\n }\n preSigned[hash][signerAddress] = true;\n }\n\n /// @dev Approves/unnapproves a Validator contract to verify signatures on signer's behalf.\n /// @param validatorAddress Address of Validator contract.\n /// @param approval Approval or disapproval of Validator contract.\n function setSignatureValidatorApproval(\n address validatorAddress,\n bool approval\n )\n external\n nonReentrant\n {\n address signerAddress = getCurrentContextAddress();\n allowedValidators[signerAddress][validatorAddress] = approval;\n emit SignatureValidatorApproval(\n signerAddress,\n validatorAddress,\n approval\n );\n }\n\n /// @dev Verifies that a hash has been signed by the given signer.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes memory signature\n )\n public\n view\n returns (bool isValid)\n {\n require(\n signature.length > 0,\n \"LENGTH_GREATER_THAN_0_REQUIRED\"\n );\n\n // Pop last byte off of signature byte array.\n uint8 signatureTypeRaw = uint8(signature.popLastByte());\n\n // Ensure signature is supported\n require(\n signatureTypeRaw < uint8(SignatureType.NSignatureTypes),\n \"SIGNATURE_UNSUPPORTED\"\n );\n\n SignatureType signatureType = SignatureType(signatureTypeRaw);\n\n // Variables are not scoped in Solidity.\n uint8 v;\n bytes32 r;\n bytes32 s;\n address recovered;\n\n // Always illegal signature.\n // This is always an implicit option since a signer can create a\n // signature array with invalid type or length. We may as well make\n // it an explicit option. This aids testing and analysis. It is\n // also the initialization value for the enum type.\n if (signatureType == SignatureType.Illegal) {\n revert(\"SIGNATURE_ILLEGAL\");\n\n // Always invalid signature.\n // Like Illegal, this is always implicitly available and therefore\n // offered explicitly. It can be implicitly created by providing\n // a correctly formatted but incorrect signature.\n } else if (signatureType == SignatureType.Invalid) {\n require(\n signature.length == 0,\n \"LENGTH_0_REQUIRED\"\n );\n isValid = false;\n return isValid;\n\n // Signature using EIP712\n } else if (signatureType == SignatureType.EIP712) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n hash,\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n\n // Signed using web3.eth_sign\n } else if (signatureType == SignatureType.EthSign) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n keccak256(abi.encodePacked(\n \"\\x19Ethereum Signed Message:\\n32\",\n hash\n )),\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n\n // Signature verified by wallet contract.\n // If used with an order, the maker of the order is the wallet contract.\n } else if (signatureType == SignatureType.Wallet) {\n isValid = isValidWalletSignature(\n hash,\n signerAddress,\n signature\n );\n return isValid;\n\n // Signature verified by validator contract.\n // If used with an order, the maker of the order can still be an EOA.\n // A signature using this type should be encoded as:\n // | Offset | Length | Contents |\n // | 0x00 | x | Signature to validate |\n // | 0x00 + x | 20 | Address of validator contract |\n // | 0x14 + x | 1 | Signature type is always \"\\x06\" |\n } else if (signatureType == SignatureType.Validator) {\n // Pop last 20 bytes off of signature byte array.\n address validatorAddress = signature.popLast20Bytes();\n \n // Ensure signer has approved validator.\n if (!allowedValidators[signerAddress][validatorAddress]) {\n return false;\n }\n isValid = isValidValidatorSignature(\n validatorAddress,\n hash,\n signerAddress,\n signature\n );\n return isValid;\n\n // Signer signed hash previously using the preSign function.\n } else if (signatureType == SignatureType.PreSigned) {\n isValid = preSigned[hash][signerAddress];\n return isValid;\n }\n\n // Anything else is illegal (We do not return false because\n // the signature may actually be valid, just not in a format\n // that we currently support. In this case returning false\n // may lead the caller to incorrectly believe that the\n // signature was invalid.)\n revert(\"SIGNATURE_UNSUPPORTED\");\n }\n\n /// @dev Verifies signature using logic defined by Wallet contract.\n /// @param hash Any 32 byte hash.\n /// @param walletAddress Address that should have signed the given hash\n /// and defines its own signature verification method.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if signature is valid for given wallet..\n function isValidWalletSignature(\n bytes32 hash,\n address walletAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid)\n {\n bytes memory calldata = abi.encodeWithSelector(\n IWallet(walletAddress).isValidSignature.selector,\n hash,\n signature\n );\n assembly {\n let cdStart := add(calldata, 32)\n let success := staticcall(\n gas, // forward all gas\n walletAddress, // address of Wallet contract\n cdStart, // pointer to start of input\n mload(calldata), // length of input\n cdStart, // write output over input\n 32 // output size is 32 bytes\n )\n\n switch success\n case 0 {\n // Revert with `Error(\"WALLET_ERROR\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000c57414c4c45545f4552524f5200000000000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n case 1 {\n // Signature is valid if call did not revert and returned true\n isValid := mload(cdStart)\n }\n }\n return isValid;\n }\n\n /// @dev Verifies signature using logic defined by Validator contract.\n /// @param validatorAddress Address of validator contract.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidValidatorSignature(\n address validatorAddress,\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid)\n {\n bytes memory calldata = abi.encodeWithSelector(\n IValidator(signerAddress).isValidSignature.selector,\n hash,\n signerAddress,\n signature\n );\n assembly {\n let cdStart := add(calldata, 32)\n let success := staticcall(\n gas, // forward all gas\n validatorAddress, // address of Validator contract\n cdStart, // pointer to start of input\n mload(calldata), // length of input\n cdStart, // write output over input\n 32 // output size is 32 bytes\n )\n\n switch success\n case 0 {\n // Revert with `Error(\"VALIDATOR_ERROR\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f56414c494441544f525f4552524f5200000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n case 1 {\n // Signature is valid if call did not revert and returned true\n isValid := mload(cdStart)\n }\n }\n return isValid;\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinTransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\nimport \"./libs/LibExchangeErrors.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./libs/LibEIP712.sol\";\n\n\ncontract MixinTransactions is\n LibEIP712,\n MSignatureValidator,\n MTransactions\n{\n // Mapping of transaction hash => executed\n // This prevents transactions from being executed more than once.\n mapping (bytes32 => bool) public transactions;\n\n // Address of current transaction signer\n address public currentContextAddress;\n\n /// @dev Executes an exchange method call in the context of signer.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @param signature Proof of signer transaction by signer.\n function executeTransaction(\n uint256 salt,\n address signerAddress,\n bytes data,\n bytes signature\n )\n external\n {\n // Prevent reentrancy\n require(\n currentContextAddress == address(0),\n \"REENTRANCY_ILLEGAL\"\n );\n\n bytes32 transactionHash = hashEIP712Message(hashZeroExTransaction(\n salt,\n signerAddress,\n data\n ));\n\n // Validate transaction has not been executed\n require(\n !transactions[transactionHash],\n \"INVALID_TX_HASH\"\n );\n\n // Transaction always valid if signer is sender of transaction\n if (signerAddress != msg.sender) {\n // Validate signature\n require(\n isValidSignature(\n transactionHash,\n signerAddress,\n signature\n ),\n \"INVALID_TX_SIGNATURE\"\n );\n\n // Set the current transaction signer\n currentContextAddress = signerAddress;\n }\n\n // Execute transaction\n transactions[transactionHash] = true;\n require(\n address(this).delegatecall(data),\n \"FAILED_EXECUTION\"\n );\n\n // Reset current transaction signer if it was previously updated\n if (signerAddress != msg.sender) {\n currentContextAddress = address(0);\n }\n }\n\n /// @dev Calculates EIP712 hash of the Transaction.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @return EIP712 hash of the Transaction.\n function hashZeroExTransaction(\n uint256 salt,\n address signerAddress,\n bytes memory data\n )\n internal\n pure\n returns (bytes32 result)\n {\n bytes32 schemaHash = EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH;\n bytes32 dataHash = keccak256(data);\n\n // Assembly for more efficiently computing:\n // keccak256(abi.encodePacked(\n // EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH,\n // salt,\n // bytes32(signerAddress),\n // keccak256(data)\n // ));\n\n assembly {\n // Load free memory pointer\n let memPtr := mload(64)\n\n mstore(memPtr, schemaHash) // hash of schema\n mstore(add(memPtr, 32), salt) // salt\n mstore(add(memPtr, 64), and(signerAddress, 0xffffffffffffffffffffffffffffffffffffffff)) // signerAddress\n mstore(add(memPtr, 96), dataHash) // hash of data\n\n // Compute hash\n result := keccak256(memPtr, 128)\n }\n return result;\n }\n\n /// @dev The current function will be called in the context of this address (either 0x transaction signer or `msg.sender`).\n /// If calling a fill function, this address will represent the taker.\n /// If calling a cancel function, this address will represent the maker.\n /// @return Signer of 0x transaction if entry point is `executeTransaction`.\n /// `msg.sender` if entry point is any other function.\n function getCurrentContextAddress()\n internal\n view\n returns (address)\n {\n address currentContextAddress_ = currentContextAddress;\n address contextAddress = currentContextAddress_ == address(0) ? msg.sender : currentContextAddress_;\n return contextAddress;\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./libs/LibAbiEncoder.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MWrapperFunctions.sol\";\n\n\ncontract MixinWrapperFunctions is\n ReentrancyGuard,\n LibMath,\n LibFillResults,\n LibAbiEncoder,\n MExchangeCore,\n MWrapperFunctions\n{\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n nonReentrant\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrKillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n return fillResults;\n }\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (FillResults memory fillResults)\n {\n // ABI encode calldata for `fillOrder`\n bytes memory fillOrderCalldata = abiEncodeFillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n\n // Delegate to `fillOrder` and handle any exceptions gracefully\n assembly {\n let success := delegatecall(\n gas, // forward all gas\n address, // call address of this contract\n add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes)\n mload(fillOrderCalldata), // length of input\n fillOrderCalldata, // write output over input\n 128 // output size is 128 bytes\n )\n if success {\n mstore(fillResults, mload(fillOrderCalldata))\n mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32)))\n mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64)))\n mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96)))\n }\n }\n // fillResults values will be 0 by default if call was unsuccessful\n return fillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrKill.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrKillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrKillOrderInternal(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrders(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n bytes memory takerAssetData = orders[0].takerAssetData;\n \n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being sold by taker is the same for each order.\n // Rather than passing this in as calldata, we use the takerAssetData from the first order in all later orders.\n orders[i].takerAssetData = takerAssetData;\n\n // Calculate the remaining amount of takerAsset to sell\n uint256 remainingTakerAssetFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= takerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory takerAssetData = orders[0].takerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being sold by taker is the same for each order.\n // Rather than passing this in as calldata, we use the takerAssetData from the first order in all later orders.\n orders[i].takerAssetData = takerAssetData;\n\n // Calculate the remaining amount of takerAsset to sell\n uint256 remainingTakerAssetFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= takerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerAsset is bought by taker.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrders(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // Rather than passing this in as calldata, we copy the makerAssetData from the first order onto all later orders.\n orders[i].makerAssetData = makerAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n if (totalFillResults.makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // Rather than passing this in as calldata, we copy the makerAssetData from the first order onto all later orders.\n orders[i].makerAssetData = makerAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n if (totalFillResults.makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously cancels multiple orders in a single transaction.\n /// @param orders Array of order specifications.\n function batchCancelOrders(LibOrder.Order[] memory orders)\n public\n nonReentrant\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n cancelOrderInternal(orders[i]);\n }\n }\n\n /// @dev Fetches information for all passed in orders.\n /// @param orders Array of order specifications.\n /// @return Array of OrderInfo instances that correspond to each order.\n function getOrdersInfo(LibOrder.Order[] memory orders)\n public\n view\n returns (LibOrder.OrderInfo[] memory)\n {\n uint256 ordersLength = orders.length;\n LibOrder.OrderInfo[] memory ordersInfo = new LibOrder.OrderInfo[](ordersLength);\n for (uint256 i = 0; i != ordersLength; i++) {\n ordersInfo[i] = getOrderInfo(orders[i]);\n }\n return ordersInfo;\n }\n\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n require(\n fillResults.takerAssetFilledAmount == takerAssetFillAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return fillResults;\n }\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IAssetProxyDispatcher {\n\n /// @dev Registers an asset proxy to its asset proxy id.\n /// Once an asset proxy is registered, it cannot be unregistered.\n /// @param assetProxy Address of new asset proxy to register.\n function registerAssetProxy(address assetProxy)\n external;\n\n /// @dev Gets an asset proxy.\n /// @param assetProxyId Id of the asset proxy.\n /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered.\n function getAssetProxy(bytes4 assetProxyId)\n external\n view\n returns (address);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IExchange.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./IExchangeCore.sol\";\nimport \"./IMatchOrders.sol\";\nimport \"./ISignatureValidator.sol\";\nimport \"./ITransactions.sol\";\nimport \"./IAssetProxyDispatcher.sol\";\nimport \"./IWrapperFunctions.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract IExchange is\n IExchangeCore,\n IMatchOrders,\n ISignatureValidator,\n ITransactions,\n IAssetProxyDispatcher,\n IWrapperFunctions\n{}\n",
- "2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IExchangeCore {\n\n /// @dev Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch\n /// and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress).\n /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled.\n function cancelOrdersUpTo(uint256 targetOrderEpoch)\n external;\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev After calling, the order can not be filled anymore.\n /// @param order Order struct containing order specifications.\n function cancelOrder(LibOrder.Order memory order)\n public;\n\n /// @dev Gets information about an order: status, hash, and amount filled.\n /// @param order Order to gather information on.\n /// @return OrderInfo Information about the order and its state.\n /// See LibOrder.OrderInfo for a complete description.\n function getOrderInfo(LibOrder.Order memory order)\n public\n view\n returns (LibOrder.OrderInfo memory orderInfo);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IMatchOrders {\n\n /// @dev Match two complementary orders that have a profitable spread.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the left order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftSignature Proof that order was created by the left maker.\n /// @param rightSignature Proof that order was created by the right maker.\n /// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.\n function matchOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n bytes memory leftSignature,\n bytes memory rightSignature\n )\n public\n returns (LibFillResults.MatchedFillResults memory matchedFillResults);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract ISignatureValidator {\n\n /// @dev Approves a hash on-chain using any valid signature type.\n /// After presigning a hash, the preSign signature type will become valid for that hash and signer.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n function preSign(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external;\n \n /// @dev Approves/unnapproves a Validator contract to verify signatures on signer's behalf.\n /// @param validatorAddress Address of Validator contract.\n /// @param approval Approval or disapproval of Validator contract.\n function setSignatureValidatorApproval(\n address validatorAddress,\n bool approval\n )\n external;\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signerAddress Address of signer.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes memory signature\n )\n public\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/ITransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\n\ncontract ITransactions {\n\n /// @dev Executes an exchange method call in the context of signer.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @param signature Proof of signer transaction by signer.\n function executeTransaction(\n uint256 salt,\n address signerAddress,\n bytes data,\n bytes signature\n )\n external;\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IValidator {\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IWallet.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IWallet {\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n bytes signature\n )\n external\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IWrapperFunctions {\n\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrKill.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrKillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrders(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerAsset is bought by taker.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrders(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously cancels multiple orders in a single transaction.\n /// @param orders Array of order specifications.\n function batchCancelOrders(LibOrder.Order[] memory orders)\n public;\n\n /// @dev Fetches information for all passed in orders\n /// @param orders Array of order specifications.\n /// @return Array of OrderInfo instances that correspond to each order.\n function getOrdersInfo(LibOrder.Order[] memory orders)\n public\n view\n returns (LibOrder.OrderInfo[] memory);\n}\n",
- "2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./LibOrder.sol\";\n\n\ncontract LibAbiEncoder {\n\n /// @dev ABI encodes calldata for `fillOrder`.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return ABI encoded calldata for `fillOrder`.\n function abiEncodeFillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n pure\n returns (bytes memory fillOrderCalldata)\n {\n // We need to call MExchangeCore.fillOrder using a delegatecall in\n // assembly so that we can intercept a call that throws. For this, we\n // need the input encoded in memory in the Ethereum ABIv2 format [1].\n\n // | Area | Offset | Length | Contents |\n // | -------- |--------|---------|-------------------------------------------- |\n // | Header | 0x00 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 0x00 | | 1. offset to order (*) |\n // | | 0x20 | | 2. takerAssetFillAmount |\n // | | 0x40 | | 3. offset to signature (*) |\n // | Data | | 12 * 32 | order: |\n // | | 0x000 | | 1. senderAddress |\n // | | 0x020 | | 2. makerAddress |\n // | | 0x040 | | 3. takerAddress |\n // | | 0x060 | | 4. feeRecipientAddress |\n // | | 0x080 | | 5. makerAssetAmount |\n // | | 0x0A0 | | 6. takerAssetAmount |\n // | | 0x0C0 | | 7. makerFeeAmount |\n // | | 0x0E0 | | 8. takerFeeAmount |\n // | | 0x100 | | 9. expirationTimeSeconds |\n // | | 0x120 | | 10. salt |\n // | | 0x140 | | 11. Offset to makerAssetData (*) |\n // | | 0x160 | | 12. Offset to takerAssetData (*) |\n // | | 0x180 | 32 | makerAssetData Length |\n // | | 0x1A0 | ** | makerAssetData Contents |\n // | | 0x1C0 | 32 | takerAssetData Length |\n // | | 0x1E0 | ** | takerAssetData Contents |\n // | | 0x200 | 32 | signature Length |\n // | | 0x220 | ** | signature Contents |\n\n // * Offsets are calculated from the beginning of the current area: Header, Params, Data:\n // An offset stored in the Params area is calculated from the beginning of the Params section.\n // An offset stored in the Data area is calculated from the beginning of the Data section.\n\n // ** The length of dynamic array contents are stored in the field immediately preceeding the contents.\n\n // [1]: https://solidity.readthedocs.io/en/develop/abi-spec.html\n\n assembly {\n\n // Areas below may use the following variables:\n // 1. <area>Start -- Start of this area in memory\n // 2. <area>End -- End of this area in memory. This value may\n // be precomputed (before writing contents),\n // or it may be computed as contents are written.\n // 3. <area>Offset -- Current offset into area. If an area's End\n // is precomputed, this variable tracks the\n // offsets of contents as they are written.\n\n /////// Setup Header Area ///////\n // Load free memory pointer\n fillOrderCalldata := mload(0x40)\n // bytes4(keccak256(\"fillOrder((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),uint256,bytes)\"))\n // = 0xb4be83d5\n // Leave 0x20 bytes to store the length\n mstore(add(fillOrderCalldata, 0x20), 0xb4be83d500000000000000000000000000000000000000000000000000000000)\n let headerAreaEnd := add(fillOrderCalldata, 0x24)\n\n /////// Setup Params Area ///////\n // This area is preallocated and written to later.\n // This is because we need to fill in offsets that have not yet been calculated.\n let paramsAreaStart := headerAreaEnd\n let paramsAreaEnd := add(paramsAreaStart, 0x60)\n let paramsAreaOffset := paramsAreaStart\n\n /////// Setup Data Area ///////\n let dataAreaStart := paramsAreaEnd\n let dataAreaEnd := dataAreaStart\n\n // Offset from the source data we're reading from\n let sourceOffset := order\n // arrayLenBytes and arrayLenWords track the length of a dynamically-allocated bytes array.\n let arrayLenBytes := 0\n let arrayLenWords := 0\n\n /////// Write order Struct ///////\n // Write memory location of Order, relative to the start of the\n // parameter list, then increment the paramsAreaOffset respectively.\n mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))\n paramsAreaOffset := add(paramsAreaOffset, 0x20)\n\n // Write values for each field in the order\n // It would be nice to use a loop, but we save on gas by writing\n // the stores sequentially.\n mstore(dataAreaEnd, mload(sourceOffset)) // makerAddress\n mstore(add(dataAreaEnd, 0x20), mload(add(sourceOffset, 0x20))) // takerAddress\n mstore(add(dataAreaEnd, 0x40), mload(add(sourceOffset, 0x40))) // feeRecipientAddress\n mstore(add(dataAreaEnd, 0x60), mload(add(sourceOffset, 0x60))) // senderAddress\n mstore(add(dataAreaEnd, 0x80), mload(add(sourceOffset, 0x80))) // makerAssetAmount\n mstore(add(dataAreaEnd, 0xA0), mload(add(sourceOffset, 0xA0))) // takerAssetAmount\n mstore(add(dataAreaEnd, 0xC0), mload(add(sourceOffset, 0xC0))) // makerFeeAmount\n mstore(add(dataAreaEnd, 0xE0), mload(add(sourceOffset, 0xE0))) // takerFeeAmount\n mstore(add(dataAreaEnd, 0x100), mload(add(sourceOffset, 0x100))) // expirationTimeSeconds\n mstore(add(dataAreaEnd, 0x120), mload(add(sourceOffset, 0x120))) // salt\n mstore(add(dataAreaEnd, 0x140), mload(add(sourceOffset, 0x140))) // Offset to makerAssetData\n mstore(add(dataAreaEnd, 0x160), mload(add(sourceOffset, 0x160))) // Offset to takerAssetData\n dataAreaEnd := add(dataAreaEnd, 0x180)\n sourceOffset := add(sourceOffset, 0x180)\n\n // Write offset to <order.makerAssetData>\n mstore(add(dataAreaStart, mul(10, 0x20)), sub(dataAreaEnd, dataAreaStart))\n\n // Calculate length of <order.makerAssetData>\n sourceOffset := mload(add(order, 0x140)) // makerAssetData\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of <order.makerAssetData>\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of <order.makerAssetData>\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n // Write offset to <order.takerAssetData>\n mstore(add(dataAreaStart, mul(11, 0x20)), sub(dataAreaEnd, dataAreaStart))\n\n // Calculate length of <order.takerAssetData>\n sourceOffset := mload(add(order, 0x160)) // takerAssetData\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of <order.takerAssetData>\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of <order.takerAssetData>\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n /////// Write takerAssetFillAmount ///////\n mstore(paramsAreaOffset, takerAssetFillAmount)\n paramsAreaOffset := add(paramsAreaOffset, 0x20)\n\n /////// Write signature ///////\n // Write offset to paramsArea\n mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))\n\n // Calculate length of signature\n sourceOffset := signature\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of signature\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of signature\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n // Set length of calldata\n mstore(fillOrderCalldata, sub(dataAreaEnd, add(fillOrderCalldata, 0x20)))\n\n // Increment free memory pointer\n mstore(0x40, dataAreaEnd)\n }\n\n return fillOrderCalldata;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibConstants.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\n// solhint-disable max-line-length\ncontract LibConstants {\n \n // Asset data for ZRX token. Used for fee transfers.\n // @TODO: Hardcode constant when we deploy. Currently \n // not constant to make testing easier.\n\n // The proxyId for ZRX_ASSET_DATA is bytes4(keccak256(\"ERC20Token(address)\")) = 0xf47261b0\n \n // Kovan ZRX address is 0x6ff6c0ff1d68b964901f986d4c9fa3ac68346570.\n // The ABI encoded proxyId and address is 0xf47261b00000000000000000000000006ff6c0ff1d68b964901f986d4c9fa3ac68346570\n // bytes constant public ZRX_ASSET_DATA = \"\\xf4\\x72\\x61\\xb0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x6f\\xf6\\xc0\\xff\\x1d\\x68\\xb9\\x64\\x90\\x1f\\x98\\x6d\\x4c\\x9f\\xa3\\xac\\x68\\x34\\x65\\x70\";\n \n // Mainnet ZRX address is 0xe41d2489571d322189246dafa5ebde1f4699f498.\n // The ABI encoded proxyId and address is 0xf47261b0000000000000000000000000e41d2489571d322189246dafa5ebde1f4699f498\n // bytes constant public ZRX_ASSET_DATA = \"\\xf4\\x72\\x61\\xb0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xe4\\x1d\\x24\\x89\\x57\\x1d\\x32\\x21\\x89\\x24\\x6d\\xaf\\xa5\\xeb\\xde\\x1f\\x46\\x99\\xf4\\x98\";\n \n // solhint-disable-next-line var-name-mixedcase\n bytes public ZRX_ASSET_DATA;\n\n // @TODO: Remove when we deploy.\n constructor (bytes memory zrxAssetData)\n public\n {\n ZRX_ASSET_DATA = zrxAssetData;\n }\n}\n// solhint-enable max-line-length\n",
- "2.0.0/protocol/Exchange/libs/LibEIP712.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract LibEIP712 {\n\n // EIP191 header for EIP712 prefix\n string constant internal EIP191_HEADER = \"\\x19\\x01\";\n\n // EIP712 Domain Name value\n string constant internal EIP712_DOMAIN_NAME = \"0x Protocol\";\n\n // EIP712 Domain Version value\n string constant internal EIP712_DOMAIN_VERSION = \"2\";\n\n // Hash of the EIP712 Domain Separator Schema\n bytes32 constant internal EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"EIP712Domain(\",\n \"string name,\",\n \"string version,\",\n \"address verifyingContract\",\n \")\"\n ));\n\n // Hash of the EIP712 Domain Separator data\n // solhint-disable-next-line var-name-mixedcase\n bytes32 public EIP712_DOMAIN_HASH;\n\n constructor ()\n public\n {\n EIP712_DOMAIN_HASH = keccak256(abi.encodePacked(\n EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH,\n keccak256(bytes(EIP712_DOMAIN_NAME)),\n keccak256(bytes(EIP712_DOMAIN_VERSION)),\n bytes32(address(this))\n ));\n }\n\n /// @dev Calculates EIP712 encoding for a hash struct in this EIP712 Domain.\n /// @param hashStruct The EIP712 hash struct.\n /// @return EIP712 hash applied to this EIP712 Domain.\n function hashEIP712Message(bytes32 hashStruct)\n internal\n view\n returns (bytes32 result)\n {\n bytes32 eip712DomainHash = EIP712_DOMAIN_HASH;\n\n // Assembly for more efficient computing:\n // keccak256(abi.encodePacked(\n // EIP191_HEADER,\n // EIP712_DOMAIN_HASH,\n // hashStruct \n // ));\n\n assembly {\n // Load free memory pointer\n let memPtr := mload(64)\n\n mstore(memPtr, 0x1901000000000000000000000000000000000000000000000000000000000000) // EIP191 header\n mstore(add(memPtr, 2), eip712DomainHash) // EIP712 domain hash\n mstore(add(memPtr, 34), hashStruct) // Hash of struct\n\n // Compute hash\n result := keccak256(memPtr, 66)\n }\n return result;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\n// solhint-disable\npragma solidity 0.4.24;\n\n\n/// @dev This contract documents the revert reasons used in the Exchange contract.\n/// This contract is intended to serve as a reference, but is not actually used for efficiency reasons.\ncontract LibExchangeErrors {\n\n /// Order validation errors ///\n string constant ORDER_UNFILLABLE = \"ORDER_UNFILLABLE\"; // Order cannot be filled.\n string constant INVALID_MAKER = \"INVALID_MAKER\"; // Invalid makerAddress.\n string constant INVALID_TAKER = \"INVALID_TAKER\"; // Invalid takerAddress.\n string constant INVALID_SENDER = \"INVALID_SENDER\"; // Invalid `msg.sender`.\n string constant INVALID_ORDER_SIGNATURE = \"INVALID_ORDER_SIGNATURE\"; // Signature validation failed. \n \n /// fillOrder validation errors ///\n string constant INVALID_TAKER_AMOUNT = \"INVALID_TAKER_AMOUNT\"; // takerAssetFillAmount cannot equal 0.\n string constant ROUNDING_ERROR = \"ROUNDING_ERROR\"; // Rounding error greater than 0.1% of takerAssetFillAmount. \n \n /// Signature validation errors ///\n string constant INVALID_SIGNATURE = \"INVALID_SIGNATURE\"; // Signature validation failed. \n string constant SIGNATURE_ILLEGAL = \"SIGNATURE_ILLEGAL\"; // Signature type is illegal.\n string constant SIGNATURE_UNSUPPORTED = \"SIGNATURE_UNSUPPORTED\"; // Signature type unsupported.\n \n /// cancelOrdersUptTo errors ///\n string constant INVALID_NEW_ORDER_EPOCH = \"INVALID_NEW_ORDER_EPOCH\"; // Specified salt must be greater than or equal to existing orderEpoch.\n\n /// fillOrKillOrder errors ///\n string constant COMPLETE_FILL_FAILED = \"COMPLETE_FILL_FAILED\"; // Desired takerAssetFillAmount could not be completely filled. \n\n /// matchOrders errors ///\n string constant NEGATIVE_SPREAD_REQUIRED = \"NEGATIVE_SPREAD_REQUIRED\"; // Matched orders must have a negative spread.\n\n /// Transaction errors ///\n string constant REENTRANCY_ILLEGAL = \"REENTRANCY_ILLEGAL\"; // Recursive reentrancy is not allowed. \n string constant INVALID_TX_HASH = \"INVALID_TX_HASH\"; // Transaction has already been executed. \n string constant INVALID_TX_SIGNATURE = \"INVALID_TX_SIGNATURE\"; // Signature validation failed. \n string constant FAILED_EXECUTION = \"FAILED_EXECUTION\"; // Transaction execution failed. \n \n /// registerAssetProxy errors ///\n string constant ASSET_PROXY_ALREADY_EXISTS = \"ASSET_PROXY_ALREADY_EXISTS\"; // AssetProxy with same id already exists.\n\n /// dispatchTransferFrom errors ///\n string constant ASSET_PROXY_DOES_NOT_EXIST = \"ASSET_PROXY_DOES_NOT_EXIST\"; // No assetProxy registered at given id.\n string constant TRANSFER_FAILED = \"TRANSFER_FAILED\"; // Asset transfer unsuccesful.\n\n /// Length validation errors ///\n string constant LENGTH_GREATER_THAN_0_REQUIRED = \"LENGTH_GREATER_THAN_0_REQUIRED\"; // Byte array must have a length greater than 0.\n string constant LENGTH_GREATER_THAN_3_REQUIRED = \"LENGTH_GREATER_THAN_3_REQUIRED\"; // Byte array must have a length greater than 3.\n string constant LENGTH_0_REQUIRED = \"LENGTH_0_REQUIRED\"; // Byte array must have a length of 0.\n string constant LENGTH_65_REQUIRED = \"LENGTH_65_REQUIRED\"; // Byte array must have a length of 65.\n}\n",
- "2.0.0/protocol/Exchange/libs/LibFillResults.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract LibFillResults is\n SafeMath\n{\n struct FillResults {\n uint256 makerAssetFilledAmount; // Total amount of makerAsset(s) filled.\n uint256 takerAssetFilledAmount; // Total amount of takerAsset(s) filled.\n uint256 makerFeePaid; // Total amount of ZRX paid by maker(s) to feeRecipient(s).\n uint256 takerFeePaid; // Total amount of ZRX paid by taker to feeRecipients(s).\n }\n\n struct MatchedFillResults {\n FillResults left; // Amounts filled and fees paid of left order.\n FillResults right; // Amounts filled and fees paid of right order.\n uint256 leftMakerAssetSpreadAmount; // Spread between price of left and right order, denominated in the left order's makerAsset, paid to taker.\n }\n\n /// @dev Adds properties of both FillResults instances.\n /// Modifies the first FillResults instance specified.\n /// @param totalFillResults Fill results instance that will be added onto.\n /// @param singleFillResults Fill results instance that will be added to totalFillResults.\n function addFillResults(FillResults memory totalFillResults, FillResults memory singleFillResults)\n internal\n pure\n {\n totalFillResults.makerAssetFilledAmount = safeAdd(totalFillResults.makerAssetFilledAmount, singleFillResults.makerAssetFilledAmount);\n totalFillResults.takerAssetFilledAmount = safeAdd(totalFillResults.takerAssetFilledAmount, singleFillResults.takerAssetFilledAmount);\n totalFillResults.makerFeePaid = safeAdd(totalFillResults.makerFeePaid, singleFillResults.makerFeePaid);\n totalFillResults.takerFeePaid = safeAdd(totalFillResults.takerFeePaid, singleFillResults.takerFeePaid);\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibMath.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract LibMath is\n SafeMath\n{\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// Reverts if rounding error is >= 0.1%\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded down.\n function safeGetPartialAmountFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n require(\n !isRoundingErrorFloor(\n numerator,\n denominator,\n target\n ),\n \"ROUNDING_ERROR\"\n );\n \n partialAmount = safeDiv(\n safeMul(numerator, target),\n denominator\n );\n return partialAmount;\n }\n\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// Reverts if rounding error is >= 0.1%\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded up.\n function safeGetPartialAmountCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n require(\n !isRoundingErrorCeil(\n numerator,\n denominator,\n target\n ),\n \"ROUNDING_ERROR\"\n );\n \n // safeDiv computes `floor(a / b)`. We use the identity (a, b integer):\n // ceil(a / b) = floor((a + b - 1) / b)\n // To implement `ceil(a / b)` using safeDiv.\n partialAmount = safeDiv(\n safeAdd(\n safeMul(numerator, target),\n safeSub(denominator, 1)\n ),\n denominator\n );\n return partialAmount;\n }\n\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded down.\n function getPartialAmountFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n partialAmount = safeDiv(\n safeMul(numerator, target),\n denominator\n );\n return partialAmount;\n }\n \n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded up.\n function getPartialAmountCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n // safeDiv computes `floor(a / b)`. We use the identity (a, b integer):\n // ceil(a / b) = floor((a + b - 1) / b)\n // To implement `ceil(a / b)` using safeDiv.\n partialAmount = safeDiv(\n safeAdd(\n safeMul(numerator, target),\n safeSub(denominator, 1)\n ),\n denominator\n );\n return partialAmount;\n }\n \n /// @dev Checks if rounding error >= 0.1% when rounding down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to multiply with numerator/denominator.\n /// @return Rounding error is present.\n function isRoundingErrorFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (bool isError)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n \n // The absolute rounding error is the difference between the rounded\n // value and the ideal value. The relative rounding error is the\n // absolute rounding error divided by the absolute value of the\n // ideal value. This is undefined when the ideal value is zero.\n //\n // The ideal value is `numerator * target / denominator`.\n // Let's call `numerator * target % denominator` the remainder.\n // The absolute error is `remainder / denominator`.\n //\n // When the ideal value is zero, we require the absolute error to\n // be zero. Fortunately, this is always the case. The ideal value is\n // zero iff `numerator == 0` and/or `target == 0`. In this case the\n // remainder and absolute error are also zero. \n if (target == 0 || numerator == 0) {\n return false;\n }\n \n // Otherwise, we want the relative rounding error to be strictly\n // less than 0.1%.\n // The relative error is `remainder / (numerator * target)`.\n // We want the relative error less than 1 / 1000:\n // remainder / (numerator * denominator) < 1 / 1000\n // or equivalently:\n // 1000 * remainder < numerator * target\n // so we have a rounding error iff:\n // 1000 * remainder >= numerator * target\n uint256 remainder = mulmod(\n target,\n numerator,\n denominator\n );\n isError = safeMul(1000, remainder) >= safeMul(numerator, target);\n return isError;\n }\n \n /// @dev Checks if rounding error >= 0.1% when rounding up.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to multiply with numerator/denominator.\n /// @return Rounding error is present.\n function isRoundingErrorCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (bool isError)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n \n // See the comments in `isRoundingError`.\n if (target == 0 || numerator == 0) {\n // When either is zero, the ideal value and rounded value are zero\n // and there is no rounding error. (Although the relative error\n // is undefined.)\n return false;\n }\n // Compute remainder as before\n uint256 remainder = mulmod(\n target,\n numerator,\n denominator\n );\n remainder = safeSub(denominator, remainder) % denominator;\n isError = safeMul(1000, remainder) >= safeMul(numerator, target);\n return isError;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibOrder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./LibEIP712.sol\";\n\n\ncontract LibOrder is\n LibEIP712\n{\n // Hash for the EIP712 Order Schema\n bytes32 constant internal EIP712_ORDER_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"Order(\",\n \"address makerAddress,\",\n \"address takerAddress,\",\n \"address feeRecipientAddress,\",\n \"address senderAddress,\",\n \"uint256 makerAssetAmount,\",\n \"uint256 takerAssetAmount,\",\n \"uint256 makerFee,\",\n \"uint256 takerFee,\",\n \"uint256 expirationTimeSeconds,\",\n \"uint256 salt,\",\n \"bytes makerAssetData,\",\n \"bytes takerAssetData\",\n \")\"\n ));\n\n // A valid order remains fillable until it is expired, fully filled, or cancelled.\n // An order's state is unaffected by external factors, like account balances.\n enum OrderStatus {\n INVALID, // Default value\n INVALID_MAKER_ASSET_AMOUNT, // Order does not have a valid maker asset amount\n INVALID_TAKER_ASSET_AMOUNT, // Order does not have a valid taker asset amount\n FILLABLE, // Order is fillable\n EXPIRED, // Order has already expired\n FULLY_FILLED, // Order is fully filled\n CANCELLED // Order has been cancelled\n }\n\n // solhint-disable max-line-length\n struct Order {\n address makerAddress; // Address that created the order. \n address takerAddress; // Address that is allowed to fill the order. If set to 0, any address is allowed to fill the order. \n address feeRecipientAddress; // Address that will recieve fees when order is filled. \n address senderAddress; // Address that is allowed to call Exchange contract methods that affect this order. If set to 0, any address is allowed to call these methods.\n uint256 makerAssetAmount; // Amount of makerAsset being offered by maker. Must be greater than 0. \n uint256 takerAssetAmount; // Amount of takerAsset being bid on by maker. Must be greater than 0. \n uint256 makerFee; // Amount of ZRX paid to feeRecipient by maker when order is filled. If set to 0, no transfer of ZRX from maker to feeRecipient will be attempted.\n uint256 takerFee; // Amount of ZRX paid to feeRecipient by taker when order is filled. If set to 0, no transfer of ZRX from taker to feeRecipient will be attempted.\n uint256 expirationTimeSeconds; // Timestamp in seconds at which order expires. \n uint256 salt; // Arbitrary number to facilitate uniqueness of the order's hash. \n bytes makerAssetData; // Encoded data that can be decoded by a specified proxy contract when transferring makerAsset. The last byte references the id of this proxy.\n bytes takerAssetData; // Encoded data that can be decoded by a specified proxy contract when transferring takerAsset. The last byte references the id of this proxy.\n }\n // solhint-enable max-line-length\n\n struct OrderInfo {\n uint8 orderStatus; // Status that describes order's validity and fillability.\n bytes32 orderHash; // EIP712 hash of the order (see LibOrder.getOrderHash).\n uint256 orderTakerAssetFilledAmount; // Amount of order that has already been filled.\n }\n\n /// @dev Calculates Keccak-256 hash of the order.\n /// @param order The order structure.\n /// @return Keccak-256 EIP712 hash of the order.\n function getOrderHash(Order memory order)\n internal\n view\n returns (bytes32 orderHash)\n {\n orderHash = hashEIP712Message(hashOrder(order));\n return orderHash;\n }\n\n /// @dev Calculates EIP712 hash of the order.\n /// @param order The order structure.\n /// @return EIP712 hash of the order.\n function hashOrder(Order memory order)\n internal\n pure\n returns (bytes32 result)\n {\n bytes32 schemaHash = EIP712_ORDER_SCHEMA_HASH;\n bytes32 makerAssetDataHash = keccak256(order.makerAssetData);\n bytes32 takerAssetDataHash = keccak256(order.takerAssetData);\n\n // Assembly for more efficiently computing:\n // keccak256(abi.encodePacked(\n // EIP712_ORDER_SCHEMA_HASH,\n // bytes32(order.makerAddress),\n // bytes32(order.takerAddress),\n // bytes32(order.feeRecipientAddress),\n // bytes32(order.senderAddress),\n // order.makerAssetAmount,\n // order.takerAssetAmount,\n // order.makerFee,\n // order.takerFee,\n // order.expirationTimeSeconds,\n // order.salt,\n // keccak256(order.makerAssetData),\n // keccak256(order.takerAssetData)\n // ));\n\n assembly {\n // Calculate memory addresses that will be swapped out before hashing\n let pos1 := sub(order, 32)\n let pos2 := add(order, 320)\n let pos3 := add(order, 352)\n\n // Backup\n let temp1 := mload(pos1)\n let temp2 := mload(pos2)\n let temp3 := mload(pos3)\n \n // Hash in place\n mstore(pos1, schemaHash)\n mstore(pos2, makerAssetDataHash)\n mstore(pos3, takerAssetDataHash)\n result := keccak256(pos1, 416)\n \n // Restore\n mstore(pos1, temp1)\n mstore(pos2, temp2)\n mstore(pos3, temp3)\n }\n return result;\n }\n}\n",
- "2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAssetProxyDispatcher.sol\";\n\n\ncontract MAssetProxyDispatcher is\n IAssetProxyDispatcher\n{\n // Logs registration of new asset proxy\n event AssetProxyRegistered(\n bytes4 id, // Id of new registered AssetProxy.\n address assetProxy // Address of new registered AssetProxy.\n );\n\n /// @dev Forwards arguments to assetProxy and calls `transferFrom`. Either succeeds or throws.\n /// @param assetData Byte array encoded for the asset.\n /// @param from Address to transfer token from.\n /// @param to Address to transfer token to.\n /// @param amount Amount of token to transfer.\n function dispatchTransferFrom(\n bytes memory assetData,\n address from,\n address to,\n uint256 amount\n )\n internal;\n}\n",
- "2.0.0/protocol/Exchange/mixins/MExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IExchangeCore.sol\";\n\n\ncontract MExchangeCore is\n IExchangeCore\n{\n // Fill event is emitted whenever an order is filled.\n event Fill(\n address indexed makerAddress, // Address that created the order. \n address indexed feeRecipientAddress, // Address that received fees.\n address takerAddress, // Address that filled the order.\n address senderAddress, // Address that called the Exchange contract (msg.sender).\n uint256 makerAssetFilledAmount, // Amount of makerAsset sold by maker and bought by taker. \n uint256 takerAssetFilledAmount, // Amount of takerAsset sold by taker and bought by maker.\n uint256 makerFeePaid, // Amount of ZRX paid to feeRecipient by maker.\n uint256 takerFeePaid, // Amount of ZRX paid to feeRecipient by taker.\n bytes32 indexed orderHash, // EIP712 hash of order (see LibOrder.getOrderHash).\n bytes makerAssetData, // Encoded data specific to makerAsset. \n bytes takerAssetData // Encoded data specific to takerAsset.\n );\n\n // Cancel event is emitted whenever an individual order is cancelled.\n event Cancel(\n address indexed makerAddress, // Address that created the order. \n address indexed feeRecipientAddress, // Address that would have recieved fees if order was filled. \n address senderAddress, // Address that called the Exchange contract (msg.sender).\n bytes32 indexed orderHash, // EIP712 hash of order (see LibOrder.getOrderHash).\n bytes makerAssetData, // Encoded data specific to makerAsset. \n bytes takerAssetData // Encoded data specific to takerAsset.\n );\n\n // CancelUpTo event is emitted whenever `cancelOrdersUpTo` is executed succesfully.\n event CancelUpTo(\n address indexed makerAddress, // Orders cancelled must have been created by this address.\n address indexed senderAddress, // Orders cancelled must have a `senderAddress` equal to this address.\n uint256 orderEpoch // Orders with specified makerAddress and senderAddress with a salt less than this value are considered cancelled.\n );\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev After calling, the order can not be filled anymore.\n /// @param order Order struct containing order specifications.\n function cancelOrderInternal(LibOrder.Order memory order)\n internal;\n\n /// @dev Updates state with results of a fill order.\n /// @param order that was filled.\n /// @param takerAddress Address of taker who filled the order.\n /// @param orderTakerAssetFilledAmount Amount of order already filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function updateFilledState(\n LibOrder.Order memory order,\n address takerAddress,\n bytes32 orderHash,\n uint256 orderTakerAssetFilledAmount,\n LibFillResults.FillResults memory fillResults\n )\n internal;\n\n /// @dev Updates state with results of cancelling an order.\n /// State is only updated if the order is currently fillable.\n /// Otherwise, updating state would have no effect.\n /// @param order that was cancelled.\n /// @param orderHash Hash of order that was cancelled.\n function updateCancelledState(\n LibOrder.Order memory order,\n bytes32 orderHash\n )\n internal;\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAddress Address of order taker.\n /// @param signature Proof that the orders was created by its maker.\n function assertFillableOrder(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo,\n address takerAddress,\n bytes memory signature\n )\n internal\n view;\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo Status, orderHash, and amount already filled of order.\n /// @param takerAssetFillAmount Desired amount of order to fill by taker.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @param makerAssetFilledAmount Amount of makerAsset that will be transfered.\n function assertValidFill(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo,\n uint256 takerAssetFillAmount,\n uint256 takerAssetFilledAmount,\n uint256 makerAssetFilledAmount\n )\n internal\n view;\n\n /// @dev Validates context for cancelOrder. Succeeds or throws.\n /// @param order to be cancelled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n function assertValidCancel(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo\n )\n internal\n view;\n\n /// @dev Calculates amounts filled and fees paid by maker and taker.\n /// @param order to be filled.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function calculateFillResults(\n LibOrder.Order memory order,\n uint256 takerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.FillResults memory fillResults);\n\n}\n",
- "2.0.0/protocol/Exchange/mixins/MMatchOrders.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IMatchOrders.sol\";\n\n\ncontract MMatchOrders is\n IMatchOrders\n{\n /// @dev Validates context for matchOrders. Succeeds or throws.\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n function assertValidMatch(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder\n )\n internal\n pure;\n\n /// @dev Calculates fill amounts for the matched orders.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the leftOrder order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftOrderTakerAssetFilledAmount Amount of left order already filled.\n /// @param rightOrderTakerAssetFilledAmount Amount of right order already filled.\n /// @param matchedFillResults Amounts to fill and fees to pay by maker and taker of matched orders.\n function calculateMatchedFillResults(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n uint256 leftOrderTakerAssetFilledAmount,\n uint256 rightOrderTakerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.MatchedFillResults memory matchedFillResults);\n\n}\n",
- "2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/ISignatureValidator.sol\";\n\n\ncontract MSignatureValidator is\n ISignatureValidator\n{\n event SignatureValidatorApproval(\n address indexed signerAddress, // Address that approves or disapproves a contract to verify signatures.\n address indexed validatorAddress, // Address of signature validator contract.\n bool approved // Approval or disapproval of validator contract.\n );\n\n // Allowed signature types.\n enum SignatureType {\n Illegal, // 0x00, default value\n Invalid, // 0x01\n EIP712, // 0x02\n EthSign, // 0x03\n Wallet, // 0x04\n Validator, // 0x05\n PreSigned, // 0x06\n NSignatureTypes // 0x07, number of signature types. Always leave at end.\n }\n\n /// @dev Verifies signature using logic defined by Wallet contract.\n /// @param hash Any 32 byte hash.\n /// @param walletAddress Address that should have signed the given hash\n /// and defines its own signature verification method.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidWalletSignature(\n bytes32 hash,\n address walletAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid);\n\n /// @dev Verifies signature using logic defined by Validator contract.\n /// @param validatorAddress Address of validator contract.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidValidatorSignature(\n address validatorAddress,\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/mixins/MTransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\nimport \"../interfaces/ITransactions.sol\";\n\n\ncontract MTransactions is\n ITransactions\n{\n // Hash for the EIP712 ZeroEx Transaction Schema\n bytes32 constant internal EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"ZeroExTransaction(\",\n \"uint256 salt,\",\n \"address signerAddress,\",\n \"bytes data\",\n \")\"\n ));\n\n /// @dev Calculates EIP712 hash of the Transaction.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @return EIP712 hash of the Transaction.\n function hashZeroExTransaction(\n uint256 salt,\n address signerAddress,\n bytes memory data\n )\n internal\n pure\n returns (bytes32 result);\n\n /// @dev The current function will be called in the context of this address (either 0x transaction signer or `msg.sender`).\n /// If calling a fill function, this address will represent the taker.\n /// If calling a cancel function, this address will represent the maker.\n /// @return Signer of 0x transaction if entry point is `executeTransaction`.\n /// `msg.sender` if entry point is any other function.\n function getCurrentContextAddress()\n internal\n view\n returns (address);\n}\n",
- "2.0.0/protocol/Exchange/mixins/MWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IWrapperFunctions.sol\";\n\n\ncontract MWrapperFunctions is \n IWrapperFunctions\n{\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n}\n",
- "2.0.0/test/DummyERC20Token/DummyERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"../../tokens/ERC20Token/MintableERC20Token.sol\";\n\n\ncontract DummyERC20Token is \n Ownable,\n MintableERC20Token\n{\n string public name;\n string public symbol;\n uint256 public decimals;\n uint256 public constant MAX_MINT_AMOUNT = 10000000000000000000000;\n\n constructor (\n string _name,\n string _symbol,\n uint256 _decimals,\n uint256 _totalSupply\n )\n public\n {\n name = _name;\n symbol = _symbol;\n decimals = _decimals;\n _totalSupply = _totalSupply;\n balances[msg.sender] = _totalSupply;\n }\n\n /// @dev Sets the balance of target address\n /// @param _target Address or which balance will be updated\n /// @param _value New balance of target address\n function setBalance(address _target, uint256 _value)\n external\n onlyOwner\n {\n uint256 currBalance = balances[_target];\n if (_value < currBalance) {\n _totalSupply = safeSub(_totalSupply, safeSub(currBalance, _value));\n } else {\n _totalSupply = safeAdd(_totalSupply, safeSub(_value, currBalance));\n }\n balances[_target] = _value;\n }\n\n /// @dev Mints new tokens for sender\n /// @param _value Amount of tokens to mint\n function mint(uint256 _value)\n external\n {\n require(\n _value <= MAX_MINT_AMOUNT,\n \"VALUE_TOO_LARGE\"\n );\n\n _mint(msg.sender, _value);\n }\n}\n",
- "2.0.0/test/DummyERC721Token/DummyERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../tokens/ERC721Token/MintableERC721Token.sol\";\nimport \"../../utils/Ownable/Ownable.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract DummyERC721Token is\n Ownable,\n MintableERC721Token\n{\n string public name;\n string public symbol;\n\n constructor (\n string _name,\n string _symbol\n )\n public\n {\n name = _name;\n symbol = _symbol;\n }\n\n /// @dev Function to mint a new token\n /// Reverts if the given token ID already exists\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _tokenId ID of the token to be minted by the msg.sender \n function mint(address _to, uint256 _tokenId)\n external\n {\n _mint(_to, _tokenId);\n }\n\n /// @dev Function to burn a token\n /// Reverts if the given token ID doesn't exist or not called by contract owner\n /// @param _owner Owner of token with given token ID\n /// @param _tokenId ID of the token to be burned by the msg.sender\n function burn(address _owner, uint256 _tokenId)\n external\n onlyOwner\n {\n _burn(_owner, _tokenId);\n }\n}\n",
- "2.0.0/tokens/ERC20Token/ERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IERC20Token.sol\";\n\n\ncontract ERC20Token is\n IERC20Token\n{\n mapping (address => uint256) internal balances;\n mapping (address => mapping (address => uint256)) internal allowed;\n\n uint256 internal _totalSupply;\n\n /// @dev send `value` token to `to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transfer(address _to, uint256 _value)\n external\n returns (bool)\n {\n require(\n balances[msg.sender] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[msg.sender] -= _value;\n balances[_to] += _value;\n\n emit Transfer(\n msg.sender,\n _to,\n _value\n );\n\n return true;\n }\n\n /// @dev send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool)\n {\n require(\n balances[_from] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n allowed[_from][msg.sender] >= _value,\n \"ERC20_INSUFFICIENT_ALLOWANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[_to] += _value;\n balances[_from] -= _value;\n allowed[_from][msg.sender] -= _value;\n \n emit Transfer(\n _from,\n _to,\n _value\n );\n \n return true;\n }\n\n /// @dev `msg.sender` approves `_spender` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Always true if the call has enough gas to complete execution\n function approve(address _spender, uint256 _value)\n external\n returns (bool)\n {\n allowed[msg.sender][_spender] = _value;\n emit Approval(\n msg.sender,\n _spender,\n _value\n );\n return true;\n }\n\n /// @dev Query total supply of token\n /// @return Total supply of token\n function totalSupply()\n external\n view\n returns (uint256)\n {\n return _totalSupply;\n }\n\n /// @dev Query the balance of owner\n /// @param _owner The address from which the balance will be retrieved\n /// @return Balance of owner\n function balanceOf(address _owner)\n external\n view\n returns (uint256)\n {\n return balances[_owner];\n }\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender)\n external\n view\n returns (uint256)\n {\n return allowed[_owner][_spender];\n }\n}\n",
- "2.0.0/tokens/ERC20Token/IERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC20Token {\n\n // solhint-disable no-simple-event-func-name\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 _value\n );\n\n event Approval(\n address indexed _owner,\n address indexed _spender,\n uint256 _value\n );\n\n /// @dev send `value` token to `to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transfer(address _to, uint256 _value)\n external\n returns (bool);\n\n /// @dev send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool);\n \n /// @dev `msg.sender` approves `_spender` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Always true if the call has enough gas to complete execution\n function approve(address _spender, uint256 _value)\n external\n returns (bool);\n\n /// @dev Query total supply of token\n /// @return Total supply of token\n function totalSupply()\n external\n view\n returns (uint256);\n \n /// @param _owner The address from which the balance will be retrieved\n /// @return Balance of owner\n function balanceOf(address _owner)\n external\n view\n returns (uint256);\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender)\n external\n view\n returns (uint256);\n}\n",
- "2.0.0/tokens/ERC20Token/MintableERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/SafeMath/SafeMath.sol\";\nimport \"./UnlimitedAllowanceERC20Token.sol\";\n\n\ncontract MintableERC20Token is \n SafeMath,\n UnlimitedAllowanceERC20Token\n{\n /// @dev Mints new tokens\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _value Amount of tokens to mint\n function _mint(address _to, uint256 _value)\n internal\n {\n balances[_to] = safeAdd(_value, balances[_to]);\n _totalSupply = safeAdd(_totalSupply, _value);\n\n emit Transfer(\n address(0),\n _to,\n _value\n );\n }\n\n /// @dev Mints new tokens\n /// @param _owner Owner of tokens that will be burned\n /// @param _value Amount of tokens to burn\n function _burn(address _owner, uint256 _value)\n internal\n {\n balances[_owner] = safeSub(balances[_owner], _value);\n _totalSupply = safeSub(_totalSupply, _value);\n\n emit Transfer(\n _owner,\n address(0),\n _value\n );\n }\n}\n",
- "2.0.0/tokens/ERC20Token/UnlimitedAllowanceERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../ERC20Token/ERC20Token.sol\";\n\n\ncontract UnlimitedAllowanceERC20Token is\n ERC20Token\n{\n uint256 constant internal MAX_UINT = 2**256 - 1;\n\n /// @dev ERC20 transferFrom, modified such that an allowance of MAX_UINT represents an unlimited allowance. See https://github.com/ethereum/EIPs/issues/717\n /// @param _from Address to transfer from.\n /// @param _to Address to transfer to.\n /// @param _value Amount to transfer.\n /// @return Success of transfer.\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool)\n {\n uint256 allowance = allowed[_from][msg.sender];\n require(\n balances[_from] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n allowance >= _value,\n \"ERC20_INSUFFICIENT_ALLOWANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[_to] += _value;\n balances[_from] -= _value;\n if (allowance < MAX_UINT) {\n allowed[_from][msg.sender] -= _value;\n }\n\n emit Transfer(\n _from,\n _to,\n _value\n );\n\n return true;\n }\n}\n",
- "2.0.0/tokens/ERC721Token/ERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IERC721Token.sol\";\nimport \"./IERC721Receiver.sol\";\nimport \"../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract ERC721Token is\n IERC721Token,\n SafeMath\n{\n // Function selector for ERC721Receiver.onERC721Received\n // 0x150b7a02\n bytes4 constant internal ERC721_RECEIVED = bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"));\n\n // Mapping of tokenId => owner\n mapping (uint256 => address) internal owners;\n\n // Mapping of tokenId => approved address\n mapping (uint256 => address) internal approvals;\n\n // Mapping of owner => number of tokens owned\n mapping (address => uint256) internal balances;\n\n // Mapping of owner => operator => approved\n mapping (address => mapping (address => bool)) internal operatorApprovals;\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT. When transfer is complete, this function\n /// checks if `_to` is a smart contract (code size > 0). If so, it calls\n /// `onERC721Received` on `_to` and throws if the return value is not\n /// `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n /// @param _data Additional data with no specified format, sent in call to `_to`\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId,\n bytes _data\n )\n external\n {\n transferFrom(\n _from,\n _to,\n _tokenId\n );\n\n uint256 receiverCodeSize;\n assembly {\n receiverCodeSize := extcodesize(_to)\n }\n if (receiverCodeSize > 0) {\n bytes4 selector = IERC721Receiver(_to).onERC721Received(\n msg.sender,\n _from,\n _tokenId,\n _data\n );\n require(\n selector == ERC721_RECEIVED,\n \"ERC721_INVALID_SELECTOR\"\n );\n }\n }\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev This works identically to the other function with an extra data parameter,\n /// except this function just sets data to \"\".\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n external\n {\n transferFrom(\n _from,\n _to,\n _tokenId\n );\n\n uint256 receiverCodeSize;\n assembly {\n receiverCodeSize := extcodesize(_to)\n }\n if (receiverCodeSize > 0) {\n bytes4 selector = IERC721Receiver(_to).onERC721Received(\n msg.sender,\n _from,\n _tokenId,\n \"\"\n );\n require(\n selector == ERC721_RECEIVED,\n \"ERC721_INVALID_SELECTOR\"\n );\n }\n }\n\n /// @notice Change or reaffirm the approved address for an NFT\n /// @dev The zero address indicates there is no approved address.\n /// Throws unless `msg.sender` is the current NFT owner, or an authorized\n /// operator of the current owner.\n /// @param _approved The new approved NFT controller\n /// @param _tokenId The NFT to approve\n function approve(address _approved, uint256 _tokenId)\n external\n {\n address owner = ownerOf(_tokenId);\n require(\n msg.sender == owner || isApprovedForAll(owner, msg.sender),\n \"ERC721_INVALID_SENDER\"\n );\n\n approvals[_tokenId] = _approved;\n emit Approval(\n owner,\n _approved,\n _tokenId\n );\n }\n\n /// @notice Enable or disable approval for a third party (\"operator\") to manage\n /// all of `msg.sender`'s assets\n /// @dev Emits the ApprovalForAll event. The contract MUST allow\n /// multiple operators per owner.\n /// @param _operator Address to add to the set of authorized operators\n /// @param _approved True if the operator is approved, false to revoke approval\n function setApprovalForAll(address _operator, bool _approved)\n external\n {\n operatorApprovals[msg.sender][_operator] = _approved;\n emit ApprovalForAll(\n msg.sender,\n _operator,\n _approved\n );\n }\n \n /// @notice Count all NFTs assigned to an owner\n /// @dev NFTs assigned to the zero address are considered invalid, and this\n /// function throws for queries about the zero address.\n /// @param _owner An address for whom to query the balance\n /// @return The number of NFTs owned by `_owner`, possibly zero\n function balanceOf(address _owner)\n external\n view\n returns (uint256)\n {\n require(\n _owner != address(0),\n \"ERC721_ZERO_OWNER\"\n );\n return balances[_owner];\n }\n\n /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE\n /// TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE\n /// THEY MAY BE PERMANENTLY LOST\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function transferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n public\n {\n require(\n _to != address(0),\n \"ERC721_ZERO_TO_ADDRESS\"\n );\n\n address owner = ownerOf(_tokenId);\n require(\n _from == owner,\n \"ERC721_OWNER_MISMATCH\"\n );\n\n address spender = msg.sender;\n address approvedAddress = getApproved(_tokenId);\n require(\n spender == owner ||\n isApprovedForAll(owner, spender) ||\n approvedAddress == spender,\n \"ERC721_INVALID_SPENDER\"\n );\n\n if (approvedAddress != address(0)) {\n approvals[_tokenId] = address(0);\n }\n\n owners[_tokenId] = _to;\n balances[_from] = safeSub(balances[_from], 1);\n balances[_to] = safeAdd(balances[_to], 1);\n \n emit Transfer(\n _from,\n _to,\n _tokenId\n );\n }\n\n /// @notice Find the owner of an NFT\n /// @dev NFTs assigned to zero address are considered invalid, and queries\n /// about them do throw.\n /// @param _tokenId The identifier for an NFT\n /// @return The address of the owner of the NFT\n function ownerOf(uint256 _tokenId)\n public\n view\n returns (address)\n {\n address owner = owners[_tokenId];\n require(\n owner != address(0),\n \"ERC721_ZERO_OWNER\"\n );\n return owner;\n }\n\n /// @notice Get the approved address for a single NFT\n /// @dev Throws if `_tokenId` is not a valid NFT.\n /// @param _tokenId The NFT to find the approved address for\n /// @return The approved address for this NFT, or the zero address if there is none\n function getApproved(uint256 _tokenId)\n public\n view\n returns (address)\n {\n return approvals[_tokenId];\n }\n\n /// @notice Query if an address is an authorized operator for another address\n /// @param _owner The address that owns the NFTs\n /// @param _operator The address that acts on behalf of the owner\n /// @return True if `_operator` is an approved operator for `_owner`, false otherwise\n function isApprovedForAll(address _owner, address _operator)\n public\n view\n returns (bool)\n {\n return operatorApprovals[_owner][_operator];\n }\n}\n",
- "2.0.0/tokens/ERC721Token/IERC721Receiver.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC721Receiver {\n\n /// @notice Handle the receipt of an NFT\n /// @dev The ERC721 smart contract calls this function on the recipient\n /// after a `transfer`. This function MAY throw to revert and reject the\n /// transfer. Return of other than the magic value MUST result in the\n /// transaction being reverted.\n /// Note: the contract address is always the message sender.\n /// @param _operator The address which called `safeTransferFrom` function\n /// @param _from The address which previously owned the token\n /// @param _tokenId The NFT identifier which is being transferred\n /// @param _data Additional data with no specified format\n /// @return `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`\n /// unless throwing\n function onERC721Received(\n address _operator,\n address _from,\n uint256 _tokenId,\n bytes _data\n )\n external\n returns (bytes4);\n}\n",
- "2.0.0/tokens/ERC721Token/IERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC721Token {\n\n /// @dev This emits when ownership of any NFT changes by any mechanism.\n /// This event emits when NFTs are created (`from` == 0) and destroyed\n /// (`to` == 0). Exception: during contract creation, any number of NFTs\n /// may be created and assigned without emitting Transfer. At the time of\n /// any transfer, the approved address for that NFT (if any) is reset to none.\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 indexed _tokenId\n );\n\n /// @dev This emits when the approved address for an NFT is changed or\n /// reaffirmed. The zero address indicates there is no approved address.\n /// When a Transfer event emits, this also indicates that the approved\n /// address for that NFT (if any) is reset to none.\n event Approval(\n address indexed _owner,\n address indexed _approved,\n uint256 indexed _tokenId\n );\n\n /// @dev This emits when an operator is enabled or disabled for an owner.\n /// The operator can manage all NFTs of the owner.\n event ApprovalForAll(\n address indexed _owner,\n address indexed _operator,\n bool _approved\n );\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// perator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT. When transfer is complete, this function\n /// checks if `_to` is a smart contract (code size > 0). If so, it calls\n /// `onERC721Received` on `_to` and throws if the return value is not\n /// `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n /// @param _data Additional data with no specified format, sent in call to `_to`\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId,\n bytes _data\n )\n external;\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev This works identically to the other function with an extra data parameter,\n /// except this function just sets data to \"\".\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n external;\n\n /// @notice Change or reaffirm the approved address for an NFT\n /// @dev The zero address indicates there is no approved address.\n /// Throws unless `msg.sender` is the current NFT owner, or an authorized\n /// operator of the current owner.\n /// @param _approved The new approved NFT controller\n /// @param _tokenId The NFT to approve\n function approve(address _approved, uint256 _tokenId)\n external;\n\n /// @notice Enable or disable approval for a third party (\"operator\") to manage\n /// all of `msg.sender`'s assets\n /// @dev Emits the ApprovalForAll event. The contract MUST allow\n /// multiple operators per owner.\n /// @param _operator Address to add to the set of authorized operators\n /// @param _approved True if the operator is approved, false to revoke approval\n function setApprovalForAll(address _operator, bool _approved)\n external;\n\n /// @notice Count all NFTs assigned to an owner\n /// @dev NFTs assigned to the zero address are considered invalid, and this\n /// function throws for queries about the zero address.\n /// @param _owner An address for whom to query the balance\n /// @return The number of NFTs owned by `_owner`, possibly zero\n function balanceOf(address _owner)\n external\n view\n returns (uint256);\n\n /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE\n /// TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE\n /// THEY MAY BE PERMANENTLY LOST\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function transferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n public;\n\n /// @notice Find the owner of an NFT\n /// @dev NFTs assigned to zero address are considered invalid, and queries\n /// about them do throw.\n /// @param _tokenId The identifier for an NFT\n /// @return The address of the owner of the NFT\n function ownerOf(uint256 _tokenId)\n public\n view\n returns (address);\n\n /// @notice Get the approved address for a single NFT\n /// @dev Throws if `_tokenId` is not a valid NFT.\n /// @param _tokenId The NFT to find the approved address for\n /// @return The approved address for this NFT, or the zero address if there is none\n function getApproved(uint256 _tokenId) \n public\n view\n returns (address);\n \n /// @notice Query if an address is an authorized operator for another address\n /// @param _owner The address that owns the NFTs\n /// @param _operator The address that acts on behalf of the owner\n /// @return True if `_operator` is an approved operator for `_owner`, false otherwise\n function isApprovedForAll(address _owner, address _operator)\n public\n view\n returns (bool);\n}\n",
- "2.0.0/tokens/ERC721Token/MintableERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./ERC721Token.sol\";\n\n\ncontract MintableERC721Token is\n ERC721Token\n{\n /// @dev Function to mint a new token\n /// Reverts if the given token ID already exists\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _tokenId ID of the token to be minted by the msg.sender \n function _mint(address _to, uint256 _tokenId)\n internal\n {\n require(\n _to != address(0),\n \"ERC721_ZERO_TO_ADDRESS\"\n );\n\n address owner = owners[_tokenId];\n require(\n owner == address(0),\n \"ERC721_OWNER_ALREADY_EXISTS\"\n );\n\n owners[_tokenId] = _to;\n balances[_to] = safeAdd(balances[_to], 1);\n\n emit Transfer(\n address(0),\n _to,\n _tokenId\n );\n }\n\n /// @dev Function to burn a token\n /// Reverts if the given token ID doesn't exist\n /// @param _owner Owner of token with given token ID\n /// @param _tokenId ID of the token to be burned by the msg.sender\n function _burn(address _owner, uint256 _tokenId)\n internal\n {\n require(\n _owner != address(0),\n \"ERC721_ZERO_OWNER_ADDRESS\"\n );\n\n address owner = owners[_tokenId];\n require(\n owner == _owner,\n \"ERC721_OWNER_MISMATCH\"\n );\n\n owners[_tokenId] = address(0);\n balances[_owner] = safeSub(balances[_owner], 1);\n\n emit Transfer(\n _owner,\n address(0),\n _tokenId\n );\n }\n}\n",
- "2.0.0/tokens/EtherToken/IEtherToken.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../ERC20Token/IERC20Token.sol\";\n\n\ncontract IEtherToken is\n IERC20Token\n{\n function deposit()\n public\n payable;\n \n function withdraw(uint256 amount)\n public;\n}\n",
- "2.0.0/utils/LibBytes/LibBytes.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\nlibrary LibBytes {\n\n using LibBytes for bytes;\n\n /// @dev Gets the memory address for a byte array.\n /// @param input Byte array to lookup.\n /// @return memoryAddress Memory address of byte array. This\n /// points to the header of the byte array which contains\n /// the length.\n function rawAddress(bytes memory input)\n internal\n pure\n returns (uint256 memoryAddress)\n {\n assembly {\n memoryAddress := input\n }\n return memoryAddress;\n }\n \n /// @dev Gets the memory address for the contents of a byte array.\n /// @param input Byte array to lookup.\n /// @return memoryAddress Memory address of the contents of the byte array.\n function contentAddress(bytes memory input)\n internal\n pure\n returns (uint256 memoryAddress)\n {\n assembly {\n memoryAddress := add(input, 32)\n }\n return memoryAddress;\n }\n\n /// @dev Copies `length` bytes from memory location `source` to `dest`.\n /// @param dest memory address to copy bytes to.\n /// @param source memory address to copy bytes from.\n /// @param length number of bytes to copy.\n function memCopy(\n uint256 dest,\n uint256 source,\n uint256 length\n )\n internal\n pure\n {\n if (length < 32) {\n // Handle a partial word by reading destination and masking\n // off the bits we are interested in.\n // This correctly handles overlap, zero lengths and source == dest\n assembly {\n let mask := sub(exp(256, sub(32, length)), 1)\n let s := and(mload(source), not(mask))\n let d := and(mload(dest), mask)\n mstore(dest, or(s, d))\n }\n } else {\n // Skip the O(length) loop when source == dest.\n if (source == dest) {\n return;\n }\n\n // For large copies we copy whole words at a time. The final\n // word is aligned to the end of the range (instead of after the\n // previous) to handle partial words. So a copy will look like this:\n //\n // ####\n // ####\n // ####\n // ####\n //\n // We handle overlap in the source and destination range by\n // changing the copying direction. This prevents us from\n // overwriting parts of source that we still need to copy.\n //\n // This correctly handles source == dest\n //\n if (source > dest) {\n assembly {\n // We subtract 32 from `sEnd` and `dEnd` because it\n // is easier to compare with in the loop, and these\n // are also the addresses we need for copying the\n // last bytes.\n length := sub(length, 32)\n let sEnd := add(source, length)\n let dEnd := add(dest, length)\n\n // Remember the last 32 bytes of source\n // This needs to be done here and not after the loop\n // because we may have overwritten the last bytes in\n // source already due to overlap.\n let last := mload(sEnd)\n\n // Copy whole words front to back\n // Note: the first check is always true,\n // this could have been a do-while loop.\n // solhint-disable-next-line no-empty-blocks\n for {} lt(source, sEnd) {} {\n mstore(dest, mload(source))\n source := add(source, 32)\n dest := add(dest, 32)\n }\n \n // Write the last 32 bytes\n mstore(dEnd, last)\n }\n } else {\n assembly {\n // We subtract 32 from `sEnd` and `dEnd` because those\n // are the starting points when copying a word at the end.\n length := sub(length, 32)\n let sEnd := add(source, length)\n let dEnd := add(dest, length)\n\n // Remember the first 32 bytes of source\n // This needs to be done here and not after the loop\n // because we may have overwritten the first bytes in\n // source already due to overlap.\n let first := mload(source)\n\n // Copy whole words back to front\n // We use a signed comparisson here to allow dEnd to become\n // negative (happens when source and dest < 32). Valid\n // addresses in local memory will never be larger than\n // 2**255, so they can be safely re-interpreted as signed.\n // Note: the first check is always true,\n // this could have been a do-while loop.\n // solhint-disable-next-line no-empty-blocks\n for {} slt(dest, dEnd) {} {\n mstore(dEnd, mload(sEnd))\n sEnd := sub(sEnd, 32)\n dEnd := sub(dEnd, 32)\n }\n \n // Write the first 32 bytes\n mstore(dest, first)\n }\n }\n }\n }\n\n /// @dev Returns a slices from a byte array.\n /// @param b The byte array to take a slice from.\n /// @param from The starting index for the slice (inclusive).\n /// @param to The final index for the slice (exclusive).\n /// @return result The slice containing bytes at indices [from, to)\n function slice(\n bytes memory b,\n uint256 from,\n uint256 to\n )\n internal\n pure\n returns (bytes memory result)\n {\n require(\n from <= to,\n \"FROM_LESS_THAN_TO_REQUIRED\"\n );\n require(\n to < b.length,\n \"TO_LESS_THAN_LENGTH_REQUIRED\"\n );\n \n // Create a new bytes structure and copy contents\n result = new bytes(to - from);\n memCopy(\n result.contentAddress(),\n b.contentAddress() + from,\n result.length\n );\n return result;\n }\n \n /// @dev Returns a slice from a byte array without preserving the input.\n /// @param b The byte array to take a slice from. Will be destroyed in the process.\n /// @param from The starting index for the slice (inclusive).\n /// @param to The final index for the slice (exclusive).\n /// @return result The slice containing bytes at indices [from, to)\n /// @dev When `from == 0`, the original array will match the slice. In other cases its state will be corrupted.\n function sliceDestructive(\n bytes memory b,\n uint256 from,\n uint256 to\n )\n internal\n pure\n returns (bytes memory result)\n {\n require(\n from <= to,\n \"FROM_LESS_THAN_TO_REQUIRED\"\n );\n require(\n to < b.length,\n \"TO_LESS_THAN_LENGTH_REQUIRED\"\n );\n \n // Create a new bytes structure around [from, to) in-place.\n assembly {\n result := add(b, from)\n mstore(result, sub(to, from))\n }\n return result;\n }\n\n /// @dev Pops the last byte off of a byte array by modifying its length.\n /// @param b Byte array that will be modified.\n /// @return The byte that was popped off.\n function popLastByte(bytes memory b)\n internal\n pure\n returns (bytes1 result)\n {\n require(\n b.length > 0,\n \"GREATER_THAN_ZERO_LENGTH_REQUIRED\"\n );\n\n // Store last byte.\n result = b[b.length - 1];\n\n assembly {\n // Decrement length of byte array.\n let newLen := sub(mload(b), 1)\n mstore(b, newLen)\n }\n return result;\n }\n\n /// @dev Pops the last 20 bytes off of a byte array by modifying its length.\n /// @param b Byte array that will be modified.\n /// @return The 20 byte address that was popped off.\n function popLast20Bytes(bytes memory b)\n internal\n pure\n returns (address result)\n {\n require(\n b.length >= 20,\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Store last 20 bytes.\n result = readAddress(b, b.length - 20);\n\n assembly {\n // Subtract 20 from byte array length.\n let newLen := sub(mload(b), 20)\n mstore(b, newLen)\n }\n return result;\n }\n\n /// @dev Tests equality of two byte arrays.\n /// @param lhs First byte array to compare.\n /// @param rhs Second byte array to compare.\n /// @return True if arrays are the same. False otherwise.\n function equals(\n bytes memory lhs,\n bytes memory rhs\n )\n internal\n pure\n returns (bool equal)\n {\n // Keccak gas cost is 30 + numWords * 6. This is a cheap way to compare.\n // We early exit on unequal lengths, but keccak would also correctly\n // handle this.\n return lhs.length == rhs.length && keccak256(lhs) == keccak256(rhs);\n }\n\n /// @dev Reads an address from a position in a byte array.\n /// @param b Byte array containing an address.\n /// @param index Index in byte array of address.\n /// @return address from byte array.\n function readAddress(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (address result)\n {\n require(\n b.length >= index + 20, // 20 is length of address\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Add offset to index:\n // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)\n // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)\n index += 20;\n\n // Read address from array memory\n assembly {\n // 1. Add index to address of bytes array\n // 2. Load 32-byte word from memory\n // 3. Apply 20-byte mask to obtain address\n result := and(mload(add(b, index)), 0xffffffffffffffffffffffffffffffffffffffff)\n }\n return result;\n }\n\n /// @dev Writes an address into a specific position in a byte array.\n /// @param b Byte array to insert address into.\n /// @param index Index in byte array of address.\n /// @param input Address to put into byte array.\n function writeAddress(\n bytes memory b,\n uint256 index,\n address input\n )\n internal\n pure\n {\n require(\n b.length >= index + 20, // 20 is length of address\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Add offset to index:\n // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)\n // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)\n index += 20;\n\n // Store address into array memory\n assembly {\n // The address occupies 20 bytes and mstore stores 32 bytes.\n // First fetch the 32-byte word where we'll be storing the address, then\n // apply a mask so we have only the bytes in the word that the address will not occupy.\n // Then combine these bytes with the address and store the 32 bytes back to memory with mstore.\n\n // 1. Add index to address of bytes array\n // 2. Load 32-byte word from memory\n // 3. Apply 12-byte mask to obtain extra bytes occupying word of memory where we'll store the address\n let neighbors := and(\n mload(add(b, index)),\n 0xffffffffffffffffffffffff0000000000000000000000000000000000000000\n )\n \n // Make sure input address is clean.\n // (Solidity does not guarantee this)\n input := and(input, 0xffffffffffffffffffffffffffffffffffffffff)\n\n // Store the neighbors and address into memory\n mstore(add(b, index), xor(input, neighbors))\n }\n }\n\n /// @dev Reads a bytes32 value from a position in a byte array.\n /// @param b Byte array containing a bytes32 value.\n /// @param index Index in byte array of bytes32 value.\n /// @return bytes32 value from byte array.\n function readBytes32(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes32 result)\n {\n require(\n b.length >= index + 32,\n \"GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 256 bit length parameter\n index += 32;\n\n // Read the bytes32 from array memory\n assembly {\n result := mload(add(b, index))\n }\n return result;\n }\n\n /// @dev Writes a bytes32 into a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input bytes32 to put into byte array.\n function writeBytes32(\n bytes memory b,\n uint256 index,\n bytes32 input\n )\n internal\n pure\n {\n require(\n b.length >= index + 32,\n \"GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 256 bit length parameter\n index += 32;\n\n // Read the bytes32 from array memory\n assembly {\n mstore(add(b, index), input)\n }\n }\n\n /// @dev Reads a uint256 value from a position in a byte array.\n /// @param b Byte array containing a uint256 value.\n /// @param index Index in byte array of uint256 value.\n /// @return uint256 value from byte array.\n function readUint256(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (uint256 result)\n {\n result = uint256(readBytes32(b, index));\n return result;\n }\n\n /// @dev Writes a uint256 into a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input uint256 to put into byte array.\n function writeUint256(\n bytes memory b,\n uint256 index,\n uint256 input\n )\n internal\n pure\n {\n writeBytes32(b, index, bytes32(input));\n }\n\n /// @dev Reads an unpadded bytes4 value from a position in a byte array.\n /// @param b Byte array containing a bytes4 value.\n /// @param index Index in byte array of bytes4 value.\n /// @return bytes4 value from byte array.\n function readBytes4(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes4 result)\n {\n require(\n b.length >= index + 4,\n \"GREATER_OR_EQUAL_TO_4_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 32 byte length field\n index += 32;\n\n // Read the bytes4 from array memory\n assembly {\n result := mload(add(b, index))\n // Solidity does not require us to clean the trailing bytes.\n // We do it anyway\n result := and(result, 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000)\n }\n return result;\n }\n\n /// @dev Reads nested bytes from a specific position.\n /// @dev NOTE: the returned value overlaps with the input value.\n /// Both should be treated as immutable.\n /// @param b Byte array containing nested bytes.\n /// @param index Index of nested bytes.\n /// @return result Nested bytes.\n function readBytesWithLength(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes memory result)\n {\n // Read length of nested bytes\n uint256 nestedBytesLength = readUint256(b, index);\n index += 32;\n\n // Assert length of <b> is valid, given\n // length of nested bytes\n require(\n b.length >= index + nestedBytesLength,\n \"GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED\"\n );\n \n // Return a pointer to the byte array as it exists inside `b`\n assembly {\n result := add(b, index)\n }\n return result;\n }\n\n /// @dev Inserts bytes at a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input bytes to insert.\n function writeBytesWithLength(\n bytes memory b,\n uint256 index,\n bytes memory input\n )\n internal\n pure\n {\n // Assert length of <b> is valid, given\n // length of input\n require(\n b.length >= index + 32 + input.length, // 32 bytes to store length\n \"GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED\"\n );\n\n // Copy <input> into <b>\n memCopy(\n b.contentAddress() + index,\n input.rawAddress(), // includes length of <input>\n input.length + 32 // +32 bytes to store <input> length\n );\n }\n\n /// @dev Performs a deep copy of a byte array onto another byte array of greater than or equal length.\n /// @param dest Byte array that will be overwritten with source bytes.\n /// @param source Byte array to copy onto dest bytes.\n function deepCopyBytes(\n bytes memory dest,\n bytes memory source\n )\n internal\n pure\n {\n uint256 sourceLen = source.length;\n // Dest length must be >= source length, or some bytes would not be copied.\n require(\n dest.length >= sourceLen,\n \"GREATER_OR_EQUAL_TO_SOURCE_BYTES_LENGTH_REQUIRED\"\n );\n memCopy(\n dest.contentAddress(),\n source.contentAddress(),\n sourceLen\n );\n }\n}\n",
- "2.0.0/utils/Ownable/IOwnable.sol": "pragma solidity 0.4.24;\n\n\ncontract IOwnable {\n\n function transferOwnership(address newOwner)\n public;\n}\n",
- "2.0.0/utils/Ownable/Ownable.sol": "pragma solidity 0.4.24;\n\nimport \"./IOwnable.sol\";\n\n\ncontract Ownable is\n IOwnable\n{\n address public owner;\n\n constructor ()\n public\n {\n owner = msg.sender;\n }\n\n modifier onlyOwner() {\n require(\n msg.sender == owner,\n \"ONLY_CONTRACT_OWNER\"\n );\n _;\n }\n\n function transferOwnership(address newOwner)\n public\n onlyOwner\n {\n if (newOwner != address(0)) {\n owner = newOwner;\n }\n }\n}\n",
- "2.0.0/utils/ReentrancyGuard/ReentrancyGuard.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract ReentrancyGuard {\n\n // Locked state of mutex\n bool private locked = false;\n\n /// @dev Functions with this modifer cannot be reentered. The mutex will be locked\n /// before function execution and unlocked after.\n modifier nonReentrant() {\n // Ensure mutex is unlocked\n require(\n !locked,\n \"REENTRANCY_ILLEGAL\"\n );\n\n // Lock mutex before function call\n locked = true;\n\n // Perform function call\n _;\n\n // Unlock mutex after function call\n locked = false;\n }\n}\n",
- "2.0.0/utils/SafeMath/SafeMath.sol": "pragma solidity 0.4.24;\n\n\ncontract SafeMath {\n\n function safeMul(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n if (a == 0) {\n return 0;\n }\n uint256 c = a * b;\n require(\n c / a == b,\n \"UINT256_OVERFLOW\"\n );\n return c;\n }\n\n function safeDiv(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n uint256 c = a / b;\n return c;\n }\n\n function safeSub(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n require(\n b <= a,\n \"UINT256_UNDERFLOW\"\n );\n return a - b;\n }\n\n function safeAdd(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n uint256 c = a + b;\n require(\n c >= a,\n \"UINT256_OVERFLOW\"\n );\n return c;\n }\n\n function max64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n\n function max256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n}\n"
- },
- "sourceTreeHashHex": "0xbd0ac9751d7681f909fd16b969568f4dfcee9893e0b084aa1b198b6bb38f8f48",
- "compiler": {
- "name": "solc",
- "version": "soljson-v0.4.24+commit.e67f0147.js",
- "settings": {
- "optimizer": {
- "enabled": true,
- "runs": 1000000
- },
- "outputSelection": {
- "*": {
- "*": [
- "abi",
- "evm.bytecode.object",
- "evm.bytecode.sourceMap",
- "evm.deployedBytecode.object",
- "evm.deployedBytecode.sourceMap"
- ]
- }
- }
- }
- },
- "networks": {
- "3": {
- "address": "0xff67881f8d12f372d91baae9752eb3631ff0ed00",
- "links": {},
- "constructorArgs": "[\"0x Protocol Token\",\"ZRX\",\"18\",\"1000000000000000000000000000\"]"
- },
- "42": {
- "address": "0x2002d3812f58e35f0ea1ffbf80a75a38c32175fa",
- "links": {},
- "constructorArgs": "[\"0x Protocol Token\",\"ZRX\",\"18\",\"1000000000000000000000000000\"]"
- },
- "50": {
- "address": "0x871dd7c2b4b25e1aa18728e9d5f2af4c4e431f5c",
- "links": {},
- "constructorArgs": "[\"0x Protocol Token\",\"ZRX\",\"18\",\"115792089237316195423570985008687907853269984665640564039457584007913129639935\"]"
- }
- }
-}
diff --git a/packages/migrations/artifacts/2.0.0-testnet/DummyERC721Token.json b/packages/migrations/artifacts/2.0.0-testnet/DummyERC721Token.json
deleted file mode 100644
index f0363ad81..000000000
--- a/packages/migrations/artifacts/2.0.0-testnet/DummyERC721Token.json
+++ /dev/null
@@ -1,672 +0,0 @@
-{
- "schemaVersion": "2.0.0",
- "contractName": "DummyERC721Token",
- "compilerOutput": {
- "abi": [
- {
- "constant": true,
- "inputs": [],
- "name": "name",
- "outputs": [
- {
- "name": "",
- "type": "string"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "_tokenId",
- "type": "uint256"
- }
- ],
- "name": "getApproved",
- "outputs": [
- {
- "name": "",
- "type": "address"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_approved",
- "type": "address"
- },
- {
- "name": "_tokenId",
- "type": "uint256"
- }
- ],
- "name": "approve",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_from",
- "type": "address"
- },
- {
- "name": "_to",
- "type": "address"
- },
- {
- "name": "_tokenId",
- "type": "uint256"
- }
- ],
- "name": "transferFrom",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_to",
- "type": "address"
- },
- {
- "name": "_tokenId",
- "type": "uint256"
- }
- ],
- "name": "mint",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_from",
- "type": "address"
- },
- {
- "name": "_to",
- "type": "address"
- },
- {
- "name": "_tokenId",
- "type": "uint256"
- }
- ],
- "name": "safeTransferFrom",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "_tokenId",
- "type": "uint256"
- }
- ],
- "name": "ownerOf",
- "outputs": [
- {
- "name": "",
- "type": "address"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "_owner",
- "type": "address"
- }
- ],
- "name": "balanceOf",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "owner",
- "outputs": [
- {
- "name": "",
- "type": "address"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "symbol",
- "outputs": [
- {
- "name": "",
- "type": "string"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_owner",
- "type": "address"
- },
- {
- "name": "_tokenId",
- "type": "uint256"
- }
- ],
- "name": "burn",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_operator",
- "type": "address"
- },
- {
- "name": "_approved",
- "type": "bool"
- }
- ],
- "name": "setApprovalForAll",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_from",
- "type": "address"
- },
- {
- "name": "_to",
- "type": "address"
- },
- {
- "name": "_tokenId",
- "type": "uint256"
- },
- {
- "name": "_data",
- "type": "bytes"
- }
- ],
- "name": "safeTransferFrom",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "_owner",
- "type": "address"
- },
- {
- "name": "_operator",
- "type": "address"
- }
- ],
- "name": "isApprovedForAll",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "newOwner",
- "type": "address"
- }
- ],
- "name": "transferOwnership",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "inputs": [
- {
- "name": "_name",
- "type": "string"
- },
- {
- "name": "_symbol",
- "type": "string"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "constructor"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "_from",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "_to",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "_tokenId",
- "type": "uint256"
- }
- ],
- "name": "Transfer",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "_owner",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "_approved",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "_tokenId",
- "type": "uint256"
- }
- ],
- "name": "Approval",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "_owner",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "_operator",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "_approved",
- "type": "bool"
- }
- ],
- "name": "ApprovalForAll",
- "type": "event"
- }
- ],
- "evm": {
- "bytecode": {
- "linkReferences": {},
- "object": "0x60806040523480156200001157600080fd5b506040516200175e3803806200175e83398101604052805160208083015160008054600160a060020a031916331790559183018051909392909201916200005f91600591908501906200007e565b508051620000759060069060208401906200007e565b50505062000123565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10620000c157805160ff1916838001178555620000f1565b82800160010185558215620000f1579182015b82811115620000f1578251825591602001919060010190620000d4565b50620000ff92915062000103565b5090565b6200012091905b80821115620000ff57600081556001016200010a565b90565b61162b80620001336000396000f3006080604052600436106100da5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100df578063081812fc14610169578063095ea7b3146101aa57806323b872dd146101dd57806340c10f191461021457806342842e0e146102455780636352211e1461027c57806370a08231146102945780638da5cb5b146102d457806395d89b41146102e95780639dc29fac146102fe578063a22cb4651461032f578063b88d4fde14610362578063e985e9c5146103a8578063f2fde38b146103f0575b600080fd5b3480156100eb57600080fd5b506100f461041e565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561012e578181015183820152602001610116565b50505050905090810190601f16801561015b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561017557600080fd5b506101816004356104ca565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b3480156101b657600080fd5b506101db73ffffffffffffffffffffffffffffffffffffffff600435166024356104f2565b005b3480156101e957600080fd5b506101db73ffffffffffffffffffffffffffffffffffffffff60043581169060243516604435610616565b34801561022057600080fd5b506101db73ffffffffffffffffffffffffffffffffffffffff60043516602435610977565b34801561025157600080fd5b506101db73ffffffffffffffffffffffffffffffffffffffff60043581169060243516604435610985565b34801561028857600080fd5b50610181600435610b50565b3480156102a057600080fd5b506102c273ffffffffffffffffffffffffffffffffffffffff60043516610be9565b60408051918252519081900360200190f35b3480156102e057600080fd5b50610181610c98565b3480156102f557600080fd5b506100f4610cb4565b34801561030a57600080fd5b506101db73ffffffffffffffffffffffffffffffffffffffff60043516602435610d2d565b34801561033b57600080fd5b506101db73ffffffffffffffffffffffffffffffffffffffff600435166024351515610dbd565b34801561036e57600080fd5b506101db73ffffffffffffffffffffffffffffffffffffffff60048035821691602480359091169160443591606435908101910135610e56565b3480156103b457600080fd5b506103dc73ffffffffffffffffffffffffffffffffffffffff6004358116906024351661103a565b604080519115158252519081900360200190f35b3480156103fc57600080fd5b506101db73ffffffffffffffffffffffffffffffffffffffff60043516611075565b6005805460408051602060026001851615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f810184900484028201840190925281815292918301828280156104c25780601f10610497576101008083540402835291602001916104c2565b820191906000526020600020905b8154815290600101906020018083116104a557829003601f168201915b505050505081565b60009081526002602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b60006104fd82610b50565b90503373ffffffffffffffffffffffffffffffffffffffff821614806105285750610528813361103a565b151561059557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4552433732315f494e56414c49445f53454e4445520000000000000000000000604482015290519081900360640190fd5b60008281526002602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff87811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6000808073ffffffffffffffffffffffffffffffffffffffff8516151561069e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4552433732315f5a45524f5f544f5f4144445245535300000000000000000000604482015290519081900360640190fd5b6106a784610b50565b925073ffffffffffffffffffffffffffffffffffffffff8681169084161461073057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4552433732315f4f574e45525f4d49534d415443480000000000000000000000604482015290519081900360640190fd5b33915061073c846104ca565b90508273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148061077d575061077d838361103a565b806107b357508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b151561082057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4552433732315f494e56414c49445f5350454e44455200000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff81161561087157600084815260026020526040902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001690555b600084815260016020818152604080842080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8b8116919091179091558a1684526003909152909120546108db9161115b565b73ffffffffffffffffffffffffffffffffffffffff80881660009081526003602052604080822093909355908716815220546109189060016111d2565b73ffffffffffffffffffffffffffffffffffffffff808716600081815260036020526040808220949094559251879391928a16917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050505050565b610981828261124d565b5050565b600080610993858585610616565b833b91506000821115610b4957604080517f150b7a0200000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff8781166024830152604482018690526080606483015260006084830181905292519087169263150b7a029260c480820193602093909283900390910190829087803b158015610a3057600080fd5b505af1158015610a44573d6000803e3d6000fd5b505050506040513d6020811015610a5a57600080fd5b5051604080517f6f6e455243373231526563656976656428616464726573732c6164647265737381527f2c75696e743235362c62797465732900000000000000000000000000000000006020820152905190819003602f0190209091507fffffffff00000000000000000000000000000000000000000000000000000000808316911614610b4957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4552433732315f494e56414c49445f53454c4543544f52000000000000000000604482015290519081900360640190fd5b5050505050565b60008181526001602052604081205473ffffffffffffffffffffffffffffffffffffffff16801515610be357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f4552433732315f5a45524f5f4f574e4552000000000000000000000000000000604482015290519081900360640190fd5b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82161515610c6f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f4552433732315f5a45524f5f4f574e4552000000000000000000000000000000604482015290519081900360640190fd5b5073ffffffffffffffffffffffffffffffffffffffff1660009081526003602052604090205490565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b6006805460408051602060026001851615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f810184900484028201840190925281815292918301828280156104c25780601f10610497576101008083540402835291602001916104c2565b60005473ffffffffffffffffffffffffffffffffffffffff163314610db357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b6109818282611425565b33600081815260046020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168085529083529281902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016861515908117909155815190815290519293927f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31929181900390910190a35050565b600080610e64878787610616565b853b91506000821115611031576040517f150b7a02000000000000000000000000000000000000000000000000000000008152336004820181815273ffffffffffffffffffffffffffffffffffffffff8a811660248501526044840189905260806064850190815260848501889052908a169363150b7a0293928c928b928b928b92909160a40184848082843782019150509650505050505050602060405180830381600087803b158015610f1857600080fd5b505af1158015610f2c573d6000803e3d6000fd5b505050506040513d6020811015610f4257600080fd5b5051604080517f6f6e455243373231526563656976656428616464726573732c6164647265737381527f2c75696e743235362c62797465732900000000000000000000000000000000006020820152905190819003602f0190209091507fffffffff0000000000000000000000000000000000000000000000000000000080831691161461103157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4552433732315f494e56414c49445f53454c4543544f52000000000000000000604482015290519081900360640190fd5b50505050505050565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260046020908152604080832093909416825291909152205460ff1690565b60005473ffffffffffffffffffffffffffffffffffffffff1633146110fb57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff81161561115857600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83161790555b50565b6000828211156111cc57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f55494e543235365f554e444552464c4f57000000000000000000000000000000604482015290519081900360640190fd5b50900390565b60008282018381101561124657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f55494e543235365f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b9392505050565b600073ffffffffffffffffffffffffffffffffffffffff831615156112d357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4552433732315f5a45524f5f544f5f4144445245535300000000000000000000604482015290519081900360640190fd5b5060008181526001602052604090205473ffffffffffffffffffffffffffffffffffffffff16801561136657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f4552433732315f4f574e45525f414c52454144595f4558495354530000000000604482015290519081900360640190fd5b600082815260016020818152604080842080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff891690811790915584526003909152909120546113cc916111d2565b73ffffffffffffffffffffffffffffffffffffffff84166000818152600360205260408082209390935591518492907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4505050565b600073ffffffffffffffffffffffffffffffffffffffff831615156114ab57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4552433732315f5a45524f5f4f574e45525f4144445245535300000000000000604482015290519081900360640190fd5b5060008181526001602052604090205473ffffffffffffffffffffffffffffffffffffffff908116908316811461154357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4552433732315f4f574e45525f4d49534d415443480000000000000000000000604482015290519081900360640190fd5b600082815260016020818152604080842080547fffffffffffffffffffffffff000000000000000000000000000000000000000016905573ffffffffffffffffffffffffffffffffffffffff871684526003909152909120546115a59161115b565b73ffffffffffffffffffffffffffffffffffffffff8416600081815260036020526040808220939093559151849291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050505600a165627a7a72305820b4f0e9923df681b39c750c35907b3b53e3d18d5d27a56215be103c035936a9e00029",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH3 0x11 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x40 MLOAD PUSH3 0x175E CODESIZE SUB DUP1 PUSH3 0x175E DUP4 CODECOPY DUP2 ADD PUSH1 0x40 MSTORE DUP1 MLOAD PUSH1 0x20 DUP1 DUP4 ADD MLOAD PUSH1 0x0 DUP1 SLOAD PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB NOT AND CALLER OR SWAP1 SSTORE SWAP2 DUP4 ADD DUP1 MLOAD SWAP1 SWAP4 SWAP3 SWAP1 SWAP3 ADD SWAP2 PUSH3 0x5F SWAP2 PUSH1 0x5 SWAP2 SWAP1 DUP6 ADD SWAP1 PUSH3 0x7E JUMP JUMPDEST POP DUP1 MLOAD PUSH3 0x75 SWAP1 PUSH1 0x6 SWAP1 PUSH1 0x20 DUP5 ADD SWAP1 PUSH3 0x7E JUMP JUMPDEST POP POP POP PUSH3 0x123 JUMP JUMPDEST DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 PUSH1 0x1F ADD PUSH1 0x20 SWAP1 DIV DUP2 ADD SWAP3 DUP3 PUSH1 0x1F LT PUSH3 0xC1 JUMPI DUP1 MLOAD PUSH1 0xFF NOT AND DUP4 DUP1 ADD OR DUP6 SSTORE PUSH3 0xF1 JUMP JUMPDEST DUP3 DUP1 ADD PUSH1 0x1 ADD DUP6 SSTORE DUP3 ISZERO PUSH3 0xF1 JUMPI SWAP2 DUP3 ADD JUMPDEST DUP3 DUP2 GT ISZERO PUSH3 0xF1 JUMPI DUP3 MLOAD DUP3 SSTORE SWAP2 PUSH1 0x20 ADD SWAP2 SWAP1 PUSH1 0x1 ADD SWAP1 PUSH3 0xD4 JUMP JUMPDEST POP PUSH3 0xFF SWAP3 SWAP2 POP PUSH3 0x103 JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST PUSH3 0x120 SWAP2 SWAP1 JUMPDEST DUP1 DUP3 GT ISZERO PUSH3 0xFF JUMPI PUSH1 0x0 DUP2 SSTORE PUSH1 0x1 ADD PUSH3 0x10A JUMP JUMPDEST SWAP1 JUMP JUMPDEST PUSH2 0x162B DUP1 PUSH3 0x133 PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN STOP PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0xDA JUMPI PUSH4 0xFFFFFFFF PUSH29 0x100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD DIV AND PUSH4 0x6FDDE03 DUP2 EQ PUSH2 0xDF JUMPI DUP1 PUSH4 0x81812FC EQ PUSH2 0x169 JUMPI DUP1 PUSH4 0x95EA7B3 EQ PUSH2 0x1AA JUMPI DUP1 PUSH4 0x23B872DD EQ PUSH2 0x1DD JUMPI DUP1 PUSH4 0x40C10F19 EQ PUSH2 0x214 JUMPI DUP1 PUSH4 0x42842E0E EQ PUSH2 0x245 JUMPI DUP1 PUSH4 0x6352211E EQ PUSH2 0x27C JUMPI DUP1 PUSH4 0x70A08231 EQ PUSH2 0x294 JUMPI DUP1 PUSH4 0x8DA5CB5B EQ PUSH2 0x2D4 JUMPI DUP1 PUSH4 0x95D89B41 EQ PUSH2 0x2E9 JUMPI DUP1 PUSH4 0x9DC29FAC EQ PUSH2 0x2FE JUMPI DUP1 PUSH4 0xA22CB465 EQ PUSH2 0x32F JUMPI DUP1 PUSH4 0xB88D4FDE EQ PUSH2 0x362 JUMPI DUP1 PUSH4 0xE985E9C5 EQ PUSH2 0x3A8 JUMPI DUP1 PUSH4 0xF2FDE38B EQ PUSH2 0x3F0 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xEB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xF4 PUSH2 0x41E JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 DUP1 DUP3 MSTORE DUP4 MLOAD DUP2 DUP4 ADD MSTORE DUP4 MLOAD SWAP2 SWAP3 DUP4 SWAP3 SWAP1 DUP4 ADD SWAP2 DUP6 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x12E JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH2 0x116 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x15B JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x175 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x181 PUSH1 0x4 CALLDATALOAD PUSH2 0x4CA JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1B6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1DB PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x4F2 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1E9 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1DB PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH1 0x44 CALLDATALOAD PUSH2 0x616 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x220 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1DB PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x977 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x251 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1DB PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH1 0x44 CALLDATALOAD PUSH2 0x985 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x288 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x181 PUSH1 0x4 CALLDATALOAD PUSH2 0xB50 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2A0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2C2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0xBE9 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2E0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x181 PUSH2 0xC98 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2F5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xF4 PUSH2 0xCB4 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x30A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1DB PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0xD2D JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x33B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1DB PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD ISZERO ISZERO PUSH2 0xDBD JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x36E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1DB PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 DUP1 CALLDATALOAD DUP3 AND SWAP2 PUSH1 0x24 DUP1 CALLDATALOAD SWAP1 SWAP2 AND SWAP2 PUSH1 0x44 CALLDATALOAD SWAP2 PUSH1 0x64 CALLDATALOAD SWAP1 DUP2 ADD SWAP2 ADD CALLDATALOAD PUSH2 0xE56 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3B4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x3DC PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH2 0x103A JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 ISZERO ISZERO DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3FC JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1DB PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x1075 JUMP JUMPDEST PUSH1 0x5 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 PUSH1 0x2 PUSH1 0x1 DUP6 AND ISZERO PUSH2 0x100 MUL PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 SWAP5 AND SWAP4 SWAP1 SWAP4 DIV PUSH1 0x1F DUP2 ADD DUP5 SWAP1 DIV DUP5 MUL DUP3 ADD DUP5 ADD SWAP1 SWAP3 MSTORE DUP2 DUP2 MSTORE SWAP3 SWAP2 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0x4C2 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x497 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x4C2 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x4A5 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP DUP2 JUMP JUMPDEST PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x4FD DUP3 PUSH2 0xB50 JUMP JUMPDEST SWAP1 POP CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND EQ DUP1 PUSH2 0x528 JUMPI POP PUSH2 0x528 DUP2 CALLER PUSH2 0x103A JUMP JUMPDEST ISZERO ISZERO PUSH2 0x595 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x15 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F494E56414C49445F53454E4445520000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x0 DUP3 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 DUP2 AND SWAP2 DUP3 OR SWAP1 SWAP3 SSTORE SWAP2 MLOAD DUP6 SWAP4 SWAP2 DUP6 AND SWAP2 PUSH32 0x8C5BE1E5EBEC7D5BD14F71427D1E84F3DD0314C0F7B2291E5B200AC8C7C3B925 SWAP2 LOG4 POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP6 AND ISZERO ISZERO PUSH2 0x69E JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x16 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F5A45524F5F544F5F4144445245535300000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH2 0x6A7 DUP5 PUSH2 0xB50 JUMP JUMPDEST SWAP3 POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP7 DUP2 AND SWAP1 DUP5 AND EQ PUSH2 0x730 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x15 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F4F574E45525F4D49534D415443480000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST CALLER SWAP2 POP PUSH2 0x73C DUP5 PUSH2 0x4CA JUMP JUMPDEST SWAP1 POP DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ DUP1 PUSH2 0x77D JUMPI POP PUSH2 0x77D DUP4 DUP4 PUSH2 0x103A JUMP JUMPDEST DUP1 PUSH2 0x7B3 JUMPI POP DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ JUMPDEST ISZERO ISZERO PUSH2 0x820 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x16 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F494E56414C49445F5350454E44455200000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND ISZERO PUSH2 0x871 JUMPI PUSH1 0x0 DUP5 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND SWAP1 SSTORE JUMPDEST PUSH1 0x0 DUP5 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 DUP2 DUP2 MSTORE PUSH1 0x40 DUP1 DUP5 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP12 DUP2 AND SWAP2 SWAP1 SWAP2 OR SWAP1 SWAP2 SSTORE DUP11 AND DUP5 MSTORE PUSH1 0x3 SWAP1 SWAP2 MSTORE SWAP1 SWAP2 KECCAK256 SLOAD PUSH2 0x8DB SWAP2 PUSH2 0x115B JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP9 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x3 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 SWAP4 SWAP1 SWAP4 SSTORE SWAP1 DUP8 AND DUP2 MSTORE KECCAK256 SLOAD PUSH2 0x918 SWAP1 PUSH1 0x1 PUSH2 0x11D2 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP8 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x3 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 SWAP5 SWAP1 SWAP5 SSTORE SWAP3 MLOAD DUP8 SWAP4 SWAP2 SWAP3 DUP11 AND SWAP2 PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF SWAP2 LOG4 POP POP POP POP POP POP JUMP JUMPDEST PUSH2 0x981 DUP3 DUP3 PUSH2 0x124D JUMP JUMPDEST POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x993 DUP6 DUP6 DUP6 PUSH2 0x616 JUMP JUMPDEST DUP4 EXTCODESIZE SWAP2 POP PUSH1 0x0 DUP3 GT ISZERO PUSH2 0xB49 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x150B7A0200000000000000000000000000000000000000000000000000000000 DUP2 MSTORE CALLER PUSH1 0x4 DUP3 ADD MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 DUP2 AND PUSH1 0x24 DUP4 ADD MSTORE PUSH1 0x44 DUP3 ADD DUP7 SWAP1 MSTORE PUSH1 0x80 PUSH1 0x64 DUP4 ADD MSTORE PUSH1 0x0 PUSH1 0x84 DUP4 ADD DUP2 SWAP1 MSTORE SWAP3 MLOAD SWAP1 DUP8 AND SWAP3 PUSH4 0x150B7A02 SWAP3 PUSH1 0xC4 DUP1 DUP3 ADD SWAP4 PUSH1 0x20 SWAP4 SWAP1 SWAP3 DUP4 SWAP1 SUB SWAP1 SWAP2 ADD SWAP1 DUP3 SWAP1 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0xA30 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0xA44 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x20 DUP2 LT ISZERO PUSH2 0xA5A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP MLOAD PUSH1 0x40 DUP1 MLOAD PUSH32 0x6F6E455243373231526563656976656428616464726573732C61646472657373 DUP2 MSTORE PUSH32 0x2C75696E743235362C6279746573290000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x2F ADD SWAP1 KECCAK256 SWAP1 SWAP2 POP PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 DUP1 DUP4 AND SWAP2 AND EQ PUSH2 0xB49 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x17 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F494E56414C49445F53454C4543544F52000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 DUP2 KECCAK256 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP1 ISZERO ISZERO PUSH2 0xBE3 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x11 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F5A45524F5F4F574E4552000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND ISZERO ISZERO PUSH2 0xC6F JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x11 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F5A45524F5F4F574E4552000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x3 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x6 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 PUSH1 0x2 PUSH1 0x1 DUP6 AND ISZERO PUSH2 0x100 MUL PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 SWAP5 AND SWAP4 SWAP1 SWAP4 DIV PUSH1 0x1F DUP2 ADD DUP5 SWAP1 DIV DUP5 MUL DUP3 ADD DUP5 ADD SWAP1 SWAP3 MSTORE DUP2 DUP2 MSTORE SWAP3 SWAP2 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0x4C2 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x497 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x4C2 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0xDB3 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH2 0x981 DUP3 DUP3 PUSH2 0x1425 JUMP JUMPDEST CALLER PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x4 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 AND DUP1 DUP6 MSTORE SWAP1 DUP4 MSTORE SWAP3 DUP2 SWAP1 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND DUP7 ISZERO ISZERO SWAP1 DUP2 OR SWAP1 SWAP2 SSTORE DUP2 MLOAD SWAP1 DUP2 MSTORE SWAP1 MLOAD SWAP3 SWAP4 SWAP3 PUSH32 0x17307EAB39AB6107E8899845AD3D59BD9653F200F220920489CA2B5937696C31 SWAP3 SWAP2 DUP2 SWAP1 SUB SWAP1 SWAP2 ADD SWAP1 LOG3 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0xE64 DUP8 DUP8 DUP8 PUSH2 0x616 JUMP JUMPDEST DUP6 EXTCODESIZE SWAP2 POP PUSH1 0x0 DUP3 GT ISZERO PUSH2 0x1031 JUMPI PUSH1 0x40 MLOAD PUSH32 0x150B7A0200000000000000000000000000000000000000000000000000000000 DUP2 MSTORE CALLER PUSH1 0x4 DUP3 ADD DUP2 DUP2 MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP11 DUP2 AND PUSH1 0x24 DUP6 ADD MSTORE PUSH1 0x44 DUP5 ADD DUP10 SWAP1 MSTORE PUSH1 0x80 PUSH1 0x64 DUP6 ADD SWAP1 DUP2 MSTORE PUSH1 0x84 DUP6 ADD DUP9 SWAP1 MSTORE SWAP1 DUP11 AND SWAP4 PUSH4 0x150B7A02 SWAP4 SWAP3 DUP13 SWAP3 DUP12 SWAP3 DUP12 SWAP3 DUP12 SWAP3 SWAP1 SWAP2 PUSH1 0xA4 ADD DUP5 DUP5 DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP SWAP7 POP POP POP POP POP POP POP PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0xF18 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0xF2C JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x20 DUP2 LT ISZERO PUSH2 0xF42 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP MLOAD PUSH1 0x40 DUP1 MLOAD PUSH32 0x6F6E455243373231526563656976656428616464726573732C61646472657373 DUP2 MSTORE PUSH32 0x2C75696E743235362C6279746573290000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x2F ADD SWAP1 KECCAK256 SWAP1 SWAP2 POP PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 DUP1 DUP4 AND SWAP2 AND EQ PUSH2 0x1031 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x17 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F494E56414C49445F53454C4543544F52000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP POP POP POP POP POP POP JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP2 DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x4 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 SWAP4 SWAP1 SWAP5 AND DUP3 MSTORE SWAP2 SWAP1 SWAP2 MSTORE KECCAK256 SLOAD PUSH1 0xFF AND SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0x10FB JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND ISZERO PUSH2 0x1158 JUMPI PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND OR SWAP1 SSTORE JUMPDEST POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 GT ISZERO PUSH2 0x11CC JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x11 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x55494E543235365F554E444552464C4F57000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP SWAP1 SUB SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 ADD DUP4 DUP2 LT ISZERO PUSH2 0x1246 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x10 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x55494E543235365F4F564552464C4F5700000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND ISZERO ISZERO PUSH2 0x12D3 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x16 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F5A45524F5F544F5F4144445245535300000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP1 ISZERO PUSH2 0x1366 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x1B PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F4F574E45525F414C52454144595F4558495354530000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x0 DUP3 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 DUP2 DUP2 MSTORE PUSH1 0x40 DUP1 DUP5 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP10 AND SWAP1 DUP2 OR SWAP1 SWAP2 SSTORE DUP5 MSTORE PUSH1 0x3 SWAP1 SWAP2 MSTORE SWAP1 SWAP2 KECCAK256 SLOAD PUSH2 0x13CC SWAP2 PUSH2 0x11D2 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x3 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 SWAP4 SWAP1 SWAP4 SSTORE SWAP2 MLOAD DUP5 SWAP3 SWAP1 PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF SWAP1 DUP3 SWAP1 LOG4 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND ISZERO ISZERO PUSH2 0x14AB JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x19 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F5A45524F5F4F574E45525F4144445245535300000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 DUP2 AND SWAP1 DUP4 AND DUP2 EQ PUSH2 0x1543 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x15 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F4F574E45525F4D49534D415443480000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x0 DUP3 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 DUP2 DUP2 MSTORE PUSH1 0x40 DUP1 DUP5 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND SWAP1 SSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 AND DUP5 MSTORE PUSH1 0x3 SWAP1 SWAP2 MSTORE SWAP1 SWAP2 KECCAK256 SLOAD PUSH2 0x15A5 SWAP2 PUSH2 0x115B JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x3 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 SWAP4 SWAP1 SWAP4 SSTORE SWAP2 MLOAD DUP5 SWAP3 SWAP2 SWAP1 PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF SWAP1 DUP4 SWAP1 LOG4 POP POP POP JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 0xb4 CREATE 0xe9 SWAP3 RETURNDATASIZE 0xf6 DUP2 0xb3 SWAP13 PUSH22 0xC35907B3B53E3D18D5D27A56215BE103C035936A9E0 STOP 0x29 ",
- "sourceMap": "743:1013:51:-;;;866:139;8:9:-1;5:2;;;30:1;27;20:12;5:2;866:139:51;;;;;;;;;;;;;;;;;;;;;162:5:63;:18;;-1:-1:-1;;;;;;162:18:63;170:10;162:18;;;866:139:51;;;960:12;;866:139;;;;;;;960:12;;:4;;:12;;;;;:::i;:::-;-1:-1:-1;982:16:51;;;;:6;;:16;;;;;:::i;:::-;;866:139;;743:1013;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;743:1013:51;;;-1:-1:-1;743:1013:51;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;"
- },
- "deployedBytecode": {
- "linkReferences": {},
- "object": "0x6080604052600436106100da5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100df578063081812fc14610169578063095ea7b3146101aa57806323b872dd146101dd57806340c10f191461021457806342842e0e146102455780636352211e1461027c57806370a08231146102945780638da5cb5b146102d457806395d89b41146102e95780639dc29fac146102fe578063a22cb4651461032f578063b88d4fde14610362578063e985e9c5146103a8578063f2fde38b146103f0575b600080fd5b3480156100eb57600080fd5b506100f461041e565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561012e578181015183820152602001610116565b50505050905090810190601f16801561015b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561017557600080fd5b506101816004356104ca565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b3480156101b657600080fd5b506101db73ffffffffffffffffffffffffffffffffffffffff600435166024356104f2565b005b3480156101e957600080fd5b506101db73ffffffffffffffffffffffffffffffffffffffff60043581169060243516604435610616565b34801561022057600080fd5b506101db73ffffffffffffffffffffffffffffffffffffffff60043516602435610977565b34801561025157600080fd5b506101db73ffffffffffffffffffffffffffffffffffffffff60043581169060243516604435610985565b34801561028857600080fd5b50610181600435610b50565b3480156102a057600080fd5b506102c273ffffffffffffffffffffffffffffffffffffffff60043516610be9565b60408051918252519081900360200190f35b3480156102e057600080fd5b50610181610c98565b3480156102f557600080fd5b506100f4610cb4565b34801561030a57600080fd5b506101db73ffffffffffffffffffffffffffffffffffffffff60043516602435610d2d565b34801561033b57600080fd5b506101db73ffffffffffffffffffffffffffffffffffffffff600435166024351515610dbd565b34801561036e57600080fd5b506101db73ffffffffffffffffffffffffffffffffffffffff60048035821691602480359091169160443591606435908101910135610e56565b3480156103b457600080fd5b506103dc73ffffffffffffffffffffffffffffffffffffffff6004358116906024351661103a565b604080519115158252519081900360200190f35b3480156103fc57600080fd5b506101db73ffffffffffffffffffffffffffffffffffffffff60043516611075565b6005805460408051602060026001851615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f810184900484028201840190925281815292918301828280156104c25780601f10610497576101008083540402835291602001916104c2565b820191906000526020600020905b8154815290600101906020018083116104a557829003601f168201915b505050505081565b60009081526002602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b60006104fd82610b50565b90503373ffffffffffffffffffffffffffffffffffffffff821614806105285750610528813361103a565b151561059557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4552433732315f494e56414c49445f53454e4445520000000000000000000000604482015290519081900360640190fd5b60008281526002602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff87811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6000808073ffffffffffffffffffffffffffffffffffffffff8516151561069e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4552433732315f5a45524f5f544f5f4144445245535300000000000000000000604482015290519081900360640190fd5b6106a784610b50565b925073ffffffffffffffffffffffffffffffffffffffff8681169084161461073057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4552433732315f4f574e45525f4d49534d415443480000000000000000000000604482015290519081900360640190fd5b33915061073c846104ca565b90508273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148061077d575061077d838361103a565b806107b357508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b151561082057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4552433732315f494e56414c49445f5350454e44455200000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff81161561087157600084815260026020526040902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001690555b600084815260016020818152604080842080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8b8116919091179091558a1684526003909152909120546108db9161115b565b73ffffffffffffffffffffffffffffffffffffffff80881660009081526003602052604080822093909355908716815220546109189060016111d2565b73ffffffffffffffffffffffffffffffffffffffff808716600081815260036020526040808220949094559251879391928a16917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050505050565b610981828261124d565b5050565b600080610993858585610616565b833b91506000821115610b4957604080517f150b7a0200000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff8781166024830152604482018690526080606483015260006084830181905292519087169263150b7a029260c480820193602093909283900390910190829087803b158015610a3057600080fd5b505af1158015610a44573d6000803e3d6000fd5b505050506040513d6020811015610a5a57600080fd5b5051604080517f6f6e455243373231526563656976656428616464726573732c6164647265737381527f2c75696e743235362c62797465732900000000000000000000000000000000006020820152905190819003602f0190209091507fffffffff00000000000000000000000000000000000000000000000000000000808316911614610b4957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4552433732315f494e56414c49445f53454c4543544f52000000000000000000604482015290519081900360640190fd5b5050505050565b60008181526001602052604081205473ffffffffffffffffffffffffffffffffffffffff16801515610be357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f4552433732315f5a45524f5f4f574e4552000000000000000000000000000000604482015290519081900360640190fd5b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82161515610c6f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f4552433732315f5a45524f5f4f574e4552000000000000000000000000000000604482015290519081900360640190fd5b5073ffffffffffffffffffffffffffffffffffffffff1660009081526003602052604090205490565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b6006805460408051602060026001851615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f810184900484028201840190925281815292918301828280156104c25780601f10610497576101008083540402835291602001916104c2565b60005473ffffffffffffffffffffffffffffffffffffffff163314610db357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b6109818282611425565b33600081815260046020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168085529083529281902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016861515908117909155815190815290519293927f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31929181900390910190a35050565b600080610e64878787610616565b853b91506000821115611031576040517f150b7a02000000000000000000000000000000000000000000000000000000008152336004820181815273ffffffffffffffffffffffffffffffffffffffff8a811660248501526044840189905260806064850190815260848501889052908a169363150b7a0293928c928b928b928b92909160a40184848082843782019150509650505050505050602060405180830381600087803b158015610f1857600080fd5b505af1158015610f2c573d6000803e3d6000fd5b505050506040513d6020811015610f4257600080fd5b5051604080517f6f6e455243373231526563656976656428616464726573732c6164647265737381527f2c75696e743235362c62797465732900000000000000000000000000000000006020820152905190819003602f0190209091507fffffffff0000000000000000000000000000000000000000000000000000000080831691161461103157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4552433732315f494e56414c49445f53454c4543544f52000000000000000000604482015290519081900360640190fd5b50505050505050565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260046020908152604080832093909416825291909152205460ff1690565b60005473ffffffffffffffffffffffffffffffffffffffff1633146110fb57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff81161561115857600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83161790555b50565b6000828211156111cc57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f55494e543235365f554e444552464c4f57000000000000000000000000000000604482015290519081900360640190fd5b50900390565b60008282018381101561124657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f55494e543235365f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b9392505050565b600073ffffffffffffffffffffffffffffffffffffffff831615156112d357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4552433732315f5a45524f5f544f5f4144445245535300000000000000000000604482015290519081900360640190fd5b5060008181526001602052604090205473ffffffffffffffffffffffffffffffffffffffff16801561136657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f4552433732315f4f574e45525f414c52454144595f4558495354530000000000604482015290519081900360640190fd5b600082815260016020818152604080842080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff891690811790915584526003909152909120546113cc916111d2565b73ffffffffffffffffffffffffffffffffffffffff84166000818152600360205260408082209390935591518492907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4505050565b600073ffffffffffffffffffffffffffffffffffffffff831615156114ab57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4552433732315f5a45524f5f4f574e45525f4144445245535300000000000000604482015290519081900360640190fd5b5060008181526001602052604090205473ffffffffffffffffffffffffffffffffffffffff908116908316811461154357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4552433732315f4f574e45525f4d49534d415443480000000000000000000000604482015290519081900360640190fd5b600082815260016020818152604080842080547fffffffffffffffffffffffff000000000000000000000000000000000000000016905573ffffffffffffffffffffffffffffffffffffffff871684526003909152909120546115a59161115b565b73ffffffffffffffffffffffffffffffffffffffff8416600081815260036020526040808220939093559151849291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050505600a165627a7a72305820b4f0e9923df681b39c750c35907b3b53e3d18d5d27a56215be103c035936a9e00029",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0xDA JUMPI PUSH4 0xFFFFFFFF PUSH29 0x100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD DIV AND PUSH4 0x6FDDE03 DUP2 EQ PUSH2 0xDF JUMPI DUP1 PUSH4 0x81812FC EQ PUSH2 0x169 JUMPI DUP1 PUSH4 0x95EA7B3 EQ PUSH2 0x1AA JUMPI DUP1 PUSH4 0x23B872DD EQ PUSH2 0x1DD JUMPI DUP1 PUSH4 0x40C10F19 EQ PUSH2 0x214 JUMPI DUP1 PUSH4 0x42842E0E EQ PUSH2 0x245 JUMPI DUP1 PUSH4 0x6352211E EQ PUSH2 0x27C JUMPI DUP1 PUSH4 0x70A08231 EQ PUSH2 0x294 JUMPI DUP1 PUSH4 0x8DA5CB5B EQ PUSH2 0x2D4 JUMPI DUP1 PUSH4 0x95D89B41 EQ PUSH2 0x2E9 JUMPI DUP1 PUSH4 0x9DC29FAC EQ PUSH2 0x2FE JUMPI DUP1 PUSH4 0xA22CB465 EQ PUSH2 0x32F JUMPI DUP1 PUSH4 0xB88D4FDE EQ PUSH2 0x362 JUMPI DUP1 PUSH4 0xE985E9C5 EQ PUSH2 0x3A8 JUMPI DUP1 PUSH4 0xF2FDE38B EQ PUSH2 0x3F0 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xEB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xF4 PUSH2 0x41E JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 DUP1 DUP3 MSTORE DUP4 MLOAD DUP2 DUP4 ADD MSTORE DUP4 MLOAD SWAP2 SWAP3 DUP4 SWAP3 SWAP1 DUP4 ADD SWAP2 DUP6 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x12E JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH2 0x116 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x15B JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x175 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x181 PUSH1 0x4 CALLDATALOAD PUSH2 0x4CA JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1B6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1DB PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x4F2 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1E9 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1DB PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH1 0x44 CALLDATALOAD PUSH2 0x616 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x220 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1DB PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x977 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x251 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1DB PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH1 0x44 CALLDATALOAD PUSH2 0x985 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x288 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x181 PUSH1 0x4 CALLDATALOAD PUSH2 0xB50 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2A0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2C2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0xBE9 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2E0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x181 PUSH2 0xC98 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2F5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xF4 PUSH2 0xCB4 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x30A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1DB PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0xD2D JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x33B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1DB PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD ISZERO ISZERO PUSH2 0xDBD JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x36E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1DB PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 DUP1 CALLDATALOAD DUP3 AND SWAP2 PUSH1 0x24 DUP1 CALLDATALOAD SWAP1 SWAP2 AND SWAP2 PUSH1 0x44 CALLDATALOAD SWAP2 PUSH1 0x64 CALLDATALOAD SWAP1 DUP2 ADD SWAP2 ADD CALLDATALOAD PUSH2 0xE56 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3B4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x3DC PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH2 0x103A JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 ISZERO ISZERO DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3FC JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1DB PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x1075 JUMP JUMPDEST PUSH1 0x5 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 PUSH1 0x2 PUSH1 0x1 DUP6 AND ISZERO PUSH2 0x100 MUL PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 SWAP5 AND SWAP4 SWAP1 SWAP4 DIV PUSH1 0x1F DUP2 ADD DUP5 SWAP1 DIV DUP5 MUL DUP3 ADD DUP5 ADD SWAP1 SWAP3 MSTORE DUP2 DUP2 MSTORE SWAP3 SWAP2 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0x4C2 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x497 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x4C2 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x4A5 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP DUP2 JUMP JUMPDEST PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x4FD DUP3 PUSH2 0xB50 JUMP JUMPDEST SWAP1 POP CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND EQ DUP1 PUSH2 0x528 JUMPI POP PUSH2 0x528 DUP2 CALLER PUSH2 0x103A JUMP JUMPDEST ISZERO ISZERO PUSH2 0x595 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x15 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F494E56414C49445F53454E4445520000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x0 DUP3 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 DUP2 AND SWAP2 DUP3 OR SWAP1 SWAP3 SSTORE SWAP2 MLOAD DUP6 SWAP4 SWAP2 DUP6 AND SWAP2 PUSH32 0x8C5BE1E5EBEC7D5BD14F71427D1E84F3DD0314C0F7B2291E5B200AC8C7C3B925 SWAP2 LOG4 POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP6 AND ISZERO ISZERO PUSH2 0x69E JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x16 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F5A45524F5F544F5F4144445245535300000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH2 0x6A7 DUP5 PUSH2 0xB50 JUMP JUMPDEST SWAP3 POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP7 DUP2 AND SWAP1 DUP5 AND EQ PUSH2 0x730 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x15 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F4F574E45525F4D49534D415443480000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST CALLER SWAP2 POP PUSH2 0x73C DUP5 PUSH2 0x4CA JUMP JUMPDEST SWAP1 POP DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ DUP1 PUSH2 0x77D JUMPI POP PUSH2 0x77D DUP4 DUP4 PUSH2 0x103A JUMP JUMPDEST DUP1 PUSH2 0x7B3 JUMPI POP DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ JUMPDEST ISZERO ISZERO PUSH2 0x820 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x16 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F494E56414C49445F5350454E44455200000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND ISZERO PUSH2 0x871 JUMPI PUSH1 0x0 DUP5 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND SWAP1 SSTORE JUMPDEST PUSH1 0x0 DUP5 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 DUP2 DUP2 MSTORE PUSH1 0x40 DUP1 DUP5 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP12 DUP2 AND SWAP2 SWAP1 SWAP2 OR SWAP1 SWAP2 SSTORE DUP11 AND DUP5 MSTORE PUSH1 0x3 SWAP1 SWAP2 MSTORE SWAP1 SWAP2 KECCAK256 SLOAD PUSH2 0x8DB SWAP2 PUSH2 0x115B JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP9 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x3 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 SWAP4 SWAP1 SWAP4 SSTORE SWAP1 DUP8 AND DUP2 MSTORE KECCAK256 SLOAD PUSH2 0x918 SWAP1 PUSH1 0x1 PUSH2 0x11D2 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP8 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x3 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 SWAP5 SWAP1 SWAP5 SSTORE SWAP3 MLOAD DUP8 SWAP4 SWAP2 SWAP3 DUP11 AND SWAP2 PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF SWAP2 LOG4 POP POP POP POP POP POP JUMP JUMPDEST PUSH2 0x981 DUP3 DUP3 PUSH2 0x124D JUMP JUMPDEST POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x993 DUP6 DUP6 DUP6 PUSH2 0x616 JUMP JUMPDEST DUP4 EXTCODESIZE SWAP2 POP PUSH1 0x0 DUP3 GT ISZERO PUSH2 0xB49 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x150B7A0200000000000000000000000000000000000000000000000000000000 DUP2 MSTORE CALLER PUSH1 0x4 DUP3 ADD MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 DUP2 AND PUSH1 0x24 DUP4 ADD MSTORE PUSH1 0x44 DUP3 ADD DUP7 SWAP1 MSTORE PUSH1 0x80 PUSH1 0x64 DUP4 ADD MSTORE PUSH1 0x0 PUSH1 0x84 DUP4 ADD DUP2 SWAP1 MSTORE SWAP3 MLOAD SWAP1 DUP8 AND SWAP3 PUSH4 0x150B7A02 SWAP3 PUSH1 0xC4 DUP1 DUP3 ADD SWAP4 PUSH1 0x20 SWAP4 SWAP1 SWAP3 DUP4 SWAP1 SUB SWAP1 SWAP2 ADD SWAP1 DUP3 SWAP1 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0xA30 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0xA44 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x20 DUP2 LT ISZERO PUSH2 0xA5A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP MLOAD PUSH1 0x40 DUP1 MLOAD PUSH32 0x6F6E455243373231526563656976656428616464726573732C61646472657373 DUP2 MSTORE PUSH32 0x2C75696E743235362C6279746573290000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x2F ADD SWAP1 KECCAK256 SWAP1 SWAP2 POP PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 DUP1 DUP4 AND SWAP2 AND EQ PUSH2 0xB49 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x17 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F494E56414C49445F53454C4543544F52000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 DUP2 KECCAK256 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP1 ISZERO ISZERO PUSH2 0xBE3 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x11 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F5A45524F5F4F574E4552000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND ISZERO ISZERO PUSH2 0xC6F JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x11 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F5A45524F5F4F574E4552000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x3 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x6 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 PUSH1 0x2 PUSH1 0x1 DUP6 AND ISZERO PUSH2 0x100 MUL PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 SWAP5 AND SWAP4 SWAP1 SWAP4 DIV PUSH1 0x1F DUP2 ADD DUP5 SWAP1 DIV DUP5 MUL DUP3 ADD DUP5 ADD SWAP1 SWAP3 MSTORE DUP2 DUP2 MSTORE SWAP3 SWAP2 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0x4C2 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x497 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x4C2 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0xDB3 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH2 0x981 DUP3 DUP3 PUSH2 0x1425 JUMP JUMPDEST CALLER PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x4 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 AND DUP1 DUP6 MSTORE SWAP1 DUP4 MSTORE SWAP3 DUP2 SWAP1 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND DUP7 ISZERO ISZERO SWAP1 DUP2 OR SWAP1 SWAP2 SSTORE DUP2 MLOAD SWAP1 DUP2 MSTORE SWAP1 MLOAD SWAP3 SWAP4 SWAP3 PUSH32 0x17307EAB39AB6107E8899845AD3D59BD9653F200F220920489CA2B5937696C31 SWAP3 SWAP2 DUP2 SWAP1 SUB SWAP1 SWAP2 ADD SWAP1 LOG3 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0xE64 DUP8 DUP8 DUP8 PUSH2 0x616 JUMP JUMPDEST DUP6 EXTCODESIZE SWAP2 POP PUSH1 0x0 DUP3 GT ISZERO PUSH2 0x1031 JUMPI PUSH1 0x40 MLOAD PUSH32 0x150B7A0200000000000000000000000000000000000000000000000000000000 DUP2 MSTORE CALLER PUSH1 0x4 DUP3 ADD DUP2 DUP2 MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP11 DUP2 AND PUSH1 0x24 DUP6 ADD MSTORE PUSH1 0x44 DUP5 ADD DUP10 SWAP1 MSTORE PUSH1 0x80 PUSH1 0x64 DUP6 ADD SWAP1 DUP2 MSTORE PUSH1 0x84 DUP6 ADD DUP9 SWAP1 MSTORE SWAP1 DUP11 AND SWAP4 PUSH4 0x150B7A02 SWAP4 SWAP3 DUP13 SWAP3 DUP12 SWAP3 DUP12 SWAP3 DUP12 SWAP3 SWAP1 SWAP2 PUSH1 0xA4 ADD DUP5 DUP5 DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP SWAP7 POP POP POP POP POP POP POP PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0xF18 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0xF2C JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x20 DUP2 LT ISZERO PUSH2 0xF42 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP MLOAD PUSH1 0x40 DUP1 MLOAD PUSH32 0x6F6E455243373231526563656976656428616464726573732C61646472657373 DUP2 MSTORE PUSH32 0x2C75696E743235362C6279746573290000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x2F ADD SWAP1 KECCAK256 SWAP1 SWAP2 POP PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 DUP1 DUP4 AND SWAP2 AND EQ PUSH2 0x1031 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x17 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F494E56414C49445F53454C4543544F52000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP POP POP POP POP POP POP JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP2 DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x4 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 SWAP4 SWAP1 SWAP5 AND DUP3 MSTORE SWAP2 SWAP1 SWAP2 MSTORE KECCAK256 SLOAD PUSH1 0xFF AND SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0x10FB JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND ISZERO PUSH2 0x1158 JUMPI PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND OR SWAP1 SSTORE JUMPDEST POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 GT ISZERO PUSH2 0x11CC JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x11 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x55494E543235365F554E444552464C4F57000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP SWAP1 SUB SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 ADD DUP4 DUP2 LT ISZERO PUSH2 0x1246 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x10 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x55494E543235365F4F564552464C4F5700000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND ISZERO ISZERO PUSH2 0x12D3 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x16 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F5A45524F5F544F5F4144445245535300000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP1 ISZERO PUSH2 0x1366 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x1B PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F4F574E45525F414C52454144595F4558495354530000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x0 DUP3 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 DUP2 DUP2 MSTORE PUSH1 0x40 DUP1 DUP5 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP10 AND SWAP1 DUP2 OR SWAP1 SWAP2 SSTORE DUP5 MSTORE PUSH1 0x3 SWAP1 SWAP2 MSTORE SWAP1 SWAP2 KECCAK256 SLOAD PUSH2 0x13CC SWAP2 PUSH2 0x11D2 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x3 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 SWAP4 SWAP1 SWAP4 SSTORE SWAP2 MLOAD DUP5 SWAP3 SWAP1 PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF SWAP1 DUP3 SWAP1 LOG4 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND ISZERO ISZERO PUSH2 0x14AB JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x19 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F5A45524F5F4F574E45525F4144445245535300000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 DUP2 AND SWAP1 DUP4 AND DUP2 EQ PUSH2 0x1543 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x15 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F4F574E45525F4D49534D415443480000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x0 DUP3 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 DUP2 DUP2 MSTORE PUSH1 0x40 DUP1 DUP5 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND SWAP1 SSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 AND DUP5 MSTORE PUSH1 0x3 SWAP1 SWAP2 MSTORE SWAP1 SWAP2 KECCAK256 SLOAD PUSH2 0x15A5 SWAP2 PUSH2 0x115B JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x3 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 SWAP4 SWAP1 SWAP4 SSTORE SWAP2 MLOAD DUP5 SWAP3 SWAP2 SWAP1 PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF SWAP1 DUP4 SWAP1 LOG4 POP POP POP JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 0xb4 CREATE 0xe9 SWAP3 RETURNDATASIZE 0xf6 DUP2 0xb3 SWAP13 PUSH22 0xC35907B3B53E3D18D5D27A56215BE103C035936A9E0 STOP 0x29 ",
- "sourceMap": "743:1013:51:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;815:18;;8:9:-1;5:2;;;30:1;27;20:12;5:2;815:18:51;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:100:-1;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;815:18:51;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8388:140:56;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;8388:140:56;;;;;;;;;;;;;;;;;;;;;;;;4378:400;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;4378:400:56;;;;;;;;;;;6624:974;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;6624:974:56;;;;;;;;;;;;;;1263:103:51;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1263:103:51;;;;;;;;;3326:682:56;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;3326:682:56;;;;;;;;;;;;;;7860:257;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;7860:257:56;;;;;5783:229;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;5783:229:56;;;;;;;;;;;;;;;;;;;;;;;91:20:63;;8:9:-1;5:2;;;30:1;27;20:12;5:2;91:20:63;;;;839::51;;8:9:-1;5:2;;;30:1;27;20:12;5:2;839:20:51;;;;1627:127;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1627:127:51;;;;;;;;;5184:261:56;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;5184:261:56;;;;;;;;;;;2257:706;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2257:706:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;8829:176;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;8829:176:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;333:167:63;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;333:167:63;;;;;;;815:18:51;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;8388:140:56:-;8472:7;8502:19;;;:9;:19;;;;;;;;;8388:140::o;4378:400::-;4463:13;4479:17;4487:8;4479:7;:17::i;:::-;4463:33;-1:-1:-1;4527:10:56;:19;;;;;:58;;;4550:35;4567:5;4574:10;4550:16;:35::i;:::-;4506:126;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4643:19;;;;:9;:19;;;;;;:31;;;;;;;;;;;;;;4689:82;;4643:19;;4689:82;;;;;;;4378:400;;;:::o;6624:974::-;6848:13;;;6772:17;;;;;6751:86;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6864:17;6872:8;6864:7;:17::i;:::-;6848:33;-1:-1:-1;6912:14:56;;;;;;;;6891:82;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7002:10;6984:28;;7048:21;7060:8;7048:11;:21::i;:::-;7022:47;;7111:5;7100:16;;:7;:16;;;:64;;;;7132:32;7149:5;7156:7;7132:16;:32::i;:::-;7100:106;;;;7199:7;7180:26;;:15;:26;;;7100:106;7079:175;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7269:29;;;;7265:92;;7344:1;7314:19;;;:9;:19;;;;;:32;;;;;;7265:92;7367:16;;;;:6;:16;;;;;;;;:22;;;;;;;;;;;;;;;7425:15;;;;:8;:15;;;;;;;7417:27;;:7;:27::i;:::-;7399:15;;;;;;;;:8;:15;;;;;;:45;;;;7478:13;;;;;;;7470:25;;7493:1;7470:7;:25::i;:::-;7454:13;;;;;;;;:8;:13;;;;;;:41;;;;7515:76;;7573:8;;7454:13;;7515:76;;;;;;6624:974;;;;;;:::o;1263:103:51:-;1339:20;1345:3;1350:8;1339:5;:20::i;:::-;1263:103;;:::o;3326:682:56:-;3550:24;3702:15;3459:80;3485:5;3504:3;3521:8;3459:12;:80::i;:::-;3639:3;3627:16;3607:36;;3685:1;3666:16;:20;3662:340;;;3720:148;;;;;;3775:10;3720:148;;;;:37;:148;;;;;;;;;;;;;;;;;;-1:-1:-1;3720:148:56;;;;;;;;:37;;;;;;:148;;;;;;;;;;;;;;;;;;:37;:148;;;5:2:-1;;;;30:1;27;20:12;5:2;3720:148:56;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3720:148:56;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3720:148:56;902:60;;;;;;;3720:148;902:60;;;;;;;;;;;;;3720:148;;-1:-1:-1;3907:27:56;;;;;;;3882:109;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3326:682;;;;;:::o;7860:257::-;7940:7;7979:16;;;:6;:16;;;;;;;;8026:19;;;8005:83;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8105:5;7860:257;-1:-1:-1;;7860:257:56:o;5783:229::-;5865:7;5909:20;;;;;5888:84;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;5989:16:56;;;;;;:8;:16;;;;;;;5783:229::o;91:20:63:-;;;;;;:::o;839::51:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1627:127;259:5:63;;;;245:10;:19;224:85;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1724:23:51;1730:6;1738:8;1724:5;:23::i;5184:261:56:-;5295:10;5277:29;;;;:17;:29;;;;;;;;;:40;;;;;;;;;;;;:52;;;;;;;;;;;;;5344:94;;;;;;;5277:40;;5295:10;5344:94;;;;;;;;;;;5184:261;;:::o;2257:706::-;2502:24;2654:15;2411:80;2437:5;2456:3;2473:8;2411:12;:80::i;:::-;2591:3;2579:16;2559:36;;2637:1;2618:16;:20;2614:343;;;2672:151;;;;;2727:10;2672:151;;;;;;:37;:151;;;;;;;;;;;;;;;;;;;;;;;;;;:37;;;;;;2727:10;2755:5;;2778:8;;2804:5;;;;2672:151;;;;2804:5;;;;2672:151;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2672:151:56;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2672:151:56;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2672:151:56;902:60;;;;;;;2672:151;902:60;;;;;;;;;;;;;2672:151;;-1:-1:-1;2862:27:56;;;;;;;2837:109;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2257:706;;;;;;;:::o;8829:176::-;8962:25;;;;8935:4;8962:25;;;:17;:25;;;;;;;;:36;;;;;;;;;;;;;;;8829:176::o;333:167:63:-;259:5;;;;245:10;:19;224:85;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;429:22;;;;425:69;;467:5;:16;;;;;;;;;;425:69;333:167;:::o;502:208:65:-;588:7;632:6;;;;611:70;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;698:5:65;;;502:208::o;716:230::-;802:7;837:5;;;873:6;;;;852:69;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;938:1;716:230;-1:-1:-1;;;716:230:65:o;941:497:59:-;1115:13;1039:17;;;;;1018:86;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1131:16:59;;;;:6;:16;;;;;;;;1178:19;;1157:93;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1261:16;;;;:6;:16;;;;;;;;:22;;;;;;;;;;;;;1317:13;;:8;:13;;;;;;;1309:25;;:7;:25::i;:::-;1293:13;;;;;;;:8;:13;;;;;;:41;;;;1350:81;;1413:8;;1293:13;1350:81;;1293:13;;1350:81;941:497;;;:::o;1667:512::-;1850:13;1768:20;;;;;1747:92;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1866:16:59;;;;:6;:16;;;;;;;;;;;1913:15;;;;1892:83;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2013:1;1986:16;;;:6;:16;;;;;;;;:29;;;;;;;2052:16;;;;:8;:16;;;;;;;2044:28;;:7;:28::i;:::-;2025:16;;;;;;;:8;:16;;;;;;:47;;;;2088:84;;2154:8;;2025:16;;2088:84;;2025:16;;2088:84;1667:512;;;:::o"
- }
- }
- },
- "sources": {
- "2.0.0/extensions/Forwarder/Forwarder.sol": {
- "id": 0
- },
- "2.0.0/extensions/Forwarder/MixinAssets.sol": {
- "id": 1
- },
- "2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol": {
- "id": 2
- },
- "2.0.0/extensions/Forwarder/MixinForwarderCore.sol": {
- "id": 3
- },
- "2.0.0/extensions/Forwarder/MixinWeth.sol": {
- "id": 4
- },
- "2.0.0/extensions/Forwarder/interfaces/IAssets.sol": {
- "id": 5
- },
- "2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol": {
- "id": 6
- },
- "2.0.0/extensions/Forwarder/libs/LibConstants.sol": {
- "id": 7
- },
- "2.0.0/extensions/Forwarder/mixins/MAssets.sol": {
- "id": 8
- },
- "2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol": {
- "id": 9
- },
- "2.0.0/extensions/Forwarder/mixins/MWeth.sol": {
- "id": 10
- },
- "2.0.0/extensions/OrderValidator/OrderValidator.sol": {
- "id": 11
- },
- "2.0.0/multisig/MultiSigWallet.sol": {
- "id": 12
- },
- "2.0.0/multisig/MultiSigWalletWithTimeLock.sol": {
- "id": 13
- },
- "2.0.0/protocol/AssetProxy/ERC20Proxy.sol": {
- "id": 14
- },
- "2.0.0/protocol/AssetProxy/ERC721Proxy.sol": {
- "id": 15
- },
- "2.0.0/protocol/AssetProxy/MixinAuthorizable.sol": {
- "id": 16
- },
- "2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol": {
- "id": 17
- },
- "2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol": {
- "id": 18
- },
- "2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol": {
- "id": 19
- },
- "2.0.0/protocol/AssetProxyOwner/AssetProxyOwner.sol": {
- "id": 20
- },
- "2.0.0/protocol/Exchange/Exchange.sol": {
- "id": 21
- },
- "2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol": {
- "id": 22
- },
- "2.0.0/protocol/Exchange/MixinExchangeCore.sol": {
- "id": 23
- },
- "2.0.0/protocol/Exchange/MixinMatchOrders.sol": {
- "id": 24
- },
- "2.0.0/protocol/Exchange/MixinSignatureValidator.sol": {
- "id": 25
- },
- "2.0.0/protocol/Exchange/MixinTransactions.sol": {
- "id": 26
- },
- "2.0.0/protocol/Exchange/MixinWrapperFunctions.sol": {
- "id": 27
- },
- "2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol": {
- "id": 28
- },
- "2.0.0/protocol/Exchange/interfaces/IExchange.sol": {
- "id": 29
- },
- "2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol": {
- "id": 30
- },
- "2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol": {
- "id": 31
- },
- "2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol": {
- "id": 32
- },
- "2.0.0/protocol/Exchange/interfaces/ITransactions.sol": {
- "id": 33
- },
- "2.0.0/protocol/Exchange/interfaces/IValidator.sol": {
- "id": 34
- },
- "2.0.0/protocol/Exchange/interfaces/IWallet.sol": {
- "id": 35
- },
- "2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol": {
- "id": 36
- },
- "2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol": {
- "id": 37
- },
- "2.0.0/protocol/Exchange/libs/LibConstants.sol": {
- "id": 38
- },
- "2.0.0/protocol/Exchange/libs/LibEIP712.sol": {
- "id": 39
- },
- "2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol": {
- "id": 40
- },
- "2.0.0/protocol/Exchange/libs/LibFillResults.sol": {
- "id": 41
- },
- "2.0.0/protocol/Exchange/libs/LibMath.sol": {
- "id": 42
- },
- "2.0.0/protocol/Exchange/libs/LibOrder.sol": {
- "id": 43
- },
- "2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol": {
- "id": 44
- },
- "2.0.0/protocol/Exchange/mixins/MExchangeCore.sol": {
- "id": 45
- },
- "2.0.0/protocol/Exchange/mixins/MMatchOrders.sol": {
- "id": 46
- },
- "2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol": {
- "id": 47
- },
- "2.0.0/protocol/Exchange/mixins/MTransactions.sol": {
- "id": 48
- },
- "2.0.0/protocol/Exchange/mixins/MWrapperFunctions.sol": {
- "id": 49
- },
- "2.0.0/test/DummyERC20Token/DummyERC20Token.sol": {
- "id": 50
- },
- "2.0.0/test/DummyERC721Token/DummyERC721Token.sol": {
- "id": 51
- },
- "2.0.0/tokens/ERC20Token/ERC20Token.sol": {
- "id": 52
- },
- "2.0.0/tokens/ERC20Token/IERC20Token.sol": {
- "id": 53
- },
- "2.0.0/tokens/ERC20Token/MintableERC20Token.sol": {
- "id": 54
- },
- "2.0.0/tokens/ERC20Token/UnlimitedAllowanceERC20Token.sol": {
- "id": 55
- },
- "2.0.0/tokens/ERC721Token/ERC721Token.sol": {
- "id": 56
- },
- "2.0.0/tokens/ERC721Token/IERC721Receiver.sol": {
- "id": 57
- },
- "2.0.0/tokens/ERC721Token/IERC721Token.sol": {
- "id": 58
- },
- "2.0.0/tokens/ERC721Token/MintableERC721Token.sol": {
- "id": 59
- },
- "2.0.0/tokens/EtherToken/IEtherToken.sol": {
- "id": 60
- },
- "2.0.0/utils/LibBytes/LibBytes.sol": {
- "id": 61
- },
- "2.0.0/utils/Ownable/IOwnable.sol": {
- "id": 62
- },
- "2.0.0/utils/Ownable/Ownable.sol": {
- "id": 63
- },
- "2.0.0/utils/ReentrancyGuard/ReentrancyGuard.sol": {
- "id": 64
- },
- "2.0.0/utils/SafeMath/SafeMath.sol": {
- "id": 65
- }
- },
- "sourceCodes": {
- "2.0.0/extensions/Forwarder/Forwarder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./MixinWeth.sol\";\nimport \"./MixinForwarderCore.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./MixinAssets.sol\";\nimport \"./MixinExchangeWrapper.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract Forwarder is\n LibConstants,\n MixinWeth,\n MixinAssets,\n MixinExchangeWrapper,\n MixinForwarderCore\n{\n constructor (\n address _exchange,\n bytes memory _zrxAssetData,\n bytes memory _wethAssetData\n )\n public\n LibConstants(\n _exchange,\n _zrxAssetData,\n _wethAssetData\n )\n MixinForwarderCore()\n {}\n}\n",
- "2.0.0/extensions/Forwarder/MixinAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"../../tokens/ERC20Token/IERC20Token.sol\";\nimport \"../../tokens/ERC721Token/IERC721Token.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MAssets.sol\";\n\n\ncontract MixinAssets is\n Ownable,\n LibConstants,\n MAssets\n{\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_TRANSFER_SELECTOR = bytes4(keccak256(\"transfer(address,uint256)\"));\n\n /// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to \n /// function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be\n /// used to withdraw assets that were accidentally sent to this contract.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of ERC20 token to withdraw.\n function withdrawAsset(\n bytes assetData,\n uint256 amount\n )\n external\n onlyOwner\n {\n transferAssetToSender(assetData, amount);\n }\n\n /// @dev Transfers given amount of asset to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferAssetToSender(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n bytes4 proxyId = assetData.readBytes4(0);\n\n if (proxyId == ERC20_DATA_ID) {\n transferERC20Token(assetData, amount);\n } else if (proxyId == ERC721_DATA_ID) {\n transferERC721Token(assetData, amount);\n } else {\n revert(\"UNSUPPORTED_ASSET_PROXY\");\n }\n }\n\n /// @dev Decodes ERC20 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC20Token(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n address token = assetData.readAddress(16);\n\n // Transfer tokens.\n // We do a raw call so we can check the success separate\n // from the return data.\n bool success = token.call(abi.encodeWithSelector(\n ERC20_TRANSFER_SELECTOR,\n msg.sender,\n amount\n ));\n require(\n success,\n \"TRANSFER_FAILED\"\n );\n \n // Check return data.\n // If there is no return data, we assume the token incorrectly\n // does not return a bool. In this case we expect it to revert\n // on failure, which was handled above.\n // If the token does return data, we require that it is a single\n // value that evaluates to true.\n assembly {\n if returndatasize {\n success := 0\n if eq(returndatasize, 32) {\n // First 64 bytes of memory are reserved scratch space\n returndatacopy(0, 0, 32)\n success := mload(0)\n }\n }\n }\n require(\n success,\n \"TRANSFER_FAILED\"\n );\n }\n\n /// @dev Decodes ERC721 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC721Token(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n require(\n amount == 1,\n \"INVALID_AMOUNT\"\n );\n // Decode asset data.\n address token = assetData.readAddress(16);\n uint256 tokenId = assetData.readUint256(36);\n\n // Perform transfer.\n IERC721Token(token).transferFrom(\n address(this),\n msg.sender,\n tokenId\n );\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MExchangeWrapper.sol\";\nimport \"../../protocol/Exchange/libs/LibAbiEncoder.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../protocol/Exchange/libs/LibFillResults.sol\";\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\n\n\ncontract MixinExchangeWrapper is\n LibAbiEncoder,\n LibFillResults,\n LibMath,\n LibConstants,\n MExchangeWrapper\n{\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n // ABI encode calldata for `fillOrder`\n bytes memory fillOrderCalldata = abiEncodeFillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n\n address exchange = address(EXCHANGE);\n\n // Call `fillOrder` and handle any exceptions gracefully\n assembly {\n let success := call(\n gas, // forward all gas\n exchange, // call address of Exchange contract\n 0, // transfer 0 wei\n add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes)\n mload(fillOrderCalldata), // length of input\n fillOrderCalldata, // write output over input\n 128 // output size is 128 bytes\n )\n if success {\n mstore(fillResults, mload(fillOrderCalldata))\n mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32)))\n mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64)))\n mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96)))\n }\n }\n // fillResults values will be 0 by default if call was unsuccessful\n return fillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of WETH has been sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param wethSellAmount Desired amount of WETH to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellWeth(\n LibOrder.Order[] memory orders,\n uint256 wethSellAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // We assume that asset being sold by taker is WETH for each order.\n orders[i].makerAssetData = makerAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of WETH to sell\n uint256 remainingTakerAssetFillAmount = safeSub(wethSellAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of WETH\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= wethSellAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// The asset being sold by taker must always be WETH.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyExactAmountWithWeth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // We assume that asset being sold by taker is WETH for each order.\n orders[i].makerAssetData = makerAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n uint256 makerAssetFilledAmount = totalFillResults.makerAssetFilledAmount;\n if (makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n\n require(\n makerAssetFilledAmount >= makerAssetFillAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return totalFillResults;\n }\n\n /// @dev Buys zrxBuyAmount of ZRX fee tokens, taking into account ZRX fees for each order. This will guarantee\n /// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues).\n /// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX\n /// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases.\n /// The asset being sold by taker must always be WETH. \n /// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset.\n /// @param zrxBuyAmount Desired amount of ZRX to buy.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return totalFillResults Amounts filled and fees paid by maker and taker.\n function marketBuyExactZrxWithWeth(\n LibOrder.Order[] memory orders,\n uint256 zrxBuyAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n // Do nothing if zrxBuyAmount == 0\n if (zrxBuyAmount == 0) {\n return totalFillResults;\n }\n\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n uint256 zrxPurchased = 0;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // All of these are ZRX/WETH, so we can drop the respective assetData from calldata.\n orders[i].makerAssetData = zrxAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of ZRX to buy.\n uint256 remainingZrxBuyAmount = safeSub(zrxBuyAmount, zrxPurchased);\n\n // Convert the remaining amount of ZRX to buy into remaining amount\n // of WETH to sell, assuming entire amount can be sold in the current order.\n uint256 remainingWethSellAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n safeSub(orders[i].makerAssetAmount, orders[i].takerFee), // our exchange rate after fees \n remainingZrxBuyAmount\n );\n\n // Attempt to sell the remaining amount of WETH.\n FillResults memory singleFillResult = fillOrderNoThrow(\n orders[i],\n safeAdd(remainingWethSellAmount, 1), // we add 1 wei to the fill amount to make up for rounding errors\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker.\n addFillResults(totalFillResults, singleFillResult);\n zrxPurchased = safeSub(totalFillResults.makerAssetFilledAmount, totalFillResults.takerFeePaid);\n\n // Stop execution if the entire amount of ZRX has been bought.\n if (zrxPurchased >= zrxBuyAmount) {\n break;\n }\n }\n\n require(\n zrxPurchased >= zrxBuyAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return totalFillResults;\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinForwarderCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MWeth.sol\";\nimport \"./mixins/MAssets.sol\";\nimport \"./mixins/MExchangeWrapper.sol\";\nimport \"./interfaces/IForwarderCore.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../protocol/Exchange/libs/LibFillResults.sol\";\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\n\n\ncontract MixinForwarderCore is\n LibFillResults,\n LibMath,\n LibConstants,\n MWeth,\n MAssets,\n MExchangeWrapper,\n IForwarderCore\n{\n using LibBytes for bytes;\n\n /// @dev Constructor approves ERC20 proxy to transfer ZRX and WETH on this contract's behalf.\n constructor ()\n public\n {\n address proxyAddress = EXCHANGE.getAssetProxy(ERC20_DATA_ID);\n require(\n proxyAddress != address(0),\n \"UNREGISTERED_ASSET_PROXY\"\n );\n ETHER_TOKEN.approve(proxyAddress, MAX_UINT);\n ZRX_TOKEN.approve(proxyAddress, MAX_UINT);\n }\n\n /// @dev Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketSellOrdersWithEth(\n LibOrder.Order[] memory orders,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n FillResults memory orderFillResults,\n FillResults memory feeOrderFillResults\n )\n {\n // Convert ETH to WETH.\n convertEthToWeth();\n\n uint256 wethSellAmount;\n uint256 zrxBuyAmount;\n uint256 makerAssetAmountPurchased;\n if (orders[0].makerAssetData.equals(ZRX_ASSET_DATA)) {\n // Calculate amount of WETH that won't be spent on ETH fees.\n wethSellAmount = getPartialAmountFloor(\n PERCENTAGE_DENOMINATOR,\n safeAdd(PERCENTAGE_DENOMINATOR, feePercentage),\n msg.value\n );\n // Market sell available WETH.\n // ZRX fees are paid with this contract's balance.\n orderFillResults = marketSellWeth(\n orders,\n wethSellAmount,\n signatures\n );\n // The fee amount must be deducted from the amount transfered back to sender.\n makerAssetAmountPurchased = safeSub(orderFillResults.makerAssetFilledAmount, orderFillResults.takerFeePaid);\n } else {\n // 5% of WETH is reserved for filling feeOrders and paying feeRecipient.\n wethSellAmount = getPartialAmountFloor(\n MAX_WETH_FILL_PERCENTAGE,\n PERCENTAGE_DENOMINATOR,\n msg.value\n );\n // Market sell 95% of WETH.\n // ZRX fees are payed with this contract's balance.\n orderFillResults = marketSellWeth(\n orders,\n wethSellAmount,\n signatures\n );\n // Buy back all ZRX spent on fees.\n zrxBuyAmount = orderFillResults.takerFeePaid;\n feeOrderFillResults = marketBuyExactZrxWithWeth(\n feeOrders,\n zrxBuyAmount,\n feeSignatures\n );\n makerAssetAmountPurchased = orderFillResults.makerAssetFilledAmount;\n }\n\n // Transfer feePercentage of total ETH spent on primary orders to feeRecipient.\n // Refund remaining ETH to msg.sender.\n transferEthFeeAndRefund(\n orderFillResults.takerAssetFilledAmount,\n feeOrderFillResults.takerAssetFilledAmount,\n feePercentage,\n feeRecipient\n );\n\n // Transfer purchased assets to msg.sender.\n transferAssetToSender(orders[0].makerAssetData, makerAssetAmountPurchased);\n }\n\n /// @dev Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param makerAssetFillAmount Desired amount of makerAsset to purchase.\n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketBuyOrdersWithEth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n FillResults memory orderFillResults,\n FillResults memory feeOrderFillResults\n )\n {\n // Convert ETH to WETH.\n convertEthToWeth();\n\n uint256 zrxBuyAmount;\n uint256 makerAssetAmountPurchased;\n if (orders[0].makerAssetData.equals(ZRX_ASSET_DATA)) {\n // If the makerAsset is ZRX, it is not necessary to pay fees out of this\n // contracts's ZRX balance because fees are factored into the price of the order.\n orderFillResults = marketBuyExactZrxWithWeth(\n orders,\n makerAssetFillAmount,\n signatures\n );\n // The fee amount must be deducted from the amount transfered back to sender.\n makerAssetAmountPurchased = safeSub(orderFillResults.makerAssetFilledAmount, orderFillResults.takerFeePaid);\n } else {\n // Attemp to purchase desired amount of makerAsset.\n // ZRX fees are payed with this contract's balance.\n orderFillResults = marketBuyExactAmountWithWeth(\n orders,\n makerAssetFillAmount,\n signatures\n );\n // Buy back all ZRX spent on fees.\n zrxBuyAmount = orderFillResults.takerFeePaid;\n feeOrderFillResults = marketBuyExactZrxWithWeth(\n feeOrders,\n zrxBuyAmount,\n feeSignatures\n );\n makerAssetAmountPurchased = orderFillResults.makerAssetFilledAmount;\n }\n\n // Transfer feePercentage of total ETH spent on primary orders to feeRecipient.\n // Refund remaining ETH to msg.sender.\n transferEthFeeAndRefund(\n orderFillResults.takerAssetFilledAmount,\n feeOrderFillResults.takerAssetFilledAmount,\n feePercentage,\n feeRecipient\n );\n\n // Transfer purchased assets to msg.sender.\n transferAssetToSender(orders[0].makerAssetData, makerAssetAmountPurchased);\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinWeth.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MWeth.sol\";\n\n\ncontract MixinWeth is\n LibMath,\n LibConstants,\n MWeth\n{\n /// @dev Default payabale function, this allows us to withdraw WETH\n function ()\n public\n payable\n {\n require(\n msg.sender == address(ETHER_TOKEN),\n \"DEFAULT_FUNCTION_WETH_CONTRACT_ONLY\"\n );\n }\n\n /// @dev Converts message call's ETH value into WETH.\n function convertEthToWeth()\n internal\n {\n require(\n msg.value > 0,\n \"INVALID_MSG_VALUE\"\n );\n ETHER_TOKEN.deposit.value(msg.value)();\n }\n\n /// @dev Transfers feePercentage of WETH spent on primary orders to feeRecipient.\n /// Refunds any excess ETH to msg.sender.\n /// @param wethSoldExcludingFeeOrders Amount of WETH sold when filling primary orders.\n /// @param wethSoldForZrx Amount of WETH sold when purchasing ZRX required for primary order fees.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n function transferEthFeeAndRefund(\n uint256 wethSoldExcludingFeeOrders,\n uint256 wethSoldForZrx,\n uint256 feePercentage,\n address feeRecipient\n )\n internal\n {\n // Ensure feePercentage is less than 5%.\n require(\n feePercentage <= MAX_FEE_PERCENTAGE,\n \"FEE_PERCENTAGE_TOO_LARGE\"\n );\n\n // Ensure that no extra WETH owned by this contract has been sold.\n uint256 wethSold = safeAdd(wethSoldExcludingFeeOrders, wethSoldForZrx);\n require(\n wethSold <= msg.value,\n \"OVERSOLD_WETH\"\n );\n\n // Calculate amount of WETH that hasn't been sold.\n uint256 wethRemaining = safeSub(msg.value, wethSold);\n\n // Calculate ETH fee to pay to feeRecipient.\n uint256 ethFee = getPartialAmountFloor(\n feePercentage,\n PERCENTAGE_DENOMINATOR,\n wethSoldExcludingFeeOrders\n );\n\n // Ensure fee is less than amount of WETH remaining.\n require(\n ethFee <= wethRemaining,\n \"INSUFFICIENT_ETH_REMAINING\"\n );\n \n // Do nothing if no WETH remaining\n if (wethRemaining > 0) {\n // Convert remaining WETH to ETH\n ETHER_TOKEN.withdraw(wethRemaining);\n\n // Pay ETH to feeRecipient\n if (ethFee > 0) {\n feeRecipient.transfer(ethFee);\n }\n\n // Refund remaining ETH to msg.sender.\n uint256 ethRefund = safeSub(wethRemaining, ethFee);\n if (ethRefund > 0) {\n msg.sender.transfer(ethRefund);\n }\n }\n }\n}\n",
- "2.0.0/extensions/Forwarder/interfaces/IAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IAssets {\n\n /// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to \n /// function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be\n /// used to withdraw assets that were accidentally sent to this contract.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of ERC20 token to withdraw.\n function withdrawAsset(\n bytes assetData,\n uint256 amount\n )\n external;\n}\n",
- "2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../../protocol/Exchange/libs/LibFillResults.sol\";\n\n\ncontract IForwarderCore {\n\n /// @dev Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketSellOrdersWithEth(\n LibOrder.Order[] memory orders,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n LibFillResults.FillResults memory orderFillResults,\n LibFillResults.FillResults memory feeOrderFillResults\n );\n\n /// @dev Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param makerAssetFillAmount Desired amount of makerAsset to purchase.\n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketBuyOrdersWithEth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n LibFillResults.FillResults memory orderFillResults,\n LibFillResults.FillResults memory feeOrderFillResults\n );\n}\n",
- "2.0.0/extensions/Forwarder/libs/LibConstants.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/LibBytes/LibBytes.sol\";\nimport \"../../../protocol/Exchange/interfaces/IExchange.sol\";\nimport \"../../../tokens/EtherToken/IEtherToken.sol\";\nimport \"../../../tokens/ERC20Token/IERC20Token.sol\";\n\n\ncontract LibConstants {\n\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n uint256 constant internal MAX_UINT = 2**256 - 1;\n uint256 constant internal PERCENTAGE_DENOMINATOR = 10**18; \n uint256 constant internal MAX_FEE_PERCENTAGE = 5 * PERCENTAGE_DENOMINATOR / 100; // 5%\n uint256 constant internal MAX_WETH_FILL_PERCENTAGE = 95 * PERCENTAGE_DENOMINATOR / 100; // 95%\n \n // solhint-disable var-name-mixedcase\n IExchange internal EXCHANGE;\n IEtherToken internal ETHER_TOKEN;\n IERC20Token internal ZRX_TOKEN;\n bytes internal ZRX_ASSET_DATA;\n bytes internal WETH_ASSET_DATA;\n // solhint-enable var-name-mixedcase\n\n constructor (\n address _exchange,\n bytes memory _zrxAssetData,\n bytes memory _wethAssetData\n )\n public\n {\n EXCHANGE = IExchange(_exchange);\n ZRX_ASSET_DATA = _zrxAssetData;\n WETH_ASSET_DATA = _wethAssetData;\n\n address etherToken = _wethAssetData.readAddress(16);\n address zrxToken = _zrxAssetData.readAddress(16);\n ETHER_TOKEN = IEtherToken(etherToken);\n ZRX_TOKEN = IERC20Token(zrxToken);\n }\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAssets.sol\";\n\n\ncontract MAssets is\n IAssets\n{\n /// @dev Transfers given amount of asset to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferAssetToSender(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n\n /// @dev Decodes ERC20 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC20Token(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n\n /// @dev Decodes ERC721 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC721Token(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../../protocol/Exchange/libs/LibFillResults.sol\";\n\n\ncontract MExchangeWrapper {\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of WETH has been sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param wethSellAmount Desired amount of WETH to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellWeth(\n LibOrder.Order[] memory orders,\n uint256 wethSellAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// The asset being sold by taker must always be WETH.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyExactAmountWithWeth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Buys zrxBuyAmount of ZRX fee tokens, taking into account ZRX fees for each order. This will guarantee\n /// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues).\n /// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX\n /// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases.\n /// The asset being sold by taker must always be WETH. \n /// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset.\n /// @param zrxBuyAmount Desired amount of ZRX to buy.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return totalFillResults Amounts filled and fees paid by maker and taker.\n function marketBuyExactZrxWithWeth(\n LibOrder.Order[] memory orders,\n uint256 zrxBuyAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MWeth.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract MWeth {\n\n /// @dev Converts message call's ETH value into WETH.\n function convertEthToWeth()\n internal;\n\n /// @dev Transfers feePercentage of WETH spent on primary orders to feeRecipient.\n /// Refunds any excess ETH to msg.sender.\n /// @param wethSoldExcludingFeeOrders Amount of WETH sold when filling primary orders.\n /// @param wethSoldForZrx Amount of WETH sold when purchasing ZRX required for primary order fees.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n function transferEthFeeAndRefund(\n uint256 wethSoldExcludingFeeOrders,\n uint256 wethSoldForZrx,\n uint256 feePercentage,\n address feeRecipient\n )\n internal;\n}\n",
- "2.0.0/extensions/OrderValidator/OrderValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../protocol/Exchange/interfaces/IExchange.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../tokens/ERC20Token/IERC20Token.sol\";\nimport \"../../tokens/ERC721Token/IERC721Token.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\n\n\ncontract OrderValidator {\n\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n\n struct TraderInfo {\n uint256 makerBalance; // Maker's balance of makerAsset\n uint256 makerAllowance; // Maker's allowance to corresponding AssetProxy\n uint256 takerBalance; // Taker's balance of takerAsset\n uint256 takerAllowance; // Taker's allowance to corresponding AssetProxy\n uint256 makerZrxBalance; // Maker's balance of ZRX\n uint256 makerZrxAllowance; // Maker's allowance of ZRX to ERC20Proxy\n uint256 takerZrxBalance; // Taker's balance of ZRX\n uint256 takerZrxAllowance; // Taker's allowance of ZRX to ERC20Proxy\n }\n\n // solhint-disable var-name-mixedcase\n IExchange internal EXCHANGE;\n bytes internal ZRX_ASSET_DATA;\n // solhint-enable var-name-mixedcase\n\n constructor (address _exchange, bytes memory _zrxAssetData)\n public\n {\n EXCHANGE = IExchange(_exchange);\n ZRX_ASSET_DATA = _zrxAssetData;\n }\n\n /// @dev Fetches information for order and maker/taker of order.\n /// @param order The order structure.\n /// @param takerAddress Address that will be filling the order.\n /// @return OrderInfo and TraderInfo instances for given order.\n function getOrderAndTraderInfo(LibOrder.Order memory order, address takerAddress)\n public\n view\n returns (LibOrder.OrderInfo memory orderInfo, TraderInfo memory traderInfo)\n {\n orderInfo = EXCHANGE.getOrderInfo(order);\n traderInfo = getTraderInfo(order, takerAddress);\n return (orderInfo, traderInfo);\n }\n\n /// @dev Fetches information for all passed in orders and the makers/takers of each order.\n /// @param orders Array of order specifications.\n /// @param takerAddresses Array of taker addresses corresponding to each order.\n /// @return Arrays of OrderInfo and TraderInfo instances that correspond to each order.\n function getOrdersAndTradersInfo(LibOrder.Order[] memory orders, address[] memory takerAddresses)\n public\n view\n returns (LibOrder.OrderInfo[] memory ordersInfo, TraderInfo[] memory tradersInfo)\n {\n ordersInfo = EXCHANGE.getOrdersInfo(orders);\n tradersInfo = getTradersInfo(orders, takerAddresses);\n return (ordersInfo, tradersInfo);\n }\n\n /// @dev Fetches balance and allowances for maker and taker of order.\n /// @param order The order structure.\n /// @param takerAddress Address that will be filling the order.\n /// @return Balances and allowances of maker and taker of order.\n function getTraderInfo(LibOrder.Order memory order, address takerAddress)\n public\n view\n returns (TraderInfo memory traderInfo)\n {\n (traderInfo.makerBalance, traderInfo.makerAllowance) = getBalanceAndAllowance(order.makerAddress, order.makerAssetData);\n (traderInfo.takerBalance, traderInfo.takerAllowance) = getBalanceAndAllowance(takerAddress, order.takerAssetData);\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n (traderInfo.makerZrxBalance, traderInfo.makerZrxAllowance) = getBalanceAndAllowance(order.makerAddress, zrxAssetData);\n (traderInfo.takerZrxBalance, traderInfo.takerZrxAllowance) = getBalanceAndAllowance(takerAddress, zrxAssetData);\n return traderInfo;\n }\n\n /// @dev Fetches balances and allowances of maker and taker for each provided order.\n /// @param orders Array of order specifications.\n /// @param takerAddresses Array of taker addresses corresponding to each order.\n /// @return Array of balances and allowances for maker and taker of each order.\n function getTradersInfo(LibOrder.Order[] memory orders, address[] memory takerAddresses)\n public\n view\n returns (TraderInfo[] memory)\n {\n uint256 ordersLength = orders.length;\n TraderInfo[] memory tradersInfo = new TraderInfo[](ordersLength);\n for (uint256 i = 0; i != ordersLength; i++) {\n tradersInfo[i] = getTraderInfo(orders[i], takerAddresses[i]);\n }\n return tradersInfo;\n }\n\n /// @dev Fetches token balances and allowances of an address to given assetProxy. Supports ERC20 and ERC721.\n /// @param target Address to fetch balances and allowances of.\n /// @param assetData Encoded data that can be decoded by a specified proxy contract when transferring asset.\n /// @return Balance of asset and allowance set to given proxy of asset.\n /// For ERC721 tokens, these values will always be 1 or 0.\n function getBalanceAndAllowance(address target, bytes memory assetData)\n public\n view\n returns (uint256 balance, uint256 allowance)\n {\n bytes4 assetProxyId = assetData.readBytes4(0);\n address token = assetData.readAddress(16);\n address assetProxy = EXCHANGE.getAssetProxy(assetProxyId);\n\n if (assetProxyId == ERC20_DATA_ID) {\n // Query balance\n balance = IERC20Token(token).balanceOf(target);\n\n // Query allowance\n allowance = IERC20Token(token).allowance(target, assetProxy);\n } else if (assetProxyId == ERC721_DATA_ID) {\n uint256 tokenId = assetData.readUint256(36);\n\n // Query owner of tokenId\n address owner = getERC721TokenOwner(token, tokenId);\n\n // Set balance to 1 if tokenId is owned by target\n balance = target == owner ? 1 : 0;\n\n // Check if ERC721Proxy is approved to spend tokenId\n bool isApproved = IERC721Token(token).isApprovedForAll(target, assetProxy) || IERC721Token(token).getApproved(tokenId) == assetProxy;\n \n // Set alowance to 1 if ERC721Proxy is approved to spend tokenId\n allowance = isApproved ? 1 : 0;\n } else {\n revert(\"UNSUPPORTED_ASSET_PROXY\");\n }\n return (balance, allowance);\n }\n\n /// @dev Fetches token balances and allowances of an address for each given assetProxy. Supports ERC20 and ERC721.\n /// @param target Address to fetch balances and allowances of.\n /// @param assetData Array of encoded byte arrays that can be decoded by a specified proxy contract when transferring asset.\n /// @return Balances and allowances of assets.\n /// For ERC721 tokens, these values will always be 1 or 0.\n function getBalancesAndAllowances(address target, bytes[] memory assetData)\n public\n view\n returns (uint256[] memory, uint256[] memory)\n {\n uint256 length = assetData.length;\n uint256[] memory balances = new uint256[](length);\n uint256[] memory allowances = new uint256[](length);\n for (uint256 i = 0; i != length; i++) {\n (balances[i], allowances[i]) = getBalanceAndAllowance(target, assetData[i]);\n }\n return (balances, allowances);\n }\n\n /// @dev Calls `token.ownerOf(tokenId)`, but returns a null owner instead of reverting on an unowned token.\n /// @param token Address of ERC721 token.\n /// @param tokenId The identifier for the specific NFT.\n /// @return Owner of tokenId or null address if unowned.\n function getERC721TokenOwner(address token, uint256 tokenId)\n public\n view\n returns (address owner)\n {\n assembly {\n // load free memory pointer\n let cdStart := mload(64)\n\n // bytes4(keccak256(ownerOf(uint256))) = 0x6352211e\n mstore(cdStart, 0x6352211e00000000000000000000000000000000000000000000000000000000)\n mstore(add(cdStart, 4), tokenId)\n\n // staticcall `ownerOf(tokenId)`\n // `ownerOf` will revert if tokenId is not owned\n let success := staticcall(\n gas, // forward all gas\n token, // call token contract\n cdStart, // start of calldata\n 36, // length of input is 36 bytes\n cdStart, // write output over input\n 32 // size of output is 32 bytes\n )\n\n // Success implies that tokenId is owned\n // Copy owner from return data if successful\n if success {\n owner := mload(cdStart)\n } \n }\n\n // Owner initialized to address(0), no need to modify if call is unsuccessful\n return owner;\n }\n}\n",
- "2.0.0/multisig/MultiSigWallet.sol": "// solhint-disable\npragma solidity ^0.4.15;\n\n\n/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.\n/// @author Stefan George - <stefan.george@consensys.net>\ncontract MultiSigWallet {\n\n /*\n * Events\n */\n event Confirmation(address indexed sender, uint indexed transactionId);\n event Revocation(address indexed sender, uint indexed transactionId);\n event Submission(uint indexed transactionId);\n event Execution(uint indexed transactionId);\n event ExecutionFailure(uint indexed transactionId);\n event Deposit(address indexed sender, uint value);\n event OwnerAddition(address indexed owner);\n event OwnerRemoval(address indexed owner);\n event RequirementChange(uint required);\n\n /*\n * Constants\n */\n uint constant public MAX_OWNER_COUNT = 50;\n\n /*\n * Storage\n */\n mapping (uint => Transaction) public transactions;\n mapping (uint => mapping (address => bool)) public confirmations;\n mapping (address => bool) public isOwner;\n address[] public owners;\n uint public required;\n uint public transactionCount;\n\n struct Transaction {\n address destination;\n uint value;\n bytes data;\n bool executed;\n }\n\n /*\n * Modifiers\n */\n modifier onlyWallet() {\n require(msg.sender == address(this));\n _;\n }\n\n modifier ownerDoesNotExist(address owner) {\n require(!isOwner[owner]);\n _;\n }\n\n modifier ownerExists(address owner) {\n require(isOwner[owner]);\n _;\n }\n\n modifier transactionExists(uint transactionId) {\n require(transactions[transactionId].destination != 0);\n _;\n }\n\n modifier confirmed(uint transactionId, address owner) {\n require(confirmations[transactionId][owner]);\n _;\n }\n\n modifier notConfirmed(uint transactionId, address owner) {\n require(!confirmations[transactionId][owner]);\n _;\n }\n\n modifier notExecuted(uint transactionId) {\n require(!transactions[transactionId].executed);\n _;\n }\n\n modifier notNull(address _address) {\n require(_address != 0);\n _;\n }\n\n modifier validRequirement(uint ownerCount, uint _required) {\n require(ownerCount <= MAX_OWNER_COUNT\n && _required <= ownerCount\n && _required != 0\n && ownerCount != 0);\n _;\n }\n\n /// @dev Fallback function allows to deposit ether.\n function()\n payable\n {\n if (msg.value > 0)\n Deposit(msg.sender, msg.value);\n }\n\n /*\n * Public functions\n */\n /// @dev Contract constructor sets initial owners and required number of confirmations.\n /// @param _owners List of initial owners.\n /// @param _required Number of required confirmations.\n function MultiSigWallet(address[] _owners, uint _required)\n public\n validRequirement(_owners.length, _required)\n {\n for (uint i=0; i<_owners.length; i++) {\n require(!isOwner[_owners[i]] && _owners[i] != 0);\n isOwner[_owners[i]] = true;\n }\n owners = _owners;\n required = _required;\n }\n\n /// @dev Allows to add a new owner. Transaction has to be sent by wallet.\n /// @param owner Address of new owner.\n function addOwner(address owner)\n public\n onlyWallet\n ownerDoesNotExist(owner)\n notNull(owner)\n validRequirement(owners.length + 1, required)\n {\n isOwner[owner] = true;\n owners.push(owner);\n OwnerAddition(owner);\n }\n\n /// @dev Allows to remove an owner. Transaction has to be sent by wallet.\n /// @param owner Address of owner.\n function removeOwner(address owner)\n public\n onlyWallet\n ownerExists(owner)\n {\n isOwner[owner] = false;\n for (uint i=0; i<owners.length - 1; i++)\n if (owners[i] == owner) {\n owners[i] = owners[owners.length - 1];\n break;\n }\n owners.length -= 1;\n if (required > owners.length)\n changeRequirement(owners.length);\n OwnerRemoval(owner);\n }\n\n /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet.\n /// @param owner Address of owner to be replaced.\n /// @param newOwner Address of new owner.\n function replaceOwner(address owner, address newOwner)\n public\n onlyWallet\n ownerExists(owner)\n ownerDoesNotExist(newOwner)\n {\n for (uint i=0; i<owners.length; i++)\n if (owners[i] == owner) {\n owners[i] = newOwner;\n break;\n }\n isOwner[owner] = false;\n isOwner[newOwner] = true;\n OwnerRemoval(owner);\n OwnerAddition(newOwner);\n }\n\n /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet.\n /// @param _required Number of required confirmations.\n function changeRequirement(uint _required)\n public\n onlyWallet\n validRequirement(owners.length, _required)\n {\n required = _required;\n RequirementChange(_required);\n }\n\n /// @dev Allows an owner to submit and confirm a transaction.\n /// @param destination Transaction target address.\n /// @param value Transaction ether value.\n /// @param data Transaction data payload.\n /// @return Returns transaction ID.\n function submitTransaction(address destination, uint value, bytes data)\n public\n returns (uint transactionId)\n {\n transactionId = addTransaction(destination, value, data);\n confirmTransaction(transactionId);\n }\n\n /// @dev Allows an owner to confirm a transaction.\n /// @param transactionId Transaction ID.\n function confirmTransaction(uint transactionId)\n public\n ownerExists(msg.sender)\n transactionExists(transactionId)\n notConfirmed(transactionId, msg.sender)\n {\n confirmations[transactionId][msg.sender] = true;\n Confirmation(msg.sender, transactionId);\n executeTransaction(transactionId);\n }\n\n /// @dev Allows an owner to revoke a confirmation for a transaction.\n /// @param transactionId Transaction ID.\n function revokeConfirmation(uint transactionId)\n public\n ownerExists(msg.sender)\n confirmed(transactionId, msg.sender)\n notExecuted(transactionId)\n {\n confirmations[transactionId][msg.sender] = false;\n Revocation(msg.sender, transactionId);\n }\n\n /// @dev Allows anyone to execute a confirmed transaction.\n /// @param transactionId Transaction ID.\n function executeTransaction(uint transactionId)\n public\n ownerExists(msg.sender)\n confirmed(transactionId, msg.sender)\n notExecuted(transactionId)\n {\n if (isConfirmed(transactionId)) {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data))\n Execution(transactionId);\n else {\n ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n }\n\n // call has been separated into its own function in order to take advantage\n // of the Solidity's code generator to produce a loop that copies tx.data into memory.\n function external_call(address destination, uint value, uint dataLength, bytes data) internal returns (bool) {\n bool result;\n assembly {\n let x := mload(0x40) // \"Allocate\" memory for output (0x40 is where \"free memory\" pointer is stored by convention)\n let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that\n result := call(\n sub(gas, 34710), // 34710 is the value that solidity is currently emitting\n // It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) +\n // callNewAccountGas (25000, in case the destination address does not exist and needs creating)\n destination,\n value,\n d,\n dataLength, // Size of the input (in bytes) - this is what fixes the padding problem\n x,\n 0 // Output is ignored, therefore the output size is zero\n )\n }\n return result;\n }\n\n /// @dev Returns the confirmation status of a transaction.\n /// @param transactionId Transaction ID.\n /// @return Confirmation status.\n function isConfirmed(uint transactionId)\n public\n constant\n returns (bool)\n {\n uint count = 0;\n for (uint i=0; i<owners.length; i++) {\n if (confirmations[transactionId][owners[i]])\n count += 1;\n if (count == required)\n return true;\n }\n }\n\n /*\n * Internal functions\n */\n /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet.\n /// @param destination Transaction target address.\n /// @param value Transaction ether value.\n /// @param data Transaction data payload.\n /// @return Returns transaction ID.\n function addTransaction(address destination, uint value, bytes data)\n internal\n notNull(destination)\n returns (uint transactionId)\n {\n transactionId = transactionCount;\n transactions[transactionId] = Transaction({\n destination: destination,\n value: value,\n data: data,\n executed: false\n });\n transactionCount += 1;\n Submission(transactionId);\n }\n\n /*\n * Web3 call functions\n */\n /// @dev Returns number of confirmations of a transaction.\n /// @param transactionId Transaction ID.\n /// @return Number of confirmations.\n function getConfirmationCount(uint transactionId)\n public\n constant\n returns (uint count)\n {\n for (uint i=0; i<owners.length; i++)\n if (confirmations[transactionId][owners[i]])\n count += 1;\n }\n\n /// @dev Returns total number of transactions after filers are applied.\n /// @param pending Include pending transactions.\n /// @param executed Include executed transactions.\n /// @return Total number of transactions after filters are applied.\n function getTransactionCount(bool pending, bool executed)\n public\n constant\n returns (uint count)\n {\n for (uint i=0; i<transactionCount; i++)\n if ( pending && !transactions[i].executed\n || executed && transactions[i].executed)\n count += 1;\n }\n\n /// @dev Returns list of owners.\n /// @return List of owner addresses.\n function getOwners()\n public\n constant\n returns (address[])\n {\n return owners;\n }\n\n /// @dev Returns array with owner addresses, which confirmed transaction.\n /// @param transactionId Transaction ID.\n /// @return Returns array of owner addresses.\n function getConfirmations(uint transactionId)\n public\n constant\n returns (address[] _confirmations)\n {\n address[] memory confirmationsTemp = new address[](owners.length);\n uint count = 0;\n uint i;\n for (i=0; i<owners.length; i++)\n if (confirmations[transactionId][owners[i]]) {\n confirmationsTemp[count] = owners[i];\n count += 1;\n }\n _confirmations = new address[](count);\n for (i=0; i<count; i++)\n _confirmations[i] = confirmationsTemp[i];\n }\n\n /// @dev Returns list of transaction IDs in defined range.\n /// @param from Index start position of transaction array.\n /// @param to Index end position of transaction array.\n /// @param pending Include pending transactions.\n /// @param executed Include executed transactions.\n /// @return Returns array of transaction IDs.\n function getTransactionIds(uint from, uint to, bool pending, bool executed)\n public\n constant\n returns (uint[] _transactionIds)\n {\n uint[] memory transactionIdsTemp = new uint[](transactionCount);\n uint count = 0;\n uint i;\n for (i=0; i<transactionCount; i++)\n if ( pending && !transactions[i].executed\n || executed && transactions[i].executed)\n {\n transactionIdsTemp[count] = i;\n count += 1;\n }\n _transactionIds = new uint[](to - from);\n for (i=from; i<to; i++)\n _transactionIds[i - from] = transactionIdsTemp[i];\n }\n}",
- "2.0.0/multisig/MultiSigWalletWithTimeLock.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MultiSigWallet.sol\";\n\n\n/// @title Multisignature wallet with time lock- Allows multiple parties to execute a transaction after a time lock has passed.\n/// @author Amir Bandeali - <amir@0xProject.com>\n// solhint-disable not-rely-on-time\ncontract MultiSigWalletWithTimeLock is\n MultiSigWallet\n{\n event ConfirmationTimeSet(uint256 indexed transactionId, uint256 confirmationTime);\n event TimeLockChange(uint256 secondsTimeLocked);\n\n uint256 public secondsTimeLocked;\n\n mapping (uint256 => uint256) public confirmationTimes;\n\n modifier notFullyConfirmed(uint256 transactionId) {\n require(\n !isConfirmed(transactionId),\n \"TX_FULLY_CONFIRMED\"\n );\n _;\n }\n\n modifier fullyConfirmed(uint256 transactionId) {\n require(\n isConfirmed(transactionId),\n \"TX_NOT_FULLY_CONFIRMED\"\n );\n _;\n }\n\n modifier pastTimeLock(uint256 transactionId) {\n require(\n block.timestamp >= confirmationTimes[transactionId] + secondsTimeLocked,\n \"TIME_LOCK_INCOMPLETE\"\n );\n _;\n }\n\n /// @dev Contract constructor sets initial owners, required number of confirmations, and time lock.\n /// @param _owners List of initial owners.\n /// @param _required Number of required confirmations.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n constructor (\n address[] _owners,\n uint256 _required,\n uint256 _secondsTimeLocked\n )\n public\n MultiSigWallet(_owners, _required)\n {\n secondsTimeLocked = _secondsTimeLocked;\n }\n\n /// @dev Changes the duration of the time lock for transactions.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n function changeTimeLock(uint256 _secondsTimeLocked)\n public\n onlyWallet\n {\n secondsTimeLocked = _secondsTimeLocked;\n emit TimeLockChange(_secondsTimeLocked);\n }\n\n /// @dev Allows an owner to confirm a transaction.\n /// @param transactionId Transaction ID.\n function confirmTransaction(uint256 transactionId)\n public\n ownerExists(msg.sender)\n transactionExists(transactionId)\n notConfirmed(transactionId, msg.sender)\n notFullyConfirmed(transactionId)\n {\n confirmations[transactionId][msg.sender] = true;\n emit Confirmation(msg.sender, transactionId);\n if (isConfirmed(transactionId)) {\n setConfirmationTime(transactionId, block.timestamp);\n }\n }\n\n /// @dev Allows anyone to execute a confirmed transaction.\n /// @param transactionId Transaction ID.\n function executeTransaction(uint256 transactionId)\n public\n notExecuted(transactionId)\n fullyConfirmed(transactionId)\n pastTimeLock(transactionId)\n {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) {\n emit Execution(transactionId);\n } else {\n emit ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n\n /// @dev Sets the time of when a submission first passed.\n function setConfirmationTime(uint256 transactionId, uint256 confirmationTime)\n internal\n {\n confirmationTimes[transactionId] = confirmationTime;\n emit ConfirmationTimeSet(transactionId, confirmationTime);\n }\n}\n",
- "2.0.0/protocol/AssetProxy/ERC20Proxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MixinAuthorizable.sol\";\n\n\ncontract ERC20Proxy is\n MixinAuthorizable\n{\n // Id of this proxy.\n bytes4 constant internal PROXY_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n \n // solhint-disable-next-line payable-fallback\n function () \n external\n {\n assembly {\n // The first 4 bytes of calldata holds the function selector\n let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)\n\n // `transferFrom` will be called with the following parameters:\n // assetData Encoded byte array.\n // from Address to transfer asset from.\n // to Address to transfer asset to.\n // amount Amount of asset to transfer.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {\n\n // To lookup a value in a mapping, we load from the storage location keccak256(k, p),\n // where k is the key left padded to 32 bytes and p is the storage slot\n let start := mload(64)\n mstore(start, and(caller, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(start, 32), authorized_slot)\n\n // Revert if authorized[msg.sender] == false\n if iszero(sload(keccak256(start, 64))) {\n // Revert with `Error(\"SENDER_NOT_AUTHORIZED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // `transferFrom`.\n // The function is marked `external`, so no abi decodeding is done for\n // us. Instead, we expect the `calldata` memory to contain the\n // following:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n //\n // (*): offset is computed from start of function parameters, so offset\n // by an additional 4 bytes in the calldata.\n //\n // (**): see table below to compute length of assetData Contents\n //\n // WARNING: The ABIv2 specification allows additional padding between\n // the Params and Data section. This will result in a larger\n // offset to assetData.\n\n // Asset data itself is encoded as follows:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 1 * 32 | function parameters: |\n // | | 4 | 12 + 20 | 1. token address |\n\n // We construct calldata for the `token.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 4 | | 1. from |\n // | | 36 | | 2. to |\n // | | 68 | | 3. amount |\n\n /////// Read token address from calldata ///////\n // * The token address is stored in `assetData`.\n //\n // * The \"offset to assetData\" is stored at offset 4 in the calldata (table 1).\n // [assetDataOffsetFromParams = calldataload(4)]\n //\n // * Notes that the \"offset to assetData\" is relative to the \"Params\" area of calldata;\n // add 4 bytes to account for the length of the \"Header\" area (table 1).\n // [assetDataOffsetFromHeader = assetDataOffsetFromParams + 4]\n //\n // * The \"token address\" is offset 32+4=36 bytes into \"assetData\" (tables 1 & 2).\n // [tokenOffset = assetDataOffsetFromHeader + 36 = calldataload(4) + 4 + 36]\n let token := calldataload(add(calldataload(4), 40))\n \n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFrom` selector.\n // Any trailing data in transferFromSelector will be\n // overwritten in the next `mstore` call.\n mstore(0, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // We copy the fields `from`, `to` and `amount` in bulk\n // from our own calldata to the new calldata.\n calldatacopy(4, 36, 96)\n\n /////// Call `token.transferFrom` using the calldata ///////\n let success := call(\n gas, // forward all gas\n token, // call address of token contract\n 0, // don't send any ETH\n 0, // pointer to start of input\n 100, // length of input\n 0, // write output over input\n 32 // output size should be 32 bytes\n )\n\n /////// Check return data. ///////\n // If there is no return data, we assume the token incorrectly\n // does not return a bool. In this case we expect it to revert\n // on failure, which was handled above.\n // If the token does return data, we require that it is a single\n // nonzero 32 bytes value.\n // So the transfer succeeded if the call succeeded and either\n // returned nothing, or returned a non-zero 32 byte value. \n success := and(success, or(\n iszero(returndatasize),\n and(\n eq(returndatasize, 32),\n gt(mload(0), 0)\n )\n ))\n if success {\n return(0, 0)\n }\n \n // Revert with `Error(\"TRANSFER_FAILED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // Revert if undefined function is called\n revert(0, 0)\n }\n }\n\n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4)\n {\n return PROXY_ID;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/ERC721Proxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MixinAuthorizable.sol\";\n\n\ncontract ERC721Proxy is\n MixinAuthorizable\n{\n // Id of this proxy.\n bytes4 constant internal PROXY_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n\n // solhint-disable-next-line payable-fallback\n function () \n external\n {\n assembly {\n // The first 4 bytes of calldata holds the function selector\n let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)\n\n // `transferFrom` will be called with the following parameters:\n // assetData Encoded byte array.\n // from Address to transfer asset from.\n // to Address to transfer asset to.\n // amount Amount of asset to transfer.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {\n\n // To lookup a value in a mapping, we load from the storage location keccak256(k, p),\n // where k is the key left padded to 32 bytes and p is the storage slot\n let start := mload(64)\n mstore(start, and(caller, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(start, 32), authorized_slot)\n\n // Revert if authorized[msg.sender] == false\n if iszero(sload(keccak256(start, 64))) {\n // Revert with `Error(\"SENDER_NOT_AUTHORIZED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // `transferFrom`.\n // The function is marked `external`, so no abi decodeding is done for\n // us. Instead, we expect the `calldata` memory to contain the\n // following:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n //\n // (*): offset is computed from start of function parameters, so offset\n // by an additional 4 bytes in the calldata.\n //\n // (**): see table below to compute length of assetData Contents\n //\n // WARNING: The ABIv2 specification allows additional padding between\n // the Params and Data section. This will result in a larger\n // offset to assetData.\n\n // Asset data itself is encoded as follows:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 2 * 32 | function parameters: |\n // | | 4 | 12 + 20 | 1. token address |\n // | | 36 | | 2. tokenId |\n \n // We construct calldata for the `token.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n // \n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 4 | | 1. from |\n // | | 36 | | 2. to |\n // | | 68 | | 3. tokenId |\n\n // There exists only 1 of each token.\n // require(amount == 1, \"INVALID_AMOUNT\")\n if sub(calldataload(100), 1) {\n // Revert with `Error(\"INVALID_AMOUNT\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000e494e56414c49445f414d4f554e540000000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFrom` selector.\n // Any trailing data in transferFromSelector will be\n // overwritten in the next `mstore` call.\n mstore(0, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // We copy the fields `from` and `to` in bulk\n // from our own calldata to the new calldata.\n calldatacopy(4, 36, 64)\n\n // Copy `tokenId` field from our own calldata to the new calldata.\n let assetDataOffset := calldataload(4)\n calldatacopy(68, add(assetDataOffset, 72), 32)\n\n /////// Call `token.transferFrom` using the calldata ///////\n let token := calldataload(add(assetDataOffset, 40))\n let success := call(\n gas, // forward all gas\n token, // call address of token contract\n 0, // don't send any ETH\n 0, // pointer to start of input\n 100, // length of input\n 0, // write output to null\n 0 // output size is 0 bytes\n )\n if success {\n return(0, 0)\n }\n \n // Revert with `Error(\"TRANSFER_FAILED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // Revert if undefined function is called\n revert(0, 0)\n }\n }\n\n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4)\n {\n return PROXY_ID;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/MixinAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"./mixins/MAuthorizable.sol\";\n\n\ncontract MixinAuthorizable is\n Ownable,\n MAuthorizable\n{\n /// @dev Only authorized addresses can invoke functions with this modifier.\n modifier onlyAuthorized {\n require(\n authorized[msg.sender],\n \"SENDER_NOT_AUTHORIZED\"\n );\n _;\n }\n\n mapping (address => bool) public authorized;\n address[] public authorities;\n\n /// @dev Authorizes an address.\n /// @param target Address to authorize.\n function addAuthorizedAddress(address target)\n external\n onlyOwner\n {\n require(\n !authorized[target],\n \"TARGET_ALREADY_AUTHORIZED\"\n );\n\n authorized[target] = true;\n authorities.push(target);\n emit AuthorizedAddressAdded(target, msg.sender);\n }\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n function removeAuthorizedAddress(address target)\n external\n onlyOwner\n {\n require(\n authorized[target],\n \"TARGET_NOT_AUTHORIZED\"\n );\n\n delete authorized[target];\n for (uint256 i = 0; i < authorities.length; i++) {\n if (authorities[i] == target) {\n authorities[i] = authorities[authorities.length - 1];\n authorities.length -= 1;\n break;\n }\n }\n emit AuthorizedAddressRemoved(target, msg.sender);\n }\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n /// @param index Index of target in authorities array.\n function removeAuthorizedAddressAtIndex(\n address target,\n uint256 index\n )\n external\n onlyOwner\n {\n require(\n authorized[target],\n \"TARGET_NOT_AUTHORIZED\"\n );\n require(\n index < authorities.length,\n \"INDEX_OUT_OF_BOUNDS\"\n );\n require(\n authorities[index] == target,\n \"AUTHORIZED_ADDRESS_MISMATCH\"\n );\n\n delete authorized[target];\n authorities[index] = authorities[authorities.length - 1];\n authorities.length -= 1;\n emit AuthorizedAddressRemoved(target, msg.sender);\n }\n\n /// @dev Gets all authorized addresses.\n /// @return Array of authorized addresses.\n function getAuthorizedAddresses()\n external\n view\n returns (address[] memory)\n {\n return authorities;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IAuthorizable.sol\";\n\n\ncontract IAssetProxy is\n IAuthorizable\n{\n /// @dev Transfers assets. Either succeeds or throws.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param from Address to transfer asset from.\n /// @param to Address to transfer asset to.\n /// @param amount Amount of asset to transfer.\n function transferFrom(\n bytes assetData,\n address from,\n address to,\n uint256 amount\n )\n external;\n \n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4);\n}\n",
- "2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/Ownable/IOwnable.sol\";\n\n\ncontract IAuthorizable is\n IOwnable\n{\n /// @dev Authorizes an address.\n /// @param target Address to authorize.\n function addAuthorizedAddress(address target)\n external;\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n function removeAuthorizedAddress(address target)\n external;\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n /// @param index Index of target in authorities array.\n function removeAuthorizedAddressAtIndex(\n address target,\n uint256 index\n )\n external;\n \n /// @dev Gets all authorized addresses.\n /// @return Array of authorized addresses.\n function getAuthorizedAddresses()\n external\n view\n returns (address[] memory);\n}\n",
- "2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAuthorizable.sol\";\n\n\ncontract MAuthorizable is\n IAuthorizable\n{\n // Event logged when a new address is authorized.\n event AuthorizedAddressAdded(\n address indexed target,\n address indexed caller\n );\n\n // Event logged when a currently authorized address is unauthorized.\n event AuthorizedAddressRemoved(\n address indexed target,\n address indexed caller\n );\n\n /// @dev Only authorized addresses can invoke functions with this modifier.\n modifier onlyAuthorized { revert(); _; }\n}\n",
- "2.0.0/protocol/AssetProxyOwner/AssetProxyOwner.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../multisig/MultiSigWalletWithTimeLock.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\n\n\ncontract AssetProxyOwner is\n MultiSigWalletWithTimeLock\n{\n using LibBytes for bytes;\n\n event AssetProxyRegistration(address assetProxyContract, bool isRegistered);\n\n // Mapping of AssetProxy contract address =>\n // if this contract is allowed to call the AssetProxy's `removeAuthorizedAddressAtIndex` method without a time lock.\n mapping (address => bool) public isAssetProxyRegistered;\n\n bytes4 constant internal REMOVE_AUTHORIZED_ADDRESS_AT_INDEX_SELECTOR = bytes4(keccak256(\"removeAuthorizedAddressAtIndex(address,uint256)\"));\n\n /// @dev Function will revert if the transaction does not call `removeAuthorizedAddressAtIndex`\n /// on an approved AssetProxy contract.\n modifier validRemoveAuthorizedAddressAtIndexTx(uint256 transactionId) {\n Transaction storage txn = transactions[transactionId];\n require(\n isAssetProxyRegistered[txn.destination],\n \"UNREGISTERED_ASSET_PROXY\"\n );\n require(\n txn.data.readBytes4(0) == REMOVE_AUTHORIZED_ADDRESS_AT_INDEX_SELECTOR,\n \"INVALID_FUNCTION_SELECTOR\"\n );\n _;\n }\n\n /// @dev Contract constructor sets initial owners, required number of confirmations,\n /// time lock, and list of AssetProxy addresses.\n /// @param _owners List of initial owners.\n /// @param _assetProxyContracts Array of AssetProxy contract addresses.\n /// @param _required Number of required confirmations.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n constructor (\n address[] memory _owners,\n address[] memory _assetProxyContracts,\n uint256 _required,\n uint256 _secondsTimeLocked\n )\n public\n MultiSigWalletWithTimeLock(_owners, _required, _secondsTimeLocked)\n {\n for (uint256 i = 0; i < _assetProxyContracts.length; i++) {\n address assetProxy = _assetProxyContracts[i];\n require(\n assetProxy != address(0),\n \"INVALID_ASSET_PROXY\"\n );\n isAssetProxyRegistered[assetProxy] = true;\n }\n }\n\n /// @dev Registers or deregisters an AssetProxy to be able to execute\n /// `removeAuthorizedAddressAtIndex` without a timelock.\n /// @param assetProxyContract Address of AssetProxy contract.\n /// @param isRegistered Status of approval for AssetProxy contract.\n function registerAssetProxy(address assetProxyContract, bool isRegistered)\n public\n onlyWallet\n notNull(assetProxyContract)\n {\n isAssetProxyRegistered[assetProxyContract] = isRegistered;\n emit AssetProxyRegistration(assetProxyContract, isRegistered);\n }\n\n /// @dev Allows execution of `removeAuthorizedAddressAtIndex` without time lock.\n /// @param transactionId Transaction ID.\n function executeRemoveAuthorizedAddressAtIndex(uint256 transactionId)\n public\n notExecuted(transactionId)\n fullyConfirmed(transactionId)\n validRemoveAuthorizedAddressAtIndexTx(transactionId)\n {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) {\n emit Execution(transactionId);\n } else {\n emit ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/Exchange.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./MixinExchangeCore.sol\";\nimport \"./MixinSignatureValidator.sol\";\nimport \"./MixinWrapperFunctions.sol\";\nimport \"./MixinAssetProxyDispatcher.sol\";\nimport \"./MixinTransactions.sol\";\nimport \"./MixinMatchOrders.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract Exchange is\n MixinExchangeCore,\n MixinMatchOrders,\n MixinSignatureValidator,\n MixinTransactions,\n MixinAssetProxyDispatcher,\n MixinWrapperFunctions\n{\n string constant public VERSION = \"2.0.1-alpha\";\n\n // Mixins are instantiated in the order they are inherited\n constructor (bytes memory _zrxAssetData)\n public\n LibConstants(_zrxAssetData) // @TODO: Remove when we deploy.\n MixinExchangeCore()\n MixinMatchOrders()\n MixinSignatureValidator()\n MixinTransactions()\n MixinAssetProxyDispatcher()\n MixinWrapperFunctions()\n {}\n}\n",
- "2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\nimport \"../AssetProxy/interfaces/IAssetProxy.sol\";\n\n\ncontract MixinAssetProxyDispatcher is\n Ownable,\n MAssetProxyDispatcher\n{\n // Mapping from Asset Proxy Id's to their respective Asset Proxy\n mapping (bytes4 => IAssetProxy) public assetProxies;\n\n /// @dev Registers an asset proxy to its asset proxy id.\n /// Once an asset proxy is registered, it cannot be unregistered.\n /// @param assetProxy Address of new asset proxy to register.\n function registerAssetProxy(address assetProxy)\n external\n onlyOwner\n {\n IAssetProxy assetProxyContract = IAssetProxy(assetProxy);\n\n // Ensure that no asset proxy exists with current id.\n bytes4 assetProxyId = assetProxyContract.getProxyId();\n address currentAssetProxy = assetProxies[assetProxyId];\n require(\n currentAssetProxy == address(0),\n \"ASSET_PROXY_ALREADY_EXISTS\"\n );\n\n // Add asset proxy and log registration.\n assetProxies[assetProxyId] = assetProxyContract;\n emit AssetProxyRegistered(\n assetProxyId,\n assetProxy\n );\n }\n\n /// @dev Gets an asset proxy.\n /// @param assetProxyId Id of the asset proxy.\n /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered.\n function getAssetProxy(bytes4 assetProxyId)\n external\n view\n returns (address)\n {\n return assetProxies[assetProxyId];\n }\n\n /// @dev Forwards arguments to assetProxy and calls `transferFrom`. Either succeeds or throws.\n /// @param assetData Byte array encoded for the asset.\n /// @param from Address to transfer token from.\n /// @param to Address to transfer token to.\n /// @param amount Amount of token to transfer.\n function dispatchTransferFrom(\n bytes memory assetData,\n address from,\n address to,\n uint256 amount\n )\n internal\n {\n // Do nothing if no amount should be transferred.\n if (amount > 0 && from != to) {\n // Ensure assetData length is valid\n require(\n assetData.length > 3,\n \"LENGTH_GREATER_THAN_3_REQUIRED\"\n );\n \n // Lookup assetProxy. We do not use `LibBytes.readBytes4` for gas efficiency reasons.\n bytes4 assetProxyId;\n assembly {\n assetProxyId := and(mload(\n add(assetData, 32)),\n 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000\n )\n }\n address assetProxy = assetProxies[assetProxyId];\n\n // Ensure that assetProxy exists\n require(\n assetProxy != address(0),\n \"ASSET_PROXY_DOES_NOT_EXIST\"\n );\n \n // We construct calldata for the `assetProxy.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n // \n // | Area | Offset | Length | Contents |\n // | -------- |--------|---------|-------------------------------------------- |\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n\n assembly {\n /////// Setup State ///////\n // `cdStart` is the start of the calldata for `assetProxy.transferFrom` (equal to free memory ptr).\n let cdStart := mload(64)\n // `dataAreaLength` is the total number of words needed to store `assetData`\n // As-per the ABI spec, this value is padded up to the nearest multiple of 32,\n // and includes 32-bytes for length.\n let dataAreaLength := and(add(mload(assetData), 63), 0xFFFFFFFFFFFE0)\n // `cdEnd` is the end of the calldata for `assetProxy.transferFrom`.\n let cdEnd := add(cdStart, add(132, dataAreaLength))\n\n \n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFromSelector`.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n mstore(cdStart, 0xa85e59e400000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // Each parameter is padded to 32-bytes. The entire Params Area is 128 bytes.\n // Notes:\n // 1. The offset to `assetData` is the length of the Params Area (128 bytes).\n // 2. A 20-byte mask is applied to addresses to zero-out the unused bytes.\n mstore(add(cdStart, 4), 128)\n mstore(add(cdStart, 36), and(from, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(cdStart, 68), and(to, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(cdStart, 100), amount)\n \n /////// Setup Data Area ///////\n // This area holds `assetData`.\n let dataArea := add(cdStart, 132)\n // solhint-disable-next-line no-empty-blocks\n for {} lt(dataArea, cdEnd) {} {\n mstore(dataArea, mload(assetData))\n dataArea := add(dataArea, 32)\n assetData := add(assetData, 32)\n }\n\n /////// Call `assetProxy.transferFrom` using the constructed calldata ///////\n let success := call(\n gas, // forward all gas\n assetProxy, // call address of asset proxy\n 0, // don't send any ETH\n cdStart, // pointer to start of input\n sub(cdEnd, cdStart), // length of input \n cdStart, // write output over input\n 512 // reserve 512 bytes for output\n )\n if iszero(success) {\n revert(cdStart, returndatasize())\n }\n }\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\n\n\ncontract MixinExchangeCore is\n ReentrancyGuard,\n LibConstants,\n LibMath,\n LibOrder,\n LibFillResults,\n MAssetProxyDispatcher,\n MExchangeCore,\n MSignatureValidator,\n MTransactions\n{\n // Mapping of orderHash => amount of takerAsset already bought by maker\n mapping (bytes32 => uint256) public filled;\n\n // Mapping of orderHash => cancelled\n mapping (bytes32 => bool) public cancelled;\n\n // Mapping of makerAddress => senderAddress => lowest salt an order can have in order to be fillable\n // Orders with specified senderAddress and with a salt less than their epoch are considered cancelled\n mapping (address => mapping (address => uint256)) public orderEpoch;\n\n /// @dev Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch\n /// and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress).\n /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled.\n function cancelOrdersUpTo(uint256 targetOrderEpoch)\n external\n nonReentrant\n {\n address makerAddress = getCurrentContextAddress();\n // If this function is called via `executeTransaction`, we only update the orderEpoch for the makerAddress/msg.sender combination.\n // This allows external filter contracts to add rules to how orders are cancelled via this function.\n address senderAddress = makerAddress == msg.sender ? address(0) : msg.sender;\n\n // orderEpoch is initialized to 0, so to cancelUpTo we need salt + 1\n uint256 newOrderEpoch = targetOrderEpoch + 1; \n uint256 oldOrderEpoch = orderEpoch[makerAddress][senderAddress];\n\n // Ensure orderEpoch is monotonically increasing\n require(\n newOrderEpoch > oldOrderEpoch, \n \"INVALID_NEW_ORDER_EPOCH\"\n );\n\n // Update orderEpoch\n orderEpoch[makerAddress][senderAddress] = newOrderEpoch;\n emit CancelUpTo(\n makerAddress,\n senderAddress,\n newOrderEpoch\n );\n }\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrder(\n Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n nonReentrant\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n return fillResults;\n }\n\n /// @dev After calling, the order can not be filled anymore.\n /// Throws if order is invalid or sender does not have permission to cancel.\n /// @param order Order to cancel. Order must be OrderStatus.FILLABLE.\n function cancelOrder(Order memory order)\n public\n nonReentrant\n {\n cancelOrderInternal(order);\n }\n\n /// @dev Gets information about an order: status, hash, and amount filled.\n /// @param order Order to gather information on.\n /// @return OrderInfo Information about the order and its state.\n /// See LibOrder.OrderInfo for a complete description.\n function getOrderInfo(Order memory order)\n public\n view\n returns (OrderInfo memory orderInfo)\n {\n // Compute the order hash\n orderInfo.orderHash = getOrderHash(order);\n\n // Fetch filled amount\n orderInfo.orderTakerAssetFilledAmount = filled[orderInfo.orderHash];\n\n // If order.makerAssetAmount is zero, we also reject the order.\n // While the Exchange contract handles them correctly, they create\n // edge cases in the supporting infrastructure because they have\n // an 'infinite' price when computed by a simple division.\n if (order.makerAssetAmount == 0) {\n orderInfo.orderStatus = uint8(OrderStatus.INVALID_MAKER_ASSET_AMOUNT);\n return orderInfo;\n }\n\n // If order.takerAssetAmount is zero, then the order will always\n // be considered filled because 0 == takerAssetAmount == orderTakerAssetFilledAmount\n // Instead of distinguishing between unfilled and filled zero taker\n // amount orders, we choose not to support them.\n if (order.takerAssetAmount == 0) {\n orderInfo.orderStatus = uint8(OrderStatus.INVALID_TAKER_ASSET_AMOUNT);\n return orderInfo;\n }\n\n // Validate order availability\n if (orderInfo.orderTakerAssetFilledAmount >= order.takerAssetAmount) {\n orderInfo.orderStatus = uint8(OrderStatus.FULLY_FILLED);\n return orderInfo;\n }\n\n // Validate order expiration\n // solhint-disable-next-line not-rely-on-time\n if (block.timestamp >= order.expirationTimeSeconds) {\n orderInfo.orderStatus = uint8(OrderStatus.EXPIRED);\n return orderInfo;\n }\n\n // Check if order has been cancelled\n if (cancelled[orderInfo.orderHash]) {\n orderInfo.orderStatus = uint8(OrderStatus.CANCELLED);\n return orderInfo;\n }\n if (orderEpoch[order.makerAddress][order.senderAddress] > order.salt) {\n orderInfo.orderStatus = uint8(OrderStatus.CANCELLED);\n return orderInfo;\n }\n\n // All other statuses are ruled out: order is Fillable\n orderInfo.orderStatus = uint8(OrderStatus.FILLABLE);\n return orderInfo;\n }\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderInternal(\n Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n // Fetch order info\n OrderInfo memory orderInfo = getOrderInfo(order);\n\n // Fetch taker address\n address takerAddress = getCurrentContextAddress();\n \n // Assert that the order is fillable by taker\n assertFillableOrder(\n order,\n orderInfo,\n takerAddress,\n signature\n );\n \n // Get amount of takerAsset to fill\n uint256 remainingTakerAssetAmount = safeSub(order.takerAssetAmount, orderInfo.orderTakerAssetFilledAmount);\n uint256 takerAssetFilledAmount = min256(takerAssetFillAmount, remainingTakerAssetAmount);\n\n // Validate context\n assertValidFill(\n order,\n orderInfo,\n takerAssetFillAmount,\n takerAssetFilledAmount,\n fillResults.makerAssetFilledAmount\n );\n\n // Compute proportional fill amounts\n fillResults = calculateFillResults(order, takerAssetFilledAmount);\n\n // Update exchange internal state\n updateFilledState(\n order,\n takerAddress,\n orderInfo.orderHash,\n orderInfo.orderTakerAssetFilledAmount,\n fillResults\n );\n \n // Settle order\n settleOrder(\n order,\n takerAddress,\n fillResults\n );\n\n return fillResults;\n }\n\n /// @dev After calling, the order can not be filled anymore.\n /// Throws if order is invalid or sender does not have permission to cancel.\n /// @param order Order to cancel. Order must be OrderStatus.FILLABLE.\n function cancelOrderInternal(Order memory order)\n internal\n {\n // Fetch current order status\n OrderInfo memory orderInfo = getOrderInfo(order);\n\n // Validate context\n assertValidCancel(order, orderInfo);\n\n // Perform cancel\n updateCancelledState(order, orderInfo.orderHash);\n }\n\n /// @dev Updates state with results of a fill order.\n /// @param order that was filled.\n /// @param takerAddress Address of taker who filled the order.\n /// @param orderTakerAssetFilledAmount Amount of order already filled.\n function updateFilledState(\n Order memory order,\n address takerAddress,\n bytes32 orderHash,\n uint256 orderTakerAssetFilledAmount,\n FillResults memory fillResults\n )\n internal\n {\n // Update state\n filled[orderHash] = safeAdd(orderTakerAssetFilledAmount, fillResults.takerAssetFilledAmount);\n\n // Log order\n emit Fill(\n order.makerAddress,\n order.feeRecipientAddress,\n takerAddress,\n msg.sender,\n fillResults.makerAssetFilledAmount,\n fillResults.takerAssetFilledAmount,\n fillResults.makerFeePaid,\n fillResults.takerFeePaid,\n orderHash,\n order.makerAssetData,\n order.takerAssetData\n );\n }\n\n /// @dev Updates state with results of cancelling an order.\n /// State is only updated if the order is currently fillable.\n /// Otherwise, updating state would have no effect.\n /// @param order that was cancelled.\n /// @param orderHash Hash of order that was cancelled.\n function updateCancelledState(\n Order memory order,\n bytes32 orderHash\n )\n internal\n {\n // Perform cancel\n cancelled[orderHash] = true;\n\n // Log cancel\n emit Cancel(\n order.makerAddress,\n order.feeRecipientAddress,\n msg.sender,\n orderHash,\n order.makerAssetData,\n order.takerAssetData\n );\n }\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAddress Address of order taker.\n /// @param signature Proof that the orders was created by its maker.\n function assertFillableOrder(\n Order memory order,\n OrderInfo memory orderInfo,\n address takerAddress,\n bytes memory signature\n )\n internal\n view\n {\n // An order can only be filled if its status is FILLABLE.\n require(\n orderInfo.orderStatus == uint8(OrderStatus.FILLABLE),\n \"ORDER_UNFILLABLE\"\n );\n \n // Validate sender is allowed to fill this order\n if (order.senderAddress != address(0)) {\n require(\n order.senderAddress == msg.sender,\n \"INVALID_SENDER\"\n );\n }\n \n // Validate taker is allowed to fill this order\n if (order.takerAddress != address(0)) {\n require(\n order.takerAddress == takerAddress,\n \"INVALID_TAKER\"\n );\n }\n \n // Validate Maker signature (check only if first time seen)\n if (orderInfo.orderTakerAssetFilledAmount == 0) {\n require(\n isValidSignature(\n orderInfo.orderHash,\n order.makerAddress,\n signature\n ),\n \"INVALID_ORDER_SIGNATURE\"\n );\n }\n }\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAssetFillAmount Desired amount of order to fill by taker.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @param makerAssetFilledAmount Amount of makerAsset that will be transfered.\n function assertValidFill(\n Order memory order,\n OrderInfo memory orderInfo,\n uint256 takerAssetFillAmount, // TODO: use FillResults\n uint256 takerAssetFilledAmount,\n uint256 makerAssetFilledAmount\n )\n internal\n view\n {\n // Revert if fill amount is invalid\n // TODO: reconsider necessity for v2.1\n require(\n takerAssetFillAmount != 0,\n \"INVALID_TAKER_AMOUNT\"\n );\n \n // Make sure taker does not pay more than desired amount\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n takerAssetFilledAmount <= takerAssetFillAmount,\n \"TAKER_OVERPAY\"\n );\n \n // Make sure order is not overfilled\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n safeAdd(orderInfo.orderTakerAssetFilledAmount, takerAssetFilledAmount) <= order.takerAssetAmount,\n \"ORDER_OVERFILL\"\n );\n \n // Make sure order is filled at acceptable price.\n // The order has an implied price from the makers perspective:\n // order price = order.makerAssetAmount / order.takerAssetAmount\n // i.e. the number of makerAsset maker is paying per takerAsset. The\n // maker is guaranteed to get this price or a better (lower) one. The\n // actual price maker is getting in this fill is:\n // fill price = makerAssetFilledAmount / takerAssetFilledAmount\n // We need `fill price <= order price` for the fill to be fair to maker.\n // This amounts to:\n // makerAssetFilledAmount order.makerAssetAmount\n // ------------------------ <= -----------------------\n // takerAssetFilledAmount order.takerAssetAmount\n // or, equivalently:\n // makerAssetFilledAmount * order.takerAssetAmount <=\n // order.makerAssetAmount * takerAssetFilledAmount\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n safeMul(makerAssetFilledAmount, order.takerAssetAmount)\n <= \n safeMul(order.makerAssetAmount, takerAssetFilledAmount),\n \"INVALID_FILL_PRICE\"\n );\n }\n\n /// @dev Validates context for cancelOrder. Succeeds or throws.\n /// @param order to be cancelled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n function assertValidCancel(\n Order memory order,\n OrderInfo memory orderInfo\n )\n internal\n view\n {\n // Ensure order is valid\n // An order can only be cancelled if its status is FILLABLE.\n require(\n orderInfo.orderStatus == uint8(OrderStatus.FILLABLE),\n \"ORDER_UNFILLABLE\"\n );\n\n // Validate sender is allowed to cancel this order\n if (order.senderAddress != address(0)) {\n require(\n order.senderAddress == msg.sender,\n \"INVALID_SENDER\"\n );\n }\n\n // Validate transaction signed by maker\n address makerAddress = getCurrentContextAddress();\n require(\n order.makerAddress == makerAddress,\n \"INVALID_MAKER\"\n );\n }\n\n /// @dev Calculates amounts filled and fees paid by maker and taker.\n /// @param order to be filled.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function calculateFillResults(\n Order memory order,\n uint256 takerAssetFilledAmount\n )\n internal\n pure\n returns (FillResults memory fillResults)\n {\n // Compute proportional transfer amounts\n fillResults.takerAssetFilledAmount = takerAssetFilledAmount;\n fillResults.makerAssetFilledAmount = safeGetPartialAmountFloor(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.makerAssetAmount\n );\n fillResults.makerFeePaid = safeGetPartialAmountFloor(\n fillResults.makerAssetFilledAmount,\n order.makerAssetAmount,\n order.makerFee\n );\n fillResults.takerFeePaid = safeGetPartialAmountFloor(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.takerFee\n );\n\n return fillResults;\n }\n\n /// @dev Settles an order by transferring assets between counterparties.\n /// @param order Order struct containing order specifications.\n /// @param takerAddress Address selling takerAsset and buying makerAsset.\n /// @param fillResults Amounts to be filled and fees paid by maker and taker.\n function settleOrder(\n LibOrder.Order memory order,\n address takerAddress,\n LibFillResults.FillResults memory fillResults\n )\n private\n {\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n dispatchTransferFrom(\n order.makerAssetData,\n order.makerAddress,\n takerAddress,\n fillResults.makerAssetFilledAmount\n );\n dispatchTransferFrom(\n order.takerAssetData,\n takerAddress,\n order.makerAddress,\n fillResults.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n zrxAssetData,\n order.makerAddress,\n order.feeRecipientAddress,\n fillResults.makerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n order.feeRecipientAddress,\n fillResults.takerFeePaid\n );\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinMatchOrders.sol": "/*\n Copyright 2018 ZeroEx Intl.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n http://www.apache.org/licenses/LICENSE-2.0\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MMatchOrders.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\n\n\ncontract MixinMatchOrders is\n ReentrancyGuard,\n LibConstants,\n LibMath,\n MAssetProxyDispatcher,\n MExchangeCore,\n MMatchOrders,\n MTransactions\n{\n /// @dev Match two complementary orders that have a profitable spread.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the left order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftSignature Proof that order was created by the left maker.\n /// @param rightSignature Proof that order was created by the right maker.\n /// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.\n function matchOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n bytes memory leftSignature,\n bytes memory rightSignature\n )\n public\n nonReentrant\n returns (LibFillResults.MatchedFillResults memory matchedFillResults)\n {\n // We assume that rightOrder.takerAssetData == leftOrder.makerAssetData and rightOrder.makerAssetData == leftOrder.takerAssetData.\n // If this assumption isn't true, the match will fail at signature validation.\n rightOrder.makerAssetData = leftOrder.takerAssetData;\n rightOrder.takerAssetData = leftOrder.makerAssetData;\n\n // Get left & right order info\n LibOrder.OrderInfo memory leftOrderInfo = getOrderInfo(leftOrder);\n LibOrder.OrderInfo memory rightOrderInfo = getOrderInfo(rightOrder);\n\n // Fetch taker address\n address takerAddress = getCurrentContextAddress();\n \n // Either our context is valid or we revert\n assertFillableOrder(\n leftOrder,\n leftOrderInfo,\n takerAddress,\n leftSignature\n );\n assertFillableOrder(\n rightOrder,\n rightOrderInfo,\n takerAddress,\n rightSignature\n );\n assertValidMatch(leftOrder, rightOrder);\n\n // Compute proportional fill amounts\n matchedFillResults = calculateMatchedFillResults(\n leftOrder,\n rightOrder,\n leftOrderInfo.orderTakerAssetFilledAmount,\n rightOrderInfo.orderTakerAssetFilledAmount\n );\n\n // Validate fill contexts\n assertValidFill(\n leftOrder,\n leftOrderInfo,\n matchedFillResults.left.takerAssetFilledAmount,\n matchedFillResults.left.takerAssetFilledAmount,\n matchedFillResults.left.makerAssetFilledAmount\n );\n assertValidFill(\n rightOrder,\n rightOrderInfo,\n matchedFillResults.right.takerAssetFilledAmount,\n matchedFillResults.right.takerAssetFilledAmount,\n matchedFillResults.right.makerAssetFilledAmount\n );\n \n // Update exchange state\n updateFilledState(\n leftOrder,\n takerAddress,\n leftOrderInfo.orderHash,\n leftOrderInfo.orderTakerAssetFilledAmount,\n matchedFillResults.left\n );\n updateFilledState(\n rightOrder,\n takerAddress,\n rightOrderInfo.orderHash,\n rightOrderInfo.orderTakerAssetFilledAmount,\n matchedFillResults.right\n );\n\n // Settle matched orders. Succeeds or throws.\n settleMatchedOrders(\n leftOrder,\n rightOrder,\n takerAddress,\n matchedFillResults\n );\n\n return matchedFillResults;\n }\n\n /// @dev Validates context for matchOrders. Succeeds or throws.\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n function assertValidMatch(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder\n )\n internal\n pure\n {\n // Make sure there is a profitable spread.\n // There is a profitable spread iff the cost per unit bought (OrderA.MakerAmount/OrderA.TakerAmount) for each order is greater\n // than the profit per unit sold of the matched order (OrderB.TakerAmount/OrderB.MakerAmount).\n // This is satisfied by the equations below:\n // <leftOrder.makerAssetAmount> / <leftOrder.takerAssetAmount> >= <rightOrder.takerAssetAmount> / <rightOrder.makerAssetAmount>\n // AND\n // <rightOrder.makerAssetAmount> / <rightOrder.takerAssetAmount> >= <leftOrder.takerAssetAmount> / <leftOrder.makerAssetAmount>\n // These equations can be combined to get the following:\n require(\n safeMul(leftOrder.makerAssetAmount, rightOrder.makerAssetAmount) >=\n safeMul(leftOrder.takerAssetAmount, rightOrder.takerAssetAmount),\n \"NEGATIVE_SPREAD_REQUIRED\"\n );\n }\n\n /// @dev Calculates fill amounts for the matched orders.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the leftOrder order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftOrderTakerAssetFilledAmount Amount of left order already filled.\n /// @param rightOrderTakerAssetFilledAmount Amount of right order already filled.\n /// @param matchedFillResults Amounts to fill and fees to pay by maker and taker of matched orders.\n function calculateMatchedFillResults(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n uint256 leftOrderTakerAssetFilledAmount,\n uint256 rightOrderTakerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.MatchedFillResults memory matchedFillResults)\n {\n // Derive maker asset amounts for left & right orders, given store taker assert amounts\n uint256 leftTakerAssetAmountRemaining = safeSub(leftOrder.takerAssetAmount, leftOrderTakerAssetFilledAmount);\n uint256 leftMakerAssetAmountRemaining = safeGetPartialAmountFloor(\n leftOrder.makerAssetAmount,\n leftOrder.takerAssetAmount,\n leftTakerAssetAmountRemaining\n );\n uint256 rightTakerAssetAmountRemaining = safeSub(rightOrder.takerAssetAmount, rightOrderTakerAssetFilledAmount);\n uint256 rightMakerAssetAmountRemaining = safeGetPartialAmountFloor(\n rightOrder.makerAssetAmount,\n rightOrder.takerAssetAmount,\n rightTakerAssetAmountRemaining\n );\n\n // Calculate fill results for maker and taker assets: at least one order will be fully filled.\n // The maximum amount the left maker can buy is `leftTakerAssetAmountRemaining`\n // The maximum amount the right maker can sell is `rightMakerAssetAmountRemaining`\n // We have two distinct cases for calculating the fill results:\n // Case 1.\n // If the left maker can buy more than the right maker can sell, then only the right order is fully filled.\n // If the left maker can buy exactly what the right maker can sell, then both orders are fully filled.\n // Case 2.\n // If the left maker cannot buy more than the right maker can sell, then only the left order is fully filled.\n if (leftTakerAssetAmountRemaining >= rightMakerAssetAmountRemaining) {\n // Case 1: Right order is fully filled\n matchedFillResults.right.makerAssetFilledAmount = rightMakerAssetAmountRemaining;\n matchedFillResults.right.takerAssetFilledAmount = rightTakerAssetAmountRemaining;\n matchedFillResults.left.takerAssetFilledAmount = matchedFillResults.right.makerAssetFilledAmount;\n // Round down to ensure the maker's exchange rate does not exceed the price specified by the order. \n // We favor the maker when the exchange rate must be rounded.\n matchedFillResults.left.makerAssetFilledAmount = safeGetPartialAmountFloor(\n leftOrder.makerAssetAmount,\n leftOrder.takerAssetAmount,\n matchedFillResults.left.takerAssetFilledAmount\n );\n } else {\n // Case 2: Left order is fully filled\n matchedFillResults.left.makerAssetFilledAmount = leftMakerAssetAmountRemaining;\n matchedFillResults.left.takerAssetFilledAmount = leftTakerAssetAmountRemaining;\n matchedFillResults.right.makerAssetFilledAmount = matchedFillResults.left.takerAssetFilledAmount;\n // Round up to ensure the maker's exchange rate does not exceed the price specified by the order.\n // We favor the maker when the exchange rate must be rounded.\n matchedFillResults.right.takerAssetFilledAmount = safeGetPartialAmountCeil(\n rightOrder.takerAssetAmount,\n rightOrder.makerAssetAmount,\n matchedFillResults.right.makerAssetFilledAmount\n );\n }\n\n // Calculate amount given to taker\n matchedFillResults.leftMakerAssetSpreadAmount = safeSub(\n matchedFillResults.left.makerAssetFilledAmount,\n matchedFillResults.right.takerAssetFilledAmount\n );\n\n // Compute fees for left order\n matchedFillResults.left.makerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.left.makerAssetFilledAmount,\n leftOrder.makerAssetAmount,\n leftOrder.makerFee\n );\n matchedFillResults.left.takerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.left.takerAssetFilledAmount,\n leftOrder.takerAssetAmount,\n leftOrder.takerFee\n );\n\n // Compute fees for right order\n matchedFillResults.right.makerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.right.makerAssetFilledAmount,\n rightOrder.makerAssetAmount,\n rightOrder.makerFee\n );\n matchedFillResults.right.takerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.right.takerAssetFilledAmount,\n rightOrder.takerAssetAmount,\n rightOrder.takerFee\n );\n\n // Return fill results\n return matchedFillResults;\n }\n\n /// @dev Settles matched order by transferring appropriate funds between order makers, taker, and fee recipient.\n /// @param leftOrder First matched order.\n /// @param rightOrder Second matched order.\n /// @param takerAddress Address that matched the orders. The taker receives the spread between orders as profit.\n /// @param matchedFillResults Struct holding amounts to transfer between makers, taker, and fee recipients.\n function settleMatchedOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n address takerAddress,\n LibFillResults.MatchedFillResults memory matchedFillResults\n )\n private\n {\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n // Order makers and taker\n dispatchTransferFrom(\n leftOrder.makerAssetData,\n leftOrder.makerAddress,\n rightOrder.makerAddress,\n matchedFillResults.right.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n rightOrder.makerAssetData,\n rightOrder.makerAddress,\n leftOrder.makerAddress,\n matchedFillResults.left.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n leftOrder.makerAssetData,\n leftOrder.makerAddress,\n takerAddress,\n matchedFillResults.leftMakerAssetSpreadAmount\n );\n\n // Maker fees\n dispatchTransferFrom(\n zrxAssetData,\n leftOrder.makerAddress,\n leftOrder.feeRecipientAddress,\n matchedFillResults.left.makerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n rightOrder.makerAddress,\n rightOrder.feeRecipientAddress,\n matchedFillResults.right.makerFeePaid\n );\n\n // Taker fees\n if (leftOrder.feeRecipientAddress == rightOrder.feeRecipientAddress) {\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n leftOrder.feeRecipientAddress,\n safeAdd(\n matchedFillResults.left.takerFeePaid,\n matchedFillResults.right.takerFeePaid\n )\n );\n } else {\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n leftOrder.feeRecipientAddress,\n matchedFillResults.left.takerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n rightOrder.feeRecipientAddress,\n matchedFillResults.right.takerFeePaid\n );\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinSignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./interfaces/IWallet.sol\";\nimport \"./interfaces/IValidator.sol\";\n\n\ncontract MixinSignatureValidator is\n ReentrancyGuard,\n MSignatureValidator,\n MTransactions\n{\n using LibBytes for bytes;\n \n // Mapping of hash => signer => signed\n mapping (bytes32 => mapping (address => bool)) public preSigned;\n\n // Mapping of signer => validator => approved\n mapping (address => mapping (address => bool)) public allowedValidators;\n\n /// @dev Approves a hash on-chain using any valid signature type.\n /// After presigning a hash, the preSign signature type will become valid for that hash and signer.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n function preSign(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external\n {\n if (signerAddress != msg.sender) {\n require(\n isValidSignature(\n hash,\n signerAddress,\n signature\n ),\n \"INVALID_SIGNATURE\"\n );\n }\n preSigned[hash][signerAddress] = true;\n }\n\n /// @dev Approves/unnapproves a Validator contract to verify signatures on signer's behalf.\n /// @param validatorAddress Address of Validator contract.\n /// @param approval Approval or disapproval of Validator contract.\n function setSignatureValidatorApproval(\n address validatorAddress,\n bool approval\n )\n external\n nonReentrant\n {\n address signerAddress = getCurrentContextAddress();\n allowedValidators[signerAddress][validatorAddress] = approval;\n emit SignatureValidatorApproval(\n signerAddress,\n validatorAddress,\n approval\n );\n }\n\n /// @dev Verifies that a hash has been signed by the given signer.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes memory signature\n )\n public\n view\n returns (bool isValid)\n {\n require(\n signature.length > 0,\n \"LENGTH_GREATER_THAN_0_REQUIRED\"\n );\n\n // Pop last byte off of signature byte array.\n uint8 signatureTypeRaw = uint8(signature.popLastByte());\n\n // Ensure signature is supported\n require(\n signatureTypeRaw < uint8(SignatureType.NSignatureTypes),\n \"SIGNATURE_UNSUPPORTED\"\n );\n\n SignatureType signatureType = SignatureType(signatureTypeRaw);\n\n // Variables are not scoped in Solidity.\n uint8 v;\n bytes32 r;\n bytes32 s;\n address recovered;\n\n // Always illegal signature.\n // This is always an implicit option since a signer can create a\n // signature array with invalid type or length. We may as well make\n // it an explicit option. This aids testing and analysis. It is\n // also the initialization value for the enum type.\n if (signatureType == SignatureType.Illegal) {\n revert(\"SIGNATURE_ILLEGAL\");\n\n // Always invalid signature.\n // Like Illegal, this is always implicitly available and therefore\n // offered explicitly. It can be implicitly created by providing\n // a correctly formatted but incorrect signature.\n } else if (signatureType == SignatureType.Invalid) {\n require(\n signature.length == 0,\n \"LENGTH_0_REQUIRED\"\n );\n isValid = false;\n return isValid;\n\n // Signature using EIP712\n } else if (signatureType == SignatureType.EIP712) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n hash,\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n\n // Signed using web3.eth_sign\n } else if (signatureType == SignatureType.EthSign) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n keccak256(abi.encodePacked(\n \"\\x19Ethereum Signed Message:\\n32\",\n hash\n )),\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n\n // Signature verified by wallet contract.\n // If used with an order, the maker of the order is the wallet contract.\n } else if (signatureType == SignatureType.Wallet) {\n isValid = isValidWalletSignature(\n hash,\n signerAddress,\n signature\n );\n return isValid;\n\n // Signature verified by validator contract.\n // If used with an order, the maker of the order can still be an EOA.\n // A signature using this type should be encoded as:\n // | Offset | Length | Contents |\n // | 0x00 | x | Signature to validate |\n // | 0x00 + x | 20 | Address of validator contract |\n // | 0x14 + x | 1 | Signature type is always \"\\x06\" |\n } else if (signatureType == SignatureType.Validator) {\n // Pop last 20 bytes off of signature byte array.\n address validatorAddress = signature.popLast20Bytes();\n \n // Ensure signer has approved validator.\n if (!allowedValidators[signerAddress][validatorAddress]) {\n return false;\n }\n isValid = isValidValidatorSignature(\n validatorAddress,\n hash,\n signerAddress,\n signature\n );\n return isValid;\n\n // Signer signed hash previously using the preSign function.\n } else if (signatureType == SignatureType.PreSigned) {\n isValid = preSigned[hash][signerAddress];\n return isValid;\n }\n\n // Anything else is illegal (We do not return false because\n // the signature may actually be valid, just not in a format\n // that we currently support. In this case returning false\n // may lead the caller to incorrectly believe that the\n // signature was invalid.)\n revert(\"SIGNATURE_UNSUPPORTED\");\n }\n\n /// @dev Verifies signature using logic defined by Wallet contract.\n /// @param hash Any 32 byte hash.\n /// @param walletAddress Address that should have signed the given hash\n /// and defines its own signature verification method.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if signature is valid for given wallet..\n function isValidWalletSignature(\n bytes32 hash,\n address walletAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid)\n {\n bytes memory calldata = abi.encodeWithSelector(\n IWallet(walletAddress).isValidSignature.selector,\n hash,\n signature\n );\n assembly {\n let cdStart := add(calldata, 32)\n let success := staticcall(\n gas, // forward all gas\n walletAddress, // address of Wallet contract\n cdStart, // pointer to start of input\n mload(calldata), // length of input\n cdStart, // write output over input\n 32 // output size is 32 bytes\n )\n\n switch success\n case 0 {\n // Revert with `Error(\"WALLET_ERROR\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000c57414c4c45545f4552524f5200000000000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n case 1 {\n // Signature is valid if call did not revert and returned true\n isValid := mload(cdStart)\n }\n }\n return isValid;\n }\n\n /// @dev Verifies signature using logic defined by Validator contract.\n /// @param validatorAddress Address of validator contract.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidValidatorSignature(\n address validatorAddress,\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid)\n {\n bytes memory calldata = abi.encodeWithSelector(\n IValidator(signerAddress).isValidSignature.selector,\n hash,\n signerAddress,\n signature\n );\n assembly {\n let cdStart := add(calldata, 32)\n let success := staticcall(\n gas, // forward all gas\n validatorAddress, // address of Validator contract\n cdStart, // pointer to start of input\n mload(calldata), // length of input\n cdStart, // write output over input\n 32 // output size is 32 bytes\n )\n\n switch success\n case 0 {\n // Revert with `Error(\"VALIDATOR_ERROR\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f56414c494441544f525f4552524f5200000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n case 1 {\n // Signature is valid if call did not revert and returned true\n isValid := mload(cdStart)\n }\n }\n return isValid;\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinTransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\nimport \"./libs/LibExchangeErrors.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./libs/LibEIP712.sol\";\n\n\ncontract MixinTransactions is\n LibEIP712,\n MSignatureValidator,\n MTransactions\n{\n // Mapping of transaction hash => executed\n // This prevents transactions from being executed more than once.\n mapping (bytes32 => bool) public transactions;\n\n // Address of current transaction signer\n address public currentContextAddress;\n\n /// @dev Executes an exchange method call in the context of signer.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @param signature Proof of signer transaction by signer.\n function executeTransaction(\n uint256 salt,\n address signerAddress,\n bytes data,\n bytes signature\n )\n external\n {\n // Prevent reentrancy\n require(\n currentContextAddress == address(0),\n \"REENTRANCY_ILLEGAL\"\n );\n\n bytes32 transactionHash = hashEIP712Message(hashZeroExTransaction(\n salt,\n signerAddress,\n data\n ));\n\n // Validate transaction has not been executed\n require(\n !transactions[transactionHash],\n \"INVALID_TX_HASH\"\n );\n\n // Transaction always valid if signer is sender of transaction\n if (signerAddress != msg.sender) {\n // Validate signature\n require(\n isValidSignature(\n transactionHash,\n signerAddress,\n signature\n ),\n \"INVALID_TX_SIGNATURE\"\n );\n\n // Set the current transaction signer\n currentContextAddress = signerAddress;\n }\n\n // Execute transaction\n transactions[transactionHash] = true;\n require(\n address(this).delegatecall(data),\n \"FAILED_EXECUTION\"\n );\n\n // Reset current transaction signer if it was previously updated\n if (signerAddress != msg.sender) {\n currentContextAddress = address(0);\n }\n }\n\n /// @dev Calculates EIP712 hash of the Transaction.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @return EIP712 hash of the Transaction.\n function hashZeroExTransaction(\n uint256 salt,\n address signerAddress,\n bytes memory data\n )\n internal\n pure\n returns (bytes32 result)\n {\n bytes32 schemaHash = EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH;\n bytes32 dataHash = keccak256(data);\n\n // Assembly for more efficiently computing:\n // keccak256(abi.encodePacked(\n // EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH,\n // salt,\n // bytes32(signerAddress),\n // keccak256(data)\n // ));\n\n assembly {\n // Load free memory pointer\n let memPtr := mload(64)\n\n mstore(memPtr, schemaHash) // hash of schema\n mstore(add(memPtr, 32), salt) // salt\n mstore(add(memPtr, 64), and(signerAddress, 0xffffffffffffffffffffffffffffffffffffffff)) // signerAddress\n mstore(add(memPtr, 96), dataHash) // hash of data\n\n // Compute hash\n result := keccak256(memPtr, 128)\n }\n return result;\n }\n\n /// @dev The current function will be called in the context of this address (either 0x transaction signer or `msg.sender`).\n /// If calling a fill function, this address will represent the taker.\n /// If calling a cancel function, this address will represent the maker.\n /// @return Signer of 0x transaction if entry point is `executeTransaction`.\n /// `msg.sender` if entry point is any other function.\n function getCurrentContextAddress()\n internal\n view\n returns (address)\n {\n address currentContextAddress_ = currentContextAddress;\n address contextAddress = currentContextAddress_ == address(0) ? msg.sender : currentContextAddress_;\n return contextAddress;\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./libs/LibAbiEncoder.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MWrapperFunctions.sol\";\n\n\ncontract MixinWrapperFunctions is\n ReentrancyGuard,\n LibMath,\n LibFillResults,\n LibAbiEncoder,\n MExchangeCore,\n MWrapperFunctions\n{\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n nonReentrant\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrKillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n return fillResults;\n }\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (FillResults memory fillResults)\n {\n // ABI encode calldata for `fillOrder`\n bytes memory fillOrderCalldata = abiEncodeFillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n\n // Delegate to `fillOrder` and handle any exceptions gracefully\n assembly {\n let success := delegatecall(\n gas, // forward all gas\n address, // call address of this contract\n add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes)\n mload(fillOrderCalldata), // length of input\n fillOrderCalldata, // write output over input\n 128 // output size is 128 bytes\n )\n if success {\n mstore(fillResults, mload(fillOrderCalldata))\n mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32)))\n mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64)))\n mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96)))\n }\n }\n // fillResults values will be 0 by default if call was unsuccessful\n return fillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrKill.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrKillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrKillOrderInternal(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrders(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n bytes memory takerAssetData = orders[0].takerAssetData;\n \n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being sold by taker is the same for each order.\n // Rather than passing this in as calldata, we use the takerAssetData from the first order in all later orders.\n orders[i].takerAssetData = takerAssetData;\n\n // Calculate the remaining amount of takerAsset to sell\n uint256 remainingTakerAssetFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= takerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory takerAssetData = orders[0].takerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being sold by taker is the same for each order.\n // Rather than passing this in as calldata, we use the takerAssetData from the first order in all later orders.\n orders[i].takerAssetData = takerAssetData;\n\n // Calculate the remaining amount of takerAsset to sell\n uint256 remainingTakerAssetFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= takerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerAsset is bought by taker.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrders(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // Rather than passing this in as calldata, we copy the makerAssetData from the first order onto all later orders.\n orders[i].makerAssetData = makerAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n if (totalFillResults.makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // Rather than passing this in as calldata, we copy the makerAssetData from the first order onto all later orders.\n orders[i].makerAssetData = makerAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n if (totalFillResults.makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously cancels multiple orders in a single transaction.\n /// @param orders Array of order specifications.\n function batchCancelOrders(LibOrder.Order[] memory orders)\n public\n nonReentrant\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n cancelOrderInternal(orders[i]);\n }\n }\n\n /// @dev Fetches information for all passed in orders.\n /// @param orders Array of order specifications.\n /// @return Array of OrderInfo instances that correspond to each order.\n function getOrdersInfo(LibOrder.Order[] memory orders)\n public\n view\n returns (LibOrder.OrderInfo[] memory)\n {\n uint256 ordersLength = orders.length;\n LibOrder.OrderInfo[] memory ordersInfo = new LibOrder.OrderInfo[](ordersLength);\n for (uint256 i = 0; i != ordersLength; i++) {\n ordersInfo[i] = getOrderInfo(orders[i]);\n }\n return ordersInfo;\n }\n\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n require(\n fillResults.takerAssetFilledAmount == takerAssetFillAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return fillResults;\n }\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IAssetProxyDispatcher {\n\n /// @dev Registers an asset proxy to its asset proxy id.\n /// Once an asset proxy is registered, it cannot be unregistered.\n /// @param assetProxy Address of new asset proxy to register.\n function registerAssetProxy(address assetProxy)\n external;\n\n /// @dev Gets an asset proxy.\n /// @param assetProxyId Id of the asset proxy.\n /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered.\n function getAssetProxy(bytes4 assetProxyId)\n external\n view\n returns (address);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IExchange.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./IExchangeCore.sol\";\nimport \"./IMatchOrders.sol\";\nimport \"./ISignatureValidator.sol\";\nimport \"./ITransactions.sol\";\nimport \"./IAssetProxyDispatcher.sol\";\nimport \"./IWrapperFunctions.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract IExchange is\n IExchangeCore,\n IMatchOrders,\n ISignatureValidator,\n ITransactions,\n IAssetProxyDispatcher,\n IWrapperFunctions\n{}\n",
- "2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IExchangeCore {\n\n /// @dev Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch\n /// and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress).\n /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled.\n function cancelOrdersUpTo(uint256 targetOrderEpoch)\n external;\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev After calling, the order can not be filled anymore.\n /// @param order Order struct containing order specifications.\n function cancelOrder(LibOrder.Order memory order)\n public;\n\n /// @dev Gets information about an order: status, hash, and amount filled.\n /// @param order Order to gather information on.\n /// @return OrderInfo Information about the order and its state.\n /// See LibOrder.OrderInfo for a complete description.\n function getOrderInfo(LibOrder.Order memory order)\n public\n view\n returns (LibOrder.OrderInfo memory orderInfo);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IMatchOrders {\n\n /// @dev Match two complementary orders that have a profitable spread.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the left order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftSignature Proof that order was created by the left maker.\n /// @param rightSignature Proof that order was created by the right maker.\n /// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.\n function matchOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n bytes memory leftSignature,\n bytes memory rightSignature\n )\n public\n returns (LibFillResults.MatchedFillResults memory matchedFillResults);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract ISignatureValidator {\n\n /// @dev Approves a hash on-chain using any valid signature type.\n /// After presigning a hash, the preSign signature type will become valid for that hash and signer.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n function preSign(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external;\n \n /// @dev Approves/unnapproves a Validator contract to verify signatures on signer's behalf.\n /// @param validatorAddress Address of Validator contract.\n /// @param approval Approval or disapproval of Validator contract.\n function setSignatureValidatorApproval(\n address validatorAddress,\n bool approval\n )\n external;\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signerAddress Address of signer.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes memory signature\n )\n public\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/ITransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\n\ncontract ITransactions {\n\n /// @dev Executes an exchange method call in the context of signer.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @param signature Proof of signer transaction by signer.\n function executeTransaction(\n uint256 salt,\n address signerAddress,\n bytes data,\n bytes signature\n )\n external;\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IValidator {\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IWallet.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IWallet {\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n bytes signature\n )\n external\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IWrapperFunctions {\n\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrKill.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrKillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrders(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerAsset is bought by taker.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrders(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously cancels multiple orders in a single transaction.\n /// @param orders Array of order specifications.\n function batchCancelOrders(LibOrder.Order[] memory orders)\n public;\n\n /// @dev Fetches information for all passed in orders\n /// @param orders Array of order specifications.\n /// @return Array of OrderInfo instances that correspond to each order.\n function getOrdersInfo(LibOrder.Order[] memory orders)\n public\n view\n returns (LibOrder.OrderInfo[] memory);\n}\n",
- "2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./LibOrder.sol\";\n\n\ncontract LibAbiEncoder {\n\n /// @dev ABI encodes calldata for `fillOrder`.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return ABI encoded calldata for `fillOrder`.\n function abiEncodeFillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n pure\n returns (bytes memory fillOrderCalldata)\n {\n // We need to call MExchangeCore.fillOrder using a delegatecall in\n // assembly so that we can intercept a call that throws. For this, we\n // need the input encoded in memory in the Ethereum ABIv2 format [1].\n\n // | Area | Offset | Length | Contents |\n // | -------- |--------|---------|-------------------------------------------- |\n // | Header | 0x00 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 0x00 | | 1. offset to order (*) |\n // | | 0x20 | | 2. takerAssetFillAmount |\n // | | 0x40 | | 3. offset to signature (*) |\n // | Data | | 12 * 32 | order: |\n // | | 0x000 | | 1. senderAddress |\n // | | 0x020 | | 2. makerAddress |\n // | | 0x040 | | 3. takerAddress |\n // | | 0x060 | | 4. feeRecipientAddress |\n // | | 0x080 | | 5. makerAssetAmount |\n // | | 0x0A0 | | 6. takerAssetAmount |\n // | | 0x0C0 | | 7. makerFeeAmount |\n // | | 0x0E0 | | 8. takerFeeAmount |\n // | | 0x100 | | 9. expirationTimeSeconds |\n // | | 0x120 | | 10. salt |\n // | | 0x140 | | 11. Offset to makerAssetData (*) |\n // | | 0x160 | | 12. Offset to takerAssetData (*) |\n // | | 0x180 | 32 | makerAssetData Length |\n // | | 0x1A0 | ** | makerAssetData Contents |\n // | | 0x1C0 | 32 | takerAssetData Length |\n // | | 0x1E0 | ** | takerAssetData Contents |\n // | | 0x200 | 32 | signature Length |\n // | | 0x220 | ** | signature Contents |\n\n // * Offsets are calculated from the beginning of the current area: Header, Params, Data:\n // An offset stored in the Params area is calculated from the beginning of the Params section.\n // An offset stored in the Data area is calculated from the beginning of the Data section.\n\n // ** The length of dynamic array contents are stored in the field immediately preceeding the contents.\n\n // [1]: https://solidity.readthedocs.io/en/develop/abi-spec.html\n\n assembly {\n\n // Areas below may use the following variables:\n // 1. <area>Start -- Start of this area in memory\n // 2. <area>End -- End of this area in memory. This value may\n // be precomputed (before writing contents),\n // or it may be computed as contents are written.\n // 3. <area>Offset -- Current offset into area. If an area's End\n // is precomputed, this variable tracks the\n // offsets of contents as they are written.\n\n /////// Setup Header Area ///////\n // Load free memory pointer\n fillOrderCalldata := mload(0x40)\n // bytes4(keccak256(\"fillOrder((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),uint256,bytes)\"))\n // = 0xb4be83d5\n // Leave 0x20 bytes to store the length\n mstore(add(fillOrderCalldata, 0x20), 0xb4be83d500000000000000000000000000000000000000000000000000000000)\n let headerAreaEnd := add(fillOrderCalldata, 0x24)\n\n /////// Setup Params Area ///////\n // This area is preallocated and written to later.\n // This is because we need to fill in offsets that have not yet been calculated.\n let paramsAreaStart := headerAreaEnd\n let paramsAreaEnd := add(paramsAreaStart, 0x60)\n let paramsAreaOffset := paramsAreaStart\n\n /////// Setup Data Area ///////\n let dataAreaStart := paramsAreaEnd\n let dataAreaEnd := dataAreaStart\n\n // Offset from the source data we're reading from\n let sourceOffset := order\n // arrayLenBytes and arrayLenWords track the length of a dynamically-allocated bytes array.\n let arrayLenBytes := 0\n let arrayLenWords := 0\n\n /////// Write order Struct ///////\n // Write memory location of Order, relative to the start of the\n // parameter list, then increment the paramsAreaOffset respectively.\n mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))\n paramsAreaOffset := add(paramsAreaOffset, 0x20)\n\n // Write values for each field in the order\n // It would be nice to use a loop, but we save on gas by writing\n // the stores sequentially.\n mstore(dataAreaEnd, mload(sourceOffset)) // makerAddress\n mstore(add(dataAreaEnd, 0x20), mload(add(sourceOffset, 0x20))) // takerAddress\n mstore(add(dataAreaEnd, 0x40), mload(add(sourceOffset, 0x40))) // feeRecipientAddress\n mstore(add(dataAreaEnd, 0x60), mload(add(sourceOffset, 0x60))) // senderAddress\n mstore(add(dataAreaEnd, 0x80), mload(add(sourceOffset, 0x80))) // makerAssetAmount\n mstore(add(dataAreaEnd, 0xA0), mload(add(sourceOffset, 0xA0))) // takerAssetAmount\n mstore(add(dataAreaEnd, 0xC0), mload(add(sourceOffset, 0xC0))) // makerFeeAmount\n mstore(add(dataAreaEnd, 0xE0), mload(add(sourceOffset, 0xE0))) // takerFeeAmount\n mstore(add(dataAreaEnd, 0x100), mload(add(sourceOffset, 0x100))) // expirationTimeSeconds\n mstore(add(dataAreaEnd, 0x120), mload(add(sourceOffset, 0x120))) // salt\n mstore(add(dataAreaEnd, 0x140), mload(add(sourceOffset, 0x140))) // Offset to makerAssetData\n mstore(add(dataAreaEnd, 0x160), mload(add(sourceOffset, 0x160))) // Offset to takerAssetData\n dataAreaEnd := add(dataAreaEnd, 0x180)\n sourceOffset := add(sourceOffset, 0x180)\n\n // Write offset to <order.makerAssetData>\n mstore(add(dataAreaStart, mul(10, 0x20)), sub(dataAreaEnd, dataAreaStart))\n\n // Calculate length of <order.makerAssetData>\n sourceOffset := mload(add(order, 0x140)) // makerAssetData\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of <order.makerAssetData>\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of <order.makerAssetData>\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n // Write offset to <order.takerAssetData>\n mstore(add(dataAreaStart, mul(11, 0x20)), sub(dataAreaEnd, dataAreaStart))\n\n // Calculate length of <order.takerAssetData>\n sourceOffset := mload(add(order, 0x160)) // takerAssetData\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of <order.takerAssetData>\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of <order.takerAssetData>\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n /////// Write takerAssetFillAmount ///////\n mstore(paramsAreaOffset, takerAssetFillAmount)\n paramsAreaOffset := add(paramsAreaOffset, 0x20)\n\n /////// Write signature ///////\n // Write offset to paramsArea\n mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))\n\n // Calculate length of signature\n sourceOffset := signature\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of signature\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of signature\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n // Set length of calldata\n mstore(fillOrderCalldata, sub(dataAreaEnd, add(fillOrderCalldata, 0x20)))\n\n // Increment free memory pointer\n mstore(0x40, dataAreaEnd)\n }\n\n return fillOrderCalldata;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibConstants.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\n// solhint-disable max-line-length\ncontract LibConstants {\n \n // Asset data for ZRX token. Used for fee transfers.\n // @TODO: Hardcode constant when we deploy. Currently \n // not constant to make testing easier.\n\n // The proxyId for ZRX_ASSET_DATA is bytes4(keccak256(\"ERC20Token(address)\")) = 0xf47261b0\n \n // Kovan ZRX address is 0x6ff6c0ff1d68b964901f986d4c9fa3ac68346570.\n // The ABI encoded proxyId and address is 0xf47261b00000000000000000000000006ff6c0ff1d68b964901f986d4c9fa3ac68346570\n // bytes constant public ZRX_ASSET_DATA = \"\\xf4\\x72\\x61\\xb0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x6f\\xf6\\xc0\\xff\\x1d\\x68\\xb9\\x64\\x90\\x1f\\x98\\x6d\\x4c\\x9f\\xa3\\xac\\x68\\x34\\x65\\x70\";\n \n // Mainnet ZRX address is 0xe41d2489571d322189246dafa5ebde1f4699f498.\n // The ABI encoded proxyId and address is 0xf47261b0000000000000000000000000e41d2489571d322189246dafa5ebde1f4699f498\n // bytes constant public ZRX_ASSET_DATA = \"\\xf4\\x72\\x61\\xb0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xe4\\x1d\\x24\\x89\\x57\\x1d\\x32\\x21\\x89\\x24\\x6d\\xaf\\xa5\\xeb\\xde\\x1f\\x46\\x99\\xf4\\x98\";\n \n // solhint-disable-next-line var-name-mixedcase\n bytes public ZRX_ASSET_DATA;\n\n // @TODO: Remove when we deploy.\n constructor (bytes memory zrxAssetData)\n public\n {\n ZRX_ASSET_DATA = zrxAssetData;\n }\n}\n// solhint-enable max-line-length\n",
- "2.0.0/protocol/Exchange/libs/LibEIP712.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract LibEIP712 {\n\n // EIP191 header for EIP712 prefix\n string constant internal EIP191_HEADER = \"\\x19\\x01\";\n\n // EIP712 Domain Name value\n string constant internal EIP712_DOMAIN_NAME = \"0x Protocol\";\n\n // EIP712 Domain Version value\n string constant internal EIP712_DOMAIN_VERSION = \"2\";\n\n // Hash of the EIP712 Domain Separator Schema\n bytes32 constant internal EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"EIP712Domain(\",\n \"string name,\",\n \"string version,\",\n \"address verifyingContract\",\n \")\"\n ));\n\n // Hash of the EIP712 Domain Separator data\n // solhint-disable-next-line var-name-mixedcase\n bytes32 public EIP712_DOMAIN_HASH;\n\n constructor ()\n public\n {\n EIP712_DOMAIN_HASH = keccak256(abi.encodePacked(\n EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH,\n keccak256(bytes(EIP712_DOMAIN_NAME)),\n keccak256(bytes(EIP712_DOMAIN_VERSION)),\n bytes32(address(this))\n ));\n }\n\n /// @dev Calculates EIP712 encoding for a hash struct in this EIP712 Domain.\n /// @param hashStruct The EIP712 hash struct.\n /// @return EIP712 hash applied to this EIP712 Domain.\n function hashEIP712Message(bytes32 hashStruct)\n internal\n view\n returns (bytes32 result)\n {\n bytes32 eip712DomainHash = EIP712_DOMAIN_HASH;\n\n // Assembly for more efficient computing:\n // keccak256(abi.encodePacked(\n // EIP191_HEADER,\n // EIP712_DOMAIN_HASH,\n // hashStruct \n // ));\n\n assembly {\n // Load free memory pointer\n let memPtr := mload(64)\n\n mstore(memPtr, 0x1901000000000000000000000000000000000000000000000000000000000000) // EIP191 header\n mstore(add(memPtr, 2), eip712DomainHash) // EIP712 domain hash\n mstore(add(memPtr, 34), hashStruct) // Hash of struct\n\n // Compute hash\n result := keccak256(memPtr, 66)\n }\n return result;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\n// solhint-disable\npragma solidity 0.4.24;\n\n\n/// @dev This contract documents the revert reasons used in the Exchange contract.\n/// This contract is intended to serve as a reference, but is not actually used for efficiency reasons.\ncontract LibExchangeErrors {\n\n /// Order validation errors ///\n string constant ORDER_UNFILLABLE = \"ORDER_UNFILLABLE\"; // Order cannot be filled.\n string constant INVALID_MAKER = \"INVALID_MAKER\"; // Invalid makerAddress.\n string constant INVALID_TAKER = \"INVALID_TAKER\"; // Invalid takerAddress.\n string constant INVALID_SENDER = \"INVALID_SENDER\"; // Invalid `msg.sender`.\n string constant INVALID_ORDER_SIGNATURE = \"INVALID_ORDER_SIGNATURE\"; // Signature validation failed. \n \n /// fillOrder validation errors ///\n string constant INVALID_TAKER_AMOUNT = \"INVALID_TAKER_AMOUNT\"; // takerAssetFillAmount cannot equal 0.\n string constant ROUNDING_ERROR = \"ROUNDING_ERROR\"; // Rounding error greater than 0.1% of takerAssetFillAmount. \n \n /// Signature validation errors ///\n string constant INVALID_SIGNATURE = \"INVALID_SIGNATURE\"; // Signature validation failed. \n string constant SIGNATURE_ILLEGAL = \"SIGNATURE_ILLEGAL\"; // Signature type is illegal.\n string constant SIGNATURE_UNSUPPORTED = \"SIGNATURE_UNSUPPORTED\"; // Signature type unsupported.\n \n /// cancelOrdersUptTo errors ///\n string constant INVALID_NEW_ORDER_EPOCH = \"INVALID_NEW_ORDER_EPOCH\"; // Specified salt must be greater than or equal to existing orderEpoch.\n\n /// fillOrKillOrder errors ///\n string constant COMPLETE_FILL_FAILED = \"COMPLETE_FILL_FAILED\"; // Desired takerAssetFillAmount could not be completely filled. \n\n /// matchOrders errors ///\n string constant NEGATIVE_SPREAD_REQUIRED = \"NEGATIVE_SPREAD_REQUIRED\"; // Matched orders must have a negative spread.\n\n /// Transaction errors ///\n string constant REENTRANCY_ILLEGAL = \"REENTRANCY_ILLEGAL\"; // Recursive reentrancy is not allowed. \n string constant INVALID_TX_HASH = \"INVALID_TX_HASH\"; // Transaction has already been executed. \n string constant INVALID_TX_SIGNATURE = \"INVALID_TX_SIGNATURE\"; // Signature validation failed. \n string constant FAILED_EXECUTION = \"FAILED_EXECUTION\"; // Transaction execution failed. \n \n /// registerAssetProxy errors ///\n string constant ASSET_PROXY_ALREADY_EXISTS = \"ASSET_PROXY_ALREADY_EXISTS\"; // AssetProxy with same id already exists.\n\n /// dispatchTransferFrom errors ///\n string constant ASSET_PROXY_DOES_NOT_EXIST = \"ASSET_PROXY_DOES_NOT_EXIST\"; // No assetProxy registered at given id.\n string constant TRANSFER_FAILED = \"TRANSFER_FAILED\"; // Asset transfer unsuccesful.\n\n /// Length validation errors ///\n string constant LENGTH_GREATER_THAN_0_REQUIRED = \"LENGTH_GREATER_THAN_0_REQUIRED\"; // Byte array must have a length greater than 0.\n string constant LENGTH_GREATER_THAN_3_REQUIRED = \"LENGTH_GREATER_THAN_3_REQUIRED\"; // Byte array must have a length greater than 3.\n string constant LENGTH_0_REQUIRED = \"LENGTH_0_REQUIRED\"; // Byte array must have a length of 0.\n string constant LENGTH_65_REQUIRED = \"LENGTH_65_REQUIRED\"; // Byte array must have a length of 65.\n}\n",
- "2.0.0/protocol/Exchange/libs/LibFillResults.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract LibFillResults is\n SafeMath\n{\n struct FillResults {\n uint256 makerAssetFilledAmount; // Total amount of makerAsset(s) filled.\n uint256 takerAssetFilledAmount; // Total amount of takerAsset(s) filled.\n uint256 makerFeePaid; // Total amount of ZRX paid by maker(s) to feeRecipient(s).\n uint256 takerFeePaid; // Total amount of ZRX paid by taker to feeRecipients(s).\n }\n\n struct MatchedFillResults {\n FillResults left; // Amounts filled and fees paid of left order.\n FillResults right; // Amounts filled and fees paid of right order.\n uint256 leftMakerAssetSpreadAmount; // Spread between price of left and right order, denominated in the left order's makerAsset, paid to taker.\n }\n\n /// @dev Adds properties of both FillResults instances.\n /// Modifies the first FillResults instance specified.\n /// @param totalFillResults Fill results instance that will be added onto.\n /// @param singleFillResults Fill results instance that will be added to totalFillResults.\n function addFillResults(FillResults memory totalFillResults, FillResults memory singleFillResults)\n internal\n pure\n {\n totalFillResults.makerAssetFilledAmount = safeAdd(totalFillResults.makerAssetFilledAmount, singleFillResults.makerAssetFilledAmount);\n totalFillResults.takerAssetFilledAmount = safeAdd(totalFillResults.takerAssetFilledAmount, singleFillResults.takerAssetFilledAmount);\n totalFillResults.makerFeePaid = safeAdd(totalFillResults.makerFeePaid, singleFillResults.makerFeePaid);\n totalFillResults.takerFeePaid = safeAdd(totalFillResults.takerFeePaid, singleFillResults.takerFeePaid);\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibMath.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract LibMath is\n SafeMath\n{\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// Reverts if rounding error is >= 0.1%\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded down.\n function safeGetPartialAmountFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n require(\n !isRoundingErrorFloor(\n numerator,\n denominator,\n target\n ),\n \"ROUNDING_ERROR\"\n );\n \n partialAmount = safeDiv(\n safeMul(numerator, target),\n denominator\n );\n return partialAmount;\n }\n\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// Reverts if rounding error is >= 0.1%\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded up.\n function safeGetPartialAmountCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n require(\n !isRoundingErrorCeil(\n numerator,\n denominator,\n target\n ),\n \"ROUNDING_ERROR\"\n );\n \n // safeDiv computes `floor(a / b)`. We use the identity (a, b integer):\n // ceil(a / b) = floor((a + b - 1) / b)\n // To implement `ceil(a / b)` using safeDiv.\n partialAmount = safeDiv(\n safeAdd(\n safeMul(numerator, target),\n safeSub(denominator, 1)\n ),\n denominator\n );\n return partialAmount;\n }\n\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded down.\n function getPartialAmountFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n partialAmount = safeDiv(\n safeMul(numerator, target),\n denominator\n );\n return partialAmount;\n }\n \n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded up.\n function getPartialAmountCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n // safeDiv computes `floor(a / b)`. We use the identity (a, b integer):\n // ceil(a / b) = floor((a + b - 1) / b)\n // To implement `ceil(a / b)` using safeDiv.\n partialAmount = safeDiv(\n safeAdd(\n safeMul(numerator, target),\n safeSub(denominator, 1)\n ),\n denominator\n );\n return partialAmount;\n }\n \n /// @dev Checks if rounding error >= 0.1% when rounding down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to multiply with numerator/denominator.\n /// @return Rounding error is present.\n function isRoundingErrorFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (bool isError)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n \n // The absolute rounding error is the difference between the rounded\n // value and the ideal value. The relative rounding error is the\n // absolute rounding error divided by the absolute value of the\n // ideal value. This is undefined when the ideal value is zero.\n //\n // The ideal value is `numerator * target / denominator`.\n // Let's call `numerator * target % denominator` the remainder.\n // The absolute error is `remainder / denominator`.\n //\n // When the ideal value is zero, we require the absolute error to\n // be zero. Fortunately, this is always the case. The ideal value is\n // zero iff `numerator == 0` and/or `target == 0`. In this case the\n // remainder and absolute error are also zero. \n if (target == 0 || numerator == 0) {\n return false;\n }\n \n // Otherwise, we want the relative rounding error to be strictly\n // less than 0.1%.\n // The relative error is `remainder / (numerator * target)`.\n // We want the relative error less than 1 / 1000:\n // remainder / (numerator * denominator) < 1 / 1000\n // or equivalently:\n // 1000 * remainder < numerator * target\n // so we have a rounding error iff:\n // 1000 * remainder >= numerator * target\n uint256 remainder = mulmod(\n target,\n numerator,\n denominator\n );\n isError = safeMul(1000, remainder) >= safeMul(numerator, target);\n return isError;\n }\n \n /// @dev Checks if rounding error >= 0.1% when rounding up.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to multiply with numerator/denominator.\n /// @return Rounding error is present.\n function isRoundingErrorCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (bool isError)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n \n // See the comments in `isRoundingError`.\n if (target == 0 || numerator == 0) {\n // When either is zero, the ideal value and rounded value are zero\n // and there is no rounding error. (Although the relative error\n // is undefined.)\n return false;\n }\n // Compute remainder as before\n uint256 remainder = mulmod(\n target,\n numerator,\n denominator\n );\n remainder = safeSub(denominator, remainder) % denominator;\n isError = safeMul(1000, remainder) >= safeMul(numerator, target);\n return isError;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibOrder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./LibEIP712.sol\";\n\n\ncontract LibOrder is\n LibEIP712\n{\n // Hash for the EIP712 Order Schema\n bytes32 constant internal EIP712_ORDER_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"Order(\",\n \"address makerAddress,\",\n \"address takerAddress,\",\n \"address feeRecipientAddress,\",\n \"address senderAddress,\",\n \"uint256 makerAssetAmount,\",\n \"uint256 takerAssetAmount,\",\n \"uint256 makerFee,\",\n \"uint256 takerFee,\",\n \"uint256 expirationTimeSeconds,\",\n \"uint256 salt,\",\n \"bytes makerAssetData,\",\n \"bytes takerAssetData\",\n \")\"\n ));\n\n // A valid order remains fillable until it is expired, fully filled, or cancelled.\n // An order's state is unaffected by external factors, like account balances.\n enum OrderStatus {\n INVALID, // Default value\n INVALID_MAKER_ASSET_AMOUNT, // Order does not have a valid maker asset amount\n INVALID_TAKER_ASSET_AMOUNT, // Order does not have a valid taker asset amount\n FILLABLE, // Order is fillable\n EXPIRED, // Order has already expired\n FULLY_FILLED, // Order is fully filled\n CANCELLED // Order has been cancelled\n }\n\n // solhint-disable max-line-length\n struct Order {\n address makerAddress; // Address that created the order. \n address takerAddress; // Address that is allowed to fill the order. If set to 0, any address is allowed to fill the order. \n address feeRecipientAddress; // Address that will recieve fees when order is filled. \n address senderAddress; // Address that is allowed to call Exchange contract methods that affect this order. If set to 0, any address is allowed to call these methods.\n uint256 makerAssetAmount; // Amount of makerAsset being offered by maker. Must be greater than 0. \n uint256 takerAssetAmount; // Amount of takerAsset being bid on by maker. Must be greater than 0. \n uint256 makerFee; // Amount of ZRX paid to feeRecipient by maker when order is filled. If set to 0, no transfer of ZRX from maker to feeRecipient will be attempted.\n uint256 takerFee; // Amount of ZRX paid to feeRecipient by taker when order is filled. If set to 0, no transfer of ZRX from taker to feeRecipient will be attempted.\n uint256 expirationTimeSeconds; // Timestamp in seconds at which order expires. \n uint256 salt; // Arbitrary number to facilitate uniqueness of the order's hash. \n bytes makerAssetData; // Encoded data that can be decoded by a specified proxy contract when transferring makerAsset. The last byte references the id of this proxy.\n bytes takerAssetData; // Encoded data that can be decoded by a specified proxy contract when transferring takerAsset. The last byte references the id of this proxy.\n }\n // solhint-enable max-line-length\n\n struct OrderInfo {\n uint8 orderStatus; // Status that describes order's validity and fillability.\n bytes32 orderHash; // EIP712 hash of the order (see LibOrder.getOrderHash).\n uint256 orderTakerAssetFilledAmount; // Amount of order that has already been filled.\n }\n\n /// @dev Calculates Keccak-256 hash of the order.\n /// @param order The order structure.\n /// @return Keccak-256 EIP712 hash of the order.\n function getOrderHash(Order memory order)\n internal\n view\n returns (bytes32 orderHash)\n {\n orderHash = hashEIP712Message(hashOrder(order));\n return orderHash;\n }\n\n /// @dev Calculates EIP712 hash of the order.\n /// @param order The order structure.\n /// @return EIP712 hash of the order.\n function hashOrder(Order memory order)\n internal\n pure\n returns (bytes32 result)\n {\n bytes32 schemaHash = EIP712_ORDER_SCHEMA_HASH;\n bytes32 makerAssetDataHash = keccak256(order.makerAssetData);\n bytes32 takerAssetDataHash = keccak256(order.takerAssetData);\n\n // Assembly for more efficiently computing:\n // keccak256(abi.encodePacked(\n // EIP712_ORDER_SCHEMA_HASH,\n // bytes32(order.makerAddress),\n // bytes32(order.takerAddress),\n // bytes32(order.feeRecipientAddress),\n // bytes32(order.senderAddress),\n // order.makerAssetAmount,\n // order.takerAssetAmount,\n // order.makerFee,\n // order.takerFee,\n // order.expirationTimeSeconds,\n // order.salt,\n // keccak256(order.makerAssetData),\n // keccak256(order.takerAssetData)\n // ));\n\n assembly {\n // Calculate memory addresses that will be swapped out before hashing\n let pos1 := sub(order, 32)\n let pos2 := add(order, 320)\n let pos3 := add(order, 352)\n\n // Backup\n let temp1 := mload(pos1)\n let temp2 := mload(pos2)\n let temp3 := mload(pos3)\n \n // Hash in place\n mstore(pos1, schemaHash)\n mstore(pos2, makerAssetDataHash)\n mstore(pos3, takerAssetDataHash)\n result := keccak256(pos1, 416)\n \n // Restore\n mstore(pos1, temp1)\n mstore(pos2, temp2)\n mstore(pos3, temp3)\n }\n return result;\n }\n}\n",
- "2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAssetProxyDispatcher.sol\";\n\n\ncontract MAssetProxyDispatcher is\n IAssetProxyDispatcher\n{\n // Logs registration of new asset proxy\n event AssetProxyRegistered(\n bytes4 id, // Id of new registered AssetProxy.\n address assetProxy // Address of new registered AssetProxy.\n );\n\n /// @dev Forwards arguments to assetProxy and calls `transferFrom`. Either succeeds or throws.\n /// @param assetData Byte array encoded for the asset.\n /// @param from Address to transfer token from.\n /// @param to Address to transfer token to.\n /// @param amount Amount of token to transfer.\n function dispatchTransferFrom(\n bytes memory assetData,\n address from,\n address to,\n uint256 amount\n )\n internal;\n}\n",
- "2.0.0/protocol/Exchange/mixins/MExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IExchangeCore.sol\";\n\n\ncontract MExchangeCore is\n IExchangeCore\n{\n // Fill event is emitted whenever an order is filled.\n event Fill(\n address indexed makerAddress, // Address that created the order. \n address indexed feeRecipientAddress, // Address that received fees.\n address takerAddress, // Address that filled the order.\n address senderAddress, // Address that called the Exchange contract (msg.sender).\n uint256 makerAssetFilledAmount, // Amount of makerAsset sold by maker and bought by taker. \n uint256 takerAssetFilledAmount, // Amount of takerAsset sold by taker and bought by maker.\n uint256 makerFeePaid, // Amount of ZRX paid to feeRecipient by maker.\n uint256 takerFeePaid, // Amount of ZRX paid to feeRecipient by taker.\n bytes32 indexed orderHash, // EIP712 hash of order (see LibOrder.getOrderHash).\n bytes makerAssetData, // Encoded data specific to makerAsset. \n bytes takerAssetData // Encoded data specific to takerAsset.\n );\n\n // Cancel event is emitted whenever an individual order is cancelled.\n event Cancel(\n address indexed makerAddress, // Address that created the order. \n address indexed feeRecipientAddress, // Address that would have recieved fees if order was filled. \n address senderAddress, // Address that called the Exchange contract (msg.sender).\n bytes32 indexed orderHash, // EIP712 hash of order (see LibOrder.getOrderHash).\n bytes makerAssetData, // Encoded data specific to makerAsset. \n bytes takerAssetData // Encoded data specific to takerAsset.\n );\n\n // CancelUpTo event is emitted whenever `cancelOrdersUpTo` is executed succesfully.\n event CancelUpTo(\n address indexed makerAddress, // Orders cancelled must have been created by this address.\n address indexed senderAddress, // Orders cancelled must have a `senderAddress` equal to this address.\n uint256 orderEpoch // Orders with specified makerAddress and senderAddress with a salt less than this value are considered cancelled.\n );\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev After calling, the order can not be filled anymore.\n /// @param order Order struct containing order specifications.\n function cancelOrderInternal(LibOrder.Order memory order)\n internal;\n\n /// @dev Updates state with results of a fill order.\n /// @param order that was filled.\n /// @param takerAddress Address of taker who filled the order.\n /// @param orderTakerAssetFilledAmount Amount of order already filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function updateFilledState(\n LibOrder.Order memory order,\n address takerAddress,\n bytes32 orderHash,\n uint256 orderTakerAssetFilledAmount,\n LibFillResults.FillResults memory fillResults\n )\n internal;\n\n /// @dev Updates state with results of cancelling an order.\n /// State is only updated if the order is currently fillable.\n /// Otherwise, updating state would have no effect.\n /// @param order that was cancelled.\n /// @param orderHash Hash of order that was cancelled.\n function updateCancelledState(\n LibOrder.Order memory order,\n bytes32 orderHash\n )\n internal;\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAddress Address of order taker.\n /// @param signature Proof that the orders was created by its maker.\n function assertFillableOrder(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo,\n address takerAddress,\n bytes memory signature\n )\n internal\n view;\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo Status, orderHash, and amount already filled of order.\n /// @param takerAssetFillAmount Desired amount of order to fill by taker.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @param makerAssetFilledAmount Amount of makerAsset that will be transfered.\n function assertValidFill(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo,\n uint256 takerAssetFillAmount,\n uint256 takerAssetFilledAmount,\n uint256 makerAssetFilledAmount\n )\n internal\n view;\n\n /// @dev Validates context for cancelOrder. Succeeds or throws.\n /// @param order to be cancelled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n function assertValidCancel(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo\n )\n internal\n view;\n\n /// @dev Calculates amounts filled and fees paid by maker and taker.\n /// @param order to be filled.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function calculateFillResults(\n LibOrder.Order memory order,\n uint256 takerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.FillResults memory fillResults);\n\n}\n",
- "2.0.0/protocol/Exchange/mixins/MMatchOrders.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IMatchOrders.sol\";\n\n\ncontract MMatchOrders is\n IMatchOrders\n{\n /// @dev Validates context for matchOrders. Succeeds or throws.\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n function assertValidMatch(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder\n )\n internal\n pure;\n\n /// @dev Calculates fill amounts for the matched orders.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the leftOrder order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftOrderTakerAssetFilledAmount Amount of left order already filled.\n /// @param rightOrderTakerAssetFilledAmount Amount of right order already filled.\n /// @param matchedFillResults Amounts to fill and fees to pay by maker and taker of matched orders.\n function calculateMatchedFillResults(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n uint256 leftOrderTakerAssetFilledAmount,\n uint256 rightOrderTakerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.MatchedFillResults memory matchedFillResults);\n\n}\n",
- "2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/ISignatureValidator.sol\";\n\n\ncontract MSignatureValidator is\n ISignatureValidator\n{\n event SignatureValidatorApproval(\n address indexed signerAddress, // Address that approves or disapproves a contract to verify signatures.\n address indexed validatorAddress, // Address of signature validator contract.\n bool approved // Approval or disapproval of validator contract.\n );\n\n // Allowed signature types.\n enum SignatureType {\n Illegal, // 0x00, default value\n Invalid, // 0x01\n EIP712, // 0x02\n EthSign, // 0x03\n Wallet, // 0x04\n Validator, // 0x05\n PreSigned, // 0x06\n NSignatureTypes // 0x07, number of signature types. Always leave at end.\n }\n\n /// @dev Verifies signature using logic defined by Wallet contract.\n /// @param hash Any 32 byte hash.\n /// @param walletAddress Address that should have signed the given hash\n /// and defines its own signature verification method.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidWalletSignature(\n bytes32 hash,\n address walletAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid);\n\n /// @dev Verifies signature using logic defined by Validator contract.\n /// @param validatorAddress Address of validator contract.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidValidatorSignature(\n address validatorAddress,\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/mixins/MTransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\nimport \"../interfaces/ITransactions.sol\";\n\n\ncontract MTransactions is\n ITransactions\n{\n // Hash for the EIP712 ZeroEx Transaction Schema\n bytes32 constant internal EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"ZeroExTransaction(\",\n \"uint256 salt,\",\n \"address signerAddress,\",\n \"bytes data\",\n \")\"\n ));\n\n /// @dev Calculates EIP712 hash of the Transaction.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @return EIP712 hash of the Transaction.\n function hashZeroExTransaction(\n uint256 salt,\n address signerAddress,\n bytes memory data\n )\n internal\n pure\n returns (bytes32 result);\n\n /// @dev The current function will be called in the context of this address (either 0x transaction signer or `msg.sender`).\n /// If calling a fill function, this address will represent the taker.\n /// If calling a cancel function, this address will represent the maker.\n /// @return Signer of 0x transaction if entry point is `executeTransaction`.\n /// `msg.sender` if entry point is any other function.\n function getCurrentContextAddress()\n internal\n view\n returns (address);\n}\n",
- "2.0.0/protocol/Exchange/mixins/MWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IWrapperFunctions.sol\";\n\n\ncontract MWrapperFunctions is \n IWrapperFunctions\n{\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n}\n",
- "2.0.0/test/DummyERC20Token/DummyERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"../../tokens/ERC20Token/MintableERC20Token.sol\";\n\n\ncontract DummyERC20Token is \n Ownable,\n MintableERC20Token\n{\n string public name;\n string public symbol;\n uint256 public decimals;\n uint256 public constant MAX_MINT_AMOUNT = 10000000000000000000000;\n\n constructor (\n string _name,\n string _symbol,\n uint256 _decimals,\n uint256 _totalSupply\n )\n public\n {\n name = _name;\n symbol = _symbol;\n decimals = _decimals;\n _totalSupply = _totalSupply;\n balances[msg.sender] = _totalSupply;\n }\n\n /// @dev Sets the balance of target address\n /// @param _target Address or which balance will be updated\n /// @param _value New balance of target address\n function setBalance(address _target, uint256 _value)\n external\n onlyOwner\n {\n uint256 currBalance = balances[_target];\n if (_value < currBalance) {\n _totalSupply = safeSub(_totalSupply, safeSub(currBalance, _value));\n } else {\n _totalSupply = safeAdd(_totalSupply, safeSub(_value, currBalance));\n }\n balances[_target] = _value;\n }\n\n /// @dev Mints new tokens for sender\n /// @param _value Amount of tokens to mint\n function mint(uint256 _value)\n external\n {\n require(\n _value <= MAX_MINT_AMOUNT,\n \"VALUE_TOO_LARGE\"\n );\n\n _mint(msg.sender, _value);\n }\n}\n",
- "2.0.0/test/DummyERC721Token/DummyERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../tokens/ERC721Token/MintableERC721Token.sol\";\nimport \"../../utils/Ownable/Ownable.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract DummyERC721Token is\n Ownable,\n MintableERC721Token\n{\n string public name;\n string public symbol;\n\n constructor (\n string _name,\n string _symbol\n )\n public\n {\n name = _name;\n symbol = _symbol;\n }\n\n /// @dev Function to mint a new token\n /// Reverts if the given token ID already exists\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _tokenId ID of the token to be minted by the msg.sender \n function mint(address _to, uint256 _tokenId)\n external\n {\n _mint(_to, _tokenId);\n }\n\n /// @dev Function to burn a token\n /// Reverts if the given token ID doesn't exist or not called by contract owner\n /// @param _owner Owner of token with given token ID\n /// @param _tokenId ID of the token to be burned by the msg.sender\n function burn(address _owner, uint256 _tokenId)\n external\n onlyOwner\n {\n _burn(_owner, _tokenId);\n }\n}\n",
- "2.0.0/tokens/ERC20Token/ERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IERC20Token.sol\";\n\n\ncontract ERC20Token is\n IERC20Token\n{\n mapping (address => uint256) internal balances;\n mapping (address => mapping (address => uint256)) internal allowed;\n\n uint256 internal _totalSupply;\n\n /// @dev send `value` token to `to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transfer(address _to, uint256 _value)\n external\n returns (bool)\n {\n require(\n balances[msg.sender] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[msg.sender] -= _value;\n balances[_to] += _value;\n\n emit Transfer(\n msg.sender,\n _to,\n _value\n );\n\n return true;\n }\n\n /// @dev send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool)\n {\n require(\n balances[_from] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n allowed[_from][msg.sender] >= _value,\n \"ERC20_INSUFFICIENT_ALLOWANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[_to] += _value;\n balances[_from] -= _value;\n allowed[_from][msg.sender] -= _value;\n \n emit Transfer(\n _from,\n _to,\n _value\n );\n \n return true;\n }\n\n /// @dev `msg.sender` approves `_spender` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Always true if the call has enough gas to complete execution\n function approve(address _spender, uint256 _value)\n external\n returns (bool)\n {\n allowed[msg.sender][_spender] = _value;\n emit Approval(\n msg.sender,\n _spender,\n _value\n );\n return true;\n }\n\n /// @dev Query total supply of token\n /// @return Total supply of token\n function totalSupply()\n external\n view\n returns (uint256)\n {\n return _totalSupply;\n }\n\n /// @dev Query the balance of owner\n /// @param _owner The address from which the balance will be retrieved\n /// @return Balance of owner\n function balanceOf(address _owner)\n external\n view\n returns (uint256)\n {\n return balances[_owner];\n }\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender)\n external\n view\n returns (uint256)\n {\n return allowed[_owner][_spender];\n }\n}\n",
- "2.0.0/tokens/ERC20Token/IERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC20Token {\n\n // solhint-disable no-simple-event-func-name\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 _value\n );\n\n event Approval(\n address indexed _owner,\n address indexed _spender,\n uint256 _value\n );\n\n /// @dev send `value` token to `to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transfer(address _to, uint256 _value)\n external\n returns (bool);\n\n /// @dev send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool);\n \n /// @dev `msg.sender` approves `_spender` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Always true if the call has enough gas to complete execution\n function approve(address _spender, uint256 _value)\n external\n returns (bool);\n\n /// @dev Query total supply of token\n /// @return Total supply of token\n function totalSupply()\n external\n view\n returns (uint256);\n \n /// @param _owner The address from which the balance will be retrieved\n /// @return Balance of owner\n function balanceOf(address _owner)\n external\n view\n returns (uint256);\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender)\n external\n view\n returns (uint256);\n}\n",
- "2.0.0/tokens/ERC20Token/MintableERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/SafeMath/SafeMath.sol\";\nimport \"./UnlimitedAllowanceERC20Token.sol\";\n\n\ncontract MintableERC20Token is \n SafeMath,\n UnlimitedAllowanceERC20Token\n{\n /// @dev Mints new tokens\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _value Amount of tokens to mint\n function _mint(address _to, uint256 _value)\n internal\n {\n balances[_to] = safeAdd(_value, balances[_to]);\n _totalSupply = safeAdd(_totalSupply, _value);\n\n emit Transfer(\n address(0),\n _to,\n _value\n );\n }\n\n /// @dev Mints new tokens\n /// @param _owner Owner of tokens that will be burned\n /// @param _value Amount of tokens to burn\n function _burn(address _owner, uint256 _value)\n internal\n {\n balances[_owner] = safeSub(balances[_owner], _value);\n _totalSupply = safeSub(_totalSupply, _value);\n\n emit Transfer(\n _owner,\n address(0),\n _value\n );\n }\n}\n",
- "2.0.0/tokens/ERC20Token/UnlimitedAllowanceERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../ERC20Token/ERC20Token.sol\";\n\n\ncontract UnlimitedAllowanceERC20Token is\n ERC20Token\n{\n uint256 constant internal MAX_UINT = 2**256 - 1;\n\n /// @dev ERC20 transferFrom, modified such that an allowance of MAX_UINT represents an unlimited allowance. See https://github.com/ethereum/EIPs/issues/717\n /// @param _from Address to transfer from.\n /// @param _to Address to transfer to.\n /// @param _value Amount to transfer.\n /// @return Success of transfer.\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool)\n {\n uint256 allowance = allowed[_from][msg.sender];\n require(\n balances[_from] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n allowance >= _value,\n \"ERC20_INSUFFICIENT_ALLOWANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[_to] += _value;\n balances[_from] -= _value;\n if (allowance < MAX_UINT) {\n allowed[_from][msg.sender] -= _value;\n }\n\n emit Transfer(\n _from,\n _to,\n _value\n );\n\n return true;\n }\n}\n",
- "2.0.0/tokens/ERC721Token/ERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IERC721Token.sol\";\nimport \"./IERC721Receiver.sol\";\nimport \"../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract ERC721Token is\n IERC721Token,\n SafeMath\n{\n // Function selector for ERC721Receiver.onERC721Received\n // 0x150b7a02\n bytes4 constant internal ERC721_RECEIVED = bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"));\n\n // Mapping of tokenId => owner\n mapping (uint256 => address) internal owners;\n\n // Mapping of tokenId => approved address\n mapping (uint256 => address) internal approvals;\n\n // Mapping of owner => number of tokens owned\n mapping (address => uint256) internal balances;\n\n // Mapping of owner => operator => approved\n mapping (address => mapping (address => bool)) internal operatorApprovals;\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT. When transfer is complete, this function\n /// checks if `_to` is a smart contract (code size > 0). If so, it calls\n /// `onERC721Received` on `_to` and throws if the return value is not\n /// `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n /// @param _data Additional data with no specified format, sent in call to `_to`\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId,\n bytes _data\n )\n external\n {\n transferFrom(\n _from,\n _to,\n _tokenId\n );\n\n uint256 receiverCodeSize;\n assembly {\n receiverCodeSize := extcodesize(_to)\n }\n if (receiverCodeSize > 0) {\n bytes4 selector = IERC721Receiver(_to).onERC721Received(\n msg.sender,\n _from,\n _tokenId,\n _data\n );\n require(\n selector == ERC721_RECEIVED,\n \"ERC721_INVALID_SELECTOR\"\n );\n }\n }\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev This works identically to the other function with an extra data parameter,\n /// except this function just sets data to \"\".\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n external\n {\n transferFrom(\n _from,\n _to,\n _tokenId\n );\n\n uint256 receiverCodeSize;\n assembly {\n receiverCodeSize := extcodesize(_to)\n }\n if (receiverCodeSize > 0) {\n bytes4 selector = IERC721Receiver(_to).onERC721Received(\n msg.sender,\n _from,\n _tokenId,\n \"\"\n );\n require(\n selector == ERC721_RECEIVED,\n \"ERC721_INVALID_SELECTOR\"\n );\n }\n }\n\n /// @notice Change or reaffirm the approved address for an NFT\n /// @dev The zero address indicates there is no approved address.\n /// Throws unless `msg.sender` is the current NFT owner, or an authorized\n /// operator of the current owner.\n /// @param _approved The new approved NFT controller\n /// @param _tokenId The NFT to approve\n function approve(address _approved, uint256 _tokenId)\n external\n {\n address owner = ownerOf(_tokenId);\n require(\n msg.sender == owner || isApprovedForAll(owner, msg.sender),\n \"ERC721_INVALID_SENDER\"\n );\n\n approvals[_tokenId] = _approved;\n emit Approval(\n owner,\n _approved,\n _tokenId\n );\n }\n\n /// @notice Enable or disable approval for a third party (\"operator\") to manage\n /// all of `msg.sender`'s assets\n /// @dev Emits the ApprovalForAll event. The contract MUST allow\n /// multiple operators per owner.\n /// @param _operator Address to add to the set of authorized operators\n /// @param _approved True if the operator is approved, false to revoke approval\n function setApprovalForAll(address _operator, bool _approved)\n external\n {\n operatorApprovals[msg.sender][_operator] = _approved;\n emit ApprovalForAll(\n msg.sender,\n _operator,\n _approved\n );\n }\n \n /// @notice Count all NFTs assigned to an owner\n /// @dev NFTs assigned to the zero address are considered invalid, and this\n /// function throws for queries about the zero address.\n /// @param _owner An address for whom to query the balance\n /// @return The number of NFTs owned by `_owner`, possibly zero\n function balanceOf(address _owner)\n external\n view\n returns (uint256)\n {\n require(\n _owner != address(0),\n \"ERC721_ZERO_OWNER\"\n );\n return balances[_owner];\n }\n\n /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE\n /// TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE\n /// THEY MAY BE PERMANENTLY LOST\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function transferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n public\n {\n require(\n _to != address(0),\n \"ERC721_ZERO_TO_ADDRESS\"\n );\n\n address owner = ownerOf(_tokenId);\n require(\n _from == owner,\n \"ERC721_OWNER_MISMATCH\"\n );\n\n address spender = msg.sender;\n address approvedAddress = getApproved(_tokenId);\n require(\n spender == owner ||\n isApprovedForAll(owner, spender) ||\n approvedAddress == spender,\n \"ERC721_INVALID_SPENDER\"\n );\n\n if (approvedAddress != address(0)) {\n approvals[_tokenId] = address(0);\n }\n\n owners[_tokenId] = _to;\n balances[_from] = safeSub(balances[_from], 1);\n balances[_to] = safeAdd(balances[_to], 1);\n \n emit Transfer(\n _from,\n _to,\n _tokenId\n );\n }\n\n /// @notice Find the owner of an NFT\n /// @dev NFTs assigned to zero address are considered invalid, and queries\n /// about them do throw.\n /// @param _tokenId The identifier for an NFT\n /// @return The address of the owner of the NFT\n function ownerOf(uint256 _tokenId)\n public\n view\n returns (address)\n {\n address owner = owners[_tokenId];\n require(\n owner != address(0),\n \"ERC721_ZERO_OWNER\"\n );\n return owner;\n }\n\n /// @notice Get the approved address for a single NFT\n /// @dev Throws if `_tokenId` is not a valid NFT.\n /// @param _tokenId The NFT to find the approved address for\n /// @return The approved address for this NFT, or the zero address if there is none\n function getApproved(uint256 _tokenId)\n public\n view\n returns (address)\n {\n return approvals[_tokenId];\n }\n\n /// @notice Query if an address is an authorized operator for another address\n /// @param _owner The address that owns the NFTs\n /// @param _operator The address that acts on behalf of the owner\n /// @return True if `_operator` is an approved operator for `_owner`, false otherwise\n function isApprovedForAll(address _owner, address _operator)\n public\n view\n returns (bool)\n {\n return operatorApprovals[_owner][_operator];\n }\n}\n",
- "2.0.0/tokens/ERC721Token/IERC721Receiver.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC721Receiver {\n\n /// @notice Handle the receipt of an NFT\n /// @dev The ERC721 smart contract calls this function on the recipient\n /// after a `transfer`. This function MAY throw to revert and reject the\n /// transfer. Return of other than the magic value MUST result in the\n /// transaction being reverted.\n /// Note: the contract address is always the message sender.\n /// @param _operator The address which called `safeTransferFrom` function\n /// @param _from The address which previously owned the token\n /// @param _tokenId The NFT identifier which is being transferred\n /// @param _data Additional data with no specified format\n /// @return `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`\n /// unless throwing\n function onERC721Received(\n address _operator,\n address _from,\n uint256 _tokenId,\n bytes _data\n )\n external\n returns (bytes4);\n}\n",
- "2.0.0/tokens/ERC721Token/IERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC721Token {\n\n /// @dev This emits when ownership of any NFT changes by any mechanism.\n /// This event emits when NFTs are created (`from` == 0) and destroyed\n /// (`to` == 0). Exception: during contract creation, any number of NFTs\n /// may be created and assigned without emitting Transfer. At the time of\n /// any transfer, the approved address for that NFT (if any) is reset to none.\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 indexed _tokenId\n );\n\n /// @dev This emits when the approved address for an NFT is changed or\n /// reaffirmed. The zero address indicates there is no approved address.\n /// When a Transfer event emits, this also indicates that the approved\n /// address for that NFT (if any) is reset to none.\n event Approval(\n address indexed _owner,\n address indexed _approved,\n uint256 indexed _tokenId\n );\n\n /// @dev This emits when an operator is enabled or disabled for an owner.\n /// The operator can manage all NFTs of the owner.\n event ApprovalForAll(\n address indexed _owner,\n address indexed _operator,\n bool _approved\n );\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// perator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT. When transfer is complete, this function\n /// checks if `_to` is a smart contract (code size > 0). If so, it calls\n /// `onERC721Received` on `_to` and throws if the return value is not\n /// `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n /// @param _data Additional data with no specified format, sent in call to `_to`\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId,\n bytes _data\n )\n external;\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev This works identically to the other function with an extra data parameter,\n /// except this function just sets data to \"\".\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n external;\n\n /// @notice Change or reaffirm the approved address for an NFT\n /// @dev The zero address indicates there is no approved address.\n /// Throws unless `msg.sender` is the current NFT owner, or an authorized\n /// operator of the current owner.\n /// @param _approved The new approved NFT controller\n /// @param _tokenId The NFT to approve\n function approve(address _approved, uint256 _tokenId)\n external;\n\n /// @notice Enable or disable approval for a third party (\"operator\") to manage\n /// all of `msg.sender`'s assets\n /// @dev Emits the ApprovalForAll event. The contract MUST allow\n /// multiple operators per owner.\n /// @param _operator Address to add to the set of authorized operators\n /// @param _approved True if the operator is approved, false to revoke approval\n function setApprovalForAll(address _operator, bool _approved)\n external;\n\n /// @notice Count all NFTs assigned to an owner\n /// @dev NFTs assigned to the zero address are considered invalid, and this\n /// function throws for queries about the zero address.\n /// @param _owner An address for whom to query the balance\n /// @return The number of NFTs owned by `_owner`, possibly zero\n function balanceOf(address _owner)\n external\n view\n returns (uint256);\n\n /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE\n /// TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE\n /// THEY MAY BE PERMANENTLY LOST\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function transferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n public;\n\n /// @notice Find the owner of an NFT\n /// @dev NFTs assigned to zero address are considered invalid, and queries\n /// about them do throw.\n /// @param _tokenId The identifier for an NFT\n /// @return The address of the owner of the NFT\n function ownerOf(uint256 _tokenId)\n public\n view\n returns (address);\n\n /// @notice Get the approved address for a single NFT\n /// @dev Throws if `_tokenId` is not a valid NFT.\n /// @param _tokenId The NFT to find the approved address for\n /// @return The approved address for this NFT, or the zero address if there is none\n function getApproved(uint256 _tokenId) \n public\n view\n returns (address);\n \n /// @notice Query if an address is an authorized operator for another address\n /// @param _owner The address that owns the NFTs\n /// @param _operator The address that acts on behalf of the owner\n /// @return True if `_operator` is an approved operator for `_owner`, false otherwise\n function isApprovedForAll(address _owner, address _operator)\n public\n view\n returns (bool);\n}\n",
- "2.0.0/tokens/ERC721Token/MintableERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./ERC721Token.sol\";\n\n\ncontract MintableERC721Token is\n ERC721Token\n{\n /// @dev Function to mint a new token\n /// Reverts if the given token ID already exists\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _tokenId ID of the token to be minted by the msg.sender \n function _mint(address _to, uint256 _tokenId)\n internal\n {\n require(\n _to != address(0),\n \"ERC721_ZERO_TO_ADDRESS\"\n );\n\n address owner = owners[_tokenId];\n require(\n owner == address(0),\n \"ERC721_OWNER_ALREADY_EXISTS\"\n );\n\n owners[_tokenId] = _to;\n balances[_to] = safeAdd(balances[_to], 1);\n\n emit Transfer(\n address(0),\n _to,\n _tokenId\n );\n }\n\n /// @dev Function to burn a token\n /// Reverts if the given token ID doesn't exist\n /// @param _owner Owner of token with given token ID\n /// @param _tokenId ID of the token to be burned by the msg.sender\n function _burn(address _owner, uint256 _tokenId)\n internal\n {\n require(\n _owner != address(0),\n \"ERC721_ZERO_OWNER_ADDRESS\"\n );\n\n address owner = owners[_tokenId];\n require(\n owner == _owner,\n \"ERC721_OWNER_MISMATCH\"\n );\n\n owners[_tokenId] = address(0);\n balances[_owner] = safeSub(balances[_owner], 1);\n\n emit Transfer(\n _owner,\n address(0),\n _tokenId\n );\n }\n}\n",
- "2.0.0/tokens/EtherToken/IEtherToken.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../ERC20Token/IERC20Token.sol\";\n\n\ncontract IEtherToken is\n IERC20Token\n{\n function deposit()\n public\n payable;\n \n function withdraw(uint256 amount)\n public;\n}\n",
- "2.0.0/utils/LibBytes/LibBytes.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\nlibrary LibBytes {\n\n using LibBytes for bytes;\n\n /// @dev Gets the memory address for a byte array.\n /// @param input Byte array to lookup.\n /// @return memoryAddress Memory address of byte array. This\n /// points to the header of the byte array which contains\n /// the length.\n function rawAddress(bytes memory input)\n internal\n pure\n returns (uint256 memoryAddress)\n {\n assembly {\n memoryAddress := input\n }\n return memoryAddress;\n }\n \n /// @dev Gets the memory address for the contents of a byte array.\n /// @param input Byte array to lookup.\n /// @return memoryAddress Memory address of the contents of the byte array.\n function contentAddress(bytes memory input)\n internal\n pure\n returns (uint256 memoryAddress)\n {\n assembly {\n memoryAddress := add(input, 32)\n }\n return memoryAddress;\n }\n\n /// @dev Copies `length` bytes from memory location `source` to `dest`.\n /// @param dest memory address to copy bytes to.\n /// @param source memory address to copy bytes from.\n /// @param length number of bytes to copy.\n function memCopy(\n uint256 dest,\n uint256 source,\n uint256 length\n )\n internal\n pure\n {\n if (length < 32) {\n // Handle a partial word by reading destination and masking\n // off the bits we are interested in.\n // This correctly handles overlap, zero lengths and source == dest\n assembly {\n let mask := sub(exp(256, sub(32, length)), 1)\n let s := and(mload(source), not(mask))\n let d := and(mload(dest), mask)\n mstore(dest, or(s, d))\n }\n } else {\n // Skip the O(length) loop when source == dest.\n if (source == dest) {\n return;\n }\n\n // For large copies we copy whole words at a time. The final\n // word is aligned to the end of the range (instead of after the\n // previous) to handle partial words. So a copy will look like this:\n //\n // ####\n // ####\n // ####\n // ####\n //\n // We handle overlap in the source and destination range by\n // changing the copying direction. This prevents us from\n // overwriting parts of source that we still need to copy.\n //\n // This correctly handles source == dest\n //\n if (source > dest) {\n assembly {\n // We subtract 32 from `sEnd` and `dEnd` because it\n // is easier to compare with in the loop, and these\n // are also the addresses we need for copying the\n // last bytes.\n length := sub(length, 32)\n let sEnd := add(source, length)\n let dEnd := add(dest, length)\n\n // Remember the last 32 bytes of source\n // This needs to be done here and not after the loop\n // because we may have overwritten the last bytes in\n // source already due to overlap.\n let last := mload(sEnd)\n\n // Copy whole words front to back\n // Note: the first check is always true,\n // this could have been a do-while loop.\n // solhint-disable-next-line no-empty-blocks\n for {} lt(source, sEnd) {} {\n mstore(dest, mload(source))\n source := add(source, 32)\n dest := add(dest, 32)\n }\n \n // Write the last 32 bytes\n mstore(dEnd, last)\n }\n } else {\n assembly {\n // We subtract 32 from `sEnd` and `dEnd` because those\n // are the starting points when copying a word at the end.\n length := sub(length, 32)\n let sEnd := add(source, length)\n let dEnd := add(dest, length)\n\n // Remember the first 32 bytes of source\n // This needs to be done here and not after the loop\n // because we may have overwritten the first bytes in\n // source already due to overlap.\n let first := mload(source)\n\n // Copy whole words back to front\n // We use a signed comparisson here to allow dEnd to become\n // negative (happens when source and dest < 32). Valid\n // addresses in local memory will never be larger than\n // 2**255, so they can be safely re-interpreted as signed.\n // Note: the first check is always true,\n // this could have been a do-while loop.\n // solhint-disable-next-line no-empty-blocks\n for {} slt(dest, dEnd) {} {\n mstore(dEnd, mload(sEnd))\n sEnd := sub(sEnd, 32)\n dEnd := sub(dEnd, 32)\n }\n \n // Write the first 32 bytes\n mstore(dest, first)\n }\n }\n }\n }\n\n /// @dev Returns a slices from a byte array.\n /// @param b The byte array to take a slice from.\n /// @param from The starting index for the slice (inclusive).\n /// @param to The final index for the slice (exclusive).\n /// @return result The slice containing bytes at indices [from, to)\n function slice(\n bytes memory b,\n uint256 from,\n uint256 to\n )\n internal\n pure\n returns (bytes memory result)\n {\n require(\n from <= to,\n \"FROM_LESS_THAN_TO_REQUIRED\"\n );\n require(\n to < b.length,\n \"TO_LESS_THAN_LENGTH_REQUIRED\"\n );\n \n // Create a new bytes structure and copy contents\n result = new bytes(to - from);\n memCopy(\n result.contentAddress(),\n b.contentAddress() + from,\n result.length\n );\n return result;\n }\n \n /// @dev Returns a slice from a byte array without preserving the input.\n /// @param b The byte array to take a slice from. Will be destroyed in the process.\n /// @param from The starting index for the slice (inclusive).\n /// @param to The final index for the slice (exclusive).\n /// @return result The slice containing bytes at indices [from, to)\n /// @dev When `from == 0`, the original array will match the slice. In other cases its state will be corrupted.\n function sliceDestructive(\n bytes memory b,\n uint256 from,\n uint256 to\n )\n internal\n pure\n returns (bytes memory result)\n {\n require(\n from <= to,\n \"FROM_LESS_THAN_TO_REQUIRED\"\n );\n require(\n to < b.length,\n \"TO_LESS_THAN_LENGTH_REQUIRED\"\n );\n \n // Create a new bytes structure around [from, to) in-place.\n assembly {\n result := add(b, from)\n mstore(result, sub(to, from))\n }\n return result;\n }\n\n /// @dev Pops the last byte off of a byte array by modifying its length.\n /// @param b Byte array that will be modified.\n /// @return The byte that was popped off.\n function popLastByte(bytes memory b)\n internal\n pure\n returns (bytes1 result)\n {\n require(\n b.length > 0,\n \"GREATER_THAN_ZERO_LENGTH_REQUIRED\"\n );\n\n // Store last byte.\n result = b[b.length - 1];\n\n assembly {\n // Decrement length of byte array.\n let newLen := sub(mload(b), 1)\n mstore(b, newLen)\n }\n return result;\n }\n\n /// @dev Pops the last 20 bytes off of a byte array by modifying its length.\n /// @param b Byte array that will be modified.\n /// @return The 20 byte address that was popped off.\n function popLast20Bytes(bytes memory b)\n internal\n pure\n returns (address result)\n {\n require(\n b.length >= 20,\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Store last 20 bytes.\n result = readAddress(b, b.length - 20);\n\n assembly {\n // Subtract 20 from byte array length.\n let newLen := sub(mload(b), 20)\n mstore(b, newLen)\n }\n return result;\n }\n\n /// @dev Tests equality of two byte arrays.\n /// @param lhs First byte array to compare.\n /// @param rhs Second byte array to compare.\n /// @return True if arrays are the same. False otherwise.\n function equals(\n bytes memory lhs,\n bytes memory rhs\n )\n internal\n pure\n returns (bool equal)\n {\n // Keccak gas cost is 30 + numWords * 6. This is a cheap way to compare.\n // We early exit on unequal lengths, but keccak would also correctly\n // handle this.\n return lhs.length == rhs.length && keccak256(lhs) == keccak256(rhs);\n }\n\n /// @dev Reads an address from a position in a byte array.\n /// @param b Byte array containing an address.\n /// @param index Index in byte array of address.\n /// @return address from byte array.\n function readAddress(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (address result)\n {\n require(\n b.length >= index + 20, // 20 is length of address\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Add offset to index:\n // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)\n // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)\n index += 20;\n\n // Read address from array memory\n assembly {\n // 1. Add index to address of bytes array\n // 2. Load 32-byte word from memory\n // 3. Apply 20-byte mask to obtain address\n result := and(mload(add(b, index)), 0xffffffffffffffffffffffffffffffffffffffff)\n }\n return result;\n }\n\n /// @dev Writes an address into a specific position in a byte array.\n /// @param b Byte array to insert address into.\n /// @param index Index in byte array of address.\n /// @param input Address to put into byte array.\n function writeAddress(\n bytes memory b,\n uint256 index,\n address input\n )\n internal\n pure\n {\n require(\n b.length >= index + 20, // 20 is length of address\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Add offset to index:\n // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)\n // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)\n index += 20;\n\n // Store address into array memory\n assembly {\n // The address occupies 20 bytes and mstore stores 32 bytes.\n // First fetch the 32-byte word where we'll be storing the address, then\n // apply a mask so we have only the bytes in the word that the address will not occupy.\n // Then combine these bytes with the address and store the 32 bytes back to memory with mstore.\n\n // 1. Add index to address of bytes array\n // 2. Load 32-byte word from memory\n // 3. Apply 12-byte mask to obtain extra bytes occupying word of memory where we'll store the address\n let neighbors := and(\n mload(add(b, index)),\n 0xffffffffffffffffffffffff0000000000000000000000000000000000000000\n )\n \n // Make sure input address is clean.\n // (Solidity does not guarantee this)\n input := and(input, 0xffffffffffffffffffffffffffffffffffffffff)\n\n // Store the neighbors and address into memory\n mstore(add(b, index), xor(input, neighbors))\n }\n }\n\n /// @dev Reads a bytes32 value from a position in a byte array.\n /// @param b Byte array containing a bytes32 value.\n /// @param index Index in byte array of bytes32 value.\n /// @return bytes32 value from byte array.\n function readBytes32(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes32 result)\n {\n require(\n b.length >= index + 32,\n \"GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 256 bit length parameter\n index += 32;\n\n // Read the bytes32 from array memory\n assembly {\n result := mload(add(b, index))\n }\n return result;\n }\n\n /// @dev Writes a bytes32 into a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input bytes32 to put into byte array.\n function writeBytes32(\n bytes memory b,\n uint256 index,\n bytes32 input\n )\n internal\n pure\n {\n require(\n b.length >= index + 32,\n \"GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 256 bit length parameter\n index += 32;\n\n // Read the bytes32 from array memory\n assembly {\n mstore(add(b, index), input)\n }\n }\n\n /// @dev Reads a uint256 value from a position in a byte array.\n /// @param b Byte array containing a uint256 value.\n /// @param index Index in byte array of uint256 value.\n /// @return uint256 value from byte array.\n function readUint256(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (uint256 result)\n {\n result = uint256(readBytes32(b, index));\n return result;\n }\n\n /// @dev Writes a uint256 into a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input uint256 to put into byte array.\n function writeUint256(\n bytes memory b,\n uint256 index,\n uint256 input\n )\n internal\n pure\n {\n writeBytes32(b, index, bytes32(input));\n }\n\n /// @dev Reads an unpadded bytes4 value from a position in a byte array.\n /// @param b Byte array containing a bytes4 value.\n /// @param index Index in byte array of bytes4 value.\n /// @return bytes4 value from byte array.\n function readBytes4(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes4 result)\n {\n require(\n b.length >= index + 4,\n \"GREATER_OR_EQUAL_TO_4_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 32 byte length field\n index += 32;\n\n // Read the bytes4 from array memory\n assembly {\n result := mload(add(b, index))\n // Solidity does not require us to clean the trailing bytes.\n // We do it anyway\n result := and(result, 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000)\n }\n return result;\n }\n\n /// @dev Reads nested bytes from a specific position.\n /// @dev NOTE: the returned value overlaps with the input value.\n /// Both should be treated as immutable.\n /// @param b Byte array containing nested bytes.\n /// @param index Index of nested bytes.\n /// @return result Nested bytes.\n function readBytesWithLength(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes memory result)\n {\n // Read length of nested bytes\n uint256 nestedBytesLength = readUint256(b, index);\n index += 32;\n\n // Assert length of <b> is valid, given\n // length of nested bytes\n require(\n b.length >= index + nestedBytesLength,\n \"GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED\"\n );\n \n // Return a pointer to the byte array as it exists inside `b`\n assembly {\n result := add(b, index)\n }\n return result;\n }\n\n /// @dev Inserts bytes at a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input bytes to insert.\n function writeBytesWithLength(\n bytes memory b,\n uint256 index,\n bytes memory input\n )\n internal\n pure\n {\n // Assert length of <b> is valid, given\n // length of input\n require(\n b.length >= index + 32 + input.length, // 32 bytes to store length\n \"GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED\"\n );\n\n // Copy <input> into <b>\n memCopy(\n b.contentAddress() + index,\n input.rawAddress(), // includes length of <input>\n input.length + 32 // +32 bytes to store <input> length\n );\n }\n\n /// @dev Performs a deep copy of a byte array onto another byte array of greater than or equal length.\n /// @param dest Byte array that will be overwritten with source bytes.\n /// @param source Byte array to copy onto dest bytes.\n function deepCopyBytes(\n bytes memory dest,\n bytes memory source\n )\n internal\n pure\n {\n uint256 sourceLen = source.length;\n // Dest length must be >= source length, or some bytes would not be copied.\n require(\n dest.length >= sourceLen,\n \"GREATER_OR_EQUAL_TO_SOURCE_BYTES_LENGTH_REQUIRED\"\n );\n memCopy(\n dest.contentAddress(),\n source.contentAddress(),\n sourceLen\n );\n }\n}\n",
- "2.0.0/utils/Ownable/IOwnable.sol": "pragma solidity 0.4.24;\n\n\ncontract IOwnable {\n\n function transferOwnership(address newOwner)\n public;\n}\n",
- "2.0.0/utils/Ownable/Ownable.sol": "pragma solidity 0.4.24;\n\nimport \"./IOwnable.sol\";\n\n\ncontract Ownable is\n IOwnable\n{\n address public owner;\n\n constructor ()\n public\n {\n owner = msg.sender;\n }\n\n modifier onlyOwner() {\n require(\n msg.sender == owner,\n \"ONLY_CONTRACT_OWNER\"\n );\n _;\n }\n\n function transferOwnership(address newOwner)\n public\n onlyOwner\n {\n if (newOwner != address(0)) {\n owner = newOwner;\n }\n }\n}\n",
- "2.0.0/utils/ReentrancyGuard/ReentrancyGuard.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract ReentrancyGuard {\n\n // Locked state of mutex\n bool private locked = false;\n\n /// @dev Functions with this modifer cannot be reentered. The mutex will be locked\n /// before function execution and unlocked after.\n modifier nonReentrant() {\n // Ensure mutex is unlocked\n require(\n !locked,\n \"REENTRANCY_ILLEGAL\"\n );\n\n // Lock mutex before function call\n locked = true;\n\n // Perform function call\n _;\n\n // Unlock mutex after function call\n locked = false;\n }\n}\n",
- "2.0.0/utils/SafeMath/SafeMath.sol": "pragma solidity 0.4.24;\n\n\ncontract SafeMath {\n\n function safeMul(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n if (a == 0) {\n return 0;\n }\n uint256 c = a * b;\n require(\n c / a == b,\n \"UINT256_OVERFLOW\"\n );\n return c;\n }\n\n function safeDiv(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n uint256 c = a / b;\n return c;\n }\n\n function safeSub(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n require(\n b <= a,\n \"UINT256_UNDERFLOW\"\n );\n return a - b;\n }\n\n function safeAdd(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n uint256 c = a + b;\n require(\n c >= a,\n \"UINT256_OVERFLOW\"\n );\n return c;\n }\n\n function max64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n\n function max256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n}\n"
- },
- "sourceTreeHashHex": "0x7c03657f568331e5dbdd3212ed6be6074760e096f601ee84ad8c0fa46acd293f",
- "compiler": {
- "name": "solc",
- "version": "soljson-v0.4.24+commit.e67f0147.js",
- "settings": {
- "optimizer": {
- "enabled": true,
- "runs": 1000000
- },
- "outputSelection": {
- "*": {
- "*": [
- "abi",
- "evm.bytecode.object",
- "evm.bytecode.sourceMap",
- "evm.deployedBytecode.object",
- "evm.deployedBytecode.sourceMap"
- ]
- }
- }
- }
- },
- "networks": {}
-} \ No newline at end of file
diff --git a/packages/migrations/artifacts/2.0.0-testnet/ERC20Proxy.json b/packages/migrations/artifacts/2.0.0-testnet/ERC20Proxy.json
deleted file mode 100644
index 17ca039b5..000000000
--- a/packages/migrations/artifacts/2.0.0-testnet/ERC20Proxy.json
+++ /dev/null
@@ -1,508 +0,0 @@
-{
- "schemaVersion": "2.0.0",
- "contractName": "ERC20Proxy",
- "compilerOutput": {
- "abi": [
- {
- "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": 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": 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"
- }
- ],
- "evm": {
- "bytecode": {
- "linkReferences": {},
- "object": "0x608060405260008054600160a060020a03191633179055610f4a806100256000396000f3006080604052600436106100985763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166342f1181e8114610248578063494503d41461027857806370712939146102b95780638da5cb5b146102e75780639ad26744146102fc578063ae25532e1461032d578063b918161114610377578063d39de6e9146103b9578063f2fde38b1461041e575b3480156100a457600080fd5b507fffffffff00000000000000000000000000000000000000000000000000000000600035167fa85e59e40000000000000000000000000000000000000000000000000000000081141561024357604080513381526001602082015290812054151561017b577f08c379a0000000000000000000000000000000000000000000000000000000006000527c20000000000000000000000000000000000000000000000000000000006020527c1553454e4445525f4e4f545f415554484f52495a454400000000000000604052600060605260646000fd5b602860043501357f23b872dd0000000000000000000000000000000000000000000000000000000060005260606024600437602060006064600080855af1600080511160203d14163d15178116905080156101d257005b7f08c379a0000000000000000000000000000000000000000000000000000000006000527c20000000000000000000000000000000000000000000000000000000006020527c0f5452414e534645525f4641494c454400000000000000000000000000604052600060605260646000fd5b600080fd5b34801561025457600080fd5b5061027673ffffffffffffffffffffffffffffffffffffffff6004351661044c565b005b34801561028457600080fd5b50610290600435610638565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b3480156102c557600080fd5b5061027673ffffffffffffffffffffffffffffffffffffffff6004351661066d565b3480156102f357600080fd5b50610290610966565b34801561030857600080fd5b5061027673ffffffffffffffffffffffffffffffffffffffff60043516602435610982565b34801561033957600080fd5b50610342610d37565b604080517fffffffff000000000000000000000000000000000000000000000000000000009092168252519081900360200190f35b34801561038357600080fd5b506103a573ffffffffffffffffffffffffffffffffffffffff60043516610d6d565b604080519115158252519081900360200190f35b3480156103c557600080fd5b506103ce610d82565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561040a5781810151838201526020016103f2565b505050509050019250505060405180910390f35b34801561042a57600080fd5b5061027673ffffffffffffffffffffffffffffffffffffffff60043516610df1565b60005473ffffffffffffffffffffffffffffffffffffffff1633146104d257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff811660009081526001602052604090205460ff161561056757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f5441524745545f414c52454144595f415554484f52495a454400000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8116600081815260016020819052604080832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168317905560028054928301815583527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace90910180547fffffffffffffffffffffffff00000000000000000000000000000000000000001684179055513392917f3147867c59d17e8fa9d522465651d44aae0a9e38f902f3475b97e58072f0ed4c91a350565b600280548290811061064657fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b6000805473ffffffffffffffffffffffffffffffffffffffff1633146106f457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff821660009081526001602052604090205460ff16151561078a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f5441524745545f4e4f545f415554484f52495a45440000000000000000000000604482015290519081900360640190fd5b5073ffffffffffffffffffffffffffffffffffffffff8116600090815260016020526040812080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690555b60025481101561091f578173ffffffffffffffffffffffffffffffffffffffff1660028281548110151561080757fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16141561091757600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff810190811061085f57fe5b6000918252602090912001546002805473ffffffffffffffffffffffffffffffffffffffff909216918390811061089257fe5b600091825260209091200180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01906109119082610ed7565b5061091f565b6001016107d7565b604051339073ffffffffffffffffffffffffffffffffffffffff8416907f1f32c1b084e2de0713b8fb16bd46bb9df710a3dbeae2f3ca93af46e016dcc6b090600090a35050565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b60005473ffffffffffffffffffffffffffffffffffffffff163314610a0857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff821660009081526001602052604090205460ff161515610a9e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f5441524745545f4e4f545f415554484f52495a45440000000000000000000000604482015290519081900360640190fd5b6002548110610b0e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f494e4445585f4f55545f4f465f424f554e445300000000000000000000000000604482015290519081900360640190fd5b8173ffffffffffffffffffffffffffffffffffffffff16600282815481101515610b3457fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff1614610bc257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f415554484f52495a45445f414444524553535f4d49534d415443480000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8216600090815260016020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8101908110610c3d57fe5b6000918252602090912001546002805473ffffffffffffffffffffffffffffffffffffffff9092169183908110610c7057fe5b600091825260209091200180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190610cef9082610ed7565b50604051339073ffffffffffffffffffffffffffffffffffffffff8416907f1f32c1b084e2de0713b8fb16bd46bb9df710a3dbeae2f3ca93af46e016dcc6b090600090a35050565b604080517f4552433230546f6b656e28616464726573732900000000000000000000000000815290519081900360130190205b90565b60016020526000908152604090205460ff1681565b60606002805480602002602001604051908101604052809291908181526020018280548015610de757602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610dbc575b5050505050905090565b60005473ffffffffffffffffffffffffffffffffffffffff163314610e7757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff811615610ed457600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83161790555b50565b815481835581811115610efb57600083815260209020610efb918101908301610f00565b505050565b610d6a91905b80821115610f1a5760008155600101610f06565b50905600a165627a7a72305820f6b2cadda0be9b47f37ed4a850b096e49b5e2e8bb7446d65481adecf980824a00029",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 SLOAD PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB NOT AND CALLER OR SWAP1 SSTORE PUSH2 0xF4A DUP1 PUSH2 0x25 PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN STOP PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x98 JUMPI PUSH4 0xFFFFFFFF PUSH29 0x100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD DIV AND PUSH4 0x42F1181E DUP2 EQ PUSH2 0x248 JUMPI DUP1 PUSH4 0x494503D4 EQ PUSH2 0x278 JUMPI DUP1 PUSH4 0x70712939 EQ PUSH2 0x2B9 JUMPI DUP1 PUSH4 0x8DA5CB5B EQ PUSH2 0x2E7 JUMPI DUP1 PUSH4 0x9AD26744 EQ PUSH2 0x2FC JUMPI DUP1 PUSH4 0xAE25532E EQ PUSH2 0x32D JUMPI DUP1 PUSH4 0xB9181611 EQ PUSH2 0x377 JUMPI DUP1 PUSH4 0xD39DE6E9 EQ PUSH2 0x3B9 JUMPI DUP1 PUSH4 0xF2FDE38B EQ PUSH2 0x41E JUMPI JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xA4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD AND PUSH32 0xA85E59E400000000000000000000000000000000000000000000000000000000 DUP2 EQ ISZERO PUSH2 0x243 JUMPI PUSH1 0x40 DUP1 MLOAD CALLER DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 DUP3 ADD MSTORE SWAP1 DUP2 KECCAK256 SLOAD ISZERO ISZERO PUSH2 0x17B JUMPI PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH29 0x2000000000000000000000000000000000000000000000000000000000 PUSH1 0x20 MSTORE PUSH29 0x1553454E4445525F4E4F545F415554484F52495A454400000000000000 PUSH1 0x40 MSTORE PUSH1 0x0 PUSH1 0x60 MSTORE PUSH1 0x64 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x28 PUSH1 0x4 CALLDATALOAD ADD CALLDATALOAD PUSH32 0x23B872DD00000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x60 PUSH1 0x24 PUSH1 0x4 CALLDATACOPY PUSH1 0x20 PUSH1 0x0 PUSH1 0x64 PUSH1 0x0 DUP1 DUP6 GAS CALL PUSH1 0x0 DUP1 MLOAD GT PUSH1 0x20 RETURNDATASIZE EQ AND RETURNDATASIZE ISZERO OR DUP2 AND SWAP1 POP DUP1 ISZERO PUSH2 0x1D2 JUMPI STOP JUMPDEST PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH29 0x2000000000000000000000000000000000000000000000000000000000 PUSH1 0x20 MSTORE PUSH29 0xF5452414E534645525F4641494C454400000000000000000000000000 PUSH1 0x40 MSTORE PUSH1 0x0 PUSH1 0x60 MSTORE PUSH1 0x64 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x254 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x276 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x44C JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x284 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x290 PUSH1 0x4 CALLDATALOAD PUSH2 0x638 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2C5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x276 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x66D JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2F3 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x290 PUSH2 0x966 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x308 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x276 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x982 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x339 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x342 PUSH2 0xD37 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 SWAP1 SWAP3 AND DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x383 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x3A5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0xD6D JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 ISZERO ISZERO DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3C5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x3CE PUSH2 0xD82 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 DUP1 DUP3 MSTORE DUP4 MLOAD DUP2 DUP4 ADD MSTORE DUP4 MLOAD SWAP2 SWAP3 DUP4 SWAP3 SWAP1 DUP4 ADD SWAP2 DUP6 DUP2 ADD SWAP2 MUL DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x40A JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH2 0x3F2 JUMP JUMPDEST POP POP POP POP SWAP1 POP ADD SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x42A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x276 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0xDF1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0x4D2 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x567 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x19 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x5441524745545F414C52454144595F415554484F52495A454400000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND DUP4 OR SWAP1 SSTORE PUSH1 0x2 DUP1 SLOAD SWAP3 DUP4 ADD DUP2 SSTORE DUP4 MSTORE PUSH32 0x405787FA12A823E0F2B7631CC41B3BA8828B3321CA811111FA75CD3AA3BB5ACE SWAP1 SWAP2 ADD DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND DUP5 OR SWAP1 SSTORE MLOAD CALLER SWAP3 SWAP2 PUSH32 0x3147867C59D17E8FA9D522465651D44AAE0A9E38F902F3475B97E58072F0ED4C SWAP2 LOG3 POP JUMP JUMPDEST PUSH1 0x2 DUP1 SLOAD DUP3 SWAP1 DUP2 LT PUSH2 0x646 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 POP DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0x6F4 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND ISZERO ISZERO PUSH2 0x78A JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x15 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x5441524745545F4E4F545F415554484F52495A45440000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 DUP2 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE JUMPDEST PUSH1 0x2 SLOAD DUP2 LT ISZERO PUSH2 0x91F JUMPI DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x2 DUP3 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x807 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0x917 JUMPI PUSH1 0x2 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 ADD SWAP1 DUP2 LT PUSH2 0x85F JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH1 0x2 DUP1 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND SWAP2 DUP4 SWAP1 DUP2 LT PUSH2 0x892 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP3 SWAP1 SWAP3 AND SWAP2 SWAP1 SWAP2 OR SWAP1 SSTORE PUSH1 0x2 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 PUSH2 0x911 SWAP1 DUP3 PUSH2 0xED7 JUMP JUMPDEST POP PUSH2 0x91F JUMP JUMPDEST PUSH1 0x1 ADD PUSH2 0x7D7 JUMP JUMPDEST PUSH1 0x40 MLOAD CALLER SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND SWAP1 PUSH32 0x1F32C1B084E2DE0713B8FB16BD46BB9DF710A3DBEAE2F3CA93AF46E016DCC6B0 SWAP1 PUSH1 0x0 SWAP1 LOG3 POP POP JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0xA08 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND ISZERO ISZERO PUSH2 0xA9E JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x15 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x5441524745545F4E4F545F415554484F52495A45440000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x2 SLOAD DUP2 LT PUSH2 0xB0E JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x494E4445585F4F55545F4F465F424F554E445300000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x2 DUP3 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0xB34 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0xBC2 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x1B PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x415554484F52495A45445F414444524553535F4D49534D415443480000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE PUSH1 0x2 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 ADD SWAP1 DUP2 LT PUSH2 0xC3D JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH1 0x2 DUP1 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND SWAP2 DUP4 SWAP1 DUP2 LT PUSH2 0xC70 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP3 SWAP1 SWAP3 AND SWAP2 SWAP1 SWAP2 OR SWAP1 SSTORE PUSH1 0x2 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 PUSH2 0xCEF SWAP1 DUP3 PUSH2 0xED7 JUMP JUMPDEST POP PUSH1 0x40 MLOAD CALLER SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND SWAP1 PUSH32 0x1F32C1B084E2DE0713B8FB16BD46BB9DF710A3DBEAE2F3CA93AF46E016DCC6B0 SWAP1 PUSH1 0x0 SWAP1 LOG3 POP POP JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0x4552433230546F6B656E28616464726573732900000000000000000000000000 DUP2 MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x13 ADD SWAP1 KECCAK256 JUMPDEST SWAP1 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x2 DUP1 SLOAD DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD DUP1 ISZERO PUSH2 0xDE7 JUMPI PUSH1 0x20 MUL DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x1 SWAP1 SWAP2 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0xDBC JUMPI JUMPDEST POP POP POP POP POP SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0xE77 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND ISZERO PUSH2 0xED4 JUMPI PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND OR SWAP1 SSTORE JUMPDEST POP JUMP JUMPDEST DUP2 SLOAD DUP2 DUP4 SSTORE DUP2 DUP2 GT ISZERO PUSH2 0xEFB JUMPI PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x20 SWAP1 KECCAK256 PUSH2 0xEFB SWAP2 DUP2 ADD SWAP1 DUP4 ADD PUSH2 0xF00 JUMP JUMPDEST POP POP POP JUMP JUMPDEST PUSH2 0xD6A SWAP2 SWAP1 JUMPDEST DUP1 DUP3 GT ISZERO PUSH2 0xF1A JUMPI PUSH1 0x0 DUP2 SSTORE PUSH1 0x1 ADD PUSH2 0xF06 JUMP JUMPDEST POP SWAP1 JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 0xf6 0xb2 0xca 0xdd LOG0 0xbe SWAP12 0x47 RETURN PUSH31 0xD4A850B096E49B5E2E8BB7446D65481ADECF980824A0002900000000000000 ",
- "sourceMap": "641:8586:14:-;;;162:5:63;:18;;-1:-1:-1;;;;;;162:18:63;170:10;162:18;;;641:8586:14;;;;;;"
- },
- "deployedBytecode": {
- "linkReferences": {},
- "object": "0x6080604052600436106100985763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166342f1181e8114610248578063494503d41461027857806370712939146102b95780638da5cb5b146102e75780639ad26744146102fc578063ae25532e1461032d578063b918161114610377578063d39de6e9146103b9578063f2fde38b1461041e575b3480156100a457600080fd5b507fffffffff00000000000000000000000000000000000000000000000000000000600035167fa85e59e40000000000000000000000000000000000000000000000000000000081141561024357604080513381526001602082015290812054151561017b577f08c379a0000000000000000000000000000000000000000000000000000000006000527c20000000000000000000000000000000000000000000000000000000006020527c1553454e4445525f4e4f545f415554484f52495a454400000000000000604052600060605260646000fd5b602860043501357f23b872dd0000000000000000000000000000000000000000000000000000000060005260606024600437602060006064600080855af1600080511160203d14163d15178116905080156101d257005b7f08c379a0000000000000000000000000000000000000000000000000000000006000527c20000000000000000000000000000000000000000000000000000000006020527c0f5452414e534645525f4641494c454400000000000000000000000000604052600060605260646000fd5b600080fd5b34801561025457600080fd5b5061027673ffffffffffffffffffffffffffffffffffffffff6004351661044c565b005b34801561028457600080fd5b50610290600435610638565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b3480156102c557600080fd5b5061027673ffffffffffffffffffffffffffffffffffffffff6004351661066d565b3480156102f357600080fd5b50610290610966565b34801561030857600080fd5b5061027673ffffffffffffffffffffffffffffffffffffffff60043516602435610982565b34801561033957600080fd5b50610342610d37565b604080517fffffffff000000000000000000000000000000000000000000000000000000009092168252519081900360200190f35b34801561038357600080fd5b506103a573ffffffffffffffffffffffffffffffffffffffff60043516610d6d565b604080519115158252519081900360200190f35b3480156103c557600080fd5b506103ce610d82565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561040a5781810151838201526020016103f2565b505050509050019250505060405180910390f35b34801561042a57600080fd5b5061027673ffffffffffffffffffffffffffffffffffffffff60043516610df1565b60005473ffffffffffffffffffffffffffffffffffffffff1633146104d257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff811660009081526001602052604090205460ff161561056757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f5441524745545f414c52454144595f415554484f52495a454400000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8116600081815260016020819052604080832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168317905560028054928301815583527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace90910180547fffffffffffffffffffffffff00000000000000000000000000000000000000001684179055513392917f3147867c59d17e8fa9d522465651d44aae0a9e38f902f3475b97e58072f0ed4c91a350565b600280548290811061064657fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b6000805473ffffffffffffffffffffffffffffffffffffffff1633146106f457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff821660009081526001602052604090205460ff16151561078a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f5441524745545f4e4f545f415554484f52495a45440000000000000000000000604482015290519081900360640190fd5b5073ffffffffffffffffffffffffffffffffffffffff8116600090815260016020526040812080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690555b60025481101561091f578173ffffffffffffffffffffffffffffffffffffffff1660028281548110151561080757fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16141561091757600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff810190811061085f57fe5b6000918252602090912001546002805473ffffffffffffffffffffffffffffffffffffffff909216918390811061089257fe5b600091825260209091200180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01906109119082610ed7565b5061091f565b6001016107d7565b604051339073ffffffffffffffffffffffffffffffffffffffff8416907f1f32c1b084e2de0713b8fb16bd46bb9df710a3dbeae2f3ca93af46e016dcc6b090600090a35050565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b60005473ffffffffffffffffffffffffffffffffffffffff163314610a0857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff821660009081526001602052604090205460ff161515610a9e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f5441524745545f4e4f545f415554484f52495a45440000000000000000000000604482015290519081900360640190fd5b6002548110610b0e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f494e4445585f4f55545f4f465f424f554e445300000000000000000000000000604482015290519081900360640190fd5b8173ffffffffffffffffffffffffffffffffffffffff16600282815481101515610b3457fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff1614610bc257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f415554484f52495a45445f414444524553535f4d49534d415443480000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8216600090815260016020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8101908110610c3d57fe5b6000918252602090912001546002805473ffffffffffffffffffffffffffffffffffffffff9092169183908110610c7057fe5b600091825260209091200180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190610cef9082610ed7565b50604051339073ffffffffffffffffffffffffffffffffffffffff8416907f1f32c1b084e2de0713b8fb16bd46bb9df710a3dbeae2f3ca93af46e016dcc6b090600090a35050565b604080517f4552433230546f6b656e28616464726573732900000000000000000000000000815290519081900360130190205b90565b60016020526000908152604090205460ff1681565b60606002805480602002602001604051908101604052809291908181526020018280548015610de757602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610dbc575b5050505050905090565b60005473ffffffffffffffffffffffffffffffffffffffff163314610e7757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff811615610ed457600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83161790555b50565b815481835581811115610efb57600083815260209020610efb918101908301610f00565b505050565b610d6a91905b80821115610f1a5760008155600101610f06565b50905600a165627a7a72305820f6b2cadda0be9b47f37ed4a850b096e49b5e2e8bb7446d65481adecf980824a00029",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x98 JUMPI PUSH4 0xFFFFFFFF PUSH29 0x100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD DIV AND PUSH4 0x42F1181E DUP2 EQ PUSH2 0x248 JUMPI DUP1 PUSH4 0x494503D4 EQ PUSH2 0x278 JUMPI DUP1 PUSH4 0x70712939 EQ PUSH2 0x2B9 JUMPI DUP1 PUSH4 0x8DA5CB5B EQ PUSH2 0x2E7 JUMPI DUP1 PUSH4 0x9AD26744 EQ PUSH2 0x2FC JUMPI DUP1 PUSH4 0xAE25532E EQ PUSH2 0x32D JUMPI DUP1 PUSH4 0xB9181611 EQ PUSH2 0x377 JUMPI DUP1 PUSH4 0xD39DE6E9 EQ PUSH2 0x3B9 JUMPI DUP1 PUSH4 0xF2FDE38B EQ PUSH2 0x41E JUMPI JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xA4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD AND PUSH32 0xA85E59E400000000000000000000000000000000000000000000000000000000 DUP2 EQ ISZERO PUSH2 0x243 JUMPI PUSH1 0x40 DUP1 MLOAD CALLER DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 DUP3 ADD MSTORE SWAP1 DUP2 KECCAK256 SLOAD ISZERO ISZERO PUSH2 0x17B JUMPI PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH29 0x2000000000000000000000000000000000000000000000000000000000 PUSH1 0x20 MSTORE PUSH29 0x1553454E4445525F4E4F545F415554484F52495A454400000000000000 PUSH1 0x40 MSTORE PUSH1 0x0 PUSH1 0x60 MSTORE PUSH1 0x64 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x28 PUSH1 0x4 CALLDATALOAD ADD CALLDATALOAD PUSH32 0x23B872DD00000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x60 PUSH1 0x24 PUSH1 0x4 CALLDATACOPY PUSH1 0x20 PUSH1 0x0 PUSH1 0x64 PUSH1 0x0 DUP1 DUP6 GAS CALL PUSH1 0x0 DUP1 MLOAD GT PUSH1 0x20 RETURNDATASIZE EQ AND RETURNDATASIZE ISZERO OR DUP2 AND SWAP1 POP DUP1 ISZERO PUSH2 0x1D2 JUMPI STOP JUMPDEST PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH29 0x2000000000000000000000000000000000000000000000000000000000 PUSH1 0x20 MSTORE PUSH29 0xF5452414E534645525F4641494C454400000000000000000000000000 PUSH1 0x40 MSTORE PUSH1 0x0 PUSH1 0x60 MSTORE PUSH1 0x64 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x254 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x276 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x44C JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x284 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x290 PUSH1 0x4 CALLDATALOAD PUSH2 0x638 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2C5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x276 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x66D JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2F3 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x290 PUSH2 0x966 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x308 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x276 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x982 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x339 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x342 PUSH2 0xD37 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 SWAP1 SWAP3 AND DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x383 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x3A5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0xD6D JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 ISZERO ISZERO DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3C5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x3CE PUSH2 0xD82 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 DUP1 DUP3 MSTORE DUP4 MLOAD DUP2 DUP4 ADD MSTORE DUP4 MLOAD SWAP2 SWAP3 DUP4 SWAP3 SWAP1 DUP4 ADD SWAP2 DUP6 DUP2 ADD SWAP2 MUL DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x40A JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH2 0x3F2 JUMP JUMPDEST POP POP POP POP SWAP1 POP ADD SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x42A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x276 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0xDF1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0x4D2 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x567 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x19 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x5441524745545F414C52454144595F415554484F52495A454400000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND DUP4 OR SWAP1 SSTORE PUSH1 0x2 DUP1 SLOAD SWAP3 DUP4 ADD DUP2 SSTORE DUP4 MSTORE PUSH32 0x405787FA12A823E0F2B7631CC41B3BA8828B3321CA811111FA75CD3AA3BB5ACE SWAP1 SWAP2 ADD DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND DUP5 OR SWAP1 SSTORE MLOAD CALLER SWAP3 SWAP2 PUSH32 0x3147867C59D17E8FA9D522465651D44AAE0A9E38F902F3475B97E58072F0ED4C SWAP2 LOG3 POP JUMP JUMPDEST PUSH1 0x2 DUP1 SLOAD DUP3 SWAP1 DUP2 LT PUSH2 0x646 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 POP DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0x6F4 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND ISZERO ISZERO PUSH2 0x78A JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x15 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x5441524745545F4E4F545F415554484F52495A45440000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 DUP2 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE JUMPDEST PUSH1 0x2 SLOAD DUP2 LT ISZERO PUSH2 0x91F JUMPI DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x2 DUP3 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x807 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0x917 JUMPI PUSH1 0x2 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 ADD SWAP1 DUP2 LT PUSH2 0x85F JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH1 0x2 DUP1 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND SWAP2 DUP4 SWAP1 DUP2 LT PUSH2 0x892 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP3 SWAP1 SWAP3 AND SWAP2 SWAP1 SWAP2 OR SWAP1 SSTORE PUSH1 0x2 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 PUSH2 0x911 SWAP1 DUP3 PUSH2 0xED7 JUMP JUMPDEST POP PUSH2 0x91F JUMP JUMPDEST PUSH1 0x1 ADD PUSH2 0x7D7 JUMP JUMPDEST PUSH1 0x40 MLOAD CALLER SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND SWAP1 PUSH32 0x1F32C1B084E2DE0713B8FB16BD46BB9DF710A3DBEAE2F3CA93AF46E016DCC6B0 SWAP1 PUSH1 0x0 SWAP1 LOG3 POP POP JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0xA08 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND ISZERO ISZERO PUSH2 0xA9E JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x15 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x5441524745545F4E4F545F415554484F52495A45440000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x2 SLOAD DUP2 LT PUSH2 0xB0E JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x494E4445585F4F55545F4F465F424F554E445300000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x2 DUP3 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0xB34 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0xBC2 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x1B PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x415554484F52495A45445F414444524553535F4D49534D415443480000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE PUSH1 0x2 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 ADD SWAP1 DUP2 LT PUSH2 0xC3D JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH1 0x2 DUP1 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND SWAP2 DUP4 SWAP1 DUP2 LT PUSH2 0xC70 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP3 SWAP1 SWAP3 AND SWAP2 SWAP1 SWAP2 OR SWAP1 SSTORE PUSH1 0x2 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 PUSH2 0xCEF SWAP1 DUP3 PUSH2 0xED7 JUMP JUMPDEST POP PUSH1 0x40 MLOAD CALLER SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND SWAP1 PUSH32 0x1F32C1B084E2DE0713B8FB16BD46BB9DF710A3DBEAE2F3CA93AF46E016DCC6B0 SWAP1 PUSH1 0x0 SWAP1 LOG3 POP POP JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0x4552433230546F6B656E28616464726573732900000000000000000000000000 DUP2 MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x13 ADD SWAP1 KECCAK256 JUMPDEST SWAP1 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x2 DUP1 SLOAD DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD DUP1 ISZERO PUSH2 0xDE7 JUMPI PUSH1 0x20 MUL DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x1 SWAP1 SWAP2 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0xDBC JUMPI JUMPDEST POP POP POP POP POP SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0xE77 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND ISZERO PUSH2 0xED4 JUMPI PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND OR SWAP1 SSTORE JUMPDEST POP JUMP JUMPDEST DUP2 SLOAD DUP2 DUP4 SSTORE DUP2 DUP2 GT ISZERO PUSH2 0xEFB JUMPI PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x20 SWAP1 KECCAK256 PUSH2 0xEFB SWAP2 DUP2 ADD SWAP1 DUP4 ADD PUSH2 0xF00 JUMP JUMPDEST POP POP POP JUMP JUMPDEST PUSH2 0xD6A SWAP2 SWAP1 JUMPDEST DUP1 DUP3 GT ISZERO PUSH2 0xF1A JUMPI PUSH1 0x0 DUP2 SSTORE PUSH1 0x1 ADD PUSH2 0xF06 JUMP JUMPDEST POP SWAP1 JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 0xf6 0xb2 0xca 0xdd LOG0 0xbe SWAP12 0x47 RETURN PUSH31 0xD4A850B096E49B5E2E8BB7446D65481ADECF980824A0002900000000000000 ",
- "sourceMap": "641:8586:14:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;641:8586:14;1031:66;1027:1;1014:15;1010:88;1493:66;1483:8;1480:80;1477:2;;;1789;1783:9;;1827:6;1809:70;;1919:15;1914:2;1903:14;;1896:39;2030:20;;;2024:27;2017:35;2014:2;;;2153:66;2150:1;2143:77;2252:66;2248:2;2241:78;2351:66;2347:2;2340:78;2450:1;2446:2;2439:13;2483:3;2480:1;2473:14;2014:2;6445;6441:1;6428:15;6424:24;6411:38;6741:66;6738:1;6731:77;7046:2;7042;7039:1;7026:23;7551:2;7488:1;7433:3;7368:1;7310;7240:5;7185:3;7159:459;8361:1;8357;8351:8;8348:15;8319:2;8303:14;8300:22;8271:114;8234:14;8227:22;8203:200;8194:7;8190:214;8179:225;;8424:7;8421:2;;;8454:12;8421:2;8586:66;8583:1;8576:77;8681:66;8677:2;8670:78;8776:66;8772:2;8765:78;8871:1;8867:2;8860:13;8900:3;8897:1;8890:14;1477:2;8996:1;8993;8986:12;1145:320:16;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1145:320:16;;;;;;;;;1030:28;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1030:28:16;;;;;;;;;;;;;;;;;;;;;;;;1579:547;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1579:547:16;;;;;;;91:20:63;;8:9:-1;5:2;;;30:1;27;20:12;5:2;91:20:63;;;;2299:643:16;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2299:643:16;;;;;;;;;9112:113:14;;8:9:-1;5:2;;;30:1;27;20:12;5:2;9112:113:14;;;;;;;;;;;;;;;;;;;;;;;981:43:16;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;981:43:16;;;;;;;;;;;;;;;;;;;;;;;;;3039:138;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3039:138:16;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:100:-1;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;3039:138:16;;;;;;;;;;;;;;;;;333:167:63;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;333:167:63;;;;;;;1145:320:16;259:5:63;;;;245:10;:19;224:85;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1262:18:16;;;;;;;:10;:18;;;;;;;;1261:19;1240:91;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1342:18;;;;;;;1363:4;1342:18;;;;;;;;:25;;;;;;;;1377:11;27:10:-1;;23:18;;;45:23;;1377:24:16;;;;;;;;;;;;;;1416:42;1447:10;;1342:18;1416:42;;;1145:320;:::o;1030:28::-;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1030:28:16;:::o;1579:547::-;1814:9;259:5:63;;;;245:10;:19;224:85;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1698:18:16;;;;;;;:10;:18;;;;;;;;1677:86;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1781:18:16;;;;;;;:10;:18;;;;;1774:25;;;;;;1809:252;1833:11;:18;1829:22;;1809:252;;;1894:6;1876:24;;:11;1888:1;1876:14;;;;;;;;;;;;;;;;;;;;;;:24;1872:179;;;1937:11;1949:18;;:22;;;;1937:35;;;;;;;;;;;;;;;;1920:11;:14;;1937:35;;;;;1932:1;;1920:14;;;;;;;;;;;;;;;:52;;;;;;;;;;;;;;;1990:11;:23;;;;;;;;;:::i;:::-;;2031:5;;1872:179;1853:3;;1809:252;;;2075:44;;2108:10;;2075:44;;;;;;;;;1579:547;;:::o;91:20:63:-;;;;;;:::o;2299:643:16:-;259:5:63;;;;245:10;:19;224:85;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2462:18:16;;;;;;;:10;:18;;;;;;;;2441:86;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2566:11;:18;2558:26;;2537:92;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2682:6;2660:28;;:11;2672:5;2660:18;;;;;;;;;;;;;;;;;;;;;;:28;2639:102;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2759:18;;;;;;;:10;:18;;;;;2752:25;;;;;;2808:11;2820:18;;:22;;;;2808:35;;;;;;;;;;;;;;;;2787:11;:18;;2808:35;;;;;2799:5;;2787:18;;;;;;;;;;;;;;;:56;;;;;;;;;;;;;;;2853:11;:23;;;;;;;;;:::i;:::-;-1:-1:-1;2891:44:16;;2924:10;;2891:44;;;;;;;;;2299:643;;:::o;9112:113:14:-;760:32;;;;;;;;;;;;;;;;9112:113;;:::o;981:43:16:-;;;;;;;;;;;;;;;:::o;3039:138::-;3120:9;3159:11;3152:18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3039:138;:::o;333:167:63:-;259:5;;;;245:10;:19;224:85;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;429:22;;;;425:69;;467:5;:16;;;;;;;;;;425:69;333:167;:::o;641:8586:14:-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;"
- }
- }
- },
- "sources": {
- "2.0.0/extensions/Forwarder/Forwarder.sol": {
- "id": 0
- },
- "2.0.0/extensions/Forwarder/MixinAssets.sol": {
- "id": 1
- },
- "2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol": {
- "id": 2
- },
- "2.0.0/extensions/Forwarder/MixinForwarderCore.sol": {
- "id": 3
- },
- "2.0.0/extensions/Forwarder/MixinWeth.sol": {
- "id": 4
- },
- "2.0.0/extensions/Forwarder/interfaces/IAssets.sol": {
- "id": 5
- },
- "2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol": {
- "id": 6
- },
- "2.0.0/extensions/Forwarder/libs/LibConstants.sol": {
- "id": 7
- },
- "2.0.0/extensions/Forwarder/mixins/MAssets.sol": {
- "id": 8
- },
- "2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol": {
- "id": 9
- },
- "2.0.0/extensions/Forwarder/mixins/MWeth.sol": {
- "id": 10
- },
- "2.0.0/extensions/OrderValidator/OrderValidator.sol": {
- "id": 11
- },
- "2.0.0/multisig/MultiSigWallet.sol": {
- "id": 12
- },
- "2.0.0/multisig/MultiSigWalletWithTimeLock.sol": {
- "id": 13
- },
- "2.0.0/protocol/AssetProxy/ERC20Proxy.sol": {
- "id": 14
- },
- "2.0.0/protocol/AssetProxy/ERC721Proxy.sol": {
- "id": 15
- },
- "2.0.0/protocol/AssetProxy/MixinAuthorizable.sol": {
- "id": 16
- },
- "2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol": {
- "id": 17
- },
- "2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol": {
- "id": 18
- },
- "2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol": {
- "id": 19
- },
- "2.0.0/protocol/AssetProxyOwner/AssetProxyOwner.sol": {
- "id": 20
- },
- "2.0.0/protocol/Exchange/Exchange.sol": {
- "id": 21
- },
- "2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol": {
- "id": 22
- },
- "2.0.0/protocol/Exchange/MixinExchangeCore.sol": {
- "id": 23
- },
- "2.0.0/protocol/Exchange/MixinMatchOrders.sol": {
- "id": 24
- },
- "2.0.0/protocol/Exchange/MixinSignatureValidator.sol": {
- "id": 25
- },
- "2.0.0/protocol/Exchange/MixinTransactions.sol": {
- "id": 26
- },
- "2.0.0/protocol/Exchange/MixinWrapperFunctions.sol": {
- "id": 27
- },
- "2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol": {
- "id": 28
- },
- "2.0.0/protocol/Exchange/interfaces/IExchange.sol": {
- "id": 29
- },
- "2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol": {
- "id": 30
- },
- "2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol": {
- "id": 31
- },
- "2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol": {
- "id": 32
- },
- "2.0.0/protocol/Exchange/interfaces/ITransactions.sol": {
- "id": 33
- },
- "2.0.0/protocol/Exchange/interfaces/IValidator.sol": {
- "id": 34
- },
- "2.0.0/protocol/Exchange/interfaces/IWallet.sol": {
- "id": 35
- },
- "2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol": {
- "id": 36
- },
- "2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol": {
- "id": 37
- },
- "2.0.0/protocol/Exchange/libs/LibConstants.sol": {
- "id": 38
- },
- "2.0.0/protocol/Exchange/libs/LibEIP712.sol": {
- "id": 39
- },
- "2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol": {
- "id": 40
- },
- "2.0.0/protocol/Exchange/libs/LibFillResults.sol": {
- "id": 41
- },
- "2.0.0/protocol/Exchange/libs/LibMath.sol": {
- "id": 42
- },
- "2.0.0/protocol/Exchange/libs/LibOrder.sol": {
- "id": 43
- },
- "2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol": {
- "id": 44
- },
- "2.0.0/protocol/Exchange/mixins/MExchangeCore.sol": {
- "id": 45
- },
- "2.0.0/protocol/Exchange/mixins/MMatchOrders.sol": {
- "id": 46
- },
- "2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol": {
- "id": 47
- },
- "2.0.0/protocol/Exchange/mixins/MTransactions.sol": {
- "id": 48
- },
- "2.0.0/protocol/Exchange/mixins/MWrapperFunctions.sol": {
- "id": 49
- },
- "2.0.0/test/DummyERC20Token/DummyERC20Token.sol": {
- "id": 50
- },
- "2.0.0/test/DummyERC721Token/DummyERC721Token.sol": {
- "id": 51
- },
- "2.0.0/tokens/ERC20Token/ERC20Token.sol": {
- "id": 52
- },
- "2.0.0/tokens/ERC20Token/IERC20Token.sol": {
- "id": 53
- },
- "2.0.0/tokens/ERC20Token/MintableERC20Token.sol": {
- "id": 54
- },
- "2.0.0/tokens/ERC20Token/UnlimitedAllowanceERC20Token.sol": {
- "id": 55
- },
- "2.0.0/tokens/ERC721Token/ERC721Token.sol": {
- "id": 56
- },
- "2.0.0/tokens/ERC721Token/IERC721Receiver.sol": {
- "id": 57
- },
- "2.0.0/tokens/ERC721Token/IERC721Token.sol": {
- "id": 58
- },
- "2.0.0/tokens/ERC721Token/MintableERC721Token.sol": {
- "id": 59
- },
- "2.0.0/tokens/EtherToken/IEtherToken.sol": {
- "id": 60
- },
- "2.0.0/utils/LibBytes/LibBytes.sol": {
- "id": 61
- },
- "2.0.0/utils/Ownable/IOwnable.sol": {
- "id": 62
- },
- "2.0.0/utils/Ownable/Ownable.sol": {
- "id": 63
- },
- "2.0.0/utils/ReentrancyGuard/ReentrancyGuard.sol": {
- "id": 64
- },
- "2.0.0/utils/SafeMath/SafeMath.sol": {
- "id": 65
- }
- },
- "sourceCodes": {
- "2.0.0/extensions/Forwarder/Forwarder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./MixinWeth.sol\";\nimport \"./MixinForwarderCore.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./MixinAssets.sol\";\nimport \"./MixinExchangeWrapper.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract Forwarder is\n LibConstants,\n MixinWeth,\n MixinAssets,\n MixinExchangeWrapper,\n MixinForwarderCore\n{\n constructor (\n address _exchange,\n bytes memory _zrxAssetData,\n bytes memory _wethAssetData\n )\n public\n LibConstants(\n _exchange,\n _zrxAssetData,\n _wethAssetData\n )\n MixinForwarderCore()\n {}\n}\n",
- "2.0.0/extensions/Forwarder/MixinAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"../../tokens/ERC20Token/IERC20Token.sol\";\nimport \"../../tokens/ERC721Token/IERC721Token.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MAssets.sol\";\n\n\ncontract MixinAssets is\n Ownable,\n LibConstants,\n MAssets\n{\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_TRANSFER_SELECTOR = bytes4(keccak256(\"transfer(address,uint256)\"));\n\n /// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to \n /// function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be\n /// used to withdraw assets that were accidentally sent to this contract.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of ERC20 token to withdraw.\n function withdrawAsset(\n bytes assetData,\n uint256 amount\n )\n external\n onlyOwner\n {\n transferAssetToSender(assetData, amount);\n }\n\n /// @dev Transfers given amount of asset to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferAssetToSender(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n bytes4 proxyId = assetData.readBytes4(0);\n\n if (proxyId == ERC20_DATA_ID) {\n transferERC20Token(assetData, amount);\n } else if (proxyId == ERC721_DATA_ID) {\n transferERC721Token(assetData, amount);\n } else {\n revert(\"UNSUPPORTED_ASSET_PROXY\");\n }\n }\n\n /// @dev Decodes ERC20 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC20Token(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n address token = assetData.readAddress(16);\n\n // Transfer tokens.\n // We do a raw call so we can check the success separate\n // from the return data.\n bool success = token.call(abi.encodeWithSelector(\n ERC20_TRANSFER_SELECTOR,\n msg.sender,\n amount\n ));\n require(\n success,\n \"TRANSFER_FAILED\"\n );\n \n // Check return data.\n // If there is no return data, we assume the token incorrectly\n // does not return a bool. In this case we expect it to revert\n // on failure, which was handled above.\n // If the token does return data, we require that it is a single\n // value that evaluates to true.\n assembly {\n if returndatasize {\n success := 0\n if eq(returndatasize, 32) {\n // First 64 bytes of memory are reserved scratch space\n returndatacopy(0, 0, 32)\n success := mload(0)\n }\n }\n }\n require(\n success,\n \"TRANSFER_FAILED\"\n );\n }\n\n /// @dev Decodes ERC721 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC721Token(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n require(\n amount == 1,\n \"INVALID_AMOUNT\"\n );\n // Decode asset data.\n address token = assetData.readAddress(16);\n uint256 tokenId = assetData.readUint256(36);\n\n // Perform transfer.\n IERC721Token(token).transferFrom(\n address(this),\n msg.sender,\n tokenId\n );\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MExchangeWrapper.sol\";\nimport \"../../protocol/Exchange/libs/LibAbiEncoder.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../protocol/Exchange/libs/LibFillResults.sol\";\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\n\n\ncontract MixinExchangeWrapper is\n LibAbiEncoder,\n LibFillResults,\n LibMath,\n LibConstants,\n MExchangeWrapper\n{\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n // ABI encode calldata for `fillOrder`\n bytes memory fillOrderCalldata = abiEncodeFillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n\n address exchange = address(EXCHANGE);\n\n // Call `fillOrder` and handle any exceptions gracefully\n assembly {\n let success := call(\n gas, // forward all gas\n exchange, // call address of Exchange contract\n 0, // transfer 0 wei\n add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes)\n mload(fillOrderCalldata), // length of input\n fillOrderCalldata, // write output over input\n 128 // output size is 128 bytes\n )\n if success {\n mstore(fillResults, mload(fillOrderCalldata))\n mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32)))\n mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64)))\n mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96)))\n }\n }\n // fillResults values will be 0 by default if call was unsuccessful\n return fillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of WETH has been sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param wethSellAmount Desired amount of WETH to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellWeth(\n LibOrder.Order[] memory orders,\n uint256 wethSellAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // We assume that asset being sold by taker is WETH for each order.\n orders[i].makerAssetData = makerAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of WETH to sell\n uint256 remainingTakerAssetFillAmount = safeSub(wethSellAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of WETH\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= wethSellAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// The asset being sold by taker must always be WETH.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyExactAmountWithWeth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // We assume that asset being sold by taker is WETH for each order.\n orders[i].makerAssetData = makerAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n uint256 makerAssetFilledAmount = totalFillResults.makerAssetFilledAmount;\n if (makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n\n require(\n makerAssetFilledAmount >= makerAssetFillAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return totalFillResults;\n }\n\n /// @dev Buys zrxBuyAmount of ZRX fee tokens, taking into account ZRX fees for each order. This will guarantee\n /// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues).\n /// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX\n /// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases.\n /// The asset being sold by taker must always be WETH. \n /// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset.\n /// @param zrxBuyAmount Desired amount of ZRX to buy.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return totalFillResults Amounts filled and fees paid by maker and taker.\n function marketBuyExactZrxWithWeth(\n LibOrder.Order[] memory orders,\n uint256 zrxBuyAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n // Do nothing if zrxBuyAmount == 0\n if (zrxBuyAmount == 0) {\n return totalFillResults;\n }\n\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n uint256 zrxPurchased = 0;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // All of these are ZRX/WETH, so we can drop the respective assetData from calldata.\n orders[i].makerAssetData = zrxAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of ZRX to buy.\n uint256 remainingZrxBuyAmount = safeSub(zrxBuyAmount, zrxPurchased);\n\n // Convert the remaining amount of ZRX to buy into remaining amount\n // of WETH to sell, assuming entire amount can be sold in the current order.\n uint256 remainingWethSellAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n safeSub(orders[i].makerAssetAmount, orders[i].takerFee), // our exchange rate after fees \n remainingZrxBuyAmount\n );\n\n // Attempt to sell the remaining amount of WETH.\n FillResults memory singleFillResult = fillOrderNoThrow(\n orders[i],\n safeAdd(remainingWethSellAmount, 1), // we add 1 wei to the fill amount to make up for rounding errors\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker.\n addFillResults(totalFillResults, singleFillResult);\n zrxPurchased = safeSub(totalFillResults.makerAssetFilledAmount, totalFillResults.takerFeePaid);\n\n // Stop execution if the entire amount of ZRX has been bought.\n if (zrxPurchased >= zrxBuyAmount) {\n break;\n }\n }\n\n require(\n zrxPurchased >= zrxBuyAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return totalFillResults;\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinForwarderCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MWeth.sol\";\nimport \"./mixins/MAssets.sol\";\nimport \"./mixins/MExchangeWrapper.sol\";\nimport \"./interfaces/IForwarderCore.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../protocol/Exchange/libs/LibFillResults.sol\";\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\n\n\ncontract MixinForwarderCore is\n LibFillResults,\n LibMath,\n LibConstants,\n MWeth,\n MAssets,\n MExchangeWrapper,\n IForwarderCore\n{\n using LibBytes for bytes;\n\n /// @dev Constructor approves ERC20 proxy to transfer ZRX and WETH on this contract's behalf.\n constructor ()\n public\n {\n address proxyAddress = EXCHANGE.getAssetProxy(ERC20_DATA_ID);\n require(\n proxyAddress != address(0),\n \"UNREGISTERED_ASSET_PROXY\"\n );\n ETHER_TOKEN.approve(proxyAddress, MAX_UINT);\n ZRX_TOKEN.approve(proxyAddress, MAX_UINT);\n }\n\n /// @dev Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketSellOrdersWithEth(\n LibOrder.Order[] memory orders,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n FillResults memory orderFillResults,\n FillResults memory feeOrderFillResults\n )\n {\n // Convert ETH to WETH.\n convertEthToWeth();\n\n uint256 wethSellAmount;\n uint256 zrxBuyAmount;\n uint256 makerAssetAmountPurchased;\n if (orders[0].makerAssetData.equals(ZRX_ASSET_DATA)) {\n // Calculate amount of WETH that won't be spent on ETH fees.\n wethSellAmount = getPartialAmountFloor(\n PERCENTAGE_DENOMINATOR,\n safeAdd(PERCENTAGE_DENOMINATOR, feePercentage),\n msg.value\n );\n // Market sell available WETH.\n // ZRX fees are paid with this contract's balance.\n orderFillResults = marketSellWeth(\n orders,\n wethSellAmount,\n signatures\n );\n // The fee amount must be deducted from the amount transfered back to sender.\n makerAssetAmountPurchased = safeSub(orderFillResults.makerAssetFilledAmount, orderFillResults.takerFeePaid);\n } else {\n // 5% of WETH is reserved for filling feeOrders and paying feeRecipient.\n wethSellAmount = getPartialAmountFloor(\n MAX_WETH_FILL_PERCENTAGE,\n PERCENTAGE_DENOMINATOR,\n msg.value\n );\n // Market sell 95% of WETH.\n // ZRX fees are payed with this contract's balance.\n orderFillResults = marketSellWeth(\n orders,\n wethSellAmount,\n signatures\n );\n // Buy back all ZRX spent on fees.\n zrxBuyAmount = orderFillResults.takerFeePaid;\n feeOrderFillResults = marketBuyExactZrxWithWeth(\n feeOrders,\n zrxBuyAmount,\n feeSignatures\n );\n makerAssetAmountPurchased = orderFillResults.makerAssetFilledAmount;\n }\n\n // Transfer feePercentage of total ETH spent on primary orders to feeRecipient.\n // Refund remaining ETH to msg.sender.\n transferEthFeeAndRefund(\n orderFillResults.takerAssetFilledAmount,\n feeOrderFillResults.takerAssetFilledAmount,\n feePercentage,\n feeRecipient\n );\n\n // Transfer purchased assets to msg.sender.\n transferAssetToSender(orders[0].makerAssetData, makerAssetAmountPurchased);\n }\n\n /// @dev Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param makerAssetFillAmount Desired amount of makerAsset to purchase.\n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketBuyOrdersWithEth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n FillResults memory orderFillResults,\n FillResults memory feeOrderFillResults\n )\n {\n // Convert ETH to WETH.\n convertEthToWeth();\n\n uint256 zrxBuyAmount;\n uint256 makerAssetAmountPurchased;\n if (orders[0].makerAssetData.equals(ZRX_ASSET_DATA)) {\n // If the makerAsset is ZRX, it is not necessary to pay fees out of this\n // contracts's ZRX balance because fees are factored into the price of the order.\n orderFillResults = marketBuyExactZrxWithWeth(\n orders,\n makerAssetFillAmount,\n signatures\n );\n // The fee amount must be deducted from the amount transfered back to sender.\n makerAssetAmountPurchased = safeSub(orderFillResults.makerAssetFilledAmount, orderFillResults.takerFeePaid);\n } else {\n // Attemp to purchase desired amount of makerAsset.\n // ZRX fees are payed with this contract's balance.\n orderFillResults = marketBuyExactAmountWithWeth(\n orders,\n makerAssetFillAmount,\n signatures\n );\n // Buy back all ZRX spent on fees.\n zrxBuyAmount = orderFillResults.takerFeePaid;\n feeOrderFillResults = marketBuyExactZrxWithWeth(\n feeOrders,\n zrxBuyAmount,\n feeSignatures\n );\n makerAssetAmountPurchased = orderFillResults.makerAssetFilledAmount;\n }\n\n // Transfer feePercentage of total ETH spent on primary orders to feeRecipient.\n // Refund remaining ETH to msg.sender.\n transferEthFeeAndRefund(\n orderFillResults.takerAssetFilledAmount,\n feeOrderFillResults.takerAssetFilledAmount,\n feePercentage,\n feeRecipient\n );\n\n // Transfer purchased assets to msg.sender.\n transferAssetToSender(orders[0].makerAssetData, makerAssetAmountPurchased);\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinWeth.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MWeth.sol\";\n\n\ncontract MixinWeth is\n LibMath,\n LibConstants,\n MWeth\n{\n /// @dev Default payabale function, this allows us to withdraw WETH\n function ()\n public\n payable\n {\n require(\n msg.sender == address(ETHER_TOKEN),\n \"DEFAULT_FUNCTION_WETH_CONTRACT_ONLY\"\n );\n }\n\n /// @dev Converts message call's ETH value into WETH.\n function convertEthToWeth()\n internal\n {\n require(\n msg.value > 0,\n \"INVALID_MSG_VALUE\"\n );\n ETHER_TOKEN.deposit.value(msg.value)();\n }\n\n /// @dev Transfers feePercentage of WETH spent on primary orders to feeRecipient.\n /// Refunds any excess ETH to msg.sender.\n /// @param wethSoldExcludingFeeOrders Amount of WETH sold when filling primary orders.\n /// @param wethSoldForZrx Amount of WETH sold when purchasing ZRX required for primary order fees.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n function transferEthFeeAndRefund(\n uint256 wethSoldExcludingFeeOrders,\n uint256 wethSoldForZrx,\n uint256 feePercentage,\n address feeRecipient\n )\n internal\n {\n // Ensure feePercentage is less than 5%.\n require(\n feePercentage <= MAX_FEE_PERCENTAGE,\n \"FEE_PERCENTAGE_TOO_LARGE\"\n );\n\n // Ensure that no extra WETH owned by this contract has been sold.\n uint256 wethSold = safeAdd(wethSoldExcludingFeeOrders, wethSoldForZrx);\n require(\n wethSold <= msg.value,\n \"OVERSOLD_WETH\"\n );\n\n // Calculate amount of WETH that hasn't been sold.\n uint256 wethRemaining = safeSub(msg.value, wethSold);\n\n // Calculate ETH fee to pay to feeRecipient.\n uint256 ethFee = getPartialAmountFloor(\n feePercentage,\n PERCENTAGE_DENOMINATOR,\n wethSoldExcludingFeeOrders\n );\n\n // Ensure fee is less than amount of WETH remaining.\n require(\n ethFee <= wethRemaining,\n \"INSUFFICIENT_ETH_REMAINING\"\n );\n \n // Do nothing if no WETH remaining\n if (wethRemaining > 0) {\n // Convert remaining WETH to ETH\n ETHER_TOKEN.withdraw(wethRemaining);\n\n // Pay ETH to feeRecipient\n if (ethFee > 0) {\n feeRecipient.transfer(ethFee);\n }\n\n // Refund remaining ETH to msg.sender.\n uint256 ethRefund = safeSub(wethRemaining, ethFee);\n if (ethRefund > 0) {\n msg.sender.transfer(ethRefund);\n }\n }\n }\n}\n",
- "2.0.0/extensions/Forwarder/interfaces/IAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IAssets {\n\n /// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to \n /// function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be\n /// used to withdraw assets that were accidentally sent to this contract.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of ERC20 token to withdraw.\n function withdrawAsset(\n bytes assetData,\n uint256 amount\n )\n external;\n}\n",
- "2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../../protocol/Exchange/libs/LibFillResults.sol\";\n\n\ncontract IForwarderCore {\n\n /// @dev Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketSellOrdersWithEth(\n LibOrder.Order[] memory orders,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n LibFillResults.FillResults memory orderFillResults,\n LibFillResults.FillResults memory feeOrderFillResults\n );\n\n /// @dev Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param makerAssetFillAmount Desired amount of makerAsset to purchase.\n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketBuyOrdersWithEth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n LibFillResults.FillResults memory orderFillResults,\n LibFillResults.FillResults memory feeOrderFillResults\n );\n}\n",
- "2.0.0/extensions/Forwarder/libs/LibConstants.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/LibBytes/LibBytes.sol\";\nimport \"../../../protocol/Exchange/interfaces/IExchange.sol\";\nimport \"../../../tokens/EtherToken/IEtherToken.sol\";\nimport \"../../../tokens/ERC20Token/IERC20Token.sol\";\n\n\ncontract LibConstants {\n\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n uint256 constant internal MAX_UINT = 2**256 - 1;\n uint256 constant internal PERCENTAGE_DENOMINATOR = 10**18; \n uint256 constant internal MAX_FEE_PERCENTAGE = 5 * PERCENTAGE_DENOMINATOR / 100; // 5%\n uint256 constant internal MAX_WETH_FILL_PERCENTAGE = 95 * PERCENTAGE_DENOMINATOR / 100; // 95%\n \n // solhint-disable var-name-mixedcase\n IExchange internal EXCHANGE;\n IEtherToken internal ETHER_TOKEN;\n IERC20Token internal ZRX_TOKEN;\n bytes internal ZRX_ASSET_DATA;\n bytes internal WETH_ASSET_DATA;\n // solhint-enable var-name-mixedcase\n\n constructor (\n address _exchange,\n bytes memory _zrxAssetData,\n bytes memory _wethAssetData\n )\n public\n {\n EXCHANGE = IExchange(_exchange);\n ZRX_ASSET_DATA = _zrxAssetData;\n WETH_ASSET_DATA = _wethAssetData;\n\n address etherToken = _wethAssetData.readAddress(16);\n address zrxToken = _zrxAssetData.readAddress(16);\n ETHER_TOKEN = IEtherToken(etherToken);\n ZRX_TOKEN = IERC20Token(zrxToken);\n }\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAssets.sol\";\n\n\ncontract MAssets is\n IAssets\n{\n /// @dev Transfers given amount of asset to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferAssetToSender(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n\n /// @dev Decodes ERC20 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC20Token(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n\n /// @dev Decodes ERC721 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC721Token(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../../protocol/Exchange/libs/LibFillResults.sol\";\n\n\ncontract MExchangeWrapper {\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of WETH has been sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param wethSellAmount Desired amount of WETH to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellWeth(\n LibOrder.Order[] memory orders,\n uint256 wethSellAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// The asset being sold by taker must always be WETH.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyExactAmountWithWeth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Buys zrxBuyAmount of ZRX fee tokens, taking into account ZRX fees for each order. This will guarantee\n /// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues).\n /// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX\n /// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases.\n /// The asset being sold by taker must always be WETH. \n /// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset.\n /// @param zrxBuyAmount Desired amount of ZRX to buy.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return totalFillResults Amounts filled and fees paid by maker and taker.\n function marketBuyExactZrxWithWeth(\n LibOrder.Order[] memory orders,\n uint256 zrxBuyAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MWeth.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract MWeth {\n\n /// @dev Converts message call's ETH value into WETH.\n function convertEthToWeth()\n internal;\n\n /// @dev Transfers feePercentage of WETH spent on primary orders to feeRecipient.\n /// Refunds any excess ETH to msg.sender.\n /// @param wethSoldExcludingFeeOrders Amount of WETH sold when filling primary orders.\n /// @param wethSoldForZrx Amount of WETH sold when purchasing ZRX required for primary order fees.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n function transferEthFeeAndRefund(\n uint256 wethSoldExcludingFeeOrders,\n uint256 wethSoldForZrx,\n uint256 feePercentage,\n address feeRecipient\n )\n internal;\n}\n",
- "2.0.0/extensions/OrderValidator/OrderValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../protocol/Exchange/interfaces/IExchange.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../tokens/ERC20Token/IERC20Token.sol\";\nimport \"../../tokens/ERC721Token/IERC721Token.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\n\n\ncontract OrderValidator {\n\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n\n struct TraderInfo {\n uint256 makerBalance; // Maker's balance of makerAsset\n uint256 makerAllowance; // Maker's allowance to corresponding AssetProxy\n uint256 takerBalance; // Taker's balance of takerAsset\n uint256 takerAllowance; // Taker's allowance to corresponding AssetProxy\n uint256 makerZrxBalance; // Maker's balance of ZRX\n uint256 makerZrxAllowance; // Maker's allowance of ZRX to ERC20Proxy\n uint256 takerZrxBalance; // Taker's balance of ZRX\n uint256 takerZrxAllowance; // Taker's allowance of ZRX to ERC20Proxy\n }\n\n // solhint-disable var-name-mixedcase\n IExchange internal EXCHANGE;\n bytes internal ZRX_ASSET_DATA;\n // solhint-enable var-name-mixedcase\n\n constructor (address _exchange, bytes memory _zrxAssetData)\n public\n {\n EXCHANGE = IExchange(_exchange);\n ZRX_ASSET_DATA = _zrxAssetData;\n }\n\n /// @dev Fetches information for order and maker/taker of order.\n /// @param order The order structure.\n /// @param takerAddress Address that will be filling the order.\n /// @return OrderInfo and TraderInfo instances for given order.\n function getOrderAndTraderInfo(LibOrder.Order memory order, address takerAddress)\n public\n view\n returns (LibOrder.OrderInfo memory orderInfo, TraderInfo memory traderInfo)\n {\n orderInfo = EXCHANGE.getOrderInfo(order);\n traderInfo = getTraderInfo(order, takerAddress);\n return (orderInfo, traderInfo);\n }\n\n /// @dev Fetches information for all passed in orders and the makers/takers of each order.\n /// @param orders Array of order specifications.\n /// @param takerAddresses Array of taker addresses corresponding to each order.\n /// @return Arrays of OrderInfo and TraderInfo instances that correspond to each order.\n function getOrdersAndTradersInfo(LibOrder.Order[] memory orders, address[] memory takerAddresses)\n public\n view\n returns (LibOrder.OrderInfo[] memory ordersInfo, TraderInfo[] memory tradersInfo)\n {\n ordersInfo = EXCHANGE.getOrdersInfo(orders);\n tradersInfo = getTradersInfo(orders, takerAddresses);\n return (ordersInfo, tradersInfo);\n }\n\n /// @dev Fetches balance and allowances for maker and taker of order.\n /// @param order The order structure.\n /// @param takerAddress Address that will be filling the order.\n /// @return Balances and allowances of maker and taker of order.\n function getTraderInfo(LibOrder.Order memory order, address takerAddress)\n public\n view\n returns (TraderInfo memory traderInfo)\n {\n (traderInfo.makerBalance, traderInfo.makerAllowance) = getBalanceAndAllowance(order.makerAddress, order.makerAssetData);\n (traderInfo.takerBalance, traderInfo.takerAllowance) = getBalanceAndAllowance(takerAddress, order.takerAssetData);\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n (traderInfo.makerZrxBalance, traderInfo.makerZrxAllowance) = getBalanceAndAllowance(order.makerAddress, zrxAssetData);\n (traderInfo.takerZrxBalance, traderInfo.takerZrxAllowance) = getBalanceAndAllowance(takerAddress, zrxAssetData);\n return traderInfo;\n }\n\n /// @dev Fetches balances and allowances of maker and taker for each provided order.\n /// @param orders Array of order specifications.\n /// @param takerAddresses Array of taker addresses corresponding to each order.\n /// @return Array of balances and allowances for maker and taker of each order.\n function getTradersInfo(LibOrder.Order[] memory orders, address[] memory takerAddresses)\n public\n view\n returns (TraderInfo[] memory)\n {\n uint256 ordersLength = orders.length;\n TraderInfo[] memory tradersInfo = new TraderInfo[](ordersLength);\n for (uint256 i = 0; i != ordersLength; i++) {\n tradersInfo[i] = getTraderInfo(orders[i], takerAddresses[i]);\n }\n return tradersInfo;\n }\n\n /// @dev Fetches token balances and allowances of an address to given assetProxy. Supports ERC20 and ERC721.\n /// @param target Address to fetch balances and allowances of.\n /// @param assetData Encoded data that can be decoded by a specified proxy contract when transferring asset.\n /// @return Balance of asset and allowance set to given proxy of asset.\n /// For ERC721 tokens, these values will always be 1 or 0.\n function getBalanceAndAllowance(address target, bytes memory assetData)\n public\n view\n returns (uint256 balance, uint256 allowance)\n {\n bytes4 assetProxyId = assetData.readBytes4(0);\n address token = assetData.readAddress(16);\n address assetProxy = EXCHANGE.getAssetProxy(assetProxyId);\n\n if (assetProxyId == ERC20_DATA_ID) {\n // Query balance\n balance = IERC20Token(token).balanceOf(target);\n\n // Query allowance\n allowance = IERC20Token(token).allowance(target, assetProxy);\n } else if (assetProxyId == ERC721_DATA_ID) {\n uint256 tokenId = assetData.readUint256(36);\n\n // Query owner of tokenId\n address owner = getERC721TokenOwner(token, tokenId);\n\n // Set balance to 1 if tokenId is owned by target\n balance = target == owner ? 1 : 0;\n\n // Check if ERC721Proxy is approved to spend tokenId\n bool isApproved = IERC721Token(token).isApprovedForAll(target, assetProxy) || IERC721Token(token).getApproved(tokenId) == assetProxy;\n \n // Set alowance to 1 if ERC721Proxy is approved to spend tokenId\n allowance = isApproved ? 1 : 0;\n } else {\n revert(\"UNSUPPORTED_ASSET_PROXY\");\n }\n return (balance, allowance);\n }\n\n /// @dev Fetches token balances and allowances of an address for each given assetProxy. Supports ERC20 and ERC721.\n /// @param target Address to fetch balances and allowances of.\n /// @param assetData Array of encoded byte arrays that can be decoded by a specified proxy contract when transferring asset.\n /// @return Balances and allowances of assets.\n /// For ERC721 tokens, these values will always be 1 or 0.\n function getBalancesAndAllowances(address target, bytes[] memory assetData)\n public\n view\n returns (uint256[] memory, uint256[] memory)\n {\n uint256 length = assetData.length;\n uint256[] memory balances = new uint256[](length);\n uint256[] memory allowances = new uint256[](length);\n for (uint256 i = 0; i != length; i++) {\n (balances[i], allowances[i]) = getBalanceAndAllowance(target, assetData[i]);\n }\n return (balances, allowances);\n }\n\n /// @dev Calls `token.ownerOf(tokenId)`, but returns a null owner instead of reverting on an unowned token.\n /// @param token Address of ERC721 token.\n /// @param tokenId The identifier for the specific NFT.\n /// @return Owner of tokenId or null address if unowned.\n function getERC721TokenOwner(address token, uint256 tokenId)\n public\n view\n returns (address owner)\n {\n assembly {\n // load free memory pointer\n let cdStart := mload(64)\n\n // bytes4(keccak256(ownerOf(uint256))) = 0x6352211e\n mstore(cdStart, 0x6352211e00000000000000000000000000000000000000000000000000000000)\n mstore(add(cdStart, 4), tokenId)\n\n // staticcall `ownerOf(tokenId)`\n // `ownerOf` will revert if tokenId is not owned\n let success := staticcall(\n gas, // forward all gas\n token, // call token contract\n cdStart, // start of calldata\n 36, // length of input is 36 bytes\n cdStart, // write output over input\n 32 // size of output is 32 bytes\n )\n\n // Success implies that tokenId is owned\n // Copy owner from return data if successful\n if success {\n owner := mload(cdStart)\n } \n }\n\n // Owner initialized to address(0), no need to modify if call is unsuccessful\n return owner;\n }\n}\n",
- "2.0.0/multisig/MultiSigWallet.sol": "// solhint-disable\npragma solidity ^0.4.15;\n\n\n/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.\n/// @author Stefan George - <stefan.george@consensys.net>\ncontract MultiSigWallet {\n\n /*\n * Events\n */\n event Confirmation(address indexed sender, uint indexed transactionId);\n event Revocation(address indexed sender, uint indexed transactionId);\n event Submission(uint indexed transactionId);\n event Execution(uint indexed transactionId);\n event ExecutionFailure(uint indexed transactionId);\n event Deposit(address indexed sender, uint value);\n event OwnerAddition(address indexed owner);\n event OwnerRemoval(address indexed owner);\n event RequirementChange(uint required);\n\n /*\n * Constants\n */\n uint constant public MAX_OWNER_COUNT = 50;\n\n /*\n * Storage\n */\n mapping (uint => Transaction) public transactions;\n mapping (uint => mapping (address => bool)) public confirmations;\n mapping (address => bool) public isOwner;\n address[] public owners;\n uint public required;\n uint public transactionCount;\n\n struct Transaction {\n address destination;\n uint value;\n bytes data;\n bool executed;\n }\n\n /*\n * Modifiers\n */\n modifier onlyWallet() {\n require(msg.sender == address(this));\n _;\n }\n\n modifier ownerDoesNotExist(address owner) {\n require(!isOwner[owner]);\n _;\n }\n\n modifier ownerExists(address owner) {\n require(isOwner[owner]);\n _;\n }\n\n modifier transactionExists(uint transactionId) {\n require(transactions[transactionId].destination != 0);\n _;\n }\n\n modifier confirmed(uint transactionId, address owner) {\n require(confirmations[transactionId][owner]);\n _;\n }\n\n modifier notConfirmed(uint transactionId, address owner) {\n require(!confirmations[transactionId][owner]);\n _;\n }\n\n modifier notExecuted(uint transactionId) {\n require(!transactions[transactionId].executed);\n _;\n }\n\n modifier notNull(address _address) {\n require(_address != 0);\n _;\n }\n\n modifier validRequirement(uint ownerCount, uint _required) {\n require(ownerCount <= MAX_OWNER_COUNT\n && _required <= ownerCount\n && _required != 0\n && ownerCount != 0);\n _;\n }\n\n /// @dev Fallback function allows to deposit ether.\n function()\n payable\n {\n if (msg.value > 0)\n Deposit(msg.sender, msg.value);\n }\n\n /*\n * Public functions\n */\n /// @dev Contract constructor sets initial owners and required number of confirmations.\n /// @param _owners List of initial owners.\n /// @param _required Number of required confirmations.\n function MultiSigWallet(address[] _owners, uint _required)\n public\n validRequirement(_owners.length, _required)\n {\n for (uint i=0; i<_owners.length; i++) {\n require(!isOwner[_owners[i]] && _owners[i] != 0);\n isOwner[_owners[i]] = true;\n }\n owners = _owners;\n required = _required;\n }\n\n /// @dev Allows to add a new owner. Transaction has to be sent by wallet.\n /// @param owner Address of new owner.\n function addOwner(address owner)\n public\n onlyWallet\n ownerDoesNotExist(owner)\n notNull(owner)\n validRequirement(owners.length + 1, required)\n {\n isOwner[owner] = true;\n owners.push(owner);\n OwnerAddition(owner);\n }\n\n /// @dev Allows to remove an owner. Transaction has to be sent by wallet.\n /// @param owner Address of owner.\n function removeOwner(address owner)\n public\n onlyWallet\n ownerExists(owner)\n {\n isOwner[owner] = false;\n for (uint i=0; i<owners.length - 1; i++)\n if (owners[i] == owner) {\n owners[i] = owners[owners.length - 1];\n break;\n }\n owners.length -= 1;\n if (required > owners.length)\n changeRequirement(owners.length);\n OwnerRemoval(owner);\n }\n\n /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet.\n /// @param owner Address of owner to be replaced.\n /// @param newOwner Address of new owner.\n function replaceOwner(address owner, address newOwner)\n public\n onlyWallet\n ownerExists(owner)\n ownerDoesNotExist(newOwner)\n {\n for (uint i=0; i<owners.length; i++)\n if (owners[i] == owner) {\n owners[i] = newOwner;\n break;\n }\n isOwner[owner] = false;\n isOwner[newOwner] = true;\n OwnerRemoval(owner);\n OwnerAddition(newOwner);\n }\n\n /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet.\n /// @param _required Number of required confirmations.\n function changeRequirement(uint _required)\n public\n onlyWallet\n validRequirement(owners.length, _required)\n {\n required = _required;\n RequirementChange(_required);\n }\n\n /// @dev Allows an owner to submit and confirm a transaction.\n /// @param destination Transaction target address.\n /// @param value Transaction ether value.\n /// @param data Transaction data payload.\n /// @return Returns transaction ID.\n function submitTransaction(address destination, uint value, bytes data)\n public\n returns (uint transactionId)\n {\n transactionId = addTransaction(destination, value, data);\n confirmTransaction(transactionId);\n }\n\n /// @dev Allows an owner to confirm a transaction.\n /// @param transactionId Transaction ID.\n function confirmTransaction(uint transactionId)\n public\n ownerExists(msg.sender)\n transactionExists(transactionId)\n notConfirmed(transactionId, msg.sender)\n {\n confirmations[transactionId][msg.sender] = true;\n Confirmation(msg.sender, transactionId);\n executeTransaction(transactionId);\n }\n\n /// @dev Allows an owner to revoke a confirmation for a transaction.\n /// @param transactionId Transaction ID.\n function revokeConfirmation(uint transactionId)\n public\n ownerExists(msg.sender)\n confirmed(transactionId, msg.sender)\n notExecuted(transactionId)\n {\n confirmations[transactionId][msg.sender] = false;\n Revocation(msg.sender, transactionId);\n }\n\n /// @dev Allows anyone to execute a confirmed transaction.\n /// @param transactionId Transaction ID.\n function executeTransaction(uint transactionId)\n public\n ownerExists(msg.sender)\n confirmed(transactionId, msg.sender)\n notExecuted(transactionId)\n {\n if (isConfirmed(transactionId)) {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data))\n Execution(transactionId);\n else {\n ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n }\n\n // call has been separated into its own function in order to take advantage\n // of the Solidity's code generator to produce a loop that copies tx.data into memory.\n function external_call(address destination, uint value, uint dataLength, bytes data) internal returns (bool) {\n bool result;\n assembly {\n let x := mload(0x40) // \"Allocate\" memory for output (0x40 is where \"free memory\" pointer is stored by convention)\n let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that\n result := call(\n sub(gas, 34710), // 34710 is the value that solidity is currently emitting\n // It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) +\n // callNewAccountGas (25000, in case the destination address does not exist and needs creating)\n destination,\n value,\n d,\n dataLength, // Size of the input (in bytes) - this is what fixes the padding problem\n x,\n 0 // Output is ignored, therefore the output size is zero\n )\n }\n return result;\n }\n\n /// @dev Returns the confirmation status of a transaction.\n /// @param transactionId Transaction ID.\n /// @return Confirmation status.\n function isConfirmed(uint transactionId)\n public\n constant\n returns (bool)\n {\n uint count = 0;\n for (uint i=0; i<owners.length; i++) {\n if (confirmations[transactionId][owners[i]])\n count += 1;\n if (count == required)\n return true;\n }\n }\n\n /*\n * Internal functions\n */\n /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet.\n /// @param destination Transaction target address.\n /// @param value Transaction ether value.\n /// @param data Transaction data payload.\n /// @return Returns transaction ID.\n function addTransaction(address destination, uint value, bytes data)\n internal\n notNull(destination)\n returns (uint transactionId)\n {\n transactionId = transactionCount;\n transactions[transactionId] = Transaction({\n destination: destination,\n value: value,\n data: data,\n executed: false\n });\n transactionCount += 1;\n Submission(transactionId);\n }\n\n /*\n * Web3 call functions\n */\n /// @dev Returns number of confirmations of a transaction.\n /// @param transactionId Transaction ID.\n /// @return Number of confirmations.\n function getConfirmationCount(uint transactionId)\n public\n constant\n returns (uint count)\n {\n for (uint i=0; i<owners.length; i++)\n if (confirmations[transactionId][owners[i]])\n count += 1;\n }\n\n /// @dev Returns total number of transactions after filers are applied.\n /// @param pending Include pending transactions.\n /// @param executed Include executed transactions.\n /// @return Total number of transactions after filters are applied.\n function getTransactionCount(bool pending, bool executed)\n public\n constant\n returns (uint count)\n {\n for (uint i=0; i<transactionCount; i++)\n if ( pending && !transactions[i].executed\n || executed && transactions[i].executed)\n count += 1;\n }\n\n /// @dev Returns list of owners.\n /// @return List of owner addresses.\n function getOwners()\n public\n constant\n returns (address[])\n {\n return owners;\n }\n\n /// @dev Returns array with owner addresses, which confirmed transaction.\n /// @param transactionId Transaction ID.\n /// @return Returns array of owner addresses.\n function getConfirmations(uint transactionId)\n public\n constant\n returns (address[] _confirmations)\n {\n address[] memory confirmationsTemp = new address[](owners.length);\n uint count = 0;\n uint i;\n for (i=0; i<owners.length; i++)\n if (confirmations[transactionId][owners[i]]) {\n confirmationsTemp[count] = owners[i];\n count += 1;\n }\n _confirmations = new address[](count);\n for (i=0; i<count; i++)\n _confirmations[i] = confirmationsTemp[i];\n }\n\n /// @dev Returns list of transaction IDs in defined range.\n /// @param from Index start position of transaction array.\n /// @param to Index end position of transaction array.\n /// @param pending Include pending transactions.\n /// @param executed Include executed transactions.\n /// @return Returns array of transaction IDs.\n function getTransactionIds(uint from, uint to, bool pending, bool executed)\n public\n constant\n returns (uint[] _transactionIds)\n {\n uint[] memory transactionIdsTemp = new uint[](transactionCount);\n uint count = 0;\n uint i;\n for (i=0; i<transactionCount; i++)\n if ( pending && !transactions[i].executed\n || executed && transactions[i].executed)\n {\n transactionIdsTemp[count] = i;\n count += 1;\n }\n _transactionIds = new uint[](to - from);\n for (i=from; i<to; i++)\n _transactionIds[i - from] = transactionIdsTemp[i];\n }\n}",
- "2.0.0/multisig/MultiSigWalletWithTimeLock.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MultiSigWallet.sol\";\n\n\n/// @title Multisignature wallet with time lock- Allows multiple parties to execute a transaction after a time lock has passed.\n/// @author Amir Bandeali - <amir@0xProject.com>\n// solhint-disable not-rely-on-time\ncontract MultiSigWalletWithTimeLock is\n MultiSigWallet\n{\n event ConfirmationTimeSet(uint256 indexed transactionId, uint256 confirmationTime);\n event TimeLockChange(uint256 secondsTimeLocked);\n\n uint256 public secondsTimeLocked;\n\n mapping (uint256 => uint256) public confirmationTimes;\n\n modifier notFullyConfirmed(uint256 transactionId) {\n require(\n !isConfirmed(transactionId),\n \"TX_FULLY_CONFIRMED\"\n );\n _;\n }\n\n modifier fullyConfirmed(uint256 transactionId) {\n require(\n isConfirmed(transactionId),\n \"TX_NOT_FULLY_CONFIRMED\"\n );\n _;\n }\n\n modifier pastTimeLock(uint256 transactionId) {\n require(\n block.timestamp >= confirmationTimes[transactionId] + secondsTimeLocked,\n \"TIME_LOCK_INCOMPLETE\"\n );\n _;\n }\n\n /// @dev Contract constructor sets initial owners, required number of confirmations, and time lock.\n /// @param _owners List of initial owners.\n /// @param _required Number of required confirmations.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n constructor (\n address[] _owners,\n uint256 _required,\n uint256 _secondsTimeLocked\n )\n public\n MultiSigWallet(_owners, _required)\n {\n secondsTimeLocked = _secondsTimeLocked;\n }\n\n /// @dev Changes the duration of the time lock for transactions.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n function changeTimeLock(uint256 _secondsTimeLocked)\n public\n onlyWallet\n {\n secondsTimeLocked = _secondsTimeLocked;\n emit TimeLockChange(_secondsTimeLocked);\n }\n\n /// @dev Allows an owner to confirm a transaction.\n /// @param transactionId Transaction ID.\n function confirmTransaction(uint256 transactionId)\n public\n ownerExists(msg.sender)\n transactionExists(transactionId)\n notConfirmed(transactionId, msg.sender)\n notFullyConfirmed(transactionId)\n {\n confirmations[transactionId][msg.sender] = true;\n emit Confirmation(msg.sender, transactionId);\n if (isConfirmed(transactionId)) {\n setConfirmationTime(transactionId, block.timestamp);\n }\n }\n\n /// @dev Allows anyone to execute a confirmed transaction.\n /// @param transactionId Transaction ID.\n function executeTransaction(uint256 transactionId)\n public\n notExecuted(transactionId)\n fullyConfirmed(transactionId)\n pastTimeLock(transactionId)\n {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) {\n emit Execution(transactionId);\n } else {\n emit ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n\n /// @dev Sets the time of when a submission first passed.\n function setConfirmationTime(uint256 transactionId, uint256 confirmationTime)\n internal\n {\n confirmationTimes[transactionId] = confirmationTime;\n emit ConfirmationTimeSet(transactionId, confirmationTime);\n }\n}\n",
- "2.0.0/protocol/AssetProxy/ERC20Proxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MixinAuthorizable.sol\";\n\n\ncontract ERC20Proxy is\n MixinAuthorizable\n{\n // Id of this proxy.\n bytes4 constant internal PROXY_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n \n // solhint-disable-next-line payable-fallback\n function () \n external\n {\n assembly {\n // The first 4 bytes of calldata holds the function selector\n let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)\n\n // `transferFrom` will be called with the following parameters:\n // assetData Encoded byte array.\n // from Address to transfer asset from.\n // to Address to transfer asset to.\n // amount Amount of asset to transfer.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {\n\n // To lookup a value in a mapping, we load from the storage location keccak256(k, p),\n // where k is the key left padded to 32 bytes and p is the storage slot\n let start := mload(64)\n mstore(start, and(caller, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(start, 32), authorized_slot)\n\n // Revert if authorized[msg.sender] == false\n if iszero(sload(keccak256(start, 64))) {\n // Revert with `Error(\"SENDER_NOT_AUTHORIZED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // `transferFrom`.\n // The function is marked `external`, so no abi decodeding is done for\n // us. Instead, we expect the `calldata` memory to contain the\n // following:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n //\n // (*): offset is computed from start of function parameters, so offset\n // by an additional 4 bytes in the calldata.\n //\n // (**): see table below to compute length of assetData Contents\n //\n // WARNING: The ABIv2 specification allows additional padding between\n // the Params and Data section. This will result in a larger\n // offset to assetData.\n\n // Asset data itself is encoded as follows:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 1 * 32 | function parameters: |\n // | | 4 | 12 + 20 | 1. token address |\n\n // We construct calldata for the `token.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 4 | | 1. from |\n // | | 36 | | 2. to |\n // | | 68 | | 3. amount |\n\n /////// Read token address from calldata ///////\n // * The token address is stored in `assetData`.\n //\n // * The \"offset to assetData\" is stored at offset 4 in the calldata (table 1).\n // [assetDataOffsetFromParams = calldataload(4)]\n //\n // * Notes that the \"offset to assetData\" is relative to the \"Params\" area of calldata;\n // add 4 bytes to account for the length of the \"Header\" area (table 1).\n // [assetDataOffsetFromHeader = assetDataOffsetFromParams + 4]\n //\n // * The \"token address\" is offset 32+4=36 bytes into \"assetData\" (tables 1 & 2).\n // [tokenOffset = assetDataOffsetFromHeader + 36 = calldataload(4) + 4 + 36]\n let token := calldataload(add(calldataload(4), 40))\n \n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFrom` selector.\n // Any trailing data in transferFromSelector will be\n // overwritten in the next `mstore` call.\n mstore(0, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // We copy the fields `from`, `to` and `amount` in bulk\n // from our own calldata to the new calldata.\n calldatacopy(4, 36, 96)\n\n /////// Call `token.transferFrom` using the calldata ///////\n let success := call(\n gas, // forward all gas\n token, // call address of token contract\n 0, // don't send any ETH\n 0, // pointer to start of input\n 100, // length of input\n 0, // write output over input\n 32 // output size should be 32 bytes\n )\n\n /////// Check return data. ///////\n // If there is no return data, we assume the token incorrectly\n // does not return a bool. In this case we expect it to revert\n // on failure, which was handled above.\n // If the token does return data, we require that it is a single\n // nonzero 32 bytes value.\n // So the transfer succeeded if the call succeeded and either\n // returned nothing, or returned a non-zero 32 byte value. \n success := and(success, or(\n iszero(returndatasize),\n and(\n eq(returndatasize, 32),\n gt(mload(0), 0)\n )\n ))\n if success {\n return(0, 0)\n }\n \n // Revert with `Error(\"TRANSFER_FAILED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // Revert if undefined function is called\n revert(0, 0)\n }\n }\n\n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4)\n {\n return PROXY_ID;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/ERC721Proxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MixinAuthorizable.sol\";\n\n\ncontract ERC721Proxy is\n MixinAuthorizable\n{\n // Id of this proxy.\n bytes4 constant internal PROXY_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n\n // solhint-disable-next-line payable-fallback\n function () \n external\n {\n assembly {\n // The first 4 bytes of calldata holds the function selector\n let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)\n\n // `transferFrom` will be called with the following parameters:\n // assetData Encoded byte array.\n // from Address to transfer asset from.\n // to Address to transfer asset to.\n // amount Amount of asset to transfer.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {\n\n // To lookup a value in a mapping, we load from the storage location keccak256(k, p),\n // where k is the key left padded to 32 bytes and p is the storage slot\n let start := mload(64)\n mstore(start, and(caller, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(start, 32), authorized_slot)\n\n // Revert if authorized[msg.sender] == false\n if iszero(sload(keccak256(start, 64))) {\n // Revert with `Error(\"SENDER_NOT_AUTHORIZED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // `transferFrom`.\n // The function is marked `external`, so no abi decodeding is done for\n // us. Instead, we expect the `calldata` memory to contain the\n // following:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n //\n // (*): offset is computed from start of function parameters, so offset\n // by an additional 4 bytes in the calldata.\n //\n // (**): see table below to compute length of assetData Contents\n //\n // WARNING: The ABIv2 specification allows additional padding between\n // the Params and Data section. This will result in a larger\n // offset to assetData.\n\n // Asset data itself is encoded as follows:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 2 * 32 | function parameters: |\n // | | 4 | 12 + 20 | 1. token address |\n // | | 36 | | 2. tokenId |\n \n // We construct calldata for the `token.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n // \n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 4 | | 1. from |\n // | | 36 | | 2. to |\n // | | 68 | | 3. tokenId |\n\n // There exists only 1 of each token.\n // require(amount == 1, \"INVALID_AMOUNT\")\n if sub(calldataload(100), 1) {\n // Revert with `Error(\"INVALID_AMOUNT\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000e494e56414c49445f414d4f554e540000000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFrom` selector.\n // Any trailing data in transferFromSelector will be\n // overwritten in the next `mstore` call.\n mstore(0, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // We copy the fields `from` and `to` in bulk\n // from our own calldata to the new calldata.\n calldatacopy(4, 36, 64)\n\n // Copy `tokenId` field from our own calldata to the new calldata.\n let assetDataOffset := calldataload(4)\n calldatacopy(68, add(assetDataOffset, 72), 32)\n\n /////// Call `token.transferFrom` using the calldata ///////\n let token := calldataload(add(assetDataOffset, 40))\n let success := call(\n gas, // forward all gas\n token, // call address of token contract\n 0, // don't send any ETH\n 0, // pointer to start of input\n 100, // length of input\n 0, // write output to null\n 0 // output size is 0 bytes\n )\n if success {\n return(0, 0)\n }\n \n // Revert with `Error(\"TRANSFER_FAILED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // Revert if undefined function is called\n revert(0, 0)\n }\n }\n\n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4)\n {\n return PROXY_ID;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/MixinAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"./mixins/MAuthorizable.sol\";\n\n\ncontract MixinAuthorizable is\n Ownable,\n MAuthorizable\n{\n /// @dev Only authorized addresses can invoke functions with this modifier.\n modifier onlyAuthorized {\n require(\n authorized[msg.sender],\n \"SENDER_NOT_AUTHORIZED\"\n );\n _;\n }\n\n mapping (address => bool) public authorized;\n address[] public authorities;\n\n /// @dev Authorizes an address.\n /// @param target Address to authorize.\n function addAuthorizedAddress(address target)\n external\n onlyOwner\n {\n require(\n !authorized[target],\n \"TARGET_ALREADY_AUTHORIZED\"\n );\n\n authorized[target] = true;\n authorities.push(target);\n emit AuthorizedAddressAdded(target, msg.sender);\n }\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n function removeAuthorizedAddress(address target)\n external\n onlyOwner\n {\n require(\n authorized[target],\n \"TARGET_NOT_AUTHORIZED\"\n );\n\n delete authorized[target];\n for (uint256 i = 0; i < authorities.length; i++) {\n if (authorities[i] == target) {\n authorities[i] = authorities[authorities.length - 1];\n authorities.length -= 1;\n break;\n }\n }\n emit AuthorizedAddressRemoved(target, msg.sender);\n }\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n /// @param index Index of target in authorities array.\n function removeAuthorizedAddressAtIndex(\n address target,\n uint256 index\n )\n external\n onlyOwner\n {\n require(\n authorized[target],\n \"TARGET_NOT_AUTHORIZED\"\n );\n require(\n index < authorities.length,\n \"INDEX_OUT_OF_BOUNDS\"\n );\n require(\n authorities[index] == target,\n \"AUTHORIZED_ADDRESS_MISMATCH\"\n );\n\n delete authorized[target];\n authorities[index] = authorities[authorities.length - 1];\n authorities.length -= 1;\n emit AuthorizedAddressRemoved(target, msg.sender);\n }\n\n /// @dev Gets all authorized addresses.\n /// @return Array of authorized addresses.\n function getAuthorizedAddresses()\n external\n view\n returns (address[] memory)\n {\n return authorities;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IAuthorizable.sol\";\n\n\ncontract IAssetProxy is\n IAuthorizable\n{\n /// @dev Transfers assets. Either succeeds or throws.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param from Address to transfer asset from.\n /// @param to Address to transfer asset to.\n /// @param amount Amount of asset to transfer.\n function transferFrom(\n bytes assetData,\n address from,\n address to,\n uint256 amount\n )\n external;\n \n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4);\n}\n",
- "2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/Ownable/IOwnable.sol\";\n\n\ncontract IAuthorizable is\n IOwnable\n{\n /// @dev Authorizes an address.\n /// @param target Address to authorize.\n function addAuthorizedAddress(address target)\n external;\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n function removeAuthorizedAddress(address target)\n external;\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n /// @param index Index of target in authorities array.\n function removeAuthorizedAddressAtIndex(\n address target,\n uint256 index\n )\n external;\n \n /// @dev Gets all authorized addresses.\n /// @return Array of authorized addresses.\n function getAuthorizedAddresses()\n external\n view\n returns (address[] memory);\n}\n",
- "2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAuthorizable.sol\";\n\n\ncontract MAuthorizable is\n IAuthorizable\n{\n // Event logged when a new address is authorized.\n event AuthorizedAddressAdded(\n address indexed target,\n address indexed caller\n );\n\n // Event logged when a currently authorized address is unauthorized.\n event AuthorizedAddressRemoved(\n address indexed target,\n address indexed caller\n );\n\n /// @dev Only authorized addresses can invoke functions with this modifier.\n modifier onlyAuthorized { revert(); _; }\n}\n",
- "2.0.0/protocol/AssetProxyOwner/AssetProxyOwner.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../multisig/MultiSigWalletWithTimeLock.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\n\n\ncontract AssetProxyOwner is\n MultiSigWalletWithTimeLock\n{\n using LibBytes for bytes;\n\n event AssetProxyRegistration(address assetProxyContract, bool isRegistered);\n\n // Mapping of AssetProxy contract address =>\n // if this contract is allowed to call the AssetProxy's `removeAuthorizedAddressAtIndex` method without a time lock.\n mapping (address => bool) public isAssetProxyRegistered;\n\n bytes4 constant internal REMOVE_AUTHORIZED_ADDRESS_AT_INDEX_SELECTOR = bytes4(keccak256(\"removeAuthorizedAddressAtIndex(address,uint256)\"));\n\n /// @dev Function will revert if the transaction does not call `removeAuthorizedAddressAtIndex`\n /// on an approved AssetProxy contract.\n modifier validRemoveAuthorizedAddressAtIndexTx(uint256 transactionId) {\n Transaction storage txn = transactions[transactionId];\n require(\n isAssetProxyRegistered[txn.destination],\n \"UNREGISTERED_ASSET_PROXY\"\n );\n require(\n txn.data.readBytes4(0) == REMOVE_AUTHORIZED_ADDRESS_AT_INDEX_SELECTOR,\n \"INVALID_FUNCTION_SELECTOR\"\n );\n _;\n }\n\n /// @dev Contract constructor sets initial owners, required number of confirmations,\n /// time lock, and list of AssetProxy addresses.\n /// @param _owners List of initial owners.\n /// @param _assetProxyContracts Array of AssetProxy contract addresses.\n /// @param _required Number of required confirmations.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n constructor (\n address[] memory _owners,\n address[] memory _assetProxyContracts,\n uint256 _required,\n uint256 _secondsTimeLocked\n )\n public\n MultiSigWalletWithTimeLock(_owners, _required, _secondsTimeLocked)\n {\n for (uint256 i = 0; i < _assetProxyContracts.length; i++) {\n address assetProxy = _assetProxyContracts[i];\n require(\n assetProxy != address(0),\n \"INVALID_ASSET_PROXY\"\n );\n isAssetProxyRegistered[assetProxy] = true;\n }\n }\n\n /// @dev Registers or deregisters an AssetProxy to be able to execute\n /// `removeAuthorizedAddressAtIndex` without a timelock.\n /// @param assetProxyContract Address of AssetProxy contract.\n /// @param isRegistered Status of approval for AssetProxy contract.\n function registerAssetProxy(address assetProxyContract, bool isRegistered)\n public\n onlyWallet\n notNull(assetProxyContract)\n {\n isAssetProxyRegistered[assetProxyContract] = isRegistered;\n emit AssetProxyRegistration(assetProxyContract, isRegistered);\n }\n\n /// @dev Allows execution of `removeAuthorizedAddressAtIndex` without time lock.\n /// @param transactionId Transaction ID.\n function executeRemoveAuthorizedAddressAtIndex(uint256 transactionId)\n public\n notExecuted(transactionId)\n fullyConfirmed(transactionId)\n validRemoveAuthorizedAddressAtIndexTx(transactionId)\n {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) {\n emit Execution(transactionId);\n } else {\n emit ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/Exchange.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./MixinExchangeCore.sol\";\nimport \"./MixinSignatureValidator.sol\";\nimport \"./MixinWrapperFunctions.sol\";\nimport \"./MixinAssetProxyDispatcher.sol\";\nimport \"./MixinTransactions.sol\";\nimport \"./MixinMatchOrders.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract Exchange is\n MixinExchangeCore,\n MixinMatchOrders,\n MixinSignatureValidator,\n MixinTransactions,\n MixinAssetProxyDispatcher,\n MixinWrapperFunctions\n{\n string constant public VERSION = \"2.0.1-alpha\";\n\n // Mixins are instantiated in the order they are inherited\n constructor (bytes memory _zrxAssetData)\n public\n LibConstants(_zrxAssetData) // @TODO: Remove when we deploy.\n MixinExchangeCore()\n MixinMatchOrders()\n MixinSignatureValidator()\n MixinTransactions()\n MixinAssetProxyDispatcher()\n MixinWrapperFunctions()\n {}\n}\n",
- "2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\nimport \"../AssetProxy/interfaces/IAssetProxy.sol\";\n\n\ncontract MixinAssetProxyDispatcher is\n Ownable,\n MAssetProxyDispatcher\n{\n // Mapping from Asset Proxy Id's to their respective Asset Proxy\n mapping (bytes4 => IAssetProxy) public assetProxies;\n\n /// @dev Registers an asset proxy to its asset proxy id.\n /// Once an asset proxy is registered, it cannot be unregistered.\n /// @param assetProxy Address of new asset proxy to register.\n function registerAssetProxy(address assetProxy)\n external\n onlyOwner\n {\n IAssetProxy assetProxyContract = IAssetProxy(assetProxy);\n\n // Ensure that no asset proxy exists with current id.\n bytes4 assetProxyId = assetProxyContract.getProxyId();\n address currentAssetProxy = assetProxies[assetProxyId];\n require(\n currentAssetProxy == address(0),\n \"ASSET_PROXY_ALREADY_EXISTS\"\n );\n\n // Add asset proxy and log registration.\n assetProxies[assetProxyId] = assetProxyContract;\n emit AssetProxyRegistered(\n assetProxyId,\n assetProxy\n );\n }\n\n /// @dev Gets an asset proxy.\n /// @param assetProxyId Id of the asset proxy.\n /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered.\n function getAssetProxy(bytes4 assetProxyId)\n external\n view\n returns (address)\n {\n return assetProxies[assetProxyId];\n }\n\n /// @dev Forwards arguments to assetProxy and calls `transferFrom`. Either succeeds or throws.\n /// @param assetData Byte array encoded for the asset.\n /// @param from Address to transfer token from.\n /// @param to Address to transfer token to.\n /// @param amount Amount of token to transfer.\n function dispatchTransferFrom(\n bytes memory assetData,\n address from,\n address to,\n uint256 amount\n )\n internal\n {\n // Do nothing if no amount should be transferred.\n if (amount > 0 && from != to) {\n // Ensure assetData length is valid\n require(\n assetData.length > 3,\n \"LENGTH_GREATER_THAN_3_REQUIRED\"\n );\n \n // Lookup assetProxy. We do not use `LibBytes.readBytes4` for gas efficiency reasons.\n bytes4 assetProxyId;\n assembly {\n assetProxyId := and(mload(\n add(assetData, 32)),\n 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000\n )\n }\n address assetProxy = assetProxies[assetProxyId];\n\n // Ensure that assetProxy exists\n require(\n assetProxy != address(0),\n \"ASSET_PROXY_DOES_NOT_EXIST\"\n );\n \n // We construct calldata for the `assetProxy.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n // \n // | Area | Offset | Length | Contents |\n // | -------- |--------|---------|-------------------------------------------- |\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n\n assembly {\n /////// Setup State ///////\n // `cdStart` is the start of the calldata for `assetProxy.transferFrom` (equal to free memory ptr).\n let cdStart := mload(64)\n // `dataAreaLength` is the total number of words needed to store `assetData`\n // As-per the ABI spec, this value is padded up to the nearest multiple of 32,\n // and includes 32-bytes for length.\n let dataAreaLength := and(add(mload(assetData), 63), 0xFFFFFFFFFFFE0)\n // `cdEnd` is the end of the calldata for `assetProxy.transferFrom`.\n let cdEnd := add(cdStart, add(132, dataAreaLength))\n\n \n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFromSelector`.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n mstore(cdStart, 0xa85e59e400000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // Each parameter is padded to 32-bytes. The entire Params Area is 128 bytes.\n // Notes:\n // 1. The offset to `assetData` is the length of the Params Area (128 bytes).\n // 2. A 20-byte mask is applied to addresses to zero-out the unused bytes.\n mstore(add(cdStart, 4), 128)\n mstore(add(cdStart, 36), and(from, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(cdStart, 68), and(to, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(cdStart, 100), amount)\n \n /////// Setup Data Area ///////\n // This area holds `assetData`.\n let dataArea := add(cdStart, 132)\n // solhint-disable-next-line no-empty-blocks\n for {} lt(dataArea, cdEnd) {} {\n mstore(dataArea, mload(assetData))\n dataArea := add(dataArea, 32)\n assetData := add(assetData, 32)\n }\n\n /////// Call `assetProxy.transferFrom` using the constructed calldata ///////\n let success := call(\n gas, // forward all gas\n assetProxy, // call address of asset proxy\n 0, // don't send any ETH\n cdStart, // pointer to start of input\n sub(cdEnd, cdStart), // length of input \n cdStart, // write output over input\n 512 // reserve 512 bytes for output\n )\n if iszero(success) {\n revert(cdStart, returndatasize())\n }\n }\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\n\n\ncontract MixinExchangeCore is\n ReentrancyGuard,\n LibConstants,\n LibMath,\n LibOrder,\n LibFillResults,\n MAssetProxyDispatcher,\n MExchangeCore,\n MSignatureValidator,\n MTransactions\n{\n // Mapping of orderHash => amount of takerAsset already bought by maker\n mapping (bytes32 => uint256) public filled;\n\n // Mapping of orderHash => cancelled\n mapping (bytes32 => bool) public cancelled;\n\n // Mapping of makerAddress => senderAddress => lowest salt an order can have in order to be fillable\n // Orders with specified senderAddress and with a salt less than their epoch are considered cancelled\n mapping (address => mapping (address => uint256)) public orderEpoch;\n\n /// @dev Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch\n /// and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress).\n /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled.\n function cancelOrdersUpTo(uint256 targetOrderEpoch)\n external\n nonReentrant\n {\n address makerAddress = getCurrentContextAddress();\n // If this function is called via `executeTransaction`, we only update the orderEpoch for the makerAddress/msg.sender combination.\n // This allows external filter contracts to add rules to how orders are cancelled via this function.\n address senderAddress = makerAddress == msg.sender ? address(0) : msg.sender;\n\n // orderEpoch is initialized to 0, so to cancelUpTo we need salt + 1\n uint256 newOrderEpoch = targetOrderEpoch + 1; \n uint256 oldOrderEpoch = orderEpoch[makerAddress][senderAddress];\n\n // Ensure orderEpoch is monotonically increasing\n require(\n newOrderEpoch > oldOrderEpoch, \n \"INVALID_NEW_ORDER_EPOCH\"\n );\n\n // Update orderEpoch\n orderEpoch[makerAddress][senderAddress] = newOrderEpoch;\n emit CancelUpTo(\n makerAddress,\n senderAddress,\n newOrderEpoch\n );\n }\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrder(\n Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n nonReentrant\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n return fillResults;\n }\n\n /// @dev After calling, the order can not be filled anymore.\n /// Throws if order is invalid or sender does not have permission to cancel.\n /// @param order Order to cancel. Order must be OrderStatus.FILLABLE.\n function cancelOrder(Order memory order)\n public\n nonReentrant\n {\n cancelOrderInternal(order);\n }\n\n /// @dev Gets information about an order: status, hash, and amount filled.\n /// @param order Order to gather information on.\n /// @return OrderInfo Information about the order and its state.\n /// See LibOrder.OrderInfo for a complete description.\n function getOrderInfo(Order memory order)\n public\n view\n returns (OrderInfo memory orderInfo)\n {\n // Compute the order hash\n orderInfo.orderHash = getOrderHash(order);\n\n // Fetch filled amount\n orderInfo.orderTakerAssetFilledAmount = filled[orderInfo.orderHash];\n\n // If order.makerAssetAmount is zero, we also reject the order.\n // While the Exchange contract handles them correctly, they create\n // edge cases in the supporting infrastructure because they have\n // an 'infinite' price when computed by a simple division.\n if (order.makerAssetAmount == 0) {\n orderInfo.orderStatus = uint8(OrderStatus.INVALID_MAKER_ASSET_AMOUNT);\n return orderInfo;\n }\n\n // If order.takerAssetAmount is zero, then the order will always\n // be considered filled because 0 == takerAssetAmount == orderTakerAssetFilledAmount\n // Instead of distinguishing between unfilled and filled zero taker\n // amount orders, we choose not to support them.\n if (order.takerAssetAmount == 0) {\n orderInfo.orderStatus = uint8(OrderStatus.INVALID_TAKER_ASSET_AMOUNT);\n return orderInfo;\n }\n\n // Validate order availability\n if (orderInfo.orderTakerAssetFilledAmount >= order.takerAssetAmount) {\n orderInfo.orderStatus = uint8(OrderStatus.FULLY_FILLED);\n return orderInfo;\n }\n\n // Validate order expiration\n // solhint-disable-next-line not-rely-on-time\n if (block.timestamp >= order.expirationTimeSeconds) {\n orderInfo.orderStatus = uint8(OrderStatus.EXPIRED);\n return orderInfo;\n }\n\n // Check if order has been cancelled\n if (cancelled[orderInfo.orderHash]) {\n orderInfo.orderStatus = uint8(OrderStatus.CANCELLED);\n return orderInfo;\n }\n if (orderEpoch[order.makerAddress][order.senderAddress] > order.salt) {\n orderInfo.orderStatus = uint8(OrderStatus.CANCELLED);\n return orderInfo;\n }\n\n // All other statuses are ruled out: order is Fillable\n orderInfo.orderStatus = uint8(OrderStatus.FILLABLE);\n return orderInfo;\n }\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderInternal(\n Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n // Fetch order info\n OrderInfo memory orderInfo = getOrderInfo(order);\n\n // Fetch taker address\n address takerAddress = getCurrentContextAddress();\n \n // Assert that the order is fillable by taker\n assertFillableOrder(\n order,\n orderInfo,\n takerAddress,\n signature\n );\n \n // Get amount of takerAsset to fill\n uint256 remainingTakerAssetAmount = safeSub(order.takerAssetAmount, orderInfo.orderTakerAssetFilledAmount);\n uint256 takerAssetFilledAmount = min256(takerAssetFillAmount, remainingTakerAssetAmount);\n\n // Validate context\n assertValidFill(\n order,\n orderInfo,\n takerAssetFillAmount,\n takerAssetFilledAmount,\n fillResults.makerAssetFilledAmount\n );\n\n // Compute proportional fill amounts\n fillResults = calculateFillResults(order, takerAssetFilledAmount);\n\n // Update exchange internal state\n updateFilledState(\n order,\n takerAddress,\n orderInfo.orderHash,\n orderInfo.orderTakerAssetFilledAmount,\n fillResults\n );\n \n // Settle order\n settleOrder(\n order,\n takerAddress,\n fillResults\n );\n\n return fillResults;\n }\n\n /// @dev After calling, the order can not be filled anymore.\n /// Throws if order is invalid or sender does not have permission to cancel.\n /// @param order Order to cancel. Order must be OrderStatus.FILLABLE.\n function cancelOrderInternal(Order memory order)\n internal\n {\n // Fetch current order status\n OrderInfo memory orderInfo = getOrderInfo(order);\n\n // Validate context\n assertValidCancel(order, orderInfo);\n\n // Perform cancel\n updateCancelledState(order, orderInfo.orderHash);\n }\n\n /// @dev Updates state with results of a fill order.\n /// @param order that was filled.\n /// @param takerAddress Address of taker who filled the order.\n /// @param orderTakerAssetFilledAmount Amount of order already filled.\n function updateFilledState(\n Order memory order,\n address takerAddress,\n bytes32 orderHash,\n uint256 orderTakerAssetFilledAmount,\n FillResults memory fillResults\n )\n internal\n {\n // Update state\n filled[orderHash] = safeAdd(orderTakerAssetFilledAmount, fillResults.takerAssetFilledAmount);\n\n // Log order\n emit Fill(\n order.makerAddress,\n order.feeRecipientAddress,\n takerAddress,\n msg.sender,\n fillResults.makerAssetFilledAmount,\n fillResults.takerAssetFilledAmount,\n fillResults.makerFeePaid,\n fillResults.takerFeePaid,\n orderHash,\n order.makerAssetData,\n order.takerAssetData\n );\n }\n\n /// @dev Updates state with results of cancelling an order.\n /// State is only updated if the order is currently fillable.\n /// Otherwise, updating state would have no effect.\n /// @param order that was cancelled.\n /// @param orderHash Hash of order that was cancelled.\n function updateCancelledState(\n Order memory order,\n bytes32 orderHash\n )\n internal\n {\n // Perform cancel\n cancelled[orderHash] = true;\n\n // Log cancel\n emit Cancel(\n order.makerAddress,\n order.feeRecipientAddress,\n msg.sender,\n orderHash,\n order.makerAssetData,\n order.takerAssetData\n );\n }\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAddress Address of order taker.\n /// @param signature Proof that the orders was created by its maker.\n function assertFillableOrder(\n Order memory order,\n OrderInfo memory orderInfo,\n address takerAddress,\n bytes memory signature\n )\n internal\n view\n {\n // An order can only be filled if its status is FILLABLE.\n require(\n orderInfo.orderStatus == uint8(OrderStatus.FILLABLE),\n \"ORDER_UNFILLABLE\"\n );\n \n // Validate sender is allowed to fill this order\n if (order.senderAddress != address(0)) {\n require(\n order.senderAddress == msg.sender,\n \"INVALID_SENDER\"\n );\n }\n \n // Validate taker is allowed to fill this order\n if (order.takerAddress != address(0)) {\n require(\n order.takerAddress == takerAddress,\n \"INVALID_TAKER\"\n );\n }\n \n // Validate Maker signature (check only if first time seen)\n if (orderInfo.orderTakerAssetFilledAmount == 0) {\n require(\n isValidSignature(\n orderInfo.orderHash,\n order.makerAddress,\n signature\n ),\n \"INVALID_ORDER_SIGNATURE\"\n );\n }\n }\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAssetFillAmount Desired amount of order to fill by taker.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @param makerAssetFilledAmount Amount of makerAsset that will be transfered.\n function assertValidFill(\n Order memory order,\n OrderInfo memory orderInfo,\n uint256 takerAssetFillAmount, // TODO: use FillResults\n uint256 takerAssetFilledAmount,\n uint256 makerAssetFilledAmount\n )\n internal\n view\n {\n // Revert if fill amount is invalid\n // TODO: reconsider necessity for v2.1\n require(\n takerAssetFillAmount != 0,\n \"INVALID_TAKER_AMOUNT\"\n );\n \n // Make sure taker does not pay more than desired amount\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n takerAssetFilledAmount <= takerAssetFillAmount,\n \"TAKER_OVERPAY\"\n );\n \n // Make sure order is not overfilled\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n safeAdd(orderInfo.orderTakerAssetFilledAmount, takerAssetFilledAmount) <= order.takerAssetAmount,\n \"ORDER_OVERFILL\"\n );\n \n // Make sure order is filled at acceptable price.\n // The order has an implied price from the makers perspective:\n // order price = order.makerAssetAmount / order.takerAssetAmount\n // i.e. the number of makerAsset maker is paying per takerAsset. The\n // maker is guaranteed to get this price or a better (lower) one. The\n // actual price maker is getting in this fill is:\n // fill price = makerAssetFilledAmount / takerAssetFilledAmount\n // We need `fill price <= order price` for the fill to be fair to maker.\n // This amounts to:\n // makerAssetFilledAmount order.makerAssetAmount\n // ------------------------ <= -----------------------\n // takerAssetFilledAmount order.takerAssetAmount\n // or, equivalently:\n // makerAssetFilledAmount * order.takerAssetAmount <=\n // order.makerAssetAmount * takerAssetFilledAmount\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n safeMul(makerAssetFilledAmount, order.takerAssetAmount)\n <= \n safeMul(order.makerAssetAmount, takerAssetFilledAmount),\n \"INVALID_FILL_PRICE\"\n );\n }\n\n /// @dev Validates context for cancelOrder. Succeeds or throws.\n /// @param order to be cancelled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n function assertValidCancel(\n Order memory order,\n OrderInfo memory orderInfo\n )\n internal\n view\n {\n // Ensure order is valid\n // An order can only be cancelled if its status is FILLABLE.\n require(\n orderInfo.orderStatus == uint8(OrderStatus.FILLABLE),\n \"ORDER_UNFILLABLE\"\n );\n\n // Validate sender is allowed to cancel this order\n if (order.senderAddress != address(0)) {\n require(\n order.senderAddress == msg.sender,\n \"INVALID_SENDER\"\n );\n }\n\n // Validate transaction signed by maker\n address makerAddress = getCurrentContextAddress();\n require(\n order.makerAddress == makerAddress,\n \"INVALID_MAKER\"\n );\n }\n\n /// @dev Calculates amounts filled and fees paid by maker and taker.\n /// @param order to be filled.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function calculateFillResults(\n Order memory order,\n uint256 takerAssetFilledAmount\n )\n internal\n pure\n returns (FillResults memory fillResults)\n {\n // Compute proportional transfer amounts\n fillResults.takerAssetFilledAmount = takerAssetFilledAmount;\n fillResults.makerAssetFilledAmount = safeGetPartialAmountFloor(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.makerAssetAmount\n );\n fillResults.makerFeePaid = safeGetPartialAmountFloor(\n fillResults.makerAssetFilledAmount,\n order.makerAssetAmount,\n order.makerFee\n );\n fillResults.takerFeePaid = safeGetPartialAmountFloor(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.takerFee\n );\n\n return fillResults;\n }\n\n /// @dev Settles an order by transferring assets between counterparties.\n /// @param order Order struct containing order specifications.\n /// @param takerAddress Address selling takerAsset and buying makerAsset.\n /// @param fillResults Amounts to be filled and fees paid by maker and taker.\n function settleOrder(\n LibOrder.Order memory order,\n address takerAddress,\n LibFillResults.FillResults memory fillResults\n )\n private\n {\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n dispatchTransferFrom(\n order.makerAssetData,\n order.makerAddress,\n takerAddress,\n fillResults.makerAssetFilledAmount\n );\n dispatchTransferFrom(\n order.takerAssetData,\n takerAddress,\n order.makerAddress,\n fillResults.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n zrxAssetData,\n order.makerAddress,\n order.feeRecipientAddress,\n fillResults.makerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n order.feeRecipientAddress,\n fillResults.takerFeePaid\n );\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinMatchOrders.sol": "/*\n Copyright 2018 ZeroEx Intl.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n http://www.apache.org/licenses/LICENSE-2.0\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MMatchOrders.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\n\n\ncontract MixinMatchOrders is\n ReentrancyGuard,\n LibConstants,\n LibMath,\n MAssetProxyDispatcher,\n MExchangeCore,\n MMatchOrders,\n MTransactions\n{\n /// @dev Match two complementary orders that have a profitable spread.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the left order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftSignature Proof that order was created by the left maker.\n /// @param rightSignature Proof that order was created by the right maker.\n /// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.\n function matchOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n bytes memory leftSignature,\n bytes memory rightSignature\n )\n public\n nonReentrant\n returns (LibFillResults.MatchedFillResults memory matchedFillResults)\n {\n // We assume that rightOrder.takerAssetData == leftOrder.makerAssetData and rightOrder.makerAssetData == leftOrder.takerAssetData.\n // If this assumption isn't true, the match will fail at signature validation.\n rightOrder.makerAssetData = leftOrder.takerAssetData;\n rightOrder.takerAssetData = leftOrder.makerAssetData;\n\n // Get left & right order info\n LibOrder.OrderInfo memory leftOrderInfo = getOrderInfo(leftOrder);\n LibOrder.OrderInfo memory rightOrderInfo = getOrderInfo(rightOrder);\n\n // Fetch taker address\n address takerAddress = getCurrentContextAddress();\n \n // Either our context is valid or we revert\n assertFillableOrder(\n leftOrder,\n leftOrderInfo,\n takerAddress,\n leftSignature\n );\n assertFillableOrder(\n rightOrder,\n rightOrderInfo,\n takerAddress,\n rightSignature\n );\n assertValidMatch(leftOrder, rightOrder);\n\n // Compute proportional fill amounts\n matchedFillResults = calculateMatchedFillResults(\n leftOrder,\n rightOrder,\n leftOrderInfo.orderTakerAssetFilledAmount,\n rightOrderInfo.orderTakerAssetFilledAmount\n );\n\n // Validate fill contexts\n assertValidFill(\n leftOrder,\n leftOrderInfo,\n matchedFillResults.left.takerAssetFilledAmount,\n matchedFillResults.left.takerAssetFilledAmount,\n matchedFillResults.left.makerAssetFilledAmount\n );\n assertValidFill(\n rightOrder,\n rightOrderInfo,\n matchedFillResults.right.takerAssetFilledAmount,\n matchedFillResults.right.takerAssetFilledAmount,\n matchedFillResults.right.makerAssetFilledAmount\n );\n \n // Update exchange state\n updateFilledState(\n leftOrder,\n takerAddress,\n leftOrderInfo.orderHash,\n leftOrderInfo.orderTakerAssetFilledAmount,\n matchedFillResults.left\n );\n updateFilledState(\n rightOrder,\n takerAddress,\n rightOrderInfo.orderHash,\n rightOrderInfo.orderTakerAssetFilledAmount,\n matchedFillResults.right\n );\n\n // Settle matched orders. Succeeds or throws.\n settleMatchedOrders(\n leftOrder,\n rightOrder,\n takerAddress,\n matchedFillResults\n );\n\n return matchedFillResults;\n }\n\n /// @dev Validates context for matchOrders. Succeeds or throws.\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n function assertValidMatch(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder\n )\n internal\n pure\n {\n // Make sure there is a profitable spread.\n // There is a profitable spread iff the cost per unit bought (OrderA.MakerAmount/OrderA.TakerAmount) for each order is greater\n // than the profit per unit sold of the matched order (OrderB.TakerAmount/OrderB.MakerAmount).\n // This is satisfied by the equations below:\n // <leftOrder.makerAssetAmount> / <leftOrder.takerAssetAmount> >= <rightOrder.takerAssetAmount> / <rightOrder.makerAssetAmount>\n // AND\n // <rightOrder.makerAssetAmount> / <rightOrder.takerAssetAmount> >= <leftOrder.takerAssetAmount> / <leftOrder.makerAssetAmount>\n // These equations can be combined to get the following:\n require(\n safeMul(leftOrder.makerAssetAmount, rightOrder.makerAssetAmount) >=\n safeMul(leftOrder.takerAssetAmount, rightOrder.takerAssetAmount),\n \"NEGATIVE_SPREAD_REQUIRED\"\n );\n }\n\n /// @dev Calculates fill amounts for the matched orders.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the leftOrder order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftOrderTakerAssetFilledAmount Amount of left order already filled.\n /// @param rightOrderTakerAssetFilledAmount Amount of right order already filled.\n /// @param matchedFillResults Amounts to fill and fees to pay by maker and taker of matched orders.\n function calculateMatchedFillResults(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n uint256 leftOrderTakerAssetFilledAmount,\n uint256 rightOrderTakerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.MatchedFillResults memory matchedFillResults)\n {\n // Derive maker asset amounts for left & right orders, given store taker assert amounts\n uint256 leftTakerAssetAmountRemaining = safeSub(leftOrder.takerAssetAmount, leftOrderTakerAssetFilledAmount);\n uint256 leftMakerAssetAmountRemaining = safeGetPartialAmountFloor(\n leftOrder.makerAssetAmount,\n leftOrder.takerAssetAmount,\n leftTakerAssetAmountRemaining\n );\n uint256 rightTakerAssetAmountRemaining = safeSub(rightOrder.takerAssetAmount, rightOrderTakerAssetFilledAmount);\n uint256 rightMakerAssetAmountRemaining = safeGetPartialAmountFloor(\n rightOrder.makerAssetAmount,\n rightOrder.takerAssetAmount,\n rightTakerAssetAmountRemaining\n );\n\n // Calculate fill results for maker and taker assets: at least one order will be fully filled.\n // The maximum amount the left maker can buy is `leftTakerAssetAmountRemaining`\n // The maximum amount the right maker can sell is `rightMakerAssetAmountRemaining`\n // We have two distinct cases for calculating the fill results:\n // Case 1.\n // If the left maker can buy more than the right maker can sell, then only the right order is fully filled.\n // If the left maker can buy exactly what the right maker can sell, then both orders are fully filled.\n // Case 2.\n // If the left maker cannot buy more than the right maker can sell, then only the left order is fully filled.\n if (leftTakerAssetAmountRemaining >= rightMakerAssetAmountRemaining) {\n // Case 1: Right order is fully filled\n matchedFillResults.right.makerAssetFilledAmount = rightMakerAssetAmountRemaining;\n matchedFillResults.right.takerAssetFilledAmount = rightTakerAssetAmountRemaining;\n matchedFillResults.left.takerAssetFilledAmount = matchedFillResults.right.makerAssetFilledAmount;\n // Round down to ensure the maker's exchange rate does not exceed the price specified by the order. \n // We favor the maker when the exchange rate must be rounded.\n matchedFillResults.left.makerAssetFilledAmount = safeGetPartialAmountFloor(\n leftOrder.makerAssetAmount,\n leftOrder.takerAssetAmount,\n matchedFillResults.left.takerAssetFilledAmount\n );\n } else {\n // Case 2: Left order is fully filled\n matchedFillResults.left.makerAssetFilledAmount = leftMakerAssetAmountRemaining;\n matchedFillResults.left.takerAssetFilledAmount = leftTakerAssetAmountRemaining;\n matchedFillResults.right.makerAssetFilledAmount = matchedFillResults.left.takerAssetFilledAmount;\n // Round up to ensure the maker's exchange rate does not exceed the price specified by the order.\n // We favor the maker when the exchange rate must be rounded.\n matchedFillResults.right.takerAssetFilledAmount = safeGetPartialAmountCeil(\n rightOrder.takerAssetAmount,\n rightOrder.makerAssetAmount,\n matchedFillResults.right.makerAssetFilledAmount\n );\n }\n\n // Calculate amount given to taker\n matchedFillResults.leftMakerAssetSpreadAmount = safeSub(\n matchedFillResults.left.makerAssetFilledAmount,\n matchedFillResults.right.takerAssetFilledAmount\n );\n\n // Compute fees for left order\n matchedFillResults.left.makerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.left.makerAssetFilledAmount,\n leftOrder.makerAssetAmount,\n leftOrder.makerFee\n );\n matchedFillResults.left.takerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.left.takerAssetFilledAmount,\n leftOrder.takerAssetAmount,\n leftOrder.takerFee\n );\n\n // Compute fees for right order\n matchedFillResults.right.makerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.right.makerAssetFilledAmount,\n rightOrder.makerAssetAmount,\n rightOrder.makerFee\n );\n matchedFillResults.right.takerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.right.takerAssetFilledAmount,\n rightOrder.takerAssetAmount,\n rightOrder.takerFee\n );\n\n // Return fill results\n return matchedFillResults;\n }\n\n /// @dev Settles matched order by transferring appropriate funds between order makers, taker, and fee recipient.\n /// @param leftOrder First matched order.\n /// @param rightOrder Second matched order.\n /// @param takerAddress Address that matched the orders. The taker receives the spread between orders as profit.\n /// @param matchedFillResults Struct holding amounts to transfer between makers, taker, and fee recipients.\n function settleMatchedOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n address takerAddress,\n LibFillResults.MatchedFillResults memory matchedFillResults\n )\n private\n {\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n // Order makers and taker\n dispatchTransferFrom(\n leftOrder.makerAssetData,\n leftOrder.makerAddress,\n rightOrder.makerAddress,\n matchedFillResults.right.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n rightOrder.makerAssetData,\n rightOrder.makerAddress,\n leftOrder.makerAddress,\n matchedFillResults.left.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n leftOrder.makerAssetData,\n leftOrder.makerAddress,\n takerAddress,\n matchedFillResults.leftMakerAssetSpreadAmount\n );\n\n // Maker fees\n dispatchTransferFrom(\n zrxAssetData,\n leftOrder.makerAddress,\n leftOrder.feeRecipientAddress,\n matchedFillResults.left.makerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n rightOrder.makerAddress,\n rightOrder.feeRecipientAddress,\n matchedFillResults.right.makerFeePaid\n );\n\n // Taker fees\n if (leftOrder.feeRecipientAddress == rightOrder.feeRecipientAddress) {\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n leftOrder.feeRecipientAddress,\n safeAdd(\n matchedFillResults.left.takerFeePaid,\n matchedFillResults.right.takerFeePaid\n )\n );\n } else {\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n leftOrder.feeRecipientAddress,\n matchedFillResults.left.takerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n rightOrder.feeRecipientAddress,\n matchedFillResults.right.takerFeePaid\n );\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinSignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./interfaces/IWallet.sol\";\nimport \"./interfaces/IValidator.sol\";\n\n\ncontract MixinSignatureValidator is\n ReentrancyGuard,\n MSignatureValidator,\n MTransactions\n{\n using LibBytes for bytes;\n \n // Mapping of hash => signer => signed\n mapping (bytes32 => mapping (address => bool)) public preSigned;\n\n // Mapping of signer => validator => approved\n mapping (address => mapping (address => bool)) public allowedValidators;\n\n /// @dev Approves a hash on-chain using any valid signature type.\n /// After presigning a hash, the preSign signature type will become valid for that hash and signer.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n function preSign(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external\n {\n if (signerAddress != msg.sender) {\n require(\n isValidSignature(\n hash,\n signerAddress,\n signature\n ),\n \"INVALID_SIGNATURE\"\n );\n }\n preSigned[hash][signerAddress] = true;\n }\n\n /// @dev Approves/unnapproves a Validator contract to verify signatures on signer's behalf.\n /// @param validatorAddress Address of Validator contract.\n /// @param approval Approval or disapproval of Validator contract.\n function setSignatureValidatorApproval(\n address validatorAddress,\n bool approval\n )\n external\n nonReentrant\n {\n address signerAddress = getCurrentContextAddress();\n allowedValidators[signerAddress][validatorAddress] = approval;\n emit SignatureValidatorApproval(\n signerAddress,\n validatorAddress,\n approval\n );\n }\n\n /// @dev Verifies that a hash has been signed by the given signer.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes memory signature\n )\n public\n view\n returns (bool isValid)\n {\n require(\n signature.length > 0,\n \"LENGTH_GREATER_THAN_0_REQUIRED\"\n );\n\n // Pop last byte off of signature byte array.\n uint8 signatureTypeRaw = uint8(signature.popLastByte());\n\n // Ensure signature is supported\n require(\n signatureTypeRaw < uint8(SignatureType.NSignatureTypes),\n \"SIGNATURE_UNSUPPORTED\"\n );\n\n SignatureType signatureType = SignatureType(signatureTypeRaw);\n\n // Variables are not scoped in Solidity.\n uint8 v;\n bytes32 r;\n bytes32 s;\n address recovered;\n\n // Always illegal signature.\n // This is always an implicit option since a signer can create a\n // signature array with invalid type or length. We may as well make\n // it an explicit option. This aids testing and analysis. It is\n // also the initialization value for the enum type.\n if (signatureType == SignatureType.Illegal) {\n revert(\"SIGNATURE_ILLEGAL\");\n\n // Always invalid signature.\n // Like Illegal, this is always implicitly available and therefore\n // offered explicitly. It can be implicitly created by providing\n // a correctly formatted but incorrect signature.\n } else if (signatureType == SignatureType.Invalid) {\n require(\n signature.length == 0,\n \"LENGTH_0_REQUIRED\"\n );\n isValid = false;\n return isValid;\n\n // Signature using EIP712\n } else if (signatureType == SignatureType.EIP712) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n hash,\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n\n // Signed using web3.eth_sign\n } else if (signatureType == SignatureType.EthSign) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n keccak256(abi.encodePacked(\n \"\\x19Ethereum Signed Message:\\n32\",\n hash\n )),\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n\n // Signature verified by wallet contract.\n // If used with an order, the maker of the order is the wallet contract.\n } else if (signatureType == SignatureType.Wallet) {\n isValid = isValidWalletSignature(\n hash,\n signerAddress,\n signature\n );\n return isValid;\n\n // Signature verified by validator contract.\n // If used with an order, the maker of the order can still be an EOA.\n // A signature using this type should be encoded as:\n // | Offset | Length | Contents |\n // | 0x00 | x | Signature to validate |\n // | 0x00 + x | 20 | Address of validator contract |\n // | 0x14 + x | 1 | Signature type is always \"\\x06\" |\n } else if (signatureType == SignatureType.Validator) {\n // Pop last 20 bytes off of signature byte array.\n address validatorAddress = signature.popLast20Bytes();\n \n // Ensure signer has approved validator.\n if (!allowedValidators[signerAddress][validatorAddress]) {\n return false;\n }\n isValid = isValidValidatorSignature(\n validatorAddress,\n hash,\n signerAddress,\n signature\n );\n return isValid;\n\n // Signer signed hash previously using the preSign function.\n } else if (signatureType == SignatureType.PreSigned) {\n isValid = preSigned[hash][signerAddress];\n return isValid;\n }\n\n // Anything else is illegal (We do not return false because\n // the signature may actually be valid, just not in a format\n // that we currently support. In this case returning false\n // may lead the caller to incorrectly believe that the\n // signature was invalid.)\n revert(\"SIGNATURE_UNSUPPORTED\");\n }\n\n /// @dev Verifies signature using logic defined by Wallet contract.\n /// @param hash Any 32 byte hash.\n /// @param walletAddress Address that should have signed the given hash\n /// and defines its own signature verification method.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if signature is valid for given wallet..\n function isValidWalletSignature(\n bytes32 hash,\n address walletAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid)\n {\n bytes memory calldata = abi.encodeWithSelector(\n IWallet(walletAddress).isValidSignature.selector,\n hash,\n signature\n );\n assembly {\n let cdStart := add(calldata, 32)\n let success := staticcall(\n gas, // forward all gas\n walletAddress, // address of Wallet contract\n cdStart, // pointer to start of input\n mload(calldata), // length of input\n cdStart, // write output over input\n 32 // output size is 32 bytes\n )\n\n switch success\n case 0 {\n // Revert with `Error(\"WALLET_ERROR\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000c57414c4c45545f4552524f5200000000000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n case 1 {\n // Signature is valid if call did not revert and returned true\n isValid := mload(cdStart)\n }\n }\n return isValid;\n }\n\n /// @dev Verifies signature using logic defined by Validator contract.\n /// @param validatorAddress Address of validator contract.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidValidatorSignature(\n address validatorAddress,\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid)\n {\n bytes memory calldata = abi.encodeWithSelector(\n IValidator(signerAddress).isValidSignature.selector,\n hash,\n signerAddress,\n signature\n );\n assembly {\n let cdStart := add(calldata, 32)\n let success := staticcall(\n gas, // forward all gas\n validatorAddress, // address of Validator contract\n cdStart, // pointer to start of input\n mload(calldata), // length of input\n cdStart, // write output over input\n 32 // output size is 32 bytes\n )\n\n switch success\n case 0 {\n // Revert with `Error(\"VALIDATOR_ERROR\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f56414c494441544f525f4552524f5200000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n case 1 {\n // Signature is valid if call did not revert and returned true\n isValid := mload(cdStart)\n }\n }\n return isValid;\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinTransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\nimport \"./libs/LibExchangeErrors.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./libs/LibEIP712.sol\";\n\n\ncontract MixinTransactions is\n LibEIP712,\n MSignatureValidator,\n MTransactions\n{\n // Mapping of transaction hash => executed\n // This prevents transactions from being executed more than once.\n mapping (bytes32 => bool) public transactions;\n\n // Address of current transaction signer\n address public currentContextAddress;\n\n /// @dev Executes an exchange method call in the context of signer.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @param signature Proof of signer transaction by signer.\n function executeTransaction(\n uint256 salt,\n address signerAddress,\n bytes data,\n bytes signature\n )\n external\n {\n // Prevent reentrancy\n require(\n currentContextAddress == address(0),\n \"REENTRANCY_ILLEGAL\"\n );\n\n bytes32 transactionHash = hashEIP712Message(hashZeroExTransaction(\n salt,\n signerAddress,\n data\n ));\n\n // Validate transaction has not been executed\n require(\n !transactions[transactionHash],\n \"INVALID_TX_HASH\"\n );\n\n // Transaction always valid if signer is sender of transaction\n if (signerAddress != msg.sender) {\n // Validate signature\n require(\n isValidSignature(\n transactionHash,\n signerAddress,\n signature\n ),\n \"INVALID_TX_SIGNATURE\"\n );\n\n // Set the current transaction signer\n currentContextAddress = signerAddress;\n }\n\n // Execute transaction\n transactions[transactionHash] = true;\n require(\n address(this).delegatecall(data),\n \"FAILED_EXECUTION\"\n );\n\n // Reset current transaction signer if it was previously updated\n if (signerAddress != msg.sender) {\n currentContextAddress = address(0);\n }\n }\n\n /// @dev Calculates EIP712 hash of the Transaction.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @return EIP712 hash of the Transaction.\n function hashZeroExTransaction(\n uint256 salt,\n address signerAddress,\n bytes memory data\n )\n internal\n pure\n returns (bytes32 result)\n {\n bytes32 schemaHash = EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH;\n bytes32 dataHash = keccak256(data);\n\n // Assembly for more efficiently computing:\n // keccak256(abi.encodePacked(\n // EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH,\n // salt,\n // bytes32(signerAddress),\n // keccak256(data)\n // ));\n\n assembly {\n // Load free memory pointer\n let memPtr := mload(64)\n\n mstore(memPtr, schemaHash) // hash of schema\n mstore(add(memPtr, 32), salt) // salt\n mstore(add(memPtr, 64), and(signerAddress, 0xffffffffffffffffffffffffffffffffffffffff)) // signerAddress\n mstore(add(memPtr, 96), dataHash) // hash of data\n\n // Compute hash\n result := keccak256(memPtr, 128)\n }\n return result;\n }\n\n /// @dev The current function will be called in the context of this address (either 0x transaction signer or `msg.sender`).\n /// If calling a fill function, this address will represent the taker.\n /// If calling a cancel function, this address will represent the maker.\n /// @return Signer of 0x transaction if entry point is `executeTransaction`.\n /// `msg.sender` if entry point is any other function.\n function getCurrentContextAddress()\n internal\n view\n returns (address)\n {\n address currentContextAddress_ = currentContextAddress;\n address contextAddress = currentContextAddress_ == address(0) ? msg.sender : currentContextAddress_;\n return contextAddress;\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./libs/LibAbiEncoder.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MWrapperFunctions.sol\";\n\n\ncontract MixinWrapperFunctions is\n ReentrancyGuard,\n LibMath,\n LibFillResults,\n LibAbiEncoder,\n MExchangeCore,\n MWrapperFunctions\n{\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n nonReentrant\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrKillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n return fillResults;\n }\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (FillResults memory fillResults)\n {\n // ABI encode calldata for `fillOrder`\n bytes memory fillOrderCalldata = abiEncodeFillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n\n // Delegate to `fillOrder` and handle any exceptions gracefully\n assembly {\n let success := delegatecall(\n gas, // forward all gas\n address, // call address of this contract\n add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes)\n mload(fillOrderCalldata), // length of input\n fillOrderCalldata, // write output over input\n 128 // output size is 128 bytes\n )\n if success {\n mstore(fillResults, mload(fillOrderCalldata))\n mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32)))\n mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64)))\n mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96)))\n }\n }\n // fillResults values will be 0 by default if call was unsuccessful\n return fillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrKill.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrKillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrKillOrderInternal(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrders(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n bytes memory takerAssetData = orders[0].takerAssetData;\n \n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being sold by taker is the same for each order.\n // Rather than passing this in as calldata, we use the takerAssetData from the first order in all later orders.\n orders[i].takerAssetData = takerAssetData;\n\n // Calculate the remaining amount of takerAsset to sell\n uint256 remainingTakerAssetFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= takerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory takerAssetData = orders[0].takerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being sold by taker is the same for each order.\n // Rather than passing this in as calldata, we use the takerAssetData from the first order in all later orders.\n orders[i].takerAssetData = takerAssetData;\n\n // Calculate the remaining amount of takerAsset to sell\n uint256 remainingTakerAssetFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= takerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerAsset is bought by taker.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrders(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // Rather than passing this in as calldata, we copy the makerAssetData from the first order onto all later orders.\n orders[i].makerAssetData = makerAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n if (totalFillResults.makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // Rather than passing this in as calldata, we copy the makerAssetData from the first order onto all later orders.\n orders[i].makerAssetData = makerAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n if (totalFillResults.makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously cancels multiple orders in a single transaction.\n /// @param orders Array of order specifications.\n function batchCancelOrders(LibOrder.Order[] memory orders)\n public\n nonReentrant\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n cancelOrderInternal(orders[i]);\n }\n }\n\n /// @dev Fetches information for all passed in orders.\n /// @param orders Array of order specifications.\n /// @return Array of OrderInfo instances that correspond to each order.\n function getOrdersInfo(LibOrder.Order[] memory orders)\n public\n view\n returns (LibOrder.OrderInfo[] memory)\n {\n uint256 ordersLength = orders.length;\n LibOrder.OrderInfo[] memory ordersInfo = new LibOrder.OrderInfo[](ordersLength);\n for (uint256 i = 0; i != ordersLength; i++) {\n ordersInfo[i] = getOrderInfo(orders[i]);\n }\n return ordersInfo;\n }\n\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n require(\n fillResults.takerAssetFilledAmount == takerAssetFillAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return fillResults;\n }\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IAssetProxyDispatcher {\n\n /// @dev Registers an asset proxy to its asset proxy id.\n /// Once an asset proxy is registered, it cannot be unregistered.\n /// @param assetProxy Address of new asset proxy to register.\n function registerAssetProxy(address assetProxy)\n external;\n\n /// @dev Gets an asset proxy.\n /// @param assetProxyId Id of the asset proxy.\n /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered.\n function getAssetProxy(bytes4 assetProxyId)\n external\n view\n returns (address);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IExchange.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./IExchangeCore.sol\";\nimport \"./IMatchOrders.sol\";\nimport \"./ISignatureValidator.sol\";\nimport \"./ITransactions.sol\";\nimport \"./IAssetProxyDispatcher.sol\";\nimport \"./IWrapperFunctions.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract IExchange is\n IExchangeCore,\n IMatchOrders,\n ISignatureValidator,\n ITransactions,\n IAssetProxyDispatcher,\n IWrapperFunctions\n{}\n",
- "2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IExchangeCore {\n\n /// @dev Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch\n /// and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress).\n /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled.\n function cancelOrdersUpTo(uint256 targetOrderEpoch)\n external;\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev After calling, the order can not be filled anymore.\n /// @param order Order struct containing order specifications.\n function cancelOrder(LibOrder.Order memory order)\n public;\n\n /// @dev Gets information about an order: status, hash, and amount filled.\n /// @param order Order to gather information on.\n /// @return OrderInfo Information about the order and its state.\n /// See LibOrder.OrderInfo for a complete description.\n function getOrderInfo(LibOrder.Order memory order)\n public\n view\n returns (LibOrder.OrderInfo memory orderInfo);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IMatchOrders {\n\n /// @dev Match two complementary orders that have a profitable spread.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the left order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftSignature Proof that order was created by the left maker.\n /// @param rightSignature Proof that order was created by the right maker.\n /// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.\n function matchOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n bytes memory leftSignature,\n bytes memory rightSignature\n )\n public\n returns (LibFillResults.MatchedFillResults memory matchedFillResults);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract ISignatureValidator {\n\n /// @dev Approves a hash on-chain using any valid signature type.\n /// After presigning a hash, the preSign signature type will become valid for that hash and signer.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n function preSign(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external;\n \n /// @dev Approves/unnapproves a Validator contract to verify signatures on signer's behalf.\n /// @param validatorAddress Address of Validator contract.\n /// @param approval Approval or disapproval of Validator contract.\n function setSignatureValidatorApproval(\n address validatorAddress,\n bool approval\n )\n external;\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signerAddress Address of signer.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes memory signature\n )\n public\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/ITransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\n\ncontract ITransactions {\n\n /// @dev Executes an exchange method call in the context of signer.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @param signature Proof of signer transaction by signer.\n function executeTransaction(\n uint256 salt,\n address signerAddress,\n bytes data,\n bytes signature\n )\n external;\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IValidator {\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IWallet.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IWallet {\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n bytes signature\n )\n external\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IWrapperFunctions {\n\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrKill.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrKillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrders(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerAsset is bought by taker.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrders(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously cancels multiple orders in a single transaction.\n /// @param orders Array of order specifications.\n function batchCancelOrders(LibOrder.Order[] memory orders)\n public;\n\n /// @dev Fetches information for all passed in orders\n /// @param orders Array of order specifications.\n /// @return Array of OrderInfo instances that correspond to each order.\n function getOrdersInfo(LibOrder.Order[] memory orders)\n public\n view\n returns (LibOrder.OrderInfo[] memory);\n}\n",
- "2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./LibOrder.sol\";\n\n\ncontract LibAbiEncoder {\n\n /// @dev ABI encodes calldata for `fillOrder`.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return ABI encoded calldata for `fillOrder`.\n function abiEncodeFillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n pure\n returns (bytes memory fillOrderCalldata)\n {\n // We need to call MExchangeCore.fillOrder using a delegatecall in\n // assembly so that we can intercept a call that throws. For this, we\n // need the input encoded in memory in the Ethereum ABIv2 format [1].\n\n // | Area | Offset | Length | Contents |\n // | -------- |--------|---------|-------------------------------------------- |\n // | Header | 0x00 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 0x00 | | 1. offset to order (*) |\n // | | 0x20 | | 2. takerAssetFillAmount |\n // | | 0x40 | | 3. offset to signature (*) |\n // | Data | | 12 * 32 | order: |\n // | | 0x000 | | 1. senderAddress |\n // | | 0x020 | | 2. makerAddress |\n // | | 0x040 | | 3. takerAddress |\n // | | 0x060 | | 4. feeRecipientAddress |\n // | | 0x080 | | 5. makerAssetAmount |\n // | | 0x0A0 | | 6. takerAssetAmount |\n // | | 0x0C0 | | 7. makerFeeAmount |\n // | | 0x0E0 | | 8. takerFeeAmount |\n // | | 0x100 | | 9. expirationTimeSeconds |\n // | | 0x120 | | 10. salt |\n // | | 0x140 | | 11. Offset to makerAssetData (*) |\n // | | 0x160 | | 12. Offset to takerAssetData (*) |\n // | | 0x180 | 32 | makerAssetData Length |\n // | | 0x1A0 | ** | makerAssetData Contents |\n // | | 0x1C0 | 32 | takerAssetData Length |\n // | | 0x1E0 | ** | takerAssetData Contents |\n // | | 0x200 | 32 | signature Length |\n // | | 0x220 | ** | signature Contents |\n\n // * Offsets are calculated from the beginning of the current area: Header, Params, Data:\n // An offset stored in the Params area is calculated from the beginning of the Params section.\n // An offset stored in the Data area is calculated from the beginning of the Data section.\n\n // ** The length of dynamic array contents are stored in the field immediately preceeding the contents.\n\n // [1]: https://solidity.readthedocs.io/en/develop/abi-spec.html\n\n assembly {\n\n // Areas below may use the following variables:\n // 1. <area>Start -- Start of this area in memory\n // 2. <area>End -- End of this area in memory. This value may\n // be precomputed (before writing contents),\n // or it may be computed as contents are written.\n // 3. <area>Offset -- Current offset into area. If an area's End\n // is precomputed, this variable tracks the\n // offsets of contents as they are written.\n\n /////// Setup Header Area ///////\n // Load free memory pointer\n fillOrderCalldata := mload(0x40)\n // bytes4(keccak256(\"fillOrder((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),uint256,bytes)\"))\n // = 0xb4be83d5\n // Leave 0x20 bytes to store the length\n mstore(add(fillOrderCalldata, 0x20), 0xb4be83d500000000000000000000000000000000000000000000000000000000)\n let headerAreaEnd := add(fillOrderCalldata, 0x24)\n\n /////// Setup Params Area ///////\n // This area is preallocated and written to later.\n // This is because we need to fill in offsets that have not yet been calculated.\n let paramsAreaStart := headerAreaEnd\n let paramsAreaEnd := add(paramsAreaStart, 0x60)\n let paramsAreaOffset := paramsAreaStart\n\n /////// Setup Data Area ///////\n let dataAreaStart := paramsAreaEnd\n let dataAreaEnd := dataAreaStart\n\n // Offset from the source data we're reading from\n let sourceOffset := order\n // arrayLenBytes and arrayLenWords track the length of a dynamically-allocated bytes array.\n let arrayLenBytes := 0\n let arrayLenWords := 0\n\n /////// Write order Struct ///////\n // Write memory location of Order, relative to the start of the\n // parameter list, then increment the paramsAreaOffset respectively.\n mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))\n paramsAreaOffset := add(paramsAreaOffset, 0x20)\n\n // Write values for each field in the order\n // It would be nice to use a loop, but we save on gas by writing\n // the stores sequentially.\n mstore(dataAreaEnd, mload(sourceOffset)) // makerAddress\n mstore(add(dataAreaEnd, 0x20), mload(add(sourceOffset, 0x20))) // takerAddress\n mstore(add(dataAreaEnd, 0x40), mload(add(sourceOffset, 0x40))) // feeRecipientAddress\n mstore(add(dataAreaEnd, 0x60), mload(add(sourceOffset, 0x60))) // senderAddress\n mstore(add(dataAreaEnd, 0x80), mload(add(sourceOffset, 0x80))) // makerAssetAmount\n mstore(add(dataAreaEnd, 0xA0), mload(add(sourceOffset, 0xA0))) // takerAssetAmount\n mstore(add(dataAreaEnd, 0xC0), mload(add(sourceOffset, 0xC0))) // makerFeeAmount\n mstore(add(dataAreaEnd, 0xE0), mload(add(sourceOffset, 0xE0))) // takerFeeAmount\n mstore(add(dataAreaEnd, 0x100), mload(add(sourceOffset, 0x100))) // expirationTimeSeconds\n mstore(add(dataAreaEnd, 0x120), mload(add(sourceOffset, 0x120))) // salt\n mstore(add(dataAreaEnd, 0x140), mload(add(sourceOffset, 0x140))) // Offset to makerAssetData\n mstore(add(dataAreaEnd, 0x160), mload(add(sourceOffset, 0x160))) // Offset to takerAssetData\n dataAreaEnd := add(dataAreaEnd, 0x180)\n sourceOffset := add(sourceOffset, 0x180)\n\n // Write offset to <order.makerAssetData>\n mstore(add(dataAreaStart, mul(10, 0x20)), sub(dataAreaEnd, dataAreaStart))\n\n // Calculate length of <order.makerAssetData>\n sourceOffset := mload(add(order, 0x140)) // makerAssetData\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of <order.makerAssetData>\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of <order.makerAssetData>\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n // Write offset to <order.takerAssetData>\n mstore(add(dataAreaStart, mul(11, 0x20)), sub(dataAreaEnd, dataAreaStart))\n\n // Calculate length of <order.takerAssetData>\n sourceOffset := mload(add(order, 0x160)) // takerAssetData\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of <order.takerAssetData>\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of <order.takerAssetData>\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n /////// Write takerAssetFillAmount ///////\n mstore(paramsAreaOffset, takerAssetFillAmount)\n paramsAreaOffset := add(paramsAreaOffset, 0x20)\n\n /////// Write signature ///////\n // Write offset to paramsArea\n mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))\n\n // Calculate length of signature\n sourceOffset := signature\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of signature\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of signature\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n // Set length of calldata\n mstore(fillOrderCalldata, sub(dataAreaEnd, add(fillOrderCalldata, 0x20)))\n\n // Increment free memory pointer\n mstore(0x40, dataAreaEnd)\n }\n\n return fillOrderCalldata;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibConstants.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\n// solhint-disable max-line-length\ncontract LibConstants {\n \n // Asset data for ZRX token. Used for fee transfers.\n // @TODO: Hardcode constant when we deploy. Currently \n // not constant to make testing easier.\n\n // The proxyId for ZRX_ASSET_DATA is bytes4(keccak256(\"ERC20Token(address)\")) = 0xf47261b0\n \n // Kovan ZRX address is 0x6ff6c0ff1d68b964901f986d4c9fa3ac68346570.\n // The ABI encoded proxyId and address is 0xf47261b00000000000000000000000006ff6c0ff1d68b964901f986d4c9fa3ac68346570\n // bytes constant public ZRX_ASSET_DATA = \"\\xf4\\x72\\x61\\xb0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x6f\\xf6\\xc0\\xff\\x1d\\x68\\xb9\\x64\\x90\\x1f\\x98\\x6d\\x4c\\x9f\\xa3\\xac\\x68\\x34\\x65\\x70\";\n \n // Mainnet ZRX address is 0xe41d2489571d322189246dafa5ebde1f4699f498.\n // The ABI encoded proxyId and address is 0xf47261b0000000000000000000000000e41d2489571d322189246dafa5ebde1f4699f498\n // bytes constant public ZRX_ASSET_DATA = \"\\xf4\\x72\\x61\\xb0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xe4\\x1d\\x24\\x89\\x57\\x1d\\x32\\x21\\x89\\x24\\x6d\\xaf\\xa5\\xeb\\xde\\x1f\\x46\\x99\\xf4\\x98\";\n \n // solhint-disable-next-line var-name-mixedcase\n bytes public ZRX_ASSET_DATA;\n\n // @TODO: Remove when we deploy.\n constructor (bytes memory zrxAssetData)\n public\n {\n ZRX_ASSET_DATA = zrxAssetData;\n }\n}\n// solhint-enable max-line-length\n",
- "2.0.0/protocol/Exchange/libs/LibEIP712.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract LibEIP712 {\n\n // EIP191 header for EIP712 prefix\n string constant internal EIP191_HEADER = \"\\x19\\x01\";\n\n // EIP712 Domain Name value\n string constant internal EIP712_DOMAIN_NAME = \"0x Protocol\";\n\n // EIP712 Domain Version value\n string constant internal EIP712_DOMAIN_VERSION = \"2\";\n\n // Hash of the EIP712 Domain Separator Schema\n bytes32 constant internal EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"EIP712Domain(\",\n \"string name,\",\n \"string version,\",\n \"address verifyingContract\",\n \")\"\n ));\n\n // Hash of the EIP712 Domain Separator data\n // solhint-disable-next-line var-name-mixedcase\n bytes32 public EIP712_DOMAIN_HASH;\n\n constructor ()\n public\n {\n EIP712_DOMAIN_HASH = keccak256(abi.encodePacked(\n EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH,\n keccak256(bytes(EIP712_DOMAIN_NAME)),\n keccak256(bytes(EIP712_DOMAIN_VERSION)),\n bytes32(address(this))\n ));\n }\n\n /// @dev Calculates EIP712 encoding for a hash struct in this EIP712 Domain.\n /// @param hashStruct The EIP712 hash struct.\n /// @return EIP712 hash applied to this EIP712 Domain.\n function hashEIP712Message(bytes32 hashStruct)\n internal\n view\n returns (bytes32 result)\n {\n bytes32 eip712DomainHash = EIP712_DOMAIN_HASH;\n\n // Assembly for more efficient computing:\n // keccak256(abi.encodePacked(\n // EIP191_HEADER,\n // EIP712_DOMAIN_HASH,\n // hashStruct \n // ));\n\n assembly {\n // Load free memory pointer\n let memPtr := mload(64)\n\n mstore(memPtr, 0x1901000000000000000000000000000000000000000000000000000000000000) // EIP191 header\n mstore(add(memPtr, 2), eip712DomainHash) // EIP712 domain hash\n mstore(add(memPtr, 34), hashStruct) // Hash of struct\n\n // Compute hash\n result := keccak256(memPtr, 66)\n }\n return result;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\n// solhint-disable\npragma solidity 0.4.24;\n\n\n/// @dev This contract documents the revert reasons used in the Exchange contract.\n/// This contract is intended to serve as a reference, but is not actually used for efficiency reasons.\ncontract LibExchangeErrors {\n\n /// Order validation errors ///\n string constant ORDER_UNFILLABLE = \"ORDER_UNFILLABLE\"; // Order cannot be filled.\n string constant INVALID_MAKER = \"INVALID_MAKER\"; // Invalid makerAddress.\n string constant INVALID_TAKER = \"INVALID_TAKER\"; // Invalid takerAddress.\n string constant INVALID_SENDER = \"INVALID_SENDER\"; // Invalid `msg.sender`.\n string constant INVALID_ORDER_SIGNATURE = \"INVALID_ORDER_SIGNATURE\"; // Signature validation failed. \n \n /// fillOrder validation errors ///\n string constant INVALID_TAKER_AMOUNT = \"INVALID_TAKER_AMOUNT\"; // takerAssetFillAmount cannot equal 0.\n string constant ROUNDING_ERROR = \"ROUNDING_ERROR\"; // Rounding error greater than 0.1% of takerAssetFillAmount. \n \n /// Signature validation errors ///\n string constant INVALID_SIGNATURE = \"INVALID_SIGNATURE\"; // Signature validation failed. \n string constant SIGNATURE_ILLEGAL = \"SIGNATURE_ILLEGAL\"; // Signature type is illegal.\n string constant SIGNATURE_UNSUPPORTED = \"SIGNATURE_UNSUPPORTED\"; // Signature type unsupported.\n \n /// cancelOrdersUptTo errors ///\n string constant INVALID_NEW_ORDER_EPOCH = \"INVALID_NEW_ORDER_EPOCH\"; // Specified salt must be greater than or equal to existing orderEpoch.\n\n /// fillOrKillOrder errors ///\n string constant COMPLETE_FILL_FAILED = \"COMPLETE_FILL_FAILED\"; // Desired takerAssetFillAmount could not be completely filled. \n\n /// matchOrders errors ///\n string constant NEGATIVE_SPREAD_REQUIRED = \"NEGATIVE_SPREAD_REQUIRED\"; // Matched orders must have a negative spread.\n\n /// Transaction errors ///\n string constant REENTRANCY_ILLEGAL = \"REENTRANCY_ILLEGAL\"; // Recursive reentrancy is not allowed. \n string constant INVALID_TX_HASH = \"INVALID_TX_HASH\"; // Transaction has already been executed. \n string constant INVALID_TX_SIGNATURE = \"INVALID_TX_SIGNATURE\"; // Signature validation failed. \n string constant FAILED_EXECUTION = \"FAILED_EXECUTION\"; // Transaction execution failed. \n \n /// registerAssetProxy errors ///\n string constant ASSET_PROXY_ALREADY_EXISTS = \"ASSET_PROXY_ALREADY_EXISTS\"; // AssetProxy with same id already exists.\n\n /// dispatchTransferFrom errors ///\n string constant ASSET_PROXY_DOES_NOT_EXIST = \"ASSET_PROXY_DOES_NOT_EXIST\"; // No assetProxy registered at given id.\n string constant TRANSFER_FAILED = \"TRANSFER_FAILED\"; // Asset transfer unsuccesful.\n\n /// Length validation errors ///\n string constant LENGTH_GREATER_THAN_0_REQUIRED = \"LENGTH_GREATER_THAN_0_REQUIRED\"; // Byte array must have a length greater than 0.\n string constant LENGTH_GREATER_THAN_3_REQUIRED = \"LENGTH_GREATER_THAN_3_REQUIRED\"; // Byte array must have a length greater than 3.\n string constant LENGTH_0_REQUIRED = \"LENGTH_0_REQUIRED\"; // Byte array must have a length of 0.\n string constant LENGTH_65_REQUIRED = \"LENGTH_65_REQUIRED\"; // Byte array must have a length of 65.\n}\n",
- "2.0.0/protocol/Exchange/libs/LibFillResults.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract LibFillResults is\n SafeMath\n{\n struct FillResults {\n uint256 makerAssetFilledAmount; // Total amount of makerAsset(s) filled.\n uint256 takerAssetFilledAmount; // Total amount of takerAsset(s) filled.\n uint256 makerFeePaid; // Total amount of ZRX paid by maker(s) to feeRecipient(s).\n uint256 takerFeePaid; // Total amount of ZRX paid by taker to feeRecipients(s).\n }\n\n struct MatchedFillResults {\n FillResults left; // Amounts filled and fees paid of left order.\n FillResults right; // Amounts filled and fees paid of right order.\n uint256 leftMakerAssetSpreadAmount; // Spread between price of left and right order, denominated in the left order's makerAsset, paid to taker.\n }\n\n /// @dev Adds properties of both FillResults instances.\n /// Modifies the first FillResults instance specified.\n /// @param totalFillResults Fill results instance that will be added onto.\n /// @param singleFillResults Fill results instance that will be added to totalFillResults.\n function addFillResults(FillResults memory totalFillResults, FillResults memory singleFillResults)\n internal\n pure\n {\n totalFillResults.makerAssetFilledAmount = safeAdd(totalFillResults.makerAssetFilledAmount, singleFillResults.makerAssetFilledAmount);\n totalFillResults.takerAssetFilledAmount = safeAdd(totalFillResults.takerAssetFilledAmount, singleFillResults.takerAssetFilledAmount);\n totalFillResults.makerFeePaid = safeAdd(totalFillResults.makerFeePaid, singleFillResults.makerFeePaid);\n totalFillResults.takerFeePaid = safeAdd(totalFillResults.takerFeePaid, singleFillResults.takerFeePaid);\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibMath.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract LibMath is\n SafeMath\n{\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// Reverts if rounding error is >= 0.1%\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded down.\n function safeGetPartialAmountFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n require(\n !isRoundingErrorFloor(\n numerator,\n denominator,\n target\n ),\n \"ROUNDING_ERROR\"\n );\n \n partialAmount = safeDiv(\n safeMul(numerator, target),\n denominator\n );\n return partialAmount;\n }\n\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// Reverts if rounding error is >= 0.1%\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded up.\n function safeGetPartialAmountCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n require(\n !isRoundingErrorCeil(\n numerator,\n denominator,\n target\n ),\n \"ROUNDING_ERROR\"\n );\n \n // safeDiv computes `floor(a / b)`. We use the identity (a, b integer):\n // ceil(a / b) = floor((a + b - 1) / b)\n // To implement `ceil(a / b)` using safeDiv.\n partialAmount = safeDiv(\n safeAdd(\n safeMul(numerator, target),\n safeSub(denominator, 1)\n ),\n denominator\n );\n return partialAmount;\n }\n\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded down.\n function getPartialAmountFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n partialAmount = safeDiv(\n safeMul(numerator, target),\n denominator\n );\n return partialAmount;\n }\n \n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded up.\n function getPartialAmountCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n // safeDiv computes `floor(a / b)`. We use the identity (a, b integer):\n // ceil(a / b) = floor((a + b - 1) / b)\n // To implement `ceil(a / b)` using safeDiv.\n partialAmount = safeDiv(\n safeAdd(\n safeMul(numerator, target),\n safeSub(denominator, 1)\n ),\n denominator\n );\n return partialAmount;\n }\n \n /// @dev Checks if rounding error >= 0.1% when rounding down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to multiply with numerator/denominator.\n /// @return Rounding error is present.\n function isRoundingErrorFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (bool isError)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n \n // The absolute rounding error is the difference between the rounded\n // value and the ideal value. The relative rounding error is the\n // absolute rounding error divided by the absolute value of the\n // ideal value. This is undefined when the ideal value is zero.\n //\n // The ideal value is `numerator * target / denominator`.\n // Let's call `numerator * target % denominator` the remainder.\n // The absolute error is `remainder / denominator`.\n //\n // When the ideal value is zero, we require the absolute error to\n // be zero. Fortunately, this is always the case. The ideal value is\n // zero iff `numerator == 0` and/or `target == 0`. In this case the\n // remainder and absolute error are also zero. \n if (target == 0 || numerator == 0) {\n return false;\n }\n \n // Otherwise, we want the relative rounding error to be strictly\n // less than 0.1%.\n // The relative error is `remainder / (numerator * target)`.\n // We want the relative error less than 1 / 1000:\n // remainder / (numerator * denominator) < 1 / 1000\n // or equivalently:\n // 1000 * remainder < numerator * target\n // so we have a rounding error iff:\n // 1000 * remainder >= numerator * target\n uint256 remainder = mulmod(\n target,\n numerator,\n denominator\n );\n isError = safeMul(1000, remainder) >= safeMul(numerator, target);\n return isError;\n }\n \n /// @dev Checks if rounding error >= 0.1% when rounding up.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to multiply with numerator/denominator.\n /// @return Rounding error is present.\n function isRoundingErrorCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (bool isError)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n \n // See the comments in `isRoundingError`.\n if (target == 0 || numerator == 0) {\n // When either is zero, the ideal value and rounded value are zero\n // and there is no rounding error. (Although the relative error\n // is undefined.)\n return false;\n }\n // Compute remainder as before\n uint256 remainder = mulmod(\n target,\n numerator,\n denominator\n );\n remainder = safeSub(denominator, remainder) % denominator;\n isError = safeMul(1000, remainder) >= safeMul(numerator, target);\n return isError;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibOrder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./LibEIP712.sol\";\n\n\ncontract LibOrder is\n LibEIP712\n{\n // Hash for the EIP712 Order Schema\n bytes32 constant internal EIP712_ORDER_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"Order(\",\n \"address makerAddress,\",\n \"address takerAddress,\",\n \"address feeRecipientAddress,\",\n \"address senderAddress,\",\n \"uint256 makerAssetAmount,\",\n \"uint256 takerAssetAmount,\",\n \"uint256 makerFee,\",\n \"uint256 takerFee,\",\n \"uint256 expirationTimeSeconds,\",\n \"uint256 salt,\",\n \"bytes makerAssetData,\",\n \"bytes takerAssetData\",\n \")\"\n ));\n\n // A valid order remains fillable until it is expired, fully filled, or cancelled.\n // An order's state is unaffected by external factors, like account balances.\n enum OrderStatus {\n INVALID, // Default value\n INVALID_MAKER_ASSET_AMOUNT, // Order does not have a valid maker asset amount\n INVALID_TAKER_ASSET_AMOUNT, // Order does not have a valid taker asset amount\n FILLABLE, // Order is fillable\n EXPIRED, // Order has already expired\n FULLY_FILLED, // Order is fully filled\n CANCELLED // Order has been cancelled\n }\n\n // solhint-disable max-line-length\n struct Order {\n address makerAddress; // Address that created the order. \n address takerAddress; // Address that is allowed to fill the order. If set to 0, any address is allowed to fill the order. \n address feeRecipientAddress; // Address that will recieve fees when order is filled. \n address senderAddress; // Address that is allowed to call Exchange contract methods that affect this order. If set to 0, any address is allowed to call these methods.\n uint256 makerAssetAmount; // Amount of makerAsset being offered by maker. Must be greater than 0. \n uint256 takerAssetAmount; // Amount of takerAsset being bid on by maker. Must be greater than 0. \n uint256 makerFee; // Amount of ZRX paid to feeRecipient by maker when order is filled. If set to 0, no transfer of ZRX from maker to feeRecipient will be attempted.\n uint256 takerFee; // Amount of ZRX paid to feeRecipient by taker when order is filled. If set to 0, no transfer of ZRX from taker to feeRecipient will be attempted.\n uint256 expirationTimeSeconds; // Timestamp in seconds at which order expires. \n uint256 salt; // Arbitrary number to facilitate uniqueness of the order's hash. \n bytes makerAssetData; // Encoded data that can be decoded by a specified proxy contract when transferring makerAsset. The last byte references the id of this proxy.\n bytes takerAssetData; // Encoded data that can be decoded by a specified proxy contract when transferring takerAsset. The last byte references the id of this proxy.\n }\n // solhint-enable max-line-length\n\n struct OrderInfo {\n uint8 orderStatus; // Status that describes order's validity and fillability.\n bytes32 orderHash; // EIP712 hash of the order (see LibOrder.getOrderHash).\n uint256 orderTakerAssetFilledAmount; // Amount of order that has already been filled.\n }\n\n /// @dev Calculates Keccak-256 hash of the order.\n /// @param order The order structure.\n /// @return Keccak-256 EIP712 hash of the order.\n function getOrderHash(Order memory order)\n internal\n view\n returns (bytes32 orderHash)\n {\n orderHash = hashEIP712Message(hashOrder(order));\n return orderHash;\n }\n\n /// @dev Calculates EIP712 hash of the order.\n /// @param order The order structure.\n /// @return EIP712 hash of the order.\n function hashOrder(Order memory order)\n internal\n pure\n returns (bytes32 result)\n {\n bytes32 schemaHash = EIP712_ORDER_SCHEMA_HASH;\n bytes32 makerAssetDataHash = keccak256(order.makerAssetData);\n bytes32 takerAssetDataHash = keccak256(order.takerAssetData);\n\n // Assembly for more efficiently computing:\n // keccak256(abi.encodePacked(\n // EIP712_ORDER_SCHEMA_HASH,\n // bytes32(order.makerAddress),\n // bytes32(order.takerAddress),\n // bytes32(order.feeRecipientAddress),\n // bytes32(order.senderAddress),\n // order.makerAssetAmount,\n // order.takerAssetAmount,\n // order.makerFee,\n // order.takerFee,\n // order.expirationTimeSeconds,\n // order.salt,\n // keccak256(order.makerAssetData),\n // keccak256(order.takerAssetData)\n // ));\n\n assembly {\n // Calculate memory addresses that will be swapped out before hashing\n let pos1 := sub(order, 32)\n let pos2 := add(order, 320)\n let pos3 := add(order, 352)\n\n // Backup\n let temp1 := mload(pos1)\n let temp2 := mload(pos2)\n let temp3 := mload(pos3)\n \n // Hash in place\n mstore(pos1, schemaHash)\n mstore(pos2, makerAssetDataHash)\n mstore(pos3, takerAssetDataHash)\n result := keccak256(pos1, 416)\n \n // Restore\n mstore(pos1, temp1)\n mstore(pos2, temp2)\n mstore(pos3, temp3)\n }\n return result;\n }\n}\n",
- "2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAssetProxyDispatcher.sol\";\n\n\ncontract MAssetProxyDispatcher is\n IAssetProxyDispatcher\n{\n // Logs registration of new asset proxy\n event AssetProxyRegistered(\n bytes4 id, // Id of new registered AssetProxy.\n address assetProxy // Address of new registered AssetProxy.\n );\n\n /// @dev Forwards arguments to assetProxy and calls `transferFrom`. Either succeeds or throws.\n /// @param assetData Byte array encoded for the asset.\n /// @param from Address to transfer token from.\n /// @param to Address to transfer token to.\n /// @param amount Amount of token to transfer.\n function dispatchTransferFrom(\n bytes memory assetData,\n address from,\n address to,\n uint256 amount\n )\n internal;\n}\n",
- "2.0.0/protocol/Exchange/mixins/MExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IExchangeCore.sol\";\n\n\ncontract MExchangeCore is\n IExchangeCore\n{\n // Fill event is emitted whenever an order is filled.\n event Fill(\n address indexed makerAddress, // Address that created the order. \n address indexed feeRecipientAddress, // Address that received fees.\n address takerAddress, // Address that filled the order.\n address senderAddress, // Address that called the Exchange contract (msg.sender).\n uint256 makerAssetFilledAmount, // Amount of makerAsset sold by maker and bought by taker. \n uint256 takerAssetFilledAmount, // Amount of takerAsset sold by taker and bought by maker.\n uint256 makerFeePaid, // Amount of ZRX paid to feeRecipient by maker.\n uint256 takerFeePaid, // Amount of ZRX paid to feeRecipient by taker.\n bytes32 indexed orderHash, // EIP712 hash of order (see LibOrder.getOrderHash).\n bytes makerAssetData, // Encoded data specific to makerAsset. \n bytes takerAssetData // Encoded data specific to takerAsset.\n );\n\n // Cancel event is emitted whenever an individual order is cancelled.\n event Cancel(\n address indexed makerAddress, // Address that created the order. \n address indexed feeRecipientAddress, // Address that would have recieved fees if order was filled. \n address senderAddress, // Address that called the Exchange contract (msg.sender).\n bytes32 indexed orderHash, // EIP712 hash of order (see LibOrder.getOrderHash).\n bytes makerAssetData, // Encoded data specific to makerAsset. \n bytes takerAssetData // Encoded data specific to takerAsset.\n );\n\n // CancelUpTo event is emitted whenever `cancelOrdersUpTo` is executed succesfully.\n event CancelUpTo(\n address indexed makerAddress, // Orders cancelled must have been created by this address.\n address indexed senderAddress, // Orders cancelled must have a `senderAddress` equal to this address.\n uint256 orderEpoch // Orders with specified makerAddress and senderAddress with a salt less than this value are considered cancelled.\n );\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev After calling, the order can not be filled anymore.\n /// @param order Order struct containing order specifications.\n function cancelOrderInternal(LibOrder.Order memory order)\n internal;\n\n /// @dev Updates state with results of a fill order.\n /// @param order that was filled.\n /// @param takerAddress Address of taker who filled the order.\n /// @param orderTakerAssetFilledAmount Amount of order already filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function updateFilledState(\n LibOrder.Order memory order,\n address takerAddress,\n bytes32 orderHash,\n uint256 orderTakerAssetFilledAmount,\n LibFillResults.FillResults memory fillResults\n )\n internal;\n\n /// @dev Updates state with results of cancelling an order.\n /// State is only updated if the order is currently fillable.\n /// Otherwise, updating state would have no effect.\n /// @param order that was cancelled.\n /// @param orderHash Hash of order that was cancelled.\n function updateCancelledState(\n LibOrder.Order memory order,\n bytes32 orderHash\n )\n internal;\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAddress Address of order taker.\n /// @param signature Proof that the orders was created by its maker.\n function assertFillableOrder(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo,\n address takerAddress,\n bytes memory signature\n )\n internal\n view;\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo Status, orderHash, and amount already filled of order.\n /// @param takerAssetFillAmount Desired amount of order to fill by taker.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @param makerAssetFilledAmount Amount of makerAsset that will be transfered.\n function assertValidFill(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo,\n uint256 takerAssetFillAmount,\n uint256 takerAssetFilledAmount,\n uint256 makerAssetFilledAmount\n )\n internal\n view;\n\n /// @dev Validates context for cancelOrder. Succeeds or throws.\n /// @param order to be cancelled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n function assertValidCancel(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo\n )\n internal\n view;\n\n /// @dev Calculates amounts filled and fees paid by maker and taker.\n /// @param order to be filled.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function calculateFillResults(\n LibOrder.Order memory order,\n uint256 takerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.FillResults memory fillResults);\n\n}\n",
- "2.0.0/protocol/Exchange/mixins/MMatchOrders.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IMatchOrders.sol\";\n\n\ncontract MMatchOrders is\n IMatchOrders\n{\n /// @dev Validates context for matchOrders. Succeeds or throws.\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n function assertValidMatch(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder\n )\n internal\n pure;\n\n /// @dev Calculates fill amounts for the matched orders.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the leftOrder order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftOrderTakerAssetFilledAmount Amount of left order already filled.\n /// @param rightOrderTakerAssetFilledAmount Amount of right order already filled.\n /// @param matchedFillResults Amounts to fill and fees to pay by maker and taker of matched orders.\n function calculateMatchedFillResults(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n uint256 leftOrderTakerAssetFilledAmount,\n uint256 rightOrderTakerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.MatchedFillResults memory matchedFillResults);\n\n}\n",
- "2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/ISignatureValidator.sol\";\n\n\ncontract MSignatureValidator is\n ISignatureValidator\n{\n event SignatureValidatorApproval(\n address indexed signerAddress, // Address that approves or disapproves a contract to verify signatures.\n address indexed validatorAddress, // Address of signature validator contract.\n bool approved // Approval or disapproval of validator contract.\n );\n\n // Allowed signature types.\n enum SignatureType {\n Illegal, // 0x00, default value\n Invalid, // 0x01\n EIP712, // 0x02\n EthSign, // 0x03\n Wallet, // 0x04\n Validator, // 0x05\n PreSigned, // 0x06\n NSignatureTypes // 0x07, number of signature types. Always leave at end.\n }\n\n /// @dev Verifies signature using logic defined by Wallet contract.\n /// @param hash Any 32 byte hash.\n /// @param walletAddress Address that should have signed the given hash\n /// and defines its own signature verification method.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidWalletSignature(\n bytes32 hash,\n address walletAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid);\n\n /// @dev Verifies signature using logic defined by Validator contract.\n /// @param validatorAddress Address of validator contract.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidValidatorSignature(\n address validatorAddress,\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/mixins/MTransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\nimport \"../interfaces/ITransactions.sol\";\n\n\ncontract MTransactions is\n ITransactions\n{\n // Hash for the EIP712 ZeroEx Transaction Schema\n bytes32 constant internal EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"ZeroExTransaction(\",\n \"uint256 salt,\",\n \"address signerAddress,\",\n \"bytes data\",\n \")\"\n ));\n\n /// @dev Calculates EIP712 hash of the Transaction.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @return EIP712 hash of the Transaction.\n function hashZeroExTransaction(\n uint256 salt,\n address signerAddress,\n bytes memory data\n )\n internal\n pure\n returns (bytes32 result);\n\n /// @dev The current function will be called in the context of this address (either 0x transaction signer or `msg.sender`).\n /// If calling a fill function, this address will represent the taker.\n /// If calling a cancel function, this address will represent the maker.\n /// @return Signer of 0x transaction if entry point is `executeTransaction`.\n /// `msg.sender` if entry point is any other function.\n function getCurrentContextAddress()\n internal\n view\n returns (address);\n}\n",
- "2.0.0/protocol/Exchange/mixins/MWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IWrapperFunctions.sol\";\n\n\ncontract MWrapperFunctions is \n IWrapperFunctions\n{\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n}\n",
- "2.0.0/test/DummyERC20Token/DummyERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"../../tokens/ERC20Token/MintableERC20Token.sol\";\n\n\ncontract DummyERC20Token is \n Ownable,\n MintableERC20Token\n{\n string public name;\n string public symbol;\n uint256 public decimals;\n uint256 public constant MAX_MINT_AMOUNT = 10000000000000000000000;\n\n constructor (\n string _name,\n string _symbol,\n uint256 _decimals,\n uint256 _totalSupply\n )\n public\n {\n name = _name;\n symbol = _symbol;\n decimals = _decimals;\n _totalSupply = _totalSupply;\n balances[msg.sender] = _totalSupply;\n }\n\n /// @dev Sets the balance of target address\n /// @param _target Address or which balance will be updated\n /// @param _value New balance of target address\n function setBalance(address _target, uint256 _value)\n external\n onlyOwner\n {\n uint256 currBalance = balances[_target];\n if (_value < currBalance) {\n _totalSupply = safeSub(_totalSupply, safeSub(currBalance, _value));\n } else {\n _totalSupply = safeAdd(_totalSupply, safeSub(_value, currBalance));\n }\n balances[_target] = _value;\n }\n\n /// @dev Mints new tokens for sender\n /// @param _value Amount of tokens to mint\n function mint(uint256 _value)\n external\n {\n require(\n _value <= MAX_MINT_AMOUNT,\n \"VALUE_TOO_LARGE\"\n );\n\n _mint(msg.sender, _value);\n }\n}\n",
- "2.0.0/test/DummyERC721Token/DummyERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../tokens/ERC721Token/MintableERC721Token.sol\";\nimport \"../../utils/Ownable/Ownable.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract DummyERC721Token is\n Ownable,\n MintableERC721Token\n{\n string public name;\n string public symbol;\n\n constructor (\n string _name,\n string _symbol\n )\n public\n {\n name = _name;\n symbol = _symbol;\n }\n\n /// @dev Function to mint a new token\n /// Reverts if the given token ID already exists\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _tokenId ID of the token to be minted by the msg.sender \n function mint(address _to, uint256 _tokenId)\n external\n {\n _mint(_to, _tokenId);\n }\n\n /// @dev Function to burn a token\n /// Reverts if the given token ID doesn't exist or not called by contract owner\n /// @param _owner Owner of token with given token ID\n /// @param _tokenId ID of the token to be burned by the msg.sender\n function burn(address _owner, uint256 _tokenId)\n external\n onlyOwner\n {\n _burn(_owner, _tokenId);\n }\n}\n",
- "2.0.0/tokens/ERC20Token/ERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IERC20Token.sol\";\n\n\ncontract ERC20Token is\n IERC20Token\n{\n mapping (address => uint256) internal balances;\n mapping (address => mapping (address => uint256)) internal allowed;\n\n uint256 internal _totalSupply;\n\n /// @dev send `value` token to `to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transfer(address _to, uint256 _value)\n external\n returns (bool)\n {\n require(\n balances[msg.sender] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[msg.sender] -= _value;\n balances[_to] += _value;\n\n emit Transfer(\n msg.sender,\n _to,\n _value\n );\n\n return true;\n }\n\n /// @dev send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool)\n {\n require(\n balances[_from] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n allowed[_from][msg.sender] >= _value,\n \"ERC20_INSUFFICIENT_ALLOWANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[_to] += _value;\n balances[_from] -= _value;\n allowed[_from][msg.sender] -= _value;\n \n emit Transfer(\n _from,\n _to,\n _value\n );\n \n return true;\n }\n\n /// @dev `msg.sender` approves `_spender` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Always true if the call has enough gas to complete execution\n function approve(address _spender, uint256 _value)\n external\n returns (bool)\n {\n allowed[msg.sender][_spender] = _value;\n emit Approval(\n msg.sender,\n _spender,\n _value\n );\n return true;\n }\n\n /// @dev Query total supply of token\n /// @return Total supply of token\n function totalSupply()\n external\n view\n returns (uint256)\n {\n return _totalSupply;\n }\n\n /// @dev Query the balance of owner\n /// @param _owner The address from which the balance will be retrieved\n /// @return Balance of owner\n function balanceOf(address _owner)\n external\n view\n returns (uint256)\n {\n return balances[_owner];\n }\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender)\n external\n view\n returns (uint256)\n {\n return allowed[_owner][_spender];\n }\n}\n",
- "2.0.0/tokens/ERC20Token/IERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC20Token {\n\n // solhint-disable no-simple-event-func-name\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 _value\n );\n\n event Approval(\n address indexed _owner,\n address indexed _spender,\n uint256 _value\n );\n\n /// @dev send `value` token to `to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transfer(address _to, uint256 _value)\n external\n returns (bool);\n\n /// @dev send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool);\n \n /// @dev `msg.sender` approves `_spender` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Always true if the call has enough gas to complete execution\n function approve(address _spender, uint256 _value)\n external\n returns (bool);\n\n /// @dev Query total supply of token\n /// @return Total supply of token\n function totalSupply()\n external\n view\n returns (uint256);\n \n /// @param _owner The address from which the balance will be retrieved\n /// @return Balance of owner\n function balanceOf(address _owner)\n external\n view\n returns (uint256);\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender)\n external\n view\n returns (uint256);\n}\n",
- "2.0.0/tokens/ERC20Token/MintableERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/SafeMath/SafeMath.sol\";\nimport \"./UnlimitedAllowanceERC20Token.sol\";\n\n\ncontract MintableERC20Token is \n SafeMath,\n UnlimitedAllowanceERC20Token\n{\n /// @dev Mints new tokens\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _value Amount of tokens to mint\n function _mint(address _to, uint256 _value)\n internal\n {\n balances[_to] = safeAdd(_value, balances[_to]);\n _totalSupply = safeAdd(_totalSupply, _value);\n\n emit Transfer(\n address(0),\n _to,\n _value\n );\n }\n\n /// @dev Mints new tokens\n /// @param _owner Owner of tokens that will be burned\n /// @param _value Amount of tokens to burn\n function _burn(address _owner, uint256 _value)\n internal\n {\n balances[_owner] = safeSub(balances[_owner], _value);\n _totalSupply = safeSub(_totalSupply, _value);\n\n emit Transfer(\n _owner,\n address(0),\n _value\n );\n }\n}\n",
- "2.0.0/tokens/ERC20Token/UnlimitedAllowanceERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../ERC20Token/ERC20Token.sol\";\n\n\ncontract UnlimitedAllowanceERC20Token is\n ERC20Token\n{\n uint256 constant internal MAX_UINT = 2**256 - 1;\n\n /// @dev ERC20 transferFrom, modified such that an allowance of MAX_UINT represents an unlimited allowance. See https://github.com/ethereum/EIPs/issues/717\n /// @param _from Address to transfer from.\n /// @param _to Address to transfer to.\n /// @param _value Amount to transfer.\n /// @return Success of transfer.\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool)\n {\n uint256 allowance = allowed[_from][msg.sender];\n require(\n balances[_from] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n allowance >= _value,\n \"ERC20_INSUFFICIENT_ALLOWANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[_to] += _value;\n balances[_from] -= _value;\n if (allowance < MAX_UINT) {\n allowed[_from][msg.sender] -= _value;\n }\n\n emit Transfer(\n _from,\n _to,\n _value\n );\n\n return true;\n }\n}\n",
- "2.0.0/tokens/ERC721Token/ERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IERC721Token.sol\";\nimport \"./IERC721Receiver.sol\";\nimport \"../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract ERC721Token is\n IERC721Token,\n SafeMath\n{\n // Function selector for ERC721Receiver.onERC721Received\n // 0x150b7a02\n bytes4 constant internal ERC721_RECEIVED = bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"));\n\n // Mapping of tokenId => owner\n mapping (uint256 => address) internal owners;\n\n // Mapping of tokenId => approved address\n mapping (uint256 => address) internal approvals;\n\n // Mapping of owner => number of tokens owned\n mapping (address => uint256) internal balances;\n\n // Mapping of owner => operator => approved\n mapping (address => mapping (address => bool)) internal operatorApprovals;\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT. When transfer is complete, this function\n /// checks if `_to` is a smart contract (code size > 0). If so, it calls\n /// `onERC721Received` on `_to` and throws if the return value is not\n /// `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n /// @param _data Additional data with no specified format, sent in call to `_to`\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId,\n bytes _data\n )\n external\n {\n transferFrom(\n _from,\n _to,\n _tokenId\n );\n\n uint256 receiverCodeSize;\n assembly {\n receiverCodeSize := extcodesize(_to)\n }\n if (receiverCodeSize > 0) {\n bytes4 selector = IERC721Receiver(_to).onERC721Received(\n msg.sender,\n _from,\n _tokenId,\n _data\n );\n require(\n selector == ERC721_RECEIVED,\n \"ERC721_INVALID_SELECTOR\"\n );\n }\n }\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev This works identically to the other function with an extra data parameter,\n /// except this function just sets data to \"\".\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n external\n {\n transferFrom(\n _from,\n _to,\n _tokenId\n );\n\n uint256 receiverCodeSize;\n assembly {\n receiverCodeSize := extcodesize(_to)\n }\n if (receiverCodeSize > 0) {\n bytes4 selector = IERC721Receiver(_to).onERC721Received(\n msg.sender,\n _from,\n _tokenId,\n \"\"\n );\n require(\n selector == ERC721_RECEIVED,\n \"ERC721_INVALID_SELECTOR\"\n );\n }\n }\n\n /// @notice Change or reaffirm the approved address for an NFT\n /// @dev The zero address indicates there is no approved address.\n /// Throws unless `msg.sender` is the current NFT owner, or an authorized\n /// operator of the current owner.\n /// @param _approved The new approved NFT controller\n /// @param _tokenId The NFT to approve\n function approve(address _approved, uint256 _tokenId)\n external\n {\n address owner = ownerOf(_tokenId);\n require(\n msg.sender == owner || isApprovedForAll(owner, msg.sender),\n \"ERC721_INVALID_SENDER\"\n );\n\n approvals[_tokenId] = _approved;\n emit Approval(\n owner,\n _approved,\n _tokenId\n );\n }\n\n /// @notice Enable or disable approval for a third party (\"operator\") to manage\n /// all of `msg.sender`'s assets\n /// @dev Emits the ApprovalForAll event. The contract MUST allow\n /// multiple operators per owner.\n /// @param _operator Address to add to the set of authorized operators\n /// @param _approved True if the operator is approved, false to revoke approval\n function setApprovalForAll(address _operator, bool _approved)\n external\n {\n operatorApprovals[msg.sender][_operator] = _approved;\n emit ApprovalForAll(\n msg.sender,\n _operator,\n _approved\n );\n }\n \n /// @notice Count all NFTs assigned to an owner\n /// @dev NFTs assigned to the zero address are considered invalid, and this\n /// function throws for queries about the zero address.\n /// @param _owner An address for whom to query the balance\n /// @return The number of NFTs owned by `_owner`, possibly zero\n function balanceOf(address _owner)\n external\n view\n returns (uint256)\n {\n require(\n _owner != address(0),\n \"ERC721_ZERO_OWNER\"\n );\n return balances[_owner];\n }\n\n /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE\n /// TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE\n /// THEY MAY BE PERMANENTLY LOST\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function transferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n public\n {\n require(\n _to != address(0),\n \"ERC721_ZERO_TO_ADDRESS\"\n );\n\n address owner = ownerOf(_tokenId);\n require(\n _from == owner,\n \"ERC721_OWNER_MISMATCH\"\n );\n\n address spender = msg.sender;\n address approvedAddress = getApproved(_tokenId);\n require(\n spender == owner ||\n isApprovedForAll(owner, spender) ||\n approvedAddress == spender,\n \"ERC721_INVALID_SPENDER\"\n );\n\n if (approvedAddress != address(0)) {\n approvals[_tokenId] = address(0);\n }\n\n owners[_tokenId] = _to;\n balances[_from] = safeSub(balances[_from], 1);\n balances[_to] = safeAdd(balances[_to], 1);\n \n emit Transfer(\n _from,\n _to,\n _tokenId\n );\n }\n\n /// @notice Find the owner of an NFT\n /// @dev NFTs assigned to zero address are considered invalid, and queries\n /// about them do throw.\n /// @param _tokenId The identifier for an NFT\n /// @return The address of the owner of the NFT\n function ownerOf(uint256 _tokenId)\n public\n view\n returns (address)\n {\n address owner = owners[_tokenId];\n require(\n owner != address(0),\n \"ERC721_ZERO_OWNER\"\n );\n return owner;\n }\n\n /// @notice Get the approved address for a single NFT\n /// @dev Throws if `_tokenId` is not a valid NFT.\n /// @param _tokenId The NFT to find the approved address for\n /// @return The approved address for this NFT, or the zero address if there is none\n function getApproved(uint256 _tokenId)\n public\n view\n returns (address)\n {\n return approvals[_tokenId];\n }\n\n /// @notice Query if an address is an authorized operator for another address\n /// @param _owner The address that owns the NFTs\n /// @param _operator The address that acts on behalf of the owner\n /// @return True if `_operator` is an approved operator for `_owner`, false otherwise\n function isApprovedForAll(address _owner, address _operator)\n public\n view\n returns (bool)\n {\n return operatorApprovals[_owner][_operator];\n }\n}\n",
- "2.0.0/tokens/ERC721Token/IERC721Receiver.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC721Receiver {\n\n /// @notice Handle the receipt of an NFT\n /// @dev The ERC721 smart contract calls this function on the recipient\n /// after a `transfer`. This function MAY throw to revert and reject the\n /// transfer. Return of other than the magic value MUST result in the\n /// transaction being reverted.\n /// Note: the contract address is always the message sender.\n /// @param _operator The address which called `safeTransferFrom` function\n /// @param _from The address which previously owned the token\n /// @param _tokenId The NFT identifier which is being transferred\n /// @param _data Additional data with no specified format\n /// @return `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`\n /// unless throwing\n function onERC721Received(\n address _operator,\n address _from,\n uint256 _tokenId,\n bytes _data\n )\n external\n returns (bytes4);\n}\n",
- "2.0.0/tokens/ERC721Token/IERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC721Token {\n\n /// @dev This emits when ownership of any NFT changes by any mechanism.\n /// This event emits when NFTs are created (`from` == 0) and destroyed\n /// (`to` == 0). Exception: during contract creation, any number of NFTs\n /// may be created and assigned without emitting Transfer. At the time of\n /// any transfer, the approved address for that NFT (if any) is reset to none.\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 indexed _tokenId\n );\n\n /// @dev This emits when the approved address for an NFT is changed or\n /// reaffirmed. The zero address indicates there is no approved address.\n /// When a Transfer event emits, this also indicates that the approved\n /// address for that NFT (if any) is reset to none.\n event Approval(\n address indexed _owner,\n address indexed _approved,\n uint256 indexed _tokenId\n );\n\n /// @dev This emits when an operator is enabled or disabled for an owner.\n /// The operator can manage all NFTs of the owner.\n event ApprovalForAll(\n address indexed _owner,\n address indexed _operator,\n bool _approved\n );\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// perator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT. When transfer is complete, this function\n /// checks if `_to` is a smart contract (code size > 0). If so, it calls\n /// `onERC721Received` on `_to` and throws if the return value is not\n /// `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n /// @param _data Additional data with no specified format, sent in call to `_to`\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId,\n bytes _data\n )\n external;\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev This works identically to the other function with an extra data parameter,\n /// except this function just sets data to \"\".\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n external;\n\n /// @notice Change or reaffirm the approved address for an NFT\n /// @dev The zero address indicates there is no approved address.\n /// Throws unless `msg.sender` is the current NFT owner, or an authorized\n /// operator of the current owner.\n /// @param _approved The new approved NFT controller\n /// @param _tokenId The NFT to approve\n function approve(address _approved, uint256 _tokenId)\n external;\n\n /// @notice Enable or disable approval for a third party (\"operator\") to manage\n /// all of `msg.sender`'s assets\n /// @dev Emits the ApprovalForAll event. The contract MUST allow\n /// multiple operators per owner.\n /// @param _operator Address to add to the set of authorized operators\n /// @param _approved True if the operator is approved, false to revoke approval\n function setApprovalForAll(address _operator, bool _approved)\n external;\n\n /// @notice Count all NFTs assigned to an owner\n /// @dev NFTs assigned to the zero address are considered invalid, and this\n /// function throws for queries about the zero address.\n /// @param _owner An address for whom to query the balance\n /// @return The number of NFTs owned by `_owner`, possibly zero\n function balanceOf(address _owner)\n external\n view\n returns (uint256);\n\n /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE\n /// TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE\n /// THEY MAY BE PERMANENTLY LOST\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function transferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n public;\n\n /// @notice Find the owner of an NFT\n /// @dev NFTs assigned to zero address are considered invalid, and queries\n /// about them do throw.\n /// @param _tokenId The identifier for an NFT\n /// @return The address of the owner of the NFT\n function ownerOf(uint256 _tokenId)\n public\n view\n returns (address);\n\n /// @notice Get the approved address for a single NFT\n /// @dev Throws if `_tokenId` is not a valid NFT.\n /// @param _tokenId The NFT to find the approved address for\n /// @return The approved address for this NFT, or the zero address if there is none\n function getApproved(uint256 _tokenId) \n public\n view\n returns (address);\n \n /// @notice Query if an address is an authorized operator for another address\n /// @param _owner The address that owns the NFTs\n /// @param _operator The address that acts on behalf of the owner\n /// @return True if `_operator` is an approved operator for `_owner`, false otherwise\n function isApprovedForAll(address _owner, address _operator)\n public\n view\n returns (bool);\n}\n",
- "2.0.0/tokens/ERC721Token/MintableERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./ERC721Token.sol\";\n\n\ncontract MintableERC721Token is\n ERC721Token\n{\n /// @dev Function to mint a new token\n /// Reverts if the given token ID already exists\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _tokenId ID of the token to be minted by the msg.sender \n function _mint(address _to, uint256 _tokenId)\n internal\n {\n require(\n _to != address(0),\n \"ERC721_ZERO_TO_ADDRESS\"\n );\n\n address owner = owners[_tokenId];\n require(\n owner == address(0),\n \"ERC721_OWNER_ALREADY_EXISTS\"\n );\n\n owners[_tokenId] = _to;\n balances[_to] = safeAdd(balances[_to], 1);\n\n emit Transfer(\n address(0),\n _to,\n _tokenId\n );\n }\n\n /// @dev Function to burn a token\n /// Reverts if the given token ID doesn't exist\n /// @param _owner Owner of token with given token ID\n /// @param _tokenId ID of the token to be burned by the msg.sender\n function _burn(address _owner, uint256 _tokenId)\n internal\n {\n require(\n _owner != address(0),\n \"ERC721_ZERO_OWNER_ADDRESS\"\n );\n\n address owner = owners[_tokenId];\n require(\n owner == _owner,\n \"ERC721_OWNER_MISMATCH\"\n );\n\n owners[_tokenId] = address(0);\n balances[_owner] = safeSub(balances[_owner], 1);\n\n emit Transfer(\n _owner,\n address(0),\n _tokenId\n );\n }\n}\n",
- "2.0.0/tokens/EtherToken/IEtherToken.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../ERC20Token/IERC20Token.sol\";\n\n\ncontract IEtherToken is\n IERC20Token\n{\n function deposit()\n public\n payable;\n \n function withdraw(uint256 amount)\n public;\n}\n",
- "2.0.0/utils/LibBytes/LibBytes.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\nlibrary LibBytes {\n\n using LibBytes for bytes;\n\n /// @dev Gets the memory address for a byte array.\n /// @param input Byte array to lookup.\n /// @return memoryAddress Memory address of byte array. This\n /// points to the header of the byte array which contains\n /// the length.\n function rawAddress(bytes memory input)\n internal\n pure\n returns (uint256 memoryAddress)\n {\n assembly {\n memoryAddress := input\n }\n return memoryAddress;\n }\n \n /// @dev Gets the memory address for the contents of a byte array.\n /// @param input Byte array to lookup.\n /// @return memoryAddress Memory address of the contents of the byte array.\n function contentAddress(bytes memory input)\n internal\n pure\n returns (uint256 memoryAddress)\n {\n assembly {\n memoryAddress := add(input, 32)\n }\n return memoryAddress;\n }\n\n /// @dev Copies `length` bytes from memory location `source` to `dest`.\n /// @param dest memory address to copy bytes to.\n /// @param source memory address to copy bytes from.\n /// @param length number of bytes to copy.\n function memCopy(\n uint256 dest,\n uint256 source,\n uint256 length\n )\n internal\n pure\n {\n if (length < 32) {\n // Handle a partial word by reading destination and masking\n // off the bits we are interested in.\n // This correctly handles overlap, zero lengths and source == dest\n assembly {\n let mask := sub(exp(256, sub(32, length)), 1)\n let s := and(mload(source), not(mask))\n let d := and(mload(dest), mask)\n mstore(dest, or(s, d))\n }\n } else {\n // Skip the O(length) loop when source == dest.\n if (source == dest) {\n return;\n }\n\n // For large copies we copy whole words at a time. The final\n // word is aligned to the end of the range (instead of after the\n // previous) to handle partial words. So a copy will look like this:\n //\n // ####\n // ####\n // ####\n // ####\n //\n // We handle overlap in the source and destination range by\n // changing the copying direction. This prevents us from\n // overwriting parts of source that we still need to copy.\n //\n // This correctly handles source == dest\n //\n if (source > dest) {\n assembly {\n // We subtract 32 from `sEnd` and `dEnd` because it\n // is easier to compare with in the loop, and these\n // are also the addresses we need for copying the\n // last bytes.\n length := sub(length, 32)\n let sEnd := add(source, length)\n let dEnd := add(dest, length)\n\n // Remember the last 32 bytes of source\n // This needs to be done here and not after the loop\n // because we may have overwritten the last bytes in\n // source already due to overlap.\n let last := mload(sEnd)\n\n // Copy whole words front to back\n // Note: the first check is always true,\n // this could have been a do-while loop.\n // solhint-disable-next-line no-empty-blocks\n for {} lt(source, sEnd) {} {\n mstore(dest, mload(source))\n source := add(source, 32)\n dest := add(dest, 32)\n }\n \n // Write the last 32 bytes\n mstore(dEnd, last)\n }\n } else {\n assembly {\n // We subtract 32 from `sEnd` and `dEnd` because those\n // are the starting points when copying a word at the end.\n length := sub(length, 32)\n let sEnd := add(source, length)\n let dEnd := add(dest, length)\n\n // Remember the first 32 bytes of source\n // This needs to be done here and not after the loop\n // because we may have overwritten the first bytes in\n // source already due to overlap.\n let first := mload(source)\n\n // Copy whole words back to front\n // We use a signed comparisson here to allow dEnd to become\n // negative (happens when source and dest < 32). Valid\n // addresses in local memory will never be larger than\n // 2**255, so they can be safely re-interpreted as signed.\n // Note: the first check is always true,\n // this could have been a do-while loop.\n // solhint-disable-next-line no-empty-blocks\n for {} slt(dest, dEnd) {} {\n mstore(dEnd, mload(sEnd))\n sEnd := sub(sEnd, 32)\n dEnd := sub(dEnd, 32)\n }\n \n // Write the first 32 bytes\n mstore(dest, first)\n }\n }\n }\n }\n\n /// @dev Returns a slices from a byte array.\n /// @param b The byte array to take a slice from.\n /// @param from The starting index for the slice (inclusive).\n /// @param to The final index for the slice (exclusive).\n /// @return result The slice containing bytes at indices [from, to)\n function slice(\n bytes memory b,\n uint256 from,\n uint256 to\n )\n internal\n pure\n returns (bytes memory result)\n {\n require(\n from <= to,\n \"FROM_LESS_THAN_TO_REQUIRED\"\n );\n require(\n to < b.length,\n \"TO_LESS_THAN_LENGTH_REQUIRED\"\n );\n \n // Create a new bytes structure and copy contents\n result = new bytes(to - from);\n memCopy(\n result.contentAddress(),\n b.contentAddress() + from,\n result.length\n );\n return result;\n }\n \n /// @dev Returns a slice from a byte array without preserving the input.\n /// @param b The byte array to take a slice from. Will be destroyed in the process.\n /// @param from The starting index for the slice (inclusive).\n /// @param to The final index for the slice (exclusive).\n /// @return result The slice containing bytes at indices [from, to)\n /// @dev When `from == 0`, the original array will match the slice. In other cases its state will be corrupted.\n function sliceDestructive(\n bytes memory b,\n uint256 from,\n uint256 to\n )\n internal\n pure\n returns (bytes memory result)\n {\n require(\n from <= to,\n \"FROM_LESS_THAN_TO_REQUIRED\"\n );\n require(\n to < b.length,\n \"TO_LESS_THAN_LENGTH_REQUIRED\"\n );\n \n // Create a new bytes structure around [from, to) in-place.\n assembly {\n result := add(b, from)\n mstore(result, sub(to, from))\n }\n return result;\n }\n\n /// @dev Pops the last byte off of a byte array by modifying its length.\n /// @param b Byte array that will be modified.\n /// @return The byte that was popped off.\n function popLastByte(bytes memory b)\n internal\n pure\n returns (bytes1 result)\n {\n require(\n b.length > 0,\n \"GREATER_THAN_ZERO_LENGTH_REQUIRED\"\n );\n\n // Store last byte.\n result = b[b.length - 1];\n\n assembly {\n // Decrement length of byte array.\n let newLen := sub(mload(b), 1)\n mstore(b, newLen)\n }\n return result;\n }\n\n /// @dev Pops the last 20 bytes off of a byte array by modifying its length.\n /// @param b Byte array that will be modified.\n /// @return The 20 byte address that was popped off.\n function popLast20Bytes(bytes memory b)\n internal\n pure\n returns (address result)\n {\n require(\n b.length >= 20,\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Store last 20 bytes.\n result = readAddress(b, b.length - 20);\n\n assembly {\n // Subtract 20 from byte array length.\n let newLen := sub(mload(b), 20)\n mstore(b, newLen)\n }\n return result;\n }\n\n /// @dev Tests equality of two byte arrays.\n /// @param lhs First byte array to compare.\n /// @param rhs Second byte array to compare.\n /// @return True if arrays are the same. False otherwise.\n function equals(\n bytes memory lhs,\n bytes memory rhs\n )\n internal\n pure\n returns (bool equal)\n {\n // Keccak gas cost is 30 + numWords * 6. This is a cheap way to compare.\n // We early exit on unequal lengths, but keccak would also correctly\n // handle this.\n return lhs.length == rhs.length && keccak256(lhs) == keccak256(rhs);\n }\n\n /// @dev Reads an address from a position in a byte array.\n /// @param b Byte array containing an address.\n /// @param index Index in byte array of address.\n /// @return address from byte array.\n function readAddress(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (address result)\n {\n require(\n b.length >= index + 20, // 20 is length of address\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Add offset to index:\n // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)\n // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)\n index += 20;\n\n // Read address from array memory\n assembly {\n // 1. Add index to address of bytes array\n // 2. Load 32-byte word from memory\n // 3. Apply 20-byte mask to obtain address\n result := and(mload(add(b, index)), 0xffffffffffffffffffffffffffffffffffffffff)\n }\n return result;\n }\n\n /// @dev Writes an address into a specific position in a byte array.\n /// @param b Byte array to insert address into.\n /// @param index Index in byte array of address.\n /// @param input Address to put into byte array.\n function writeAddress(\n bytes memory b,\n uint256 index,\n address input\n )\n internal\n pure\n {\n require(\n b.length >= index + 20, // 20 is length of address\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Add offset to index:\n // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)\n // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)\n index += 20;\n\n // Store address into array memory\n assembly {\n // The address occupies 20 bytes and mstore stores 32 bytes.\n // First fetch the 32-byte word where we'll be storing the address, then\n // apply a mask so we have only the bytes in the word that the address will not occupy.\n // Then combine these bytes with the address and store the 32 bytes back to memory with mstore.\n\n // 1. Add index to address of bytes array\n // 2. Load 32-byte word from memory\n // 3. Apply 12-byte mask to obtain extra bytes occupying word of memory where we'll store the address\n let neighbors := and(\n mload(add(b, index)),\n 0xffffffffffffffffffffffff0000000000000000000000000000000000000000\n )\n \n // Make sure input address is clean.\n // (Solidity does not guarantee this)\n input := and(input, 0xffffffffffffffffffffffffffffffffffffffff)\n\n // Store the neighbors and address into memory\n mstore(add(b, index), xor(input, neighbors))\n }\n }\n\n /// @dev Reads a bytes32 value from a position in a byte array.\n /// @param b Byte array containing a bytes32 value.\n /// @param index Index in byte array of bytes32 value.\n /// @return bytes32 value from byte array.\n function readBytes32(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes32 result)\n {\n require(\n b.length >= index + 32,\n \"GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 256 bit length parameter\n index += 32;\n\n // Read the bytes32 from array memory\n assembly {\n result := mload(add(b, index))\n }\n return result;\n }\n\n /// @dev Writes a bytes32 into a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input bytes32 to put into byte array.\n function writeBytes32(\n bytes memory b,\n uint256 index,\n bytes32 input\n )\n internal\n pure\n {\n require(\n b.length >= index + 32,\n \"GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 256 bit length parameter\n index += 32;\n\n // Read the bytes32 from array memory\n assembly {\n mstore(add(b, index), input)\n }\n }\n\n /// @dev Reads a uint256 value from a position in a byte array.\n /// @param b Byte array containing a uint256 value.\n /// @param index Index in byte array of uint256 value.\n /// @return uint256 value from byte array.\n function readUint256(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (uint256 result)\n {\n result = uint256(readBytes32(b, index));\n return result;\n }\n\n /// @dev Writes a uint256 into a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input uint256 to put into byte array.\n function writeUint256(\n bytes memory b,\n uint256 index,\n uint256 input\n )\n internal\n pure\n {\n writeBytes32(b, index, bytes32(input));\n }\n\n /// @dev Reads an unpadded bytes4 value from a position in a byte array.\n /// @param b Byte array containing a bytes4 value.\n /// @param index Index in byte array of bytes4 value.\n /// @return bytes4 value from byte array.\n function readBytes4(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes4 result)\n {\n require(\n b.length >= index + 4,\n \"GREATER_OR_EQUAL_TO_4_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 32 byte length field\n index += 32;\n\n // Read the bytes4 from array memory\n assembly {\n result := mload(add(b, index))\n // Solidity does not require us to clean the trailing bytes.\n // We do it anyway\n result := and(result, 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000)\n }\n return result;\n }\n\n /// @dev Reads nested bytes from a specific position.\n /// @dev NOTE: the returned value overlaps with the input value.\n /// Both should be treated as immutable.\n /// @param b Byte array containing nested bytes.\n /// @param index Index of nested bytes.\n /// @return result Nested bytes.\n function readBytesWithLength(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes memory result)\n {\n // Read length of nested bytes\n uint256 nestedBytesLength = readUint256(b, index);\n index += 32;\n\n // Assert length of <b> is valid, given\n // length of nested bytes\n require(\n b.length >= index + nestedBytesLength,\n \"GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED\"\n );\n \n // Return a pointer to the byte array as it exists inside `b`\n assembly {\n result := add(b, index)\n }\n return result;\n }\n\n /// @dev Inserts bytes at a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input bytes to insert.\n function writeBytesWithLength(\n bytes memory b,\n uint256 index,\n bytes memory input\n )\n internal\n pure\n {\n // Assert length of <b> is valid, given\n // length of input\n require(\n b.length >= index + 32 + input.length, // 32 bytes to store length\n \"GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED\"\n );\n\n // Copy <input> into <b>\n memCopy(\n b.contentAddress() + index,\n input.rawAddress(), // includes length of <input>\n input.length + 32 // +32 bytes to store <input> length\n );\n }\n\n /// @dev Performs a deep copy of a byte array onto another byte array of greater than or equal length.\n /// @param dest Byte array that will be overwritten with source bytes.\n /// @param source Byte array to copy onto dest bytes.\n function deepCopyBytes(\n bytes memory dest,\n bytes memory source\n )\n internal\n pure\n {\n uint256 sourceLen = source.length;\n // Dest length must be >= source length, or some bytes would not be copied.\n require(\n dest.length >= sourceLen,\n \"GREATER_OR_EQUAL_TO_SOURCE_BYTES_LENGTH_REQUIRED\"\n );\n memCopy(\n dest.contentAddress(),\n source.contentAddress(),\n sourceLen\n );\n }\n}\n",
- "2.0.0/utils/Ownable/IOwnable.sol": "pragma solidity 0.4.24;\n\n\ncontract IOwnable {\n\n function transferOwnership(address newOwner)\n public;\n}\n",
- "2.0.0/utils/Ownable/Ownable.sol": "pragma solidity 0.4.24;\n\nimport \"./IOwnable.sol\";\n\n\ncontract Ownable is\n IOwnable\n{\n address public owner;\n\n constructor ()\n public\n {\n owner = msg.sender;\n }\n\n modifier onlyOwner() {\n require(\n msg.sender == owner,\n \"ONLY_CONTRACT_OWNER\"\n );\n _;\n }\n\n function transferOwnership(address newOwner)\n public\n onlyOwner\n {\n if (newOwner != address(0)) {\n owner = newOwner;\n }\n }\n}\n",
- "2.0.0/utils/ReentrancyGuard/ReentrancyGuard.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract ReentrancyGuard {\n\n // Locked state of mutex\n bool private locked = false;\n\n /// @dev Functions with this modifer cannot be reentered. The mutex will be locked\n /// before function execution and unlocked after.\n modifier nonReentrant() {\n // Ensure mutex is unlocked\n require(\n !locked,\n \"REENTRANCY_ILLEGAL\"\n );\n\n // Lock mutex before function call\n locked = true;\n\n // Perform function call\n _;\n\n // Unlock mutex after function call\n locked = false;\n }\n}\n",
- "2.0.0/utils/SafeMath/SafeMath.sol": "pragma solidity 0.4.24;\n\n\ncontract SafeMath {\n\n function safeMul(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n if (a == 0) {\n return 0;\n }\n uint256 c = a * b;\n require(\n c / a == b,\n \"UINT256_OVERFLOW\"\n );\n return c;\n }\n\n function safeDiv(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n uint256 c = a / b;\n return c;\n }\n\n function safeSub(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n require(\n b <= a,\n \"UINT256_UNDERFLOW\"\n );\n return a - b;\n }\n\n function safeAdd(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n uint256 c = a + b;\n require(\n c >= a,\n \"UINT256_OVERFLOW\"\n );\n return c;\n }\n\n function max64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n\n function max256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n}\n"
- },
- "sourceTreeHashHex": "0x61b379850639517b46c6d60f6c12c18bf568c6d475f90938b2653446bd018009",
- "compiler": {
- "name": "solc",
- "version": "soljson-v0.4.24+commit.e67f0147.js",
- "settings": {
- "optimizer": {
- "enabled": true,
- "runs": 1000000
- },
- "outputSelection": {
- "*": {
- "*": [
- "abi",
- "evm.bytecode.object",
- "evm.bytecode.sourceMap",
- "evm.deployedBytecode.object",
- "evm.deployedBytecode.sourceMap"
- ]
- }
- }
- }
- },
- "networks": {
- "3": {
- "address": "0xb1408f4c245a23c31b98d2c626777d4c0d766caa",
- "links": {},
- "constructorArgs": "[]"
- },
- "42": {
- "address": "0xf1ec01d6236d3cd881a0bf0130ea25fe4234003e",
- "links": {},
- "constructorArgs": "[]"
- },
- "50": {
- "address": "0x1dc4c1cefef38a777b15aa20260a54e584b16c48",
- "links": {},
- "constructorArgs": "[]"
- }
- }
-}
diff --git a/packages/migrations/artifacts/2.0.0-testnet/ERC20Token.json b/packages/migrations/artifacts/2.0.0-testnet/ERC20Token.json
deleted file mode 100644
index 11ec4b57a..000000000
--- a/packages/migrations/artifacts/2.0.0-testnet/ERC20Token.json
+++ /dev/null
@@ -1,486 +0,0 @@
-{
- "schemaVersion": "2.0.0",
- "contractName": "ERC20Token",
- "compilerOutput": {
- "abi": [
- {
- "constant": false,
- "inputs": [
- {
- "name": "_spender",
- "type": "address"
- },
- {
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "approve",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "totalSupply",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_from",
- "type": "address"
- },
- {
- "name": "_to",
- "type": "address"
- },
- {
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "transferFrom",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "_owner",
- "type": "address"
- }
- ],
- "name": "balanceOf",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_to",
- "type": "address"
- },
- {
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "transfer",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "_owner",
- "type": "address"
- },
- {
- "name": "_spender",
- "type": "address"
- }
- ],
- "name": "allowance",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "_from",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "_to",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "Transfer",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "_owner",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "_spender",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "Approval",
- "type": "event"
- }
- ],
- "evm": {
- "bytecode": {
- "linkReferences": {},
- "object": "0x608060405234801561001057600080fd5b506106a0806100206000396000f3006080604052600436106100775763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663095ea7b3811461007c57806318160ddd146100c157806323b872dd146100e857806370a082311461011f578063a9059cbb1461014d578063dd62ed3e1461017e575b600080fd5b34801561008857600080fd5b506100ad73ffffffffffffffffffffffffffffffffffffffff600435166024356101b2565b604080519115158252519081900360200190f35b3480156100cd57600080fd5b506100d6610225565b60408051918252519081900360200190f35b3480156100f457600080fd5b506100ad73ffffffffffffffffffffffffffffffffffffffff6004358116906024351660443561022b565b34801561012b57600080fd5b506100d673ffffffffffffffffffffffffffffffffffffffff60043516610487565b34801561015957600080fd5b506100ad73ffffffffffffffffffffffffffffffffffffffff600435166024356104af565b34801561018a57600080fd5b506100d673ffffffffffffffffffffffffffffffffffffffff6004358116906024351661063c565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60025490565b73ffffffffffffffffffffffffffffffffffffffff83166000908152602081905260408120548211156102bf57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f45524332305f494e53554646494349454e545f42414c414e4345000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8416600090815260016020908152604080832033845290915290205482111561035e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f45524332305f494e53554646494349454e545f414c4c4f57414e434500000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205482810110156103f457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f55494e543235365f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff80841660008181526020818152604080832080548801905593881680835284832080548890039055600182528483203384528252918490208054879003905583518681529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35060019392505050565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b3360009081526020819052604081205482111561052d57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f45524332305f494e53554646494349454e545f42414c414e4345000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205482810110156105c357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f55494e543235365f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b336000818152602081815260408083208054879003905573ffffffffffffffffffffffffffffffffffffffff871680845292819020805487019055805186815290519293927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a350600192915050565b73ffffffffffffffffffffffffffffffffffffffff9182166000908152600160209081526040808320939094168252919091522054905600a165627a7a72305820203a592c9390a8a005821d7dffa1c27ae97bf827d8ef17cfee3a8a70776b22d90029",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x6A0 DUP1 PUSH2 0x20 PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN STOP PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x77 JUMPI PUSH4 0xFFFFFFFF PUSH29 0x100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD DIV AND PUSH4 0x95EA7B3 DUP2 EQ PUSH2 0x7C JUMPI DUP1 PUSH4 0x18160DDD EQ PUSH2 0xC1 JUMPI DUP1 PUSH4 0x23B872DD EQ PUSH2 0xE8 JUMPI DUP1 PUSH4 0x70A08231 EQ PUSH2 0x11F JUMPI DUP1 PUSH4 0xA9059CBB EQ PUSH2 0x14D JUMPI DUP1 PUSH4 0xDD62ED3E EQ PUSH2 0x17E JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x88 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x1B2 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 ISZERO ISZERO DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xCD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xD6 PUSH2 0x225 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xF4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH1 0x44 CALLDATALOAD PUSH2 0x22B JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x12B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xD6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x487 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x159 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x4AF JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x18A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xD6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH2 0x63C JUMP JUMPDEST CALLER PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 AND DUP1 DUP6 MSTORE SWAP1 DUP4 MSTORE DUP2 DUP5 KECCAK256 DUP7 SWAP1 SSTORE DUP2 MLOAD DUP7 DUP2 MSTORE SWAP2 MLOAD SWAP4 SWAP5 SWAP1 SWAP4 SWAP1 SWAP3 PUSH32 0x8C5BE1E5EBEC7D5BD14F71427D1E84F3DD0314C0F7B2291E5B200AC8C7C3B925 SWAP3 DUP3 SWAP1 SUB ADD SWAP1 LOG3 POP PUSH1 0x1 SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x2 SLOAD SWAP1 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 DUP2 KECCAK256 SLOAD DUP3 GT ISZERO PUSH2 0x2BF JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x1A PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x45524332305F494E53554646494349454E545F42414C414E4345000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 CALLER DUP5 MSTORE SWAP1 SWAP2 MSTORE SWAP1 KECCAK256 SLOAD DUP3 GT ISZERO PUSH2 0x35E JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x1C PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x45524332305F494E53554646494349454E545F414C4C4F57414E434500000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP3 DUP2 ADD LT ISZERO PUSH2 0x3F4 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x10 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x55494E543235365F4F564552464C4F5700000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP5 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x20 DUP2 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 DUP1 SLOAD DUP9 ADD SWAP1 SSTORE SWAP4 DUP9 AND DUP1 DUP4 MSTORE DUP5 DUP4 KECCAK256 DUP1 SLOAD DUP9 SWAP1 SUB SWAP1 SSTORE PUSH1 0x1 DUP3 MSTORE DUP5 DUP4 KECCAK256 CALLER DUP5 MSTORE DUP3 MSTORE SWAP2 DUP5 SWAP1 KECCAK256 DUP1 SLOAD DUP8 SWAP1 SUB SWAP1 SSTORE DUP4 MLOAD DUP7 DUP2 MSTORE SWAP4 MLOAD SWAP3 SWAP4 SWAP2 SWAP3 PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF SWAP3 DUP2 SWAP1 SUB SWAP1 SWAP2 ADD SWAP1 LOG3 POP PUSH1 0x1 SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD SWAP1 JUMP JUMPDEST CALLER PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 DUP2 KECCAK256 SLOAD DUP3 GT ISZERO PUSH2 0x52D JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x1A PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x45524332305F494E53554646494349454E545F42414C414E4345000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP3 DUP2 ADD LT ISZERO PUSH2 0x5C3 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x10 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x55494E543235365F4F564552464C4F5700000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST CALLER PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x20 DUP2 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 DUP1 SLOAD DUP8 SWAP1 SUB SWAP1 SSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 AND DUP1 DUP5 MSTORE SWAP3 DUP2 SWAP1 KECCAK256 DUP1 SLOAD DUP8 ADD SWAP1 SSTORE DUP1 MLOAD DUP7 DUP2 MSTORE SWAP1 MLOAD SWAP3 SWAP4 SWAP3 PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF SWAP3 SWAP2 DUP2 SWAP1 SUB SWAP1 SWAP2 ADD SWAP1 LOG3 POP PUSH1 0x1 SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP2 DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 SWAP4 SWAP1 SWAP5 AND DUP3 MSTORE SWAP2 SWAP1 SWAP2 MSTORE KECCAK256 SLOAD SWAP1 JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 KECCAK256 GASPRICE MSIZE 0x2c SWAP4 SWAP1 0xa8 LOG0 SDIV DUP3 SAR PUSH30 0xFFA1C27AE97BF827D8EF17CFEE3A8A70776B22D900290000000000000000 ",
- "sourceMap": "635:3396:52:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;635:3396:52;;;;;;;"
- },
- "deployedBytecode": {
- "linkReferences": {},
- "object": "0x6080604052600436106100775763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663095ea7b3811461007c57806318160ddd146100c157806323b872dd146100e857806370a082311461011f578063a9059cbb1461014d578063dd62ed3e1461017e575b600080fd5b34801561008857600080fd5b506100ad73ffffffffffffffffffffffffffffffffffffffff600435166024356101b2565b604080519115158252519081900360200190f35b3480156100cd57600080fd5b506100d6610225565b60408051918252519081900360200190f35b3480156100f457600080fd5b506100ad73ffffffffffffffffffffffffffffffffffffffff6004358116906024351660443561022b565b34801561012b57600080fd5b506100d673ffffffffffffffffffffffffffffffffffffffff60043516610487565b34801561015957600080fd5b506100ad73ffffffffffffffffffffffffffffffffffffffff600435166024356104af565b34801561018a57600080fd5b506100d673ffffffffffffffffffffffffffffffffffffffff6004358116906024351661063c565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60025490565b73ffffffffffffffffffffffffffffffffffffffff83166000908152602081905260408120548211156102bf57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f45524332305f494e53554646494349454e545f42414c414e4345000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8416600090815260016020908152604080832033845290915290205482111561035e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f45524332305f494e53554646494349454e545f414c4c4f57414e434500000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205482810110156103f457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f55494e543235365f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff80841660008181526020818152604080832080548801905593881680835284832080548890039055600182528483203384528252918490208054879003905583518681529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35060019392505050565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b3360009081526020819052604081205482111561052d57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f45524332305f494e53554646494349454e545f42414c414e4345000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205482810110156105c357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f55494e543235365f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b336000818152602081815260408083208054879003905573ffffffffffffffffffffffffffffffffffffffff871680845292819020805487019055805186815290519293927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a350600192915050565b73ffffffffffffffffffffffffffffffffffffffff9182166000908152600160209081526040808320939094168252919091522054905600a165627a7a72305820203a592c9390a8a005821d7dffa1c27ae97bf827d8ef17cfee3a8a70776b22d90029",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x77 JUMPI PUSH4 0xFFFFFFFF PUSH29 0x100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD DIV AND PUSH4 0x95EA7B3 DUP2 EQ PUSH2 0x7C JUMPI DUP1 PUSH4 0x18160DDD EQ PUSH2 0xC1 JUMPI DUP1 PUSH4 0x23B872DD EQ PUSH2 0xE8 JUMPI DUP1 PUSH4 0x70A08231 EQ PUSH2 0x11F JUMPI DUP1 PUSH4 0xA9059CBB EQ PUSH2 0x14D JUMPI DUP1 PUSH4 0xDD62ED3E EQ PUSH2 0x17E JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x88 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x1B2 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 ISZERO ISZERO DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xCD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xD6 PUSH2 0x225 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xF4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH1 0x44 CALLDATALOAD PUSH2 0x22B JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x12B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xD6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x487 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x159 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x4AF JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x18A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xD6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH2 0x63C JUMP JUMPDEST CALLER PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 AND DUP1 DUP6 MSTORE SWAP1 DUP4 MSTORE DUP2 DUP5 KECCAK256 DUP7 SWAP1 SSTORE DUP2 MLOAD DUP7 DUP2 MSTORE SWAP2 MLOAD SWAP4 SWAP5 SWAP1 SWAP4 SWAP1 SWAP3 PUSH32 0x8C5BE1E5EBEC7D5BD14F71427D1E84F3DD0314C0F7B2291E5B200AC8C7C3B925 SWAP3 DUP3 SWAP1 SUB ADD SWAP1 LOG3 POP PUSH1 0x1 SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x2 SLOAD SWAP1 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 DUP2 KECCAK256 SLOAD DUP3 GT ISZERO PUSH2 0x2BF JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x1A PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x45524332305F494E53554646494349454E545F42414C414E4345000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 CALLER DUP5 MSTORE SWAP1 SWAP2 MSTORE SWAP1 KECCAK256 SLOAD DUP3 GT ISZERO PUSH2 0x35E JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x1C PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x45524332305F494E53554646494349454E545F414C4C4F57414E434500000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP3 DUP2 ADD LT ISZERO PUSH2 0x3F4 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x10 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x55494E543235365F4F564552464C4F5700000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP5 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x20 DUP2 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 DUP1 SLOAD DUP9 ADD SWAP1 SSTORE SWAP4 DUP9 AND DUP1 DUP4 MSTORE DUP5 DUP4 KECCAK256 DUP1 SLOAD DUP9 SWAP1 SUB SWAP1 SSTORE PUSH1 0x1 DUP3 MSTORE DUP5 DUP4 KECCAK256 CALLER DUP5 MSTORE DUP3 MSTORE SWAP2 DUP5 SWAP1 KECCAK256 DUP1 SLOAD DUP8 SWAP1 SUB SWAP1 SSTORE DUP4 MLOAD DUP7 DUP2 MSTORE SWAP4 MLOAD SWAP3 SWAP4 SWAP2 SWAP3 PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF SWAP3 DUP2 SWAP1 SUB SWAP1 SWAP2 ADD SWAP1 LOG3 POP PUSH1 0x1 SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD SWAP1 JUMP JUMPDEST CALLER PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 DUP2 KECCAK256 SLOAD DUP3 GT ISZERO PUSH2 0x52D JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x1A PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x45524332305F494E53554646494349454E545F42414C414E4345000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP3 DUP2 ADD LT ISZERO PUSH2 0x5C3 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x10 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x55494E543235365F4F564552464C4F5700000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST CALLER PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x20 DUP2 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 DUP1 SLOAD DUP8 SWAP1 SUB SWAP1 SSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 AND DUP1 DUP5 MSTORE SWAP3 DUP2 SWAP1 KECCAK256 DUP1 SLOAD DUP8 ADD SWAP1 SSTORE DUP1 MLOAD DUP7 DUP2 MSTORE SWAP1 MLOAD SWAP3 SWAP4 SWAP3 PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF SWAP3 SWAP2 DUP2 SWAP1 SUB SWAP1 SWAP2 ADD SWAP1 LOG3 POP PUSH1 0x1 SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP2 DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 SWAP4 SWAP1 SWAP5 AND DUP3 MSTORE SWAP2 SWAP1 SWAP2 MSTORE KECCAK256 SLOAD SWAP1 JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 KECCAK256 GASPRICE MSIZE 0x2c SWAP4 SWAP1 0xa8 LOG0 SDIV DUP3 SAR PUSH30 0xFFA1C27AE97BF827D8EF17CFEE3A8A70776B22D900290000000000000000 ",
- "sourceMap": "635:3396:52:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2896:270;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2896:270:52;;;;;;;;;;;;;;;;;;;;;;;;;;;3251:119;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3251:119:52;;;;;;;;;;;;;;;;;;;;1872:723;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1872:723:52;;;;;;;;;;;;;;3524:135;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;3524:135:52;;;;;;;1055:514;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1055:514:52;;;;;;;;;3867:162;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;3867:162:52;;;;;;;;;;;;2896:270;3009:10;2981:4;3001:19;;;:7;:19;;;;;;;;;:29;;;;;;;;;;;:38;;;3054:84;;;;;;;2981:4;;3001:29;;3009:10;;3054:84;;;;;;;;-1:-1:-1;3155:4:52;2896:270;;;;:::o;3251:119::-;3351:12;;3251:119;:::o;1872:723::-;2043:15;;;2002:4;2043:15;;;;;;;;;;;:25;-1:-1:-1;2043:25:52;2022:98;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2151:14;;;;;;;:7;:14;;;;;;;;2166:10;2151:26;;;;;;;;:36;-1:-1:-1;2151:36:52;2130:111;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2298:13;;;:8;:13;;;;;;;;;;;2272:22;;;:39;;2251:102;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2364:13;;;;:8;:13;;;;;;;;;;;:23;;;;;;2397:15;;;;;;;;;:25;;;;;;;-1:-1:-1;2432:14:52;;;;;2447:10;2432:26;;;;;;;;:36;;;;;;;2488:74;;;;;;;2364:13;;2397:15;;2488:74;;;;;;;;;;-1:-1:-1;2584:4:52;1872:723;;;;;:::o;3524:135::-;3636:16;;3606:7;3636:16;;;;;;;;;;;;3524:135::o;1055:514::-;1186:10;1136:4;1177:20;;;;;;;;;;;:30;-1:-1:-1;1177:30:52;1156:103;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1316:13;;;:8;:13;;;;;;;;;;;1290:22;;;:39;;1269:102;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1391:10;1382:8;:20;;;;;;;;;;;:30;;;;;;;:20;1422:13;;;;;;;;;:23;;;;;;1461:79;;;;;;;1422:13;;1391:10;1461:79;;;;;;;;;;;-1:-1:-1;1558:4:52;1055:514;;;;:::o;3867:162::-;3997:15;;;;3967:7;3997:15;;;:7;:15;;;;;;;;:25;;;;;;;;;;;;;3867:162::o"
- }
- }
- },
- "sources": {
- "2.0.0/extensions/Forwarder/Forwarder.sol": {
- "id": 0
- },
- "2.0.0/extensions/Forwarder/MixinAssets.sol": {
- "id": 1
- },
- "2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol": {
- "id": 2
- },
- "2.0.0/extensions/Forwarder/MixinForwarderCore.sol": {
- "id": 3
- },
- "2.0.0/extensions/Forwarder/MixinWeth.sol": {
- "id": 4
- },
- "2.0.0/extensions/Forwarder/interfaces/IAssets.sol": {
- "id": 5
- },
- "2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol": {
- "id": 6
- },
- "2.0.0/extensions/Forwarder/libs/LibConstants.sol": {
- "id": 7
- },
- "2.0.0/extensions/Forwarder/mixins/MAssets.sol": {
- "id": 8
- },
- "2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol": {
- "id": 9
- },
- "2.0.0/extensions/Forwarder/mixins/MWeth.sol": {
- "id": 10
- },
- "2.0.0/extensions/OrderValidator/OrderValidator.sol": {
- "id": 11
- },
- "2.0.0/multisig/MultiSigWallet.sol": {
- "id": 12
- },
- "2.0.0/multisig/MultiSigWalletWithTimeLock.sol": {
- "id": 13
- },
- "2.0.0/protocol/AssetProxy/ERC20Proxy.sol": {
- "id": 14
- },
- "2.0.0/protocol/AssetProxy/ERC721Proxy.sol": {
- "id": 15
- },
- "2.0.0/protocol/AssetProxy/MixinAuthorizable.sol": {
- "id": 16
- },
- "2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol": {
- "id": 17
- },
- "2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol": {
- "id": 18
- },
- "2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol": {
- "id": 19
- },
- "2.0.0/protocol/AssetProxyOwner/AssetProxyOwner.sol": {
- "id": 20
- },
- "2.0.0/protocol/Exchange/Exchange.sol": {
- "id": 21
- },
- "2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol": {
- "id": 22
- },
- "2.0.0/protocol/Exchange/MixinExchangeCore.sol": {
- "id": 23
- },
- "2.0.0/protocol/Exchange/MixinMatchOrders.sol": {
- "id": 24
- },
- "2.0.0/protocol/Exchange/MixinSignatureValidator.sol": {
- "id": 25
- },
- "2.0.0/protocol/Exchange/MixinTransactions.sol": {
- "id": 26
- },
- "2.0.0/protocol/Exchange/MixinWrapperFunctions.sol": {
- "id": 27
- },
- "2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol": {
- "id": 28
- },
- "2.0.0/protocol/Exchange/interfaces/IExchange.sol": {
- "id": 29
- },
- "2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol": {
- "id": 30
- },
- "2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol": {
- "id": 31
- },
- "2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol": {
- "id": 32
- },
- "2.0.0/protocol/Exchange/interfaces/ITransactions.sol": {
- "id": 33
- },
- "2.0.0/protocol/Exchange/interfaces/IValidator.sol": {
- "id": 34
- },
- "2.0.0/protocol/Exchange/interfaces/IWallet.sol": {
- "id": 35
- },
- "2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol": {
- "id": 36
- },
- "2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol": {
- "id": 37
- },
- "2.0.0/protocol/Exchange/libs/LibConstants.sol": {
- "id": 38
- },
- "2.0.0/protocol/Exchange/libs/LibEIP712.sol": {
- "id": 39
- },
- "2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol": {
- "id": 40
- },
- "2.0.0/protocol/Exchange/libs/LibFillResults.sol": {
- "id": 41
- },
- "2.0.0/protocol/Exchange/libs/LibMath.sol": {
- "id": 42
- },
- "2.0.0/protocol/Exchange/libs/LibOrder.sol": {
- "id": 43
- },
- "2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol": {
- "id": 44
- },
- "2.0.0/protocol/Exchange/mixins/MExchangeCore.sol": {
- "id": 45
- },
- "2.0.0/protocol/Exchange/mixins/MMatchOrders.sol": {
- "id": 46
- },
- "2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol": {
- "id": 47
- },
- "2.0.0/protocol/Exchange/mixins/MTransactions.sol": {
- "id": 48
- },
- "2.0.0/protocol/Exchange/mixins/MWrapperFunctions.sol": {
- "id": 49
- },
- "2.0.0/test/DummyERC20Token/DummyERC20Token.sol": {
- "id": 50
- },
- "2.0.0/test/DummyERC721Token/DummyERC721Token.sol": {
- "id": 51
- },
- "2.0.0/tokens/ERC20Token/ERC20Token.sol": {
- "id": 52
- },
- "2.0.0/tokens/ERC20Token/IERC20Token.sol": {
- "id": 53
- },
- "2.0.0/tokens/ERC20Token/MintableERC20Token.sol": {
- "id": 54
- },
- "2.0.0/tokens/ERC20Token/UnlimitedAllowanceERC20Token.sol": {
- "id": 55
- },
- "2.0.0/tokens/ERC721Token/ERC721Token.sol": {
- "id": 56
- },
- "2.0.0/tokens/ERC721Token/IERC721Receiver.sol": {
- "id": 57
- },
- "2.0.0/tokens/ERC721Token/IERC721Token.sol": {
- "id": 58
- },
- "2.0.0/tokens/ERC721Token/MintableERC721Token.sol": {
- "id": 59
- },
- "2.0.0/tokens/EtherToken/IEtherToken.sol": {
- "id": 60
- },
- "2.0.0/utils/LibBytes/LibBytes.sol": {
- "id": 61
- },
- "2.0.0/utils/Ownable/IOwnable.sol": {
- "id": 62
- },
- "2.0.0/utils/Ownable/Ownable.sol": {
- "id": 63
- },
- "2.0.0/utils/ReentrancyGuard/ReentrancyGuard.sol": {
- "id": 64
- },
- "2.0.0/utils/SafeMath/SafeMath.sol": {
- "id": 65
- }
- },
- "sourceCodes": {
- "2.0.0/extensions/Forwarder/Forwarder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./MixinWeth.sol\";\nimport \"./MixinForwarderCore.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./MixinAssets.sol\";\nimport \"./MixinExchangeWrapper.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract Forwarder is\n LibConstants,\n MixinWeth,\n MixinAssets,\n MixinExchangeWrapper,\n MixinForwarderCore\n{\n constructor (\n address _exchange,\n bytes memory _zrxAssetData,\n bytes memory _wethAssetData\n )\n public\n LibConstants(\n _exchange,\n _zrxAssetData,\n _wethAssetData\n )\n MixinForwarderCore()\n {}\n}\n",
- "2.0.0/extensions/Forwarder/MixinAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"../../tokens/ERC20Token/IERC20Token.sol\";\nimport \"../../tokens/ERC721Token/IERC721Token.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MAssets.sol\";\n\n\ncontract MixinAssets is\n Ownable,\n LibConstants,\n MAssets\n{\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_TRANSFER_SELECTOR = bytes4(keccak256(\"transfer(address,uint256)\"));\n\n /// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to \n /// function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be\n /// used to withdraw assets that were accidentally sent to this contract.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of ERC20 token to withdraw.\n function withdrawAsset(\n bytes assetData,\n uint256 amount\n )\n external\n onlyOwner\n {\n transferAssetToSender(assetData, amount);\n }\n\n /// @dev Transfers given amount of asset to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferAssetToSender(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n bytes4 proxyId = assetData.readBytes4(0);\n\n if (proxyId == ERC20_DATA_ID) {\n transferERC20Token(assetData, amount);\n } else if (proxyId == ERC721_DATA_ID) {\n transferERC721Token(assetData, amount);\n } else {\n revert(\"UNSUPPORTED_ASSET_PROXY\");\n }\n }\n\n /// @dev Decodes ERC20 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC20Token(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n address token = assetData.readAddress(16);\n\n // Transfer tokens.\n // We do a raw call so we can check the success separate\n // from the return data.\n bool success = token.call(abi.encodeWithSelector(\n ERC20_TRANSFER_SELECTOR,\n msg.sender,\n amount\n ));\n require(\n success,\n \"TRANSFER_FAILED\"\n );\n \n // Check return data.\n // If there is no return data, we assume the token incorrectly\n // does not return a bool. In this case we expect it to revert\n // on failure, which was handled above.\n // If the token does return data, we require that it is a single\n // value that evaluates to true.\n assembly {\n if returndatasize {\n success := 0\n if eq(returndatasize, 32) {\n // First 64 bytes of memory are reserved scratch space\n returndatacopy(0, 0, 32)\n success := mload(0)\n }\n }\n }\n require(\n success,\n \"TRANSFER_FAILED\"\n );\n }\n\n /// @dev Decodes ERC721 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC721Token(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n require(\n amount == 1,\n \"INVALID_AMOUNT\"\n );\n // Decode asset data.\n address token = assetData.readAddress(16);\n uint256 tokenId = assetData.readUint256(36);\n\n // Perform transfer.\n IERC721Token(token).transferFrom(\n address(this),\n msg.sender,\n tokenId\n );\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MExchangeWrapper.sol\";\nimport \"../../protocol/Exchange/libs/LibAbiEncoder.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../protocol/Exchange/libs/LibFillResults.sol\";\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\n\n\ncontract MixinExchangeWrapper is\n LibAbiEncoder,\n LibFillResults,\n LibMath,\n LibConstants,\n MExchangeWrapper\n{\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n // ABI encode calldata for `fillOrder`\n bytes memory fillOrderCalldata = abiEncodeFillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n\n address exchange = address(EXCHANGE);\n\n // Call `fillOrder` and handle any exceptions gracefully\n assembly {\n let success := call(\n gas, // forward all gas\n exchange, // call address of Exchange contract\n 0, // transfer 0 wei\n add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes)\n mload(fillOrderCalldata), // length of input\n fillOrderCalldata, // write output over input\n 128 // output size is 128 bytes\n )\n if success {\n mstore(fillResults, mload(fillOrderCalldata))\n mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32)))\n mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64)))\n mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96)))\n }\n }\n // fillResults values will be 0 by default if call was unsuccessful\n return fillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of WETH has been sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param wethSellAmount Desired amount of WETH to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellWeth(\n LibOrder.Order[] memory orders,\n uint256 wethSellAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // We assume that asset being sold by taker is WETH for each order.\n orders[i].makerAssetData = makerAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of WETH to sell\n uint256 remainingTakerAssetFillAmount = safeSub(wethSellAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of WETH\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= wethSellAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// The asset being sold by taker must always be WETH.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyExactAmountWithWeth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // We assume that asset being sold by taker is WETH for each order.\n orders[i].makerAssetData = makerAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n uint256 makerAssetFilledAmount = totalFillResults.makerAssetFilledAmount;\n if (makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n\n require(\n makerAssetFilledAmount >= makerAssetFillAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return totalFillResults;\n }\n\n /// @dev Buys zrxBuyAmount of ZRX fee tokens, taking into account ZRX fees for each order. This will guarantee\n /// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues).\n /// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX\n /// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases.\n /// The asset being sold by taker must always be WETH. \n /// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset.\n /// @param zrxBuyAmount Desired amount of ZRX to buy.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return totalFillResults Amounts filled and fees paid by maker and taker.\n function marketBuyExactZrxWithWeth(\n LibOrder.Order[] memory orders,\n uint256 zrxBuyAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n // Do nothing if zrxBuyAmount == 0\n if (zrxBuyAmount == 0) {\n return totalFillResults;\n }\n\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n uint256 zrxPurchased = 0;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // All of these are ZRX/WETH, so we can drop the respective assetData from calldata.\n orders[i].makerAssetData = zrxAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of ZRX to buy.\n uint256 remainingZrxBuyAmount = safeSub(zrxBuyAmount, zrxPurchased);\n\n // Convert the remaining amount of ZRX to buy into remaining amount\n // of WETH to sell, assuming entire amount can be sold in the current order.\n uint256 remainingWethSellAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n safeSub(orders[i].makerAssetAmount, orders[i].takerFee), // our exchange rate after fees \n remainingZrxBuyAmount\n );\n\n // Attempt to sell the remaining amount of WETH.\n FillResults memory singleFillResult = fillOrderNoThrow(\n orders[i],\n safeAdd(remainingWethSellAmount, 1), // we add 1 wei to the fill amount to make up for rounding errors\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker.\n addFillResults(totalFillResults, singleFillResult);\n zrxPurchased = safeSub(totalFillResults.makerAssetFilledAmount, totalFillResults.takerFeePaid);\n\n // Stop execution if the entire amount of ZRX has been bought.\n if (zrxPurchased >= zrxBuyAmount) {\n break;\n }\n }\n\n require(\n zrxPurchased >= zrxBuyAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return totalFillResults;\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinForwarderCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MWeth.sol\";\nimport \"./mixins/MAssets.sol\";\nimport \"./mixins/MExchangeWrapper.sol\";\nimport \"./interfaces/IForwarderCore.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../protocol/Exchange/libs/LibFillResults.sol\";\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\n\n\ncontract MixinForwarderCore is\n LibFillResults,\n LibMath,\n LibConstants,\n MWeth,\n MAssets,\n MExchangeWrapper,\n IForwarderCore\n{\n using LibBytes for bytes;\n\n /// @dev Constructor approves ERC20 proxy to transfer ZRX and WETH on this contract's behalf.\n constructor ()\n public\n {\n address proxyAddress = EXCHANGE.getAssetProxy(ERC20_DATA_ID);\n require(\n proxyAddress != address(0),\n \"UNREGISTERED_ASSET_PROXY\"\n );\n ETHER_TOKEN.approve(proxyAddress, MAX_UINT);\n ZRX_TOKEN.approve(proxyAddress, MAX_UINT);\n }\n\n /// @dev Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketSellOrdersWithEth(\n LibOrder.Order[] memory orders,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n FillResults memory orderFillResults,\n FillResults memory feeOrderFillResults\n )\n {\n // Convert ETH to WETH.\n convertEthToWeth();\n\n uint256 wethSellAmount;\n uint256 zrxBuyAmount;\n uint256 makerAssetAmountPurchased;\n if (orders[0].makerAssetData.equals(ZRX_ASSET_DATA)) {\n // Calculate amount of WETH that won't be spent on ETH fees.\n wethSellAmount = getPartialAmountFloor(\n PERCENTAGE_DENOMINATOR,\n safeAdd(PERCENTAGE_DENOMINATOR, feePercentage),\n msg.value\n );\n // Market sell available WETH.\n // ZRX fees are paid with this contract's balance.\n orderFillResults = marketSellWeth(\n orders,\n wethSellAmount,\n signatures\n );\n // The fee amount must be deducted from the amount transfered back to sender.\n makerAssetAmountPurchased = safeSub(orderFillResults.makerAssetFilledAmount, orderFillResults.takerFeePaid);\n } else {\n // 5% of WETH is reserved for filling feeOrders and paying feeRecipient.\n wethSellAmount = getPartialAmountFloor(\n MAX_WETH_FILL_PERCENTAGE,\n PERCENTAGE_DENOMINATOR,\n msg.value\n );\n // Market sell 95% of WETH.\n // ZRX fees are payed with this contract's balance.\n orderFillResults = marketSellWeth(\n orders,\n wethSellAmount,\n signatures\n );\n // Buy back all ZRX spent on fees.\n zrxBuyAmount = orderFillResults.takerFeePaid;\n feeOrderFillResults = marketBuyExactZrxWithWeth(\n feeOrders,\n zrxBuyAmount,\n feeSignatures\n );\n makerAssetAmountPurchased = orderFillResults.makerAssetFilledAmount;\n }\n\n // Transfer feePercentage of total ETH spent on primary orders to feeRecipient.\n // Refund remaining ETH to msg.sender.\n transferEthFeeAndRefund(\n orderFillResults.takerAssetFilledAmount,\n feeOrderFillResults.takerAssetFilledAmount,\n feePercentage,\n feeRecipient\n );\n\n // Transfer purchased assets to msg.sender.\n transferAssetToSender(orders[0].makerAssetData, makerAssetAmountPurchased);\n }\n\n /// @dev Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param makerAssetFillAmount Desired amount of makerAsset to purchase.\n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketBuyOrdersWithEth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n FillResults memory orderFillResults,\n FillResults memory feeOrderFillResults\n )\n {\n // Convert ETH to WETH.\n convertEthToWeth();\n\n uint256 zrxBuyAmount;\n uint256 makerAssetAmountPurchased;\n if (orders[0].makerAssetData.equals(ZRX_ASSET_DATA)) {\n // If the makerAsset is ZRX, it is not necessary to pay fees out of this\n // contracts's ZRX balance because fees are factored into the price of the order.\n orderFillResults = marketBuyExactZrxWithWeth(\n orders,\n makerAssetFillAmount,\n signatures\n );\n // The fee amount must be deducted from the amount transfered back to sender.\n makerAssetAmountPurchased = safeSub(orderFillResults.makerAssetFilledAmount, orderFillResults.takerFeePaid);\n } else {\n // Attemp to purchase desired amount of makerAsset.\n // ZRX fees are payed with this contract's balance.\n orderFillResults = marketBuyExactAmountWithWeth(\n orders,\n makerAssetFillAmount,\n signatures\n );\n // Buy back all ZRX spent on fees.\n zrxBuyAmount = orderFillResults.takerFeePaid;\n feeOrderFillResults = marketBuyExactZrxWithWeth(\n feeOrders,\n zrxBuyAmount,\n feeSignatures\n );\n makerAssetAmountPurchased = orderFillResults.makerAssetFilledAmount;\n }\n\n // Transfer feePercentage of total ETH spent on primary orders to feeRecipient.\n // Refund remaining ETH to msg.sender.\n transferEthFeeAndRefund(\n orderFillResults.takerAssetFilledAmount,\n feeOrderFillResults.takerAssetFilledAmount,\n feePercentage,\n feeRecipient\n );\n\n // Transfer purchased assets to msg.sender.\n transferAssetToSender(orders[0].makerAssetData, makerAssetAmountPurchased);\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinWeth.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MWeth.sol\";\n\n\ncontract MixinWeth is\n LibMath,\n LibConstants,\n MWeth\n{\n /// @dev Default payabale function, this allows us to withdraw WETH\n function ()\n public\n payable\n {\n require(\n msg.sender == address(ETHER_TOKEN),\n \"DEFAULT_FUNCTION_WETH_CONTRACT_ONLY\"\n );\n }\n\n /// @dev Converts message call's ETH value into WETH.\n function convertEthToWeth()\n internal\n {\n require(\n msg.value > 0,\n \"INVALID_MSG_VALUE\"\n );\n ETHER_TOKEN.deposit.value(msg.value)();\n }\n\n /// @dev Transfers feePercentage of WETH spent on primary orders to feeRecipient.\n /// Refunds any excess ETH to msg.sender.\n /// @param wethSoldExcludingFeeOrders Amount of WETH sold when filling primary orders.\n /// @param wethSoldForZrx Amount of WETH sold when purchasing ZRX required for primary order fees.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n function transferEthFeeAndRefund(\n uint256 wethSoldExcludingFeeOrders,\n uint256 wethSoldForZrx,\n uint256 feePercentage,\n address feeRecipient\n )\n internal\n {\n // Ensure feePercentage is less than 5%.\n require(\n feePercentage <= MAX_FEE_PERCENTAGE,\n \"FEE_PERCENTAGE_TOO_LARGE\"\n );\n\n // Ensure that no extra WETH owned by this contract has been sold.\n uint256 wethSold = safeAdd(wethSoldExcludingFeeOrders, wethSoldForZrx);\n require(\n wethSold <= msg.value,\n \"OVERSOLD_WETH\"\n );\n\n // Calculate amount of WETH that hasn't been sold.\n uint256 wethRemaining = safeSub(msg.value, wethSold);\n\n // Calculate ETH fee to pay to feeRecipient.\n uint256 ethFee = getPartialAmountFloor(\n feePercentage,\n PERCENTAGE_DENOMINATOR,\n wethSoldExcludingFeeOrders\n );\n\n // Ensure fee is less than amount of WETH remaining.\n require(\n ethFee <= wethRemaining,\n \"INSUFFICIENT_ETH_REMAINING\"\n );\n \n // Do nothing if no WETH remaining\n if (wethRemaining > 0) {\n // Convert remaining WETH to ETH\n ETHER_TOKEN.withdraw(wethRemaining);\n\n // Pay ETH to feeRecipient\n if (ethFee > 0) {\n feeRecipient.transfer(ethFee);\n }\n\n // Refund remaining ETH to msg.sender.\n uint256 ethRefund = safeSub(wethRemaining, ethFee);\n if (ethRefund > 0) {\n msg.sender.transfer(ethRefund);\n }\n }\n }\n}\n",
- "2.0.0/extensions/Forwarder/interfaces/IAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IAssets {\n\n /// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to \n /// function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be\n /// used to withdraw assets that were accidentally sent to this contract.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of ERC20 token to withdraw.\n function withdrawAsset(\n bytes assetData,\n uint256 amount\n )\n external;\n}\n",
- "2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../../protocol/Exchange/libs/LibFillResults.sol\";\n\n\ncontract IForwarderCore {\n\n /// @dev Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketSellOrdersWithEth(\n LibOrder.Order[] memory orders,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n LibFillResults.FillResults memory orderFillResults,\n LibFillResults.FillResults memory feeOrderFillResults\n );\n\n /// @dev Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param makerAssetFillAmount Desired amount of makerAsset to purchase.\n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketBuyOrdersWithEth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n LibFillResults.FillResults memory orderFillResults,\n LibFillResults.FillResults memory feeOrderFillResults\n );\n}\n",
- "2.0.0/extensions/Forwarder/libs/LibConstants.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/LibBytes/LibBytes.sol\";\nimport \"../../../protocol/Exchange/interfaces/IExchange.sol\";\nimport \"../../../tokens/EtherToken/IEtherToken.sol\";\nimport \"../../../tokens/ERC20Token/IERC20Token.sol\";\n\n\ncontract LibConstants {\n\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n uint256 constant internal MAX_UINT = 2**256 - 1;\n uint256 constant internal PERCENTAGE_DENOMINATOR = 10**18; \n uint256 constant internal MAX_FEE_PERCENTAGE = 5 * PERCENTAGE_DENOMINATOR / 100; // 5%\n uint256 constant internal MAX_WETH_FILL_PERCENTAGE = 95 * PERCENTAGE_DENOMINATOR / 100; // 95%\n \n // solhint-disable var-name-mixedcase\n IExchange internal EXCHANGE;\n IEtherToken internal ETHER_TOKEN;\n IERC20Token internal ZRX_TOKEN;\n bytes internal ZRX_ASSET_DATA;\n bytes internal WETH_ASSET_DATA;\n // solhint-enable var-name-mixedcase\n\n constructor (\n address _exchange,\n bytes memory _zrxAssetData,\n bytes memory _wethAssetData\n )\n public\n {\n EXCHANGE = IExchange(_exchange);\n ZRX_ASSET_DATA = _zrxAssetData;\n WETH_ASSET_DATA = _wethAssetData;\n\n address etherToken = _wethAssetData.readAddress(16);\n address zrxToken = _zrxAssetData.readAddress(16);\n ETHER_TOKEN = IEtherToken(etherToken);\n ZRX_TOKEN = IERC20Token(zrxToken);\n }\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAssets.sol\";\n\n\ncontract MAssets is\n IAssets\n{\n /// @dev Transfers given amount of asset to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferAssetToSender(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n\n /// @dev Decodes ERC20 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC20Token(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n\n /// @dev Decodes ERC721 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC721Token(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../../protocol/Exchange/libs/LibFillResults.sol\";\n\n\ncontract MExchangeWrapper {\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of WETH has been sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param wethSellAmount Desired amount of WETH to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellWeth(\n LibOrder.Order[] memory orders,\n uint256 wethSellAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// The asset being sold by taker must always be WETH.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyExactAmountWithWeth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Buys zrxBuyAmount of ZRX fee tokens, taking into account ZRX fees for each order. This will guarantee\n /// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues).\n /// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX\n /// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases.\n /// The asset being sold by taker must always be WETH. \n /// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset.\n /// @param zrxBuyAmount Desired amount of ZRX to buy.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return totalFillResults Amounts filled and fees paid by maker and taker.\n function marketBuyExactZrxWithWeth(\n LibOrder.Order[] memory orders,\n uint256 zrxBuyAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MWeth.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract MWeth {\n\n /// @dev Converts message call's ETH value into WETH.\n function convertEthToWeth()\n internal;\n\n /// @dev Transfers feePercentage of WETH spent on primary orders to feeRecipient.\n /// Refunds any excess ETH to msg.sender.\n /// @param wethSoldExcludingFeeOrders Amount of WETH sold when filling primary orders.\n /// @param wethSoldForZrx Amount of WETH sold when purchasing ZRX required for primary order fees.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n function transferEthFeeAndRefund(\n uint256 wethSoldExcludingFeeOrders,\n uint256 wethSoldForZrx,\n uint256 feePercentage,\n address feeRecipient\n )\n internal;\n}\n",
- "2.0.0/extensions/OrderValidator/OrderValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../protocol/Exchange/interfaces/IExchange.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../tokens/ERC20Token/IERC20Token.sol\";\nimport \"../../tokens/ERC721Token/IERC721Token.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\n\n\ncontract OrderValidator {\n\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n\n struct TraderInfo {\n uint256 makerBalance; // Maker's balance of makerAsset\n uint256 makerAllowance; // Maker's allowance to corresponding AssetProxy\n uint256 takerBalance; // Taker's balance of takerAsset\n uint256 takerAllowance; // Taker's allowance to corresponding AssetProxy\n uint256 makerZrxBalance; // Maker's balance of ZRX\n uint256 makerZrxAllowance; // Maker's allowance of ZRX to ERC20Proxy\n uint256 takerZrxBalance; // Taker's balance of ZRX\n uint256 takerZrxAllowance; // Taker's allowance of ZRX to ERC20Proxy\n }\n\n // solhint-disable var-name-mixedcase\n IExchange internal EXCHANGE;\n bytes internal ZRX_ASSET_DATA;\n // solhint-enable var-name-mixedcase\n\n constructor (address _exchange, bytes memory _zrxAssetData)\n public\n {\n EXCHANGE = IExchange(_exchange);\n ZRX_ASSET_DATA = _zrxAssetData;\n }\n\n /// @dev Fetches information for order and maker/taker of order.\n /// @param order The order structure.\n /// @param takerAddress Address that will be filling the order.\n /// @return OrderInfo and TraderInfo instances for given order.\n function getOrderAndTraderInfo(LibOrder.Order memory order, address takerAddress)\n public\n view\n returns (LibOrder.OrderInfo memory orderInfo, TraderInfo memory traderInfo)\n {\n orderInfo = EXCHANGE.getOrderInfo(order);\n traderInfo = getTraderInfo(order, takerAddress);\n return (orderInfo, traderInfo);\n }\n\n /// @dev Fetches information for all passed in orders and the makers/takers of each order.\n /// @param orders Array of order specifications.\n /// @param takerAddresses Array of taker addresses corresponding to each order.\n /// @return Arrays of OrderInfo and TraderInfo instances that correspond to each order.\n function getOrdersAndTradersInfo(LibOrder.Order[] memory orders, address[] memory takerAddresses)\n public\n view\n returns (LibOrder.OrderInfo[] memory ordersInfo, TraderInfo[] memory tradersInfo)\n {\n ordersInfo = EXCHANGE.getOrdersInfo(orders);\n tradersInfo = getTradersInfo(orders, takerAddresses);\n return (ordersInfo, tradersInfo);\n }\n\n /// @dev Fetches balance and allowances for maker and taker of order.\n /// @param order The order structure.\n /// @param takerAddress Address that will be filling the order.\n /// @return Balances and allowances of maker and taker of order.\n function getTraderInfo(LibOrder.Order memory order, address takerAddress)\n public\n view\n returns (TraderInfo memory traderInfo)\n {\n (traderInfo.makerBalance, traderInfo.makerAllowance) = getBalanceAndAllowance(order.makerAddress, order.makerAssetData);\n (traderInfo.takerBalance, traderInfo.takerAllowance) = getBalanceAndAllowance(takerAddress, order.takerAssetData);\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n (traderInfo.makerZrxBalance, traderInfo.makerZrxAllowance) = getBalanceAndAllowance(order.makerAddress, zrxAssetData);\n (traderInfo.takerZrxBalance, traderInfo.takerZrxAllowance) = getBalanceAndAllowance(takerAddress, zrxAssetData);\n return traderInfo;\n }\n\n /// @dev Fetches balances and allowances of maker and taker for each provided order.\n /// @param orders Array of order specifications.\n /// @param takerAddresses Array of taker addresses corresponding to each order.\n /// @return Array of balances and allowances for maker and taker of each order.\n function getTradersInfo(LibOrder.Order[] memory orders, address[] memory takerAddresses)\n public\n view\n returns (TraderInfo[] memory)\n {\n uint256 ordersLength = orders.length;\n TraderInfo[] memory tradersInfo = new TraderInfo[](ordersLength);\n for (uint256 i = 0; i != ordersLength; i++) {\n tradersInfo[i] = getTraderInfo(orders[i], takerAddresses[i]);\n }\n return tradersInfo;\n }\n\n /// @dev Fetches token balances and allowances of an address to given assetProxy. Supports ERC20 and ERC721.\n /// @param target Address to fetch balances and allowances of.\n /// @param assetData Encoded data that can be decoded by a specified proxy contract when transferring asset.\n /// @return Balance of asset and allowance set to given proxy of asset.\n /// For ERC721 tokens, these values will always be 1 or 0.\n function getBalanceAndAllowance(address target, bytes memory assetData)\n public\n view\n returns (uint256 balance, uint256 allowance)\n {\n bytes4 assetProxyId = assetData.readBytes4(0);\n address token = assetData.readAddress(16);\n address assetProxy = EXCHANGE.getAssetProxy(assetProxyId);\n\n if (assetProxyId == ERC20_DATA_ID) {\n // Query balance\n balance = IERC20Token(token).balanceOf(target);\n\n // Query allowance\n allowance = IERC20Token(token).allowance(target, assetProxy);\n } else if (assetProxyId == ERC721_DATA_ID) {\n uint256 tokenId = assetData.readUint256(36);\n\n // Query owner of tokenId\n address owner = getERC721TokenOwner(token, tokenId);\n\n // Set balance to 1 if tokenId is owned by target\n balance = target == owner ? 1 : 0;\n\n // Check if ERC721Proxy is approved to spend tokenId\n bool isApproved = IERC721Token(token).isApprovedForAll(target, assetProxy) || IERC721Token(token).getApproved(tokenId) == assetProxy;\n \n // Set alowance to 1 if ERC721Proxy is approved to spend tokenId\n allowance = isApproved ? 1 : 0;\n } else {\n revert(\"UNSUPPORTED_ASSET_PROXY\");\n }\n return (balance, allowance);\n }\n\n /// @dev Fetches token balances and allowances of an address for each given assetProxy. Supports ERC20 and ERC721.\n /// @param target Address to fetch balances and allowances of.\n /// @param assetData Array of encoded byte arrays that can be decoded by a specified proxy contract when transferring asset.\n /// @return Balances and allowances of assets.\n /// For ERC721 tokens, these values will always be 1 or 0.\n function getBalancesAndAllowances(address target, bytes[] memory assetData)\n public\n view\n returns (uint256[] memory, uint256[] memory)\n {\n uint256 length = assetData.length;\n uint256[] memory balances = new uint256[](length);\n uint256[] memory allowances = new uint256[](length);\n for (uint256 i = 0; i != length; i++) {\n (balances[i], allowances[i]) = getBalanceAndAllowance(target, assetData[i]);\n }\n return (balances, allowances);\n }\n\n /// @dev Calls `token.ownerOf(tokenId)`, but returns a null owner instead of reverting on an unowned token.\n /// @param token Address of ERC721 token.\n /// @param tokenId The identifier for the specific NFT.\n /// @return Owner of tokenId or null address if unowned.\n function getERC721TokenOwner(address token, uint256 tokenId)\n public\n view\n returns (address owner)\n {\n assembly {\n // load free memory pointer\n let cdStart := mload(64)\n\n // bytes4(keccak256(ownerOf(uint256))) = 0x6352211e\n mstore(cdStart, 0x6352211e00000000000000000000000000000000000000000000000000000000)\n mstore(add(cdStart, 4), tokenId)\n\n // staticcall `ownerOf(tokenId)`\n // `ownerOf` will revert if tokenId is not owned\n let success := staticcall(\n gas, // forward all gas\n token, // call token contract\n cdStart, // start of calldata\n 36, // length of input is 36 bytes\n cdStart, // write output over input\n 32 // size of output is 32 bytes\n )\n\n // Success implies that tokenId is owned\n // Copy owner from return data if successful\n if success {\n owner := mload(cdStart)\n } \n }\n\n // Owner initialized to address(0), no need to modify if call is unsuccessful\n return owner;\n }\n}\n",
- "2.0.0/multisig/MultiSigWallet.sol": "// solhint-disable\npragma solidity ^0.4.15;\n\n\n/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.\n/// @author Stefan George - <stefan.george@consensys.net>\ncontract MultiSigWallet {\n\n /*\n * Events\n */\n event Confirmation(address indexed sender, uint indexed transactionId);\n event Revocation(address indexed sender, uint indexed transactionId);\n event Submission(uint indexed transactionId);\n event Execution(uint indexed transactionId);\n event ExecutionFailure(uint indexed transactionId);\n event Deposit(address indexed sender, uint value);\n event OwnerAddition(address indexed owner);\n event OwnerRemoval(address indexed owner);\n event RequirementChange(uint required);\n\n /*\n * Constants\n */\n uint constant public MAX_OWNER_COUNT = 50;\n\n /*\n * Storage\n */\n mapping (uint => Transaction) public transactions;\n mapping (uint => mapping (address => bool)) public confirmations;\n mapping (address => bool) public isOwner;\n address[] public owners;\n uint public required;\n uint public transactionCount;\n\n struct Transaction {\n address destination;\n uint value;\n bytes data;\n bool executed;\n }\n\n /*\n * Modifiers\n */\n modifier onlyWallet() {\n require(msg.sender == address(this));\n _;\n }\n\n modifier ownerDoesNotExist(address owner) {\n require(!isOwner[owner]);\n _;\n }\n\n modifier ownerExists(address owner) {\n require(isOwner[owner]);\n _;\n }\n\n modifier transactionExists(uint transactionId) {\n require(transactions[transactionId].destination != 0);\n _;\n }\n\n modifier confirmed(uint transactionId, address owner) {\n require(confirmations[transactionId][owner]);\n _;\n }\n\n modifier notConfirmed(uint transactionId, address owner) {\n require(!confirmations[transactionId][owner]);\n _;\n }\n\n modifier notExecuted(uint transactionId) {\n require(!transactions[transactionId].executed);\n _;\n }\n\n modifier notNull(address _address) {\n require(_address != 0);\n _;\n }\n\n modifier validRequirement(uint ownerCount, uint _required) {\n require(ownerCount <= MAX_OWNER_COUNT\n && _required <= ownerCount\n && _required != 0\n && ownerCount != 0);\n _;\n }\n\n /// @dev Fallback function allows to deposit ether.\n function()\n payable\n {\n if (msg.value > 0)\n Deposit(msg.sender, msg.value);\n }\n\n /*\n * Public functions\n */\n /// @dev Contract constructor sets initial owners and required number of confirmations.\n /// @param _owners List of initial owners.\n /// @param _required Number of required confirmations.\n function MultiSigWallet(address[] _owners, uint _required)\n public\n validRequirement(_owners.length, _required)\n {\n for (uint i=0; i<_owners.length; i++) {\n require(!isOwner[_owners[i]] && _owners[i] != 0);\n isOwner[_owners[i]] = true;\n }\n owners = _owners;\n required = _required;\n }\n\n /// @dev Allows to add a new owner. Transaction has to be sent by wallet.\n /// @param owner Address of new owner.\n function addOwner(address owner)\n public\n onlyWallet\n ownerDoesNotExist(owner)\n notNull(owner)\n validRequirement(owners.length + 1, required)\n {\n isOwner[owner] = true;\n owners.push(owner);\n OwnerAddition(owner);\n }\n\n /// @dev Allows to remove an owner. Transaction has to be sent by wallet.\n /// @param owner Address of owner.\n function removeOwner(address owner)\n public\n onlyWallet\n ownerExists(owner)\n {\n isOwner[owner] = false;\n for (uint i=0; i<owners.length - 1; i++)\n if (owners[i] == owner) {\n owners[i] = owners[owners.length - 1];\n break;\n }\n owners.length -= 1;\n if (required > owners.length)\n changeRequirement(owners.length);\n OwnerRemoval(owner);\n }\n\n /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet.\n /// @param owner Address of owner to be replaced.\n /// @param newOwner Address of new owner.\n function replaceOwner(address owner, address newOwner)\n public\n onlyWallet\n ownerExists(owner)\n ownerDoesNotExist(newOwner)\n {\n for (uint i=0; i<owners.length; i++)\n if (owners[i] == owner) {\n owners[i] = newOwner;\n break;\n }\n isOwner[owner] = false;\n isOwner[newOwner] = true;\n OwnerRemoval(owner);\n OwnerAddition(newOwner);\n }\n\n /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet.\n /// @param _required Number of required confirmations.\n function changeRequirement(uint _required)\n public\n onlyWallet\n validRequirement(owners.length, _required)\n {\n required = _required;\n RequirementChange(_required);\n }\n\n /// @dev Allows an owner to submit and confirm a transaction.\n /// @param destination Transaction target address.\n /// @param value Transaction ether value.\n /// @param data Transaction data payload.\n /// @return Returns transaction ID.\n function submitTransaction(address destination, uint value, bytes data)\n public\n returns (uint transactionId)\n {\n transactionId = addTransaction(destination, value, data);\n confirmTransaction(transactionId);\n }\n\n /// @dev Allows an owner to confirm a transaction.\n /// @param transactionId Transaction ID.\n function confirmTransaction(uint transactionId)\n public\n ownerExists(msg.sender)\n transactionExists(transactionId)\n notConfirmed(transactionId, msg.sender)\n {\n confirmations[transactionId][msg.sender] = true;\n Confirmation(msg.sender, transactionId);\n executeTransaction(transactionId);\n }\n\n /// @dev Allows an owner to revoke a confirmation for a transaction.\n /// @param transactionId Transaction ID.\n function revokeConfirmation(uint transactionId)\n public\n ownerExists(msg.sender)\n confirmed(transactionId, msg.sender)\n notExecuted(transactionId)\n {\n confirmations[transactionId][msg.sender] = false;\n Revocation(msg.sender, transactionId);\n }\n\n /// @dev Allows anyone to execute a confirmed transaction.\n /// @param transactionId Transaction ID.\n function executeTransaction(uint transactionId)\n public\n ownerExists(msg.sender)\n confirmed(transactionId, msg.sender)\n notExecuted(transactionId)\n {\n if (isConfirmed(transactionId)) {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data))\n Execution(transactionId);\n else {\n ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n }\n\n // call has been separated into its own function in order to take advantage\n // of the Solidity's code generator to produce a loop that copies tx.data into memory.\n function external_call(address destination, uint value, uint dataLength, bytes data) internal returns (bool) {\n bool result;\n assembly {\n let x := mload(0x40) // \"Allocate\" memory for output (0x40 is where \"free memory\" pointer is stored by convention)\n let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that\n result := call(\n sub(gas, 34710), // 34710 is the value that solidity is currently emitting\n // It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) +\n // callNewAccountGas (25000, in case the destination address does not exist and needs creating)\n destination,\n value,\n d,\n dataLength, // Size of the input (in bytes) - this is what fixes the padding problem\n x,\n 0 // Output is ignored, therefore the output size is zero\n )\n }\n return result;\n }\n\n /// @dev Returns the confirmation status of a transaction.\n /// @param transactionId Transaction ID.\n /// @return Confirmation status.\n function isConfirmed(uint transactionId)\n public\n constant\n returns (bool)\n {\n uint count = 0;\n for (uint i=0; i<owners.length; i++) {\n if (confirmations[transactionId][owners[i]])\n count += 1;\n if (count == required)\n return true;\n }\n }\n\n /*\n * Internal functions\n */\n /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet.\n /// @param destination Transaction target address.\n /// @param value Transaction ether value.\n /// @param data Transaction data payload.\n /// @return Returns transaction ID.\n function addTransaction(address destination, uint value, bytes data)\n internal\n notNull(destination)\n returns (uint transactionId)\n {\n transactionId = transactionCount;\n transactions[transactionId] = Transaction({\n destination: destination,\n value: value,\n data: data,\n executed: false\n });\n transactionCount += 1;\n Submission(transactionId);\n }\n\n /*\n * Web3 call functions\n */\n /// @dev Returns number of confirmations of a transaction.\n /// @param transactionId Transaction ID.\n /// @return Number of confirmations.\n function getConfirmationCount(uint transactionId)\n public\n constant\n returns (uint count)\n {\n for (uint i=0; i<owners.length; i++)\n if (confirmations[transactionId][owners[i]])\n count += 1;\n }\n\n /// @dev Returns total number of transactions after filers are applied.\n /// @param pending Include pending transactions.\n /// @param executed Include executed transactions.\n /// @return Total number of transactions after filters are applied.\n function getTransactionCount(bool pending, bool executed)\n public\n constant\n returns (uint count)\n {\n for (uint i=0; i<transactionCount; i++)\n if ( pending && !transactions[i].executed\n || executed && transactions[i].executed)\n count += 1;\n }\n\n /// @dev Returns list of owners.\n /// @return List of owner addresses.\n function getOwners()\n public\n constant\n returns (address[])\n {\n return owners;\n }\n\n /// @dev Returns array with owner addresses, which confirmed transaction.\n /// @param transactionId Transaction ID.\n /// @return Returns array of owner addresses.\n function getConfirmations(uint transactionId)\n public\n constant\n returns (address[] _confirmations)\n {\n address[] memory confirmationsTemp = new address[](owners.length);\n uint count = 0;\n uint i;\n for (i=0; i<owners.length; i++)\n if (confirmations[transactionId][owners[i]]) {\n confirmationsTemp[count] = owners[i];\n count += 1;\n }\n _confirmations = new address[](count);\n for (i=0; i<count; i++)\n _confirmations[i] = confirmationsTemp[i];\n }\n\n /// @dev Returns list of transaction IDs in defined range.\n /// @param from Index start position of transaction array.\n /// @param to Index end position of transaction array.\n /// @param pending Include pending transactions.\n /// @param executed Include executed transactions.\n /// @return Returns array of transaction IDs.\n function getTransactionIds(uint from, uint to, bool pending, bool executed)\n public\n constant\n returns (uint[] _transactionIds)\n {\n uint[] memory transactionIdsTemp = new uint[](transactionCount);\n uint count = 0;\n uint i;\n for (i=0; i<transactionCount; i++)\n if ( pending && !transactions[i].executed\n || executed && transactions[i].executed)\n {\n transactionIdsTemp[count] = i;\n count += 1;\n }\n _transactionIds = new uint[](to - from);\n for (i=from; i<to; i++)\n _transactionIds[i - from] = transactionIdsTemp[i];\n }\n}",
- "2.0.0/multisig/MultiSigWalletWithTimeLock.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MultiSigWallet.sol\";\n\n\n/// @title Multisignature wallet with time lock- Allows multiple parties to execute a transaction after a time lock has passed.\n/// @author Amir Bandeali - <amir@0xProject.com>\n// solhint-disable not-rely-on-time\ncontract MultiSigWalletWithTimeLock is\n MultiSigWallet\n{\n event ConfirmationTimeSet(uint256 indexed transactionId, uint256 confirmationTime);\n event TimeLockChange(uint256 secondsTimeLocked);\n\n uint256 public secondsTimeLocked;\n\n mapping (uint256 => uint256) public confirmationTimes;\n\n modifier notFullyConfirmed(uint256 transactionId) {\n require(\n !isConfirmed(transactionId),\n \"TX_FULLY_CONFIRMED\"\n );\n _;\n }\n\n modifier fullyConfirmed(uint256 transactionId) {\n require(\n isConfirmed(transactionId),\n \"TX_NOT_FULLY_CONFIRMED\"\n );\n _;\n }\n\n modifier pastTimeLock(uint256 transactionId) {\n require(\n block.timestamp >= confirmationTimes[transactionId] + secondsTimeLocked,\n \"TIME_LOCK_INCOMPLETE\"\n );\n _;\n }\n\n /// @dev Contract constructor sets initial owners, required number of confirmations, and time lock.\n /// @param _owners List of initial owners.\n /// @param _required Number of required confirmations.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n constructor (\n address[] _owners,\n uint256 _required,\n uint256 _secondsTimeLocked\n )\n public\n MultiSigWallet(_owners, _required)\n {\n secondsTimeLocked = _secondsTimeLocked;\n }\n\n /// @dev Changes the duration of the time lock for transactions.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n function changeTimeLock(uint256 _secondsTimeLocked)\n public\n onlyWallet\n {\n secondsTimeLocked = _secondsTimeLocked;\n emit TimeLockChange(_secondsTimeLocked);\n }\n\n /// @dev Allows an owner to confirm a transaction.\n /// @param transactionId Transaction ID.\n function confirmTransaction(uint256 transactionId)\n public\n ownerExists(msg.sender)\n transactionExists(transactionId)\n notConfirmed(transactionId, msg.sender)\n notFullyConfirmed(transactionId)\n {\n confirmations[transactionId][msg.sender] = true;\n emit Confirmation(msg.sender, transactionId);\n if (isConfirmed(transactionId)) {\n setConfirmationTime(transactionId, block.timestamp);\n }\n }\n\n /// @dev Allows anyone to execute a confirmed transaction.\n /// @param transactionId Transaction ID.\n function executeTransaction(uint256 transactionId)\n public\n notExecuted(transactionId)\n fullyConfirmed(transactionId)\n pastTimeLock(transactionId)\n {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) {\n emit Execution(transactionId);\n } else {\n emit ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n\n /// @dev Sets the time of when a submission first passed.\n function setConfirmationTime(uint256 transactionId, uint256 confirmationTime)\n internal\n {\n confirmationTimes[transactionId] = confirmationTime;\n emit ConfirmationTimeSet(transactionId, confirmationTime);\n }\n}\n",
- "2.0.0/protocol/AssetProxy/ERC20Proxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MixinAuthorizable.sol\";\n\n\ncontract ERC20Proxy is\n MixinAuthorizable\n{\n // Id of this proxy.\n bytes4 constant internal PROXY_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n \n // solhint-disable-next-line payable-fallback\n function () \n external\n {\n assembly {\n // The first 4 bytes of calldata holds the function selector\n let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)\n\n // `transferFrom` will be called with the following parameters:\n // assetData Encoded byte array.\n // from Address to transfer asset from.\n // to Address to transfer asset to.\n // amount Amount of asset to transfer.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {\n\n // To lookup a value in a mapping, we load from the storage location keccak256(k, p),\n // where k is the key left padded to 32 bytes and p is the storage slot\n let start := mload(64)\n mstore(start, and(caller, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(start, 32), authorized_slot)\n\n // Revert if authorized[msg.sender] == false\n if iszero(sload(keccak256(start, 64))) {\n // Revert with `Error(\"SENDER_NOT_AUTHORIZED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // `transferFrom`.\n // The function is marked `external`, so no abi decodeding is done for\n // us. Instead, we expect the `calldata` memory to contain the\n // following:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n //\n // (*): offset is computed from start of function parameters, so offset\n // by an additional 4 bytes in the calldata.\n //\n // (**): see table below to compute length of assetData Contents\n //\n // WARNING: The ABIv2 specification allows additional padding between\n // the Params and Data section. This will result in a larger\n // offset to assetData.\n\n // Asset data itself is encoded as follows:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 1 * 32 | function parameters: |\n // | | 4 | 12 + 20 | 1. token address |\n\n // We construct calldata for the `token.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 4 | | 1. from |\n // | | 36 | | 2. to |\n // | | 68 | | 3. amount |\n\n /////// Read token address from calldata ///////\n // * The token address is stored in `assetData`.\n //\n // * The \"offset to assetData\" is stored at offset 4 in the calldata (table 1).\n // [assetDataOffsetFromParams = calldataload(4)]\n //\n // * Notes that the \"offset to assetData\" is relative to the \"Params\" area of calldata;\n // add 4 bytes to account for the length of the \"Header\" area (table 1).\n // [assetDataOffsetFromHeader = assetDataOffsetFromParams + 4]\n //\n // * The \"token address\" is offset 32+4=36 bytes into \"assetData\" (tables 1 & 2).\n // [tokenOffset = assetDataOffsetFromHeader + 36 = calldataload(4) + 4 + 36]\n let token := calldataload(add(calldataload(4), 40))\n \n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFrom` selector.\n // Any trailing data in transferFromSelector will be\n // overwritten in the next `mstore` call.\n mstore(0, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // We copy the fields `from`, `to` and `amount` in bulk\n // from our own calldata to the new calldata.\n calldatacopy(4, 36, 96)\n\n /////// Call `token.transferFrom` using the calldata ///////\n let success := call(\n gas, // forward all gas\n token, // call address of token contract\n 0, // don't send any ETH\n 0, // pointer to start of input\n 100, // length of input\n 0, // write output over input\n 32 // output size should be 32 bytes\n )\n\n /////// Check return data. ///////\n // If there is no return data, we assume the token incorrectly\n // does not return a bool. In this case we expect it to revert\n // on failure, which was handled above.\n // If the token does return data, we require that it is a single\n // nonzero 32 bytes value.\n // So the transfer succeeded if the call succeeded and either\n // returned nothing, or returned a non-zero 32 byte value. \n success := and(success, or(\n iszero(returndatasize),\n and(\n eq(returndatasize, 32),\n gt(mload(0), 0)\n )\n ))\n if success {\n return(0, 0)\n }\n \n // Revert with `Error(\"TRANSFER_FAILED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // Revert if undefined function is called\n revert(0, 0)\n }\n }\n\n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4)\n {\n return PROXY_ID;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/ERC721Proxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MixinAuthorizable.sol\";\n\n\ncontract ERC721Proxy is\n MixinAuthorizable\n{\n // Id of this proxy.\n bytes4 constant internal PROXY_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n\n // solhint-disable-next-line payable-fallback\n function () \n external\n {\n assembly {\n // The first 4 bytes of calldata holds the function selector\n let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)\n\n // `transferFrom` will be called with the following parameters:\n // assetData Encoded byte array.\n // from Address to transfer asset from.\n // to Address to transfer asset to.\n // amount Amount of asset to transfer.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {\n\n // To lookup a value in a mapping, we load from the storage location keccak256(k, p),\n // where k is the key left padded to 32 bytes and p is the storage slot\n let start := mload(64)\n mstore(start, and(caller, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(start, 32), authorized_slot)\n\n // Revert if authorized[msg.sender] == false\n if iszero(sload(keccak256(start, 64))) {\n // Revert with `Error(\"SENDER_NOT_AUTHORIZED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // `transferFrom`.\n // The function is marked `external`, so no abi decodeding is done for\n // us. Instead, we expect the `calldata` memory to contain the\n // following:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n //\n // (*): offset is computed from start of function parameters, so offset\n // by an additional 4 bytes in the calldata.\n //\n // (**): see table below to compute length of assetData Contents\n //\n // WARNING: The ABIv2 specification allows additional padding between\n // the Params and Data section. This will result in a larger\n // offset to assetData.\n\n // Asset data itself is encoded as follows:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 2 * 32 | function parameters: |\n // | | 4 | 12 + 20 | 1. token address |\n // | | 36 | | 2. tokenId |\n \n // We construct calldata for the `token.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n // \n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 4 | | 1. from |\n // | | 36 | | 2. to |\n // | | 68 | | 3. tokenId |\n\n // There exists only 1 of each token.\n // require(amount == 1, \"INVALID_AMOUNT\")\n if sub(calldataload(100), 1) {\n // Revert with `Error(\"INVALID_AMOUNT\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000e494e56414c49445f414d4f554e540000000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFrom` selector.\n // Any trailing data in transferFromSelector will be\n // overwritten in the next `mstore` call.\n mstore(0, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // We copy the fields `from` and `to` in bulk\n // from our own calldata to the new calldata.\n calldatacopy(4, 36, 64)\n\n // Copy `tokenId` field from our own calldata to the new calldata.\n let assetDataOffset := calldataload(4)\n calldatacopy(68, add(assetDataOffset, 72), 32)\n\n /////// Call `token.transferFrom` using the calldata ///////\n let token := calldataload(add(assetDataOffset, 40))\n let success := call(\n gas, // forward all gas\n token, // call address of token contract\n 0, // don't send any ETH\n 0, // pointer to start of input\n 100, // length of input\n 0, // write output to null\n 0 // output size is 0 bytes\n )\n if success {\n return(0, 0)\n }\n \n // Revert with `Error(\"TRANSFER_FAILED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // Revert if undefined function is called\n revert(0, 0)\n }\n }\n\n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4)\n {\n return PROXY_ID;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/MixinAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"./mixins/MAuthorizable.sol\";\n\n\ncontract MixinAuthorizable is\n Ownable,\n MAuthorizable\n{\n /// @dev Only authorized addresses can invoke functions with this modifier.\n modifier onlyAuthorized {\n require(\n authorized[msg.sender],\n \"SENDER_NOT_AUTHORIZED\"\n );\n _;\n }\n\n mapping (address => bool) public authorized;\n address[] public authorities;\n\n /// @dev Authorizes an address.\n /// @param target Address to authorize.\n function addAuthorizedAddress(address target)\n external\n onlyOwner\n {\n require(\n !authorized[target],\n \"TARGET_ALREADY_AUTHORIZED\"\n );\n\n authorized[target] = true;\n authorities.push(target);\n emit AuthorizedAddressAdded(target, msg.sender);\n }\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n function removeAuthorizedAddress(address target)\n external\n onlyOwner\n {\n require(\n authorized[target],\n \"TARGET_NOT_AUTHORIZED\"\n );\n\n delete authorized[target];\n for (uint256 i = 0; i < authorities.length; i++) {\n if (authorities[i] == target) {\n authorities[i] = authorities[authorities.length - 1];\n authorities.length -= 1;\n break;\n }\n }\n emit AuthorizedAddressRemoved(target, msg.sender);\n }\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n /// @param index Index of target in authorities array.\n function removeAuthorizedAddressAtIndex(\n address target,\n uint256 index\n )\n external\n onlyOwner\n {\n require(\n authorized[target],\n \"TARGET_NOT_AUTHORIZED\"\n );\n require(\n index < authorities.length,\n \"INDEX_OUT_OF_BOUNDS\"\n );\n require(\n authorities[index] == target,\n \"AUTHORIZED_ADDRESS_MISMATCH\"\n );\n\n delete authorized[target];\n authorities[index] = authorities[authorities.length - 1];\n authorities.length -= 1;\n emit AuthorizedAddressRemoved(target, msg.sender);\n }\n\n /// @dev Gets all authorized addresses.\n /// @return Array of authorized addresses.\n function getAuthorizedAddresses()\n external\n view\n returns (address[] memory)\n {\n return authorities;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IAuthorizable.sol\";\n\n\ncontract IAssetProxy is\n IAuthorizable\n{\n /// @dev Transfers assets. Either succeeds or throws.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param from Address to transfer asset from.\n /// @param to Address to transfer asset to.\n /// @param amount Amount of asset to transfer.\n function transferFrom(\n bytes assetData,\n address from,\n address to,\n uint256 amount\n )\n external;\n \n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4);\n}\n",
- "2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/Ownable/IOwnable.sol\";\n\n\ncontract IAuthorizable is\n IOwnable\n{\n /// @dev Authorizes an address.\n /// @param target Address to authorize.\n function addAuthorizedAddress(address target)\n external;\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n function removeAuthorizedAddress(address target)\n external;\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n /// @param index Index of target in authorities array.\n function removeAuthorizedAddressAtIndex(\n address target,\n uint256 index\n )\n external;\n \n /// @dev Gets all authorized addresses.\n /// @return Array of authorized addresses.\n function getAuthorizedAddresses()\n external\n view\n returns (address[] memory);\n}\n",
- "2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAuthorizable.sol\";\n\n\ncontract MAuthorizable is\n IAuthorizable\n{\n // Event logged when a new address is authorized.\n event AuthorizedAddressAdded(\n address indexed target,\n address indexed caller\n );\n\n // Event logged when a currently authorized address is unauthorized.\n event AuthorizedAddressRemoved(\n address indexed target,\n address indexed caller\n );\n\n /// @dev Only authorized addresses can invoke functions with this modifier.\n modifier onlyAuthorized { revert(); _; }\n}\n",
- "2.0.0/protocol/AssetProxyOwner/AssetProxyOwner.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../multisig/MultiSigWalletWithTimeLock.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\n\n\ncontract AssetProxyOwner is\n MultiSigWalletWithTimeLock\n{\n using LibBytes for bytes;\n\n event AssetProxyRegistration(address assetProxyContract, bool isRegistered);\n\n // Mapping of AssetProxy contract address =>\n // if this contract is allowed to call the AssetProxy's `removeAuthorizedAddressAtIndex` method without a time lock.\n mapping (address => bool) public isAssetProxyRegistered;\n\n bytes4 constant internal REMOVE_AUTHORIZED_ADDRESS_AT_INDEX_SELECTOR = bytes4(keccak256(\"removeAuthorizedAddressAtIndex(address,uint256)\"));\n\n /// @dev Function will revert if the transaction does not call `removeAuthorizedAddressAtIndex`\n /// on an approved AssetProxy contract.\n modifier validRemoveAuthorizedAddressAtIndexTx(uint256 transactionId) {\n Transaction storage txn = transactions[transactionId];\n require(\n isAssetProxyRegistered[txn.destination],\n \"UNREGISTERED_ASSET_PROXY\"\n );\n require(\n txn.data.readBytes4(0) == REMOVE_AUTHORIZED_ADDRESS_AT_INDEX_SELECTOR,\n \"INVALID_FUNCTION_SELECTOR\"\n );\n _;\n }\n\n /// @dev Contract constructor sets initial owners, required number of confirmations,\n /// time lock, and list of AssetProxy addresses.\n /// @param _owners List of initial owners.\n /// @param _assetProxyContracts Array of AssetProxy contract addresses.\n /// @param _required Number of required confirmations.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n constructor (\n address[] memory _owners,\n address[] memory _assetProxyContracts,\n uint256 _required,\n uint256 _secondsTimeLocked\n )\n public\n MultiSigWalletWithTimeLock(_owners, _required, _secondsTimeLocked)\n {\n for (uint256 i = 0; i < _assetProxyContracts.length; i++) {\n address assetProxy = _assetProxyContracts[i];\n require(\n assetProxy != address(0),\n \"INVALID_ASSET_PROXY\"\n );\n isAssetProxyRegistered[assetProxy] = true;\n }\n }\n\n /// @dev Registers or deregisters an AssetProxy to be able to execute\n /// `removeAuthorizedAddressAtIndex` without a timelock.\n /// @param assetProxyContract Address of AssetProxy contract.\n /// @param isRegistered Status of approval for AssetProxy contract.\n function registerAssetProxy(address assetProxyContract, bool isRegistered)\n public\n onlyWallet\n notNull(assetProxyContract)\n {\n isAssetProxyRegistered[assetProxyContract] = isRegistered;\n emit AssetProxyRegistration(assetProxyContract, isRegistered);\n }\n\n /// @dev Allows execution of `removeAuthorizedAddressAtIndex` without time lock.\n /// @param transactionId Transaction ID.\n function executeRemoveAuthorizedAddressAtIndex(uint256 transactionId)\n public\n notExecuted(transactionId)\n fullyConfirmed(transactionId)\n validRemoveAuthorizedAddressAtIndexTx(transactionId)\n {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) {\n emit Execution(transactionId);\n } else {\n emit ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/Exchange.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./MixinExchangeCore.sol\";\nimport \"./MixinSignatureValidator.sol\";\nimport \"./MixinWrapperFunctions.sol\";\nimport \"./MixinAssetProxyDispatcher.sol\";\nimport \"./MixinTransactions.sol\";\nimport \"./MixinMatchOrders.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract Exchange is\n MixinExchangeCore,\n MixinMatchOrders,\n MixinSignatureValidator,\n MixinTransactions,\n MixinAssetProxyDispatcher,\n MixinWrapperFunctions\n{\n string constant public VERSION = \"2.0.1-alpha\";\n\n // Mixins are instantiated in the order they are inherited\n constructor (bytes memory _zrxAssetData)\n public\n LibConstants(_zrxAssetData) // @TODO: Remove when we deploy.\n MixinExchangeCore()\n MixinMatchOrders()\n MixinSignatureValidator()\n MixinTransactions()\n MixinAssetProxyDispatcher()\n MixinWrapperFunctions()\n {}\n}\n",
- "2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\nimport \"../AssetProxy/interfaces/IAssetProxy.sol\";\n\n\ncontract MixinAssetProxyDispatcher is\n Ownable,\n MAssetProxyDispatcher\n{\n // Mapping from Asset Proxy Id's to their respective Asset Proxy\n mapping (bytes4 => IAssetProxy) public assetProxies;\n\n /// @dev Registers an asset proxy to its asset proxy id.\n /// Once an asset proxy is registered, it cannot be unregistered.\n /// @param assetProxy Address of new asset proxy to register.\n function registerAssetProxy(address assetProxy)\n external\n onlyOwner\n {\n IAssetProxy assetProxyContract = IAssetProxy(assetProxy);\n\n // Ensure that no asset proxy exists with current id.\n bytes4 assetProxyId = assetProxyContract.getProxyId();\n address currentAssetProxy = assetProxies[assetProxyId];\n require(\n currentAssetProxy == address(0),\n \"ASSET_PROXY_ALREADY_EXISTS\"\n );\n\n // Add asset proxy and log registration.\n assetProxies[assetProxyId] = assetProxyContract;\n emit AssetProxyRegistered(\n assetProxyId,\n assetProxy\n );\n }\n\n /// @dev Gets an asset proxy.\n /// @param assetProxyId Id of the asset proxy.\n /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered.\n function getAssetProxy(bytes4 assetProxyId)\n external\n view\n returns (address)\n {\n return assetProxies[assetProxyId];\n }\n\n /// @dev Forwards arguments to assetProxy and calls `transferFrom`. Either succeeds or throws.\n /// @param assetData Byte array encoded for the asset.\n /// @param from Address to transfer token from.\n /// @param to Address to transfer token to.\n /// @param amount Amount of token to transfer.\n function dispatchTransferFrom(\n bytes memory assetData,\n address from,\n address to,\n uint256 amount\n )\n internal\n {\n // Do nothing if no amount should be transferred.\n if (amount > 0 && from != to) {\n // Ensure assetData length is valid\n require(\n assetData.length > 3,\n \"LENGTH_GREATER_THAN_3_REQUIRED\"\n );\n \n // Lookup assetProxy. We do not use `LibBytes.readBytes4` for gas efficiency reasons.\n bytes4 assetProxyId;\n assembly {\n assetProxyId := and(mload(\n add(assetData, 32)),\n 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000\n )\n }\n address assetProxy = assetProxies[assetProxyId];\n\n // Ensure that assetProxy exists\n require(\n assetProxy != address(0),\n \"ASSET_PROXY_DOES_NOT_EXIST\"\n );\n \n // We construct calldata for the `assetProxy.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n // \n // | Area | Offset | Length | Contents |\n // | -------- |--------|---------|-------------------------------------------- |\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n\n assembly {\n /////// Setup State ///////\n // `cdStart` is the start of the calldata for `assetProxy.transferFrom` (equal to free memory ptr).\n let cdStart := mload(64)\n // `dataAreaLength` is the total number of words needed to store `assetData`\n // As-per the ABI spec, this value is padded up to the nearest multiple of 32,\n // and includes 32-bytes for length.\n let dataAreaLength := and(add(mload(assetData), 63), 0xFFFFFFFFFFFE0)\n // `cdEnd` is the end of the calldata for `assetProxy.transferFrom`.\n let cdEnd := add(cdStart, add(132, dataAreaLength))\n\n \n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFromSelector`.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n mstore(cdStart, 0xa85e59e400000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // Each parameter is padded to 32-bytes. The entire Params Area is 128 bytes.\n // Notes:\n // 1. The offset to `assetData` is the length of the Params Area (128 bytes).\n // 2. A 20-byte mask is applied to addresses to zero-out the unused bytes.\n mstore(add(cdStart, 4), 128)\n mstore(add(cdStart, 36), and(from, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(cdStart, 68), and(to, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(cdStart, 100), amount)\n \n /////// Setup Data Area ///////\n // This area holds `assetData`.\n let dataArea := add(cdStart, 132)\n // solhint-disable-next-line no-empty-blocks\n for {} lt(dataArea, cdEnd) {} {\n mstore(dataArea, mload(assetData))\n dataArea := add(dataArea, 32)\n assetData := add(assetData, 32)\n }\n\n /////// Call `assetProxy.transferFrom` using the constructed calldata ///////\n let success := call(\n gas, // forward all gas\n assetProxy, // call address of asset proxy\n 0, // don't send any ETH\n cdStart, // pointer to start of input\n sub(cdEnd, cdStart), // length of input \n cdStart, // write output over input\n 512 // reserve 512 bytes for output\n )\n if iszero(success) {\n revert(cdStart, returndatasize())\n }\n }\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\n\n\ncontract MixinExchangeCore is\n ReentrancyGuard,\n LibConstants,\n LibMath,\n LibOrder,\n LibFillResults,\n MAssetProxyDispatcher,\n MExchangeCore,\n MSignatureValidator,\n MTransactions\n{\n // Mapping of orderHash => amount of takerAsset already bought by maker\n mapping (bytes32 => uint256) public filled;\n\n // Mapping of orderHash => cancelled\n mapping (bytes32 => bool) public cancelled;\n\n // Mapping of makerAddress => senderAddress => lowest salt an order can have in order to be fillable\n // Orders with specified senderAddress and with a salt less than their epoch are considered cancelled\n mapping (address => mapping (address => uint256)) public orderEpoch;\n\n /// @dev Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch\n /// and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress).\n /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled.\n function cancelOrdersUpTo(uint256 targetOrderEpoch)\n external\n nonReentrant\n {\n address makerAddress = getCurrentContextAddress();\n // If this function is called via `executeTransaction`, we only update the orderEpoch for the makerAddress/msg.sender combination.\n // This allows external filter contracts to add rules to how orders are cancelled via this function.\n address senderAddress = makerAddress == msg.sender ? address(0) : msg.sender;\n\n // orderEpoch is initialized to 0, so to cancelUpTo we need salt + 1\n uint256 newOrderEpoch = targetOrderEpoch + 1; \n uint256 oldOrderEpoch = orderEpoch[makerAddress][senderAddress];\n\n // Ensure orderEpoch is monotonically increasing\n require(\n newOrderEpoch > oldOrderEpoch, \n \"INVALID_NEW_ORDER_EPOCH\"\n );\n\n // Update orderEpoch\n orderEpoch[makerAddress][senderAddress] = newOrderEpoch;\n emit CancelUpTo(\n makerAddress,\n senderAddress,\n newOrderEpoch\n );\n }\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrder(\n Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n nonReentrant\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n return fillResults;\n }\n\n /// @dev After calling, the order can not be filled anymore.\n /// Throws if order is invalid or sender does not have permission to cancel.\n /// @param order Order to cancel. Order must be OrderStatus.FILLABLE.\n function cancelOrder(Order memory order)\n public\n nonReentrant\n {\n cancelOrderInternal(order);\n }\n\n /// @dev Gets information about an order: status, hash, and amount filled.\n /// @param order Order to gather information on.\n /// @return OrderInfo Information about the order and its state.\n /// See LibOrder.OrderInfo for a complete description.\n function getOrderInfo(Order memory order)\n public\n view\n returns (OrderInfo memory orderInfo)\n {\n // Compute the order hash\n orderInfo.orderHash = getOrderHash(order);\n\n // Fetch filled amount\n orderInfo.orderTakerAssetFilledAmount = filled[orderInfo.orderHash];\n\n // If order.makerAssetAmount is zero, we also reject the order.\n // While the Exchange contract handles them correctly, they create\n // edge cases in the supporting infrastructure because they have\n // an 'infinite' price when computed by a simple division.\n if (order.makerAssetAmount == 0) {\n orderInfo.orderStatus = uint8(OrderStatus.INVALID_MAKER_ASSET_AMOUNT);\n return orderInfo;\n }\n\n // If order.takerAssetAmount is zero, then the order will always\n // be considered filled because 0 == takerAssetAmount == orderTakerAssetFilledAmount\n // Instead of distinguishing between unfilled and filled zero taker\n // amount orders, we choose not to support them.\n if (order.takerAssetAmount == 0) {\n orderInfo.orderStatus = uint8(OrderStatus.INVALID_TAKER_ASSET_AMOUNT);\n return orderInfo;\n }\n\n // Validate order availability\n if (orderInfo.orderTakerAssetFilledAmount >= order.takerAssetAmount) {\n orderInfo.orderStatus = uint8(OrderStatus.FULLY_FILLED);\n return orderInfo;\n }\n\n // Validate order expiration\n // solhint-disable-next-line not-rely-on-time\n if (block.timestamp >= order.expirationTimeSeconds) {\n orderInfo.orderStatus = uint8(OrderStatus.EXPIRED);\n return orderInfo;\n }\n\n // Check if order has been cancelled\n if (cancelled[orderInfo.orderHash]) {\n orderInfo.orderStatus = uint8(OrderStatus.CANCELLED);\n return orderInfo;\n }\n if (orderEpoch[order.makerAddress][order.senderAddress] > order.salt) {\n orderInfo.orderStatus = uint8(OrderStatus.CANCELLED);\n return orderInfo;\n }\n\n // All other statuses are ruled out: order is Fillable\n orderInfo.orderStatus = uint8(OrderStatus.FILLABLE);\n return orderInfo;\n }\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderInternal(\n Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n // Fetch order info\n OrderInfo memory orderInfo = getOrderInfo(order);\n\n // Fetch taker address\n address takerAddress = getCurrentContextAddress();\n \n // Assert that the order is fillable by taker\n assertFillableOrder(\n order,\n orderInfo,\n takerAddress,\n signature\n );\n \n // Get amount of takerAsset to fill\n uint256 remainingTakerAssetAmount = safeSub(order.takerAssetAmount, orderInfo.orderTakerAssetFilledAmount);\n uint256 takerAssetFilledAmount = min256(takerAssetFillAmount, remainingTakerAssetAmount);\n\n // Validate context\n assertValidFill(\n order,\n orderInfo,\n takerAssetFillAmount,\n takerAssetFilledAmount,\n fillResults.makerAssetFilledAmount\n );\n\n // Compute proportional fill amounts\n fillResults = calculateFillResults(order, takerAssetFilledAmount);\n\n // Update exchange internal state\n updateFilledState(\n order,\n takerAddress,\n orderInfo.orderHash,\n orderInfo.orderTakerAssetFilledAmount,\n fillResults\n );\n \n // Settle order\n settleOrder(\n order,\n takerAddress,\n fillResults\n );\n\n return fillResults;\n }\n\n /// @dev After calling, the order can not be filled anymore.\n /// Throws if order is invalid or sender does not have permission to cancel.\n /// @param order Order to cancel. Order must be OrderStatus.FILLABLE.\n function cancelOrderInternal(Order memory order)\n internal\n {\n // Fetch current order status\n OrderInfo memory orderInfo = getOrderInfo(order);\n\n // Validate context\n assertValidCancel(order, orderInfo);\n\n // Perform cancel\n updateCancelledState(order, orderInfo.orderHash);\n }\n\n /// @dev Updates state with results of a fill order.\n /// @param order that was filled.\n /// @param takerAddress Address of taker who filled the order.\n /// @param orderTakerAssetFilledAmount Amount of order already filled.\n function updateFilledState(\n Order memory order,\n address takerAddress,\n bytes32 orderHash,\n uint256 orderTakerAssetFilledAmount,\n FillResults memory fillResults\n )\n internal\n {\n // Update state\n filled[orderHash] = safeAdd(orderTakerAssetFilledAmount, fillResults.takerAssetFilledAmount);\n\n // Log order\n emit Fill(\n order.makerAddress,\n order.feeRecipientAddress,\n takerAddress,\n msg.sender,\n fillResults.makerAssetFilledAmount,\n fillResults.takerAssetFilledAmount,\n fillResults.makerFeePaid,\n fillResults.takerFeePaid,\n orderHash,\n order.makerAssetData,\n order.takerAssetData\n );\n }\n\n /// @dev Updates state with results of cancelling an order.\n /// State is only updated if the order is currently fillable.\n /// Otherwise, updating state would have no effect.\n /// @param order that was cancelled.\n /// @param orderHash Hash of order that was cancelled.\n function updateCancelledState(\n Order memory order,\n bytes32 orderHash\n )\n internal\n {\n // Perform cancel\n cancelled[orderHash] = true;\n\n // Log cancel\n emit Cancel(\n order.makerAddress,\n order.feeRecipientAddress,\n msg.sender,\n orderHash,\n order.makerAssetData,\n order.takerAssetData\n );\n }\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAddress Address of order taker.\n /// @param signature Proof that the orders was created by its maker.\n function assertFillableOrder(\n Order memory order,\n OrderInfo memory orderInfo,\n address takerAddress,\n bytes memory signature\n )\n internal\n view\n {\n // An order can only be filled if its status is FILLABLE.\n require(\n orderInfo.orderStatus == uint8(OrderStatus.FILLABLE),\n \"ORDER_UNFILLABLE\"\n );\n \n // Validate sender is allowed to fill this order\n if (order.senderAddress != address(0)) {\n require(\n order.senderAddress == msg.sender,\n \"INVALID_SENDER\"\n );\n }\n \n // Validate taker is allowed to fill this order\n if (order.takerAddress != address(0)) {\n require(\n order.takerAddress == takerAddress,\n \"INVALID_TAKER\"\n );\n }\n \n // Validate Maker signature (check only if first time seen)\n if (orderInfo.orderTakerAssetFilledAmount == 0) {\n require(\n isValidSignature(\n orderInfo.orderHash,\n order.makerAddress,\n signature\n ),\n \"INVALID_ORDER_SIGNATURE\"\n );\n }\n }\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAssetFillAmount Desired amount of order to fill by taker.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @param makerAssetFilledAmount Amount of makerAsset that will be transfered.\n function assertValidFill(\n Order memory order,\n OrderInfo memory orderInfo,\n uint256 takerAssetFillAmount, // TODO: use FillResults\n uint256 takerAssetFilledAmount,\n uint256 makerAssetFilledAmount\n )\n internal\n view\n {\n // Revert if fill amount is invalid\n // TODO: reconsider necessity for v2.1\n require(\n takerAssetFillAmount != 0,\n \"INVALID_TAKER_AMOUNT\"\n );\n \n // Make sure taker does not pay more than desired amount\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n takerAssetFilledAmount <= takerAssetFillAmount,\n \"TAKER_OVERPAY\"\n );\n \n // Make sure order is not overfilled\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n safeAdd(orderInfo.orderTakerAssetFilledAmount, takerAssetFilledAmount) <= order.takerAssetAmount,\n \"ORDER_OVERFILL\"\n );\n \n // Make sure order is filled at acceptable price.\n // The order has an implied price from the makers perspective:\n // order price = order.makerAssetAmount / order.takerAssetAmount\n // i.e. the number of makerAsset maker is paying per takerAsset. The\n // maker is guaranteed to get this price or a better (lower) one. The\n // actual price maker is getting in this fill is:\n // fill price = makerAssetFilledAmount / takerAssetFilledAmount\n // We need `fill price <= order price` for the fill to be fair to maker.\n // This amounts to:\n // makerAssetFilledAmount order.makerAssetAmount\n // ------------------------ <= -----------------------\n // takerAssetFilledAmount order.takerAssetAmount\n // or, equivalently:\n // makerAssetFilledAmount * order.takerAssetAmount <=\n // order.makerAssetAmount * takerAssetFilledAmount\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n safeMul(makerAssetFilledAmount, order.takerAssetAmount)\n <= \n safeMul(order.makerAssetAmount, takerAssetFilledAmount),\n \"INVALID_FILL_PRICE\"\n );\n }\n\n /// @dev Validates context for cancelOrder. Succeeds or throws.\n /// @param order to be cancelled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n function assertValidCancel(\n Order memory order,\n OrderInfo memory orderInfo\n )\n internal\n view\n {\n // Ensure order is valid\n // An order can only be cancelled if its status is FILLABLE.\n require(\n orderInfo.orderStatus == uint8(OrderStatus.FILLABLE),\n \"ORDER_UNFILLABLE\"\n );\n\n // Validate sender is allowed to cancel this order\n if (order.senderAddress != address(0)) {\n require(\n order.senderAddress == msg.sender,\n \"INVALID_SENDER\"\n );\n }\n\n // Validate transaction signed by maker\n address makerAddress = getCurrentContextAddress();\n require(\n order.makerAddress == makerAddress,\n \"INVALID_MAKER\"\n );\n }\n\n /// @dev Calculates amounts filled and fees paid by maker and taker.\n /// @param order to be filled.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function calculateFillResults(\n Order memory order,\n uint256 takerAssetFilledAmount\n )\n internal\n pure\n returns (FillResults memory fillResults)\n {\n // Compute proportional transfer amounts\n fillResults.takerAssetFilledAmount = takerAssetFilledAmount;\n fillResults.makerAssetFilledAmount = safeGetPartialAmountFloor(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.makerAssetAmount\n );\n fillResults.makerFeePaid = safeGetPartialAmountFloor(\n fillResults.makerAssetFilledAmount,\n order.makerAssetAmount,\n order.makerFee\n );\n fillResults.takerFeePaid = safeGetPartialAmountFloor(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.takerFee\n );\n\n return fillResults;\n }\n\n /// @dev Settles an order by transferring assets between counterparties.\n /// @param order Order struct containing order specifications.\n /// @param takerAddress Address selling takerAsset and buying makerAsset.\n /// @param fillResults Amounts to be filled and fees paid by maker and taker.\n function settleOrder(\n LibOrder.Order memory order,\n address takerAddress,\n LibFillResults.FillResults memory fillResults\n )\n private\n {\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n dispatchTransferFrom(\n order.makerAssetData,\n order.makerAddress,\n takerAddress,\n fillResults.makerAssetFilledAmount\n );\n dispatchTransferFrom(\n order.takerAssetData,\n takerAddress,\n order.makerAddress,\n fillResults.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n zrxAssetData,\n order.makerAddress,\n order.feeRecipientAddress,\n fillResults.makerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n order.feeRecipientAddress,\n fillResults.takerFeePaid\n );\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinMatchOrders.sol": "/*\n Copyright 2018 ZeroEx Intl.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n http://www.apache.org/licenses/LICENSE-2.0\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MMatchOrders.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\n\n\ncontract MixinMatchOrders is\n ReentrancyGuard,\n LibConstants,\n LibMath,\n MAssetProxyDispatcher,\n MExchangeCore,\n MMatchOrders,\n MTransactions\n{\n /// @dev Match two complementary orders that have a profitable spread.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the left order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftSignature Proof that order was created by the left maker.\n /// @param rightSignature Proof that order was created by the right maker.\n /// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.\n function matchOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n bytes memory leftSignature,\n bytes memory rightSignature\n )\n public\n nonReentrant\n returns (LibFillResults.MatchedFillResults memory matchedFillResults)\n {\n // We assume that rightOrder.takerAssetData == leftOrder.makerAssetData and rightOrder.makerAssetData == leftOrder.takerAssetData.\n // If this assumption isn't true, the match will fail at signature validation.\n rightOrder.makerAssetData = leftOrder.takerAssetData;\n rightOrder.takerAssetData = leftOrder.makerAssetData;\n\n // Get left & right order info\n LibOrder.OrderInfo memory leftOrderInfo = getOrderInfo(leftOrder);\n LibOrder.OrderInfo memory rightOrderInfo = getOrderInfo(rightOrder);\n\n // Fetch taker address\n address takerAddress = getCurrentContextAddress();\n \n // Either our context is valid or we revert\n assertFillableOrder(\n leftOrder,\n leftOrderInfo,\n takerAddress,\n leftSignature\n );\n assertFillableOrder(\n rightOrder,\n rightOrderInfo,\n takerAddress,\n rightSignature\n );\n assertValidMatch(leftOrder, rightOrder);\n\n // Compute proportional fill amounts\n matchedFillResults = calculateMatchedFillResults(\n leftOrder,\n rightOrder,\n leftOrderInfo.orderTakerAssetFilledAmount,\n rightOrderInfo.orderTakerAssetFilledAmount\n );\n\n // Validate fill contexts\n assertValidFill(\n leftOrder,\n leftOrderInfo,\n matchedFillResults.left.takerAssetFilledAmount,\n matchedFillResults.left.takerAssetFilledAmount,\n matchedFillResults.left.makerAssetFilledAmount\n );\n assertValidFill(\n rightOrder,\n rightOrderInfo,\n matchedFillResults.right.takerAssetFilledAmount,\n matchedFillResults.right.takerAssetFilledAmount,\n matchedFillResults.right.makerAssetFilledAmount\n );\n \n // Update exchange state\n updateFilledState(\n leftOrder,\n takerAddress,\n leftOrderInfo.orderHash,\n leftOrderInfo.orderTakerAssetFilledAmount,\n matchedFillResults.left\n );\n updateFilledState(\n rightOrder,\n takerAddress,\n rightOrderInfo.orderHash,\n rightOrderInfo.orderTakerAssetFilledAmount,\n matchedFillResults.right\n );\n\n // Settle matched orders. Succeeds or throws.\n settleMatchedOrders(\n leftOrder,\n rightOrder,\n takerAddress,\n matchedFillResults\n );\n\n return matchedFillResults;\n }\n\n /// @dev Validates context for matchOrders. Succeeds or throws.\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n function assertValidMatch(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder\n )\n internal\n pure\n {\n // Make sure there is a profitable spread.\n // There is a profitable spread iff the cost per unit bought (OrderA.MakerAmount/OrderA.TakerAmount) for each order is greater\n // than the profit per unit sold of the matched order (OrderB.TakerAmount/OrderB.MakerAmount).\n // This is satisfied by the equations below:\n // <leftOrder.makerAssetAmount> / <leftOrder.takerAssetAmount> >= <rightOrder.takerAssetAmount> / <rightOrder.makerAssetAmount>\n // AND\n // <rightOrder.makerAssetAmount> / <rightOrder.takerAssetAmount> >= <leftOrder.takerAssetAmount> / <leftOrder.makerAssetAmount>\n // These equations can be combined to get the following:\n require(\n safeMul(leftOrder.makerAssetAmount, rightOrder.makerAssetAmount) >=\n safeMul(leftOrder.takerAssetAmount, rightOrder.takerAssetAmount),\n \"NEGATIVE_SPREAD_REQUIRED\"\n );\n }\n\n /// @dev Calculates fill amounts for the matched orders.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the leftOrder order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftOrderTakerAssetFilledAmount Amount of left order already filled.\n /// @param rightOrderTakerAssetFilledAmount Amount of right order already filled.\n /// @param matchedFillResults Amounts to fill and fees to pay by maker and taker of matched orders.\n function calculateMatchedFillResults(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n uint256 leftOrderTakerAssetFilledAmount,\n uint256 rightOrderTakerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.MatchedFillResults memory matchedFillResults)\n {\n // Derive maker asset amounts for left & right orders, given store taker assert amounts\n uint256 leftTakerAssetAmountRemaining = safeSub(leftOrder.takerAssetAmount, leftOrderTakerAssetFilledAmount);\n uint256 leftMakerAssetAmountRemaining = safeGetPartialAmountFloor(\n leftOrder.makerAssetAmount,\n leftOrder.takerAssetAmount,\n leftTakerAssetAmountRemaining\n );\n uint256 rightTakerAssetAmountRemaining = safeSub(rightOrder.takerAssetAmount, rightOrderTakerAssetFilledAmount);\n uint256 rightMakerAssetAmountRemaining = safeGetPartialAmountFloor(\n rightOrder.makerAssetAmount,\n rightOrder.takerAssetAmount,\n rightTakerAssetAmountRemaining\n );\n\n // Calculate fill results for maker and taker assets: at least one order will be fully filled.\n // The maximum amount the left maker can buy is `leftTakerAssetAmountRemaining`\n // The maximum amount the right maker can sell is `rightMakerAssetAmountRemaining`\n // We have two distinct cases for calculating the fill results:\n // Case 1.\n // If the left maker can buy more than the right maker can sell, then only the right order is fully filled.\n // If the left maker can buy exactly what the right maker can sell, then both orders are fully filled.\n // Case 2.\n // If the left maker cannot buy more than the right maker can sell, then only the left order is fully filled.\n if (leftTakerAssetAmountRemaining >= rightMakerAssetAmountRemaining) {\n // Case 1: Right order is fully filled\n matchedFillResults.right.makerAssetFilledAmount = rightMakerAssetAmountRemaining;\n matchedFillResults.right.takerAssetFilledAmount = rightTakerAssetAmountRemaining;\n matchedFillResults.left.takerAssetFilledAmount = matchedFillResults.right.makerAssetFilledAmount;\n // Round down to ensure the maker's exchange rate does not exceed the price specified by the order. \n // We favor the maker when the exchange rate must be rounded.\n matchedFillResults.left.makerAssetFilledAmount = safeGetPartialAmountFloor(\n leftOrder.makerAssetAmount,\n leftOrder.takerAssetAmount,\n matchedFillResults.left.takerAssetFilledAmount\n );\n } else {\n // Case 2: Left order is fully filled\n matchedFillResults.left.makerAssetFilledAmount = leftMakerAssetAmountRemaining;\n matchedFillResults.left.takerAssetFilledAmount = leftTakerAssetAmountRemaining;\n matchedFillResults.right.makerAssetFilledAmount = matchedFillResults.left.takerAssetFilledAmount;\n // Round up to ensure the maker's exchange rate does not exceed the price specified by the order.\n // We favor the maker when the exchange rate must be rounded.\n matchedFillResults.right.takerAssetFilledAmount = safeGetPartialAmountCeil(\n rightOrder.takerAssetAmount,\n rightOrder.makerAssetAmount,\n matchedFillResults.right.makerAssetFilledAmount\n );\n }\n\n // Calculate amount given to taker\n matchedFillResults.leftMakerAssetSpreadAmount = safeSub(\n matchedFillResults.left.makerAssetFilledAmount,\n matchedFillResults.right.takerAssetFilledAmount\n );\n\n // Compute fees for left order\n matchedFillResults.left.makerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.left.makerAssetFilledAmount,\n leftOrder.makerAssetAmount,\n leftOrder.makerFee\n );\n matchedFillResults.left.takerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.left.takerAssetFilledAmount,\n leftOrder.takerAssetAmount,\n leftOrder.takerFee\n );\n\n // Compute fees for right order\n matchedFillResults.right.makerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.right.makerAssetFilledAmount,\n rightOrder.makerAssetAmount,\n rightOrder.makerFee\n );\n matchedFillResults.right.takerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.right.takerAssetFilledAmount,\n rightOrder.takerAssetAmount,\n rightOrder.takerFee\n );\n\n // Return fill results\n return matchedFillResults;\n }\n\n /// @dev Settles matched order by transferring appropriate funds between order makers, taker, and fee recipient.\n /// @param leftOrder First matched order.\n /// @param rightOrder Second matched order.\n /// @param takerAddress Address that matched the orders. The taker receives the spread between orders as profit.\n /// @param matchedFillResults Struct holding amounts to transfer between makers, taker, and fee recipients.\n function settleMatchedOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n address takerAddress,\n LibFillResults.MatchedFillResults memory matchedFillResults\n )\n private\n {\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n // Order makers and taker\n dispatchTransferFrom(\n leftOrder.makerAssetData,\n leftOrder.makerAddress,\n rightOrder.makerAddress,\n matchedFillResults.right.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n rightOrder.makerAssetData,\n rightOrder.makerAddress,\n leftOrder.makerAddress,\n matchedFillResults.left.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n leftOrder.makerAssetData,\n leftOrder.makerAddress,\n takerAddress,\n matchedFillResults.leftMakerAssetSpreadAmount\n );\n\n // Maker fees\n dispatchTransferFrom(\n zrxAssetData,\n leftOrder.makerAddress,\n leftOrder.feeRecipientAddress,\n matchedFillResults.left.makerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n rightOrder.makerAddress,\n rightOrder.feeRecipientAddress,\n matchedFillResults.right.makerFeePaid\n );\n\n // Taker fees\n if (leftOrder.feeRecipientAddress == rightOrder.feeRecipientAddress) {\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n leftOrder.feeRecipientAddress,\n safeAdd(\n matchedFillResults.left.takerFeePaid,\n matchedFillResults.right.takerFeePaid\n )\n );\n } else {\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n leftOrder.feeRecipientAddress,\n matchedFillResults.left.takerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n rightOrder.feeRecipientAddress,\n matchedFillResults.right.takerFeePaid\n );\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinSignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./interfaces/IWallet.sol\";\nimport \"./interfaces/IValidator.sol\";\n\n\ncontract MixinSignatureValidator is\n ReentrancyGuard,\n MSignatureValidator,\n MTransactions\n{\n using LibBytes for bytes;\n \n // Mapping of hash => signer => signed\n mapping (bytes32 => mapping (address => bool)) public preSigned;\n\n // Mapping of signer => validator => approved\n mapping (address => mapping (address => bool)) public allowedValidators;\n\n /// @dev Approves a hash on-chain using any valid signature type.\n /// After presigning a hash, the preSign signature type will become valid for that hash and signer.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n function preSign(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external\n {\n if (signerAddress != msg.sender) {\n require(\n isValidSignature(\n hash,\n signerAddress,\n signature\n ),\n \"INVALID_SIGNATURE\"\n );\n }\n preSigned[hash][signerAddress] = true;\n }\n\n /// @dev Approves/unnapproves a Validator contract to verify signatures on signer's behalf.\n /// @param validatorAddress Address of Validator contract.\n /// @param approval Approval or disapproval of Validator contract.\n function setSignatureValidatorApproval(\n address validatorAddress,\n bool approval\n )\n external\n nonReentrant\n {\n address signerAddress = getCurrentContextAddress();\n allowedValidators[signerAddress][validatorAddress] = approval;\n emit SignatureValidatorApproval(\n signerAddress,\n validatorAddress,\n approval\n );\n }\n\n /// @dev Verifies that a hash has been signed by the given signer.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes memory signature\n )\n public\n view\n returns (bool isValid)\n {\n require(\n signature.length > 0,\n \"LENGTH_GREATER_THAN_0_REQUIRED\"\n );\n\n // Pop last byte off of signature byte array.\n uint8 signatureTypeRaw = uint8(signature.popLastByte());\n\n // Ensure signature is supported\n require(\n signatureTypeRaw < uint8(SignatureType.NSignatureTypes),\n \"SIGNATURE_UNSUPPORTED\"\n );\n\n SignatureType signatureType = SignatureType(signatureTypeRaw);\n\n // Variables are not scoped in Solidity.\n uint8 v;\n bytes32 r;\n bytes32 s;\n address recovered;\n\n // Always illegal signature.\n // This is always an implicit option since a signer can create a\n // signature array with invalid type or length. We may as well make\n // it an explicit option. This aids testing and analysis. It is\n // also the initialization value for the enum type.\n if (signatureType == SignatureType.Illegal) {\n revert(\"SIGNATURE_ILLEGAL\");\n\n // Always invalid signature.\n // Like Illegal, this is always implicitly available and therefore\n // offered explicitly. It can be implicitly created by providing\n // a correctly formatted but incorrect signature.\n } else if (signatureType == SignatureType.Invalid) {\n require(\n signature.length == 0,\n \"LENGTH_0_REQUIRED\"\n );\n isValid = false;\n return isValid;\n\n // Signature using EIP712\n } else if (signatureType == SignatureType.EIP712) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n hash,\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n\n // Signed using web3.eth_sign\n } else if (signatureType == SignatureType.EthSign) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n keccak256(abi.encodePacked(\n \"\\x19Ethereum Signed Message:\\n32\",\n hash\n )),\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n\n // Signature verified by wallet contract.\n // If used with an order, the maker of the order is the wallet contract.\n } else if (signatureType == SignatureType.Wallet) {\n isValid = isValidWalletSignature(\n hash,\n signerAddress,\n signature\n );\n return isValid;\n\n // Signature verified by validator contract.\n // If used with an order, the maker of the order can still be an EOA.\n // A signature using this type should be encoded as:\n // | Offset | Length | Contents |\n // | 0x00 | x | Signature to validate |\n // | 0x00 + x | 20 | Address of validator contract |\n // | 0x14 + x | 1 | Signature type is always \"\\x06\" |\n } else if (signatureType == SignatureType.Validator) {\n // Pop last 20 bytes off of signature byte array.\n address validatorAddress = signature.popLast20Bytes();\n \n // Ensure signer has approved validator.\n if (!allowedValidators[signerAddress][validatorAddress]) {\n return false;\n }\n isValid = isValidValidatorSignature(\n validatorAddress,\n hash,\n signerAddress,\n signature\n );\n return isValid;\n\n // Signer signed hash previously using the preSign function.\n } else if (signatureType == SignatureType.PreSigned) {\n isValid = preSigned[hash][signerAddress];\n return isValid;\n }\n\n // Anything else is illegal (We do not return false because\n // the signature may actually be valid, just not in a format\n // that we currently support. In this case returning false\n // may lead the caller to incorrectly believe that the\n // signature was invalid.)\n revert(\"SIGNATURE_UNSUPPORTED\");\n }\n\n /// @dev Verifies signature using logic defined by Wallet contract.\n /// @param hash Any 32 byte hash.\n /// @param walletAddress Address that should have signed the given hash\n /// and defines its own signature verification method.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if signature is valid for given wallet..\n function isValidWalletSignature(\n bytes32 hash,\n address walletAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid)\n {\n bytes memory calldata = abi.encodeWithSelector(\n IWallet(walletAddress).isValidSignature.selector,\n hash,\n signature\n );\n assembly {\n let cdStart := add(calldata, 32)\n let success := staticcall(\n gas, // forward all gas\n walletAddress, // address of Wallet contract\n cdStart, // pointer to start of input\n mload(calldata), // length of input\n cdStart, // write output over input\n 32 // output size is 32 bytes\n )\n\n switch success\n case 0 {\n // Revert with `Error(\"WALLET_ERROR\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000c57414c4c45545f4552524f5200000000000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n case 1 {\n // Signature is valid if call did not revert and returned true\n isValid := mload(cdStart)\n }\n }\n return isValid;\n }\n\n /// @dev Verifies signature using logic defined by Validator contract.\n /// @param validatorAddress Address of validator contract.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidValidatorSignature(\n address validatorAddress,\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid)\n {\n bytes memory calldata = abi.encodeWithSelector(\n IValidator(signerAddress).isValidSignature.selector,\n hash,\n signerAddress,\n signature\n );\n assembly {\n let cdStart := add(calldata, 32)\n let success := staticcall(\n gas, // forward all gas\n validatorAddress, // address of Validator contract\n cdStart, // pointer to start of input\n mload(calldata), // length of input\n cdStart, // write output over input\n 32 // output size is 32 bytes\n )\n\n switch success\n case 0 {\n // Revert with `Error(\"VALIDATOR_ERROR\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f56414c494441544f525f4552524f5200000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n case 1 {\n // Signature is valid if call did not revert and returned true\n isValid := mload(cdStart)\n }\n }\n return isValid;\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinTransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\nimport \"./libs/LibExchangeErrors.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./libs/LibEIP712.sol\";\n\n\ncontract MixinTransactions is\n LibEIP712,\n MSignatureValidator,\n MTransactions\n{\n // Mapping of transaction hash => executed\n // This prevents transactions from being executed more than once.\n mapping (bytes32 => bool) public transactions;\n\n // Address of current transaction signer\n address public currentContextAddress;\n\n /// @dev Executes an exchange method call in the context of signer.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @param signature Proof of signer transaction by signer.\n function executeTransaction(\n uint256 salt,\n address signerAddress,\n bytes data,\n bytes signature\n )\n external\n {\n // Prevent reentrancy\n require(\n currentContextAddress == address(0),\n \"REENTRANCY_ILLEGAL\"\n );\n\n bytes32 transactionHash = hashEIP712Message(hashZeroExTransaction(\n salt,\n signerAddress,\n data\n ));\n\n // Validate transaction has not been executed\n require(\n !transactions[transactionHash],\n \"INVALID_TX_HASH\"\n );\n\n // Transaction always valid if signer is sender of transaction\n if (signerAddress != msg.sender) {\n // Validate signature\n require(\n isValidSignature(\n transactionHash,\n signerAddress,\n signature\n ),\n \"INVALID_TX_SIGNATURE\"\n );\n\n // Set the current transaction signer\n currentContextAddress = signerAddress;\n }\n\n // Execute transaction\n transactions[transactionHash] = true;\n require(\n address(this).delegatecall(data),\n \"FAILED_EXECUTION\"\n );\n\n // Reset current transaction signer if it was previously updated\n if (signerAddress != msg.sender) {\n currentContextAddress = address(0);\n }\n }\n\n /// @dev Calculates EIP712 hash of the Transaction.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @return EIP712 hash of the Transaction.\n function hashZeroExTransaction(\n uint256 salt,\n address signerAddress,\n bytes memory data\n )\n internal\n pure\n returns (bytes32 result)\n {\n bytes32 schemaHash = EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH;\n bytes32 dataHash = keccak256(data);\n\n // Assembly for more efficiently computing:\n // keccak256(abi.encodePacked(\n // EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH,\n // salt,\n // bytes32(signerAddress),\n // keccak256(data)\n // ));\n\n assembly {\n // Load free memory pointer\n let memPtr := mload(64)\n\n mstore(memPtr, schemaHash) // hash of schema\n mstore(add(memPtr, 32), salt) // salt\n mstore(add(memPtr, 64), and(signerAddress, 0xffffffffffffffffffffffffffffffffffffffff)) // signerAddress\n mstore(add(memPtr, 96), dataHash) // hash of data\n\n // Compute hash\n result := keccak256(memPtr, 128)\n }\n return result;\n }\n\n /// @dev The current function will be called in the context of this address (either 0x transaction signer or `msg.sender`).\n /// If calling a fill function, this address will represent the taker.\n /// If calling a cancel function, this address will represent the maker.\n /// @return Signer of 0x transaction if entry point is `executeTransaction`.\n /// `msg.sender` if entry point is any other function.\n function getCurrentContextAddress()\n internal\n view\n returns (address)\n {\n address currentContextAddress_ = currentContextAddress;\n address contextAddress = currentContextAddress_ == address(0) ? msg.sender : currentContextAddress_;\n return contextAddress;\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./libs/LibAbiEncoder.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MWrapperFunctions.sol\";\n\n\ncontract MixinWrapperFunctions is\n ReentrancyGuard,\n LibMath,\n LibFillResults,\n LibAbiEncoder,\n MExchangeCore,\n MWrapperFunctions\n{\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n nonReentrant\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrKillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n return fillResults;\n }\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (FillResults memory fillResults)\n {\n // ABI encode calldata for `fillOrder`\n bytes memory fillOrderCalldata = abiEncodeFillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n\n // Delegate to `fillOrder` and handle any exceptions gracefully\n assembly {\n let success := delegatecall(\n gas, // forward all gas\n address, // call address of this contract\n add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes)\n mload(fillOrderCalldata), // length of input\n fillOrderCalldata, // write output over input\n 128 // output size is 128 bytes\n )\n if success {\n mstore(fillResults, mload(fillOrderCalldata))\n mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32)))\n mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64)))\n mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96)))\n }\n }\n // fillResults values will be 0 by default if call was unsuccessful\n return fillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrKill.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrKillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrKillOrderInternal(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrders(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n bytes memory takerAssetData = orders[0].takerAssetData;\n \n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being sold by taker is the same for each order.\n // Rather than passing this in as calldata, we use the takerAssetData from the first order in all later orders.\n orders[i].takerAssetData = takerAssetData;\n\n // Calculate the remaining amount of takerAsset to sell\n uint256 remainingTakerAssetFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= takerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory takerAssetData = orders[0].takerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being sold by taker is the same for each order.\n // Rather than passing this in as calldata, we use the takerAssetData from the first order in all later orders.\n orders[i].takerAssetData = takerAssetData;\n\n // Calculate the remaining amount of takerAsset to sell\n uint256 remainingTakerAssetFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= takerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerAsset is bought by taker.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrders(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // Rather than passing this in as calldata, we copy the makerAssetData from the first order onto all later orders.\n orders[i].makerAssetData = makerAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n if (totalFillResults.makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // Rather than passing this in as calldata, we copy the makerAssetData from the first order onto all later orders.\n orders[i].makerAssetData = makerAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n if (totalFillResults.makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously cancels multiple orders in a single transaction.\n /// @param orders Array of order specifications.\n function batchCancelOrders(LibOrder.Order[] memory orders)\n public\n nonReentrant\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n cancelOrderInternal(orders[i]);\n }\n }\n\n /// @dev Fetches information for all passed in orders.\n /// @param orders Array of order specifications.\n /// @return Array of OrderInfo instances that correspond to each order.\n function getOrdersInfo(LibOrder.Order[] memory orders)\n public\n view\n returns (LibOrder.OrderInfo[] memory)\n {\n uint256 ordersLength = orders.length;\n LibOrder.OrderInfo[] memory ordersInfo = new LibOrder.OrderInfo[](ordersLength);\n for (uint256 i = 0; i != ordersLength; i++) {\n ordersInfo[i] = getOrderInfo(orders[i]);\n }\n return ordersInfo;\n }\n\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n require(\n fillResults.takerAssetFilledAmount == takerAssetFillAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return fillResults;\n }\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IAssetProxyDispatcher {\n\n /// @dev Registers an asset proxy to its asset proxy id.\n /// Once an asset proxy is registered, it cannot be unregistered.\n /// @param assetProxy Address of new asset proxy to register.\n function registerAssetProxy(address assetProxy)\n external;\n\n /// @dev Gets an asset proxy.\n /// @param assetProxyId Id of the asset proxy.\n /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered.\n function getAssetProxy(bytes4 assetProxyId)\n external\n view\n returns (address);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IExchange.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./IExchangeCore.sol\";\nimport \"./IMatchOrders.sol\";\nimport \"./ISignatureValidator.sol\";\nimport \"./ITransactions.sol\";\nimport \"./IAssetProxyDispatcher.sol\";\nimport \"./IWrapperFunctions.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract IExchange is\n IExchangeCore,\n IMatchOrders,\n ISignatureValidator,\n ITransactions,\n IAssetProxyDispatcher,\n IWrapperFunctions\n{}\n",
- "2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IExchangeCore {\n\n /// @dev Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch\n /// and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress).\n /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled.\n function cancelOrdersUpTo(uint256 targetOrderEpoch)\n external;\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev After calling, the order can not be filled anymore.\n /// @param order Order struct containing order specifications.\n function cancelOrder(LibOrder.Order memory order)\n public;\n\n /// @dev Gets information about an order: status, hash, and amount filled.\n /// @param order Order to gather information on.\n /// @return OrderInfo Information about the order and its state.\n /// See LibOrder.OrderInfo for a complete description.\n function getOrderInfo(LibOrder.Order memory order)\n public\n view\n returns (LibOrder.OrderInfo memory orderInfo);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IMatchOrders {\n\n /// @dev Match two complementary orders that have a profitable spread.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the left order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftSignature Proof that order was created by the left maker.\n /// @param rightSignature Proof that order was created by the right maker.\n /// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.\n function matchOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n bytes memory leftSignature,\n bytes memory rightSignature\n )\n public\n returns (LibFillResults.MatchedFillResults memory matchedFillResults);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract ISignatureValidator {\n\n /// @dev Approves a hash on-chain using any valid signature type.\n /// After presigning a hash, the preSign signature type will become valid for that hash and signer.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n function preSign(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external;\n \n /// @dev Approves/unnapproves a Validator contract to verify signatures on signer's behalf.\n /// @param validatorAddress Address of Validator contract.\n /// @param approval Approval or disapproval of Validator contract.\n function setSignatureValidatorApproval(\n address validatorAddress,\n bool approval\n )\n external;\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signerAddress Address of signer.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes memory signature\n )\n public\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/ITransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\n\ncontract ITransactions {\n\n /// @dev Executes an exchange method call in the context of signer.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @param signature Proof of signer transaction by signer.\n function executeTransaction(\n uint256 salt,\n address signerAddress,\n bytes data,\n bytes signature\n )\n external;\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IValidator {\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IWallet.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IWallet {\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n bytes signature\n )\n external\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IWrapperFunctions {\n\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrKill.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrKillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrders(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerAsset is bought by taker.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrders(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously cancels multiple orders in a single transaction.\n /// @param orders Array of order specifications.\n function batchCancelOrders(LibOrder.Order[] memory orders)\n public;\n\n /// @dev Fetches information for all passed in orders\n /// @param orders Array of order specifications.\n /// @return Array of OrderInfo instances that correspond to each order.\n function getOrdersInfo(LibOrder.Order[] memory orders)\n public\n view\n returns (LibOrder.OrderInfo[] memory);\n}\n",
- "2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./LibOrder.sol\";\n\n\ncontract LibAbiEncoder {\n\n /// @dev ABI encodes calldata for `fillOrder`.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return ABI encoded calldata for `fillOrder`.\n function abiEncodeFillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n pure\n returns (bytes memory fillOrderCalldata)\n {\n // We need to call MExchangeCore.fillOrder using a delegatecall in\n // assembly so that we can intercept a call that throws. For this, we\n // need the input encoded in memory in the Ethereum ABIv2 format [1].\n\n // | Area | Offset | Length | Contents |\n // | -------- |--------|---------|-------------------------------------------- |\n // | Header | 0x00 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 0x00 | | 1. offset to order (*) |\n // | | 0x20 | | 2. takerAssetFillAmount |\n // | | 0x40 | | 3. offset to signature (*) |\n // | Data | | 12 * 32 | order: |\n // | | 0x000 | | 1. senderAddress |\n // | | 0x020 | | 2. makerAddress |\n // | | 0x040 | | 3. takerAddress |\n // | | 0x060 | | 4. feeRecipientAddress |\n // | | 0x080 | | 5. makerAssetAmount |\n // | | 0x0A0 | | 6. takerAssetAmount |\n // | | 0x0C0 | | 7. makerFeeAmount |\n // | | 0x0E0 | | 8. takerFeeAmount |\n // | | 0x100 | | 9. expirationTimeSeconds |\n // | | 0x120 | | 10. salt |\n // | | 0x140 | | 11. Offset to makerAssetData (*) |\n // | | 0x160 | | 12. Offset to takerAssetData (*) |\n // | | 0x180 | 32 | makerAssetData Length |\n // | | 0x1A0 | ** | makerAssetData Contents |\n // | | 0x1C0 | 32 | takerAssetData Length |\n // | | 0x1E0 | ** | takerAssetData Contents |\n // | | 0x200 | 32 | signature Length |\n // | | 0x220 | ** | signature Contents |\n\n // * Offsets are calculated from the beginning of the current area: Header, Params, Data:\n // An offset stored in the Params area is calculated from the beginning of the Params section.\n // An offset stored in the Data area is calculated from the beginning of the Data section.\n\n // ** The length of dynamic array contents are stored in the field immediately preceeding the contents.\n\n // [1]: https://solidity.readthedocs.io/en/develop/abi-spec.html\n\n assembly {\n\n // Areas below may use the following variables:\n // 1. <area>Start -- Start of this area in memory\n // 2. <area>End -- End of this area in memory. This value may\n // be precomputed (before writing contents),\n // or it may be computed as contents are written.\n // 3. <area>Offset -- Current offset into area. If an area's End\n // is precomputed, this variable tracks the\n // offsets of contents as they are written.\n\n /////// Setup Header Area ///////\n // Load free memory pointer\n fillOrderCalldata := mload(0x40)\n // bytes4(keccak256(\"fillOrder((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),uint256,bytes)\"))\n // = 0xb4be83d5\n // Leave 0x20 bytes to store the length\n mstore(add(fillOrderCalldata, 0x20), 0xb4be83d500000000000000000000000000000000000000000000000000000000)\n let headerAreaEnd := add(fillOrderCalldata, 0x24)\n\n /////// Setup Params Area ///////\n // This area is preallocated and written to later.\n // This is because we need to fill in offsets that have not yet been calculated.\n let paramsAreaStart := headerAreaEnd\n let paramsAreaEnd := add(paramsAreaStart, 0x60)\n let paramsAreaOffset := paramsAreaStart\n\n /////// Setup Data Area ///////\n let dataAreaStart := paramsAreaEnd\n let dataAreaEnd := dataAreaStart\n\n // Offset from the source data we're reading from\n let sourceOffset := order\n // arrayLenBytes and arrayLenWords track the length of a dynamically-allocated bytes array.\n let arrayLenBytes := 0\n let arrayLenWords := 0\n\n /////// Write order Struct ///////\n // Write memory location of Order, relative to the start of the\n // parameter list, then increment the paramsAreaOffset respectively.\n mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))\n paramsAreaOffset := add(paramsAreaOffset, 0x20)\n\n // Write values for each field in the order\n // It would be nice to use a loop, but we save on gas by writing\n // the stores sequentially.\n mstore(dataAreaEnd, mload(sourceOffset)) // makerAddress\n mstore(add(dataAreaEnd, 0x20), mload(add(sourceOffset, 0x20))) // takerAddress\n mstore(add(dataAreaEnd, 0x40), mload(add(sourceOffset, 0x40))) // feeRecipientAddress\n mstore(add(dataAreaEnd, 0x60), mload(add(sourceOffset, 0x60))) // senderAddress\n mstore(add(dataAreaEnd, 0x80), mload(add(sourceOffset, 0x80))) // makerAssetAmount\n mstore(add(dataAreaEnd, 0xA0), mload(add(sourceOffset, 0xA0))) // takerAssetAmount\n mstore(add(dataAreaEnd, 0xC0), mload(add(sourceOffset, 0xC0))) // makerFeeAmount\n mstore(add(dataAreaEnd, 0xE0), mload(add(sourceOffset, 0xE0))) // takerFeeAmount\n mstore(add(dataAreaEnd, 0x100), mload(add(sourceOffset, 0x100))) // expirationTimeSeconds\n mstore(add(dataAreaEnd, 0x120), mload(add(sourceOffset, 0x120))) // salt\n mstore(add(dataAreaEnd, 0x140), mload(add(sourceOffset, 0x140))) // Offset to makerAssetData\n mstore(add(dataAreaEnd, 0x160), mload(add(sourceOffset, 0x160))) // Offset to takerAssetData\n dataAreaEnd := add(dataAreaEnd, 0x180)\n sourceOffset := add(sourceOffset, 0x180)\n\n // Write offset to <order.makerAssetData>\n mstore(add(dataAreaStart, mul(10, 0x20)), sub(dataAreaEnd, dataAreaStart))\n\n // Calculate length of <order.makerAssetData>\n sourceOffset := mload(add(order, 0x140)) // makerAssetData\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of <order.makerAssetData>\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of <order.makerAssetData>\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n // Write offset to <order.takerAssetData>\n mstore(add(dataAreaStart, mul(11, 0x20)), sub(dataAreaEnd, dataAreaStart))\n\n // Calculate length of <order.takerAssetData>\n sourceOffset := mload(add(order, 0x160)) // takerAssetData\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of <order.takerAssetData>\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of <order.takerAssetData>\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n /////// Write takerAssetFillAmount ///////\n mstore(paramsAreaOffset, takerAssetFillAmount)\n paramsAreaOffset := add(paramsAreaOffset, 0x20)\n\n /////// Write signature ///////\n // Write offset to paramsArea\n mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))\n\n // Calculate length of signature\n sourceOffset := signature\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of signature\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of signature\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n // Set length of calldata\n mstore(fillOrderCalldata, sub(dataAreaEnd, add(fillOrderCalldata, 0x20)))\n\n // Increment free memory pointer\n mstore(0x40, dataAreaEnd)\n }\n\n return fillOrderCalldata;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibConstants.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\n// solhint-disable max-line-length\ncontract LibConstants {\n \n // Asset data for ZRX token. Used for fee transfers.\n // @TODO: Hardcode constant when we deploy. Currently \n // not constant to make testing easier.\n\n // The proxyId for ZRX_ASSET_DATA is bytes4(keccak256(\"ERC20Token(address)\")) = 0xf47261b0\n \n // Kovan ZRX address is 0x6ff6c0ff1d68b964901f986d4c9fa3ac68346570.\n // The ABI encoded proxyId and address is 0xf47261b00000000000000000000000006ff6c0ff1d68b964901f986d4c9fa3ac68346570\n // bytes constant public ZRX_ASSET_DATA = \"\\xf4\\x72\\x61\\xb0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x6f\\xf6\\xc0\\xff\\x1d\\x68\\xb9\\x64\\x90\\x1f\\x98\\x6d\\x4c\\x9f\\xa3\\xac\\x68\\x34\\x65\\x70\";\n \n // Mainnet ZRX address is 0xe41d2489571d322189246dafa5ebde1f4699f498.\n // The ABI encoded proxyId and address is 0xf47261b0000000000000000000000000e41d2489571d322189246dafa5ebde1f4699f498\n // bytes constant public ZRX_ASSET_DATA = \"\\xf4\\x72\\x61\\xb0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xe4\\x1d\\x24\\x89\\x57\\x1d\\x32\\x21\\x89\\x24\\x6d\\xaf\\xa5\\xeb\\xde\\x1f\\x46\\x99\\xf4\\x98\";\n \n // solhint-disable-next-line var-name-mixedcase\n bytes public ZRX_ASSET_DATA;\n\n // @TODO: Remove when we deploy.\n constructor (bytes memory zrxAssetData)\n public\n {\n ZRX_ASSET_DATA = zrxAssetData;\n }\n}\n// solhint-enable max-line-length\n",
- "2.0.0/protocol/Exchange/libs/LibEIP712.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract LibEIP712 {\n\n // EIP191 header for EIP712 prefix\n string constant internal EIP191_HEADER = \"\\x19\\x01\";\n\n // EIP712 Domain Name value\n string constant internal EIP712_DOMAIN_NAME = \"0x Protocol\";\n\n // EIP712 Domain Version value\n string constant internal EIP712_DOMAIN_VERSION = \"2\";\n\n // Hash of the EIP712 Domain Separator Schema\n bytes32 constant internal EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"EIP712Domain(\",\n \"string name,\",\n \"string version,\",\n \"address verifyingContract\",\n \")\"\n ));\n\n // Hash of the EIP712 Domain Separator data\n // solhint-disable-next-line var-name-mixedcase\n bytes32 public EIP712_DOMAIN_HASH;\n\n constructor ()\n public\n {\n EIP712_DOMAIN_HASH = keccak256(abi.encodePacked(\n EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH,\n keccak256(bytes(EIP712_DOMAIN_NAME)),\n keccak256(bytes(EIP712_DOMAIN_VERSION)),\n bytes32(address(this))\n ));\n }\n\n /// @dev Calculates EIP712 encoding for a hash struct in this EIP712 Domain.\n /// @param hashStruct The EIP712 hash struct.\n /// @return EIP712 hash applied to this EIP712 Domain.\n function hashEIP712Message(bytes32 hashStruct)\n internal\n view\n returns (bytes32 result)\n {\n bytes32 eip712DomainHash = EIP712_DOMAIN_HASH;\n\n // Assembly for more efficient computing:\n // keccak256(abi.encodePacked(\n // EIP191_HEADER,\n // EIP712_DOMAIN_HASH,\n // hashStruct \n // ));\n\n assembly {\n // Load free memory pointer\n let memPtr := mload(64)\n\n mstore(memPtr, 0x1901000000000000000000000000000000000000000000000000000000000000) // EIP191 header\n mstore(add(memPtr, 2), eip712DomainHash) // EIP712 domain hash\n mstore(add(memPtr, 34), hashStruct) // Hash of struct\n\n // Compute hash\n result := keccak256(memPtr, 66)\n }\n return result;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\n// solhint-disable\npragma solidity 0.4.24;\n\n\n/// @dev This contract documents the revert reasons used in the Exchange contract.\n/// This contract is intended to serve as a reference, but is not actually used for efficiency reasons.\ncontract LibExchangeErrors {\n\n /// Order validation errors ///\n string constant ORDER_UNFILLABLE = \"ORDER_UNFILLABLE\"; // Order cannot be filled.\n string constant INVALID_MAKER = \"INVALID_MAKER\"; // Invalid makerAddress.\n string constant INVALID_TAKER = \"INVALID_TAKER\"; // Invalid takerAddress.\n string constant INVALID_SENDER = \"INVALID_SENDER\"; // Invalid `msg.sender`.\n string constant INVALID_ORDER_SIGNATURE = \"INVALID_ORDER_SIGNATURE\"; // Signature validation failed. \n \n /// fillOrder validation errors ///\n string constant INVALID_TAKER_AMOUNT = \"INVALID_TAKER_AMOUNT\"; // takerAssetFillAmount cannot equal 0.\n string constant ROUNDING_ERROR = \"ROUNDING_ERROR\"; // Rounding error greater than 0.1% of takerAssetFillAmount. \n \n /// Signature validation errors ///\n string constant INVALID_SIGNATURE = \"INVALID_SIGNATURE\"; // Signature validation failed. \n string constant SIGNATURE_ILLEGAL = \"SIGNATURE_ILLEGAL\"; // Signature type is illegal.\n string constant SIGNATURE_UNSUPPORTED = \"SIGNATURE_UNSUPPORTED\"; // Signature type unsupported.\n \n /// cancelOrdersUptTo errors ///\n string constant INVALID_NEW_ORDER_EPOCH = \"INVALID_NEW_ORDER_EPOCH\"; // Specified salt must be greater than or equal to existing orderEpoch.\n\n /// fillOrKillOrder errors ///\n string constant COMPLETE_FILL_FAILED = \"COMPLETE_FILL_FAILED\"; // Desired takerAssetFillAmount could not be completely filled. \n\n /// matchOrders errors ///\n string constant NEGATIVE_SPREAD_REQUIRED = \"NEGATIVE_SPREAD_REQUIRED\"; // Matched orders must have a negative spread.\n\n /// Transaction errors ///\n string constant REENTRANCY_ILLEGAL = \"REENTRANCY_ILLEGAL\"; // Recursive reentrancy is not allowed. \n string constant INVALID_TX_HASH = \"INVALID_TX_HASH\"; // Transaction has already been executed. \n string constant INVALID_TX_SIGNATURE = \"INVALID_TX_SIGNATURE\"; // Signature validation failed. \n string constant FAILED_EXECUTION = \"FAILED_EXECUTION\"; // Transaction execution failed. \n \n /// registerAssetProxy errors ///\n string constant ASSET_PROXY_ALREADY_EXISTS = \"ASSET_PROXY_ALREADY_EXISTS\"; // AssetProxy with same id already exists.\n\n /// dispatchTransferFrom errors ///\n string constant ASSET_PROXY_DOES_NOT_EXIST = \"ASSET_PROXY_DOES_NOT_EXIST\"; // No assetProxy registered at given id.\n string constant TRANSFER_FAILED = \"TRANSFER_FAILED\"; // Asset transfer unsuccesful.\n\n /// Length validation errors ///\n string constant LENGTH_GREATER_THAN_0_REQUIRED = \"LENGTH_GREATER_THAN_0_REQUIRED\"; // Byte array must have a length greater than 0.\n string constant LENGTH_GREATER_THAN_3_REQUIRED = \"LENGTH_GREATER_THAN_3_REQUIRED\"; // Byte array must have a length greater than 3.\n string constant LENGTH_0_REQUIRED = \"LENGTH_0_REQUIRED\"; // Byte array must have a length of 0.\n string constant LENGTH_65_REQUIRED = \"LENGTH_65_REQUIRED\"; // Byte array must have a length of 65.\n}\n",
- "2.0.0/protocol/Exchange/libs/LibFillResults.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract LibFillResults is\n SafeMath\n{\n struct FillResults {\n uint256 makerAssetFilledAmount; // Total amount of makerAsset(s) filled.\n uint256 takerAssetFilledAmount; // Total amount of takerAsset(s) filled.\n uint256 makerFeePaid; // Total amount of ZRX paid by maker(s) to feeRecipient(s).\n uint256 takerFeePaid; // Total amount of ZRX paid by taker to feeRecipients(s).\n }\n\n struct MatchedFillResults {\n FillResults left; // Amounts filled and fees paid of left order.\n FillResults right; // Amounts filled and fees paid of right order.\n uint256 leftMakerAssetSpreadAmount; // Spread between price of left and right order, denominated in the left order's makerAsset, paid to taker.\n }\n\n /// @dev Adds properties of both FillResults instances.\n /// Modifies the first FillResults instance specified.\n /// @param totalFillResults Fill results instance that will be added onto.\n /// @param singleFillResults Fill results instance that will be added to totalFillResults.\n function addFillResults(FillResults memory totalFillResults, FillResults memory singleFillResults)\n internal\n pure\n {\n totalFillResults.makerAssetFilledAmount = safeAdd(totalFillResults.makerAssetFilledAmount, singleFillResults.makerAssetFilledAmount);\n totalFillResults.takerAssetFilledAmount = safeAdd(totalFillResults.takerAssetFilledAmount, singleFillResults.takerAssetFilledAmount);\n totalFillResults.makerFeePaid = safeAdd(totalFillResults.makerFeePaid, singleFillResults.makerFeePaid);\n totalFillResults.takerFeePaid = safeAdd(totalFillResults.takerFeePaid, singleFillResults.takerFeePaid);\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibMath.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract LibMath is\n SafeMath\n{\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// Reverts if rounding error is >= 0.1%\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded down.\n function safeGetPartialAmountFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n require(\n !isRoundingErrorFloor(\n numerator,\n denominator,\n target\n ),\n \"ROUNDING_ERROR\"\n );\n \n partialAmount = safeDiv(\n safeMul(numerator, target),\n denominator\n );\n return partialAmount;\n }\n\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// Reverts if rounding error is >= 0.1%\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded up.\n function safeGetPartialAmountCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n require(\n !isRoundingErrorCeil(\n numerator,\n denominator,\n target\n ),\n \"ROUNDING_ERROR\"\n );\n \n // safeDiv computes `floor(a / b)`. We use the identity (a, b integer):\n // ceil(a / b) = floor((a + b - 1) / b)\n // To implement `ceil(a / b)` using safeDiv.\n partialAmount = safeDiv(\n safeAdd(\n safeMul(numerator, target),\n safeSub(denominator, 1)\n ),\n denominator\n );\n return partialAmount;\n }\n\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded down.\n function getPartialAmountFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n partialAmount = safeDiv(\n safeMul(numerator, target),\n denominator\n );\n return partialAmount;\n }\n \n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded up.\n function getPartialAmountCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n // safeDiv computes `floor(a / b)`. We use the identity (a, b integer):\n // ceil(a / b) = floor((a + b - 1) / b)\n // To implement `ceil(a / b)` using safeDiv.\n partialAmount = safeDiv(\n safeAdd(\n safeMul(numerator, target),\n safeSub(denominator, 1)\n ),\n denominator\n );\n return partialAmount;\n }\n \n /// @dev Checks if rounding error >= 0.1% when rounding down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to multiply with numerator/denominator.\n /// @return Rounding error is present.\n function isRoundingErrorFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (bool isError)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n \n // The absolute rounding error is the difference between the rounded\n // value and the ideal value. The relative rounding error is the\n // absolute rounding error divided by the absolute value of the\n // ideal value. This is undefined when the ideal value is zero.\n //\n // The ideal value is `numerator * target / denominator`.\n // Let's call `numerator * target % denominator` the remainder.\n // The absolute error is `remainder / denominator`.\n //\n // When the ideal value is zero, we require the absolute error to\n // be zero. Fortunately, this is always the case. The ideal value is\n // zero iff `numerator == 0` and/or `target == 0`. In this case the\n // remainder and absolute error are also zero. \n if (target == 0 || numerator == 0) {\n return false;\n }\n \n // Otherwise, we want the relative rounding error to be strictly\n // less than 0.1%.\n // The relative error is `remainder / (numerator * target)`.\n // We want the relative error less than 1 / 1000:\n // remainder / (numerator * denominator) < 1 / 1000\n // or equivalently:\n // 1000 * remainder < numerator * target\n // so we have a rounding error iff:\n // 1000 * remainder >= numerator * target\n uint256 remainder = mulmod(\n target,\n numerator,\n denominator\n );\n isError = safeMul(1000, remainder) >= safeMul(numerator, target);\n return isError;\n }\n \n /// @dev Checks if rounding error >= 0.1% when rounding up.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to multiply with numerator/denominator.\n /// @return Rounding error is present.\n function isRoundingErrorCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (bool isError)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n \n // See the comments in `isRoundingError`.\n if (target == 0 || numerator == 0) {\n // When either is zero, the ideal value and rounded value are zero\n // and there is no rounding error. (Although the relative error\n // is undefined.)\n return false;\n }\n // Compute remainder as before\n uint256 remainder = mulmod(\n target,\n numerator,\n denominator\n );\n remainder = safeSub(denominator, remainder) % denominator;\n isError = safeMul(1000, remainder) >= safeMul(numerator, target);\n return isError;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibOrder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./LibEIP712.sol\";\n\n\ncontract LibOrder is\n LibEIP712\n{\n // Hash for the EIP712 Order Schema\n bytes32 constant internal EIP712_ORDER_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"Order(\",\n \"address makerAddress,\",\n \"address takerAddress,\",\n \"address feeRecipientAddress,\",\n \"address senderAddress,\",\n \"uint256 makerAssetAmount,\",\n \"uint256 takerAssetAmount,\",\n \"uint256 makerFee,\",\n \"uint256 takerFee,\",\n \"uint256 expirationTimeSeconds,\",\n \"uint256 salt,\",\n \"bytes makerAssetData,\",\n \"bytes takerAssetData\",\n \")\"\n ));\n\n // A valid order remains fillable until it is expired, fully filled, or cancelled.\n // An order's state is unaffected by external factors, like account balances.\n enum OrderStatus {\n INVALID, // Default value\n INVALID_MAKER_ASSET_AMOUNT, // Order does not have a valid maker asset amount\n INVALID_TAKER_ASSET_AMOUNT, // Order does not have a valid taker asset amount\n FILLABLE, // Order is fillable\n EXPIRED, // Order has already expired\n FULLY_FILLED, // Order is fully filled\n CANCELLED // Order has been cancelled\n }\n\n // solhint-disable max-line-length\n struct Order {\n address makerAddress; // Address that created the order. \n address takerAddress; // Address that is allowed to fill the order. If set to 0, any address is allowed to fill the order. \n address feeRecipientAddress; // Address that will recieve fees when order is filled. \n address senderAddress; // Address that is allowed to call Exchange contract methods that affect this order. If set to 0, any address is allowed to call these methods.\n uint256 makerAssetAmount; // Amount of makerAsset being offered by maker. Must be greater than 0. \n uint256 takerAssetAmount; // Amount of takerAsset being bid on by maker. Must be greater than 0. \n uint256 makerFee; // Amount of ZRX paid to feeRecipient by maker when order is filled. If set to 0, no transfer of ZRX from maker to feeRecipient will be attempted.\n uint256 takerFee; // Amount of ZRX paid to feeRecipient by taker when order is filled. If set to 0, no transfer of ZRX from taker to feeRecipient will be attempted.\n uint256 expirationTimeSeconds; // Timestamp in seconds at which order expires. \n uint256 salt; // Arbitrary number to facilitate uniqueness of the order's hash. \n bytes makerAssetData; // Encoded data that can be decoded by a specified proxy contract when transferring makerAsset. The last byte references the id of this proxy.\n bytes takerAssetData; // Encoded data that can be decoded by a specified proxy contract when transferring takerAsset. The last byte references the id of this proxy.\n }\n // solhint-enable max-line-length\n\n struct OrderInfo {\n uint8 orderStatus; // Status that describes order's validity and fillability.\n bytes32 orderHash; // EIP712 hash of the order (see LibOrder.getOrderHash).\n uint256 orderTakerAssetFilledAmount; // Amount of order that has already been filled.\n }\n\n /// @dev Calculates Keccak-256 hash of the order.\n /// @param order The order structure.\n /// @return Keccak-256 EIP712 hash of the order.\n function getOrderHash(Order memory order)\n internal\n view\n returns (bytes32 orderHash)\n {\n orderHash = hashEIP712Message(hashOrder(order));\n return orderHash;\n }\n\n /// @dev Calculates EIP712 hash of the order.\n /// @param order The order structure.\n /// @return EIP712 hash of the order.\n function hashOrder(Order memory order)\n internal\n pure\n returns (bytes32 result)\n {\n bytes32 schemaHash = EIP712_ORDER_SCHEMA_HASH;\n bytes32 makerAssetDataHash = keccak256(order.makerAssetData);\n bytes32 takerAssetDataHash = keccak256(order.takerAssetData);\n\n // Assembly for more efficiently computing:\n // keccak256(abi.encodePacked(\n // EIP712_ORDER_SCHEMA_HASH,\n // bytes32(order.makerAddress),\n // bytes32(order.takerAddress),\n // bytes32(order.feeRecipientAddress),\n // bytes32(order.senderAddress),\n // order.makerAssetAmount,\n // order.takerAssetAmount,\n // order.makerFee,\n // order.takerFee,\n // order.expirationTimeSeconds,\n // order.salt,\n // keccak256(order.makerAssetData),\n // keccak256(order.takerAssetData)\n // ));\n\n assembly {\n // Calculate memory addresses that will be swapped out before hashing\n let pos1 := sub(order, 32)\n let pos2 := add(order, 320)\n let pos3 := add(order, 352)\n\n // Backup\n let temp1 := mload(pos1)\n let temp2 := mload(pos2)\n let temp3 := mload(pos3)\n \n // Hash in place\n mstore(pos1, schemaHash)\n mstore(pos2, makerAssetDataHash)\n mstore(pos3, takerAssetDataHash)\n result := keccak256(pos1, 416)\n \n // Restore\n mstore(pos1, temp1)\n mstore(pos2, temp2)\n mstore(pos3, temp3)\n }\n return result;\n }\n}\n",
- "2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAssetProxyDispatcher.sol\";\n\n\ncontract MAssetProxyDispatcher is\n IAssetProxyDispatcher\n{\n // Logs registration of new asset proxy\n event AssetProxyRegistered(\n bytes4 id, // Id of new registered AssetProxy.\n address assetProxy // Address of new registered AssetProxy.\n );\n\n /// @dev Forwards arguments to assetProxy and calls `transferFrom`. Either succeeds or throws.\n /// @param assetData Byte array encoded for the asset.\n /// @param from Address to transfer token from.\n /// @param to Address to transfer token to.\n /// @param amount Amount of token to transfer.\n function dispatchTransferFrom(\n bytes memory assetData,\n address from,\n address to,\n uint256 amount\n )\n internal;\n}\n",
- "2.0.0/protocol/Exchange/mixins/MExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IExchangeCore.sol\";\n\n\ncontract MExchangeCore is\n IExchangeCore\n{\n // Fill event is emitted whenever an order is filled.\n event Fill(\n address indexed makerAddress, // Address that created the order. \n address indexed feeRecipientAddress, // Address that received fees.\n address takerAddress, // Address that filled the order.\n address senderAddress, // Address that called the Exchange contract (msg.sender).\n uint256 makerAssetFilledAmount, // Amount of makerAsset sold by maker and bought by taker. \n uint256 takerAssetFilledAmount, // Amount of takerAsset sold by taker and bought by maker.\n uint256 makerFeePaid, // Amount of ZRX paid to feeRecipient by maker.\n uint256 takerFeePaid, // Amount of ZRX paid to feeRecipient by taker.\n bytes32 indexed orderHash, // EIP712 hash of order (see LibOrder.getOrderHash).\n bytes makerAssetData, // Encoded data specific to makerAsset. \n bytes takerAssetData // Encoded data specific to takerAsset.\n );\n\n // Cancel event is emitted whenever an individual order is cancelled.\n event Cancel(\n address indexed makerAddress, // Address that created the order. \n address indexed feeRecipientAddress, // Address that would have recieved fees if order was filled. \n address senderAddress, // Address that called the Exchange contract (msg.sender).\n bytes32 indexed orderHash, // EIP712 hash of order (see LibOrder.getOrderHash).\n bytes makerAssetData, // Encoded data specific to makerAsset. \n bytes takerAssetData // Encoded data specific to takerAsset.\n );\n\n // CancelUpTo event is emitted whenever `cancelOrdersUpTo` is executed succesfully.\n event CancelUpTo(\n address indexed makerAddress, // Orders cancelled must have been created by this address.\n address indexed senderAddress, // Orders cancelled must have a `senderAddress` equal to this address.\n uint256 orderEpoch // Orders with specified makerAddress and senderAddress with a salt less than this value are considered cancelled.\n );\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev After calling, the order can not be filled anymore.\n /// @param order Order struct containing order specifications.\n function cancelOrderInternal(LibOrder.Order memory order)\n internal;\n\n /// @dev Updates state with results of a fill order.\n /// @param order that was filled.\n /// @param takerAddress Address of taker who filled the order.\n /// @param orderTakerAssetFilledAmount Amount of order already filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function updateFilledState(\n LibOrder.Order memory order,\n address takerAddress,\n bytes32 orderHash,\n uint256 orderTakerAssetFilledAmount,\n LibFillResults.FillResults memory fillResults\n )\n internal;\n\n /// @dev Updates state with results of cancelling an order.\n /// State is only updated if the order is currently fillable.\n /// Otherwise, updating state would have no effect.\n /// @param order that was cancelled.\n /// @param orderHash Hash of order that was cancelled.\n function updateCancelledState(\n LibOrder.Order memory order,\n bytes32 orderHash\n )\n internal;\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAddress Address of order taker.\n /// @param signature Proof that the orders was created by its maker.\n function assertFillableOrder(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo,\n address takerAddress,\n bytes memory signature\n )\n internal\n view;\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo Status, orderHash, and amount already filled of order.\n /// @param takerAssetFillAmount Desired amount of order to fill by taker.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @param makerAssetFilledAmount Amount of makerAsset that will be transfered.\n function assertValidFill(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo,\n uint256 takerAssetFillAmount,\n uint256 takerAssetFilledAmount,\n uint256 makerAssetFilledAmount\n )\n internal\n view;\n\n /// @dev Validates context for cancelOrder. Succeeds or throws.\n /// @param order to be cancelled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n function assertValidCancel(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo\n )\n internal\n view;\n\n /// @dev Calculates amounts filled and fees paid by maker and taker.\n /// @param order to be filled.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function calculateFillResults(\n LibOrder.Order memory order,\n uint256 takerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.FillResults memory fillResults);\n\n}\n",
- "2.0.0/protocol/Exchange/mixins/MMatchOrders.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IMatchOrders.sol\";\n\n\ncontract MMatchOrders is\n IMatchOrders\n{\n /// @dev Validates context for matchOrders. Succeeds or throws.\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n function assertValidMatch(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder\n )\n internal\n pure;\n\n /// @dev Calculates fill amounts for the matched orders.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the leftOrder order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftOrderTakerAssetFilledAmount Amount of left order already filled.\n /// @param rightOrderTakerAssetFilledAmount Amount of right order already filled.\n /// @param matchedFillResults Amounts to fill and fees to pay by maker and taker of matched orders.\n function calculateMatchedFillResults(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n uint256 leftOrderTakerAssetFilledAmount,\n uint256 rightOrderTakerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.MatchedFillResults memory matchedFillResults);\n\n}\n",
- "2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/ISignatureValidator.sol\";\n\n\ncontract MSignatureValidator is\n ISignatureValidator\n{\n event SignatureValidatorApproval(\n address indexed signerAddress, // Address that approves or disapproves a contract to verify signatures.\n address indexed validatorAddress, // Address of signature validator contract.\n bool approved // Approval or disapproval of validator contract.\n );\n\n // Allowed signature types.\n enum SignatureType {\n Illegal, // 0x00, default value\n Invalid, // 0x01\n EIP712, // 0x02\n EthSign, // 0x03\n Wallet, // 0x04\n Validator, // 0x05\n PreSigned, // 0x06\n NSignatureTypes // 0x07, number of signature types. Always leave at end.\n }\n\n /// @dev Verifies signature using logic defined by Wallet contract.\n /// @param hash Any 32 byte hash.\n /// @param walletAddress Address that should have signed the given hash\n /// and defines its own signature verification method.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidWalletSignature(\n bytes32 hash,\n address walletAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid);\n\n /// @dev Verifies signature using logic defined by Validator contract.\n /// @param validatorAddress Address of validator contract.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidValidatorSignature(\n address validatorAddress,\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/mixins/MTransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\nimport \"../interfaces/ITransactions.sol\";\n\n\ncontract MTransactions is\n ITransactions\n{\n // Hash for the EIP712 ZeroEx Transaction Schema\n bytes32 constant internal EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"ZeroExTransaction(\",\n \"uint256 salt,\",\n \"address signerAddress,\",\n \"bytes data\",\n \")\"\n ));\n\n /// @dev Calculates EIP712 hash of the Transaction.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @return EIP712 hash of the Transaction.\n function hashZeroExTransaction(\n uint256 salt,\n address signerAddress,\n bytes memory data\n )\n internal\n pure\n returns (bytes32 result);\n\n /// @dev The current function will be called in the context of this address (either 0x transaction signer or `msg.sender`).\n /// If calling a fill function, this address will represent the taker.\n /// If calling a cancel function, this address will represent the maker.\n /// @return Signer of 0x transaction if entry point is `executeTransaction`.\n /// `msg.sender` if entry point is any other function.\n function getCurrentContextAddress()\n internal\n view\n returns (address);\n}\n",
- "2.0.0/protocol/Exchange/mixins/MWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IWrapperFunctions.sol\";\n\n\ncontract MWrapperFunctions is \n IWrapperFunctions\n{\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n}\n",
- "2.0.0/test/DummyERC20Token/DummyERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"../../tokens/ERC20Token/MintableERC20Token.sol\";\n\n\ncontract DummyERC20Token is \n Ownable,\n MintableERC20Token\n{\n string public name;\n string public symbol;\n uint256 public decimals;\n uint256 public constant MAX_MINT_AMOUNT = 10000000000000000000000;\n\n constructor (\n string _name,\n string _symbol,\n uint256 _decimals,\n uint256 _totalSupply\n )\n public\n {\n name = _name;\n symbol = _symbol;\n decimals = _decimals;\n _totalSupply = _totalSupply;\n balances[msg.sender] = _totalSupply;\n }\n\n /// @dev Sets the balance of target address\n /// @param _target Address or which balance will be updated\n /// @param _value New balance of target address\n function setBalance(address _target, uint256 _value)\n external\n onlyOwner\n {\n uint256 currBalance = balances[_target];\n if (_value < currBalance) {\n _totalSupply = safeSub(_totalSupply, safeSub(currBalance, _value));\n } else {\n _totalSupply = safeAdd(_totalSupply, safeSub(_value, currBalance));\n }\n balances[_target] = _value;\n }\n\n /// @dev Mints new tokens for sender\n /// @param _value Amount of tokens to mint\n function mint(uint256 _value)\n external\n {\n require(\n _value <= MAX_MINT_AMOUNT,\n \"VALUE_TOO_LARGE\"\n );\n\n _mint(msg.sender, _value);\n }\n}\n",
- "2.0.0/test/DummyERC721Token/DummyERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../tokens/ERC721Token/MintableERC721Token.sol\";\nimport \"../../utils/Ownable/Ownable.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract DummyERC721Token is\n Ownable,\n MintableERC721Token\n{\n string public name;\n string public symbol;\n\n constructor (\n string _name,\n string _symbol\n )\n public\n {\n name = _name;\n symbol = _symbol;\n }\n\n /// @dev Function to mint a new token\n /// Reverts if the given token ID already exists\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _tokenId ID of the token to be minted by the msg.sender \n function mint(address _to, uint256 _tokenId)\n external\n {\n _mint(_to, _tokenId);\n }\n\n /// @dev Function to burn a token\n /// Reverts if the given token ID doesn't exist or not called by contract owner\n /// @param _owner Owner of token with given token ID\n /// @param _tokenId ID of the token to be burned by the msg.sender\n function burn(address _owner, uint256 _tokenId)\n external\n onlyOwner\n {\n _burn(_owner, _tokenId);\n }\n}\n",
- "2.0.0/tokens/ERC20Token/ERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IERC20Token.sol\";\n\n\ncontract ERC20Token is\n IERC20Token\n{\n mapping (address => uint256) internal balances;\n mapping (address => mapping (address => uint256)) internal allowed;\n\n uint256 internal _totalSupply;\n\n /// @dev send `value` token to `to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transfer(address _to, uint256 _value)\n external\n returns (bool)\n {\n require(\n balances[msg.sender] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[msg.sender] -= _value;\n balances[_to] += _value;\n\n emit Transfer(\n msg.sender,\n _to,\n _value\n );\n\n return true;\n }\n\n /// @dev send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool)\n {\n require(\n balances[_from] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n allowed[_from][msg.sender] >= _value,\n \"ERC20_INSUFFICIENT_ALLOWANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[_to] += _value;\n balances[_from] -= _value;\n allowed[_from][msg.sender] -= _value;\n \n emit Transfer(\n _from,\n _to,\n _value\n );\n \n return true;\n }\n\n /// @dev `msg.sender` approves `_spender` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Always true if the call has enough gas to complete execution\n function approve(address _spender, uint256 _value)\n external\n returns (bool)\n {\n allowed[msg.sender][_spender] = _value;\n emit Approval(\n msg.sender,\n _spender,\n _value\n );\n return true;\n }\n\n /// @dev Query total supply of token\n /// @return Total supply of token\n function totalSupply()\n external\n view\n returns (uint256)\n {\n return _totalSupply;\n }\n\n /// @dev Query the balance of owner\n /// @param _owner The address from which the balance will be retrieved\n /// @return Balance of owner\n function balanceOf(address _owner)\n external\n view\n returns (uint256)\n {\n return balances[_owner];\n }\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender)\n external\n view\n returns (uint256)\n {\n return allowed[_owner][_spender];\n }\n}\n",
- "2.0.0/tokens/ERC20Token/IERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC20Token {\n\n // solhint-disable no-simple-event-func-name\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 _value\n );\n\n event Approval(\n address indexed _owner,\n address indexed _spender,\n uint256 _value\n );\n\n /// @dev send `value` token to `to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transfer(address _to, uint256 _value)\n external\n returns (bool);\n\n /// @dev send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool);\n \n /// @dev `msg.sender` approves `_spender` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Always true if the call has enough gas to complete execution\n function approve(address _spender, uint256 _value)\n external\n returns (bool);\n\n /// @dev Query total supply of token\n /// @return Total supply of token\n function totalSupply()\n external\n view\n returns (uint256);\n \n /// @param _owner The address from which the balance will be retrieved\n /// @return Balance of owner\n function balanceOf(address _owner)\n external\n view\n returns (uint256);\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender)\n external\n view\n returns (uint256);\n}\n",
- "2.0.0/tokens/ERC20Token/MintableERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/SafeMath/SafeMath.sol\";\nimport \"./UnlimitedAllowanceERC20Token.sol\";\n\n\ncontract MintableERC20Token is \n SafeMath,\n UnlimitedAllowanceERC20Token\n{\n /// @dev Mints new tokens\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _value Amount of tokens to mint\n function _mint(address _to, uint256 _value)\n internal\n {\n balances[_to] = safeAdd(_value, balances[_to]);\n _totalSupply = safeAdd(_totalSupply, _value);\n\n emit Transfer(\n address(0),\n _to,\n _value\n );\n }\n\n /// @dev Mints new tokens\n /// @param _owner Owner of tokens that will be burned\n /// @param _value Amount of tokens to burn\n function _burn(address _owner, uint256 _value)\n internal\n {\n balances[_owner] = safeSub(balances[_owner], _value);\n _totalSupply = safeSub(_totalSupply, _value);\n\n emit Transfer(\n _owner,\n address(0),\n _value\n );\n }\n}\n",
- "2.0.0/tokens/ERC20Token/UnlimitedAllowanceERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../ERC20Token/ERC20Token.sol\";\n\n\ncontract UnlimitedAllowanceERC20Token is\n ERC20Token\n{\n uint256 constant internal MAX_UINT = 2**256 - 1;\n\n /// @dev ERC20 transferFrom, modified such that an allowance of MAX_UINT represents an unlimited allowance. See https://github.com/ethereum/EIPs/issues/717\n /// @param _from Address to transfer from.\n /// @param _to Address to transfer to.\n /// @param _value Amount to transfer.\n /// @return Success of transfer.\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool)\n {\n uint256 allowance = allowed[_from][msg.sender];\n require(\n balances[_from] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n allowance >= _value,\n \"ERC20_INSUFFICIENT_ALLOWANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[_to] += _value;\n balances[_from] -= _value;\n if (allowance < MAX_UINT) {\n allowed[_from][msg.sender] -= _value;\n }\n\n emit Transfer(\n _from,\n _to,\n _value\n );\n\n return true;\n }\n}\n",
- "2.0.0/tokens/ERC721Token/ERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IERC721Token.sol\";\nimport \"./IERC721Receiver.sol\";\nimport \"../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract ERC721Token is\n IERC721Token,\n SafeMath\n{\n // Function selector for ERC721Receiver.onERC721Received\n // 0x150b7a02\n bytes4 constant internal ERC721_RECEIVED = bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"));\n\n // Mapping of tokenId => owner\n mapping (uint256 => address) internal owners;\n\n // Mapping of tokenId => approved address\n mapping (uint256 => address) internal approvals;\n\n // Mapping of owner => number of tokens owned\n mapping (address => uint256) internal balances;\n\n // Mapping of owner => operator => approved\n mapping (address => mapping (address => bool)) internal operatorApprovals;\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT. When transfer is complete, this function\n /// checks if `_to` is a smart contract (code size > 0). If so, it calls\n /// `onERC721Received` on `_to` and throws if the return value is not\n /// `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n /// @param _data Additional data with no specified format, sent in call to `_to`\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId,\n bytes _data\n )\n external\n {\n transferFrom(\n _from,\n _to,\n _tokenId\n );\n\n uint256 receiverCodeSize;\n assembly {\n receiverCodeSize := extcodesize(_to)\n }\n if (receiverCodeSize > 0) {\n bytes4 selector = IERC721Receiver(_to).onERC721Received(\n msg.sender,\n _from,\n _tokenId,\n _data\n );\n require(\n selector == ERC721_RECEIVED,\n \"ERC721_INVALID_SELECTOR\"\n );\n }\n }\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev This works identically to the other function with an extra data parameter,\n /// except this function just sets data to \"\".\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n external\n {\n transferFrom(\n _from,\n _to,\n _tokenId\n );\n\n uint256 receiverCodeSize;\n assembly {\n receiverCodeSize := extcodesize(_to)\n }\n if (receiverCodeSize > 0) {\n bytes4 selector = IERC721Receiver(_to).onERC721Received(\n msg.sender,\n _from,\n _tokenId,\n \"\"\n );\n require(\n selector == ERC721_RECEIVED,\n \"ERC721_INVALID_SELECTOR\"\n );\n }\n }\n\n /// @notice Change or reaffirm the approved address for an NFT\n /// @dev The zero address indicates there is no approved address.\n /// Throws unless `msg.sender` is the current NFT owner, or an authorized\n /// operator of the current owner.\n /// @param _approved The new approved NFT controller\n /// @param _tokenId The NFT to approve\n function approve(address _approved, uint256 _tokenId)\n external\n {\n address owner = ownerOf(_tokenId);\n require(\n msg.sender == owner || isApprovedForAll(owner, msg.sender),\n \"ERC721_INVALID_SENDER\"\n );\n\n approvals[_tokenId] = _approved;\n emit Approval(\n owner,\n _approved,\n _tokenId\n );\n }\n\n /// @notice Enable or disable approval for a third party (\"operator\") to manage\n /// all of `msg.sender`'s assets\n /// @dev Emits the ApprovalForAll event. The contract MUST allow\n /// multiple operators per owner.\n /// @param _operator Address to add to the set of authorized operators\n /// @param _approved True if the operator is approved, false to revoke approval\n function setApprovalForAll(address _operator, bool _approved)\n external\n {\n operatorApprovals[msg.sender][_operator] = _approved;\n emit ApprovalForAll(\n msg.sender,\n _operator,\n _approved\n );\n }\n \n /// @notice Count all NFTs assigned to an owner\n /// @dev NFTs assigned to the zero address are considered invalid, and this\n /// function throws for queries about the zero address.\n /// @param _owner An address for whom to query the balance\n /// @return The number of NFTs owned by `_owner`, possibly zero\n function balanceOf(address _owner)\n external\n view\n returns (uint256)\n {\n require(\n _owner != address(0),\n \"ERC721_ZERO_OWNER\"\n );\n return balances[_owner];\n }\n\n /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE\n /// TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE\n /// THEY MAY BE PERMANENTLY LOST\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function transferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n public\n {\n require(\n _to != address(0),\n \"ERC721_ZERO_TO_ADDRESS\"\n );\n\n address owner = ownerOf(_tokenId);\n require(\n _from == owner,\n \"ERC721_OWNER_MISMATCH\"\n );\n\n address spender = msg.sender;\n address approvedAddress = getApproved(_tokenId);\n require(\n spender == owner ||\n isApprovedForAll(owner, spender) ||\n approvedAddress == spender,\n \"ERC721_INVALID_SPENDER\"\n );\n\n if (approvedAddress != address(0)) {\n approvals[_tokenId] = address(0);\n }\n\n owners[_tokenId] = _to;\n balances[_from] = safeSub(balances[_from], 1);\n balances[_to] = safeAdd(balances[_to], 1);\n \n emit Transfer(\n _from,\n _to,\n _tokenId\n );\n }\n\n /// @notice Find the owner of an NFT\n /// @dev NFTs assigned to zero address are considered invalid, and queries\n /// about them do throw.\n /// @param _tokenId The identifier for an NFT\n /// @return The address of the owner of the NFT\n function ownerOf(uint256 _tokenId)\n public\n view\n returns (address)\n {\n address owner = owners[_tokenId];\n require(\n owner != address(0),\n \"ERC721_ZERO_OWNER\"\n );\n return owner;\n }\n\n /// @notice Get the approved address for a single NFT\n /// @dev Throws if `_tokenId` is not a valid NFT.\n /// @param _tokenId The NFT to find the approved address for\n /// @return The approved address for this NFT, or the zero address if there is none\n function getApproved(uint256 _tokenId)\n public\n view\n returns (address)\n {\n return approvals[_tokenId];\n }\n\n /// @notice Query if an address is an authorized operator for another address\n /// @param _owner The address that owns the NFTs\n /// @param _operator The address that acts on behalf of the owner\n /// @return True if `_operator` is an approved operator for `_owner`, false otherwise\n function isApprovedForAll(address _owner, address _operator)\n public\n view\n returns (bool)\n {\n return operatorApprovals[_owner][_operator];\n }\n}\n",
- "2.0.0/tokens/ERC721Token/IERC721Receiver.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC721Receiver {\n\n /// @notice Handle the receipt of an NFT\n /// @dev The ERC721 smart contract calls this function on the recipient\n /// after a `transfer`. This function MAY throw to revert and reject the\n /// transfer. Return of other than the magic value MUST result in the\n /// transaction being reverted.\n /// Note: the contract address is always the message sender.\n /// @param _operator The address which called `safeTransferFrom` function\n /// @param _from The address which previously owned the token\n /// @param _tokenId The NFT identifier which is being transferred\n /// @param _data Additional data with no specified format\n /// @return `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`\n /// unless throwing\n function onERC721Received(\n address _operator,\n address _from,\n uint256 _tokenId,\n bytes _data\n )\n external\n returns (bytes4);\n}\n",
- "2.0.0/tokens/ERC721Token/IERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC721Token {\n\n /// @dev This emits when ownership of any NFT changes by any mechanism.\n /// This event emits when NFTs are created (`from` == 0) and destroyed\n /// (`to` == 0). Exception: during contract creation, any number of NFTs\n /// may be created and assigned without emitting Transfer. At the time of\n /// any transfer, the approved address for that NFT (if any) is reset to none.\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 indexed _tokenId\n );\n\n /// @dev This emits when the approved address for an NFT is changed or\n /// reaffirmed. The zero address indicates there is no approved address.\n /// When a Transfer event emits, this also indicates that the approved\n /// address for that NFT (if any) is reset to none.\n event Approval(\n address indexed _owner,\n address indexed _approved,\n uint256 indexed _tokenId\n );\n\n /// @dev This emits when an operator is enabled or disabled for an owner.\n /// The operator can manage all NFTs of the owner.\n event ApprovalForAll(\n address indexed _owner,\n address indexed _operator,\n bool _approved\n );\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// perator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT. When transfer is complete, this function\n /// checks if `_to` is a smart contract (code size > 0). If so, it calls\n /// `onERC721Received` on `_to` and throws if the return value is not\n /// `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n /// @param _data Additional data with no specified format, sent in call to `_to`\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId,\n bytes _data\n )\n external;\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev This works identically to the other function with an extra data parameter,\n /// except this function just sets data to \"\".\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n external;\n\n /// @notice Change or reaffirm the approved address for an NFT\n /// @dev The zero address indicates there is no approved address.\n /// Throws unless `msg.sender` is the current NFT owner, or an authorized\n /// operator of the current owner.\n /// @param _approved The new approved NFT controller\n /// @param _tokenId The NFT to approve\n function approve(address _approved, uint256 _tokenId)\n external;\n\n /// @notice Enable or disable approval for a third party (\"operator\") to manage\n /// all of `msg.sender`'s assets\n /// @dev Emits the ApprovalForAll event. The contract MUST allow\n /// multiple operators per owner.\n /// @param _operator Address to add to the set of authorized operators\n /// @param _approved True if the operator is approved, false to revoke approval\n function setApprovalForAll(address _operator, bool _approved)\n external;\n\n /// @notice Count all NFTs assigned to an owner\n /// @dev NFTs assigned to the zero address are considered invalid, and this\n /// function throws for queries about the zero address.\n /// @param _owner An address for whom to query the balance\n /// @return The number of NFTs owned by `_owner`, possibly zero\n function balanceOf(address _owner)\n external\n view\n returns (uint256);\n\n /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE\n /// TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE\n /// THEY MAY BE PERMANENTLY LOST\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function transferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n public;\n\n /// @notice Find the owner of an NFT\n /// @dev NFTs assigned to zero address are considered invalid, and queries\n /// about them do throw.\n /// @param _tokenId The identifier for an NFT\n /// @return The address of the owner of the NFT\n function ownerOf(uint256 _tokenId)\n public\n view\n returns (address);\n\n /// @notice Get the approved address for a single NFT\n /// @dev Throws if `_tokenId` is not a valid NFT.\n /// @param _tokenId The NFT to find the approved address for\n /// @return The approved address for this NFT, or the zero address if there is none\n function getApproved(uint256 _tokenId) \n public\n view\n returns (address);\n \n /// @notice Query if an address is an authorized operator for another address\n /// @param _owner The address that owns the NFTs\n /// @param _operator The address that acts on behalf of the owner\n /// @return True if `_operator` is an approved operator for `_owner`, false otherwise\n function isApprovedForAll(address _owner, address _operator)\n public\n view\n returns (bool);\n}\n",
- "2.0.0/tokens/ERC721Token/MintableERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./ERC721Token.sol\";\n\n\ncontract MintableERC721Token is\n ERC721Token\n{\n /// @dev Function to mint a new token\n /// Reverts if the given token ID already exists\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _tokenId ID of the token to be minted by the msg.sender \n function _mint(address _to, uint256 _tokenId)\n internal\n {\n require(\n _to != address(0),\n \"ERC721_ZERO_TO_ADDRESS\"\n );\n\n address owner = owners[_tokenId];\n require(\n owner == address(0),\n \"ERC721_OWNER_ALREADY_EXISTS\"\n );\n\n owners[_tokenId] = _to;\n balances[_to] = safeAdd(balances[_to], 1);\n\n emit Transfer(\n address(0),\n _to,\n _tokenId\n );\n }\n\n /// @dev Function to burn a token\n /// Reverts if the given token ID doesn't exist\n /// @param _owner Owner of token with given token ID\n /// @param _tokenId ID of the token to be burned by the msg.sender\n function _burn(address _owner, uint256 _tokenId)\n internal\n {\n require(\n _owner != address(0),\n \"ERC721_ZERO_OWNER_ADDRESS\"\n );\n\n address owner = owners[_tokenId];\n require(\n owner == _owner,\n \"ERC721_OWNER_MISMATCH\"\n );\n\n owners[_tokenId] = address(0);\n balances[_owner] = safeSub(balances[_owner], 1);\n\n emit Transfer(\n _owner,\n address(0),\n _tokenId\n );\n }\n}\n",
- "2.0.0/tokens/EtherToken/IEtherToken.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../ERC20Token/IERC20Token.sol\";\n\n\ncontract IEtherToken is\n IERC20Token\n{\n function deposit()\n public\n payable;\n \n function withdraw(uint256 amount)\n public;\n}\n",
- "2.0.0/utils/LibBytes/LibBytes.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\nlibrary LibBytes {\n\n using LibBytes for bytes;\n\n /// @dev Gets the memory address for a byte array.\n /// @param input Byte array to lookup.\n /// @return memoryAddress Memory address of byte array. This\n /// points to the header of the byte array which contains\n /// the length.\n function rawAddress(bytes memory input)\n internal\n pure\n returns (uint256 memoryAddress)\n {\n assembly {\n memoryAddress := input\n }\n return memoryAddress;\n }\n \n /// @dev Gets the memory address for the contents of a byte array.\n /// @param input Byte array to lookup.\n /// @return memoryAddress Memory address of the contents of the byte array.\n function contentAddress(bytes memory input)\n internal\n pure\n returns (uint256 memoryAddress)\n {\n assembly {\n memoryAddress := add(input, 32)\n }\n return memoryAddress;\n }\n\n /// @dev Copies `length` bytes from memory location `source` to `dest`.\n /// @param dest memory address to copy bytes to.\n /// @param source memory address to copy bytes from.\n /// @param length number of bytes to copy.\n function memCopy(\n uint256 dest,\n uint256 source,\n uint256 length\n )\n internal\n pure\n {\n if (length < 32) {\n // Handle a partial word by reading destination and masking\n // off the bits we are interested in.\n // This correctly handles overlap, zero lengths and source == dest\n assembly {\n let mask := sub(exp(256, sub(32, length)), 1)\n let s := and(mload(source), not(mask))\n let d := and(mload(dest), mask)\n mstore(dest, or(s, d))\n }\n } else {\n // Skip the O(length) loop when source == dest.\n if (source == dest) {\n return;\n }\n\n // For large copies we copy whole words at a time. The final\n // word is aligned to the end of the range (instead of after the\n // previous) to handle partial words. So a copy will look like this:\n //\n // ####\n // ####\n // ####\n // ####\n //\n // We handle overlap in the source and destination range by\n // changing the copying direction. This prevents us from\n // overwriting parts of source that we still need to copy.\n //\n // This correctly handles source == dest\n //\n if (source > dest) {\n assembly {\n // We subtract 32 from `sEnd` and `dEnd` because it\n // is easier to compare with in the loop, and these\n // are also the addresses we need for copying the\n // last bytes.\n length := sub(length, 32)\n let sEnd := add(source, length)\n let dEnd := add(dest, length)\n\n // Remember the last 32 bytes of source\n // This needs to be done here and not after the loop\n // because we may have overwritten the last bytes in\n // source already due to overlap.\n let last := mload(sEnd)\n\n // Copy whole words front to back\n // Note: the first check is always true,\n // this could have been a do-while loop.\n // solhint-disable-next-line no-empty-blocks\n for {} lt(source, sEnd) {} {\n mstore(dest, mload(source))\n source := add(source, 32)\n dest := add(dest, 32)\n }\n \n // Write the last 32 bytes\n mstore(dEnd, last)\n }\n } else {\n assembly {\n // We subtract 32 from `sEnd` and `dEnd` because those\n // are the starting points when copying a word at the end.\n length := sub(length, 32)\n let sEnd := add(source, length)\n let dEnd := add(dest, length)\n\n // Remember the first 32 bytes of source\n // This needs to be done here and not after the loop\n // because we may have overwritten the first bytes in\n // source already due to overlap.\n let first := mload(source)\n\n // Copy whole words back to front\n // We use a signed comparisson here to allow dEnd to become\n // negative (happens when source and dest < 32). Valid\n // addresses in local memory will never be larger than\n // 2**255, so they can be safely re-interpreted as signed.\n // Note: the first check is always true,\n // this could have been a do-while loop.\n // solhint-disable-next-line no-empty-blocks\n for {} slt(dest, dEnd) {} {\n mstore(dEnd, mload(sEnd))\n sEnd := sub(sEnd, 32)\n dEnd := sub(dEnd, 32)\n }\n \n // Write the first 32 bytes\n mstore(dest, first)\n }\n }\n }\n }\n\n /// @dev Returns a slices from a byte array.\n /// @param b The byte array to take a slice from.\n /// @param from The starting index for the slice (inclusive).\n /// @param to The final index for the slice (exclusive).\n /// @return result The slice containing bytes at indices [from, to)\n function slice(\n bytes memory b,\n uint256 from,\n uint256 to\n )\n internal\n pure\n returns (bytes memory result)\n {\n require(\n from <= to,\n \"FROM_LESS_THAN_TO_REQUIRED\"\n );\n require(\n to < b.length,\n \"TO_LESS_THAN_LENGTH_REQUIRED\"\n );\n \n // Create a new bytes structure and copy contents\n result = new bytes(to - from);\n memCopy(\n result.contentAddress(),\n b.contentAddress() + from,\n result.length\n );\n return result;\n }\n \n /// @dev Returns a slice from a byte array without preserving the input.\n /// @param b The byte array to take a slice from. Will be destroyed in the process.\n /// @param from The starting index for the slice (inclusive).\n /// @param to The final index for the slice (exclusive).\n /// @return result The slice containing bytes at indices [from, to)\n /// @dev When `from == 0`, the original array will match the slice. In other cases its state will be corrupted.\n function sliceDestructive(\n bytes memory b,\n uint256 from,\n uint256 to\n )\n internal\n pure\n returns (bytes memory result)\n {\n require(\n from <= to,\n \"FROM_LESS_THAN_TO_REQUIRED\"\n );\n require(\n to < b.length,\n \"TO_LESS_THAN_LENGTH_REQUIRED\"\n );\n \n // Create a new bytes structure around [from, to) in-place.\n assembly {\n result := add(b, from)\n mstore(result, sub(to, from))\n }\n return result;\n }\n\n /// @dev Pops the last byte off of a byte array by modifying its length.\n /// @param b Byte array that will be modified.\n /// @return The byte that was popped off.\n function popLastByte(bytes memory b)\n internal\n pure\n returns (bytes1 result)\n {\n require(\n b.length > 0,\n \"GREATER_THAN_ZERO_LENGTH_REQUIRED\"\n );\n\n // Store last byte.\n result = b[b.length - 1];\n\n assembly {\n // Decrement length of byte array.\n let newLen := sub(mload(b), 1)\n mstore(b, newLen)\n }\n return result;\n }\n\n /// @dev Pops the last 20 bytes off of a byte array by modifying its length.\n /// @param b Byte array that will be modified.\n /// @return The 20 byte address that was popped off.\n function popLast20Bytes(bytes memory b)\n internal\n pure\n returns (address result)\n {\n require(\n b.length >= 20,\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Store last 20 bytes.\n result = readAddress(b, b.length - 20);\n\n assembly {\n // Subtract 20 from byte array length.\n let newLen := sub(mload(b), 20)\n mstore(b, newLen)\n }\n return result;\n }\n\n /// @dev Tests equality of two byte arrays.\n /// @param lhs First byte array to compare.\n /// @param rhs Second byte array to compare.\n /// @return True if arrays are the same. False otherwise.\n function equals(\n bytes memory lhs,\n bytes memory rhs\n )\n internal\n pure\n returns (bool equal)\n {\n // Keccak gas cost is 30 + numWords * 6. This is a cheap way to compare.\n // We early exit on unequal lengths, but keccak would also correctly\n // handle this.\n return lhs.length == rhs.length && keccak256(lhs) == keccak256(rhs);\n }\n\n /// @dev Reads an address from a position in a byte array.\n /// @param b Byte array containing an address.\n /// @param index Index in byte array of address.\n /// @return address from byte array.\n function readAddress(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (address result)\n {\n require(\n b.length >= index + 20, // 20 is length of address\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Add offset to index:\n // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)\n // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)\n index += 20;\n\n // Read address from array memory\n assembly {\n // 1. Add index to address of bytes array\n // 2. Load 32-byte word from memory\n // 3. Apply 20-byte mask to obtain address\n result := and(mload(add(b, index)), 0xffffffffffffffffffffffffffffffffffffffff)\n }\n return result;\n }\n\n /// @dev Writes an address into a specific position in a byte array.\n /// @param b Byte array to insert address into.\n /// @param index Index in byte array of address.\n /// @param input Address to put into byte array.\n function writeAddress(\n bytes memory b,\n uint256 index,\n address input\n )\n internal\n pure\n {\n require(\n b.length >= index + 20, // 20 is length of address\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Add offset to index:\n // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)\n // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)\n index += 20;\n\n // Store address into array memory\n assembly {\n // The address occupies 20 bytes and mstore stores 32 bytes.\n // First fetch the 32-byte word where we'll be storing the address, then\n // apply a mask so we have only the bytes in the word that the address will not occupy.\n // Then combine these bytes with the address and store the 32 bytes back to memory with mstore.\n\n // 1. Add index to address of bytes array\n // 2. Load 32-byte word from memory\n // 3. Apply 12-byte mask to obtain extra bytes occupying word of memory where we'll store the address\n let neighbors := and(\n mload(add(b, index)),\n 0xffffffffffffffffffffffff0000000000000000000000000000000000000000\n )\n \n // Make sure input address is clean.\n // (Solidity does not guarantee this)\n input := and(input, 0xffffffffffffffffffffffffffffffffffffffff)\n\n // Store the neighbors and address into memory\n mstore(add(b, index), xor(input, neighbors))\n }\n }\n\n /// @dev Reads a bytes32 value from a position in a byte array.\n /// @param b Byte array containing a bytes32 value.\n /// @param index Index in byte array of bytes32 value.\n /// @return bytes32 value from byte array.\n function readBytes32(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes32 result)\n {\n require(\n b.length >= index + 32,\n \"GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 256 bit length parameter\n index += 32;\n\n // Read the bytes32 from array memory\n assembly {\n result := mload(add(b, index))\n }\n return result;\n }\n\n /// @dev Writes a bytes32 into a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input bytes32 to put into byte array.\n function writeBytes32(\n bytes memory b,\n uint256 index,\n bytes32 input\n )\n internal\n pure\n {\n require(\n b.length >= index + 32,\n \"GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 256 bit length parameter\n index += 32;\n\n // Read the bytes32 from array memory\n assembly {\n mstore(add(b, index), input)\n }\n }\n\n /// @dev Reads a uint256 value from a position in a byte array.\n /// @param b Byte array containing a uint256 value.\n /// @param index Index in byte array of uint256 value.\n /// @return uint256 value from byte array.\n function readUint256(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (uint256 result)\n {\n result = uint256(readBytes32(b, index));\n return result;\n }\n\n /// @dev Writes a uint256 into a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input uint256 to put into byte array.\n function writeUint256(\n bytes memory b,\n uint256 index,\n uint256 input\n )\n internal\n pure\n {\n writeBytes32(b, index, bytes32(input));\n }\n\n /// @dev Reads an unpadded bytes4 value from a position in a byte array.\n /// @param b Byte array containing a bytes4 value.\n /// @param index Index in byte array of bytes4 value.\n /// @return bytes4 value from byte array.\n function readBytes4(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes4 result)\n {\n require(\n b.length >= index + 4,\n \"GREATER_OR_EQUAL_TO_4_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 32 byte length field\n index += 32;\n\n // Read the bytes4 from array memory\n assembly {\n result := mload(add(b, index))\n // Solidity does not require us to clean the trailing bytes.\n // We do it anyway\n result := and(result, 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000)\n }\n return result;\n }\n\n /// @dev Reads nested bytes from a specific position.\n /// @dev NOTE: the returned value overlaps with the input value.\n /// Both should be treated as immutable.\n /// @param b Byte array containing nested bytes.\n /// @param index Index of nested bytes.\n /// @return result Nested bytes.\n function readBytesWithLength(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes memory result)\n {\n // Read length of nested bytes\n uint256 nestedBytesLength = readUint256(b, index);\n index += 32;\n\n // Assert length of <b> is valid, given\n // length of nested bytes\n require(\n b.length >= index + nestedBytesLength,\n \"GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED\"\n );\n \n // Return a pointer to the byte array as it exists inside `b`\n assembly {\n result := add(b, index)\n }\n return result;\n }\n\n /// @dev Inserts bytes at a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input bytes to insert.\n function writeBytesWithLength(\n bytes memory b,\n uint256 index,\n bytes memory input\n )\n internal\n pure\n {\n // Assert length of <b> is valid, given\n // length of input\n require(\n b.length >= index + 32 + input.length, // 32 bytes to store length\n \"GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED\"\n );\n\n // Copy <input> into <b>\n memCopy(\n b.contentAddress() + index,\n input.rawAddress(), // includes length of <input>\n input.length + 32 // +32 bytes to store <input> length\n );\n }\n\n /// @dev Performs a deep copy of a byte array onto another byte array of greater than or equal length.\n /// @param dest Byte array that will be overwritten with source bytes.\n /// @param source Byte array to copy onto dest bytes.\n function deepCopyBytes(\n bytes memory dest,\n bytes memory source\n )\n internal\n pure\n {\n uint256 sourceLen = source.length;\n // Dest length must be >= source length, or some bytes would not be copied.\n require(\n dest.length >= sourceLen,\n \"GREATER_OR_EQUAL_TO_SOURCE_BYTES_LENGTH_REQUIRED\"\n );\n memCopy(\n dest.contentAddress(),\n source.contentAddress(),\n sourceLen\n );\n }\n}\n",
- "2.0.0/utils/Ownable/IOwnable.sol": "pragma solidity 0.4.24;\n\n\ncontract IOwnable {\n\n function transferOwnership(address newOwner)\n public;\n}\n",
- "2.0.0/utils/Ownable/Ownable.sol": "pragma solidity 0.4.24;\n\nimport \"./IOwnable.sol\";\n\n\ncontract Ownable is\n IOwnable\n{\n address public owner;\n\n constructor ()\n public\n {\n owner = msg.sender;\n }\n\n modifier onlyOwner() {\n require(\n msg.sender == owner,\n \"ONLY_CONTRACT_OWNER\"\n );\n _;\n }\n\n function transferOwnership(address newOwner)\n public\n onlyOwner\n {\n if (newOwner != address(0)) {\n owner = newOwner;\n }\n }\n}\n",
- "2.0.0/utils/ReentrancyGuard/ReentrancyGuard.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract ReentrancyGuard {\n\n // Locked state of mutex\n bool private locked = false;\n\n /// @dev Functions with this modifer cannot be reentered. The mutex will be locked\n /// before function execution and unlocked after.\n modifier nonReentrant() {\n // Ensure mutex is unlocked\n require(\n !locked,\n \"REENTRANCY_ILLEGAL\"\n );\n\n // Lock mutex before function call\n locked = true;\n\n // Perform function call\n _;\n\n // Unlock mutex after function call\n locked = false;\n }\n}\n",
- "2.0.0/utils/SafeMath/SafeMath.sol": "pragma solidity 0.4.24;\n\n\ncontract SafeMath {\n\n function safeMul(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n if (a == 0) {\n return 0;\n }\n uint256 c = a * b;\n require(\n c / a == b,\n \"UINT256_OVERFLOW\"\n );\n return c;\n }\n\n function safeDiv(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n uint256 c = a / b;\n return c;\n }\n\n function safeSub(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n require(\n b <= a,\n \"UINT256_UNDERFLOW\"\n );\n return a - b;\n }\n\n function safeAdd(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n uint256 c = a + b;\n require(\n c >= a,\n \"UINT256_OVERFLOW\"\n );\n return c;\n }\n\n function max64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n\n function max256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n}\n"
- },
- "sourceTreeHashHex": "0xee0dcd8415ba0737890f13994332b71d7fbed7c79041929a551c334c497db064",
- "compiler": {
- "name": "solc",
- "version": "soljson-v0.4.24+commit.e67f0147.js",
- "settings": {
- "optimizer": {
- "enabled": true,
- "runs": 1000000
- },
- "outputSelection": {
- "*": {
- "*": [
- "abi",
- "evm.bytecode.object",
- "evm.bytecode.sourceMap",
- "evm.deployedBytecode.object",
- "evm.deployedBytecode.sourceMap"
- ]
- }
- }
- }
- },
- "networks": {}
-} \ No newline at end of file
diff --git a/packages/migrations/artifacts/2.0.0-testnet/ERC721Proxy.json b/packages/migrations/artifacts/2.0.0-testnet/ERC721Proxy.json
deleted file mode 100644
index fa4a7cae9..000000000
--- a/packages/migrations/artifacts/2.0.0-testnet/ERC721Proxy.json
+++ /dev/null
@@ -1,508 +0,0 @@
-{
- "schemaVersion": "2.0.0",
- "contractName": "ERC721Proxy",
- "compilerOutput": {
- "abi": [
- {
- "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": 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": 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"
- }
- ],
- "evm": {
- "bytecode": {
- "linkReferences": {},
- "object": "0x608060405260008054600160a060020a03191633179055610fbe806100256000396000f3006080604052600436106100985763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166342f1181e81146102bc578063494503d4146102ec578063707129391461032d5780638da5cb5b1461035b5780639ad2674414610370578063ae25532e146103a1578063b9181611146103eb578063d39de6e91461042d578063f2fde38b14610492575b3480156100a457600080fd5b507fffffffff00000000000000000000000000000000000000000000000000000000600035167fa85e59e4000000000000000000000000000000000000000000000000000000008114156102b757604080513381526001602082015290812054151561017b577f08c379a0000000000000000000000000000000000000000000000000000000006000527c20000000000000000000000000000000000000000000000000000000006020527c1553454e4445525f4e4f545f415554484f52495a454400000000000000604052600060605260646000fd5b600160643503156101f7577f08c379a0000000000000000000000000000000000000000000000000000000006000527c20000000000000000000000000000000000000000000000000000000006020527c0e494e56414c49445f414d4f554e540000000000000000000000000000604052600060605260646000fd5b7f23b872dd000000000000000000000000000000000000000000000000000000006000526040602460043760043560206048820160443760288101356000806064600080855af1801561024657005b7f08c379a0000000000000000000000000000000000000000000000000000000006000527c20000000000000000000000000000000000000000000000000000000006020527c0f5452414e534645525f4641494c454400000000000000000000000000604052600060605260646000fd5b600080fd5b3480156102c857600080fd5b506102ea73ffffffffffffffffffffffffffffffffffffffff600435166104c0565b005b3480156102f857600080fd5b506103046004356106ac565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b34801561033957600080fd5b506102ea73ffffffffffffffffffffffffffffffffffffffff600435166106e1565b34801561036757600080fd5b506103046109da565b34801561037c57600080fd5b506102ea73ffffffffffffffffffffffffffffffffffffffff600435166024356109f6565b3480156103ad57600080fd5b506103b6610dab565b604080517fffffffff000000000000000000000000000000000000000000000000000000009092168252519081900360200190f35b3480156103f757600080fd5b5061041973ffffffffffffffffffffffffffffffffffffffff60043516610de1565b604080519115158252519081900360200190f35b34801561043957600080fd5b50610442610df6565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561047e578181015183820152602001610466565b505050509050019250505060405180910390f35b34801561049e57600080fd5b506102ea73ffffffffffffffffffffffffffffffffffffffff60043516610e65565b60005473ffffffffffffffffffffffffffffffffffffffff16331461054657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff811660009081526001602052604090205460ff16156105db57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f5441524745545f414c52454144595f415554484f52495a454400000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8116600081815260016020819052604080832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168317905560028054928301815583527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace90910180547fffffffffffffffffffffffff00000000000000000000000000000000000000001684179055513392917f3147867c59d17e8fa9d522465651d44aae0a9e38f902f3475b97e58072f0ed4c91a350565b60028054829081106106ba57fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b6000805473ffffffffffffffffffffffffffffffffffffffff16331461076857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff821660009081526001602052604090205460ff1615156107fe57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f5441524745545f4e4f545f415554484f52495a45440000000000000000000000604482015290519081900360640190fd5b5073ffffffffffffffffffffffffffffffffffffffff8116600090815260016020526040812080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690555b600254811015610993578173ffffffffffffffffffffffffffffffffffffffff1660028281548110151561087b57fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16141561098b57600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81019081106108d357fe5b6000918252602090912001546002805473ffffffffffffffffffffffffffffffffffffffff909216918390811061090657fe5b600091825260209091200180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01906109859082610f4b565b50610993565b60010161084b565b604051339073ffffffffffffffffffffffffffffffffffffffff8416907f1f32c1b084e2de0713b8fb16bd46bb9df710a3dbeae2f3ca93af46e016dcc6b090600090a35050565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b60005473ffffffffffffffffffffffffffffffffffffffff163314610a7c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff821660009081526001602052604090205460ff161515610b1257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f5441524745545f4e4f545f415554484f52495a45440000000000000000000000604482015290519081900360640190fd5b6002548110610b8257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f494e4445585f4f55545f4f465f424f554e445300000000000000000000000000604482015290519081900360640190fd5b8173ffffffffffffffffffffffffffffffffffffffff16600282815481101515610ba857fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff1614610c3657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f415554484f52495a45445f414444524553535f4d49534d415443480000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8216600090815260016020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8101908110610cb157fe5b6000918252602090912001546002805473ffffffffffffffffffffffffffffffffffffffff9092169183908110610ce457fe5b600091825260209091200180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190610d639082610f4b565b50604051339073ffffffffffffffffffffffffffffffffffffffff8416907f1f32c1b084e2de0713b8fb16bd46bb9df710a3dbeae2f3ca93af46e016dcc6b090600090a35050565b604080517f455243373231546f6b656e28616464726573732c75696e7432353629000000008152905190819003601c0190205b90565b60016020526000908152604090205460ff1681565b60606002805480602002602001604051908101604052809291908181526020018280548015610e5b57602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610e30575b5050505050905090565b60005473ffffffffffffffffffffffffffffffffffffffff163314610eeb57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff811615610f4857600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83161790555b50565b815481835581811115610f6f57600083815260209020610f6f918101908301610f74565b505050565b610dde91905b80821115610f8e5760008155600101610f7a565b50905600a165627a7a7230582051377ae1ca7b3f3d032510ea8cba18dc3e6ce467f660ab6b18edebeb780449c60029",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 SLOAD PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB NOT AND CALLER OR SWAP1 SSTORE PUSH2 0xFBE DUP1 PUSH2 0x25 PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN STOP PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x98 JUMPI PUSH4 0xFFFFFFFF PUSH29 0x100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD DIV AND PUSH4 0x42F1181E DUP2 EQ PUSH2 0x2BC JUMPI DUP1 PUSH4 0x494503D4 EQ PUSH2 0x2EC JUMPI DUP1 PUSH4 0x70712939 EQ PUSH2 0x32D JUMPI DUP1 PUSH4 0x8DA5CB5B EQ PUSH2 0x35B JUMPI DUP1 PUSH4 0x9AD26744 EQ PUSH2 0x370 JUMPI DUP1 PUSH4 0xAE25532E EQ PUSH2 0x3A1 JUMPI DUP1 PUSH4 0xB9181611 EQ PUSH2 0x3EB JUMPI DUP1 PUSH4 0xD39DE6E9 EQ PUSH2 0x42D JUMPI DUP1 PUSH4 0xF2FDE38B EQ PUSH2 0x492 JUMPI JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xA4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD AND PUSH32 0xA85E59E400000000000000000000000000000000000000000000000000000000 DUP2 EQ ISZERO PUSH2 0x2B7 JUMPI PUSH1 0x40 DUP1 MLOAD CALLER DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 DUP3 ADD MSTORE SWAP1 DUP2 KECCAK256 SLOAD ISZERO ISZERO PUSH2 0x17B JUMPI PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH29 0x2000000000000000000000000000000000000000000000000000000000 PUSH1 0x20 MSTORE PUSH29 0x1553454E4445525F4E4F545F415554484F52495A454400000000000000 PUSH1 0x40 MSTORE PUSH1 0x0 PUSH1 0x60 MSTORE PUSH1 0x64 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x1 PUSH1 0x64 CALLDATALOAD SUB ISZERO PUSH2 0x1F7 JUMPI PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH29 0x2000000000000000000000000000000000000000000000000000000000 PUSH1 0x20 MSTORE PUSH29 0xE494E56414C49445F414D4F554E540000000000000000000000000000 PUSH1 0x40 MSTORE PUSH1 0x0 PUSH1 0x60 MSTORE PUSH1 0x64 PUSH1 0x0 REVERT JUMPDEST PUSH32 0x23B872DD00000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x24 PUSH1 0x4 CALLDATACOPY PUSH1 0x4 CALLDATALOAD PUSH1 0x20 PUSH1 0x48 DUP3 ADD PUSH1 0x44 CALLDATACOPY PUSH1 0x28 DUP2 ADD CALLDATALOAD PUSH1 0x0 DUP1 PUSH1 0x64 PUSH1 0x0 DUP1 DUP6 GAS CALL DUP1 ISZERO PUSH2 0x246 JUMPI STOP JUMPDEST PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH29 0x2000000000000000000000000000000000000000000000000000000000 PUSH1 0x20 MSTORE PUSH29 0xF5452414E534645525F4641494C454400000000000000000000000000 PUSH1 0x40 MSTORE PUSH1 0x0 PUSH1 0x60 MSTORE PUSH1 0x64 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2C8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2EA PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x4C0 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2F8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x304 PUSH1 0x4 CALLDATALOAD PUSH2 0x6AC JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x339 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2EA PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x6E1 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x367 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x304 PUSH2 0x9DA JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x37C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2EA PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x9F6 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3AD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x3B6 PUSH2 0xDAB JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 SWAP1 SWAP3 AND DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3F7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x419 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0xDE1 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 ISZERO ISZERO DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x439 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x442 PUSH2 0xDF6 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 DUP1 DUP3 MSTORE DUP4 MLOAD DUP2 DUP4 ADD MSTORE DUP4 MLOAD SWAP2 SWAP3 DUP4 SWAP3 SWAP1 DUP4 ADD SWAP2 DUP6 DUP2 ADD SWAP2 MUL DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x47E JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH2 0x466 JUMP JUMPDEST POP POP POP POP SWAP1 POP ADD SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x49E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2EA PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0xE65 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0x546 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x5DB JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x19 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x5441524745545F414C52454144595F415554484F52495A454400000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND DUP4 OR SWAP1 SSTORE PUSH1 0x2 DUP1 SLOAD SWAP3 DUP4 ADD DUP2 SSTORE DUP4 MSTORE PUSH32 0x405787FA12A823E0F2B7631CC41B3BA8828B3321CA811111FA75CD3AA3BB5ACE SWAP1 SWAP2 ADD DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND DUP5 OR SWAP1 SSTORE MLOAD CALLER SWAP3 SWAP2 PUSH32 0x3147867C59D17E8FA9D522465651D44AAE0A9E38F902F3475B97E58072F0ED4C SWAP2 LOG3 POP JUMP JUMPDEST PUSH1 0x2 DUP1 SLOAD DUP3 SWAP1 DUP2 LT PUSH2 0x6BA JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 POP DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0x768 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND ISZERO ISZERO PUSH2 0x7FE JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x15 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x5441524745545F4E4F545F415554484F52495A45440000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 DUP2 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE JUMPDEST PUSH1 0x2 SLOAD DUP2 LT ISZERO PUSH2 0x993 JUMPI DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x2 DUP3 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x87B JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0x98B JUMPI PUSH1 0x2 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 ADD SWAP1 DUP2 LT PUSH2 0x8D3 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH1 0x2 DUP1 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND SWAP2 DUP4 SWAP1 DUP2 LT PUSH2 0x906 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP3 SWAP1 SWAP3 AND SWAP2 SWAP1 SWAP2 OR SWAP1 SSTORE PUSH1 0x2 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 PUSH2 0x985 SWAP1 DUP3 PUSH2 0xF4B JUMP JUMPDEST POP PUSH2 0x993 JUMP JUMPDEST PUSH1 0x1 ADD PUSH2 0x84B JUMP JUMPDEST PUSH1 0x40 MLOAD CALLER SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND SWAP1 PUSH32 0x1F32C1B084E2DE0713B8FB16BD46BB9DF710A3DBEAE2F3CA93AF46E016DCC6B0 SWAP1 PUSH1 0x0 SWAP1 LOG3 POP POP JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0xA7C JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND ISZERO ISZERO PUSH2 0xB12 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x15 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x5441524745545F4E4F545F415554484F52495A45440000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x2 SLOAD DUP2 LT PUSH2 0xB82 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x494E4445585F4F55545F4F465F424F554E445300000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x2 DUP3 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0xBA8 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0xC36 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x1B PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x415554484F52495A45445F414444524553535F4D49534D415443480000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE PUSH1 0x2 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 ADD SWAP1 DUP2 LT PUSH2 0xCB1 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH1 0x2 DUP1 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND SWAP2 DUP4 SWAP1 DUP2 LT PUSH2 0xCE4 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP3 SWAP1 SWAP3 AND SWAP2 SWAP1 SWAP2 OR SWAP1 SSTORE PUSH1 0x2 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 PUSH2 0xD63 SWAP1 DUP3 PUSH2 0xF4B JUMP JUMPDEST POP PUSH1 0x40 MLOAD CALLER SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND SWAP1 PUSH32 0x1F32C1B084E2DE0713B8FB16BD46BB9DF710A3DBEAE2F3CA93AF46E016DCC6B0 SWAP1 PUSH1 0x0 SWAP1 LOG3 POP POP JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0x455243373231546F6B656E28616464726573732C75696E743235362900000000 DUP2 MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x1C ADD SWAP1 KECCAK256 JUMPDEST SWAP1 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x2 DUP1 SLOAD DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD DUP1 ISZERO PUSH2 0xE5B JUMPI PUSH1 0x20 MUL DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x1 SWAP1 SWAP2 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0xE30 JUMPI JUMPDEST POP POP POP POP POP SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0xEEB JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND ISZERO PUSH2 0xF48 JUMPI PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND OR SWAP1 SSTORE JUMPDEST POP JUMP JUMPDEST DUP2 SLOAD DUP2 DUP4 SSTORE DUP2 DUP2 GT ISZERO PUSH2 0xF6F JUMPI PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x20 SWAP1 KECCAK256 PUSH2 0xF6F SWAP2 DUP2 ADD SWAP1 DUP4 ADD PUSH2 0xF74 JUMP JUMPDEST POP POP POP JUMP JUMPDEST PUSH2 0xDDE SWAP2 SWAP1 JUMPDEST DUP1 DUP3 GT ISZERO PUSH2 0xF8E JUMPI PUSH1 0x0 DUP2 SSTORE PUSH1 0x1 ADD PUSH2 0xF7A JUMP JUMPDEST POP SWAP1 JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 MLOAD CALLDATACOPY PUSH27 0xE1CA7B3F3D032510EA8CBA18DC3E6CE467F660AB6B18EDEBEB7804 0x49 0xc6 STOP 0x29 ",
- "sourceMap": "641:7861:15:-;;;162:5:63;:18;;-1:-1:-1;;;;;;162:18:63;170:10;162:18;;;641:7861:15;;;;;;"
- },
- "deployedBytecode": {
- "linkReferences": {},
- "object": "0x6080604052600436106100985763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166342f1181e81146102bc578063494503d4146102ec578063707129391461032d5780638da5cb5b1461035b5780639ad2674414610370578063ae25532e146103a1578063b9181611146103eb578063d39de6e91461042d578063f2fde38b14610492575b3480156100a457600080fd5b507fffffffff00000000000000000000000000000000000000000000000000000000600035167fa85e59e4000000000000000000000000000000000000000000000000000000008114156102b757604080513381526001602082015290812054151561017b577f08c379a0000000000000000000000000000000000000000000000000000000006000527c20000000000000000000000000000000000000000000000000000000006020527c1553454e4445525f4e4f545f415554484f52495a454400000000000000604052600060605260646000fd5b600160643503156101f7577f08c379a0000000000000000000000000000000000000000000000000000000006000527c20000000000000000000000000000000000000000000000000000000006020527c0e494e56414c49445f414d4f554e540000000000000000000000000000604052600060605260646000fd5b7f23b872dd000000000000000000000000000000000000000000000000000000006000526040602460043760043560206048820160443760288101356000806064600080855af1801561024657005b7f08c379a0000000000000000000000000000000000000000000000000000000006000527c20000000000000000000000000000000000000000000000000000000006020527c0f5452414e534645525f4641494c454400000000000000000000000000604052600060605260646000fd5b600080fd5b3480156102c857600080fd5b506102ea73ffffffffffffffffffffffffffffffffffffffff600435166104c0565b005b3480156102f857600080fd5b506103046004356106ac565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b34801561033957600080fd5b506102ea73ffffffffffffffffffffffffffffffffffffffff600435166106e1565b34801561036757600080fd5b506103046109da565b34801561037c57600080fd5b506102ea73ffffffffffffffffffffffffffffffffffffffff600435166024356109f6565b3480156103ad57600080fd5b506103b6610dab565b604080517fffffffff000000000000000000000000000000000000000000000000000000009092168252519081900360200190f35b3480156103f757600080fd5b5061041973ffffffffffffffffffffffffffffffffffffffff60043516610de1565b604080519115158252519081900360200190f35b34801561043957600080fd5b50610442610df6565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561047e578181015183820152602001610466565b505050509050019250505060405180910390f35b34801561049e57600080fd5b506102ea73ffffffffffffffffffffffffffffffffffffffff60043516610e65565b60005473ffffffffffffffffffffffffffffffffffffffff16331461054657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff811660009081526001602052604090205460ff16156105db57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f5441524745545f414c52454144595f415554484f52495a454400000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8116600081815260016020819052604080832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168317905560028054928301815583527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace90910180547fffffffffffffffffffffffff00000000000000000000000000000000000000001684179055513392917f3147867c59d17e8fa9d522465651d44aae0a9e38f902f3475b97e58072f0ed4c91a350565b60028054829081106106ba57fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b6000805473ffffffffffffffffffffffffffffffffffffffff16331461076857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff821660009081526001602052604090205460ff1615156107fe57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f5441524745545f4e4f545f415554484f52495a45440000000000000000000000604482015290519081900360640190fd5b5073ffffffffffffffffffffffffffffffffffffffff8116600090815260016020526040812080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690555b600254811015610993578173ffffffffffffffffffffffffffffffffffffffff1660028281548110151561087b57fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16141561098b57600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81019081106108d357fe5b6000918252602090912001546002805473ffffffffffffffffffffffffffffffffffffffff909216918390811061090657fe5b600091825260209091200180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01906109859082610f4b565b50610993565b60010161084b565b604051339073ffffffffffffffffffffffffffffffffffffffff8416907f1f32c1b084e2de0713b8fb16bd46bb9df710a3dbeae2f3ca93af46e016dcc6b090600090a35050565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b60005473ffffffffffffffffffffffffffffffffffffffff163314610a7c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff821660009081526001602052604090205460ff161515610b1257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f5441524745545f4e4f545f415554484f52495a45440000000000000000000000604482015290519081900360640190fd5b6002548110610b8257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f494e4445585f4f55545f4f465f424f554e445300000000000000000000000000604482015290519081900360640190fd5b8173ffffffffffffffffffffffffffffffffffffffff16600282815481101515610ba857fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff1614610c3657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f415554484f52495a45445f414444524553535f4d49534d415443480000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8216600090815260016020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8101908110610cb157fe5b6000918252602090912001546002805473ffffffffffffffffffffffffffffffffffffffff9092169183908110610ce457fe5b600091825260209091200180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190610d639082610f4b565b50604051339073ffffffffffffffffffffffffffffffffffffffff8416907f1f32c1b084e2de0713b8fb16bd46bb9df710a3dbeae2f3ca93af46e016dcc6b090600090a35050565b604080517f455243373231546f6b656e28616464726573732c75696e7432353629000000008152905190819003601c0190205b90565b60016020526000908152604090205460ff1681565b60606002805480602002602001604051908101604052809291908181526020018280548015610e5b57602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610e30575b5050505050905090565b60005473ffffffffffffffffffffffffffffffffffffffff163314610eeb57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff811615610f4857600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83161790555b50565b815481835581811115610f6f57600083815260209020610f6f918101908301610f74565b505050565b610dde91905b80821115610f8e5760008155600101610f7a565b50905600a165627a7a7230582051377ae1ca7b3f3d032510ea8cba18dc3e6ce467f660ab6b18edebeb780449c60029",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x98 JUMPI PUSH4 0xFFFFFFFF PUSH29 0x100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD DIV AND PUSH4 0x42F1181E DUP2 EQ PUSH2 0x2BC JUMPI DUP1 PUSH4 0x494503D4 EQ PUSH2 0x2EC JUMPI DUP1 PUSH4 0x70712939 EQ PUSH2 0x32D JUMPI DUP1 PUSH4 0x8DA5CB5B EQ PUSH2 0x35B JUMPI DUP1 PUSH4 0x9AD26744 EQ PUSH2 0x370 JUMPI DUP1 PUSH4 0xAE25532E EQ PUSH2 0x3A1 JUMPI DUP1 PUSH4 0xB9181611 EQ PUSH2 0x3EB JUMPI DUP1 PUSH4 0xD39DE6E9 EQ PUSH2 0x42D JUMPI DUP1 PUSH4 0xF2FDE38B EQ PUSH2 0x492 JUMPI JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xA4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD AND PUSH32 0xA85E59E400000000000000000000000000000000000000000000000000000000 DUP2 EQ ISZERO PUSH2 0x2B7 JUMPI PUSH1 0x40 DUP1 MLOAD CALLER DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 DUP3 ADD MSTORE SWAP1 DUP2 KECCAK256 SLOAD ISZERO ISZERO PUSH2 0x17B JUMPI PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH29 0x2000000000000000000000000000000000000000000000000000000000 PUSH1 0x20 MSTORE PUSH29 0x1553454E4445525F4E4F545F415554484F52495A454400000000000000 PUSH1 0x40 MSTORE PUSH1 0x0 PUSH1 0x60 MSTORE PUSH1 0x64 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x1 PUSH1 0x64 CALLDATALOAD SUB ISZERO PUSH2 0x1F7 JUMPI PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH29 0x2000000000000000000000000000000000000000000000000000000000 PUSH1 0x20 MSTORE PUSH29 0xE494E56414C49445F414D4F554E540000000000000000000000000000 PUSH1 0x40 MSTORE PUSH1 0x0 PUSH1 0x60 MSTORE PUSH1 0x64 PUSH1 0x0 REVERT JUMPDEST PUSH32 0x23B872DD00000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x24 PUSH1 0x4 CALLDATACOPY PUSH1 0x4 CALLDATALOAD PUSH1 0x20 PUSH1 0x48 DUP3 ADD PUSH1 0x44 CALLDATACOPY PUSH1 0x28 DUP2 ADD CALLDATALOAD PUSH1 0x0 DUP1 PUSH1 0x64 PUSH1 0x0 DUP1 DUP6 GAS CALL DUP1 ISZERO PUSH2 0x246 JUMPI STOP JUMPDEST PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH29 0x2000000000000000000000000000000000000000000000000000000000 PUSH1 0x20 MSTORE PUSH29 0xF5452414E534645525F4641494C454400000000000000000000000000 PUSH1 0x40 MSTORE PUSH1 0x0 PUSH1 0x60 MSTORE PUSH1 0x64 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2C8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2EA PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x4C0 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2F8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x304 PUSH1 0x4 CALLDATALOAD PUSH2 0x6AC JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x339 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2EA PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x6E1 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x367 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x304 PUSH2 0x9DA JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x37C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2EA PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x9F6 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3AD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x3B6 PUSH2 0xDAB JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 SWAP1 SWAP3 AND DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3F7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x419 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0xDE1 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 ISZERO ISZERO DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x439 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x442 PUSH2 0xDF6 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 DUP1 DUP3 MSTORE DUP4 MLOAD DUP2 DUP4 ADD MSTORE DUP4 MLOAD SWAP2 SWAP3 DUP4 SWAP3 SWAP1 DUP4 ADD SWAP2 DUP6 DUP2 ADD SWAP2 MUL DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x47E JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH2 0x466 JUMP JUMPDEST POP POP POP POP SWAP1 POP ADD SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x49E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2EA PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0xE65 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0x546 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x5DB JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x19 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x5441524745545F414C52454144595F415554484F52495A454400000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND DUP4 OR SWAP1 SSTORE PUSH1 0x2 DUP1 SLOAD SWAP3 DUP4 ADD DUP2 SSTORE DUP4 MSTORE PUSH32 0x405787FA12A823E0F2B7631CC41B3BA8828B3321CA811111FA75CD3AA3BB5ACE SWAP1 SWAP2 ADD DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND DUP5 OR SWAP1 SSTORE MLOAD CALLER SWAP3 SWAP2 PUSH32 0x3147867C59D17E8FA9D522465651D44AAE0A9E38F902F3475B97E58072F0ED4C SWAP2 LOG3 POP JUMP JUMPDEST PUSH1 0x2 DUP1 SLOAD DUP3 SWAP1 DUP2 LT PUSH2 0x6BA JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 POP DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0x768 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND ISZERO ISZERO PUSH2 0x7FE JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x15 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x5441524745545F4E4F545F415554484F52495A45440000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 DUP2 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE JUMPDEST PUSH1 0x2 SLOAD DUP2 LT ISZERO PUSH2 0x993 JUMPI DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x2 DUP3 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x87B JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0x98B JUMPI PUSH1 0x2 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 ADD SWAP1 DUP2 LT PUSH2 0x8D3 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH1 0x2 DUP1 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND SWAP2 DUP4 SWAP1 DUP2 LT PUSH2 0x906 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP3 SWAP1 SWAP3 AND SWAP2 SWAP1 SWAP2 OR SWAP1 SSTORE PUSH1 0x2 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 PUSH2 0x985 SWAP1 DUP3 PUSH2 0xF4B JUMP JUMPDEST POP PUSH2 0x993 JUMP JUMPDEST PUSH1 0x1 ADD PUSH2 0x84B JUMP JUMPDEST PUSH1 0x40 MLOAD CALLER SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND SWAP1 PUSH32 0x1F32C1B084E2DE0713B8FB16BD46BB9DF710A3DBEAE2F3CA93AF46E016DCC6B0 SWAP1 PUSH1 0x0 SWAP1 LOG3 POP POP JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0xA7C JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND ISZERO ISZERO PUSH2 0xB12 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x15 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x5441524745545F4E4F545F415554484F52495A45440000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x2 SLOAD DUP2 LT PUSH2 0xB82 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x494E4445585F4F55545F4F465F424F554E445300000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x2 DUP3 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0xBA8 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0xC36 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x1B PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x415554484F52495A45445F414444524553535F4D49534D415443480000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE PUSH1 0x2 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 ADD SWAP1 DUP2 LT PUSH2 0xCB1 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH1 0x2 DUP1 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND SWAP2 DUP4 SWAP1 DUP2 LT PUSH2 0xCE4 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP3 SWAP1 SWAP3 AND SWAP2 SWAP1 SWAP2 OR SWAP1 SSTORE PUSH1 0x2 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 PUSH2 0xD63 SWAP1 DUP3 PUSH2 0xF4B JUMP JUMPDEST POP PUSH1 0x40 MLOAD CALLER SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND SWAP1 PUSH32 0x1F32C1B084E2DE0713B8FB16BD46BB9DF710A3DBEAE2F3CA93AF46E016DCC6B0 SWAP1 PUSH1 0x0 SWAP1 LOG3 POP POP JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0x455243373231546F6B656E28616464726573732C75696E743235362900000000 DUP2 MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x1C ADD SWAP1 KECCAK256 JUMPDEST SWAP1 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x2 DUP1 SLOAD DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD DUP1 ISZERO PUSH2 0xE5B JUMPI PUSH1 0x20 MUL DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x1 SWAP1 SWAP2 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0xE30 JUMPI JUMPDEST POP POP POP POP POP SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0xEEB JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND ISZERO PUSH2 0xF48 JUMPI PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND OR SWAP1 SSTORE JUMPDEST POP JUMP JUMPDEST DUP2 SLOAD DUP2 DUP4 SSTORE DUP2 DUP2 GT ISZERO PUSH2 0xF6F JUMPI PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x20 SWAP1 KECCAK256 PUSH2 0xF6F SWAP2 DUP2 ADD SWAP1 DUP4 ADD PUSH2 0xF74 JUMP JUMPDEST POP POP POP JUMP JUMPDEST PUSH2 0xDDE SWAP2 SWAP1 JUMPDEST DUP1 DUP3 GT ISZERO PUSH2 0xF8E JUMPI PUSH1 0x0 DUP2 SSTORE PUSH1 0x1 ADD PUSH2 0xF7A JUMP JUMPDEST POP SWAP1 JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 MLOAD CALLDATACOPY PUSH27 0xE1CA7B3F3D032510EA8CBA18DC3E6CE467F660AB6B18EDEBEB7804 0x49 0xc6 STOP 0x29 ",
- "sourceMap": "641:7861:15:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;641:7861:15;1037:66;1033:1;1020:15;1016:88;1499:66;1489:8;1486:80;1483:2;;;1795;1789:9;;1833:6;1815:70;;1925:15;1920:2;1909:14;;1902:39;2036:20;;;2030:27;2023:35;2020:2;;;2159:66;2156:1;2149:77;2258:66;2254:2;2247:78;2357:66;2353:2;2346:78;2456:1;2452:2;2445:13;2489:3;2486:1;2479:14;2020:2;5829:1;5823:3;5810:17;5806:25;5803:2;;;5925:66;5922:1;5915:77;6024:66;6020:2;6013:78;6123:66;6119:2;6112:78;6222:1;6218:2;6211:13;6255:3;6252:1;6245:14;5803:2;6553:66;6550:1;6543:77;6848:2;6844;6841:1;6828:23;6988:1;6975:15;7050:2;7045;7028:15;7024:24;7020:2;7007:46;7195:2;7178:15;7174:24;7161:38;7620:1;7560;7505:3;7440:1;7382;7312:5;7257:3;7231:448;7699:7;7696:2;;;7729:12;7696:2;7861:66;7858:1;7851:77;7956:66;7952:2;7945:78;8051:66;8047:2;8040:78;8146:1;8142:2;8135:13;8175:3;8172:1;8165:14;1483:2;8271:1;8268;8261:12;1145:320:16;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1145:320:16;;;;;;;;;1030:28;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1030:28:16;;;;;;;;;;;;;;;;;;;;;;;;1579:547;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1579:547:16;;;;;;;91:20:63;;8:9:-1;5:2;;;30:1;27;20:12;5:2;91:20:63;;;;2299:643:16;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2299:643:16;;;;;;;;;8387:113:15;;8:9:-1;5:2;;;30:1;27;20:12;5:2;8387:113:15;;;;;;;;;;;;;;;;;;;;;;;981:43:16;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;981:43:16;;;;;;;;;;;;;;;;;;;;;;;;;3039:138;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3039:138:16;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:100:-1;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;3039:138:16;;;;;;;;;;;;;;;;;333:167:63;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;333:167:63;;;;;;;1145:320:16;259:5:63;;;;245:10;:19;224:85;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1262:18:16;;;;;;;:10;:18;;;;;;;;1261:19;1240:91;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1342:18;;;;;;;1363:4;1342:18;;;;;;;;:25;;;;;;;;1377:11;27:10:-1;;23:18;;;45:23;;1377:24:16;;;;;;;;;;;;;;1416:42;1447:10;;1342:18;1416:42;;;1145:320;:::o;1030:28::-;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1030:28:16;:::o;1579:547::-;1814:9;259:5:63;;;;245:10;:19;224:85;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1698:18:16;;;;;;;:10;:18;;;;;;;;1677:86;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1781:18:16;;;;;;;:10;:18;;;;;1774:25;;;;;;1809:252;1833:11;:18;1829:22;;1809:252;;;1894:6;1876:24;;:11;1888:1;1876:14;;;;;;;;;;;;;;;;;;;;;;:24;1872:179;;;1937:11;1949:18;;:22;;;;1937:35;;;;;;;;;;;;;;;;1920:11;:14;;1937:35;;;;;1932:1;;1920:14;;;;;;;;;;;;;;;:52;;;;;;;;;;;;;;;1990:11;:23;;;;;;;;;:::i;:::-;;2031:5;;1872:179;1853:3;;1809:252;;;2075:44;;2108:10;;2075:44;;;;;;;;;1579:547;;:::o;91:20:63:-;;;;;;:::o;2299:643:16:-;259:5:63;;;;245:10;:19;224:85;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2462:18:16;;;;;;;:10;:18;;;;;;;;2441:86;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2566:11;:18;2558:26;;2537:92;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2682:6;2660:28;;:11;2672:5;2660:18;;;;;;;;;;;;;;;;;;;;;;:28;2639:102;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2759:18;;;;;;;:10;:18;;;;;2752:25;;;;;;2808:11;2820:18;;:22;;;;2808:35;;;;;;;;;;;;;;;;2787:11;:18;;2808:35;;;;;2799:5;;2787:18;;;;;;;;;;;;;;;:56;;;;;;;;;;;;;;;2853:11;:23;;;;;;;;;:::i;:::-;-1:-1:-1;2891:44:16;;2924:10;;2891:44;;;;;;;;;2299:643;;:::o;8387:113:15:-;761:41;;;;;;;;;;;;;;;;8387:113;;:::o;981:43:16:-;;;;;;;;;;;;;;;:::o;3039:138::-;3120:9;3159:11;3152:18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3039:138;:::o;333:167:63:-;259:5;;;;245:10;:19;224:85;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;429:22;;;;425:69;;467:5;:16;;;;;;;;;;425:69;333:167;:::o;641:7861:15:-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;"
- }
- }
- },
- "sources": {
- "2.0.0/extensions/Forwarder/Forwarder.sol": {
- "id": 0
- },
- "2.0.0/extensions/Forwarder/MixinAssets.sol": {
- "id": 1
- },
- "2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol": {
- "id": 2
- },
- "2.0.0/extensions/Forwarder/MixinForwarderCore.sol": {
- "id": 3
- },
- "2.0.0/extensions/Forwarder/MixinWeth.sol": {
- "id": 4
- },
- "2.0.0/extensions/Forwarder/interfaces/IAssets.sol": {
- "id": 5
- },
- "2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol": {
- "id": 6
- },
- "2.0.0/extensions/Forwarder/libs/LibConstants.sol": {
- "id": 7
- },
- "2.0.0/extensions/Forwarder/mixins/MAssets.sol": {
- "id": 8
- },
- "2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol": {
- "id": 9
- },
- "2.0.0/extensions/Forwarder/mixins/MWeth.sol": {
- "id": 10
- },
- "2.0.0/extensions/OrderValidator/OrderValidator.sol": {
- "id": 11
- },
- "2.0.0/multisig/MultiSigWallet.sol": {
- "id": 12
- },
- "2.0.0/multisig/MultiSigWalletWithTimeLock.sol": {
- "id": 13
- },
- "2.0.0/protocol/AssetProxy/ERC20Proxy.sol": {
- "id": 14
- },
- "2.0.0/protocol/AssetProxy/ERC721Proxy.sol": {
- "id": 15
- },
- "2.0.0/protocol/AssetProxy/MixinAuthorizable.sol": {
- "id": 16
- },
- "2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol": {
- "id": 17
- },
- "2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol": {
- "id": 18
- },
- "2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol": {
- "id": 19
- },
- "2.0.0/protocol/AssetProxyOwner/AssetProxyOwner.sol": {
- "id": 20
- },
- "2.0.0/protocol/Exchange/Exchange.sol": {
- "id": 21
- },
- "2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol": {
- "id": 22
- },
- "2.0.0/protocol/Exchange/MixinExchangeCore.sol": {
- "id": 23
- },
- "2.0.0/protocol/Exchange/MixinMatchOrders.sol": {
- "id": 24
- },
- "2.0.0/protocol/Exchange/MixinSignatureValidator.sol": {
- "id": 25
- },
- "2.0.0/protocol/Exchange/MixinTransactions.sol": {
- "id": 26
- },
- "2.0.0/protocol/Exchange/MixinWrapperFunctions.sol": {
- "id": 27
- },
- "2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol": {
- "id": 28
- },
- "2.0.0/protocol/Exchange/interfaces/IExchange.sol": {
- "id": 29
- },
- "2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol": {
- "id": 30
- },
- "2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol": {
- "id": 31
- },
- "2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol": {
- "id": 32
- },
- "2.0.0/protocol/Exchange/interfaces/ITransactions.sol": {
- "id": 33
- },
- "2.0.0/protocol/Exchange/interfaces/IValidator.sol": {
- "id": 34
- },
- "2.0.0/protocol/Exchange/interfaces/IWallet.sol": {
- "id": 35
- },
- "2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol": {
- "id": 36
- },
- "2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol": {
- "id": 37
- },
- "2.0.0/protocol/Exchange/libs/LibConstants.sol": {
- "id": 38
- },
- "2.0.0/protocol/Exchange/libs/LibEIP712.sol": {
- "id": 39
- },
- "2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol": {
- "id": 40
- },
- "2.0.0/protocol/Exchange/libs/LibFillResults.sol": {
- "id": 41
- },
- "2.0.0/protocol/Exchange/libs/LibMath.sol": {
- "id": 42
- },
- "2.0.0/protocol/Exchange/libs/LibOrder.sol": {
- "id": 43
- },
- "2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol": {
- "id": 44
- },
- "2.0.0/protocol/Exchange/mixins/MExchangeCore.sol": {
- "id": 45
- },
- "2.0.0/protocol/Exchange/mixins/MMatchOrders.sol": {
- "id": 46
- },
- "2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol": {
- "id": 47
- },
- "2.0.0/protocol/Exchange/mixins/MTransactions.sol": {
- "id": 48
- },
- "2.0.0/protocol/Exchange/mixins/MWrapperFunctions.sol": {
- "id": 49
- },
- "2.0.0/test/DummyERC20Token/DummyERC20Token.sol": {
- "id": 50
- },
- "2.0.0/test/DummyERC721Token/DummyERC721Token.sol": {
- "id": 51
- },
- "2.0.0/tokens/ERC20Token/ERC20Token.sol": {
- "id": 52
- },
- "2.0.0/tokens/ERC20Token/IERC20Token.sol": {
- "id": 53
- },
- "2.0.0/tokens/ERC20Token/MintableERC20Token.sol": {
- "id": 54
- },
- "2.0.0/tokens/ERC20Token/UnlimitedAllowanceERC20Token.sol": {
- "id": 55
- },
- "2.0.0/tokens/ERC721Token/ERC721Token.sol": {
- "id": 56
- },
- "2.0.0/tokens/ERC721Token/IERC721Receiver.sol": {
- "id": 57
- },
- "2.0.0/tokens/ERC721Token/IERC721Token.sol": {
- "id": 58
- },
- "2.0.0/tokens/ERC721Token/MintableERC721Token.sol": {
- "id": 59
- },
- "2.0.0/tokens/EtherToken/IEtherToken.sol": {
- "id": 60
- },
- "2.0.0/utils/LibBytes/LibBytes.sol": {
- "id": 61
- },
- "2.0.0/utils/Ownable/IOwnable.sol": {
- "id": 62
- },
- "2.0.0/utils/Ownable/Ownable.sol": {
- "id": 63
- },
- "2.0.0/utils/ReentrancyGuard/ReentrancyGuard.sol": {
- "id": 64
- },
- "2.0.0/utils/SafeMath/SafeMath.sol": {
- "id": 65
- }
- },
- "sourceCodes": {
- "2.0.0/extensions/Forwarder/Forwarder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./MixinWeth.sol\";\nimport \"./MixinForwarderCore.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./MixinAssets.sol\";\nimport \"./MixinExchangeWrapper.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract Forwarder is\n LibConstants,\n MixinWeth,\n MixinAssets,\n MixinExchangeWrapper,\n MixinForwarderCore\n{\n constructor (\n address _exchange,\n bytes memory _zrxAssetData,\n bytes memory _wethAssetData\n )\n public\n LibConstants(\n _exchange,\n _zrxAssetData,\n _wethAssetData\n )\n MixinForwarderCore()\n {}\n}\n",
- "2.0.0/extensions/Forwarder/MixinAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"../../tokens/ERC20Token/IERC20Token.sol\";\nimport \"../../tokens/ERC721Token/IERC721Token.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MAssets.sol\";\n\n\ncontract MixinAssets is\n Ownable,\n LibConstants,\n MAssets\n{\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_TRANSFER_SELECTOR = bytes4(keccak256(\"transfer(address,uint256)\"));\n\n /// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to \n /// function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be\n /// used to withdraw assets that were accidentally sent to this contract.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of ERC20 token to withdraw.\n function withdrawAsset(\n bytes assetData,\n uint256 amount\n )\n external\n onlyOwner\n {\n transferAssetToSender(assetData, amount);\n }\n\n /// @dev Transfers given amount of asset to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferAssetToSender(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n bytes4 proxyId = assetData.readBytes4(0);\n\n if (proxyId == ERC20_DATA_ID) {\n transferERC20Token(assetData, amount);\n } else if (proxyId == ERC721_DATA_ID) {\n transferERC721Token(assetData, amount);\n } else {\n revert(\"UNSUPPORTED_ASSET_PROXY\");\n }\n }\n\n /// @dev Decodes ERC20 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC20Token(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n address token = assetData.readAddress(16);\n\n // Transfer tokens.\n // We do a raw call so we can check the success separate\n // from the return data.\n bool success = token.call(abi.encodeWithSelector(\n ERC20_TRANSFER_SELECTOR,\n msg.sender,\n amount\n ));\n require(\n success,\n \"TRANSFER_FAILED\"\n );\n \n // Check return data.\n // If there is no return data, we assume the token incorrectly\n // does not return a bool. In this case we expect it to revert\n // on failure, which was handled above.\n // If the token does return data, we require that it is a single\n // value that evaluates to true.\n assembly {\n if returndatasize {\n success := 0\n if eq(returndatasize, 32) {\n // First 64 bytes of memory are reserved scratch space\n returndatacopy(0, 0, 32)\n success := mload(0)\n }\n }\n }\n require(\n success,\n \"TRANSFER_FAILED\"\n );\n }\n\n /// @dev Decodes ERC721 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC721Token(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n require(\n amount == 1,\n \"INVALID_AMOUNT\"\n );\n // Decode asset data.\n address token = assetData.readAddress(16);\n uint256 tokenId = assetData.readUint256(36);\n\n // Perform transfer.\n IERC721Token(token).transferFrom(\n address(this),\n msg.sender,\n tokenId\n );\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MExchangeWrapper.sol\";\nimport \"../../protocol/Exchange/libs/LibAbiEncoder.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../protocol/Exchange/libs/LibFillResults.sol\";\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\n\n\ncontract MixinExchangeWrapper is\n LibAbiEncoder,\n LibFillResults,\n LibMath,\n LibConstants,\n MExchangeWrapper\n{\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n // ABI encode calldata for `fillOrder`\n bytes memory fillOrderCalldata = abiEncodeFillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n\n address exchange = address(EXCHANGE);\n\n // Call `fillOrder` and handle any exceptions gracefully\n assembly {\n let success := call(\n gas, // forward all gas\n exchange, // call address of Exchange contract\n 0, // transfer 0 wei\n add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes)\n mload(fillOrderCalldata), // length of input\n fillOrderCalldata, // write output over input\n 128 // output size is 128 bytes\n )\n if success {\n mstore(fillResults, mload(fillOrderCalldata))\n mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32)))\n mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64)))\n mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96)))\n }\n }\n // fillResults values will be 0 by default if call was unsuccessful\n return fillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of WETH has been sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param wethSellAmount Desired amount of WETH to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellWeth(\n LibOrder.Order[] memory orders,\n uint256 wethSellAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // We assume that asset being sold by taker is WETH for each order.\n orders[i].makerAssetData = makerAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of WETH to sell\n uint256 remainingTakerAssetFillAmount = safeSub(wethSellAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of WETH\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= wethSellAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// The asset being sold by taker must always be WETH.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyExactAmountWithWeth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // We assume that asset being sold by taker is WETH for each order.\n orders[i].makerAssetData = makerAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n uint256 makerAssetFilledAmount = totalFillResults.makerAssetFilledAmount;\n if (makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n\n require(\n makerAssetFilledAmount >= makerAssetFillAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return totalFillResults;\n }\n\n /// @dev Buys zrxBuyAmount of ZRX fee tokens, taking into account ZRX fees for each order. This will guarantee\n /// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues).\n /// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX\n /// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases.\n /// The asset being sold by taker must always be WETH. \n /// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset.\n /// @param zrxBuyAmount Desired amount of ZRX to buy.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return totalFillResults Amounts filled and fees paid by maker and taker.\n function marketBuyExactZrxWithWeth(\n LibOrder.Order[] memory orders,\n uint256 zrxBuyAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n // Do nothing if zrxBuyAmount == 0\n if (zrxBuyAmount == 0) {\n return totalFillResults;\n }\n\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n uint256 zrxPurchased = 0;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // All of these are ZRX/WETH, so we can drop the respective assetData from calldata.\n orders[i].makerAssetData = zrxAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of ZRX to buy.\n uint256 remainingZrxBuyAmount = safeSub(zrxBuyAmount, zrxPurchased);\n\n // Convert the remaining amount of ZRX to buy into remaining amount\n // of WETH to sell, assuming entire amount can be sold in the current order.\n uint256 remainingWethSellAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n safeSub(orders[i].makerAssetAmount, orders[i].takerFee), // our exchange rate after fees \n remainingZrxBuyAmount\n );\n\n // Attempt to sell the remaining amount of WETH.\n FillResults memory singleFillResult = fillOrderNoThrow(\n orders[i],\n safeAdd(remainingWethSellAmount, 1), // we add 1 wei to the fill amount to make up for rounding errors\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker.\n addFillResults(totalFillResults, singleFillResult);\n zrxPurchased = safeSub(totalFillResults.makerAssetFilledAmount, totalFillResults.takerFeePaid);\n\n // Stop execution if the entire amount of ZRX has been bought.\n if (zrxPurchased >= zrxBuyAmount) {\n break;\n }\n }\n\n require(\n zrxPurchased >= zrxBuyAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return totalFillResults;\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinForwarderCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MWeth.sol\";\nimport \"./mixins/MAssets.sol\";\nimport \"./mixins/MExchangeWrapper.sol\";\nimport \"./interfaces/IForwarderCore.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../protocol/Exchange/libs/LibFillResults.sol\";\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\n\n\ncontract MixinForwarderCore is\n LibFillResults,\n LibMath,\n LibConstants,\n MWeth,\n MAssets,\n MExchangeWrapper,\n IForwarderCore\n{\n using LibBytes for bytes;\n\n /// @dev Constructor approves ERC20 proxy to transfer ZRX and WETH on this contract's behalf.\n constructor ()\n public\n {\n address proxyAddress = EXCHANGE.getAssetProxy(ERC20_DATA_ID);\n require(\n proxyAddress != address(0),\n \"UNREGISTERED_ASSET_PROXY\"\n );\n ETHER_TOKEN.approve(proxyAddress, MAX_UINT);\n ZRX_TOKEN.approve(proxyAddress, MAX_UINT);\n }\n\n /// @dev Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketSellOrdersWithEth(\n LibOrder.Order[] memory orders,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n FillResults memory orderFillResults,\n FillResults memory feeOrderFillResults\n )\n {\n // Convert ETH to WETH.\n convertEthToWeth();\n\n uint256 wethSellAmount;\n uint256 zrxBuyAmount;\n uint256 makerAssetAmountPurchased;\n if (orders[0].makerAssetData.equals(ZRX_ASSET_DATA)) {\n // Calculate amount of WETH that won't be spent on ETH fees.\n wethSellAmount = getPartialAmountFloor(\n PERCENTAGE_DENOMINATOR,\n safeAdd(PERCENTAGE_DENOMINATOR, feePercentage),\n msg.value\n );\n // Market sell available WETH.\n // ZRX fees are paid with this contract's balance.\n orderFillResults = marketSellWeth(\n orders,\n wethSellAmount,\n signatures\n );\n // The fee amount must be deducted from the amount transfered back to sender.\n makerAssetAmountPurchased = safeSub(orderFillResults.makerAssetFilledAmount, orderFillResults.takerFeePaid);\n } else {\n // 5% of WETH is reserved for filling feeOrders and paying feeRecipient.\n wethSellAmount = getPartialAmountFloor(\n MAX_WETH_FILL_PERCENTAGE,\n PERCENTAGE_DENOMINATOR,\n msg.value\n );\n // Market sell 95% of WETH.\n // ZRX fees are payed with this contract's balance.\n orderFillResults = marketSellWeth(\n orders,\n wethSellAmount,\n signatures\n );\n // Buy back all ZRX spent on fees.\n zrxBuyAmount = orderFillResults.takerFeePaid;\n feeOrderFillResults = marketBuyExactZrxWithWeth(\n feeOrders,\n zrxBuyAmount,\n feeSignatures\n );\n makerAssetAmountPurchased = orderFillResults.makerAssetFilledAmount;\n }\n\n // Transfer feePercentage of total ETH spent on primary orders to feeRecipient.\n // Refund remaining ETH to msg.sender.\n transferEthFeeAndRefund(\n orderFillResults.takerAssetFilledAmount,\n feeOrderFillResults.takerAssetFilledAmount,\n feePercentage,\n feeRecipient\n );\n\n // Transfer purchased assets to msg.sender.\n transferAssetToSender(orders[0].makerAssetData, makerAssetAmountPurchased);\n }\n\n /// @dev Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param makerAssetFillAmount Desired amount of makerAsset to purchase.\n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketBuyOrdersWithEth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n FillResults memory orderFillResults,\n FillResults memory feeOrderFillResults\n )\n {\n // Convert ETH to WETH.\n convertEthToWeth();\n\n uint256 zrxBuyAmount;\n uint256 makerAssetAmountPurchased;\n if (orders[0].makerAssetData.equals(ZRX_ASSET_DATA)) {\n // If the makerAsset is ZRX, it is not necessary to pay fees out of this\n // contracts's ZRX balance because fees are factored into the price of the order.\n orderFillResults = marketBuyExactZrxWithWeth(\n orders,\n makerAssetFillAmount,\n signatures\n );\n // The fee amount must be deducted from the amount transfered back to sender.\n makerAssetAmountPurchased = safeSub(orderFillResults.makerAssetFilledAmount, orderFillResults.takerFeePaid);\n } else {\n // Attemp to purchase desired amount of makerAsset.\n // ZRX fees are payed with this contract's balance.\n orderFillResults = marketBuyExactAmountWithWeth(\n orders,\n makerAssetFillAmount,\n signatures\n );\n // Buy back all ZRX spent on fees.\n zrxBuyAmount = orderFillResults.takerFeePaid;\n feeOrderFillResults = marketBuyExactZrxWithWeth(\n feeOrders,\n zrxBuyAmount,\n feeSignatures\n );\n makerAssetAmountPurchased = orderFillResults.makerAssetFilledAmount;\n }\n\n // Transfer feePercentage of total ETH spent on primary orders to feeRecipient.\n // Refund remaining ETH to msg.sender.\n transferEthFeeAndRefund(\n orderFillResults.takerAssetFilledAmount,\n feeOrderFillResults.takerAssetFilledAmount,\n feePercentage,\n feeRecipient\n );\n\n // Transfer purchased assets to msg.sender.\n transferAssetToSender(orders[0].makerAssetData, makerAssetAmountPurchased);\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinWeth.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MWeth.sol\";\n\n\ncontract MixinWeth is\n LibMath,\n LibConstants,\n MWeth\n{\n /// @dev Default payabale function, this allows us to withdraw WETH\n function ()\n public\n payable\n {\n require(\n msg.sender == address(ETHER_TOKEN),\n \"DEFAULT_FUNCTION_WETH_CONTRACT_ONLY\"\n );\n }\n\n /// @dev Converts message call's ETH value into WETH.\n function convertEthToWeth()\n internal\n {\n require(\n msg.value > 0,\n \"INVALID_MSG_VALUE\"\n );\n ETHER_TOKEN.deposit.value(msg.value)();\n }\n\n /// @dev Transfers feePercentage of WETH spent on primary orders to feeRecipient.\n /// Refunds any excess ETH to msg.sender.\n /// @param wethSoldExcludingFeeOrders Amount of WETH sold when filling primary orders.\n /// @param wethSoldForZrx Amount of WETH sold when purchasing ZRX required for primary order fees.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n function transferEthFeeAndRefund(\n uint256 wethSoldExcludingFeeOrders,\n uint256 wethSoldForZrx,\n uint256 feePercentage,\n address feeRecipient\n )\n internal\n {\n // Ensure feePercentage is less than 5%.\n require(\n feePercentage <= MAX_FEE_PERCENTAGE,\n \"FEE_PERCENTAGE_TOO_LARGE\"\n );\n\n // Ensure that no extra WETH owned by this contract has been sold.\n uint256 wethSold = safeAdd(wethSoldExcludingFeeOrders, wethSoldForZrx);\n require(\n wethSold <= msg.value,\n \"OVERSOLD_WETH\"\n );\n\n // Calculate amount of WETH that hasn't been sold.\n uint256 wethRemaining = safeSub(msg.value, wethSold);\n\n // Calculate ETH fee to pay to feeRecipient.\n uint256 ethFee = getPartialAmountFloor(\n feePercentage,\n PERCENTAGE_DENOMINATOR,\n wethSoldExcludingFeeOrders\n );\n\n // Ensure fee is less than amount of WETH remaining.\n require(\n ethFee <= wethRemaining,\n \"INSUFFICIENT_ETH_REMAINING\"\n );\n \n // Do nothing if no WETH remaining\n if (wethRemaining > 0) {\n // Convert remaining WETH to ETH\n ETHER_TOKEN.withdraw(wethRemaining);\n\n // Pay ETH to feeRecipient\n if (ethFee > 0) {\n feeRecipient.transfer(ethFee);\n }\n\n // Refund remaining ETH to msg.sender.\n uint256 ethRefund = safeSub(wethRemaining, ethFee);\n if (ethRefund > 0) {\n msg.sender.transfer(ethRefund);\n }\n }\n }\n}\n",
- "2.0.0/extensions/Forwarder/interfaces/IAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IAssets {\n\n /// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to \n /// function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be\n /// used to withdraw assets that were accidentally sent to this contract.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of ERC20 token to withdraw.\n function withdrawAsset(\n bytes assetData,\n uint256 amount\n )\n external;\n}\n",
- "2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../../protocol/Exchange/libs/LibFillResults.sol\";\n\n\ncontract IForwarderCore {\n\n /// @dev Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketSellOrdersWithEth(\n LibOrder.Order[] memory orders,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n LibFillResults.FillResults memory orderFillResults,\n LibFillResults.FillResults memory feeOrderFillResults\n );\n\n /// @dev Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param makerAssetFillAmount Desired amount of makerAsset to purchase.\n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketBuyOrdersWithEth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n LibFillResults.FillResults memory orderFillResults,\n LibFillResults.FillResults memory feeOrderFillResults\n );\n}\n",
- "2.0.0/extensions/Forwarder/libs/LibConstants.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/LibBytes/LibBytes.sol\";\nimport \"../../../protocol/Exchange/interfaces/IExchange.sol\";\nimport \"../../../tokens/EtherToken/IEtherToken.sol\";\nimport \"../../../tokens/ERC20Token/IERC20Token.sol\";\n\n\ncontract LibConstants {\n\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n uint256 constant internal MAX_UINT = 2**256 - 1;\n uint256 constant internal PERCENTAGE_DENOMINATOR = 10**18; \n uint256 constant internal MAX_FEE_PERCENTAGE = 5 * PERCENTAGE_DENOMINATOR / 100; // 5%\n uint256 constant internal MAX_WETH_FILL_PERCENTAGE = 95 * PERCENTAGE_DENOMINATOR / 100; // 95%\n \n // solhint-disable var-name-mixedcase\n IExchange internal EXCHANGE;\n IEtherToken internal ETHER_TOKEN;\n IERC20Token internal ZRX_TOKEN;\n bytes internal ZRX_ASSET_DATA;\n bytes internal WETH_ASSET_DATA;\n // solhint-enable var-name-mixedcase\n\n constructor (\n address _exchange,\n bytes memory _zrxAssetData,\n bytes memory _wethAssetData\n )\n public\n {\n EXCHANGE = IExchange(_exchange);\n ZRX_ASSET_DATA = _zrxAssetData;\n WETH_ASSET_DATA = _wethAssetData;\n\n address etherToken = _wethAssetData.readAddress(16);\n address zrxToken = _zrxAssetData.readAddress(16);\n ETHER_TOKEN = IEtherToken(etherToken);\n ZRX_TOKEN = IERC20Token(zrxToken);\n }\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAssets.sol\";\n\n\ncontract MAssets is\n IAssets\n{\n /// @dev Transfers given amount of asset to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferAssetToSender(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n\n /// @dev Decodes ERC20 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC20Token(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n\n /// @dev Decodes ERC721 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC721Token(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../../protocol/Exchange/libs/LibFillResults.sol\";\n\n\ncontract MExchangeWrapper {\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of WETH has been sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param wethSellAmount Desired amount of WETH to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellWeth(\n LibOrder.Order[] memory orders,\n uint256 wethSellAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// The asset being sold by taker must always be WETH.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyExactAmountWithWeth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Buys zrxBuyAmount of ZRX fee tokens, taking into account ZRX fees for each order. This will guarantee\n /// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues).\n /// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX\n /// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases.\n /// The asset being sold by taker must always be WETH. \n /// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset.\n /// @param zrxBuyAmount Desired amount of ZRX to buy.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return totalFillResults Amounts filled and fees paid by maker and taker.\n function marketBuyExactZrxWithWeth(\n LibOrder.Order[] memory orders,\n uint256 zrxBuyAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MWeth.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract MWeth {\n\n /// @dev Converts message call's ETH value into WETH.\n function convertEthToWeth()\n internal;\n\n /// @dev Transfers feePercentage of WETH spent on primary orders to feeRecipient.\n /// Refunds any excess ETH to msg.sender.\n /// @param wethSoldExcludingFeeOrders Amount of WETH sold when filling primary orders.\n /// @param wethSoldForZrx Amount of WETH sold when purchasing ZRX required for primary order fees.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n function transferEthFeeAndRefund(\n uint256 wethSoldExcludingFeeOrders,\n uint256 wethSoldForZrx,\n uint256 feePercentage,\n address feeRecipient\n )\n internal;\n}\n",
- "2.0.0/extensions/OrderValidator/OrderValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../protocol/Exchange/interfaces/IExchange.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../tokens/ERC20Token/IERC20Token.sol\";\nimport \"../../tokens/ERC721Token/IERC721Token.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\n\n\ncontract OrderValidator {\n\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n\n struct TraderInfo {\n uint256 makerBalance; // Maker's balance of makerAsset\n uint256 makerAllowance; // Maker's allowance to corresponding AssetProxy\n uint256 takerBalance; // Taker's balance of takerAsset\n uint256 takerAllowance; // Taker's allowance to corresponding AssetProxy\n uint256 makerZrxBalance; // Maker's balance of ZRX\n uint256 makerZrxAllowance; // Maker's allowance of ZRX to ERC20Proxy\n uint256 takerZrxBalance; // Taker's balance of ZRX\n uint256 takerZrxAllowance; // Taker's allowance of ZRX to ERC20Proxy\n }\n\n // solhint-disable var-name-mixedcase\n IExchange internal EXCHANGE;\n bytes internal ZRX_ASSET_DATA;\n // solhint-enable var-name-mixedcase\n\n constructor (address _exchange, bytes memory _zrxAssetData)\n public\n {\n EXCHANGE = IExchange(_exchange);\n ZRX_ASSET_DATA = _zrxAssetData;\n }\n\n /// @dev Fetches information for order and maker/taker of order.\n /// @param order The order structure.\n /// @param takerAddress Address that will be filling the order.\n /// @return OrderInfo and TraderInfo instances for given order.\n function getOrderAndTraderInfo(LibOrder.Order memory order, address takerAddress)\n public\n view\n returns (LibOrder.OrderInfo memory orderInfo, TraderInfo memory traderInfo)\n {\n orderInfo = EXCHANGE.getOrderInfo(order);\n traderInfo = getTraderInfo(order, takerAddress);\n return (orderInfo, traderInfo);\n }\n\n /// @dev Fetches information for all passed in orders and the makers/takers of each order.\n /// @param orders Array of order specifications.\n /// @param takerAddresses Array of taker addresses corresponding to each order.\n /// @return Arrays of OrderInfo and TraderInfo instances that correspond to each order.\n function getOrdersAndTradersInfo(LibOrder.Order[] memory orders, address[] memory takerAddresses)\n public\n view\n returns (LibOrder.OrderInfo[] memory ordersInfo, TraderInfo[] memory tradersInfo)\n {\n ordersInfo = EXCHANGE.getOrdersInfo(orders);\n tradersInfo = getTradersInfo(orders, takerAddresses);\n return (ordersInfo, tradersInfo);\n }\n\n /// @dev Fetches balance and allowances for maker and taker of order.\n /// @param order The order structure.\n /// @param takerAddress Address that will be filling the order.\n /// @return Balances and allowances of maker and taker of order.\n function getTraderInfo(LibOrder.Order memory order, address takerAddress)\n public\n view\n returns (TraderInfo memory traderInfo)\n {\n (traderInfo.makerBalance, traderInfo.makerAllowance) = getBalanceAndAllowance(order.makerAddress, order.makerAssetData);\n (traderInfo.takerBalance, traderInfo.takerAllowance) = getBalanceAndAllowance(takerAddress, order.takerAssetData);\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n (traderInfo.makerZrxBalance, traderInfo.makerZrxAllowance) = getBalanceAndAllowance(order.makerAddress, zrxAssetData);\n (traderInfo.takerZrxBalance, traderInfo.takerZrxAllowance) = getBalanceAndAllowance(takerAddress, zrxAssetData);\n return traderInfo;\n }\n\n /// @dev Fetches balances and allowances of maker and taker for each provided order.\n /// @param orders Array of order specifications.\n /// @param takerAddresses Array of taker addresses corresponding to each order.\n /// @return Array of balances and allowances for maker and taker of each order.\n function getTradersInfo(LibOrder.Order[] memory orders, address[] memory takerAddresses)\n public\n view\n returns (TraderInfo[] memory)\n {\n uint256 ordersLength = orders.length;\n TraderInfo[] memory tradersInfo = new TraderInfo[](ordersLength);\n for (uint256 i = 0; i != ordersLength; i++) {\n tradersInfo[i] = getTraderInfo(orders[i], takerAddresses[i]);\n }\n return tradersInfo;\n }\n\n /// @dev Fetches token balances and allowances of an address to given assetProxy. Supports ERC20 and ERC721.\n /// @param target Address to fetch balances and allowances of.\n /// @param assetData Encoded data that can be decoded by a specified proxy contract when transferring asset.\n /// @return Balance of asset and allowance set to given proxy of asset.\n /// For ERC721 tokens, these values will always be 1 or 0.\n function getBalanceAndAllowance(address target, bytes memory assetData)\n public\n view\n returns (uint256 balance, uint256 allowance)\n {\n bytes4 assetProxyId = assetData.readBytes4(0);\n address token = assetData.readAddress(16);\n address assetProxy = EXCHANGE.getAssetProxy(assetProxyId);\n\n if (assetProxyId == ERC20_DATA_ID) {\n // Query balance\n balance = IERC20Token(token).balanceOf(target);\n\n // Query allowance\n allowance = IERC20Token(token).allowance(target, assetProxy);\n } else if (assetProxyId == ERC721_DATA_ID) {\n uint256 tokenId = assetData.readUint256(36);\n\n // Query owner of tokenId\n address owner = getERC721TokenOwner(token, tokenId);\n\n // Set balance to 1 if tokenId is owned by target\n balance = target == owner ? 1 : 0;\n\n // Check if ERC721Proxy is approved to spend tokenId\n bool isApproved = IERC721Token(token).isApprovedForAll(target, assetProxy) || IERC721Token(token).getApproved(tokenId) == assetProxy;\n \n // Set alowance to 1 if ERC721Proxy is approved to spend tokenId\n allowance = isApproved ? 1 : 0;\n } else {\n revert(\"UNSUPPORTED_ASSET_PROXY\");\n }\n return (balance, allowance);\n }\n\n /// @dev Fetches token balances and allowances of an address for each given assetProxy. Supports ERC20 and ERC721.\n /// @param target Address to fetch balances and allowances of.\n /// @param assetData Array of encoded byte arrays that can be decoded by a specified proxy contract when transferring asset.\n /// @return Balances and allowances of assets.\n /// For ERC721 tokens, these values will always be 1 or 0.\n function getBalancesAndAllowances(address target, bytes[] memory assetData)\n public\n view\n returns (uint256[] memory, uint256[] memory)\n {\n uint256 length = assetData.length;\n uint256[] memory balances = new uint256[](length);\n uint256[] memory allowances = new uint256[](length);\n for (uint256 i = 0; i != length; i++) {\n (balances[i], allowances[i]) = getBalanceAndAllowance(target, assetData[i]);\n }\n return (balances, allowances);\n }\n\n /// @dev Calls `token.ownerOf(tokenId)`, but returns a null owner instead of reverting on an unowned token.\n /// @param token Address of ERC721 token.\n /// @param tokenId The identifier for the specific NFT.\n /// @return Owner of tokenId or null address if unowned.\n function getERC721TokenOwner(address token, uint256 tokenId)\n public\n view\n returns (address owner)\n {\n assembly {\n // load free memory pointer\n let cdStart := mload(64)\n\n // bytes4(keccak256(ownerOf(uint256))) = 0x6352211e\n mstore(cdStart, 0x6352211e00000000000000000000000000000000000000000000000000000000)\n mstore(add(cdStart, 4), tokenId)\n\n // staticcall `ownerOf(tokenId)`\n // `ownerOf` will revert if tokenId is not owned\n let success := staticcall(\n gas, // forward all gas\n token, // call token contract\n cdStart, // start of calldata\n 36, // length of input is 36 bytes\n cdStart, // write output over input\n 32 // size of output is 32 bytes\n )\n\n // Success implies that tokenId is owned\n // Copy owner from return data if successful\n if success {\n owner := mload(cdStart)\n } \n }\n\n // Owner initialized to address(0), no need to modify if call is unsuccessful\n return owner;\n }\n}\n",
- "2.0.0/multisig/MultiSigWallet.sol": "// solhint-disable\npragma solidity ^0.4.15;\n\n\n/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.\n/// @author Stefan George - <stefan.george@consensys.net>\ncontract MultiSigWallet {\n\n /*\n * Events\n */\n event Confirmation(address indexed sender, uint indexed transactionId);\n event Revocation(address indexed sender, uint indexed transactionId);\n event Submission(uint indexed transactionId);\n event Execution(uint indexed transactionId);\n event ExecutionFailure(uint indexed transactionId);\n event Deposit(address indexed sender, uint value);\n event OwnerAddition(address indexed owner);\n event OwnerRemoval(address indexed owner);\n event RequirementChange(uint required);\n\n /*\n * Constants\n */\n uint constant public MAX_OWNER_COUNT = 50;\n\n /*\n * Storage\n */\n mapping (uint => Transaction) public transactions;\n mapping (uint => mapping (address => bool)) public confirmations;\n mapping (address => bool) public isOwner;\n address[] public owners;\n uint public required;\n uint public transactionCount;\n\n struct Transaction {\n address destination;\n uint value;\n bytes data;\n bool executed;\n }\n\n /*\n * Modifiers\n */\n modifier onlyWallet() {\n require(msg.sender == address(this));\n _;\n }\n\n modifier ownerDoesNotExist(address owner) {\n require(!isOwner[owner]);\n _;\n }\n\n modifier ownerExists(address owner) {\n require(isOwner[owner]);\n _;\n }\n\n modifier transactionExists(uint transactionId) {\n require(transactions[transactionId].destination != 0);\n _;\n }\n\n modifier confirmed(uint transactionId, address owner) {\n require(confirmations[transactionId][owner]);\n _;\n }\n\n modifier notConfirmed(uint transactionId, address owner) {\n require(!confirmations[transactionId][owner]);\n _;\n }\n\n modifier notExecuted(uint transactionId) {\n require(!transactions[transactionId].executed);\n _;\n }\n\n modifier notNull(address _address) {\n require(_address != 0);\n _;\n }\n\n modifier validRequirement(uint ownerCount, uint _required) {\n require(ownerCount <= MAX_OWNER_COUNT\n && _required <= ownerCount\n && _required != 0\n && ownerCount != 0);\n _;\n }\n\n /// @dev Fallback function allows to deposit ether.\n function()\n payable\n {\n if (msg.value > 0)\n Deposit(msg.sender, msg.value);\n }\n\n /*\n * Public functions\n */\n /// @dev Contract constructor sets initial owners and required number of confirmations.\n /// @param _owners List of initial owners.\n /// @param _required Number of required confirmations.\n function MultiSigWallet(address[] _owners, uint _required)\n public\n validRequirement(_owners.length, _required)\n {\n for (uint i=0; i<_owners.length; i++) {\n require(!isOwner[_owners[i]] && _owners[i] != 0);\n isOwner[_owners[i]] = true;\n }\n owners = _owners;\n required = _required;\n }\n\n /// @dev Allows to add a new owner. Transaction has to be sent by wallet.\n /// @param owner Address of new owner.\n function addOwner(address owner)\n public\n onlyWallet\n ownerDoesNotExist(owner)\n notNull(owner)\n validRequirement(owners.length + 1, required)\n {\n isOwner[owner] = true;\n owners.push(owner);\n OwnerAddition(owner);\n }\n\n /// @dev Allows to remove an owner. Transaction has to be sent by wallet.\n /// @param owner Address of owner.\n function removeOwner(address owner)\n public\n onlyWallet\n ownerExists(owner)\n {\n isOwner[owner] = false;\n for (uint i=0; i<owners.length - 1; i++)\n if (owners[i] == owner) {\n owners[i] = owners[owners.length - 1];\n break;\n }\n owners.length -= 1;\n if (required > owners.length)\n changeRequirement(owners.length);\n OwnerRemoval(owner);\n }\n\n /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet.\n /// @param owner Address of owner to be replaced.\n /// @param newOwner Address of new owner.\n function replaceOwner(address owner, address newOwner)\n public\n onlyWallet\n ownerExists(owner)\n ownerDoesNotExist(newOwner)\n {\n for (uint i=0; i<owners.length; i++)\n if (owners[i] == owner) {\n owners[i] = newOwner;\n break;\n }\n isOwner[owner] = false;\n isOwner[newOwner] = true;\n OwnerRemoval(owner);\n OwnerAddition(newOwner);\n }\n\n /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet.\n /// @param _required Number of required confirmations.\n function changeRequirement(uint _required)\n public\n onlyWallet\n validRequirement(owners.length, _required)\n {\n required = _required;\n RequirementChange(_required);\n }\n\n /// @dev Allows an owner to submit and confirm a transaction.\n /// @param destination Transaction target address.\n /// @param value Transaction ether value.\n /// @param data Transaction data payload.\n /// @return Returns transaction ID.\n function submitTransaction(address destination, uint value, bytes data)\n public\n returns (uint transactionId)\n {\n transactionId = addTransaction(destination, value, data);\n confirmTransaction(transactionId);\n }\n\n /// @dev Allows an owner to confirm a transaction.\n /// @param transactionId Transaction ID.\n function confirmTransaction(uint transactionId)\n public\n ownerExists(msg.sender)\n transactionExists(transactionId)\n notConfirmed(transactionId, msg.sender)\n {\n confirmations[transactionId][msg.sender] = true;\n Confirmation(msg.sender, transactionId);\n executeTransaction(transactionId);\n }\n\n /// @dev Allows an owner to revoke a confirmation for a transaction.\n /// @param transactionId Transaction ID.\n function revokeConfirmation(uint transactionId)\n public\n ownerExists(msg.sender)\n confirmed(transactionId, msg.sender)\n notExecuted(transactionId)\n {\n confirmations[transactionId][msg.sender] = false;\n Revocation(msg.sender, transactionId);\n }\n\n /// @dev Allows anyone to execute a confirmed transaction.\n /// @param transactionId Transaction ID.\n function executeTransaction(uint transactionId)\n public\n ownerExists(msg.sender)\n confirmed(transactionId, msg.sender)\n notExecuted(transactionId)\n {\n if (isConfirmed(transactionId)) {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data))\n Execution(transactionId);\n else {\n ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n }\n\n // call has been separated into its own function in order to take advantage\n // of the Solidity's code generator to produce a loop that copies tx.data into memory.\n function external_call(address destination, uint value, uint dataLength, bytes data) internal returns (bool) {\n bool result;\n assembly {\n let x := mload(0x40) // \"Allocate\" memory for output (0x40 is where \"free memory\" pointer is stored by convention)\n let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that\n result := call(\n sub(gas, 34710), // 34710 is the value that solidity is currently emitting\n // It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) +\n // callNewAccountGas (25000, in case the destination address does not exist and needs creating)\n destination,\n value,\n d,\n dataLength, // Size of the input (in bytes) - this is what fixes the padding problem\n x,\n 0 // Output is ignored, therefore the output size is zero\n )\n }\n return result;\n }\n\n /// @dev Returns the confirmation status of a transaction.\n /// @param transactionId Transaction ID.\n /// @return Confirmation status.\n function isConfirmed(uint transactionId)\n public\n constant\n returns (bool)\n {\n uint count = 0;\n for (uint i=0; i<owners.length; i++) {\n if (confirmations[transactionId][owners[i]])\n count += 1;\n if (count == required)\n return true;\n }\n }\n\n /*\n * Internal functions\n */\n /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet.\n /// @param destination Transaction target address.\n /// @param value Transaction ether value.\n /// @param data Transaction data payload.\n /// @return Returns transaction ID.\n function addTransaction(address destination, uint value, bytes data)\n internal\n notNull(destination)\n returns (uint transactionId)\n {\n transactionId = transactionCount;\n transactions[transactionId] = Transaction({\n destination: destination,\n value: value,\n data: data,\n executed: false\n });\n transactionCount += 1;\n Submission(transactionId);\n }\n\n /*\n * Web3 call functions\n */\n /// @dev Returns number of confirmations of a transaction.\n /// @param transactionId Transaction ID.\n /// @return Number of confirmations.\n function getConfirmationCount(uint transactionId)\n public\n constant\n returns (uint count)\n {\n for (uint i=0; i<owners.length; i++)\n if (confirmations[transactionId][owners[i]])\n count += 1;\n }\n\n /// @dev Returns total number of transactions after filers are applied.\n /// @param pending Include pending transactions.\n /// @param executed Include executed transactions.\n /// @return Total number of transactions after filters are applied.\n function getTransactionCount(bool pending, bool executed)\n public\n constant\n returns (uint count)\n {\n for (uint i=0; i<transactionCount; i++)\n if ( pending && !transactions[i].executed\n || executed && transactions[i].executed)\n count += 1;\n }\n\n /// @dev Returns list of owners.\n /// @return List of owner addresses.\n function getOwners()\n public\n constant\n returns (address[])\n {\n return owners;\n }\n\n /// @dev Returns array with owner addresses, which confirmed transaction.\n /// @param transactionId Transaction ID.\n /// @return Returns array of owner addresses.\n function getConfirmations(uint transactionId)\n public\n constant\n returns (address[] _confirmations)\n {\n address[] memory confirmationsTemp = new address[](owners.length);\n uint count = 0;\n uint i;\n for (i=0; i<owners.length; i++)\n if (confirmations[transactionId][owners[i]]) {\n confirmationsTemp[count] = owners[i];\n count += 1;\n }\n _confirmations = new address[](count);\n for (i=0; i<count; i++)\n _confirmations[i] = confirmationsTemp[i];\n }\n\n /// @dev Returns list of transaction IDs in defined range.\n /// @param from Index start position of transaction array.\n /// @param to Index end position of transaction array.\n /// @param pending Include pending transactions.\n /// @param executed Include executed transactions.\n /// @return Returns array of transaction IDs.\n function getTransactionIds(uint from, uint to, bool pending, bool executed)\n public\n constant\n returns (uint[] _transactionIds)\n {\n uint[] memory transactionIdsTemp = new uint[](transactionCount);\n uint count = 0;\n uint i;\n for (i=0; i<transactionCount; i++)\n if ( pending && !transactions[i].executed\n || executed && transactions[i].executed)\n {\n transactionIdsTemp[count] = i;\n count += 1;\n }\n _transactionIds = new uint[](to - from);\n for (i=from; i<to; i++)\n _transactionIds[i - from] = transactionIdsTemp[i];\n }\n}",
- "2.0.0/multisig/MultiSigWalletWithTimeLock.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MultiSigWallet.sol\";\n\n\n/// @title Multisignature wallet with time lock- Allows multiple parties to execute a transaction after a time lock has passed.\n/// @author Amir Bandeali - <amir@0xProject.com>\n// solhint-disable not-rely-on-time\ncontract MultiSigWalletWithTimeLock is\n MultiSigWallet\n{\n event ConfirmationTimeSet(uint256 indexed transactionId, uint256 confirmationTime);\n event TimeLockChange(uint256 secondsTimeLocked);\n\n uint256 public secondsTimeLocked;\n\n mapping (uint256 => uint256) public confirmationTimes;\n\n modifier notFullyConfirmed(uint256 transactionId) {\n require(\n !isConfirmed(transactionId),\n \"TX_FULLY_CONFIRMED\"\n );\n _;\n }\n\n modifier fullyConfirmed(uint256 transactionId) {\n require(\n isConfirmed(transactionId),\n \"TX_NOT_FULLY_CONFIRMED\"\n );\n _;\n }\n\n modifier pastTimeLock(uint256 transactionId) {\n require(\n block.timestamp >= confirmationTimes[transactionId] + secondsTimeLocked,\n \"TIME_LOCK_INCOMPLETE\"\n );\n _;\n }\n\n /// @dev Contract constructor sets initial owners, required number of confirmations, and time lock.\n /// @param _owners List of initial owners.\n /// @param _required Number of required confirmations.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n constructor (\n address[] _owners,\n uint256 _required,\n uint256 _secondsTimeLocked\n )\n public\n MultiSigWallet(_owners, _required)\n {\n secondsTimeLocked = _secondsTimeLocked;\n }\n\n /// @dev Changes the duration of the time lock for transactions.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n function changeTimeLock(uint256 _secondsTimeLocked)\n public\n onlyWallet\n {\n secondsTimeLocked = _secondsTimeLocked;\n emit TimeLockChange(_secondsTimeLocked);\n }\n\n /// @dev Allows an owner to confirm a transaction.\n /// @param transactionId Transaction ID.\n function confirmTransaction(uint256 transactionId)\n public\n ownerExists(msg.sender)\n transactionExists(transactionId)\n notConfirmed(transactionId, msg.sender)\n notFullyConfirmed(transactionId)\n {\n confirmations[transactionId][msg.sender] = true;\n emit Confirmation(msg.sender, transactionId);\n if (isConfirmed(transactionId)) {\n setConfirmationTime(transactionId, block.timestamp);\n }\n }\n\n /// @dev Allows anyone to execute a confirmed transaction.\n /// @param transactionId Transaction ID.\n function executeTransaction(uint256 transactionId)\n public\n notExecuted(transactionId)\n fullyConfirmed(transactionId)\n pastTimeLock(transactionId)\n {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) {\n emit Execution(transactionId);\n } else {\n emit ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n\n /// @dev Sets the time of when a submission first passed.\n function setConfirmationTime(uint256 transactionId, uint256 confirmationTime)\n internal\n {\n confirmationTimes[transactionId] = confirmationTime;\n emit ConfirmationTimeSet(transactionId, confirmationTime);\n }\n}\n",
- "2.0.0/protocol/AssetProxy/ERC20Proxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MixinAuthorizable.sol\";\n\n\ncontract ERC20Proxy is\n MixinAuthorizable\n{\n // Id of this proxy.\n bytes4 constant internal PROXY_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n \n // solhint-disable-next-line payable-fallback\n function () \n external\n {\n assembly {\n // The first 4 bytes of calldata holds the function selector\n let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)\n\n // `transferFrom` will be called with the following parameters:\n // assetData Encoded byte array.\n // from Address to transfer asset from.\n // to Address to transfer asset to.\n // amount Amount of asset to transfer.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {\n\n // To lookup a value in a mapping, we load from the storage location keccak256(k, p),\n // where k is the key left padded to 32 bytes and p is the storage slot\n let start := mload(64)\n mstore(start, and(caller, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(start, 32), authorized_slot)\n\n // Revert if authorized[msg.sender] == false\n if iszero(sload(keccak256(start, 64))) {\n // Revert with `Error(\"SENDER_NOT_AUTHORIZED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // `transferFrom`.\n // The function is marked `external`, so no abi decodeding is done for\n // us. Instead, we expect the `calldata` memory to contain the\n // following:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n //\n // (*): offset is computed from start of function parameters, so offset\n // by an additional 4 bytes in the calldata.\n //\n // (**): see table below to compute length of assetData Contents\n //\n // WARNING: The ABIv2 specification allows additional padding between\n // the Params and Data section. This will result in a larger\n // offset to assetData.\n\n // Asset data itself is encoded as follows:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 1 * 32 | function parameters: |\n // | | 4 | 12 + 20 | 1. token address |\n\n // We construct calldata for the `token.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 4 | | 1. from |\n // | | 36 | | 2. to |\n // | | 68 | | 3. amount |\n\n /////// Read token address from calldata ///////\n // * The token address is stored in `assetData`.\n //\n // * The \"offset to assetData\" is stored at offset 4 in the calldata (table 1).\n // [assetDataOffsetFromParams = calldataload(4)]\n //\n // * Notes that the \"offset to assetData\" is relative to the \"Params\" area of calldata;\n // add 4 bytes to account for the length of the \"Header\" area (table 1).\n // [assetDataOffsetFromHeader = assetDataOffsetFromParams + 4]\n //\n // * The \"token address\" is offset 32+4=36 bytes into \"assetData\" (tables 1 & 2).\n // [tokenOffset = assetDataOffsetFromHeader + 36 = calldataload(4) + 4 + 36]\n let token := calldataload(add(calldataload(4), 40))\n \n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFrom` selector.\n // Any trailing data in transferFromSelector will be\n // overwritten in the next `mstore` call.\n mstore(0, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // We copy the fields `from`, `to` and `amount` in bulk\n // from our own calldata to the new calldata.\n calldatacopy(4, 36, 96)\n\n /////// Call `token.transferFrom` using the calldata ///////\n let success := call(\n gas, // forward all gas\n token, // call address of token contract\n 0, // don't send any ETH\n 0, // pointer to start of input\n 100, // length of input\n 0, // write output over input\n 32 // output size should be 32 bytes\n )\n\n /////// Check return data. ///////\n // If there is no return data, we assume the token incorrectly\n // does not return a bool. In this case we expect it to revert\n // on failure, which was handled above.\n // If the token does return data, we require that it is a single\n // nonzero 32 bytes value.\n // So the transfer succeeded if the call succeeded and either\n // returned nothing, or returned a non-zero 32 byte value. \n success := and(success, or(\n iszero(returndatasize),\n and(\n eq(returndatasize, 32),\n gt(mload(0), 0)\n )\n ))\n if success {\n return(0, 0)\n }\n \n // Revert with `Error(\"TRANSFER_FAILED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // Revert if undefined function is called\n revert(0, 0)\n }\n }\n\n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4)\n {\n return PROXY_ID;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/ERC721Proxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MixinAuthorizable.sol\";\n\n\ncontract ERC721Proxy is\n MixinAuthorizable\n{\n // Id of this proxy.\n bytes4 constant internal PROXY_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n\n // solhint-disable-next-line payable-fallback\n function () \n external\n {\n assembly {\n // The first 4 bytes of calldata holds the function selector\n let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)\n\n // `transferFrom` will be called with the following parameters:\n // assetData Encoded byte array.\n // from Address to transfer asset from.\n // to Address to transfer asset to.\n // amount Amount of asset to transfer.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {\n\n // To lookup a value in a mapping, we load from the storage location keccak256(k, p),\n // where k is the key left padded to 32 bytes and p is the storage slot\n let start := mload(64)\n mstore(start, and(caller, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(start, 32), authorized_slot)\n\n // Revert if authorized[msg.sender] == false\n if iszero(sload(keccak256(start, 64))) {\n // Revert with `Error(\"SENDER_NOT_AUTHORIZED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // `transferFrom`.\n // The function is marked `external`, so no abi decodeding is done for\n // us. Instead, we expect the `calldata` memory to contain the\n // following:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n //\n // (*): offset is computed from start of function parameters, so offset\n // by an additional 4 bytes in the calldata.\n //\n // (**): see table below to compute length of assetData Contents\n //\n // WARNING: The ABIv2 specification allows additional padding between\n // the Params and Data section. This will result in a larger\n // offset to assetData.\n\n // Asset data itself is encoded as follows:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 2 * 32 | function parameters: |\n // | | 4 | 12 + 20 | 1. token address |\n // | | 36 | | 2. tokenId |\n \n // We construct calldata for the `token.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n // \n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 4 | | 1. from |\n // | | 36 | | 2. to |\n // | | 68 | | 3. tokenId |\n\n // There exists only 1 of each token.\n // require(amount == 1, \"INVALID_AMOUNT\")\n if sub(calldataload(100), 1) {\n // Revert with `Error(\"INVALID_AMOUNT\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000e494e56414c49445f414d4f554e540000000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFrom` selector.\n // Any trailing data in transferFromSelector will be\n // overwritten in the next `mstore` call.\n mstore(0, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // We copy the fields `from` and `to` in bulk\n // from our own calldata to the new calldata.\n calldatacopy(4, 36, 64)\n\n // Copy `tokenId` field from our own calldata to the new calldata.\n let assetDataOffset := calldataload(4)\n calldatacopy(68, add(assetDataOffset, 72), 32)\n\n /////// Call `token.transferFrom` using the calldata ///////\n let token := calldataload(add(assetDataOffset, 40))\n let success := call(\n gas, // forward all gas\n token, // call address of token contract\n 0, // don't send any ETH\n 0, // pointer to start of input\n 100, // length of input\n 0, // write output to null\n 0 // output size is 0 bytes\n )\n if success {\n return(0, 0)\n }\n \n // Revert with `Error(\"TRANSFER_FAILED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // Revert if undefined function is called\n revert(0, 0)\n }\n }\n\n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4)\n {\n return PROXY_ID;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/MixinAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"./mixins/MAuthorizable.sol\";\n\n\ncontract MixinAuthorizable is\n Ownable,\n MAuthorizable\n{\n /// @dev Only authorized addresses can invoke functions with this modifier.\n modifier onlyAuthorized {\n require(\n authorized[msg.sender],\n \"SENDER_NOT_AUTHORIZED\"\n );\n _;\n }\n\n mapping (address => bool) public authorized;\n address[] public authorities;\n\n /// @dev Authorizes an address.\n /// @param target Address to authorize.\n function addAuthorizedAddress(address target)\n external\n onlyOwner\n {\n require(\n !authorized[target],\n \"TARGET_ALREADY_AUTHORIZED\"\n );\n\n authorized[target] = true;\n authorities.push(target);\n emit AuthorizedAddressAdded(target, msg.sender);\n }\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n function removeAuthorizedAddress(address target)\n external\n onlyOwner\n {\n require(\n authorized[target],\n \"TARGET_NOT_AUTHORIZED\"\n );\n\n delete authorized[target];\n for (uint256 i = 0; i < authorities.length; i++) {\n if (authorities[i] == target) {\n authorities[i] = authorities[authorities.length - 1];\n authorities.length -= 1;\n break;\n }\n }\n emit AuthorizedAddressRemoved(target, msg.sender);\n }\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n /// @param index Index of target in authorities array.\n function removeAuthorizedAddressAtIndex(\n address target,\n uint256 index\n )\n external\n onlyOwner\n {\n require(\n authorized[target],\n \"TARGET_NOT_AUTHORIZED\"\n );\n require(\n index < authorities.length,\n \"INDEX_OUT_OF_BOUNDS\"\n );\n require(\n authorities[index] == target,\n \"AUTHORIZED_ADDRESS_MISMATCH\"\n );\n\n delete authorized[target];\n authorities[index] = authorities[authorities.length - 1];\n authorities.length -= 1;\n emit AuthorizedAddressRemoved(target, msg.sender);\n }\n\n /// @dev Gets all authorized addresses.\n /// @return Array of authorized addresses.\n function getAuthorizedAddresses()\n external\n view\n returns (address[] memory)\n {\n return authorities;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IAuthorizable.sol\";\n\n\ncontract IAssetProxy is\n IAuthorizable\n{\n /// @dev Transfers assets. Either succeeds or throws.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param from Address to transfer asset from.\n /// @param to Address to transfer asset to.\n /// @param amount Amount of asset to transfer.\n function transferFrom(\n bytes assetData,\n address from,\n address to,\n uint256 amount\n )\n external;\n \n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4);\n}\n",
- "2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/Ownable/IOwnable.sol\";\n\n\ncontract IAuthorizable is\n IOwnable\n{\n /// @dev Authorizes an address.\n /// @param target Address to authorize.\n function addAuthorizedAddress(address target)\n external;\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n function removeAuthorizedAddress(address target)\n external;\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n /// @param index Index of target in authorities array.\n function removeAuthorizedAddressAtIndex(\n address target,\n uint256 index\n )\n external;\n \n /// @dev Gets all authorized addresses.\n /// @return Array of authorized addresses.\n function getAuthorizedAddresses()\n external\n view\n returns (address[] memory);\n}\n",
- "2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAuthorizable.sol\";\n\n\ncontract MAuthorizable is\n IAuthorizable\n{\n // Event logged when a new address is authorized.\n event AuthorizedAddressAdded(\n address indexed target,\n address indexed caller\n );\n\n // Event logged when a currently authorized address is unauthorized.\n event AuthorizedAddressRemoved(\n address indexed target,\n address indexed caller\n );\n\n /// @dev Only authorized addresses can invoke functions with this modifier.\n modifier onlyAuthorized { revert(); _; }\n}\n",
- "2.0.0/protocol/AssetProxyOwner/AssetProxyOwner.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../multisig/MultiSigWalletWithTimeLock.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\n\n\ncontract AssetProxyOwner is\n MultiSigWalletWithTimeLock\n{\n using LibBytes for bytes;\n\n event AssetProxyRegistration(address assetProxyContract, bool isRegistered);\n\n // Mapping of AssetProxy contract address =>\n // if this contract is allowed to call the AssetProxy's `removeAuthorizedAddressAtIndex` method without a time lock.\n mapping (address => bool) public isAssetProxyRegistered;\n\n bytes4 constant internal REMOVE_AUTHORIZED_ADDRESS_AT_INDEX_SELECTOR = bytes4(keccak256(\"removeAuthorizedAddressAtIndex(address,uint256)\"));\n\n /// @dev Function will revert if the transaction does not call `removeAuthorizedAddressAtIndex`\n /// on an approved AssetProxy contract.\n modifier validRemoveAuthorizedAddressAtIndexTx(uint256 transactionId) {\n Transaction storage txn = transactions[transactionId];\n require(\n isAssetProxyRegistered[txn.destination],\n \"UNREGISTERED_ASSET_PROXY\"\n );\n require(\n txn.data.readBytes4(0) == REMOVE_AUTHORIZED_ADDRESS_AT_INDEX_SELECTOR,\n \"INVALID_FUNCTION_SELECTOR\"\n );\n _;\n }\n\n /// @dev Contract constructor sets initial owners, required number of confirmations,\n /// time lock, and list of AssetProxy addresses.\n /// @param _owners List of initial owners.\n /// @param _assetProxyContracts Array of AssetProxy contract addresses.\n /// @param _required Number of required confirmations.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n constructor (\n address[] memory _owners,\n address[] memory _assetProxyContracts,\n uint256 _required,\n uint256 _secondsTimeLocked\n )\n public\n MultiSigWalletWithTimeLock(_owners, _required, _secondsTimeLocked)\n {\n for (uint256 i = 0; i < _assetProxyContracts.length; i++) {\n address assetProxy = _assetProxyContracts[i];\n require(\n assetProxy != address(0),\n \"INVALID_ASSET_PROXY\"\n );\n isAssetProxyRegistered[assetProxy] = true;\n }\n }\n\n /// @dev Registers or deregisters an AssetProxy to be able to execute\n /// `removeAuthorizedAddressAtIndex` without a timelock.\n /// @param assetProxyContract Address of AssetProxy contract.\n /// @param isRegistered Status of approval for AssetProxy contract.\n function registerAssetProxy(address assetProxyContract, bool isRegistered)\n public\n onlyWallet\n notNull(assetProxyContract)\n {\n isAssetProxyRegistered[assetProxyContract] = isRegistered;\n emit AssetProxyRegistration(assetProxyContract, isRegistered);\n }\n\n /// @dev Allows execution of `removeAuthorizedAddressAtIndex` without time lock.\n /// @param transactionId Transaction ID.\n function executeRemoveAuthorizedAddressAtIndex(uint256 transactionId)\n public\n notExecuted(transactionId)\n fullyConfirmed(transactionId)\n validRemoveAuthorizedAddressAtIndexTx(transactionId)\n {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) {\n emit Execution(transactionId);\n } else {\n emit ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/Exchange.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./MixinExchangeCore.sol\";\nimport \"./MixinSignatureValidator.sol\";\nimport \"./MixinWrapperFunctions.sol\";\nimport \"./MixinAssetProxyDispatcher.sol\";\nimport \"./MixinTransactions.sol\";\nimport \"./MixinMatchOrders.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract Exchange is\n MixinExchangeCore,\n MixinMatchOrders,\n MixinSignatureValidator,\n MixinTransactions,\n MixinAssetProxyDispatcher,\n MixinWrapperFunctions\n{\n string constant public VERSION = \"2.0.1-alpha\";\n\n // Mixins are instantiated in the order they are inherited\n constructor (bytes memory _zrxAssetData)\n public\n LibConstants(_zrxAssetData) // @TODO: Remove when we deploy.\n MixinExchangeCore()\n MixinMatchOrders()\n MixinSignatureValidator()\n MixinTransactions()\n MixinAssetProxyDispatcher()\n MixinWrapperFunctions()\n {}\n}\n",
- "2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\nimport \"../AssetProxy/interfaces/IAssetProxy.sol\";\n\n\ncontract MixinAssetProxyDispatcher is\n Ownable,\n MAssetProxyDispatcher\n{\n // Mapping from Asset Proxy Id's to their respective Asset Proxy\n mapping (bytes4 => IAssetProxy) public assetProxies;\n\n /// @dev Registers an asset proxy to its asset proxy id.\n /// Once an asset proxy is registered, it cannot be unregistered.\n /// @param assetProxy Address of new asset proxy to register.\n function registerAssetProxy(address assetProxy)\n external\n onlyOwner\n {\n IAssetProxy assetProxyContract = IAssetProxy(assetProxy);\n\n // Ensure that no asset proxy exists with current id.\n bytes4 assetProxyId = assetProxyContract.getProxyId();\n address currentAssetProxy = assetProxies[assetProxyId];\n require(\n currentAssetProxy == address(0),\n \"ASSET_PROXY_ALREADY_EXISTS\"\n );\n\n // Add asset proxy and log registration.\n assetProxies[assetProxyId] = assetProxyContract;\n emit AssetProxyRegistered(\n assetProxyId,\n assetProxy\n );\n }\n\n /// @dev Gets an asset proxy.\n /// @param assetProxyId Id of the asset proxy.\n /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered.\n function getAssetProxy(bytes4 assetProxyId)\n external\n view\n returns (address)\n {\n return assetProxies[assetProxyId];\n }\n\n /// @dev Forwards arguments to assetProxy and calls `transferFrom`. Either succeeds or throws.\n /// @param assetData Byte array encoded for the asset.\n /// @param from Address to transfer token from.\n /// @param to Address to transfer token to.\n /// @param amount Amount of token to transfer.\n function dispatchTransferFrom(\n bytes memory assetData,\n address from,\n address to,\n uint256 amount\n )\n internal\n {\n // Do nothing if no amount should be transferred.\n if (amount > 0 && from != to) {\n // Ensure assetData length is valid\n require(\n assetData.length > 3,\n \"LENGTH_GREATER_THAN_3_REQUIRED\"\n );\n \n // Lookup assetProxy. We do not use `LibBytes.readBytes4` for gas efficiency reasons.\n bytes4 assetProxyId;\n assembly {\n assetProxyId := and(mload(\n add(assetData, 32)),\n 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000\n )\n }\n address assetProxy = assetProxies[assetProxyId];\n\n // Ensure that assetProxy exists\n require(\n assetProxy != address(0),\n \"ASSET_PROXY_DOES_NOT_EXIST\"\n );\n \n // We construct calldata for the `assetProxy.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n // \n // | Area | Offset | Length | Contents |\n // | -------- |--------|---------|-------------------------------------------- |\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n\n assembly {\n /////// Setup State ///////\n // `cdStart` is the start of the calldata for `assetProxy.transferFrom` (equal to free memory ptr).\n let cdStart := mload(64)\n // `dataAreaLength` is the total number of words needed to store `assetData`\n // As-per the ABI spec, this value is padded up to the nearest multiple of 32,\n // and includes 32-bytes for length.\n let dataAreaLength := and(add(mload(assetData), 63), 0xFFFFFFFFFFFE0)\n // `cdEnd` is the end of the calldata for `assetProxy.transferFrom`.\n let cdEnd := add(cdStart, add(132, dataAreaLength))\n\n \n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFromSelector`.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n mstore(cdStart, 0xa85e59e400000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // Each parameter is padded to 32-bytes. The entire Params Area is 128 bytes.\n // Notes:\n // 1. The offset to `assetData` is the length of the Params Area (128 bytes).\n // 2. A 20-byte mask is applied to addresses to zero-out the unused bytes.\n mstore(add(cdStart, 4), 128)\n mstore(add(cdStart, 36), and(from, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(cdStart, 68), and(to, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(cdStart, 100), amount)\n \n /////// Setup Data Area ///////\n // This area holds `assetData`.\n let dataArea := add(cdStart, 132)\n // solhint-disable-next-line no-empty-blocks\n for {} lt(dataArea, cdEnd) {} {\n mstore(dataArea, mload(assetData))\n dataArea := add(dataArea, 32)\n assetData := add(assetData, 32)\n }\n\n /////// Call `assetProxy.transferFrom` using the constructed calldata ///////\n let success := call(\n gas, // forward all gas\n assetProxy, // call address of asset proxy\n 0, // don't send any ETH\n cdStart, // pointer to start of input\n sub(cdEnd, cdStart), // length of input \n cdStart, // write output over input\n 512 // reserve 512 bytes for output\n )\n if iszero(success) {\n revert(cdStart, returndatasize())\n }\n }\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\n\n\ncontract MixinExchangeCore is\n ReentrancyGuard,\n LibConstants,\n LibMath,\n LibOrder,\n LibFillResults,\n MAssetProxyDispatcher,\n MExchangeCore,\n MSignatureValidator,\n MTransactions\n{\n // Mapping of orderHash => amount of takerAsset already bought by maker\n mapping (bytes32 => uint256) public filled;\n\n // Mapping of orderHash => cancelled\n mapping (bytes32 => bool) public cancelled;\n\n // Mapping of makerAddress => senderAddress => lowest salt an order can have in order to be fillable\n // Orders with specified senderAddress and with a salt less than their epoch are considered cancelled\n mapping (address => mapping (address => uint256)) public orderEpoch;\n\n /// @dev Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch\n /// and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress).\n /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled.\n function cancelOrdersUpTo(uint256 targetOrderEpoch)\n external\n nonReentrant\n {\n address makerAddress = getCurrentContextAddress();\n // If this function is called via `executeTransaction`, we only update the orderEpoch for the makerAddress/msg.sender combination.\n // This allows external filter contracts to add rules to how orders are cancelled via this function.\n address senderAddress = makerAddress == msg.sender ? address(0) : msg.sender;\n\n // orderEpoch is initialized to 0, so to cancelUpTo we need salt + 1\n uint256 newOrderEpoch = targetOrderEpoch + 1; \n uint256 oldOrderEpoch = orderEpoch[makerAddress][senderAddress];\n\n // Ensure orderEpoch is monotonically increasing\n require(\n newOrderEpoch > oldOrderEpoch, \n \"INVALID_NEW_ORDER_EPOCH\"\n );\n\n // Update orderEpoch\n orderEpoch[makerAddress][senderAddress] = newOrderEpoch;\n emit CancelUpTo(\n makerAddress,\n senderAddress,\n newOrderEpoch\n );\n }\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrder(\n Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n nonReentrant\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n return fillResults;\n }\n\n /// @dev After calling, the order can not be filled anymore.\n /// Throws if order is invalid or sender does not have permission to cancel.\n /// @param order Order to cancel. Order must be OrderStatus.FILLABLE.\n function cancelOrder(Order memory order)\n public\n nonReentrant\n {\n cancelOrderInternal(order);\n }\n\n /// @dev Gets information about an order: status, hash, and amount filled.\n /// @param order Order to gather information on.\n /// @return OrderInfo Information about the order and its state.\n /// See LibOrder.OrderInfo for a complete description.\n function getOrderInfo(Order memory order)\n public\n view\n returns (OrderInfo memory orderInfo)\n {\n // Compute the order hash\n orderInfo.orderHash = getOrderHash(order);\n\n // Fetch filled amount\n orderInfo.orderTakerAssetFilledAmount = filled[orderInfo.orderHash];\n\n // If order.makerAssetAmount is zero, we also reject the order.\n // While the Exchange contract handles them correctly, they create\n // edge cases in the supporting infrastructure because they have\n // an 'infinite' price when computed by a simple division.\n if (order.makerAssetAmount == 0) {\n orderInfo.orderStatus = uint8(OrderStatus.INVALID_MAKER_ASSET_AMOUNT);\n return orderInfo;\n }\n\n // If order.takerAssetAmount is zero, then the order will always\n // be considered filled because 0 == takerAssetAmount == orderTakerAssetFilledAmount\n // Instead of distinguishing between unfilled and filled zero taker\n // amount orders, we choose not to support them.\n if (order.takerAssetAmount == 0) {\n orderInfo.orderStatus = uint8(OrderStatus.INVALID_TAKER_ASSET_AMOUNT);\n return orderInfo;\n }\n\n // Validate order availability\n if (orderInfo.orderTakerAssetFilledAmount >= order.takerAssetAmount) {\n orderInfo.orderStatus = uint8(OrderStatus.FULLY_FILLED);\n return orderInfo;\n }\n\n // Validate order expiration\n // solhint-disable-next-line not-rely-on-time\n if (block.timestamp >= order.expirationTimeSeconds) {\n orderInfo.orderStatus = uint8(OrderStatus.EXPIRED);\n return orderInfo;\n }\n\n // Check if order has been cancelled\n if (cancelled[orderInfo.orderHash]) {\n orderInfo.orderStatus = uint8(OrderStatus.CANCELLED);\n return orderInfo;\n }\n if (orderEpoch[order.makerAddress][order.senderAddress] > order.salt) {\n orderInfo.orderStatus = uint8(OrderStatus.CANCELLED);\n return orderInfo;\n }\n\n // All other statuses are ruled out: order is Fillable\n orderInfo.orderStatus = uint8(OrderStatus.FILLABLE);\n return orderInfo;\n }\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderInternal(\n Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n // Fetch order info\n OrderInfo memory orderInfo = getOrderInfo(order);\n\n // Fetch taker address\n address takerAddress = getCurrentContextAddress();\n \n // Assert that the order is fillable by taker\n assertFillableOrder(\n order,\n orderInfo,\n takerAddress,\n signature\n );\n \n // Get amount of takerAsset to fill\n uint256 remainingTakerAssetAmount = safeSub(order.takerAssetAmount, orderInfo.orderTakerAssetFilledAmount);\n uint256 takerAssetFilledAmount = min256(takerAssetFillAmount, remainingTakerAssetAmount);\n\n // Validate context\n assertValidFill(\n order,\n orderInfo,\n takerAssetFillAmount,\n takerAssetFilledAmount,\n fillResults.makerAssetFilledAmount\n );\n\n // Compute proportional fill amounts\n fillResults = calculateFillResults(order, takerAssetFilledAmount);\n\n // Update exchange internal state\n updateFilledState(\n order,\n takerAddress,\n orderInfo.orderHash,\n orderInfo.orderTakerAssetFilledAmount,\n fillResults\n );\n \n // Settle order\n settleOrder(\n order,\n takerAddress,\n fillResults\n );\n\n return fillResults;\n }\n\n /// @dev After calling, the order can not be filled anymore.\n /// Throws if order is invalid or sender does not have permission to cancel.\n /// @param order Order to cancel. Order must be OrderStatus.FILLABLE.\n function cancelOrderInternal(Order memory order)\n internal\n {\n // Fetch current order status\n OrderInfo memory orderInfo = getOrderInfo(order);\n\n // Validate context\n assertValidCancel(order, orderInfo);\n\n // Perform cancel\n updateCancelledState(order, orderInfo.orderHash);\n }\n\n /// @dev Updates state with results of a fill order.\n /// @param order that was filled.\n /// @param takerAddress Address of taker who filled the order.\n /// @param orderTakerAssetFilledAmount Amount of order already filled.\n function updateFilledState(\n Order memory order,\n address takerAddress,\n bytes32 orderHash,\n uint256 orderTakerAssetFilledAmount,\n FillResults memory fillResults\n )\n internal\n {\n // Update state\n filled[orderHash] = safeAdd(orderTakerAssetFilledAmount, fillResults.takerAssetFilledAmount);\n\n // Log order\n emit Fill(\n order.makerAddress,\n order.feeRecipientAddress,\n takerAddress,\n msg.sender,\n fillResults.makerAssetFilledAmount,\n fillResults.takerAssetFilledAmount,\n fillResults.makerFeePaid,\n fillResults.takerFeePaid,\n orderHash,\n order.makerAssetData,\n order.takerAssetData\n );\n }\n\n /// @dev Updates state with results of cancelling an order.\n /// State is only updated if the order is currently fillable.\n /// Otherwise, updating state would have no effect.\n /// @param order that was cancelled.\n /// @param orderHash Hash of order that was cancelled.\n function updateCancelledState(\n Order memory order,\n bytes32 orderHash\n )\n internal\n {\n // Perform cancel\n cancelled[orderHash] = true;\n\n // Log cancel\n emit Cancel(\n order.makerAddress,\n order.feeRecipientAddress,\n msg.sender,\n orderHash,\n order.makerAssetData,\n order.takerAssetData\n );\n }\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAddress Address of order taker.\n /// @param signature Proof that the orders was created by its maker.\n function assertFillableOrder(\n Order memory order,\n OrderInfo memory orderInfo,\n address takerAddress,\n bytes memory signature\n )\n internal\n view\n {\n // An order can only be filled if its status is FILLABLE.\n require(\n orderInfo.orderStatus == uint8(OrderStatus.FILLABLE),\n \"ORDER_UNFILLABLE\"\n );\n \n // Validate sender is allowed to fill this order\n if (order.senderAddress != address(0)) {\n require(\n order.senderAddress == msg.sender,\n \"INVALID_SENDER\"\n );\n }\n \n // Validate taker is allowed to fill this order\n if (order.takerAddress != address(0)) {\n require(\n order.takerAddress == takerAddress,\n \"INVALID_TAKER\"\n );\n }\n \n // Validate Maker signature (check only if first time seen)\n if (orderInfo.orderTakerAssetFilledAmount == 0) {\n require(\n isValidSignature(\n orderInfo.orderHash,\n order.makerAddress,\n signature\n ),\n \"INVALID_ORDER_SIGNATURE\"\n );\n }\n }\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAssetFillAmount Desired amount of order to fill by taker.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @param makerAssetFilledAmount Amount of makerAsset that will be transfered.\n function assertValidFill(\n Order memory order,\n OrderInfo memory orderInfo,\n uint256 takerAssetFillAmount, // TODO: use FillResults\n uint256 takerAssetFilledAmount,\n uint256 makerAssetFilledAmount\n )\n internal\n view\n {\n // Revert if fill amount is invalid\n // TODO: reconsider necessity for v2.1\n require(\n takerAssetFillAmount != 0,\n \"INVALID_TAKER_AMOUNT\"\n );\n \n // Make sure taker does not pay more than desired amount\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n takerAssetFilledAmount <= takerAssetFillAmount,\n \"TAKER_OVERPAY\"\n );\n \n // Make sure order is not overfilled\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n safeAdd(orderInfo.orderTakerAssetFilledAmount, takerAssetFilledAmount) <= order.takerAssetAmount,\n \"ORDER_OVERFILL\"\n );\n \n // Make sure order is filled at acceptable price.\n // The order has an implied price from the makers perspective:\n // order price = order.makerAssetAmount / order.takerAssetAmount\n // i.e. the number of makerAsset maker is paying per takerAsset. The\n // maker is guaranteed to get this price or a better (lower) one. The\n // actual price maker is getting in this fill is:\n // fill price = makerAssetFilledAmount / takerAssetFilledAmount\n // We need `fill price <= order price` for the fill to be fair to maker.\n // This amounts to:\n // makerAssetFilledAmount order.makerAssetAmount\n // ------------------------ <= -----------------------\n // takerAssetFilledAmount order.takerAssetAmount\n // or, equivalently:\n // makerAssetFilledAmount * order.takerAssetAmount <=\n // order.makerAssetAmount * takerAssetFilledAmount\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n safeMul(makerAssetFilledAmount, order.takerAssetAmount)\n <= \n safeMul(order.makerAssetAmount, takerAssetFilledAmount),\n \"INVALID_FILL_PRICE\"\n );\n }\n\n /// @dev Validates context for cancelOrder. Succeeds or throws.\n /// @param order to be cancelled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n function assertValidCancel(\n Order memory order,\n OrderInfo memory orderInfo\n )\n internal\n view\n {\n // Ensure order is valid\n // An order can only be cancelled if its status is FILLABLE.\n require(\n orderInfo.orderStatus == uint8(OrderStatus.FILLABLE),\n \"ORDER_UNFILLABLE\"\n );\n\n // Validate sender is allowed to cancel this order\n if (order.senderAddress != address(0)) {\n require(\n order.senderAddress == msg.sender,\n \"INVALID_SENDER\"\n );\n }\n\n // Validate transaction signed by maker\n address makerAddress = getCurrentContextAddress();\n require(\n order.makerAddress == makerAddress,\n \"INVALID_MAKER\"\n );\n }\n\n /// @dev Calculates amounts filled and fees paid by maker and taker.\n /// @param order to be filled.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function calculateFillResults(\n Order memory order,\n uint256 takerAssetFilledAmount\n )\n internal\n pure\n returns (FillResults memory fillResults)\n {\n // Compute proportional transfer amounts\n fillResults.takerAssetFilledAmount = takerAssetFilledAmount;\n fillResults.makerAssetFilledAmount = safeGetPartialAmountFloor(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.makerAssetAmount\n );\n fillResults.makerFeePaid = safeGetPartialAmountFloor(\n fillResults.makerAssetFilledAmount,\n order.makerAssetAmount,\n order.makerFee\n );\n fillResults.takerFeePaid = safeGetPartialAmountFloor(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.takerFee\n );\n\n return fillResults;\n }\n\n /// @dev Settles an order by transferring assets between counterparties.\n /// @param order Order struct containing order specifications.\n /// @param takerAddress Address selling takerAsset and buying makerAsset.\n /// @param fillResults Amounts to be filled and fees paid by maker and taker.\n function settleOrder(\n LibOrder.Order memory order,\n address takerAddress,\n LibFillResults.FillResults memory fillResults\n )\n private\n {\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n dispatchTransferFrom(\n order.makerAssetData,\n order.makerAddress,\n takerAddress,\n fillResults.makerAssetFilledAmount\n );\n dispatchTransferFrom(\n order.takerAssetData,\n takerAddress,\n order.makerAddress,\n fillResults.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n zrxAssetData,\n order.makerAddress,\n order.feeRecipientAddress,\n fillResults.makerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n order.feeRecipientAddress,\n fillResults.takerFeePaid\n );\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinMatchOrders.sol": "/*\n Copyright 2018 ZeroEx Intl.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n http://www.apache.org/licenses/LICENSE-2.0\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MMatchOrders.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\n\n\ncontract MixinMatchOrders is\n ReentrancyGuard,\n LibConstants,\n LibMath,\n MAssetProxyDispatcher,\n MExchangeCore,\n MMatchOrders,\n MTransactions\n{\n /// @dev Match two complementary orders that have a profitable spread.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the left order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftSignature Proof that order was created by the left maker.\n /// @param rightSignature Proof that order was created by the right maker.\n /// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.\n function matchOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n bytes memory leftSignature,\n bytes memory rightSignature\n )\n public\n nonReentrant\n returns (LibFillResults.MatchedFillResults memory matchedFillResults)\n {\n // We assume that rightOrder.takerAssetData == leftOrder.makerAssetData and rightOrder.makerAssetData == leftOrder.takerAssetData.\n // If this assumption isn't true, the match will fail at signature validation.\n rightOrder.makerAssetData = leftOrder.takerAssetData;\n rightOrder.takerAssetData = leftOrder.makerAssetData;\n\n // Get left & right order info\n LibOrder.OrderInfo memory leftOrderInfo = getOrderInfo(leftOrder);\n LibOrder.OrderInfo memory rightOrderInfo = getOrderInfo(rightOrder);\n\n // Fetch taker address\n address takerAddress = getCurrentContextAddress();\n \n // Either our context is valid or we revert\n assertFillableOrder(\n leftOrder,\n leftOrderInfo,\n takerAddress,\n leftSignature\n );\n assertFillableOrder(\n rightOrder,\n rightOrderInfo,\n takerAddress,\n rightSignature\n );\n assertValidMatch(leftOrder, rightOrder);\n\n // Compute proportional fill amounts\n matchedFillResults = calculateMatchedFillResults(\n leftOrder,\n rightOrder,\n leftOrderInfo.orderTakerAssetFilledAmount,\n rightOrderInfo.orderTakerAssetFilledAmount\n );\n\n // Validate fill contexts\n assertValidFill(\n leftOrder,\n leftOrderInfo,\n matchedFillResults.left.takerAssetFilledAmount,\n matchedFillResults.left.takerAssetFilledAmount,\n matchedFillResults.left.makerAssetFilledAmount\n );\n assertValidFill(\n rightOrder,\n rightOrderInfo,\n matchedFillResults.right.takerAssetFilledAmount,\n matchedFillResults.right.takerAssetFilledAmount,\n matchedFillResults.right.makerAssetFilledAmount\n );\n \n // Update exchange state\n updateFilledState(\n leftOrder,\n takerAddress,\n leftOrderInfo.orderHash,\n leftOrderInfo.orderTakerAssetFilledAmount,\n matchedFillResults.left\n );\n updateFilledState(\n rightOrder,\n takerAddress,\n rightOrderInfo.orderHash,\n rightOrderInfo.orderTakerAssetFilledAmount,\n matchedFillResults.right\n );\n\n // Settle matched orders. Succeeds or throws.\n settleMatchedOrders(\n leftOrder,\n rightOrder,\n takerAddress,\n matchedFillResults\n );\n\n return matchedFillResults;\n }\n\n /// @dev Validates context for matchOrders. Succeeds or throws.\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n function assertValidMatch(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder\n )\n internal\n pure\n {\n // Make sure there is a profitable spread.\n // There is a profitable spread iff the cost per unit bought (OrderA.MakerAmount/OrderA.TakerAmount) for each order is greater\n // than the profit per unit sold of the matched order (OrderB.TakerAmount/OrderB.MakerAmount).\n // This is satisfied by the equations below:\n // <leftOrder.makerAssetAmount> / <leftOrder.takerAssetAmount> >= <rightOrder.takerAssetAmount> / <rightOrder.makerAssetAmount>\n // AND\n // <rightOrder.makerAssetAmount> / <rightOrder.takerAssetAmount> >= <leftOrder.takerAssetAmount> / <leftOrder.makerAssetAmount>\n // These equations can be combined to get the following:\n require(\n safeMul(leftOrder.makerAssetAmount, rightOrder.makerAssetAmount) >=\n safeMul(leftOrder.takerAssetAmount, rightOrder.takerAssetAmount),\n \"NEGATIVE_SPREAD_REQUIRED\"\n );\n }\n\n /// @dev Calculates fill amounts for the matched orders.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the leftOrder order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftOrderTakerAssetFilledAmount Amount of left order already filled.\n /// @param rightOrderTakerAssetFilledAmount Amount of right order already filled.\n /// @param matchedFillResults Amounts to fill and fees to pay by maker and taker of matched orders.\n function calculateMatchedFillResults(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n uint256 leftOrderTakerAssetFilledAmount,\n uint256 rightOrderTakerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.MatchedFillResults memory matchedFillResults)\n {\n // Derive maker asset amounts for left & right orders, given store taker assert amounts\n uint256 leftTakerAssetAmountRemaining = safeSub(leftOrder.takerAssetAmount, leftOrderTakerAssetFilledAmount);\n uint256 leftMakerAssetAmountRemaining = safeGetPartialAmountFloor(\n leftOrder.makerAssetAmount,\n leftOrder.takerAssetAmount,\n leftTakerAssetAmountRemaining\n );\n uint256 rightTakerAssetAmountRemaining = safeSub(rightOrder.takerAssetAmount, rightOrderTakerAssetFilledAmount);\n uint256 rightMakerAssetAmountRemaining = safeGetPartialAmountFloor(\n rightOrder.makerAssetAmount,\n rightOrder.takerAssetAmount,\n rightTakerAssetAmountRemaining\n );\n\n // Calculate fill results for maker and taker assets: at least one order will be fully filled.\n // The maximum amount the left maker can buy is `leftTakerAssetAmountRemaining`\n // The maximum amount the right maker can sell is `rightMakerAssetAmountRemaining`\n // We have two distinct cases for calculating the fill results:\n // Case 1.\n // If the left maker can buy more than the right maker can sell, then only the right order is fully filled.\n // If the left maker can buy exactly what the right maker can sell, then both orders are fully filled.\n // Case 2.\n // If the left maker cannot buy more than the right maker can sell, then only the left order is fully filled.\n if (leftTakerAssetAmountRemaining >= rightMakerAssetAmountRemaining) {\n // Case 1: Right order is fully filled\n matchedFillResults.right.makerAssetFilledAmount = rightMakerAssetAmountRemaining;\n matchedFillResults.right.takerAssetFilledAmount = rightTakerAssetAmountRemaining;\n matchedFillResults.left.takerAssetFilledAmount = matchedFillResults.right.makerAssetFilledAmount;\n // Round down to ensure the maker's exchange rate does not exceed the price specified by the order. \n // We favor the maker when the exchange rate must be rounded.\n matchedFillResults.left.makerAssetFilledAmount = safeGetPartialAmountFloor(\n leftOrder.makerAssetAmount,\n leftOrder.takerAssetAmount,\n matchedFillResults.left.takerAssetFilledAmount\n );\n } else {\n // Case 2: Left order is fully filled\n matchedFillResults.left.makerAssetFilledAmount = leftMakerAssetAmountRemaining;\n matchedFillResults.left.takerAssetFilledAmount = leftTakerAssetAmountRemaining;\n matchedFillResults.right.makerAssetFilledAmount = matchedFillResults.left.takerAssetFilledAmount;\n // Round up to ensure the maker's exchange rate does not exceed the price specified by the order.\n // We favor the maker when the exchange rate must be rounded.\n matchedFillResults.right.takerAssetFilledAmount = safeGetPartialAmountCeil(\n rightOrder.takerAssetAmount,\n rightOrder.makerAssetAmount,\n matchedFillResults.right.makerAssetFilledAmount\n );\n }\n\n // Calculate amount given to taker\n matchedFillResults.leftMakerAssetSpreadAmount = safeSub(\n matchedFillResults.left.makerAssetFilledAmount,\n matchedFillResults.right.takerAssetFilledAmount\n );\n\n // Compute fees for left order\n matchedFillResults.left.makerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.left.makerAssetFilledAmount,\n leftOrder.makerAssetAmount,\n leftOrder.makerFee\n );\n matchedFillResults.left.takerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.left.takerAssetFilledAmount,\n leftOrder.takerAssetAmount,\n leftOrder.takerFee\n );\n\n // Compute fees for right order\n matchedFillResults.right.makerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.right.makerAssetFilledAmount,\n rightOrder.makerAssetAmount,\n rightOrder.makerFee\n );\n matchedFillResults.right.takerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.right.takerAssetFilledAmount,\n rightOrder.takerAssetAmount,\n rightOrder.takerFee\n );\n\n // Return fill results\n return matchedFillResults;\n }\n\n /// @dev Settles matched order by transferring appropriate funds between order makers, taker, and fee recipient.\n /// @param leftOrder First matched order.\n /// @param rightOrder Second matched order.\n /// @param takerAddress Address that matched the orders. The taker receives the spread between orders as profit.\n /// @param matchedFillResults Struct holding amounts to transfer between makers, taker, and fee recipients.\n function settleMatchedOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n address takerAddress,\n LibFillResults.MatchedFillResults memory matchedFillResults\n )\n private\n {\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n // Order makers and taker\n dispatchTransferFrom(\n leftOrder.makerAssetData,\n leftOrder.makerAddress,\n rightOrder.makerAddress,\n matchedFillResults.right.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n rightOrder.makerAssetData,\n rightOrder.makerAddress,\n leftOrder.makerAddress,\n matchedFillResults.left.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n leftOrder.makerAssetData,\n leftOrder.makerAddress,\n takerAddress,\n matchedFillResults.leftMakerAssetSpreadAmount\n );\n\n // Maker fees\n dispatchTransferFrom(\n zrxAssetData,\n leftOrder.makerAddress,\n leftOrder.feeRecipientAddress,\n matchedFillResults.left.makerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n rightOrder.makerAddress,\n rightOrder.feeRecipientAddress,\n matchedFillResults.right.makerFeePaid\n );\n\n // Taker fees\n if (leftOrder.feeRecipientAddress == rightOrder.feeRecipientAddress) {\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n leftOrder.feeRecipientAddress,\n safeAdd(\n matchedFillResults.left.takerFeePaid,\n matchedFillResults.right.takerFeePaid\n )\n );\n } else {\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n leftOrder.feeRecipientAddress,\n matchedFillResults.left.takerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n rightOrder.feeRecipientAddress,\n matchedFillResults.right.takerFeePaid\n );\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinSignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./interfaces/IWallet.sol\";\nimport \"./interfaces/IValidator.sol\";\n\n\ncontract MixinSignatureValidator is\n ReentrancyGuard,\n MSignatureValidator,\n MTransactions\n{\n using LibBytes for bytes;\n \n // Mapping of hash => signer => signed\n mapping (bytes32 => mapping (address => bool)) public preSigned;\n\n // Mapping of signer => validator => approved\n mapping (address => mapping (address => bool)) public allowedValidators;\n\n /// @dev Approves a hash on-chain using any valid signature type.\n /// After presigning a hash, the preSign signature type will become valid for that hash and signer.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n function preSign(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external\n {\n if (signerAddress != msg.sender) {\n require(\n isValidSignature(\n hash,\n signerAddress,\n signature\n ),\n \"INVALID_SIGNATURE\"\n );\n }\n preSigned[hash][signerAddress] = true;\n }\n\n /// @dev Approves/unnapproves a Validator contract to verify signatures on signer's behalf.\n /// @param validatorAddress Address of Validator contract.\n /// @param approval Approval or disapproval of Validator contract.\n function setSignatureValidatorApproval(\n address validatorAddress,\n bool approval\n )\n external\n nonReentrant\n {\n address signerAddress = getCurrentContextAddress();\n allowedValidators[signerAddress][validatorAddress] = approval;\n emit SignatureValidatorApproval(\n signerAddress,\n validatorAddress,\n approval\n );\n }\n\n /// @dev Verifies that a hash has been signed by the given signer.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes memory signature\n )\n public\n view\n returns (bool isValid)\n {\n require(\n signature.length > 0,\n \"LENGTH_GREATER_THAN_0_REQUIRED\"\n );\n\n // Pop last byte off of signature byte array.\n uint8 signatureTypeRaw = uint8(signature.popLastByte());\n\n // Ensure signature is supported\n require(\n signatureTypeRaw < uint8(SignatureType.NSignatureTypes),\n \"SIGNATURE_UNSUPPORTED\"\n );\n\n SignatureType signatureType = SignatureType(signatureTypeRaw);\n\n // Variables are not scoped in Solidity.\n uint8 v;\n bytes32 r;\n bytes32 s;\n address recovered;\n\n // Always illegal signature.\n // This is always an implicit option since a signer can create a\n // signature array with invalid type or length. We may as well make\n // it an explicit option. This aids testing and analysis. It is\n // also the initialization value for the enum type.\n if (signatureType == SignatureType.Illegal) {\n revert(\"SIGNATURE_ILLEGAL\");\n\n // Always invalid signature.\n // Like Illegal, this is always implicitly available and therefore\n // offered explicitly. It can be implicitly created by providing\n // a correctly formatted but incorrect signature.\n } else if (signatureType == SignatureType.Invalid) {\n require(\n signature.length == 0,\n \"LENGTH_0_REQUIRED\"\n );\n isValid = false;\n return isValid;\n\n // Signature using EIP712\n } else if (signatureType == SignatureType.EIP712) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n hash,\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n\n // Signed using web3.eth_sign\n } else if (signatureType == SignatureType.EthSign) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n keccak256(abi.encodePacked(\n \"\\x19Ethereum Signed Message:\\n32\",\n hash\n )),\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n\n // Signature verified by wallet contract.\n // If used with an order, the maker of the order is the wallet contract.\n } else if (signatureType == SignatureType.Wallet) {\n isValid = isValidWalletSignature(\n hash,\n signerAddress,\n signature\n );\n return isValid;\n\n // Signature verified by validator contract.\n // If used with an order, the maker of the order can still be an EOA.\n // A signature using this type should be encoded as:\n // | Offset | Length | Contents |\n // | 0x00 | x | Signature to validate |\n // | 0x00 + x | 20 | Address of validator contract |\n // | 0x14 + x | 1 | Signature type is always \"\\x06\" |\n } else if (signatureType == SignatureType.Validator) {\n // Pop last 20 bytes off of signature byte array.\n address validatorAddress = signature.popLast20Bytes();\n \n // Ensure signer has approved validator.\n if (!allowedValidators[signerAddress][validatorAddress]) {\n return false;\n }\n isValid = isValidValidatorSignature(\n validatorAddress,\n hash,\n signerAddress,\n signature\n );\n return isValid;\n\n // Signer signed hash previously using the preSign function.\n } else if (signatureType == SignatureType.PreSigned) {\n isValid = preSigned[hash][signerAddress];\n return isValid;\n }\n\n // Anything else is illegal (We do not return false because\n // the signature may actually be valid, just not in a format\n // that we currently support. In this case returning false\n // may lead the caller to incorrectly believe that the\n // signature was invalid.)\n revert(\"SIGNATURE_UNSUPPORTED\");\n }\n\n /// @dev Verifies signature using logic defined by Wallet contract.\n /// @param hash Any 32 byte hash.\n /// @param walletAddress Address that should have signed the given hash\n /// and defines its own signature verification method.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if signature is valid for given wallet..\n function isValidWalletSignature(\n bytes32 hash,\n address walletAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid)\n {\n bytes memory calldata = abi.encodeWithSelector(\n IWallet(walletAddress).isValidSignature.selector,\n hash,\n signature\n );\n assembly {\n let cdStart := add(calldata, 32)\n let success := staticcall(\n gas, // forward all gas\n walletAddress, // address of Wallet contract\n cdStart, // pointer to start of input\n mload(calldata), // length of input\n cdStart, // write output over input\n 32 // output size is 32 bytes\n )\n\n switch success\n case 0 {\n // Revert with `Error(\"WALLET_ERROR\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000c57414c4c45545f4552524f5200000000000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n case 1 {\n // Signature is valid if call did not revert and returned true\n isValid := mload(cdStart)\n }\n }\n return isValid;\n }\n\n /// @dev Verifies signature using logic defined by Validator contract.\n /// @param validatorAddress Address of validator contract.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidValidatorSignature(\n address validatorAddress,\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid)\n {\n bytes memory calldata = abi.encodeWithSelector(\n IValidator(signerAddress).isValidSignature.selector,\n hash,\n signerAddress,\n signature\n );\n assembly {\n let cdStart := add(calldata, 32)\n let success := staticcall(\n gas, // forward all gas\n validatorAddress, // address of Validator contract\n cdStart, // pointer to start of input\n mload(calldata), // length of input\n cdStart, // write output over input\n 32 // output size is 32 bytes\n )\n\n switch success\n case 0 {\n // Revert with `Error(\"VALIDATOR_ERROR\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f56414c494441544f525f4552524f5200000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n case 1 {\n // Signature is valid if call did not revert and returned true\n isValid := mload(cdStart)\n }\n }\n return isValid;\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinTransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\nimport \"./libs/LibExchangeErrors.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./libs/LibEIP712.sol\";\n\n\ncontract MixinTransactions is\n LibEIP712,\n MSignatureValidator,\n MTransactions\n{\n // Mapping of transaction hash => executed\n // This prevents transactions from being executed more than once.\n mapping (bytes32 => bool) public transactions;\n\n // Address of current transaction signer\n address public currentContextAddress;\n\n /// @dev Executes an exchange method call in the context of signer.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @param signature Proof of signer transaction by signer.\n function executeTransaction(\n uint256 salt,\n address signerAddress,\n bytes data,\n bytes signature\n )\n external\n {\n // Prevent reentrancy\n require(\n currentContextAddress == address(0),\n \"REENTRANCY_ILLEGAL\"\n );\n\n bytes32 transactionHash = hashEIP712Message(hashZeroExTransaction(\n salt,\n signerAddress,\n data\n ));\n\n // Validate transaction has not been executed\n require(\n !transactions[transactionHash],\n \"INVALID_TX_HASH\"\n );\n\n // Transaction always valid if signer is sender of transaction\n if (signerAddress != msg.sender) {\n // Validate signature\n require(\n isValidSignature(\n transactionHash,\n signerAddress,\n signature\n ),\n \"INVALID_TX_SIGNATURE\"\n );\n\n // Set the current transaction signer\n currentContextAddress = signerAddress;\n }\n\n // Execute transaction\n transactions[transactionHash] = true;\n require(\n address(this).delegatecall(data),\n \"FAILED_EXECUTION\"\n );\n\n // Reset current transaction signer if it was previously updated\n if (signerAddress != msg.sender) {\n currentContextAddress = address(0);\n }\n }\n\n /// @dev Calculates EIP712 hash of the Transaction.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @return EIP712 hash of the Transaction.\n function hashZeroExTransaction(\n uint256 salt,\n address signerAddress,\n bytes memory data\n )\n internal\n pure\n returns (bytes32 result)\n {\n bytes32 schemaHash = EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH;\n bytes32 dataHash = keccak256(data);\n\n // Assembly for more efficiently computing:\n // keccak256(abi.encodePacked(\n // EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH,\n // salt,\n // bytes32(signerAddress),\n // keccak256(data)\n // ));\n\n assembly {\n // Load free memory pointer\n let memPtr := mload(64)\n\n mstore(memPtr, schemaHash) // hash of schema\n mstore(add(memPtr, 32), salt) // salt\n mstore(add(memPtr, 64), and(signerAddress, 0xffffffffffffffffffffffffffffffffffffffff)) // signerAddress\n mstore(add(memPtr, 96), dataHash) // hash of data\n\n // Compute hash\n result := keccak256(memPtr, 128)\n }\n return result;\n }\n\n /// @dev The current function will be called in the context of this address (either 0x transaction signer or `msg.sender`).\n /// If calling a fill function, this address will represent the taker.\n /// If calling a cancel function, this address will represent the maker.\n /// @return Signer of 0x transaction if entry point is `executeTransaction`.\n /// `msg.sender` if entry point is any other function.\n function getCurrentContextAddress()\n internal\n view\n returns (address)\n {\n address currentContextAddress_ = currentContextAddress;\n address contextAddress = currentContextAddress_ == address(0) ? msg.sender : currentContextAddress_;\n return contextAddress;\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./libs/LibAbiEncoder.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MWrapperFunctions.sol\";\n\n\ncontract MixinWrapperFunctions is\n ReentrancyGuard,\n LibMath,\n LibFillResults,\n LibAbiEncoder,\n MExchangeCore,\n MWrapperFunctions\n{\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n nonReentrant\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrKillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n return fillResults;\n }\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (FillResults memory fillResults)\n {\n // ABI encode calldata for `fillOrder`\n bytes memory fillOrderCalldata = abiEncodeFillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n\n // Delegate to `fillOrder` and handle any exceptions gracefully\n assembly {\n let success := delegatecall(\n gas, // forward all gas\n address, // call address of this contract\n add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes)\n mload(fillOrderCalldata), // length of input\n fillOrderCalldata, // write output over input\n 128 // output size is 128 bytes\n )\n if success {\n mstore(fillResults, mload(fillOrderCalldata))\n mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32)))\n mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64)))\n mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96)))\n }\n }\n // fillResults values will be 0 by default if call was unsuccessful\n return fillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrKill.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrKillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrKillOrderInternal(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrders(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n bytes memory takerAssetData = orders[0].takerAssetData;\n \n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being sold by taker is the same for each order.\n // Rather than passing this in as calldata, we use the takerAssetData from the first order in all later orders.\n orders[i].takerAssetData = takerAssetData;\n\n // Calculate the remaining amount of takerAsset to sell\n uint256 remainingTakerAssetFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= takerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory takerAssetData = orders[0].takerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being sold by taker is the same for each order.\n // Rather than passing this in as calldata, we use the takerAssetData from the first order in all later orders.\n orders[i].takerAssetData = takerAssetData;\n\n // Calculate the remaining amount of takerAsset to sell\n uint256 remainingTakerAssetFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= takerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerAsset is bought by taker.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrders(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // Rather than passing this in as calldata, we copy the makerAssetData from the first order onto all later orders.\n orders[i].makerAssetData = makerAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n if (totalFillResults.makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // Rather than passing this in as calldata, we copy the makerAssetData from the first order onto all later orders.\n orders[i].makerAssetData = makerAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n if (totalFillResults.makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously cancels multiple orders in a single transaction.\n /// @param orders Array of order specifications.\n function batchCancelOrders(LibOrder.Order[] memory orders)\n public\n nonReentrant\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n cancelOrderInternal(orders[i]);\n }\n }\n\n /// @dev Fetches information for all passed in orders.\n /// @param orders Array of order specifications.\n /// @return Array of OrderInfo instances that correspond to each order.\n function getOrdersInfo(LibOrder.Order[] memory orders)\n public\n view\n returns (LibOrder.OrderInfo[] memory)\n {\n uint256 ordersLength = orders.length;\n LibOrder.OrderInfo[] memory ordersInfo = new LibOrder.OrderInfo[](ordersLength);\n for (uint256 i = 0; i != ordersLength; i++) {\n ordersInfo[i] = getOrderInfo(orders[i]);\n }\n return ordersInfo;\n }\n\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n require(\n fillResults.takerAssetFilledAmount == takerAssetFillAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return fillResults;\n }\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IAssetProxyDispatcher {\n\n /// @dev Registers an asset proxy to its asset proxy id.\n /// Once an asset proxy is registered, it cannot be unregistered.\n /// @param assetProxy Address of new asset proxy to register.\n function registerAssetProxy(address assetProxy)\n external;\n\n /// @dev Gets an asset proxy.\n /// @param assetProxyId Id of the asset proxy.\n /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered.\n function getAssetProxy(bytes4 assetProxyId)\n external\n view\n returns (address);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IExchange.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./IExchangeCore.sol\";\nimport \"./IMatchOrders.sol\";\nimport \"./ISignatureValidator.sol\";\nimport \"./ITransactions.sol\";\nimport \"./IAssetProxyDispatcher.sol\";\nimport \"./IWrapperFunctions.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract IExchange is\n IExchangeCore,\n IMatchOrders,\n ISignatureValidator,\n ITransactions,\n IAssetProxyDispatcher,\n IWrapperFunctions\n{}\n",
- "2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IExchangeCore {\n\n /// @dev Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch\n /// and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress).\n /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled.\n function cancelOrdersUpTo(uint256 targetOrderEpoch)\n external;\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev After calling, the order can not be filled anymore.\n /// @param order Order struct containing order specifications.\n function cancelOrder(LibOrder.Order memory order)\n public;\n\n /// @dev Gets information about an order: status, hash, and amount filled.\n /// @param order Order to gather information on.\n /// @return OrderInfo Information about the order and its state.\n /// See LibOrder.OrderInfo for a complete description.\n function getOrderInfo(LibOrder.Order memory order)\n public\n view\n returns (LibOrder.OrderInfo memory orderInfo);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IMatchOrders {\n\n /// @dev Match two complementary orders that have a profitable spread.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the left order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftSignature Proof that order was created by the left maker.\n /// @param rightSignature Proof that order was created by the right maker.\n /// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.\n function matchOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n bytes memory leftSignature,\n bytes memory rightSignature\n )\n public\n returns (LibFillResults.MatchedFillResults memory matchedFillResults);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract ISignatureValidator {\n\n /// @dev Approves a hash on-chain using any valid signature type.\n /// After presigning a hash, the preSign signature type will become valid for that hash and signer.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n function preSign(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external;\n \n /// @dev Approves/unnapproves a Validator contract to verify signatures on signer's behalf.\n /// @param validatorAddress Address of Validator contract.\n /// @param approval Approval or disapproval of Validator contract.\n function setSignatureValidatorApproval(\n address validatorAddress,\n bool approval\n )\n external;\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signerAddress Address of signer.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes memory signature\n )\n public\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/ITransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\n\ncontract ITransactions {\n\n /// @dev Executes an exchange method call in the context of signer.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @param signature Proof of signer transaction by signer.\n function executeTransaction(\n uint256 salt,\n address signerAddress,\n bytes data,\n bytes signature\n )\n external;\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IValidator {\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IWallet.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IWallet {\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n bytes signature\n )\n external\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IWrapperFunctions {\n\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrKill.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrKillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrders(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerAsset is bought by taker.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrders(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously cancels multiple orders in a single transaction.\n /// @param orders Array of order specifications.\n function batchCancelOrders(LibOrder.Order[] memory orders)\n public;\n\n /// @dev Fetches information for all passed in orders\n /// @param orders Array of order specifications.\n /// @return Array of OrderInfo instances that correspond to each order.\n function getOrdersInfo(LibOrder.Order[] memory orders)\n public\n view\n returns (LibOrder.OrderInfo[] memory);\n}\n",
- "2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./LibOrder.sol\";\n\n\ncontract LibAbiEncoder {\n\n /// @dev ABI encodes calldata for `fillOrder`.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return ABI encoded calldata for `fillOrder`.\n function abiEncodeFillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n pure\n returns (bytes memory fillOrderCalldata)\n {\n // We need to call MExchangeCore.fillOrder using a delegatecall in\n // assembly so that we can intercept a call that throws. For this, we\n // need the input encoded in memory in the Ethereum ABIv2 format [1].\n\n // | Area | Offset | Length | Contents |\n // | -------- |--------|---------|-------------------------------------------- |\n // | Header | 0x00 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 0x00 | | 1. offset to order (*) |\n // | | 0x20 | | 2. takerAssetFillAmount |\n // | | 0x40 | | 3. offset to signature (*) |\n // | Data | | 12 * 32 | order: |\n // | | 0x000 | | 1. senderAddress |\n // | | 0x020 | | 2. makerAddress |\n // | | 0x040 | | 3. takerAddress |\n // | | 0x060 | | 4. feeRecipientAddress |\n // | | 0x080 | | 5. makerAssetAmount |\n // | | 0x0A0 | | 6. takerAssetAmount |\n // | | 0x0C0 | | 7. makerFeeAmount |\n // | | 0x0E0 | | 8. takerFeeAmount |\n // | | 0x100 | | 9. expirationTimeSeconds |\n // | | 0x120 | | 10. salt |\n // | | 0x140 | | 11. Offset to makerAssetData (*) |\n // | | 0x160 | | 12. Offset to takerAssetData (*) |\n // | | 0x180 | 32 | makerAssetData Length |\n // | | 0x1A0 | ** | makerAssetData Contents |\n // | | 0x1C0 | 32 | takerAssetData Length |\n // | | 0x1E0 | ** | takerAssetData Contents |\n // | | 0x200 | 32 | signature Length |\n // | | 0x220 | ** | signature Contents |\n\n // * Offsets are calculated from the beginning of the current area: Header, Params, Data:\n // An offset stored in the Params area is calculated from the beginning of the Params section.\n // An offset stored in the Data area is calculated from the beginning of the Data section.\n\n // ** The length of dynamic array contents are stored in the field immediately preceeding the contents.\n\n // [1]: https://solidity.readthedocs.io/en/develop/abi-spec.html\n\n assembly {\n\n // Areas below may use the following variables:\n // 1. <area>Start -- Start of this area in memory\n // 2. <area>End -- End of this area in memory. This value may\n // be precomputed (before writing contents),\n // or it may be computed as contents are written.\n // 3. <area>Offset -- Current offset into area. If an area's End\n // is precomputed, this variable tracks the\n // offsets of contents as they are written.\n\n /////// Setup Header Area ///////\n // Load free memory pointer\n fillOrderCalldata := mload(0x40)\n // bytes4(keccak256(\"fillOrder((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),uint256,bytes)\"))\n // = 0xb4be83d5\n // Leave 0x20 bytes to store the length\n mstore(add(fillOrderCalldata, 0x20), 0xb4be83d500000000000000000000000000000000000000000000000000000000)\n let headerAreaEnd := add(fillOrderCalldata, 0x24)\n\n /////// Setup Params Area ///////\n // This area is preallocated and written to later.\n // This is because we need to fill in offsets that have not yet been calculated.\n let paramsAreaStart := headerAreaEnd\n let paramsAreaEnd := add(paramsAreaStart, 0x60)\n let paramsAreaOffset := paramsAreaStart\n\n /////// Setup Data Area ///////\n let dataAreaStart := paramsAreaEnd\n let dataAreaEnd := dataAreaStart\n\n // Offset from the source data we're reading from\n let sourceOffset := order\n // arrayLenBytes and arrayLenWords track the length of a dynamically-allocated bytes array.\n let arrayLenBytes := 0\n let arrayLenWords := 0\n\n /////// Write order Struct ///////\n // Write memory location of Order, relative to the start of the\n // parameter list, then increment the paramsAreaOffset respectively.\n mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))\n paramsAreaOffset := add(paramsAreaOffset, 0x20)\n\n // Write values for each field in the order\n // It would be nice to use a loop, but we save on gas by writing\n // the stores sequentially.\n mstore(dataAreaEnd, mload(sourceOffset)) // makerAddress\n mstore(add(dataAreaEnd, 0x20), mload(add(sourceOffset, 0x20))) // takerAddress\n mstore(add(dataAreaEnd, 0x40), mload(add(sourceOffset, 0x40))) // feeRecipientAddress\n mstore(add(dataAreaEnd, 0x60), mload(add(sourceOffset, 0x60))) // senderAddress\n mstore(add(dataAreaEnd, 0x80), mload(add(sourceOffset, 0x80))) // makerAssetAmount\n mstore(add(dataAreaEnd, 0xA0), mload(add(sourceOffset, 0xA0))) // takerAssetAmount\n mstore(add(dataAreaEnd, 0xC0), mload(add(sourceOffset, 0xC0))) // makerFeeAmount\n mstore(add(dataAreaEnd, 0xE0), mload(add(sourceOffset, 0xE0))) // takerFeeAmount\n mstore(add(dataAreaEnd, 0x100), mload(add(sourceOffset, 0x100))) // expirationTimeSeconds\n mstore(add(dataAreaEnd, 0x120), mload(add(sourceOffset, 0x120))) // salt\n mstore(add(dataAreaEnd, 0x140), mload(add(sourceOffset, 0x140))) // Offset to makerAssetData\n mstore(add(dataAreaEnd, 0x160), mload(add(sourceOffset, 0x160))) // Offset to takerAssetData\n dataAreaEnd := add(dataAreaEnd, 0x180)\n sourceOffset := add(sourceOffset, 0x180)\n\n // Write offset to <order.makerAssetData>\n mstore(add(dataAreaStart, mul(10, 0x20)), sub(dataAreaEnd, dataAreaStart))\n\n // Calculate length of <order.makerAssetData>\n sourceOffset := mload(add(order, 0x140)) // makerAssetData\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of <order.makerAssetData>\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of <order.makerAssetData>\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n // Write offset to <order.takerAssetData>\n mstore(add(dataAreaStart, mul(11, 0x20)), sub(dataAreaEnd, dataAreaStart))\n\n // Calculate length of <order.takerAssetData>\n sourceOffset := mload(add(order, 0x160)) // takerAssetData\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of <order.takerAssetData>\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of <order.takerAssetData>\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n /////// Write takerAssetFillAmount ///////\n mstore(paramsAreaOffset, takerAssetFillAmount)\n paramsAreaOffset := add(paramsAreaOffset, 0x20)\n\n /////// Write signature ///////\n // Write offset to paramsArea\n mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))\n\n // Calculate length of signature\n sourceOffset := signature\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of signature\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of signature\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n // Set length of calldata\n mstore(fillOrderCalldata, sub(dataAreaEnd, add(fillOrderCalldata, 0x20)))\n\n // Increment free memory pointer\n mstore(0x40, dataAreaEnd)\n }\n\n return fillOrderCalldata;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibConstants.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\n// solhint-disable max-line-length\ncontract LibConstants {\n \n // Asset data for ZRX token. Used for fee transfers.\n // @TODO: Hardcode constant when we deploy. Currently \n // not constant to make testing easier.\n\n // The proxyId for ZRX_ASSET_DATA is bytes4(keccak256(\"ERC20Token(address)\")) = 0xf47261b0\n \n // Kovan ZRX address is 0x6ff6c0ff1d68b964901f986d4c9fa3ac68346570.\n // The ABI encoded proxyId and address is 0xf47261b00000000000000000000000006ff6c0ff1d68b964901f986d4c9fa3ac68346570\n // bytes constant public ZRX_ASSET_DATA = \"\\xf4\\x72\\x61\\xb0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x6f\\xf6\\xc0\\xff\\x1d\\x68\\xb9\\x64\\x90\\x1f\\x98\\x6d\\x4c\\x9f\\xa3\\xac\\x68\\x34\\x65\\x70\";\n \n // Mainnet ZRX address is 0xe41d2489571d322189246dafa5ebde1f4699f498.\n // The ABI encoded proxyId and address is 0xf47261b0000000000000000000000000e41d2489571d322189246dafa5ebde1f4699f498\n // bytes constant public ZRX_ASSET_DATA = \"\\xf4\\x72\\x61\\xb0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xe4\\x1d\\x24\\x89\\x57\\x1d\\x32\\x21\\x89\\x24\\x6d\\xaf\\xa5\\xeb\\xde\\x1f\\x46\\x99\\xf4\\x98\";\n \n // solhint-disable-next-line var-name-mixedcase\n bytes public ZRX_ASSET_DATA;\n\n // @TODO: Remove when we deploy.\n constructor (bytes memory zrxAssetData)\n public\n {\n ZRX_ASSET_DATA = zrxAssetData;\n }\n}\n// solhint-enable max-line-length\n",
- "2.0.0/protocol/Exchange/libs/LibEIP712.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract LibEIP712 {\n\n // EIP191 header for EIP712 prefix\n string constant internal EIP191_HEADER = \"\\x19\\x01\";\n\n // EIP712 Domain Name value\n string constant internal EIP712_DOMAIN_NAME = \"0x Protocol\";\n\n // EIP712 Domain Version value\n string constant internal EIP712_DOMAIN_VERSION = \"2\";\n\n // Hash of the EIP712 Domain Separator Schema\n bytes32 constant internal EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"EIP712Domain(\",\n \"string name,\",\n \"string version,\",\n \"address verifyingContract\",\n \")\"\n ));\n\n // Hash of the EIP712 Domain Separator data\n // solhint-disable-next-line var-name-mixedcase\n bytes32 public EIP712_DOMAIN_HASH;\n\n constructor ()\n public\n {\n EIP712_DOMAIN_HASH = keccak256(abi.encodePacked(\n EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH,\n keccak256(bytes(EIP712_DOMAIN_NAME)),\n keccak256(bytes(EIP712_DOMAIN_VERSION)),\n bytes32(address(this))\n ));\n }\n\n /// @dev Calculates EIP712 encoding for a hash struct in this EIP712 Domain.\n /// @param hashStruct The EIP712 hash struct.\n /// @return EIP712 hash applied to this EIP712 Domain.\n function hashEIP712Message(bytes32 hashStruct)\n internal\n view\n returns (bytes32 result)\n {\n bytes32 eip712DomainHash = EIP712_DOMAIN_HASH;\n\n // Assembly for more efficient computing:\n // keccak256(abi.encodePacked(\n // EIP191_HEADER,\n // EIP712_DOMAIN_HASH,\n // hashStruct \n // ));\n\n assembly {\n // Load free memory pointer\n let memPtr := mload(64)\n\n mstore(memPtr, 0x1901000000000000000000000000000000000000000000000000000000000000) // EIP191 header\n mstore(add(memPtr, 2), eip712DomainHash) // EIP712 domain hash\n mstore(add(memPtr, 34), hashStruct) // Hash of struct\n\n // Compute hash\n result := keccak256(memPtr, 66)\n }\n return result;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\n// solhint-disable\npragma solidity 0.4.24;\n\n\n/// @dev This contract documents the revert reasons used in the Exchange contract.\n/// This contract is intended to serve as a reference, but is not actually used for efficiency reasons.\ncontract LibExchangeErrors {\n\n /// Order validation errors ///\n string constant ORDER_UNFILLABLE = \"ORDER_UNFILLABLE\"; // Order cannot be filled.\n string constant INVALID_MAKER = \"INVALID_MAKER\"; // Invalid makerAddress.\n string constant INVALID_TAKER = \"INVALID_TAKER\"; // Invalid takerAddress.\n string constant INVALID_SENDER = \"INVALID_SENDER\"; // Invalid `msg.sender`.\n string constant INVALID_ORDER_SIGNATURE = \"INVALID_ORDER_SIGNATURE\"; // Signature validation failed. \n \n /// fillOrder validation errors ///\n string constant INVALID_TAKER_AMOUNT = \"INVALID_TAKER_AMOUNT\"; // takerAssetFillAmount cannot equal 0.\n string constant ROUNDING_ERROR = \"ROUNDING_ERROR\"; // Rounding error greater than 0.1% of takerAssetFillAmount. \n \n /// Signature validation errors ///\n string constant INVALID_SIGNATURE = \"INVALID_SIGNATURE\"; // Signature validation failed. \n string constant SIGNATURE_ILLEGAL = \"SIGNATURE_ILLEGAL\"; // Signature type is illegal.\n string constant SIGNATURE_UNSUPPORTED = \"SIGNATURE_UNSUPPORTED\"; // Signature type unsupported.\n \n /// cancelOrdersUptTo errors ///\n string constant INVALID_NEW_ORDER_EPOCH = \"INVALID_NEW_ORDER_EPOCH\"; // Specified salt must be greater than or equal to existing orderEpoch.\n\n /// fillOrKillOrder errors ///\n string constant COMPLETE_FILL_FAILED = \"COMPLETE_FILL_FAILED\"; // Desired takerAssetFillAmount could not be completely filled. \n\n /// matchOrders errors ///\n string constant NEGATIVE_SPREAD_REQUIRED = \"NEGATIVE_SPREAD_REQUIRED\"; // Matched orders must have a negative spread.\n\n /// Transaction errors ///\n string constant REENTRANCY_ILLEGAL = \"REENTRANCY_ILLEGAL\"; // Recursive reentrancy is not allowed. \n string constant INVALID_TX_HASH = \"INVALID_TX_HASH\"; // Transaction has already been executed. \n string constant INVALID_TX_SIGNATURE = \"INVALID_TX_SIGNATURE\"; // Signature validation failed. \n string constant FAILED_EXECUTION = \"FAILED_EXECUTION\"; // Transaction execution failed. \n \n /// registerAssetProxy errors ///\n string constant ASSET_PROXY_ALREADY_EXISTS = \"ASSET_PROXY_ALREADY_EXISTS\"; // AssetProxy with same id already exists.\n\n /// dispatchTransferFrom errors ///\n string constant ASSET_PROXY_DOES_NOT_EXIST = \"ASSET_PROXY_DOES_NOT_EXIST\"; // No assetProxy registered at given id.\n string constant TRANSFER_FAILED = \"TRANSFER_FAILED\"; // Asset transfer unsuccesful.\n\n /// Length validation errors ///\n string constant LENGTH_GREATER_THAN_0_REQUIRED = \"LENGTH_GREATER_THAN_0_REQUIRED\"; // Byte array must have a length greater than 0.\n string constant LENGTH_GREATER_THAN_3_REQUIRED = \"LENGTH_GREATER_THAN_3_REQUIRED\"; // Byte array must have a length greater than 3.\n string constant LENGTH_0_REQUIRED = \"LENGTH_0_REQUIRED\"; // Byte array must have a length of 0.\n string constant LENGTH_65_REQUIRED = \"LENGTH_65_REQUIRED\"; // Byte array must have a length of 65.\n}\n",
- "2.0.0/protocol/Exchange/libs/LibFillResults.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract LibFillResults is\n SafeMath\n{\n struct FillResults {\n uint256 makerAssetFilledAmount; // Total amount of makerAsset(s) filled.\n uint256 takerAssetFilledAmount; // Total amount of takerAsset(s) filled.\n uint256 makerFeePaid; // Total amount of ZRX paid by maker(s) to feeRecipient(s).\n uint256 takerFeePaid; // Total amount of ZRX paid by taker to feeRecipients(s).\n }\n\n struct MatchedFillResults {\n FillResults left; // Amounts filled and fees paid of left order.\n FillResults right; // Amounts filled and fees paid of right order.\n uint256 leftMakerAssetSpreadAmount; // Spread between price of left and right order, denominated in the left order's makerAsset, paid to taker.\n }\n\n /// @dev Adds properties of both FillResults instances.\n /// Modifies the first FillResults instance specified.\n /// @param totalFillResults Fill results instance that will be added onto.\n /// @param singleFillResults Fill results instance that will be added to totalFillResults.\n function addFillResults(FillResults memory totalFillResults, FillResults memory singleFillResults)\n internal\n pure\n {\n totalFillResults.makerAssetFilledAmount = safeAdd(totalFillResults.makerAssetFilledAmount, singleFillResults.makerAssetFilledAmount);\n totalFillResults.takerAssetFilledAmount = safeAdd(totalFillResults.takerAssetFilledAmount, singleFillResults.takerAssetFilledAmount);\n totalFillResults.makerFeePaid = safeAdd(totalFillResults.makerFeePaid, singleFillResults.makerFeePaid);\n totalFillResults.takerFeePaid = safeAdd(totalFillResults.takerFeePaid, singleFillResults.takerFeePaid);\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibMath.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract LibMath is\n SafeMath\n{\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// Reverts if rounding error is >= 0.1%\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded down.\n function safeGetPartialAmountFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n require(\n !isRoundingErrorFloor(\n numerator,\n denominator,\n target\n ),\n \"ROUNDING_ERROR\"\n );\n \n partialAmount = safeDiv(\n safeMul(numerator, target),\n denominator\n );\n return partialAmount;\n }\n\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// Reverts if rounding error is >= 0.1%\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded up.\n function safeGetPartialAmountCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n require(\n !isRoundingErrorCeil(\n numerator,\n denominator,\n target\n ),\n \"ROUNDING_ERROR\"\n );\n \n // safeDiv computes `floor(a / b)`. We use the identity (a, b integer):\n // ceil(a / b) = floor((a + b - 1) / b)\n // To implement `ceil(a / b)` using safeDiv.\n partialAmount = safeDiv(\n safeAdd(\n safeMul(numerator, target),\n safeSub(denominator, 1)\n ),\n denominator\n );\n return partialAmount;\n }\n\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded down.\n function getPartialAmountFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n partialAmount = safeDiv(\n safeMul(numerator, target),\n denominator\n );\n return partialAmount;\n }\n \n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded up.\n function getPartialAmountCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n // safeDiv computes `floor(a / b)`. We use the identity (a, b integer):\n // ceil(a / b) = floor((a + b - 1) / b)\n // To implement `ceil(a / b)` using safeDiv.\n partialAmount = safeDiv(\n safeAdd(\n safeMul(numerator, target),\n safeSub(denominator, 1)\n ),\n denominator\n );\n return partialAmount;\n }\n \n /// @dev Checks if rounding error >= 0.1% when rounding down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to multiply with numerator/denominator.\n /// @return Rounding error is present.\n function isRoundingErrorFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (bool isError)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n \n // The absolute rounding error is the difference between the rounded\n // value and the ideal value. The relative rounding error is the\n // absolute rounding error divided by the absolute value of the\n // ideal value. This is undefined when the ideal value is zero.\n //\n // The ideal value is `numerator * target / denominator`.\n // Let's call `numerator * target % denominator` the remainder.\n // The absolute error is `remainder / denominator`.\n //\n // When the ideal value is zero, we require the absolute error to\n // be zero. Fortunately, this is always the case. The ideal value is\n // zero iff `numerator == 0` and/or `target == 0`. In this case the\n // remainder and absolute error are also zero. \n if (target == 0 || numerator == 0) {\n return false;\n }\n \n // Otherwise, we want the relative rounding error to be strictly\n // less than 0.1%.\n // The relative error is `remainder / (numerator * target)`.\n // We want the relative error less than 1 / 1000:\n // remainder / (numerator * denominator) < 1 / 1000\n // or equivalently:\n // 1000 * remainder < numerator * target\n // so we have a rounding error iff:\n // 1000 * remainder >= numerator * target\n uint256 remainder = mulmod(\n target,\n numerator,\n denominator\n );\n isError = safeMul(1000, remainder) >= safeMul(numerator, target);\n return isError;\n }\n \n /// @dev Checks if rounding error >= 0.1% when rounding up.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to multiply with numerator/denominator.\n /// @return Rounding error is present.\n function isRoundingErrorCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (bool isError)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n \n // See the comments in `isRoundingError`.\n if (target == 0 || numerator == 0) {\n // When either is zero, the ideal value and rounded value are zero\n // and there is no rounding error. (Although the relative error\n // is undefined.)\n return false;\n }\n // Compute remainder as before\n uint256 remainder = mulmod(\n target,\n numerator,\n denominator\n );\n remainder = safeSub(denominator, remainder) % denominator;\n isError = safeMul(1000, remainder) >= safeMul(numerator, target);\n return isError;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibOrder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./LibEIP712.sol\";\n\n\ncontract LibOrder is\n LibEIP712\n{\n // Hash for the EIP712 Order Schema\n bytes32 constant internal EIP712_ORDER_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"Order(\",\n \"address makerAddress,\",\n \"address takerAddress,\",\n \"address feeRecipientAddress,\",\n \"address senderAddress,\",\n \"uint256 makerAssetAmount,\",\n \"uint256 takerAssetAmount,\",\n \"uint256 makerFee,\",\n \"uint256 takerFee,\",\n \"uint256 expirationTimeSeconds,\",\n \"uint256 salt,\",\n \"bytes makerAssetData,\",\n \"bytes takerAssetData\",\n \")\"\n ));\n\n // A valid order remains fillable until it is expired, fully filled, or cancelled.\n // An order's state is unaffected by external factors, like account balances.\n enum OrderStatus {\n INVALID, // Default value\n INVALID_MAKER_ASSET_AMOUNT, // Order does not have a valid maker asset amount\n INVALID_TAKER_ASSET_AMOUNT, // Order does not have a valid taker asset amount\n FILLABLE, // Order is fillable\n EXPIRED, // Order has already expired\n FULLY_FILLED, // Order is fully filled\n CANCELLED // Order has been cancelled\n }\n\n // solhint-disable max-line-length\n struct Order {\n address makerAddress; // Address that created the order. \n address takerAddress; // Address that is allowed to fill the order. If set to 0, any address is allowed to fill the order. \n address feeRecipientAddress; // Address that will recieve fees when order is filled. \n address senderAddress; // Address that is allowed to call Exchange contract methods that affect this order. If set to 0, any address is allowed to call these methods.\n uint256 makerAssetAmount; // Amount of makerAsset being offered by maker. Must be greater than 0. \n uint256 takerAssetAmount; // Amount of takerAsset being bid on by maker. Must be greater than 0. \n uint256 makerFee; // Amount of ZRX paid to feeRecipient by maker when order is filled. If set to 0, no transfer of ZRX from maker to feeRecipient will be attempted.\n uint256 takerFee; // Amount of ZRX paid to feeRecipient by taker when order is filled. If set to 0, no transfer of ZRX from taker to feeRecipient will be attempted.\n uint256 expirationTimeSeconds; // Timestamp in seconds at which order expires. \n uint256 salt; // Arbitrary number to facilitate uniqueness of the order's hash. \n bytes makerAssetData; // Encoded data that can be decoded by a specified proxy contract when transferring makerAsset. The last byte references the id of this proxy.\n bytes takerAssetData; // Encoded data that can be decoded by a specified proxy contract when transferring takerAsset. The last byte references the id of this proxy.\n }\n // solhint-enable max-line-length\n\n struct OrderInfo {\n uint8 orderStatus; // Status that describes order's validity and fillability.\n bytes32 orderHash; // EIP712 hash of the order (see LibOrder.getOrderHash).\n uint256 orderTakerAssetFilledAmount; // Amount of order that has already been filled.\n }\n\n /// @dev Calculates Keccak-256 hash of the order.\n /// @param order The order structure.\n /// @return Keccak-256 EIP712 hash of the order.\n function getOrderHash(Order memory order)\n internal\n view\n returns (bytes32 orderHash)\n {\n orderHash = hashEIP712Message(hashOrder(order));\n return orderHash;\n }\n\n /// @dev Calculates EIP712 hash of the order.\n /// @param order The order structure.\n /// @return EIP712 hash of the order.\n function hashOrder(Order memory order)\n internal\n pure\n returns (bytes32 result)\n {\n bytes32 schemaHash = EIP712_ORDER_SCHEMA_HASH;\n bytes32 makerAssetDataHash = keccak256(order.makerAssetData);\n bytes32 takerAssetDataHash = keccak256(order.takerAssetData);\n\n // Assembly for more efficiently computing:\n // keccak256(abi.encodePacked(\n // EIP712_ORDER_SCHEMA_HASH,\n // bytes32(order.makerAddress),\n // bytes32(order.takerAddress),\n // bytes32(order.feeRecipientAddress),\n // bytes32(order.senderAddress),\n // order.makerAssetAmount,\n // order.takerAssetAmount,\n // order.makerFee,\n // order.takerFee,\n // order.expirationTimeSeconds,\n // order.salt,\n // keccak256(order.makerAssetData),\n // keccak256(order.takerAssetData)\n // ));\n\n assembly {\n // Calculate memory addresses that will be swapped out before hashing\n let pos1 := sub(order, 32)\n let pos2 := add(order, 320)\n let pos3 := add(order, 352)\n\n // Backup\n let temp1 := mload(pos1)\n let temp2 := mload(pos2)\n let temp3 := mload(pos3)\n \n // Hash in place\n mstore(pos1, schemaHash)\n mstore(pos2, makerAssetDataHash)\n mstore(pos3, takerAssetDataHash)\n result := keccak256(pos1, 416)\n \n // Restore\n mstore(pos1, temp1)\n mstore(pos2, temp2)\n mstore(pos3, temp3)\n }\n return result;\n }\n}\n",
- "2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAssetProxyDispatcher.sol\";\n\n\ncontract MAssetProxyDispatcher is\n IAssetProxyDispatcher\n{\n // Logs registration of new asset proxy\n event AssetProxyRegistered(\n bytes4 id, // Id of new registered AssetProxy.\n address assetProxy // Address of new registered AssetProxy.\n );\n\n /// @dev Forwards arguments to assetProxy and calls `transferFrom`. Either succeeds or throws.\n /// @param assetData Byte array encoded for the asset.\n /// @param from Address to transfer token from.\n /// @param to Address to transfer token to.\n /// @param amount Amount of token to transfer.\n function dispatchTransferFrom(\n bytes memory assetData,\n address from,\n address to,\n uint256 amount\n )\n internal;\n}\n",
- "2.0.0/protocol/Exchange/mixins/MExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IExchangeCore.sol\";\n\n\ncontract MExchangeCore is\n IExchangeCore\n{\n // Fill event is emitted whenever an order is filled.\n event Fill(\n address indexed makerAddress, // Address that created the order. \n address indexed feeRecipientAddress, // Address that received fees.\n address takerAddress, // Address that filled the order.\n address senderAddress, // Address that called the Exchange contract (msg.sender).\n uint256 makerAssetFilledAmount, // Amount of makerAsset sold by maker and bought by taker. \n uint256 takerAssetFilledAmount, // Amount of takerAsset sold by taker and bought by maker.\n uint256 makerFeePaid, // Amount of ZRX paid to feeRecipient by maker.\n uint256 takerFeePaid, // Amount of ZRX paid to feeRecipient by taker.\n bytes32 indexed orderHash, // EIP712 hash of order (see LibOrder.getOrderHash).\n bytes makerAssetData, // Encoded data specific to makerAsset. \n bytes takerAssetData // Encoded data specific to takerAsset.\n );\n\n // Cancel event is emitted whenever an individual order is cancelled.\n event Cancel(\n address indexed makerAddress, // Address that created the order. \n address indexed feeRecipientAddress, // Address that would have recieved fees if order was filled. \n address senderAddress, // Address that called the Exchange contract (msg.sender).\n bytes32 indexed orderHash, // EIP712 hash of order (see LibOrder.getOrderHash).\n bytes makerAssetData, // Encoded data specific to makerAsset. \n bytes takerAssetData // Encoded data specific to takerAsset.\n );\n\n // CancelUpTo event is emitted whenever `cancelOrdersUpTo` is executed succesfully.\n event CancelUpTo(\n address indexed makerAddress, // Orders cancelled must have been created by this address.\n address indexed senderAddress, // Orders cancelled must have a `senderAddress` equal to this address.\n uint256 orderEpoch // Orders with specified makerAddress and senderAddress with a salt less than this value are considered cancelled.\n );\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev After calling, the order can not be filled anymore.\n /// @param order Order struct containing order specifications.\n function cancelOrderInternal(LibOrder.Order memory order)\n internal;\n\n /// @dev Updates state with results of a fill order.\n /// @param order that was filled.\n /// @param takerAddress Address of taker who filled the order.\n /// @param orderTakerAssetFilledAmount Amount of order already filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function updateFilledState(\n LibOrder.Order memory order,\n address takerAddress,\n bytes32 orderHash,\n uint256 orderTakerAssetFilledAmount,\n LibFillResults.FillResults memory fillResults\n )\n internal;\n\n /// @dev Updates state with results of cancelling an order.\n /// State is only updated if the order is currently fillable.\n /// Otherwise, updating state would have no effect.\n /// @param order that was cancelled.\n /// @param orderHash Hash of order that was cancelled.\n function updateCancelledState(\n LibOrder.Order memory order,\n bytes32 orderHash\n )\n internal;\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAddress Address of order taker.\n /// @param signature Proof that the orders was created by its maker.\n function assertFillableOrder(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo,\n address takerAddress,\n bytes memory signature\n )\n internal\n view;\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo Status, orderHash, and amount already filled of order.\n /// @param takerAssetFillAmount Desired amount of order to fill by taker.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @param makerAssetFilledAmount Amount of makerAsset that will be transfered.\n function assertValidFill(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo,\n uint256 takerAssetFillAmount,\n uint256 takerAssetFilledAmount,\n uint256 makerAssetFilledAmount\n )\n internal\n view;\n\n /// @dev Validates context for cancelOrder. Succeeds or throws.\n /// @param order to be cancelled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n function assertValidCancel(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo\n )\n internal\n view;\n\n /// @dev Calculates amounts filled and fees paid by maker and taker.\n /// @param order to be filled.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function calculateFillResults(\n LibOrder.Order memory order,\n uint256 takerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.FillResults memory fillResults);\n\n}\n",
- "2.0.0/protocol/Exchange/mixins/MMatchOrders.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IMatchOrders.sol\";\n\n\ncontract MMatchOrders is\n IMatchOrders\n{\n /// @dev Validates context for matchOrders. Succeeds or throws.\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n function assertValidMatch(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder\n )\n internal\n pure;\n\n /// @dev Calculates fill amounts for the matched orders.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the leftOrder order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftOrderTakerAssetFilledAmount Amount of left order already filled.\n /// @param rightOrderTakerAssetFilledAmount Amount of right order already filled.\n /// @param matchedFillResults Amounts to fill and fees to pay by maker and taker of matched orders.\n function calculateMatchedFillResults(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n uint256 leftOrderTakerAssetFilledAmount,\n uint256 rightOrderTakerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.MatchedFillResults memory matchedFillResults);\n\n}\n",
- "2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/ISignatureValidator.sol\";\n\n\ncontract MSignatureValidator is\n ISignatureValidator\n{\n event SignatureValidatorApproval(\n address indexed signerAddress, // Address that approves or disapproves a contract to verify signatures.\n address indexed validatorAddress, // Address of signature validator contract.\n bool approved // Approval or disapproval of validator contract.\n );\n\n // Allowed signature types.\n enum SignatureType {\n Illegal, // 0x00, default value\n Invalid, // 0x01\n EIP712, // 0x02\n EthSign, // 0x03\n Wallet, // 0x04\n Validator, // 0x05\n PreSigned, // 0x06\n NSignatureTypes // 0x07, number of signature types. Always leave at end.\n }\n\n /// @dev Verifies signature using logic defined by Wallet contract.\n /// @param hash Any 32 byte hash.\n /// @param walletAddress Address that should have signed the given hash\n /// and defines its own signature verification method.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidWalletSignature(\n bytes32 hash,\n address walletAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid);\n\n /// @dev Verifies signature using logic defined by Validator contract.\n /// @param validatorAddress Address of validator contract.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidValidatorSignature(\n address validatorAddress,\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/mixins/MTransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\nimport \"../interfaces/ITransactions.sol\";\n\n\ncontract MTransactions is\n ITransactions\n{\n // Hash for the EIP712 ZeroEx Transaction Schema\n bytes32 constant internal EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"ZeroExTransaction(\",\n \"uint256 salt,\",\n \"address signerAddress,\",\n \"bytes data\",\n \")\"\n ));\n\n /// @dev Calculates EIP712 hash of the Transaction.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @return EIP712 hash of the Transaction.\n function hashZeroExTransaction(\n uint256 salt,\n address signerAddress,\n bytes memory data\n )\n internal\n pure\n returns (bytes32 result);\n\n /// @dev The current function will be called in the context of this address (either 0x transaction signer or `msg.sender`).\n /// If calling a fill function, this address will represent the taker.\n /// If calling a cancel function, this address will represent the maker.\n /// @return Signer of 0x transaction if entry point is `executeTransaction`.\n /// `msg.sender` if entry point is any other function.\n function getCurrentContextAddress()\n internal\n view\n returns (address);\n}\n",
- "2.0.0/protocol/Exchange/mixins/MWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IWrapperFunctions.sol\";\n\n\ncontract MWrapperFunctions is \n IWrapperFunctions\n{\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n}\n",
- "2.0.0/test/DummyERC20Token/DummyERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"../../tokens/ERC20Token/MintableERC20Token.sol\";\n\n\ncontract DummyERC20Token is \n Ownable,\n MintableERC20Token\n{\n string public name;\n string public symbol;\n uint256 public decimals;\n uint256 public constant MAX_MINT_AMOUNT = 10000000000000000000000;\n\n constructor (\n string _name,\n string _symbol,\n uint256 _decimals,\n uint256 _totalSupply\n )\n public\n {\n name = _name;\n symbol = _symbol;\n decimals = _decimals;\n _totalSupply = _totalSupply;\n balances[msg.sender] = _totalSupply;\n }\n\n /// @dev Sets the balance of target address\n /// @param _target Address or which balance will be updated\n /// @param _value New balance of target address\n function setBalance(address _target, uint256 _value)\n external\n onlyOwner\n {\n uint256 currBalance = balances[_target];\n if (_value < currBalance) {\n _totalSupply = safeSub(_totalSupply, safeSub(currBalance, _value));\n } else {\n _totalSupply = safeAdd(_totalSupply, safeSub(_value, currBalance));\n }\n balances[_target] = _value;\n }\n\n /// @dev Mints new tokens for sender\n /// @param _value Amount of tokens to mint\n function mint(uint256 _value)\n external\n {\n require(\n _value <= MAX_MINT_AMOUNT,\n \"VALUE_TOO_LARGE\"\n );\n\n _mint(msg.sender, _value);\n }\n}\n",
- "2.0.0/test/DummyERC721Token/DummyERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../tokens/ERC721Token/MintableERC721Token.sol\";\nimport \"../../utils/Ownable/Ownable.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract DummyERC721Token is\n Ownable,\n MintableERC721Token\n{\n string public name;\n string public symbol;\n\n constructor (\n string _name,\n string _symbol\n )\n public\n {\n name = _name;\n symbol = _symbol;\n }\n\n /// @dev Function to mint a new token\n /// Reverts if the given token ID already exists\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _tokenId ID of the token to be minted by the msg.sender \n function mint(address _to, uint256 _tokenId)\n external\n {\n _mint(_to, _tokenId);\n }\n\n /// @dev Function to burn a token\n /// Reverts if the given token ID doesn't exist or not called by contract owner\n /// @param _owner Owner of token with given token ID\n /// @param _tokenId ID of the token to be burned by the msg.sender\n function burn(address _owner, uint256 _tokenId)\n external\n onlyOwner\n {\n _burn(_owner, _tokenId);\n }\n}\n",
- "2.0.0/tokens/ERC20Token/ERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IERC20Token.sol\";\n\n\ncontract ERC20Token is\n IERC20Token\n{\n mapping (address => uint256) internal balances;\n mapping (address => mapping (address => uint256)) internal allowed;\n\n uint256 internal _totalSupply;\n\n /// @dev send `value` token to `to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transfer(address _to, uint256 _value)\n external\n returns (bool)\n {\n require(\n balances[msg.sender] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[msg.sender] -= _value;\n balances[_to] += _value;\n\n emit Transfer(\n msg.sender,\n _to,\n _value\n );\n\n return true;\n }\n\n /// @dev send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool)\n {\n require(\n balances[_from] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n allowed[_from][msg.sender] >= _value,\n \"ERC20_INSUFFICIENT_ALLOWANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[_to] += _value;\n balances[_from] -= _value;\n allowed[_from][msg.sender] -= _value;\n \n emit Transfer(\n _from,\n _to,\n _value\n );\n \n return true;\n }\n\n /// @dev `msg.sender` approves `_spender` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Always true if the call has enough gas to complete execution\n function approve(address _spender, uint256 _value)\n external\n returns (bool)\n {\n allowed[msg.sender][_spender] = _value;\n emit Approval(\n msg.sender,\n _spender,\n _value\n );\n return true;\n }\n\n /// @dev Query total supply of token\n /// @return Total supply of token\n function totalSupply()\n external\n view\n returns (uint256)\n {\n return _totalSupply;\n }\n\n /// @dev Query the balance of owner\n /// @param _owner The address from which the balance will be retrieved\n /// @return Balance of owner\n function balanceOf(address _owner)\n external\n view\n returns (uint256)\n {\n return balances[_owner];\n }\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender)\n external\n view\n returns (uint256)\n {\n return allowed[_owner][_spender];\n }\n}\n",
- "2.0.0/tokens/ERC20Token/IERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC20Token {\n\n // solhint-disable no-simple-event-func-name\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 _value\n );\n\n event Approval(\n address indexed _owner,\n address indexed _spender,\n uint256 _value\n );\n\n /// @dev send `value` token to `to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transfer(address _to, uint256 _value)\n external\n returns (bool);\n\n /// @dev send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool);\n \n /// @dev `msg.sender` approves `_spender` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Always true if the call has enough gas to complete execution\n function approve(address _spender, uint256 _value)\n external\n returns (bool);\n\n /// @dev Query total supply of token\n /// @return Total supply of token\n function totalSupply()\n external\n view\n returns (uint256);\n \n /// @param _owner The address from which the balance will be retrieved\n /// @return Balance of owner\n function balanceOf(address _owner)\n external\n view\n returns (uint256);\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender)\n external\n view\n returns (uint256);\n}\n",
- "2.0.0/tokens/ERC20Token/MintableERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/SafeMath/SafeMath.sol\";\nimport \"./UnlimitedAllowanceERC20Token.sol\";\n\n\ncontract MintableERC20Token is \n SafeMath,\n UnlimitedAllowanceERC20Token\n{\n /// @dev Mints new tokens\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _value Amount of tokens to mint\n function _mint(address _to, uint256 _value)\n internal\n {\n balances[_to] = safeAdd(_value, balances[_to]);\n _totalSupply = safeAdd(_totalSupply, _value);\n\n emit Transfer(\n address(0),\n _to,\n _value\n );\n }\n\n /// @dev Mints new tokens\n /// @param _owner Owner of tokens that will be burned\n /// @param _value Amount of tokens to burn\n function _burn(address _owner, uint256 _value)\n internal\n {\n balances[_owner] = safeSub(balances[_owner], _value);\n _totalSupply = safeSub(_totalSupply, _value);\n\n emit Transfer(\n _owner,\n address(0),\n _value\n );\n }\n}\n",
- "2.0.0/tokens/ERC20Token/UnlimitedAllowanceERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../ERC20Token/ERC20Token.sol\";\n\n\ncontract UnlimitedAllowanceERC20Token is\n ERC20Token\n{\n uint256 constant internal MAX_UINT = 2**256 - 1;\n\n /// @dev ERC20 transferFrom, modified such that an allowance of MAX_UINT represents an unlimited allowance. See https://github.com/ethereum/EIPs/issues/717\n /// @param _from Address to transfer from.\n /// @param _to Address to transfer to.\n /// @param _value Amount to transfer.\n /// @return Success of transfer.\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool)\n {\n uint256 allowance = allowed[_from][msg.sender];\n require(\n balances[_from] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n allowance >= _value,\n \"ERC20_INSUFFICIENT_ALLOWANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[_to] += _value;\n balances[_from] -= _value;\n if (allowance < MAX_UINT) {\n allowed[_from][msg.sender] -= _value;\n }\n\n emit Transfer(\n _from,\n _to,\n _value\n );\n\n return true;\n }\n}\n",
- "2.0.0/tokens/ERC721Token/ERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IERC721Token.sol\";\nimport \"./IERC721Receiver.sol\";\nimport \"../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract ERC721Token is\n IERC721Token,\n SafeMath\n{\n // Function selector for ERC721Receiver.onERC721Received\n // 0x150b7a02\n bytes4 constant internal ERC721_RECEIVED = bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"));\n\n // Mapping of tokenId => owner\n mapping (uint256 => address) internal owners;\n\n // Mapping of tokenId => approved address\n mapping (uint256 => address) internal approvals;\n\n // Mapping of owner => number of tokens owned\n mapping (address => uint256) internal balances;\n\n // Mapping of owner => operator => approved\n mapping (address => mapping (address => bool)) internal operatorApprovals;\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT. When transfer is complete, this function\n /// checks if `_to` is a smart contract (code size > 0). If so, it calls\n /// `onERC721Received` on `_to` and throws if the return value is not\n /// `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n /// @param _data Additional data with no specified format, sent in call to `_to`\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId,\n bytes _data\n )\n external\n {\n transferFrom(\n _from,\n _to,\n _tokenId\n );\n\n uint256 receiverCodeSize;\n assembly {\n receiverCodeSize := extcodesize(_to)\n }\n if (receiverCodeSize > 0) {\n bytes4 selector = IERC721Receiver(_to).onERC721Received(\n msg.sender,\n _from,\n _tokenId,\n _data\n );\n require(\n selector == ERC721_RECEIVED,\n \"ERC721_INVALID_SELECTOR\"\n );\n }\n }\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev This works identically to the other function with an extra data parameter,\n /// except this function just sets data to \"\".\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n external\n {\n transferFrom(\n _from,\n _to,\n _tokenId\n );\n\n uint256 receiverCodeSize;\n assembly {\n receiverCodeSize := extcodesize(_to)\n }\n if (receiverCodeSize > 0) {\n bytes4 selector = IERC721Receiver(_to).onERC721Received(\n msg.sender,\n _from,\n _tokenId,\n \"\"\n );\n require(\n selector == ERC721_RECEIVED,\n \"ERC721_INVALID_SELECTOR\"\n );\n }\n }\n\n /// @notice Change or reaffirm the approved address for an NFT\n /// @dev The zero address indicates there is no approved address.\n /// Throws unless `msg.sender` is the current NFT owner, or an authorized\n /// operator of the current owner.\n /// @param _approved The new approved NFT controller\n /// @param _tokenId The NFT to approve\n function approve(address _approved, uint256 _tokenId)\n external\n {\n address owner = ownerOf(_tokenId);\n require(\n msg.sender == owner || isApprovedForAll(owner, msg.sender),\n \"ERC721_INVALID_SENDER\"\n );\n\n approvals[_tokenId] = _approved;\n emit Approval(\n owner,\n _approved,\n _tokenId\n );\n }\n\n /// @notice Enable or disable approval for a third party (\"operator\") to manage\n /// all of `msg.sender`'s assets\n /// @dev Emits the ApprovalForAll event. The contract MUST allow\n /// multiple operators per owner.\n /// @param _operator Address to add to the set of authorized operators\n /// @param _approved True if the operator is approved, false to revoke approval\n function setApprovalForAll(address _operator, bool _approved)\n external\n {\n operatorApprovals[msg.sender][_operator] = _approved;\n emit ApprovalForAll(\n msg.sender,\n _operator,\n _approved\n );\n }\n \n /// @notice Count all NFTs assigned to an owner\n /// @dev NFTs assigned to the zero address are considered invalid, and this\n /// function throws for queries about the zero address.\n /// @param _owner An address for whom to query the balance\n /// @return The number of NFTs owned by `_owner`, possibly zero\n function balanceOf(address _owner)\n external\n view\n returns (uint256)\n {\n require(\n _owner != address(0),\n \"ERC721_ZERO_OWNER\"\n );\n return balances[_owner];\n }\n\n /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE\n /// TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE\n /// THEY MAY BE PERMANENTLY LOST\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function transferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n public\n {\n require(\n _to != address(0),\n \"ERC721_ZERO_TO_ADDRESS\"\n );\n\n address owner = ownerOf(_tokenId);\n require(\n _from == owner,\n \"ERC721_OWNER_MISMATCH\"\n );\n\n address spender = msg.sender;\n address approvedAddress = getApproved(_tokenId);\n require(\n spender == owner ||\n isApprovedForAll(owner, spender) ||\n approvedAddress == spender,\n \"ERC721_INVALID_SPENDER\"\n );\n\n if (approvedAddress != address(0)) {\n approvals[_tokenId] = address(0);\n }\n\n owners[_tokenId] = _to;\n balances[_from] = safeSub(balances[_from], 1);\n balances[_to] = safeAdd(balances[_to], 1);\n \n emit Transfer(\n _from,\n _to,\n _tokenId\n );\n }\n\n /// @notice Find the owner of an NFT\n /// @dev NFTs assigned to zero address are considered invalid, and queries\n /// about them do throw.\n /// @param _tokenId The identifier for an NFT\n /// @return The address of the owner of the NFT\n function ownerOf(uint256 _tokenId)\n public\n view\n returns (address)\n {\n address owner = owners[_tokenId];\n require(\n owner != address(0),\n \"ERC721_ZERO_OWNER\"\n );\n return owner;\n }\n\n /// @notice Get the approved address for a single NFT\n /// @dev Throws if `_tokenId` is not a valid NFT.\n /// @param _tokenId The NFT to find the approved address for\n /// @return The approved address for this NFT, or the zero address if there is none\n function getApproved(uint256 _tokenId)\n public\n view\n returns (address)\n {\n return approvals[_tokenId];\n }\n\n /// @notice Query if an address is an authorized operator for another address\n /// @param _owner The address that owns the NFTs\n /// @param _operator The address that acts on behalf of the owner\n /// @return True if `_operator` is an approved operator for `_owner`, false otherwise\n function isApprovedForAll(address _owner, address _operator)\n public\n view\n returns (bool)\n {\n return operatorApprovals[_owner][_operator];\n }\n}\n",
- "2.0.0/tokens/ERC721Token/IERC721Receiver.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC721Receiver {\n\n /// @notice Handle the receipt of an NFT\n /// @dev The ERC721 smart contract calls this function on the recipient\n /// after a `transfer`. This function MAY throw to revert and reject the\n /// transfer. Return of other than the magic value MUST result in the\n /// transaction being reverted.\n /// Note: the contract address is always the message sender.\n /// @param _operator The address which called `safeTransferFrom` function\n /// @param _from The address which previously owned the token\n /// @param _tokenId The NFT identifier which is being transferred\n /// @param _data Additional data with no specified format\n /// @return `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`\n /// unless throwing\n function onERC721Received(\n address _operator,\n address _from,\n uint256 _tokenId,\n bytes _data\n )\n external\n returns (bytes4);\n}\n",
- "2.0.0/tokens/ERC721Token/IERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC721Token {\n\n /// @dev This emits when ownership of any NFT changes by any mechanism.\n /// This event emits when NFTs are created (`from` == 0) and destroyed\n /// (`to` == 0). Exception: during contract creation, any number of NFTs\n /// may be created and assigned without emitting Transfer. At the time of\n /// any transfer, the approved address for that NFT (if any) is reset to none.\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 indexed _tokenId\n );\n\n /// @dev This emits when the approved address for an NFT is changed or\n /// reaffirmed. The zero address indicates there is no approved address.\n /// When a Transfer event emits, this also indicates that the approved\n /// address for that NFT (if any) is reset to none.\n event Approval(\n address indexed _owner,\n address indexed _approved,\n uint256 indexed _tokenId\n );\n\n /// @dev This emits when an operator is enabled or disabled for an owner.\n /// The operator can manage all NFTs of the owner.\n event ApprovalForAll(\n address indexed _owner,\n address indexed _operator,\n bool _approved\n );\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// perator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT. When transfer is complete, this function\n /// checks if `_to` is a smart contract (code size > 0). If so, it calls\n /// `onERC721Received` on `_to` and throws if the return value is not\n /// `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n /// @param _data Additional data with no specified format, sent in call to `_to`\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId,\n bytes _data\n )\n external;\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev This works identically to the other function with an extra data parameter,\n /// except this function just sets data to \"\".\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n external;\n\n /// @notice Change or reaffirm the approved address for an NFT\n /// @dev The zero address indicates there is no approved address.\n /// Throws unless `msg.sender` is the current NFT owner, or an authorized\n /// operator of the current owner.\n /// @param _approved The new approved NFT controller\n /// @param _tokenId The NFT to approve\n function approve(address _approved, uint256 _tokenId)\n external;\n\n /// @notice Enable or disable approval for a third party (\"operator\") to manage\n /// all of `msg.sender`'s assets\n /// @dev Emits the ApprovalForAll event. The contract MUST allow\n /// multiple operators per owner.\n /// @param _operator Address to add to the set of authorized operators\n /// @param _approved True if the operator is approved, false to revoke approval\n function setApprovalForAll(address _operator, bool _approved)\n external;\n\n /// @notice Count all NFTs assigned to an owner\n /// @dev NFTs assigned to the zero address are considered invalid, and this\n /// function throws for queries about the zero address.\n /// @param _owner An address for whom to query the balance\n /// @return The number of NFTs owned by `_owner`, possibly zero\n function balanceOf(address _owner)\n external\n view\n returns (uint256);\n\n /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE\n /// TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE\n /// THEY MAY BE PERMANENTLY LOST\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function transferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n public;\n\n /// @notice Find the owner of an NFT\n /// @dev NFTs assigned to zero address are considered invalid, and queries\n /// about them do throw.\n /// @param _tokenId The identifier for an NFT\n /// @return The address of the owner of the NFT\n function ownerOf(uint256 _tokenId)\n public\n view\n returns (address);\n\n /// @notice Get the approved address for a single NFT\n /// @dev Throws if `_tokenId` is not a valid NFT.\n /// @param _tokenId The NFT to find the approved address for\n /// @return The approved address for this NFT, or the zero address if there is none\n function getApproved(uint256 _tokenId) \n public\n view\n returns (address);\n \n /// @notice Query if an address is an authorized operator for another address\n /// @param _owner The address that owns the NFTs\n /// @param _operator The address that acts on behalf of the owner\n /// @return True if `_operator` is an approved operator for `_owner`, false otherwise\n function isApprovedForAll(address _owner, address _operator)\n public\n view\n returns (bool);\n}\n",
- "2.0.0/tokens/ERC721Token/MintableERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./ERC721Token.sol\";\n\n\ncontract MintableERC721Token is\n ERC721Token\n{\n /// @dev Function to mint a new token\n /// Reverts if the given token ID already exists\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _tokenId ID of the token to be minted by the msg.sender \n function _mint(address _to, uint256 _tokenId)\n internal\n {\n require(\n _to != address(0),\n \"ERC721_ZERO_TO_ADDRESS\"\n );\n\n address owner = owners[_tokenId];\n require(\n owner == address(0),\n \"ERC721_OWNER_ALREADY_EXISTS\"\n );\n\n owners[_tokenId] = _to;\n balances[_to] = safeAdd(balances[_to], 1);\n\n emit Transfer(\n address(0),\n _to,\n _tokenId\n );\n }\n\n /// @dev Function to burn a token\n /// Reverts if the given token ID doesn't exist\n /// @param _owner Owner of token with given token ID\n /// @param _tokenId ID of the token to be burned by the msg.sender\n function _burn(address _owner, uint256 _tokenId)\n internal\n {\n require(\n _owner != address(0),\n \"ERC721_ZERO_OWNER_ADDRESS\"\n );\n\n address owner = owners[_tokenId];\n require(\n owner == _owner,\n \"ERC721_OWNER_MISMATCH\"\n );\n\n owners[_tokenId] = address(0);\n balances[_owner] = safeSub(balances[_owner], 1);\n\n emit Transfer(\n _owner,\n address(0),\n _tokenId\n );\n }\n}\n",
- "2.0.0/tokens/EtherToken/IEtherToken.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../ERC20Token/IERC20Token.sol\";\n\n\ncontract IEtherToken is\n IERC20Token\n{\n function deposit()\n public\n payable;\n \n function withdraw(uint256 amount)\n public;\n}\n",
- "2.0.0/utils/LibBytes/LibBytes.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\nlibrary LibBytes {\n\n using LibBytes for bytes;\n\n /// @dev Gets the memory address for a byte array.\n /// @param input Byte array to lookup.\n /// @return memoryAddress Memory address of byte array. This\n /// points to the header of the byte array which contains\n /// the length.\n function rawAddress(bytes memory input)\n internal\n pure\n returns (uint256 memoryAddress)\n {\n assembly {\n memoryAddress := input\n }\n return memoryAddress;\n }\n \n /// @dev Gets the memory address for the contents of a byte array.\n /// @param input Byte array to lookup.\n /// @return memoryAddress Memory address of the contents of the byte array.\n function contentAddress(bytes memory input)\n internal\n pure\n returns (uint256 memoryAddress)\n {\n assembly {\n memoryAddress := add(input, 32)\n }\n return memoryAddress;\n }\n\n /// @dev Copies `length` bytes from memory location `source` to `dest`.\n /// @param dest memory address to copy bytes to.\n /// @param source memory address to copy bytes from.\n /// @param length number of bytes to copy.\n function memCopy(\n uint256 dest,\n uint256 source,\n uint256 length\n )\n internal\n pure\n {\n if (length < 32) {\n // Handle a partial word by reading destination and masking\n // off the bits we are interested in.\n // This correctly handles overlap, zero lengths and source == dest\n assembly {\n let mask := sub(exp(256, sub(32, length)), 1)\n let s := and(mload(source), not(mask))\n let d := and(mload(dest), mask)\n mstore(dest, or(s, d))\n }\n } else {\n // Skip the O(length) loop when source == dest.\n if (source == dest) {\n return;\n }\n\n // For large copies we copy whole words at a time. The final\n // word is aligned to the end of the range (instead of after the\n // previous) to handle partial words. So a copy will look like this:\n //\n // ####\n // ####\n // ####\n // ####\n //\n // We handle overlap in the source and destination range by\n // changing the copying direction. This prevents us from\n // overwriting parts of source that we still need to copy.\n //\n // This correctly handles source == dest\n //\n if (source > dest) {\n assembly {\n // We subtract 32 from `sEnd` and `dEnd` because it\n // is easier to compare with in the loop, and these\n // are also the addresses we need for copying the\n // last bytes.\n length := sub(length, 32)\n let sEnd := add(source, length)\n let dEnd := add(dest, length)\n\n // Remember the last 32 bytes of source\n // This needs to be done here and not after the loop\n // because we may have overwritten the last bytes in\n // source already due to overlap.\n let last := mload(sEnd)\n\n // Copy whole words front to back\n // Note: the first check is always true,\n // this could have been a do-while loop.\n // solhint-disable-next-line no-empty-blocks\n for {} lt(source, sEnd) {} {\n mstore(dest, mload(source))\n source := add(source, 32)\n dest := add(dest, 32)\n }\n \n // Write the last 32 bytes\n mstore(dEnd, last)\n }\n } else {\n assembly {\n // We subtract 32 from `sEnd` and `dEnd` because those\n // are the starting points when copying a word at the end.\n length := sub(length, 32)\n let sEnd := add(source, length)\n let dEnd := add(dest, length)\n\n // Remember the first 32 bytes of source\n // This needs to be done here and not after the loop\n // because we may have overwritten the first bytes in\n // source already due to overlap.\n let first := mload(source)\n\n // Copy whole words back to front\n // We use a signed comparisson here to allow dEnd to become\n // negative (happens when source and dest < 32). Valid\n // addresses in local memory will never be larger than\n // 2**255, so they can be safely re-interpreted as signed.\n // Note: the first check is always true,\n // this could have been a do-while loop.\n // solhint-disable-next-line no-empty-blocks\n for {} slt(dest, dEnd) {} {\n mstore(dEnd, mload(sEnd))\n sEnd := sub(sEnd, 32)\n dEnd := sub(dEnd, 32)\n }\n \n // Write the first 32 bytes\n mstore(dest, first)\n }\n }\n }\n }\n\n /// @dev Returns a slices from a byte array.\n /// @param b The byte array to take a slice from.\n /// @param from The starting index for the slice (inclusive).\n /// @param to The final index for the slice (exclusive).\n /// @return result The slice containing bytes at indices [from, to)\n function slice(\n bytes memory b,\n uint256 from,\n uint256 to\n )\n internal\n pure\n returns (bytes memory result)\n {\n require(\n from <= to,\n \"FROM_LESS_THAN_TO_REQUIRED\"\n );\n require(\n to < b.length,\n \"TO_LESS_THAN_LENGTH_REQUIRED\"\n );\n \n // Create a new bytes structure and copy contents\n result = new bytes(to - from);\n memCopy(\n result.contentAddress(),\n b.contentAddress() + from,\n result.length\n );\n return result;\n }\n \n /// @dev Returns a slice from a byte array without preserving the input.\n /// @param b The byte array to take a slice from. Will be destroyed in the process.\n /// @param from The starting index for the slice (inclusive).\n /// @param to The final index for the slice (exclusive).\n /// @return result The slice containing bytes at indices [from, to)\n /// @dev When `from == 0`, the original array will match the slice. In other cases its state will be corrupted.\n function sliceDestructive(\n bytes memory b,\n uint256 from,\n uint256 to\n )\n internal\n pure\n returns (bytes memory result)\n {\n require(\n from <= to,\n \"FROM_LESS_THAN_TO_REQUIRED\"\n );\n require(\n to < b.length,\n \"TO_LESS_THAN_LENGTH_REQUIRED\"\n );\n \n // Create a new bytes structure around [from, to) in-place.\n assembly {\n result := add(b, from)\n mstore(result, sub(to, from))\n }\n return result;\n }\n\n /// @dev Pops the last byte off of a byte array by modifying its length.\n /// @param b Byte array that will be modified.\n /// @return The byte that was popped off.\n function popLastByte(bytes memory b)\n internal\n pure\n returns (bytes1 result)\n {\n require(\n b.length > 0,\n \"GREATER_THAN_ZERO_LENGTH_REQUIRED\"\n );\n\n // Store last byte.\n result = b[b.length - 1];\n\n assembly {\n // Decrement length of byte array.\n let newLen := sub(mload(b), 1)\n mstore(b, newLen)\n }\n return result;\n }\n\n /// @dev Pops the last 20 bytes off of a byte array by modifying its length.\n /// @param b Byte array that will be modified.\n /// @return The 20 byte address that was popped off.\n function popLast20Bytes(bytes memory b)\n internal\n pure\n returns (address result)\n {\n require(\n b.length >= 20,\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Store last 20 bytes.\n result = readAddress(b, b.length - 20);\n\n assembly {\n // Subtract 20 from byte array length.\n let newLen := sub(mload(b), 20)\n mstore(b, newLen)\n }\n return result;\n }\n\n /// @dev Tests equality of two byte arrays.\n /// @param lhs First byte array to compare.\n /// @param rhs Second byte array to compare.\n /// @return True if arrays are the same. False otherwise.\n function equals(\n bytes memory lhs,\n bytes memory rhs\n )\n internal\n pure\n returns (bool equal)\n {\n // Keccak gas cost is 30 + numWords * 6. This is a cheap way to compare.\n // We early exit on unequal lengths, but keccak would also correctly\n // handle this.\n return lhs.length == rhs.length && keccak256(lhs) == keccak256(rhs);\n }\n\n /// @dev Reads an address from a position in a byte array.\n /// @param b Byte array containing an address.\n /// @param index Index in byte array of address.\n /// @return address from byte array.\n function readAddress(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (address result)\n {\n require(\n b.length >= index + 20, // 20 is length of address\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Add offset to index:\n // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)\n // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)\n index += 20;\n\n // Read address from array memory\n assembly {\n // 1. Add index to address of bytes array\n // 2. Load 32-byte word from memory\n // 3. Apply 20-byte mask to obtain address\n result := and(mload(add(b, index)), 0xffffffffffffffffffffffffffffffffffffffff)\n }\n return result;\n }\n\n /// @dev Writes an address into a specific position in a byte array.\n /// @param b Byte array to insert address into.\n /// @param index Index in byte array of address.\n /// @param input Address to put into byte array.\n function writeAddress(\n bytes memory b,\n uint256 index,\n address input\n )\n internal\n pure\n {\n require(\n b.length >= index + 20, // 20 is length of address\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Add offset to index:\n // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)\n // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)\n index += 20;\n\n // Store address into array memory\n assembly {\n // The address occupies 20 bytes and mstore stores 32 bytes.\n // First fetch the 32-byte word where we'll be storing the address, then\n // apply a mask so we have only the bytes in the word that the address will not occupy.\n // Then combine these bytes with the address and store the 32 bytes back to memory with mstore.\n\n // 1. Add index to address of bytes array\n // 2. Load 32-byte word from memory\n // 3. Apply 12-byte mask to obtain extra bytes occupying word of memory where we'll store the address\n let neighbors := and(\n mload(add(b, index)),\n 0xffffffffffffffffffffffff0000000000000000000000000000000000000000\n )\n \n // Make sure input address is clean.\n // (Solidity does not guarantee this)\n input := and(input, 0xffffffffffffffffffffffffffffffffffffffff)\n\n // Store the neighbors and address into memory\n mstore(add(b, index), xor(input, neighbors))\n }\n }\n\n /// @dev Reads a bytes32 value from a position in a byte array.\n /// @param b Byte array containing a bytes32 value.\n /// @param index Index in byte array of bytes32 value.\n /// @return bytes32 value from byte array.\n function readBytes32(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes32 result)\n {\n require(\n b.length >= index + 32,\n \"GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 256 bit length parameter\n index += 32;\n\n // Read the bytes32 from array memory\n assembly {\n result := mload(add(b, index))\n }\n return result;\n }\n\n /// @dev Writes a bytes32 into a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input bytes32 to put into byte array.\n function writeBytes32(\n bytes memory b,\n uint256 index,\n bytes32 input\n )\n internal\n pure\n {\n require(\n b.length >= index + 32,\n \"GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 256 bit length parameter\n index += 32;\n\n // Read the bytes32 from array memory\n assembly {\n mstore(add(b, index), input)\n }\n }\n\n /// @dev Reads a uint256 value from a position in a byte array.\n /// @param b Byte array containing a uint256 value.\n /// @param index Index in byte array of uint256 value.\n /// @return uint256 value from byte array.\n function readUint256(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (uint256 result)\n {\n result = uint256(readBytes32(b, index));\n return result;\n }\n\n /// @dev Writes a uint256 into a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input uint256 to put into byte array.\n function writeUint256(\n bytes memory b,\n uint256 index,\n uint256 input\n )\n internal\n pure\n {\n writeBytes32(b, index, bytes32(input));\n }\n\n /// @dev Reads an unpadded bytes4 value from a position in a byte array.\n /// @param b Byte array containing a bytes4 value.\n /// @param index Index in byte array of bytes4 value.\n /// @return bytes4 value from byte array.\n function readBytes4(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes4 result)\n {\n require(\n b.length >= index + 4,\n \"GREATER_OR_EQUAL_TO_4_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 32 byte length field\n index += 32;\n\n // Read the bytes4 from array memory\n assembly {\n result := mload(add(b, index))\n // Solidity does not require us to clean the trailing bytes.\n // We do it anyway\n result := and(result, 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000)\n }\n return result;\n }\n\n /// @dev Reads nested bytes from a specific position.\n /// @dev NOTE: the returned value overlaps with the input value.\n /// Both should be treated as immutable.\n /// @param b Byte array containing nested bytes.\n /// @param index Index of nested bytes.\n /// @return result Nested bytes.\n function readBytesWithLength(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes memory result)\n {\n // Read length of nested bytes\n uint256 nestedBytesLength = readUint256(b, index);\n index += 32;\n\n // Assert length of <b> is valid, given\n // length of nested bytes\n require(\n b.length >= index + nestedBytesLength,\n \"GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED\"\n );\n \n // Return a pointer to the byte array as it exists inside `b`\n assembly {\n result := add(b, index)\n }\n return result;\n }\n\n /// @dev Inserts bytes at a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input bytes to insert.\n function writeBytesWithLength(\n bytes memory b,\n uint256 index,\n bytes memory input\n )\n internal\n pure\n {\n // Assert length of <b> is valid, given\n // length of input\n require(\n b.length >= index + 32 + input.length, // 32 bytes to store length\n \"GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED\"\n );\n\n // Copy <input> into <b>\n memCopy(\n b.contentAddress() + index,\n input.rawAddress(), // includes length of <input>\n input.length + 32 // +32 bytes to store <input> length\n );\n }\n\n /// @dev Performs a deep copy of a byte array onto another byte array of greater than or equal length.\n /// @param dest Byte array that will be overwritten with source bytes.\n /// @param source Byte array to copy onto dest bytes.\n function deepCopyBytes(\n bytes memory dest,\n bytes memory source\n )\n internal\n pure\n {\n uint256 sourceLen = source.length;\n // Dest length must be >= source length, or some bytes would not be copied.\n require(\n dest.length >= sourceLen,\n \"GREATER_OR_EQUAL_TO_SOURCE_BYTES_LENGTH_REQUIRED\"\n );\n memCopy(\n dest.contentAddress(),\n source.contentAddress(),\n sourceLen\n );\n }\n}\n",
- "2.0.0/utils/Ownable/IOwnable.sol": "pragma solidity 0.4.24;\n\n\ncontract IOwnable {\n\n function transferOwnership(address newOwner)\n public;\n}\n",
- "2.0.0/utils/Ownable/Ownable.sol": "pragma solidity 0.4.24;\n\nimport \"./IOwnable.sol\";\n\n\ncontract Ownable is\n IOwnable\n{\n address public owner;\n\n constructor ()\n public\n {\n owner = msg.sender;\n }\n\n modifier onlyOwner() {\n require(\n msg.sender == owner,\n \"ONLY_CONTRACT_OWNER\"\n );\n _;\n }\n\n function transferOwnership(address newOwner)\n public\n onlyOwner\n {\n if (newOwner != address(0)) {\n owner = newOwner;\n }\n }\n}\n",
- "2.0.0/utils/ReentrancyGuard/ReentrancyGuard.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract ReentrancyGuard {\n\n // Locked state of mutex\n bool private locked = false;\n\n /// @dev Functions with this modifer cannot be reentered. The mutex will be locked\n /// before function execution and unlocked after.\n modifier nonReentrant() {\n // Ensure mutex is unlocked\n require(\n !locked,\n \"REENTRANCY_ILLEGAL\"\n );\n\n // Lock mutex before function call\n locked = true;\n\n // Perform function call\n _;\n\n // Unlock mutex after function call\n locked = false;\n }\n}\n",
- "2.0.0/utils/SafeMath/SafeMath.sol": "pragma solidity 0.4.24;\n\n\ncontract SafeMath {\n\n function safeMul(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n if (a == 0) {\n return 0;\n }\n uint256 c = a * b;\n require(\n c / a == b,\n \"UINT256_OVERFLOW\"\n );\n return c;\n }\n\n function safeDiv(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n uint256 c = a / b;\n return c;\n }\n\n function safeSub(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n require(\n b <= a,\n \"UINT256_UNDERFLOW\"\n );\n return a - b;\n }\n\n function safeAdd(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n uint256 c = a + b;\n require(\n c >= a,\n \"UINT256_OVERFLOW\"\n );\n return c;\n }\n\n function max64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n\n function max256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n}\n"
- },
- "sourceTreeHashHex": "0x93eec0587c0db8b68951a9c0c348c14e22831361b7fe38bb2d29a09ad670e10d",
- "compiler": {
- "name": "solc",
- "version": "soljson-v0.4.24+commit.e67f0147.js",
- "settings": {
- "optimizer": {
- "enabled": true,
- "runs": 1000000
- },
- "outputSelection": {
- "*": {
- "*": [
- "abi",
- "evm.bytecode.object",
- "evm.bytecode.sourceMap",
- "evm.deployedBytecode.object",
- "evm.deployedBytecode.sourceMap"
- ]
- }
- }
- }
- },
- "networks": {
- "3": {
- "address": "0xe654aac058bfbf9f83fcaee7793311dd82f6ddb4",
- "links": {},
- "constructorArgs": "[]"
- },
- "42": {
- "address": "0x2a9127c745688a165106c11cd4d647d2220af821",
- "links": {},
- "constructorArgs": "[]"
- },
- "50": {
- "address": "0x1d7022f5b17d2f8b695918fb48fa1089c9f85401",
- "links": {},
- "constructorArgs": "[]"
- }
- }
-}
diff --git a/packages/migrations/artifacts/2.0.0-testnet/ERC721Token.json b/packages/migrations/artifacts/2.0.0-testnet/ERC721Token.json
deleted file mode 100644
index ceb374730..000000000
--- a/packages/migrations/artifacts/2.0.0-testnet/ERC721Token.json
+++ /dev/null
@@ -1,565 +0,0 @@
-{
- "schemaVersion": "2.0.0",
- "contractName": "ERC721Token",
- "compilerOutput": {
- "abi": [
- {
- "constant": true,
- "inputs": [
- {
- "name": "_tokenId",
- "type": "uint256"
- }
- ],
- "name": "getApproved",
- "outputs": [
- {
- "name": "",
- "type": "address"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_approved",
- "type": "address"
- },
- {
- "name": "_tokenId",
- "type": "uint256"
- }
- ],
- "name": "approve",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_from",
- "type": "address"
- },
- {
- "name": "_to",
- "type": "address"
- },
- {
- "name": "_tokenId",
- "type": "uint256"
- }
- ],
- "name": "transferFrom",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_from",
- "type": "address"
- },
- {
- "name": "_to",
- "type": "address"
- },
- {
- "name": "_tokenId",
- "type": "uint256"
- }
- ],
- "name": "safeTransferFrom",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "_tokenId",
- "type": "uint256"
- }
- ],
- "name": "ownerOf",
- "outputs": [
- {
- "name": "",
- "type": "address"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "_owner",
- "type": "address"
- }
- ],
- "name": "balanceOf",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_operator",
- "type": "address"
- },
- {
- "name": "_approved",
- "type": "bool"
- }
- ],
- "name": "setApprovalForAll",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_from",
- "type": "address"
- },
- {
- "name": "_to",
- "type": "address"
- },
- {
- "name": "_tokenId",
- "type": "uint256"
- },
- {
- "name": "_data",
- "type": "bytes"
- }
- ],
- "name": "safeTransferFrom",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "_owner",
- "type": "address"
- },
- {
- "name": "_operator",
- "type": "address"
- }
- ],
- "name": "isApprovedForAll",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "_from",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "_to",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "_tokenId",
- "type": "uint256"
- }
- ],
- "name": "Transfer",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "_owner",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "_approved",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "_tokenId",
- "type": "uint256"
- }
- ],
- "name": "Approval",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "_owner",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "_operator",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "_approved",
- "type": "bool"
- }
- ],
- "name": "ApprovalForAll",
- "type": "event"
- }
- ],
- "evm": {
- "bytecode": {
- "linkReferences": {},
- "object": "0x608060405234801561001057600080fd5b50610e2d806100206000396000f3006080604052600436106100985763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663081812fc811461009d578063095ea7b3146100de57806323b872dd1461011157806342842e0e146101485780636352211e1461017f57806370a0823114610197578063a22cb465146101d7578063b88d4fde1461020a578063e985e9c514610250575b600080fd5b3480156100a957600080fd5b506100b5600435610298565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b3480156100ea57600080fd5b5061010f73ffffffffffffffffffffffffffffffffffffffff600435166024356102c0565b005b34801561011d57600080fd5b5061010f73ffffffffffffffffffffffffffffffffffffffff600435811690602435166044356103e4565b34801561015457600080fd5b5061010f73ffffffffffffffffffffffffffffffffffffffff60043581169060243516604435610744565b34801561018b57600080fd5b506100b560043561090f565b3480156101a357600080fd5b506101c573ffffffffffffffffffffffffffffffffffffffff600435166109a8565b60408051918252519081900360200190f35b3480156101e357600080fd5b5061010f73ffffffffffffffffffffffffffffffffffffffff600435166024351515610a57565b34801561021657600080fd5b5061010f73ffffffffffffffffffffffffffffffffffffffff60048035821691602480359091169160443591606435908101910135610af0565b34801561025c57600080fd5b5061028473ffffffffffffffffffffffffffffffffffffffff60043581169060243516610cd4565b604080519115158252519081900360200190f35b60009081526001602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b60006102cb8261090f565b90503373ffffffffffffffffffffffffffffffffffffffff821614806102f657506102f68133610cd4565b151561036357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4552433732315f494e56414c49445f53454e4445520000000000000000000000604482015290519081900360640190fd5b60008281526001602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff87811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6000808073ffffffffffffffffffffffffffffffffffffffff8516151561046c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4552433732315f5a45524f5f544f5f4144445245535300000000000000000000604482015290519081900360640190fd5b6104758461090f565b925073ffffffffffffffffffffffffffffffffffffffff868116908416146104fe57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4552433732315f4f574e45525f4d49534d415443480000000000000000000000604482015290519081900360640190fd5b33915061050a84610298565b90508273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148061054b575061054b8383610cd4565b8061058157508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b15156105ee57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4552433732315f494e56414c49445f5350454e44455200000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff81161561063f57600084815260016020526040902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001690555b60008481526020818152604080832080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8a8116919091179091558916835260029091529020546106a8906001610d0f565b73ffffffffffffffffffffffffffffffffffffffff80881660009081526002602052604080822093909355908716815220546106e5906001610d86565b73ffffffffffffffffffffffffffffffffffffffff808716600081815260026020526040808220949094559251879391928a16917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050505050565b6000806107528585856103e4565b833b9150600082111561090857604080517f150b7a0200000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff8781166024830152604482018690526080606483015260006084830181905292519087169263150b7a029260c480820193602093909283900390910190829087803b1580156107ef57600080fd5b505af1158015610803573d6000803e3d6000fd5b505050506040513d602081101561081957600080fd5b5051604080517f6f6e455243373231526563656976656428616464726573732c6164647265737381527f2c75696e743235362c62797465732900000000000000000000000000000000006020820152905190819003602f0190209091507fffffffff0000000000000000000000000000000000000000000000000000000080831691161461090857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4552433732315f494e56414c49445f53454c4543544f52000000000000000000604482015290519081900360640190fd5b5050505050565b60008181526020819052604081205473ffffffffffffffffffffffffffffffffffffffff168015156109a257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f4552433732315f5a45524f5f4f574e4552000000000000000000000000000000604482015290519081900360640190fd5b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82161515610a2e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f4552433732315f5a45524f5f4f574e4552000000000000000000000000000000604482015290519081900360640190fd5b5073ffffffffffffffffffffffffffffffffffffffff1660009081526002602052604090205490565b33600081815260036020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168085529083529281902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016861515908117909155815190815290519293927f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31929181900390910190a35050565b600080610afe8787876103e4565b853b91506000821115610ccb576040517f150b7a02000000000000000000000000000000000000000000000000000000008152336004820181815273ffffffffffffffffffffffffffffffffffffffff8a811660248501526044840189905260806064850190815260848501889052908a169363150b7a0293928c928b928b928b92909160a40184848082843782019150509650505050505050602060405180830381600087803b158015610bb257600080fd5b505af1158015610bc6573d6000803e3d6000fd5b505050506040513d6020811015610bdc57600080fd5b5051604080517f6f6e455243373231526563656976656428616464726573732c6164647265737381527f2c75696e743235362c62797465732900000000000000000000000000000000006020820152905190819003602f0190209091507fffffffff00000000000000000000000000000000000000000000000000000000808316911614610ccb57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4552433732315f494e56414c49445f53454c4543544f52000000000000000000604482015290519081900360640190fd5b50505050505050565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260036020908152604080832093909416825291909152205460ff1690565b600082821115610d8057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f55494e543235365f554e444552464c4f57000000000000000000000000000000604482015290519081900360640190fd5b50900390565b600082820183811015610dfa57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f55494e543235365f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b93925050505600a165627a7a723058207318c14c91209a554964c5f972b95a90fe384dd7dd96ccfd0609544e6439c3c90029",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xE2D DUP1 PUSH2 0x20 PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN STOP PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x98 JUMPI PUSH4 0xFFFFFFFF PUSH29 0x100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD DIV AND PUSH4 0x81812FC DUP2 EQ PUSH2 0x9D JUMPI DUP1 PUSH4 0x95EA7B3 EQ PUSH2 0xDE JUMPI DUP1 PUSH4 0x23B872DD EQ PUSH2 0x111 JUMPI DUP1 PUSH4 0x42842E0E EQ PUSH2 0x148 JUMPI DUP1 PUSH4 0x6352211E EQ PUSH2 0x17F JUMPI DUP1 PUSH4 0x70A08231 EQ PUSH2 0x197 JUMPI DUP1 PUSH4 0xA22CB465 EQ PUSH2 0x1D7 JUMPI DUP1 PUSH4 0xB88D4FDE EQ PUSH2 0x20A JUMPI DUP1 PUSH4 0xE985E9C5 EQ PUSH2 0x250 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xA9 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xB5 PUSH1 0x4 CALLDATALOAD PUSH2 0x298 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xEA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x10F PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x2C0 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x11D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x10F PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH1 0x44 CALLDATALOAD PUSH2 0x3E4 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x154 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x10F PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH1 0x44 CALLDATALOAD PUSH2 0x744 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x18B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xB5 PUSH1 0x4 CALLDATALOAD PUSH2 0x90F JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1A3 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1C5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x9A8 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1E3 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x10F PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD ISZERO ISZERO PUSH2 0xA57 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x216 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x10F PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 DUP1 CALLDATALOAD DUP3 AND SWAP2 PUSH1 0x24 DUP1 CALLDATALOAD SWAP1 SWAP2 AND SWAP2 PUSH1 0x44 CALLDATALOAD SWAP2 PUSH1 0x64 CALLDATALOAD SWAP1 DUP2 ADD SWAP2 ADD CALLDATALOAD PUSH2 0xAF0 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x25C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x284 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH2 0xCD4 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 ISZERO ISZERO DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x2CB DUP3 PUSH2 0x90F JUMP JUMPDEST SWAP1 POP CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND EQ DUP1 PUSH2 0x2F6 JUMPI POP PUSH2 0x2F6 DUP2 CALLER PUSH2 0xCD4 JUMP JUMPDEST ISZERO ISZERO PUSH2 0x363 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x15 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F494E56414C49445F53454E4445520000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x0 DUP3 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 DUP2 AND SWAP2 DUP3 OR SWAP1 SWAP3 SSTORE SWAP2 MLOAD DUP6 SWAP4 SWAP2 DUP6 AND SWAP2 PUSH32 0x8C5BE1E5EBEC7D5BD14F71427D1E84F3DD0314C0F7B2291E5B200AC8C7C3B925 SWAP2 LOG4 POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP6 AND ISZERO ISZERO PUSH2 0x46C JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x16 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F5A45524F5F544F5F4144445245535300000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH2 0x475 DUP5 PUSH2 0x90F JUMP JUMPDEST SWAP3 POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP7 DUP2 AND SWAP1 DUP5 AND EQ PUSH2 0x4FE JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x15 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F4F574E45525F4D49534D415443480000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST CALLER SWAP2 POP PUSH2 0x50A DUP5 PUSH2 0x298 JUMP JUMPDEST SWAP1 POP DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ DUP1 PUSH2 0x54B JUMPI POP PUSH2 0x54B DUP4 DUP4 PUSH2 0xCD4 JUMP JUMPDEST DUP1 PUSH2 0x581 JUMPI POP DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ JUMPDEST ISZERO ISZERO PUSH2 0x5EE JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x16 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F494E56414C49445F5350454E44455200000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND ISZERO PUSH2 0x63F JUMPI PUSH1 0x0 DUP5 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND SWAP1 SSTORE JUMPDEST PUSH1 0x0 DUP5 DUP2 MSTORE PUSH1 0x20 DUP2 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP11 DUP2 AND SWAP2 SWAP1 SWAP2 OR SWAP1 SWAP2 SSTORE DUP10 AND DUP4 MSTORE PUSH1 0x2 SWAP1 SWAP2 MSTORE SWAP1 KECCAK256 SLOAD PUSH2 0x6A8 SWAP1 PUSH1 0x1 PUSH2 0xD0F JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP9 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 SWAP4 SWAP1 SWAP4 SSTORE SWAP1 DUP8 AND DUP2 MSTORE KECCAK256 SLOAD PUSH2 0x6E5 SWAP1 PUSH1 0x1 PUSH2 0xD86 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP8 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 SWAP5 SWAP1 SWAP5 SSTORE SWAP3 MLOAD DUP8 SWAP4 SWAP2 SWAP3 DUP11 AND SWAP2 PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF SWAP2 LOG4 POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x752 DUP6 DUP6 DUP6 PUSH2 0x3E4 JUMP JUMPDEST DUP4 EXTCODESIZE SWAP2 POP PUSH1 0x0 DUP3 GT ISZERO PUSH2 0x908 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x150B7A0200000000000000000000000000000000000000000000000000000000 DUP2 MSTORE CALLER PUSH1 0x4 DUP3 ADD MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 DUP2 AND PUSH1 0x24 DUP4 ADD MSTORE PUSH1 0x44 DUP3 ADD DUP7 SWAP1 MSTORE PUSH1 0x80 PUSH1 0x64 DUP4 ADD MSTORE PUSH1 0x0 PUSH1 0x84 DUP4 ADD DUP2 SWAP1 MSTORE SWAP3 MLOAD SWAP1 DUP8 AND SWAP3 PUSH4 0x150B7A02 SWAP3 PUSH1 0xC4 DUP1 DUP3 ADD SWAP4 PUSH1 0x20 SWAP4 SWAP1 SWAP3 DUP4 SWAP1 SUB SWAP1 SWAP2 ADD SWAP1 DUP3 SWAP1 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x7EF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x803 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x20 DUP2 LT ISZERO PUSH2 0x819 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP MLOAD PUSH1 0x40 DUP1 MLOAD PUSH32 0x6F6E455243373231526563656976656428616464726573732C61646472657373 DUP2 MSTORE PUSH32 0x2C75696E743235362C6279746573290000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x2F ADD SWAP1 KECCAK256 SWAP1 SWAP2 POP PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 DUP1 DUP4 AND SWAP2 AND EQ PUSH2 0x908 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x17 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F494E56414C49445F53454C4543544F52000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 DUP2 KECCAK256 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP1 ISZERO ISZERO PUSH2 0x9A2 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x11 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F5A45524F5F4F574E4552000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND ISZERO ISZERO PUSH2 0xA2E JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x11 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F5A45524F5F4F574E4552000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD SWAP1 JUMP JUMPDEST CALLER PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x3 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 AND DUP1 DUP6 MSTORE SWAP1 DUP4 MSTORE SWAP3 DUP2 SWAP1 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND DUP7 ISZERO ISZERO SWAP1 DUP2 OR SWAP1 SWAP2 SSTORE DUP2 MLOAD SWAP1 DUP2 MSTORE SWAP1 MLOAD SWAP3 SWAP4 SWAP3 PUSH32 0x17307EAB39AB6107E8899845AD3D59BD9653F200F220920489CA2B5937696C31 SWAP3 SWAP2 DUP2 SWAP1 SUB SWAP1 SWAP2 ADD SWAP1 LOG3 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0xAFE DUP8 DUP8 DUP8 PUSH2 0x3E4 JUMP JUMPDEST DUP6 EXTCODESIZE SWAP2 POP PUSH1 0x0 DUP3 GT ISZERO PUSH2 0xCCB JUMPI PUSH1 0x40 MLOAD PUSH32 0x150B7A0200000000000000000000000000000000000000000000000000000000 DUP2 MSTORE CALLER PUSH1 0x4 DUP3 ADD DUP2 DUP2 MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP11 DUP2 AND PUSH1 0x24 DUP6 ADD MSTORE PUSH1 0x44 DUP5 ADD DUP10 SWAP1 MSTORE PUSH1 0x80 PUSH1 0x64 DUP6 ADD SWAP1 DUP2 MSTORE PUSH1 0x84 DUP6 ADD DUP9 SWAP1 MSTORE SWAP1 DUP11 AND SWAP4 PUSH4 0x150B7A02 SWAP4 SWAP3 DUP13 SWAP3 DUP12 SWAP3 DUP12 SWAP3 DUP12 SWAP3 SWAP1 SWAP2 PUSH1 0xA4 ADD DUP5 DUP5 DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP SWAP7 POP POP POP POP POP POP POP PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0xBB2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0xBC6 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x20 DUP2 LT ISZERO PUSH2 0xBDC JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP MLOAD PUSH1 0x40 DUP1 MLOAD PUSH32 0x6F6E455243373231526563656976656428616464726573732C61646472657373 DUP2 MSTORE PUSH32 0x2C75696E743235362C6279746573290000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x2F ADD SWAP1 KECCAK256 SWAP1 SWAP2 POP PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 DUP1 DUP4 AND SWAP2 AND EQ PUSH2 0xCCB JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x17 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F494E56414C49445F53454C4543544F52000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP POP POP POP POP POP POP JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP2 DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x3 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 SWAP4 SWAP1 SWAP5 AND DUP3 MSTORE SWAP2 SWAP1 SWAP2 MSTORE KECCAK256 SLOAD PUSH1 0xFF AND SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 GT ISZERO PUSH2 0xD80 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x11 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x55494E543235365F554E444552464C4F57000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP SWAP1 SUB SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 ADD DUP4 DUP2 LT ISZERO PUSH2 0xDFA JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x10 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x55494E543235365F4F564552464C4F5700000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST SWAP4 SWAP3 POP POP POP JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 PUSH20 0x18C14C91209A554964C5F972B95A90FE384DD7DD SWAP7 0xcc REVERT MOD MULMOD SLOAD 0x4e PUSH5 0x39C3C90029 ",
- "sourceMap": "712:8295:56:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;712:8295:56;;;;;;;"
- },
- "deployedBytecode": {
- "linkReferences": {},
- "object": "0x6080604052600436106100985763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663081812fc811461009d578063095ea7b3146100de57806323b872dd1461011157806342842e0e146101485780636352211e1461017f57806370a0823114610197578063a22cb465146101d7578063b88d4fde1461020a578063e985e9c514610250575b600080fd5b3480156100a957600080fd5b506100b5600435610298565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b3480156100ea57600080fd5b5061010f73ffffffffffffffffffffffffffffffffffffffff600435166024356102c0565b005b34801561011d57600080fd5b5061010f73ffffffffffffffffffffffffffffffffffffffff600435811690602435166044356103e4565b34801561015457600080fd5b5061010f73ffffffffffffffffffffffffffffffffffffffff60043581169060243516604435610744565b34801561018b57600080fd5b506100b560043561090f565b3480156101a357600080fd5b506101c573ffffffffffffffffffffffffffffffffffffffff600435166109a8565b60408051918252519081900360200190f35b3480156101e357600080fd5b5061010f73ffffffffffffffffffffffffffffffffffffffff600435166024351515610a57565b34801561021657600080fd5b5061010f73ffffffffffffffffffffffffffffffffffffffff60048035821691602480359091169160443591606435908101910135610af0565b34801561025c57600080fd5b5061028473ffffffffffffffffffffffffffffffffffffffff60043581169060243516610cd4565b604080519115158252519081900360200190f35b60009081526001602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b60006102cb8261090f565b90503373ffffffffffffffffffffffffffffffffffffffff821614806102f657506102f68133610cd4565b151561036357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4552433732315f494e56414c49445f53454e4445520000000000000000000000604482015290519081900360640190fd5b60008281526001602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff87811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6000808073ffffffffffffffffffffffffffffffffffffffff8516151561046c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4552433732315f5a45524f5f544f5f4144445245535300000000000000000000604482015290519081900360640190fd5b6104758461090f565b925073ffffffffffffffffffffffffffffffffffffffff868116908416146104fe57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4552433732315f4f574e45525f4d49534d415443480000000000000000000000604482015290519081900360640190fd5b33915061050a84610298565b90508273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148061054b575061054b8383610cd4565b8061058157508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b15156105ee57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4552433732315f494e56414c49445f5350454e44455200000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff81161561063f57600084815260016020526040902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001690555b60008481526020818152604080832080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8a8116919091179091558916835260029091529020546106a8906001610d0f565b73ffffffffffffffffffffffffffffffffffffffff80881660009081526002602052604080822093909355908716815220546106e5906001610d86565b73ffffffffffffffffffffffffffffffffffffffff808716600081815260026020526040808220949094559251879391928a16917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050505050565b6000806107528585856103e4565b833b9150600082111561090857604080517f150b7a0200000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff8781166024830152604482018690526080606483015260006084830181905292519087169263150b7a029260c480820193602093909283900390910190829087803b1580156107ef57600080fd5b505af1158015610803573d6000803e3d6000fd5b505050506040513d602081101561081957600080fd5b5051604080517f6f6e455243373231526563656976656428616464726573732c6164647265737381527f2c75696e743235362c62797465732900000000000000000000000000000000006020820152905190819003602f0190209091507fffffffff0000000000000000000000000000000000000000000000000000000080831691161461090857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4552433732315f494e56414c49445f53454c4543544f52000000000000000000604482015290519081900360640190fd5b5050505050565b60008181526020819052604081205473ffffffffffffffffffffffffffffffffffffffff168015156109a257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f4552433732315f5a45524f5f4f574e4552000000000000000000000000000000604482015290519081900360640190fd5b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82161515610a2e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f4552433732315f5a45524f5f4f574e4552000000000000000000000000000000604482015290519081900360640190fd5b5073ffffffffffffffffffffffffffffffffffffffff1660009081526002602052604090205490565b33600081815260036020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168085529083529281902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016861515908117909155815190815290519293927f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31929181900390910190a35050565b600080610afe8787876103e4565b853b91506000821115610ccb576040517f150b7a02000000000000000000000000000000000000000000000000000000008152336004820181815273ffffffffffffffffffffffffffffffffffffffff8a811660248501526044840189905260806064850190815260848501889052908a169363150b7a0293928c928b928b928b92909160a40184848082843782019150509650505050505050602060405180830381600087803b158015610bb257600080fd5b505af1158015610bc6573d6000803e3d6000fd5b505050506040513d6020811015610bdc57600080fd5b5051604080517f6f6e455243373231526563656976656428616464726573732c6164647265737381527f2c75696e743235362c62797465732900000000000000000000000000000000006020820152905190819003602f0190209091507fffffffff00000000000000000000000000000000000000000000000000000000808316911614610ccb57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4552433732315f494e56414c49445f53454c4543544f52000000000000000000604482015290519081900360640190fd5b50505050505050565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260036020908152604080832093909416825291909152205460ff1690565b600082821115610d8057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f55494e543235365f554e444552464c4f57000000000000000000000000000000604482015290519081900360640190fd5b50900390565b600082820183811015610dfa57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f55494e543235365f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b93925050505600a165627a7a723058207318c14c91209a554964c5f972b95a90fe384dd7dd96ccfd0609544e6439c3c90029",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x98 JUMPI PUSH4 0xFFFFFFFF PUSH29 0x100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD DIV AND PUSH4 0x81812FC DUP2 EQ PUSH2 0x9D JUMPI DUP1 PUSH4 0x95EA7B3 EQ PUSH2 0xDE JUMPI DUP1 PUSH4 0x23B872DD EQ PUSH2 0x111 JUMPI DUP1 PUSH4 0x42842E0E EQ PUSH2 0x148 JUMPI DUP1 PUSH4 0x6352211E EQ PUSH2 0x17F JUMPI DUP1 PUSH4 0x70A08231 EQ PUSH2 0x197 JUMPI DUP1 PUSH4 0xA22CB465 EQ PUSH2 0x1D7 JUMPI DUP1 PUSH4 0xB88D4FDE EQ PUSH2 0x20A JUMPI DUP1 PUSH4 0xE985E9C5 EQ PUSH2 0x250 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xA9 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xB5 PUSH1 0x4 CALLDATALOAD PUSH2 0x298 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xEA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x10F PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x2C0 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x11D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x10F PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH1 0x44 CALLDATALOAD PUSH2 0x3E4 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x154 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x10F PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH1 0x44 CALLDATALOAD PUSH2 0x744 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x18B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xB5 PUSH1 0x4 CALLDATALOAD PUSH2 0x90F JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1A3 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1C5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x9A8 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1E3 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x10F PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD ISZERO ISZERO PUSH2 0xA57 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x216 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x10F PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 DUP1 CALLDATALOAD DUP3 AND SWAP2 PUSH1 0x24 DUP1 CALLDATALOAD SWAP1 SWAP2 AND SWAP2 PUSH1 0x44 CALLDATALOAD SWAP2 PUSH1 0x64 CALLDATALOAD SWAP1 DUP2 ADD SWAP2 ADD CALLDATALOAD PUSH2 0xAF0 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x25C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x284 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH2 0xCD4 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 ISZERO ISZERO DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x2CB DUP3 PUSH2 0x90F JUMP JUMPDEST SWAP1 POP CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND EQ DUP1 PUSH2 0x2F6 JUMPI POP PUSH2 0x2F6 DUP2 CALLER PUSH2 0xCD4 JUMP JUMPDEST ISZERO ISZERO PUSH2 0x363 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x15 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F494E56414C49445F53454E4445520000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x0 DUP3 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 DUP2 AND SWAP2 DUP3 OR SWAP1 SWAP3 SSTORE SWAP2 MLOAD DUP6 SWAP4 SWAP2 DUP6 AND SWAP2 PUSH32 0x8C5BE1E5EBEC7D5BD14F71427D1E84F3DD0314C0F7B2291E5B200AC8C7C3B925 SWAP2 LOG4 POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP6 AND ISZERO ISZERO PUSH2 0x46C JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x16 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F5A45524F5F544F5F4144445245535300000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH2 0x475 DUP5 PUSH2 0x90F JUMP JUMPDEST SWAP3 POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP7 DUP2 AND SWAP1 DUP5 AND EQ PUSH2 0x4FE JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x15 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F4F574E45525F4D49534D415443480000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST CALLER SWAP2 POP PUSH2 0x50A DUP5 PUSH2 0x298 JUMP JUMPDEST SWAP1 POP DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ DUP1 PUSH2 0x54B JUMPI POP PUSH2 0x54B DUP4 DUP4 PUSH2 0xCD4 JUMP JUMPDEST DUP1 PUSH2 0x581 JUMPI POP DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ JUMPDEST ISZERO ISZERO PUSH2 0x5EE JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x16 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F494E56414C49445F5350454E44455200000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND ISZERO PUSH2 0x63F JUMPI PUSH1 0x0 DUP5 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND SWAP1 SSTORE JUMPDEST PUSH1 0x0 DUP5 DUP2 MSTORE PUSH1 0x20 DUP2 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP11 DUP2 AND SWAP2 SWAP1 SWAP2 OR SWAP1 SWAP2 SSTORE DUP10 AND DUP4 MSTORE PUSH1 0x2 SWAP1 SWAP2 MSTORE SWAP1 KECCAK256 SLOAD PUSH2 0x6A8 SWAP1 PUSH1 0x1 PUSH2 0xD0F JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP9 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 SWAP4 SWAP1 SWAP4 SSTORE SWAP1 DUP8 AND DUP2 MSTORE KECCAK256 SLOAD PUSH2 0x6E5 SWAP1 PUSH1 0x1 PUSH2 0xD86 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP8 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 SWAP5 SWAP1 SWAP5 SSTORE SWAP3 MLOAD DUP8 SWAP4 SWAP2 SWAP3 DUP11 AND SWAP2 PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF SWAP2 LOG4 POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x752 DUP6 DUP6 DUP6 PUSH2 0x3E4 JUMP JUMPDEST DUP4 EXTCODESIZE SWAP2 POP PUSH1 0x0 DUP3 GT ISZERO PUSH2 0x908 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x150B7A0200000000000000000000000000000000000000000000000000000000 DUP2 MSTORE CALLER PUSH1 0x4 DUP3 ADD MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 DUP2 AND PUSH1 0x24 DUP4 ADD MSTORE PUSH1 0x44 DUP3 ADD DUP7 SWAP1 MSTORE PUSH1 0x80 PUSH1 0x64 DUP4 ADD MSTORE PUSH1 0x0 PUSH1 0x84 DUP4 ADD DUP2 SWAP1 MSTORE SWAP3 MLOAD SWAP1 DUP8 AND SWAP3 PUSH4 0x150B7A02 SWAP3 PUSH1 0xC4 DUP1 DUP3 ADD SWAP4 PUSH1 0x20 SWAP4 SWAP1 SWAP3 DUP4 SWAP1 SUB SWAP1 SWAP2 ADD SWAP1 DUP3 SWAP1 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x7EF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x803 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x20 DUP2 LT ISZERO PUSH2 0x819 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP MLOAD PUSH1 0x40 DUP1 MLOAD PUSH32 0x6F6E455243373231526563656976656428616464726573732C61646472657373 DUP2 MSTORE PUSH32 0x2C75696E743235362C6279746573290000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x2F ADD SWAP1 KECCAK256 SWAP1 SWAP2 POP PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 DUP1 DUP4 AND SWAP2 AND EQ PUSH2 0x908 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x17 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F494E56414C49445F53454C4543544F52000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 DUP2 KECCAK256 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP1 ISZERO ISZERO PUSH2 0x9A2 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x11 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F5A45524F5F4F574E4552000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND ISZERO ISZERO PUSH2 0xA2E JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x11 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F5A45524F5F4F574E4552000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD SWAP1 JUMP JUMPDEST CALLER PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x3 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 AND DUP1 DUP6 MSTORE SWAP1 DUP4 MSTORE SWAP3 DUP2 SWAP1 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND DUP7 ISZERO ISZERO SWAP1 DUP2 OR SWAP1 SWAP2 SSTORE DUP2 MLOAD SWAP1 DUP2 MSTORE SWAP1 MLOAD SWAP3 SWAP4 SWAP3 PUSH32 0x17307EAB39AB6107E8899845AD3D59BD9653F200F220920489CA2B5937696C31 SWAP3 SWAP2 DUP2 SWAP1 SUB SWAP1 SWAP2 ADD SWAP1 LOG3 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0xAFE DUP8 DUP8 DUP8 PUSH2 0x3E4 JUMP JUMPDEST DUP6 EXTCODESIZE SWAP2 POP PUSH1 0x0 DUP3 GT ISZERO PUSH2 0xCCB JUMPI PUSH1 0x40 MLOAD PUSH32 0x150B7A0200000000000000000000000000000000000000000000000000000000 DUP2 MSTORE CALLER PUSH1 0x4 DUP3 ADD DUP2 DUP2 MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP11 DUP2 AND PUSH1 0x24 DUP6 ADD MSTORE PUSH1 0x44 DUP5 ADD DUP10 SWAP1 MSTORE PUSH1 0x80 PUSH1 0x64 DUP6 ADD SWAP1 DUP2 MSTORE PUSH1 0x84 DUP6 ADD DUP9 SWAP1 MSTORE SWAP1 DUP11 AND SWAP4 PUSH4 0x150B7A02 SWAP4 SWAP3 DUP13 SWAP3 DUP12 SWAP3 DUP12 SWAP3 DUP12 SWAP3 SWAP1 SWAP2 PUSH1 0xA4 ADD DUP5 DUP5 DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP SWAP7 POP POP POP POP POP POP POP PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0xBB2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0xBC6 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x20 DUP2 LT ISZERO PUSH2 0xBDC JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP MLOAD PUSH1 0x40 DUP1 MLOAD PUSH32 0x6F6E455243373231526563656976656428616464726573732C61646472657373 DUP2 MSTORE PUSH32 0x2C75696E743235362C6279746573290000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x2F ADD SWAP1 KECCAK256 SWAP1 SWAP2 POP PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 DUP1 DUP4 AND SWAP2 AND EQ PUSH2 0xCCB JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x17 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F494E56414C49445F53454C4543544F52000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP POP POP POP POP POP POP JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP2 DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x3 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 SWAP4 SWAP1 SWAP5 AND DUP3 MSTORE SWAP2 SWAP1 SWAP2 MSTORE KECCAK256 SLOAD PUSH1 0xFF AND SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 GT ISZERO PUSH2 0xD80 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x11 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x55494E543235365F554E444552464C4F57000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP SWAP1 SUB SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 ADD DUP4 DUP2 LT ISZERO PUSH2 0xDFA JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x10 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x55494E543235365F4F564552464C4F5700000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST SWAP4 SWAP3 POP POP POP JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 PUSH20 0x18C14C91209A554964C5F972B95A90FE384DD7DD SWAP7 0xcc REVERT MOD MULMOD SLOAD 0x4e PUSH5 0x39C3C90029 ",
- "sourceMap": "712:8295:56:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8388:140;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;8388:140:56;;;;;;;;;;;;;;;;;;;;;;;;4378:400;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;4378:400:56;;;;;;;;;;;6624:974;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;6624:974:56;;;;;;;;;;;;;;3326:682;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;3326:682:56;;;;;;;;;;;;;;7860:257;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;7860:257:56;;;;;5783:229;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;5783:229:56;;;;;;;;;;;;;;;;;;;;;;;5184:261;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;5184:261:56;;;;;;;;;;;2257:706;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2257:706:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;8829:176;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;8829:176:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8388:140;8472:7;8502:19;;;:9;:19;;;;;;;;;8388:140::o;4378:400::-;4463:13;4479:17;4487:8;4479:7;:17::i;:::-;4463:33;-1:-1:-1;4527:10:56;:19;;;;;:58;;;4550:35;4567:5;4574:10;4550:16;:35::i;:::-;4506:126;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4643:19;;;;:9;:19;;;;;;:31;;;;;;;;;;;;;;4689:82;;4643:19;;4689:82;;;;;;;4378:400;;;:::o;6624:974::-;6848:13;;;6772:17;;;;;6751:86;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6864:17;6872:8;6864:7;:17::i;:::-;6848:33;-1:-1:-1;6912:14:56;;;;;;;;6891:82;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7002:10;6984:28;;7048:21;7060:8;7048:11;:21::i;:::-;7022:47;;7111:5;7100:16;;:7;:16;;;:64;;;;7132:32;7149:5;7156:7;7132:16;:32::i;:::-;7100:106;;;;7199:7;7180:26;;:15;:26;;;7100:106;7079:175;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7269:29;;;;7265:92;;7344:1;7314:19;;;:9;:19;;;;;:32;;;;;;7265:92;7367:6;:16;;;;;;;;;;;:22;;;;;;;;;;;;;;;7425:15;;;;:8;:15;;;;;;7417:27;;-1:-1:-1;7417:7:56;:27::i;:::-;7399:15;;;;;;;;:8;:15;;;;;;:45;;;;7478:13;;;;;;;7470:25;;7493:1;7470:7;:25::i;:::-;7454:13;;;;;;;;:8;:13;;;;;;:41;;;;7515:76;;7573:8;;7454:13;;7515:76;;;;;;6624:974;;;;;;:::o;3326:682::-;3550:24;3702:15;3459:80;3485:5;3504:3;3521:8;3459:12;:80::i;:::-;3639:3;3627:16;3607:36;;3685:1;3666:16;:20;3662:340;;;3720:148;;;;;;3775:10;3720:148;;;;:37;:148;;;;;;;;;;;;;;;;;;-1:-1:-1;3720:148:56;;;;;;;;:37;;;;;;:148;;;;;;;;;;;;;;;;;;:37;:148;;;5:2:-1;;;;30:1;27;20:12;5:2;3720:148:56;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3720:148:56;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3720:148:56;902:60;;;;;;;3720:148;902:60;;;;;;;;;;;;;3720:148;;-1:-1:-1;3907:27:56;;;;;;;3882:109;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3326:682;;;;;:::o;7860:257::-;7940:7;7979:16;;;;;;;;;;;;;8026:19;;;8005:83;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8105:5;7860:257;-1:-1:-1;;7860:257:56:o;5783:229::-;5865:7;5909:20;;;;;5888:84;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;5989:16:56;;;;;;:8;:16;;;;;;;5783:229::o;5184:261::-;5295:10;5277:29;;;;:17;:29;;;;;;;;;:40;;;;;;;;;;;;:52;;;;;;;;;;;;;5344:94;;;;;;;5277:40;;5295:10;5344:94;;;;;;;;;;;5184:261;;:::o;2257:706::-;2502:24;2654:15;2411:80;2437:5;2456:3;2473:8;2411:12;:80::i;:::-;2591:3;2579:16;2559:36;;2637:1;2618:16;:20;2614:343;;;2672:151;;;;;2727:10;2672:151;;;;;;:37;:151;;;;;;;;;;;;;;;;;;;;;;;;;;:37;;;;;;2727:10;2755:5;;2778:8;;2804:5;;;;2672:151;;;;2804:5;;;;2672:151;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2672:151:56;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2672:151:56;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2672:151:56;902:60;;;;;;;2672:151;902:60;;;;;;;;;;;;;2672:151;;-1:-1:-1;2862:27:56;;;;;;;2837:109;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2257:706;;;;;;;:::o;8829:176::-;8962:25;;;;8935:4;8962:25;;;:17;:25;;;;;;;;:36;;;;;;;;;;;;;;;8829:176::o;502:208:65:-;588:7;632:6;;;;611:70;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;698:5:65;;;502:208::o;716:230::-;802:7;837:5;;;873:6;;;;852:69;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;938:1;716:230;-1:-1:-1;;;716:230:65:o"
- }
- }
- },
- "sources": {
- "2.0.0/extensions/Forwarder/Forwarder.sol": {
- "id": 0
- },
- "2.0.0/extensions/Forwarder/MixinAssets.sol": {
- "id": 1
- },
- "2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol": {
- "id": 2
- },
- "2.0.0/extensions/Forwarder/MixinForwarderCore.sol": {
- "id": 3
- },
- "2.0.0/extensions/Forwarder/MixinWeth.sol": {
- "id": 4
- },
- "2.0.0/extensions/Forwarder/interfaces/IAssets.sol": {
- "id": 5
- },
- "2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol": {
- "id": 6
- },
- "2.0.0/extensions/Forwarder/libs/LibConstants.sol": {
- "id": 7
- },
- "2.0.0/extensions/Forwarder/mixins/MAssets.sol": {
- "id": 8
- },
- "2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol": {
- "id": 9
- },
- "2.0.0/extensions/Forwarder/mixins/MWeth.sol": {
- "id": 10
- },
- "2.0.0/extensions/OrderValidator/OrderValidator.sol": {
- "id": 11
- },
- "2.0.0/multisig/MultiSigWallet.sol": {
- "id": 12
- },
- "2.0.0/multisig/MultiSigWalletWithTimeLock.sol": {
- "id": 13
- },
- "2.0.0/protocol/AssetProxy/ERC20Proxy.sol": {
- "id": 14
- },
- "2.0.0/protocol/AssetProxy/ERC721Proxy.sol": {
- "id": 15
- },
- "2.0.0/protocol/AssetProxy/MixinAuthorizable.sol": {
- "id": 16
- },
- "2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol": {
- "id": 17
- },
- "2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol": {
- "id": 18
- },
- "2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol": {
- "id": 19
- },
- "2.0.0/protocol/AssetProxyOwner/AssetProxyOwner.sol": {
- "id": 20
- },
- "2.0.0/protocol/Exchange/Exchange.sol": {
- "id": 21
- },
- "2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol": {
- "id": 22
- },
- "2.0.0/protocol/Exchange/MixinExchangeCore.sol": {
- "id": 23
- },
- "2.0.0/protocol/Exchange/MixinMatchOrders.sol": {
- "id": 24
- },
- "2.0.0/protocol/Exchange/MixinSignatureValidator.sol": {
- "id": 25
- },
- "2.0.0/protocol/Exchange/MixinTransactions.sol": {
- "id": 26
- },
- "2.0.0/protocol/Exchange/MixinWrapperFunctions.sol": {
- "id": 27
- },
- "2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol": {
- "id": 28
- },
- "2.0.0/protocol/Exchange/interfaces/IExchange.sol": {
- "id": 29
- },
- "2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol": {
- "id": 30
- },
- "2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol": {
- "id": 31
- },
- "2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol": {
- "id": 32
- },
- "2.0.0/protocol/Exchange/interfaces/ITransactions.sol": {
- "id": 33
- },
- "2.0.0/protocol/Exchange/interfaces/IValidator.sol": {
- "id": 34
- },
- "2.0.0/protocol/Exchange/interfaces/IWallet.sol": {
- "id": 35
- },
- "2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol": {
- "id": 36
- },
- "2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol": {
- "id": 37
- },
- "2.0.0/protocol/Exchange/libs/LibConstants.sol": {
- "id": 38
- },
- "2.0.0/protocol/Exchange/libs/LibEIP712.sol": {
- "id": 39
- },
- "2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol": {
- "id": 40
- },
- "2.0.0/protocol/Exchange/libs/LibFillResults.sol": {
- "id": 41
- },
- "2.0.0/protocol/Exchange/libs/LibMath.sol": {
- "id": 42
- },
- "2.0.0/protocol/Exchange/libs/LibOrder.sol": {
- "id": 43
- },
- "2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol": {
- "id": 44
- },
- "2.0.0/protocol/Exchange/mixins/MExchangeCore.sol": {
- "id": 45
- },
- "2.0.0/protocol/Exchange/mixins/MMatchOrders.sol": {
- "id": 46
- },
- "2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol": {
- "id": 47
- },
- "2.0.0/protocol/Exchange/mixins/MTransactions.sol": {
- "id": 48
- },
- "2.0.0/protocol/Exchange/mixins/MWrapperFunctions.sol": {
- "id": 49
- },
- "2.0.0/test/DummyERC20Token/DummyERC20Token.sol": {
- "id": 50
- },
- "2.0.0/test/DummyERC721Token/DummyERC721Token.sol": {
- "id": 51
- },
- "2.0.0/tokens/ERC20Token/ERC20Token.sol": {
- "id": 52
- },
- "2.0.0/tokens/ERC20Token/IERC20Token.sol": {
- "id": 53
- },
- "2.0.0/tokens/ERC20Token/MintableERC20Token.sol": {
- "id": 54
- },
- "2.0.0/tokens/ERC20Token/UnlimitedAllowanceERC20Token.sol": {
- "id": 55
- },
- "2.0.0/tokens/ERC721Token/ERC721Token.sol": {
- "id": 56
- },
- "2.0.0/tokens/ERC721Token/IERC721Receiver.sol": {
- "id": 57
- },
- "2.0.0/tokens/ERC721Token/IERC721Token.sol": {
- "id": 58
- },
- "2.0.0/tokens/ERC721Token/MintableERC721Token.sol": {
- "id": 59
- },
- "2.0.0/tokens/EtherToken/IEtherToken.sol": {
- "id": 60
- },
- "2.0.0/utils/LibBytes/LibBytes.sol": {
- "id": 61
- },
- "2.0.0/utils/Ownable/IOwnable.sol": {
- "id": 62
- },
- "2.0.0/utils/Ownable/Ownable.sol": {
- "id": 63
- },
- "2.0.0/utils/ReentrancyGuard/ReentrancyGuard.sol": {
- "id": 64
- },
- "2.0.0/utils/SafeMath/SafeMath.sol": {
- "id": 65
- }
- },
- "sourceCodes": {
- "2.0.0/extensions/Forwarder/Forwarder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./MixinWeth.sol\";\nimport \"./MixinForwarderCore.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./MixinAssets.sol\";\nimport \"./MixinExchangeWrapper.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract Forwarder is\n LibConstants,\n MixinWeth,\n MixinAssets,\n MixinExchangeWrapper,\n MixinForwarderCore\n{\n constructor (\n address _exchange,\n bytes memory _zrxAssetData,\n bytes memory _wethAssetData\n )\n public\n LibConstants(\n _exchange,\n _zrxAssetData,\n _wethAssetData\n )\n MixinForwarderCore()\n {}\n}\n",
- "2.0.0/extensions/Forwarder/MixinAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"../../tokens/ERC20Token/IERC20Token.sol\";\nimport \"../../tokens/ERC721Token/IERC721Token.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MAssets.sol\";\n\n\ncontract MixinAssets is\n Ownable,\n LibConstants,\n MAssets\n{\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_TRANSFER_SELECTOR = bytes4(keccak256(\"transfer(address,uint256)\"));\n\n /// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to \n /// function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be\n /// used to withdraw assets that were accidentally sent to this contract.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of ERC20 token to withdraw.\n function withdrawAsset(\n bytes assetData,\n uint256 amount\n )\n external\n onlyOwner\n {\n transferAssetToSender(assetData, amount);\n }\n\n /// @dev Transfers given amount of asset to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferAssetToSender(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n bytes4 proxyId = assetData.readBytes4(0);\n\n if (proxyId == ERC20_DATA_ID) {\n transferERC20Token(assetData, amount);\n } else if (proxyId == ERC721_DATA_ID) {\n transferERC721Token(assetData, amount);\n } else {\n revert(\"UNSUPPORTED_ASSET_PROXY\");\n }\n }\n\n /// @dev Decodes ERC20 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC20Token(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n address token = assetData.readAddress(16);\n\n // Transfer tokens.\n // We do a raw call so we can check the success separate\n // from the return data.\n bool success = token.call(abi.encodeWithSelector(\n ERC20_TRANSFER_SELECTOR,\n msg.sender,\n amount\n ));\n require(\n success,\n \"TRANSFER_FAILED\"\n );\n \n // Check return data.\n // If there is no return data, we assume the token incorrectly\n // does not return a bool. In this case we expect it to revert\n // on failure, which was handled above.\n // If the token does return data, we require that it is a single\n // value that evaluates to true.\n assembly {\n if returndatasize {\n success := 0\n if eq(returndatasize, 32) {\n // First 64 bytes of memory are reserved scratch space\n returndatacopy(0, 0, 32)\n success := mload(0)\n }\n }\n }\n require(\n success,\n \"TRANSFER_FAILED\"\n );\n }\n\n /// @dev Decodes ERC721 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC721Token(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n require(\n amount == 1,\n \"INVALID_AMOUNT\"\n );\n // Decode asset data.\n address token = assetData.readAddress(16);\n uint256 tokenId = assetData.readUint256(36);\n\n // Perform transfer.\n IERC721Token(token).transferFrom(\n address(this),\n msg.sender,\n tokenId\n );\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MExchangeWrapper.sol\";\nimport \"../../protocol/Exchange/libs/LibAbiEncoder.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../protocol/Exchange/libs/LibFillResults.sol\";\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\n\n\ncontract MixinExchangeWrapper is\n LibAbiEncoder,\n LibFillResults,\n LibMath,\n LibConstants,\n MExchangeWrapper\n{\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n // ABI encode calldata for `fillOrder`\n bytes memory fillOrderCalldata = abiEncodeFillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n\n address exchange = address(EXCHANGE);\n\n // Call `fillOrder` and handle any exceptions gracefully\n assembly {\n let success := call(\n gas, // forward all gas\n exchange, // call address of Exchange contract\n 0, // transfer 0 wei\n add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes)\n mload(fillOrderCalldata), // length of input\n fillOrderCalldata, // write output over input\n 128 // output size is 128 bytes\n )\n if success {\n mstore(fillResults, mload(fillOrderCalldata))\n mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32)))\n mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64)))\n mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96)))\n }\n }\n // fillResults values will be 0 by default if call was unsuccessful\n return fillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of WETH has been sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param wethSellAmount Desired amount of WETH to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellWeth(\n LibOrder.Order[] memory orders,\n uint256 wethSellAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // We assume that asset being sold by taker is WETH for each order.\n orders[i].makerAssetData = makerAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of WETH to sell\n uint256 remainingTakerAssetFillAmount = safeSub(wethSellAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of WETH\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= wethSellAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// The asset being sold by taker must always be WETH.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyExactAmountWithWeth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // We assume that asset being sold by taker is WETH for each order.\n orders[i].makerAssetData = makerAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n uint256 makerAssetFilledAmount = totalFillResults.makerAssetFilledAmount;\n if (makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n\n require(\n makerAssetFilledAmount >= makerAssetFillAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return totalFillResults;\n }\n\n /// @dev Buys zrxBuyAmount of ZRX fee tokens, taking into account ZRX fees for each order. This will guarantee\n /// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues).\n /// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX\n /// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases.\n /// The asset being sold by taker must always be WETH. \n /// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset.\n /// @param zrxBuyAmount Desired amount of ZRX to buy.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return totalFillResults Amounts filled and fees paid by maker and taker.\n function marketBuyExactZrxWithWeth(\n LibOrder.Order[] memory orders,\n uint256 zrxBuyAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n // Do nothing if zrxBuyAmount == 0\n if (zrxBuyAmount == 0) {\n return totalFillResults;\n }\n\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n uint256 zrxPurchased = 0;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // All of these are ZRX/WETH, so we can drop the respective assetData from calldata.\n orders[i].makerAssetData = zrxAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of ZRX to buy.\n uint256 remainingZrxBuyAmount = safeSub(zrxBuyAmount, zrxPurchased);\n\n // Convert the remaining amount of ZRX to buy into remaining amount\n // of WETH to sell, assuming entire amount can be sold in the current order.\n uint256 remainingWethSellAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n safeSub(orders[i].makerAssetAmount, orders[i].takerFee), // our exchange rate after fees \n remainingZrxBuyAmount\n );\n\n // Attempt to sell the remaining amount of WETH.\n FillResults memory singleFillResult = fillOrderNoThrow(\n orders[i],\n safeAdd(remainingWethSellAmount, 1), // we add 1 wei to the fill amount to make up for rounding errors\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker.\n addFillResults(totalFillResults, singleFillResult);\n zrxPurchased = safeSub(totalFillResults.makerAssetFilledAmount, totalFillResults.takerFeePaid);\n\n // Stop execution if the entire amount of ZRX has been bought.\n if (zrxPurchased >= zrxBuyAmount) {\n break;\n }\n }\n\n require(\n zrxPurchased >= zrxBuyAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return totalFillResults;\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinForwarderCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MWeth.sol\";\nimport \"./mixins/MAssets.sol\";\nimport \"./mixins/MExchangeWrapper.sol\";\nimport \"./interfaces/IForwarderCore.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../protocol/Exchange/libs/LibFillResults.sol\";\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\n\n\ncontract MixinForwarderCore is\n LibFillResults,\n LibMath,\n LibConstants,\n MWeth,\n MAssets,\n MExchangeWrapper,\n IForwarderCore\n{\n using LibBytes for bytes;\n\n /// @dev Constructor approves ERC20 proxy to transfer ZRX and WETH on this contract's behalf.\n constructor ()\n public\n {\n address proxyAddress = EXCHANGE.getAssetProxy(ERC20_DATA_ID);\n require(\n proxyAddress != address(0),\n \"UNREGISTERED_ASSET_PROXY\"\n );\n ETHER_TOKEN.approve(proxyAddress, MAX_UINT);\n ZRX_TOKEN.approve(proxyAddress, MAX_UINT);\n }\n\n /// @dev Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketSellOrdersWithEth(\n LibOrder.Order[] memory orders,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n FillResults memory orderFillResults,\n FillResults memory feeOrderFillResults\n )\n {\n // Convert ETH to WETH.\n convertEthToWeth();\n\n uint256 wethSellAmount;\n uint256 zrxBuyAmount;\n uint256 makerAssetAmountPurchased;\n if (orders[0].makerAssetData.equals(ZRX_ASSET_DATA)) {\n // Calculate amount of WETH that won't be spent on ETH fees.\n wethSellAmount = getPartialAmountFloor(\n PERCENTAGE_DENOMINATOR,\n safeAdd(PERCENTAGE_DENOMINATOR, feePercentage),\n msg.value\n );\n // Market sell available WETH.\n // ZRX fees are paid with this contract's balance.\n orderFillResults = marketSellWeth(\n orders,\n wethSellAmount,\n signatures\n );\n // The fee amount must be deducted from the amount transfered back to sender.\n makerAssetAmountPurchased = safeSub(orderFillResults.makerAssetFilledAmount, orderFillResults.takerFeePaid);\n } else {\n // 5% of WETH is reserved for filling feeOrders and paying feeRecipient.\n wethSellAmount = getPartialAmountFloor(\n MAX_WETH_FILL_PERCENTAGE,\n PERCENTAGE_DENOMINATOR,\n msg.value\n );\n // Market sell 95% of WETH.\n // ZRX fees are payed with this contract's balance.\n orderFillResults = marketSellWeth(\n orders,\n wethSellAmount,\n signatures\n );\n // Buy back all ZRX spent on fees.\n zrxBuyAmount = orderFillResults.takerFeePaid;\n feeOrderFillResults = marketBuyExactZrxWithWeth(\n feeOrders,\n zrxBuyAmount,\n feeSignatures\n );\n makerAssetAmountPurchased = orderFillResults.makerAssetFilledAmount;\n }\n\n // Transfer feePercentage of total ETH spent on primary orders to feeRecipient.\n // Refund remaining ETH to msg.sender.\n transferEthFeeAndRefund(\n orderFillResults.takerAssetFilledAmount,\n feeOrderFillResults.takerAssetFilledAmount,\n feePercentage,\n feeRecipient\n );\n\n // Transfer purchased assets to msg.sender.\n transferAssetToSender(orders[0].makerAssetData, makerAssetAmountPurchased);\n }\n\n /// @dev Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param makerAssetFillAmount Desired amount of makerAsset to purchase.\n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketBuyOrdersWithEth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n FillResults memory orderFillResults,\n FillResults memory feeOrderFillResults\n )\n {\n // Convert ETH to WETH.\n convertEthToWeth();\n\n uint256 zrxBuyAmount;\n uint256 makerAssetAmountPurchased;\n if (orders[0].makerAssetData.equals(ZRX_ASSET_DATA)) {\n // If the makerAsset is ZRX, it is not necessary to pay fees out of this\n // contracts's ZRX balance because fees are factored into the price of the order.\n orderFillResults = marketBuyExactZrxWithWeth(\n orders,\n makerAssetFillAmount,\n signatures\n );\n // The fee amount must be deducted from the amount transfered back to sender.\n makerAssetAmountPurchased = safeSub(orderFillResults.makerAssetFilledAmount, orderFillResults.takerFeePaid);\n } else {\n // Attemp to purchase desired amount of makerAsset.\n // ZRX fees are payed with this contract's balance.\n orderFillResults = marketBuyExactAmountWithWeth(\n orders,\n makerAssetFillAmount,\n signatures\n );\n // Buy back all ZRX spent on fees.\n zrxBuyAmount = orderFillResults.takerFeePaid;\n feeOrderFillResults = marketBuyExactZrxWithWeth(\n feeOrders,\n zrxBuyAmount,\n feeSignatures\n );\n makerAssetAmountPurchased = orderFillResults.makerAssetFilledAmount;\n }\n\n // Transfer feePercentage of total ETH spent on primary orders to feeRecipient.\n // Refund remaining ETH to msg.sender.\n transferEthFeeAndRefund(\n orderFillResults.takerAssetFilledAmount,\n feeOrderFillResults.takerAssetFilledAmount,\n feePercentage,\n feeRecipient\n );\n\n // Transfer purchased assets to msg.sender.\n transferAssetToSender(orders[0].makerAssetData, makerAssetAmountPurchased);\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinWeth.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MWeth.sol\";\n\n\ncontract MixinWeth is\n LibMath,\n LibConstants,\n MWeth\n{\n /// @dev Default payabale function, this allows us to withdraw WETH\n function ()\n public\n payable\n {\n require(\n msg.sender == address(ETHER_TOKEN),\n \"DEFAULT_FUNCTION_WETH_CONTRACT_ONLY\"\n );\n }\n\n /// @dev Converts message call's ETH value into WETH.\n function convertEthToWeth()\n internal\n {\n require(\n msg.value > 0,\n \"INVALID_MSG_VALUE\"\n );\n ETHER_TOKEN.deposit.value(msg.value)();\n }\n\n /// @dev Transfers feePercentage of WETH spent on primary orders to feeRecipient.\n /// Refunds any excess ETH to msg.sender.\n /// @param wethSoldExcludingFeeOrders Amount of WETH sold when filling primary orders.\n /// @param wethSoldForZrx Amount of WETH sold when purchasing ZRX required for primary order fees.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n function transferEthFeeAndRefund(\n uint256 wethSoldExcludingFeeOrders,\n uint256 wethSoldForZrx,\n uint256 feePercentage,\n address feeRecipient\n )\n internal\n {\n // Ensure feePercentage is less than 5%.\n require(\n feePercentage <= MAX_FEE_PERCENTAGE,\n \"FEE_PERCENTAGE_TOO_LARGE\"\n );\n\n // Ensure that no extra WETH owned by this contract has been sold.\n uint256 wethSold = safeAdd(wethSoldExcludingFeeOrders, wethSoldForZrx);\n require(\n wethSold <= msg.value,\n \"OVERSOLD_WETH\"\n );\n\n // Calculate amount of WETH that hasn't been sold.\n uint256 wethRemaining = safeSub(msg.value, wethSold);\n\n // Calculate ETH fee to pay to feeRecipient.\n uint256 ethFee = getPartialAmountFloor(\n feePercentage,\n PERCENTAGE_DENOMINATOR,\n wethSoldExcludingFeeOrders\n );\n\n // Ensure fee is less than amount of WETH remaining.\n require(\n ethFee <= wethRemaining,\n \"INSUFFICIENT_ETH_REMAINING\"\n );\n \n // Do nothing if no WETH remaining\n if (wethRemaining > 0) {\n // Convert remaining WETH to ETH\n ETHER_TOKEN.withdraw(wethRemaining);\n\n // Pay ETH to feeRecipient\n if (ethFee > 0) {\n feeRecipient.transfer(ethFee);\n }\n\n // Refund remaining ETH to msg.sender.\n uint256 ethRefund = safeSub(wethRemaining, ethFee);\n if (ethRefund > 0) {\n msg.sender.transfer(ethRefund);\n }\n }\n }\n}\n",
- "2.0.0/extensions/Forwarder/interfaces/IAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IAssets {\n\n /// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to \n /// function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be\n /// used to withdraw assets that were accidentally sent to this contract.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of ERC20 token to withdraw.\n function withdrawAsset(\n bytes assetData,\n uint256 amount\n )\n external;\n}\n",
- "2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../../protocol/Exchange/libs/LibFillResults.sol\";\n\n\ncontract IForwarderCore {\n\n /// @dev Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketSellOrdersWithEth(\n LibOrder.Order[] memory orders,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n LibFillResults.FillResults memory orderFillResults,\n LibFillResults.FillResults memory feeOrderFillResults\n );\n\n /// @dev Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param makerAssetFillAmount Desired amount of makerAsset to purchase.\n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketBuyOrdersWithEth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n LibFillResults.FillResults memory orderFillResults,\n LibFillResults.FillResults memory feeOrderFillResults\n );\n}\n",
- "2.0.0/extensions/Forwarder/libs/LibConstants.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/LibBytes/LibBytes.sol\";\nimport \"../../../protocol/Exchange/interfaces/IExchange.sol\";\nimport \"../../../tokens/EtherToken/IEtherToken.sol\";\nimport \"../../../tokens/ERC20Token/IERC20Token.sol\";\n\n\ncontract LibConstants {\n\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n uint256 constant internal MAX_UINT = 2**256 - 1;\n uint256 constant internal PERCENTAGE_DENOMINATOR = 10**18; \n uint256 constant internal MAX_FEE_PERCENTAGE = 5 * PERCENTAGE_DENOMINATOR / 100; // 5%\n uint256 constant internal MAX_WETH_FILL_PERCENTAGE = 95 * PERCENTAGE_DENOMINATOR / 100; // 95%\n \n // solhint-disable var-name-mixedcase\n IExchange internal EXCHANGE;\n IEtherToken internal ETHER_TOKEN;\n IERC20Token internal ZRX_TOKEN;\n bytes internal ZRX_ASSET_DATA;\n bytes internal WETH_ASSET_DATA;\n // solhint-enable var-name-mixedcase\n\n constructor (\n address _exchange,\n bytes memory _zrxAssetData,\n bytes memory _wethAssetData\n )\n public\n {\n EXCHANGE = IExchange(_exchange);\n ZRX_ASSET_DATA = _zrxAssetData;\n WETH_ASSET_DATA = _wethAssetData;\n\n address etherToken = _wethAssetData.readAddress(16);\n address zrxToken = _zrxAssetData.readAddress(16);\n ETHER_TOKEN = IEtherToken(etherToken);\n ZRX_TOKEN = IERC20Token(zrxToken);\n }\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAssets.sol\";\n\n\ncontract MAssets is\n IAssets\n{\n /// @dev Transfers given amount of asset to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferAssetToSender(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n\n /// @dev Decodes ERC20 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC20Token(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n\n /// @dev Decodes ERC721 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC721Token(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../../protocol/Exchange/libs/LibFillResults.sol\";\n\n\ncontract MExchangeWrapper {\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of WETH has been sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param wethSellAmount Desired amount of WETH to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellWeth(\n LibOrder.Order[] memory orders,\n uint256 wethSellAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// The asset being sold by taker must always be WETH.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyExactAmountWithWeth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Buys zrxBuyAmount of ZRX fee tokens, taking into account ZRX fees for each order. This will guarantee\n /// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues).\n /// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX\n /// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases.\n /// The asset being sold by taker must always be WETH. \n /// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset.\n /// @param zrxBuyAmount Desired amount of ZRX to buy.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return totalFillResults Amounts filled and fees paid by maker and taker.\n function marketBuyExactZrxWithWeth(\n LibOrder.Order[] memory orders,\n uint256 zrxBuyAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MWeth.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract MWeth {\n\n /// @dev Converts message call's ETH value into WETH.\n function convertEthToWeth()\n internal;\n\n /// @dev Transfers feePercentage of WETH spent on primary orders to feeRecipient.\n /// Refunds any excess ETH to msg.sender.\n /// @param wethSoldExcludingFeeOrders Amount of WETH sold when filling primary orders.\n /// @param wethSoldForZrx Amount of WETH sold when purchasing ZRX required for primary order fees.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n function transferEthFeeAndRefund(\n uint256 wethSoldExcludingFeeOrders,\n uint256 wethSoldForZrx,\n uint256 feePercentage,\n address feeRecipient\n )\n internal;\n}\n",
- "2.0.0/extensions/OrderValidator/OrderValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../protocol/Exchange/interfaces/IExchange.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../tokens/ERC20Token/IERC20Token.sol\";\nimport \"../../tokens/ERC721Token/IERC721Token.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\n\n\ncontract OrderValidator {\n\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n\n struct TraderInfo {\n uint256 makerBalance; // Maker's balance of makerAsset\n uint256 makerAllowance; // Maker's allowance to corresponding AssetProxy\n uint256 takerBalance; // Taker's balance of takerAsset\n uint256 takerAllowance; // Taker's allowance to corresponding AssetProxy\n uint256 makerZrxBalance; // Maker's balance of ZRX\n uint256 makerZrxAllowance; // Maker's allowance of ZRX to ERC20Proxy\n uint256 takerZrxBalance; // Taker's balance of ZRX\n uint256 takerZrxAllowance; // Taker's allowance of ZRX to ERC20Proxy\n }\n\n // solhint-disable var-name-mixedcase\n IExchange internal EXCHANGE;\n bytes internal ZRX_ASSET_DATA;\n // solhint-enable var-name-mixedcase\n\n constructor (address _exchange, bytes memory _zrxAssetData)\n public\n {\n EXCHANGE = IExchange(_exchange);\n ZRX_ASSET_DATA = _zrxAssetData;\n }\n\n /// @dev Fetches information for order and maker/taker of order.\n /// @param order The order structure.\n /// @param takerAddress Address that will be filling the order.\n /// @return OrderInfo and TraderInfo instances for given order.\n function getOrderAndTraderInfo(LibOrder.Order memory order, address takerAddress)\n public\n view\n returns (LibOrder.OrderInfo memory orderInfo, TraderInfo memory traderInfo)\n {\n orderInfo = EXCHANGE.getOrderInfo(order);\n traderInfo = getTraderInfo(order, takerAddress);\n return (orderInfo, traderInfo);\n }\n\n /// @dev Fetches information for all passed in orders and the makers/takers of each order.\n /// @param orders Array of order specifications.\n /// @param takerAddresses Array of taker addresses corresponding to each order.\n /// @return Arrays of OrderInfo and TraderInfo instances that correspond to each order.\n function getOrdersAndTradersInfo(LibOrder.Order[] memory orders, address[] memory takerAddresses)\n public\n view\n returns (LibOrder.OrderInfo[] memory ordersInfo, TraderInfo[] memory tradersInfo)\n {\n ordersInfo = EXCHANGE.getOrdersInfo(orders);\n tradersInfo = getTradersInfo(orders, takerAddresses);\n return (ordersInfo, tradersInfo);\n }\n\n /// @dev Fetches balance and allowances for maker and taker of order.\n /// @param order The order structure.\n /// @param takerAddress Address that will be filling the order.\n /// @return Balances and allowances of maker and taker of order.\n function getTraderInfo(LibOrder.Order memory order, address takerAddress)\n public\n view\n returns (TraderInfo memory traderInfo)\n {\n (traderInfo.makerBalance, traderInfo.makerAllowance) = getBalanceAndAllowance(order.makerAddress, order.makerAssetData);\n (traderInfo.takerBalance, traderInfo.takerAllowance) = getBalanceAndAllowance(takerAddress, order.takerAssetData);\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n (traderInfo.makerZrxBalance, traderInfo.makerZrxAllowance) = getBalanceAndAllowance(order.makerAddress, zrxAssetData);\n (traderInfo.takerZrxBalance, traderInfo.takerZrxAllowance) = getBalanceAndAllowance(takerAddress, zrxAssetData);\n return traderInfo;\n }\n\n /// @dev Fetches balances and allowances of maker and taker for each provided order.\n /// @param orders Array of order specifications.\n /// @param takerAddresses Array of taker addresses corresponding to each order.\n /// @return Array of balances and allowances for maker and taker of each order.\n function getTradersInfo(LibOrder.Order[] memory orders, address[] memory takerAddresses)\n public\n view\n returns (TraderInfo[] memory)\n {\n uint256 ordersLength = orders.length;\n TraderInfo[] memory tradersInfo = new TraderInfo[](ordersLength);\n for (uint256 i = 0; i != ordersLength; i++) {\n tradersInfo[i] = getTraderInfo(orders[i], takerAddresses[i]);\n }\n return tradersInfo;\n }\n\n /// @dev Fetches token balances and allowances of an address to given assetProxy. Supports ERC20 and ERC721.\n /// @param target Address to fetch balances and allowances of.\n /// @param assetData Encoded data that can be decoded by a specified proxy contract when transferring asset.\n /// @return Balance of asset and allowance set to given proxy of asset.\n /// For ERC721 tokens, these values will always be 1 or 0.\n function getBalanceAndAllowance(address target, bytes memory assetData)\n public\n view\n returns (uint256 balance, uint256 allowance)\n {\n bytes4 assetProxyId = assetData.readBytes4(0);\n address token = assetData.readAddress(16);\n address assetProxy = EXCHANGE.getAssetProxy(assetProxyId);\n\n if (assetProxyId == ERC20_DATA_ID) {\n // Query balance\n balance = IERC20Token(token).balanceOf(target);\n\n // Query allowance\n allowance = IERC20Token(token).allowance(target, assetProxy);\n } else if (assetProxyId == ERC721_DATA_ID) {\n uint256 tokenId = assetData.readUint256(36);\n\n // Query owner of tokenId\n address owner = getERC721TokenOwner(token, tokenId);\n\n // Set balance to 1 if tokenId is owned by target\n balance = target == owner ? 1 : 0;\n\n // Check if ERC721Proxy is approved to spend tokenId\n bool isApproved = IERC721Token(token).isApprovedForAll(target, assetProxy) || IERC721Token(token).getApproved(tokenId) == assetProxy;\n \n // Set alowance to 1 if ERC721Proxy is approved to spend tokenId\n allowance = isApproved ? 1 : 0;\n } else {\n revert(\"UNSUPPORTED_ASSET_PROXY\");\n }\n return (balance, allowance);\n }\n\n /// @dev Fetches token balances and allowances of an address for each given assetProxy. Supports ERC20 and ERC721.\n /// @param target Address to fetch balances and allowances of.\n /// @param assetData Array of encoded byte arrays that can be decoded by a specified proxy contract when transferring asset.\n /// @return Balances and allowances of assets.\n /// For ERC721 tokens, these values will always be 1 or 0.\n function getBalancesAndAllowances(address target, bytes[] memory assetData)\n public\n view\n returns (uint256[] memory, uint256[] memory)\n {\n uint256 length = assetData.length;\n uint256[] memory balances = new uint256[](length);\n uint256[] memory allowances = new uint256[](length);\n for (uint256 i = 0; i != length; i++) {\n (balances[i], allowances[i]) = getBalanceAndAllowance(target, assetData[i]);\n }\n return (balances, allowances);\n }\n\n /// @dev Calls `token.ownerOf(tokenId)`, but returns a null owner instead of reverting on an unowned token.\n /// @param token Address of ERC721 token.\n /// @param tokenId The identifier for the specific NFT.\n /// @return Owner of tokenId or null address if unowned.\n function getERC721TokenOwner(address token, uint256 tokenId)\n public\n view\n returns (address owner)\n {\n assembly {\n // load free memory pointer\n let cdStart := mload(64)\n\n // bytes4(keccak256(ownerOf(uint256))) = 0x6352211e\n mstore(cdStart, 0x6352211e00000000000000000000000000000000000000000000000000000000)\n mstore(add(cdStart, 4), tokenId)\n\n // staticcall `ownerOf(tokenId)`\n // `ownerOf` will revert if tokenId is not owned\n let success := staticcall(\n gas, // forward all gas\n token, // call token contract\n cdStart, // start of calldata\n 36, // length of input is 36 bytes\n cdStart, // write output over input\n 32 // size of output is 32 bytes\n )\n\n // Success implies that tokenId is owned\n // Copy owner from return data if successful\n if success {\n owner := mload(cdStart)\n } \n }\n\n // Owner initialized to address(0), no need to modify if call is unsuccessful\n return owner;\n }\n}\n",
- "2.0.0/multisig/MultiSigWallet.sol": "// solhint-disable\npragma solidity ^0.4.15;\n\n\n/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.\n/// @author Stefan George - <stefan.george@consensys.net>\ncontract MultiSigWallet {\n\n /*\n * Events\n */\n event Confirmation(address indexed sender, uint indexed transactionId);\n event Revocation(address indexed sender, uint indexed transactionId);\n event Submission(uint indexed transactionId);\n event Execution(uint indexed transactionId);\n event ExecutionFailure(uint indexed transactionId);\n event Deposit(address indexed sender, uint value);\n event OwnerAddition(address indexed owner);\n event OwnerRemoval(address indexed owner);\n event RequirementChange(uint required);\n\n /*\n * Constants\n */\n uint constant public MAX_OWNER_COUNT = 50;\n\n /*\n * Storage\n */\n mapping (uint => Transaction) public transactions;\n mapping (uint => mapping (address => bool)) public confirmations;\n mapping (address => bool) public isOwner;\n address[] public owners;\n uint public required;\n uint public transactionCount;\n\n struct Transaction {\n address destination;\n uint value;\n bytes data;\n bool executed;\n }\n\n /*\n * Modifiers\n */\n modifier onlyWallet() {\n require(msg.sender == address(this));\n _;\n }\n\n modifier ownerDoesNotExist(address owner) {\n require(!isOwner[owner]);\n _;\n }\n\n modifier ownerExists(address owner) {\n require(isOwner[owner]);\n _;\n }\n\n modifier transactionExists(uint transactionId) {\n require(transactions[transactionId].destination != 0);\n _;\n }\n\n modifier confirmed(uint transactionId, address owner) {\n require(confirmations[transactionId][owner]);\n _;\n }\n\n modifier notConfirmed(uint transactionId, address owner) {\n require(!confirmations[transactionId][owner]);\n _;\n }\n\n modifier notExecuted(uint transactionId) {\n require(!transactions[transactionId].executed);\n _;\n }\n\n modifier notNull(address _address) {\n require(_address != 0);\n _;\n }\n\n modifier validRequirement(uint ownerCount, uint _required) {\n require(ownerCount <= MAX_OWNER_COUNT\n && _required <= ownerCount\n && _required != 0\n && ownerCount != 0);\n _;\n }\n\n /// @dev Fallback function allows to deposit ether.\n function()\n payable\n {\n if (msg.value > 0)\n Deposit(msg.sender, msg.value);\n }\n\n /*\n * Public functions\n */\n /// @dev Contract constructor sets initial owners and required number of confirmations.\n /// @param _owners List of initial owners.\n /// @param _required Number of required confirmations.\n function MultiSigWallet(address[] _owners, uint _required)\n public\n validRequirement(_owners.length, _required)\n {\n for (uint i=0; i<_owners.length; i++) {\n require(!isOwner[_owners[i]] && _owners[i] != 0);\n isOwner[_owners[i]] = true;\n }\n owners = _owners;\n required = _required;\n }\n\n /// @dev Allows to add a new owner. Transaction has to be sent by wallet.\n /// @param owner Address of new owner.\n function addOwner(address owner)\n public\n onlyWallet\n ownerDoesNotExist(owner)\n notNull(owner)\n validRequirement(owners.length + 1, required)\n {\n isOwner[owner] = true;\n owners.push(owner);\n OwnerAddition(owner);\n }\n\n /// @dev Allows to remove an owner. Transaction has to be sent by wallet.\n /// @param owner Address of owner.\n function removeOwner(address owner)\n public\n onlyWallet\n ownerExists(owner)\n {\n isOwner[owner] = false;\n for (uint i=0; i<owners.length - 1; i++)\n if (owners[i] == owner) {\n owners[i] = owners[owners.length - 1];\n break;\n }\n owners.length -= 1;\n if (required > owners.length)\n changeRequirement(owners.length);\n OwnerRemoval(owner);\n }\n\n /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet.\n /// @param owner Address of owner to be replaced.\n /// @param newOwner Address of new owner.\n function replaceOwner(address owner, address newOwner)\n public\n onlyWallet\n ownerExists(owner)\n ownerDoesNotExist(newOwner)\n {\n for (uint i=0; i<owners.length; i++)\n if (owners[i] == owner) {\n owners[i] = newOwner;\n break;\n }\n isOwner[owner] = false;\n isOwner[newOwner] = true;\n OwnerRemoval(owner);\n OwnerAddition(newOwner);\n }\n\n /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet.\n /// @param _required Number of required confirmations.\n function changeRequirement(uint _required)\n public\n onlyWallet\n validRequirement(owners.length, _required)\n {\n required = _required;\n RequirementChange(_required);\n }\n\n /// @dev Allows an owner to submit and confirm a transaction.\n /// @param destination Transaction target address.\n /// @param value Transaction ether value.\n /// @param data Transaction data payload.\n /// @return Returns transaction ID.\n function submitTransaction(address destination, uint value, bytes data)\n public\n returns (uint transactionId)\n {\n transactionId = addTransaction(destination, value, data);\n confirmTransaction(transactionId);\n }\n\n /// @dev Allows an owner to confirm a transaction.\n /// @param transactionId Transaction ID.\n function confirmTransaction(uint transactionId)\n public\n ownerExists(msg.sender)\n transactionExists(transactionId)\n notConfirmed(transactionId, msg.sender)\n {\n confirmations[transactionId][msg.sender] = true;\n Confirmation(msg.sender, transactionId);\n executeTransaction(transactionId);\n }\n\n /// @dev Allows an owner to revoke a confirmation for a transaction.\n /// @param transactionId Transaction ID.\n function revokeConfirmation(uint transactionId)\n public\n ownerExists(msg.sender)\n confirmed(transactionId, msg.sender)\n notExecuted(transactionId)\n {\n confirmations[transactionId][msg.sender] = false;\n Revocation(msg.sender, transactionId);\n }\n\n /// @dev Allows anyone to execute a confirmed transaction.\n /// @param transactionId Transaction ID.\n function executeTransaction(uint transactionId)\n public\n ownerExists(msg.sender)\n confirmed(transactionId, msg.sender)\n notExecuted(transactionId)\n {\n if (isConfirmed(transactionId)) {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data))\n Execution(transactionId);\n else {\n ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n }\n\n // call has been separated into its own function in order to take advantage\n // of the Solidity's code generator to produce a loop that copies tx.data into memory.\n function external_call(address destination, uint value, uint dataLength, bytes data) internal returns (bool) {\n bool result;\n assembly {\n let x := mload(0x40) // \"Allocate\" memory for output (0x40 is where \"free memory\" pointer is stored by convention)\n let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that\n result := call(\n sub(gas, 34710), // 34710 is the value that solidity is currently emitting\n // It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) +\n // callNewAccountGas (25000, in case the destination address does not exist and needs creating)\n destination,\n value,\n d,\n dataLength, // Size of the input (in bytes) - this is what fixes the padding problem\n x,\n 0 // Output is ignored, therefore the output size is zero\n )\n }\n return result;\n }\n\n /// @dev Returns the confirmation status of a transaction.\n /// @param transactionId Transaction ID.\n /// @return Confirmation status.\n function isConfirmed(uint transactionId)\n public\n constant\n returns (bool)\n {\n uint count = 0;\n for (uint i=0; i<owners.length; i++) {\n if (confirmations[transactionId][owners[i]])\n count += 1;\n if (count == required)\n return true;\n }\n }\n\n /*\n * Internal functions\n */\n /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet.\n /// @param destination Transaction target address.\n /// @param value Transaction ether value.\n /// @param data Transaction data payload.\n /// @return Returns transaction ID.\n function addTransaction(address destination, uint value, bytes data)\n internal\n notNull(destination)\n returns (uint transactionId)\n {\n transactionId = transactionCount;\n transactions[transactionId] = Transaction({\n destination: destination,\n value: value,\n data: data,\n executed: false\n });\n transactionCount += 1;\n Submission(transactionId);\n }\n\n /*\n * Web3 call functions\n */\n /// @dev Returns number of confirmations of a transaction.\n /// @param transactionId Transaction ID.\n /// @return Number of confirmations.\n function getConfirmationCount(uint transactionId)\n public\n constant\n returns (uint count)\n {\n for (uint i=0; i<owners.length; i++)\n if (confirmations[transactionId][owners[i]])\n count += 1;\n }\n\n /// @dev Returns total number of transactions after filers are applied.\n /// @param pending Include pending transactions.\n /// @param executed Include executed transactions.\n /// @return Total number of transactions after filters are applied.\n function getTransactionCount(bool pending, bool executed)\n public\n constant\n returns (uint count)\n {\n for (uint i=0; i<transactionCount; i++)\n if ( pending && !transactions[i].executed\n || executed && transactions[i].executed)\n count += 1;\n }\n\n /// @dev Returns list of owners.\n /// @return List of owner addresses.\n function getOwners()\n public\n constant\n returns (address[])\n {\n return owners;\n }\n\n /// @dev Returns array with owner addresses, which confirmed transaction.\n /// @param transactionId Transaction ID.\n /// @return Returns array of owner addresses.\n function getConfirmations(uint transactionId)\n public\n constant\n returns (address[] _confirmations)\n {\n address[] memory confirmationsTemp = new address[](owners.length);\n uint count = 0;\n uint i;\n for (i=0; i<owners.length; i++)\n if (confirmations[transactionId][owners[i]]) {\n confirmationsTemp[count] = owners[i];\n count += 1;\n }\n _confirmations = new address[](count);\n for (i=0; i<count; i++)\n _confirmations[i] = confirmationsTemp[i];\n }\n\n /// @dev Returns list of transaction IDs in defined range.\n /// @param from Index start position of transaction array.\n /// @param to Index end position of transaction array.\n /// @param pending Include pending transactions.\n /// @param executed Include executed transactions.\n /// @return Returns array of transaction IDs.\n function getTransactionIds(uint from, uint to, bool pending, bool executed)\n public\n constant\n returns (uint[] _transactionIds)\n {\n uint[] memory transactionIdsTemp = new uint[](transactionCount);\n uint count = 0;\n uint i;\n for (i=0; i<transactionCount; i++)\n if ( pending && !transactions[i].executed\n || executed && transactions[i].executed)\n {\n transactionIdsTemp[count] = i;\n count += 1;\n }\n _transactionIds = new uint[](to - from);\n for (i=from; i<to; i++)\n _transactionIds[i - from] = transactionIdsTemp[i];\n }\n}",
- "2.0.0/multisig/MultiSigWalletWithTimeLock.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MultiSigWallet.sol\";\n\n\n/// @title Multisignature wallet with time lock- Allows multiple parties to execute a transaction after a time lock has passed.\n/// @author Amir Bandeali - <amir@0xProject.com>\n// solhint-disable not-rely-on-time\ncontract MultiSigWalletWithTimeLock is\n MultiSigWallet\n{\n event ConfirmationTimeSet(uint256 indexed transactionId, uint256 confirmationTime);\n event TimeLockChange(uint256 secondsTimeLocked);\n\n uint256 public secondsTimeLocked;\n\n mapping (uint256 => uint256) public confirmationTimes;\n\n modifier notFullyConfirmed(uint256 transactionId) {\n require(\n !isConfirmed(transactionId),\n \"TX_FULLY_CONFIRMED\"\n );\n _;\n }\n\n modifier fullyConfirmed(uint256 transactionId) {\n require(\n isConfirmed(transactionId),\n \"TX_NOT_FULLY_CONFIRMED\"\n );\n _;\n }\n\n modifier pastTimeLock(uint256 transactionId) {\n require(\n block.timestamp >= confirmationTimes[transactionId] + secondsTimeLocked,\n \"TIME_LOCK_INCOMPLETE\"\n );\n _;\n }\n\n /// @dev Contract constructor sets initial owners, required number of confirmations, and time lock.\n /// @param _owners List of initial owners.\n /// @param _required Number of required confirmations.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n constructor (\n address[] _owners,\n uint256 _required,\n uint256 _secondsTimeLocked\n )\n public\n MultiSigWallet(_owners, _required)\n {\n secondsTimeLocked = _secondsTimeLocked;\n }\n\n /// @dev Changes the duration of the time lock for transactions.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n function changeTimeLock(uint256 _secondsTimeLocked)\n public\n onlyWallet\n {\n secondsTimeLocked = _secondsTimeLocked;\n emit TimeLockChange(_secondsTimeLocked);\n }\n\n /// @dev Allows an owner to confirm a transaction.\n /// @param transactionId Transaction ID.\n function confirmTransaction(uint256 transactionId)\n public\n ownerExists(msg.sender)\n transactionExists(transactionId)\n notConfirmed(transactionId, msg.sender)\n notFullyConfirmed(transactionId)\n {\n confirmations[transactionId][msg.sender] = true;\n emit Confirmation(msg.sender, transactionId);\n if (isConfirmed(transactionId)) {\n setConfirmationTime(transactionId, block.timestamp);\n }\n }\n\n /// @dev Allows anyone to execute a confirmed transaction.\n /// @param transactionId Transaction ID.\n function executeTransaction(uint256 transactionId)\n public\n notExecuted(transactionId)\n fullyConfirmed(transactionId)\n pastTimeLock(transactionId)\n {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) {\n emit Execution(transactionId);\n } else {\n emit ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n\n /// @dev Sets the time of when a submission first passed.\n function setConfirmationTime(uint256 transactionId, uint256 confirmationTime)\n internal\n {\n confirmationTimes[transactionId] = confirmationTime;\n emit ConfirmationTimeSet(transactionId, confirmationTime);\n }\n}\n",
- "2.0.0/protocol/AssetProxy/ERC20Proxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MixinAuthorizable.sol\";\n\n\ncontract ERC20Proxy is\n MixinAuthorizable\n{\n // Id of this proxy.\n bytes4 constant internal PROXY_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n \n // solhint-disable-next-line payable-fallback\n function () \n external\n {\n assembly {\n // The first 4 bytes of calldata holds the function selector\n let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)\n\n // `transferFrom` will be called with the following parameters:\n // assetData Encoded byte array.\n // from Address to transfer asset from.\n // to Address to transfer asset to.\n // amount Amount of asset to transfer.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {\n\n // To lookup a value in a mapping, we load from the storage location keccak256(k, p),\n // where k is the key left padded to 32 bytes and p is the storage slot\n let start := mload(64)\n mstore(start, and(caller, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(start, 32), authorized_slot)\n\n // Revert if authorized[msg.sender] == false\n if iszero(sload(keccak256(start, 64))) {\n // Revert with `Error(\"SENDER_NOT_AUTHORIZED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // `transferFrom`.\n // The function is marked `external`, so no abi decodeding is done for\n // us. Instead, we expect the `calldata` memory to contain the\n // following:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n //\n // (*): offset is computed from start of function parameters, so offset\n // by an additional 4 bytes in the calldata.\n //\n // (**): see table below to compute length of assetData Contents\n //\n // WARNING: The ABIv2 specification allows additional padding between\n // the Params and Data section. This will result in a larger\n // offset to assetData.\n\n // Asset data itself is encoded as follows:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 1 * 32 | function parameters: |\n // | | 4 | 12 + 20 | 1. token address |\n\n // We construct calldata for the `token.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 4 | | 1. from |\n // | | 36 | | 2. to |\n // | | 68 | | 3. amount |\n\n /////// Read token address from calldata ///////\n // * The token address is stored in `assetData`.\n //\n // * The \"offset to assetData\" is stored at offset 4 in the calldata (table 1).\n // [assetDataOffsetFromParams = calldataload(4)]\n //\n // * Notes that the \"offset to assetData\" is relative to the \"Params\" area of calldata;\n // add 4 bytes to account for the length of the \"Header\" area (table 1).\n // [assetDataOffsetFromHeader = assetDataOffsetFromParams + 4]\n //\n // * The \"token address\" is offset 32+4=36 bytes into \"assetData\" (tables 1 & 2).\n // [tokenOffset = assetDataOffsetFromHeader + 36 = calldataload(4) + 4 + 36]\n let token := calldataload(add(calldataload(4), 40))\n \n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFrom` selector.\n // Any trailing data in transferFromSelector will be\n // overwritten in the next `mstore` call.\n mstore(0, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // We copy the fields `from`, `to` and `amount` in bulk\n // from our own calldata to the new calldata.\n calldatacopy(4, 36, 96)\n\n /////// Call `token.transferFrom` using the calldata ///////\n let success := call(\n gas, // forward all gas\n token, // call address of token contract\n 0, // don't send any ETH\n 0, // pointer to start of input\n 100, // length of input\n 0, // write output over input\n 32 // output size should be 32 bytes\n )\n\n /////// Check return data. ///////\n // If there is no return data, we assume the token incorrectly\n // does not return a bool. In this case we expect it to revert\n // on failure, which was handled above.\n // If the token does return data, we require that it is a single\n // nonzero 32 bytes value.\n // So the transfer succeeded if the call succeeded and either\n // returned nothing, or returned a non-zero 32 byte value. \n success := and(success, or(\n iszero(returndatasize),\n and(\n eq(returndatasize, 32),\n gt(mload(0), 0)\n )\n ))\n if success {\n return(0, 0)\n }\n \n // Revert with `Error(\"TRANSFER_FAILED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // Revert if undefined function is called\n revert(0, 0)\n }\n }\n\n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4)\n {\n return PROXY_ID;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/ERC721Proxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MixinAuthorizable.sol\";\n\n\ncontract ERC721Proxy is\n MixinAuthorizable\n{\n // Id of this proxy.\n bytes4 constant internal PROXY_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n\n // solhint-disable-next-line payable-fallback\n function () \n external\n {\n assembly {\n // The first 4 bytes of calldata holds the function selector\n let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)\n\n // `transferFrom` will be called with the following parameters:\n // assetData Encoded byte array.\n // from Address to transfer asset from.\n // to Address to transfer asset to.\n // amount Amount of asset to transfer.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {\n\n // To lookup a value in a mapping, we load from the storage location keccak256(k, p),\n // where k is the key left padded to 32 bytes and p is the storage slot\n let start := mload(64)\n mstore(start, and(caller, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(start, 32), authorized_slot)\n\n // Revert if authorized[msg.sender] == false\n if iszero(sload(keccak256(start, 64))) {\n // Revert with `Error(\"SENDER_NOT_AUTHORIZED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // `transferFrom`.\n // The function is marked `external`, so no abi decodeding is done for\n // us. Instead, we expect the `calldata` memory to contain the\n // following:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n //\n // (*): offset is computed from start of function parameters, so offset\n // by an additional 4 bytes in the calldata.\n //\n // (**): see table below to compute length of assetData Contents\n //\n // WARNING: The ABIv2 specification allows additional padding between\n // the Params and Data section. This will result in a larger\n // offset to assetData.\n\n // Asset data itself is encoded as follows:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 2 * 32 | function parameters: |\n // | | 4 | 12 + 20 | 1. token address |\n // | | 36 | | 2. tokenId |\n \n // We construct calldata for the `token.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n // \n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 4 | | 1. from |\n // | | 36 | | 2. to |\n // | | 68 | | 3. tokenId |\n\n // There exists only 1 of each token.\n // require(amount == 1, \"INVALID_AMOUNT\")\n if sub(calldataload(100), 1) {\n // Revert with `Error(\"INVALID_AMOUNT\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000e494e56414c49445f414d4f554e540000000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFrom` selector.\n // Any trailing data in transferFromSelector will be\n // overwritten in the next `mstore` call.\n mstore(0, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // We copy the fields `from` and `to` in bulk\n // from our own calldata to the new calldata.\n calldatacopy(4, 36, 64)\n\n // Copy `tokenId` field from our own calldata to the new calldata.\n let assetDataOffset := calldataload(4)\n calldatacopy(68, add(assetDataOffset, 72), 32)\n\n /////// Call `token.transferFrom` using the calldata ///////\n let token := calldataload(add(assetDataOffset, 40))\n let success := call(\n gas, // forward all gas\n token, // call address of token contract\n 0, // don't send any ETH\n 0, // pointer to start of input\n 100, // length of input\n 0, // write output to null\n 0 // output size is 0 bytes\n )\n if success {\n return(0, 0)\n }\n \n // Revert with `Error(\"TRANSFER_FAILED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // Revert if undefined function is called\n revert(0, 0)\n }\n }\n\n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4)\n {\n return PROXY_ID;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/MixinAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"./mixins/MAuthorizable.sol\";\n\n\ncontract MixinAuthorizable is\n Ownable,\n MAuthorizable\n{\n /// @dev Only authorized addresses can invoke functions with this modifier.\n modifier onlyAuthorized {\n require(\n authorized[msg.sender],\n \"SENDER_NOT_AUTHORIZED\"\n );\n _;\n }\n\n mapping (address => bool) public authorized;\n address[] public authorities;\n\n /// @dev Authorizes an address.\n /// @param target Address to authorize.\n function addAuthorizedAddress(address target)\n external\n onlyOwner\n {\n require(\n !authorized[target],\n \"TARGET_ALREADY_AUTHORIZED\"\n );\n\n authorized[target] = true;\n authorities.push(target);\n emit AuthorizedAddressAdded(target, msg.sender);\n }\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n function removeAuthorizedAddress(address target)\n external\n onlyOwner\n {\n require(\n authorized[target],\n \"TARGET_NOT_AUTHORIZED\"\n );\n\n delete authorized[target];\n for (uint256 i = 0; i < authorities.length; i++) {\n if (authorities[i] == target) {\n authorities[i] = authorities[authorities.length - 1];\n authorities.length -= 1;\n break;\n }\n }\n emit AuthorizedAddressRemoved(target, msg.sender);\n }\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n /// @param index Index of target in authorities array.\n function removeAuthorizedAddressAtIndex(\n address target,\n uint256 index\n )\n external\n onlyOwner\n {\n require(\n authorized[target],\n \"TARGET_NOT_AUTHORIZED\"\n );\n require(\n index < authorities.length,\n \"INDEX_OUT_OF_BOUNDS\"\n );\n require(\n authorities[index] == target,\n \"AUTHORIZED_ADDRESS_MISMATCH\"\n );\n\n delete authorized[target];\n authorities[index] = authorities[authorities.length - 1];\n authorities.length -= 1;\n emit AuthorizedAddressRemoved(target, msg.sender);\n }\n\n /// @dev Gets all authorized addresses.\n /// @return Array of authorized addresses.\n function getAuthorizedAddresses()\n external\n view\n returns (address[] memory)\n {\n return authorities;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IAuthorizable.sol\";\n\n\ncontract IAssetProxy is\n IAuthorizable\n{\n /// @dev Transfers assets. Either succeeds or throws.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param from Address to transfer asset from.\n /// @param to Address to transfer asset to.\n /// @param amount Amount of asset to transfer.\n function transferFrom(\n bytes assetData,\n address from,\n address to,\n uint256 amount\n )\n external;\n \n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4);\n}\n",
- "2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/Ownable/IOwnable.sol\";\n\n\ncontract IAuthorizable is\n IOwnable\n{\n /// @dev Authorizes an address.\n /// @param target Address to authorize.\n function addAuthorizedAddress(address target)\n external;\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n function removeAuthorizedAddress(address target)\n external;\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n /// @param index Index of target in authorities array.\n function removeAuthorizedAddressAtIndex(\n address target,\n uint256 index\n )\n external;\n \n /// @dev Gets all authorized addresses.\n /// @return Array of authorized addresses.\n function getAuthorizedAddresses()\n external\n view\n returns (address[] memory);\n}\n",
- "2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAuthorizable.sol\";\n\n\ncontract MAuthorizable is\n IAuthorizable\n{\n // Event logged when a new address is authorized.\n event AuthorizedAddressAdded(\n address indexed target,\n address indexed caller\n );\n\n // Event logged when a currently authorized address is unauthorized.\n event AuthorizedAddressRemoved(\n address indexed target,\n address indexed caller\n );\n\n /// @dev Only authorized addresses can invoke functions with this modifier.\n modifier onlyAuthorized { revert(); _; }\n}\n",
- "2.0.0/protocol/AssetProxyOwner/AssetProxyOwner.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../multisig/MultiSigWalletWithTimeLock.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\n\n\ncontract AssetProxyOwner is\n MultiSigWalletWithTimeLock\n{\n using LibBytes for bytes;\n\n event AssetProxyRegistration(address assetProxyContract, bool isRegistered);\n\n // Mapping of AssetProxy contract address =>\n // if this contract is allowed to call the AssetProxy's `removeAuthorizedAddressAtIndex` method without a time lock.\n mapping (address => bool) public isAssetProxyRegistered;\n\n bytes4 constant internal REMOVE_AUTHORIZED_ADDRESS_AT_INDEX_SELECTOR = bytes4(keccak256(\"removeAuthorizedAddressAtIndex(address,uint256)\"));\n\n /// @dev Function will revert if the transaction does not call `removeAuthorizedAddressAtIndex`\n /// on an approved AssetProxy contract.\n modifier validRemoveAuthorizedAddressAtIndexTx(uint256 transactionId) {\n Transaction storage txn = transactions[transactionId];\n require(\n isAssetProxyRegistered[txn.destination],\n \"UNREGISTERED_ASSET_PROXY\"\n );\n require(\n txn.data.readBytes4(0) == REMOVE_AUTHORIZED_ADDRESS_AT_INDEX_SELECTOR,\n \"INVALID_FUNCTION_SELECTOR\"\n );\n _;\n }\n\n /// @dev Contract constructor sets initial owners, required number of confirmations,\n /// time lock, and list of AssetProxy addresses.\n /// @param _owners List of initial owners.\n /// @param _assetProxyContracts Array of AssetProxy contract addresses.\n /// @param _required Number of required confirmations.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n constructor (\n address[] memory _owners,\n address[] memory _assetProxyContracts,\n uint256 _required,\n uint256 _secondsTimeLocked\n )\n public\n MultiSigWalletWithTimeLock(_owners, _required, _secondsTimeLocked)\n {\n for (uint256 i = 0; i < _assetProxyContracts.length; i++) {\n address assetProxy = _assetProxyContracts[i];\n require(\n assetProxy != address(0),\n \"INVALID_ASSET_PROXY\"\n );\n isAssetProxyRegistered[assetProxy] = true;\n }\n }\n\n /// @dev Registers or deregisters an AssetProxy to be able to execute\n /// `removeAuthorizedAddressAtIndex` without a timelock.\n /// @param assetProxyContract Address of AssetProxy contract.\n /// @param isRegistered Status of approval for AssetProxy contract.\n function registerAssetProxy(address assetProxyContract, bool isRegistered)\n public\n onlyWallet\n notNull(assetProxyContract)\n {\n isAssetProxyRegistered[assetProxyContract] = isRegistered;\n emit AssetProxyRegistration(assetProxyContract, isRegistered);\n }\n\n /// @dev Allows execution of `removeAuthorizedAddressAtIndex` without time lock.\n /// @param transactionId Transaction ID.\n function executeRemoveAuthorizedAddressAtIndex(uint256 transactionId)\n public\n notExecuted(transactionId)\n fullyConfirmed(transactionId)\n validRemoveAuthorizedAddressAtIndexTx(transactionId)\n {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) {\n emit Execution(transactionId);\n } else {\n emit ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/Exchange.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./MixinExchangeCore.sol\";\nimport \"./MixinSignatureValidator.sol\";\nimport \"./MixinWrapperFunctions.sol\";\nimport \"./MixinAssetProxyDispatcher.sol\";\nimport \"./MixinTransactions.sol\";\nimport \"./MixinMatchOrders.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract Exchange is\n MixinExchangeCore,\n MixinMatchOrders,\n MixinSignatureValidator,\n MixinTransactions,\n MixinAssetProxyDispatcher,\n MixinWrapperFunctions\n{\n string constant public VERSION = \"2.0.1-alpha\";\n\n // Mixins are instantiated in the order they are inherited\n constructor (bytes memory _zrxAssetData)\n public\n LibConstants(_zrxAssetData) // @TODO: Remove when we deploy.\n MixinExchangeCore()\n MixinMatchOrders()\n MixinSignatureValidator()\n MixinTransactions()\n MixinAssetProxyDispatcher()\n MixinWrapperFunctions()\n {}\n}\n",
- "2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\nimport \"../AssetProxy/interfaces/IAssetProxy.sol\";\n\n\ncontract MixinAssetProxyDispatcher is\n Ownable,\n MAssetProxyDispatcher\n{\n // Mapping from Asset Proxy Id's to their respective Asset Proxy\n mapping (bytes4 => IAssetProxy) public assetProxies;\n\n /// @dev Registers an asset proxy to its asset proxy id.\n /// Once an asset proxy is registered, it cannot be unregistered.\n /// @param assetProxy Address of new asset proxy to register.\n function registerAssetProxy(address assetProxy)\n external\n onlyOwner\n {\n IAssetProxy assetProxyContract = IAssetProxy(assetProxy);\n\n // Ensure that no asset proxy exists with current id.\n bytes4 assetProxyId = assetProxyContract.getProxyId();\n address currentAssetProxy = assetProxies[assetProxyId];\n require(\n currentAssetProxy == address(0),\n \"ASSET_PROXY_ALREADY_EXISTS\"\n );\n\n // Add asset proxy and log registration.\n assetProxies[assetProxyId] = assetProxyContract;\n emit AssetProxyRegistered(\n assetProxyId,\n assetProxy\n );\n }\n\n /// @dev Gets an asset proxy.\n /// @param assetProxyId Id of the asset proxy.\n /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered.\n function getAssetProxy(bytes4 assetProxyId)\n external\n view\n returns (address)\n {\n return assetProxies[assetProxyId];\n }\n\n /// @dev Forwards arguments to assetProxy and calls `transferFrom`. Either succeeds or throws.\n /// @param assetData Byte array encoded for the asset.\n /// @param from Address to transfer token from.\n /// @param to Address to transfer token to.\n /// @param amount Amount of token to transfer.\n function dispatchTransferFrom(\n bytes memory assetData,\n address from,\n address to,\n uint256 amount\n )\n internal\n {\n // Do nothing if no amount should be transferred.\n if (amount > 0 && from != to) {\n // Ensure assetData length is valid\n require(\n assetData.length > 3,\n \"LENGTH_GREATER_THAN_3_REQUIRED\"\n );\n \n // Lookup assetProxy. We do not use `LibBytes.readBytes4` for gas efficiency reasons.\n bytes4 assetProxyId;\n assembly {\n assetProxyId := and(mload(\n add(assetData, 32)),\n 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000\n )\n }\n address assetProxy = assetProxies[assetProxyId];\n\n // Ensure that assetProxy exists\n require(\n assetProxy != address(0),\n \"ASSET_PROXY_DOES_NOT_EXIST\"\n );\n \n // We construct calldata for the `assetProxy.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n // \n // | Area | Offset | Length | Contents |\n // | -------- |--------|---------|-------------------------------------------- |\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n\n assembly {\n /////// Setup State ///////\n // `cdStart` is the start of the calldata for `assetProxy.transferFrom` (equal to free memory ptr).\n let cdStart := mload(64)\n // `dataAreaLength` is the total number of words needed to store `assetData`\n // As-per the ABI spec, this value is padded up to the nearest multiple of 32,\n // and includes 32-bytes for length.\n let dataAreaLength := and(add(mload(assetData), 63), 0xFFFFFFFFFFFE0)\n // `cdEnd` is the end of the calldata for `assetProxy.transferFrom`.\n let cdEnd := add(cdStart, add(132, dataAreaLength))\n\n \n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFromSelector`.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n mstore(cdStart, 0xa85e59e400000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // Each parameter is padded to 32-bytes. The entire Params Area is 128 bytes.\n // Notes:\n // 1. The offset to `assetData` is the length of the Params Area (128 bytes).\n // 2. A 20-byte mask is applied to addresses to zero-out the unused bytes.\n mstore(add(cdStart, 4), 128)\n mstore(add(cdStart, 36), and(from, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(cdStart, 68), and(to, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(cdStart, 100), amount)\n \n /////// Setup Data Area ///////\n // This area holds `assetData`.\n let dataArea := add(cdStart, 132)\n // solhint-disable-next-line no-empty-blocks\n for {} lt(dataArea, cdEnd) {} {\n mstore(dataArea, mload(assetData))\n dataArea := add(dataArea, 32)\n assetData := add(assetData, 32)\n }\n\n /////// Call `assetProxy.transferFrom` using the constructed calldata ///////\n let success := call(\n gas, // forward all gas\n assetProxy, // call address of asset proxy\n 0, // don't send any ETH\n cdStart, // pointer to start of input\n sub(cdEnd, cdStart), // length of input \n cdStart, // write output over input\n 512 // reserve 512 bytes for output\n )\n if iszero(success) {\n revert(cdStart, returndatasize())\n }\n }\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\n\n\ncontract MixinExchangeCore is\n ReentrancyGuard,\n LibConstants,\n LibMath,\n LibOrder,\n LibFillResults,\n MAssetProxyDispatcher,\n MExchangeCore,\n MSignatureValidator,\n MTransactions\n{\n // Mapping of orderHash => amount of takerAsset already bought by maker\n mapping (bytes32 => uint256) public filled;\n\n // Mapping of orderHash => cancelled\n mapping (bytes32 => bool) public cancelled;\n\n // Mapping of makerAddress => senderAddress => lowest salt an order can have in order to be fillable\n // Orders with specified senderAddress and with a salt less than their epoch are considered cancelled\n mapping (address => mapping (address => uint256)) public orderEpoch;\n\n /// @dev Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch\n /// and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress).\n /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled.\n function cancelOrdersUpTo(uint256 targetOrderEpoch)\n external\n nonReentrant\n {\n address makerAddress = getCurrentContextAddress();\n // If this function is called via `executeTransaction`, we only update the orderEpoch for the makerAddress/msg.sender combination.\n // This allows external filter contracts to add rules to how orders are cancelled via this function.\n address senderAddress = makerAddress == msg.sender ? address(0) : msg.sender;\n\n // orderEpoch is initialized to 0, so to cancelUpTo we need salt + 1\n uint256 newOrderEpoch = targetOrderEpoch + 1; \n uint256 oldOrderEpoch = orderEpoch[makerAddress][senderAddress];\n\n // Ensure orderEpoch is monotonically increasing\n require(\n newOrderEpoch > oldOrderEpoch, \n \"INVALID_NEW_ORDER_EPOCH\"\n );\n\n // Update orderEpoch\n orderEpoch[makerAddress][senderAddress] = newOrderEpoch;\n emit CancelUpTo(\n makerAddress,\n senderAddress,\n newOrderEpoch\n );\n }\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrder(\n Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n nonReentrant\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n return fillResults;\n }\n\n /// @dev After calling, the order can not be filled anymore.\n /// Throws if order is invalid or sender does not have permission to cancel.\n /// @param order Order to cancel. Order must be OrderStatus.FILLABLE.\n function cancelOrder(Order memory order)\n public\n nonReentrant\n {\n cancelOrderInternal(order);\n }\n\n /// @dev Gets information about an order: status, hash, and amount filled.\n /// @param order Order to gather information on.\n /// @return OrderInfo Information about the order and its state.\n /// See LibOrder.OrderInfo for a complete description.\n function getOrderInfo(Order memory order)\n public\n view\n returns (OrderInfo memory orderInfo)\n {\n // Compute the order hash\n orderInfo.orderHash = getOrderHash(order);\n\n // Fetch filled amount\n orderInfo.orderTakerAssetFilledAmount = filled[orderInfo.orderHash];\n\n // If order.makerAssetAmount is zero, we also reject the order.\n // While the Exchange contract handles them correctly, they create\n // edge cases in the supporting infrastructure because they have\n // an 'infinite' price when computed by a simple division.\n if (order.makerAssetAmount == 0) {\n orderInfo.orderStatus = uint8(OrderStatus.INVALID_MAKER_ASSET_AMOUNT);\n return orderInfo;\n }\n\n // If order.takerAssetAmount is zero, then the order will always\n // be considered filled because 0 == takerAssetAmount == orderTakerAssetFilledAmount\n // Instead of distinguishing between unfilled and filled zero taker\n // amount orders, we choose not to support them.\n if (order.takerAssetAmount == 0) {\n orderInfo.orderStatus = uint8(OrderStatus.INVALID_TAKER_ASSET_AMOUNT);\n return orderInfo;\n }\n\n // Validate order availability\n if (orderInfo.orderTakerAssetFilledAmount >= order.takerAssetAmount) {\n orderInfo.orderStatus = uint8(OrderStatus.FULLY_FILLED);\n return orderInfo;\n }\n\n // Validate order expiration\n // solhint-disable-next-line not-rely-on-time\n if (block.timestamp >= order.expirationTimeSeconds) {\n orderInfo.orderStatus = uint8(OrderStatus.EXPIRED);\n return orderInfo;\n }\n\n // Check if order has been cancelled\n if (cancelled[orderInfo.orderHash]) {\n orderInfo.orderStatus = uint8(OrderStatus.CANCELLED);\n return orderInfo;\n }\n if (orderEpoch[order.makerAddress][order.senderAddress] > order.salt) {\n orderInfo.orderStatus = uint8(OrderStatus.CANCELLED);\n return orderInfo;\n }\n\n // All other statuses are ruled out: order is Fillable\n orderInfo.orderStatus = uint8(OrderStatus.FILLABLE);\n return orderInfo;\n }\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderInternal(\n Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n // Fetch order info\n OrderInfo memory orderInfo = getOrderInfo(order);\n\n // Fetch taker address\n address takerAddress = getCurrentContextAddress();\n \n // Assert that the order is fillable by taker\n assertFillableOrder(\n order,\n orderInfo,\n takerAddress,\n signature\n );\n \n // Get amount of takerAsset to fill\n uint256 remainingTakerAssetAmount = safeSub(order.takerAssetAmount, orderInfo.orderTakerAssetFilledAmount);\n uint256 takerAssetFilledAmount = min256(takerAssetFillAmount, remainingTakerAssetAmount);\n\n // Validate context\n assertValidFill(\n order,\n orderInfo,\n takerAssetFillAmount,\n takerAssetFilledAmount,\n fillResults.makerAssetFilledAmount\n );\n\n // Compute proportional fill amounts\n fillResults = calculateFillResults(order, takerAssetFilledAmount);\n\n // Update exchange internal state\n updateFilledState(\n order,\n takerAddress,\n orderInfo.orderHash,\n orderInfo.orderTakerAssetFilledAmount,\n fillResults\n );\n \n // Settle order\n settleOrder(\n order,\n takerAddress,\n fillResults\n );\n\n return fillResults;\n }\n\n /// @dev After calling, the order can not be filled anymore.\n /// Throws if order is invalid or sender does not have permission to cancel.\n /// @param order Order to cancel. Order must be OrderStatus.FILLABLE.\n function cancelOrderInternal(Order memory order)\n internal\n {\n // Fetch current order status\n OrderInfo memory orderInfo = getOrderInfo(order);\n\n // Validate context\n assertValidCancel(order, orderInfo);\n\n // Perform cancel\n updateCancelledState(order, orderInfo.orderHash);\n }\n\n /// @dev Updates state with results of a fill order.\n /// @param order that was filled.\n /// @param takerAddress Address of taker who filled the order.\n /// @param orderTakerAssetFilledAmount Amount of order already filled.\n function updateFilledState(\n Order memory order,\n address takerAddress,\n bytes32 orderHash,\n uint256 orderTakerAssetFilledAmount,\n FillResults memory fillResults\n )\n internal\n {\n // Update state\n filled[orderHash] = safeAdd(orderTakerAssetFilledAmount, fillResults.takerAssetFilledAmount);\n\n // Log order\n emit Fill(\n order.makerAddress,\n order.feeRecipientAddress,\n takerAddress,\n msg.sender,\n fillResults.makerAssetFilledAmount,\n fillResults.takerAssetFilledAmount,\n fillResults.makerFeePaid,\n fillResults.takerFeePaid,\n orderHash,\n order.makerAssetData,\n order.takerAssetData\n );\n }\n\n /// @dev Updates state with results of cancelling an order.\n /// State is only updated if the order is currently fillable.\n /// Otherwise, updating state would have no effect.\n /// @param order that was cancelled.\n /// @param orderHash Hash of order that was cancelled.\n function updateCancelledState(\n Order memory order,\n bytes32 orderHash\n )\n internal\n {\n // Perform cancel\n cancelled[orderHash] = true;\n\n // Log cancel\n emit Cancel(\n order.makerAddress,\n order.feeRecipientAddress,\n msg.sender,\n orderHash,\n order.makerAssetData,\n order.takerAssetData\n );\n }\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAddress Address of order taker.\n /// @param signature Proof that the orders was created by its maker.\n function assertFillableOrder(\n Order memory order,\n OrderInfo memory orderInfo,\n address takerAddress,\n bytes memory signature\n )\n internal\n view\n {\n // An order can only be filled if its status is FILLABLE.\n require(\n orderInfo.orderStatus == uint8(OrderStatus.FILLABLE),\n \"ORDER_UNFILLABLE\"\n );\n \n // Validate sender is allowed to fill this order\n if (order.senderAddress != address(0)) {\n require(\n order.senderAddress == msg.sender,\n \"INVALID_SENDER\"\n );\n }\n \n // Validate taker is allowed to fill this order\n if (order.takerAddress != address(0)) {\n require(\n order.takerAddress == takerAddress,\n \"INVALID_TAKER\"\n );\n }\n \n // Validate Maker signature (check only if first time seen)\n if (orderInfo.orderTakerAssetFilledAmount == 0) {\n require(\n isValidSignature(\n orderInfo.orderHash,\n order.makerAddress,\n signature\n ),\n \"INVALID_ORDER_SIGNATURE\"\n );\n }\n }\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAssetFillAmount Desired amount of order to fill by taker.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @param makerAssetFilledAmount Amount of makerAsset that will be transfered.\n function assertValidFill(\n Order memory order,\n OrderInfo memory orderInfo,\n uint256 takerAssetFillAmount, // TODO: use FillResults\n uint256 takerAssetFilledAmount,\n uint256 makerAssetFilledAmount\n )\n internal\n view\n {\n // Revert if fill amount is invalid\n // TODO: reconsider necessity for v2.1\n require(\n takerAssetFillAmount != 0,\n \"INVALID_TAKER_AMOUNT\"\n );\n \n // Make sure taker does not pay more than desired amount\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n takerAssetFilledAmount <= takerAssetFillAmount,\n \"TAKER_OVERPAY\"\n );\n \n // Make sure order is not overfilled\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n safeAdd(orderInfo.orderTakerAssetFilledAmount, takerAssetFilledAmount) <= order.takerAssetAmount,\n \"ORDER_OVERFILL\"\n );\n \n // Make sure order is filled at acceptable price.\n // The order has an implied price from the makers perspective:\n // order price = order.makerAssetAmount / order.takerAssetAmount\n // i.e. the number of makerAsset maker is paying per takerAsset. The\n // maker is guaranteed to get this price or a better (lower) one. The\n // actual price maker is getting in this fill is:\n // fill price = makerAssetFilledAmount / takerAssetFilledAmount\n // We need `fill price <= order price` for the fill to be fair to maker.\n // This amounts to:\n // makerAssetFilledAmount order.makerAssetAmount\n // ------------------------ <= -----------------------\n // takerAssetFilledAmount order.takerAssetAmount\n // or, equivalently:\n // makerAssetFilledAmount * order.takerAssetAmount <=\n // order.makerAssetAmount * takerAssetFilledAmount\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n safeMul(makerAssetFilledAmount, order.takerAssetAmount)\n <= \n safeMul(order.makerAssetAmount, takerAssetFilledAmount),\n \"INVALID_FILL_PRICE\"\n );\n }\n\n /// @dev Validates context for cancelOrder. Succeeds or throws.\n /// @param order to be cancelled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n function assertValidCancel(\n Order memory order,\n OrderInfo memory orderInfo\n )\n internal\n view\n {\n // Ensure order is valid\n // An order can only be cancelled if its status is FILLABLE.\n require(\n orderInfo.orderStatus == uint8(OrderStatus.FILLABLE),\n \"ORDER_UNFILLABLE\"\n );\n\n // Validate sender is allowed to cancel this order\n if (order.senderAddress != address(0)) {\n require(\n order.senderAddress == msg.sender,\n \"INVALID_SENDER\"\n );\n }\n\n // Validate transaction signed by maker\n address makerAddress = getCurrentContextAddress();\n require(\n order.makerAddress == makerAddress,\n \"INVALID_MAKER\"\n );\n }\n\n /// @dev Calculates amounts filled and fees paid by maker and taker.\n /// @param order to be filled.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function calculateFillResults(\n Order memory order,\n uint256 takerAssetFilledAmount\n )\n internal\n pure\n returns (FillResults memory fillResults)\n {\n // Compute proportional transfer amounts\n fillResults.takerAssetFilledAmount = takerAssetFilledAmount;\n fillResults.makerAssetFilledAmount = safeGetPartialAmountFloor(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.makerAssetAmount\n );\n fillResults.makerFeePaid = safeGetPartialAmountFloor(\n fillResults.makerAssetFilledAmount,\n order.makerAssetAmount,\n order.makerFee\n );\n fillResults.takerFeePaid = safeGetPartialAmountFloor(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.takerFee\n );\n\n return fillResults;\n }\n\n /// @dev Settles an order by transferring assets between counterparties.\n /// @param order Order struct containing order specifications.\n /// @param takerAddress Address selling takerAsset and buying makerAsset.\n /// @param fillResults Amounts to be filled and fees paid by maker and taker.\n function settleOrder(\n LibOrder.Order memory order,\n address takerAddress,\n LibFillResults.FillResults memory fillResults\n )\n private\n {\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n dispatchTransferFrom(\n order.makerAssetData,\n order.makerAddress,\n takerAddress,\n fillResults.makerAssetFilledAmount\n );\n dispatchTransferFrom(\n order.takerAssetData,\n takerAddress,\n order.makerAddress,\n fillResults.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n zrxAssetData,\n order.makerAddress,\n order.feeRecipientAddress,\n fillResults.makerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n order.feeRecipientAddress,\n fillResults.takerFeePaid\n );\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinMatchOrders.sol": "/*\n Copyright 2018 ZeroEx Intl.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n http://www.apache.org/licenses/LICENSE-2.0\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MMatchOrders.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\n\n\ncontract MixinMatchOrders is\n ReentrancyGuard,\n LibConstants,\n LibMath,\n MAssetProxyDispatcher,\n MExchangeCore,\n MMatchOrders,\n MTransactions\n{\n /// @dev Match two complementary orders that have a profitable spread.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the left order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftSignature Proof that order was created by the left maker.\n /// @param rightSignature Proof that order was created by the right maker.\n /// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.\n function matchOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n bytes memory leftSignature,\n bytes memory rightSignature\n )\n public\n nonReentrant\n returns (LibFillResults.MatchedFillResults memory matchedFillResults)\n {\n // We assume that rightOrder.takerAssetData == leftOrder.makerAssetData and rightOrder.makerAssetData == leftOrder.takerAssetData.\n // If this assumption isn't true, the match will fail at signature validation.\n rightOrder.makerAssetData = leftOrder.takerAssetData;\n rightOrder.takerAssetData = leftOrder.makerAssetData;\n\n // Get left & right order info\n LibOrder.OrderInfo memory leftOrderInfo = getOrderInfo(leftOrder);\n LibOrder.OrderInfo memory rightOrderInfo = getOrderInfo(rightOrder);\n\n // Fetch taker address\n address takerAddress = getCurrentContextAddress();\n \n // Either our context is valid or we revert\n assertFillableOrder(\n leftOrder,\n leftOrderInfo,\n takerAddress,\n leftSignature\n );\n assertFillableOrder(\n rightOrder,\n rightOrderInfo,\n takerAddress,\n rightSignature\n );\n assertValidMatch(leftOrder, rightOrder);\n\n // Compute proportional fill amounts\n matchedFillResults = calculateMatchedFillResults(\n leftOrder,\n rightOrder,\n leftOrderInfo.orderTakerAssetFilledAmount,\n rightOrderInfo.orderTakerAssetFilledAmount\n );\n\n // Validate fill contexts\n assertValidFill(\n leftOrder,\n leftOrderInfo,\n matchedFillResults.left.takerAssetFilledAmount,\n matchedFillResults.left.takerAssetFilledAmount,\n matchedFillResults.left.makerAssetFilledAmount\n );\n assertValidFill(\n rightOrder,\n rightOrderInfo,\n matchedFillResults.right.takerAssetFilledAmount,\n matchedFillResults.right.takerAssetFilledAmount,\n matchedFillResults.right.makerAssetFilledAmount\n );\n \n // Update exchange state\n updateFilledState(\n leftOrder,\n takerAddress,\n leftOrderInfo.orderHash,\n leftOrderInfo.orderTakerAssetFilledAmount,\n matchedFillResults.left\n );\n updateFilledState(\n rightOrder,\n takerAddress,\n rightOrderInfo.orderHash,\n rightOrderInfo.orderTakerAssetFilledAmount,\n matchedFillResults.right\n );\n\n // Settle matched orders. Succeeds or throws.\n settleMatchedOrders(\n leftOrder,\n rightOrder,\n takerAddress,\n matchedFillResults\n );\n\n return matchedFillResults;\n }\n\n /// @dev Validates context for matchOrders. Succeeds or throws.\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n function assertValidMatch(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder\n )\n internal\n pure\n {\n // Make sure there is a profitable spread.\n // There is a profitable spread iff the cost per unit bought (OrderA.MakerAmount/OrderA.TakerAmount) for each order is greater\n // than the profit per unit sold of the matched order (OrderB.TakerAmount/OrderB.MakerAmount).\n // This is satisfied by the equations below:\n // <leftOrder.makerAssetAmount> / <leftOrder.takerAssetAmount> >= <rightOrder.takerAssetAmount> / <rightOrder.makerAssetAmount>\n // AND\n // <rightOrder.makerAssetAmount> / <rightOrder.takerAssetAmount> >= <leftOrder.takerAssetAmount> / <leftOrder.makerAssetAmount>\n // These equations can be combined to get the following:\n require(\n safeMul(leftOrder.makerAssetAmount, rightOrder.makerAssetAmount) >=\n safeMul(leftOrder.takerAssetAmount, rightOrder.takerAssetAmount),\n \"NEGATIVE_SPREAD_REQUIRED\"\n );\n }\n\n /// @dev Calculates fill amounts for the matched orders.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the leftOrder order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftOrderTakerAssetFilledAmount Amount of left order already filled.\n /// @param rightOrderTakerAssetFilledAmount Amount of right order already filled.\n /// @param matchedFillResults Amounts to fill and fees to pay by maker and taker of matched orders.\n function calculateMatchedFillResults(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n uint256 leftOrderTakerAssetFilledAmount,\n uint256 rightOrderTakerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.MatchedFillResults memory matchedFillResults)\n {\n // Derive maker asset amounts for left & right orders, given store taker assert amounts\n uint256 leftTakerAssetAmountRemaining = safeSub(leftOrder.takerAssetAmount, leftOrderTakerAssetFilledAmount);\n uint256 leftMakerAssetAmountRemaining = safeGetPartialAmountFloor(\n leftOrder.makerAssetAmount,\n leftOrder.takerAssetAmount,\n leftTakerAssetAmountRemaining\n );\n uint256 rightTakerAssetAmountRemaining = safeSub(rightOrder.takerAssetAmount, rightOrderTakerAssetFilledAmount);\n uint256 rightMakerAssetAmountRemaining = safeGetPartialAmountFloor(\n rightOrder.makerAssetAmount,\n rightOrder.takerAssetAmount,\n rightTakerAssetAmountRemaining\n );\n\n // Calculate fill results for maker and taker assets: at least one order will be fully filled.\n // The maximum amount the left maker can buy is `leftTakerAssetAmountRemaining`\n // The maximum amount the right maker can sell is `rightMakerAssetAmountRemaining`\n // We have two distinct cases for calculating the fill results:\n // Case 1.\n // If the left maker can buy more than the right maker can sell, then only the right order is fully filled.\n // If the left maker can buy exactly what the right maker can sell, then both orders are fully filled.\n // Case 2.\n // If the left maker cannot buy more than the right maker can sell, then only the left order is fully filled.\n if (leftTakerAssetAmountRemaining >= rightMakerAssetAmountRemaining) {\n // Case 1: Right order is fully filled\n matchedFillResults.right.makerAssetFilledAmount = rightMakerAssetAmountRemaining;\n matchedFillResults.right.takerAssetFilledAmount = rightTakerAssetAmountRemaining;\n matchedFillResults.left.takerAssetFilledAmount = matchedFillResults.right.makerAssetFilledAmount;\n // Round down to ensure the maker's exchange rate does not exceed the price specified by the order. \n // We favor the maker when the exchange rate must be rounded.\n matchedFillResults.left.makerAssetFilledAmount = safeGetPartialAmountFloor(\n leftOrder.makerAssetAmount,\n leftOrder.takerAssetAmount,\n matchedFillResults.left.takerAssetFilledAmount\n );\n } else {\n // Case 2: Left order is fully filled\n matchedFillResults.left.makerAssetFilledAmount = leftMakerAssetAmountRemaining;\n matchedFillResults.left.takerAssetFilledAmount = leftTakerAssetAmountRemaining;\n matchedFillResults.right.makerAssetFilledAmount = matchedFillResults.left.takerAssetFilledAmount;\n // Round up to ensure the maker's exchange rate does not exceed the price specified by the order.\n // We favor the maker when the exchange rate must be rounded.\n matchedFillResults.right.takerAssetFilledAmount = safeGetPartialAmountCeil(\n rightOrder.takerAssetAmount,\n rightOrder.makerAssetAmount,\n matchedFillResults.right.makerAssetFilledAmount\n );\n }\n\n // Calculate amount given to taker\n matchedFillResults.leftMakerAssetSpreadAmount = safeSub(\n matchedFillResults.left.makerAssetFilledAmount,\n matchedFillResults.right.takerAssetFilledAmount\n );\n\n // Compute fees for left order\n matchedFillResults.left.makerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.left.makerAssetFilledAmount,\n leftOrder.makerAssetAmount,\n leftOrder.makerFee\n );\n matchedFillResults.left.takerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.left.takerAssetFilledAmount,\n leftOrder.takerAssetAmount,\n leftOrder.takerFee\n );\n\n // Compute fees for right order\n matchedFillResults.right.makerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.right.makerAssetFilledAmount,\n rightOrder.makerAssetAmount,\n rightOrder.makerFee\n );\n matchedFillResults.right.takerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.right.takerAssetFilledAmount,\n rightOrder.takerAssetAmount,\n rightOrder.takerFee\n );\n\n // Return fill results\n return matchedFillResults;\n }\n\n /// @dev Settles matched order by transferring appropriate funds between order makers, taker, and fee recipient.\n /// @param leftOrder First matched order.\n /// @param rightOrder Second matched order.\n /// @param takerAddress Address that matched the orders. The taker receives the spread between orders as profit.\n /// @param matchedFillResults Struct holding amounts to transfer between makers, taker, and fee recipients.\n function settleMatchedOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n address takerAddress,\n LibFillResults.MatchedFillResults memory matchedFillResults\n )\n private\n {\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n // Order makers and taker\n dispatchTransferFrom(\n leftOrder.makerAssetData,\n leftOrder.makerAddress,\n rightOrder.makerAddress,\n matchedFillResults.right.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n rightOrder.makerAssetData,\n rightOrder.makerAddress,\n leftOrder.makerAddress,\n matchedFillResults.left.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n leftOrder.makerAssetData,\n leftOrder.makerAddress,\n takerAddress,\n matchedFillResults.leftMakerAssetSpreadAmount\n );\n\n // Maker fees\n dispatchTransferFrom(\n zrxAssetData,\n leftOrder.makerAddress,\n leftOrder.feeRecipientAddress,\n matchedFillResults.left.makerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n rightOrder.makerAddress,\n rightOrder.feeRecipientAddress,\n matchedFillResults.right.makerFeePaid\n );\n\n // Taker fees\n if (leftOrder.feeRecipientAddress == rightOrder.feeRecipientAddress) {\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n leftOrder.feeRecipientAddress,\n safeAdd(\n matchedFillResults.left.takerFeePaid,\n matchedFillResults.right.takerFeePaid\n )\n );\n } else {\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n leftOrder.feeRecipientAddress,\n matchedFillResults.left.takerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n rightOrder.feeRecipientAddress,\n matchedFillResults.right.takerFeePaid\n );\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinSignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./interfaces/IWallet.sol\";\nimport \"./interfaces/IValidator.sol\";\n\n\ncontract MixinSignatureValidator is\n ReentrancyGuard,\n MSignatureValidator,\n MTransactions\n{\n using LibBytes for bytes;\n \n // Mapping of hash => signer => signed\n mapping (bytes32 => mapping (address => bool)) public preSigned;\n\n // Mapping of signer => validator => approved\n mapping (address => mapping (address => bool)) public allowedValidators;\n\n /// @dev Approves a hash on-chain using any valid signature type.\n /// After presigning a hash, the preSign signature type will become valid for that hash and signer.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n function preSign(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external\n {\n if (signerAddress != msg.sender) {\n require(\n isValidSignature(\n hash,\n signerAddress,\n signature\n ),\n \"INVALID_SIGNATURE\"\n );\n }\n preSigned[hash][signerAddress] = true;\n }\n\n /// @dev Approves/unnapproves a Validator contract to verify signatures on signer's behalf.\n /// @param validatorAddress Address of Validator contract.\n /// @param approval Approval or disapproval of Validator contract.\n function setSignatureValidatorApproval(\n address validatorAddress,\n bool approval\n )\n external\n nonReentrant\n {\n address signerAddress = getCurrentContextAddress();\n allowedValidators[signerAddress][validatorAddress] = approval;\n emit SignatureValidatorApproval(\n signerAddress,\n validatorAddress,\n approval\n );\n }\n\n /// @dev Verifies that a hash has been signed by the given signer.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes memory signature\n )\n public\n view\n returns (bool isValid)\n {\n require(\n signature.length > 0,\n \"LENGTH_GREATER_THAN_0_REQUIRED\"\n );\n\n // Pop last byte off of signature byte array.\n uint8 signatureTypeRaw = uint8(signature.popLastByte());\n\n // Ensure signature is supported\n require(\n signatureTypeRaw < uint8(SignatureType.NSignatureTypes),\n \"SIGNATURE_UNSUPPORTED\"\n );\n\n SignatureType signatureType = SignatureType(signatureTypeRaw);\n\n // Variables are not scoped in Solidity.\n uint8 v;\n bytes32 r;\n bytes32 s;\n address recovered;\n\n // Always illegal signature.\n // This is always an implicit option since a signer can create a\n // signature array with invalid type or length. We may as well make\n // it an explicit option. This aids testing and analysis. It is\n // also the initialization value for the enum type.\n if (signatureType == SignatureType.Illegal) {\n revert(\"SIGNATURE_ILLEGAL\");\n\n // Always invalid signature.\n // Like Illegal, this is always implicitly available and therefore\n // offered explicitly. It can be implicitly created by providing\n // a correctly formatted but incorrect signature.\n } else if (signatureType == SignatureType.Invalid) {\n require(\n signature.length == 0,\n \"LENGTH_0_REQUIRED\"\n );\n isValid = false;\n return isValid;\n\n // Signature using EIP712\n } else if (signatureType == SignatureType.EIP712) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n hash,\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n\n // Signed using web3.eth_sign\n } else if (signatureType == SignatureType.EthSign) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n keccak256(abi.encodePacked(\n \"\\x19Ethereum Signed Message:\\n32\",\n hash\n )),\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n\n // Signature verified by wallet contract.\n // If used with an order, the maker of the order is the wallet contract.\n } else if (signatureType == SignatureType.Wallet) {\n isValid = isValidWalletSignature(\n hash,\n signerAddress,\n signature\n );\n return isValid;\n\n // Signature verified by validator contract.\n // If used with an order, the maker of the order can still be an EOA.\n // A signature using this type should be encoded as:\n // | Offset | Length | Contents |\n // | 0x00 | x | Signature to validate |\n // | 0x00 + x | 20 | Address of validator contract |\n // | 0x14 + x | 1 | Signature type is always \"\\x06\" |\n } else if (signatureType == SignatureType.Validator) {\n // Pop last 20 bytes off of signature byte array.\n address validatorAddress = signature.popLast20Bytes();\n \n // Ensure signer has approved validator.\n if (!allowedValidators[signerAddress][validatorAddress]) {\n return false;\n }\n isValid = isValidValidatorSignature(\n validatorAddress,\n hash,\n signerAddress,\n signature\n );\n return isValid;\n\n // Signer signed hash previously using the preSign function.\n } else if (signatureType == SignatureType.PreSigned) {\n isValid = preSigned[hash][signerAddress];\n return isValid;\n }\n\n // Anything else is illegal (We do not return false because\n // the signature may actually be valid, just not in a format\n // that we currently support. In this case returning false\n // may lead the caller to incorrectly believe that the\n // signature was invalid.)\n revert(\"SIGNATURE_UNSUPPORTED\");\n }\n\n /// @dev Verifies signature using logic defined by Wallet contract.\n /// @param hash Any 32 byte hash.\n /// @param walletAddress Address that should have signed the given hash\n /// and defines its own signature verification method.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if signature is valid for given wallet..\n function isValidWalletSignature(\n bytes32 hash,\n address walletAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid)\n {\n bytes memory calldata = abi.encodeWithSelector(\n IWallet(walletAddress).isValidSignature.selector,\n hash,\n signature\n );\n assembly {\n let cdStart := add(calldata, 32)\n let success := staticcall(\n gas, // forward all gas\n walletAddress, // address of Wallet contract\n cdStart, // pointer to start of input\n mload(calldata), // length of input\n cdStart, // write output over input\n 32 // output size is 32 bytes\n )\n\n switch success\n case 0 {\n // Revert with `Error(\"WALLET_ERROR\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000c57414c4c45545f4552524f5200000000000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n case 1 {\n // Signature is valid if call did not revert and returned true\n isValid := mload(cdStart)\n }\n }\n return isValid;\n }\n\n /// @dev Verifies signature using logic defined by Validator contract.\n /// @param validatorAddress Address of validator contract.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidValidatorSignature(\n address validatorAddress,\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid)\n {\n bytes memory calldata = abi.encodeWithSelector(\n IValidator(signerAddress).isValidSignature.selector,\n hash,\n signerAddress,\n signature\n );\n assembly {\n let cdStart := add(calldata, 32)\n let success := staticcall(\n gas, // forward all gas\n validatorAddress, // address of Validator contract\n cdStart, // pointer to start of input\n mload(calldata), // length of input\n cdStart, // write output over input\n 32 // output size is 32 bytes\n )\n\n switch success\n case 0 {\n // Revert with `Error(\"VALIDATOR_ERROR\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f56414c494441544f525f4552524f5200000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n case 1 {\n // Signature is valid if call did not revert and returned true\n isValid := mload(cdStart)\n }\n }\n return isValid;\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinTransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\nimport \"./libs/LibExchangeErrors.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./libs/LibEIP712.sol\";\n\n\ncontract MixinTransactions is\n LibEIP712,\n MSignatureValidator,\n MTransactions\n{\n // Mapping of transaction hash => executed\n // This prevents transactions from being executed more than once.\n mapping (bytes32 => bool) public transactions;\n\n // Address of current transaction signer\n address public currentContextAddress;\n\n /// @dev Executes an exchange method call in the context of signer.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @param signature Proof of signer transaction by signer.\n function executeTransaction(\n uint256 salt,\n address signerAddress,\n bytes data,\n bytes signature\n )\n external\n {\n // Prevent reentrancy\n require(\n currentContextAddress == address(0),\n \"REENTRANCY_ILLEGAL\"\n );\n\n bytes32 transactionHash = hashEIP712Message(hashZeroExTransaction(\n salt,\n signerAddress,\n data\n ));\n\n // Validate transaction has not been executed\n require(\n !transactions[transactionHash],\n \"INVALID_TX_HASH\"\n );\n\n // Transaction always valid if signer is sender of transaction\n if (signerAddress != msg.sender) {\n // Validate signature\n require(\n isValidSignature(\n transactionHash,\n signerAddress,\n signature\n ),\n \"INVALID_TX_SIGNATURE\"\n );\n\n // Set the current transaction signer\n currentContextAddress = signerAddress;\n }\n\n // Execute transaction\n transactions[transactionHash] = true;\n require(\n address(this).delegatecall(data),\n \"FAILED_EXECUTION\"\n );\n\n // Reset current transaction signer if it was previously updated\n if (signerAddress != msg.sender) {\n currentContextAddress = address(0);\n }\n }\n\n /// @dev Calculates EIP712 hash of the Transaction.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @return EIP712 hash of the Transaction.\n function hashZeroExTransaction(\n uint256 salt,\n address signerAddress,\n bytes memory data\n )\n internal\n pure\n returns (bytes32 result)\n {\n bytes32 schemaHash = EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH;\n bytes32 dataHash = keccak256(data);\n\n // Assembly for more efficiently computing:\n // keccak256(abi.encodePacked(\n // EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH,\n // salt,\n // bytes32(signerAddress),\n // keccak256(data)\n // ));\n\n assembly {\n // Load free memory pointer\n let memPtr := mload(64)\n\n mstore(memPtr, schemaHash) // hash of schema\n mstore(add(memPtr, 32), salt) // salt\n mstore(add(memPtr, 64), and(signerAddress, 0xffffffffffffffffffffffffffffffffffffffff)) // signerAddress\n mstore(add(memPtr, 96), dataHash) // hash of data\n\n // Compute hash\n result := keccak256(memPtr, 128)\n }\n return result;\n }\n\n /// @dev The current function will be called in the context of this address (either 0x transaction signer or `msg.sender`).\n /// If calling a fill function, this address will represent the taker.\n /// If calling a cancel function, this address will represent the maker.\n /// @return Signer of 0x transaction if entry point is `executeTransaction`.\n /// `msg.sender` if entry point is any other function.\n function getCurrentContextAddress()\n internal\n view\n returns (address)\n {\n address currentContextAddress_ = currentContextAddress;\n address contextAddress = currentContextAddress_ == address(0) ? msg.sender : currentContextAddress_;\n return contextAddress;\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./libs/LibAbiEncoder.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MWrapperFunctions.sol\";\n\n\ncontract MixinWrapperFunctions is\n ReentrancyGuard,\n LibMath,\n LibFillResults,\n LibAbiEncoder,\n MExchangeCore,\n MWrapperFunctions\n{\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n nonReentrant\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrKillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n return fillResults;\n }\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (FillResults memory fillResults)\n {\n // ABI encode calldata for `fillOrder`\n bytes memory fillOrderCalldata = abiEncodeFillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n\n // Delegate to `fillOrder` and handle any exceptions gracefully\n assembly {\n let success := delegatecall(\n gas, // forward all gas\n address, // call address of this contract\n add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes)\n mload(fillOrderCalldata), // length of input\n fillOrderCalldata, // write output over input\n 128 // output size is 128 bytes\n )\n if success {\n mstore(fillResults, mload(fillOrderCalldata))\n mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32)))\n mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64)))\n mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96)))\n }\n }\n // fillResults values will be 0 by default if call was unsuccessful\n return fillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrKill.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrKillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrKillOrderInternal(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrders(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n bytes memory takerAssetData = orders[0].takerAssetData;\n \n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being sold by taker is the same for each order.\n // Rather than passing this in as calldata, we use the takerAssetData from the first order in all later orders.\n orders[i].takerAssetData = takerAssetData;\n\n // Calculate the remaining amount of takerAsset to sell\n uint256 remainingTakerAssetFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= takerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory takerAssetData = orders[0].takerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being sold by taker is the same for each order.\n // Rather than passing this in as calldata, we use the takerAssetData from the first order in all later orders.\n orders[i].takerAssetData = takerAssetData;\n\n // Calculate the remaining amount of takerAsset to sell\n uint256 remainingTakerAssetFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= takerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerAsset is bought by taker.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrders(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // Rather than passing this in as calldata, we copy the makerAssetData from the first order onto all later orders.\n orders[i].makerAssetData = makerAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n if (totalFillResults.makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // Rather than passing this in as calldata, we copy the makerAssetData from the first order onto all later orders.\n orders[i].makerAssetData = makerAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n if (totalFillResults.makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously cancels multiple orders in a single transaction.\n /// @param orders Array of order specifications.\n function batchCancelOrders(LibOrder.Order[] memory orders)\n public\n nonReentrant\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n cancelOrderInternal(orders[i]);\n }\n }\n\n /// @dev Fetches information for all passed in orders.\n /// @param orders Array of order specifications.\n /// @return Array of OrderInfo instances that correspond to each order.\n function getOrdersInfo(LibOrder.Order[] memory orders)\n public\n view\n returns (LibOrder.OrderInfo[] memory)\n {\n uint256 ordersLength = orders.length;\n LibOrder.OrderInfo[] memory ordersInfo = new LibOrder.OrderInfo[](ordersLength);\n for (uint256 i = 0; i != ordersLength; i++) {\n ordersInfo[i] = getOrderInfo(orders[i]);\n }\n return ordersInfo;\n }\n\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n require(\n fillResults.takerAssetFilledAmount == takerAssetFillAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return fillResults;\n }\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IAssetProxyDispatcher {\n\n /// @dev Registers an asset proxy to its asset proxy id.\n /// Once an asset proxy is registered, it cannot be unregistered.\n /// @param assetProxy Address of new asset proxy to register.\n function registerAssetProxy(address assetProxy)\n external;\n\n /// @dev Gets an asset proxy.\n /// @param assetProxyId Id of the asset proxy.\n /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered.\n function getAssetProxy(bytes4 assetProxyId)\n external\n view\n returns (address);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IExchange.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./IExchangeCore.sol\";\nimport \"./IMatchOrders.sol\";\nimport \"./ISignatureValidator.sol\";\nimport \"./ITransactions.sol\";\nimport \"./IAssetProxyDispatcher.sol\";\nimport \"./IWrapperFunctions.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract IExchange is\n IExchangeCore,\n IMatchOrders,\n ISignatureValidator,\n ITransactions,\n IAssetProxyDispatcher,\n IWrapperFunctions\n{}\n",
- "2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IExchangeCore {\n\n /// @dev Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch\n /// and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress).\n /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled.\n function cancelOrdersUpTo(uint256 targetOrderEpoch)\n external;\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev After calling, the order can not be filled anymore.\n /// @param order Order struct containing order specifications.\n function cancelOrder(LibOrder.Order memory order)\n public;\n\n /// @dev Gets information about an order: status, hash, and amount filled.\n /// @param order Order to gather information on.\n /// @return OrderInfo Information about the order and its state.\n /// See LibOrder.OrderInfo for a complete description.\n function getOrderInfo(LibOrder.Order memory order)\n public\n view\n returns (LibOrder.OrderInfo memory orderInfo);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IMatchOrders {\n\n /// @dev Match two complementary orders that have a profitable spread.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the left order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftSignature Proof that order was created by the left maker.\n /// @param rightSignature Proof that order was created by the right maker.\n /// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.\n function matchOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n bytes memory leftSignature,\n bytes memory rightSignature\n )\n public\n returns (LibFillResults.MatchedFillResults memory matchedFillResults);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract ISignatureValidator {\n\n /// @dev Approves a hash on-chain using any valid signature type.\n /// After presigning a hash, the preSign signature type will become valid for that hash and signer.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n function preSign(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external;\n \n /// @dev Approves/unnapproves a Validator contract to verify signatures on signer's behalf.\n /// @param validatorAddress Address of Validator contract.\n /// @param approval Approval or disapproval of Validator contract.\n function setSignatureValidatorApproval(\n address validatorAddress,\n bool approval\n )\n external;\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signerAddress Address of signer.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes memory signature\n )\n public\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/ITransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\n\ncontract ITransactions {\n\n /// @dev Executes an exchange method call in the context of signer.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @param signature Proof of signer transaction by signer.\n function executeTransaction(\n uint256 salt,\n address signerAddress,\n bytes data,\n bytes signature\n )\n external;\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IValidator {\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IWallet.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IWallet {\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n bytes signature\n )\n external\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IWrapperFunctions {\n\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrKill.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrKillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrders(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerAsset is bought by taker.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrders(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously cancels multiple orders in a single transaction.\n /// @param orders Array of order specifications.\n function batchCancelOrders(LibOrder.Order[] memory orders)\n public;\n\n /// @dev Fetches information for all passed in orders\n /// @param orders Array of order specifications.\n /// @return Array of OrderInfo instances that correspond to each order.\n function getOrdersInfo(LibOrder.Order[] memory orders)\n public\n view\n returns (LibOrder.OrderInfo[] memory);\n}\n",
- "2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./LibOrder.sol\";\n\n\ncontract LibAbiEncoder {\n\n /// @dev ABI encodes calldata for `fillOrder`.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return ABI encoded calldata for `fillOrder`.\n function abiEncodeFillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n pure\n returns (bytes memory fillOrderCalldata)\n {\n // We need to call MExchangeCore.fillOrder using a delegatecall in\n // assembly so that we can intercept a call that throws. For this, we\n // need the input encoded in memory in the Ethereum ABIv2 format [1].\n\n // | Area | Offset | Length | Contents |\n // | -------- |--------|---------|-------------------------------------------- |\n // | Header | 0x00 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 0x00 | | 1. offset to order (*) |\n // | | 0x20 | | 2. takerAssetFillAmount |\n // | | 0x40 | | 3. offset to signature (*) |\n // | Data | | 12 * 32 | order: |\n // | | 0x000 | | 1. senderAddress |\n // | | 0x020 | | 2. makerAddress |\n // | | 0x040 | | 3. takerAddress |\n // | | 0x060 | | 4. feeRecipientAddress |\n // | | 0x080 | | 5. makerAssetAmount |\n // | | 0x0A0 | | 6. takerAssetAmount |\n // | | 0x0C0 | | 7. makerFeeAmount |\n // | | 0x0E0 | | 8. takerFeeAmount |\n // | | 0x100 | | 9. expirationTimeSeconds |\n // | | 0x120 | | 10. salt |\n // | | 0x140 | | 11. Offset to makerAssetData (*) |\n // | | 0x160 | | 12. Offset to takerAssetData (*) |\n // | | 0x180 | 32 | makerAssetData Length |\n // | | 0x1A0 | ** | makerAssetData Contents |\n // | | 0x1C0 | 32 | takerAssetData Length |\n // | | 0x1E0 | ** | takerAssetData Contents |\n // | | 0x200 | 32 | signature Length |\n // | | 0x220 | ** | signature Contents |\n\n // * Offsets are calculated from the beginning of the current area: Header, Params, Data:\n // An offset stored in the Params area is calculated from the beginning of the Params section.\n // An offset stored in the Data area is calculated from the beginning of the Data section.\n\n // ** The length of dynamic array contents are stored in the field immediately preceeding the contents.\n\n // [1]: https://solidity.readthedocs.io/en/develop/abi-spec.html\n\n assembly {\n\n // Areas below may use the following variables:\n // 1. <area>Start -- Start of this area in memory\n // 2. <area>End -- End of this area in memory. This value may\n // be precomputed (before writing contents),\n // or it may be computed as contents are written.\n // 3. <area>Offset -- Current offset into area. If an area's End\n // is precomputed, this variable tracks the\n // offsets of contents as they are written.\n\n /////// Setup Header Area ///////\n // Load free memory pointer\n fillOrderCalldata := mload(0x40)\n // bytes4(keccak256(\"fillOrder((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),uint256,bytes)\"))\n // = 0xb4be83d5\n // Leave 0x20 bytes to store the length\n mstore(add(fillOrderCalldata, 0x20), 0xb4be83d500000000000000000000000000000000000000000000000000000000)\n let headerAreaEnd := add(fillOrderCalldata, 0x24)\n\n /////// Setup Params Area ///////\n // This area is preallocated and written to later.\n // This is because we need to fill in offsets that have not yet been calculated.\n let paramsAreaStart := headerAreaEnd\n let paramsAreaEnd := add(paramsAreaStart, 0x60)\n let paramsAreaOffset := paramsAreaStart\n\n /////// Setup Data Area ///////\n let dataAreaStart := paramsAreaEnd\n let dataAreaEnd := dataAreaStart\n\n // Offset from the source data we're reading from\n let sourceOffset := order\n // arrayLenBytes and arrayLenWords track the length of a dynamically-allocated bytes array.\n let arrayLenBytes := 0\n let arrayLenWords := 0\n\n /////// Write order Struct ///////\n // Write memory location of Order, relative to the start of the\n // parameter list, then increment the paramsAreaOffset respectively.\n mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))\n paramsAreaOffset := add(paramsAreaOffset, 0x20)\n\n // Write values for each field in the order\n // It would be nice to use a loop, but we save on gas by writing\n // the stores sequentially.\n mstore(dataAreaEnd, mload(sourceOffset)) // makerAddress\n mstore(add(dataAreaEnd, 0x20), mload(add(sourceOffset, 0x20))) // takerAddress\n mstore(add(dataAreaEnd, 0x40), mload(add(sourceOffset, 0x40))) // feeRecipientAddress\n mstore(add(dataAreaEnd, 0x60), mload(add(sourceOffset, 0x60))) // senderAddress\n mstore(add(dataAreaEnd, 0x80), mload(add(sourceOffset, 0x80))) // makerAssetAmount\n mstore(add(dataAreaEnd, 0xA0), mload(add(sourceOffset, 0xA0))) // takerAssetAmount\n mstore(add(dataAreaEnd, 0xC0), mload(add(sourceOffset, 0xC0))) // makerFeeAmount\n mstore(add(dataAreaEnd, 0xE0), mload(add(sourceOffset, 0xE0))) // takerFeeAmount\n mstore(add(dataAreaEnd, 0x100), mload(add(sourceOffset, 0x100))) // expirationTimeSeconds\n mstore(add(dataAreaEnd, 0x120), mload(add(sourceOffset, 0x120))) // salt\n mstore(add(dataAreaEnd, 0x140), mload(add(sourceOffset, 0x140))) // Offset to makerAssetData\n mstore(add(dataAreaEnd, 0x160), mload(add(sourceOffset, 0x160))) // Offset to takerAssetData\n dataAreaEnd := add(dataAreaEnd, 0x180)\n sourceOffset := add(sourceOffset, 0x180)\n\n // Write offset to <order.makerAssetData>\n mstore(add(dataAreaStart, mul(10, 0x20)), sub(dataAreaEnd, dataAreaStart))\n\n // Calculate length of <order.makerAssetData>\n sourceOffset := mload(add(order, 0x140)) // makerAssetData\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of <order.makerAssetData>\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of <order.makerAssetData>\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n // Write offset to <order.takerAssetData>\n mstore(add(dataAreaStart, mul(11, 0x20)), sub(dataAreaEnd, dataAreaStart))\n\n // Calculate length of <order.takerAssetData>\n sourceOffset := mload(add(order, 0x160)) // takerAssetData\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of <order.takerAssetData>\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of <order.takerAssetData>\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n /////// Write takerAssetFillAmount ///////\n mstore(paramsAreaOffset, takerAssetFillAmount)\n paramsAreaOffset := add(paramsAreaOffset, 0x20)\n\n /////// Write signature ///////\n // Write offset to paramsArea\n mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))\n\n // Calculate length of signature\n sourceOffset := signature\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of signature\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of signature\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n // Set length of calldata\n mstore(fillOrderCalldata, sub(dataAreaEnd, add(fillOrderCalldata, 0x20)))\n\n // Increment free memory pointer\n mstore(0x40, dataAreaEnd)\n }\n\n return fillOrderCalldata;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibConstants.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\n// solhint-disable max-line-length\ncontract LibConstants {\n \n // Asset data for ZRX token. Used for fee transfers.\n // @TODO: Hardcode constant when we deploy. Currently \n // not constant to make testing easier.\n\n // The proxyId for ZRX_ASSET_DATA is bytes4(keccak256(\"ERC20Token(address)\")) = 0xf47261b0\n \n // Kovan ZRX address is 0x6ff6c0ff1d68b964901f986d4c9fa3ac68346570.\n // The ABI encoded proxyId and address is 0xf47261b00000000000000000000000006ff6c0ff1d68b964901f986d4c9fa3ac68346570\n // bytes constant public ZRX_ASSET_DATA = \"\\xf4\\x72\\x61\\xb0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x6f\\xf6\\xc0\\xff\\x1d\\x68\\xb9\\x64\\x90\\x1f\\x98\\x6d\\x4c\\x9f\\xa3\\xac\\x68\\x34\\x65\\x70\";\n \n // Mainnet ZRX address is 0xe41d2489571d322189246dafa5ebde1f4699f498.\n // The ABI encoded proxyId and address is 0xf47261b0000000000000000000000000e41d2489571d322189246dafa5ebde1f4699f498\n // bytes constant public ZRX_ASSET_DATA = \"\\xf4\\x72\\x61\\xb0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xe4\\x1d\\x24\\x89\\x57\\x1d\\x32\\x21\\x89\\x24\\x6d\\xaf\\xa5\\xeb\\xde\\x1f\\x46\\x99\\xf4\\x98\";\n \n // solhint-disable-next-line var-name-mixedcase\n bytes public ZRX_ASSET_DATA;\n\n // @TODO: Remove when we deploy.\n constructor (bytes memory zrxAssetData)\n public\n {\n ZRX_ASSET_DATA = zrxAssetData;\n }\n}\n// solhint-enable max-line-length\n",
- "2.0.0/protocol/Exchange/libs/LibEIP712.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract LibEIP712 {\n\n // EIP191 header for EIP712 prefix\n string constant internal EIP191_HEADER = \"\\x19\\x01\";\n\n // EIP712 Domain Name value\n string constant internal EIP712_DOMAIN_NAME = \"0x Protocol\";\n\n // EIP712 Domain Version value\n string constant internal EIP712_DOMAIN_VERSION = \"2\";\n\n // Hash of the EIP712 Domain Separator Schema\n bytes32 constant internal EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"EIP712Domain(\",\n \"string name,\",\n \"string version,\",\n \"address verifyingContract\",\n \")\"\n ));\n\n // Hash of the EIP712 Domain Separator data\n // solhint-disable-next-line var-name-mixedcase\n bytes32 public EIP712_DOMAIN_HASH;\n\n constructor ()\n public\n {\n EIP712_DOMAIN_HASH = keccak256(abi.encodePacked(\n EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH,\n keccak256(bytes(EIP712_DOMAIN_NAME)),\n keccak256(bytes(EIP712_DOMAIN_VERSION)),\n bytes32(address(this))\n ));\n }\n\n /// @dev Calculates EIP712 encoding for a hash struct in this EIP712 Domain.\n /// @param hashStruct The EIP712 hash struct.\n /// @return EIP712 hash applied to this EIP712 Domain.\n function hashEIP712Message(bytes32 hashStruct)\n internal\n view\n returns (bytes32 result)\n {\n bytes32 eip712DomainHash = EIP712_DOMAIN_HASH;\n\n // Assembly for more efficient computing:\n // keccak256(abi.encodePacked(\n // EIP191_HEADER,\n // EIP712_DOMAIN_HASH,\n // hashStruct \n // ));\n\n assembly {\n // Load free memory pointer\n let memPtr := mload(64)\n\n mstore(memPtr, 0x1901000000000000000000000000000000000000000000000000000000000000) // EIP191 header\n mstore(add(memPtr, 2), eip712DomainHash) // EIP712 domain hash\n mstore(add(memPtr, 34), hashStruct) // Hash of struct\n\n // Compute hash\n result := keccak256(memPtr, 66)\n }\n return result;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\n// solhint-disable\npragma solidity 0.4.24;\n\n\n/// @dev This contract documents the revert reasons used in the Exchange contract.\n/// This contract is intended to serve as a reference, but is not actually used for efficiency reasons.\ncontract LibExchangeErrors {\n\n /// Order validation errors ///\n string constant ORDER_UNFILLABLE = \"ORDER_UNFILLABLE\"; // Order cannot be filled.\n string constant INVALID_MAKER = \"INVALID_MAKER\"; // Invalid makerAddress.\n string constant INVALID_TAKER = \"INVALID_TAKER\"; // Invalid takerAddress.\n string constant INVALID_SENDER = \"INVALID_SENDER\"; // Invalid `msg.sender`.\n string constant INVALID_ORDER_SIGNATURE = \"INVALID_ORDER_SIGNATURE\"; // Signature validation failed. \n \n /// fillOrder validation errors ///\n string constant INVALID_TAKER_AMOUNT = \"INVALID_TAKER_AMOUNT\"; // takerAssetFillAmount cannot equal 0.\n string constant ROUNDING_ERROR = \"ROUNDING_ERROR\"; // Rounding error greater than 0.1% of takerAssetFillAmount. \n \n /// Signature validation errors ///\n string constant INVALID_SIGNATURE = \"INVALID_SIGNATURE\"; // Signature validation failed. \n string constant SIGNATURE_ILLEGAL = \"SIGNATURE_ILLEGAL\"; // Signature type is illegal.\n string constant SIGNATURE_UNSUPPORTED = \"SIGNATURE_UNSUPPORTED\"; // Signature type unsupported.\n \n /// cancelOrdersUptTo errors ///\n string constant INVALID_NEW_ORDER_EPOCH = \"INVALID_NEW_ORDER_EPOCH\"; // Specified salt must be greater than or equal to existing orderEpoch.\n\n /// fillOrKillOrder errors ///\n string constant COMPLETE_FILL_FAILED = \"COMPLETE_FILL_FAILED\"; // Desired takerAssetFillAmount could not be completely filled. \n\n /// matchOrders errors ///\n string constant NEGATIVE_SPREAD_REQUIRED = \"NEGATIVE_SPREAD_REQUIRED\"; // Matched orders must have a negative spread.\n\n /// Transaction errors ///\n string constant REENTRANCY_ILLEGAL = \"REENTRANCY_ILLEGAL\"; // Recursive reentrancy is not allowed. \n string constant INVALID_TX_HASH = \"INVALID_TX_HASH\"; // Transaction has already been executed. \n string constant INVALID_TX_SIGNATURE = \"INVALID_TX_SIGNATURE\"; // Signature validation failed. \n string constant FAILED_EXECUTION = \"FAILED_EXECUTION\"; // Transaction execution failed. \n \n /// registerAssetProxy errors ///\n string constant ASSET_PROXY_ALREADY_EXISTS = \"ASSET_PROXY_ALREADY_EXISTS\"; // AssetProxy with same id already exists.\n\n /// dispatchTransferFrom errors ///\n string constant ASSET_PROXY_DOES_NOT_EXIST = \"ASSET_PROXY_DOES_NOT_EXIST\"; // No assetProxy registered at given id.\n string constant TRANSFER_FAILED = \"TRANSFER_FAILED\"; // Asset transfer unsuccesful.\n\n /// Length validation errors ///\n string constant LENGTH_GREATER_THAN_0_REQUIRED = \"LENGTH_GREATER_THAN_0_REQUIRED\"; // Byte array must have a length greater than 0.\n string constant LENGTH_GREATER_THAN_3_REQUIRED = \"LENGTH_GREATER_THAN_3_REQUIRED\"; // Byte array must have a length greater than 3.\n string constant LENGTH_0_REQUIRED = \"LENGTH_0_REQUIRED\"; // Byte array must have a length of 0.\n string constant LENGTH_65_REQUIRED = \"LENGTH_65_REQUIRED\"; // Byte array must have a length of 65.\n}\n",
- "2.0.0/protocol/Exchange/libs/LibFillResults.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract LibFillResults is\n SafeMath\n{\n struct FillResults {\n uint256 makerAssetFilledAmount; // Total amount of makerAsset(s) filled.\n uint256 takerAssetFilledAmount; // Total amount of takerAsset(s) filled.\n uint256 makerFeePaid; // Total amount of ZRX paid by maker(s) to feeRecipient(s).\n uint256 takerFeePaid; // Total amount of ZRX paid by taker to feeRecipients(s).\n }\n\n struct MatchedFillResults {\n FillResults left; // Amounts filled and fees paid of left order.\n FillResults right; // Amounts filled and fees paid of right order.\n uint256 leftMakerAssetSpreadAmount; // Spread between price of left and right order, denominated in the left order's makerAsset, paid to taker.\n }\n\n /// @dev Adds properties of both FillResults instances.\n /// Modifies the first FillResults instance specified.\n /// @param totalFillResults Fill results instance that will be added onto.\n /// @param singleFillResults Fill results instance that will be added to totalFillResults.\n function addFillResults(FillResults memory totalFillResults, FillResults memory singleFillResults)\n internal\n pure\n {\n totalFillResults.makerAssetFilledAmount = safeAdd(totalFillResults.makerAssetFilledAmount, singleFillResults.makerAssetFilledAmount);\n totalFillResults.takerAssetFilledAmount = safeAdd(totalFillResults.takerAssetFilledAmount, singleFillResults.takerAssetFilledAmount);\n totalFillResults.makerFeePaid = safeAdd(totalFillResults.makerFeePaid, singleFillResults.makerFeePaid);\n totalFillResults.takerFeePaid = safeAdd(totalFillResults.takerFeePaid, singleFillResults.takerFeePaid);\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibMath.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract LibMath is\n SafeMath\n{\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// Reverts if rounding error is >= 0.1%\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded down.\n function safeGetPartialAmountFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n require(\n !isRoundingErrorFloor(\n numerator,\n denominator,\n target\n ),\n \"ROUNDING_ERROR\"\n );\n \n partialAmount = safeDiv(\n safeMul(numerator, target),\n denominator\n );\n return partialAmount;\n }\n\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// Reverts if rounding error is >= 0.1%\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded up.\n function safeGetPartialAmountCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n require(\n !isRoundingErrorCeil(\n numerator,\n denominator,\n target\n ),\n \"ROUNDING_ERROR\"\n );\n \n // safeDiv computes `floor(a / b)`. We use the identity (a, b integer):\n // ceil(a / b) = floor((a + b - 1) / b)\n // To implement `ceil(a / b)` using safeDiv.\n partialAmount = safeDiv(\n safeAdd(\n safeMul(numerator, target),\n safeSub(denominator, 1)\n ),\n denominator\n );\n return partialAmount;\n }\n\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded down.\n function getPartialAmountFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n partialAmount = safeDiv(\n safeMul(numerator, target),\n denominator\n );\n return partialAmount;\n }\n \n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded up.\n function getPartialAmountCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n // safeDiv computes `floor(a / b)`. We use the identity (a, b integer):\n // ceil(a / b) = floor((a + b - 1) / b)\n // To implement `ceil(a / b)` using safeDiv.\n partialAmount = safeDiv(\n safeAdd(\n safeMul(numerator, target),\n safeSub(denominator, 1)\n ),\n denominator\n );\n return partialAmount;\n }\n \n /// @dev Checks if rounding error >= 0.1% when rounding down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to multiply with numerator/denominator.\n /// @return Rounding error is present.\n function isRoundingErrorFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (bool isError)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n \n // The absolute rounding error is the difference between the rounded\n // value and the ideal value. The relative rounding error is the\n // absolute rounding error divided by the absolute value of the\n // ideal value. This is undefined when the ideal value is zero.\n //\n // The ideal value is `numerator * target / denominator`.\n // Let's call `numerator * target % denominator` the remainder.\n // The absolute error is `remainder / denominator`.\n //\n // When the ideal value is zero, we require the absolute error to\n // be zero. Fortunately, this is always the case. The ideal value is\n // zero iff `numerator == 0` and/or `target == 0`. In this case the\n // remainder and absolute error are also zero. \n if (target == 0 || numerator == 0) {\n return false;\n }\n \n // Otherwise, we want the relative rounding error to be strictly\n // less than 0.1%.\n // The relative error is `remainder / (numerator * target)`.\n // We want the relative error less than 1 / 1000:\n // remainder / (numerator * denominator) < 1 / 1000\n // or equivalently:\n // 1000 * remainder < numerator * target\n // so we have a rounding error iff:\n // 1000 * remainder >= numerator * target\n uint256 remainder = mulmod(\n target,\n numerator,\n denominator\n );\n isError = safeMul(1000, remainder) >= safeMul(numerator, target);\n return isError;\n }\n \n /// @dev Checks if rounding error >= 0.1% when rounding up.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to multiply with numerator/denominator.\n /// @return Rounding error is present.\n function isRoundingErrorCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (bool isError)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n \n // See the comments in `isRoundingError`.\n if (target == 0 || numerator == 0) {\n // When either is zero, the ideal value and rounded value are zero\n // and there is no rounding error. (Although the relative error\n // is undefined.)\n return false;\n }\n // Compute remainder as before\n uint256 remainder = mulmod(\n target,\n numerator,\n denominator\n );\n remainder = safeSub(denominator, remainder) % denominator;\n isError = safeMul(1000, remainder) >= safeMul(numerator, target);\n return isError;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibOrder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./LibEIP712.sol\";\n\n\ncontract LibOrder is\n LibEIP712\n{\n // Hash for the EIP712 Order Schema\n bytes32 constant internal EIP712_ORDER_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"Order(\",\n \"address makerAddress,\",\n \"address takerAddress,\",\n \"address feeRecipientAddress,\",\n \"address senderAddress,\",\n \"uint256 makerAssetAmount,\",\n \"uint256 takerAssetAmount,\",\n \"uint256 makerFee,\",\n \"uint256 takerFee,\",\n \"uint256 expirationTimeSeconds,\",\n \"uint256 salt,\",\n \"bytes makerAssetData,\",\n \"bytes takerAssetData\",\n \")\"\n ));\n\n // A valid order remains fillable until it is expired, fully filled, or cancelled.\n // An order's state is unaffected by external factors, like account balances.\n enum OrderStatus {\n INVALID, // Default value\n INVALID_MAKER_ASSET_AMOUNT, // Order does not have a valid maker asset amount\n INVALID_TAKER_ASSET_AMOUNT, // Order does not have a valid taker asset amount\n FILLABLE, // Order is fillable\n EXPIRED, // Order has already expired\n FULLY_FILLED, // Order is fully filled\n CANCELLED // Order has been cancelled\n }\n\n // solhint-disable max-line-length\n struct Order {\n address makerAddress; // Address that created the order. \n address takerAddress; // Address that is allowed to fill the order. If set to 0, any address is allowed to fill the order. \n address feeRecipientAddress; // Address that will recieve fees when order is filled. \n address senderAddress; // Address that is allowed to call Exchange contract methods that affect this order. If set to 0, any address is allowed to call these methods.\n uint256 makerAssetAmount; // Amount of makerAsset being offered by maker. Must be greater than 0. \n uint256 takerAssetAmount; // Amount of takerAsset being bid on by maker. Must be greater than 0. \n uint256 makerFee; // Amount of ZRX paid to feeRecipient by maker when order is filled. If set to 0, no transfer of ZRX from maker to feeRecipient will be attempted.\n uint256 takerFee; // Amount of ZRX paid to feeRecipient by taker when order is filled. If set to 0, no transfer of ZRX from taker to feeRecipient will be attempted.\n uint256 expirationTimeSeconds; // Timestamp in seconds at which order expires. \n uint256 salt; // Arbitrary number to facilitate uniqueness of the order's hash. \n bytes makerAssetData; // Encoded data that can be decoded by a specified proxy contract when transferring makerAsset. The last byte references the id of this proxy.\n bytes takerAssetData; // Encoded data that can be decoded by a specified proxy contract when transferring takerAsset. The last byte references the id of this proxy.\n }\n // solhint-enable max-line-length\n\n struct OrderInfo {\n uint8 orderStatus; // Status that describes order's validity and fillability.\n bytes32 orderHash; // EIP712 hash of the order (see LibOrder.getOrderHash).\n uint256 orderTakerAssetFilledAmount; // Amount of order that has already been filled.\n }\n\n /// @dev Calculates Keccak-256 hash of the order.\n /// @param order The order structure.\n /// @return Keccak-256 EIP712 hash of the order.\n function getOrderHash(Order memory order)\n internal\n view\n returns (bytes32 orderHash)\n {\n orderHash = hashEIP712Message(hashOrder(order));\n return orderHash;\n }\n\n /// @dev Calculates EIP712 hash of the order.\n /// @param order The order structure.\n /// @return EIP712 hash of the order.\n function hashOrder(Order memory order)\n internal\n pure\n returns (bytes32 result)\n {\n bytes32 schemaHash = EIP712_ORDER_SCHEMA_HASH;\n bytes32 makerAssetDataHash = keccak256(order.makerAssetData);\n bytes32 takerAssetDataHash = keccak256(order.takerAssetData);\n\n // Assembly for more efficiently computing:\n // keccak256(abi.encodePacked(\n // EIP712_ORDER_SCHEMA_HASH,\n // bytes32(order.makerAddress),\n // bytes32(order.takerAddress),\n // bytes32(order.feeRecipientAddress),\n // bytes32(order.senderAddress),\n // order.makerAssetAmount,\n // order.takerAssetAmount,\n // order.makerFee,\n // order.takerFee,\n // order.expirationTimeSeconds,\n // order.salt,\n // keccak256(order.makerAssetData),\n // keccak256(order.takerAssetData)\n // ));\n\n assembly {\n // Calculate memory addresses that will be swapped out before hashing\n let pos1 := sub(order, 32)\n let pos2 := add(order, 320)\n let pos3 := add(order, 352)\n\n // Backup\n let temp1 := mload(pos1)\n let temp2 := mload(pos2)\n let temp3 := mload(pos3)\n \n // Hash in place\n mstore(pos1, schemaHash)\n mstore(pos2, makerAssetDataHash)\n mstore(pos3, takerAssetDataHash)\n result := keccak256(pos1, 416)\n \n // Restore\n mstore(pos1, temp1)\n mstore(pos2, temp2)\n mstore(pos3, temp3)\n }\n return result;\n }\n}\n",
- "2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAssetProxyDispatcher.sol\";\n\n\ncontract MAssetProxyDispatcher is\n IAssetProxyDispatcher\n{\n // Logs registration of new asset proxy\n event AssetProxyRegistered(\n bytes4 id, // Id of new registered AssetProxy.\n address assetProxy // Address of new registered AssetProxy.\n );\n\n /// @dev Forwards arguments to assetProxy and calls `transferFrom`. Either succeeds or throws.\n /// @param assetData Byte array encoded for the asset.\n /// @param from Address to transfer token from.\n /// @param to Address to transfer token to.\n /// @param amount Amount of token to transfer.\n function dispatchTransferFrom(\n bytes memory assetData,\n address from,\n address to,\n uint256 amount\n )\n internal;\n}\n",
- "2.0.0/protocol/Exchange/mixins/MExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IExchangeCore.sol\";\n\n\ncontract MExchangeCore is\n IExchangeCore\n{\n // Fill event is emitted whenever an order is filled.\n event Fill(\n address indexed makerAddress, // Address that created the order. \n address indexed feeRecipientAddress, // Address that received fees.\n address takerAddress, // Address that filled the order.\n address senderAddress, // Address that called the Exchange contract (msg.sender).\n uint256 makerAssetFilledAmount, // Amount of makerAsset sold by maker and bought by taker. \n uint256 takerAssetFilledAmount, // Amount of takerAsset sold by taker and bought by maker.\n uint256 makerFeePaid, // Amount of ZRX paid to feeRecipient by maker.\n uint256 takerFeePaid, // Amount of ZRX paid to feeRecipient by taker.\n bytes32 indexed orderHash, // EIP712 hash of order (see LibOrder.getOrderHash).\n bytes makerAssetData, // Encoded data specific to makerAsset. \n bytes takerAssetData // Encoded data specific to takerAsset.\n );\n\n // Cancel event is emitted whenever an individual order is cancelled.\n event Cancel(\n address indexed makerAddress, // Address that created the order. \n address indexed feeRecipientAddress, // Address that would have recieved fees if order was filled. \n address senderAddress, // Address that called the Exchange contract (msg.sender).\n bytes32 indexed orderHash, // EIP712 hash of order (see LibOrder.getOrderHash).\n bytes makerAssetData, // Encoded data specific to makerAsset. \n bytes takerAssetData // Encoded data specific to takerAsset.\n );\n\n // CancelUpTo event is emitted whenever `cancelOrdersUpTo` is executed succesfully.\n event CancelUpTo(\n address indexed makerAddress, // Orders cancelled must have been created by this address.\n address indexed senderAddress, // Orders cancelled must have a `senderAddress` equal to this address.\n uint256 orderEpoch // Orders with specified makerAddress and senderAddress with a salt less than this value are considered cancelled.\n );\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev After calling, the order can not be filled anymore.\n /// @param order Order struct containing order specifications.\n function cancelOrderInternal(LibOrder.Order memory order)\n internal;\n\n /// @dev Updates state with results of a fill order.\n /// @param order that was filled.\n /// @param takerAddress Address of taker who filled the order.\n /// @param orderTakerAssetFilledAmount Amount of order already filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function updateFilledState(\n LibOrder.Order memory order,\n address takerAddress,\n bytes32 orderHash,\n uint256 orderTakerAssetFilledAmount,\n LibFillResults.FillResults memory fillResults\n )\n internal;\n\n /// @dev Updates state with results of cancelling an order.\n /// State is only updated if the order is currently fillable.\n /// Otherwise, updating state would have no effect.\n /// @param order that was cancelled.\n /// @param orderHash Hash of order that was cancelled.\n function updateCancelledState(\n LibOrder.Order memory order,\n bytes32 orderHash\n )\n internal;\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAddress Address of order taker.\n /// @param signature Proof that the orders was created by its maker.\n function assertFillableOrder(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo,\n address takerAddress,\n bytes memory signature\n )\n internal\n view;\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo Status, orderHash, and amount already filled of order.\n /// @param takerAssetFillAmount Desired amount of order to fill by taker.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @param makerAssetFilledAmount Amount of makerAsset that will be transfered.\n function assertValidFill(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo,\n uint256 takerAssetFillAmount,\n uint256 takerAssetFilledAmount,\n uint256 makerAssetFilledAmount\n )\n internal\n view;\n\n /// @dev Validates context for cancelOrder. Succeeds or throws.\n /// @param order to be cancelled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n function assertValidCancel(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo\n )\n internal\n view;\n\n /// @dev Calculates amounts filled and fees paid by maker and taker.\n /// @param order to be filled.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function calculateFillResults(\n LibOrder.Order memory order,\n uint256 takerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.FillResults memory fillResults);\n\n}\n",
- "2.0.0/protocol/Exchange/mixins/MMatchOrders.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IMatchOrders.sol\";\n\n\ncontract MMatchOrders is\n IMatchOrders\n{\n /// @dev Validates context for matchOrders. Succeeds or throws.\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n function assertValidMatch(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder\n )\n internal\n pure;\n\n /// @dev Calculates fill amounts for the matched orders.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the leftOrder order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftOrderTakerAssetFilledAmount Amount of left order already filled.\n /// @param rightOrderTakerAssetFilledAmount Amount of right order already filled.\n /// @param matchedFillResults Amounts to fill and fees to pay by maker and taker of matched orders.\n function calculateMatchedFillResults(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n uint256 leftOrderTakerAssetFilledAmount,\n uint256 rightOrderTakerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.MatchedFillResults memory matchedFillResults);\n\n}\n",
- "2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/ISignatureValidator.sol\";\n\n\ncontract MSignatureValidator is\n ISignatureValidator\n{\n event SignatureValidatorApproval(\n address indexed signerAddress, // Address that approves or disapproves a contract to verify signatures.\n address indexed validatorAddress, // Address of signature validator contract.\n bool approved // Approval or disapproval of validator contract.\n );\n\n // Allowed signature types.\n enum SignatureType {\n Illegal, // 0x00, default value\n Invalid, // 0x01\n EIP712, // 0x02\n EthSign, // 0x03\n Wallet, // 0x04\n Validator, // 0x05\n PreSigned, // 0x06\n NSignatureTypes // 0x07, number of signature types. Always leave at end.\n }\n\n /// @dev Verifies signature using logic defined by Wallet contract.\n /// @param hash Any 32 byte hash.\n /// @param walletAddress Address that should have signed the given hash\n /// and defines its own signature verification method.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidWalletSignature(\n bytes32 hash,\n address walletAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid);\n\n /// @dev Verifies signature using logic defined by Validator contract.\n /// @param validatorAddress Address of validator contract.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidValidatorSignature(\n address validatorAddress,\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/mixins/MTransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\nimport \"../interfaces/ITransactions.sol\";\n\n\ncontract MTransactions is\n ITransactions\n{\n // Hash for the EIP712 ZeroEx Transaction Schema\n bytes32 constant internal EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"ZeroExTransaction(\",\n \"uint256 salt,\",\n \"address signerAddress,\",\n \"bytes data\",\n \")\"\n ));\n\n /// @dev Calculates EIP712 hash of the Transaction.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @return EIP712 hash of the Transaction.\n function hashZeroExTransaction(\n uint256 salt,\n address signerAddress,\n bytes memory data\n )\n internal\n pure\n returns (bytes32 result);\n\n /// @dev The current function will be called in the context of this address (either 0x transaction signer or `msg.sender`).\n /// If calling a fill function, this address will represent the taker.\n /// If calling a cancel function, this address will represent the maker.\n /// @return Signer of 0x transaction if entry point is `executeTransaction`.\n /// `msg.sender` if entry point is any other function.\n function getCurrentContextAddress()\n internal\n view\n returns (address);\n}\n",
- "2.0.0/protocol/Exchange/mixins/MWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IWrapperFunctions.sol\";\n\n\ncontract MWrapperFunctions is \n IWrapperFunctions\n{\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n}\n",
- "2.0.0/test/DummyERC20Token/DummyERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"../../tokens/ERC20Token/MintableERC20Token.sol\";\n\n\ncontract DummyERC20Token is \n Ownable,\n MintableERC20Token\n{\n string public name;\n string public symbol;\n uint256 public decimals;\n uint256 public constant MAX_MINT_AMOUNT = 10000000000000000000000;\n\n constructor (\n string _name,\n string _symbol,\n uint256 _decimals,\n uint256 _totalSupply\n )\n public\n {\n name = _name;\n symbol = _symbol;\n decimals = _decimals;\n _totalSupply = _totalSupply;\n balances[msg.sender] = _totalSupply;\n }\n\n /// @dev Sets the balance of target address\n /// @param _target Address or which balance will be updated\n /// @param _value New balance of target address\n function setBalance(address _target, uint256 _value)\n external\n onlyOwner\n {\n uint256 currBalance = balances[_target];\n if (_value < currBalance) {\n _totalSupply = safeSub(_totalSupply, safeSub(currBalance, _value));\n } else {\n _totalSupply = safeAdd(_totalSupply, safeSub(_value, currBalance));\n }\n balances[_target] = _value;\n }\n\n /// @dev Mints new tokens for sender\n /// @param _value Amount of tokens to mint\n function mint(uint256 _value)\n external\n {\n require(\n _value <= MAX_MINT_AMOUNT,\n \"VALUE_TOO_LARGE\"\n );\n\n _mint(msg.sender, _value);\n }\n}\n",
- "2.0.0/test/DummyERC721Token/DummyERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../tokens/ERC721Token/MintableERC721Token.sol\";\nimport \"../../utils/Ownable/Ownable.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract DummyERC721Token is\n Ownable,\n MintableERC721Token\n{\n string public name;\n string public symbol;\n\n constructor (\n string _name,\n string _symbol\n )\n public\n {\n name = _name;\n symbol = _symbol;\n }\n\n /// @dev Function to mint a new token\n /// Reverts if the given token ID already exists\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _tokenId ID of the token to be minted by the msg.sender \n function mint(address _to, uint256 _tokenId)\n external\n {\n _mint(_to, _tokenId);\n }\n\n /// @dev Function to burn a token\n /// Reverts if the given token ID doesn't exist or not called by contract owner\n /// @param _owner Owner of token with given token ID\n /// @param _tokenId ID of the token to be burned by the msg.sender\n function burn(address _owner, uint256 _tokenId)\n external\n onlyOwner\n {\n _burn(_owner, _tokenId);\n }\n}\n",
- "2.0.0/tokens/ERC20Token/ERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IERC20Token.sol\";\n\n\ncontract ERC20Token is\n IERC20Token\n{\n mapping (address => uint256) internal balances;\n mapping (address => mapping (address => uint256)) internal allowed;\n\n uint256 internal _totalSupply;\n\n /// @dev send `value` token to `to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transfer(address _to, uint256 _value)\n external\n returns (bool)\n {\n require(\n balances[msg.sender] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[msg.sender] -= _value;\n balances[_to] += _value;\n\n emit Transfer(\n msg.sender,\n _to,\n _value\n );\n\n return true;\n }\n\n /// @dev send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool)\n {\n require(\n balances[_from] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n allowed[_from][msg.sender] >= _value,\n \"ERC20_INSUFFICIENT_ALLOWANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[_to] += _value;\n balances[_from] -= _value;\n allowed[_from][msg.sender] -= _value;\n \n emit Transfer(\n _from,\n _to,\n _value\n );\n \n return true;\n }\n\n /// @dev `msg.sender` approves `_spender` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Always true if the call has enough gas to complete execution\n function approve(address _spender, uint256 _value)\n external\n returns (bool)\n {\n allowed[msg.sender][_spender] = _value;\n emit Approval(\n msg.sender,\n _spender,\n _value\n );\n return true;\n }\n\n /// @dev Query total supply of token\n /// @return Total supply of token\n function totalSupply()\n external\n view\n returns (uint256)\n {\n return _totalSupply;\n }\n\n /// @dev Query the balance of owner\n /// @param _owner The address from which the balance will be retrieved\n /// @return Balance of owner\n function balanceOf(address _owner)\n external\n view\n returns (uint256)\n {\n return balances[_owner];\n }\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender)\n external\n view\n returns (uint256)\n {\n return allowed[_owner][_spender];\n }\n}\n",
- "2.0.0/tokens/ERC20Token/IERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC20Token {\n\n // solhint-disable no-simple-event-func-name\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 _value\n );\n\n event Approval(\n address indexed _owner,\n address indexed _spender,\n uint256 _value\n );\n\n /// @dev send `value` token to `to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transfer(address _to, uint256 _value)\n external\n returns (bool);\n\n /// @dev send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool);\n \n /// @dev `msg.sender` approves `_spender` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Always true if the call has enough gas to complete execution\n function approve(address _spender, uint256 _value)\n external\n returns (bool);\n\n /// @dev Query total supply of token\n /// @return Total supply of token\n function totalSupply()\n external\n view\n returns (uint256);\n \n /// @param _owner The address from which the balance will be retrieved\n /// @return Balance of owner\n function balanceOf(address _owner)\n external\n view\n returns (uint256);\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender)\n external\n view\n returns (uint256);\n}\n",
- "2.0.0/tokens/ERC20Token/MintableERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/SafeMath/SafeMath.sol\";\nimport \"./UnlimitedAllowanceERC20Token.sol\";\n\n\ncontract MintableERC20Token is \n SafeMath,\n UnlimitedAllowanceERC20Token\n{\n /// @dev Mints new tokens\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _value Amount of tokens to mint\n function _mint(address _to, uint256 _value)\n internal\n {\n balances[_to] = safeAdd(_value, balances[_to]);\n _totalSupply = safeAdd(_totalSupply, _value);\n\n emit Transfer(\n address(0),\n _to,\n _value\n );\n }\n\n /// @dev Mints new tokens\n /// @param _owner Owner of tokens that will be burned\n /// @param _value Amount of tokens to burn\n function _burn(address _owner, uint256 _value)\n internal\n {\n balances[_owner] = safeSub(balances[_owner], _value);\n _totalSupply = safeSub(_totalSupply, _value);\n\n emit Transfer(\n _owner,\n address(0),\n _value\n );\n }\n}\n",
- "2.0.0/tokens/ERC20Token/UnlimitedAllowanceERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../ERC20Token/ERC20Token.sol\";\n\n\ncontract UnlimitedAllowanceERC20Token is\n ERC20Token\n{\n uint256 constant internal MAX_UINT = 2**256 - 1;\n\n /// @dev ERC20 transferFrom, modified such that an allowance of MAX_UINT represents an unlimited allowance. See https://github.com/ethereum/EIPs/issues/717\n /// @param _from Address to transfer from.\n /// @param _to Address to transfer to.\n /// @param _value Amount to transfer.\n /// @return Success of transfer.\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool)\n {\n uint256 allowance = allowed[_from][msg.sender];\n require(\n balances[_from] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n allowance >= _value,\n \"ERC20_INSUFFICIENT_ALLOWANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[_to] += _value;\n balances[_from] -= _value;\n if (allowance < MAX_UINT) {\n allowed[_from][msg.sender] -= _value;\n }\n\n emit Transfer(\n _from,\n _to,\n _value\n );\n\n return true;\n }\n}\n",
- "2.0.0/tokens/ERC721Token/ERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IERC721Token.sol\";\nimport \"./IERC721Receiver.sol\";\nimport \"../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract ERC721Token is\n IERC721Token,\n SafeMath\n{\n // Function selector for ERC721Receiver.onERC721Received\n // 0x150b7a02\n bytes4 constant internal ERC721_RECEIVED = bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"));\n\n // Mapping of tokenId => owner\n mapping (uint256 => address) internal owners;\n\n // Mapping of tokenId => approved address\n mapping (uint256 => address) internal approvals;\n\n // Mapping of owner => number of tokens owned\n mapping (address => uint256) internal balances;\n\n // Mapping of owner => operator => approved\n mapping (address => mapping (address => bool)) internal operatorApprovals;\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT. When transfer is complete, this function\n /// checks if `_to` is a smart contract (code size > 0). If so, it calls\n /// `onERC721Received` on `_to` and throws if the return value is not\n /// `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n /// @param _data Additional data with no specified format, sent in call to `_to`\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId,\n bytes _data\n )\n external\n {\n transferFrom(\n _from,\n _to,\n _tokenId\n );\n\n uint256 receiverCodeSize;\n assembly {\n receiverCodeSize := extcodesize(_to)\n }\n if (receiverCodeSize > 0) {\n bytes4 selector = IERC721Receiver(_to).onERC721Received(\n msg.sender,\n _from,\n _tokenId,\n _data\n );\n require(\n selector == ERC721_RECEIVED,\n \"ERC721_INVALID_SELECTOR\"\n );\n }\n }\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev This works identically to the other function with an extra data parameter,\n /// except this function just sets data to \"\".\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n external\n {\n transferFrom(\n _from,\n _to,\n _tokenId\n );\n\n uint256 receiverCodeSize;\n assembly {\n receiverCodeSize := extcodesize(_to)\n }\n if (receiverCodeSize > 0) {\n bytes4 selector = IERC721Receiver(_to).onERC721Received(\n msg.sender,\n _from,\n _tokenId,\n \"\"\n );\n require(\n selector == ERC721_RECEIVED,\n \"ERC721_INVALID_SELECTOR\"\n );\n }\n }\n\n /// @notice Change or reaffirm the approved address for an NFT\n /// @dev The zero address indicates there is no approved address.\n /// Throws unless `msg.sender` is the current NFT owner, or an authorized\n /// operator of the current owner.\n /// @param _approved The new approved NFT controller\n /// @param _tokenId The NFT to approve\n function approve(address _approved, uint256 _tokenId)\n external\n {\n address owner = ownerOf(_tokenId);\n require(\n msg.sender == owner || isApprovedForAll(owner, msg.sender),\n \"ERC721_INVALID_SENDER\"\n );\n\n approvals[_tokenId] = _approved;\n emit Approval(\n owner,\n _approved,\n _tokenId\n );\n }\n\n /// @notice Enable or disable approval for a third party (\"operator\") to manage\n /// all of `msg.sender`'s assets\n /// @dev Emits the ApprovalForAll event. The contract MUST allow\n /// multiple operators per owner.\n /// @param _operator Address to add to the set of authorized operators\n /// @param _approved True if the operator is approved, false to revoke approval\n function setApprovalForAll(address _operator, bool _approved)\n external\n {\n operatorApprovals[msg.sender][_operator] = _approved;\n emit ApprovalForAll(\n msg.sender,\n _operator,\n _approved\n );\n }\n \n /// @notice Count all NFTs assigned to an owner\n /// @dev NFTs assigned to the zero address are considered invalid, and this\n /// function throws for queries about the zero address.\n /// @param _owner An address for whom to query the balance\n /// @return The number of NFTs owned by `_owner`, possibly zero\n function balanceOf(address _owner)\n external\n view\n returns (uint256)\n {\n require(\n _owner != address(0),\n \"ERC721_ZERO_OWNER\"\n );\n return balances[_owner];\n }\n\n /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE\n /// TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE\n /// THEY MAY BE PERMANENTLY LOST\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function transferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n public\n {\n require(\n _to != address(0),\n \"ERC721_ZERO_TO_ADDRESS\"\n );\n\n address owner = ownerOf(_tokenId);\n require(\n _from == owner,\n \"ERC721_OWNER_MISMATCH\"\n );\n\n address spender = msg.sender;\n address approvedAddress = getApproved(_tokenId);\n require(\n spender == owner ||\n isApprovedForAll(owner, spender) ||\n approvedAddress == spender,\n \"ERC721_INVALID_SPENDER\"\n );\n\n if (approvedAddress != address(0)) {\n approvals[_tokenId] = address(0);\n }\n\n owners[_tokenId] = _to;\n balances[_from] = safeSub(balances[_from], 1);\n balances[_to] = safeAdd(balances[_to], 1);\n \n emit Transfer(\n _from,\n _to,\n _tokenId\n );\n }\n\n /// @notice Find the owner of an NFT\n /// @dev NFTs assigned to zero address are considered invalid, and queries\n /// about them do throw.\n /// @param _tokenId The identifier for an NFT\n /// @return The address of the owner of the NFT\n function ownerOf(uint256 _tokenId)\n public\n view\n returns (address)\n {\n address owner = owners[_tokenId];\n require(\n owner != address(0),\n \"ERC721_ZERO_OWNER\"\n );\n return owner;\n }\n\n /// @notice Get the approved address for a single NFT\n /// @dev Throws if `_tokenId` is not a valid NFT.\n /// @param _tokenId The NFT to find the approved address for\n /// @return The approved address for this NFT, or the zero address if there is none\n function getApproved(uint256 _tokenId)\n public\n view\n returns (address)\n {\n return approvals[_tokenId];\n }\n\n /// @notice Query if an address is an authorized operator for another address\n /// @param _owner The address that owns the NFTs\n /// @param _operator The address that acts on behalf of the owner\n /// @return True if `_operator` is an approved operator for `_owner`, false otherwise\n function isApprovedForAll(address _owner, address _operator)\n public\n view\n returns (bool)\n {\n return operatorApprovals[_owner][_operator];\n }\n}\n",
- "2.0.0/tokens/ERC721Token/IERC721Receiver.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC721Receiver {\n\n /// @notice Handle the receipt of an NFT\n /// @dev The ERC721 smart contract calls this function on the recipient\n /// after a `transfer`. This function MAY throw to revert and reject the\n /// transfer. Return of other than the magic value MUST result in the\n /// transaction being reverted.\n /// Note: the contract address is always the message sender.\n /// @param _operator The address which called `safeTransferFrom` function\n /// @param _from The address which previously owned the token\n /// @param _tokenId The NFT identifier which is being transferred\n /// @param _data Additional data with no specified format\n /// @return `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`\n /// unless throwing\n function onERC721Received(\n address _operator,\n address _from,\n uint256 _tokenId,\n bytes _data\n )\n external\n returns (bytes4);\n}\n",
- "2.0.0/tokens/ERC721Token/IERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC721Token {\n\n /// @dev This emits when ownership of any NFT changes by any mechanism.\n /// This event emits when NFTs are created (`from` == 0) and destroyed\n /// (`to` == 0). Exception: during contract creation, any number of NFTs\n /// may be created and assigned without emitting Transfer. At the time of\n /// any transfer, the approved address for that NFT (if any) is reset to none.\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 indexed _tokenId\n );\n\n /// @dev This emits when the approved address for an NFT is changed or\n /// reaffirmed. The zero address indicates there is no approved address.\n /// When a Transfer event emits, this also indicates that the approved\n /// address for that NFT (if any) is reset to none.\n event Approval(\n address indexed _owner,\n address indexed _approved,\n uint256 indexed _tokenId\n );\n\n /// @dev This emits when an operator is enabled or disabled for an owner.\n /// The operator can manage all NFTs of the owner.\n event ApprovalForAll(\n address indexed _owner,\n address indexed _operator,\n bool _approved\n );\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// perator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT. When transfer is complete, this function\n /// checks if `_to` is a smart contract (code size > 0). If so, it calls\n /// `onERC721Received` on `_to` and throws if the return value is not\n /// `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n /// @param _data Additional data with no specified format, sent in call to `_to`\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId,\n bytes _data\n )\n external;\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev This works identically to the other function with an extra data parameter,\n /// except this function just sets data to \"\".\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n external;\n\n /// @notice Change or reaffirm the approved address for an NFT\n /// @dev The zero address indicates there is no approved address.\n /// Throws unless `msg.sender` is the current NFT owner, or an authorized\n /// operator of the current owner.\n /// @param _approved The new approved NFT controller\n /// @param _tokenId The NFT to approve\n function approve(address _approved, uint256 _tokenId)\n external;\n\n /// @notice Enable or disable approval for a third party (\"operator\") to manage\n /// all of `msg.sender`'s assets\n /// @dev Emits the ApprovalForAll event. The contract MUST allow\n /// multiple operators per owner.\n /// @param _operator Address to add to the set of authorized operators\n /// @param _approved True if the operator is approved, false to revoke approval\n function setApprovalForAll(address _operator, bool _approved)\n external;\n\n /// @notice Count all NFTs assigned to an owner\n /// @dev NFTs assigned to the zero address are considered invalid, and this\n /// function throws for queries about the zero address.\n /// @param _owner An address for whom to query the balance\n /// @return The number of NFTs owned by `_owner`, possibly zero\n function balanceOf(address _owner)\n external\n view\n returns (uint256);\n\n /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE\n /// TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE\n /// THEY MAY BE PERMANENTLY LOST\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function transferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n public;\n\n /// @notice Find the owner of an NFT\n /// @dev NFTs assigned to zero address are considered invalid, and queries\n /// about them do throw.\n /// @param _tokenId The identifier for an NFT\n /// @return The address of the owner of the NFT\n function ownerOf(uint256 _tokenId)\n public\n view\n returns (address);\n\n /// @notice Get the approved address for a single NFT\n /// @dev Throws if `_tokenId` is not a valid NFT.\n /// @param _tokenId The NFT to find the approved address for\n /// @return The approved address for this NFT, or the zero address if there is none\n function getApproved(uint256 _tokenId) \n public\n view\n returns (address);\n \n /// @notice Query if an address is an authorized operator for another address\n /// @param _owner The address that owns the NFTs\n /// @param _operator The address that acts on behalf of the owner\n /// @return True if `_operator` is an approved operator for `_owner`, false otherwise\n function isApprovedForAll(address _owner, address _operator)\n public\n view\n returns (bool);\n}\n",
- "2.0.0/tokens/ERC721Token/MintableERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./ERC721Token.sol\";\n\n\ncontract MintableERC721Token is\n ERC721Token\n{\n /// @dev Function to mint a new token\n /// Reverts if the given token ID already exists\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _tokenId ID of the token to be minted by the msg.sender \n function _mint(address _to, uint256 _tokenId)\n internal\n {\n require(\n _to != address(0),\n \"ERC721_ZERO_TO_ADDRESS\"\n );\n\n address owner = owners[_tokenId];\n require(\n owner == address(0),\n \"ERC721_OWNER_ALREADY_EXISTS\"\n );\n\n owners[_tokenId] = _to;\n balances[_to] = safeAdd(balances[_to], 1);\n\n emit Transfer(\n address(0),\n _to,\n _tokenId\n );\n }\n\n /// @dev Function to burn a token\n /// Reverts if the given token ID doesn't exist\n /// @param _owner Owner of token with given token ID\n /// @param _tokenId ID of the token to be burned by the msg.sender\n function _burn(address _owner, uint256 _tokenId)\n internal\n {\n require(\n _owner != address(0),\n \"ERC721_ZERO_OWNER_ADDRESS\"\n );\n\n address owner = owners[_tokenId];\n require(\n owner == _owner,\n \"ERC721_OWNER_MISMATCH\"\n );\n\n owners[_tokenId] = address(0);\n balances[_owner] = safeSub(balances[_owner], 1);\n\n emit Transfer(\n _owner,\n address(0),\n _tokenId\n );\n }\n}\n",
- "2.0.0/tokens/EtherToken/IEtherToken.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../ERC20Token/IERC20Token.sol\";\n\n\ncontract IEtherToken is\n IERC20Token\n{\n function deposit()\n public\n payable;\n \n function withdraw(uint256 amount)\n public;\n}\n",
- "2.0.0/utils/LibBytes/LibBytes.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\nlibrary LibBytes {\n\n using LibBytes for bytes;\n\n /// @dev Gets the memory address for a byte array.\n /// @param input Byte array to lookup.\n /// @return memoryAddress Memory address of byte array. This\n /// points to the header of the byte array which contains\n /// the length.\n function rawAddress(bytes memory input)\n internal\n pure\n returns (uint256 memoryAddress)\n {\n assembly {\n memoryAddress := input\n }\n return memoryAddress;\n }\n \n /// @dev Gets the memory address for the contents of a byte array.\n /// @param input Byte array to lookup.\n /// @return memoryAddress Memory address of the contents of the byte array.\n function contentAddress(bytes memory input)\n internal\n pure\n returns (uint256 memoryAddress)\n {\n assembly {\n memoryAddress := add(input, 32)\n }\n return memoryAddress;\n }\n\n /// @dev Copies `length` bytes from memory location `source` to `dest`.\n /// @param dest memory address to copy bytes to.\n /// @param source memory address to copy bytes from.\n /// @param length number of bytes to copy.\n function memCopy(\n uint256 dest,\n uint256 source,\n uint256 length\n )\n internal\n pure\n {\n if (length < 32) {\n // Handle a partial word by reading destination and masking\n // off the bits we are interested in.\n // This correctly handles overlap, zero lengths and source == dest\n assembly {\n let mask := sub(exp(256, sub(32, length)), 1)\n let s := and(mload(source), not(mask))\n let d := and(mload(dest), mask)\n mstore(dest, or(s, d))\n }\n } else {\n // Skip the O(length) loop when source == dest.\n if (source == dest) {\n return;\n }\n\n // For large copies we copy whole words at a time. The final\n // word is aligned to the end of the range (instead of after the\n // previous) to handle partial words. So a copy will look like this:\n //\n // ####\n // ####\n // ####\n // ####\n //\n // We handle overlap in the source and destination range by\n // changing the copying direction. This prevents us from\n // overwriting parts of source that we still need to copy.\n //\n // This correctly handles source == dest\n //\n if (source > dest) {\n assembly {\n // We subtract 32 from `sEnd` and `dEnd` because it\n // is easier to compare with in the loop, and these\n // are also the addresses we need for copying the\n // last bytes.\n length := sub(length, 32)\n let sEnd := add(source, length)\n let dEnd := add(dest, length)\n\n // Remember the last 32 bytes of source\n // This needs to be done here and not after the loop\n // because we may have overwritten the last bytes in\n // source already due to overlap.\n let last := mload(sEnd)\n\n // Copy whole words front to back\n // Note: the first check is always true,\n // this could have been a do-while loop.\n // solhint-disable-next-line no-empty-blocks\n for {} lt(source, sEnd) {} {\n mstore(dest, mload(source))\n source := add(source, 32)\n dest := add(dest, 32)\n }\n \n // Write the last 32 bytes\n mstore(dEnd, last)\n }\n } else {\n assembly {\n // We subtract 32 from `sEnd` and `dEnd` because those\n // are the starting points when copying a word at the end.\n length := sub(length, 32)\n let sEnd := add(source, length)\n let dEnd := add(dest, length)\n\n // Remember the first 32 bytes of source\n // This needs to be done here and not after the loop\n // because we may have overwritten the first bytes in\n // source already due to overlap.\n let first := mload(source)\n\n // Copy whole words back to front\n // We use a signed comparisson here to allow dEnd to become\n // negative (happens when source and dest < 32). Valid\n // addresses in local memory will never be larger than\n // 2**255, so they can be safely re-interpreted as signed.\n // Note: the first check is always true,\n // this could have been a do-while loop.\n // solhint-disable-next-line no-empty-blocks\n for {} slt(dest, dEnd) {} {\n mstore(dEnd, mload(sEnd))\n sEnd := sub(sEnd, 32)\n dEnd := sub(dEnd, 32)\n }\n \n // Write the first 32 bytes\n mstore(dest, first)\n }\n }\n }\n }\n\n /// @dev Returns a slices from a byte array.\n /// @param b The byte array to take a slice from.\n /// @param from The starting index for the slice (inclusive).\n /// @param to The final index for the slice (exclusive).\n /// @return result The slice containing bytes at indices [from, to)\n function slice(\n bytes memory b,\n uint256 from,\n uint256 to\n )\n internal\n pure\n returns (bytes memory result)\n {\n require(\n from <= to,\n \"FROM_LESS_THAN_TO_REQUIRED\"\n );\n require(\n to < b.length,\n \"TO_LESS_THAN_LENGTH_REQUIRED\"\n );\n \n // Create a new bytes structure and copy contents\n result = new bytes(to - from);\n memCopy(\n result.contentAddress(),\n b.contentAddress() + from,\n result.length\n );\n return result;\n }\n \n /// @dev Returns a slice from a byte array without preserving the input.\n /// @param b The byte array to take a slice from. Will be destroyed in the process.\n /// @param from The starting index for the slice (inclusive).\n /// @param to The final index for the slice (exclusive).\n /// @return result The slice containing bytes at indices [from, to)\n /// @dev When `from == 0`, the original array will match the slice. In other cases its state will be corrupted.\n function sliceDestructive(\n bytes memory b,\n uint256 from,\n uint256 to\n )\n internal\n pure\n returns (bytes memory result)\n {\n require(\n from <= to,\n \"FROM_LESS_THAN_TO_REQUIRED\"\n );\n require(\n to < b.length,\n \"TO_LESS_THAN_LENGTH_REQUIRED\"\n );\n \n // Create a new bytes structure around [from, to) in-place.\n assembly {\n result := add(b, from)\n mstore(result, sub(to, from))\n }\n return result;\n }\n\n /// @dev Pops the last byte off of a byte array by modifying its length.\n /// @param b Byte array that will be modified.\n /// @return The byte that was popped off.\n function popLastByte(bytes memory b)\n internal\n pure\n returns (bytes1 result)\n {\n require(\n b.length > 0,\n \"GREATER_THAN_ZERO_LENGTH_REQUIRED\"\n );\n\n // Store last byte.\n result = b[b.length - 1];\n\n assembly {\n // Decrement length of byte array.\n let newLen := sub(mload(b), 1)\n mstore(b, newLen)\n }\n return result;\n }\n\n /// @dev Pops the last 20 bytes off of a byte array by modifying its length.\n /// @param b Byte array that will be modified.\n /// @return The 20 byte address that was popped off.\n function popLast20Bytes(bytes memory b)\n internal\n pure\n returns (address result)\n {\n require(\n b.length >= 20,\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Store last 20 bytes.\n result = readAddress(b, b.length - 20);\n\n assembly {\n // Subtract 20 from byte array length.\n let newLen := sub(mload(b), 20)\n mstore(b, newLen)\n }\n return result;\n }\n\n /// @dev Tests equality of two byte arrays.\n /// @param lhs First byte array to compare.\n /// @param rhs Second byte array to compare.\n /// @return True if arrays are the same. False otherwise.\n function equals(\n bytes memory lhs,\n bytes memory rhs\n )\n internal\n pure\n returns (bool equal)\n {\n // Keccak gas cost is 30 + numWords * 6. This is a cheap way to compare.\n // We early exit on unequal lengths, but keccak would also correctly\n // handle this.\n return lhs.length == rhs.length && keccak256(lhs) == keccak256(rhs);\n }\n\n /// @dev Reads an address from a position in a byte array.\n /// @param b Byte array containing an address.\n /// @param index Index in byte array of address.\n /// @return address from byte array.\n function readAddress(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (address result)\n {\n require(\n b.length >= index + 20, // 20 is length of address\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Add offset to index:\n // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)\n // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)\n index += 20;\n\n // Read address from array memory\n assembly {\n // 1. Add index to address of bytes array\n // 2. Load 32-byte word from memory\n // 3. Apply 20-byte mask to obtain address\n result := and(mload(add(b, index)), 0xffffffffffffffffffffffffffffffffffffffff)\n }\n return result;\n }\n\n /// @dev Writes an address into a specific position in a byte array.\n /// @param b Byte array to insert address into.\n /// @param index Index in byte array of address.\n /// @param input Address to put into byte array.\n function writeAddress(\n bytes memory b,\n uint256 index,\n address input\n )\n internal\n pure\n {\n require(\n b.length >= index + 20, // 20 is length of address\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Add offset to index:\n // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)\n // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)\n index += 20;\n\n // Store address into array memory\n assembly {\n // The address occupies 20 bytes and mstore stores 32 bytes.\n // First fetch the 32-byte word where we'll be storing the address, then\n // apply a mask so we have only the bytes in the word that the address will not occupy.\n // Then combine these bytes with the address and store the 32 bytes back to memory with mstore.\n\n // 1. Add index to address of bytes array\n // 2. Load 32-byte word from memory\n // 3. Apply 12-byte mask to obtain extra bytes occupying word of memory where we'll store the address\n let neighbors := and(\n mload(add(b, index)),\n 0xffffffffffffffffffffffff0000000000000000000000000000000000000000\n )\n \n // Make sure input address is clean.\n // (Solidity does not guarantee this)\n input := and(input, 0xffffffffffffffffffffffffffffffffffffffff)\n\n // Store the neighbors and address into memory\n mstore(add(b, index), xor(input, neighbors))\n }\n }\n\n /// @dev Reads a bytes32 value from a position in a byte array.\n /// @param b Byte array containing a bytes32 value.\n /// @param index Index in byte array of bytes32 value.\n /// @return bytes32 value from byte array.\n function readBytes32(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes32 result)\n {\n require(\n b.length >= index + 32,\n \"GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 256 bit length parameter\n index += 32;\n\n // Read the bytes32 from array memory\n assembly {\n result := mload(add(b, index))\n }\n return result;\n }\n\n /// @dev Writes a bytes32 into a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input bytes32 to put into byte array.\n function writeBytes32(\n bytes memory b,\n uint256 index,\n bytes32 input\n )\n internal\n pure\n {\n require(\n b.length >= index + 32,\n \"GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 256 bit length parameter\n index += 32;\n\n // Read the bytes32 from array memory\n assembly {\n mstore(add(b, index), input)\n }\n }\n\n /// @dev Reads a uint256 value from a position in a byte array.\n /// @param b Byte array containing a uint256 value.\n /// @param index Index in byte array of uint256 value.\n /// @return uint256 value from byte array.\n function readUint256(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (uint256 result)\n {\n result = uint256(readBytes32(b, index));\n return result;\n }\n\n /// @dev Writes a uint256 into a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input uint256 to put into byte array.\n function writeUint256(\n bytes memory b,\n uint256 index,\n uint256 input\n )\n internal\n pure\n {\n writeBytes32(b, index, bytes32(input));\n }\n\n /// @dev Reads an unpadded bytes4 value from a position in a byte array.\n /// @param b Byte array containing a bytes4 value.\n /// @param index Index in byte array of bytes4 value.\n /// @return bytes4 value from byte array.\n function readBytes4(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes4 result)\n {\n require(\n b.length >= index + 4,\n \"GREATER_OR_EQUAL_TO_4_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 32 byte length field\n index += 32;\n\n // Read the bytes4 from array memory\n assembly {\n result := mload(add(b, index))\n // Solidity does not require us to clean the trailing bytes.\n // We do it anyway\n result := and(result, 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000)\n }\n return result;\n }\n\n /// @dev Reads nested bytes from a specific position.\n /// @dev NOTE: the returned value overlaps with the input value.\n /// Both should be treated as immutable.\n /// @param b Byte array containing nested bytes.\n /// @param index Index of nested bytes.\n /// @return result Nested bytes.\n function readBytesWithLength(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes memory result)\n {\n // Read length of nested bytes\n uint256 nestedBytesLength = readUint256(b, index);\n index += 32;\n\n // Assert length of <b> is valid, given\n // length of nested bytes\n require(\n b.length >= index + nestedBytesLength,\n \"GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED\"\n );\n \n // Return a pointer to the byte array as it exists inside `b`\n assembly {\n result := add(b, index)\n }\n return result;\n }\n\n /// @dev Inserts bytes at a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input bytes to insert.\n function writeBytesWithLength(\n bytes memory b,\n uint256 index,\n bytes memory input\n )\n internal\n pure\n {\n // Assert length of <b> is valid, given\n // length of input\n require(\n b.length >= index + 32 + input.length, // 32 bytes to store length\n \"GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED\"\n );\n\n // Copy <input> into <b>\n memCopy(\n b.contentAddress() + index,\n input.rawAddress(), // includes length of <input>\n input.length + 32 // +32 bytes to store <input> length\n );\n }\n\n /// @dev Performs a deep copy of a byte array onto another byte array of greater than or equal length.\n /// @param dest Byte array that will be overwritten with source bytes.\n /// @param source Byte array to copy onto dest bytes.\n function deepCopyBytes(\n bytes memory dest,\n bytes memory source\n )\n internal\n pure\n {\n uint256 sourceLen = source.length;\n // Dest length must be >= source length, or some bytes would not be copied.\n require(\n dest.length >= sourceLen,\n \"GREATER_OR_EQUAL_TO_SOURCE_BYTES_LENGTH_REQUIRED\"\n );\n memCopy(\n dest.contentAddress(),\n source.contentAddress(),\n sourceLen\n );\n }\n}\n",
- "2.0.0/utils/Ownable/IOwnable.sol": "pragma solidity 0.4.24;\n\n\ncontract IOwnable {\n\n function transferOwnership(address newOwner)\n public;\n}\n",
- "2.0.0/utils/Ownable/Ownable.sol": "pragma solidity 0.4.24;\n\nimport \"./IOwnable.sol\";\n\n\ncontract Ownable is\n IOwnable\n{\n address public owner;\n\n constructor ()\n public\n {\n owner = msg.sender;\n }\n\n modifier onlyOwner() {\n require(\n msg.sender == owner,\n \"ONLY_CONTRACT_OWNER\"\n );\n _;\n }\n\n function transferOwnership(address newOwner)\n public\n onlyOwner\n {\n if (newOwner != address(0)) {\n owner = newOwner;\n }\n }\n}\n",
- "2.0.0/utils/ReentrancyGuard/ReentrancyGuard.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract ReentrancyGuard {\n\n // Locked state of mutex\n bool private locked = false;\n\n /// @dev Functions with this modifer cannot be reentered. The mutex will be locked\n /// before function execution and unlocked after.\n modifier nonReentrant() {\n // Ensure mutex is unlocked\n require(\n !locked,\n \"REENTRANCY_ILLEGAL\"\n );\n\n // Lock mutex before function call\n locked = true;\n\n // Perform function call\n _;\n\n // Unlock mutex after function call\n locked = false;\n }\n}\n",
- "2.0.0/utils/SafeMath/SafeMath.sol": "pragma solidity 0.4.24;\n\n\ncontract SafeMath {\n\n function safeMul(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n if (a == 0) {\n return 0;\n }\n uint256 c = a * b;\n require(\n c / a == b,\n \"UINT256_OVERFLOW\"\n );\n return c;\n }\n\n function safeDiv(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n uint256 c = a / b;\n return c;\n }\n\n function safeSub(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n require(\n b <= a,\n \"UINT256_UNDERFLOW\"\n );\n return a - b;\n }\n\n function safeAdd(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n uint256 c = a + b;\n require(\n c >= a,\n \"UINT256_OVERFLOW\"\n );\n return c;\n }\n\n function max64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n\n function max256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n}\n"
- },
- "sourceTreeHashHex": "0xf4217ae1c8ee6ad15913d86a30747907f26acfb4a1970ea3c8a30d45ce9171d0",
- "compiler": {
- "name": "solc",
- "version": "soljson-v0.4.24+commit.e67f0147.js",
- "settings": {
- "optimizer": {
- "enabled": true,
- "runs": 1000000
- },
- "outputSelection": {
- "*": {
- "*": [
- "abi",
- "evm.bytecode.object",
- "evm.bytecode.sourceMap",
- "evm.deployedBytecode.object",
- "evm.deployedBytecode.sourceMap"
- ]
- }
- }
- }
- },
- "networks": {}
-} \ No newline at end of file
diff --git a/packages/migrations/artifacts/2.0.0-testnet/Exchange.json b/packages/migrations/artifacts/2.0.0-testnet/Exchange.json
deleted file mode 100644
index 043b499b0..000000000
--- a/packages/migrations/artifacts/2.0.0-testnet/Exchange.json
+++ /dev/null
@@ -1,2294 +0,0 @@
-{
- "schemaVersion": "2.0.0",
- "contractName": "Exchange",
- "compilerOutput": {
- "abi": [
- {
- "constant": true,
- "inputs": [
- {
- "name": "",
- "type": "bytes32"
- }
- ],
- "name": "filled",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "orders",
- "type": "tuple[]"
- },
- {
- "name": "takerAssetFillAmounts",
- "type": "uint256[]"
- },
- {
- "name": "signatures",
- "type": "bytes[]"
- }
- ],
- "name": "batchFillOrders",
- "outputs": [
- {
- "components": [
- {
- "name": "makerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "makerFeePaid",
- "type": "uint256"
- },
- {
- "name": "takerFeePaid",
- "type": "uint256"
- }
- ],
- "name": "totalFillResults",
- "type": "tuple"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "",
- "type": "bytes32"
- }
- ],
- "name": "cancelled",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "hash",
- "type": "bytes32"
- },
- {
- "name": "signerAddress",
- "type": "address"
- },
- {
- "name": "signature",
- "type": "bytes"
- }
- ],
- "name": "preSign",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "leftOrder",
- "type": "tuple"
- },
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "rightOrder",
- "type": "tuple"
- },
- {
- "name": "leftSignature",
- "type": "bytes"
- },
- {
- "name": "rightSignature",
- "type": "bytes"
- }
- ],
- "name": "matchOrders",
- "outputs": [
- {
- "components": [
- {
- "components": [
- {
- "name": "makerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "makerFeePaid",
- "type": "uint256"
- },
- {
- "name": "takerFeePaid",
- "type": "uint256"
- }
- ],
- "name": "left",
- "type": "tuple"
- },
- {
- "components": [
- {
- "name": "makerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "makerFeePaid",
- "type": "uint256"
- },
- {
- "name": "takerFeePaid",
- "type": "uint256"
- }
- ],
- "name": "right",
- "type": "tuple"
- },
- {
- "name": "leftMakerAssetSpreadAmount",
- "type": "uint256"
- }
- ],
- "name": "matchedFillResults",
- "type": "tuple"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "order",
- "type": "tuple"
- },
- {
- "name": "takerAssetFillAmount",
- "type": "uint256"
- },
- {
- "name": "signature",
- "type": "bytes"
- }
- ],
- "name": "fillOrderNoThrow",
- "outputs": [
- {
- "components": [
- {
- "name": "makerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "makerFeePaid",
- "type": "uint256"
- },
- {
- "name": "takerFeePaid",
- "type": "uint256"
- }
- ],
- "name": "fillResults",
- "type": "tuple"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "",
- "type": "bytes4"
- }
- ],
- "name": "assetProxies",
- "outputs": [
- {
- "name": "",
- "type": "address"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "orders",
- "type": "tuple[]"
- }
- ],
- "name": "batchCancelOrders",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "orders",
- "type": "tuple[]"
- },
- {
- "name": "takerAssetFillAmounts",
- "type": "uint256[]"
- },
- {
- "name": "signatures",
- "type": "bytes[]"
- }
- ],
- "name": "batchFillOrKillOrders",
- "outputs": [
- {
- "components": [
- {
- "name": "makerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "makerFeePaid",
- "type": "uint256"
- },
- {
- "name": "takerFeePaid",
- "type": "uint256"
- }
- ],
- "name": "totalFillResults",
- "type": "tuple"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "targetOrderEpoch",
- "type": "uint256"
- }
- ],
- "name": "cancelOrdersUpTo",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "orders",
- "type": "tuple[]"
- },
- {
- "name": "takerAssetFillAmounts",
- "type": "uint256[]"
- },
- {
- "name": "signatures",
- "type": "bytes[]"
- }
- ],
- "name": "batchFillOrdersNoThrow",
- "outputs": [
- {
- "components": [
- {
- "name": "makerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "makerFeePaid",
- "type": "uint256"
- },
- {
- "name": "takerFeePaid",
- "type": "uint256"
- }
- ],
- "name": "totalFillResults",
- "type": "tuple"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "assetProxyId",
- "type": "bytes4"
- }
- ],
- "name": "getAssetProxy",
- "outputs": [
- {
- "name": "",
- "type": "address"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "",
- "type": "bytes32"
- }
- ],
- "name": "transactions",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "order",
- "type": "tuple"
- },
- {
- "name": "takerAssetFillAmount",
- "type": "uint256"
- },
- {
- "name": "signature",
- "type": "bytes"
- }
- ],
- "name": "fillOrKillOrder",
- "outputs": [
- {
- "components": [
- {
- "name": "makerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "makerFeePaid",
- "type": "uint256"
- },
- {
- "name": "takerFeePaid",
- "type": "uint256"
- }
- ],
- "name": "fillResults",
- "type": "tuple"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "validatorAddress",
- "type": "address"
- },
- {
- "name": "approval",
- "type": "bool"
- }
- ],
- "name": "setSignatureValidatorApproval",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "",
- "type": "address"
- },
- {
- "name": "",
- "type": "address"
- }
- ],
- "name": "allowedValidators",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "orders",
- "type": "tuple[]"
- },
- {
- "name": "takerAssetFillAmount",
- "type": "uint256"
- },
- {
- "name": "signatures",
- "type": "bytes[]"
- }
- ],
- "name": "marketSellOrders",
- "outputs": [
- {
- "components": [
- {
- "name": "makerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "makerFeePaid",
- "type": "uint256"
- },
- {
- "name": "takerFeePaid",
- "type": "uint256"
- }
- ],
- "name": "totalFillResults",
- "type": "tuple"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "orders",
- "type": "tuple[]"
- }
- ],
- "name": "getOrdersInfo",
- "outputs": [
- {
- "components": [
- {
- "name": "orderStatus",
- "type": "uint8"
- },
- {
- "name": "orderHash",
- "type": "bytes32"
- },
- {
- "name": "orderTakerAssetFilledAmount",
- "type": "uint256"
- }
- ],
- "name": "",
- "type": "tuple[]"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "",
- "type": "bytes32"
- },
- {
- "name": "",
- "type": "address"
- }
- ],
- "name": "preSigned",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "owner",
- "outputs": [
- {
- "name": "",
- "type": "address"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "hash",
- "type": "bytes32"
- },
- {
- "name": "signerAddress",
- "type": "address"
- },
- {
- "name": "signature",
- "type": "bytes"
- }
- ],
- "name": "isValidSignature",
- "outputs": [
- {
- "name": "isValid",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "orders",
- "type": "tuple[]"
- },
- {
- "name": "makerAssetFillAmount",
- "type": "uint256"
- },
- {
- "name": "signatures",
- "type": "bytes[]"
- }
- ],
- "name": "marketBuyOrdersNoThrow",
- "outputs": [
- {
- "components": [
- {
- "name": "makerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "makerFeePaid",
- "type": "uint256"
- },
- {
- "name": "takerFeePaid",
- "type": "uint256"
- }
- ],
- "name": "totalFillResults",
- "type": "tuple"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "order",
- "type": "tuple"
- },
- {
- "name": "takerAssetFillAmount",
- "type": "uint256"
- },
- {
- "name": "signature",
- "type": "bytes"
- }
- ],
- "name": "fillOrder",
- "outputs": [
- {
- "components": [
- {
- "name": "makerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "makerFeePaid",
- "type": "uint256"
- },
- {
- "name": "takerFeePaid",
- "type": "uint256"
- }
- ],
- "name": "fillResults",
- "type": "tuple"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "signerAddress",
- "type": "address"
- },
- {
- "name": "data",
- "type": "bytes"
- },
- {
- "name": "signature",
- "type": "bytes"
- }
- ],
- "name": "executeTransaction",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "assetProxy",
- "type": "address"
- }
- ],
- "name": "registerAssetProxy",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "order",
- "type": "tuple"
- }
- ],
- "name": "getOrderInfo",
- "outputs": [
- {
- "components": [
- {
- "name": "orderStatus",
- "type": "uint8"
- },
- {
- "name": "orderHash",
- "type": "bytes32"
- },
- {
- "name": "orderTakerAssetFilledAmount",
- "type": "uint256"
- }
- ],
- "name": "orderInfo",
- "type": "tuple"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "order",
- "type": "tuple"
- }
- ],
- "name": "cancelOrder",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "",
- "type": "address"
- },
- {
- "name": "",
- "type": "address"
- }
- ],
- "name": "orderEpoch",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "ZRX_ASSET_DATA",
- "outputs": [
- {
- "name": "",
- "type": "bytes"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "orders",
- "type": "tuple[]"
- },
- {
- "name": "takerAssetFillAmount",
- "type": "uint256"
- },
- {
- "name": "signatures",
- "type": "bytes[]"
- }
- ],
- "name": "marketSellOrdersNoThrow",
- "outputs": [
- {
- "components": [
- {
- "name": "makerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "makerFeePaid",
- "type": "uint256"
- },
- {
- "name": "takerFeePaid",
- "type": "uint256"
- }
- ],
- "name": "totalFillResults",
- "type": "tuple"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "EIP712_DOMAIN_HASH",
- "outputs": [
- {
- "name": "",
- "type": "bytes32"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "orders",
- "type": "tuple[]"
- },
- {
- "name": "makerAssetFillAmount",
- "type": "uint256"
- },
- {
- "name": "signatures",
- "type": "bytes[]"
- }
- ],
- "name": "marketBuyOrders",
- "outputs": [
- {
- "components": [
- {
- "name": "makerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "makerFeePaid",
- "type": "uint256"
- },
- {
- "name": "takerFeePaid",
- "type": "uint256"
- }
- ],
- "name": "totalFillResults",
- "type": "tuple"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "currentContextAddress",
- "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"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "VERSION",
- "outputs": [
- {
- "name": "",
- "type": "string"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "inputs": [
- {
- "name": "_zrxAssetData",
- "type": "bytes"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "constructor"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "signerAddress",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "validatorAddress",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "approved",
- "type": "bool"
- }
- ],
- "name": "SignatureValidatorApproval",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "makerAddress",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "takerAddress",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "senderAddress",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "makerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "indexed": false,
- "name": "takerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "indexed": false,
- "name": "makerFeePaid",
- "type": "uint256"
- },
- {
- "indexed": false,
- "name": "takerFeePaid",
- "type": "uint256"
- },
- {
- "indexed": true,
- "name": "orderHash",
- "type": "bytes32"
- },
- {
- "indexed": false,
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "indexed": false,
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "Fill",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "makerAddress",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "senderAddress",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "orderHash",
- "type": "bytes32"
- },
- {
- "indexed": false,
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "indexed": false,
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "Cancel",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "makerAddress",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "senderAddress",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "orderEpoch",
- "type": "uint256"
- }
- ],
- "name": "CancelUpTo",
- "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": "0x60806040526000805460ff191690553480156200001b57600080fd5b5060405162005ec038038062005ec083398101806040526200004191908101906200044d565b80518190620000589060019060208401906200034c565b5050604080517f454950373132446f6d61696e28000000000000000000000000000000000000006020808301919091527f737472696e67206e616d652c0000000000000000000000000000000000000000602d8301527f737472696e672076657273696f6e2c000000000000000000000000000000000060398301527f6164647265737320766572696679696e67436f6e74726163740000000000000060488301527f2900000000000000000000000000000000000000000000000000000000000000606183015282516042818403018152606290920192839052815191929182918401908083835b60208310620001625780518252601f19909201916020918201910162000141565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208285018552600b8084527f30782050726f746f636f6c000000000000000000000000000000000000000000928401928352945190965091945090928392508083835b60208310620001ec5780518252601f199092019160209182019101620001cb565b51815160209384036101000a600019018019909216911617905260408051929094018290038220828501855260018084527f3200000000000000000000000000000000000000000000000000000000000000928401928352945190965091945090928392508083835b60208310620002765780518252601f19909201916020918201910162000255565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208282019890985281840196909652606081019690965250306080808701919091528151808703909101815260a09095019081905284519093849350850191508083835b60208310620003015780518252601f199092019160209182019101620002e0565b5181516000196020949094036101000a939093019283169219169190911790526040519201829003909120600255505060038054600160a060020a03191633179055506200050f9050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200038f57805160ff1916838001178555620003bf565b82800160010185558215620003bf579182015b82811115620003bf578251825591602001919060010190620003a2565b50620003cd929150620003d1565b5090565b620003ee91905b80821115620003cd5760008155600101620003d8565b90565b6000601f820183136200040357600080fd5b81516200041a6200041482620004b4565b6200048d565b915080825260208301602083018583830111156200043757600080fd5b62000444838284620004dc565b50505092915050565b6000602082840312156200046057600080fd5b81516001604060020a038111156200047757600080fd5b6200048584828501620003f1565b949350505050565b6040518181016001604060020a0381118282101715620004ac57600080fd5b604052919050565b60006001604060020a03821115620004cb57600080fd5b506020601f91909101601f19160190565b60005b83811015620004f9578181015183820152602001620004df565b8381111562000509576000848401525b50505050565b6159a1806200051f6000396000f3006080604052600436106101b65763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663288cdc9181146101bb578063297bb70b146101f15780632ac126221461021e5780633683ef8e1461024b5780633c28d8611461026d5780633e228bae1461029a5780633fd3c997146102ba5780634ac14782146102e75780634d0ae546146103075780634f9559b11461032757806350dde190146103475780636070410814610367578063642f2eaf1461039457806364a3bc15146103b457806377fcce68146103d45780637b8e3514146103f45780637e1d9808146104145780637e9d74dc1461043457806382c174d0146104615780638da5cb5b146104815780639363470214610496578063a3e20380146104b6578063b4be83d5146104d6578063bfc8bfce146104f6578063c585bb9314610516578063c75e0a8114610536578063d46b02c314610563578063d9bfa73e14610583578063db123b1a146105a3578063dd1c7d18146105c5578063e306f779146105e5578063e5fa431b146105fa578063eea086ba1461061a578063f2fde38b1461062f578063ffa1ad741461064f575b600080fd5b3480156101c757600080fd5b506101db6101d63660046148ee565b610664565b6040516101e89190615513565b60405180910390f35b3480156101fd57600080fd5b5061021161020c366004614811565b610676565b6040516101e891906157ed565b34801561022a57600080fd5b5061023e6102393660046148ee565b6107a1565b6040516101e89190615505565b34801561025757600080fd5b5061026b61026636600461492b565b6107b6565b005b34801561027957600080fd5b5061028d610288366004614a5f565b6108a3565b6040516101e891906157fb565b3480156102a657600080fd5b506102116102b5366004614b1f565b610a3a565b3480156102c657600080fd5b506102da6102d53660046149ee565b610a90565b6040516101e891906155cf565b3480156102f357600080fd5b5061026b6103023660046147dc565b610ab8565b34801561031357600080fd5b50610211610322366004614811565b610b85565b34801561033357600080fd5b5061026b6103423660046148ee565b610c75565b34801561035357600080fd5b50610211610362366004614811565b610e2a565b34801561037357600080fd5b506103876103823660046149ee565b610ebe565b6040516101e89190615425565b3480156103a057600080fd5b5061023e6103af3660046148ee565b610f0c565b3480156103c057600080fd5b506102116103cf366004614b1f565b610f21565b3480156103e057600080fd5b5061026b6103ef3660046147ac565b610fcc565b34801561040057600080fd5b5061023e61040f366004614772565b611106565b34801561042057600080fd5b5061021161042f3660046148a5565b611126565b34801561044057600080fd5b5061045461044f3660046147dc565b61128a565b6040516101e891906154f4565b34801561046d57600080fd5b5061023e61047c36600461490c565b61131f565b34801561048d57600080fd5b5061038761133f565b3480156104a257600080fd5b5061023e6104b1366004614993565b61135b565b3480156104c257600080fd5b506102116104d13660046148a5565b6118de565b3480156104e257600080fd5b506102116104f1366004614b1f565b6119f1565b34801561050257600080fd5b5061026b610511366004614b68565b611a6c565b34801561052257600080fd5b5061026b610531366004614754565b611d05565b34801561054257600080fd5b50610556610551366004614a2a565b611f30565b6040516101e8919061580a565b34801561056f57600080fd5b5061026b61057e366004614a2a565b61202a565b34801561058f57600080fd5b506101db61059e366004614772565b6120c6565b3480156105af57600080fd5b506105b86120e3565b6040516101e891906155be565b3480156105d157600080fd5b506102116105e03660046148a5565b61218e565b3480156105f157600080fd5b506101db612263565b34801561060657600080fd5b506102116106153660046148a5565b612269565b34801561062657600080fd5b506103876123db565b34801561063b57600080fd5b5061026b61064a366004614754565b6123f7565b34801561065b57600080fd5b506105b86124a8565b60046020526000908152604090205481565b61067e614386565b600080610689614386565b60005460ff16156106cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061576d565b60405180910390fd5b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011781558751935091505b81831461076f57610758878381518110151561071957fe5b90602001906020020151878481518110151561073157fe5b90602001906020020151878581518110151561074957fe5b906020019060200201516124df565b9050610764848261257d565b600190910190610701565b5050600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055509392505050565b60056020526000908152604090205460ff1681565b73ffffffffffffffffffffffffffffffffffffffff831633146108465761080e848484848080601f0160208091040260200160405190810160405280939291908181526020018383808284375061135b945050505050565b1515610846576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061569d565b5050600091825260076020908152604080842073ffffffffffffffffffffffffffffffffffffffff9093168452919052902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b6108ab6143af565b6108b36143de565b6108bb6143de565b6000805460ff16156108f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061576d565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905561016080890151610140808a01919091528901519088015261094588611f30565b925061095087611f30565b915061095a6125df565b905061096888848389612611565b61097487838388612611565b61097e88886127a9565b610992888885604001518560400151612809565b8051602081015190519195506109ad918a9186918190612990565b6020808501519081015190516109c99189918591908190612990565b6109e28882856020015186604001518860000151612aa9565b6109fb8782846020015185604001518860200151612aa9565b610a0788888387612b55565b5050600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905550949350505050565b610a42614386565b6060610a4f858585612d2d565b9050608081825160208401305af48015610a8657815183526020820151602084015260408201516040840152606082015160608401525b505b509392505050565b600b6020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b60008054819060ff1615610af8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061576d565b5050600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011781558151905b808214610b5857610b508382815181101515610b4157fe5b90602001906020020151612eff565b600101610b29565b5050600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905550565b610b8d614386565b600080610b98614386565b60005460ff1615610bd5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061576d565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011781558751935091505b81831461076f57610c5e8783815181101515610c1f57fe5b906020019060200201518784815181101515610c3757fe5b906020019060200201518785815181101515610c4f57fe5b90602001906020020151612f2a565b9050610c6a848261257d565b600190910190610c07565b6000805481908190819060ff1615610cb9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061576d565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055610cec6125df565b935073ffffffffffffffffffffffffffffffffffffffff84163314610d115733610d14565b60005b73ffffffffffffffffffffffffffffffffffffffff8086166000908152600660209081526040808320938516835292905220549093506001860192509050808211610d8b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061572d565b73ffffffffffffffffffffffffffffffffffffffff80851660008181526006602090815260408083209488168084529490915290819020859055517f82af639571738f4ebd4268fb0363d8957ebe1bbb9e78dba5ebd69eed39b154f090610df3908690615513565b60405180910390a35050600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055505050565b610e32614386565b600080610e3d614386565b86519250600091505b818314610eb457610e9d8783815181101515610e5e57fe5b906020019060200201518784815181101515610e7657fe5b906020019060200201518785815181101515610e8e57fe5b90602001906020020151610a3a565b9050610ea9848261257d565b600190910190610e46565b5050509392505050565b7fffffffff0000000000000000000000000000000000000000000000000000000081166000908152600b602052604090205473ffffffffffffffffffffffffffffffffffffffff165b919050565b60096020526000908152604090205460ff1681565b610f29614386565b60005460ff1615610f66576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061576d565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055610f9c848484612f2a565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055949350505050565b6000805460ff161561100a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061576d565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905561103d6125df565b73ffffffffffffffffffffffffffffffffffffffff8181166000818152600860209081526040808320948916808452949091529081902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168715151790555192935090917fa8656e308026eeabce8f0bc18048433252318ab80ac79da0b3d3d8697dfba891906110d1908690615505565b60405180910390a35050600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905550565b600860209081526000928352604080842090915290825290205460ff1681565b61112e614386565b6060600080600061113d614386565b60005460ff161561117a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061576d565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117815589518a919081106111b257fe5b906020019060200201516101600151945088519350600092505b828414611255578489848151811015156111e257fe5b906020019060200201516101600181905250611202888760200151612f7d565b915061122e898481518110151561121557fe5b9060200190602002015183898681518110151561074957fe5b905061123a868261257d565b6020860151881161124a57611255565b6001909201916111cc565b5050600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055509195945050505050565b606060006060600084519250826040519080825280602002602001820160405280156112d057816020015b6112bd6143de565b8152602001906001900390816112b55790505b509150600090505b808314610a88576112ff85828151811015156112f057fe5b90602001906020020151611f30565b828281518110151561130d57fe5b602090810290910101526001016112d8565b600760209081526000928352604080842090915290825290205460ff1681565b60035473ffffffffffffffffffffffffffffffffffffffff1681565b600080600080600080600080600089511115156113a4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061571d565b6113ad89612fc4565b7f010000000000000000000000000000000000000000000000000000000000000090049650600760ff88161061140f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061563d565b8660ff16600781111561141e57fe5b9550600086600781111561142e57fe5b1415611466576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061570d565b600186600781111561147457fe5b14156114bc578851156114b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906157dd565b600097506118d0565b60028660078111156114ca57fe5b141561160557885160411461150b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906155dd565b88600081518110151561151a57fe5b01602001517f010000000000000000000000000000000000000000000000000000000000000090819004810204945061155a89600163ffffffff61308816565b935061156d89602163ffffffff61308816565b925060018b86868660405160008152602001604052604051611592949392919061556e565b60206040516020810390808403906000865af11580156115b6573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015173ffffffffffffffffffffffffffffffffffffffff8c811690821614995092506118d09050565b600386600781111561161357fe5b14156117b9578851604114611654576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906155dd565b88600081518110151561166357fe5b01602001517f01000000000000000000000000000000000000000000000000000000000000009081900481020494506116a389600163ffffffff61308816565b93506116b689602163ffffffff61308816565b925060018b60405160200180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c0182600019166000191681526020019150506040516020818303038152906040526040518082805190602001908083835b6020831061175757805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161171a565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040805192909401829003822060008352910192839052611592945092508991899150889061556e565b60048660078111156117c757fe5b14156117df576117d88b8b8b6130d3565b97506118d0565b60058660078111156117ed57fe5b1415611850576117fc89613228565b73ffffffffffffffffffffffffffffffffffffffff808c1660009081526008602090815260408083209385168352929052205490915060ff16151561184457600097506118d0565b6117d8818c8c8c6132a1565b600686600781111561185e57fe5b141561189e5760008b815260076020908152604080832073ffffffffffffffffffffffffffffffffffffffff8e16845290915290205460ff1697506118d0565b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061563d565b505050505050509392505050565b6118e6614386565b60606000806000806118f6614386565b89600081518110151561190557fe5b906020019060200201516101400151955089519450600093505b8385146119e457858a8581518110151561193557fe5b6020908102909101015161014001528651611951908a90612f7d565b92506119948a8581518110151561196457fe5b9060200190602002015160a001518b8681518110151561198057fe5b9060200190602002015160800151856133fd565b91506119c08a858151811015156119a757fe5b90602001906020020151838a87815181101515610e8e57fe5b90506119cc878261257d565b865189116119d9576119e4565b60019093019261191f565b5050505050509392505050565b6119f9614386565b60005460ff1615611a36576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061576d565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055610f9c8484846124df565b600a5460009073ffffffffffffffffffffffffffffffffffffffff1615611abf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061576d565b611b02611afd888888888080601f01602080910402602001604051908101604052809392919081815260200183838082843750613453945050505050565b613694565b60008181526009602052604090205490915060ff1615611b4e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061568d565b73ffffffffffffffffffffffffffffffffffffffff86163314611c1f57611ba6818785858080601f0160208091040260200160405190810160405280939291908181526020018383808284375061135b945050505050565b1515611bde576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906157cd565b600a80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff88161790555b6000818152600960205260409081902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555130908690869080838380828437820191505092505050600060405180830381855af49150501515611cb6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906156bd565b73ffffffffffffffffffffffffffffffffffffffff86163314611cfc57600a80547fffffffffffffffffffffffff00000000000000000000000000000000000000001690555b50505050505050565b6003546000908190819073ffffffffffffffffffffffffffffffffffffffff163314611d5d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061577d565b8392508273ffffffffffffffffffffffffffffffffffffffff1663ae25532e6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b158015611dc457600080fd5b505af1158015611dd8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611dfc9190810190614a0c565b7fffffffff0000000000000000000000000000000000000000000000000000000081166000908152600b602052604090205490925073ffffffffffffffffffffffffffffffffffffffff1690508015611e81576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061561d565b7fffffffff0000000000000000000000000000000000000000000000000000000082166000908152600b60205260409081902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8616179055517fd2c6b762299c609bdb96520b58a49bfb80186934d4f71a86a367571a15c0319490611f2290849087906155a3565b60405180910390a150505050565b611f386143de565b611f41826136d1565b6020808301829052600091825260049052604090819020549082015260808201511515611f755760015b60ff168152610f07565b60a08201511515611f87576002611f6b565b60a0820151604082015110611f9d576005611f6b565b6101008201514210611fb0576004611f6b565b60208082015160009081526005909152604090205460ff1615611fd4576006611f6b565b610120820151825173ffffffffffffffffffffffffffffffffffffffff90811660009081526006602090815260408083206060880151909416835292905220541115612021576006611f6b565b60038152919050565b60005460ff1615612067576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061576d565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905561209b81612eff565b50600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055565b600660209081526000928352604080842090915290825290205481565b60018054604080516020600284861615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f810184900484028201840190925281815292918301828280156121865780601f1061215b57610100808354040283529160200191612186565b820191906000526020600020905b81548152906001019060200180831161216957829003601f168201915b505050505081565b612196614386565b606060008060006121a5614386565b8860008151811015156121b457fe5b906020019060200201516101600151945088519350600092505b828414612257578489848151811015156121e457fe5b906020019060200201516101600181905250612204888760200151612f7d565b9150612230898481518110151561221757fe5b90602001906020020151838986815181101515610e8e57fe5b905061223c868261257d565b6020860151881161224c57612257565b6001909201916121ce565b50505050509392505050565b60025481565b612271614386565b6060600080600080612281614386565b60005460ff16156122be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061576d565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011781558a518b919081106122f657fe5b906020019060200201516101400151955089519450600093505b8385146123a557858a8581518110151561232657fe5b6020908102909101015161014001528651612342908a90612f7d565b92506123558a8581518110151561196457fe5b91506123818a8581518110151561236857fe5b90602001906020020151838a8781518110151561074957fe5b905061238d878261257d565b8651891161239a576123a5565b600190930192612310565b5050600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905550929695505050505050565b600a5473ffffffffffffffffffffffffffffffffffffffff1681565b60035473ffffffffffffffffffffffffffffffffffffffff163314612448576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061577d565b73ffffffffffffffffffffffffffffffffffffffff8116156124a557600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83161790555b50565b60408051808201909152600b81527f322e302e312d616c706861000000000000000000000000000000000000000000602082015281565b6124e7614386565b6124ef6143de565b60008060006124fd88611f30565b93506125076125df565b925061251588858589612611565b6125278860a001518560400151612f7d565b915061253387836136df565b9050612546888589848960000151612990565b61255088826136f5565b945061256788848660200151876040015189612aa9565b612572888487613756565b505050509392505050565b8151815161258b9190613864565b8252602080830151908201516125a19190613864565b6020830152604080830151908201516125ba9190613864565b6040830152606080830151908201516125d39190613864565b60609092019190915250565b600a5460009073ffffffffffffffffffffffffffffffffffffffff16818115612608578161260a565b335b9392505050565b825160ff1660031461264f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061579d565b606084015173ffffffffffffffffffffffffffffffffffffffff16156126c257606084015173ffffffffffffffffffffffffffffffffffffffff1633146126c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906157ad565b602084015173ffffffffffffffffffffffffffffffffffffffff161561274d578173ffffffffffffffffffffffffffffffffffffffff16846020015173ffffffffffffffffffffffffffffffffffffffff1614151561274d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906155ed565b604083015115156127a35761276b836020015185600001518361135b565b15156127a3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061565d565b50505050565b6127bb8260a001518260a001516138ae565b6127cd836080015183608001516138ae565b1015612805576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906157bd565b5050565b6128116143af565b6000806000806128258960a0015188612f7d565b935061283a89608001518a60a0015186613909565b925061284a8860a0015187612f7d565b915061285f88608001518960a0015184613909565b90508084106128a25760208086018051839052805182018490525151865182015260808a015160a08b015187519092015161289a9290613909565b8551526128df565b845183905284516020908101859052855181015190860180519190915260a089015160808a01519151516128d69290613986565b60208087015101525b84515160208087015101516128f49190612f7d565b604086015284515160808a015160c08b0151612911929190613909565b85516040015284516020015160a08a015160e08b0151612932929190613909565b855160600152602085015151608089015160c08a0151612953929190613909565b8560200151604001818152505061297b8560200151602001518960a001518a60e00151613909565b60208601516060015250505050949350505050565b8215156129c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906156dd565b82821115612a03576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906156cd565b8460a00151612a16856040015184613864565b1115612a4e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906155fd565b612a5c8560800151836138ae565b612a6a828760a001516138ae565b1115612aa2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061575d565b5050505050565b612ab7828260200151613864565b600084815260046020908152604091829020929092558681015187518451938501518584015160608701516101408c01516101608d015196518b9873ffffffffffffffffffffffffffffffffffffffff9788169897909616967f0bcc4c97732e47d9946f229edb95f5b6323f601300e4690de719993f3c37112996612b46968f96339692959194909390615433565b60405180910390a45050505050565b60018054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101008789161502019095169490940493840181900481028201810190925282815260609390929091830182828015612bfe5780601f10612bd357610100808354040283529160200191612bfe565b820191906000526020600020905b815481529060010190602001808311612be157829003601f168201915b50505050509050612c2685610140015186600001518660000151856020015160200151613a23565b61014084015184518651845160200151612c4293929190613a23565b612c5b8561014001518660000151858560400151613a23565b612c778186600001518760400151856000015160400151613a23565b612c938185600001518660400151856020015160400151613a23565b836040015173ffffffffffffffffffffffffffffffffffffffff16856040015173ffffffffffffffffffffffffffffffffffffffff161415612cfd57612cf881848760400151612cf3866000015160600151876020015160600151613864565b613a23565b612aa2565b612d1581848760400151856000015160600151613a23565b612aa281848660400151856020015160600151613a23565b604080517fb4be83d5000000000000000000000000000000000000000000000000000000006020808301919091526060602483018181528751608485019081528884015160a48601529488015160c48501529087015160e4840152608087015161010484015260a087015161012484015260c087015161014484015260e08701516101648401526101008701516101848401526101208701516101a4840152610140870180516101c485019081526101608901516101e4860152610180905251805161020485018190529394919384936044870192849261022489019291820191601f82010460005b81811015612e34578351855260209485019490930192600101612e16565b50505050818103610160808401919091528a0151805180835260209283019291820191601f82010460005b81811015612e7d578351855260209485019490930192600101612e5f565b50505089845250848103602093840190815288518083529093918201918981019190601f82010460005b81811015612ec5578351855260209485019490930192600101612ea7565b5050507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08883030188525060405250505050509392505050565b612f076143de565b612f1082611f30565b9050612f1c8282613bed565b612805828260200151613d04565b612f32614386565b612f3d8484846124df565b6020810151909150831461260a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061574d565b600082821115612fb9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061560d565b508082035b92915050565b6000808251111515613002576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906156fd565b815182907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff810190811061303257fe5b016020015182517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01909252507f0100000000000000000000000000000000000000000000000000000000000000908190040290565b6000816020018351101515156130ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061562d565b50016020015190565b6040516000906060907f1626ba7e000000000000000000000000000000000000000000000000000000009061310e908790869060240161554e565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152919052602080820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909416939093178352815191935090829081885afa8080156131ab576001811461321c57612572565b7f08c379a0000000000000000000000000000000000000000000000000000000006000527c20000000000000000000000000000000000000000000000000000000006020527c0c57414c4c45545f4552524f5200000000000000000000000000000000604052600060605260646000fd5b50505195945050505050565b60006014825110151515613268576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061578d565b613276826014845103613dab565b82517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec019092525090565b6040516000906060907f9363470200000000000000000000000000000000000000000000000000000000906132de90879087908790602401615521565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152919052602080820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009094169390931783528151919350908290818a5afa80801561337b57600181146133ec576133f1565b7f08c379a0000000000000000000000000000000000000000000000000000000006000527c20000000000000000000000000000000000000000000000000000000006020527c0f56414c494441544f525f4552524f5200000000000000000000000000604052600060605260646000fd5b825194505b50505050949350505050565b6000808311613438576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061564d565b61344b61344585846138ae565b84613e0c565b949350505050565b604080517f5a65726f45785472616e73616374696f6e2800000000000000000000000000006020808301919091527f75696e743235362073616c742c0000000000000000000000000000000000000060328301527f61646472657373207369676e6572416464726573732c00000000000000000000603f8301527f627974657320646174610000000000000000000000000000000000000000000060558301527f2900000000000000000000000000000000000000000000000000000000000000605f830152825180830384018152606090920192839052815160009384938493909282918401908083835b6020831061357c57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161353f565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018019909216911617905260405191909301819003812089519097508995509093508392850191508083835b6020831061361257805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016135d5565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040805192909401829003822097825281019a909a525073ffffffffffffffffffffffffffffffffffffffff97909716968801969096525050606085015250506080909120919050565b600280546040517f190100000000000000000000000000000000000000000000000000000000000081529182015260228101919091526042902090565b6000612fbe611afd83613e23565b60008183106136ee578161260a565b5090919050565b6136fd614386565b6020810182905260a08301516080840151613719918491613909565b808252608084015160c0850151613731929190613909565b604082015260a083015160e084015161374b918491613909565b606082015292915050565b60018054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61010087891615020190951694909404938401819004810282018101909252828152606093909290918301828280156137ff5780601f106137d4576101008083540402835291602001916137ff565b820191906000526020600020905b8154815290600101906020018083116137e257829003601f168201915b5050505050905061381f8461014001518560000151858560000151613a23565b6138388461016001518486600001518560200151613a23565b61385081856000015186604001518560400151613a23565b6127a3818486604001518560600151613a23565b6000828201838110156138a3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061567d565b8091505b5092915050565b6000808315156138c157600091506138a7565b508282028284828115156138d157fe5b04146138a3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061567d565b6000808311613944576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061564d565b61394f84848461427c565b15613438576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906156ad565b60008083116139c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061564d565b6139cc848484614301565b15613a03576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906156ad565b61344b613445613a1386856138ae565b613a1e866001612f7d565b613864565b600080600083118015613a6257508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b15613be5578551600310613aa2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061573d565b50506020848101517fffffffff00000000000000000000000000000000000000000000000000000000166000818152600b90925260409091205473ffffffffffffffffffffffffffffffffffffffff16801515613b2b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906156ed565b604051660fffffffffffe0603f885101168060840182017fa85e59e40000000000000000000000000000000000000000000000000000000083526080600484015273ffffffffffffffffffffffffffffffffffffffff8816602484015273ffffffffffffffffffffffffffffffffffffffff87166044840152856064840152608483015b81811015613bc757895181526020998a019901613baf565b61020084858403866000895af1801515613bdf573d85fd5b50505050505b505050505050565b805160009060ff16600314613c2e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061579d565b606083015173ffffffffffffffffffffffffffffffffffffffff1615613ca157606083015173ffffffffffffffffffffffffffffffffffffffff163314613ca1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906157ad565b613ca96125df565b835190915073ffffffffffffffffffffffffffffffffffffffff808316911614613cff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061566d565b505050565b6000818152600560205260409081902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558281015183516101408501516101608601519351859473ffffffffffffffffffffffffffffffffffffffff9485169493909316927fdc47b3613d9fe400085f6dbdc99453462279057e6207385042827ed6b1a62cf792613d9f923392906154b7565b60405180910390a45050565b600081601401835110151515613ded576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061578d565b50016014015173ffffffffffffffffffffffffffffffffffffffff1690565b6000808284811515613e1a57fe5b04949350505050565b604080517f4f726465722800000000000000000000000000000000000000000000000000006020808301919091527f61646472657373206d616b6572416464726573732c000000000000000000000060268301527f616464726573732074616b6572416464726573732c0000000000000000000000603b8301527f6164647265737320666565526563697069656e74416464726573732c0000000060508301527f616464726573732073656e646572416464726573732c00000000000000000000606c8301527f75696e74323536206d616b65724173736574416d6f756e742c0000000000000060828301527f75696e743235362074616b65724173736574416d6f756e742c00000000000000609b8301527f75696e74323536206d616b65724665652c00000000000000000000000000000060b48301527f75696e743235362074616b65724665652c00000000000000000000000000000060c58301527f75696e743235362065787069726174696f6e54696d655365636f6e64732c000060d68301527f75696e743235362073616c742c0000000000000000000000000000000000000060f48301527f6279746573206d616b65724173736574446174612c00000000000000000000006101018301527f62797465732074616b65724173736574446174610000000000000000000000006101168301527f290000000000000000000000000000000000000000000000000000000000000061012a830152825161010b81840301815261012b90920192839052815160009384938493849391929182918401908083835b602083106140ab57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161406e565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930181900381206101408b0151805191995095509093508392850191508083835b6020831061414657805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101614109565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930181900381206101608b0151805191985095509093508392850191508083835b602083106141e157805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016141a4565b5181516020939093036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018019909116921691909117905260405192018290039091207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0890180516101408b018051610160909c0180519a84529881529288526101a0822091529890525050509190525090919050565b6000808084116142b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061564d565b8215806142c3575084155b156142d15760009150610a88565b838015156142db57fe5b85840990506142ea85846138ae565b6142f66103e8836138ae565b101595945050505050565b60008080841161433d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061564d565b821580614348575084155b156143565760009150610a88565b8380151561436057fe5b8584099050836143708583612f7d565b81151561437957fe5b0690506142ea85846138ae565b608060405190810160405280600081526020016000815260200160008152602001600081525090565b610120604051908101604052806143c4614386565b81526020016143d1614386565b8152602001600081525090565b604080516060810182526000808252602082018190529181019190915290565b600061260a82356158b0565b6000601f8201831361441b57600080fd5b813561442e6144298261583f565b615818565b81815260209384019390925082018360005b8381101561446c578135860161445688826145bc565b8452506020928301929190910190600101614440565b5050505092915050565b6000601f8201831361448757600080fd5b81356144956144298261583f565b81815260209384019390925082018360005b8381101561446c57813586016144bd888261460b565b84525060209283019291909101906001016144a7565b6000601f820183136144e457600080fd5b81356144f26144298261583f565b9150818183526020840193506020810190508385602084028201111561451757600080fd5b60005b8381101561446c578161452d888261454f565b845250602092830192919091019060010161451a565b600061260a82356158c9565b600061260a82356158ce565b600061260a82356158d1565b600061260a82516158d1565b600080601f8301841361458557600080fd5b50813567ffffffffffffffff81111561459d57600080fd5b6020830191508360018202830111156145b557600080fd5b9250929050565b6000601f820183136145cd57600080fd5b81356145db61442982615860565b915080825260208301602083018583830111156145f757600080fd5b614602838284615907565b50505092915050565b6000610180828403121561461e57600080fd5b614629610180615818565b9050600061463784846143fe565b8252506020614648848483016143fe565b602083015250604061465c848285016143fe565b6040830152506060614670848285016143fe565b60608301525060806146848482850161454f565b60808301525060a06146988482850161454f565b60a08301525060c06146ac8482850161454f565b60c08301525060e06146c08482850161454f565b60e0830152506101006146d58482850161454f565b610100830152506101206146eb8482850161454f565b6101208301525061014082013567ffffffffffffffff81111561470d57600080fd5b614719848285016145bc565b6101408301525061016082013567ffffffffffffffff81111561473b57600080fd5b614747848285016145bc565b6101608301525092915050565b60006020828403121561476657600080fd5b600061344b84846143fe565b6000806040838503121561478557600080fd5b600061479185856143fe565b92505060206147a2858286016143fe565b9150509250929050565b600080604083850312156147bf57600080fd5b60006147cb85856143fe565b92505060206147a285828601614543565b6000602082840312156147ee57600080fd5b813567ffffffffffffffff81111561480557600080fd5b61344b84828501614476565b60008060006060848603121561482657600080fd5b833567ffffffffffffffff81111561483d57600080fd5b61484986828701614476565b935050602084013567ffffffffffffffff81111561486657600080fd5b614872868287016144d3565b925050604084013567ffffffffffffffff81111561488f57600080fd5b61489b8682870161440a565b9150509250925092565b6000806000606084860312156148ba57600080fd5b833567ffffffffffffffff8111156148d157600080fd5b6148dd86828701614476565b93505060206148728682870161454f565b60006020828403121561490057600080fd5b600061344b848461454f565b6000806040838503121561491f57600080fd5b6000614791858561454f565b6000806000806060858703121561494157600080fd5b600061494d878761454f565b945050602061495e878288016143fe565b935050604085013567ffffffffffffffff81111561497b57600080fd5b61498787828801614573565b95989497509550505050565b6000806000606084860312156149a857600080fd5b60006149b4868661454f565b93505060206149c5868287016143fe565b925050604084013567ffffffffffffffff8111156149e257600080fd5b61489b868287016145bc565b600060208284031215614a0057600080fd5b600061344b848461455b565b600060208284031215614a1e57600080fd5b600061344b8484614567565b600060208284031215614a3c57600080fd5b813567ffffffffffffffff811115614a5357600080fd5b61344b8482850161460b565b60008060008060808587031215614a7557600080fd5b843567ffffffffffffffff811115614a8c57600080fd5b614a988782880161460b565b945050602085013567ffffffffffffffff811115614ab557600080fd5b614ac18782880161460b565b935050604085013567ffffffffffffffff811115614ade57600080fd5b614aea878288016145bc565b925050606085013567ffffffffffffffff811115614b0757600080fd5b614b13878288016145bc565b91505092959194509250565b600080600060608486031215614b3457600080fd5b833567ffffffffffffffff811115614b4b57600080fd5b614b578682870161460b565b93505060206149c58682870161454f565b60008060008060008060808789031215614b8157600080fd5b6000614b8d898961454f565b9650506020614b9e89828a016143fe565b955050604087013567ffffffffffffffff811115614bbb57600080fd5b614bc789828a01614573565b9450945050606087013567ffffffffffffffff811115614be657600080fd5b614bf289828a01614573565b92509250509295509295509295565b614c0a816158b0565b82525050565b6000614c1b826158ac565b808452602084019350614c2d836158a6565b60005b82811015614c5d57614c438683516153e5565b614c4c826158a6565b606096909601959150600101614c30565b5093949350505050565b614c0a816158c9565b614c0a816158ce565b614c0a816158d1565b6000614c8d826158ac565b808452614ca1816020860160208601615913565b614caa8161593f565b9093016020019392505050565b614c0a816158fc565b601281527f4c454e4754485f36355f52455155495245440000000000000000000000000000602082015260400190565b600d81527f494e56414c49445f54414b455200000000000000000000000000000000000000602082015260400190565b600e81527f4f524445525f4f56455246494c4c000000000000000000000000000000000000602082015260400190565b601181527f55494e543235365f554e444552464c4f57000000000000000000000000000000602082015260400190565b601a81527f41535345545f50524f58595f414c52454144595f455849535453000000000000602082015260400190565b602681527f475245415445525f4f525f455155414c5f544f5f33325f4c454e4754485f524560208201527f5155495245440000000000000000000000000000000000000000000000000000604082015260600190565b601581527f5349474e41545552455f554e535550504f525445440000000000000000000000602082015260400190565b601081527f4449564953494f4e5f42595f5a45524f00000000000000000000000000000000602082015260400190565b601781527f494e56414c49445f4f524445525f5349474e4154555245000000000000000000602082015260400190565b600d81527f494e56414c49445f4d414b455200000000000000000000000000000000000000602082015260400190565b601081527f55494e543235365f4f564552464c4f5700000000000000000000000000000000602082015260400190565b600f81527f494e56414c49445f54585f484153480000000000000000000000000000000000602082015260400190565b601181527f494e56414c49445f5349474e4154555245000000000000000000000000000000602082015260400190565b600e81527f524f554e44494e475f4552524f52000000000000000000000000000000000000602082015260400190565b601081527f4641494c45445f455845435554494f4e00000000000000000000000000000000602082015260400190565b600d81527f54414b45525f4f56455250415900000000000000000000000000000000000000602082015260400190565b601481527f494e56414c49445f54414b45525f414d4f554e54000000000000000000000000602082015260400190565b601a81527f41535345545f50524f58595f444f45535f4e4f545f4558495354000000000000602082015260400190565b602181527f475245415445525f5448414e5f5a45524f5f4c454e4754485f5245515549524560208201527f4400000000000000000000000000000000000000000000000000000000000000604082015260600190565b601181527f5349474e41545552455f494c4c4547414c000000000000000000000000000000602082015260400190565b601e81527f4c454e4754485f475245415445525f5448414e5f305f52455155495245440000602082015260400190565b601781527f494e56414c49445f4e45575f4f524445525f45504f4348000000000000000000602082015260400190565b601e81527f4c454e4754485f475245415445525f5448414e5f335f52455155495245440000602082015260400190565b601481527f434f4d504c4554455f46494c4c5f4641494c4544000000000000000000000000602082015260400190565b601281527f494e56414c49445f46494c4c5f50524943450000000000000000000000000000602082015260400190565b601281527f5245454e5452414e43595f494c4c4547414c0000000000000000000000000000602082015260400190565b601381527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000602082015260400190565b602681527f475245415445525f4f525f455155414c5f544f5f32305f4c454e4754485f524560208201527f5155495245440000000000000000000000000000000000000000000000000000604082015260600190565b601081527f4f524445525f554e46494c4c41424c4500000000000000000000000000000000602082015260400190565b600e81527f494e56414c49445f53454e444552000000000000000000000000000000000000602082015260400190565b601881527f4e454741544956455f5350524541445f52455155495245440000000000000000602082015260400190565b601481527f494e56414c49445f54585f5349474e4154555245000000000000000000000000602082015260400190565b601181527f4c454e4754485f305f5245515549524544000000000000000000000000000000602082015260400190565b805160808301906153738482614c70565b5060208201516153866020850182614c70565b5060408201516153996040850182614c70565b5060608201516127a36060850182614c70565b80516101208301906153be8482615362565b5060208201516153d16080850182615362565b5060408201516127a3610100850182614c70565b805160608301906153f6848261541c565b5060208201516154096020850182614c70565b5060408201516127a36040850182614c70565b614c0a816158f6565b60208101612fbe8284614c01565b6101008101615442828b614c01565b61544f602083018a614c01565b61545c6040830189614c70565b6154696060830188614c70565b6154766080830187614c70565b61548360a0830186614c70565b81810360c08301526154958185614c82565b905081810360e08301526154a98184614c82565b9a9950505050505050505050565b606081016154c58286614c01565b81810360208301526154d78185614c82565b905081810360408301526154eb8184614c82565b95945050505050565b6020808252810161260a8184614c10565b60208101612fbe8284614c67565b60208101612fbe8284614c70565b6060810161552f8286614c70565b61553c6020830185614c01565b81810360408301526154eb8184614c82565b6040810161555c8285614c70565b818103602083015261344b8184614c82565b6080810161557c8287614c70565b615589602083018661541c565b6155966040830185614c70565b6154eb6060830184614c70565b604081016155b18285614c79565b61260a6020830184614c01565b6020808252810161260a8184614c82565b60208101612fbe8284614cb7565b60208082528101612fbe81614cc0565b60208082528101612fbe81614cf0565b60208082528101612fbe81614d20565b60208082528101612fbe81614d50565b60208082528101612fbe81614d80565b60208082528101612fbe81614db0565b60208082528101612fbe81614e06565b60208082528101612fbe81614e36565b60208082528101612fbe81614e66565b60208082528101612fbe81614e96565b60208082528101612fbe81614ec6565b60208082528101612fbe81614ef6565b60208082528101612fbe81614f26565b60208082528101612fbe81614f56565b60208082528101612fbe81614f86565b60208082528101612fbe81614fb6565b60208082528101612fbe81614fe6565b60208082528101612fbe81615016565b60208082528101612fbe81615046565b60208082528101612fbe8161509c565b60208082528101612fbe816150cc565b60208082528101612fbe816150fc565b60208082528101612fbe8161512c565b60208082528101612fbe8161515c565b60208082528101612fbe8161518c565b60208082528101612fbe816151bc565b60208082528101612fbe816151ec565b60208082528101612fbe8161521c565b60208082528101612fbe81615272565b60208082528101612fbe816152a2565b60208082528101612fbe816152d2565b60208082528101612fbe81615302565b60208082528101612fbe81615332565b60808101612fbe8284615362565b6101208101612fbe82846153ac565b60608101612fbe82846153e5565b60405181810167ffffffffffffffff8111828210171561583757600080fd5b604052919050565b600067ffffffffffffffff82111561585657600080fd5b5060209081020190565b600067ffffffffffffffff82111561587757600080fd5b506020601f919091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0160190565b60200190565b5190565b73ffffffffffffffffffffffffffffffffffffffff1690565b151590565b90565b7fffffffff000000000000000000000000000000000000000000000000000000001690565b60ff1690565b6000612fbe826158b0565b82818337506000910152565b60005b8381101561592e578181015183820152602001615916565b838111156127a35750506000910152565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016905600a265627a7a7230582075fcae05644c6afa57da58b9541210644237fc1ec14adf590fb4a63ba9aec8876c6578706572696d656e74616cf50037",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 SLOAD PUSH1 0xFF NOT AND SWAP1 SSTORE CALLVALUE DUP1 ISZERO PUSH3 0x1B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x40 MLOAD PUSH3 0x5EC0 CODESIZE SUB DUP1 PUSH3 0x5EC0 DUP4 CODECOPY DUP2 ADD DUP1 PUSH1 0x40 MSTORE PUSH3 0x41 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH3 0x44D JUMP JUMPDEST DUP1 MLOAD DUP2 SWAP1 PUSH3 0x58 SWAP1 PUSH1 0x1 SWAP1 PUSH1 0x20 DUP5 ADD SWAP1 PUSH3 0x34C JUMP JUMPDEST POP POP PUSH1 0x40 DUP1 MLOAD PUSH32 0x454950373132446F6D61696E2800000000000000000000000000000000000000 PUSH1 0x20 DUP1 DUP4 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH32 0x737472696E67206E616D652C0000000000000000000000000000000000000000 PUSH1 0x2D DUP4 ADD MSTORE PUSH32 0x737472696E672076657273696F6E2C0000000000000000000000000000000000 PUSH1 0x39 DUP4 ADD MSTORE PUSH32 0x6164647265737320766572696679696E67436F6E747261637400000000000000 PUSH1 0x48 DUP4 ADD MSTORE PUSH32 0x2900000000000000000000000000000000000000000000000000000000000000 PUSH1 0x61 DUP4 ADD MSTORE DUP3 MLOAD PUSH1 0x42 DUP2 DUP5 SUB ADD DUP2 MSTORE PUSH1 0x62 SWAP1 SWAP3 ADD SWAP3 DUP4 SWAP1 MSTORE DUP2 MLOAD SWAP2 SWAP3 SWAP2 DUP3 SWAP2 DUP5 ADD SWAP1 DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT PUSH3 0x162 JUMPI DUP1 MLOAD DUP3 MSTORE PUSH1 0x1F NOT SWAP1 SWAP3 ADD SWAP2 PUSH1 0x20 SWAP2 DUP3 ADD SWAP2 ADD PUSH3 0x141 JUMP JUMPDEST MLOAD DUP2 MLOAD PUSH1 0x20 SWAP4 DUP5 SUB PUSH2 0x100 EXP PUSH1 0x0 NOT ADD DUP1 NOT SWAP1 SWAP3 AND SWAP2 AND OR SWAP1 MSTORE PUSH1 0x40 DUP1 MLOAD SWAP3 SWAP1 SWAP5 ADD DUP3 SWAP1 SUB DUP3 KECCAK256 DUP3 DUP6 ADD DUP6 MSTORE PUSH1 0xB DUP1 DUP5 MSTORE PUSH32 0x30782050726F746F636F6C000000000000000000000000000000000000000000 SWAP3 DUP5 ADD SWAP3 DUP4 MSTORE SWAP5 MLOAD SWAP1 SWAP7 POP SWAP2 SWAP5 POP SWAP1 SWAP3 DUP4 SWAP3 POP DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT PUSH3 0x1EC JUMPI DUP1 MLOAD DUP3 MSTORE PUSH1 0x1F NOT SWAP1 SWAP3 ADD SWAP2 PUSH1 0x20 SWAP2 DUP3 ADD SWAP2 ADD PUSH3 0x1CB JUMP JUMPDEST MLOAD DUP2 MLOAD PUSH1 0x20 SWAP4 DUP5 SUB PUSH2 0x100 EXP PUSH1 0x0 NOT ADD DUP1 NOT SWAP1 SWAP3 AND SWAP2 AND OR SWAP1 MSTORE PUSH1 0x40 DUP1 MLOAD SWAP3 SWAP1 SWAP5 ADD DUP3 SWAP1 SUB DUP3 KECCAK256 DUP3 DUP6 ADD DUP6 MSTORE PUSH1 0x1 DUP1 DUP5 MSTORE PUSH32 0x3200000000000000000000000000000000000000000000000000000000000000 SWAP3 DUP5 ADD SWAP3 DUP4 MSTORE SWAP5 MLOAD SWAP1 SWAP7 POP SWAP2 SWAP5 POP SWAP1 SWAP3 DUP4 SWAP3 POP DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT PUSH3 0x276 JUMPI DUP1 MLOAD DUP3 MSTORE PUSH1 0x1F NOT SWAP1 SWAP3 ADD SWAP2 PUSH1 0x20 SWAP2 DUP3 ADD SWAP2 ADD PUSH3 0x255 JUMP JUMPDEST MLOAD DUP2 MLOAD PUSH1 0x20 SWAP4 DUP5 SUB PUSH2 0x100 EXP PUSH1 0x0 NOT ADD DUP1 NOT SWAP1 SWAP3 AND SWAP2 AND OR SWAP1 MSTORE PUSH1 0x40 DUP1 MLOAD SWAP3 SWAP1 SWAP5 ADD DUP3 SWAP1 SUB DUP3 KECCAK256 DUP3 DUP3 ADD SWAP9 SWAP1 SWAP9 MSTORE DUP2 DUP5 ADD SWAP7 SWAP1 SWAP7 MSTORE PUSH1 0x60 DUP2 ADD SWAP7 SWAP1 SWAP7 MSTORE POP ADDRESS PUSH1 0x80 DUP1 DUP8 ADD SWAP2 SWAP1 SWAP2 MSTORE DUP2 MLOAD DUP1 DUP8 SUB SWAP1 SWAP2 ADD DUP2 MSTORE PUSH1 0xA0 SWAP1 SWAP6 ADD SWAP1 DUP2 SWAP1 MSTORE DUP5 MLOAD SWAP1 SWAP4 DUP5 SWAP4 POP DUP6 ADD SWAP2 POP DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT PUSH3 0x301 JUMPI DUP1 MLOAD DUP3 MSTORE PUSH1 0x1F NOT SWAP1 SWAP3 ADD SWAP2 PUSH1 0x20 SWAP2 DUP3 ADD SWAP2 ADD PUSH3 0x2E0 JUMP JUMPDEST MLOAD DUP2 MLOAD PUSH1 0x0 NOT PUSH1 0x20 SWAP5 SWAP1 SWAP5 SUB PUSH2 0x100 EXP SWAP4 SWAP1 SWAP4 ADD SWAP3 DUP4 AND SWAP3 NOT AND SWAP2 SWAP1 SWAP2 OR SWAP1 MSTORE PUSH1 0x40 MLOAD SWAP3 ADD DUP3 SWAP1 SUB SWAP1 SWAP2 KECCAK256 PUSH1 0x2 SSTORE POP POP PUSH1 0x3 DUP1 SLOAD PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB NOT AND CALLER OR SWAP1 SSTORE POP PUSH3 0x50F SWAP1 POP JUMP JUMPDEST DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 PUSH1 0x1F ADD PUSH1 0x20 SWAP1 DIV DUP2 ADD SWAP3 DUP3 PUSH1 0x1F LT PUSH3 0x38F JUMPI DUP1 MLOAD PUSH1 0xFF NOT AND DUP4 DUP1 ADD OR DUP6 SSTORE PUSH3 0x3BF JUMP JUMPDEST DUP3 DUP1 ADD PUSH1 0x1 ADD DUP6 SSTORE DUP3 ISZERO PUSH3 0x3BF JUMPI SWAP2 DUP3 ADD JUMPDEST DUP3 DUP2 GT ISZERO PUSH3 0x3BF JUMPI DUP3 MLOAD DUP3 SSTORE SWAP2 PUSH1 0x20 ADD SWAP2 SWAP1 PUSH1 0x1 ADD SWAP1 PUSH3 0x3A2 JUMP JUMPDEST POP PUSH3 0x3CD SWAP3 SWAP2 POP PUSH3 0x3D1 JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST PUSH3 0x3EE SWAP2 SWAP1 JUMPDEST DUP1 DUP3 GT ISZERO PUSH3 0x3CD JUMPI PUSH1 0x0 DUP2 SSTORE PUSH1 0x1 ADD PUSH3 0x3D8 JUMP JUMPDEST SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH3 0x403 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 MLOAD PUSH3 0x41A PUSH3 0x414 DUP3 PUSH3 0x4B4 JUMP JUMPDEST PUSH3 0x48D JUMP JUMPDEST SWAP2 POP DUP1 DUP3 MSTORE PUSH1 0x20 DUP4 ADD PUSH1 0x20 DUP4 ADD DUP6 DUP4 DUP4 ADD GT ISZERO PUSH3 0x437 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH3 0x444 DUP4 DUP3 DUP5 PUSH3 0x4DC JUMP JUMPDEST POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH3 0x460 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 MLOAD PUSH1 0x1 PUSH1 0x40 PUSH1 0x2 EXP SUB DUP2 GT ISZERO PUSH3 0x477 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH3 0x485 DUP5 DUP3 DUP6 ADD PUSH3 0x3F1 JUMP JUMPDEST SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x40 MLOAD DUP2 DUP2 ADD PUSH1 0x1 PUSH1 0x40 PUSH1 0x2 EXP SUB DUP2 GT DUP3 DUP3 LT OR ISZERO PUSH3 0x4AC JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x40 MSTORE SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1 PUSH1 0x40 PUSH1 0x2 EXP SUB DUP3 GT ISZERO PUSH3 0x4CB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x20 PUSH1 0x1F SWAP2 SWAP1 SWAP2 ADD PUSH1 0x1F NOT AND ADD SWAP1 JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH3 0x4F9 JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH3 0x4DF JUMP JUMPDEST DUP4 DUP2 GT ISZERO PUSH3 0x509 JUMPI PUSH1 0x0 DUP5 DUP5 ADD MSTORE JUMPDEST POP POP POP POP JUMP JUMPDEST PUSH2 0x59A1 DUP1 PUSH3 0x51F PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN STOP PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x1B6 JUMPI PUSH4 0xFFFFFFFF PUSH29 0x100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD DIV AND PUSH4 0x288CDC91 DUP2 EQ PUSH2 0x1BB JUMPI DUP1 PUSH4 0x297BB70B EQ PUSH2 0x1F1 JUMPI DUP1 PUSH4 0x2AC12622 EQ PUSH2 0x21E JUMPI DUP1 PUSH4 0x3683EF8E EQ PUSH2 0x24B JUMPI DUP1 PUSH4 0x3C28D861 EQ PUSH2 0x26D JUMPI DUP1 PUSH4 0x3E228BAE EQ PUSH2 0x29A JUMPI DUP1 PUSH4 0x3FD3C997 EQ PUSH2 0x2BA JUMPI DUP1 PUSH4 0x4AC14782 EQ PUSH2 0x2E7 JUMPI DUP1 PUSH4 0x4D0AE546 EQ PUSH2 0x307 JUMPI DUP1 PUSH4 0x4F9559B1 EQ PUSH2 0x327 JUMPI DUP1 PUSH4 0x50DDE190 EQ PUSH2 0x347 JUMPI DUP1 PUSH4 0x60704108 EQ PUSH2 0x367 JUMPI DUP1 PUSH4 0x642F2EAF EQ PUSH2 0x394 JUMPI DUP1 PUSH4 0x64A3BC15 EQ PUSH2 0x3B4 JUMPI DUP1 PUSH4 0x77FCCE68 EQ PUSH2 0x3D4 JUMPI DUP1 PUSH4 0x7B8E3514 EQ PUSH2 0x3F4 JUMPI DUP1 PUSH4 0x7E1D9808 EQ PUSH2 0x414 JUMPI DUP1 PUSH4 0x7E9D74DC EQ PUSH2 0x434 JUMPI DUP1 PUSH4 0x82C174D0 EQ PUSH2 0x461 JUMPI DUP1 PUSH4 0x8DA5CB5B EQ PUSH2 0x481 JUMPI DUP1 PUSH4 0x93634702 EQ PUSH2 0x496 JUMPI DUP1 PUSH4 0xA3E20380 EQ PUSH2 0x4B6 JUMPI DUP1 PUSH4 0xB4BE83D5 EQ PUSH2 0x4D6 JUMPI DUP1 PUSH4 0xBFC8BFCE EQ PUSH2 0x4F6 JUMPI DUP1 PUSH4 0xC585BB93 EQ PUSH2 0x516 JUMPI DUP1 PUSH4 0xC75E0A81 EQ PUSH2 0x536 JUMPI DUP1 PUSH4 0xD46B02C3 EQ PUSH2 0x563 JUMPI DUP1 PUSH4 0xD9BFA73E EQ PUSH2 0x583 JUMPI DUP1 PUSH4 0xDB123B1A EQ PUSH2 0x5A3 JUMPI DUP1 PUSH4 0xDD1C7D18 EQ PUSH2 0x5C5 JUMPI DUP1 PUSH4 0xE306F779 EQ PUSH2 0x5E5 JUMPI DUP1 PUSH4 0xE5FA431B EQ PUSH2 0x5FA JUMPI DUP1 PUSH4 0xEEA086BA EQ PUSH2 0x61A JUMPI DUP1 PUSH4 0xF2FDE38B EQ PUSH2 0x62F JUMPI DUP1 PUSH4 0xFFA1AD74 EQ PUSH2 0x64F JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1C7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1DB PUSH2 0x1D6 CALLDATASIZE PUSH1 0x4 PUSH2 0x48EE JUMP JUMPDEST PUSH2 0x664 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1E8 SWAP2 SWAP1 PUSH2 0x5513 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1FD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x211 PUSH2 0x20C CALLDATASIZE PUSH1 0x4 PUSH2 0x4811 JUMP JUMPDEST PUSH2 0x676 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1E8 SWAP2 SWAP1 PUSH2 0x57ED JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x22A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x23E PUSH2 0x239 CALLDATASIZE PUSH1 0x4 PUSH2 0x48EE JUMP JUMPDEST PUSH2 0x7A1 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1E8 SWAP2 SWAP1 PUSH2 0x5505 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x257 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x26B PUSH2 0x266 CALLDATASIZE PUSH1 0x4 PUSH2 0x492B JUMP JUMPDEST PUSH2 0x7B6 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x279 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x28D PUSH2 0x288 CALLDATASIZE PUSH1 0x4 PUSH2 0x4A5F JUMP JUMPDEST PUSH2 0x8A3 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1E8 SWAP2 SWAP1 PUSH2 0x57FB JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2A6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x211 PUSH2 0x2B5 CALLDATASIZE PUSH1 0x4 PUSH2 0x4B1F JUMP JUMPDEST PUSH2 0xA3A JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2C6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2DA PUSH2 0x2D5 CALLDATASIZE PUSH1 0x4 PUSH2 0x49EE JUMP JUMPDEST PUSH2 0xA90 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1E8 SWAP2 SWAP1 PUSH2 0x55CF JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2F3 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x26B PUSH2 0x302 CALLDATASIZE PUSH1 0x4 PUSH2 0x47DC JUMP JUMPDEST PUSH2 0xAB8 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x313 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x211 PUSH2 0x322 CALLDATASIZE PUSH1 0x4 PUSH2 0x4811 JUMP JUMPDEST PUSH2 0xB85 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x333 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x26B PUSH2 0x342 CALLDATASIZE PUSH1 0x4 PUSH2 0x48EE JUMP JUMPDEST PUSH2 0xC75 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x353 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x211 PUSH2 0x362 CALLDATASIZE PUSH1 0x4 PUSH2 0x4811 JUMP JUMPDEST PUSH2 0xE2A JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x373 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x387 PUSH2 0x382 CALLDATASIZE PUSH1 0x4 PUSH2 0x49EE JUMP JUMPDEST PUSH2 0xEBE JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1E8 SWAP2 SWAP1 PUSH2 0x5425 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3A0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x23E PUSH2 0x3AF CALLDATASIZE PUSH1 0x4 PUSH2 0x48EE JUMP JUMPDEST PUSH2 0xF0C JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3C0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x211 PUSH2 0x3CF CALLDATASIZE PUSH1 0x4 PUSH2 0x4B1F JUMP JUMPDEST PUSH2 0xF21 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3E0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x26B PUSH2 0x3EF CALLDATASIZE PUSH1 0x4 PUSH2 0x47AC JUMP JUMPDEST PUSH2 0xFCC JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x400 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x23E PUSH2 0x40F CALLDATASIZE PUSH1 0x4 PUSH2 0x4772 JUMP JUMPDEST PUSH2 0x1106 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x420 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x211 PUSH2 0x42F CALLDATASIZE PUSH1 0x4 PUSH2 0x48A5 JUMP JUMPDEST PUSH2 0x1126 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x440 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x454 PUSH2 0x44F CALLDATASIZE PUSH1 0x4 PUSH2 0x47DC JUMP JUMPDEST PUSH2 0x128A JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1E8 SWAP2 SWAP1 PUSH2 0x54F4 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x46D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x23E PUSH2 0x47C CALLDATASIZE PUSH1 0x4 PUSH2 0x490C JUMP JUMPDEST PUSH2 0x131F JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x48D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x387 PUSH2 0x133F JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x4A2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x23E PUSH2 0x4B1 CALLDATASIZE PUSH1 0x4 PUSH2 0x4993 JUMP JUMPDEST PUSH2 0x135B JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x4C2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x211 PUSH2 0x4D1 CALLDATASIZE PUSH1 0x4 PUSH2 0x48A5 JUMP JUMPDEST PUSH2 0x18DE JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x4E2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x211 PUSH2 0x4F1 CALLDATASIZE PUSH1 0x4 PUSH2 0x4B1F JUMP JUMPDEST PUSH2 0x19F1 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x502 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x26B PUSH2 0x511 CALLDATASIZE PUSH1 0x4 PUSH2 0x4B68 JUMP JUMPDEST PUSH2 0x1A6C JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x522 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x26B PUSH2 0x531 CALLDATASIZE PUSH1 0x4 PUSH2 0x4754 JUMP JUMPDEST PUSH2 0x1D05 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x542 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x556 PUSH2 0x551 CALLDATASIZE PUSH1 0x4 PUSH2 0x4A2A JUMP JUMPDEST PUSH2 0x1F30 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1E8 SWAP2 SWAP1 PUSH2 0x580A JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x56F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x26B PUSH2 0x57E CALLDATASIZE PUSH1 0x4 PUSH2 0x4A2A JUMP JUMPDEST PUSH2 0x202A JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x58F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1DB PUSH2 0x59E CALLDATASIZE PUSH1 0x4 PUSH2 0x4772 JUMP JUMPDEST PUSH2 0x20C6 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x5AF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x5B8 PUSH2 0x20E3 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1E8 SWAP2 SWAP1 PUSH2 0x55BE JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x5D1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x211 PUSH2 0x5E0 CALLDATASIZE PUSH1 0x4 PUSH2 0x48A5 JUMP JUMPDEST PUSH2 0x218E JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x5F1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1DB PUSH2 0x2263 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x606 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x211 PUSH2 0x615 CALLDATASIZE PUSH1 0x4 PUSH2 0x48A5 JUMP JUMPDEST PUSH2 0x2269 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x626 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x387 PUSH2 0x23DB JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x63B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x26B PUSH2 0x64A CALLDATASIZE PUSH1 0x4 PUSH2 0x4754 JUMP JUMPDEST PUSH2 0x23F7 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x65B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x5B8 PUSH2 0x24A8 JUMP JUMPDEST PUSH1 0x4 PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP2 JUMP JUMPDEST PUSH2 0x67E PUSH2 0x4386 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x689 PUSH2 0x4386 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x6CF JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x576D JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR DUP2 SSTORE DUP8 MLOAD SWAP4 POP SWAP2 POP JUMPDEST DUP2 DUP4 EQ PUSH2 0x76F JUMPI PUSH2 0x758 DUP8 DUP4 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x719 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP8 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x731 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP8 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x749 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x24DF JUMP JUMPDEST SWAP1 POP PUSH2 0x764 DUP5 DUP3 PUSH2 0x257D JUMP JUMPDEST PUSH1 0x1 SWAP1 SWAP2 ADD SWAP1 PUSH2 0x701 JUMP JUMPDEST POP POP PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x5 PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND CALLER EQ PUSH2 0x846 JUMPI PUSH2 0x80E DUP5 DUP5 DUP5 DUP5 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY POP PUSH2 0x135B SWAP5 POP POP POP POP POP JUMP JUMPDEST ISZERO ISZERO PUSH2 0x846 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x569D JUMP JUMPDEST POP POP PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x7 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP5 KECCAK256 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP4 AND DUP5 MSTORE SWAP2 SWAP1 MSTORE SWAP1 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR SWAP1 SSTORE JUMP JUMPDEST PUSH2 0x8AB PUSH2 0x43AF JUMP JUMPDEST PUSH2 0x8B3 PUSH2 0x43DE JUMP JUMPDEST PUSH2 0x8BB PUSH2 0x43DE JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x8F9 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x576D JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR SWAP1 SSTORE PUSH2 0x160 DUP1 DUP10 ADD MLOAD PUSH2 0x140 DUP1 DUP11 ADD SWAP2 SWAP1 SWAP2 MSTORE DUP10 ADD MLOAD SWAP1 DUP9 ADD MSTORE PUSH2 0x945 DUP9 PUSH2 0x1F30 JUMP JUMPDEST SWAP3 POP PUSH2 0x950 DUP8 PUSH2 0x1F30 JUMP JUMPDEST SWAP2 POP PUSH2 0x95A PUSH2 0x25DF JUMP JUMPDEST SWAP1 POP PUSH2 0x968 DUP9 DUP5 DUP4 DUP10 PUSH2 0x2611 JUMP JUMPDEST PUSH2 0x974 DUP8 DUP4 DUP4 DUP9 PUSH2 0x2611 JUMP JUMPDEST PUSH2 0x97E DUP9 DUP9 PUSH2 0x27A9 JUMP JUMPDEST PUSH2 0x992 DUP9 DUP9 DUP6 PUSH1 0x40 ADD MLOAD DUP6 PUSH1 0x40 ADD MLOAD PUSH2 0x2809 JUMP JUMPDEST DUP1 MLOAD PUSH1 0x20 DUP2 ADD MLOAD SWAP1 MLOAD SWAP2 SWAP6 POP PUSH2 0x9AD SWAP2 DUP11 SWAP2 DUP7 SWAP2 DUP2 SWAP1 PUSH2 0x2990 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP6 ADD MLOAD SWAP1 DUP2 ADD MLOAD SWAP1 MLOAD PUSH2 0x9C9 SWAP2 DUP10 SWAP2 DUP6 SWAP2 SWAP1 DUP2 SWAP1 PUSH2 0x2990 JUMP JUMPDEST PUSH2 0x9E2 DUP9 DUP3 DUP6 PUSH1 0x20 ADD MLOAD DUP7 PUSH1 0x40 ADD MLOAD DUP9 PUSH1 0x0 ADD MLOAD PUSH2 0x2AA9 JUMP JUMPDEST PUSH2 0x9FB DUP8 DUP3 DUP5 PUSH1 0x20 ADD MLOAD DUP6 PUSH1 0x40 ADD MLOAD DUP9 PUSH1 0x20 ADD MLOAD PUSH2 0x2AA9 JUMP JUMPDEST PUSH2 0xA07 DUP9 DUP9 DUP4 DUP8 PUSH2 0x2B55 JUMP JUMPDEST POP POP PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE POP SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH2 0xA42 PUSH2 0x4386 JUMP JUMPDEST PUSH1 0x60 PUSH2 0xA4F DUP6 DUP6 DUP6 PUSH2 0x2D2D JUMP JUMPDEST SWAP1 POP PUSH1 0x80 DUP2 DUP3 MLOAD PUSH1 0x20 DUP5 ADD ADDRESS GAS DELEGATECALL DUP1 ISZERO PUSH2 0xA86 JUMPI DUP2 MLOAD DUP4 MSTORE PUSH1 0x20 DUP3 ADD MLOAD PUSH1 0x20 DUP5 ADD MSTORE PUSH1 0x40 DUP3 ADD MLOAD PUSH1 0x40 DUP5 ADD MSTORE PUSH1 0x60 DUP3 ADD MLOAD PUSH1 0x60 DUP5 ADD MSTORE JUMPDEST POP JUMPDEST POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0xB PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD DUP2 SWAP1 PUSH1 0xFF AND ISZERO PUSH2 0xAF8 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x576D JUMP JUMPDEST POP POP PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR DUP2 SSTORE DUP2 MLOAD SWAP1 JUMPDEST DUP1 DUP3 EQ PUSH2 0xB58 JUMPI PUSH2 0xB50 DUP4 DUP3 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xB41 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x2EFF JUMP JUMPDEST PUSH1 0x1 ADD PUSH2 0xB29 JUMP JUMPDEST POP POP PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE POP JUMP JUMPDEST PUSH2 0xB8D PUSH2 0x4386 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0xB98 PUSH2 0x4386 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0xBD5 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x576D JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR DUP2 SSTORE DUP8 MLOAD SWAP4 POP SWAP2 POP JUMPDEST DUP2 DUP4 EQ PUSH2 0x76F JUMPI PUSH2 0xC5E DUP8 DUP4 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xC1F JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP8 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xC37 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP8 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xC4F JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x2F2A JUMP JUMPDEST SWAP1 POP PUSH2 0xC6A DUP5 DUP3 PUSH2 0x257D JUMP JUMPDEST PUSH1 0x1 SWAP1 SWAP2 ADD SWAP1 PUSH2 0xC07 JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD DUP2 SWAP1 DUP2 SWAP1 DUP2 SWAP1 PUSH1 0xFF AND ISZERO PUSH2 0xCB9 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x576D JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR SWAP1 SSTORE PUSH2 0xCEC PUSH2 0x25DF JUMP JUMPDEST SWAP4 POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND CALLER EQ PUSH2 0xD11 JUMPI CALLER PUSH2 0xD14 JUMP JUMPDEST PUSH1 0x0 JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP7 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x6 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 SWAP4 DUP6 AND DUP4 MSTORE SWAP3 SWAP1 MSTORE KECCAK256 SLOAD SWAP1 SWAP4 POP PUSH1 0x1 DUP7 ADD SWAP3 POP SWAP1 POP DUP1 DUP3 GT PUSH2 0xD8B JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x572D JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP6 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x6 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 SWAP5 DUP9 AND DUP1 DUP5 MSTORE SWAP5 SWAP1 SWAP2 MSTORE SWAP1 DUP2 SWAP1 KECCAK256 DUP6 SWAP1 SSTORE MLOAD PUSH32 0x82AF639571738F4EBD4268FB0363D8957EBE1BBB9E78DBA5EBD69EED39B154F0 SWAP1 PUSH2 0xDF3 SWAP1 DUP7 SWAP1 PUSH2 0x5513 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 POP POP PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE POP POP POP JUMP JUMPDEST PUSH2 0xE32 PUSH2 0x4386 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0xE3D PUSH2 0x4386 JUMP JUMPDEST DUP7 MLOAD SWAP3 POP PUSH1 0x0 SWAP2 POP JUMPDEST DUP2 DUP4 EQ PUSH2 0xEB4 JUMPI PUSH2 0xE9D DUP8 DUP4 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xE5E JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP8 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xE76 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP8 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xE8E JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0xA3A JUMP JUMPDEST SWAP1 POP PUSH2 0xEA9 DUP5 DUP3 PUSH2 0x257D JUMP JUMPDEST PUSH1 0x1 SWAP1 SWAP2 ADD SWAP1 PUSH2 0xE46 JUMP JUMPDEST POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 DUP2 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0xB PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND JUMPDEST SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x9 PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH2 0xF29 PUSH2 0x4386 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0xF66 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x576D JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR SWAP1 SSTORE PUSH2 0xF9C DUP5 DUP5 DUP5 PUSH2 0x2F2A JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x100A JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x576D JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR SWAP1 SSTORE PUSH2 0x103D PUSH2 0x25DF JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 DUP2 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x8 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 SWAP5 DUP10 AND DUP1 DUP5 MSTORE SWAP5 SWAP1 SWAP2 MSTORE SWAP1 DUP2 SWAP1 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND DUP8 ISZERO ISZERO OR SWAP1 SSTORE MLOAD SWAP3 SWAP4 POP SWAP1 SWAP2 PUSH32 0xA8656E308026EEABCE8F0BC18048433252318AB80AC79DA0B3D3D8697DFBA891 SWAP1 PUSH2 0x10D1 SWAP1 DUP7 SWAP1 PUSH2 0x5505 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 POP POP PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE POP JUMP JUMPDEST PUSH1 0x8 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x0 SWAP3 DUP4 MSTORE PUSH1 0x40 DUP1 DUP5 KECCAK256 SWAP1 SWAP2 MSTORE SWAP1 DUP3 MSTORE SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH2 0x112E PUSH2 0x4386 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x0 DUP1 PUSH1 0x0 PUSH2 0x113D PUSH2 0x4386 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x117A JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x576D JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR DUP2 SSTORE DUP10 MLOAD DUP11 SWAP2 SWAP1 DUP2 LT PUSH2 0x11B2 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x160 ADD MLOAD SWAP5 POP DUP9 MLOAD SWAP4 POP PUSH1 0x0 SWAP3 POP JUMPDEST DUP3 DUP5 EQ PUSH2 0x1255 JUMPI DUP5 DUP10 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x11E2 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x160 ADD DUP2 SWAP1 MSTORE POP PUSH2 0x1202 DUP9 DUP8 PUSH1 0x20 ADD MLOAD PUSH2 0x2F7D JUMP JUMPDEST SWAP2 POP PUSH2 0x122E DUP10 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1215 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP4 DUP10 DUP7 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x749 JUMPI INVALID JUMPDEST SWAP1 POP PUSH2 0x123A DUP7 DUP3 PUSH2 0x257D JUMP JUMPDEST PUSH1 0x20 DUP7 ADD MLOAD DUP9 GT PUSH2 0x124A JUMPI PUSH2 0x1255 JUMP JUMPDEST PUSH1 0x1 SWAP1 SWAP3 ADD SWAP2 PUSH2 0x11CC JUMP JUMPDEST POP POP PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE POP SWAP2 SWAP6 SWAP5 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x60 PUSH1 0x0 PUSH1 0x60 PUSH1 0x0 DUP5 MLOAD SWAP3 POP DUP3 PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x12D0 JUMPI DUP2 PUSH1 0x20 ADD JUMPDEST PUSH2 0x12BD PUSH2 0x43DE JUMP JUMPDEST DUP2 MSTORE PUSH1 0x20 ADD SWAP1 PUSH1 0x1 SWAP1 SUB SWAP1 DUP2 PUSH2 0x12B5 JUMPI SWAP1 POP JUMPDEST POP SWAP2 POP PUSH1 0x0 SWAP1 POP JUMPDEST DUP1 DUP4 EQ PUSH2 0xA88 JUMPI PUSH2 0x12FF DUP6 DUP3 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x12F0 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x1F30 JUMP JUMPDEST DUP3 DUP3 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x130D JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD MSTORE PUSH1 0x1 ADD PUSH2 0x12D8 JUMP JUMPDEST PUSH1 0x7 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x0 SWAP3 DUP4 MSTORE PUSH1 0x40 DUP1 DUP5 KECCAK256 SWAP1 SWAP2 MSTORE SWAP1 DUP3 MSTORE SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH1 0x3 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 DUP10 MLOAD GT ISZERO ISZERO PUSH2 0x13A4 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x571D JUMP JUMPDEST PUSH2 0x13AD DUP10 PUSH2 0x2FC4 JUMP JUMPDEST PUSH32 0x100000000000000000000000000000000000000000000000000000000000000 SWAP1 DIV SWAP7 POP PUSH1 0x7 PUSH1 0xFF DUP9 AND LT PUSH2 0x140F JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x563D JUMP JUMPDEST DUP7 PUSH1 0xFF AND PUSH1 0x7 DUP2 GT ISZERO PUSH2 0x141E JUMPI INVALID JUMPDEST SWAP6 POP PUSH1 0x0 DUP7 PUSH1 0x7 DUP2 GT ISZERO PUSH2 0x142E JUMPI INVALID JUMPDEST EQ ISZERO PUSH2 0x1466 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x570D JUMP JUMPDEST PUSH1 0x1 DUP7 PUSH1 0x7 DUP2 GT ISZERO PUSH2 0x1474 JUMPI INVALID JUMPDEST EQ ISZERO PUSH2 0x14BC JUMPI DUP9 MLOAD ISZERO PUSH2 0x14B3 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x57DD JUMP JUMPDEST PUSH1 0x0 SWAP8 POP PUSH2 0x18D0 JUMP JUMPDEST PUSH1 0x2 DUP7 PUSH1 0x7 DUP2 GT ISZERO PUSH2 0x14CA JUMPI INVALID JUMPDEST EQ ISZERO PUSH2 0x1605 JUMPI DUP9 MLOAD PUSH1 0x41 EQ PUSH2 0x150B JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x55DD JUMP JUMPDEST DUP9 PUSH1 0x0 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x151A JUMPI INVALID JUMPDEST ADD PUSH1 0x20 ADD MLOAD PUSH32 0x100000000000000000000000000000000000000000000000000000000000000 SWAP1 DUP2 SWAP1 DIV DUP2 MUL DIV SWAP5 POP PUSH2 0x155A DUP10 PUSH1 0x1 PUSH4 0xFFFFFFFF PUSH2 0x3088 AND JUMP JUMPDEST SWAP4 POP PUSH2 0x156D DUP10 PUSH1 0x21 PUSH4 0xFFFFFFFF PUSH2 0x3088 AND JUMP JUMPDEST SWAP3 POP PUSH1 0x1 DUP12 DUP7 DUP7 DUP7 PUSH1 0x40 MLOAD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MSTORE PUSH1 0x40 MLOAD PUSH2 0x1592 SWAP5 SWAP4 SWAP3 SWAP2 SWAP1 PUSH2 0x556E JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 SUB SWAP1 DUP1 DUP5 SUB SWAP1 PUSH1 0x0 DUP7 GAS CALL ISZERO DUP1 ISZERO PUSH2 0x15B6 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP PUSH1 0x40 MLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP13 DUP2 AND SWAP1 DUP3 AND EQ SWAP10 POP SWAP3 POP PUSH2 0x18D0 SWAP1 POP JUMP JUMPDEST PUSH1 0x3 DUP7 PUSH1 0x7 DUP2 GT ISZERO PUSH2 0x1613 JUMPI INVALID JUMPDEST EQ ISZERO PUSH2 0x17B9 JUMPI DUP9 MLOAD PUSH1 0x41 EQ PUSH2 0x1654 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x55DD JUMP JUMPDEST DUP9 PUSH1 0x0 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1663 JUMPI INVALID JUMPDEST ADD PUSH1 0x20 ADD MLOAD PUSH32 0x100000000000000000000000000000000000000000000000000000000000000 SWAP1 DUP2 SWAP1 DIV DUP2 MUL DIV SWAP5 POP PUSH2 0x16A3 DUP10 PUSH1 0x1 PUSH4 0xFFFFFFFF PUSH2 0x3088 AND JUMP JUMPDEST SWAP4 POP PUSH2 0x16B6 DUP10 PUSH1 0x21 PUSH4 0xFFFFFFFF PUSH2 0x3088 AND JUMP JUMPDEST SWAP3 POP PUSH1 0x1 DUP12 PUSH1 0x40 MLOAD PUSH1 0x20 ADD DUP1 DUP1 PUSH32 0x19457468657265756D205369676E6564204D6573736167653A0A333200000000 DUP2 MSTORE POP PUSH1 0x1C ADD DUP3 PUSH1 0x0 NOT AND PUSH1 0x0 NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE PUSH1 0x40 MLOAD DUP1 DUP3 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT PUSH2 0x1757 JUMPI DUP1 MLOAD DUP3 MSTORE PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 SWAP1 SWAP3 ADD SWAP2 PUSH1 0x20 SWAP2 DUP3 ADD SWAP2 ADD PUSH2 0x171A JUMP JUMPDEST MLOAD DUP2 MLOAD PUSH1 0x20 SWAP4 DUP5 SUB PUSH2 0x100 EXP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD DUP1 NOT SWAP1 SWAP3 AND SWAP2 AND OR SWAP1 MSTORE PUSH1 0x40 DUP1 MLOAD SWAP3 SWAP1 SWAP5 ADD DUP3 SWAP1 SUB DUP3 KECCAK256 PUSH1 0x0 DUP4 MSTORE SWAP2 ADD SWAP3 DUP4 SWAP1 MSTORE PUSH2 0x1592 SWAP5 POP SWAP3 POP DUP10 SWAP2 DUP10 SWAP2 POP DUP9 SWAP1 PUSH2 0x556E JUMP JUMPDEST PUSH1 0x4 DUP7 PUSH1 0x7 DUP2 GT ISZERO PUSH2 0x17C7 JUMPI INVALID JUMPDEST EQ ISZERO PUSH2 0x17DF JUMPI PUSH2 0x17D8 DUP12 DUP12 DUP12 PUSH2 0x30D3 JUMP JUMPDEST SWAP8 POP PUSH2 0x18D0 JUMP JUMPDEST PUSH1 0x5 DUP7 PUSH1 0x7 DUP2 GT ISZERO PUSH2 0x17ED JUMPI INVALID JUMPDEST EQ ISZERO PUSH2 0x1850 JUMPI PUSH2 0x17FC DUP10 PUSH2 0x3228 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP13 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x8 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 SWAP4 DUP6 AND DUP4 MSTORE SWAP3 SWAP1 MSTORE KECCAK256 SLOAD SWAP1 SWAP2 POP PUSH1 0xFF AND ISZERO ISZERO PUSH2 0x1844 JUMPI PUSH1 0x0 SWAP8 POP PUSH2 0x18D0 JUMP JUMPDEST PUSH2 0x17D8 DUP2 DUP13 DUP13 DUP13 PUSH2 0x32A1 JUMP JUMPDEST PUSH1 0x6 DUP7 PUSH1 0x7 DUP2 GT ISZERO PUSH2 0x185E JUMPI INVALID JUMPDEST EQ ISZERO PUSH2 0x189E JUMPI PUSH1 0x0 DUP12 DUP2 MSTORE PUSH1 0x7 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP15 AND DUP5 MSTORE SWAP1 SWAP2 MSTORE SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND SWAP8 POP PUSH2 0x18D0 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x563D JUMP JUMPDEST POP POP POP POP POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH2 0x18E6 PUSH2 0x4386 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH2 0x18F6 PUSH2 0x4386 JUMP JUMPDEST DUP10 PUSH1 0x0 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1905 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x140 ADD MLOAD SWAP6 POP DUP10 MLOAD SWAP5 POP PUSH1 0x0 SWAP4 POP JUMPDEST DUP4 DUP6 EQ PUSH2 0x19E4 JUMPI DUP6 DUP11 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1935 JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD MLOAD PUSH2 0x140 ADD MSTORE DUP7 MLOAD PUSH2 0x1951 SWAP1 DUP11 SWAP1 PUSH2 0x2F7D JUMP JUMPDEST SWAP3 POP PUSH2 0x1994 DUP11 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1964 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH1 0xA0 ADD MLOAD DUP12 DUP7 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1980 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH1 0x80 ADD MLOAD DUP6 PUSH2 0x33FD JUMP JUMPDEST SWAP2 POP PUSH2 0x19C0 DUP11 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x19A7 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP4 DUP11 DUP8 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xE8E JUMPI INVALID JUMPDEST SWAP1 POP PUSH2 0x19CC DUP8 DUP3 PUSH2 0x257D JUMP JUMPDEST DUP7 MLOAD DUP10 GT PUSH2 0x19D9 JUMPI PUSH2 0x19E4 JUMP JUMPDEST PUSH1 0x1 SWAP1 SWAP4 ADD SWAP3 PUSH2 0x191F JUMP JUMPDEST POP POP POP POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH2 0x19F9 PUSH2 0x4386 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x1A36 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x576D JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR SWAP1 SSTORE PUSH2 0xF9C DUP5 DUP5 DUP5 PUSH2 0x24DF JUMP JUMPDEST PUSH1 0xA SLOAD PUSH1 0x0 SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND ISZERO PUSH2 0x1ABF JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x576D JUMP JUMPDEST PUSH2 0x1B02 PUSH2 0x1AFD DUP9 DUP9 DUP9 DUP9 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY POP PUSH2 0x3453 SWAP5 POP POP POP POP POP JUMP JUMPDEST PUSH2 0x3694 JUMP JUMPDEST PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x9 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD SWAP1 SWAP2 POP PUSH1 0xFF AND ISZERO PUSH2 0x1B4E JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x568D JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP7 AND CALLER EQ PUSH2 0x1C1F JUMPI PUSH2 0x1BA6 DUP2 DUP8 DUP6 DUP6 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY POP PUSH2 0x135B SWAP5 POP POP POP POP POP JUMP JUMPDEST ISZERO ISZERO PUSH2 0x1BDE JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x57CD JUMP JUMPDEST PUSH1 0xA DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP9 AND OR SWAP1 SSTORE JUMPDEST PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x9 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 DUP2 SWAP1 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR SWAP1 SSTORE MLOAD ADDRESS SWAP1 DUP7 SWAP1 DUP7 SWAP1 DUP1 DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP SWAP3 POP POP POP PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP6 GAS DELEGATECALL SWAP2 POP POP ISZERO ISZERO PUSH2 0x1CB6 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x56BD JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP7 AND CALLER EQ PUSH2 0x1CFC JUMPI PUSH1 0xA DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND SWAP1 SSTORE JUMPDEST POP POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x3 SLOAD PUSH1 0x0 SWAP1 DUP2 SWAP1 DUP2 SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0x1D5D JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x577D JUMP JUMPDEST DUP4 SWAP3 POP DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0xAE25532E PUSH1 0x40 MLOAD DUP2 PUSH4 0xFFFFFFFF AND PUSH29 0x100000000000000000000000000000000000000000000000000000000 MUL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x1DC4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x1DD8 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP PUSH2 0x1DFC SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x4A0C JUMP JUMPDEST PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 DUP2 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0xB PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD SWAP1 SWAP3 POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 POP DUP1 ISZERO PUSH2 0x1E81 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x561D JUMP JUMPDEST PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0xB PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 DUP2 SWAP1 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP7 AND OR SWAP1 SSTORE MLOAD PUSH32 0xD2C6B762299C609BDB96520B58A49BFB80186934D4F71A86A367571A15C03194 SWAP1 PUSH2 0x1F22 SWAP1 DUP5 SWAP1 DUP8 SWAP1 PUSH2 0x55A3 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG1 POP POP POP POP JUMP JUMPDEST PUSH2 0x1F38 PUSH2 0x43DE JUMP JUMPDEST PUSH2 0x1F41 DUP3 PUSH2 0x36D1 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP4 ADD DUP3 SWAP1 MSTORE PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x4 SWAP1 MSTORE PUSH1 0x40 SWAP1 DUP2 SWAP1 KECCAK256 SLOAD SWAP1 DUP3 ADD MSTORE PUSH1 0x80 DUP3 ADD MLOAD ISZERO ISZERO PUSH2 0x1F75 JUMPI PUSH1 0x1 JUMPDEST PUSH1 0xFF AND DUP2 MSTORE PUSH2 0xF07 JUMP JUMPDEST PUSH1 0xA0 DUP3 ADD MLOAD ISZERO ISZERO PUSH2 0x1F87 JUMPI PUSH1 0x2 PUSH2 0x1F6B JUMP JUMPDEST PUSH1 0xA0 DUP3 ADD MLOAD PUSH1 0x40 DUP3 ADD MLOAD LT PUSH2 0x1F9D JUMPI PUSH1 0x5 PUSH2 0x1F6B JUMP JUMPDEST PUSH2 0x100 DUP3 ADD MLOAD TIMESTAMP LT PUSH2 0x1FB0 JUMPI PUSH1 0x4 PUSH2 0x1F6B JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 ADD MLOAD PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x5 SWAP1 SWAP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x1FD4 JUMPI PUSH1 0x6 PUSH2 0x1F6B JUMP JUMPDEST PUSH2 0x120 DUP3 ADD MLOAD DUP3 MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 DUP2 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x6 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 PUSH1 0x60 DUP9 ADD MLOAD SWAP1 SWAP5 AND DUP4 MSTORE SWAP3 SWAP1 MSTORE KECCAK256 SLOAD GT ISZERO PUSH2 0x2021 JUMPI PUSH1 0x6 PUSH2 0x1F6B JUMP JUMPDEST PUSH1 0x3 DUP2 MSTORE SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x2067 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x576D JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR SWAP1 SSTORE PUSH2 0x209B DUP2 PUSH2 0x2EFF JUMP JUMPDEST POP PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE JUMP JUMPDEST PUSH1 0x6 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x0 SWAP3 DUP4 MSTORE PUSH1 0x40 DUP1 DUP5 KECCAK256 SWAP1 SWAP2 MSTORE SWAP1 DUP3 MSTORE SWAP1 KECCAK256 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x1 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 PUSH1 0x2 DUP5 DUP7 AND ISZERO PUSH2 0x100 MUL PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 SWAP5 AND SWAP4 SWAP1 SWAP4 DIV PUSH1 0x1F DUP2 ADD DUP5 SWAP1 DIV DUP5 MUL DUP3 ADD DUP5 ADD SWAP1 SWAP3 MSTORE DUP2 DUP2 MSTORE SWAP3 SWAP2 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0x2186 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x215B JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x2186 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x2169 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP DUP2 JUMP JUMPDEST PUSH2 0x2196 PUSH2 0x4386 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x0 DUP1 PUSH1 0x0 PUSH2 0x21A5 PUSH2 0x4386 JUMP JUMPDEST DUP9 PUSH1 0x0 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x21B4 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x160 ADD MLOAD SWAP5 POP DUP9 MLOAD SWAP4 POP PUSH1 0x0 SWAP3 POP JUMPDEST DUP3 DUP5 EQ PUSH2 0x2257 JUMPI DUP5 DUP10 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x21E4 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x160 ADD DUP2 SWAP1 MSTORE POP PUSH2 0x2204 DUP9 DUP8 PUSH1 0x20 ADD MLOAD PUSH2 0x2F7D JUMP JUMPDEST SWAP2 POP PUSH2 0x2230 DUP10 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x2217 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP4 DUP10 DUP7 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xE8E JUMPI INVALID JUMPDEST SWAP1 POP PUSH2 0x223C DUP7 DUP3 PUSH2 0x257D JUMP JUMPDEST PUSH1 0x20 DUP7 ADD MLOAD DUP9 GT PUSH2 0x224C JUMPI PUSH2 0x2257 JUMP JUMPDEST PUSH1 0x1 SWAP1 SWAP3 ADD SWAP2 PUSH2 0x21CE JUMP JUMPDEST POP POP POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x2 SLOAD DUP2 JUMP JUMPDEST PUSH2 0x2271 PUSH2 0x4386 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH2 0x2281 PUSH2 0x4386 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x22BE JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x576D JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR DUP2 SSTORE DUP11 MLOAD DUP12 SWAP2 SWAP1 DUP2 LT PUSH2 0x22F6 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x140 ADD MLOAD SWAP6 POP DUP10 MLOAD SWAP5 POP PUSH1 0x0 SWAP4 POP JUMPDEST DUP4 DUP6 EQ PUSH2 0x23A5 JUMPI DUP6 DUP11 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x2326 JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD MLOAD PUSH2 0x140 ADD MSTORE DUP7 MLOAD PUSH2 0x2342 SWAP1 DUP11 SWAP1 PUSH2 0x2F7D JUMP JUMPDEST SWAP3 POP PUSH2 0x2355 DUP11 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1964 JUMPI INVALID JUMPDEST SWAP2 POP PUSH2 0x2381 DUP11 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x2368 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP4 DUP11 DUP8 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x749 JUMPI INVALID JUMPDEST SWAP1 POP PUSH2 0x238D DUP8 DUP3 PUSH2 0x257D JUMP JUMPDEST DUP7 MLOAD DUP10 GT PUSH2 0x239A JUMPI PUSH2 0x23A5 JUMP JUMPDEST PUSH1 0x1 SWAP1 SWAP4 ADD SWAP3 PUSH2 0x2310 JUMP JUMPDEST POP POP PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE POP SWAP3 SWAP7 SWAP6 POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0xA SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x3 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0x2448 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x577D JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND ISZERO PUSH2 0x24A5 JUMPI PUSH1 0x3 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND OR SWAP1 SSTORE JUMPDEST POP JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD DUP1 DUP3 ADD SWAP1 SWAP2 MSTORE PUSH1 0xB DUP2 MSTORE PUSH32 0x322E302E312D616C706861000000000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE DUP2 JUMP JUMPDEST PUSH2 0x24E7 PUSH2 0x4386 JUMP JUMPDEST PUSH2 0x24EF PUSH2 0x43DE JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH2 0x24FD DUP9 PUSH2 0x1F30 JUMP JUMPDEST SWAP4 POP PUSH2 0x2507 PUSH2 0x25DF JUMP JUMPDEST SWAP3 POP PUSH2 0x2515 DUP9 DUP6 DUP6 DUP10 PUSH2 0x2611 JUMP JUMPDEST PUSH2 0x2527 DUP9 PUSH1 0xA0 ADD MLOAD DUP6 PUSH1 0x40 ADD MLOAD PUSH2 0x2F7D JUMP JUMPDEST SWAP2 POP PUSH2 0x2533 DUP8 DUP4 PUSH2 0x36DF JUMP JUMPDEST SWAP1 POP PUSH2 0x2546 DUP9 DUP6 DUP10 DUP5 DUP10 PUSH1 0x0 ADD MLOAD PUSH2 0x2990 JUMP JUMPDEST PUSH2 0x2550 DUP9 DUP3 PUSH2 0x36F5 JUMP JUMPDEST SWAP5 POP PUSH2 0x2567 DUP9 DUP5 DUP7 PUSH1 0x20 ADD MLOAD DUP8 PUSH1 0x40 ADD MLOAD DUP10 PUSH2 0x2AA9 JUMP JUMPDEST PUSH2 0x2572 DUP9 DUP5 DUP8 PUSH2 0x3756 JUMP JUMPDEST POP POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST DUP2 MLOAD DUP2 MLOAD PUSH2 0x258B SWAP2 SWAP1 PUSH2 0x3864 JUMP JUMPDEST DUP3 MSTORE PUSH1 0x20 DUP1 DUP4 ADD MLOAD SWAP1 DUP3 ADD MLOAD PUSH2 0x25A1 SWAP2 SWAP1 PUSH2 0x3864 JUMP JUMPDEST PUSH1 0x20 DUP4 ADD MSTORE PUSH1 0x40 DUP1 DUP4 ADD MLOAD SWAP1 DUP3 ADD MLOAD PUSH2 0x25BA SWAP2 SWAP1 PUSH2 0x3864 JUMP JUMPDEST PUSH1 0x40 DUP4 ADD MSTORE PUSH1 0x60 DUP1 DUP4 ADD MLOAD SWAP1 DUP3 ADD MLOAD PUSH2 0x25D3 SWAP2 SWAP1 PUSH2 0x3864 JUMP JUMPDEST PUSH1 0x60 SWAP1 SWAP3 ADD SWAP2 SWAP1 SWAP2 MSTORE POP JUMP JUMPDEST PUSH1 0xA SLOAD PUSH1 0x0 SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 DUP2 ISZERO PUSH2 0x2608 JUMPI DUP2 PUSH2 0x260A JUMP JUMPDEST CALLER JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST DUP3 MLOAD PUSH1 0xFF AND PUSH1 0x3 EQ PUSH2 0x264F JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x579D JUMP JUMPDEST PUSH1 0x60 DUP5 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND ISZERO PUSH2 0x26C2 JUMPI PUSH1 0x60 DUP5 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0x26C2 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x57AD JUMP JUMPDEST PUSH1 0x20 DUP5 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND ISZERO PUSH2 0x274D JUMPI DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP5 PUSH1 0x20 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x274D JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x55ED JUMP JUMPDEST PUSH1 0x40 DUP4 ADD MLOAD ISZERO ISZERO PUSH2 0x27A3 JUMPI PUSH2 0x276B DUP4 PUSH1 0x20 ADD MLOAD DUP6 PUSH1 0x0 ADD MLOAD DUP4 PUSH2 0x135B JUMP JUMPDEST ISZERO ISZERO PUSH2 0x27A3 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x565D JUMP JUMPDEST POP POP POP POP JUMP JUMPDEST PUSH2 0x27BB DUP3 PUSH1 0xA0 ADD MLOAD DUP3 PUSH1 0xA0 ADD MLOAD PUSH2 0x38AE JUMP JUMPDEST PUSH2 0x27CD DUP4 PUSH1 0x80 ADD MLOAD DUP4 PUSH1 0x80 ADD MLOAD PUSH2 0x38AE JUMP JUMPDEST LT ISZERO PUSH2 0x2805 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x57BD JUMP JUMPDEST POP POP JUMP JUMPDEST PUSH2 0x2811 PUSH2 0x43AF JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH2 0x2825 DUP10 PUSH1 0xA0 ADD MLOAD DUP9 PUSH2 0x2F7D JUMP JUMPDEST SWAP4 POP PUSH2 0x283A DUP10 PUSH1 0x80 ADD MLOAD DUP11 PUSH1 0xA0 ADD MLOAD DUP7 PUSH2 0x3909 JUMP JUMPDEST SWAP3 POP PUSH2 0x284A DUP9 PUSH1 0xA0 ADD MLOAD DUP8 PUSH2 0x2F7D JUMP JUMPDEST SWAP2 POP PUSH2 0x285F DUP9 PUSH1 0x80 ADD MLOAD DUP10 PUSH1 0xA0 ADD MLOAD DUP5 PUSH2 0x3909 JUMP JUMPDEST SWAP1 POP DUP1 DUP5 LT PUSH2 0x28A2 JUMPI PUSH1 0x20 DUP1 DUP7 ADD DUP1 MLOAD DUP4 SWAP1 MSTORE DUP1 MLOAD DUP3 ADD DUP5 SWAP1 MSTORE MLOAD MLOAD DUP7 MLOAD DUP3 ADD MSTORE PUSH1 0x80 DUP11 ADD MLOAD PUSH1 0xA0 DUP12 ADD MLOAD DUP8 MLOAD SWAP1 SWAP3 ADD MLOAD PUSH2 0x289A SWAP3 SWAP1 PUSH2 0x3909 JUMP JUMPDEST DUP6 MLOAD MSTORE PUSH2 0x28DF JUMP JUMPDEST DUP5 MLOAD DUP4 SWAP1 MSTORE DUP5 MLOAD PUSH1 0x20 SWAP1 DUP2 ADD DUP6 SWAP1 MSTORE DUP6 MLOAD DUP2 ADD MLOAD SWAP1 DUP7 ADD DUP1 MLOAD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0xA0 DUP10 ADD MLOAD PUSH1 0x80 DUP11 ADD MLOAD SWAP2 MLOAD MLOAD PUSH2 0x28D6 SWAP3 SWAP1 PUSH2 0x3986 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP8 ADD MLOAD ADD MSTORE JUMPDEST DUP5 MLOAD MLOAD PUSH1 0x20 DUP1 DUP8 ADD MLOAD ADD MLOAD PUSH2 0x28F4 SWAP2 SWAP1 PUSH2 0x2F7D JUMP JUMPDEST PUSH1 0x40 DUP7 ADD MSTORE DUP5 MLOAD MLOAD PUSH1 0x80 DUP11 ADD MLOAD PUSH1 0xC0 DUP12 ADD MLOAD PUSH2 0x2911 SWAP3 SWAP2 SWAP1 PUSH2 0x3909 JUMP JUMPDEST DUP6 MLOAD PUSH1 0x40 ADD MSTORE DUP5 MLOAD PUSH1 0x20 ADD MLOAD PUSH1 0xA0 DUP11 ADD MLOAD PUSH1 0xE0 DUP12 ADD MLOAD PUSH2 0x2932 SWAP3 SWAP2 SWAP1 PUSH2 0x3909 JUMP JUMPDEST DUP6 MLOAD PUSH1 0x60 ADD MSTORE PUSH1 0x20 DUP6 ADD MLOAD MLOAD PUSH1 0x80 DUP10 ADD MLOAD PUSH1 0xC0 DUP11 ADD MLOAD PUSH2 0x2953 SWAP3 SWAP2 SWAP1 PUSH2 0x3909 JUMP JUMPDEST DUP6 PUSH1 0x20 ADD MLOAD PUSH1 0x40 ADD DUP2 DUP2 MSTORE POP POP PUSH2 0x297B DUP6 PUSH1 0x20 ADD MLOAD PUSH1 0x20 ADD MLOAD DUP10 PUSH1 0xA0 ADD MLOAD DUP11 PUSH1 0xE0 ADD MLOAD PUSH2 0x3909 JUMP JUMPDEST PUSH1 0x20 DUP7 ADD MLOAD PUSH1 0x60 ADD MSTORE POP POP POP POP SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST DUP3 ISZERO ISZERO PUSH2 0x29C9 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x56DD JUMP JUMPDEST DUP3 DUP3 GT ISZERO PUSH2 0x2A03 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x56CD JUMP JUMPDEST DUP5 PUSH1 0xA0 ADD MLOAD PUSH2 0x2A16 DUP6 PUSH1 0x40 ADD MLOAD DUP5 PUSH2 0x3864 JUMP JUMPDEST GT ISZERO PUSH2 0x2A4E JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x55FD JUMP JUMPDEST PUSH2 0x2A5C DUP6 PUSH1 0x80 ADD MLOAD DUP4 PUSH2 0x38AE JUMP JUMPDEST PUSH2 0x2A6A DUP3 DUP8 PUSH1 0xA0 ADD MLOAD PUSH2 0x38AE JUMP JUMPDEST GT ISZERO PUSH2 0x2AA2 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x575D JUMP JUMPDEST POP POP POP POP POP JUMP JUMPDEST PUSH2 0x2AB7 DUP3 DUP3 PUSH1 0x20 ADD MLOAD PUSH2 0x3864 JUMP JUMPDEST PUSH1 0x0 DUP5 DUP2 MSTORE PUSH1 0x4 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP2 DUP3 SWAP1 KECCAK256 SWAP3 SWAP1 SWAP3 SSTORE DUP7 DUP2 ADD MLOAD DUP8 MLOAD DUP5 MLOAD SWAP4 DUP6 ADD MLOAD DUP6 DUP5 ADD MLOAD PUSH1 0x60 DUP8 ADD MLOAD PUSH2 0x140 DUP13 ADD MLOAD PUSH2 0x160 DUP14 ADD MLOAD SWAP7 MLOAD DUP12 SWAP9 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP8 DUP9 AND SWAP9 SWAP8 SWAP1 SWAP7 AND SWAP7 PUSH32 0xBCC4C97732E47D9946F229EDB95F5B6323F601300E4690DE719993F3C371129 SWAP7 PUSH2 0x2B46 SWAP7 DUP16 SWAP7 CALLER SWAP7 SWAP3 SWAP6 SWAP2 SWAP5 SWAP1 SWAP4 SWAP1 PUSH2 0x5433 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG4 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x1 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 PUSH1 0x1F PUSH1 0x2 PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH2 0x100 DUP8 DUP10 AND ISZERO MUL ADD SWAP1 SWAP6 AND SWAP5 SWAP1 SWAP5 DIV SWAP4 DUP5 ADD DUP2 SWAP1 DIV DUP2 MUL DUP3 ADD DUP2 ADD SWAP1 SWAP3 MSTORE DUP3 DUP2 MSTORE PUSH1 0x60 SWAP4 SWAP1 SWAP3 SWAP1 SWAP2 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0x2BFE JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x2BD3 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x2BFE JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x2BE1 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP1 POP PUSH2 0x2C26 DUP6 PUSH2 0x140 ADD MLOAD DUP7 PUSH1 0x0 ADD MLOAD DUP7 PUSH1 0x0 ADD MLOAD DUP6 PUSH1 0x20 ADD MLOAD PUSH1 0x20 ADD MLOAD PUSH2 0x3A23 JUMP JUMPDEST PUSH2 0x140 DUP5 ADD MLOAD DUP5 MLOAD DUP7 MLOAD DUP5 MLOAD PUSH1 0x20 ADD MLOAD PUSH2 0x2C42 SWAP4 SWAP3 SWAP2 SWAP1 PUSH2 0x3A23 JUMP JUMPDEST PUSH2 0x2C5B DUP6 PUSH2 0x140 ADD MLOAD DUP7 PUSH1 0x0 ADD MLOAD DUP6 DUP6 PUSH1 0x40 ADD MLOAD PUSH2 0x3A23 JUMP JUMPDEST PUSH2 0x2C77 DUP2 DUP7 PUSH1 0x0 ADD MLOAD DUP8 PUSH1 0x40 ADD MLOAD DUP6 PUSH1 0x0 ADD MLOAD PUSH1 0x40 ADD MLOAD PUSH2 0x3A23 JUMP JUMPDEST PUSH2 0x2C93 DUP2 DUP6 PUSH1 0x0 ADD MLOAD DUP7 PUSH1 0x40 ADD MLOAD DUP6 PUSH1 0x20 ADD MLOAD PUSH1 0x40 ADD MLOAD PUSH2 0x3A23 JUMP JUMPDEST DUP4 PUSH1 0x40 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP6 PUSH1 0x40 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0x2CFD JUMPI PUSH2 0x2CF8 DUP2 DUP5 DUP8 PUSH1 0x40 ADD MLOAD PUSH2 0x2CF3 DUP7 PUSH1 0x0 ADD MLOAD PUSH1 0x60 ADD MLOAD DUP8 PUSH1 0x20 ADD MLOAD PUSH1 0x60 ADD MLOAD PUSH2 0x3864 JUMP JUMPDEST PUSH2 0x3A23 JUMP JUMPDEST PUSH2 0x2AA2 JUMP JUMPDEST PUSH2 0x2D15 DUP2 DUP5 DUP8 PUSH1 0x40 ADD MLOAD DUP6 PUSH1 0x0 ADD MLOAD PUSH1 0x60 ADD MLOAD PUSH2 0x3A23 JUMP JUMPDEST PUSH2 0x2AA2 DUP2 DUP5 DUP7 PUSH1 0x40 ADD MLOAD DUP6 PUSH1 0x20 ADD MLOAD PUSH1 0x60 ADD MLOAD PUSH2 0x3A23 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0xB4BE83D500000000000000000000000000000000000000000000000000000000 PUSH1 0x20 DUP1 DUP4 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x60 PUSH1 0x24 DUP4 ADD DUP2 DUP2 MSTORE DUP8 MLOAD PUSH1 0x84 DUP6 ADD SWAP1 DUP2 MSTORE DUP9 DUP5 ADD MLOAD PUSH1 0xA4 DUP7 ADD MSTORE SWAP5 DUP9 ADD MLOAD PUSH1 0xC4 DUP6 ADD MSTORE SWAP1 DUP8 ADD MLOAD PUSH1 0xE4 DUP5 ADD MSTORE PUSH1 0x80 DUP8 ADD MLOAD PUSH2 0x104 DUP5 ADD MSTORE PUSH1 0xA0 DUP8 ADD MLOAD PUSH2 0x124 DUP5 ADD MSTORE PUSH1 0xC0 DUP8 ADD MLOAD PUSH2 0x144 DUP5 ADD MSTORE PUSH1 0xE0 DUP8 ADD MLOAD PUSH2 0x164 DUP5 ADD MSTORE PUSH2 0x100 DUP8 ADD MLOAD PUSH2 0x184 DUP5 ADD MSTORE PUSH2 0x120 DUP8 ADD MLOAD PUSH2 0x1A4 DUP5 ADD MSTORE PUSH2 0x140 DUP8 ADD DUP1 MLOAD PUSH2 0x1C4 DUP6 ADD SWAP1 DUP2 MSTORE PUSH2 0x160 DUP10 ADD MLOAD PUSH2 0x1E4 DUP7 ADD MSTORE PUSH2 0x180 SWAP1 MSTORE MLOAD DUP1 MLOAD PUSH2 0x204 DUP6 ADD DUP2 SWAP1 MSTORE SWAP4 SWAP5 SWAP2 SWAP4 DUP5 SWAP4 PUSH1 0x44 DUP8 ADD SWAP3 DUP5 SWAP3 PUSH2 0x224 DUP10 ADD SWAP3 SWAP2 DUP3 ADD SWAP2 PUSH1 0x1F DUP3 ADD DIV PUSH1 0x0 JUMPDEST DUP2 DUP2 LT ISZERO PUSH2 0x2E34 JUMPI DUP4 MLOAD DUP6 MSTORE PUSH1 0x20 SWAP5 DUP6 ADD SWAP5 SWAP1 SWAP4 ADD SWAP3 PUSH1 0x1 ADD PUSH2 0x2E16 JUMP JUMPDEST POP POP POP POP DUP2 DUP2 SUB PUSH2 0x160 DUP1 DUP5 ADD SWAP2 SWAP1 SWAP2 MSTORE DUP11 ADD MLOAD DUP1 MLOAD DUP1 DUP4 MSTORE PUSH1 0x20 SWAP3 DUP4 ADD SWAP3 SWAP2 DUP3 ADD SWAP2 PUSH1 0x1F DUP3 ADD DIV PUSH1 0x0 JUMPDEST DUP2 DUP2 LT ISZERO PUSH2 0x2E7D JUMPI DUP4 MLOAD DUP6 MSTORE PUSH1 0x20 SWAP5 DUP6 ADD SWAP5 SWAP1 SWAP4 ADD SWAP3 PUSH1 0x1 ADD PUSH2 0x2E5F JUMP JUMPDEST POP POP POP DUP10 DUP5 MSTORE POP DUP5 DUP2 SUB PUSH1 0x20 SWAP4 DUP5 ADD SWAP1 DUP2 MSTORE DUP9 MLOAD DUP1 DUP4 MSTORE SWAP1 SWAP4 SWAP2 DUP3 ADD SWAP2 DUP10 DUP2 ADD SWAP2 SWAP1 PUSH1 0x1F DUP3 ADD DIV PUSH1 0x0 JUMPDEST DUP2 DUP2 LT ISZERO PUSH2 0x2EC5 JUMPI DUP4 MLOAD DUP6 MSTORE PUSH1 0x20 SWAP5 DUP6 ADD SWAP5 SWAP1 SWAP4 ADD SWAP3 PUSH1 0x1 ADD PUSH2 0x2EA7 JUMP JUMPDEST POP POP POP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 DUP9 DUP4 SUB ADD DUP9 MSTORE POP PUSH1 0x40 MSTORE POP POP POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH2 0x2F07 PUSH2 0x43DE JUMP JUMPDEST PUSH2 0x2F10 DUP3 PUSH2 0x1F30 JUMP JUMPDEST SWAP1 POP PUSH2 0x2F1C DUP3 DUP3 PUSH2 0x3BED JUMP JUMPDEST PUSH2 0x2805 DUP3 DUP3 PUSH1 0x20 ADD MLOAD PUSH2 0x3D04 JUMP JUMPDEST PUSH2 0x2F32 PUSH2 0x4386 JUMP JUMPDEST PUSH2 0x2F3D DUP5 DUP5 DUP5 PUSH2 0x24DF JUMP JUMPDEST PUSH1 0x20 DUP2 ADD MLOAD SWAP1 SWAP2 POP DUP4 EQ PUSH2 0x260A JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x574D JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 GT ISZERO PUSH2 0x2FB9 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x560D JUMP JUMPDEST POP DUP1 DUP3 SUB JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP3 MLOAD GT ISZERO ISZERO PUSH2 0x3002 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x56FD JUMP JUMPDEST DUP2 MLOAD DUP3 SWAP1 PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 ADD SWAP1 DUP2 LT PUSH2 0x3032 JUMPI INVALID JUMPDEST ADD PUSH1 0x20 ADD MLOAD DUP3 MLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 SWAP3 MSTORE POP PUSH32 0x100000000000000000000000000000000000000000000000000000000000000 SWAP1 DUP2 SWAP1 DIV MUL SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x20 ADD DUP4 MLOAD LT ISZERO ISZERO ISZERO PUSH2 0x30CA JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x562D JUMP JUMPDEST POP ADD PUSH1 0x20 ADD MLOAD SWAP1 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x0 SWAP1 PUSH1 0x60 SWAP1 PUSH32 0x1626BA7E00000000000000000000000000000000000000000000000000000000 SWAP1 PUSH2 0x310E SWAP1 DUP8 SWAP1 DUP7 SWAP1 PUSH1 0x24 ADD PUSH2 0x554E JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 DUP2 DUP5 SUB ADD DUP2 MSTORE SWAP2 SWAP1 MSTORE PUSH1 0x20 DUP1 DUP3 ADD DUP1 MLOAD PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 SWAP1 SWAP5 AND SWAP4 SWAP1 SWAP4 OR DUP4 MSTORE DUP2 MLOAD SWAP2 SWAP4 POP SWAP1 DUP3 SWAP1 DUP2 DUP9 GAS STATICCALL DUP1 DUP1 ISZERO PUSH2 0x31AB JUMPI PUSH1 0x1 DUP2 EQ PUSH2 0x321C JUMPI PUSH2 0x2572 JUMP JUMPDEST PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH29 0x2000000000000000000000000000000000000000000000000000000000 PUSH1 0x20 MSTORE PUSH29 0xC57414C4C45545F4552524F5200000000000000000000000000000000 PUSH1 0x40 MSTORE PUSH1 0x0 PUSH1 0x60 MSTORE PUSH1 0x64 PUSH1 0x0 REVERT JUMPDEST POP POP MLOAD SWAP6 SWAP5 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x14 DUP3 MLOAD LT ISZERO ISZERO ISZERO PUSH2 0x3268 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x578D JUMP JUMPDEST PUSH2 0x3276 DUP3 PUSH1 0x14 DUP5 MLOAD SUB PUSH2 0x3DAB JUMP JUMPDEST DUP3 MLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEC ADD SWAP1 SWAP3 MSTORE POP SWAP1 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x0 SWAP1 PUSH1 0x60 SWAP1 PUSH32 0x9363470200000000000000000000000000000000000000000000000000000000 SWAP1 PUSH2 0x32DE SWAP1 DUP8 SWAP1 DUP8 SWAP1 DUP8 SWAP1 PUSH1 0x24 ADD PUSH2 0x5521 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 DUP2 DUP5 SUB ADD DUP2 MSTORE SWAP2 SWAP1 MSTORE PUSH1 0x20 DUP1 DUP3 ADD DUP1 MLOAD PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 SWAP1 SWAP5 AND SWAP4 SWAP1 SWAP4 OR DUP4 MSTORE DUP2 MLOAD SWAP2 SWAP4 POP SWAP1 DUP3 SWAP1 DUP2 DUP11 GAS STATICCALL DUP1 DUP1 ISZERO PUSH2 0x337B JUMPI PUSH1 0x1 DUP2 EQ PUSH2 0x33EC JUMPI PUSH2 0x33F1 JUMP JUMPDEST PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH29 0x2000000000000000000000000000000000000000000000000000000000 PUSH1 0x20 MSTORE PUSH29 0xF56414C494441544F525F4552524F5200000000000000000000000000 PUSH1 0x40 MSTORE PUSH1 0x0 PUSH1 0x60 MSTORE PUSH1 0x64 PUSH1 0x0 REVERT JUMPDEST DUP3 MLOAD SWAP5 POP JUMPDEST POP POP POP POP SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP4 GT PUSH2 0x3438 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x564D JUMP JUMPDEST PUSH2 0x344B PUSH2 0x3445 DUP6 DUP5 PUSH2 0x38AE JUMP JUMPDEST DUP5 PUSH2 0x3E0C JUMP JUMPDEST SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0x5A65726F45785472616E73616374696F6E280000000000000000000000000000 PUSH1 0x20 DUP1 DUP4 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH32 0x75696E743235362073616C742C00000000000000000000000000000000000000 PUSH1 0x32 DUP4 ADD MSTORE PUSH32 0x61646472657373207369676E6572416464726573732C00000000000000000000 PUSH1 0x3F DUP4 ADD MSTORE PUSH32 0x6279746573206461746100000000000000000000000000000000000000000000 PUSH1 0x55 DUP4 ADD MSTORE PUSH32 0x2900000000000000000000000000000000000000000000000000000000000000 PUSH1 0x5F DUP4 ADD MSTORE DUP3 MLOAD DUP1 DUP4 SUB DUP5 ADD DUP2 MSTORE PUSH1 0x60 SWAP1 SWAP3 ADD SWAP3 DUP4 SWAP1 MSTORE DUP2 MLOAD PUSH1 0x0 SWAP4 DUP5 SWAP4 DUP5 SWAP4 SWAP1 SWAP3 DUP3 SWAP2 DUP5 ADD SWAP1 DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT PUSH2 0x357C JUMPI DUP1 MLOAD DUP3 MSTORE PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 SWAP1 SWAP3 ADD SWAP2 PUSH1 0x20 SWAP2 DUP3 ADD SWAP2 ADD PUSH2 0x353F JUMP JUMPDEST MLOAD DUP2 MLOAD PUSH1 0x20 SWAP4 DUP5 SUB PUSH2 0x100 EXP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD DUP1 NOT SWAP1 SWAP3 AND SWAP2 AND OR SWAP1 MSTORE PUSH1 0x40 MLOAD SWAP2 SWAP1 SWAP4 ADD DUP2 SWAP1 SUB DUP2 KECCAK256 DUP10 MLOAD SWAP1 SWAP8 POP DUP10 SWAP6 POP SWAP1 SWAP4 POP DUP4 SWAP3 DUP6 ADD SWAP2 POP DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT PUSH2 0x3612 JUMPI DUP1 MLOAD DUP3 MSTORE PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 SWAP1 SWAP3 ADD SWAP2 PUSH1 0x20 SWAP2 DUP3 ADD SWAP2 ADD PUSH2 0x35D5 JUMP JUMPDEST MLOAD DUP2 MLOAD PUSH1 0x20 SWAP4 DUP5 SUB PUSH2 0x100 EXP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD DUP1 NOT SWAP1 SWAP3 AND SWAP2 AND OR SWAP1 MSTORE PUSH1 0x40 DUP1 MLOAD SWAP3 SWAP1 SWAP5 ADD DUP3 SWAP1 SUB DUP3 KECCAK256 SWAP8 DUP3 MSTORE DUP2 ADD SWAP11 SWAP1 SWAP11 MSTORE POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP8 SWAP1 SWAP8 AND SWAP7 DUP9 ADD SWAP7 SWAP1 SWAP7 MSTORE POP POP PUSH1 0x60 DUP6 ADD MSTORE POP POP PUSH1 0x80 SWAP1 SWAP2 KECCAK256 SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x2 DUP1 SLOAD PUSH1 0x40 MLOAD PUSH32 0x1901000000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE SWAP2 DUP3 ADD MSTORE PUSH1 0x22 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x42 SWAP1 KECCAK256 SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x2FBE PUSH2 0x1AFD DUP4 PUSH2 0x3E23 JUMP JUMPDEST PUSH1 0x0 DUP2 DUP4 LT PUSH2 0x36EE JUMPI DUP2 PUSH2 0x260A JUMP JUMPDEST POP SWAP1 SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0x36FD PUSH2 0x4386 JUMP JUMPDEST PUSH1 0x20 DUP2 ADD DUP3 SWAP1 MSTORE PUSH1 0xA0 DUP4 ADD MLOAD PUSH1 0x80 DUP5 ADD MLOAD PUSH2 0x3719 SWAP2 DUP5 SWAP2 PUSH2 0x3909 JUMP JUMPDEST DUP1 DUP3 MSTORE PUSH1 0x80 DUP5 ADD MLOAD PUSH1 0xC0 DUP6 ADD MLOAD PUSH2 0x3731 SWAP3 SWAP2 SWAP1 PUSH2 0x3909 JUMP JUMPDEST PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0xA0 DUP4 ADD MLOAD PUSH1 0xE0 DUP5 ADD MLOAD PUSH2 0x374B SWAP2 DUP5 SWAP2 PUSH2 0x3909 JUMP JUMPDEST PUSH1 0x60 DUP3 ADD MSTORE SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x1 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 PUSH1 0x1F PUSH1 0x2 PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH2 0x100 DUP8 DUP10 AND ISZERO MUL ADD SWAP1 SWAP6 AND SWAP5 SWAP1 SWAP5 DIV SWAP4 DUP5 ADD DUP2 SWAP1 DIV DUP2 MUL DUP3 ADD DUP2 ADD SWAP1 SWAP3 MSTORE DUP3 DUP2 MSTORE PUSH1 0x60 SWAP4 SWAP1 SWAP3 SWAP1 SWAP2 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0x37FF JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x37D4 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x37FF JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x37E2 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP1 POP PUSH2 0x381F DUP5 PUSH2 0x140 ADD MLOAD DUP6 PUSH1 0x0 ADD MLOAD DUP6 DUP6 PUSH1 0x0 ADD MLOAD PUSH2 0x3A23 JUMP JUMPDEST PUSH2 0x3838 DUP5 PUSH2 0x160 ADD MLOAD DUP5 DUP7 PUSH1 0x0 ADD MLOAD DUP6 PUSH1 0x20 ADD MLOAD PUSH2 0x3A23 JUMP JUMPDEST PUSH2 0x3850 DUP2 DUP6 PUSH1 0x0 ADD MLOAD DUP7 PUSH1 0x40 ADD MLOAD DUP6 PUSH1 0x40 ADD MLOAD PUSH2 0x3A23 JUMP JUMPDEST PUSH2 0x27A3 DUP2 DUP5 DUP7 PUSH1 0x40 ADD MLOAD DUP6 PUSH1 0x60 ADD MLOAD PUSH2 0x3A23 JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 ADD DUP4 DUP2 LT ISZERO PUSH2 0x38A3 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x567D JUMP JUMPDEST DUP1 SWAP2 POP JUMPDEST POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP4 ISZERO ISZERO PUSH2 0x38C1 JUMPI PUSH1 0x0 SWAP2 POP PUSH2 0x38A7 JUMP JUMPDEST POP DUP3 DUP3 MUL DUP3 DUP5 DUP3 DUP2 ISZERO ISZERO PUSH2 0x38D1 JUMPI INVALID JUMPDEST DIV EQ PUSH2 0x38A3 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x567D JUMP JUMPDEST PUSH1 0x0 DUP1 DUP4 GT PUSH2 0x3944 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x564D JUMP JUMPDEST PUSH2 0x394F DUP5 DUP5 DUP5 PUSH2 0x427C JUMP JUMPDEST ISZERO PUSH2 0x3438 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x56AD JUMP JUMPDEST PUSH1 0x0 DUP1 DUP4 GT PUSH2 0x39C1 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x564D JUMP JUMPDEST PUSH2 0x39CC DUP5 DUP5 DUP5 PUSH2 0x4301 JUMP JUMPDEST ISZERO PUSH2 0x3A03 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x56AD JUMP JUMPDEST PUSH2 0x344B PUSH2 0x3445 PUSH2 0x3A13 DUP7 DUP6 PUSH2 0x38AE JUMP JUMPDEST PUSH2 0x3A1E DUP7 PUSH1 0x1 PUSH2 0x2F7D JUMP JUMPDEST PUSH2 0x3864 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP4 GT DUP1 ISZERO PUSH2 0x3A62 JUMPI POP DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO JUMPDEST ISZERO PUSH2 0x3BE5 JUMPI DUP6 MLOAD PUSH1 0x3 LT PUSH2 0x3AA2 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x573D JUMP JUMPDEST POP POP PUSH1 0x20 DUP5 DUP2 ADD MLOAD PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0xB SWAP1 SWAP3 MSTORE PUSH1 0x40 SWAP1 SWAP2 KECCAK256 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP1 ISZERO ISZERO PUSH2 0x3B2B JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x56ED JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH7 0xFFFFFFFFFFFE0 PUSH1 0x3F DUP9 MLOAD ADD AND DUP1 PUSH1 0x84 ADD DUP3 ADD PUSH32 0xA85E59E400000000000000000000000000000000000000000000000000000000 DUP4 MSTORE PUSH1 0x80 PUSH1 0x4 DUP5 ADD MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP9 AND PUSH1 0x24 DUP5 ADD MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 AND PUSH1 0x44 DUP5 ADD MSTORE DUP6 PUSH1 0x64 DUP5 ADD MSTORE PUSH1 0x84 DUP4 ADD JUMPDEST DUP2 DUP2 LT ISZERO PUSH2 0x3BC7 JUMPI DUP10 MLOAD DUP2 MSTORE PUSH1 0x20 SWAP10 DUP11 ADD SWAP10 ADD PUSH2 0x3BAF JUMP JUMPDEST PUSH2 0x200 DUP5 DUP6 DUP5 SUB DUP7 PUSH1 0x0 DUP10 GAS CALL DUP1 ISZERO ISZERO PUSH2 0x3BDF JUMPI RETURNDATASIZE DUP6 REVERT JUMPDEST POP POP POP POP POP JUMPDEST POP POP POP POP POP POP JUMP JUMPDEST DUP1 MLOAD PUSH1 0x0 SWAP1 PUSH1 0xFF AND PUSH1 0x3 EQ PUSH2 0x3C2E JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x579D JUMP JUMPDEST PUSH1 0x60 DUP4 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND ISZERO PUSH2 0x3CA1 JUMPI PUSH1 0x60 DUP4 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0x3CA1 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x57AD JUMP JUMPDEST PUSH2 0x3CA9 PUSH2 0x25DF JUMP JUMPDEST DUP4 MLOAD SWAP1 SWAP2 POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP4 AND SWAP2 AND EQ PUSH2 0x3CFF JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x566D JUMP JUMPDEST POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x5 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 DUP2 SWAP1 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR SWAP1 SSTORE DUP3 DUP2 ADD MLOAD DUP4 MLOAD PUSH2 0x140 DUP6 ADD MLOAD PUSH2 0x160 DUP7 ADD MLOAD SWAP4 MLOAD DUP6 SWAP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP5 DUP6 AND SWAP5 SWAP4 SWAP1 SWAP4 AND SWAP3 PUSH32 0xDC47B3613D9FE400085F6DBDC99453462279057E6207385042827ED6B1A62CF7 SWAP3 PUSH2 0x3D9F SWAP3 CALLER SWAP3 SWAP1 PUSH2 0x54B7 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG4 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x14 ADD DUP4 MLOAD LT ISZERO ISZERO ISZERO PUSH2 0x3DED JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x578D JUMP JUMPDEST POP ADD PUSH1 0x14 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 DUP3 DUP5 DUP2 ISZERO ISZERO PUSH2 0x3E1A JUMPI INVALID JUMPDEST DIV SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0x4F72646572280000000000000000000000000000000000000000000000000000 PUSH1 0x20 DUP1 DUP4 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH32 0x61646472657373206D616B6572416464726573732C0000000000000000000000 PUSH1 0x26 DUP4 ADD MSTORE PUSH32 0x616464726573732074616B6572416464726573732C0000000000000000000000 PUSH1 0x3B DUP4 ADD MSTORE PUSH32 0x6164647265737320666565526563697069656E74416464726573732C00000000 PUSH1 0x50 DUP4 ADD MSTORE PUSH32 0x616464726573732073656E646572416464726573732C00000000000000000000 PUSH1 0x6C DUP4 ADD MSTORE PUSH32 0x75696E74323536206D616B65724173736574416D6F756E742C00000000000000 PUSH1 0x82 DUP4 ADD MSTORE PUSH32 0x75696E743235362074616B65724173736574416D6F756E742C00000000000000 PUSH1 0x9B DUP4 ADD MSTORE PUSH32 0x75696E74323536206D616B65724665652C000000000000000000000000000000 PUSH1 0xB4 DUP4 ADD MSTORE PUSH32 0x75696E743235362074616B65724665652C000000000000000000000000000000 PUSH1 0xC5 DUP4 ADD MSTORE PUSH32 0x75696E743235362065787069726174696F6E54696D655365636F6E64732C0000 PUSH1 0xD6 DUP4 ADD MSTORE PUSH32 0x75696E743235362073616C742C00000000000000000000000000000000000000 PUSH1 0xF4 DUP4 ADD MSTORE PUSH32 0x6279746573206D616B65724173736574446174612C0000000000000000000000 PUSH2 0x101 DUP4 ADD MSTORE PUSH32 0x62797465732074616B6572417373657444617461000000000000000000000000 PUSH2 0x116 DUP4 ADD MSTORE PUSH32 0x2900000000000000000000000000000000000000000000000000000000000000 PUSH2 0x12A DUP4 ADD MSTORE DUP3 MLOAD PUSH2 0x10B DUP2 DUP5 SUB ADD DUP2 MSTORE PUSH2 0x12B SWAP1 SWAP3 ADD SWAP3 DUP4 SWAP1 MSTORE DUP2 MLOAD PUSH1 0x0 SWAP4 DUP5 SWAP4 DUP5 SWAP4 DUP5 SWAP4 SWAP2 SWAP3 SWAP2 DUP3 SWAP2 DUP5 ADD SWAP1 DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT PUSH2 0x40AB JUMPI DUP1 MLOAD DUP3 MSTORE PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 SWAP1 SWAP3 ADD SWAP2 PUSH1 0x20 SWAP2 DUP3 ADD SWAP2 ADD PUSH2 0x406E JUMP JUMPDEST MLOAD DUP2 MLOAD PUSH1 0x20 SWAP4 DUP5 SUB PUSH2 0x100 EXP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD DUP1 NOT SWAP1 SWAP3 AND SWAP2 AND OR SWAP1 MSTORE PUSH1 0x40 MLOAD SWAP2 SWAP1 SWAP4 ADD DUP2 SWAP1 SUB DUP2 KECCAK256 PUSH2 0x140 DUP12 ADD MLOAD DUP1 MLOAD SWAP2 SWAP10 POP SWAP6 POP SWAP1 SWAP4 POP DUP4 SWAP3 DUP6 ADD SWAP2 POP DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT PUSH2 0x4146 JUMPI DUP1 MLOAD DUP3 MSTORE PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 SWAP1 SWAP3 ADD SWAP2 PUSH1 0x20 SWAP2 DUP3 ADD SWAP2 ADD PUSH2 0x4109 JUMP JUMPDEST MLOAD DUP2 MLOAD PUSH1 0x20 SWAP4 DUP5 SUB PUSH2 0x100 EXP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD DUP1 NOT SWAP1 SWAP3 AND SWAP2 AND OR SWAP1 MSTORE PUSH1 0x40 MLOAD SWAP2 SWAP1 SWAP4 ADD DUP2 SWAP1 SUB DUP2 KECCAK256 PUSH2 0x160 DUP12 ADD MLOAD DUP1 MLOAD SWAP2 SWAP9 POP SWAP6 POP SWAP1 SWAP4 POP DUP4 SWAP3 DUP6 ADD SWAP2 POP DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT PUSH2 0x41E1 JUMPI DUP1 MLOAD DUP3 MSTORE PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 SWAP1 SWAP3 ADD SWAP2 PUSH1 0x20 SWAP2 DUP3 ADD SWAP2 ADD PUSH2 0x41A4 JUMP JUMPDEST MLOAD DUP2 MLOAD PUSH1 0x20 SWAP4 SWAP1 SWAP4 SUB PUSH2 0x100 EXP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD DUP1 NOT SWAP1 SWAP2 AND SWAP3 AND SWAP2 SWAP1 SWAP2 OR SWAP1 MSTORE PUSH1 0x40 MLOAD SWAP3 ADD DUP3 SWAP1 SUB SWAP1 SWAP2 KECCAK256 PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 DUP10 ADD DUP1 MLOAD PUSH2 0x140 DUP12 ADD DUP1 MLOAD PUSH2 0x160 SWAP1 SWAP13 ADD DUP1 MLOAD SWAP11 DUP5 MSTORE SWAP9 DUP2 MSTORE SWAP3 DUP9 MSTORE PUSH2 0x1A0 DUP3 KECCAK256 SWAP2 MSTORE SWAP9 SWAP1 MSTORE POP POP POP SWAP2 SWAP1 MSTORE POP SWAP1 SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP1 DUP5 GT PUSH2 0x42B8 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x564D JUMP JUMPDEST DUP3 ISZERO DUP1 PUSH2 0x42C3 JUMPI POP DUP5 ISZERO JUMPDEST ISZERO PUSH2 0x42D1 JUMPI PUSH1 0x0 SWAP2 POP PUSH2 0xA88 JUMP JUMPDEST DUP4 DUP1 ISZERO ISZERO PUSH2 0x42DB JUMPI INVALID JUMPDEST DUP6 DUP5 MULMOD SWAP1 POP PUSH2 0x42EA DUP6 DUP5 PUSH2 0x38AE JUMP JUMPDEST PUSH2 0x42F6 PUSH2 0x3E8 DUP4 PUSH2 0x38AE JUMP JUMPDEST LT ISZERO SWAP6 SWAP5 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP1 DUP5 GT PUSH2 0x433D JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x564D JUMP JUMPDEST DUP3 ISZERO DUP1 PUSH2 0x4348 JUMPI POP DUP5 ISZERO JUMPDEST ISZERO PUSH2 0x4356 JUMPI PUSH1 0x0 SWAP2 POP PUSH2 0xA88 JUMP JUMPDEST DUP4 DUP1 ISZERO ISZERO PUSH2 0x4360 JUMPI INVALID JUMPDEST DUP6 DUP5 MULMOD SWAP1 POP DUP4 PUSH2 0x4370 DUP6 DUP4 PUSH2 0x2F7D JUMP JUMPDEST DUP2 ISZERO ISZERO PUSH2 0x4379 JUMPI INVALID JUMPDEST MOD SWAP1 POP PUSH2 0x42EA DUP6 DUP5 PUSH2 0x38AE JUMP JUMPDEST PUSH1 0x80 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE POP SWAP1 JUMP JUMPDEST PUSH2 0x120 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH2 0x43C4 PUSH2 0x4386 JUMP JUMPDEST DUP2 MSTORE PUSH1 0x20 ADD PUSH2 0x43D1 PUSH2 0x4386 JUMP JUMPDEST DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE POP SWAP1 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x60 DUP2 ADD DUP3 MSTORE PUSH1 0x0 DUP1 DUP3 MSTORE PUSH1 0x20 DUP3 ADD DUP2 SWAP1 MSTORE SWAP2 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x260A DUP3 CALLDATALOAD PUSH2 0x58B0 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH2 0x441B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0x442E PUSH2 0x4429 DUP3 PUSH2 0x583F JUMP JUMPDEST PUSH2 0x5818 JUMP JUMPDEST DUP2 DUP2 MSTORE PUSH1 0x20 SWAP4 DUP5 ADD SWAP4 SWAP1 SWAP3 POP DUP3 ADD DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x446C JUMPI DUP2 CALLDATALOAD DUP7 ADD PUSH2 0x4456 DUP9 DUP3 PUSH2 0x45BC JUMP JUMPDEST DUP5 MSTORE POP PUSH1 0x20 SWAP3 DUP4 ADD SWAP3 SWAP2 SWAP1 SWAP2 ADD SWAP1 PUSH1 0x1 ADD PUSH2 0x4440 JUMP JUMPDEST POP POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH2 0x4487 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0x4495 PUSH2 0x4429 DUP3 PUSH2 0x583F JUMP JUMPDEST DUP2 DUP2 MSTORE PUSH1 0x20 SWAP4 DUP5 ADD SWAP4 SWAP1 SWAP3 POP DUP3 ADD DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x446C JUMPI DUP2 CALLDATALOAD DUP7 ADD PUSH2 0x44BD DUP9 DUP3 PUSH2 0x460B JUMP JUMPDEST DUP5 MSTORE POP PUSH1 0x20 SWAP3 DUP4 ADD SWAP3 SWAP2 SWAP1 SWAP2 ADD SWAP1 PUSH1 0x1 ADD PUSH2 0x44A7 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH2 0x44E4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0x44F2 PUSH2 0x4429 DUP3 PUSH2 0x583F JUMP JUMPDEST SWAP2 POP DUP2 DUP2 DUP4 MSTORE PUSH1 0x20 DUP5 ADD SWAP4 POP PUSH1 0x20 DUP2 ADD SWAP1 POP DUP4 DUP6 PUSH1 0x20 DUP5 MUL DUP3 ADD GT ISZERO PUSH2 0x4517 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x446C JUMPI DUP2 PUSH2 0x452D DUP9 DUP3 PUSH2 0x454F JUMP JUMPDEST DUP5 MSTORE POP PUSH1 0x20 SWAP3 DUP4 ADD SWAP3 SWAP2 SWAP1 SWAP2 ADD SWAP1 PUSH1 0x1 ADD PUSH2 0x451A JUMP JUMPDEST PUSH1 0x0 PUSH2 0x260A DUP3 CALLDATALOAD PUSH2 0x58C9 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x260A DUP3 CALLDATALOAD PUSH2 0x58CE JUMP JUMPDEST PUSH1 0x0 PUSH2 0x260A DUP3 CALLDATALOAD PUSH2 0x58D1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x260A DUP3 MLOAD PUSH2 0x58D1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x1F DUP4 ADD DUP5 SGT PUSH2 0x4585 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP DUP2 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x459D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x20 DUP4 ADD SWAP2 POP DUP4 PUSH1 0x1 DUP3 MUL DUP4 ADD GT ISZERO PUSH2 0x45B5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH2 0x45CD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0x45DB PUSH2 0x4429 DUP3 PUSH2 0x5860 JUMP JUMPDEST SWAP2 POP DUP1 DUP3 MSTORE PUSH1 0x20 DUP4 ADD PUSH1 0x20 DUP4 ADD DUP6 DUP4 DUP4 ADD GT ISZERO PUSH2 0x45F7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4602 DUP4 DUP3 DUP5 PUSH2 0x5907 JUMP JUMPDEST POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x180 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x461E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4629 PUSH2 0x180 PUSH2 0x5818 JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0x4637 DUP5 DUP5 PUSH2 0x43FE JUMP JUMPDEST DUP3 MSTORE POP PUSH1 0x20 PUSH2 0x4648 DUP5 DUP5 DUP4 ADD PUSH2 0x43FE JUMP JUMPDEST PUSH1 0x20 DUP4 ADD MSTORE POP PUSH1 0x40 PUSH2 0x465C DUP5 DUP3 DUP6 ADD PUSH2 0x43FE JUMP JUMPDEST PUSH1 0x40 DUP4 ADD MSTORE POP PUSH1 0x60 PUSH2 0x4670 DUP5 DUP3 DUP6 ADD PUSH2 0x43FE JUMP JUMPDEST PUSH1 0x60 DUP4 ADD MSTORE POP PUSH1 0x80 PUSH2 0x4684 DUP5 DUP3 DUP6 ADD PUSH2 0x454F JUMP JUMPDEST PUSH1 0x80 DUP4 ADD MSTORE POP PUSH1 0xA0 PUSH2 0x4698 DUP5 DUP3 DUP6 ADD PUSH2 0x454F JUMP JUMPDEST PUSH1 0xA0 DUP4 ADD MSTORE POP PUSH1 0xC0 PUSH2 0x46AC DUP5 DUP3 DUP6 ADD PUSH2 0x454F JUMP JUMPDEST PUSH1 0xC0 DUP4 ADD MSTORE POP PUSH1 0xE0 PUSH2 0x46C0 DUP5 DUP3 DUP6 ADD PUSH2 0x454F JUMP JUMPDEST PUSH1 0xE0 DUP4 ADD MSTORE POP PUSH2 0x100 PUSH2 0x46D5 DUP5 DUP3 DUP6 ADD PUSH2 0x454F JUMP JUMPDEST PUSH2 0x100 DUP4 ADD MSTORE POP PUSH2 0x120 PUSH2 0x46EB DUP5 DUP3 DUP6 ADD PUSH2 0x454F JUMP JUMPDEST PUSH2 0x120 DUP4 ADD MSTORE POP PUSH2 0x140 DUP3 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x470D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4719 DUP5 DUP3 DUP6 ADD PUSH2 0x45BC JUMP JUMPDEST PUSH2 0x140 DUP4 ADD MSTORE POP PUSH2 0x160 DUP3 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x473B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4747 DUP5 DUP3 DUP6 ADD PUSH2 0x45BC JUMP JUMPDEST PUSH2 0x160 DUP4 ADD MSTORE POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x4766 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x344B DUP5 DUP5 PUSH2 0x43FE JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x4785 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x4791 DUP6 DUP6 PUSH2 0x43FE JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0x47A2 DUP6 DUP3 DUP7 ADD PUSH2 0x43FE JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x47BF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x47CB DUP6 DUP6 PUSH2 0x43FE JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0x47A2 DUP6 DUP3 DUP7 ADD PUSH2 0x4543 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x47EE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x4805 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x344B DUP5 DUP3 DUP6 ADD PUSH2 0x4476 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x60 DUP5 DUP7 SUB SLT ISZERO PUSH2 0x4826 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP4 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x483D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4849 DUP7 DUP3 DUP8 ADD PUSH2 0x4476 JUMP JUMPDEST SWAP4 POP POP PUSH1 0x20 DUP5 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x4866 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4872 DUP7 DUP3 DUP8 ADD PUSH2 0x44D3 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x40 DUP5 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x488F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x489B DUP7 DUP3 DUP8 ADD PUSH2 0x440A JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 POP SWAP3 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x60 DUP5 DUP7 SUB SLT ISZERO PUSH2 0x48BA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP4 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x48D1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x48DD DUP7 DUP3 DUP8 ADD PUSH2 0x4476 JUMP JUMPDEST SWAP4 POP POP PUSH1 0x20 PUSH2 0x4872 DUP7 DUP3 DUP8 ADD PUSH2 0x454F JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x4900 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x344B DUP5 DUP5 PUSH2 0x454F JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x491F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x4791 DUP6 DUP6 PUSH2 0x454F JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x60 DUP6 DUP8 SUB SLT ISZERO PUSH2 0x4941 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x494D DUP8 DUP8 PUSH2 0x454F JUMP JUMPDEST SWAP5 POP POP PUSH1 0x20 PUSH2 0x495E DUP8 DUP3 DUP9 ADD PUSH2 0x43FE JUMP JUMPDEST SWAP4 POP POP PUSH1 0x40 DUP6 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x497B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4987 DUP8 DUP3 DUP9 ADD PUSH2 0x4573 JUMP JUMPDEST SWAP6 SWAP9 SWAP5 SWAP8 POP SWAP6 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x60 DUP5 DUP7 SUB SLT ISZERO PUSH2 0x49A8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x49B4 DUP7 DUP7 PUSH2 0x454F JUMP JUMPDEST SWAP4 POP POP PUSH1 0x20 PUSH2 0x49C5 DUP7 DUP3 DUP8 ADD PUSH2 0x43FE JUMP JUMPDEST SWAP3 POP POP PUSH1 0x40 DUP5 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x49E2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x489B DUP7 DUP3 DUP8 ADD PUSH2 0x45BC JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x4A00 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x344B DUP5 DUP5 PUSH2 0x455B JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x4A1E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x344B DUP5 DUP5 PUSH2 0x4567 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x4A3C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x4A53 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x344B DUP5 DUP3 DUP6 ADD PUSH2 0x460B JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x80 DUP6 DUP8 SUB SLT ISZERO PUSH2 0x4A75 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP5 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x4A8C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4A98 DUP8 DUP3 DUP9 ADD PUSH2 0x460B JUMP JUMPDEST SWAP5 POP POP PUSH1 0x20 DUP6 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x4AB5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4AC1 DUP8 DUP3 DUP9 ADD PUSH2 0x460B JUMP JUMPDEST SWAP4 POP POP PUSH1 0x40 DUP6 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x4ADE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4AEA DUP8 DUP3 DUP9 ADD PUSH2 0x45BC JUMP JUMPDEST SWAP3 POP POP PUSH1 0x60 DUP6 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x4B07 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4B13 DUP8 DUP3 DUP9 ADD PUSH2 0x45BC JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP6 SWAP2 SWAP5 POP SWAP3 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x60 DUP5 DUP7 SUB SLT ISZERO PUSH2 0x4B34 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP4 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x4B4B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4B57 DUP7 DUP3 DUP8 ADD PUSH2 0x460B JUMP JUMPDEST SWAP4 POP POP PUSH1 0x20 PUSH2 0x49C5 DUP7 DUP3 DUP8 ADD PUSH2 0x454F JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x80 DUP8 DUP10 SUB SLT ISZERO PUSH2 0x4B81 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x4B8D DUP10 DUP10 PUSH2 0x454F JUMP JUMPDEST SWAP7 POP POP PUSH1 0x20 PUSH2 0x4B9E DUP10 DUP3 DUP11 ADD PUSH2 0x43FE JUMP JUMPDEST SWAP6 POP POP PUSH1 0x40 DUP8 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x4BBB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4BC7 DUP10 DUP3 DUP11 ADD PUSH2 0x4573 JUMP JUMPDEST SWAP5 POP SWAP5 POP POP PUSH1 0x60 DUP8 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x4BE6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4BF2 DUP10 DUP3 DUP11 ADD PUSH2 0x4573 JUMP JUMPDEST SWAP3 POP SWAP3 POP POP SWAP3 SWAP6 POP SWAP3 SWAP6 POP SWAP3 SWAP6 JUMP JUMPDEST PUSH2 0x4C0A DUP2 PUSH2 0x58B0 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x4C1B DUP3 PUSH2 0x58AC JUMP JUMPDEST DUP1 DUP5 MSTORE PUSH1 0x20 DUP5 ADD SWAP4 POP PUSH2 0x4C2D DUP4 PUSH2 0x58A6 JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP3 DUP2 LT ISZERO PUSH2 0x4C5D JUMPI PUSH2 0x4C43 DUP7 DUP4 MLOAD PUSH2 0x53E5 JUMP JUMPDEST PUSH2 0x4C4C DUP3 PUSH2 0x58A6 JUMP JUMPDEST PUSH1 0x60 SWAP7 SWAP1 SWAP7 ADD SWAP6 SWAP2 POP PUSH1 0x1 ADD PUSH2 0x4C30 JUMP JUMPDEST POP SWAP4 SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH2 0x4C0A DUP2 PUSH2 0x58C9 JUMP JUMPDEST PUSH2 0x4C0A DUP2 PUSH2 0x58CE JUMP JUMPDEST PUSH2 0x4C0A DUP2 PUSH2 0x58D1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x4C8D DUP3 PUSH2 0x58AC JUMP JUMPDEST DUP1 DUP5 MSTORE PUSH2 0x4CA1 DUP2 PUSH1 0x20 DUP7 ADD PUSH1 0x20 DUP7 ADD PUSH2 0x5913 JUMP JUMPDEST PUSH2 0x4CAA DUP2 PUSH2 0x593F JUMP JUMPDEST SWAP1 SWAP4 ADD PUSH1 0x20 ADD SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH2 0x4C0A DUP2 PUSH2 0x58FC JUMP JUMPDEST PUSH1 0x12 DUP2 MSTORE PUSH32 0x4C454E4754485F36355F52455155495245440000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0xD DUP2 MSTORE PUSH32 0x494E56414C49445F54414B455200000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0xE DUP2 MSTORE PUSH32 0x4F524445525F4F56455246494C4C000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x11 DUP2 MSTORE PUSH32 0x55494E543235365F554E444552464C4F57000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x1A DUP2 MSTORE PUSH32 0x41535345545F50524F58595F414C52454144595F455849535453000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x26 DUP2 MSTORE PUSH32 0x475245415445525F4F525F455155414C5F544F5F33325F4C454E4754485F5245 PUSH1 0x20 DUP3 ADD MSTORE PUSH32 0x5155495245440000000000000000000000000000000000000000000000000000 PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x60 ADD SWAP1 JUMP JUMPDEST PUSH1 0x15 DUP2 MSTORE PUSH32 0x5349474E41545552455F554E535550504F525445440000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x10 DUP2 MSTORE PUSH32 0x4449564953494F4E5F42595F5A45524F00000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x17 DUP2 MSTORE PUSH32 0x494E56414C49445F4F524445525F5349474E4154555245000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0xD DUP2 MSTORE PUSH32 0x494E56414C49445F4D414B455200000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x10 DUP2 MSTORE PUSH32 0x55494E543235365F4F564552464C4F5700000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0xF DUP2 MSTORE PUSH32 0x494E56414C49445F54585F484153480000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x11 DUP2 MSTORE PUSH32 0x494E56414C49445F5349474E4154555245000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0xE DUP2 MSTORE PUSH32 0x524F554E44494E475F4552524F52000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x10 DUP2 MSTORE PUSH32 0x4641494C45445F455845435554494F4E00000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0xD DUP2 MSTORE PUSH32 0x54414B45525F4F56455250415900000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x14 DUP2 MSTORE PUSH32 0x494E56414C49445F54414B45525F414D4F554E54000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x1A DUP2 MSTORE PUSH32 0x41535345545F50524F58595F444F45535F4E4F545F4558495354000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x21 DUP2 MSTORE PUSH32 0x475245415445525F5448414E5F5A45524F5F4C454E4754485F52455155495245 PUSH1 0x20 DUP3 ADD MSTORE PUSH32 0x4400000000000000000000000000000000000000000000000000000000000000 PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x60 ADD SWAP1 JUMP JUMPDEST PUSH1 0x11 DUP2 MSTORE PUSH32 0x5349474E41545552455F494C4C4547414C000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x1E DUP2 MSTORE PUSH32 0x4C454E4754485F475245415445525F5448414E5F305F52455155495245440000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x17 DUP2 MSTORE PUSH32 0x494E56414C49445F4E45575F4F524445525F45504F4348000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x1E DUP2 MSTORE PUSH32 0x4C454E4754485F475245415445525F5448414E5F335F52455155495245440000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x14 DUP2 MSTORE PUSH32 0x434F4D504C4554455F46494C4C5F4641494C4544000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x12 DUP2 MSTORE PUSH32 0x494E56414C49445F46494C4C5F50524943450000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x12 DUP2 MSTORE PUSH32 0x5245454E5452414E43595F494C4C4547414C0000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x13 DUP2 MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x26 DUP2 MSTORE PUSH32 0x475245415445525F4F525F455155414C5F544F5F32305F4C454E4754485F5245 PUSH1 0x20 DUP3 ADD MSTORE PUSH32 0x5155495245440000000000000000000000000000000000000000000000000000 PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x60 ADD SWAP1 JUMP JUMPDEST PUSH1 0x10 DUP2 MSTORE PUSH32 0x4F524445525F554E46494C4C41424C4500000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0xE DUP2 MSTORE PUSH32 0x494E56414C49445F53454E444552000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x18 DUP2 MSTORE PUSH32 0x4E454741544956455F5350524541445F52455155495245440000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x14 DUP2 MSTORE PUSH32 0x494E56414C49445F54585F5349474E4154555245000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x11 DUP2 MSTORE PUSH32 0x4C454E4754485F305F5245515549524544000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST DUP1 MLOAD PUSH1 0x80 DUP4 ADD SWAP1 PUSH2 0x5373 DUP5 DUP3 PUSH2 0x4C70 JUMP JUMPDEST POP PUSH1 0x20 DUP3 ADD MLOAD PUSH2 0x5386 PUSH1 0x20 DUP6 ADD DUP3 PUSH2 0x4C70 JUMP JUMPDEST POP PUSH1 0x40 DUP3 ADD MLOAD PUSH2 0x5399 PUSH1 0x40 DUP6 ADD DUP3 PUSH2 0x4C70 JUMP JUMPDEST POP PUSH1 0x60 DUP3 ADD MLOAD PUSH2 0x27A3 PUSH1 0x60 DUP6 ADD DUP3 PUSH2 0x4C70 JUMP JUMPDEST DUP1 MLOAD PUSH2 0x120 DUP4 ADD SWAP1 PUSH2 0x53BE DUP5 DUP3 PUSH2 0x5362 JUMP JUMPDEST POP PUSH1 0x20 DUP3 ADD MLOAD PUSH2 0x53D1 PUSH1 0x80 DUP6 ADD DUP3 PUSH2 0x5362 JUMP JUMPDEST POP PUSH1 0x40 DUP3 ADD MLOAD PUSH2 0x27A3 PUSH2 0x100 DUP6 ADD DUP3 PUSH2 0x4C70 JUMP JUMPDEST DUP1 MLOAD PUSH1 0x60 DUP4 ADD SWAP1 PUSH2 0x53F6 DUP5 DUP3 PUSH2 0x541C JUMP JUMPDEST POP PUSH1 0x20 DUP3 ADD MLOAD PUSH2 0x5409 PUSH1 0x20 DUP6 ADD DUP3 PUSH2 0x4C70 JUMP JUMPDEST POP PUSH1 0x40 DUP3 ADD MLOAD PUSH2 0x27A3 PUSH1 0x40 DUP6 ADD DUP3 PUSH2 0x4C70 JUMP JUMPDEST PUSH2 0x4C0A DUP2 PUSH2 0x58F6 JUMP JUMPDEST PUSH1 0x20 DUP2 ADD PUSH2 0x2FBE DUP3 DUP5 PUSH2 0x4C01 JUMP JUMPDEST PUSH2 0x100 DUP2 ADD PUSH2 0x5442 DUP3 DUP12 PUSH2 0x4C01 JUMP JUMPDEST PUSH2 0x544F PUSH1 0x20 DUP4 ADD DUP11 PUSH2 0x4C01 JUMP JUMPDEST PUSH2 0x545C PUSH1 0x40 DUP4 ADD DUP10 PUSH2 0x4C70 JUMP JUMPDEST PUSH2 0x5469 PUSH1 0x60 DUP4 ADD DUP9 PUSH2 0x4C70 JUMP JUMPDEST PUSH2 0x5476 PUSH1 0x80 DUP4 ADD DUP8 PUSH2 0x4C70 JUMP JUMPDEST PUSH2 0x5483 PUSH1 0xA0 DUP4 ADD DUP7 PUSH2 0x4C70 JUMP JUMPDEST DUP2 DUP2 SUB PUSH1 0xC0 DUP4 ADD MSTORE PUSH2 0x5495 DUP2 DUP6 PUSH2 0x4C82 JUMP JUMPDEST SWAP1 POP DUP2 DUP2 SUB PUSH1 0xE0 DUP4 ADD MSTORE PUSH2 0x54A9 DUP2 DUP5 PUSH2 0x4C82 JUMP JUMPDEST SWAP11 SWAP10 POP POP POP POP POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x60 DUP2 ADD PUSH2 0x54C5 DUP3 DUP7 PUSH2 0x4C01 JUMP JUMPDEST DUP2 DUP2 SUB PUSH1 0x20 DUP4 ADD MSTORE PUSH2 0x54D7 DUP2 DUP6 PUSH2 0x4C82 JUMP JUMPDEST SWAP1 POP DUP2 DUP2 SUB PUSH1 0x40 DUP4 ADD MSTORE PUSH2 0x54EB DUP2 DUP5 PUSH2 0x4C82 JUMP JUMPDEST SWAP6 SWAP5 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x260A DUP2 DUP5 PUSH2 0x4C10 JUMP JUMPDEST PUSH1 0x20 DUP2 ADD PUSH2 0x2FBE DUP3 DUP5 PUSH2 0x4C67 JUMP JUMPDEST PUSH1 0x20 DUP2 ADD PUSH2 0x2FBE DUP3 DUP5 PUSH2 0x4C70 JUMP JUMPDEST PUSH1 0x60 DUP2 ADD PUSH2 0x552F DUP3 DUP7 PUSH2 0x4C70 JUMP JUMPDEST PUSH2 0x553C PUSH1 0x20 DUP4 ADD DUP6 PUSH2 0x4C01 JUMP JUMPDEST DUP2 DUP2 SUB PUSH1 0x40 DUP4 ADD MSTORE PUSH2 0x54EB DUP2 DUP5 PUSH2 0x4C82 JUMP JUMPDEST PUSH1 0x40 DUP2 ADD PUSH2 0x555C DUP3 DUP6 PUSH2 0x4C70 JUMP JUMPDEST DUP2 DUP2 SUB PUSH1 0x20 DUP4 ADD MSTORE PUSH2 0x344B DUP2 DUP5 PUSH2 0x4C82 JUMP JUMPDEST PUSH1 0x80 DUP2 ADD PUSH2 0x557C DUP3 DUP8 PUSH2 0x4C70 JUMP JUMPDEST PUSH2 0x5589 PUSH1 0x20 DUP4 ADD DUP7 PUSH2 0x541C JUMP JUMPDEST PUSH2 0x5596 PUSH1 0x40 DUP4 ADD DUP6 PUSH2 0x4C70 JUMP JUMPDEST PUSH2 0x54EB PUSH1 0x60 DUP4 ADD DUP5 PUSH2 0x4C70 JUMP JUMPDEST PUSH1 0x40 DUP2 ADD PUSH2 0x55B1 DUP3 DUP6 PUSH2 0x4C79 JUMP JUMPDEST PUSH2 0x260A PUSH1 0x20 DUP4 ADD DUP5 PUSH2 0x4C01 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x260A DUP2 DUP5 PUSH2 0x4C82 JUMP JUMPDEST PUSH1 0x20 DUP2 ADD PUSH2 0x2FBE DUP3 DUP5 PUSH2 0x4CB7 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x4CC0 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x4CF0 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x4D20 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x4D50 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x4D80 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x4DB0 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x4E06 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x4E36 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x4E66 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x4E96 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x4EC6 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x4EF6 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x4F26 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x4F56 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x4F86 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x4FB6 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x4FE6 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x5016 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x5046 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x509C JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x50CC JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x50FC JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x512C JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x515C JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x518C JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x51BC JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x51EC JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x521C JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x5272 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x52A2 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x52D2 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x5302 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x5332 JUMP JUMPDEST PUSH1 0x80 DUP2 ADD PUSH2 0x2FBE DUP3 DUP5 PUSH2 0x5362 JUMP JUMPDEST PUSH2 0x120 DUP2 ADD PUSH2 0x2FBE DUP3 DUP5 PUSH2 0x53AC JUMP JUMPDEST PUSH1 0x60 DUP2 ADD PUSH2 0x2FBE DUP3 DUP5 PUSH2 0x53E5 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP2 DUP2 ADD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT DUP3 DUP3 LT OR ISZERO PUSH2 0x5837 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x40 MSTORE SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH8 0xFFFFFFFFFFFFFFFF DUP3 GT ISZERO PUSH2 0x5856 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x20 SWAP1 DUP2 MUL ADD SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH8 0xFFFFFFFFFFFFFFFF DUP3 GT ISZERO PUSH2 0x5877 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x20 PUSH1 0x1F SWAP2 SWAP1 SWAP2 ADD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 AND ADD SWAP1 JUMP JUMPDEST PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST MLOAD SWAP1 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 JUMP JUMPDEST ISZERO ISZERO SWAP1 JUMP JUMPDEST SWAP1 JUMP JUMPDEST PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 AND SWAP1 JUMP JUMPDEST PUSH1 0xFF AND SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x2FBE DUP3 PUSH2 0x58B0 JUMP JUMPDEST DUP3 DUP2 DUP4 CALLDATACOPY POP PUSH1 0x0 SWAP2 ADD MSTORE JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x592E JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH2 0x5916 JUMP JUMPDEST DUP4 DUP2 GT ISZERO PUSH2 0x27A3 JUMPI POP POP PUSH1 0x0 SWAP2 ADD MSTORE JUMP JUMPDEST PUSH1 0x1F ADD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 AND SWAP1 JUMP STOP LOG2 PUSH6 0x627A7A723058 KECCAK256 PUSH22 0xFCAE05644C6AFA57DA58B9541210644237FC1EC14ADF MSIZE 0xf 0xb4 0xa6 EXTCODESIZE 0xa9 0xae 0xc8 DUP8 PUSH13 0x6578706572696D656E74616CF5 STOP CALLDATACOPY ",
- "sourceMap": "931:615:21:-;;;689:5:64;667:27;;-1:-1:-1;;667:27:64;;;1228:316:21;5:2:-1;;;;30:1;27;20:12;5:2;1228:316:21;;;;;;;;;;;;;;;;;;;;;;;;1919:29:38;;1305:13:21;;1919:29:38;;:14;;:29;;;;;:::i;:::-;-1:-1:-1;;1045:148:39;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;22:32:-1;26:21;;;22:32;6:49;;1045:148:39;;;;;;;;1035:159;;1045:148;;;;;1035:159;;;;1045:148;1035:159;36:153:-1;66:2;58:11;;36:153;;176:10;;164:23;;-1:-1;;139:12;;;;98:2;89:12;;;;114;36:153;;;299:10;344;;263:2;259:12;;;254:3;250:22;-1:-1;;246:30;311:9;;295:26;;;340:21;;377:20;365:33;;1035:159:39;;;;;;;;;;;;1511:18;;;;;;;;;;;;;;;;1495:36;;1035:159;;-1:-1:-1;1035:159:39;;-1:-1:-1;1495:36:39;;;;-1:-1:-1;1511:18:39;1495:36;1511:18;36:153:-1;66:2;58:11;;36:153;;176:10;;164:23;;-1:-1;;139:12;;;;98:2;89:12;;;;114;36:153;;;299:10;344;;263:2;259:12;;;254:3;250:22;-1:-1;;246:30;311:9;;295:26;;;340:21;;377:20;365:33;;1495:36:39;;;;;;;;;;;;1561:21;;;;;274:1:-1;1561:21:39;;;;;;;;;;1545:39;;1495:36;;-1:-1:-1;1495:36:39;;-1:-1:-1;1545:39:39;;;;-1:-1:-1;274:1;1545:39:39;1561:21;36:153:-1;66:2;58:11;;36:153;;176:10;;164:23;;-1:-1;;139:12;;;;98:2;89:12;;;;114;36:153;;;299:10;344;;263:2;259:12;;;254:3;250:22;-1:-1;;246:30;311:9;;295:26;;;340:21;;377:20;365:33;;1545:39:39;;;;;;;;;;;;1416:214;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1614:4:39;1416:214;;;;;;;;;;26:21:-1;;;22:32;;;6:49;;1416:214:39;;;;;;;;1406:225;;1416:214;;;;-1:-1:-1;1406:225:39;;;-1:-1:-1;1406:225:39;1416:214;1406:225;36:153:-1;66:2;58:11;;36:153;;176:10;;164:23;;-1:-1;;139:12;;;;98:2;89:12;;;;114;36:153;;;299:10;344;;-1:-1;;263:2;259:12;;;;254:3;250:22;246:30;;;;340:21;;;311:9;;295:26;377:20;;;;365:33;;1406:225:39;;;;;;;;;;1385:18;:246;-1:-1:-1;;162:5:63;:18;;-1:-1:-1;;;;;;162:18:63;170:10;162:18;;;-1:-1:-1;931:615:21;;-1:-1:-1;931:615:21;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;931:615:21;;;-1:-1:-1;931:615:21;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;:::o;6:442:-1:-;;111:4;99:17;;95:27;-1:-1;85:2;;136:1;133;126:12;85:2;166:6;160:13;188:64;203:48;244:6;203:48;;;188:64;;;179:73;;272:6;265:5;258:21;308:4;300:6;296:17;341:4;334:5;330:16;376:3;367:6;362:3;358:16;355:25;352:2;;;393:1;390;383:12;352:2;403:39;435:6;430:3;425;403:39;;;78:370;;;;;;;;456:360;;580:2;568:9;559:7;555:23;551:32;548:2;;;596:1;593;586:12;548:2;631:24;;-1:-1;;;;;664:30;;661:2;;;707:1;704;697:12;661:2;727:73;792:7;783:6;772:9;768:22;727:73;;;717:83;542:274;-1:-1;;;;542:274;823:256;885:2;879:9;911:17;;;-1:-1;;;;;971:34;;1007:22;;;968:62;965:2;;;1043:1;1040;1033:12;965:2;1059;1052:22;863:216;;-1:-1;863:216;1086:258;;-1:-1;;;;;1221:6;1218:30;1215:2;;;1261:1;1258;1251:12;1215:2;-1:-1;1334:4;1305;1282:17;;;;-1:-1;;1278:33;1324:15;;1152:192;1352:268;1417:1;1424:101;1438:6;1435:1;1432:13;1424:101;;;1505:11;;;1499:18;1486:11;;;1479:39;1460:2;1453:10;1424:101;;;1540:6;1537:1;1534:13;1531:2;;;1605:1;1596:6;1591:3;1587:16;1580:27;1531:2;1401:219;;;;;;931:615:21;;;;;;"
- },
- "deployedBytecode": {
- "linkReferences": {},
- "object": "0x6080604052600436106101b65763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663288cdc9181146101bb578063297bb70b146101f15780632ac126221461021e5780633683ef8e1461024b5780633c28d8611461026d5780633e228bae1461029a5780633fd3c997146102ba5780634ac14782146102e75780634d0ae546146103075780634f9559b11461032757806350dde190146103475780636070410814610367578063642f2eaf1461039457806364a3bc15146103b457806377fcce68146103d45780637b8e3514146103f45780637e1d9808146104145780637e9d74dc1461043457806382c174d0146104615780638da5cb5b146104815780639363470214610496578063a3e20380146104b6578063b4be83d5146104d6578063bfc8bfce146104f6578063c585bb9314610516578063c75e0a8114610536578063d46b02c314610563578063d9bfa73e14610583578063db123b1a146105a3578063dd1c7d18146105c5578063e306f779146105e5578063e5fa431b146105fa578063eea086ba1461061a578063f2fde38b1461062f578063ffa1ad741461064f575b600080fd5b3480156101c757600080fd5b506101db6101d63660046148ee565b610664565b6040516101e89190615513565b60405180910390f35b3480156101fd57600080fd5b5061021161020c366004614811565b610676565b6040516101e891906157ed565b34801561022a57600080fd5b5061023e6102393660046148ee565b6107a1565b6040516101e89190615505565b34801561025757600080fd5b5061026b61026636600461492b565b6107b6565b005b34801561027957600080fd5b5061028d610288366004614a5f565b6108a3565b6040516101e891906157fb565b3480156102a657600080fd5b506102116102b5366004614b1f565b610a3a565b3480156102c657600080fd5b506102da6102d53660046149ee565b610a90565b6040516101e891906155cf565b3480156102f357600080fd5b5061026b6103023660046147dc565b610ab8565b34801561031357600080fd5b50610211610322366004614811565b610b85565b34801561033357600080fd5b5061026b6103423660046148ee565b610c75565b34801561035357600080fd5b50610211610362366004614811565b610e2a565b34801561037357600080fd5b506103876103823660046149ee565b610ebe565b6040516101e89190615425565b3480156103a057600080fd5b5061023e6103af3660046148ee565b610f0c565b3480156103c057600080fd5b506102116103cf366004614b1f565b610f21565b3480156103e057600080fd5b5061026b6103ef3660046147ac565b610fcc565b34801561040057600080fd5b5061023e61040f366004614772565b611106565b34801561042057600080fd5b5061021161042f3660046148a5565b611126565b34801561044057600080fd5b5061045461044f3660046147dc565b61128a565b6040516101e891906154f4565b34801561046d57600080fd5b5061023e61047c36600461490c565b61131f565b34801561048d57600080fd5b5061038761133f565b3480156104a257600080fd5b5061023e6104b1366004614993565b61135b565b3480156104c257600080fd5b506102116104d13660046148a5565b6118de565b3480156104e257600080fd5b506102116104f1366004614b1f565b6119f1565b34801561050257600080fd5b5061026b610511366004614b68565b611a6c565b34801561052257600080fd5b5061026b610531366004614754565b611d05565b34801561054257600080fd5b50610556610551366004614a2a565b611f30565b6040516101e8919061580a565b34801561056f57600080fd5b5061026b61057e366004614a2a565b61202a565b34801561058f57600080fd5b506101db61059e366004614772565b6120c6565b3480156105af57600080fd5b506105b86120e3565b6040516101e891906155be565b3480156105d157600080fd5b506102116105e03660046148a5565b61218e565b3480156105f157600080fd5b506101db612263565b34801561060657600080fd5b506102116106153660046148a5565b612269565b34801561062657600080fd5b506103876123db565b34801561063b57600080fd5b5061026b61064a366004614754565b6123f7565b34801561065b57600080fd5b506105b86124a8565b60046020526000908152604090205481565b61067e614386565b600080610689614386565b60005460ff16156106cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061576d565b60405180910390fd5b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011781558751935091505b81831461076f57610758878381518110151561071957fe5b90602001906020020151878481518110151561073157fe5b90602001906020020151878581518110151561074957fe5b906020019060200201516124df565b9050610764848261257d565b600190910190610701565b5050600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055509392505050565b60056020526000908152604090205460ff1681565b73ffffffffffffffffffffffffffffffffffffffff831633146108465761080e848484848080601f0160208091040260200160405190810160405280939291908181526020018383808284375061135b945050505050565b1515610846576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061569d565b5050600091825260076020908152604080842073ffffffffffffffffffffffffffffffffffffffff9093168452919052902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b6108ab6143af565b6108b36143de565b6108bb6143de565b6000805460ff16156108f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061576d565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905561016080890151610140808a01919091528901519088015261094588611f30565b925061095087611f30565b915061095a6125df565b905061096888848389612611565b61097487838388612611565b61097e88886127a9565b610992888885604001518560400151612809565b8051602081015190519195506109ad918a9186918190612990565b6020808501519081015190516109c99189918591908190612990565b6109e28882856020015186604001518860000151612aa9565b6109fb8782846020015185604001518860200151612aa9565b610a0788888387612b55565b5050600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905550949350505050565b610a42614386565b6060610a4f858585612d2d565b9050608081825160208401305af48015610a8657815183526020820151602084015260408201516040840152606082015160608401525b505b509392505050565b600b6020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b60008054819060ff1615610af8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061576d565b5050600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011781558151905b808214610b5857610b508382815181101515610b4157fe5b90602001906020020151612eff565b600101610b29565b5050600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905550565b610b8d614386565b600080610b98614386565b60005460ff1615610bd5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061576d565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011781558751935091505b81831461076f57610c5e8783815181101515610c1f57fe5b906020019060200201518784815181101515610c3757fe5b906020019060200201518785815181101515610c4f57fe5b90602001906020020151612f2a565b9050610c6a848261257d565b600190910190610c07565b6000805481908190819060ff1615610cb9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061576d565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055610cec6125df565b935073ffffffffffffffffffffffffffffffffffffffff84163314610d115733610d14565b60005b73ffffffffffffffffffffffffffffffffffffffff8086166000908152600660209081526040808320938516835292905220549093506001860192509050808211610d8b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061572d565b73ffffffffffffffffffffffffffffffffffffffff80851660008181526006602090815260408083209488168084529490915290819020859055517f82af639571738f4ebd4268fb0363d8957ebe1bbb9e78dba5ebd69eed39b154f090610df3908690615513565b60405180910390a35050600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055505050565b610e32614386565b600080610e3d614386565b86519250600091505b818314610eb457610e9d8783815181101515610e5e57fe5b906020019060200201518784815181101515610e7657fe5b906020019060200201518785815181101515610e8e57fe5b90602001906020020151610a3a565b9050610ea9848261257d565b600190910190610e46565b5050509392505050565b7fffffffff0000000000000000000000000000000000000000000000000000000081166000908152600b602052604090205473ffffffffffffffffffffffffffffffffffffffff165b919050565b60096020526000908152604090205460ff1681565b610f29614386565b60005460ff1615610f66576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061576d565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055610f9c848484612f2a565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055949350505050565b6000805460ff161561100a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061576d565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905561103d6125df565b73ffffffffffffffffffffffffffffffffffffffff8181166000818152600860209081526040808320948916808452949091529081902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168715151790555192935090917fa8656e308026eeabce8f0bc18048433252318ab80ac79da0b3d3d8697dfba891906110d1908690615505565b60405180910390a35050600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905550565b600860209081526000928352604080842090915290825290205460ff1681565b61112e614386565b6060600080600061113d614386565b60005460ff161561117a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061576d565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117815589518a919081106111b257fe5b906020019060200201516101600151945088519350600092505b828414611255578489848151811015156111e257fe5b906020019060200201516101600181905250611202888760200151612f7d565b915061122e898481518110151561121557fe5b9060200190602002015183898681518110151561074957fe5b905061123a868261257d565b6020860151881161124a57611255565b6001909201916111cc565b5050600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055509195945050505050565b606060006060600084519250826040519080825280602002602001820160405280156112d057816020015b6112bd6143de565b8152602001906001900390816112b55790505b509150600090505b808314610a88576112ff85828151811015156112f057fe5b90602001906020020151611f30565b828281518110151561130d57fe5b602090810290910101526001016112d8565b600760209081526000928352604080842090915290825290205460ff1681565b60035473ffffffffffffffffffffffffffffffffffffffff1681565b600080600080600080600080600089511115156113a4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061571d565b6113ad89612fc4565b7f010000000000000000000000000000000000000000000000000000000000000090049650600760ff88161061140f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061563d565b8660ff16600781111561141e57fe5b9550600086600781111561142e57fe5b1415611466576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061570d565b600186600781111561147457fe5b14156114bc578851156114b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906157dd565b600097506118d0565b60028660078111156114ca57fe5b141561160557885160411461150b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906155dd565b88600081518110151561151a57fe5b01602001517f010000000000000000000000000000000000000000000000000000000000000090819004810204945061155a89600163ffffffff61308816565b935061156d89602163ffffffff61308816565b925060018b86868660405160008152602001604052604051611592949392919061556e565b60206040516020810390808403906000865af11580156115b6573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015173ffffffffffffffffffffffffffffffffffffffff8c811690821614995092506118d09050565b600386600781111561161357fe5b14156117b9578851604114611654576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906155dd565b88600081518110151561166357fe5b01602001517f01000000000000000000000000000000000000000000000000000000000000009081900481020494506116a389600163ffffffff61308816565b93506116b689602163ffffffff61308816565b925060018b60405160200180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c0182600019166000191681526020019150506040516020818303038152906040526040518082805190602001908083835b6020831061175757805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161171a565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040805192909401829003822060008352910192839052611592945092508991899150889061556e565b60048660078111156117c757fe5b14156117df576117d88b8b8b6130d3565b97506118d0565b60058660078111156117ed57fe5b1415611850576117fc89613228565b73ffffffffffffffffffffffffffffffffffffffff808c1660009081526008602090815260408083209385168352929052205490915060ff16151561184457600097506118d0565b6117d8818c8c8c6132a1565b600686600781111561185e57fe5b141561189e5760008b815260076020908152604080832073ffffffffffffffffffffffffffffffffffffffff8e16845290915290205460ff1697506118d0565b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061563d565b505050505050509392505050565b6118e6614386565b60606000806000806118f6614386565b89600081518110151561190557fe5b906020019060200201516101400151955089519450600093505b8385146119e457858a8581518110151561193557fe5b6020908102909101015161014001528651611951908a90612f7d565b92506119948a8581518110151561196457fe5b9060200190602002015160a001518b8681518110151561198057fe5b9060200190602002015160800151856133fd565b91506119c08a858151811015156119a757fe5b90602001906020020151838a87815181101515610e8e57fe5b90506119cc878261257d565b865189116119d9576119e4565b60019093019261191f565b5050505050509392505050565b6119f9614386565b60005460ff1615611a36576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061576d565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055610f9c8484846124df565b600a5460009073ffffffffffffffffffffffffffffffffffffffff1615611abf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061576d565b611b02611afd888888888080601f01602080910402602001604051908101604052809392919081815260200183838082843750613453945050505050565b613694565b60008181526009602052604090205490915060ff1615611b4e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061568d565b73ffffffffffffffffffffffffffffffffffffffff86163314611c1f57611ba6818785858080601f0160208091040260200160405190810160405280939291908181526020018383808284375061135b945050505050565b1515611bde576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906157cd565b600a80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff88161790555b6000818152600960205260409081902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555130908690869080838380828437820191505092505050600060405180830381855af49150501515611cb6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906156bd565b73ffffffffffffffffffffffffffffffffffffffff86163314611cfc57600a80547fffffffffffffffffffffffff00000000000000000000000000000000000000001690555b50505050505050565b6003546000908190819073ffffffffffffffffffffffffffffffffffffffff163314611d5d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061577d565b8392508273ffffffffffffffffffffffffffffffffffffffff1663ae25532e6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b158015611dc457600080fd5b505af1158015611dd8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611dfc9190810190614a0c565b7fffffffff0000000000000000000000000000000000000000000000000000000081166000908152600b602052604090205490925073ffffffffffffffffffffffffffffffffffffffff1690508015611e81576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061561d565b7fffffffff0000000000000000000000000000000000000000000000000000000082166000908152600b60205260409081902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8616179055517fd2c6b762299c609bdb96520b58a49bfb80186934d4f71a86a367571a15c0319490611f2290849087906155a3565b60405180910390a150505050565b611f386143de565b611f41826136d1565b6020808301829052600091825260049052604090819020549082015260808201511515611f755760015b60ff168152610f07565b60a08201511515611f87576002611f6b565b60a0820151604082015110611f9d576005611f6b565b6101008201514210611fb0576004611f6b565b60208082015160009081526005909152604090205460ff1615611fd4576006611f6b565b610120820151825173ffffffffffffffffffffffffffffffffffffffff90811660009081526006602090815260408083206060880151909416835292905220541115612021576006611f6b565b60038152919050565b60005460ff1615612067576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061576d565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905561209b81612eff565b50600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055565b600660209081526000928352604080842090915290825290205481565b60018054604080516020600284861615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f810184900484028201840190925281815292918301828280156121865780601f1061215b57610100808354040283529160200191612186565b820191906000526020600020905b81548152906001019060200180831161216957829003601f168201915b505050505081565b612196614386565b606060008060006121a5614386565b8860008151811015156121b457fe5b906020019060200201516101600151945088519350600092505b828414612257578489848151811015156121e457fe5b906020019060200201516101600181905250612204888760200151612f7d565b9150612230898481518110151561221757fe5b90602001906020020151838986815181101515610e8e57fe5b905061223c868261257d565b6020860151881161224c57612257565b6001909201916121ce565b50505050509392505050565b60025481565b612271614386565b6060600080600080612281614386565b60005460ff16156122be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061576d565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011781558a518b919081106122f657fe5b906020019060200201516101400151955089519450600093505b8385146123a557858a8581518110151561232657fe5b6020908102909101015161014001528651612342908a90612f7d565b92506123558a8581518110151561196457fe5b91506123818a8581518110151561236857fe5b90602001906020020151838a8781518110151561074957fe5b905061238d878261257d565b8651891161239a576123a5565b600190930192612310565b5050600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905550929695505050505050565b600a5473ffffffffffffffffffffffffffffffffffffffff1681565b60035473ffffffffffffffffffffffffffffffffffffffff163314612448576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061577d565b73ffffffffffffffffffffffffffffffffffffffff8116156124a557600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83161790555b50565b60408051808201909152600b81527f322e302e312d616c706861000000000000000000000000000000000000000000602082015281565b6124e7614386565b6124ef6143de565b60008060006124fd88611f30565b93506125076125df565b925061251588858589612611565b6125278860a001518560400151612f7d565b915061253387836136df565b9050612546888589848960000151612990565b61255088826136f5565b945061256788848660200151876040015189612aa9565b612572888487613756565b505050509392505050565b8151815161258b9190613864565b8252602080830151908201516125a19190613864565b6020830152604080830151908201516125ba9190613864565b6040830152606080830151908201516125d39190613864565b60609092019190915250565b600a5460009073ffffffffffffffffffffffffffffffffffffffff16818115612608578161260a565b335b9392505050565b825160ff1660031461264f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061579d565b606084015173ffffffffffffffffffffffffffffffffffffffff16156126c257606084015173ffffffffffffffffffffffffffffffffffffffff1633146126c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906157ad565b602084015173ffffffffffffffffffffffffffffffffffffffff161561274d578173ffffffffffffffffffffffffffffffffffffffff16846020015173ffffffffffffffffffffffffffffffffffffffff1614151561274d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906155ed565b604083015115156127a35761276b836020015185600001518361135b565b15156127a3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061565d565b50505050565b6127bb8260a001518260a001516138ae565b6127cd836080015183608001516138ae565b1015612805576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906157bd565b5050565b6128116143af565b6000806000806128258960a0015188612f7d565b935061283a89608001518a60a0015186613909565b925061284a8860a0015187612f7d565b915061285f88608001518960a0015184613909565b90508084106128a25760208086018051839052805182018490525151865182015260808a015160a08b015187519092015161289a9290613909565b8551526128df565b845183905284516020908101859052855181015190860180519190915260a089015160808a01519151516128d69290613986565b60208087015101525b84515160208087015101516128f49190612f7d565b604086015284515160808a015160c08b0151612911929190613909565b85516040015284516020015160a08a015160e08b0151612932929190613909565b855160600152602085015151608089015160c08a0151612953929190613909565b8560200151604001818152505061297b8560200151602001518960a001518a60e00151613909565b60208601516060015250505050949350505050565b8215156129c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906156dd565b82821115612a03576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906156cd565b8460a00151612a16856040015184613864565b1115612a4e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906155fd565b612a5c8560800151836138ae565b612a6a828760a001516138ae565b1115612aa2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061575d565b5050505050565b612ab7828260200151613864565b600084815260046020908152604091829020929092558681015187518451938501518584015160608701516101408c01516101608d015196518b9873ffffffffffffffffffffffffffffffffffffffff9788169897909616967f0bcc4c97732e47d9946f229edb95f5b6323f601300e4690de719993f3c37112996612b46968f96339692959194909390615433565b60405180910390a45050505050565b60018054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101008789161502019095169490940493840181900481028201810190925282815260609390929091830182828015612bfe5780601f10612bd357610100808354040283529160200191612bfe565b820191906000526020600020905b815481529060010190602001808311612be157829003601f168201915b50505050509050612c2685610140015186600001518660000151856020015160200151613a23565b61014084015184518651845160200151612c4293929190613a23565b612c5b8561014001518660000151858560400151613a23565b612c778186600001518760400151856000015160400151613a23565b612c938185600001518660400151856020015160400151613a23565b836040015173ffffffffffffffffffffffffffffffffffffffff16856040015173ffffffffffffffffffffffffffffffffffffffff161415612cfd57612cf881848760400151612cf3866000015160600151876020015160600151613864565b613a23565b612aa2565b612d1581848760400151856000015160600151613a23565b612aa281848660400151856020015160600151613a23565b604080517fb4be83d5000000000000000000000000000000000000000000000000000000006020808301919091526060602483018181528751608485019081528884015160a48601529488015160c48501529087015160e4840152608087015161010484015260a087015161012484015260c087015161014484015260e08701516101648401526101008701516101848401526101208701516101a4840152610140870180516101c485019081526101608901516101e4860152610180905251805161020485018190529394919384936044870192849261022489019291820191601f82010460005b81811015612e34578351855260209485019490930192600101612e16565b50505050818103610160808401919091528a0151805180835260209283019291820191601f82010460005b81811015612e7d578351855260209485019490930192600101612e5f565b50505089845250848103602093840190815288518083529093918201918981019190601f82010460005b81811015612ec5578351855260209485019490930192600101612ea7565b5050507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08883030188525060405250505050509392505050565b612f076143de565b612f1082611f30565b9050612f1c8282613bed565b612805828260200151613d04565b612f32614386565b612f3d8484846124df565b6020810151909150831461260a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061574d565b600082821115612fb9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061560d565b508082035b92915050565b6000808251111515613002576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906156fd565b815182907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff810190811061303257fe5b016020015182517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01909252507f0100000000000000000000000000000000000000000000000000000000000000908190040290565b6000816020018351101515156130ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061562d565b50016020015190565b6040516000906060907f1626ba7e000000000000000000000000000000000000000000000000000000009061310e908790869060240161554e565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152919052602080820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909416939093178352815191935090829081885afa8080156131ab576001811461321c57612572565b7f08c379a0000000000000000000000000000000000000000000000000000000006000527c20000000000000000000000000000000000000000000000000000000006020527c0c57414c4c45545f4552524f5200000000000000000000000000000000604052600060605260646000fd5b50505195945050505050565b60006014825110151515613268576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061578d565b613276826014845103613dab565b82517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec019092525090565b6040516000906060907f9363470200000000000000000000000000000000000000000000000000000000906132de90879087908790602401615521565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152919052602080820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009094169390931783528151919350908290818a5afa80801561337b57600181146133ec576133f1565b7f08c379a0000000000000000000000000000000000000000000000000000000006000527c20000000000000000000000000000000000000000000000000000000006020527c0f56414c494441544f525f4552524f5200000000000000000000000000604052600060605260646000fd5b825194505b50505050949350505050565b6000808311613438576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061564d565b61344b61344585846138ae565b84613e0c565b949350505050565b604080517f5a65726f45785472616e73616374696f6e2800000000000000000000000000006020808301919091527f75696e743235362073616c742c0000000000000000000000000000000000000060328301527f61646472657373207369676e6572416464726573732c00000000000000000000603f8301527f627974657320646174610000000000000000000000000000000000000000000060558301527f2900000000000000000000000000000000000000000000000000000000000000605f830152825180830384018152606090920192839052815160009384938493909282918401908083835b6020831061357c57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161353f565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018019909216911617905260405191909301819003812089519097508995509093508392850191508083835b6020831061361257805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016135d5565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040805192909401829003822097825281019a909a525073ffffffffffffffffffffffffffffffffffffffff97909716968801969096525050606085015250506080909120919050565b600280546040517f190100000000000000000000000000000000000000000000000000000000000081529182015260228101919091526042902090565b6000612fbe611afd83613e23565b60008183106136ee578161260a565b5090919050565b6136fd614386565b6020810182905260a08301516080840151613719918491613909565b808252608084015160c0850151613731929190613909565b604082015260a083015160e084015161374b918491613909565b606082015292915050565b60018054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61010087891615020190951694909404938401819004810282018101909252828152606093909290918301828280156137ff5780601f106137d4576101008083540402835291602001916137ff565b820191906000526020600020905b8154815290600101906020018083116137e257829003601f168201915b5050505050905061381f8461014001518560000151858560000151613a23565b6138388461016001518486600001518560200151613a23565b61385081856000015186604001518560400151613a23565b6127a3818486604001518560600151613a23565b6000828201838110156138a3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061567d565b8091505b5092915050565b6000808315156138c157600091506138a7565b508282028284828115156138d157fe5b04146138a3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061567d565b6000808311613944576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061564d565b61394f84848461427c565b15613438576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906156ad565b60008083116139c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061564d565b6139cc848484614301565b15613a03576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906156ad565b61344b613445613a1386856138ae565b613a1e866001612f7d565b613864565b600080600083118015613a6257508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b15613be5578551600310613aa2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061573d565b50506020848101517fffffffff00000000000000000000000000000000000000000000000000000000166000818152600b90925260409091205473ffffffffffffffffffffffffffffffffffffffff16801515613b2b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906156ed565b604051660fffffffffffe0603f885101168060840182017fa85e59e40000000000000000000000000000000000000000000000000000000083526080600484015273ffffffffffffffffffffffffffffffffffffffff8816602484015273ffffffffffffffffffffffffffffffffffffffff87166044840152856064840152608483015b81811015613bc757895181526020998a019901613baf565b61020084858403866000895af1801515613bdf573d85fd5b50505050505b505050505050565b805160009060ff16600314613c2e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061579d565b606083015173ffffffffffffffffffffffffffffffffffffffff1615613ca157606083015173ffffffffffffffffffffffffffffffffffffffff163314613ca1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906157ad565b613ca96125df565b835190915073ffffffffffffffffffffffffffffffffffffffff808316911614613cff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061566d565b505050565b6000818152600560205260409081902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558281015183516101408501516101608601519351859473ffffffffffffffffffffffffffffffffffffffff9485169493909316927fdc47b3613d9fe400085f6dbdc99453462279057e6207385042827ed6b1a62cf792613d9f923392906154b7565b60405180910390a45050565b600081601401835110151515613ded576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061578d565b50016014015173ffffffffffffffffffffffffffffffffffffffff1690565b6000808284811515613e1a57fe5b04949350505050565b604080517f4f726465722800000000000000000000000000000000000000000000000000006020808301919091527f61646472657373206d616b6572416464726573732c000000000000000000000060268301527f616464726573732074616b6572416464726573732c0000000000000000000000603b8301527f6164647265737320666565526563697069656e74416464726573732c0000000060508301527f616464726573732073656e646572416464726573732c00000000000000000000606c8301527f75696e74323536206d616b65724173736574416d6f756e742c0000000000000060828301527f75696e743235362074616b65724173736574416d6f756e742c00000000000000609b8301527f75696e74323536206d616b65724665652c00000000000000000000000000000060b48301527f75696e743235362074616b65724665652c00000000000000000000000000000060c58301527f75696e743235362065787069726174696f6e54696d655365636f6e64732c000060d68301527f75696e743235362073616c742c0000000000000000000000000000000000000060f48301527f6279746573206d616b65724173736574446174612c00000000000000000000006101018301527f62797465732074616b65724173736574446174610000000000000000000000006101168301527f290000000000000000000000000000000000000000000000000000000000000061012a830152825161010b81840301815261012b90920192839052815160009384938493849391929182918401908083835b602083106140ab57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161406e565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930181900381206101408b0151805191995095509093508392850191508083835b6020831061414657805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101614109565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930181900381206101608b0151805191985095509093508392850191508083835b602083106141e157805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016141a4565b5181516020939093036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018019909116921691909117905260405192018290039091207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0890180516101408b018051610160909c0180519a84529881529288526101a0822091529890525050509190525090919050565b6000808084116142b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061564d565b8215806142c3575084155b156142d15760009150610a88565b838015156142db57fe5b85840990506142ea85846138ae565b6142f66103e8836138ae565b101595945050505050565b60008080841161433d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061564d565b821580614348575084155b156143565760009150610a88565b8380151561436057fe5b8584099050836143708583612f7d565b81151561437957fe5b0690506142ea85846138ae565b608060405190810160405280600081526020016000815260200160008152602001600081525090565b610120604051908101604052806143c4614386565b81526020016143d1614386565b8152602001600081525090565b604080516060810182526000808252602082018190529181019190915290565b600061260a82356158b0565b6000601f8201831361441b57600080fd5b813561442e6144298261583f565b615818565b81815260209384019390925082018360005b8381101561446c578135860161445688826145bc565b8452506020928301929190910190600101614440565b5050505092915050565b6000601f8201831361448757600080fd5b81356144956144298261583f565b81815260209384019390925082018360005b8381101561446c57813586016144bd888261460b565b84525060209283019291909101906001016144a7565b6000601f820183136144e457600080fd5b81356144f26144298261583f565b9150818183526020840193506020810190508385602084028201111561451757600080fd5b60005b8381101561446c578161452d888261454f565b845250602092830192919091019060010161451a565b600061260a82356158c9565b600061260a82356158ce565b600061260a82356158d1565b600061260a82516158d1565b600080601f8301841361458557600080fd5b50813567ffffffffffffffff81111561459d57600080fd5b6020830191508360018202830111156145b557600080fd5b9250929050565b6000601f820183136145cd57600080fd5b81356145db61442982615860565b915080825260208301602083018583830111156145f757600080fd5b614602838284615907565b50505092915050565b6000610180828403121561461e57600080fd5b614629610180615818565b9050600061463784846143fe565b8252506020614648848483016143fe565b602083015250604061465c848285016143fe565b6040830152506060614670848285016143fe565b60608301525060806146848482850161454f565b60808301525060a06146988482850161454f565b60a08301525060c06146ac8482850161454f565b60c08301525060e06146c08482850161454f565b60e0830152506101006146d58482850161454f565b610100830152506101206146eb8482850161454f565b6101208301525061014082013567ffffffffffffffff81111561470d57600080fd5b614719848285016145bc565b6101408301525061016082013567ffffffffffffffff81111561473b57600080fd5b614747848285016145bc565b6101608301525092915050565b60006020828403121561476657600080fd5b600061344b84846143fe565b6000806040838503121561478557600080fd5b600061479185856143fe565b92505060206147a2858286016143fe565b9150509250929050565b600080604083850312156147bf57600080fd5b60006147cb85856143fe565b92505060206147a285828601614543565b6000602082840312156147ee57600080fd5b813567ffffffffffffffff81111561480557600080fd5b61344b84828501614476565b60008060006060848603121561482657600080fd5b833567ffffffffffffffff81111561483d57600080fd5b61484986828701614476565b935050602084013567ffffffffffffffff81111561486657600080fd5b614872868287016144d3565b925050604084013567ffffffffffffffff81111561488f57600080fd5b61489b8682870161440a565b9150509250925092565b6000806000606084860312156148ba57600080fd5b833567ffffffffffffffff8111156148d157600080fd5b6148dd86828701614476565b93505060206148728682870161454f565b60006020828403121561490057600080fd5b600061344b848461454f565b6000806040838503121561491f57600080fd5b6000614791858561454f565b6000806000806060858703121561494157600080fd5b600061494d878761454f565b945050602061495e878288016143fe565b935050604085013567ffffffffffffffff81111561497b57600080fd5b61498787828801614573565b95989497509550505050565b6000806000606084860312156149a857600080fd5b60006149b4868661454f565b93505060206149c5868287016143fe565b925050604084013567ffffffffffffffff8111156149e257600080fd5b61489b868287016145bc565b600060208284031215614a0057600080fd5b600061344b848461455b565b600060208284031215614a1e57600080fd5b600061344b8484614567565b600060208284031215614a3c57600080fd5b813567ffffffffffffffff811115614a5357600080fd5b61344b8482850161460b565b60008060008060808587031215614a7557600080fd5b843567ffffffffffffffff811115614a8c57600080fd5b614a988782880161460b565b945050602085013567ffffffffffffffff811115614ab557600080fd5b614ac18782880161460b565b935050604085013567ffffffffffffffff811115614ade57600080fd5b614aea878288016145bc565b925050606085013567ffffffffffffffff811115614b0757600080fd5b614b13878288016145bc565b91505092959194509250565b600080600060608486031215614b3457600080fd5b833567ffffffffffffffff811115614b4b57600080fd5b614b578682870161460b565b93505060206149c58682870161454f565b60008060008060008060808789031215614b8157600080fd5b6000614b8d898961454f565b9650506020614b9e89828a016143fe565b955050604087013567ffffffffffffffff811115614bbb57600080fd5b614bc789828a01614573565b9450945050606087013567ffffffffffffffff811115614be657600080fd5b614bf289828a01614573565b92509250509295509295509295565b614c0a816158b0565b82525050565b6000614c1b826158ac565b808452602084019350614c2d836158a6565b60005b82811015614c5d57614c438683516153e5565b614c4c826158a6565b606096909601959150600101614c30565b5093949350505050565b614c0a816158c9565b614c0a816158ce565b614c0a816158d1565b6000614c8d826158ac565b808452614ca1816020860160208601615913565b614caa8161593f565b9093016020019392505050565b614c0a816158fc565b601281527f4c454e4754485f36355f52455155495245440000000000000000000000000000602082015260400190565b600d81527f494e56414c49445f54414b455200000000000000000000000000000000000000602082015260400190565b600e81527f4f524445525f4f56455246494c4c000000000000000000000000000000000000602082015260400190565b601181527f55494e543235365f554e444552464c4f57000000000000000000000000000000602082015260400190565b601a81527f41535345545f50524f58595f414c52454144595f455849535453000000000000602082015260400190565b602681527f475245415445525f4f525f455155414c5f544f5f33325f4c454e4754485f524560208201527f5155495245440000000000000000000000000000000000000000000000000000604082015260600190565b601581527f5349474e41545552455f554e535550504f525445440000000000000000000000602082015260400190565b601081527f4449564953494f4e5f42595f5a45524f00000000000000000000000000000000602082015260400190565b601781527f494e56414c49445f4f524445525f5349474e4154555245000000000000000000602082015260400190565b600d81527f494e56414c49445f4d414b455200000000000000000000000000000000000000602082015260400190565b601081527f55494e543235365f4f564552464c4f5700000000000000000000000000000000602082015260400190565b600f81527f494e56414c49445f54585f484153480000000000000000000000000000000000602082015260400190565b601181527f494e56414c49445f5349474e4154555245000000000000000000000000000000602082015260400190565b600e81527f524f554e44494e475f4552524f52000000000000000000000000000000000000602082015260400190565b601081527f4641494c45445f455845435554494f4e00000000000000000000000000000000602082015260400190565b600d81527f54414b45525f4f56455250415900000000000000000000000000000000000000602082015260400190565b601481527f494e56414c49445f54414b45525f414d4f554e54000000000000000000000000602082015260400190565b601a81527f41535345545f50524f58595f444f45535f4e4f545f4558495354000000000000602082015260400190565b602181527f475245415445525f5448414e5f5a45524f5f4c454e4754485f5245515549524560208201527f4400000000000000000000000000000000000000000000000000000000000000604082015260600190565b601181527f5349474e41545552455f494c4c4547414c000000000000000000000000000000602082015260400190565b601e81527f4c454e4754485f475245415445525f5448414e5f305f52455155495245440000602082015260400190565b601781527f494e56414c49445f4e45575f4f524445525f45504f4348000000000000000000602082015260400190565b601e81527f4c454e4754485f475245415445525f5448414e5f335f52455155495245440000602082015260400190565b601481527f434f4d504c4554455f46494c4c5f4641494c4544000000000000000000000000602082015260400190565b601281527f494e56414c49445f46494c4c5f50524943450000000000000000000000000000602082015260400190565b601281527f5245454e5452414e43595f494c4c4547414c0000000000000000000000000000602082015260400190565b601381527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000602082015260400190565b602681527f475245415445525f4f525f455155414c5f544f5f32305f4c454e4754485f524560208201527f5155495245440000000000000000000000000000000000000000000000000000604082015260600190565b601081527f4f524445525f554e46494c4c41424c4500000000000000000000000000000000602082015260400190565b600e81527f494e56414c49445f53454e444552000000000000000000000000000000000000602082015260400190565b601881527f4e454741544956455f5350524541445f52455155495245440000000000000000602082015260400190565b601481527f494e56414c49445f54585f5349474e4154555245000000000000000000000000602082015260400190565b601181527f4c454e4754485f305f5245515549524544000000000000000000000000000000602082015260400190565b805160808301906153738482614c70565b5060208201516153866020850182614c70565b5060408201516153996040850182614c70565b5060608201516127a36060850182614c70565b80516101208301906153be8482615362565b5060208201516153d16080850182615362565b5060408201516127a3610100850182614c70565b805160608301906153f6848261541c565b5060208201516154096020850182614c70565b5060408201516127a36040850182614c70565b614c0a816158f6565b60208101612fbe8284614c01565b6101008101615442828b614c01565b61544f602083018a614c01565b61545c6040830189614c70565b6154696060830188614c70565b6154766080830187614c70565b61548360a0830186614c70565b81810360c08301526154958185614c82565b905081810360e08301526154a98184614c82565b9a9950505050505050505050565b606081016154c58286614c01565b81810360208301526154d78185614c82565b905081810360408301526154eb8184614c82565b95945050505050565b6020808252810161260a8184614c10565b60208101612fbe8284614c67565b60208101612fbe8284614c70565b6060810161552f8286614c70565b61553c6020830185614c01565b81810360408301526154eb8184614c82565b6040810161555c8285614c70565b818103602083015261344b8184614c82565b6080810161557c8287614c70565b615589602083018661541c565b6155966040830185614c70565b6154eb6060830184614c70565b604081016155b18285614c79565b61260a6020830184614c01565b6020808252810161260a8184614c82565b60208101612fbe8284614cb7565b60208082528101612fbe81614cc0565b60208082528101612fbe81614cf0565b60208082528101612fbe81614d20565b60208082528101612fbe81614d50565b60208082528101612fbe81614d80565b60208082528101612fbe81614db0565b60208082528101612fbe81614e06565b60208082528101612fbe81614e36565b60208082528101612fbe81614e66565b60208082528101612fbe81614e96565b60208082528101612fbe81614ec6565b60208082528101612fbe81614ef6565b60208082528101612fbe81614f26565b60208082528101612fbe81614f56565b60208082528101612fbe81614f86565b60208082528101612fbe81614fb6565b60208082528101612fbe81614fe6565b60208082528101612fbe81615016565b60208082528101612fbe81615046565b60208082528101612fbe8161509c565b60208082528101612fbe816150cc565b60208082528101612fbe816150fc565b60208082528101612fbe8161512c565b60208082528101612fbe8161515c565b60208082528101612fbe8161518c565b60208082528101612fbe816151bc565b60208082528101612fbe816151ec565b60208082528101612fbe8161521c565b60208082528101612fbe81615272565b60208082528101612fbe816152a2565b60208082528101612fbe816152d2565b60208082528101612fbe81615302565b60208082528101612fbe81615332565b60808101612fbe8284615362565b6101208101612fbe82846153ac565b60608101612fbe82846153e5565b60405181810167ffffffffffffffff8111828210171561583757600080fd5b604052919050565b600067ffffffffffffffff82111561585657600080fd5b5060209081020190565b600067ffffffffffffffff82111561587757600080fd5b506020601f919091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0160190565b60200190565b5190565b73ffffffffffffffffffffffffffffffffffffffff1690565b151590565b90565b7fffffffff000000000000000000000000000000000000000000000000000000001690565b60ff1690565b6000612fbe826158b0565b82818337506000910152565b60005b8381101561592e578181015183820152602001615916565b838111156127a35750506000910152565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016905600a265627a7a7230582075fcae05644c6afa57da58b9541210644237fc1ec14adf590fb4a63ba9aec8876c6578706572696d656e74616cf50037",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x1B6 JUMPI PUSH4 0xFFFFFFFF PUSH29 0x100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD DIV AND PUSH4 0x288CDC91 DUP2 EQ PUSH2 0x1BB JUMPI DUP1 PUSH4 0x297BB70B EQ PUSH2 0x1F1 JUMPI DUP1 PUSH4 0x2AC12622 EQ PUSH2 0x21E JUMPI DUP1 PUSH4 0x3683EF8E EQ PUSH2 0x24B JUMPI DUP1 PUSH4 0x3C28D861 EQ PUSH2 0x26D JUMPI DUP1 PUSH4 0x3E228BAE EQ PUSH2 0x29A JUMPI DUP1 PUSH4 0x3FD3C997 EQ PUSH2 0x2BA JUMPI DUP1 PUSH4 0x4AC14782 EQ PUSH2 0x2E7 JUMPI DUP1 PUSH4 0x4D0AE546 EQ PUSH2 0x307 JUMPI DUP1 PUSH4 0x4F9559B1 EQ PUSH2 0x327 JUMPI DUP1 PUSH4 0x50DDE190 EQ PUSH2 0x347 JUMPI DUP1 PUSH4 0x60704108 EQ PUSH2 0x367 JUMPI DUP1 PUSH4 0x642F2EAF EQ PUSH2 0x394 JUMPI DUP1 PUSH4 0x64A3BC15 EQ PUSH2 0x3B4 JUMPI DUP1 PUSH4 0x77FCCE68 EQ PUSH2 0x3D4 JUMPI DUP1 PUSH4 0x7B8E3514 EQ PUSH2 0x3F4 JUMPI DUP1 PUSH4 0x7E1D9808 EQ PUSH2 0x414 JUMPI DUP1 PUSH4 0x7E9D74DC EQ PUSH2 0x434 JUMPI DUP1 PUSH4 0x82C174D0 EQ PUSH2 0x461 JUMPI DUP1 PUSH4 0x8DA5CB5B EQ PUSH2 0x481 JUMPI DUP1 PUSH4 0x93634702 EQ PUSH2 0x496 JUMPI DUP1 PUSH4 0xA3E20380 EQ PUSH2 0x4B6 JUMPI DUP1 PUSH4 0xB4BE83D5 EQ PUSH2 0x4D6 JUMPI DUP1 PUSH4 0xBFC8BFCE EQ PUSH2 0x4F6 JUMPI DUP1 PUSH4 0xC585BB93 EQ PUSH2 0x516 JUMPI DUP1 PUSH4 0xC75E0A81 EQ PUSH2 0x536 JUMPI DUP1 PUSH4 0xD46B02C3 EQ PUSH2 0x563 JUMPI DUP1 PUSH4 0xD9BFA73E EQ PUSH2 0x583 JUMPI DUP1 PUSH4 0xDB123B1A EQ PUSH2 0x5A3 JUMPI DUP1 PUSH4 0xDD1C7D18 EQ PUSH2 0x5C5 JUMPI DUP1 PUSH4 0xE306F779 EQ PUSH2 0x5E5 JUMPI DUP1 PUSH4 0xE5FA431B EQ PUSH2 0x5FA JUMPI DUP1 PUSH4 0xEEA086BA EQ PUSH2 0x61A JUMPI DUP1 PUSH4 0xF2FDE38B EQ PUSH2 0x62F JUMPI DUP1 PUSH4 0xFFA1AD74 EQ PUSH2 0x64F JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1C7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1DB PUSH2 0x1D6 CALLDATASIZE PUSH1 0x4 PUSH2 0x48EE JUMP JUMPDEST PUSH2 0x664 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1E8 SWAP2 SWAP1 PUSH2 0x5513 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1FD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x211 PUSH2 0x20C CALLDATASIZE PUSH1 0x4 PUSH2 0x4811 JUMP JUMPDEST PUSH2 0x676 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1E8 SWAP2 SWAP1 PUSH2 0x57ED JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x22A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x23E PUSH2 0x239 CALLDATASIZE PUSH1 0x4 PUSH2 0x48EE JUMP JUMPDEST PUSH2 0x7A1 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1E8 SWAP2 SWAP1 PUSH2 0x5505 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x257 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x26B PUSH2 0x266 CALLDATASIZE PUSH1 0x4 PUSH2 0x492B JUMP JUMPDEST PUSH2 0x7B6 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x279 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x28D PUSH2 0x288 CALLDATASIZE PUSH1 0x4 PUSH2 0x4A5F JUMP JUMPDEST PUSH2 0x8A3 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1E8 SWAP2 SWAP1 PUSH2 0x57FB JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2A6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x211 PUSH2 0x2B5 CALLDATASIZE PUSH1 0x4 PUSH2 0x4B1F JUMP JUMPDEST PUSH2 0xA3A JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2C6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2DA PUSH2 0x2D5 CALLDATASIZE PUSH1 0x4 PUSH2 0x49EE JUMP JUMPDEST PUSH2 0xA90 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1E8 SWAP2 SWAP1 PUSH2 0x55CF JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2F3 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x26B PUSH2 0x302 CALLDATASIZE PUSH1 0x4 PUSH2 0x47DC JUMP JUMPDEST PUSH2 0xAB8 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x313 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x211 PUSH2 0x322 CALLDATASIZE PUSH1 0x4 PUSH2 0x4811 JUMP JUMPDEST PUSH2 0xB85 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x333 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x26B PUSH2 0x342 CALLDATASIZE PUSH1 0x4 PUSH2 0x48EE JUMP JUMPDEST PUSH2 0xC75 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x353 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x211 PUSH2 0x362 CALLDATASIZE PUSH1 0x4 PUSH2 0x4811 JUMP JUMPDEST PUSH2 0xE2A JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x373 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x387 PUSH2 0x382 CALLDATASIZE PUSH1 0x4 PUSH2 0x49EE JUMP JUMPDEST PUSH2 0xEBE JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1E8 SWAP2 SWAP1 PUSH2 0x5425 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3A0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x23E PUSH2 0x3AF CALLDATASIZE PUSH1 0x4 PUSH2 0x48EE JUMP JUMPDEST PUSH2 0xF0C JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3C0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x211 PUSH2 0x3CF CALLDATASIZE PUSH1 0x4 PUSH2 0x4B1F JUMP JUMPDEST PUSH2 0xF21 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3E0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x26B PUSH2 0x3EF CALLDATASIZE PUSH1 0x4 PUSH2 0x47AC JUMP JUMPDEST PUSH2 0xFCC JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x400 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x23E PUSH2 0x40F CALLDATASIZE PUSH1 0x4 PUSH2 0x4772 JUMP JUMPDEST PUSH2 0x1106 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x420 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x211 PUSH2 0x42F CALLDATASIZE PUSH1 0x4 PUSH2 0x48A5 JUMP JUMPDEST PUSH2 0x1126 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x440 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x454 PUSH2 0x44F CALLDATASIZE PUSH1 0x4 PUSH2 0x47DC JUMP JUMPDEST PUSH2 0x128A JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1E8 SWAP2 SWAP1 PUSH2 0x54F4 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x46D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x23E PUSH2 0x47C CALLDATASIZE PUSH1 0x4 PUSH2 0x490C JUMP JUMPDEST PUSH2 0x131F JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x48D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x387 PUSH2 0x133F JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x4A2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x23E PUSH2 0x4B1 CALLDATASIZE PUSH1 0x4 PUSH2 0x4993 JUMP JUMPDEST PUSH2 0x135B JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x4C2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x211 PUSH2 0x4D1 CALLDATASIZE PUSH1 0x4 PUSH2 0x48A5 JUMP JUMPDEST PUSH2 0x18DE JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x4E2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x211 PUSH2 0x4F1 CALLDATASIZE PUSH1 0x4 PUSH2 0x4B1F JUMP JUMPDEST PUSH2 0x19F1 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x502 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x26B PUSH2 0x511 CALLDATASIZE PUSH1 0x4 PUSH2 0x4B68 JUMP JUMPDEST PUSH2 0x1A6C JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x522 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x26B PUSH2 0x531 CALLDATASIZE PUSH1 0x4 PUSH2 0x4754 JUMP JUMPDEST PUSH2 0x1D05 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x542 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x556 PUSH2 0x551 CALLDATASIZE PUSH1 0x4 PUSH2 0x4A2A JUMP JUMPDEST PUSH2 0x1F30 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1E8 SWAP2 SWAP1 PUSH2 0x580A JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x56F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x26B PUSH2 0x57E CALLDATASIZE PUSH1 0x4 PUSH2 0x4A2A JUMP JUMPDEST PUSH2 0x202A JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x58F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1DB PUSH2 0x59E CALLDATASIZE PUSH1 0x4 PUSH2 0x4772 JUMP JUMPDEST PUSH2 0x20C6 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x5AF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x5B8 PUSH2 0x20E3 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1E8 SWAP2 SWAP1 PUSH2 0x55BE JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x5D1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x211 PUSH2 0x5E0 CALLDATASIZE PUSH1 0x4 PUSH2 0x48A5 JUMP JUMPDEST PUSH2 0x218E JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x5F1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1DB PUSH2 0x2263 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x606 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x211 PUSH2 0x615 CALLDATASIZE PUSH1 0x4 PUSH2 0x48A5 JUMP JUMPDEST PUSH2 0x2269 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x626 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x387 PUSH2 0x23DB JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x63B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x26B PUSH2 0x64A CALLDATASIZE PUSH1 0x4 PUSH2 0x4754 JUMP JUMPDEST PUSH2 0x23F7 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x65B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x5B8 PUSH2 0x24A8 JUMP JUMPDEST PUSH1 0x4 PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP2 JUMP JUMPDEST PUSH2 0x67E PUSH2 0x4386 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x689 PUSH2 0x4386 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x6CF JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x576D JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR DUP2 SSTORE DUP8 MLOAD SWAP4 POP SWAP2 POP JUMPDEST DUP2 DUP4 EQ PUSH2 0x76F JUMPI PUSH2 0x758 DUP8 DUP4 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x719 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP8 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x731 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP8 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x749 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x24DF JUMP JUMPDEST SWAP1 POP PUSH2 0x764 DUP5 DUP3 PUSH2 0x257D JUMP JUMPDEST PUSH1 0x1 SWAP1 SWAP2 ADD SWAP1 PUSH2 0x701 JUMP JUMPDEST POP POP PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x5 PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND CALLER EQ PUSH2 0x846 JUMPI PUSH2 0x80E DUP5 DUP5 DUP5 DUP5 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY POP PUSH2 0x135B SWAP5 POP POP POP POP POP JUMP JUMPDEST ISZERO ISZERO PUSH2 0x846 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x569D JUMP JUMPDEST POP POP PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x7 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP5 KECCAK256 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP4 AND DUP5 MSTORE SWAP2 SWAP1 MSTORE SWAP1 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR SWAP1 SSTORE JUMP JUMPDEST PUSH2 0x8AB PUSH2 0x43AF JUMP JUMPDEST PUSH2 0x8B3 PUSH2 0x43DE JUMP JUMPDEST PUSH2 0x8BB PUSH2 0x43DE JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x8F9 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x576D JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR SWAP1 SSTORE PUSH2 0x160 DUP1 DUP10 ADD MLOAD PUSH2 0x140 DUP1 DUP11 ADD SWAP2 SWAP1 SWAP2 MSTORE DUP10 ADD MLOAD SWAP1 DUP9 ADD MSTORE PUSH2 0x945 DUP9 PUSH2 0x1F30 JUMP JUMPDEST SWAP3 POP PUSH2 0x950 DUP8 PUSH2 0x1F30 JUMP JUMPDEST SWAP2 POP PUSH2 0x95A PUSH2 0x25DF JUMP JUMPDEST SWAP1 POP PUSH2 0x968 DUP9 DUP5 DUP4 DUP10 PUSH2 0x2611 JUMP JUMPDEST PUSH2 0x974 DUP8 DUP4 DUP4 DUP9 PUSH2 0x2611 JUMP JUMPDEST PUSH2 0x97E DUP9 DUP9 PUSH2 0x27A9 JUMP JUMPDEST PUSH2 0x992 DUP9 DUP9 DUP6 PUSH1 0x40 ADD MLOAD DUP6 PUSH1 0x40 ADD MLOAD PUSH2 0x2809 JUMP JUMPDEST DUP1 MLOAD PUSH1 0x20 DUP2 ADD MLOAD SWAP1 MLOAD SWAP2 SWAP6 POP PUSH2 0x9AD SWAP2 DUP11 SWAP2 DUP7 SWAP2 DUP2 SWAP1 PUSH2 0x2990 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP6 ADD MLOAD SWAP1 DUP2 ADD MLOAD SWAP1 MLOAD PUSH2 0x9C9 SWAP2 DUP10 SWAP2 DUP6 SWAP2 SWAP1 DUP2 SWAP1 PUSH2 0x2990 JUMP JUMPDEST PUSH2 0x9E2 DUP9 DUP3 DUP6 PUSH1 0x20 ADD MLOAD DUP7 PUSH1 0x40 ADD MLOAD DUP9 PUSH1 0x0 ADD MLOAD PUSH2 0x2AA9 JUMP JUMPDEST PUSH2 0x9FB DUP8 DUP3 DUP5 PUSH1 0x20 ADD MLOAD DUP6 PUSH1 0x40 ADD MLOAD DUP9 PUSH1 0x20 ADD MLOAD PUSH2 0x2AA9 JUMP JUMPDEST PUSH2 0xA07 DUP9 DUP9 DUP4 DUP8 PUSH2 0x2B55 JUMP JUMPDEST POP POP PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE POP SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH2 0xA42 PUSH2 0x4386 JUMP JUMPDEST PUSH1 0x60 PUSH2 0xA4F DUP6 DUP6 DUP6 PUSH2 0x2D2D JUMP JUMPDEST SWAP1 POP PUSH1 0x80 DUP2 DUP3 MLOAD PUSH1 0x20 DUP5 ADD ADDRESS GAS DELEGATECALL DUP1 ISZERO PUSH2 0xA86 JUMPI DUP2 MLOAD DUP4 MSTORE PUSH1 0x20 DUP3 ADD MLOAD PUSH1 0x20 DUP5 ADD MSTORE PUSH1 0x40 DUP3 ADD MLOAD PUSH1 0x40 DUP5 ADD MSTORE PUSH1 0x60 DUP3 ADD MLOAD PUSH1 0x60 DUP5 ADD MSTORE JUMPDEST POP JUMPDEST POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0xB PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD DUP2 SWAP1 PUSH1 0xFF AND ISZERO PUSH2 0xAF8 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x576D JUMP JUMPDEST POP POP PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR DUP2 SSTORE DUP2 MLOAD SWAP1 JUMPDEST DUP1 DUP3 EQ PUSH2 0xB58 JUMPI PUSH2 0xB50 DUP4 DUP3 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xB41 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x2EFF JUMP JUMPDEST PUSH1 0x1 ADD PUSH2 0xB29 JUMP JUMPDEST POP POP PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE POP JUMP JUMPDEST PUSH2 0xB8D PUSH2 0x4386 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0xB98 PUSH2 0x4386 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0xBD5 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x576D JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR DUP2 SSTORE DUP8 MLOAD SWAP4 POP SWAP2 POP JUMPDEST DUP2 DUP4 EQ PUSH2 0x76F JUMPI PUSH2 0xC5E DUP8 DUP4 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xC1F JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP8 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xC37 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP8 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xC4F JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x2F2A JUMP JUMPDEST SWAP1 POP PUSH2 0xC6A DUP5 DUP3 PUSH2 0x257D JUMP JUMPDEST PUSH1 0x1 SWAP1 SWAP2 ADD SWAP1 PUSH2 0xC07 JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD DUP2 SWAP1 DUP2 SWAP1 DUP2 SWAP1 PUSH1 0xFF AND ISZERO PUSH2 0xCB9 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x576D JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR SWAP1 SSTORE PUSH2 0xCEC PUSH2 0x25DF JUMP JUMPDEST SWAP4 POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND CALLER EQ PUSH2 0xD11 JUMPI CALLER PUSH2 0xD14 JUMP JUMPDEST PUSH1 0x0 JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP7 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x6 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 SWAP4 DUP6 AND DUP4 MSTORE SWAP3 SWAP1 MSTORE KECCAK256 SLOAD SWAP1 SWAP4 POP PUSH1 0x1 DUP7 ADD SWAP3 POP SWAP1 POP DUP1 DUP3 GT PUSH2 0xD8B JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x572D JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP6 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x6 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 SWAP5 DUP9 AND DUP1 DUP5 MSTORE SWAP5 SWAP1 SWAP2 MSTORE SWAP1 DUP2 SWAP1 KECCAK256 DUP6 SWAP1 SSTORE MLOAD PUSH32 0x82AF639571738F4EBD4268FB0363D8957EBE1BBB9E78DBA5EBD69EED39B154F0 SWAP1 PUSH2 0xDF3 SWAP1 DUP7 SWAP1 PUSH2 0x5513 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 POP POP PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE POP POP POP JUMP JUMPDEST PUSH2 0xE32 PUSH2 0x4386 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0xE3D PUSH2 0x4386 JUMP JUMPDEST DUP7 MLOAD SWAP3 POP PUSH1 0x0 SWAP2 POP JUMPDEST DUP2 DUP4 EQ PUSH2 0xEB4 JUMPI PUSH2 0xE9D DUP8 DUP4 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xE5E JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP8 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xE76 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP8 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xE8E JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0xA3A JUMP JUMPDEST SWAP1 POP PUSH2 0xEA9 DUP5 DUP3 PUSH2 0x257D JUMP JUMPDEST PUSH1 0x1 SWAP1 SWAP2 ADD SWAP1 PUSH2 0xE46 JUMP JUMPDEST POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 DUP2 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0xB PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND JUMPDEST SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x9 PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH2 0xF29 PUSH2 0x4386 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0xF66 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x576D JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR SWAP1 SSTORE PUSH2 0xF9C DUP5 DUP5 DUP5 PUSH2 0x2F2A JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x100A JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x576D JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR SWAP1 SSTORE PUSH2 0x103D PUSH2 0x25DF JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 DUP2 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x8 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 SWAP5 DUP10 AND DUP1 DUP5 MSTORE SWAP5 SWAP1 SWAP2 MSTORE SWAP1 DUP2 SWAP1 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND DUP8 ISZERO ISZERO OR SWAP1 SSTORE MLOAD SWAP3 SWAP4 POP SWAP1 SWAP2 PUSH32 0xA8656E308026EEABCE8F0BC18048433252318AB80AC79DA0B3D3D8697DFBA891 SWAP1 PUSH2 0x10D1 SWAP1 DUP7 SWAP1 PUSH2 0x5505 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 POP POP PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE POP JUMP JUMPDEST PUSH1 0x8 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x0 SWAP3 DUP4 MSTORE PUSH1 0x40 DUP1 DUP5 KECCAK256 SWAP1 SWAP2 MSTORE SWAP1 DUP3 MSTORE SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH2 0x112E PUSH2 0x4386 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x0 DUP1 PUSH1 0x0 PUSH2 0x113D PUSH2 0x4386 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x117A JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x576D JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR DUP2 SSTORE DUP10 MLOAD DUP11 SWAP2 SWAP1 DUP2 LT PUSH2 0x11B2 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x160 ADD MLOAD SWAP5 POP DUP9 MLOAD SWAP4 POP PUSH1 0x0 SWAP3 POP JUMPDEST DUP3 DUP5 EQ PUSH2 0x1255 JUMPI DUP5 DUP10 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x11E2 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x160 ADD DUP2 SWAP1 MSTORE POP PUSH2 0x1202 DUP9 DUP8 PUSH1 0x20 ADD MLOAD PUSH2 0x2F7D JUMP JUMPDEST SWAP2 POP PUSH2 0x122E DUP10 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1215 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP4 DUP10 DUP7 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x749 JUMPI INVALID JUMPDEST SWAP1 POP PUSH2 0x123A DUP7 DUP3 PUSH2 0x257D JUMP JUMPDEST PUSH1 0x20 DUP7 ADD MLOAD DUP9 GT PUSH2 0x124A JUMPI PUSH2 0x1255 JUMP JUMPDEST PUSH1 0x1 SWAP1 SWAP3 ADD SWAP2 PUSH2 0x11CC JUMP JUMPDEST POP POP PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE POP SWAP2 SWAP6 SWAP5 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x60 PUSH1 0x0 PUSH1 0x60 PUSH1 0x0 DUP5 MLOAD SWAP3 POP DUP3 PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x12D0 JUMPI DUP2 PUSH1 0x20 ADD JUMPDEST PUSH2 0x12BD PUSH2 0x43DE JUMP JUMPDEST DUP2 MSTORE PUSH1 0x20 ADD SWAP1 PUSH1 0x1 SWAP1 SUB SWAP1 DUP2 PUSH2 0x12B5 JUMPI SWAP1 POP JUMPDEST POP SWAP2 POP PUSH1 0x0 SWAP1 POP JUMPDEST DUP1 DUP4 EQ PUSH2 0xA88 JUMPI PUSH2 0x12FF DUP6 DUP3 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x12F0 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x1F30 JUMP JUMPDEST DUP3 DUP3 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x130D JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD MSTORE PUSH1 0x1 ADD PUSH2 0x12D8 JUMP JUMPDEST PUSH1 0x7 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x0 SWAP3 DUP4 MSTORE PUSH1 0x40 DUP1 DUP5 KECCAK256 SWAP1 SWAP2 MSTORE SWAP1 DUP3 MSTORE SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH1 0x3 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 DUP10 MLOAD GT ISZERO ISZERO PUSH2 0x13A4 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x571D JUMP JUMPDEST PUSH2 0x13AD DUP10 PUSH2 0x2FC4 JUMP JUMPDEST PUSH32 0x100000000000000000000000000000000000000000000000000000000000000 SWAP1 DIV SWAP7 POP PUSH1 0x7 PUSH1 0xFF DUP9 AND LT PUSH2 0x140F JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x563D JUMP JUMPDEST DUP7 PUSH1 0xFF AND PUSH1 0x7 DUP2 GT ISZERO PUSH2 0x141E JUMPI INVALID JUMPDEST SWAP6 POP PUSH1 0x0 DUP7 PUSH1 0x7 DUP2 GT ISZERO PUSH2 0x142E JUMPI INVALID JUMPDEST EQ ISZERO PUSH2 0x1466 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x570D JUMP JUMPDEST PUSH1 0x1 DUP7 PUSH1 0x7 DUP2 GT ISZERO PUSH2 0x1474 JUMPI INVALID JUMPDEST EQ ISZERO PUSH2 0x14BC JUMPI DUP9 MLOAD ISZERO PUSH2 0x14B3 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x57DD JUMP JUMPDEST PUSH1 0x0 SWAP8 POP PUSH2 0x18D0 JUMP JUMPDEST PUSH1 0x2 DUP7 PUSH1 0x7 DUP2 GT ISZERO PUSH2 0x14CA JUMPI INVALID JUMPDEST EQ ISZERO PUSH2 0x1605 JUMPI DUP9 MLOAD PUSH1 0x41 EQ PUSH2 0x150B JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x55DD JUMP JUMPDEST DUP9 PUSH1 0x0 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x151A JUMPI INVALID JUMPDEST ADD PUSH1 0x20 ADD MLOAD PUSH32 0x100000000000000000000000000000000000000000000000000000000000000 SWAP1 DUP2 SWAP1 DIV DUP2 MUL DIV SWAP5 POP PUSH2 0x155A DUP10 PUSH1 0x1 PUSH4 0xFFFFFFFF PUSH2 0x3088 AND JUMP JUMPDEST SWAP4 POP PUSH2 0x156D DUP10 PUSH1 0x21 PUSH4 0xFFFFFFFF PUSH2 0x3088 AND JUMP JUMPDEST SWAP3 POP PUSH1 0x1 DUP12 DUP7 DUP7 DUP7 PUSH1 0x40 MLOAD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MSTORE PUSH1 0x40 MLOAD PUSH2 0x1592 SWAP5 SWAP4 SWAP3 SWAP2 SWAP1 PUSH2 0x556E JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 SUB SWAP1 DUP1 DUP5 SUB SWAP1 PUSH1 0x0 DUP7 GAS CALL ISZERO DUP1 ISZERO PUSH2 0x15B6 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP PUSH1 0x40 MLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP13 DUP2 AND SWAP1 DUP3 AND EQ SWAP10 POP SWAP3 POP PUSH2 0x18D0 SWAP1 POP JUMP JUMPDEST PUSH1 0x3 DUP7 PUSH1 0x7 DUP2 GT ISZERO PUSH2 0x1613 JUMPI INVALID JUMPDEST EQ ISZERO PUSH2 0x17B9 JUMPI DUP9 MLOAD PUSH1 0x41 EQ PUSH2 0x1654 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x55DD JUMP JUMPDEST DUP9 PUSH1 0x0 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1663 JUMPI INVALID JUMPDEST ADD PUSH1 0x20 ADD MLOAD PUSH32 0x100000000000000000000000000000000000000000000000000000000000000 SWAP1 DUP2 SWAP1 DIV DUP2 MUL DIV SWAP5 POP PUSH2 0x16A3 DUP10 PUSH1 0x1 PUSH4 0xFFFFFFFF PUSH2 0x3088 AND JUMP JUMPDEST SWAP4 POP PUSH2 0x16B6 DUP10 PUSH1 0x21 PUSH4 0xFFFFFFFF PUSH2 0x3088 AND JUMP JUMPDEST SWAP3 POP PUSH1 0x1 DUP12 PUSH1 0x40 MLOAD PUSH1 0x20 ADD DUP1 DUP1 PUSH32 0x19457468657265756D205369676E6564204D6573736167653A0A333200000000 DUP2 MSTORE POP PUSH1 0x1C ADD DUP3 PUSH1 0x0 NOT AND PUSH1 0x0 NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE PUSH1 0x40 MLOAD DUP1 DUP3 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT PUSH2 0x1757 JUMPI DUP1 MLOAD DUP3 MSTORE PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 SWAP1 SWAP3 ADD SWAP2 PUSH1 0x20 SWAP2 DUP3 ADD SWAP2 ADD PUSH2 0x171A JUMP JUMPDEST MLOAD DUP2 MLOAD PUSH1 0x20 SWAP4 DUP5 SUB PUSH2 0x100 EXP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD DUP1 NOT SWAP1 SWAP3 AND SWAP2 AND OR SWAP1 MSTORE PUSH1 0x40 DUP1 MLOAD SWAP3 SWAP1 SWAP5 ADD DUP3 SWAP1 SUB DUP3 KECCAK256 PUSH1 0x0 DUP4 MSTORE SWAP2 ADD SWAP3 DUP4 SWAP1 MSTORE PUSH2 0x1592 SWAP5 POP SWAP3 POP DUP10 SWAP2 DUP10 SWAP2 POP DUP9 SWAP1 PUSH2 0x556E JUMP JUMPDEST PUSH1 0x4 DUP7 PUSH1 0x7 DUP2 GT ISZERO PUSH2 0x17C7 JUMPI INVALID JUMPDEST EQ ISZERO PUSH2 0x17DF JUMPI PUSH2 0x17D8 DUP12 DUP12 DUP12 PUSH2 0x30D3 JUMP JUMPDEST SWAP8 POP PUSH2 0x18D0 JUMP JUMPDEST PUSH1 0x5 DUP7 PUSH1 0x7 DUP2 GT ISZERO PUSH2 0x17ED JUMPI INVALID JUMPDEST EQ ISZERO PUSH2 0x1850 JUMPI PUSH2 0x17FC DUP10 PUSH2 0x3228 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP13 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x8 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 SWAP4 DUP6 AND DUP4 MSTORE SWAP3 SWAP1 MSTORE KECCAK256 SLOAD SWAP1 SWAP2 POP PUSH1 0xFF AND ISZERO ISZERO PUSH2 0x1844 JUMPI PUSH1 0x0 SWAP8 POP PUSH2 0x18D0 JUMP JUMPDEST PUSH2 0x17D8 DUP2 DUP13 DUP13 DUP13 PUSH2 0x32A1 JUMP JUMPDEST PUSH1 0x6 DUP7 PUSH1 0x7 DUP2 GT ISZERO PUSH2 0x185E JUMPI INVALID JUMPDEST EQ ISZERO PUSH2 0x189E JUMPI PUSH1 0x0 DUP12 DUP2 MSTORE PUSH1 0x7 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP15 AND DUP5 MSTORE SWAP1 SWAP2 MSTORE SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND SWAP8 POP PUSH2 0x18D0 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x563D JUMP JUMPDEST POP POP POP POP POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH2 0x18E6 PUSH2 0x4386 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH2 0x18F6 PUSH2 0x4386 JUMP JUMPDEST DUP10 PUSH1 0x0 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1905 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x140 ADD MLOAD SWAP6 POP DUP10 MLOAD SWAP5 POP PUSH1 0x0 SWAP4 POP JUMPDEST DUP4 DUP6 EQ PUSH2 0x19E4 JUMPI DUP6 DUP11 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1935 JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD MLOAD PUSH2 0x140 ADD MSTORE DUP7 MLOAD PUSH2 0x1951 SWAP1 DUP11 SWAP1 PUSH2 0x2F7D JUMP JUMPDEST SWAP3 POP PUSH2 0x1994 DUP11 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1964 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH1 0xA0 ADD MLOAD DUP12 DUP7 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1980 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH1 0x80 ADD MLOAD DUP6 PUSH2 0x33FD JUMP JUMPDEST SWAP2 POP PUSH2 0x19C0 DUP11 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x19A7 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP4 DUP11 DUP8 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xE8E JUMPI INVALID JUMPDEST SWAP1 POP PUSH2 0x19CC DUP8 DUP3 PUSH2 0x257D JUMP JUMPDEST DUP7 MLOAD DUP10 GT PUSH2 0x19D9 JUMPI PUSH2 0x19E4 JUMP JUMPDEST PUSH1 0x1 SWAP1 SWAP4 ADD SWAP3 PUSH2 0x191F JUMP JUMPDEST POP POP POP POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH2 0x19F9 PUSH2 0x4386 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x1A36 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x576D JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR SWAP1 SSTORE PUSH2 0xF9C DUP5 DUP5 DUP5 PUSH2 0x24DF JUMP JUMPDEST PUSH1 0xA SLOAD PUSH1 0x0 SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND ISZERO PUSH2 0x1ABF JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x576D JUMP JUMPDEST PUSH2 0x1B02 PUSH2 0x1AFD DUP9 DUP9 DUP9 DUP9 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY POP PUSH2 0x3453 SWAP5 POP POP POP POP POP JUMP JUMPDEST PUSH2 0x3694 JUMP JUMPDEST PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x9 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD SWAP1 SWAP2 POP PUSH1 0xFF AND ISZERO PUSH2 0x1B4E JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x568D JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP7 AND CALLER EQ PUSH2 0x1C1F JUMPI PUSH2 0x1BA6 DUP2 DUP8 DUP6 DUP6 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY POP PUSH2 0x135B SWAP5 POP POP POP POP POP JUMP JUMPDEST ISZERO ISZERO PUSH2 0x1BDE JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x57CD JUMP JUMPDEST PUSH1 0xA DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP9 AND OR SWAP1 SSTORE JUMPDEST PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x9 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 DUP2 SWAP1 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR SWAP1 SSTORE MLOAD ADDRESS SWAP1 DUP7 SWAP1 DUP7 SWAP1 DUP1 DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP SWAP3 POP POP POP PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP6 GAS DELEGATECALL SWAP2 POP POP ISZERO ISZERO PUSH2 0x1CB6 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x56BD JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP7 AND CALLER EQ PUSH2 0x1CFC JUMPI PUSH1 0xA DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND SWAP1 SSTORE JUMPDEST POP POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x3 SLOAD PUSH1 0x0 SWAP1 DUP2 SWAP1 DUP2 SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0x1D5D JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x577D JUMP JUMPDEST DUP4 SWAP3 POP DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0xAE25532E PUSH1 0x40 MLOAD DUP2 PUSH4 0xFFFFFFFF AND PUSH29 0x100000000000000000000000000000000000000000000000000000000 MUL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x1DC4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x1DD8 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP PUSH2 0x1DFC SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x4A0C JUMP JUMPDEST PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 DUP2 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0xB PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD SWAP1 SWAP3 POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 POP DUP1 ISZERO PUSH2 0x1E81 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x561D JUMP JUMPDEST PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0xB PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 DUP2 SWAP1 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP7 AND OR SWAP1 SSTORE MLOAD PUSH32 0xD2C6B762299C609BDB96520B58A49BFB80186934D4F71A86A367571A15C03194 SWAP1 PUSH2 0x1F22 SWAP1 DUP5 SWAP1 DUP8 SWAP1 PUSH2 0x55A3 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG1 POP POP POP POP JUMP JUMPDEST PUSH2 0x1F38 PUSH2 0x43DE JUMP JUMPDEST PUSH2 0x1F41 DUP3 PUSH2 0x36D1 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP4 ADD DUP3 SWAP1 MSTORE PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x4 SWAP1 MSTORE PUSH1 0x40 SWAP1 DUP2 SWAP1 KECCAK256 SLOAD SWAP1 DUP3 ADD MSTORE PUSH1 0x80 DUP3 ADD MLOAD ISZERO ISZERO PUSH2 0x1F75 JUMPI PUSH1 0x1 JUMPDEST PUSH1 0xFF AND DUP2 MSTORE PUSH2 0xF07 JUMP JUMPDEST PUSH1 0xA0 DUP3 ADD MLOAD ISZERO ISZERO PUSH2 0x1F87 JUMPI PUSH1 0x2 PUSH2 0x1F6B JUMP JUMPDEST PUSH1 0xA0 DUP3 ADD MLOAD PUSH1 0x40 DUP3 ADD MLOAD LT PUSH2 0x1F9D JUMPI PUSH1 0x5 PUSH2 0x1F6B JUMP JUMPDEST PUSH2 0x100 DUP3 ADD MLOAD TIMESTAMP LT PUSH2 0x1FB0 JUMPI PUSH1 0x4 PUSH2 0x1F6B JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 ADD MLOAD PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x5 SWAP1 SWAP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x1FD4 JUMPI PUSH1 0x6 PUSH2 0x1F6B JUMP JUMPDEST PUSH2 0x120 DUP3 ADD MLOAD DUP3 MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 DUP2 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x6 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 PUSH1 0x60 DUP9 ADD MLOAD SWAP1 SWAP5 AND DUP4 MSTORE SWAP3 SWAP1 MSTORE KECCAK256 SLOAD GT ISZERO PUSH2 0x2021 JUMPI PUSH1 0x6 PUSH2 0x1F6B JUMP JUMPDEST PUSH1 0x3 DUP2 MSTORE SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x2067 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x576D JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR SWAP1 SSTORE PUSH2 0x209B DUP2 PUSH2 0x2EFF JUMP JUMPDEST POP PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE JUMP JUMPDEST PUSH1 0x6 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x0 SWAP3 DUP4 MSTORE PUSH1 0x40 DUP1 DUP5 KECCAK256 SWAP1 SWAP2 MSTORE SWAP1 DUP3 MSTORE SWAP1 KECCAK256 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x1 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 PUSH1 0x2 DUP5 DUP7 AND ISZERO PUSH2 0x100 MUL PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 SWAP5 AND SWAP4 SWAP1 SWAP4 DIV PUSH1 0x1F DUP2 ADD DUP5 SWAP1 DIV DUP5 MUL DUP3 ADD DUP5 ADD SWAP1 SWAP3 MSTORE DUP2 DUP2 MSTORE SWAP3 SWAP2 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0x2186 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x215B JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x2186 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x2169 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP DUP2 JUMP JUMPDEST PUSH2 0x2196 PUSH2 0x4386 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x0 DUP1 PUSH1 0x0 PUSH2 0x21A5 PUSH2 0x4386 JUMP JUMPDEST DUP9 PUSH1 0x0 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x21B4 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x160 ADD MLOAD SWAP5 POP DUP9 MLOAD SWAP4 POP PUSH1 0x0 SWAP3 POP JUMPDEST DUP3 DUP5 EQ PUSH2 0x2257 JUMPI DUP5 DUP10 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x21E4 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x160 ADD DUP2 SWAP1 MSTORE POP PUSH2 0x2204 DUP9 DUP8 PUSH1 0x20 ADD MLOAD PUSH2 0x2F7D JUMP JUMPDEST SWAP2 POP PUSH2 0x2230 DUP10 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x2217 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP4 DUP10 DUP7 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xE8E JUMPI INVALID JUMPDEST SWAP1 POP PUSH2 0x223C DUP7 DUP3 PUSH2 0x257D JUMP JUMPDEST PUSH1 0x20 DUP7 ADD MLOAD DUP9 GT PUSH2 0x224C JUMPI PUSH2 0x2257 JUMP JUMPDEST PUSH1 0x1 SWAP1 SWAP3 ADD SWAP2 PUSH2 0x21CE JUMP JUMPDEST POP POP POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x2 SLOAD DUP2 JUMP JUMPDEST PUSH2 0x2271 PUSH2 0x4386 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH2 0x2281 PUSH2 0x4386 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x22BE JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x576D JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR DUP2 SSTORE DUP11 MLOAD DUP12 SWAP2 SWAP1 DUP2 LT PUSH2 0x22F6 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x140 ADD MLOAD SWAP6 POP DUP10 MLOAD SWAP5 POP PUSH1 0x0 SWAP4 POP JUMPDEST DUP4 DUP6 EQ PUSH2 0x23A5 JUMPI DUP6 DUP11 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x2326 JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD MLOAD PUSH2 0x140 ADD MSTORE DUP7 MLOAD PUSH2 0x2342 SWAP1 DUP11 SWAP1 PUSH2 0x2F7D JUMP JUMPDEST SWAP3 POP PUSH2 0x2355 DUP11 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1964 JUMPI INVALID JUMPDEST SWAP2 POP PUSH2 0x2381 DUP11 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x2368 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP4 DUP11 DUP8 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x749 JUMPI INVALID JUMPDEST SWAP1 POP PUSH2 0x238D DUP8 DUP3 PUSH2 0x257D JUMP JUMPDEST DUP7 MLOAD DUP10 GT PUSH2 0x239A JUMPI PUSH2 0x23A5 JUMP JUMPDEST PUSH1 0x1 SWAP1 SWAP4 ADD SWAP3 PUSH2 0x2310 JUMP JUMPDEST POP POP PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE POP SWAP3 SWAP7 SWAP6 POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0xA SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x3 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0x2448 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x577D JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND ISZERO PUSH2 0x24A5 JUMPI PUSH1 0x3 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND OR SWAP1 SSTORE JUMPDEST POP JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD DUP1 DUP3 ADD SWAP1 SWAP2 MSTORE PUSH1 0xB DUP2 MSTORE PUSH32 0x322E302E312D616C706861000000000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE DUP2 JUMP JUMPDEST PUSH2 0x24E7 PUSH2 0x4386 JUMP JUMPDEST PUSH2 0x24EF PUSH2 0x43DE JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH2 0x24FD DUP9 PUSH2 0x1F30 JUMP JUMPDEST SWAP4 POP PUSH2 0x2507 PUSH2 0x25DF JUMP JUMPDEST SWAP3 POP PUSH2 0x2515 DUP9 DUP6 DUP6 DUP10 PUSH2 0x2611 JUMP JUMPDEST PUSH2 0x2527 DUP9 PUSH1 0xA0 ADD MLOAD DUP6 PUSH1 0x40 ADD MLOAD PUSH2 0x2F7D JUMP JUMPDEST SWAP2 POP PUSH2 0x2533 DUP8 DUP4 PUSH2 0x36DF JUMP JUMPDEST SWAP1 POP PUSH2 0x2546 DUP9 DUP6 DUP10 DUP5 DUP10 PUSH1 0x0 ADD MLOAD PUSH2 0x2990 JUMP JUMPDEST PUSH2 0x2550 DUP9 DUP3 PUSH2 0x36F5 JUMP JUMPDEST SWAP5 POP PUSH2 0x2567 DUP9 DUP5 DUP7 PUSH1 0x20 ADD MLOAD DUP8 PUSH1 0x40 ADD MLOAD DUP10 PUSH2 0x2AA9 JUMP JUMPDEST PUSH2 0x2572 DUP9 DUP5 DUP8 PUSH2 0x3756 JUMP JUMPDEST POP POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST DUP2 MLOAD DUP2 MLOAD PUSH2 0x258B SWAP2 SWAP1 PUSH2 0x3864 JUMP JUMPDEST DUP3 MSTORE PUSH1 0x20 DUP1 DUP4 ADD MLOAD SWAP1 DUP3 ADD MLOAD PUSH2 0x25A1 SWAP2 SWAP1 PUSH2 0x3864 JUMP JUMPDEST PUSH1 0x20 DUP4 ADD MSTORE PUSH1 0x40 DUP1 DUP4 ADD MLOAD SWAP1 DUP3 ADD MLOAD PUSH2 0x25BA SWAP2 SWAP1 PUSH2 0x3864 JUMP JUMPDEST PUSH1 0x40 DUP4 ADD MSTORE PUSH1 0x60 DUP1 DUP4 ADD MLOAD SWAP1 DUP3 ADD MLOAD PUSH2 0x25D3 SWAP2 SWAP1 PUSH2 0x3864 JUMP JUMPDEST PUSH1 0x60 SWAP1 SWAP3 ADD SWAP2 SWAP1 SWAP2 MSTORE POP JUMP JUMPDEST PUSH1 0xA SLOAD PUSH1 0x0 SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 DUP2 ISZERO PUSH2 0x2608 JUMPI DUP2 PUSH2 0x260A JUMP JUMPDEST CALLER JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST DUP3 MLOAD PUSH1 0xFF AND PUSH1 0x3 EQ PUSH2 0x264F JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x579D JUMP JUMPDEST PUSH1 0x60 DUP5 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND ISZERO PUSH2 0x26C2 JUMPI PUSH1 0x60 DUP5 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0x26C2 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x57AD JUMP JUMPDEST PUSH1 0x20 DUP5 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND ISZERO PUSH2 0x274D JUMPI DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP5 PUSH1 0x20 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x274D JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x55ED JUMP JUMPDEST PUSH1 0x40 DUP4 ADD MLOAD ISZERO ISZERO PUSH2 0x27A3 JUMPI PUSH2 0x276B DUP4 PUSH1 0x20 ADD MLOAD DUP6 PUSH1 0x0 ADD MLOAD DUP4 PUSH2 0x135B JUMP JUMPDEST ISZERO ISZERO PUSH2 0x27A3 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x565D JUMP JUMPDEST POP POP POP POP JUMP JUMPDEST PUSH2 0x27BB DUP3 PUSH1 0xA0 ADD MLOAD DUP3 PUSH1 0xA0 ADD MLOAD PUSH2 0x38AE JUMP JUMPDEST PUSH2 0x27CD DUP4 PUSH1 0x80 ADD MLOAD DUP4 PUSH1 0x80 ADD MLOAD PUSH2 0x38AE JUMP JUMPDEST LT ISZERO PUSH2 0x2805 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x57BD JUMP JUMPDEST POP POP JUMP JUMPDEST PUSH2 0x2811 PUSH2 0x43AF JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH2 0x2825 DUP10 PUSH1 0xA0 ADD MLOAD DUP9 PUSH2 0x2F7D JUMP JUMPDEST SWAP4 POP PUSH2 0x283A DUP10 PUSH1 0x80 ADD MLOAD DUP11 PUSH1 0xA0 ADD MLOAD DUP7 PUSH2 0x3909 JUMP JUMPDEST SWAP3 POP PUSH2 0x284A DUP9 PUSH1 0xA0 ADD MLOAD DUP8 PUSH2 0x2F7D JUMP JUMPDEST SWAP2 POP PUSH2 0x285F DUP9 PUSH1 0x80 ADD MLOAD DUP10 PUSH1 0xA0 ADD MLOAD DUP5 PUSH2 0x3909 JUMP JUMPDEST SWAP1 POP DUP1 DUP5 LT PUSH2 0x28A2 JUMPI PUSH1 0x20 DUP1 DUP7 ADD DUP1 MLOAD DUP4 SWAP1 MSTORE DUP1 MLOAD DUP3 ADD DUP5 SWAP1 MSTORE MLOAD MLOAD DUP7 MLOAD DUP3 ADD MSTORE PUSH1 0x80 DUP11 ADD MLOAD PUSH1 0xA0 DUP12 ADD MLOAD DUP8 MLOAD SWAP1 SWAP3 ADD MLOAD PUSH2 0x289A SWAP3 SWAP1 PUSH2 0x3909 JUMP JUMPDEST DUP6 MLOAD MSTORE PUSH2 0x28DF JUMP JUMPDEST DUP5 MLOAD DUP4 SWAP1 MSTORE DUP5 MLOAD PUSH1 0x20 SWAP1 DUP2 ADD DUP6 SWAP1 MSTORE DUP6 MLOAD DUP2 ADD MLOAD SWAP1 DUP7 ADD DUP1 MLOAD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0xA0 DUP10 ADD MLOAD PUSH1 0x80 DUP11 ADD MLOAD SWAP2 MLOAD MLOAD PUSH2 0x28D6 SWAP3 SWAP1 PUSH2 0x3986 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP8 ADD MLOAD ADD MSTORE JUMPDEST DUP5 MLOAD MLOAD PUSH1 0x20 DUP1 DUP8 ADD MLOAD ADD MLOAD PUSH2 0x28F4 SWAP2 SWAP1 PUSH2 0x2F7D JUMP JUMPDEST PUSH1 0x40 DUP7 ADD MSTORE DUP5 MLOAD MLOAD PUSH1 0x80 DUP11 ADD MLOAD PUSH1 0xC0 DUP12 ADD MLOAD PUSH2 0x2911 SWAP3 SWAP2 SWAP1 PUSH2 0x3909 JUMP JUMPDEST DUP6 MLOAD PUSH1 0x40 ADD MSTORE DUP5 MLOAD PUSH1 0x20 ADD MLOAD PUSH1 0xA0 DUP11 ADD MLOAD PUSH1 0xE0 DUP12 ADD MLOAD PUSH2 0x2932 SWAP3 SWAP2 SWAP1 PUSH2 0x3909 JUMP JUMPDEST DUP6 MLOAD PUSH1 0x60 ADD MSTORE PUSH1 0x20 DUP6 ADD MLOAD MLOAD PUSH1 0x80 DUP10 ADD MLOAD PUSH1 0xC0 DUP11 ADD MLOAD PUSH2 0x2953 SWAP3 SWAP2 SWAP1 PUSH2 0x3909 JUMP JUMPDEST DUP6 PUSH1 0x20 ADD MLOAD PUSH1 0x40 ADD DUP2 DUP2 MSTORE POP POP PUSH2 0x297B DUP6 PUSH1 0x20 ADD MLOAD PUSH1 0x20 ADD MLOAD DUP10 PUSH1 0xA0 ADD MLOAD DUP11 PUSH1 0xE0 ADD MLOAD PUSH2 0x3909 JUMP JUMPDEST PUSH1 0x20 DUP7 ADD MLOAD PUSH1 0x60 ADD MSTORE POP POP POP POP SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST DUP3 ISZERO ISZERO PUSH2 0x29C9 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x56DD JUMP JUMPDEST DUP3 DUP3 GT ISZERO PUSH2 0x2A03 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x56CD JUMP JUMPDEST DUP5 PUSH1 0xA0 ADD MLOAD PUSH2 0x2A16 DUP6 PUSH1 0x40 ADD MLOAD DUP5 PUSH2 0x3864 JUMP JUMPDEST GT ISZERO PUSH2 0x2A4E JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x55FD JUMP JUMPDEST PUSH2 0x2A5C DUP6 PUSH1 0x80 ADD MLOAD DUP4 PUSH2 0x38AE JUMP JUMPDEST PUSH2 0x2A6A DUP3 DUP8 PUSH1 0xA0 ADD MLOAD PUSH2 0x38AE JUMP JUMPDEST GT ISZERO PUSH2 0x2AA2 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x575D JUMP JUMPDEST POP POP POP POP POP JUMP JUMPDEST PUSH2 0x2AB7 DUP3 DUP3 PUSH1 0x20 ADD MLOAD PUSH2 0x3864 JUMP JUMPDEST PUSH1 0x0 DUP5 DUP2 MSTORE PUSH1 0x4 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP2 DUP3 SWAP1 KECCAK256 SWAP3 SWAP1 SWAP3 SSTORE DUP7 DUP2 ADD MLOAD DUP8 MLOAD DUP5 MLOAD SWAP4 DUP6 ADD MLOAD DUP6 DUP5 ADD MLOAD PUSH1 0x60 DUP8 ADD MLOAD PUSH2 0x140 DUP13 ADD MLOAD PUSH2 0x160 DUP14 ADD MLOAD SWAP7 MLOAD DUP12 SWAP9 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP8 DUP9 AND SWAP9 SWAP8 SWAP1 SWAP7 AND SWAP7 PUSH32 0xBCC4C97732E47D9946F229EDB95F5B6323F601300E4690DE719993F3C371129 SWAP7 PUSH2 0x2B46 SWAP7 DUP16 SWAP7 CALLER SWAP7 SWAP3 SWAP6 SWAP2 SWAP5 SWAP1 SWAP4 SWAP1 PUSH2 0x5433 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG4 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x1 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 PUSH1 0x1F PUSH1 0x2 PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH2 0x100 DUP8 DUP10 AND ISZERO MUL ADD SWAP1 SWAP6 AND SWAP5 SWAP1 SWAP5 DIV SWAP4 DUP5 ADD DUP2 SWAP1 DIV DUP2 MUL DUP3 ADD DUP2 ADD SWAP1 SWAP3 MSTORE DUP3 DUP2 MSTORE PUSH1 0x60 SWAP4 SWAP1 SWAP3 SWAP1 SWAP2 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0x2BFE JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x2BD3 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x2BFE JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x2BE1 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP1 POP PUSH2 0x2C26 DUP6 PUSH2 0x140 ADD MLOAD DUP7 PUSH1 0x0 ADD MLOAD DUP7 PUSH1 0x0 ADD MLOAD DUP6 PUSH1 0x20 ADD MLOAD PUSH1 0x20 ADD MLOAD PUSH2 0x3A23 JUMP JUMPDEST PUSH2 0x140 DUP5 ADD MLOAD DUP5 MLOAD DUP7 MLOAD DUP5 MLOAD PUSH1 0x20 ADD MLOAD PUSH2 0x2C42 SWAP4 SWAP3 SWAP2 SWAP1 PUSH2 0x3A23 JUMP JUMPDEST PUSH2 0x2C5B DUP6 PUSH2 0x140 ADD MLOAD DUP7 PUSH1 0x0 ADD MLOAD DUP6 DUP6 PUSH1 0x40 ADD MLOAD PUSH2 0x3A23 JUMP JUMPDEST PUSH2 0x2C77 DUP2 DUP7 PUSH1 0x0 ADD MLOAD DUP8 PUSH1 0x40 ADD MLOAD DUP6 PUSH1 0x0 ADD MLOAD PUSH1 0x40 ADD MLOAD PUSH2 0x3A23 JUMP JUMPDEST PUSH2 0x2C93 DUP2 DUP6 PUSH1 0x0 ADD MLOAD DUP7 PUSH1 0x40 ADD MLOAD DUP6 PUSH1 0x20 ADD MLOAD PUSH1 0x40 ADD MLOAD PUSH2 0x3A23 JUMP JUMPDEST DUP4 PUSH1 0x40 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP6 PUSH1 0x40 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0x2CFD JUMPI PUSH2 0x2CF8 DUP2 DUP5 DUP8 PUSH1 0x40 ADD MLOAD PUSH2 0x2CF3 DUP7 PUSH1 0x0 ADD MLOAD PUSH1 0x60 ADD MLOAD DUP8 PUSH1 0x20 ADD MLOAD PUSH1 0x60 ADD MLOAD PUSH2 0x3864 JUMP JUMPDEST PUSH2 0x3A23 JUMP JUMPDEST PUSH2 0x2AA2 JUMP JUMPDEST PUSH2 0x2D15 DUP2 DUP5 DUP8 PUSH1 0x40 ADD MLOAD DUP6 PUSH1 0x0 ADD MLOAD PUSH1 0x60 ADD MLOAD PUSH2 0x3A23 JUMP JUMPDEST PUSH2 0x2AA2 DUP2 DUP5 DUP7 PUSH1 0x40 ADD MLOAD DUP6 PUSH1 0x20 ADD MLOAD PUSH1 0x60 ADD MLOAD PUSH2 0x3A23 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0xB4BE83D500000000000000000000000000000000000000000000000000000000 PUSH1 0x20 DUP1 DUP4 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x60 PUSH1 0x24 DUP4 ADD DUP2 DUP2 MSTORE DUP8 MLOAD PUSH1 0x84 DUP6 ADD SWAP1 DUP2 MSTORE DUP9 DUP5 ADD MLOAD PUSH1 0xA4 DUP7 ADD MSTORE SWAP5 DUP9 ADD MLOAD PUSH1 0xC4 DUP6 ADD MSTORE SWAP1 DUP8 ADD MLOAD PUSH1 0xE4 DUP5 ADD MSTORE PUSH1 0x80 DUP8 ADD MLOAD PUSH2 0x104 DUP5 ADD MSTORE PUSH1 0xA0 DUP8 ADD MLOAD PUSH2 0x124 DUP5 ADD MSTORE PUSH1 0xC0 DUP8 ADD MLOAD PUSH2 0x144 DUP5 ADD MSTORE PUSH1 0xE0 DUP8 ADD MLOAD PUSH2 0x164 DUP5 ADD MSTORE PUSH2 0x100 DUP8 ADD MLOAD PUSH2 0x184 DUP5 ADD MSTORE PUSH2 0x120 DUP8 ADD MLOAD PUSH2 0x1A4 DUP5 ADD MSTORE PUSH2 0x140 DUP8 ADD DUP1 MLOAD PUSH2 0x1C4 DUP6 ADD SWAP1 DUP2 MSTORE PUSH2 0x160 DUP10 ADD MLOAD PUSH2 0x1E4 DUP7 ADD MSTORE PUSH2 0x180 SWAP1 MSTORE MLOAD DUP1 MLOAD PUSH2 0x204 DUP6 ADD DUP2 SWAP1 MSTORE SWAP4 SWAP5 SWAP2 SWAP4 DUP5 SWAP4 PUSH1 0x44 DUP8 ADD SWAP3 DUP5 SWAP3 PUSH2 0x224 DUP10 ADD SWAP3 SWAP2 DUP3 ADD SWAP2 PUSH1 0x1F DUP3 ADD DIV PUSH1 0x0 JUMPDEST DUP2 DUP2 LT ISZERO PUSH2 0x2E34 JUMPI DUP4 MLOAD DUP6 MSTORE PUSH1 0x20 SWAP5 DUP6 ADD SWAP5 SWAP1 SWAP4 ADD SWAP3 PUSH1 0x1 ADD PUSH2 0x2E16 JUMP JUMPDEST POP POP POP POP DUP2 DUP2 SUB PUSH2 0x160 DUP1 DUP5 ADD SWAP2 SWAP1 SWAP2 MSTORE DUP11 ADD MLOAD DUP1 MLOAD DUP1 DUP4 MSTORE PUSH1 0x20 SWAP3 DUP4 ADD SWAP3 SWAP2 DUP3 ADD SWAP2 PUSH1 0x1F DUP3 ADD DIV PUSH1 0x0 JUMPDEST DUP2 DUP2 LT ISZERO PUSH2 0x2E7D JUMPI DUP4 MLOAD DUP6 MSTORE PUSH1 0x20 SWAP5 DUP6 ADD SWAP5 SWAP1 SWAP4 ADD SWAP3 PUSH1 0x1 ADD PUSH2 0x2E5F JUMP JUMPDEST POP POP POP DUP10 DUP5 MSTORE POP DUP5 DUP2 SUB PUSH1 0x20 SWAP4 DUP5 ADD SWAP1 DUP2 MSTORE DUP9 MLOAD DUP1 DUP4 MSTORE SWAP1 SWAP4 SWAP2 DUP3 ADD SWAP2 DUP10 DUP2 ADD SWAP2 SWAP1 PUSH1 0x1F DUP3 ADD DIV PUSH1 0x0 JUMPDEST DUP2 DUP2 LT ISZERO PUSH2 0x2EC5 JUMPI DUP4 MLOAD DUP6 MSTORE PUSH1 0x20 SWAP5 DUP6 ADD SWAP5 SWAP1 SWAP4 ADD SWAP3 PUSH1 0x1 ADD PUSH2 0x2EA7 JUMP JUMPDEST POP POP POP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 DUP9 DUP4 SUB ADD DUP9 MSTORE POP PUSH1 0x40 MSTORE POP POP POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH2 0x2F07 PUSH2 0x43DE JUMP JUMPDEST PUSH2 0x2F10 DUP3 PUSH2 0x1F30 JUMP JUMPDEST SWAP1 POP PUSH2 0x2F1C DUP3 DUP3 PUSH2 0x3BED JUMP JUMPDEST PUSH2 0x2805 DUP3 DUP3 PUSH1 0x20 ADD MLOAD PUSH2 0x3D04 JUMP JUMPDEST PUSH2 0x2F32 PUSH2 0x4386 JUMP JUMPDEST PUSH2 0x2F3D DUP5 DUP5 DUP5 PUSH2 0x24DF JUMP JUMPDEST PUSH1 0x20 DUP2 ADD MLOAD SWAP1 SWAP2 POP DUP4 EQ PUSH2 0x260A JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x574D JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 GT ISZERO PUSH2 0x2FB9 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x560D JUMP JUMPDEST POP DUP1 DUP3 SUB JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP3 MLOAD GT ISZERO ISZERO PUSH2 0x3002 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x56FD JUMP JUMPDEST DUP2 MLOAD DUP3 SWAP1 PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 ADD SWAP1 DUP2 LT PUSH2 0x3032 JUMPI INVALID JUMPDEST ADD PUSH1 0x20 ADD MLOAD DUP3 MLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 SWAP3 MSTORE POP PUSH32 0x100000000000000000000000000000000000000000000000000000000000000 SWAP1 DUP2 SWAP1 DIV MUL SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x20 ADD DUP4 MLOAD LT ISZERO ISZERO ISZERO PUSH2 0x30CA JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x562D JUMP JUMPDEST POP ADD PUSH1 0x20 ADD MLOAD SWAP1 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x0 SWAP1 PUSH1 0x60 SWAP1 PUSH32 0x1626BA7E00000000000000000000000000000000000000000000000000000000 SWAP1 PUSH2 0x310E SWAP1 DUP8 SWAP1 DUP7 SWAP1 PUSH1 0x24 ADD PUSH2 0x554E JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 DUP2 DUP5 SUB ADD DUP2 MSTORE SWAP2 SWAP1 MSTORE PUSH1 0x20 DUP1 DUP3 ADD DUP1 MLOAD PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 SWAP1 SWAP5 AND SWAP4 SWAP1 SWAP4 OR DUP4 MSTORE DUP2 MLOAD SWAP2 SWAP4 POP SWAP1 DUP3 SWAP1 DUP2 DUP9 GAS STATICCALL DUP1 DUP1 ISZERO PUSH2 0x31AB JUMPI PUSH1 0x1 DUP2 EQ PUSH2 0x321C JUMPI PUSH2 0x2572 JUMP JUMPDEST PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH29 0x2000000000000000000000000000000000000000000000000000000000 PUSH1 0x20 MSTORE PUSH29 0xC57414C4C45545F4552524F5200000000000000000000000000000000 PUSH1 0x40 MSTORE PUSH1 0x0 PUSH1 0x60 MSTORE PUSH1 0x64 PUSH1 0x0 REVERT JUMPDEST POP POP MLOAD SWAP6 SWAP5 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x14 DUP3 MLOAD LT ISZERO ISZERO ISZERO PUSH2 0x3268 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x578D JUMP JUMPDEST PUSH2 0x3276 DUP3 PUSH1 0x14 DUP5 MLOAD SUB PUSH2 0x3DAB JUMP JUMPDEST DUP3 MLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEC ADD SWAP1 SWAP3 MSTORE POP SWAP1 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x0 SWAP1 PUSH1 0x60 SWAP1 PUSH32 0x9363470200000000000000000000000000000000000000000000000000000000 SWAP1 PUSH2 0x32DE SWAP1 DUP8 SWAP1 DUP8 SWAP1 DUP8 SWAP1 PUSH1 0x24 ADD PUSH2 0x5521 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 DUP2 DUP5 SUB ADD DUP2 MSTORE SWAP2 SWAP1 MSTORE PUSH1 0x20 DUP1 DUP3 ADD DUP1 MLOAD PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 SWAP1 SWAP5 AND SWAP4 SWAP1 SWAP4 OR DUP4 MSTORE DUP2 MLOAD SWAP2 SWAP4 POP SWAP1 DUP3 SWAP1 DUP2 DUP11 GAS STATICCALL DUP1 DUP1 ISZERO PUSH2 0x337B JUMPI PUSH1 0x1 DUP2 EQ PUSH2 0x33EC JUMPI PUSH2 0x33F1 JUMP JUMPDEST PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH29 0x2000000000000000000000000000000000000000000000000000000000 PUSH1 0x20 MSTORE PUSH29 0xF56414C494441544F525F4552524F5200000000000000000000000000 PUSH1 0x40 MSTORE PUSH1 0x0 PUSH1 0x60 MSTORE PUSH1 0x64 PUSH1 0x0 REVERT JUMPDEST DUP3 MLOAD SWAP5 POP JUMPDEST POP POP POP POP SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP4 GT PUSH2 0x3438 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x564D JUMP JUMPDEST PUSH2 0x344B PUSH2 0x3445 DUP6 DUP5 PUSH2 0x38AE JUMP JUMPDEST DUP5 PUSH2 0x3E0C JUMP JUMPDEST SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0x5A65726F45785472616E73616374696F6E280000000000000000000000000000 PUSH1 0x20 DUP1 DUP4 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH32 0x75696E743235362073616C742C00000000000000000000000000000000000000 PUSH1 0x32 DUP4 ADD MSTORE PUSH32 0x61646472657373207369676E6572416464726573732C00000000000000000000 PUSH1 0x3F DUP4 ADD MSTORE PUSH32 0x6279746573206461746100000000000000000000000000000000000000000000 PUSH1 0x55 DUP4 ADD MSTORE PUSH32 0x2900000000000000000000000000000000000000000000000000000000000000 PUSH1 0x5F DUP4 ADD MSTORE DUP3 MLOAD DUP1 DUP4 SUB DUP5 ADD DUP2 MSTORE PUSH1 0x60 SWAP1 SWAP3 ADD SWAP3 DUP4 SWAP1 MSTORE DUP2 MLOAD PUSH1 0x0 SWAP4 DUP5 SWAP4 DUP5 SWAP4 SWAP1 SWAP3 DUP3 SWAP2 DUP5 ADD SWAP1 DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT PUSH2 0x357C JUMPI DUP1 MLOAD DUP3 MSTORE PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 SWAP1 SWAP3 ADD SWAP2 PUSH1 0x20 SWAP2 DUP3 ADD SWAP2 ADD PUSH2 0x353F JUMP JUMPDEST MLOAD DUP2 MLOAD PUSH1 0x20 SWAP4 DUP5 SUB PUSH2 0x100 EXP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD DUP1 NOT SWAP1 SWAP3 AND SWAP2 AND OR SWAP1 MSTORE PUSH1 0x40 MLOAD SWAP2 SWAP1 SWAP4 ADD DUP2 SWAP1 SUB DUP2 KECCAK256 DUP10 MLOAD SWAP1 SWAP8 POP DUP10 SWAP6 POP SWAP1 SWAP4 POP DUP4 SWAP3 DUP6 ADD SWAP2 POP DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT PUSH2 0x3612 JUMPI DUP1 MLOAD DUP3 MSTORE PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 SWAP1 SWAP3 ADD SWAP2 PUSH1 0x20 SWAP2 DUP3 ADD SWAP2 ADD PUSH2 0x35D5 JUMP JUMPDEST MLOAD DUP2 MLOAD PUSH1 0x20 SWAP4 DUP5 SUB PUSH2 0x100 EXP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD DUP1 NOT SWAP1 SWAP3 AND SWAP2 AND OR SWAP1 MSTORE PUSH1 0x40 DUP1 MLOAD SWAP3 SWAP1 SWAP5 ADD DUP3 SWAP1 SUB DUP3 KECCAK256 SWAP8 DUP3 MSTORE DUP2 ADD SWAP11 SWAP1 SWAP11 MSTORE POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP8 SWAP1 SWAP8 AND SWAP7 DUP9 ADD SWAP7 SWAP1 SWAP7 MSTORE POP POP PUSH1 0x60 DUP6 ADD MSTORE POP POP PUSH1 0x80 SWAP1 SWAP2 KECCAK256 SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x2 DUP1 SLOAD PUSH1 0x40 MLOAD PUSH32 0x1901000000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE SWAP2 DUP3 ADD MSTORE PUSH1 0x22 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x42 SWAP1 KECCAK256 SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x2FBE PUSH2 0x1AFD DUP4 PUSH2 0x3E23 JUMP JUMPDEST PUSH1 0x0 DUP2 DUP4 LT PUSH2 0x36EE JUMPI DUP2 PUSH2 0x260A JUMP JUMPDEST POP SWAP1 SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0x36FD PUSH2 0x4386 JUMP JUMPDEST PUSH1 0x20 DUP2 ADD DUP3 SWAP1 MSTORE PUSH1 0xA0 DUP4 ADD MLOAD PUSH1 0x80 DUP5 ADD MLOAD PUSH2 0x3719 SWAP2 DUP5 SWAP2 PUSH2 0x3909 JUMP JUMPDEST DUP1 DUP3 MSTORE PUSH1 0x80 DUP5 ADD MLOAD PUSH1 0xC0 DUP6 ADD MLOAD PUSH2 0x3731 SWAP3 SWAP2 SWAP1 PUSH2 0x3909 JUMP JUMPDEST PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0xA0 DUP4 ADD MLOAD PUSH1 0xE0 DUP5 ADD MLOAD PUSH2 0x374B SWAP2 DUP5 SWAP2 PUSH2 0x3909 JUMP JUMPDEST PUSH1 0x60 DUP3 ADD MSTORE SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x1 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 PUSH1 0x1F PUSH1 0x2 PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH2 0x100 DUP8 DUP10 AND ISZERO MUL ADD SWAP1 SWAP6 AND SWAP5 SWAP1 SWAP5 DIV SWAP4 DUP5 ADD DUP2 SWAP1 DIV DUP2 MUL DUP3 ADD DUP2 ADD SWAP1 SWAP3 MSTORE DUP3 DUP2 MSTORE PUSH1 0x60 SWAP4 SWAP1 SWAP3 SWAP1 SWAP2 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0x37FF JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x37D4 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x37FF JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x37E2 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP1 POP PUSH2 0x381F DUP5 PUSH2 0x140 ADD MLOAD DUP6 PUSH1 0x0 ADD MLOAD DUP6 DUP6 PUSH1 0x0 ADD MLOAD PUSH2 0x3A23 JUMP JUMPDEST PUSH2 0x3838 DUP5 PUSH2 0x160 ADD MLOAD DUP5 DUP7 PUSH1 0x0 ADD MLOAD DUP6 PUSH1 0x20 ADD MLOAD PUSH2 0x3A23 JUMP JUMPDEST PUSH2 0x3850 DUP2 DUP6 PUSH1 0x0 ADD MLOAD DUP7 PUSH1 0x40 ADD MLOAD DUP6 PUSH1 0x40 ADD MLOAD PUSH2 0x3A23 JUMP JUMPDEST PUSH2 0x27A3 DUP2 DUP5 DUP7 PUSH1 0x40 ADD MLOAD DUP6 PUSH1 0x60 ADD MLOAD PUSH2 0x3A23 JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 ADD DUP4 DUP2 LT ISZERO PUSH2 0x38A3 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x567D JUMP JUMPDEST DUP1 SWAP2 POP JUMPDEST POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP4 ISZERO ISZERO PUSH2 0x38C1 JUMPI PUSH1 0x0 SWAP2 POP PUSH2 0x38A7 JUMP JUMPDEST POP DUP3 DUP3 MUL DUP3 DUP5 DUP3 DUP2 ISZERO ISZERO PUSH2 0x38D1 JUMPI INVALID JUMPDEST DIV EQ PUSH2 0x38A3 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x567D JUMP JUMPDEST PUSH1 0x0 DUP1 DUP4 GT PUSH2 0x3944 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x564D JUMP JUMPDEST PUSH2 0x394F DUP5 DUP5 DUP5 PUSH2 0x427C JUMP JUMPDEST ISZERO PUSH2 0x3438 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x56AD JUMP JUMPDEST PUSH1 0x0 DUP1 DUP4 GT PUSH2 0x39C1 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x564D JUMP JUMPDEST PUSH2 0x39CC DUP5 DUP5 DUP5 PUSH2 0x4301 JUMP JUMPDEST ISZERO PUSH2 0x3A03 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x56AD JUMP JUMPDEST PUSH2 0x344B PUSH2 0x3445 PUSH2 0x3A13 DUP7 DUP6 PUSH2 0x38AE JUMP JUMPDEST PUSH2 0x3A1E DUP7 PUSH1 0x1 PUSH2 0x2F7D JUMP JUMPDEST PUSH2 0x3864 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP4 GT DUP1 ISZERO PUSH2 0x3A62 JUMPI POP DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO JUMPDEST ISZERO PUSH2 0x3BE5 JUMPI DUP6 MLOAD PUSH1 0x3 LT PUSH2 0x3AA2 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x573D JUMP JUMPDEST POP POP PUSH1 0x20 DUP5 DUP2 ADD MLOAD PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0xB SWAP1 SWAP3 MSTORE PUSH1 0x40 SWAP1 SWAP2 KECCAK256 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP1 ISZERO ISZERO PUSH2 0x3B2B JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x56ED JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH7 0xFFFFFFFFFFFE0 PUSH1 0x3F DUP9 MLOAD ADD AND DUP1 PUSH1 0x84 ADD DUP3 ADD PUSH32 0xA85E59E400000000000000000000000000000000000000000000000000000000 DUP4 MSTORE PUSH1 0x80 PUSH1 0x4 DUP5 ADD MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP9 AND PUSH1 0x24 DUP5 ADD MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 AND PUSH1 0x44 DUP5 ADD MSTORE DUP6 PUSH1 0x64 DUP5 ADD MSTORE PUSH1 0x84 DUP4 ADD JUMPDEST DUP2 DUP2 LT ISZERO PUSH2 0x3BC7 JUMPI DUP10 MLOAD DUP2 MSTORE PUSH1 0x20 SWAP10 DUP11 ADD SWAP10 ADD PUSH2 0x3BAF JUMP JUMPDEST PUSH2 0x200 DUP5 DUP6 DUP5 SUB DUP7 PUSH1 0x0 DUP10 GAS CALL DUP1 ISZERO ISZERO PUSH2 0x3BDF JUMPI RETURNDATASIZE DUP6 REVERT JUMPDEST POP POP POP POP POP JUMPDEST POP POP POP POP POP POP JUMP JUMPDEST DUP1 MLOAD PUSH1 0x0 SWAP1 PUSH1 0xFF AND PUSH1 0x3 EQ PUSH2 0x3C2E JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x579D JUMP JUMPDEST PUSH1 0x60 DUP4 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND ISZERO PUSH2 0x3CA1 JUMPI PUSH1 0x60 DUP4 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0x3CA1 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x57AD JUMP JUMPDEST PUSH2 0x3CA9 PUSH2 0x25DF JUMP JUMPDEST DUP4 MLOAD SWAP1 SWAP2 POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP4 AND SWAP2 AND EQ PUSH2 0x3CFF JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x566D JUMP JUMPDEST POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x5 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 DUP2 SWAP1 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR SWAP1 SSTORE DUP3 DUP2 ADD MLOAD DUP4 MLOAD PUSH2 0x140 DUP6 ADD MLOAD PUSH2 0x160 DUP7 ADD MLOAD SWAP4 MLOAD DUP6 SWAP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP5 DUP6 AND SWAP5 SWAP4 SWAP1 SWAP4 AND SWAP3 PUSH32 0xDC47B3613D9FE400085F6DBDC99453462279057E6207385042827ED6B1A62CF7 SWAP3 PUSH2 0x3D9F SWAP3 CALLER SWAP3 SWAP1 PUSH2 0x54B7 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG4 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x14 ADD DUP4 MLOAD LT ISZERO ISZERO ISZERO PUSH2 0x3DED JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x578D JUMP JUMPDEST POP ADD PUSH1 0x14 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 DUP3 DUP5 DUP2 ISZERO ISZERO PUSH2 0x3E1A JUMPI INVALID JUMPDEST DIV SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0x4F72646572280000000000000000000000000000000000000000000000000000 PUSH1 0x20 DUP1 DUP4 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH32 0x61646472657373206D616B6572416464726573732C0000000000000000000000 PUSH1 0x26 DUP4 ADD MSTORE PUSH32 0x616464726573732074616B6572416464726573732C0000000000000000000000 PUSH1 0x3B DUP4 ADD MSTORE PUSH32 0x6164647265737320666565526563697069656E74416464726573732C00000000 PUSH1 0x50 DUP4 ADD MSTORE PUSH32 0x616464726573732073656E646572416464726573732C00000000000000000000 PUSH1 0x6C DUP4 ADD MSTORE PUSH32 0x75696E74323536206D616B65724173736574416D6F756E742C00000000000000 PUSH1 0x82 DUP4 ADD MSTORE PUSH32 0x75696E743235362074616B65724173736574416D6F756E742C00000000000000 PUSH1 0x9B DUP4 ADD MSTORE PUSH32 0x75696E74323536206D616B65724665652C000000000000000000000000000000 PUSH1 0xB4 DUP4 ADD MSTORE PUSH32 0x75696E743235362074616B65724665652C000000000000000000000000000000 PUSH1 0xC5 DUP4 ADD MSTORE PUSH32 0x75696E743235362065787069726174696F6E54696D655365636F6E64732C0000 PUSH1 0xD6 DUP4 ADD MSTORE PUSH32 0x75696E743235362073616C742C00000000000000000000000000000000000000 PUSH1 0xF4 DUP4 ADD MSTORE PUSH32 0x6279746573206D616B65724173736574446174612C0000000000000000000000 PUSH2 0x101 DUP4 ADD MSTORE PUSH32 0x62797465732074616B6572417373657444617461000000000000000000000000 PUSH2 0x116 DUP4 ADD MSTORE PUSH32 0x2900000000000000000000000000000000000000000000000000000000000000 PUSH2 0x12A DUP4 ADD MSTORE DUP3 MLOAD PUSH2 0x10B DUP2 DUP5 SUB ADD DUP2 MSTORE PUSH2 0x12B SWAP1 SWAP3 ADD SWAP3 DUP4 SWAP1 MSTORE DUP2 MLOAD PUSH1 0x0 SWAP4 DUP5 SWAP4 DUP5 SWAP4 DUP5 SWAP4 SWAP2 SWAP3 SWAP2 DUP3 SWAP2 DUP5 ADD SWAP1 DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT PUSH2 0x40AB JUMPI DUP1 MLOAD DUP3 MSTORE PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 SWAP1 SWAP3 ADD SWAP2 PUSH1 0x20 SWAP2 DUP3 ADD SWAP2 ADD PUSH2 0x406E JUMP JUMPDEST MLOAD DUP2 MLOAD PUSH1 0x20 SWAP4 DUP5 SUB PUSH2 0x100 EXP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD DUP1 NOT SWAP1 SWAP3 AND SWAP2 AND OR SWAP1 MSTORE PUSH1 0x40 MLOAD SWAP2 SWAP1 SWAP4 ADD DUP2 SWAP1 SUB DUP2 KECCAK256 PUSH2 0x140 DUP12 ADD MLOAD DUP1 MLOAD SWAP2 SWAP10 POP SWAP6 POP SWAP1 SWAP4 POP DUP4 SWAP3 DUP6 ADD SWAP2 POP DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT PUSH2 0x4146 JUMPI DUP1 MLOAD DUP3 MSTORE PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 SWAP1 SWAP3 ADD SWAP2 PUSH1 0x20 SWAP2 DUP3 ADD SWAP2 ADD PUSH2 0x4109 JUMP JUMPDEST MLOAD DUP2 MLOAD PUSH1 0x20 SWAP4 DUP5 SUB PUSH2 0x100 EXP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD DUP1 NOT SWAP1 SWAP3 AND SWAP2 AND OR SWAP1 MSTORE PUSH1 0x40 MLOAD SWAP2 SWAP1 SWAP4 ADD DUP2 SWAP1 SUB DUP2 KECCAK256 PUSH2 0x160 DUP12 ADD MLOAD DUP1 MLOAD SWAP2 SWAP9 POP SWAP6 POP SWAP1 SWAP4 POP DUP4 SWAP3 DUP6 ADD SWAP2 POP DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT PUSH2 0x41E1 JUMPI DUP1 MLOAD DUP3 MSTORE PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 SWAP1 SWAP3 ADD SWAP2 PUSH1 0x20 SWAP2 DUP3 ADD SWAP2 ADD PUSH2 0x41A4 JUMP JUMPDEST MLOAD DUP2 MLOAD PUSH1 0x20 SWAP4 SWAP1 SWAP4 SUB PUSH2 0x100 EXP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD DUP1 NOT SWAP1 SWAP2 AND SWAP3 AND SWAP2 SWAP1 SWAP2 OR SWAP1 MSTORE PUSH1 0x40 MLOAD SWAP3 ADD DUP3 SWAP1 SUB SWAP1 SWAP2 KECCAK256 PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 DUP10 ADD DUP1 MLOAD PUSH2 0x140 DUP12 ADD DUP1 MLOAD PUSH2 0x160 SWAP1 SWAP13 ADD DUP1 MLOAD SWAP11 DUP5 MSTORE SWAP9 DUP2 MSTORE SWAP3 DUP9 MSTORE PUSH2 0x1A0 DUP3 KECCAK256 SWAP2 MSTORE SWAP9 SWAP1 MSTORE POP POP POP SWAP2 SWAP1 MSTORE POP SWAP1 SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP1 DUP5 GT PUSH2 0x42B8 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x564D JUMP JUMPDEST DUP3 ISZERO DUP1 PUSH2 0x42C3 JUMPI POP DUP5 ISZERO JUMPDEST ISZERO PUSH2 0x42D1 JUMPI PUSH1 0x0 SWAP2 POP PUSH2 0xA88 JUMP JUMPDEST DUP4 DUP1 ISZERO ISZERO PUSH2 0x42DB JUMPI INVALID JUMPDEST DUP6 DUP5 MULMOD SWAP1 POP PUSH2 0x42EA DUP6 DUP5 PUSH2 0x38AE JUMP JUMPDEST PUSH2 0x42F6 PUSH2 0x3E8 DUP4 PUSH2 0x38AE JUMP JUMPDEST LT ISZERO SWAP6 SWAP5 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP1 DUP5 GT PUSH2 0x433D JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x564D JUMP JUMPDEST DUP3 ISZERO DUP1 PUSH2 0x4348 JUMPI POP DUP5 ISZERO JUMPDEST ISZERO PUSH2 0x4356 JUMPI PUSH1 0x0 SWAP2 POP PUSH2 0xA88 JUMP JUMPDEST DUP4 DUP1 ISZERO ISZERO PUSH2 0x4360 JUMPI INVALID JUMPDEST DUP6 DUP5 MULMOD SWAP1 POP DUP4 PUSH2 0x4370 DUP6 DUP4 PUSH2 0x2F7D JUMP JUMPDEST DUP2 ISZERO ISZERO PUSH2 0x4379 JUMPI INVALID JUMPDEST MOD SWAP1 POP PUSH2 0x42EA DUP6 DUP5 PUSH2 0x38AE JUMP JUMPDEST PUSH1 0x80 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE POP SWAP1 JUMP JUMPDEST PUSH2 0x120 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH2 0x43C4 PUSH2 0x4386 JUMP JUMPDEST DUP2 MSTORE PUSH1 0x20 ADD PUSH2 0x43D1 PUSH2 0x4386 JUMP JUMPDEST DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE POP SWAP1 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x60 DUP2 ADD DUP3 MSTORE PUSH1 0x0 DUP1 DUP3 MSTORE PUSH1 0x20 DUP3 ADD DUP2 SWAP1 MSTORE SWAP2 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x260A DUP3 CALLDATALOAD PUSH2 0x58B0 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH2 0x441B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0x442E PUSH2 0x4429 DUP3 PUSH2 0x583F JUMP JUMPDEST PUSH2 0x5818 JUMP JUMPDEST DUP2 DUP2 MSTORE PUSH1 0x20 SWAP4 DUP5 ADD SWAP4 SWAP1 SWAP3 POP DUP3 ADD DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x446C JUMPI DUP2 CALLDATALOAD DUP7 ADD PUSH2 0x4456 DUP9 DUP3 PUSH2 0x45BC JUMP JUMPDEST DUP5 MSTORE POP PUSH1 0x20 SWAP3 DUP4 ADD SWAP3 SWAP2 SWAP1 SWAP2 ADD SWAP1 PUSH1 0x1 ADD PUSH2 0x4440 JUMP JUMPDEST POP POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH2 0x4487 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0x4495 PUSH2 0x4429 DUP3 PUSH2 0x583F JUMP JUMPDEST DUP2 DUP2 MSTORE PUSH1 0x20 SWAP4 DUP5 ADD SWAP4 SWAP1 SWAP3 POP DUP3 ADD DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x446C JUMPI DUP2 CALLDATALOAD DUP7 ADD PUSH2 0x44BD DUP9 DUP3 PUSH2 0x460B JUMP JUMPDEST DUP5 MSTORE POP PUSH1 0x20 SWAP3 DUP4 ADD SWAP3 SWAP2 SWAP1 SWAP2 ADD SWAP1 PUSH1 0x1 ADD PUSH2 0x44A7 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH2 0x44E4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0x44F2 PUSH2 0x4429 DUP3 PUSH2 0x583F JUMP JUMPDEST SWAP2 POP DUP2 DUP2 DUP4 MSTORE PUSH1 0x20 DUP5 ADD SWAP4 POP PUSH1 0x20 DUP2 ADD SWAP1 POP DUP4 DUP6 PUSH1 0x20 DUP5 MUL DUP3 ADD GT ISZERO PUSH2 0x4517 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x446C JUMPI DUP2 PUSH2 0x452D DUP9 DUP3 PUSH2 0x454F JUMP JUMPDEST DUP5 MSTORE POP PUSH1 0x20 SWAP3 DUP4 ADD SWAP3 SWAP2 SWAP1 SWAP2 ADD SWAP1 PUSH1 0x1 ADD PUSH2 0x451A JUMP JUMPDEST PUSH1 0x0 PUSH2 0x260A DUP3 CALLDATALOAD PUSH2 0x58C9 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x260A DUP3 CALLDATALOAD PUSH2 0x58CE JUMP JUMPDEST PUSH1 0x0 PUSH2 0x260A DUP3 CALLDATALOAD PUSH2 0x58D1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x260A DUP3 MLOAD PUSH2 0x58D1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x1F DUP4 ADD DUP5 SGT PUSH2 0x4585 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP DUP2 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x459D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x20 DUP4 ADD SWAP2 POP DUP4 PUSH1 0x1 DUP3 MUL DUP4 ADD GT ISZERO PUSH2 0x45B5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH2 0x45CD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0x45DB PUSH2 0x4429 DUP3 PUSH2 0x5860 JUMP JUMPDEST SWAP2 POP DUP1 DUP3 MSTORE PUSH1 0x20 DUP4 ADD PUSH1 0x20 DUP4 ADD DUP6 DUP4 DUP4 ADD GT ISZERO PUSH2 0x45F7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4602 DUP4 DUP3 DUP5 PUSH2 0x5907 JUMP JUMPDEST POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x180 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x461E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4629 PUSH2 0x180 PUSH2 0x5818 JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0x4637 DUP5 DUP5 PUSH2 0x43FE JUMP JUMPDEST DUP3 MSTORE POP PUSH1 0x20 PUSH2 0x4648 DUP5 DUP5 DUP4 ADD PUSH2 0x43FE JUMP JUMPDEST PUSH1 0x20 DUP4 ADD MSTORE POP PUSH1 0x40 PUSH2 0x465C DUP5 DUP3 DUP6 ADD PUSH2 0x43FE JUMP JUMPDEST PUSH1 0x40 DUP4 ADD MSTORE POP PUSH1 0x60 PUSH2 0x4670 DUP5 DUP3 DUP6 ADD PUSH2 0x43FE JUMP JUMPDEST PUSH1 0x60 DUP4 ADD MSTORE POP PUSH1 0x80 PUSH2 0x4684 DUP5 DUP3 DUP6 ADD PUSH2 0x454F JUMP JUMPDEST PUSH1 0x80 DUP4 ADD MSTORE POP PUSH1 0xA0 PUSH2 0x4698 DUP5 DUP3 DUP6 ADD PUSH2 0x454F JUMP JUMPDEST PUSH1 0xA0 DUP4 ADD MSTORE POP PUSH1 0xC0 PUSH2 0x46AC DUP5 DUP3 DUP6 ADD PUSH2 0x454F JUMP JUMPDEST PUSH1 0xC0 DUP4 ADD MSTORE POP PUSH1 0xE0 PUSH2 0x46C0 DUP5 DUP3 DUP6 ADD PUSH2 0x454F JUMP JUMPDEST PUSH1 0xE0 DUP4 ADD MSTORE POP PUSH2 0x100 PUSH2 0x46D5 DUP5 DUP3 DUP6 ADD PUSH2 0x454F JUMP JUMPDEST PUSH2 0x100 DUP4 ADD MSTORE POP PUSH2 0x120 PUSH2 0x46EB DUP5 DUP3 DUP6 ADD PUSH2 0x454F JUMP JUMPDEST PUSH2 0x120 DUP4 ADD MSTORE POP PUSH2 0x140 DUP3 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x470D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4719 DUP5 DUP3 DUP6 ADD PUSH2 0x45BC JUMP JUMPDEST PUSH2 0x140 DUP4 ADD MSTORE POP PUSH2 0x160 DUP3 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x473B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4747 DUP5 DUP3 DUP6 ADD PUSH2 0x45BC JUMP JUMPDEST PUSH2 0x160 DUP4 ADD MSTORE POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x4766 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x344B DUP5 DUP5 PUSH2 0x43FE JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x4785 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x4791 DUP6 DUP6 PUSH2 0x43FE JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0x47A2 DUP6 DUP3 DUP7 ADD PUSH2 0x43FE JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x47BF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x47CB DUP6 DUP6 PUSH2 0x43FE JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0x47A2 DUP6 DUP3 DUP7 ADD PUSH2 0x4543 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x47EE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x4805 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x344B DUP5 DUP3 DUP6 ADD PUSH2 0x4476 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x60 DUP5 DUP7 SUB SLT ISZERO PUSH2 0x4826 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP4 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x483D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4849 DUP7 DUP3 DUP8 ADD PUSH2 0x4476 JUMP JUMPDEST SWAP4 POP POP PUSH1 0x20 DUP5 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x4866 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4872 DUP7 DUP3 DUP8 ADD PUSH2 0x44D3 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x40 DUP5 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x488F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x489B DUP7 DUP3 DUP8 ADD PUSH2 0x440A JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 POP SWAP3 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x60 DUP5 DUP7 SUB SLT ISZERO PUSH2 0x48BA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP4 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x48D1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x48DD DUP7 DUP3 DUP8 ADD PUSH2 0x4476 JUMP JUMPDEST SWAP4 POP POP PUSH1 0x20 PUSH2 0x4872 DUP7 DUP3 DUP8 ADD PUSH2 0x454F JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x4900 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x344B DUP5 DUP5 PUSH2 0x454F JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x491F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x4791 DUP6 DUP6 PUSH2 0x454F JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x60 DUP6 DUP8 SUB SLT ISZERO PUSH2 0x4941 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x494D DUP8 DUP8 PUSH2 0x454F JUMP JUMPDEST SWAP5 POP POP PUSH1 0x20 PUSH2 0x495E DUP8 DUP3 DUP9 ADD PUSH2 0x43FE JUMP JUMPDEST SWAP4 POP POP PUSH1 0x40 DUP6 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x497B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4987 DUP8 DUP3 DUP9 ADD PUSH2 0x4573 JUMP JUMPDEST SWAP6 SWAP9 SWAP5 SWAP8 POP SWAP6 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x60 DUP5 DUP7 SUB SLT ISZERO PUSH2 0x49A8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x49B4 DUP7 DUP7 PUSH2 0x454F JUMP JUMPDEST SWAP4 POP POP PUSH1 0x20 PUSH2 0x49C5 DUP7 DUP3 DUP8 ADD PUSH2 0x43FE JUMP JUMPDEST SWAP3 POP POP PUSH1 0x40 DUP5 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x49E2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x489B DUP7 DUP3 DUP8 ADD PUSH2 0x45BC JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x4A00 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x344B DUP5 DUP5 PUSH2 0x455B JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x4A1E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x344B DUP5 DUP5 PUSH2 0x4567 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x4A3C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x4A53 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x344B DUP5 DUP3 DUP6 ADD PUSH2 0x460B JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x80 DUP6 DUP8 SUB SLT ISZERO PUSH2 0x4A75 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP5 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x4A8C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4A98 DUP8 DUP3 DUP9 ADD PUSH2 0x460B JUMP JUMPDEST SWAP5 POP POP PUSH1 0x20 DUP6 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x4AB5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4AC1 DUP8 DUP3 DUP9 ADD PUSH2 0x460B JUMP JUMPDEST SWAP4 POP POP PUSH1 0x40 DUP6 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x4ADE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4AEA DUP8 DUP3 DUP9 ADD PUSH2 0x45BC JUMP JUMPDEST SWAP3 POP POP PUSH1 0x60 DUP6 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x4B07 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4B13 DUP8 DUP3 DUP9 ADD PUSH2 0x45BC JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP6 SWAP2 SWAP5 POP SWAP3 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x60 DUP5 DUP7 SUB SLT ISZERO PUSH2 0x4B34 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP4 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x4B4B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4B57 DUP7 DUP3 DUP8 ADD PUSH2 0x460B JUMP JUMPDEST SWAP4 POP POP PUSH1 0x20 PUSH2 0x49C5 DUP7 DUP3 DUP8 ADD PUSH2 0x454F JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x80 DUP8 DUP10 SUB SLT ISZERO PUSH2 0x4B81 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x4B8D DUP10 DUP10 PUSH2 0x454F JUMP JUMPDEST SWAP7 POP POP PUSH1 0x20 PUSH2 0x4B9E DUP10 DUP3 DUP11 ADD PUSH2 0x43FE JUMP JUMPDEST SWAP6 POP POP PUSH1 0x40 DUP8 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x4BBB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4BC7 DUP10 DUP3 DUP11 ADD PUSH2 0x4573 JUMP JUMPDEST SWAP5 POP SWAP5 POP POP PUSH1 0x60 DUP8 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x4BE6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4BF2 DUP10 DUP3 DUP11 ADD PUSH2 0x4573 JUMP JUMPDEST SWAP3 POP SWAP3 POP POP SWAP3 SWAP6 POP SWAP3 SWAP6 POP SWAP3 SWAP6 JUMP JUMPDEST PUSH2 0x4C0A DUP2 PUSH2 0x58B0 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x4C1B DUP3 PUSH2 0x58AC JUMP JUMPDEST DUP1 DUP5 MSTORE PUSH1 0x20 DUP5 ADD SWAP4 POP PUSH2 0x4C2D DUP4 PUSH2 0x58A6 JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP3 DUP2 LT ISZERO PUSH2 0x4C5D JUMPI PUSH2 0x4C43 DUP7 DUP4 MLOAD PUSH2 0x53E5 JUMP JUMPDEST PUSH2 0x4C4C DUP3 PUSH2 0x58A6 JUMP JUMPDEST PUSH1 0x60 SWAP7 SWAP1 SWAP7 ADD SWAP6 SWAP2 POP PUSH1 0x1 ADD PUSH2 0x4C30 JUMP JUMPDEST POP SWAP4 SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH2 0x4C0A DUP2 PUSH2 0x58C9 JUMP JUMPDEST PUSH2 0x4C0A DUP2 PUSH2 0x58CE JUMP JUMPDEST PUSH2 0x4C0A DUP2 PUSH2 0x58D1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x4C8D DUP3 PUSH2 0x58AC JUMP JUMPDEST DUP1 DUP5 MSTORE PUSH2 0x4CA1 DUP2 PUSH1 0x20 DUP7 ADD PUSH1 0x20 DUP7 ADD PUSH2 0x5913 JUMP JUMPDEST PUSH2 0x4CAA DUP2 PUSH2 0x593F JUMP JUMPDEST SWAP1 SWAP4 ADD PUSH1 0x20 ADD SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH2 0x4C0A DUP2 PUSH2 0x58FC JUMP JUMPDEST PUSH1 0x12 DUP2 MSTORE PUSH32 0x4C454E4754485F36355F52455155495245440000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0xD DUP2 MSTORE PUSH32 0x494E56414C49445F54414B455200000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0xE DUP2 MSTORE PUSH32 0x4F524445525F4F56455246494C4C000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x11 DUP2 MSTORE PUSH32 0x55494E543235365F554E444552464C4F57000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x1A DUP2 MSTORE PUSH32 0x41535345545F50524F58595F414C52454144595F455849535453000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x26 DUP2 MSTORE PUSH32 0x475245415445525F4F525F455155414C5F544F5F33325F4C454E4754485F5245 PUSH1 0x20 DUP3 ADD MSTORE PUSH32 0x5155495245440000000000000000000000000000000000000000000000000000 PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x60 ADD SWAP1 JUMP JUMPDEST PUSH1 0x15 DUP2 MSTORE PUSH32 0x5349474E41545552455F554E535550504F525445440000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x10 DUP2 MSTORE PUSH32 0x4449564953494F4E5F42595F5A45524F00000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x17 DUP2 MSTORE PUSH32 0x494E56414C49445F4F524445525F5349474E4154555245000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0xD DUP2 MSTORE PUSH32 0x494E56414C49445F4D414B455200000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x10 DUP2 MSTORE PUSH32 0x55494E543235365F4F564552464C4F5700000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0xF DUP2 MSTORE PUSH32 0x494E56414C49445F54585F484153480000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x11 DUP2 MSTORE PUSH32 0x494E56414C49445F5349474E4154555245000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0xE DUP2 MSTORE PUSH32 0x524F554E44494E475F4552524F52000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x10 DUP2 MSTORE PUSH32 0x4641494C45445F455845435554494F4E00000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0xD DUP2 MSTORE PUSH32 0x54414B45525F4F56455250415900000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x14 DUP2 MSTORE PUSH32 0x494E56414C49445F54414B45525F414D4F554E54000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x1A DUP2 MSTORE PUSH32 0x41535345545F50524F58595F444F45535F4E4F545F4558495354000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x21 DUP2 MSTORE PUSH32 0x475245415445525F5448414E5F5A45524F5F4C454E4754485F52455155495245 PUSH1 0x20 DUP3 ADD MSTORE PUSH32 0x4400000000000000000000000000000000000000000000000000000000000000 PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x60 ADD SWAP1 JUMP JUMPDEST PUSH1 0x11 DUP2 MSTORE PUSH32 0x5349474E41545552455F494C4C4547414C000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x1E DUP2 MSTORE PUSH32 0x4C454E4754485F475245415445525F5448414E5F305F52455155495245440000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x17 DUP2 MSTORE PUSH32 0x494E56414C49445F4E45575F4F524445525F45504F4348000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x1E DUP2 MSTORE PUSH32 0x4C454E4754485F475245415445525F5448414E5F335F52455155495245440000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x14 DUP2 MSTORE PUSH32 0x434F4D504C4554455F46494C4C5F4641494C4544000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x12 DUP2 MSTORE PUSH32 0x494E56414C49445F46494C4C5F50524943450000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x12 DUP2 MSTORE PUSH32 0x5245454E5452414E43595F494C4C4547414C0000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x13 DUP2 MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x26 DUP2 MSTORE PUSH32 0x475245415445525F4F525F455155414C5F544F5F32305F4C454E4754485F5245 PUSH1 0x20 DUP3 ADD MSTORE PUSH32 0x5155495245440000000000000000000000000000000000000000000000000000 PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x60 ADD SWAP1 JUMP JUMPDEST PUSH1 0x10 DUP2 MSTORE PUSH32 0x4F524445525F554E46494C4C41424C4500000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0xE DUP2 MSTORE PUSH32 0x494E56414C49445F53454E444552000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x18 DUP2 MSTORE PUSH32 0x4E454741544956455F5350524541445F52455155495245440000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x14 DUP2 MSTORE PUSH32 0x494E56414C49445F54585F5349474E4154555245000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x11 DUP2 MSTORE PUSH32 0x4C454E4754485F305F5245515549524544000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST DUP1 MLOAD PUSH1 0x80 DUP4 ADD SWAP1 PUSH2 0x5373 DUP5 DUP3 PUSH2 0x4C70 JUMP JUMPDEST POP PUSH1 0x20 DUP3 ADD MLOAD PUSH2 0x5386 PUSH1 0x20 DUP6 ADD DUP3 PUSH2 0x4C70 JUMP JUMPDEST POP PUSH1 0x40 DUP3 ADD MLOAD PUSH2 0x5399 PUSH1 0x40 DUP6 ADD DUP3 PUSH2 0x4C70 JUMP JUMPDEST POP PUSH1 0x60 DUP3 ADD MLOAD PUSH2 0x27A3 PUSH1 0x60 DUP6 ADD DUP3 PUSH2 0x4C70 JUMP JUMPDEST DUP1 MLOAD PUSH2 0x120 DUP4 ADD SWAP1 PUSH2 0x53BE DUP5 DUP3 PUSH2 0x5362 JUMP JUMPDEST POP PUSH1 0x20 DUP3 ADD MLOAD PUSH2 0x53D1 PUSH1 0x80 DUP6 ADD DUP3 PUSH2 0x5362 JUMP JUMPDEST POP PUSH1 0x40 DUP3 ADD MLOAD PUSH2 0x27A3 PUSH2 0x100 DUP6 ADD DUP3 PUSH2 0x4C70 JUMP JUMPDEST DUP1 MLOAD PUSH1 0x60 DUP4 ADD SWAP1 PUSH2 0x53F6 DUP5 DUP3 PUSH2 0x541C JUMP JUMPDEST POP PUSH1 0x20 DUP3 ADD MLOAD PUSH2 0x5409 PUSH1 0x20 DUP6 ADD DUP3 PUSH2 0x4C70 JUMP JUMPDEST POP PUSH1 0x40 DUP3 ADD MLOAD PUSH2 0x27A3 PUSH1 0x40 DUP6 ADD DUP3 PUSH2 0x4C70 JUMP JUMPDEST PUSH2 0x4C0A DUP2 PUSH2 0x58F6 JUMP JUMPDEST PUSH1 0x20 DUP2 ADD PUSH2 0x2FBE DUP3 DUP5 PUSH2 0x4C01 JUMP JUMPDEST PUSH2 0x100 DUP2 ADD PUSH2 0x5442 DUP3 DUP12 PUSH2 0x4C01 JUMP JUMPDEST PUSH2 0x544F PUSH1 0x20 DUP4 ADD DUP11 PUSH2 0x4C01 JUMP JUMPDEST PUSH2 0x545C PUSH1 0x40 DUP4 ADD DUP10 PUSH2 0x4C70 JUMP JUMPDEST PUSH2 0x5469 PUSH1 0x60 DUP4 ADD DUP9 PUSH2 0x4C70 JUMP JUMPDEST PUSH2 0x5476 PUSH1 0x80 DUP4 ADD DUP8 PUSH2 0x4C70 JUMP JUMPDEST PUSH2 0x5483 PUSH1 0xA0 DUP4 ADD DUP7 PUSH2 0x4C70 JUMP JUMPDEST DUP2 DUP2 SUB PUSH1 0xC0 DUP4 ADD MSTORE PUSH2 0x5495 DUP2 DUP6 PUSH2 0x4C82 JUMP JUMPDEST SWAP1 POP DUP2 DUP2 SUB PUSH1 0xE0 DUP4 ADD MSTORE PUSH2 0x54A9 DUP2 DUP5 PUSH2 0x4C82 JUMP JUMPDEST SWAP11 SWAP10 POP POP POP POP POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x60 DUP2 ADD PUSH2 0x54C5 DUP3 DUP7 PUSH2 0x4C01 JUMP JUMPDEST DUP2 DUP2 SUB PUSH1 0x20 DUP4 ADD MSTORE PUSH2 0x54D7 DUP2 DUP6 PUSH2 0x4C82 JUMP JUMPDEST SWAP1 POP DUP2 DUP2 SUB PUSH1 0x40 DUP4 ADD MSTORE PUSH2 0x54EB DUP2 DUP5 PUSH2 0x4C82 JUMP JUMPDEST SWAP6 SWAP5 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x260A DUP2 DUP5 PUSH2 0x4C10 JUMP JUMPDEST PUSH1 0x20 DUP2 ADD PUSH2 0x2FBE DUP3 DUP5 PUSH2 0x4C67 JUMP JUMPDEST PUSH1 0x20 DUP2 ADD PUSH2 0x2FBE DUP3 DUP5 PUSH2 0x4C70 JUMP JUMPDEST PUSH1 0x60 DUP2 ADD PUSH2 0x552F DUP3 DUP7 PUSH2 0x4C70 JUMP JUMPDEST PUSH2 0x553C PUSH1 0x20 DUP4 ADD DUP6 PUSH2 0x4C01 JUMP JUMPDEST DUP2 DUP2 SUB PUSH1 0x40 DUP4 ADD MSTORE PUSH2 0x54EB DUP2 DUP5 PUSH2 0x4C82 JUMP JUMPDEST PUSH1 0x40 DUP2 ADD PUSH2 0x555C DUP3 DUP6 PUSH2 0x4C70 JUMP JUMPDEST DUP2 DUP2 SUB PUSH1 0x20 DUP4 ADD MSTORE PUSH2 0x344B DUP2 DUP5 PUSH2 0x4C82 JUMP JUMPDEST PUSH1 0x80 DUP2 ADD PUSH2 0x557C DUP3 DUP8 PUSH2 0x4C70 JUMP JUMPDEST PUSH2 0x5589 PUSH1 0x20 DUP4 ADD DUP7 PUSH2 0x541C JUMP JUMPDEST PUSH2 0x5596 PUSH1 0x40 DUP4 ADD DUP6 PUSH2 0x4C70 JUMP JUMPDEST PUSH2 0x54EB PUSH1 0x60 DUP4 ADD DUP5 PUSH2 0x4C70 JUMP JUMPDEST PUSH1 0x40 DUP2 ADD PUSH2 0x55B1 DUP3 DUP6 PUSH2 0x4C79 JUMP JUMPDEST PUSH2 0x260A PUSH1 0x20 DUP4 ADD DUP5 PUSH2 0x4C01 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x260A DUP2 DUP5 PUSH2 0x4C82 JUMP JUMPDEST PUSH1 0x20 DUP2 ADD PUSH2 0x2FBE DUP3 DUP5 PUSH2 0x4CB7 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x4CC0 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x4CF0 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x4D20 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x4D50 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x4D80 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x4DB0 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x4E06 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x4E36 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x4E66 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x4E96 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x4EC6 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x4EF6 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x4F26 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x4F56 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x4F86 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x4FB6 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x4FE6 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x5016 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x5046 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x509C JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x50CC JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x50FC JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x512C JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x515C JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x518C JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x51BC JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x51EC JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x521C JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x5272 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x52A2 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x52D2 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x5302 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2FBE DUP2 PUSH2 0x5332 JUMP JUMPDEST PUSH1 0x80 DUP2 ADD PUSH2 0x2FBE DUP3 DUP5 PUSH2 0x5362 JUMP JUMPDEST PUSH2 0x120 DUP2 ADD PUSH2 0x2FBE DUP3 DUP5 PUSH2 0x53AC JUMP JUMPDEST PUSH1 0x60 DUP2 ADD PUSH2 0x2FBE DUP3 DUP5 PUSH2 0x53E5 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP2 DUP2 ADD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT DUP3 DUP3 LT OR ISZERO PUSH2 0x5837 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x40 MSTORE SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH8 0xFFFFFFFFFFFFFFFF DUP3 GT ISZERO PUSH2 0x5856 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x20 SWAP1 DUP2 MUL ADD SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH8 0xFFFFFFFFFFFFFFFF DUP3 GT ISZERO PUSH2 0x5877 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x20 PUSH1 0x1F SWAP2 SWAP1 SWAP2 ADD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 AND ADD SWAP1 JUMP JUMPDEST PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST MLOAD SWAP1 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 JUMP JUMPDEST ISZERO ISZERO SWAP1 JUMP JUMPDEST SWAP1 JUMP JUMPDEST PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 AND SWAP1 JUMP JUMPDEST PUSH1 0xFF AND SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x2FBE DUP3 PUSH2 0x58B0 JUMP JUMPDEST DUP3 DUP2 DUP4 CALLDATACOPY POP PUSH1 0x0 SWAP2 ADD MSTORE JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x592E JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH2 0x5916 JUMP JUMPDEST DUP4 DUP2 GT ISZERO PUSH2 0x27A3 JUMPI POP POP PUSH1 0x0 SWAP2 ADD MSTORE JUMP JUMPDEST PUSH1 0x1F ADD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 AND SWAP1 JUMP STOP LOG2 PUSH6 0x627A7A723058 KECCAK256 PUSH22 0xFCAE05644C6AFA57DA58B9541210644237FC1EC14ADF MSIZE 0xf 0xb4 0xa6 EXTCODESIZE 0xa9 0xae 0xc8 DUP8 PUSH13 0x6578706572696D656E74616CF5 STOP CALLDATACOPY ",
- "sourceMap": "931:615:21:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1277:42:23;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1277:42:23;;;;;;;;;;;;;;;;;;;;;;;;;4133:647:27;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;4133:647:27;;;;;;;;;;;;;;;;;1367:42:23;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1367:42:23;;;;;;;;;;;;;;;;;1572:445:25;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1572:445:25;;;;;;;;;;;1870:2891:24;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1870:2891:24;;;;;;;;;;;;;;;;;2139:1515:27;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2139:1515:27;;;;;;;;;897:51:22;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;897:51:22;;;;;;;;;;;;;;;;;15747:260:27;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;15747:260:27;;;;;;;;;5260:659;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;5260:659:27;;;;;;;;;2018:1079:23;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2018:1079:23;;;;;;;;;6478:632:27;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;6478:632:27;;;;;;;;;2013:154:22;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2013:154:22;;;;;;;;;;;;;;;;;967:45:26;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;967:45:26;;;;;;;;;1357:395:27;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1357:395:27;;;;;;;;;2254:412:25;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2254:412:25;;;;;;;;;1166:71;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1166:71:25;;;;;;;;;7498:1507:27;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;7498:1507:27;;;;;;;;;16201:419;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;16201:419:27;;;;;;;;;;;;;;;;;1046:63:25;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1046:63:25;;;;;;;;;91:20:63;;8:9:-1;5:2;;;30:1;27;20:12;5:2;91:20:63;;;;3038:4848:25;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;3038:4848:25;;;;;;;;;13713:1899:27;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;13713:1899:27;;;;;;;;;3414:374:23;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;3414:374:23;;;;;;;;;1426:1456:26;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1426:1456:26;;;;;;;;;1157:666:22;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1157:666:22;;;;;;;;;4417:2261:23;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;4417:2261:23;;;;;;;;;;;;;;;;;4019:124;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;4019:124:23;;;;;;;;;1627:67;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1627:67:23;;;;;;;;;1779:27:38;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1779:27:38;;;;;;;;;;;;9462:1488:27;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;9462:1488:27;;;;;;;;;1301:33:39;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1301:33:39;;;;11338:1914:27;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;11338:1914:27;;;;;;;;;1064:36:26;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1064:36:26;;;;333:167:63;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;333:167:63;;;;;;;;;1112:46:21;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1112:46:21;;;;1277:42:23;;;;;;;;;;;;;:::o;4133:647:27:-;4340:35;;:::i;:::-;4391:20;4442:9;4495:36;;:::i;:::-;939:6:64;;;;938:7;917:72;;;;;;;;;;;;;;;;;;;;;;1043:6;:13;;;;1052:4;1043:13;;;4414::27;;;-1:-1:-1;1043:6:64;-1:-1:-1;4437:304:27;4457:17;;;4437:304;;4534:131;4569:6;4576:1;4569:9;;;;;;;;;;;;;;;;;;4596:21;4618:1;4596:24;;;;;;;;;;;;;;;;;;4638:10;4649:1;4638:13;;;;;;;;;;;;;;;;;;4534:17;:131::i;:::-;4495:170;;4679:51;4694:16;4712:17;4679:14;:51::i;:::-;4476:3;;;;;4437:304;;;-1:-1:-1;;1165:5:64;1156:14;;;;;;-1:-1:-1;4133:647:27;;-1:-1:-1;;;4133:647:27:o;1367:42:23:-;;;;;;;;;;;;;;;:::o;1572:445:25:-;1708:27;;;1725:10;1708:27;1704:260;;1776:126;1814:4;1840:13;1875:9;;1776:126;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1776:16:25;;-1:-1:-1;;;;;1776:126:25:i;:::-;1751:202;;;;;;;;;;;;;;;;-1:-1:-1;;1973:15:25;;;;:9;:15;;;;;;;;:30;;;;;;;;;;;:37;;;;2006:4;1973:37;;;1572:445::o;1870:2891:24:-;2106:59;;:::i;:::-;2571:39;;:::i;:::-;2646:40;;:::i;:::-;2755:20;939:6:64;;;;938:7;917:72;;;;;;;;;;;;;;1043:6;:13;;;;1052:4;1043:13;;;2435:24:24;;;;;2407:25;;;;:52;;;;2497:24;;;2469:25;;;:52;2613:23;2435:9;2613:12;:23::i;:::-;2571:65;;2689:24;2702:10;2689:12;:24::i;:::-;2646:67;;2778:26;:24;:26::i;:::-;2755:49;;2875:132;2908:9;2931:13;2958:12;2984:13;2875:19;:132::i;:::-;3017:135;3050:10;3074:14;3102:12;3128:14;3017:19;:135::i;:::-;3162:39;3179:9;3190:10;3162:16;:39::i;:::-;3278:195;3319:9;3342:10;3366:13;:41;;;3421:14;:42;;;3278:27;:195::i;:::-;3597:23;;:46;;;;3717;;3257:216;;-1:-1:-1;3518:255:24;;3547:9;;3570:13;;3597:46;;3518:15;:255::i;:::-;3864:24;;;;;:47;;;;3986;;3783:260;;3812:10;;3836:14;;3864:47;;;3783:15;:260::i;:::-;4095:205;4126:9;4149:12;4175:13;:23;;;4212:13;:41;;;4267:18;:23;;;4095:17;:205::i;:::-;4310:209;4341:10;4365:12;4391:14;:24;;;4429:14;:42;;;4485:18;:24;;;4310:17;:209::i;:::-;4584:134;4617:9;4640:10;4664:12;4690:18;4584:19;:134::i;:::-;-1:-1:-1;;1165:5:64;1156:14;;;;;;-1:-1:-1;1870:2891:24;;-1:-1:-1;;;;1870:2891:24:o;2139:1515:27:-;2310:30;;:::i;:::-;2403;2436:104;2468:5;2487:20;2521:9;2436:18;:104::i;:::-;2403:137;;3116:3;3037:17;2972;2966:24;2870:2;2851:17;2847:26;2762:7;2691:3;2661:532;3209:7;3206:2;;;3261:17;3255:24;3242:11;3235:45;3355:2;3336:17;3332:26;3326:33;3321:2;3308:11;3304:20;3297:63;3435:2;3416:17;3412:26;3406:33;3401:2;3388:11;3384:20;3377:63;3515:2;3496:17;3492:26;3486:33;3481:2;3468:11;3464:20;3457:63;3206:2;-1:-1:-1;2139:1515:27;;;;;;;:::o;897:51:22:-;;;;;;;;;;;;;;;:::o;15747:260:27:-;15856:20;939:6:64;;15856:20:27;;939:6:64;;938:7;917:72;;;;;;;;;;;;;;-1:-1:-1;;1043:6:64;:13;;;;1052:4;1043:13;;;15879::27;;;15902:99;15922:17;;;15902:99;;15960:30;15980:6;15987:1;15980:9;;;;;;;;;;;;;;;;;;15960:19;:30::i;:::-;15941:3;;15902:99;;;-1:-1:-1;;1165:5:64;1156:14;;;;;;-1:-1:-1;15747:260:27:o;5260:659::-;5473:35;;:::i;:::-;5524:20;5575:9;5628:36;;:::i;:::-;939:6:64;;;;938:7;917:72;;;;;;;;;;;;;;1043:6;:13;;;;1052:4;1043:13;;;5547::27;;;-1:-1:-1;1043:6:64;-1:-1:-1;5570:310:27;5590:17;;;5570:310;;5667:137;5708:6;5715:1;5708:9;;;;;;;;;;;;;;;;;;5735:21;5757:1;5735:24;;;;;;;;;;;;;;;;;;5777:10;5788:1;5777:13;;;;;;;;;;;;;;;;;;5667:23;:137::i;:::-;5628:176;;5818:51;5833:16;5851:17;5818:14;:51::i;:::-;5609:3;;;;;5570:310;;2018:1079:23;2122:20;939:6:64;;2122:20:23;;;;;;939:6:64;;938:7;917:72;;;;;;;;;;;;;;1043:6;:13;;;;1052:4;1043:13;;;2145:26:23;:24;:26::i;:::-;2122:49;-1:-1:-1;2453:26:23;;;2469:10;2453:26;:52;;2495:10;2453:52;;;2490:1;2453:52;2673:24;;;;;;;;:10;:24;;;;;;;;:39;;;;;;;;;;2429:76;;-1:-1:-1;2636:1:23;2617:20;;;-1:-1:-1;2673:39:23;-1:-1:-1;2801:29:23;;;2780:100;;;;;;;;;;;;;;2920:24;;;;;;;;:10;:24;;;;;;;;:39;;;;;;;;;;;;;;:55;;;2990:100;;;;;2962:13;;2990:100;;;;;;;;;;-1:-1:-1;;1165:5:64;1156:14;;;;;;-1:-1:-1;;;2018:1079:23:o;6478:632:27:-;6671:35;;:::i;:::-;6722:20;6773:9;6826:36;;:::i;:::-;6745:6;:13;6722:36;;6785:1;6773:13;;6768:303;6788:17;;;6768:303;;6865:130;6899:6;6906:1;6899:9;;;;;;;;;;;;;;;;;;6926:21;6948:1;6926:24;;;;;;;;;;;;;;;;;;6968:10;6979:1;6968:13;;;;;;;;;;;;;;;;;;6865:16;:130::i;:::-;6826:169;;7009:51;7024:16;7042:17;7009:14;:51::i;:::-;6807:3;;;;;6768:303;;;6478:632;;;;;;;;:::o;2013:154:22:-;2134:26;;;2104:7;2134:26;;;:12;:26;;;;;;;;2013:154;;;;:::o;967:45:26:-;;;;;;;;;;;;;;;:::o;1357:395:27:-;1548:30;;:::i;:::-;939:6:64;;;;938:7;917:72;;;;;;;;;;;;;;1043:6;:13;;;;1052:4;1043:13;;;1608:109:27;1645:5;1664:20;1698:9;1608:23;:109::i;:::-;1165:5:64;1156:14;;;;;;1594:123:27;1357:395;-1:-1:-1;;;;1357:395:27:o;2254:412:25:-;2408:21;939:6:64;;;;938:7;917:72;;;;;;;;;;;;;;1043:6;:13;;;;1052:4;1043:13;;;2432:26:25;:24;:26::i;:::-;2468:32;;;;;;;;:17;:32;;;;;;;;:50;;;;;;;;;;;;;;:61;;;;;;;;;;2544:115;2468:32;;-1:-1:-1;2468:50:25;;2544:115;;;;2468:61;;2544:115;;;;;;;;;;-1:-1:-1;;1165:5:64;1156:14;;;;;;-1:-1:-1;2254:412:25:o;1166:71::-;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;7498:1507:27:-;7696:35;;:::i;:::-;7747:27;7816:20;7867:9;8253:37;8444:36;;:::i;:::-;939:6:64;;;;938:7;917:72;;;;;;;;;;;;;;1043:6;:13;;;;1052:4;1043:13;;;7777:9:27;;:6;;1043::64;7777:9:27;;;;;;;;;;;;;;:24;;;7747:54;;7839:6;:13;7816:36;;7879:1;7867:13;;7862:1104;7882:17;;;7862:1104;;8156:14;8129:6;8136:1;8129:9;;;;;;;;;;;;;;;;;;:24;;:41;;;;8293:70;8301:20;8323:16;:39;;;8293:7;:70::i;:::-;8253:110;;8483:136;8518:6;8525:1;8518:9;;;;;;;;;;;;;;;;;;8545:29;8592:10;8603:1;8592:13;;;;;;;;;8483:136;8444:175;;8704:51;8719:16;8737:17;8704:14;:51::i;:::-;8853:39;;;;:63;-1:-1:-1;8849:107:27;;8936:5;;8849:107;7901:3;;;;;7862:1104;;;-1:-1:-1;;1165:5:64;1156:14;;;;;;-1:-1:-1;7498:1507:27;;;-1:-1:-1;;;;;7498:1507:27:o;16201:419::-;16301:20;16344;16390:38;16484:9;16367:6;:13;16344:36;;16456:12;16431:38;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;16390:79;;16496:1;16484:13;;16479:108;16499:17;;;16479:108;;16553:23;16566:6;16573:1;16566:9;;;;;;;;;;;;;;;;;;16553:12;:23::i;:::-;16537:10;16548:1;16537:13;;;;;;;;;;;;;;;;;;:39;16518:3;;16479:108;;1046:63:25;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;91:20:63:-;;;;;;:::o;3038:4848:25:-;3200:12;3390:22;3631:27;3752:7;3769:9;3788;3807:17;6871:24;3268:1;3249:9;:16;:20;3228:97;;;;;;;;;;;;;;;;3421:23;:9;:21;:23::i;:::-;3415:30;;;;-1:-1:-1;3543:29:25;3518:55;;;;3497:123;;;;;;;;;;;;;;3675:16;3661:31;;;;;;;;;;3631:61;-1:-1:-1;4174:21:25;4157:13;:38;;;;;;;;;4153:3383;;;4211:27;;;;;;;;;;;4153:3383;4520:21;4503:13;:38;;;;;;;;;4499:3037;;;4582:16;;:21;4557:97;;;;;;;;;;;;;;4678:5;;-1:-1:-1;4697:14:25;;4499:3037;4784:20;4767:13;:37;;;;;;;;;4763:2773;;;4845:16;;4865:2;4845:22;4820:99;;;;;;;;;;;;;;4943:9;4953:1;4943:12;;;;;;;;;;;;;;;;;;;;;4937:19;;-1:-1:-1;4974:24:25;:9;4996:1;4974:24;:21;:24;:::i;:::-;4970:28;-1:-1:-1;5016:25:25;:9;5038:2;5016:25;:21;:25;:::i;:::-;5012:29;;5067:102;5094:4;5116:1;5135;5154;5067:102;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;-1:-1;;5067:102:25;;;;;5193:26;;;;;;;;;-1:-1:-1;5067:102:25;-1:-1:-1;5233:14:25;;-1:-1:-1;5233:14:25;4763:2773;5324:21;5307:13;:38;;;;;;;;;5303:2233;;;5386:16;;5406:2;5386:22;5361:99;;;;;;;;;;;;;;5484:9;5494:1;5484:12;;;;;;;;;;;;;;;;;;;;;5478:19;;-1:-1:-1;5515:24:25;:9;5537:1;5515:24;:21;:24;:::i;:::-;5511:28;-1:-1:-1;5557:25:25;:9;5579:2;5557:25;:21;:25;:::i;:::-;5553:29;;5608:225;5739:4;5645:116;;;;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;5645:116:25;;;5635:127;;;;;;;;;;;;;36:153:-1;66:2;58:11;;36:153;;176:10;;164:23;;139:12;;;;;98:2;89:12;;;;114;36:153;;;299:10;344;;263:2;259:12;;;254:3;250:22;246:30;;311:9;;295:26;;;340:21;;377:20;365:33;;5635:127:25;;;;;;;;;;;;-1:-1:-1;5608:225:25;;;;;;;;;;-1:-1:-1;5635:127:25;-1:-1:-1;5780:1:25;;5799;;-1:-1:-1;5818:1:25;;5608:225;;5303:2233;6081:20;6064:13;:37;;;;;;;;;6060:1476;;;6127:116;6167:4;6189:13;6220:9;6127:22;:116::i;:::-;6117:126;-1:-1:-1;6257:14:25;;6060:1476;6770:23;6753:13;:40;;;;;;;;;6749:787;;;6898:26;:9;:24;:26::i;:::-;7009:32;;;;;;;;:17;:32;;;;;;;;:50;;;;;;;;;;6871:53;;-1:-1:-1;7009:50:25;;7008:51;7004:102;;;7086:5;7079:12;;;;7004:102;7129:153;7172:16;7206:4;7228:13;7259:9;7129:25;:153::i;6749:787::-;7418:23;7401:13;:40;;;;;;;;;7397:139;;;7467:15;;;;:9;:15;;;;;;;;:30;;;;;;;;;;;;;;-1:-1:-1;7511:14:25;;7397:139;7848:31;;;;;;;;;;;3038:4848;;;;;;;;;;;;;:::o;13713:1899:27:-;13896:35;;:::i;:::-;13947:27;14012:20;14063:9;14453:37;14759;15050:36;;:::i;:::-;13977:6;13984:1;13977:9;;;;;;;;;;;;;;;;;;:24;;;13947:54;;14035:6;:13;14012:36;;14075:1;14063:13;;14058:1515;14078:17;;;14058:1515;;14357:14;14330:6;14337:1;14330:9;;;;;;;;;;;;;;;;;;;:24;;:41;14523:39;;14493:70;;14501:20;;14493:7;:70::i;:::-;14453:110;;14799:170;14838:6;14845:1;14838:9;;;;;;;;;;;;;;;;;;:26;;;14882:6;14889:1;14882:9;;;;;;;;;;;;;;;;;;:26;;;14926:29;14799:21;:170::i;:::-;14759:210;;15089:135;15123:6;15130:1;15123:9;;;;;;;;;;;;;;;;;;15150:29;15197:10;15208:1;15197:13;;;;;;;;;15089:135;15050:174;;15309:51;15324:16;15342:17;15309:14;:51::i;:::-;15460:39;;:63;-1:-1:-1;15456:107:27;;15543:5;;15456:107;14097:3;;;;;14058:1515;;;13713:1899;;;;;;;;;;;:::o;3414:374:23:-;3590:30;;:::i;:::-;939:6:64;;;;938:7;917:72;;;;;;;;;;;;;;1043:6;:13;;;;1052:4;1043:13;;;3650:103:23;3681:5;3700:20;3734:9;3650:17;:103::i;1426:1456:26:-;1640:21;;1730:23;;1640:35;:21;:35;1619:100;;;;;;;;;;;;;;1756:113;1774:94;1809:4;1827:13;1854:4;;1774:94;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1774:21:26;;-1:-1:-1;;;;;1774:94:26:i;:::-;1756:17;:113::i;:::-;1956:29;;;;:12;:29;;;;;;1730:139;;-1:-1:-1;1956:29:26;;1955:30;1934:92;;;;;;;;;;;;;;2112:27;;;2129:10;2112:27;2108:410;;2214:137;2252:15;2289:13;2324:9;;2214:137;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;2214:16:26;;-1:-1:-1;;;;;2214:137:26:i;:::-;2189:216;;;;;;;;;;;;;;;;2470:21;:37;;;;;;;;;;2108:410;2559:29;;;;:12;:29;;;;;;;:36;;;;2591:4;2559:36;;;2626:32;2634:4;;2653;;;;2626:32;2653:4;;;;2626:32;;;;;;;;;;;;;;;;;;;;;;;;2605:95;;;;;;;;;;;;;;;;2788:27;;;2805:10;2788:27;2784:92;;2831:21;:34;;;;;;2784:92;1426:1456;;;;;;;:::o;1157:666:22:-;259:5:63;;1254:30:22;;;;;;259:5:63;;245:10;:19;224:85;;;;;;;;;;;;;;1299:10:22;1254:56;;1405:18;:29;;;:31;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1405:31:22;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1405:31:22;;;;;;;101:4:-1;97:9;90:4;84;80:15;76:31;69:5;65:43;126:6;120:4;113:20;0:138;1405:31:22;;;;;;;;;1474:26;;;;;;;:12;:26;;;;;;1383:53;;-1:-1:-1;1474:26:22;;;-1:-1:-1;1531:31:22;;1510:104;;;;;;;;;;;;;;1674:26;;;;;;;:12;:26;;;;;;;:47;;;;;;;;;;1736:80;;;;;1674:26;;1796:10;;1736:80;;;;;;;;;;1157:666;;;;:::o;4417:2261:23:-;4504:26;;:::i;:::-;4602:19;4615:5;4602:12;:19::i;:::-;4580;;;;:41;;;;4703:27;;;:6;:27;;;;;;;;4663:37;;;:67;5032:22;;;;:27;5028:157;;;5105:38;5099:45;5075:69;;;;5158:16;;5028:157;5498:22;;;;:27;5494:157;;;5571:38;5565:45;;5494:157;5745:22;;;;5704:37;;;;:63;5700:179;;5813:24;5807:31;;5700:179;6003:27;;;;5984:15;:46;5980:157;;6076:19;6070:26;;5980:157;6206:19;;;;;6196:30;;;;:9;:30;;;;;;;;;6192:143;;;6272:21;6266:28;;6192:143;6402:10;;;;6359:18;;6348:30;;;;;;;;:10;:30;;;;;;;;6379:19;;;;6348:51;;;;;;;;;;:64;6344:177;;;6458:21;6452:28;;6344:177;6624:20;6594:51;;;4417:2261;-1:-1:-1;4417:2261:23:o;4019:124::-;939:6:64;;;;938:7;917:72;;;;;;;;;;;;;;1043:6;:13;;;;1052:4;1043:13;;;4110:26:23;4130:5;4110:19;:26::i;:::-;-1:-1:-1;1165:5:64;1156:14;;;;;;4019:124:23:o;1627:67::-;;;;;;;;;;;;;;;;;;;;;;;;:::o;1779:27:38:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;9462:1488:27:-;9646:35;;:::i;:::-;9697:27;9762:20;9813:9;10199:37;10390:36;;:::i;:::-;9727:6;9734:1;9727:9;;;;;;;;;;;;;;;;;;:24;;;9697:54;;9785:6;:13;9762:36;;9825:1;9813:13;;9808:1103;9828:17;;;9808:1103;;10102:14;10075:6;10082:1;10075:9;;;;;;;;;;;;;;;;;;:24;;:41;;;;10239:70;10247:20;10269:16;:39;;;10239:7;:70::i;:::-;10199:110;;10429:135;10463:6;10470:1;10463:9;;;;;;;;;;;;;;;;;;10490:29;10537:10;10548:1;10537:13;;;;;;;;;10429:135;10390:174;;10649:51;10664:16;10682:17;10649:14;:51::i;:::-;10798:39;;;;:63;-1:-1:-1;10794:107:27;;10881:5;;10794:107;9847:3;;;;;9808:1103;;;9462:1488;;;;;;;;;;:::o;1301:33:39:-;;;;:::o;11338:1914:27:-;11535:35;;:::i;:::-;11586:27;11651:20;11702:9;12092:37;12398;12689:36;;:::i;:::-;939:6:64;;;;938:7;917:72;;;;;;;;;;;;;;1043:6;:13;;;;1052:4;1043:13;;;11616:9:27;;:6;;1043::64;11616:9:27;;;;;;;;;;;;;;:24;;;11586:54;;11674:6;:13;11651:36;;11714:1;11702:13;;11697:1516;11717:17;;;11697:1516;;11996:14;11969:6;11976:1;11969:9;;;;;;;;;;;;;;;;;;;:24;;:41;12162:39;;12132:70;;12140:20;;12132:7;:70::i;:::-;12092:110;;12438:170;12477:6;12484:1;12477:9;;;;;;;;;12438:170;12398:210;;12728:136;12763:6;12770:1;12763:9;;;;;;;;;;;;;;;;;;12790:29;12837:10;12848:1;12837:13;;;;;;;;;12728:136;12689:175;;12949:51;12964:16;12982:17;12949:14;:51::i;:::-;13100:39;;:63;-1:-1:-1;13096:107:27;;13183:5;;13096:107;11736:3;;;;;11697:1516;;;-1:-1:-1;;1165:5:64;1156:14;;;;;;-1:-1:-1;11338:1914:27;;;-1:-1:-1;;;;;;11338:1914:27:o;1064:36:26:-;;;;;;:::o;333:167:63:-;259:5;;;;245:10;:19;224:85;;;;;;;;;;;;;;429:22;;;;425:69;;467:5;:16;;;;;;;;;;425:69;333:167;:::o;1112:46:21:-;;;;;;;;;;;;;;;;;;;:::o;6995:1583:23:-;7160:30;;:::i;:::-;7234:26;;:::i;:::-;7324:20;7629:33;7745:30;7263:19;7276:5;7263:12;:19::i;:::-;7234:48;;7347:26;:24;:26::i;:::-;7324:49;;7446:120;7479:5;7498:9;7521:12;7547:9;7446:19;:120::i;:::-;7665:70;7673:5;:22;;;7697:9;:37;;;7665:7;:70::i;:::-;7629:106;;7778:55;7785:20;7807:25;7778:6;:55::i;:::-;7745:88;;7872:185;7901:5;7920:9;7943:20;7977:22;8013:11;:34;;;7872:15;:185::i;:::-;8127:51;8148:5;8155:22;8127:20;:51::i;:::-;8113:65;;8231:181;8262:5;8281:12;8307:9;:19;;;8340:9;:37;;;8391:11;8231:17;:181::i;:::-;8451:91;8476:5;8495:12;8521:11;8451;:91::i;:::-;6995:1583;;;;;;;;;:::o;1771:648:41:-;1964:39;;2005:40;;1956:90;;1964:39;1956:7;:90::i;:::-;1914:132;;2106:39;;;;;2147:40;;;;2098:90;;2106:39;2098:7;:90::i;:::-;2056:39;;;:132;2238:29;;;;;2269:30;;;;2230:70;;2238:29;2230:7;:70::i;:::-;2198:29;;;:102;2350:29;;;;;2381:30;;;;2342:70;;2350:29;2342:7;:70::i;:::-;2310:29;;;;:102;;;;-1:-1:-1;1771:648:41:o;4841:307:26:-;4980:21;;4924:7;;4980:21;;4924:7;5036:36;;:74;;5088:22;5036:74;;;5075:10;5036:74;5011:99;4841:307;-1:-1:-1;;;4841:307:26:o;11221:1268:23:-;11513:21;;:52;;11544:20;11513:52;11492:115;;;;;;;;;;;;;;11687:19;;;;:33;;;11683:170;;11761:19;;;;:33;;11784:10;11761:33;11736:106;;;;;;;;;;;;;;11931:18;;;;:32;;;11927:169;;12026:12;12004:34;;:5;:18;;;:34;;;11979:106;;;;;;;;;;;;;;;;12186:37;;;;:42;12182:301;;;12269:146;12307:9;:19;;;12348:5;:18;;;12388:9;12269:16;:146::i;:::-;12244:228;;;;;;;;;;;;;;;;11221:1268;;;;:::o;4931:1075:24:-;5885:64;5893:9;:26;;;5921:10;:27;;;5885:7;:64::i;:::-;5805;5813:9;:26;;;5841:10;:27;;;5805:7;:64::i;:::-;:144;;5784:215;;;;;;;;;;;;;;4931:1075;;:::o;6742:4784::-;7014:59;;:::i;:::-;7185:37;7303;7511:38;7632;7225:68;7233:9;:26;;;7261:31;7225:7;:68::i;:::-;7185:108;;7343:158;7382:9;:26;;;7422:9;:26;;;7462:29;7343:25;:158::i;:::-;7303:198;;7552:70;7560:10;:27;;;7589:32;7552:7;:70::i;:::-;7511:111;;7673:161;7712:10;:27;;;7753:10;:27;;;7794:30;7673:25;:161::i;:::-;7632:202;-1:-1:-1;8592:63:24;;;8588:1672;;8722:24;;;;;;:80;;;8816:24;;:47;;:80;;;8959:24;:47;8910:23;;:46;;:96;9299:26;;;;9343;;;;9387:23;;:46;;;;9256:191;;9343:26;9256:25;:191::i;:::-;9207:23;;:240;8588:1672;;;9528:23;;:78;;;9620:23;;:46;;;;:78;;;9762:23;;:46;;;9712:24;;;;;:96;;;;10098:27;;;;10143;;;;10188:24;;:47;10056:193;;10143:27;10056:24;:193::i;:::-;10006:24;;;;;:47;:243;8588:1672;10382:23;;:46;10442:24;;;;;:47;;10361:138;;10382:46;10361:7;:138::i;:::-;10313:45;;;:186;10627:23;;:46;10687:26;;;;10727:18;;;;10588:167;;10627:46;10687:26;10588:25;:167::i;:::-;10549:23;;:36;;:206;10843:23;;:46;;;10903:26;;;;10943:18;;;;10804:167;;10843:46;10903:26;10804:25;:167::i;:::-;10765:23;;:36;;:206;11101:24;;;;:47;11162:27;;;;11203:19;;;;11062:170;;11101:47;11162:27;11062:25;:170::i;:::-;11022:18;:24;;;:37;;:210;;;;;11282:170;11321:18;:24;;;:47;;;11382:10;:27;;;11423:10;:19;;;11282:25;:170::i;:::-;11242:24;;;;:37;;:210;6742:4784;;;;;;;;;;:::o;12927:2440:23:-;13322:25;;;13301:92;;;;;;;;;;;;;;13621:46;;;;13600:106;;;;;;;;;;;;;;13988:5;:22;;;13914:70;13922:9;:37;;;13961:22;13914:7;:70::i;:::-;:96;;13893:157;;;;;;;;;;;;;;15261:55;15269:5;:22;;;15293;15261:7;:55::i;:::-;15177;15185:22;15209:5;:22;;;15177:7;:55::i;:::-;:139;;15156:204;;;;;;;;;;;;;;12927:2440;;;;;:::o;9384:792::-;9662:72;9670:27;9699:11;:34;;;9662:7;:72::i;:::-;9642:17;;;;:6;:17;;;;;;;;;:92;;;;9821:25;;;;9789:18;;9910:34;;9958;;;;10006:24;;;;10044;;;;10105:20;;;;10139;;;;9771:398;;9642:17;;9771:398;;;;;;;;;;;;;;9860:12;;9886:10;;9910:34;;9958;;10006:24;;10139:20;9771:398;;;;;;;;;;9384:792;;;;;:::o;11972:2233:24:-;12247:14;12219:42;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:25;;:42;;12247:14;;12219:42;;12247:14;12219:42;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12305:202;12339:9;:24;;;12377:9;:22;;;12413:10;:23;;;12450:18;:24;;;:47;;;12305:20;:202::i;:::-;12551:25;;;;12590:23;;12627:22;;12663:23;;:46;;;12517:202;;12551:25;12590:23;12627:22;12517:20;:202::i;:::-;12729:189;12763:9;:24;;;12801:9;:22;;;12837:12;12863:18;:45;;;12729:20;:189::i;:::-;12951:185;12985:12;13011:9;:22;;;13047:9;:29;;;13090:18;:23;;;:36;;;12951:20;:185::i;:::-;13146:188;13180:12;13206:10;:23;;;13243:10;:30;;;13287:18;:24;;;:37;;;13146:20;:188::i;:::-;13404:10;:30;;;13371:63;;:9;:29;;;:63;;;13367:832;;;13450:301;13488:12;13518;13548:9;:29;;;13595:142;13624:18;:23;;;:36;;;13682:18;:24;;;:37;;;13595:7;:142::i;:::-;13450:20;:301::i;:::-;13367:832;;;13782:195;13820:12;13850;13880:9;:29;;;13927:18;:23;;;:36;;;13782:20;:195::i;:::-;13991:197;14029:12;14059;14089:10;:30;;;14137:18;:24;;;:37;;;13991:20;:197::i;1011:10099:37:-;5031:4;5025:11;;5321:66;5314:4;5291:28;;;5284:104;;;;1199:30;5445:4;5422:28;;6444:59;;;6770:19;;5736:26;;;6750:40;;;6883:23;;;6877:30;6853:22;;;6846:62;6979:23;;;6973:30;6949:22;;;6942:62;7082:23;;;7076:30;7052:22;;;7045:62;7197:4;7179:23;;7173:30;7149:22;;;7142:62;7297:4;7279:23;;7273:30;7249:22;;;7242:62;7397:4;7379:23;;7373:30;7349:22;;;7342:62;7495:4;7477:23;;7471:30;7447:22;;;7440:62;7594:5;7576:24;;7570:31;7545:23;;;7538:64;7699:5;7681:24;;7675:31;7650:23;;;7643:64;7787:5;7769:24;;7763:31;;7738:23;;;7731:64;;;7895:5;7877:24;;7871:31;7846:23;;;7839:64;7979:5;8106:74;;8268:24;8340:19;;7962:23;;;8544:34;;;5025:11;;5422:28;;;;6536:27;;;;5736:26;;8606:22;;;;8388:23;;;;8464:4;8445:24;;8441:35;6190:1;8698:237;8721:13;8718:1;8715:20;8698:237;;;8791:19;;8771:40;;8860:4;8843:22;;;;8898:23;;;;8749:1;8742:9;8698:237;;;-1:-1:-1;;;;9045:31:37;;;9029:13;9010:33;;;9003:74;;;;9171:17;;9165:24;9237:19;;9441:34;;;9037:4;9503:22;;;;9285:23;;;;9361:4;9342:24;;9338:35;9610:1;9596:237;9619:13;9616:1;9613:20;9596:237;;;9689:19;;9669:40;;9758:4;9741:22;;;;9796:23;;;;9647:1;9640:9;9596:237;;;-1:-1:-1;;;9902:46:37;;;-1:-1:-1;10133:33:37;;;10003:4;9981:27;;;10108:59;;;10281:19;;10472:34;;;9981:27;;10534:22;;;;10329:23;;;;10281:19;10405:4;10386:24;;10382:35;-1:-1:-1;10613:237:37;10636:13;10633:1;10630:20;10613:237;;;10706:19;;10686:40;;10775:4;10758:22;;;;10813:23;;;;10664:1;10657:9;10613:237;;;-1:-1:-1;;;10928:46:37;;;;;10902:73;;-1:-1:-1;11041:4:37;11034:25;-1:-1:-1;;;;;1011:10099:37;;;;;:::o;8809:332:23:-;8927:26;;:::i;:::-;8956:19;8969:5;8956:12;:19::i;:::-;8927:48;;9014:35;9032:5;9039:9;9014:17;:35::i;:::-;9086:48;9107:5;9114:9;:19;;;9086:20;:48::i;16922:513:27:-;17102:30;;:::i;:::-;17162:103;17193:5;17212:20;17246:9;17162:17;:103::i;:::-;17296:34;;;;17148:117;;-1:-1:-1;17296:58:27;;17275:125;;;;;;;;;;;;;502:208:65;588:7;632:6;;;;611:70;;;;;;;;;;;;;;-1:-1:-1;698:5:65;;;502:208;;;;;:::o;8313:448:61:-;8397:13;8458:1;8447;:8;:12;8426:92;;;;;;;;;;;;;;;;8568:8;;8566:1;;8568:12;;;;8566:15;;;;;;;;;;8680:8;;8676:16;;8705:17;;;-1:-1:-1;8566:15:61;;;;;;;8313:448::o;13290:490::-;13411:14;13474:5;13482:2;13474:10;13462:1;:8;:22;;13441:107;;;;;;;;;;;;;;;;-1:-1:-1;13727:13:61;13629:2;13727:13;13721:20;;13290:490::o;8292:1482:25:-;8507:135;;8455:12;;8483:21;;8543:48;;8507:135;;8605:4;;8623:9;;8507:135;;;;;;;;22:32:-1;26:21;;;22:32;6:49;;8507:135:25;;;49:4:-1;25:18;;;61:17;;8507:135:25;182:15:-1;8507:135:25;;;;179:29:-1;;;;160:49;;8943:15:25;;8507:135;;-1:-1:-1;49:4;25:18;;;8816:13:25;8763:3;8735:380;9136:7;9156:422;;;;9596:1;9591:143;;;;9129:605;;9156:422;9246:66;9243:1;9236:77;9341:66;9337:2;9330:78;9436:66;9432:2;9425:78;9531:1;9527:2;9520:13;9560:3;9557:1;9550:14;9591:143;-1:-1:-1;;9706:14:25;;8292:1482;-1:-1:-1;;;;;8292:1482:25:o;8956:482:61:-;9043:14;9106:2;9094:1;:8;:14;;9073:99;;;;;;;;;;;;;;;;9224:29;9236:1;9250:2;9239:1;:8;:13;9224:11;:29::i;:::-;9356:8;;9352:17;;9382;;;-1:-1:-1;9215:38:61;8956:482::o;10213:1561:25:-;10465:165;;10413:12;;10441:21;;10501:51;;10465:165;;10566:4;;10512:13;;10611:9;;10465:165;;;;;;;;22:32:-1;26:21;;;22:32;6:49;;10465:165:25;;;49:4:-1;25:18;;;61:17;;10465:165:25;182:15:-1;10465:165:25;;;;179:29:-1;;;;160:49;;10937:15:25;;10465:165;;-1:-1:-1;49:4;25:18;;;10805:16:25;10751:3;10723:389;11133:7;11153:425;;;;11596:1;11591:143;;;;11126:608;;11153:425;11246:66;11243:1;11236:77;11341:66;11337:2;11330:78;11436:66;11432:2;11425:78;11531:1;11527:2;11520:13;11560:3;11557:1;11550:14;11591:143;11712:7;11706:14;11695:25;;11126:608;-1:-1:-1;;;10213:1561:25;;;;;;;:::o;3123:425:42:-;3287:21;3345:15;;;3324:78;;;;;;;;;;;;;;3429:82;3450:26;3458:9;3469:6;3450:7;:26::i;:::-;3490:11;3429:7;:82::i;:::-;3413:98;3123:425;-1:-1:-1;;;;3123:425:42:o;3175:1222:26:-;827:146:48;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;26:21:-1;;;22:32;;6:49;;827:146:48;;;;;;;;817:157;;3339:14:26;;;;;;827:146:48;;;;817:157;;;;827:146;817:157;36:153:-1;66:2;58:11;;36:153;;176:10;;164:23;;139:12;;;;;98:2;89:12;;;;114;36:153;;;299:10;344;;263:2;259:12;;;254:3;250:22;246:30;;311:9;;295:26;;;340:21;;377:20;365:33;;817:157:48;;;;;;;;;;;3456:15:26;;817:157:48;;-1:-1:-1;3456:15:26;;-1:-1:-1;817:157:48;;-1:-1:-1;817:157:48;;3456:15:26;;;-1:-1:-1;3456:15:26;817:157:48;3456:15:26;36:153:-1;66:2;58:11;;36:153;;176:10;;164:23;;139:12;;;;;98:2;89:12;;;;114;36:153;;;299:10;344;;263:2;259:12;;;254:3;250:22;246:30;;311:9;;295:26;;;340:21;;377:20;365:33;;3456:15:26;;;;;;;;;;;;3834:26;;;3960:15;;3953:29;;;;-1:-1:-1;4105:42:26;4086:62;;;;4069:15;;;4062:87;;;;-1:-1:-1;;4199:2:26;4187:15;;4180:33;-1:-1:-1;;4354:3:26;4336:22;;;;3175:1222;-1:-1:-1;3175:1222:26:o;1834:924:39:-;1985:18;;;2297:2;2291:9;2329:66;2314:82;;2434:14;;;2427:40;2564:2;2552:15;;2545:35;;;;2716:2;2698:21;;;1834:924::o;4211:202:43:-;4300:17;4345:35;4363:16;4373:5;4363:9;:16::i;1371:135:65:-;1456:7;1490:1;1486;:5;:13;;1498:1;1486:13;;;-1:-1:-1;1494:1:65;;1479:20;-1:-1:-1;1371:135:65:o;16651:887:23:-;16802:30;;:::i;:::-;16897:34;;;:59;;;17078:22;;;;17114;;;;17003:143;;16934:22;;17003:25;:143::i;:::-;16966:180;;;17270:22;;;;17306:14;;;;17183:147;;16966:180;17270:22;17183:25;:147::i;:::-;17156:24;;;:174;17442:22;;;;17478:14;;;;17367:135;;17406:22;;17367:25;:135::i;:::-;17340:24;;;:162;16651:887;;;;:::o;17848:932::-;18055:14;18027:42;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:25;;:42;;18055:14;;18027:42;;18055:14;18027:42;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;18079:170;18113:5;:20;;;18147:5;:18;;;18179:12;18205:11;:34;;;18079:20;:170::i;:::-;18259;18293:5;:20;;;18327:12;18353:5;:18;;;18385:11;:34;;;18259:20;:170::i;:::-;18439:165;18473:12;18499:5;:18;;;18531:5;:25;;;18570:11;:24;;;18439:20;:165::i;:::-;18614:159;18648:12;18674;18700:5;:25;;;18739:11;:24;;;18614:20;:159::i;716:230:65:-;802:7;837:5;;;873:6;;;;852:69;;;;;;;;;;;;;;938:1;931:8;;716:230;;;;;;:::o;51:288::-;137:7;;164:6;;160:45;;;193:1;186:8;;;;160:45;-1:-1:-1;226:5:65;;;230:1;226;:5;262;;;;;;;;:10;241:73;;;;;;;;;;;;;1012:624:42;1180:21;1238:15;;;1217:78;;;;;;;;;;;;;;1328:114;1366:9;1393:11;1422:6;1328:20;:114::i;:::-;1327:115;1306:176;;;;;;;;;;;;;1959:889;2126:21;2184:15;;;2163:78;;;;;;;;;;;;;;2274:113;2311:9;2338:11;2367:6;2274:19;:113::i;:::-;2273:114;2252:175;;;;;;;;;;;;;;2649:162;2670:106;2695:26;2703:9;2714:6;2695:7;:26::i;:::-;2739:23;2747:11;2760:1;2739:7;:23::i;:::-;2670:7;:106::i;2482:5147:22:-;3031:19;3290:18;2718:1;2709:6;:10;:24;;;;;2731:2;2723:10;;:4;:10;;;;2709:24;2705:4918;;;2822:16;;2841:1;-1:-1:-1;2797:109:22;;;;;;;;;;;;;;-1:-1:-1;;3153:2:22;3138:18;;;3111:46;3179:66;3107:156;3311:26;;;;:12;:26;;;;;;;;;;3422:24;;;3397:109;;;;;;;;;;;;;;4923:2;4917:9;5239:15;5234:2;5222:9;5216:16;5212:25;5208:47;5392:14;5387:3;5383:24;5374:7;5370:38;5676:66;5667:7;5660:83;6160:3;6156:1;6147:7;6143:15;6136:28;6216:42;6210:4;6206:53;6201:2;6192:7;6188:16;6181:79;6310:42;6306:2;6302:51;6297:2;6288:7;6284:16;6277:77;6397:6;6391:3;6382:7;6378:17;6371:33;6563:3;6554:7;6550:17;6645:206;6665:5;6655:8;6652:19;6645:206;;;6714:16;;6697:34;;6778:2;6815:18;;;;6764:17;6645:206;;;7417:3;7346:7;7292;7285:5;7281:19;7208:7;7142:1;7067:10;7004:3;6978:512;7517:7;7510:15;7507:2;;;7564:16;7555:7;7548:33;7507:2;4724:2889;;;;;;2482:5147;;;;;;:::o;15564:816:23:-;15828:21;;16220:20;;15828:52;;15859:20;15828:52;15807:115;;;;;;;;;;;;;;15996:19;;;;:33;;;15992:170;;16070:19;;;;:33;;16093:10;16070:33;16045:106;;;;;;;;;;;;;;16243:26;:24;:26::i;:::-;16300:18;;16220:49;;-1:-1:-1;16300:34:23;;;;;;;16279:94;;;;;;;;;;;;;;15564:816;;;:::o;10478:422::-;10626:20;;;;:9;:20;;;;;;;:27;;;;10649:4;10626:27;;;10743:25;;;;10711:18;;10829:20;;;;10863;;;;10691:202;;10636:9;;10691:202;;;;;;;;;;;;;;10782:10;;10863:20;10691:202;;;;;;;;;;10478:422;;:::o;10268:886:61:-;10389:14;10452:5;10460:2;10452:10;10440:1;:8;:22;;10419:135;;;;;;;;;;;;;;;;-1:-1:-1;11056:13:61;10801:2;11056:13;11050:20;11072:42;11046:69;;10268:886::o;345:151:65:-;431:7;454:9;470:1;466;:5;;;;;;;;;345:151;-1:-1:-1;;;;345:151:65:o;4553:1678:43:-;777:457;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;22:32:-1;26:21;;;22:32;6:49;;777:457:43;;;;;;;;767:468;;4639:14;;;;;;;;777:457;;;;;767:468;;;;777:457;767:468;36:153:-1;66:2;58:11;;36:153;;176:10;;164:23;;139:12;;;;;98:2;89:12;;;;114;36:153;;;299:10;344;;263:2;259:12;;;254:3;250:22;246:30;;311:9;;295:26;;;340:21;;377:20;365:33;;767:468:43;;;;;;;;;;;4763:20;;;;4753:31;;767:468;;-1:-1:-1;4763:20:43;-1:-1:-1;767:468:43;;-1:-1:-1;767:468:43;;4753:31;;;-1:-1:-1;4753:31:43;767:468;4753:31;36:153:-1;66:2;58:11;;36:153;;176:10;;164:23;;139:12;;;;;98:2;89:12;;;;114;36:153;;;299:10;344;;263:2;259:12;;;254:3;250:22;246:30;;311:9;;295:26;;;340:21;;377:20;365:33;;4753:31:43;;;;;;;;;;;4833:20;;;;4823:31;;4753;;-1:-1:-1;4833:20:43;-1:-1:-1;4753:31:43;;-1:-1:-1;4753:31:43;;4823;;;-1:-1:-1;4823:31:43;4753;4823;36:153:-1;66:2;58:11;;36:153;;176:10;;164:23;;139:12;;;;;98:2;89:12;;;;114;36:153;;;299:10;344;;263:2;259:12;;;;254:3;250:22;246:30;;311:9;;295:26;;;340:21;;377:20;;;;365:33;;4823:31:43;;;;;;;;;;5620:14;;;5763:11;;5670:3;5659:15;;5800:11;;5710:3;5699:15;;;5837:11;;5903:24;;;5940:32;;;5985;;;6056:3;6040:20;;6109:19;;6141;;;-1:-1:-1;;;6173:19:43;;;-1:-1:-1;6040:20:43;;4553:1678;-1:-1:-1;4553:1678:43:o;4779:1869:42:-;4942:12;;4991:15;;;4970:78;;;;;;;;;;;;;;5868:11;;;:29;;-1:-1:-1;5883:14:42;;5868:29;5864:72;;;5920:5;5913:12;;;;5864:72;6522:11;6459:84;;;;;;;6499:9;6479:6;6459:84;6439:104;;6591:26;6599:9;6610:6;6591:7;:26::i;:::-;6563:24;6571:4;6577:9;6563:7;:24::i;:::-;:54;;;4779:1869;-1:-1:-1;;;;;4779:1869:42:o;6909:918::-;7071:12;;7120:15;;;7099:78;;;;;;;;;;;;;;7250:11;;;:29;;-1:-1:-1;7265:14:42;;7250:29;7246:257;;;7487:5;7480:12;;;;7246:257;7634:11;7571:84;;;;;;;7611:9;7591:6;7571:84;7551:104;;7711:11;7677:31;7685:11;7698:9;7677:7;:31::i;:::-;:45;;;;;;;;7665:57;;7770:26;7778:9;7789:6;7770:7;:26::i;931:615:21:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;;;:::o;:::-;;;;;;;;;-1:-1:-1;931:615:21;;;;;;;;;;;;;;;;;:::o;5:118:-1:-;;72:46;110:6;97:20;72:46;;146:693;;261:4;249:17;;245:27;-1:-1;235:2;;286:1;283;276:12;235:2;323:6;310:20;345:85;360:69;422:6;360:69;;;345:85;;;458:21;;;502:4;490:17;;;;336:94;;-1:-1;515:14;;490:17;610:1;595:238;620:6;617:1;614:13;595:238;;;703:3;690:17;682:6;678:30;727:42;765:3;753:10;727:42;;;715:55;;-1:-1;793:4;784:14;;;;812;;;;;642:1;635:9;595:238;;;599:14;228:611;;;;;;;;879:735;;1008:4;996:17;;992:27;-1:-1;982:2;;1033:1;1030;1023:12;982:2;1070:6;1057:20;1092:99;1107:83;1183:6;1107:83;;1092:99;1219:21;;;1263:4;1251:17;;;;1083:108;;-1:-1;1276:14;;1251:17;1371:1;1356:252;1381:6;1378:1;1375:13;1356:252;;;1464:3;1451:17;1443:6;1439:30;1488:56;1540:3;1528:10;1488:56;;;1476:69;;-1:-1;1568:4;1559:14;;;;1587;;;;;1403:1;1396:9;1356:252;;1640:707;;1750:4;1738:17;;1734:27;-1:-1;1724:2;;1775:1;1772;1765:12;1724:2;1812:6;1799:20;1834:80;1849:64;1906:6;1849:64;;1834:80;1825:89;;1931:5;1956:6;1949:5;1942:21;1986:4;1978:6;1974:17;1964:27;;2008:4;2003:3;1999:14;1992:21;;2061:6;2108:3;2100:4;2092:6;2088:17;2083:3;2079:27;2076:36;2073:2;;;2125:1;2122;2115:12;2073:2;2150:1;2135:206;2160:6;2157:1;2154:13;2135:206;;;2218:3;2240:37;2273:3;2261:10;2240:37;;;2228:50;;-1:-1;2301:4;2292:14;;;;2320;;;;;2182:1;2175:9;2135:206;;2355:112;;2419:43;2454:6;2441:20;2419:43;;2474:118;;2541:46;2579:6;2566:20;2541:46;;2599:116;;2665:45;2702:6;2689:20;2665:45;;2722:120;;2799:38;2829:6;2823:13;2799:38;;2863:335;;;2970:4;2958:17;;2954:27;-1:-1;2944:2;;2995:1;2992;2985:12;2944:2;-1:-1;3015:20;;3055:18;3044:30;;3041:2;;;3087:1;3084;3077:12;3041:2;3121:4;3113:6;3109:17;3097:29;;3171:3;3164;3156:6;3152:16;3142:8;3138:31;3135:40;3132:2;;;3188:1;3185;3178:12;3132:2;2937:261;;;;;;3207:432;;3297:4;3285:17;;3281:27;-1:-1;3271:2;;3322:1;3319;3312:12;3271:2;3359:6;3346:20;3381:60;3396:44;3433:6;3396:44;;3381:60;3372:69;;3461:6;3454:5;3447:21;3497:4;3489:6;3485:17;3530:4;3523:5;3519:16;3565:3;3556:6;3551:3;3547:16;3544:25;3541:2;;;3582:1;3579;3572:12;3541:2;3592:41;3626:6;3621:3;3616;3592:41;;;3264:375;;;;;;;;4124:2205;;4232:5;4220:9;4215:3;4211:19;4207:31;4204:2;;;4251:1;4248;4241:12;4204:2;4269:21;4284:5;4269:21;;;4260:30;-1:-1;4348:1;4379:49;4424:3;4404:9;4379:49;;;4355:74;;-1:-1;4498:2;4531:49;4576:3;4552:22;;;4531:49;;;4524:4;4517:5;4513:16;4506:75;4450:142;4657:2;4690:49;4735:3;4726:6;4715:9;4711:22;4690:49;;;4683:4;4676:5;4672:16;4665:75;4602:149;4810:2;4843:49;4888:3;4879:6;4868:9;4864:22;4843:49;;;4836:4;4829:5;4825:16;4818:75;4761:143;4966:3;5000:49;5045:3;5036:6;5025:9;5021:22;5000:49;;;4993:4;4986:5;4982:16;4975:75;4914:147;5123:3;5157:49;5202:3;5193:6;5182:9;5178:22;5157:49;;;5150:4;5143:5;5139:16;5132:75;5071:147;5272:3;5306:49;5351:3;5342:6;5331:9;5327:22;5306:49;;;5299:4;5292:5;5288:16;5281:75;5228:139;5421:3;5455:49;5500:3;5491:6;5480:9;5476:22;5455:49;;;5448:4;5441:5;5437:16;5430:75;5377:139;5583:3;5618:49;5663:3;5654:6;5643:9;5639:22;5618:49;;;5610:5;5603;5599:17;5592:76;5526:153;5729:3;5764:49;5809:3;5800:6;5789:9;5785:22;5764:49;;;5756:5;5749;5745:17;5738:76;5689:136;5913:3;5902:9;5898:19;5885:33;5938:18;5930:6;5927:30;5924:2;;;5970:1;5967;5960:12;5924:2;6006:54;6056:3;6047:6;6036:9;6032:22;6006:54;;;5998:5;5991;5987:17;5980:81;5835:237;6160:3;6149:9;6145:19;6132:33;6185:18;6177:6;6174:30;6171:2;;;6217:1;6214;6207:12;6171:2;6253:54;6303:3;6294:6;6283:9;6279:22;6253:54;;;6245:5;6238;6234:17;6227:81;6082:237;4198:2131;;;;;8705:241;;8809:2;8797:9;8788:7;8784:23;8780:32;8777:2;;;8825:1;8822;8815:12;8777:2;8860:1;8877:53;8922:7;8902:9;8877:53;;8953:366;;;9074:2;9062:9;9053:7;9049:23;9045:32;9042:2;;;9090:1;9087;9080:12;9042:2;9125:1;9142:53;9187:7;9167:9;9142:53;;;9132:63;;9104:97;9232:2;9250:53;9295:7;9286:6;9275:9;9271:22;9250:53;;;9240:63;;9211:98;9036:283;;;;;;9326:360;;;9444:2;9432:9;9423:7;9419:23;9415:32;9412:2;;;9460:1;9457;9450:12;9412:2;9495:1;9512:53;9557:7;9537:9;9512:53;;;9502:63;;9474:97;9602:2;9620:50;9662:7;9653:6;9642:9;9638:22;9620:50;;9693:415;;9841:2;9829:9;9820:7;9816:23;9812:32;9809:2;;;9857:1;9854;9847:12;9809:2;9892:31;;9943:18;9932:30;;9929:2;;;9975:1;9972;9965:12;9929:2;9995:97;10084:7;10075:6;10064:9;10060:22;9995:97;;10115:947;;;;10352:2;10340:9;10331:7;10327:23;10323:32;10320:2;;;10368:1;10365;10358:12;10320:2;10403:31;;10454:18;10443:30;;10440:2;;;10486:1;10483;10476:12;10440:2;10506:97;10595:7;10586:6;10575:9;10571:22;10506:97;;;10496:107;;10382:227;10668:2;10657:9;10653:18;10640:32;10692:18;10684:6;10681:30;10678:2;;;10724:1;10721;10714:12;10678:2;10744:78;10814:7;10805:6;10794:9;10790:22;10744:78;;;10734:88;;10619:209;10887:2;10876:9;10872:18;10859:32;10911:18;10903:6;10900:30;10897:2;;;10943:1;10940;10933:12;10897:2;10963:83;11038:7;11029:6;11018:9;11014:22;10963:83;;;10953:93;;10838:214;10314:748;;;;;;11069:811;;;;11281:2;11269:9;11260:7;11256:23;11252:32;11249:2;;;11297:1;11294;11287:12;11249:2;11332:31;;11383:18;11372:30;;11369:2;;;11415:1;11412;11405:12;11369:2;11435:97;11524:7;11515:6;11504:9;11500:22;11435:97;;;11425:107;;11311:227;11569:2;11587:53;11632:7;11623:6;11612:9;11608:22;11587:53;;11887:241;;11991:2;11979:9;11970:7;11966:23;11962:32;11959:2;;;12007:1;12004;11997:12;11959:2;12042:1;12059:53;12104:7;12084:9;12059:53;;12135:366;;;12256:2;12244:9;12235:7;12231:23;12227:32;12224:2;;;12272:1;12269;12262:12;12224:2;12307:1;12324:53;12369:7;12349:9;12324:53;;12508:615;;;;;12665:2;12653:9;12644:7;12640:23;12636:32;12633:2;;;12681:1;12678;12671:12;12633:2;12716:1;12733:53;12778:7;12758:9;12733:53;;;12723:63;;12695:97;12823:2;12841:53;12886:7;12877:6;12866:9;12862:22;12841:53;;;12831:63;;12802:98;12959:2;12948:9;12944:18;12931:32;12983:18;12975:6;12972:30;12969:2;;;13015:1;13012;13005:12;12969:2;13043:64;13099:7;13090:6;13079:9;13075:22;13043:64;;;12627:496;;;;-1:-1;13025:82;-1:-1;;;;12627:496;13130:595;;;;13277:2;13265:9;13256:7;13252:23;13248:32;13245:2;;;13293:1;13290;13283:12;13245:2;13328:1;13345:53;13390:7;13370:9;13345:53;;;13335:63;;13307:97;13435:2;13453:53;13498:7;13489:6;13478:9;13474:22;13453:53;;;13443:63;;13414:98;13571:2;13560:9;13556:18;13543:32;13595:18;13587:6;13584:30;13581:2;;;13627:1;13624;13617:12;13581:2;13647:62;13701:7;13692:6;13681:9;13677:22;13647:62;;13732:239;;13835:2;13823:9;13814:7;13810:23;13806:32;13803:2;;;13851:1;13848;13841:12;13803:2;13886:1;13903:52;13947:7;13927:9;13903:52;;13978:261;;14092:2;14080:9;14071:7;14067:23;14063:32;14060:2;;;14108:1;14105;14098:12;14060:2;14143:1;14160:63;14215:7;14195:9;14160:63;;14246:373;;14373:2;14361:9;14352:7;14348:23;14344:32;14341:2;;;14389:1;14386;14379:12;14341:2;14424:31;;14475:18;14464:30;;14461:2;;;14507:1;14504;14497:12;14461:2;14527:76;14595:7;14586:6;14575:9;14571:22;14527:76;;14626:1089;;;;;14845:3;14833:9;14824:7;14820:23;14816:33;14813:2;;;14862:1;14859;14852:12;14813:2;14897:31;;14948:18;14937:30;;14934:2;;;14980:1;14977;14970:12;14934:2;15000:76;15068:7;15059:6;15048:9;15044:22;15000:76;;;14990:86;;14876:206;15141:2;15130:9;15126:18;15113:32;15165:18;15157:6;15154:30;15151:2;;;15197:1;15194;15187:12;15151:2;15217:76;15285:7;15276:6;15265:9;15261:22;15217:76;;;15207:86;;15092:207;15358:2;15347:9;15343:18;15330:32;15382:18;15374:6;15371:30;15368:2;;;15414:1;15411;15404:12;15368:2;15434:62;15488:7;15479:6;15468:9;15464:22;15434:62;;;15424:72;;15309:193;15561:2;15550:9;15546:18;15533:32;15585:18;15577:6;15574:30;15571:2;;;15617:1;15614;15607:12;15571:2;15637:62;15691:7;15682:6;15671:9;15667:22;15637:62;;;15627:72;;15512:193;14807:908;;;;;;;;15722:727;;;;15892:2;15880:9;15871:7;15867:23;15863:32;15860:2;;;15908:1;15905;15898:12;15860:2;15943:31;;15994:18;15983:30;;15980:2;;;16026:1;16023;16016:12;15980:2;16046:76;16114:7;16105:6;16094:9;16090:22;16046:76;;;16036:86;;15922:206;16159:2;16177:53;16222:7;16213:6;16202:9;16198:22;16177:53;;16704:865;;;;;;;16897:3;16885:9;16876:7;16872:23;16868:33;16865:2;;;16914:1;16911;16904:12;16865:2;16949:1;16966:53;17011:7;16991:9;16966:53;;;16956:63;;16928:97;17056:2;17074:53;17119:7;17110:6;17099:9;17095:22;17074:53;;;17064:63;;17035:98;17192:2;17181:9;17177:18;17164:32;17216:18;17208:6;17205:30;17202:2;;;17248:1;17245;17238:12;17202:2;17276:64;17332:7;17323:6;17312:9;17308:22;17276:64;;;17258:82;;;;17143:203;17405:2;17394:9;17390:18;17377:32;17429:18;17421:6;17418:30;17415:2;;;17461:1;17458;17451:12;17415:2;17489:64;17545:7;17536:6;17525:9;17521:22;17489:64;;;17471:82;;;;17356:203;16859:710;;;;;;;;;17576:110;17649:31;17674:5;17649:31;;;17644:3;17637:44;17631:55;;;17760:755;;17941:77;18012:5;17941:77;;;18036:6;18031:3;18024:19;18060:4;18055:3;18051:14;18044:21;;18105:79;18178:5;18105:79;;;18205:1;18190:303;18215:6;18212:1;18209:13;18190:303;;;18255:103;18354:3;18345:6;18339:13;18255:103;;;18375:83;18451:6;18375:83;;;18481:4;18472:14;;;;;18365:93;-1:-1;18237:1;18230:9;18190:303;;;-1:-1;18506:3;;17920:595;-1:-1;;;;17920:595;18523:101;18590:28;18612:5;18590:28;;18631:110;18704:31;18729:5;18704:31;;18748:107;18819:30;18843:5;18819:30;;18862:297;;18962:38;18994:5;18962:38;;;19017:6;19012:3;19005:19;19029:63;19085:6;19078:4;19073:3;19069:14;19062:4;19055:5;19051:16;19029:63;;;19124:29;19146:6;19124:29;;;19104:50;;;19117:4;19104:50;;18942:217;-1:-1;;;18942:217;19462:156;19555:57;19606:5;19555:57;;19925:296;20080:2;20068:15;;20117:66;20112:2;20103:12;;20096:88;20212:2;20203:12;;20061:160;20230:296;20385:2;20373:15;;20422:66;20417:2;20408:12;;20401:88;20517:2;20508:12;;20366:160;20535:296;20690:2;20678:15;;20727:66;20722:2;20713:12;;20706:88;20822:2;20813:12;;20671:160;20840:296;20995:2;20983:15;;21032:66;21027:2;21018:12;;21011:88;21127:2;21118:12;;20976:160;21145:296;21300:2;21288:15;;21337:66;21332:2;21323:12;;21316:88;21432:2;21423:12;;21281:160;21450:397;21605:2;21593:15;;21642:66;21637:2;21628:12;;21621:88;21743:66;21738:2;21729:12;;21722:88;21838:2;21829:12;;21586:261;21856:296;22011:2;21999:15;;22048:66;22043:2;22034:12;;22027:88;22143:2;22134:12;;21992:160;22161:296;22316:2;22304:15;;22353:66;22348:2;22339:12;;22332:88;22448:2;22439:12;;22297:160;22466:296;22621:2;22609:15;;22658:66;22653:2;22644:12;;22637:88;22753:2;22744:12;;22602:160;22771:296;22926:2;22914:15;;22963:66;22958:2;22949:12;;22942:88;23058:2;23049:12;;22907:160;23076:296;23231:2;23219:15;;23268:66;23263:2;23254:12;;23247:88;23363:2;23354:12;;23212:160;23381:296;23536:2;23524:15;;23573:66;23568:2;23559:12;;23552:88;23668:2;23659:12;;23517:160;23686:296;23841:2;23829:15;;23878:66;23873:2;23864:12;;23857:88;23973:2;23964:12;;23822:160;23991:296;24146:2;24134:15;;24183:66;24178:2;24169:12;;24162:88;24278:2;24269:12;;24127:160;24296:296;24451:2;24439:15;;24488:66;24483:2;24474:12;;24467:88;24583:2;24574:12;;24432:160;24601:296;24756:2;24744:15;;24793:66;24788:2;24779:12;;24772:88;24888:2;24879:12;;24737:160;24906:296;25061:2;25049:15;;25098:66;25093:2;25084:12;;25077:88;25193:2;25184:12;;25042:160;25211:296;25366:2;25354:15;;25403:66;25398:2;25389:12;;25382:88;25498:2;25489:12;;25347:160;25516:397;25671:2;25659:15;;25708:66;25703:2;25694:12;;25687:88;25809:66;25804:2;25795:12;;25788:88;25904:2;25895:12;;25652:261;25922:296;26077:2;26065:15;;26114:66;26109:2;26100:12;;26093:88;26209:2;26200:12;;26058:160;26227:296;26382:2;26370:15;;26419:66;26414:2;26405:12;;26398:88;26514:2;26505:12;;26363:160;26532:296;26687:2;26675:15;;26724:66;26719:2;26710:12;;26703:88;26819:2;26810:12;;26668:160;26837:296;26992:2;26980:15;;27029:66;27024:2;27015:12;;27008:88;27124:2;27115:12;;26973:160;27142:296;27297:2;27285:15;;27334:66;27329:2;27320:12;;27313:88;27429:2;27420:12;;27278:160;27447:296;27602:2;27590:15;;27639:66;27634:2;27625:12;;27618:88;27734:2;27725:12;;27583:160;27752:296;27907:2;27895:15;;27944:66;27939:2;27930:12;;27923:88;28039:2;28030:12;;27888:160;28057:296;28212:2;28200:15;;28249:66;28244:2;28235:12;;28228:88;28344:2;28335:12;;28193:160;28362:397;28517:2;28505:15;;28554:66;28549:2;28540:12;;28533:88;28655:66;28650:2;28641:12;;28634:88;28750:2;28741:12;;28498:261;28768:296;28923:2;28911:15;;28960:66;28955:2;28946:12;;28939:88;29055:2;29046:12;;28904:160;29073:296;29228:2;29216:15;;29265:66;29260:2;29251:12;;29244:88;29360:2;29351:12;;29209:160;29378:296;29533:2;29521:15;;29570:66;29565:2;29556:12;;29549:88;29665:2;29656:12;;29514:160;29683:296;29838:2;29826:15;;29875:66;29870:2;29861:12;;29854:88;29970:2;29961:12;;29819:160;29988:296;30143:2;30131:15;;30180:66;30175:2;30166:12;;30159:88;30275:2;30266:12;;30124:160;30369:888;30597:22;;30510:4;30501:14;;;30631:61;30505:3;30597:22;30631:61;;;30530:174;30798:4;30791:5;30787:16;30781:23;30816:62;30872:4;30867:3;30863:14;30850:11;30816:62;;;30714:176;30974:4;30967:5;30963:16;30957:23;30992:62;31048:4;31043:3;31039:14;31026:11;30992:62;;;30900:166;31150:4;31143:5;31139:16;31133:23;31168:62;31224:4;31219:3;31215:14;31202:11;31168:62;;32323:815;32548:22;;32478:5;32469:15;;;32582:115;32473:3;32548:22;32582:115;;;32499:210;32786:4;32779:5;32775:16;32769:23;32804:116;32914:4;32909:3;32905:14;32892:11;32804:116;;;32719:213;33030:4;33023:5;33019:16;33013:23;33048:63;33104:5;33099:3;33095:15;33082:11;33048:63;;33206:695;33419:22;;33343:4;33334:14;;;33453:57;33338:3;33419:22;33453:57;;;33363:159;33603:4;33596:5;33592:16;33586:23;33621:62;33677:4;33672:3;33668:14;33655:11;33621:62;;;33532:163;33794:4;33787:5;33783:16;33777:23;33812:62;33868:4;33863:3;33859:14;33846:11;33812:62;;34784:104;34853:29;34876:5;34853:29;;34895:193;35003:2;34988:18;;35017:61;34992:9;35051:6;35017:61;;35095:1057;35427:3;35412:19;;35442:61;35416:9;35476:6;35442:61;;;35514:62;35572:2;35561:9;35557:18;35548:6;35514:62;;;35587;35645:2;35634:9;35630:18;35621:6;35587:62;;;35660;35718:2;35707:9;35703:18;35694:6;35660:62;;;35733:63;35791:3;35780:9;35776:19;35767:6;35733:63;;;35807;35865:3;35854:9;35850:19;35841:6;35807:63;;;35919:9;35913:4;35909:20;35903:3;35892:9;35888:19;35881:49;35944:62;36001:4;35992:6;35944:62;;;35936:70;;36055:9;36049:4;36045:20;36039:3;36028:9;36024:19;36017:49;36080:62;36137:4;36128:6;36080:62;;;36072:70;35398:754;-1:-1;;;;;;;;;;35398:754;36159:547;36351:2;36336:18;;36365:61;36340:9;36399:6;36365:61;;;36474:9;36468:4;36464:20;36459:2;36448:9;36444:18;36437:48;36499:62;36556:4;36547:6;36499:62;;;36491:70;;36609:9;36603:4;36599:20;36594:2;36583:9;36579:18;36572:48;36634:62;36691:4;36682:6;36634:62;;;36626:70;36322:384;-1:-1;;;;;36322:384;36713:433;36917:2;36931:47;;;36902:18;;36992:144;36902:18;37122:6;36992:144;;37153:181;37255:2;37240:18;;37269:55;37244:9;37297:6;37269:55;;37341:193;37449:2;37434:18;;37463:61;37438:9;37497:6;37463:61;;37541:479;37723:2;37708:18;;37737:61;37712:9;37771:6;37737:61;;;37809:62;37867:2;37856:9;37852:18;37843:6;37809:62;;;37919:9;37913:4;37909:20;37904:2;37893:9;37889:18;37882:48;37944:66;38005:4;37996:6;37944:66;;38027:378;38181:2;38166:18;;38195:61;38170:9;38229:6;38195:61;;;38304:9;38298:4;38294:20;38289:2;38278:9;38274:18;38267:48;38329:66;38390:4;38381:6;38329:66;;38412:489;38600:3;38585:19;;38615:61;38589:9;38649:6;38615:61;;;38687:58;38741:2;38730:9;38726:18;38717:6;38687:58;;;38756:62;38814:2;38803:9;38799:18;38790:6;38756:62;;;38829;38887:2;38876:9;38872:18;38863:6;38829:62;;38908:290;39042:2;39027:18;;39056:59;39031:9;39088:6;39056:59;;;39126:62;39184:2;39173:9;39169:18;39160:6;39126:62;;39205:269;39327:2;39341:47;;;39312:18;;39402:62;39312:18;39450:6;39402:62;;39481:233;39609:2;39594:18;;39623:81;39598:9;39677:6;39623:81;;40001:387;40182:2;40196:47;;;40167:18;;40257:121;40167:18;40257:121;;40395:387;40576:2;40590:47;;;40561:18;;40651:121;40561:18;40651:121;;40789:387;40970:2;40984:47;;;40955:18;;41045:121;40955:18;41045:121;;41183:387;41364:2;41378:47;;;41349:18;;41439:121;41349:18;41439:121;;41577:387;41758:2;41772:47;;;41743:18;;41833:121;41743:18;41833:121;;41971:387;42152:2;42166:47;;;42137:18;;42227:121;42137:18;42227:121;;42365:387;42546:2;42560:47;;;42531:18;;42621:121;42531:18;42621:121;;42759:387;42940:2;42954:47;;;42925:18;;43015:121;42925:18;43015:121;;43153:387;43334:2;43348:47;;;43319:18;;43409:121;43319:18;43409:121;;43547:387;43728:2;43742:47;;;43713:18;;43803:121;43713:18;43803:121;;43941:387;44122:2;44136:47;;;44107:18;;44197:121;44107:18;44197:121;;44335:387;44516:2;44530:47;;;44501:18;;44591:121;44501:18;44591:121;;44729:387;44910:2;44924:47;;;44895:18;;44985:121;44895:18;44985:121;;45123:387;45304:2;45318:47;;;45289:18;;45379:121;45289:18;45379:121;;45517:387;45698:2;45712:47;;;45683:18;;45773:121;45683:18;45773:121;;45911:387;46092:2;46106:47;;;46077:18;;46167:121;46077:18;46167:121;;46305:387;46486:2;46500:47;;;46471:18;;46561:121;46471:18;46561:121;;46699:387;46880:2;46894:47;;;46865:18;;46955:121;46865:18;46955:121;;47093:387;47274:2;47288:47;;;47259:18;;47349:121;47259:18;47349:121;;47487:387;47668:2;47682:47;;;47653:18;;47743:121;47653:18;47743:121;;47881:387;48062:2;48076:47;;;48047:18;;48137:121;48047:18;48137:121;;48275:387;48456:2;48470:47;;;48441:18;;48531:121;48441:18;48531:121;;48669:387;48850:2;48864:47;;;48835:18;;48925:121;48835:18;48925:121;;49063:387;49244:2;49258:47;;;49229:18;;49319:121;49229:18;49319:121;;49457:387;49638:2;49652:47;;;49623:18;;49713:121;49623:18;49713:121;;49851:387;50032:2;50046:47;;;50017:18;;50107:121;50017:18;50107:121;;50245:387;50426:2;50440:47;;;50411:18;;50501:121;50411:18;50501:121;;50639:387;50820:2;50834:47;;;50805:18;;50895:121;50805:18;50895:121;;51033:387;51214:2;51228:47;;;51199:18;;51289:121;51199:18;51289:121;;51427:387;51608:2;51622:47;;;51593:18;;51683:121;51593:18;51683:121;;51821:387;52002:2;52016:47;;;51987:18;;52077:121;51987:18;52077:121;;52215:387;52396:2;52410:47;;;52381:18;;52471:121;52381:18;52471:121;;52609:387;52790:2;52804:47;;;52775:18;;52865:121;52775:18;52865:121;;53003:310;53169:3;53154:19;;53184:119;53158:9;53276:6;53184:119;;53320:338;53500:3;53485:19;;53515:133;53489:9;53621:6;53515:133;;53665:301;53827:2;53812:18;;53841:115;53816:9;53929:6;53841:115;;54173:256;54235:2;54229:9;54261:17;;;54336:18;54321:34;;54357:22;;;54318:62;54315:2;;;54393:1;54390;54383:12;54315:2;54409;54402:22;54213:216;;-1:-1;54213:216;54436:263;;54600:18;54592:6;54589:30;54586:2;;;54632:1;54629;54622:12;54586:2;-1:-1;54661:4;54649:17;;;54679:15;;54523:176;55255:254;;55394:18;55386:6;55383:30;55380:2;;;55426:1;55423;55416:12;55380:2;-1:-1;55499:4;55470;55447:17;;;;55466:9;55443:33;55489:15;;55317:192;55783:144;55915:4;55903:17;;55884:43;55936:130;56049:12;;56033:33;56514:128;56594:42;56583:54;;56566:76;56649:92;56722:13;56715:21;;56698:43;56748:79;56817:5;56800:27;56834:151;56913:66;56902:78;;56885:100;57078:88;57156:4;57145:16;;57128:38;57737:135;;57836:31;57861:5;57836:31;;57880:145;57961:6;57956:3;57951;57938:30;-1:-1;58017:1;57999:16;;57992:27;57931:94;58034:268;58099:1;58106:101;58120:6;58117:1;58114:13;58106:101;;;58187:11;;;58181:18;58168:11;;;58161:39;58142:2;58135:10;58106:101;;;58222:6;58219:1;58216:13;58213:2;;;-1:-1;;58287:1;58269:16;;58262:27;58083:219;58310:97;58398:2;58378:14;58394:7;58374:28;;58358:49"
- }
- }
- },
- "sources": {
- "2.0.0/extensions/Forwarder/Forwarder.sol": {
- "id": 0
- },
- "2.0.0/extensions/Forwarder/MixinAssets.sol": {
- "id": 1
- },
- "2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol": {
- "id": 2
- },
- "2.0.0/extensions/Forwarder/MixinForwarderCore.sol": {
- "id": 3
- },
- "2.0.0/extensions/Forwarder/MixinWeth.sol": {
- "id": 4
- },
- "2.0.0/extensions/Forwarder/interfaces/IAssets.sol": {
- "id": 5
- },
- "2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol": {
- "id": 6
- },
- "2.0.0/extensions/Forwarder/libs/LibConstants.sol": {
- "id": 7
- },
- "2.0.0/extensions/Forwarder/mixins/MAssets.sol": {
- "id": 8
- },
- "2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol": {
- "id": 9
- },
- "2.0.0/extensions/Forwarder/mixins/MWeth.sol": {
- "id": 10
- },
- "2.0.0/extensions/OrderValidator/OrderValidator.sol": {
- "id": 11
- },
- "2.0.0/multisig/MultiSigWallet.sol": {
- "id": 12
- },
- "2.0.0/multisig/MultiSigWalletWithTimeLock.sol": {
- "id": 13
- },
- "2.0.0/protocol/AssetProxy/ERC20Proxy.sol": {
- "id": 14
- },
- "2.0.0/protocol/AssetProxy/ERC721Proxy.sol": {
- "id": 15
- },
- "2.0.0/protocol/AssetProxy/MixinAuthorizable.sol": {
- "id": 16
- },
- "2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol": {
- "id": 17
- },
- "2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol": {
- "id": 18
- },
- "2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol": {
- "id": 19
- },
- "2.0.0/protocol/AssetProxyOwner/AssetProxyOwner.sol": {
- "id": 20
- },
- "2.0.0/protocol/Exchange/Exchange.sol": {
- "id": 21
- },
- "2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol": {
- "id": 22
- },
- "2.0.0/protocol/Exchange/MixinExchangeCore.sol": {
- "id": 23
- },
- "2.0.0/protocol/Exchange/MixinMatchOrders.sol": {
- "id": 24
- },
- "2.0.0/protocol/Exchange/MixinSignatureValidator.sol": {
- "id": 25
- },
- "2.0.0/protocol/Exchange/MixinTransactions.sol": {
- "id": 26
- },
- "2.0.0/protocol/Exchange/MixinWrapperFunctions.sol": {
- "id": 27
- },
- "2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol": {
- "id": 28
- },
- "2.0.0/protocol/Exchange/interfaces/IExchange.sol": {
- "id": 29
- },
- "2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol": {
- "id": 30
- },
- "2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol": {
- "id": 31
- },
- "2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol": {
- "id": 32
- },
- "2.0.0/protocol/Exchange/interfaces/ITransactions.sol": {
- "id": 33
- },
- "2.0.0/protocol/Exchange/interfaces/IValidator.sol": {
- "id": 34
- },
- "2.0.0/protocol/Exchange/interfaces/IWallet.sol": {
- "id": 35
- },
- "2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol": {
- "id": 36
- },
- "2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol": {
- "id": 37
- },
- "2.0.0/protocol/Exchange/libs/LibConstants.sol": {
- "id": 38
- },
- "2.0.0/protocol/Exchange/libs/LibEIP712.sol": {
- "id": 39
- },
- "2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol": {
- "id": 40
- },
- "2.0.0/protocol/Exchange/libs/LibFillResults.sol": {
- "id": 41
- },
- "2.0.0/protocol/Exchange/libs/LibMath.sol": {
- "id": 42
- },
- "2.0.0/protocol/Exchange/libs/LibOrder.sol": {
- "id": 43
- },
- "2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol": {
- "id": 44
- },
- "2.0.0/protocol/Exchange/mixins/MExchangeCore.sol": {
- "id": 45
- },
- "2.0.0/protocol/Exchange/mixins/MMatchOrders.sol": {
- "id": 46
- },
- "2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol": {
- "id": 47
- },
- "2.0.0/protocol/Exchange/mixins/MTransactions.sol": {
- "id": 48
- },
- "2.0.0/protocol/Exchange/mixins/MWrapperFunctions.sol": {
- "id": 49
- },
- "2.0.0/test/DummyERC20Token/DummyERC20Token.sol": {
- "id": 50
- },
- "2.0.0/test/DummyERC721Token/DummyERC721Token.sol": {
- "id": 51
- },
- "2.0.0/tokens/ERC20Token/ERC20Token.sol": {
- "id": 52
- },
- "2.0.0/tokens/ERC20Token/IERC20Token.sol": {
- "id": 53
- },
- "2.0.0/tokens/ERC20Token/MintableERC20Token.sol": {
- "id": 54
- },
- "2.0.0/tokens/ERC20Token/UnlimitedAllowanceERC20Token.sol": {
- "id": 55
- },
- "2.0.0/tokens/ERC721Token/ERC721Token.sol": {
- "id": 56
- },
- "2.0.0/tokens/ERC721Token/IERC721Receiver.sol": {
- "id": 57
- },
- "2.0.0/tokens/ERC721Token/IERC721Token.sol": {
- "id": 58
- },
- "2.0.0/tokens/ERC721Token/MintableERC721Token.sol": {
- "id": 59
- },
- "2.0.0/tokens/EtherToken/IEtherToken.sol": {
- "id": 60
- },
- "2.0.0/utils/LibBytes/LibBytes.sol": {
- "id": 61
- },
- "2.0.0/utils/Ownable/IOwnable.sol": {
- "id": 62
- },
- "2.0.0/utils/Ownable/Ownable.sol": {
- "id": 63
- },
- "2.0.0/utils/ReentrancyGuard/ReentrancyGuard.sol": {
- "id": 64
- },
- "2.0.0/utils/SafeMath/SafeMath.sol": {
- "id": 65
- }
- },
- "sourceCodes": {
- "2.0.0/extensions/Forwarder/Forwarder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./MixinWeth.sol\";\nimport \"./MixinForwarderCore.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./MixinAssets.sol\";\nimport \"./MixinExchangeWrapper.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract Forwarder is\n LibConstants,\n MixinWeth,\n MixinAssets,\n MixinExchangeWrapper,\n MixinForwarderCore\n{\n constructor (\n address _exchange,\n bytes memory _zrxAssetData,\n bytes memory _wethAssetData\n )\n public\n LibConstants(\n _exchange,\n _zrxAssetData,\n _wethAssetData\n )\n MixinForwarderCore()\n {}\n}\n",
- "2.0.0/extensions/Forwarder/MixinAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"../../tokens/ERC20Token/IERC20Token.sol\";\nimport \"../../tokens/ERC721Token/IERC721Token.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MAssets.sol\";\n\n\ncontract MixinAssets is\n Ownable,\n LibConstants,\n MAssets\n{\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_TRANSFER_SELECTOR = bytes4(keccak256(\"transfer(address,uint256)\"));\n\n /// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to \n /// function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be\n /// used to withdraw assets that were accidentally sent to this contract.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of ERC20 token to withdraw.\n function withdrawAsset(\n bytes assetData,\n uint256 amount\n )\n external\n onlyOwner\n {\n transferAssetToSender(assetData, amount);\n }\n\n /// @dev Transfers given amount of asset to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferAssetToSender(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n bytes4 proxyId = assetData.readBytes4(0);\n\n if (proxyId == ERC20_DATA_ID) {\n transferERC20Token(assetData, amount);\n } else if (proxyId == ERC721_DATA_ID) {\n transferERC721Token(assetData, amount);\n } else {\n revert(\"UNSUPPORTED_ASSET_PROXY\");\n }\n }\n\n /// @dev Decodes ERC20 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC20Token(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n address token = assetData.readAddress(16);\n\n // Transfer tokens.\n // We do a raw call so we can check the success separate\n // from the return data.\n bool success = token.call(abi.encodeWithSelector(\n ERC20_TRANSFER_SELECTOR,\n msg.sender,\n amount\n ));\n require(\n success,\n \"TRANSFER_FAILED\"\n );\n \n // Check return data.\n // If there is no return data, we assume the token incorrectly\n // does not return a bool. In this case we expect it to revert\n // on failure, which was handled above.\n // If the token does return data, we require that it is a single\n // value that evaluates to true.\n assembly {\n if returndatasize {\n success := 0\n if eq(returndatasize, 32) {\n // First 64 bytes of memory are reserved scratch space\n returndatacopy(0, 0, 32)\n success := mload(0)\n }\n }\n }\n require(\n success,\n \"TRANSFER_FAILED\"\n );\n }\n\n /// @dev Decodes ERC721 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC721Token(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n require(\n amount == 1,\n \"INVALID_AMOUNT\"\n );\n // Decode asset data.\n address token = assetData.readAddress(16);\n uint256 tokenId = assetData.readUint256(36);\n\n // Perform transfer.\n IERC721Token(token).transferFrom(\n address(this),\n msg.sender,\n tokenId\n );\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MExchangeWrapper.sol\";\nimport \"../../protocol/Exchange/libs/LibAbiEncoder.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../protocol/Exchange/libs/LibFillResults.sol\";\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\n\n\ncontract MixinExchangeWrapper is\n LibAbiEncoder,\n LibFillResults,\n LibMath,\n LibConstants,\n MExchangeWrapper\n{\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n // ABI encode calldata for `fillOrder`\n bytes memory fillOrderCalldata = abiEncodeFillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n\n address exchange = address(EXCHANGE);\n\n // Call `fillOrder` and handle any exceptions gracefully\n assembly {\n let success := call(\n gas, // forward all gas\n exchange, // call address of Exchange contract\n 0, // transfer 0 wei\n add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes)\n mload(fillOrderCalldata), // length of input\n fillOrderCalldata, // write output over input\n 128 // output size is 128 bytes\n )\n if success {\n mstore(fillResults, mload(fillOrderCalldata))\n mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32)))\n mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64)))\n mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96)))\n }\n }\n // fillResults values will be 0 by default if call was unsuccessful\n return fillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of WETH has been sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param wethSellAmount Desired amount of WETH to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellWeth(\n LibOrder.Order[] memory orders,\n uint256 wethSellAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // We assume that asset being sold by taker is WETH for each order.\n orders[i].makerAssetData = makerAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of WETH to sell\n uint256 remainingTakerAssetFillAmount = safeSub(wethSellAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of WETH\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= wethSellAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// The asset being sold by taker must always be WETH.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyExactAmountWithWeth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // We assume that asset being sold by taker is WETH for each order.\n orders[i].makerAssetData = makerAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n uint256 makerAssetFilledAmount = totalFillResults.makerAssetFilledAmount;\n if (makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n\n require(\n makerAssetFilledAmount >= makerAssetFillAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return totalFillResults;\n }\n\n /// @dev Buys zrxBuyAmount of ZRX fee tokens, taking into account ZRX fees for each order. This will guarantee\n /// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues).\n /// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX\n /// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases.\n /// The asset being sold by taker must always be WETH. \n /// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset.\n /// @param zrxBuyAmount Desired amount of ZRX to buy.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return totalFillResults Amounts filled and fees paid by maker and taker.\n function marketBuyExactZrxWithWeth(\n LibOrder.Order[] memory orders,\n uint256 zrxBuyAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n // Do nothing if zrxBuyAmount == 0\n if (zrxBuyAmount == 0) {\n return totalFillResults;\n }\n\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n uint256 zrxPurchased = 0;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // All of these are ZRX/WETH, so we can drop the respective assetData from calldata.\n orders[i].makerAssetData = zrxAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of ZRX to buy.\n uint256 remainingZrxBuyAmount = safeSub(zrxBuyAmount, zrxPurchased);\n\n // Convert the remaining amount of ZRX to buy into remaining amount\n // of WETH to sell, assuming entire amount can be sold in the current order.\n uint256 remainingWethSellAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n safeSub(orders[i].makerAssetAmount, orders[i].takerFee), // our exchange rate after fees \n remainingZrxBuyAmount\n );\n\n // Attempt to sell the remaining amount of WETH.\n FillResults memory singleFillResult = fillOrderNoThrow(\n orders[i],\n safeAdd(remainingWethSellAmount, 1), // we add 1 wei to the fill amount to make up for rounding errors\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker.\n addFillResults(totalFillResults, singleFillResult);\n zrxPurchased = safeSub(totalFillResults.makerAssetFilledAmount, totalFillResults.takerFeePaid);\n\n // Stop execution if the entire amount of ZRX has been bought.\n if (zrxPurchased >= zrxBuyAmount) {\n break;\n }\n }\n\n require(\n zrxPurchased >= zrxBuyAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return totalFillResults;\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinForwarderCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MWeth.sol\";\nimport \"./mixins/MAssets.sol\";\nimport \"./mixins/MExchangeWrapper.sol\";\nimport \"./interfaces/IForwarderCore.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../protocol/Exchange/libs/LibFillResults.sol\";\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\n\n\ncontract MixinForwarderCore is\n LibFillResults,\n LibMath,\n LibConstants,\n MWeth,\n MAssets,\n MExchangeWrapper,\n IForwarderCore\n{\n using LibBytes for bytes;\n\n /// @dev Constructor approves ERC20 proxy to transfer ZRX and WETH on this contract's behalf.\n constructor ()\n public\n {\n address proxyAddress = EXCHANGE.getAssetProxy(ERC20_DATA_ID);\n require(\n proxyAddress != address(0),\n \"UNREGISTERED_ASSET_PROXY\"\n );\n ETHER_TOKEN.approve(proxyAddress, MAX_UINT);\n ZRX_TOKEN.approve(proxyAddress, MAX_UINT);\n }\n\n /// @dev Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketSellOrdersWithEth(\n LibOrder.Order[] memory orders,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n FillResults memory orderFillResults,\n FillResults memory feeOrderFillResults\n )\n {\n // Convert ETH to WETH.\n convertEthToWeth();\n\n uint256 wethSellAmount;\n uint256 zrxBuyAmount;\n uint256 makerAssetAmountPurchased;\n if (orders[0].makerAssetData.equals(ZRX_ASSET_DATA)) {\n // Calculate amount of WETH that won't be spent on ETH fees.\n wethSellAmount = getPartialAmountFloor(\n PERCENTAGE_DENOMINATOR,\n safeAdd(PERCENTAGE_DENOMINATOR, feePercentage),\n msg.value\n );\n // Market sell available WETH.\n // ZRX fees are paid with this contract's balance.\n orderFillResults = marketSellWeth(\n orders,\n wethSellAmount,\n signatures\n );\n // The fee amount must be deducted from the amount transfered back to sender.\n makerAssetAmountPurchased = safeSub(orderFillResults.makerAssetFilledAmount, orderFillResults.takerFeePaid);\n } else {\n // 5% of WETH is reserved for filling feeOrders and paying feeRecipient.\n wethSellAmount = getPartialAmountFloor(\n MAX_WETH_FILL_PERCENTAGE,\n PERCENTAGE_DENOMINATOR,\n msg.value\n );\n // Market sell 95% of WETH.\n // ZRX fees are payed with this contract's balance.\n orderFillResults = marketSellWeth(\n orders,\n wethSellAmount,\n signatures\n );\n // Buy back all ZRX spent on fees.\n zrxBuyAmount = orderFillResults.takerFeePaid;\n feeOrderFillResults = marketBuyExactZrxWithWeth(\n feeOrders,\n zrxBuyAmount,\n feeSignatures\n );\n makerAssetAmountPurchased = orderFillResults.makerAssetFilledAmount;\n }\n\n // Transfer feePercentage of total ETH spent on primary orders to feeRecipient.\n // Refund remaining ETH to msg.sender.\n transferEthFeeAndRefund(\n orderFillResults.takerAssetFilledAmount,\n feeOrderFillResults.takerAssetFilledAmount,\n feePercentage,\n feeRecipient\n );\n\n // Transfer purchased assets to msg.sender.\n transferAssetToSender(orders[0].makerAssetData, makerAssetAmountPurchased);\n }\n\n /// @dev Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param makerAssetFillAmount Desired amount of makerAsset to purchase.\n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketBuyOrdersWithEth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n FillResults memory orderFillResults,\n FillResults memory feeOrderFillResults\n )\n {\n // Convert ETH to WETH.\n convertEthToWeth();\n\n uint256 zrxBuyAmount;\n uint256 makerAssetAmountPurchased;\n if (orders[0].makerAssetData.equals(ZRX_ASSET_DATA)) {\n // If the makerAsset is ZRX, it is not necessary to pay fees out of this\n // contracts's ZRX balance because fees are factored into the price of the order.\n orderFillResults = marketBuyExactZrxWithWeth(\n orders,\n makerAssetFillAmount,\n signatures\n );\n // The fee amount must be deducted from the amount transfered back to sender.\n makerAssetAmountPurchased = safeSub(orderFillResults.makerAssetFilledAmount, orderFillResults.takerFeePaid);\n } else {\n // Attemp to purchase desired amount of makerAsset.\n // ZRX fees are payed with this contract's balance.\n orderFillResults = marketBuyExactAmountWithWeth(\n orders,\n makerAssetFillAmount,\n signatures\n );\n // Buy back all ZRX spent on fees.\n zrxBuyAmount = orderFillResults.takerFeePaid;\n feeOrderFillResults = marketBuyExactZrxWithWeth(\n feeOrders,\n zrxBuyAmount,\n feeSignatures\n );\n makerAssetAmountPurchased = orderFillResults.makerAssetFilledAmount;\n }\n\n // Transfer feePercentage of total ETH spent on primary orders to feeRecipient.\n // Refund remaining ETH to msg.sender.\n transferEthFeeAndRefund(\n orderFillResults.takerAssetFilledAmount,\n feeOrderFillResults.takerAssetFilledAmount,\n feePercentage,\n feeRecipient\n );\n\n // Transfer purchased assets to msg.sender.\n transferAssetToSender(orders[0].makerAssetData, makerAssetAmountPurchased);\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinWeth.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MWeth.sol\";\n\n\ncontract MixinWeth is\n LibMath,\n LibConstants,\n MWeth\n{\n /// @dev Default payabale function, this allows us to withdraw WETH\n function ()\n public\n payable\n {\n require(\n msg.sender == address(ETHER_TOKEN),\n \"DEFAULT_FUNCTION_WETH_CONTRACT_ONLY\"\n );\n }\n\n /// @dev Converts message call's ETH value into WETH.\n function convertEthToWeth()\n internal\n {\n require(\n msg.value > 0,\n \"INVALID_MSG_VALUE\"\n );\n ETHER_TOKEN.deposit.value(msg.value)();\n }\n\n /// @dev Transfers feePercentage of WETH spent on primary orders to feeRecipient.\n /// Refunds any excess ETH to msg.sender.\n /// @param wethSoldExcludingFeeOrders Amount of WETH sold when filling primary orders.\n /// @param wethSoldForZrx Amount of WETH sold when purchasing ZRX required for primary order fees.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n function transferEthFeeAndRefund(\n uint256 wethSoldExcludingFeeOrders,\n uint256 wethSoldForZrx,\n uint256 feePercentage,\n address feeRecipient\n )\n internal\n {\n // Ensure feePercentage is less than 5%.\n require(\n feePercentage <= MAX_FEE_PERCENTAGE,\n \"FEE_PERCENTAGE_TOO_LARGE\"\n );\n\n // Ensure that no extra WETH owned by this contract has been sold.\n uint256 wethSold = safeAdd(wethSoldExcludingFeeOrders, wethSoldForZrx);\n require(\n wethSold <= msg.value,\n \"OVERSOLD_WETH\"\n );\n\n // Calculate amount of WETH that hasn't been sold.\n uint256 wethRemaining = safeSub(msg.value, wethSold);\n\n // Calculate ETH fee to pay to feeRecipient.\n uint256 ethFee = getPartialAmountFloor(\n feePercentage,\n PERCENTAGE_DENOMINATOR,\n wethSoldExcludingFeeOrders\n );\n\n // Ensure fee is less than amount of WETH remaining.\n require(\n ethFee <= wethRemaining,\n \"INSUFFICIENT_ETH_REMAINING\"\n );\n \n // Do nothing if no WETH remaining\n if (wethRemaining > 0) {\n // Convert remaining WETH to ETH\n ETHER_TOKEN.withdraw(wethRemaining);\n\n // Pay ETH to feeRecipient\n if (ethFee > 0) {\n feeRecipient.transfer(ethFee);\n }\n\n // Refund remaining ETH to msg.sender.\n uint256 ethRefund = safeSub(wethRemaining, ethFee);\n if (ethRefund > 0) {\n msg.sender.transfer(ethRefund);\n }\n }\n }\n}\n",
- "2.0.0/extensions/Forwarder/interfaces/IAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IAssets {\n\n /// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to \n /// function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be\n /// used to withdraw assets that were accidentally sent to this contract.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of ERC20 token to withdraw.\n function withdrawAsset(\n bytes assetData,\n uint256 amount\n )\n external;\n}\n",
- "2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../../protocol/Exchange/libs/LibFillResults.sol\";\n\n\ncontract IForwarderCore {\n\n /// @dev Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketSellOrdersWithEth(\n LibOrder.Order[] memory orders,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n LibFillResults.FillResults memory orderFillResults,\n LibFillResults.FillResults memory feeOrderFillResults\n );\n\n /// @dev Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param makerAssetFillAmount Desired amount of makerAsset to purchase.\n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketBuyOrdersWithEth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n LibFillResults.FillResults memory orderFillResults,\n LibFillResults.FillResults memory feeOrderFillResults\n );\n}\n",
- "2.0.0/extensions/Forwarder/libs/LibConstants.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/LibBytes/LibBytes.sol\";\nimport \"../../../protocol/Exchange/interfaces/IExchange.sol\";\nimport \"../../../tokens/EtherToken/IEtherToken.sol\";\nimport \"../../../tokens/ERC20Token/IERC20Token.sol\";\n\n\ncontract LibConstants {\n\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n uint256 constant internal MAX_UINT = 2**256 - 1;\n uint256 constant internal PERCENTAGE_DENOMINATOR = 10**18; \n uint256 constant internal MAX_FEE_PERCENTAGE = 5 * PERCENTAGE_DENOMINATOR / 100; // 5%\n uint256 constant internal MAX_WETH_FILL_PERCENTAGE = 95 * PERCENTAGE_DENOMINATOR / 100; // 95%\n \n // solhint-disable var-name-mixedcase\n IExchange internal EXCHANGE;\n IEtherToken internal ETHER_TOKEN;\n IERC20Token internal ZRX_TOKEN;\n bytes internal ZRX_ASSET_DATA;\n bytes internal WETH_ASSET_DATA;\n // solhint-enable var-name-mixedcase\n\n constructor (\n address _exchange,\n bytes memory _zrxAssetData,\n bytes memory _wethAssetData\n )\n public\n {\n EXCHANGE = IExchange(_exchange);\n ZRX_ASSET_DATA = _zrxAssetData;\n WETH_ASSET_DATA = _wethAssetData;\n\n address etherToken = _wethAssetData.readAddress(16);\n address zrxToken = _zrxAssetData.readAddress(16);\n ETHER_TOKEN = IEtherToken(etherToken);\n ZRX_TOKEN = IERC20Token(zrxToken);\n }\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAssets.sol\";\n\n\ncontract MAssets is\n IAssets\n{\n /// @dev Transfers given amount of asset to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferAssetToSender(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n\n /// @dev Decodes ERC20 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC20Token(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n\n /// @dev Decodes ERC721 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC721Token(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../../protocol/Exchange/libs/LibFillResults.sol\";\n\n\ncontract MExchangeWrapper {\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of WETH has been sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param wethSellAmount Desired amount of WETH to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellWeth(\n LibOrder.Order[] memory orders,\n uint256 wethSellAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// The asset being sold by taker must always be WETH.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyExactAmountWithWeth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Buys zrxBuyAmount of ZRX fee tokens, taking into account ZRX fees for each order. This will guarantee\n /// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues).\n /// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX\n /// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases.\n /// The asset being sold by taker must always be WETH. \n /// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset.\n /// @param zrxBuyAmount Desired amount of ZRX to buy.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return totalFillResults Amounts filled and fees paid by maker and taker.\n function marketBuyExactZrxWithWeth(\n LibOrder.Order[] memory orders,\n uint256 zrxBuyAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MWeth.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract MWeth {\n\n /// @dev Converts message call's ETH value into WETH.\n function convertEthToWeth()\n internal;\n\n /// @dev Transfers feePercentage of WETH spent on primary orders to feeRecipient.\n /// Refunds any excess ETH to msg.sender.\n /// @param wethSoldExcludingFeeOrders Amount of WETH sold when filling primary orders.\n /// @param wethSoldForZrx Amount of WETH sold when purchasing ZRX required for primary order fees.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n function transferEthFeeAndRefund(\n uint256 wethSoldExcludingFeeOrders,\n uint256 wethSoldForZrx,\n uint256 feePercentage,\n address feeRecipient\n )\n internal;\n}\n",
- "2.0.0/extensions/OrderValidator/OrderValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../protocol/Exchange/interfaces/IExchange.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../tokens/ERC20Token/IERC20Token.sol\";\nimport \"../../tokens/ERC721Token/IERC721Token.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\n\n\ncontract OrderValidator {\n\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n\n struct TraderInfo {\n uint256 makerBalance; // Maker's balance of makerAsset\n uint256 makerAllowance; // Maker's allowance to corresponding AssetProxy\n uint256 takerBalance; // Taker's balance of takerAsset\n uint256 takerAllowance; // Taker's allowance to corresponding AssetProxy\n uint256 makerZrxBalance; // Maker's balance of ZRX\n uint256 makerZrxAllowance; // Maker's allowance of ZRX to ERC20Proxy\n uint256 takerZrxBalance; // Taker's balance of ZRX\n uint256 takerZrxAllowance; // Taker's allowance of ZRX to ERC20Proxy\n }\n\n // solhint-disable var-name-mixedcase\n IExchange internal EXCHANGE;\n bytes internal ZRX_ASSET_DATA;\n // solhint-enable var-name-mixedcase\n\n constructor (address _exchange, bytes memory _zrxAssetData)\n public\n {\n EXCHANGE = IExchange(_exchange);\n ZRX_ASSET_DATA = _zrxAssetData;\n }\n\n /// @dev Fetches information for order and maker/taker of order.\n /// @param order The order structure.\n /// @param takerAddress Address that will be filling the order.\n /// @return OrderInfo and TraderInfo instances for given order.\n function getOrderAndTraderInfo(LibOrder.Order memory order, address takerAddress)\n public\n view\n returns (LibOrder.OrderInfo memory orderInfo, TraderInfo memory traderInfo)\n {\n orderInfo = EXCHANGE.getOrderInfo(order);\n traderInfo = getTraderInfo(order, takerAddress);\n return (orderInfo, traderInfo);\n }\n\n /// @dev Fetches information for all passed in orders and the makers/takers of each order.\n /// @param orders Array of order specifications.\n /// @param takerAddresses Array of taker addresses corresponding to each order.\n /// @return Arrays of OrderInfo and TraderInfo instances that correspond to each order.\n function getOrdersAndTradersInfo(LibOrder.Order[] memory orders, address[] memory takerAddresses)\n public\n view\n returns (LibOrder.OrderInfo[] memory ordersInfo, TraderInfo[] memory tradersInfo)\n {\n ordersInfo = EXCHANGE.getOrdersInfo(orders);\n tradersInfo = getTradersInfo(orders, takerAddresses);\n return (ordersInfo, tradersInfo);\n }\n\n /// @dev Fetches balance and allowances for maker and taker of order.\n /// @param order The order structure.\n /// @param takerAddress Address that will be filling the order.\n /// @return Balances and allowances of maker and taker of order.\n function getTraderInfo(LibOrder.Order memory order, address takerAddress)\n public\n view\n returns (TraderInfo memory traderInfo)\n {\n (traderInfo.makerBalance, traderInfo.makerAllowance) = getBalanceAndAllowance(order.makerAddress, order.makerAssetData);\n (traderInfo.takerBalance, traderInfo.takerAllowance) = getBalanceAndAllowance(takerAddress, order.takerAssetData);\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n (traderInfo.makerZrxBalance, traderInfo.makerZrxAllowance) = getBalanceAndAllowance(order.makerAddress, zrxAssetData);\n (traderInfo.takerZrxBalance, traderInfo.takerZrxAllowance) = getBalanceAndAllowance(takerAddress, zrxAssetData);\n return traderInfo;\n }\n\n /// @dev Fetches balances and allowances of maker and taker for each provided order.\n /// @param orders Array of order specifications.\n /// @param takerAddresses Array of taker addresses corresponding to each order.\n /// @return Array of balances and allowances for maker and taker of each order.\n function getTradersInfo(LibOrder.Order[] memory orders, address[] memory takerAddresses)\n public\n view\n returns (TraderInfo[] memory)\n {\n uint256 ordersLength = orders.length;\n TraderInfo[] memory tradersInfo = new TraderInfo[](ordersLength);\n for (uint256 i = 0; i != ordersLength; i++) {\n tradersInfo[i] = getTraderInfo(orders[i], takerAddresses[i]);\n }\n return tradersInfo;\n }\n\n /// @dev Fetches token balances and allowances of an address to given assetProxy. Supports ERC20 and ERC721.\n /// @param target Address to fetch balances and allowances of.\n /// @param assetData Encoded data that can be decoded by a specified proxy contract when transferring asset.\n /// @return Balance of asset and allowance set to given proxy of asset.\n /// For ERC721 tokens, these values will always be 1 or 0.\n function getBalanceAndAllowance(address target, bytes memory assetData)\n public\n view\n returns (uint256 balance, uint256 allowance)\n {\n bytes4 assetProxyId = assetData.readBytes4(0);\n address token = assetData.readAddress(16);\n address assetProxy = EXCHANGE.getAssetProxy(assetProxyId);\n\n if (assetProxyId == ERC20_DATA_ID) {\n // Query balance\n balance = IERC20Token(token).balanceOf(target);\n\n // Query allowance\n allowance = IERC20Token(token).allowance(target, assetProxy);\n } else if (assetProxyId == ERC721_DATA_ID) {\n uint256 tokenId = assetData.readUint256(36);\n\n // Query owner of tokenId\n address owner = getERC721TokenOwner(token, tokenId);\n\n // Set balance to 1 if tokenId is owned by target\n balance = target == owner ? 1 : 0;\n\n // Check if ERC721Proxy is approved to spend tokenId\n bool isApproved = IERC721Token(token).isApprovedForAll(target, assetProxy) || IERC721Token(token).getApproved(tokenId) == assetProxy;\n \n // Set alowance to 1 if ERC721Proxy is approved to spend tokenId\n allowance = isApproved ? 1 : 0;\n } else {\n revert(\"UNSUPPORTED_ASSET_PROXY\");\n }\n return (balance, allowance);\n }\n\n /// @dev Fetches token balances and allowances of an address for each given assetProxy. Supports ERC20 and ERC721.\n /// @param target Address to fetch balances and allowances of.\n /// @param assetData Array of encoded byte arrays that can be decoded by a specified proxy contract when transferring asset.\n /// @return Balances and allowances of assets.\n /// For ERC721 tokens, these values will always be 1 or 0.\n function getBalancesAndAllowances(address target, bytes[] memory assetData)\n public\n view\n returns (uint256[] memory, uint256[] memory)\n {\n uint256 length = assetData.length;\n uint256[] memory balances = new uint256[](length);\n uint256[] memory allowances = new uint256[](length);\n for (uint256 i = 0; i != length; i++) {\n (balances[i], allowances[i]) = getBalanceAndAllowance(target, assetData[i]);\n }\n return (balances, allowances);\n }\n\n /// @dev Calls `token.ownerOf(tokenId)`, but returns a null owner instead of reverting on an unowned token.\n /// @param token Address of ERC721 token.\n /// @param tokenId The identifier for the specific NFT.\n /// @return Owner of tokenId or null address if unowned.\n function getERC721TokenOwner(address token, uint256 tokenId)\n public\n view\n returns (address owner)\n {\n assembly {\n // load free memory pointer\n let cdStart := mload(64)\n\n // bytes4(keccak256(ownerOf(uint256))) = 0x6352211e\n mstore(cdStart, 0x6352211e00000000000000000000000000000000000000000000000000000000)\n mstore(add(cdStart, 4), tokenId)\n\n // staticcall `ownerOf(tokenId)`\n // `ownerOf` will revert if tokenId is not owned\n let success := staticcall(\n gas, // forward all gas\n token, // call token contract\n cdStart, // start of calldata\n 36, // length of input is 36 bytes\n cdStart, // write output over input\n 32 // size of output is 32 bytes\n )\n\n // Success implies that tokenId is owned\n // Copy owner from return data if successful\n if success {\n owner := mload(cdStart)\n } \n }\n\n // Owner initialized to address(0), no need to modify if call is unsuccessful\n return owner;\n }\n}\n",
- "2.0.0/multisig/MultiSigWallet.sol": "// solhint-disable\npragma solidity ^0.4.15;\n\n\n/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.\n/// @author Stefan George - <stefan.george@consensys.net>\ncontract MultiSigWallet {\n\n /*\n * Events\n */\n event Confirmation(address indexed sender, uint indexed transactionId);\n event Revocation(address indexed sender, uint indexed transactionId);\n event Submission(uint indexed transactionId);\n event Execution(uint indexed transactionId);\n event ExecutionFailure(uint indexed transactionId);\n event Deposit(address indexed sender, uint value);\n event OwnerAddition(address indexed owner);\n event OwnerRemoval(address indexed owner);\n event RequirementChange(uint required);\n\n /*\n * Constants\n */\n uint constant public MAX_OWNER_COUNT = 50;\n\n /*\n * Storage\n */\n mapping (uint => Transaction) public transactions;\n mapping (uint => mapping (address => bool)) public confirmations;\n mapping (address => bool) public isOwner;\n address[] public owners;\n uint public required;\n uint public transactionCount;\n\n struct Transaction {\n address destination;\n uint value;\n bytes data;\n bool executed;\n }\n\n /*\n * Modifiers\n */\n modifier onlyWallet() {\n require(msg.sender == address(this));\n _;\n }\n\n modifier ownerDoesNotExist(address owner) {\n require(!isOwner[owner]);\n _;\n }\n\n modifier ownerExists(address owner) {\n require(isOwner[owner]);\n _;\n }\n\n modifier transactionExists(uint transactionId) {\n require(transactions[transactionId].destination != 0);\n _;\n }\n\n modifier confirmed(uint transactionId, address owner) {\n require(confirmations[transactionId][owner]);\n _;\n }\n\n modifier notConfirmed(uint transactionId, address owner) {\n require(!confirmations[transactionId][owner]);\n _;\n }\n\n modifier notExecuted(uint transactionId) {\n require(!transactions[transactionId].executed);\n _;\n }\n\n modifier notNull(address _address) {\n require(_address != 0);\n _;\n }\n\n modifier validRequirement(uint ownerCount, uint _required) {\n require(ownerCount <= MAX_OWNER_COUNT\n && _required <= ownerCount\n && _required != 0\n && ownerCount != 0);\n _;\n }\n\n /// @dev Fallback function allows to deposit ether.\n function()\n payable\n {\n if (msg.value > 0)\n Deposit(msg.sender, msg.value);\n }\n\n /*\n * Public functions\n */\n /// @dev Contract constructor sets initial owners and required number of confirmations.\n /// @param _owners List of initial owners.\n /// @param _required Number of required confirmations.\n function MultiSigWallet(address[] _owners, uint _required)\n public\n validRequirement(_owners.length, _required)\n {\n for (uint i=0; i<_owners.length; i++) {\n require(!isOwner[_owners[i]] && _owners[i] != 0);\n isOwner[_owners[i]] = true;\n }\n owners = _owners;\n required = _required;\n }\n\n /// @dev Allows to add a new owner. Transaction has to be sent by wallet.\n /// @param owner Address of new owner.\n function addOwner(address owner)\n public\n onlyWallet\n ownerDoesNotExist(owner)\n notNull(owner)\n validRequirement(owners.length + 1, required)\n {\n isOwner[owner] = true;\n owners.push(owner);\n OwnerAddition(owner);\n }\n\n /// @dev Allows to remove an owner. Transaction has to be sent by wallet.\n /// @param owner Address of owner.\n function removeOwner(address owner)\n public\n onlyWallet\n ownerExists(owner)\n {\n isOwner[owner] = false;\n for (uint i=0; i<owners.length - 1; i++)\n if (owners[i] == owner) {\n owners[i] = owners[owners.length - 1];\n break;\n }\n owners.length -= 1;\n if (required > owners.length)\n changeRequirement(owners.length);\n OwnerRemoval(owner);\n }\n\n /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet.\n /// @param owner Address of owner to be replaced.\n /// @param newOwner Address of new owner.\n function replaceOwner(address owner, address newOwner)\n public\n onlyWallet\n ownerExists(owner)\n ownerDoesNotExist(newOwner)\n {\n for (uint i=0; i<owners.length; i++)\n if (owners[i] == owner) {\n owners[i] = newOwner;\n break;\n }\n isOwner[owner] = false;\n isOwner[newOwner] = true;\n OwnerRemoval(owner);\n OwnerAddition(newOwner);\n }\n\n /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet.\n /// @param _required Number of required confirmations.\n function changeRequirement(uint _required)\n public\n onlyWallet\n validRequirement(owners.length, _required)\n {\n required = _required;\n RequirementChange(_required);\n }\n\n /// @dev Allows an owner to submit and confirm a transaction.\n /// @param destination Transaction target address.\n /// @param value Transaction ether value.\n /// @param data Transaction data payload.\n /// @return Returns transaction ID.\n function submitTransaction(address destination, uint value, bytes data)\n public\n returns (uint transactionId)\n {\n transactionId = addTransaction(destination, value, data);\n confirmTransaction(transactionId);\n }\n\n /// @dev Allows an owner to confirm a transaction.\n /// @param transactionId Transaction ID.\n function confirmTransaction(uint transactionId)\n public\n ownerExists(msg.sender)\n transactionExists(transactionId)\n notConfirmed(transactionId, msg.sender)\n {\n confirmations[transactionId][msg.sender] = true;\n Confirmation(msg.sender, transactionId);\n executeTransaction(transactionId);\n }\n\n /// @dev Allows an owner to revoke a confirmation for a transaction.\n /// @param transactionId Transaction ID.\n function revokeConfirmation(uint transactionId)\n public\n ownerExists(msg.sender)\n confirmed(transactionId, msg.sender)\n notExecuted(transactionId)\n {\n confirmations[transactionId][msg.sender] = false;\n Revocation(msg.sender, transactionId);\n }\n\n /// @dev Allows anyone to execute a confirmed transaction.\n /// @param transactionId Transaction ID.\n function executeTransaction(uint transactionId)\n public\n ownerExists(msg.sender)\n confirmed(transactionId, msg.sender)\n notExecuted(transactionId)\n {\n if (isConfirmed(transactionId)) {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data))\n Execution(transactionId);\n else {\n ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n }\n\n // call has been separated into its own function in order to take advantage\n // of the Solidity's code generator to produce a loop that copies tx.data into memory.\n function external_call(address destination, uint value, uint dataLength, bytes data) internal returns (bool) {\n bool result;\n assembly {\n let x := mload(0x40) // \"Allocate\" memory for output (0x40 is where \"free memory\" pointer is stored by convention)\n let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that\n result := call(\n sub(gas, 34710), // 34710 is the value that solidity is currently emitting\n // It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) +\n // callNewAccountGas (25000, in case the destination address does not exist and needs creating)\n destination,\n value,\n d,\n dataLength, // Size of the input (in bytes) - this is what fixes the padding problem\n x,\n 0 // Output is ignored, therefore the output size is zero\n )\n }\n return result;\n }\n\n /// @dev Returns the confirmation status of a transaction.\n /// @param transactionId Transaction ID.\n /// @return Confirmation status.\n function isConfirmed(uint transactionId)\n public\n constant\n returns (bool)\n {\n uint count = 0;\n for (uint i=0; i<owners.length; i++) {\n if (confirmations[transactionId][owners[i]])\n count += 1;\n if (count == required)\n return true;\n }\n }\n\n /*\n * Internal functions\n */\n /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet.\n /// @param destination Transaction target address.\n /// @param value Transaction ether value.\n /// @param data Transaction data payload.\n /// @return Returns transaction ID.\n function addTransaction(address destination, uint value, bytes data)\n internal\n notNull(destination)\n returns (uint transactionId)\n {\n transactionId = transactionCount;\n transactions[transactionId] = Transaction({\n destination: destination,\n value: value,\n data: data,\n executed: false\n });\n transactionCount += 1;\n Submission(transactionId);\n }\n\n /*\n * Web3 call functions\n */\n /// @dev Returns number of confirmations of a transaction.\n /// @param transactionId Transaction ID.\n /// @return Number of confirmations.\n function getConfirmationCount(uint transactionId)\n public\n constant\n returns (uint count)\n {\n for (uint i=0; i<owners.length; i++)\n if (confirmations[transactionId][owners[i]])\n count += 1;\n }\n\n /// @dev Returns total number of transactions after filers are applied.\n /// @param pending Include pending transactions.\n /// @param executed Include executed transactions.\n /// @return Total number of transactions after filters are applied.\n function getTransactionCount(bool pending, bool executed)\n public\n constant\n returns (uint count)\n {\n for (uint i=0; i<transactionCount; i++)\n if ( pending && !transactions[i].executed\n || executed && transactions[i].executed)\n count += 1;\n }\n\n /// @dev Returns list of owners.\n /// @return List of owner addresses.\n function getOwners()\n public\n constant\n returns (address[])\n {\n return owners;\n }\n\n /// @dev Returns array with owner addresses, which confirmed transaction.\n /// @param transactionId Transaction ID.\n /// @return Returns array of owner addresses.\n function getConfirmations(uint transactionId)\n public\n constant\n returns (address[] _confirmations)\n {\n address[] memory confirmationsTemp = new address[](owners.length);\n uint count = 0;\n uint i;\n for (i=0; i<owners.length; i++)\n if (confirmations[transactionId][owners[i]]) {\n confirmationsTemp[count] = owners[i];\n count += 1;\n }\n _confirmations = new address[](count);\n for (i=0; i<count; i++)\n _confirmations[i] = confirmationsTemp[i];\n }\n\n /// @dev Returns list of transaction IDs in defined range.\n /// @param from Index start position of transaction array.\n /// @param to Index end position of transaction array.\n /// @param pending Include pending transactions.\n /// @param executed Include executed transactions.\n /// @return Returns array of transaction IDs.\n function getTransactionIds(uint from, uint to, bool pending, bool executed)\n public\n constant\n returns (uint[] _transactionIds)\n {\n uint[] memory transactionIdsTemp = new uint[](transactionCount);\n uint count = 0;\n uint i;\n for (i=0; i<transactionCount; i++)\n if ( pending && !transactions[i].executed\n || executed && transactions[i].executed)\n {\n transactionIdsTemp[count] = i;\n count += 1;\n }\n _transactionIds = new uint[](to - from);\n for (i=from; i<to; i++)\n _transactionIds[i - from] = transactionIdsTemp[i];\n }\n}",
- "2.0.0/multisig/MultiSigWalletWithTimeLock.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MultiSigWallet.sol\";\n\n\n/// @title Multisignature wallet with time lock- Allows multiple parties to execute a transaction after a time lock has passed.\n/// @author Amir Bandeali - <amir@0xProject.com>\n// solhint-disable not-rely-on-time\ncontract MultiSigWalletWithTimeLock is\n MultiSigWallet\n{\n event ConfirmationTimeSet(uint256 indexed transactionId, uint256 confirmationTime);\n event TimeLockChange(uint256 secondsTimeLocked);\n\n uint256 public secondsTimeLocked;\n\n mapping (uint256 => uint256) public confirmationTimes;\n\n modifier notFullyConfirmed(uint256 transactionId) {\n require(\n !isConfirmed(transactionId),\n \"TX_FULLY_CONFIRMED\"\n );\n _;\n }\n\n modifier fullyConfirmed(uint256 transactionId) {\n require(\n isConfirmed(transactionId),\n \"TX_NOT_FULLY_CONFIRMED\"\n );\n _;\n }\n\n modifier pastTimeLock(uint256 transactionId) {\n require(\n block.timestamp >= confirmationTimes[transactionId] + secondsTimeLocked,\n \"TIME_LOCK_INCOMPLETE\"\n );\n _;\n }\n\n /// @dev Contract constructor sets initial owners, required number of confirmations, and time lock.\n /// @param _owners List of initial owners.\n /// @param _required Number of required confirmations.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n constructor (\n address[] _owners,\n uint256 _required,\n uint256 _secondsTimeLocked\n )\n public\n MultiSigWallet(_owners, _required)\n {\n secondsTimeLocked = _secondsTimeLocked;\n }\n\n /// @dev Changes the duration of the time lock for transactions.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n function changeTimeLock(uint256 _secondsTimeLocked)\n public\n onlyWallet\n {\n secondsTimeLocked = _secondsTimeLocked;\n emit TimeLockChange(_secondsTimeLocked);\n }\n\n /// @dev Allows an owner to confirm a transaction.\n /// @param transactionId Transaction ID.\n function confirmTransaction(uint256 transactionId)\n public\n ownerExists(msg.sender)\n transactionExists(transactionId)\n notConfirmed(transactionId, msg.sender)\n notFullyConfirmed(transactionId)\n {\n confirmations[transactionId][msg.sender] = true;\n emit Confirmation(msg.sender, transactionId);\n if (isConfirmed(transactionId)) {\n setConfirmationTime(transactionId, block.timestamp);\n }\n }\n\n /// @dev Allows anyone to execute a confirmed transaction.\n /// @param transactionId Transaction ID.\n function executeTransaction(uint256 transactionId)\n public\n notExecuted(transactionId)\n fullyConfirmed(transactionId)\n pastTimeLock(transactionId)\n {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) {\n emit Execution(transactionId);\n } else {\n emit ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n\n /// @dev Sets the time of when a submission first passed.\n function setConfirmationTime(uint256 transactionId, uint256 confirmationTime)\n internal\n {\n confirmationTimes[transactionId] = confirmationTime;\n emit ConfirmationTimeSet(transactionId, confirmationTime);\n }\n}\n",
- "2.0.0/protocol/AssetProxy/ERC20Proxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MixinAuthorizable.sol\";\n\n\ncontract ERC20Proxy is\n MixinAuthorizable\n{\n // Id of this proxy.\n bytes4 constant internal PROXY_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n \n // solhint-disable-next-line payable-fallback\n function () \n external\n {\n assembly {\n // The first 4 bytes of calldata holds the function selector\n let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)\n\n // `transferFrom` will be called with the following parameters:\n // assetData Encoded byte array.\n // from Address to transfer asset from.\n // to Address to transfer asset to.\n // amount Amount of asset to transfer.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {\n\n // To lookup a value in a mapping, we load from the storage location keccak256(k, p),\n // where k is the key left padded to 32 bytes and p is the storage slot\n let start := mload(64)\n mstore(start, and(caller, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(start, 32), authorized_slot)\n\n // Revert if authorized[msg.sender] == false\n if iszero(sload(keccak256(start, 64))) {\n // Revert with `Error(\"SENDER_NOT_AUTHORIZED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // `transferFrom`.\n // The function is marked `external`, so no abi decodeding is done for\n // us. Instead, we expect the `calldata` memory to contain the\n // following:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n //\n // (*): offset is computed from start of function parameters, so offset\n // by an additional 4 bytes in the calldata.\n //\n // (**): see table below to compute length of assetData Contents\n //\n // WARNING: The ABIv2 specification allows additional padding between\n // the Params and Data section. This will result in a larger\n // offset to assetData.\n\n // Asset data itself is encoded as follows:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 1 * 32 | function parameters: |\n // | | 4 | 12 + 20 | 1. token address |\n\n // We construct calldata for the `token.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 4 | | 1. from |\n // | | 36 | | 2. to |\n // | | 68 | | 3. amount |\n\n /////// Read token address from calldata ///////\n // * The token address is stored in `assetData`.\n //\n // * The \"offset to assetData\" is stored at offset 4 in the calldata (table 1).\n // [assetDataOffsetFromParams = calldataload(4)]\n //\n // * Notes that the \"offset to assetData\" is relative to the \"Params\" area of calldata;\n // add 4 bytes to account for the length of the \"Header\" area (table 1).\n // [assetDataOffsetFromHeader = assetDataOffsetFromParams + 4]\n //\n // * The \"token address\" is offset 32+4=36 bytes into \"assetData\" (tables 1 & 2).\n // [tokenOffset = assetDataOffsetFromHeader + 36 = calldataload(4) + 4 + 36]\n let token := calldataload(add(calldataload(4), 40))\n \n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFrom` selector.\n // Any trailing data in transferFromSelector will be\n // overwritten in the next `mstore` call.\n mstore(0, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // We copy the fields `from`, `to` and `amount` in bulk\n // from our own calldata to the new calldata.\n calldatacopy(4, 36, 96)\n\n /////// Call `token.transferFrom` using the calldata ///////\n let success := call(\n gas, // forward all gas\n token, // call address of token contract\n 0, // don't send any ETH\n 0, // pointer to start of input\n 100, // length of input\n 0, // write output over input\n 32 // output size should be 32 bytes\n )\n\n /////// Check return data. ///////\n // If there is no return data, we assume the token incorrectly\n // does not return a bool. In this case we expect it to revert\n // on failure, which was handled above.\n // If the token does return data, we require that it is a single\n // nonzero 32 bytes value.\n // So the transfer succeeded if the call succeeded and either\n // returned nothing, or returned a non-zero 32 byte value. \n success := and(success, or(\n iszero(returndatasize),\n and(\n eq(returndatasize, 32),\n gt(mload(0), 0)\n )\n ))\n if success {\n return(0, 0)\n }\n \n // Revert with `Error(\"TRANSFER_FAILED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // Revert if undefined function is called\n revert(0, 0)\n }\n }\n\n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4)\n {\n return PROXY_ID;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/ERC721Proxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MixinAuthorizable.sol\";\n\n\ncontract ERC721Proxy is\n MixinAuthorizable\n{\n // Id of this proxy.\n bytes4 constant internal PROXY_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n\n // solhint-disable-next-line payable-fallback\n function () \n external\n {\n assembly {\n // The first 4 bytes of calldata holds the function selector\n let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)\n\n // `transferFrom` will be called with the following parameters:\n // assetData Encoded byte array.\n // from Address to transfer asset from.\n // to Address to transfer asset to.\n // amount Amount of asset to transfer.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {\n\n // To lookup a value in a mapping, we load from the storage location keccak256(k, p),\n // where k is the key left padded to 32 bytes and p is the storage slot\n let start := mload(64)\n mstore(start, and(caller, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(start, 32), authorized_slot)\n\n // Revert if authorized[msg.sender] == false\n if iszero(sload(keccak256(start, 64))) {\n // Revert with `Error(\"SENDER_NOT_AUTHORIZED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // `transferFrom`.\n // The function is marked `external`, so no abi decodeding is done for\n // us. Instead, we expect the `calldata` memory to contain the\n // following:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n //\n // (*): offset is computed from start of function parameters, so offset\n // by an additional 4 bytes in the calldata.\n //\n // (**): see table below to compute length of assetData Contents\n //\n // WARNING: The ABIv2 specification allows additional padding between\n // the Params and Data section. This will result in a larger\n // offset to assetData.\n\n // Asset data itself is encoded as follows:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 2 * 32 | function parameters: |\n // | | 4 | 12 + 20 | 1. token address |\n // | | 36 | | 2. tokenId |\n \n // We construct calldata for the `token.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n // \n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 4 | | 1. from |\n // | | 36 | | 2. to |\n // | | 68 | | 3. tokenId |\n\n // There exists only 1 of each token.\n // require(amount == 1, \"INVALID_AMOUNT\")\n if sub(calldataload(100), 1) {\n // Revert with `Error(\"INVALID_AMOUNT\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000e494e56414c49445f414d4f554e540000000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFrom` selector.\n // Any trailing data in transferFromSelector will be\n // overwritten in the next `mstore` call.\n mstore(0, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // We copy the fields `from` and `to` in bulk\n // from our own calldata to the new calldata.\n calldatacopy(4, 36, 64)\n\n // Copy `tokenId` field from our own calldata to the new calldata.\n let assetDataOffset := calldataload(4)\n calldatacopy(68, add(assetDataOffset, 72), 32)\n\n /////// Call `token.transferFrom` using the calldata ///////\n let token := calldataload(add(assetDataOffset, 40))\n let success := call(\n gas, // forward all gas\n token, // call address of token contract\n 0, // don't send any ETH\n 0, // pointer to start of input\n 100, // length of input\n 0, // write output to null\n 0 // output size is 0 bytes\n )\n if success {\n return(0, 0)\n }\n \n // Revert with `Error(\"TRANSFER_FAILED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // Revert if undefined function is called\n revert(0, 0)\n }\n }\n\n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4)\n {\n return PROXY_ID;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/MixinAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"./mixins/MAuthorizable.sol\";\n\n\ncontract MixinAuthorizable is\n Ownable,\n MAuthorizable\n{\n /// @dev Only authorized addresses can invoke functions with this modifier.\n modifier onlyAuthorized {\n require(\n authorized[msg.sender],\n \"SENDER_NOT_AUTHORIZED\"\n );\n _;\n }\n\n mapping (address => bool) public authorized;\n address[] public authorities;\n\n /// @dev Authorizes an address.\n /// @param target Address to authorize.\n function addAuthorizedAddress(address target)\n external\n onlyOwner\n {\n require(\n !authorized[target],\n \"TARGET_ALREADY_AUTHORIZED\"\n );\n\n authorized[target] = true;\n authorities.push(target);\n emit AuthorizedAddressAdded(target, msg.sender);\n }\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n function removeAuthorizedAddress(address target)\n external\n onlyOwner\n {\n require(\n authorized[target],\n \"TARGET_NOT_AUTHORIZED\"\n );\n\n delete authorized[target];\n for (uint256 i = 0; i < authorities.length; i++) {\n if (authorities[i] == target) {\n authorities[i] = authorities[authorities.length - 1];\n authorities.length -= 1;\n break;\n }\n }\n emit AuthorizedAddressRemoved(target, msg.sender);\n }\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n /// @param index Index of target in authorities array.\n function removeAuthorizedAddressAtIndex(\n address target,\n uint256 index\n )\n external\n onlyOwner\n {\n require(\n authorized[target],\n \"TARGET_NOT_AUTHORIZED\"\n );\n require(\n index < authorities.length,\n \"INDEX_OUT_OF_BOUNDS\"\n );\n require(\n authorities[index] == target,\n \"AUTHORIZED_ADDRESS_MISMATCH\"\n );\n\n delete authorized[target];\n authorities[index] = authorities[authorities.length - 1];\n authorities.length -= 1;\n emit AuthorizedAddressRemoved(target, msg.sender);\n }\n\n /// @dev Gets all authorized addresses.\n /// @return Array of authorized addresses.\n function getAuthorizedAddresses()\n external\n view\n returns (address[] memory)\n {\n return authorities;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IAuthorizable.sol\";\n\n\ncontract IAssetProxy is\n IAuthorizable\n{\n /// @dev Transfers assets. Either succeeds or throws.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param from Address to transfer asset from.\n /// @param to Address to transfer asset to.\n /// @param amount Amount of asset to transfer.\n function transferFrom(\n bytes assetData,\n address from,\n address to,\n uint256 amount\n )\n external;\n \n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4);\n}\n",
- "2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/Ownable/IOwnable.sol\";\n\n\ncontract IAuthorizable is\n IOwnable\n{\n /// @dev Authorizes an address.\n /// @param target Address to authorize.\n function addAuthorizedAddress(address target)\n external;\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n function removeAuthorizedAddress(address target)\n external;\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n /// @param index Index of target in authorities array.\n function removeAuthorizedAddressAtIndex(\n address target,\n uint256 index\n )\n external;\n \n /// @dev Gets all authorized addresses.\n /// @return Array of authorized addresses.\n function getAuthorizedAddresses()\n external\n view\n returns (address[] memory);\n}\n",
- "2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAuthorizable.sol\";\n\n\ncontract MAuthorizable is\n IAuthorizable\n{\n // Event logged when a new address is authorized.\n event AuthorizedAddressAdded(\n address indexed target,\n address indexed caller\n );\n\n // Event logged when a currently authorized address is unauthorized.\n event AuthorizedAddressRemoved(\n address indexed target,\n address indexed caller\n );\n\n /// @dev Only authorized addresses can invoke functions with this modifier.\n modifier onlyAuthorized { revert(); _; }\n}\n",
- "2.0.0/protocol/AssetProxyOwner/AssetProxyOwner.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../multisig/MultiSigWalletWithTimeLock.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\n\n\ncontract AssetProxyOwner is\n MultiSigWalletWithTimeLock\n{\n using LibBytes for bytes;\n\n event AssetProxyRegistration(address assetProxyContract, bool isRegistered);\n\n // Mapping of AssetProxy contract address =>\n // if this contract is allowed to call the AssetProxy's `removeAuthorizedAddressAtIndex` method without a time lock.\n mapping (address => bool) public isAssetProxyRegistered;\n\n bytes4 constant internal REMOVE_AUTHORIZED_ADDRESS_AT_INDEX_SELECTOR = bytes4(keccak256(\"removeAuthorizedAddressAtIndex(address,uint256)\"));\n\n /// @dev Function will revert if the transaction does not call `removeAuthorizedAddressAtIndex`\n /// on an approved AssetProxy contract.\n modifier validRemoveAuthorizedAddressAtIndexTx(uint256 transactionId) {\n Transaction storage txn = transactions[transactionId];\n require(\n isAssetProxyRegistered[txn.destination],\n \"UNREGISTERED_ASSET_PROXY\"\n );\n require(\n txn.data.readBytes4(0) == REMOVE_AUTHORIZED_ADDRESS_AT_INDEX_SELECTOR,\n \"INVALID_FUNCTION_SELECTOR\"\n );\n _;\n }\n\n /// @dev Contract constructor sets initial owners, required number of confirmations,\n /// time lock, and list of AssetProxy addresses.\n /// @param _owners List of initial owners.\n /// @param _assetProxyContracts Array of AssetProxy contract addresses.\n /// @param _required Number of required confirmations.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n constructor (\n address[] memory _owners,\n address[] memory _assetProxyContracts,\n uint256 _required,\n uint256 _secondsTimeLocked\n )\n public\n MultiSigWalletWithTimeLock(_owners, _required, _secondsTimeLocked)\n {\n for (uint256 i = 0; i < _assetProxyContracts.length; i++) {\n address assetProxy = _assetProxyContracts[i];\n require(\n assetProxy != address(0),\n \"INVALID_ASSET_PROXY\"\n );\n isAssetProxyRegistered[assetProxy] = true;\n }\n }\n\n /// @dev Registers or deregisters an AssetProxy to be able to execute\n /// `removeAuthorizedAddressAtIndex` without a timelock.\n /// @param assetProxyContract Address of AssetProxy contract.\n /// @param isRegistered Status of approval for AssetProxy contract.\n function registerAssetProxy(address assetProxyContract, bool isRegistered)\n public\n onlyWallet\n notNull(assetProxyContract)\n {\n isAssetProxyRegistered[assetProxyContract] = isRegistered;\n emit AssetProxyRegistration(assetProxyContract, isRegistered);\n }\n\n /// @dev Allows execution of `removeAuthorizedAddressAtIndex` without time lock.\n /// @param transactionId Transaction ID.\n function executeRemoveAuthorizedAddressAtIndex(uint256 transactionId)\n public\n notExecuted(transactionId)\n fullyConfirmed(transactionId)\n validRemoveAuthorizedAddressAtIndexTx(transactionId)\n {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) {\n emit Execution(transactionId);\n } else {\n emit ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/Exchange.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./MixinExchangeCore.sol\";\nimport \"./MixinSignatureValidator.sol\";\nimport \"./MixinWrapperFunctions.sol\";\nimport \"./MixinAssetProxyDispatcher.sol\";\nimport \"./MixinTransactions.sol\";\nimport \"./MixinMatchOrders.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract Exchange is\n MixinExchangeCore,\n MixinMatchOrders,\n MixinSignatureValidator,\n MixinTransactions,\n MixinAssetProxyDispatcher,\n MixinWrapperFunctions\n{\n string constant public VERSION = \"2.0.1-alpha\";\n\n // Mixins are instantiated in the order they are inherited\n constructor (bytes memory _zrxAssetData)\n public\n LibConstants(_zrxAssetData) // @TODO: Remove when we deploy.\n MixinExchangeCore()\n MixinMatchOrders()\n MixinSignatureValidator()\n MixinTransactions()\n MixinAssetProxyDispatcher()\n MixinWrapperFunctions()\n {}\n}\n",
- "2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\nimport \"../AssetProxy/interfaces/IAssetProxy.sol\";\n\n\ncontract MixinAssetProxyDispatcher is\n Ownable,\n MAssetProxyDispatcher\n{\n // Mapping from Asset Proxy Id's to their respective Asset Proxy\n mapping (bytes4 => IAssetProxy) public assetProxies;\n\n /// @dev Registers an asset proxy to its asset proxy id.\n /// Once an asset proxy is registered, it cannot be unregistered.\n /// @param assetProxy Address of new asset proxy to register.\n function registerAssetProxy(address assetProxy)\n external\n onlyOwner\n {\n IAssetProxy assetProxyContract = IAssetProxy(assetProxy);\n\n // Ensure that no asset proxy exists with current id.\n bytes4 assetProxyId = assetProxyContract.getProxyId();\n address currentAssetProxy = assetProxies[assetProxyId];\n require(\n currentAssetProxy == address(0),\n \"ASSET_PROXY_ALREADY_EXISTS\"\n );\n\n // Add asset proxy and log registration.\n assetProxies[assetProxyId] = assetProxyContract;\n emit AssetProxyRegistered(\n assetProxyId,\n assetProxy\n );\n }\n\n /// @dev Gets an asset proxy.\n /// @param assetProxyId Id of the asset proxy.\n /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered.\n function getAssetProxy(bytes4 assetProxyId)\n external\n view\n returns (address)\n {\n return assetProxies[assetProxyId];\n }\n\n /// @dev Forwards arguments to assetProxy and calls `transferFrom`. Either succeeds or throws.\n /// @param assetData Byte array encoded for the asset.\n /// @param from Address to transfer token from.\n /// @param to Address to transfer token to.\n /// @param amount Amount of token to transfer.\n function dispatchTransferFrom(\n bytes memory assetData,\n address from,\n address to,\n uint256 amount\n )\n internal\n {\n // Do nothing if no amount should be transferred.\n if (amount > 0 && from != to) {\n // Ensure assetData length is valid\n require(\n assetData.length > 3,\n \"LENGTH_GREATER_THAN_3_REQUIRED\"\n );\n \n // Lookup assetProxy. We do not use `LibBytes.readBytes4` for gas efficiency reasons.\n bytes4 assetProxyId;\n assembly {\n assetProxyId := and(mload(\n add(assetData, 32)),\n 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000\n )\n }\n address assetProxy = assetProxies[assetProxyId];\n\n // Ensure that assetProxy exists\n require(\n assetProxy != address(0),\n \"ASSET_PROXY_DOES_NOT_EXIST\"\n );\n \n // We construct calldata for the `assetProxy.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n // \n // | Area | Offset | Length | Contents |\n // | -------- |--------|---------|-------------------------------------------- |\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n\n assembly {\n /////// Setup State ///////\n // `cdStart` is the start of the calldata for `assetProxy.transferFrom` (equal to free memory ptr).\n let cdStart := mload(64)\n // `dataAreaLength` is the total number of words needed to store `assetData`\n // As-per the ABI spec, this value is padded up to the nearest multiple of 32,\n // and includes 32-bytes for length.\n let dataAreaLength := and(add(mload(assetData), 63), 0xFFFFFFFFFFFE0)\n // `cdEnd` is the end of the calldata for `assetProxy.transferFrom`.\n let cdEnd := add(cdStart, add(132, dataAreaLength))\n\n \n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFromSelector`.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n mstore(cdStart, 0xa85e59e400000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // Each parameter is padded to 32-bytes. The entire Params Area is 128 bytes.\n // Notes:\n // 1. The offset to `assetData` is the length of the Params Area (128 bytes).\n // 2. A 20-byte mask is applied to addresses to zero-out the unused bytes.\n mstore(add(cdStart, 4), 128)\n mstore(add(cdStart, 36), and(from, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(cdStart, 68), and(to, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(cdStart, 100), amount)\n \n /////// Setup Data Area ///////\n // This area holds `assetData`.\n let dataArea := add(cdStart, 132)\n // solhint-disable-next-line no-empty-blocks\n for {} lt(dataArea, cdEnd) {} {\n mstore(dataArea, mload(assetData))\n dataArea := add(dataArea, 32)\n assetData := add(assetData, 32)\n }\n\n /////// Call `assetProxy.transferFrom` using the constructed calldata ///////\n let success := call(\n gas, // forward all gas\n assetProxy, // call address of asset proxy\n 0, // don't send any ETH\n cdStart, // pointer to start of input\n sub(cdEnd, cdStart), // length of input \n cdStart, // write output over input\n 512 // reserve 512 bytes for output\n )\n if iszero(success) {\n revert(cdStart, returndatasize())\n }\n }\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\n\n\ncontract MixinExchangeCore is\n ReentrancyGuard,\n LibConstants,\n LibMath,\n LibOrder,\n LibFillResults,\n MAssetProxyDispatcher,\n MExchangeCore,\n MSignatureValidator,\n MTransactions\n{\n // Mapping of orderHash => amount of takerAsset already bought by maker\n mapping (bytes32 => uint256) public filled;\n\n // Mapping of orderHash => cancelled\n mapping (bytes32 => bool) public cancelled;\n\n // Mapping of makerAddress => senderAddress => lowest salt an order can have in order to be fillable\n // Orders with specified senderAddress and with a salt less than their epoch are considered cancelled\n mapping (address => mapping (address => uint256)) public orderEpoch;\n\n /// @dev Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch\n /// and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress).\n /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled.\n function cancelOrdersUpTo(uint256 targetOrderEpoch)\n external\n nonReentrant\n {\n address makerAddress = getCurrentContextAddress();\n // If this function is called via `executeTransaction`, we only update the orderEpoch for the makerAddress/msg.sender combination.\n // This allows external filter contracts to add rules to how orders are cancelled via this function.\n address senderAddress = makerAddress == msg.sender ? address(0) : msg.sender;\n\n // orderEpoch is initialized to 0, so to cancelUpTo we need salt + 1\n uint256 newOrderEpoch = targetOrderEpoch + 1; \n uint256 oldOrderEpoch = orderEpoch[makerAddress][senderAddress];\n\n // Ensure orderEpoch is monotonically increasing\n require(\n newOrderEpoch > oldOrderEpoch, \n \"INVALID_NEW_ORDER_EPOCH\"\n );\n\n // Update orderEpoch\n orderEpoch[makerAddress][senderAddress] = newOrderEpoch;\n emit CancelUpTo(\n makerAddress,\n senderAddress,\n newOrderEpoch\n );\n }\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrder(\n Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n nonReentrant\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n return fillResults;\n }\n\n /// @dev After calling, the order can not be filled anymore.\n /// Throws if order is invalid or sender does not have permission to cancel.\n /// @param order Order to cancel. Order must be OrderStatus.FILLABLE.\n function cancelOrder(Order memory order)\n public\n nonReentrant\n {\n cancelOrderInternal(order);\n }\n\n /// @dev Gets information about an order: status, hash, and amount filled.\n /// @param order Order to gather information on.\n /// @return OrderInfo Information about the order and its state.\n /// See LibOrder.OrderInfo for a complete description.\n function getOrderInfo(Order memory order)\n public\n view\n returns (OrderInfo memory orderInfo)\n {\n // Compute the order hash\n orderInfo.orderHash = getOrderHash(order);\n\n // Fetch filled amount\n orderInfo.orderTakerAssetFilledAmount = filled[orderInfo.orderHash];\n\n // If order.makerAssetAmount is zero, we also reject the order.\n // While the Exchange contract handles them correctly, they create\n // edge cases in the supporting infrastructure because they have\n // an 'infinite' price when computed by a simple division.\n if (order.makerAssetAmount == 0) {\n orderInfo.orderStatus = uint8(OrderStatus.INVALID_MAKER_ASSET_AMOUNT);\n return orderInfo;\n }\n\n // If order.takerAssetAmount is zero, then the order will always\n // be considered filled because 0 == takerAssetAmount == orderTakerAssetFilledAmount\n // Instead of distinguishing between unfilled and filled zero taker\n // amount orders, we choose not to support them.\n if (order.takerAssetAmount == 0) {\n orderInfo.orderStatus = uint8(OrderStatus.INVALID_TAKER_ASSET_AMOUNT);\n return orderInfo;\n }\n\n // Validate order availability\n if (orderInfo.orderTakerAssetFilledAmount >= order.takerAssetAmount) {\n orderInfo.orderStatus = uint8(OrderStatus.FULLY_FILLED);\n return orderInfo;\n }\n\n // Validate order expiration\n // solhint-disable-next-line not-rely-on-time\n if (block.timestamp >= order.expirationTimeSeconds) {\n orderInfo.orderStatus = uint8(OrderStatus.EXPIRED);\n return orderInfo;\n }\n\n // Check if order has been cancelled\n if (cancelled[orderInfo.orderHash]) {\n orderInfo.orderStatus = uint8(OrderStatus.CANCELLED);\n return orderInfo;\n }\n if (orderEpoch[order.makerAddress][order.senderAddress] > order.salt) {\n orderInfo.orderStatus = uint8(OrderStatus.CANCELLED);\n return orderInfo;\n }\n\n // All other statuses are ruled out: order is Fillable\n orderInfo.orderStatus = uint8(OrderStatus.FILLABLE);\n return orderInfo;\n }\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderInternal(\n Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n // Fetch order info\n OrderInfo memory orderInfo = getOrderInfo(order);\n\n // Fetch taker address\n address takerAddress = getCurrentContextAddress();\n \n // Assert that the order is fillable by taker\n assertFillableOrder(\n order,\n orderInfo,\n takerAddress,\n signature\n );\n \n // Get amount of takerAsset to fill\n uint256 remainingTakerAssetAmount = safeSub(order.takerAssetAmount, orderInfo.orderTakerAssetFilledAmount);\n uint256 takerAssetFilledAmount = min256(takerAssetFillAmount, remainingTakerAssetAmount);\n\n // Validate context\n assertValidFill(\n order,\n orderInfo,\n takerAssetFillAmount,\n takerAssetFilledAmount,\n fillResults.makerAssetFilledAmount\n );\n\n // Compute proportional fill amounts\n fillResults = calculateFillResults(order, takerAssetFilledAmount);\n\n // Update exchange internal state\n updateFilledState(\n order,\n takerAddress,\n orderInfo.orderHash,\n orderInfo.orderTakerAssetFilledAmount,\n fillResults\n );\n \n // Settle order\n settleOrder(\n order,\n takerAddress,\n fillResults\n );\n\n return fillResults;\n }\n\n /// @dev After calling, the order can not be filled anymore.\n /// Throws if order is invalid or sender does not have permission to cancel.\n /// @param order Order to cancel. Order must be OrderStatus.FILLABLE.\n function cancelOrderInternal(Order memory order)\n internal\n {\n // Fetch current order status\n OrderInfo memory orderInfo = getOrderInfo(order);\n\n // Validate context\n assertValidCancel(order, orderInfo);\n\n // Perform cancel\n updateCancelledState(order, orderInfo.orderHash);\n }\n\n /// @dev Updates state with results of a fill order.\n /// @param order that was filled.\n /// @param takerAddress Address of taker who filled the order.\n /// @param orderTakerAssetFilledAmount Amount of order already filled.\n function updateFilledState(\n Order memory order,\n address takerAddress,\n bytes32 orderHash,\n uint256 orderTakerAssetFilledAmount,\n FillResults memory fillResults\n )\n internal\n {\n // Update state\n filled[orderHash] = safeAdd(orderTakerAssetFilledAmount, fillResults.takerAssetFilledAmount);\n\n // Log order\n emit Fill(\n order.makerAddress,\n order.feeRecipientAddress,\n takerAddress,\n msg.sender,\n fillResults.makerAssetFilledAmount,\n fillResults.takerAssetFilledAmount,\n fillResults.makerFeePaid,\n fillResults.takerFeePaid,\n orderHash,\n order.makerAssetData,\n order.takerAssetData\n );\n }\n\n /// @dev Updates state with results of cancelling an order.\n /// State is only updated if the order is currently fillable.\n /// Otherwise, updating state would have no effect.\n /// @param order that was cancelled.\n /// @param orderHash Hash of order that was cancelled.\n function updateCancelledState(\n Order memory order,\n bytes32 orderHash\n )\n internal\n {\n // Perform cancel\n cancelled[orderHash] = true;\n\n // Log cancel\n emit Cancel(\n order.makerAddress,\n order.feeRecipientAddress,\n msg.sender,\n orderHash,\n order.makerAssetData,\n order.takerAssetData\n );\n }\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAddress Address of order taker.\n /// @param signature Proof that the orders was created by its maker.\n function assertFillableOrder(\n Order memory order,\n OrderInfo memory orderInfo,\n address takerAddress,\n bytes memory signature\n )\n internal\n view\n {\n // An order can only be filled if its status is FILLABLE.\n require(\n orderInfo.orderStatus == uint8(OrderStatus.FILLABLE),\n \"ORDER_UNFILLABLE\"\n );\n \n // Validate sender is allowed to fill this order\n if (order.senderAddress != address(0)) {\n require(\n order.senderAddress == msg.sender,\n \"INVALID_SENDER\"\n );\n }\n \n // Validate taker is allowed to fill this order\n if (order.takerAddress != address(0)) {\n require(\n order.takerAddress == takerAddress,\n \"INVALID_TAKER\"\n );\n }\n \n // Validate Maker signature (check only if first time seen)\n if (orderInfo.orderTakerAssetFilledAmount == 0) {\n require(\n isValidSignature(\n orderInfo.orderHash,\n order.makerAddress,\n signature\n ),\n \"INVALID_ORDER_SIGNATURE\"\n );\n }\n }\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAssetFillAmount Desired amount of order to fill by taker.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @param makerAssetFilledAmount Amount of makerAsset that will be transfered.\n function assertValidFill(\n Order memory order,\n OrderInfo memory orderInfo,\n uint256 takerAssetFillAmount, // TODO: use FillResults\n uint256 takerAssetFilledAmount,\n uint256 makerAssetFilledAmount\n )\n internal\n view\n {\n // Revert if fill amount is invalid\n // TODO: reconsider necessity for v2.1\n require(\n takerAssetFillAmount != 0,\n \"INVALID_TAKER_AMOUNT\"\n );\n \n // Make sure taker does not pay more than desired amount\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n takerAssetFilledAmount <= takerAssetFillAmount,\n \"TAKER_OVERPAY\"\n );\n \n // Make sure order is not overfilled\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n safeAdd(orderInfo.orderTakerAssetFilledAmount, takerAssetFilledAmount) <= order.takerAssetAmount,\n \"ORDER_OVERFILL\"\n );\n \n // Make sure order is filled at acceptable price.\n // The order has an implied price from the makers perspective:\n // order price = order.makerAssetAmount / order.takerAssetAmount\n // i.e. the number of makerAsset maker is paying per takerAsset. The\n // maker is guaranteed to get this price or a better (lower) one. The\n // actual price maker is getting in this fill is:\n // fill price = makerAssetFilledAmount / takerAssetFilledAmount\n // We need `fill price <= order price` for the fill to be fair to maker.\n // This amounts to:\n // makerAssetFilledAmount order.makerAssetAmount\n // ------------------------ <= -----------------------\n // takerAssetFilledAmount order.takerAssetAmount\n // or, equivalently:\n // makerAssetFilledAmount * order.takerAssetAmount <=\n // order.makerAssetAmount * takerAssetFilledAmount\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n safeMul(makerAssetFilledAmount, order.takerAssetAmount)\n <= \n safeMul(order.makerAssetAmount, takerAssetFilledAmount),\n \"INVALID_FILL_PRICE\"\n );\n }\n\n /// @dev Validates context for cancelOrder. Succeeds or throws.\n /// @param order to be cancelled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n function assertValidCancel(\n Order memory order,\n OrderInfo memory orderInfo\n )\n internal\n view\n {\n // Ensure order is valid\n // An order can only be cancelled if its status is FILLABLE.\n require(\n orderInfo.orderStatus == uint8(OrderStatus.FILLABLE),\n \"ORDER_UNFILLABLE\"\n );\n\n // Validate sender is allowed to cancel this order\n if (order.senderAddress != address(0)) {\n require(\n order.senderAddress == msg.sender,\n \"INVALID_SENDER\"\n );\n }\n\n // Validate transaction signed by maker\n address makerAddress = getCurrentContextAddress();\n require(\n order.makerAddress == makerAddress,\n \"INVALID_MAKER\"\n );\n }\n\n /// @dev Calculates amounts filled and fees paid by maker and taker.\n /// @param order to be filled.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function calculateFillResults(\n Order memory order,\n uint256 takerAssetFilledAmount\n )\n internal\n pure\n returns (FillResults memory fillResults)\n {\n // Compute proportional transfer amounts\n fillResults.takerAssetFilledAmount = takerAssetFilledAmount;\n fillResults.makerAssetFilledAmount = safeGetPartialAmountFloor(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.makerAssetAmount\n );\n fillResults.makerFeePaid = safeGetPartialAmountFloor(\n fillResults.makerAssetFilledAmount,\n order.makerAssetAmount,\n order.makerFee\n );\n fillResults.takerFeePaid = safeGetPartialAmountFloor(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.takerFee\n );\n\n return fillResults;\n }\n\n /// @dev Settles an order by transferring assets between counterparties.\n /// @param order Order struct containing order specifications.\n /// @param takerAddress Address selling takerAsset and buying makerAsset.\n /// @param fillResults Amounts to be filled and fees paid by maker and taker.\n function settleOrder(\n LibOrder.Order memory order,\n address takerAddress,\n LibFillResults.FillResults memory fillResults\n )\n private\n {\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n dispatchTransferFrom(\n order.makerAssetData,\n order.makerAddress,\n takerAddress,\n fillResults.makerAssetFilledAmount\n );\n dispatchTransferFrom(\n order.takerAssetData,\n takerAddress,\n order.makerAddress,\n fillResults.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n zrxAssetData,\n order.makerAddress,\n order.feeRecipientAddress,\n fillResults.makerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n order.feeRecipientAddress,\n fillResults.takerFeePaid\n );\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinMatchOrders.sol": "/*\n Copyright 2018 ZeroEx Intl.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n http://www.apache.org/licenses/LICENSE-2.0\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MMatchOrders.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\n\n\ncontract MixinMatchOrders is\n ReentrancyGuard,\n LibConstants,\n LibMath,\n MAssetProxyDispatcher,\n MExchangeCore,\n MMatchOrders,\n MTransactions\n{\n /// @dev Match two complementary orders that have a profitable spread.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the left order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftSignature Proof that order was created by the left maker.\n /// @param rightSignature Proof that order was created by the right maker.\n /// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.\n function matchOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n bytes memory leftSignature,\n bytes memory rightSignature\n )\n public\n nonReentrant\n returns (LibFillResults.MatchedFillResults memory matchedFillResults)\n {\n // We assume that rightOrder.takerAssetData == leftOrder.makerAssetData and rightOrder.makerAssetData == leftOrder.takerAssetData.\n // If this assumption isn't true, the match will fail at signature validation.\n rightOrder.makerAssetData = leftOrder.takerAssetData;\n rightOrder.takerAssetData = leftOrder.makerAssetData;\n\n // Get left & right order info\n LibOrder.OrderInfo memory leftOrderInfo = getOrderInfo(leftOrder);\n LibOrder.OrderInfo memory rightOrderInfo = getOrderInfo(rightOrder);\n\n // Fetch taker address\n address takerAddress = getCurrentContextAddress();\n \n // Either our context is valid or we revert\n assertFillableOrder(\n leftOrder,\n leftOrderInfo,\n takerAddress,\n leftSignature\n );\n assertFillableOrder(\n rightOrder,\n rightOrderInfo,\n takerAddress,\n rightSignature\n );\n assertValidMatch(leftOrder, rightOrder);\n\n // Compute proportional fill amounts\n matchedFillResults = calculateMatchedFillResults(\n leftOrder,\n rightOrder,\n leftOrderInfo.orderTakerAssetFilledAmount,\n rightOrderInfo.orderTakerAssetFilledAmount\n );\n\n // Validate fill contexts\n assertValidFill(\n leftOrder,\n leftOrderInfo,\n matchedFillResults.left.takerAssetFilledAmount,\n matchedFillResults.left.takerAssetFilledAmount,\n matchedFillResults.left.makerAssetFilledAmount\n );\n assertValidFill(\n rightOrder,\n rightOrderInfo,\n matchedFillResults.right.takerAssetFilledAmount,\n matchedFillResults.right.takerAssetFilledAmount,\n matchedFillResults.right.makerAssetFilledAmount\n );\n \n // Update exchange state\n updateFilledState(\n leftOrder,\n takerAddress,\n leftOrderInfo.orderHash,\n leftOrderInfo.orderTakerAssetFilledAmount,\n matchedFillResults.left\n );\n updateFilledState(\n rightOrder,\n takerAddress,\n rightOrderInfo.orderHash,\n rightOrderInfo.orderTakerAssetFilledAmount,\n matchedFillResults.right\n );\n\n // Settle matched orders. Succeeds or throws.\n settleMatchedOrders(\n leftOrder,\n rightOrder,\n takerAddress,\n matchedFillResults\n );\n\n return matchedFillResults;\n }\n\n /// @dev Validates context for matchOrders. Succeeds or throws.\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n function assertValidMatch(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder\n )\n internal\n pure\n {\n // Make sure there is a profitable spread.\n // There is a profitable spread iff the cost per unit bought (OrderA.MakerAmount/OrderA.TakerAmount) for each order is greater\n // than the profit per unit sold of the matched order (OrderB.TakerAmount/OrderB.MakerAmount).\n // This is satisfied by the equations below:\n // <leftOrder.makerAssetAmount> / <leftOrder.takerAssetAmount> >= <rightOrder.takerAssetAmount> / <rightOrder.makerAssetAmount>\n // AND\n // <rightOrder.makerAssetAmount> / <rightOrder.takerAssetAmount> >= <leftOrder.takerAssetAmount> / <leftOrder.makerAssetAmount>\n // These equations can be combined to get the following:\n require(\n safeMul(leftOrder.makerAssetAmount, rightOrder.makerAssetAmount) >=\n safeMul(leftOrder.takerAssetAmount, rightOrder.takerAssetAmount),\n \"NEGATIVE_SPREAD_REQUIRED\"\n );\n }\n\n /// @dev Calculates fill amounts for the matched orders.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the leftOrder order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftOrderTakerAssetFilledAmount Amount of left order already filled.\n /// @param rightOrderTakerAssetFilledAmount Amount of right order already filled.\n /// @param matchedFillResults Amounts to fill and fees to pay by maker and taker of matched orders.\n function calculateMatchedFillResults(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n uint256 leftOrderTakerAssetFilledAmount,\n uint256 rightOrderTakerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.MatchedFillResults memory matchedFillResults)\n {\n // Derive maker asset amounts for left & right orders, given store taker assert amounts\n uint256 leftTakerAssetAmountRemaining = safeSub(leftOrder.takerAssetAmount, leftOrderTakerAssetFilledAmount);\n uint256 leftMakerAssetAmountRemaining = safeGetPartialAmountFloor(\n leftOrder.makerAssetAmount,\n leftOrder.takerAssetAmount,\n leftTakerAssetAmountRemaining\n );\n uint256 rightTakerAssetAmountRemaining = safeSub(rightOrder.takerAssetAmount, rightOrderTakerAssetFilledAmount);\n uint256 rightMakerAssetAmountRemaining = safeGetPartialAmountFloor(\n rightOrder.makerAssetAmount,\n rightOrder.takerAssetAmount,\n rightTakerAssetAmountRemaining\n );\n\n // Calculate fill results for maker and taker assets: at least one order will be fully filled.\n // The maximum amount the left maker can buy is `leftTakerAssetAmountRemaining`\n // The maximum amount the right maker can sell is `rightMakerAssetAmountRemaining`\n // We have two distinct cases for calculating the fill results:\n // Case 1.\n // If the left maker can buy more than the right maker can sell, then only the right order is fully filled.\n // If the left maker can buy exactly what the right maker can sell, then both orders are fully filled.\n // Case 2.\n // If the left maker cannot buy more than the right maker can sell, then only the left order is fully filled.\n if (leftTakerAssetAmountRemaining >= rightMakerAssetAmountRemaining) {\n // Case 1: Right order is fully filled\n matchedFillResults.right.makerAssetFilledAmount = rightMakerAssetAmountRemaining;\n matchedFillResults.right.takerAssetFilledAmount = rightTakerAssetAmountRemaining;\n matchedFillResults.left.takerAssetFilledAmount = matchedFillResults.right.makerAssetFilledAmount;\n // Round down to ensure the maker's exchange rate does not exceed the price specified by the order. \n // We favor the maker when the exchange rate must be rounded.\n matchedFillResults.left.makerAssetFilledAmount = safeGetPartialAmountFloor(\n leftOrder.makerAssetAmount,\n leftOrder.takerAssetAmount,\n matchedFillResults.left.takerAssetFilledAmount\n );\n } else {\n // Case 2: Left order is fully filled\n matchedFillResults.left.makerAssetFilledAmount = leftMakerAssetAmountRemaining;\n matchedFillResults.left.takerAssetFilledAmount = leftTakerAssetAmountRemaining;\n matchedFillResults.right.makerAssetFilledAmount = matchedFillResults.left.takerAssetFilledAmount;\n // Round up to ensure the maker's exchange rate does not exceed the price specified by the order.\n // We favor the maker when the exchange rate must be rounded.\n matchedFillResults.right.takerAssetFilledAmount = safeGetPartialAmountCeil(\n rightOrder.takerAssetAmount,\n rightOrder.makerAssetAmount,\n matchedFillResults.right.makerAssetFilledAmount\n );\n }\n\n // Calculate amount given to taker\n matchedFillResults.leftMakerAssetSpreadAmount = safeSub(\n matchedFillResults.left.makerAssetFilledAmount,\n matchedFillResults.right.takerAssetFilledAmount\n );\n\n // Compute fees for left order\n matchedFillResults.left.makerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.left.makerAssetFilledAmount,\n leftOrder.makerAssetAmount,\n leftOrder.makerFee\n );\n matchedFillResults.left.takerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.left.takerAssetFilledAmount,\n leftOrder.takerAssetAmount,\n leftOrder.takerFee\n );\n\n // Compute fees for right order\n matchedFillResults.right.makerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.right.makerAssetFilledAmount,\n rightOrder.makerAssetAmount,\n rightOrder.makerFee\n );\n matchedFillResults.right.takerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.right.takerAssetFilledAmount,\n rightOrder.takerAssetAmount,\n rightOrder.takerFee\n );\n\n // Return fill results\n return matchedFillResults;\n }\n\n /// @dev Settles matched order by transferring appropriate funds between order makers, taker, and fee recipient.\n /// @param leftOrder First matched order.\n /// @param rightOrder Second matched order.\n /// @param takerAddress Address that matched the orders. The taker receives the spread between orders as profit.\n /// @param matchedFillResults Struct holding amounts to transfer between makers, taker, and fee recipients.\n function settleMatchedOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n address takerAddress,\n LibFillResults.MatchedFillResults memory matchedFillResults\n )\n private\n {\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n // Order makers and taker\n dispatchTransferFrom(\n leftOrder.makerAssetData,\n leftOrder.makerAddress,\n rightOrder.makerAddress,\n matchedFillResults.right.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n rightOrder.makerAssetData,\n rightOrder.makerAddress,\n leftOrder.makerAddress,\n matchedFillResults.left.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n leftOrder.makerAssetData,\n leftOrder.makerAddress,\n takerAddress,\n matchedFillResults.leftMakerAssetSpreadAmount\n );\n\n // Maker fees\n dispatchTransferFrom(\n zrxAssetData,\n leftOrder.makerAddress,\n leftOrder.feeRecipientAddress,\n matchedFillResults.left.makerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n rightOrder.makerAddress,\n rightOrder.feeRecipientAddress,\n matchedFillResults.right.makerFeePaid\n );\n\n // Taker fees\n if (leftOrder.feeRecipientAddress == rightOrder.feeRecipientAddress) {\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n leftOrder.feeRecipientAddress,\n safeAdd(\n matchedFillResults.left.takerFeePaid,\n matchedFillResults.right.takerFeePaid\n )\n );\n } else {\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n leftOrder.feeRecipientAddress,\n matchedFillResults.left.takerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n rightOrder.feeRecipientAddress,\n matchedFillResults.right.takerFeePaid\n );\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinSignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./interfaces/IWallet.sol\";\nimport \"./interfaces/IValidator.sol\";\n\n\ncontract MixinSignatureValidator is\n ReentrancyGuard,\n MSignatureValidator,\n MTransactions\n{\n using LibBytes for bytes;\n \n // Mapping of hash => signer => signed\n mapping (bytes32 => mapping (address => bool)) public preSigned;\n\n // Mapping of signer => validator => approved\n mapping (address => mapping (address => bool)) public allowedValidators;\n\n /// @dev Approves a hash on-chain using any valid signature type.\n /// After presigning a hash, the preSign signature type will become valid for that hash and signer.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n function preSign(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external\n {\n if (signerAddress != msg.sender) {\n require(\n isValidSignature(\n hash,\n signerAddress,\n signature\n ),\n \"INVALID_SIGNATURE\"\n );\n }\n preSigned[hash][signerAddress] = true;\n }\n\n /// @dev Approves/unnapproves a Validator contract to verify signatures on signer's behalf.\n /// @param validatorAddress Address of Validator contract.\n /// @param approval Approval or disapproval of Validator contract.\n function setSignatureValidatorApproval(\n address validatorAddress,\n bool approval\n )\n external\n nonReentrant\n {\n address signerAddress = getCurrentContextAddress();\n allowedValidators[signerAddress][validatorAddress] = approval;\n emit SignatureValidatorApproval(\n signerAddress,\n validatorAddress,\n approval\n );\n }\n\n /// @dev Verifies that a hash has been signed by the given signer.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes memory signature\n )\n public\n view\n returns (bool isValid)\n {\n require(\n signature.length > 0,\n \"LENGTH_GREATER_THAN_0_REQUIRED\"\n );\n\n // Pop last byte off of signature byte array.\n uint8 signatureTypeRaw = uint8(signature.popLastByte());\n\n // Ensure signature is supported\n require(\n signatureTypeRaw < uint8(SignatureType.NSignatureTypes),\n \"SIGNATURE_UNSUPPORTED\"\n );\n\n SignatureType signatureType = SignatureType(signatureTypeRaw);\n\n // Variables are not scoped in Solidity.\n uint8 v;\n bytes32 r;\n bytes32 s;\n address recovered;\n\n // Always illegal signature.\n // This is always an implicit option since a signer can create a\n // signature array with invalid type or length. We may as well make\n // it an explicit option. This aids testing and analysis. It is\n // also the initialization value for the enum type.\n if (signatureType == SignatureType.Illegal) {\n revert(\"SIGNATURE_ILLEGAL\");\n\n // Always invalid signature.\n // Like Illegal, this is always implicitly available and therefore\n // offered explicitly. It can be implicitly created by providing\n // a correctly formatted but incorrect signature.\n } else if (signatureType == SignatureType.Invalid) {\n require(\n signature.length == 0,\n \"LENGTH_0_REQUIRED\"\n );\n isValid = false;\n return isValid;\n\n // Signature using EIP712\n } else if (signatureType == SignatureType.EIP712) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n hash,\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n\n // Signed using web3.eth_sign\n } else if (signatureType == SignatureType.EthSign) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n keccak256(abi.encodePacked(\n \"\\x19Ethereum Signed Message:\\n32\",\n hash\n )),\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n\n // Signature verified by wallet contract.\n // If used with an order, the maker of the order is the wallet contract.\n } else if (signatureType == SignatureType.Wallet) {\n isValid = isValidWalletSignature(\n hash,\n signerAddress,\n signature\n );\n return isValid;\n\n // Signature verified by validator contract.\n // If used with an order, the maker of the order can still be an EOA.\n // A signature using this type should be encoded as:\n // | Offset | Length | Contents |\n // | 0x00 | x | Signature to validate |\n // | 0x00 + x | 20 | Address of validator contract |\n // | 0x14 + x | 1 | Signature type is always \"\\x06\" |\n } else if (signatureType == SignatureType.Validator) {\n // Pop last 20 bytes off of signature byte array.\n address validatorAddress = signature.popLast20Bytes();\n \n // Ensure signer has approved validator.\n if (!allowedValidators[signerAddress][validatorAddress]) {\n return false;\n }\n isValid = isValidValidatorSignature(\n validatorAddress,\n hash,\n signerAddress,\n signature\n );\n return isValid;\n\n // Signer signed hash previously using the preSign function.\n } else if (signatureType == SignatureType.PreSigned) {\n isValid = preSigned[hash][signerAddress];\n return isValid;\n }\n\n // Anything else is illegal (We do not return false because\n // the signature may actually be valid, just not in a format\n // that we currently support. In this case returning false\n // may lead the caller to incorrectly believe that the\n // signature was invalid.)\n revert(\"SIGNATURE_UNSUPPORTED\");\n }\n\n /// @dev Verifies signature using logic defined by Wallet contract.\n /// @param hash Any 32 byte hash.\n /// @param walletAddress Address that should have signed the given hash\n /// and defines its own signature verification method.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if signature is valid for given wallet..\n function isValidWalletSignature(\n bytes32 hash,\n address walletAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid)\n {\n bytes memory calldata = abi.encodeWithSelector(\n IWallet(walletAddress).isValidSignature.selector,\n hash,\n signature\n );\n assembly {\n let cdStart := add(calldata, 32)\n let success := staticcall(\n gas, // forward all gas\n walletAddress, // address of Wallet contract\n cdStart, // pointer to start of input\n mload(calldata), // length of input\n cdStart, // write output over input\n 32 // output size is 32 bytes\n )\n\n switch success\n case 0 {\n // Revert with `Error(\"WALLET_ERROR\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000c57414c4c45545f4552524f5200000000000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n case 1 {\n // Signature is valid if call did not revert and returned true\n isValid := mload(cdStart)\n }\n }\n return isValid;\n }\n\n /// @dev Verifies signature using logic defined by Validator contract.\n /// @param validatorAddress Address of validator contract.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidValidatorSignature(\n address validatorAddress,\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid)\n {\n bytes memory calldata = abi.encodeWithSelector(\n IValidator(signerAddress).isValidSignature.selector,\n hash,\n signerAddress,\n signature\n );\n assembly {\n let cdStart := add(calldata, 32)\n let success := staticcall(\n gas, // forward all gas\n validatorAddress, // address of Validator contract\n cdStart, // pointer to start of input\n mload(calldata), // length of input\n cdStart, // write output over input\n 32 // output size is 32 bytes\n )\n\n switch success\n case 0 {\n // Revert with `Error(\"VALIDATOR_ERROR\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f56414c494441544f525f4552524f5200000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n case 1 {\n // Signature is valid if call did not revert and returned true\n isValid := mload(cdStart)\n }\n }\n return isValid;\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinTransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\nimport \"./libs/LibExchangeErrors.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./libs/LibEIP712.sol\";\n\n\ncontract MixinTransactions is\n LibEIP712,\n MSignatureValidator,\n MTransactions\n{\n // Mapping of transaction hash => executed\n // This prevents transactions from being executed more than once.\n mapping (bytes32 => bool) public transactions;\n\n // Address of current transaction signer\n address public currentContextAddress;\n\n /// @dev Executes an exchange method call in the context of signer.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @param signature Proof of signer transaction by signer.\n function executeTransaction(\n uint256 salt,\n address signerAddress,\n bytes data,\n bytes signature\n )\n external\n {\n // Prevent reentrancy\n require(\n currentContextAddress == address(0),\n \"REENTRANCY_ILLEGAL\"\n );\n\n bytes32 transactionHash = hashEIP712Message(hashZeroExTransaction(\n salt,\n signerAddress,\n data\n ));\n\n // Validate transaction has not been executed\n require(\n !transactions[transactionHash],\n \"INVALID_TX_HASH\"\n );\n\n // Transaction always valid if signer is sender of transaction\n if (signerAddress != msg.sender) {\n // Validate signature\n require(\n isValidSignature(\n transactionHash,\n signerAddress,\n signature\n ),\n \"INVALID_TX_SIGNATURE\"\n );\n\n // Set the current transaction signer\n currentContextAddress = signerAddress;\n }\n\n // Execute transaction\n transactions[transactionHash] = true;\n require(\n address(this).delegatecall(data),\n \"FAILED_EXECUTION\"\n );\n\n // Reset current transaction signer if it was previously updated\n if (signerAddress != msg.sender) {\n currentContextAddress = address(0);\n }\n }\n\n /// @dev Calculates EIP712 hash of the Transaction.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @return EIP712 hash of the Transaction.\n function hashZeroExTransaction(\n uint256 salt,\n address signerAddress,\n bytes memory data\n )\n internal\n pure\n returns (bytes32 result)\n {\n bytes32 schemaHash = EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH;\n bytes32 dataHash = keccak256(data);\n\n // Assembly for more efficiently computing:\n // keccak256(abi.encodePacked(\n // EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH,\n // salt,\n // bytes32(signerAddress),\n // keccak256(data)\n // ));\n\n assembly {\n // Load free memory pointer\n let memPtr := mload(64)\n\n mstore(memPtr, schemaHash) // hash of schema\n mstore(add(memPtr, 32), salt) // salt\n mstore(add(memPtr, 64), and(signerAddress, 0xffffffffffffffffffffffffffffffffffffffff)) // signerAddress\n mstore(add(memPtr, 96), dataHash) // hash of data\n\n // Compute hash\n result := keccak256(memPtr, 128)\n }\n return result;\n }\n\n /// @dev The current function will be called in the context of this address (either 0x transaction signer or `msg.sender`).\n /// If calling a fill function, this address will represent the taker.\n /// If calling a cancel function, this address will represent the maker.\n /// @return Signer of 0x transaction if entry point is `executeTransaction`.\n /// `msg.sender` if entry point is any other function.\n function getCurrentContextAddress()\n internal\n view\n returns (address)\n {\n address currentContextAddress_ = currentContextAddress;\n address contextAddress = currentContextAddress_ == address(0) ? msg.sender : currentContextAddress_;\n return contextAddress;\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./libs/LibAbiEncoder.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MWrapperFunctions.sol\";\n\n\ncontract MixinWrapperFunctions is\n ReentrancyGuard,\n LibMath,\n LibFillResults,\n LibAbiEncoder,\n MExchangeCore,\n MWrapperFunctions\n{\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n nonReentrant\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrKillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n return fillResults;\n }\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (FillResults memory fillResults)\n {\n // ABI encode calldata for `fillOrder`\n bytes memory fillOrderCalldata = abiEncodeFillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n\n // Delegate to `fillOrder` and handle any exceptions gracefully\n assembly {\n let success := delegatecall(\n gas, // forward all gas\n address, // call address of this contract\n add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes)\n mload(fillOrderCalldata), // length of input\n fillOrderCalldata, // write output over input\n 128 // output size is 128 bytes\n )\n if success {\n mstore(fillResults, mload(fillOrderCalldata))\n mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32)))\n mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64)))\n mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96)))\n }\n }\n // fillResults values will be 0 by default if call was unsuccessful\n return fillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrKill.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrKillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrKillOrderInternal(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrders(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n bytes memory takerAssetData = orders[0].takerAssetData;\n \n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being sold by taker is the same for each order.\n // Rather than passing this in as calldata, we use the takerAssetData from the first order in all later orders.\n orders[i].takerAssetData = takerAssetData;\n\n // Calculate the remaining amount of takerAsset to sell\n uint256 remainingTakerAssetFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= takerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory takerAssetData = orders[0].takerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being sold by taker is the same for each order.\n // Rather than passing this in as calldata, we use the takerAssetData from the first order in all later orders.\n orders[i].takerAssetData = takerAssetData;\n\n // Calculate the remaining amount of takerAsset to sell\n uint256 remainingTakerAssetFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= takerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerAsset is bought by taker.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrders(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // Rather than passing this in as calldata, we copy the makerAssetData from the first order onto all later orders.\n orders[i].makerAssetData = makerAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n if (totalFillResults.makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // Rather than passing this in as calldata, we copy the makerAssetData from the first order onto all later orders.\n orders[i].makerAssetData = makerAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n if (totalFillResults.makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously cancels multiple orders in a single transaction.\n /// @param orders Array of order specifications.\n function batchCancelOrders(LibOrder.Order[] memory orders)\n public\n nonReentrant\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n cancelOrderInternal(orders[i]);\n }\n }\n\n /// @dev Fetches information for all passed in orders.\n /// @param orders Array of order specifications.\n /// @return Array of OrderInfo instances that correspond to each order.\n function getOrdersInfo(LibOrder.Order[] memory orders)\n public\n view\n returns (LibOrder.OrderInfo[] memory)\n {\n uint256 ordersLength = orders.length;\n LibOrder.OrderInfo[] memory ordersInfo = new LibOrder.OrderInfo[](ordersLength);\n for (uint256 i = 0; i != ordersLength; i++) {\n ordersInfo[i] = getOrderInfo(orders[i]);\n }\n return ordersInfo;\n }\n\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n require(\n fillResults.takerAssetFilledAmount == takerAssetFillAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return fillResults;\n }\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IAssetProxyDispatcher {\n\n /// @dev Registers an asset proxy to its asset proxy id.\n /// Once an asset proxy is registered, it cannot be unregistered.\n /// @param assetProxy Address of new asset proxy to register.\n function registerAssetProxy(address assetProxy)\n external;\n\n /// @dev Gets an asset proxy.\n /// @param assetProxyId Id of the asset proxy.\n /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered.\n function getAssetProxy(bytes4 assetProxyId)\n external\n view\n returns (address);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IExchange.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./IExchangeCore.sol\";\nimport \"./IMatchOrders.sol\";\nimport \"./ISignatureValidator.sol\";\nimport \"./ITransactions.sol\";\nimport \"./IAssetProxyDispatcher.sol\";\nimport \"./IWrapperFunctions.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract IExchange is\n IExchangeCore,\n IMatchOrders,\n ISignatureValidator,\n ITransactions,\n IAssetProxyDispatcher,\n IWrapperFunctions\n{}\n",
- "2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IExchangeCore {\n\n /// @dev Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch\n /// and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress).\n /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled.\n function cancelOrdersUpTo(uint256 targetOrderEpoch)\n external;\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev After calling, the order can not be filled anymore.\n /// @param order Order struct containing order specifications.\n function cancelOrder(LibOrder.Order memory order)\n public;\n\n /// @dev Gets information about an order: status, hash, and amount filled.\n /// @param order Order to gather information on.\n /// @return OrderInfo Information about the order and its state.\n /// See LibOrder.OrderInfo for a complete description.\n function getOrderInfo(LibOrder.Order memory order)\n public\n view\n returns (LibOrder.OrderInfo memory orderInfo);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IMatchOrders {\n\n /// @dev Match two complementary orders that have a profitable spread.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the left order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftSignature Proof that order was created by the left maker.\n /// @param rightSignature Proof that order was created by the right maker.\n /// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.\n function matchOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n bytes memory leftSignature,\n bytes memory rightSignature\n )\n public\n returns (LibFillResults.MatchedFillResults memory matchedFillResults);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract ISignatureValidator {\n\n /// @dev Approves a hash on-chain using any valid signature type.\n /// After presigning a hash, the preSign signature type will become valid for that hash and signer.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n function preSign(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external;\n \n /// @dev Approves/unnapproves a Validator contract to verify signatures on signer's behalf.\n /// @param validatorAddress Address of Validator contract.\n /// @param approval Approval or disapproval of Validator contract.\n function setSignatureValidatorApproval(\n address validatorAddress,\n bool approval\n )\n external;\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signerAddress Address of signer.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes memory signature\n )\n public\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/ITransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\n\ncontract ITransactions {\n\n /// @dev Executes an exchange method call in the context of signer.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @param signature Proof of signer transaction by signer.\n function executeTransaction(\n uint256 salt,\n address signerAddress,\n bytes data,\n bytes signature\n )\n external;\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IValidator {\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IWallet.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IWallet {\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n bytes signature\n )\n external\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IWrapperFunctions {\n\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrKill.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrKillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrders(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerAsset is bought by taker.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrders(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously cancels multiple orders in a single transaction.\n /// @param orders Array of order specifications.\n function batchCancelOrders(LibOrder.Order[] memory orders)\n public;\n\n /// @dev Fetches information for all passed in orders\n /// @param orders Array of order specifications.\n /// @return Array of OrderInfo instances that correspond to each order.\n function getOrdersInfo(LibOrder.Order[] memory orders)\n public\n view\n returns (LibOrder.OrderInfo[] memory);\n}\n",
- "2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./LibOrder.sol\";\n\n\ncontract LibAbiEncoder {\n\n /// @dev ABI encodes calldata for `fillOrder`.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return ABI encoded calldata for `fillOrder`.\n function abiEncodeFillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n pure\n returns (bytes memory fillOrderCalldata)\n {\n // We need to call MExchangeCore.fillOrder using a delegatecall in\n // assembly so that we can intercept a call that throws. For this, we\n // need the input encoded in memory in the Ethereum ABIv2 format [1].\n\n // | Area | Offset | Length | Contents |\n // | -------- |--------|---------|-------------------------------------------- |\n // | Header | 0x00 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 0x00 | | 1. offset to order (*) |\n // | | 0x20 | | 2. takerAssetFillAmount |\n // | | 0x40 | | 3. offset to signature (*) |\n // | Data | | 12 * 32 | order: |\n // | | 0x000 | | 1. senderAddress |\n // | | 0x020 | | 2. makerAddress |\n // | | 0x040 | | 3. takerAddress |\n // | | 0x060 | | 4. feeRecipientAddress |\n // | | 0x080 | | 5. makerAssetAmount |\n // | | 0x0A0 | | 6. takerAssetAmount |\n // | | 0x0C0 | | 7. makerFeeAmount |\n // | | 0x0E0 | | 8. takerFeeAmount |\n // | | 0x100 | | 9. expirationTimeSeconds |\n // | | 0x120 | | 10. salt |\n // | | 0x140 | | 11. Offset to makerAssetData (*) |\n // | | 0x160 | | 12. Offset to takerAssetData (*) |\n // | | 0x180 | 32 | makerAssetData Length |\n // | | 0x1A0 | ** | makerAssetData Contents |\n // | | 0x1C0 | 32 | takerAssetData Length |\n // | | 0x1E0 | ** | takerAssetData Contents |\n // | | 0x200 | 32 | signature Length |\n // | | 0x220 | ** | signature Contents |\n\n // * Offsets are calculated from the beginning of the current area: Header, Params, Data:\n // An offset stored in the Params area is calculated from the beginning of the Params section.\n // An offset stored in the Data area is calculated from the beginning of the Data section.\n\n // ** The length of dynamic array contents are stored in the field immediately preceeding the contents.\n\n // [1]: https://solidity.readthedocs.io/en/develop/abi-spec.html\n\n assembly {\n\n // Areas below may use the following variables:\n // 1. <area>Start -- Start of this area in memory\n // 2. <area>End -- End of this area in memory. This value may\n // be precomputed (before writing contents),\n // or it may be computed as contents are written.\n // 3. <area>Offset -- Current offset into area. If an area's End\n // is precomputed, this variable tracks the\n // offsets of contents as they are written.\n\n /////// Setup Header Area ///////\n // Load free memory pointer\n fillOrderCalldata := mload(0x40)\n // bytes4(keccak256(\"fillOrder((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),uint256,bytes)\"))\n // = 0xb4be83d5\n // Leave 0x20 bytes to store the length\n mstore(add(fillOrderCalldata, 0x20), 0xb4be83d500000000000000000000000000000000000000000000000000000000)\n let headerAreaEnd := add(fillOrderCalldata, 0x24)\n\n /////// Setup Params Area ///////\n // This area is preallocated and written to later.\n // This is because we need to fill in offsets that have not yet been calculated.\n let paramsAreaStart := headerAreaEnd\n let paramsAreaEnd := add(paramsAreaStart, 0x60)\n let paramsAreaOffset := paramsAreaStart\n\n /////// Setup Data Area ///////\n let dataAreaStart := paramsAreaEnd\n let dataAreaEnd := dataAreaStart\n\n // Offset from the source data we're reading from\n let sourceOffset := order\n // arrayLenBytes and arrayLenWords track the length of a dynamically-allocated bytes array.\n let arrayLenBytes := 0\n let arrayLenWords := 0\n\n /////// Write order Struct ///////\n // Write memory location of Order, relative to the start of the\n // parameter list, then increment the paramsAreaOffset respectively.\n mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))\n paramsAreaOffset := add(paramsAreaOffset, 0x20)\n\n // Write values for each field in the order\n // It would be nice to use a loop, but we save on gas by writing\n // the stores sequentially.\n mstore(dataAreaEnd, mload(sourceOffset)) // makerAddress\n mstore(add(dataAreaEnd, 0x20), mload(add(sourceOffset, 0x20))) // takerAddress\n mstore(add(dataAreaEnd, 0x40), mload(add(sourceOffset, 0x40))) // feeRecipientAddress\n mstore(add(dataAreaEnd, 0x60), mload(add(sourceOffset, 0x60))) // senderAddress\n mstore(add(dataAreaEnd, 0x80), mload(add(sourceOffset, 0x80))) // makerAssetAmount\n mstore(add(dataAreaEnd, 0xA0), mload(add(sourceOffset, 0xA0))) // takerAssetAmount\n mstore(add(dataAreaEnd, 0xC0), mload(add(sourceOffset, 0xC0))) // makerFeeAmount\n mstore(add(dataAreaEnd, 0xE0), mload(add(sourceOffset, 0xE0))) // takerFeeAmount\n mstore(add(dataAreaEnd, 0x100), mload(add(sourceOffset, 0x100))) // expirationTimeSeconds\n mstore(add(dataAreaEnd, 0x120), mload(add(sourceOffset, 0x120))) // salt\n mstore(add(dataAreaEnd, 0x140), mload(add(sourceOffset, 0x140))) // Offset to makerAssetData\n mstore(add(dataAreaEnd, 0x160), mload(add(sourceOffset, 0x160))) // Offset to takerAssetData\n dataAreaEnd := add(dataAreaEnd, 0x180)\n sourceOffset := add(sourceOffset, 0x180)\n\n // Write offset to <order.makerAssetData>\n mstore(add(dataAreaStart, mul(10, 0x20)), sub(dataAreaEnd, dataAreaStart))\n\n // Calculate length of <order.makerAssetData>\n sourceOffset := mload(add(order, 0x140)) // makerAssetData\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of <order.makerAssetData>\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of <order.makerAssetData>\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n // Write offset to <order.takerAssetData>\n mstore(add(dataAreaStart, mul(11, 0x20)), sub(dataAreaEnd, dataAreaStart))\n\n // Calculate length of <order.takerAssetData>\n sourceOffset := mload(add(order, 0x160)) // takerAssetData\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of <order.takerAssetData>\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of <order.takerAssetData>\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n /////// Write takerAssetFillAmount ///////\n mstore(paramsAreaOffset, takerAssetFillAmount)\n paramsAreaOffset := add(paramsAreaOffset, 0x20)\n\n /////// Write signature ///////\n // Write offset to paramsArea\n mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))\n\n // Calculate length of signature\n sourceOffset := signature\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of signature\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of signature\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n // Set length of calldata\n mstore(fillOrderCalldata, sub(dataAreaEnd, add(fillOrderCalldata, 0x20)))\n\n // Increment free memory pointer\n mstore(0x40, dataAreaEnd)\n }\n\n return fillOrderCalldata;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibConstants.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\n// solhint-disable max-line-length\ncontract LibConstants {\n \n // Asset data for ZRX token. Used for fee transfers.\n // @TODO: Hardcode constant when we deploy. Currently \n // not constant to make testing easier.\n\n // The proxyId for ZRX_ASSET_DATA is bytes4(keccak256(\"ERC20Token(address)\")) = 0xf47261b0\n \n // Kovan ZRX address is 0x6ff6c0ff1d68b964901f986d4c9fa3ac68346570.\n // The ABI encoded proxyId and address is 0xf47261b00000000000000000000000006ff6c0ff1d68b964901f986d4c9fa3ac68346570\n // bytes constant public ZRX_ASSET_DATA = \"\\xf4\\x72\\x61\\xb0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x6f\\xf6\\xc0\\xff\\x1d\\x68\\xb9\\x64\\x90\\x1f\\x98\\x6d\\x4c\\x9f\\xa3\\xac\\x68\\x34\\x65\\x70\";\n \n // Mainnet ZRX address is 0xe41d2489571d322189246dafa5ebde1f4699f498.\n // The ABI encoded proxyId and address is 0xf47261b0000000000000000000000000e41d2489571d322189246dafa5ebde1f4699f498\n // bytes constant public ZRX_ASSET_DATA = \"\\xf4\\x72\\x61\\xb0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xe4\\x1d\\x24\\x89\\x57\\x1d\\x32\\x21\\x89\\x24\\x6d\\xaf\\xa5\\xeb\\xde\\x1f\\x46\\x99\\xf4\\x98\";\n \n // solhint-disable-next-line var-name-mixedcase\n bytes public ZRX_ASSET_DATA;\n\n // @TODO: Remove when we deploy.\n constructor (bytes memory zrxAssetData)\n public\n {\n ZRX_ASSET_DATA = zrxAssetData;\n }\n}\n// solhint-enable max-line-length\n",
- "2.0.0/protocol/Exchange/libs/LibEIP712.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract LibEIP712 {\n\n // EIP191 header for EIP712 prefix\n string constant internal EIP191_HEADER = \"\\x19\\x01\";\n\n // EIP712 Domain Name value\n string constant internal EIP712_DOMAIN_NAME = \"0x Protocol\";\n\n // EIP712 Domain Version value\n string constant internal EIP712_DOMAIN_VERSION = \"2\";\n\n // Hash of the EIP712 Domain Separator Schema\n bytes32 constant internal EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"EIP712Domain(\",\n \"string name,\",\n \"string version,\",\n \"address verifyingContract\",\n \")\"\n ));\n\n // Hash of the EIP712 Domain Separator data\n // solhint-disable-next-line var-name-mixedcase\n bytes32 public EIP712_DOMAIN_HASH;\n\n constructor ()\n public\n {\n EIP712_DOMAIN_HASH = keccak256(abi.encodePacked(\n EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH,\n keccak256(bytes(EIP712_DOMAIN_NAME)),\n keccak256(bytes(EIP712_DOMAIN_VERSION)),\n bytes32(address(this))\n ));\n }\n\n /// @dev Calculates EIP712 encoding for a hash struct in this EIP712 Domain.\n /// @param hashStruct The EIP712 hash struct.\n /// @return EIP712 hash applied to this EIP712 Domain.\n function hashEIP712Message(bytes32 hashStruct)\n internal\n view\n returns (bytes32 result)\n {\n bytes32 eip712DomainHash = EIP712_DOMAIN_HASH;\n\n // Assembly for more efficient computing:\n // keccak256(abi.encodePacked(\n // EIP191_HEADER,\n // EIP712_DOMAIN_HASH,\n // hashStruct \n // ));\n\n assembly {\n // Load free memory pointer\n let memPtr := mload(64)\n\n mstore(memPtr, 0x1901000000000000000000000000000000000000000000000000000000000000) // EIP191 header\n mstore(add(memPtr, 2), eip712DomainHash) // EIP712 domain hash\n mstore(add(memPtr, 34), hashStruct) // Hash of struct\n\n // Compute hash\n result := keccak256(memPtr, 66)\n }\n return result;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\n// solhint-disable\npragma solidity 0.4.24;\n\n\n/// @dev This contract documents the revert reasons used in the Exchange contract.\n/// This contract is intended to serve as a reference, but is not actually used for efficiency reasons.\ncontract LibExchangeErrors {\n\n /// Order validation errors ///\n string constant ORDER_UNFILLABLE = \"ORDER_UNFILLABLE\"; // Order cannot be filled.\n string constant INVALID_MAKER = \"INVALID_MAKER\"; // Invalid makerAddress.\n string constant INVALID_TAKER = \"INVALID_TAKER\"; // Invalid takerAddress.\n string constant INVALID_SENDER = \"INVALID_SENDER\"; // Invalid `msg.sender`.\n string constant INVALID_ORDER_SIGNATURE = \"INVALID_ORDER_SIGNATURE\"; // Signature validation failed. \n \n /// fillOrder validation errors ///\n string constant INVALID_TAKER_AMOUNT = \"INVALID_TAKER_AMOUNT\"; // takerAssetFillAmount cannot equal 0.\n string constant ROUNDING_ERROR = \"ROUNDING_ERROR\"; // Rounding error greater than 0.1% of takerAssetFillAmount. \n \n /// Signature validation errors ///\n string constant INVALID_SIGNATURE = \"INVALID_SIGNATURE\"; // Signature validation failed. \n string constant SIGNATURE_ILLEGAL = \"SIGNATURE_ILLEGAL\"; // Signature type is illegal.\n string constant SIGNATURE_UNSUPPORTED = \"SIGNATURE_UNSUPPORTED\"; // Signature type unsupported.\n \n /// cancelOrdersUptTo errors ///\n string constant INVALID_NEW_ORDER_EPOCH = \"INVALID_NEW_ORDER_EPOCH\"; // Specified salt must be greater than or equal to existing orderEpoch.\n\n /// fillOrKillOrder errors ///\n string constant COMPLETE_FILL_FAILED = \"COMPLETE_FILL_FAILED\"; // Desired takerAssetFillAmount could not be completely filled. \n\n /// matchOrders errors ///\n string constant NEGATIVE_SPREAD_REQUIRED = \"NEGATIVE_SPREAD_REQUIRED\"; // Matched orders must have a negative spread.\n\n /// Transaction errors ///\n string constant REENTRANCY_ILLEGAL = \"REENTRANCY_ILLEGAL\"; // Recursive reentrancy is not allowed. \n string constant INVALID_TX_HASH = \"INVALID_TX_HASH\"; // Transaction has already been executed. \n string constant INVALID_TX_SIGNATURE = \"INVALID_TX_SIGNATURE\"; // Signature validation failed. \n string constant FAILED_EXECUTION = \"FAILED_EXECUTION\"; // Transaction execution failed. \n \n /// registerAssetProxy errors ///\n string constant ASSET_PROXY_ALREADY_EXISTS = \"ASSET_PROXY_ALREADY_EXISTS\"; // AssetProxy with same id already exists.\n\n /// dispatchTransferFrom errors ///\n string constant ASSET_PROXY_DOES_NOT_EXIST = \"ASSET_PROXY_DOES_NOT_EXIST\"; // No assetProxy registered at given id.\n string constant TRANSFER_FAILED = \"TRANSFER_FAILED\"; // Asset transfer unsuccesful.\n\n /// Length validation errors ///\n string constant LENGTH_GREATER_THAN_0_REQUIRED = \"LENGTH_GREATER_THAN_0_REQUIRED\"; // Byte array must have a length greater than 0.\n string constant LENGTH_GREATER_THAN_3_REQUIRED = \"LENGTH_GREATER_THAN_3_REQUIRED\"; // Byte array must have a length greater than 3.\n string constant LENGTH_0_REQUIRED = \"LENGTH_0_REQUIRED\"; // Byte array must have a length of 0.\n string constant LENGTH_65_REQUIRED = \"LENGTH_65_REQUIRED\"; // Byte array must have a length of 65.\n}\n",
- "2.0.0/protocol/Exchange/libs/LibFillResults.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract LibFillResults is\n SafeMath\n{\n struct FillResults {\n uint256 makerAssetFilledAmount; // Total amount of makerAsset(s) filled.\n uint256 takerAssetFilledAmount; // Total amount of takerAsset(s) filled.\n uint256 makerFeePaid; // Total amount of ZRX paid by maker(s) to feeRecipient(s).\n uint256 takerFeePaid; // Total amount of ZRX paid by taker to feeRecipients(s).\n }\n\n struct MatchedFillResults {\n FillResults left; // Amounts filled and fees paid of left order.\n FillResults right; // Amounts filled and fees paid of right order.\n uint256 leftMakerAssetSpreadAmount; // Spread between price of left and right order, denominated in the left order's makerAsset, paid to taker.\n }\n\n /// @dev Adds properties of both FillResults instances.\n /// Modifies the first FillResults instance specified.\n /// @param totalFillResults Fill results instance that will be added onto.\n /// @param singleFillResults Fill results instance that will be added to totalFillResults.\n function addFillResults(FillResults memory totalFillResults, FillResults memory singleFillResults)\n internal\n pure\n {\n totalFillResults.makerAssetFilledAmount = safeAdd(totalFillResults.makerAssetFilledAmount, singleFillResults.makerAssetFilledAmount);\n totalFillResults.takerAssetFilledAmount = safeAdd(totalFillResults.takerAssetFilledAmount, singleFillResults.takerAssetFilledAmount);\n totalFillResults.makerFeePaid = safeAdd(totalFillResults.makerFeePaid, singleFillResults.makerFeePaid);\n totalFillResults.takerFeePaid = safeAdd(totalFillResults.takerFeePaid, singleFillResults.takerFeePaid);\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibMath.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract LibMath is\n SafeMath\n{\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// Reverts if rounding error is >= 0.1%\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded down.\n function safeGetPartialAmountFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n require(\n !isRoundingErrorFloor(\n numerator,\n denominator,\n target\n ),\n \"ROUNDING_ERROR\"\n );\n \n partialAmount = safeDiv(\n safeMul(numerator, target),\n denominator\n );\n return partialAmount;\n }\n\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// Reverts if rounding error is >= 0.1%\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded up.\n function safeGetPartialAmountCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n require(\n !isRoundingErrorCeil(\n numerator,\n denominator,\n target\n ),\n \"ROUNDING_ERROR\"\n );\n \n // safeDiv computes `floor(a / b)`. We use the identity (a, b integer):\n // ceil(a / b) = floor((a + b - 1) / b)\n // To implement `ceil(a / b)` using safeDiv.\n partialAmount = safeDiv(\n safeAdd(\n safeMul(numerator, target),\n safeSub(denominator, 1)\n ),\n denominator\n );\n return partialAmount;\n }\n\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded down.\n function getPartialAmountFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n partialAmount = safeDiv(\n safeMul(numerator, target),\n denominator\n );\n return partialAmount;\n }\n \n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded up.\n function getPartialAmountCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n // safeDiv computes `floor(a / b)`. We use the identity (a, b integer):\n // ceil(a / b) = floor((a + b - 1) / b)\n // To implement `ceil(a / b)` using safeDiv.\n partialAmount = safeDiv(\n safeAdd(\n safeMul(numerator, target),\n safeSub(denominator, 1)\n ),\n denominator\n );\n return partialAmount;\n }\n \n /// @dev Checks if rounding error >= 0.1% when rounding down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to multiply with numerator/denominator.\n /// @return Rounding error is present.\n function isRoundingErrorFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (bool isError)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n \n // The absolute rounding error is the difference between the rounded\n // value and the ideal value. The relative rounding error is the\n // absolute rounding error divided by the absolute value of the\n // ideal value. This is undefined when the ideal value is zero.\n //\n // The ideal value is `numerator * target / denominator`.\n // Let's call `numerator * target % denominator` the remainder.\n // The absolute error is `remainder / denominator`.\n //\n // When the ideal value is zero, we require the absolute error to\n // be zero. Fortunately, this is always the case. The ideal value is\n // zero iff `numerator == 0` and/or `target == 0`. In this case the\n // remainder and absolute error are also zero. \n if (target == 0 || numerator == 0) {\n return false;\n }\n \n // Otherwise, we want the relative rounding error to be strictly\n // less than 0.1%.\n // The relative error is `remainder / (numerator * target)`.\n // We want the relative error less than 1 / 1000:\n // remainder / (numerator * denominator) < 1 / 1000\n // or equivalently:\n // 1000 * remainder < numerator * target\n // so we have a rounding error iff:\n // 1000 * remainder >= numerator * target\n uint256 remainder = mulmod(\n target,\n numerator,\n denominator\n );\n isError = safeMul(1000, remainder) >= safeMul(numerator, target);\n return isError;\n }\n \n /// @dev Checks if rounding error >= 0.1% when rounding up.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to multiply with numerator/denominator.\n /// @return Rounding error is present.\n function isRoundingErrorCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (bool isError)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n \n // See the comments in `isRoundingError`.\n if (target == 0 || numerator == 0) {\n // When either is zero, the ideal value and rounded value are zero\n // and there is no rounding error. (Although the relative error\n // is undefined.)\n return false;\n }\n // Compute remainder as before\n uint256 remainder = mulmod(\n target,\n numerator,\n denominator\n );\n remainder = safeSub(denominator, remainder) % denominator;\n isError = safeMul(1000, remainder) >= safeMul(numerator, target);\n return isError;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibOrder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./LibEIP712.sol\";\n\n\ncontract LibOrder is\n LibEIP712\n{\n // Hash for the EIP712 Order Schema\n bytes32 constant internal EIP712_ORDER_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"Order(\",\n \"address makerAddress,\",\n \"address takerAddress,\",\n \"address feeRecipientAddress,\",\n \"address senderAddress,\",\n \"uint256 makerAssetAmount,\",\n \"uint256 takerAssetAmount,\",\n \"uint256 makerFee,\",\n \"uint256 takerFee,\",\n \"uint256 expirationTimeSeconds,\",\n \"uint256 salt,\",\n \"bytes makerAssetData,\",\n \"bytes takerAssetData\",\n \")\"\n ));\n\n // A valid order remains fillable until it is expired, fully filled, or cancelled.\n // An order's state is unaffected by external factors, like account balances.\n enum OrderStatus {\n INVALID, // Default value\n INVALID_MAKER_ASSET_AMOUNT, // Order does not have a valid maker asset amount\n INVALID_TAKER_ASSET_AMOUNT, // Order does not have a valid taker asset amount\n FILLABLE, // Order is fillable\n EXPIRED, // Order has already expired\n FULLY_FILLED, // Order is fully filled\n CANCELLED // Order has been cancelled\n }\n\n // solhint-disable max-line-length\n struct Order {\n address makerAddress; // Address that created the order. \n address takerAddress; // Address that is allowed to fill the order. If set to 0, any address is allowed to fill the order. \n address feeRecipientAddress; // Address that will recieve fees when order is filled. \n address senderAddress; // Address that is allowed to call Exchange contract methods that affect this order. If set to 0, any address is allowed to call these methods.\n uint256 makerAssetAmount; // Amount of makerAsset being offered by maker. Must be greater than 0. \n uint256 takerAssetAmount; // Amount of takerAsset being bid on by maker. Must be greater than 0. \n uint256 makerFee; // Amount of ZRX paid to feeRecipient by maker when order is filled. If set to 0, no transfer of ZRX from maker to feeRecipient will be attempted.\n uint256 takerFee; // Amount of ZRX paid to feeRecipient by taker when order is filled. If set to 0, no transfer of ZRX from taker to feeRecipient will be attempted.\n uint256 expirationTimeSeconds; // Timestamp in seconds at which order expires. \n uint256 salt; // Arbitrary number to facilitate uniqueness of the order's hash. \n bytes makerAssetData; // Encoded data that can be decoded by a specified proxy contract when transferring makerAsset. The last byte references the id of this proxy.\n bytes takerAssetData; // Encoded data that can be decoded by a specified proxy contract when transferring takerAsset. The last byte references the id of this proxy.\n }\n // solhint-enable max-line-length\n\n struct OrderInfo {\n uint8 orderStatus; // Status that describes order's validity and fillability.\n bytes32 orderHash; // EIP712 hash of the order (see LibOrder.getOrderHash).\n uint256 orderTakerAssetFilledAmount; // Amount of order that has already been filled.\n }\n\n /// @dev Calculates Keccak-256 hash of the order.\n /// @param order The order structure.\n /// @return Keccak-256 EIP712 hash of the order.\n function getOrderHash(Order memory order)\n internal\n view\n returns (bytes32 orderHash)\n {\n orderHash = hashEIP712Message(hashOrder(order));\n return orderHash;\n }\n\n /// @dev Calculates EIP712 hash of the order.\n /// @param order The order structure.\n /// @return EIP712 hash of the order.\n function hashOrder(Order memory order)\n internal\n pure\n returns (bytes32 result)\n {\n bytes32 schemaHash = EIP712_ORDER_SCHEMA_HASH;\n bytes32 makerAssetDataHash = keccak256(order.makerAssetData);\n bytes32 takerAssetDataHash = keccak256(order.takerAssetData);\n\n // Assembly for more efficiently computing:\n // keccak256(abi.encodePacked(\n // EIP712_ORDER_SCHEMA_HASH,\n // bytes32(order.makerAddress),\n // bytes32(order.takerAddress),\n // bytes32(order.feeRecipientAddress),\n // bytes32(order.senderAddress),\n // order.makerAssetAmount,\n // order.takerAssetAmount,\n // order.makerFee,\n // order.takerFee,\n // order.expirationTimeSeconds,\n // order.salt,\n // keccak256(order.makerAssetData),\n // keccak256(order.takerAssetData)\n // ));\n\n assembly {\n // Calculate memory addresses that will be swapped out before hashing\n let pos1 := sub(order, 32)\n let pos2 := add(order, 320)\n let pos3 := add(order, 352)\n\n // Backup\n let temp1 := mload(pos1)\n let temp2 := mload(pos2)\n let temp3 := mload(pos3)\n \n // Hash in place\n mstore(pos1, schemaHash)\n mstore(pos2, makerAssetDataHash)\n mstore(pos3, takerAssetDataHash)\n result := keccak256(pos1, 416)\n \n // Restore\n mstore(pos1, temp1)\n mstore(pos2, temp2)\n mstore(pos3, temp3)\n }\n return result;\n }\n}\n",
- "2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAssetProxyDispatcher.sol\";\n\n\ncontract MAssetProxyDispatcher is\n IAssetProxyDispatcher\n{\n // Logs registration of new asset proxy\n event AssetProxyRegistered(\n bytes4 id, // Id of new registered AssetProxy.\n address assetProxy // Address of new registered AssetProxy.\n );\n\n /// @dev Forwards arguments to assetProxy and calls `transferFrom`. Either succeeds or throws.\n /// @param assetData Byte array encoded for the asset.\n /// @param from Address to transfer token from.\n /// @param to Address to transfer token to.\n /// @param amount Amount of token to transfer.\n function dispatchTransferFrom(\n bytes memory assetData,\n address from,\n address to,\n uint256 amount\n )\n internal;\n}\n",
- "2.0.0/protocol/Exchange/mixins/MExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IExchangeCore.sol\";\n\n\ncontract MExchangeCore is\n IExchangeCore\n{\n // Fill event is emitted whenever an order is filled.\n event Fill(\n address indexed makerAddress, // Address that created the order. \n address indexed feeRecipientAddress, // Address that received fees.\n address takerAddress, // Address that filled the order.\n address senderAddress, // Address that called the Exchange contract (msg.sender).\n uint256 makerAssetFilledAmount, // Amount of makerAsset sold by maker and bought by taker. \n uint256 takerAssetFilledAmount, // Amount of takerAsset sold by taker and bought by maker.\n uint256 makerFeePaid, // Amount of ZRX paid to feeRecipient by maker.\n uint256 takerFeePaid, // Amount of ZRX paid to feeRecipient by taker.\n bytes32 indexed orderHash, // EIP712 hash of order (see LibOrder.getOrderHash).\n bytes makerAssetData, // Encoded data specific to makerAsset. \n bytes takerAssetData // Encoded data specific to takerAsset.\n );\n\n // Cancel event is emitted whenever an individual order is cancelled.\n event Cancel(\n address indexed makerAddress, // Address that created the order. \n address indexed feeRecipientAddress, // Address that would have recieved fees if order was filled. \n address senderAddress, // Address that called the Exchange contract (msg.sender).\n bytes32 indexed orderHash, // EIP712 hash of order (see LibOrder.getOrderHash).\n bytes makerAssetData, // Encoded data specific to makerAsset. \n bytes takerAssetData // Encoded data specific to takerAsset.\n );\n\n // CancelUpTo event is emitted whenever `cancelOrdersUpTo` is executed succesfully.\n event CancelUpTo(\n address indexed makerAddress, // Orders cancelled must have been created by this address.\n address indexed senderAddress, // Orders cancelled must have a `senderAddress` equal to this address.\n uint256 orderEpoch // Orders with specified makerAddress and senderAddress with a salt less than this value are considered cancelled.\n );\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev After calling, the order can not be filled anymore.\n /// @param order Order struct containing order specifications.\n function cancelOrderInternal(LibOrder.Order memory order)\n internal;\n\n /// @dev Updates state with results of a fill order.\n /// @param order that was filled.\n /// @param takerAddress Address of taker who filled the order.\n /// @param orderTakerAssetFilledAmount Amount of order already filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function updateFilledState(\n LibOrder.Order memory order,\n address takerAddress,\n bytes32 orderHash,\n uint256 orderTakerAssetFilledAmount,\n LibFillResults.FillResults memory fillResults\n )\n internal;\n\n /// @dev Updates state with results of cancelling an order.\n /// State is only updated if the order is currently fillable.\n /// Otherwise, updating state would have no effect.\n /// @param order that was cancelled.\n /// @param orderHash Hash of order that was cancelled.\n function updateCancelledState(\n LibOrder.Order memory order,\n bytes32 orderHash\n )\n internal;\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAddress Address of order taker.\n /// @param signature Proof that the orders was created by its maker.\n function assertFillableOrder(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo,\n address takerAddress,\n bytes memory signature\n )\n internal\n view;\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo Status, orderHash, and amount already filled of order.\n /// @param takerAssetFillAmount Desired amount of order to fill by taker.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @param makerAssetFilledAmount Amount of makerAsset that will be transfered.\n function assertValidFill(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo,\n uint256 takerAssetFillAmount,\n uint256 takerAssetFilledAmount,\n uint256 makerAssetFilledAmount\n )\n internal\n view;\n\n /// @dev Validates context for cancelOrder. Succeeds or throws.\n /// @param order to be cancelled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n function assertValidCancel(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo\n )\n internal\n view;\n\n /// @dev Calculates amounts filled and fees paid by maker and taker.\n /// @param order to be filled.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function calculateFillResults(\n LibOrder.Order memory order,\n uint256 takerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.FillResults memory fillResults);\n\n}\n",
- "2.0.0/protocol/Exchange/mixins/MMatchOrders.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IMatchOrders.sol\";\n\n\ncontract MMatchOrders is\n IMatchOrders\n{\n /// @dev Validates context for matchOrders. Succeeds or throws.\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n function assertValidMatch(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder\n )\n internal\n pure;\n\n /// @dev Calculates fill amounts for the matched orders.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the leftOrder order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftOrderTakerAssetFilledAmount Amount of left order already filled.\n /// @param rightOrderTakerAssetFilledAmount Amount of right order already filled.\n /// @param matchedFillResults Amounts to fill and fees to pay by maker and taker of matched orders.\n function calculateMatchedFillResults(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n uint256 leftOrderTakerAssetFilledAmount,\n uint256 rightOrderTakerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.MatchedFillResults memory matchedFillResults);\n\n}\n",
- "2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/ISignatureValidator.sol\";\n\n\ncontract MSignatureValidator is\n ISignatureValidator\n{\n event SignatureValidatorApproval(\n address indexed signerAddress, // Address that approves or disapproves a contract to verify signatures.\n address indexed validatorAddress, // Address of signature validator contract.\n bool approved // Approval or disapproval of validator contract.\n );\n\n // Allowed signature types.\n enum SignatureType {\n Illegal, // 0x00, default value\n Invalid, // 0x01\n EIP712, // 0x02\n EthSign, // 0x03\n Wallet, // 0x04\n Validator, // 0x05\n PreSigned, // 0x06\n NSignatureTypes // 0x07, number of signature types. Always leave at end.\n }\n\n /// @dev Verifies signature using logic defined by Wallet contract.\n /// @param hash Any 32 byte hash.\n /// @param walletAddress Address that should have signed the given hash\n /// and defines its own signature verification method.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidWalletSignature(\n bytes32 hash,\n address walletAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid);\n\n /// @dev Verifies signature using logic defined by Validator contract.\n /// @param validatorAddress Address of validator contract.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidValidatorSignature(\n address validatorAddress,\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/mixins/MTransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\nimport \"../interfaces/ITransactions.sol\";\n\n\ncontract MTransactions is\n ITransactions\n{\n // Hash for the EIP712 ZeroEx Transaction Schema\n bytes32 constant internal EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"ZeroExTransaction(\",\n \"uint256 salt,\",\n \"address signerAddress,\",\n \"bytes data\",\n \")\"\n ));\n\n /// @dev Calculates EIP712 hash of the Transaction.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @return EIP712 hash of the Transaction.\n function hashZeroExTransaction(\n uint256 salt,\n address signerAddress,\n bytes memory data\n )\n internal\n pure\n returns (bytes32 result);\n\n /// @dev The current function will be called in the context of this address (either 0x transaction signer or `msg.sender`).\n /// If calling a fill function, this address will represent the taker.\n /// If calling a cancel function, this address will represent the maker.\n /// @return Signer of 0x transaction if entry point is `executeTransaction`.\n /// `msg.sender` if entry point is any other function.\n function getCurrentContextAddress()\n internal\n view\n returns (address);\n}\n",
- "2.0.0/protocol/Exchange/mixins/MWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IWrapperFunctions.sol\";\n\n\ncontract MWrapperFunctions is \n IWrapperFunctions\n{\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n}\n",
- "2.0.0/test/DummyERC20Token/DummyERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"../../tokens/ERC20Token/MintableERC20Token.sol\";\n\n\ncontract DummyERC20Token is \n Ownable,\n MintableERC20Token\n{\n string public name;\n string public symbol;\n uint256 public decimals;\n uint256 public constant MAX_MINT_AMOUNT = 10000000000000000000000;\n\n constructor (\n string _name,\n string _symbol,\n uint256 _decimals,\n uint256 _totalSupply\n )\n public\n {\n name = _name;\n symbol = _symbol;\n decimals = _decimals;\n _totalSupply = _totalSupply;\n balances[msg.sender] = _totalSupply;\n }\n\n /// @dev Sets the balance of target address\n /// @param _target Address or which balance will be updated\n /// @param _value New balance of target address\n function setBalance(address _target, uint256 _value)\n external\n onlyOwner\n {\n uint256 currBalance = balances[_target];\n if (_value < currBalance) {\n _totalSupply = safeSub(_totalSupply, safeSub(currBalance, _value));\n } else {\n _totalSupply = safeAdd(_totalSupply, safeSub(_value, currBalance));\n }\n balances[_target] = _value;\n }\n\n /// @dev Mints new tokens for sender\n /// @param _value Amount of tokens to mint\n function mint(uint256 _value)\n external\n {\n require(\n _value <= MAX_MINT_AMOUNT,\n \"VALUE_TOO_LARGE\"\n );\n\n _mint(msg.sender, _value);\n }\n}\n",
- "2.0.0/test/DummyERC721Token/DummyERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../tokens/ERC721Token/MintableERC721Token.sol\";\nimport \"../../utils/Ownable/Ownable.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract DummyERC721Token is\n Ownable,\n MintableERC721Token\n{\n string public name;\n string public symbol;\n\n constructor (\n string _name,\n string _symbol\n )\n public\n {\n name = _name;\n symbol = _symbol;\n }\n\n /// @dev Function to mint a new token\n /// Reverts if the given token ID already exists\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _tokenId ID of the token to be minted by the msg.sender \n function mint(address _to, uint256 _tokenId)\n external\n {\n _mint(_to, _tokenId);\n }\n\n /// @dev Function to burn a token\n /// Reverts if the given token ID doesn't exist or not called by contract owner\n /// @param _owner Owner of token with given token ID\n /// @param _tokenId ID of the token to be burned by the msg.sender\n function burn(address _owner, uint256 _tokenId)\n external\n onlyOwner\n {\n _burn(_owner, _tokenId);\n }\n}\n",
- "2.0.0/tokens/ERC20Token/ERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IERC20Token.sol\";\n\n\ncontract ERC20Token is\n IERC20Token\n{\n mapping (address => uint256) internal balances;\n mapping (address => mapping (address => uint256)) internal allowed;\n\n uint256 internal _totalSupply;\n\n /// @dev send `value` token to `to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transfer(address _to, uint256 _value)\n external\n returns (bool)\n {\n require(\n balances[msg.sender] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[msg.sender] -= _value;\n balances[_to] += _value;\n\n emit Transfer(\n msg.sender,\n _to,\n _value\n );\n\n return true;\n }\n\n /// @dev send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool)\n {\n require(\n balances[_from] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n allowed[_from][msg.sender] >= _value,\n \"ERC20_INSUFFICIENT_ALLOWANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[_to] += _value;\n balances[_from] -= _value;\n allowed[_from][msg.sender] -= _value;\n \n emit Transfer(\n _from,\n _to,\n _value\n );\n \n return true;\n }\n\n /// @dev `msg.sender` approves `_spender` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Always true if the call has enough gas to complete execution\n function approve(address _spender, uint256 _value)\n external\n returns (bool)\n {\n allowed[msg.sender][_spender] = _value;\n emit Approval(\n msg.sender,\n _spender,\n _value\n );\n return true;\n }\n\n /// @dev Query total supply of token\n /// @return Total supply of token\n function totalSupply()\n external\n view\n returns (uint256)\n {\n return _totalSupply;\n }\n\n /// @dev Query the balance of owner\n /// @param _owner The address from which the balance will be retrieved\n /// @return Balance of owner\n function balanceOf(address _owner)\n external\n view\n returns (uint256)\n {\n return balances[_owner];\n }\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender)\n external\n view\n returns (uint256)\n {\n return allowed[_owner][_spender];\n }\n}\n",
- "2.0.0/tokens/ERC20Token/IERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC20Token {\n\n // solhint-disable no-simple-event-func-name\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 _value\n );\n\n event Approval(\n address indexed _owner,\n address indexed _spender,\n uint256 _value\n );\n\n /// @dev send `value` token to `to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transfer(address _to, uint256 _value)\n external\n returns (bool);\n\n /// @dev send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool);\n \n /// @dev `msg.sender` approves `_spender` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Always true if the call has enough gas to complete execution\n function approve(address _spender, uint256 _value)\n external\n returns (bool);\n\n /// @dev Query total supply of token\n /// @return Total supply of token\n function totalSupply()\n external\n view\n returns (uint256);\n \n /// @param _owner The address from which the balance will be retrieved\n /// @return Balance of owner\n function balanceOf(address _owner)\n external\n view\n returns (uint256);\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender)\n external\n view\n returns (uint256);\n}\n",
- "2.0.0/tokens/ERC20Token/MintableERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/SafeMath/SafeMath.sol\";\nimport \"./UnlimitedAllowanceERC20Token.sol\";\n\n\ncontract MintableERC20Token is \n SafeMath,\n UnlimitedAllowanceERC20Token\n{\n /// @dev Mints new tokens\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _value Amount of tokens to mint\n function _mint(address _to, uint256 _value)\n internal\n {\n balances[_to] = safeAdd(_value, balances[_to]);\n _totalSupply = safeAdd(_totalSupply, _value);\n\n emit Transfer(\n address(0),\n _to,\n _value\n );\n }\n\n /// @dev Mints new tokens\n /// @param _owner Owner of tokens that will be burned\n /// @param _value Amount of tokens to burn\n function _burn(address _owner, uint256 _value)\n internal\n {\n balances[_owner] = safeSub(balances[_owner], _value);\n _totalSupply = safeSub(_totalSupply, _value);\n\n emit Transfer(\n _owner,\n address(0),\n _value\n );\n }\n}\n",
- "2.0.0/tokens/ERC20Token/UnlimitedAllowanceERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../ERC20Token/ERC20Token.sol\";\n\n\ncontract UnlimitedAllowanceERC20Token is\n ERC20Token\n{\n uint256 constant internal MAX_UINT = 2**256 - 1;\n\n /// @dev ERC20 transferFrom, modified such that an allowance of MAX_UINT represents an unlimited allowance. See https://github.com/ethereum/EIPs/issues/717\n /// @param _from Address to transfer from.\n /// @param _to Address to transfer to.\n /// @param _value Amount to transfer.\n /// @return Success of transfer.\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool)\n {\n uint256 allowance = allowed[_from][msg.sender];\n require(\n balances[_from] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n allowance >= _value,\n \"ERC20_INSUFFICIENT_ALLOWANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[_to] += _value;\n balances[_from] -= _value;\n if (allowance < MAX_UINT) {\n allowed[_from][msg.sender] -= _value;\n }\n\n emit Transfer(\n _from,\n _to,\n _value\n );\n\n return true;\n }\n}\n",
- "2.0.0/tokens/ERC721Token/ERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IERC721Token.sol\";\nimport \"./IERC721Receiver.sol\";\nimport \"../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract ERC721Token is\n IERC721Token,\n SafeMath\n{\n // Function selector for ERC721Receiver.onERC721Received\n // 0x150b7a02\n bytes4 constant internal ERC721_RECEIVED = bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"));\n\n // Mapping of tokenId => owner\n mapping (uint256 => address) internal owners;\n\n // Mapping of tokenId => approved address\n mapping (uint256 => address) internal approvals;\n\n // Mapping of owner => number of tokens owned\n mapping (address => uint256) internal balances;\n\n // Mapping of owner => operator => approved\n mapping (address => mapping (address => bool)) internal operatorApprovals;\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT. When transfer is complete, this function\n /// checks if `_to` is a smart contract (code size > 0). If so, it calls\n /// `onERC721Received` on `_to` and throws if the return value is not\n /// `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n /// @param _data Additional data with no specified format, sent in call to `_to`\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId,\n bytes _data\n )\n external\n {\n transferFrom(\n _from,\n _to,\n _tokenId\n );\n\n uint256 receiverCodeSize;\n assembly {\n receiverCodeSize := extcodesize(_to)\n }\n if (receiverCodeSize > 0) {\n bytes4 selector = IERC721Receiver(_to).onERC721Received(\n msg.sender,\n _from,\n _tokenId,\n _data\n );\n require(\n selector == ERC721_RECEIVED,\n \"ERC721_INVALID_SELECTOR\"\n );\n }\n }\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev This works identically to the other function with an extra data parameter,\n /// except this function just sets data to \"\".\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n external\n {\n transferFrom(\n _from,\n _to,\n _tokenId\n );\n\n uint256 receiverCodeSize;\n assembly {\n receiverCodeSize := extcodesize(_to)\n }\n if (receiverCodeSize > 0) {\n bytes4 selector = IERC721Receiver(_to).onERC721Received(\n msg.sender,\n _from,\n _tokenId,\n \"\"\n );\n require(\n selector == ERC721_RECEIVED,\n \"ERC721_INVALID_SELECTOR\"\n );\n }\n }\n\n /// @notice Change or reaffirm the approved address for an NFT\n /// @dev The zero address indicates there is no approved address.\n /// Throws unless `msg.sender` is the current NFT owner, or an authorized\n /// operator of the current owner.\n /// @param _approved The new approved NFT controller\n /// @param _tokenId The NFT to approve\n function approve(address _approved, uint256 _tokenId)\n external\n {\n address owner = ownerOf(_tokenId);\n require(\n msg.sender == owner || isApprovedForAll(owner, msg.sender),\n \"ERC721_INVALID_SENDER\"\n );\n\n approvals[_tokenId] = _approved;\n emit Approval(\n owner,\n _approved,\n _tokenId\n );\n }\n\n /// @notice Enable or disable approval for a third party (\"operator\") to manage\n /// all of `msg.sender`'s assets\n /// @dev Emits the ApprovalForAll event. The contract MUST allow\n /// multiple operators per owner.\n /// @param _operator Address to add to the set of authorized operators\n /// @param _approved True if the operator is approved, false to revoke approval\n function setApprovalForAll(address _operator, bool _approved)\n external\n {\n operatorApprovals[msg.sender][_operator] = _approved;\n emit ApprovalForAll(\n msg.sender,\n _operator,\n _approved\n );\n }\n \n /// @notice Count all NFTs assigned to an owner\n /// @dev NFTs assigned to the zero address are considered invalid, and this\n /// function throws for queries about the zero address.\n /// @param _owner An address for whom to query the balance\n /// @return The number of NFTs owned by `_owner`, possibly zero\n function balanceOf(address _owner)\n external\n view\n returns (uint256)\n {\n require(\n _owner != address(0),\n \"ERC721_ZERO_OWNER\"\n );\n return balances[_owner];\n }\n\n /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE\n /// TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE\n /// THEY MAY BE PERMANENTLY LOST\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function transferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n public\n {\n require(\n _to != address(0),\n \"ERC721_ZERO_TO_ADDRESS\"\n );\n\n address owner = ownerOf(_tokenId);\n require(\n _from == owner,\n \"ERC721_OWNER_MISMATCH\"\n );\n\n address spender = msg.sender;\n address approvedAddress = getApproved(_tokenId);\n require(\n spender == owner ||\n isApprovedForAll(owner, spender) ||\n approvedAddress == spender,\n \"ERC721_INVALID_SPENDER\"\n );\n\n if (approvedAddress != address(0)) {\n approvals[_tokenId] = address(0);\n }\n\n owners[_tokenId] = _to;\n balances[_from] = safeSub(balances[_from], 1);\n balances[_to] = safeAdd(balances[_to], 1);\n \n emit Transfer(\n _from,\n _to,\n _tokenId\n );\n }\n\n /// @notice Find the owner of an NFT\n /// @dev NFTs assigned to zero address are considered invalid, and queries\n /// about them do throw.\n /// @param _tokenId The identifier for an NFT\n /// @return The address of the owner of the NFT\n function ownerOf(uint256 _tokenId)\n public\n view\n returns (address)\n {\n address owner = owners[_tokenId];\n require(\n owner != address(0),\n \"ERC721_ZERO_OWNER\"\n );\n return owner;\n }\n\n /// @notice Get the approved address for a single NFT\n /// @dev Throws if `_tokenId` is not a valid NFT.\n /// @param _tokenId The NFT to find the approved address for\n /// @return The approved address for this NFT, or the zero address if there is none\n function getApproved(uint256 _tokenId)\n public\n view\n returns (address)\n {\n return approvals[_tokenId];\n }\n\n /// @notice Query if an address is an authorized operator for another address\n /// @param _owner The address that owns the NFTs\n /// @param _operator The address that acts on behalf of the owner\n /// @return True if `_operator` is an approved operator for `_owner`, false otherwise\n function isApprovedForAll(address _owner, address _operator)\n public\n view\n returns (bool)\n {\n return operatorApprovals[_owner][_operator];\n }\n}\n",
- "2.0.0/tokens/ERC721Token/IERC721Receiver.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC721Receiver {\n\n /// @notice Handle the receipt of an NFT\n /// @dev The ERC721 smart contract calls this function on the recipient\n /// after a `transfer`. This function MAY throw to revert and reject the\n /// transfer. Return of other than the magic value MUST result in the\n /// transaction being reverted.\n /// Note: the contract address is always the message sender.\n /// @param _operator The address which called `safeTransferFrom` function\n /// @param _from The address which previously owned the token\n /// @param _tokenId The NFT identifier which is being transferred\n /// @param _data Additional data with no specified format\n /// @return `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`\n /// unless throwing\n function onERC721Received(\n address _operator,\n address _from,\n uint256 _tokenId,\n bytes _data\n )\n external\n returns (bytes4);\n}\n",
- "2.0.0/tokens/ERC721Token/IERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC721Token {\n\n /// @dev This emits when ownership of any NFT changes by any mechanism.\n /// This event emits when NFTs are created (`from` == 0) and destroyed\n /// (`to` == 0). Exception: during contract creation, any number of NFTs\n /// may be created and assigned without emitting Transfer. At the time of\n /// any transfer, the approved address for that NFT (if any) is reset to none.\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 indexed _tokenId\n );\n\n /// @dev This emits when the approved address for an NFT is changed or\n /// reaffirmed. The zero address indicates there is no approved address.\n /// When a Transfer event emits, this also indicates that the approved\n /// address for that NFT (if any) is reset to none.\n event Approval(\n address indexed _owner,\n address indexed _approved,\n uint256 indexed _tokenId\n );\n\n /// @dev This emits when an operator is enabled or disabled for an owner.\n /// The operator can manage all NFTs of the owner.\n event ApprovalForAll(\n address indexed _owner,\n address indexed _operator,\n bool _approved\n );\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// perator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT. When transfer is complete, this function\n /// checks if `_to` is a smart contract (code size > 0). If so, it calls\n /// `onERC721Received` on `_to` and throws if the return value is not\n /// `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n /// @param _data Additional data with no specified format, sent in call to `_to`\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId,\n bytes _data\n )\n external;\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev This works identically to the other function with an extra data parameter,\n /// except this function just sets data to \"\".\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n external;\n\n /// @notice Change or reaffirm the approved address for an NFT\n /// @dev The zero address indicates there is no approved address.\n /// Throws unless `msg.sender` is the current NFT owner, or an authorized\n /// operator of the current owner.\n /// @param _approved The new approved NFT controller\n /// @param _tokenId The NFT to approve\n function approve(address _approved, uint256 _tokenId)\n external;\n\n /// @notice Enable or disable approval for a third party (\"operator\") to manage\n /// all of `msg.sender`'s assets\n /// @dev Emits the ApprovalForAll event. The contract MUST allow\n /// multiple operators per owner.\n /// @param _operator Address to add to the set of authorized operators\n /// @param _approved True if the operator is approved, false to revoke approval\n function setApprovalForAll(address _operator, bool _approved)\n external;\n\n /// @notice Count all NFTs assigned to an owner\n /// @dev NFTs assigned to the zero address are considered invalid, and this\n /// function throws for queries about the zero address.\n /// @param _owner An address for whom to query the balance\n /// @return The number of NFTs owned by `_owner`, possibly zero\n function balanceOf(address _owner)\n external\n view\n returns (uint256);\n\n /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE\n /// TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE\n /// THEY MAY BE PERMANENTLY LOST\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function transferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n public;\n\n /// @notice Find the owner of an NFT\n /// @dev NFTs assigned to zero address are considered invalid, and queries\n /// about them do throw.\n /// @param _tokenId The identifier for an NFT\n /// @return The address of the owner of the NFT\n function ownerOf(uint256 _tokenId)\n public\n view\n returns (address);\n\n /// @notice Get the approved address for a single NFT\n /// @dev Throws if `_tokenId` is not a valid NFT.\n /// @param _tokenId The NFT to find the approved address for\n /// @return The approved address for this NFT, or the zero address if there is none\n function getApproved(uint256 _tokenId) \n public\n view\n returns (address);\n \n /// @notice Query if an address is an authorized operator for another address\n /// @param _owner The address that owns the NFTs\n /// @param _operator The address that acts on behalf of the owner\n /// @return True if `_operator` is an approved operator for `_owner`, false otherwise\n function isApprovedForAll(address _owner, address _operator)\n public\n view\n returns (bool);\n}\n",
- "2.0.0/tokens/ERC721Token/MintableERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./ERC721Token.sol\";\n\n\ncontract MintableERC721Token is\n ERC721Token\n{\n /// @dev Function to mint a new token\n /// Reverts if the given token ID already exists\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _tokenId ID of the token to be minted by the msg.sender \n function _mint(address _to, uint256 _tokenId)\n internal\n {\n require(\n _to != address(0),\n \"ERC721_ZERO_TO_ADDRESS\"\n );\n\n address owner = owners[_tokenId];\n require(\n owner == address(0),\n \"ERC721_OWNER_ALREADY_EXISTS\"\n );\n\n owners[_tokenId] = _to;\n balances[_to] = safeAdd(balances[_to], 1);\n\n emit Transfer(\n address(0),\n _to,\n _tokenId\n );\n }\n\n /// @dev Function to burn a token\n /// Reverts if the given token ID doesn't exist\n /// @param _owner Owner of token with given token ID\n /// @param _tokenId ID of the token to be burned by the msg.sender\n function _burn(address _owner, uint256 _tokenId)\n internal\n {\n require(\n _owner != address(0),\n \"ERC721_ZERO_OWNER_ADDRESS\"\n );\n\n address owner = owners[_tokenId];\n require(\n owner == _owner,\n \"ERC721_OWNER_MISMATCH\"\n );\n\n owners[_tokenId] = address(0);\n balances[_owner] = safeSub(balances[_owner], 1);\n\n emit Transfer(\n _owner,\n address(0),\n _tokenId\n );\n }\n}\n",
- "2.0.0/tokens/EtherToken/IEtherToken.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../ERC20Token/IERC20Token.sol\";\n\n\ncontract IEtherToken is\n IERC20Token\n{\n function deposit()\n public\n payable;\n \n function withdraw(uint256 amount)\n public;\n}\n",
- "2.0.0/utils/LibBytes/LibBytes.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\nlibrary LibBytes {\n\n using LibBytes for bytes;\n\n /// @dev Gets the memory address for a byte array.\n /// @param input Byte array to lookup.\n /// @return memoryAddress Memory address of byte array. This\n /// points to the header of the byte array which contains\n /// the length.\n function rawAddress(bytes memory input)\n internal\n pure\n returns (uint256 memoryAddress)\n {\n assembly {\n memoryAddress := input\n }\n return memoryAddress;\n }\n \n /// @dev Gets the memory address for the contents of a byte array.\n /// @param input Byte array to lookup.\n /// @return memoryAddress Memory address of the contents of the byte array.\n function contentAddress(bytes memory input)\n internal\n pure\n returns (uint256 memoryAddress)\n {\n assembly {\n memoryAddress := add(input, 32)\n }\n return memoryAddress;\n }\n\n /// @dev Copies `length` bytes from memory location `source` to `dest`.\n /// @param dest memory address to copy bytes to.\n /// @param source memory address to copy bytes from.\n /// @param length number of bytes to copy.\n function memCopy(\n uint256 dest,\n uint256 source,\n uint256 length\n )\n internal\n pure\n {\n if (length < 32) {\n // Handle a partial word by reading destination and masking\n // off the bits we are interested in.\n // This correctly handles overlap, zero lengths and source == dest\n assembly {\n let mask := sub(exp(256, sub(32, length)), 1)\n let s := and(mload(source), not(mask))\n let d := and(mload(dest), mask)\n mstore(dest, or(s, d))\n }\n } else {\n // Skip the O(length) loop when source == dest.\n if (source == dest) {\n return;\n }\n\n // For large copies we copy whole words at a time. The final\n // word is aligned to the end of the range (instead of after the\n // previous) to handle partial words. So a copy will look like this:\n //\n // ####\n // ####\n // ####\n // ####\n //\n // We handle overlap in the source and destination range by\n // changing the copying direction. This prevents us from\n // overwriting parts of source that we still need to copy.\n //\n // This correctly handles source == dest\n //\n if (source > dest) {\n assembly {\n // We subtract 32 from `sEnd` and `dEnd` because it\n // is easier to compare with in the loop, and these\n // are also the addresses we need for copying the\n // last bytes.\n length := sub(length, 32)\n let sEnd := add(source, length)\n let dEnd := add(dest, length)\n\n // Remember the last 32 bytes of source\n // This needs to be done here and not after the loop\n // because we may have overwritten the last bytes in\n // source already due to overlap.\n let last := mload(sEnd)\n\n // Copy whole words front to back\n // Note: the first check is always true,\n // this could have been a do-while loop.\n // solhint-disable-next-line no-empty-blocks\n for {} lt(source, sEnd) {} {\n mstore(dest, mload(source))\n source := add(source, 32)\n dest := add(dest, 32)\n }\n \n // Write the last 32 bytes\n mstore(dEnd, last)\n }\n } else {\n assembly {\n // We subtract 32 from `sEnd` and `dEnd` because those\n // are the starting points when copying a word at the end.\n length := sub(length, 32)\n let sEnd := add(source, length)\n let dEnd := add(dest, length)\n\n // Remember the first 32 bytes of source\n // This needs to be done here and not after the loop\n // because we may have overwritten the first bytes in\n // source already due to overlap.\n let first := mload(source)\n\n // Copy whole words back to front\n // We use a signed comparisson here to allow dEnd to become\n // negative (happens when source and dest < 32). Valid\n // addresses in local memory will never be larger than\n // 2**255, so they can be safely re-interpreted as signed.\n // Note: the first check is always true,\n // this could have been a do-while loop.\n // solhint-disable-next-line no-empty-blocks\n for {} slt(dest, dEnd) {} {\n mstore(dEnd, mload(sEnd))\n sEnd := sub(sEnd, 32)\n dEnd := sub(dEnd, 32)\n }\n \n // Write the first 32 bytes\n mstore(dest, first)\n }\n }\n }\n }\n\n /// @dev Returns a slices from a byte array.\n /// @param b The byte array to take a slice from.\n /// @param from The starting index for the slice (inclusive).\n /// @param to The final index for the slice (exclusive).\n /// @return result The slice containing bytes at indices [from, to)\n function slice(\n bytes memory b,\n uint256 from,\n uint256 to\n )\n internal\n pure\n returns (bytes memory result)\n {\n require(\n from <= to,\n \"FROM_LESS_THAN_TO_REQUIRED\"\n );\n require(\n to < b.length,\n \"TO_LESS_THAN_LENGTH_REQUIRED\"\n );\n \n // Create a new bytes structure and copy contents\n result = new bytes(to - from);\n memCopy(\n result.contentAddress(),\n b.contentAddress() + from,\n result.length\n );\n return result;\n }\n \n /// @dev Returns a slice from a byte array without preserving the input.\n /// @param b The byte array to take a slice from. Will be destroyed in the process.\n /// @param from The starting index for the slice (inclusive).\n /// @param to The final index for the slice (exclusive).\n /// @return result The slice containing bytes at indices [from, to)\n /// @dev When `from == 0`, the original array will match the slice. In other cases its state will be corrupted.\n function sliceDestructive(\n bytes memory b,\n uint256 from,\n uint256 to\n )\n internal\n pure\n returns (bytes memory result)\n {\n require(\n from <= to,\n \"FROM_LESS_THAN_TO_REQUIRED\"\n );\n require(\n to < b.length,\n \"TO_LESS_THAN_LENGTH_REQUIRED\"\n );\n \n // Create a new bytes structure around [from, to) in-place.\n assembly {\n result := add(b, from)\n mstore(result, sub(to, from))\n }\n return result;\n }\n\n /// @dev Pops the last byte off of a byte array by modifying its length.\n /// @param b Byte array that will be modified.\n /// @return The byte that was popped off.\n function popLastByte(bytes memory b)\n internal\n pure\n returns (bytes1 result)\n {\n require(\n b.length > 0,\n \"GREATER_THAN_ZERO_LENGTH_REQUIRED\"\n );\n\n // Store last byte.\n result = b[b.length - 1];\n\n assembly {\n // Decrement length of byte array.\n let newLen := sub(mload(b), 1)\n mstore(b, newLen)\n }\n return result;\n }\n\n /// @dev Pops the last 20 bytes off of a byte array by modifying its length.\n /// @param b Byte array that will be modified.\n /// @return The 20 byte address that was popped off.\n function popLast20Bytes(bytes memory b)\n internal\n pure\n returns (address result)\n {\n require(\n b.length >= 20,\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Store last 20 bytes.\n result = readAddress(b, b.length - 20);\n\n assembly {\n // Subtract 20 from byte array length.\n let newLen := sub(mload(b), 20)\n mstore(b, newLen)\n }\n return result;\n }\n\n /// @dev Tests equality of two byte arrays.\n /// @param lhs First byte array to compare.\n /// @param rhs Second byte array to compare.\n /// @return True if arrays are the same. False otherwise.\n function equals(\n bytes memory lhs,\n bytes memory rhs\n )\n internal\n pure\n returns (bool equal)\n {\n // Keccak gas cost is 30 + numWords * 6. This is a cheap way to compare.\n // We early exit on unequal lengths, but keccak would also correctly\n // handle this.\n return lhs.length == rhs.length && keccak256(lhs) == keccak256(rhs);\n }\n\n /// @dev Reads an address from a position in a byte array.\n /// @param b Byte array containing an address.\n /// @param index Index in byte array of address.\n /// @return address from byte array.\n function readAddress(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (address result)\n {\n require(\n b.length >= index + 20, // 20 is length of address\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Add offset to index:\n // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)\n // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)\n index += 20;\n\n // Read address from array memory\n assembly {\n // 1. Add index to address of bytes array\n // 2. Load 32-byte word from memory\n // 3. Apply 20-byte mask to obtain address\n result := and(mload(add(b, index)), 0xffffffffffffffffffffffffffffffffffffffff)\n }\n return result;\n }\n\n /// @dev Writes an address into a specific position in a byte array.\n /// @param b Byte array to insert address into.\n /// @param index Index in byte array of address.\n /// @param input Address to put into byte array.\n function writeAddress(\n bytes memory b,\n uint256 index,\n address input\n )\n internal\n pure\n {\n require(\n b.length >= index + 20, // 20 is length of address\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Add offset to index:\n // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)\n // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)\n index += 20;\n\n // Store address into array memory\n assembly {\n // The address occupies 20 bytes and mstore stores 32 bytes.\n // First fetch the 32-byte word where we'll be storing the address, then\n // apply a mask so we have only the bytes in the word that the address will not occupy.\n // Then combine these bytes with the address and store the 32 bytes back to memory with mstore.\n\n // 1. Add index to address of bytes array\n // 2. Load 32-byte word from memory\n // 3. Apply 12-byte mask to obtain extra bytes occupying word of memory where we'll store the address\n let neighbors := and(\n mload(add(b, index)),\n 0xffffffffffffffffffffffff0000000000000000000000000000000000000000\n )\n \n // Make sure input address is clean.\n // (Solidity does not guarantee this)\n input := and(input, 0xffffffffffffffffffffffffffffffffffffffff)\n\n // Store the neighbors and address into memory\n mstore(add(b, index), xor(input, neighbors))\n }\n }\n\n /// @dev Reads a bytes32 value from a position in a byte array.\n /// @param b Byte array containing a bytes32 value.\n /// @param index Index in byte array of bytes32 value.\n /// @return bytes32 value from byte array.\n function readBytes32(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes32 result)\n {\n require(\n b.length >= index + 32,\n \"GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 256 bit length parameter\n index += 32;\n\n // Read the bytes32 from array memory\n assembly {\n result := mload(add(b, index))\n }\n return result;\n }\n\n /// @dev Writes a bytes32 into a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input bytes32 to put into byte array.\n function writeBytes32(\n bytes memory b,\n uint256 index,\n bytes32 input\n )\n internal\n pure\n {\n require(\n b.length >= index + 32,\n \"GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 256 bit length parameter\n index += 32;\n\n // Read the bytes32 from array memory\n assembly {\n mstore(add(b, index), input)\n }\n }\n\n /// @dev Reads a uint256 value from a position in a byte array.\n /// @param b Byte array containing a uint256 value.\n /// @param index Index in byte array of uint256 value.\n /// @return uint256 value from byte array.\n function readUint256(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (uint256 result)\n {\n result = uint256(readBytes32(b, index));\n return result;\n }\n\n /// @dev Writes a uint256 into a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input uint256 to put into byte array.\n function writeUint256(\n bytes memory b,\n uint256 index,\n uint256 input\n )\n internal\n pure\n {\n writeBytes32(b, index, bytes32(input));\n }\n\n /// @dev Reads an unpadded bytes4 value from a position in a byte array.\n /// @param b Byte array containing a bytes4 value.\n /// @param index Index in byte array of bytes4 value.\n /// @return bytes4 value from byte array.\n function readBytes4(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes4 result)\n {\n require(\n b.length >= index + 4,\n \"GREATER_OR_EQUAL_TO_4_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 32 byte length field\n index += 32;\n\n // Read the bytes4 from array memory\n assembly {\n result := mload(add(b, index))\n // Solidity does not require us to clean the trailing bytes.\n // We do it anyway\n result := and(result, 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000)\n }\n return result;\n }\n\n /// @dev Reads nested bytes from a specific position.\n /// @dev NOTE: the returned value overlaps with the input value.\n /// Both should be treated as immutable.\n /// @param b Byte array containing nested bytes.\n /// @param index Index of nested bytes.\n /// @return result Nested bytes.\n function readBytesWithLength(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes memory result)\n {\n // Read length of nested bytes\n uint256 nestedBytesLength = readUint256(b, index);\n index += 32;\n\n // Assert length of <b> is valid, given\n // length of nested bytes\n require(\n b.length >= index + nestedBytesLength,\n \"GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED\"\n );\n \n // Return a pointer to the byte array as it exists inside `b`\n assembly {\n result := add(b, index)\n }\n return result;\n }\n\n /// @dev Inserts bytes at a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input bytes to insert.\n function writeBytesWithLength(\n bytes memory b,\n uint256 index,\n bytes memory input\n )\n internal\n pure\n {\n // Assert length of <b> is valid, given\n // length of input\n require(\n b.length >= index + 32 + input.length, // 32 bytes to store length\n \"GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED\"\n );\n\n // Copy <input> into <b>\n memCopy(\n b.contentAddress() + index,\n input.rawAddress(), // includes length of <input>\n input.length + 32 // +32 bytes to store <input> length\n );\n }\n\n /// @dev Performs a deep copy of a byte array onto another byte array of greater than or equal length.\n /// @param dest Byte array that will be overwritten with source bytes.\n /// @param source Byte array to copy onto dest bytes.\n function deepCopyBytes(\n bytes memory dest,\n bytes memory source\n )\n internal\n pure\n {\n uint256 sourceLen = source.length;\n // Dest length must be >= source length, or some bytes would not be copied.\n require(\n dest.length >= sourceLen,\n \"GREATER_OR_EQUAL_TO_SOURCE_BYTES_LENGTH_REQUIRED\"\n );\n memCopy(\n dest.contentAddress(),\n source.contentAddress(),\n sourceLen\n );\n }\n}\n",
- "2.0.0/utils/Ownable/IOwnable.sol": "pragma solidity 0.4.24;\n\n\ncontract IOwnable {\n\n function transferOwnership(address newOwner)\n public;\n}\n",
- "2.0.0/utils/Ownable/Ownable.sol": "pragma solidity 0.4.24;\n\nimport \"./IOwnable.sol\";\n\n\ncontract Ownable is\n IOwnable\n{\n address public owner;\n\n constructor ()\n public\n {\n owner = msg.sender;\n }\n\n modifier onlyOwner() {\n require(\n msg.sender == owner,\n \"ONLY_CONTRACT_OWNER\"\n );\n _;\n }\n\n function transferOwnership(address newOwner)\n public\n onlyOwner\n {\n if (newOwner != address(0)) {\n owner = newOwner;\n }\n }\n}\n",
- "2.0.0/utils/ReentrancyGuard/ReentrancyGuard.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract ReentrancyGuard {\n\n // Locked state of mutex\n bool private locked = false;\n\n /// @dev Functions with this modifer cannot be reentered. The mutex will be locked\n /// before function execution and unlocked after.\n modifier nonReentrant() {\n // Ensure mutex is unlocked\n require(\n !locked,\n \"REENTRANCY_ILLEGAL\"\n );\n\n // Lock mutex before function call\n locked = true;\n\n // Perform function call\n _;\n\n // Unlock mutex after function call\n locked = false;\n }\n}\n",
- "2.0.0/utils/SafeMath/SafeMath.sol": "pragma solidity 0.4.24;\n\n\ncontract SafeMath {\n\n function safeMul(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n if (a == 0) {\n return 0;\n }\n uint256 c = a * b;\n require(\n c / a == b,\n \"UINT256_OVERFLOW\"\n );\n return c;\n }\n\n function safeDiv(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n uint256 c = a / b;\n return c;\n }\n\n function safeSub(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n require(\n b <= a,\n \"UINT256_UNDERFLOW\"\n );\n return a - b;\n }\n\n function safeAdd(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n uint256 c = a + b;\n require(\n c >= a,\n \"UINT256_OVERFLOW\"\n );\n return c;\n }\n\n function max64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n\n function max256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n}\n"
- },
- "sourceTreeHashHex": "0x6ff1018244f1bb1b06f24f9e10b69d8f303b9440899eef7a5dea9bb9c3817cb9",
- "compiler": {
- "name": "solc",
- "version": "soljson-v0.4.24+commit.e67f0147.js",
- "settings": {
- "optimizer": {
- "enabled": true,
- "runs": 1000000
- },
- "outputSelection": {
- "*": {
- "*": [
- "abi",
- "evm.bytecode.object",
- "evm.bytecode.sourceMap",
- "evm.deployedBytecode.object",
- "evm.deployedBytecode.sourceMap"
- ]
- }
- }
- }
- },
- "networks": {
- "3": {
- "address": "0x4530c0483a1633c7a1c97d2c53721caff2caaaaf",
- "links": {},
- "constructorArgs": "[\"0xf47261b0000000000000000000000000ff67881f8d12f372d91baae9752eb3631ff0ed00\"]"
- },
- "42": {
- "address": "0x35dd2932454449b14cee11a94d3674a936d5d7b2",
- "links": {},
- "constructorArgs": "[\"0xf47261b00000000000000000000000002002d3812f58e35f0ea1ffbf80a75a38c32175fa\"]"
- },
- "50": {
- "address": "0x48bacb9266a570d521063ef5dd96e61686dbe788",
- "links": {},
- "constructorArgs": "[\"0xf47261b0000000000000000000000000871dd7c2b4b25e1aa18728e9d5f2af4c4e431f5c\"]"
- }
- }
-}
diff --git a/packages/migrations/artifacts/2.0.0-testnet/Forwarder.json b/packages/migrations/artifacts/2.0.0-testnet/Forwarder.json
deleted file mode 100644
index 6d282022e..000000000
--- a/packages/migrations/artifacts/2.0.0-testnet/Forwarder.json
+++ /dev/null
@@ -1,761 +0,0 @@
-{
- "schemaVersion": "2.0.0",
- "contractName": "Forwarder",
- "compilerOutput": {
- "abi": [
- {
- "constant": false,
- "inputs": [
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "orders",
- "type": "tuple[]"
- },
- {
- "name": "makerAssetFillAmount",
- "type": "uint256"
- },
- {
- "name": "signatures",
- "type": "bytes[]"
- },
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "feeOrders",
- "type": "tuple[]"
- },
- {
- "name": "feeSignatures",
- "type": "bytes[]"
- },
- {
- "name": "feePercentage",
- "type": "uint256"
- },
- {
- "name": "feeRecipient",
- "type": "address"
- }
- ],
- "name": "marketBuyOrdersWithEth",
- "outputs": [
- {
- "components": [
- {
- "name": "makerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "makerFeePaid",
- "type": "uint256"
- },
- {
- "name": "takerFeePaid",
- "type": "uint256"
- }
- ],
- "name": "orderFillResults",
- "type": "tuple"
- },
- {
- "components": [
- {
- "name": "makerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "makerFeePaid",
- "type": "uint256"
- },
- {
- "name": "takerFeePaid",
- "type": "uint256"
- }
- ],
- "name": "feeOrderFillResults",
- "type": "tuple"
- }
- ],
- "payable": true,
- "stateMutability": "payable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "assetData",
- "type": "bytes"
- },
- {
- "name": "amount",
- "type": "uint256"
- }
- ],
- "name": "withdrawAsset",
- "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": [
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "orders",
- "type": "tuple[]"
- },
- {
- "name": "signatures",
- "type": "bytes[]"
- },
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "feeOrders",
- "type": "tuple[]"
- },
- {
- "name": "feeSignatures",
- "type": "bytes[]"
- },
- {
- "name": "feePercentage",
- "type": "uint256"
- },
- {
- "name": "feeRecipient",
- "type": "address"
- }
- ],
- "name": "marketSellOrdersWithEth",
- "outputs": [
- {
- "components": [
- {
- "name": "makerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "makerFeePaid",
- "type": "uint256"
- },
- {
- "name": "takerFeePaid",
- "type": "uint256"
- }
- ],
- "name": "orderFillResults",
- "type": "tuple"
- },
- {
- "components": [
- {
- "name": "makerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "makerFeePaid",
- "type": "uint256"
- },
- {
- "name": "takerFeePaid",
- "type": "uint256"
- }
- ],
- "name": "feeOrderFillResults",
- "type": "tuple"
- }
- ],
- "payable": true,
- "stateMutability": "payable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "newOwner",
- "type": "address"
- }
- ],
- "name": "transferOwnership",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "inputs": [
- {
- "name": "_exchange",
- "type": "address"
- },
- {
- "name": "_zrxAssetData",
- "type": "bytes"
- },
- {
- "name": "_wethAssetData",
- "type": "bytes"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "constructor"
- },
- {
- "payable": true,
- "stateMutability": "payable",
- "type": "fallback"
- }
- ],
- "evm": {
- "bytecode": {
- "linkReferences": {},
- "object": "0x60806040523480156200001157600080fd5b5060405162002cdb38038062002cdb83398101806040526200003791908101906200051d565b6000805433600160a060020a031991821617825560018054909116600160a060020a0386161790558251849084908490849081906200007e906004906020870190620003d0565b50825162000094906005906020860190620003d0565b50620000b0836010640100000000620018f66200036f82021704565b9150620000cd846010640100000000620018f66200036f82021704565b60028054600160a060020a03948516600160a060020a031991821617909155600380549285169290911691909117905550600154604080517f4552433230546f6b656e28616464726573732900000000000000000000000000815290519081900360130181207f6070410800000000000000000000000000000000000000000000000000000000825291909216945063607041089350620001739250906004016200068e565b602060405180830381600087803b1580156200018e57600080fd5b505af1158015620001a3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250620001c99190810190620004f4565b9050600160a060020a038116151562000219576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200021090620006b0565b60405180910390fd5b6002546040517f095ea7b3000000000000000000000000000000000000000000000000000000008152600160a060020a039091169063095ea7b39062000268908490600019906004016200066f565b602060405180830381600087803b1580156200028357600080fd5b505af115801562000298573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250620002be9190810190620005a1565b506003546040517f095ea7b3000000000000000000000000000000000000000000000000000000008152600160a060020a039091169063095ea7b3906200030e908490600019906004016200066f565b602060405180830381600087803b1580156200032957600080fd5b505af11580156200033e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250620003649190810190620005a1565b50505050506200077a565b600081601401835110151515620003b4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040162000210906200069e565b506014818301810151910190600160a060020a03165b92915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200041357805160ff191683800117855562000443565b8280016001018555821562000443579182015b828111156200044357825182559160200191906001019062000426565b506200045192915062000455565b5090565b6200047291905b808211156200045157600081556001016200045c565b90565b600062000483825162000711565b9392505050565b600062000483825162000742565b6000601f82018313620004aa57600080fd5b8151620004c1620004bb82620006e9565b620006c2565b91508082526020830160208301858383011115620004de57600080fd5b620004eb83828462000747565b50505092915050565b6000602082840312156200050757600080fd5b600062000515848462000475565b949350505050565b6000806000606084860312156200053357600080fd5b600062000541868662000475565b93505060208401516001604060020a038111156200055e57600080fd5b6200056c8682870162000498565b92505060408401516001604060020a038111156200058957600080fd5b620005978682870162000498565b9150509250925092565b600060208284031215620005b457600080fd5b60006200051584846200048a565b620005cd8162000711565b82525050565b620005cd816200071d565b602681527f475245415445525f4f525f455155414c5f544f5f32305f4c454e4754485f524560208201527f5155495245440000000000000000000000000000000000000000000000000000604082015260600190565b601881527f554e524547495354455245445f41535345545f50524f58590000000000000000602082015260400190565b620005cd8162000472565b604081016200067f8285620005c2565b62000483602083018462000664565b60208101620003ca8284620005d3565b60208082528101620003ca81620005de565b60208082528101620003ca8162000634565b6040518181016001604060020a0381118282101715620006e157600080fd5b604052919050565b60006001604060020a038211156200070057600080fd5b506020601f91909101601f19160190565b600160a060020a031690565b7fffffffff000000000000000000000000000000000000000000000000000000001690565b151590565b60005b83811015620007645781810151838201526020016200074a565b8381111562000774576000848401525b50505050565b612551806200078a6000396000f30060806040526004361061006c5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166318978e8281146100c8578063630f1e6c146100f25780638da5cb5b146101125780639395525c14610134578063f2fde38b14610147575b60025473ffffffffffffffffffffffffffffffffffffffff1633146100c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612337565b60405180910390fd5b005b6100db6100d6366004611da0565b610167565b6040516100e9929190612437565b60405180910390f35b3480156100fe57600080fd5b506100c661010d366004611e9b565b6102f7565b34801561011e57600080fd5b50610127610388565b6040516100e991906122e6565b6100db610142366004611cba565b6103a4565b34801561015357600080fd5b506100c6610162366004611c94565b61050a565b61016f6119a9565b6101776119a9565b6000806101826105bb565b60048054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610100600188161502019095169490940493840181900481028201810190925282815261025c939092909183018282801561022d5780601f106102025761010080835404028352916020019161022d565b820191906000526020600020905b81548152906001019060200180831161021057829003601f168201915b50505050508c600081518110151561024157fe5b6020908102909101015161014001519063ffffffff61069616565b156102875761026c8b8b8b6107c3565b935061028084600001518560600151610acb565b90506102ae565b6102928b8b8b610b0d565b9350836060015191506102a68883896107c3565b845190935090505b6102c2846020015184602001518888610d1f565b6102e98b60008151811015156102d457fe5b90602001906020020151610140015182610f33565b505097509795505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610348576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123e7565b61038383838080601f01602080910402602001604051908101604052809392919081815260200183838082843750879450610f339350505050565b505050565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b6103ac6119a9565b6103b46119a9565b60008060006103c16105bb565b60048054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101006001881615020190951694909404938401819004810282018101909252828152610441939092909183018282801561022d5780601f106102025761010080835404028352916020019161022d565b156104925761046a670de0b6b3a7640000610464670de0b6b3a76400008a61104f565b34611099565b92506104778b848c6110f1565b945061048b85600001518660600151610acb565b90506104d6565b6104ad670d2f13f7789f0000670de0b6b3a764000034611099565b92506104ba8b848c6110f1565b9450846060015191506104ce89838a6107c3565b855190945090505b6104ea856020015185602001518989610d1f565b6104fc8b60008151811015156102d457fe5b505050965096945050505050565b60005473ffffffffffffffffffffffffffffffffffffffff16331461055b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123e7565b73ffffffffffffffffffffffffffffffffffffffff8116156105b857600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83161790555b50565b600034116105f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612347565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0e30db0346040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004016000604051808303818588803b15801561067b57600080fd5b505af115801561068f573d6000803e3d6000fd5b5050505050565b6000815183511480156107ba5750816040518082805190602001908083835b602083106106f257805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016106b5565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0180199092169116179052604051919093018190038120885190955088945090928392508401908083835b6020831061078757805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161074a565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060001916145b90505b92915050565b6107cb6119a9565b60608060008060008060006107de6119a9565b8a15156107ea57610abc565b6004805460408051602060026001851615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f8101849004840282018401909252818152929183018282801561088e5780601f106108635761010080835404028352916020019161088e565b820191906000526020600020905b81548152906001019060200180831161087157829003601f168201915b505060058054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101006001881615020190951694909404938401819004810282018101909252828152969e509194509250840190508282801561093d5780601f106109125761010080835404028352916020019161093d565b820191906000526020600020905b81548152906001019060200180831161092057829003601f168201915b50505050509650600095508b519450600093505b838514610a8257878c8581518110151561096757fe5b6020908102909101015161014001528b5187908d908690811061098657fe5b60209081029091010151610160015261099f8b87610acb565b9250610a068c858151811015156109b257fe5b9060200190602002015160a00151610a008e878151811015156109d157fe5b90602001906020020151608001518f888151811015156109ed57fe5b9060200190602002015160e00151610acb565b85611099565b9150610a4b8c85815181101515610a1957fe5b90602001906020020151610a2e84600161104f565b8c87815181101515610a3c57fe5b90602001906020020151611295565b9050610a57898261130d565b610a6989600001518a60600151610acb565b95508a8610610a7757610a82565b600190930192610951565b8a861015610abc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123c7565b50505050505050509392505050565b600082821115610b07576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612367565b50900390565b610b156119a9565b606080600080600080610b266119a9565b60008b6000815181101515610b3757fe5b6020908102919091018101516101400151600580546040805160026001841615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190931692909204601f8101869004860283018601909152808252929b5092909190830182828015610bef5780601f10610bc457610100808354040283529160200191610bef565b820191906000526020600020905b815481529060010190602001808311610bd257829003601f168201915b505050505096508b519550600094505b848614610ce557878c86815181101515610c1557fe5b6020908102909101015161014001528b5187908d9087908110610c3457fe5b6020908102909101015161016001528851610c50908c90610acb565b9350610c938c86815181101515610c6357fe5b9060200190602002015160a001518d87815181101515610c7f57fe5b906020019060200201516080015186611099565b9250610cbf8c86815181101515610ca657fe5b90602001906020020151848c88815181101515610a3c57fe5b9150610ccb898361130d565b5087518a8110610cda57610ce5565b600190940193610bff565b8a811015610abc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123c7565b600080808066b1a2bc2ec50000861115610d65576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123f7565b610d6f888861104f565b935034841115610dab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612357565b610db53485610acb565b9250610dca86670de0b6b3a76400008a611099565b915082821115610e06576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123d7565b6000831115610f29576002546040517f2e1a7d4d00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911690632e1a7d4d90610e65908690600401612453565b600060405180830381600087803b158015610e7f57600080fd5b505af1158015610e93573d6000803e3d6000fd5b505050506000821115610ee55760405173ffffffffffffffffffffffffffffffffffffffff86169083156108fc029084906000818181858888f19350505050158015610ee3573d6000803e3d6000fd5b505b610eef8383610acb565b90506000811115610f2957604051339082156108fc029083906000818181858888f19350505050158015610f27573d6000803e3d6000fd5b505b5050505050505050565b6000610f45838263ffffffff61136f16565b604080517f4552433230546f6b656e28616464726573732900000000000000000000000000815290519081900360130190209091507fffffffff0000000000000000000000000000000000000000000000000000000080831691161415610fb557610fb083836113dc565b610383565b604080517f455243373231546f6b656e28616464726573732c75696e7432353629000000008152905190819003601c0190207fffffffff000000000000000000000000000000000000000000000000000000008281169116141561101d57610fb083836115ca565b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123a7565b60008282018381101561108e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612397565b8091505b5092915050565b60008083116110d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612387565b6110e76110e185846116b2565b8461170d565b90505b9392505050565b6110f96119a9565b60608060008060006111096119a9565b89600081518110151561111857fe5b6020908102919091018101516101400151600580546040805160026001841615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190931692909204601f8101869004860283018601909152808252929950929091908301828280156111d05780601f106111a5576101008083540402835291602001916111d0565b820191906000526020600020905b8154815290600101906020018083116111b357829003601f168201915b5050505050945089519350600092505b82841461128857858a848151811015156111f657fe5b602090810290910101516101400152895185908b908590811061121557fe5b906020019060200201516101600181905250611235898860200151610acb565b91506112618a8481518110151561124857fe5b90602001906020020151838a86815181101515610a3c57fe5b905061126d878261130d565b6020870151891161127d57611288565b6001909201916111e0565b5050505050509392505050565b61129d6119a9565b606060006112ac868686611724565b600154815191935073ffffffffffffffffffffffffffffffffffffffff1691506080908390602082016000855af1801561130357825184526020830151602085015260408301516040850152606083015160608501525b5050509392505050565b8151815161131b919061104f565b825260208083015190820151611331919061104f565b60208301526040808301519082015161134a919061104f565b604083015260608083015190820151611363919061104f565b60609092019190915250565b6000816004018351101515156113b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612417565b5001602001517fffffffff000000000000000000000000000000000000000000000000000000001690565b6000806113f084601063ffffffff6118f616565b604080517f7472616e7366657228616464726573732c75696e7432353629000000000000008152905190819003601901812091935073ffffffffffffffffffffffffffffffffffffffff8416919061144e903390879060240161231c565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009094169390931783525181519192909182919080838360005b838110156114f25781810151838201526020016114da565b50505050905090810190601f16801561151f5780820380516001836020036101000a031916815260200191505b509150506000604051808303816000865af19250505080151561156e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123b7565b3d1561158b575060003d6020141561158b5760206000803e506000515b8015156115c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123b7565b50505050565b60008060018314611607576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612427565b61161884601063ffffffff6118f616565b915061162b84602463ffffffff61195716565b6040517f23b872dd00000000000000000000000000000000000000000000000000000000815290915073ffffffffffffffffffffffffffffffffffffffff8316906323b872dd90611684903090339086906004016122f4565b600060405180830381600087803b15801561169e57600080fd5b505af1158015610f29573d6000803e3d6000fd5b6000808315156116c55760009150611092565b508282028284828115156116d557fe5b041461108e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612397565b600080828481151561171b57fe5b04949350505050565b604080517fb4be83d5000000000000000000000000000000000000000000000000000000006020808301919091526060602483018181528751608485019081528884015160a48601529488015160c48501529087015160e4840152608087015161010484015260a087015161012484015260c087015161014484015260e08701516101648401526101008701516101848401526101208701516101a4840152610140870180516101c485019081526101608901516101e4860152610180905251805161020485018190529394919384936044870192849261022489019291820191601f82010460005b8181101561182b57835185526020948501949093019260010161180d565b50505050818103610160808401919091528a0151805180835260209283019291820191601f82010460005b81811015611874578351855260209485019490930192600101611856565b50505089845250848103602093840190815288518083529093918201918981019190601f82010460005b818110156118bc57835185526020948501949093019260010161189e565b5050507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08883030188525060405250505050509392505050565b600081601401835110151515611938576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612407565b50016014015173ffffffffffffffffffffffffffffffffffffffff1690565b60006107ba83836000816020018351101515156119a0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612377565b50016020015190565b608060405190810160405280600081526020016000815260200160008152602001600081525090565b60006107ba82356124ef565b6000601f820183136119ef57600080fd5b8135611a026119fd82612488565b612461565b81815260209384019390925082018360005b83811015611a405781358601611a2a8882611af0565b8452506020928301929190910190600101611a14565b5050505092915050565b6000601f82018313611a5b57600080fd5b8135611a696119fd82612488565b81815260209384019390925082018360005b83811015611a405781358601611a918882611b3f565b8452506020928301929190910190600101611a7b565b600080601f83018413611ab957600080fd5b50813567ffffffffffffffff811115611ad157600080fd5b602083019150836001820283011115611ae957600080fd5b9250929050565b6000601f82018313611b0157600080fd5b8135611b0f6119fd826124a9565b91508082526020830160208301858383011115611b2b57600080fd5b611b3683828461250b565b50505092915050565b60006101808284031215611b5257600080fd5b611b5d610180612461565b90506000611b6b84846119d2565b8252506020611b7c848483016119d2565b6020830152506040611b90848285016119d2565b6040830152506060611ba4848285016119d2565b6060830152506080611bb884828501611c88565b60808301525060a0611bcc84828501611c88565b60a08301525060c0611be084828501611c88565b60c08301525060e0611bf484828501611c88565b60e083015250610100611c0984828501611c88565b61010083015250610120611c1f84828501611c88565b6101208301525061014082013567ffffffffffffffff811115611c4157600080fd5b611c4d84828501611af0565b6101408301525061016082013567ffffffffffffffff811115611c6f57600080fd5b611c7b84828501611af0565b6101608301525092915050565b60006107ba8235612508565b600060208284031215611ca657600080fd5b6000611cb284846119d2565b949350505050565b60008060008060008060c08789031215611cd357600080fd5b863567ffffffffffffffff811115611cea57600080fd5b611cf689828a01611a4a565b965050602087013567ffffffffffffffff811115611d1357600080fd5b611d1f89828a016119de565b955050604087013567ffffffffffffffff811115611d3c57600080fd5b611d4889828a01611a4a565b945050606087013567ffffffffffffffff811115611d6557600080fd5b611d7189828a016119de565b9350506080611d8289828a01611c88565b92505060a0611d9389828a016119d2565b9150509295509295509295565b600080600080600080600060e0888a031215611dbb57600080fd5b873567ffffffffffffffff811115611dd257600080fd5b611dde8a828b01611a4a565b9750506020611def8a828b01611c88565b965050604088013567ffffffffffffffff811115611e0c57600080fd5b611e188a828b016119de565b955050606088013567ffffffffffffffff811115611e3557600080fd5b611e418a828b01611a4a565b945050608088013567ffffffffffffffff811115611e5e57600080fd5b611e6a8a828b016119de565b93505060a0611e7b8a828b01611c88565b92505060c0611e8c8a828b016119d2565b91505092959891949750929550565b600080600060408486031215611eb057600080fd5b833567ffffffffffffffff811115611ec757600080fd5b611ed386828701611aa7565b93509350506020611ee686828701611c88565b9150509250925092565b611ef9816124ef565b82525050565b602381527f44454641554c545f46554e4354494f4e5f574554485f434f4e54524143545f4f60208201527f4e4c590000000000000000000000000000000000000000000000000000000000604082015260600190565b601181527f494e56414c49445f4d53475f56414c5545000000000000000000000000000000602082015260400190565b600d81527f4f564552534f4c445f5745544800000000000000000000000000000000000000602082015260400190565b601181527f55494e543235365f554e444552464c4f57000000000000000000000000000000602082015260400190565b602681527f475245415445525f4f525f455155414c5f544f5f33325f4c454e4754485f524560208201527f5155495245440000000000000000000000000000000000000000000000000000604082015260600190565b601081527f4449564953494f4e5f42595f5a45524f00000000000000000000000000000000602082015260400190565b601081527f55494e543235365f4f564552464c4f5700000000000000000000000000000000602082015260400190565b601781527f554e535550504f525445445f41535345545f50524f5859000000000000000000602082015260400190565b600f81527f5452414e534645525f4641494c45440000000000000000000000000000000000602082015260400190565b601481527f434f4d504c4554455f46494c4c5f4641494c4544000000000000000000000000602082015260400190565b601a81527f494e53554646494349454e545f4554485f52454d41494e494e47000000000000602082015260400190565b601381527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000602082015260400190565b601881527f4645455f50455243454e544147455f544f4f5f4c415247450000000000000000602082015260400190565b602681527f475245415445525f4f525f455155414c5f544f5f32305f4c454e4754485f524560208201527f5155495245440000000000000000000000000000000000000000000000000000604082015260600190565b602581527f475245415445525f4f525f455155414c5f544f5f345f4c454e4754485f52455160208201527f5549524544000000000000000000000000000000000000000000000000000000604082015260600190565b600e81527f494e56414c49445f414d4f554e54000000000000000000000000000000000000602082015260400190565b805160808301906122a884826122dd565b5060208201516122bb60208501826122dd565b5060408201516122ce60408501826122dd565b5060608201516115c460608501825b611ef981612508565b602081016107bd8284611ef0565b606081016123028286611ef0565b61230f6020830185611ef0565b611cb260408301846122dd565b6040810161232a8285611ef0565b6110ea60208301846122dd565b602080825281016107bd81611eff565b602080825281016107bd81611f55565b602080825281016107bd81611f85565b602080825281016107bd81611fb5565b602080825281016107bd81611fe5565b602080825281016107bd8161203b565b602080825281016107bd8161206b565b602080825281016107bd8161209b565b602080825281016107bd816120cb565b602080825281016107bd816120fb565b602080825281016107bd8161212b565b602080825281016107bd8161215b565b602080825281016107bd8161218b565b602080825281016107bd816121bb565b602080825281016107bd81612211565b602080825281016107bd81612267565b61010081016124468285612297565b6110ea6080830184612297565b602081016107bd82846122dd565b60405181810167ffffffffffffffff8111828210171561248057600080fd5b604052919050565b600067ffffffffffffffff82111561249f57600080fd5b5060209081020190565b600067ffffffffffffffff8211156124c057600080fd5b506020601f919091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0160190565b73ffffffffffffffffffffffffffffffffffffffff1690565b90565b828183375060009101525600a265627a7a72305820185af4a5e8525b0c20983bf22c09773a1cab3f704716cba4c8da3b112601cd666c6578706572696d656e74616cf50037",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH3 0x11 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x40 MLOAD PUSH3 0x2CDB CODESIZE SUB DUP1 PUSH3 0x2CDB DUP4 CODECOPY DUP2 ADD DUP1 PUSH1 0x40 MSTORE PUSH3 0x37 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH3 0x51D JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD CALLER PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB NOT SWAP2 DUP3 AND OR DUP3 SSTORE PUSH1 0x1 DUP1 SLOAD SWAP1 SWAP2 AND PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB DUP7 AND OR SWAP1 SSTORE DUP3 MLOAD DUP5 SWAP1 DUP5 SWAP1 DUP5 SWAP1 DUP5 SWAP1 DUP2 SWAP1 PUSH3 0x7E SWAP1 PUSH1 0x4 SWAP1 PUSH1 0x20 DUP8 ADD SWAP1 PUSH3 0x3D0 JUMP JUMPDEST POP DUP3 MLOAD PUSH3 0x94 SWAP1 PUSH1 0x5 SWAP1 PUSH1 0x20 DUP7 ADD SWAP1 PUSH3 0x3D0 JUMP JUMPDEST POP PUSH3 0xB0 DUP4 PUSH1 0x10 PUSH5 0x100000000 PUSH3 0x18F6 PUSH3 0x36F DUP3 MUL OR DIV JUMP JUMPDEST SWAP2 POP PUSH3 0xCD DUP5 PUSH1 0x10 PUSH5 0x100000000 PUSH3 0x18F6 PUSH3 0x36F DUP3 MUL OR DIV JUMP JUMPDEST PUSH1 0x2 DUP1 SLOAD PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB SWAP5 DUP6 AND PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB NOT SWAP2 DUP3 AND OR SWAP1 SWAP2 SSTORE PUSH1 0x3 DUP1 SLOAD SWAP3 DUP6 AND SWAP3 SWAP1 SWAP2 AND SWAP2 SWAP1 SWAP2 OR SWAP1 SSTORE POP PUSH1 0x1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH32 0x4552433230546F6B656E28616464726573732900000000000000000000000000 DUP2 MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x13 ADD DUP2 KECCAK256 PUSH32 0x6070410800000000000000000000000000000000000000000000000000000000 DUP3 MSTORE SWAP2 SWAP1 SWAP3 AND SWAP5 POP PUSH4 0x60704108 SWAP4 POP PUSH3 0x173 SWAP3 POP SWAP1 PUSH1 0x4 ADD PUSH3 0x68E JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH3 0x18E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH3 0x1A3 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP PUSH3 0x1C9 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH3 0x4F4 JUMP JUMPDEST SWAP1 POP PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB DUP2 AND ISZERO ISZERO PUSH3 0x219 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH3 0x210 SWAP1 PUSH3 0x6B0 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x2 SLOAD PUSH1 0x40 MLOAD PUSH32 0x95EA7B300000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB SWAP1 SWAP2 AND SWAP1 PUSH4 0x95EA7B3 SWAP1 PUSH3 0x268 SWAP1 DUP5 SWAP1 PUSH1 0x0 NOT SWAP1 PUSH1 0x4 ADD PUSH3 0x66F JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH3 0x283 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH3 0x298 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP PUSH3 0x2BE SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH3 0x5A1 JUMP JUMPDEST POP PUSH1 0x3 SLOAD PUSH1 0x40 MLOAD PUSH32 0x95EA7B300000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB SWAP1 SWAP2 AND SWAP1 PUSH4 0x95EA7B3 SWAP1 PUSH3 0x30E SWAP1 DUP5 SWAP1 PUSH1 0x0 NOT SWAP1 PUSH1 0x4 ADD PUSH3 0x66F JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH3 0x329 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH3 0x33E JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP PUSH3 0x364 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH3 0x5A1 JUMP JUMPDEST POP POP POP POP POP PUSH3 0x77A JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x14 ADD DUP4 MLOAD LT ISZERO ISZERO ISZERO PUSH3 0x3B4 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH3 0x210 SWAP1 PUSH3 0x69E JUMP JUMPDEST POP PUSH1 0x14 DUP2 DUP4 ADD DUP2 ADD MLOAD SWAP2 ADD SWAP1 PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB AND JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 PUSH1 0x1F ADD PUSH1 0x20 SWAP1 DIV DUP2 ADD SWAP3 DUP3 PUSH1 0x1F LT PUSH3 0x413 JUMPI DUP1 MLOAD PUSH1 0xFF NOT AND DUP4 DUP1 ADD OR DUP6 SSTORE PUSH3 0x443 JUMP JUMPDEST DUP3 DUP1 ADD PUSH1 0x1 ADD DUP6 SSTORE DUP3 ISZERO PUSH3 0x443 JUMPI SWAP2 DUP3 ADD JUMPDEST DUP3 DUP2 GT ISZERO PUSH3 0x443 JUMPI DUP3 MLOAD DUP3 SSTORE SWAP2 PUSH1 0x20 ADD SWAP2 SWAP1 PUSH1 0x1 ADD SWAP1 PUSH3 0x426 JUMP JUMPDEST POP PUSH3 0x451 SWAP3 SWAP2 POP PUSH3 0x455 JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST PUSH3 0x472 SWAP2 SWAP1 JUMPDEST DUP1 DUP3 GT ISZERO PUSH3 0x451 JUMPI PUSH1 0x0 DUP2 SSTORE PUSH1 0x1 ADD PUSH3 0x45C JUMP JUMPDEST SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH3 0x483 DUP3 MLOAD PUSH3 0x711 JUMP JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH3 0x483 DUP3 MLOAD PUSH3 0x742 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH3 0x4AA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 MLOAD PUSH3 0x4C1 PUSH3 0x4BB DUP3 PUSH3 0x6E9 JUMP JUMPDEST PUSH3 0x6C2 JUMP JUMPDEST SWAP2 POP DUP1 DUP3 MSTORE PUSH1 0x20 DUP4 ADD PUSH1 0x20 DUP4 ADD DUP6 DUP4 DUP4 ADD GT ISZERO PUSH3 0x4DE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH3 0x4EB DUP4 DUP3 DUP5 PUSH3 0x747 JUMP JUMPDEST POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH3 0x507 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH3 0x515 DUP5 DUP5 PUSH3 0x475 JUMP JUMPDEST SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x60 DUP5 DUP7 SUB SLT ISZERO PUSH3 0x533 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH3 0x541 DUP7 DUP7 PUSH3 0x475 JUMP JUMPDEST SWAP4 POP POP PUSH1 0x20 DUP5 ADD MLOAD PUSH1 0x1 PUSH1 0x40 PUSH1 0x2 EXP SUB DUP2 GT ISZERO PUSH3 0x55E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH3 0x56C DUP7 DUP3 DUP8 ADD PUSH3 0x498 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x40 DUP5 ADD MLOAD PUSH1 0x1 PUSH1 0x40 PUSH1 0x2 EXP SUB DUP2 GT ISZERO PUSH3 0x589 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH3 0x597 DUP7 DUP3 DUP8 ADD PUSH3 0x498 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 POP SWAP3 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH3 0x5B4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH3 0x515 DUP5 DUP5 PUSH3 0x48A JUMP JUMPDEST PUSH3 0x5CD DUP2 PUSH3 0x711 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH3 0x5CD DUP2 PUSH3 0x71D JUMP JUMPDEST PUSH1 0x26 DUP2 MSTORE PUSH32 0x475245415445525F4F525F455155414C5F544F5F32305F4C454E4754485F5245 PUSH1 0x20 DUP3 ADD MSTORE PUSH32 0x5155495245440000000000000000000000000000000000000000000000000000 PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x60 ADD SWAP1 JUMP JUMPDEST PUSH1 0x18 DUP2 MSTORE PUSH32 0x554E524547495354455245445F41535345545F50524F58590000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH3 0x5CD DUP2 PUSH3 0x472 JUMP JUMPDEST PUSH1 0x40 DUP2 ADD PUSH3 0x67F DUP3 DUP6 PUSH3 0x5C2 JUMP JUMPDEST PUSH3 0x483 PUSH1 0x20 DUP4 ADD DUP5 PUSH3 0x664 JUMP JUMPDEST PUSH1 0x20 DUP2 ADD PUSH3 0x3CA DUP3 DUP5 PUSH3 0x5D3 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH3 0x3CA DUP2 PUSH3 0x5DE JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH3 0x3CA DUP2 PUSH3 0x634 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP2 DUP2 ADD PUSH1 0x1 PUSH1 0x40 PUSH1 0x2 EXP SUB DUP2 GT DUP3 DUP3 LT OR ISZERO PUSH3 0x6E1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x40 MSTORE SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1 PUSH1 0x40 PUSH1 0x2 EXP SUB DUP3 GT ISZERO PUSH3 0x700 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x20 PUSH1 0x1F SWAP2 SWAP1 SWAP2 ADD PUSH1 0x1F NOT AND ADD SWAP1 JUMP JUMPDEST PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB AND SWAP1 JUMP JUMPDEST PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 AND SWAP1 JUMP JUMPDEST ISZERO ISZERO SWAP1 JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH3 0x764 JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH3 0x74A JUMP JUMPDEST DUP4 DUP2 GT ISZERO PUSH3 0x774 JUMPI PUSH1 0x0 DUP5 DUP5 ADD MSTORE JUMPDEST POP POP POP POP JUMP JUMPDEST PUSH2 0x2551 DUP1 PUSH3 0x78A PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN STOP PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x6C JUMPI PUSH4 0xFFFFFFFF PUSH29 0x100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD DIV AND PUSH4 0x18978E82 DUP2 EQ PUSH2 0xC8 JUMPI DUP1 PUSH4 0x630F1E6C EQ PUSH2 0xF2 JUMPI DUP1 PUSH4 0x8DA5CB5B EQ PUSH2 0x112 JUMPI DUP1 PUSH4 0x9395525C EQ PUSH2 0x134 JUMPI DUP1 PUSH4 0xF2FDE38B EQ PUSH2 0x147 JUMPI JUMPDEST PUSH1 0x2 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0xC6 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x2337 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST STOP JUMPDEST PUSH2 0xDB PUSH2 0xD6 CALLDATASIZE PUSH1 0x4 PUSH2 0x1DA0 JUMP JUMPDEST PUSH2 0x167 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xE9 SWAP3 SWAP2 SWAP1 PUSH2 0x2437 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xFE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xC6 PUSH2 0x10D CALLDATASIZE PUSH1 0x4 PUSH2 0x1E9B JUMP JUMPDEST PUSH2 0x2F7 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x11E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x127 PUSH2 0x388 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xE9 SWAP2 SWAP1 PUSH2 0x22E6 JUMP JUMPDEST PUSH2 0xDB PUSH2 0x142 CALLDATASIZE PUSH1 0x4 PUSH2 0x1CBA JUMP JUMPDEST PUSH2 0x3A4 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x153 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xC6 PUSH2 0x162 CALLDATASIZE PUSH1 0x4 PUSH2 0x1C94 JUMP JUMPDEST PUSH2 0x50A JUMP JUMPDEST PUSH2 0x16F PUSH2 0x19A9 JUMP JUMPDEST PUSH2 0x177 PUSH2 0x19A9 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x182 PUSH2 0x5BB JUMP JUMPDEST PUSH1 0x4 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 PUSH1 0x1F PUSH1 0x2 PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH2 0x100 PUSH1 0x1 DUP9 AND ISZERO MUL ADD SWAP1 SWAP6 AND SWAP5 SWAP1 SWAP5 DIV SWAP4 DUP5 ADD DUP2 SWAP1 DIV DUP2 MUL DUP3 ADD DUP2 ADD SWAP1 SWAP3 MSTORE DUP3 DUP2 MSTORE PUSH2 0x25C SWAP4 SWAP1 SWAP3 SWAP1 SWAP2 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0x22D JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x202 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x22D JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x210 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP DUP13 PUSH1 0x0 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x241 JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD MLOAD PUSH2 0x140 ADD MLOAD SWAP1 PUSH4 0xFFFFFFFF PUSH2 0x696 AND JUMP JUMPDEST ISZERO PUSH2 0x287 JUMPI PUSH2 0x26C DUP12 DUP12 DUP12 PUSH2 0x7C3 JUMP JUMPDEST SWAP4 POP PUSH2 0x280 DUP5 PUSH1 0x0 ADD MLOAD DUP6 PUSH1 0x60 ADD MLOAD PUSH2 0xACB JUMP JUMPDEST SWAP1 POP PUSH2 0x2AE JUMP JUMPDEST PUSH2 0x292 DUP12 DUP12 DUP12 PUSH2 0xB0D JUMP JUMPDEST SWAP4 POP DUP4 PUSH1 0x60 ADD MLOAD SWAP2 POP PUSH2 0x2A6 DUP9 DUP4 DUP10 PUSH2 0x7C3 JUMP JUMPDEST DUP5 MLOAD SWAP1 SWAP4 POP SWAP1 POP JUMPDEST PUSH2 0x2C2 DUP5 PUSH1 0x20 ADD MLOAD DUP5 PUSH1 0x20 ADD MLOAD DUP9 DUP9 PUSH2 0xD1F JUMP JUMPDEST PUSH2 0x2E9 DUP12 PUSH1 0x0 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x2D4 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x140 ADD MLOAD DUP3 PUSH2 0xF33 JUMP JUMPDEST POP POP SWAP8 POP SWAP8 SWAP6 POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0x348 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x23E7 JUMP JUMPDEST PUSH2 0x383 DUP4 DUP4 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY POP DUP8 SWAP5 POP PUSH2 0xF33 SWAP4 POP POP POP POP JUMP JUMPDEST POP POP POP JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH2 0x3AC PUSH2 0x19A9 JUMP JUMPDEST PUSH2 0x3B4 PUSH2 0x19A9 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH2 0x3C1 PUSH2 0x5BB JUMP JUMPDEST PUSH1 0x4 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 PUSH1 0x1F PUSH1 0x2 PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH2 0x100 PUSH1 0x1 DUP9 AND ISZERO MUL ADD SWAP1 SWAP6 AND SWAP5 SWAP1 SWAP5 DIV SWAP4 DUP5 ADD DUP2 SWAP1 DIV DUP2 MUL DUP3 ADD DUP2 ADD SWAP1 SWAP3 MSTORE DUP3 DUP2 MSTORE PUSH2 0x441 SWAP4 SWAP1 SWAP3 SWAP1 SWAP2 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0x22D JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x202 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x22D JUMP JUMPDEST ISZERO PUSH2 0x492 JUMPI PUSH2 0x46A PUSH8 0xDE0B6B3A7640000 PUSH2 0x464 PUSH8 0xDE0B6B3A7640000 DUP11 PUSH2 0x104F JUMP JUMPDEST CALLVALUE PUSH2 0x1099 JUMP JUMPDEST SWAP3 POP PUSH2 0x477 DUP12 DUP5 DUP13 PUSH2 0x10F1 JUMP JUMPDEST SWAP5 POP PUSH2 0x48B DUP6 PUSH1 0x0 ADD MLOAD DUP7 PUSH1 0x60 ADD MLOAD PUSH2 0xACB JUMP JUMPDEST SWAP1 POP PUSH2 0x4D6 JUMP JUMPDEST PUSH2 0x4AD PUSH8 0xD2F13F7789F0000 PUSH8 0xDE0B6B3A7640000 CALLVALUE PUSH2 0x1099 JUMP JUMPDEST SWAP3 POP PUSH2 0x4BA DUP12 DUP5 DUP13 PUSH2 0x10F1 JUMP JUMPDEST SWAP5 POP DUP5 PUSH1 0x60 ADD MLOAD SWAP2 POP PUSH2 0x4CE DUP10 DUP4 DUP11 PUSH2 0x7C3 JUMP JUMPDEST DUP6 MLOAD SWAP1 SWAP5 POP SWAP1 POP JUMPDEST PUSH2 0x4EA DUP6 PUSH1 0x20 ADD MLOAD DUP6 PUSH1 0x20 ADD MLOAD DUP10 DUP10 PUSH2 0xD1F JUMP JUMPDEST PUSH2 0x4FC DUP12 PUSH1 0x0 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x2D4 JUMPI INVALID JUMPDEST POP POP POP SWAP7 POP SWAP7 SWAP5 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0x55B JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x23E7 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND ISZERO PUSH2 0x5B8 JUMPI PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND OR SWAP1 SSTORE JUMPDEST POP JUMP JUMPDEST PUSH1 0x0 CALLVALUE GT PUSH2 0x5F5 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x2347 JUMP JUMPDEST PUSH1 0x2 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0xD0E30DB0 CALLVALUE PUSH1 0x40 MLOAD DUP3 PUSH4 0xFFFFFFFF AND PUSH29 0x100000000000000000000000000000000000000000000000000000000 MUL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP6 DUP9 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x67B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x68F JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD DUP4 MLOAD EQ DUP1 ISZERO PUSH2 0x7BA JUMPI POP DUP2 PUSH1 0x40 MLOAD DUP1 DUP3 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT PUSH2 0x6F2 JUMPI DUP1 MLOAD DUP3 MSTORE PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 SWAP1 SWAP3 ADD SWAP2 PUSH1 0x20 SWAP2 DUP3 ADD SWAP2 ADD PUSH2 0x6B5 JUMP JUMPDEST MLOAD DUP2 MLOAD PUSH1 0x20 SWAP4 DUP5 SUB PUSH2 0x100 EXP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD DUP1 NOT SWAP1 SWAP3 AND SWAP2 AND OR SWAP1 MSTORE PUSH1 0x40 MLOAD SWAP2 SWAP1 SWAP4 ADD DUP2 SWAP1 SUB DUP2 KECCAK256 DUP9 MLOAD SWAP1 SWAP6 POP DUP9 SWAP5 POP SWAP1 SWAP3 DUP4 SWAP3 POP DUP5 ADD SWAP1 DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT PUSH2 0x787 JUMPI DUP1 MLOAD DUP3 MSTORE PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 SWAP1 SWAP3 ADD SWAP2 PUSH1 0x20 SWAP2 DUP3 ADD SWAP2 ADD PUSH2 0x74A JUMP JUMPDEST PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB DUP1 NOT DUP3 MLOAD AND DUP2 DUP5 MLOAD AND DUP1 DUP3 OR DUP6 MSTORE POP POP POP POP POP POP SWAP1 POP ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 KECCAK256 PUSH1 0x0 NOT AND EQ JUMPDEST SWAP1 POP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x7CB PUSH2 0x19A9 JUMP JUMPDEST PUSH1 0x60 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 PUSH2 0x7DE PUSH2 0x19A9 JUMP JUMPDEST DUP11 ISZERO ISZERO PUSH2 0x7EA JUMPI PUSH2 0xABC JUMP JUMPDEST PUSH1 0x4 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 PUSH1 0x2 PUSH1 0x1 DUP6 AND ISZERO PUSH2 0x100 MUL PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 SWAP5 AND SWAP4 SWAP1 SWAP4 DIV PUSH1 0x1F DUP2 ADD DUP5 SWAP1 DIV DUP5 MUL DUP3 ADD DUP5 ADD SWAP1 SWAP3 MSTORE DUP2 DUP2 MSTORE SWAP3 SWAP2 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0x88E JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x863 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x88E JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x871 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP PUSH1 0x5 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 PUSH1 0x1F PUSH1 0x2 PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH2 0x100 PUSH1 0x1 DUP9 AND ISZERO MUL ADD SWAP1 SWAP6 AND SWAP5 SWAP1 SWAP5 DIV SWAP4 DUP5 ADD DUP2 SWAP1 DIV DUP2 MUL DUP3 ADD DUP2 ADD SWAP1 SWAP3 MSTORE DUP3 DUP2 MSTORE SWAP7 SWAP15 POP SWAP2 SWAP5 POP SWAP3 POP DUP5 ADD SWAP1 POP DUP3 DUP3 DUP1 ISZERO PUSH2 0x93D JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x912 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x93D JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x920 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP7 POP PUSH1 0x0 SWAP6 POP DUP12 MLOAD SWAP5 POP PUSH1 0x0 SWAP4 POP JUMPDEST DUP4 DUP6 EQ PUSH2 0xA82 JUMPI DUP8 DUP13 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x967 JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD MLOAD PUSH2 0x140 ADD MSTORE DUP12 MLOAD DUP8 SWAP1 DUP14 SWAP1 DUP7 SWAP1 DUP2 LT PUSH2 0x986 JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD MLOAD PUSH2 0x160 ADD MSTORE PUSH2 0x99F DUP12 DUP8 PUSH2 0xACB JUMP JUMPDEST SWAP3 POP PUSH2 0xA06 DUP13 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x9B2 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH1 0xA0 ADD MLOAD PUSH2 0xA00 DUP15 DUP8 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x9D1 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH1 0x80 ADD MLOAD DUP16 DUP9 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x9ED JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH1 0xE0 ADD MLOAD PUSH2 0xACB JUMP JUMPDEST DUP6 PUSH2 0x1099 JUMP JUMPDEST SWAP2 POP PUSH2 0xA4B DUP13 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xA19 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0xA2E DUP5 PUSH1 0x1 PUSH2 0x104F JUMP JUMPDEST DUP13 DUP8 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xA3C JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x1295 JUMP JUMPDEST SWAP1 POP PUSH2 0xA57 DUP10 DUP3 PUSH2 0x130D JUMP JUMPDEST PUSH2 0xA69 DUP10 PUSH1 0x0 ADD MLOAD DUP11 PUSH1 0x60 ADD MLOAD PUSH2 0xACB JUMP JUMPDEST SWAP6 POP DUP11 DUP7 LT PUSH2 0xA77 JUMPI PUSH2 0xA82 JUMP JUMPDEST PUSH1 0x1 SWAP1 SWAP4 ADD SWAP3 PUSH2 0x951 JUMP JUMPDEST DUP11 DUP7 LT ISZERO PUSH2 0xABC JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x23C7 JUMP JUMPDEST POP POP POP POP POP POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 GT ISZERO PUSH2 0xB07 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x2367 JUMP JUMPDEST POP SWAP1 SUB SWAP1 JUMP JUMPDEST PUSH2 0xB15 PUSH2 0x19A9 JUMP JUMPDEST PUSH1 0x60 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH2 0xB26 PUSH2 0x19A9 JUMP JUMPDEST PUSH1 0x0 DUP12 PUSH1 0x0 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xB37 JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP2 SWAP1 SWAP2 ADD DUP2 ADD MLOAD PUSH2 0x140 ADD MLOAD PUSH1 0x5 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x2 PUSH1 0x1 DUP5 AND ISZERO PUSH2 0x100 MUL PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 SWAP4 AND SWAP3 SWAP1 SWAP3 DIV PUSH1 0x1F DUP2 ADD DUP7 SWAP1 DIV DUP7 MUL DUP4 ADD DUP7 ADD SWAP1 SWAP2 MSTORE DUP1 DUP3 MSTORE SWAP3 SWAP12 POP SWAP3 SWAP1 SWAP2 SWAP1 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0xBEF JUMPI DUP1 PUSH1 0x1F LT PUSH2 0xBC4 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0xBEF JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0xBD2 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP7 POP DUP12 MLOAD SWAP6 POP PUSH1 0x0 SWAP5 POP JUMPDEST DUP5 DUP7 EQ PUSH2 0xCE5 JUMPI DUP8 DUP13 DUP7 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xC15 JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD MLOAD PUSH2 0x140 ADD MSTORE DUP12 MLOAD DUP8 SWAP1 DUP14 SWAP1 DUP8 SWAP1 DUP2 LT PUSH2 0xC34 JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD MLOAD PUSH2 0x160 ADD MSTORE DUP9 MLOAD PUSH2 0xC50 SWAP1 DUP13 SWAP1 PUSH2 0xACB JUMP JUMPDEST SWAP4 POP PUSH2 0xC93 DUP13 DUP7 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xC63 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH1 0xA0 ADD MLOAD DUP14 DUP8 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xC7F JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH1 0x80 ADD MLOAD DUP7 PUSH2 0x1099 JUMP JUMPDEST SWAP3 POP PUSH2 0xCBF DUP13 DUP7 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xCA6 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP5 DUP13 DUP9 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xA3C JUMPI INVALID JUMPDEST SWAP2 POP PUSH2 0xCCB DUP10 DUP4 PUSH2 0x130D JUMP JUMPDEST POP DUP8 MLOAD DUP11 DUP2 LT PUSH2 0xCDA JUMPI PUSH2 0xCE5 JUMP JUMPDEST PUSH1 0x1 SWAP1 SWAP5 ADD SWAP4 PUSH2 0xBFF JUMP JUMPDEST DUP11 DUP2 LT ISZERO PUSH2 0xABC JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x23C7 JUMP JUMPDEST PUSH1 0x0 DUP1 DUP1 DUP1 PUSH7 0xB1A2BC2EC50000 DUP7 GT ISZERO PUSH2 0xD65 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x23F7 JUMP JUMPDEST PUSH2 0xD6F DUP9 DUP9 PUSH2 0x104F JUMP JUMPDEST SWAP4 POP CALLVALUE DUP5 GT ISZERO PUSH2 0xDAB JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x2357 JUMP JUMPDEST PUSH2 0xDB5 CALLVALUE DUP6 PUSH2 0xACB JUMP JUMPDEST SWAP3 POP PUSH2 0xDCA DUP7 PUSH8 0xDE0B6B3A7640000 DUP11 PUSH2 0x1099 JUMP JUMPDEST SWAP2 POP DUP3 DUP3 GT ISZERO PUSH2 0xE06 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x23D7 JUMP JUMPDEST PUSH1 0x0 DUP4 GT ISZERO PUSH2 0xF29 JUMPI PUSH1 0x2 SLOAD PUSH1 0x40 MLOAD PUSH32 0x2E1A7D4D00000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP2 AND SWAP1 PUSH4 0x2E1A7D4D SWAP1 PUSH2 0xE65 SWAP1 DUP7 SWAP1 PUSH1 0x4 ADD PUSH2 0x2453 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0xE7F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0xE93 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x0 DUP3 GT ISZERO PUSH2 0xEE5 JUMPI PUSH1 0x40 MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP7 AND SWAP1 DUP4 ISZERO PUSH2 0x8FC MUL SWAP1 DUP5 SWAP1 PUSH1 0x0 DUP2 DUP2 DUP2 DUP6 DUP9 DUP9 CALL SWAP4 POP POP POP POP ISZERO DUP1 ISZERO PUSH2 0xEE3 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP JUMPDEST PUSH2 0xEEF DUP4 DUP4 PUSH2 0xACB JUMP JUMPDEST SWAP1 POP PUSH1 0x0 DUP2 GT ISZERO PUSH2 0xF29 JUMPI PUSH1 0x40 MLOAD CALLER SWAP1 DUP3 ISZERO PUSH2 0x8FC MUL SWAP1 DUP4 SWAP1 PUSH1 0x0 DUP2 DUP2 DUP2 DUP6 DUP9 DUP9 CALL SWAP4 POP POP POP POP ISZERO DUP1 ISZERO PUSH2 0xF27 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP JUMPDEST POP POP POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0xF45 DUP4 DUP3 PUSH4 0xFFFFFFFF PUSH2 0x136F AND JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0x4552433230546F6B656E28616464726573732900000000000000000000000000 DUP2 MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x13 ADD SWAP1 KECCAK256 SWAP1 SWAP2 POP PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 DUP1 DUP4 AND SWAP2 AND EQ ISZERO PUSH2 0xFB5 JUMPI PUSH2 0xFB0 DUP4 DUP4 PUSH2 0x13DC JUMP JUMPDEST PUSH2 0x383 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0x455243373231546F6B656E28616464726573732C75696E743235362900000000 DUP2 MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x1C ADD SWAP1 KECCAK256 PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 DUP3 DUP2 AND SWAP2 AND EQ ISZERO PUSH2 0x101D JUMPI PUSH2 0xFB0 DUP4 DUP4 PUSH2 0x15CA JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x23A7 JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 ADD DUP4 DUP2 LT ISZERO PUSH2 0x108E JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x2397 JUMP JUMPDEST DUP1 SWAP2 POP JUMPDEST POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP4 GT PUSH2 0x10D4 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x2387 JUMP JUMPDEST PUSH2 0x10E7 PUSH2 0x10E1 DUP6 DUP5 PUSH2 0x16B2 JUMP JUMPDEST DUP5 PUSH2 0x170D JUMP JUMPDEST SWAP1 POP JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH2 0x10F9 PUSH2 0x19A9 JUMP JUMPDEST PUSH1 0x60 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 PUSH2 0x1109 PUSH2 0x19A9 JUMP JUMPDEST DUP10 PUSH1 0x0 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1118 JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP2 SWAP1 SWAP2 ADD DUP2 ADD MLOAD PUSH2 0x140 ADD MLOAD PUSH1 0x5 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x2 PUSH1 0x1 DUP5 AND ISZERO PUSH2 0x100 MUL PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 SWAP4 AND SWAP3 SWAP1 SWAP3 DIV PUSH1 0x1F DUP2 ADD DUP7 SWAP1 DIV DUP7 MUL DUP4 ADD DUP7 ADD SWAP1 SWAP2 MSTORE DUP1 DUP3 MSTORE SWAP3 SWAP10 POP SWAP3 SWAP1 SWAP2 SWAP1 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0x11D0 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x11A5 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x11D0 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x11B3 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP5 POP DUP10 MLOAD SWAP4 POP PUSH1 0x0 SWAP3 POP JUMPDEST DUP3 DUP5 EQ PUSH2 0x1288 JUMPI DUP6 DUP11 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x11F6 JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD MLOAD PUSH2 0x140 ADD MSTORE DUP10 MLOAD DUP6 SWAP1 DUP12 SWAP1 DUP6 SWAP1 DUP2 LT PUSH2 0x1215 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x160 ADD DUP2 SWAP1 MSTORE POP PUSH2 0x1235 DUP10 DUP9 PUSH1 0x20 ADD MLOAD PUSH2 0xACB JUMP JUMPDEST SWAP2 POP PUSH2 0x1261 DUP11 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1248 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP4 DUP11 DUP7 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xA3C JUMPI INVALID JUMPDEST SWAP1 POP PUSH2 0x126D DUP8 DUP3 PUSH2 0x130D JUMP JUMPDEST PUSH1 0x20 DUP8 ADD MLOAD DUP10 GT PUSH2 0x127D JUMPI PUSH2 0x1288 JUMP JUMPDEST PUSH1 0x1 SWAP1 SWAP3 ADD SWAP2 PUSH2 0x11E0 JUMP JUMPDEST POP POP POP POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH2 0x129D PUSH2 0x19A9 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x0 PUSH2 0x12AC DUP7 DUP7 DUP7 PUSH2 0x1724 JUMP JUMPDEST PUSH1 0x1 SLOAD DUP2 MLOAD SWAP2 SWAP4 POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP2 POP PUSH1 0x80 SWAP1 DUP4 SWAP1 PUSH1 0x20 DUP3 ADD PUSH1 0x0 DUP6 GAS CALL DUP1 ISZERO PUSH2 0x1303 JUMPI DUP3 MLOAD DUP5 MSTORE PUSH1 0x20 DUP4 ADD MLOAD PUSH1 0x20 DUP6 ADD MSTORE PUSH1 0x40 DUP4 ADD MLOAD PUSH1 0x40 DUP6 ADD MSTORE PUSH1 0x60 DUP4 ADD MLOAD PUSH1 0x60 DUP6 ADD MSTORE JUMPDEST POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST DUP2 MLOAD DUP2 MLOAD PUSH2 0x131B SWAP2 SWAP1 PUSH2 0x104F JUMP JUMPDEST DUP3 MSTORE PUSH1 0x20 DUP1 DUP4 ADD MLOAD SWAP1 DUP3 ADD MLOAD PUSH2 0x1331 SWAP2 SWAP1 PUSH2 0x104F JUMP JUMPDEST PUSH1 0x20 DUP4 ADD MSTORE PUSH1 0x40 DUP1 DUP4 ADD MLOAD SWAP1 DUP3 ADD MLOAD PUSH2 0x134A SWAP2 SWAP1 PUSH2 0x104F JUMP JUMPDEST PUSH1 0x40 DUP4 ADD MSTORE PUSH1 0x60 DUP1 DUP4 ADD MLOAD SWAP1 DUP3 ADD MLOAD PUSH2 0x1363 SWAP2 SWAP1 PUSH2 0x104F JUMP JUMPDEST PUSH1 0x60 SWAP1 SWAP3 ADD SWAP2 SWAP1 SWAP2 MSTORE POP JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x4 ADD DUP4 MLOAD LT ISZERO ISZERO ISZERO PUSH2 0x13B1 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x2417 JUMP JUMPDEST POP ADD PUSH1 0x20 ADD MLOAD PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 AND SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x13F0 DUP5 PUSH1 0x10 PUSH4 0xFFFFFFFF PUSH2 0x18F6 AND JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0x7472616E7366657228616464726573732C75696E743235362900000000000000 DUP2 MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x19 ADD DUP2 KECCAK256 SWAP2 SWAP4 POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND SWAP2 SWAP1 PUSH2 0x144E SWAP1 CALLER SWAP1 DUP8 SWAP1 PUSH1 0x24 ADD PUSH2 0x231C JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 DUP2 DUP5 SUB ADD DUP2 MSTORE SWAP2 DUP2 MSTORE PUSH1 0x20 DUP3 ADD DUP1 MLOAD PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 SWAP1 SWAP5 AND SWAP4 SWAP1 SWAP4 OR DUP4 MSTORE MLOAD DUP2 MLOAD SWAP2 SWAP3 SWAP1 SWAP2 DUP3 SWAP2 SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x14F2 JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH2 0x14DA JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x151F JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP2 POP POP PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP7 GAS CALL SWAP3 POP POP POP DUP1 ISZERO ISZERO PUSH2 0x156E JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x23B7 JUMP JUMPDEST RETURNDATASIZE ISZERO PUSH2 0x158B JUMPI POP PUSH1 0x0 RETURNDATASIZE PUSH1 0x20 EQ ISZERO PUSH2 0x158B JUMPI PUSH1 0x20 PUSH1 0x0 DUP1 RETURNDATACOPY POP PUSH1 0x0 MLOAD JUMPDEST DUP1 ISZERO ISZERO PUSH2 0x15C4 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x23B7 JUMP JUMPDEST POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x1 DUP4 EQ PUSH2 0x1607 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x2427 JUMP JUMPDEST PUSH2 0x1618 DUP5 PUSH1 0x10 PUSH4 0xFFFFFFFF PUSH2 0x18F6 AND JUMP JUMPDEST SWAP2 POP PUSH2 0x162B DUP5 PUSH1 0x24 PUSH4 0xFFFFFFFF PUSH2 0x1957 AND JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH32 0x23B872DD00000000000000000000000000000000000000000000000000000000 DUP2 MSTORE SWAP1 SWAP2 POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND SWAP1 PUSH4 0x23B872DD SWAP1 PUSH2 0x1684 SWAP1 ADDRESS SWAP1 CALLER SWAP1 DUP7 SWAP1 PUSH1 0x4 ADD PUSH2 0x22F4 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x169E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0xF29 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST PUSH1 0x0 DUP1 DUP4 ISZERO ISZERO PUSH2 0x16C5 JUMPI PUSH1 0x0 SWAP2 POP PUSH2 0x1092 JUMP JUMPDEST POP DUP3 DUP3 MUL DUP3 DUP5 DUP3 DUP2 ISZERO ISZERO PUSH2 0x16D5 JUMPI INVALID JUMPDEST DIV EQ PUSH2 0x108E JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x2397 JUMP JUMPDEST PUSH1 0x0 DUP1 DUP3 DUP5 DUP2 ISZERO ISZERO PUSH2 0x171B JUMPI INVALID JUMPDEST DIV SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0xB4BE83D500000000000000000000000000000000000000000000000000000000 PUSH1 0x20 DUP1 DUP4 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x60 PUSH1 0x24 DUP4 ADD DUP2 DUP2 MSTORE DUP8 MLOAD PUSH1 0x84 DUP6 ADD SWAP1 DUP2 MSTORE DUP9 DUP5 ADD MLOAD PUSH1 0xA4 DUP7 ADD MSTORE SWAP5 DUP9 ADD MLOAD PUSH1 0xC4 DUP6 ADD MSTORE SWAP1 DUP8 ADD MLOAD PUSH1 0xE4 DUP5 ADD MSTORE PUSH1 0x80 DUP8 ADD MLOAD PUSH2 0x104 DUP5 ADD MSTORE PUSH1 0xA0 DUP8 ADD MLOAD PUSH2 0x124 DUP5 ADD MSTORE PUSH1 0xC0 DUP8 ADD MLOAD PUSH2 0x144 DUP5 ADD MSTORE PUSH1 0xE0 DUP8 ADD MLOAD PUSH2 0x164 DUP5 ADD MSTORE PUSH2 0x100 DUP8 ADD MLOAD PUSH2 0x184 DUP5 ADD MSTORE PUSH2 0x120 DUP8 ADD MLOAD PUSH2 0x1A4 DUP5 ADD MSTORE PUSH2 0x140 DUP8 ADD DUP1 MLOAD PUSH2 0x1C4 DUP6 ADD SWAP1 DUP2 MSTORE PUSH2 0x160 DUP10 ADD MLOAD PUSH2 0x1E4 DUP7 ADD MSTORE PUSH2 0x180 SWAP1 MSTORE MLOAD DUP1 MLOAD PUSH2 0x204 DUP6 ADD DUP2 SWAP1 MSTORE SWAP4 SWAP5 SWAP2 SWAP4 DUP5 SWAP4 PUSH1 0x44 DUP8 ADD SWAP3 DUP5 SWAP3 PUSH2 0x224 DUP10 ADD SWAP3 SWAP2 DUP3 ADD SWAP2 PUSH1 0x1F DUP3 ADD DIV PUSH1 0x0 JUMPDEST DUP2 DUP2 LT ISZERO PUSH2 0x182B JUMPI DUP4 MLOAD DUP6 MSTORE PUSH1 0x20 SWAP5 DUP6 ADD SWAP5 SWAP1 SWAP4 ADD SWAP3 PUSH1 0x1 ADD PUSH2 0x180D JUMP JUMPDEST POP POP POP POP DUP2 DUP2 SUB PUSH2 0x160 DUP1 DUP5 ADD SWAP2 SWAP1 SWAP2 MSTORE DUP11 ADD MLOAD DUP1 MLOAD DUP1 DUP4 MSTORE PUSH1 0x20 SWAP3 DUP4 ADD SWAP3 SWAP2 DUP3 ADD SWAP2 PUSH1 0x1F DUP3 ADD DIV PUSH1 0x0 JUMPDEST DUP2 DUP2 LT ISZERO PUSH2 0x1874 JUMPI DUP4 MLOAD DUP6 MSTORE PUSH1 0x20 SWAP5 DUP6 ADD SWAP5 SWAP1 SWAP4 ADD SWAP3 PUSH1 0x1 ADD PUSH2 0x1856 JUMP JUMPDEST POP POP POP DUP10 DUP5 MSTORE POP DUP5 DUP2 SUB PUSH1 0x20 SWAP4 DUP5 ADD SWAP1 DUP2 MSTORE DUP9 MLOAD DUP1 DUP4 MSTORE SWAP1 SWAP4 SWAP2 DUP3 ADD SWAP2 DUP10 DUP2 ADD SWAP2 SWAP1 PUSH1 0x1F DUP3 ADD DIV PUSH1 0x0 JUMPDEST DUP2 DUP2 LT ISZERO PUSH2 0x18BC JUMPI DUP4 MLOAD DUP6 MSTORE PUSH1 0x20 SWAP5 DUP6 ADD SWAP5 SWAP1 SWAP4 ADD SWAP3 PUSH1 0x1 ADD PUSH2 0x189E JUMP JUMPDEST POP POP POP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 DUP9 DUP4 SUB ADD DUP9 MSTORE POP PUSH1 0x40 MSTORE POP POP POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x14 ADD DUP4 MLOAD LT ISZERO ISZERO ISZERO PUSH2 0x1938 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x2407 JUMP JUMPDEST POP ADD PUSH1 0x14 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x7BA DUP4 DUP4 PUSH1 0x0 DUP2 PUSH1 0x20 ADD DUP4 MLOAD LT ISZERO ISZERO ISZERO PUSH2 0x19A0 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x2377 JUMP JUMPDEST POP ADD PUSH1 0x20 ADD MLOAD SWAP1 JUMP JUMPDEST PUSH1 0x80 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE POP SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x7BA DUP3 CALLDATALOAD PUSH2 0x24EF JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH2 0x19EF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0x1A02 PUSH2 0x19FD DUP3 PUSH2 0x2488 JUMP JUMPDEST PUSH2 0x2461 JUMP JUMPDEST DUP2 DUP2 MSTORE PUSH1 0x20 SWAP4 DUP5 ADD SWAP4 SWAP1 SWAP3 POP DUP3 ADD DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x1A40 JUMPI DUP2 CALLDATALOAD DUP7 ADD PUSH2 0x1A2A DUP9 DUP3 PUSH2 0x1AF0 JUMP JUMPDEST DUP5 MSTORE POP PUSH1 0x20 SWAP3 DUP4 ADD SWAP3 SWAP2 SWAP1 SWAP2 ADD SWAP1 PUSH1 0x1 ADD PUSH2 0x1A14 JUMP JUMPDEST POP POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH2 0x1A5B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0x1A69 PUSH2 0x19FD DUP3 PUSH2 0x2488 JUMP JUMPDEST DUP2 DUP2 MSTORE PUSH1 0x20 SWAP4 DUP5 ADD SWAP4 SWAP1 SWAP3 POP DUP3 ADD DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x1A40 JUMPI DUP2 CALLDATALOAD DUP7 ADD PUSH2 0x1A91 DUP9 DUP3 PUSH2 0x1B3F JUMP JUMPDEST DUP5 MSTORE POP PUSH1 0x20 SWAP3 DUP4 ADD SWAP3 SWAP2 SWAP1 SWAP2 ADD SWAP1 PUSH1 0x1 ADD PUSH2 0x1A7B JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x1F DUP4 ADD DUP5 SGT PUSH2 0x1AB9 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP DUP2 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1AD1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x20 DUP4 ADD SWAP2 POP DUP4 PUSH1 0x1 DUP3 MUL DUP4 ADD GT ISZERO PUSH2 0x1AE9 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH2 0x1B01 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0x1B0F PUSH2 0x19FD DUP3 PUSH2 0x24A9 JUMP JUMPDEST SWAP2 POP DUP1 DUP3 MSTORE PUSH1 0x20 DUP4 ADD PUSH1 0x20 DUP4 ADD DUP6 DUP4 DUP4 ADD GT ISZERO PUSH2 0x1B2B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1B36 DUP4 DUP3 DUP5 PUSH2 0x250B JUMP JUMPDEST POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x180 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x1B52 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1B5D PUSH2 0x180 PUSH2 0x2461 JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0x1B6B DUP5 DUP5 PUSH2 0x19D2 JUMP JUMPDEST DUP3 MSTORE POP PUSH1 0x20 PUSH2 0x1B7C DUP5 DUP5 DUP4 ADD PUSH2 0x19D2 JUMP JUMPDEST PUSH1 0x20 DUP4 ADD MSTORE POP PUSH1 0x40 PUSH2 0x1B90 DUP5 DUP3 DUP6 ADD PUSH2 0x19D2 JUMP JUMPDEST PUSH1 0x40 DUP4 ADD MSTORE POP PUSH1 0x60 PUSH2 0x1BA4 DUP5 DUP3 DUP6 ADD PUSH2 0x19D2 JUMP JUMPDEST PUSH1 0x60 DUP4 ADD MSTORE POP PUSH1 0x80 PUSH2 0x1BB8 DUP5 DUP3 DUP6 ADD PUSH2 0x1C88 JUMP JUMPDEST PUSH1 0x80 DUP4 ADD MSTORE POP PUSH1 0xA0 PUSH2 0x1BCC DUP5 DUP3 DUP6 ADD PUSH2 0x1C88 JUMP JUMPDEST PUSH1 0xA0 DUP4 ADD MSTORE POP PUSH1 0xC0 PUSH2 0x1BE0 DUP5 DUP3 DUP6 ADD PUSH2 0x1C88 JUMP JUMPDEST PUSH1 0xC0 DUP4 ADD MSTORE POP PUSH1 0xE0 PUSH2 0x1BF4 DUP5 DUP3 DUP6 ADD PUSH2 0x1C88 JUMP JUMPDEST PUSH1 0xE0 DUP4 ADD MSTORE POP PUSH2 0x100 PUSH2 0x1C09 DUP5 DUP3 DUP6 ADD PUSH2 0x1C88 JUMP JUMPDEST PUSH2 0x100 DUP4 ADD MSTORE POP PUSH2 0x120 PUSH2 0x1C1F DUP5 DUP3 DUP6 ADD PUSH2 0x1C88 JUMP JUMPDEST PUSH2 0x120 DUP4 ADD MSTORE POP PUSH2 0x140 DUP3 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1C41 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1C4D DUP5 DUP3 DUP6 ADD PUSH2 0x1AF0 JUMP JUMPDEST PUSH2 0x140 DUP4 ADD MSTORE POP PUSH2 0x160 DUP3 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1C6F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1C7B DUP5 DUP3 DUP6 ADD PUSH2 0x1AF0 JUMP JUMPDEST PUSH2 0x160 DUP4 ADD MSTORE POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x7BA DUP3 CALLDATALOAD PUSH2 0x2508 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x1CA6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1CB2 DUP5 DUP5 PUSH2 0x19D2 JUMP JUMPDEST SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0xC0 DUP8 DUP10 SUB SLT ISZERO PUSH2 0x1CD3 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP7 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1CEA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1CF6 DUP10 DUP3 DUP11 ADD PUSH2 0x1A4A JUMP JUMPDEST SWAP7 POP POP PUSH1 0x20 DUP8 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1D13 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1D1F DUP10 DUP3 DUP11 ADD PUSH2 0x19DE JUMP JUMPDEST SWAP6 POP POP PUSH1 0x40 DUP8 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1D3C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1D48 DUP10 DUP3 DUP11 ADD PUSH2 0x1A4A JUMP JUMPDEST SWAP5 POP POP PUSH1 0x60 DUP8 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1D65 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1D71 DUP10 DUP3 DUP11 ADD PUSH2 0x19DE JUMP JUMPDEST SWAP4 POP POP PUSH1 0x80 PUSH2 0x1D82 DUP10 DUP3 DUP11 ADD PUSH2 0x1C88 JUMP JUMPDEST SWAP3 POP POP PUSH1 0xA0 PUSH2 0x1D93 DUP10 DUP3 DUP11 ADD PUSH2 0x19D2 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP6 POP SWAP3 SWAP6 POP SWAP3 SWAP6 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0xE0 DUP9 DUP11 SUB SLT ISZERO PUSH2 0x1DBB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP8 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1DD2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1DDE DUP11 DUP3 DUP12 ADD PUSH2 0x1A4A JUMP JUMPDEST SWAP8 POP POP PUSH1 0x20 PUSH2 0x1DEF DUP11 DUP3 DUP12 ADD PUSH2 0x1C88 JUMP JUMPDEST SWAP7 POP POP PUSH1 0x40 DUP9 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1E0C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1E18 DUP11 DUP3 DUP12 ADD PUSH2 0x19DE JUMP JUMPDEST SWAP6 POP POP PUSH1 0x60 DUP9 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1E35 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1E41 DUP11 DUP3 DUP12 ADD PUSH2 0x1A4A JUMP JUMPDEST SWAP5 POP POP PUSH1 0x80 DUP9 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1E5E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1E6A DUP11 DUP3 DUP12 ADD PUSH2 0x19DE JUMP JUMPDEST SWAP4 POP POP PUSH1 0xA0 PUSH2 0x1E7B DUP11 DUP3 DUP12 ADD PUSH2 0x1C88 JUMP JUMPDEST SWAP3 POP POP PUSH1 0xC0 PUSH2 0x1E8C DUP11 DUP3 DUP12 ADD PUSH2 0x19D2 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP6 SWAP9 SWAP2 SWAP5 SWAP8 POP SWAP3 SWAP6 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x40 DUP5 DUP7 SUB SLT ISZERO PUSH2 0x1EB0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP4 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1EC7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1ED3 DUP7 DUP3 DUP8 ADD PUSH2 0x1AA7 JUMP JUMPDEST SWAP4 POP SWAP4 POP POP PUSH1 0x20 PUSH2 0x1EE6 DUP7 DUP3 DUP8 ADD PUSH2 0x1C88 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 POP SWAP3 JUMP JUMPDEST PUSH2 0x1EF9 DUP2 PUSH2 0x24EF JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x23 DUP2 MSTORE PUSH32 0x44454641554C545F46554E4354494F4E5F574554485F434F4E54524143545F4F PUSH1 0x20 DUP3 ADD MSTORE PUSH32 0x4E4C590000000000000000000000000000000000000000000000000000000000 PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x60 ADD SWAP1 JUMP JUMPDEST PUSH1 0x11 DUP2 MSTORE PUSH32 0x494E56414C49445F4D53475F56414C5545000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0xD DUP2 MSTORE PUSH32 0x4F564552534F4C445F5745544800000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x11 DUP2 MSTORE PUSH32 0x55494E543235365F554E444552464C4F57000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x26 DUP2 MSTORE PUSH32 0x475245415445525F4F525F455155414C5F544F5F33325F4C454E4754485F5245 PUSH1 0x20 DUP3 ADD MSTORE PUSH32 0x5155495245440000000000000000000000000000000000000000000000000000 PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x60 ADD SWAP1 JUMP JUMPDEST PUSH1 0x10 DUP2 MSTORE PUSH32 0x4449564953494F4E5F42595F5A45524F00000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x10 DUP2 MSTORE PUSH32 0x55494E543235365F4F564552464C4F5700000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x17 DUP2 MSTORE PUSH32 0x554E535550504F525445445F41535345545F50524F5859000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0xF DUP2 MSTORE PUSH32 0x5452414E534645525F4641494C45440000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x14 DUP2 MSTORE PUSH32 0x434F4D504C4554455F46494C4C5F4641494C4544000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x1A DUP2 MSTORE PUSH32 0x494E53554646494349454E545F4554485F52454D41494E494E47000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x13 DUP2 MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x18 DUP2 MSTORE PUSH32 0x4645455F50455243454E544147455F544F4F5F4C415247450000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x26 DUP2 MSTORE PUSH32 0x475245415445525F4F525F455155414C5F544F5F32305F4C454E4754485F5245 PUSH1 0x20 DUP3 ADD MSTORE PUSH32 0x5155495245440000000000000000000000000000000000000000000000000000 PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x60 ADD SWAP1 JUMP JUMPDEST PUSH1 0x25 DUP2 MSTORE PUSH32 0x475245415445525F4F525F455155414C5F544F5F345F4C454E4754485F524551 PUSH1 0x20 DUP3 ADD MSTORE PUSH32 0x5549524544000000000000000000000000000000000000000000000000000000 PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x60 ADD SWAP1 JUMP JUMPDEST PUSH1 0xE DUP2 MSTORE PUSH32 0x494E56414C49445F414D4F554E54000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST DUP1 MLOAD PUSH1 0x80 DUP4 ADD SWAP1 PUSH2 0x22A8 DUP5 DUP3 PUSH2 0x22DD JUMP JUMPDEST POP PUSH1 0x20 DUP3 ADD MLOAD PUSH2 0x22BB PUSH1 0x20 DUP6 ADD DUP3 PUSH2 0x22DD JUMP JUMPDEST POP PUSH1 0x40 DUP3 ADD MLOAD PUSH2 0x22CE PUSH1 0x40 DUP6 ADD DUP3 PUSH2 0x22DD JUMP JUMPDEST POP PUSH1 0x60 DUP3 ADD MLOAD PUSH2 0x15C4 PUSH1 0x60 DUP6 ADD DUP3 JUMPDEST PUSH2 0x1EF9 DUP2 PUSH2 0x2508 JUMP JUMPDEST PUSH1 0x20 DUP2 ADD PUSH2 0x7BD DUP3 DUP5 PUSH2 0x1EF0 JUMP JUMPDEST PUSH1 0x60 DUP2 ADD PUSH2 0x2302 DUP3 DUP7 PUSH2 0x1EF0 JUMP JUMPDEST PUSH2 0x230F PUSH1 0x20 DUP4 ADD DUP6 PUSH2 0x1EF0 JUMP JUMPDEST PUSH2 0x1CB2 PUSH1 0x40 DUP4 ADD DUP5 PUSH2 0x22DD JUMP JUMPDEST PUSH1 0x40 DUP2 ADD PUSH2 0x232A DUP3 DUP6 PUSH2 0x1EF0 JUMP JUMPDEST PUSH2 0x10EA PUSH1 0x20 DUP4 ADD DUP5 PUSH2 0x22DD JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x1EFF JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x1F55 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x1F85 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x1FB5 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x1FE5 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x203B JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x206B JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x209B JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x20CB JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x20FB JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x212B JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x215B JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x218B JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x21BB JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x2211 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x2267 JUMP JUMPDEST PUSH2 0x100 DUP2 ADD PUSH2 0x2446 DUP3 DUP6 PUSH2 0x2297 JUMP JUMPDEST PUSH2 0x10EA PUSH1 0x80 DUP4 ADD DUP5 PUSH2 0x2297 JUMP JUMPDEST PUSH1 0x20 DUP2 ADD PUSH2 0x7BD DUP3 DUP5 PUSH2 0x22DD JUMP JUMPDEST PUSH1 0x40 MLOAD DUP2 DUP2 ADD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT DUP3 DUP3 LT OR ISZERO PUSH2 0x2480 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x40 MSTORE SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH8 0xFFFFFFFFFFFFFFFF DUP3 GT ISZERO PUSH2 0x249F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x20 SWAP1 DUP2 MUL ADD SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH8 0xFFFFFFFFFFFFFFFF DUP3 GT ISZERO PUSH2 0x24C0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x20 PUSH1 0x1F SWAP2 SWAP1 SWAP2 ADD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 AND ADD SWAP1 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 JUMP JUMPDEST SWAP1 JUMP JUMPDEST DUP3 DUP2 DUP4 CALLDATACOPY POP PUSH1 0x0 SWAP2 ADD MSTORE JUMP STOP LOG2 PUSH6 0x627A7A723058 KECCAK256 XOR GAS DELEGATECALL 0xa5 0xe8 MSTORE JUMPDEST 0xc KECCAK256 SWAP9 EXTCODESIZE CALLCODE 0x2c MULMOD PUSH24 0x3A1CAB3F704716CBA4C8DA3B112601CD666C657870657269 PUSH14 0x656E74616CF50037000000000000 ",
- "sourceMap": "836:407:0:-;;;963:278;8:9:-1;5:2;;;30:1;27;20:12;5:2;963:278:0;;;;;;;;;;;;;;;;;;;;;;;;1348:20:3;162:18:63;;170:10;-1:-1:-1;;;;;;162:18:63;;;;;;-1:-1:-1;1795:31:7;;;;;-1:-1:-1;;;;;1795:31:7;;;;;1836:30;;1795:31;;1836:30;;1181:14:0;;1348:20:3;;;;1836:30:7;;:14;;:30;;;;;:::i;:::-;-1:-1:-1;1876:32:7;;;;:15;;:32;;;;;:::i;:::-;-1:-1:-1;1940:30:7;:14;1967:2;1940:26;;;;;;:30;:::i;:::-;1919:51;-1:-1:-1;1999:29:7;:13;2025:2;1999:25;;;;;;:29;:::i;:::-;2038:11;:37;;-1:-1:-1;;;;;2038:37:7;;;-1:-1:-1;;;;;;2038:37:7;;;;;;;2085:9;:33;;;;;;;;;;;;;;;-1:-1:-1;2038:37:7;1371:8:3;930:32:7;;;;;;;;;;;;;;;;1371:37:3;;;:8;;;;;-1:-1:-1;1371:22:3;;-1:-1:-1;1371:37:3;;-1:-1:-1;930:32:7;1371:37:3;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1371:37:3;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1371:37:3;;;;;;;101:4:-1;97:9;90:4;84;80:15;76:31;69:5;65:43;126:6;120:4;113:20;0:138;1371:37:3;;;;;;;;;1348:60;-1:-1:-1;;;;;;1439:26:3;;;;1418:97;;;;;;;;;;;;;;;;;;;;;;1525:11;;:43;;;;;-1:-1:-1;;;;;1525:11:3;;;;:19;;:43;;1545:12;;-1:-1:-1;;1103:10:7;1525:43:3;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1525:43:3;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1525:43:3;;;;;;;101:4:-1;97:9;90:4;84;80:15;76:31;69:5;65:43;126:6;120:4;113:20;0:138;1525:43:3;;;;;;;;;-1:-1:-1;1578:9:3;;:41;;;;;-1:-1:-1;;;;;1578:9:3;;;;:17;;:41;;1596:12;;-1:-1:-1;;1103:10:7;1578:41:3;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1578:41:3;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1578:41:3;;;;;;;101:4:-1;97:9;90:4;84;80:15;76:31;69:5;65:43;126:6;120:4;113:20;0:138;1578:41:3;;;;;;;;;;1304:322;963:278:0;;;836:407;;10268:886:61;10389:14;10452:5;10460:2;10452:10;10440:1;:8;:22;;10419:135;;;;;;;;;;;;;;;;-1:-1:-1;10801:2:61;11056:13;;;;;11050:20;10792:11;;;-1:-1:-1;;;;;11046:69:61;10268:886;;;;;:::o;836:407:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;836:407:0;;;-1:-1:-1;836:407:0;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;:::o;5:122:-1:-;;83:39;114:6;108:13;83:39;;;74:48;68:59;-1:-1;;;68:59;134:116;;209:36;237:6;231:13;209:36;;258:442;;363:4;351:17;;347:27;-1:-1;337:2;;388:1;385;378:12;337:2;418:6;412:13;440:64;455:48;496:6;455:48;;;440:64;;;431:73;;524:6;517:5;510:21;560:4;552:6;548:17;593:4;586:5;582:16;628:3;619:6;614:3;610:16;607:25;604:2;;;645:1;642;635:12;604:2;655:39;687:6;682:3;677;655:39;;;330:370;;;;;;;;708:263;;823:2;811:9;802:7;798:23;794:32;791:2;;;839:1;836;829:12;791:2;874:1;891:64;947:7;927:9;891:64;;;881:74;785:186;-1:-1;;;;785:186;978:729;;;;1145:2;1133:9;1124:7;1120:23;1116:32;1113:2;;;1161:1;1158;1151:12;1113:2;1196:1;1213:64;1269:7;1249:9;1213:64;;;1203:74;;1175:108;1335:2;1324:9;1320:18;1314:25;-1:-1;;;;;1351:6;1348:30;1345:2;;;1391:1;1388;1381:12;1345:2;1411:73;1476:7;1467:6;1456:9;1452:22;1411:73;;;1401:83;;1293:197;1542:2;1531:9;1527:18;1521:25;-1:-1;;;;;1558:6;1555:30;1552:2;;;1598:1;1595;1588:12;1552:2;1618:73;1683:7;1674:6;1663:9;1659:22;1618:73;;;1608:83;;1500:197;1107:600;;;;;;1714:257;;1826:2;1814:9;1805:7;1801:23;1797:32;1794:2;;;1842:1;1839;1832:12;1794:2;1877:1;1894:61;1947:7;1927:9;1894:61;;1978:110;2051:31;2076:5;2051:31;;;2046:3;2039:44;2033:55;;;2095:107;2166:30;2190:5;2166:30;;2210:397;2365:2;2353:15;;2402:66;2397:2;2388:12;;2381:88;2503:66;2498:2;2489:12;;2482:88;2598:2;2589:12;;2346:261;2616:296;2771:2;2759:15;;2808:66;2803:2;2794:12;;2787:88;2903:2;2894:12;;2752:160;2920:110;2993:31;3018:5;2993:31;;3037:294;3173:2;3158:18;;3187:61;3162:9;3221:6;3187:61;;;3259:62;3317:2;3306:9;3302:18;3293:6;3259:62;;3338:189;3444:2;3429:18;;3458:59;3433:9;3490:6;3458:59;;3534:387;3715:2;3729:47;;;3700:18;;3790:121;3700:18;3790:121;;3928:387;4109:2;4123:47;;;4094:18;;4184:121;4094:18;4184:121;;4322:256;4384:2;4378:9;4410:17;;;-1:-1;;;;;4470:34;;4506:22;;;4467:62;4464:2;;;4542:1;4539;4532:12;4464:2;4558;4551:22;4362:216;;-1:-1;4362:216;4585:258;;-1:-1;;;;;4720:6;4717:30;4714:2;;;4760:1;4757;4750:12;4714:2;-1:-1;4833:4;4804;4781:17;;;;-1:-1;;4777:33;4823:15;;4651:192;4850:128;-1:-1;;;;;4919:54;;4902:76;4985:151;5064:66;5053:78;;5036:100;5364:92;5437:13;5430:21;;5413:43;5464:268;5529:1;5536:101;5550:6;5547:1;5544:13;5536:101;;;5617:11;;;5611:18;5598:11;;;5591:39;5572:2;5565:10;5536:101;;;5652:6;5649:1;5646:13;5643:2;;;5717:1;5708:6;5703:3;5699:16;5692:27;5643:2;5513:219;;;;;;836:407:0;;;;;;"
- },
- "deployedBytecode": {
- "linkReferences": {},
- "object": "0x60806040526004361061006c5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166318978e8281146100c8578063630f1e6c146100f25780638da5cb5b146101125780639395525c14610134578063f2fde38b14610147575b60025473ffffffffffffffffffffffffffffffffffffffff1633146100c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612337565b60405180910390fd5b005b6100db6100d6366004611da0565b610167565b6040516100e9929190612437565b60405180910390f35b3480156100fe57600080fd5b506100c661010d366004611e9b565b6102f7565b34801561011e57600080fd5b50610127610388565b6040516100e991906122e6565b6100db610142366004611cba565b6103a4565b34801561015357600080fd5b506100c6610162366004611c94565b61050a565b61016f6119a9565b6101776119a9565b6000806101826105bb565b60048054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610100600188161502019095169490940493840181900481028201810190925282815261025c939092909183018282801561022d5780601f106102025761010080835404028352916020019161022d565b820191906000526020600020905b81548152906001019060200180831161021057829003601f168201915b50505050508c600081518110151561024157fe5b6020908102909101015161014001519063ffffffff61069616565b156102875761026c8b8b8b6107c3565b935061028084600001518560600151610acb565b90506102ae565b6102928b8b8b610b0d565b9350836060015191506102a68883896107c3565b845190935090505b6102c2846020015184602001518888610d1f565b6102e98b60008151811015156102d457fe5b90602001906020020151610140015182610f33565b505097509795505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610348576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123e7565b61038383838080601f01602080910402602001604051908101604052809392919081815260200183838082843750879450610f339350505050565b505050565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b6103ac6119a9565b6103b46119a9565b60008060006103c16105bb565b60048054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101006001881615020190951694909404938401819004810282018101909252828152610441939092909183018282801561022d5780601f106102025761010080835404028352916020019161022d565b156104925761046a670de0b6b3a7640000610464670de0b6b3a76400008a61104f565b34611099565b92506104778b848c6110f1565b945061048b85600001518660600151610acb565b90506104d6565b6104ad670d2f13f7789f0000670de0b6b3a764000034611099565b92506104ba8b848c6110f1565b9450846060015191506104ce89838a6107c3565b855190945090505b6104ea856020015185602001518989610d1f565b6104fc8b60008151811015156102d457fe5b505050965096945050505050565b60005473ffffffffffffffffffffffffffffffffffffffff16331461055b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123e7565b73ffffffffffffffffffffffffffffffffffffffff8116156105b857600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83161790555b50565b600034116105f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612347565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0e30db0346040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004016000604051808303818588803b15801561067b57600080fd5b505af115801561068f573d6000803e3d6000fd5b5050505050565b6000815183511480156107ba5750816040518082805190602001908083835b602083106106f257805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016106b5565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0180199092169116179052604051919093018190038120885190955088945090928392508401908083835b6020831061078757805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161074a565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060001916145b90505b92915050565b6107cb6119a9565b60608060008060008060006107de6119a9565b8a15156107ea57610abc565b6004805460408051602060026001851615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f8101849004840282018401909252818152929183018282801561088e5780601f106108635761010080835404028352916020019161088e565b820191906000526020600020905b81548152906001019060200180831161087157829003601f168201915b505060058054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101006001881615020190951694909404938401819004810282018101909252828152969e509194509250840190508282801561093d5780601f106109125761010080835404028352916020019161093d565b820191906000526020600020905b81548152906001019060200180831161092057829003601f168201915b50505050509650600095508b519450600093505b838514610a8257878c8581518110151561096757fe5b6020908102909101015161014001528b5187908d908690811061098657fe5b60209081029091010151610160015261099f8b87610acb565b9250610a068c858151811015156109b257fe5b9060200190602002015160a00151610a008e878151811015156109d157fe5b90602001906020020151608001518f888151811015156109ed57fe5b9060200190602002015160e00151610acb565b85611099565b9150610a4b8c85815181101515610a1957fe5b90602001906020020151610a2e84600161104f565b8c87815181101515610a3c57fe5b90602001906020020151611295565b9050610a57898261130d565b610a6989600001518a60600151610acb565b95508a8610610a7757610a82565b600190930192610951565b8a861015610abc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123c7565b50505050505050509392505050565b600082821115610b07576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612367565b50900390565b610b156119a9565b606080600080600080610b266119a9565b60008b6000815181101515610b3757fe5b6020908102919091018101516101400151600580546040805160026001841615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190931692909204601f8101869004860283018601909152808252929b5092909190830182828015610bef5780601f10610bc457610100808354040283529160200191610bef565b820191906000526020600020905b815481529060010190602001808311610bd257829003601f168201915b505050505096508b519550600094505b848614610ce557878c86815181101515610c1557fe5b6020908102909101015161014001528b5187908d9087908110610c3457fe5b6020908102909101015161016001528851610c50908c90610acb565b9350610c938c86815181101515610c6357fe5b9060200190602002015160a001518d87815181101515610c7f57fe5b906020019060200201516080015186611099565b9250610cbf8c86815181101515610ca657fe5b90602001906020020151848c88815181101515610a3c57fe5b9150610ccb898361130d565b5087518a8110610cda57610ce5565b600190940193610bff565b8a811015610abc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123c7565b600080808066b1a2bc2ec50000861115610d65576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123f7565b610d6f888861104f565b935034841115610dab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612357565b610db53485610acb565b9250610dca86670de0b6b3a76400008a611099565b915082821115610e06576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123d7565b6000831115610f29576002546040517f2e1a7d4d00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911690632e1a7d4d90610e65908690600401612453565b600060405180830381600087803b158015610e7f57600080fd5b505af1158015610e93573d6000803e3d6000fd5b505050506000821115610ee55760405173ffffffffffffffffffffffffffffffffffffffff86169083156108fc029084906000818181858888f19350505050158015610ee3573d6000803e3d6000fd5b505b610eef8383610acb565b90506000811115610f2957604051339082156108fc029083906000818181858888f19350505050158015610f27573d6000803e3d6000fd5b505b5050505050505050565b6000610f45838263ffffffff61136f16565b604080517f4552433230546f6b656e28616464726573732900000000000000000000000000815290519081900360130190209091507fffffffff0000000000000000000000000000000000000000000000000000000080831691161415610fb557610fb083836113dc565b610383565b604080517f455243373231546f6b656e28616464726573732c75696e7432353629000000008152905190819003601c0190207fffffffff000000000000000000000000000000000000000000000000000000008281169116141561101d57610fb083836115ca565b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123a7565b60008282018381101561108e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612397565b8091505b5092915050565b60008083116110d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612387565b6110e76110e185846116b2565b8461170d565b90505b9392505050565b6110f96119a9565b60608060008060006111096119a9565b89600081518110151561111857fe5b6020908102919091018101516101400151600580546040805160026001841615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190931692909204601f8101869004860283018601909152808252929950929091908301828280156111d05780601f106111a5576101008083540402835291602001916111d0565b820191906000526020600020905b8154815290600101906020018083116111b357829003601f168201915b5050505050945089519350600092505b82841461128857858a848151811015156111f657fe5b602090810290910101516101400152895185908b908590811061121557fe5b906020019060200201516101600181905250611235898860200151610acb565b91506112618a8481518110151561124857fe5b90602001906020020151838a86815181101515610a3c57fe5b905061126d878261130d565b6020870151891161127d57611288565b6001909201916111e0565b5050505050509392505050565b61129d6119a9565b606060006112ac868686611724565b600154815191935073ffffffffffffffffffffffffffffffffffffffff1691506080908390602082016000855af1801561130357825184526020830151602085015260408301516040850152606083015160608501525b5050509392505050565b8151815161131b919061104f565b825260208083015190820151611331919061104f565b60208301526040808301519082015161134a919061104f565b604083015260608083015190820151611363919061104f565b60609092019190915250565b6000816004018351101515156113b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612417565b5001602001517fffffffff000000000000000000000000000000000000000000000000000000001690565b6000806113f084601063ffffffff6118f616565b604080517f7472616e7366657228616464726573732c75696e7432353629000000000000008152905190819003601901812091935073ffffffffffffffffffffffffffffffffffffffff8416919061144e903390879060240161231c565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009094169390931783525181519192909182919080838360005b838110156114f25781810151838201526020016114da565b50505050905090810190601f16801561151f5780820380516001836020036101000a031916815260200191505b509150506000604051808303816000865af19250505080151561156e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123b7565b3d1561158b575060003d6020141561158b5760206000803e506000515b8015156115c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123b7565b50505050565b60008060018314611607576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612427565b61161884601063ffffffff6118f616565b915061162b84602463ffffffff61195716565b6040517f23b872dd00000000000000000000000000000000000000000000000000000000815290915073ffffffffffffffffffffffffffffffffffffffff8316906323b872dd90611684903090339086906004016122f4565b600060405180830381600087803b15801561169e57600080fd5b505af1158015610f29573d6000803e3d6000fd5b6000808315156116c55760009150611092565b508282028284828115156116d557fe5b041461108e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612397565b600080828481151561171b57fe5b04949350505050565b604080517fb4be83d5000000000000000000000000000000000000000000000000000000006020808301919091526060602483018181528751608485019081528884015160a48601529488015160c48501529087015160e4840152608087015161010484015260a087015161012484015260c087015161014484015260e08701516101648401526101008701516101848401526101208701516101a4840152610140870180516101c485019081526101608901516101e4860152610180905251805161020485018190529394919384936044870192849261022489019291820191601f82010460005b8181101561182b57835185526020948501949093019260010161180d565b50505050818103610160808401919091528a0151805180835260209283019291820191601f82010460005b81811015611874578351855260209485019490930192600101611856565b50505089845250848103602093840190815288518083529093918201918981019190601f82010460005b818110156118bc57835185526020948501949093019260010161189e565b5050507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08883030188525060405250505050509392505050565b600081601401835110151515611938576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612407565b50016014015173ffffffffffffffffffffffffffffffffffffffff1690565b60006107ba83836000816020018351101515156119a0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612377565b50016020015190565b608060405190810160405280600081526020016000815260200160008152602001600081525090565b60006107ba82356124ef565b6000601f820183136119ef57600080fd5b8135611a026119fd82612488565b612461565b81815260209384019390925082018360005b83811015611a405781358601611a2a8882611af0565b8452506020928301929190910190600101611a14565b5050505092915050565b6000601f82018313611a5b57600080fd5b8135611a696119fd82612488565b81815260209384019390925082018360005b83811015611a405781358601611a918882611b3f565b8452506020928301929190910190600101611a7b565b600080601f83018413611ab957600080fd5b50813567ffffffffffffffff811115611ad157600080fd5b602083019150836001820283011115611ae957600080fd5b9250929050565b6000601f82018313611b0157600080fd5b8135611b0f6119fd826124a9565b91508082526020830160208301858383011115611b2b57600080fd5b611b3683828461250b565b50505092915050565b60006101808284031215611b5257600080fd5b611b5d610180612461565b90506000611b6b84846119d2565b8252506020611b7c848483016119d2565b6020830152506040611b90848285016119d2565b6040830152506060611ba4848285016119d2565b6060830152506080611bb884828501611c88565b60808301525060a0611bcc84828501611c88565b60a08301525060c0611be084828501611c88565b60c08301525060e0611bf484828501611c88565b60e083015250610100611c0984828501611c88565b61010083015250610120611c1f84828501611c88565b6101208301525061014082013567ffffffffffffffff811115611c4157600080fd5b611c4d84828501611af0565b6101408301525061016082013567ffffffffffffffff811115611c6f57600080fd5b611c7b84828501611af0565b6101608301525092915050565b60006107ba8235612508565b600060208284031215611ca657600080fd5b6000611cb284846119d2565b949350505050565b60008060008060008060c08789031215611cd357600080fd5b863567ffffffffffffffff811115611cea57600080fd5b611cf689828a01611a4a565b965050602087013567ffffffffffffffff811115611d1357600080fd5b611d1f89828a016119de565b955050604087013567ffffffffffffffff811115611d3c57600080fd5b611d4889828a01611a4a565b945050606087013567ffffffffffffffff811115611d6557600080fd5b611d7189828a016119de565b9350506080611d8289828a01611c88565b92505060a0611d9389828a016119d2565b9150509295509295509295565b600080600080600080600060e0888a031215611dbb57600080fd5b873567ffffffffffffffff811115611dd257600080fd5b611dde8a828b01611a4a565b9750506020611def8a828b01611c88565b965050604088013567ffffffffffffffff811115611e0c57600080fd5b611e188a828b016119de565b955050606088013567ffffffffffffffff811115611e3557600080fd5b611e418a828b01611a4a565b945050608088013567ffffffffffffffff811115611e5e57600080fd5b611e6a8a828b016119de565b93505060a0611e7b8a828b01611c88565b92505060c0611e8c8a828b016119d2565b91505092959891949750929550565b600080600060408486031215611eb057600080fd5b833567ffffffffffffffff811115611ec757600080fd5b611ed386828701611aa7565b93509350506020611ee686828701611c88565b9150509250925092565b611ef9816124ef565b82525050565b602381527f44454641554c545f46554e4354494f4e5f574554485f434f4e54524143545f4f60208201527f4e4c590000000000000000000000000000000000000000000000000000000000604082015260600190565b601181527f494e56414c49445f4d53475f56414c5545000000000000000000000000000000602082015260400190565b600d81527f4f564552534f4c445f5745544800000000000000000000000000000000000000602082015260400190565b601181527f55494e543235365f554e444552464c4f57000000000000000000000000000000602082015260400190565b602681527f475245415445525f4f525f455155414c5f544f5f33325f4c454e4754485f524560208201527f5155495245440000000000000000000000000000000000000000000000000000604082015260600190565b601081527f4449564953494f4e5f42595f5a45524f00000000000000000000000000000000602082015260400190565b601081527f55494e543235365f4f564552464c4f5700000000000000000000000000000000602082015260400190565b601781527f554e535550504f525445445f41535345545f50524f5859000000000000000000602082015260400190565b600f81527f5452414e534645525f4641494c45440000000000000000000000000000000000602082015260400190565b601481527f434f4d504c4554455f46494c4c5f4641494c4544000000000000000000000000602082015260400190565b601a81527f494e53554646494349454e545f4554485f52454d41494e494e47000000000000602082015260400190565b601381527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000602082015260400190565b601881527f4645455f50455243454e544147455f544f4f5f4c415247450000000000000000602082015260400190565b602681527f475245415445525f4f525f455155414c5f544f5f32305f4c454e4754485f524560208201527f5155495245440000000000000000000000000000000000000000000000000000604082015260600190565b602581527f475245415445525f4f525f455155414c5f544f5f345f4c454e4754485f52455160208201527f5549524544000000000000000000000000000000000000000000000000000000604082015260600190565b600e81527f494e56414c49445f414d4f554e54000000000000000000000000000000000000602082015260400190565b805160808301906122a884826122dd565b5060208201516122bb60208501826122dd565b5060408201516122ce60408501826122dd565b5060608201516115c460608501825b611ef981612508565b602081016107bd8284611ef0565b606081016123028286611ef0565b61230f6020830185611ef0565b611cb260408301846122dd565b6040810161232a8285611ef0565b6110ea60208301846122dd565b602080825281016107bd81611eff565b602080825281016107bd81611f55565b602080825281016107bd81611f85565b602080825281016107bd81611fb5565b602080825281016107bd81611fe5565b602080825281016107bd8161203b565b602080825281016107bd8161206b565b602080825281016107bd8161209b565b602080825281016107bd816120cb565b602080825281016107bd816120fb565b602080825281016107bd8161212b565b602080825281016107bd8161215b565b602080825281016107bd8161218b565b602080825281016107bd816121bb565b602080825281016107bd81612211565b602080825281016107bd81612267565b61010081016124468285612297565b6110ea6080830184612297565b602081016107bd82846122dd565b60405181810167ffffffffffffffff8111828210171561248057600080fd5b604052919050565b600067ffffffffffffffff82111561249f57600080fd5b5060209081020190565b600067ffffffffffffffff8211156124c057600080fd5b506020601f919091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0160190565b73ffffffffffffffffffffffffffffffffffffffff1690565b90565b828183375060009101525600a265627a7a72305820185af4a5e8525b0c20983bf22c09773a1cab3f704716cba4c8da3b112601cd666c6578706572696d656e74616cf50037",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x6C JUMPI PUSH4 0xFFFFFFFF PUSH29 0x100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD DIV AND PUSH4 0x18978E82 DUP2 EQ PUSH2 0xC8 JUMPI DUP1 PUSH4 0x630F1E6C EQ PUSH2 0xF2 JUMPI DUP1 PUSH4 0x8DA5CB5B EQ PUSH2 0x112 JUMPI DUP1 PUSH4 0x9395525C EQ PUSH2 0x134 JUMPI DUP1 PUSH4 0xF2FDE38B EQ PUSH2 0x147 JUMPI JUMPDEST PUSH1 0x2 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0xC6 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x2337 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST STOP JUMPDEST PUSH2 0xDB PUSH2 0xD6 CALLDATASIZE PUSH1 0x4 PUSH2 0x1DA0 JUMP JUMPDEST PUSH2 0x167 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xE9 SWAP3 SWAP2 SWAP1 PUSH2 0x2437 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xFE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xC6 PUSH2 0x10D CALLDATASIZE PUSH1 0x4 PUSH2 0x1E9B JUMP JUMPDEST PUSH2 0x2F7 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x11E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x127 PUSH2 0x388 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xE9 SWAP2 SWAP1 PUSH2 0x22E6 JUMP JUMPDEST PUSH2 0xDB PUSH2 0x142 CALLDATASIZE PUSH1 0x4 PUSH2 0x1CBA JUMP JUMPDEST PUSH2 0x3A4 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x153 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xC6 PUSH2 0x162 CALLDATASIZE PUSH1 0x4 PUSH2 0x1C94 JUMP JUMPDEST PUSH2 0x50A JUMP JUMPDEST PUSH2 0x16F PUSH2 0x19A9 JUMP JUMPDEST PUSH2 0x177 PUSH2 0x19A9 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x182 PUSH2 0x5BB JUMP JUMPDEST PUSH1 0x4 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 PUSH1 0x1F PUSH1 0x2 PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH2 0x100 PUSH1 0x1 DUP9 AND ISZERO MUL ADD SWAP1 SWAP6 AND SWAP5 SWAP1 SWAP5 DIV SWAP4 DUP5 ADD DUP2 SWAP1 DIV DUP2 MUL DUP3 ADD DUP2 ADD SWAP1 SWAP3 MSTORE DUP3 DUP2 MSTORE PUSH2 0x25C SWAP4 SWAP1 SWAP3 SWAP1 SWAP2 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0x22D JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x202 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x22D JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x210 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP DUP13 PUSH1 0x0 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x241 JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD MLOAD PUSH2 0x140 ADD MLOAD SWAP1 PUSH4 0xFFFFFFFF PUSH2 0x696 AND JUMP JUMPDEST ISZERO PUSH2 0x287 JUMPI PUSH2 0x26C DUP12 DUP12 DUP12 PUSH2 0x7C3 JUMP JUMPDEST SWAP4 POP PUSH2 0x280 DUP5 PUSH1 0x0 ADD MLOAD DUP6 PUSH1 0x60 ADD MLOAD PUSH2 0xACB JUMP JUMPDEST SWAP1 POP PUSH2 0x2AE JUMP JUMPDEST PUSH2 0x292 DUP12 DUP12 DUP12 PUSH2 0xB0D JUMP JUMPDEST SWAP4 POP DUP4 PUSH1 0x60 ADD MLOAD SWAP2 POP PUSH2 0x2A6 DUP9 DUP4 DUP10 PUSH2 0x7C3 JUMP JUMPDEST DUP5 MLOAD SWAP1 SWAP4 POP SWAP1 POP JUMPDEST PUSH2 0x2C2 DUP5 PUSH1 0x20 ADD MLOAD DUP5 PUSH1 0x20 ADD MLOAD DUP9 DUP9 PUSH2 0xD1F JUMP JUMPDEST PUSH2 0x2E9 DUP12 PUSH1 0x0 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x2D4 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x140 ADD MLOAD DUP3 PUSH2 0xF33 JUMP JUMPDEST POP POP SWAP8 POP SWAP8 SWAP6 POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0x348 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x23E7 JUMP JUMPDEST PUSH2 0x383 DUP4 DUP4 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY POP DUP8 SWAP5 POP PUSH2 0xF33 SWAP4 POP POP POP POP JUMP JUMPDEST POP POP POP JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH2 0x3AC PUSH2 0x19A9 JUMP JUMPDEST PUSH2 0x3B4 PUSH2 0x19A9 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH2 0x3C1 PUSH2 0x5BB JUMP JUMPDEST PUSH1 0x4 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 PUSH1 0x1F PUSH1 0x2 PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH2 0x100 PUSH1 0x1 DUP9 AND ISZERO MUL ADD SWAP1 SWAP6 AND SWAP5 SWAP1 SWAP5 DIV SWAP4 DUP5 ADD DUP2 SWAP1 DIV DUP2 MUL DUP3 ADD DUP2 ADD SWAP1 SWAP3 MSTORE DUP3 DUP2 MSTORE PUSH2 0x441 SWAP4 SWAP1 SWAP3 SWAP1 SWAP2 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0x22D JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x202 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x22D JUMP JUMPDEST ISZERO PUSH2 0x492 JUMPI PUSH2 0x46A PUSH8 0xDE0B6B3A7640000 PUSH2 0x464 PUSH8 0xDE0B6B3A7640000 DUP11 PUSH2 0x104F JUMP JUMPDEST CALLVALUE PUSH2 0x1099 JUMP JUMPDEST SWAP3 POP PUSH2 0x477 DUP12 DUP5 DUP13 PUSH2 0x10F1 JUMP JUMPDEST SWAP5 POP PUSH2 0x48B DUP6 PUSH1 0x0 ADD MLOAD DUP7 PUSH1 0x60 ADD MLOAD PUSH2 0xACB JUMP JUMPDEST SWAP1 POP PUSH2 0x4D6 JUMP JUMPDEST PUSH2 0x4AD PUSH8 0xD2F13F7789F0000 PUSH8 0xDE0B6B3A7640000 CALLVALUE PUSH2 0x1099 JUMP JUMPDEST SWAP3 POP PUSH2 0x4BA DUP12 DUP5 DUP13 PUSH2 0x10F1 JUMP JUMPDEST SWAP5 POP DUP5 PUSH1 0x60 ADD MLOAD SWAP2 POP PUSH2 0x4CE DUP10 DUP4 DUP11 PUSH2 0x7C3 JUMP JUMPDEST DUP6 MLOAD SWAP1 SWAP5 POP SWAP1 POP JUMPDEST PUSH2 0x4EA DUP6 PUSH1 0x20 ADD MLOAD DUP6 PUSH1 0x20 ADD MLOAD DUP10 DUP10 PUSH2 0xD1F JUMP JUMPDEST PUSH2 0x4FC DUP12 PUSH1 0x0 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x2D4 JUMPI INVALID JUMPDEST POP POP POP SWAP7 POP SWAP7 SWAP5 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0x55B JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x23E7 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND ISZERO PUSH2 0x5B8 JUMPI PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND OR SWAP1 SSTORE JUMPDEST POP JUMP JUMPDEST PUSH1 0x0 CALLVALUE GT PUSH2 0x5F5 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x2347 JUMP JUMPDEST PUSH1 0x2 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0xD0E30DB0 CALLVALUE PUSH1 0x40 MLOAD DUP3 PUSH4 0xFFFFFFFF AND PUSH29 0x100000000000000000000000000000000000000000000000000000000 MUL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP6 DUP9 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x67B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x68F JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD DUP4 MLOAD EQ DUP1 ISZERO PUSH2 0x7BA JUMPI POP DUP2 PUSH1 0x40 MLOAD DUP1 DUP3 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT PUSH2 0x6F2 JUMPI DUP1 MLOAD DUP3 MSTORE PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 SWAP1 SWAP3 ADD SWAP2 PUSH1 0x20 SWAP2 DUP3 ADD SWAP2 ADD PUSH2 0x6B5 JUMP JUMPDEST MLOAD DUP2 MLOAD PUSH1 0x20 SWAP4 DUP5 SUB PUSH2 0x100 EXP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD DUP1 NOT SWAP1 SWAP3 AND SWAP2 AND OR SWAP1 MSTORE PUSH1 0x40 MLOAD SWAP2 SWAP1 SWAP4 ADD DUP2 SWAP1 SUB DUP2 KECCAK256 DUP9 MLOAD SWAP1 SWAP6 POP DUP9 SWAP5 POP SWAP1 SWAP3 DUP4 SWAP3 POP DUP5 ADD SWAP1 DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT PUSH2 0x787 JUMPI DUP1 MLOAD DUP3 MSTORE PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 SWAP1 SWAP3 ADD SWAP2 PUSH1 0x20 SWAP2 DUP3 ADD SWAP2 ADD PUSH2 0x74A JUMP JUMPDEST PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB DUP1 NOT DUP3 MLOAD AND DUP2 DUP5 MLOAD AND DUP1 DUP3 OR DUP6 MSTORE POP POP POP POP POP POP SWAP1 POP ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 KECCAK256 PUSH1 0x0 NOT AND EQ JUMPDEST SWAP1 POP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x7CB PUSH2 0x19A9 JUMP JUMPDEST PUSH1 0x60 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 PUSH2 0x7DE PUSH2 0x19A9 JUMP JUMPDEST DUP11 ISZERO ISZERO PUSH2 0x7EA JUMPI PUSH2 0xABC JUMP JUMPDEST PUSH1 0x4 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 PUSH1 0x2 PUSH1 0x1 DUP6 AND ISZERO PUSH2 0x100 MUL PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 SWAP5 AND SWAP4 SWAP1 SWAP4 DIV PUSH1 0x1F DUP2 ADD DUP5 SWAP1 DIV DUP5 MUL DUP3 ADD DUP5 ADD SWAP1 SWAP3 MSTORE DUP2 DUP2 MSTORE SWAP3 SWAP2 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0x88E JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x863 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x88E JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x871 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP PUSH1 0x5 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 PUSH1 0x1F PUSH1 0x2 PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH2 0x100 PUSH1 0x1 DUP9 AND ISZERO MUL ADD SWAP1 SWAP6 AND SWAP5 SWAP1 SWAP5 DIV SWAP4 DUP5 ADD DUP2 SWAP1 DIV DUP2 MUL DUP3 ADD DUP2 ADD SWAP1 SWAP3 MSTORE DUP3 DUP2 MSTORE SWAP7 SWAP15 POP SWAP2 SWAP5 POP SWAP3 POP DUP5 ADD SWAP1 POP DUP3 DUP3 DUP1 ISZERO PUSH2 0x93D JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x912 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x93D JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x920 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP7 POP PUSH1 0x0 SWAP6 POP DUP12 MLOAD SWAP5 POP PUSH1 0x0 SWAP4 POP JUMPDEST DUP4 DUP6 EQ PUSH2 0xA82 JUMPI DUP8 DUP13 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x967 JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD MLOAD PUSH2 0x140 ADD MSTORE DUP12 MLOAD DUP8 SWAP1 DUP14 SWAP1 DUP7 SWAP1 DUP2 LT PUSH2 0x986 JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD MLOAD PUSH2 0x160 ADD MSTORE PUSH2 0x99F DUP12 DUP8 PUSH2 0xACB JUMP JUMPDEST SWAP3 POP PUSH2 0xA06 DUP13 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x9B2 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH1 0xA0 ADD MLOAD PUSH2 0xA00 DUP15 DUP8 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x9D1 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH1 0x80 ADD MLOAD DUP16 DUP9 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x9ED JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH1 0xE0 ADD MLOAD PUSH2 0xACB JUMP JUMPDEST DUP6 PUSH2 0x1099 JUMP JUMPDEST SWAP2 POP PUSH2 0xA4B DUP13 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xA19 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0xA2E DUP5 PUSH1 0x1 PUSH2 0x104F JUMP JUMPDEST DUP13 DUP8 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xA3C JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x1295 JUMP JUMPDEST SWAP1 POP PUSH2 0xA57 DUP10 DUP3 PUSH2 0x130D JUMP JUMPDEST PUSH2 0xA69 DUP10 PUSH1 0x0 ADD MLOAD DUP11 PUSH1 0x60 ADD MLOAD PUSH2 0xACB JUMP JUMPDEST SWAP6 POP DUP11 DUP7 LT PUSH2 0xA77 JUMPI PUSH2 0xA82 JUMP JUMPDEST PUSH1 0x1 SWAP1 SWAP4 ADD SWAP3 PUSH2 0x951 JUMP JUMPDEST DUP11 DUP7 LT ISZERO PUSH2 0xABC JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x23C7 JUMP JUMPDEST POP POP POP POP POP POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 GT ISZERO PUSH2 0xB07 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x2367 JUMP JUMPDEST POP SWAP1 SUB SWAP1 JUMP JUMPDEST PUSH2 0xB15 PUSH2 0x19A9 JUMP JUMPDEST PUSH1 0x60 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH2 0xB26 PUSH2 0x19A9 JUMP JUMPDEST PUSH1 0x0 DUP12 PUSH1 0x0 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xB37 JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP2 SWAP1 SWAP2 ADD DUP2 ADD MLOAD PUSH2 0x140 ADD MLOAD PUSH1 0x5 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x2 PUSH1 0x1 DUP5 AND ISZERO PUSH2 0x100 MUL PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 SWAP4 AND SWAP3 SWAP1 SWAP3 DIV PUSH1 0x1F DUP2 ADD DUP7 SWAP1 DIV DUP7 MUL DUP4 ADD DUP7 ADD SWAP1 SWAP2 MSTORE DUP1 DUP3 MSTORE SWAP3 SWAP12 POP SWAP3 SWAP1 SWAP2 SWAP1 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0xBEF JUMPI DUP1 PUSH1 0x1F LT PUSH2 0xBC4 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0xBEF JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0xBD2 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP7 POP DUP12 MLOAD SWAP6 POP PUSH1 0x0 SWAP5 POP JUMPDEST DUP5 DUP7 EQ PUSH2 0xCE5 JUMPI DUP8 DUP13 DUP7 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xC15 JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD MLOAD PUSH2 0x140 ADD MSTORE DUP12 MLOAD DUP8 SWAP1 DUP14 SWAP1 DUP8 SWAP1 DUP2 LT PUSH2 0xC34 JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD MLOAD PUSH2 0x160 ADD MSTORE DUP9 MLOAD PUSH2 0xC50 SWAP1 DUP13 SWAP1 PUSH2 0xACB JUMP JUMPDEST SWAP4 POP PUSH2 0xC93 DUP13 DUP7 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xC63 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH1 0xA0 ADD MLOAD DUP14 DUP8 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xC7F JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH1 0x80 ADD MLOAD DUP7 PUSH2 0x1099 JUMP JUMPDEST SWAP3 POP PUSH2 0xCBF DUP13 DUP7 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xCA6 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP5 DUP13 DUP9 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xA3C JUMPI INVALID JUMPDEST SWAP2 POP PUSH2 0xCCB DUP10 DUP4 PUSH2 0x130D JUMP JUMPDEST POP DUP8 MLOAD DUP11 DUP2 LT PUSH2 0xCDA JUMPI PUSH2 0xCE5 JUMP JUMPDEST PUSH1 0x1 SWAP1 SWAP5 ADD SWAP4 PUSH2 0xBFF JUMP JUMPDEST DUP11 DUP2 LT ISZERO PUSH2 0xABC JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x23C7 JUMP JUMPDEST PUSH1 0x0 DUP1 DUP1 DUP1 PUSH7 0xB1A2BC2EC50000 DUP7 GT ISZERO PUSH2 0xD65 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x23F7 JUMP JUMPDEST PUSH2 0xD6F DUP9 DUP9 PUSH2 0x104F JUMP JUMPDEST SWAP4 POP CALLVALUE DUP5 GT ISZERO PUSH2 0xDAB JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x2357 JUMP JUMPDEST PUSH2 0xDB5 CALLVALUE DUP6 PUSH2 0xACB JUMP JUMPDEST SWAP3 POP PUSH2 0xDCA DUP7 PUSH8 0xDE0B6B3A7640000 DUP11 PUSH2 0x1099 JUMP JUMPDEST SWAP2 POP DUP3 DUP3 GT ISZERO PUSH2 0xE06 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x23D7 JUMP JUMPDEST PUSH1 0x0 DUP4 GT ISZERO PUSH2 0xF29 JUMPI PUSH1 0x2 SLOAD PUSH1 0x40 MLOAD PUSH32 0x2E1A7D4D00000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP2 AND SWAP1 PUSH4 0x2E1A7D4D SWAP1 PUSH2 0xE65 SWAP1 DUP7 SWAP1 PUSH1 0x4 ADD PUSH2 0x2453 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0xE7F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0xE93 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x0 DUP3 GT ISZERO PUSH2 0xEE5 JUMPI PUSH1 0x40 MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP7 AND SWAP1 DUP4 ISZERO PUSH2 0x8FC MUL SWAP1 DUP5 SWAP1 PUSH1 0x0 DUP2 DUP2 DUP2 DUP6 DUP9 DUP9 CALL SWAP4 POP POP POP POP ISZERO DUP1 ISZERO PUSH2 0xEE3 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP JUMPDEST PUSH2 0xEEF DUP4 DUP4 PUSH2 0xACB JUMP JUMPDEST SWAP1 POP PUSH1 0x0 DUP2 GT ISZERO PUSH2 0xF29 JUMPI PUSH1 0x40 MLOAD CALLER SWAP1 DUP3 ISZERO PUSH2 0x8FC MUL SWAP1 DUP4 SWAP1 PUSH1 0x0 DUP2 DUP2 DUP2 DUP6 DUP9 DUP9 CALL SWAP4 POP POP POP POP ISZERO DUP1 ISZERO PUSH2 0xF27 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP JUMPDEST POP POP POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0xF45 DUP4 DUP3 PUSH4 0xFFFFFFFF PUSH2 0x136F AND JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0x4552433230546F6B656E28616464726573732900000000000000000000000000 DUP2 MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x13 ADD SWAP1 KECCAK256 SWAP1 SWAP2 POP PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 DUP1 DUP4 AND SWAP2 AND EQ ISZERO PUSH2 0xFB5 JUMPI PUSH2 0xFB0 DUP4 DUP4 PUSH2 0x13DC JUMP JUMPDEST PUSH2 0x383 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0x455243373231546F6B656E28616464726573732C75696E743235362900000000 DUP2 MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x1C ADD SWAP1 KECCAK256 PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 DUP3 DUP2 AND SWAP2 AND EQ ISZERO PUSH2 0x101D JUMPI PUSH2 0xFB0 DUP4 DUP4 PUSH2 0x15CA JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x23A7 JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 ADD DUP4 DUP2 LT ISZERO PUSH2 0x108E JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x2397 JUMP JUMPDEST DUP1 SWAP2 POP JUMPDEST POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP4 GT PUSH2 0x10D4 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x2387 JUMP JUMPDEST PUSH2 0x10E7 PUSH2 0x10E1 DUP6 DUP5 PUSH2 0x16B2 JUMP JUMPDEST DUP5 PUSH2 0x170D JUMP JUMPDEST SWAP1 POP JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH2 0x10F9 PUSH2 0x19A9 JUMP JUMPDEST PUSH1 0x60 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 PUSH2 0x1109 PUSH2 0x19A9 JUMP JUMPDEST DUP10 PUSH1 0x0 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1118 JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP2 SWAP1 SWAP2 ADD DUP2 ADD MLOAD PUSH2 0x140 ADD MLOAD PUSH1 0x5 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x2 PUSH1 0x1 DUP5 AND ISZERO PUSH2 0x100 MUL PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 SWAP4 AND SWAP3 SWAP1 SWAP3 DIV PUSH1 0x1F DUP2 ADD DUP7 SWAP1 DIV DUP7 MUL DUP4 ADD DUP7 ADD SWAP1 SWAP2 MSTORE DUP1 DUP3 MSTORE SWAP3 SWAP10 POP SWAP3 SWAP1 SWAP2 SWAP1 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0x11D0 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x11A5 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x11D0 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x11B3 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP5 POP DUP10 MLOAD SWAP4 POP PUSH1 0x0 SWAP3 POP JUMPDEST DUP3 DUP5 EQ PUSH2 0x1288 JUMPI DUP6 DUP11 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x11F6 JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD MLOAD PUSH2 0x140 ADD MSTORE DUP10 MLOAD DUP6 SWAP1 DUP12 SWAP1 DUP6 SWAP1 DUP2 LT PUSH2 0x1215 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x160 ADD DUP2 SWAP1 MSTORE POP PUSH2 0x1235 DUP10 DUP9 PUSH1 0x20 ADD MLOAD PUSH2 0xACB JUMP JUMPDEST SWAP2 POP PUSH2 0x1261 DUP11 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1248 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP4 DUP11 DUP7 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xA3C JUMPI INVALID JUMPDEST SWAP1 POP PUSH2 0x126D DUP8 DUP3 PUSH2 0x130D JUMP JUMPDEST PUSH1 0x20 DUP8 ADD MLOAD DUP10 GT PUSH2 0x127D JUMPI PUSH2 0x1288 JUMP JUMPDEST PUSH1 0x1 SWAP1 SWAP3 ADD SWAP2 PUSH2 0x11E0 JUMP JUMPDEST POP POP POP POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH2 0x129D PUSH2 0x19A9 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x0 PUSH2 0x12AC DUP7 DUP7 DUP7 PUSH2 0x1724 JUMP JUMPDEST PUSH1 0x1 SLOAD DUP2 MLOAD SWAP2 SWAP4 POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP2 POP PUSH1 0x80 SWAP1 DUP4 SWAP1 PUSH1 0x20 DUP3 ADD PUSH1 0x0 DUP6 GAS CALL DUP1 ISZERO PUSH2 0x1303 JUMPI DUP3 MLOAD DUP5 MSTORE PUSH1 0x20 DUP4 ADD MLOAD PUSH1 0x20 DUP6 ADD MSTORE PUSH1 0x40 DUP4 ADD MLOAD PUSH1 0x40 DUP6 ADD MSTORE PUSH1 0x60 DUP4 ADD MLOAD PUSH1 0x60 DUP6 ADD MSTORE JUMPDEST POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST DUP2 MLOAD DUP2 MLOAD PUSH2 0x131B SWAP2 SWAP1 PUSH2 0x104F JUMP JUMPDEST DUP3 MSTORE PUSH1 0x20 DUP1 DUP4 ADD MLOAD SWAP1 DUP3 ADD MLOAD PUSH2 0x1331 SWAP2 SWAP1 PUSH2 0x104F JUMP JUMPDEST PUSH1 0x20 DUP4 ADD MSTORE PUSH1 0x40 DUP1 DUP4 ADD MLOAD SWAP1 DUP3 ADD MLOAD PUSH2 0x134A SWAP2 SWAP1 PUSH2 0x104F JUMP JUMPDEST PUSH1 0x40 DUP4 ADD MSTORE PUSH1 0x60 DUP1 DUP4 ADD MLOAD SWAP1 DUP3 ADD MLOAD PUSH2 0x1363 SWAP2 SWAP1 PUSH2 0x104F JUMP JUMPDEST PUSH1 0x60 SWAP1 SWAP3 ADD SWAP2 SWAP1 SWAP2 MSTORE POP JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x4 ADD DUP4 MLOAD LT ISZERO ISZERO ISZERO PUSH2 0x13B1 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x2417 JUMP JUMPDEST POP ADD PUSH1 0x20 ADD MLOAD PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 AND SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x13F0 DUP5 PUSH1 0x10 PUSH4 0xFFFFFFFF PUSH2 0x18F6 AND JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0x7472616E7366657228616464726573732C75696E743235362900000000000000 DUP2 MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x19 ADD DUP2 KECCAK256 SWAP2 SWAP4 POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND SWAP2 SWAP1 PUSH2 0x144E SWAP1 CALLER SWAP1 DUP8 SWAP1 PUSH1 0x24 ADD PUSH2 0x231C JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 DUP2 DUP5 SUB ADD DUP2 MSTORE SWAP2 DUP2 MSTORE PUSH1 0x20 DUP3 ADD DUP1 MLOAD PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 SWAP1 SWAP5 AND SWAP4 SWAP1 SWAP4 OR DUP4 MSTORE MLOAD DUP2 MLOAD SWAP2 SWAP3 SWAP1 SWAP2 DUP3 SWAP2 SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x14F2 JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH2 0x14DA JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x151F JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP2 POP POP PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP7 GAS CALL SWAP3 POP POP POP DUP1 ISZERO ISZERO PUSH2 0x156E JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x23B7 JUMP JUMPDEST RETURNDATASIZE ISZERO PUSH2 0x158B JUMPI POP PUSH1 0x0 RETURNDATASIZE PUSH1 0x20 EQ ISZERO PUSH2 0x158B JUMPI PUSH1 0x20 PUSH1 0x0 DUP1 RETURNDATACOPY POP PUSH1 0x0 MLOAD JUMPDEST DUP1 ISZERO ISZERO PUSH2 0x15C4 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x23B7 JUMP JUMPDEST POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x1 DUP4 EQ PUSH2 0x1607 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x2427 JUMP JUMPDEST PUSH2 0x1618 DUP5 PUSH1 0x10 PUSH4 0xFFFFFFFF PUSH2 0x18F6 AND JUMP JUMPDEST SWAP2 POP PUSH2 0x162B DUP5 PUSH1 0x24 PUSH4 0xFFFFFFFF PUSH2 0x1957 AND JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH32 0x23B872DD00000000000000000000000000000000000000000000000000000000 DUP2 MSTORE SWAP1 SWAP2 POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND SWAP1 PUSH4 0x23B872DD SWAP1 PUSH2 0x1684 SWAP1 ADDRESS SWAP1 CALLER SWAP1 DUP7 SWAP1 PUSH1 0x4 ADD PUSH2 0x22F4 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x169E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0xF29 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST PUSH1 0x0 DUP1 DUP4 ISZERO ISZERO PUSH2 0x16C5 JUMPI PUSH1 0x0 SWAP2 POP PUSH2 0x1092 JUMP JUMPDEST POP DUP3 DUP3 MUL DUP3 DUP5 DUP3 DUP2 ISZERO ISZERO PUSH2 0x16D5 JUMPI INVALID JUMPDEST DIV EQ PUSH2 0x108E JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x2397 JUMP JUMPDEST PUSH1 0x0 DUP1 DUP3 DUP5 DUP2 ISZERO ISZERO PUSH2 0x171B JUMPI INVALID JUMPDEST DIV SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0xB4BE83D500000000000000000000000000000000000000000000000000000000 PUSH1 0x20 DUP1 DUP4 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x60 PUSH1 0x24 DUP4 ADD DUP2 DUP2 MSTORE DUP8 MLOAD PUSH1 0x84 DUP6 ADD SWAP1 DUP2 MSTORE DUP9 DUP5 ADD MLOAD PUSH1 0xA4 DUP7 ADD MSTORE SWAP5 DUP9 ADD MLOAD PUSH1 0xC4 DUP6 ADD MSTORE SWAP1 DUP8 ADD MLOAD PUSH1 0xE4 DUP5 ADD MSTORE PUSH1 0x80 DUP8 ADD MLOAD PUSH2 0x104 DUP5 ADD MSTORE PUSH1 0xA0 DUP8 ADD MLOAD PUSH2 0x124 DUP5 ADD MSTORE PUSH1 0xC0 DUP8 ADD MLOAD PUSH2 0x144 DUP5 ADD MSTORE PUSH1 0xE0 DUP8 ADD MLOAD PUSH2 0x164 DUP5 ADD MSTORE PUSH2 0x100 DUP8 ADD MLOAD PUSH2 0x184 DUP5 ADD MSTORE PUSH2 0x120 DUP8 ADD MLOAD PUSH2 0x1A4 DUP5 ADD MSTORE PUSH2 0x140 DUP8 ADD DUP1 MLOAD PUSH2 0x1C4 DUP6 ADD SWAP1 DUP2 MSTORE PUSH2 0x160 DUP10 ADD MLOAD PUSH2 0x1E4 DUP7 ADD MSTORE PUSH2 0x180 SWAP1 MSTORE MLOAD DUP1 MLOAD PUSH2 0x204 DUP6 ADD DUP2 SWAP1 MSTORE SWAP4 SWAP5 SWAP2 SWAP4 DUP5 SWAP4 PUSH1 0x44 DUP8 ADD SWAP3 DUP5 SWAP3 PUSH2 0x224 DUP10 ADD SWAP3 SWAP2 DUP3 ADD SWAP2 PUSH1 0x1F DUP3 ADD DIV PUSH1 0x0 JUMPDEST DUP2 DUP2 LT ISZERO PUSH2 0x182B JUMPI DUP4 MLOAD DUP6 MSTORE PUSH1 0x20 SWAP5 DUP6 ADD SWAP5 SWAP1 SWAP4 ADD SWAP3 PUSH1 0x1 ADD PUSH2 0x180D JUMP JUMPDEST POP POP POP POP DUP2 DUP2 SUB PUSH2 0x160 DUP1 DUP5 ADD SWAP2 SWAP1 SWAP2 MSTORE DUP11 ADD MLOAD DUP1 MLOAD DUP1 DUP4 MSTORE PUSH1 0x20 SWAP3 DUP4 ADD SWAP3 SWAP2 DUP3 ADD SWAP2 PUSH1 0x1F DUP3 ADD DIV PUSH1 0x0 JUMPDEST DUP2 DUP2 LT ISZERO PUSH2 0x1874 JUMPI DUP4 MLOAD DUP6 MSTORE PUSH1 0x20 SWAP5 DUP6 ADD SWAP5 SWAP1 SWAP4 ADD SWAP3 PUSH1 0x1 ADD PUSH2 0x1856 JUMP JUMPDEST POP POP POP DUP10 DUP5 MSTORE POP DUP5 DUP2 SUB PUSH1 0x20 SWAP4 DUP5 ADD SWAP1 DUP2 MSTORE DUP9 MLOAD DUP1 DUP4 MSTORE SWAP1 SWAP4 SWAP2 DUP3 ADD SWAP2 DUP10 DUP2 ADD SWAP2 SWAP1 PUSH1 0x1F DUP3 ADD DIV PUSH1 0x0 JUMPDEST DUP2 DUP2 LT ISZERO PUSH2 0x18BC JUMPI DUP4 MLOAD DUP6 MSTORE PUSH1 0x20 SWAP5 DUP6 ADD SWAP5 SWAP1 SWAP4 ADD SWAP3 PUSH1 0x1 ADD PUSH2 0x189E JUMP JUMPDEST POP POP POP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 DUP9 DUP4 SUB ADD DUP9 MSTORE POP PUSH1 0x40 MSTORE POP POP POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x14 ADD DUP4 MLOAD LT ISZERO ISZERO ISZERO PUSH2 0x1938 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x2407 JUMP JUMPDEST POP ADD PUSH1 0x14 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x7BA DUP4 DUP4 PUSH1 0x0 DUP2 PUSH1 0x20 ADD DUP4 MLOAD LT ISZERO ISZERO ISZERO PUSH2 0x19A0 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x2377 JUMP JUMPDEST POP ADD PUSH1 0x20 ADD MLOAD SWAP1 JUMP JUMPDEST PUSH1 0x80 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE POP SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x7BA DUP3 CALLDATALOAD PUSH2 0x24EF JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH2 0x19EF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0x1A02 PUSH2 0x19FD DUP3 PUSH2 0x2488 JUMP JUMPDEST PUSH2 0x2461 JUMP JUMPDEST DUP2 DUP2 MSTORE PUSH1 0x20 SWAP4 DUP5 ADD SWAP4 SWAP1 SWAP3 POP DUP3 ADD DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x1A40 JUMPI DUP2 CALLDATALOAD DUP7 ADD PUSH2 0x1A2A DUP9 DUP3 PUSH2 0x1AF0 JUMP JUMPDEST DUP5 MSTORE POP PUSH1 0x20 SWAP3 DUP4 ADD SWAP3 SWAP2 SWAP1 SWAP2 ADD SWAP1 PUSH1 0x1 ADD PUSH2 0x1A14 JUMP JUMPDEST POP POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH2 0x1A5B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0x1A69 PUSH2 0x19FD DUP3 PUSH2 0x2488 JUMP JUMPDEST DUP2 DUP2 MSTORE PUSH1 0x20 SWAP4 DUP5 ADD SWAP4 SWAP1 SWAP3 POP DUP3 ADD DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x1A40 JUMPI DUP2 CALLDATALOAD DUP7 ADD PUSH2 0x1A91 DUP9 DUP3 PUSH2 0x1B3F JUMP JUMPDEST DUP5 MSTORE POP PUSH1 0x20 SWAP3 DUP4 ADD SWAP3 SWAP2 SWAP1 SWAP2 ADD SWAP1 PUSH1 0x1 ADD PUSH2 0x1A7B JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x1F DUP4 ADD DUP5 SGT PUSH2 0x1AB9 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP DUP2 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1AD1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x20 DUP4 ADD SWAP2 POP DUP4 PUSH1 0x1 DUP3 MUL DUP4 ADD GT ISZERO PUSH2 0x1AE9 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH2 0x1B01 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0x1B0F PUSH2 0x19FD DUP3 PUSH2 0x24A9 JUMP JUMPDEST SWAP2 POP DUP1 DUP3 MSTORE PUSH1 0x20 DUP4 ADD PUSH1 0x20 DUP4 ADD DUP6 DUP4 DUP4 ADD GT ISZERO PUSH2 0x1B2B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1B36 DUP4 DUP3 DUP5 PUSH2 0x250B JUMP JUMPDEST POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x180 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x1B52 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1B5D PUSH2 0x180 PUSH2 0x2461 JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0x1B6B DUP5 DUP5 PUSH2 0x19D2 JUMP JUMPDEST DUP3 MSTORE POP PUSH1 0x20 PUSH2 0x1B7C DUP5 DUP5 DUP4 ADD PUSH2 0x19D2 JUMP JUMPDEST PUSH1 0x20 DUP4 ADD MSTORE POP PUSH1 0x40 PUSH2 0x1B90 DUP5 DUP3 DUP6 ADD PUSH2 0x19D2 JUMP JUMPDEST PUSH1 0x40 DUP4 ADD MSTORE POP PUSH1 0x60 PUSH2 0x1BA4 DUP5 DUP3 DUP6 ADD PUSH2 0x19D2 JUMP JUMPDEST PUSH1 0x60 DUP4 ADD MSTORE POP PUSH1 0x80 PUSH2 0x1BB8 DUP5 DUP3 DUP6 ADD PUSH2 0x1C88 JUMP JUMPDEST PUSH1 0x80 DUP4 ADD MSTORE POP PUSH1 0xA0 PUSH2 0x1BCC DUP5 DUP3 DUP6 ADD PUSH2 0x1C88 JUMP JUMPDEST PUSH1 0xA0 DUP4 ADD MSTORE POP PUSH1 0xC0 PUSH2 0x1BE0 DUP5 DUP3 DUP6 ADD PUSH2 0x1C88 JUMP JUMPDEST PUSH1 0xC0 DUP4 ADD MSTORE POP PUSH1 0xE0 PUSH2 0x1BF4 DUP5 DUP3 DUP6 ADD PUSH2 0x1C88 JUMP JUMPDEST PUSH1 0xE0 DUP4 ADD MSTORE POP PUSH2 0x100 PUSH2 0x1C09 DUP5 DUP3 DUP6 ADD PUSH2 0x1C88 JUMP JUMPDEST PUSH2 0x100 DUP4 ADD MSTORE POP PUSH2 0x120 PUSH2 0x1C1F DUP5 DUP3 DUP6 ADD PUSH2 0x1C88 JUMP JUMPDEST PUSH2 0x120 DUP4 ADD MSTORE POP PUSH2 0x140 DUP3 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1C41 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1C4D DUP5 DUP3 DUP6 ADD PUSH2 0x1AF0 JUMP JUMPDEST PUSH2 0x140 DUP4 ADD MSTORE POP PUSH2 0x160 DUP3 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1C6F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1C7B DUP5 DUP3 DUP6 ADD PUSH2 0x1AF0 JUMP JUMPDEST PUSH2 0x160 DUP4 ADD MSTORE POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x7BA DUP3 CALLDATALOAD PUSH2 0x2508 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x1CA6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1CB2 DUP5 DUP5 PUSH2 0x19D2 JUMP JUMPDEST SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0xC0 DUP8 DUP10 SUB SLT ISZERO PUSH2 0x1CD3 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP7 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1CEA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1CF6 DUP10 DUP3 DUP11 ADD PUSH2 0x1A4A JUMP JUMPDEST SWAP7 POP POP PUSH1 0x20 DUP8 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1D13 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1D1F DUP10 DUP3 DUP11 ADD PUSH2 0x19DE JUMP JUMPDEST SWAP6 POP POP PUSH1 0x40 DUP8 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1D3C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1D48 DUP10 DUP3 DUP11 ADD PUSH2 0x1A4A JUMP JUMPDEST SWAP5 POP POP PUSH1 0x60 DUP8 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1D65 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1D71 DUP10 DUP3 DUP11 ADD PUSH2 0x19DE JUMP JUMPDEST SWAP4 POP POP PUSH1 0x80 PUSH2 0x1D82 DUP10 DUP3 DUP11 ADD PUSH2 0x1C88 JUMP JUMPDEST SWAP3 POP POP PUSH1 0xA0 PUSH2 0x1D93 DUP10 DUP3 DUP11 ADD PUSH2 0x19D2 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP6 POP SWAP3 SWAP6 POP SWAP3 SWAP6 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0xE0 DUP9 DUP11 SUB SLT ISZERO PUSH2 0x1DBB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP8 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1DD2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1DDE DUP11 DUP3 DUP12 ADD PUSH2 0x1A4A JUMP JUMPDEST SWAP8 POP POP PUSH1 0x20 PUSH2 0x1DEF DUP11 DUP3 DUP12 ADD PUSH2 0x1C88 JUMP JUMPDEST SWAP7 POP POP PUSH1 0x40 DUP9 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1E0C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1E18 DUP11 DUP3 DUP12 ADD PUSH2 0x19DE JUMP JUMPDEST SWAP6 POP POP PUSH1 0x60 DUP9 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1E35 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1E41 DUP11 DUP3 DUP12 ADD PUSH2 0x1A4A JUMP JUMPDEST SWAP5 POP POP PUSH1 0x80 DUP9 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1E5E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1E6A DUP11 DUP3 DUP12 ADD PUSH2 0x19DE JUMP JUMPDEST SWAP4 POP POP PUSH1 0xA0 PUSH2 0x1E7B DUP11 DUP3 DUP12 ADD PUSH2 0x1C88 JUMP JUMPDEST SWAP3 POP POP PUSH1 0xC0 PUSH2 0x1E8C DUP11 DUP3 DUP12 ADD PUSH2 0x19D2 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP6 SWAP9 SWAP2 SWAP5 SWAP8 POP SWAP3 SWAP6 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x40 DUP5 DUP7 SUB SLT ISZERO PUSH2 0x1EB0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP4 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1EC7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1ED3 DUP7 DUP3 DUP8 ADD PUSH2 0x1AA7 JUMP JUMPDEST SWAP4 POP SWAP4 POP POP PUSH1 0x20 PUSH2 0x1EE6 DUP7 DUP3 DUP8 ADD PUSH2 0x1C88 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 POP SWAP3 JUMP JUMPDEST PUSH2 0x1EF9 DUP2 PUSH2 0x24EF JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x23 DUP2 MSTORE PUSH32 0x44454641554C545F46554E4354494F4E5F574554485F434F4E54524143545F4F PUSH1 0x20 DUP3 ADD MSTORE PUSH32 0x4E4C590000000000000000000000000000000000000000000000000000000000 PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x60 ADD SWAP1 JUMP JUMPDEST PUSH1 0x11 DUP2 MSTORE PUSH32 0x494E56414C49445F4D53475F56414C5545000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0xD DUP2 MSTORE PUSH32 0x4F564552534F4C445F5745544800000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x11 DUP2 MSTORE PUSH32 0x55494E543235365F554E444552464C4F57000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x26 DUP2 MSTORE PUSH32 0x475245415445525F4F525F455155414C5F544F5F33325F4C454E4754485F5245 PUSH1 0x20 DUP3 ADD MSTORE PUSH32 0x5155495245440000000000000000000000000000000000000000000000000000 PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x60 ADD SWAP1 JUMP JUMPDEST PUSH1 0x10 DUP2 MSTORE PUSH32 0x4449564953494F4E5F42595F5A45524F00000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x10 DUP2 MSTORE PUSH32 0x55494E543235365F4F564552464C4F5700000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x17 DUP2 MSTORE PUSH32 0x554E535550504F525445445F41535345545F50524F5859000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0xF DUP2 MSTORE PUSH32 0x5452414E534645525F4641494C45440000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x14 DUP2 MSTORE PUSH32 0x434F4D504C4554455F46494C4C5F4641494C4544000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x1A DUP2 MSTORE PUSH32 0x494E53554646494349454E545F4554485F52454D41494E494E47000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x13 DUP2 MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x18 DUP2 MSTORE PUSH32 0x4645455F50455243454E544147455F544F4F5F4C415247450000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x26 DUP2 MSTORE PUSH32 0x475245415445525F4F525F455155414C5F544F5F32305F4C454E4754485F5245 PUSH1 0x20 DUP3 ADD MSTORE PUSH32 0x5155495245440000000000000000000000000000000000000000000000000000 PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x60 ADD SWAP1 JUMP JUMPDEST PUSH1 0x25 DUP2 MSTORE PUSH32 0x475245415445525F4F525F455155414C5F544F5F345F4C454E4754485F524551 PUSH1 0x20 DUP3 ADD MSTORE PUSH32 0x5549524544000000000000000000000000000000000000000000000000000000 PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x60 ADD SWAP1 JUMP JUMPDEST PUSH1 0xE DUP2 MSTORE PUSH32 0x494E56414C49445F414D4F554E54000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST DUP1 MLOAD PUSH1 0x80 DUP4 ADD SWAP1 PUSH2 0x22A8 DUP5 DUP3 PUSH2 0x22DD JUMP JUMPDEST POP PUSH1 0x20 DUP3 ADD MLOAD PUSH2 0x22BB PUSH1 0x20 DUP6 ADD DUP3 PUSH2 0x22DD JUMP JUMPDEST POP PUSH1 0x40 DUP3 ADD MLOAD PUSH2 0x22CE PUSH1 0x40 DUP6 ADD DUP3 PUSH2 0x22DD JUMP JUMPDEST POP PUSH1 0x60 DUP3 ADD MLOAD PUSH2 0x15C4 PUSH1 0x60 DUP6 ADD DUP3 JUMPDEST PUSH2 0x1EF9 DUP2 PUSH2 0x2508 JUMP JUMPDEST PUSH1 0x20 DUP2 ADD PUSH2 0x7BD DUP3 DUP5 PUSH2 0x1EF0 JUMP JUMPDEST PUSH1 0x60 DUP2 ADD PUSH2 0x2302 DUP3 DUP7 PUSH2 0x1EF0 JUMP JUMPDEST PUSH2 0x230F PUSH1 0x20 DUP4 ADD DUP6 PUSH2 0x1EF0 JUMP JUMPDEST PUSH2 0x1CB2 PUSH1 0x40 DUP4 ADD DUP5 PUSH2 0x22DD JUMP JUMPDEST PUSH1 0x40 DUP2 ADD PUSH2 0x232A DUP3 DUP6 PUSH2 0x1EF0 JUMP JUMPDEST PUSH2 0x10EA PUSH1 0x20 DUP4 ADD DUP5 PUSH2 0x22DD JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x1EFF JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x1F55 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x1F85 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x1FB5 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x1FE5 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x203B JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x206B JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x209B JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x20CB JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x20FB JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x212B JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x215B JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x218B JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x21BB JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x2211 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x2267 JUMP JUMPDEST PUSH2 0x100 DUP2 ADD PUSH2 0x2446 DUP3 DUP6 PUSH2 0x2297 JUMP JUMPDEST PUSH2 0x10EA PUSH1 0x80 DUP4 ADD DUP5 PUSH2 0x2297 JUMP JUMPDEST PUSH1 0x20 DUP2 ADD PUSH2 0x7BD DUP3 DUP5 PUSH2 0x22DD JUMP JUMPDEST PUSH1 0x40 MLOAD DUP2 DUP2 ADD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT DUP3 DUP3 LT OR ISZERO PUSH2 0x2480 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x40 MSTORE SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH8 0xFFFFFFFFFFFFFFFF DUP3 GT ISZERO PUSH2 0x249F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x20 SWAP1 DUP2 MUL ADD SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH8 0xFFFFFFFFFFFFFFFF DUP3 GT ISZERO PUSH2 0x24C0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x20 PUSH1 0x1F SWAP2 SWAP1 SWAP2 ADD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 AND ADD SWAP1 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 JUMP JUMPDEST SWAP1 JUMP JUMPDEST DUP3 DUP2 DUP4 CALLDATACOPY POP PUSH1 0x0 SWAP2 ADD MSTORE JUMP STOP LOG2 PUSH6 0x627A7A723058 KECCAK256 XOR GAS DELEGATECALL 0xa5 0xe8 MSTORE JUMPDEST 0xc KECCAK256 SWAP9 EXTCODESIZE CALLCODE 0x2c MULMOD PUSH24 0x3A1CAB3F704716CBA4C8DA3B112601CD666C657870657269 PUSH14 0x656E74616CF50037000000000000 ",
- "sourceMap": "836:407:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;962:11:4;;;;940:10;:34;919:116;;;;;;;;;;;;;;;;;;;;;;836:407:0;6574:2360:3;;;;;;;;;;;;;;;;;;;;;;;;;;;1490:174:1;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1490:174:1;;;;;;;;;91:20:63;;8:9:-1;5:2;;;30:1;27;20:12;5:2;91:20:63;;;;;;;;;;;;2756:2751:3;;;;;;;;;;333:167:63;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;333:167:63;;;;;;;;;6574:2360:3;6929:35;;:::i;:::-;6978:38;;:::i;:::-;7102:20;7132:33;7073:18;:16;:18::i;:::-;7211:14;7179:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7211:14;;7179:47;;7211:14;7179:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:6;7186:1;7179:9;;;;;;;;;;;;;;;;;;;:24;;;;:47;:31;:47;:::i;:::-;7175:1275;;;7440:129;7483:6;7507:20;7545:10;7440:25;:129::i;:::-;7421:148;;7701:79;7709:16;:39;;;7750:16;:29;;;7701:7;:79::i;:::-;7673:107;;7175:1275;;;7958:132;8004:6;8028:20;8066:10;7958:28;:132::i;:::-;7939:151;;8166:16;:29;;;8151:44;;8231:127;8274:9;8301:12;8331:13;8231:25;:127::i;:::-;8400:39;;8209:149;;-1:-1:-1;8400:39:3;-1:-1:-1;7175:1275:3;8595:195;8632:16;:39;;;8685:19;:42;;;8741:13;8768:12;8595:23;:195::i;:::-;8853:74;8875:6;8882:1;8875:9;;;;;;;;;;;;;;;;;;:24;;;8901:25;8853:21;:74::i;:::-;6574:2360;;;;;;;;;;;;:::o;1490:174:1:-;259:5:63;;;;245:10;:19;224:85;;;;;;;;;;;;;;1617:40:1;1639:9;;1617:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1650:6:1;;-1:-1:-1;1617:21:1;;-1:-1:-1;;;;1617:40:1:i;:::-;1490:174;;;:::o;91:20:63:-;;;;;;:::o;2756:2751:3:-;3074:35;;:::i;:::-;3123:38;;:::i;:::-;3247:22;3279:20;3309:33;3218:18;:16;:18::i;:::-;3388:14;3356:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3388:14;;3356:47;;3388:14;3356:47;;;;;;;;;;;;;;;;;;;;;;;;;3352:1671;;;3509:166;1170:6:7;3588:46:3;1170:6:7;3620:13:3;3588:7;:46::i;:::-;3652:9;3509:21;:166::i;:::-;3492:183;;3814:112;3846:6;3870:14;3902:10;3814:14;:112::i;:::-;3795:131;;4058:79;4066:16;:39;;;4107:16;:29;;;4058:7;:79::i;:::-;4030:107;;3352:1671;;;4270:144;1335:33:7;1170:6;4391:9:3;4270:21;:144::i;:::-;4253:161;;4551:112;4583:6;4607:14;4639:10;4551:14;:112::i;:::-;4532:131;;4739:16;:29;;;4724:44;;4804:127;4847:9;4874:12;4904:13;4804:25;:127::i;:::-;4973:39;;4782:149;;-1:-1:-1;4973:39:3;-1:-1:-1;3352:1671:3;5168:195;5205:16;:39;;;5258:19;:42;;;5314:13;5341:12;5168:23;:195::i;:::-;5426:74;5448:6;5455:1;5448:9;;;;;;;;;5426:74;2756:2751;;;;;;;;;;;;:::o;333:167:63:-;259:5;;;;245:10;:19;224:85;;;;;;;;;;;;;;429:22;;;;425:69;;467:5;:16;;;;;;;;;;425:69;333:167;:::o;1106:191:4:-;1198:1;1186:9;:13;1165:77;;;;;;;;;;;;;;1252:11;;;;;;;;;;;:19;;;1278:9;1252:38;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1252:38:4;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1252:38:4;;;;;1106:191::o;9651:403:61:-;9772:10;10001:3;:10;9987:3;:10;:24;:60;;;;;10043:3;10033:14;;;;;;;;;;;;;36:153:-1;66:2;58:11;;36:153;;176:10;;164:23;;139:12;;;;;98:2;89:12;;;;114;36:153;;;299:10;344;;263:2;259:12;;;254:3;250:22;246:30;;311:9;;295:26;;;340:21;;377:20;365:33;;10033:14:61;;;;;;;;;;;10015;;10033;;-1:-1:-1;10015:14:61;;-1:-1:-1;10033:14:61;;;;-1:-1:-1;10015:14:61;;;;10033;10015;36:153:-1;66:2;58:11;;36:153;;176:10;;164:23;;139:12;;;;;98:2;89:12;;;;114;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;10015:14:61;;;;;;;;;;;;;;;;:32;;;;9987:60;9980:67;;9651:403;;;;;:::o;8545:2260:2:-;8725:35;;:::i;:::-;8900:25;8952:26;9006:20;9041;9092:9;9412:29;9663:31;9998:35;;:::i;:::-;8823:17;;8819:71;;;8856:23;;8819:71;8928:14;8900:42;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8928:14;8900:42;;8928:14;8900:42;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;8981:15:2;8952:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8900:42;;-1:-1:-1;8981:15:2;;-1:-1:-1;8952:44:2;-1:-1:-1;8952:44:2;;;-1:-1:-1;8981:15:2;8952:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9029:1;9006:24;;9064:6;:13;9041:36;;9104:1;9092:13;;9087:1573;9107:17;;;9087:1573;;9270:12;9243:6;9250:1;9243:9;;;;;;;;;;;;;;;;;;;:24;;:39;9296:9;;9323:13;;9296:6;;9303:1;;9296:9;;;;;;;;;;;;;;;:24;;:40;9444:35;9452:12;9466;9444:7;:35::i;:::-;9412:67;;9697:225;9736:6;9743:1;9736:9;;;;;;;;;;;;;;;;;;:26;;;9780:55;9788:6;9795:1;9788:9;;;;;;;;;;;;;;;;;;:26;;;9816:6;9823:1;9816:9;;;;;;;;;;;;;;;;;;:18;;;9780:7;:55::i;:::-;9887:21;9697;:225::i;:::-;9663:259;;10036:208;10070:6;10077:1;10070:9;;;;;;;;;;;;;;;;;;10097:35;10105:23;10130:1;10097:7;:35::i;:::-;10217:10;10228:1;10217:13;;;;;;;;;;;;;;;;;;10036:16;:208::i;:::-;9998:246;;10330:50;10345:16;10363;10330:14;:50::i;:::-;10409:79;10417:16;:39;;;10458:16;:29;;;10409:7;:79::i;:::-;10394:94;-1:-1:-1;10582:28:2;;;10578:72;;10630:5;;10578:72;9126:3;;;;;9087:1573;;;10691:28;;;;10670:95;;;;;;;;;;;;;;8545:2260;;;;;;;;;;;;;:::o;502:208:65:-;588:7;632:6;;;;611:70;;;;;;;;;;;;;;-1:-1:-1;698:5:65;;;502:208::o;5554:2161:2:-;5745:35;;:::i;:::-;5796:27;5860:26;5915:20;5966:9;6363:37;6669;6960:36;;:::i;:::-;7366:30;5826:6;5833:1;5826:9;;;;;;;;;;;;;;;;;;;;;:24;;;5889:15;5860:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5826:24;;-1:-1:-1;5860:44:2;5889:15;;5860:44;;;5889:15;5860:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5938:6;:13;5915:36;;5978:1;5966:13;;5961:1591;5981:17;;;5961:1591;;6213:14;6186:6;6193:1;6186:9;;;;;;;;;;;;;;;;;;;:24;;:41;6241:9;;6268:13;;6241:6;;6248:1;;6241:9;;;;;;;;;;;;;;;:24;;:40;6433:39;;6403:70;;6411:20;;6403:7;:70::i;:::-;6363:110;;6709:170;6748:6;6755:1;6748:9;;;;;;;;;;;;;;;;;;:26;;;6792:6;6799:1;6792:9;;;;;;;;;;;;;;;;;;:26;;;6836:29;6709:21;:170::i;:::-;6669:210;;6999:135;7033:6;7040:1;7033:9;;;;;;;;;;;;;;;;;;7060:29;7107:10;7118:1;7107:13;;;;;;;;;6999:135;6960:174;;7219:51;7234:16;7252:17;7219:14;:51::i;:::-;-1:-1:-1;7399:39:2;;7456:46;;;7452:90;;7522:5;;7452:90;6000:3;;;;;5961:1591;;;7583:46;;;;7562:113;;;;;;;;;;;;;1829:1648:4;2277:16;;;;1230:32:7;2106:35:4;;;2085:106;;;;;;;;;;;;;;2296:51;2304:26;2332:14;2296:7;:51::i;:::-;2277:70;-1:-1:-1;2390:9:4;2378:21;;;2357:81;;;;;;;;;;;;;;2532:28;2540:9;2551:8;2532:7;:28::i;:::-;2508:52;;2641:134;2676:13;1170:6:7;2739:26:4;2641:21;:134::i;:::-;2624:151;-1:-1:-1;2868:23:4;;;;2847:96;;;;;;;;;;;;;;3021:1;3005:13;:17;3001:470;;;3083:11;;:35;;;;;:11;;;;;:20;;:35;;3104:13;;3083:35;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3083:35:4;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3083:35:4;;;;3185:1;3176:6;:10;3172:78;;;3206:29;;:21;;;;:29;;;;;3228:6;;3206:29;;;;3228:6;3206:21;:29;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3206:29:4;3172:78;3335:30;3343:13;3358:6;3335:7;:30::i;:::-;3315:50;;3395:1;3383:9;:13;3379:82;;;3416:30;;:10;;:30;;;;;3436:9;;3416:30;;;;3436:9;3416:10;:30;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3416:30:4;3379:82;1829:1648;;;;;;;;:::o;1863:437:1:-;1987:14;2004:23;:9;1987:14;2004:23;:20;:23;:::i;:::-;930:32:7;;;;;;;;;;;;;;;;1987:40:1;;-1:-1:-1;2042:24:1;;;;;;;2038:256;;;2082:37;2101:9;2112:6;2082:18;:37::i;:::-;2038:256;;;1018:41:7;;;;;;;;;;;;;;;;2140:25:1;;;;;;;2136:158;;;2181:38;2201:9;2212:6;2181:19;:38::i;2136:158::-;2250:33;;;;;;;;;;;716:230:65;802:7;837:5;;;873:6;;;;852:69;;;;;;;;;;;;;;938:1;931:8;;716:230;;;;;;:::o;3123:425:42:-;3287:21;3345:15;;;3324:78;;;;;;;;;;;;;;3429:82;3450:26;3458:9;3469:6;3450:7;:26::i;:::-;3490:11;3429:7;:82::i;:::-;3413:98;-1:-1:-1;3123:425:42;;;;;;:::o;3512:1517:2:-;3683:35;;:::i;:::-;3734:27;3798:26;3853:20;3904:9;4296:37;4475:36;;:::i;:::-;3764:6;3771:1;3764:9;;;;;;;;;;;;;;;;;;;;;:24;;;3827:15;3798:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3764:24;;-1:-1:-1;3798:44:2;3827:15;;3798:44;;;3827:15;3798:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3876:6;:13;3853:36;;3916:1;3904:13;;3899:1091;3919:17;;;3899:1091;;4151:14;4124:6;4131:1;4124:9;;;;;;;;;;;;;;;;;;;:24;;:41;4179:9;;4206:13;;4179:6;;4186:1;;4179:9;;;;;;;;;;;;;;:24;;:40;;;;4336:64;4344:14;4360:16;:39;;;4336:7;:64::i;:::-;4296:104;;4514:135;4548:6;4555:1;4548:9;;;;;;;;;;;;;;;;;;4575:29;4622:10;4633:1;4622:13;;;;;;;;;4514:135;4475:174;;4734:51;4749:16;4767:17;4734:14;:51::i;:::-;4883:39;;;;:57;-1:-1:-1;4879:101:2;;4960:5;;4879:101;3938:3;;;;;3899:1091;;;3512:1517;;;;;;;;;;;:::o;1444:1623::-;1617:30;;:::i;:::-;1710;1858:16;1743:104;1775:5;1794:20;1828:9;1743:18;:104::i;:::-;1885:8;;2379:24;;1710:137;;-1:-1:-1;1885:8:2;;;-1:-1:-1;2529:3:2;;1710:137;;2283:2;2260:26;;1885:8;;2030:3;2008:598;2622:7;2619:2;;;2674:17;2668:24;2655:11;2648:45;2768:2;2749:17;2745:26;2739:33;2734:2;2721:11;2717:20;2710:63;2848:2;2829:17;2825:26;2819:33;2814:2;2801:11;2797:20;2790:63;2928:2;2909:17;2905:26;2899:33;2894:2;2881:11;2877:20;2870:63;2619:2;-1:-1:-1;1444:1623:2;;;;;;;:::o;1771:648:41:-;1964:39;;2005:40;;1956:90;;1964:39;1956:7;:90::i;:::-;1914:132;;2106:39;;;;;2147:40;;;;2098:90;;2106:39;2098:7;:90::i;:::-;2056:39;;;:132;2238:29;;;;;2269:30;;;;2230:70;;2238:29;2230:7;:70::i;:::-;2198:29;;;:102;2350:29;;;;;2381:30;;;;2342:70;;2350:29;2342:7;:70::i;:::-;2310:29;;;;:102;;;;-1:-1:-1;1771:648:41:o;15593:687:61:-;15713:13;15775:5;15783:1;15775:9;15763:1;:8;:21;;15742:105;;;;;;;;;;;;;;;;-1:-1:-1;16021:13:61;15924:2;16021:13;16015:20;16174:66;16162:79;;15593:687::o;2518:1273:1:-;2639:13;;2655:25;:9;2677:2;2655:25;:21;:25;:::i;:::-;1022:38;;;;;;;;;;;;;;;;2639:41;;-1:-1:-1;2832:10:1;;;;1022:38;2843:113;;2916:10;;2940:6;;2843:113;;;;;;;;22:32:-1;26:21;;;22:32;6:49;;2843:113:1;;;49:4:-1;25:18;;61:17;;2843:113:1;182:15:-1;2843:113:1;;;;179:29:-1;;;;160:49;;2832:125:1;;;2843:113;;2832:125;;;;25:18:-1;2832:125:1;;25:18:-1;-1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;2832:125:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;2967:69:1;;;;;;;;;;;;;;;;;3415:14;3412:2;;;-1:-1:-1;3459:1:1;3483:14;3499:2;3480:22;3477:2;;;3621;3618:1;3615;3600:24;-1:-1:-1;3662:1:1;3656:8;3477:2;3736:7;3715:69;;;;;;;;;;;;;;;;2518:1273;;;;:::o;4010:489::-;4244:13;;4163:1;4153:11;;4132:72;;;;;;;;;;;;;;4260:25;:9;4282:2;4260:25;:21;:25;:::i;:::-;4244:41;-1:-1:-1;4313:25:1;:9;4335:2;4313:25;:21;:25;:::i;:::-;4378:114;;;;;4295:43;;-1:-1:-1;4378:32:1;;;;;;:114;;4432:4;;4451:10;;4295:43;;4378:114;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;4378:114:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;51:288:65;137:7;;164:6;;160:45;;;193:1;186:8;;;;160:45;-1:-1:-1;226:5:65;;;230:1;226;:5;262;;;;;;;;:10;241:73;;;;;;;;;;;;;345:151;431:7;454:9;470:1;466;:5;;;;;;;;;345:151;-1:-1:-1;;;;345:151:65:o;1011:10099:37:-;5031:4;5025:11;;5321:66;5314:4;5291:28;;;5284:104;;;;1199:30;5445:4;5422:28;;6444:59;;;6770:19;;5736:26;;;6750:40;;;6883:23;;;6877:30;6853:22;;;6846:62;6979:23;;;6973:30;6949:22;;;6942:62;7082:23;;;7076:30;7052:22;;;7045:62;7197:4;7179:23;;7173:30;7149:22;;;7142:62;7297:4;7279:23;;7273:30;7249:22;;;7242:62;7397:4;7379:23;;7373:30;7349:22;;;7342:62;7495:4;7477:23;;7471:30;7447:22;;;7440:62;7594:5;7576:24;;7570:31;7545:23;;;7538:64;7699:5;7681:24;;7675:31;7650:23;;;7643:64;7787:5;7769:24;;7763:31;;7738:23;;;7731:64;;;7895:5;7877:24;;7871:31;7846:23;;;7839:64;7979:5;8106:74;;8268:24;8340:19;;7962:23;;;8544:34;;;5025:11;;5422:28;;;;6536:27;;;;5736:26;;8606:22;;;;8388:23;;;;8464:4;8445:24;;8441:35;6190:1;8698:237;8721:13;8718:1;8715:20;8698:237;;;8791:19;;8771:40;;8860:4;8843:22;;;;8898:23;;;;8749:1;8742:9;8698:237;;;-1:-1:-1;;;;9045:31:37;;;9029:13;9010:33;;;9003:74;;;;9171:17;;9165:24;9237:19;;9441:34;;;9037:4;9503:22;;;;9285:23;;;;9361:4;9342:24;;9338:35;9610:1;9596:237;9619:13;9616:1;9613:20;9596:237;;;9689:19;;9669:40;;9758:4;9741:22;;;;9796:23;;;;9647:1;9640:9;9596:237;;;-1:-1:-1;;;9902:46:37;;;-1:-1:-1;10133:33:37;;;10003:4;9981:27;;;10108:59;;;10281:19;;10472:34;;;9981:27;;10534:22;;;;10329:23;;;;10281:19;10405:4;10386:24;;10382:35;-1:-1:-1;10613:237:37;10636:13;10633:1;10630:20;10613:237;;;10706:19;;10686:40;;10775:4;10758:22;;;;10813:23;;;;10664:1;10657:9;10613:237;;;-1:-1:-1;;;10928:46:37;;;;;10902:73;;-1:-1:-1;11041:4:37;11034:25;-1:-1:-1;;;;;1011:10099:37;;;;;:::o;10268:886:61:-;10389:14;10452:5;10460:2;10452:10;10440:1;:8;:22;;10419:135;;;;;;;;;;;;;;;;-1:-1:-1;11056:13:61;10801:2;11056:13;11050:20;11072:42;11046:69;;10268:886::o;14708:220::-;14829:14;14876:21;14888:1;14891:5;13411:14;13474:5;13482:2;13474:10;13462:1;:8;:22;;13441:107;;;;;;;;;;;;;;;;-1:-1:-1;13727:13:61;13629:2;13727:13;13721:20;;13290:490::o;836:407:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;5:118:-1:-;;72:46;110:6;97:20;72:46;;146:693;;261:4;249:17;;245:27;-1:-1;235:2;;286:1;283;276:12;235:2;323:6;310:20;345:85;360:69;422:6;360:69;;;345:85;;;458:21;;;502:4;490:17;;;;336:94;;-1:-1;515:14;;490:17;610:1;595:238;620:6;617:1;614:13;595:238;;;703:3;690:17;682:6;678:30;727:42;765:3;753:10;727:42;;;715:55;;-1:-1;793:4;784:14;;;;812;;;;;642:1;635:9;595:238;;;599:14;228:611;;;;;;;;879:735;;1008:4;996:17;;992:27;-1:-1;982:2;;1033:1;1030;1023:12;982:2;1070:6;1057:20;1092:99;1107:83;1183:6;1107:83;;1092:99;1219:21;;;1263:4;1251:17;;;;1083:108;;-1:-1;1276:14;;1251:17;1371:1;1356:252;1381:6;1378:1;1375:13;1356:252;;;1464:3;1451:17;1443:6;1439:30;1488:56;1540:3;1528:10;1488:56;;;1476:69;;-1:-1;1568:4;1559:14;;;;1587;;;;;1403:1;1396:9;1356:252;;1636:335;;;1743:4;1731:17;;1727:27;-1:-1;1717:2;;1768:1;1765;1758:12;1717:2;-1:-1;1788:20;;1828:18;1817:30;;1814:2;;;1860:1;1857;1850:12;1814:2;1894:4;1886:6;1882:17;1870:29;;1944:3;1937;1929:6;1925:16;1915:8;1911:31;1908:40;1905:2;;;1961:1;1958;1951:12;1905:2;1710:261;;;;;;1980:432;;2070:4;2058:17;;2054:27;-1:-1;2044:2;;2095:1;2092;2085:12;2044:2;2132:6;2119:20;2154:60;2169:44;2206:6;2169:44;;2154:60;2145:69;;2234:6;2227:5;2220:21;2270:4;2262:6;2258:17;2303:4;2296:5;2292:16;2338:3;2329:6;2324:3;2320:16;2317:25;2314:2;;;2355:1;2352;2345:12;2314:2;2365:41;2399:6;2394:3;2389;2365:41;;;2037:375;;;;;;;;2448:2205;;2556:5;2544:9;2539:3;2535:19;2531:31;2528:2;;;2575:1;2572;2565:12;2528:2;2593:21;2608:5;2593:21;;;2584:30;-1:-1;2672:1;2703:49;2748:3;2728:9;2703:49;;;2679:74;;-1:-1;2822:2;2855:49;2900:3;2876:22;;;2855:49;;;2848:4;2841:5;2837:16;2830:75;2774:142;2981:2;3014:49;3059:3;3050:6;3039:9;3035:22;3014:49;;;3007:4;3000:5;2996:16;2989:75;2926:149;3134:2;3167:49;3212:3;3203:6;3192:9;3188:22;3167:49;;;3160:4;3153:5;3149:16;3142:75;3085:143;3290:3;3324:49;3369:3;3360:6;3349:9;3345:22;3324:49;;;3317:4;3310:5;3306:16;3299:75;3238:147;3447:3;3481:49;3526:3;3517:6;3506:9;3502:22;3481:49;;;3474:4;3467:5;3463:16;3456:75;3395:147;3596:3;3630:49;3675:3;3666:6;3655:9;3651:22;3630:49;;;3623:4;3616:5;3612:16;3605:75;3552:139;3745:3;3779:49;3824:3;3815:6;3804:9;3800:22;3779:49;;;3772:4;3765:5;3761:16;3754:75;3701:139;3907:3;3942:49;3987:3;3978:6;3967:9;3963:22;3942:49;;;3934:5;3927;3923:17;3916:76;3850:153;4053:3;4088:49;4133:3;4124:6;4113:9;4109:22;4088:49;;;4080:5;4073;4069:17;4062:76;4013:136;4237:3;4226:9;4222:19;4209:33;4262:18;4254:6;4251:30;4248:2;;;4294:1;4291;4284:12;4248:2;4330:54;4380:3;4371:6;4360:9;4356:22;4330:54;;;4322:5;4315;4311:17;4304:81;4159:237;4484:3;4473:9;4469:19;4456:33;4509:18;4501:6;4498:30;4495:2;;;4541:1;4538;4531:12;4495:2;4577:54;4627:3;4618:6;4607:9;4603:22;4577:54;;;4569:5;4562;4558:17;4551:81;4406:237;2522:2131;;;;;4660:118;;4727:46;4765:6;4752:20;4727:46;;4785:241;;4889:2;4877:9;4868:7;4864:23;4860:32;4857:2;;;4905:1;4902;4895:12;4857:2;4940:1;4957:53;5002:7;4982:9;4957:53;;;4947:63;4851:175;-1:-1;;;;4851:175;5033:1509;;;;;;;5370:3;5358:9;5349:7;5345:23;5341:33;5338:2;;;5387:1;5384;5377:12;5338:2;5422:31;;5473:18;5462:30;;5459:2;;;5505:1;5502;5495:12;5459:2;5525:97;5614:7;5605:6;5594:9;5590:22;5525:97;;;5515:107;;5401:227;5687:2;5676:9;5672:18;5659:32;5711:18;5703:6;5700:30;5697:2;;;5743:1;5740;5733:12;5697:2;5763:83;5838:7;5829:6;5818:9;5814:22;5763:83;;;5753:93;;5638:214;5911:2;5900:9;5896:18;5883:32;5935:18;5927:6;5924:30;5921:2;;;5967:1;5964;5957:12;5921:2;5987:97;6076:7;6067:6;6056:9;6052:22;5987:97;;;5977:107;;5862:228;6149:2;6138:9;6134:18;6121:32;6173:18;6165:6;6162:30;6159:2;;;6205:1;6202;6195:12;6159:2;6225:83;6300:7;6291:6;6280:9;6276:22;6225:83;;;6215:93;;6100:214;6345:3;6364:53;6409:7;6400:6;6389:9;6385:22;6364:53;;;6354:63;;6324:99;6454:3;6473:53;6518:7;6509:6;6498:9;6494:22;6473:53;;;6463:63;;6433:99;5332:1210;;;;;;;;;6549:1635;;;;;;;;6903:3;6891:9;6882:7;6878:23;6874:33;6871:2;;;6920:1;6917;6910:12;6871:2;6955:31;;7006:18;6995:30;;6992:2;;;7038:1;7035;7028:12;6992:2;7058:97;7147:7;7138:6;7127:9;7123:22;7058:97;;;7048:107;;6934:227;7192:2;7210:53;7255:7;7246:6;7235:9;7231:22;7210:53;;;7200:63;;7171:98;7328:2;7317:9;7313:18;7300:32;7352:18;7344:6;7341:30;7338:2;;;7384:1;7381;7374:12;7338:2;7404:83;7479:7;7470:6;7459:9;7455:22;7404:83;;;7394:93;;7279:214;7552:2;7541:9;7537:18;7524:32;7576:18;7568:6;7565:30;7562:2;;;7608:1;7605;7598:12;7562:2;7628:97;7717:7;7708:6;7697:9;7693:22;7628:97;;;7618:107;;7503:228;7790:3;7779:9;7775:19;7762:33;7815:18;7807:6;7804:30;7801:2;;;7847:1;7844;7837:12;7801:2;7867:83;7942:7;7933:6;7922:9;7918:22;7867:83;;;7857:93;;7741:215;7987:3;8006:53;8051:7;8042:6;8031:9;8027:22;8006:53;;;7996:63;;7966:99;8096:3;8115:53;8160:7;8151:6;8140:9;8136:22;8115:53;;;8105:63;;8075:99;6865:1319;;;;;;;;;;;8191:490;;;;8331:2;8319:9;8310:7;8306:23;8302:32;8299:2;;;8347:1;8344;8337:12;8299:2;8382:31;;8433:18;8422:30;;8419:2;;;8465:1;8462;8455:12;8419:2;8493:64;8549:7;8540:6;8529:9;8525:22;8493:64;;;8475:82;;;;8361:202;8594:2;8612:53;8657:7;8648:6;8637:9;8633:22;8612:53;;;8602:63;;8573:98;8293:388;;;;;;8688:110;8761:31;8786:5;8761:31;;;8756:3;8749:44;8743:55;;;8806:397;8961:2;8949:15;;8998:66;8993:2;8984:12;;8977:88;9099:66;9094:2;9085:12;;9078:88;9194:2;9185:12;;8942:261;9212:296;9367:2;9355:15;;9404:66;9399:2;9390:12;;9383:88;9499:2;9490:12;;9348:160;9517:296;9672:2;9660:15;;9709:66;9704:2;9695:12;;9688:88;9804:2;9795:12;;9653:160;9822:296;9977:2;9965:15;;10014:66;10009:2;10000:12;;9993:88;10109:2;10100:12;;9958:160;10127:397;10282:2;10270:15;;10319:66;10314:2;10305:12;;10298:88;10420:66;10415:2;10406:12;;10399:88;10515:2;10506:12;;10263:261;10533:296;10688:2;10676:15;;10725:66;10720:2;10711:12;;10704:88;10820:2;10811:12;;10669:160;10838:296;10993:2;10981:15;;11030:66;11025:2;11016:12;;11009:88;11125:2;11116:12;;10974:160;11143:296;11298:2;11286:15;;11335:66;11330:2;11321:12;;11314:88;11430:2;11421:12;;11279:160;11448:296;11603:2;11591:15;;11640:66;11635:2;11626:12;;11619:88;11735:2;11726:12;;11584:160;11753:296;11908:2;11896:15;;11945:66;11940:2;11931:12;;11924:88;12040:2;12031:12;;11889:160;12058:296;12213:2;12201:15;;12250:66;12245:2;12236:12;;12229:88;12345:2;12336:12;;12194:160;12363:296;12518:2;12506:15;;12555:66;12550:2;12541:12;;12534:88;12650:2;12641:12;;12499:160;12668:296;12823:2;12811:15;;12860:66;12855:2;12846:12;;12839:88;12955:2;12946:12;;12804:160;12973:397;13128:2;13116:15;;13165:66;13160:2;13151:12;;13144:88;13266:66;13261:2;13252:12;;13245:88;13361:2;13352:12;;13109:261;13379:397;13534:2;13522:15;;13571:66;13566:2;13557:12;;13550:88;13672:66;13667:2;13658:12;;13651:88;13767:2;13758:12;;13515:261;13785:296;13940:2;13928:15;;13977:66;13972:2;13963:12;;13956:88;14072:2;14063:12;;13921:160;14166:888;14394:22;;14307:4;14298:14;;;14428:61;14302:3;14394:22;14428:61;;;14327:174;14595:4;14588:5;14584:16;14578:23;14613:62;14669:4;14664:3;14660:14;14647:11;14613:62;;;14511:176;14771:4;14764:5;14760:16;14754:23;14789:62;14845:4;14840:3;14836:14;14823:11;14789:62;;;14697:166;14947:4;14940:5;14936:16;14930:23;14965:62;15021:4;15016:3;15012:14;14999:11;15061:110;15134:31;15159:5;15134:31;;15178:193;15286:2;15271:18;;15300:61;15275:9;15334:6;15300:61;;15378:395;15542:2;15527:18;;15556:61;15531:9;15590:6;15556:61;;;15628:62;15686:2;15675:9;15671:18;15662:6;15628:62;;;15701;15759:2;15748:9;15744:18;15735:6;15701:62;;15780:294;15916:2;15901:18;;15930:61;15905:9;15964:6;15930:61;;;16002:62;16060:2;16049:9;16045:18;16036:6;16002:62;;16081:387;16262:2;16276:47;;;16247:18;;16337:121;16247:18;16337:121;;16475:387;16656:2;16670:47;;;16641:18;;16731:121;16641:18;16731:121;;16869:387;17050:2;17064:47;;;17035:18;;17125:121;17035:18;17125:121;;17263:387;17444:2;17458:47;;;17429:18;;17519:121;17429:18;17519:121;;17657:387;17838:2;17852:47;;;17823:18;;17913:121;17823:18;17913:121;;18051:387;18232:2;18246:47;;;18217:18;;18307:121;18217:18;18307:121;;18445:387;18626:2;18640:47;;;18611:18;;18701:121;18611:18;18701:121;;18839:387;19020:2;19034:47;;;19005:18;;19095:121;19005:18;19095:121;;19233:387;19414:2;19428:47;;;19399:18;;19489:121;19399:18;19489:121;;19627:387;19808:2;19822:47;;;19793:18;;19883:121;19793:18;19883:121;;20021:387;20202:2;20216:47;;;20187:18;;20277:121;20187:18;20277:121;;20415:387;20596:2;20610:47;;;20581:18;;20671:121;20581:18;20671:121;;20809:387;20990:2;21004:47;;;20975:18;;21065:121;20975:18;21065:121;;21203:387;21384:2;21398:47;;;21369:18;;21459:121;21369:18;21459:121;;21597:387;21778:2;21792:47;;;21763:18;;21853:121;21763:18;21853:121;;21991:387;22172:2;22186:47;;;22157:18;;22247:121;22157:18;22247:121;;22385:528;22637:3;22622:19;;22652:119;22626:9;22744:6;22652:119;;;22782:121;22898:3;22887:9;22883:19;22874:6;22782:121;;22920:193;23028:2;23013:18;;23042:61;23017:9;23076:6;23042:61;;23120:256;23182:2;23176:9;23208:17;;;23283:18;23268:34;;23304:22;;;23265:62;23262:2;;;23340:1;23337;23330:12;23262:2;23356;23349:22;23160:216;;-1:-1;23160:216;23383:263;;23547:18;23539:6;23536:30;23533:2;;;23579:1;23576;23569:12;23533:2;-1:-1;23608:4;23596:17;;;23626:15;;23470:176;23937:254;;24076:18;24068:6;24065:30;24062:2;;;24108:1;24105;24098:12;24062:2;-1:-1;24181:4;24152;24129:17;;;;24148:9;24125:33;24171:15;;23999:192;24198:128;24278:42;24267:54;;24250:76;24333:79;24402:5;24385:27;24641:145;24722:6;24717:3;24712;24699:30;-1:-1;24778:1;24760:16;;24753:27;24692:94"
- }
- }
- },
- "sources": {
- "2.0.0/extensions/Forwarder/Forwarder.sol": {
- "id": 0
- },
- "2.0.0/extensions/Forwarder/MixinAssets.sol": {
- "id": 1
- },
- "2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol": {
- "id": 2
- },
- "2.0.0/extensions/Forwarder/MixinForwarderCore.sol": {
- "id": 3
- },
- "2.0.0/extensions/Forwarder/MixinWeth.sol": {
- "id": 4
- },
- "2.0.0/extensions/Forwarder/interfaces/IAssets.sol": {
- "id": 5
- },
- "2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol": {
- "id": 6
- },
- "2.0.0/extensions/Forwarder/libs/LibConstants.sol": {
- "id": 7
- },
- "2.0.0/extensions/Forwarder/mixins/MAssets.sol": {
- "id": 8
- },
- "2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol": {
- "id": 9
- },
- "2.0.0/extensions/Forwarder/mixins/MWeth.sol": {
- "id": 10
- },
- "2.0.0/extensions/OrderValidator/OrderValidator.sol": {
- "id": 11
- },
- "2.0.0/multisig/MultiSigWallet.sol": {
- "id": 12
- },
- "2.0.0/multisig/MultiSigWalletWithTimeLock.sol": {
- "id": 13
- },
- "2.0.0/protocol/AssetProxy/ERC20Proxy.sol": {
- "id": 14
- },
- "2.0.0/protocol/AssetProxy/ERC721Proxy.sol": {
- "id": 15
- },
- "2.0.0/protocol/AssetProxy/MixinAuthorizable.sol": {
- "id": 16
- },
- "2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol": {
- "id": 17
- },
- "2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol": {
- "id": 18
- },
- "2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol": {
- "id": 19
- },
- "2.0.0/protocol/AssetProxyOwner/AssetProxyOwner.sol": {
- "id": 20
- },
- "2.0.0/protocol/Exchange/Exchange.sol": {
- "id": 21
- },
- "2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol": {
- "id": 22
- },
- "2.0.0/protocol/Exchange/MixinExchangeCore.sol": {
- "id": 23
- },
- "2.0.0/protocol/Exchange/MixinMatchOrders.sol": {
- "id": 24
- },
- "2.0.0/protocol/Exchange/MixinSignatureValidator.sol": {
- "id": 25
- },
- "2.0.0/protocol/Exchange/MixinTransactions.sol": {
- "id": 26
- },
- "2.0.0/protocol/Exchange/MixinWrapperFunctions.sol": {
- "id": 27
- },
- "2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol": {
- "id": 28
- },
- "2.0.0/protocol/Exchange/interfaces/IExchange.sol": {
- "id": 29
- },
- "2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol": {
- "id": 30
- },
- "2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol": {
- "id": 31
- },
- "2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol": {
- "id": 32
- },
- "2.0.0/protocol/Exchange/interfaces/ITransactions.sol": {
- "id": 33
- },
- "2.0.0/protocol/Exchange/interfaces/IValidator.sol": {
- "id": 34
- },
- "2.0.0/protocol/Exchange/interfaces/IWallet.sol": {
- "id": 35
- },
- "2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol": {
- "id": 36
- },
- "2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol": {
- "id": 37
- },
- "2.0.0/protocol/Exchange/libs/LibConstants.sol": {
- "id": 38
- },
- "2.0.0/protocol/Exchange/libs/LibEIP712.sol": {
- "id": 39
- },
- "2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol": {
- "id": 40
- },
- "2.0.0/protocol/Exchange/libs/LibFillResults.sol": {
- "id": 41
- },
- "2.0.0/protocol/Exchange/libs/LibMath.sol": {
- "id": 42
- },
- "2.0.0/protocol/Exchange/libs/LibOrder.sol": {
- "id": 43
- },
- "2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol": {
- "id": 44
- },
- "2.0.0/protocol/Exchange/mixins/MExchangeCore.sol": {
- "id": 45
- },
- "2.0.0/protocol/Exchange/mixins/MMatchOrders.sol": {
- "id": 46
- },
- "2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol": {
- "id": 47
- },
- "2.0.0/protocol/Exchange/mixins/MTransactions.sol": {
- "id": 48
- },
- "2.0.0/protocol/Exchange/mixins/MWrapperFunctions.sol": {
- "id": 49
- },
- "2.0.0/test/DummyERC20Token/DummyERC20Token.sol": {
- "id": 50
- },
- "2.0.0/test/DummyERC721Token/DummyERC721Token.sol": {
- "id": 51
- },
- "2.0.0/tokens/ERC20Token/ERC20Token.sol": {
- "id": 52
- },
- "2.0.0/tokens/ERC20Token/IERC20Token.sol": {
- "id": 53
- },
- "2.0.0/tokens/ERC20Token/MintableERC20Token.sol": {
- "id": 54
- },
- "2.0.0/tokens/ERC20Token/UnlimitedAllowanceERC20Token.sol": {
- "id": 55
- },
- "2.0.0/tokens/ERC721Token/ERC721Token.sol": {
- "id": 56
- },
- "2.0.0/tokens/ERC721Token/IERC721Receiver.sol": {
- "id": 57
- },
- "2.0.0/tokens/ERC721Token/IERC721Token.sol": {
- "id": 58
- },
- "2.0.0/tokens/ERC721Token/MintableERC721Token.sol": {
- "id": 59
- },
- "2.0.0/tokens/EtherToken/IEtherToken.sol": {
- "id": 60
- },
- "2.0.0/utils/LibBytes/LibBytes.sol": {
- "id": 61
- },
- "2.0.0/utils/Ownable/IOwnable.sol": {
- "id": 62
- },
- "2.0.0/utils/Ownable/Ownable.sol": {
- "id": 63
- },
- "2.0.0/utils/ReentrancyGuard/ReentrancyGuard.sol": {
- "id": 64
- },
- "2.0.0/utils/SafeMath/SafeMath.sol": {
- "id": 65
- }
- },
- "sourceCodes": {
- "2.0.0/extensions/Forwarder/Forwarder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./MixinWeth.sol\";\nimport \"./MixinForwarderCore.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./MixinAssets.sol\";\nimport \"./MixinExchangeWrapper.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract Forwarder is\n LibConstants,\n MixinWeth,\n MixinAssets,\n MixinExchangeWrapper,\n MixinForwarderCore\n{\n constructor (\n address _exchange,\n bytes memory _zrxAssetData,\n bytes memory _wethAssetData\n )\n public\n LibConstants(\n _exchange,\n _zrxAssetData,\n _wethAssetData\n )\n MixinForwarderCore()\n {}\n}\n",
- "2.0.0/extensions/Forwarder/MixinAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"../../tokens/ERC20Token/IERC20Token.sol\";\nimport \"../../tokens/ERC721Token/IERC721Token.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MAssets.sol\";\n\n\ncontract MixinAssets is\n Ownable,\n LibConstants,\n MAssets\n{\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_TRANSFER_SELECTOR = bytes4(keccak256(\"transfer(address,uint256)\"));\n\n /// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to \n /// function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be\n /// used to withdraw assets that were accidentally sent to this contract.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of ERC20 token to withdraw.\n function withdrawAsset(\n bytes assetData,\n uint256 amount\n )\n external\n onlyOwner\n {\n transferAssetToSender(assetData, amount);\n }\n\n /// @dev Transfers given amount of asset to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferAssetToSender(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n bytes4 proxyId = assetData.readBytes4(0);\n\n if (proxyId == ERC20_DATA_ID) {\n transferERC20Token(assetData, amount);\n } else if (proxyId == ERC721_DATA_ID) {\n transferERC721Token(assetData, amount);\n } else {\n revert(\"UNSUPPORTED_ASSET_PROXY\");\n }\n }\n\n /// @dev Decodes ERC20 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC20Token(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n address token = assetData.readAddress(16);\n\n // Transfer tokens.\n // We do a raw call so we can check the success separate\n // from the return data.\n bool success = token.call(abi.encodeWithSelector(\n ERC20_TRANSFER_SELECTOR,\n msg.sender,\n amount\n ));\n require(\n success,\n \"TRANSFER_FAILED\"\n );\n \n // Check return data.\n // If there is no return data, we assume the token incorrectly\n // does not return a bool. In this case we expect it to revert\n // on failure, which was handled above.\n // If the token does return data, we require that it is a single\n // value that evaluates to true.\n assembly {\n if returndatasize {\n success := 0\n if eq(returndatasize, 32) {\n // First 64 bytes of memory are reserved scratch space\n returndatacopy(0, 0, 32)\n success := mload(0)\n }\n }\n }\n require(\n success,\n \"TRANSFER_FAILED\"\n );\n }\n\n /// @dev Decodes ERC721 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC721Token(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n require(\n amount == 1,\n \"INVALID_AMOUNT\"\n );\n // Decode asset data.\n address token = assetData.readAddress(16);\n uint256 tokenId = assetData.readUint256(36);\n\n // Perform transfer.\n IERC721Token(token).transferFrom(\n address(this),\n msg.sender,\n tokenId\n );\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MExchangeWrapper.sol\";\nimport \"../../protocol/Exchange/libs/LibAbiEncoder.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../protocol/Exchange/libs/LibFillResults.sol\";\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\n\n\ncontract MixinExchangeWrapper is\n LibAbiEncoder,\n LibFillResults,\n LibMath,\n LibConstants,\n MExchangeWrapper\n{\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n // ABI encode calldata for `fillOrder`\n bytes memory fillOrderCalldata = abiEncodeFillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n\n address exchange = address(EXCHANGE);\n\n // Call `fillOrder` and handle any exceptions gracefully\n assembly {\n let success := call(\n gas, // forward all gas\n exchange, // call address of Exchange contract\n 0, // transfer 0 wei\n add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes)\n mload(fillOrderCalldata), // length of input\n fillOrderCalldata, // write output over input\n 128 // output size is 128 bytes\n )\n if success {\n mstore(fillResults, mload(fillOrderCalldata))\n mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32)))\n mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64)))\n mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96)))\n }\n }\n // fillResults values will be 0 by default if call was unsuccessful\n return fillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of WETH has been sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param wethSellAmount Desired amount of WETH to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellWeth(\n LibOrder.Order[] memory orders,\n uint256 wethSellAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // We assume that asset being sold by taker is WETH for each order.\n orders[i].makerAssetData = makerAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of WETH to sell\n uint256 remainingTakerAssetFillAmount = safeSub(wethSellAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of WETH\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= wethSellAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// The asset being sold by taker must always be WETH.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyExactAmountWithWeth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // We assume that asset being sold by taker is WETH for each order.\n orders[i].makerAssetData = makerAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n uint256 makerAssetFilledAmount = totalFillResults.makerAssetFilledAmount;\n if (makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n\n require(\n makerAssetFilledAmount >= makerAssetFillAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return totalFillResults;\n }\n\n /// @dev Buys zrxBuyAmount of ZRX fee tokens, taking into account ZRX fees for each order. This will guarantee\n /// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues).\n /// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX\n /// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases.\n /// The asset being sold by taker must always be WETH. \n /// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset.\n /// @param zrxBuyAmount Desired amount of ZRX to buy.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return totalFillResults Amounts filled and fees paid by maker and taker.\n function marketBuyExactZrxWithWeth(\n LibOrder.Order[] memory orders,\n uint256 zrxBuyAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n // Do nothing if zrxBuyAmount == 0\n if (zrxBuyAmount == 0) {\n return totalFillResults;\n }\n\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n uint256 zrxPurchased = 0;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // All of these are ZRX/WETH, so we can drop the respective assetData from calldata.\n orders[i].makerAssetData = zrxAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of ZRX to buy.\n uint256 remainingZrxBuyAmount = safeSub(zrxBuyAmount, zrxPurchased);\n\n // Convert the remaining amount of ZRX to buy into remaining amount\n // of WETH to sell, assuming entire amount can be sold in the current order.\n uint256 remainingWethSellAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n safeSub(orders[i].makerAssetAmount, orders[i].takerFee), // our exchange rate after fees \n remainingZrxBuyAmount\n );\n\n // Attempt to sell the remaining amount of WETH.\n FillResults memory singleFillResult = fillOrderNoThrow(\n orders[i],\n safeAdd(remainingWethSellAmount, 1), // we add 1 wei to the fill amount to make up for rounding errors\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker.\n addFillResults(totalFillResults, singleFillResult);\n zrxPurchased = safeSub(totalFillResults.makerAssetFilledAmount, totalFillResults.takerFeePaid);\n\n // Stop execution if the entire amount of ZRX has been bought.\n if (zrxPurchased >= zrxBuyAmount) {\n break;\n }\n }\n\n require(\n zrxPurchased >= zrxBuyAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return totalFillResults;\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinForwarderCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MWeth.sol\";\nimport \"./mixins/MAssets.sol\";\nimport \"./mixins/MExchangeWrapper.sol\";\nimport \"./interfaces/IForwarderCore.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../protocol/Exchange/libs/LibFillResults.sol\";\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\n\n\ncontract MixinForwarderCore is\n LibFillResults,\n LibMath,\n LibConstants,\n MWeth,\n MAssets,\n MExchangeWrapper,\n IForwarderCore\n{\n using LibBytes for bytes;\n\n /// @dev Constructor approves ERC20 proxy to transfer ZRX and WETH on this contract's behalf.\n constructor ()\n public\n {\n address proxyAddress = EXCHANGE.getAssetProxy(ERC20_DATA_ID);\n require(\n proxyAddress != address(0),\n \"UNREGISTERED_ASSET_PROXY\"\n );\n ETHER_TOKEN.approve(proxyAddress, MAX_UINT);\n ZRX_TOKEN.approve(proxyAddress, MAX_UINT);\n }\n\n /// @dev Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketSellOrdersWithEth(\n LibOrder.Order[] memory orders,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n FillResults memory orderFillResults,\n FillResults memory feeOrderFillResults\n )\n {\n // Convert ETH to WETH.\n convertEthToWeth();\n\n uint256 wethSellAmount;\n uint256 zrxBuyAmount;\n uint256 makerAssetAmountPurchased;\n if (orders[0].makerAssetData.equals(ZRX_ASSET_DATA)) {\n // Calculate amount of WETH that won't be spent on ETH fees.\n wethSellAmount = getPartialAmountFloor(\n PERCENTAGE_DENOMINATOR,\n safeAdd(PERCENTAGE_DENOMINATOR, feePercentage),\n msg.value\n );\n // Market sell available WETH.\n // ZRX fees are paid with this contract's balance.\n orderFillResults = marketSellWeth(\n orders,\n wethSellAmount,\n signatures\n );\n // The fee amount must be deducted from the amount transfered back to sender.\n makerAssetAmountPurchased = safeSub(orderFillResults.makerAssetFilledAmount, orderFillResults.takerFeePaid);\n } else {\n // 5% of WETH is reserved for filling feeOrders and paying feeRecipient.\n wethSellAmount = getPartialAmountFloor(\n MAX_WETH_FILL_PERCENTAGE,\n PERCENTAGE_DENOMINATOR,\n msg.value\n );\n // Market sell 95% of WETH.\n // ZRX fees are payed with this contract's balance.\n orderFillResults = marketSellWeth(\n orders,\n wethSellAmount,\n signatures\n );\n // Buy back all ZRX spent on fees.\n zrxBuyAmount = orderFillResults.takerFeePaid;\n feeOrderFillResults = marketBuyExactZrxWithWeth(\n feeOrders,\n zrxBuyAmount,\n feeSignatures\n );\n makerAssetAmountPurchased = orderFillResults.makerAssetFilledAmount;\n }\n\n // Transfer feePercentage of total ETH spent on primary orders to feeRecipient.\n // Refund remaining ETH to msg.sender.\n transferEthFeeAndRefund(\n orderFillResults.takerAssetFilledAmount,\n feeOrderFillResults.takerAssetFilledAmount,\n feePercentage,\n feeRecipient\n );\n\n // Transfer purchased assets to msg.sender.\n transferAssetToSender(orders[0].makerAssetData, makerAssetAmountPurchased);\n }\n\n /// @dev Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param makerAssetFillAmount Desired amount of makerAsset to purchase.\n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketBuyOrdersWithEth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n FillResults memory orderFillResults,\n FillResults memory feeOrderFillResults\n )\n {\n // Convert ETH to WETH.\n convertEthToWeth();\n\n uint256 zrxBuyAmount;\n uint256 makerAssetAmountPurchased;\n if (orders[0].makerAssetData.equals(ZRX_ASSET_DATA)) {\n // If the makerAsset is ZRX, it is not necessary to pay fees out of this\n // contracts's ZRX balance because fees are factored into the price of the order.\n orderFillResults = marketBuyExactZrxWithWeth(\n orders,\n makerAssetFillAmount,\n signatures\n );\n // The fee amount must be deducted from the amount transfered back to sender.\n makerAssetAmountPurchased = safeSub(orderFillResults.makerAssetFilledAmount, orderFillResults.takerFeePaid);\n } else {\n // Attemp to purchase desired amount of makerAsset.\n // ZRX fees are payed with this contract's balance.\n orderFillResults = marketBuyExactAmountWithWeth(\n orders,\n makerAssetFillAmount,\n signatures\n );\n // Buy back all ZRX spent on fees.\n zrxBuyAmount = orderFillResults.takerFeePaid;\n feeOrderFillResults = marketBuyExactZrxWithWeth(\n feeOrders,\n zrxBuyAmount,\n feeSignatures\n );\n makerAssetAmountPurchased = orderFillResults.makerAssetFilledAmount;\n }\n\n // Transfer feePercentage of total ETH spent on primary orders to feeRecipient.\n // Refund remaining ETH to msg.sender.\n transferEthFeeAndRefund(\n orderFillResults.takerAssetFilledAmount,\n feeOrderFillResults.takerAssetFilledAmount,\n feePercentage,\n feeRecipient\n );\n\n // Transfer purchased assets to msg.sender.\n transferAssetToSender(orders[0].makerAssetData, makerAssetAmountPurchased);\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinWeth.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MWeth.sol\";\n\n\ncontract MixinWeth is\n LibMath,\n LibConstants,\n MWeth\n{\n /// @dev Default payabale function, this allows us to withdraw WETH\n function ()\n public\n payable\n {\n require(\n msg.sender == address(ETHER_TOKEN),\n \"DEFAULT_FUNCTION_WETH_CONTRACT_ONLY\"\n );\n }\n\n /// @dev Converts message call's ETH value into WETH.\n function convertEthToWeth()\n internal\n {\n require(\n msg.value > 0,\n \"INVALID_MSG_VALUE\"\n );\n ETHER_TOKEN.deposit.value(msg.value)();\n }\n\n /// @dev Transfers feePercentage of WETH spent on primary orders to feeRecipient.\n /// Refunds any excess ETH to msg.sender.\n /// @param wethSoldExcludingFeeOrders Amount of WETH sold when filling primary orders.\n /// @param wethSoldForZrx Amount of WETH sold when purchasing ZRX required for primary order fees.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n function transferEthFeeAndRefund(\n uint256 wethSoldExcludingFeeOrders,\n uint256 wethSoldForZrx,\n uint256 feePercentage,\n address feeRecipient\n )\n internal\n {\n // Ensure feePercentage is less than 5%.\n require(\n feePercentage <= MAX_FEE_PERCENTAGE,\n \"FEE_PERCENTAGE_TOO_LARGE\"\n );\n\n // Ensure that no extra WETH owned by this contract has been sold.\n uint256 wethSold = safeAdd(wethSoldExcludingFeeOrders, wethSoldForZrx);\n require(\n wethSold <= msg.value,\n \"OVERSOLD_WETH\"\n );\n\n // Calculate amount of WETH that hasn't been sold.\n uint256 wethRemaining = safeSub(msg.value, wethSold);\n\n // Calculate ETH fee to pay to feeRecipient.\n uint256 ethFee = getPartialAmountFloor(\n feePercentage,\n PERCENTAGE_DENOMINATOR,\n wethSoldExcludingFeeOrders\n );\n\n // Ensure fee is less than amount of WETH remaining.\n require(\n ethFee <= wethRemaining,\n \"INSUFFICIENT_ETH_REMAINING\"\n );\n \n // Do nothing if no WETH remaining\n if (wethRemaining > 0) {\n // Convert remaining WETH to ETH\n ETHER_TOKEN.withdraw(wethRemaining);\n\n // Pay ETH to feeRecipient\n if (ethFee > 0) {\n feeRecipient.transfer(ethFee);\n }\n\n // Refund remaining ETH to msg.sender.\n uint256 ethRefund = safeSub(wethRemaining, ethFee);\n if (ethRefund > 0) {\n msg.sender.transfer(ethRefund);\n }\n }\n }\n}\n",
- "2.0.0/extensions/Forwarder/interfaces/IAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IAssets {\n\n /// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to \n /// function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be\n /// used to withdraw assets that were accidentally sent to this contract.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of ERC20 token to withdraw.\n function withdrawAsset(\n bytes assetData,\n uint256 amount\n )\n external;\n}\n",
- "2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../../protocol/Exchange/libs/LibFillResults.sol\";\n\n\ncontract IForwarderCore {\n\n /// @dev Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketSellOrdersWithEth(\n LibOrder.Order[] memory orders,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n LibFillResults.FillResults memory orderFillResults,\n LibFillResults.FillResults memory feeOrderFillResults\n );\n\n /// @dev Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param makerAssetFillAmount Desired amount of makerAsset to purchase.\n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketBuyOrdersWithEth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n LibFillResults.FillResults memory orderFillResults,\n LibFillResults.FillResults memory feeOrderFillResults\n );\n}\n",
- "2.0.0/extensions/Forwarder/libs/LibConstants.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/LibBytes/LibBytes.sol\";\nimport \"../../../protocol/Exchange/interfaces/IExchange.sol\";\nimport \"../../../tokens/EtherToken/IEtherToken.sol\";\nimport \"../../../tokens/ERC20Token/IERC20Token.sol\";\n\n\ncontract LibConstants {\n\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n uint256 constant internal MAX_UINT = 2**256 - 1;\n uint256 constant internal PERCENTAGE_DENOMINATOR = 10**18; \n uint256 constant internal MAX_FEE_PERCENTAGE = 5 * PERCENTAGE_DENOMINATOR / 100; // 5%\n uint256 constant internal MAX_WETH_FILL_PERCENTAGE = 95 * PERCENTAGE_DENOMINATOR / 100; // 95%\n \n // solhint-disable var-name-mixedcase\n IExchange internal EXCHANGE;\n IEtherToken internal ETHER_TOKEN;\n IERC20Token internal ZRX_TOKEN;\n bytes internal ZRX_ASSET_DATA;\n bytes internal WETH_ASSET_DATA;\n // solhint-enable var-name-mixedcase\n\n constructor (\n address _exchange,\n bytes memory _zrxAssetData,\n bytes memory _wethAssetData\n )\n public\n {\n EXCHANGE = IExchange(_exchange);\n ZRX_ASSET_DATA = _zrxAssetData;\n WETH_ASSET_DATA = _wethAssetData;\n\n address etherToken = _wethAssetData.readAddress(16);\n address zrxToken = _zrxAssetData.readAddress(16);\n ETHER_TOKEN = IEtherToken(etherToken);\n ZRX_TOKEN = IERC20Token(zrxToken);\n }\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAssets.sol\";\n\n\ncontract MAssets is\n IAssets\n{\n /// @dev Transfers given amount of asset to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferAssetToSender(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n\n /// @dev Decodes ERC20 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC20Token(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n\n /// @dev Decodes ERC721 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC721Token(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../../protocol/Exchange/libs/LibFillResults.sol\";\n\n\ncontract MExchangeWrapper {\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of WETH has been sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param wethSellAmount Desired amount of WETH to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellWeth(\n LibOrder.Order[] memory orders,\n uint256 wethSellAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// The asset being sold by taker must always be WETH.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyExactAmountWithWeth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Buys zrxBuyAmount of ZRX fee tokens, taking into account ZRX fees for each order. This will guarantee\n /// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues).\n /// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX\n /// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases.\n /// The asset being sold by taker must always be WETH. \n /// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset.\n /// @param zrxBuyAmount Desired amount of ZRX to buy.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return totalFillResults Amounts filled and fees paid by maker and taker.\n function marketBuyExactZrxWithWeth(\n LibOrder.Order[] memory orders,\n uint256 zrxBuyAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MWeth.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract MWeth {\n\n /// @dev Converts message call's ETH value into WETH.\n function convertEthToWeth()\n internal;\n\n /// @dev Transfers feePercentage of WETH spent on primary orders to feeRecipient.\n /// Refunds any excess ETH to msg.sender.\n /// @param wethSoldExcludingFeeOrders Amount of WETH sold when filling primary orders.\n /// @param wethSoldForZrx Amount of WETH sold when purchasing ZRX required for primary order fees.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n function transferEthFeeAndRefund(\n uint256 wethSoldExcludingFeeOrders,\n uint256 wethSoldForZrx,\n uint256 feePercentage,\n address feeRecipient\n )\n internal;\n}\n",
- "2.0.0/extensions/OrderValidator/OrderValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../protocol/Exchange/interfaces/IExchange.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../tokens/ERC20Token/IERC20Token.sol\";\nimport \"../../tokens/ERC721Token/IERC721Token.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\n\n\ncontract OrderValidator {\n\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n\n struct TraderInfo {\n uint256 makerBalance; // Maker's balance of makerAsset\n uint256 makerAllowance; // Maker's allowance to corresponding AssetProxy\n uint256 takerBalance; // Taker's balance of takerAsset\n uint256 takerAllowance; // Taker's allowance to corresponding AssetProxy\n uint256 makerZrxBalance; // Maker's balance of ZRX\n uint256 makerZrxAllowance; // Maker's allowance of ZRX to ERC20Proxy\n uint256 takerZrxBalance; // Taker's balance of ZRX\n uint256 takerZrxAllowance; // Taker's allowance of ZRX to ERC20Proxy\n }\n\n // solhint-disable var-name-mixedcase\n IExchange internal EXCHANGE;\n bytes internal ZRX_ASSET_DATA;\n // solhint-enable var-name-mixedcase\n\n constructor (address _exchange, bytes memory _zrxAssetData)\n public\n {\n EXCHANGE = IExchange(_exchange);\n ZRX_ASSET_DATA = _zrxAssetData;\n }\n\n /// @dev Fetches information for order and maker/taker of order.\n /// @param order The order structure.\n /// @param takerAddress Address that will be filling the order.\n /// @return OrderInfo and TraderInfo instances for given order.\n function getOrderAndTraderInfo(LibOrder.Order memory order, address takerAddress)\n public\n view\n returns (LibOrder.OrderInfo memory orderInfo, TraderInfo memory traderInfo)\n {\n orderInfo = EXCHANGE.getOrderInfo(order);\n traderInfo = getTraderInfo(order, takerAddress);\n return (orderInfo, traderInfo);\n }\n\n /// @dev Fetches information for all passed in orders and the makers/takers of each order.\n /// @param orders Array of order specifications.\n /// @param takerAddresses Array of taker addresses corresponding to each order.\n /// @return Arrays of OrderInfo and TraderInfo instances that correspond to each order.\n function getOrdersAndTradersInfo(LibOrder.Order[] memory orders, address[] memory takerAddresses)\n public\n view\n returns (LibOrder.OrderInfo[] memory ordersInfo, TraderInfo[] memory tradersInfo)\n {\n ordersInfo = EXCHANGE.getOrdersInfo(orders);\n tradersInfo = getTradersInfo(orders, takerAddresses);\n return (ordersInfo, tradersInfo);\n }\n\n /// @dev Fetches balance and allowances for maker and taker of order.\n /// @param order The order structure.\n /// @param takerAddress Address that will be filling the order.\n /// @return Balances and allowances of maker and taker of order.\n function getTraderInfo(LibOrder.Order memory order, address takerAddress)\n public\n view\n returns (TraderInfo memory traderInfo)\n {\n (traderInfo.makerBalance, traderInfo.makerAllowance) = getBalanceAndAllowance(order.makerAddress, order.makerAssetData);\n (traderInfo.takerBalance, traderInfo.takerAllowance) = getBalanceAndAllowance(takerAddress, order.takerAssetData);\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n (traderInfo.makerZrxBalance, traderInfo.makerZrxAllowance) = getBalanceAndAllowance(order.makerAddress, zrxAssetData);\n (traderInfo.takerZrxBalance, traderInfo.takerZrxAllowance) = getBalanceAndAllowance(takerAddress, zrxAssetData);\n return traderInfo;\n }\n\n /// @dev Fetches balances and allowances of maker and taker for each provided order.\n /// @param orders Array of order specifications.\n /// @param takerAddresses Array of taker addresses corresponding to each order.\n /// @return Array of balances and allowances for maker and taker of each order.\n function getTradersInfo(LibOrder.Order[] memory orders, address[] memory takerAddresses)\n public\n view\n returns (TraderInfo[] memory)\n {\n uint256 ordersLength = orders.length;\n TraderInfo[] memory tradersInfo = new TraderInfo[](ordersLength);\n for (uint256 i = 0; i != ordersLength; i++) {\n tradersInfo[i] = getTraderInfo(orders[i], takerAddresses[i]);\n }\n return tradersInfo;\n }\n\n /// @dev Fetches token balances and allowances of an address to given assetProxy. Supports ERC20 and ERC721.\n /// @param target Address to fetch balances and allowances of.\n /// @param assetData Encoded data that can be decoded by a specified proxy contract when transferring asset.\n /// @return Balance of asset and allowance set to given proxy of asset.\n /// For ERC721 tokens, these values will always be 1 or 0.\n function getBalanceAndAllowance(address target, bytes memory assetData)\n public\n view\n returns (uint256 balance, uint256 allowance)\n {\n bytes4 assetProxyId = assetData.readBytes4(0);\n address token = assetData.readAddress(16);\n address assetProxy = EXCHANGE.getAssetProxy(assetProxyId);\n\n if (assetProxyId == ERC20_DATA_ID) {\n // Query balance\n balance = IERC20Token(token).balanceOf(target);\n\n // Query allowance\n allowance = IERC20Token(token).allowance(target, assetProxy);\n } else if (assetProxyId == ERC721_DATA_ID) {\n uint256 tokenId = assetData.readUint256(36);\n\n // Query owner of tokenId\n address owner = getERC721TokenOwner(token, tokenId);\n\n // Set balance to 1 if tokenId is owned by target\n balance = target == owner ? 1 : 0;\n\n // Check if ERC721Proxy is approved to spend tokenId\n bool isApproved = IERC721Token(token).isApprovedForAll(target, assetProxy) || IERC721Token(token).getApproved(tokenId) == assetProxy;\n \n // Set alowance to 1 if ERC721Proxy is approved to spend tokenId\n allowance = isApproved ? 1 : 0;\n } else {\n revert(\"UNSUPPORTED_ASSET_PROXY\");\n }\n return (balance, allowance);\n }\n\n /// @dev Fetches token balances and allowances of an address for each given assetProxy. Supports ERC20 and ERC721.\n /// @param target Address to fetch balances and allowances of.\n /// @param assetData Array of encoded byte arrays that can be decoded by a specified proxy contract when transferring asset.\n /// @return Balances and allowances of assets.\n /// For ERC721 tokens, these values will always be 1 or 0.\n function getBalancesAndAllowances(address target, bytes[] memory assetData)\n public\n view\n returns (uint256[] memory, uint256[] memory)\n {\n uint256 length = assetData.length;\n uint256[] memory balances = new uint256[](length);\n uint256[] memory allowances = new uint256[](length);\n for (uint256 i = 0; i != length; i++) {\n (balances[i], allowances[i]) = getBalanceAndAllowance(target, assetData[i]);\n }\n return (balances, allowances);\n }\n\n /// @dev Calls `token.ownerOf(tokenId)`, but returns a null owner instead of reverting on an unowned token.\n /// @param token Address of ERC721 token.\n /// @param tokenId The identifier for the specific NFT.\n /// @return Owner of tokenId or null address if unowned.\n function getERC721TokenOwner(address token, uint256 tokenId)\n public\n view\n returns (address owner)\n {\n assembly {\n // load free memory pointer\n let cdStart := mload(64)\n\n // bytes4(keccak256(ownerOf(uint256))) = 0x6352211e\n mstore(cdStart, 0x6352211e00000000000000000000000000000000000000000000000000000000)\n mstore(add(cdStart, 4), tokenId)\n\n // staticcall `ownerOf(tokenId)`\n // `ownerOf` will revert if tokenId is not owned\n let success := staticcall(\n gas, // forward all gas\n token, // call token contract\n cdStart, // start of calldata\n 36, // length of input is 36 bytes\n cdStart, // write output over input\n 32 // size of output is 32 bytes\n )\n\n // Success implies that tokenId is owned\n // Copy owner from return data if successful\n if success {\n owner := mload(cdStart)\n } \n }\n\n // Owner initialized to address(0), no need to modify if call is unsuccessful\n return owner;\n }\n}\n",
- "2.0.0/multisig/MultiSigWallet.sol": "// solhint-disable\npragma solidity ^0.4.15;\n\n\n/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.\n/// @author Stefan George - <stefan.george@consensys.net>\ncontract MultiSigWallet {\n\n /*\n * Events\n */\n event Confirmation(address indexed sender, uint indexed transactionId);\n event Revocation(address indexed sender, uint indexed transactionId);\n event Submission(uint indexed transactionId);\n event Execution(uint indexed transactionId);\n event ExecutionFailure(uint indexed transactionId);\n event Deposit(address indexed sender, uint value);\n event OwnerAddition(address indexed owner);\n event OwnerRemoval(address indexed owner);\n event RequirementChange(uint required);\n\n /*\n * Constants\n */\n uint constant public MAX_OWNER_COUNT = 50;\n\n /*\n * Storage\n */\n mapping (uint => Transaction) public transactions;\n mapping (uint => mapping (address => bool)) public confirmations;\n mapping (address => bool) public isOwner;\n address[] public owners;\n uint public required;\n uint public transactionCount;\n\n struct Transaction {\n address destination;\n uint value;\n bytes data;\n bool executed;\n }\n\n /*\n * Modifiers\n */\n modifier onlyWallet() {\n require(msg.sender == address(this));\n _;\n }\n\n modifier ownerDoesNotExist(address owner) {\n require(!isOwner[owner]);\n _;\n }\n\n modifier ownerExists(address owner) {\n require(isOwner[owner]);\n _;\n }\n\n modifier transactionExists(uint transactionId) {\n require(transactions[transactionId].destination != 0);\n _;\n }\n\n modifier confirmed(uint transactionId, address owner) {\n require(confirmations[transactionId][owner]);\n _;\n }\n\n modifier notConfirmed(uint transactionId, address owner) {\n require(!confirmations[transactionId][owner]);\n _;\n }\n\n modifier notExecuted(uint transactionId) {\n require(!transactions[transactionId].executed);\n _;\n }\n\n modifier notNull(address _address) {\n require(_address != 0);\n _;\n }\n\n modifier validRequirement(uint ownerCount, uint _required) {\n require(ownerCount <= MAX_OWNER_COUNT\n && _required <= ownerCount\n && _required != 0\n && ownerCount != 0);\n _;\n }\n\n /// @dev Fallback function allows to deposit ether.\n function()\n payable\n {\n if (msg.value > 0)\n Deposit(msg.sender, msg.value);\n }\n\n /*\n * Public functions\n */\n /// @dev Contract constructor sets initial owners and required number of confirmations.\n /// @param _owners List of initial owners.\n /// @param _required Number of required confirmations.\n function MultiSigWallet(address[] _owners, uint _required)\n public\n validRequirement(_owners.length, _required)\n {\n for (uint i=0; i<_owners.length; i++) {\n require(!isOwner[_owners[i]] && _owners[i] != 0);\n isOwner[_owners[i]] = true;\n }\n owners = _owners;\n required = _required;\n }\n\n /// @dev Allows to add a new owner. Transaction has to be sent by wallet.\n /// @param owner Address of new owner.\n function addOwner(address owner)\n public\n onlyWallet\n ownerDoesNotExist(owner)\n notNull(owner)\n validRequirement(owners.length + 1, required)\n {\n isOwner[owner] = true;\n owners.push(owner);\n OwnerAddition(owner);\n }\n\n /// @dev Allows to remove an owner. Transaction has to be sent by wallet.\n /// @param owner Address of owner.\n function removeOwner(address owner)\n public\n onlyWallet\n ownerExists(owner)\n {\n isOwner[owner] = false;\n for (uint i=0; i<owners.length - 1; i++)\n if (owners[i] == owner) {\n owners[i] = owners[owners.length - 1];\n break;\n }\n owners.length -= 1;\n if (required > owners.length)\n changeRequirement(owners.length);\n OwnerRemoval(owner);\n }\n\n /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet.\n /// @param owner Address of owner to be replaced.\n /// @param newOwner Address of new owner.\n function replaceOwner(address owner, address newOwner)\n public\n onlyWallet\n ownerExists(owner)\n ownerDoesNotExist(newOwner)\n {\n for (uint i=0; i<owners.length; i++)\n if (owners[i] == owner) {\n owners[i] = newOwner;\n break;\n }\n isOwner[owner] = false;\n isOwner[newOwner] = true;\n OwnerRemoval(owner);\n OwnerAddition(newOwner);\n }\n\n /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet.\n /// @param _required Number of required confirmations.\n function changeRequirement(uint _required)\n public\n onlyWallet\n validRequirement(owners.length, _required)\n {\n required = _required;\n RequirementChange(_required);\n }\n\n /// @dev Allows an owner to submit and confirm a transaction.\n /// @param destination Transaction target address.\n /// @param value Transaction ether value.\n /// @param data Transaction data payload.\n /// @return Returns transaction ID.\n function submitTransaction(address destination, uint value, bytes data)\n public\n returns (uint transactionId)\n {\n transactionId = addTransaction(destination, value, data);\n confirmTransaction(transactionId);\n }\n\n /// @dev Allows an owner to confirm a transaction.\n /// @param transactionId Transaction ID.\n function confirmTransaction(uint transactionId)\n public\n ownerExists(msg.sender)\n transactionExists(transactionId)\n notConfirmed(transactionId, msg.sender)\n {\n confirmations[transactionId][msg.sender] = true;\n Confirmation(msg.sender, transactionId);\n executeTransaction(transactionId);\n }\n\n /// @dev Allows an owner to revoke a confirmation for a transaction.\n /// @param transactionId Transaction ID.\n function revokeConfirmation(uint transactionId)\n public\n ownerExists(msg.sender)\n confirmed(transactionId, msg.sender)\n notExecuted(transactionId)\n {\n confirmations[transactionId][msg.sender] = false;\n Revocation(msg.sender, transactionId);\n }\n\n /// @dev Allows anyone to execute a confirmed transaction.\n /// @param transactionId Transaction ID.\n function executeTransaction(uint transactionId)\n public\n ownerExists(msg.sender)\n confirmed(transactionId, msg.sender)\n notExecuted(transactionId)\n {\n if (isConfirmed(transactionId)) {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data))\n Execution(transactionId);\n else {\n ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n }\n\n // call has been separated into its own function in order to take advantage\n // of the Solidity's code generator to produce a loop that copies tx.data into memory.\n function external_call(address destination, uint value, uint dataLength, bytes data) internal returns (bool) {\n bool result;\n assembly {\n let x := mload(0x40) // \"Allocate\" memory for output (0x40 is where \"free memory\" pointer is stored by convention)\n let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that\n result := call(\n sub(gas, 34710), // 34710 is the value that solidity is currently emitting\n // It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) +\n // callNewAccountGas (25000, in case the destination address does not exist and needs creating)\n destination,\n value,\n d,\n dataLength, // Size of the input (in bytes) - this is what fixes the padding problem\n x,\n 0 // Output is ignored, therefore the output size is zero\n )\n }\n return result;\n }\n\n /// @dev Returns the confirmation status of a transaction.\n /// @param transactionId Transaction ID.\n /// @return Confirmation status.\n function isConfirmed(uint transactionId)\n public\n constant\n returns (bool)\n {\n uint count = 0;\n for (uint i=0; i<owners.length; i++) {\n if (confirmations[transactionId][owners[i]])\n count += 1;\n if (count == required)\n return true;\n }\n }\n\n /*\n * Internal functions\n */\n /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet.\n /// @param destination Transaction target address.\n /// @param value Transaction ether value.\n /// @param data Transaction data payload.\n /// @return Returns transaction ID.\n function addTransaction(address destination, uint value, bytes data)\n internal\n notNull(destination)\n returns (uint transactionId)\n {\n transactionId = transactionCount;\n transactions[transactionId] = Transaction({\n destination: destination,\n value: value,\n data: data,\n executed: false\n });\n transactionCount += 1;\n Submission(transactionId);\n }\n\n /*\n * Web3 call functions\n */\n /// @dev Returns number of confirmations of a transaction.\n /// @param transactionId Transaction ID.\n /// @return Number of confirmations.\n function getConfirmationCount(uint transactionId)\n public\n constant\n returns (uint count)\n {\n for (uint i=0; i<owners.length; i++)\n if (confirmations[transactionId][owners[i]])\n count += 1;\n }\n\n /// @dev Returns total number of transactions after filers are applied.\n /// @param pending Include pending transactions.\n /// @param executed Include executed transactions.\n /// @return Total number of transactions after filters are applied.\n function getTransactionCount(bool pending, bool executed)\n public\n constant\n returns (uint count)\n {\n for (uint i=0; i<transactionCount; i++)\n if ( pending && !transactions[i].executed\n || executed && transactions[i].executed)\n count += 1;\n }\n\n /// @dev Returns list of owners.\n /// @return List of owner addresses.\n function getOwners()\n public\n constant\n returns (address[])\n {\n return owners;\n }\n\n /// @dev Returns array with owner addresses, which confirmed transaction.\n /// @param transactionId Transaction ID.\n /// @return Returns array of owner addresses.\n function getConfirmations(uint transactionId)\n public\n constant\n returns (address[] _confirmations)\n {\n address[] memory confirmationsTemp = new address[](owners.length);\n uint count = 0;\n uint i;\n for (i=0; i<owners.length; i++)\n if (confirmations[transactionId][owners[i]]) {\n confirmationsTemp[count] = owners[i];\n count += 1;\n }\n _confirmations = new address[](count);\n for (i=0; i<count; i++)\n _confirmations[i] = confirmationsTemp[i];\n }\n\n /// @dev Returns list of transaction IDs in defined range.\n /// @param from Index start position of transaction array.\n /// @param to Index end position of transaction array.\n /// @param pending Include pending transactions.\n /// @param executed Include executed transactions.\n /// @return Returns array of transaction IDs.\n function getTransactionIds(uint from, uint to, bool pending, bool executed)\n public\n constant\n returns (uint[] _transactionIds)\n {\n uint[] memory transactionIdsTemp = new uint[](transactionCount);\n uint count = 0;\n uint i;\n for (i=0; i<transactionCount; i++)\n if ( pending && !transactions[i].executed\n || executed && transactions[i].executed)\n {\n transactionIdsTemp[count] = i;\n count += 1;\n }\n _transactionIds = new uint[](to - from);\n for (i=from; i<to; i++)\n _transactionIds[i - from] = transactionIdsTemp[i];\n }\n}",
- "2.0.0/multisig/MultiSigWalletWithTimeLock.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MultiSigWallet.sol\";\n\n\n/// @title Multisignature wallet with time lock- Allows multiple parties to execute a transaction after a time lock has passed.\n/// @author Amir Bandeali - <amir@0xProject.com>\n// solhint-disable not-rely-on-time\ncontract MultiSigWalletWithTimeLock is\n MultiSigWallet\n{\n event ConfirmationTimeSet(uint256 indexed transactionId, uint256 confirmationTime);\n event TimeLockChange(uint256 secondsTimeLocked);\n\n uint256 public secondsTimeLocked;\n\n mapping (uint256 => uint256) public confirmationTimes;\n\n modifier notFullyConfirmed(uint256 transactionId) {\n require(\n !isConfirmed(transactionId),\n \"TX_FULLY_CONFIRMED\"\n );\n _;\n }\n\n modifier fullyConfirmed(uint256 transactionId) {\n require(\n isConfirmed(transactionId),\n \"TX_NOT_FULLY_CONFIRMED\"\n );\n _;\n }\n\n modifier pastTimeLock(uint256 transactionId) {\n require(\n block.timestamp >= confirmationTimes[transactionId] + secondsTimeLocked,\n \"TIME_LOCK_INCOMPLETE\"\n );\n _;\n }\n\n /// @dev Contract constructor sets initial owners, required number of confirmations, and time lock.\n /// @param _owners List of initial owners.\n /// @param _required Number of required confirmations.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n constructor (\n address[] _owners,\n uint256 _required,\n uint256 _secondsTimeLocked\n )\n public\n MultiSigWallet(_owners, _required)\n {\n secondsTimeLocked = _secondsTimeLocked;\n }\n\n /// @dev Changes the duration of the time lock for transactions.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n function changeTimeLock(uint256 _secondsTimeLocked)\n public\n onlyWallet\n {\n secondsTimeLocked = _secondsTimeLocked;\n emit TimeLockChange(_secondsTimeLocked);\n }\n\n /// @dev Allows an owner to confirm a transaction.\n /// @param transactionId Transaction ID.\n function confirmTransaction(uint256 transactionId)\n public\n ownerExists(msg.sender)\n transactionExists(transactionId)\n notConfirmed(transactionId, msg.sender)\n notFullyConfirmed(transactionId)\n {\n confirmations[transactionId][msg.sender] = true;\n emit Confirmation(msg.sender, transactionId);\n if (isConfirmed(transactionId)) {\n setConfirmationTime(transactionId, block.timestamp);\n }\n }\n\n /// @dev Allows anyone to execute a confirmed transaction.\n /// @param transactionId Transaction ID.\n function executeTransaction(uint256 transactionId)\n public\n notExecuted(transactionId)\n fullyConfirmed(transactionId)\n pastTimeLock(transactionId)\n {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) {\n emit Execution(transactionId);\n } else {\n emit ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n\n /// @dev Sets the time of when a submission first passed.\n function setConfirmationTime(uint256 transactionId, uint256 confirmationTime)\n internal\n {\n confirmationTimes[transactionId] = confirmationTime;\n emit ConfirmationTimeSet(transactionId, confirmationTime);\n }\n}\n",
- "2.0.0/protocol/AssetProxy/ERC20Proxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MixinAuthorizable.sol\";\n\n\ncontract ERC20Proxy is\n MixinAuthorizable\n{\n // Id of this proxy.\n bytes4 constant internal PROXY_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n \n // solhint-disable-next-line payable-fallback\n function () \n external\n {\n assembly {\n // The first 4 bytes of calldata holds the function selector\n let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)\n\n // `transferFrom` will be called with the following parameters:\n // assetData Encoded byte array.\n // from Address to transfer asset from.\n // to Address to transfer asset to.\n // amount Amount of asset to transfer.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {\n\n // To lookup a value in a mapping, we load from the storage location keccak256(k, p),\n // where k is the key left padded to 32 bytes and p is the storage slot\n let start := mload(64)\n mstore(start, and(caller, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(start, 32), authorized_slot)\n\n // Revert if authorized[msg.sender] == false\n if iszero(sload(keccak256(start, 64))) {\n // Revert with `Error(\"SENDER_NOT_AUTHORIZED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // `transferFrom`.\n // The function is marked `external`, so no abi decodeding is done for\n // us. Instead, we expect the `calldata` memory to contain the\n // following:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n //\n // (*): offset is computed from start of function parameters, so offset\n // by an additional 4 bytes in the calldata.\n //\n // (**): see table below to compute length of assetData Contents\n //\n // WARNING: The ABIv2 specification allows additional padding between\n // the Params and Data section. This will result in a larger\n // offset to assetData.\n\n // Asset data itself is encoded as follows:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 1 * 32 | function parameters: |\n // | | 4 | 12 + 20 | 1. token address |\n\n // We construct calldata for the `token.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 4 | | 1. from |\n // | | 36 | | 2. to |\n // | | 68 | | 3. amount |\n\n /////// Read token address from calldata ///////\n // * The token address is stored in `assetData`.\n //\n // * The \"offset to assetData\" is stored at offset 4 in the calldata (table 1).\n // [assetDataOffsetFromParams = calldataload(4)]\n //\n // * Notes that the \"offset to assetData\" is relative to the \"Params\" area of calldata;\n // add 4 bytes to account for the length of the \"Header\" area (table 1).\n // [assetDataOffsetFromHeader = assetDataOffsetFromParams + 4]\n //\n // * The \"token address\" is offset 32+4=36 bytes into \"assetData\" (tables 1 & 2).\n // [tokenOffset = assetDataOffsetFromHeader + 36 = calldataload(4) + 4 + 36]\n let token := calldataload(add(calldataload(4), 40))\n \n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFrom` selector.\n // Any trailing data in transferFromSelector will be\n // overwritten in the next `mstore` call.\n mstore(0, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // We copy the fields `from`, `to` and `amount` in bulk\n // from our own calldata to the new calldata.\n calldatacopy(4, 36, 96)\n\n /////// Call `token.transferFrom` using the calldata ///////\n let success := call(\n gas, // forward all gas\n token, // call address of token contract\n 0, // don't send any ETH\n 0, // pointer to start of input\n 100, // length of input\n 0, // write output over input\n 32 // output size should be 32 bytes\n )\n\n /////// Check return data. ///////\n // If there is no return data, we assume the token incorrectly\n // does not return a bool. In this case we expect it to revert\n // on failure, which was handled above.\n // If the token does return data, we require that it is a single\n // nonzero 32 bytes value.\n // So the transfer succeeded if the call succeeded and either\n // returned nothing, or returned a non-zero 32 byte value. \n success := and(success, or(\n iszero(returndatasize),\n and(\n eq(returndatasize, 32),\n gt(mload(0), 0)\n )\n ))\n if success {\n return(0, 0)\n }\n \n // Revert with `Error(\"TRANSFER_FAILED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // Revert if undefined function is called\n revert(0, 0)\n }\n }\n\n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4)\n {\n return PROXY_ID;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/ERC721Proxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MixinAuthorizable.sol\";\n\n\ncontract ERC721Proxy is\n MixinAuthorizable\n{\n // Id of this proxy.\n bytes4 constant internal PROXY_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n\n // solhint-disable-next-line payable-fallback\n function () \n external\n {\n assembly {\n // The first 4 bytes of calldata holds the function selector\n let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)\n\n // `transferFrom` will be called with the following parameters:\n // assetData Encoded byte array.\n // from Address to transfer asset from.\n // to Address to transfer asset to.\n // amount Amount of asset to transfer.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {\n\n // To lookup a value in a mapping, we load from the storage location keccak256(k, p),\n // where k is the key left padded to 32 bytes and p is the storage slot\n let start := mload(64)\n mstore(start, and(caller, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(start, 32), authorized_slot)\n\n // Revert if authorized[msg.sender] == false\n if iszero(sload(keccak256(start, 64))) {\n // Revert with `Error(\"SENDER_NOT_AUTHORIZED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // `transferFrom`.\n // The function is marked `external`, so no abi decodeding is done for\n // us. Instead, we expect the `calldata` memory to contain the\n // following:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n //\n // (*): offset is computed from start of function parameters, so offset\n // by an additional 4 bytes in the calldata.\n //\n // (**): see table below to compute length of assetData Contents\n //\n // WARNING: The ABIv2 specification allows additional padding between\n // the Params and Data section. This will result in a larger\n // offset to assetData.\n\n // Asset data itself is encoded as follows:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 2 * 32 | function parameters: |\n // | | 4 | 12 + 20 | 1. token address |\n // | | 36 | | 2. tokenId |\n \n // We construct calldata for the `token.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n // \n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 4 | | 1. from |\n // | | 36 | | 2. to |\n // | | 68 | | 3. tokenId |\n\n // There exists only 1 of each token.\n // require(amount == 1, \"INVALID_AMOUNT\")\n if sub(calldataload(100), 1) {\n // Revert with `Error(\"INVALID_AMOUNT\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000e494e56414c49445f414d4f554e540000000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFrom` selector.\n // Any trailing data in transferFromSelector will be\n // overwritten in the next `mstore` call.\n mstore(0, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // We copy the fields `from` and `to` in bulk\n // from our own calldata to the new calldata.\n calldatacopy(4, 36, 64)\n\n // Copy `tokenId` field from our own calldata to the new calldata.\n let assetDataOffset := calldataload(4)\n calldatacopy(68, add(assetDataOffset, 72), 32)\n\n /////// Call `token.transferFrom` using the calldata ///////\n let token := calldataload(add(assetDataOffset, 40))\n let success := call(\n gas, // forward all gas\n token, // call address of token contract\n 0, // don't send any ETH\n 0, // pointer to start of input\n 100, // length of input\n 0, // write output to null\n 0 // output size is 0 bytes\n )\n if success {\n return(0, 0)\n }\n \n // Revert with `Error(\"TRANSFER_FAILED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // Revert if undefined function is called\n revert(0, 0)\n }\n }\n\n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4)\n {\n return PROXY_ID;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/MixinAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"./mixins/MAuthorizable.sol\";\n\n\ncontract MixinAuthorizable is\n Ownable,\n MAuthorizable\n{\n /// @dev Only authorized addresses can invoke functions with this modifier.\n modifier onlyAuthorized {\n require(\n authorized[msg.sender],\n \"SENDER_NOT_AUTHORIZED\"\n );\n _;\n }\n\n mapping (address => bool) public authorized;\n address[] public authorities;\n\n /// @dev Authorizes an address.\n /// @param target Address to authorize.\n function addAuthorizedAddress(address target)\n external\n onlyOwner\n {\n require(\n !authorized[target],\n \"TARGET_ALREADY_AUTHORIZED\"\n );\n\n authorized[target] = true;\n authorities.push(target);\n emit AuthorizedAddressAdded(target, msg.sender);\n }\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n function removeAuthorizedAddress(address target)\n external\n onlyOwner\n {\n require(\n authorized[target],\n \"TARGET_NOT_AUTHORIZED\"\n );\n\n delete authorized[target];\n for (uint256 i = 0; i < authorities.length; i++) {\n if (authorities[i] == target) {\n authorities[i] = authorities[authorities.length - 1];\n authorities.length -= 1;\n break;\n }\n }\n emit AuthorizedAddressRemoved(target, msg.sender);\n }\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n /// @param index Index of target in authorities array.\n function removeAuthorizedAddressAtIndex(\n address target,\n uint256 index\n )\n external\n onlyOwner\n {\n require(\n authorized[target],\n \"TARGET_NOT_AUTHORIZED\"\n );\n require(\n index < authorities.length,\n \"INDEX_OUT_OF_BOUNDS\"\n );\n require(\n authorities[index] == target,\n \"AUTHORIZED_ADDRESS_MISMATCH\"\n );\n\n delete authorized[target];\n authorities[index] = authorities[authorities.length - 1];\n authorities.length -= 1;\n emit AuthorizedAddressRemoved(target, msg.sender);\n }\n\n /// @dev Gets all authorized addresses.\n /// @return Array of authorized addresses.\n function getAuthorizedAddresses()\n external\n view\n returns (address[] memory)\n {\n return authorities;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IAuthorizable.sol\";\n\n\ncontract IAssetProxy is\n IAuthorizable\n{\n /// @dev Transfers assets. Either succeeds or throws.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param from Address to transfer asset from.\n /// @param to Address to transfer asset to.\n /// @param amount Amount of asset to transfer.\n function transferFrom(\n bytes assetData,\n address from,\n address to,\n uint256 amount\n )\n external;\n \n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4);\n}\n",
- "2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/Ownable/IOwnable.sol\";\n\n\ncontract IAuthorizable is\n IOwnable\n{\n /// @dev Authorizes an address.\n /// @param target Address to authorize.\n function addAuthorizedAddress(address target)\n external;\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n function removeAuthorizedAddress(address target)\n external;\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n /// @param index Index of target in authorities array.\n function removeAuthorizedAddressAtIndex(\n address target,\n uint256 index\n )\n external;\n \n /// @dev Gets all authorized addresses.\n /// @return Array of authorized addresses.\n function getAuthorizedAddresses()\n external\n view\n returns (address[] memory);\n}\n",
- "2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAuthorizable.sol\";\n\n\ncontract MAuthorizable is\n IAuthorizable\n{\n // Event logged when a new address is authorized.\n event AuthorizedAddressAdded(\n address indexed target,\n address indexed caller\n );\n\n // Event logged when a currently authorized address is unauthorized.\n event AuthorizedAddressRemoved(\n address indexed target,\n address indexed caller\n );\n\n /// @dev Only authorized addresses can invoke functions with this modifier.\n modifier onlyAuthorized { revert(); _; }\n}\n",
- "2.0.0/protocol/AssetProxyOwner/AssetProxyOwner.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../multisig/MultiSigWalletWithTimeLock.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\n\n\ncontract AssetProxyOwner is\n MultiSigWalletWithTimeLock\n{\n using LibBytes for bytes;\n\n event AssetProxyRegistration(address assetProxyContract, bool isRegistered);\n\n // Mapping of AssetProxy contract address =>\n // if this contract is allowed to call the AssetProxy's `removeAuthorizedAddressAtIndex` method without a time lock.\n mapping (address => bool) public isAssetProxyRegistered;\n\n bytes4 constant internal REMOVE_AUTHORIZED_ADDRESS_AT_INDEX_SELECTOR = bytes4(keccak256(\"removeAuthorizedAddressAtIndex(address,uint256)\"));\n\n /// @dev Function will revert if the transaction does not call `removeAuthorizedAddressAtIndex`\n /// on an approved AssetProxy contract.\n modifier validRemoveAuthorizedAddressAtIndexTx(uint256 transactionId) {\n Transaction storage txn = transactions[transactionId];\n require(\n isAssetProxyRegistered[txn.destination],\n \"UNREGISTERED_ASSET_PROXY\"\n );\n require(\n txn.data.readBytes4(0) == REMOVE_AUTHORIZED_ADDRESS_AT_INDEX_SELECTOR,\n \"INVALID_FUNCTION_SELECTOR\"\n );\n _;\n }\n\n /// @dev Contract constructor sets initial owners, required number of confirmations,\n /// time lock, and list of AssetProxy addresses.\n /// @param _owners List of initial owners.\n /// @param _assetProxyContracts Array of AssetProxy contract addresses.\n /// @param _required Number of required confirmations.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n constructor (\n address[] memory _owners,\n address[] memory _assetProxyContracts,\n uint256 _required,\n uint256 _secondsTimeLocked\n )\n public\n MultiSigWalletWithTimeLock(_owners, _required, _secondsTimeLocked)\n {\n for (uint256 i = 0; i < _assetProxyContracts.length; i++) {\n address assetProxy = _assetProxyContracts[i];\n require(\n assetProxy != address(0),\n \"INVALID_ASSET_PROXY\"\n );\n isAssetProxyRegistered[assetProxy] = true;\n }\n }\n\n /// @dev Registers or deregisters an AssetProxy to be able to execute\n /// `removeAuthorizedAddressAtIndex` without a timelock.\n /// @param assetProxyContract Address of AssetProxy contract.\n /// @param isRegistered Status of approval for AssetProxy contract.\n function registerAssetProxy(address assetProxyContract, bool isRegistered)\n public\n onlyWallet\n notNull(assetProxyContract)\n {\n isAssetProxyRegistered[assetProxyContract] = isRegistered;\n emit AssetProxyRegistration(assetProxyContract, isRegistered);\n }\n\n /// @dev Allows execution of `removeAuthorizedAddressAtIndex` without time lock.\n /// @param transactionId Transaction ID.\n function executeRemoveAuthorizedAddressAtIndex(uint256 transactionId)\n public\n notExecuted(transactionId)\n fullyConfirmed(transactionId)\n validRemoveAuthorizedAddressAtIndexTx(transactionId)\n {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) {\n emit Execution(transactionId);\n } else {\n emit ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/Exchange.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./MixinExchangeCore.sol\";\nimport \"./MixinSignatureValidator.sol\";\nimport \"./MixinWrapperFunctions.sol\";\nimport \"./MixinAssetProxyDispatcher.sol\";\nimport \"./MixinTransactions.sol\";\nimport \"./MixinMatchOrders.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract Exchange is\n MixinExchangeCore,\n MixinMatchOrders,\n MixinSignatureValidator,\n MixinTransactions,\n MixinAssetProxyDispatcher,\n MixinWrapperFunctions\n{\n string constant public VERSION = \"2.0.1-alpha\";\n\n // Mixins are instantiated in the order they are inherited\n constructor (bytes memory _zrxAssetData)\n public\n LibConstants(_zrxAssetData) // @TODO: Remove when we deploy.\n MixinExchangeCore()\n MixinMatchOrders()\n MixinSignatureValidator()\n MixinTransactions()\n MixinAssetProxyDispatcher()\n MixinWrapperFunctions()\n {}\n}\n",
- "2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\nimport \"../AssetProxy/interfaces/IAssetProxy.sol\";\n\n\ncontract MixinAssetProxyDispatcher is\n Ownable,\n MAssetProxyDispatcher\n{\n // Mapping from Asset Proxy Id's to their respective Asset Proxy\n mapping (bytes4 => IAssetProxy) public assetProxies;\n\n /// @dev Registers an asset proxy to its asset proxy id.\n /// Once an asset proxy is registered, it cannot be unregistered.\n /// @param assetProxy Address of new asset proxy to register.\n function registerAssetProxy(address assetProxy)\n external\n onlyOwner\n {\n IAssetProxy assetProxyContract = IAssetProxy(assetProxy);\n\n // Ensure that no asset proxy exists with current id.\n bytes4 assetProxyId = assetProxyContract.getProxyId();\n address currentAssetProxy = assetProxies[assetProxyId];\n require(\n currentAssetProxy == address(0),\n \"ASSET_PROXY_ALREADY_EXISTS\"\n );\n\n // Add asset proxy and log registration.\n assetProxies[assetProxyId] = assetProxyContract;\n emit AssetProxyRegistered(\n assetProxyId,\n assetProxy\n );\n }\n\n /// @dev Gets an asset proxy.\n /// @param assetProxyId Id of the asset proxy.\n /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered.\n function getAssetProxy(bytes4 assetProxyId)\n external\n view\n returns (address)\n {\n return assetProxies[assetProxyId];\n }\n\n /// @dev Forwards arguments to assetProxy and calls `transferFrom`. Either succeeds or throws.\n /// @param assetData Byte array encoded for the asset.\n /// @param from Address to transfer token from.\n /// @param to Address to transfer token to.\n /// @param amount Amount of token to transfer.\n function dispatchTransferFrom(\n bytes memory assetData,\n address from,\n address to,\n uint256 amount\n )\n internal\n {\n // Do nothing if no amount should be transferred.\n if (amount > 0 && from != to) {\n // Ensure assetData length is valid\n require(\n assetData.length > 3,\n \"LENGTH_GREATER_THAN_3_REQUIRED\"\n );\n \n // Lookup assetProxy. We do not use `LibBytes.readBytes4` for gas efficiency reasons.\n bytes4 assetProxyId;\n assembly {\n assetProxyId := and(mload(\n add(assetData, 32)),\n 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000\n )\n }\n address assetProxy = assetProxies[assetProxyId];\n\n // Ensure that assetProxy exists\n require(\n assetProxy != address(0),\n \"ASSET_PROXY_DOES_NOT_EXIST\"\n );\n \n // We construct calldata for the `assetProxy.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n // \n // | Area | Offset | Length | Contents |\n // | -------- |--------|---------|-------------------------------------------- |\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n\n assembly {\n /////// Setup State ///////\n // `cdStart` is the start of the calldata for `assetProxy.transferFrom` (equal to free memory ptr).\n let cdStart := mload(64)\n // `dataAreaLength` is the total number of words needed to store `assetData`\n // As-per the ABI spec, this value is padded up to the nearest multiple of 32,\n // and includes 32-bytes for length.\n let dataAreaLength := and(add(mload(assetData), 63), 0xFFFFFFFFFFFE0)\n // `cdEnd` is the end of the calldata for `assetProxy.transferFrom`.\n let cdEnd := add(cdStart, add(132, dataAreaLength))\n\n \n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFromSelector`.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n mstore(cdStart, 0xa85e59e400000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // Each parameter is padded to 32-bytes. The entire Params Area is 128 bytes.\n // Notes:\n // 1. The offset to `assetData` is the length of the Params Area (128 bytes).\n // 2. A 20-byte mask is applied to addresses to zero-out the unused bytes.\n mstore(add(cdStart, 4), 128)\n mstore(add(cdStart, 36), and(from, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(cdStart, 68), and(to, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(cdStart, 100), amount)\n \n /////// Setup Data Area ///////\n // This area holds `assetData`.\n let dataArea := add(cdStart, 132)\n // solhint-disable-next-line no-empty-blocks\n for {} lt(dataArea, cdEnd) {} {\n mstore(dataArea, mload(assetData))\n dataArea := add(dataArea, 32)\n assetData := add(assetData, 32)\n }\n\n /////// Call `assetProxy.transferFrom` using the constructed calldata ///////\n let success := call(\n gas, // forward all gas\n assetProxy, // call address of asset proxy\n 0, // don't send any ETH\n cdStart, // pointer to start of input\n sub(cdEnd, cdStart), // length of input \n cdStart, // write output over input\n 512 // reserve 512 bytes for output\n )\n if iszero(success) {\n revert(cdStart, returndatasize())\n }\n }\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\n\n\ncontract MixinExchangeCore is\n ReentrancyGuard,\n LibConstants,\n LibMath,\n LibOrder,\n LibFillResults,\n MAssetProxyDispatcher,\n MExchangeCore,\n MSignatureValidator,\n MTransactions\n{\n // Mapping of orderHash => amount of takerAsset already bought by maker\n mapping (bytes32 => uint256) public filled;\n\n // Mapping of orderHash => cancelled\n mapping (bytes32 => bool) public cancelled;\n\n // Mapping of makerAddress => senderAddress => lowest salt an order can have in order to be fillable\n // Orders with specified senderAddress and with a salt less than their epoch are considered cancelled\n mapping (address => mapping (address => uint256)) public orderEpoch;\n\n /// @dev Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch\n /// and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress).\n /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled.\n function cancelOrdersUpTo(uint256 targetOrderEpoch)\n external\n nonReentrant\n {\n address makerAddress = getCurrentContextAddress();\n // If this function is called via `executeTransaction`, we only update the orderEpoch for the makerAddress/msg.sender combination.\n // This allows external filter contracts to add rules to how orders are cancelled via this function.\n address senderAddress = makerAddress == msg.sender ? address(0) : msg.sender;\n\n // orderEpoch is initialized to 0, so to cancelUpTo we need salt + 1\n uint256 newOrderEpoch = targetOrderEpoch + 1; \n uint256 oldOrderEpoch = orderEpoch[makerAddress][senderAddress];\n\n // Ensure orderEpoch is monotonically increasing\n require(\n newOrderEpoch > oldOrderEpoch, \n \"INVALID_NEW_ORDER_EPOCH\"\n );\n\n // Update orderEpoch\n orderEpoch[makerAddress][senderAddress] = newOrderEpoch;\n emit CancelUpTo(\n makerAddress,\n senderAddress,\n newOrderEpoch\n );\n }\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrder(\n Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n nonReentrant\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n return fillResults;\n }\n\n /// @dev After calling, the order can not be filled anymore.\n /// Throws if order is invalid or sender does not have permission to cancel.\n /// @param order Order to cancel. Order must be OrderStatus.FILLABLE.\n function cancelOrder(Order memory order)\n public\n nonReentrant\n {\n cancelOrderInternal(order);\n }\n\n /// @dev Gets information about an order: status, hash, and amount filled.\n /// @param order Order to gather information on.\n /// @return OrderInfo Information about the order and its state.\n /// See LibOrder.OrderInfo for a complete description.\n function getOrderInfo(Order memory order)\n public\n view\n returns (OrderInfo memory orderInfo)\n {\n // Compute the order hash\n orderInfo.orderHash = getOrderHash(order);\n\n // Fetch filled amount\n orderInfo.orderTakerAssetFilledAmount = filled[orderInfo.orderHash];\n\n // If order.makerAssetAmount is zero, we also reject the order.\n // While the Exchange contract handles them correctly, they create\n // edge cases in the supporting infrastructure because they have\n // an 'infinite' price when computed by a simple division.\n if (order.makerAssetAmount == 0) {\n orderInfo.orderStatus = uint8(OrderStatus.INVALID_MAKER_ASSET_AMOUNT);\n return orderInfo;\n }\n\n // If order.takerAssetAmount is zero, then the order will always\n // be considered filled because 0 == takerAssetAmount == orderTakerAssetFilledAmount\n // Instead of distinguishing between unfilled and filled zero taker\n // amount orders, we choose not to support them.\n if (order.takerAssetAmount == 0) {\n orderInfo.orderStatus = uint8(OrderStatus.INVALID_TAKER_ASSET_AMOUNT);\n return orderInfo;\n }\n\n // Validate order availability\n if (orderInfo.orderTakerAssetFilledAmount >= order.takerAssetAmount) {\n orderInfo.orderStatus = uint8(OrderStatus.FULLY_FILLED);\n return orderInfo;\n }\n\n // Validate order expiration\n // solhint-disable-next-line not-rely-on-time\n if (block.timestamp >= order.expirationTimeSeconds) {\n orderInfo.orderStatus = uint8(OrderStatus.EXPIRED);\n return orderInfo;\n }\n\n // Check if order has been cancelled\n if (cancelled[orderInfo.orderHash]) {\n orderInfo.orderStatus = uint8(OrderStatus.CANCELLED);\n return orderInfo;\n }\n if (orderEpoch[order.makerAddress][order.senderAddress] > order.salt) {\n orderInfo.orderStatus = uint8(OrderStatus.CANCELLED);\n return orderInfo;\n }\n\n // All other statuses are ruled out: order is Fillable\n orderInfo.orderStatus = uint8(OrderStatus.FILLABLE);\n return orderInfo;\n }\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderInternal(\n Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n // Fetch order info\n OrderInfo memory orderInfo = getOrderInfo(order);\n\n // Fetch taker address\n address takerAddress = getCurrentContextAddress();\n \n // Assert that the order is fillable by taker\n assertFillableOrder(\n order,\n orderInfo,\n takerAddress,\n signature\n );\n \n // Get amount of takerAsset to fill\n uint256 remainingTakerAssetAmount = safeSub(order.takerAssetAmount, orderInfo.orderTakerAssetFilledAmount);\n uint256 takerAssetFilledAmount = min256(takerAssetFillAmount, remainingTakerAssetAmount);\n\n // Validate context\n assertValidFill(\n order,\n orderInfo,\n takerAssetFillAmount,\n takerAssetFilledAmount,\n fillResults.makerAssetFilledAmount\n );\n\n // Compute proportional fill amounts\n fillResults = calculateFillResults(order, takerAssetFilledAmount);\n\n // Update exchange internal state\n updateFilledState(\n order,\n takerAddress,\n orderInfo.orderHash,\n orderInfo.orderTakerAssetFilledAmount,\n fillResults\n );\n \n // Settle order\n settleOrder(\n order,\n takerAddress,\n fillResults\n );\n\n return fillResults;\n }\n\n /// @dev After calling, the order can not be filled anymore.\n /// Throws if order is invalid or sender does not have permission to cancel.\n /// @param order Order to cancel. Order must be OrderStatus.FILLABLE.\n function cancelOrderInternal(Order memory order)\n internal\n {\n // Fetch current order status\n OrderInfo memory orderInfo = getOrderInfo(order);\n\n // Validate context\n assertValidCancel(order, orderInfo);\n\n // Perform cancel\n updateCancelledState(order, orderInfo.orderHash);\n }\n\n /// @dev Updates state with results of a fill order.\n /// @param order that was filled.\n /// @param takerAddress Address of taker who filled the order.\n /// @param orderTakerAssetFilledAmount Amount of order already filled.\n function updateFilledState(\n Order memory order,\n address takerAddress,\n bytes32 orderHash,\n uint256 orderTakerAssetFilledAmount,\n FillResults memory fillResults\n )\n internal\n {\n // Update state\n filled[orderHash] = safeAdd(orderTakerAssetFilledAmount, fillResults.takerAssetFilledAmount);\n\n // Log order\n emit Fill(\n order.makerAddress,\n order.feeRecipientAddress,\n takerAddress,\n msg.sender,\n fillResults.makerAssetFilledAmount,\n fillResults.takerAssetFilledAmount,\n fillResults.makerFeePaid,\n fillResults.takerFeePaid,\n orderHash,\n order.makerAssetData,\n order.takerAssetData\n );\n }\n\n /// @dev Updates state with results of cancelling an order.\n /// State is only updated if the order is currently fillable.\n /// Otherwise, updating state would have no effect.\n /// @param order that was cancelled.\n /// @param orderHash Hash of order that was cancelled.\n function updateCancelledState(\n Order memory order,\n bytes32 orderHash\n )\n internal\n {\n // Perform cancel\n cancelled[orderHash] = true;\n\n // Log cancel\n emit Cancel(\n order.makerAddress,\n order.feeRecipientAddress,\n msg.sender,\n orderHash,\n order.makerAssetData,\n order.takerAssetData\n );\n }\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAddress Address of order taker.\n /// @param signature Proof that the orders was created by its maker.\n function assertFillableOrder(\n Order memory order,\n OrderInfo memory orderInfo,\n address takerAddress,\n bytes memory signature\n )\n internal\n view\n {\n // An order can only be filled if its status is FILLABLE.\n require(\n orderInfo.orderStatus == uint8(OrderStatus.FILLABLE),\n \"ORDER_UNFILLABLE\"\n );\n \n // Validate sender is allowed to fill this order\n if (order.senderAddress != address(0)) {\n require(\n order.senderAddress == msg.sender,\n \"INVALID_SENDER\"\n );\n }\n \n // Validate taker is allowed to fill this order\n if (order.takerAddress != address(0)) {\n require(\n order.takerAddress == takerAddress,\n \"INVALID_TAKER\"\n );\n }\n \n // Validate Maker signature (check only if first time seen)\n if (orderInfo.orderTakerAssetFilledAmount == 0) {\n require(\n isValidSignature(\n orderInfo.orderHash,\n order.makerAddress,\n signature\n ),\n \"INVALID_ORDER_SIGNATURE\"\n );\n }\n }\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAssetFillAmount Desired amount of order to fill by taker.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @param makerAssetFilledAmount Amount of makerAsset that will be transfered.\n function assertValidFill(\n Order memory order,\n OrderInfo memory orderInfo,\n uint256 takerAssetFillAmount, // TODO: use FillResults\n uint256 takerAssetFilledAmount,\n uint256 makerAssetFilledAmount\n )\n internal\n view\n {\n // Revert if fill amount is invalid\n // TODO: reconsider necessity for v2.1\n require(\n takerAssetFillAmount != 0,\n \"INVALID_TAKER_AMOUNT\"\n );\n \n // Make sure taker does not pay more than desired amount\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n takerAssetFilledAmount <= takerAssetFillAmount,\n \"TAKER_OVERPAY\"\n );\n \n // Make sure order is not overfilled\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n safeAdd(orderInfo.orderTakerAssetFilledAmount, takerAssetFilledAmount) <= order.takerAssetAmount,\n \"ORDER_OVERFILL\"\n );\n \n // Make sure order is filled at acceptable price.\n // The order has an implied price from the makers perspective:\n // order price = order.makerAssetAmount / order.takerAssetAmount\n // i.e. the number of makerAsset maker is paying per takerAsset. The\n // maker is guaranteed to get this price or a better (lower) one. The\n // actual price maker is getting in this fill is:\n // fill price = makerAssetFilledAmount / takerAssetFilledAmount\n // We need `fill price <= order price` for the fill to be fair to maker.\n // This amounts to:\n // makerAssetFilledAmount order.makerAssetAmount\n // ------------------------ <= -----------------------\n // takerAssetFilledAmount order.takerAssetAmount\n // or, equivalently:\n // makerAssetFilledAmount * order.takerAssetAmount <=\n // order.makerAssetAmount * takerAssetFilledAmount\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n safeMul(makerAssetFilledAmount, order.takerAssetAmount)\n <= \n safeMul(order.makerAssetAmount, takerAssetFilledAmount),\n \"INVALID_FILL_PRICE\"\n );\n }\n\n /// @dev Validates context for cancelOrder. Succeeds or throws.\n /// @param order to be cancelled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n function assertValidCancel(\n Order memory order,\n OrderInfo memory orderInfo\n )\n internal\n view\n {\n // Ensure order is valid\n // An order can only be cancelled if its status is FILLABLE.\n require(\n orderInfo.orderStatus == uint8(OrderStatus.FILLABLE),\n \"ORDER_UNFILLABLE\"\n );\n\n // Validate sender is allowed to cancel this order\n if (order.senderAddress != address(0)) {\n require(\n order.senderAddress == msg.sender,\n \"INVALID_SENDER\"\n );\n }\n\n // Validate transaction signed by maker\n address makerAddress = getCurrentContextAddress();\n require(\n order.makerAddress == makerAddress,\n \"INVALID_MAKER\"\n );\n }\n\n /// @dev Calculates amounts filled and fees paid by maker and taker.\n /// @param order to be filled.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function calculateFillResults(\n Order memory order,\n uint256 takerAssetFilledAmount\n )\n internal\n pure\n returns (FillResults memory fillResults)\n {\n // Compute proportional transfer amounts\n fillResults.takerAssetFilledAmount = takerAssetFilledAmount;\n fillResults.makerAssetFilledAmount = safeGetPartialAmountFloor(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.makerAssetAmount\n );\n fillResults.makerFeePaid = safeGetPartialAmountFloor(\n fillResults.makerAssetFilledAmount,\n order.makerAssetAmount,\n order.makerFee\n );\n fillResults.takerFeePaid = safeGetPartialAmountFloor(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.takerFee\n );\n\n return fillResults;\n }\n\n /// @dev Settles an order by transferring assets between counterparties.\n /// @param order Order struct containing order specifications.\n /// @param takerAddress Address selling takerAsset and buying makerAsset.\n /// @param fillResults Amounts to be filled and fees paid by maker and taker.\n function settleOrder(\n LibOrder.Order memory order,\n address takerAddress,\n LibFillResults.FillResults memory fillResults\n )\n private\n {\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n dispatchTransferFrom(\n order.makerAssetData,\n order.makerAddress,\n takerAddress,\n fillResults.makerAssetFilledAmount\n );\n dispatchTransferFrom(\n order.takerAssetData,\n takerAddress,\n order.makerAddress,\n fillResults.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n zrxAssetData,\n order.makerAddress,\n order.feeRecipientAddress,\n fillResults.makerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n order.feeRecipientAddress,\n fillResults.takerFeePaid\n );\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinMatchOrders.sol": "/*\n Copyright 2018 ZeroEx Intl.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n http://www.apache.org/licenses/LICENSE-2.0\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MMatchOrders.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\n\n\ncontract MixinMatchOrders is\n ReentrancyGuard,\n LibConstants,\n LibMath,\n MAssetProxyDispatcher,\n MExchangeCore,\n MMatchOrders,\n MTransactions\n{\n /// @dev Match two complementary orders that have a profitable spread.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the left order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftSignature Proof that order was created by the left maker.\n /// @param rightSignature Proof that order was created by the right maker.\n /// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.\n function matchOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n bytes memory leftSignature,\n bytes memory rightSignature\n )\n public\n nonReentrant\n returns (LibFillResults.MatchedFillResults memory matchedFillResults)\n {\n // We assume that rightOrder.takerAssetData == leftOrder.makerAssetData and rightOrder.makerAssetData == leftOrder.takerAssetData.\n // If this assumption isn't true, the match will fail at signature validation.\n rightOrder.makerAssetData = leftOrder.takerAssetData;\n rightOrder.takerAssetData = leftOrder.makerAssetData;\n\n // Get left & right order info\n LibOrder.OrderInfo memory leftOrderInfo = getOrderInfo(leftOrder);\n LibOrder.OrderInfo memory rightOrderInfo = getOrderInfo(rightOrder);\n\n // Fetch taker address\n address takerAddress = getCurrentContextAddress();\n \n // Either our context is valid or we revert\n assertFillableOrder(\n leftOrder,\n leftOrderInfo,\n takerAddress,\n leftSignature\n );\n assertFillableOrder(\n rightOrder,\n rightOrderInfo,\n takerAddress,\n rightSignature\n );\n assertValidMatch(leftOrder, rightOrder);\n\n // Compute proportional fill amounts\n matchedFillResults = calculateMatchedFillResults(\n leftOrder,\n rightOrder,\n leftOrderInfo.orderTakerAssetFilledAmount,\n rightOrderInfo.orderTakerAssetFilledAmount\n );\n\n // Validate fill contexts\n assertValidFill(\n leftOrder,\n leftOrderInfo,\n matchedFillResults.left.takerAssetFilledAmount,\n matchedFillResults.left.takerAssetFilledAmount,\n matchedFillResults.left.makerAssetFilledAmount\n );\n assertValidFill(\n rightOrder,\n rightOrderInfo,\n matchedFillResults.right.takerAssetFilledAmount,\n matchedFillResults.right.takerAssetFilledAmount,\n matchedFillResults.right.makerAssetFilledAmount\n );\n \n // Update exchange state\n updateFilledState(\n leftOrder,\n takerAddress,\n leftOrderInfo.orderHash,\n leftOrderInfo.orderTakerAssetFilledAmount,\n matchedFillResults.left\n );\n updateFilledState(\n rightOrder,\n takerAddress,\n rightOrderInfo.orderHash,\n rightOrderInfo.orderTakerAssetFilledAmount,\n matchedFillResults.right\n );\n\n // Settle matched orders. Succeeds or throws.\n settleMatchedOrders(\n leftOrder,\n rightOrder,\n takerAddress,\n matchedFillResults\n );\n\n return matchedFillResults;\n }\n\n /// @dev Validates context for matchOrders. Succeeds or throws.\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n function assertValidMatch(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder\n )\n internal\n pure\n {\n // Make sure there is a profitable spread.\n // There is a profitable spread iff the cost per unit bought (OrderA.MakerAmount/OrderA.TakerAmount) for each order is greater\n // than the profit per unit sold of the matched order (OrderB.TakerAmount/OrderB.MakerAmount).\n // This is satisfied by the equations below:\n // <leftOrder.makerAssetAmount> / <leftOrder.takerAssetAmount> >= <rightOrder.takerAssetAmount> / <rightOrder.makerAssetAmount>\n // AND\n // <rightOrder.makerAssetAmount> / <rightOrder.takerAssetAmount> >= <leftOrder.takerAssetAmount> / <leftOrder.makerAssetAmount>\n // These equations can be combined to get the following:\n require(\n safeMul(leftOrder.makerAssetAmount, rightOrder.makerAssetAmount) >=\n safeMul(leftOrder.takerAssetAmount, rightOrder.takerAssetAmount),\n \"NEGATIVE_SPREAD_REQUIRED\"\n );\n }\n\n /// @dev Calculates fill amounts for the matched orders.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the leftOrder order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftOrderTakerAssetFilledAmount Amount of left order already filled.\n /// @param rightOrderTakerAssetFilledAmount Amount of right order already filled.\n /// @param matchedFillResults Amounts to fill and fees to pay by maker and taker of matched orders.\n function calculateMatchedFillResults(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n uint256 leftOrderTakerAssetFilledAmount,\n uint256 rightOrderTakerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.MatchedFillResults memory matchedFillResults)\n {\n // Derive maker asset amounts for left & right orders, given store taker assert amounts\n uint256 leftTakerAssetAmountRemaining = safeSub(leftOrder.takerAssetAmount, leftOrderTakerAssetFilledAmount);\n uint256 leftMakerAssetAmountRemaining = safeGetPartialAmountFloor(\n leftOrder.makerAssetAmount,\n leftOrder.takerAssetAmount,\n leftTakerAssetAmountRemaining\n );\n uint256 rightTakerAssetAmountRemaining = safeSub(rightOrder.takerAssetAmount, rightOrderTakerAssetFilledAmount);\n uint256 rightMakerAssetAmountRemaining = safeGetPartialAmountFloor(\n rightOrder.makerAssetAmount,\n rightOrder.takerAssetAmount,\n rightTakerAssetAmountRemaining\n );\n\n // Calculate fill results for maker and taker assets: at least one order will be fully filled.\n // The maximum amount the left maker can buy is `leftTakerAssetAmountRemaining`\n // The maximum amount the right maker can sell is `rightMakerAssetAmountRemaining`\n // We have two distinct cases for calculating the fill results:\n // Case 1.\n // If the left maker can buy more than the right maker can sell, then only the right order is fully filled.\n // If the left maker can buy exactly what the right maker can sell, then both orders are fully filled.\n // Case 2.\n // If the left maker cannot buy more than the right maker can sell, then only the left order is fully filled.\n if (leftTakerAssetAmountRemaining >= rightMakerAssetAmountRemaining) {\n // Case 1: Right order is fully filled\n matchedFillResults.right.makerAssetFilledAmount = rightMakerAssetAmountRemaining;\n matchedFillResults.right.takerAssetFilledAmount = rightTakerAssetAmountRemaining;\n matchedFillResults.left.takerAssetFilledAmount = matchedFillResults.right.makerAssetFilledAmount;\n // Round down to ensure the maker's exchange rate does not exceed the price specified by the order. \n // We favor the maker when the exchange rate must be rounded.\n matchedFillResults.left.makerAssetFilledAmount = safeGetPartialAmountFloor(\n leftOrder.makerAssetAmount,\n leftOrder.takerAssetAmount,\n matchedFillResults.left.takerAssetFilledAmount\n );\n } else {\n // Case 2: Left order is fully filled\n matchedFillResults.left.makerAssetFilledAmount = leftMakerAssetAmountRemaining;\n matchedFillResults.left.takerAssetFilledAmount = leftTakerAssetAmountRemaining;\n matchedFillResults.right.makerAssetFilledAmount = matchedFillResults.left.takerAssetFilledAmount;\n // Round up to ensure the maker's exchange rate does not exceed the price specified by the order.\n // We favor the maker when the exchange rate must be rounded.\n matchedFillResults.right.takerAssetFilledAmount = safeGetPartialAmountCeil(\n rightOrder.takerAssetAmount,\n rightOrder.makerAssetAmount,\n matchedFillResults.right.makerAssetFilledAmount\n );\n }\n\n // Calculate amount given to taker\n matchedFillResults.leftMakerAssetSpreadAmount = safeSub(\n matchedFillResults.left.makerAssetFilledAmount,\n matchedFillResults.right.takerAssetFilledAmount\n );\n\n // Compute fees for left order\n matchedFillResults.left.makerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.left.makerAssetFilledAmount,\n leftOrder.makerAssetAmount,\n leftOrder.makerFee\n );\n matchedFillResults.left.takerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.left.takerAssetFilledAmount,\n leftOrder.takerAssetAmount,\n leftOrder.takerFee\n );\n\n // Compute fees for right order\n matchedFillResults.right.makerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.right.makerAssetFilledAmount,\n rightOrder.makerAssetAmount,\n rightOrder.makerFee\n );\n matchedFillResults.right.takerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.right.takerAssetFilledAmount,\n rightOrder.takerAssetAmount,\n rightOrder.takerFee\n );\n\n // Return fill results\n return matchedFillResults;\n }\n\n /// @dev Settles matched order by transferring appropriate funds between order makers, taker, and fee recipient.\n /// @param leftOrder First matched order.\n /// @param rightOrder Second matched order.\n /// @param takerAddress Address that matched the orders. The taker receives the spread between orders as profit.\n /// @param matchedFillResults Struct holding amounts to transfer between makers, taker, and fee recipients.\n function settleMatchedOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n address takerAddress,\n LibFillResults.MatchedFillResults memory matchedFillResults\n )\n private\n {\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n // Order makers and taker\n dispatchTransferFrom(\n leftOrder.makerAssetData,\n leftOrder.makerAddress,\n rightOrder.makerAddress,\n matchedFillResults.right.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n rightOrder.makerAssetData,\n rightOrder.makerAddress,\n leftOrder.makerAddress,\n matchedFillResults.left.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n leftOrder.makerAssetData,\n leftOrder.makerAddress,\n takerAddress,\n matchedFillResults.leftMakerAssetSpreadAmount\n );\n\n // Maker fees\n dispatchTransferFrom(\n zrxAssetData,\n leftOrder.makerAddress,\n leftOrder.feeRecipientAddress,\n matchedFillResults.left.makerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n rightOrder.makerAddress,\n rightOrder.feeRecipientAddress,\n matchedFillResults.right.makerFeePaid\n );\n\n // Taker fees\n if (leftOrder.feeRecipientAddress == rightOrder.feeRecipientAddress) {\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n leftOrder.feeRecipientAddress,\n safeAdd(\n matchedFillResults.left.takerFeePaid,\n matchedFillResults.right.takerFeePaid\n )\n );\n } else {\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n leftOrder.feeRecipientAddress,\n matchedFillResults.left.takerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n rightOrder.feeRecipientAddress,\n matchedFillResults.right.takerFeePaid\n );\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinSignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./interfaces/IWallet.sol\";\nimport \"./interfaces/IValidator.sol\";\n\n\ncontract MixinSignatureValidator is\n ReentrancyGuard,\n MSignatureValidator,\n MTransactions\n{\n using LibBytes for bytes;\n \n // Mapping of hash => signer => signed\n mapping (bytes32 => mapping (address => bool)) public preSigned;\n\n // Mapping of signer => validator => approved\n mapping (address => mapping (address => bool)) public allowedValidators;\n\n /// @dev Approves a hash on-chain using any valid signature type.\n /// After presigning a hash, the preSign signature type will become valid for that hash and signer.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n function preSign(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external\n {\n if (signerAddress != msg.sender) {\n require(\n isValidSignature(\n hash,\n signerAddress,\n signature\n ),\n \"INVALID_SIGNATURE\"\n );\n }\n preSigned[hash][signerAddress] = true;\n }\n\n /// @dev Approves/unnapproves a Validator contract to verify signatures on signer's behalf.\n /// @param validatorAddress Address of Validator contract.\n /// @param approval Approval or disapproval of Validator contract.\n function setSignatureValidatorApproval(\n address validatorAddress,\n bool approval\n )\n external\n nonReentrant\n {\n address signerAddress = getCurrentContextAddress();\n allowedValidators[signerAddress][validatorAddress] = approval;\n emit SignatureValidatorApproval(\n signerAddress,\n validatorAddress,\n approval\n );\n }\n\n /// @dev Verifies that a hash has been signed by the given signer.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes memory signature\n )\n public\n view\n returns (bool isValid)\n {\n require(\n signature.length > 0,\n \"LENGTH_GREATER_THAN_0_REQUIRED\"\n );\n\n // Pop last byte off of signature byte array.\n uint8 signatureTypeRaw = uint8(signature.popLastByte());\n\n // Ensure signature is supported\n require(\n signatureTypeRaw < uint8(SignatureType.NSignatureTypes),\n \"SIGNATURE_UNSUPPORTED\"\n );\n\n SignatureType signatureType = SignatureType(signatureTypeRaw);\n\n // Variables are not scoped in Solidity.\n uint8 v;\n bytes32 r;\n bytes32 s;\n address recovered;\n\n // Always illegal signature.\n // This is always an implicit option since a signer can create a\n // signature array with invalid type or length. We may as well make\n // it an explicit option. This aids testing and analysis. It is\n // also the initialization value for the enum type.\n if (signatureType == SignatureType.Illegal) {\n revert(\"SIGNATURE_ILLEGAL\");\n\n // Always invalid signature.\n // Like Illegal, this is always implicitly available and therefore\n // offered explicitly. It can be implicitly created by providing\n // a correctly formatted but incorrect signature.\n } else if (signatureType == SignatureType.Invalid) {\n require(\n signature.length == 0,\n \"LENGTH_0_REQUIRED\"\n );\n isValid = false;\n return isValid;\n\n // Signature using EIP712\n } else if (signatureType == SignatureType.EIP712) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n hash,\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n\n // Signed using web3.eth_sign\n } else if (signatureType == SignatureType.EthSign) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n keccak256(abi.encodePacked(\n \"\\x19Ethereum Signed Message:\\n32\",\n hash\n )),\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n\n // Signature verified by wallet contract.\n // If used with an order, the maker of the order is the wallet contract.\n } else if (signatureType == SignatureType.Wallet) {\n isValid = isValidWalletSignature(\n hash,\n signerAddress,\n signature\n );\n return isValid;\n\n // Signature verified by validator contract.\n // If used with an order, the maker of the order can still be an EOA.\n // A signature using this type should be encoded as:\n // | Offset | Length | Contents |\n // | 0x00 | x | Signature to validate |\n // | 0x00 + x | 20 | Address of validator contract |\n // | 0x14 + x | 1 | Signature type is always \"\\x06\" |\n } else if (signatureType == SignatureType.Validator) {\n // Pop last 20 bytes off of signature byte array.\n address validatorAddress = signature.popLast20Bytes();\n \n // Ensure signer has approved validator.\n if (!allowedValidators[signerAddress][validatorAddress]) {\n return false;\n }\n isValid = isValidValidatorSignature(\n validatorAddress,\n hash,\n signerAddress,\n signature\n );\n return isValid;\n\n // Signer signed hash previously using the preSign function.\n } else if (signatureType == SignatureType.PreSigned) {\n isValid = preSigned[hash][signerAddress];\n return isValid;\n }\n\n // Anything else is illegal (We do not return false because\n // the signature may actually be valid, just not in a format\n // that we currently support. In this case returning false\n // may lead the caller to incorrectly believe that the\n // signature was invalid.)\n revert(\"SIGNATURE_UNSUPPORTED\");\n }\n\n /// @dev Verifies signature using logic defined by Wallet contract.\n /// @param hash Any 32 byte hash.\n /// @param walletAddress Address that should have signed the given hash\n /// and defines its own signature verification method.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if signature is valid for given wallet..\n function isValidWalletSignature(\n bytes32 hash,\n address walletAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid)\n {\n bytes memory calldata = abi.encodeWithSelector(\n IWallet(walletAddress).isValidSignature.selector,\n hash,\n signature\n );\n assembly {\n let cdStart := add(calldata, 32)\n let success := staticcall(\n gas, // forward all gas\n walletAddress, // address of Wallet contract\n cdStart, // pointer to start of input\n mload(calldata), // length of input\n cdStart, // write output over input\n 32 // output size is 32 bytes\n )\n\n switch success\n case 0 {\n // Revert with `Error(\"WALLET_ERROR\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000c57414c4c45545f4552524f5200000000000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n case 1 {\n // Signature is valid if call did not revert and returned true\n isValid := mload(cdStart)\n }\n }\n return isValid;\n }\n\n /// @dev Verifies signature using logic defined by Validator contract.\n /// @param validatorAddress Address of validator contract.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidValidatorSignature(\n address validatorAddress,\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid)\n {\n bytes memory calldata = abi.encodeWithSelector(\n IValidator(signerAddress).isValidSignature.selector,\n hash,\n signerAddress,\n signature\n );\n assembly {\n let cdStart := add(calldata, 32)\n let success := staticcall(\n gas, // forward all gas\n validatorAddress, // address of Validator contract\n cdStart, // pointer to start of input\n mload(calldata), // length of input\n cdStart, // write output over input\n 32 // output size is 32 bytes\n )\n\n switch success\n case 0 {\n // Revert with `Error(\"VALIDATOR_ERROR\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f56414c494441544f525f4552524f5200000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n case 1 {\n // Signature is valid if call did not revert and returned true\n isValid := mload(cdStart)\n }\n }\n return isValid;\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinTransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\nimport \"./libs/LibExchangeErrors.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./libs/LibEIP712.sol\";\n\n\ncontract MixinTransactions is\n LibEIP712,\n MSignatureValidator,\n MTransactions\n{\n // Mapping of transaction hash => executed\n // This prevents transactions from being executed more than once.\n mapping (bytes32 => bool) public transactions;\n\n // Address of current transaction signer\n address public currentContextAddress;\n\n /// @dev Executes an exchange method call in the context of signer.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @param signature Proof of signer transaction by signer.\n function executeTransaction(\n uint256 salt,\n address signerAddress,\n bytes data,\n bytes signature\n )\n external\n {\n // Prevent reentrancy\n require(\n currentContextAddress == address(0),\n \"REENTRANCY_ILLEGAL\"\n );\n\n bytes32 transactionHash = hashEIP712Message(hashZeroExTransaction(\n salt,\n signerAddress,\n data\n ));\n\n // Validate transaction has not been executed\n require(\n !transactions[transactionHash],\n \"INVALID_TX_HASH\"\n );\n\n // Transaction always valid if signer is sender of transaction\n if (signerAddress != msg.sender) {\n // Validate signature\n require(\n isValidSignature(\n transactionHash,\n signerAddress,\n signature\n ),\n \"INVALID_TX_SIGNATURE\"\n );\n\n // Set the current transaction signer\n currentContextAddress = signerAddress;\n }\n\n // Execute transaction\n transactions[transactionHash] = true;\n require(\n address(this).delegatecall(data),\n \"FAILED_EXECUTION\"\n );\n\n // Reset current transaction signer if it was previously updated\n if (signerAddress != msg.sender) {\n currentContextAddress = address(0);\n }\n }\n\n /// @dev Calculates EIP712 hash of the Transaction.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @return EIP712 hash of the Transaction.\n function hashZeroExTransaction(\n uint256 salt,\n address signerAddress,\n bytes memory data\n )\n internal\n pure\n returns (bytes32 result)\n {\n bytes32 schemaHash = EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH;\n bytes32 dataHash = keccak256(data);\n\n // Assembly for more efficiently computing:\n // keccak256(abi.encodePacked(\n // EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH,\n // salt,\n // bytes32(signerAddress),\n // keccak256(data)\n // ));\n\n assembly {\n // Load free memory pointer\n let memPtr := mload(64)\n\n mstore(memPtr, schemaHash) // hash of schema\n mstore(add(memPtr, 32), salt) // salt\n mstore(add(memPtr, 64), and(signerAddress, 0xffffffffffffffffffffffffffffffffffffffff)) // signerAddress\n mstore(add(memPtr, 96), dataHash) // hash of data\n\n // Compute hash\n result := keccak256(memPtr, 128)\n }\n return result;\n }\n\n /// @dev The current function will be called in the context of this address (either 0x transaction signer or `msg.sender`).\n /// If calling a fill function, this address will represent the taker.\n /// If calling a cancel function, this address will represent the maker.\n /// @return Signer of 0x transaction if entry point is `executeTransaction`.\n /// `msg.sender` if entry point is any other function.\n function getCurrentContextAddress()\n internal\n view\n returns (address)\n {\n address currentContextAddress_ = currentContextAddress;\n address contextAddress = currentContextAddress_ == address(0) ? msg.sender : currentContextAddress_;\n return contextAddress;\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./libs/LibAbiEncoder.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MWrapperFunctions.sol\";\n\n\ncontract MixinWrapperFunctions is\n ReentrancyGuard,\n LibMath,\n LibFillResults,\n LibAbiEncoder,\n MExchangeCore,\n MWrapperFunctions\n{\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n nonReentrant\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrKillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n return fillResults;\n }\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (FillResults memory fillResults)\n {\n // ABI encode calldata for `fillOrder`\n bytes memory fillOrderCalldata = abiEncodeFillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n\n // Delegate to `fillOrder` and handle any exceptions gracefully\n assembly {\n let success := delegatecall(\n gas, // forward all gas\n address, // call address of this contract\n add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes)\n mload(fillOrderCalldata), // length of input\n fillOrderCalldata, // write output over input\n 128 // output size is 128 bytes\n )\n if success {\n mstore(fillResults, mload(fillOrderCalldata))\n mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32)))\n mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64)))\n mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96)))\n }\n }\n // fillResults values will be 0 by default if call was unsuccessful\n return fillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrKill.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrKillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrKillOrderInternal(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrders(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n bytes memory takerAssetData = orders[0].takerAssetData;\n \n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being sold by taker is the same for each order.\n // Rather than passing this in as calldata, we use the takerAssetData from the first order in all later orders.\n orders[i].takerAssetData = takerAssetData;\n\n // Calculate the remaining amount of takerAsset to sell\n uint256 remainingTakerAssetFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= takerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory takerAssetData = orders[0].takerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being sold by taker is the same for each order.\n // Rather than passing this in as calldata, we use the takerAssetData from the first order in all later orders.\n orders[i].takerAssetData = takerAssetData;\n\n // Calculate the remaining amount of takerAsset to sell\n uint256 remainingTakerAssetFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= takerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerAsset is bought by taker.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrders(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // Rather than passing this in as calldata, we copy the makerAssetData from the first order onto all later orders.\n orders[i].makerAssetData = makerAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n if (totalFillResults.makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // Rather than passing this in as calldata, we copy the makerAssetData from the first order onto all later orders.\n orders[i].makerAssetData = makerAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n if (totalFillResults.makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously cancels multiple orders in a single transaction.\n /// @param orders Array of order specifications.\n function batchCancelOrders(LibOrder.Order[] memory orders)\n public\n nonReentrant\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n cancelOrderInternal(orders[i]);\n }\n }\n\n /// @dev Fetches information for all passed in orders.\n /// @param orders Array of order specifications.\n /// @return Array of OrderInfo instances that correspond to each order.\n function getOrdersInfo(LibOrder.Order[] memory orders)\n public\n view\n returns (LibOrder.OrderInfo[] memory)\n {\n uint256 ordersLength = orders.length;\n LibOrder.OrderInfo[] memory ordersInfo = new LibOrder.OrderInfo[](ordersLength);\n for (uint256 i = 0; i != ordersLength; i++) {\n ordersInfo[i] = getOrderInfo(orders[i]);\n }\n return ordersInfo;\n }\n\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n require(\n fillResults.takerAssetFilledAmount == takerAssetFillAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return fillResults;\n }\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IAssetProxyDispatcher {\n\n /// @dev Registers an asset proxy to its asset proxy id.\n /// Once an asset proxy is registered, it cannot be unregistered.\n /// @param assetProxy Address of new asset proxy to register.\n function registerAssetProxy(address assetProxy)\n external;\n\n /// @dev Gets an asset proxy.\n /// @param assetProxyId Id of the asset proxy.\n /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered.\n function getAssetProxy(bytes4 assetProxyId)\n external\n view\n returns (address);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IExchange.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./IExchangeCore.sol\";\nimport \"./IMatchOrders.sol\";\nimport \"./ISignatureValidator.sol\";\nimport \"./ITransactions.sol\";\nimport \"./IAssetProxyDispatcher.sol\";\nimport \"./IWrapperFunctions.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract IExchange is\n IExchangeCore,\n IMatchOrders,\n ISignatureValidator,\n ITransactions,\n IAssetProxyDispatcher,\n IWrapperFunctions\n{}\n",
- "2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IExchangeCore {\n\n /// @dev Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch\n /// and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress).\n /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled.\n function cancelOrdersUpTo(uint256 targetOrderEpoch)\n external;\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev After calling, the order can not be filled anymore.\n /// @param order Order struct containing order specifications.\n function cancelOrder(LibOrder.Order memory order)\n public;\n\n /// @dev Gets information about an order: status, hash, and amount filled.\n /// @param order Order to gather information on.\n /// @return OrderInfo Information about the order and its state.\n /// See LibOrder.OrderInfo for a complete description.\n function getOrderInfo(LibOrder.Order memory order)\n public\n view\n returns (LibOrder.OrderInfo memory orderInfo);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IMatchOrders {\n\n /// @dev Match two complementary orders that have a profitable spread.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the left order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftSignature Proof that order was created by the left maker.\n /// @param rightSignature Proof that order was created by the right maker.\n /// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.\n function matchOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n bytes memory leftSignature,\n bytes memory rightSignature\n )\n public\n returns (LibFillResults.MatchedFillResults memory matchedFillResults);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract ISignatureValidator {\n\n /// @dev Approves a hash on-chain using any valid signature type.\n /// After presigning a hash, the preSign signature type will become valid for that hash and signer.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n function preSign(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external;\n \n /// @dev Approves/unnapproves a Validator contract to verify signatures on signer's behalf.\n /// @param validatorAddress Address of Validator contract.\n /// @param approval Approval or disapproval of Validator contract.\n function setSignatureValidatorApproval(\n address validatorAddress,\n bool approval\n )\n external;\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signerAddress Address of signer.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes memory signature\n )\n public\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/ITransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\n\ncontract ITransactions {\n\n /// @dev Executes an exchange method call in the context of signer.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @param signature Proof of signer transaction by signer.\n function executeTransaction(\n uint256 salt,\n address signerAddress,\n bytes data,\n bytes signature\n )\n external;\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IValidator {\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IWallet.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IWallet {\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n bytes signature\n )\n external\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IWrapperFunctions {\n\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrKill.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrKillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrders(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerAsset is bought by taker.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrders(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously cancels multiple orders in a single transaction.\n /// @param orders Array of order specifications.\n function batchCancelOrders(LibOrder.Order[] memory orders)\n public;\n\n /// @dev Fetches information for all passed in orders\n /// @param orders Array of order specifications.\n /// @return Array of OrderInfo instances that correspond to each order.\n function getOrdersInfo(LibOrder.Order[] memory orders)\n public\n view\n returns (LibOrder.OrderInfo[] memory);\n}\n",
- "2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./LibOrder.sol\";\n\n\ncontract LibAbiEncoder {\n\n /// @dev ABI encodes calldata for `fillOrder`.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return ABI encoded calldata for `fillOrder`.\n function abiEncodeFillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n pure\n returns (bytes memory fillOrderCalldata)\n {\n // We need to call MExchangeCore.fillOrder using a delegatecall in\n // assembly so that we can intercept a call that throws. For this, we\n // need the input encoded in memory in the Ethereum ABIv2 format [1].\n\n // | Area | Offset | Length | Contents |\n // | -------- |--------|---------|-------------------------------------------- |\n // | Header | 0x00 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 0x00 | | 1. offset to order (*) |\n // | | 0x20 | | 2. takerAssetFillAmount |\n // | | 0x40 | | 3. offset to signature (*) |\n // | Data | | 12 * 32 | order: |\n // | | 0x000 | | 1. senderAddress |\n // | | 0x020 | | 2. makerAddress |\n // | | 0x040 | | 3. takerAddress |\n // | | 0x060 | | 4. feeRecipientAddress |\n // | | 0x080 | | 5. makerAssetAmount |\n // | | 0x0A0 | | 6. takerAssetAmount |\n // | | 0x0C0 | | 7. makerFeeAmount |\n // | | 0x0E0 | | 8. takerFeeAmount |\n // | | 0x100 | | 9. expirationTimeSeconds |\n // | | 0x120 | | 10. salt |\n // | | 0x140 | | 11. Offset to makerAssetData (*) |\n // | | 0x160 | | 12. Offset to takerAssetData (*) |\n // | | 0x180 | 32 | makerAssetData Length |\n // | | 0x1A0 | ** | makerAssetData Contents |\n // | | 0x1C0 | 32 | takerAssetData Length |\n // | | 0x1E0 | ** | takerAssetData Contents |\n // | | 0x200 | 32 | signature Length |\n // | | 0x220 | ** | signature Contents |\n\n // * Offsets are calculated from the beginning of the current area: Header, Params, Data:\n // An offset stored in the Params area is calculated from the beginning of the Params section.\n // An offset stored in the Data area is calculated from the beginning of the Data section.\n\n // ** The length of dynamic array contents are stored in the field immediately preceeding the contents.\n\n // [1]: https://solidity.readthedocs.io/en/develop/abi-spec.html\n\n assembly {\n\n // Areas below may use the following variables:\n // 1. <area>Start -- Start of this area in memory\n // 2. <area>End -- End of this area in memory. This value may\n // be precomputed (before writing contents),\n // or it may be computed as contents are written.\n // 3. <area>Offset -- Current offset into area. If an area's End\n // is precomputed, this variable tracks the\n // offsets of contents as they are written.\n\n /////// Setup Header Area ///////\n // Load free memory pointer\n fillOrderCalldata := mload(0x40)\n // bytes4(keccak256(\"fillOrder((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),uint256,bytes)\"))\n // = 0xb4be83d5\n // Leave 0x20 bytes to store the length\n mstore(add(fillOrderCalldata, 0x20), 0xb4be83d500000000000000000000000000000000000000000000000000000000)\n let headerAreaEnd := add(fillOrderCalldata, 0x24)\n\n /////// Setup Params Area ///////\n // This area is preallocated and written to later.\n // This is because we need to fill in offsets that have not yet been calculated.\n let paramsAreaStart := headerAreaEnd\n let paramsAreaEnd := add(paramsAreaStart, 0x60)\n let paramsAreaOffset := paramsAreaStart\n\n /////// Setup Data Area ///////\n let dataAreaStart := paramsAreaEnd\n let dataAreaEnd := dataAreaStart\n\n // Offset from the source data we're reading from\n let sourceOffset := order\n // arrayLenBytes and arrayLenWords track the length of a dynamically-allocated bytes array.\n let arrayLenBytes := 0\n let arrayLenWords := 0\n\n /////// Write order Struct ///////\n // Write memory location of Order, relative to the start of the\n // parameter list, then increment the paramsAreaOffset respectively.\n mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))\n paramsAreaOffset := add(paramsAreaOffset, 0x20)\n\n // Write values for each field in the order\n // It would be nice to use a loop, but we save on gas by writing\n // the stores sequentially.\n mstore(dataAreaEnd, mload(sourceOffset)) // makerAddress\n mstore(add(dataAreaEnd, 0x20), mload(add(sourceOffset, 0x20))) // takerAddress\n mstore(add(dataAreaEnd, 0x40), mload(add(sourceOffset, 0x40))) // feeRecipientAddress\n mstore(add(dataAreaEnd, 0x60), mload(add(sourceOffset, 0x60))) // senderAddress\n mstore(add(dataAreaEnd, 0x80), mload(add(sourceOffset, 0x80))) // makerAssetAmount\n mstore(add(dataAreaEnd, 0xA0), mload(add(sourceOffset, 0xA0))) // takerAssetAmount\n mstore(add(dataAreaEnd, 0xC0), mload(add(sourceOffset, 0xC0))) // makerFeeAmount\n mstore(add(dataAreaEnd, 0xE0), mload(add(sourceOffset, 0xE0))) // takerFeeAmount\n mstore(add(dataAreaEnd, 0x100), mload(add(sourceOffset, 0x100))) // expirationTimeSeconds\n mstore(add(dataAreaEnd, 0x120), mload(add(sourceOffset, 0x120))) // salt\n mstore(add(dataAreaEnd, 0x140), mload(add(sourceOffset, 0x140))) // Offset to makerAssetData\n mstore(add(dataAreaEnd, 0x160), mload(add(sourceOffset, 0x160))) // Offset to takerAssetData\n dataAreaEnd := add(dataAreaEnd, 0x180)\n sourceOffset := add(sourceOffset, 0x180)\n\n // Write offset to <order.makerAssetData>\n mstore(add(dataAreaStart, mul(10, 0x20)), sub(dataAreaEnd, dataAreaStart))\n\n // Calculate length of <order.makerAssetData>\n sourceOffset := mload(add(order, 0x140)) // makerAssetData\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of <order.makerAssetData>\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of <order.makerAssetData>\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n // Write offset to <order.takerAssetData>\n mstore(add(dataAreaStart, mul(11, 0x20)), sub(dataAreaEnd, dataAreaStart))\n\n // Calculate length of <order.takerAssetData>\n sourceOffset := mload(add(order, 0x160)) // takerAssetData\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of <order.takerAssetData>\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of <order.takerAssetData>\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n /////// Write takerAssetFillAmount ///////\n mstore(paramsAreaOffset, takerAssetFillAmount)\n paramsAreaOffset := add(paramsAreaOffset, 0x20)\n\n /////// Write signature ///////\n // Write offset to paramsArea\n mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))\n\n // Calculate length of signature\n sourceOffset := signature\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of signature\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of signature\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n // Set length of calldata\n mstore(fillOrderCalldata, sub(dataAreaEnd, add(fillOrderCalldata, 0x20)))\n\n // Increment free memory pointer\n mstore(0x40, dataAreaEnd)\n }\n\n return fillOrderCalldata;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibConstants.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\n// solhint-disable max-line-length\ncontract LibConstants {\n \n // Asset data for ZRX token. Used for fee transfers.\n // @TODO: Hardcode constant when we deploy. Currently \n // not constant to make testing easier.\n\n // The proxyId for ZRX_ASSET_DATA is bytes4(keccak256(\"ERC20Token(address)\")) = 0xf47261b0\n \n // Kovan ZRX address is 0x6ff6c0ff1d68b964901f986d4c9fa3ac68346570.\n // The ABI encoded proxyId and address is 0xf47261b00000000000000000000000006ff6c0ff1d68b964901f986d4c9fa3ac68346570\n // bytes constant public ZRX_ASSET_DATA = \"\\xf4\\x72\\x61\\xb0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x6f\\xf6\\xc0\\xff\\x1d\\x68\\xb9\\x64\\x90\\x1f\\x98\\x6d\\x4c\\x9f\\xa3\\xac\\x68\\x34\\x65\\x70\";\n \n // Mainnet ZRX address is 0xe41d2489571d322189246dafa5ebde1f4699f498.\n // The ABI encoded proxyId and address is 0xf47261b0000000000000000000000000e41d2489571d322189246dafa5ebde1f4699f498\n // bytes constant public ZRX_ASSET_DATA = \"\\xf4\\x72\\x61\\xb0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xe4\\x1d\\x24\\x89\\x57\\x1d\\x32\\x21\\x89\\x24\\x6d\\xaf\\xa5\\xeb\\xde\\x1f\\x46\\x99\\xf4\\x98\";\n \n // solhint-disable-next-line var-name-mixedcase\n bytes public ZRX_ASSET_DATA;\n\n // @TODO: Remove when we deploy.\n constructor (bytes memory zrxAssetData)\n public\n {\n ZRX_ASSET_DATA = zrxAssetData;\n }\n}\n// solhint-enable max-line-length\n",
- "2.0.0/protocol/Exchange/libs/LibEIP712.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract LibEIP712 {\n\n // EIP191 header for EIP712 prefix\n string constant internal EIP191_HEADER = \"\\x19\\x01\";\n\n // EIP712 Domain Name value\n string constant internal EIP712_DOMAIN_NAME = \"0x Protocol\";\n\n // EIP712 Domain Version value\n string constant internal EIP712_DOMAIN_VERSION = \"2\";\n\n // Hash of the EIP712 Domain Separator Schema\n bytes32 constant internal EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"EIP712Domain(\",\n \"string name,\",\n \"string version,\",\n \"address verifyingContract\",\n \")\"\n ));\n\n // Hash of the EIP712 Domain Separator data\n // solhint-disable-next-line var-name-mixedcase\n bytes32 public EIP712_DOMAIN_HASH;\n\n constructor ()\n public\n {\n EIP712_DOMAIN_HASH = keccak256(abi.encodePacked(\n EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH,\n keccak256(bytes(EIP712_DOMAIN_NAME)),\n keccak256(bytes(EIP712_DOMAIN_VERSION)),\n bytes32(address(this))\n ));\n }\n\n /// @dev Calculates EIP712 encoding for a hash struct in this EIP712 Domain.\n /// @param hashStruct The EIP712 hash struct.\n /// @return EIP712 hash applied to this EIP712 Domain.\n function hashEIP712Message(bytes32 hashStruct)\n internal\n view\n returns (bytes32 result)\n {\n bytes32 eip712DomainHash = EIP712_DOMAIN_HASH;\n\n // Assembly for more efficient computing:\n // keccak256(abi.encodePacked(\n // EIP191_HEADER,\n // EIP712_DOMAIN_HASH,\n // hashStruct \n // ));\n\n assembly {\n // Load free memory pointer\n let memPtr := mload(64)\n\n mstore(memPtr, 0x1901000000000000000000000000000000000000000000000000000000000000) // EIP191 header\n mstore(add(memPtr, 2), eip712DomainHash) // EIP712 domain hash\n mstore(add(memPtr, 34), hashStruct) // Hash of struct\n\n // Compute hash\n result := keccak256(memPtr, 66)\n }\n return result;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\n// solhint-disable\npragma solidity 0.4.24;\n\n\n/// @dev This contract documents the revert reasons used in the Exchange contract.\n/// This contract is intended to serve as a reference, but is not actually used for efficiency reasons.\ncontract LibExchangeErrors {\n\n /// Order validation errors ///\n string constant ORDER_UNFILLABLE = \"ORDER_UNFILLABLE\"; // Order cannot be filled.\n string constant INVALID_MAKER = \"INVALID_MAKER\"; // Invalid makerAddress.\n string constant INVALID_TAKER = \"INVALID_TAKER\"; // Invalid takerAddress.\n string constant INVALID_SENDER = \"INVALID_SENDER\"; // Invalid `msg.sender`.\n string constant INVALID_ORDER_SIGNATURE = \"INVALID_ORDER_SIGNATURE\"; // Signature validation failed. \n \n /// fillOrder validation errors ///\n string constant INVALID_TAKER_AMOUNT = \"INVALID_TAKER_AMOUNT\"; // takerAssetFillAmount cannot equal 0.\n string constant ROUNDING_ERROR = \"ROUNDING_ERROR\"; // Rounding error greater than 0.1% of takerAssetFillAmount. \n \n /// Signature validation errors ///\n string constant INVALID_SIGNATURE = \"INVALID_SIGNATURE\"; // Signature validation failed. \n string constant SIGNATURE_ILLEGAL = \"SIGNATURE_ILLEGAL\"; // Signature type is illegal.\n string constant SIGNATURE_UNSUPPORTED = \"SIGNATURE_UNSUPPORTED\"; // Signature type unsupported.\n \n /// cancelOrdersUptTo errors ///\n string constant INVALID_NEW_ORDER_EPOCH = \"INVALID_NEW_ORDER_EPOCH\"; // Specified salt must be greater than or equal to existing orderEpoch.\n\n /// fillOrKillOrder errors ///\n string constant COMPLETE_FILL_FAILED = \"COMPLETE_FILL_FAILED\"; // Desired takerAssetFillAmount could not be completely filled. \n\n /// matchOrders errors ///\n string constant NEGATIVE_SPREAD_REQUIRED = \"NEGATIVE_SPREAD_REQUIRED\"; // Matched orders must have a negative spread.\n\n /// Transaction errors ///\n string constant REENTRANCY_ILLEGAL = \"REENTRANCY_ILLEGAL\"; // Recursive reentrancy is not allowed. \n string constant INVALID_TX_HASH = \"INVALID_TX_HASH\"; // Transaction has already been executed. \n string constant INVALID_TX_SIGNATURE = \"INVALID_TX_SIGNATURE\"; // Signature validation failed. \n string constant FAILED_EXECUTION = \"FAILED_EXECUTION\"; // Transaction execution failed. \n \n /// registerAssetProxy errors ///\n string constant ASSET_PROXY_ALREADY_EXISTS = \"ASSET_PROXY_ALREADY_EXISTS\"; // AssetProxy with same id already exists.\n\n /// dispatchTransferFrom errors ///\n string constant ASSET_PROXY_DOES_NOT_EXIST = \"ASSET_PROXY_DOES_NOT_EXIST\"; // No assetProxy registered at given id.\n string constant TRANSFER_FAILED = \"TRANSFER_FAILED\"; // Asset transfer unsuccesful.\n\n /// Length validation errors ///\n string constant LENGTH_GREATER_THAN_0_REQUIRED = \"LENGTH_GREATER_THAN_0_REQUIRED\"; // Byte array must have a length greater than 0.\n string constant LENGTH_GREATER_THAN_3_REQUIRED = \"LENGTH_GREATER_THAN_3_REQUIRED\"; // Byte array must have a length greater than 3.\n string constant LENGTH_0_REQUIRED = \"LENGTH_0_REQUIRED\"; // Byte array must have a length of 0.\n string constant LENGTH_65_REQUIRED = \"LENGTH_65_REQUIRED\"; // Byte array must have a length of 65.\n}\n",
- "2.0.0/protocol/Exchange/libs/LibFillResults.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract LibFillResults is\n SafeMath\n{\n struct FillResults {\n uint256 makerAssetFilledAmount; // Total amount of makerAsset(s) filled.\n uint256 takerAssetFilledAmount; // Total amount of takerAsset(s) filled.\n uint256 makerFeePaid; // Total amount of ZRX paid by maker(s) to feeRecipient(s).\n uint256 takerFeePaid; // Total amount of ZRX paid by taker to feeRecipients(s).\n }\n\n struct MatchedFillResults {\n FillResults left; // Amounts filled and fees paid of left order.\n FillResults right; // Amounts filled and fees paid of right order.\n uint256 leftMakerAssetSpreadAmount; // Spread between price of left and right order, denominated in the left order's makerAsset, paid to taker.\n }\n\n /// @dev Adds properties of both FillResults instances.\n /// Modifies the first FillResults instance specified.\n /// @param totalFillResults Fill results instance that will be added onto.\n /// @param singleFillResults Fill results instance that will be added to totalFillResults.\n function addFillResults(FillResults memory totalFillResults, FillResults memory singleFillResults)\n internal\n pure\n {\n totalFillResults.makerAssetFilledAmount = safeAdd(totalFillResults.makerAssetFilledAmount, singleFillResults.makerAssetFilledAmount);\n totalFillResults.takerAssetFilledAmount = safeAdd(totalFillResults.takerAssetFilledAmount, singleFillResults.takerAssetFilledAmount);\n totalFillResults.makerFeePaid = safeAdd(totalFillResults.makerFeePaid, singleFillResults.makerFeePaid);\n totalFillResults.takerFeePaid = safeAdd(totalFillResults.takerFeePaid, singleFillResults.takerFeePaid);\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibMath.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract LibMath is\n SafeMath\n{\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// Reverts if rounding error is >= 0.1%\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded down.\n function safeGetPartialAmountFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n require(\n !isRoundingErrorFloor(\n numerator,\n denominator,\n target\n ),\n \"ROUNDING_ERROR\"\n );\n \n partialAmount = safeDiv(\n safeMul(numerator, target),\n denominator\n );\n return partialAmount;\n }\n\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// Reverts if rounding error is >= 0.1%\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded up.\n function safeGetPartialAmountCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n require(\n !isRoundingErrorCeil(\n numerator,\n denominator,\n target\n ),\n \"ROUNDING_ERROR\"\n );\n \n // safeDiv computes `floor(a / b)`. We use the identity (a, b integer):\n // ceil(a / b) = floor((a + b - 1) / b)\n // To implement `ceil(a / b)` using safeDiv.\n partialAmount = safeDiv(\n safeAdd(\n safeMul(numerator, target),\n safeSub(denominator, 1)\n ),\n denominator\n );\n return partialAmount;\n }\n\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded down.\n function getPartialAmountFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n partialAmount = safeDiv(\n safeMul(numerator, target),\n denominator\n );\n return partialAmount;\n }\n \n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded up.\n function getPartialAmountCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n // safeDiv computes `floor(a / b)`. We use the identity (a, b integer):\n // ceil(a / b) = floor((a + b - 1) / b)\n // To implement `ceil(a / b)` using safeDiv.\n partialAmount = safeDiv(\n safeAdd(\n safeMul(numerator, target),\n safeSub(denominator, 1)\n ),\n denominator\n );\n return partialAmount;\n }\n \n /// @dev Checks if rounding error >= 0.1% when rounding down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to multiply with numerator/denominator.\n /// @return Rounding error is present.\n function isRoundingErrorFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (bool isError)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n \n // The absolute rounding error is the difference between the rounded\n // value and the ideal value. The relative rounding error is the\n // absolute rounding error divided by the absolute value of the\n // ideal value. This is undefined when the ideal value is zero.\n //\n // The ideal value is `numerator * target / denominator`.\n // Let's call `numerator * target % denominator` the remainder.\n // The absolute error is `remainder / denominator`.\n //\n // When the ideal value is zero, we require the absolute error to\n // be zero. Fortunately, this is always the case. The ideal value is\n // zero iff `numerator == 0` and/or `target == 0`. In this case the\n // remainder and absolute error are also zero. \n if (target == 0 || numerator == 0) {\n return false;\n }\n \n // Otherwise, we want the relative rounding error to be strictly\n // less than 0.1%.\n // The relative error is `remainder / (numerator * target)`.\n // We want the relative error less than 1 / 1000:\n // remainder / (numerator * denominator) < 1 / 1000\n // or equivalently:\n // 1000 * remainder < numerator * target\n // so we have a rounding error iff:\n // 1000 * remainder >= numerator * target\n uint256 remainder = mulmod(\n target,\n numerator,\n denominator\n );\n isError = safeMul(1000, remainder) >= safeMul(numerator, target);\n return isError;\n }\n \n /// @dev Checks if rounding error >= 0.1% when rounding up.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to multiply with numerator/denominator.\n /// @return Rounding error is present.\n function isRoundingErrorCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (bool isError)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n \n // See the comments in `isRoundingError`.\n if (target == 0 || numerator == 0) {\n // When either is zero, the ideal value and rounded value are zero\n // and there is no rounding error. (Although the relative error\n // is undefined.)\n return false;\n }\n // Compute remainder as before\n uint256 remainder = mulmod(\n target,\n numerator,\n denominator\n );\n remainder = safeSub(denominator, remainder) % denominator;\n isError = safeMul(1000, remainder) >= safeMul(numerator, target);\n return isError;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibOrder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./LibEIP712.sol\";\n\n\ncontract LibOrder is\n LibEIP712\n{\n // Hash for the EIP712 Order Schema\n bytes32 constant internal EIP712_ORDER_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"Order(\",\n \"address makerAddress,\",\n \"address takerAddress,\",\n \"address feeRecipientAddress,\",\n \"address senderAddress,\",\n \"uint256 makerAssetAmount,\",\n \"uint256 takerAssetAmount,\",\n \"uint256 makerFee,\",\n \"uint256 takerFee,\",\n \"uint256 expirationTimeSeconds,\",\n \"uint256 salt,\",\n \"bytes makerAssetData,\",\n \"bytes takerAssetData\",\n \")\"\n ));\n\n // A valid order remains fillable until it is expired, fully filled, or cancelled.\n // An order's state is unaffected by external factors, like account balances.\n enum OrderStatus {\n INVALID, // Default value\n INVALID_MAKER_ASSET_AMOUNT, // Order does not have a valid maker asset amount\n INVALID_TAKER_ASSET_AMOUNT, // Order does not have a valid taker asset amount\n FILLABLE, // Order is fillable\n EXPIRED, // Order has already expired\n FULLY_FILLED, // Order is fully filled\n CANCELLED // Order has been cancelled\n }\n\n // solhint-disable max-line-length\n struct Order {\n address makerAddress; // Address that created the order. \n address takerAddress; // Address that is allowed to fill the order. If set to 0, any address is allowed to fill the order. \n address feeRecipientAddress; // Address that will recieve fees when order is filled. \n address senderAddress; // Address that is allowed to call Exchange contract methods that affect this order. If set to 0, any address is allowed to call these methods.\n uint256 makerAssetAmount; // Amount of makerAsset being offered by maker. Must be greater than 0. \n uint256 takerAssetAmount; // Amount of takerAsset being bid on by maker. Must be greater than 0. \n uint256 makerFee; // Amount of ZRX paid to feeRecipient by maker when order is filled. If set to 0, no transfer of ZRX from maker to feeRecipient will be attempted.\n uint256 takerFee; // Amount of ZRX paid to feeRecipient by taker when order is filled. If set to 0, no transfer of ZRX from taker to feeRecipient will be attempted.\n uint256 expirationTimeSeconds; // Timestamp in seconds at which order expires. \n uint256 salt; // Arbitrary number to facilitate uniqueness of the order's hash. \n bytes makerAssetData; // Encoded data that can be decoded by a specified proxy contract when transferring makerAsset. The last byte references the id of this proxy.\n bytes takerAssetData; // Encoded data that can be decoded by a specified proxy contract when transferring takerAsset. The last byte references the id of this proxy.\n }\n // solhint-enable max-line-length\n\n struct OrderInfo {\n uint8 orderStatus; // Status that describes order's validity and fillability.\n bytes32 orderHash; // EIP712 hash of the order (see LibOrder.getOrderHash).\n uint256 orderTakerAssetFilledAmount; // Amount of order that has already been filled.\n }\n\n /// @dev Calculates Keccak-256 hash of the order.\n /// @param order The order structure.\n /// @return Keccak-256 EIP712 hash of the order.\n function getOrderHash(Order memory order)\n internal\n view\n returns (bytes32 orderHash)\n {\n orderHash = hashEIP712Message(hashOrder(order));\n return orderHash;\n }\n\n /// @dev Calculates EIP712 hash of the order.\n /// @param order The order structure.\n /// @return EIP712 hash of the order.\n function hashOrder(Order memory order)\n internal\n pure\n returns (bytes32 result)\n {\n bytes32 schemaHash = EIP712_ORDER_SCHEMA_HASH;\n bytes32 makerAssetDataHash = keccak256(order.makerAssetData);\n bytes32 takerAssetDataHash = keccak256(order.takerAssetData);\n\n // Assembly for more efficiently computing:\n // keccak256(abi.encodePacked(\n // EIP712_ORDER_SCHEMA_HASH,\n // bytes32(order.makerAddress),\n // bytes32(order.takerAddress),\n // bytes32(order.feeRecipientAddress),\n // bytes32(order.senderAddress),\n // order.makerAssetAmount,\n // order.takerAssetAmount,\n // order.makerFee,\n // order.takerFee,\n // order.expirationTimeSeconds,\n // order.salt,\n // keccak256(order.makerAssetData),\n // keccak256(order.takerAssetData)\n // ));\n\n assembly {\n // Calculate memory addresses that will be swapped out before hashing\n let pos1 := sub(order, 32)\n let pos2 := add(order, 320)\n let pos3 := add(order, 352)\n\n // Backup\n let temp1 := mload(pos1)\n let temp2 := mload(pos2)\n let temp3 := mload(pos3)\n \n // Hash in place\n mstore(pos1, schemaHash)\n mstore(pos2, makerAssetDataHash)\n mstore(pos3, takerAssetDataHash)\n result := keccak256(pos1, 416)\n \n // Restore\n mstore(pos1, temp1)\n mstore(pos2, temp2)\n mstore(pos3, temp3)\n }\n return result;\n }\n}\n",
- "2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAssetProxyDispatcher.sol\";\n\n\ncontract MAssetProxyDispatcher is\n IAssetProxyDispatcher\n{\n // Logs registration of new asset proxy\n event AssetProxyRegistered(\n bytes4 id, // Id of new registered AssetProxy.\n address assetProxy // Address of new registered AssetProxy.\n );\n\n /// @dev Forwards arguments to assetProxy and calls `transferFrom`. Either succeeds or throws.\n /// @param assetData Byte array encoded for the asset.\n /// @param from Address to transfer token from.\n /// @param to Address to transfer token to.\n /// @param amount Amount of token to transfer.\n function dispatchTransferFrom(\n bytes memory assetData,\n address from,\n address to,\n uint256 amount\n )\n internal;\n}\n",
- "2.0.0/protocol/Exchange/mixins/MExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IExchangeCore.sol\";\n\n\ncontract MExchangeCore is\n IExchangeCore\n{\n // Fill event is emitted whenever an order is filled.\n event Fill(\n address indexed makerAddress, // Address that created the order. \n address indexed feeRecipientAddress, // Address that received fees.\n address takerAddress, // Address that filled the order.\n address senderAddress, // Address that called the Exchange contract (msg.sender).\n uint256 makerAssetFilledAmount, // Amount of makerAsset sold by maker and bought by taker. \n uint256 takerAssetFilledAmount, // Amount of takerAsset sold by taker and bought by maker.\n uint256 makerFeePaid, // Amount of ZRX paid to feeRecipient by maker.\n uint256 takerFeePaid, // Amount of ZRX paid to feeRecipient by taker.\n bytes32 indexed orderHash, // EIP712 hash of order (see LibOrder.getOrderHash).\n bytes makerAssetData, // Encoded data specific to makerAsset. \n bytes takerAssetData // Encoded data specific to takerAsset.\n );\n\n // Cancel event is emitted whenever an individual order is cancelled.\n event Cancel(\n address indexed makerAddress, // Address that created the order. \n address indexed feeRecipientAddress, // Address that would have recieved fees if order was filled. \n address senderAddress, // Address that called the Exchange contract (msg.sender).\n bytes32 indexed orderHash, // EIP712 hash of order (see LibOrder.getOrderHash).\n bytes makerAssetData, // Encoded data specific to makerAsset. \n bytes takerAssetData // Encoded data specific to takerAsset.\n );\n\n // CancelUpTo event is emitted whenever `cancelOrdersUpTo` is executed succesfully.\n event CancelUpTo(\n address indexed makerAddress, // Orders cancelled must have been created by this address.\n address indexed senderAddress, // Orders cancelled must have a `senderAddress` equal to this address.\n uint256 orderEpoch // Orders with specified makerAddress and senderAddress with a salt less than this value are considered cancelled.\n );\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev After calling, the order can not be filled anymore.\n /// @param order Order struct containing order specifications.\n function cancelOrderInternal(LibOrder.Order memory order)\n internal;\n\n /// @dev Updates state with results of a fill order.\n /// @param order that was filled.\n /// @param takerAddress Address of taker who filled the order.\n /// @param orderTakerAssetFilledAmount Amount of order already filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function updateFilledState(\n LibOrder.Order memory order,\n address takerAddress,\n bytes32 orderHash,\n uint256 orderTakerAssetFilledAmount,\n LibFillResults.FillResults memory fillResults\n )\n internal;\n\n /// @dev Updates state with results of cancelling an order.\n /// State is only updated if the order is currently fillable.\n /// Otherwise, updating state would have no effect.\n /// @param order that was cancelled.\n /// @param orderHash Hash of order that was cancelled.\n function updateCancelledState(\n LibOrder.Order memory order,\n bytes32 orderHash\n )\n internal;\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAddress Address of order taker.\n /// @param signature Proof that the orders was created by its maker.\n function assertFillableOrder(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo,\n address takerAddress,\n bytes memory signature\n )\n internal\n view;\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo Status, orderHash, and amount already filled of order.\n /// @param takerAssetFillAmount Desired amount of order to fill by taker.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @param makerAssetFilledAmount Amount of makerAsset that will be transfered.\n function assertValidFill(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo,\n uint256 takerAssetFillAmount,\n uint256 takerAssetFilledAmount,\n uint256 makerAssetFilledAmount\n )\n internal\n view;\n\n /// @dev Validates context for cancelOrder. Succeeds or throws.\n /// @param order to be cancelled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n function assertValidCancel(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo\n )\n internal\n view;\n\n /// @dev Calculates amounts filled and fees paid by maker and taker.\n /// @param order to be filled.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function calculateFillResults(\n LibOrder.Order memory order,\n uint256 takerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.FillResults memory fillResults);\n\n}\n",
- "2.0.0/protocol/Exchange/mixins/MMatchOrders.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IMatchOrders.sol\";\n\n\ncontract MMatchOrders is\n IMatchOrders\n{\n /// @dev Validates context for matchOrders. Succeeds or throws.\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n function assertValidMatch(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder\n )\n internal\n pure;\n\n /// @dev Calculates fill amounts for the matched orders.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the leftOrder order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftOrderTakerAssetFilledAmount Amount of left order already filled.\n /// @param rightOrderTakerAssetFilledAmount Amount of right order already filled.\n /// @param matchedFillResults Amounts to fill and fees to pay by maker and taker of matched orders.\n function calculateMatchedFillResults(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n uint256 leftOrderTakerAssetFilledAmount,\n uint256 rightOrderTakerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.MatchedFillResults memory matchedFillResults);\n\n}\n",
- "2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/ISignatureValidator.sol\";\n\n\ncontract MSignatureValidator is\n ISignatureValidator\n{\n event SignatureValidatorApproval(\n address indexed signerAddress, // Address that approves or disapproves a contract to verify signatures.\n address indexed validatorAddress, // Address of signature validator contract.\n bool approved // Approval or disapproval of validator contract.\n );\n\n // Allowed signature types.\n enum SignatureType {\n Illegal, // 0x00, default value\n Invalid, // 0x01\n EIP712, // 0x02\n EthSign, // 0x03\n Wallet, // 0x04\n Validator, // 0x05\n PreSigned, // 0x06\n NSignatureTypes // 0x07, number of signature types. Always leave at end.\n }\n\n /// @dev Verifies signature using logic defined by Wallet contract.\n /// @param hash Any 32 byte hash.\n /// @param walletAddress Address that should have signed the given hash\n /// and defines its own signature verification method.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidWalletSignature(\n bytes32 hash,\n address walletAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid);\n\n /// @dev Verifies signature using logic defined by Validator contract.\n /// @param validatorAddress Address of validator contract.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidValidatorSignature(\n address validatorAddress,\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/mixins/MTransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\nimport \"../interfaces/ITransactions.sol\";\n\n\ncontract MTransactions is\n ITransactions\n{\n // Hash for the EIP712 ZeroEx Transaction Schema\n bytes32 constant internal EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"ZeroExTransaction(\",\n \"uint256 salt,\",\n \"address signerAddress,\",\n \"bytes data\",\n \")\"\n ));\n\n /// @dev Calculates EIP712 hash of the Transaction.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @return EIP712 hash of the Transaction.\n function hashZeroExTransaction(\n uint256 salt,\n address signerAddress,\n bytes memory data\n )\n internal\n pure\n returns (bytes32 result);\n\n /// @dev The current function will be called in the context of this address (either 0x transaction signer or `msg.sender`).\n /// If calling a fill function, this address will represent the taker.\n /// If calling a cancel function, this address will represent the maker.\n /// @return Signer of 0x transaction if entry point is `executeTransaction`.\n /// `msg.sender` if entry point is any other function.\n function getCurrentContextAddress()\n internal\n view\n returns (address);\n}\n",
- "2.0.0/protocol/Exchange/mixins/MWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IWrapperFunctions.sol\";\n\n\ncontract MWrapperFunctions is \n IWrapperFunctions\n{\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n}\n",
- "2.0.0/test/DummyERC20Token/DummyERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"../../tokens/ERC20Token/MintableERC20Token.sol\";\n\n\ncontract DummyERC20Token is \n Ownable,\n MintableERC20Token\n{\n string public name;\n string public symbol;\n uint256 public decimals;\n uint256 public constant MAX_MINT_AMOUNT = 10000000000000000000000;\n\n constructor (\n string _name,\n string _symbol,\n uint256 _decimals,\n uint256 _totalSupply\n )\n public\n {\n name = _name;\n symbol = _symbol;\n decimals = _decimals;\n _totalSupply = _totalSupply;\n balances[msg.sender] = _totalSupply;\n }\n\n /// @dev Sets the balance of target address\n /// @param _target Address or which balance will be updated\n /// @param _value New balance of target address\n function setBalance(address _target, uint256 _value)\n external\n onlyOwner\n {\n uint256 currBalance = balances[_target];\n if (_value < currBalance) {\n _totalSupply = safeSub(_totalSupply, safeSub(currBalance, _value));\n } else {\n _totalSupply = safeAdd(_totalSupply, safeSub(_value, currBalance));\n }\n balances[_target] = _value;\n }\n\n /// @dev Mints new tokens for sender\n /// @param _value Amount of tokens to mint\n function mint(uint256 _value)\n external\n {\n require(\n _value <= MAX_MINT_AMOUNT,\n \"VALUE_TOO_LARGE\"\n );\n\n _mint(msg.sender, _value);\n }\n}\n",
- "2.0.0/test/DummyERC721Token/DummyERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../tokens/ERC721Token/MintableERC721Token.sol\";\nimport \"../../utils/Ownable/Ownable.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract DummyERC721Token is\n Ownable,\n MintableERC721Token\n{\n string public name;\n string public symbol;\n\n constructor (\n string _name,\n string _symbol\n )\n public\n {\n name = _name;\n symbol = _symbol;\n }\n\n /// @dev Function to mint a new token\n /// Reverts if the given token ID already exists\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _tokenId ID of the token to be minted by the msg.sender \n function mint(address _to, uint256 _tokenId)\n external\n {\n _mint(_to, _tokenId);\n }\n\n /// @dev Function to burn a token\n /// Reverts if the given token ID doesn't exist or not called by contract owner\n /// @param _owner Owner of token with given token ID\n /// @param _tokenId ID of the token to be burned by the msg.sender\n function burn(address _owner, uint256 _tokenId)\n external\n onlyOwner\n {\n _burn(_owner, _tokenId);\n }\n}\n",
- "2.0.0/tokens/ERC20Token/ERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IERC20Token.sol\";\n\n\ncontract ERC20Token is\n IERC20Token\n{\n mapping (address => uint256) internal balances;\n mapping (address => mapping (address => uint256)) internal allowed;\n\n uint256 internal _totalSupply;\n\n /// @dev send `value` token to `to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transfer(address _to, uint256 _value)\n external\n returns (bool)\n {\n require(\n balances[msg.sender] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[msg.sender] -= _value;\n balances[_to] += _value;\n\n emit Transfer(\n msg.sender,\n _to,\n _value\n );\n\n return true;\n }\n\n /// @dev send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool)\n {\n require(\n balances[_from] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n allowed[_from][msg.sender] >= _value,\n \"ERC20_INSUFFICIENT_ALLOWANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[_to] += _value;\n balances[_from] -= _value;\n allowed[_from][msg.sender] -= _value;\n \n emit Transfer(\n _from,\n _to,\n _value\n );\n \n return true;\n }\n\n /// @dev `msg.sender` approves `_spender` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Always true if the call has enough gas to complete execution\n function approve(address _spender, uint256 _value)\n external\n returns (bool)\n {\n allowed[msg.sender][_spender] = _value;\n emit Approval(\n msg.sender,\n _spender,\n _value\n );\n return true;\n }\n\n /// @dev Query total supply of token\n /// @return Total supply of token\n function totalSupply()\n external\n view\n returns (uint256)\n {\n return _totalSupply;\n }\n\n /// @dev Query the balance of owner\n /// @param _owner The address from which the balance will be retrieved\n /// @return Balance of owner\n function balanceOf(address _owner)\n external\n view\n returns (uint256)\n {\n return balances[_owner];\n }\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender)\n external\n view\n returns (uint256)\n {\n return allowed[_owner][_spender];\n }\n}\n",
- "2.0.0/tokens/ERC20Token/IERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC20Token {\n\n // solhint-disable no-simple-event-func-name\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 _value\n );\n\n event Approval(\n address indexed _owner,\n address indexed _spender,\n uint256 _value\n );\n\n /// @dev send `value` token to `to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transfer(address _to, uint256 _value)\n external\n returns (bool);\n\n /// @dev send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool);\n \n /// @dev `msg.sender` approves `_spender` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Always true if the call has enough gas to complete execution\n function approve(address _spender, uint256 _value)\n external\n returns (bool);\n\n /// @dev Query total supply of token\n /// @return Total supply of token\n function totalSupply()\n external\n view\n returns (uint256);\n \n /// @param _owner The address from which the balance will be retrieved\n /// @return Balance of owner\n function balanceOf(address _owner)\n external\n view\n returns (uint256);\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender)\n external\n view\n returns (uint256);\n}\n",
- "2.0.0/tokens/ERC20Token/MintableERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/SafeMath/SafeMath.sol\";\nimport \"./UnlimitedAllowanceERC20Token.sol\";\n\n\ncontract MintableERC20Token is \n SafeMath,\n UnlimitedAllowanceERC20Token\n{\n /// @dev Mints new tokens\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _value Amount of tokens to mint\n function _mint(address _to, uint256 _value)\n internal\n {\n balances[_to] = safeAdd(_value, balances[_to]);\n _totalSupply = safeAdd(_totalSupply, _value);\n\n emit Transfer(\n address(0),\n _to,\n _value\n );\n }\n\n /// @dev Mints new tokens\n /// @param _owner Owner of tokens that will be burned\n /// @param _value Amount of tokens to burn\n function _burn(address _owner, uint256 _value)\n internal\n {\n balances[_owner] = safeSub(balances[_owner], _value);\n _totalSupply = safeSub(_totalSupply, _value);\n\n emit Transfer(\n _owner,\n address(0),\n _value\n );\n }\n}\n",
- "2.0.0/tokens/ERC20Token/UnlimitedAllowanceERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../ERC20Token/ERC20Token.sol\";\n\n\ncontract UnlimitedAllowanceERC20Token is\n ERC20Token\n{\n uint256 constant internal MAX_UINT = 2**256 - 1;\n\n /// @dev ERC20 transferFrom, modified such that an allowance of MAX_UINT represents an unlimited allowance. See https://github.com/ethereum/EIPs/issues/717\n /// @param _from Address to transfer from.\n /// @param _to Address to transfer to.\n /// @param _value Amount to transfer.\n /// @return Success of transfer.\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool)\n {\n uint256 allowance = allowed[_from][msg.sender];\n require(\n balances[_from] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n allowance >= _value,\n \"ERC20_INSUFFICIENT_ALLOWANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[_to] += _value;\n balances[_from] -= _value;\n if (allowance < MAX_UINT) {\n allowed[_from][msg.sender] -= _value;\n }\n\n emit Transfer(\n _from,\n _to,\n _value\n );\n\n return true;\n }\n}\n",
- "2.0.0/tokens/ERC721Token/ERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IERC721Token.sol\";\nimport \"./IERC721Receiver.sol\";\nimport \"../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract ERC721Token is\n IERC721Token,\n SafeMath\n{\n // Function selector for ERC721Receiver.onERC721Received\n // 0x150b7a02\n bytes4 constant internal ERC721_RECEIVED = bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"));\n\n // Mapping of tokenId => owner\n mapping (uint256 => address) internal owners;\n\n // Mapping of tokenId => approved address\n mapping (uint256 => address) internal approvals;\n\n // Mapping of owner => number of tokens owned\n mapping (address => uint256) internal balances;\n\n // Mapping of owner => operator => approved\n mapping (address => mapping (address => bool)) internal operatorApprovals;\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT. When transfer is complete, this function\n /// checks if `_to` is a smart contract (code size > 0). If so, it calls\n /// `onERC721Received` on `_to` and throws if the return value is not\n /// `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n /// @param _data Additional data with no specified format, sent in call to `_to`\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId,\n bytes _data\n )\n external\n {\n transferFrom(\n _from,\n _to,\n _tokenId\n );\n\n uint256 receiverCodeSize;\n assembly {\n receiverCodeSize := extcodesize(_to)\n }\n if (receiverCodeSize > 0) {\n bytes4 selector = IERC721Receiver(_to).onERC721Received(\n msg.sender,\n _from,\n _tokenId,\n _data\n );\n require(\n selector == ERC721_RECEIVED,\n \"ERC721_INVALID_SELECTOR\"\n );\n }\n }\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev This works identically to the other function with an extra data parameter,\n /// except this function just sets data to \"\".\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n external\n {\n transferFrom(\n _from,\n _to,\n _tokenId\n );\n\n uint256 receiverCodeSize;\n assembly {\n receiverCodeSize := extcodesize(_to)\n }\n if (receiverCodeSize > 0) {\n bytes4 selector = IERC721Receiver(_to).onERC721Received(\n msg.sender,\n _from,\n _tokenId,\n \"\"\n );\n require(\n selector == ERC721_RECEIVED,\n \"ERC721_INVALID_SELECTOR\"\n );\n }\n }\n\n /// @notice Change or reaffirm the approved address for an NFT\n /// @dev The zero address indicates there is no approved address.\n /// Throws unless `msg.sender` is the current NFT owner, or an authorized\n /// operator of the current owner.\n /// @param _approved The new approved NFT controller\n /// @param _tokenId The NFT to approve\n function approve(address _approved, uint256 _tokenId)\n external\n {\n address owner = ownerOf(_tokenId);\n require(\n msg.sender == owner || isApprovedForAll(owner, msg.sender),\n \"ERC721_INVALID_SENDER\"\n );\n\n approvals[_tokenId] = _approved;\n emit Approval(\n owner,\n _approved,\n _tokenId\n );\n }\n\n /// @notice Enable or disable approval for a third party (\"operator\") to manage\n /// all of `msg.sender`'s assets\n /// @dev Emits the ApprovalForAll event. The contract MUST allow\n /// multiple operators per owner.\n /// @param _operator Address to add to the set of authorized operators\n /// @param _approved True if the operator is approved, false to revoke approval\n function setApprovalForAll(address _operator, bool _approved)\n external\n {\n operatorApprovals[msg.sender][_operator] = _approved;\n emit ApprovalForAll(\n msg.sender,\n _operator,\n _approved\n );\n }\n \n /// @notice Count all NFTs assigned to an owner\n /// @dev NFTs assigned to the zero address are considered invalid, and this\n /// function throws for queries about the zero address.\n /// @param _owner An address for whom to query the balance\n /// @return The number of NFTs owned by `_owner`, possibly zero\n function balanceOf(address _owner)\n external\n view\n returns (uint256)\n {\n require(\n _owner != address(0),\n \"ERC721_ZERO_OWNER\"\n );\n return balances[_owner];\n }\n\n /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE\n /// TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE\n /// THEY MAY BE PERMANENTLY LOST\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function transferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n public\n {\n require(\n _to != address(0),\n \"ERC721_ZERO_TO_ADDRESS\"\n );\n\n address owner = ownerOf(_tokenId);\n require(\n _from == owner,\n \"ERC721_OWNER_MISMATCH\"\n );\n\n address spender = msg.sender;\n address approvedAddress = getApproved(_tokenId);\n require(\n spender == owner ||\n isApprovedForAll(owner, spender) ||\n approvedAddress == spender,\n \"ERC721_INVALID_SPENDER\"\n );\n\n if (approvedAddress != address(0)) {\n approvals[_tokenId] = address(0);\n }\n\n owners[_tokenId] = _to;\n balances[_from] = safeSub(balances[_from], 1);\n balances[_to] = safeAdd(balances[_to], 1);\n \n emit Transfer(\n _from,\n _to,\n _tokenId\n );\n }\n\n /// @notice Find the owner of an NFT\n /// @dev NFTs assigned to zero address are considered invalid, and queries\n /// about them do throw.\n /// @param _tokenId The identifier for an NFT\n /// @return The address of the owner of the NFT\n function ownerOf(uint256 _tokenId)\n public\n view\n returns (address)\n {\n address owner = owners[_tokenId];\n require(\n owner != address(0),\n \"ERC721_ZERO_OWNER\"\n );\n return owner;\n }\n\n /// @notice Get the approved address for a single NFT\n /// @dev Throws if `_tokenId` is not a valid NFT.\n /// @param _tokenId The NFT to find the approved address for\n /// @return The approved address for this NFT, or the zero address if there is none\n function getApproved(uint256 _tokenId)\n public\n view\n returns (address)\n {\n return approvals[_tokenId];\n }\n\n /// @notice Query if an address is an authorized operator for another address\n /// @param _owner The address that owns the NFTs\n /// @param _operator The address that acts on behalf of the owner\n /// @return True if `_operator` is an approved operator for `_owner`, false otherwise\n function isApprovedForAll(address _owner, address _operator)\n public\n view\n returns (bool)\n {\n return operatorApprovals[_owner][_operator];\n }\n}\n",
- "2.0.0/tokens/ERC721Token/IERC721Receiver.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC721Receiver {\n\n /// @notice Handle the receipt of an NFT\n /// @dev The ERC721 smart contract calls this function on the recipient\n /// after a `transfer`. This function MAY throw to revert and reject the\n /// transfer. Return of other than the magic value MUST result in the\n /// transaction being reverted.\n /// Note: the contract address is always the message sender.\n /// @param _operator The address which called `safeTransferFrom` function\n /// @param _from The address which previously owned the token\n /// @param _tokenId The NFT identifier which is being transferred\n /// @param _data Additional data with no specified format\n /// @return `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`\n /// unless throwing\n function onERC721Received(\n address _operator,\n address _from,\n uint256 _tokenId,\n bytes _data\n )\n external\n returns (bytes4);\n}\n",
- "2.0.0/tokens/ERC721Token/IERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC721Token {\n\n /// @dev This emits when ownership of any NFT changes by any mechanism.\n /// This event emits when NFTs are created (`from` == 0) and destroyed\n /// (`to` == 0). Exception: during contract creation, any number of NFTs\n /// may be created and assigned without emitting Transfer. At the time of\n /// any transfer, the approved address for that NFT (if any) is reset to none.\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 indexed _tokenId\n );\n\n /// @dev This emits when the approved address for an NFT is changed or\n /// reaffirmed. The zero address indicates there is no approved address.\n /// When a Transfer event emits, this also indicates that the approved\n /// address for that NFT (if any) is reset to none.\n event Approval(\n address indexed _owner,\n address indexed _approved,\n uint256 indexed _tokenId\n );\n\n /// @dev This emits when an operator is enabled or disabled for an owner.\n /// The operator can manage all NFTs of the owner.\n event ApprovalForAll(\n address indexed _owner,\n address indexed _operator,\n bool _approved\n );\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// perator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT. When transfer is complete, this function\n /// checks if `_to` is a smart contract (code size > 0). If so, it calls\n /// `onERC721Received` on `_to` and throws if the return value is not\n /// `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n /// @param _data Additional data with no specified format, sent in call to `_to`\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId,\n bytes _data\n )\n external;\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev This works identically to the other function with an extra data parameter,\n /// except this function just sets data to \"\".\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n external;\n\n /// @notice Change or reaffirm the approved address for an NFT\n /// @dev The zero address indicates there is no approved address.\n /// Throws unless `msg.sender` is the current NFT owner, or an authorized\n /// operator of the current owner.\n /// @param _approved The new approved NFT controller\n /// @param _tokenId The NFT to approve\n function approve(address _approved, uint256 _tokenId)\n external;\n\n /// @notice Enable or disable approval for a third party (\"operator\") to manage\n /// all of `msg.sender`'s assets\n /// @dev Emits the ApprovalForAll event. The contract MUST allow\n /// multiple operators per owner.\n /// @param _operator Address to add to the set of authorized operators\n /// @param _approved True if the operator is approved, false to revoke approval\n function setApprovalForAll(address _operator, bool _approved)\n external;\n\n /// @notice Count all NFTs assigned to an owner\n /// @dev NFTs assigned to the zero address are considered invalid, and this\n /// function throws for queries about the zero address.\n /// @param _owner An address for whom to query the balance\n /// @return The number of NFTs owned by `_owner`, possibly zero\n function balanceOf(address _owner)\n external\n view\n returns (uint256);\n\n /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE\n /// TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE\n /// THEY MAY BE PERMANENTLY LOST\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function transferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n public;\n\n /// @notice Find the owner of an NFT\n /// @dev NFTs assigned to zero address are considered invalid, and queries\n /// about them do throw.\n /// @param _tokenId The identifier for an NFT\n /// @return The address of the owner of the NFT\n function ownerOf(uint256 _tokenId)\n public\n view\n returns (address);\n\n /// @notice Get the approved address for a single NFT\n /// @dev Throws if `_tokenId` is not a valid NFT.\n /// @param _tokenId The NFT to find the approved address for\n /// @return The approved address for this NFT, or the zero address if there is none\n function getApproved(uint256 _tokenId) \n public\n view\n returns (address);\n \n /// @notice Query if an address is an authorized operator for another address\n /// @param _owner The address that owns the NFTs\n /// @param _operator The address that acts on behalf of the owner\n /// @return True if `_operator` is an approved operator for `_owner`, false otherwise\n function isApprovedForAll(address _owner, address _operator)\n public\n view\n returns (bool);\n}\n",
- "2.0.0/tokens/ERC721Token/MintableERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./ERC721Token.sol\";\n\n\ncontract MintableERC721Token is\n ERC721Token\n{\n /// @dev Function to mint a new token\n /// Reverts if the given token ID already exists\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _tokenId ID of the token to be minted by the msg.sender \n function _mint(address _to, uint256 _tokenId)\n internal\n {\n require(\n _to != address(0),\n \"ERC721_ZERO_TO_ADDRESS\"\n );\n\n address owner = owners[_tokenId];\n require(\n owner == address(0),\n \"ERC721_OWNER_ALREADY_EXISTS\"\n );\n\n owners[_tokenId] = _to;\n balances[_to] = safeAdd(balances[_to], 1);\n\n emit Transfer(\n address(0),\n _to,\n _tokenId\n );\n }\n\n /// @dev Function to burn a token\n /// Reverts if the given token ID doesn't exist\n /// @param _owner Owner of token with given token ID\n /// @param _tokenId ID of the token to be burned by the msg.sender\n function _burn(address _owner, uint256 _tokenId)\n internal\n {\n require(\n _owner != address(0),\n \"ERC721_ZERO_OWNER_ADDRESS\"\n );\n\n address owner = owners[_tokenId];\n require(\n owner == _owner,\n \"ERC721_OWNER_MISMATCH\"\n );\n\n owners[_tokenId] = address(0);\n balances[_owner] = safeSub(balances[_owner], 1);\n\n emit Transfer(\n _owner,\n address(0),\n _tokenId\n );\n }\n}\n",
- "2.0.0/tokens/EtherToken/IEtherToken.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../ERC20Token/IERC20Token.sol\";\n\n\ncontract IEtherToken is\n IERC20Token\n{\n function deposit()\n public\n payable;\n \n function withdraw(uint256 amount)\n public;\n}\n",
- "2.0.0/utils/LibBytes/LibBytes.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\nlibrary LibBytes {\n\n using LibBytes for bytes;\n\n /// @dev Gets the memory address for a byte array.\n /// @param input Byte array to lookup.\n /// @return memoryAddress Memory address of byte array. This\n /// points to the header of the byte array which contains\n /// the length.\n function rawAddress(bytes memory input)\n internal\n pure\n returns (uint256 memoryAddress)\n {\n assembly {\n memoryAddress := input\n }\n return memoryAddress;\n }\n \n /// @dev Gets the memory address for the contents of a byte array.\n /// @param input Byte array to lookup.\n /// @return memoryAddress Memory address of the contents of the byte array.\n function contentAddress(bytes memory input)\n internal\n pure\n returns (uint256 memoryAddress)\n {\n assembly {\n memoryAddress := add(input, 32)\n }\n return memoryAddress;\n }\n\n /// @dev Copies `length` bytes from memory location `source` to `dest`.\n /// @param dest memory address to copy bytes to.\n /// @param source memory address to copy bytes from.\n /// @param length number of bytes to copy.\n function memCopy(\n uint256 dest,\n uint256 source,\n uint256 length\n )\n internal\n pure\n {\n if (length < 32) {\n // Handle a partial word by reading destination and masking\n // off the bits we are interested in.\n // This correctly handles overlap, zero lengths and source == dest\n assembly {\n let mask := sub(exp(256, sub(32, length)), 1)\n let s := and(mload(source), not(mask))\n let d := and(mload(dest), mask)\n mstore(dest, or(s, d))\n }\n } else {\n // Skip the O(length) loop when source == dest.\n if (source == dest) {\n return;\n }\n\n // For large copies we copy whole words at a time. The final\n // word is aligned to the end of the range (instead of after the\n // previous) to handle partial words. So a copy will look like this:\n //\n // ####\n // ####\n // ####\n // ####\n //\n // We handle overlap in the source and destination range by\n // changing the copying direction. This prevents us from\n // overwriting parts of source that we still need to copy.\n //\n // This correctly handles source == dest\n //\n if (source > dest) {\n assembly {\n // We subtract 32 from `sEnd` and `dEnd` because it\n // is easier to compare with in the loop, and these\n // are also the addresses we need for copying the\n // last bytes.\n length := sub(length, 32)\n let sEnd := add(source, length)\n let dEnd := add(dest, length)\n\n // Remember the last 32 bytes of source\n // This needs to be done here and not after the loop\n // because we may have overwritten the last bytes in\n // source already due to overlap.\n let last := mload(sEnd)\n\n // Copy whole words front to back\n // Note: the first check is always true,\n // this could have been a do-while loop.\n // solhint-disable-next-line no-empty-blocks\n for {} lt(source, sEnd) {} {\n mstore(dest, mload(source))\n source := add(source, 32)\n dest := add(dest, 32)\n }\n \n // Write the last 32 bytes\n mstore(dEnd, last)\n }\n } else {\n assembly {\n // We subtract 32 from `sEnd` and `dEnd` because those\n // are the starting points when copying a word at the end.\n length := sub(length, 32)\n let sEnd := add(source, length)\n let dEnd := add(dest, length)\n\n // Remember the first 32 bytes of source\n // This needs to be done here and not after the loop\n // because we may have overwritten the first bytes in\n // source already due to overlap.\n let first := mload(source)\n\n // Copy whole words back to front\n // We use a signed comparisson here to allow dEnd to become\n // negative (happens when source and dest < 32). Valid\n // addresses in local memory will never be larger than\n // 2**255, so they can be safely re-interpreted as signed.\n // Note: the first check is always true,\n // this could have been a do-while loop.\n // solhint-disable-next-line no-empty-blocks\n for {} slt(dest, dEnd) {} {\n mstore(dEnd, mload(sEnd))\n sEnd := sub(sEnd, 32)\n dEnd := sub(dEnd, 32)\n }\n \n // Write the first 32 bytes\n mstore(dest, first)\n }\n }\n }\n }\n\n /// @dev Returns a slices from a byte array.\n /// @param b The byte array to take a slice from.\n /// @param from The starting index for the slice (inclusive).\n /// @param to The final index for the slice (exclusive).\n /// @return result The slice containing bytes at indices [from, to)\n function slice(\n bytes memory b,\n uint256 from,\n uint256 to\n )\n internal\n pure\n returns (bytes memory result)\n {\n require(\n from <= to,\n \"FROM_LESS_THAN_TO_REQUIRED\"\n );\n require(\n to < b.length,\n \"TO_LESS_THAN_LENGTH_REQUIRED\"\n );\n \n // Create a new bytes structure and copy contents\n result = new bytes(to - from);\n memCopy(\n result.contentAddress(),\n b.contentAddress() + from,\n result.length\n );\n return result;\n }\n \n /// @dev Returns a slice from a byte array without preserving the input.\n /// @param b The byte array to take a slice from. Will be destroyed in the process.\n /// @param from The starting index for the slice (inclusive).\n /// @param to The final index for the slice (exclusive).\n /// @return result The slice containing bytes at indices [from, to)\n /// @dev When `from == 0`, the original array will match the slice. In other cases its state will be corrupted.\n function sliceDestructive(\n bytes memory b,\n uint256 from,\n uint256 to\n )\n internal\n pure\n returns (bytes memory result)\n {\n require(\n from <= to,\n \"FROM_LESS_THAN_TO_REQUIRED\"\n );\n require(\n to < b.length,\n \"TO_LESS_THAN_LENGTH_REQUIRED\"\n );\n \n // Create a new bytes structure around [from, to) in-place.\n assembly {\n result := add(b, from)\n mstore(result, sub(to, from))\n }\n return result;\n }\n\n /// @dev Pops the last byte off of a byte array by modifying its length.\n /// @param b Byte array that will be modified.\n /// @return The byte that was popped off.\n function popLastByte(bytes memory b)\n internal\n pure\n returns (bytes1 result)\n {\n require(\n b.length > 0,\n \"GREATER_THAN_ZERO_LENGTH_REQUIRED\"\n );\n\n // Store last byte.\n result = b[b.length - 1];\n\n assembly {\n // Decrement length of byte array.\n let newLen := sub(mload(b), 1)\n mstore(b, newLen)\n }\n return result;\n }\n\n /// @dev Pops the last 20 bytes off of a byte array by modifying its length.\n /// @param b Byte array that will be modified.\n /// @return The 20 byte address that was popped off.\n function popLast20Bytes(bytes memory b)\n internal\n pure\n returns (address result)\n {\n require(\n b.length >= 20,\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Store last 20 bytes.\n result = readAddress(b, b.length - 20);\n\n assembly {\n // Subtract 20 from byte array length.\n let newLen := sub(mload(b), 20)\n mstore(b, newLen)\n }\n return result;\n }\n\n /// @dev Tests equality of two byte arrays.\n /// @param lhs First byte array to compare.\n /// @param rhs Second byte array to compare.\n /// @return True if arrays are the same. False otherwise.\n function equals(\n bytes memory lhs,\n bytes memory rhs\n )\n internal\n pure\n returns (bool equal)\n {\n // Keccak gas cost is 30 + numWords * 6. This is a cheap way to compare.\n // We early exit on unequal lengths, but keccak would also correctly\n // handle this.\n return lhs.length == rhs.length && keccak256(lhs) == keccak256(rhs);\n }\n\n /// @dev Reads an address from a position in a byte array.\n /// @param b Byte array containing an address.\n /// @param index Index in byte array of address.\n /// @return address from byte array.\n function readAddress(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (address result)\n {\n require(\n b.length >= index + 20, // 20 is length of address\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Add offset to index:\n // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)\n // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)\n index += 20;\n\n // Read address from array memory\n assembly {\n // 1. Add index to address of bytes array\n // 2. Load 32-byte word from memory\n // 3. Apply 20-byte mask to obtain address\n result := and(mload(add(b, index)), 0xffffffffffffffffffffffffffffffffffffffff)\n }\n return result;\n }\n\n /// @dev Writes an address into a specific position in a byte array.\n /// @param b Byte array to insert address into.\n /// @param index Index in byte array of address.\n /// @param input Address to put into byte array.\n function writeAddress(\n bytes memory b,\n uint256 index,\n address input\n )\n internal\n pure\n {\n require(\n b.length >= index + 20, // 20 is length of address\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Add offset to index:\n // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)\n // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)\n index += 20;\n\n // Store address into array memory\n assembly {\n // The address occupies 20 bytes and mstore stores 32 bytes.\n // First fetch the 32-byte word where we'll be storing the address, then\n // apply a mask so we have only the bytes in the word that the address will not occupy.\n // Then combine these bytes with the address and store the 32 bytes back to memory with mstore.\n\n // 1. Add index to address of bytes array\n // 2. Load 32-byte word from memory\n // 3. Apply 12-byte mask to obtain extra bytes occupying word of memory where we'll store the address\n let neighbors := and(\n mload(add(b, index)),\n 0xffffffffffffffffffffffff0000000000000000000000000000000000000000\n )\n \n // Make sure input address is clean.\n // (Solidity does not guarantee this)\n input := and(input, 0xffffffffffffffffffffffffffffffffffffffff)\n\n // Store the neighbors and address into memory\n mstore(add(b, index), xor(input, neighbors))\n }\n }\n\n /// @dev Reads a bytes32 value from a position in a byte array.\n /// @param b Byte array containing a bytes32 value.\n /// @param index Index in byte array of bytes32 value.\n /// @return bytes32 value from byte array.\n function readBytes32(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes32 result)\n {\n require(\n b.length >= index + 32,\n \"GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 256 bit length parameter\n index += 32;\n\n // Read the bytes32 from array memory\n assembly {\n result := mload(add(b, index))\n }\n return result;\n }\n\n /// @dev Writes a bytes32 into a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input bytes32 to put into byte array.\n function writeBytes32(\n bytes memory b,\n uint256 index,\n bytes32 input\n )\n internal\n pure\n {\n require(\n b.length >= index + 32,\n \"GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 256 bit length parameter\n index += 32;\n\n // Read the bytes32 from array memory\n assembly {\n mstore(add(b, index), input)\n }\n }\n\n /// @dev Reads a uint256 value from a position in a byte array.\n /// @param b Byte array containing a uint256 value.\n /// @param index Index in byte array of uint256 value.\n /// @return uint256 value from byte array.\n function readUint256(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (uint256 result)\n {\n result = uint256(readBytes32(b, index));\n return result;\n }\n\n /// @dev Writes a uint256 into a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input uint256 to put into byte array.\n function writeUint256(\n bytes memory b,\n uint256 index,\n uint256 input\n )\n internal\n pure\n {\n writeBytes32(b, index, bytes32(input));\n }\n\n /// @dev Reads an unpadded bytes4 value from a position in a byte array.\n /// @param b Byte array containing a bytes4 value.\n /// @param index Index in byte array of bytes4 value.\n /// @return bytes4 value from byte array.\n function readBytes4(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes4 result)\n {\n require(\n b.length >= index + 4,\n \"GREATER_OR_EQUAL_TO_4_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 32 byte length field\n index += 32;\n\n // Read the bytes4 from array memory\n assembly {\n result := mload(add(b, index))\n // Solidity does not require us to clean the trailing bytes.\n // We do it anyway\n result := and(result, 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000)\n }\n return result;\n }\n\n /// @dev Reads nested bytes from a specific position.\n /// @dev NOTE: the returned value overlaps with the input value.\n /// Both should be treated as immutable.\n /// @param b Byte array containing nested bytes.\n /// @param index Index of nested bytes.\n /// @return result Nested bytes.\n function readBytesWithLength(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes memory result)\n {\n // Read length of nested bytes\n uint256 nestedBytesLength = readUint256(b, index);\n index += 32;\n\n // Assert length of <b> is valid, given\n // length of nested bytes\n require(\n b.length >= index + nestedBytesLength,\n \"GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED\"\n );\n \n // Return a pointer to the byte array as it exists inside `b`\n assembly {\n result := add(b, index)\n }\n return result;\n }\n\n /// @dev Inserts bytes at a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input bytes to insert.\n function writeBytesWithLength(\n bytes memory b,\n uint256 index,\n bytes memory input\n )\n internal\n pure\n {\n // Assert length of <b> is valid, given\n // length of input\n require(\n b.length >= index + 32 + input.length, // 32 bytes to store length\n \"GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED\"\n );\n\n // Copy <input> into <b>\n memCopy(\n b.contentAddress() + index,\n input.rawAddress(), // includes length of <input>\n input.length + 32 // +32 bytes to store <input> length\n );\n }\n\n /// @dev Performs a deep copy of a byte array onto another byte array of greater than or equal length.\n /// @param dest Byte array that will be overwritten with source bytes.\n /// @param source Byte array to copy onto dest bytes.\n function deepCopyBytes(\n bytes memory dest,\n bytes memory source\n )\n internal\n pure\n {\n uint256 sourceLen = source.length;\n // Dest length must be >= source length, or some bytes would not be copied.\n require(\n dest.length >= sourceLen,\n \"GREATER_OR_EQUAL_TO_SOURCE_BYTES_LENGTH_REQUIRED\"\n );\n memCopy(\n dest.contentAddress(),\n source.contentAddress(),\n sourceLen\n );\n }\n}\n",
- "2.0.0/utils/Ownable/IOwnable.sol": "pragma solidity 0.4.24;\n\n\ncontract IOwnable {\n\n function transferOwnership(address newOwner)\n public;\n}\n",
- "2.0.0/utils/Ownable/Ownable.sol": "pragma solidity 0.4.24;\n\nimport \"./IOwnable.sol\";\n\n\ncontract Ownable is\n IOwnable\n{\n address public owner;\n\n constructor ()\n public\n {\n owner = msg.sender;\n }\n\n modifier onlyOwner() {\n require(\n msg.sender == owner,\n \"ONLY_CONTRACT_OWNER\"\n );\n _;\n }\n\n function transferOwnership(address newOwner)\n public\n onlyOwner\n {\n if (newOwner != address(0)) {\n owner = newOwner;\n }\n }\n}\n",
- "2.0.0/utils/ReentrancyGuard/ReentrancyGuard.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract ReentrancyGuard {\n\n // Locked state of mutex\n bool private locked = false;\n\n /// @dev Functions with this modifer cannot be reentered. The mutex will be locked\n /// before function execution and unlocked after.\n modifier nonReentrant() {\n // Ensure mutex is unlocked\n require(\n !locked,\n \"REENTRANCY_ILLEGAL\"\n );\n\n // Lock mutex before function call\n locked = true;\n\n // Perform function call\n _;\n\n // Unlock mutex after function call\n locked = false;\n }\n}\n",
- "2.0.0/utils/SafeMath/SafeMath.sol": "pragma solidity 0.4.24;\n\n\ncontract SafeMath {\n\n function safeMul(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n if (a == 0) {\n return 0;\n }\n uint256 c = a * b;\n require(\n c / a == b,\n \"UINT256_OVERFLOW\"\n );\n return c;\n }\n\n function safeDiv(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n uint256 c = a / b;\n return c;\n }\n\n function safeSub(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n require(\n b <= a,\n \"UINT256_UNDERFLOW\"\n );\n return a - b;\n }\n\n function safeAdd(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n uint256 c = a + b;\n require(\n c >= a,\n \"UINT256_OVERFLOW\"\n );\n return c;\n }\n\n function max64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n\n function max256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n}\n"
- },
- "sourceTreeHashHex": "0xb375308e9f71e2b537b4b9fe7d0dc45c38b7c936468e948958e6aa135dc204c1",
- "compiler": {
- "name": "solc",
- "version": "soljson-v0.4.24+commit.e67f0147.js",
- "settings": {
- "optimizer": {
- "enabled": true,
- "runs": 1000000
- },
- "outputSelection": {
- "*": {
- "*": [
- "abi",
- "evm.bytecode.object",
- "evm.bytecode.sourceMap",
- "evm.deployedBytecode.object",
- "evm.deployedBytecode.sourceMap"
- ]
- }
- }
- }
- },
- "networks": {
- "3": {
- "address": "0x3983e204b12b3c02fb0638caf2cd406a62e0ead3",
- "links": {},
- "constructorArgs": "[\"0x4530c0483a1633c7a1c97d2c53721caff2caaaaf\",\"0xf47261b0000000000000000000000000ff67881f8d12f372d91baae9752eb3631ff0ed00\",\"0xf47261b0000000000000000000000000c778417e063141139fce010982780140aa0cd5ab\"]"
- },
- "42": {
- "address": "0xd85e2fa7e7e252b27b01bf0d65c946959d2f45b8",
- "links": {},
- "constructorArgs": "[\"0x35dd2932454449b14cee11a94d3674a936d5d7b2\",\"0xf47261b00000000000000000000000002002d3812f58e35f0ea1ffbf80a75a38c32175fa\",\"0xf47261b0000000000000000000000000d0a1e359811322d97991e03f863a0c30c2cf029c\"]"
- },
- "50": {
- "address": "0xb69e673309512a9d726f87304c6984054f87a93b",
- "links": {},
- "constructorArgs": "[\"0x0b1ba0af832d7c05fd64161e0db78e85978e8082\",\"0xf47261b0000000000000000000000000871dd7c2b4b25e1aa18728e9d5f2af4c4e431f5c\",\"0xf47261b00000000000000000000000000000000000000000000000000000000000000000\"]"
- }
- }
-}
diff --git a/packages/migrations/artifacts/2.0.0-testnet/IValidator.json b/packages/migrations/artifacts/2.0.0-testnet/IValidator.json
deleted file mode 100644
index 0ccb7b343..000000000
--- a/packages/migrations/artifacts/2.0.0-testnet/IValidator.json
+++ /dev/null
@@ -1,320 +0,0 @@
-{
- "schemaVersion": "2.0.0",
- "contractName": "IValidator",
- "compilerOutput": {
- "abi": [
- {
- "constant": true,
- "inputs": [
- {
- "name": "hash",
- "type": "bytes32"
- },
- {
- "name": "signerAddress",
- "type": "address"
- },
- {
- "name": "signature",
- "type": "bytes"
- }
- ],
- "name": "isValidSignature",
- "outputs": [
- {
- "name": "isValid",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- }
- ],
- "evm": {
- "bytecode": {
- "linkReferences": {},
- "object": "0x",
- "opcodes": "",
- "sourceMap": ""
- },
- "deployedBytecode": {
- "linkReferences": {},
- "object": "0x",
- "opcodes": "",
- "sourceMap": ""
- }
- }
- },
- "sources": {
- "2.0.0/extensions/Forwarder/Forwarder.sol": {
- "id": 0
- },
- "2.0.0/extensions/Forwarder/MixinAssets.sol": {
- "id": 1
- },
- "2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol": {
- "id": 2
- },
- "2.0.0/extensions/Forwarder/MixinForwarderCore.sol": {
- "id": 3
- },
- "2.0.0/extensions/Forwarder/MixinWeth.sol": {
- "id": 4
- },
- "2.0.0/extensions/Forwarder/interfaces/IAssets.sol": {
- "id": 5
- },
- "2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol": {
- "id": 6
- },
- "2.0.0/extensions/Forwarder/libs/LibConstants.sol": {
- "id": 7
- },
- "2.0.0/extensions/Forwarder/mixins/MAssets.sol": {
- "id": 8
- },
- "2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol": {
- "id": 9
- },
- "2.0.0/extensions/Forwarder/mixins/MWeth.sol": {
- "id": 10
- },
- "2.0.0/extensions/OrderValidator/OrderValidator.sol": {
- "id": 11
- },
- "2.0.0/protocol/AssetProxy/ERC20Proxy.sol": {
- "id": 12
- },
- "2.0.0/protocol/AssetProxy/ERC721Proxy.sol": {
- "id": 13
- },
- "2.0.0/protocol/AssetProxy/MixinAuthorizable.sol": {
- "id": 14
- },
- "2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol": {
- "id": 15
- },
- "2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol": {
- "id": 16
- },
- "2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol": {
- "id": 17
- },
- "2.0.0/protocol/Exchange/Exchange.sol": {
- "id": 18
- },
- "2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol": {
- "id": 19
- },
- "2.0.0/protocol/Exchange/MixinExchangeCore.sol": {
- "id": 20
- },
- "2.0.0/protocol/Exchange/MixinMatchOrders.sol": {
- "id": 21
- },
- "2.0.0/protocol/Exchange/MixinSignatureValidator.sol": {
- "id": 22
- },
- "2.0.0/protocol/Exchange/MixinTransactions.sol": {
- "id": 23
- },
- "2.0.0/protocol/Exchange/MixinWrapperFunctions.sol": {
- "id": 24
- },
- "2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol": {
- "id": 25
- },
- "2.0.0/protocol/Exchange/interfaces/IExchange.sol": {
- "id": 26
- },
- "2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol": {
- "id": 27
- },
- "2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol": {
- "id": 28
- },
- "2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol": {
- "id": 29
- },
- "2.0.0/protocol/Exchange/interfaces/ITransactions.sol": {
- "id": 30
- },
- "2.0.0/protocol/Exchange/interfaces/IValidator.sol": {
- "id": 31
- },
- "2.0.0/protocol/Exchange/interfaces/IWallet.sol": {
- "id": 32
- },
- "2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol": {
- "id": 33
- },
- "2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol": {
- "id": 34
- },
- "2.0.0/protocol/Exchange/libs/LibConstants.sol": {
- "id": 35
- },
- "2.0.0/protocol/Exchange/libs/LibEIP712.sol": {
- "id": 36
- },
- "2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol": {
- "id": 37
- },
- "2.0.0/protocol/Exchange/libs/LibFillResults.sol": {
- "id": 38
- },
- "2.0.0/protocol/Exchange/libs/LibMath.sol": {
- "id": 39
- },
- "2.0.0/protocol/Exchange/libs/LibOrder.sol": {
- "id": 40
- },
- "2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol": {
- "id": 41
- },
- "2.0.0/protocol/Exchange/mixins/MExchangeCore.sol": {
- "id": 42
- },
- "2.0.0/protocol/Exchange/mixins/MMatchOrders.sol": {
- "id": 43
- },
- "2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol": {
- "id": 44
- },
- "2.0.0/protocol/Exchange/mixins/MTransactions.sol": {
- "id": 45
- },
- "2.0.0/test/DummyERC20Token/DummyERC20Token.sol": {
- "id": 46
- },
- "2.0.0/test/DummyERC721Token/DummyERC721Token.sol": {
- "id": 47
- },
- "2.0.0/tokens/ERC20Token/ERC20Token.sol": {
- "id": 48
- },
- "2.0.0/tokens/ERC20Token/IERC20Token.sol": {
- "id": 49
- },
- "2.0.0/tokens/ERC20Token/MintableERC20Token.sol": {
- "id": 50
- },
- "2.0.0/tokens/ERC20Token/UnlimitedAllowanceERC20Token.sol": {
- "id": 51
- },
- "2.0.0/tokens/ERC721Token/ERC721Token.sol": {
- "id": 52
- },
- "2.0.0/tokens/ERC721Token/IERC721Receiver.sol": {
- "id": 53
- },
- "2.0.0/tokens/ERC721Token/IERC721Token.sol": {
- "id": 54
- },
- "2.0.0/tokens/ERC721Token/MintableERC721Token.sol": {
- "id": 55
- },
- "2.0.0/tokens/EtherToken/IEtherToken.sol": {
- "id": 56
- },
- "2.0.0/utils/LibBytes/LibBytes.sol": {
- "id": 57
- },
- "2.0.0/utils/Ownable/IOwnable.sol": {
- "id": 58
- },
- "2.0.0/utils/Ownable/Ownable.sol": {
- "id": 59
- },
- "2.0.0/utils/SafeMath/SafeMath.sol": {
- "id": 60
- }
- },
- "sourceCodes": {
- "2.0.0/extensions/Forwarder/Forwarder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./MixinWeth.sol\";\nimport \"./MixinForwarderCore.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./MixinAssets.sol\";\nimport \"./MixinExchangeWrapper.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract Forwarder is\n LibConstants,\n MixinWeth,\n MixinAssets,\n MixinExchangeWrapper,\n MixinForwarderCore\n{\n\n constructor (\n address _exchange,\n bytes memory _zrxAssetData,\n bytes memory _wethAssetData\n )\n public\n LibConstants(\n _exchange,\n _zrxAssetData,\n _wethAssetData\n )\n MixinForwarderCore()\n {}\n}\n",
- "2.0.0/extensions/Forwarder/MixinAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"../../tokens/ERC20Token/IERC20Token.sol\";\nimport \"../../tokens/ERC721Token/IERC721Token.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MAssets.sol\";\n\n\ncontract MixinAssets is\n Ownable,\n LibConstants,\n MAssets\n{\n\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_TRANSFER_SELECTOR = bytes4(keccak256(\"transfer(address,uint256)\"));\n\n /// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to \n /// function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be\n /// used to withdraw assets that were accidentally sent to this contract.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of ERC20 token to withdraw.\n function withdrawAsset(\n bytes assetData,\n uint256 amount\n )\n external\n onlyOwner\n {\n transferAssetToSender(assetData, amount);\n }\n\n /// @dev Transfers given amount of asset to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferAssetToSender(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n bytes4 proxyId = assetData.readBytes4(0);\n\n if (proxyId == ERC20_DATA_ID) {\n transferERC20Token(assetData, amount);\n } else if (proxyId == ERC721_DATA_ID) {\n transferERC721Token(assetData, amount);\n } else {\n revert(\"UNSUPPORTED_ASSET_PROXY\");\n }\n }\n\n /// @dev Decodes ERC20 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC20Token(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n address token = assetData.readAddress(16);\n\n // Transfer tokens.\n // We do a raw call so we can check the success separate\n // from the return data.\n bool success = token.call(abi.encodeWithSelector(\n ERC20_TRANSFER_SELECTOR,\n msg.sender,\n amount\n ));\n require(\n success,\n \"TRANSFER_FAILED\"\n );\n \n // Check return data.\n // If there is no return data, we assume the token incorrectly\n // does not return a bool. In this case we expect it to revert\n // on failure, which was handled above.\n // If the token does return data, we require that it is a single\n // value that evaluates to true.\n assembly {\n if returndatasize {\n success := 0\n if eq(returndatasize, 32) {\n // First 64 bytes of memory are reserved scratch space\n returndatacopy(0, 0, 32)\n success := mload(0)\n }\n }\n }\n require(\n success,\n \"TRANSFER_FAILED\"\n );\n }\n\n /// @dev Decodes ERC721 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC721Token(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n require(\n amount == 1,\n \"INVALID_AMOUNT\"\n );\n // Decode asset data.\n address token = assetData.readAddress(16);\n uint256 tokenId = assetData.readUint256(36);\n\n // Perform transfer.\n IERC721Token(token).transferFrom(\n address(this),\n msg.sender,\n tokenId\n );\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MExchangeWrapper.sol\";\nimport \"../../protocol/Exchange/libs/LibAbiEncoder.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../protocol/Exchange/libs/LibFillResults.sol\";\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\n\n\ncontract MixinExchangeWrapper is\n LibAbiEncoder,\n LibFillResults,\n LibMath,\n LibConstants,\n MExchangeWrapper\n{\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n // ABI encode calldata for `fillOrder`\n bytes memory fillOrderCalldata = abiEncodeFillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n\n address exchange = address(EXCHANGE);\n\n // Call `fillOrder` and handle any exceptions gracefully\n assembly {\n let success := call(\n gas, // forward all gas, TODO: look into gas consumption of assert/throw\n exchange, // call address of Exchange contract\n 0, // transfer 0 wei\n add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes)\n mload(fillOrderCalldata), // length of input\n fillOrderCalldata, // write output over input\n 128 // output size is 128 bytes\n )\n switch success\n case 0 {\n mstore(fillResults, 0)\n mstore(add(fillResults, 32), 0)\n mstore(add(fillResults, 64), 0)\n mstore(add(fillResults, 96), 0)\n }\n case 1 {\n mstore(fillResults, mload(fillOrderCalldata))\n mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32)))\n mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64)))\n mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96)))\n }\n }\n return fillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of WETH has been sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param wethSellAmount Desired amount of WETH to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellWeth(\n LibOrder.Order[] memory orders,\n uint256 wethSellAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // We assume that asset being sold by taker is WETH for each order.\n orders[i].makerAssetData = makerAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of WETH to sell\n uint256 remainingTakerAssetFillAmount = safeSub(wethSellAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of WETH\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= wethSellAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// The asset being sold by taker must always be WETH.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyExactAmountWithWeth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // We assume that asset being sold by taker is WETH for each order.\n orders[i].makerAssetData = makerAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmount(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n uint256 makerAssetFilledAmount = totalFillResults.makerAssetFilledAmount;\n if (makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n\n require(\n makerAssetFilledAmount >= makerAssetFillAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return totalFillResults;\n }\n\n /// @dev Buys zrxBuyAmount of ZRX fee tokens, taking into account ZRX fees for each order. This will guarantee\n /// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues).\n /// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX\n /// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases.\n /// The asset being sold by taker must always be WETH. \n /// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset.\n /// @param zrxBuyAmount Desired amount of ZRX to buy.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return totalFillResults Amounts filled and fees paid by maker and taker.\n function marketBuyExactZrxWithWeth(\n LibOrder.Order[] memory orders,\n uint256 zrxBuyAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n // Do nothing if zrxBuyAmount == 0\n if (zrxBuyAmount == 0) {\n return totalFillResults;\n }\n\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n uint256 zrxPurchased = 0;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // All of these are ZRX/WETH, so we can drop the respective assetData from calldata.\n orders[i].makerAssetData = zrxAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of ZRX to buy.\n uint256 remainingZrxBuyAmount = safeSub(zrxBuyAmount, zrxPurchased);\n\n // Convert the remaining amount of ZRX to buy into remaining amount\n // of WETH to sell, assuming entire amount can be sold in the current order.\n uint256 remainingWethSellAmount = getPartialAmount(\n orders[i].takerAssetAmount,\n safeSub(orders[i].makerAssetAmount, orders[i].takerFee), // our exchange rate after fees \n remainingZrxBuyAmount\n );\n\n // Attempt to sell the remaining amount of WETH.\n FillResults memory singleFillResult = fillOrderNoThrow(\n orders[i],\n safeAdd(remainingWethSellAmount, 1), // we add 1 wei to the fill amount to make up for rounding errors\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker.\n addFillResults(totalFillResults, singleFillResult);\n zrxPurchased = safeSub(totalFillResults.makerAssetFilledAmount, totalFillResults.takerFeePaid);\n\n // Stop execution if the entire amount of ZRX has been bought.\n if (zrxPurchased >= zrxBuyAmount) {\n break;\n }\n }\n\n require(\n zrxPurchased >= zrxBuyAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return totalFillResults;\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinForwarderCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MWeth.sol\";\nimport \"./mixins/MAssets.sol\";\nimport \"./mixins/MExchangeWrapper.sol\";\nimport \"./interfaces/IForwarderCore.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../protocol/Exchange/libs/LibFillResults.sol\";\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\n\n\ncontract MixinForwarderCore is\n LibFillResults,\n LibMath,\n LibConstants,\n MWeth,\n MAssets,\n MExchangeWrapper,\n IForwarderCore\n{\n\n using LibBytes for bytes;\n\n /// @dev Constructor approves ERC20 proxy to transfer ZRX and WETH on this contract's behalf.\n constructor ()\n public\n {\n address proxyAddress = EXCHANGE.getAssetProxy(ERC20_DATA_ID);\n if (proxyAddress != address(0)) {\n ETHER_TOKEN.approve(proxyAddress, MAX_UINT);\n ZRX_TOKEN.approve(proxyAddress, MAX_UINT);\n }\n }\n\n /// @dev Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketSellOrdersWithEth(\n LibOrder.Order[] memory orders,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n FillResults memory orderFillResults,\n FillResults memory feeOrderFillResults\n )\n {\n // Convert ETH to WETH.\n convertEthToWeth();\n\n uint256 wethSellAmount;\n uint256 zrxBuyAmount;\n uint256 makerAssetAmountPurchased;\n if (orders[0].makerAssetData.equals(ZRX_ASSET_DATA)) {\n // Calculate amount of WETH that won't be spent on ETH fees.\n wethSellAmount = getPartialAmount(\n PERCENTAGE_DENOMINATOR,\n safeAdd(PERCENTAGE_DENOMINATOR, feePercentage),\n msg.value\n );\n // Market sell available WETH.\n // ZRX fees are paid with this contract's balance.\n orderFillResults = marketSellWeth(\n orders,\n wethSellAmount,\n signatures\n );\n // The fee amount must be deducted from the amount transfered back to sender.\n makerAssetAmountPurchased = safeSub(orderFillResults.makerAssetFilledAmount, orderFillResults.takerFeePaid);\n } else {\n // 5% of WETH is reserved for filling feeOrders and paying feeRecipient.\n wethSellAmount = getPartialAmount(\n MAX_WETH_FILL_PERCENTAGE,\n PERCENTAGE_DENOMINATOR,\n msg.value\n );\n // Market sell 95% of WETH.\n // ZRX fees are payed with this contract's balance.\n orderFillResults = marketSellWeth(\n orders,\n wethSellAmount,\n signatures\n );\n // Buy back all ZRX spent on fees.\n zrxBuyAmount = orderFillResults.takerFeePaid;\n feeOrderFillResults = marketBuyExactZrxWithWeth(\n feeOrders,\n zrxBuyAmount,\n feeSignatures\n );\n makerAssetAmountPurchased = orderFillResults.makerAssetFilledAmount;\n }\n\n // Transfer feePercentage of total ETH spent on primary orders to feeRecipient.\n // Refund remaining ETH to msg.sender.\n transferEthFeeAndRefund(\n orderFillResults.takerAssetFilledAmount,\n feeOrderFillResults.takerAssetFilledAmount,\n feePercentage,\n feeRecipient\n );\n\n // Transfer purchased assets to msg.sender.\n transferAssetToSender(orders[0].makerAssetData, makerAssetAmountPurchased);\n }\n\n /// @dev Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param makerAssetFillAmount Desired amount of makerAsset to purchase.\n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketBuyOrdersWithEth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n FillResults memory orderFillResults,\n FillResults memory feeOrderFillResults\n )\n {\n // Convert ETH to WETH.\n convertEthToWeth();\n\n uint256 zrxBuyAmount;\n uint256 makerAssetAmountPurchased;\n if (orders[0].makerAssetData.equals(ZRX_ASSET_DATA)) {\n // If the makerAsset is ZRX, it is not necessary to pay fees out of this\n // contracts's ZRX balance because fees are factored into the price of the order.\n orderFillResults = marketBuyExactZrxWithWeth(\n orders,\n makerAssetFillAmount,\n signatures\n );\n // The fee amount must be deducted from the amount transfered back to sender.\n makerAssetAmountPurchased = safeSub(orderFillResults.makerAssetFilledAmount, orderFillResults.takerFeePaid);\n } else {\n // Attemp to purchase desired amount of makerAsset.\n // ZRX fees are payed with this contract's balance.\n orderFillResults = marketBuyExactAmountWithWeth(\n orders,\n makerAssetFillAmount,\n signatures\n );\n // Buy back all ZRX spent on fees.\n zrxBuyAmount = orderFillResults.takerFeePaid;\n feeOrderFillResults = marketBuyExactZrxWithWeth(\n feeOrders,\n zrxBuyAmount,\n feeSignatures\n );\n makerAssetAmountPurchased = orderFillResults.makerAssetFilledAmount;\n }\n\n // Transfer feePercentage of total ETH spent on primary orders to feeRecipient.\n // Refund remaining ETH to msg.sender.\n transferEthFeeAndRefund(\n orderFillResults.takerAssetFilledAmount,\n feeOrderFillResults.takerAssetFilledAmount,\n feePercentage,\n feeRecipient\n );\n\n // Transfer purchased assets to msg.sender.\n transferAssetToSender(orders[0].makerAssetData, makerAssetAmountPurchased);\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinWeth.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MWeth.sol\";\n\n\ncontract MixinWeth is\n LibMath,\n LibConstants,\n MWeth\n{\n\n /// @dev Default payabale function, this allows us to withdraw WETH\n function ()\n public\n payable\n {\n require(\n msg.sender == address(ETHER_TOKEN),\n \"DEFAULT_FUNCTION_WETH_CONTRACT_ONLY\"\n );\n }\n\n /// @dev Converts message call's ETH value into WETH.\n function convertEthToWeth()\n internal\n {\n require(\n msg.value > 0,\n \"INVALID_MSG_VALUE\"\n );\n ETHER_TOKEN.deposit.value(msg.value)();\n }\n\n /// @dev Transfers feePercentage of WETH spent on primary orders to feeRecipient.\n /// Refunds any excess ETH to msg.sender.\n /// @param wethSoldExcludingFeeOrders Amount of WETH sold when filling primary orders.\n /// @param wethSoldForZrx Amount of WETH sold when purchasing ZRX required for primary order fees.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n function transferEthFeeAndRefund(\n uint256 wethSoldExcludingFeeOrders,\n uint256 wethSoldForZrx,\n uint256 feePercentage,\n address feeRecipient\n )\n internal\n {\n // Ensure feePercentage is less than 5%.\n require(\n feePercentage <= MAX_FEE_PERCENTAGE,\n \"FEE_PERCENTAGE_TOO_LARGE\"\n );\n\n // Ensure that no extra WETH owned by this contract has been sold.\n uint256 wethSold = safeAdd(wethSoldExcludingFeeOrders, wethSoldForZrx);\n require(\n wethSold <= msg.value,\n \"OVERSOLD_WETH\"\n );\n\n // Calculate amount of WETH that hasn't been sold.\n uint256 wethRemaining = safeSub(msg.value, wethSold);\n\n // Calculate ETH fee to pay to feeRecipient.\n uint256 ethFee = getPartialAmount(\n feePercentage,\n PERCENTAGE_DENOMINATOR,\n wethSoldExcludingFeeOrders\n );\n\n // Ensure fee is less than amount of WETH remaining.\n require(\n ethFee <= wethRemaining,\n \"INSUFFICIENT_ETH_REMAINING\"\n );\n \n // Do nothing if no WETH remaining\n if (wethRemaining > 0) {\n // Convert remaining WETH to ETH\n ETHER_TOKEN.withdraw(wethRemaining);\n\n // Pay ETH to feeRecipient\n if (ethFee > 0) {\n feeRecipient.transfer(ethFee);\n }\n\n // Refund remaining ETH to msg.sender.\n uint256 ethRefund = safeSub(wethRemaining, ethFee);\n if (ethRefund > 0) {\n msg.sender.transfer(ethRefund);\n }\n }\n }\n}\n",
- "2.0.0/extensions/Forwarder/interfaces/IAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IAssets {\n\n /// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to \n /// function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be\n /// used to withdraw assets that were accidentally sent to this contract.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of ERC20 token to withdraw.\n function withdrawAsset(\n bytes assetData,\n uint256 amount\n )\n external;\n}\n",
- "2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../../protocol/Exchange/libs/LibFillResults.sol\";\n\n\ncontract IForwarderCore {\n\n /// @dev Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketSellOrdersWithEth(\n LibOrder.Order[] memory orders,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n LibFillResults.FillResults memory orderFillResults,\n LibFillResults.FillResults memory feeOrderFillResults\n );\n\n /// @dev Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param makerAssetFillAmount Desired amount of makerAsset to purchase.\n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketBuyOrdersWithEth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n LibFillResults.FillResults memory orderFillResults,\n LibFillResults.FillResults memory feeOrderFillResults\n );\n}\n",
- "2.0.0/extensions/Forwarder/libs/LibConstants.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/LibBytes/LibBytes.sol\";\nimport \"../../../protocol/Exchange/interfaces/IExchange.sol\";\nimport \"../../../tokens/EtherToken/IEtherToken.sol\";\nimport \"../../../tokens/ERC20Token/IERC20Token.sol\";\n\n\ncontract LibConstants {\n\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n uint256 constant internal MAX_UINT = 2**256 - 1;\n uint256 constant internal PERCENTAGE_DENOMINATOR = 10**18; \n uint256 constant internal MAX_FEE_PERCENTAGE = 5 * PERCENTAGE_DENOMINATOR / 100; // 5%\n uint256 constant internal MAX_WETH_FILL_PERCENTAGE = 95 * PERCENTAGE_DENOMINATOR / 100; // 95%\n \n // solhint-disable var-name-mixedcase\n IExchange internal EXCHANGE;\n IEtherToken internal ETHER_TOKEN;\n IERC20Token internal ZRX_TOKEN;\n bytes internal ZRX_ASSET_DATA;\n bytes internal WETH_ASSET_DATA;\n // solhint-enable var-name-mixedcase\n\n constructor (\n address _exchange,\n bytes memory _zrxAssetData,\n bytes memory _wethAssetData\n )\n public\n {\n EXCHANGE = IExchange(_exchange);\n ZRX_ASSET_DATA = _zrxAssetData;\n WETH_ASSET_DATA = _wethAssetData;\n\n address etherToken = _wethAssetData.readAddress(16);\n address zrxToken = _zrxAssetData.readAddress(16);\n ETHER_TOKEN = IEtherToken(etherToken);\n ZRX_TOKEN = IERC20Token(zrxToken);\n }\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAssets.sol\";\n\n\ncontract MAssets is\n IAssets\n{\n\n /// @dev Transfers given amount of asset to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferAssetToSender(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n\n /// @dev Decodes ERC20 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC20Token(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n\n /// @dev Decodes ERC721 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC721Token(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../../protocol/Exchange/libs/LibFillResults.sol\";\n\n\ncontract MExchangeWrapper {\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of WETH has been sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param wethSellAmount Desired amount of WETH to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellWeth(\n LibOrder.Order[] memory orders,\n uint256 wethSellAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// The asset being sold by taker must always be WETH.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyExactAmountWithWeth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Buys zrxBuyAmount of ZRX fee tokens, taking into account ZRX fees for each order. This will guarantee\n /// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues).\n /// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX\n /// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases.\n /// The asset being sold by taker must always be WETH. \n /// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset.\n /// @param zrxBuyAmount Desired amount of ZRX to buy.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return totalFillResults Amounts filled and fees paid by maker and taker.\n function marketBuyExactZrxWithWeth(\n LibOrder.Order[] memory orders,\n uint256 zrxBuyAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MWeth.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract MWeth {\n\n /// @dev Converts message call's ETH value into WETH.\n function convertEthToWeth()\n internal;\n\n /// @dev Transfers feePercentage of WETH spent on primary orders to feeRecipient.\n /// Refunds any excess ETH to msg.sender.\n /// @param wethSoldExcludingFeeOrders Amount of WETH sold when filling primary orders.\n /// @param wethSoldForZrx Amount of WETH sold when purchasing ZRX required for primary order fees.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n function transferEthFeeAndRefund(\n uint256 wethSoldExcludingFeeOrders,\n uint256 wethSoldForZrx,\n uint256 feePercentage,\n address feeRecipient\n )\n internal;\n}\n",
- "2.0.0/extensions/OrderValidator/OrderValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../protocol/Exchange/interfaces/IExchange.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../tokens/ERC20Token/IERC20Token.sol\";\nimport \"../../tokens/ERC721Token/IERC721Token.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\n\n\ncontract OrderValidator {\n\n bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n\n using LibBytes for bytes;\n\n struct TraderInfo {\n uint256 makerBalance; // Maker's balance of makerAsset\n uint256 makerAllowance; // Maker's allowance to corresponding AssetProxy\n uint256 takerBalance; // Taker's balance of takerAsset\n uint256 takerAllowance; // Taker's allowance to corresponding AssetProxy\n uint256 makerZrxBalance; // Maker's balance of ZRX\n uint256 makerZrxAllowance; // Maker's allowance of ZRX to ERC20Proxy\n uint256 takerZrxBalance; // Taker's balance of ZRX\n uint256 takerZrxAllowance; // Taker's allowance of ZRX to ERC20Proxy\n }\n\n // solhint-disable var-name-mixedcase\n IExchange internal EXCHANGE;\n bytes internal ZRX_ASSET_DATA;\n // solhint-enable var-name-mixedcase\n\n constructor (address _exchange, bytes memory _zrxAssetData)\n public\n {\n EXCHANGE = IExchange(_exchange);\n ZRX_ASSET_DATA = _zrxAssetData;\n }\n\n /// @dev Fetches information for order and maker/taker of order.\n /// @param order The order structure.\n /// @param takerAddress Address that will be filling the order.\n /// @return OrderInfo and TraderInfo instances for given order.\n function getOrderAndTraderInfo(LibOrder.Order memory order, address takerAddress)\n public\n view\n returns (LibOrder.OrderInfo memory orderInfo, TraderInfo memory traderInfo)\n {\n orderInfo = EXCHANGE.getOrderInfo(order);\n traderInfo = getTraderInfo(order, takerAddress);\n return (orderInfo, traderInfo);\n }\n\n /// @dev Fetches information for all passed in orders and the makers/takers of each order.\n /// @param orders Array of order specifications.\n /// @param takerAddresses Array of taker addresses corresponding to each order.\n /// @return Arrays of OrderInfo and TraderInfo instances that correspond to each order.\n function getOrdersAndTradersInfo(LibOrder.Order[] memory orders, address[] memory takerAddresses)\n public\n view\n returns (LibOrder.OrderInfo[] memory ordersInfo, TraderInfo[] memory tradersInfo)\n {\n ordersInfo = EXCHANGE.getOrdersInfo(orders);\n tradersInfo = getTradersInfo(orders, takerAddresses);\n return (ordersInfo, tradersInfo);\n }\n\n /// @dev Fetches balance and allowances for maker and taker of order.\n /// @param order The order structure.\n /// @param takerAddress Address that will be filling the order.\n /// @return Balances and allowances of maker and taker of order.\n function getTraderInfo(LibOrder.Order memory order, address takerAddress)\n public\n view\n returns (TraderInfo memory traderInfo)\n {\n (traderInfo.makerBalance, traderInfo.makerAllowance) = getBalanceAndAllowance(order.makerAddress, order.makerAssetData);\n (traderInfo.takerBalance, traderInfo.takerAllowance) = getBalanceAndAllowance(takerAddress, order.takerAssetData);\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n (traderInfo.makerZrxBalance, traderInfo.makerZrxAllowance) = getBalanceAndAllowance(order.makerAddress, zrxAssetData);\n (traderInfo.takerZrxBalance, traderInfo.takerZrxAllowance) = getBalanceAndAllowance(takerAddress, zrxAssetData);\n return traderInfo;\n }\n\n /// @dev Fetches balances and allowances of maker and taker for each provided order.\n /// @param orders Array of order specifications.\n /// @param takerAddresses Array of taker addresses corresponding to each order.\n /// @return Array of balances and allowances for maker and taker of each order.\n function getTradersInfo(LibOrder.Order[] memory orders, address[] memory takerAddresses)\n public\n view\n returns (TraderInfo[] memory)\n {\n uint256 ordersLength = orders.length;\n TraderInfo[] memory tradersInfo = new TraderInfo[](ordersLength);\n for (uint256 i = 0; i != ordersLength; i++) {\n tradersInfo[i] = getTraderInfo(orders[i], takerAddresses[i]);\n }\n return tradersInfo;\n }\n\n /// @dev Fetches token balances and allowances of an address to given assetProxy. Supports ERC20 and ERC721.\n /// @param target Address to fetch balances and allowances of.\n /// @param assetData Encoded data that can be decoded by a specified proxy contract when transferring asset.\n /// @return Balance of asset and allowance set to given proxy of asset.\n /// For ERC721 tokens, these values will always be 1 or 0.\n function getBalanceAndAllowance(address target, bytes memory assetData)\n public\n view\n returns (uint256 balance, uint256 allowance)\n {\n bytes4 assetProxyId = assetData.readBytes4(0);\n address token = assetData.readAddress(16);\n address assetProxy = EXCHANGE.getAssetProxy(assetProxyId);\n\n if (assetProxyId == ERC20_DATA_ID) {\n // Query balance\n balance = IERC20Token(token).balanceOf(target);\n\n // Query allowance\n allowance = IERC20Token(token).allowance(target, assetProxy);\n } else if (assetProxyId == ERC721_DATA_ID) {\n uint256 tokenId = assetData.readUint256(36);\n\n // Query owner of tokenId\n address owner = getERC721TokenOwner(token, tokenId);\n\n // Set balance to 1 if tokenId is owned by target\n balance = target == owner ? 1 : 0;\n\n // Check if ERC721Proxy is approved to spend tokenId\n bool isApproved = IERC721Token(token).isApprovedForAll(target, assetProxy) || IERC721Token(token).getApproved(tokenId) == assetProxy;\n \n // Set alowance to 1 if ERC721Proxy is approved to spend tokenId\n allowance = isApproved ? 1 : 0;\n } else {\n revert(\"UNSUPPORTED_ASSET_PROXY\");\n }\n return (balance, allowance);\n }\n\n /// @dev Fetches token balances and allowances of an address for each given assetProxy. Supports ERC20 and ERC721.\n /// @param target Address to fetch balances and allowances of.\n /// @param assetData Array of encoded byte arrays that can be decoded by a specified proxy contract when transferring asset.\n /// @return Balances and allowances of assets.\n /// For ERC721 tokens, these values will always be 1 or 0.\n function getBalancesAndAllowances(address target, bytes[] memory assetData)\n public\n view\n returns (uint256[] memory, uint256[] memory)\n {\n uint256 length = assetData.length;\n uint256[] memory balances = new uint256[](length);\n uint256[] memory allowances = new uint256[](length);\n for (uint256 i = 0; i != length; i++) {\n (balances[i], allowances[i]) = getBalanceAndAllowance(target, assetData[i]);\n }\n return (balances, allowances);\n }\n\n /// @dev Calls `token.ownerOf(tokenId)`, but returns a null owner instead of reverting on an unowned token.\n /// @param token Address of ERC721 token.\n /// @param tokenId The identifier for the specific NFT.\n /// @return Owner of tokenId or null address if unowned.\n function getERC721TokenOwner(address token, uint256 tokenId)\n public\n view\n returns (address owner)\n {\n assembly {\n // load free memory pointer\n let cdStart := mload(64)\n\n // bytes4(keccak256(ownerOf(uint256))) = 0x6352211e\n mstore(cdStart, 0x6352211e00000000000000000000000000000000000000000000000000000000)\n mstore(add(cdStart, 4), tokenId)\n\n // staticcall `ownerOf(tokenId)`\n // `ownerOf` will revert if tokenId is not owned\n let success := staticcall(\n gas, // forward all gas\n token, // call token contract\n cdStart, // start of calldata\n 36, // length of input is 36 bytes\n cdStart, // write output over input\n 32 // size of output is 32 bytes\n )\n\n // Success implies that tokenId is owned\n // Copy owner from return data if successful\n if success {\n owner := mload(cdStart)\n } \n }\n\n // Owner initialized to address(0), no need to modify if call is unsuccessful\n return owner;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/ERC20Proxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"./MixinAuthorizable.sol\";\n\n\ncontract ERC20Proxy is\n MixinAuthorizable\n{\n // Id of this proxy.\n bytes4 constant internal PROXY_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n \n // solhint-disable-next-line payable-fallback\n function () \n external\n {\n assembly {\n // The first 4 bytes of calldata holds the function selector\n let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)\n\n // `transferFrom` will be called with the following parameters:\n // assetData Encoded byte array.\n // from Address to transfer asset from.\n // to Address to transfer asset to.\n // amount Amount of asset to transfer.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {\n\n // To lookup a value in a mapping, we load from the storage location keccak256(k, p),\n // where k is the key left padded to 32 bytes and p is the storage slot\n let start := mload(64)\n mstore(start, and(caller, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(start, 32), authorized_slot)\n\n // Revert if authorized[msg.sender] == false\n if iszero(sload(keccak256(start, 64))) {\n // Revert with `Error(\"SENDER_NOT_AUTHORIZED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n \n /////// Token contract address ///////\n // The token address is found as follows:\n // * It is stored at offset 4 in `assetData` contents.\n // * This is stored at offset 32 from `assetData`.\n // * The offset to `assetData` from Params is stored at offset\n // 4 in calldata.\n // * The offset of Params in calldata is 4.\n // So we read location 4 and add 32 + 4 + 4 to it.\n let token := calldataload(add(calldataload(4), 40))\n \n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFrom` selector.\n // Any trailing data in transferFromSelector will be\n // overwritten in the next `mstore` call.\n mstore(0, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // We copy the fields `from`, `to` and `amount` in bulk\n // from our own calldata to the new calldata.\n calldatacopy(4, 36, 96)\n\n /////// Call `token.transferFrom` using the calldata ///////\n let success := call(\n gas, // forward all gas\n token, // call address of token contract\n 0, // don't send any ETH\n 0, // pointer to start of input\n 100, // length of input\n 0, // write output over input\n 32 // output size should be 32 bytes\n )\n\n /////// Check return data. ///////\n // If there is no return data, we assume the token incorrectly\n // does not return a bool. In this case we expect it to revert\n // on failure, which was handled above.\n // If the token does return data, we require that it is a single\n // nonzero 32 bytes value.\n // So the transfer succeeded if the call succeeded and either\n // returned nothing, or returned a non-zero 32 byte value. \n success := and(success, or(\n iszero(returndatasize),\n and(\n eq(returndatasize, 32),\n gt(mload(0), 0)\n )\n ))\n if success {\n return(0, 0)\n }\n \n // Revert with `Error(\"TRANSFER_FAILED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n }\n }\n\n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4)\n {\n return PROXY_ID;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/ERC721Proxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"./MixinAuthorizable.sol\";\n\n\ncontract ERC721Proxy is\n MixinAuthorizable\n{\n // Id of this proxy.\n bytes4 constant internal PROXY_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n\n // solhint-disable-next-line payable-fallback\n function () \n external\n {\n assembly {\n // The first 4 bytes of calldata holds the function selector\n let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)\n\n // `transferFrom` will be called with the following parameters:\n // assetData Encoded byte array.\n // from Address to transfer asset from.\n // to Address to transfer asset to.\n // amount Amount of asset to transfer.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {\n\n // To lookup a value in a mapping, we load from the storage location keccak256(k, p),\n // where k is the key left padded to 32 bytes and p is the storage slot\n let start := mload(64)\n mstore(start, and(caller, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(start, 32), authorized_slot)\n\n // Revert if authorized[msg.sender] == false\n if iszero(sload(keccak256(start, 64))) {\n // Revert with `Error(\"SENDER_NOT_AUTHORIZED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // `transferFrom`.\n // The function is marked `external`, so no abi decodeding is done for\n // us. Instead, we expect the `calldata` memory to contain the\n // following:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n //\n // (*): offset is computed from start of function parameters, so offset\n // by an additional 4 bytes in the calldata.\n //\n // WARNING: The ABIv2 specification allows additional padding between\n // the Params and Data section. This will result in a larger\n // offset to assetData.\n\n // Asset data itself is encoded as follows:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 2 * 32 | function parameters: |\n // | | 4 | 12 + 20 | 1. token address |\n // | | 36 | | 2. tokenId |\n \n // We construct calldata for the `token.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n // \n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 4 | | 1. from |\n // | | 36 | | 2. to |\n // | | 68 | | 3. tokenId |\n\n // There exists only 1 of each token.\n // require(amount == 1, \"INVALID_AMOUNT\")\n if sub(calldataload(100), 1) {\n // Revert with `Error(\"INVALID_AMOUNT\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000e494e56414c49445f414d4f554e540000000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFrom` selector.\n // Any trailing data in transferFromSelector will be\n // overwritten in the next `mstore` call.\n mstore(0, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // We copy the fields `from` and `to` in bulk\n // from our own calldata to the new calldata.\n calldatacopy(4, 36, 64)\n\n // Copy `tokenId` field from our own calldata to the new calldata.\n let assetDataOffset := calldataload(4)\n calldatacopy(68, add(assetDataOffset, 72), 32)\n\n /////// Call `token.transferFrom` using the calldata ///////\n let token := calldataload(add(assetDataOffset, 40))\n let success := call(\n gas, // forward all gas\n token, // call address of token contract\n 0, // don't send any ETH\n 0, // pointer to start of input\n 100, // length of input\n 0, // write output to null\n 0 // output size is 0 bytes\n )\n if success {\n return(0, 0)\n }\n \n // Revert with `Error(\"TRANSFER_FAILED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n }\n }\n\n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4)\n {\n return PROXY_ID;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/MixinAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"./mixins/MAuthorizable.sol\";\n\n\ncontract MixinAuthorizable is\n Ownable,\n MAuthorizable\n{\n\n /// @dev Only authorized addresses can invoke functions with this modifier.\n modifier onlyAuthorized {\n require(\n authorized[msg.sender],\n \"SENDER_NOT_AUTHORIZED\"\n );\n _;\n }\n\n mapping (address => bool) public authorized;\n address[] public authorities;\n\n /// @dev Authorizes an address.\n /// @param target Address to authorize.\n function addAuthorizedAddress(address target)\n external\n onlyOwner\n {\n require(\n !authorized[target],\n \"TARGET_ALREADY_AUTHORIZED\"\n );\n\n authorized[target] = true;\n authorities.push(target);\n emit AuthorizedAddressAdded(target, msg.sender);\n }\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n function removeAuthorizedAddress(address target)\n external\n onlyOwner\n {\n require(\n authorized[target],\n \"TARGET_NOT_AUTHORIZED\"\n );\n\n delete authorized[target];\n for (uint256 i = 0; i < authorities.length; i++) {\n if (authorities[i] == target) {\n authorities[i] = authorities[authorities.length - 1];\n authorities.length -= 1;\n break;\n }\n }\n emit AuthorizedAddressRemoved(target, msg.sender);\n }\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n /// @param index Index of target in authorities array.\n function removeAuthorizedAddressAtIndex(\n address target,\n uint256 index\n )\n external\n onlyOwner\n {\n require(\n authorized[target],\n \"TARGET_NOT_AUTHORIZED\"\n );\n require(\n index < authorities.length,\n \"INDEX_OUT_OF_BOUNDS\"\n );\n require(\n authorities[index] == target,\n \"AUTHORIZED_ADDRESS_MISMATCH\"\n );\n\n delete authorized[target];\n authorities[index] = authorities[authorities.length - 1];\n authorities.length -= 1;\n emit AuthorizedAddressRemoved(target, msg.sender);\n }\n\n /// @dev Gets all authorized addresses.\n /// @return Array of authorized addresses.\n function getAuthorizedAddresses()\n external\n view\n returns (address[] memory)\n {\n return authorities;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IAuthorizable.sol\";\n\n\ncontract IAssetProxy is\n IAuthorizable\n{\n\n /// @dev Transfers assets. Either succeeds or throws.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param from Address to transfer asset from.\n /// @param to Address to transfer asset to.\n /// @param amount Amount of asset to transfer.\n function transferFrom(\n bytes assetData,\n address from,\n address to,\n uint256 amount\n )\n external;\n \n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4);\n}\n",
- "2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/Ownable/IOwnable.sol\";\n\n\ncontract IAuthorizable is\n IOwnable\n{\n\n /// @dev Authorizes an address.\n /// @param target Address to authorize.\n function addAuthorizedAddress(address target)\n external;\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n function removeAuthorizedAddress(address target)\n external;\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n /// @param index Index of target in authorities array.\n function removeAuthorizedAddressAtIndex(\n address target,\n uint256 index\n )\n external;\n \n /// @dev Gets all authorized addresses.\n /// @return Array of authorized addresses.\n function getAuthorizedAddresses()\n external\n view\n returns (address[] memory);\n}\n",
- "2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAuthorizable.sol\";\n\n\ncontract MAuthorizable is\n IAuthorizable\n{\n\n // Event logged when a new address is authorized.\n event AuthorizedAddressAdded(\n address indexed target,\n address indexed caller\n );\n\n // Event logged when a currently authorized address is unauthorized.\n event AuthorizedAddressRemoved(\n address indexed target,\n address indexed caller\n );\n\n /// @dev Only authorized addresses can invoke functions with this modifier.\n modifier onlyAuthorized { revert(); _; }\n}\n",
- "2.0.0/protocol/Exchange/Exchange.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./MixinExchangeCore.sol\";\nimport \"./MixinSignatureValidator.sol\";\nimport \"./MixinWrapperFunctions.sol\";\nimport \"./MixinAssetProxyDispatcher.sol\";\nimport \"./MixinTransactions.sol\";\nimport \"./MixinMatchOrders.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract Exchange is\n MixinExchangeCore,\n MixinMatchOrders,\n MixinSignatureValidator,\n MixinTransactions,\n MixinAssetProxyDispatcher,\n MixinWrapperFunctions\n{\n\n string constant public VERSION = \"2.0.1-alpha\";\n\n // Mixins are instantiated in the order they are inherited\n constructor (bytes memory _zrxAssetData)\n public\n LibConstants(_zrxAssetData) // @TODO: Remove when we deploy.\n MixinExchangeCore()\n MixinMatchOrders()\n MixinSignatureValidator()\n MixinTransactions()\n MixinAssetProxyDispatcher()\n MixinWrapperFunctions()\n {}\n}\n",
- "2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\nimport \"../AssetProxy/interfaces/IAssetProxy.sol\";\n\n\ncontract MixinAssetProxyDispatcher is\n Ownable,\n MAssetProxyDispatcher\n{\n using LibBytes for bytes;\n \n // Mapping from Asset Proxy Id's to their respective Asset Proxy\n mapping (bytes4 => IAssetProxy) public assetProxies;\n\n /// @dev Registers an asset proxy to its asset proxy id.\n /// Once an asset proxy is registered, it cannot be unregistered.\n /// @param assetProxy Address of new asset proxy to register.\n function registerAssetProxy(address assetProxy)\n external\n onlyOwner\n {\n IAssetProxy assetProxyContract = IAssetProxy(assetProxy);\n\n // Ensure that no asset proxy exists with current id.\n bytes4 assetProxyId = assetProxyContract.getProxyId();\n address currentAssetProxy = assetProxies[assetProxyId];\n require(\n currentAssetProxy == address(0),\n \"ASSET_PROXY_ALREADY_EXISTS\"\n );\n\n // Add asset proxy and log registration.\n assetProxies[assetProxyId] = assetProxyContract;\n emit AssetProxyRegistered(\n assetProxyId,\n assetProxy\n );\n }\n\n /// @dev Gets an asset proxy.\n /// @param assetProxyId Id of the asset proxy.\n /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered.\n function getAssetProxy(bytes4 assetProxyId)\n external\n view\n returns (address)\n {\n return assetProxies[assetProxyId];\n }\n\n /// @dev Forwards arguments to assetProxy and calls `transferFrom`. Either succeeds or throws.\n /// @param assetData Byte array encoded for the asset.\n /// @param from Address to transfer token from.\n /// @param to Address to transfer token to.\n /// @param amount Amount of token to transfer.\n function dispatchTransferFrom(\n bytes memory assetData,\n address from,\n address to,\n uint256 amount\n )\n internal\n {\n // Do nothing if no amount should be transferred.\n if (amount > 0) {\n // Ensure assetData length is valid\n require(\n assetData.length > 3,\n \"LENGTH_GREATER_THAN_3_REQUIRED\"\n );\n \n // Lookup assetProxy\n bytes4 assetProxyId;\n assembly {\n assetProxyId := and(mload(\n add(assetData, 32)),\n 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000\n )\n }\n address assetProxy = assetProxies[assetProxyId];\n\n // Ensure that assetProxy exists\n require(\n assetProxy != address(0),\n \"ASSET_PROXY_DOES_NOT_EXIST\"\n );\n \n // We construct calldata for the `assetProxy.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n // \n // | Area | Offset | Length | Contents |\n // | -------- |--------|---------|-------------------------------------------- |\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n\n assembly {\n /////// Setup State ///////\n // `cdStart` is the start of the calldata for `assetProxy.transferFrom` (equal to free memory ptr).\n let cdStart := mload(64)\n // `dataAreaLength` is the total number of words needed to store `assetData`\n // As-per the ABI spec, this value is padded up to the nearest multiple of 32,\n // and includes 32-bytes for length.\n let dataAreaLength := and(add(mload(assetData), 63), 0xFFFFFFFFFFFE0)\n // `cdEnd` is the end of the calldata for `assetProxy.transferFrom`.\n let cdEnd := add(cdStart, add(132, dataAreaLength))\n\n \n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFromSelector`.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n mstore(cdStart, 0xa85e59e400000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // Each parameter is padded to 32-bytes. The entire Params Area is 128 bytes.\n // Notes:\n // 1. The offset to `assetData` is the length of the Params Area (128 bytes).\n // 2. A 20-byte mask is applied to addresses to zero-out the unused bytes.\n mstore(add(cdStart, 4), 128)\n mstore(add(cdStart, 36), and(from, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(cdStart, 68), and(to, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(cdStart, 100), amount)\n \n /////// Setup Data Area ///////\n // This area holds `assetData`.\n let dataArea := add(cdStart, 132)\n // solhint-disable-next-line no-empty-blocks\n for {} lt(dataArea, cdEnd) {} {\n mstore(dataArea, mload(assetData))\n dataArea := add(dataArea, 32)\n assetData := add(assetData, 32)\n }\n\n /////// Call `assetProxy.transferFrom` using the constructed calldata ///////\n let success := call(\n gas, // forward all gas\n assetProxy, // call address of asset proxy\n 0, // don't send any ETH\n cdStart, // pointer to start of input\n sub(cdEnd, cdStart), // length of input \n cdStart, // write output over input\n 512 // reserve 512 bytes for output\n )\n if iszero(success) {\n revert(cdStart, returndatasize())\n }\n }\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\n\n\ncontract MixinExchangeCore is\n LibConstants,\n LibMath,\n LibOrder,\n LibFillResults,\n MAssetProxyDispatcher,\n MExchangeCore,\n MSignatureValidator,\n MTransactions\n{\n // Mapping of orderHash => amount of takerAsset already bought by maker\n mapping (bytes32 => uint256) public filled;\n\n // Mapping of orderHash => cancelled\n mapping (bytes32 => bool) public cancelled;\n\n // Mapping of makerAddress => senderAddress => lowest salt an order can have in order to be fillable\n // Orders with specified senderAddress and with a salt less than their epoch are considered cancelled\n mapping (address => mapping (address => uint256)) public orderEpoch;\n\n /// @dev Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch\n /// and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress).\n /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled.\n function cancelOrdersUpTo(uint256 targetOrderEpoch)\n external\n {\n address makerAddress = getCurrentContextAddress();\n // If this function is called via `executeTransaction`, we only update the orderEpoch for the makerAddress/msg.sender combination.\n // This allows external filter contracts to add rules to how orders are cancelled via this function.\n address senderAddress = makerAddress == msg.sender ? address(0) : msg.sender;\n\n // orderEpoch is initialized to 0, so to cancelUpTo we need salt + 1\n uint256 newOrderEpoch = targetOrderEpoch + 1; \n uint256 oldOrderEpoch = orderEpoch[makerAddress][senderAddress];\n\n // Ensure orderEpoch is monotonically increasing\n require(\n newOrderEpoch > oldOrderEpoch, \n \"INVALID_NEW_ORDER_EPOCH\"\n );\n\n // Update orderEpoch\n orderEpoch[makerAddress][senderAddress] = newOrderEpoch;\n emit CancelUpTo(makerAddress, senderAddress, newOrderEpoch);\n }\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrder(\n Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (FillResults memory fillResults)\n {\n // Fetch order info\n OrderInfo memory orderInfo = getOrderInfo(order);\n\n // Fetch taker address\n address takerAddress = getCurrentContextAddress();\n\n // Get amount of takerAsset to fill\n uint256 remainingTakerAssetAmount = safeSub(order.takerAssetAmount, orderInfo.orderTakerAssetFilledAmount);\n uint256 takerAssetFilledAmount = min256(takerAssetFillAmount, remainingTakerAssetAmount);\n\n // Validate context\n assertValidFill(\n order,\n orderInfo,\n takerAddress,\n takerAssetFillAmount,\n takerAssetFilledAmount,\n signature\n );\n\n // Compute proportional fill amounts\n fillResults = calculateFillResults(order, takerAssetFilledAmount);\n\n // Update exchange internal state\n updateFilledState(\n order,\n takerAddress,\n orderInfo.orderHash,\n orderInfo.orderTakerAssetFilledAmount,\n fillResults\n );\n \n // Settle order\n settleOrder(order, takerAddress, fillResults);\n\n return fillResults;\n }\n\n /// @dev After calling, the order can not be filled anymore.\n /// Throws if order is invalid or sender does not have permission to cancel.\n /// @param order Order to cancel. Order must be OrderStatus.FILLABLE.\n function cancelOrder(Order memory order)\n public\n {\n // Fetch current order status\n OrderInfo memory orderInfo = getOrderInfo(order);\n\n // Validate context\n assertValidCancel(order, orderInfo);\n\n // Perform cancel\n updateCancelledState(order, orderInfo.orderHash);\n }\n\n /// @dev Gets information about an order: status, hash, and amount filled.\n /// @param order Order to gather information on.\n /// @return OrderInfo Information about the order and its state.\n /// See LibOrder.OrderInfo for a complete description.\n function getOrderInfo(Order memory order)\n public\n view\n returns (OrderInfo memory orderInfo)\n {\n // Compute the order hash\n orderInfo.orderHash = getOrderHash(order);\n\n // Fetch filled amount\n orderInfo.orderTakerAssetFilledAmount = filled[orderInfo.orderHash];\n\n // If order.makerAssetAmount is zero, we also reject the order.\n // While the Exchange contract handles them correctly, they create\n // edge cases in the supporting infrastructure because they have\n // an 'infinite' price when computed by a simple division.\n if (order.makerAssetAmount == 0) {\n orderInfo.orderStatus = uint8(OrderStatus.INVALID_MAKER_ASSET_AMOUNT);\n return orderInfo;\n }\n\n // If order.takerAssetAmount is zero, then the order will always\n // be considered filled because 0 == takerAssetAmount == orderTakerAssetFilledAmount\n // Instead of distinguishing between unfilled and filled zero taker\n // amount orders, we choose not to support them.\n if (order.takerAssetAmount == 0) {\n orderInfo.orderStatus = uint8(OrderStatus.INVALID_TAKER_ASSET_AMOUNT);\n return orderInfo;\n }\n\n // Validate order availability\n if (orderInfo.orderTakerAssetFilledAmount >= order.takerAssetAmount) {\n orderInfo.orderStatus = uint8(OrderStatus.FULLY_FILLED);\n return orderInfo;\n }\n\n // Validate order expiration\n // solhint-disable-next-line not-rely-on-time\n if (block.timestamp >= order.expirationTimeSeconds) {\n orderInfo.orderStatus = uint8(OrderStatus.EXPIRED);\n return orderInfo;\n }\n\n // Check if order has been cancelled\n if (cancelled[orderInfo.orderHash]) {\n orderInfo.orderStatus = uint8(OrderStatus.CANCELLED);\n return orderInfo;\n }\n if (orderEpoch[order.makerAddress][order.senderAddress] > order.salt) {\n orderInfo.orderStatus = uint8(OrderStatus.CANCELLED);\n return orderInfo;\n }\n\n // All other statuses are ruled out: order is Fillable\n orderInfo.orderStatus = uint8(OrderStatus.FILLABLE);\n return orderInfo;\n }\n\n /// @dev Updates state with results of a fill order.\n /// @param order that was filled.\n /// @param takerAddress Address of taker who filled the order.\n /// @param orderTakerAssetFilledAmount Amount of order already filled.\n function updateFilledState(\n Order memory order,\n address takerAddress,\n bytes32 orderHash,\n uint256 orderTakerAssetFilledAmount,\n FillResults memory fillResults\n )\n internal\n {\n // Update state\n filled[orderHash] = safeAdd(orderTakerAssetFilledAmount, fillResults.takerAssetFilledAmount);\n\n // Log order\n emit Fill(\n order.makerAddress,\n order.feeRecipientAddress,\n takerAddress,\n msg.sender,\n fillResults.makerAssetFilledAmount,\n fillResults.takerAssetFilledAmount,\n fillResults.makerFeePaid,\n fillResults.takerFeePaid,\n orderHash,\n order.makerAssetData,\n order.takerAssetData\n );\n }\n\n /// @dev Updates state with results of cancelling an order.\n /// State is only updated if the order is currently fillable.\n /// Otherwise, updating state would have no effect.\n /// @param order that was cancelled.\n /// @param orderHash Hash of order that was cancelled.\n function updateCancelledState(\n Order memory order,\n bytes32 orderHash\n )\n internal\n {\n // Perform cancel\n cancelled[orderHash] = true;\n\n // Log cancel\n emit Cancel(\n order.makerAddress,\n order.feeRecipientAddress,\n msg.sender,\n orderHash,\n order.makerAssetData,\n order.takerAssetData\n );\n }\n\n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAddress Address of order taker.\n /// @param takerAssetFillAmount Desired amount of order to fill by taker.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @param signature Proof that the orders was created by its maker.\n function assertValidFill(\n Order memory order,\n OrderInfo memory orderInfo,\n address takerAddress,\n uint256 takerAssetFillAmount,\n uint256 takerAssetFilledAmount,\n bytes memory signature\n )\n internal\n view\n {\n // An order can only be filled if its status is FILLABLE.\n require(\n orderInfo.orderStatus == uint8(OrderStatus.FILLABLE),\n \"ORDER_UNFILLABLE\"\n );\n\n // Revert if fill amount is invalid\n require(\n takerAssetFillAmount != 0,\n \"INVALID_TAKER_AMOUNT\"\n );\n\n // Validate sender is allowed to fill this order\n if (order.senderAddress != address(0)) {\n require(\n order.senderAddress == msg.sender,\n \"INVALID_SENDER\"\n );\n }\n\n // Validate taker is allowed to fill this order\n if (order.takerAddress != address(0)) {\n require(\n order.takerAddress == takerAddress,\n \"INVALID_TAKER\"\n );\n }\n\n // Validate Maker signature (check only if first time seen)\n if (orderInfo.orderTakerAssetFilledAmount == 0) {\n require(\n isValidSignature(\n orderInfo.orderHash,\n order.makerAddress,\n signature\n ),\n \"INVALID_ORDER_SIGNATURE\"\n );\n }\n\n // Validate fill order rounding\n require(\n !isRoundingError(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.makerAssetAmount\n ),\n \"ROUNDING_ERROR\"\n );\n }\n\n /// @dev Validates context for cancelOrder. Succeeds or throws.\n /// @param order to be cancelled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n function assertValidCancel(\n Order memory order,\n OrderInfo memory orderInfo\n )\n internal\n view\n {\n // Ensure order is valid\n // An order can only be cancelled if its status is FILLABLE.\n require(\n orderInfo.orderStatus == uint8(OrderStatus.FILLABLE),\n \"ORDER_UNFILLABLE\"\n );\n\n // Validate sender is allowed to cancel this order\n if (order.senderAddress != address(0)) {\n require(\n order.senderAddress == msg.sender,\n \"INVALID_SENDER\"\n );\n }\n\n // Validate transaction signed by maker\n address makerAddress = getCurrentContextAddress();\n require(\n order.makerAddress == makerAddress,\n \"INVALID_MAKER\"\n );\n }\n\n /// @dev Calculates amounts filled and fees paid by maker and taker.\n /// @param order to be filled.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function calculateFillResults(\n Order memory order,\n uint256 takerAssetFilledAmount\n )\n internal\n pure\n returns (FillResults memory fillResults)\n {\n // Compute proportional transfer amounts\n fillResults.takerAssetFilledAmount = takerAssetFilledAmount;\n fillResults.makerAssetFilledAmount = getPartialAmount(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.makerAssetAmount\n );\n fillResults.makerFeePaid = getPartialAmount(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.makerFee\n );\n fillResults.takerFeePaid = getPartialAmount(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.takerFee\n );\n\n return fillResults;\n }\n\n /// @dev Settles an order by transferring assets between counterparties.\n /// @param order Order struct containing order specifications.\n /// @param takerAddress Address selling takerAsset and buying makerAsset.\n /// @param fillResults Amounts to be filled and fees paid by maker and taker.\n function settleOrder(\n LibOrder.Order memory order,\n address takerAddress,\n LibFillResults.FillResults memory fillResults\n )\n private\n {\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n dispatchTransferFrom(\n order.makerAssetData,\n order.makerAddress,\n takerAddress,\n fillResults.makerAssetFilledAmount\n );\n dispatchTransferFrom(\n order.takerAssetData,\n takerAddress,\n order.makerAddress,\n fillResults.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n zrxAssetData,\n order.makerAddress,\n order.feeRecipientAddress,\n fillResults.makerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n order.feeRecipientAddress,\n fillResults.takerFeePaid\n );\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinMatchOrders.sol": "/*\n Copyright 2018 ZeroEx Intl.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n http://www.apache.org/licenses/LICENSE-2.0\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MMatchOrders.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\n\n\ncontract MixinMatchOrders is\n LibConstants,\n LibMath,\n MAssetProxyDispatcher,\n MExchangeCore,\n MMatchOrders,\n MTransactions\n{\n /// @dev Match two complementary orders that have a profitable spread.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the left order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftSignature Proof that order was created by the left maker.\n /// @param rightSignature Proof that order was created by the right maker.\n /// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.\n function matchOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n bytes memory leftSignature,\n bytes memory rightSignature\n )\n public\n returns (LibFillResults.MatchedFillResults memory matchedFillResults)\n {\n // We assume that rightOrder.takerAssetData == leftOrder.makerAssetData and rightOrder.makerAssetData == leftOrder.takerAssetData.\n // If this assumption isn't true, the match will fail at signature validation.\n rightOrder.makerAssetData = leftOrder.takerAssetData;\n rightOrder.takerAssetData = leftOrder.makerAssetData;\n\n // Get left & right order info\n LibOrder.OrderInfo memory leftOrderInfo = getOrderInfo(leftOrder);\n LibOrder.OrderInfo memory rightOrderInfo = getOrderInfo(rightOrder);\n\n // Fetch taker address\n address takerAddress = getCurrentContextAddress();\n\n // Either our context is valid or we revert\n assertValidMatch(leftOrder, rightOrder);\n\n // Compute proportional fill amounts\n matchedFillResults = calculateMatchedFillResults(\n leftOrder,\n rightOrder,\n leftOrderInfo.orderTakerAssetFilledAmount,\n rightOrderInfo.orderTakerAssetFilledAmount\n );\n\n // Validate fill contexts\n assertValidFill(\n leftOrder,\n leftOrderInfo,\n takerAddress,\n matchedFillResults.left.takerAssetFilledAmount,\n matchedFillResults.left.takerAssetFilledAmount,\n leftSignature\n );\n assertValidFill(\n rightOrder,\n rightOrderInfo,\n takerAddress,\n matchedFillResults.right.takerAssetFilledAmount,\n matchedFillResults.right.takerAssetFilledAmount,\n rightSignature\n );\n\n // Update exchange state\n updateFilledState(\n leftOrder,\n takerAddress,\n leftOrderInfo.orderHash,\n leftOrderInfo.orderTakerAssetFilledAmount,\n matchedFillResults.left\n );\n updateFilledState(\n rightOrder,\n takerAddress,\n rightOrderInfo.orderHash,\n rightOrderInfo.orderTakerAssetFilledAmount,\n matchedFillResults.right\n );\n \n // Settle matched orders. Succeeds or throws.\n settleMatchedOrders(\n leftOrder,\n rightOrder,\n takerAddress,\n matchedFillResults\n );\n\n return matchedFillResults;\n }\n\n /// @dev Validates context for matchOrders. Succeeds or throws.\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n function assertValidMatch(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder\n )\n internal\n pure\n {\n // Make sure there is a profitable spread.\n // There is a profitable spread iff the cost per unit bought (OrderA.MakerAmount/OrderA.TakerAmount) for each order is greater\n // than the profit per unit sold of the matched order (OrderB.TakerAmount/OrderB.MakerAmount).\n // This is satisfied by the equations below:\n // <leftOrder.makerAssetAmount> / <leftOrder.takerAssetAmount> >= <rightOrder.takerAssetAmount> / <rightOrder.makerAssetAmount>\n // AND\n // <rightOrder.makerAssetAmount> / <rightOrder.takerAssetAmount> >= <leftOrder.takerAssetAmount> / <leftOrder.makerAssetAmount>\n // These equations can be combined to get the following:\n require(\n safeMul(leftOrder.makerAssetAmount, rightOrder.makerAssetAmount) >=\n safeMul(leftOrder.takerAssetAmount, rightOrder.takerAssetAmount),\n \"NEGATIVE_SPREAD_REQUIRED\"\n );\n }\n\n /// @dev Calculates fill amounts for the matched orders.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the leftOrder order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftOrderTakerAssetFilledAmount Amount of left order already filled.\n /// @param rightOrderTakerAssetFilledAmount Amount of right order already filled.\n /// @param matchedFillResults Amounts to fill and fees to pay by maker and taker of matched orders.\n function calculateMatchedFillResults(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n uint256 leftOrderTakerAssetFilledAmount,\n uint256 rightOrderTakerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.MatchedFillResults memory matchedFillResults)\n {\n // We settle orders at the exchange rate of the right order.\n // The amount saved by the left maker goes to the taker.\n // Either the left or right order will be fully filled; possibly both.\n // The left order is fully filled iff the right order can sell more than left can buy.\n // That is: the amount required to fill the left order is less than or equal to\n // the amount we can spend from the right order:\n // <leftTakerAssetAmountRemaining> <= <rightTakerAssetAmountRemaining> * <rightMakerToTakerRatio>\n // <leftTakerAssetAmountRemaining> <= <rightTakerAssetAmountRemaining> * <rightOrder.makerAssetAmount> / <rightOrder.takerAssetAmount>\n // <leftTakerAssetAmountRemaining> * <rightOrder.takerAssetAmount> <= <rightTakerAssetAmountRemaining> * <rightOrder.makerAssetAmount>\n uint256 leftTakerAssetAmountRemaining = safeSub(leftOrder.takerAssetAmount, leftOrderTakerAssetFilledAmount);\n uint256 rightTakerAssetAmountRemaining = safeSub(rightOrder.takerAssetAmount, rightOrderTakerAssetFilledAmount);\n uint256 leftTakerAssetFilledAmount;\n uint256 rightTakerAssetFilledAmount;\n if (\n safeMul(leftTakerAssetAmountRemaining, rightOrder.takerAssetAmount) <=\n safeMul(rightTakerAssetAmountRemaining, rightOrder.makerAssetAmount)\n ) {\n // Left order will be fully filled: maximally fill left\n leftTakerAssetFilledAmount = leftTakerAssetAmountRemaining;\n\n // The right order receives an amount proportional to how much was spent.\n rightTakerAssetFilledAmount = getPartialAmount(\n rightOrder.takerAssetAmount,\n rightOrder.makerAssetAmount,\n leftTakerAssetFilledAmount\n );\n } else {\n // Right order will be fully filled: maximally fill right\n rightTakerAssetFilledAmount = rightTakerAssetAmountRemaining;\n\n // The left order receives an amount proportional to how much was spent.\n leftTakerAssetFilledAmount = getPartialAmount(\n rightOrder.makerAssetAmount,\n rightOrder.takerAssetAmount,\n rightTakerAssetFilledAmount\n );\n }\n\n // Calculate fill results for left order\n matchedFillResults.left = calculateFillResults(\n leftOrder,\n leftTakerAssetFilledAmount\n );\n\n // Calculate fill results for right order\n matchedFillResults.right = calculateFillResults(\n rightOrder,\n rightTakerAssetFilledAmount\n );\n\n // Calculate amount given to taker\n matchedFillResults.leftMakerAssetSpreadAmount = safeSub(\n matchedFillResults.left.makerAssetFilledAmount,\n matchedFillResults.right.takerAssetFilledAmount\n );\n\n // Return fill results\n return matchedFillResults;\n }\n\n /// @dev Settles matched order by transferring appropriate funds between order makers, taker, and fee recipient.\n /// @param leftOrder First matched order.\n /// @param rightOrder Second matched order.\n /// @param takerAddress Address that matched the orders. The taker receives the spread between orders as profit.\n /// @param matchedFillResults Struct holding amounts to transfer between makers, taker, and fee recipients.\n function settleMatchedOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n address takerAddress,\n LibFillResults.MatchedFillResults memory matchedFillResults\n )\n private\n {\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n // Order makers and taker\n dispatchTransferFrom(\n leftOrder.makerAssetData,\n leftOrder.makerAddress,\n rightOrder.makerAddress,\n matchedFillResults.right.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n rightOrder.makerAssetData,\n rightOrder.makerAddress,\n leftOrder.makerAddress,\n matchedFillResults.left.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n leftOrder.makerAssetData,\n leftOrder.makerAddress,\n takerAddress,\n matchedFillResults.leftMakerAssetSpreadAmount\n );\n\n // Maker fees\n dispatchTransferFrom(\n zrxAssetData,\n leftOrder.makerAddress,\n leftOrder.feeRecipientAddress,\n matchedFillResults.left.makerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n rightOrder.makerAddress,\n rightOrder.feeRecipientAddress,\n matchedFillResults.right.makerFeePaid\n );\n\n // Taker fees\n if (leftOrder.feeRecipientAddress == rightOrder.feeRecipientAddress) {\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n leftOrder.feeRecipientAddress,\n safeAdd(\n matchedFillResults.left.takerFeePaid,\n matchedFillResults.right.takerFeePaid\n )\n );\n } else {\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n leftOrder.feeRecipientAddress,\n matchedFillResults.left.takerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n rightOrder.feeRecipientAddress,\n matchedFillResults.right.takerFeePaid\n );\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinSignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./interfaces/IWallet.sol\";\nimport \"./interfaces/IValidator.sol\";\n\n\ncontract MixinSignatureValidator is\n MSignatureValidator,\n MTransactions\n{\n using LibBytes for bytes;\n \n // Mapping of hash => signer => signed\n mapping (bytes32 => mapping (address => bool)) public preSigned;\n\n // Mapping of signer => validator => approved\n mapping (address => mapping (address => bool)) public allowedValidators;\n\n /// @dev Approves a hash on-chain using any valid signature type.\n /// After presigning a hash, the preSign signature type will become valid for that hash and signer.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n function preSign(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external\n {\n require(\n isValidSignature(\n hash,\n signerAddress,\n signature\n ),\n \"INVALID_SIGNATURE\"\n );\n preSigned[hash][signerAddress] = true;\n }\n\n /// @dev Approves/unnapproves a Validator contract to verify signatures on signer's behalf.\n /// @param validatorAddress Address of Validator contract.\n /// @param approval Approval or disapproval of Validator contract.\n function setSignatureValidatorApproval(\n address validatorAddress,\n bool approval\n )\n external\n {\n address signerAddress = getCurrentContextAddress();\n allowedValidators[signerAddress][validatorAddress] = approval;\n emit SignatureValidatorApproval(\n signerAddress,\n validatorAddress,\n approval\n );\n }\n\n /// @dev Verifies that a hash has been signed by the given signer.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes memory signature\n )\n public\n view\n returns (bool isValid)\n {\n require(\n signature.length > 0,\n \"LENGTH_GREATER_THAN_0_REQUIRED\"\n );\n\n // Pop last byte off of signature byte array.\n uint8 signatureTypeRaw = uint8(signature.popLastByte());\n\n // Ensure signature is supported\n require(\n signatureTypeRaw < uint8(SignatureType.NSignatureTypes),\n \"SIGNATURE_UNSUPPORTED\"\n );\n\n SignatureType signatureType = SignatureType(signatureTypeRaw);\n\n // Variables are not scoped in Solidity.\n uint8 v;\n bytes32 r;\n bytes32 s;\n address recovered;\n\n // Always illegal signature.\n // This is always an implicit option since a signer can create a\n // signature array with invalid type or length. We may as well make\n // it an explicit option. This aids testing and analysis. It is\n // also the initialization value for the enum type.\n if (signatureType == SignatureType.Illegal) {\n revert(\"SIGNATURE_ILLEGAL\");\n\n // Always invalid signature.\n // Like Illegal, this is always implicitly available and therefore\n // offered explicitly. It can be implicitly created by providing\n // a correctly formatted but incorrect signature.\n } else if (signatureType == SignatureType.Invalid) {\n require(\n signature.length == 0,\n \"LENGTH_0_REQUIRED\"\n );\n isValid = false;\n return isValid;\n\n // Signature using EIP712\n } else if (signatureType == SignatureType.EIP712) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n hash,\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n\n // Signed using web3.eth_sign\n } else if (signatureType == SignatureType.EthSign) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n keccak256(abi.encodePacked(\n \"\\x19Ethereum Signed Message:\\n32\",\n hash\n )),\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n\n // Implicitly signed by caller.\n // The signer has initiated the call. In the case of non-contract\n // accounts it means the transaction itself was signed.\n // Example: let's say for a particular operation three signatures\n // A, B and C are required. To submit the transaction, A and B can\n // give a signature to C, who can then submit the transaction using\n // `Caller` for his own signature. Or A and C can sign and B can\n // submit using `Caller`. Having `Caller` allows this flexibility.\n } else if (signatureType == SignatureType.Caller) {\n require(\n signature.length == 0,\n \"LENGTH_0_REQUIRED\"\n );\n isValid = signerAddress == msg.sender;\n return isValid;\n\n // Signature verified by wallet contract.\n // If used with an order, the maker of the order is the wallet contract.\n } else if (signatureType == SignatureType.Wallet) {\n isValid = IWallet(signerAddress).isValidSignature(hash, signature);\n return isValid;\n\n // Signature verified by validator contract.\n // If used with an order, the maker of the order can still be an EOA.\n // A signature using this type should be encoded as:\n // | Offset | Length | Contents |\n // | 0x00 | x | Signature to validate |\n // | 0x00 + x | 20 | Address of validator contract |\n // | 0x14 + x | 1 | Signature type is always \"\\x06\" |\n } else if (signatureType == SignatureType.Validator) {\n // Pop last 20 bytes off of signature byte array.\n address validatorAddress = signature.popLast20Bytes();\n \n // Ensure signer has approved validator.\n if (!allowedValidators[signerAddress][validatorAddress]) {\n return false;\n }\n isValid = IValidator(validatorAddress).isValidSignature(\n hash,\n signerAddress,\n signature\n );\n return isValid;\n\n // Signer signed hash previously using the preSign function.\n } else if (signatureType == SignatureType.PreSigned) {\n isValid = preSigned[hash][signerAddress];\n return isValid;\n\n // Signature from Trezor hardware wallet.\n // It differs from web3.eth_sign in the encoding of message length\n // (Bitcoin varint encoding vs ascii-decimal, the latter is not\n // self-terminating which leads to ambiguities).\n // See also:\n // https://en.bitcoin.it/wiki/Protocol_documentation#Variable_length_integer\n // https://github.com/trezor/trezor-mcu/blob/master/firmware/ethereum.c#L602\n // https://github.com/trezor/trezor-mcu/blob/master/firmware/crypto.c#L36\n } else if (signatureType == SignatureType.Trezor) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n keccak256(abi.encodePacked(\n \"\\x19Ethereum Signed Message:\\n\\x20\",\n hash\n )),\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n }\n\n // Anything else is illegal (We do not return false because\n // the signature may actually be valid, just not in a format\n // that we currently support. In this case returning false\n // may lead the caller to incorrectly believe that the\n // signature was invalid.)\n revert(\"SIGNATURE_UNSUPPORTED\");\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinTransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\nimport \"./libs/LibExchangeErrors.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./libs/LibEIP712.sol\";\n\n\ncontract MixinTransactions is\n LibEIP712,\n MSignatureValidator,\n MTransactions\n{\n\n // Mapping of transaction hash => executed\n // This prevents transactions from being executed more than once.\n mapping (bytes32 => bool) public transactions;\n\n // Address of current transaction signer\n address public currentContextAddress;\n\n // Hash for the EIP712 ZeroEx Transaction Schema\n bytes32 constant internal EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"ZeroExTransaction(\",\n \"uint256 salt,\",\n \"address signerAddress,\",\n \"bytes data\",\n \")\"\n ));\n\n /// @dev Executes an exchange method call in the context of signer.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @param signature Proof of signer transaction by signer.\n function executeTransaction(\n uint256 salt,\n address signerAddress,\n bytes data,\n bytes signature\n )\n external\n {\n // Prevent reentrancy\n require(\n currentContextAddress == address(0),\n \"REENTRANCY_ILLEGAL\"\n );\n\n bytes32 transactionHash = hashEIP712Message(hashZeroExTransaction(\n salt,\n signerAddress,\n data\n ));\n\n // Validate transaction has not been executed\n require(\n !transactions[transactionHash],\n \"INVALID_TX_HASH\"\n );\n\n // Transaction always valid if signer is sender of transaction\n if (signerAddress != msg.sender) {\n // Validate signature\n require(\n isValidSignature(\n transactionHash,\n signerAddress,\n signature\n ),\n \"INVALID_TX_SIGNATURE\"\n );\n\n // Set the current transaction signer\n currentContextAddress = signerAddress;\n }\n\n // Execute transaction\n transactions[transactionHash] = true;\n require(\n address(this).delegatecall(data),\n \"FAILED_EXECUTION\"\n );\n\n // Reset current transaction signer if it was previously updated\n if (signerAddress != msg.sender) {\n currentContextAddress = address(0);\n }\n }\n\n /// @dev Calculates EIP712 hash of the Transaction.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @return EIP712 hash of the Transaction.\n function hashZeroExTransaction(\n uint256 salt,\n address signerAddress,\n bytes memory data\n )\n internal\n pure\n returns (bytes32 result)\n {\n bytes32 schemaHash = EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH;\n bytes32 dataHash = keccak256(data);\n\n // Assembly for more efficiently computing:\n // keccak256(abi.encodePacked(\n // EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH,\n // salt,\n // bytes32(signerAddress),\n // keccak256(data)\n // ));\n\n assembly {\n // Load free memory pointer\n let memPtr := mload(64)\n\n mstore(memPtr, schemaHash) // hash of schema\n mstore(add(memPtr, 32), salt) // salt\n mstore(add(memPtr, 64), and(signerAddress, 0xffffffffffffffffffffffffffffffffffffffff)) // signerAddress\n mstore(add(memPtr, 96), dataHash) // hash of data\n\n // Compute hash\n result := keccak256(memPtr, 128)\n }\n return result;\n }\n\n /// @dev The current function will be called in the context of this address (either 0x transaction signer or `msg.sender`).\n /// If calling a fill function, this address will represent the taker.\n /// If calling a cancel function, this address will represent the maker.\n /// @return Signer of 0x transaction if entry point is `executeTransaction`.\n /// `msg.sender` if entry point is any other function.\n function getCurrentContextAddress()\n internal\n view\n returns (address)\n {\n address contextAddress = currentContextAddress == address(0) ? msg.sender : currentContextAddress;\n return contextAddress;\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibMath.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./libs/LibAbiEncoder.sol\";\nimport \"./mixins/MExchangeCore.sol\";\n\n\ncontract MixinWrapperFunctions is\n LibMath,\n LibFillResults,\n LibAbiEncoder,\n MExchangeCore\n{\n\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n require(\n fillResults.takerAssetFilledAmount == takerAssetFillAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return fillResults;\n }\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (FillResults memory fillResults)\n {\n // ABI encode calldata for `fillOrder`\n bytes memory fillOrderCalldata = abiEncodeFillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n\n // Delegate to `fillOrder` and handle any exceptions gracefully\n assembly {\n let success := delegatecall(\n gas, // forward all gas, TODO: look into gas consumption of assert/throw\n address, // call address of this contract\n add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes)\n mload(fillOrderCalldata), // length of input\n fillOrderCalldata, // write output over input\n 128 // output size is 128 bytes\n )\n switch success\n case 0 {\n mstore(fillResults, 0)\n mstore(add(fillResults, 32), 0)\n mstore(add(fillResults, 64), 0)\n mstore(add(fillResults, 96), 0)\n }\n case 1 {\n mstore(fillResults, mload(fillOrderCalldata))\n mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32)))\n mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64)))\n mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96)))\n }\n }\n return fillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrder(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrKill.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrKillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrKillOrder(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrders(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory takerAssetData = orders[0].takerAssetData;\n \n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being sold by taker is the same for each order.\n // Rather than passing this in as calldata, we use the takerAssetData from the first order in all later orders.\n orders[i].takerAssetData = takerAssetData;\n\n // Calculate the remaining amount of takerAsset to sell\n uint256 remainingTakerAssetFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrder(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= takerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory takerAssetData = orders[0].takerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being sold by taker is the same for each order.\n // Rather than passing this in as calldata, we use the takerAssetData from the first order in all later orders.\n orders[i].takerAssetData = takerAssetData;\n\n // Calculate the remaining amount of takerAsset to sell\n uint256 remainingTakerAssetFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= takerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerAsset is bought by taker.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrders(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // Rather than passing this in as calldata, we copy the makerAssetData from the first order onto all later orders.\n orders[i].makerAssetData = makerAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmount(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrder(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n if (totalFillResults.makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // Rather than passing this in as calldata, we copy the makerAssetData from the first order onto all later orders.\n orders[i].makerAssetData = makerAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmount(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n if (totalFillResults.makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously cancels multiple orders in a single transaction.\n /// @param orders Array of order specifications.\n function batchCancelOrders(LibOrder.Order[] memory orders)\n public\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n cancelOrder(orders[i]);\n }\n }\n\n /// @dev Fetches information for all passed in orders.\n /// @param orders Array of order specifications.\n /// @return Array of OrderInfo instances that correspond to each order.\n function getOrdersInfo(LibOrder.Order[] memory orders)\n public\n view\n returns (LibOrder.OrderInfo[] memory)\n {\n uint256 ordersLength = orders.length;\n LibOrder.OrderInfo[] memory ordersInfo = new LibOrder.OrderInfo[](ordersLength);\n for (uint256 i = 0; i != ordersLength; i++) {\n ordersInfo[i] = getOrderInfo(orders[i]);\n }\n return ordersInfo;\n }\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IAssetProxyDispatcher {\n\n /// @dev Registers an asset proxy to its asset proxy id.\n /// Once an asset proxy is registered, it cannot be unregistered.\n /// @param assetProxy Address of new asset proxy to register.\n function registerAssetProxy(address assetProxy)\n external;\n\n /// @dev Gets an asset proxy.\n /// @param assetProxyId Id of the asset proxy.\n /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered.\n function getAssetProxy(bytes4 assetProxyId)\n external\n view\n returns (address);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IExchange.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./IExchangeCore.sol\";\nimport \"./IMatchOrders.sol\";\nimport \"./ISignatureValidator.sol\";\nimport \"./ITransactions.sol\";\nimport \"./IAssetProxyDispatcher.sol\";\nimport \"./IWrapperFunctions.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract IExchange is\n IExchangeCore,\n IMatchOrders,\n ISignatureValidator,\n ITransactions,\n IAssetProxyDispatcher,\n IWrapperFunctions\n{}\n",
- "2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IExchangeCore {\n\n /// @dev Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch\n /// and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress).\n /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled.\n function cancelOrdersUpTo(uint256 targetOrderEpoch)\n external;\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev After calling, the order can not be filled anymore.\n /// @param order Order struct containing order specifications.\n function cancelOrder(LibOrder.Order memory order)\n public;\n\n /// @dev Gets information about an order: status, hash, and amount filled.\n /// @param order Order to gather information on.\n /// @return OrderInfo Information about the order and its state.\n /// See LibOrder.OrderInfo for a complete description.\n function getOrderInfo(LibOrder.Order memory order)\n public\n view\n returns (LibOrder.OrderInfo memory orderInfo);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IMatchOrders {\n\n /// @dev Match two complementary orders that have a profitable spread.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the left order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftSignature Proof that order was created by the left maker.\n /// @param rightSignature Proof that order was created by the right maker.\n /// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.\n function matchOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n bytes memory leftSignature,\n bytes memory rightSignature\n )\n public\n returns (LibFillResults.MatchedFillResults memory matchedFillResults);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract ISignatureValidator {\n\n /// @dev Approves a hash on-chain using any valid signature type.\n /// After presigning a hash, the preSign signature type will become valid for that hash and signer.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n function preSign(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external;\n \n /// @dev Approves/unnapproves a Validator contract to verify signatures on signer's behalf.\n /// @param validatorAddress Address of Validator contract.\n /// @param approval Approval or disapproval of Validator contract.\n function setSignatureValidatorApproval(\n address validatorAddress,\n bool approval\n )\n external;\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signerAddress Address of signer.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes memory signature\n )\n public\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/ITransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\n\ncontract ITransactions {\n\n /// @dev Executes an exchange method call in the context of signer.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @param signature Proof of signer transaction by signer.\n function executeTransaction(\n uint256 salt,\n address signerAddress,\n bytes data,\n bytes signature\n )\n external;\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IValidator {\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IWallet.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IWallet {\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n bytes signature\n )\n external\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IWrapperFunctions {\n\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrKill.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrKillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrders(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerAsset is bought by taker.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrders(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously cancels multiple orders in a single transaction.\n /// @param orders Array of order specifications.\n function batchCancelOrders(LibOrder.Order[] memory orders)\n public;\n\n /// @dev Fetches information for all passed in orders\n /// @param orders Array of order specifications.\n /// @return Array of OrderInfo instances that correspond to each order.\n function getOrdersInfo(LibOrder.Order[] memory orders)\n public\n view\n returns (LibOrder.OrderInfo[] memory);\n}\n",
- "2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./LibOrder.sol\";\n\n\ncontract LibAbiEncoder {\n\n /// @dev ABI encodes calldata for `fillOrder`.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return ABI encoded calldata for `fillOrder`.\n function abiEncodeFillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n pure\n returns (bytes memory fillOrderCalldata)\n {\n // We need to call MExchangeCore.fillOrder using a delegatecall in\n // assembly so that we can intercept a call that throws. For this, we\n // need the input encoded in memory in the Ethereum ABIv2 format [1].\n\n // | Area | Offset | Length | Contents |\n // | -------- |--------|---------|-------------------------------------------- |\n // | Header | 0x00 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 0x00 | | 1. offset to order (*) |\n // | | 0x20 | | 2. takerAssetFillAmount |\n // | | 0x40 | | 3. offset to signature (*) |\n // | Data | | 12 * 32 | order: |\n // | | 0x000 | | 1. senderAddress |\n // | | 0x020 | | 2. makerAddress |\n // | | 0x040 | | 3. takerAddress |\n // | | 0x060 | | 4. feeRecipientAddress |\n // | | 0x080 | | 5. makerAssetAmount |\n // | | 0x0A0 | | 6. takerAssetAmount |\n // | | 0x0C0 | | 7. makerFeeAmount |\n // | | 0x0E0 | | 8. takerFeeAmount |\n // | | 0x100 | | 9. expirationTimeSeconds |\n // | | 0x120 | | 10. salt |\n // | | 0x140 | | 11. Offset to makerAssetData (*) |\n // | | 0x160 | | 12. Offset to takerAssetData (*) |\n // | | 0x180 | 32 | makerAssetData Length |\n // | | 0x1A0 | ** | makerAssetData Contents |\n // | | 0x1C0 | 32 | takerAssetData Length |\n // | | 0x1E0 | ** | takerAssetData Contents |\n // | | 0x200 | 32 | signature Length |\n // | | 0x220 | ** | signature Contents |\n\n // * Offsets are calculated from the beginning of the current area: Header, Params, Data:\n // An offset stored in the Params area is calculated from the beginning of the Params section.\n // An offset stored in the Data area is calculated from the beginning of the Data section.\n\n // ** The length of dynamic array contents are stored in the field immediately preceeding the contents.\n\n // [1]: https://solidity.readthedocs.io/en/develop/abi-spec.html\n\n assembly {\n\n // Areas below may use the following variables:\n // 1. <area>Start -- Start of this area in memory\n // 2. <area>End -- End of this area in memory. This value may\n // be precomputed (before writing contents),\n // or it may be computed as contents are written.\n // 3. <area>Offset -- Current offset into area. If an area's End\n // is precomputed, this variable tracks the\n // offsets of contents as they are written.\n\n /////// Setup Header Area ///////\n // Load free memory pointer\n fillOrderCalldata := mload(0x40)\n // bytes4(keccak256(\"fillOrder((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),uint256,bytes)\"))\n // = 0xb4be83d5\n // Leave 0x20 bytes to store the length\n mstore(add(fillOrderCalldata, 0x20), 0xb4be83d500000000000000000000000000000000000000000000000000000000)\n let headerAreaEnd := add(fillOrderCalldata, 0x24)\n\n /////// Setup Params Area ///////\n // This area is preallocated and written to later.\n // This is because we need to fill in offsets that have not yet been calculated.\n let paramsAreaStart := headerAreaEnd\n let paramsAreaEnd := add(paramsAreaStart, 0x60)\n let paramsAreaOffset := paramsAreaStart\n\n /////// Setup Data Area ///////\n let dataAreaStart := paramsAreaEnd\n let dataAreaEnd := dataAreaStart\n\n // Offset from the source data we're reading from\n let sourceOffset := order\n // arrayLenBytes and arrayLenWords track the length of a dynamically-allocated bytes array.\n let arrayLenBytes := 0\n let arrayLenWords := 0\n\n /////// Write order Struct ///////\n // Write memory location of Order, relative to the start of the\n // parameter list, then increment the paramsAreaOffset respectively.\n mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))\n paramsAreaOffset := add(paramsAreaOffset, 0x20)\n\n // Write values for each field in the order\n // It would be nice to use a loop, but we save on gas by writing\n // the stores sequentially.\n mstore(dataAreaEnd, mload(sourceOffset)) // makerAddress\n mstore(add(dataAreaEnd, 0x20), mload(add(sourceOffset, 0x20))) // takerAddress\n mstore(add(dataAreaEnd, 0x40), mload(add(sourceOffset, 0x40))) // feeRecipientAddress\n mstore(add(dataAreaEnd, 0x60), mload(add(sourceOffset, 0x60))) // senderAddress\n mstore(add(dataAreaEnd, 0x80), mload(add(sourceOffset, 0x80))) // makerAssetAmount\n mstore(add(dataAreaEnd, 0xA0), mload(add(sourceOffset, 0xA0))) // takerAssetAmount\n mstore(add(dataAreaEnd, 0xC0), mload(add(sourceOffset, 0xC0))) // makerFeeAmount\n mstore(add(dataAreaEnd, 0xE0), mload(add(sourceOffset, 0xE0))) // takerFeeAmount\n mstore(add(dataAreaEnd, 0x100), mload(add(sourceOffset, 0x100))) // expirationTimeSeconds\n mstore(add(dataAreaEnd, 0x120), mload(add(sourceOffset, 0x120))) // salt\n mstore(add(dataAreaEnd, 0x140), mload(add(sourceOffset, 0x140))) // Offset to makerAssetData\n mstore(add(dataAreaEnd, 0x160), mload(add(sourceOffset, 0x160))) // Offset to takerAssetData\n dataAreaEnd := add(dataAreaEnd, 0x180)\n sourceOffset := add(sourceOffset, 0x180)\n\n // Write offset to <order.makerAssetData>\n mstore(add(dataAreaStart, mul(10, 0x20)), sub(dataAreaEnd, dataAreaStart))\n\n // Calculate length of <order.makerAssetData>\n sourceOffset := mload(add(order, 0x140)) // makerAssetData\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of <order.makerAssetData>\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of <order.makerAssetData>\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n // Write offset to <order.takerAssetData>\n mstore(add(dataAreaStart, mul(11, 0x20)), sub(dataAreaEnd, dataAreaStart))\n\n // Calculate length of <order.takerAssetData>\n sourceOffset := mload(add(order, 0x160)) // takerAssetData\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of <order.takerAssetData>\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of <order.takerAssetData>\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n /////// Write takerAssetFillAmount ///////\n mstore(paramsAreaOffset, takerAssetFillAmount)\n paramsAreaOffset := add(paramsAreaOffset, 0x20)\n\n /////// Write signature ///////\n // Write offset to paramsArea\n mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))\n\n // Calculate length of signature\n sourceOffset := signature\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of signature\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of signature\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n // Set length of calldata\n mstore(fillOrderCalldata, sub(dataAreaEnd, add(fillOrderCalldata, 0x20)))\n\n // Increment free memory pointer\n mstore(0x40, dataAreaEnd)\n }\n\n return fillOrderCalldata;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibConstants.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\n// solhint-disable max-line-length\ncontract LibConstants {\n \n // Asset data for ZRX token. Used for fee transfers.\n // @TODO: Hardcode constant when we deploy. Currently \n // not constant to make testing easier.\n\n // The proxyId for ZRX_ASSET_DATA is bytes4(keccak256(\"ERC20Token(address)\")) = 0xf47261b0\n \n // Kovan ZRX address is 0x6ff6c0ff1d68b964901f986d4c9fa3ac68346570.\n // The ABI encoded proxyId and address is 0xf47261b00000000000000000000000006ff6c0ff1d68b964901f986d4c9fa3ac68346570\n // bytes constant public ZRX_ASSET_DATA = \"\\xf4\\x72\\x61\\xb0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x6f\\xf6\\xc0\\xff\\x1d\\x68\\xb9\\x64\\x90\\x1f\\x98\\x6d\\x4c\\x9f\\xa3\\xac\\x68\\x34\\x65\\x70\";\n \n // Mainnet ZRX address is 0xe41d2489571d322189246dafa5ebde1f4699f498.\n // The ABI encoded proxyId and address is 0xf47261b0000000000000000000000000e41d2489571d322189246dafa5ebde1f4699f498\n // bytes constant public ZRX_ASSET_DATA = \"\\xf4\\x72\\x61\\xb0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xe4\\x1d\\x24\\x89\\x57\\x1d\\x32\\x21\\x89\\x24\\x6d\\xaf\\xa5\\xeb\\xde\\x1f\\x46\\x99\\xf4\\x98\";\n \n // solhint-disable-next-line var-name-mixedcase\n bytes public ZRX_ASSET_DATA;\n\n // @TODO: Remove when we deploy.\n constructor (bytes memory zrxAssetData)\n public\n {\n ZRX_ASSET_DATA = zrxAssetData;\n }\n}\n// solhint-enable max-line-length\n",
- "2.0.0/protocol/Exchange/libs/LibEIP712.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract LibEIP712 {\n // EIP191 header for EIP712 prefix\n string constant internal EIP191_HEADER = \"\\x19\\x01\";\n\n // EIP712 Domain Name value\n string constant internal EIP712_DOMAIN_NAME = \"0x Protocol\";\n\n // EIP712 Domain Version value\n string constant internal EIP712_DOMAIN_VERSION = \"2\";\n\n // Hash of the EIP712 Domain Separator Schema\n bytes32 constant internal EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"EIP712Domain(\",\n \"string name,\",\n \"string version,\",\n \"address verifyingContract\",\n \")\"\n ));\n\n // Hash of the EIP712 Domain Separator data\n // solhint-disable-next-line var-name-mixedcase\n bytes32 public EIP712_DOMAIN_HASH;\n\n constructor ()\n public\n {\n EIP712_DOMAIN_HASH = keccak256(abi.encodePacked(\n EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH,\n keccak256(bytes(EIP712_DOMAIN_NAME)),\n keccak256(bytes(EIP712_DOMAIN_VERSION)),\n bytes32(address(this))\n ));\n }\n\n /// @dev Calculates EIP712 encoding for a hash struct in this EIP712 Domain.\n /// @param hashStruct The EIP712 hash struct.\n /// @return EIP712 hash applied to this EIP712 Domain.\n function hashEIP712Message(bytes32 hashStruct)\n internal\n view\n returns (bytes32 result)\n {\n bytes32 eip712DomainHash = EIP712_DOMAIN_HASH;\n\n // Assembly for more efficient computing:\n // keccak256(abi.encodePacked(\n // EIP191_HEADER,\n // EIP712_DOMAIN_HASH,\n // hashStruct \n // ));\n\n assembly {\n // Load free memory pointer\n let memPtr := mload(64)\n\n mstore(memPtr, 0x1901000000000000000000000000000000000000000000000000000000000000) // EIP191 header\n mstore(add(memPtr, 2), eip712DomainHash) // EIP712 domain hash\n mstore(add(memPtr, 34), hashStruct) // Hash of struct\n\n // Compute hash\n result := keccak256(memPtr, 66)\n }\n return result;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\n// solhint-disable\npragma solidity 0.4.24;\n\n\n/// @dev This contract documents the revert reasons used in the Exchange contract.\n/// This contract is intended to serve as a reference, but is not actually used for efficiency reasons.\ncontract LibExchangeErrors {\n\n /// Order validation errors ///\n string constant ORDER_UNFILLABLE = \"ORDER_UNFILLABLE\"; // Order cannot be filled.\n string constant INVALID_MAKER = \"INVALID_MAKER\"; // Invalid makerAddress.\n string constant INVALID_TAKER = \"INVALID_TAKER\"; // Invalid takerAddress.\n string constant INVALID_SENDER = \"INVALID_SENDER\"; // Invalid `msg.sender`.\n string constant INVALID_ORDER_SIGNATURE = \"INVALID_ORDER_SIGNATURE\"; // Signature validation failed. \n \n /// fillOrder validation errors ///\n string constant INVALID_TAKER_AMOUNT = \"INVALID_TAKER_AMOUNT\"; // takerAssetFillAmount cannot equal 0.\n string constant ROUNDING_ERROR = \"ROUNDING_ERROR\"; // Rounding error greater than 0.1% of takerAssetFillAmount. \n \n /// Signature validation errors ///\n string constant INVALID_SIGNATURE = \"INVALID_SIGNATURE\"; // Signature validation failed. \n string constant SIGNATURE_ILLEGAL = \"SIGNATURE_ILLEGAL\"; // Signature type is illegal.\n string constant SIGNATURE_UNSUPPORTED = \"SIGNATURE_UNSUPPORTED\"; // Signature type unsupported.\n \n /// cancelOrdersUptTo errors ///\n string constant INVALID_NEW_ORDER_EPOCH = \"INVALID_NEW_ORDER_EPOCH\"; // Specified salt must be greater than or equal to existing orderEpoch.\n\n /// fillOrKillOrder errors ///\n string constant COMPLETE_FILL_FAILED = \"COMPLETE_FILL_FAILED\"; // Desired takerAssetFillAmount could not be completely filled. \n\n /// matchOrders errors ///\n string constant NEGATIVE_SPREAD_REQUIRED = \"NEGATIVE_SPREAD_REQUIRED\"; // Matched orders must have a negative spread.\n\n /// Transaction errors ///\n string constant REENTRANCY_ILLEGAL = \"REENTRANCY_ILLEGAL\"; // Recursive reentrancy is not allowed. \n string constant INVALID_TX_HASH = \"INVALID_TX_HASH\"; // Transaction has already been executed. \n string constant INVALID_TX_SIGNATURE = \"INVALID_TX_SIGNATURE\"; // Signature validation failed. \n string constant FAILED_EXECUTION = \"FAILED_EXECUTION\"; // Transaction execution failed. \n \n /// registerAssetProxy errors ///\n string constant ASSET_PROXY_ALREADY_EXISTS = \"ASSET_PROXY_ALREADY_EXISTS\"; // AssetProxy with same id already exists.\n\n /// dispatchTransferFrom errors ///\n string constant ASSET_PROXY_DOES_NOT_EXIST = \"ASSET_PROXY_DOES_NOT_EXIST\"; // No assetProxy registered at given id.\n string constant TRANSFER_FAILED = \"TRANSFER_FAILED\"; // Asset transfer unsuccesful.\n\n /// Length validation errors ///\n string constant LENGTH_GREATER_THAN_0_REQUIRED = \"LENGTH_GREATER_THAN_0_REQUIRED\"; // Byte array must have a length greater than 0.\n string constant LENGTH_GREATER_THAN_3_REQUIRED = \"LENGTH_GREATER_THAN_3_REQUIRED\"; // Byte array must have a length greater than 3.\n string constant LENGTH_0_REQUIRED = \"LENGTH_0_REQUIRED\"; // Byte array must have a length of 0.\n string constant LENGTH_65_REQUIRED = \"LENGTH_65_REQUIRED\"; // Byte array must have a length of 65.\n}\n",
- "2.0.0/protocol/Exchange/libs/LibFillResults.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract LibFillResults is\n SafeMath\n{\n\n struct FillResults {\n uint256 makerAssetFilledAmount; // Total amount of makerAsset(s) filled.\n uint256 takerAssetFilledAmount; // Total amount of takerAsset(s) filled.\n uint256 makerFeePaid; // Total amount of ZRX paid by maker(s) to feeRecipient(s).\n uint256 takerFeePaid; // Total amount of ZRX paid by taker to feeRecipients(s).\n }\n\n struct MatchedFillResults {\n FillResults left; // Amounts filled and fees paid of left order.\n FillResults right; // Amounts filled and fees paid of right order.\n uint256 leftMakerAssetSpreadAmount; // Spread between price of left and right order, denominated in the left order's makerAsset, paid to taker.\n }\n\n /// @dev Adds properties of both FillResults instances.\n /// Modifies the first FillResults instance specified.\n /// @param totalFillResults Fill results instance that will be added onto.\n /// @param singleFillResults Fill results instance that will be added to totalFillResults.\n function addFillResults(FillResults memory totalFillResults, FillResults memory singleFillResults)\n internal\n pure\n {\n totalFillResults.makerAssetFilledAmount = safeAdd(totalFillResults.makerAssetFilledAmount, singleFillResults.makerAssetFilledAmount);\n totalFillResults.takerAssetFilledAmount = safeAdd(totalFillResults.takerAssetFilledAmount, singleFillResults.takerAssetFilledAmount);\n totalFillResults.makerFeePaid = safeAdd(totalFillResults.makerFeePaid, singleFillResults.makerFeePaid);\n totalFillResults.takerFeePaid = safeAdd(totalFillResults.takerFeePaid, singleFillResults.takerFeePaid);\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibMath.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract LibMath is\n SafeMath\n{\n\n /// @dev Calculates partial value given a numerator and denominator.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target.\n function getPartialAmount(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n partialAmount = safeDiv(\n safeMul(numerator, target),\n denominator\n );\n return partialAmount;\n }\n\n /// @dev Checks if rounding error > 0.1%.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to multiply with numerator/denominator.\n /// @return Rounding error is present.\n function isRoundingError(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (bool isError)\n {\n uint256 remainder = mulmod(target, numerator, denominator);\n if (remainder == 0) {\n return false; // No rounding error.\n }\n\n uint256 errPercentageTimes1000000 = safeDiv(\n safeMul(remainder, 1000000),\n safeMul(numerator, target)\n );\n isError = errPercentageTimes1000000 > 1000;\n return isError;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibOrder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./LibEIP712.sol\";\n\n\ncontract LibOrder is\n LibEIP712\n{\n\n // Hash for the EIP712 Order Schema\n bytes32 constant internal EIP712_ORDER_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"Order(\",\n \"address makerAddress,\",\n \"address takerAddress,\",\n \"address feeRecipientAddress,\",\n \"address senderAddress,\",\n \"uint256 makerAssetAmount,\",\n \"uint256 takerAssetAmount,\",\n \"uint256 makerFee,\",\n \"uint256 takerFee,\",\n \"uint256 expirationTimeSeconds,\",\n \"uint256 salt,\",\n \"bytes makerAssetData,\",\n \"bytes takerAssetData\",\n \")\"\n ));\n\n // A valid order remains fillable until it is expired, fully filled, or cancelled.\n // An order's state is unaffected by external factors, like account balances.\n enum OrderStatus {\n INVALID, // Default value\n INVALID_MAKER_ASSET_AMOUNT, // Order does not have a valid maker asset amount\n INVALID_TAKER_ASSET_AMOUNT, // Order does not have a valid taker asset amount\n FILLABLE, // Order is fillable\n EXPIRED, // Order has already expired\n FULLY_FILLED, // Order is fully filled\n CANCELLED // Order has been cancelled\n }\n\n // solhint-disable max-line-length\n struct Order {\n address makerAddress; // Address that created the order. \n address takerAddress; // Address that is allowed to fill the order. If set to 0, any address is allowed to fill the order. \n address feeRecipientAddress; // Address that will recieve fees when order is filled. \n address senderAddress; // Address that is allowed to call Exchange contract methods that affect this order. If set to 0, any address is allowed to call these methods.\n uint256 makerAssetAmount; // Amount of makerAsset being offered by maker. Must be greater than 0. \n uint256 takerAssetAmount; // Amount of takerAsset being bid on by maker. Must be greater than 0. \n uint256 makerFee; // Amount of ZRX paid to feeRecipient by maker when order is filled. If set to 0, no transfer of ZRX from maker to feeRecipient will be attempted.\n uint256 takerFee; // Amount of ZRX paid to feeRecipient by taker when order is filled. If set to 0, no transfer of ZRX from taker to feeRecipient will be attempted.\n uint256 expirationTimeSeconds; // Timestamp in seconds at which order expires. \n uint256 salt; // Arbitrary number to facilitate uniqueness of the order's hash. \n bytes makerAssetData; // Encoded data that can be decoded by a specified proxy contract when transferring makerAsset. The last byte references the id of this proxy.\n bytes takerAssetData; // Encoded data that can be decoded by a specified proxy contract when transferring takerAsset. The last byte references the id of this proxy.\n }\n // solhint-enable max-line-length\n\n struct OrderInfo {\n uint8 orderStatus; // Status that describes order's validity and fillability.\n bytes32 orderHash; // EIP712 hash of the order (see LibOrder.getOrderHash).\n uint256 orderTakerAssetFilledAmount; // Amount of order that has already been filled.\n }\n\n /// @dev Calculates Keccak-256 hash of the order.\n /// @param order The order structure.\n /// @return Keccak-256 EIP712 hash of the order.\n function getOrderHash(Order memory order)\n internal\n view\n returns (bytes32 orderHash)\n {\n orderHash = hashEIP712Message(hashOrder(order));\n return orderHash;\n }\n\n /// @dev Calculates EIP712 hash of the order.\n /// @param order The order structure.\n /// @return EIP712 hash of the order.\n function hashOrder(Order memory order)\n internal\n pure\n returns (bytes32 result)\n {\n bytes32 schemaHash = EIP712_ORDER_SCHEMA_HASH;\n bytes32 makerAssetDataHash = keccak256(order.makerAssetData);\n bytes32 takerAssetDataHash = keccak256(order.takerAssetData);\n\n // Assembly for more efficiently computing:\n // keccak256(abi.encodePacked(\n // EIP712_ORDER_SCHEMA_HASH,\n // bytes32(order.makerAddress),\n // bytes32(order.takerAddress),\n // bytes32(order.feeRecipientAddress),\n // bytes32(order.senderAddress),\n // order.makerAssetAmount,\n // order.takerAssetAmount,\n // order.makerFee,\n // order.takerFee,\n // order.expirationTimeSeconds,\n // order.salt,\n // keccak256(order.makerAssetData),\n // keccak256(order.takerAssetData)\n // ));\n\n assembly {\n // Calculate memory addresses that will be swapped out before hashing\n let pos1 := sub(order, 32)\n let pos2 := add(order, 320)\n let pos3 := add(order, 352)\n\n // Backup\n let temp1 := mload(pos1)\n let temp2 := mload(pos2)\n let temp3 := mload(pos3)\n \n // Hash in place\n mstore(pos1, schemaHash)\n mstore(pos2, makerAssetDataHash)\n mstore(pos3, takerAssetDataHash)\n result := keccak256(pos1, 416)\n \n // Restore\n mstore(pos1, temp1)\n mstore(pos2, temp2)\n mstore(pos3, temp3)\n }\n return result;\n }\n}\n",
- "2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAssetProxyDispatcher.sol\";\n\n\ncontract MAssetProxyDispatcher is\n IAssetProxyDispatcher\n{\n\n // Logs registration of new asset proxy\n event AssetProxyRegistered(\n bytes4 id, // Id of new registered AssetProxy.\n address assetProxy // Address of new registered AssetProxy.\n );\n\n /// @dev Forwards arguments to assetProxy and calls `transferFrom`. Either succeeds or throws.\n /// @param assetData Byte array encoded for the asset.\n /// @param from Address to transfer token from.\n /// @param to Address to transfer token to.\n /// @param amount Amount of token to transfer.\n function dispatchTransferFrom(\n bytes memory assetData,\n address from,\n address to,\n uint256 amount\n )\n internal;\n}\n",
- "2.0.0/protocol/Exchange/mixins/MExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IExchangeCore.sol\";\n\n\ncontract MExchangeCore is\n IExchangeCore\n{\n // Fill event is emitted whenever an order is filled.\n event Fill(\n address indexed makerAddress, // Address that created the order. \n address indexed feeRecipientAddress, // Address that received fees.\n address takerAddress, // Address that filled the order.\n address senderAddress, // Address that called the Exchange contract (msg.sender).\n uint256 makerAssetFilledAmount, // Amount of makerAsset sold by maker and bought by taker. \n uint256 takerAssetFilledAmount, // Amount of takerAsset sold by taker and bought by maker.\n uint256 makerFeePaid, // Amount of ZRX paid to feeRecipient by maker.\n uint256 takerFeePaid, // Amount of ZRX paid to feeRecipient by taker.\n bytes32 indexed orderHash, // EIP712 hash of order (see LibOrder.getOrderHash).\n bytes makerAssetData, // Encoded data specific to makerAsset. \n bytes takerAssetData // Encoded data specific to takerAsset.\n );\n\n // Cancel event is emitted whenever an individual order is cancelled.\n event Cancel(\n address indexed makerAddress, // Address that created the order. \n address indexed feeRecipientAddress, // Address that would have recieved fees if order was filled. \n address senderAddress, // Address that called the Exchange contract (msg.sender).\n bytes32 indexed orderHash, // EIP712 hash of order (see LibOrder.getOrderHash).\n bytes makerAssetData, // Encoded data specific to makerAsset. \n bytes takerAssetData // Encoded data specific to takerAsset.\n );\n\n // CancelUpTo event is emitted whenever `cancelOrdersUpTo` is executed succesfully.\n event CancelUpTo(\n address indexed makerAddress, // Orders cancelled must have been created by this address.\n address indexed senderAddress, // Orders cancelled must have a `senderAddress` equal to this address.\n uint256 orderEpoch // Orders with specified makerAddress and senderAddress with a salt less than this value are considered cancelled.\n );\n\n /// @dev Updates state with results of a fill order.\n /// @param order that was filled.\n /// @param takerAddress Address of taker who filled the order.\n /// @param orderTakerAssetFilledAmount Amount of order already filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function updateFilledState(\n LibOrder.Order memory order,\n address takerAddress,\n bytes32 orderHash,\n uint256 orderTakerAssetFilledAmount,\n LibFillResults.FillResults memory fillResults\n )\n internal;\n\n /// @dev Updates state with results of cancelling an order.\n /// State is only updated if the order is currently fillable.\n /// Otherwise, updating state would have no effect.\n /// @param order that was cancelled.\n /// @param orderHash Hash of order that was cancelled.\n function updateCancelledState(\n LibOrder.Order memory order,\n bytes32 orderHash\n )\n internal;\n\n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo Status, orderHash, and amount already filled of order.\n /// @param takerAddress Address of order taker.\n /// @param takerAssetFillAmount Desired amount of order to fill by taker.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @param signature Proof that the orders was created by its maker.\n function assertValidFill(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo,\n address takerAddress,\n uint256 takerAssetFillAmount,\n uint256 takerAssetFilledAmount,\n bytes memory signature\n )\n internal\n view;\n\n /// @dev Validates context for cancelOrder. Succeeds or throws.\n /// @param order to be cancelled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n function assertValidCancel(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo\n )\n internal\n view;\n\n /// @dev Calculates amounts filled and fees paid by maker and taker.\n /// @param order to be filled.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function calculateFillResults(\n LibOrder.Order memory order,\n uint256 takerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.FillResults memory fillResults);\n\n}\n",
- "2.0.0/protocol/Exchange/mixins/MMatchOrders.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IMatchOrders.sol\";\n\n\ncontract MMatchOrders is\n IMatchOrders\n{\n\n /// @dev Validates context for matchOrders. Succeeds or throws.\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n function assertValidMatch(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder\n )\n internal\n pure;\n\n /// @dev Calculates fill amounts for the matched orders.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the leftOrder order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftOrderTakerAssetFilledAmount Amount of left order already filled.\n /// @param rightOrderTakerAssetFilledAmount Amount of right order already filled.\n /// @param matchedFillResults Amounts to fill and fees to pay by maker and taker of matched orders.\n function calculateMatchedFillResults(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n uint256 leftOrderTakerAssetFilledAmount,\n uint256 rightOrderTakerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.MatchedFillResults memory matchedFillResults);\n\n}\n",
- "2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/ISignatureValidator.sol\";\n\n\ncontract MSignatureValidator is\n ISignatureValidator\n{\n event SignatureValidatorApproval(\n address indexed signerAddress, // Address that approves or disapproves a contract to verify signatures.\n address indexed validatorAddress, // Address of signature validator contract.\n bool approved // Approval or disapproval of validator contract.\n );\n\n // Allowed signature types.\n enum SignatureType {\n Illegal, // 0x00, default value\n Invalid, // 0x01\n EIP712, // 0x02\n EthSign, // 0x03\n Caller, // 0x04\n Wallet, // 0x05\n Validator, // 0x06\n PreSigned, // 0x07\n Trezor, // 0x08\n NSignatureTypes // 0x09, number of signature types. Always leave at end.\n }\n}\n",
- "2.0.0/protocol/Exchange/mixins/MTransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\nimport \"../interfaces/ITransactions.sol\";\n\n\ncontract MTransactions is\n ITransactions\n{\n\n /// @dev The current function will be called in the context of this address (either 0x transaction signer or `msg.sender`).\n /// If calling a fill function, this address will represent the taker.\n /// If calling a cancel function, this address will represent the maker.\n /// @return Signer of 0x transaction if entry point is `executeTransaction`.\n /// `msg.sender` if entry point is any other function.\n function getCurrentContextAddress()\n internal\n view\n returns (address);\n}\n",
- "2.0.0/test/DummyERC20Token/DummyERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"../../tokens/ERC20Token/MintableERC20Token.sol\";\n\n\ncontract DummyERC20Token is \n Ownable,\n MintableERC20Token\n{\n string public name;\n string public symbol;\n uint256 public decimals;\n uint256 public constant MAX_MINT_AMOUNT = 10000000000000000000000;\n\n constructor (\n string _name,\n string _symbol,\n uint256 _decimals,\n uint256 _totalSupply\n )\n public\n {\n name = _name;\n symbol = _symbol;\n decimals = _decimals;\n _totalSupply = _totalSupply;\n balances[msg.sender] = _totalSupply;\n }\n\n /// @dev Sets the balance of target address\n /// @param _target Address or which balance will be updated\n /// @param _value New balance of target address\n function setBalance(address _target, uint256 _value)\n external\n onlyOwner\n {\n uint256 currBalance = balances[_target];\n if (_value < currBalance) {\n _totalSupply = safeSub(_totalSupply, safeSub(currBalance, _value));\n } else {\n _totalSupply = safeAdd(_totalSupply, safeSub(_value, currBalance));\n }\n balances[_target] = _value;\n }\n\n /// @dev Mints new tokens for sender\n /// @param _value Amount of tokens to mint\n function mint(uint256 _value)\n external\n {\n require(\n _value <= MAX_MINT_AMOUNT,\n \"VALUE_TOO_LARGE\"\n );\n\n _mint(msg.sender, _value);\n }\n}\n",
- "2.0.0/test/DummyERC721Token/DummyERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../tokens/ERC721Token/MintableERC721Token.sol\";\nimport \"../../utils/Ownable/Ownable.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract DummyERC721Token is\n Ownable,\n MintableERC721Token\n{\n string public name;\n string public symbol;\n\n constructor (\n string _name,\n string _symbol\n )\n public\n {\n name = _name;\n symbol = _symbol;\n }\n\n /// @dev Function to mint a new token\n /// Reverts if the given token ID already exists\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _tokenId ID of the token to be minted by the msg.sender \n function mint(address _to, uint256 _tokenId)\n external\n {\n _mint(_to, _tokenId);\n }\n\n /// @dev Function to burn a token\n /// Reverts if the given token ID doesn't exist or not called by contract owner\n /// @param _owner Owner of token with given token ID\n /// @param _tokenId ID of the token to be burned by the msg.sender\n function burn(address _owner, uint256 _tokenId)\n external\n onlyOwner\n {\n _burn(_owner, _tokenId);\n }\n}\n",
- "2.0.0/tokens/ERC20Token/ERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IERC20Token.sol\";\n\n\ncontract ERC20Token is\n IERC20Token\n{\n\n mapping (address => uint256) internal balances;\n mapping (address => mapping (address => uint256)) internal allowed;\n\n uint256 internal _totalSupply;\n\n /// @dev send `value` token to `to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transfer(address _to, uint256 _value)\n external\n returns (bool)\n {\n require(\n balances[msg.sender] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[msg.sender] -= _value;\n balances[_to] += _value;\n\n emit Transfer(\n msg.sender,\n _to,\n _value\n );\n\n return true;\n }\n\n /// @dev send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool)\n {\n require(\n balances[_from] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n allowed[_from][msg.sender] >= _value,\n \"ERC20_INSUFFICIENT_ALLOWANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[_to] += _value;\n balances[_from] -= _value;\n allowed[_from][msg.sender] -= _value;\n \n emit Transfer(\n _from,\n _to,\n _value\n );\n \n return true;\n }\n\n /// @dev `msg.sender` approves `_spender` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Always true if the call has enough gas to complete execution\n function approve(address _spender, uint256 _value)\n external\n returns (bool)\n {\n allowed[msg.sender][_spender] = _value;\n emit Approval(\n msg.sender,\n _spender,\n _value\n );\n return true;\n }\n\n /// @dev Query total supply of token\n /// @return Total supply of token\n function totalSupply()\n external\n view\n returns (uint256)\n {\n return _totalSupply;\n }\n\n /// @dev Query the balance of owner\n /// @param _owner The address from which the balance will be retrieved\n /// @return Balance of owner\n function balanceOf(address _owner)\n external\n view\n returns (uint256)\n {\n return balances[_owner];\n }\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender)\n external\n view\n returns (uint256)\n {\n return allowed[_owner][_spender];\n }\n}\n",
- "2.0.0/tokens/ERC20Token/IERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC20Token {\n\n // solhint-disable no-simple-event-func-name\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 _value\n );\n\n event Approval(\n address indexed _owner,\n address indexed _spender,\n uint256 _value\n );\n\n /// @dev send `value` token to `to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transfer(address _to, uint256 _value)\n external\n returns (bool);\n\n /// @dev send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool);\n \n /// @dev `msg.sender` approves `_spender` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Always true if the call has enough gas to complete execution\n function approve(address _spender, uint256 _value)\n external\n returns (bool);\n\n /// @dev Query total supply of token\n /// @return Total supply of token\n function totalSupply()\n external\n view\n returns (uint256);\n \n /// @param _owner The address from which the balance will be retrieved\n /// @return Balance of owner\n function balanceOf(address _owner)\n external\n view\n returns (uint256);\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender)\n external\n view\n returns (uint256);\n}\n",
- "2.0.0/tokens/ERC20Token/MintableERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/SafeMath/SafeMath.sol\";\nimport \"./UnlimitedAllowanceERC20Token.sol\";\n\n\ncontract MintableERC20Token is \n SafeMath,\n UnlimitedAllowanceERC20Token\n{\n\n /// @dev Mints new tokens\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _value Amount of tokens to mint\n function _mint(address _to, uint256 _value)\n internal\n {\n balances[_to] = safeAdd(_value, balances[_to]);\n _totalSupply = safeAdd(_totalSupply, _value);\n\n emit Transfer(\n address(0),\n _to,\n _value\n );\n }\n\n /// @dev Mints new tokens\n /// @param _owner Owner of tokens that will be burned\n /// @param _value Amount of tokens to burn\n function _burn(address _owner, uint256 _value)\n internal\n {\n balances[_owner] = safeSub(balances[_owner], _value);\n _totalSupply = safeSub(_totalSupply, _value);\n\n emit Transfer(\n _owner,\n address(0),\n _value\n );\n }\n}\n",
- "2.0.0/tokens/ERC20Token/UnlimitedAllowanceERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../ERC20Token/ERC20Token.sol\";\n\n\ncontract UnlimitedAllowanceERC20Token is\n ERC20Token\n{\n\n uint256 constant internal MAX_UINT = 2**256 - 1;\n\n /// @dev ERC20 transferFrom, modified such that an allowance of MAX_UINT represents an unlimited allowance. See https://github.com/ethereum/EIPs/issues/717\n /// @param _from Address to transfer from.\n /// @param _to Address to transfer to.\n /// @param _value Amount to transfer.\n /// @return Success of transfer.\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool)\n {\n uint256 allowance = allowed[_from][msg.sender];\n require(\n balances[_from] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n allowance >= _value,\n \"ERC20_INSUFFICIENT_ALLOWANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[_to] += _value;\n balances[_from] -= _value;\n if (allowance < MAX_UINT) {\n allowed[_from][msg.sender] -= _value;\n }\n\n emit Transfer(\n _from,\n _to,\n _value\n );\n\n return true;\n }\n}\n",
- "2.0.0/tokens/ERC721Token/ERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IERC721Token.sol\";\nimport \"./IERC721Receiver.sol\";\nimport \"../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract ERC721Token is\n IERC721Token,\n SafeMath\n{\n // Function selector for ERC721Receiver.onERC721Received\n // 0x150b7a02\n bytes4 constant internal ERC721_RECEIVED = bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"));\n\n // Mapping of tokenId => owner\n mapping (uint256 => address) internal owners;\n\n // Mapping of tokenId => approved address\n mapping (uint256 => address) internal approvals;\n\n // Mapping of owner => number of tokens owned\n mapping (address => uint256) internal balances;\n\n // Mapping of owner => operator => approved\n mapping (address => mapping (address => bool)) internal operatorApprovals;\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT. When transfer is complete, this function\n /// checks if `_to` is a smart contract (code size > 0). If so, it calls\n /// `onERC721Received` on `_to` and throws if the return value is not\n /// `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n /// @param _data Additional data with no specified format, sent in call to `_to`\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId,\n bytes _data\n )\n external\n {\n transferFrom(\n _from,\n _to,\n _tokenId\n );\n\n uint256 receiverCodeSize;\n assembly {\n receiverCodeSize := extcodesize(_to)\n }\n if (receiverCodeSize > 0) {\n bytes4 selector = IERC721Receiver(_to).onERC721Received(\n msg.sender,\n _from,\n _tokenId,\n _data\n );\n require(\n selector == ERC721_RECEIVED,\n \"ERC721_INVALID_SELECTOR\"\n );\n }\n }\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev This works identically to the other function with an extra data parameter,\n /// except this function just sets data to \"\".\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n external\n {\n transferFrom(\n _from,\n _to,\n _tokenId\n );\n\n uint256 receiverCodeSize;\n assembly {\n receiverCodeSize := extcodesize(_to)\n }\n if (receiverCodeSize > 0) {\n bytes4 selector = IERC721Receiver(_to).onERC721Received(\n msg.sender,\n _from,\n _tokenId,\n \"\"\n );\n require(\n selector == ERC721_RECEIVED,\n \"ERC721_INVALID_SELECTOR\"\n );\n }\n }\n\n /// @notice Change or reaffirm the approved address for an NFT\n /// @dev The zero address indicates there is no approved address.\n /// Throws unless `msg.sender` is the current NFT owner, or an authorized\n /// operator of the current owner.\n /// @param _approved The new approved NFT controller\n /// @param _tokenId The NFT to approve\n function approve(address _approved, uint256 _tokenId)\n external\n {\n address owner = ownerOf(_tokenId);\n require(\n msg.sender == owner || isApprovedForAll(owner, msg.sender),\n \"ERC721_INVALID_SENDER\"\n );\n\n approvals[_tokenId] = _approved;\n emit Approval(\n owner,\n _approved,\n _tokenId\n );\n }\n\n /// @notice Enable or disable approval for a third party (\"operator\") to manage\n /// all of `msg.sender`'s assets\n /// @dev Emits the ApprovalForAll event. The contract MUST allow\n /// multiple operators per owner.\n /// @param _operator Address to add to the set of authorized operators\n /// @param _approved True if the operator is approved, false to revoke approval\n function setApprovalForAll(address _operator, bool _approved)\n external\n {\n operatorApprovals[msg.sender][_operator] = _approved;\n emit ApprovalForAll(\n msg.sender,\n _operator,\n _approved\n );\n }\n \n /// @notice Count all NFTs assigned to an owner\n /// @dev NFTs assigned to the zero address are considered invalid, and this\n /// function throws for queries about the zero address.\n /// @param _owner An address for whom to query the balance\n /// @return The number of NFTs owned by `_owner`, possibly zero\n function balanceOf(address _owner)\n external\n view\n returns (uint256)\n {\n require(\n _owner != address(0),\n \"ERC721_ZERO_OWNER\"\n );\n return balances[_owner];\n }\n\n /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE\n /// TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE\n /// THEY MAY BE PERMANENTLY LOST\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function transferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n public\n {\n require(\n _to != address(0),\n \"ERC721_ZERO_TO_ADDRESS\"\n );\n\n address owner = ownerOf(_tokenId);\n require(\n _from == owner,\n \"ERC721_OWNER_MISMATCH\"\n );\n\n address spender = msg.sender;\n address approvedAddress = getApproved(_tokenId);\n require(\n spender == owner ||\n isApprovedForAll(owner, spender) ||\n approvedAddress == spender,\n \"ERC721_INVALID_SPENDER\"\n );\n\n if (approvedAddress != address(0)) {\n approvals[_tokenId] = address(0);\n }\n\n owners[_tokenId] = _to;\n balances[_from] = safeSub(balances[_from], 1);\n balances[_to] = safeAdd(balances[_to], 1);\n \n emit Transfer(\n _from,\n _to,\n _tokenId\n );\n }\n\n /// @notice Find the owner of an NFT\n /// @dev NFTs assigned to zero address are considered invalid, and queries\n /// about them do throw.\n /// @param _tokenId The identifier for an NFT\n /// @return The address of the owner of the NFT\n function ownerOf(uint256 _tokenId)\n public\n view\n returns (address)\n {\n address owner = owners[_tokenId];\n require(\n owner != address(0),\n \"ERC721_ZERO_OWNER\"\n );\n return owner;\n }\n\n /// @notice Get the approved address for a single NFT\n /// @dev Throws if `_tokenId` is not a valid NFT.\n /// @param _tokenId The NFT to find the approved address for\n /// @return The approved address for this NFT, or the zero address if there is none\n function getApproved(uint256 _tokenId)\n public\n view\n returns (address)\n {\n return approvals[_tokenId];\n }\n\n /// @notice Query if an address is an authorized operator for another address\n /// @param _owner The address that owns the NFTs\n /// @param _operator The address that acts on behalf of the owner\n /// @return True if `_operator` is an approved operator for `_owner`, false otherwise\n function isApprovedForAll(address _owner, address _operator)\n public\n view\n returns (bool)\n {\n return operatorApprovals[_owner][_operator];\n }\n}\n",
- "2.0.0/tokens/ERC721Token/IERC721Receiver.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC721Receiver {\n\n /// @notice Handle the receipt of an NFT\n /// @dev The ERC721 smart contract calls this function on the recipient\n /// after a `transfer`. This function MAY throw to revert and reject the\n /// transfer. Return of other than the magic value MUST result in the\n /// transaction being reverted.\n /// Note: the contract address is always the message sender.\n /// @param _operator The address which called `safeTransferFrom` function\n /// @param _from The address which previously owned the token\n /// @param _tokenId The NFT identifier which is being transferred\n /// @param _data Additional data with no specified format\n /// @return `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`\n /// unless throwing\n function onERC721Received(\n address _operator,\n address _from,\n uint256 _tokenId,\n bytes _data\n )\n external\n returns (bytes4);\n}\n",
- "2.0.0/tokens/ERC721Token/IERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC721Token {\n\n /// @dev This emits when ownership of any NFT changes by any mechanism.\n /// This event emits when NFTs are created (`from` == 0) and destroyed\n /// (`to` == 0). Exception: during contract creation, any number of NFTs\n /// may be created and assigned without emitting Transfer. At the time of\n /// any transfer, the approved address for that NFT (if any) is reset to none.\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 indexed _tokenId\n );\n\n /// @dev This emits when the approved address for an NFT is changed or\n /// reaffirmed. The zero address indicates there is no approved address.\n /// When a Transfer event emits, this also indicates that the approved\n /// address for that NFT (if any) is reset to none.\n event Approval(\n address indexed _owner,\n address indexed _approved,\n uint256 indexed _tokenId\n );\n\n /// @dev This emits when an operator is enabled or disabled for an owner.\n /// The operator can manage all NFTs of the owner.\n event ApprovalForAll(\n address indexed _owner,\n address indexed _operator,\n bool _approved\n );\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// perator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT. When transfer is complete, this function\n /// checks if `_to` is a smart contract (code size > 0). If so, it calls\n /// `onERC721Received` on `_to` and throws if the return value is not\n /// `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n /// @param _data Additional data with no specified format, sent in call to `_to`\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId,\n bytes _data\n )\n external;\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev This works identically to the other function with an extra data parameter,\n /// except this function just sets data to \"\".\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n external;\n\n /// @notice Change or reaffirm the approved address for an NFT\n /// @dev The zero address indicates there is no approved address.\n /// Throws unless `msg.sender` is the current NFT owner, or an authorized\n /// operator of the current owner.\n /// @param _approved The new approved NFT controller\n /// @param _tokenId The NFT to approve\n function approve(address _approved, uint256 _tokenId)\n external;\n\n /// @notice Enable or disable approval for a third party (\"operator\") to manage\n /// all of `msg.sender`'s assets\n /// @dev Emits the ApprovalForAll event. The contract MUST allow\n /// multiple operators per owner.\n /// @param _operator Address to add to the set of authorized operators\n /// @param _approved True if the operator is approved, false to revoke approval\n function setApprovalForAll(address _operator, bool _approved)\n external;\n\n /// @notice Count all NFTs assigned to an owner\n /// @dev NFTs assigned to the zero address are considered invalid, and this\n /// function throws for queries about the zero address.\n /// @param _owner An address for whom to query the balance\n /// @return The number of NFTs owned by `_owner`, possibly zero\n function balanceOf(address _owner)\n external\n view\n returns (uint256);\n\n /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE\n /// TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE\n /// THEY MAY BE PERMANENTLY LOST\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function transferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n public;\n\n /// @notice Find the owner of an NFT\n /// @dev NFTs assigned to zero address are considered invalid, and queries\n /// about them do throw.\n /// @param _tokenId The identifier for an NFT\n /// @return The address of the owner of the NFT\n function ownerOf(uint256 _tokenId)\n public\n view\n returns (address);\n\n /// @notice Get the approved address for a single NFT\n /// @dev Throws if `_tokenId` is not a valid NFT.\n /// @param _tokenId The NFT to find the approved address for\n /// @return The approved address for this NFT, or the zero address if there is none\n function getApproved(uint256 _tokenId) \n public\n view\n returns (address);\n \n /// @notice Query if an address is an authorized operator for another address\n /// @param _owner The address that owns the NFTs\n /// @param _operator The address that acts on behalf of the owner\n /// @return True if `_operator` is an approved operator for `_owner`, false otherwise\n function isApprovedForAll(address _owner, address _operator)\n public\n view\n returns (bool);\n}\n",
- "2.0.0/tokens/ERC721Token/MintableERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./ERC721Token.sol\";\n\n\ncontract MintableERC721Token is\n ERC721Token\n{\n\n /// @dev Function to mint a new token\n /// Reverts if the given token ID already exists\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _tokenId ID of the token to be minted by the msg.sender \n function _mint(address _to, uint256 _tokenId)\n internal\n {\n require(\n _to != address(0),\n \"ERC721_ZERO_TO_ADDRESS\"\n );\n\n address owner = owners[_tokenId];\n require(\n owner == address(0),\n \"ERC721_OWNER_ALREADY_EXISTS\"\n );\n\n owners[_tokenId] = _to;\n balances[_to] = safeAdd(balances[_to], 1);\n\n emit Transfer(\n address(0),\n _to,\n _tokenId\n );\n }\n\n /// @dev Function to burn a token\n /// Reverts if the given token ID doesn't exist\n /// @param _owner Owner of token with given token ID\n /// @param _tokenId ID of the token to be burned by the msg.sender\n function _burn(address _owner, uint256 _tokenId)\n internal\n {\n require(\n _owner != address(0),\n \"ERC721_ZERO_OWNER_ADDRESS\"\n );\n\n address owner = owners[_tokenId];\n require(\n owner == _owner,\n \"ERC721_OWNER_MISMATCH\"\n );\n\n owners[_tokenId] = address(0);\n balances[_owner] = safeSub(balances[_owner], 1);\n\n emit Transfer(\n _owner,\n address(0),\n _tokenId\n );\n }\n}\n",
- "2.0.0/tokens/EtherToken/IEtherToken.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../ERC20Token/IERC20Token.sol\";\n\n\ncontract IEtherToken is\n IERC20Token\n{\n function deposit()\n public\n payable;\n \n function withdraw(uint256 amount)\n public;\n}\n",
- "2.0.0/utils/LibBytes/LibBytes.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\nlibrary LibBytes {\n\n using LibBytes for bytes;\n\n /// @dev Gets the memory address for a byte array.\n /// @param input Byte array to lookup.\n /// @return memoryAddress Memory address of byte array. This\n /// points to the header of the byte array which contains\n /// the length.\n function rawAddress(bytes memory input)\n internal\n pure\n returns (uint256 memoryAddress)\n {\n assembly {\n memoryAddress := input\n }\n return memoryAddress;\n }\n \n /// @dev Gets the memory address for the contents of a byte array.\n /// @param input Byte array to lookup.\n /// @return memoryAddress Memory address of the contents of the byte array.\n function contentAddress(bytes memory input)\n internal\n pure\n returns (uint256 memoryAddress)\n {\n assembly {\n memoryAddress := add(input, 32)\n }\n return memoryAddress;\n }\n\n /// @dev Copies `length` bytes from memory location `source` to `dest`.\n /// @param dest memory address to copy bytes to.\n /// @param source memory address to copy bytes from.\n /// @param length number of bytes to copy.\n function memCopy(\n uint256 dest,\n uint256 source,\n uint256 length\n )\n internal\n pure\n {\n if (length < 32) {\n // Handle a partial word by reading destination and masking\n // off the bits we are interested in.\n // This correctly handles overlap, zero lengths and source == dest\n assembly {\n let mask := sub(exp(256, sub(32, length)), 1)\n let s := and(mload(source), not(mask))\n let d := and(mload(dest), mask)\n mstore(dest, or(s, d))\n }\n } else {\n // Skip the O(length) loop when source == dest.\n if (source == dest) {\n return;\n }\n\n // For large copies we copy whole words at a time. The final\n // word is aligned to the end of the range (instead of after the\n // previous) to handle partial words. So a copy will look like this:\n //\n // ####\n // ####\n // ####\n // ####\n //\n // We handle overlap in the source and destination range by\n // changing the copying direction. This prevents us from\n // overwriting parts of source that we still need to copy.\n //\n // This correctly handles source == dest\n //\n if (source > dest) {\n assembly {\n // We subtract 32 from `sEnd` and `dEnd` because it\n // is easier to compare with in the loop, and these\n // are also the addresses we need for copying the\n // last bytes.\n length := sub(length, 32)\n let sEnd := add(source, length)\n let dEnd := add(dest, length)\n\n // Remember the last 32 bytes of source\n // This needs to be done here and not after the loop\n // because we may have overwritten the last bytes in\n // source already due to overlap.\n let last := mload(sEnd)\n\n // Copy whole words front to back\n // Note: the first check is always true,\n // this could have been a do-while loop.\n // solhint-disable-next-line no-empty-blocks\n for {} lt(source, sEnd) {} {\n mstore(dest, mload(source))\n source := add(source, 32)\n dest := add(dest, 32)\n }\n \n // Write the last 32 bytes\n mstore(dEnd, last)\n }\n } else {\n assembly {\n // We subtract 32 from `sEnd` and `dEnd` because those\n // are the starting points when copying a word at the end.\n length := sub(length, 32)\n let sEnd := add(source, length)\n let dEnd := add(dest, length)\n\n // Remember the first 32 bytes of source\n // This needs to be done here and not after the loop\n // because we may have overwritten the first bytes in\n // source already due to overlap.\n let first := mload(source)\n\n // Copy whole words back to front\n // We use a signed comparisson here to allow dEnd to become\n // negative (happens when source and dest < 32). Valid\n // addresses in local memory will never be larger than\n // 2**255, so they can be safely re-interpreted as signed.\n // Note: the first check is always true,\n // this could have been a do-while loop.\n // solhint-disable-next-line no-empty-blocks\n for {} slt(dest, dEnd) {} {\n mstore(dEnd, mload(sEnd))\n sEnd := sub(sEnd, 32)\n dEnd := sub(dEnd, 32)\n }\n \n // Write the first 32 bytes\n mstore(dest, first)\n }\n }\n }\n }\n\n /// @dev Returns a slices from a byte array.\n /// @param b The byte array to take a slice from.\n /// @param from The starting index for the slice (inclusive).\n /// @param to The final index for the slice (exclusive).\n /// @return result The slice containing bytes at indices [from, to)\n function slice(\n bytes memory b,\n uint256 from,\n uint256 to\n )\n internal\n pure\n returns (bytes memory result)\n {\n require(\n from <= to,\n \"FROM_LESS_THAN_TO_REQUIRED\"\n );\n require(\n to < b.length,\n \"TO_LESS_THAN_LENGTH_REQUIRED\"\n );\n \n // Create a new bytes structure and copy contents\n result = new bytes(to - from);\n memCopy(\n result.contentAddress(),\n b.contentAddress() + from,\n result.length);\n return result;\n }\n \n /// @dev Returns a slice from a byte array without preserving the input.\n /// @param b The byte array to take a slice from. Will be destroyed in the process.\n /// @param from The starting index for the slice (inclusive).\n /// @param to The final index for the slice (exclusive).\n /// @return result The slice containing bytes at indices [from, to)\n /// @dev When `from == 0`, the original array will match the slice. In other cases its state will be corrupted.\n function sliceDestructive(\n bytes memory b,\n uint256 from,\n uint256 to\n )\n internal\n pure\n returns (bytes memory result)\n {\n require(\n from <= to,\n \"FROM_LESS_THAN_TO_REQUIRED\"\n );\n require(\n to < b.length,\n \"TO_LESS_THAN_LENGTH_REQUIRED\"\n );\n \n // Create a new bytes structure around [from, to) in-place.\n assembly {\n result := add(b, from)\n mstore(result, sub(to, from))\n }\n return result;\n }\n\n /// @dev Pops the last byte off of a byte array by modifying its length.\n /// @param b Byte array that will be modified.\n /// @return The byte that was popped off.\n function popLastByte(bytes memory b)\n internal\n pure\n returns (bytes1 result)\n {\n require(\n b.length > 0,\n \"GREATER_THAN_ZERO_LENGTH_REQUIRED\"\n );\n\n // Store last byte.\n result = b[b.length - 1];\n\n assembly {\n // Decrement length of byte array.\n let newLen := sub(mload(b), 1)\n mstore(b, newLen)\n }\n return result;\n }\n\n /// @dev Pops the last 20 bytes off of a byte array by modifying its length.\n /// @param b Byte array that will be modified.\n /// @return The 20 byte address that was popped off.\n function popLast20Bytes(bytes memory b)\n internal\n pure\n returns (address result)\n {\n require(\n b.length >= 20,\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Store last 20 bytes.\n result = readAddress(b, b.length - 20);\n\n assembly {\n // Subtract 20 from byte array length.\n let newLen := sub(mload(b), 20)\n mstore(b, newLen)\n }\n return result;\n }\n\n /// @dev Tests equality of two byte arrays.\n /// @param lhs First byte array to compare.\n /// @param rhs Second byte array to compare.\n /// @return True if arrays are the same. False otherwise.\n function equals(\n bytes memory lhs,\n bytes memory rhs\n )\n internal\n pure\n returns (bool equal)\n {\n // Keccak gas cost is 30 + numWords * 6. This is a cheap way to compare.\n // We early exit on unequal lengths, but keccak would also correctly\n // handle this.\n return lhs.length == rhs.length && keccak256(lhs) == keccak256(rhs);\n }\n\n /// @dev Reads an address from a position in a byte array.\n /// @param b Byte array containing an address.\n /// @param index Index in byte array of address.\n /// @return address from byte array.\n function readAddress(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (address result)\n {\n require(\n b.length >= index + 20, // 20 is length of address\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Add offset to index:\n // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)\n // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)\n index += 20;\n\n // Read address from array memory\n assembly {\n // 1. Add index to address of bytes array\n // 2. Load 32-byte word from memory\n // 3. Apply 20-byte mask to obtain address\n result := and(mload(add(b, index)), 0xffffffffffffffffffffffffffffffffffffffff)\n }\n return result;\n }\n\n /// @dev Writes an address into a specific position in a byte array.\n /// @param b Byte array to insert address into.\n /// @param index Index in byte array of address.\n /// @param input Address to put into byte array.\n function writeAddress(\n bytes memory b,\n uint256 index,\n address input\n )\n internal\n pure\n {\n require(\n b.length >= index + 20, // 20 is length of address\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Add offset to index:\n // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)\n // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)\n index += 20;\n\n // Store address into array memory\n assembly {\n // The address occupies 20 bytes and mstore stores 32 bytes.\n // First fetch the 32-byte word where we'll be storing the address, then\n // apply a mask so we have only the bytes in the word that the address will not occupy.\n // Then combine these bytes with the address and store the 32 bytes back to memory with mstore.\n\n // 1. Add index to address of bytes array\n // 2. Load 32-byte word from memory\n // 3. Apply 12-byte mask to obtain extra bytes occupying word of memory where we'll store the address\n let neighbors := and(\n mload(add(b, index)),\n 0xffffffffffffffffffffffff0000000000000000000000000000000000000000\n )\n \n // Make sure input address is clean.\n // (Solidity does not guarantee this)\n input := and(input, 0xffffffffffffffffffffffffffffffffffffffff)\n\n // Store the neighbors and address into memory\n mstore(add(b, index), xor(input, neighbors))\n }\n }\n\n /// @dev Reads a bytes32 value from a position in a byte array.\n /// @param b Byte array containing a bytes32 value.\n /// @param index Index in byte array of bytes32 value.\n /// @return bytes32 value from byte array.\n function readBytes32(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes32 result)\n {\n require(\n b.length >= index + 32,\n \"GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 256 bit length parameter\n index += 32;\n\n // Read the bytes32 from array memory\n assembly {\n result := mload(add(b, index))\n }\n return result;\n }\n\n /// @dev Writes a bytes32 into a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input bytes32 to put into byte array.\n function writeBytes32(\n bytes memory b,\n uint256 index,\n bytes32 input\n )\n internal\n pure\n {\n require(\n b.length >= index + 32,\n \"GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 256 bit length parameter\n index += 32;\n\n // Read the bytes32 from array memory\n assembly {\n mstore(add(b, index), input)\n }\n }\n\n /// @dev Reads a uint256 value from a position in a byte array.\n /// @param b Byte array containing a uint256 value.\n /// @param index Index in byte array of uint256 value.\n /// @return uint256 value from byte array.\n function readUint256(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (uint256 result)\n {\n return uint256(readBytes32(b, index));\n }\n\n /// @dev Writes a uint256 into a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input uint256 to put into byte array.\n function writeUint256(\n bytes memory b,\n uint256 index,\n uint256 input\n )\n internal\n pure\n {\n writeBytes32(b, index, bytes32(input));\n }\n\n /// @dev Reads an unpadded bytes4 value from a position in a byte array.\n /// @param b Byte array containing a bytes4 value.\n /// @param index Index in byte array of bytes4 value.\n /// @return bytes4 value from byte array.\n function readBytes4(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes4 result)\n {\n require(\n b.length >= index + 4,\n \"GREATER_OR_EQUAL_TO_4_LENGTH_REQUIRED\"\n );\n assembly {\n result := mload(add(b, 32))\n // Solidity does not require us to clean the trailing bytes.\n // We do it anyway\n result := and(result, 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000)\n }\n return result;\n }\n\n /// @dev Reads nested bytes from a specific position.\n /// @dev NOTE: the returned value overlaps with the input value.\n /// Both should be treated as immutable.\n /// @param b Byte array containing nested bytes.\n /// @param index Index of nested bytes.\n /// @return result Nested bytes.\n function readBytesWithLength(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes memory result)\n {\n // Read length of nested bytes\n uint256 nestedBytesLength = readUint256(b, index);\n index += 32;\n\n // Assert length of <b> is valid, given\n // length of nested bytes\n require(\n b.length >= index + nestedBytesLength,\n \"GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED\"\n );\n \n // Return a pointer to the byte array as it exists inside `b`\n assembly {\n result := add(b, index)\n }\n return result;\n }\n\n /// @dev Inserts bytes at a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input bytes to insert.\n function writeBytesWithLength(\n bytes memory b,\n uint256 index,\n bytes memory input\n )\n internal\n pure\n {\n // Assert length of <b> is valid, given\n // length of input\n require(\n b.length >= index + 32 + input.length, // 32 bytes to store length\n \"GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED\"\n );\n\n // Copy <input> into <b>\n memCopy(\n b.contentAddress() + index,\n input.rawAddress(), // includes length of <input>\n input.length + 32 // +32 bytes to store <input> length\n );\n }\n\n /// @dev Performs a deep copy of a byte array onto another byte array of greater than or equal length.\n /// @param dest Byte array that will be overwritten with source bytes.\n /// @param source Byte array to copy onto dest bytes.\n function deepCopyBytes(\n bytes memory dest,\n bytes memory source\n )\n internal\n pure\n {\n uint256 sourceLen = source.length;\n // Dest length must be >= source length, or some bytes would not be copied.\n require(\n dest.length >= sourceLen,\n \"GREATER_OR_EQUAL_TO_SOURCE_BYTES_LENGTH_REQUIRED\"\n );\n memCopy(\n dest.contentAddress(),\n source.contentAddress(),\n sourceLen\n );\n }\n}\n",
- "2.0.0/utils/Ownable/IOwnable.sol": "pragma solidity 0.4.24;\n\n/*\n * Ownable\n *\n * Base contract with an owner.\n * Provides onlyOwner modifier, which prevents function from running if it is called by anyone other than the owner.\n */\n\ncontract IOwnable {\n function transferOwnership(address newOwner)\n public;\n}\n",
- "2.0.0/utils/Ownable/Ownable.sol": "pragma solidity 0.4.24;\n\n/*\n * Ownable\n *\n * Base contract with an owner.\n * Provides onlyOwner modifier, which prevents function from running if it is called by anyone other than the owner.\n */\n\nimport \"./IOwnable.sol\";\n\n\ncontract Ownable is IOwnable {\n address public owner;\n\n constructor ()\n public\n {\n owner = msg.sender;\n }\n\n modifier onlyOwner() {\n require(\n msg.sender == owner,\n \"ONLY_CONTRACT_OWNER\"\n );\n _;\n }\n\n function transferOwnership(address newOwner)\n public\n onlyOwner\n {\n if (newOwner != address(0)) {\n owner = newOwner;\n }\n }\n}\n",
- "2.0.0/utils/SafeMath/SafeMath.sol": "pragma solidity 0.4.24;\n\n\ncontract SafeMath {\n function safeMul(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n if (a == 0) {\n return 0;\n }\n uint256 c = a * b;\n require(\n c / a == b,\n \"UINT256_OVERFLOW\"\n );\n return c;\n }\n\n function safeDiv(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n uint256 c = a / b;\n return c;\n }\n\n function safeSub(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n require(\n b <= a,\n \"UINT256_UNDERFLOW\"\n );\n return a - b;\n }\n\n function safeAdd(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n uint256 c = a + b;\n require(\n c >= a,\n \"UINT256_OVERFLOW\"\n );\n return c;\n }\n\n function max64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n\n function max256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n}\n"
- },
- "sourceTreeHashHex": "0x560b257f8a4e1420a4586d5ba0c40e74042ef5af0f53aad412951444ea710a7e",
- "compiler": {
- "name": "solc",
- "version": "soljson-v0.4.24+commit.e67f0147.js",
- "settings": {
- "optimizer": {
- "enabled": true,
- "runs": 1000000
- },
- "outputSelection": {
- "*": {
- "*": [
- "abi",
- "evm.bytecode.object",
- "evm.bytecode.sourceMap",
- "evm.deployedBytecode.object",
- "evm.deployedBytecode.sourceMap"
- ]
- }
- }
- }
- },
- "networks": {}
-} \ No newline at end of file
diff --git a/packages/migrations/artifacts/2.0.0-testnet/IWallet.json b/packages/migrations/artifacts/2.0.0-testnet/IWallet.json
deleted file mode 100644
index df892d360..000000000
--- a/packages/migrations/artifacts/2.0.0-testnet/IWallet.json
+++ /dev/null
@@ -1,316 +0,0 @@
-{
- "schemaVersion": "2.0.0",
- "contractName": "IWallet",
- "compilerOutput": {
- "abi": [
- {
- "constant": true,
- "inputs": [
- {
- "name": "hash",
- "type": "bytes32"
- },
- {
- "name": "signature",
- "type": "bytes"
- }
- ],
- "name": "isValidSignature",
- "outputs": [
- {
- "name": "isValid",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- }
- ],
- "evm": {
- "bytecode": {
- "linkReferences": {},
- "object": "0x",
- "opcodes": "",
- "sourceMap": ""
- },
- "deployedBytecode": {
- "linkReferences": {},
- "object": "0x",
- "opcodes": "",
- "sourceMap": ""
- }
- }
- },
- "sources": {
- "2.0.0/extensions/Forwarder/Forwarder.sol": {
- "id": 0
- },
- "2.0.0/extensions/Forwarder/MixinAssets.sol": {
- "id": 1
- },
- "2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol": {
- "id": 2
- },
- "2.0.0/extensions/Forwarder/MixinForwarderCore.sol": {
- "id": 3
- },
- "2.0.0/extensions/Forwarder/MixinWeth.sol": {
- "id": 4
- },
- "2.0.0/extensions/Forwarder/interfaces/IAssets.sol": {
- "id": 5
- },
- "2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol": {
- "id": 6
- },
- "2.0.0/extensions/Forwarder/libs/LibConstants.sol": {
- "id": 7
- },
- "2.0.0/extensions/Forwarder/mixins/MAssets.sol": {
- "id": 8
- },
- "2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol": {
- "id": 9
- },
- "2.0.0/extensions/Forwarder/mixins/MWeth.sol": {
- "id": 10
- },
- "2.0.0/extensions/OrderValidator/OrderValidator.sol": {
- "id": 11
- },
- "2.0.0/protocol/AssetProxy/ERC20Proxy.sol": {
- "id": 12
- },
- "2.0.0/protocol/AssetProxy/ERC721Proxy.sol": {
- "id": 13
- },
- "2.0.0/protocol/AssetProxy/MixinAuthorizable.sol": {
- "id": 14
- },
- "2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol": {
- "id": 15
- },
- "2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol": {
- "id": 16
- },
- "2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol": {
- "id": 17
- },
- "2.0.0/protocol/Exchange/Exchange.sol": {
- "id": 18
- },
- "2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol": {
- "id": 19
- },
- "2.0.0/protocol/Exchange/MixinExchangeCore.sol": {
- "id": 20
- },
- "2.0.0/protocol/Exchange/MixinMatchOrders.sol": {
- "id": 21
- },
- "2.0.0/protocol/Exchange/MixinSignatureValidator.sol": {
- "id": 22
- },
- "2.0.0/protocol/Exchange/MixinTransactions.sol": {
- "id": 23
- },
- "2.0.0/protocol/Exchange/MixinWrapperFunctions.sol": {
- "id": 24
- },
- "2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol": {
- "id": 25
- },
- "2.0.0/protocol/Exchange/interfaces/IExchange.sol": {
- "id": 26
- },
- "2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol": {
- "id": 27
- },
- "2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol": {
- "id": 28
- },
- "2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol": {
- "id": 29
- },
- "2.0.0/protocol/Exchange/interfaces/ITransactions.sol": {
- "id": 30
- },
- "2.0.0/protocol/Exchange/interfaces/IValidator.sol": {
- "id": 31
- },
- "2.0.0/protocol/Exchange/interfaces/IWallet.sol": {
- "id": 32
- },
- "2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol": {
- "id": 33
- },
- "2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol": {
- "id": 34
- },
- "2.0.0/protocol/Exchange/libs/LibConstants.sol": {
- "id": 35
- },
- "2.0.0/protocol/Exchange/libs/LibEIP712.sol": {
- "id": 36
- },
- "2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol": {
- "id": 37
- },
- "2.0.0/protocol/Exchange/libs/LibFillResults.sol": {
- "id": 38
- },
- "2.0.0/protocol/Exchange/libs/LibMath.sol": {
- "id": 39
- },
- "2.0.0/protocol/Exchange/libs/LibOrder.sol": {
- "id": 40
- },
- "2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol": {
- "id": 41
- },
- "2.0.0/protocol/Exchange/mixins/MExchangeCore.sol": {
- "id": 42
- },
- "2.0.0/protocol/Exchange/mixins/MMatchOrders.sol": {
- "id": 43
- },
- "2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol": {
- "id": 44
- },
- "2.0.0/protocol/Exchange/mixins/MTransactions.sol": {
- "id": 45
- },
- "2.0.0/test/DummyERC20Token/DummyERC20Token.sol": {
- "id": 46
- },
- "2.0.0/test/DummyERC721Token/DummyERC721Token.sol": {
- "id": 47
- },
- "2.0.0/tokens/ERC20Token/ERC20Token.sol": {
- "id": 48
- },
- "2.0.0/tokens/ERC20Token/IERC20Token.sol": {
- "id": 49
- },
- "2.0.0/tokens/ERC20Token/MintableERC20Token.sol": {
- "id": 50
- },
- "2.0.0/tokens/ERC20Token/UnlimitedAllowanceERC20Token.sol": {
- "id": 51
- },
- "2.0.0/tokens/ERC721Token/ERC721Token.sol": {
- "id": 52
- },
- "2.0.0/tokens/ERC721Token/IERC721Receiver.sol": {
- "id": 53
- },
- "2.0.0/tokens/ERC721Token/IERC721Token.sol": {
- "id": 54
- },
- "2.0.0/tokens/ERC721Token/MintableERC721Token.sol": {
- "id": 55
- },
- "2.0.0/tokens/EtherToken/IEtherToken.sol": {
- "id": 56
- },
- "2.0.0/utils/LibBytes/LibBytes.sol": {
- "id": 57
- },
- "2.0.0/utils/Ownable/IOwnable.sol": {
- "id": 58
- },
- "2.0.0/utils/Ownable/Ownable.sol": {
- "id": 59
- },
- "2.0.0/utils/SafeMath/SafeMath.sol": {
- "id": 60
- }
- },
- "sourceCodes": {
- "2.0.0/extensions/Forwarder/Forwarder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./MixinWeth.sol\";\nimport \"./MixinForwarderCore.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./MixinAssets.sol\";\nimport \"./MixinExchangeWrapper.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract Forwarder is\n LibConstants,\n MixinWeth,\n MixinAssets,\n MixinExchangeWrapper,\n MixinForwarderCore\n{\n\n constructor (\n address _exchange,\n bytes memory _zrxAssetData,\n bytes memory _wethAssetData\n )\n public\n LibConstants(\n _exchange,\n _zrxAssetData,\n _wethAssetData\n )\n MixinForwarderCore()\n {}\n}\n",
- "2.0.0/extensions/Forwarder/MixinAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"../../tokens/ERC20Token/IERC20Token.sol\";\nimport \"../../tokens/ERC721Token/IERC721Token.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MAssets.sol\";\n\n\ncontract MixinAssets is\n Ownable,\n LibConstants,\n MAssets\n{\n\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_TRANSFER_SELECTOR = bytes4(keccak256(\"transfer(address,uint256)\"));\n\n /// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to \n /// function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be\n /// used to withdraw assets that were accidentally sent to this contract.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of ERC20 token to withdraw.\n function withdrawAsset(\n bytes assetData,\n uint256 amount\n )\n external\n onlyOwner\n {\n transferAssetToSender(assetData, amount);\n }\n\n /// @dev Transfers given amount of asset to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferAssetToSender(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n bytes4 proxyId = assetData.readBytes4(0);\n\n if (proxyId == ERC20_DATA_ID) {\n transferERC20Token(assetData, amount);\n } else if (proxyId == ERC721_DATA_ID) {\n transferERC721Token(assetData, amount);\n } else {\n revert(\"UNSUPPORTED_ASSET_PROXY\");\n }\n }\n\n /// @dev Decodes ERC20 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC20Token(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n address token = assetData.readAddress(16);\n\n // Transfer tokens.\n // We do a raw call so we can check the success separate\n // from the return data.\n bool success = token.call(abi.encodeWithSelector(\n ERC20_TRANSFER_SELECTOR,\n msg.sender,\n amount\n ));\n require(\n success,\n \"TRANSFER_FAILED\"\n );\n \n // Check return data.\n // If there is no return data, we assume the token incorrectly\n // does not return a bool. In this case we expect it to revert\n // on failure, which was handled above.\n // If the token does return data, we require that it is a single\n // value that evaluates to true.\n assembly {\n if returndatasize {\n success := 0\n if eq(returndatasize, 32) {\n // First 64 bytes of memory are reserved scratch space\n returndatacopy(0, 0, 32)\n success := mload(0)\n }\n }\n }\n require(\n success,\n \"TRANSFER_FAILED\"\n );\n }\n\n /// @dev Decodes ERC721 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC721Token(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n require(\n amount == 1,\n \"INVALID_AMOUNT\"\n );\n // Decode asset data.\n address token = assetData.readAddress(16);\n uint256 tokenId = assetData.readUint256(36);\n\n // Perform transfer.\n IERC721Token(token).transferFrom(\n address(this),\n msg.sender,\n tokenId\n );\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MExchangeWrapper.sol\";\nimport \"../../protocol/Exchange/libs/LibAbiEncoder.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../protocol/Exchange/libs/LibFillResults.sol\";\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\n\n\ncontract MixinExchangeWrapper is\n LibAbiEncoder,\n LibFillResults,\n LibMath,\n LibConstants,\n MExchangeWrapper\n{\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n // ABI encode calldata for `fillOrder`\n bytes memory fillOrderCalldata = abiEncodeFillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n\n address exchange = address(EXCHANGE);\n\n // Call `fillOrder` and handle any exceptions gracefully\n assembly {\n let success := call(\n gas, // forward all gas, TODO: look into gas consumption of assert/throw\n exchange, // call address of Exchange contract\n 0, // transfer 0 wei\n add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes)\n mload(fillOrderCalldata), // length of input\n fillOrderCalldata, // write output over input\n 128 // output size is 128 bytes\n )\n switch success\n case 0 {\n mstore(fillResults, 0)\n mstore(add(fillResults, 32), 0)\n mstore(add(fillResults, 64), 0)\n mstore(add(fillResults, 96), 0)\n }\n case 1 {\n mstore(fillResults, mload(fillOrderCalldata))\n mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32)))\n mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64)))\n mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96)))\n }\n }\n return fillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of WETH has been sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param wethSellAmount Desired amount of WETH to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellWeth(\n LibOrder.Order[] memory orders,\n uint256 wethSellAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // We assume that asset being sold by taker is WETH for each order.\n orders[i].makerAssetData = makerAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of WETH to sell\n uint256 remainingTakerAssetFillAmount = safeSub(wethSellAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of WETH\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= wethSellAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// The asset being sold by taker must always be WETH.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyExactAmountWithWeth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // We assume that asset being sold by taker is WETH for each order.\n orders[i].makerAssetData = makerAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmount(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n uint256 makerAssetFilledAmount = totalFillResults.makerAssetFilledAmount;\n if (makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n\n require(\n makerAssetFilledAmount >= makerAssetFillAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return totalFillResults;\n }\n\n /// @dev Buys zrxBuyAmount of ZRX fee tokens, taking into account ZRX fees for each order. This will guarantee\n /// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues).\n /// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX\n /// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases.\n /// The asset being sold by taker must always be WETH. \n /// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset.\n /// @param zrxBuyAmount Desired amount of ZRX to buy.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return totalFillResults Amounts filled and fees paid by maker and taker.\n function marketBuyExactZrxWithWeth(\n LibOrder.Order[] memory orders,\n uint256 zrxBuyAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n // Do nothing if zrxBuyAmount == 0\n if (zrxBuyAmount == 0) {\n return totalFillResults;\n }\n\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n uint256 zrxPurchased = 0;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // All of these are ZRX/WETH, so we can drop the respective assetData from calldata.\n orders[i].makerAssetData = zrxAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of ZRX to buy.\n uint256 remainingZrxBuyAmount = safeSub(zrxBuyAmount, zrxPurchased);\n\n // Convert the remaining amount of ZRX to buy into remaining amount\n // of WETH to sell, assuming entire amount can be sold in the current order.\n uint256 remainingWethSellAmount = getPartialAmount(\n orders[i].takerAssetAmount,\n safeSub(orders[i].makerAssetAmount, orders[i].takerFee), // our exchange rate after fees \n remainingZrxBuyAmount\n );\n\n // Attempt to sell the remaining amount of WETH.\n FillResults memory singleFillResult = fillOrderNoThrow(\n orders[i],\n safeAdd(remainingWethSellAmount, 1), // we add 1 wei to the fill amount to make up for rounding errors\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker.\n addFillResults(totalFillResults, singleFillResult);\n zrxPurchased = safeSub(totalFillResults.makerAssetFilledAmount, totalFillResults.takerFeePaid);\n\n // Stop execution if the entire amount of ZRX has been bought.\n if (zrxPurchased >= zrxBuyAmount) {\n break;\n }\n }\n\n require(\n zrxPurchased >= zrxBuyAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return totalFillResults;\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinForwarderCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MWeth.sol\";\nimport \"./mixins/MAssets.sol\";\nimport \"./mixins/MExchangeWrapper.sol\";\nimport \"./interfaces/IForwarderCore.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../protocol/Exchange/libs/LibFillResults.sol\";\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\n\n\ncontract MixinForwarderCore is\n LibFillResults,\n LibMath,\n LibConstants,\n MWeth,\n MAssets,\n MExchangeWrapper,\n IForwarderCore\n{\n\n using LibBytes for bytes;\n\n /// @dev Constructor approves ERC20 proxy to transfer ZRX and WETH on this contract's behalf.\n constructor ()\n public\n {\n address proxyAddress = EXCHANGE.getAssetProxy(ERC20_DATA_ID);\n if (proxyAddress != address(0)) {\n ETHER_TOKEN.approve(proxyAddress, MAX_UINT);\n ZRX_TOKEN.approve(proxyAddress, MAX_UINT);\n }\n }\n\n /// @dev Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketSellOrdersWithEth(\n LibOrder.Order[] memory orders,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n FillResults memory orderFillResults,\n FillResults memory feeOrderFillResults\n )\n {\n // Convert ETH to WETH.\n convertEthToWeth();\n\n uint256 wethSellAmount;\n uint256 zrxBuyAmount;\n uint256 makerAssetAmountPurchased;\n if (orders[0].makerAssetData.equals(ZRX_ASSET_DATA)) {\n // Calculate amount of WETH that won't be spent on ETH fees.\n wethSellAmount = getPartialAmount(\n PERCENTAGE_DENOMINATOR,\n safeAdd(PERCENTAGE_DENOMINATOR, feePercentage),\n msg.value\n );\n // Market sell available WETH.\n // ZRX fees are paid with this contract's balance.\n orderFillResults = marketSellWeth(\n orders,\n wethSellAmount,\n signatures\n );\n // The fee amount must be deducted from the amount transfered back to sender.\n makerAssetAmountPurchased = safeSub(orderFillResults.makerAssetFilledAmount, orderFillResults.takerFeePaid);\n } else {\n // 5% of WETH is reserved for filling feeOrders and paying feeRecipient.\n wethSellAmount = getPartialAmount(\n MAX_WETH_FILL_PERCENTAGE,\n PERCENTAGE_DENOMINATOR,\n msg.value\n );\n // Market sell 95% of WETH.\n // ZRX fees are payed with this contract's balance.\n orderFillResults = marketSellWeth(\n orders,\n wethSellAmount,\n signatures\n );\n // Buy back all ZRX spent on fees.\n zrxBuyAmount = orderFillResults.takerFeePaid;\n feeOrderFillResults = marketBuyExactZrxWithWeth(\n feeOrders,\n zrxBuyAmount,\n feeSignatures\n );\n makerAssetAmountPurchased = orderFillResults.makerAssetFilledAmount;\n }\n\n // Transfer feePercentage of total ETH spent on primary orders to feeRecipient.\n // Refund remaining ETH to msg.sender.\n transferEthFeeAndRefund(\n orderFillResults.takerAssetFilledAmount,\n feeOrderFillResults.takerAssetFilledAmount,\n feePercentage,\n feeRecipient\n );\n\n // Transfer purchased assets to msg.sender.\n transferAssetToSender(orders[0].makerAssetData, makerAssetAmountPurchased);\n }\n\n /// @dev Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param makerAssetFillAmount Desired amount of makerAsset to purchase.\n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketBuyOrdersWithEth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n FillResults memory orderFillResults,\n FillResults memory feeOrderFillResults\n )\n {\n // Convert ETH to WETH.\n convertEthToWeth();\n\n uint256 zrxBuyAmount;\n uint256 makerAssetAmountPurchased;\n if (orders[0].makerAssetData.equals(ZRX_ASSET_DATA)) {\n // If the makerAsset is ZRX, it is not necessary to pay fees out of this\n // contracts's ZRX balance because fees are factored into the price of the order.\n orderFillResults = marketBuyExactZrxWithWeth(\n orders,\n makerAssetFillAmount,\n signatures\n );\n // The fee amount must be deducted from the amount transfered back to sender.\n makerAssetAmountPurchased = safeSub(orderFillResults.makerAssetFilledAmount, orderFillResults.takerFeePaid);\n } else {\n // Attemp to purchase desired amount of makerAsset.\n // ZRX fees are payed with this contract's balance.\n orderFillResults = marketBuyExactAmountWithWeth(\n orders,\n makerAssetFillAmount,\n signatures\n );\n // Buy back all ZRX spent on fees.\n zrxBuyAmount = orderFillResults.takerFeePaid;\n feeOrderFillResults = marketBuyExactZrxWithWeth(\n feeOrders,\n zrxBuyAmount,\n feeSignatures\n );\n makerAssetAmountPurchased = orderFillResults.makerAssetFilledAmount;\n }\n\n // Transfer feePercentage of total ETH spent on primary orders to feeRecipient.\n // Refund remaining ETH to msg.sender.\n transferEthFeeAndRefund(\n orderFillResults.takerAssetFilledAmount,\n feeOrderFillResults.takerAssetFilledAmount,\n feePercentage,\n feeRecipient\n );\n\n // Transfer purchased assets to msg.sender.\n transferAssetToSender(orders[0].makerAssetData, makerAssetAmountPurchased);\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinWeth.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MWeth.sol\";\n\n\ncontract MixinWeth is\n LibMath,\n LibConstants,\n MWeth\n{\n\n /// @dev Default payabale function, this allows us to withdraw WETH\n function ()\n public\n payable\n {\n require(\n msg.sender == address(ETHER_TOKEN),\n \"DEFAULT_FUNCTION_WETH_CONTRACT_ONLY\"\n );\n }\n\n /// @dev Converts message call's ETH value into WETH.\n function convertEthToWeth()\n internal\n {\n require(\n msg.value > 0,\n \"INVALID_MSG_VALUE\"\n );\n ETHER_TOKEN.deposit.value(msg.value)();\n }\n\n /// @dev Transfers feePercentage of WETH spent on primary orders to feeRecipient.\n /// Refunds any excess ETH to msg.sender.\n /// @param wethSoldExcludingFeeOrders Amount of WETH sold when filling primary orders.\n /// @param wethSoldForZrx Amount of WETH sold when purchasing ZRX required for primary order fees.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n function transferEthFeeAndRefund(\n uint256 wethSoldExcludingFeeOrders,\n uint256 wethSoldForZrx,\n uint256 feePercentage,\n address feeRecipient\n )\n internal\n {\n // Ensure feePercentage is less than 5%.\n require(\n feePercentage <= MAX_FEE_PERCENTAGE,\n \"FEE_PERCENTAGE_TOO_LARGE\"\n );\n\n // Ensure that no extra WETH owned by this contract has been sold.\n uint256 wethSold = safeAdd(wethSoldExcludingFeeOrders, wethSoldForZrx);\n require(\n wethSold <= msg.value,\n \"OVERSOLD_WETH\"\n );\n\n // Calculate amount of WETH that hasn't been sold.\n uint256 wethRemaining = safeSub(msg.value, wethSold);\n\n // Calculate ETH fee to pay to feeRecipient.\n uint256 ethFee = getPartialAmount(\n feePercentage,\n PERCENTAGE_DENOMINATOR,\n wethSoldExcludingFeeOrders\n );\n\n // Ensure fee is less than amount of WETH remaining.\n require(\n ethFee <= wethRemaining,\n \"INSUFFICIENT_ETH_REMAINING\"\n );\n \n // Do nothing if no WETH remaining\n if (wethRemaining > 0) {\n // Convert remaining WETH to ETH\n ETHER_TOKEN.withdraw(wethRemaining);\n\n // Pay ETH to feeRecipient\n if (ethFee > 0) {\n feeRecipient.transfer(ethFee);\n }\n\n // Refund remaining ETH to msg.sender.\n uint256 ethRefund = safeSub(wethRemaining, ethFee);\n if (ethRefund > 0) {\n msg.sender.transfer(ethRefund);\n }\n }\n }\n}\n",
- "2.0.0/extensions/Forwarder/interfaces/IAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IAssets {\n\n /// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to \n /// function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be\n /// used to withdraw assets that were accidentally sent to this contract.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of ERC20 token to withdraw.\n function withdrawAsset(\n bytes assetData,\n uint256 amount\n )\n external;\n}\n",
- "2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../../protocol/Exchange/libs/LibFillResults.sol\";\n\n\ncontract IForwarderCore {\n\n /// @dev Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketSellOrdersWithEth(\n LibOrder.Order[] memory orders,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n LibFillResults.FillResults memory orderFillResults,\n LibFillResults.FillResults memory feeOrderFillResults\n );\n\n /// @dev Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param makerAssetFillAmount Desired amount of makerAsset to purchase.\n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketBuyOrdersWithEth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n LibFillResults.FillResults memory orderFillResults,\n LibFillResults.FillResults memory feeOrderFillResults\n );\n}\n",
- "2.0.0/extensions/Forwarder/libs/LibConstants.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/LibBytes/LibBytes.sol\";\nimport \"../../../protocol/Exchange/interfaces/IExchange.sol\";\nimport \"../../../tokens/EtherToken/IEtherToken.sol\";\nimport \"../../../tokens/ERC20Token/IERC20Token.sol\";\n\n\ncontract LibConstants {\n\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n uint256 constant internal MAX_UINT = 2**256 - 1;\n uint256 constant internal PERCENTAGE_DENOMINATOR = 10**18; \n uint256 constant internal MAX_FEE_PERCENTAGE = 5 * PERCENTAGE_DENOMINATOR / 100; // 5%\n uint256 constant internal MAX_WETH_FILL_PERCENTAGE = 95 * PERCENTAGE_DENOMINATOR / 100; // 95%\n \n // solhint-disable var-name-mixedcase\n IExchange internal EXCHANGE;\n IEtherToken internal ETHER_TOKEN;\n IERC20Token internal ZRX_TOKEN;\n bytes internal ZRX_ASSET_DATA;\n bytes internal WETH_ASSET_DATA;\n // solhint-enable var-name-mixedcase\n\n constructor (\n address _exchange,\n bytes memory _zrxAssetData,\n bytes memory _wethAssetData\n )\n public\n {\n EXCHANGE = IExchange(_exchange);\n ZRX_ASSET_DATA = _zrxAssetData;\n WETH_ASSET_DATA = _wethAssetData;\n\n address etherToken = _wethAssetData.readAddress(16);\n address zrxToken = _zrxAssetData.readAddress(16);\n ETHER_TOKEN = IEtherToken(etherToken);\n ZRX_TOKEN = IERC20Token(zrxToken);\n }\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAssets.sol\";\n\n\ncontract MAssets is\n IAssets\n{\n\n /// @dev Transfers given amount of asset to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferAssetToSender(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n\n /// @dev Decodes ERC20 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC20Token(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n\n /// @dev Decodes ERC721 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC721Token(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../../protocol/Exchange/libs/LibFillResults.sol\";\n\n\ncontract MExchangeWrapper {\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of WETH has been sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param wethSellAmount Desired amount of WETH to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellWeth(\n LibOrder.Order[] memory orders,\n uint256 wethSellAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// The asset being sold by taker must always be WETH.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyExactAmountWithWeth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Buys zrxBuyAmount of ZRX fee tokens, taking into account ZRX fees for each order. This will guarantee\n /// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues).\n /// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX\n /// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases.\n /// The asset being sold by taker must always be WETH. \n /// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset.\n /// @param zrxBuyAmount Desired amount of ZRX to buy.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return totalFillResults Amounts filled and fees paid by maker and taker.\n function marketBuyExactZrxWithWeth(\n LibOrder.Order[] memory orders,\n uint256 zrxBuyAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MWeth.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract MWeth {\n\n /// @dev Converts message call's ETH value into WETH.\n function convertEthToWeth()\n internal;\n\n /// @dev Transfers feePercentage of WETH spent on primary orders to feeRecipient.\n /// Refunds any excess ETH to msg.sender.\n /// @param wethSoldExcludingFeeOrders Amount of WETH sold when filling primary orders.\n /// @param wethSoldForZrx Amount of WETH sold when purchasing ZRX required for primary order fees.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n function transferEthFeeAndRefund(\n uint256 wethSoldExcludingFeeOrders,\n uint256 wethSoldForZrx,\n uint256 feePercentage,\n address feeRecipient\n )\n internal;\n}\n",
- "2.0.0/extensions/OrderValidator/OrderValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../protocol/Exchange/interfaces/IExchange.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../tokens/ERC20Token/IERC20Token.sol\";\nimport \"../../tokens/ERC721Token/IERC721Token.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\n\n\ncontract OrderValidator {\n\n bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n\n using LibBytes for bytes;\n\n struct TraderInfo {\n uint256 makerBalance; // Maker's balance of makerAsset\n uint256 makerAllowance; // Maker's allowance to corresponding AssetProxy\n uint256 takerBalance; // Taker's balance of takerAsset\n uint256 takerAllowance; // Taker's allowance to corresponding AssetProxy\n uint256 makerZrxBalance; // Maker's balance of ZRX\n uint256 makerZrxAllowance; // Maker's allowance of ZRX to ERC20Proxy\n uint256 takerZrxBalance; // Taker's balance of ZRX\n uint256 takerZrxAllowance; // Taker's allowance of ZRX to ERC20Proxy\n }\n\n // solhint-disable var-name-mixedcase\n IExchange internal EXCHANGE;\n bytes internal ZRX_ASSET_DATA;\n // solhint-enable var-name-mixedcase\n\n constructor (address _exchange, bytes memory _zrxAssetData)\n public\n {\n EXCHANGE = IExchange(_exchange);\n ZRX_ASSET_DATA = _zrxAssetData;\n }\n\n /// @dev Fetches information for order and maker/taker of order.\n /// @param order The order structure.\n /// @param takerAddress Address that will be filling the order.\n /// @return OrderInfo and TraderInfo instances for given order.\n function getOrderAndTraderInfo(LibOrder.Order memory order, address takerAddress)\n public\n view\n returns (LibOrder.OrderInfo memory orderInfo, TraderInfo memory traderInfo)\n {\n orderInfo = EXCHANGE.getOrderInfo(order);\n traderInfo = getTraderInfo(order, takerAddress);\n return (orderInfo, traderInfo);\n }\n\n /// @dev Fetches information for all passed in orders and the makers/takers of each order.\n /// @param orders Array of order specifications.\n /// @param takerAddresses Array of taker addresses corresponding to each order.\n /// @return Arrays of OrderInfo and TraderInfo instances that correspond to each order.\n function getOrdersAndTradersInfo(LibOrder.Order[] memory orders, address[] memory takerAddresses)\n public\n view\n returns (LibOrder.OrderInfo[] memory ordersInfo, TraderInfo[] memory tradersInfo)\n {\n ordersInfo = EXCHANGE.getOrdersInfo(orders);\n tradersInfo = getTradersInfo(orders, takerAddresses);\n return (ordersInfo, tradersInfo);\n }\n\n /// @dev Fetches balance and allowances for maker and taker of order.\n /// @param order The order structure.\n /// @param takerAddress Address that will be filling the order.\n /// @return Balances and allowances of maker and taker of order.\n function getTraderInfo(LibOrder.Order memory order, address takerAddress)\n public\n view\n returns (TraderInfo memory traderInfo)\n {\n (traderInfo.makerBalance, traderInfo.makerAllowance) = getBalanceAndAllowance(order.makerAddress, order.makerAssetData);\n (traderInfo.takerBalance, traderInfo.takerAllowance) = getBalanceAndAllowance(takerAddress, order.takerAssetData);\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n (traderInfo.makerZrxBalance, traderInfo.makerZrxAllowance) = getBalanceAndAllowance(order.makerAddress, zrxAssetData);\n (traderInfo.takerZrxBalance, traderInfo.takerZrxAllowance) = getBalanceAndAllowance(takerAddress, zrxAssetData);\n return traderInfo;\n }\n\n /// @dev Fetches balances and allowances of maker and taker for each provided order.\n /// @param orders Array of order specifications.\n /// @param takerAddresses Array of taker addresses corresponding to each order.\n /// @return Array of balances and allowances for maker and taker of each order.\n function getTradersInfo(LibOrder.Order[] memory orders, address[] memory takerAddresses)\n public\n view\n returns (TraderInfo[] memory)\n {\n uint256 ordersLength = orders.length;\n TraderInfo[] memory tradersInfo = new TraderInfo[](ordersLength);\n for (uint256 i = 0; i != ordersLength; i++) {\n tradersInfo[i] = getTraderInfo(orders[i], takerAddresses[i]);\n }\n return tradersInfo;\n }\n\n /// @dev Fetches token balances and allowances of an address to given assetProxy. Supports ERC20 and ERC721.\n /// @param target Address to fetch balances and allowances of.\n /// @param assetData Encoded data that can be decoded by a specified proxy contract when transferring asset.\n /// @return Balance of asset and allowance set to given proxy of asset.\n /// For ERC721 tokens, these values will always be 1 or 0.\n function getBalanceAndAllowance(address target, bytes memory assetData)\n public\n view\n returns (uint256 balance, uint256 allowance)\n {\n bytes4 assetProxyId = assetData.readBytes4(0);\n address token = assetData.readAddress(16);\n address assetProxy = EXCHANGE.getAssetProxy(assetProxyId);\n\n if (assetProxyId == ERC20_DATA_ID) {\n // Query balance\n balance = IERC20Token(token).balanceOf(target);\n\n // Query allowance\n allowance = IERC20Token(token).allowance(target, assetProxy);\n } else if (assetProxyId == ERC721_DATA_ID) {\n uint256 tokenId = assetData.readUint256(36);\n\n // Query owner of tokenId\n address owner = getERC721TokenOwner(token, tokenId);\n\n // Set balance to 1 if tokenId is owned by target\n balance = target == owner ? 1 : 0;\n\n // Check if ERC721Proxy is approved to spend tokenId\n bool isApproved = IERC721Token(token).isApprovedForAll(target, assetProxy) || IERC721Token(token).getApproved(tokenId) == assetProxy;\n \n // Set alowance to 1 if ERC721Proxy is approved to spend tokenId\n allowance = isApproved ? 1 : 0;\n } else {\n revert(\"UNSUPPORTED_ASSET_PROXY\");\n }\n return (balance, allowance);\n }\n\n /// @dev Fetches token balances and allowances of an address for each given assetProxy. Supports ERC20 and ERC721.\n /// @param target Address to fetch balances and allowances of.\n /// @param assetData Array of encoded byte arrays that can be decoded by a specified proxy contract when transferring asset.\n /// @return Balances and allowances of assets.\n /// For ERC721 tokens, these values will always be 1 or 0.\n function getBalancesAndAllowances(address target, bytes[] memory assetData)\n public\n view\n returns (uint256[] memory, uint256[] memory)\n {\n uint256 length = assetData.length;\n uint256[] memory balances = new uint256[](length);\n uint256[] memory allowances = new uint256[](length);\n for (uint256 i = 0; i != length; i++) {\n (balances[i], allowances[i]) = getBalanceAndAllowance(target, assetData[i]);\n }\n return (balances, allowances);\n }\n\n /// @dev Calls `token.ownerOf(tokenId)`, but returns a null owner instead of reverting on an unowned token.\n /// @param token Address of ERC721 token.\n /// @param tokenId The identifier for the specific NFT.\n /// @return Owner of tokenId or null address if unowned.\n function getERC721TokenOwner(address token, uint256 tokenId)\n public\n view\n returns (address owner)\n {\n assembly {\n // load free memory pointer\n let cdStart := mload(64)\n\n // bytes4(keccak256(ownerOf(uint256))) = 0x6352211e\n mstore(cdStart, 0x6352211e00000000000000000000000000000000000000000000000000000000)\n mstore(add(cdStart, 4), tokenId)\n\n // staticcall `ownerOf(tokenId)`\n // `ownerOf` will revert if tokenId is not owned\n let success := staticcall(\n gas, // forward all gas\n token, // call token contract\n cdStart, // start of calldata\n 36, // length of input is 36 bytes\n cdStart, // write output over input\n 32 // size of output is 32 bytes\n )\n\n // Success implies that tokenId is owned\n // Copy owner from return data if successful\n if success {\n owner := mload(cdStart)\n } \n }\n\n // Owner initialized to address(0), no need to modify if call is unsuccessful\n return owner;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/ERC20Proxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"./MixinAuthorizable.sol\";\n\n\ncontract ERC20Proxy is\n MixinAuthorizable\n{\n // Id of this proxy.\n bytes4 constant internal PROXY_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n \n // solhint-disable-next-line payable-fallback\n function () \n external\n {\n assembly {\n // The first 4 bytes of calldata holds the function selector\n let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)\n\n // `transferFrom` will be called with the following parameters:\n // assetData Encoded byte array.\n // from Address to transfer asset from.\n // to Address to transfer asset to.\n // amount Amount of asset to transfer.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {\n\n // To lookup a value in a mapping, we load from the storage location keccak256(k, p),\n // where k is the key left padded to 32 bytes and p is the storage slot\n let start := mload(64)\n mstore(start, and(caller, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(start, 32), authorized_slot)\n\n // Revert if authorized[msg.sender] == false\n if iszero(sload(keccak256(start, 64))) {\n // Revert with `Error(\"SENDER_NOT_AUTHORIZED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n \n /////// Token contract address ///////\n // The token address is found as follows:\n // * It is stored at offset 4 in `assetData` contents.\n // * This is stored at offset 32 from `assetData`.\n // * The offset to `assetData` from Params is stored at offset\n // 4 in calldata.\n // * The offset of Params in calldata is 4.\n // So we read location 4 and add 32 + 4 + 4 to it.\n let token := calldataload(add(calldataload(4), 40))\n \n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFrom` selector.\n // Any trailing data in transferFromSelector will be\n // overwritten in the next `mstore` call.\n mstore(0, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // We copy the fields `from`, `to` and `amount` in bulk\n // from our own calldata to the new calldata.\n calldatacopy(4, 36, 96)\n\n /////// Call `token.transferFrom` using the calldata ///////\n let success := call(\n gas, // forward all gas\n token, // call address of token contract\n 0, // don't send any ETH\n 0, // pointer to start of input\n 100, // length of input\n 0, // write output over input\n 32 // output size should be 32 bytes\n )\n\n /////// Check return data. ///////\n // If there is no return data, we assume the token incorrectly\n // does not return a bool. In this case we expect it to revert\n // on failure, which was handled above.\n // If the token does return data, we require that it is a single\n // nonzero 32 bytes value.\n // So the transfer succeeded if the call succeeded and either\n // returned nothing, or returned a non-zero 32 byte value. \n success := and(success, or(\n iszero(returndatasize),\n and(\n eq(returndatasize, 32),\n gt(mload(0), 0)\n )\n ))\n if success {\n return(0, 0)\n }\n \n // Revert with `Error(\"TRANSFER_FAILED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n }\n }\n\n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4)\n {\n return PROXY_ID;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/ERC721Proxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"./MixinAuthorizable.sol\";\n\n\ncontract ERC721Proxy is\n MixinAuthorizable\n{\n // Id of this proxy.\n bytes4 constant internal PROXY_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n\n // solhint-disable-next-line payable-fallback\n function () \n external\n {\n assembly {\n // The first 4 bytes of calldata holds the function selector\n let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)\n\n // `transferFrom` will be called with the following parameters:\n // assetData Encoded byte array.\n // from Address to transfer asset from.\n // to Address to transfer asset to.\n // amount Amount of asset to transfer.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {\n\n // To lookup a value in a mapping, we load from the storage location keccak256(k, p),\n // where k is the key left padded to 32 bytes and p is the storage slot\n let start := mload(64)\n mstore(start, and(caller, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(start, 32), authorized_slot)\n\n // Revert if authorized[msg.sender] == false\n if iszero(sload(keccak256(start, 64))) {\n // Revert with `Error(\"SENDER_NOT_AUTHORIZED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // `transferFrom`.\n // The function is marked `external`, so no abi decodeding is done for\n // us. Instead, we expect the `calldata` memory to contain the\n // following:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n //\n // (*): offset is computed from start of function parameters, so offset\n // by an additional 4 bytes in the calldata.\n //\n // WARNING: The ABIv2 specification allows additional padding between\n // the Params and Data section. This will result in a larger\n // offset to assetData.\n\n // Asset data itself is encoded as follows:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 2 * 32 | function parameters: |\n // | | 4 | 12 + 20 | 1. token address |\n // | | 36 | | 2. tokenId |\n \n // We construct calldata for the `token.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n // \n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 4 | | 1. from |\n // | | 36 | | 2. to |\n // | | 68 | | 3. tokenId |\n\n // There exists only 1 of each token.\n // require(amount == 1, \"INVALID_AMOUNT\")\n if sub(calldataload(100), 1) {\n // Revert with `Error(\"INVALID_AMOUNT\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000e494e56414c49445f414d4f554e540000000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFrom` selector.\n // Any trailing data in transferFromSelector will be\n // overwritten in the next `mstore` call.\n mstore(0, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // We copy the fields `from` and `to` in bulk\n // from our own calldata to the new calldata.\n calldatacopy(4, 36, 64)\n\n // Copy `tokenId` field from our own calldata to the new calldata.\n let assetDataOffset := calldataload(4)\n calldatacopy(68, add(assetDataOffset, 72), 32)\n\n /////// Call `token.transferFrom` using the calldata ///////\n let token := calldataload(add(assetDataOffset, 40))\n let success := call(\n gas, // forward all gas\n token, // call address of token contract\n 0, // don't send any ETH\n 0, // pointer to start of input\n 100, // length of input\n 0, // write output to null\n 0 // output size is 0 bytes\n )\n if success {\n return(0, 0)\n }\n \n // Revert with `Error(\"TRANSFER_FAILED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n }\n }\n\n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4)\n {\n return PROXY_ID;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/MixinAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"./mixins/MAuthorizable.sol\";\n\n\ncontract MixinAuthorizable is\n Ownable,\n MAuthorizable\n{\n\n /// @dev Only authorized addresses can invoke functions with this modifier.\n modifier onlyAuthorized {\n require(\n authorized[msg.sender],\n \"SENDER_NOT_AUTHORIZED\"\n );\n _;\n }\n\n mapping (address => bool) public authorized;\n address[] public authorities;\n\n /// @dev Authorizes an address.\n /// @param target Address to authorize.\n function addAuthorizedAddress(address target)\n external\n onlyOwner\n {\n require(\n !authorized[target],\n \"TARGET_ALREADY_AUTHORIZED\"\n );\n\n authorized[target] = true;\n authorities.push(target);\n emit AuthorizedAddressAdded(target, msg.sender);\n }\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n function removeAuthorizedAddress(address target)\n external\n onlyOwner\n {\n require(\n authorized[target],\n \"TARGET_NOT_AUTHORIZED\"\n );\n\n delete authorized[target];\n for (uint256 i = 0; i < authorities.length; i++) {\n if (authorities[i] == target) {\n authorities[i] = authorities[authorities.length - 1];\n authorities.length -= 1;\n break;\n }\n }\n emit AuthorizedAddressRemoved(target, msg.sender);\n }\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n /// @param index Index of target in authorities array.\n function removeAuthorizedAddressAtIndex(\n address target,\n uint256 index\n )\n external\n onlyOwner\n {\n require(\n authorized[target],\n \"TARGET_NOT_AUTHORIZED\"\n );\n require(\n index < authorities.length,\n \"INDEX_OUT_OF_BOUNDS\"\n );\n require(\n authorities[index] == target,\n \"AUTHORIZED_ADDRESS_MISMATCH\"\n );\n\n delete authorized[target];\n authorities[index] = authorities[authorities.length - 1];\n authorities.length -= 1;\n emit AuthorizedAddressRemoved(target, msg.sender);\n }\n\n /// @dev Gets all authorized addresses.\n /// @return Array of authorized addresses.\n function getAuthorizedAddresses()\n external\n view\n returns (address[] memory)\n {\n return authorities;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IAuthorizable.sol\";\n\n\ncontract IAssetProxy is\n IAuthorizable\n{\n\n /// @dev Transfers assets. Either succeeds or throws.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param from Address to transfer asset from.\n /// @param to Address to transfer asset to.\n /// @param amount Amount of asset to transfer.\n function transferFrom(\n bytes assetData,\n address from,\n address to,\n uint256 amount\n )\n external;\n \n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4);\n}\n",
- "2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/Ownable/IOwnable.sol\";\n\n\ncontract IAuthorizable is\n IOwnable\n{\n\n /// @dev Authorizes an address.\n /// @param target Address to authorize.\n function addAuthorizedAddress(address target)\n external;\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n function removeAuthorizedAddress(address target)\n external;\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n /// @param index Index of target in authorities array.\n function removeAuthorizedAddressAtIndex(\n address target,\n uint256 index\n )\n external;\n \n /// @dev Gets all authorized addresses.\n /// @return Array of authorized addresses.\n function getAuthorizedAddresses()\n external\n view\n returns (address[] memory);\n}\n",
- "2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAuthorizable.sol\";\n\n\ncontract MAuthorizable is\n IAuthorizable\n{\n\n // Event logged when a new address is authorized.\n event AuthorizedAddressAdded(\n address indexed target,\n address indexed caller\n );\n\n // Event logged when a currently authorized address is unauthorized.\n event AuthorizedAddressRemoved(\n address indexed target,\n address indexed caller\n );\n\n /// @dev Only authorized addresses can invoke functions with this modifier.\n modifier onlyAuthorized { revert(); _; }\n}\n",
- "2.0.0/protocol/Exchange/Exchange.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./MixinExchangeCore.sol\";\nimport \"./MixinSignatureValidator.sol\";\nimport \"./MixinWrapperFunctions.sol\";\nimport \"./MixinAssetProxyDispatcher.sol\";\nimport \"./MixinTransactions.sol\";\nimport \"./MixinMatchOrders.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract Exchange is\n MixinExchangeCore,\n MixinMatchOrders,\n MixinSignatureValidator,\n MixinTransactions,\n MixinAssetProxyDispatcher,\n MixinWrapperFunctions\n{\n\n string constant public VERSION = \"2.0.1-alpha\";\n\n // Mixins are instantiated in the order they are inherited\n constructor (bytes memory _zrxAssetData)\n public\n LibConstants(_zrxAssetData) // @TODO: Remove when we deploy.\n MixinExchangeCore()\n MixinMatchOrders()\n MixinSignatureValidator()\n MixinTransactions()\n MixinAssetProxyDispatcher()\n MixinWrapperFunctions()\n {}\n}\n",
- "2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\nimport \"../AssetProxy/interfaces/IAssetProxy.sol\";\n\n\ncontract MixinAssetProxyDispatcher is\n Ownable,\n MAssetProxyDispatcher\n{\n using LibBytes for bytes;\n \n // Mapping from Asset Proxy Id's to their respective Asset Proxy\n mapping (bytes4 => IAssetProxy) public assetProxies;\n\n /// @dev Registers an asset proxy to its asset proxy id.\n /// Once an asset proxy is registered, it cannot be unregistered.\n /// @param assetProxy Address of new asset proxy to register.\n function registerAssetProxy(address assetProxy)\n external\n onlyOwner\n {\n IAssetProxy assetProxyContract = IAssetProxy(assetProxy);\n\n // Ensure that no asset proxy exists with current id.\n bytes4 assetProxyId = assetProxyContract.getProxyId();\n address currentAssetProxy = assetProxies[assetProxyId];\n require(\n currentAssetProxy == address(0),\n \"ASSET_PROXY_ALREADY_EXISTS\"\n );\n\n // Add asset proxy and log registration.\n assetProxies[assetProxyId] = assetProxyContract;\n emit AssetProxyRegistered(\n assetProxyId,\n assetProxy\n );\n }\n\n /// @dev Gets an asset proxy.\n /// @param assetProxyId Id of the asset proxy.\n /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered.\n function getAssetProxy(bytes4 assetProxyId)\n external\n view\n returns (address)\n {\n return assetProxies[assetProxyId];\n }\n\n /// @dev Forwards arguments to assetProxy and calls `transferFrom`. Either succeeds or throws.\n /// @param assetData Byte array encoded for the asset.\n /// @param from Address to transfer token from.\n /// @param to Address to transfer token to.\n /// @param amount Amount of token to transfer.\n function dispatchTransferFrom(\n bytes memory assetData,\n address from,\n address to,\n uint256 amount\n )\n internal\n {\n // Do nothing if no amount should be transferred.\n if (amount > 0) {\n // Ensure assetData length is valid\n require(\n assetData.length > 3,\n \"LENGTH_GREATER_THAN_3_REQUIRED\"\n );\n \n // Lookup assetProxy\n bytes4 assetProxyId;\n assembly {\n assetProxyId := and(mload(\n add(assetData, 32)),\n 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000\n )\n }\n address assetProxy = assetProxies[assetProxyId];\n\n // Ensure that assetProxy exists\n require(\n assetProxy != address(0),\n \"ASSET_PROXY_DOES_NOT_EXIST\"\n );\n \n // We construct calldata for the `assetProxy.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n // \n // | Area | Offset | Length | Contents |\n // | -------- |--------|---------|-------------------------------------------- |\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n\n assembly {\n /////// Setup State ///////\n // `cdStart` is the start of the calldata for `assetProxy.transferFrom` (equal to free memory ptr).\n let cdStart := mload(64)\n // `dataAreaLength` is the total number of words needed to store `assetData`\n // As-per the ABI spec, this value is padded up to the nearest multiple of 32,\n // and includes 32-bytes for length.\n let dataAreaLength := and(add(mload(assetData), 63), 0xFFFFFFFFFFFE0)\n // `cdEnd` is the end of the calldata for `assetProxy.transferFrom`.\n let cdEnd := add(cdStart, add(132, dataAreaLength))\n\n \n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFromSelector`.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n mstore(cdStart, 0xa85e59e400000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // Each parameter is padded to 32-bytes. The entire Params Area is 128 bytes.\n // Notes:\n // 1. The offset to `assetData` is the length of the Params Area (128 bytes).\n // 2. A 20-byte mask is applied to addresses to zero-out the unused bytes.\n mstore(add(cdStart, 4), 128)\n mstore(add(cdStart, 36), and(from, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(cdStart, 68), and(to, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(cdStart, 100), amount)\n \n /////// Setup Data Area ///////\n // This area holds `assetData`.\n let dataArea := add(cdStart, 132)\n // solhint-disable-next-line no-empty-blocks\n for {} lt(dataArea, cdEnd) {} {\n mstore(dataArea, mload(assetData))\n dataArea := add(dataArea, 32)\n assetData := add(assetData, 32)\n }\n\n /////// Call `assetProxy.transferFrom` using the constructed calldata ///////\n let success := call(\n gas, // forward all gas\n assetProxy, // call address of asset proxy\n 0, // don't send any ETH\n cdStart, // pointer to start of input\n sub(cdEnd, cdStart), // length of input \n cdStart, // write output over input\n 512 // reserve 512 bytes for output\n )\n if iszero(success) {\n revert(cdStart, returndatasize())\n }\n }\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\n\n\ncontract MixinExchangeCore is\n LibConstants,\n LibMath,\n LibOrder,\n LibFillResults,\n MAssetProxyDispatcher,\n MExchangeCore,\n MSignatureValidator,\n MTransactions\n{\n // Mapping of orderHash => amount of takerAsset already bought by maker\n mapping (bytes32 => uint256) public filled;\n\n // Mapping of orderHash => cancelled\n mapping (bytes32 => bool) public cancelled;\n\n // Mapping of makerAddress => senderAddress => lowest salt an order can have in order to be fillable\n // Orders with specified senderAddress and with a salt less than their epoch are considered cancelled\n mapping (address => mapping (address => uint256)) public orderEpoch;\n\n /// @dev Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch\n /// and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress).\n /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled.\n function cancelOrdersUpTo(uint256 targetOrderEpoch)\n external\n {\n address makerAddress = getCurrentContextAddress();\n // If this function is called via `executeTransaction`, we only update the orderEpoch for the makerAddress/msg.sender combination.\n // This allows external filter contracts to add rules to how orders are cancelled via this function.\n address senderAddress = makerAddress == msg.sender ? address(0) : msg.sender;\n\n // orderEpoch is initialized to 0, so to cancelUpTo we need salt + 1\n uint256 newOrderEpoch = targetOrderEpoch + 1; \n uint256 oldOrderEpoch = orderEpoch[makerAddress][senderAddress];\n\n // Ensure orderEpoch is monotonically increasing\n require(\n newOrderEpoch > oldOrderEpoch, \n \"INVALID_NEW_ORDER_EPOCH\"\n );\n\n // Update orderEpoch\n orderEpoch[makerAddress][senderAddress] = newOrderEpoch;\n emit CancelUpTo(makerAddress, senderAddress, newOrderEpoch);\n }\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrder(\n Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (FillResults memory fillResults)\n {\n // Fetch order info\n OrderInfo memory orderInfo = getOrderInfo(order);\n\n // Fetch taker address\n address takerAddress = getCurrentContextAddress();\n\n // Get amount of takerAsset to fill\n uint256 remainingTakerAssetAmount = safeSub(order.takerAssetAmount, orderInfo.orderTakerAssetFilledAmount);\n uint256 takerAssetFilledAmount = min256(takerAssetFillAmount, remainingTakerAssetAmount);\n\n // Validate context\n assertValidFill(\n order,\n orderInfo,\n takerAddress,\n takerAssetFillAmount,\n takerAssetFilledAmount,\n signature\n );\n\n // Compute proportional fill amounts\n fillResults = calculateFillResults(order, takerAssetFilledAmount);\n\n // Update exchange internal state\n updateFilledState(\n order,\n takerAddress,\n orderInfo.orderHash,\n orderInfo.orderTakerAssetFilledAmount,\n fillResults\n );\n \n // Settle order\n settleOrder(order, takerAddress, fillResults);\n\n return fillResults;\n }\n\n /// @dev After calling, the order can not be filled anymore.\n /// Throws if order is invalid or sender does not have permission to cancel.\n /// @param order Order to cancel. Order must be OrderStatus.FILLABLE.\n function cancelOrder(Order memory order)\n public\n {\n // Fetch current order status\n OrderInfo memory orderInfo = getOrderInfo(order);\n\n // Validate context\n assertValidCancel(order, orderInfo);\n\n // Perform cancel\n updateCancelledState(order, orderInfo.orderHash);\n }\n\n /// @dev Gets information about an order: status, hash, and amount filled.\n /// @param order Order to gather information on.\n /// @return OrderInfo Information about the order and its state.\n /// See LibOrder.OrderInfo for a complete description.\n function getOrderInfo(Order memory order)\n public\n view\n returns (OrderInfo memory orderInfo)\n {\n // Compute the order hash\n orderInfo.orderHash = getOrderHash(order);\n\n // Fetch filled amount\n orderInfo.orderTakerAssetFilledAmount = filled[orderInfo.orderHash];\n\n // If order.makerAssetAmount is zero, we also reject the order.\n // While the Exchange contract handles them correctly, they create\n // edge cases in the supporting infrastructure because they have\n // an 'infinite' price when computed by a simple division.\n if (order.makerAssetAmount == 0) {\n orderInfo.orderStatus = uint8(OrderStatus.INVALID_MAKER_ASSET_AMOUNT);\n return orderInfo;\n }\n\n // If order.takerAssetAmount is zero, then the order will always\n // be considered filled because 0 == takerAssetAmount == orderTakerAssetFilledAmount\n // Instead of distinguishing between unfilled and filled zero taker\n // amount orders, we choose not to support them.\n if (order.takerAssetAmount == 0) {\n orderInfo.orderStatus = uint8(OrderStatus.INVALID_TAKER_ASSET_AMOUNT);\n return orderInfo;\n }\n\n // Validate order availability\n if (orderInfo.orderTakerAssetFilledAmount >= order.takerAssetAmount) {\n orderInfo.orderStatus = uint8(OrderStatus.FULLY_FILLED);\n return orderInfo;\n }\n\n // Validate order expiration\n // solhint-disable-next-line not-rely-on-time\n if (block.timestamp >= order.expirationTimeSeconds) {\n orderInfo.orderStatus = uint8(OrderStatus.EXPIRED);\n return orderInfo;\n }\n\n // Check if order has been cancelled\n if (cancelled[orderInfo.orderHash]) {\n orderInfo.orderStatus = uint8(OrderStatus.CANCELLED);\n return orderInfo;\n }\n if (orderEpoch[order.makerAddress][order.senderAddress] > order.salt) {\n orderInfo.orderStatus = uint8(OrderStatus.CANCELLED);\n return orderInfo;\n }\n\n // All other statuses are ruled out: order is Fillable\n orderInfo.orderStatus = uint8(OrderStatus.FILLABLE);\n return orderInfo;\n }\n\n /// @dev Updates state with results of a fill order.\n /// @param order that was filled.\n /// @param takerAddress Address of taker who filled the order.\n /// @param orderTakerAssetFilledAmount Amount of order already filled.\n function updateFilledState(\n Order memory order,\n address takerAddress,\n bytes32 orderHash,\n uint256 orderTakerAssetFilledAmount,\n FillResults memory fillResults\n )\n internal\n {\n // Update state\n filled[orderHash] = safeAdd(orderTakerAssetFilledAmount, fillResults.takerAssetFilledAmount);\n\n // Log order\n emit Fill(\n order.makerAddress,\n order.feeRecipientAddress,\n takerAddress,\n msg.sender,\n fillResults.makerAssetFilledAmount,\n fillResults.takerAssetFilledAmount,\n fillResults.makerFeePaid,\n fillResults.takerFeePaid,\n orderHash,\n order.makerAssetData,\n order.takerAssetData\n );\n }\n\n /// @dev Updates state with results of cancelling an order.\n /// State is only updated if the order is currently fillable.\n /// Otherwise, updating state would have no effect.\n /// @param order that was cancelled.\n /// @param orderHash Hash of order that was cancelled.\n function updateCancelledState(\n Order memory order,\n bytes32 orderHash\n )\n internal\n {\n // Perform cancel\n cancelled[orderHash] = true;\n\n // Log cancel\n emit Cancel(\n order.makerAddress,\n order.feeRecipientAddress,\n msg.sender,\n orderHash,\n order.makerAssetData,\n order.takerAssetData\n );\n }\n\n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAddress Address of order taker.\n /// @param takerAssetFillAmount Desired amount of order to fill by taker.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @param signature Proof that the orders was created by its maker.\n function assertValidFill(\n Order memory order,\n OrderInfo memory orderInfo,\n address takerAddress,\n uint256 takerAssetFillAmount,\n uint256 takerAssetFilledAmount,\n bytes memory signature\n )\n internal\n view\n {\n // An order can only be filled if its status is FILLABLE.\n require(\n orderInfo.orderStatus == uint8(OrderStatus.FILLABLE),\n \"ORDER_UNFILLABLE\"\n );\n\n // Revert if fill amount is invalid\n require(\n takerAssetFillAmount != 0,\n \"INVALID_TAKER_AMOUNT\"\n );\n\n // Validate sender is allowed to fill this order\n if (order.senderAddress != address(0)) {\n require(\n order.senderAddress == msg.sender,\n \"INVALID_SENDER\"\n );\n }\n\n // Validate taker is allowed to fill this order\n if (order.takerAddress != address(0)) {\n require(\n order.takerAddress == takerAddress,\n \"INVALID_TAKER\"\n );\n }\n\n // Validate Maker signature (check only if first time seen)\n if (orderInfo.orderTakerAssetFilledAmount == 0) {\n require(\n isValidSignature(\n orderInfo.orderHash,\n order.makerAddress,\n signature\n ),\n \"INVALID_ORDER_SIGNATURE\"\n );\n }\n\n // Validate fill order rounding\n require(\n !isRoundingError(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.makerAssetAmount\n ),\n \"ROUNDING_ERROR\"\n );\n }\n\n /// @dev Validates context for cancelOrder. Succeeds or throws.\n /// @param order to be cancelled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n function assertValidCancel(\n Order memory order,\n OrderInfo memory orderInfo\n )\n internal\n view\n {\n // Ensure order is valid\n // An order can only be cancelled if its status is FILLABLE.\n require(\n orderInfo.orderStatus == uint8(OrderStatus.FILLABLE),\n \"ORDER_UNFILLABLE\"\n );\n\n // Validate sender is allowed to cancel this order\n if (order.senderAddress != address(0)) {\n require(\n order.senderAddress == msg.sender,\n \"INVALID_SENDER\"\n );\n }\n\n // Validate transaction signed by maker\n address makerAddress = getCurrentContextAddress();\n require(\n order.makerAddress == makerAddress,\n \"INVALID_MAKER\"\n );\n }\n\n /// @dev Calculates amounts filled and fees paid by maker and taker.\n /// @param order to be filled.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function calculateFillResults(\n Order memory order,\n uint256 takerAssetFilledAmount\n )\n internal\n pure\n returns (FillResults memory fillResults)\n {\n // Compute proportional transfer amounts\n fillResults.takerAssetFilledAmount = takerAssetFilledAmount;\n fillResults.makerAssetFilledAmount = getPartialAmount(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.makerAssetAmount\n );\n fillResults.makerFeePaid = getPartialAmount(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.makerFee\n );\n fillResults.takerFeePaid = getPartialAmount(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.takerFee\n );\n\n return fillResults;\n }\n\n /// @dev Settles an order by transferring assets between counterparties.\n /// @param order Order struct containing order specifications.\n /// @param takerAddress Address selling takerAsset and buying makerAsset.\n /// @param fillResults Amounts to be filled and fees paid by maker and taker.\n function settleOrder(\n LibOrder.Order memory order,\n address takerAddress,\n LibFillResults.FillResults memory fillResults\n )\n private\n {\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n dispatchTransferFrom(\n order.makerAssetData,\n order.makerAddress,\n takerAddress,\n fillResults.makerAssetFilledAmount\n );\n dispatchTransferFrom(\n order.takerAssetData,\n takerAddress,\n order.makerAddress,\n fillResults.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n zrxAssetData,\n order.makerAddress,\n order.feeRecipientAddress,\n fillResults.makerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n order.feeRecipientAddress,\n fillResults.takerFeePaid\n );\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinMatchOrders.sol": "/*\n Copyright 2018 ZeroEx Intl.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n http://www.apache.org/licenses/LICENSE-2.0\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MMatchOrders.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\n\n\ncontract MixinMatchOrders is\n LibConstants,\n LibMath,\n MAssetProxyDispatcher,\n MExchangeCore,\n MMatchOrders,\n MTransactions\n{\n /// @dev Match two complementary orders that have a profitable spread.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the left order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftSignature Proof that order was created by the left maker.\n /// @param rightSignature Proof that order was created by the right maker.\n /// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.\n function matchOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n bytes memory leftSignature,\n bytes memory rightSignature\n )\n public\n returns (LibFillResults.MatchedFillResults memory matchedFillResults)\n {\n // We assume that rightOrder.takerAssetData == leftOrder.makerAssetData and rightOrder.makerAssetData == leftOrder.takerAssetData.\n // If this assumption isn't true, the match will fail at signature validation.\n rightOrder.makerAssetData = leftOrder.takerAssetData;\n rightOrder.takerAssetData = leftOrder.makerAssetData;\n\n // Get left & right order info\n LibOrder.OrderInfo memory leftOrderInfo = getOrderInfo(leftOrder);\n LibOrder.OrderInfo memory rightOrderInfo = getOrderInfo(rightOrder);\n\n // Fetch taker address\n address takerAddress = getCurrentContextAddress();\n\n // Either our context is valid or we revert\n assertValidMatch(leftOrder, rightOrder);\n\n // Compute proportional fill amounts\n matchedFillResults = calculateMatchedFillResults(\n leftOrder,\n rightOrder,\n leftOrderInfo.orderTakerAssetFilledAmount,\n rightOrderInfo.orderTakerAssetFilledAmount\n );\n\n // Validate fill contexts\n assertValidFill(\n leftOrder,\n leftOrderInfo,\n takerAddress,\n matchedFillResults.left.takerAssetFilledAmount,\n matchedFillResults.left.takerAssetFilledAmount,\n leftSignature\n );\n assertValidFill(\n rightOrder,\n rightOrderInfo,\n takerAddress,\n matchedFillResults.right.takerAssetFilledAmount,\n matchedFillResults.right.takerAssetFilledAmount,\n rightSignature\n );\n\n // Update exchange state\n updateFilledState(\n leftOrder,\n takerAddress,\n leftOrderInfo.orderHash,\n leftOrderInfo.orderTakerAssetFilledAmount,\n matchedFillResults.left\n );\n updateFilledState(\n rightOrder,\n takerAddress,\n rightOrderInfo.orderHash,\n rightOrderInfo.orderTakerAssetFilledAmount,\n matchedFillResults.right\n );\n \n // Settle matched orders. Succeeds or throws.\n settleMatchedOrders(\n leftOrder,\n rightOrder,\n takerAddress,\n matchedFillResults\n );\n\n return matchedFillResults;\n }\n\n /// @dev Validates context for matchOrders. Succeeds or throws.\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n function assertValidMatch(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder\n )\n internal\n pure\n {\n // Make sure there is a profitable spread.\n // There is a profitable spread iff the cost per unit bought (OrderA.MakerAmount/OrderA.TakerAmount) for each order is greater\n // than the profit per unit sold of the matched order (OrderB.TakerAmount/OrderB.MakerAmount).\n // This is satisfied by the equations below:\n // <leftOrder.makerAssetAmount> / <leftOrder.takerAssetAmount> >= <rightOrder.takerAssetAmount> / <rightOrder.makerAssetAmount>\n // AND\n // <rightOrder.makerAssetAmount> / <rightOrder.takerAssetAmount> >= <leftOrder.takerAssetAmount> / <leftOrder.makerAssetAmount>\n // These equations can be combined to get the following:\n require(\n safeMul(leftOrder.makerAssetAmount, rightOrder.makerAssetAmount) >=\n safeMul(leftOrder.takerAssetAmount, rightOrder.takerAssetAmount),\n \"NEGATIVE_SPREAD_REQUIRED\"\n );\n }\n\n /// @dev Calculates fill amounts for the matched orders.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the leftOrder order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftOrderTakerAssetFilledAmount Amount of left order already filled.\n /// @param rightOrderTakerAssetFilledAmount Amount of right order already filled.\n /// @param matchedFillResults Amounts to fill and fees to pay by maker and taker of matched orders.\n function calculateMatchedFillResults(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n uint256 leftOrderTakerAssetFilledAmount,\n uint256 rightOrderTakerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.MatchedFillResults memory matchedFillResults)\n {\n // We settle orders at the exchange rate of the right order.\n // The amount saved by the left maker goes to the taker.\n // Either the left or right order will be fully filled; possibly both.\n // The left order is fully filled iff the right order can sell more than left can buy.\n // That is: the amount required to fill the left order is less than or equal to\n // the amount we can spend from the right order:\n // <leftTakerAssetAmountRemaining> <= <rightTakerAssetAmountRemaining> * <rightMakerToTakerRatio>\n // <leftTakerAssetAmountRemaining> <= <rightTakerAssetAmountRemaining> * <rightOrder.makerAssetAmount> / <rightOrder.takerAssetAmount>\n // <leftTakerAssetAmountRemaining> * <rightOrder.takerAssetAmount> <= <rightTakerAssetAmountRemaining> * <rightOrder.makerAssetAmount>\n uint256 leftTakerAssetAmountRemaining = safeSub(leftOrder.takerAssetAmount, leftOrderTakerAssetFilledAmount);\n uint256 rightTakerAssetAmountRemaining = safeSub(rightOrder.takerAssetAmount, rightOrderTakerAssetFilledAmount);\n uint256 leftTakerAssetFilledAmount;\n uint256 rightTakerAssetFilledAmount;\n if (\n safeMul(leftTakerAssetAmountRemaining, rightOrder.takerAssetAmount) <=\n safeMul(rightTakerAssetAmountRemaining, rightOrder.makerAssetAmount)\n ) {\n // Left order will be fully filled: maximally fill left\n leftTakerAssetFilledAmount = leftTakerAssetAmountRemaining;\n\n // The right order receives an amount proportional to how much was spent.\n rightTakerAssetFilledAmount = getPartialAmount(\n rightOrder.takerAssetAmount,\n rightOrder.makerAssetAmount,\n leftTakerAssetFilledAmount\n );\n } else {\n // Right order will be fully filled: maximally fill right\n rightTakerAssetFilledAmount = rightTakerAssetAmountRemaining;\n\n // The left order receives an amount proportional to how much was spent.\n leftTakerAssetFilledAmount = getPartialAmount(\n rightOrder.makerAssetAmount,\n rightOrder.takerAssetAmount,\n rightTakerAssetFilledAmount\n );\n }\n\n // Calculate fill results for left order\n matchedFillResults.left = calculateFillResults(\n leftOrder,\n leftTakerAssetFilledAmount\n );\n\n // Calculate fill results for right order\n matchedFillResults.right = calculateFillResults(\n rightOrder,\n rightTakerAssetFilledAmount\n );\n\n // Calculate amount given to taker\n matchedFillResults.leftMakerAssetSpreadAmount = safeSub(\n matchedFillResults.left.makerAssetFilledAmount,\n matchedFillResults.right.takerAssetFilledAmount\n );\n\n // Return fill results\n return matchedFillResults;\n }\n\n /// @dev Settles matched order by transferring appropriate funds between order makers, taker, and fee recipient.\n /// @param leftOrder First matched order.\n /// @param rightOrder Second matched order.\n /// @param takerAddress Address that matched the orders. The taker receives the spread between orders as profit.\n /// @param matchedFillResults Struct holding amounts to transfer between makers, taker, and fee recipients.\n function settleMatchedOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n address takerAddress,\n LibFillResults.MatchedFillResults memory matchedFillResults\n )\n private\n {\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n // Order makers and taker\n dispatchTransferFrom(\n leftOrder.makerAssetData,\n leftOrder.makerAddress,\n rightOrder.makerAddress,\n matchedFillResults.right.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n rightOrder.makerAssetData,\n rightOrder.makerAddress,\n leftOrder.makerAddress,\n matchedFillResults.left.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n leftOrder.makerAssetData,\n leftOrder.makerAddress,\n takerAddress,\n matchedFillResults.leftMakerAssetSpreadAmount\n );\n\n // Maker fees\n dispatchTransferFrom(\n zrxAssetData,\n leftOrder.makerAddress,\n leftOrder.feeRecipientAddress,\n matchedFillResults.left.makerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n rightOrder.makerAddress,\n rightOrder.feeRecipientAddress,\n matchedFillResults.right.makerFeePaid\n );\n\n // Taker fees\n if (leftOrder.feeRecipientAddress == rightOrder.feeRecipientAddress) {\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n leftOrder.feeRecipientAddress,\n safeAdd(\n matchedFillResults.left.takerFeePaid,\n matchedFillResults.right.takerFeePaid\n )\n );\n } else {\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n leftOrder.feeRecipientAddress,\n matchedFillResults.left.takerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n rightOrder.feeRecipientAddress,\n matchedFillResults.right.takerFeePaid\n );\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinSignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./interfaces/IWallet.sol\";\nimport \"./interfaces/IValidator.sol\";\n\n\ncontract MixinSignatureValidator is\n MSignatureValidator,\n MTransactions\n{\n using LibBytes for bytes;\n \n // Mapping of hash => signer => signed\n mapping (bytes32 => mapping (address => bool)) public preSigned;\n\n // Mapping of signer => validator => approved\n mapping (address => mapping (address => bool)) public allowedValidators;\n\n /// @dev Approves a hash on-chain using any valid signature type.\n /// After presigning a hash, the preSign signature type will become valid for that hash and signer.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n function preSign(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external\n {\n require(\n isValidSignature(\n hash,\n signerAddress,\n signature\n ),\n \"INVALID_SIGNATURE\"\n );\n preSigned[hash][signerAddress] = true;\n }\n\n /// @dev Approves/unnapproves a Validator contract to verify signatures on signer's behalf.\n /// @param validatorAddress Address of Validator contract.\n /// @param approval Approval or disapproval of Validator contract.\n function setSignatureValidatorApproval(\n address validatorAddress,\n bool approval\n )\n external\n {\n address signerAddress = getCurrentContextAddress();\n allowedValidators[signerAddress][validatorAddress] = approval;\n emit SignatureValidatorApproval(\n signerAddress,\n validatorAddress,\n approval\n );\n }\n\n /// @dev Verifies that a hash has been signed by the given signer.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes memory signature\n )\n public\n view\n returns (bool isValid)\n {\n require(\n signature.length > 0,\n \"LENGTH_GREATER_THAN_0_REQUIRED\"\n );\n\n // Pop last byte off of signature byte array.\n uint8 signatureTypeRaw = uint8(signature.popLastByte());\n\n // Ensure signature is supported\n require(\n signatureTypeRaw < uint8(SignatureType.NSignatureTypes),\n \"SIGNATURE_UNSUPPORTED\"\n );\n\n SignatureType signatureType = SignatureType(signatureTypeRaw);\n\n // Variables are not scoped in Solidity.\n uint8 v;\n bytes32 r;\n bytes32 s;\n address recovered;\n\n // Always illegal signature.\n // This is always an implicit option since a signer can create a\n // signature array with invalid type or length. We may as well make\n // it an explicit option. This aids testing and analysis. It is\n // also the initialization value for the enum type.\n if (signatureType == SignatureType.Illegal) {\n revert(\"SIGNATURE_ILLEGAL\");\n\n // Always invalid signature.\n // Like Illegal, this is always implicitly available and therefore\n // offered explicitly. It can be implicitly created by providing\n // a correctly formatted but incorrect signature.\n } else if (signatureType == SignatureType.Invalid) {\n require(\n signature.length == 0,\n \"LENGTH_0_REQUIRED\"\n );\n isValid = false;\n return isValid;\n\n // Signature using EIP712\n } else if (signatureType == SignatureType.EIP712) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n hash,\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n\n // Signed using web3.eth_sign\n } else if (signatureType == SignatureType.EthSign) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n keccak256(abi.encodePacked(\n \"\\x19Ethereum Signed Message:\\n32\",\n hash\n )),\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n\n // Implicitly signed by caller.\n // The signer has initiated the call. In the case of non-contract\n // accounts it means the transaction itself was signed.\n // Example: let's say for a particular operation three signatures\n // A, B and C are required. To submit the transaction, A and B can\n // give a signature to C, who can then submit the transaction using\n // `Caller` for his own signature. Or A and C can sign and B can\n // submit using `Caller`. Having `Caller` allows this flexibility.\n } else if (signatureType == SignatureType.Caller) {\n require(\n signature.length == 0,\n \"LENGTH_0_REQUIRED\"\n );\n isValid = signerAddress == msg.sender;\n return isValid;\n\n // Signature verified by wallet contract.\n // If used with an order, the maker of the order is the wallet contract.\n } else if (signatureType == SignatureType.Wallet) {\n isValid = IWallet(signerAddress).isValidSignature(hash, signature);\n return isValid;\n\n // Signature verified by validator contract.\n // If used with an order, the maker of the order can still be an EOA.\n // A signature using this type should be encoded as:\n // | Offset | Length | Contents |\n // | 0x00 | x | Signature to validate |\n // | 0x00 + x | 20 | Address of validator contract |\n // | 0x14 + x | 1 | Signature type is always \"\\x06\" |\n } else if (signatureType == SignatureType.Validator) {\n // Pop last 20 bytes off of signature byte array.\n address validatorAddress = signature.popLast20Bytes();\n \n // Ensure signer has approved validator.\n if (!allowedValidators[signerAddress][validatorAddress]) {\n return false;\n }\n isValid = IValidator(validatorAddress).isValidSignature(\n hash,\n signerAddress,\n signature\n );\n return isValid;\n\n // Signer signed hash previously using the preSign function.\n } else if (signatureType == SignatureType.PreSigned) {\n isValid = preSigned[hash][signerAddress];\n return isValid;\n\n // Signature from Trezor hardware wallet.\n // It differs from web3.eth_sign in the encoding of message length\n // (Bitcoin varint encoding vs ascii-decimal, the latter is not\n // self-terminating which leads to ambiguities).\n // See also:\n // https://en.bitcoin.it/wiki/Protocol_documentation#Variable_length_integer\n // https://github.com/trezor/trezor-mcu/blob/master/firmware/ethereum.c#L602\n // https://github.com/trezor/trezor-mcu/blob/master/firmware/crypto.c#L36\n } else if (signatureType == SignatureType.Trezor) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n keccak256(abi.encodePacked(\n \"\\x19Ethereum Signed Message:\\n\\x20\",\n hash\n )),\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n }\n\n // Anything else is illegal (We do not return false because\n // the signature may actually be valid, just not in a format\n // that we currently support. In this case returning false\n // may lead the caller to incorrectly believe that the\n // signature was invalid.)\n revert(\"SIGNATURE_UNSUPPORTED\");\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinTransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\nimport \"./libs/LibExchangeErrors.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./libs/LibEIP712.sol\";\n\n\ncontract MixinTransactions is\n LibEIP712,\n MSignatureValidator,\n MTransactions\n{\n\n // Mapping of transaction hash => executed\n // This prevents transactions from being executed more than once.\n mapping (bytes32 => bool) public transactions;\n\n // Address of current transaction signer\n address public currentContextAddress;\n\n // Hash for the EIP712 ZeroEx Transaction Schema\n bytes32 constant internal EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"ZeroExTransaction(\",\n \"uint256 salt,\",\n \"address signerAddress,\",\n \"bytes data\",\n \")\"\n ));\n\n /// @dev Executes an exchange method call in the context of signer.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @param signature Proof of signer transaction by signer.\n function executeTransaction(\n uint256 salt,\n address signerAddress,\n bytes data,\n bytes signature\n )\n external\n {\n // Prevent reentrancy\n require(\n currentContextAddress == address(0),\n \"REENTRANCY_ILLEGAL\"\n );\n\n bytes32 transactionHash = hashEIP712Message(hashZeroExTransaction(\n salt,\n signerAddress,\n data\n ));\n\n // Validate transaction has not been executed\n require(\n !transactions[transactionHash],\n \"INVALID_TX_HASH\"\n );\n\n // Transaction always valid if signer is sender of transaction\n if (signerAddress != msg.sender) {\n // Validate signature\n require(\n isValidSignature(\n transactionHash,\n signerAddress,\n signature\n ),\n \"INVALID_TX_SIGNATURE\"\n );\n\n // Set the current transaction signer\n currentContextAddress = signerAddress;\n }\n\n // Execute transaction\n transactions[transactionHash] = true;\n require(\n address(this).delegatecall(data),\n \"FAILED_EXECUTION\"\n );\n\n // Reset current transaction signer if it was previously updated\n if (signerAddress != msg.sender) {\n currentContextAddress = address(0);\n }\n }\n\n /// @dev Calculates EIP712 hash of the Transaction.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @return EIP712 hash of the Transaction.\n function hashZeroExTransaction(\n uint256 salt,\n address signerAddress,\n bytes memory data\n )\n internal\n pure\n returns (bytes32 result)\n {\n bytes32 schemaHash = EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH;\n bytes32 dataHash = keccak256(data);\n\n // Assembly for more efficiently computing:\n // keccak256(abi.encodePacked(\n // EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH,\n // salt,\n // bytes32(signerAddress),\n // keccak256(data)\n // ));\n\n assembly {\n // Load free memory pointer\n let memPtr := mload(64)\n\n mstore(memPtr, schemaHash) // hash of schema\n mstore(add(memPtr, 32), salt) // salt\n mstore(add(memPtr, 64), and(signerAddress, 0xffffffffffffffffffffffffffffffffffffffff)) // signerAddress\n mstore(add(memPtr, 96), dataHash) // hash of data\n\n // Compute hash\n result := keccak256(memPtr, 128)\n }\n return result;\n }\n\n /// @dev The current function will be called in the context of this address (either 0x transaction signer or `msg.sender`).\n /// If calling a fill function, this address will represent the taker.\n /// If calling a cancel function, this address will represent the maker.\n /// @return Signer of 0x transaction if entry point is `executeTransaction`.\n /// `msg.sender` if entry point is any other function.\n function getCurrentContextAddress()\n internal\n view\n returns (address)\n {\n address contextAddress = currentContextAddress == address(0) ? msg.sender : currentContextAddress;\n return contextAddress;\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibMath.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./libs/LibAbiEncoder.sol\";\nimport \"./mixins/MExchangeCore.sol\";\n\n\ncontract MixinWrapperFunctions is\n LibMath,\n LibFillResults,\n LibAbiEncoder,\n MExchangeCore\n{\n\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n require(\n fillResults.takerAssetFilledAmount == takerAssetFillAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return fillResults;\n }\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (FillResults memory fillResults)\n {\n // ABI encode calldata for `fillOrder`\n bytes memory fillOrderCalldata = abiEncodeFillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n\n // Delegate to `fillOrder` and handle any exceptions gracefully\n assembly {\n let success := delegatecall(\n gas, // forward all gas, TODO: look into gas consumption of assert/throw\n address, // call address of this contract\n add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes)\n mload(fillOrderCalldata), // length of input\n fillOrderCalldata, // write output over input\n 128 // output size is 128 bytes\n )\n switch success\n case 0 {\n mstore(fillResults, 0)\n mstore(add(fillResults, 32), 0)\n mstore(add(fillResults, 64), 0)\n mstore(add(fillResults, 96), 0)\n }\n case 1 {\n mstore(fillResults, mload(fillOrderCalldata))\n mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32)))\n mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64)))\n mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96)))\n }\n }\n return fillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrder(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrKill.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrKillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrKillOrder(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrders(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory takerAssetData = orders[0].takerAssetData;\n \n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being sold by taker is the same for each order.\n // Rather than passing this in as calldata, we use the takerAssetData from the first order in all later orders.\n orders[i].takerAssetData = takerAssetData;\n\n // Calculate the remaining amount of takerAsset to sell\n uint256 remainingTakerAssetFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrder(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= takerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory takerAssetData = orders[0].takerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being sold by taker is the same for each order.\n // Rather than passing this in as calldata, we use the takerAssetData from the first order in all later orders.\n orders[i].takerAssetData = takerAssetData;\n\n // Calculate the remaining amount of takerAsset to sell\n uint256 remainingTakerAssetFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= takerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerAsset is bought by taker.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrders(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // Rather than passing this in as calldata, we copy the makerAssetData from the first order onto all later orders.\n orders[i].makerAssetData = makerAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmount(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrder(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n if (totalFillResults.makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // Rather than passing this in as calldata, we copy the makerAssetData from the first order onto all later orders.\n orders[i].makerAssetData = makerAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmount(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n if (totalFillResults.makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously cancels multiple orders in a single transaction.\n /// @param orders Array of order specifications.\n function batchCancelOrders(LibOrder.Order[] memory orders)\n public\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n cancelOrder(orders[i]);\n }\n }\n\n /// @dev Fetches information for all passed in orders.\n /// @param orders Array of order specifications.\n /// @return Array of OrderInfo instances that correspond to each order.\n function getOrdersInfo(LibOrder.Order[] memory orders)\n public\n view\n returns (LibOrder.OrderInfo[] memory)\n {\n uint256 ordersLength = orders.length;\n LibOrder.OrderInfo[] memory ordersInfo = new LibOrder.OrderInfo[](ordersLength);\n for (uint256 i = 0; i != ordersLength; i++) {\n ordersInfo[i] = getOrderInfo(orders[i]);\n }\n return ordersInfo;\n }\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IAssetProxyDispatcher {\n\n /// @dev Registers an asset proxy to its asset proxy id.\n /// Once an asset proxy is registered, it cannot be unregistered.\n /// @param assetProxy Address of new asset proxy to register.\n function registerAssetProxy(address assetProxy)\n external;\n\n /// @dev Gets an asset proxy.\n /// @param assetProxyId Id of the asset proxy.\n /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered.\n function getAssetProxy(bytes4 assetProxyId)\n external\n view\n returns (address);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IExchange.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./IExchangeCore.sol\";\nimport \"./IMatchOrders.sol\";\nimport \"./ISignatureValidator.sol\";\nimport \"./ITransactions.sol\";\nimport \"./IAssetProxyDispatcher.sol\";\nimport \"./IWrapperFunctions.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract IExchange is\n IExchangeCore,\n IMatchOrders,\n ISignatureValidator,\n ITransactions,\n IAssetProxyDispatcher,\n IWrapperFunctions\n{}\n",
- "2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IExchangeCore {\n\n /// @dev Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch\n /// and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress).\n /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled.\n function cancelOrdersUpTo(uint256 targetOrderEpoch)\n external;\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev After calling, the order can not be filled anymore.\n /// @param order Order struct containing order specifications.\n function cancelOrder(LibOrder.Order memory order)\n public;\n\n /// @dev Gets information about an order: status, hash, and amount filled.\n /// @param order Order to gather information on.\n /// @return OrderInfo Information about the order and its state.\n /// See LibOrder.OrderInfo for a complete description.\n function getOrderInfo(LibOrder.Order memory order)\n public\n view\n returns (LibOrder.OrderInfo memory orderInfo);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IMatchOrders {\n\n /// @dev Match two complementary orders that have a profitable spread.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the left order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftSignature Proof that order was created by the left maker.\n /// @param rightSignature Proof that order was created by the right maker.\n /// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.\n function matchOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n bytes memory leftSignature,\n bytes memory rightSignature\n )\n public\n returns (LibFillResults.MatchedFillResults memory matchedFillResults);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract ISignatureValidator {\n\n /// @dev Approves a hash on-chain using any valid signature type.\n /// After presigning a hash, the preSign signature type will become valid for that hash and signer.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n function preSign(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external;\n \n /// @dev Approves/unnapproves a Validator contract to verify signatures on signer's behalf.\n /// @param validatorAddress Address of Validator contract.\n /// @param approval Approval or disapproval of Validator contract.\n function setSignatureValidatorApproval(\n address validatorAddress,\n bool approval\n )\n external;\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signerAddress Address of signer.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes memory signature\n )\n public\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/ITransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\n\ncontract ITransactions {\n\n /// @dev Executes an exchange method call in the context of signer.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @param signature Proof of signer transaction by signer.\n function executeTransaction(\n uint256 salt,\n address signerAddress,\n bytes data,\n bytes signature\n )\n external;\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IValidator {\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IWallet.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IWallet {\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n bytes signature\n )\n external\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IWrapperFunctions {\n\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrKill.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrKillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrders(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerAsset is bought by taker.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrders(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously cancels multiple orders in a single transaction.\n /// @param orders Array of order specifications.\n function batchCancelOrders(LibOrder.Order[] memory orders)\n public;\n\n /// @dev Fetches information for all passed in orders\n /// @param orders Array of order specifications.\n /// @return Array of OrderInfo instances that correspond to each order.\n function getOrdersInfo(LibOrder.Order[] memory orders)\n public\n view\n returns (LibOrder.OrderInfo[] memory);\n}\n",
- "2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./LibOrder.sol\";\n\n\ncontract LibAbiEncoder {\n\n /// @dev ABI encodes calldata for `fillOrder`.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return ABI encoded calldata for `fillOrder`.\n function abiEncodeFillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n pure\n returns (bytes memory fillOrderCalldata)\n {\n // We need to call MExchangeCore.fillOrder using a delegatecall in\n // assembly so that we can intercept a call that throws. For this, we\n // need the input encoded in memory in the Ethereum ABIv2 format [1].\n\n // | Area | Offset | Length | Contents |\n // | -------- |--------|---------|-------------------------------------------- |\n // | Header | 0x00 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 0x00 | | 1. offset to order (*) |\n // | | 0x20 | | 2. takerAssetFillAmount |\n // | | 0x40 | | 3. offset to signature (*) |\n // | Data | | 12 * 32 | order: |\n // | | 0x000 | | 1. senderAddress |\n // | | 0x020 | | 2. makerAddress |\n // | | 0x040 | | 3. takerAddress |\n // | | 0x060 | | 4. feeRecipientAddress |\n // | | 0x080 | | 5. makerAssetAmount |\n // | | 0x0A0 | | 6. takerAssetAmount |\n // | | 0x0C0 | | 7. makerFeeAmount |\n // | | 0x0E0 | | 8. takerFeeAmount |\n // | | 0x100 | | 9. expirationTimeSeconds |\n // | | 0x120 | | 10. salt |\n // | | 0x140 | | 11. Offset to makerAssetData (*) |\n // | | 0x160 | | 12. Offset to takerAssetData (*) |\n // | | 0x180 | 32 | makerAssetData Length |\n // | | 0x1A0 | ** | makerAssetData Contents |\n // | | 0x1C0 | 32 | takerAssetData Length |\n // | | 0x1E0 | ** | takerAssetData Contents |\n // | | 0x200 | 32 | signature Length |\n // | | 0x220 | ** | signature Contents |\n\n // * Offsets are calculated from the beginning of the current area: Header, Params, Data:\n // An offset stored in the Params area is calculated from the beginning of the Params section.\n // An offset stored in the Data area is calculated from the beginning of the Data section.\n\n // ** The length of dynamic array contents are stored in the field immediately preceeding the contents.\n\n // [1]: https://solidity.readthedocs.io/en/develop/abi-spec.html\n\n assembly {\n\n // Areas below may use the following variables:\n // 1. <area>Start -- Start of this area in memory\n // 2. <area>End -- End of this area in memory. This value may\n // be precomputed (before writing contents),\n // or it may be computed as contents are written.\n // 3. <area>Offset -- Current offset into area. If an area's End\n // is precomputed, this variable tracks the\n // offsets of contents as they are written.\n\n /////// Setup Header Area ///////\n // Load free memory pointer\n fillOrderCalldata := mload(0x40)\n // bytes4(keccak256(\"fillOrder((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),uint256,bytes)\"))\n // = 0xb4be83d5\n // Leave 0x20 bytes to store the length\n mstore(add(fillOrderCalldata, 0x20), 0xb4be83d500000000000000000000000000000000000000000000000000000000)\n let headerAreaEnd := add(fillOrderCalldata, 0x24)\n\n /////// Setup Params Area ///////\n // This area is preallocated and written to later.\n // This is because we need to fill in offsets that have not yet been calculated.\n let paramsAreaStart := headerAreaEnd\n let paramsAreaEnd := add(paramsAreaStart, 0x60)\n let paramsAreaOffset := paramsAreaStart\n\n /////// Setup Data Area ///////\n let dataAreaStart := paramsAreaEnd\n let dataAreaEnd := dataAreaStart\n\n // Offset from the source data we're reading from\n let sourceOffset := order\n // arrayLenBytes and arrayLenWords track the length of a dynamically-allocated bytes array.\n let arrayLenBytes := 0\n let arrayLenWords := 0\n\n /////// Write order Struct ///////\n // Write memory location of Order, relative to the start of the\n // parameter list, then increment the paramsAreaOffset respectively.\n mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))\n paramsAreaOffset := add(paramsAreaOffset, 0x20)\n\n // Write values for each field in the order\n // It would be nice to use a loop, but we save on gas by writing\n // the stores sequentially.\n mstore(dataAreaEnd, mload(sourceOffset)) // makerAddress\n mstore(add(dataAreaEnd, 0x20), mload(add(sourceOffset, 0x20))) // takerAddress\n mstore(add(dataAreaEnd, 0x40), mload(add(sourceOffset, 0x40))) // feeRecipientAddress\n mstore(add(dataAreaEnd, 0x60), mload(add(sourceOffset, 0x60))) // senderAddress\n mstore(add(dataAreaEnd, 0x80), mload(add(sourceOffset, 0x80))) // makerAssetAmount\n mstore(add(dataAreaEnd, 0xA0), mload(add(sourceOffset, 0xA0))) // takerAssetAmount\n mstore(add(dataAreaEnd, 0xC0), mload(add(sourceOffset, 0xC0))) // makerFeeAmount\n mstore(add(dataAreaEnd, 0xE0), mload(add(sourceOffset, 0xE0))) // takerFeeAmount\n mstore(add(dataAreaEnd, 0x100), mload(add(sourceOffset, 0x100))) // expirationTimeSeconds\n mstore(add(dataAreaEnd, 0x120), mload(add(sourceOffset, 0x120))) // salt\n mstore(add(dataAreaEnd, 0x140), mload(add(sourceOffset, 0x140))) // Offset to makerAssetData\n mstore(add(dataAreaEnd, 0x160), mload(add(sourceOffset, 0x160))) // Offset to takerAssetData\n dataAreaEnd := add(dataAreaEnd, 0x180)\n sourceOffset := add(sourceOffset, 0x180)\n\n // Write offset to <order.makerAssetData>\n mstore(add(dataAreaStart, mul(10, 0x20)), sub(dataAreaEnd, dataAreaStart))\n\n // Calculate length of <order.makerAssetData>\n sourceOffset := mload(add(order, 0x140)) // makerAssetData\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of <order.makerAssetData>\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of <order.makerAssetData>\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n // Write offset to <order.takerAssetData>\n mstore(add(dataAreaStart, mul(11, 0x20)), sub(dataAreaEnd, dataAreaStart))\n\n // Calculate length of <order.takerAssetData>\n sourceOffset := mload(add(order, 0x160)) // takerAssetData\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of <order.takerAssetData>\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of <order.takerAssetData>\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n /////// Write takerAssetFillAmount ///////\n mstore(paramsAreaOffset, takerAssetFillAmount)\n paramsAreaOffset := add(paramsAreaOffset, 0x20)\n\n /////// Write signature ///////\n // Write offset to paramsArea\n mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))\n\n // Calculate length of signature\n sourceOffset := signature\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of signature\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of signature\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n // Set length of calldata\n mstore(fillOrderCalldata, sub(dataAreaEnd, add(fillOrderCalldata, 0x20)))\n\n // Increment free memory pointer\n mstore(0x40, dataAreaEnd)\n }\n\n return fillOrderCalldata;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibConstants.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\n// solhint-disable max-line-length\ncontract LibConstants {\n \n // Asset data for ZRX token. Used for fee transfers.\n // @TODO: Hardcode constant when we deploy. Currently \n // not constant to make testing easier.\n\n // The proxyId for ZRX_ASSET_DATA is bytes4(keccak256(\"ERC20Token(address)\")) = 0xf47261b0\n \n // Kovan ZRX address is 0x6ff6c0ff1d68b964901f986d4c9fa3ac68346570.\n // The ABI encoded proxyId and address is 0xf47261b00000000000000000000000006ff6c0ff1d68b964901f986d4c9fa3ac68346570\n // bytes constant public ZRX_ASSET_DATA = \"\\xf4\\x72\\x61\\xb0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x6f\\xf6\\xc0\\xff\\x1d\\x68\\xb9\\x64\\x90\\x1f\\x98\\x6d\\x4c\\x9f\\xa3\\xac\\x68\\x34\\x65\\x70\";\n \n // Mainnet ZRX address is 0xe41d2489571d322189246dafa5ebde1f4699f498.\n // The ABI encoded proxyId and address is 0xf47261b0000000000000000000000000e41d2489571d322189246dafa5ebde1f4699f498\n // bytes constant public ZRX_ASSET_DATA = \"\\xf4\\x72\\x61\\xb0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xe4\\x1d\\x24\\x89\\x57\\x1d\\x32\\x21\\x89\\x24\\x6d\\xaf\\xa5\\xeb\\xde\\x1f\\x46\\x99\\xf4\\x98\";\n \n // solhint-disable-next-line var-name-mixedcase\n bytes public ZRX_ASSET_DATA;\n\n // @TODO: Remove when we deploy.\n constructor (bytes memory zrxAssetData)\n public\n {\n ZRX_ASSET_DATA = zrxAssetData;\n }\n}\n// solhint-enable max-line-length\n",
- "2.0.0/protocol/Exchange/libs/LibEIP712.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract LibEIP712 {\n // EIP191 header for EIP712 prefix\n string constant internal EIP191_HEADER = \"\\x19\\x01\";\n\n // EIP712 Domain Name value\n string constant internal EIP712_DOMAIN_NAME = \"0x Protocol\";\n\n // EIP712 Domain Version value\n string constant internal EIP712_DOMAIN_VERSION = \"2\";\n\n // Hash of the EIP712 Domain Separator Schema\n bytes32 constant internal EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"EIP712Domain(\",\n \"string name,\",\n \"string version,\",\n \"address verifyingContract\",\n \")\"\n ));\n\n // Hash of the EIP712 Domain Separator data\n // solhint-disable-next-line var-name-mixedcase\n bytes32 public EIP712_DOMAIN_HASH;\n\n constructor ()\n public\n {\n EIP712_DOMAIN_HASH = keccak256(abi.encodePacked(\n EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH,\n keccak256(bytes(EIP712_DOMAIN_NAME)),\n keccak256(bytes(EIP712_DOMAIN_VERSION)),\n bytes32(address(this))\n ));\n }\n\n /// @dev Calculates EIP712 encoding for a hash struct in this EIP712 Domain.\n /// @param hashStruct The EIP712 hash struct.\n /// @return EIP712 hash applied to this EIP712 Domain.\n function hashEIP712Message(bytes32 hashStruct)\n internal\n view\n returns (bytes32 result)\n {\n bytes32 eip712DomainHash = EIP712_DOMAIN_HASH;\n\n // Assembly for more efficient computing:\n // keccak256(abi.encodePacked(\n // EIP191_HEADER,\n // EIP712_DOMAIN_HASH,\n // hashStruct \n // ));\n\n assembly {\n // Load free memory pointer\n let memPtr := mload(64)\n\n mstore(memPtr, 0x1901000000000000000000000000000000000000000000000000000000000000) // EIP191 header\n mstore(add(memPtr, 2), eip712DomainHash) // EIP712 domain hash\n mstore(add(memPtr, 34), hashStruct) // Hash of struct\n\n // Compute hash\n result := keccak256(memPtr, 66)\n }\n return result;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\n// solhint-disable\npragma solidity 0.4.24;\n\n\n/// @dev This contract documents the revert reasons used in the Exchange contract.\n/// This contract is intended to serve as a reference, but is not actually used for efficiency reasons.\ncontract LibExchangeErrors {\n\n /// Order validation errors ///\n string constant ORDER_UNFILLABLE = \"ORDER_UNFILLABLE\"; // Order cannot be filled.\n string constant INVALID_MAKER = \"INVALID_MAKER\"; // Invalid makerAddress.\n string constant INVALID_TAKER = \"INVALID_TAKER\"; // Invalid takerAddress.\n string constant INVALID_SENDER = \"INVALID_SENDER\"; // Invalid `msg.sender`.\n string constant INVALID_ORDER_SIGNATURE = \"INVALID_ORDER_SIGNATURE\"; // Signature validation failed. \n \n /// fillOrder validation errors ///\n string constant INVALID_TAKER_AMOUNT = \"INVALID_TAKER_AMOUNT\"; // takerAssetFillAmount cannot equal 0.\n string constant ROUNDING_ERROR = \"ROUNDING_ERROR\"; // Rounding error greater than 0.1% of takerAssetFillAmount. \n \n /// Signature validation errors ///\n string constant INVALID_SIGNATURE = \"INVALID_SIGNATURE\"; // Signature validation failed. \n string constant SIGNATURE_ILLEGAL = \"SIGNATURE_ILLEGAL\"; // Signature type is illegal.\n string constant SIGNATURE_UNSUPPORTED = \"SIGNATURE_UNSUPPORTED\"; // Signature type unsupported.\n \n /// cancelOrdersUptTo errors ///\n string constant INVALID_NEW_ORDER_EPOCH = \"INVALID_NEW_ORDER_EPOCH\"; // Specified salt must be greater than or equal to existing orderEpoch.\n\n /// fillOrKillOrder errors ///\n string constant COMPLETE_FILL_FAILED = \"COMPLETE_FILL_FAILED\"; // Desired takerAssetFillAmount could not be completely filled. \n\n /// matchOrders errors ///\n string constant NEGATIVE_SPREAD_REQUIRED = \"NEGATIVE_SPREAD_REQUIRED\"; // Matched orders must have a negative spread.\n\n /// Transaction errors ///\n string constant REENTRANCY_ILLEGAL = \"REENTRANCY_ILLEGAL\"; // Recursive reentrancy is not allowed. \n string constant INVALID_TX_HASH = \"INVALID_TX_HASH\"; // Transaction has already been executed. \n string constant INVALID_TX_SIGNATURE = \"INVALID_TX_SIGNATURE\"; // Signature validation failed. \n string constant FAILED_EXECUTION = \"FAILED_EXECUTION\"; // Transaction execution failed. \n \n /// registerAssetProxy errors ///\n string constant ASSET_PROXY_ALREADY_EXISTS = \"ASSET_PROXY_ALREADY_EXISTS\"; // AssetProxy with same id already exists.\n\n /// dispatchTransferFrom errors ///\n string constant ASSET_PROXY_DOES_NOT_EXIST = \"ASSET_PROXY_DOES_NOT_EXIST\"; // No assetProxy registered at given id.\n string constant TRANSFER_FAILED = \"TRANSFER_FAILED\"; // Asset transfer unsuccesful.\n\n /// Length validation errors ///\n string constant LENGTH_GREATER_THAN_0_REQUIRED = \"LENGTH_GREATER_THAN_0_REQUIRED\"; // Byte array must have a length greater than 0.\n string constant LENGTH_GREATER_THAN_3_REQUIRED = \"LENGTH_GREATER_THAN_3_REQUIRED\"; // Byte array must have a length greater than 3.\n string constant LENGTH_0_REQUIRED = \"LENGTH_0_REQUIRED\"; // Byte array must have a length of 0.\n string constant LENGTH_65_REQUIRED = \"LENGTH_65_REQUIRED\"; // Byte array must have a length of 65.\n}\n",
- "2.0.0/protocol/Exchange/libs/LibFillResults.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract LibFillResults is\n SafeMath\n{\n\n struct FillResults {\n uint256 makerAssetFilledAmount; // Total amount of makerAsset(s) filled.\n uint256 takerAssetFilledAmount; // Total amount of takerAsset(s) filled.\n uint256 makerFeePaid; // Total amount of ZRX paid by maker(s) to feeRecipient(s).\n uint256 takerFeePaid; // Total amount of ZRX paid by taker to feeRecipients(s).\n }\n\n struct MatchedFillResults {\n FillResults left; // Amounts filled and fees paid of left order.\n FillResults right; // Amounts filled and fees paid of right order.\n uint256 leftMakerAssetSpreadAmount; // Spread between price of left and right order, denominated in the left order's makerAsset, paid to taker.\n }\n\n /// @dev Adds properties of both FillResults instances.\n /// Modifies the first FillResults instance specified.\n /// @param totalFillResults Fill results instance that will be added onto.\n /// @param singleFillResults Fill results instance that will be added to totalFillResults.\n function addFillResults(FillResults memory totalFillResults, FillResults memory singleFillResults)\n internal\n pure\n {\n totalFillResults.makerAssetFilledAmount = safeAdd(totalFillResults.makerAssetFilledAmount, singleFillResults.makerAssetFilledAmount);\n totalFillResults.takerAssetFilledAmount = safeAdd(totalFillResults.takerAssetFilledAmount, singleFillResults.takerAssetFilledAmount);\n totalFillResults.makerFeePaid = safeAdd(totalFillResults.makerFeePaid, singleFillResults.makerFeePaid);\n totalFillResults.takerFeePaid = safeAdd(totalFillResults.takerFeePaid, singleFillResults.takerFeePaid);\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibMath.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract LibMath is\n SafeMath\n{\n\n /// @dev Calculates partial value given a numerator and denominator.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target.\n function getPartialAmount(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n partialAmount = safeDiv(\n safeMul(numerator, target),\n denominator\n );\n return partialAmount;\n }\n\n /// @dev Checks if rounding error > 0.1%.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to multiply with numerator/denominator.\n /// @return Rounding error is present.\n function isRoundingError(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (bool isError)\n {\n uint256 remainder = mulmod(target, numerator, denominator);\n if (remainder == 0) {\n return false; // No rounding error.\n }\n\n uint256 errPercentageTimes1000000 = safeDiv(\n safeMul(remainder, 1000000),\n safeMul(numerator, target)\n );\n isError = errPercentageTimes1000000 > 1000;\n return isError;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibOrder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./LibEIP712.sol\";\n\n\ncontract LibOrder is\n LibEIP712\n{\n\n // Hash for the EIP712 Order Schema\n bytes32 constant internal EIP712_ORDER_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"Order(\",\n \"address makerAddress,\",\n \"address takerAddress,\",\n \"address feeRecipientAddress,\",\n \"address senderAddress,\",\n \"uint256 makerAssetAmount,\",\n \"uint256 takerAssetAmount,\",\n \"uint256 makerFee,\",\n \"uint256 takerFee,\",\n \"uint256 expirationTimeSeconds,\",\n \"uint256 salt,\",\n \"bytes makerAssetData,\",\n \"bytes takerAssetData\",\n \")\"\n ));\n\n // A valid order remains fillable until it is expired, fully filled, or cancelled.\n // An order's state is unaffected by external factors, like account balances.\n enum OrderStatus {\n INVALID, // Default value\n INVALID_MAKER_ASSET_AMOUNT, // Order does not have a valid maker asset amount\n INVALID_TAKER_ASSET_AMOUNT, // Order does not have a valid taker asset amount\n FILLABLE, // Order is fillable\n EXPIRED, // Order has already expired\n FULLY_FILLED, // Order is fully filled\n CANCELLED // Order has been cancelled\n }\n\n // solhint-disable max-line-length\n struct Order {\n address makerAddress; // Address that created the order. \n address takerAddress; // Address that is allowed to fill the order. If set to 0, any address is allowed to fill the order. \n address feeRecipientAddress; // Address that will recieve fees when order is filled. \n address senderAddress; // Address that is allowed to call Exchange contract methods that affect this order. If set to 0, any address is allowed to call these methods.\n uint256 makerAssetAmount; // Amount of makerAsset being offered by maker. Must be greater than 0. \n uint256 takerAssetAmount; // Amount of takerAsset being bid on by maker. Must be greater than 0. \n uint256 makerFee; // Amount of ZRX paid to feeRecipient by maker when order is filled. If set to 0, no transfer of ZRX from maker to feeRecipient will be attempted.\n uint256 takerFee; // Amount of ZRX paid to feeRecipient by taker when order is filled. If set to 0, no transfer of ZRX from taker to feeRecipient will be attempted.\n uint256 expirationTimeSeconds; // Timestamp in seconds at which order expires. \n uint256 salt; // Arbitrary number to facilitate uniqueness of the order's hash. \n bytes makerAssetData; // Encoded data that can be decoded by a specified proxy contract when transferring makerAsset. The last byte references the id of this proxy.\n bytes takerAssetData; // Encoded data that can be decoded by a specified proxy contract when transferring takerAsset. The last byte references the id of this proxy.\n }\n // solhint-enable max-line-length\n\n struct OrderInfo {\n uint8 orderStatus; // Status that describes order's validity and fillability.\n bytes32 orderHash; // EIP712 hash of the order (see LibOrder.getOrderHash).\n uint256 orderTakerAssetFilledAmount; // Amount of order that has already been filled.\n }\n\n /// @dev Calculates Keccak-256 hash of the order.\n /// @param order The order structure.\n /// @return Keccak-256 EIP712 hash of the order.\n function getOrderHash(Order memory order)\n internal\n view\n returns (bytes32 orderHash)\n {\n orderHash = hashEIP712Message(hashOrder(order));\n return orderHash;\n }\n\n /// @dev Calculates EIP712 hash of the order.\n /// @param order The order structure.\n /// @return EIP712 hash of the order.\n function hashOrder(Order memory order)\n internal\n pure\n returns (bytes32 result)\n {\n bytes32 schemaHash = EIP712_ORDER_SCHEMA_HASH;\n bytes32 makerAssetDataHash = keccak256(order.makerAssetData);\n bytes32 takerAssetDataHash = keccak256(order.takerAssetData);\n\n // Assembly for more efficiently computing:\n // keccak256(abi.encodePacked(\n // EIP712_ORDER_SCHEMA_HASH,\n // bytes32(order.makerAddress),\n // bytes32(order.takerAddress),\n // bytes32(order.feeRecipientAddress),\n // bytes32(order.senderAddress),\n // order.makerAssetAmount,\n // order.takerAssetAmount,\n // order.makerFee,\n // order.takerFee,\n // order.expirationTimeSeconds,\n // order.salt,\n // keccak256(order.makerAssetData),\n // keccak256(order.takerAssetData)\n // ));\n\n assembly {\n // Calculate memory addresses that will be swapped out before hashing\n let pos1 := sub(order, 32)\n let pos2 := add(order, 320)\n let pos3 := add(order, 352)\n\n // Backup\n let temp1 := mload(pos1)\n let temp2 := mload(pos2)\n let temp3 := mload(pos3)\n \n // Hash in place\n mstore(pos1, schemaHash)\n mstore(pos2, makerAssetDataHash)\n mstore(pos3, takerAssetDataHash)\n result := keccak256(pos1, 416)\n \n // Restore\n mstore(pos1, temp1)\n mstore(pos2, temp2)\n mstore(pos3, temp3)\n }\n return result;\n }\n}\n",
- "2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAssetProxyDispatcher.sol\";\n\n\ncontract MAssetProxyDispatcher is\n IAssetProxyDispatcher\n{\n\n // Logs registration of new asset proxy\n event AssetProxyRegistered(\n bytes4 id, // Id of new registered AssetProxy.\n address assetProxy // Address of new registered AssetProxy.\n );\n\n /// @dev Forwards arguments to assetProxy and calls `transferFrom`. Either succeeds or throws.\n /// @param assetData Byte array encoded for the asset.\n /// @param from Address to transfer token from.\n /// @param to Address to transfer token to.\n /// @param amount Amount of token to transfer.\n function dispatchTransferFrom(\n bytes memory assetData,\n address from,\n address to,\n uint256 amount\n )\n internal;\n}\n",
- "2.0.0/protocol/Exchange/mixins/MExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IExchangeCore.sol\";\n\n\ncontract MExchangeCore is\n IExchangeCore\n{\n // Fill event is emitted whenever an order is filled.\n event Fill(\n address indexed makerAddress, // Address that created the order. \n address indexed feeRecipientAddress, // Address that received fees.\n address takerAddress, // Address that filled the order.\n address senderAddress, // Address that called the Exchange contract (msg.sender).\n uint256 makerAssetFilledAmount, // Amount of makerAsset sold by maker and bought by taker. \n uint256 takerAssetFilledAmount, // Amount of takerAsset sold by taker and bought by maker.\n uint256 makerFeePaid, // Amount of ZRX paid to feeRecipient by maker.\n uint256 takerFeePaid, // Amount of ZRX paid to feeRecipient by taker.\n bytes32 indexed orderHash, // EIP712 hash of order (see LibOrder.getOrderHash).\n bytes makerAssetData, // Encoded data specific to makerAsset. \n bytes takerAssetData // Encoded data specific to takerAsset.\n );\n\n // Cancel event is emitted whenever an individual order is cancelled.\n event Cancel(\n address indexed makerAddress, // Address that created the order. \n address indexed feeRecipientAddress, // Address that would have recieved fees if order was filled. \n address senderAddress, // Address that called the Exchange contract (msg.sender).\n bytes32 indexed orderHash, // EIP712 hash of order (see LibOrder.getOrderHash).\n bytes makerAssetData, // Encoded data specific to makerAsset. \n bytes takerAssetData // Encoded data specific to takerAsset.\n );\n\n // CancelUpTo event is emitted whenever `cancelOrdersUpTo` is executed succesfully.\n event CancelUpTo(\n address indexed makerAddress, // Orders cancelled must have been created by this address.\n address indexed senderAddress, // Orders cancelled must have a `senderAddress` equal to this address.\n uint256 orderEpoch // Orders with specified makerAddress and senderAddress with a salt less than this value are considered cancelled.\n );\n\n /// @dev Updates state with results of a fill order.\n /// @param order that was filled.\n /// @param takerAddress Address of taker who filled the order.\n /// @param orderTakerAssetFilledAmount Amount of order already filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function updateFilledState(\n LibOrder.Order memory order,\n address takerAddress,\n bytes32 orderHash,\n uint256 orderTakerAssetFilledAmount,\n LibFillResults.FillResults memory fillResults\n )\n internal;\n\n /// @dev Updates state with results of cancelling an order.\n /// State is only updated if the order is currently fillable.\n /// Otherwise, updating state would have no effect.\n /// @param order that was cancelled.\n /// @param orderHash Hash of order that was cancelled.\n function updateCancelledState(\n LibOrder.Order memory order,\n bytes32 orderHash\n )\n internal;\n\n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo Status, orderHash, and amount already filled of order.\n /// @param takerAddress Address of order taker.\n /// @param takerAssetFillAmount Desired amount of order to fill by taker.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @param signature Proof that the orders was created by its maker.\n function assertValidFill(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo,\n address takerAddress,\n uint256 takerAssetFillAmount,\n uint256 takerAssetFilledAmount,\n bytes memory signature\n )\n internal\n view;\n\n /// @dev Validates context for cancelOrder. Succeeds or throws.\n /// @param order to be cancelled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n function assertValidCancel(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo\n )\n internal\n view;\n\n /// @dev Calculates amounts filled and fees paid by maker and taker.\n /// @param order to be filled.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function calculateFillResults(\n LibOrder.Order memory order,\n uint256 takerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.FillResults memory fillResults);\n\n}\n",
- "2.0.0/protocol/Exchange/mixins/MMatchOrders.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IMatchOrders.sol\";\n\n\ncontract MMatchOrders is\n IMatchOrders\n{\n\n /// @dev Validates context for matchOrders. Succeeds or throws.\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n function assertValidMatch(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder\n )\n internal\n pure;\n\n /// @dev Calculates fill amounts for the matched orders.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the leftOrder order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftOrderTakerAssetFilledAmount Amount of left order already filled.\n /// @param rightOrderTakerAssetFilledAmount Amount of right order already filled.\n /// @param matchedFillResults Amounts to fill and fees to pay by maker and taker of matched orders.\n function calculateMatchedFillResults(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n uint256 leftOrderTakerAssetFilledAmount,\n uint256 rightOrderTakerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.MatchedFillResults memory matchedFillResults);\n\n}\n",
- "2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/ISignatureValidator.sol\";\n\n\ncontract MSignatureValidator is\n ISignatureValidator\n{\n event SignatureValidatorApproval(\n address indexed signerAddress, // Address that approves or disapproves a contract to verify signatures.\n address indexed validatorAddress, // Address of signature validator contract.\n bool approved // Approval or disapproval of validator contract.\n );\n\n // Allowed signature types.\n enum SignatureType {\n Illegal, // 0x00, default value\n Invalid, // 0x01\n EIP712, // 0x02\n EthSign, // 0x03\n Caller, // 0x04\n Wallet, // 0x05\n Validator, // 0x06\n PreSigned, // 0x07\n Trezor, // 0x08\n NSignatureTypes // 0x09, number of signature types. Always leave at end.\n }\n}\n",
- "2.0.0/protocol/Exchange/mixins/MTransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\nimport \"../interfaces/ITransactions.sol\";\n\n\ncontract MTransactions is\n ITransactions\n{\n\n /// @dev The current function will be called in the context of this address (either 0x transaction signer or `msg.sender`).\n /// If calling a fill function, this address will represent the taker.\n /// If calling a cancel function, this address will represent the maker.\n /// @return Signer of 0x transaction if entry point is `executeTransaction`.\n /// `msg.sender` if entry point is any other function.\n function getCurrentContextAddress()\n internal\n view\n returns (address);\n}\n",
- "2.0.0/test/DummyERC20Token/DummyERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"../../tokens/ERC20Token/MintableERC20Token.sol\";\n\n\ncontract DummyERC20Token is \n Ownable,\n MintableERC20Token\n{\n string public name;\n string public symbol;\n uint256 public decimals;\n uint256 public constant MAX_MINT_AMOUNT = 10000000000000000000000;\n\n constructor (\n string _name,\n string _symbol,\n uint256 _decimals,\n uint256 _totalSupply\n )\n public\n {\n name = _name;\n symbol = _symbol;\n decimals = _decimals;\n _totalSupply = _totalSupply;\n balances[msg.sender] = _totalSupply;\n }\n\n /// @dev Sets the balance of target address\n /// @param _target Address or which balance will be updated\n /// @param _value New balance of target address\n function setBalance(address _target, uint256 _value)\n external\n onlyOwner\n {\n uint256 currBalance = balances[_target];\n if (_value < currBalance) {\n _totalSupply = safeSub(_totalSupply, safeSub(currBalance, _value));\n } else {\n _totalSupply = safeAdd(_totalSupply, safeSub(_value, currBalance));\n }\n balances[_target] = _value;\n }\n\n /// @dev Mints new tokens for sender\n /// @param _value Amount of tokens to mint\n function mint(uint256 _value)\n external\n {\n require(\n _value <= MAX_MINT_AMOUNT,\n \"VALUE_TOO_LARGE\"\n );\n\n _mint(msg.sender, _value);\n }\n}\n",
- "2.0.0/test/DummyERC721Token/DummyERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../tokens/ERC721Token/MintableERC721Token.sol\";\nimport \"../../utils/Ownable/Ownable.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract DummyERC721Token is\n Ownable,\n MintableERC721Token\n{\n string public name;\n string public symbol;\n\n constructor (\n string _name,\n string _symbol\n )\n public\n {\n name = _name;\n symbol = _symbol;\n }\n\n /// @dev Function to mint a new token\n /// Reverts if the given token ID already exists\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _tokenId ID of the token to be minted by the msg.sender \n function mint(address _to, uint256 _tokenId)\n external\n {\n _mint(_to, _tokenId);\n }\n\n /// @dev Function to burn a token\n /// Reverts if the given token ID doesn't exist or not called by contract owner\n /// @param _owner Owner of token with given token ID\n /// @param _tokenId ID of the token to be burned by the msg.sender\n function burn(address _owner, uint256 _tokenId)\n external\n onlyOwner\n {\n _burn(_owner, _tokenId);\n }\n}\n",
- "2.0.0/tokens/ERC20Token/ERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IERC20Token.sol\";\n\n\ncontract ERC20Token is\n IERC20Token\n{\n\n mapping (address => uint256) internal balances;\n mapping (address => mapping (address => uint256)) internal allowed;\n\n uint256 internal _totalSupply;\n\n /// @dev send `value` token to `to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transfer(address _to, uint256 _value)\n external\n returns (bool)\n {\n require(\n balances[msg.sender] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[msg.sender] -= _value;\n balances[_to] += _value;\n\n emit Transfer(\n msg.sender,\n _to,\n _value\n );\n\n return true;\n }\n\n /// @dev send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool)\n {\n require(\n balances[_from] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n allowed[_from][msg.sender] >= _value,\n \"ERC20_INSUFFICIENT_ALLOWANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[_to] += _value;\n balances[_from] -= _value;\n allowed[_from][msg.sender] -= _value;\n \n emit Transfer(\n _from,\n _to,\n _value\n );\n \n return true;\n }\n\n /// @dev `msg.sender` approves `_spender` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Always true if the call has enough gas to complete execution\n function approve(address _spender, uint256 _value)\n external\n returns (bool)\n {\n allowed[msg.sender][_spender] = _value;\n emit Approval(\n msg.sender,\n _spender,\n _value\n );\n return true;\n }\n\n /// @dev Query total supply of token\n /// @return Total supply of token\n function totalSupply()\n external\n view\n returns (uint256)\n {\n return _totalSupply;\n }\n\n /// @dev Query the balance of owner\n /// @param _owner The address from which the balance will be retrieved\n /// @return Balance of owner\n function balanceOf(address _owner)\n external\n view\n returns (uint256)\n {\n return balances[_owner];\n }\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender)\n external\n view\n returns (uint256)\n {\n return allowed[_owner][_spender];\n }\n}\n",
- "2.0.0/tokens/ERC20Token/IERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC20Token {\n\n // solhint-disable no-simple-event-func-name\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 _value\n );\n\n event Approval(\n address indexed _owner,\n address indexed _spender,\n uint256 _value\n );\n\n /// @dev send `value` token to `to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transfer(address _to, uint256 _value)\n external\n returns (bool);\n\n /// @dev send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool);\n \n /// @dev `msg.sender` approves `_spender` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Always true if the call has enough gas to complete execution\n function approve(address _spender, uint256 _value)\n external\n returns (bool);\n\n /// @dev Query total supply of token\n /// @return Total supply of token\n function totalSupply()\n external\n view\n returns (uint256);\n \n /// @param _owner The address from which the balance will be retrieved\n /// @return Balance of owner\n function balanceOf(address _owner)\n external\n view\n returns (uint256);\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender)\n external\n view\n returns (uint256);\n}\n",
- "2.0.0/tokens/ERC20Token/MintableERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/SafeMath/SafeMath.sol\";\nimport \"./UnlimitedAllowanceERC20Token.sol\";\n\n\ncontract MintableERC20Token is \n SafeMath,\n UnlimitedAllowanceERC20Token\n{\n\n /// @dev Mints new tokens\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _value Amount of tokens to mint\n function _mint(address _to, uint256 _value)\n internal\n {\n balances[_to] = safeAdd(_value, balances[_to]);\n _totalSupply = safeAdd(_totalSupply, _value);\n\n emit Transfer(\n address(0),\n _to,\n _value\n );\n }\n\n /// @dev Mints new tokens\n /// @param _owner Owner of tokens that will be burned\n /// @param _value Amount of tokens to burn\n function _burn(address _owner, uint256 _value)\n internal\n {\n balances[_owner] = safeSub(balances[_owner], _value);\n _totalSupply = safeSub(_totalSupply, _value);\n\n emit Transfer(\n _owner,\n address(0),\n _value\n );\n }\n}\n",
- "2.0.0/tokens/ERC20Token/UnlimitedAllowanceERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../ERC20Token/ERC20Token.sol\";\n\n\ncontract UnlimitedAllowanceERC20Token is\n ERC20Token\n{\n\n uint256 constant internal MAX_UINT = 2**256 - 1;\n\n /// @dev ERC20 transferFrom, modified such that an allowance of MAX_UINT represents an unlimited allowance. See https://github.com/ethereum/EIPs/issues/717\n /// @param _from Address to transfer from.\n /// @param _to Address to transfer to.\n /// @param _value Amount to transfer.\n /// @return Success of transfer.\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool)\n {\n uint256 allowance = allowed[_from][msg.sender];\n require(\n balances[_from] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n allowance >= _value,\n \"ERC20_INSUFFICIENT_ALLOWANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[_to] += _value;\n balances[_from] -= _value;\n if (allowance < MAX_UINT) {\n allowed[_from][msg.sender] -= _value;\n }\n\n emit Transfer(\n _from,\n _to,\n _value\n );\n\n return true;\n }\n}\n",
- "2.0.0/tokens/ERC721Token/ERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IERC721Token.sol\";\nimport \"./IERC721Receiver.sol\";\nimport \"../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract ERC721Token is\n IERC721Token,\n SafeMath\n{\n // Function selector for ERC721Receiver.onERC721Received\n // 0x150b7a02\n bytes4 constant internal ERC721_RECEIVED = bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"));\n\n // Mapping of tokenId => owner\n mapping (uint256 => address) internal owners;\n\n // Mapping of tokenId => approved address\n mapping (uint256 => address) internal approvals;\n\n // Mapping of owner => number of tokens owned\n mapping (address => uint256) internal balances;\n\n // Mapping of owner => operator => approved\n mapping (address => mapping (address => bool)) internal operatorApprovals;\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT. When transfer is complete, this function\n /// checks if `_to` is a smart contract (code size > 0). If so, it calls\n /// `onERC721Received` on `_to` and throws if the return value is not\n /// `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n /// @param _data Additional data with no specified format, sent in call to `_to`\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId,\n bytes _data\n )\n external\n {\n transferFrom(\n _from,\n _to,\n _tokenId\n );\n\n uint256 receiverCodeSize;\n assembly {\n receiverCodeSize := extcodesize(_to)\n }\n if (receiverCodeSize > 0) {\n bytes4 selector = IERC721Receiver(_to).onERC721Received(\n msg.sender,\n _from,\n _tokenId,\n _data\n );\n require(\n selector == ERC721_RECEIVED,\n \"ERC721_INVALID_SELECTOR\"\n );\n }\n }\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev This works identically to the other function with an extra data parameter,\n /// except this function just sets data to \"\".\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n external\n {\n transferFrom(\n _from,\n _to,\n _tokenId\n );\n\n uint256 receiverCodeSize;\n assembly {\n receiverCodeSize := extcodesize(_to)\n }\n if (receiverCodeSize > 0) {\n bytes4 selector = IERC721Receiver(_to).onERC721Received(\n msg.sender,\n _from,\n _tokenId,\n \"\"\n );\n require(\n selector == ERC721_RECEIVED,\n \"ERC721_INVALID_SELECTOR\"\n );\n }\n }\n\n /// @notice Change or reaffirm the approved address for an NFT\n /// @dev The zero address indicates there is no approved address.\n /// Throws unless `msg.sender` is the current NFT owner, or an authorized\n /// operator of the current owner.\n /// @param _approved The new approved NFT controller\n /// @param _tokenId The NFT to approve\n function approve(address _approved, uint256 _tokenId)\n external\n {\n address owner = ownerOf(_tokenId);\n require(\n msg.sender == owner || isApprovedForAll(owner, msg.sender),\n \"ERC721_INVALID_SENDER\"\n );\n\n approvals[_tokenId] = _approved;\n emit Approval(\n owner,\n _approved,\n _tokenId\n );\n }\n\n /// @notice Enable or disable approval for a third party (\"operator\") to manage\n /// all of `msg.sender`'s assets\n /// @dev Emits the ApprovalForAll event. The contract MUST allow\n /// multiple operators per owner.\n /// @param _operator Address to add to the set of authorized operators\n /// @param _approved True if the operator is approved, false to revoke approval\n function setApprovalForAll(address _operator, bool _approved)\n external\n {\n operatorApprovals[msg.sender][_operator] = _approved;\n emit ApprovalForAll(\n msg.sender,\n _operator,\n _approved\n );\n }\n \n /// @notice Count all NFTs assigned to an owner\n /// @dev NFTs assigned to the zero address are considered invalid, and this\n /// function throws for queries about the zero address.\n /// @param _owner An address for whom to query the balance\n /// @return The number of NFTs owned by `_owner`, possibly zero\n function balanceOf(address _owner)\n external\n view\n returns (uint256)\n {\n require(\n _owner != address(0),\n \"ERC721_ZERO_OWNER\"\n );\n return balances[_owner];\n }\n\n /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE\n /// TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE\n /// THEY MAY BE PERMANENTLY LOST\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function transferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n public\n {\n require(\n _to != address(0),\n \"ERC721_ZERO_TO_ADDRESS\"\n );\n\n address owner = ownerOf(_tokenId);\n require(\n _from == owner,\n \"ERC721_OWNER_MISMATCH\"\n );\n\n address spender = msg.sender;\n address approvedAddress = getApproved(_tokenId);\n require(\n spender == owner ||\n isApprovedForAll(owner, spender) ||\n approvedAddress == spender,\n \"ERC721_INVALID_SPENDER\"\n );\n\n if (approvedAddress != address(0)) {\n approvals[_tokenId] = address(0);\n }\n\n owners[_tokenId] = _to;\n balances[_from] = safeSub(balances[_from], 1);\n balances[_to] = safeAdd(balances[_to], 1);\n \n emit Transfer(\n _from,\n _to,\n _tokenId\n );\n }\n\n /// @notice Find the owner of an NFT\n /// @dev NFTs assigned to zero address are considered invalid, and queries\n /// about them do throw.\n /// @param _tokenId The identifier for an NFT\n /// @return The address of the owner of the NFT\n function ownerOf(uint256 _tokenId)\n public\n view\n returns (address)\n {\n address owner = owners[_tokenId];\n require(\n owner != address(0),\n \"ERC721_ZERO_OWNER\"\n );\n return owner;\n }\n\n /// @notice Get the approved address for a single NFT\n /// @dev Throws if `_tokenId` is not a valid NFT.\n /// @param _tokenId The NFT to find the approved address for\n /// @return The approved address for this NFT, or the zero address if there is none\n function getApproved(uint256 _tokenId)\n public\n view\n returns (address)\n {\n return approvals[_tokenId];\n }\n\n /// @notice Query if an address is an authorized operator for another address\n /// @param _owner The address that owns the NFTs\n /// @param _operator The address that acts on behalf of the owner\n /// @return True if `_operator` is an approved operator for `_owner`, false otherwise\n function isApprovedForAll(address _owner, address _operator)\n public\n view\n returns (bool)\n {\n return operatorApprovals[_owner][_operator];\n }\n}\n",
- "2.0.0/tokens/ERC721Token/IERC721Receiver.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC721Receiver {\n\n /// @notice Handle the receipt of an NFT\n /// @dev The ERC721 smart contract calls this function on the recipient\n /// after a `transfer`. This function MAY throw to revert and reject the\n /// transfer. Return of other than the magic value MUST result in the\n /// transaction being reverted.\n /// Note: the contract address is always the message sender.\n /// @param _operator The address which called `safeTransferFrom` function\n /// @param _from The address which previously owned the token\n /// @param _tokenId The NFT identifier which is being transferred\n /// @param _data Additional data with no specified format\n /// @return `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`\n /// unless throwing\n function onERC721Received(\n address _operator,\n address _from,\n uint256 _tokenId,\n bytes _data\n )\n external\n returns (bytes4);\n}\n",
- "2.0.0/tokens/ERC721Token/IERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC721Token {\n\n /// @dev This emits when ownership of any NFT changes by any mechanism.\n /// This event emits when NFTs are created (`from` == 0) and destroyed\n /// (`to` == 0). Exception: during contract creation, any number of NFTs\n /// may be created and assigned without emitting Transfer. At the time of\n /// any transfer, the approved address for that NFT (if any) is reset to none.\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 indexed _tokenId\n );\n\n /// @dev This emits when the approved address for an NFT is changed or\n /// reaffirmed. The zero address indicates there is no approved address.\n /// When a Transfer event emits, this also indicates that the approved\n /// address for that NFT (if any) is reset to none.\n event Approval(\n address indexed _owner,\n address indexed _approved,\n uint256 indexed _tokenId\n );\n\n /// @dev This emits when an operator is enabled or disabled for an owner.\n /// The operator can manage all NFTs of the owner.\n event ApprovalForAll(\n address indexed _owner,\n address indexed _operator,\n bool _approved\n );\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// perator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT. When transfer is complete, this function\n /// checks if `_to` is a smart contract (code size > 0). If so, it calls\n /// `onERC721Received` on `_to` and throws if the return value is not\n /// `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n /// @param _data Additional data with no specified format, sent in call to `_to`\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId,\n bytes _data\n )\n external;\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev This works identically to the other function with an extra data parameter,\n /// except this function just sets data to \"\".\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n external;\n\n /// @notice Change or reaffirm the approved address for an NFT\n /// @dev The zero address indicates there is no approved address.\n /// Throws unless `msg.sender` is the current NFT owner, or an authorized\n /// operator of the current owner.\n /// @param _approved The new approved NFT controller\n /// @param _tokenId The NFT to approve\n function approve(address _approved, uint256 _tokenId)\n external;\n\n /// @notice Enable or disable approval for a third party (\"operator\") to manage\n /// all of `msg.sender`'s assets\n /// @dev Emits the ApprovalForAll event. The contract MUST allow\n /// multiple operators per owner.\n /// @param _operator Address to add to the set of authorized operators\n /// @param _approved True if the operator is approved, false to revoke approval\n function setApprovalForAll(address _operator, bool _approved)\n external;\n\n /// @notice Count all NFTs assigned to an owner\n /// @dev NFTs assigned to the zero address are considered invalid, and this\n /// function throws for queries about the zero address.\n /// @param _owner An address for whom to query the balance\n /// @return The number of NFTs owned by `_owner`, possibly zero\n function balanceOf(address _owner)\n external\n view\n returns (uint256);\n\n /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE\n /// TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE\n /// THEY MAY BE PERMANENTLY LOST\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function transferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n public;\n\n /// @notice Find the owner of an NFT\n /// @dev NFTs assigned to zero address are considered invalid, and queries\n /// about them do throw.\n /// @param _tokenId The identifier for an NFT\n /// @return The address of the owner of the NFT\n function ownerOf(uint256 _tokenId)\n public\n view\n returns (address);\n\n /// @notice Get the approved address for a single NFT\n /// @dev Throws if `_tokenId` is not a valid NFT.\n /// @param _tokenId The NFT to find the approved address for\n /// @return The approved address for this NFT, or the zero address if there is none\n function getApproved(uint256 _tokenId) \n public\n view\n returns (address);\n \n /// @notice Query if an address is an authorized operator for another address\n /// @param _owner The address that owns the NFTs\n /// @param _operator The address that acts on behalf of the owner\n /// @return True if `_operator` is an approved operator for `_owner`, false otherwise\n function isApprovedForAll(address _owner, address _operator)\n public\n view\n returns (bool);\n}\n",
- "2.0.0/tokens/ERC721Token/MintableERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./ERC721Token.sol\";\n\n\ncontract MintableERC721Token is\n ERC721Token\n{\n\n /// @dev Function to mint a new token\n /// Reverts if the given token ID already exists\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _tokenId ID of the token to be minted by the msg.sender \n function _mint(address _to, uint256 _tokenId)\n internal\n {\n require(\n _to != address(0),\n \"ERC721_ZERO_TO_ADDRESS\"\n );\n\n address owner = owners[_tokenId];\n require(\n owner == address(0),\n \"ERC721_OWNER_ALREADY_EXISTS\"\n );\n\n owners[_tokenId] = _to;\n balances[_to] = safeAdd(balances[_to], 1);\n\n emit Transfer(\n address(0),\n _to,\n _tokenId\n );\n }\n\n /// @dev Function to burn a token\n /// Reverts if the given token ID doesn't exist\n /// @param _owner Owner of token with given token ID\n /// @param _tokenId ID of the token to be burned by the msg.sender\n function _burn(address _owner, uint256 _tokenId)\n internal\n {\n require(\n _owner != address(0),\n \"ERC721_ZERO_OWNER_ADDRESS\"\n );\n\n address owner = owners[_tokenId];\n require(\n owner == _owner,\n \"ERC721_OWNER_MISMATCH\"\n );\n\n owners[_tokenId] = address(0);\n balances[_owner] = safeSub(balances[_owner], 1);\n\n emit Transfer(\n _owner,\n address(0),\n _tokenId\n );\n }\n}\n",
- "2.0.0/tokens/EtherToken/IEtherToken.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../ERC20Token/IERC20Token.sol\";\n\n\ncontract IEtherToken is\n IERC20Token\n{\n function deposit()\n public\n payable;\n \n function withdraw(uint256 amount)\n public;\n}\n",
- "2.0.0/utils/LibBytes/LibBytes.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\nlibrary LibBytes {\n\n using LibBytes for bytes;\n\n /// @dev Gets the memory address for a byte array.\n /// @param input Byte array to lookup.\n /// @return memoryAddress Memory address of byte array. This\n /// points to the header of the byte array which contains\n /// the length.\n function rawAddress(bytes memory input)\n internal\n pure\n returns (uint256 memoryAddress)\n {\n assembly {\n memoryAddress := input\n }\n return memoryAddress;\n }\n \n /// @dev Gets the memory address for the contents of a byte array.\n /// @param input Byte array to lookup.\n /// @return memoryAddress Memory address of the contents of the byte array.\n function contentAddress(bytes memory input)\n internal\n pure\n returns (uint256 memoryAddress)\n {\n assembly {\n memoryAddress := add(input, 32)\n }\n return memoryAddress;\n }\n\n /// @dev Copies `length` bytes from memory location `source` to `dest`.\n /// @param dest memory address to copy bytes to.\n /// @param source memory address to copy bytes from.\n /// @param length number of bytes to copy.\n function memCopy(\n uint256 dest,\n uint256 source,\n uint256 length\n )\n internal\n pure\n {\n if (length < 32) {\n // Handle a partial word by reading destination and masking\n // off the bits we are interested in.\n // This correctly handles overlap, zero lengths and source == dest\n assembly {\n let mask := sub(exp(256, sub(32, length)), 1)\n let s := and(mload(source), not(mask))\n let d := and(mload(dest), mask)\n mstore(dest, or(s, d))\n }\n } else {\n // Skip the O(length) loop when source == dest.\n if (source == dest) {\n return;\n }\n\n // For large copies we copy whole words at a time. The final\n // word is aligned to the end of the range (instead of after the\n // previous) to handle partial words. So a copy will look like this:\n //\n // ####\n // ####\n // ####\n // ####\n //\n // We handle overlap in the source and destination range by\n // changing the copying direction. This prevents us from\n // overwriting parts of source that we still need to copy.\n //\n // This correctly handles source == dest\n //\n if (source > dest) {\n assembly {\n // We subtract 32 from `sEnd` and `dEnd` because it\n // is easier to compare with in the loop, and these\n // are also the addresses we need for copying the\n // last bytes.\n length := sub(length, 32)\n let sEnd := add(source, length)\n let dEnd := add(dest, length)\n\n // Remember the last 32 bytes of source\n // This needs to be done here and not after the loop\n // because we may have overwritten the last bytes in\n // source already due to overlap.\n let last := mload(sEnd)\n\n // Copy whole words front to back\n // Note: the first check is always true,\n // this could have been a do-while loop.\n // solhint-disable-next-line no-empty-blocks\n for {} lt(source, sEnd) {} {\n mstore(dest, mload(source))\n source := add(source, 32)\n dest := add(dest, 32)\n }\n \n // Write the last 32 bytes\n mstore(dEnd, last)\n }\n } else {\n assembly {\n // We subtract 32 from `sEnd` and `dEnd` because those\n // are the starting points when copying a word at the end.\n length := sub(length, 32)\n let sEnd := add(source, length)\n let dEnd := add(dest, length)\n\n // Remember the first 32 bytes of source\n // This needs to be done here and not after the loop\n // because we may have overwritten the first bytes in\n // source already due to overlap.\n let first := mload(source)\n\n // Copy whole words back to front\n // We use a signed comparisson here to allow dEnd to become\n // negative (happens when source and dest < 32). Valid\n // addresses in local memory will never be larger than\n // 2**255, so they can be safely re-interpreted as signed.\n // Note: the first check is always true,\n // this could have been a do-while loop.\n // solhint-disable-next-line no-empty-blocks\n for {} slt(dest, dEnd) {} {\n mstore(dEnd, mload(sEnd))\n sEnd := sub(sEnd, 32)\n dEnd := sub(dEnd, 32)\n }\n \n // Write the first 32 bytes\n mstore(dest, first)\n }\n }\n }\n }\n\n /// @dev Returns a slices from a byte array.\n /// @param b The byte array to take a slice from.\n /// @param from The starting index for the slice (inclusive).\n /// @param to The final index for the slice (exclusive).\n /// @return result The slice containing bytes at indices [from, to)\n function slice(\n bytes memory b,\n uint256 from,\n uint256 to\n )\n internal\n pure\n returns (bytes memory result)\n {\n require(\n from <= to,\n \"FROM_LESS_THAN_TO_REQUIRED\"\n );\n require(\n to < b.length,\n \"TO_LESS_THAN_LENGTH_REQUIRED\"\n );\n \n // Create a new bytes structure and copy contents\n result = new bytes(to - from);\n memCopy(\n result.contentAddress(),\n b.contentAddress() + from,\n result.length);\n return result;\n }\n \n /// @dev Returns a slice from a byte array without preserving the input.\n /// @param b The byte array to take a slice from. Will be destroyed in the process.\n /// @param from The starting index for the slice (inclusive).\n /// @param to The final index for the slice (exclusive).\n /// @return result The slice containing bytes at indices [from, to)\n /// @dev When `from == 0`, the original array will match the slice. In other cases its state will be corrupted.\n function sliceDestructive(\n bytes memory b,\n uint256 from,\n uint256 to\n )\n internal\n pure\n returns (bytes memory result)\n {\n require(\n from <= to,\n \"FROM_LESS_THAN_TO_REQUIRED\"\n );\n require(\n to < b.length,\n \"TO_LESS_THAN_LENGTH_REQUIRED\"\n );\n \n // Create a new bytes structure around [from, to) in-place.\n assembly {\n result := add(b, from)\n mstore(result, sub(to, from))\n }\n return result;\n }\n\n /// @dev Pops the last byte off of a byte array by modifying its length.\n /// @param b Byte array that will be modified.\n /// @return The byte that was popped off.\n function popLastByte(bytes memory b)\n internal\n pure\n returns (bytes1 result)\n {\n require(\n b.length > 0,\n \"GREATER_THAN_ZERO_LENGTH_REQUIRED\"\n );\n\n // Store last byte.\n result = b[b.length - 1];\n\n assembly {\n // Decrement length of byte array.\n let newLen := sub(mload(b), 1)\n mstore(b, newLen)\n }\n return result;\n }\n\n /// @dev Pops the last 20 bytes off of a byte array by modifying its length.\n /// @param b Byte array that will be modified.\n /// @return The 20 byte address that was popped off.\n function popLast20Bytes(bytes memory b)\n internal\n pure\n returns (address result)\n {\n require(\n b.length >= 20,\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Store last 20 bytes.\n result = readAddress(b, b.length - 20);\n\n assembly {\n // Subtract 20 from byte array length.\n let newLen := sub(mload(b), 20)\n mstore(b, newLen)\n }\n return result;\n }\n\n /// @dev Tests equality of two byte arrays.\n /// @param lhs First byte array to compare.\n /// @param rhs Second byte array to compare.\n /// @return True if arrays are the same. False otherwise.\n function equals(\n bytes memory lhs,\n bytes memory rhs\n )\n internal\n pure\n returns (bool equal)\n {\n // Keccak gas cost is 30 + numWords * 6. This is a cheap way to compare.\n // We early exit on unequal lengths, but keccak would also correctly\n // handle this.\n return lhs.length == rhs.length && keccak256(lhs) == keccak256(rhs);\n }\n\n /// @dev Reads an address from a position in a byte array.\n /// @param b Byte array containing an address.\n /// @param index Index in byte array of address.\n /// @return address from byte array.\n function readAddress(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (address result)\n {\n require(\n b.length >= index + 20, // 20 is length of address\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Add offset to index:\n // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)\n // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)\n index += 20;\n\n // Read address from array memory\n assembly {\n // 1. Add index to address of bytes array\n // 2. Load 32-byte word from memory\n // 3. Apply 20-byte mask to obtain address\n result := and(mload(add(b, index)), 0xffffffffffffffffffffffffffffffffffffffff)\n }\n return result;\n }\n\n /// @dev Writes an address into a specific position in a byte array.\n /// @param b Byte array to insert address into.\n /// @param index Index in byte array of address.\n /// @param input Address to put into byte array.\n function writeAddress(\n bytes memory b,\n uint256 index,\n address input\n )\n internal\n pure\n {\n require(\n b.length >= index + 20, // 20 is length of address\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Add offset to index:\n // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)\n // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)\n index += 20;\n\n // Store address into array memory\n assembly {\n // The address occupies 20 bytes and mstore stores 32 bytes.\n // First fetch the 32-byte word where we'll be storing the address, then\n // apply a mask so we have only the bytes in the word that the address will not occupy.\n // Then combine these bytes with the address and store the 32 bytes back to memory with mstore.\n\n // 1. Add index to address of bytes array\n // 2. Load 32-byte word from memory\n // 3. Apply 12-byte mask to obtain extra bytes occupying word of memory where we'll store the address\n let neighbors := and(\n mload(add(b, index)),\n 0xffffffffffffffffffffffff0000000000000000000000000000000000000000\n )\n \n // Make sure input address is clean.\n // (Solidity does not guarantee this)\n input := and(input, 0xffffffffffffffffffffffffffffffffffffffff)\n\n // Store the neighbors and address into memory\n mstore(add(b, index), xor(input, neighbors))\n }\n }\n\n /// @dev Reads a bytes32 value from a position in a byte array.\n /// @param b Byte array containing a bytes32 value.\n /// @param index Index in byte array of bytes32 value.\n /// @return bytes32 value from byte array.\n function readBytes32(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes32 result)\n {\n require(\n b.length >= index + 32,\n \"GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 256 bit length parameter\n index += 32;\n\n // Read the bytes32 from array memory\n assembly {\n result := mload(add(b, index))\n }\n return result;\n }\n\n /// @dev Writes a bytes32 into a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input bytes32 to put into byte array.\n function writeBytes32(\n bytes memory b,\n uint256 index,\n bytes32 input\n )\n internal\n pure\n {\n require(\n b.length >= index + 32,\n \"GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 256 bit length parameter\n index += 32;\n\n // Read the bytes32 from array memory\n assembly {\n mstore(add(b, index), input)\n }\n }\n\n /// @dev Reads a uint256 value from a position in a byte array.\n /// @param b Byte array containing a uint256 value.\n /// @param index Index in byte array of uint256 value.\n /// @return uint256 value from byte array.\n function readUint256(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (uint256 result)\n {\n return uint256(readBytes32(b, index));\n }\n\n /// @dev Writes a uint256 into a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input uint256 to put into byte array.\n function writeUint256(\n bytes memory b,\n uint256 index,\n uint256 input\n )\n internal\n pure\n {\n writeBytes32(b, index, bytes32(input));\n }\n\n /// @dev Reads an unpadded bytes4 value from a position in a byte array.\n /// @param b Byte array containing a bytes4 value.\n /// @param index Index in byte array of bytes4 value.\n /// @return bytes4 value from byte array.\n function readBytes4(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes4 result)\n {\n require(\n b.length >= index + 4,\n \"GREATER_OR_EQUAL_TO_4_LENGTH_REQUIRED\"\n );\n assembly {\n result := mload(add(b, 32))\n // Solidity does not require us to clean the trailing bytes.\n // We do it anyway\n result := and(result, 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000)\n }\n return result;\n }\n\n /// @dev Reads nested bytes from a specific position.\n /// @dev NOTE: the returned value overlaps with the input value.\n /// Both should be treated as immutable.\n /// @param b Byte array containing nested bytes.\n /// @param index Index of nested bytes.\n /// @return result Nested bytes.\n function readBytesWithLength(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes memory result)\n {\n // Read length of nested bytes\n uint256 nestedBytesLength = readUint256(b, index);\n index += 32;\n\n // Assert length of <b> is valid, given\n // length of nested bytes\n require(\n b.length >= index + nestedBytesLength,\n \"GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED\"\n );\n \n // Return a pointer to the byte array as it exists inside `b`\n assembly {\n result := add(b, index)\n }\n return result;\n }\n\n /// @dev Inserts bytes at a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input bytes to insert.\n function writeBytesWithLength(\n bytes memory b,\n uint256 index,\n bytes memory input\n )\n internal\n pure\n {\n // Assert length of <b> is valid, given\n // length of input\n require(\n b.length >= index + 32 + input.length, // 32 bytes to store length\n \"GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED\"\n );\n\n // Copy <input> into <b>\n memCopy(\n b.contentAddress() + index,\n input.rawAddress(), // includes length of <input>\n input.length + 32 // +32 bytes to store <input> length\n );\n }\n\n /// @dev Performs a deep copy of a byte array onto another byte array of greater than or equal length.\n /// @param dest Byte array that will be overwritten with source bytes.\n /// @param source Byte array to copy onto dest bytes.\n function deepCopyBytes(\n bytes memory dest,\n bytes memory source\n )\n internal\n pure\n {\n uint256 sourceLen = source.length;\n // Dest length must be >= source length, or some bytes would not be copied.\n require(\n dest.length >= sourceLen,\n \"GREATER_OR_EQUAL_TO_SOURCE_BYTES_LENGTH_REQUIRED\"\n );\n memCopy(\n dest.contentAddress(),\n source.contentAddress(),\n sourceLen\n );\n }\n}\n",
- "2.0.0/utils/Ownable/IOwnable.sol": "pragma solidity 0.4.24;\n\n/*\n * Ownable\n *\n * Base contract with an owner.\n * Provides onlyOwner modifier, which prevents function from running if it is called by anyone other than the owner.\n */\n\ncontract IOwnable {\n function transferOwnership(address newOwner)\n public;\n}\n",
- "2.0.0/utils/Ownable/Ownable.sol": "pragma solidity 0.4.24;\n\n/*\n * Ownable\n *\n * Base contract with an owner.\n * Provides onlyOwner modifier, which prevents function from running if it is called by anyone other than the owner.\n */\n\nimport \"./IOwnable.sol\";\n\n\ncontract Ownable is IOwnable {\n address public owner;\n\n constructor ()\n public\n {\n owner = msg.sender;\n }\n\n modifier onlyOwner() {\n require(\n msg.sender == owner,\n \"ONLY_CONTRACT_OWNER\"\n );\n _;\n }\n\n function transferOwnership(address newOwner)\n public\n onlyOwner\n {\n if (newOwner != address(0)) {\n owner = newOwner;\n }\n }\n}\n",
- "2.0.0/utils/SafeMath/SafeMath.sol": "pragma solidity 0.4.24;\n\n\ncontract SafeMath {\n function safeMul(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n if (a == 0) {\n return 0;\n }\n uint256 c = a * b;\n require(\n c / a == b,\n \"UINT256_OVERFLOW\"\n );\n return c;\n }\n\n function safeDiv(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n uint256 c = a / b;\n return c;\n }\n\n function safeSub(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n require(\n b <= a,\n \"UINT256_UNDERFLOW\"\n );\n return a - b;\n }\n\n function safeAdd(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n uint256 c = a + b;\n require(\n c >= a,\n \"UINT256_OVERFLOW\"\n );\n return c;\n }\n\n function max64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n\n function max256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n}\n"
- },
- "sourceTreeHashHex": "0x70b7d3c15ab87e6b4b1011d194282163232dfd88486038e4120d6bf245d58e44",
- "compiler": {
- "name": "solc",
- "version": "soljson-v0.4.24+commit.e67f0147.js",
- "settings": {
- "optimizer": {
- "enabled": true,
- "runs": 1000000
- },
- "outputSelection": {
- "*": {
- "*": [
- "abi",
- "evm.bytecode.object",
- "evm.bytecode.sourceMap",
- "evm.deployedBytecode.object",
- "evm.deployedBytecode.sourceMap"
- ]
- }
- }
- }
- },
- "networks": {}
-} \ No newline at end of file
diff --git a/packages/migrations/artifacts/2.0.0-testnet/OrderValidator.json b/packages/migrations/artifacts/2.0.0-testnet/OrderValidator.json
deleted file mode 100644
index 4d21192f3..000000000
--- a/packages/migrations/artifacts/2.0.0-testnet/OrderValidator.json
+++ /dev/null
@@ -1,885 +0,0 @@
-{
- "schemaVersion": "2.0.0",
- "contractName": "OrderValidator",
- "compilerOutput": {
- "abi": [
- {
- "constant": true,
- "inputs": [
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "order",
- "type": "tuple"
- },
- {
- "name": "takerAddress",
- "type": "address"
- }
- ],
- "name": "getOrderAndTraderInfo",
- "outputs": [
- {
- "components": [
- {
- "name": "orderStatus",
- "type": "uint8"
- },
- {
- "name": "orderHash",
- "type": "bytes32"
- },
- {
- "name": "orderTakerAssetFilledAmount",
- "type": "uint256"
- }
- ],
- "name": "orderInfo",
- "type": "tuple"
- },
- {
- "components": [
- {
- "name": "makerBalance",
- "type": "uint256"
- },
- {
- "name": "makerAllowance",
- "type": "uint256"
- },
- {
- "name": "takerBalance",
- "type": "uint256"
- },
- {
- "name": "takerAllowance",
- "type": "uint256"
- },
- {
- "name": "makerZrxBalance",
- "type": "uint256"
- },
- {
- "name": "makerZrxAllowance",
- "type": "uint256"
- },
- {
- "name": "takerZrxBalance",
- "type": "uint256"
- },
- {
- "name": "takerZrxAllowance",
- "type": "uint256"
- }
- ],
- "name": "traderInfo",
- "type": "tuple"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "target",
- "type": "address"
- },
- {
- "name": "assetData",
- "type": "bytes"
- }
- ],
- "name": "getBalanceAndAllowance",
- "outputs": [
- {
- "name": "balance",
- "type": "uint256"
- },
- {
- "name": "allowance",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "orders",
- "type": "tuple[]"
- },
- {
- "name": "takerAddresses",
- "type": "address[]"
- }
- ],
- "name": "getOrdersAndTradersInfo",
- "outputs": [
- {
- "components": [
- {
- "name": "orderStatus",
- "type": "uint8"
- },
- {
- "name": "orderHash",
- "type": "bytes32"
- },
- {
- "name": "orderTakerAssetFilledAmount",
- "type": "uint256"
- }
- ],
- "name": "ordersInfo",
- "type": "tuple[]"
- },
- {
- "components": [
- {
- "name": "makerBalance",
- "type": "uint256"
- },
- {
- "name": "makerAllowance",
- "type": "uint256"
- },
- {
- "name": "takerBalance",
- "type": "uint256"
- },
- {
- "name": "takerAllowance",
- "type": "uint256"
- },
- {
- "name": "makerZrxBalance",
- "type": "uint256"
- },
- {
- "name": "makerZrxAllowance",
- "type": "uint256"
- },
- {
- "name": "takerZrxBalance",
- "type": "uint256"
- },
- {
- "name": "takerZrxAllowance",
- "type": "uint256"
- }
- ],
- "name": "tradersInfo",
- "type": "tuple[]"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "orders",
- "type": "tuple[]"
- },
- {
- "name": "takerAddresses",
- "type": "address[]"
- }
- ],
- "name": "getTradersInfo",
- "outputs": [
- {
- "components": [
- {
- "name": "makerBalance",
- "type": "uint256"
- },
- {
- "name": "makerAllowance",
- "type": "uint256"
- },
- {
- "name": "takerBalance",
- "type": "uint256"
- },
- {
- "name": "takerAllowance",
- "type": "uint256"
- },
- {
- "name": "makerZrxBalance",
- "type": "uint256"
- },
- {
- "name": "makerZrxAllowance",
- "type": "uint256"
- },
- {
- "name": "takerZrxBalance",
- "type": "uint256"
- },
- {
- "name": "takerZrxAllowance",
- "type": "uint256"
- }
- ],
- "name": "",
- "type": "tuple[]"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "token",
- "type": "address"
- },
- {
- "name": "tokenId",
- "type": "uint256"
- }
- ],
- "name": "getERC721TokenOwner",
- "outputs": [
- {
- "name": "owner",
- "type": "address"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "target",
- "type": "address"
- },
- {
- "name": "assetData",
- "type": "bytes[]"
- }
- ],
- "name": "getBalancesAndAllowances",
- "outputs": [
- {
- "name": "",
- "type": "uint256[]"
- },
- {
- "name": "",
- "type": "uint256[]"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "order",
- "type": "tuple"
- },
- {
- "name": "takerAddress",
- "type": "address"
- }
- ],
- "name": "getTraderInfo",
- "outputs": [
- {
- "components": [
- {
- "name": "makerBalance",
- "type": "uint256"
- },
- {
- "name": "makerAllowance",
- "type": "uint256"
- },
- {
- "name": "takerBalance",
- "type": "uint256"
- },
- {
- "name": "takerAllowance",
- "type": "uint256"
- },
- {
- "name": "makerZrxBalance",
- "type": "uint256"
- },
- {
- "name": "makerZrxAllowance",
- "type": "uint256"
- },
- {
- "name": "takerZrxBalance",
- "type": "uint256"
- },
- {
- "name": "takerZrxAllowance",
- "type": "uint256"
- }
- ],
- "name": "traderInfo",
- "type": "tuple"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "inputs": [
- {
- "name": "_exchange",
- "type": "address"
- },
- {
- "name": "_zrxAssetData",
- "type": "bytes"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "constructor"
- }
- ],
- "evm": {
- "bytecode": {
- "linkReferences": {},
- "object": "0x60806040523480156200001157600080fd5b5060405162001d3a38038062001d3a833981018060405262000037919081019062000186565b60008054600160a060020a031916600160a060020a03841617905580516200006790600190602084019062000070565b5050506200026b565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10620000b357805160ff1916838001178555620000e3565b82800160010185558215620000e3579182015b82811115620000e3578251825591602001919060010190620000c6565b50620000f1929150620000f5565b5090565b6200011291905b80821115620000f15760008155600101620000fc565b90565b60006200012382516200022c565b9392505050565b6000601f820183136200013c57600080fd5b8151620001536200014d8262000204565b620001dd565b915080825260208301602083018583830111156200017057600080fd5b6200017d83828462000238565b50505092915050565b600080604083850312156200019a57600080fd5b6000620001a8858562000115565b92505060208301516001604060020a03811115620001c557600080fd5b620001d3858286016200012a565b9150509250929050565b6040518181016001604060020a0381118282101715620001fc57600080fd5b604052919050565b60006001604060020a038211156200021b57600080fd5b506020601f91909101601f19160190565b600160a060020a031690565b60005b83811015620002555781810151838201526020016200023b565b8381111562000265576000848401525b50505050565b611abf806200027b6000396000f3006080604052600436106100825763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166304ad1e5381146100875780632cd0fc73146100be5780634b95de13146100ec578063690d31141461011a578063b698846314610147578063c6b7f4ee14610174578063f241ffb0146101a2575b600080fd5b34801561009357600080fd5b506100a76100a23660046112d3565b6101cf565b6040516100b59291906118dc565b60405180910390f35b3480156100ca57600080fd5b506100de6100d936600461118b565b61029c565b6040516100b5929190611926565b3480156100f857600080fd5b5061010c610107366004611238565b6107cd565b6040516100b5929190611822565b34801561012657600080fd5b5061013a610135366004611238565b6108a4565b6040516100b59190611858565b34801561015357600080fd5b506101676101623660046111d3565b61095e565b6040516100b591906117f9565b34801561018057600080fd5b5061019461018f366004611139565b6109a9565b6040516100b5929190611869565b3480156101ae57600080fd5b506101c26101bd3660046112d3565b610a86565b6040516100b59190611909565b6101d7610cd0565b6101df610cf0565b6000546040517fc75e0a8100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091169063c75e0a81906102359087906004016118f8565b606060405180830381600087803b15801561024f57600080fd5b505af1158015610263573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061028791908101906112b5565b91506102938484610a86565b90509250929050565b6000808080808080806102b5898263ffffffff610ba416565b95506102c889601063ffffffff610c1116565b6000546040517f6070410800000000000000000000000000000000000000000000000000000000815291965073ffffffffffffffffffffffffffffffffffffffff169063607041089061031f90899060040161188e565b602060405180830381600087803b15801561033957600080fd5b505af115801561034d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506103719190810190611113565b604080517f4552433230546f6b656e28616464726573732900000000000000000000000000815290519081900360130190209094507fffffffff0000000000000000000000000000000000000000000000000000000087811691161415610526576040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8616906370a0823190610424908d906004016117f9565b602060405180830381600087803b15801561043e57600080fd5b505af1158015610452573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610476919081019061131a565b6040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815290985073ffffffffffffffffffffffffffffffffffffffff86169063dd62ed3e906104cd908d908890600401611807565b602060405180830381600087803b1580156104e757600080fd5b505af11580156104fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061051f919081019061131a565b96506107c0565b604080517f455243373231546f6b656e28616464726573732c75696e7432353629000000008152905190819003601c0190207fffffffff00000000000000000000000000000000000000000000000000000000878116911614156107855761059589602463ffffffff610c7216565b92506105a1858461095e565b91508173ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff16146105dd5760006105e0565b60015b60ff1697508473ffffffffffffffffffffffffffffffffffffffff1663e985e9c58b866040518363ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040161063c929190611807565b602060405180830381600087803b15801561065657600080fd5b505af115801561066a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061068e9190810190611297565b8061076a57508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1663081812fc856040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004016107009190611918565b602060405180830381600087803b15801561071a57600080fd5b505af115801561072e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506107529190810190611113565b73ffffffffffffffffffffffffffffffffffffffff16145b90508061077857600061077b565b60015b60ff1696506107c0565b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107b7906118ac565b60405180910390fd5b5050505050509250929050565b6000546040517f7e9d74dc000000000000000000000000000000000000000000000000000000008152606091829173ffffffffffffffffffffffffffffffffffffffff90911690637e9d74dc90610828908790600401611847565b600060405180830381600087803b15801561084257600080fd5b505af1158015610856573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405261089c9190810190611203565b915061029384845b606060006060600085519250826040519080825280602002602001820160405280156108ea57816020015b6108d7610cf0565b8152602001906001900390816108cf5790505b509150600090505b80831461095157610931868281518110151561090a57fe5b90602001906020020151868381518110151561092257fe5b90602001906020020151610a86565b828281518110151561093f57fe5b602090810290910101526001016108f2565b8193505b50505092915050565b60006040517f6352211e000000000000000000000000000000000000000000000000000000008152826004820152602081602483875afa80156109a057815192505b50505b92915050565b6060806000606080600086519350836040519080825280602002602001820160405280156109e1578160200160208202803883390190505b50925083604051908082528060200260200182016040528015610a0e578160200160208202803883390190505b509150600090505b808414610a7957610a3e888883815181101515610a2f57fe5b9060200190602002015161029c565b8483815181101515610a4c57fe5b9060200190602002018484815181101515610a6357fe5b6020908102909101019190915252600101610a16565b5090969095509350505050565b610a8e610cf0565b6060610aa3846000015185610140015161029c565b60208401528252610160840151610abb90849061029c565b60608401526040808401919091526001805482516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101008688161502019094169390930492830181900481028201810190945281815292830182828015610b6a5780601f10610b3f57610100808354040283529160200191610b6a565b820191906000526020600020905b815481529060010190602001808311610b4d57829003601f168201915b50505050509050610b7f84600001518261029c565b60a08401526080830152610b93838261029c565b60e084015260c08301525092915050565b600081600401835110151515610be6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107b7906118cc565b5001602001517fffffffff000000000000000000000000000000000000000000000000000000001690565b600081601401835110151515610c53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107b7906118bc565b50016014015173ffffffffffffffffffffffffffffffffffffffff1690565b6000610c7e8383610c85565b9392505050565b600081602001835110151515610cc7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107b79061189c565b50016020015190565b604080516060810182526000808252602082018190529181019190915290565b6101006040519081016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6000610c7e82356119d9565b6000610c7e82516119d9565b6000601f82018313610d5f57600080fd5b8135610d72610d6d82611968565b611941565b91508181835260208401935060208101905083856020840282011115610d9757600080fd5b60005b83811015610dc35781610dad8882610d36565b8452506020928301929190910190600101610d9a565b5050505092915050565b6000601f82018313610dde57600080fd5b8135610dec610d6d82611968565b81815260209384019390925082018360005b83811015610dc35781358601610e148882610f11565b8452506020928301929190910190600101610dfe565b6000601f82018313610e3b57600080fd5b8151610e49610d6d82611968565b91508181835260208401935060208101905083856060840282011115610e6e57600080fd5b60005b83811015610dc35781610e848882610f57565b84525060209092019160609190910190600101610e71565b6000601f82018313610ead57600080fd5b8135610ebb610d6d82611968565b81815260209384019390925082018360005b83811015610dc35781358601610ee38882610fb2565b8452506020928301929190910190600101610ecd565b6000610c7e8251611a20565b6000610c7e82516119f2565b6000601f82018313610f2257600080fd5b8135610f30610d6d82611989565b91508082526020830160208301858383011115610f4c57600080fd5b610955838284611a25565b600060608284031215610f6957600080fd5b610f736060611941565b90506000610f818484611107565b8252506020610f9284848301610f05565b6020830152506040610fa684828501610f05565b60408301525092915050565b60006101808284031215610fc557600080fd5b610fd0610180611941565b90506000610fde8484610d36565b8252506020610fef84848301610d36565b602083015250604061100384828501610d36565b604083015250606061101784828501610d36565b606083015250608061102b848285016110fb565b60808301525060a061103f848285016110fb565b60a08301525060c0611053848285016110fb565b60c08301525060e0611067848285016110fb565b60e08301525061010061107c848285016110fb565b61010083015250610120611092848285016110fb565b6101208301525061014082013567ffffffffffffffff8111156110b457600080fd5b6110c084828501610f11565b6101408301525061016082013567ffffffffffffffff8111156110e257600080fd5b6110ee84828501610f11565b6101608301525092915050565b6000610c7e82356119f2565b6000610c7e8251611a1a565b60006020828403121561112557600080fd5b60006111318484610d42565b949350505050565b6000806040838503121561114c57600080fd5b60006111588585610d36565b925050602083013567ffffffffffffffff81111561117557600080fd5b61118185828601610dcd565b9150509250929050565b6000806040838503121561119e57600080fd5b60006111aa8585610d36565b925050602083013567ffffffffffffffff8111156111c757600080fd5b61118185828601610f11565b600080604083850312156111e657600080fd5b60006111f28585610d36565b9250506020611181858286016110fb565b60006020828403121561121557600080fd5b815167ffffffffffffffff81111561122c57600080fd5b61113184828501610e2a565b6000806040838503121561124b57600080fd5b823567ffffffffffffffff81111561126257600080fd5b61126e85828601610e9c565b925050602083013567ffffffffffffffff81111561128b57600080fd5b61118185828601610d4e565b6000602082840312156112a957600080fd5b60006111318484610ef9565b6000606082840312156112c757600080fd5b60006111318484610f57565b600080604083850312156112e657600080fd5b823567ffffffffffffffff8111156112fd57600080fd5b61130985828601610fb2565b925050602061118185828601610d36565b60006020828403121561132c57600080fd5b60006111318484610f05565b611341816119d9565b82525050565b6000611352826119d5565b808452602084019350611364836119cf565b60005b828110156113945761137a868351611619565b611383826119cf565b606096909601959150600101611367565b5093949350505050565b60006113a9826119d5565b808452602084019350836020820285016113c2856119cf565b60005b848110156113f95783830388526113dd838351611656565b92506113e8826119cf565b6020989098019791506001016113c5565b50909695505050505050565b6000611410826119d5565b808452602084019350611422836119cf565b60005b8281101561139457611438868351611759565b611441826119cf565b61010096909601959150600101611425565b600061145e826119d5565b808452602084019350611470836119cf565b60005b82811015611394576114868683516114a0565b61148f826119cf565b602096909601959150600101611473565b611341816119f2565b611341816119f5565b60006114bd826119d5565b8084526114d1816020860160208601611a31565b6114da81611a5d565b9093016020019392505050565b602681527f475245415445525f4f525f455155414c5f544f5f33325f4c454e4754485f524560208201527f5155495245440000000000000000000000000000000000000000000000000000604082015260600190565b601781527f554e535550504f525445445f41535345545f50524f5859000000000000000000602082015260400190565b602681527f475245415445525f4f525f455155414c5f544f5f32305f4c454e4754485f524560208201527f5155495245440000000000000000000000000000000000000000000000000000604082015260600190565b602581527f475245415445525f4f525f455155414c5f544f5f345f4c454e4754485f52455160208201527f5549524544000000000000000000000000000000000000000000000000000000604082015260600190565b8051606083019061162a84826117f0565b50602082015161163d60208501826114a0565b50604082015161165060408501826114a0565b50505050565b805160009061018084019061166b8582611338565b50602083015161167e6020860182611338565b5060408301516116916040860182611338565b5060608301516116a46060860182611338565b5060808301516116b760808601826114a0565b5060a08301516116ca60a08601826114a0565b5060c08301516116dd60c08601826114a0565b5060e08301516116f060e08601826114a0565b506101008301516117056101008601826114a0565b5061012083015161171a6101208601826114a0565b5061014083015184820361014086015261173482826114b2565b91505061016083015184820361016086015261175082826114b2565b95945050505050565b805161010083019061176b84826114a0565b50602082015161177e60208501826114a0565b50604082015161179160408501826114a0565b5060608201516117a460608501826114a0565b5060808201516117b760808501826114a0565b5060a08201516117ca60a08501826114a0565b5060c08201516117dd60c08501826114a0565b5060e082015161165060e08501826114a0565b61134181611a1a565b602081016109a38284611338565b604081016118158285611338565b610c7e6020830184611338565b604080825281016118338185611347565b905081810360208301526111318184611405565b60208082528101610c7e818461139e565b60208082528101610c7e8184611405565b6040808252810161187a8185611453565b905081810360208301526111318184611453565b602081016109a382846114a9565b602080825281016109a3816114e7565b602080825281016109a38161153d565b602080825281016109a38161156d565b602080825281016109a3816115c3565b61016081016118eb8285611619565b610c7e6060830184611759565b60208082528101610c7e8184611656565b61010081016109a38284611759565b602081016109a382846114a0565b6040810161193482856114a0565b610c7e60208301846114a0565b60405181810167ffffffffffffffff8111828210171561196057600080fd5b604052919050565b600067ffffffffffffffff82111561197f57600080fd5b5060209081020190565b600067ffffffffffffffff8211156119a057600080fd5b506020601f919091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0160190565b60200190565b5190565b73ffffffffffffffffffffffffffffffffffffffff1690565b90565b7fffffffff000000000000000000000000000000000000000000000000000000001690565b60ff1690565b151590565b82818337506000910152565b60005b83811015611a4c578181015183820152602001611a34565b838111156116505750506000910152565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016905600a265627a7a72305820d2e97e29f930427e8936d11af9a8ee1660886400d9687abb10c976177f33449c6c6578706572696d656e74616cf50037",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH3 0x11 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x40 MLOAD PUSH3 0x1D3A CODESIZE SUB DUP1 PUSH3 0x1D3A DUP4 CODECOPY DUP2 ADD DUP1 PUSH1 0x40 MSTORE PUSH3 0x37 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH3 0x186 JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB NOT AND PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB DUP5 AND OR SWAP1 SSTORE DUP1 MLOAD PUSH3 0x67 SWAP1 PUSH1 0x1 SWAP1 PUSH1 0x20 DUP5 ADD SWAP1 PUSH3 0x70 JUMP JUMPDEST POP POP POP PUSH3 0x26B JUMP JUMPDEST DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 PUSH1 0x1F ADD PUSH1 0x20 SWAP1 DIV DUP2 ADD SWAP3 DUP3 PUSH1 0x1F LT PUSH3 0xB3 JUMPI DUP1 MLOAD PUSH1 0xFF NOT AND DUP4 DUP1 ADD OR DUP6 SSTORE PUSH3 0xE3 JUMP JUMPDEST DUP3 DUP1 ADD PUSH1 0x1 ADD DUP6 SSTORE DUP3 ISZERO PUSH3 0xE3 JUMPI SWAP2 DUP3 ADD JUMPDEST DUP3 DUP2 GT ISZERO PUSH3 0xE3 JUMPI DUP3 MLOAD DUP3 SSTORE SWAP2 PUSH1 0x20 ADD SWAP2 SWAP1 PUSH1 0x1 ADD SWAP1 PUSH3 0xC6 JUMP JUMPDEST POP PUSH3 0xF1 SWAP3 SWAP2 POP PUSH3 0xF5 JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST PUSH3 0x112 SWAP2 SWAP1 JUMPDEST DUP1 DUP3 GT ISZERO PUSH3 0xF1 JUMPI PUSH1 0x0 DUP2 SSTORE PUSH1 0x1 ADD PUSH3 0xFC JUMP JUMPDEST SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH3 0x123 DUP3 MLOAD PUSH3 0x22C JUMP JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH3 0x13C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 MLOAD PUSH3 0x153 PUSH3 0x14D DUP3 PUSH3 0x204 JUMP JUMPDEST PUSH3 0x1DD JUMP JUMPDEST SWAP2 POP DUP1 DUP3 MSTORE PUSH1 0x20 DUP4 ADD PUSH1 0x20 DUP4 ADD DUP6 DUP4 DUP4 ADD GT ISZERO PUSH3 0x170 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH3 0x17D DUP4 DUP3 DUP5 PUSH3 0x238 JUMP JUMPDEST POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH3 0x19A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH3 0x1A8 DUP6 DUP6 PUSH3 0x115 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 DUP4 ADD MLOAD PUSH1 0x1 PUSH1 0x40 PUSH1 0x2 EXP SUB DUP2 GT ISZERO PUSH3 0x1C5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH3 0x1D3 DUP6 DUP3 DUP7 ADD PUSH3 0x12A JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x40 MLOAD DUP2 DUP2 ADD PUSH1 0x1 PUSH1 0x40 PUSH1 0x2 EXP SUB DUP2 GT DUP3 DUP3 LT OR ISZERO PUSH3 0x1FC JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x40 MSTORE SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1 PUSH1 0x40 PUSH1 0x2 EXP SUB DUP3 GT ISZERO PUSH3 0x21B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x20 PUSH1 0x1F SWAP2 SWAP1 SWAP2 ADD PUSH1 0x1F NOT AND ADD SWAP1 JUMP JUMPDEST PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB AND SWAP1 JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH3 0x255 JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH3 0x23B JUMP JUMPDEST DUP4 DUP2 GT ISZERO PUSH3 0x265 JUMPI PUSH1 0x0 DUP5 DUP5 ADD MSTORE JUMPDEST POP POP POP POP JUMP JUMPDEST PUSH2 0x1ABF DUP1 PUSH3 0x27B PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN STOP PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x82 JUMPI PUSH4 0xFFFFFFFF PUSH29 0x100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD DIV AND PUSH4 0x4AD1E53 DUP2 EQ PUSH2 0x87 JUMPI DUP1 PUSH4 0x2CD0FC73 EQ PUSH2 0xBE JUMPI DUP1 PUSH4 0x4B95DE13 EQ PUSH2 0xEC JUMPI DUP1 PUSH4 0x690D3114 EQ PUSH2 0x11A JUMPI DUP1 PUSH4 0xB6988463 EQ PUSH2 0x147 JUMPI DUP1 PUSH4 0xC6B7F4EE EQ PUSH2 0x174 JUMPI DUP1 PUSH4 0xF241FFB0 EQ PUSH2 0x1A2 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x93 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xA7 PUSH2 0xA2 CALLDATASIZE PUSH1 0x4 PUSH2 0x12D3 JUMP JUMPDEST PUSH2 0x1CF JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xB5 SWAP3 SWAP2 SWAP1 PUSH2 0x18DC JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xCA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xDE PUSH2 0xD9 CALLDATASIZE PUSH1 0x4 PUSH2 0x118B JUMP JUMPDEST PUSH2 0x29C JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xB5 SWAP3 SWAP2 SWAP1 PUSH2 0x1926 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xF8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x10C PUSH2 0x107 CALLDATASIZE PUSH1 0x4 PUSH2 0x1238 JUMP JUMPDEST PUSH2 0x7CD JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xB5 SWAP3 SWAP2 SWAP1 PUSH2 0x1822 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x126 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x13A PUSH2 0x135 CALLDATASIZE PUSH1 0x4 PUSH2 0x1238 JUMP JUMPDEST PUSH2 0x8A4 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xB5 SWAP2 SWAP1 PUSH2 0x1858 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x153 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x167 PUSH2 0x162 CALLDATASIZE PUSH1 0x4 PUSH2 0x11D3 JUMP JUMPDEST PUSH2 0x95E JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xB5 SWAP2 SWAP1 PUSH2 0x17F9 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x180 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x194 PUSH2 0x18F CALLDATASIZE PUSH1 0x4 PUSH2 0x1139 JUMP JUMPDEST PUSH2 0x9A9 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xB5 SWAP3 SWAP2 SWAP1 PUSH2 0x1869 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1AE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1C2 PUSH2 0x1BD CALLDATASIZE PUSH1 0x4 PUSH2 0x12D3 JUMP JUMPDEST PUSH2 0xA86 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xB5 SWAP2 SWAP1 PUSH2 0x1909 JUMP JUMPDEST PUSH2 0x1D7 PUSH2 0xCD0 JUMP JUMPDEST PUSH2 0x1DF PUSH2 0xCF0 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x40 MLOAD PUSH32 0xC75E0A8100000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP2 AND SWAP1 PUSH4 0xC75E0A81 SWAP1 PUSH2 0x235 SWAP1 DUP8 SWAP1 PUSH1 0x4 ADD PUSH2 0x18F8 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x24F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x263 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP PUSH2 0x287 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x12B5 JUMP JUMPDEST SWAP2 POP PUSH2 0x293 DUP5 DUP5 PUSH2 0xA86 JUMP JUMPDEST SWAP1 POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP1 DUP1 DUP1 DUP1 DUP1 DUP1 PUSH2 0x2B5 DUP10 DUP3 PUSH4 0xFFFFFFFF PUSH2 0xBA4 AND JUMP JUMPDEST SWAP6 POP PUSH2 0x2C8 DUP10 PUSH1 0x10 PUSH4 0xFFFFFFFF PUSH2 0xC11 AND JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x40 MLOAD PUSH32 0x6070410800000000000000000000000000000000000000000000000000000000 DUP2 MSTORE SWAP2 SWAP7 POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH4 0x60704108 SWAP1 PUSH2 0x31F SWAP1 DUP10 SWAP1 PUSH1 0x4 ADD PUSH2 0x188E JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x339 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x34D JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP PUSH2 0x371 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x1113 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0x4552433230546F6B656E28616464726573732900000000000000000000000000 DUP2 MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x13 ADD SWAP1 KECCAK256 SWAP1 SWAP5 POP PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 DUP8 DUP2 AND SWAP2 AND EQ ISZERO PUSH2 0x526 JUMPI PUSH1 0x40 MLOAD PUSH32 0x70A0823100000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP7 AND SWAP1 PUSH4 0x70A08231 SWAP1 PUSH2 0x424 SWAP1 DUP14 SWAP1 PUSH1 0x4 ADD PUSH2 0x17F9 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x43E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x452 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP PUSH2 0x476 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x131A JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH32 0xDD62ED3E00000000000000000000000000000000000000000000000000000000 DUP2 MSTORE SWAP1 SWAP9 POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP7 AND SWAP1 PUSH4 0xDD62ED3E SWAP1 PUSH2 0x4CD SWAP1 DUP14 SWAP1 DUP9 SWAP1 PUSH1 0x4 ADD PUSH2 0x1807 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x4E7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x4FB JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP PUSH2 0x51F SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x131A JUMP JUMPDEST SWAP7 POP PUSH2 0x7C0 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0x455243373231546F6B656E28616464726573732C75696E743235362900000000 DUP2 MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x1C ADD SWAP1 KECCAK256 PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 DUP8 DUP2 AND SWAP2 AND EQ ISZERO PUSH2 0x785 JUMPI PUSH2 0x595 DUP10 PUSH1 0x24 PUSH4 0xFFFFFFFF PUSH2 0xC72 AND JUMP JUMPDEST SWAP3 POP PUSH2 0x5A1 DUP6 DUP5 PUSH2 0x95E JUMP JUMPDEST SWAP2 POP DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP11 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0x5DD JUMPI PUSH1 0x0 PUSH2 0x5E0 JUMP JUMPDEST PUSH1 0x1 JUMPDEST PUSH1 0xFF AND SWAP8 POP DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0xE985E9C5 DUP12 DUP7 PUSH1 0x40 MLOAD DUP4 PUSH4 0xFFFFFFFF AND PUSH29 0x100000000000000000000000000000000000000000000000000000000 MUL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x63C SWAP3 SWAP2 SWAP1 PUSH2 0x1807 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x656 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x66A JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP PUSH2 0x68E SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x1297 JUMP JUMPDEST DUP1 PUSH2 0x76A JUMPI POP DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0x81812FC DUP6 PUSH1 0x40 MLOAD DUP3 PUSH4 0xFFFFFFFF AND PUSH29 0x100000000000000000000000000000000000000000000000000000000 MUL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x700 SWAP2 SWAP1 PUSH2 0x1918 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x71A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x72E JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP PUSH2 0x752 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x1113 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ JUMPDEST SWAP1 POP DUP1 PUSH2 0x778 JUMPI PUSH1 0x0 PUSH2 0x77B JUMP JUMPDEST PUSH1 0x1 JUMPDEST PUSH1 0xFF AND SWAP7 POP PUSH2 0x7C0 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x7B7 SWAP1 PUSH2 0x18AC JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP POP POP POP POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x40 MLOAD PUSH32 0x7E9D74DC00000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x60 SWAP2 DUP3 SWAP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP2 AND SWAP1 PUSH4 0x7E9D74DC SWAP1 PUSH2 0x828 SWAP1 DUP8 SWAP1 PUSH1 0x4 ADD PUSH2 0x1847 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x842 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x856 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x0 DUP3 RETURNDATACOPY PUSH1 0x1F RETURNDATASIZE SWAP1 DUP2 ADD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 AND DUP3 ADD PUSH1 0x40 MSTORE PUSH2 0x89C SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x1203 JUMP JUMPDEST SWAP2 POP PUSH2 0x293 DUP5 DUP5 JUMPDEST PUSH1 0x60 PUSH1 0x0 PUSH1 0x60 PUSH1 0x0 DUP6 MLOAD SWAP3 POP DUP3 PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x8EA JUMPI DUP2 PUSH1 0x20 ADD JUMPDEST PUSH2 0x8D7 PUSH2 0xCF0 JUMP JUMPDEST DUP2 MSTORE PUSH1 0x20 ADD SWAP1 PUSH1 0x1 SWAP1 SUB SWAP1 DUP2 PUSH2 0x8CF JUMPI SWAP1 POP JUMPDEST POP SWAP2 POP PUSH1 0x0 SWAP1 POP JUMPDEST DUP1 DUP4 EQ PUSH2 0x951 JUMPI PUSH2 0x931 DUP7 DUP3 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x90A JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP7 DUP4 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x922 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0xA86 JUMP JUMPDEST DUP3 DUP3 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x93F JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD MSTORE PUSH1 0x1 ADD PUSH2 0x8F2 JUMP JUMPDEST DUP2 SWAP4 POP JUMPDEST POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD PUSH32 0x6352211E00000000000000000000000000000000000000000000000000000000 DUP2 MSTORE DUP3 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x20 DUP2 PUSH1 0x24 DUP4 DUP8 GAS STATICCALL DUP1 ISZERO PUSH2 0x9A0 JUMPI DUP2 MLOAD SWAP3 POP JUMPDEST POP POP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x60 DUP1 PUSH1 0x0 PUSH1 0x60 DUP1 PUSH1 0x0 DUP7 MLOAD SWAP4 POP DUP4 PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x9E1 JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CODESIZE DUP4 CODECOPY ADD SWAP1 POP JUMPDEST POP SWAP3 POP DUP4 PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0xA0E JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CODESIZE DUP4 CODECOPY ADD SWAP1 POP JUMPDEST POP SWAP2 POP PUSH1 0x0 SWAP1 POP JUMPDEST DUP1 DUP5 EQ PUSH2 0xA79 JUMPI PUSH2 0xA3E DUP9 DUP9 DUP4 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xA2F JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x29C JUMP JUMPDEST DUP5 DUP4 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xA4C JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD DUP5 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xA63 JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD SWAP2 SWAP1 SWAP2 MSTORE MSTORE PUSH1 0x1 ADD PUSH2 0xA16 JUMP JUMPDEST POP SWAP1 SWAP7 SWAP1 SWAP6 POP SWAP4 POP POP POP POP JUMP JUMPDEST PUSH2 0xA8E PUSH2 0xCF0 JUMP JUMPDEST PUSH1 0x60 PUSH2 0xAA3 DUP5 PUSH1 0x0 ADD MLOAD DUP6 PUSH2 0x140 ADD MLOAD PUSH2 0x29C JUMP JUMPDEST PUSH1 0x20 DUP5 ADD MSTORE DUP3 MSTORE PUSH2 0x160 DUP5 ADD MLOAD PUSH2 0xABB SWAP1 DUP5 SWAP1 PUSH2 0x29C JUMP JUMPDEST PUSH1 0x60 DUP5 ADD MSTORE PUSH1 0x40 DUP1 DUP5 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x1 DUP1 SLOAD DUP3 MLOAD PUSH1 0x20 PUSH1 0x1F PUSH1 0x2 PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH2 0x100 DUP7 DUP9 AND ISZERO MUL ADD SWAP1 SWAP5 AND SWAP4 SWAP1 SWAP4 DIV SWAP3 DUP4 ADD DUP2 SWAP1 DIV DUP2 MUL DUP3 ADD DUP2 ADD SWAP1 SWAP5 MSTORE DUP2 DUP2 MSTORE SWAP3 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0xB6A JUMPI DUP1 PUSH1 0x1F LT PUSH2 0xB3F JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0xB6A JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0xB4D JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP1 POP PUSH2 0xB7F DUP5 PUSH1 0x0 ADD MLOAD DUP3 PUSH2 0x29C JUMP JUMPDEST PUSH1 0xA0 DUP5 ADD MSTORE PUSH1 0x80 DUP4 ADD MSTORE PUSH2 0xB93 DUP4 DUP3 PUSH2 0x29C JUMP JUMPDEST PUSH1 0xE0 DUP5 ADD MSTORE PUSH1 0xC0 DUP4 ADD MSTORE POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x4 ADD DUP4 MLOAD LT ISZERO ISZERO ISZERO PUSH2 0xBE6 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x7B7 SWAP1 PUSH2 0x18CC JUMP JUMPDEST POP ADD PUSH1 0x20 ADD MLOAD PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 AND SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x14 ADD DUP4 MLOAD LT ISZERO ISZERO ISZERO PUSH2 0xC53 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x7B7 SWAP1 PUSH2 0x18BC JUMP JUMPDEST POP ADD PUSH1 0x14 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0xC7E DUP4 DUP4 PUSH2 0xC85 JUMP JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x20 ADD DUP4 MLOAD LT ISZERO ISZERO ISZERO PUSH2 0xCC7 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x7B7 SWAP1 PUSH2 0x189C JUMP JUMPDEST POP ADD PUSH1 0x20 ADD MLOAD SWAP1 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x60 DUP2 ADD DUP3 MSTORE PUSH1 0x0 DUP1 DUP3 MSTORE PUSH1 0x20 DUP3 ADD DUP2 SWAP1 MSTORE SWAP2 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE SWAP1 JUMP JUMPDEST PUSH2 0x100 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE POP SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0xC7E DUP3 CALLDATALOAD PUSH2 0x19D9 JUMP JUMPDEST PUSH1 0x0 PUSH2 0xC7E DUP3 MLOAD PUSH2 0x19D9 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH2 0xD5F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0xD72 PUSH2 0xD6D DUP3 PUSH2 0x1968 JUMP JUMPDEST PUSH2 0x1941 JUMP JUMPDEST SWAP2 POP DUP2 DUP2 DUP4 MSTORE PUSH1 0x20 DUP5 ADD SWAP4 POP PUSH1 0x20 DUP2 ADD SWAP1 POP DUP4 DUP6 PUSH1 0x20 DUP5 MUL DUP3 ADD GT ISZERO PUSH2 0xD97 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0xDC3 JUMPI DUP2 PUSH2 0xDAD DUP9 DUP3 PUSH2 0xD36 JUMP JUMPDEST DUP5 MSTORE POP PUSH1 0x20 SWAP3 DUP4 ADD SWAP3 SWAP2 SWAP1 SWAP2 ADD SWAP1 PUSH1 0x1 ADD PUSH2 0xD9A JUMP JUMPDEST POP POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH2 0xDDE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0xDEC PUSH2 0xD6D DUP3 PUSH2 0x1968 JUMP JUMPDEST DUP2 DUP2 MSTORE PUSH1 0x20 SWAP4 DUP5 ADD SWAP4 SWAP1 SWAP3 POP DUP3 ADD DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0xDC3 JUMPI DUP2 CALLDATALOAD DUP7 ADD PUSH2 0xE14 DUP9 DUP3 PUSH2 0xF11 JUMP JUMPDEST DUP5 MSTORE POP PUSH1 0x20 SWAP3 DUP4 ADD SWAP3 SWAP2 SWAP1 SWAP2 ADD SWAP1 PUSH1 0x1 ADD PUSH2 0xDFE JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH2 0xE3B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 MLOAD PUSH2 0xE49 PUSH2 0xD6D DUP3 PUSH2 0x1968 JUMP JUMPDEST SWAP2 POP DUP2 DUP2 DUP4 MSTORE PUSH1 0x20 DUP5 ADD SWAP4 POP PUSH1 0x20 DUP2 ADD SWAP1 POP DUP4 DUP6 PUSH1 0x60 DUP5 MUL DUP3 ADD GT ISZERO PUSH2 0xE6E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0xDC3 JUMPI DUP2 PUSH2 0xE84 DUP9 DUP3 PUSH2 0xF57 JUMP JUMPDEST DUP5 MSTORE POP PUSH1 0x20 SWAP1 SWAP3 ADD SWAP2 PUSH1 0x60 SWAP2 SWAP1 SWAP2 ADD SWAP1 PUSH1 0x1 ADD PUSH2 0xE71 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH2 0xEAD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0xEBB PUSH2 0xD6D DUP3 PUSH2 0x1968 JUMP JUMPDEST DUP2 DUP2 MSTORE PUSH1 0x20 SWAP4 DUP5 ADD SWAP4 SWAP1 SWAP3 POP DUP3 ADD DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0xDC3 JUMPI DUP2 CALLDATALOAD DUP7 ADD PUSH2 0xEE3 DUP9 DUP3 PUSH2 0xFB2 JUMP JUMPDEST DUP5 MSTORE POP PUSH1 0x20 SWAP3 DUP4 ADD SWAP3 SWAP2 SWAP1 SWAP2 ADD SWAP1 PUSH1 0x1 ADD PUSH2 0xECD JUMP JUMPDEST PUSH1 0x0 PUSH2 0xC7E DUP3 MLOAD PUSH2 0x1A20 JUMP JUMPDEST PUSH1 0x0 PUSH2 0xC7E DUP3 MLOAD PUSH2 0x19F2 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH2 0xF22 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0xF30 PUSH2 0xD6D DUP3 PUSH2 0x1989 JUMP JUMPDEST SWAP2 POP DUP1 DUP3 MSTORE PUSH1 0x20 DUP4 ADD PUSH1 0x20 DUP4 ADD DUP6 DUP4 DUP4 ADD GT ISZERO PUSH2 0xF4C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x955 DUP4 DUP3 DUP5 PUSH2 0x1A25 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x60 DUP3 DUP5 SUB SLT ISZERO PUSH2 0xF69 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0xF73 PUSH1 0x60 PUSH2 0x1941 JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0xF81 DUP5 DUP5 PUSH2 0x1107 JUMP JUMPDEST DUP3 MSTORE POP PUSH1 0x20 PUSH2 0xF92 DUP5 DUP5 DUP4 ADD PUSH2 0xF05 JUMP JUMPDEST PUSH1 0x20 DUP4 ADD MSTORE POP PUSH1 0x40 PUSH2 0xFA6 DUP5 DUP3 DUP6 ADD PUSH2 0xF05 JUMP JUMPDEST PUSH1 0x40 DUP4 ADD MSTORE POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x180 DUP3 DUP5 SUB SLT ISZERO PUSH2 0xFC5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0xFD0 PUSH2 0x180 PUSH2 0x1941 JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0xFDE DUP5 DUP5 PUSH2 0xD36 JUMP JUMPDEST DUP3 MSTORE POP PUSH1 0x20 PUSH2 0xFEF DUP5 DUP5 DUP4 ADD PUSH2 0xD36 JUMP JUMPDEST PUSH1 0x20 DUP4 ADD MSTORE POP PUSH1 0x40 PUSH2 0x1003 DUP5 DUP3 DUP6 ADD PUSH2 0xD36 JUMP JUMPDEST PUSH1 0x40 DUP4 ADD MSTORE POP PUSH1 0x60 PUSH2 0x1017 DUP5 DUP3 DUP6 ADD PUSH2 0xD36 JUMP JUMPDEST PUSH1 0x60 DUP4 ADD MSTORE POP PUSH1 0x80 PUSH2 0x102B DUP5 DUP3 DUP6 ADD PUSH2 0x10FB JUMP JUMPDEST PUSH1 0x80 DUP4 ADD MSTORE POP PUSH1 0xA0 PUSH2 0x103F DUP5 DUP3 DUP6 ADD PUSH2 0x10FB JUMP JUMPDEST PUSH1 0xA0 DUP4 ADD MSTORE POP PUSH1 0xC0 PUSH2 0x1053 DUP5 DUP3 DUP6 ADD PUSH2 0x10FB JUMP JUMPDEST PUSH1 0xC0 DUP4 ADD MSTORE POP PUSH1 0xE0 PUSH2 0x1067 DUP5 DUP3 DUP6 ADD PUSH2 0x10FB JUMP JUMPDEST PUSH1 0xE0 DUP4 ADD MSTORE POP PUSH2 0x100 PUSH2 0x107C DUP5 DUP3 DUP6 ADD PUSH2 0x10FB JUMP JUMPDEST PUSH2 0x100 DUP4 ADD MSTORE POP PUSH2 0x120 PUSH2 0x1092 DUP5 DUP3 DUP6 ADD PUSH2 0x10FB JUMP JUMPDEST PUSH2 0x120 DUP4 ADD MSTORE POP PUSH2 0x140 DUP3 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x10B4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x10C0 DUP5 DUP3 DUP6 ADD PUSH2 0xF11 JUMP JUMPDEST PUSH2 0x140 DUP4 ADD MSTORE POP PUSH2 0x160 DUP3 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x10E2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x10EE DUP5 DUP3 DUP6 ADD PUSH2 0xF11 JUMP JUMPDEST PUSH2 0x160 DUP4 ADD MSTORE POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0xC7E DUP3 CALLDATALOAD PUSH2 0x19F2 JUMP JUMPDEST PUSH1 0x0 PUSH2 0xC7E DUP3 MLOAD PUSH2 0x1A1A JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x1125 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1131 DUP5 DUP5 PUSH2 0xD42 JUMP JUMPDEST SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x114C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1158 DUP6 DUP6 PUSH2 0xD36 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 DUP4 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1175 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1181 DUP6 DUP3 DUP7 ADD PUSH2 0xDCD JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x119E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x11AA DUP6 DUP6 PUSH2 0xD36 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 DUP4 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x11C7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1181 DUP6 DUP3 DUP7 ADD PUSH2 0xF11 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x11E6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x11F2 DUP6 DUP6 PUSH2 0xD36 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0x1181 DUP6 DUP3 DUP7 ADD PUSH2 0x10FB JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x1215 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 MLOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x122C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1131 DUP5 DUP3 DUP6 ADD PUSH2 0xE2A JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x124B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1262 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x126E DUP6 DUP3 DUP7 ADD PUSH2 0xE9C JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 DUP4 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x128B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1181 DUP6 DUP3 DUP7 ADD PUSH2 0xD4E JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x12A9 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1131 DUP5 DUP5 PUSH2 0xEF9 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x60 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x12C7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1131 DUP5 DUP5 PUSH2 0xF57 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x12E6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x12FD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1309 DUP6 DUP3 DUP7 ADD PUSH2 0xFB2 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0x1181 DUP6 DUP3 DUP7 ADD PUSH2 0xD36 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x132C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1131 DUP5 DUP5 PUSH2 0xF05 JUMP JUMPDEST PUSH2 0x1341 DUP2 PUSH2 0x19D9 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x1352 DUP3 PUSH2 0x19D5 JUMP JUMPDEST DUP1 DUP5 MSTORE PUSH1 0x20 DUP5 ADD SWAP4 POP PUSH2 0x1364 DUP4 PUSH2 0x19CF JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP3 DUP2 LT ISZERO PUSH2 0x1394 JUMPI PUSH2 0x137A DUP7 DUP4 MLOAD PUSH2 0x1619 JUMP JUMPDEST PUSH2 0x1383 DUP3 PUSH2 0x19CF JUMP JUMPDEST PUSH1 0x60 SWAP7 SWAP1 SWAP7 ADD SWAP6 SWAP2 POP PUSH1 0x1 ADD PUSH2 0x1367 JUMP JUMPDEST POP SWAP4 SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x13A9 DUP3 PUSH2 0x19D5 JUMP JUMPDEST DUP1 DUP5 MSTORE PUSH1 0x20 DUP5 ADD SWAP4 POP DUP4 PUSH1 0x20 DUP3 MUL DUP6 ADD PUSH2 0x13C2 DUP6 PUSH2 0x19CF JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP5 DUP2 LT ISZERO PUSH2 0x13F9 JUMPI DUP4 DUP4 SUB DUP9 MSTORE PUSH2 0x13DD DUP4 DUP4 MLOAD PUSH2 0x1656 JUMP JUMPDEST SWAP3 POP PUSH2 0x13E8 DUP3 PUSH2 0x19CF JUMP JUMPDEST PUSH1 0x20 SWAP9 SWAP1 SWAP9 ADD SWAP8 SWAP2 POP PUSH1 0x1 ADD PUSH2 0x13C5 JUMP JUMPDEST POP SWAP1 SWAP7 SWAP6 POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x1410 DUP3 PUSH2 0x19D5 JUMP JUMPDEST DUP1 DUP5 MSTORE PUSH1 0x20 DUP5 ADD SWAP4 POP PUSH2 0x1422 DUP4 PUSH2 0x19CF JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP3 DUP2 LT ISZERO PUSH2 0x1394 JUMPI PUSH2 0x1438 DUP7 DUP4 MLOAD PUSH2 0x1759 JUMP JUMPDEST PUSH2 0x1441 DUP3 PUSH2 0x19CF JUMP JUMPDEST PUSH2 0x100 SWAP7 SWAP1 SWAP7 ADD SWAP6 SWAP2 POP PUSH1 0x1 ADD PUSH2 0x1425 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x145E DUP3 PUSH2 0x19D5 JUMP JUMPDEST DUP1 DUP5 MSTORE PUSH1 0x20 DUP5 ADD SWAP4 POP PUSH2 0x1470 DUP4 PUSH2 0x19CF JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP3 DUP2 LT ISZERO PUSH2 0x1394 JUMPI PUSH2 0x1486 DUP7 DUP4 MLOAD PUSH2 0x14A0 JUMP JUMPDEST PUSH2 0x148F DUP3 PUSH2 0x19CF JUMP JUMPDEST PUSH1 0x20 SWAP7 SWAP1 SWAP7 ADD SWAP6 SWAP2 POP PUSH1 0x1 ADD PUSH2 0x1473 JUMP JUMPDEST PUSH2 0x1341 DUP2 PUSH2 0x19F2 JUMP JUMPDEST PUSH2 0x1341 DUP2 PUSH2 0x19F5 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x14BD DUP3 PUSH2 0x19D5 JUMP JUMPDEST DUP1 DUP5 MSTORE PUSH2 0x14D1 DUP2 PUSH1 0x20 DUP7 ADD PUSH1 0x20 DUP7 ADD PUSH2 0x1A31 JUMP JUMPDEST PUSH2 0x14DA DUP2 PUSH2 0x1A5D JUMP JUMPDEST SWAP1 SWAP4 ADD PUSH1 0x20 ADD SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x26 DUP2 MSTORE PUSH32 0x475245415445525F4F525F455155414C5F544F5F33325F4C454E4754485F5245 PUSH1 0x20 DUP3 ADD MSTORE PUSH32 0x5155495245440000000000000000000000000000000000000000000000000000 PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x60 ADD SWAP1 JUMP JUMPDEST PUSH1 0x17 DUP2 MSTORE PUSH32 0x554E535550504F525445445F41535345545F50524F5859000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x26 DUP2 MSTORE PUSH32 0x475245415445525F4F525F455155414C5F544F5F32305F4C454E4754485F5245 PUSH1 0x20 DUP3 ADD MSTORE PUSH32 0x5155495245440000000000000000000000000000000000000000000000000000 PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x60 ADD SWAP1 JUMP JUMPDEST PUSH1 0x25 DUP2 MSTORE PUSH32 0x475245415445525F4F525F455155414C5F544F5F345F4C454E4754485F524551 PUSH1 0x20 DUP3 ADD MSTORE PUSH32 0x5549524544000000000000000000000000000000000000000000000000000000 PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x60 ADD SWAP1 JUMP JUMPDEST DUP1 MLOAD PUSH1 0x60 DUP4 ADD SWAP1 PUSH2 0x162A DUP5 DUP3 PUSH2 0x17F0 JUMP JUMPDEST POP PUSH1 0x20 DUP3 ADD MLOAD PUSH2 0x163D PUSH1 0x20 DUP6 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH1 0x40 DUP3 ADD MLOAD PUSH2 0x1650 PUSH1 0x40 DUP6 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP POP POP POP JUMP JUMPDEST DUP1 MLOAD PUSH1 0x0 SWAP1 PUSH2 0x180 DUP5 ADD SWAP1 PUSH2 0x166B DUP6 DUP3 PUSH2 0x1338 JUMP JUMPDEST POP PUSH1 0x20 DUP4 ADD MLOAD PUSH2 0x167E PUSH1 0x20 DUP7 ADD DUP3 PUSH2 0x1338 JUMP JUMPDEST POP PUSH1 0x40 DUP4 ADD MLOAD PUSH2 0x1691 PUSH1 0x40 DUP7 ADD DUP3 PUSH2 0x1338 JUMP JUMPDEST POP PUSH1 0x60 DUP4 ADD MLOAD PUSH2 0x16A4 PUSH1 0x60 DUP7 ADD DUP3 PUSH2 0x1338 JUMP JUMPDEST POP PUSH1 0x80 DUP4 ADD MLOAD PUSH2 0x16B7 PUSH1 0x80 DUP7 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH1 0xA0 DUP4 ADD MLOAD PUSH2 0x16CA PUSH1 0xA0 DUP7 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH1 0xC0 DUP4 ADD MLOAD PUSH2 0x16DD PUSH1 0xC0 DUP7 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH1 0xE0 DUP4 ADD MLOAD PUSH2 0x16F0 PUSH1 0xE0 DUP7 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH2 0x100 DUP4 ADD MLOAD PUSH2 0x1705 PUSH2 0x100 DUP7 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH2 0x120 DUP4 ADD MLOAD PUSH2 0x171A PUSH2 0x120 DUP7 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH2 0x140 DUP4 ADD MLOAD DUP5 DUP3 SUB PUSH2 0x140 DUP7 ADD MSTORE PUSH2 0x1734 DUP3 DUP3 PUSH2 0x14B2 JUMP JUMPDEST SWAP2 POP POP PUSH2 0x160 DUP4 ADD MLOAD DUP5 DUP3 SUB PUSH2 0x160 DUP7 ADD MSTORE PUSH2 0x1750 DUP3 DUP3 PUSH2 0x14B2 JUMP JUMPDEST SWAP6 SWAP5 POP POP POP POP POP JUMP JUMPDEST DUP1 MLOAD PUSH2 0x100 DUP4 ADD SWAP1 PUSH2 0x176B DUP5 DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH1 0x20 DUP3 ADD MLOAD PUSH2 0x177E PUSH1 0x20 DUP6 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH1 0x40 DUP3 ADD MLOAD PUSH2 0x1791 PUSH1 0x40 DUP6 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH1 0x60 DUP3 ADD MLOAD PUSH2 0x17A4 PUSH1 0x60 DUP6 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH1 0x80 DUP3 ADD MLOAD PUSH2 0x17B7 PUSH1 0x80 DUP6 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH1 0xA0 DUP3 ADD MLOAD PUSH2 0x17CA PUSH1 0xA0 DUP6 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH1 0xC0 DUP3 ADD MLOAD PUSH2 0x17DD PUSH1 0xC0 DUP6 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH1 0xE0 DUP3 ADD MLOAD PUSH2 0x1650 PUSH1 0xE0 DUP6 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST PUSH2 0x1341 DUP2 PUSH2 0x1A1A JUMP JUMPDEST PUSH1 0x20 DUP2 ADD PUSH2 0x9A3 DUP3 DUP5 PUSH2 0x1338 JUMP JUMPDEST PUSH1 0x40 DUP2 ADD PUSH2 0x1815 DUP3 DUP6 PUSH2 0x1338 JUMP JUMPDEST PUSH2 0xC7E PUSH1 0x20 DUP4 ADD DUP5 PUSH2 0x1338 JUMP JUMPDEST PUSH1 0x40 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x1833 DUP2 DUP6 PUSH2 0x1347 JUMP JUMPDEST SWAP1 POP DUP2 DUP2 SUB PUSH1 0x20 DUP4 ADD MSTORE PUSH2 0x1131 DUP2 DUP5 PUSH2 0x1405 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0xC7E DUP2 DUP5 PUSH2 0x139E JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0xC7E DUP2 DUP5 PUSH2 0x1405 JUMP JUMPDEST PUSH1 0x40 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x187A DUP2 DUP6 PUSH2 0x1453 JUMP JUMPDEST SWAP1 POP DUP2 DUP2 SUB PUSH1 0x20 DUP4 ADD MSTORE PUSH2 0x1131 DUP2 DUP5 PUSH2 0x1453 JUMP JUMPDEST PUSH1 0x20 DUP2 ADD PUSH2 0x9A3 DUP3 DUP5 PUSH2 0x14A9 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x9A3 DUP2 PUSH2 0x14E7 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x9A3 DUP2 PUSH2 0x153D JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x9A3 DUP2 PUSH2 0x156D JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x9A3 DUP2 PUSH2 0x15C3 JUMP JUMPDEST PUSH2 0x160 DUP2 ADD PUSH2 0x18EB DUP3 DUP6 PUSH2 0x1619 JUMP JUMPDEST PUSH2 0xC7E PUSH1 0x60 DUP4 ADD DUP5 PUSH2 0x1759 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0xC7E DUP2 DUP5 PUSH2 0x1656 JUMP JUMPDEST PUSH2 0x100 DUP2 ADD PUSH2 0x9A3 DUP3 DUP5 PUSH2 0x1759 JUMP JUMPDEST PUSH1 0x20 DUP2 ADD PUSH2 0x9A3 DUP3 DUP5 PUSH2 0x14A0 JUMP JUMPDEST PUSH1 0x40 DUP2 ADD PUSH2 0x1934 DUP3 DUP6 PUSH2 0x14A0 JUMP JUMPDEST PUSH2 0xC7E PUSH1 0x20 DUP4 ADD DUP5 PUSH2 0x14A0 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP2 DUP2 ADD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT DUP3 DUP3 LT OR ISZERO PUSH2 0x1960 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x40 MSTORE SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH8 0xFFFFFFFFFFFFFFFF DUP3 GT ISZERO PUSH2 0x197F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x20 SWAP1 DUP2 MUL ADD SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH8 0xFFFFFFFFFFFFFFFF DUP3 GT ISZERO PUSH2 0x19A0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x20 PUSH1 0x1F SWAP2 SWAP1 SWAP2 ADD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 AND ADD SWAP1 JUMP JUMPDEST PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST MLOAD SWAP1 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 JUMP JUMPDEST SWAP1 JUMP JUMPDEST PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 AND SWAP1 JUMP JUMPDEST PUSH1 0xFF AND SWAP1 JUMP JUMPDEST ISZERO ISZERO SWAP1 JUMP JUMPDEST DUP3 DUP2 DUP4 CALLDATACOPY POP PUSH1 0x0 SWAP2 ADD MSTORE JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x1A4C JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH2 0x1A34 JUMP JUMPDEST DUP4 DUP2 GT ISZERO PUSH2 0x1650 JUMPI POP POP PUSH1 0x0 SWAP2 ADD MSTORE JUMP JUMPDEST PUSH1 0x1F ADD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 AND SWAP1 JUMP STOP LOG2 PUSH6 0x627A7A723058 KECCAK256 0xd2 0xe9 PUSH31 0x29F930427E8936D11AF9A8EE1660886400D9687ABB10C976177F33449C6C65 PUSH25 0x706572696D656E74616CF50037000000000000000000000000 ",
- "sourceMap": "898:8536:11:-;;;1916:167;8:9:-1;5:2;;;30:1;27;20:12;5:2;1916:167:11;;;;;;;;;;;;;;;;;;;;;;;;2005:8;:31;;-1:-1:-1;;;;;;2005:31:11;-1:-1:-1;;;;;2005:31:11;;;;;2046:30;;;;-1:-1:-1;;2046:30:11;;;;;:::i;:::-;;1916:167;;898:8536;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;898:8536:11;;;-1:-1:-1;898:8536:11;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;:::o;5:122:-1:-;;83:39;114:6;108:13;83:39;;;74:48;68:59;-1:-1;;;68:59;135:442;;240:4;228:17;;224:27;-1:-1;214:2;;265:1;262;255:12;214:2;295:6;289:13;317:64;332:48;373:6;332:48;;;317:64;;;308:73;;401:6;394:5;387:21;437:4;429:6;425:17;470:4;463:5;459:16;505:3;496:6;491:3;487:16;484:25;481:2;;;522:1;519;512:12;481:2;532:39;564:6;559:3;554;532:39;;;207:370;;;;;;;;585:496;;;726:2;714:9;705:7;701:23;697:32;694:2;;;742:1;739;732:12;694:2;777:1;794:64;850:7;830:9;794:64;;;784:74;;756:108;916:2;905:9;901:18;895:25;-1:-1;;;;;932:6;929:30;926:2;;;972:1;969;962:12;926:2;992:73;1057:7;1048:6;1037:9;1033:22;992:73;;;982:83;;874:197;688:393;;;;;;1088:256;1150:2;1144:9;1176:17;;;-1:-1;;;;;1236:34;;1272:22;;;1233:62;1230:2;;;1308:1;1305;1298:12;1230:2;1324;1317:22;1128:216;;-1:-1;1128:216;1351:258;;-1:-1;;;;;1486:6;1483:30;1480:2;;;1526:1;1523;1516:12;1480:2;-1:-1;1599:4;1570;1547:17;;;;-1:-1;;1543:33;1589:15;;1417:192;1616:128;-1:-1;;;;;1685:54;;1668:76;1752:268;1817:1;1824:101;1838:6;1835:1;1832:13;1824:101;;;1905:11;;;1899:18;1886:11;;;1879:39;1860:2;1853:10;1824:101;;;1940:6;1937:1;1934:13;1931:2;;;2005:1;1996:6;1991:3;1987:16;1980:27;1931:2;1801:219;;;;;;898:8536:11;;;;;;"
- },
- "deployedBytecode": {
- "linkReferences": {},
- "object": "0x6080604052600436106100825763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166304ad1e5381146100875780632cd0fc73146100be5780634b95de13146100ec578063690d31141461011a578063b698846314610147578063c6b7f4ee14610174578063f241ffb0146101a2575b600080fd5b34801561009357600080fd5b506100a76100a23660046112d3565b6101cf565b6040516100b59291906118dc565b60405180910390f35b3480156100ca57600080fd5b506100de6100d936600461118b565b61029c565b6040516100b5929190611926565b3480156100f857600080fd5b5061010c610107366004611238565b6107cd565b6040516100b5929190611822565b34801561012657600080fd5b5061013a610135366004611238565b6108a4565b6040516100b59190611858565b34801561015357600080fd5b506101676101623660046111d3565b61095e565b6040516100b591906117f9565b34801561018057600080fd5b5061019461018f366004611139565b6109a9565b6040516100b5929190611869565b3480156101ae57600080fd5b506101c26101bd3660046112d3565b610a86565b6040516100b59190611909565b6101d7610cd0565b6101df610cf0565b6000546040517fc75e0a8100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091169063c75e0a81906102359087906004016118f8565b606060405180830381600087803b15801561024f57600080fd5b505af1158015610263573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061028791908101906112b5565b91506102938484610a86565b90509250929050565b6000808080808080806102b5898263ffffffff610ba416565b95506102c889601063ffffffff610c1116565b6000546040517f6070410800000000000000000000000000000000000000000000000000000000815291965073ffffffffffffffffffffffffffffffffffffffff169063607041089061031f90899060040161188e565b602060405180830381600087803b15801561033957600080fd5b505af115801561034d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506103719190810190611113565b604080517f4552433230546f6b656e28616464726573732900000000000000000000000000815290519081900360130190209094507fffffffff0000000000000000000000000000000000000000000000000000000087811691161415610526576040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8616906370a0823190610424908d906004016117f9565b602060405180830381600087803b15801561043e57600080fd5b505af1158015610452573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610476919081019061131a565b6040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815290985073ffffffffffffffffffffffffffffffffffffffff86169063dd62ed3e906104cd908d908890600401611807565b602060405180830381600087803b1580156104e757600080fd5b505af11580156104fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061051f919081019061131a565b96506107c0565b604080517f455243373231546f6b656e28616464726573732c75696e7432353629000000008152905190819003601c0190207fffffffff00000000000000000000000000000000000000000000000000000000878116911614156107855761059589602463ffffffff610c7216565b92506105a1858461095e565b91508173ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff16146105dd5760006105e0565b60015b60ff1697508473ffffffffffffffffffffffffffffffffffffffff1663e985e9c58b866040518363ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040161063c929190611807565b602060405180830381600087803b15801561065657600080fd5b505af115801561066a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061068e9190810190611297565b8061076a57508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1663081812fc856040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004016107009190611918565b602060405180830381600087803b15801561071a57600080fd5b505af115801561072e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506107529190810190611113565b73ffffffffffffffffffffffffffffffffffffffff16145b90508061077857600061077b565b60015b60ff1696506107c0565b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107b7906118ac565b60405180910390fd5b5050505050509250929050565b6000546040517f7e9d74dc000000000000000000000000000000000000000000000000000000008152606091829173ffffffffffffffffffffffffffffffffffffffff90911690637e9d74dc90610828908790600401611847565b600060405180830381600087803b15801561084257600080fd5b505af1158015610856573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405261089c9190810190611203565b915061029384845b606060006060600085519250826040519080825280602002602001820160405280156108ea57816020015b6108d7610cf0565b8152602001906001900390816108cf5790505b509150600090505b80831461095157610931868281518110151561090a57fe5b90602001906020020151868381518110151561092257fe5b90602001906020020151610a86565b828281518110151561093f57fe5b602090810290910101526001016108f2565b8193505b50505092915050565b60006040517f6352211e000000000000000000000000000000000000000000000000000000008152826004820152602081602483875afa80156109a057815192505b50505b92915050565b6060806000606080600086519350836040519080825280602002602001820160405280156109e1578160200160208202803883390190505b50925083604051908082528060200260200182016040528015610a0e578160200160208202803883390190505b509150600090505b808414610a7957610a3e888883815181101515610a2f57fe5b9060200190602002015161029c565b8483815181101515610a4c57fe5b9060200190602002018484815181101515610a6357fe5b6020908102909101019190915252600101610a16565b5090969095509350505050565b610a8e610cf0565b6060610aa3846000015185610140015161029c565b60208401528252610160840151610abb90849061029c565b60608401526040808401919091526001805482516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101008688161502019094169390930492830181900481028201810190945281815292830182828015610b6a5780601f10610b3f57610100808354040283529160200191610b6a565b820191906000526020600020905b815481529060010190602001808311610b4d57829003601f168201915b50505050509050610b7f84600001518261029c565b60a08401526080830152610b93838261029c565b60e084015260c08301525092915050565b600081600401835110151515610be6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107b7906118cc565b5001602001517fffffffff000000000000000000000000000000000000000000000000000000001690565b600081601401835110151515610c53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107b7906118bc565b50016014015173ffffffffffffffffffffffffffffffffffffffff1690565b6000610c7e8383610c85565b9392505050565b600081602001835110151515610cc7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107b79061189c565b50016020015190565b604080516060810182526000808252602082018190529181019190915290565b6101006040519081016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6000610c7e82356119d9565b6000610c7e82516119d9565b6000601f82018313610d5f57600080fd5b8135610d72610d6d82611968565b611941565b91508181835260208401935060208101905083856020840282011115610d9757600080fd5b60005b83811015610dc35781610dad8882610d36565b8452506020928301929190910190600101610d9a565b5050505092915050565b6000601f82018313610dde57600080fd5b8135610dec610d6d82611968565b81815260209384019390925082018360005b83811015610dc35781358601610e148882610f11565b8452506020928301929190910190600101610dfe565b6000601f82018313610e3b57600080fd5b8151610e49610d6d82611968565b91508181835260208401935060208101905083856060840282011115610e6e57600080fd5b60005b83811015610dc35781610e848882610f57565b84525060209092019160609190910190600101610e71565b6000601f82018313610ead57600080fd5b8135610ebb610d6d82611968565b81815260209384019390925082018360005b83811015610dc35781358601610ee38882610fb2565b8452506020928301929190910190600101610ecd565b6000610c7e8251611a20565b6000610c7e82516119f2565b6000601f82018313610f2257600080fd5b8135610f30610d6d82611989565b91508082526020830160208301858383011115610f4c57600080fd5b610955838284611a25565b600060608284031215610f6957600080fd5b610f736060611941565b90506000610f818484611107565b8252506020610f9284848301610f05565b6020830152506040610fa684828501610f05565b60408301525092915050565b60006101808284031215610fc557600080fd5b610fd0610180611941565b90506000610fde8484610d36565b8252506020610fef84848301610d36565b602083015250604061100384828501610d36565b604083015250606061101784828501610d36565b606083015250608061102b848285016110fb565b60808301525060a061103f848285016110fb565b60a08301525060c0611053848285016110fb565b60c08301525060e0611067848285016110fb565b60e08301525061010061107c848285016110fb565b61010083015250610120611092848285016110fb565b6101208301525061014082013567ffffffffffffffff8111156110b457600080fd5b6110c084828501610f11565b6101408301525061016082013567ffffffffffffffff8111156110e257600080fd5b6110ee84828501610f11565b6101608301525092915050565b6000610c7e82356119f2565b6000610c7e8251611a1a565b60006020828403121561112557600080fd5b60006111318484610d42565b949350505050565b6000806040838503121561114c57600080fd5b60006111588585610d36565b925050602083013567ffffffffffffffff81111561117557600080fd5b61118185828601610dcd565b9150509250929050565b6000806040838503121561119e57600080fd5b60006111aa8585610d36565b925050602083013567ffffffffffffffff8111156111c757600080fd5b61118185828601610f11565b600080604083850312156111e657600080fd5b60006111f28585610d36565b9250506020611181858286016110fb565b60006020828403121561121557600080fd5b815167ffffffffffffffff81111561122c57600080fd5b61113184828501610e2a565b6000806040838503121561124b57600080fd5b823567ffffffffffffffff81111561126257600080fd5b61126e85828601610e9c565b925050602083013567ffffffffffffffff81111561128b57600080fd5b61118185828601610d4e565b6000602082840312156112a957600080fd5b60006111318484610ef9565b6000606082840312156112c757600080fd5b60006111318484610f57565b600080604083850312156112e657600080fd5b823567ffffffffffffffff8111156112fd57600080fd5b61130985828601610fb2565b925050602061118185828601610d36565b60006020828403121561132c57600080fd5b60006111318484610f05565b611341816119d9565b82525050565b6000611352826119d5565b808452602084019350611364836119cf565b60005b828110156113945761137a868351611619565b611383826119cf565b606096909601959150600101611367565b5093949350505050565b60006113a9826119d5565b808452602084019350836020820285016113c2856119cf565b60005b848110156113f95783830388526113dd838351611656565b92506113e8826119cf565b6020989098019791506001016113c5565b50909695505050505050565b6000611410826119d5565b808452602084019350611422836119cf565b60005b8281101561139457611438868351611759565b611441826119cf565b61010096909601959150600101611425565b600061145e826119d5565b808452602084019350611470836119cf565b60005b82811015611394576114868683516114a0565b61148f826119cf565b602096909601959150600101611473565b611341816119f2565b611341816119f5565b60006114bd826119d5565b8084526114d1816020860160208601611a31565b6114da81611a5d565b9093016020019392505050565b602681527f475245415445525f4f525f455155414c5f544f5f33325f4c454e4754485f524560208201527f5155495245440000000000000000000000000000000000000000000000000000604082015260600190565b601781527f554e535550504f525445445f41535345545f50524f5859000000000000000000602082015260400190565b602681527f475245415445525f4f525f455155414c5f544f5f32305f4c454e4754485f524560208201527f5155495245440000000000000000000000000000000000000000000000000000604082015260600190565b602581527f475245415445525f4f525f455155414c5f544f5f345f4c454e4754485f52455160208201527f5549524544000000000000000000000000000000000000000000000000000000604082015260600190565b8051606083019061162a84826117f0565b50602082015161163d60208501826114a0565b50604082015161165060408501826114a0565b50505050565b805160009061018084019061166b8582611338565b50602083015161167e6020860182611338565b5060408301516116916040860182611338565b5060608301516116a46060860182611338565b5060808301516116b760808601826114a0565b5060a08301516116ca60a08601826114a0565b5060c08301516116dd60c08601826114a0565b5060e08301516116f060e08601826114a0565b506101008301516117056101008601826114a0565b5061012083015161171a6101208601826114a0565b5061014083015184820361014086015261173482826114b2565b91505061016083015184820361016086015261175082826114b2565b95945050505050565b805161010083019061176b84826114a0565b50602082015161177e60208501826114a0565b50604082015161179160408501826114a0565b5060608201516117a460608501826114a0565b5060808201516117b760808501826114a0565b5060a08201516117ca60a08501826114a0565b5060c08201516117dd60c08501826114a0565b5060e082015161165060e08501826114a0565b61134181611a1a565b602081016109a38284611338565b604081016118158285611338565b610c7e6020830184611338565b604080825281016118338185611347565b905081810360208301526111318184611405565b60208082528101610c7e818461139e565b60208082528101610c7e8184611405565b6040808252810161187a8185611453565b905081810360208301526111318184611453565b602081016109a382846114a9565b602080825281016109a3816114e7565b602080825281016109a38161153d565b602080825281016109a38161156d565b602080825281016109a3816115c3565b61016081016118eb8285611619565b610c7e6060830184611759565b60208082528101610c7e8184611656565b61010081016109a38284611759565b602081016109a382846114a0565b6040810161193482856114a0565b610c7e60208301846114a0565b60405181810167ffffffffffffffff8111828210171561196057600080fd5b604052919050565b600067ffffffffffffffff82111561197f57600080fd5b5060209081020190565b600067ffffffffffffffff8211156119a057600080fd5b506020601f919091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0160190565b60200190565b5190565b73ffffffffffffffffffffffffffffffffffffffff1690565b90565b7fffffffff000000000000000000000000000000000000000000000000000000001690565b60ff1690565b151590565b82818337506000910152565b60005b83811015611a4c578181015183820152602001611a34565b838111156116505750506000910152565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016905600a265627a7a72305820d2e97e29f930427e8936d11af9a8ee1660886400d9687abb10c976177f33449c6c6578706572696d656e74616cf50037",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x82 JUMPI PUSH4 0xFFFFFFFF PUSH29 0x100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD DIV AND PUSH4 0x4AD1E53 DUP2 EQ PUSH2 0x87 JUMPI DUP1 PUSH4 0x2CD0FC73 EQ PUSH2 0xBE JUMPI DUP1 PUSH4 0x4B95DE13 EQ PUSH2 0xEC JUMPI DUP1 PUSH4 0x690D3114 EQ PUSH2 0x11A JUMPI DUP1 PUSH4 0xB6988463 EQ PUSH2 0x147 JUMPI DUP1 PUSH4 0xC6B7F4EE EQ PUSH2 0x174 JUMPI DUP1 PUSH4 0xF241FFB0 EQ PUSH2 0x1A2 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x93 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xA7 PUSH2 0xA2 CALLDATASIZE PUSH1 0x4 PUSH2 0x12D3 JUMP JUMPDEST PUSH2 0x1CF JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xB5 SWAP3 SWAP2 SWAP1 PUSH2 0x18DC JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xCA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xDE PUSH2 0xD9 CALLDATASIZE PUSH1 0x4 PUSH2 0x118B JUMP JUMPDEST PUSH2 0x29C JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xB5 SWAP3 SWAP2 SWAP1 PUSH2 0x1926 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xF8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x10C PUSH2 0x107 CALLDATASIZE PUSH1 0x4 PUSH2 0x1238 JUMP JUMPDEST PUSH2 0x7CD JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xB5 SWAP3 SWAP2 SWAP1 PUSH2 0x1822 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x126 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x13A PUSH2 0x135 CALLDATASIZE PUSH1 0x4 PUSH2 0x1238 JUMP JUMPDEST PUSH2 0x8A4 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xB5 SWAP2 SWAP1 PUSH2 0x1858 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x153 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x167 PUSH2 0x162 CALLDATASIZE PUSH1 0x4 PUSH2 0x11D3 JUMP JUMPDEST PUSH2 0x95E JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xB5 SWAP2 SWAP1 PUSH2 0x17F9 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x180 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x194 PUSH2 0x18F CALLDATASIZE PUSH1 0x4 PUSH2 0x1139 JUMP JUMPDEST PUSH2 0x9A9 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xB5 SWAP3 SWAP2 SWAP1 PUSH2 0x1869 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1AE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1C2 PUSH2 0x1BD CALLDATASIZE PUSH1 0x4 PUSH2 0x12D3 JUMP JUMPDEST PUSH2 0xA86 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xB5 SWAP2 SWAP1 PUSH2 0x1909 JUMP JUMPDEST PUSH2 0x1D7 PUSH2 0xCD0 JUMP JUMPDEST PUSH2 0x1DF PUSH2 0xCF0 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x40 MLOAD PUSH32 0xC75E0A8100000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP2 AND SWAP1 PUSH4 0xC75E0A81 SWAP1 PUSH2 0x235 SWAP1 DUP8 SWAP1 PUSH1 0x4 ADD PUSH2 0x18F8 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x24F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x263 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP PUSH2 0x287 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x12B5 JUMP JUMPDEST SWAP2 POP PUSH2 0x293 DUP5 DUP5 PUSH2 0xA86 JUMP JUMPDEST SWAP1 POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP1 DUP1 DUP1 DUP1 DUP1 DUP1 PUSH2 0x2B5 DUP10 DUP3 PUSH4 0xFFFFFFFF PUSH2 0xBA4 AND JUMP JUMPDEST SWAP6 POP PUSH2 0x2C8 DUP10 PUSH1 0x10 PUSH4 0xFFFFFFFF PUSH2 0xC11 AND JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x40 MLOAD PUSH32 0x6070410800000000000000000000000000000000000000000000000000000000 DUP2 MSTORE SWAP2 SWAP7 POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH4 0x60704108 SWAP1 PUSH2 0x31F SWAP1 DUP10 SWAP1 PUSH1 0x4 ADD PUSH2 0x188E JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x339 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x34D JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP PUSH2 0x371 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x1113 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0x4552433230546F6B656E28616464726573732900000000000000000000000000 DUP2 MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x13 ADD SWAP1 KECCAK256 SWAP1 SWAP5 POP PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 DUP8 DUP2 AND SWAP2 AND EQ ISZERO PUSH2 0x526 JUMPI PUSH1 0x40 MLOAD PUSH32 0x70A0823100000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP7 AND SWAP1 PUSH4 0x70A08231 SWAP1 PUSH2 0x424 SWAP1 DUP14 SWAP1 PUSH1 0x4 ADD PUSH2 0x17F9 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x43E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x452 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP PUSH2 0x476 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x131A JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH32 0xDD62ED3E00000000000000000000000000000000000000000000000000000000 DUP2 MSTORE SWAP1 SWAP9 POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP7 AND SWAP1 PUSH4 0xDD62ED3E SWAP1 PUSH2 0x4CD SWAP1 DUP14 SWAP1 DUP9 SWAP1 PUSH1 0x4 ADD PUSH2 0x1807 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x4E7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x4FB JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP PUSH2 0x51F SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x131A JUMP JUMPDEST SWAP7 POP PUSH2 0x7C0 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0x455243373231546F6B656E28616464726573732C75696E743235362900000000 DUP2 MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x1C ADD SWAP1 KECCAK256 PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 DUP8 DUP2 AND SWAP2 AND EQ ISZERO PUSH2 0x785 JUMPI PUSH2 0x595 DUP10 PUSH1 0x24 PUSH4 0xFFFFFFFF PUSH2 0xC72 AND JUMP JUMPDEST SWAP3 POP PUSH2 0x5A1 DUP6 DUP5 PUSH2 0x95E JUMP JUMPDEST SWAP2 POP DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP11 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0x5DD JUMPI PUSH1 0x0 PUSH2 0x5E0 JUMP JUMPDEST PUSH1 0x1 JUMPDEST PUSH1 0xFF AND SWAP8 POP DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0xE985E9C5 DUP12 DUP7 PUSH1 0x40 MLOAD DUP4 PUSH4 0xFFFFFFFF AND PUSH29 0x100000000000000000000000000000000000000000000000000000000 MUL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x63C SWAP3 SWAP2 SWAP1 PUSH2 0x1807 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x656 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x66A JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP PUSH2 0x68E SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x1297 JUMP JUMPDEST DUP1 PUSH2 0x76A JUMPI POP DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0x81812FC DUP6 PUSH1 0x40 MLOAD DUP3 PUSH4 0xFFFFFFFF AND PUSH29 0x100000000000000000000000000000000000000000000000000000000 MUL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x700 SWAP2 SWAP1 PUSH2 0x1918 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x71A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x72E JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP PUSH2 0x752 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x1113 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ JUMPDEST SWAP1 POP DUP1 PUSH2 0x778 JUMPI PUSH1 0x0 PUSH2 0x77B JUMP JUMPDEST PUSH1 0x1 JUMPDEST PUSH1 0xFF AND SWAP7 POP PUSH2 0x7C0 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x7B7 SWAP1 PUSH2 0x18AC JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP POP POP POP POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x40 MLOAD PUSH32 0x7E9D74DC00000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x60 SWAP2 DUP3 SWAP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP2 AND SWAP1 PUSH4 0x7E9D74DC SWAP1 PUSH2 0x828 SWAP1 DUP8 SWAP1 PUSH1 0x4 ADD PUSH2 0x1847 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x842 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x856 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x0 DUP3 RETURNDATACOPY PUSH1 0x1F RETURNDATASIZE SWAP1 DUP2 ADD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 AND DUP3 ADD PUSH1 0x40 MSTORE PUSH2 0x89C SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x1203 JUMP JUMPDEST SWAP2 POP PUSH2 0x293 DUP5 DUP5 JUMPDEST PUSH1 0x60 PUSH1 0x0 PUSH1 0x60 PUSH1 0x0 DUP6 MLOAD SWAP3 POP DUP3 PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x8EA JUMPI DUP2 PUSH1 0x20 ADD JUMPDEST PUSH2 0x8D7 PUSH2 0xCF0 JUMP JUMPDEST DUP2 MSTORE PUSH1 0x20 ADD SWAP1 PUSH1 0x1 SWAP1 SUB SWAP1 DUP2 PUSH2 0x8CF JUMPI SWAP1 POP JUMPDEST POP SWAP2 POP PUSH1 0x0 SWAP1 POP JUMPDEST DUP1 DUP4 EQ PUSH2 0x951 JUMPI PUSH2 0x931 DUP7 DUP3 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x90A JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP7 DUP4 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x922 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0xA86 JUMP JUMPDEST DUP3 DUP3 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x93F JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD MSTORE PUSH1 0x1 ADD PUSH2 0x8F2 JUMP JUMPDEST DUP2 SWAP4 POP JUMPDEST POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD PUSH32 0x6352211E00000000000000000000000000000000000000000000000000000000 DUP2 MSTORE DUP3 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x20 DUP2 PUSH1 0x24 DUP4 DUP8 GAS STATICCALL DUP1 ISZERO PUSH2 0x9A0 JUMPI DUP2 MLOAD SWAP3 POP JUMPDEST POP POP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x60 DUP1 PUSH1 0x0 PUSH1 0x60 DUP1 PUSH1 0x0 DUP7 MLOAD SWAP4 POP DUP4 PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x9E1 JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CODESIZE DUP4 CODECOPY ADD SWAP1 POP JUMPDEST POP SWAP3 POP DUP4 PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0xA0E JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CODESIZE DUP4 CODECOPY ADD SWAP1 POP JUMPDEST POP SWAP2 POP PUSH1 0x0 SWAP1 POP JUMPDEST DUP1 DUP5 EQ PUSH2 0xA79 JUMPI PUSH2 0xA3E DUP9 DUP9 DUP4 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xA2F JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x29C JUMP JUMPDEST DUP5 DUP4 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xA4C JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD DUP5 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xA63 JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD SWAP2 SWAP1 SWAP2 MSTORE MSTORE PUSH1 0x1 ADD PUSH2 0xA16 JUMP JUMPDEST POP SWAP1 SWAP7 SWAP1 SWAP6 POP SWAP4 POP POP POP POP JUMP JUMPDEST PUSH2 0xA8E PUSH2 0xCF0 JUMP JUMPDEST PUSH1 0x60 PUSH2 0xAA3 DUP5 PUSH1 0x0 ADD MLOAD DUP6 PUSH2 0x140 ADD MLOAD PUSH2 0x29C JUMP JUMPDEST PUSH1 0x20 DUP5 ADD MSTORE DUP3 MSTORE PUSH2 0x160 DUP5 ADD MLOAD PUSH2 0xABB SWAP1 DUP5 SWAP1 PUSH2 0x29C JUMP JUMPDEST PUSH1 0x60 DUP5 ADD MSTORE PUSH1 0x40 DUP1 DUP5 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x1 DUP1 SLOAD DUP3 MLOAD PUSH1 0x20 PUSH1 0x1F PUSH1 0x2 PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH2 0x100 DUP7 DUP9 AND ISZERO MUL ADD SWAP1 SWAP5 AND SWAP4 SWAP1 SWAP4 DIV SWAP3 DUP4 ADD DUP2 SWAP1 DIV DUP2 MUL DUP3 ADD DUP2 ADD SWAP1 SWAP5 MSTORE DUP2 DUP2 MSTORE SWAP3 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0xB6A JUMPI DUP1 PUSH1 0x1F LT PUSH2 0xB3F JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0xB6A JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0xB4D JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP1 POP PUSH2 0xB7F DUP5 PUSH1 0x0 ADD MLOAD DUP3 PUSH2 0x29C JUMP JUMPDEST PUSH1 0xA0 DUP5 ADD MSTORE PUSH1 0x80 DUP4 ADD MSTORE PUSH2 0xB93 DUP4 DUP3 PUSH2 0x29C JUMP JUMPDEST PUSH1 0xE0 DUP5 ADD MSTORE PUSH1 0xC0 DUP4 ADD MSTORE POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x4 ADD DUP4 MLOAD LT ISZERO ISZERO ISZERO PUSH2 0xBE6 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x7B7 SWAP1 PUSH2 0x18CC JUMP JUMPDEST POP ADD PUSH1 0x20 ADD MLOAD PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 AND SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x14 ADD DUP4 MLOAD LT ISZERO ISZERO ISZERO PUSH2 0xC53 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x7B7 SWAP1 PUSH2 0x18BC JUMP JUMPDEST POP ADD PUSH1 0x14 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0xC7E DUP4 DUP4 PUSH2 0xC85 JUMP JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x20 ADD DUP4 MLOAD LT ISZERO ISZERO ISZERO PUSH2 0xCC7 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x7B7 SWAP1 PUSH2 0x189C JUMP JUMPDEST POP ADD PUSH1 0x20 ADD MLOAD SWAP1 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x60 DUP2 ADD DUP3 MSTORE PUSH1 0x0 DUP1 DUP3 MSTORE PUSH1 0x20 DUP3 ADD DUP2 SWAP1 MSTORE SWAP2 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE SWAP1 JUMP JUMPDEST PUSH2 0x100 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE POP SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0xC7E DUP3 CALLDATALOAD PUSH2 0x19D9 JUMP JUMPDEST PUSH1 0x0 PUSH2 0xC7E DUP3 MLOAD PUSH2 0x19D9 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH2 0xD5F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0xD72 PUSH2 0xD6D DUP3 PUSH2 0x1968 JUMP JUMPDEST PUSH2 0x1941 JUMP JUMPDEST SWAP2 POP DUP2 DUP2 DUP4 MSTORE PUSH1 0x20 DUP5 ADD SWAP4 POP PUSH1 0x20 DUP2 ADD SWAP1 POP DUP4 DUP6 PUSH1 0x20 DUP5 MUL DUP3 ADD GT ISZERO PUSH2 0xD97 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0xDC3 JUMPI DUP2 PUSH2 0xDAD DUP9 DUP3 PUSH2 0xD36 JUMP JUMPDEST DUP5 MSTORE POP PUSH1 0x20 SWAP3 DUP4 ADD SWAP3 SWAP2 SWAP1 SWAP2 ADD SWAP1 PUSH1 0x1 ADD PUSH2 0xD9A JUMP JUMPDEST POP POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH2 0xDDE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0xDEC PUSH2 0xD6D DUP3 PUSH2 0x1968 JUMP JUMPDEST DUP2 DUP2 MSTORE PUSH1 0x20 SWAP4 DUP5 ADD SWAP4 SWAP1 SWAP3 POP DUP3 ADD DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0xDC3 JUMPI DUP2 CALLDATALOAD DUP7 ADD PUSH2 0xE14 DUP9 DUP3 PUSH2 0xF11 JUMP JUMPDEST DUP5 MSTORE POP PUSH1 0x20 SWAP3 DUP4 ADD SWAP3 SWAP2 SWAP1 SWAP2 ADD SWAP1 PUSH1 0x1 ADD PUSH2 0xDFE JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH2 0xE3B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 MLOAD PUSH2 0xE49 PUSH2 0xD6D DUP3 PUSH2 0x1968 JUMP JUMPDEST SWAP2 POP DUP2 DUP2 DUP4 MSTORE PUSH1 0x20 DUP5 ADD SWAP4 POP PUSH1 0x20 DUP2 ADD SWAP1 POP DUP4 DUP6 PUSH1 0x60 DUP5 MUL DUP3 ADD GT ISZERO PUSH2 0xE6E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0xDC3 JUMPI DUP2 PUSH2 0xE84 DUP9 DUP3 PUSH2 0xF57 JUMP JUMPDEST DUP5 MSTORE POP PUSH1 0x20 SWAP1 SWAP3 ADD SWAP2 PUSH1 0x60 SWAP2 SWAP1 SWAP2 ADD SWAP1 PUSH1 0x1 ADD PUSH2 0xE71 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH2 0xEAD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0xEBB PUSH2 0xD6D DUP3 PUSH2 0x1968 JUMP JUMPDEST DUP2 DUP2 MSTORE PUSH1 0x20 SWAP4 DUP5 ADD SWAP4 SWAP1 SWAP3 POP DUP3 ADD DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0xDC3 JUMPI DUP2 CALLDATALOAD DUP7 ADD PUSH2 0xEE3 DUP9 DUP3 PUSH2 0xFB2 JUMP JUMPDEST DUP5 MSTORE POP PUSH1 0x20 SWAP3 DUP4 ADD SWAP3 SWAP2 SWAP1 SWAP2 ADD SWAP1 PUSH1 0x1 ADD PUSH2 0xECD JUMP JUMPDEST PUSH1 0x0 PUSH2 0xC7E DUP3 MLOAD PUSH2 0x1A20 JUMP JUMPDEST PUSH1 0x0 PUSH2 0xC7E DUP3 MLOAD PUSH2 0x19F2 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH2 0xF22 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0xF30 PUSH2 0xD6D DUP3 PUSH2 0x1989 JUMP JUMPDEST SWAP2 POP DUP1 DUP3 MSTORE PUSH1 0x20 DUP4 ADD PUSH1 0x20 DUP4 ADD DUP6 DUP4 DUP4 ADD GT ISZERO PUSH2 0xF4C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x955 DUP4 DUP3 DUP5 PUSH2 0x1A25 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x60 DUP3 DUP5 SUB SLT ISZERO PUSH2 0xF69 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0xF73 PUSH1 0x60 PUSH2 0x1941 JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0xF81 DUP5 DUP5 PUSH2 0x1107 JUMP JUMPDEST DUP3 MSTORE POP PUSH1 0x20 PUSH2 0xF92 DUP5 DUP5 DUP4 ADD PUSH2 0xF05 JUMP JUMPDEST PUSH1 0x20 DUP4 ADD MSTORE POP PUSH1 0x40 PUSH2 0xFA6 DUP5 DUP3 DUP6 ADD PUSH2 0xF05 JUMP JUMPDEST PUSH1 0x40 DUP4 ADD MSTORE POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x180 DUP3 DUP5 SUB SLT ISZERO PUSH2 0xFC5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0xFD0 PUSH2 0x180 PUSH2 0x1941 JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0xFDE DUP5 DUP5 PUSH2 0xD36 JUMP JUMPDEST DUP3 MSTORE POP PUSH1 0x20 PUSH2 0xFEF DUP5 DUP5 DUP4 ADD PUSH2 0xD36 JUMP JUMPDEST PUSH1 0x20 DUP4 ADD MSTORE POP PUSH1 0x40 PUSH2 0x1003 DUP5 DUP3 DUP6 ADD PUSH2 0xD36 JUMP JUMPDEST PUSH1 0x40 DUP4 ADD MSTORE POP PUSH1 0x60 PUSH2 0x1017 DUP5 DUP3 DUP6 ADD PUSH2 0xD36 JUMP JUMPDEST PUSH1 0x60 DUP4 ADD MSTORE POP PUSH1 0x80 PUSH2 0x102B DUP5 DUP3 DUP6 ADD PUSH2 0x10FB JUMP JUMPDEST PUSH1 0x80 DUP4 ADD MSTORE POP PUSH1 0xA0 PUSH2 0x103F DUP5 DUP3 DUP6 ADD PUSH2 0x10FB JUMP JUMPDEST PUSH1 0xA0 DUP4 ADD MSTORE POP PUSH1 0xC0 PUSH2 0x1053 DUP5 DUP3 DUP6 ADD PUSH2 0x10FB JUMP JUMPDEST PUSH1 0xC0 DUP4 ADD MSTORE POP PUSH1 0xE0 PUSH2 0x1067 DUP5 DUP3 DUP6 ADD PUSH2 0x10FB JUMP JUMPDEST PUSH1 0xE0 DUP4 ADD MSTORE POP PUSH2 0x100 PUSH2 0x107C DUP5 DUP3 DUP6 ADD PUSH2 0x10FB JUMP JUMPDEST PUSH2 0x100 DUP4 ADD MSTORE POP PUSH2 0x120 PUSH2 0x1092 DUP5 DUP3 DUP6 ADD PUSH2 0x10FB JUMP JUMPDEST PUSH2 0x120 DUP4 ADD MSTORE POP PUSH2 0x140 DUP3 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x10B4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x10C0 DUP5 DUP3 DUP6 ADD PUSH2 0xF11 JUMP JUMPDEST PUSH2 0x140 DUP4 ADD MSTORE POP PUSH2 0x160 DUP3 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x10E2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x10EE DUP5 DUP3 DUP6 ADD PUSH2 0xF11 JUMP JUMPDEST PUSH2 0x160 DUP4 ADD MSTORE POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0xC7E DUP3 CALLDATALOAD PUSH2 0x19F2 JUMP JUMPDEST PUSH1 0x0 PUSH2 0xC7E DUP3 MLOAD PUSH2 0x1A1A JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x1125 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1131 DUP5 DUP5 PUSH2 0xD42 JUMP JUMPDEST SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x114C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1158 DUP6 DUP6 PUSH2 0xD36 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 DUP4 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1175 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1181 DUP6 DUP3 DUP7 ADD PUSH2 0xDCD JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x119E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x11AA DUP6 DUP6 PUSH2 0xD36 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 DUP4 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x11C7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1181 DUP6 DUP3 DUP7 ADD PUSH2 0xF11 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x11E6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x11F2 DUP6 DUP6 PUSH2 0xD36 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0x1181 DUP6 DUP3 DUP7 ADD PUSH2 0x10FB JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x1215 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 MLOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x122C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1131 DUP5 DUP3 DUP6 ADD PUSH2 0xE2A JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x124B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1262 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x126E DUP6 DUP3 DUP7 ADD PUSH2 0xE9C JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 DUP4 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x128B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1181 DUP6 DUP3 DUP7 ADD PUSH2 0xD4E JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x12A9 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1131 DUP5 DUP5 PUSH2 0xEF9 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x60 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x12C7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1131 DUP5 DUP5 PUSH2 0xF57 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x12E6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x12FD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1309 DUP6 DUP3 DUP7 ADD PUSH2 0xFB2 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0x1181 DUP6 DUP3 DUP7 ADD PUSH2 0xD36 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x132C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1131 DUP5 DUP5 PUSH2 0xF05 JUMP JUMPDEST PUSH2 0x1341 DUP2 PUSH2 0x19D9 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x1352 DUP3 PUSH2 0x19D5 JUMP JUMPDEST DUP1 DUP5 MSTORE PUSH1 0x20 DUP5 ADD SWAP4 POP PUSH2 0x1364 DUP4 PUSH2 0x19CF JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP3 DUP2 LT ISZERO PUSH2 0x1394 JUMPI PUSH2 0x137A DUP7 DUP4 MLOAD PUSH2 0x1619 JUMP JUMPDEST PUSH2 0x1383 DUP3 PUSH2 0x19CF JUMP JUMPDEST PUSH1 0x60 SWAP7 SWAP1 SWAP7 ADD SWAP6 SWAP2 POP PUSH1 0x1 ADD PUSH2 0x1367 JUMP JUMPDEST POP SWAP4 SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x13A9 DUP3 PUSH2 0x19D5 JUMP JUMPDEST DUP1 DUP5 MSTORE PUSH1 0x20 DUP5 ADD SWAP4 POP DUP4 PUSH1 0x20 DUP3 MUL DUP6 ADD PUSH2 0x13C2 DUP6 PUSH2 0x19CF JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP5 DUP2 LT ISZERO PUSH2 0x13F9 JUMPI DUP4 DUP4 SUB DUP9 MSTORE PUSH2 0x13DD DUP4 DUP4 MLOAD PUSH2 0x1656 JUMP JUMPDEST SWAP3 POP PUSH2 0x13E8 DUP3 PUSH2 0x19CF JUMP JUMPDEST PUSH1 0x20 SWAP9 SWAP1 SWAP9 ADD SWAP8 SWAP2 POP PUSH1 0x1 ADD PUSH2 0x13C5 JUMP JUMPDEST POP SWAP1 SWAP7 SWAP6 POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x1410 DUP3 PUSH2 0x19D5 JUMP JUMPDEST DUP1 DUP5 MSTORE PUSH1 0x20 DUP5 ADD SWAP4 POP PUSH2 0x1422 DUP4 PUSH2 0x19CF JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP3 DUP2 LT ISZERO PUSH2 0x1394 JUMPI PUSH2 0x1438 DUP7 DUP4 MLOAD PUSH2 0x1759 JUMP JUMPDEST PUSH2 0x1441 DUP3 PUSH2 0x19CF JUMP JUMPDEST PUSH2 0x100 SWAP7 SWAP1 SWAP7 ADD SWAP6 SWAP2 POP PUSH1 0x1 ADD PUSH2 0x1425 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x145E DUP3 PUSH2 0x19D5 JUMP JUMPDEST DUP1 DUP5 MSTORE PUSH1 0x20 DUP5 ADD SWAP4 POP PUSH2 0x1470 DUP4 PUSH2 0x19CF JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP3 DUP2 LT ISZERO PUSH2 0x1394 JUMPI PUSH2 0x1486 DUP7 DUP4 MLOAD PUSH2 0x14A0 JUMP JUMPDEST PUSH2 0x148F DUP3 PUSH2 0x19CF JUMP JUMPDEST PUSH1 0x20 SWAP7 SWAP1 SWAP7 ADD SWAP6 SWAP2 POP PUSH1 0x1 ADD PUSH2 0x1473 JUMP JUMPDEST PUSH2 0x1341 DUP2 PUSH2 0x19F2 JUMP JUMPDEST PUSH2 0x1341 DUP2 PUSH2 0x19F5 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x14BD DUP3 PUSH2 0x19D5 JUMP JUMPDEST DUP1 DUP5 MSTORE PUSH2 0x14D1 DUP2 PUSH1 0x20 DUP7 ADD PUSH1 0x20 DUP7 ADD PUSH2 0x1A31 JUMP JUMPDEST PUSH2 0x14DA DUP2 PUSH2 0x1A5D JUMP JUMPDEST SWAP1 SWAP4 ADD PUSH1 0x20 ADD SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x26 DUP2 MSTORE PUSH32 0x475245415445525F4F525F455155414C5F544F5F33325F4C454E4754485F5245 PUSH1 0x20 DUP3 ADD MSTORE PUSH32 0x5155495245440000000000000000000000000000000000000000000000000000 PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x60 ADD SWAP1 JUMP JUMPDEST PUSH1 0x17 DUP2 MSTORE PUSH32 0x554E535550504F525445445F41535345545F50524F5859000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x26 DUP2 MSTORE PUSH32 0x475245415445525F4F525F455155414C5F544F5F32305F4C454E4754485F5245 PUSH1 0x20 DUP3 ADD MSTORE PUSH32 0x5155495245440000000000000000000000000000000000000000000000000000 PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x60 ADD SWAP1 JUMP JUMPDEST PUSH1 0x25 DUP2 MSTORE PUSH32 0x475245415445525F4F525F455155414C5F544F5F345F4C454E4754485F524551 PUSH1 0x20 DUP3 ADD MSTORE PUSH32 0x5549524544000000000000000000000000000000000000000000000000000000 PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x60 ADD SWAP1 JUMP JUMPDEST DUP1 MLOAD PUSH1 0x60 DUP4 ADD SWAP1 PUSH2 0x162A DUP5 DUP3 PUSH2 0x17F0 JUMP JUMPDEST POP PUSH1 0x20 DUP3 ADD MLOAD PUSH2 0x163D PUSH1 0x20 DUP6 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH1 0x40 DUP3 ADD MLOAD PUSH2 0x1650 PUSH1 0x40 DUP6 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP POP POP POP JUMP JUMPDEST DUP1 MLOAD PUSH1 0x0 SWAP1 PUSH2 0x180 DUP5 ADD SWAP1 PUSH2 0x166B DUP6 DUP3 PUSH2 0x1338 JUMP JUMPDEST POP PUSH1 0x20 DUP4 ADD MLOAD PUSH2 0x167E PUSH1 0x20 DUP7 ADD DUP3 PUSH2 0x1338 JUMP JUMPDEST POP PUSH1 0x40 DUP4 ADD MLOAD PUSH2 0x1691 PUSH1 0x40 DUP7 ADD DUP3 PUSH2 0x1338 JUMP JUMPDEST POP PUSH1 0x60 DUP4 ADD MLOAD PUSH2 0x16A4 PUSH1 0x60 DUP7 ADD DUP3 PUSH2 0x1338 JUMP JUMPDEST POP PUSH1 0x80 DUP4 ADD MLOAD PUSH2 0x16B7 PUSH1 0x80 DUP7 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH1 0xA0 DUP4 ADD MLOAD PUSH2 0x16CA PUSH1 0xA0 DUP7 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH1 0xC0 DUP4 ADD MLOAD PUSH2 0x16DD PUSH1 0xC0 DUP7 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH1 0xE0 DUP4 ADD MLOAD PUSH2 0x16F0 PUSH1 0xE0 DUP7 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH2 0x100 DUP4 ADD MLOAD PUSH2 0x1705 PUSH2 0x100 DUP7 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH2 0x120 DUP4 ADD MLOAD PUSH2 0x171A PUSH2 0x120 DUP7 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH2 0x140 DUP4 ADD MLOAD DUP5 DUP3 SUB PUSH2 0x140 DUP7 ADD MSTORE PUSH2 0x1734 DUP3 DUP3 PUSH2 0x14B2 JUMP JUMPDEST SWAP2 POP POP PUSH2 0x160 DUP4 ADD MLOAD DUP5 DUP3 SUB PUSH2 0x160 DUP7 ADD MSTORE PUSH2 0x1750 DUP3 DUP3 PUSH2 0x14B2 JUMP JUMPDEST SWAP6 SWAP5 POP POP POP POP POP JUMP JUMPDEST DUP1 MLOAD PUSH2 0x100 DUP4 ADD SWAP1 PUSH2 0x176B DUP5 DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH1 0x20 DUP3 ADD MLOAD PUSH2 0x177E PUSH1 0x20 DUP6 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH1 0x40 DUP3 ADD MLOAD PUSH2 0x1791 PUSH1 0x40 DUP6 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH1 0x60 DUP3 ADD MLOAD PUSH2 0x17A4 PUSH1 0x60 DUP6 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH1 0x80 DUP3 ADD MLOAD PUSH2 0x17B7 PUSH1 0x80 DUP6 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH1 0xA0 DUP3 ADD MLOAD PUSH2 0x17CA PUSH1 0xA0 DUP6 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH1 0xC0 DUP3 ADD MLOAD PUSH2 0x17DD PUSH1 0xC0 DUP6 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH1 0xE0 DUP3 ADD MLOAD PUSH2 0x1650 PUSH1 0xE0 DUP6 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST PUSH2 0x1341 DUP2 PUSH2 0x1A1A JUMP JUMPDEST PUSH1 0x20 DUP2 ADD PUSH2 0x9A3 DUP3 DUP5 PUSH2 0x1338 JUMP JUMPDEST PUSH1 0x40 DUP2 ADD PUSH2 0x1815 DUP3 DUP6 PUSH2 0x1338 JUMP JUMPDEST PUSH2 0xC7E PUSH1 0x20 DUP4 ADD DUP5 PUSH2 0x1338 JUMP JUMPDEST PUSH1 0x40 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x1833 DUP2 DUP6 PUSH2 0x1347 JUMP JUMPDEST SWAP1 POP DUP2 DUP2 SUB PUSH1 0x20 DUP4 ADD MSTORE PUSH2 0x1131 DUP2 DUP5 PUSH2 0x1405 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0xC7E DUP2 DUP5 PUSH2 0x139E JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0xC7E DUP2 DUP5 PUSH2 0x1405 JUMP JUMPDEST PUSH1 0x40 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x187A DUP2 DUP6 PUSH2 0x1453 JUMP JUMPDEST SWAP1 POP DUP2 DUP2 SUB PUSH1 0x20 DUP4 ADD MSTORE PUSH2 0x1131 DUP2 DUP5 PUSH2 0x1453 JUMP JUMPDEST PUSH1 0x20 DUP2 ADD PUSH2 0x9A3 DUP3 DUP5 PUSH2 0x14A9 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x9A3 DUP2 PUSH2 0x14E7 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x9A3 DUP2 PUSH2 0x153D JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x9A3 DUP2 PUSH2 0x156D JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x9A3 DUP2 PUSH2 0x15C3 JUMP JUMPDEST PUSH2 0x160 DUP2 ADD PUSH2 0x18EB DUP3 DUP6 PUSH2 0x1619 JUMP JUMPDEST PUSH2 0xC7E PUSH1 0x60 DUP4 ADD DUP5 PUSH2 0x1759 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0xC7E DUP2 DUP5 PUSH2 0x1656 JUMP JUMPDEST PUSH2 0x100 DUP2 ADD PUSH2 0x9A3 DUP3 DUP5 PUSH2 0x1759 JUMP JUMPDEST PUSH1 0x20 DUP2 ADD PUSH2 0x9A3 DUP3 DUP5 PUSH2 0x14A0 JUMP JUMPDEST PUSH1 0x40 DUP2 ADD PUSH2 0x1934 DUP3 DUP6 PUSH2 0x14A0 JUMP JUMPDEST PUSH2 0xC7E PUSH1 0x20 DUP4 ADD DUP5 PUSH2 0x14A0 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP2 DUP2 ADD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT DUP3 DUP3 LT OR ISZERO PUSH2 0x1960 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x40 MSTORE SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH8 0xFFFFFFFFFFFFFFFF DUP3 GT ISZERO PUSH2 0x197F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x20 SWAP1 DUP2 MUL ADD SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH8 0xFFFFFFFFFFFFFFFF DUP3 GT ISZERO PUSH2 0x19A0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x20 PUSH1 0x1F SWAP2 SWAP1 SWAP2 ADD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 AND ADD SWAP1 JUMP JUMPDEST PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST MLOAD SWAP1 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 JUMP JUMPDEST SWAP1 JUMP JUMPDEST PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 AND SWAP1 JUMP JUMPDEST PUSH1 0xFF AND SWAP1 JUMP JUMPDEST ISZERO ISZERO SWAP1 JUMP JUMPDEST DUP3 DUP2 DUP4 CALLDATACOPY POP PUSH1 0x0 SWAP2 ADD MSTORE JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x1A4C JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH2 0x1A34 JUMP JUMPDEST DUP4 DUP2 GT ISZERO PUSH2 0x1650 JUMPI POP POP PUSH1 0x0 SWAP2 ADD MSTORE JUMP JUMPDEST PUSH1 0x1F ADD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 AND SWAP1 JUMP STOP LOG2 PUSH6 0x627A7A723058 KECCAK256 0xd2 0xe9 PUSH31 0x29F930427E8936D11AF9A8EE1660886400D9687ABB10C976177F33449C6C65 PUSH25 0x706572696D656E74616CF50037000000000000000000000000 ",
- "sourceMap": "898:8536:11:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2336:352;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2336:352:11;;;;;;;;;;;;;;;;;;;;;;;;;;5614:1359;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;5614:1359:11;;;;;;;;;;;;;;;;;;3018:384;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;3018:384:11;;;;;;;;;;;;;;;;;;4716:452;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;4716:452:11;;;;;;;;;;;;;;;;;8218:1214;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;8218:1214:11;;;;;;;;;;;;;;;;;7416:517;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;7416:517:11;;;;;;;;;;;;;;;;;;3661:739;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;3661:739:11;;;;;;;;;;;;;;;;;2336:352;2463:35;;:::i;:::-;2500:28;;:::i;:::-;2556:8;;:28;;;;;:8;;;;;:21;;:28;;2578:5;;2556:28;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2556:28:11;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2556:28:11;;;;;;;101:4:-1;97:9;90:4;84;80:15;76:31;69:5;65:43;126:6;120:4;113:20;0:138;2556:28:11;;;;;;;;;2544:40;;2607:34;2621:5;2628:12;2607:13;:34::i;:::-;2594:47;-1:-1:-1;2336:352:11;;;;;:::o;5614:1359::-;5731:15;;;;;;;;5803:23;:9;5731:15;5803:23;:20;:23;:::i;:::-;5781:45;-1:-1:-1;5852:25:11;:9;5874:2;5852:25;:21;:25;:::i;:::-;5908:8;;:36;;;;;5836:41;;-1:-1:-1;5908:8:11;;;:22;;:36;;5931:12;;5908:36;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;5908:36:11;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;5908:36:11;;;;;;;101:4:-1;97:9;90:4;84;80:15;76:31;69:5;65:43;126:6;120:4;113:20;0:138;5908:36:11;;;;;;;;;1008:32;;;;;;;;;;;;;;;;5887:57;;-1:-1:-1;5959:29:11;;;;;;;5955:975;;;6043:36;;;;;:28;;;;;;:36;;6072:6;;6043:36;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;6043:36:11;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;6043:36:11;;;;;;;101:4:-1;97:9;90:4;84;80:15;76:31;69:5;65:43;126:6;120:4;113:20;0:138;6043:36:11;;;;;;;;;6137:48;;;;;6033:46;;-1:-1:-1;6137:28:11;;;;;;:48;;6166:6;;6174:10;;6137:48;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;6137:48:11;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;6137:48:11;;;;;;;101:4:-1;97:9;90:4;84;80:15;76:31;69:5;65:43;126:6;120:4;113:20;0:138;6137:48:11;;;;;;;;;6125:60;;5955:975;;;1096:41;;;;;;;;;;;;;;;;6206:30;;;;;;;6202:728;;;6270:25;:9;6292:2;6270:25;:21;:25;:::i;:::-;6252:43;;6364:35;6384:5;6391:7;6364:19;:35::i;:::-;6348:51;;6496:5;6486:15;;:6;:15;;;:23;;6508:1;6486:23;;;6504:1;6486:23;6476:33;;;;6620:5;6607:36;;;6644:6;6652:10;6607:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;6607:56:11;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;6607:56:11;;;;;;;101:4:-1;97:9;90:4;84;80:15;76:31;69:5;65:43;126:6;120:4;113:20;0:138;6607:56:11;;;;;;;;;:114;;;;6711:10;6667:54;;6680:5;6667:31;;;6699:7;6667:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;6667:40:11;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;6667:40:11;;;;;;;101:4:-1;97:9;90:4;84;80:15;76:31;69:5;65:43;126:6;120:4;113:20;0:138;6667:40:11;;;;;;;;;:54;;;6607:114;6589:132;;6837:10;:18;;6854:1;6837:18;;;6850:1;6837:18;6825:30;;;;6202:728;;;6886:33;;;;;;;;;;;;;;;;;;;6202:728;5614:1359;;;;;;;;;;;:::o;3018:384::-;3261:8;;:30;;;;;3161:38;;;;3261:8;;;;;:22;;:30;;3284:6;;3261:30;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3261:30:11;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3261:30:11;;;;;;39:16:-1;36:1;17:17;2:54;101:4;3261:30:11;80:15:-1;;;97:9;76:31;65:43;;120:4;113:20;3261:30:11;;;;;;;;;3248:43;;3315:38;3330:6;3338:14;4716:452;4850:12;4885:20;4931:31;5010:9;4908:6;:13;4885:36;;4982:12;4965:30;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;4931:64;;5022:1;5010:13;;5005:129;5025:17;;;5005:129;;5080:43;5094:6;5101:1;5094:9;;;;;;;;;;;;;;;;;;5105:14;5120:1;5105:17;;;;;;;;;;;;;;;;;;5080:13;:43::i;:::-;5063:11;5075:1;5063:14;;;;;;;;;;;;;;;;;;:60;5044:3;;5005:129;;;5150:11;5143:18;;4716:452;;;;;;;;:::o;8218:1214::-;8324:13;8437:2;8431:9;8534:66;8525:7;8518:83;8638:7;8634:1;8625:7;8621:15;8614:32;9060:2;9007:7;8950:2;8903:7;8854:5;8809:3;8781:332;9240:7;9237:2;;;9281:7;9275:14;9266:23;;9237:2;-1:-1:-1;;8218:1214:11;;;;;:::o;7416:517::-;7537:9;7555;7587:14;7630:25;7689:27;7755:9;7604;:16;7587:33;;7672:6;7658:21;;;;;;;;;;;;;;;;;;;;;;29:2:-1;21:6;17:15;117:4;105:10;97:6;88:34;136:17;;-1:-1;7658:21:11;;7630:49;;7733:6;7719:21;;;;;;;;;;;;;;;;;;;;;;29:2:-1;21:6;17:15;117:4;105:10;97:6;88:34;136:17;;-1:-1;7719:21:11;;7689:51;;7767:1;7755:13;;7750:138;7770:11;;;7750:138;;7833:44;7856:6;7864:9;7874:1;7864:12;;;;;;;;;;;;;;;;;;7833:22;:44::i;:::-;7803:8;7812:1;7803:11;;;;;;;;;;;;;;;;;7816:10;7827:1;7816:13;;;;;;;;;;;;;;;;;;7802:75;;;;;7783:3;;7750:138;;;-1:-1:-1;7905:8:11;;7915:10;;-1:-1:-1;7416:517:11;-1:-1:-1;;;;7416:517:11:o;3661:739::-;3780:28;;:::i;:::-;4076:25;3879:64;3902:5;:18;;;3922:5;:20;;;3879:22;:64::i;:::-;3850:25;;;3824:119;;;4045:20;;;;4008:58;;4031:12;;4008:22;:58::i;:::-;3979:25;;;3953:113;3954:23;;;;3953:113;;;;4104:14;4076:42;;;;-1:-1:-1;4076:42:11;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4104:14;4076:42;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4189:56;4212:5;:18;;;4232:12;4189:22;:56::i;:::-;4157:28;;;4128:117;4129:26;;;4128:117;4316:50;4339:12;4353;4316:22;:50::i;:::-;4284:28;;;4255:111;4256:26;;;4255:111;3661:739;;;;;:::o;15593:687:61:-;15713:13;15775:5;15783:1;15775:9;15763:1;:8;:21;;15742:105;;;;;;;;;;;;;;;;-1:-1:-1;16021:13:61;15924:2;16021:13;16015:20;16174:66;16162:79;;15593:687::o;10268:886::-;10389:14;10452:5;10460:2;10452:10;10440:1;:8;:22;;10419:135;;;;;;;;;;;;;;;;-1:-1:-1;11056:13:61;10801:2;11056:13;11050:20;11072:42;11046:69;;10268:886::o;14708:220::-;14829:14;14876:21;14888:1;14891:5;14876:11;:21::i;:::-;14868:30;14708:220;-1:-1:-1;;;14708:220:61:o;13290:490::-;13411:14;13474:5;13482:2;13474:10;13462:1;:8;:22;;13441:107;;;;;;;;;;;;;;;;-1:-1:-1;13727:13:61;13629:2;13727:13;13721:20;;13290:490::o;898:8536:11:-;;;;;;;;;-1:-1:-1;898:8536:11;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;5:118:-1:-;;72:46;110:6;97:20;72:46;;130:122;;208:39;239:6;233:13;208:39;;277:707;;387:4;375:17;;371:27;-1:-1;361:2;;412:1;409;402:12;361:2;449:6;436:20;471:80;486:64;543:6;486:64;;;471:80;;;462:89;;568:5;593:6;586:5;579:21;623:4;615:6;611:17;601:27;;645:4;640:3;636:14;629:21;;698:6;745:3;737:4;729:6;725:17;720:3;716:27;713:36;710:2;;;762:1;759;752:12;710:2;787:1;772:206;797:6;794:1;791:13;772:206;;;855:3;877:37;910:3;898:10;877:37;;;865:50;;-1:-1;938:4;929:14;;;;957;;;;;819:1;812:9;772:206;;;776:14;354:630;;;;;;;;1008:693;;1123:4;1111:17;;1107:27;-1:-1;1097:2;;1148:1;1145;1138:12;1097:2;1185:6;1172:20;1207:85;1222:69;1284:6;1222:69;;1207:85;1320:21;;;1364:4;1352:17;;;;1198:94;;-1:-1;1377:14;;1352:17;1472:1;1457:238;1482:6;1479:1;1476:13;1457:238;;;1565:3;1552:17;1544:6;1540:30;1589:42;1627:3;1615:10;1589:42;;;1577:55;;-1:-1;1655:4;1646:14;;;;1674;;;;;1504:1;1497:9;1457:238;;1745:791;;1889:4;1877:17;;1873:27;-1:-1;1863:2;;1914:1;1911;1904:12;1863:2;1944:6;1938:13;1966:103;1981:87;2061:6;1981:87;;1966:103;1957:112;;2086:5;2111:6;2104:5;2097:21;2141:4;2133:6;2129:17;2119:27;;2163:4;2158:3;2154:14;2147:21;;2216:6;2263:3;2255:4;2247:6;2243:17;2238:3;2234:27;2231:36;2228:2;;;2280:1;2277;2270:12;2228:2;2305:1;2290:240;2315:6;2312:1;2309:13;2290:240;;;2373:3;2395:71;2462:3;2450:10;2395:71;;;2383:84;;-1:-1;2490:4;2481:14;;;;2518:4;2509:14;;;;;2337:1;2330:9;2290:240;;2576:735;;2705:4;2693:17;;2689:27;-1:-1;2679:2;;2730:1;2727;2720:12;2679:2;2767:6;2754:20;2789:99;2804:83;2880:6;2804:83;;2789:99;2916:21;;;2960:4;2948:17;;;;2780:108;;-1:-1;2973:14;;2948:17;3068:1;3053:252;3078:6;3075:1;3072:13;3053:252;;;3161:3;3148:17;3140:6;3136:30;3185:56;3237:3;3225:10;3185:56;;;3173:69;;-1:-1;3265:4;3256:14;;;;3284;;;;;3100:1;3093:9;3053:252;;3319:116;;3394:36;3422:6;3416:13;3394:36;;3442:122;;3520:39;3551:6;3545:13;3520:39;;3572:432;;3662:4;3650:17;;3646:27;-1:-1;3636:2;;3687:1;3684;3677:12;3636:2;3724:6;3711:20;3746:60;3761:44;3798:6;3761:44;;3746:60;3737:69;;3826:6;3819:5;3812:21;3862:4;3854:6;3850:17;3895:4;3888:5;3884:16;3930:3;3921:6;3916:3;3912:16;3909:25;3906:2;;;3947:1;3944;3937:12;3906:2;3957:41;3991:6;3986:3;3981;3957:41;;4493:685;;4616:4;4604:9;4599:3;4595:19;4591:30;4588:2;;;4634:1;4631;4624:12;4588:2;4652:20;4667:4;4652:20;;;4643:29;-1:-1;4729:1;4760:58;4814:3;4794:9;4760:58;;;4736:83;;-1:-1;4885:2;4918:60;4974:3;4950:22;;;4918:60;;;4911:4;4904:5;4900:16;4893:86;4840:150;5063:2;5096:60;5152:3;5143:6;5132:9;5128:22;5096:60;;;5089:4;5082:5;5078:16;5071:86;5000:168;4582:596;;;;;5941:2205;;6049:5;6037:9;6032:3;6028:19;6024:31;6021:2;;;6068:1;6065;6058:12;6021:2;6086:21;6101:5;6086:21;;;6077:30;-1:-1;6165:1;6196:49;6241:3;6221:9;6196:49;;;6172:74;;-1:-1;6315:2;6348:49;6393:3;6369:22;;;6348:49;;;6341:4;6334:5;6330:16;6323:75;6267:142;6474:2;6507:49;6552:3;6543:6;6532:9;6528:22;6507:49;;;6500:4;6493:5;6489:16;6482:75;6419:149;6627:2;6660:49;6705:3;6696:6;6685:9;6681:22;6660:49;;;6653:4;6646:5;6642:16;6635:75;6578:143;6783:3;6817:49;6862:3;6853:6;6842:9;6838:22;6817:49;;;6810:4;6803:5;6799:16;6792:75;6731:147;6940:3;6974:49;7019:3;7010:6;6999:9;6995:22;6974:49;;;6967:4;6960:5;6956:16;6949:75;6888:147;7089:3;7123:49;7168:3;7159:6;7148:9;7144:22;7123:49;;;7116:4;7109:5;7105:16;7098:75;7045:139;7238:3;7272:49;7317:3;7308:6;7297:9;7293:22;7272:49;;;7265:4;7258:5;7254:16;7247:75;7194:139;7400:3;7435:49;7480:3;7471:6;7460:9;7456:22;7435:49;;;7427:5;7420;7416:17;7409:76;7343:153;7546:3;7581:49;7626:3;7617:6;7606:9;7602:22;7581:49;;;7573:5;7566;7562:17;7555:76;7506:136;7730:3;7719:9;7715:19;7702:33;7755:18;7747:6;7744:30;7741:2;;;7787:1;7784;7777:12;7741:2;7823:54;7873:3;7864:6;7853:9;7849:22;7823:54;;;7815:5;7808;7804:17;7797:81;7652:237;7977:3;7966:9;7962:19;7949:33;8002:18;7994:6;7991:30;7988:2;;;8034:1;8031;8024:12;7988:2;8070:54;8120:3;8111:6;8100:9;8096:22;8070:54;;;8062:5;8055;8051:17;8044:81;7899:237;6015:2131;;;;;10397:118;;10464:46;10502:6;10489:20;10464:46;;10651:118;;10727:37;10756:6;10750:13;10727:37;;10776:263;;10891:2;10879:9;10870:7;10866:23;10862:32;10859:2;;;10907:1;10904;10897:12;10859:2;10942:1;10959:64;11015:7;10995:9;10959:64;;;10949:74;10853:186;-1:-1;;;;10853:186;11046:512;;;11197:2;11185:9;11176:7;11172:23;11168:32;11165:2;;;11213:1;11210;11203:12;11165:2;11248:1;11265:53;11310:7;11290:9;11265:53;;;11255:63;;11227:97;11383:2;11372:9;11368:18;11355:32;11407:18;11399:6;11396:30;11393:2;;;11439:1;11436;11429:12;11393:2;11459:83;11534:7;11525:6;11514:9;11510:22;11459:83;;;11449:93;;11334:214;11159:399;;;;;;11565:470;;;11695:2;11683:9;11674:7;11670:23;11666:32;11663:2;;;11711:1;11708;11701:12;11663:2;11746:1;11763:53;11808:7;11788:9;11763:53;;;11753:63;;11725:97;11881:2;11870:9;11866:18;11853:32;11905:18;11897:6;11894:30;11891:2;;;11937:1;11934;11927:12;11891:2;11957:62;12011:7;12002:6;11991:9;11987:22;11957:62;;12042:366;;;12163:2;12151:9;12142:7;12138:23;12134:32;12131:2;;;12179:1;12176;12169:12;12131:2;12214:1;12231:53;12276:7;12256:9;12231:53;;;12221:63;;12193:97;12321:2;12339:53;12384:7;12375:6;12364:9;12360:22;12339:53;;12415:438;;12578:2;12566:9;12557:7;12553:23;12549:32;12546:2;;;12594:1;12591;12584:12;12546:2;12629:24;;12673:18;12662:30;;12659:2;;;12705:1;12702;12695:12;12659:2;12725:112;12829:7;12820:6;12809:9;12805:22;12725:112;;12860:676;;;13050:2;13038:9;13029:7;13025:23;13021:32;13018:2;;;13066:1;13063;13056:12;13018:2;13101:31;;13152:18;13141:30;;13138:2;;;13184:1;13181;13174:12;13138:2;13204:97;13293:7;13284:6;13273:9;13269:22;13204:97;;;13194:107;;13080:227;13366:2;13355:9;13351:18;13338:32;13390:18;13382:6;13379:30;13376:2;;;13422:1;13419;13412:12;13376:2;13442:78;13512:7;13503:6;13492:9;13488:22;13442:78;;13543:257;;13655:2;13643:9;13634:7;13630:23;13626:32;13623:2;;;13671:1;13668;13661:12;13623:2;13706:1;13723:61;13776:7;13756:9;13723:61;;13807:317;;13949:2;13937:9;13928:7;13924:23;13920:32;13917:2;;;13965:1;13962;13955:12;13917:2;14000:1;14017:91;14100:7;14080:9;14017:91;;14131:498;;;14275:2;14263:9;14254:7;14250:23;14246:32;14243:2;;;14291:1;14288;14281:12;14243:2;14326:31;;14377:18;14366:30;;14363:2;;;14409:1;14406;14399:12;14363:2;14429:76;14497:7;14488:6;14477:9;14473:22;14429:76;;;14419:86;;14305:206;14542:2;14560:53;14605:7;14596:6;14585:9;14581:22;14560:53;;14636:263;;14751:2;14739:9;14730:7;14726:23;14722:32;14719:2;;;14767:1;14764;14757:12;14719:2;14802:1;14819:64;14875:7;14855:9;14819:64;;14906:110;14979:31;15004:5;14979:31;;;14974:3;14967:44;14961:55;;;15090:755;;15271:77;15342:5;15271:77;;;15366:6;15361:3;15354:19;15390:4;15385:3;15381:14;15374:21;;15435:79;15508:5;15435:79;;;15535:1;15520:303;15545:6;15542:1;15539:13;15520:303;;;15585:103;15684:3;15675:6;15669:13;15585:103;;;15705:83;15781:6;15705:83;;;15811:4;15802:14;;;;;15695:93;-1:-1;15567:1;15560:9;15520:303;;;-1:-1;15836:3;;15250:595;-1:-1;;;;15250:595;15912:864;;16085:73;16152:5;16085:73;;;16176:6;16171:3;16164:19;16200:4;16195:3;16191:14;16184:21;;16248:3;16290:4;16282:6;16278:17;16273:3;16269:27;16316:75;16385:5;16316:75;;;16412:1;16397:340;16422:6;16419:1;16416:13;16397:340;;;16484:9;16478:4;16474:20;16469:3;16462:33;16510:96;16601:4;16592:6;16586:13;16510:96;;;16502:104;;16623:79;16695:6;16623:79;;;16725:4;16716:14;;;;;16613:89;-1:-1;16444:1;16437:9;16397:340;;;-1:-1;16750:4;;16064:712;-1:-1;;;;;;16064:712;16865:749;;17044:76;17114:5;17044:76;;;17138:6;17133:3;17126:19;17162:4;17157:3;17153:14;17146:21;;17207:78;17279:5;17207:78;;;17306:1;17291:301;17316:6;17313:1;17310:13;17291:301;;;17356:101;17453:3;17444:6;17438:13;17356:101;;;17474:82;17549:6;17474:82;;;17579:5;17570:15;;;;;17464:92;-1:-1;17338:1;17331:9;17291:301;;17653:590;;17788:54;17836:5;17788:54;;;17860:6;17855:3;17848:19;17884:4;17879:3;17875:14;17868:21;;17929:56;17979:5;17929:56;;;18006:1;17991:230;18016:6;18013:1;18010:13;17991:230;;;18056:53;18105:3;18096:6;18090:13;18056:53;;;18126:60;18179:6;18126:60;;;18209:4;18200:14;;;;;18116:70;-1:-1;18038:1;18031:9;17991:230;;18251:110;18324:31;18349:5;18324:31;;18368:107;18439:30;18463:5;18439:30;;18482:289;;18578:34;18606:5;18578:34;;;18629:6;18624:3;18617:19;18641:63;18697:6;18690:4;18685:3;18681:14;18674:4;18667:5;18663:16;18641:63;;;18736:29;18758:6;18736:29;;;18716:50;;;18729:4;18716:50;;18558:213;-1:-1;;;18558:213;18779:397;18934:2;18922:15;;18971:66;18966:2;18957:12;;18950:88;19072:66;19067:2;19058:12;;19051:88;19167:2;19158:12;;18915:261;19185:296;19340:2;19328:15;;19377:66;19372:2;19363:12;;19356:88;19472:2;19463:12;;19321:160;19490:397;19645:2;19633:15;;19682:66;19677:2;19668:12;;19661:88;19783:66;19778:2;19769:12;;19762:88;19878:2;19869:12;;19626:261;19896:397;20051:2;20039:15;;20088:66;20083:2;20074:12;;20067:88;20189:66;20184:2;20175:12;;20168:88;20284:2;20275:12;;20032:261;20362:695;20575:22;;20499:4;20490:14;;;20609:57;20494:3;20575:22;20609:57;;;20519:159;20759:4;20752:5;20748:16;20742:23;20777:62;20833:4;20828:3;20824:14;20811:11;20777:62;;;20688:163;20950:4;20943:5;20939:16;20933:23;20968:62;21024:4;21019:3;21015:14;21002:11;20968:62;;;20861:181;20472:585;;;;21876:2419;22091:22;;21876:2419;;22013:5;22004:15;;;22125:61;22008:3;22091:22;22125:61;;;22034:164;22282:4;22275:5;22271:16;22265:23;22300:62;22356:4;22351:3;22347:14;22334:11;22300:62;;;22208:166;22465:4;22458:5;22454:16;22448:23;22483:62;22539:4;22534:3;22530:14;22517:11;22483:62;;;22384:173;22642:4;22635:5;22631:16;22625:23;22660:62;22716:4;22711:3;22707:14;22694:11;22660:62;;;22567:167;22822:4;22815:5;22811:16;22805:23;22840:62;22896:4;22891:3;22887:14;22874:11;22840:62;;;22744:170;23002:4;22995:5;22991:16;22985:23;23020:62;23076:4;23071:3;23067:14;23054:11;23020:62;;;22924:170;23174:4;23167:5;23163:16;23157:23;23192:62;23248:4;23243:3;23239:14;23226:11;23192:62;;;23104:162;23346:4;23339:5;23335:16;23329:23;23364:62;23420:4;23415:3;23411:14;23398:11;23364:62;;;23276:162;23531:5;23524;23520:17;23514:24;23550:63;23606:5;23601:3;23597:15;23584:11;23550:63;;;23448:177;23701:5;23694;23690:17;23684:24;23720:63;23776:5;23771:3;23767:15;23754:11;23720:63;;;23635:160;23881:5;23874;23870:17;23864:24;23934:3;23928:4;23924:14;23916:5;23911:3;23907:15;23900:39;23954:66;24015:4;24002:11;23954:66;;;23946:74;;23805:227;24118:5;24111;24107:17;24101:24;24171:3;24165:4;24161:14;24153:5;24148:3;24144:15;24137:39;24191:66;24252:4;24239:11;24191:66;;;24183:74;21986:2309;-1:-1;;;;;21986:2309;26852:1587;27065:22;;26987:5;26978:15;;;27099:61;26982:3;27065:22;27099:61;;;27008:164;27258:4;27251:5;27247:16;27241:23;27276:62;27332:4;27327:3;27323:14;27310:11;27276:62;;;27182:168;27434:4;27427:5;27423:16;27417:23;27452:62;27508:4;27503:3;27499:14;27486:11;27452:62;;;27360:166;27612:4;27605:5;27601:16;27595:23;27630:62;27686:4;27681:3;27677:14;27664:11;27630:62;;;27536:168;27791:4;27784:5;27780:16;27774:23;27809:62;27865:4;27860:3;27856:14;27843:11;27809:62;;;27714:169;27972:4;27965:5;27961:16;27955:23;27990:62;28046:4;28041:3;28037:14;28024:11;27990:62;;;27893:171;28151:4;28144:5;28140:16;28134:23;28169:62;28225:4;28220:3;28216:14;28203:11;28169:62;;;28074:169;28332:4;28325:5;28321:16;28315:23;28350:62;28406:4;28401:3;28397:14;28384:11;28350:62;;30228:104;30297:29;30320:5;30297:29;;30339:193;30447:2;30432:18;;30461:61;30436:9;30495:6;30461:61;;30539:294;30675:2;30660:18;;30689:61;30664:9;30723:6;30689:61;;;30761:62;30819:2;30808:9;30804:18;30795:6;30761:62;;30840:770;31166:2;31180:47;;;31151:18;;31241:144;31151:18;31371:6;31241:144;;;31233:152;;31433:9;31427:4;31423:20;31418:2;31407:9;31403:18;31396:48;31458:142;31595:4;31586:6;31458:142;;31617:417;31813:2;31827:47;;;31798:18;;31888:136;31798:18;32010:6;31888:136;;32041:429;32243:2;32257:47;;;32228:18;;32318:142;32228:18;32446:6;32318:142;;32477:590;32713:2;32727:47;;;32698:18;;32788:98;32698:18;32872:6;32788:98;;;32780:106;;32934:9;32928:4;32924:20;32919:2;32908:9;32904:18;32897:48;32959:98;33052:4;33043:6;32959:98;;33074:189;33180:2;33165:18;;33194:59;33169:9;33226:6;33194:59;;33270:387;33451:2;33465:47;;;33436:18;;33526:121;33436:18;33526:121;;33664:387;33845:2;33859:47;;;33830:18;;33920:121;33830:18;33920:121;;34058:387;34239:2;34253:47;;;34224:18;;34314:121;34224:18;34314:121;;34452:387;34633:2;34647:47;;;34618:18;;34708:121;34618:18;34708:121;;34846:507;35088:3;35073:19;;35103:115;35077:9;35191:6;35103:115;;;35229:114;35339:2;35328:9;35324:18;35315:6;35229:114;;35360:333;35514:2;35528:47;;;35499:18;;35589:94;35499:18;35669:6;35589:94;;35700:298;35860:3;35845:19;;35875:113;35849:9;35961:6;35875:113;;36005:193;36113:2;36098:18;;36127:61;36102:9;36161:6;36127:61;;36205:294;36341:2;36326:18;;36355:61;36330:9;36389:6;36355:61;;;36427:62;36485:2;36474:9;36470:18;36461:6;36427:62;;36506:256;36568:2;36562:9;36594:17;;;36669:18;36654:34;;36690:22;;;36651:62;36648:2;;;36726:1;36723;36716:12;36648:2;36742;36735:22;36546:216;;-1:-1;36546:216;36769:258;;36928:18;36920:6;36917:30;36914:2;;;36960:1;36957;36950:12;36914:2;-1:-1;36989:4;36977:17;;;37007:15;;36851:176;37876:254;;38015:18;38007:6;38004:30;38001:2;;;38047:1;38044;38037:12;38001:2;-1:-1;38120:4;38091;38068:17;;;;38087:9;38064:33;38110:15;;37938:192;38404:144;38536:4;38524:17;;38505:43;38994:130;39107:12;;39091:33;40196:128;40276:42;40265:54;;40248:76;40331:79;40400:5;40383:27;40417:151;40496:66;40485:78;;40468:100;40661:88;40739:4;40728:16;;40711:38;40891:92;40964:13;40957:21;;40940:43;41258:145;41339:6;41334:3;41329;41316:30;-1:-1;41395:1;41377:16;;41370:27;41309:94;41412:268;41477:1;41484:101;41498:6;41495:1;41492:13;41484:101;;;41565:11;;;41559:18;41546:11;;;41539:39;41520:2;41513:10;41484:101;;;41600:6;41597:1;41594:13;41591:2;;;-1:-1;;41665:1;41647:16;;41640:27;41461:219;41688:97;41776:2;41756:14;41772:7;41752:28;;41736:49"
- }
- }
- },
- "sources": {
- "2.0.0/extensions/Forwarder/Forwarder.sol": {
- "id": 0
- },
- "2.0.0/extensions/Forwarder/MixinAssets.sol": {
- "id": 1
- },
- "2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol": {
- "id": 2
- },
- "2.0.0/extensions/Forwarder/MixinForwarderCore.sol": {
- "id": 3
- },
- "2.0.0/extensions/Forwarder/MixinWeth.sol": {
- "id": 4
- },
- "2.0.0/extensions/Forwarder/interfaces/IAssets.sol": {
- "id": 5
- },
- "2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol": {
- "id": 6
- },
- "2.0.0/extensions/Forwarder/libs/LibConstants.sol": {
- "id": 7
- },
- "2.0.0/extensions/Forwarder/mixins/MAssets.sol": {
- "id": 8
- },
- "2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol": {
- "id": 9
- },
- "2.0.0/extensions/Forwarder/mixins/MWeth.sol": {
- "id": 10
- },
- "2.0.0/extensions/OrderValidator/OrderValidator.sol": {
- "id": 11
- },
- "2.0.0/multisig/MultiSigWallet.sol": {
- "id": 12
- },
- "2.0.0/multisig/MultiSigWalletWithTimeLock.sol": {
- "id": 13
- },
- "2.0.0/protocol/AssetProxy/ERC20Proxy.sol": {
- "id": 14
- },
- "2.0.0/protocol/AssetProxy/ERC721Proxy.sol": {
- "id": 15
- },
- "2.0.0/protocol/AssetProxy/MixinAuthorizable.sol": {
- "id": 16
- },
- "2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol": {
- "id": 17
- },
- "2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol": {
- "id": 18
- },
- "2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol": {
- "id": 19
- },
- "2.0.0/protocol/AssetProxyOwner/AssetProxyOwner.sol": {
- "id": 20
- },
- "2.0.0/protocol/Exchange/Exchange.sol": {
- "id": 21
- },
- "2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol": {
- "id": 22
- },
- "2.0.0/protocol/Exchange/MixinExchangeCore.sol": {
- "id": 23
- },
- "2.0.0/protocol/Exchange/MixinMatchOrders.sol": {
- "id": 24
- },
- "2.0.0/protocol/Exchange/MixinSignatureValidator.sol": {
- "id": 25
- },
- "2.0.0/protocol/Exchange/MixinTransactions.sol": {
- "id": 26
- },
- "2.0.0/protocol/Exchange/MixinWrapperFunctions.sol": {
- "id": 27
- },
- "2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol": {
- "id": 28
- },
- "2.0.0/protocol/Exchange/interfaces/IExchange.sol": {
- "id": 29
- },
- "2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol": {
- "id": 30
- },
- "2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol": {
- "id": 31
- },
- "2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol": {
- "id": 32
- },
- "2.0.0/protocol/Exchange/interfaces/ITransactions.sol": {
- "id": 33
- },
- "2.0.0/protocol/Exchange/interfaces/IValidator.sol": {
- "id": 34
- },
- "2.0.0/protocol/Exchange/interfaces/IWallet.sol": {
- "id": 35
- },
- "2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol": {
- "id": 36
- },
- "2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol": {
- "id": 37
- },
- "2.0.0/protocol/Exchange/libs/LibConstants.sol": {
- "id": 38
- },
- "2.0.0/protocol/Exchange/libs/LibEIP712.sol": {
- "id": 39
- },
- "2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol": {
- "id": 40
- },
- "2.0.0/protocol/Exchange/libs/LibFillResults.sol": {
- "id": 41
- },
- "2.0.0/protocol/Exchange/libs/LibMath.sol": {
- "id": 42
- },
- "2.0.0/protocol/Exchange/libs/LibOrder.sol": {
- "id": 43
- },
- "2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol": {
- "id": 44
- },
- "2.0.0/protocol/Exchange/mixins/MExchangeCore.sol": {
- "id": 45
- },
- "2.0.0/protocol/Exchange/mixins/MMatchOrders.sol": {
- "id": 46
- },
- "2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol": {
- "id": 47
- },
- "2.0.0/protocol/Exchange/mixins/MTransactions.sol": {
- "id": 48
- },
- "2.0.0/protocol/Exchange/mixins/MWrapperFunctions.sol": {
- "id": 49
- },
- "2.0.0/test/DummyERC20Token/DummyERC20Token.sol": {
- "id": 50
- },
- "2.0.0/test/DummyERC721Token/DummyERC721Token.sol": {
- "id": 51
- },
- "2.0.0/tokens/ERC20Token/ERC20Token.sol": {
- "id": 52
- },
- "2.0.0/tokens/ERC20Token/IERC20Token.sol": {
- "id": 53
- },
- "2.0.0/tokens/ERC20Token/MintableERC20Token.sol": {
- "id": 54
- },
- "2.0.0/tokens/ERC20Token/UnlimitedAllowanceERC20Token.sol": {
- "id": 55
- },
- "2.0.0/tokens/ERC721Token/ERC721Token.sol": {
- "id": 56
- },
- "2.0.0/tokens/ERC721Token/IERC721Receiver.sol": {
- "id": 57
- },
- "2.0.0/tokens/ERC721Token/IERC721Token.sol": {
- "id": 58
- },
- "2.0.0/tokens/ERC721Token/MintableERC721Token.sol": {
- "id": 59
- },
- "2.0.0/tokens/EtherToken/IEtherToken.sol": {
- "id": 60
- },
- "2.0.0/utils/LibBytes/LibBytes.sol": {
- "id": 61
- },
- "2.0.0/utils/Ownable/IOwnable.sol": {
- "id": 62
- },
- "2.0.0/utils/Ownable/Ownable.sol": {
- "id": 63
- },
- "2.0.0/utils/ReentrancyGuard/ReentrancyGuard.sol": {
- "id": 64
- },
- "2.0.0/utils/SafeMath/SafeMath.sol": {
- "id": 65
- }
- },
- "sourceCodes": {
- "2.0.0/extensions/Forwarder/Forwarder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./MixinWeth.sol\";\nimport \"./MixinForwarderCore.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./MixinAssets.sol\";\nimport \"./MixinExchangeWrapper.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract Forwarder is\n LibConstants,\n MixinWeth,\n MixinAssets,\n MixinExchangeWrapper,\n MixinForwarderCore\n{\n constructor (\n address _exchange,\n bytes memory _zrxAssetData,\n bytes memory _wethAssetData\n )\n public\n LibConstants(\n _exchange,\n _zrxAssetData,\n _wethAssetData\n )\n MixinForwarderCore()\n {}\n}\n",
- "2.0.0/extensions/Forwarder/MixinAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"../../tokens/ERC20Token/IERC20Token.sol\";\nimport \"../../tokens/ERC721Token/IERC721Token.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MAssets.sol\";\n\n\ncontract MixinAssets is\n Ownable,\n LibConstants,\n MAssets\n{\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_TRANSFER_SELECTOR = bytes4(keccak256(\"transfer(address,uint256)\"));\n\n /// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to \n /// function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be\n /// used to withdraw assets that were accidentally sent to this contract.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of ERC20 token to withdraw.\n function withdrawAsset(\n bytes assetData,\n uint256 amount\n )\n external\n onlyOwner\n {\n transferAssetToSender(assetData, amount);\n }\n\n /// @dev Transfers given amount of asset to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferAssetToSender(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n bytes4 proxyId = assetData.readBytes4(0);\n\n if (proxyId == ERC20_DATA_ID) {\n transferERC20Token(assetData, amount);\n } else if (proxyId == ERC721_DATA_ID) {\n transferERC721Token(assetData, amount);\n } else {\n revert(\"UNSUPPORTED_ASSET_PROXY\");\n }\n }\n\n /// @dev Decodes ERC20 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC20Token(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n address token = assetData.readAddress(16);\n\n // Transfer tokens.\n // We do a raw call so we can check the success separate\n // from the return data.\n bool success = token.call(abi.encodeWithSelector(\n ERC20_TRANSFER_SELECTOR,\n msg.sender,\n amount\n ));\n require(\n success,\n \"TRANSFER_FAILED\"\n );\n \n // Check return data.\n // If there is no return data, we assume the token incorrectly\n // does not return a bool. In this case we expect it to revert\n // on failure, which was handled above.\n // If the token does return data, we require that it is a single\n // value that evaluates to true.\n assembly {\n if returndatasize {\n success := 0\n if eq(returndatasize, 32) {\n // First 64 bytes of memory are reserved scratch space\n returndatacopy(0, 0, 32)\n success := mload(0)\n }\n }\n }\n require(\n success,\n \"TRANSFER_FAILED\"\n );\n }\n\n /// @dev Decodes ERC721 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC721Token(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n require(\n amount == 1,\n \"INVALID_AMOUNT\"\n );\n // Decode asset data.\n address token = assetData.readAddress(16);\n uint256 tokenId = assetData.readUint256(36);\n\n // Perform transfer.\n IERC721Token(token).transferFrom(\n address(this),\n msg.sender,\n tokenId\n );\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MExchangeWrapper.sol\";\nimport \"../../protocol/Exchange/libs/LibAbiEncoder.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../protocol/Exchange/libs/LibFillResults.sol\";\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\n\n\ncontract MixinExchangeWrapper is\n LibAbiEncoder,\n LibFillResults,\n LibMath,\n LibConstants,\n MExchangeWrapper\n{\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n // ABI encode calldata for `fillOrder`\n bytes memory fillOrderCalldata = abiEncodeFillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n\n address exchange = address(EXCHANGE);\n\n // Call `fillOrder` and handle any exceptions gracefully\n assembly {\n let success := call(\n gas, // forward all gas\n exchange, // call address of Exchange contract\n 0, // transfer 0 wei\n add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes)\n mload(fillOrderCalldata), // length of input\n fillOrderCalldata, // write output over input\n 128 // output size is 128 bytes\n )\n if success {\n mstore(fillResults, mload(fillOrderCalldata))\n mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32)))\n mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64)))\n mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96)))\n }\n }\n // fillResults values will be 0 by default if call was unsuccessful\n return fillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of WETH has been sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param wethSellAmount Desired amount of WETH to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellWeth(\n LibOrder.Order[] memory orders,\n uint256 wethSellAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // We assume that asset being sold by taker is WETH for each order.\n orders[i].makerAssetData = makerAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of WETH to sell\n uint256 remainingTakerAssetFillAmount = safeSub(wethSellAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of WETH\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= wethSellAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// The asset being sold by taker must always be WETH.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyExactAmountWithWeth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // We assume that asset being sold by taker is WETH for each order.\n orders[i].makerAssetData = makerAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n uint256 makerAssetFilledAmount = totalFillResults.makerAssetFilledAmount;\n if (makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n\n require(\n makerAssetFilledAmount >= makerAssetFillAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return totalFillResults;\n }\n\n /// @dev Buys zrxBuyAmount of ZRX fee tokens, taking into account ZRX fees for each order. This will guarantee\n /// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues).\n /// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX\n /// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases.\n /// The asset being sold by taker must always be WETH. \n /// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset.\n /// @param zrxBuyAmount Desired amount of ZRX to buy.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return totalFillResults Amounts filled and fees paid by maker and taker.\n function marketBuyExactZrxWithWeth(\n LibOrder.Order[] memory orders,\n uint256 zrxBuyAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n // Do nothing if zrxBuyAmount == 0\n if (zrxBuyAmount == 0) {\n return totalFillResults;\n }\n\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n uint256 zrxPurchased = 0;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // All of these are ZRX/WETH, so we can drop the respective assetData from calldata.\n orders[i].makerAssetData = zrxAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of ZRX to buy.\n uint256 remainingZrxBuyAmount = safeSub(zrxBuyAmount, zrxPurchased);\n\n // Convert the remaining amount of ZRX to buy into remaining amount\n // of WETH to sell, assuming entire amount can be sold in the current order.\n uint256 remainingWethSellAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n safeSub(orders[i].makerAssetAmount, orders[i].takerFee), // our exchange rate after fees \n remainingZrxBuyAmount\n );\n\n // Attempt to sell the remaining amount of WETH.\n FillResults memory singleFillResult = fillOrderNoThrow(\n orders[i],\n safeAdd(remainingWethSellAmount, 1), // we add 1 wei to the fill amount to make up for rounding errors\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker.\n addFillResults(totalFillResults, singleFillResult);\n zrxPurchased = safeSub(totalFillResults.makerAssetFilledAmount, totalFillResults.takerFeePaid);\n\n // Stop execution if the entire amount of ZRX has been bought.\n if (zrxPurchased >= zrxBuyAmount) {\n break;\n }\n }\n\n require(\n zrxPurchased >= zrxBuyAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return totalFillResults;\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinForwarderCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MWeth.sol\";\nimport \"./mixins/MAssets.sol\";\nimport \"./mixins/MExchangeWrapper.sol\";\nimport \"./interfaces/IForwarderCore.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../protocol/Exchange/libs/LibFillResults.sol\";\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\n\n\ncontract MixinForwarderCore is\n LibFillResults,\n LibMath,\n LibConstants,\n MWeth,\n MAssets,\n MExchangeWrapper,\n IForwarderCore\n{\n using LibBytes for bytes;\n\n /// @dev Constructor approves ERC20 proxy to transfer ZRX and WETH on this contract's behalf.\n constructor ()\n public\n {\n address proxyAddress = EXCHANGE.getAssetProxy(ERC20_DATA_ID);\n require(\n proxyAddress != address(0),\n \"UNREGISTERED_ASSET_PROXY\"\n );\n ETHER_TOKEN.approve(proxyAddress, MAX_UINT);\n ZRX_TOKEN.approve(proxyAddress, MAX_UINT);\n }\n\n /// @dev Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketSellOrdersWithEth(\n LibOrder.Order[] memory orders,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n FillResults memory orderFillResults,\n FillResults memory feeOrderFillResults\n )\n {\n // Convert ETH to WETH.\n convertEthToWeth();\n\n uint256 wethSellAmount;\n uint256 zrxBuyAmount;\n uint256 makerAssetAmountPurchased;\n if (orders[0].makerAssetData.equals(ZRX_ASSET_DATA)) {\n // Calculate amount of WETH that won't be spent on ETH fees.\n wethSellAmount = getPartialAmountFloor(\n PERCENTAGE_DENOMINATOR,\n safeAdd(PERCENTAGE_DENOMINATOR, feePercentage),\n msg.value\n );\n // Market sell available WETH.\n // ZRX fees are paid with this contract's balance.\n orderFillResults = marketSellWeth(\n orders,\n wethSellAmount,\n signatures\n );\n // The fee amount must be deducted from the amount transfered back to sender.\n makerAssetAmountPurchased = safeSub(orderFillResults.makerAssetFilledAmount, orderFillResults.takerFeePaid);\n } else {\n // 5% of WETH is reserved for filling feeOrders and paying feeRecipient.\n wethSellAmount = getPartialAmountFloor(\n MAX_WETH_FILL_PERCENTAGE,\n PERCENTAGE_DENOMINATOR,\n msg.value\n );\n // Market sell 95% of WETH.\n // ZRX fees are payed with this contract's balance.\n orderFillResults = marketSellWeth(\n orders,\n wethSellAmount,\n signatures\n );\n // Buy back all ZRX spent on fees.\n zrxBuyAmount = orderFillResults.takerFeePaid;\n feeOrderFillResults = marketBuyExactZrxWithWeth(\n feeOrders,\n zrxBuyAmount,\n feeSignatures\n );\n makerAssetAmountPurchased = orderFillResults.makerAssetFilledAmount;\n }\n\n // Transfer feePercentage of total ETH spent on primary orders to feeRecipient.\n // Refund remaining ETH to msg.sender.\n transferEthFeeAndRefund(\n orderFillResults.takerAssetFilledAmount,\n feeOrderFillResults.takerAssetFilledAmount,\n feePercentage,\n feeRecipient\n );\n\n // Transfer purchased assets to msg.sender.\n transferAssetToSender(orders[0].makerAssetData, makerAssetAmountPurchased);\n }\n\n /// @dev Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param makerAssetFillAmount Desired amount of makerAsset to purchase.\n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketBuyOrdersWithEth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n FillResults memory orderFillResults,\n FillResults memory feeOrderFillResults\n )\n {\n // Convert ETH to WETH.\n convertEthToWeth();\n\n uint256 zrxBuyAmount;\n uint256 makerAssetAmountPurchased;\n if (orders[0].makerAssetData.equals(ZRX_ASSET_DATA)) {\n // If the makerAsset is ZRX, it is not necessary to pay fees out of this\n // contracts's ZRX balance because fees are factored into the price of the order.\n orderFillResults = marketBuyExactZrxWithWeth(\n orders,\n makerAssetFillAmount,\n signatures\n );\n // The fee amount must be deducted from the amount transfered back to sender.\n makerAssetAmountPurchased = safeSub(orderFillResults.makerAssetFilledAmount, orderFillResults.takerFeePaid);\n } else {\n // Attemp to purchase desired amount of makerAsset.\n // ZRX fees are payed with this contract's balance.\n orderFillResults = marketBuyExactAmountWithWeth(\n orders,\n makerAssetFillAmount,\n signatures\n );\n // Buy back all ZRX spent on fees.\n zrxBuyAmount = orderFillResults.takerFeePaid;\n feeOrderFillResults = marketBuyExactZrxWithWeth(\n feeOrders,\n zrxBuyAmount,\n feeSignatures\n );\n makerAssetAmountPurchased = orderFillResults.makerAssetFilledAmount;\n }\n\n // Transfer feePercentage of total ETH spent on primary orders to feeRecipient.\n // Refund remaining ETH to msg.sender.\n transferEthFeeAndRefund(\n orderFillResults.takerAssetFilledAmount,\n feeOrderFillResults.takerAssetFilledAmount,\n feePercentage,\n feeRecipient\n );\n\n // Transfer purchased assets to msg.sender.\n transferAssetToSender(orders[0].makerAssetData, makerAssetAmountPurchased);\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinWeth.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MWeth.sol\";\n\n\ncontract MixinWeth is\n LibMath,\n LibConstants,\n MWeth\n{\n /// @dev Default payabale function, this allows us to withdraw WETH\n function ()\n public\n payable\n {\n require(\n msg.sender == address(ETHER_TOKEN),\n \"DEFAULT_FUNCTION_WETH_CONTRACT_ONLY\"\n );\n }\n\n /// @dev Converts message call's ETH value into WETH.\n function convertEthToWeth()\n internal\n {\n require(\n msg.value > 0,\n \"INVALID_MSG_VALUE\"\n );\n ETHER_TOKEN.deposit.value(msg.value)();\n }\n\n /// @dev Transfers feePercentage of WETH spent on primary orders to feeRecipient.\n /// Refunds any excess ETH to msg.sender.\n /// @param wethSoldExcludingFeeOrders Amount of WETH sold when filling primary orders.\n /// @param wethSoldForZrx Amount of WETH sold when purchasing ZRX required for primary order fees.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n function transferEthFeeAndRefund(\n uint256 wethSoldExcludingFeeOrders,\n uint256 wethSoldForZrx,\n uint256 feePercentage,\n address feeRecipient\n )\n internal\n {\n // Ensure feePercentage is less than 5%.\n require(\n feePercentage <= MAX_FEE_PERCENTAGE,\n \"FEE_PERCENTAGE_TOO_LARGE\"\n );\n\n // Ensure that no extra WETH owned by this contract has been sold.\n uint256 wethSold = safeAdd(wethSoldExcludingFeeOrders, wethSoldForZrx);\n require(\n wethSold <= msg.value,\n \"OVERSOLD_WETH\"\n );\n\n // Calculate amount of WETH that hasn't been sold.\n uint256 wethRemaining = safeSub(msg.value, wethSold);\n\n // Calculate ETH fee to pay to feeRecipient.\n uint256 ethFee = getPartialAmountFloor(\n feePercentage,\n PERCENTAGE_DENOMINATOR,\n wethSoldExcludingFeeOrders\n );\n\n // Ensure fee is less than amount of WETH remaining.\n require(\n ethFee <= wethRemaining,\n \"INSUFFICIENT_ETH_REMAINING\"\n );\n \n // Do nothing if no WETH remaining\n if (wethRemaining > 0) {\n // Convert remaining WETH to ETH\n ETHER_TOKEN.withdraw(wethRemaining);\n\n // Pay ETH to feeRecipient\n if (ethFee > 0) {\n feeRecipient.transfer(ethFee);\n }\n\n // Refund remaining ETH to msg.sender.\n uint256 ethRefund = safeSub(wethRemaining, ethFee);\n if (ethRefund > 0) {\n msg.sender.transfer(ethRefund);\n }\n }\n }\n}\n",
- "2.0.0/extensions/Forwarder/interfaces/IAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IAssets {\n\n /// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to \n /// function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be\n /// used to withdraw assets that were accidentally sent to this contract.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of ERC20 token to withdraw.\n function withdrawAsset(\n bytes assetData,\n uint256 amount\n )\n external;\n}\n",
- "2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../../protocol/Exchange/libs/LibFillResults.sol\";\n\n\ncontract IForwarderCore {\n\n /// @dev Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketSellOrdersWithEth(\n LibOrder.Order[] memory orders,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n LibFillResults.FillResults memory orderFillResults,\n LibFillResults.FillResults memory feeOrderFillResults\n );\n\n /// @dev Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param makerAssetFillAmount Desired amount of makerAsset to purchase.\n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketBuyOrdersWithEth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n LibFillResults.FillResults memory orderFillResults,\n LibFillResults.FillResults memory feeOrderFillResults\n );\n}\n",
- "2.0.0/extensions/Forwarder/libs/LibConstants.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/LibBytes/LibBytes.sol\";\nimport \"../../../protocol/Exchange/interfaces/IExchange.sol\";\nimport \"../../../tokens/EtherToken/IEtherToken.sol\";\nimport \"../../../tokens/ERC20Token/IERC20Token.sol\";\n\n\ncontract LibConstants {\n\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n uint256 constant internal MAX_UINT = 2**256 - 1;\n uint256 constant internal PERCENTAGE_DENOMINATOR = 10**18; \n uint256 constant internal MAX_FEE_PERCENTAGE = 5 * PERCENTAGE_DENOMINATOR / 100; // 5%\n uint256 constant internal MAX_WETH_FILL_PERCENTAGE = 95 * PERCENTAGE_DENOMINATOR / 100; // 95%\n \n // solhint-disable var-name-mixedcase\n IExchange internal EXCHANGE;\n IEtherToken internal ETHER_TOKEN;\n IERC20Token internal ZRX_TOKEN;\n bytes internal ZRX_ASSET_DATA;\n bytes internal WETH_ASSET_DATA;\n // solhint-enable var-name-mixedcase\n\n constructor (\n address _exchange,\n bytes memory _zrxAssetData,\n bytes memory _wethAssetData\n )\n public\n {\n EXCHANGE = IExchange(_exchange);\n ZRX_ASSET_DATA = _zrxAssetData;\n WETH_ASSET_DATA = _wethAssetData;\n\n address etherToken = _wethAssetData.readAddress(16);\n address zrxToken = _zrxAssetData.readAddress(16);\n ETHER_TOKEN = IEtherToken(etherToken);\n ZRX_TOKEN = IERC20Token(zrxToken);\n }\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAssets.sol\";\n\n\ncontract MAssets is\n IAssets\n{\n /// @dev Transfers given amount of asset to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferAssetToSender(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n\n /// @dev Decodes ERC20 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC20Token(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n\n /// @dev Decodes ERC721 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC721Token(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../../protocol/Exchange/libs/LibFillResults.sol\";\n\n\ncontract MExchangeWrapper {\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of WETH has been sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param wethSellAmount Desired amount of WETH to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellWeth(\n LibOrder.Order[] memory orders,\n uint256 wethSellAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// The asset being sold by taker must always be WETH.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyExactAmountWithWeth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Buys zrxBuyAmount of ZRX fee tokens, taking into account ZRX fees for each order. This will guarantee\n /// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues).\n /// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX\n /// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases.\n /// The asset being sold by taker must always be WETH. \n /// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset.\n /// @param zrxBuyAmount Desired amount of ZRX to buy.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return totalFillResults Amounts filled and fees paid by maker and taker.\n function marketBuyExactZrxWithWeth(\n LibOrder.Order[] memory orders,\n uint256 zrxBuyAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MWeth.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract MWeth {\n\n /// @dev Converts message call's ETH value into WETH.\n function convertEthToWeth()\n internal;\n\n /// @dev Transfers feePercentage of WETH spent on primary orders to feeRecipient.\n /// Refunds any excess ETH to msg.sender.\n /// @param wethSoldExcludingFeeOrders Amount of WETH sold when filling primary orders.\n /// @param wethSoldForZrx Amount of WETH sold when purchasing ZRX required for primary order fees.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n function transferEthFeeAndRefund(\n uint256 wethSoldExcludingFeeOrders,\n uint256 wethSoldForZrx,\n uint256 feePercentage,\n address feeRecipient\n )\n internal;\n}\n",
- "2.0.0/extensions/OrderValidator/OrderValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../protocol/Exchange/interfaces/IExchange.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../tokens/ERC20Token/IERC20Token.sol\";\nimport \"../../tokens/ERC721Token/IERC721Token.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\n\n\ncontract OrderValidator {\n\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n\n struct TraderInfo {\n uint256 makerBalance; // Maker's balance of makerAsset\n uint256 makerAllowance; // Maker's allowance to corresponding AssetProxy\n uint256 takerBalance; // Taker's balance of takerAsset\n uint256 takerAllowance; // Taker's allowance to corresponding AssetProxy\n uint256 makerZrxBalance; // Maker's balance of ZRX\n uint256 makerZrxAllowance; // Maker's allowance of ZRX to ERC20Proxy\n uint256 takerZrxBalance; // Taker's balance of ZRX\n uint256 takerZrxAllowance; // Taker's allowance of ZRX to ERC20Proxy\n }\n\n // solhint-disable var-name-mixedcase\n IExchange internal EXCHANGE;\n bytes internal ZRX_ASSET_DATA;\n // solhint-enable var-name-mixedcase\n\n constructor (address _exchange, bytes memory _zrxAssetData)\n public\n {\n EXCHANGE = IExchange(_exchange);\n ZRX_ASSET_DATA = _zrxAssetData;\n }\n\n /// @dev Fetches information for order and maker/taker of order.\n /// @param order The order structure.\n /// @param takerAddress Address that will be filling the order.\n /// @return OrderInfo and TraderInfo instances for given order.\n function getOrderAndTraderInfo(LibOrder.Order memory order, address takerAddress)\n public\n view\n returns (LibOrder.OrderInfo memory orderInfo, TraderInfo memory traderInfo)\n {\n orderInfo = EXCHANGE.getOrderInfo(order);\n traderInfo = getTraderInfo(order, takerAddress);\n return (orderInfo, traderInfo);\n }\n\n /// @dev Fetches information for all passed in orders and the makers/takers of each order.\n /// @param orders Array of order specifications.\n /// @param takerAddresses Array of taker addresses corresponding to each order.\n /// @return Arrays of OrderInfo and TraderInfo instances that correspond to each order.\n function getOrdersAndTradersInfo(LibOrder.Order[] memory orders, address[] memory takerAddresses)\n public\n view\n returns (LibOrder.OrderInfo[] memory ordersInfo, TraderInfo[] memory tradersInfo)\n {\n ordersInfo = EXCHANGE.getOrdersInfo(orders);\n tradersInfo = getTradersInfo(orders, takerAddresses);\n return (ordersInfo, tradersInfo);\n }\n\n /// @dev Fetches balance and allowances for maker and taker of order.\n /// @param order The order structure.\n /// @param takerAddress Address that will be filling the order.\n /// @return Balances and allowances of maker and taker of order.\n function getTraderInfo(LibOrder.Order memory order, address takerAddress)\n public\n view\n returns (TraderInfo memory traderInfo)\n {\n (traderInfo.makerBalance, traderInfo.makerAllowance) = getBalanceAndAllowance(order.makerAddress, order.makerAssetData);\n (traderInfo.takerBalance, traderInfo.takerAllowance) = getBalanceAndAllowance(takerAddress, order.takerAssetData);\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n (traderInfo.makerZrxBalance, traderInfo.makerZrxAllowance) = getBalanceAndAllowance(order.makerAddress, zrxAssetData);\n (traderInfo.takerZrxBalance, traderInfo.takerZrxAllowance) = getBalanceAndAllowance(takerAddress, zrxAssetData);\n return traderInfo;\n }\n\n /// @dev Fetches balances and allowances of maker and taker for each provided order.\n /// @param orders Array of order specifications.\n /// @param takerAddresses Array of taker addresses corresponding to each order.\n /// @return Array of balances and allowances for maker and taker of each order.\n function getTradersInfo(LibOrder.Order[] memory orders, address[] memory takerAddresses)\n public\n view\n returns (TraderInfo[] memory)\n {\n uint256 ordersLength = orders.length;\n TraderInfo[] memory tradersInfo = new TraderInfo[](ordersLength);\n for (uint256 i = 0; i != ordersLength; i++) {\n tradersInfo[i] = getTraderInfo(orders[i], takerAddresses[i]);\n }\n return tradersInfo;\n }\n\n /// @dev Fetches token balances and allowances of an address to given assetProxy. Supports ERC20 and ERC721.\n /// @param target Address to fetch balances and allowances of.\n /// @param assetData Encoded data that can be decoded by a specified proxy contract when transferring asset.\n /// @return Balance of asset and allowance set to given proxy of asset.\n /// For ERC721 tokens, these values will always be 1 or 0.\n function getBalanceAndAllowance(address target, bytes memory assetData)\n public\n view\n returns (uint256 balance, uint256 allowance)\n {\n bytes4 assetProxyId = assetData.readBytes4(0);\n address token = assetData.readAddress(16);\n address assetProxy = EXCHANGE.getAssetProxy(assetProxyId);\n\n if (assetProxyId == ERC20_DATA_ID) {\n // Query balance\n balance = IERC20Token(token).balanceOf(target);\n\n // Query allowance\n allowance = IERC20Token(token).allowance(target, assetProxy);\n } else if (assetProxyId == ERC721_DATA_ID) {\n uint256 tokenId = assetData.readUint256(36);\n\n // Query owner of tokenId\n address owner = getERC721TokenOwner(token, tokenId);\n\n // Set balance to 1 if tokenId is owned by target\n balance = target == owner ? 1 : 0;\n\n // Check if ERC721Proxy is approved to spend tokenId\n bool isApproved = IERC721Token(token).isApprovedForAll(target, assetProxy) || IERC721Token(token).getApproved(tokenId) == assetProxy;\n \n // Set alowance to 1 if ERC721Proxy is approved to spend tokenId\n allowance = isApproved ? 1 : 0;\n } else {\n revert(\"UNSUPPORTED_ASSET_PROXY\");\n }\n return (balance, allowance);\n }\n\n /// @dev Fetches token balances and allowances of an address for each given assetProxy. Supports ERC20 and ERC721.\n /// @param target Address to fetch balances and allowances of.\n /// @param assetData Array of encoded byte arrays that can be decoded by a specified proxy contract when transferring asset.\n /// @return Balances and allowances of assets.\n /// For ERC721 tokens, these values will always be 1 or 0.\n function getBalancesAndAllowances(address target, bytes[] memory assetData)\n public\n view\n returns (uint256[] memory, uint256[] memory)\n {\n uint256 length = assetData.length;\n uint256[] memory balances = new uint256[](length);\n uint256[] memory allowances = new uint256[](length);\n for (uint256 i = 0; i != length; i++) {\n (balances[i], allowances[i]) = getBalanceAndAllowance(target, assetData[i]);\n }\n return (balances, allowances);\n }\n\n /// @dev Calls `token.ownerOf(tokenId)`, but returns a null owner instead of reverting on an unowned token.\n /// @param token Address of ERC721 token.\n /// @param tokenId The identifier for the specific NFT.\n /// @return Owner of tokenId or null address if unowned.\n function getERC721TokenOwner(address token, uint256 tokenId)\n public\n view\n returns (address owner)\n {\n assembly {\n // load free memory pointer\n let cdStart := mload(64)\n\n // bytes4(keccak256(ownerOf(uint256))) = 0x6352211e\n mstore(cdStart, 0x6352211e00000000000000000000000000000000000000000000000000000000)\n mstore(add(cdStart, 4), tokenId)\n\n // staticcall `ownerOf(tokenId)`\n // `ownerOf` will revert if tokenId is not owned\n let success := staticcall(\n gas, // forward all gas\n token, // call token contract\n cdStart, // start of calldata\n 36, // length of input is 36 bytes\n cdStart, // write output over input\n 32 // size of output is 32 bytes\n )\n\n // Success implies that tokenId is owned\n // Copy owner from return data if successful\n if success {\n owner := mload(cdStart)\n } \n }\n\n // Owner initialized to address(0), no need to modify if call is unsuccessful\n return owner;\n }\n}\n",
- "2.0.0/multisig/MultiSigWallet.sol": "// solhint-disable\npragma solidity ^0.4.15;\n\n\n/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.\n/// @author Stefan George - <stefan.george@consensys.net>\ncontract MultiSigWallet {\n\n /*\n * Events\n */\n event Confirmation(address indexed sender, uint indexed transactionId);\n event Revocation(address indexed sender, uint indexed transactionId);\n event Submission(uint indexed transactionId);\n event Execution(uint indexed transactionId);\n event ExecutionFailure(uint indexed transactionId);\n event Deposit(address indexed sender, uint value);\n event OwnerAddition(address indexed owner);\n event OwnerRemoval(address indexed owner);\n event RequirementChange(uint required);\n\n /*\n * Constants\n */\n uint constant public MAX_OWNER_COUNT = 50;\n\n /*\n * Storage\n */\n mapping (uint => Transaction) public transactions;\n mapping (uint => mapping (address => bool)) public confirmations;\n mapping (address => bool) public isOwner;\n address[] public owners;\n uint public required;\n uint public transactionCount;\n\n struct Transaction {\n address destination;\n uint value;\n bytes data;\n bool executed;\n }\n\n /*\n * Modifiers\n */\n modifier onlyWallet() {\n require(msg.sender == address(this));\n _;\n }\n\n modifier ownerDoesNotExist(address owner) {\n require(!isOwner[owner]);\n _;\n }\n\n modifier ownerExists(address owner) {\n require(isOwner[owner]);\n _;\n }\n\n modifier transactionExists(uint transactionId) {\n require(transactions[transactionId].destination != 0);\n _;\n }\n\n modifier confirmed(uint transactionId, address owner) {\n require(confirmations[transactionId][owner]);\n _;\n }\n\n modifier notConfirmed(uint transactionId, address owner) {\n require(!confirmations[transactionId][owner]);\n _;\n }\n\n modifier notExecuted(uint transactionId) {\n require(!transactions[transactionId].executed);\n _;\n }\n\n modifier notNull(address _address) {\n require(_address != 0);\n _;\n }\n\n modifier validRequirement(uint ownerCount, uint _required) {\n require(ownerCount <= MAX_OWNER_COUNT\n && _required <= ownerCount\n && _required != 0\n && ownerCount != 0);\n _;\n }\n\n /// @dev Fallback function allows to deposit ether.\n function()\n payable\n {\n if (msg.value > 0)\n Deposit(msg.sender, msg.value);\n }\n\n /*\n * Public functions\n */\n /// @dev Contract constructor sets initial owners and required number of confirmations.\n /// @param _owners List of initial owners.\n /// @param _required Number of required confirmations.\n function MultiSigWallet(address[] _owners, uint _required)\n public\n validRequirement(_owners.length, _required)\n {\n for (uint i=0; i<_owners.length; i++) {\n require(!isOwner[_owners[i]] && _owners[i] != 0);\n isOwner[_owners[i]] = true;\n }\n owners = _owners;\n required = _required;\n }\n\n /// @dev Allows to add a new owner. Transaction has to be sent by wallet.\n /// @param owner Address of new owner.\n function addOwner(address owner)\n public\n onlyWallet\n ownerDoesNotExist(owner)\n notNull(owner)\n validRequirement(owners.length + 1, required)\n {\n isOwner[owner] = true;\n owners.push(owner);\n OwnerAddition(owner);\n }\n\n /// @dev Allows to remove an owner. Transaction has to be sent by wallet.\n /// @param owner Address of owner.\n function removeOwner(address owner)\n public\n onlyWallet\n ownerExists(owner)\n {\n isOwner[owner] = false;\n for (uint i=0; i<owners.length - 1; i++)\n if (owners[i] == owner) {\n owners[i] = owners[owners.length - 1];\n break;\n }\n owners.length -= 1;\n if (required > owners.length)\n changeRequirement(owners.length);\n OwnerRemoval(owner);\n }\n\n /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet.\n /// @param owner Address of owner to be replaced.\n /// @param newOwner Address of new owner.\n function replaceOwner(address owner, address newOwner)\n public\n onlyWallet\n ownerExists(owner)\n ownerDoesNotExist(newOwner)\n {\n for (uint i=0; i<owners.length; i++)\n if (owners[i] == owner) {\n owners[i] = newOwner;\n break;\n }\n isOwner[owner] = false;\n isOwner[newOwner] = true;\n OwnerRemoval(owner);\n OwnerAddition(newOwner);\n }\n\n /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet.\n /// @param _required Number of required confirmations.\n function changeRequirement(uint _required)\n public\n onlyWallet\n validRequirement(owners.length, _required)\n {\n required = _required;\n RequirementChange(_required);\n }\n\n /// @dev Allows an owner to submit and confirm a transaction.\n /// @param destination Transaction target address.\n /// @param value Transaction ether value.\n /// @param data Transaction data payload.\n /// @return Returns transaction ID.\n function submitTransaction(address destination, uint value, bytes data)\n public\n returns (uint transactionId)\n {\n transactionId = addTransaction(destination, value, data);\n confirmTransaction(transactionId);\n }\n\n /// @dev Allows an owner to confirm a transaction.\n /// @param transactionId Transaction ID.\n function confirmTransaction(uint transactionId)\n public\n ownerExists(msg.sender)\n transactionExists(transactionId)\n notConfirmed(transactionId, msg.sender)\n {\n confirmations[transactionId][msg.sender] = true;\n Confirmation(msg.sender, transactionId);\n executeTransaction(transactionId);\n }\n\n /// @dev Allows an owner to revoke a confirmation for a transaction.\n /// @param transactionId Transaction ID.\n function revokeConfirmation(uint transactionId)\n public\n ownerExists(msg.sender)\n confirmed(transactionId, msg.sender)\n notExecuted(transactionId)\n {\n confirmations[transactionId][msg.sender] = false;\n Revocation(msg.sender, transactionId);\n }\n\n /// @dev Allows anyone to execute a confirmed transaction.\n /// @param transactionId Transaction ID.\n function executeTransaction(uint transactionId)\n public\n ownerExists(msg.sender)\n confirmed(transactionId, msg.sender)\n notExecuted(transactionId)\n {\n if (isConfirmed(transactionId)) {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data))\n Execution(transactionId);\n else {\n ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n }\n\n // call has been separated into its own function in order to take advantage\n // of the Solidity's code generator to produce a loop that copies tx.data into memory.\n function external_call(address destination, uint value, uint dataLength, bytes data) internal returns (bool) {\n bool result;\n assembly {\n let x := mload(0x40) // \"Allocate\" memory for output (0x40 is where \"free memory\" pointer is stored by convention)\n let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that\n result := call(\n sub(gas, 34710), // 34710 is the value that solidity is currently emitting\n // It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) +\n // callNewAccountGas (25000, in case the destination address does not exist and needs creating)\n destination,\n value,\n d,\n dataLength, // Size of the input (in bytes) - this is what fixes the padding problem\n x,\n 0 // Output is ignored, therefore the output size is zero\n )\n }\n return result;\n }\n\n /// @dev Returns the confirmation status of a transaction.\n /// @param transactionId Transaction ID.\n /// @return Confirmation status.\n function isConfirmed(uint transactionId)\n public\n constant\n returns (bool)\n {\n uint count = 0;\n for (uint i=0; i<owners.length; i++) {\n if (confirmations[transactionId][owners[i]])\n count += 1;\n if (count == required)\n return true;\n }\n }\n\n /*\n * Internal functions\n */\n /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet.\n /// @param destination Transaction target address.\n /// @param value Transaction ether value.\n /// @param data Transaction data payload.\n /// @return Returns transaction ID.\n function addTransaction(address destination, uint value, bytes data)\n internal\n notNull(destination)\n returns (uint transactionId)\n {\n transactionId = transactionCount;\n transactions[transactionId] = Transaction({\n destination: destination,\n value: value,\n data: data,\n executed: false\n });\n transactionCount += 1;\n Submission(transactionId);\n }\n\n /*\n * Web3 call functions\n */\n /// @dev Returns number of confirmations of a transaction.\n /// @param transactionId Transaction ID.\n /// @return Number of confirmations.\n function getConfirmationCount(uint transactionId)\n public\n constant\n returns (uint count)\n {\n for (uint i=0; i<owners.length; i++)\n if (confirmations[transactionId][owners[i]])\n count += 1;\n }\n\n /// @dev Returns total number of transactions after filers are applied.\n /// @param pending Include pending transactions.\n /// @param executed Include executed transactions.\n /// @return Total number of transactions after filters are applied.\n function getTransactionCount(bool pending, bool executed)\n public\n constant\n returns (uint count)\n {\n for (uint i=0; i<transactionCount; i++)\n if ( pending && !transactions[i].executed\n || executed && transactions[i].executed)\n count += 1;\n }\n\n /// @dev Returns list of owners.\n /// @return List of owner addresses.\n function getOwners()\n public\n constant\n returns (address[])\n {\n return owners;\n }\n\n /// @dev Returns array with owner addresses, which confirmed transaction.\n /// @param transactionId Transaction ID.\n /// @return Returns array of owner addresses.\n function getConfirmations(uint transactionId)\n public\n constant\n returns (address[] _confirmations)\n {\n address[] memory confirmationsTemp = new address[](owners.length);\n uint count = 0;\n uint i;\n for (i=0; i<owners.length; i++)\n if (confirmations[transactionId][owners[i]]) {\n confirmationsTemp[count] = owners[i];\n count += 1;\n }\n _confirmations = new address[](count);\n for (i=0; i<count; i++)\n _confirmations[i] = confirmationsTemp[i];\n }\n\n /// @dev Returns list of transaction IDs in defined range.\n /// @param from Index start position of transaction array.\n /// @param to Index end position of transaction array.\n /// @param pending Include pending transactions.\n /// @param executed Include executed transactions.\n /// @return Returns array of transaction IDs.\n function getTransactionIds(uint from, uint to, bool pending, bool executed)\n public\n constant\n returns (uint[] _transactionIds)\n {\n uint[] memory transactionIdsTemp = new uint[](transactionCount);\n uint count = 0;\n uint i;\n for (i=0; i<transactionCount; i++)\n if ( pending && !transactions[i].executed\n || executed && transactions[i].executed)\n {\n transactionIdsTemp[count] = i;\n count += 1;\n }\n _transactionIds = new uint[](to - from);\n for (i=from; i<to; i++)\n _transactionIds[i - from] = transactionIdsTemp[i];\n }\n}",
- "2.0.0/multisig/MultiSigWalletWithTimeLock.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MultiSigWallet.sol\";\n\n\n/// @title Multisignature wallet with time lock- Allows multiple parties to execute a transaction after a time lock has passed.\n/// @author Amir Bandeali - <amir@0xProject.com>\n// solhint-disable not-rely-on-time\ncontract MultiSigWalletWithTimeLock is\n MultiSigWallet\n{\n event ConfirmationTimeSet(uint256 indexed transactionId, uint256 confirmationTime);\n event TimeLockChange(uint256 secondsTimeLocked);\n\n uint256 public secondsTimeLocked;\n\n mapping (uint256 => uint256) public confirmationTimes;\n\n modifier notFullyConfirmed(uint256 transactionId) {\n require(\n !isConfirmed(transactionId),\n \"TX_FULLY_CONFIRMED\"\n );\n _;\n }\n\n modifier fullyConfirmed(uint256 transactionId) {\n require(\n isConfirmed(transactionId),\n \"TX_NOT_FULLY_CONFIRMED\"\n );\n _;\n }\n\n modifier pastTimeLock(uint256 transactionId) {\n require(\n block.timestamp >= confirmationTimes[transactionId] + secondsTimeLocked,\n \"TIME_LOCK_INCOMPLETE\"\n );\n _;\n }\n\n /// @dev Contract constructor sets initial owners, required number of confirmations, and time lock.\n /// @param _owners List of initial owners.\n /// @param _required Number of required confirmations.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n constructor (\n address[] _owners,\n uint256 _required,\n uint256 _secondsTimeLocked\n )\n public\n MultiSigWallet(_owners, _required)\n {\n secondsTimeLocked = _secondsTimeLocked;\n }\n\n /// @dev Changes the duration of the time lock for transactions.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n function changeTimeLock(uint256 _secondsTimeLocked)\n public\n onlyWallet\n {\n secondsTimeLocked = _secondsTimeLocked;\n emit TimeLockChange(_secondsTimeLocked);\n }\n\n /// @dev Allows an owner to confirm a transaction.\n /// @param transactionId Transaction ID.\n function confirmTransaction(uint256 transactionId)\n public\n ownerExists(msg.sender)\n transactionExists(transactionId)\n notConfirmed(transactionId, msg.sender)\n notFullyConfirmed(transactionId)\n {\n confirmations[transactionId][msg.sender] = true;\n emit Confirmation(msg.sender, transactionId);\n if (isConfirmed(transactionId)) {\n setConfirmationTime(transactionId, block.timestamp);\n }\n }\n\n /// @dev Allows anyone to execute a confirmed transaction.\n /// @param transactionId Transaction ID.\n function executeTransaction(uint256 transactionId)\n public\n notExecuted(transactionId)\n fullyConfirmed(transactionId)\n pastTimeLock(transactionId)\n {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) {\n emit Execution(transactionId);\n } else {\n emit ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n\n /// @dev Sets the time of when a submission first passed.\n function setConfirmationTime(uint256 transactionId, uint256 confirmationTime)\n internal\n {\n confirmationTimes[transactionId] = confirmationTime;\n emit ConfirmationTimeSet(transactionId, confirmationTime);\n }\n}\n",
- "2.0.0/protocol/AssetProxy/ERC20Proxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MixinAuthorizable.sol\";\n\n\ncontract ERC20Proxy is\n MixinAuthorizable\n{\n // Id of this proxy.\n bytes4 constant internal PROXY_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n \n // solhint-disable-next-line payable-fallback\n function () \n external\n {\n assembly {\n // The first 4 bytes of calldata holds the function selector\n let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)\n\n // `transferFrom` will be called with the following parameters:\n // assetData Encoded byte array.\n // from Address to transfer asset from.\n // to Address to transfer asset to.\n // amount Amount of asset to transfer.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {\n\n // To lookup a value in a mapping, we load from the storage location keccak256(k, p),\n // where k is the key left padded to 32 bytes and p is the storage slot\n let start := mload(64)\n mstore(start, and(caller, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(start, 32), authorized_slot)\n\n // Revert if authorized[msg.sender] == false\n if iszero(sload(keccak256(start, 64))) {\n // Revert with `Error(\"SENDER_NOT_AUTHORIZED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // `transferFrom`.\n // The function is marked `external`, so no abi decodeding is done for\n // us. Instead, we expect the `calldata` memory to contain the\n // following:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n //\n // (*): offset is computed from start of function parameters, so offset\n // by an additional 4 bytes in the calldata.\n //\n // (**): see table below to compute length of assetData Contents\n //\n // WARNING: The ABIv2 specification allows additional padding between\n // the Params and Data section. This will result in a larger\n // offset to assetData.\n\n // Asset data itself is encoded as follows:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 1 * 32 | function parameters: |\n // | | 4 | 12 + 20 | 1. token address |\n\n // We construct calldata for the `token.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 4 | | 1. from |\n // | | 36 | | 2. to |\n // | | 68 | | 3. amount |\n\n /////// Read token address from calldata ///////\n // * The token address is stored in `assetData`.\n //\n // * The \"offset to assetData\" is stored at offset 4 in the calldata (table 1).\n // [assetDataOffsetFromParams = calldataload(4)]\n //\n // * Notes that the \"offset to assetData\" is relative to the \"Params\" area of calldata;\n // add 4 bytes to account for the length of the \"Header\" area (table 1).\n // [assetDataOffsetFromHeader = assetDataOffsetFromParams + 4]\n //\n // * The \"token address\" is offset 32+4=36 bytes into \"assetData\" (tables 1 & 2).\n // [tokenOffset = assetDataOffsetFromHeader + 36 = calldataload(4) + 4 + 36]\n let token := calldataload(add(calldataload(4), 40))\n \n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFrom` selector.\n // Any trailing data in transferFromSelector will be\n // overwritten in the next `mstore` call.\n mstore(0, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // We copy the fields `from`, `to` and `amount` in bulk\n // from our own calldata to the new calldata.\n calldatacopy(4, 36, 96)\n\n /////// Call `token.transferFrom` using the calldata ///////\n let success := call(\n gas, // forward all gas\n token, // call address of token contract\n 0, // don't send any ETH\n 0, // pointer to start of input\n 100, // length of input\n 0, // write output over input\n 32 // output size should be 32 bytes\n )\n\n /////// Check return data. ///////\n // If there is no return data, we assume the token incorrectly\n // does not return a bool. In this case we expect it to revert\n // on failure, which was handled above.\n // If the token does return data, we require that it is a single\n // nonzero 32 bytes value.\n // So the transfer succeeded if the call succeeded and either\n // returned nothing, or returned a non-zero 32 byte value. \n success := and(success, or(\n iszero(returndatasize),\n and(\n eq(returndatasize, 32),\n gt(mload(0), 0)\n )\n ))\n if success {\n return(0, 0)\n }\n \n // Revert with `Error(\"TRANSFER_FAILED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // Revert if undefined function is called\n revert(0, 0)\n }\n }\n\n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4)\n {\n return PROXY_ID;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/ERC721Proxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MixinAuthorizable.sol\";\n\n\ncontract ERC721Proxy is\n MixinAuthorizable\n{\n // Id of this proxy.\n bytes4 constant internal PROXY_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n\n // solhint-disable-next-line payable-fallback\n function () \n external\n {\n assembly {\n // The first 4 bytes of calldata holds the function selector\n let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)\n\n // `transferFrom` will be called with the following parameters:\n // assetData Encoded byte array.\n // from Address to transfer asset from.\n // to Address to transfer asset to.\n // amount Amount of asset to transfer.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {\n\n // To lookup a value in a mapping, we load from the storage location keccak256(k, p),\n // where k is the key left padded to 32 bytes and p is the storage slot\n let start := mload(64)\n mstore(start, and(caller, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(start, 32), authorized_slot)\n\n // Revert if authorized[msg.sender] == false\n if iszero(sload(keccak256(start, 64))) {\n // Revert with `Error(\"SENDER_NOT_AUTHORIZED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // `transferFrom`.\n // The function is marked `external`, so no abi decodeding is done for\n // us. Instead, we expect the `calldata` memory to contain the\n // following:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n //\n // (*): offset is computed from start of function parameters, so offset\n // by an additional 4 bytes in the calldata.\n //\n // (**): see table below to compute length of assetData Contents\n //\n // WARNING: The ABIv2 specification allows additional padding between\n // the Params and Data section. This will result in a larger\n // offset to assetData.\n\n // Asset data itself is encoded as follows:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 2 * 32 | function parameters: |\n // | | 4 | 12 + 20 | 1. token address |\n // | | 36 | | 2. tokenId |\n \n // We construct calldata for the `token.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n // \n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 4 | | 1. from |\n // | | 36 | | 2. to |\n // | | 68 | | 3. tokenId |\n\n // There exists only 1 of each token.\n // require(amount == 1, \"INVALID_AMOUNT\")\n if sub(calldataload(100), 1) {\n // Revert with `Error(\"INVALID_AMOUNT\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000e494e56414c49445f414d4f554e540000000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFrom` selector.\n // Any trailing data in transferFromSelector will be\n // overwritten in the next `mstore` call.\n mstore(0, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // We copy the fields `from` and `to` in bulk\n // from our own calldata to the new calldata.\n calldatacopy(4, 36, 64)\n\n // Copy `tokenId` field from our own calldata to the new calldata.\n let assetDataOffset := calldataload(4)\n calldatacopy(68, add(assetDataOffset, 72), 32)\n\n /////// Call `token.transferFrom` using the calldata ///////\n let token := calldataload(add(assetDataOffset, 40))\n let success := call(\n gas, // forward all gas\n token, // call address of token contract\n 0, // don't send any ETH\n 0, // pointer to start of input\n 100, // length of input\n 0, // write output to null\n 0 // output size is 0 bytes\n )\n if success {\n return(0, 0)\n }\n \n // Revert with `Error(\"TRANSFER_FAILED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // Revert if undefined function is called\n revert(0, 0)\n }\n }\n\n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4)\n {\n return PROXY_ID;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/MixinAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"./mixins/MAuthorizable.sol\";\n\n\ncontract MixinAuthorizable is\n Ownable,\n MAuthorizable\n{\n /// @dev Only authorized addresses can invoke functions with this modifier.\n modifier onlyAuthorized {\n require(\n authorized[msg.sender],\n \"SENDER_NOT_AUTHORIZED\"\n );\n _;\n }\n\n mapping (address => bool) public authorized;\n address[] public authorities;\n\n /// @dev Authorizes an address.\n /// @param target Address to authorize.\n function addAuthorizedAddress(address target)\n external\n onlyOwner\n {\n require(\n !authorized[target],\n \"TARGET_ALREADY_AUTHORIZED\"\n );\n\n authorized[target] = true;\n authorities.push(target);\n emit AuthorizedAddressAdded(target, msg.sender);\n }\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n function removeAuthorizedAddress(address target)\n external\n onlyOwner\n {\n require(\n authorized[target],\n \"TARGET_NOT_AUTHORIZED\"\n );\n\n delete authorized[target];\n for (uint256 i = 0; i < authorities.length; i++) {\n if (authorities[i] == target) {\n authorities[i] = authorities[authorities.length - 1];\n authorities.length -= 1;\n break;\n }\n }\n emit AuthorizedAddressRemoved(target, msg.sender);\n }\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n /// @param index Index of target in authorities array.\n function removeAuthorizedAddressAtIndex(\n address target,\n uint256 index\n )\n external\n onlyOwner\n {\n require(\n authorized[target],\n \"TARGET_NOT_AUTHORIZED\"\n );\n require(\n index < authorities.length,\n \"INDEX_OUT_OF_BOUNDS\"\n );\n require(\n authorities[index] == target,\n \"AUTHORIZED_ADDRESS_MISMATCH\"\n );\n\n delete authorized[target];\n authorities[index] = authorities[authorities.length - 1];\n authorities.length -= 1;\n emit AuthorizedAddressRemoved(target, msg.sender);\n }\n\n /// @dev Gets all authorized addresses.\n /// @return Array of authorized addresses.\n function getAuthorizedAddresses()\n external\n view\n returns (address[] memory)\n {\n return authorities;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IAuthorizable.sol\";\n\n\ncontract IAssetProxy is\n IAuthorizable\n{\n /// @dev Transfers assets. Either succeeds or throws.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param from Address to transfer asset from.\n /// @param to Address to transfer asset to.\n /// @param amount Amount of asset to transfer.\n function transferFrom(\n bytes assetData,\n address from,\n address to,\n uint256 amount\n )\n external;\n \n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4);\n}\n",
- "2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/Ownable/IOwnable.sol\";\n\n\ncontract IAuthorizable is\n IOwnable\n{\n /// @dev Authorizes an address.\n /// @param target Address to authorize.\n function addAuthorizedAddress(address target)\n external;\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n function removeAuthorizedAddress(address target)\n external;\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n /// @param index Index of target in authorities array.\n function removeAuthorizedAddressAtIndex(\n address target,\n uint256 index\n )\n external;\n \n /// @dev Gets all authorized addresses.\n /// @return Array of authorized addresses.\n function getAuthorizedAddresses()\n external\n view\n returns (address[] memory);\n}\n",
- "2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAuthorizable.sol\";\n\n\ncontract MAuthorizable is\n IAuthorizable\n{\n // Event logged when a new address is authorized.\n event AuthorizedAddressAdded(\n address indexed target,\n address indexed caller\n );\n\n // Event logged when a currently authorized address is unauthorized.\n event AuthorizedAddressRemoved(\n address indexed target,\n address indexed caller\n );\n\n /// @dev Only authorized addresses can invoke functions with this modifier.\n modifier onlyAuthorized { revert(); _; }\n}\n",
- "2.0.0/protocol/AssetProxyOwner/AssetProxyOwner.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../multisig/MultiSigWalletWithTimeLock.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\n\n\ncontract AssetProxyOwner is\n MultiSigWalletWithTimeLock\n{\n using LibBytes for bytes;\n\n event AssetProxyRegistration(address assetProxyContract, bool isRegistered);\n\n // Mapping of AssetProxy contract address =>\n // if this contract is allowed to call the AssetProxy's `removeAuthorizedAddressAtIndex` method without a time lock.\n mapping (address => bool) public isAssetProxyRegistered;\n\n bytes4 constant internal REMOVE_AUTHORIZED_ADDRESS_AT_INDEX_SELECTOR = bytes4(keccak256(\"removeAuthorizedAddressAtIndex(address,uint256)\"));\n\n /// @dev Function will revert if the transaction does not call `removeAuthorizedAddressAtIndex`\n /// on an approved AssetProxy contract.\n modifier validRemoveAuthorizedAddressAtIndexTx(uint256 transactionId) {\n Transaction storage txn = transactions[transactionId];\n require(\n isAssetProxyRegistered[txn.destination],\n \"UNREGISTERED_ASSET_PROXY\"\n );\n require(\n txn.data.readBytes4(0) == REMOVE_AUTHORIZED_ADDRESS_AT_INDEX_SELECTOR,\n \"INVALID_FUNCTION_SELECTOR\"\n );\n _;\n }\n\n /// @dev Contract constructor sets initial owners, required number of confirmations,\n /// time lock, and list of AssetProxy addresses.\n /// @param _owners List of initial owners.\n /// @param _assetProxyContracts Array of AssetProxy contract addresses.\n /// @param _required Number of required confirmations.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n constructor (\n address[] memory _owners,\n address[] memory _assetProxyContracts,\n uint256 _required,\n uint256 _secondsTimeLocked\n )\n public\n MultiSigWalletWithTimeLock(_owners, _required, _secondsTimeLocked)\n {\n for (uint256 i = 0; i < _assetProxyContracts.length; i++) {\n address assetProxy = _assetProxyContracts[i];\n require(\n assetProxy != address(0),\n \"INVALID_ASSET_PROXY\"\n );\n isAssetProxyRegistered[assetProxy] = true;\n }\n }\n\n /// @dev Registers or deregisters an AssetProxy to be able to execute\n /// `removeAuthorizedAddressAtIndex` without a timelock.\n /// @param assetProxyContract Address of AssetProxy contract.\n /// @param isRegistered Status of approval for AssetProxy contract.\n function registerAssetProxy(address assetProxyContract, bool isRegistered)\n public\n onlyWallet\n notNull(assetProxyContract)\n {\n isAssetProxyRegistered[assetProxyContract] = isRegistered;\n emit AssetProxyRegistration(assetProxyContract, isRegistered);\n }\n\n /// @dev Allows execution of `removeAuthorizedAddressAtIndex` without time lock.\n /// @param transactionId Transaction ID.\n function executeRemoveAuthorizedAddressAtIndex(uint256 transactionId)\n public\n notExecuted(transactionId)\n fullyConfirmed(transactionId)\n validRemoveAuthorizedAddressAtIndexTx(transactionId)\n {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) {\n emit Execution(transactionId);\n } else {\n emit ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/Exchange.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./MixinExchangeCore.sol\";\nimport \"./MixinSignatureValidator.sol\";\nimport \"./MixinWrapperFunctions.sol\";\nimport \"./MixinAssetProxyDispatcher.sol\";\nimport \"./MixinTransactions.sol\";\nimport \"./MixinMatchOrders.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract Exchange is\n MixinExchangeCore,\n MixinMatchOrders,\n MixinSignatureValidator,\n MixinTransactions,\n MixinAssetProxyDispatcher,\n MixinWrapperFunctions\n{\n string constant public VERSION = \"2.0.1-alpha\";\n\n // Mixins are instantiated in the order they are inherited\n constructor (bytes memory _zrxAssetData)\n public\n LibConstants(_zrxAssetData) // @TODO: Remove when we deploy.\n MixinExchangeCore()\n MixinMatchOrders()\n MixinSignatureValidator()\n MixinTransactions()\n MixinAssetProxyDispatcher()\n MixinWrapperFunctions()\n {}\n}\n",
- "2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\nimport \"../AssetProxy/interfaces/IAssetProxy.sol\";\n\n\ncontract MixinAssetProxyDispatcher is\n Ownable,\n MAssetProxyDispatcher\n{\n // Mapping from Asset Proxy Id's to their respective Asset Proxy\n mapping (bytes4 => IAssetProxy) public assetProxies;\n\n /// @dev Registers an asset proxy to its asset proxy id.\n /// Once an asset proxy is registered, it cannot be unregistered.\n /// @param assetProxy Address of new asset proxy to register.\n function registerAssetProxy(address assetProxy)\n external\n onlyOwner\n {\n IAssetProxy assetProxyContract = IAssetProxy(assetProxy);\n\n // Ensure that no asset proxy exists with current id.\n bytes4 assetProxyId = assetProxyContract.getProxyId();\n address currentAssetProxy = assetProxies[assetProxyId];\n require(\n currentAssetProxy == address(0),\n \"ASSET_PROXY_ALREADY_EXISTS\"\n );\n\n // Add asset proxy and log registration.\n assetProxies[assetProxyId] = assetProxyContract;\n emit AssetProxyRegistered(\n assetProxyId,\n assetProxy\n );\n }\n\n /// @dev Gets an asset proxy.\n /// @param assetProxyId Id of the asset proxy.\n /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered.\n function getAssetProxy(bytes4 assetProxyId)\n external\n view\n returns (address)\n {\n return assetProxies[assetProxyId];\n }\n\n /// @dev Forwards arguments to assetProxy and calls `transferFrom`. Either succeeds or throws.\n /// @param assetData Byte array encoded for the asset.\n /// @param from Address to transfer token from.\n /// @param to Address to transfer token to.\n /// @param amount Amount of token to transfer.\n function dispatchTransferFrom(\n bytes memory assetData,\n address from,\n address to,\n uint256 amount\n )\n internal\n {\n // Do nothing if no amount should be transferred.\n if (amount > 0 && from != to) {\n // Ensure assetData length is valid\n require(\n assetData.length > 3,\n \"LENGTH_GREATER_THAN_3_REQUIRED\"\n );\n \n // Lookup assetProxy. We do not use `LibBytes.readBytes4` for gas efficiency reasons.\n bytes4 assetProxyId;\n assembly {\n assetProxyId := and(mload(\n add(assetData, 32)),\n 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000\n )\n }\n address assetProxy = assetProxies[assetProxyId];\n\n // Ensure that assetProxy exists\n require(\n assetProxy != address(0),\n \"ASSET_PROXY_DOES_NOT_EXIST\"\n );\n \n // We construct calldata for the `assetProxy.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n // \n // | Area | Offset | Length | Contents |\n // | -------- |--------|---------|-------------------------------------------- |\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n\n assembly {\n /////// Setup State ///////\n // `cdStart` is the start of the calldata for `assetProxy.transferFrom` (equal to free memory ptr).\n let cdStart := mload(64)\n // `dataAreaLength` is the total number of words needed to store `assetData`\n // As-per the ABI spec, this value is padded up to the nearest multiple of 32,\n // and includes 32-bytes for length.\n let dataAreaLength := and(add(mload(assetData), 63), 0xFFFFFFFFFFFE0)\n // `cdEnd` is the end of the calldata for `assetProxy.transferFrom`.\n let cdEnd := add(cdStart, add(132, dataAreaLength))\n\n \n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFromSelector`.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n mstore(cdStart, 0xa85e59e400000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // Each parameter is padded to 32-bytes. The entire Params Area is 128 bytes.\n // Notes:\n // 1. The offset to `assetData` is the length of the Params Area (128 bytes).\n // 2. A 20-byte mask is applied to addresses to zero-out the unused bytes.\n mstore(add(cdStart, 4), 128)\n mstore(add(cdStart, 36), and(from, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(cdStart, 68), and(to, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(cdStart, 100), amount)\n \n /////// Setup Data Area ///////\n // This area holds `assetData`.\n let dataArea := add(cdStart, 132)\n // solhint-disable-next-line no-empty-blocks\n for {} lt(dataArea, cdEnd) {} {\n mstore(dataArea, mload(assetData))\n dataArea := add(dataArea, 32)\n assetData := add(assetData, 32)\n }\n\n /////// Call `assetProxy.transferFrom` using the constructed calldata ///////\n let success := call(\n gas, // forward all gas\n assetProxy, // call address of asset proxy\n 0, // don't send any ETH\n cdStart, // pointer to start of input\n sub(cdEnd, cdStart), // length of input \n cdStart, // write output over input\n 512 // reserve 512 bytes for output\n )\n if iszero(success) {\n revert(cdStart, returndatasize())\n }\n }\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\n\n\ncontract MixinExchangeCore is\n ReentrancyGuard,\n LibConstants,\n LibMath,\n LibOrder,\n LibFillResults,\n MAssetProxyDispatcher,\n MExchangeCore,\n MSignatureValidator,\n MTransactions\n{\n // Mapping of orderHash => amount of takerAsset already bought by maker\n mapping (bytes32 => uint256) public filled;\n\n // Mapping of orderHash => cancelled\n mapping (bytes32 => bool) public cancelled;\n\n // Mapping of makerAddress => senderAddress => lowest salt an order can have in order to be fillable\n // Orders with specified senderAddress and with a salt less than their epoch are considered cancelled\n mapping (address => mapping (address => uint256)) public orderEpoch;\n\n /// @dev Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch\n /// and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress).\n /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled.\n function cancelOrdersUpTo(uint256 targetOrderEpoch)\n external\n nonReentrant\n {\n address makerAddress = getCurrentContextAddress();\n // If this function is called via `executeTransaction`, we only update the orderEpoch for the makerAddress/msg.sender combination.\n // This allows external filter contracts to add rules to how orders are cancelled via this function.\n address senderAddress = makerAddress == msg.sender ? address(0) : msg.sender;\n\n // orderEpoch is initialized to 0, so to cancelUpTo we need salt + 1\n uint256 newOrderEpoch = targetOrderEpoch + 1; \n uint256 oldOrderEpoch = orderEpoch[makerAddress][senderAddress];\n\n // Ensure orderEpoch is monotonically increasing\n require(\n newOrderEpoch > oldOrderEpoch, \n \"INVALID_NEW_ORDER_EPOCH\"\n );\n\n // Update orderEpoch\n orderEpoch[makerAddress][senderAddress] = newOrderEpoch;\n emit CancelUpTo(\n makerAddress,\n senderAddress,\n newOrderEpoch\n );\n }\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrder(\n Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n nonReentrant\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n return fillResults;\n }\n\n /// @dev After calling, the order can not be filled anymore.\n /// Throws if order is invalid or sender does not have permission to cancel.\n /// @param order Order to cancel. Order must be OrderStatus.FILLABLE.\n function cancelOrder(Order memory order)\n public\n nonReentrant\n {\n cancelOrderInternal(order);\n }\n\n /// @dev Gets information about an order: status, hash, and amount filled.\n /// @param order Order to gather information on.\n /// @return OrderInfo Information about the order and its state.\n /// See LibOrder.OrderInfo for a complete description.\n function getOrderInfo(Order memory order)\n public\n view\n returns (OrderInfo memory orderInfo)\n {\n // Compute the order hash\n orderInfo.orderHash = getOrderHash(order);\n\n // Fetch filled amount\n orderInfo.orderTakerAssetFilledAmount = filled[orderInfo.orderHash];\n\n // If order.makerAssetAmount is zero, we also reject the order.\n // While the Exchange contract handles them correctly, they create\n // edge cases in the supporting infrastructure because they have\n // an 'infinite' price when computed by a simple division.\n if (order.makerAssetAmount == 0) {\n orderInfo.orderStatus = uint8(OrderStatus.INVALID_MAKER_ASSET_AMOUNT);\n return orderInfo;\n }\n\n // If order.takerAssetAmount is zero, then the order will always\n // be considered filled because 0 == takerAssetAmount == orderTakerAssetFilledAmount\n // Instead of distinguishing between unfilled and filled zero taker\n // amount orders, we choose not to support them.\n if (order.takerAssetAmount == 0) {\n orderInfo.orderStatus = uint8(OrderStatus.INVALID_TAKER_ASSET_AMOUNT);\n return orderInfo;\n }\n\n // Validate order availability\n if (orderInfo.orderTakerAssetFilledAmount >= order.takerAssetAmount) {\n orderInfo.orderStatus = uint8(OrderStatus.FULLY_FILLED);\n return orderInfo;\n }\n\n // Validate order expiration\n // solhint-disable-next-line not-rely-on-time\n if (block.timestamp >= order.expirationTimeSeconds) {\n orderInfo.orderStatus = uint8(OrderStatus.EXPIRED);\n return orderInfo;\n }\n\n // Check if order has been cancelled\n if (cancelled[orderInfo.orderHash]) {\n orderInfo.orderStatus = uint8(OrderStatus.CANCELLED);\n return orderInfo;\n }\n if (orderEpoch[order.makerAddress][order.senderAddress] > order.salt) {\n orderInfo.orderStatus = uint8(OrderStatus.CANCELLED);\n return orderInfo;\n }\n\n // All other statuses are ruled out: order is Fillable\n orderInfo.orderStatus = uint8(OrderStatus.FILLABLE);\n return orderInfo;\n }\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderInternal(\n Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n // Fetch order info\n OrderInfo memory orderInfo = getOrderInfo(order);\n\n // Fetch taker address\n address takerAddress = getCurrentContextAddress();\n \n // Assert that the order is fillable by taker\n assertFillableOrder(\n order,\n orderInfo,\n takerAddress,\n signature\n );\n \n // Get amount of takerAsset to fill\n uint256 remainingTakerAssetAmount = safeSub(order.takerAssetAmount, orderInfo.orderTakerAssetFilledAmount);\n uint256 takerAssetFilledAmount = min256(takerAssetFillAmount, remainingTakerAssetAmount);\n\n // Validate context\n assertValidFill(\n order,\n orderInfo,\n takerAssetFillAmount,\n takerAssetFilledAmount,\n fillResults.makerAssetFilledAmount\n );\n\n // Compute proportional fill amounts\n fillResults = calculateFillResults(order, takerAssetFilledAmount);\n\n // Update exchange internal state\n updateFilledState(\n order,\n takerAddress,\n orderInfo.orderHash,\n orderInfo.orderTakerAssetFilledAmount,\n fillResults\n );\n \n // Settle order\n settleOrder(\n order,\n takerAddress,\n fillResults\n );\n\n return fillResults;\n }\n\n /// @dev After calling, the order can not be filled anymore.\n /// Throws if order is invalid or sender does not have permission to cancel.\n /// @param order Order to cancel. Order must be OrderStatus.FILLABLE.\n function cancelOrderInternal(Order memory order)\n internal\n {\n // Fetch current order status\n OrderInfo memory orderInfo = getOrderInfo(order);\n\n // Validate context\n assertValidCancel(order, orderInfo);\n\n // Perform cancel\n updateCancelledState(order, orderInfo.orderHash);\n }\n\n /// @dev Updates state with results of a fill order.\n /// @param order that was filled.\n /// @param takerAddress Address of taker who filled the order.\n /// @param orderTakerAssetFilledAmount Amount of order already filled.\n function updateFilledState(\n Order memory order,\n address takerAddress,\n bytes32 orderHash,\n uint256 orderTakerAssetFilledAmount,\n FillResults memory fillResults\n )\n internal\n {\n // Update state\n filled[orderHash] = safeAdd(orderTakerAssetFilledAmount, fillResults.takerAssetFilledAmount);\n\n // Log order\n emit Fill(\n order.makerAddress,\n order.feeRecipientAddress,\n takerAddress,\n msg.sender,\n fillResults.makerAssetFilledAmount,\n fillResults.takerAssetFilledAmount,\n fillResults.makerFeePaid,\n fillResults.takerFeePaid,\n orderHash,\n order.makerAssetData,\n order.takerAssetData\n );\n }\n\n /// @dev Updates state with results of cancelling an order.\n /// State is only updated if the order is currently fillable.\n /// Otherwise, updating state would have no effect.\n /// @param order that was cancelled.\n /// @param orderHash Hash of order that was cancelled.\n function updateCancelledState(\n Order memory order,\n bytes32 orderHash\n )\n internal\n {\n // Perform cancel\n cancelled[orderHash] = true;\n\n // Log cancel\n emit Cancel(\n order.makerAddress,\n order.feeRecipientAddress,\n msg.sender,\n orderHash,\n order.makerAssetData,\n order.takerAssetData\n );\n }\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAddress Address of order taker.\n /// @param signature Proof that the orders was created by its maker.\n function assertFillableOrder(\n Order memory order,\n OrderInfo memory orderInfo,\n address takerAddress,\n bytes memory signature\n )\n internal\n view\n {\n // An order can only be filled if its status is FILLABLE.\n require(\n orderInfo.orderStatus == uint8(OrderStatus.FILLABLE),\n \"ORDER_UNFILLABLE\"\n );\n \n // Validate sender is allowed to fill this order\n if (order.senderAddress != address(0)) {\n require(\n order.senderAddress == msg.sender,\n \"INVALID_SENDER\"\n );\n }\n \n // Validate taker is allowed to fill this order\n if (order.takerAddress != address(0)) {\n require(\n order.takerAddress == takerAddress,\n \"INVALID_TAKER\"\n );\n }\n \n // Validate Maker signature (check only if first time seen)\n if (orderInfo.orderTakerAssetFilledAmount == 0) {\n require(\n isValidSignature(\n orderInfo.orderHash,\n order.makerAddress,\n signature\n ),\n \"INVALID_ORDER_SIGNATURE\"\n );\n }\n }\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAssetFillAmount Desired amount of order to fill by taker.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @param makerAssetFilledAmount Amount of makerAsset that will be transfered.\n function assertValidFill(\n Order memory order,\n OrderInfo memory orderInfo,\n uint256 takerAssetFillAmount, // TODO: use FillResults\n uint256 takerAssetFilledAmount,\n uint256 makerAssetFilledAmount\n )\n internal\n view\n {\n // Revert if fill amount is invalid\n // TODO: reconsider necessity for v2.1\n require(\n takerAssetFillAmount != 0,\n \"INVALID_TAKER_AMOUNT\"\n );\n \n // Make sure taker does not pay more than desired amount\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n takerAssetFilledAmount <= takerAssetFillAmount,\n \"TAKER_OVERPAY\"\n );\n \n // Make sure order is not overfilled\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n safeAdd(orderInfo.orderTakerAssetFilledAmount, takerAssetFilledAmount) <= order.takerAssetAmount,\n \"ORDER_OVERFILL\"\n );\n \n // Make sure order is filled at acceptable price.\n // The order has an implied price from the makers perspective:\n // order price = order.makerAssetAmount / order.takerAssetAmount\n // i.e. the number of makerAsset maker is paying per takerAsset. The\n // maker is guaranteed to get this price or a better (lower) one. The\n // actual price maker is getting in this fill is:\n // fill price = makerAssetFilledAmount / takerAssetFilledAmount\n // We need `fill price <= order price` for the fill to be fair to maker.\n // This amounts to:\n // makerAssetFilledAmount order.makerAssetAmount\n // ------------------------ <= -----------------------\n // takerAssetFilledAmount order.takerAssetAmount\n // or, equivalently:\n // makerAssetFilledAmount * order.takerAssetAmount <=\n // order.makerAssetAmount * takerAssetFilledAmount\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n safeMul(makerAssetFilledAmount, order.takerAssetAmount)\n <= \n safeMul(order.makerAssetAmount, takerAssetFilledAmount),\n \"INVALID_FILL_PRICE\"\n );\n }\n\n /// @dev Validates context for cancelOrder. Succeeds or throws.\n /// @param order to be cancelled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n function assertValidCancel(\n Order memory order,\n OrderInfo memory orderInfo\n )\n internal\n view\n {\n // Ensure order is valid\n // An order can only be cancelled if its status is FILLABLE.\n require(\n orderInfo.orderStatus == uint8(OrderStatus.FILLABLE),\n \"ORDER_UNFILLABLE\"\n );\n\n // Validate sender is allowed to cancel this order\n if (order.senderAddress != address(0)) {\n require(\n order.senderAddress == msg.sender,\n \"INVALID_SENDER\"\n );\n }\n\n // Validate transaction signed by maker\n address makerAddress = getCurrentContextAddress();\n require(\n order.makerAddress == makerAddress,\n \"INVALID_MAKER\"\n );\n }\n\n /// @dev Calculates amounts filled and fees paid by maker and taker.\n /// @param order to be filled.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function calculateFillResults(\n Order memory order,\n uint256 takerAssetFilledAmount\n )\n internal\n pure\n returns (FillResults memory fillResults)\n {\n // Compute proportional transfer amounts\n fillResults.takerAssetFilledAmount = takerAssetFilledAmount;\n fillResults.makerAssetFilledAmount = safeGetPartialAmountFloor(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.makerAssetAmount\n );\n fillResults.makerFeePaid = safeGetPartialAmountFloor(\n fillResults.makerAssetFilledAmount,\n order.makerAssetAmount,\n order.makerFee\n );\n fillResults.takerFeePaid = safeGetPartialAmountFloor(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.takerFee\n );\n\n return fillResults;\n }\n\n /// @dev Settles an order by transferring assets between counterparties.\n /// @param order Order struct containing order specifications.\n /// @param takerAddress Address selling takerAsset and buying makerAsset.\n /// @param fillResults Amounts to be filled and fees paid by maker and taker.\n function settleOrder(\n LibOrder.Order memory order,\n address takerAddress,\n LibFillResults.FillResults memory fillResults\n )\n private\n {\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n dispatchTransferFrom(\n order.makerAssetData,\n order.makerAddress,\n takerAddress,\n fillResults.makerAssetFilledAmount\n );\n dispatchTransferFrom(\n order.takerAssetData,\n takerAddress,\n order.makerAddress,\n fillResults.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n zrxAssetData,\n order.makerAddress,\n order.feeRecipientAddress,\n fillResults.makerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n order.feeRecipientAddress,\n fillResults.takerFeePaid\n );\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinMatchOrders.sol": "/*\n Copyright 2018 ZeroEx Intl.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n http://www.apache.org/licenses/LICENSE-2.0\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MMatchOrders.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\n\n\ncontract MixinMatchOrders is\n ReentrancyGuard,\n LibConstants,\n LibMath,\n MAssetProxyDispatcher,\n MExchangeCore,\n MMatchOrders,\n MTransactions\n{\n /// @dev Match two complementary orders that have a profitable spread.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the left order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftSignature Proof that order was created by the left maker.\n /// @param rightSignature Proof that order was created by the right maker.\n /// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.\n function matchOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n bytes memory leftSignature,\n bytes memory rightSignature\n )\n public\n nonReentrant\n returns (LibFillResults.MatchedFillResults memory matchedFillResults)\n {\n // We assume that rightOrder.takerAssetData == leftOrder.makerAssetData and rightOrder.makerAssetData == leftOrder.takerAssetData.\n // If this assumption isn't true, the match will fail at signature validation.\n rightOrder.makerAssetData = leftOrder.takerAssetData;\n rightOrder.takerAssetData = leftOrder.makerAssetData;\n\n // Get left & right order info\n LibOrder.OrderInfo memory leftOrderInfo = getOrderInfo(leftOrder);\n LibOrder.OrderInfo memory rightOrderInfo = getOrderInfo(rightOrder);\n\n // Fetch taker address\n address takerAddress = getCurrentContextAddress();\n \n // Either our context is valid or we revert\n assertFillableOrder(\n leftOrder,\n leftOrderInfo,\n takerAddress,\n leftSignature\n );\n assertFillableOrder(\n rightOrder,\n rightOrderInfo,\n takerAddress,\n rightSignature\n );\n assertValidMatch(leftOrder, rightOrder);\n\n // Compute proportional fill amounts\n matchedFillResults = calculateMatchedFillResults(\n leftOrder,\n rightOrder,\n leftOrderInfo.orderTakerAssetFilledAmount,\n rightOrderInfo.orderTakerAssetFilledAmount\n );\n\n // Validate fill contexts\n assertValidFill(\n leftOrder,\n leftOrderInfo,\n matchedFillResults.left.takerAssetFilledAmount,\n matchedFillResults.left.takerAssetFilledAmount,\n matchedFillResults.left.makerAssetFilledAmount\n );\n assertValidFill(\n rightOrder,\n rightOrderInfo,\n matchedFillResults.right.takerAssetFilledAmount,\n matchedFillResults.right.takerAssetFilledAmount,\n matchedFillResults.right.makerAssetFilledAmount\n );\n \n // Update exchange state\n updateFilledState(\n leftOrder,\n takerAddress,\n leftOrderInfo.orderHash,\n leftOrderInfo.orderTakerAssetFilledAmount,\n matchedFillResults.left\n );\n updateFilledState(\n rightOrder,\n takerAddress,\n rightOrderInfo.orderHash,\n rightOrderInfo.orderTakerAssetFilledAmount,\n matchedFillResults.right\n );\n\n // Settle matched orders. Succeeds or throws.\n settleMatchedOrders(\n leftOrder,\n rightOrder,\n takerAddress,\n matchedFillResults\n );\n\n return matchedFillResults;\n }\n\n /// @dev Validates context for matchOrders. Succeeds or throws.\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n function assertValidMatch(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder\n )\n internal\n pure\n {\n // Make sure there is a profitable spread.\n // There is a profitable spread iff the cost per unit bought (OrderA.MakerAmount/OrderA.TakerAmount) for each order is greater\n // than the profit per unit sold of the matched order (OrderB.TakerAmount/OrderB.MakerAmount).\n // This is satisfied by the equations below:\n // <leftOrder.makerAssetAmount> / <leftOrder.takerAssetAmount> >= <rightOrder.takerAssetAmount> / <rightOrder.makerAssetAmount>\n // AND\n // <rightOrder.makerAssetAmount> / <rightOrder.takerAssetAmount> >= <leftOrder.takerAssetAmount> / <leftOrder.makerAssetAmount>\n // These equations can be combined to get the following:\n require(\n safeMul(leftOrder.makerAssetAmount, rightOrder.makerAssetAmount) >=\n safeMul(leftOrder.takerAssetAmount, rightOrder.takerAssetAmount),\n \"NEGATIVE_SPREAD_REQUIRED\"\n );\n }\n\n /// @dev Calculates fill amounts for the matched orders.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the leftOrder order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftOrderTakerAssetFilledAmount Amount of left order already filled.\n /// @param rightOrderTakerAssetFilledAmount Amount of right order already filled.\n /// @param matchedFillResults Amounts to fill and fees to pay by maker and taker of matched orders.\n function calculateMatchedFillResults(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n uint256 leftOrderTakerAssetFilledAmount,\n uint256 rightOrderTakerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.MatchedFillResults memory matchedFillResults)\n {\n // Derive maker asset amounts for left & right orders, given store taker assert amounts\n uint256 leftTakerAssetAmountRemaining = safeSub(leftOrder.takerAssetAmount, leftOrderTakerAssetFilledAmount);\n uint256 leftMakerAssetAmountRemaining = safeGetPartialAmountFloor(\n leftOrder.makerAssetAmount,\n leftOrder.takerAssetAmount,\n leftTakerAssetAmountRemaining\n );\n uint256 rightTakerAssetAmountRemaining = safeSub(rightOrder.takerAssetAmount, rightOrderTakerAssetFilledAmount);\n uint256 rightMakerAssetAmountRemaining = safeGetPartialAmountFloor(\n rightOrder.makerAssetAmount,\n rightOrder.takerAssetAmount,\n rightTakerAssetAmountRemaining\n );\n\n // Calculate fill results for maker and taker assets: at least one order will be fully filled.\n // The maximum amount the left maker can buy is `leftTakerAssetAmountRemaining`\n // The maximum amount the right maker can sell is `rightMakerAssetAmountRemaining`\n // We have two distinct cases for calculating the fill results:\n // Case 1.\n // If the left maker can buy more than the right maker can sell, then only the right order is fully filled.\n // If the left maker can buy exactly what the right maker can sell, then both orders are fully filled.\n // Case 2.\n // If the left maker cannot buy more than the right maker can sell, then only the left order is fully filled.\n if (leftTakerAssetAmountRemaining >= rightMakerAssetAmountRemaining) {\n // Case 1: Right order is fully filled\n matchedFillResults.right.makerAssetFilledAmount = rightMakerAssetAmountRemaining;\n matchedFillResults.right.takerAssetFilledAmount = rightTakerAssetAmountRemaining;\n matchedFillResults.left.takerAssetFilledAmount = matchedFillResults.right.makerAssetFilledAmount;\n // Round down to ensure the maker's exchange rate does not exceed the price specified by the order. \n // We favor the maker when the exchange rate must be rounded.\n matchedFillResults.left.makerAssetFilledAmount = safeGetPartialAmountFloor(\n leftOrder.makerAssetAmount,\n leftOrder.takerAssetAmount,\n matchedFillResults.left.takerAssetFilledAmount\n );\n } else {\n // Case 2: Left order is fully filled\n matchedFillResults.left.makerAssetFilledAmount = leftMakerAssetAmountRemaining;\n matchedFillResults.left.takerAssetFilledAmount = leftTakerAssetAmountRemaining;\n matchedFillResults.right.makerAssetFilledAmount = matchedFillResults.left.takerAssetFilledAmount;\n // Round up to ensure the maker's exchange rate does not exceed the price specified by the order.\n // We favor the maker when the exchange rate must be rounded.\n matchedFillResults.right.takerAssetFilledAmount = safeGetPartialAmountCeil(\n rightOrder.takerAssetAmount,\n rightOrder.makerAssetAmount,\n matchedFillResults.right.makerAssetFilledAmount\n );\n }\n\n // Calculate amount given to taker\n matchedFillResults.leftMakerAssetSpreadAmount = safeSub(\n matchedFillResults.left.makerAssetFilledAmount,\n matchedFillResults.right.takerAssetFilledAmount\n );\n\n // Compute fees for left order\n matchedFillResults.left.makerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.left.makerAssetFilledAmount,\n leftOrder.makerAssetAmount,\n leftOrder.makerFee\n );\n matchedFillResults.left.takerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.left.takerAssetFilledAmount,\n leftOrder.takerAssetAmount,\n leftOrder.takerFee\n );\n\n // Compute fees for right order\n matchedFillResults.right.makerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.right.makerAssetFilledAmount,\n rightOrder.makerAssetAmount,\n rightOrder.makerFee\n );\n matchedFillResults.right.takerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.right.takerAssetFilledAmount,\n rightOrder.takerAssetAmount,\n rightOrder.takerFee\n );\n\n // Return fill results\n return matchedFillResults;\n }\n\n /// @dev Settles matched order by transferring appropriate funds between order makers, taker, and fee recipient.\n /// @param leftOrder First matched order.\n /// @param rightOrder Second matched order.\n /// @param takerAddress Address that matched the orders. The taker receives the spread between orders as profit.\n /// @param matchedFillResults Struct holding amounts to transfer between makers, taker, and fee recipients.\n function settleMatchedOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n address takerAddress,\n LibFillResults.MatchedFillResults memory matchedFillResults\n )\n private\n {\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n // Order makers and taker\n dispatchTransferFrom(\n leftOrder.makerAssetData,\n leftOrder.makerAddress,\n rightOrder.makerAddress,\n matchedFillResults.right.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n rightOrder.makerAssetData,\n rightOrder.makerAddress,\n leftOrder.makerAddress,\n matchedFillResults.left.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n leftOrder.makerAssetData,\n leftOrder.makerAddress,\n takerAddress,\n matchedFillResults.leftMakerAssetSpreadAmount\n );\n\n // Maker fees\n dispatchTransferFrom(\n zrxAssetData,\n leftOrder.makerAddress,\n leftOrder.feeRecipientAddress,\n matchedFillResults.left.makerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n rightOrder.makerAddress,\n rightOrder.feeRecipientAddress,\n matchedFillResults.right.makerFeePaid\n );\n\n // Taker fees\n if (leftOrder.feeRecipientAddress == rightOrder.feeRecipientAddress) {\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n leftOrder.feeRecipientAddress,\n safeAdd(\n matchedFillResults.left.takerFeePaid,\n matchedFillResults.right.takerFeePaid\n )\n );\n } else {\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n leftOrder.feeRecipientAddress,\n matchedFillResults.left.takerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n rightOrder.feeRecipientAddress,\n matchedFillResults.right.takerFeePaid\n );\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinSignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./interfaces/IWallet.sol\";\nimport \"./interfaces/IValidator.sol\";\n\n\ncontract MixinSignatureValidator is\n ReentrancyGuard,\n MSignatureValidator,\n MTransactions\n{\n using LibBytes for bytes;\n \n // Mapping of hash => signer => signed\n mapping (bytes32 => mapping (address => bool)) public preSigned;\n\n // Mapping of signer => validator => approved\n mapping (address => mapping (address => bool)) public allowedValidators;\n\n /// @dev Approves a hash on-chain using any valid signature type.\n /// After presigning a hash, the preSign signature type will become valid for that hash and signer.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n function preSign(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external\n {\n if (signerAddress != msg.sender) {\n require(\n isValidSignature(\n hash,\n signerAddress,\n signature\n ),\n \"INVALID_SIGNATURE\"\n );\n }\n preSigned[hash][signerAddress] = true;\n }\n\n /// @dev Approves/unnapproves a Validator contract to verify signatures on signer's behalf.\n /// @param validatorAddress Address of Validator contract.\n /// @param approval Approval or disapproval of Validator contract.\n function setSignatureValidatorApproval(\n address validatorAddress,\n bool approval\n )\n external\n nonReentrant\n {\n address signerAddress = getCurrentContextAddress();\n allowedValidators[signerAddress][validatorAddress] = approval;\n emit SignatureValidatorApproval(\n signerAddress,\n validatorAddress,\n approval\n );\n }\n\n /// @dev Verifies that a hash has been signed by the given signer.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes memory signature\n )\n public\n view\n returns (bool isValid)\n {\n require(\n signature.length > 0,\n \"LENGTH_GREATER_THAN_0_REQUIRED\"\n );\n\n // Pop last byte off of signature byte array.\n uint8 signatureTypeRaw = uint8(signature.popLastByte());\n\n // Ensure signature is supported\n require(\n signatureTypeRaw < uint8(SignatureType.NSignatureTypes),\n \"SIGNATURE_UNSUPPORTED\"\n );\n\n SignatureType signatureType = SignatureType(signatureTypeRaw);\n\n // Variables are not scoped in Solidity.\n uint8 v;\n bytes32 r;\n bytes32 s;\n address recovered;\n\n // Always illegal signature.\n // This is always an implicit option since a signer can create a\n // signature array with invalid type or length. We may as well make\n // it an explicit option. This aids testing and analysis. It is\n // also the initialization value for the enum type.\n if (signatureType == SignatureType.Illegal) {\n revert(\"SIGNATURE_ILLEGAL\");\n\n // Always invalid signature.\n // Like Illegal, this is always implicitly available and therefore\n // offered explicitly. It can be implicitly created by providing\n // a correctly formatted but incorrect signature.\n } else if (signatureType == SignatureType.Invalid) {\n require(\n signature.length == 0,\n \"LENGTH_0_REQUIRED\"\n );\n isValid = false;\n return isValid;\n\n // Signature using EIP712\n } else if (signatureType == SignatureType.EIP712) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n hash,\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n\n // Signed using web3.eth_sign\n } else if (signatureType == SignatureType.EthSign) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n keccak256(abi.encodePacked(\n \"\\x19Ethereum Signed Message:\\n32\",\n hash\n )),\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n\n // Signature verified by wallet contract.\n // If used with an order, the maker of the order is the wallet contract.\n } else if (signatureType == SignatureType.Wallet) {\n isValid = isValidWalletSignature(\n hash,\n signerAddress,\n signature\n );\n return isValid;\n\n // Signature verified by validator contract.\n // If used with an order, the maker of the order can still be an EOA.\n // A signature using this type should be encoded as:\n // | Offset | Length | Contents |\n // | 0x00 | x | Signature to validate |\n // | 0x00 + x | 20 | Address of validator contract |\n // | 0x14 + x | 1 | Signature type is always \"\\x06\" |\n } else if (signatureType == SignatureType.Validator) {\n // Pop last 20 bytes off of signature byte array.\n address validatorAddress = signature.popLast20Bytes();\n \n // Ensure signer has approved validator.\n if (!allowedValidators[signerAddress][validatorAddress]) {\n return false;\n }\n isValid = isValidValidatorSignature(\n validatorAddress,\n hash,\n signerAddress,\n signature\n );\n return isValid;\n\n // Signer signed hash previously using the preSign function.\n } else if (signatureType == SignatureType.PreSigned) {\n isValid = preSigned[hash][signerAddress];\n return isValid;\n }\n\n // Anything else is illegal (We do not return false because\n // the signature may actually be valid, just not in a format\n // that we currently support. In this case returning false\n // may lead the caller to incorrectly believe that the\n // signature was invalid.)\n revert(\"SIGNATURE_UNSUPPORTED\");\n }\n\n /// @dev Verifies signature using logic defined by Wallet contract.\n /// @param hash Any 32 byte hash.\n /// @param walletAddress Address that should have signed the given hash\n /// and defines its own signature verification method.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if signature is valid for given wallet..\n function isValidWalletSignature(\n bytes32 hash,\n address walletAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid)\n {\n bytes memory calldata = abi.encodeWithSelector(\n IWallet(walletAddress).isValidSignature.selector,\n hash,\n signature\n );\n assembly {\n let cdStart := add(calldata, 32)\n let success := staticcall(\n gas, // forward all gas\n walletAddress, // address of Wallet contract\n cdStart, // pointer to start of input\n mload(calldata), // length of input\n cdStart, // write output over input\n 32 // output size is 32 bytes\n )\n\n switch success\n case 0 {\n // Revert with `Error(\"WALLET_ERROR\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000c57414c4c45545f4552524f5200000000000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n case 1 {\n // Signature is valid if call did not revert and returned true\n isValid := mload(cdStart)\n }\n }\n return isValid;\n }\n\n /// @dev Verifies signature using logic defined by Validator contract.\n /// @param validatorAddress Address of validator contract.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidValidatorSignature(\n address validatorAddress,\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid)\n {\n bytes memory calldata = abi.encodeWithSelector(\n IValidator(signerAddress).isValidSignature.selector,\n hash,\n signerAddress,\n signature\n );\n assembly {\n let cdStart := add(calldata, 32)\n let success := staticcall(\n gas, // forward all gas\n validatorAddress, // address of Validator contract\n cdStart, // pointer to start of input\n mload(calldata), // length of input\n cdStart, // write output over input\n 32 // output size is 32 bytes\n )\n\n switch success\n case 0 {\n // Revert with `Error(\"VALIDATOR_ERROR\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f56414c494441544f525f4552524f5200000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n case 1 {\n // Signature is valid if call did not revert and returned true\n isValid := mload(cdStart)\n }\n }\n return isValid;\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinTransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\nimport \"./libs/LibExchangeErrors.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./libs/LibEIP712.sol\";\n\n\ncontract MixinTransactions is\n LibEIP712,\n MSignatureValidator,\n MTransactions\n{\n // Mapping of transaction hash => executed\n // This prevents transactions from being executed more than once.\n mapping (bytes32 => bool) public transactions;\n\n // Address of current transaction signer\n address public currentContextAddress;\n\n /// @dev Executes an exchange method call in the context of signer.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @param signature Proof of signer transaction by signer.\n function executeTransaction(\n uint256 salt,\n address signerAddress,\n bytes data,\n bytes signature\n )\n external\n {\n // Prevent reentrancy\n require(\n currentContextAddress == address(0),\n \"REENTRANCY_ILLEGAL\"\n );\n\n bytes32 transactionHash = hashEIP712Message(hashZeroExTransaction(\n salt,\n signerAddress,\n data\n ));\n\n // Validate transaction has not been executed\n require(\n !transactions[transactionHash],\n \"INVALID_TX_HASH\"\n );\n\n // Transaction always valid if signer is sender of transaction\n if (signerAddress != msg.sender) {\n // Validate signature\n require(\n isValidSignature(\n transactionHash,\n signerAddress,\n signature\n ),\n \"INVALID_TX_SIGNATURE\"\n );\n\n // Set the current transaction signer\n currentContextAddress = signerAddress;\n }\n\n // Execute transaction\n transactions[transactionHash] = true;\n require(\n address(this).delegatecall(data),\n \"FAILED_EXECUTION\"\n );\n\n // Reset current transaction signer if it was previously updated\n if (signerAddress != msg.sender) {\n currentContextAddress = address(0);\n }\n }\n\n /// @dev Calculates EIP712 hash of the Transaction.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @return EIP712 hash of the Transaction.\n function hashZeroExTransaction(\n uint256 salt,\n address signerAddress,\n bytes memory data\n )\n internal\n pure\n returns (bytes32 result)\n {\n bytes32 schemaHash = EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH;\n bytes32 dataHash = keccak256(data);\n\n // Assembly for more efficiently computing:\n // keccak256(abi.encodePacked(\n // EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH,\n // salt,\n // bytes32(signerAddress),\n // keccak256(data)\n // ));\n\n assembly {\n // Load free memory pointer\n let memPtr := mload(64)\n\n mstore(memPtr, schemaHash) // hash of schema\n mstore(add(memPtr, 32), salt) // salt\n mstore(add(memPtr, 64), and(signerAddress, 0xffffffffffffffffffffffffffffffffffffffff)) // signerAddress\n mstore(add(memPtr, 96), dataHash) // hash of data\n\n // Compute hash\n result := keccak256(memPtr, 128)\n }\n return result;\n }\n\n /// @dev The current function will be called in the context of this address (either 0x transaction signer or `msg.sender`).\n /// If calling a fill function, this address will represent the taker.\n /// If calling a cancel function, this address will represent the maker.\n /// @return Signer of 0x transaction if entry point is `executeTransaction`.\n /// `msg.sender` if entry point is any other function.\n function getCurrentContextAddress()\n internal\n view\n returns (address)\n {\n address currentContextAddress_ = currentContextAddress;\n address contextAddress = currentContextAddress_ == address(0) ? msg.sender : currentContextAddress_;\n return contextAddress;\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./libs/LibAbiEncoder.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MWrapperFunctions.sol\";\n\n\ncontract MixinWrapperFunctions is\n ReentrancyGuard,\n LibMath,\n LibFillResults,\n LibAbiEncoder,\n MExchangeCore,\n MWrapperFunctions\n{\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n nonReentrant\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrKillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n return fillResults;\n }\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (FillResults memory fillResults)\n {\n // ABI encode calldata for `fillOrder`\n bytes memory fillOrderCalldata = abiEncodeFillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n\n // Delegate to `fillOrder` and handle any exceptions gracefully\n assembly {\n let success := delegatecall(\n gas, // forward all gas\n address, // call address of this contract\n add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes)\n mload(fillOrderCalldata), // length of input\n fillOrderCalldata, // write output over input\n 128 // output size is 128 bytes\n )\n if success {\n mstore(fillResults, mload(fillOrderCalldata))\n mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32)))\n mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64)))\n mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96)))\n }\n }\n // fillResults values will be 0 by default if call was unsuccessful\n return fillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrKill.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrKillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrKillOrderInternal(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrders(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n bytes memory takerAssetData = orders[0].takerAssetData;\n \n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being sold by taker is the same for each order.\n // Rather than passing this in as calldata, we use the takerAssetData from the first order in all later orders.\n orders[i].takerAssetData = takerAssetData;\n\n // Calculate the remaining amount of takerAsset to sell\n uint256 remainingTakerAssetFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= takerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory takerAssetData = orders[0].takerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being sold by taker is the same for each order.\n // Rather than passing this in as calldata, we use the takerAssetData from the first order in all later orders.\n orders[i].takerAssetData = takerAssetData;\n\n // Calculate the remaining amount of takerAsset to sell\n uint256 remainingTakerAssetFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= takerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerAsset is bought by taker.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrders(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // Rather than passing this in as calldata, we copy the makerAssetData from the first order onto all later orders.\n orders[i].makerAssetData = makerAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n if (totalFillResults.makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // Rather than passing this in as calldata, we copy the makerAssetData from the first order onto all later orders.\n orders[i].makerAssetData = makerAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n if (totalFillResults.makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously cancels multiple orders in a single transaction.\n /// @param orders Array of order specifications.\n function batchCancelOrders(LibOrder.Order[] memory orders)\n public\n nonReentrant\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n cancelOrderInternal(orders[i]);\n }\n }\n\n /// @dev Fetches information for all passed in orders.\n /// @param orders Array of order specifications.\n /// @return Array of OrderInfo instances that correspond to each order.\n function getOrdersInfo(LibOrder.Order[] memory orders)\n public\n view\n returns (LibOrder.OrderInfo[] memory)\n {\n uint256 ordersLength = orders.length;\n LibOrder.OrderInfo[] memory ordersInfo = new LibOrder.OrderInfo[](ordersLength);\n for (uint256 i = 0; i != ordersLength; i++) {\n ordersInfo[i] = getOrderInfo(orders[i]);\n }\n return ordersInfo;\n }\n\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n require(\n fillResults.takerAssetFilledAmount == takerAssetFillAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return fillResults;\n }\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IAssetProxyDispatcher {\n\n /// @dev Registers an asset proxy to its asset proxy id.\n /// Once an asset proxy is registered, it cannot be unregistered.\n /// @param assetProxy Address of new asset proxy to register.\n function registerAssetProxy(address assetProxy)\n external;\n\n /// @dev Gets an asset proxy.\n /// @param assetProxyId Id of the asset proxy.\n /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered.\n function getAssetProxy(bytes4 assetProxyId)\n external\n view\n returns (address);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IExchange.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./IExchangeCore.sol\";\nimport \"./IMatchOrders.sol\";\nimport \"./ISignatureValidator.sol\";\nimport \"./ITransactions.sol\";\nimport \"./IAssetProxyDispatcher.sol\";\nimport \"./IWrapperFunctions.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract IExchange is\n IExchangeCore,\n IMatchOrders,\n ISignatureValidator,\n ITransactions,\n IAssetProxyDispatcher,\n IWrapperFunctions\n{}\n",
- "2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IExchangeCore {\n\n /// @dev Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch\n /// and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress).\n /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled.\n function cancelOrdersUpTo(uint256 targetOrderEpoch)\n external;\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev After calling, the order can not be filled anymore.\n /// @param order Order struct containing order specifications.\n function cancelOrder(LibOrder.Order memory order)\n public;\n\n /// @dev Gets information about an order: status, hash, and amount filled.\n /// @param order Order to gather information on.\n /// @return OrderInfo Information about the order and its state.\n /// See LibOrder.OrderInfo for a complete description.\n function getOrderInfo(LibOrder.Order memory order)\n public\n view\n returns (LibOrder.OrderInfo memory orderInfo);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IMatchOrders {\n\n /// @dev Match two complementary orders that have a profitable spread.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the left order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftSignature Proof that order was created by the left maker.\n /// @param rightSignature Proof that order was created by the right maker.\n /// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.\n function matchOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n bytes memory leftSignature,\n bytes memory rightSignature\n )\n public\n returns (LibFillResults.MatchedFillResults memory matchedFillResults);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract ISignatureValidator {\n\n /// @dev Approves a hash on-chain using any valid signature type.\n /// After presigning a hash, the preSign signature type will become valid for that hash and signer.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n function preSign(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external;\n \n /// @dev Approves/unnapproves a Validator contract to verify signatures on signer's behalf.\n /// @param validatorAddress Address of Validator contract.\n /// @param approval Approval or disapproval of Validator contract.\n function setSignatureValidatorApproval(\n address validatorAddress,\n bool approval\n )\n external;\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signerAddress Address of signer.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes memory signature\n )\n public\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/ITransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\n\ncontract ITransactions {\n\n /// @dev Executes an exchange method call in the context of signer.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @param signature Proof of signer transaction by signer.\n function executeTransaction(\n uint256 salt,\n address signerAddress,\n bytes data,\n bytes signature\n )\n external;\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IValidator {\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IWallet.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IWallet {\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n bytes signature\n )\n external\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IWrapperFunctions {\n\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrKill.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrKillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrders(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerAsset is bought by taker.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrders(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously cancels multiple orders in a single transaction.\n /// @param orders Array of order specifications.\n function batchCancelOrders(LibOrder.Order[] memory orders)\n public;\n\n /// @dev Fetches information for all passed in orders\n /// @param orders Array of order specifications.\n /// @return Array of OrderInfo instances that correspond to each order.\n function getOrdersInfo(LibOrder.Order[] memory orders)\n public\n view\n returns (LibOrder.OrderInfo[] memory);\n}\n",
- "2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./LibOrder.sol\";\n\n\ncontract LibAbiEncoder {\n\n /// @dev ABI encodes calldata for `fillOrder`.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return ABI encoded calldata for `fillOrder`.\n function abiEncodeFillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n pure\n returns (bytes memory fillOrderCalldata)\n {\n // We need to call MExchangeCore.fillOrder using a delegatecall in\n // assembly so that we can intercept a call that throws. For this, we\n // need the input encoded in memory in the Ethereum ABIv2 format [1].\n\n // | Area | Offset | Length | Contents |\n // | -------- |--------|---------|-------------------------------------------- |\n // | Header | 0x00 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 0x00 | | 1. offset to order (*) |\n // | | 0x20 | | 2. takerAssetFillAmount |\n // | | 0x40 | | 3. offset to signature (*) |\n // | Data | | 12 * 32 | order: |\n // | | 0x000 | | 1. senderAddress |\n // | | 0x020 | | 2. makerAddress |\n // | | 0x040 | | 3. takerAddress |\n // | | 0x060 | | 4. feeRecipientAddress |\n // | | 0x080 | | 5. makerAssetAmount |\n // | | 0x0A0 | | 6. takerAssetAmount |\n // | | 0x0C0 | | 7. makerFeeAmount |\n // | | 0x0E0 | | 8. takerFeeAmount |\n // | | 0x100 | | 9. expirationTimeSeconds |\n // | | 0x120 | | 10. salt |\n // | | 0x140 | | 11. Offset to makerAssetData (*) |\n // | | 0x160 | | 12. Offset to takerAssetData (*) |\n // | | 0x180 | 32 | makerAssetData Length |\n // | | 0x1A0 | ** | makerAssetData Contents |\n // | | 0x1C0 | 32 | takerAssetData Length |\n // | | 0x1E0 | ** | takerAssetData Contents |\n // | | 0x200 | 32 | signature Length |\n // | | 0x220 | ** | signature Contents |\n\n // * Offsets are calculated from the beginning of the current area: Header, Params, Data:\n // An offset stored in the Params area is calculated from the beginning of the Params section.\n // An offset stored in the Data area is calculated from the beginning of the Data section.\n\n // ** The length of dynamic array contents are stored in the field immediately preceeding the contents.\n\n // [1]: https://solidity.readthedocs.io/en/develop/abi-spec.html\n\n assembly {\n\n // Areas below may use the following variables:\n // 1. <area>Start -- Start of this area in memory\n // 2. <area>End -- End of this area in memory. This value may\n // be precomputed (before writing contents),\n // or it may be computed as contents are written.\n // 3. <area>Offset -- Current offset into area. If an area's End\n // is precomputed, this variable tracks the\n // offsets of contents as they are written.\n\n /////// Setup Header Area ///////\n // Load free memory pointer\n fillOrderCalldata := mload(0x40)\n // bytes4(keccak256(\"fillOrder((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),uint256,bytes)\"))\n // = 0xb4be83d5\n // Leave 0x20 bytes to store the length\n mstore(add(fillOrderCalldata, 0x20), 0xb4be83d500000000000000000000000000000000000000000000000000000000)\n let headerAreaEnd := add(fillOrderCalldata, 0x24)\n\n /////// Setup Params Area ///////\n // This area is preallocated and written to later.\n // This is because we need to fill in offsets that have not yet been calculated.\n let paramsAreaStart := headerAreaEnd\n let paramsAreaEnd := add(paramsAreaStart, 0x60)\n let paramsAreaOffset := paramsAreaStart\n\n /////// Setup Data Area ///////\n let dataAreaStart := paramsAreaEnd\n let dataAreaEnd := dataAreaStart\n\n // Offset from the source data we're reading from\n let sourceOffset := order\n // arrayLenBytes and arrayLenWords track the length of a dynamically-allocated bytes array.\n let arrayLenBytes := 0\n let arrayLenWords := 0\n\n /////// Write order Struct ///////\n // Write memory location of Order, relative to the start of the\n // parameter list, then increment the paramsAreaOffset respectively.\n mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))\n paramsAreaOffset := add(paramsAreaOffset, 0x20)\n\n // Write values for each field in the order\n // It would be nice to use a loop, but we save on gas by writing\n // the stores sequentially.\n mstore(dataAreaEnd, mload(sourceOffset)) // makerAddress\n mstore(add(dataAreaEnd, 0x20), mload(add(sourceOffset, 0x20))) // takerAddress\n mstore(add(dataAreaEnd, 0x40), mload(add(sourceOffset, 0x40))) // feeRecipientAddress\n mstore(add(dataAreaEnd, 0x60), mload(add(sourceOffset, 0x60))) // senderAddress\n mstore(add(dataAreaEnd, 0x80), mload(add(sourceOffset, 0x80))) // makerAssetAmount\n mstore(add(dataAreaEnd, 0xA0), mload(add(sourceOffset, 0xA0))) // takerAssetAmount\n mstore(add(dataAreaEnd, 0xC0), mload(add(sourceOffset, 0xC0))) // makerFeeAmount\n mstore(add(dataAreaEnd, 0xE0), mload(add(sourceOffset, 0xE0))) // takerFeeAmount\n mstore(add(dataAreaEnd, 0x100), mload(add(sourceOffset, 0x100))) // expirationTimeSeconds\n mstore(add(dataAreaEnd, 0x120), mload(add(sourceOffset, 0x120))) // salt\n mstore(add(dataAreaEnd, 0x140), mload(add(sourceOffset, 0x140))) // Offset to makerAssetData\n mstore(add(dataAreaEnd, 0x160), mload(add(sourceOffset, 0x160))) // Offset to takerAssetData\n dataAreaEnd := add(dataAreaEnd, 0x180)\n sourceOffset := add(sourceOffset, 0x180)\n\n // Write offset to <order.makerAssetData>\n mstore(add(dataAreaStart, mul(10, 0x20)), sub(dataAreaEnd, dataAreaStart))\n\n // Calculate length of <order.makerAssetData>\n sourceOffset := mload(add(order, 0x140)) // makerAssetData\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of <order.makerAssetData>\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of <order.makerAssetData>\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n // Write offset to <order.takerAssetData>\n mstore(add(dataAreaStart, mul(11, 0x20)), sub(dataAreaEnd, dataAreaStart))\n\n // Calculate length of <order.takerAssetData>\n sourceOffset := mload(add(order, 0x160)) // takerAssetData\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of <order.takerAssetData>\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of <order.takerAssetData>\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n /////// Write takerAssetFillAmount ///////\n mstore(paramsAreaOffset, takerAssetFillAmount)\n paramsAreaOffset := add(paramsAreaOffset, 0x20)\n\n /////// Write signature ///////\n // Write offset to paramsArea\n mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))\n\n // Calculate length of signature\n sourceOffset := signature\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of signature\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of signature\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n // Set length of calldata\n mstore(fillOrderCalldata, sub(dataAreaEnd, add(fillOrderCalldata, 0x20)))\n\n // Increment free memory pointer\n mstore(0x40, dataAreaEnd)\n }\n\n return fillOrderCalldata;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibConstants.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\n// solhint-disable max-line-length\ncontract LibConstants {\n \n // Asset data for ZRX token. Used for fee transfers.\n // @TODO: Hardcode constant when we deploy. Currently \n // not constant to make testing easier.\n\n // The proxyId for ZRX_ASSET_DATA is bytes4(keccak256(\"ERC20Token(address)\")) = 0xf47261b0\n \n // Kovan ZRX address is 0x6ff6c0ff1d68b964901f986d4c9fa3ac68346570.\n // The ABI encoded proxyId and address is 0xf47261b00000000000000000000000006ff6c0ff1d68b964901f986d4c9fa3ac68346570\n // bytes constant public ZRX_ASSET_DATA = \"\\xf4\\x72\\x61\\xb0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x6f\\xf6\\xc0\\xff\\x1d\\x68\\xb9\\x64\\x90\\x1f\\x98\\x6d\\x4c\\x9f\\xa3\\xac\\x68\\x34\\x65\\x70\";\n \n // Mainnet ZRX address is 0xe41d2489571d322189246dafa5ebde1f4699f498.\n // The ABI encoded proxyId and address is 0xf47261b0000000000000000000000000e41d2489571d322189246dafa5ebde1f4699f498\n // bytes constant public ZRX_ASSET_DATA = \"\\xf4\\x72\\x61\\xb0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xe4\\x1d\\x24\\x89\\x57\\x1d\\x32\\x21\\x89\\x24\\x6d\\xaf\\xa5\\xeb\\xde\\x1f\\x46\\x99\\xf4\\x98\";\n \n // solhint-disable-next-line var-name-mixedcase\n bytes public ZRX_ASSET_DATA;\n\n // @TODO: Remove when we deploy.\n constructor (bytes memory zrxAssetData)\n public\n {\n ZRX_ASSET_DATA = zrxAssetData;\n }\n}\n// solhint-enable max-line-length\n",
- "2.0.0/protocol/Exchange/libs/LibEIP712.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract LibEIP712 {\n\n // EIP191 header for EIP712 prefix\n string constant internal EIP191_HEADER = \"\\x19\\x01\";\n\n // EIP712 Domain Name value\n string constant internal EIP712_DOMAIN_NAME = \"0x Protocol\";\n\n // EIP712 Domain Version value\n string constant internal EIP712_DOMAIN_VERSION = \"2\";\n\n // Hash of the EIP712 Domain Separator Schema\n bytes32 constant internal EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"EIP712Domain(\",\n \"string name,\",\n \"string version,\",\n \"address verifyingContract\",\n \")\"\n ));\n\n // Hash of the EIP712 Domain Separator data\n // solhint-disable-next-line var-name-mixedcase\n bytes32 public EIP712_DOMAIN_HASH;\n\n constructor ()\n public\n {\n EIP712_DOMAIN_HASH = keccak256(abi.encodePacked(\n EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH,\n keccak256(bytes(EIP712_DOMAIN_NAME)),\n keccak256(bytes(EIP712_DOMAIN_VERSION)),\n bytes32(address(this))\n ));\n }\n\n /// @dev Calculates EIP712 encoding for a hash struct in this EIP712 Domain.\n /// @param hashStruct The EIP712 hash struct.\n /// @return EIP712 hash applied to this EIP712 Domain.\n function hashEIP712Message(bytes32 hashStruct)\n internal\n view\n returns (bytes32 result)\n {\n bytes32 eip712DomainHash = EIP712_DOMAIN_HASH;\n\n // Assembly for more efficient computing:\n // keccak256(abi.encodePacked(\n // EIP191_HEADER,\n // EIP712_DOMAIN_HASH,\n // hashStruct \n // ));\n\n assembly {\n // Load free memory pointer\n let memPtr := mload(64)\n\n mstore(memPtr, 0x1901000000000000000000000000000000000000000000000000000000000000) // EIP191 header\n mstore(add(memPtr, 2), eip712DomainHash) // EIP712 domain hash\n mstore(add(memPtr, 34), hashStruct) // Hash of struct\n\n // Compute hash\n result := keccak256(memPtr, 66)\n }\n return result;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\n// solhint-disable\npragma solidity 0.4.24;\n\n\n/// @dev This contract documents the revert reasons used in the Exchange contract.\n/// This contract is intended to serve as a reference, but is not actually used for efficiency reasons.\ncontract LibExchangeErrors {\n\n /// Order validation errors ///\n string constant ORDER_UNFILLABLE = \"ORDER_UNFILLABLE\"; // Order cannot be filled.\n string constant INVALID_MAKER = \"INVALID_MAKER\"; // Invalid makerAddress.\n string constant INVALID_TAKER = \"INVALID_TAKER\"; // Invalid takerAddress.\n string constant INVALID_SENDER = \"INVALID_SENDER\"; // Invalid `msg.sender`.\n string constant INVALID_ORDER_SIGNATURE = \"INVALID_ORDER_SIGNATURE\"; // Signature validation failed. \n \n /// fillOrder validation errors ///\n string constant INVALID_TAKER_AMOUNT = \"INVALID_TAKER_AMOUNT\"; // takerAssetFillAmount cannot equal 0.\n string constant ROUNDING_ERROR = \"ROUNDING_ERROR\"; // Rounding error greater than 0.1% of takerAssetFillAmount. \n \n /// Signature validation errors ///\n string constant INVALID_SIGNATURE = \"INVALID_SIGNATURE\"; // Signature validation failed. \n string constant SIGNATURE_ILLEGAL = \"SIGNATURE_ILLEGAL\"; // Signature type is illegal.\n string constant SIGNATURE_UNSUPPORTED = \"SIGNATURE_UNSUPPORTED\"; // Signature type unsupported.\n \n /// cancelOrdersUptTo errors ///\n string constant INVALID_NEW_ORDER_EPOCH = \"INVALID_NEW_ORDER_EPOCH\"; // Specified salt must be greater than or equal to existing orderEpoch.\n\n /// fillOrKillOrder errors ///\n string constant COMPLETE_FILL_FAILED = \"COMPLETE_FILL_FAILED\"; // Desired takerAssetFillAmount could not be completely filled. \n\n /// matchOrders errors ///\n string constant NEGATIVE_SPREAD_REQUIRED = \"NEGATIVE_SPREAD_REQUIRED\"; // Matched orders must have a negative spread.\n\n /// Transaction errors ///\n string constant REENTRANCY_ILLEGAL = \"REENTRANCY_ILLEGAL\"; // Recursive reentrancy is not allowed. \n string constant INVALID_TX_HASH = \"INVALID_TX_HASH\"; // Transaction has already been executed. \n string constant INVALID_TX_SIGNATURE = \"INVALID_TX_SIGNATURE\"; // Signature validation failed. \n string constant FAILED_EXECUTION = \"FAILED_EXECUTION\"; // Transaction execution failed. \n \n /// registerAssetProxy errors ///\n string constant ASSET_PROXY_ALREADY_EXISTS = \"ASSET_PROXY_ALREADY_EXISTS\"; // AssetProxy with same id already exists.\n\n /// dispatchTransferFrom errors ///\n string constant ASSET_PROXY_DOES_NOT_EXIST = \"ASSET_PROXY_DOES_NOT_EXIST\"; // No assetProxy registered at given id.\n string constant TRANSFER_FAILED = \"TRANSFER_FAILED\"; // Asset transfer unsuccesful.\n\n /// Length validation errors ///\n string constant LENGTH_GREATER_THAN_0_REQUIRED = \"LENGTH_GREATER_THAN_0_REQUIRED\"; // Byte array must have a length greater than 0.\n string constant LENGTH_GREATER_THAN_3_REQUIRED = \"LENGTH_GREATER_THAN_3_REQUIRED\"; // Byte array must have a length greater than 3.\n string constant LENGTH_0_REQUIRED = \"LENGTH_0_REQUIRED\"; // Byte array must have a length of 0.\n string constant LENGTH_65_REQUIRED = \"LENGTH_65_REQUIRED\"; // Byte array must have a length of 65.\n}\n",
- "2.0.0/protocol/Exchange/libs/LibFillResults.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract LibFillResults is\n SafeMath\n{\n struct FillResults {\n uint256 makerAssetFilledAmount; // Total amount of makerAsset(s) filled.\n uint256 takerAssetFilledAmount; // Total amount of takerAsset(s) filled.\n uint256 makerFeePaid; // Total amount of ZRX paid by maker(s) to feeRecipient(s).\n uint256 takerFeePaid; // Total amount of ZRX paid by taker to feeRecipients(s).\n }\n\n struct MatchedFillResults {\n FillResults left; // Amounts filled and fees paid of left order.\n FillResults right; // Amounts filled and fees paid of right order.\n uint256 leftMakerAssetSpreadAmount; // Spread between price of left and right order, denominated in the left order's makerAsset, paid to taker.\n }\n\n /// @dev Adds properties of both FillResults instances.\n /// Modifies the first FillResults instance specified.\n /// @param totalFillResults Fill results instance that will be added onto.\n /// @param singleFillResults Fill results instance that will be added to totalFillResults.\n function addFillResults(FillResults memory totalFillResults, FillResults memory singleFillResults)\n internal\n pure\n {\n totalFillResults.makerAssetFilledAmount = safeAdd(totalFillResults.makerAssetFilledAmount, singleFillResults.makerAssetFilledAmount);\n totalFillResults.takerAssetFilledAmount = safeAdd(totalFillResults.takerAssetFilledAmount, singleFillResults.takerAssetFilledAmount);\n totalFillResults.makerFeePaid = safeAdd(totalFillResults.makerFeePaid, singleFillResults.makerFeePaid);\n totalFillResults.takerFeePaid = safeAdd(totalFillResults.takerFeePaid, singleFillResults.takerFeePaid);\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibMath.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract LibMath is\n SafeMath\n{\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// Reverts if rounding error is >= 0.1%\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded down.\n function safeGetPartialAmountFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n require(\n !isRoundingErrorFloor(\n numerator,\n denominator,\n target\n ),\n \"ROUNDING_ERROR\"\n );\n \n partialAmount = safeDiv(\n safeMul(numerator, target),\n denominator\n );\n return partialAmount;\n }\n\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// Reverts if rounding error is >= 0.1%\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded up.\n function safeGetPartialAmountCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n require(\n !isRoundingErrorCeil(\n numerator,\n denominator,\n target\n ),\n \"ROUNDING_ERROR\"\n );\n \n // safeDiv computes `floor(a / b)`. We use the identity (a, b integer):\n // ceil(a / b) = floor((a + b - 1) / b)\n // To implement `ceil(a / b)` using safeDiv.\n partialAmount = safeDiv(\n safeAdd(\n safeMul(numerator, target),\n safeSub(denominator, 1)\n ),\n denominator\n );\n return partialAmount;\n }\n\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded down.\n function getPartialAmountFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n partialAmount = safeDiv(\n safeMul(numerator, target),\n denominator\n );\n return partialAmount;\n }\n \n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded up.\n function getPartialAmountCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n // safeDiv computes `floor(a / b)`. We use the identity (a, b integer):\n // ceil(a / b) = floor((a + b - 1) / b)\n // To implement `ceil(a / b)` using safeDiv.\n partialAmount = safeDiv(\n safeAdd(\n safeMul(numerator, target),\n safeSub(denominator, 1)\n ),\n denominator\n );\n return partialAmount;\n }\n \n /// @dev Checks if rounding error >= 0.1% when rounding down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to multiply with numerator/denominator.\n /// @return Rounding error is present.\n function isRoundingErrorFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (bool isError)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n \n // The absolute rounding error is the difference between the rounded\n // value and the ideal value. The relative rounding error is the\n // absolute rounding error divided by the absolute value of the\n // ideal value. This is undefined when the ideal value is zero.\n //\n // The ideal value is `numerator * target / denominator`.\n // Let's call `numerator * target % denominator` the remainder.\n // The absolute error is `remainder / denominator`.\n //\n // When the ideal value is zero, we require the absolute error to\n // be zero. Fortunately, this is always the case. The ideal value is\n // zero iff `numerator == 0` and/or `target == 0`. In this case the\n // remainder and absolute error are also zero. \n if (target == 0 || numerator == 0) {\n return false;\n }\n \n // Otherwise, we want the relative rounding error to be strictly\n // less than 0.1%.\n // The relative error is `remainder / (numerator * target)`.\n // We want the relative error less than 1 / 1000:\n // remainder / (numerator * denominator) < 1 / 1000\n // or equivalently:\n // 1000 * remainder < numerator * target\n // so we have a rounding error iff:\n // 1000 * remainder >= numerator * target\n uint256 remainder = mulmod(\n target,\n numerator,\n denominator\n );\n isError = safeMul(1000, remainder) >= safeMul(numerator, target);\n return isError;\n }\n \n /// @dev Checks if rounding error >= 0.1% when rounding up.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to multiply with numerator/denominator.\n /// @return Rounding error is present.\n function isRoundingErrorCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (bool isError)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n \n // See the comments in `isRoundingError`.\n if (target == 0 || numerator == 0) {\n // When either is zero, the ideal value and rounded value are zero\n // and there is no rounding error. (Although the relative error\n // is undefined.)\n return false;\n }\n // Compute remainder as before\n uint256 remainder = mulmod(\n target,\n numerator,\n denominator\n );\n remainder = safeSub(denominator, remainder) % denominator;\n isError = safeMul(1000, remainder) >= safeMul(numerator, target);\n return isError;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibOrder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./LibEIP712.sol\";\n\n\ncontract LibOrder is\n LibEIP712\n{\n // Hash for the EIP712 Order Schema\n bytes32 constant internal EIP712_ORDER_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"Order(\",\n \"address makerAddress,\",\n \"address takerAddress,\",\n \"address feeRecipientAddress,\",\n \"address senderAddress,\",\n \"uint256 makerAssetAmount,\",\n \"uint256 takerAssetAmount,\",\n \"uint256 makerFee,\",\n \"uint256 takerFee,\",\n \"uint256 expirationTimeSeconds,\",\n \"uint256 salt,\",\n \"bytes makerAssetData,\",\n \"bytes takerAssetData\",\n \")\"\n ));\n\n // A valid order remains fillable until it is expired, fully filled, or cancelled.\n // An order's state is unaffected by external factors, like account balances.\n enum OrderStatus {\n INVALID, // Default value\n INVALID_MAKER_ASSET_AMOUNT, // Order does not have a valid maker asset amount\n INVALID_TAKER_ASSET_AMOUNT, // Order does not have a valid taker asset amount\n FILLABLE, // Order is fillable\n EXPIRED, // Order has already expired\n FULLY_FILLED, // Order is fully filled\n CANCELLED // Order has been cancelled\n }\n\n // solhint-disable max-line-length\n struct Order {\n address makerAddress; // Address that created the order. \n address takerAddress; // Address that is allowed to fill the order. If set to 0, any address is allowed to fill the order. \n address feeRecipientAddress; // Address that will recieve fees when order is filled. \n address senderAddress; // Address that is allowed to call Exchange contract methods that affect this order. If set to 0, any address is allowed to call these methods.\n uint256 makerAssetAmount; // Amount of makerAsset being offered by maker. Must be greater than 0. \n uint256 takerAssetAmount; // Amount of takerAsset being bid on by maker. Must be greater than 0. \n uint256 makerFee; // Amount of ZRX paid to feeRecipient by maker when order is filled. If set to 0, no transfer of ZRX from maker to feeRecipient will be attempted.\n uint256 takerFee; // Amount of ZRX paid to feeRecipient by taker when order is filled. If set to 0, no transfer of ZRX from taker to feeRecipient will be attempted.\n uint256 expirationTimeSeconds; // Timestamp in seconds at which order expires. \n uint256 salt; // Arbitrary number to facilitate uniqueness of the order's hash. \n bytes makerAssetData; // Encoded data that can be decoded by a specified proxy contract when transferring makerAsset. The last byte references the id of this proxy.\n bytes takerAssetData; // Encoded data that can be decoded by a specified proxy contract when transferring takerAsset. The last byte references the id of this proxy.\n }\n // solhint-enable max-line-length\n\n struct OrderInfo {\n uint8 orderStatus; // Status that describes order's validity and fillability.\n bytes32 orderHash; // EIP712 hash of the order (see LibOrder.getOrderHash).\n uint256 orderTakerAssetFilledAmount; // Amount of order that has already been filled.\n }\n\n /// @dev Calculates Keccak-256 hash of the order.\n /// @param order The order structure.\n /// @return Keccak-256 EIP712 hash of the order.\n function getOrderHash(Order memory order)\n internal\n view\n returns (bytes32 orderHash)\n {\n orderHash = hashEIP712Message(hashOrder(order));\n return orderHash;\n }\n\n /// @dev Calculates EIP712 hash of the order.\n /// @param order The order structure.\n /// @return EIP712 hash of the order.\n function hashOrder(Order memory order)\n internal\n pure\n returns (bytes32 result)\n {\n bytes32 schemaHash = EIP712_ORDER_SCHEMA_HASH;\n bytes32 makerAssetDataHash = keccak256(order.makerAssetData);\n bytes32 takerAssetDataHash = keccak256(order.takerAssetData);\n\n // Assembly for more efficiently computing:\n // keccak256(abi.encodePacked(\n // EIP712_ORDER_SCHEMA_HASH,\n // bytes32(order.makerAddress),\n // bytes32(order.takerAddress),\n // bytes32(order.feeRecipientAddress),\n // bytes32(order.senderAddress),\n // order.makerAssetAmount,\n // order.takerAssetAmount,\n // order.makerFee,\n // order.takerFee,\n // order.expirationTimeSeconds,\n // order.salt,\n // keccak256(order.makerAssetData),\n // keccak256(order.takerAssetData)\n // ));\n\n assembly {\n // Calculate memory addresses that will be swapped out before hashing\n let pos1 := sub(order, 32)\n let pos2 := add(order, 320)\n let pos3 := add(order, 352)\n\n // Backup\n let temp1 := mload(pos1)\n let temp2 := mload(pos2)\n let temp3 := mload(pos3)\n \n // Hash in place\n mstore(pos1, schemaHash)\n mstore(pos2, makerAssetDataHash)\n mstore(pos3, takerAssetDataHash)\n result := keccak256(pos1, 416)\n \n // Restore\n mstore(pos1, temp1)\n mstore(pos2, temp2)\n mstore(pos3, temp3)\n }\n return result;\n }\n}\n",
- "2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAssetProxyDispatcher.sol\";\n\n\ncontract MAssetProxyDispatcher is\n IAssetProxyDispatcher\n{\n // Logs registration of new asset proxy\n event AssetProxyRegistered(\n bytes4 id, // Id of new registered AssetProxy.\n address assetProxy // Address of new registered AssetProxy.\n );\n\n /// @dev Forwards arguments to assetProxy and calls `transferFrom`. Either succeeds or throws.\n /// @param assetData Byte array encoded for the asset.\n /// @param from Address to transfer token from.\n /// @param to Address to transfer token to.\n /// @param amount Amount of token to transfer.\n function dispatchTransferFrom(\n bytes memory assetData,\n address from,\n address to,\n uint256 amount\n )\n internal;\n}\n",
- "2.0.0/protocol/Exchange/mixins/MExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IExchangeCore.sol\";\n\n\ncontract MExchangeCore is\n IExchangeCore\n{\n // Fill event is emitted whenever an order is filled.\n event Fill(\n address indexed makerAddress, // Address that created the order. \n address indexed feeRecipientAddress, // Address that received fees.\n address takerAddress, // Address that filled the order.\n address senderAddress, // Address that called the Exchange contract (msg.sender).\n uint256 makerAssetFilledAmount, // Amount of makerAsset sold by maker and bought by taker. \n uint256 takerAssetFilledAmount, // Amount of takerAsset sold by taker and bought by maker.\n uint256 makerFeePaid, // Amount of ZRX paid to feeRecipient by maker.\n uint256 takerFeePaid, // Amount of ZRX paid to feeRecipient by taker.\n bytes32 indexed orderHash, // EIP712 hash of order (see LibOrder.getOrderHash).\n bytes makerAssetData, // Encoded data specific to makerAsset. \n bytes takerAssetData // Encoded data specific to takerAsset.\n );\n\n // Cancel event is emitted whenever an individual order is cancelled.\n event Cancel(\n address indexed makerAddress, // Address that created the order. \n address indexed feeRecipientAddress, // Address that would have recieved fees if order was filled. \n address senderAddress, // Address that called the Exchange contract (msg.sender).\n bytes32 indexed orderHash, // EIP712 hash of order (see LibOrder.getOrderHash).\n bytes makerAssetData, // Encoded data specific to makerAsset. \n bytes takerAssetData // Encoded data specific to takerAsset.\n );\n\n // CancelUpTo event is emitted whenever `cancelOrdersUpTo` is executed succesfully.\n event CancelUpTo(\n address indexed makerAddress, // Orders cancelled must have been created by this address.\n address indexed senderAddress, // Orders cancelled must have a `senderAddress` equal to this address.\n uint256 orderEpoch // Orders with specified makerAddress and senderAddress with a salt less than this value are considered cancelled.\n );\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev After calling, the order can not be filled anymore.\n /// @param order Order struct containing order specifications.\n function cancelOrderInternal(LibOrder.Order memory order)\n internal;\n\n /// @dev Updates state with results of a fill order.\n /// @param order that was filled.\n /// @param takerAddress Address of taker who filled the order.\n /// @param orderTakerAssetFilledAmount Amount of order already filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function updateFilledState(\n LibOrder.Order memory order,\n address takerAddress,\n bytes32 orderHash,\n uint256 orderTakerAssetFilledAmount,\n LibFillResults.FillResults memory fillResults\n )\n internal;\n\n /// @dev Updates state with results of cancelling an order.\n /// State is only updated if the order is currently fillable.\n /// Otherwise, updating state would have no effect.\n /// @param order that was cancelled.\n /// @param orderHash Hash of order that was cancelled.\n function updateCancelledState(\n LibOrder.Order memory order,\n bytes32 orderHash\n )\n internal;\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAddress Address of order taker.\n /// @param signature Proof that the orders was created by its maker.\n function assertFillableOrder(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo,\n address takerAddress,\n bytes memory signature\n )\n internal\n view;\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo Status, orderHash, and amount already filled of order.\n /// @param takerAssetFillAmount Desired amount of order to fill by taker.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @param makerAssetFilledAmount Amount of makerAsset that will be transfered.\n function assertValidFill(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo,\n uint256 takerAssetFillAmount,\n uint256 takerAssetFilledAmount,\n uint256 makerAssetFilledAmount\n )\n internal\n view;\n\n /// @dev Validates context for cancelOrder. Succeeds or throws.\n /// @param order to be cancelled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n function assertValidCancel(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo\n )\n internal\n view;\n\n /// @dev Calculates amounts filled and fees paid by maker and taker.\n /// @param order to be filled.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function calculateFillResults(\n LibOrder.Order memory order,\n uint256 takerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.FillResults memory fillResults);\n\n}\n",
- "2.0.0/protocol/Exchange/mixins/MMatchOrders.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IMatchOrders.sol\";\n\n\ncontract MMatchOrders is\n IMatchOrders\n{\n /// @dev Validates context for matchOrders. Succeeds or throws.\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n function assertValidMatch(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder\n )\n internal\n pure;\n\n /// @dev Calculates fill amounts for the matched orders.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the leftOrder order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftOrderTakerAssetFilledAmount Amount of left order already filled.\n /// @param rightOrderTakerAssetFilledAmount Amount of right order already filled.\n /// @param matchedFillResults Amounts to fill and fees to pay by maker and taker of matched orders.\n function calculateMatchedFillResults(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n uint256 leftOrderTakerAssetFilledAmount,\n uint256 rightOrderTakerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.MatchedFillResults memory matchedFillResults);\n\n}\n",
- "2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/ISignatureValidator.sol\";\n\n\ncontract MSignatureValidator is\n ISignatureValidator\n{\n event SignatureValidatorApproval(\n address indexed signerAddress, // Address that approves or disapproves a contract to verify signatures.\n address indexed validatorAddress, // Address of signature validator contract.\n bool approved // Approval or disapproval of validator contract.\n );\n\n // Allowed signature types.\n enum SignatureType {\n Illegal, // 0x00, default value\n Invalid, // 0x01\n EIP712, // 0x02\n EthSign, // 0x03\n Wallet, // 0x04\n Validator, // 0x05\n PreSigned, // 0x06\n NSignatureTypes // 0x07, number of signature types. Always leave at end.\n }\n\n /// @dev Verifies signature using logic defined by Wallet contract.\n /// @param hash Any 32 byte hash.\n /// @param walletAddress Address that should have signed the given hash\n /// and defines its own signature verification method.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidWalletSignature(\n bytes32 hash,\n address walletAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid);\n\n /// @dev Verifies signature using logic defined by Validator contract.\n /// @param validatorAddress Address of validator contract.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidValidatorSignature(\n address validatorAddress,\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/mixins/MTransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\nimport \"../interfaces/ITransactions.sol\";\n\n\ncontract MTransactions is\n ITransactions\n{\n // Hash for the EIP712 ZeroEx Transaction Schema\n bytes32 constant internal EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"ZeroExTransaction(\",\n \"uint256 salt,\",\n \"address signerAddress,\",\n \"bytes data\",\n \")\"\n ));\n\n /// @dev Calculates EIP712 hash of the Transaction.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @return EIP712 hash of the Transaction.\n function hashZeroExTransaction(\n uint256 salt,\n address signerAddress,\n bytes memory data\n )\n internal\n pure\n returns (bytes32 result);\n\n /// @dev The current function will be called in the context of this address (either 0x transaction signer or `msg.sender`).\n /// If calling a fill function, this address will represent the taker.\n /// If calling a cancel function, this address will represent the maker.\n /// @return Signer of 0x transaction if entry point is `executeTransaction`.\n /// `msg.sender` if entry point is any other function.\n function getCurrentContextAddress()\n internal\n view\n returns (address);\n}\n",
- "2.0.0/protocol/Exchange/mixins/MWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IWrapperFunctions.sol\";\n\n\ncontract MWrapperFunctions is \n IWrapperFunctions\n{\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n}\n",
- "2.0.0/test/DummyERC20Token/DummyERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"../../tokens/ERC20Token/MintableERC20Token.sol\";\n\n\ncontract DummyERC20Token is \n Ownable,\n MintableERC20Token\n{\n string public name;\n string public symbol;\n uint256 public decimals;\n uint256 public constant MAX_MINT_AMOUNT = 10000000000000000000000;\n\n constructor (\n string _name,\n string _symbol,\n uint256 _decimals,\n uint256 _totalSupply\n )\n public\n {\n name = _name;\n symbol = _symbol;\n decimals = _decimals;\n _totalSupply = _totalSupply;\n balances[msg.sender] = _totalSupply;\n }\n\n /// @dev Sets the balance of target address\n /// @param _target Address or which balance will be updated\n /// @param _value New balance of target address\n function setBalance(address _target, uint256 _value)\n external\n onlyOwner\n {\n uint256 currBalance = balances[_target];\n if (_value < currBalance) {\n _totalSupply = safeSub(_totalSupply, safeSub(currBalance, _value));\n } else {\n _totalSupply = safeAdd(_totalSupply, safeSub(_value, currBalance));\n }\n balances[_target] = _value;\n }\n\n /// @dev Mints new tokens for sender\n /// @param _value Amount of tokens to mint\n function mint(uint256 _value)\n external\n {\n require(\n _value <= MAX_MINT_AMOUNT,\n \"VALUE_TOO_LARGE\"\n );\n\n _mint(msg.sender, _value);\n }\n}\n",
- "2.0.0/test/DummyERC721Token/DummyERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../tokens/ERC721Token/MintableERC721Token.sol\";\nimport \"../../utils/Ownable/Ownable.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract DummyERC721Token is\n Ownable,\n MintableERC721Token\n{\n string public name;\n string public symbol;\n\n constructor (\n string _name,\n string _symbol\n )\n public\n {\n name = _name;\n symbol = _symbol;\n }\n\n /// @dev Function to mint a new token\n /// Reverts if the given token ID already exists\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _tokenId ID of the token to be minted by the msg.sender \n function mint(address _to, uint256 _tokenId)\n external\n {\n _mint(_to, _tokenId);\n }\n\n /// @dev Function to burn a token\n /// Reverts if the given token ID doesn't exist or not called by contract owner\n /// @param _owner Owner of token with given token ID\n /// @param _tokenId ID of the token to be burned by the msg.sender\n function burn(address _owner, uint256 _tokenId)\n external\n onlyOwner\n {\n _burn(_owner, _tokenId);\n }\n}\n",
- "2.0.0/tokens/ERC20Token/ERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IERC20Token.sol\";\n\n\ncontract ERC20Token is\n IERC20Token\n{\n mapping (address => uint256) internal balances;\n mapping (address => mapping (address => uint256)) internal allowed;\n\n uint256 internal _totalSupply;\n\n /// @dev send `value` token to `to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transfer(address _to, uint256 _value)\n external\n returns (bool)\n {\n require(\n balances[msg.sender] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[msg.sender] -= _value;\n balances[_to] += _value;\n\n emit Transfer(\n msg.sender,\n _to,\n _value\n );\n\n return true;\n }\n\n /// @dev send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool)\n {\n require(\n balances[_from] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n allowed[_from][msg.sender] >= _value,\n \"ERC20_INSUFFICIENT_ALLOWANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[_to] += _value;\n balances[_from] -= _value;\n allowed[_from][msg.sender] -= _value;\n \n emit Transfer(\n _from,\n _to,\n _value\n );\n \n return true;\n }\n\n /// @dev `msg.sender` approves `_spender` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Always true if the call has enough gas to complete execution\n function approve(address _spender, uint256 _value)\n external\n returns (bool)\n {\n allowed[msg.sender][_spender] = _value;\n emit Approval(\n msg.sender,\n _spender,\n _value\n );\n return true;\n }\n\n /// @dev Query total supply of token\n /// @return Total supply of token\n function totalSupply()\n external\n view\n returns (uint256)\n {\n return _totalSupply;\n }\n\n /// @dev Query the balance of owner\n /// @param _owner The address from which the balance will be retrieved\n /// @return Balance of owner\n function balanceOf(address _owner)\n external\n view\n returns (uint256)\n {\n return balances[_owner];\n }\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender)\n external\n view\n returns (uint256)\n {\n return allowed[_owner][_spender];\n }\n}\n",
- "2.0.0/tokens/ERC20Token/IERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC20Token {\n\n // solhint-disable no-simple-event-func-name\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 _value\n );\n\n event Approval(\n address indexed _owner,\n address indexed _spender,\n uint256 _value\n );\n\n /// @dev send `value` token to `to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transfer(address _to, uint256 _value)\n external\n returns (bool);\n\n /// @dev send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool);\n \n /// @dev `msg.sender` approves `_spender` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Always true if the call has enough gas to complete execution\n function approve(address _spender, uint256 _value)\n external\n returns (bool);\n\n /// @dev Query total supply of token\n /// @return Total supply of token\n function totalSupply()\n external\n view\n returns (uint256);\n \n /// @param _owner The address from which the balance will be retrieved\n /// @return Balance of owner\n function balanceOf(address _owner)\n external\n view\n returns (uint256);\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender)\n external\n view\n returns (uint256);\n}\n",
- "2.0.0/tokens/ERC20Token/MintableERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/SafeMath/SafeMath.sol\";\nimport \"./UnlimitedAllowanceERC20Token.sol\";\n\n\ncontract MintableERC20Token is \n SafeMath,\n UnlimitedAllowanceERC20Token\n{\n /// @dev Mints new tokens\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _value Amount of tokens to mint\n function _mint(address _to, uint256 _value)\n internal\n {\n balances[_to] = safeAdd(_value, balances[_to]);\n _totalSupply = safeAdd(_totalSupply, _value);\n\n emit Transfer(\n address(0),\n _to,\n _value\n );\n }\n\n /// @dev Mints new tokens\n /// @param _owner Owner of tokens that will be burned\n /// @param _value Amount of tokens to burn\n function _burn(address _owner, uint256 _value)\n internal\n {\n balances[_owner] = safeSub(balances[_owner], _value);\n _totalSupply = safeSub(_totalSupply, _value);\n\n emit Transfer(\n _owner,\n address(0),\n _value\n );\n }\n}\n",
- "2.0.0/tokens/ERC20Token/UnlimitedAllowanceERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../ERC20Token/ERC20Token.sol\";\n\n\ncontract UnlimitedAllowanceERC20Token is\n ERC20Token\n{\n uint256 constant internal MAX_UINT = 2**256 - 1;\n\n /// @dev ERC20 transferFrom, modified such that an allowance of MAX_UINT represents an unlimited allowance. See https://github.com/ethereum/EIPs/issues/717\n /// @param _from Address to transfer from.\n /// @param _to Address to transfer to.\n /// @param _value Amount to transfer.\n /// @return Success of transfer.\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool)\n {\n uint256 allowance = allowed[_from][msg.sender];\n require(\n balances[_from] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n allowance >= _value,\n \"ERC20_INSUFFICIENT_ALLOWANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[_to] += _value;\n balances[_from] -= _value;\n if (allowance < MAX_UINT) {\n allowed[_from][msg.sender] -= _value;\n }\n\n emit Transfer(\n _from,\n _to,\n _value\n );\n\n return true;\n }\n}\n",
- "2.0.0/tokens/ERC721Token/ERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IERC721Token.sol\";\nimport \"./IERC721Receiver.sol\";\nimport \"../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract ERC721Token is\n IERC721Token,\n SafeMath\n{\n // Function selector for ERC721Receiver.onERC721Received\n // 0x150b7a02\n bytes4 constant internal ERC721_RECEIVED = bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"));\n\n // Mapping of tokenId => owner\n mapping (uint256 => address) internal owners;\n\n // Mapping of tokenId => approved address\n mapping (uint256 => address) internal approvals;\n\n // Mapping of owner => number of tokens owned\n mapping (address => uint256) internal balances;\n\n // Mapping of owner => operator => approved\n mapping (address => mapping (address => bool)) internal operatorApprovals;\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT. When transfer is complete, this function\n /// checks if `_to` is a smart contract (code size > 0). If so, it calls\n /// `onERC721Received` on `_to` and throws if the return value is not\n /// `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n /// @param _data Additional data with no specified format, sent in call to `_to`\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId,\n bytes _data\n )\n external\n {\n transferFrom(\n _from,\n _to,\n _tokenId\n );\n\n uint256 receiverCodeSize;\n assembly {\n receiverCodeSize := extcodesize(_to)\n }\n if (receiverCodeSize > 0) {\n bytes4 selector = IERC721Receiver(_to).onERC721Received(\n msg.sender,\n _from,\n _tokenId,\n _data\n );\n require(\n selector == ERC721_RECEIVED,\n \"ERC721_INVALID_SELECTOR\"\n );\n }\n }\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev This works identically to the other function with an extra data parameter,\n /// except this function just sets data to \"\".\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n external\n {\n transferFrom(\n _from,\n _to,\n _tokenId\n );\n\n uint256 receiverCodeSize;\n assembly {\n receiverCodeSize := extcodesize(_to)\n }\n if (receiverCodeSize > 0) {\n bytes4 selector = IERC721Receiver(_to).onERC721Received(\n msg.sender,\n _from,\n _tokenId,\n \"\"\n );\n require(\n selector == ERC721_RECEIVED,\n \"ERC721_INVALID_SELECTOR\"\n );\n }\n }\n\n /// @notice Change or reaffirm the approved address for an NFT\n /// @dev The zero address indicates there is no approved address.\n /// Throws unless `msg.sender` is the current NFT owner, or an authorized\n /// operator of the current owner.\n /// @param _approved The new approved NFT controller\n /// @param _tokenId The NFT to approve\n function approve(address _approved, uint256 _tokenId)\n external\n {\n address owner = ownerOf(_tokenId);\n require(\n msg.sender == owner || isApprovedForAll(owner, msg.sender),\n \"ERC721_INVALID_SENDER\"\n );\n\n approvals[_tokenId] = _approved;\n emit Approval(\n owner,\n _approved,\n _tokenId\n );\n }\n\n /// @notice Enable or disable approval for a third party (\"operator\") to manage\n /// all of `msg.sender`'s assets\n /// @dev Emits the ApprovalForAll event. The contract MUST allow\n /// multiple operators per owner.\n /// @param _operator Address to add to the set of authorized operators\n /// @param _approved True if the operator is approved, false to revoke approval\n function setApprovalForAll(address _operator, bool _approved)\n external\n {\n operatorApprovals[msg.sender][_operator] = _approved;\n emit ApprovalForAll(\n msg.sender,\n _operator,\n _approved\n );\n }\n \n /// @notice Count all NFTs assigned to an owner\n /// @dev NFTs assigned to the zero address are considered invalid, and this\n /// function throws for queries about the zero address.\n /// @param _owner An address for whom to query the balance\n /// @return The number of NFTs owned by `_owner`, possibly zero\n function balanceOf(address _owner)\n external\n view\n returns (uint256)\n {\n require(\n _owner != address(0),\n \"ERC721_ZERO_OWNER\"\n );\n return balances[_owner];\n }\n\n /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE\n /// TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE\n /// THEY MAY BE PERMANENTLY LOST\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function transferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n public\n {\n require(\n _to != address(0),\n \"ERC721_ZERO_TO_ADDRESS\"\n );\n\n address owner = ownerOf(_tokenId);\n require(\n _from == owner,\n \"ERC721_OWNER_MISMATCH\"\n );\n\n address spender = msg.sender;\n address approvedAddress = getApproved(_tokenId);\n require(\n spender == owner ||\n isApprovedForAll(owner, spender) ||\n approvedAddress == spender,\n \"ERC721_INVALID_SPENDER\"\n );\n\n if (approvedAddress != address(0)) {\n approvals[_tokenId] = address(0);\n }\n\n owners[_tokenId] = _to;\n balances[_from] = safeSub(balances[_from], 1);\n balances[_to] = safeAdd(balances[_to], 1);\n \n emit Transfer(\n _from,\n _to,\n _tokenId\n );\n }\n\n /// @notice Find the owner of an NFT\n /// @dev NFTs assigned to zero address are considered invalid, and queries\n /// about them do throw.\n /// @param _tokenId The identifier for an NFT\n /// @return The address of the owner of the NFT\n function ownerOf(uint256 _tokenId)\n public\n view\n returns (address)\n {\n address owner = owners[_tokenId];\n require(\n owner != address(0),\n \"ERC721_ZERO_OWNER\"\n );\n return owner;\n }\n\n /// @notice Get the approved address for a single NFT\n /// @dev Throws if `_tokenId` is not a valid NFT.\n /// @param _tokenId The NFT to find the approved address for\n /// @return The approved address for this NFT, or the zero address if there is none\n function getApproved(uint256 _tokenId)\n public\n view\n returns (address)\n {\n return approvals[_tokenId];\n }\n\n /// @notice Query if an address is an authorized operator for another address\n /// @param _owner The address that owns the NFTs\n /// @param _operator The address that acts on behalf of the owner\n /// @return True if `_operator` is an approved operator for `_owner`, false otherwise\n function isApprovedForAll(address _owner, address _operator)\n public\n view\n returns (bool)\n {\n return operatorApprovals[_owner][_operator];\n }\n}\n",
- "2.0.0/tokens/ERC721Token/IERC721Receiver.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC721Receiver {\n\n /// @notice Handle the receipt of an NFT\n /// @dev The ERC721 smart contract calls this function on the recipient\n /// after a `transfer`. This function MAY throw to revert and reject the\n /// transfer. Return of other than the magic value MUST result in the\n /// transaction being reverted.\n /// Note: the contract address is always the message sender.\n /// @param _operator The address which called `safeTransferFrom` function\n /// @param _from The address which previously owned the token\n /// @param _tokenId The NFT identifier which is being transferred\n /// @param _data Additional data with no specified format\n /// @return `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`\n /// unless throwing\n function onERC721Received(\n address _operator,\n address _from,\n uint256 _tokenId,\n bytes _data\n )\n external\n returns (bytes4);\n}\n",
- "2.0.0/tokens/ERC721Token/IERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC721Token {\n\n /// @dev This emits when ownership of any NFT changes by any mechanism.\n /// This event emits when NFTs are created (`from` == 0) and destroyed\n /// (`to` == 0). Exception: during contract creation, any number of NFTs\n /// may be created and assigned without emitting Transfer. At the time of\n /// any transfer, the approved address for that NFT (if any) is reset to none.\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 indexed _tokenId\n );\n\n /// @dev This emits when the approved address for an NFT is changed or\n /// reaffirmed. The zero address indicates there is no approved address.\n /// When a Transfer event emits, this also indicates that the approved\n /// address for that NFT (if any) is reset to none.\n event Approval(\n address indexed _owner,\n address indexed _approved,\n uint256 indexed _tokenId\n );\n\n /// @dev This emits when an operator is enabled or disabled for an owner.\n /// The operator can manage all NFTs of the owner.\n event ApprovalForAll(\n address indexed _owner,\n address indexed _operator,\n bool _approved\n );\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// perator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT. When transfer is complete, this function\n /// checks if `_to` is a smart contract (code size > 0). If so, it calls\n /// `onERC721Received` on `_to` and throws if the return value is not\n /// `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n /// @param _data Additional data with no specified format, sent in call to `_to`\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId,\n bytes _data\n )\n external;\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev This works identically to the other function with an extra data parameter,\n /// except this function just sets data to \"\".\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n external;\n\n /// @notice Change or reaffirm the approved address for an NFT\n /// @dev The zero address indicates there is no approved address.\n /// Throws unless `msg.sender` is the current NFT owner, or an authorized\n /// operator of the current owner.\n /// @param _approved The new approved NFT controller\n /// @param _tokenId The NFT to approve\n function approve(address _approved, uint256 _tokenId)\n external;\n\n /// @notice Enable or disable approval for a third party (\"operator\") to manage\n /// all of `msg.sender`'s assets\n /// @dev Emits the ApprovalForAll event. The contract MUST allow\n /// multiple operators per owner.\n /// @param _operator Address to add to the set of authorized operators\n /// @param _approved True if the operator is approved, false to revoke approval\n function setApprovalForAll(address _operator, bool _approved)\n external;\n\n /// @notice Count all NFTs assigned to an owner\n /// @dev NFTs assigned to the zero address are considered invalid, and this\n /// function throws for queries about the zero address.\n /// @param _owner An address for whom to query the balance\n /// @return The number of NFTs owned by `_owner`, possibly zero\n function balanceOf(address _owner)\n external\n view\n returns (uint256);\n\n /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE\n /// TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE\n /// THEY MAY BE PERMANENTLY LOST\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function transferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n public;\n\n /// @notice Find the owner of an NFT\n /// @dev NFTs assigned to zero address are considered invalid, and queries\n /// about them do throw.\n /// @param _tokenId The identifier for an NFT\n /// @return The address of the owner of the NFT\n function ownerOf(uint256 _tokenId)\n public\n view\n returns (address);\n\n /// @notice Get the approved address for a single NFT\n /// @dev Throws if `_tokenId` is not a valid NFT.\n /// @param _tokenId The NFT to find the approved address for\n /// @return The approved address for this NFT, or the zero address if there is none\n function getApproved(uint256 _tokenId) \n public\n view\n returns (address);\n \n /// @notice Query if an address is an authorized operator for another address\n /// @param _owner The address that owns the NFTs\n /// @param _operator The address that acts on behalf of the owner\n /// @return True if `_operator` is an approved operator for `_owner`, false otherwise\n function isApprovedForAll(address _owner, address _operator)\n public\n view\n returns (bool);\n}\n",
- "2.0.0/tokens/ERC721Token/MintableERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./ERC721Token.sol\";\n\n\ncontract MintableERC721Token is\n ERC721Token\n{\n /// @dev Function to mint a new token\n /// Reverts if the given token ID already exists\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _tokenId ID of the token to be minted by the msg.sender \n function _mint(address _to, uint256 _tokenId)\n internal\n {\n require(\n _to != address(0),\n \"ERC721_ZERO_TO_ADDRESS\"\n );\n\n address owner = owners[_tokenId];\n require(\n owner == address(0),\n \"ERC721_OWNER_ALREADY_EXISTS\"\n );\n\n owners[_tokenId] = _to;\n balances[_to] = safeAdd(balances[_to], 1);\n\n emit Transfer(\n address(0),\n _to,\n _tokenId\n );\n }\n\n /// @dev Function to burn a token\n /// Reverts if the given token ID doesn't exist\n /// @param _owner Owner of token with given token ID\n /// @param _tokenId ID of the token to be burned by the msg.sender\n function _burn(address _owner, uint256 _tokenId)\n internal\n {\n require(\n _owner != address(0),\n \"ERC721_ZERO_OWNER_ADDRESS\"\n );\n\n address owner = owners[_tokenId];\n require(\n owner == _owner,\n \"ERC721_OWNER_MISMATCH\"\n );\n\n owners[_tokenId] = address(0);\n balances[_owner] = safeSub(balances[_owner], 1);\n\n emit Transfer(\n _owner,\n address(0),\n _tokenId\n );\n }\n}\n",
- "2.0.0/tokens/EtherToken/IEtherToken.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../ERC20Token/IERC20Token.sol\";\n\n\ncontract IEtherToken is\n IERC20Token\n{\n function deposit()\n public\n payable;\n \n function withdraw(uint256 amount)\n public;\n}\n",
- "2.0.0/utils/LibBytes/LibBytes.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\nlibrary LibBytes {\n\n using LibBytes for bytes;\n\n /// @dev Gets the memory address for a byte array.\n /// @param input Byte array to lookup.\n /// @return memoryAddress Memory address of byte array. This\n /// points to the header of the byte array which contains\n /// the length.\n function rawAddress(bytes memory input)\n internal\n pure\n returns (uint256 memoryAddress)\n {\n assembly {\n memoryAddress := input\n }\n return memoryAddress;\n }\n \n /// @dev Gets the memory address for the contents of a byte array.\n /// @param input Byte array to lookup.\n /// @return memoryAddress Memory address of the contents of the byte array.\n function contentAddress(bytes memory input)\n internal\n pure\n returns (uint256 memoryAddress)\n {\n assembly {\n memoryAddress := add(input, 32)\n }\n return memoryAddress;\n }\n\n /// @dev Copies `length` bytes from memory location `source` to `dest`.\n /// @param dest memory address to copy bytes to.\n /// @param source memory address to copy bytes from.\n /// @param length number of bytes to copy.\n function memCopy(\n uint256 dest,\n uint256 source,\n uint256 length\n )\n internal\n pure\n {\n if (length < 32) {\n // Handle a partial word by reading destination and masking\n // off the bits we are interested in.\n // This correctly handles overlap, zero lengths and source == dest\n assembly {\n let mask := sub(exp(256, sub(32, length)), 1)\n let s := and(mload(source), not(mask))\n let d := and(mload(dest), mask)\n mstore(dest, or(s, d))\n }\n } else {\n // Skip the O(length) loop when source == dest.\n if (source == dest) {\n return;\n }\n\n // For large copies we copy whole words at a time. The final\n // word is aligned to the end of the range (instead of after the\n // previous) to handle partial words. So a copy will look like this:\n //\n // ####\n // ####\n // ####\n // ####\n //\n // We handle overlap in the source and destination range by\n // changing the copying direction. This prevents us from\n // overwriting parts of source that we still need to copy.\n //\n // This correctly handles source == dest\n //\n if (source > dest) {\n assembly {\n // We subtract 32 from `sEnd` and `dEnd` because it\n // is easier to compare with in the loop, and these\n // are also the addresses we need for copying the\n // last bytes.\n length := sub(length, 32)\n let sEnd := add(source, length)\n let dEnd := add(dest, length)\n\n // Remember the last 32 bytes of source\n // This needs to be done here and not after the loop\n // because we may have overwritten the last bytes in\n // source already due to overlap.\n let last := mload(sEnd)\n\n // Copy whole words front to back\n // Note: the first check is always true,\n // this could have been a do-while loop.\n // solhint-disable-next-line no-empty-blocks\n for {} lt(source, sEnd) {} {\n mstore(dest, mload(source))\n source := add(source, 32)\n dest := add(dest, 32)\n }\n \n // Write the last 32 bytes\n mstore(dEnd, last)\n }\n } else {\n assembly {\n // We subtract 32 from `sEnd` and `dEnd` because those\n // are the starting points when copying a word at the end.\n length := sub(length, 32)\n let sEnd := add(source, length)\n let dEnd := add(dest, length)\n\n // Remember the first 32 bytes of source\n // This needs to be done here and not after the loop\n // because we may have overwritten the first bytes in\n // source already due to overlap.\n let first := mload(source)\n\n // Copy whole words back to front\n // We use a signed comparisson here to allow dEnd to become\n // negative (happens when source and dest < 32). Valid\n // addresses in local memory will never be larger than\n // 2**255, so they can be safely re-interpreted as signed.\n // Note: the first check is always true,\n // this could have been a do-while loop.\n // solhint-disable-next-line no-empty-blocks\n for {} slt(dest, dEnd) {} {\n mstore(dEnd, mload(sEnd))\n sEnd := sub(sEnd, 32)\n dEnd := sub(dEnd, 32)\n }\n \n // Write the first 32 bytes\n mstore(dest, first)\n }\n }\n }\n }\n\n /// @dev Returns a slices from a byte array.\n /// @param b The byte array to take a slice from.\n /// @param from The starting index for the slice (inclusive).\n /// @param to The final index for the slice (exclusive).\n /// @return result The slice containing bytes at indices [from, to)\n function slice(\n bytes memory b,\n uint256 from,\n uint256 to\n )\n internal\n pure\n returns (bytes memory result)\n {\n require(\n from <= to,\n \"FROM_LESS_THAN_TO_REQUIRED\"\n );\n require(\n to < b.length,\n \"TO_LESS_THAN_LENGTH_REQUIRED\"\n );\n \n // Create a new bytes structure and copy contents\n result = new bytes(to - from);\n memCopy(\n result.contentAddress(),\n b.contentAddress() + from,\n result.length\n );\n return result;\n }\n \n /// @dev Returns a slice from a byte array without preserving the input.\n /// @param b The byte array to take a slice from. Will be destroyed in the process.\n /// @param from The starting index for the slice (inclusive).\n /// @param to The final index for the slice (exclusive).\n /// @return result The slice containing bytes at indices [from, to)\n /// @dev When `from == 0`, the original array will match the slice. In other cases its state will be corrupted.\n function sliceDestructive(\n bytes memory b,\n uint256 from,\n uint256 to\n )\n internal\n pure\n returns (bytes memory result)\n {\n require(\n from <= to,\n \"FROM_LESS_THAN_TO_REQUIRED\"\n );\n require(\n to < b.length,\n \"TO_LESS_THAN_LENGTH_REQUIRED\"\n );\n \n // Create a new bytes structure around [from, to) in-place.\n assembly {\n result := add(b, from)\n mstore(result, sub(to, from))\n }\n return result;\n }\n\n /// @dev Pops the last byte off of a byte array by modifying its length.\n /// @param b Byte array that will be modified.\n /// @return The byte that was popped off.\n function popLastByte(bytes memory b)\n internal\n pure\n returns (bytes1 result)\n {\n require(\n b.length > 0,\n \"GREATER_THAN_ZERO_LENGTH_REQUIRED\"\n );\n\n // Store last byte.\n result = b[b.length - 1];\n\n assembly {\n // Decrement length of byte array.\n let newLen := sub(mload(b), 1)\n mstore(b, newLen)\n }\n return result;\n }\n\n /// @dev Pops the last 20 bytes off of a byte array by modifying its length.\n /// @param b Byte array that will be modified.\n /// @return The 20 byte address that was popped off.\n function popLast20Bytes(bytes memory b)\n internal\n pure\n returns (address result)\n {\n require(\n b.length >= 20,\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Store last 20 bytes.\n result = readAddress(b, b.length - 20);\n\n assembly {\n // Subtract 20 from byte array length.\n let newLen := sub(mload(b), 20)\n mstore(b, newLen)\n }\n return result;\n }\n\n /// @dev Tests equality of two byte arrays.\n /// @param lhs First byte array to compare.\n /// @param rhs Second byte array to compare.\n /// @return True if arrays are the same. False otherwise.\n function equals(\n bytes memory lhs,\n bytes memory rhs\n )\n internal\n pure\n returns (bool equal)\n {\n // Keccak gas cost is 30 + numWords * 6. This is a cheap way to compare.\n // We early exit on unequal lengths, but keccak would also correctly\n // handle this.\n return lhs.length == rhs.length && keccak256(lhs) == keccak256(rhs);\n }\n\n /// @dev Reads an address from a position in a byte array.\n /// @param b Byte array containing an address.\n /// @param index Index in byte array of address.\n /// @return address from byte array.\n function readAddress(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (address result)\n {\n require(\n b.length >= index + 20, // 20 is length of address\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Add offset to index:\n // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)\n // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)\n index += 20;\n\n // Read address from array memory\n assembly {\n // 1. Add index to address of bytes array\n // 2. Load 32-byte word from memory\n // 3. Apply 20-byte mask to obtain address\n result := and(mload(add(b, index)), 0xffffffffffffffffffffffffffffffffffffffff)\n }\n return result;\n }\n\n /// @dev Writes an address into a specific position in a byte array.\n /// @param b Byte array to insert address into.\n /// @param index Index in byte array of address.\n /// @param input Address to put into byte array.\n function writeAddress(\n bytes memory b,\n uint256 index,\n address input\n )\n internal\n pure\n {\n require(\n b.length >= index + 20, // 20 is length of address\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Add offset to index:\n // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)\n // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)\n index += 20;\n\n // Store address into array memory\n assembly {\n // The address occupies 20 bytes and mstore stores 32 bytes.\n // First fetch the 32-byte word where we'll be storing the address, then\n // apply a mask so we have only the bytes in the word that the address will not occupy.\n // Then combine these bytes with the address and store the 32 bytes back to memory with mstore.\n\n // 1. Add index to address of bytes array\n // 2. Load 32-byte word from memory\n // 3. Apply 12-byte mask to obtain extra bytes occupying word of memory where we'll store the address\n let neighbors := and(\n mload(add(b, index)),\n 0xffffffffffffffffffffffff0000000000000000000000000000000000000000\n )\n \n // Make sure input address is clean.\n // (Solidity does not guarantee this)\n input := and(input, 0xffffffffffffffffffffffffffffffffffffffff)\n\n // Store the neighbors and address into memory\n mstore(add(b, index), xor(input, neighbors))\n }\n }\n\n /// @dev Reads a bytes32 value from a position in a byte array.\n /// @param b Byte array containing a bytes32 value.\n /// @param index Index in byte array of bytes32 value.\n /// @return bytes32 value from byte array.\n function readBytes32(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes32 result)\n {\n require(\n b.length >= index + 32,\n \"GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 256 bit length parameter\n index += 32;\n\n // Read the bytes32 from array memory\n assembly {\n result := mload(add(b, index))\n }\n return result;\n }\n\n /// @dev Writes a bytes32 into a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input bytes32 to put into byte array.\n function writeBytes32(\n bytes memory b,\n uint256 index,\n bytes32 input\n )\n internal\n pure\n {\n require(\n b.length >= index + 32,\n \"GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 256 bit length parameter\n index += 32;\n\n // Read the bytes32 from array memory\n assembly {\n mstore(add(b, index), input)\n }\n }\n\n /// @dev Reads a uint256 value from a position in a byte array.\n /// @param b Byte array containing a uint256 value.\n /// @param index Index in byte array of uint256 value.\n /// @return uint256 value from byte array.\n function readUint256(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (uint256 result)\n {\n result = uint256(readBytes32(b, index));\n return result;\n }\n\n /// @dev Writes a uint256 into a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input uint256 to put into byte array.\n function writeUint256(\n bytes memory b,\n uint256 index,\n uint256 input\n )\n internal\n pure\n {\n writeBytes32(b, index, bytes32(input));\n }\n\n /// @dev Reads an unpadded bytes4 value from a position in a byte array.\n /// @param b Byte array containing a bytes4 value.\n /// @param index Index in byte array of bytes4 value.\n /// @return bytes4 value from byte array.\n function readBytes4(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes4 result)\n {\n require(\n b.length >= index + 4,\n \"GREATER_OR_EQUAL_TO_4_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 32 byte length field\n index += 32;\n\n // Read the bytes4 from array memory\n assembly {\n result := mload(add(b, index))\n // Solidity does not require us to clean the trailing bytes.\n // We do it anyway\n result := and(result, 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000)\n }\n return result;\n }\n\n /// @dev Reads nested bytes from a specific position.\n /// @dev NOTE: the returned value overlaps with the input value.\n /// Both should be treated as immutable.\n /// @param b Byte array containing nested bytes.\n /// @param index Index of nested bytes.\n /// @return result Nested bytes.\n function readBytesWithLength(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes memory result)\n {\n // Read length of nested bytes\n uint256 nestedBytesLength = readUint256(b, index);\n index += 32;\n\n // Assert length of <b> is valid, given\n // length of nested bytes\n require(\n b.length >= index + nestedBytesLength,\n \"GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED\"\n );\n \n // Return a pointer to the byte array as it exists inside `b`\n assembly {\n result := add(b, index)\n }\n return result;\n }\n\n /// @dev Inserts bytes at a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input bytes to insert.\n function writeBytesWithLength(\n bytes memory b,\n uint256 index,\n bytes memory input\n )\n internal\n pure\n {\n // Assert length of <b> is valid, given\n // length of input\n require(\n b.length >= index + 32 + input.length, // 32 bytes to store length\n \"GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED\"\n );\n\n // Copy <input> into <b>\n memCopy(\n b.contentAddress() + index,\n input.rawAddress(), // includes length of <input>\n input.length + 32 // +32 bytes to store <input> length\n );\n }\n\n /// @dev Performs a deep copy of a byte array onto another byte array of greater than or equal length.\n /// @param dest Byte array that will be overwritten with source bytes.\n /// @param source Byte array to copy onto dest bytes.\n function deepCopyBytes(\n bytes memory dest,\n bytes memory source\n )\n internal\n pure\n {\n uint256 sourceLen = source.length;\n // Dest length must be >= source length, or some bytes would not be copied.\n require(\n dest.length >= sourceLen,\n \"GREATER_OR_EQUAL_TO_SOURCE_BYTES_LENGTH_REQUIRED\"\n );\n memCopy(\n dest.contentAddress(),\n source.contentAddress(),\n sourceLen\n );\n }\n}\n",
- "2.0.0/utils/Ownable/IOwnable.sol": "pragma solidity 0.4.24;\n\n\ncontract IOwnable {\n\n function transferOwnership(address newOwner)\n public;\n}\n",
- "2.0.0/utils/Ownable/Ownable.sol": "pragma solidity 0.4.24;\n\nimport \"./IOwnable.sol\";\n\n\ncontract Ownable is\n IOwnable\n{\n address public owner;\n\n constructor ()\n public\n {\n owner = msg.sender;\n }\n\n modifier onlyOwner() {\n require(\n msg.sender == owner,\n \"ONLY_CONTRACT_OWNER\"\n );\n _;\n }\n\n function transferOwnership(address newOwner)\n public\n onlyOwner\n {\n if (newOwner != address(0)) {\n owner = newOwner;\n }\n }\n}\n",
- "2.0.0/utils/ReentrancyGuard/ReentrancyGuard.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract ReentrancyGuard {\n\n // Locked state of mutex\n bool private locked = false;\n\n /// @dev Functions with this modifer cannot be reentered. The mutex will be locked\n /// before function execution and unlocked after.\n modifier nonReentrant() {\n // Ensure mutex is unlocked\n require(\n !locked,\n \"REENTRANCY_ILLEGAL\"\n );\n\n // Lock mutex before function call\n locked = true;\n\n // Perform function call\n _;\n\n // Unlock mutex after function call\n locked = false;\n }\n}\n",
- "2.0.0/utils/SafeMath/SafeMath.sol": "pragma solidity 0.4.24;\n\n\ncontract SafeMath {\n\n function safeMul(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n if (a == 0) {\n return 0;\n }\n uint256 c = a * b;\n require(\n c / a == b,\n \"UINT256_OVERFLOW\"\n );\n return c;\n }\n\n function safeDiv(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n uint256 c = a / b;\n return c;\n }\n\n function safeSub(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n require(\n b <= a,\n \"UINT256_UNDERFLOW\"\n );\n return a - b;\n }\n\n function safeAdd(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n uint256 c = a + b;\n require(\n c >= a,\n \"UINT256_OVERFLOW\"\n );\n return c;\n }\n\n function max64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n\n function max256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n}\n"
- },
- "sourceTreeHashHex": "0x95729ff69e872a60a92c7eef28cea3188d821ab1a379a46c12b21fc386a9855c",
- "compiler": {
- "name": "solc",
- "version": "soljson-v0.4.24+commit.e67f0147.js",
- "settings": {
- "optimizer": {
- "enabled": true,
- "runs": 1000000
- },
- "outputSelection": {
- "*": {
- "*": [
- "abi",
- "evm.bytecode.object",
- "evm.bytecode.sourceMap",
- "evm.deployedBytecode.object",
- "evm.deployedBytecode.sourceMap"
- ]
- }
- }
- }
- },
- "networks": {
- "3": {
- "address": "0x90431a90516ab49af23a0530e04e8c7836e7122f",
- "links": {},
- "constructorArgs": "[\"0x4530c0483a1633c7a1c97d2c53721caff2caaaaf\",\"0xf47261b0000000000000000000000000ff67881f8d12f372d91baae9752eb3631ff0ed00\"]"
- },
- "42": {
- "address": "0xb389da3d204b412df2f75c6afb3d0a7ce0bc283d",
- "links": {},
- "constructorArgs": "[\"0x35dd2932454449b14cee11a94d3674a936d5d7b2\",\"0xf47261b00000000000000000000000002002d3812f58e35f0ea1ffbf80a75a38c32175fa\"]"
- },
- "50": {
- "address": "0xe86bb98fcf9bff3512c74589b78fb168200cc546",
- "links": {},
- "constructorArgs": "[\"0x48bacb9266a570d521063ef5dd96e61686dbe788\",\"0xf47261b0000000000000000000000000871dd7c2b4b25e1aa18728e9d5f2af4c4e431f5c\"]"
- }
- }
-} \ No newline at end of file
diff --git a/packages/migrations/artifacts/2.0.0-testnet/WETH9.json b/packages/migrations/artifacts/2.0.0-testnet/WETH9.json
deleted file mode 100644
index 8cca84e41..000000000
--- a/packages/migrations/artifacts/2.0.0-testnet/WETH9.json
+++ /dev/null
@@ -1,346 +0,0 @@
-{
- "schemaVersion": "2.0.0",
- "contractName": "WETH9",
- "compilerOutput": {
- "abi": [
- {
- "constant": true,
- "inputs": [],
- "name": "name",
- "outputs": [
- {
- "name": "",
- "type": "string"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "guy",
- "type": "address"
- },
- {
- "name": "wad",
- "type": "uint256"
- }
- ],
- "name": "approve",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "totalSupply",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "src",
- "type": "address"
- },
- {
- "name": "dst",
- "type": "address"
- },
- {
- "name": "wad",
- "type": "uint256"
- }
- ],
- "name": "transferFrom",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "wad",
- "type": "uint256"
- }
- ],
- "name": "withdraw",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "decimals",
- "outputs": [
- {
- "name": "",
- "type": "uint8"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "",
- "type": "address"
- }
- ],
- "name": "balanceOf",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "symbol",
- "outputs": [
- {
- "name": "",
- "type": "string"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "dst",
- "type": "address"
- },
- {
- "name": "wad",
- "type": "uint256"
- }
- ],
- "name": "transfer",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [],
- "name": "deposit",
- "outputs": [],
- "payable": true,
- "stateMutability": "payable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "",
- "type": "address"
- },
- {
- "name": "",
- "type": "address"
- }
- ],
- "name": "allowance",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "payable": true,
- "stateMutability": "payable",
- "type": "fallback"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "_owner",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "_spender",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "Approval",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "_from",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "_to",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "Transfer",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "_owner",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "Deposit",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "_owner",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "Withdrawal",
- "type": "event"
- }
- ],
- "evm": {
- "bytecode": {
- "linkReferences": {},
- "object": "0x60c0604052600d60808190527f577261707065642045746865720000000000000000000000000000000000000060a090815261003e91600091906100a3565b506040805180820190915260048082527f57455448000000000000000000000000000000000000000000000000000000006020909201918252610083916001916100a3565b506002805460ff1916601217905534801561009d57600080fd5b5061013e565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106100e457805160ff1916838001178555610111565b82800160010185558215610111579182015b828111156101115782518255916020019190600101906100f6565b5061011d929150610121565b5090565b61013b91905b8082111561011d5760008155600101610127565b90565b6107688061014d6000396000f3006080604052600436106100ae5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100b8578063095ea7b31461014257806318160ddd1461018757806323b872dd146101ae5780632e1a7d4d146101e5578063313ce567146101fd57806370a082311461022857806395d89b4114610256578063a9059cbb1461026b578063d0e30db0146100ae578063dd62ed3e1461029c575b6100b66102d0565b005b3480156100c457600080fd5b506100cd61031f565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101075781810151838201526020016100ef565b50505050905090810190601f1680156101345780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561014e57600080fd5b5061017373ffffffffffffffffffffffffffffffffffffffff600435166024356103cb565b604080519115158252519081900360200190f35b34801561019357600080fd5b5061019c61043e565b60408051918252519081900360200190f35b3480156101ba57600080fd5b5061017373ffffffffffffffffffffffffffffffffffffffff60043581169060243516604435610443565b3480156101f157600080fd5b506100b66004356105e3565b34801561020957600080fd5b50610212610678565b6040805160ff9092168252519081900360200190f35b34801561023457600080fd5b5061019c73ffffffffffffffffffffffffffffffffffffffff60043516610681565b34801561026257600080fd5b506100cd610693565b34801561027757600080fd5b5061017373ffffffffffffffffffffffffffffffffffffffff6004351660243561070b565b3480156102a857600080fd5b5061019c73ffffffffffffffffffffffffffffffffffffffff6004358116906024351661071f565b33600081815260036020908152604091829020805434908101909155825190815291517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9281900390910190a2565b6000805460408051602060026001851615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f810184900484028201840190925281815292918301828280156103c35780601f10610398576101008083540402835291602001916103c3565b820191906000526020600020905b8154815290600101906020018083116103a657829003601f168201915b505050505081565b33600081815260046020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b303190565b73ffffffffffffffffffffffffffffffffffffffff831660009081526003602052604081205482111561047557600080fd5b73ffffffffffffffffffffffffffffffffffffffff841633148015906104eb575073ffffffffffffffffffffffffffffffffffffffff841660009081526004602090815260408083203384529091529020547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14155b156105655773ffffffffffffffffffffffffffffffffffffffff8416600090815260046020908152604080832033845290915290205482111561052d57600080fd5b73ffffffffffffffffffffffffffffffffffffffff841660009081526004602090815260408083203384529091529020805483900390555b73ffffffffffffffffffffffffffffffffffffffff808516600081815260036020908152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35060019392505050565b336000908152600360205260409020548111156105ff57600080fd5b33600081815260036020526040808220805485900390555183156108fc0291849190818181858888f1935050505015801561063e573d6000803e3d6000fd5b5060408051828152905133917f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65919081900360200190a250565b60025460ff1681565b60036020526000908152604090205481565b60018054604080516020600284861615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f810184900484028201840190925281815292918301828280156103c35780601f10610398576101008083540402835291602001916103c3565b6000610718338484610443565b9392505050565b6004602090815260009283526040808420909152908252902054815600a165627a7a72305820228981f11f47ad9630080069b0a81423fcfba5aa8e0f478a579c4bc080ba7e820029",
- "opcodes": "PUSH1 0xC0 PUSH1 0x40 MSTORE PUSH1 0xD PUSH1 0x80 DUP2 SWAP1 MSTORE PUSH32 0x5772617070656420457468657200000000000000000000000000000000000000 PUSH1 0xA0 SWAP1 DUP2 MSTORE PUSH2 0x3E SWAP2 PUSH1 0x0 SWAP2 SWAP1 PUSH2 0xA3 JUMP JUMPDEST POP PUSH1 0x40 DUP1 MLOAD DUP1 DUP3 ADD SWAP1 SWAP2 MSTORE PUSH1 0x4 DUP1 DUP3 MSTORE PUSH32 0x5745544800000000000000000000000000000000000000000000000000000000 PUSH1 0x20 SWAP1 SWAP3 ADD SWAP2 DUP3 MSTORE PUSH2 0x83 SWAP2 PUSH1 0x1 SWAP2 PUSH2 0xA3 JUMP JUMPDEST POP PUSH1 0x2 DUP1 SLOAD PUSH1 0xFF NOT AND PUSH1 0x12 OR SWAP1 SSTORE CALLVALUE DUP1 ISZERO PUSH2 0x9D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x13E JUMP JUMPDEST DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 PUSH1 0x1F ADD PUSH1 0x20 SWAP1 DIV DUP2 ADD SWAP3 DUP3 PUSH1 0x1F LT PUSH2 0xE4 JUMPI DUP1 MLOAD PUSH1 0xFF NOT AND DUP4 DUP1 ADD OR DUP6 SSTORE PUSH2 0x111 JUMP JUMPDEST DUP3 DUP1 ADD PUSH1 0x1 ADD DUP6 SSTORE DUP3 ISZERO PUSH2 0x111 JUMPI SWAP2 DUP3 ADD JUMPDEST DUP3 DUP2 GT ISZERO PUSH2 0x111 JUMPI DUP3 MLOAD DUP3 SSTORE SWAP2 PUSH1 0x20 ADD SWAP2 SWAP1 PUSH1 0x1 ADD SWAP1 PUSH2 0xF6 JUMP JUMPDEST POP PUSH2 0x11D SWAP3 SWAP2 POP PUSH2 0x121 JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST PUSH2 0x13B SWAP2 SWAP1 JUMPDEST DUP1 DUP3 GT ISZERO PUSH2 0x11D JUMPI PUSH1 0x0 DUP2 SSTORE PUSH1 0x1 ADD PUSH2 0x127 JUMP JUMPDEST SWAP1 JUMP JUMPDEST PUSH2 0x768 DUP1 PUSH2 0x14D PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN STOP PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0xAE JUMPI PUSH4 0xFFFFFFFF PUSH29 0x100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD DIV AND PUSH4 0x6FDDE03 DUP2 EQ PUSH2 0xB8 JUMPI DUP1 PUSH4 0x95EA7B3 EQ PUSH2 0x142 JUMPI DUP1 PUSH4 0x18160DDD EQ PUSH2 0x187 JUMPI DUP1 PUSH4 0x23B872DD EQ PUSH2 0x1AE JUMPI DUP1 PUSH4 0x2E1A7D4D EQ PUSH2 0x1E5 JUMPI DUP1 PUSH4 0x313CE567 EQ PUSH2 0x1FD JUMPI DUP1 PUSH4 0x70A08231 EQ PUSH2 0x228 JUMPI DUP1 PUSH4 0x95D89B41 EQ PUSH2 0x256 JUMPI DUP1 PUSH4 0xA9059CBB EQ PUSH2 0x26B JUMPI DUP1 PUSH4 0xD0E30DB0 EQ PUSH2 0xAE JUMPI DUP1 PUSH4 0xDD62ED3E EQ PUSH2 0x29C JUMPI JUMPDEST PUSH2 0xB6 PUSH2 0x2D0 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xC4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xCD PUSH2 0x31F JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 DUP1 DUP3 MSTORE DUP4 MLOAD DUP2 DUP4 ADD MSTORE DUP4 MLOAD SWAP2 SWAP3 DUP4 SWAP3 SWAP1 DUP4 ADD SWAP2 DUP6 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x107 JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH2 0xEF JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x134 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x14E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x173 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x3CB JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 ISZERO ISZERO DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x193 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19C PUSH2 0x43E JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1BA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x173 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH1 0x44 CALLDATALOAD PUSH2 0x443 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1F1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xB6 PUSH1 0x4 CALLDATALOAD PUSH2 0x5E3 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x209 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x212 PUSH2 0x678 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0xFF SWAP1 SWAP3 AND DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x234 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19C PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x681 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x262 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xCD PUSH2 0x693 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x277 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x173 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x70B JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2A8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19C PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH2 0x71F JUMP JUMPDEST CALLER PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x3 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP2 DUP3 SWAP1 KECCAK256 DUP1 SLOAD CALLVALUE SWAP1 DUP2 ADD SWAP1 SWAP2 SSTORE DUP3 MLOAD SWAP1 DUP2 MSTORE SWAP2 MLOAD PUSH32 0xE1FFFCC4923D04B559F4D29A8BFC6CDA04EB5B0D3C460751C2402C5C5CC9109C SWAP3 DUP2 SWAP1 SUB SWAP1 SWAP2 ADD SWAP1 LOG2 JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 PUSH1 0x2 PUSH1 0x1 DUP6 AND ISZERO PUSH2 0x100 MUL PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 SWAP5 AND SWAP4 SWAP1 SWAP4 DIV PUSH1 0x1F DUP2 ADD DUP5 SWAP1 DIV DUP5 MUL DUP3 ADD DUP5 ADD SWAP1 SWAP3 MSTORE DUP2 DUP2 MSTORE SWAP3 SWAP2 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0x3C3 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x398 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x3C3 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x3A6 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP DUP2 JUMP JUMPDEST CALLER PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x4 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 AND DUP1 DUP6 MSTORE SWAP1 DUP4 MSTORE DUP2 DUP5 KECCAK256 DUP7 SWAP1 SSTORE DUP2 MLOAD DUP7 DUP2 MSTORE SWAP2 MLOAD SWAP4 SWAP5 SWAP1 SWAP4 SWAP1 SWAP3 PUSH32 0x8C5BE1E5EBEC7D5BD14F71427D1E84F3DD0314C0F7B2291E5B200AC8C7C3B925 SWAP3 DUP3 SWAP1 SUB ADD SWAP1 LOG3 POP PUSH1 0x1 SWAP3 SWAP2 POP POP JUMP JUMPDEST ADDRESS BALANCE SWAP1 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x3 PUSH1 0x20 MSTORE PUSH1 0x40 DUP2 KECCAK256 SLOAD DUP3 GT ISZERO PUSH2 0x475 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND CALLER EQ DUP1 ISZERO SWAP1 PUSH2 0x4EB JUMPI POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x4 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 CALLER DUP5 MSTORE SWAP1 SWAP2 MSTORE SWAP1 KECCAK256 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF EQ ISZERO JUMPDEST ISZERO PUSH2 0x565 JUMPI PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x4 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 CALLER DUP5 MSTORE SWAP1 SWAP2 MSTORE SWAP1 KECCAK256 SLOAD DUP3 GT ISZERO PUSH2 0x52D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x4 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 CALLER DUP5 MSTORE SWAP1 SWAP2 MSTORE SWAP1 KECCAK256 DUP1 SLOAD DUP4 SWAP1 SUB SWAP1 SSTORE JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP6 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x3 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 DUP1 SLOAD DUP9 SWAP1 SUB SWAP1 SSTORE SWAP4 DUP8 AND DUP1 DUP4 MSTORE SWAP2 DUP5 SWAP1 KECCAK256 DUP1 SLOAD DUP8 ADD SWAP1 SSTORE DUP4 MLOAD DUP7 DUP2 MSTORE SWAP4 MLOAD SWAP2 SWAP4 PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF SWAP3 SWAP1 DUP2 SWAP1 SUB SWAP1 SWAP2 ADD SWAP1 LOG3 POP PUSH1 0x1 SWAP4 SWAP3 POP POP POP JUMP JUMPDEST CALLER PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x3 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP2 GT ISZERO PUSH2 0x5FF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST CALLER PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x3 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 DUP1 SLOAD DUP6 SWAP1 SUB SWAP1 SSTORE MLOAD DUP4 ISZERO PUSH2 0x8FC MUL SWAP2 DUP5 SWAP2 SWAP1 DUP2 DUP2 DUP2 DUP6 DUP9 DUP9 CALL SWAP4 POP POP POP POP ISZERO DUP1 ISZERO PUSH2 0x63E JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP PUSH1 0x40 DUP1 MLOAD DUP3 DUP2 MSTORE SWAP1 MLOAD CALLER SWAP2 PUSH32 0x7FCF532C15F0A6DB0BD6D0E038BEA71D30D808C7D98CB3BF7268A95BF5081B65 SWAP2 SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 LOG2 POP JUMP JUMPDEST PUSH1 0x2 SLOAD PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH1 0x3 PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x1 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 PUSH1 0x2 DUP5 DUP7 AND ISZERO PUSH2 0x100 MUL PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 SWAP5 AND SWAP4 SWAP1 SWAP4 DIV PUSH1 0x1F DUP2 ADD DUP5 SWAP1 DIV DUP5 MUL DUP3 ADD DUP5 ADD SWAP1 SWAP3 MSTORE DUP2 DUP2 MSTORE SWAP3 SWAP2 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0x3C3 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x398 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x3C3 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x718 CALLER DUP5 DUP5 PUSH2 0x443 JUMP JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x4 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x0 SWAP3 DUP4 MSTORE PUSH1 0x40 DUP1 DUP5 KECCAK256 SWAP1 SWAP2 MSTORE SWAP1 DUP3 MSTORE SWAP1 KECCAK256 SLOAD DUP2 JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 0x22 DUP10 DUP2 CALL 0x1f 0x47 0xad SWAP7 ADDRESS ADDMOD STOP PUSH10 0xB0A81423FCFBA5AA8E0F 0x47 DUP11 JUMPI SWAP13 0x4b 0xc0 DUP1 0xba PUSH31 0x82002900000000000000000000000000000000000000000000000000000000 ",
- "sourceMap": "753:40:0:-;732:1806;753:40;;732:1806;753:40;;;;;;;;;;-1:-1:-1;;753:40:0;;:::i;:::-;-1:-1:-1;799:31:0;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;836:27:0;;;-1:-1:-1;;836:27:0;861:2;836:27;;;732:1806;5:2:-1;;;;30:1;27;20:12;5:2;732:1806:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;732:1806:0;;;-1:-1:-1;732:1806:0;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;"
- },
- "deployedBytecode": {
- "linkReferences": {},
- "object": "0x6080604052600436106100ae5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100b8578063095ea7b31461014257806318160ddd1461018757806323b872dd146101ae5780632e1a7d4d146101e5578063313ce567146101fd57806370a082311461022857806395d89b4114610256578063a9059cbb1461026b578063d0e30db0146100ae578063dd62ed3e1461029c575b6100b66102d0565b005b3480156100c457600080fd5b506100cd61031f565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101075781810151838201526020016100ef565b50505050905090810190601f1680156101345780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561014e57600080fd5b5061017373ffffffffffffffffffffffffffffffffffffffff600435166024356103cb565b604080519115158252519081900360200190f35b34801561019357600080fd5b5061019c61043e565b60408051918252519081900360200190f35b3480156101ba57600080fd5b5061017373ffffffffffffffffffffffffffffffffffffffff60043581169060243516604435610443565b3480156101f157600080fd5b506100b66004356105e3565b34801561020957600080fd5b50610212610678565b6040805160ff9092168252519081900360200190f35b34801561023457600080fd5b5061019c73ffffffffffffffffffffffffffffffffffffffff60043516610681565b34801561026257600080fd5b506100cd610693565b34801561027757600080fd5b5061017373ffffffffffffffffffffffffffffffffffffffff6004351660243561070b565b3480156102a857600080fd5b5061019c73ffffffffffffffffffffffffffffffffffffffff6004358116906024351661071f565b33600081815260036020908152604091829020805434908101909155825190815291517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9281900390910190a2565b6000805460408051602060026001851615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f810184900484028201840190925281815292918301828280156103c35780601f10610398576101008083540402835291602001916103c3565b820191906000526020600020905b8154815290600101906020018083116103a657829003601f168201915b505050505081565b33600081815260046020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b303190565b73ffffffffffffffffffffffffffffffffffffffff831660009081526003602052604081205482111561047557600080fd5b73ffffffffffffffffffffffffffffffffffffffff841633148015906104eb575073ffffffffffffffffffffffffffffffffffffffff841660009081526004602090815260408083203384529091529020547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14155b156105655773ffffffffffffffffffffffffffffffffffffffff8416600090815260046020908152604080832033845290915290205482111561052d57600080fd5b73ffffffffffffffffffffffffffffffffffffffff841660009081526004602090815260408083203384529091529020805483900390555b73ffffffffffffffffffffffffffffffffffffffff808516600081815260036020908152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35060019392505050565b336000908152600360205260409020548111156105ff57600080fd5b33600081815260036020526040808220805485900390555183156108fc0291849190818181858888f1935050505015801561063e573d6000803e3d6000fd5b5060408051828152905133917f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65919081900360200190a250565b60025460ff1681565b60036020526000908152604090205481565b60018054604080516020600284861615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f810184900484028201840190925281815292918301828280156103c35780601f10610398576101008083540402835291602001916103c3565b6000610718338484610443565b9392505050565b6004602090815260009283526040808420909152908252902054815600a165627a7a72305820228981f11f47ad9630080069b0a81423fcfba5aa8e0f478a579c4bc080ba7e820029",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0xAE JUMPI PUSH4 0xFFFFFFFF PUSH29 0x100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD DIV AND PUSH4 0x6FDDE03 DUP2 EQ PUSH2 0xB8 JUMPI DUP1 PUSH4 0x95EA7B3 EQ PUSH2 0x142 JUMPI DUP1 PUSH4 0x18160DDD EQ PUSH2 0x187 JUMPI DUP1 PUSH4 0x23B872DD EQ PUSH2 0x1AE JUMPI DUP1 PUSH4 0x2E1A7D4D EQ PUSH2 0x1E5 JUMPI DUP1 PUSH4 0x313CE567 EQ PUSH2 0x1FD JUMPI DUP1 PUSH4 0x70A08231 EQ PUSH2 0x228 JUMPI DUP1 PUSH4 0x95D89B41 EQ PUSH2 0x256 JUMPI DUP1 PUSH4 0xA9059CBB EQ PUSH2 0x26B JUMPI DUP1 PUSH4 0xD0E30DB0 EQ PUSH2 0xAE JUMPI DUP1 PUSH4 0xDD62ED3E EQ PUSH2 0x29C JUMPI JUMPDEST PUSH2 0xB6 PUSH2 0x2D0 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xC4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xCD PUSH2 0x31F JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 DUP1 DUP3 MSTORE DUP4 MLOAD DUP2 DUP4 ADD MSTORE DUP4 MLOAD SWAP2 SWAP3 DUP4 SWAP3 SWAP1 DUP4 ADD SWAP2 DUP6 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x107 JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH2 0xEF JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x134 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x14E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x173 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x3CB JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 ISZERO ISZERO DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x193 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19C PUSH2 0x43E JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1BA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x173 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH1 0x44 CALLDATALOAD PUSH2 0x443 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1F1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xB6 PUSH1 0x4 CALLDATALOAD PUSH2 0x5E3 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x209 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x212 PUSH2 0x678 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0xFF SWAP1 SWAP3 AND DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x234 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19C PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x681 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x262 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xCD PUSH2 0x693 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x277 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x173 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x70B JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2A8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19C PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH2 0x71F JUMP JUMPDEST CALLER PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x3 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP2 DUP3 SWAP1 KECCAK256 DUP1 SLOAD CALLVALUE SWAP1 DUP2 ADD SWAP1 SWAP2 SSTORE DUP3 MLOAD SWAP1 DUP2 MSTORE SWAP2 MLOAD PUSH32 0xE1FFFCC4923D04B559F4D29A8BFC6CDA04EB5B0D3C460751C2402C5C5CC9109C SWAP3 DUP2 SWAP1 SUB SWAP1 SWAP2 ADD SWAP1 LOG2 JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 PUSH1 0x2 PUSH1 0x1 DUP6 AND ISZERO PUSH2 0x100 MUL PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 SWAP5 AND SWAP4 SWAP1 SWAP4 DIV PUSH1 0x1F DUP2 ADD DUP5 SWAP1 DIV DUP5 MUL DUP3 ADD DUP5 ADD SWAP1 SWAP3 MSTORE DUP2 DUP2 MSTORE SWAP3 SWAP2 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0x3C3 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x398 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x3C3 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x3A6 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP DUP2 JUMP JUMPDEST CALLER PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x4 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 AND DUP1 DUP6 MSTORE SWAP1 DUP4 MSTORE DUP2 DUP5 KECCAK256 DUP7 SWAP1 SSTORE DUP2 MLOAD DUP7 DUP2 MSTORE SWAP2 MLOAD SWAP4 SWAP5 SWAP1 SWAP4 SWAP1 SWAP3 PUSH32 0x8C5BE1E5EBEC7D5BD14F71427D1E84F3DD0314C0F7B2291E5B200AC8C7C3B925 SWAP3 DUP3 SWAP1 SUB ADD SWAP1 LOG3 POP PUSH1 0x1 SWAP3 SWAP2 POP POP JUMP JUMPDEST ADDRESS BALANCE SWAP1 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x3 PUSH1 0x20 MSTORE PUSH1 0x40 DUP2 KECCAK256 SLOAD DUP3 GT ISZERO PUSH2 0x475 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND CALLER EQ DUP1 ISZERO SWAP1 PUSH2 0x4EB JUMPI POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x4 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 CALLER DUP5 MSTORE SWAP1 SWAP2 MSTORE SWAP1 KECCAK256 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF EQ ISZERO JUMPDEST ISZERO PUSH2 0x565 JUMPI PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x4 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 CALLER DUP5 MSTORE SWAP1 SWAP2 MSTORE SWAP1 KECCAK256 SLOAD DUP3 GT ISZERO PUSH2 0x52D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x4 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 CALLER DUP5 MSTORE SWAP1 SWAP2 MSTORE SWAP1 KECCAK256 DUP1 SLOAD DUP4 SWAP1 SUB SWAP1 SSTORE JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP6 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x3 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 DUP1 SLOAD DUP9 SWAP1 SUB SWAP1 SSTORE SWAP4 DUP8 AND DUP1 DUP4 MSTORE SWAP2 DUP5 SWAP1 KECCAK256 DUP1 SLOAD DUP8 ADD SWAP1 SSTORE DUP4 MLOAD DUP7 DUP2 MSTORE SWAP4 MLOAD SWAP2 SWAP4 PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF SWAP3 SWAP1 DUP2 SWAP1 SUB SWAP1 SWAP2 ADD SWAP1 LOG3 POP PUSH1 0x1 SWAP4 SWAP3 POP POP POP JUMP JUMPDEST CALLER PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x3 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP2 GT ISZERO PUSH2 0x5FF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST CALLER PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x3 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 DUP1 SLOAD DUP6 SWAP1 SUB SWAP1 SSTORE MLOAD DUP4 ISZERO PUSH2 0x8FC MUL SWAP2 DUP5 SWAP2 SWAP1 DUP2 DUP2 DUP2 DUP6 DUP9 DUP9 CALL SWAP4 POP POP POP POP ISZERO DUP1 ISZERO PUSH2 0x63E JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP PUSH1 0x40 DUP1 MLOAD DUP3 DUP2 MSTORE SWAP1 MLOAD CALLER SWAP2 PUSH32 0x7FCF532C15F0A6DB0BD6D0E038BEA71D30D808C7D98CB3BF7268A95BF5081B65 SWAP2 SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 LOG2 POP JUMP JUMPDEST PUSH1 0x2 SLOAD PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH1 0x3 PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x1 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 PUSH1 0x2 DUP5 DUP7 AND ISZERO PUSH2 0x100 MUL PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 SWAP5 AND SWAP4 SWAP1 SWAP4 DIV PUSH1 0x1F DUP2 ADD DUP5 SWAP1 DIV DUP5 MUL DUP3 ADD DUP5 ADD SWAP1 SWAP3 MSTORE DUP2 DUP2 MSTORE SWAP3 SWAP2 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0x3C3 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x398 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x3C3 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x718 CALLER DUP5 DUP5 PUSH2 0x443 JUMP JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x4 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x0 SWAP3 DUP4 MSTORE PUSH1 0x40 DUP1 DUP5 KECCAK256 SWAP1 SWAP2 MSTORE SWAP1 DUP3 MSTORE SWAP1 KECCAK256 SLOAD DUP2 JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 0x22 DUP10 DUP2 CALL 0x1f 0x47 0xad SWAP7 ADDRESS ADDMOD STOP PUSH10 0xB0A81423FCFBA5AA8E0F 0x47 DUP11 JUMPI SWAP13 0x4b 0xc0 DUP1 0xba PUSH31 0x82002900000000000000000000000000000000000000000000000000000000 ",
- "sourceMap": "732:1806:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1329:9;:7;:9::i;:::-;732:1806;753:40;;8:9:-1;5:2;;;30:1;27;20:12;5:2;753:40:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:100:-1;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;753:40:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1776:172;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1776:172:0;;;;;;;;;;;;;;;;;;;;;;;;;;;1684:86;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1684:86:0;;;;;;;;;;;;;;;;;;;;2081:455;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2081:455:0;;;;;;;;;;;;;;1480:198;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1480:198:0;;;;;836:27;;8:9:-1;5:2;;;30:1;27;20:12;5:2;836:27:0;;;;;;;;;;;;;;;;;;;;;;;1150:65;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1150:65:0;;;;;;;799:31;;8:9:-1;5:2;;;30:1;27;20:12;5:2;799:31:0;;;;1954:121;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1954:121:0;;;;;;;;;1221:65;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1221:65:0;;;;;;;;;;;;1350:125;1404:10;1394:21;;;;:9;:21;;;;;;;;;:34;;1419:9;1394:34;;;;;;1438:30;;;;;;;;;;;;;;;;;1350:125::o;753:40::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;1776:172::-;1858:10;1832:4;1848:21;;;:9;:21;;;;;;;;;:26;;;;;;;;;;;:32;;;1890:30;;;;;;;1832:4;;1848:26;;1858:10;;1890:30;;;;;;;;-1:-1:-1;1937:4:0;1776:172;;;;:::o;1684:86::-;1751:4;:12;1684:86;:::o;2081:455::-;2199:14;;;2171:4;2199:14;;;:9;:14;;;;;;:21;-1:-1:-1;2199:21:0;2191:30;;;;;;2236:17;;;2243:10;2236:17;;;;:59;;-1:-1:-1;2257:14:0;;;;;;;:9;:14;;;;;;;;2272:10;2257:26;;;;;;;;2292:2;2257:38;;2236:59;2232:179;;;2319:14;;;;;;;:9;:14;;;;;;;;2334:10;2319:26;;;;;;;;:33;-1:-1:-1;2319:33:0;2311:42;;;;;;2367:14;;;;;;;:9;:14;;;;;;;;2382:10;2367:26;;;;;;;:33;;;;;;;2232:179;2421:14;;;;;;;;:9;:14;;;;;;;;:21;;;;;;;2452:14;;;;;;;;;;:21;;;;;;2484:23;;;;;;;2452:14;;2484:23;;;;;;;;;;;-1:-1:-1;2525:4:0;2081:455;;;;;:::o;1480:198::-;1543:10;1533:21;;;;:9;:21;;;;;;:28;-1:-1:-1;1533:28:0;1525:37;;;;;;1582:10;1572:21;;;;:9;:21;;;;;;:28;;;;;;;1610:24;;;;;;1597:3;;1610:24;;1572:21;1610:24;1597:3;1582:10;1610:24;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;-1:-1;1644:27:0;;;;;;;;1655:10;;1644:27;;;;;;;;;;1480:198;:::o;836:27::-;;;;;;:::o;1150:65::-;;;;;;;;;;;;;:::o;799:31::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1954:121;2011:4;2034:34;2047:10;2059:3;2064;2034:12;:34::i;:::-;2027:41;1954:121;-1:-1:-1;;;1954:121:0:o;1221:65::-;;;;;;;;;;;;;;;;;;;;;;;;:::o"
- }
- }
- },
- "sources": {
- "2.0.0/tokens/EtherToken/WETH9.sol": {
- "id": 0
- }
- },
- "sourceCodes": {
- "2.0.0/tokens/EtherToken/WETH9.sol": "// Copyright (C) 2015, 2016, 2017 Dapphub\n\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see <http://www.gnu.org/licenses/>.\n\n// solhint-disable\npragma solidity ^0.4.18;\n\n\ncontract WETH9 {\n string public name = \"Wrapped Ether\";\n string public symbol = \"WETH\";\n uint8 public decimals = 18;\n\n event Approval(address indexed _owner, address indexed _spender, uint _value);\n event Transfer(address indexed _from, address indexed _to, uint _value);\n event Deposit(address indexed _owner, uint _value);\n event Withdrawal(address indexed _owner, uint _value);\n\n mapping (address => uint) public balanceOf;\n mapping (address => mapping (address => uint)) public allowance;\n\n function() public payable {\n deposit();\n }\n function deposit() public payable {\n balanceOf[msg.sender] += msg.value;\n Deposit(msg.sender, msg.value);\n }\n function withdraw(uint wad) public {\n require(balanceOf[msg.sender] >= wad);\n balanceOf[msg.sender] -= wad;\n msg.sender.transfer(wad);\n Withdrawal(msg.sender, wad);\n }\n\n function totalSupply() public view returns (uint) {\n return this.balance;\n }\n\n function approve(address guy, uint wad) public returns (bool) {\n allowance[msg.sender][guy] = wad;\n Approval(msg.sender, guy, wad);\n return true;\n }\n\n function transfer(address dst, uint wad) public returns (bool) {\n return transferFrom(msg.sender, dst, wad);\n }\n\n function transferFrom(address src, address dst, uint wad)\n public\n returns (bool)\n {\n require(balanceOf[src] >= wad);\n\n if (src != msg.sender && allowance[src][msg.sender] != uint(-1)) {\n require(allowance[src][msg.sender] >= wad);\n allowance[src][msg.sender] -= wad;\n }\n\n balanceOf[src] -= wad;\n balanceOf[dst] += wad;\n\n Transfer(src, dst, wad);\n\n return true;\n }\n}\n\n\n/*\n GNU GENERAL PUBLIC LICENSE\n Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n Preamble\n\n The GNU General Public License is a free, copyleft license for\nsoftware and other kinds of works.\n\n The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works. By contrast,\nthe GNU General Public License is intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users. We, the Free Software Foundation, use the\nGNU General Public License for most of our software; it applies also to\nany other work released this way by its authors. You can apply it to\nyour programs, too.\n\n When we speak of free software, we are referring to freedom, not\nprice. Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n To protect your rights, we need to prevent others from denying you\nthese rights or asking you to surrender the rights. Therefore, you have\ncertain responsibilities if you distribute copies of the software, or if\nyou modify it: responsibilities to respect the freedom of others.\n\n For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must pass on to the recipients the same\nfreedoms that you received. You must make sure that they, too, receive\nor can get the source code. And you must show them these terms so they\nknow their rights.\n\n Developers that use the GNU GPL protect your rights with two steps:\n(1) assert copyright on the software, and (2) offer you this License\ngiving you legal permission to copy, distribute and/or modify it.\n\n For the developers' and authors' protection, the GPL clearly explains\nthat there is no warranty for this free software. For both users' and\nauthors' sake, the GPL requires that modified versions be marked as\nchanged, so that their problems will not be attributed erroneously to\nauthors of previous versions.\n\n Some devices are designed to deny users access to install or run\nmodified versions of the software inside them, although the manufacturer\ncan do so. This is fundamentally incompatible with the aim of\nprotecting users' freedom to change the software. The systematic\npattern of such abuse occurs in the area of products for individuals to\nuse, which is precisely where it is most unacceptable. Therefore, we\nhave designed this version of the GPL to prohibit the practice for those\nproducts. If such problems arise substantially in other domains, we\nstand ready to extend this provision to those domains in future versions\nof the GPL, as needed to protect the freedom of users.\n\n Finally, every program is threatened constantly by software patents.\nStates should not allow patents to restrict development and use of\nsoftware on general-purpose computers, but in those that do, we wish to\navoid the special danger that patents applied to a free program could\nmake it effectively proprietary. To prevent this, the GPL assures that\npatents cannot be used to render the program non-free.\n\n The precise terms and conditions for copying, distribution and\nmodification follow.\n\n TERMS AND CONDITIONS\n\n 0. Definitions.\n\n \"This License\" refers to version 3 of the GNU General Public License.\n\n \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n \"The Program\" refers to any copyrightable work licensed under this\nLicense. Each licensee is addressed as \"you\". \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy. The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy. Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies. Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License. If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n 1. Source Code.\n\n The \"source code\" for a work means the preferred form of the work\nfor making modifications to it. \"Object code\" means any non-source\nform of a work.\n\n A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form. A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities. However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work. For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n The Corresponding Source for a work in source code form is that\nsame work.\n\n 2. Basic Permissions.\n\n All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met. This License explicitly affirms your unlimited\npermission to run the unmodified Program. The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work. This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force. You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright. Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n Conveying under any other circumstances is permitted solely under\nthe conditions stated below. Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n 3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n 4. Conveying Verbatim Copies.\n\n You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n 5. Conveying Modified Source Versions.\n\n You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n a) The work must carry prominent notices stating that you modified\n it, and giving a relevant date.\n\n b) The work must carry prominent notices stating that it is\n released under this License and any conditions added under section\n 7. This requirement modifies the requirement in section 4 to\n \"keep intact all notices\".\n\n c) You must license the entire work, as a whole, under this\n License to anyone who comes into possession of a copy. This\n License will therefore apply, along with any applicable section 7\n additional terms, to the whole of the work, and all its parts,\n regardless of how they are packaged. This License gives no\n permission to license the work in any other way, but it does not\n invalidate such permission if you have separately received it.\n\n d) If the work has interactive user interfaces, each must display\n Appropriate Legal Notices; however, if the Program has interactive\n interfaces that do not display Appropriate Legal Notices, your\n work need not make them do so.\n\n A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit. Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n 6. Conveying Non-Source Forms.\n\n You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n a) Convey the object code in, or embodied in, a physical product\n (including a physical distribution medium), accompanied by the\n Corresponding Source fixed on a durable physical medium\n customarily used for software interchange.\n\n b) Convey the object code in, or embodied in, a physical product\n (including a physical distribution medium), accompanied by a\n written offer, valid for at least three years and valid for as\n long as you offer spare parts or customer support for that product\n model, to give anyone who possesses the object code either (1) a\n copy of the Corresponding Source for all the software in the\n product that is covered by this License, on a durable physical\n medium customarily used for software interchange, for a price no\n more than your reasonable cost of physically performing this\n conveying of source, or (2) access to copy the\n Corresponding Source from a network server at no charge.\n\n c) Convey individual copies of the object code with a copy of the\n written offer to provide the Corresponding Source. This\n alternative is allowed only occasionally and noncommercially, and\n only if you received the object code with such an offer, in accord\n with subsection 6b.\n\n d) Convey the object code by offering access from a designated\n place (gratis or for a charge), and offer equivalent access to the\n Corresponding Source in the same way through the same place at no\n further charge. You need not require recipients to copy the\n Corresponding Source along with the object code. If the place to\n copy the object code is a network server, the Corresponding Source\n may be on a different server (operated by you or a third party)\n that supports equivalent copying facilities, provided you maintain\n clear directions next to the object code saying where to find the\n Corresponding Source. Regardless of what server hosts the\n Corresponding Source, you remain obligated to ensure that it is\n available for as long as needed to satisfy these requirements.\n\n e) Convey the object code using peer-to-peer transmission, provided\n you inform other peers where the object code and Corresponding\n Source of the work are being offered to the general public at no\n charge under subsection 6d.\n\n A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling. In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage. For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product. A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source. The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information. But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed. Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n 7. Additional Terms.\n\n \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law. If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit. (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.) You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n a) Disclaiming warranty or limiting liability differently from the\n terms of sections 15 and 16 of this License; or\n\n b) Requiring preservation of specified reasonable legal notices or\n author attributions in that material or in the Appropriate Legal\n Notices displayed by works containing it; or\n\n c) Prohibiting misrepresentation of the origin of that material, or\n requiring that modified versions of such material be marked in\n reasonable ways as different from the original version; or\n\n d) Limiting the use for publicity purposes of names of licensors or\n authors of the material; or\n\n e) Declining to grant rights under trademark law for use of some\n trade names, trademarks, or service marks; or\n\n f) Requiring indemnification of licensors and authors of that\n material by anyone who conveys the material (or modified versions of\n it) with contractual assumptions of liability to the recipient, for\n any liability that these contractual assumptions directly impose on\n those licensors and authors.\n\n All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10. If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term. If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n 8. Termination.\n\n You may not propagate or modify a covered work except as expressly\nprovided under this License. Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License. If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n 9. Acceptance Not Required for Having Copies.\n\n You are not required to accept this License in order to receive or\nrun a copy of the Program. Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance. However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work. These actions infringe copyright if you do\nnot accept this License. Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n 10. Automatic Licensing of Downstream Recipients.\n\n Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License. You are not responsible\nfor enforcing compliance by third parties with this License.\n\n An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations. If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License. For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n 11. Patents.\n\n A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based. The\nwork thus licensed is called the contributor's \"contributor version\".\n\n A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version. For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement). To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients. \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License. You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n 12. No Surrender of Others' Freedom.\n\n If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License. If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all. For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n 13. Use with the GNU Affero General Public License.\n\n Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU Affero General Public License into a single\ncombined work, and to convey the resulting work. The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the special requirements of the GNU Affero General Public License,\nsection 13, concerning interaction through a network will apply to the\ncombination as such.\n\n 14. Revised Versions of this License.\n\n The Free Software Foundation may publish revised and/or new versions of\nthe GNU General Public License from time to time. Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n Each version is given a distinguishing version number. If the\nProgram specifies that a certain numbered version of the GNU General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation. If the Program does not specify a version number of the\nGNU General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n If the Program specifies that a proxy can decide which future\nversions of the GNU General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n Later license versions may give you additional or different\npermissions. However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n 15. Disclaimer of Warranty.\n\n THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n 16. Limitation of Liability.\n\n IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n 17. Interpretation of Sections 15 and 16.\n\n If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n END OF TERMS AND CONDITIONS\n\n How to Apply These Terms to Your New Programs\n\n If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n To do so, attach the following notices to the program. It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n <one line to give the program's name and a brief idea of what it does.>\n Copyright (C) <year> <name of author>\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program. If not, see <http://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n If the program does terminal interaction, make it output a short\nnotice like this when it starts in an interactive mode:\n\n <program> Copyright (C) <year> <name of author>\n This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n This is free software, and you are welcome to redistribute it\n under certain conditions; type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' should show the appropriate\nparts of the General Public License. Of course, your program's commands\nmight be different; for a GUI interface, you would use an \"about box\".\n\n You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU GPL, see\n<http://www.gnu.org/licenses/>.\n\n The GNU General Public License does not permit incorporating your program\ninto proprietary programs. If your program is a subroutine library, you\nmay consider it more useful to permit linking proprietary applications with\nthe library. If this is what you want to do, use the GNU Lesser General\nPublic License instead of this License. But first, please read\n<http://www.gnu.org/philosophy/why-not-lgpl.html>.\n\n*/\n"
- },
- "sourceTreeHashHex": "0x08a4125fbc1137215308db8e8f4c0774b2adbec12342172c17216bcaa6e596c6",
- "compiler": {
- "name": "solc",
- "version": "soljson-v0.4.24+commit.e67f0147.js",
- "settings": {
- "optimizer": {
- "enabled": true,
- "runs": 1000000
- },
- "outputSelection": {
- "*": {
- "*": [
- "abi",
- "evm.bytecode.object",
- "evm.bytecode.sourceMap",
- "evm.deployedBytecode.object",
- "evm.deployedBytecode.sourceMap"
- ]
- }
- }
- }
- },
- "networks": {
- "3": {
- "address": "0xc778417e063141139fce010982780140aa0cd5ab",
- "links": {},
- "constructorArgs": "[]"
- },
- "42": {
- "address": "0xd0a1e359811322d97991e03f863a0c30c2cf029c",
- "links": {},
- "constructorArgs": "[]"
- },
- "50": {
- "address": "0x0b1ba0af832d7c05fd64161e0db78e85978e8082",
- "links": {},
- "constructorArgs": "[]"
- }
- }
-}
diff --git a/packages/migrations/artifacts/2.0.0-testnet/ZRXToken.json b/packages/migrations/artifacts/2.0.0-testnet/ZRXToken.json
deleted file mode 100644
index 76ee77b34..000000000
--- a/packages/migrations/artifacts/2.0.0-testnet/ZRXToken.json
+++ /dev/null
@@ -1,10041 +0,0 @@
-{
- "schemaVersion": "2.0.0",
- "contractName": "ZRXToken",
- "compilerOutput": {
- "abi": [
- {
- "constant": true,
- "inputs": [],
- "name": "name",
- "outputs": [
- {
- "name": "",
- "type": "string"
- }
- ],
- "payable": false,
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_spender",
- "type": "address"
- },
- {
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "approve",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "totalSupply",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_from",
- "type": "address"
- },
- {
- "name": "_to",
- "type": "address"
- },
- {
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "transferFrom",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "decimals",
- "outputs": [
- {
- "name": "",
- "type": "uint8"
- }
- ],
- "payable": false,
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "_owner",
- "type": "address"
- }
- ],
- "name": "balanceOf",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "symbol",
- "outputs": [
- {
- "name": "",
- "type": "string"
- }
- ],
- "payable": false,
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_to",
- "type": "address"
- },
- {
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "transfer",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "_owner",
- "type": "address"
- },
- {
- "name": "_spender",
- "type": "address"
- }
- ],
- "name": "allowance",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "type": "function"
- },
- {
- "inputs": [],
- "payable": false,
- "type": "constructor"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "_from",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "_to",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "Transfer",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "_owner",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "_spender",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "Approval",
- "type": "event"
- }
- ],
- "devdoc": {
- "methods": {
- "transferFrom(address,address,uint256)": {
- "details": "ERC20 transferFrom, modified such that an allowance of MAX_UINT represents an unlimited allowance.",
- "params": {
- "_from": "Address to transfer from.",
- "_to": "Address to transfer to.",
- "_value": "Amount to transfer."
- },
- "return": "Success of transfer."
- }
- }
- },
- "evm": {
- "assembly": " /* \"2.0.0/tokens/ZRXToken/ZRXToken.sol\":795:1250 contract ZRXToken is ... */\n mstore(0x40, 0x60)\n /* \"2.0.0/tokens/ZRXToken/ZRXToken.sol\":966:972 10**27 */\n 0x33b2e3c9fd0803ce8000000\n /* \"2.0.0/tokens/ZRXToken/ZRXToken.sol\":937:972 uint256 public totalSupply = 10**27 */\n 0x3\n sstore\n /* \"2.0.0/tokens/ZRXToken/ZRXToken.sol\":1158:1248 function ZRXToken()... */\n jumpi(tag_1, iszero(callvalue))\n invalid\ntag_1:\ntag_2:\n /* \"2.0.0/tokens/ZRXToken/ZRXToken.sol\":1230:1241 totalSupply */\n sload(0x3)\n sub(exp(0x2, 0xa0), 0x1)\n /* \"2.0.0/tokens/ZRXToken/ZRXToken.sol\":1216:1226 msg.sender */\n caller\n /* \"2.0.0/tokens/ZRXToken/ZRXToken.sol\":1207:1227 balances[msg.sender] */\n and\n /* \"2.0.0/tokens/ZRXToken/ZRXToken.sol\":1207:1215 balances */\n 0x0\n /* \"2.0.0/tokens/ZRXToken/ZRXToken.sol\":1207:1227 balances[msg.sender] */\n swap1\n dup2\n mstore\n 0x20\n dup2\n swap1\n mstore\n 0x40\n swap1\n sha3\n /* \"2.0.0/tokens/ZRXToken/ZRXToken.sol\":1207:1241 balances[msg.sender] = totalSupply */\n sstore\n /* \"2.0.0/tokens/ZRXToken/ZRXToken.sol\":1158:1248 function ZRXToken()... */\ntag_3:\n /* \"2.0.0/tokens/ZRXToken/ZRXToken.sol\":795:1250 contract ZRXToken is ... */\ntag_4:\n dataSize(sub_0)\n dup1\n dataOffset(sub_0)\n 0x0\n codecopy\n 0x0\n return\nstop\n\nsub_0: assembly {\n /* \"2.0.0/tokens/ZRXToken/ZRXToken.sol\":795:1250 contract ZRXToken is ... */\n mstore(0x40, 0x60)\n jumpi(tag_1, iszero(calldatasize))\n and(div(calldataload(0x0), 0x100000000000000000000000000000000000000000000000000000000), 0xffffffff)\n 0x6fdde03\n dup2\n eq\n tag_2\n jumpi\n dup1\n 0x95ea7b3\n eq\n tag_3\n jumpi\n dup1\n 0x18160ddd\n eq\n tag_4\n jumpi\n dup1\n 0x23b872dd\n eq\n tag_5\n jumpi\n dup1\n 0x313ce567\n eq\n tag_6\n jumpi\n dup1\n 0x70a08231\n eq\n tag_7\n jumpi\n dup1\n 0x95d89b41\n eq\n tag_8\n jumpi\n dup1\n 0xa9059cbb\n eq\n tag_9\n jumpi\n dup1\n 0xdd62ed3e\n eq\n tag_10\n jumpi\n tag_1:\n invalid\n /* \"2.0.0/tokens/ZRXToken/ZRXToken.sol\":1017:1066 string constant public name = \"0x Protocol Token\" */\n tag_2:\n jumpi(tag_11, iszero(callvalue))\n invalid\n tag_11:\n tag_12\n jump(tag_13)\n tag_12:\n 0x40\n dup1\n mload\n 0x20\n dup1\n dup3\n mstore\n dup4\n mload\n dup2\n dup4\n add\n mstore\n dup4\n mload\n swap2\n swap3\n dup4\n swap3\n swap1\n dup4\n add\n swap2\n dup6\n add\n swap1\n dup1\n dup4\n dup4\n /* \"--CODEGEN--\":18:20 */\n dup3\n iszero\n /* \"--CODEGEN--\":13:16 */\n tag_14\n /* \"--CODEGEN--\":7:12 */\n jumpi\n /* \"--CODEGEN--\":32:37 */\n tag_15:\n /* \"--CODEGEN--\":59:62 */\n dup1\n /* \"--CODEGEN--\":53:58 */\n mload\n /* \"--CODEGEN--\":48:51 */\n dup3\n /* \"--CODEGEN--\":41:47 */\n mstore\n /* \"--CODEGEN--\":93:95 */\n 0x20\n /* \"--CODEGEN--\":88:91 */\n dup4\n /* \"--CODEGEN--\":85:87 */\n gt\n /* \"--CODEGEN--\":78:84 */\n iszero\n /* \"--CODEGEN--\":73:76 */\n tag_14\n /* \"--CODEGEN--\":67:72 */\n jumpi\n /* \"--CODEGEN--\":152:155 */\n 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0\n swap1\n swap3\n add\n swap2\n /* \"--CODEGEN--\":117:119 */\n 0x20\n /* \"--CODEGEN--\":108:111 */\n swap2\n dup3\n add\n swap2\n /* \"--CODEGEN--\":130:133 */\n add\n /* \"--CODEGEN--\":172:177 */\n tag_15\n /* \"--CODEGEN--\":167:171 */\n jump\n /* \"--CODEGEN--\":181:184 */\n tag_14:\n /* \"--CODEGEN--\":3:189 */\n pop\n pop\n pop\n swap1\n pop\n swap1\n dup2\n add\n swap1\n 0x1f\n and\n dup1\n iszero\n tag_16\n jumpi\n dup1\n dup3\n sub\n dup1\n mload\n 0x1\n dup4\n 0x20\n sub\n 0x100\n exp\n sub\n not\n and\n dup2\n mstore\n 0x20\n add\n swap2\n pop\n tag_16:\n pop\n swap3\n pop\n pop\n pop\n mload(0x40)\n dup1\n swap2\n sub\n swap1\n return\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1087:1274 */\n tag_3:\n jumpi(tag_17, iszero(callvalue))\n invalid\n tag_17:\n tag_18\n and(calldataload(0x4), 0xffffffffffffffffffffffffffffffffffffffff)\n calldataload(0x24)\n jump(tag_19)\n tag_18:\n 0x40\n dup1\n mload\n swap2\n iszero\n iszero\n dup3\n mstore\n mload\n swap1\n dup2\n swap1\n sub\n 0x20\n add\n swap1\n return\n /* \"2.0.0/tokens/ZRXToken/ZRXToken.sol\":937:972 uint256 public totalSupply = 10**27 */\n tag_4:\n jumpi(tag_20, iszero(callvalue))\n invalid\n tag_20:\n tag_21\n jump(tag_22)\n tag_21:\n 0x40\n dup1\n mload\n swap2\n dup3\n mstore\n mload\n swap1\n dup2\n swap1\n sub\n 0x20\n add\n swap1\n return\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1066:1675 */\n tag_5:\n jumpi(tag_23, iszero(callvalue))\n invalid\n tag_23:\n tag_18\n 0xffffffffffffffffffffffffffffffffffffffff\n calldataload(0x4)\n dup2\n and\n swap1\n calldataload(0x24)\n and\n calldataload(0x44)\n jump(tag_25)\n tag_24:\n 0x40\n dup1\n mload\n swap2\n iszero\n iszero\n dup3\n mstore\n mload\n swap1\n dup2\n swap1\n sub\n 0x20\n add\n swap1\n return\n /* \"2.0.0/tokens/ZRXToken/ZRXToken.sol\":896:931 uint8 constant public decimals = 18 */\n tag_6:\n jumpi(tag_26, iszero(callvalue))\n invalid\n tag_26:\n tag_27\n jump(tag_28)\n tag_27:\n 0x40\n dup1\n mload\n 0xff\n swap1\n swap3\n and\n dup3\n mstore\n mload\n swap1\n dup2\n swap1\n sub\n 0x20\n add\n swap1\n return\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":982:1081 */\n tag_7:\n jumpi(tag_29, iszero(callvalue))\n invalid\n tag_29:\n tag_21\n and(calldataload(0x4), 0xffffffffffffffffffffffffffffffffffffffff)\n jump(tag_31)\n tag_30:\n 0x40\n dup1\n mload\n swap2\n dup3\n mstore\n mload\n swap1\n dup2\n swap1\n sub\n 0x20\n add\n swap1\n return\n /* \"2.0.0/tokens/ZRXToken/ZRXToken.sol\":1072:1109 string constant public symbol = \"ZRX\" */\n tag_8:\n jumpi(tag_32, iszero(callvalue))\n invalid\n tag_32:\n tag_12\n jump(tag_34)\n tag_33:\n 0x40\n dup1\n mload\n 0x20\n dup1\n dup3\n mstore\n dup4\n mload\n dup2\n dup4\n add\n mstore\n dup4\n mload\n swap2\n swap3\n dup4\n swap3\n swap1\n dup4\n add\n swap2\n dup6\n add\n swap1\n dup1\n dup4\n dup4\n /* \"--CODEGEN--\":18:20 */\n dup3\n iszero\n /* \"--CODEGEN--\":13:16 */\n tag_14\n /* \"--CODEGEN--\":7:12 */\n jumpi\n /* \"--CODEGEN--\":32:37 */\n tag_36:\n /* \"--CODEGEN--\":59:62 */\n dup1\n /* \"--CODEGEN--\":53:58 */\n mload\n /* \"--CODEGEN--\":48:51 */\n dup3\n /* \"--CODEGEN--\":41:47 */\n mstore\n /* \"--CODEGEN--\":93:95 */\n 0x20\n /* \"--CODEGEN--\":88:91 */\n dup4\n /* \"--CODEGEN--\":85:87 */\n gt\n /* \"--CODEGEN--\":78:84 */\n iszero\n /* \"--CODEGEN--\":73:76 */\n tag_14\n /* \"--CODEGEN--\":67:72 */\n jumpi\n /* \"--CODEGEN--\":152:155 */\n 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0\n swap1\n swap3\n add\n swap2\n /* \"--CODEGEN--\":117:119 */\n 0x20\n /* \"--CODEGEN--\":108:111 */\n swap2\n dup3\n add\n swap2\n /* \"--CODEGEN--\":130:133 */\n add\n /* \"--CODEGEN--\":172:177 */\n tag_15\n /* \"--CODEGEN--\":167:171 */\n jump\n /* \"--CODEGEN--\":181:184 */\n tag_35:\n /* \"--CODEGEN--\":3:189 */\n pop\n pop\n pop\n swap1\n pop\n swap1\n dup2\n add\n swap1\n 0x1f\n and\n dup1\n iszero\n tag_16\n jumpi\n dup1\n dup3\n sub\n dup1\n mload\n 0x1\n dup4\n 0x20\n sub\n 0x100\n exp\n sub\n not\n and\n dup2\n mstore\n 0x20\n add\n swap2\n pop\n tag_37:\n pop\n swap3\n pop\n pop\n pop\n mload(0x40)\n dup1\n swap2\n sub\n swap1\n return\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":125:535 */\n tag_9:\n jumpi(tag_38, iszero(callvalue))\n invalid\n tag_38:\n tag_18\n and(calldataload(0x4), 0xffffffffffffffffffffffffffffffffffffffff)\n calldataload(0x24)\n jump(tag_40)\n tag_39:\n 0x40\n dup1\n mload\n swap2\n iszero\n iszero\n dup3\n mstore\n mload\n swap1\n dup2\n swap1\n sub\n 0x20\n add\n swap1\n return\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1280:1406 */\n tag_10:\n jumpi(tag_41, iszero(callvalue))\n invalid\n tag_41:\n tag_21\n 0xffffffffffffffffffffffffffffffffffffffff\n calldataload(0x4)\n dup2\n and\n swap1\n calldataload(0x24)\n and\n jump(tag_43)\n tag_42:\n 0x40\n dup1\n mload\n swap2\n dup3\n mstore\n mload\n swap1\n dup2\n swap1\n sub\n 0x20\n add\n swap1\n return\n /* \"2.0.0/tokens/ZRXToken/ZRXToken.sol\":1017:1066 string constant public name = \"0x Protocol Token\" */\n tag_13:\n 0x40\n dup1\n mload\n dup1\n dup3\n add\n swap1\n swap2\n mstore\n 0x11\n dup2\n mstore\n 0x30782050726f746f636f6c20546f6b656e000000000000000000000000000000\n 0x20\n dup3\n add\n mstore\n dup2\n jump\t// out\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1087:1274 */\n tag_19:\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1160:1179 */\n 0xffffffffffffffffffffffffffffffffffffffff\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1168:1178 */\n caller\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1160:1179 */\n dup2\n and\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1144:1148 */\n 0x0\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1160:1179 */\n dup2\n dup2\n mstore\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1160:1167 */\n 0x1\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1160:1179 */\n 0x20\n swap1\n dup2\n mstore\n 0x40\n dup1\n dup4\n sha3\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1160:1189 */\n swap5\n dup8\n and\n dup1\n dup5\n mstore\n swap5\n dup3\n mstore\n dup1\n dup4\n sha3\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1160:1198 */\n dup7\n swap1\n sstore\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1208:1246 */\n dup1\n mload\n dup7\n dup2\n mstore\n swap1\n mload\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1144:1148 */\n swap3\n swap5\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1160:1189 */\n swap4\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1160:1179 */\n swap3\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1208:1246 */\n 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925\n swap3\n swap2\n dup2\n swap1\n sub\n swap1\n swap2\n add\n swap1\n log3\n pop\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1263:1267 */\n 0x1\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1087:1274 */\n tag_44:\n swap3\n swap2\n pop\n pop\n jump\t// out\n /* \"2.0.0/tokens/ZRXToken/ZRXToken.sol\":937:972 uint256 public totalSupply = 10**27 */\n tag_22:\n sload(0x3)\n dup2\n jump\t// out\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1066:1675 */\n tag_25:\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1198:1212 */\n 0xffffffffffffffffffffffffffffffffffffffff\n dup1\n dup5\n and\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1161:1165 */\n 0x0\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1198:1212 */\n dup2\n dup2\n mstore\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1198:1205 */\n 0x1\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1198:1212 */\n 0x20\n swap1\n dup2\n mstore\n 0x40\n dup1\n dup4\n sha3\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1213:1223 */\n caller\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1198:1224 */\n swap1\n swap6\n and\n dup4\n mstore\n swap4\n dup2\n mstore\n dup4\n dup3\n sha3\n sload\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1238:1253 */\n swap3\n dup3\n mstore\n dup2\n swap1\n mstore\n swap2\n dup3\n sha3\n sload\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1238:1263 */\n dup4\n swap1\n lt\n dup1\n iszero\n swap1\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1238:1298 */\n tag_46\n jumpi\n pop\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1292:1298 */\n dup3\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1279:1288 */\n dup2\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1279:1298 */\n lt\n iszero\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1238:1298 */\n tag_46:\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1238:1353 */\n dup1\n iszero\n tag_47\n jumpi\n pop\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1340:1353 */\n 0xffffffffffffffffffffffffffffffffffffffff\n dup5\n and\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1340:1348 */\n 0x0\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1340:1353 */\n swap1\n dup2\n mstore\n 0x20\n dup2\n swap1\n mstore\n 0x40\n swap1\n sha3\n sload\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1314:1336 */\n dup4\n dup2\n add\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1314:1353 */\n lt\n iszero\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1238:1353 */\n tag_47:\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1234:1669 */\n iszero\n tag_48\n jumpi\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1378:1391 */\n 0xffffffffffffffffffffffffffffffffffffffff\n dup1\n dup6\n and\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1378:1386 */\n 0x0\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1378:1391 */\n swap1\n dup2\n mstore\n 0x20\n dup2\n swap1\n mstore\n 0x40\n dup1\n dup3\n sha3\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1378:1401 */\n dup1\n sload\n dup8\n add\n swap1\n sstore\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1415:1430 */\n swap2\n dup8\n and\n dup2\n mstore\n sha3\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1415:1440 */\n dup1\n sload\n dup5\n swap1\n sub\n swap1\n sstore\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":768:778 */\n 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1458:1478 */\n dup2\n lt\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1454:1549 */\n iszero\n tag_49\n jumpi\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1498:1512 */\n 0xffffffffffffffffffffffffffffffffffffffff\n dup1\n dup7\n and\n 0x0\n swap1\n dup2\n mstore\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1498:1505 */\n 0x1\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1498:1512 */\n 0x20\n swap1\n dup2\n mstore\n 0x40\n dup1\n dup4\n sha3\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1513:1523 */\n caller\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1498:1524 */\n swap1\n swap5\n and\n dup4\n mstore\n swap3\n swap1\n mstore\n sha3\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1498:1534 */\n dup1\n sload\n dup5\n swap1\n sub\n swap1\n sstore\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1454:1549 */\n tag_49:\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1578:1581 */\n dup4\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1562:1590 */\n 0xffffffffffffffffffffffffffffffffffffffff\n and\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1571:1576 */\n dup6\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1562:1590 */\n 0xffffffffffffffffffffffffffffffffffffffff\n and\n 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1583:1589 */\n dup6\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1562:1590 */\n mload(0x40)\n dup1\n dup3\n dup2\n mstore\n 0x20\n add\n swap2\n pop\n pop\n mload(0x40)\n dup1\n swap2\n sub\n swap1\n log3\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1611:1615 */\n 0x1\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1604:1615 */\n swap2\n pop\n jump(tag_50)\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1234:1669 */\n tag_48:\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1653:1658 */\n 0x0\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1646:1658 */\n swap2\n pop\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1234:1669 */\n tag_50:\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1066:1675 */\n tag_45:\n pop\n swap4\n swap3\n pop\n pop\n pop\n jump\t// out\n /* \"2.0.0/tokens/ZRXToken/ZRXToken.sol\":896:931 uint8 constant public decimals = 18 */\n tag_28:\n /* \"2.0.0/tokens/ZRXToken/ZRXToken.sol\":929:931 18 */\n 0x12\n /* \"2.0.0/tokens/ZRXToken/ZRXToken.sol\":896:931 uint8 constant public decimals = 18 */\n dup2\n jump\t// out\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":982:1081 */\n tag_31:\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1058:1074 */\n 0xffffffffffffffffffffffffffffffffffffffff\n dup2\n and\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1035:1039 */\n 0x0\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1058:1074 */\n swap1\n dup2\n mstore\n 0x20\n dup2\n swap1\n mstore\n 0x40\n swap1\n sha3\n sload\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":982:1081 */\n tag_51:\n swap2\n swap1\n pop\n jump\t// out\n /* \"2.0.0/tokens/ZRXToken/ZRXToken.sol\":1072:1109 string constant public symbol = \"ZRX\" */\n tag_34:\n 0x40\n dup1\n mload\n dup1\n dup3\n add\n swap1\n swap2\n mstore\n 0x3\n dup2\n mstore\n 0x5a52580000000000000000000000000000000000000000000000000000000000\n 0x20\n dup3\n add\n mstore\n dup2\n jump\t// out\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":125:535 */\n tag_40:\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":267:287 */\n 0xffffffffffffffffffffffffffffffffffffffff\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":276:286 */\n caller\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":267:287 */\n and\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":178:182 */\n 0x0\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":267:287 */\n swap1\n dup2\n mstore\n 0x20\n dup2\n swap1\n mstore\n 0x40\n dup2\n sha3\n sload\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":267:297 */\n dup3\n swap1\n lt\n dup1\n iszero\n swap1\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":267:340 */\n tag_53\n jumpi\n pop\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":327:340 */\n 0xffffffffffffffffffffffffffffffffffffffff\n dup4\n and\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":327:335 */\n 0x0\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":327:340 */\n swap1\n dup2\n mstore\n 0x20\n dup2\n swap1\n mstore\n 0x40\n swap1\n sha3\n sload\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":301:323 */\n dup3\n dup2\n add\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":301:340 */\n lt\n iszero\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":267:340 */\n tag_53:\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":263:529 */\n iszero\n tag_54\n jumpi\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":356:376 */\n 0xffffffffffffffffffffffffffffffffffffffff\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":365:375 */\n caller\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":356:376 */\n dup2\n and\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":356:364 */\n 0x0\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":356:376 */\n dup2\n dup2\n mstore\n 0x20\n dup2\n dup2\n mstore\n 0x40\n dup1\n dup4\n sha3\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":356:386 */\n dup1\n sload\n dup9\n swap1\n sub\n swap1\n sstore\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":400:413 */\n swap4\n dup8\n and\n dup1\n dup4\n mstore\n swap2\n dup5\n swap1\n sha3\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":400:423 */\n dup1\n sload\n dup8\n add\n swap1\n sstore\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":437:470 */\n dup4\n mload\n dup7\n dup2\n mstore\n swap4\n mload\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":400:413 */\n swap2\n swap4\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":437:470 */\n 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef\n swap3\n swap1\n dup2\n swap1\n sub\n swap1\n swap2\n add\n swap1\n log3\n pop\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":491:495 */\n 0x1\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":484:495 */\n jump(tag_44)\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":263:529 */\n tag_54:\n pop\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":521:526 */\n 0x0\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":514:526 */\n jump(tag_44)\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":263:529 */\n tag_55:\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":125:535 */\n tag_52:\n swap3\n swap2\n pop\n pop\n jump\t// out\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1280:1406 */\n tag_43:\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1374:1389 */\n 0xffffffffffffffffffffffffffffffffffffffff\n dup1\n dup4\n and\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1351:1355 */\n 0x0\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1374:1389 */\n swap1\n dup2\n mstore\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1374:1381 */\n 0x1\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1374:1389 */\n 0x20\n swap1\n dup2\n mstore\n 0x40\n dup1\n dup4\n sha3\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1374:1399 */\n swap4\n dup6\n and\n dup4\n mstore\n swap3\n swap1\n mstore\n sha3\n sload\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1280:1406 */\n tag_56:\n swap3\n swap2\n pop\n pop\n jump\t// out\n}\n",
- "bytecode": {
- "linkReferences": {},
- "object": "0x60606040526b033b2e3c9fd0803ce8000000600355341561001c57fe5b5b600354600160a060020a0333166000908152602081905260409020555b5b61078d8061004a6000396000f300606060405236156100965763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610098578063095ea7b31461014657806318160ddd1461018657806323b872dd146101a8578063313ce567146101ee57806370a082311461021457806395d89b411461024f578063a9059cbb146102fd578063dd62ed3e1461033d575bfe5b34156100a057fe5b6100a861037e565b60408051602080825283518183015283519192839290830191850190808383821561010c575b80518252602083111561010c577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016100ce565b505050905090810190601f1680156101385780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561014e57fe5b61017273ffffffffffffffffffffffffffffffffffffffff600435166024356103b5565b604080519115158252519081900360200190f35b341561018e57fe5b61019661042d565b60408051918252519081900360200190f35b34156101b057fe5b61017273ffffffffffffffffffffffffffffffffffffffff60043581169060243516604435610433565b604080519115158252519081900360200190f35b34156101f657fe5b6101fe6105d4565b6040805160ff9092168252519081900360200190f35b341561021c57fe5b61019673ffffffffffffffffffffffffffffffffffffffff600435166105d9565b60408051918252519081900360200190f35b341561025757fe5b6100a8610605565b60408051602080825283518183015283519192839290830191850190808383821561010c575b80518252602083111561010c577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016100ce565b505050905090810190601f1680156101385780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561030557fe5b61017273ffffffffffffffffffffffffffffffffffffffff6004351660243561063c565b604080519115158252519081900360200190f35b341561034557fe5b61019673ffffffffffffffffffffffffffffffffffffffff60043581169060243516610727565b60408051918252519081900360200190f35b60408051808201909152601181527f30782050726f746f636f6c20546f6b656e000000000000000000000000000000602082015281565b73ffffffffffffffffffffffffffffffffffffffff338116600081815260016020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b60035481565b73ffffffffffffffffffffffffffffffffffffffff808416600081815260016020908152604080832033909516835293815283822054928252819052918220548390108015906104835750828110155b80156104b6575073ffffffffffffffffffffffffffffffffffffffff841660009081526020819052604090205483810110155b156105c65773ffffffffffffffffffffffffffffffffffffffff808516600090815260208190526040808220805487019055918716815220805484900390557fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8110156105585773ffffffffffffffffffffffffffffffffffffffff808616600090815260016020908152604080832033909416835292905220805484900390555b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191506105cb565b600091505b5b509392505050565b601281565b73ffffffffffffffffffffffffffffffffffffffff81166000908152602081905260409020545b919050565b60408051808201909152600381527f5a52580000000000000000000000000000000000000000000000000000000000602082015281565b73ffffffffffffffffffffffffffffffffffffffff3316600090815260208190526040812054829010801590610699575073ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205482810110155b156107185773ffffffffffffffffffffffffffffffffffffffff33811660008181526020818152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a3506001610427565b506000610427565b5b92915050565b73ffffffffffffffffffffffffffffffffffffffff8083166000908152600160209081526040808320938516835292905220545b929150505600a165627a7a723058201b5b70cf82a73dec658c2e60ab9a0f8e2ba01a74b66a6f5b0402f56d2ea0ffcf0029",
- "opcodes": "PUSH1 0x60 PUSH1 0x40 MSTORE PUSH12 0x33B2E3C9FD0803CE8000000 PUSH1 0x3 SSTORE CALLVALUE ISZERO PUSH2 0x1C JUMPI INVALID JUMPDEST JUMPDEST PUSH1 0x3 SLOAD PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB CALLER AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 SWAP1 SHA3 SSTORE JUMPDEST JUMPDEST PUSH2 0x78D DUP1 PUSH2 0x4A PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN STOP PUSH1 0x60 PUSH1 0x40 MSTORE CALLDATASIZE ISZERO PUSH2 0x96 JUMPI PUSH4 0xFFFFFFFF PUSH29 0x100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD DIV AND PUSH4 0x6FDDE03 DUP2 EQ PUSH2 0x98 JUMPI DUP1 PUSH4 0x95EA7B3 EQ PUSH2 0x146 JUMPI DUP1 PUSH4 0x18160DDD EQ PUSH2 0x186 JUMPI DUP1 PUSH4 0x23B872DD EQ PUSH2 0x1A8 JUMPI DUP1 PUSH4 0x313CE567 EQ PUSH2 0x1EE JUMPI DUP1 PUSH4 0x70A08231 EQ PUSH2 0x214 JUMPI DUP1 PUSH4 0x95D89B41 EQ PUSH2 0x24F JUMPI DUP1 PUSH4 0xA9059CBB EQ PUSH2 0x2FD JUMPI DUP1 PUSH4 0xDD62ED3E EQ PUSH2 0x33D JUMPI JUMPDEST INVALID JUMPDEST CALLVALUE ISZERO PUSH2 0xA0 JUMPI INVALID JUMPDEST PUSH2 0xA8 PUSH2 0x37E JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 DUP1 DUP3 MSTORE DUP4 MLOAD DUP2 DUP4 ADD MSTORE DUP4 MLOAD SWAP2 SWAP3 DUP4 SWAP3 SWAP1 DUP4 ADD SWAP2 DUP6 ADD SWAP1 DUP1 DUP4 DUP4 DUP3 ISZERO PUSH2 0x10C JUMPI JUMPDEST DUP1 MLOAD DUP3 MSTORE PUSH1 0x20 DUP4 GT ISZERO PUSH2 0x10C JUMPI PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 SWAP1 SWAP3 ADD SWAP2 PUSH1 0x20 SWAP2 DUP3 ADD SWAP2 ADD PUSH2 0xCE JUMP JUMPDEST POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x138 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE ISZERO PUSH2 0x14E JUMPI INVALID JUMPDEST PUSH2 0x172 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x3B5 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 ISZERO ISZERO DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE ISZERO PUSH2 0x18E JUMPI INVALID JUMPDEST PUSH2 0x196 PUSH2 0x42D JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE ISZERO PUSH2 0x1B0 JUMPI INVALID JUMPDEST PUSH2 0x172 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH1 0x44 CALLDATALOAD PUSH2 0x433 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 ISZERO ISZERO DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE ISZERO PUSH2 0x1F6 JUMPI INVALID JUMPDEST PUSH2 0x1FE PUSH2 0x5D4 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0xFF SWAP1 SWAP3 AND DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE ISZERO PUSH2 0x21C JUMPI INVALID JUMPDEST PUSH2 0x196 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x5D9 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE ISZERO PUSH2 0x257 JUMPI INVALID JUMPDEST PUSH2 0xA8 PUSH2 0x605 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 DUP1 DUP3 MSTORE DUP4 MLOAD DUP2 DUP4 ADD MSTORE DUP4 MLOAD SWAP2 SWAP3 DUP4 SWAP3 SWAP1 DUP4 ADD SWAP2 DUP6 ADD SWAP1 DUP1 DUP4 DUP4 DUP3 ISZERO PUSH2 0x10C JUMPI JUMPDEST DUP1 MLOAD DUP3 MSTORE PUSH1 0x20 DUP4 GT ISZERO PUSH2 0x10C JUMPI PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 SWAP1 SWAP3 ADD SWAP2 PUSH1 0x20 SWAP2 DUP3 ADD SWAP2 ADD PUSH2 0xCE JUMP JUMPDEST POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x138 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE ISZERO PUSH2 0x305 JUMPI INVALID JUMPDEST PUSH2 0x172 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x63C JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 ISZERO ISZERO DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE ISZERO PUSH2 0x345 JUMPI INVALID JUMPDEST PUSH2 0x196 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH2 0x727 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST PUSH1 0x40 DUP1 MLOAD DUP1 DUP3 ADD SWAP1 SWAP2 MSTORE PUSH1 0x11 DUP2 MSTORE PUSH32 0x30782050726F746F636F6C20546F6B656E000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE DUP2 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF CALLER DUP2 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 SHA3 SWAP5 DUP8 AND DUP1 DUP5 MSTORE SWAP5 DUP3 MSTORE DUP1 DUP4 SHA3 DUP7 SWAP1 SSTORE DUP1 MLOAD DUP7 DUP2 MSTORE SWAP1 MLOAD SWAP3 SWAP5 SWAP4 SWAP3 PUSH32 0x8C5BE1E5EBEC7D5BD14F71427D1E84F3DD0314C0F7B2291E5B200AC8C7C3B925 SWAP3 SWAP2 DUP2 SWAP1 SUB SWAP1 SWAP2 ADD SWAP1 LOG3 POP PUSH1 0x1 JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x3 SLOAD DUP2 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP5 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 SHA3 CALLER SWAP1 SWAP6 AND DUP4 MSTORE SWAP4 DUP2 MSTORE DUP4 DUP3 SHA3 SLOAD SWAP3 DUP3 MSTORE DUP2 SWAP1 MSTORE SWAP2 DUP3 SHA3 SLOAD DUP4 SWAP1 LT DUP1 ISZERO SWAP1 PUSH2 0x483 JUMPI POP DUP3 DUP2 LT ISZERO JUMPDEST DUP1 ISZERO PUSH2 0x4B6 JUMPI POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 SWAP1 SHA3 SLOAD DUP4 DUP2 ADD LT ISZERO JUMPDEST ISZERO PUSH2 0x5C6 JUMPI PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP6 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 DUP1 DUP3 SHA3 DUP1 SLOAD DUP8 ADD SWAP1 SSTORE SWAP2 DUP8 AND DUP2 MSTORE SHA3 DUP1 SLOAD DUP5 SWAP1 SUB SWAP1 SSTORE PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 LT ISZERO PUSH2 0x558 JUMPI PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP7 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 SHA3 CALLER SWAP1 SWAP5 AND DUP4 MSTORE SWAP3 SWAP1 MSTORE SHA3 DUP1 SLOAD DUP5 SWAP1 SUB SWAP1 SSTORE JUMPDEST DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF DUP6 PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x1 SWAP2 POP PUSH2 0x5CB JUMP JUMPDEST PUSH1 0x0 SWAP2 POP JUMPDEST JUMPDEST POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x12 DUP2 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 SWAP1 SHA3 SLOAD JUMPDEST SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD DUP1 DUP3 ADD SWAP1 SWAP2 MSTORE PUSH1 0x3 DUP2 MSTORE PUSH32 0x5A52580000000000000000000000000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE DUP2 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF CALLER AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 DUP2 SHA3 SLOAD DUP3 SWAP1 LT DUP1 ISZERO SWAP1 PUSH2 0x699 JUMPI POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 SWAP1 SHA3 SLOAD DUP3 DUP2 ADD LT ISZERO JUMPDEST ISZERO PUSH2 0x718 JUMPI PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF CALLER DUP2 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x20 DUP2 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 SHA3 DUP1 SLOAD DUP9 SWAP1 SUB SWAP1 SSTORE SWAP4 DUP8 AND DUP1 DUP4 MSTORE SWAP2 DUP5 SWAP1 SHA3 DUP1 SLOAD DUP8 ADD SWAP1 SSTORE DUP4 MLOAD DUP7 DUP2 MSTORE SWAP4 MLOAD SWAP2 SWAP4 PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF SWAP3 SWAP1 DUP2 SWAP1 SUB SWAP1 SWAP2 ADD SWAP1 LOG3 POP PUSH1 0x1 PUSH2 0x427 JUMP JUMPDEST POP PUSH1 0x0 PUSH2 0x427 JUMP JUMPDEST JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP4 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 SHA3 SWAP4 DUP6 AND DUP4 MSTORE SWAP3 SWAP1 MSTORE SHA3 SLOAD JUMPDEST SWAP3 SWAP2 POP POP JUMP STOP LOG1 PUSH6 0x627A7A723058 SHA3 0x1b JUMPDEST PUSH17 0xCF82A73DEC658C2E60AB9A0F8E2BA01A74 0xb6 PUSH11 0x6F5B0402F56D2EA0FFCF00 0x29 ",
- "sourceMap": "795:455:3:-;;;966:6;937:35;;1158:90;;;;;;;1230:11;;-1:-1:-1;;;;;1216:10:3;1207:20;:8;:20;;;;;;;;;;:34;1158:90;795:455;;;;;;;"
- },
- "deployedBytecode": {
- "linkReferences": {},
- "object": "0x606060405236156100965763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610098578063095ea7b31461014657806318160ddd1461018657806323b872dd146101a8578063313ce567146101ee57806370a082311461021457806395d89b411461024f578063a9059cbb146102fd578063dd62ed3e1461033d575bfe5b34156100a057fe5b6100a861037e565b60408051602080825283518183015283519192839290830191850190808383821561010c575b80518252602083111561010c577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016100ce565b505050905090810190601f1680156101385780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561014e57fe5b61017273ffffffffffffffffffffffffffffffffffffffff600435166024356103b5565b604080519115158252519081900360200190f35b341561018e57fe5b61019661042d565b60408051918252519081900360200190f35b34156101b057fe5b61017273ffffffffffffffffffffffffffffffffffffffff60043581169060243516604435610433565b604080519115158252519081900360200190f35b34156101f657fe5b6101fe6105d4565b6040805160ff9092168252519081900360200190f35b341561021c57fe5b61019673ffffffffffffffffffffffffffffffffffffffff600435166105d9565b60408051918252519081900360200190f35b341561025757fe5b6100a8610605565b60408051602080825283518183015283519192839290830191850190808383821561010c575b80518252602083111561010c577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016100ce565b505050905090810190601f1680156101385780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561030557fe5b61017273ffffffffffffffffffffffffffffffffffffffff6004351660243561063c565b604080519115158252519081900360200190f35b341561034557fe5b61019673ffffffffffffffffffffffffffffffffffffffff60043581169060243516610727565b60408051918252519081900360200190f35b60408051808201909152601181527f30782050726f746f636f6c20546f6b656e000000000000000000000000000000602082015281565b73ffffffffffffffffffffffffffffffffffffffff338116600081815260016020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b60035481565b73ffffffffffffffffffffffffffffffffffffffff808416600081815260016020908152604080832033909516835293815283822054928252819052918220548390108015906104835750828110155b80156104b6575073ffffffffffffffffffffffffffffffffffffffff841660009081526020819052604090205483810110155b156105c65773ffffffffffffffffffffffffffffffffffffffff808516600090815260208190526040808220805487019055918716815220805484900390557fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8110156105585773ffffffffffffffffffffffffffffffffffffffff808616600090815260016020908152604080832033909416835292905220805484900390555b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191506105cb565b600091505b5b509392505050565b601281565b73ffffffffffffffffffffffffffffffffffffffff81166000908152602081905260409020545b919050565b60408051808201909152600381527f5a52580000000000000000000000000000000000000000000000000000000000602082015281565b73ffffffffffffffffffffffffffffffffffffffff3316600090815260208190526040812054829010801590610699575073ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205482810110155b156107185773ffffffffffffffffffffffffffffffffffffffff33811660008181526020818152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a3506001610427565b506000610427565b5b92915050565b73ffffffffffffffffffffffffffffffffffffffff8083166000908152600160209081526040808320938516835292905220545b929150505600a165627a7a723058201b5b70cf82a73dec658c2e60ab9a0f8e2ba01a74b66a6f5b0402f56d2ea0ffcf0029",
- "opcodes": "PUSH1 0x60 PUSH1 0x40 MSTORE CALLDATASIZE ISZERO PUSH2 0x96 JUMPI PUSH4 0xFFFFFFFF PUSH29 0x100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD DIV AND PUSH4 0x6FDDE03 DUP2 EQ PUSH2 0x98 JUMPI DUP1 PUSH4 0x95EA7B3 EQ PUSH2 0x146 JUMPI DUP1 PUSH4 0x18160DDD EQ PUSH2 0x186 JUMPI DUP1 PUSH4 0x23B872DD EQ PUSH2 0x1A8 JUMPI DUP1 PUSH4 0x313CE567 EQ PUSH2 0x1EE JUMPI DUP1 PUSH4 0x70A08231 EQ PUSH2 0x214 JUMPI DUP1 PUSH4 0x95D89B41 EQ PUSH2 0x24F JUMPI DUP1 PUSH4 0xA9059CBB EQ PUSH2 0x2FD JUMPI DUP1 PUSH4 0xDD62ED3E EQ PUSH2 0x33D JUMPI JUMPDEST INVALID JUMPDEST CALLVALUE ISZERO PUSH2 0xA0 JUMPI INVALID JUMPDEST PUSH2 0xA8 PUSH2 0x37E JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 DUP1 DUP3 MSTORE DUP4 MLOAD DUP2 DUP4 ADD MSTORE DUP4 MLOAD SWAP2 SWAP3 DUP4 SWAP3 SWAP1 DUP4 ADD SWAP2 DUP6 ADD SWAP1 DUP1 DUP4 DUP4 DUP3 ISZERO PUSH2 0x10C JUMPI JUMPDEST DUP1 MLOAD DUP3 MSTORE PUSH1 0x20 DUP4 GT ISZERO PUSH2 0x10C JUMPI PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 SWAP1 SWAP3 ADD SWAP2 PUSH1 0x20 SWAP2 DUP3 ADD SWAP2 ADD PUSH2 0xCE JUMP JUMPDEST POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x138 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE ISZERO PUSH2 0x14E JUMPI INVALID JUMPDEST PUSH2 0x172 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x3B5 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 ISZERO ISZERO DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE ISZERO PUSH2 0x18E JUMPI INVALID JUMPDEST PUSH2 0x196 PUSH2 0x42D JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE ISZERO PUSH2 0x1B0 JUMPI INVALID JUMPDEST PUSH2 0x172 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH1 0x44 CALLDATALOAD PUSH2 0x433 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 ISZERO ISZERO DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE ISZERO PUSH2 0x1F6 JUMPI INVALID JUMPDEST PUSH2 0x1FE PUSH2 0x5D4 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0xFF SWAP1 SWAP3 AND DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE ISZERO PUSH2 0x21C JUMPI INVALID JUMPDEST PUSH2 0x196 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x5D9 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE ISZERO PUSH2 0x257 JUMPI INVALID JUMPDEST PUSH2 0xA8 PUSH2 0x605 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 DUP1 DUP3 MSTORE DUP4 MLOAD DUP2 DUP4 ADD MSTORE DUP4 MLOAD SWAP2 SWAP3 DUP4 SWAP3 SWAP1 DUP4 ADD SWAP2 DUP6 ADD SWAP1 DUP1 DUP4 DUP4 DUP3 ISZERO PUSH2 0x10C JUMPI JUMPDEST DUP1 MLOAD DUP3 MSTORE PUSH1 0x20 DUP4 GT ISZERO PUSH2 0x10C JUMPI PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 SWAP1 SWAP3 ADD SWAP2 PUSH1 0x20 SWAP2 DUP3 ADD SWAP2 ADD PUSH2 0xCE JUMP JUMPDEST POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x138 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE ISZERO PUSH2 0x305 JUMPI INVALID JUMPDEST PUSH2 0x172 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x63C JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 ISZERO ISZERO DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE ISZERO PUSH2 0x345 JUMPI INVALID JUMPDEST PUSH2 0x196 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH2 0x727 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST PUSH1 0x40 DUP1 MLOAD DUP1 DUP3 ADD SWAP1 SWAP2 MSTORE PUSH1 0x11 DUP2 MSTORE PUSH32 0x30782050726F746F636F6C20546F6B656E000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE DUP2 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF CALLER DUP2 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 SHA3 SWAP5 DUP8 AND DUP1 DUP5 MSTORE SWAP5 DUP3 MSTORE DUP1 DUP4 SHA3 DUP7 SWAP1 SSTORE DUP1 MLOAD DUP7 DUP2 MSTORE SWAP1 MLOAD SWAP3 SWAP5 SWAP4 SWAP3 PUSH32 0x8C5BE1E5EBEC7D5BD14F71427D1E84F3DD0314C0F7B2291E5B200AC8C7C3B925 SWAP3 SWAP2 DUP2 SWAP1 SUB SWAP1 SWAP2 ADD SWAP1 LOG3 POP PUSH1 0x1 JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x3 SLOAD DUP2 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP5 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 SHA3 CALLER SWAP1 SWAP6 AND DUP4 MSTORE SWAP4 DUP2 MSTORE DUP4 DUP3 SHA3 SLOAD SWAP3 DUP3 MSTORE DUP2 SWAP1 MSTORE SWAP2 DUP3 SHA3 SLOAD DUP4 SWAP1 LT DUP1 ISZERO SWAP1 PUSH2 0x483 JUMPI POP DUP3 DUP2 LT ISZERO JUMPDEST DUP1 ISZERO PUSH2 0x4B6 JUMPI POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 SWAP1 SHA3 SLOAD DUP4 DUP2 ADD LT ISZERO JUMPDEST ISZERO PUSH2 0x5C6 JUMPI PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP6 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 DUP1 DUP3 SHA3 DUP1 SLOAD DUP8 ADD SWAP1 SSTORE SWAP2 DUP8 AND DUP2 MSTORE SHA3 DUP1 SLOAD DUP5 SWAP1 SUB SWAP1 SSTORE PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 LT ISZERO PUSH2 0x558 JUMPI PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP7 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 SHA3 CALLER SWAP1 SWAP5 AND DUP4 MSTORE SWAP3 SWAP1 MSTORE SHA3 DUP1 SLOAD DUP5 SWAP1 SUB SWAP1 SSTORE JUMPDEST DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF DUP6 PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x1 SWAP2 POP PUSH2 0x5CB JUMP JUMPDEST PUSH1 0x0 SWAP2 POP JUMPDEST JUMPDEST POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x12 DUP2 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 SWAP1 SHA3 SLOAD JUMPDEST SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD DUP1 DUP3 ADD SWAP1 SWAP2 MSTORE PUSH1 0x3 DUP2 MSTORE PUSH32 0x5A52580000000000000000000000000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE DUP2 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF CALLER AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 DUP2 SHA3 SLOAD DUP3 SWAP1 LT DUP1 ISZERO SWAP1 PUSH2 0x699 JUMPI POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 SWAP1 SHA3 SLOAD DUP3 DUP2 ADD LT ISZERO JUMPDEST ISZERO PUSH2 0x718 JUMPI PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF CALLER DUP2 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x20 DUP2 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 SHA3 DUP1 SLOAD DUP9 SWAP1 SUB SWAP1 SSTORE SWAP4 DUP8 AND DUP1 DUP4 MSTORE SWAP2 DUP5 SWAP1 SHA3 DUP1 SLOAD DUP8 ADD SWAP1 SSTORE DUP4 MLOAD DUP7 DUP2 MSTORE SWAP4 MLOAD SWAP2 SWAP4 PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF SWAP3 SWAP1 DUP2 SWAP1 SUB SWAP1 SWAP2 ADD SWAP1 LOG3 POP PUSH1 0x1 PUSH2 0x427 JUMP JUMPDEST POP PUSH1 0x0 PUSH2 0x427 JUMP JUMPDEST JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP4 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 SHA3 SWAP4 DUP6 AND DUP4 MSTORE SWAP3 SWAP1 MSTORE SHA3 SLOAD JUMPDEST SWAP3 SWAP2 POP POP JUMP STOP LOG1 PUSH6 0x627A7A723058 SHA3 0x1b JUMPDEST PUSH17 0xCF82A73DEC658C2E60AB9A0F8E2BA01A74 0xb6 PUSH11 0x6F5B0402F56D2EA0FFCF00 0x29 ",
- "sourceMap": "795:455:3:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1017:49;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;18:2:-1;;13:3;7:5;32;59:3;53:5;48:3;41:6;93:2;88:3;85:2;78:6;73:3;67:5;152:3;;;;;117:2;108:3;;;;130;172:5;167:4;181:3;3:186;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1087:187:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;937:35:3;;;;;;;;;;;;;;;;;;;;;;;;;;1066:609:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;896:35:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;982:99:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1072:37:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;18:2:-1;;13:3;7:5;32;59:3;53:5;48:3;41:6;93:2;88:3;85:2;78:6;73:3;67:5;152:3;;;;;117:2;108:3;;;;130;172:5;167:4;181:3;3:186;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;125:410:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1280:126;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1017:49:3;;;;;;;;;;;;;;;;;;;:::o;1087:187:0:-;1160:19;1168:10;1160:19;;1144:4;1160:19;;;:7;:19;;;;;;;;:29;;;;;;;;;;;;:38;;;1208;;;;;;;1144:4;;1160:29;:19;1208:38;;;;;;;;;;;-1:-1:-1;1263:4:0;1087:187;;;;;:::o;937:35:3:-;;;;:::o;1066:609:2:-;1198:14;;;;1161:4;1198:14;;;:7;:14;;;;;;;;1213:10;1198:26;;;;;;;;;;;;1238:15;;;;;;;;;;:25;;;;;;:60;;;1292:6;1279:9;:19;;1238:60;:115;;;;-1:-1:-1;1340:13:2;;;:8;:13;;;;;;;;;;;1314:22;;;:39;;1238:115;1234:435;;;1378:13;;;;:8;:13;;;;;;;;;;;:23;;;;;;1415:15;;;;;;:25;;;;;;;768:10;1458:20;;1454:95;;;1498:14;;;;;;;;:7;:14;;;;;;;;1513:10;1498:26;;;;;;;;;:36;;;;;;;1454:95;1578:3;1562:28;;1571:5;1562:28;;;1583:6;1562:28;;;;;;;;;;;;;;;;;;1611:4;1604:11;;;;1234:435;1653:5;1646:12;;1234:435;1066:609;;;;;;;:::o;896:35:3:-;929:2;896:35;:::o;982:99:0:-;1058:16;;;1035:4;1058:16;;;;;;;;;;;982:99;;;;:::o;1072:37:3:-;;;;;;;;;;;;;;;;;;;:::o;125:410:0:-;267:20;276:10;267:20;178:4;267:20;;;;;;;;;;;:30;;;;;;:73;;-1:-1:-1;327:13:0;;;:8;:13;;;;;;;;;;;301:22;;;:39;;267:73;263:266;;;356:20;365:10;356:20;;:8;:20;;;;;;;;;;;:30;;;;;;;400:13;;;;;;;;;;:23;;;;;;437:33;;;;;;;400:13;;437:33;;;;;;;;;;;-1:-1:-1;491:4:0;484:11;;263:266;-1:-1:-1;521:5:0;514:12;;263:266;125:410;;;;;:::o;1280:126::-;1374:15;;;;1351:4;1374:15;;;:7;:15;;;;;;;;:25;;;;;;;;;;1280:126;;;;;:::o"
- },
- "gasEstimates": {
- "creation": {
- "codeDepositCost": "386600",
- "executionCost": "40780",
- "totalCost": "427380"
- },
- "external": {
- "allowance(address,address)": "737",
- "approve(address,uint256)": "22218",
- "balanceOf(address)": "579",
- "decimals()": "270",
- "name()": "530",
- "symbol()": "662",
- "totalSupply()": "417",
- "transfer(address,uint256)": "43393",
- "transferFrom(address,address,uint256)": "64116"
- }
- },
- "legacyAssembly": {
- ".code": [
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH",
- "value": "60"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "MSTORE"
- },
- {
- "begin": 966,
- "end": 972,
- "name": "PUSH",
- "value": "33B2E3C9FD0803CE8000000"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "PUSH",
- "value": "3"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "SSTORE"
- },
- {
- "begin": 1158,
- "end": 1248,
- "name": "CALLVALUE"
- },
- {
- "begin": 1158,
- "end": 1248,
- "name": "ISZERO"
- },
- {
- "begin": 1158,
- "end": 1248,
- "name": "PUSH [tag]",
- "value": "1"
- },
- {
- "begin": 1158,
- "end": 1248,
- "name": "JUMPI"
- },
- {
- "begin": 1158,
- "end": 1248,
- "name": "INVALID"
- },
- {
- "begin": 1158,
- "end": 1248,
- "name": "tag",
- "value": "1"
- },
- {
- "begin": 1158,
- "end": 1248,
- "name": "JUMPDEST"
- },
- {
- "begin": 1158,
- "end": 1248,
- "name": "tag",
- "value": "2"
- },
- {
- "begin": 1158,
- "end": 1248,
- "name": "JUMPDEST"
- },
- {
- "begin": 1230,
- "end": 1241,
- "name": "PUSH",
- "value": "3"
- },
- {
- "begin": 1230,
- "end": 1241,
- "name": "SLOAD"
- },
- {
- "begin": -1,
- "end": -1,
- "name": "PUSH",
- "value": "1"
- },
- {
- "begin": -1,
- "end": -1,
- "name": "PUSH",
- "value": "A0"
- },
- {
- "begin": -1,
- "end": -1,
- "name": "PUSH",
- "value": "2"
- },
- {
- "begin": -1,
- "end": -1,
- "name": "EXP"
- },
- {
- "begin": -1,
- "end": -1,
- "name": "SUB"
- },
- {
- "begin": 1216,
- "end": 1226,
- "name": "CALLER"
- },
- {
- "begin": 1207,
- "end": 1227,
- "name": "AND"
- },
- {
- "begin": 1207,
- "end": 1215,
- "name": "PUSH",
- "value": "0"
- },
- {
- "begin": 1207,
- "end": 1227,
- "name": "SWAP1"
- },
- {
- "begin": 1207,
- "end": 1227,
- "name": "DUP2"
- },
- {
- "begin": 1207,
- "end": 1227,
- "name": "MSTORE"
- },
- {
- "begin": 1207,
- "end": 1227,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 1207,
- "end": 1227,
- "name": "DUP2"
- },
- {
- "begin": 1207,
- "end": 1227,
- "name": "SWAP1"
- },
- {
- "begin": 1207,
- "end": 1227,
- "name": "MSTORE"
- },
- {
- "begin": 1207,
- "end": 1227,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 1207,
- "end": 1227,
- "name": "SWAP1"
- },
- {
- "begin": 1207,
- "end": 1227,
- "name": "SHA3"
- },
- {
- "begin": 1207,
- "end": 1241,
- "name": "SSTORE"
- },
- {
- "begin": 1158,
- "end": 1248,
- "name": "tag",
- "value": "3"
- },
- {
- "begin": 1158,
- "end": 1248,
- "name": "JUMPDEST"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "tag",
- "value": "4"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "JUMPDEST"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH #[$]",
- "value": "0000000000000000000000000000000000000000000000000000000000000000"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "DUP1"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH [$]",
- "value": "0000000000000000000000000000000000000000000000000000000000000000"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH",
- "value": "0"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "CODECOPY"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH",
- "value": "0"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "RETURN"
- }
- ],
- ".data": {
- "0": {
- ".code": [
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH",
- "value": "60"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "MSTORE"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "CALLDATASIZE"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "ISZERO"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH [tag]",
- "value": "1"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "JUMPI"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH",
- "value": "FFFFFFFF"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH",
- "value": "100000000000000000000000000000000000000000000000000000000"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH",
- "value": "0"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "CALLDATALOAD"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "DIV"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "AND"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH",
- "value": "6FDDE03"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "DUP2"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "EQ"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH [tag]",
- "value": "2"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "JUMPI"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "DUP1"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH",
- "value": "95EA7B3"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "EQ"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH [tag]",
- "value": "3"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "JUMPI"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "DUP1"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH",
- "value": "18160DDD"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "EQ"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH [tag]",
- "value": "4"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "JUMPI"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "DUP1"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH",
- "value": "23B872DD"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "EQ"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH [tag]",
- "value": "5"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "JUMPI"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "DUP1"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH",
- "value": "313CE567"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "EQ"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH [tag]",
- "value": "6"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "JUMPI"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "DUP1"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH",
- "value": "70A08231"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "EQ"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH [tag]",
- "value": "7"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "JUMPI"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "DUP1"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH",
- "value": "95D89B41"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "EQ"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH [tag]",
- "value": "8"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "JUMPI"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "DUP1"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH",
- "value": "A9059CBB"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "EQ"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH [tag]",
- "value": "9"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "JUMPI"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "DUP1"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH",
- "value": "DD62ED3E"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "EQ"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH [tag]",
- "value": "10"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "JUMPI"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "tag",
- "value": "1"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "JUMPDEST"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "INVALID"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "tag",
- "value": "2"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "JUMPDEST"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "CALLVALUE"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "ISZERO"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "PUSH [tag]",
- "value": "11"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "JUMPI"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "INVALID"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "tag",
- "value": "11"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "JUMPDEST"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "PUSH [tag]",
- "value": "12"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "PUSH [tag]",
- "value": "13"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "JUMP"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "tag",
- "value": "12"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "JUMPDEST"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "DUP1"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "MLOAD"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "DUP1"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "DUP3"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "MSTORE"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "DUP4"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "MLOAD"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "DUP2"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "DUP4"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "ADD"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "MSTORE"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "DUP4"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "MLOAD"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "SWAP2"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "SWAP3"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "DUP4"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "SWAP3"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "SWAP1"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "DUP4"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "ADD"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "SWAP2"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "DUP6"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "ADD"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "SWAP1"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "DUP1"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "DUP4"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "DUP4"
- },
- {
- "begin": 18,
- "end": 20,
- "name": "DUP3"
- },
- {
- "begin": 18,
- "end": 20,
- "name": "ISZERO"
- },
- {
- "begin": 13,
- "end": 16,
- "name": "PUSH [tag]",
- "value": "14"
- },
- {
- "begin": 7,
- "end": 12,
- "name": "JUMPI"
- },
- {
- "begin": 32,
- "end": 37,
- "name": "tag",
- "value": "15"
- },
- {
- "begin": 32,
- "end": 37,
- "name": "JUMPDEST"
- },
- {
- "begin": 59,
- "end": 62,
- "name": "DUP1"
- },
- {
- "begin": 53,
- "end": 58,
- "name": "MLOAD"
- },
- {
- "begin": 48,
- "end": 51,
- "name": "DUP3"
- },
- {
- "begin": 41,
- "end": 47,
- "name": "MSTORE"
- },
- {
- "begin": 93,
- "end": 95,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 88,
- "end": 91,
- "name": "DUP4"
- },
- {
- "begin": 85,
- "end": 87,
- "name": "GT"
- },
- {
- "begin": 78,
- "end": 84,
- "name": "ISZERO"
- },
- {
- "begin": 73,
- "end": 76,
- "name": "PUSH [tag]",
- "value": "14"
- },
- {
- "begin": 67,
- "end": 72,
- "name": "JUMPI"
- },
- {
- "begin": 152,
- "end": 155,
- "name": "PUSH",
- "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0"
- },
- {
- "begin": 152,
- "end": 155,
- "name": "SWAP1"
- },
- {
- "begin": 152,
- "end": 155,
- "name": "SWAP3"
- },
- {
- "begin": 152,
- "end": 155,
- "name": "ADD"
- },
- {
- "begin": 152,
- "end": 155,
- "name": "SWAP2"
- },
- {
- "begin": 117,
- "end": 119,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 108,
- "end": 111,
- "name": "SWAP2"
- },
- {
- "begin": 108,
- "end": 111,
- "name": "DUP3"
- },
- {
- "begin": 108,
- "end": 111,
- "name": "ADD"
- },
- {
- "begin": 108,
- "end": 111,
- "name": "SWAP2"
- },
- {
- "begin": 130,
- "end": 133,
- "name": "ADD"
- },
- {
- "begin": 172,
- "end": 177,
- "name": "PUSH [tag]",
- "value": "15"
- },
- {
- "begin": 167,
- "end": 171,
- "name": "JUMP"
- },
- {
- "begin": 181,
- "end": 184,
- "name": "tag",
- "value": "14"
- },
- {
- "begin": 181,
- "end": 184,
- "name": "JUMPDEST"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "POP"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "POP"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "POP"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "SWAP1"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "POP"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "SWAP1"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "DUP2"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "ADD"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "SWAP1"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "PUSH",
- "value": "1F"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "AND"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "DUP1"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "ISZERO"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "PUSH [tag]",
- "value": "16"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "JUMPI"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "DUP1"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "DUP3"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "SUB"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "DUP1"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "MLOAD"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "PUSH",
- "value": "1"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "DUP4"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "SUB"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "PUSH",
- "value": "100"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "EXP"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "SUB"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "NOT"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "AND"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "DUP2"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "MSTORE"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "ADD"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "SWAP2"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "POP"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "tag",
- "value": "16"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "JUMPDEST"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "POP"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "SWAP3"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "POP"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "POP"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "POP"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "MLOAD"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "DUP1"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "SWAP2"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "SUB"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "SWAP1"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "RETURN"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "tag",
- "value": "3"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "JUMPDEST"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "CALLVALUE"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "ISZERO"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "PUSH [tag]",
- "value": "17"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "JUMPI"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "INVALID"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "tag",
- "value": "17"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "JUMPDEST"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "PUSH [tag]",
- "value": "18"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "PUSH",
- "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "PUSH",
- "value": "4"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "CALLDATALOAD"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "AND"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "PUSH",
- "value": "24"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "CALLDATALOAD"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "PUSH [tag]",
- "value": "19"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "JUMP"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "tag",
- "value": "18"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "JUMPDEST"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "DUP1"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "MLOAD"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "SWAP2"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "ISZERO"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "ISZERO"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "DUP3"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "MSTORE"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "MLOAD"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "SWAP1"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "DUP2"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "SWAP1"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "SUB"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "ADD"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "SWAP1"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "RETURN"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "tag",
- "value": "4"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "JUMPDEST"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "CALLVALUE"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "ISZERO"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "PUSH [tag]",
- "value": "20"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "JUMPI"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "INVALID"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "tag",
- "value": "20"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "JUMPDEST"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "PUSH [tag]",
- "value": "21"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "PUSH [tag]",
- "value": "22"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "JUMP"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "tag",
- "value": "21"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "JUMPDEST"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "DUP1"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "MLOAD"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "SWAP2"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "DUP3"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "MSTORE"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "MLOAD"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "SWAP1"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "DUP2"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "SWAP1"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "SUB"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "ADD"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "SWAP1"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "RETURN"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "tag",
- "value": "5"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "JUMPDEST"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "CALLVALUE"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "ISZERO"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "PUSH [tag]",
- "value": "23"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "JUMPI"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "INVALID"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "tag",
- "value": "23"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "JUMPDEST"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "PUSH [tag]",
- "value": "18"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "PUSH",
- "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "PUSH",
- "value": "4"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "CALLDATALOAD"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "DUP2"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "AND"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "SWAP1"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "PUSH",
- "value": "24"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "CALLDATALOAD"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "AND"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "PUSH",
- "value": "44"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "CALLDATALOAD"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "PUSH [tag]",
- "value": "25"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "JUMP"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "tag",
- "value": "24"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "JUMPDEST"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "DUP1"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "MLOAD"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "SWAP2"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "ISZERO"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "ISZERO"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "DUP3"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "MSTORE"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "MLOAD"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "SWAP1"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "DUP2"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "SWAP1"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "SUB"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "ADD"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "SWAP1"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "RETURN"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "tag",
- "value": "6"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "JUMPDEST"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "CALLVALUE"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "ISZERO"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "PUSH [tag]",
- "value": "26"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "JUMPI"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "INVALID"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "tag",
- "value": "26"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "JUMPDEST"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "PUSH [tag]",
- "value": "27"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "PUSH [tag]",
- "value": "28"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "JUMP"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "tag",
- "value": "27"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "JUMPDEST"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "DUP1"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "MLOAD"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "PUSH",
- "value": "FF"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "SWAP1"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "SWAP3"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "AND"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "DUP3"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "MSTORE"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "MLOAD"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "SWAP1"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "DUP2"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "SWAP1"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "SUB"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "ADD"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "SWAP1"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "RETURN"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "tag",
- "value": "7"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "JUMPDEST"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "CALLVALUE"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "ISZERO"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "PUSH [tag]",
- "value": "29"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "JUMPI"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "INVALID"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "tag",
- "value": "29"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "JUMPDEST"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "PUSH [tag]",
- "value": "21"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "PUSH",
- "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "PUSH",
- "value": "4"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "CALLDATALOAD"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "AND"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "PUSH [tag]",
- "value": "31"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "JUMP"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "tag",
- "value": "30"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "JUMPDEST"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "DUP1"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "MLOAD"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "SWAP2"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "DUP3"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "MSTORE"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "MLOAD"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "SWAP1"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "DUP2"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "SWAP1"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "SUB"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "ADD"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "SWAP1"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "RETURN"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "tag",
- "value": "8"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "JUMPDEST"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "CALLVALUE"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "ISZERO"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "PUSH [tag]",
- "value": "32"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "JUMPI"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "INVALID"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "tag",
- "value": "32"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "JUMPDEST"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "PUSH [tag]",
- "value": "12"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "PUSH [tag]",
- "value": "34"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "JUMP"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "tag",
- "value": "33"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "JUMPDEST"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "DUP1"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "MLOAD"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "DUP1"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "DUP3"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "MSTORE"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "DUP4"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "MLOAD"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "DUP2"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "DUP4"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "ADD"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "MSTORE"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "DUP4"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "MLOAD"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "SWAP2"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "SWAP3"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "DUP4"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "SWAP3"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "SWAP1"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "DUP4"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "ADD"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "SWAP2"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "DUP6"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "ADD"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "SWAP1"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "DUP1"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "DUP4"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "DUP4"
- },
- {
- "begin": 18,
- "end": 20,
- "name": "DUP3"
- },
- {
- "begin": 18,
- "end": 20,
- "name": "ISZERO"
- },
- {
- "begin": 13,
- "end": 16,
- "name": "PUSH [tag]",
- "value": "14"
- },
- {
- "begin": 7,
- "end": 12,
- "name": "JUMPI"
- },
- {
- "begin": 32,
- "end": 37,
- "name": "tag",
- "value": "36"
- },
- {
- "begin": 32,
- "end": 37,
- "name": "JUMPDEST"
- },
- {
- "begin": 59,
- "end": 62,
- "name": "DUP1"
- },
- {
- "begin": 53,
- "end": 58,
- "name": "MLOAD"
- },
- {
- "begin": 48,
- "end": 51,
- "name": "DUP3"
- },
- {
- "begin": 41,
- "end": 47,
- "name": "MSTORE"
- },
- {
- "begin": 93,
- "end": 95,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 88,
- "end": 91,
- "name": "DUP4"
- },
- {
- "begin": 85,
- "end": 87,
- "name": "GT"
- },
- {
- "begin": 78,
- "end": 84,
- "name": "ISZERO"
- },
- {
- "begin": 73,
- "end": 76,
- "name": "PUSH [tag]",
- "value": "14"
- },
- {
- "begin": 67,
- "end": 72,
- "name": "JUMPI"
- },
- {
- "begin": 152,
- "end": 155,
- "name": "PUSH",
- "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0"
- },
- {
- "begin": 152,
- "end": 155,
- "name": "SWAP1"
- },
- {
- "begin": 152,
- "end": 155,
- "name": "SWAP3"
- },
- {
- "begin": 152,
- "end": 155,
- "name": "ADD"
- },
- {
- "begin": 152,
- "end": 155,
- "name": "SWAP2"
- },
- {
- "begin": 117,
- "end": 119,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 108,
- "end": 111,
- "name": "SWAP2"
- },
- {
- "begin": 108,
- "end": 111,
- "name": "DUP3"
- },
- {
- "begin": 108,
- "end": 111,
- "name": "ADD"
- },
- {
- "begin": 108,
- "end": 111,
- "name": "SWAP2"
- },
- {
- "begin": 130,
- "end": 133,
- "name": "ADD"
- },
- {
- "begin": 172,
- "end": 177,
- "name": "PUSH [tag]",
- "value": "15"
- },
- {
- "begin": 167,
- "end": 171,
- "name": "JUMP"
- },
- {
- "begin": 181,
- "end": 184,
- "name": "tag",
- "value": "35"
- },
- {
- "begin": 181,
- "end": 184,
- "name": "JUMPDEST"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "POP"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "POP"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "POP"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "SWAP1"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "POP"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "SWAP1"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "DUP2"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "ADD"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "SWAP1"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "PUSH",
- "value": "1F"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "AND"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "DUP1"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "ISZERO"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "PUSH [tag]",
- "value": "16"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "JUMPI"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "DUP1"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "DUP3"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "SUB"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "DUP1"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "MLOAD"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "PUSH",
- "value": "1"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "DUP4"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "SUB"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "PUSH",
- "value": "100"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "EXP"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "SUB"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "NOT"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "AND"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "DUP2"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "MSTORE"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "ADD"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "SWAP2"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "POP"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "tag",
- "value": "37"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "JUMPDEST"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "POP"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "SWAP3"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "POP"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "POP"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "POP"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "MLOAD"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "DUP1"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "SWAP2"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "SUB"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "SWAP1"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "RETURN"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "tag",
- "value": "9"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "JUMPDEST"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "CALLVALUE"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "ISZERO"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "PUSH [tag]",
- "value": "38"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "JUMPI"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "INVALID"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "tag",
- "value": "38"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "JUMPDEST"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "PUSH [tag]",
- "value": "18"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "PUSH",
- "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "PUSH",
- "value": "4"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "CALLDATALOAD"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "AND"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "PUSH",
- "value": "24"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "CALLDATALOAD"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "PUSH [tag]",
- "value": "40"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "JUMP"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "tag",
- "value": "39"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "JUMPDEST"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "DUP1"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "MLOAD"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "SWAP2"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "ISZERO"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "ISZERO"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "DUP3"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "MSTORE"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "MLOAD"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "SWAP1"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "DUP2"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "SWAP1"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "SUB"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "ADD"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "SWAP1"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "RETURN"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "tag",
- "value": "10"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "JUMPDEST"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "CALLVALUE"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "ISZERO"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "PUSH [tag]",
- "value": "41"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "JUMPI"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "INVALID"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "tag",
- "value": "41"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "JUMPDEST"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "PUSH [tag]",
- "value": "21"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "PUSH",
- "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "PUSH",
- "value": "4"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "CALLDATALOAD"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "DUP2"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "AND"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "SWAP1"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "PUSH",
- "value": "24"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "CALLDATALOAD"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "AND"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "PUSH [tag]",
- "value": "43"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "JUMP"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "tag",
- "value": "42"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "JUMPDEST"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "DUP1"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "MLOAD"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "SWAP2"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "DUP3"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "MSTORE"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "MLOAD"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "SWAP1"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "DUP2"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "SWAP1"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "SUB"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "ADD"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "SWAP1"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "RETURN"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "tag",
- "value": "13"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "JUMPDEST"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "DUP1"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "MLOAD"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "DUP1"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "DUP3"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "ADD"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "SWAP1"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "SWAP2"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "MSTORE"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "PUSH",
- "value": "11"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "DUP2"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "MSTORE"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "PUSH",
- "value": "30782050726F746F636F6C20546F6B656E000000000000000000000000000000"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "DUP3"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "ADD"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "MSTORE"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "DUP2"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "JUMP",
- "value": "[out]"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "tag",
- "value": "19"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "JUMPDEST"
- },
- {
- "begin": 1160,
- "end": 1179,
- "name": "PUSH",
- "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
- },
- {
- "begin": 1168,
- "end": 1178,
- "name": "CALLER"
- },
- {
- "begin": 1160,
- "end": 1179,
- "name": "DUP2"
- },
- {
- "begin": 1160,
- "end": 1179,
- "name": "AND"
- },
- {
- "begin": 1144,
- "end": 1148,
- "name": "PUSH",
- "value": "0"
- },
- {
- "begin": 1160,
- "end": 1179,
- "name": "DUP2"
- },
- {
- "begin": 1160,
- "end": 1179,
- "name": "DUP2"
- },
- {
- "begin": 1160,
- "end": 1179,
- "name": "MSTORE"
- },
- {
- "begin": 1160,
- "end": 1167,
- "name": "PUSH",
- "value": "1"
- },
- {
- "begin": 1160,
- "end": 1179,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 1160,
- "end": 1179,
- "name": "SWAP1"
- },
- {
- "begin": 1160,
- "end": 1179,
- "name": "DUP2"
- },
- {
- "begin": 1160,
- "end": 1179,
- "name": "MSTORE"
- },
- {
- "begin": 1160,
- "end": 1179,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 1160,
- "end": 1179,
- "name": "DUP1"
- },
- {
- "begin": 1160,
- "end": 1179,
- "name": "DUP4"
- },
- {
- "begin": 1160,
- "end": 1179,
- "name": "SHA3"
- },
- {
- "begin": 1160,
- "end": 1189,
- "name": "SWAP5"
- },
- {
- "begin": 1160,
- "end": 1189,
- "name": "DUP8"
- },
- {
- "begin": 1160,
- "end": 1189,
- "name": "AND"
- },
- {
- "begin": 1160,
- "end": 1189,
- "name": "DUP1"
- },
- {
- "begin": 1160,
- "end": 1189,
- "name": "DUP5"
- },
- {
- "begin": 1160,
- "end": 1189,
- "name": "MSTORE"
- },
- {
- "begin": 1160,
- "end": 1189,
- "name": "SWAP5"
- },
- {
- "begin": 1160,
- "end": 1189,
- "name": "DUP3"
- },
- {
- "begin": 1160,
- "end": 1189,
- "name": "MSTORE"
- },
- {
- "begin": 1160,
- "end": 1189,
- "name": "DUP1"
- },
- {
- "begin": 1160,
- "end": 1189,
- "name": "DUP4"
- },
- {
- "begin": 1160,
- "end": 1189,
- "name": "SHA3"
- },
- {
- "begin": 1160,
- "end": 1198,
- "name": "DUP7"
- },
- {
- "begin": 1160,
- "end": 1198,
- "name": "SWAP1"
- },
- {
- "begin": 1160,
- "end": 1198,
- "name": "SSTORE"
- },
- {
- "begin": 1208,
- "end": 1246,
- "name": "DUP1"
- },
- {
- "begin": 1208,
- "end": 1246,
- "name": "MLOAD"
- },
- {
- "begin": 1208,
- "end": 1246,
- "name": "DUP7"
- },
- {
- "begin": 1208,
- "end": 1246,
- "name": "DUP2"
- },
- {
- "begin": 1208,
- "end": 1246,
- "name": "MSTORE"
- },
- {
- "begin": 1208,
- "end": 1246,
- "name": "SWAP1"
- },
- {
- "begin": 1208,
- "end": 1246,
- "name": "MLOAD"
- },
- {
- "begin": 1144,
- "end": 1148,
- "name": "SWAP3"
- },
- {
- "begin": 1144,
- "end": 1148,
- "name": "SWAP5"
- },
- {
- "begin": 1160,
- "end": 1189,
- "name": "SWAP4"
- },
- {
- "begin": 1160,
- "end": 1179,
- "name": "SWAP3"
- },
- {
- "begin": 1208,
- "end": 1246,
- "name": "PUSH",
- "value": "8C5BE1E5EBEC7D5BD14F71427D1E84F3DD0314C0F7B2291E5B200AC8C7C3B925"
- },
- {
- "begin": 1208,
- "end": 1246,
- "name": "SWAP3"
- },
- {
- "begin": 1208,
- "end": 1246,
- "name": "SWAP2"
- },
- {
- "begin": 1208,
- "end": 1246,
- "name": "DUP2"
- },
- {
- "begin": 1208,
- "end": 1246,
- "name": "SWAP1"
- },
- {
- "begin": 1208,
- "end": 1246,
- "name": "SUB"
- },
- {
- "begin": 1208,
- "end": 1246,
- "name": "SWAP1"
- },
- {
- "begin": 1208,
- "end": 1246,
- "name": "SWAP2"
- },
- {
- "begin": 1208,
- "end": 1246,
- "name": "ADD"
- },
- {
- "begin": 1208,
- "end": 1246,
- "name": "SWAP1"
- },
- {
- "begin": 1208,
- "end": 1246,
- "name": "LOG3"
- },
- {
- "begin": -1,
- "end": -1,
- "name": "POP"
- },
- {
- "begin": 1263,
- "end": 1267,
- "name": "PUSH",
- "value": "1"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "tag",
- "value": "44"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "JUMPDEST"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "SWAP3"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "SWAP2"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "POP"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "POP"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "JUMP",
- "value": "[out]"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "tag",
- "value": "22"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "JUMPDEST"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "PUSH",
- "value": "3"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "SLOAD"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "DUP2"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "JUMP",
- "value": "[out]"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "tag",
- "value": "25"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "JUMPDEST"
- },
- {
- "begin": 1198,
- "end": 1212,
- "name": "PUSH",
- "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
- },
- {
- "begin": 1198,
- "end": 1212,
- "name": "DUP1"
- },
- {
- "begin": 1198,
- "end": 1212,
- "name": "DUP5"
- },
- {
- "begin": 1198,
- "end": 1212,
- "name": "AND"
- },
- {
- "begin": 1161,
- "end": 1165,
- "name": "PUSH",
- "value": "0"
- },
- {
- "begin": 1198,
- "end": 1212,
- "name": "DUP2"
- },
- {
- "begin": 1198,
- "end": 1212,
- "name": "DUP2"
- },
- {
- "begin": 1198,
- "end": 1212,
- "name": "MSTORE"
- },
- {
- "begin": 1198,
- "end": 1205,
- "name": "PUSH",
- "value": "1"
- },
- {
- "begin": 1198,
- "end": 1212,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 1198,
- "end": 1212,
- "name": "SWAP1"
- },
- {
- "begin": 1198,
- "end": 1212,
- "name": "DUP2"
- },
- {
- "begin": 1198,
- "end": 1212,
- "name": "MSTORE"
- },
- {
- "begin": 1198,
- "end": 1212,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 1198,
- "end": 1212,
- "name": "DUP1"
- },
- {
- "begin": 1198,
- "end": 1212,
- "name": "DUP4"
- },
- {
- "begin": 1198,
- "end": 1212,
- "name": "SHA3"
- },
- {
- "begin": 1213,
- "end": 1223,
- "name": "CALLER"
- },
- {
- "begin": 1198,
- "end": 1224,
- "name": "SWAP1"
- },
- {
- "begin": 1198,
- "end": 1224,
- "name": "SWAP6"
- },
- {
- "begin": 1198,
- "end": 1224,
- "name": "AND"
- },
- {
- "begin": 1198,
- "end": 1224,
- "name": "DUP4"
- },
- {
- "begin": 1198,
- "end": 1224,
- "name": "MSTORE"
- },
- {
- "begin": 1198,
- "end": 1224,
- "name": "SWAP4"
- },
- {
- "begin": 1198,
- "end": 1224,
- "name": "DUP2"
- },
- {
- "begin": 1198,
- "end": 1224,
- "name": "MSTORE"
- },
- {
- "begin": 1198,
- "end": 1224,
- "name": "DUP4"
- },
- {
- "begin": 1198,
- "end": 1224,
- "name": "DUP3"
- },
- {
- "begin": 1198,
- "end": 1224,
- "name": "SHA3"
- },
- {
- "begin": 1198,
- "end": 1224,
- "name": "SLOAD"
- },
- {
- "begin": 1238,
- "end": 1253,
- "name": "SWAP3"
- },
- {
- "begin": 1238,
- "end": 1253,
- "name": "DUP3"
- },
- {
- "begin": 1238,
- "end": 1253,
- "name": "MSTORE"
- },
- {
- "begin": 1238,
- "end": 1253,
- "name": "DUP2"
- },
- {
- "begin": 1238,
- "end": 1253,
- "name": "SWAP1"
- },
- {
- "begin": 1238,
- "end": 1253,
- "name": "MSTORE"
- },
- {
- "begin": 1238,
- "end": 1253,
- "name": "SWAP2"
- },
- {
- "begin": 1238,
- "end": 1253,
- "name": "DUP3"
- },
- {
- "begin": 1238,
- "end": 1253,
- "name": "SHA3"
- },
- {
- "begin": 1238,
- "end": 1253,
- "name": "SLOAD"
- },
- {
- "begin": 1238,
- "end": 1263,
- "name": "DUP4"
- },
- {
- "begin": 1238,
- "end": 1263,
- "name": "SWAP1"
- },
- {
- "begin": 1238,
- "end": 1263,
- "name": "LT"
- },
- {
- "begin": 1238,
- "end": 1263,
- "name": "DUP1"
- },
- {
- "begin": 1238,
- "end": 1263,
- "name": "ISZERO"
- },
- {
- "begin": 1238,
- "end": 1263,
- "name": "SWAP1"
- },
- {
- "begin": 1238,
- "end": 1298,
- "name": "PUSH [tag]",
- "value": "46"
- },
- {
- "begin": 1238,
- "end": 1298,
- "name": "JUMPI"
- },
- {
- "begin": 1238,
- "end": 1298,
- "name": "POP"
- },
- {
- "begin": 1292,
- "end": 1298,
- "name": "DUP3"
- },
- {
- "begin": 1279,
- "end": 1288,
- "name": "DUP2"
- },
- {
- "begin": 1279,
- "end": 1298,
- "name": "LT"
- },
- {
- "begin": 1279,
- "end": 1298,
- "name": "ISZERO"
- },
- {
- "begin": 1238,
- "end": 1298,
- "name": "tag",
- "value": "46"
- },
- {
- "begin": 1238,
- "end": 1298,
- "name": "JUMPDEST"
- },
- {
- "begin": 1238,
- "end": 1353,
- "name": "DUP1"
- },
- {
- "begin": 1238,
- "end": 1353,
- "name": "ISZERO"
- },
- {
- "begin": 1238,
- "end": 1353,
- "name": "PUSH [tag]",
- "value": "47"
- },
- {
- "begin": 1238,
- "end": 1353,
- "name": "JUMPI"
- },
- {
- "begin": -1,
- "end": -1,
- "name": "POP"
- },
- {
- "begin": 1340,
- "end": 1353,
- "name": "PUSH",
- "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
- },
- {
- "begin": 1340,
- "end": 1353,
- "name": "DUP5"
- },
- {
- "begin": 1340,
- "end": 1353,
- "name": "AND"
- },
- {
- "begin": 1340,
- "end": 1348,
- "name": "PUSH",
- "value": "0"
- },
- {
- "begin": 1340,
- "end": 1353,
- "name": "SWAP1"
- },
- {
- "begin": 1340,
- "end": 1353,
- "name": "DUP2"
- },
- {
- "begin": 1340,
- "end": 1353,
- "name": "MSTORE"
- },
- {
- "begin": 1340,
- "end": 1353,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 1340,
- "end": 1353,
- "name": "DUP2"
- },
- {
- "begin": 1340,
- "end": 1353,
- "name": "SWAP1"
- },
- {
- "begin": 1340,
- "end": 1353,
- "name": "MSTORE"
- },
- {
- "begin": 1340,
- "end": 1353,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 1340,
- "end": 1353,
- "name": "SWAP1"
- },
- {
- "begin": 1340,
- "end": 1353,
- "name": "SHA3"
- },
- {
- "begin": 1340,
- "end": 1353,
- "name": "SLOAD"
- },
- {
- "begin": 1314,
- "end": 1336,
- "name": "DUP4"
- },
- {
- "begin": 1314,
- "end": 1336,
- "name": "DUP2"
- },
- {
- "begin": 1314,
- "end": 1336,
- "name": "ADD"
- },
- {
- "begin": 1314,
- "end": 1353,
- "name": "LT"
- },
- {
- "begin": 1314,
- "end": 1353,
- "name": "ISZERO"
- },
- {
- "begin": 1238,
- "end": 1353,
- "name": "tag",
- "value": "47"
- },
- {
- "begin": 1238,
- "end": 1353,
- "name": "JUMPDEST"
- },
- {
- "begin": 1234,
- "end": 1669,
- "name": "ISZERO"
- },
- {
- "begin": 1234,
- "end": 1669,
- "name": "PUSH [tag]",
- "value": "48"
- },
- {
- "begin": 1234,
- "end": 1669,
- "name": "JUMPI"
- },
- {
- "begin": 1378,
- "end": 1391,
- "name": "PUSH",
- "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
- },
- {
- "begin": 1378,
- "end": 1391,
- "name": "DUP1"
- },
- {
- "begin": 1378,
- "end": 1391,
- "name": "DUP6"
- },
- {
- "begin": 1378,
- "end": 1391,
- "name": "AND"
- },
- {
- "begin": 1378,
- "end": 1386,
- "name": "PUSH",
- "value": "0"
- },
- {
- "begin": 1378,
- "end": 1391,
- "name": "SWAP1"
- },
- {
- "begin": 1378,
- "end": 1391,
- "name": "DUP2"
- },
- {
- "begin": 1378,
- "end": 1391,
- "name": "MSTORE"
- },
- {
- "begin": 1378,
- "end": 1391,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 1378,
- "end": 1391,
- "name": "DUP2"
- },
- {
- "begin": 1378,
- "end": 1391,
- "name": "SWAP1"
- },
- {
- "begin": 1378,
- "end": 1391,
- "name": "MSTORE"
- },
- {
- "begin": 1378,
- "end": 1391,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 1378,
- "end": 1391,
- "name": "DUP1"
- },
- {
- "begin": 1378,
- "end": 1391,
- "name": "DUP3"
- },
- {
- "begin": 1378,
- "end": 1391,
- "name": "SHA3"
- },
- {
- "begin": 1378,
- "end": 1401,
- "name": "DUP1"
- },
- {
- "begin": 1378,
- "end": 1401,
- "name": "SLOAD"
- },
- {
- "begin": 1378,
- "end": 1401,
- "name": "DUP8"
- },
- {
- "begin": 1378,
- "end": 1401,
- "name": "ADD"
- },
- {
- "begin": 1378,
- "end": 1401,
- "name": "SWAP1"
- },
- {
- "begin": 1378,
- "end": 1401,
- "name": "SSTORE"
- },
- {
- "begin": 1415,
- "end": 1430,
- "name": "SWAP2"
- },
- {
- "begin": 1415,
- "end": 1430,
- "name": "DUP8"
- },
- {
- "begin": 1415,
- "end": 1430,
- "name": "AND"
- },
- {
- "begin": 1415,
- "end": 1430,
- "name": "DUP2"
- },
- {
- "begin": 1415,
- "end": 1430,
- "name": "MSTORE"
- },
- {
- "begin": 1415,
- "end": 1430,
- "name": "SHA3"
- },
- {
- "begin": 1415,
- "end": 1440,
- "name": "DUP1"
- },
- {
- "begin": 1415,
- "end": 1440,
- "name": "SLOAD"
- },
- {
- "begin": 1415,
- "end": 1440,
- "name": "DUP5"
- },
- {
- "begin": 1415,
- "end": 1440,
- "name": "SWAP1"
- },
- {
- "begin": 1415,
- "end": 1440,
- "name": "SUB"
- },
- {
- "begin": 1415,
- "end": 1440,
- "name": "SWAP1"
- },
- {
- "begin": 1415,
- "end": 1440,
- "name": "SSTORE"
- },
- {
- "begin": 768,
- "end": 778,
- "name": "PUSH",
- "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
- },
- {
- "begin": 1458,
- "end": 1478,
- "name": "DUP2"
- },
- {
- "begin": 1458,
- "end": 1478,
- "name": "LT"
- },
- {
- "begin": 1454,
- "end": 1549,
- "name": "ISZERO"
- },
- {
- "begin": 1454,
- "end": 1549,
- "name": "PUSH [tag]",
- "value": "49"
- },
- {
- "begin": 1454,
- "end": 1549,
- "name": "JUMPI"
- },
- {
- "begin": 1498,
- "end": 1512,
- "name": "PUSH",
- "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
- },
- {
- "begin": 1498,
- "end": 1512,
- "name": "DUP1"
- },
- {
- "begin": 1498,
- "end": 1512,
- "name": "DUP7"
- },
- {
- "begin": 1498,
- "end": 1512,
- "name": "AND"
- },
- {
- "begin": 1498,
- "end": 1512,
- "name": "PUSH",
- "value": "0"
- },
- {
- "begin": 1498,
- "end": 1512,
- "name": "SWAP1"
- },
- {
- "begin": 1498,
- "end": 1512,
- "name": "DUP2"
- },
- {
- "begin": 1498,
- "end": 1512,
- "name": "MSTORE"
- },
- {
- "begin": 1498,
- "end": 1505,
- "name": "PUSH",
- "value": "1"
- },
- {
- "begin": 1498,
- "end": 1512,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 1498,
- "end": 1512,
- "name": "SWAP1"
- },
- {
- "begin": 1498,
- "end": 1512,
- "name": "DUP2"
- },
- {
- "begin": 1498,
- "end": 1512,
- "name": "MSTORE"
- },
- {
- "begin": 1498,
- "end": 1512,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 1498,
- "end": 1512,
- "name": "DUP1"
- },
- {
- "begin": 1498,
- "end": 1512,
- "name": "DUP4"
- },
- {
- "begin": 1498,
- "end": 1512,
- "name": "SHA3"
- },
- {
- "begin": 1513,
- "end": 1523,
- "name": "CALLER"
- },
- {
- "begin": 1498,
- "end": 1524,
- "name": "SWAP1"
- },
- {
- "begin": 1498,
- "end": 1524,
- "name": "SWAP5"
- },
- {
- "begin": 1498,
- "end": 1524,
- "name": "AND"
- },
- {
- "begin": 1498,
- "end": 1524,
- "name": "DUP4"
- },
- {
- "begin": 1498,
- "end": 1524,
- "name": "MSTORE"
- },
- {
- "begin": 1498,
- "end": 1524,
- "name": "SWAP3"
- },
- {
- "begin": 1498,
- "end": 1524,
- "name": "SWAP1"
- },
- {
- "begin": 1498,
- "end": 1524,
- "name": "MSTORE"
- },
- {
- "begin": 1498,
- "end": 1524,
- "name": "SHA3"
- },
- {
- "begin": 1498,
- "end": 1534,
- "name": "DUP1"
- },
- {
- "begin": 1498,
- "end": 1534,
- "name": "SLOAD"
- },
- {
- "begin": 1498,
- "end": 1534,
- "name": "DUP5"
- },
- {
- "begin": 1498,
- "end": 1534,
- "name": "SWAP1"
- },
- {
- "begin": 1498,
- "end": 1534,
- "name": "SUB"
- },
- {
- "begin": 1498,
- "end": 1534,
- "name": "SWAP1"
- },
- {
- "begin": 1498,
- "end": 1534,
- "name": "SSTORE"
- },
- {
- "begin": 1454,
- "end": 1549,
- "name": "tag",
- "value": "49"
- },
- {
- "begin": 1454,
- "end": 1549,
- "name": "JUMPDEST"
- },
- {
- "begin": 1578,
- "end": 1581,
- "name": "DUP4"
- },
- {
- "begin": 1562,
- "end": 1590,
- "name": "PUSH",
- "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
- },
- {
- "begin": 1562,
- "end": 1590,
- "name": "AND"
- },
- {
- "begin": 1571,
- "end": 1576,
- "name": "DUP6"
- },
- {
- "begin": 1562,
- "end": 1590,
- "name": "PUSH",
- "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
- },
- {
- "begin": 1562,
- "end": 1590,
- "name": "AND"
- },
- {
- "begin": 1562,
- "end": 1590,
- "name": "PUSH",
- "value": "DDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF"
- },
- {
- "begin": 1583,
- "end": 1589,
- "name": "DUP6"
- },
- {
- "begin": 1562,
- "end": 1590,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 1562,
- "end": 1590,
- "name": "MLOAD"
- },
- {
- "begin": 1562,
- "end": 1590,
- "name": "DUP1"
- },
- {
- "begin": 1562,
- "end": 1590,
- "name": "DUP3"
- },
- {
- "begin": 1562,
- "end": 1590,
- "name": "DUP2"
- },
- {
- "begin": 1562,
- "end": 1590,
- "name": "MSTORE"
- },
- {
- "begin": 1562,
- "end": 1590,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 1562,
- "end": 1590,
- "name": "ADD"
- },
- {
- "begin": 1562,
- "end": 1590,
- "name": "SWAP2"
- },
- {
- "begin": 1562,
- "end": 1590,
- "name": "POP"
- },
- {
- "begin": 1562,
- "end": 1590,
- "name": "POP"
- },
- {
- "begin": 1562,
- "end": 1590,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 1562,
- "end": 1590,
- "name": "MLOAD"
- },
- {
- "begin": 1562,
- "end": 1590,
- "name": "DUP1"
- },
- {
- "begin": 1562,
- "end": 1590,
- "name": "SWAP2"
- },
- {
- "begin": 1562,
- "end": 1590,
- "name": "SUB"
- },
- {
- "begin": 1562,
- "end": 1590,
- "name": "SWAP1"
- },
- {
- "begin": 1562,
- "end": 1590,
- "name": "LOG3"
- },
- {
- "begin": 1611,
- "end": 1615,
- "name": "PUSH",
- "value": "1"
- },
- {
- "begin": 1604,
- "end": 1615,
- "name": "SWAP2"
- },
- {
- "begin": 1604,
- "end": 1615,
- "name": "POP"
- },
- {
- "begin": 1604,
- "end": 1615,
- "name": "PUSH [tag]",
- "value": "50"
- },
- {
- "begin": 1604,
- "end": 1615,
- "name": "JUMP"
- },
- {
- "begin": 1234,
- "end": 1669,
- "name": "tag",
- "value": "48"
- },
- {
- "begin": 1234,
- "end": 1669,
- "name": "JUMPDEST"
- },
- {
- "begin": 1653,
- "end": 1658,
- "name": "PUSH",
- "value": "0"
- },
- {
- "begin": 1646,
- "end": 1658,
- "name": "SWAP2"
- },
- {
- "begin": 1646,
- "end": 1658,
- "name": "POP"
- },
- {
- "begin": 1234,
- "end": 1669,
- "name": "tag",
- "value": "50"
- },
- {
- "begin": 1234,
- "end": 1669,
- "name": "JUMPDEST"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "tag",
- "value": "45"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "JUMPDEST"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "POP"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "SWAP4"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "SWAP3"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "POP"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "POP"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "POP"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "JUMP",
- "value": "[out]"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "tag",
- "value": "28"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "JUMPDEST"
- },
- {
- "begin": 929,
- "end": 931,
- "name": "PUSH",
- "value": "12"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "DUP2"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "JUMP",
- "value": "[out]"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "tag",
- "value": "31"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "JUMPDEST"
- },
- {
- "begin": 1058,
- "end": 1074,
- "name": "PUSH",
- "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
- },
- {
- "begin": 1058,
- "end": 1074,
- "name": "DUP2"
- },
- {
- "begin": 1058,
- "end": 1074,
- "name": "AND"
- },
- {
- "begin": 1035,
- "end": 1039,
- "name": "PUSH",
- "value": "0"
- },
- {
- "begin": 1058,
- "end": 1074,
- "name": "SWAP1"
- },
- {
- "begin": 1058,
- "end": 1074,
- "name": "DUP2"
- },
- {
- "begin": 1058,
- "end": 1074,
- "name": "MSTORE"
- },
- {
- "begin": 1058,
- "end": 1074,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 1058,
- "end": 1074,
- "name": "DUP2"
- },
- {
- "begin": 1058,
- "end": 1074,
- "name": "SWAP1"
- },
- {
- "begin": 1058,
- "end": 1074,
- "name": "MSTORE"
- },
- {
- "begin": 1058,
- "end": 1074,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 1058,
- "end": 1074,
- "name": "SWAP1"
- },
- {
- "begin": 1058,
- "end": 1074,
- "name": "SHA3"
- },
- {
- "begin": 1058,
- "end": 1074,
- "name": "SLOAD"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "tag",
- "value": "51"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "JUMPDEST"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "SWAP2"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "SWAP1"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "POP"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "JUMP",
- "value": "[out]"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "tag",
- "value": "34"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "JUMPDEST"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "DUP1"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "MLOAD"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "DUP1"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "DUP3"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "ADD"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "SWAP1"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "SWAP2"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "MSTORE"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "PUSH",
- "value": "3"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "DUP2"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "MSTORE"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "PUSH",
- "value": "5A52580000000000000000000000000000000000000000000000000000000000"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "DUP3"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "ADD"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "MSTORE"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "DUP2"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "JUMP",
- "value": "[out]"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "tag",
- "value": "40"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "JUMPDEST"
- },
- {
- "begin": 267,
- "end": 287,
- "name": "PUSH",
- "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
- },
- {
- "begin": 276,
- "end": 286,
- "name": "CALLER"
- },
- {
- "begin": 267,
- "end": 287,
- "name": "AND"
- },
- {
- "begin": 178,
- "end": 182,
- "name": "PUSH",
- "value": "0"
- },
- {
- "begin": 267,
- "end": 287,
- "name": "SWAP1"
- },
- {
- "begin": 267,
- "end": 287,
- "name": "DUP2"
- },
- {
- "begin": 267,
- "end": 287,
- "name": "MSTORE"
- },
- {
- "begin": 267,
- "end": 287,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 267,
- "end": 287,
- "name": "DUP2"
- },
- {
- "begin": 267,
- "end": 287,
- "name": "SWAP1"
- },
- {
- "begin": 267,
- "end": 287,
- "name": "MSTORE"
- },
- {
- "begin": 267,
- "end": 287,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 267,
- "end": 287,
- "name": "DUP2"
- },
- {
- "begin": 267,
- "end": 287,
- "name": "SHA3"
- },
- {
- "begin": 267,
- "end": 287,
- "name": "SLOAD"
- },
- {
- "begin": 267,
- "end": 297,
- "name": "DUP3"
- },
- {
- "begin": 267,
- "end": 297,
- "name": "SWAP1"
- },
- {
- "begin": 267,
- "end": 297,
- "name": "LT"
- },
- {
- "begin": 267,
- "end": 297,
- "name": "DUP1"
- },
- {
- "begin": 267,
- "end": 297,
- "name": "ISZERO"
- },
- {
- "begin": 267,
- "end": 297,
- "name": "SWAP1"
- },
- {
- "begin": 267,
- "end": 340,
- "name": "PUSH [tag]",
- "value": "53"
- },
- {
- "begin": 267,
- "end": 340,
- "name": "JUMPI"
- },
- {
- "begin": -1,
- "end": -1,
- "name": "POP"
- },
- {
- "begin": 327,
- "end": 340,
- "name": "PUSH",
- "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
- },
- {
- "begin": 327,
- "end": 340,
- "name": "DUP4"
- },
- {
- "begin": 327,
- "end": 340,
- "name": "AND"
- },
- {
- "begin": 327,
- "end": 335,
- "name": "PUSH",
- "value": "0"
- },
- {
- "begin": 327,
- "end": 340,
- "name": "SWAP1"
- },
- {
- "begin": 327,
- "end": 340,
- "name": "DUP2"
- },
- {
- "begin": 327,
- "end": 340,
- "name": "MSTORE"
- },
- {
- "begin": 327,
- "end": 340,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 327,
- "end": 340,
- "name": "DUP2"
- },
- {
- "begin": 327,
- "end": 340,
- "name": "SWAP1"
- },
- {
- "begin": 327,
- "end": 340,
- "name": "MSTORE"
- },
- {
- "begin": 327,
- "end": 340,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 327,
- "end": 340,
- "name": "SWAP1"
- },
- {
- "begin": 327,
- "end": 340,
- "name": "SHA3"
- },
- {
- "begin": 327,
- "end": 340,
- "name": "SLOAD"
- },
- {
- "begin": 301,
- "end": 323,
- "name": "DUP3"
- },
- {
- "begin": 301,
- "end": 323,
- "name": "DUP2"
- },
- {
- "begin": 301,
- "end": 323,
- "name": "ADD"
- },
- {
- "begin": 301,
- "end": 340,
- "name": "LT"
- },
- {
- "begin": 301,
- "end": 340,
- "name": "ISZERO"
- },
- {
- "begin": 267,
- "end": 340,
- "name": "tag",
- "value": "53"
- },
- {
- "begin": 267,
- "end": 340,
- "name": "JUMPDEST"
- },
- {
- "begin": 263,
- "end": 529,
- "name": "ISZERO"
- },
- {
- "begin": 263,
- "end": 529,
- "name": "PUSH [tag]",
- "value": "54"
- },
- {
- "begin": 263,
- "end": 529,
- "name": "JUMPI"
- },
- {
- "begin": 356,
- "end": 376,
- "name": "PUSH",
- "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
- },
- {
- "begin": 365,
- "end": 375,
- "name": "CALLER"
- },
- {
- "begin": 356,
- "end": 376,
- "name": "DUP2"
- },
- {
- "begin": 356,
- "end": 376,
- "name": "AND"
- },
- {
- "begin": 356,
- "end": 364,
- "name": "PUSH",
- "value": "0"
- },
- {
- "begin": 356,
- "end": 376,
- "name": "DUP2"
- },
- {
- "begin": 356,
- "end": 376,
- "name": "DUP2"
- },
- {
- "begin": 356,
- "end": 376,
- "name": "MSTORE"
- },
- {
- "begin": 356,
- "end": 376,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 356,
- "end": 376,
- "name": "DUP2"
- },
- {
- "begin": 356,
- "end": 376,
- "name": "DUP2"
- },
- {
- "begin": 356,
- "end": 376,
- "name": "MSTORE"
- },
- {
- "begin": 356,
- "end": 376,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 356,
- "end": 376,
- "name": "DUP1"
- },
- {
- "begin": 356,
- "end": 376,
- "name": "DUP4"
- },
- {
- "begin": 356,
- "end": 376,
- "name": "SHA3"
- },
- {
- "begin": 356,
- "end": 386,
- "name": "DUP1"
- },
- {
- "begin": 356,
- "end": 386,
- "name": "SLOAD"
- },
- {
- "begin": 356,
- "end": 386,
- "name": "DUP9"
- },
- {
- "begin": 356,
- "end": 386,
- "name": "SWAP1"
- },
- {
- "begin": 356,
- "end": 386,
- "name": "SUB"
- },
- {
- "begin": 356,
- "end": 386,
- "name": "SWAP1"
- },
- {
- "begin": 356,
- "end": 386,
- "name": "SSTORE"
- },
- {
- "begin": 400,
- "end": 413,
- "name": "SWAP4"
- },
- {
- "begin": 400,
- "end": 413,
- "name": "DUP8"
- },
- {
- "begin": 400,
- "end": 413,
- "name": "AND"
- },
- {
- "begin": 400,
- "end": 413,
- "name": "DUP1"
- },
- {
- "begin": 400,
- "end": 413,
- "name": "DUP4"
- },
- {
- "begin": 400,
- "end": 413,
- "name": "MSTORE"
- },
- {
- "begin": 400,
- "end": 413,
- "name": "SWAP2"
- },
- {
- "begin": 400,
- "end": 413,
- "name": "DUP5"
- },
- {
- "begin": 400,
- "end": 413,
- "name": "SWAP1"
- },
- {
- "begin": 400,
- "end": 413,
- "name": "SHA3"
- },
- {
- "begin": 400,
- "end": 423,
- "name": "DUP1"
- },
- {
- "begin": 400,
- "end": 423,
- "name": "SLOAD"
- },
- {
- "begin": 400,
- "end": 423,
- "name": "DUP8"
- },
- {
- "begin": 400,
- "end": 423,
- "name": "ADD"
- },
- {
- "begin": 400,
- "end": 423,
- "name": "SWAP1"
- },
- {
- "begin": 400,
- "end": 423,
- "name": "SSTORE"
- },
- {
- "begin": 437,
- "end": 470,
- "name": "DUP4"
- },
- {
- "begin": 437,
- "end": 470,
- "name": "MLOAD"
- },
- {
- "begin": 437,
- "end": 470,
- "name": "DUP7"
- },
- {
- "begin": 437,
- "end": 470,
- "name": "DUP2"
- },
- {
- "begin": 437,
- "end": 470,
- "name": "MSTORE"
- },
- {
- "begin": 437,
- "end": 470,
- "name": "SWAP4"
- },
- {
- "begin": 437,
- "end": 470,
- "name": "MLOAD"
- },
- {
- "begin": 400,
- "end": 413,
- "name": "SWAP2"
- },
- {
- "begin": 400,
- "end": 413,
- "name": "SWAP4"
- },
- {
- "begin": 437,
- "end": 470,
- "name": "PUSH",
- "value": "DDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF"
- },
- {
- "begin": 437,
- "end": 470,
- "name": "SWAP3"
- },
- {
- "begin": 437,
- "end": 470,
- "name": "SWAP1"
- },
- {
- "begin": 437,
- "end": 470,
- "name": "DUP2"
- },
- {
- "begin": 437,
- "end": 470,
- "name": "SWAP1"
- },
- {
- "begin": 437,
- "end": 470,
- "name": "SUB"
- },
- {
- "begin": 437,
- "end": 470,
- "name": "SWAP1"
- },
- {
- "begin": 437,
- "end": 470,
- "name": "SWAP2"
- },
- {
- "begin": 437,
- "end": 470,
- "name": "ADD"
- },
- {
- "begin": 437,
- "end": 470,
- "name": "SWAP1"
- },
- {
- "begin": 437,
- "end": 470,
- "name": "LOG3"
- },
- {
- "begin": -1,
- "end": -1,
- "name": "POP"
- },
- {
- "begin": 491,
- "end": 495,
- "name": "PUSH",
- "value": "1"
- },
- {
- "begin": 484,
- "end": 495,
- "name": "PUSH [tag]",
- "value": "44"
- },
- {
- "begin": 484,
- "end": 495,
- "name": "JUMP"
- },
- {
- "begin": 263,
- "end": 529,
- "name": "tag",
- "value": "54"
- },
- {
- "begin": 263,
- "end": 529,
- "name": "JUMPDEST"
- },
- {
- "begin": -1,
- "end": -1,
- "name": "POP"
- },
- {
- "begin": 521,
- "end": 526,
- "name": "PUSH",
- "value": "0"
- },
- {
- "begin": 514,
- "end": 526,
- "name": "PUSH [tag]",
- "value": "44"
- },
- {
- "begin": 514,
- "end": 526,
- "name": "JUMP"
- },
- {
- "begin": 263,
- "end": 529,
- "name": "tag",
- "value": "55"
- },
- {
- "begin": 263,
- "end": 529,
- "name": "JUMPDEST"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "tag",
- "value": "52"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "JUMPDEST"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "SWAP3"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "SWAP2"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "POP"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "POP"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "JUMP",
- "value": "[out]"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "tag",
- "value": "43"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "JUMPDEST"
- },
- {
- "begin": 1374,
- "end": 1389,
- "name": "PUSH",
- "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
- },
- {
- "begin": 1374,
- "end": 1389,
- "name": "DUP1"
- },
- {
- "begin": 1374,
- "end": 1389,
- "name": "DUP4"
- },
- {
- "begin": 1374,
- "end": 1389,
- "name": "AND"
- },
- {
- "begin": 1351,
- "end": 1355,
- "name": "PUSH",
- "value": "0"
- },
- {
- "begin": 1374,
- "end": 1389,
- "name": "SWAP1"
- },
- {
- "begin": 1374,
- "end": 1389,
- "name": "DUP2"
- },
- {
- "begin": 1374,
- "end": 1389,
- "name": "MSTORE"
- },
- {
- "begin": 1374,
- "end": 1381,
- "name": "PUSH",
- "value": "1"
- },
- {
- "begin": 1374,
- "end": 1389,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 1374,
- "end": 1389,
- "name": "SWAP1"
- },
- {
- "begin": 1374,
- "end": 1389,
- "name": "DUP2"
- },
- {
- "begin": 1374,
- "end": 1389,
- "name": "MSTORE"
- },
- {
- "begin": 1374,
- "end": 1389,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 1374,
- "end": 1389,
- "name": "DUP1"
- },
- {
- "begin": 1374,
- "end": 1389,
- "name": "DUP4"
- },
- {
- "begin": 1374,
- "end": 1389,
- "name": "SHA3"
- },
- {
- "begin": 1374,
- "end": 1399,
- "name": "SWAP4"
- },
- {
- "begin": 1374,
- "end": 1399,
- "name": "DUP6"
- },
- {
- "begin": 1374,
- "end": 1399,
- "name": "AND"
- },
- {
- "begin": 1374,
- "end": 1399,
- "name": "DUP4"
- },
- {
- "begin": 1374,
- "end": 1399,
- "name": "MSTORE"
- },
- {
- "begin": 1374,
- "end": 1399,
- "name": "SWAP3"
- },
- {
- "begin": 1374,
- "end": 1399,
- "name": "SWAP1"
- },
- {
- "begin": 1374,
- "end": 1399,
- "name": "MSTORE"
- },
- {
- "begin": 1374,
- "end": 1399,
- "name": "SHA3"
- },
- {
- "begin": 1374,
- "end": 1399,
- "name": "SLOAD"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "tag",
- "value": "56"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "JUMPDEST"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "SWAP3"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "SWAP2"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "POP"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "POP"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "JUMP",
- "value": "[out]"
- }
- ]
- }
- }
- },
- "methodIdentifiers": {
- "allowance(address,address)": "dd62ed3e",
- "approve(address,uint256)": "095ea7b3",
- "balanceOf(address)": "70a08231",
- "decimals()": "313ce567",
- "name()": "06fdde03",
- "symbol()": "95d89b41",
- "totalSupply()": "18160ddd",
- "transfer(address,uint256)": "a9059cbb",
- "transferFrom(address,address,uint256)": "23b872dd"
- }
- },
- "metadata": "{\"compiler\":{\"version\":\"0.4.11+commit.68ef5810\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":true,\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_spender\",\"type\":\"address\"},{\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_from\",\"type\":\"address\"},{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"},{\"name\":\"_spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"inputs\":[],\"payable\":false,\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"_from\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"_to\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"_owner\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"_spender\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"}],\"devdoc\":{\"methods\":{\"transferFrom(address,address,uint256)\":{\"details\":\"ERC20 transferFrom, modified such that an allowance of MAX_UINT represents an unlimited allowance.\",\"params\":{\"_from\":\"Address to transfer from.\",\"_to\":\"Address to transfer to.\",\"_value\":\"Amount to transfer.\"},\"return\":\"Success of transfer.\"}}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"2.0.0/tokens/ZRXToken/ZRXToken.sol\":\"ZRXToken\"},\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":1000000},\"remappings\":[]},\"sources\":{\"1.0.0/ERC20Token/ERC20Token_v1.sol\":{\"keccak256\":\"0x3d710b436c430d6fe49f64b091555405360d76da6454b93faa8e213eea34a96d\",\"urls\":[\"bzzr://d12710a563415ad98ff28ecb3aab0b68467b3d023e7c130c73ed9918ef86158e\"]},\"1.0.0/Token/Token_v1.sol\":{\"keccak256\":\"0x35a82bc7bc0994caa97f8ea44660b9b5e796acfe72705b5ff7ed8f2a3c47ff37\",\"urls\":[\"bzzr://a62ae857a4cf2e8948e36d02470c612ac1a5ac20ebe1c1b553ad1ed8becb634e\"]},\"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":{\"keccak256\":\"0x2e1f4b899081cedd8940a9cd0f0f7413264c883312ed0ba9c53885766fe0a1a5\",\"urls\":[\"bzzr://47c42a58e56ffe81e49c8aabd3c391f5fa807fea299b3a2178501e3669baeb52\"]},\"2.0.0/tokens/ZRXToken/ZRXToken.sol\":{\"keccak256\":\"0x8c1c3401023b24d6248391a1f4596f3552caf846c9dcb2450110d7b6cc91acf1\",\"urls\":[\"bzzr://57a9912b95029fdeb1cb791f085472bef8bf3f68885b82035939d4ed5dceaa8f\"]}},\"version\":1}",
- "userdoc": {
- "methods": {}
- }
- },
- "sources": {
- "1.0.0/ERC20Token/ERC20Token_v1.sol": {
- "id": 0,
- "legacyAST": {
- "children": [
- {
- "attributes": {
- "literals": [
- "solidity",
- "^",
- "0.4",
- ".11"
- ]
- },
- "id": 126,
- "name": "PragmaDirective",
- "src": "0:24:0"
- },
- {
- "attributes": {
- "file": "../Token/Token_v1.sol"
- },
- "id": 128,
- "name": "ImportDirective",
- "src": "26:58:0"
- },
- {
- "attributes": {
- "fullyImplemented": true,
- "isLibrary": false,
- "linearizedBaseContracts": [
- 322,
- 397
- ],
- "name": "ERC20Token_v1"
- },
- "children": [
- {
- "children": [
- {
- "attributes": {
- "name": "Token"
- },
- "id": 129,
- "name": "UserDefinedTypeName",
- "src": "112:5:0"
- }
- ],
- "id": 130,
- "name": "InheritanceSpecifier",
- "src": "112:5:0"
- },
- {
- "attributes": {
- "constant": false,
- "name": "transfer",
- "payable": false,
- "visibility": "public"
- },
- "children": [
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "name": "_to",
- "storageLocation": "default",
- "type": "address",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "address"
- },
- "id": 131,
- "name": "ElementaryTypeName",
- "src": "143:7:0"
- }
- ],
- "id": 132,
- "name": "VariableDeclaration",
- "src": "143:11:0"
- },
- {
- "attributes": {
- "constant": false,
- "name": "_value",
- "storageLocation": "default",
- "type": "uint256",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "uint"
- },
- "id": 133,
- "name": "ElementaryTypeName",
- "src": "156:4:0"
- }
- ],
- "id": 134,
- "name": "VariableDeclaration",
- "src": "156:11:0"
- }
- ],
- "id": 135,
- "name": "ParameterList",
- "src": "142:26:0"
- },
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "name": "",
- "storageLocation": "default",
- "type": "bool",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "bool"
- },
- "id": 136,
- "name": "ElementaryTypeName",
- "src": "178:4:0"
- }
- ],
- "id": 137,
- "name": "VariableDeclaration",
- "src": "178:4:0"
- }
- ],
- "id": 138,
- "name": "ParameterList",
- "src": "177:6:0"
- },
- {
- "children": [
- {
- "children": [
- {
- "attributes": {
- "operator": "&&",
- "type": "bool"
- },
- "children": [
- {
- "attributes": {
- "operator": ">=",
- "type": "bool"
- },
- "children": [
- {
- "attributes": {
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => uint256)",
- "value": "balances"
- },
- "id": 139,
- "name": "Identifier",
- "src": "267:8:0"
- },
- {
- "attributes": {
- "member_name": "sender",
- "type": "address"
- },
- "children": [
- {
- "attributes": {
- "type": "msg",
- "value": "msg"
- },
- "id": 140,
- "name": "Identifier",
- "src": "276:3:0"
- }
- ],
- "id": 141,
- "name": "MemberAccess",
- "src": "276:10:0"
- }
- ],
- "id": 142,
- "name": "IndexAccess",
- "src": "267:20:0"
- },
- {
- "attributes": {
- "type": "uint256",
- "value": "_value"
- },
- "id": 143,
- "name": "Identifier",
- "src": "291:6:0"
- }
- ],
- "id": 144,
- "name": "BinaryOperation",
- "src": "267:30:0"
- },
- {
- "attributes": {
- "operator": ">=",
- "type": "bool"
- },
- "children": [
- {
- "attributes": {
- "operator": "+",
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => uint256)",
- "value": "balances"
- },
- "id": 145,
- "name": "Identifier",
- "src": "301:8:0"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_to"
- },
- "id": 146,
- "name": "Identifier",
- "src": "310:3:0"
- }
- ],
- "id": 147,
- "name": "IndexAccess",
- "src": "301:13:0"
- },
- {
- "attributes": {
- "type": "uint256",
- "value": "_value"
- },
- "id": 148,
- "name": "Identifier",
- "src": "317:6:0"
- }
- ],
- "id": 149,
- "name": "BinaryOperation",
- "src": "301:22:0"
- },
- {
- "attributes": {
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => uint256)",
- "value": "balances"
- },
- "id": 150,
- "name": "Identifier",
- "src": "327:8:0"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_to"
- },
- "id": 151,
- "name": "Identifier",
- "src": "336:3:0"
- }
- ],
- "id": 152,
- "name": "IndexAccess",
- "src": "327:13:0"
- }
- ],
- "id": 153,
- "name": "BinaryOperation",
- "src": "301:39:0"
- }
- ],
- "id": 154,
- "name": "BinaryOperation",
- "src": "267:73:0"
- },
- {
- "children": [
- {
- "children": [
- {
- "attributes": {
- "operator": "-=",
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => uint256)",
- "value": "balances"
- },
- "id": 155,
- "name": "Identifier",
- "src": "356:8:0"
- },
- {
- "attributes": {
- "member_name": "sender",
- "type": "address"
- },
- "children": [
- {
- "attributes": {
- "type": "msg",
- "value": "msg"
- },
- "id": 156,
- "name": "Identifier",
- "src": "365:3:0"
- }
- ],
- "id": 157,
- "name": "MemberAccess",
- "src": "365:10:0"
- }
- ],
- "id": 158,
- "name": "IndexAccess",
- "src": "356:20:0"
- },
- {
- "attributes": {
- "type": "uint256",
- "value": "_value"
- },
- "id": 159,
- "name": "Identifier",
- "src": "380:6:0"
- }
- ],
- "id": 160,
- "name": "Assignment",
- "src": "356:30:0"
- }
- ],
- "id": 161,
- "name": "ExpressionStatement",
- "src": "356:30:0"
- },
- {
- "children": [
- {
- "attributes": {
- "operator": "+=",
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => uint256)",
- "value": "balances"
- },
- "id": 162,
- "name": "Identifier",
- "src": "400:8:0"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_to"
- },
- "id": 163,
- "name": "Identifier",
- "src": "409:3:0"
- }
- ],
- "id": 164,
- "name": "IndexAccess",
- "src": "400:13:0"
- },
- {
- "attributes": {
- "type": "uint256",
- "value": "_value"
- },
- "id": 165,
- "name": "Identifier",
- "src": "417:6:0"
- }
- ],
- "id": 166,
- "name": "Assignment",
- "src": "400:23:0"
- }
- ],
- "id": 167,
- "name": "ExpressionStatement",
- "src": "400:23:0"
- },
- {
- "children": [
- {
- "attributes": {
- "type": "tuple()",
- "type_conversion": false
- },
- "children": [
- {
- "attributes": {
- "type": "function (address,address,uint256) constant",
- "value": "Transfer"
- },
- "id": 168,
- "name": "Identifier",
- "src": "437:8:0"
- },
- {
- "attributes": {
- "member_name": "sender",
- "type": "address"
- },
- "children": [
- {
- "attributes": {
- "type": "msg",
- "value": "msg"
- },
- "id": 169,
- "name": "Identifier",
- "src": "446:3:0"
- }
- ],
- "id": 170,
- "name": "MemberAccess",
- "src": "446:10:0"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_to"
- },
- "id": 171,
- "name": "Identifier",
- "src": "458:3:0"
- },
- {
- "attributes": {
- "type": "uint256",
- "value": "_value"
- },
- "id": 172,
- "name": "Identifier",
- "src": "463:6:0"
- }
- ],
- "id": 173,
- "name": "FunctionCall",
- "src": "437:33:0"
- }
- ],
- "id": 174,
- "name": "ExpressionStatement",
- "src": "437:33:0"
- },
- {
- "children": [
- {
- "attributes": {
- "hexvalue": "74727565",
- "subdenomination": null,
- "token": "true",
- "type": "bool",
- "value": "true"
- },
- "id": 175,
- "name": "Literal",
- "src": "491:4:0"
- }
- ],
- "id": 176,
- "name": "Return",
- "src": "484:11:0"
- }
- ],
- "id": 177,
- "name": "Block",
- "src": "342:164:0"
- },
- {
- "children": [
- {
- "children": [
- {
- "attributes": {
- "hexvalue": "66616c7365",
- "subdenomination": null,
- "token": "false",
- "type": "bool",
- "value": "false"
- },
- "id": 178,
- "name": "Literal",
- "src": "521:5:0"
- }
- ],
- "id": 179,
- "name": "Return",
- "src": "514:12:0"
- }
- ],
- "id": 180,
- "name": "Block",
- "src": "512:17:0"
- }
- ],
- "id": 181,
- "name": "IfStatement",
- "src": "263:266:0"
- }
- ],
- "id": 182,
- "name": "Block",
- "src": "184:351:0"
- }
- ],
- "id": 183,
- "name": "FunctionDefinition",
- "src": "125:410:0"
- },
- {
- "attributes": {
- "constant": false,
- "name": "transferFrom",
- "payable": false,
- "visibility": "public"
- },
- "children": [
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "name": "_from",
- "storageLocation": "default",
- "type": "address",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "address"
- },
- "id": 184,
- "name": "ElementaryTypeName",
- "src": "563:7:0"
- }
- ],
- "id": 185,
- "name": "VariableDeclaration",
- "src": "563:13:0"
- },
- {
- "attributes": {
- "constant": false,
- "name": "_to",
- "storageLocation": "default",
- "type": "address",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "address"
- },
- "id": 186,
- "name": "ElementaryTypeName",
- "src": "578:7:0"
- }
- ],
- "id": 187,
- "name": "VariableDeclaration",
- "src": "578:11:0"
- },
- {
- "attributes": {
- "constant": false,
- "name": "_value",
- "storageLocation": "default",
- "type": "uint256",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "uint"
- },
- "id": 188,
- "name": "ElementaryTypeName",
- "src": "591:4:0"
- }
- ],
- "id": 189,
- "name": "VariableDeclaration",
- "src": "591:11:0"
- }
- ],
- "id": 190,
- "name": "ParameterList",
- "src": "562:41:0"
- },
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "name": "",
- "storageLocation": "default",
- "type": "bool",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "bool"
- },
- "id": 191,
- "name": "ElementaryTypeName",
- "src": "613:4:0"
- }
- ],
- "id": 192,
- "name": "VariableDeclaration",
- "src": "613:4:0"
- }
- ],
- "id": 193,
- "name": "ParameterList",
- "src": "612:6:0"
- },
- {
- "children": [
- {
- "children": [
- {
- "attributes": {
- "operator": "&&",
- "type": "bool"
- },
- "children": [
- {
- "attributes": {
- "operator": "&&",
- "type": "bool"
- },
- "children": [
- {
- "attributes": {
- "operator": ">=",
- "type": "bool"
- },
- "children": [
- {
- "attributes": {
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => uint256)",
- "value": "balances"
- },
- "id": 194,
- "name": "Identifier",
- "src": "633:8:0"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_from"
- },
- "id": 195,
- "name": "Identifier",
- "src": "642:5:0"
- }
- ],
- "id": 196,
- "name": "IndexAccess",
- "src": "633:15:0"
- },
- {
- "attributes": {
- "type": "uint256",
- "value": "_value"
- },
- "id": 197,
- "name": "Identifier",
- "src": "652:6:0"
- }
- ],
- "id": 198,
- "name": "BinaryOperation",
- "src": "633:25:0"
- },
- {
- "attributes": {
- "operator": ">=",
- "type": "bool"
- },
- "children": [
- {
- "attributes": {
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => uint256)"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => mapping(address => uint256))",
- "value": "allowed"
- },
- "id": 199,
- "name": "Identifier",
- "src": "662:7:0"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_from"
- },
- "id": 200,
- "name": "Identifier",
- "src": "670:5:0"
- }
- ],
- "id": 201,
- "name": "IndexAccess",
- "src": "662:14:0"
- },
- {
- "attributes": {
- "member_name": "sender",
- "type": "address"
- },
- "children": [
- {
- "attributes": {
- "type": "msg",
- "value": "msg"
- },
- "id": 202,
- "name": "Identifier",
- "src": "677:3:0"
- }
- ],
- "id": 203,
- "name": "MemberAccess",
- "src": "677:10:0"
- }
- ],
- "id": 204,
- "name": "IndexAccess",
- "src": "662:26:0"
- },
- {
- "attributes": {
- "type": "uint256",
- "value": "_value"
- },
- "id": 205,
- "name": "Identifier",
- "src": "692:6:0"
- }
- ],
- "id": 206,
- "name": "BinaryOperation",
- "src": "662:36:0"
- }
- ],
- "id": 207,
- "name": "BinaryOperation",
- "src": "633:65:0"
- },
- {
- "attributes": {
- "operator": ">=",
- "type": "bool"
- },
- "children": [
- {
- "attributes": {
- "operator": "+",
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => uint256)",
- "value": "balances"
- },
- "id": 208,
- "name": "Identifier",
- "src": "702:8:0"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_to"
- },
- "id": 209,
- "name": "Identifier",
- "src": "711:3:0"
- }
- ],
- "id": 210,
- "name": "IndexAccess",
- "src": "702:13:0"
- },
- {
- "attributes": {
- "type": "uint256",
- "value": "_value"
- },
- "id": 211,
- "name": "Identifier",
- "src": "718:6:0"
- }
- ],
- "id": 212,
- "name": "BinaryOperation",
- "src": "702:22:0"
- },
- {
- "attributes": {
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => uint256)",
- "value": "balances"
- },
- "id": 213,
- "name": "Identifier",
- "src": "728:8:0"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_to"
- },
- "id": 214,
- "name": "Identifier",
- "src": "737:3:0"
- }
- ],
- "id": 215,
- "name": "IndexAccess",
- "src": "728:13:0"
- }
- ],
- "id": 216,
- "name": "BinaryOperation",
- "src": "702:39:0"
- }
- ],
- "id": 217,
- "name": "BinaryOperation",
- "src": "633:108:0"
- },
- {
- "children": [
- {
- "children": [
- {
- "attributes": {
- "operator": "+=",
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => uint256)",
- "value": "balances"
- },
- "id": 218,
- "name": "Identifier",
- "src": "757:8:0"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_to"
- },
- "id": 219,
- "name": "Identifier",
- "src": "766:3:0"
- }
- ],
- "id": 220,
- "name": "IndexAccess",
- "src": "757:13:0"
- },
- {
- "attributes": {
- "type": "uint256",
- "value": "_value"
- },
- "id": 221,
- "name": "Identifier",
- "src": "774:6:0"
- }
- ],
- "id": 222,
- "name": "Assignment",
- "src": "757:23:0"
- }
- ],
- "id": 223,
- "name": "ExpressionStatement",
- "src": "757:23:0"
- },
- {
- "children": [
- {
- "attributes": {
- "operator": "-=",
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => uint256)",
- "value": "balances"
- },
- "id": 224,
- "name": "Identifier",
- "src": "794:8:0"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_from"
- },
- "id": 225,
- "name": "Identifier",
- "src": "803:5:0"
- }
- ],
- "id": 226,
- "name": "IndexAccess",
- "src": "794:15:0"
- },
- {
- "attributes": {
- "type": "uint256",
- "value": "_value"
- },
- "id": 227,
- "name": "Identifier",
- "src": "813:6:0"
- }
- ],
- "id": 228,
- "name": "Assignment",
- "src": "794:25:0"
- }
- ],
- "id": 229,
- "name": "ExpressionStatement",
- "src": "794:25:0"
- },
- {
- "children": [
- {
- "attributes": {
- "operator": "-=",
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => uint256)"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => mapping(address => uint256))",
- "value": "allowed"
- },
- "id": 230,
- "name": "Identifier",
- "src": "833:7:0"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_from"
- },
- "id": 231,
- "name": "Identifier",
- "src": "841:5:0"
- }
- ],
- "id": 234,
- "name": "IndexAccess",
- "src": "833:14:0"
- },
- {
- "attributes": {
- "member_name": "sender",
- "type": "address"
- },
- "children": [
- {
- "attributes": {
- "type": "msg",
- "value": "msg"
- },
- "id": 232,
- "name": "Identifier",
- "src": "848:3:0"
- }
- ],
- "id": 233,
- "name": "MemberAccess",
- "src": "848:10:0"
- }
- ],
- "id": 235,
- "name": "IndexAccess",
- "src": "833:26:0"
- },
- {
- "attributes": {
- "type": "uint256",
- "value": "_value"
- },
- "id": 236,
- "name": "Identifier",
- "src": "863:6:0"
- }
- ],
- "id": 237,
- "name": "Assignment",
- "src": "833:36:0"
- }
- ],
- "id": 238,
- "name": "ExpressionStatement",
- "src": "833:36:0"
- },
- {
- "children": [
- {
- "attributes": {
- "type": "tuple()",
- "type_conversion": false
- },
- "children": [
- {
- "attributes": {
- "type": "function (address,address,uint256) constant",
- "value": "Transfer"
- },
- "id": 239,
- "name": "Identifier",
- "src": "883:8:0"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_from"
- },
- "id": 240,
- "name": "Identifier",
- "src": "892:5:0"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_to"
- },
- "id": 241,
- "name": "Identifier",
- "src": "899:3:0"
- },
- {
- "attributes": {
- "type": "uint256",
- "value": "_value"
- },
- "id": 242,
- "name": "Identifier",
- "src": "904:6:0"
- }
- ],
- "id": 243,
- "name": "FunctionCall",
- "src": "883:28:0"
- }
- ],
- "id": 244,
- "name": "ExpressionStatement",
- "src": "883:28:0"
- },
- {
- "children": [
- {
- "attributes": {
- "hexvalue": "74727565",
- "subdenomination": null,
- "token": "true",
- "type": "bool",
- "value": "true"
- },
- "id": 245,
- "name": "Literal",
- "src": "932:4:0"
- }
- ],
- "id": 246,
- "name": "Return",
- "src": "925:11:0"
- }
- ],
- "id": 247,
- "name": "Block",
- "src": "743:204:0"
- },
- {
- "children": [
- {
- "children": [
- {
- "attributes": {
- "hexvalue": "66616c7365",
- "subdenomination": null,
- "token": "false",
- "type": "bool",
- "value": "false"
- },
- "id": 248,
- "name": "Literal",
- "src": "962:5:0"
- }
- ],
- "id": 249,
- "name": "Return",
- "src": "955:12:0"
- }
- ],
- "id": 250,
- "name": "Block",
- "src": "953:17:0"
- }
- ],
- "id": 251,
- "name": "IfStatement",
- "src": "629:341:0"
- }
- ],
- "id": 252,
- "name": "Block",
- "src": "619:357:0"
- }
- ],
- "id": 253,
- "name": "FunctionDefinition",
- "src": "541:435:0"
- },
- {
- "attributes": {
- "constant": true,
- "name": "balanceOf",
- "payable": false,
- "visibility": "public"
- },
- "children": [
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "name": "_owner",
- "storageLocation": "default",
- "type": "address",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "address"
- },
- "id": 254,
- "name": "ElementaryTypeName",
- "src": "1001:7:0"
- }
- ],
- "id": 255,
- "name": "VariableDeclaration",
- "src": "1001:14:0"
- }
- ],
- "id": 256,
- "name": "ParameterList",
- "src": "1000:16:0"
- },
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "name": "",
- "storageLocation": "default",
- "type": "uint256",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "uint"
- },
- "id": 257,
- "name": "ElementaryTypeName",
- "src": "1035:4:0"
- }
- ],
- "id": 258,
- "name": "VariableDeclaration",
- "src": "1035:4:0"
- }
- ],
- "id": 259,
- "name": "ParameterList",
- "src": "1034:6:0"
- },
- {
- "children": [
- {
- "children": [
- {
- "attributes": {
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => uint256)",
- "value": "balances"
- },
- "id": 260,
- "name": "Identifier",
- "src": "1058:8:0"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_owner"
- },
- "id": 261,
- "name": "Identifier",
- "src": "1067:6:0"
- }
- ],
- "id": 262,
- "name": "IndexAccess",
- "src": "1058:16:0"
- }
- ],
- "id": 263,
- "name": "Return",
- "src": "1051:23:0"
- }
- ],
- "id": 264,
- "name": "Block",
- "src": "1041:40:0"
- }
- ],
- "id": 265,
- "name": "FunctionDefinition",
- "src": "982:99:0"
- },
- {
- "attributes": {
- "constant": false,
- "name": "approve",
- "payable": false,
- "visibility": "public"
- },
- "children": [
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "name": "_spender",
- "storageLocation": "default",
- "type": "address",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "address"
- },
- "id": 266,
- "name": "ElementaryTypeName",
- "src": "1104:7:0"
- }
- ],
- "id": 267,
- "name": "VariableDeclaration",
- "src": "1104:16:0"
- },
- {
- "attributes": {
- "constant": false,
- "name": "_value",
- "storageLocation": "default",
- "type": "uint256",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "uint"
- },
- "id": 268,
- "name": "ElementaryTypeName",
- "src": "1122:4:0"
- }
- ],
- "id": 269,
- "name": "VariableDeclaration",
- "src": "1122:11:0"
- }
- ],
- "id": 270,
- "name": "ParameterList",
- "src": "1103:31:0"
- },
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "name": "",
- "storageLocation": "default",
- "type": "bool",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "bool"
- },
- "id": 271,
- "name": "ElementaryTypeName",
- "src": "1144:4:0"
- }
- ],
- "id": 272,
- "name": "VariableDeclaration",
- "src": "1144:4:0"
- }
- ],
- "id": 273,
- "name": "ParameterList",
- "src": "1143:6:0"
- },
- {
- "children": [
- {
- "children": [
- {
- "attributes": {
- "operator": "=",
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => uint256)"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => mapping(address => uint256))",
- "value": "allowed"
- },
- "id": 274,
- "name": "Identifier",
- "src": "1160:7:0"
- },
- {
- "attributes": {
- "member_name": "sender",
- "type": "address"
- },
- "children": [
- {
- "attributes": {
- "type": "msg",
- "value": "msg"
- },
- "id": 275,
- "name": "Identifier",
- "src": "1168:3:0"
- }
- ],
- "id": 276,
- "name": "MemberAccess",
- "src": "1168:10:0"
- }
- ],
- "id": 278,
- "name": "IndexAccess",
- "src": "1160:19:0"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_spender"
- },
- "id": 277,
- "name": "Identifier",
- "src": "1180:8:0"
- }
- ],
- "id": 279,
- "name": "IndexAccess",
- "src": "1160:29:0"
- },
- {
- "attributes": {
- "type": "uint256",
- "value": "_value"
- },
- "id": 280,
- "name": "Identifier",
- "src": "1192:6:0"
- }
- ],
- "id": 281,
- "name": "Assignment",
- "src": "1160:38:0"
- }
- ],
- "id": 282,
- "name": "ExpressionStatement",
- "src": "1160:38:0"
- },
- {
- "children": [
- {
- "attributes": {
- "type": "tuple()",
- "type_conversion": false
- },
- "children": [
- {
- "attributes": {
- "type": "function (address,address,uint256) constant",
- "value": "Approval"
- },
- "id": 283,
- "name": "Identifier",
- "src": "1208:8:0"
- },
- {
- "attributes": {
- "member_name": "sender",
- "type": "address"
- },
- "children": [
- {
- "attributes": {
- "type": "msg",
- "value": "msg"
- },
- "id": 284,
- "name": "Identifier",
- "src": "1217:3:0"
- }
- ],
- "id": 285,
- "name": "MemberAccess",
- "src": "1217:10:0"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_spender"
- },
- "id": 286,
- "name": "Identifier",
- "src": "1229:8:0"
- },
- {
- "attributes": {
- "type": "uint256",
- "value": "_value"
- },
- "id": 287,
- "name": "Identifier",
- "src": "1239:6:0"
- }
- ],
- "id": 288,
- "name": "FunctionCall",
- "src": "1208:38:0"
- }
- ],
- "id": 289,
- "name": "ExpressionStatement",
- "src": "1208:38:0"
- },
- {
- "children": [
- {
- "attributes": {
- "hexvalue": "74727565",
- "subdenomination": null,
- "token": "true",
- "type": "bool",
- "value": "true"
- },
- "id": 290,
- "name": "Literal",
- "src": "1263:4:0"
- }
- ],
- "id": 291,
- "name": "Return",
- "src": "1256:11:0"
- }
- ],
- "id": 292,
- "name": "Block",
- "src": "1150:124:0"
- }
- ],
- "id": 293,
- "name": "FunctionDefinition",
- "src": "1087:187:0"
- },
- {
- "attributes": {
- "constant": true,
- "name": "allowance",
- "payable": false,
- "visibility": "public"
- },
- "children": [
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "name": "_owner",
- "storageLocation": "default",
- "type": "address",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "address"
- },
- "id": 294,
- "name": "ElementaryTypeName",
- "src": "1299:7:0"
- }
- ],
- "id": 295,
- "name": "VariableDeclaration",
- "src": "1299:14:0"
- },
- {
- "attributes": {
- "constant": false,
- "name": "_spender",
- "storageLocation": "default",
- "type": "address",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "address"
- },
- "id": 296,
- "name": "ElementaryTypeName",
- "src": "1315:7:0"
- }
- ],
- "id": 297,
- "name": "VariableDeclaration",
- "src": "1315:16:0"
- }
- ],
- "id": 298,
- "name": "ParameterList",
- "src": "1298:34:0"
- },
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "name": "",
- "storageLocation": "default",
- "type": "uint256",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "uint"
- },
- "id": 299,
- "name": "ElementaryTypeName",
- "src": "1351:4:0"
- }
- ],
- "id": 300,
- "name": "VariableDeclaration",
- "src": "1351:4:0"
- }
- ],
- "id": 301,
- "name": "ParameterList",
- "src": "1350:6:0"
- },
- {
- "children": [
- {
- "children": [
- {
- "attributes": {
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => uint256)"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => mapping(address => uint256))",
- "value": "allowed"
- },
- "id": 302,
- "name": "Identifier",
- "src": "1374:7:0"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_owner"
- },
- "id": 303,
- "name": "Identifier",
- "src": "1382:6:0"
- }
- ],
- "id": 304,
- "name": "IndexAccess",
- "src": "1374:15:0"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_spender"
- },
- "id": 305,
- "name": "Identifier",
- "src": "1390:8:0"
- }
- ],
- "id": 306,
- "name": "IndexAccess",
- "src": "1374:25:0"
- }
- ],
- "id": 307,
- "name": "Return",
- "src": "1367:32:0"
- }
- ],
- "id": 308,
- "name": "Block",
- "src": "1357:49:0"
- }
- ],
- "id": 309,
- "name": "FunctionDefinition",
- "src": "1280:126:0"
- },
- {
- "attributes": {
- "constant": false,
- "name": "balances",
- "storageLocation": "default",
- "type": "mapping(address => uint256)",
- "visibility": "internal"
- },
- "children": [
- {
- "children": [
- {
- "attributes": {
- "name": "address"
- },
- "id": 310,
- "name": "ElementaryTypeName",
- "src": "1421:7:0"
- },
- {
- "attributes": {
- "name": "uint"
- },
- "id": 311,
- "name": "ElementaryTypeName",
- "src": "1432:4:0"
- }
- ],
- "id": 312,
- "name": "Mapping",
- "src": "1412:25:0"
- }
- ],
- "id": 313,
- "name": "VariableDeclaration",
- "src": "1412:34:0"
- },
- {
- "attributes": {
- "constant": false,
- "name": "allowed",
- "storageLocation": "default",
- "type": "mapping(address => mapping(address => uint256))",
- "visibility": "internal"
- },
- "children": [
- {
- "children": [
- {
- "attributes": {
- "name": "address"
- },
- "id": 314,
- "name": "ElementaryTypeName",
- "src": "1461:7:0"
- },
- {
- "children": [
- {
- "attributes": {
- "name": "address"
- },
- "id": 315,
- "name": "ElementaryTypeName",
- "src": "1481:7:0"
- },
- {
- "attributes": {
- "name": "uint"
- },
- "id": 316,
- "name": "ElementaryTypeName",
- "src": "1492:4:0"
- }
- ],
- "id": 317,
- "name": "Mapping",
- "src": "1472:25:0"
- }
- ],
- "id": 318,
- "name": "Mapping",
- "src": "1452:46:0"
- }
- ],
- "id": 319,
- "name": "VariableDeclaration",
- "src": "1452:54:0"
- },
- {
- "attributes": {
- "constant": false,
- "name": "totalSupply",
- "storageLocation": "default",
- "type": "uint256",
- "visibility": "public"
- },
- "children": [
- {
- "attributes": {
- "name": "uint"
- },
- "id": 320,
- "name": "ElementaryTypeName",
- "src": "1512:4:0"
- }
- ],
- "id": 321,
- "name": "VariableDeclaration",
- "src": "1512:23:0"
- }
- ],
- "id": 322,
- "name": "ContractDefinition",
- "src": "86:1452:0"
- }
- ],
- "name": "SourceUnit"
- }
- },
- "1.0.0/Token/Token_v1.sol": {
- "id": 1,
- "legacyAST": {
- "children": [
- {
- "attributes": {
- "literals": [
- "solidity",
- "^",
- "0.4",
- ".11"
- ]
- },
- "id": 324,
- "name": "PragmaDirective",
- "src": "0:24:1"
- },
- {
- "attributes": {
- "fullyImplemented": true,
- "isLibrary": false,
- "linearizedBaseContracts": [
- 397
- ],
- "name": "Token_v1"
- },
- "children": [
- {
- "attributes": {
- "constant": true,
- "name": "totalSupply",
- "payable": false,
- "visibility": "public"
- },
- "children": [
- {
- "children": [],
- "id": 325,
- "name": "ParameterList",
- "src": "110:2:1"
- },
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "name": "supply",
- "storageLocation": "default",
- "type": "uint256",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "uint"
- },
- "id": 326,
- "name": "ElementaryTypeName",
- "src": "131:4:1"
- }
- ],
- "id": 327,
- "name": "VariableDeclaration",
- "src": "131:11:1"
- }
- ],
- "id": 328,
- "name": "ParameterList",
- "src": "130:13:1"
- },
- {
- "children": [],
- "id": 329,
- "name": "Block",
- "src": "144:2:1"
- }
- ],
- "id": 330,
- "name": "FunctionDefinition",
- "src": "90:56:1"
- },
- {
- "attributes": {
- "constant": true,
- "name": "balanceOf",
- "payable": false,
- "visibility": "public"
- },
- "children": [
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "name": "_owner",
- "storageLocation": "default",
- "type": "address",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "address"
- },
- "id": 331,
- "name": "ElementaryTypeName",
- "src": "274:7:1"
- }
- ],
- "id": 332,
- "name": "VariableDeclaration",
- "src": "274:14:1"
- }
- ],
- "id": 333,
- "name": "ParameterList",
- "src": "273:16:1"
- },
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "name": "balance",
- "storageLocation": "default",
- "type": "uint256",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "uint"
- },
- "id": 334,
- "name": "ElementaryTypeName",
- "src": "308:4:1"
- }
- ],
- "id": 335,
- "name": "VariableDeclaration",
- "src": "308:12:1"
- }
- ],
- "id": 336,
- "name": "ParameterList",
- "src": "307:14:1"
- },
- {
- "children": [],
- "id": 337,
- "name": "Block",
- "src": "322:2:1"
- }
- ],
- "id": 338,
- "name": "FunctionDefinition",
- "src": "255:69:1"
- },
- {
- "attributes": {
- "constant": false,
- "name": "transfer",
- "payable": false,
- "visibility": "public"
- },
- "children": [
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "name": "_to",
- "storageLocation": "default",
- "type": "address",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "address"
- },
- "id": 339,
- "name": "ElementaryTypeName",
- "src": "578:7:1"
- }
- ],
- "id": 340,
- "name": "VariableDeclaration",
- "src": "578:11:1"
- },
- {
- "attributes": {
- "constant": false,
- "name": "_value",
- "storageLocation": "default",
- "type": "uint256",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "uint"
- },
- "id": 341,
- "name": "ElementaryTypeName",
- "src": "591:4:1"
- }
- ],
- "id": 342,
- "name": "VariableDeclaration",
- "src": "591:11:1"
- }
- ],
- "id": 343,
- "name": "ParameterList",
- "src": "577:26:1"
- },
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "name": "success",
- "storageLocation": "default",
- "type": "bool",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "bool"
- },
- "id": 344,
- "name": "ElementaryTypeName",
- "src": "613:4:1"
- }
- ],
- "id": 345,
- "name": "VariableDeclaration",
- "src": "613:12:1"
- }
- ],
- "id": 346,
- "name": "ParameterList",
- "src": "612:14:1"
- },
- {
- "children": [],
- "id": 347,
- "name": "Block",
- "src": "627:2:1"
- }
- ],
- "id": 348,
- "name": "FunctionDefinition",
- "src": "560:69:1"
- },
- {
- "attributes": {
- "constant": false,
- "name": "transferFrom",
- "payable": false,
- "visibility": "public"
- },
- "children": [
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "name": "_from",
- "storageLocation": "default",
- "type": "address",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "address"
- },
- "id": 349,
- "name": "ElementaryTypeName",
- "src": "972:7:1"
- }
- ],
- "id": 350,
- "name": "VariableDeclaration",
- "src": "972:13:1"
- },
- {
- "attributes": {
- "constant": false,
- "name": "_to",
- "storageLocation": "default",
- "type": "address",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "address"
- },
- "id": 351,
- "name": "ElementaryTypeName",
- "src": "987:7:1"
- }
- ],
- "id": 352,
- "name": "VariableDeclaration",
- "src": "987:11:1"
- },
- {
- "attributes": {
- "constant": false,
- "name": "_value",
- "storageLocation": "default",
- "type": "uint256",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "uint"
- },
- "id": 353,
- "name": "ElementaryTypeName",
- "src": "1000:4:1"
- }
- ],
- "id": 354,
- "name": "VariableDeclaration",
- "src": "1000:11:1"
- }
- ],
- "id": 355,
- "name": "ParameterList",
- "src": "971:41:1"
- },
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "name": "success",
- "storageLocation": "default",
- "type": "bool",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "bool"
- },
- "id": 356,
- "name": "ElementaryTypeName",
- "src": "1022:4:1"
- }
- ],
- "id": 357,
- "name": "VariableDeclaration",
- "src": "1022:12:1"
- }
- ],
- "id": 358,
- "name": "ParameterList",
- "src": "1021:14:1"
- },
- {
- "children": [],
- "id": 359,
- "name": "Block",
- "src": "1036:2:1"
- }
- ],
- "id": 360,
- "name": "FunctionDefinition",
- "src": "950:88:1"
- },
- {
- "attributes": {
- "constant": false,
- "name": "approve",
- "payable": false,
- "visibility": "public"
- },
- "children": [
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "name": "_spender",
- "storageLocation": "default",
- "type": "address",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "address"
- },
- "id": 361,
- "name": "ElementaryTypeName",
- "src": "1338:7:1"
- }
- ],
- "id": 362,
- "name": "VariableDeclaration",
- "src": "1338:16:1"
- },
- {
- "attributes": {
- "constant": false,
- "name": "_value",
- "storageLocation": "default",
- "type": "uint256",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "uint"
- },
- "id": 363,
- "name": "ElementaryTypeName",
- "src": "1356:4:1"
- }
- ],
- "id": 364,
- "name": "VariableDeclaration",
- "src": "1356:11:1"
- }
- ],
- "id": 365,
- "name": "ParameterList",
- "src": "1337:31:1"
- },
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "name": "success",
- "storageLocation": "default",
- "type": "bool",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "bool"
- },
- "id": 366,
- "name": "ElementaryTypeName",
- "src": "1378:4:1"
- }
- ],
- "id": 367,
- "name": "VariableDeclaration",
- "src": "1378:12:1"
- }
- ],
- "id": 368,
- "name": "ParameterList",
- "src": "1377:14:1"
- },
- {
- "children": [],
- "id": 369,
- "name": "Block",
- "src": "1392:2:1"
- }
- ],
- "id": 370,
- "name": "FunctionDefinition",
- "src": "1321:73:1"
- },
- {
- "attributes": {
- "constant": true,
- "name": "allowance",
- "payable": false,
- "visibility": "public"
- },
- "children": [
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "name": "_owner",
- "storageLocation": "default",
- "type": "address",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "address"
- },
- "id": 371,
- "name": "ElementaryTypeName",
- "src": "1621:7:1"
- }
- ],
- "id": 372,
- "name": "VariableDeclaration",
- "src": "1621:14:1"
- },
- {
- "attributes": {
- "constant": false,
- "name": "_spender",
- "storageLocation": "default",
- "type": "address",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "address"
- },
- "id": 373,
- "name": "ElementaryTypeName",
- "src": "1637:7:1"
- }
- ],
- "id": 374,
- "name": "VariableDeclaration",
- "src": "1637:16:1"
- }
- ],
- "id": 375,
- "name": "ParameterList",
- "src": "1620:34:1"
- },
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "name": "remaining",
- "storageLocation": "default",
- "type": "uint256",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "uint"
- },
- "id": 376,
- "name": "ElementaryTypeName",
- "src": "1673:4:1"
- }
- ],
- "id": 377,
- "name": "VariableDeclaration",
- "src": "1673:14:1"
- }
- ],
- "id": 378,
- "name": "ParameterList",
- "src": "1672:16:1"
- },
- {
- "children": [],
- "id": 379,
- "name": "Block",
- "src": "1689:2:1"
- }
- ],
- "id": 380,
- "name": "FunctionDefinition",
- "src": "1602:89:1"
- },
- {
- "attributes": {
- "name": "Transfer"
- },
- "children": [
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "indexed": true,
- "name": "_from",
- "storageLocation": "default",
- "type": "address",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "address"
- },
- "id": 381,
- "name": "ElementaryTypeName",
- "src": "1712:7:1"
- }
- ],
- "id": 382,
- "name": "VariableDeclaration",
- "src": "1712:21:1"
- },
- {
- "attributes": {
- "constant": false,
- "indexed": true,
- "name": "_to",
- "storageLocation": "default",
- "type": "address",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "address"
- },
- "id": 383,
- "name": "ElementaryTypeName",
- "src": "1735:7:1"
- }
- ],
- "id": 384,
- "name": "VariableDeclaration",
- "src": "1735:19:1"
- },
- {
- "attributes": {
- "constant": false,
- "indexed": false,
- "name": "_value",
- "storageLocation": "default",
- "type": "uint256",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "uint"
- },
- "id": 385,
- "name": "ElementaryTypeName",
- "src": "1756:4:1"
- }
- ],
- "id": 386,
- "name": "VariableDeclaration",
- "src": "1756:11:1"
- }
- ],
- "id": 387,
- "name": "ParameterList",
- "src": "1711:57:1"
- }
- ],
- "id": 388,
- "name": "EventDefinition",
- "src": "1697:72:1"
- },
- {
- "attributes": {
- "name": "Approval"
- },
- "children": [
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "indexed": true,
- "name": "_owner",
- "storageLocation": "default",
- "type": "address",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "address"
- },
- "id": 389,
- "name": "ElementaryTypeName",
- "src": "1789:7:1"
- }
- ],
- "id": 390,
- "name": "VariableDeclaration",
- "src": "1789:22:1"
- },
- {
- "attributes": {
- "constant": false,
- "indexed": true,
- "name": "_spender",
- "storageLocation": "default",
- "type": "address",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "address"
- },
- "id": 391,
- "name": "ElementaryTypeName",
- "src": "1813:7:1"
- }
- ],
- "id": 392,
- "name": "VariableDeclaration",
- "src": "1813:24:1"
- },
- {
- "attributes": {
- "constant": false,
- "indexed": false,
- "name": "_value",
- "storageLocation": "default",
- "type": "uint256",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "uint"
- },
- "id": 393,
- "name": "ElementaryTypeName",
- "src": "1839:4:1"
- }
- ],
- "id": 394,
- "name": "VariableDeclaration",
- "src": "1839:11:1"
- }
- ],
- "id": 395,
- "name": "ParameterList",
- "src": "1788:63:1"
- }
- ],
- "id": 396,
- "name": "EventDefinition",
- "src": "1774:78:1"
- }
- ],
- "id": 397,
- "name": "ContractDefinition",
- "src": "26:1828:1"
- }
- ],
- "name": "SourceUnit"
- }
- },
- "1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol": {
- "id": 2,
- "legacyAST": {
- "children": [
- {
- "attributes": {
- "literals": [
- "solidity",
- "^",
- "0.4",
- ".11"
- ]
- },
- "id": 33,
- "name": "PragmaDirective",
- "src": "580:24:2"
- },
- {
- "attributes": {
- "file": "../ERC20Token/ERC20Token_v1.sol"
- },
- "id": 35,
- "name": "ImportDirective",
- "src": "606:78:2"
- },
- {
- "attributes": {
- "fullyImplemented": true,
- "isLibrary": false,
- "linearizedBaseContracts": [
- 124,
- 322,
- 397
- ],
- "name": "UnlimitedAllowanceToken_v1"
- },
- "children": [
- {
- "children": [
- {
- "attributes": {
- "name": "ERC20Token"
- },
- "id": 36,
- "name": "UserDefinedTypeName",
- "src": "725:10:2"
- }
- ],
- "id": 37,
- "name": "InheritanceSpecifier",
- "src": "725:10:2"
- },
- {
- "attributes": {
- "constant": true,
- "name": "MAX_UINT",
- "storageLocation": "default",
- "type": "uint256",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "uint"
- },
- "id": 38,
- "name": "ElementaryTypeName",
- "src": "743:4:2"
- },
- {
- "attributes": {
- "operator": "-",
- "type": "int_const 115792089237316195423570985008687907853269984665640564039457584007913129639935"
- },
- "children": [
- {
- "attributes": {
- "operator": "**",
- "type": "int_const 115792089237316195423570985008687907853269984665640564039457584007913129639936"
- },
- "children": [
- {
- "attributes": {
- "hexvalue": "32",
- "subdenomination": null,
- "token": null,
- "type": "int_const 2",
- "value": "2"
- },
- "id": 39,
- "name": "Literal",
- "src": "768:1:2"
- },
- {
- "attributes": {
- "hexvalue": "323536",
- "subdenomination": null,
- "token": null,
- "type": "int_const 256",
- "value": "256"
- },
- "id": 40,
- "name": "Literal",
- "src": "771:3:2"
- }
- ],
- "id": 41,
- "name": "BinaryOperation",
- "src": "768:6:2"
- },
- {
- "attributes": {
- "hexvalue": "31",
- "subdenomination": null,
- "token": null,
- "type": "int_const 1",
- "value": "1"
- },
- "id": 42,
- "name": "Literal",
- "src": "777:1:2"
- }
- ],
- "id": 43,
- "name": "BinaryOperation",
- "src": "768:10:2"
- }
- ],
- "id": 44,
- "name": "VariableDeclaration",
- "src": "743:35:2"
- },
- {
- "attributes": {
- "constant": false,
- "name": "transferFrom",
- "payable": false,
- "visibility": "public"
- },
- "children": [
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "name": "_from",
- "storageLocation": "default",
- "type": "address",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "address"
- },
- "id": 45,
- "name": "ElementaryTypeName",
- "src": "1088:7:2"
- }
- ],
- "id": 46,
- "name": "VariableDeclaration",
- "src": "1088:13:2"
- },
- {
- "attributes": {
- "constant": false,
- "name": "_to",
- "storageLocation": "default",
- "type": "address",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "address"
- },
- "id": 47,
- "name": "ElementaryTypeName",
- "src": "1103:7:2"
- }
- ],
- "id": 48,
- "name": "VariableDeclaration",
- "src": "1103:11:2"
- },
- {
- "attributes": {
- "constant": false,
- "name": "_value",
- "storageLocation": "default",
- "type": "uint256",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "uint"
- },
- "id": 49,
- "name": "ElementaryTypeName",
- "src": "1116:4:2"
- }
- ],
- "id": 50,
- "name": "VariableDeclaration",
- "src": "1116:11:2"
- }
- ],
- "id": 51,
- "name": "ParameterList",
- "src": "1087:41:2"
- },
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "name": "",
- "storageLocation": "default",
- "type": "bool",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "bool"
- },
- "id": 52,
- "name": "ElementaryTypeName",
- "src": "1161:4:2"
- }
- ],
- "id": 53,
- "name": "VariableDeclaration",
- "src": "1161:4:2"
- }
- ],
- "id": 54,
- "name": "ParameterList",
- "src": "1160:6:2"
- },
- {
- "children": [
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "name": "allowance",
- "storageLocation": "default",
- "type": "uint256",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "uint"
- },
- "id": 55,
- "name": "ElementaryTypeName",
- "src": "1181:4:2"
- }
- ],
- "id": 56,
- "name": "VariableDeclaration",
- "src": "1181:14:2"
- },
- {
- "attributes": {
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => uint256)"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => mapping(address => uint256))",
- "value": "allowed"
- },
- "id": 57,
- "name": "Identifier",
- "src": "1198:7:2"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_from"
- },
- "id": 58,
- "name": "Identifier",
- "src": "1206:5:2"
- }
- ],
- "id": 59,
- "name": "IndexAccess",
- "src": "1198:14:2"
- },
- {
- "attributes": {
- "member_name": "sender",
- "type": "address"
- },
- "children": [
- {
- "attributes": {
- "type": "msg",
- "value": "msg"
- },
- "id": 60,
- "name": "Identifier",
- "src": "1213:3:2"
- }
- ],
- "id": 61,
- "name": "MemberAccess",
- "src": "1213:10:2"
- }
- ],
- "id": 62,
- "name": "IndexAccess",
- "src": "1198:26:2"
- }
- ],
- "id": 63,
- "name": "VariableDeclarationStatement",
- "src": "1181:43:2"
- },
- {
- "children": [
- {
- "attributes": {
- "operator": "&&",
- "type": "bool"
- },
- "children": [
- {
- "attributes": {
- "operator": "&&",
- "type": "bool"
- },
- "children": [
- {
- "attributes": {
- "operator": ">=",
- "type": "bool"
- },
- "children": [
- {
- "attributes": {
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => uint256)",
- "value": "balances"
- },
- "id": 64,
- "name": "Identifier",
- "src": "1238:8:2"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_from"
- },
- "id": 65,
- "name": "Identifier",
- "src": "1247:5:2"
- }
- ],
- "id": 66,
- "name": "IndexAccess",
- "src": "1238:15:2"
- },
- {
- "attributes": {
- "type": "uint256",
- "value": "_value"
- },
- "id": 67,
- "name": "Identifier",
- "src": "1257:6:2"
- }
- ],
- "id": 68,
- "name": "BinaryOperation",
- "src": "1238:25:2"
- },
- {
- "attributes": {
- "operator": ">=",
- "type": "bool"
- },
- "children": [
- {
- "attributes": {
- "type": "uint256",
- "value": "allowance"
- },
- "id": 69,
- "name": "Identifier",
- "src": "1279:9:2"
- },
- {
- "attributes": {
- "type": "uint256",
- "value": "_value"
- },
- "id": 70,
- "name": "Identifier",
- "src": "1292:6:2"
- }
- ],
- "id": 71,
- "name": "BinaryOperation",
- "src": "1279:19:2"
- }
- ],
- "id": 72,
- "name": "BinaryOperation",
- "src": "1238:60:2"
- },
- {
- "attributes": {
- "operator": ">=",
- "type": "bool"
- },
- "children": [
- {
- "attributes": {
- "operator": "+",
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => uint256)",
- "value": "balances"
- },
- "id": 73,
- "name": "Identifier",
- "src": "1314:8:2"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_to"
- },
- "id": 74,
- "name": "Identifier",
- "src": "1323:3:2"
- }
- ],
- "id": 75,
- "name": "IndexAccess",
- "src": "1314:13:2"
- },
- {
- "attributes": {
- "type": "uint256",
- "value": "_value"
- },
- "id": 76,
- "name": "Identifier",
- "src": "1330:6:2"
- }
- ],
- "id": 77,
- "name": "BinaryOperation",
- "src": "1314:22:2"
- },
- {
- "attributes": {
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => uint256)",
- "value": "balances"
- },
- "id": 78,
- "name": "Identifier",
- "src": "1340:8:2"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_to"
- },
- "id": 79,
- "name": "Identifier",
- "src": "1349:3:2"
- }
- ],
- "id": 80,
- "name": "IndexAccess",
- "src": "1340:13:2"
- }
- ],
- "id": 81,
- "name": "BinaryOperation",
- "src": "1314:39:2"
- }
- ],
- "id": 82,
- "name": "BinaryOperation",
- "src": "1238:115:2"
- },
- {
- "children": [
- {
- "children": [
- {
- "attributes": {
- "operator": "+=",
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => uint256)",
- "value": "balances"
- },
- "id": 83,
- "name": "Identifier",
- "src": "1378:8:2"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_to"
- },
- "id": 84,
- "name": "Identifier",
- "src": "1387:3:2"
- }
- ],
- "id": 85,
- "name": "IndexAccess",
- "src": "1378:13:2"
- },
- {
- "attributes": {
- "type": "uint256",
- "value": "_value"
- },
- "id": 86,
- "name": "Identifier",
- "src": "1395:6:2"
- }
- ],
- "id": 87,
- "name": "Assignment",
- "src": "1378:23:2"
- }
- ],
- "id": 88,
- "name": "ExpressionStatement",
- "src": "1378:23:2"
- },
- {
- "children": [
- {
- "attributes": {
- "operator": "-=",
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => uint256)",
- "value": "balances"
- },
- "id": 89,
- "name": "Identifier",
- "src": "1415:8:2"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_from"
- },
- "id": 90,
- "name": "Identifier",
- "src": "1424:5:2"
- }
- ],
- "id": 91,
- "name": "IndexAccess",
- "src": "1415:15:2"
- },
- {
- "attributes": {
- "type": "uint256",
- "value": "_value"
- },
- "id": 92,
- "name": "Identifier",
- "src": "1434:6:2"
- }
- ],
- "id": 93,
- "name": "Assignment",
- "src": "1415:25:2"
- }
- ],
- "id": 94,
- "name": "ExpressionStatement",
- "src": "1415:25:2"
- },
- {
- "children": [
- {
- "attributes": {
- "operator": "<",
- "type": "bool"
- },
- "children": [
- {
- "attributes": {
- "type": "uint256",
- "value": "allowance"
- },
- "id": 95,
- "name": "Identifier",
- "src": "1458:9:2"
- },
- {
- "attributes": {
- "type": "uint256",
- "value": "MAX_UINT"
- },
- "id": 96,
- "name": "Identifier",
- "src": "1470:8:2"
- }
- ],
- "id": 97,
- "name": "BinaryOperation",
- "src": "1458:20:2"
- },
- {
- "children": [
- {
- "children": [
- {
- "attributes": {
- "operator": "-=",
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => uint256)"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => mapping(address => uint256))",
- "value": "allowed"
- },
- "id": 98,
- "name": "Identifier",
- "src": "1498:7:2"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_from"
- },
- "id": 99,
- "name": "Identifier",
- "src": "1506:5:2"
- }
- ],
- "id": 102,
- "name": "IndexAccess",
- "src": "1498:14:2"
- },
- {
- "attributes": {
- "member_name": "sender",
- "type": "address"
- },
- "children": [
- {
- "attributes": {
- "type": "msg",
- "value": "msg"
- },
- "id": 100,
- "name": "Identifier",
- "src": "1513:3:2"
- }
- ],
- "id": 101,
- "name": "MemberAccess",
- "src": "1513:10:2"
- }
- ],
- "id": 103,
- "name": "IndexAccess",
- "src": "1498:26:2"
- },
- {
- "attributes": {
- "type": "uint256",
- "value": "_value"
- },
- "id": 104,
- "name": "Identifier",
- "src": "1528:6:2"
- }
- ],
- "id": 105,
- "name": "Assignment",
- "src": "1498:36:2"
- }
- ],
- "id": 106,
- "name": "ExpressionStatement",
- "src": "1498:36:2"
- }
- ],
- "id": 107,
- "name": "Block",
- "src": "1480:69:2"
- }
- ],
- "id": 108,
- "name": "IfStatement",
- "src": "1454:95:2"
- },
- {
- "children": [
- {
- "attributes": {
- "type": "tuple()",
- "type_conversion": false
- },
- "children": [
- {
- "attributes": {
- "type": "function (address,address,uint256) constant",
- "value": "Transfer"
- },
- "id": 109,
- "name": "Identifier",
- "src": "1562:8:2"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_from"
- },
- "id": 110,
- "name": "Identifier",
- "src": "1571:5:2"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_to"
- },
- "id": 111,
- "name": "Identifier",
- "src": "1578:3:2"
- },
- {
- "attributes": {
- "type": "uint256",
- "value": "_value"
- },
- "id": 112,
- "name": "Identifier",
- "src": "1583:6:2"
- }
- ],
- "id": 113,
- "name": "FunctionCall",
- "src": "1562:28:2"
- }
- ],
- "id": 114,
- "name": "ExpressionStatement",
- "src": "1562:28:2"
- },
- {
- "children": [
- {
- "attributes": {
- "hexvalue": "74727565",
- "subdenomination": null,
- "token": "true",
- "type": "bool",
- "value": "true"
- },
- "id": 115,
- "name": "Literal",
- "src": "1611:4:2"
- }
- ],
- "id": 116,
- "name": "Return",
- "src": "1604:11:2"
- }
- ],
- "id": 117,
- "name": "Block",
- "src": "1364:262:2"
- },
- {
- "children": [
- {
- "children": [
- {
- "attributes": {
- "hexvalue": "66616c7365",
- "subdenomination": null,
- "token": "false",
- "type": "bool",
- "value": "false"
- },
- "id": 118,
- "name": "Literal",
- "src": "1653:5:2"
- }
- ],
- "id": 119,
- "name": "Return",
- "src": "1646:12:2"
- }
- ],
- "id": 120,
- "name": "Block",
- "src": "1632:37:2"
- }
- ],
- "id": 121,
- "name": "IfStatement",
- "src": "1234:435:2"
- }
- ],
- "id": 122,
- "name": "Block",
- "src": "1171:504:2"
- }
- ],
- "id": 123,
- "name": "FunctionDefinition",
- "src": "1066:609:2"
- }
- ],
- "id": 124,
- "name": "ContractDefinition",
- "src": "686:991:2"
- }
- ],
- "name": "SourceUnit"
- }
- },
- "2.0.0/tokens/ZRXToken/ZRXToken.sol": {
- "id": 3,
- "legacyAST": {
- "children": [
- {
- "attributes": {
- "literals": [
- "solidity",
- "0.4",
- ".11"
- ]
- },
- "id": 1,
- "name": "PragmaDirective",
- "src": "580:23:3"
- },
- {
- "attributes": {
- "file": "../../../1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol"
- },
- "id": 3,
- "name": "ImportDirective",
- "src": "650:142:3"
- },
- {
- "attributes": {
- "fullyImplemented": true,
- "isLibrary": false,
- "linearizedBaseContracts": [
- 31,
- 124,
- 322,
- 397
- ],
- "name": "ZRXToken"
- },
- "children": [
- {
- "children": [
- {
- "attributes": {
- "name": "UnlimitedAllowanceToken"
- },
- "id": 4,
- "name": "UserDefinedTypeName",
- "src": "821:23:3"
- }
- ],
- "id": 5,
- "name": "InheritanceSpecifier",
- "src": "821:23:3"
- },
- {
- "attributes": {
- "constant": true,
- "name": "decimals",
- "storageLocation": "default",
- "type": "uint8",
- "visibility": "public"
- },
- "children": [
- {
- "attributes": {
- "name": "uint8"
- },
- "id": 6,
- "name": "ElementaryTypeName",
- "src": "896:5:3"
- },
- {
- "attributes": {
- "hexvalue": "3138",
- "subdenomination": null,
- "token": null,
- "type": "int_const 18",
- "value": "18"
- },
- "id": 7,
- "name": "Literal",
- "src": "929:2:3"
- }
- ],
- "id": 8,
- "name": "VariableDeclaration",
- "src": "896:35:3"
- },
- {
- "attributes": {
- "constant": false,
- "name": "totalSupply",
- "storageLocation": "default",
- "type": "uint256",
- "visibility": "public"
- },
- "children": [
- {
- "attributes": {
- "name": "uint256"
- },
- "id": 9,
- "name": "ElementaryTypeName",
- "src": "937:7:3"
- },
- {
- "attributes": {
- "operator": "**",
- "type": "int_const 1000000000000000000000000000"
- },
- "children": [
- {
- "attributes": {
- "hexvalue": "3130",
- "subdenomination": null,
- "token": null,
- "type": "int_const 10",
- "value": "10"
- },
- "id": 10,
- "name": "Literal",
- "src": "966:2:3"
- },
- {
- "attributes": {
- "hexvalue": "3237",
- "subdenomination": null,
- "token": null,
- "type": "int_const 27",
- "value": "27"
- },
- "id": 11,
- "name": "Literal",
- "src": "970:2:3"
- }
- ],
- "id": 12,
- "name": "BinaryOperation",
- "src": "966:6:3"
- }
- ],
- "id": 13,
- "name": "VariableDeclaration",
- "src": "937:35:3"
- },
- {
- "attributes": {
- "constant": true,
- "name": "name",
- "storageLocation": "default",
- "type": "string memory",
- "visibility": "public"
- },
- "children": [
- {
- "attributes": {
- "name": "string"
- },
- "id": 14,
- "name": "ElementaryTypeName",
- "src": "1017:6:3"
- },
- {
- "attributes": {
- "hexvalue": "30782050726f746f636f6c20546f6b656e",
- "subdenomination": null,
- "token": null,
- "type": "literal_string \"0x Protocol Token\"",
- "value": "0x Protocol Token"
- },
- "id": 15,
- "name": "Literal",
- "src": "1047:19:3"
- }
- ],
- "id": 16,
- "name": "VariableDeclaration",
- "src": "1017:49:3"
- },
- {
- "attributes": {
- "constant": true,
- "name": "symbol",
- "storageLocation": "default",
- "type": "string memory",
- "visibility": "public"
- },
- "children": [
- {
- "attributes": {
- "name": "string"
- },
- "id": 17,
- "name": "ElementaryTypeName",
- "src": "1072:6:3"
- },
- {
- "attributes": {
- "hexvalue": "5a5258",
- "subdenomination": null,
- "token": null,
- "type": "literal_string \"ZRX\"",
- "value": "ZRX"
- },
- "id": 18,
- "name": "Literal",
- "src": "1104:5:3"
- }
- ],
- "id": 19,
- "name": "VariableDeclaration",
- "src": "1072:37:3"
- },
- {
- "attributes": {
- "constant": false,
- "name": "ZRXToken",
- "payable": false,
- "visibility": "public"
- },
- "children": [
- {
- "children": [],
- "id": 20,
- "name": "ParameterList",
- "src": "1175:2:3"
- },
- {
- "children": [],
- "id": 21,
- "name": "ParameterList",
- "src": "1197:0:3"
- },
- {
- "children": [
- {
- "children": [
- {
- "attributes": {
- "operator": "=",
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => uint256)",
- "value": "balances"
- },
- "id": 22,
- "name": "Identifier",
- "src": "1207:8:3"
- },
- {
- "attributes": {
- "member_name": "sender",
- "type": "address"
- },
- "children": [
- {
- "attributes": {
- "type": "msg",
- "value": "msg"
- },
- "id": 23,
- "name": "Identifier",
- "src": "1216:3:3"
- }
- ],
- "id": 24,
- "name": "MemberAccess",
- "src": "1216:10:3"
- }
- ],
- "id": 25,
- "name": "IndexAccess",
- "src": "1207:20:3"
- },
- {
- "attributes": {
- "type": "uint256",
- "value": "totalSupply"
- },
- "id": 26,
- "name": "Identifier",
- "src": "1230:11:3"
- }
- ],
- "id": 27,
- "name": "Assignment",
- "src": "1207:34:3"
- }
- ],
- "id": 28,
- "name": "ExpressionStatement",
- "src": "1207:34:3"
- }
- ],
- "id": 29,
- "name": "Block",
- "src": "1197:51:3"
- }
- ],
- "id": 30,
- "name": "FunctionDefinition",
- "src": "1158:90:3"
- }
- ],
- "id": 31,
- "name": "ContractDefinition",
- "src": "795:455:3"
- }
- ],
- "name": "SourceUnit"
- }
- }
- },
- "sourceCodes": {
- "1.0.0/ERC20Token/ERC20Token_v1.sol": "pragma solidity ^0.4.11;\n\nimport { Token_v1 as Token } from \"../Token/Token_v1.sol\";\n\ncontract ERC20Token_v1 is Token {\n\n function transfer(address _to, uint _value) returns (bool) {\n //Default assumes totalSupply can't be over max (2^256 - 1).\n if (balances[msg.sender] >= _value && balances[_to] + _value >= balances[_to]) {\n balances[msg.sender] -= _value;\n balances[_to] += _value;\n Transfer(msg.sender, _to, _value);\n return true;\n } else { return false; }\n }\n\n function transferFrom(address _from, address _to, uint _value) returns (bool) {\n if (balances[_from] >= _value && allowed[_from][msg.sender] >= _value && balances[_to] + _value >= balances[_to]) {\n balances[_to] += _value;\n balances[_from] -= _value;\n allowed[_from][msg.sender] -= _value;\n Transfer(_from, _to, _value);\n return true;\n } else { return false; }\n }\n\n function balanceOf(address _owner) constant returns (uint) {\n return balances[_owner];\n }\n\n function approve(address _spender, uint _value) returns (bool) {\n allowed[msg.sender][_spender] = _value;\n Approval(msg.sender, _spender, _value);\n return true;\n }\n\n function allowance(address _owner, address _spender) constant returns (uint) {\n return allowed[_owner][_spender];\n }\n\n mapping (address => uint) balances;\n mapping (address => mapping (address => uint)) allowed;\n uint public totalSupply;\n}\n",
- "1.0.0/Token/Token_v1.sol": "pragma solidity ^0.4.11;\n\ncontract Token_v1 {\n\n /// @return total amount of tokens\n function totalSupply() constant returns (uint supply) {}\n\n /// @param _owner The address from which the balance will be retrieved\n /// @return The balance\n function balanceOf(address _owner) constant returns (uint balance) {}\n\n /// @notice send `_value` token to `_to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return Whether the transfer was successful or not\n function transfer(address _to, uint _value) returns (bool success) {}\n\n /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return Whether the transfer was successful or not\n function transferFrom(address _from, address _to, uint _value) returns (bool success) {}\n\n /// @notice `msg.sender` approves `_addr` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Whether the approval was successful or not\n function approve(address _spender, uint _value) returns (bool success) {}\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender) constant returns (uint remaining) {}\n\n event Transfer(address indexed _from, address indexed _to, uint _value);\n event Approval(address indexed _owner, address indexed _spender, uint _value);\n}\n\n",
- "1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.4.11;\n\nimport { ERC20Token_v1 as ERC20Token } from \"../ERC20Token/ERC20Token_v1.sol\";\n\ncontract UnlimitedAllowanceToken_v1 is ERC20Token {\n\n uint constant MAX_UINT = 2**256 - 1;\n\n /// @dev ERC20 transferFrom, modified such that an allowance of MAX_UINT represents an unlimited allowance.\n /// @param _from Address to transfer from.\n /// @param _to Address to transfer to.\n /// @param _value Amount to transfer.\n /// @return Success of transfer.\n function transferFrom(address _from, address _to, uint _value)\n public\n returns (bool)\n {\n uint allowance = allowed[_from][msg.sender];\n if (balances[_from] >= _value\n && allowance >= _value\n && balances[_to] + _value >= balances[_to]\n ) {\n balances[_to] += _value;\n balances[_from] -= _value;\n if (allowance < MAX_UINT) {\n allowed[_from][msg.sender] -= _value;\n }\n Transfer(_from, _to, _value);\n return true;\n } else {\n return false;\n }\n }\n}\n",
- "2.0.0/tokens/ZRXToken/ZRXToken.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.11;\n\n// solhint-disable-next-line max-line-length\nimport { UnlimitedAllowanceToken_v1 as UnlimitedAllowanceToken } from \"../../../1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\";\n\n\ncontract ZRXToken is \n UnlimitedAllowanceToken\n{\n\n // solhint-disable const-name-snakecase\n uint8 constant public decimals = 18;\n uint256 public totalSupply = 10**27; // 1 billion tokens, 18 decimal places\n string constant public name = \"0x Protocol Token\";\n string constant public symbol = \"ZRX\";\n // solhint-enableconst-name-snakecase\n\n function ZRXToken()\n public\n {\n balances[msg.sender] = totalSupply;\n }\n}\n"
- },
- "sourceTreeHashHex": "0xe3fb14114a377d3b5f004168d4f43cb29ab930b3277425645bdbd609bf974317",
- "compiler": {
- "name": "solc",
- "version": "soljson-v0.4.11+commit.68ef5810.js",
- "settings": {
- "optimizer": {
- "enabled": true,
- "runs": 1000000
- },
- "outputSelection": {
- "*": {
- "*": [
- "abi",
- "evm.bytecode.object",
- "evm.bytecode.sourceMap",
- "evm.deployedBytecode.object",
- "evm.deployedBytecode.sourceMap"
- ]
- }
- }
- }
- },
- "networks": {
- "3": {
- "address": "0xff67881f8d12f372d91baae9752eb3631ff0ed00",
- "links": {},
- "constructorArgs": "[\"0x Protocol Token\",\"ZRX\",\"18\",\"1000000000000000000000000000\"]"
- },
- "42": {
- "address": "0x2002d3812f58e35f0ea1ffbf80a75a38c32175fa",
- "links": {},
- "constructorArgs": "[\"0x Protocol Token\",\"ZRX\",\"18\",\"1000000000000000000000000000\"]"
- },
- "50": {
- "address": "0x871dd7c2b4b25e1aa18728e9d5f2af4c4e431f5c",
- "links": {},
- "constructorArgs": "[]"
- }
- }
-}
diff --git a/packages/migrations/artifacts/2.0.0-trimmed/Forwarder.json b/packages/migrations/artifacts/2.0.0-trimmed/Forwarder.json
deleted file mode 100644
index 9fe4fd601..000000000
--- a/packages/migrations/artifacts/2.0.0-trimmed/Forwarder.json
+++ /dev/null
@@ -1,473 +0,0 @@
-{
- "schemaVersion": "2.0.0",
- "contractName": "Forwarder",
- "compilerOutput": {
- "abi": [
- {
- "constant": false,
- "inputs": [
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "orders",
- "type": "tuple[]"
- },
- {
- "name": "makerAssetFillAmount",
- "type": "uint256"
- },
- {
- "name": "signatures",
- "type": "bytes[]"
- },
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "feeOrders",
- "type": "tuple[]"
- },
- {
- "name": "feeSignatures",
- "type": "bytes[]"
- },
- {
- "name": "feePercentage",
- "type": "uint256"
- },
- {
- "name": "feeRecipient",
- "type": "address"
- }
- ],
- "name": "marketBuyOrdersWithEth",
- "outputs": [
- {
- "components": [
- {
- "name": "makerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "makerFeePaid",
- "type": "uint256"
- },
- {
- "name": "takerFeePaid",
- "type": "uint256"
- }
- ],
- "name": "orderFillResults",
- "type": "tuple"
- },
- {
- "components": [
- {
- "name": "makerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "makerFeePaid",
- "type": "uint256"
- },
- {
- "name": "takerFeePaid",
- "type": "uint256"
- }
- ],
- "name": "feeOrderFillResults",
- "type": "tuple"
- }
- ],
- "payable": true,
- "stateMutability": "payable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "assetData",
- "type": "bytes"
- },
- {
- "name": "amount",
- "type": "uint256"
- }
- ],
- "name": "withdrawAsset",
- "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": [
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "orders",
- "type": "tuple[]"
- },
- {
- "name": "signatures",
- "type": "bytes[]"
- },
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "feeOrders",
- "type": "tuple[]"
- },
- {
- "name": "feeSignatures",
- "type": "bytes[]"
- },
- {
- "name": "feePercentage",
- "type": "uint256"
- },
- {
- "name": "feeRecipient",
- "type": "address"
- }
- ],
- "name": "marketSellOrdersWithEth",
- "outputs": [
- {
- "components": [
- {
- "name": "makerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "makerFeePaid",
- "type": "uint256"
- },
- {
- "name": "takerFeePaid",
- "type": "uint256"
- }
- ],
- "name": "orderFillResults",
- "type": "tuple"
- },
- {
- "components": [
- {
- "name": "makerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "makerFeePaid",
- "type": "uint256"
- },
- {
- "name": "takerFeePaid",
- "type": "uint256"
- }
- ],
- "name": "feeOrderFillResults",
- "type": "tuple"
- }
- ],
- "payable": true,
- "stateMutability": "payable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "newOwner",
- "type": "address"
- }
- ],
- "name": "transferOwnership",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "inputs": [
- {
- "name": "_exchange",
- "type": "address"
- },
- {
- "name": "_zrxAssetData",
- "type": "bytes"
- },
- {
- "name": "_wethAssetData",
- "type": "bytes"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "constructor"
- },
- {
- "payable": true,
- "stateMutability": "payable",
- "type": "fallback"
- }
- ],
- "evm": {
- "bytecode": {
- "linkReferences": {},
- "object":
- "0x60806040523480156200001157600080fd5b5060405162002cdb38038062002cdb83398101806040526200003791908101906200051d565b6000805433600160a060020a031991821617825560018054909116600160a060020a0386161790558251849084908490849081906200007e906004906020870190620003d0565b50825162000094906005906020860190620003d0565b50620000b0836010640100000000620018f66200036f82021704565b9150620000cd846010640100000000620018f66200036f82021704565b60028054600160a060020a03948516600160a060020a031991821617909155600380549285169290911691909117905550600154604080517f4552433230546f6b656e28616464726573732900000000000000000000000000815290519081900360130181207f6070410800000000000000000000000000000000000000000000000000000000825291909216945063607041089350620001739250906004016200068e565b602060405180830381600087803b1580156200018e57600080fd5b505af1158015620001a3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250620001c99190810190620004f4565b9050600160a060020a038116151562000219576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200021090620006b0565b60405180910390fd5b6002546040517f095ea7b3000000000000000000000000000000000000000000000000000000008152600160a060020a039091169063095ea7b39062000268908490600019906004016200066f565b602060405180830381600087803b1580156200028357600080fd5b505af115801562000298573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250620002be9190810190620005a1565b506003546040517f095ea7b3000000000000000000000000000000000000000000000000000000008152600160a060020a039091169063095ea7b3906200030e908490600019906004016200066f565b602060405180830381600087803b1580156200032957600080fd5b505af11580156200033e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250620003649190810190620005a1565b50505050506200077a565b600081601401835110151515620003b4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040162000210906200069e565b506014818301810151910190600160a060020a03165b92915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200041357805160ff191683800117855562000443565b8280016001018555821562000443579182015b828111156200044357825182559160200191906001019062000426565b506200045192915062000455565b5090565b6200047291905b808211156200045157600081556001016200045c565b90565b600062000483825162000711565b9392505050565b600062000483825162000742565b6000601f82018313620004aa57600080fd5b8151620004c1620004bb82620006e9565b620006c2565b91508082526020830160208301858383011115620004de57600080fd5b620004eb83828462000747565b50505092915050565b6000602082840312156200050757600080fd5b600062000515848462000475565b949350505050565b6000806000606084860312156200053357600080fd5b600062000541868662000475565b93505060208401516001604060020a038111156200055e57600080fd5b6200056c8682870162000498565b92505060408401516001604060020a038111156200058957600080fd5b620005978682870162000498565b9150509250925092565b600060208284031215620005b457600080fd5b60006200051584846200048a565b620005cd8162000711565b82525050565b620005cd816200071d565b602681527f475245415445525f4f525f455155414c5f544f5f32305f4c454e4754485f524560208201527f5155495245440000000000000000000000000000000000000000000000000000604082015260600190565b601881527f554e524547495354455245445f41535345545f50524f58590000000000000000602082015260400190565b620005cd8162000472565b604081016200067f8285620005c2565b62000483602083018462000664565b60208101620003ca8284620005d3565b60208082528101620003ca81620005de565b60208082528101620003ca8162000634565b6040518181016001604060020a0381118282101715620006e157600080fd5b604052919050565b60006001604060020a038211156200070057600080fd5b506020601f91909101601f19160190565b600160a060020a031690565b7fffffffff000000000000000000000000000000000000000000000000000000001690565b151590565b60005b83811015620007645781810151838201526020016200074a565b8381111562000774576000848401525b50505050565b612551806200078a6000396000f30060806040526004361061006c5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166318978e8281146100c8578063630f1e6c146100f25780638da5cb5b146101125780639395525c14610134578063f2fde38b14610147575b60025473ffffffffffffffffffffffffffffffffffffffff1633146100c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612337565b60405180910390fd5b005b6100db6100d6366004611da0565b610167565b6040516100e9929190612437565b60405180910390f35b3480156100fe57600080fd5b506100c661010d366004611e9b565b6102f7565b34801561011e57600080fd5b50610127610388565b6040516100e991906122e6565b6100db610142366004611cba565b6103a4565b34801561015357600080fd5b506100c6610162366004611c94565b61050a565b61016f6119a9565b6101776119a9565b6000806101826105bb565b60048054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610100600188161502019095169490940493840181900481028201810190925282815261025c939092909183018282801561022d5780601f106102025761010080835404028352916020019161022d565b820191906000526020600020905b81548152906001019060200180831161021057829003601f168201915b50505050508c600081518110151561024157fe5b6020908102909101015161014001519063ffffffff61069616565b156102875761026c8b8b8b6107c3565b935061028084600001518560600151610acb565b90506102ae565b6102928b8b8b610b0d565b9350836060015191506102a68883896107c3565b845190935090505b6102c2846020015184602001518888610d1f565b6102e98b60008151811015156102d457fe5b90602001906020020151610140015182610f33565b505097509795505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610348576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123e7565b61038383838080601f01602080910402602001604051908101604052809392919081815260200183838082843750879450610f339350505050565b505050565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b6103ac6119a9565b6103b46119a9565b60008060006103c16105bb565b60048054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101006001881615020190951694909404938401819004810282018101909252828152610441939092909183018282801561022d5780601f106102025761010080835404028352916020019161022d565b156104925761046a670de0b6b3a7640000610464670de0b6b3a76400008a61104f565b34611099565b92506104778b848c6110f1565b945061048b85600001518660600151610acb565b90506104d6565b6104ad670d2f13f7789f0000670de0b6b3a764000034611099565b92506104ba8b848c6110f1565b9450846060015191506104ce89838a6107c3565b855190945090505b6104ea856020015185602001518989610d1f565b6104fc8b60008151811015156102d457fe5b505050965096945050505050565b60005473ffffffffffffffffffffffffffffffffffffffff16331461055b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123e7565b73ffffffffffffffffffffffffffffffffffffffff8116156105b857600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83161790555b50565b600034116105f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612347565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0e30db0346040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004016000604051808303818588803b15801561067b57600080fd5b505af115801561068f573d6000803e3d6000fd5b5050505050565b6000815183511480156107ba5750816040518082805190602001908083835b602083106106f257805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016106b5565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0180199092169116179052604051919093018190038120885190955088945090928392508401908083835b6020831061078757805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161074a565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060001916145b90505b92915050565b6107cb6119a9565b60608060008060008060006107de6119a9565b8a15156107ea57610abc565b6004805460408051602060026001851615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f8101849004840282018401909252818152929183018282801561088e5780601f106108635761010080835404028352916020019161088e565b820191906000526020600020905b81548152906001019060200180831161087157829003601f168201915b505060058054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101006001881615020190951694909404938401819004810282018101909252828152969e509194509250840190508282801561093d5780601f106109125761010080835404028352916020019161093d565b820191906000526020600020905b81548152906001019060200180831161092057829003601f168201915b50505050509650600095508b519450600093505b838514610a8257878c8581518110151561096757fe5b6020908102909101015161014001528b5187908d908690811061098657fe5b60209081029091010151610160015261099f8b87610acb565b9250610a068c858151811015156109b257fe5b9060200190602002015160a00151610a008e878151811015156109d157fe5b90602001906020020151608001518f888151811015156109ed57fe5b9060200190602002015160e00151610acb565b85611099565b9150610a4b8c85815181101515610a1957fe5b90602001906020020151610a2e84600161104f565b8c87815181101515610a3c57fe5b90602001906020020151611295565b9050610a57898261130d565b610a6989600001518a60600151610acb565b95508a8610610a7757610a82565b600190930192610951565b8a861015610abc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123c7565b50505050505050509392505050565b600082821115610b07576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612367565b50900390565b610b156119a9565b606080600080600080610b266119a9565b60008b6000815181101515610b3757fe5b6020908102919091018101516101400151600580546040805160026001841615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190931692909204601f8101869004860283018601909152808252929b5092909190830182828015610bef5780601f10610bc457610100808354040283529160200191610bef565b820191906000526020600020905b815481529060010190602001808311610bd257829003601f168201915b505050505096508b519550600094505b848614610ce557878c86815181101515610c1557fe5b6020908102909101015161014001528b5187908d9087908110610c3457fe5b6020908102909101015161016001528851610c50908c90610acb565b9350610c938c86815181101515610c6357fe5b9060200190602002015160a001518d87815181101515610c7f57fe5b906020019060200201516080015186611099565b9250610cbf8c86815181101515610ca657fe5b90602001906020020151848c88815181101515610a3c57fe5b9150610ccb898361130d565b5087518a8110610cda57610ce5565b600190940193610bff565b8a811015610abc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123c7565b600080808066b1a2bc2ec50000861115610d65576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123f7565b610d6f888861104f565b935034841115610dab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612357565b610db53485610acb565b9250610dca86670de0b6b3a76400008a611099565b915082821115610e06576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123d7565b6000831115610f29576002546040517f2e1a7d4d00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911690632e1a7d4d90610e65908690600401612453565b600060405180830381600087803b158015610e7f57600080fd5b505af1158015610e93573d6000803e3d6000fd5b505050506000821115610ee55760405173ffffffffffffffffffffffffffffffffffffffff86169083156108fc029084906000818181858888f19350505050158015610ee3573d6000803e3d6000fd5b505b610eef8383610acb565b90506000811115610f2957604051339082156108fc029083906000818181858888f19350505050158015610f27573d6000803e3d6000fd5b505b5050505050505050565b6000610f45838263ffffffff61136f16565b604080517f4552433230546f6b656e28616464726573732900000000000000000000000000815290519081900360130190209091507fffffffff0000000000000000000000000000000000000000000000000000000080831691161415610fb557610fb083836113dc565b610383565b604080517f455243373231546f6b656e28616464726573732c75696e7432353629000000008152905190819003601c0190207fffffffff000000000000000000000000000000000000000000000000000000008281169116141561101d57610fb083836115ca565b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123a7565b60008282018381101561108e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612397565b8091505b5092915050565b60008083116110d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612387565b6110e76110e185846116b2565b8461170d565b90505b9392505050565b6110f96119a9565b60608060008060006111096119a9565b89600081518110151561111857fe5b6020908102919091018101516101400151600580546040805160026001841615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190931692909204601f8101869004860283018601909152808252929950929091908301828280156111d05780601f106111a5576101008083540402835291602001916111d0565b820191906000526020600020905b8154815290600101906020018083116111b357829003601f168201915b5050505050945089519350600092505b82841461128857858a848151811015156111f657fe5b602090810290910101516101400152895185908b908590811061121557fe5b906020019060200201516101600181905250611235898860200151610acb565b91506112618a8481518110151561124857fe5b90602001906020020151838a86815181101515610a3c57fe5b905061126d878261130d565b6020870151891161127d57611288565b6001909201916111e0565b5050505050509392505050565b61129d6119a9565b606060006112ac868686611724565b600154815191935073ffffffffffffffffffffffffffffffffffffffff1691506080908390602082016000855af1801561130357825184526020830151602085015260408301516040850152606083015160608501525b5050509392505050565b8151815161131b919061104f565b825260208083015190820151611331919061104f565b60208301526040808301519082015161134a919061104f565b604083015260608083015190820151611363919061104f565b60609092019190915250565b6000816004018351101515156113b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612417565b5001602001517fffffffff000000000000000000000000000000000000000000000000000000001690565b6000806113f084601063ffffffff6118f616565b604080517f7472616e7366657228616464726573732c75696e7432353629000000000000008152905190819003601901812091935073ffffffffffffffffffffffffffffffffffffffff8416919061144e903390879060240161231c565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009094169390931783525181519192909182919080838360005b838110156114f25781810151838201526020016114da565b50505050905090810190601f16801561151f5780820380516001836020036101000a031916815260200191505b509150506000604051808303816000865af19250505080151561156e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123b7565b3d1561158b575060003d6020141561158b5760206000803e506000515b8015156115c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123b7565b50505050565b60008060018314611607576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612427565b61161884601063ffffffff6118f616565b915061162b84602463ffffffff61195716565b6040517f23b872dd00000000000000000000000000000000000000000000000000000000815290915073ffffffffffffffffffffffffffffffffffffffff8316906323b872dd90611684903090339086906004016122f4565b600060405180830381600087803b15801561169e57600080fd5b505af1158015610f29573d6000803e3d6000fd5b6000808315156116c55760009150611092565b508282028284828115156116d557fe5b041461108e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612397565b600080828481151561171b57fe5b04949350505050565b604080517fb4be83d5000000000000000000000000000000000000000000000000000000006020808301919091526060602483018181528751608485019081528884015160a48601529488015160c48501529087015160e4840152608087015161010484015260a087015161012484015260c087015161014484015260e08701516101648401526101008701516101848401526101208701516101a4840152610140870180516101c485019081526101608901516101e4860152610180905251805161020485018190529394919384936044870192849261022489019291820191601f82010460005b8181101561182b57835185526020948501949093019260010161180d565b50505050818103610160808401919091528a0151805180835260209283019291820191601f82010460005b81811015611874578351855260209485019490930192600101611856565b50505089845250848103602093840190815288518083529093918201918981019190601f82010460005b818110156118bc57835185526020948501949093019260010161189e565b5050507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08883030188525060405250505050509392505050565b600081601401835110151515611938576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612407565b50016014015173ffffffffffffffffffffffffffffffffffffffff1690565b60006107ba83836000816020018351101515156119a0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612377565b50016020015190565b608060405190810160405280600081526020016000815260200160008152602001600081525090565b60006107ba82356124ef565b6000601f820183136119ef57600080fd5b8135611a026119fd82612488565b612461565b81815260209384019390925082018360005b83811015611a405781358601611a2a8882611af0565b8452506020928301929190910190600101611a14565b5050505092915050565b6000601f82018313611a5b57600080fd5b8135611a696119fd82612488565b81815260209384019390925082018360005b83811015611a405781358601611a918882611b3f565b8452506020928301929190910190600101611a7b565b600080601f83018413611ab957600080fd5b50813567ffffffffffffffff811115611ad157600080fd5b602083019150836001820283011115611ae957600080fd5b9250929050565b6000601f82018313611b0157600080fd5b8135611b0f6119fd826124a9565b91508082526020830160208301858383011115611b2b57600080fd5b611b3683828461250b565b50505092915050565b60006101808284031215611b5257600080fd5b611b5d610180612461565b90506000611b6b84846119d2565b8252506020611b7c848483016119d2565b6020830152506040611b90848285016119d2565b6040830152506060611ba4848285016119d2565b6060830152506080611bb884828501611c88565b60808301525060a0611bcc84828501611c88565b60a08301525060c0611be084828501611c88565b60c08301525060e0611bf484828501611c88565b60e083015250610100611c0984828501611c88565b61010083015250610120611c1f84828501611c88565b6101208301525061014082013567ffffffffffffffff811115611c4157600080fd5b611c4d84828501611af0565b6101408301525061016082013567ffffffffffffffff811115611c6f57600080fd5b611c7b84828501611af0565b6101608301525092915050565b60006107ba8235612508565b600060208284031215611ca657600080fd5b6000611cb284846119d2565b949350505050565b60008060008060008060c08789031215611cd357600080fd5b863567ffffffffffffffff811115611cea57600080fd5b611cf689828a01611a4a565b965050602087013567ffffffffffffffff811115611d1357600080fd5b611d1f89828a016119de565b955050604087013567ffffffffffffffff811115611d3c57600080fd5b611d4889828a01611a4a565b945050606087013567ffffffffffffffff811115611d6557600080fd5b611d7189828a016119de565b9350506080611d8289828a01611c88565b92505060a0611d9389828a016119d2565b9150509295509295509295565b600080600080600080600060e0888a031215611dbb57600080fd5b873567ffffffffffffffff811115611dd257600080fd5b611dde8a828b01611a4a565b9750506020611def8a828b01611c88565b965050604088013567ffffffffffffffff811115611e0c57600080fd5b611e188a828b016119de565b955050606088013567ffffffffffffffff811115611e3557600080fd5b611e418a828b01611a4a565b945050608088013567ffffffffffffffff811115611e5e57600080fd5b611e6a8a828b016119de565b93505060a0611e7b8a828b01611c88565b92505060c0611e8c8a828b016119d2565b91505092959891949750929550565b600080600060408486031215611eb057600080fd5b833567ffffffffffffffff811115611ec757600080fd5b611ed386828701611aa7565b93509350506020611ee686828701611c88565b9150509250925092565b611ef9816124ef565b82525050565b602381527f44454641554c545f46554e4354494f4e5f574554485f434f4e54524143545f4f60208201527f4e4c590000000000000000000000000000000000000000000000000000000000604082015260600190565b601181527f494e56414c49445f4d53475f56414c5545000000000000000000000000000000602082015260400190565b600d81527f4f564552534f4c445f5745544800000000000000000000000000000000000000602082015260400190565b601181527f55494e543235365f554e444552464c4f57000000000000000000000000000000602082015260400190565b602681527f475245415445525f4f525f455155414c5f544f5f33325f4c454e4754485f524560208201527f5155495245440000000000000000000000000000000000000000000000000000604082015260600190565b601081527f4449564953494f4e5f42595f5a45524f00000000000000000000000000000000602082015260400190565b601081527f55494e543235365f4f564552464c4f5700000000000000000000000000000000602082015260400190565b601781527f554e535550504f525445445f41535345545f50524f5859000000000000000000602082015260400190565b600f81527f5452414e534645525f4641494c45440000000000000000000000000000000000602082015260400190565b601481527f434f4d504c4554455f46494c4c5f4641494c4544000000000000000000000000602082015260400190565b601a81527f494e53554646494349454e545f4554485f52454d41494e494e47000000000000602082015260400190565b601381527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000602082015260400190565b601881527f4645455f50455243454e544147455f544f4f5f4c415247450000000000000000602082015260400190565b602681527f475245415445525f4f525f455155414c5f544f5f32305f4c454e4754485f524560208201527f5155495245440000000000000000000000000000000000000000000000000000604082015260600190565b602581527f475245415445525f4f525f455155414c5f544f5f345f4c454e4754485f52455160208201527f5549524544000000000000000000000000000000000000000000000000000000604082015260600190565b600e81527f494e56414c49445f414d4f554e54000000000000000000000000000000000000602082015260400190565b805160808301906122a884826122dd565b5060208201516122bb60208501826122dd565b5060408201516122ce60408501826122dd565b5060608201516115c460608501825b611ef981612508565b602081016107bd8284611ef0565b606081016123028286611ef0565b61230f6020830185611ef0565b611cb260408301846122dd565b6040810161232a8285611ef0565b6110ea60208301846122dd565b602080825281016107bd81611eff565b602080825281016107bd81611f55565b602080825281016107bd81611f85565b602080825281016107bd81611fb5565b602080825281016107bd81611fe5565b602080825281016107bd8161203b565b602080825281016107bd8161206b565b602080825281016107bd8161209b565b602080825281016107bd816120cb565b602080825281016107bd816120fb565b602080825281016107bd8161212b565b602080825281016107bd8161215b565b602080825281016107bd8161218b565b602080825281016107bd816121bb565b602080825281016107bd81612211565b602080825281016107bd81612267565b61010081016124468285612297565b6110ea6080830184612297565b602081016107bd82846122dd565b60405181810167ffffffffffffffff8111828210171561248057600080fd5b604052919050565b600067ffffffffffffffff82111561249f57600080fd5b5060209081020190565b600067ffffffffffffffff8211156124c057600080fd5b506020601f919091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0160190565b73ffffffffffffffffffffffffffffffffffffffff1690565b90565b828183375060009101525600a265627a7a72305820185af4a5e8525b0c20983bf22c09773a1cab3f704716cba4c8da3b112601cd666c6578706572696d656e74616cf50037"
- }
- }
- },
- "networks": {
- "1": {
- "address": "0x7afc2d5107af94c462a194d2c21b5bdd238709d6",
- "links": {},
- "constructorArgs":
- "[\"0x4f833a24e1f95d70f028921e27040ca56e09ab0b\",\"0xf47261b0000000000000000000000000e41d2489571d322189246dafa5ebde1f4699f498\",\"0xf47261b0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2\"]"
- },
- "3": {
- "address": "0x3983e204b12b3c02fb0638caf2cd406a62e0ead3",
- "links": {},
- "constructorArgs":
- "[\"0x4530c0483a1633c7a1c97d2c53721caff2caaaaf\",\"0xf47261b0000000000000000000000000ff67881f8d12f372d91baae9752eb3631ff0ed00\",\"0xf47261b0000000000000000000000000c778417e063141139fce010982780140aa0cd5ab\"]"
- },
- "42": {
- "address": "0xd85e2fa7e7e252b27b01bf0d65c946959d2f45b8",
- "links": {},
- "constructorArgs":
- "[\"0x35dd2932454449b14cee11a94d3674a936d5d7b2\",\"0xf47261b00000000000000000000000002002d3812f58e35f0ea1ffbf80a75a38c32175fa\",\"0xf47261b0000000000000000000000000d0a1e359811322d97991e03f863a0c30c2cf029c\"]"
- },
- "50": {
- "address": "0xb69e673309512a9d726f87304c6984054f87a93b",
- "links": {},
- "constructorArgs":
- "[\"0x0b1ba0af832d7c05fd64161e0db78e85978e8082\",\"0xf47261b0000000000000000000000000871dd7c2b4b25e1aa18728e9d5f2af4c4e431f5c\",\"0xf47261b00000000000000000000000000000000000000000000000000000000000000000\"]"
- }
- }
-}
diff --git a/packages/migrations/artifacts/2.0.0/AssetProxyOwner.json b/packages/migrations/artifacts/2.0.0/AssetProxyOwner.json
deleted file mode 100644
index 680ed3abd..000000000
--- a/packages/migrations/artifacts/2.0.0/AssetProxyOwner.json
+++ /dev/null
@@ -1,985 +0,0 @@
-{
- "schemaVersion": "2.0.0",
- "contractName": "AssetProxyOwner",
- "compilerOutput": {
- "abi": [
- {
- "constant": true,
- "inputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "name": "owners",
- "outputs": [
- {
- "name": "",
- "type": "address"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "owner",
- "type": "address"
- }
- ],
- "name": "removeOwner",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "revokeConfirmation",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "",
- "type": "address"
- }
- ],
- "name": "isOwner",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "",
- "type": "uint256"
- },
- {
- "name": "",
- "type": "address"
- }
- ],
- "name": "confirmations",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "executeRemoveAuthorizedAddressAtIndex",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "secondsTimeLocked",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "pending",
- "type": "bool"
- },
- {
- "name": "executed",
- "type": "bool"
- }
- ],
- "name": "getTransactionCount",
- "outputs": [
- {
- "name": "count",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "assetProxyContract",
- "type": "address"
- },
- {
- "name": "isRegistered",
- "type": "bool"
- }
- ],
- "name": "registerAssetProxy",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "owner",
- "type": "address"
- }
- ],
- "name": "addOwner",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "isConfirmed",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_secondsTimeLocked",
- "type": "uint256"
- }
- ],
- "name": "changeTimeLock",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "",
- "type": "address"
- }
- ],
- "name": "isAssetProxyRegistered",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "getConfirmationCount",
- "outputs": [
- {
- "name": "count",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "name": "transactions",
- "outputs": [
- {
- "name": "destination",
- "type": "address"
- },
- {
- "name": "value",
- "type": "uint256"
- },
- {
- "name": "data",
- "type": "bytes"
- },
- {
- "name": "executed",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "getOwners",
- "outputs": [
- {
- "name": "",
- "type": "address[]"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "from",
- "type": "uint256"
- },
- {
- "name": "to",
- "type": "uint256"
- },
- {
- "name": "pending",
- "type": "bool"
- },
- {
- "name": "executed",
- "type": "bool"
- }
- ],
- "name": "getTransactionIds",
- "outputs": [
- {
- "name": "_transactionIds",
- "type": "uint256[]"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "getConfirmations",
- "outputs": [
- {
- "name": "_confirmations",
- "type": "address[]"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "transactionCount",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_required",
- "type": "uint256"
- }
- ],
- "name": "changeRequirement",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "confirmTransaction",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "destination",
- "type": "address"
- },
- {
- "name": "value",
- "type": "uint256"
- },
- {
- "name": "data",
- "type": "bytes"
- }
- ],
- "name": "submitTransaction",
- "outputs": [
- {
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "name": "confirmationTimes",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "MAX_OWNER_COUNT",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "required",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "owner",
- "type": "address"
- },
- {
- "name": "newOwner",
- "type": "address"
- }
- ],
- "name": "replaceOwner",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "executeTransaction",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "inputs": [
- {
- "name": "_owners",
- "type": "address[]"
- },
- {
- "name": "_assetProxyContracts",
- "type": "address[]"
- },
- {
- "name": "_required",
- "type": "uint256"
- },
- {
- "name": "_secondsTimeLocked",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "constructor"
- },
- {
- "payable": true,
- "stateMutability": "payable",
- "type": "fallback"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": false,
- "name": "assetProxyContract",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "isRegistered",
- "type": "bool"
- }
- ],
- "name": "AssetProxyRegistration",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "transactionId",
- "type": "uint256"
- },
- {
- "indexed": false,
- "name": "confirmationTime",
- "type": "uint256"
- }
- ],
- "name": "ConfirmationTimeSet",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": false,
- "name": "secondsTimeLocked",
- "type": "uint256"
- }
- ],
- "name": "TimeLockChange",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "sender",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "Confirmation",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "sender",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "Revocation",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "Submission",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "Execution",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "transactionId",
- "type": "uint256"
- }
- ],
- "name": "ExecutionFailure",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "sender",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "value",
- "type": "uint256"
- }
- ],
- "name": "Deposit",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "owner",
- "type": "address"
- }
- ],
- "name": "OwnerAddition",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "owner",
- "type": "address"
- }
- ],
- "name": "OwnerRemoval",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": false,
- "name": "required",
- "type": "uint256"
- }
- ],
- "name": "RequirementChange",
- "type": "event"
- }
- ],
- "evm": {
- "bytecode": {
- "linkReferences": {},
- "object": "0x60806040523480156200001157600080fd5b50604051620024633803806200246383398101604090815281516020830151918301516060840151918401805190949390930192909190600090819086908590859083908390869082603282118015906200006c5750818111155b80156200007857508015155b80156200008457508115155b15156200009057600080fd5b600092505b84518310156200016857600260008685815181101515620000b257fe5b6020908102909101810151600160a060020a031682528101919091526040016000205460ff161580156200010857508483815181101515620000f057fe5b90602001906020020151600160a060020a0316600014155b15156200011457600080fd5b60016002600087868151811015156200012957fe5b602090810291909101810151600160a060020a03168252810191909152604001600020805460ff19169115159190911790556001929092019162000095565b84516200017d9060039060208801906200026c565b50505060049190915550506006555060009250505b845182101562000260578482815181101515620001ab57fe5b602090810290910101519050600160a060020a03811615156200022f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f494e56414c49445f41535345545f50524f585900000000000000000000000000604482015290519081900360640190fd5b600160a060020a0381166000908152600860205260409020805460ff19166001908117909155919091019062000192565b50505050505062000300565b828054828255906000526020600020908101928215620002c4579160200282015b82811115620002c45782518254600160a060020a031916600160a060020a039091161782556020909201916001909101906200028d565b50620002d2929150620002d6565b5090565b620002fd91905b80821115620002d2578054600160a060020a0319168155600101620002dd565b90565b61215380620003106000396000f30060806040526004361061015e5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663025e7c2781146101a0578063173825d9146101e157806320ea8d861461020f5780632f54bf6e146102275780633411c81c146102695780633589b35c1461029a57806337bd78a0146102b257806354741525146102d95780635a1a66af146102f85780637065cb481461032b578063784547a7146103595780637ad28c511461037157806383250f79146103895780638b51d13f146103b75780639ace38c2146103cf578063a0e67e2b146104a4578063a8abe69a14610509578063b5dc40c31461052e578063b77bf60014610546578063ba51a6df1461055b578063c01a8c8414610573578063c64274741461058b578063d38f2d8214610601578063d74f8edd14610619578063dc8452cd1461062e578063e20056e614610643578063ee22610b14610677575b600034111561019e5760408051348152905133917fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c919081900360200190a25b005b3480156101ac57600080fd5b506101b860043561068f565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b3480156101ed57600080fd5b5061019e73ffffffffffffffffffffffffffffffffffffffff600435166106c4565b34801561021b57600080fd5b5061019e60043561091b565b34801561023357600080fd5b5061025573ffffffffffffffffffffffffffffffffffffffff600435166109f3565b604080519115158252519081900360200190f35b34801561027557600080fd5b5061025560043573ffffffffffffffffffffffffffffffffffffffff60243516610a08565b3480156102a657600080fd5b5061019e600435610a28565b3480156102be57600080fd5b506102c7610eda565b60408051918252519081900360200190f35b3480156102e557600080fd5b506102c760043515156024351515610ee0565b34801561030457600080fd5b5061019e73ffffffffffffffffffffffffffffffffffffffff600435166024351515610f4c565b34801561033757600080fd5b5061019e73ffffffffffffffffffffffffffffffffffffffff6004351661100b565b34801561036557600080fd5b50610255600435611180565b34801561037d57600080fd5b5061019e600435611211565b34801561039557600080fd5b5061025573ffffffffffffffffffffffffffffffffffffffff60043516611258565b3480156103c357600080fd5b506102c760043561126d565b3480156103db57600080fd5b506103e76004356112e9565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018060200183151515158152602001828103825284818151815260200191508051906020019080838360005b8381101561046657818101518382015260200161044e565b50505050905090810190601f1680156104935780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b3480156104b057600080fd5b506104b96113d2565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156104f55781810151838201526020016104dd565b505050509050019250505060405180910390f35b34801561051557600080fd5b506104b960043560243560443515156064351515611442565b34801561053a57600080fd5b506104b960043561157b565b34801561055257600080fd5b506102c7611728565b34801561056757600080fd5b5061019e60043561172e565b34801561057f57600080fd5b5061019e6004356117ad565b34801561059757600080fd5b50604080516020600460443581810135601f81018490048402850184019095528484526102c794823573ffffffffffffffffffffffffffffffffffffffff169460248035953695946064949201919081908401838280828437509497506119219650505050505050565b34801561060d57600080fd5b506102c7600435611940565b34801561062557600080fd5b506102c7611952565b34801561063a57600080fd5b506102c7611957565b34801561064f57600080fd5b5061019e73ffffffffffffffffffffffffffffffffffffffff6004358116906024351661195d565b34801561068357600080fd5b5061019e600435611b6d565b600380548290811061069d57fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b60003330146106d257600080fd5b73ffffffffffffffffffffffffffffffffffffffff8216600090815260026020526040902054829060ff16151561070857600080fd5b73ffffffffffffffffffffffffffffffffffffffff8316600090815260026020526040812080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905591505b6003547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0182101561088b578273ffffffffffffffffffffffffffffffffffffffff166003838154811015156107a857fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16141561088057600380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff810190811061080057fe5b6000918252602090912001546003805473ffffffffffffffffffffffffffffffffffffffff909216918490811061083357fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061088b565b600190910190610756565b600380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01906108bc9082612066565b5060035460045411156108d5576003546108d59061172e565b60405173ffffffffffffffffffffffffffffffffffffffff8416907f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9090600090a2505050565b3360008181526002602052604090205460ff16151561093957600080fd5b60008281526001602090815260408083203380855292529091205483919060ff16151561096557600080fd5b600084815260208190526040902060030154849060ff161561098657600080fd5b600085815260016020908152604080832033808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690555187927ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e991a35050505050565b60026020526000908152604090205460ff1681565b600160209081526000928352604080842090915290825290205460ff1681565b600081815260208190526040812060030154829060ff1615610a4957600080fd5b82610a5381611180565b1515610ac057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f54585f4e4f545f46554c4c595f434f4e4649524d454400000000000000000000604482015290519081900360640190fd5b600084815260208181526040808320805473ffffffffffffffffffffffffffffffffffffffff16845260089092529091205485919060ff161515610b6557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f554e524547495354455245445f41535345545f50524f58590000000000000000604482015290519081900360640190fd5b604080517f72656d6f7665417574686f72697a6564416464726573734174496e646578286181527f6464726573732c75696e74323536290000000000000000000000000000000000602080830191909152825191829003602f01822060028086018054601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61010060018416150201909116929092049182018490048402850184019095528084527fffffffff0000000000000000000000000000000000000000000000000000000090911693610ca193600093909290830182828015610c8e5780601f10610c6357610100808354040283529160200191610c8e565b820191906000526020600020905b815481529060010190602001808311610c7157829003601f168201915b5050505050611dfd90919063ffffffff16565b7fffffffff000000000000000000000000000000000000000000000000000000001614610d2f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f494e56414c49445f46554e4354494f4e5f53454c4543544f5200000000000000604482015290519081900360640190fd5b600086815260208181526040918290206003810180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001908117909155815481830154600280850180548851601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff97831615610100029790970190911692909204948501879004870282018701909752838152939a50610e479573ffffffffffffffffffffffffffffffffffffffff90921694909391908390830182828015610e3d5780601f10610e1257610100808354040283529160200191610e3d565b820191906000526020600020905b815481529060010190602001808311610e2057829003601f168201915b5050505050611ec5565b15610e7c5760405186907f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7590600090a2610ed2565b60405186907f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923690600090a26003850180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690555b505050505050565b60065481565b6000805b600554811015610f4557838015610f0d575060008181526020819052604090206003015460ff16155b80610f315750828015610f31575060008181526020819052604090206003015460ff165b15610f3d576001820191505b600101610ee4565b5092915050565b333014610f5857600080fd5b8173ffffffffffffffffffffffffffffffffffffffff81161515610f7b57600080fd5b73ffffffffffffffffffffffffffffffffffffffff831660008181526008602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001686151590811790915582519384529083015280517fdaef8ff7dc66c5e34eb9c338aab679d9f427f89868d9228494455a4d982eb2b09281900390910190a1505050565b33301461101757600080fd5b73ffffffffffffffffffffffffffffffffffffffff8116600090815260026020526040902054819060ff161561104c57600080fd5b8173ffffffffffffffffffffffffffffffffffffffff8116151561106f57600080fd5b6003805490506001016004546032821115801561108c5750818111155b801561109757508015155b80156110a257508115155b15156110ad57600080fd5b73ffffffffffffffffffffffffffffffffffffffff851660008181526002602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600190811790915560038054918201815583527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001684179055517ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d9190a25050505050565b600080805b60035481101561120a57600084815260016020526040812060038054919291849081106111ae57fe5b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff16835282019290925260400190205460ff16156111ef576001820191505b600454821415611202576001925061120a565b600101611185565b5050919050565b33301461121d57600080fd5b60068190556040805182815290517fd1c9101a34feff75cccef14a28785a0279cb0b49c1f321f21f5f422e746b43779181900360200190a150565b60086020526000908152604090205460ff1681565b6000805b6003548110156112e3576000838152600160205260408120600380549192918490811061129a57fe5b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff16835282019290925260400190205460ff16156112db576001820191505b600101611271565b50919050565b60006020818152918152604090819020805460018083015460028085018054875161010095821615959095027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff011691909104601f810188900488028401880190965285835273ffffffffffffffffffffffffffffffffffffffff909316959094919291908301828280156113bf5780601f10611394576101008083540402835291602001916113bf565b820191906000526020600020905b8154815290600101906020018083116113a257829003601f168201915b5050506003909301549192505060ff1684565b6060600380548060200260200160405190810160405280929190818152602001828054801561143757602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff16815260019091019060200180831161140c575b505050505090505b90565b606080600080600554604051908082528060200260200182016040528015611474578160200160208202803883390190505b50925060009150600090505b6005548110156114fb578580156114a9575060008181526020819052604090206003015460ff16155b806114cd57508480156114cd575060008181526020819052604090206003015460ff165b156114f3578083838151811015156114e157fe5b60209081029091010152600191909101905b600101611480565b878703604051908082528060200260200182016040528015611527578160200160208202803883390190505b5093508790505b8681101561157057828181518110151561154457fe5b906020019060200201518489830381518110151561155e57fe5b6020908102909101015260010161152e565b505050949350505050565b6060806000806003805490506040519080825280602002602001820160405280156115b0578160200160208202803883390190505b50925060009150600090505b60035481101561169457600085815260016020526040812060038054919291849081106115e557fe5b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff16835282019290925260400190205460ff161561168c57600380548290811061162d57fe5b600091825260209091200154835173ffffffffffffffffffffffffffffffffffffffff9091169084908490811061166057fe5b73ffffffffffffffffffffffffffffffffffffffff909216602092830290910190910152600191909101905b6001016115bc565b816040519080825280602002602001820160405280156116be578160200160208202803883390190505b509350600090505b818110156117205782818151811015156116dc57fe5b9060200190602002015184828151811015156116f457fe5b73ffffffffffffffffffffffffffffffffffffffff9092166020928302909101909101526001016116c6565b505050919050565b60055481565b33301461173a57600080fd5b600354816032821180159061174f5750818111155b801561175a57508015155b801561176557508115155b151561177057600080fd5b60048390556040805184815290517fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a9181900360200190a1505050565b3360008181526002602052604090205460ff1615156117cb57600080fd5b600082815260208190526040902054829073ffffffffffffffffffffffffffffffffffffffff1615156117fd57600080fd5b60008381526001602090815260408083203380855292529091205484919060ff161561182857600080fd5b8461183281611180565b1561189e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f54585f46554c4c595f434f4e4649524d45440000000000000000000000000000604482015290519081900360640190fd5b600086815260016020818152604080842033808652925280842080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016909317909255905188927f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef91a361191286611180565b15610ed257610ed28642611ee8565b600061192e848484611f33565b9050611939816117ad565b9392505050565b60076020526000908152604090205481565b603281565b60045481565b600033301461196b57600080fd5b73ffffffffffffffffffffffffffffffffffffffff8316600090815260026020526040902054839060ff1615156119a157600080fd5b73ffffffffffffffffffffffffffffffffffffffff8316600090815260026020526040902054839060ff16156119d657600080fd5b600092505b600354831015611a9b578473ffffffffffffffffffffffffffffffffffffffff16600384815481101515611a0b57fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff161415611a905783600384815481101515611a4357fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611a9b565b6001909201916119db565b73ffffffffffffffffffffffffffffffffffffffff80861660008181526002602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0090811690915593881682528082208054909416600117909355915190917f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9091a260405173ffffffffffffffffffffffffffffffffffffffff8516907ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d90600090a25050505050565b600081815260208190526040812060030154829060ff1615611b8e57600080fd5b82611b9881611180565b1515611c0557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f54585f4e4f545f46554c4c595f434f4e4649524d454400000000000000000000604482015290519081900360640190fd5b600654600085815260076020526040902054859101421015611c8857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f54494d455f4c4f434b5f494e434f4d504c455445000000000000000000000000604482015290519081900360640190fd5b600085815260208181526040918290206003810180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001908117909155815481830154600280850180548851601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff97831615610100029790970190911692909204948501879004870282018701909752838152939950611d6b9573ffffffffffffffffffffffffffffffffffffffff90921694909391908390830182828015610e3d5780601f10610e1257610100808354040283529160200191610e3d565b15611da05760405185907f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7590600090a2611df6565b60405185907f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923690600090a26003840180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690555b5050505050565b600081600401835110151515611e9a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f475245415445525f4f525f455155414c5f544f5f345f4c454e4754485f52455160448201527f5549524544000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b5001602001517fffffffff000000000000000000000000000000000000000000000000000000001690565b6000806040516020840160008287838a8c6187965a03f198975050505050505050565b6000828152600760209081526040918290208390558151838152915184927f0b237afe65f1514fd7ea3f923ea4fe792bdd07000a912b6cd1602a8e7f573c8d92908290030190a25050565b60008373ffffffffffffffffffffffffffffffffffffffff81161515611f5857600080fd5b6005546040805160808101825273ffffffffffffffffffffffffffffffffffffffff8881168252602080830189815283850189815260006060860181905287815280845295909520845181547fffffffffffffffffffffffff00000000000000000000000000000000000000001694169390931783555160018301559251805194965091939092611ff092600285019291019061208f565b5060609190910151600390910180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001691151591909117905560058054600101905560405182907fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5190600090a2509392505050565b81548183558181111561208a5760008381526020902061208a91810190830161210d565b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106120d057805160ff19168380011785556120fd565b828001600101855582156120fd579182015b828111156120fd5782518255916020019190600101906120e2565b5061210992915061210d565b5090565b61143f91905b8082111561210957600081556001016121135600a165627a7a72305820528db33b34dd3d87f92765da5fac3e1e5d1b9239353f6405405ca9bfc9cee8db0029",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH3 0x11 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x40 MLOAD PUSH3 0x2463 CODESIZE SUB DUP1 PUSH3 0x2463 DUP4 CODECOPY DUP2 ADD PUSH1 0x40 SWAP1 DUP2 MSTORE DUP2 MLOAD PUSH1 0x20 DUP4 ADD MLOAD SWAP2 DUP4 ADD MLOAD PUSH1 0x60 DUP5 ADD MLOAD SWAP2 DUP5 ADD DUP1 MLOAD SWAP1 SWAP5 SWAP4 SWAP1 SWAP4 ADD SWAP3 SWAP1 SWAP2 SWAP1 PUSH1 0x0 SWAP1 DUP2 SWAP1 DUP7 SWAP1 DUP6 SWAP1 DUP6 SWAP1 DUP4 SWAP1 DUP4 SWAP1 DUP7 SWAP1 DUP3 PUSH1 0x32 DUP3 GT DUP1 ISZERO SWAP1 PUSH3 0x6C JUMPI POP DUP2 DUP2 GT ISZERO JUMPDEST DUP1 ISZERO PUSH3 0x78 JUMPI POP DUP1 ISZERO ISZERO JUMPDEST DUP1 ISZERO PUSH3 0x84 JUMPI POP DUP2 ISZERO ISZERO JUMPDEST ISZERO ISZERO PUSH3 0x90 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 SWAP3 POP JUMPDEST DUP5 MLOAD DUP4 LT ISZERO PUSH3 0x168 JUMPI PUSH1 0x2 PUSH1 0x0 DUP7 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH3 0xB2 JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD DUP2 ADD MLOAD PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB AND DUP3 MSTORE DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x40 ADD PUSH1 0x0 KECCAK256 SLOAD PUSH1 0xFF AND ISZERO DUP1 ISZERO PUSH3 0x108 JUMPI POP DUP5 DUP4 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH3 0xF0 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB AND PUSH1 0x0 EQ ISZERO JUMPDEST ISZERO ISZERO PUSH3 0x114 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x1 PUSH1 0x2 PUSH1 0x0 DUP8 DUP7 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH3 0x129 JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP2 SWAP1 SWAP2 ADD DUP2 ADD MLOAD PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB AND DUP3 MSTORE DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x40 ADD PUSH1 0x0 KECCAK256 DUP1 SLOAD PUSH1 0xFF NOT AND SWAP2 ISZERO ISZERO SWAP2 SWAP1 SWAP2 OR SWAP1 SSTORE PUSH1 0x1 SWAP3 SWAP1 SWAP3 ADD SWAP2 PUSH3 0x95 JUMP JUMPDEST DUP5 MLOAD PUSH3 0x17D SWAP1 PUSH1 0x3 SWAP1 PUSH1 0x20 DUP9 ADD SWAP1 PUSH3 0x26C JUMP JUMPDEST POP POP POP PUSH1 0x4 SWAP2 SWAP1 SWAP2 SSTORE POP POP PUSH1 0x6 SSTORE POP PUSH1 0x0 SWAP3 POP POP JUMPDEST DUP5 MLOAD DUP3 LT ISZERO PUSH3 0x260 JUMPI DUP5 DUP3 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH3 0x1AB JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD MLOAD SWAP1 POP PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB DUP2 AND ISZERO ISZERO PUSH3 0x22F JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x494E56414C49445F41535345545F50524F585900000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB DUP2 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x8 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 DUP1 SLOAD PUSH1 0xFF NOT AND PUSH1 0x1 SWAP1 DUP2 OR SWAP1 SWAP2 SSTORE SWAP2 SWAP1 SWAP2 ADD SWAP1 PUSH3 0x192 JUMP JUMPDEST POP POP POP POP POP POP PUSH3 0x300 JUMP JUMPDEST DUP3 DUP1 SLOAD DUP3 DUP3 SSTORE SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 DUP2 ADD SWAP3 DUP3 ISZERO PUSH3 0x2C4 JUMPI SWAP2 PUSH1 0x20 MUL DUP3 ADD JUMPDEST DUP3 DUP2 GT ISZERO PUSH3 0x2C4 JUMPI DUP3 MLOAD DUP3 SLOAD PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB NOT AND PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB SWAP1 SWAP2 AND OR DUP3 SSTORE PUSH1 0x20 SWAP1 SWAP3 ADD SWAP2 PUSH1 0x1 SWAP1 SWAP2 ADD SWAP1 PUSH3 0x28D JUMP JUMPDEST POP PUSH3 0x2D2 SWAP3 SWAP2 POP PUSH3 0x2D6 JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST PUSH3 0x2FD SWAP2 SWAP1 JUMPDEST DUP1 DUP3 GT ISZERO PUSH3 0x2D2 JUMPI DUP1 SLOAD PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB NOT AND DUP2 SSTORE PUSH1 0x1 ADD PUSH3 0x2DD JUMP JUMPDEST SWAP1 JUMP JUMPDEST PUSH2 0x2153 DUP1 PUSH3 0x310 PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN STOP PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x15E JUMPI PUSH4 0xFFFFFFFF PUSH29 0x100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD DIV AND PUSH4 0x25E7C27 DUP2 EQ PUSH2 0x1A0 JUMPI DUP1 PUSH4 0x173825D9 EQ PUSH2 0x1E1 JUMPI DUP1 PUSH4 0x20EA8D86 EQ PUSH2 0x20F JUMPI DUP1 PUSH4 0x2F54BF6E EQ PUSH2 0x227 JUMPI DUP1 PUSH4 0x3411C81C EQ PUSH2 0x269 JUMPI DUP1 PUSH4 0x3589B35C EQ PUSH2 0x29A JUMPI DUP1 PUSH4 0x37BD78A0 EQ PUSH2 0x2B2 JUMPI DUP1 PUSH4 0x54741525 EQ PUSH2 0x2D9 JUMPI DUP1 PUSH4 0x5A1A66AF EQ PUSH2 0x2F8 JUMPI DUP1 PUSH4 0x7065CB48 EQ PUSH2 0x32B JUMPI DUP1 PUSH4 0x784547A7 EQ PUSH2 0x359 JUMPI DUP1 PUSH4 0x7AD28C51 EQ PUSH2 0x371 JUMPI DUP1 PUSH4 0x83250F79 EQ PUSH2 0x389 JUMPI DUP1 PUSH4 0x8B51D13F EQ PUSH2 0x3B7 JUMPI DUP1 PUSH4 0x9ACE38C2 EQ PUSH2 0x3CF JUMPI DUP1 PUSH4 0xA0E67E2B EQ PUSH2 0x4A4 JUMPI DUP1 PUSH4 0xA8ABE69A EQ PUSH2 0x509 JUMPI DUP1 PUSH4 0xB5DC40C3 EQ PUSH2 0x52E JUMPI DUP1 PUSH4 0xB77BF600 EQ PUSH2 0x546 JUMPI DUP1 PUSH4 0xBA51A6DF EQ PUSH2 0x55B JUMPI DUP1 PUSH4 0xC01A8C84 EQ PUSH2 0x573 JUMPI DUP1 PUSH4 0xC6427474 EQ PUSH2 0x58B JUMPI DUP1 PUSH4 0xD38F2D82 EQ PUSH2 0x601 JUMPI DUP1 PUSH4 0xD74F8EDD EQ PUSH2 0x619 JUMPI DUP1 PUSH4 0xDC8452CD EQ PUSH2 0x62E JUMPI DUP1 PUSH4 0xE20056E6 EQ PUSH2 0x643 JUMPI DUP1 PUSH4 0xEE22610B EQ PUSH2 0x677 JUMPI JUMPDEST PUSH1 0x0 CALLVALUE GT ISZERO PUSH2 0x19E JUMPI PUSH1 0x40 DUP1 MLOAD CALLVALUE DUP2 MSTORE SWAP1 MLOAD CALLER SWAP2 PUSH32 0xE1FFFCC4923D04B559F4D29A8BFC6CDA04EB5B0D3C460751C2402C5C5CC9109C SWAP2 SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 LOG2 JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1AC JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1B8 PUSH1 0x4 CALLDATALOAD PUSH2 0x68F JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1ED JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19E PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x6C4 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x21B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19E PUSH1 0x4 CALLDATALOAD PUSH2 0x91B JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x233 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x255 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x9F3 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 ISZERO ISZERO DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x275 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x255 PUSH1 0x4 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x24 CALLDATALOAD AND PUSH2 0xA08 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2A6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19E PUSH1 0x4 CALLDATALOAD PUSH2 0xA28 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2BE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2C7 PUSH2 0xEDA JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2E5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2C7 PUSH1 0x4 CALLDATALOAD ISZERO ISZERO PUSH1 0x24 CALLDATALOAD ISZERO ISZERO PUSH2 0xEE0 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x304 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19E PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD ISZERO ISZERO PUSH2 0xF4C JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x337 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19E PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x100B JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x365 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x255 PUSH1 0x4 CALLDATALOAD PUSH2 0x1180 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x37D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19E PUSH1 0x4 CALLDATALOAD PUSH2 0x1211 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x395 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x255 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x1258 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3C3 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2C7 PUSH1 0x4 CALLDATALOAD PUSH2 0x126D JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3DB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x3E7 PUSH1 0x4 CALLDATALOAD PUSH2 0x12E9 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP5 DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP4 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE DUP5 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x466 JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH2 0x44E JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x493 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP6 POP POP POP POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x4B0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x4B9 PUSH2 0x13D2 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 DUP1 DUP3 MSTORE DUP4 MLOAD DUP2 DUP4 ADD MSTORE DUP4 MLOAD SWAP2 SWAP3 DUP4 SWAP3 SWAP1 DUP4 ADD SWAP2 DUP6 DUP2 ADD SWAP2 MUL DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x4F5 JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH2 0x4DD JUMP JUMPDEST POP POP POP POP SWAP1 POP ADD SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x515 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x4B9 PUSH1 0x4 CALLDATALOAD PUSH1 0x24 CALLDATALOAD PUSH1 0x44 CALLDATALOAD ISZERO ISZERO PUSH1 0x64 CALLDATALOAD ISZERO ISZERO PUSH2 0x1442 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x53A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x4B9 PUSH1 0x4 CALLDATALOAD PUSH2 0x157B JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x552 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2C7 PUSH2 0x1728 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x567 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19E PUSH1 0x4 CALLDATALOAD PUSH2 0x172E JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x57F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19E PUSH1 0x4 CALLDATALOAD PUSH2 0x17AD JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x597 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 PUSH1 0x4 PUSH1 0x44 CALLDATALOAD DUP2 DUP2 ADD CALLDATALOAD PUSH1 0x1F DUP2 ADD DUP5 SWAP1 DIV DUP5 MUL DUP6 ADD DUP5 ADD SWAP1 SWAP6 MSTORE DUP5 DUP5 MSTORE PUSH2 0x2C7 SWAP5 DUP3 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP5 PUSH1 0x24 DUP1 CALLDATALOAD SWAP6 CALLDATASIZE SWAP6 SWAP5 PUSH1 0x64 SWAP5 SWAP3 ADD SWAP2 SWAP1 DUP2 SWAP1 DUP5 ADD DUP4 DUP3 DUP1 DUP3 DUP5 CALLDATACOPY POP SWAP5 SWAP8 POP PUSH2 0x1921 SWAP7 POP POP POP POP POP POP POP JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x60D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2C7 PUSH1 0x4 CALLDATALOAD PUSH2 0x1940 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x625 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2C7 PUSH2 0x1952 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x63A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2C7 PUSH2 0x1957 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x64F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19E PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH2 0x195D JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x683 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19E PUSH1 0x4 CALLDATALOAD PUSH2 0x1B6D JUMP JUMPDEST PUSH1 0x3 DUP1 SLOAD DUP3 SWAP1 DUP2 LT PUSH2 0x69D JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 POP DUP2 JUMP JUMPDEST PUSH1 0x0 CALLER ADDRESS EQ PUSH2 0x6D2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP3 SWAP1 PUSH1 0xFF AND ISZERO ISZERO PUSH2 0x708 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 DUP2 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE SWAP2 POP JUMPDEST PUSH1 0x3 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD DUP3 LT ISZERO PUSH2 0x88B JUMPI DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x3 DUP4 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x7A8 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0x880 JUMPI PUSH1 0x3 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 ADD SWAP1 DUP2 LT PUSH2 0x800 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH1 0x3 DUP1 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND SWAP2 DUP5 SWAP1 DUP2 LT PUSH2 0x833 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH2 0x88B JUMP JUMPDEST PUSH1 0x1 SWAP1 SWAP2 ADD SWAP1 PUSH2 0x756 JUMP JUMPDEST PUSH1 0x3 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 PUSH2 0x8BC SWAP1 DUP3 PUSH2 0x2066 JUMP JUMPDEST POP PUSH1 0x3 SLOAD PUSH1 0x4 SLOAD GT ISZERO PUSH2 0x8D5 JUMPI PUSH1 0x3 SLOAD PUSH2 0x8D5 SWAP1 PUSH2 0x172E JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND SWAP1 PUSH32 0x8001553A916EF2F495D26A907CC54D96ED840D7BDA71E73194BF5A9DF7A76B90 SWAP1 PUSH1 0x0 SWAP1 LOG2 POP POP POP JUMP JUMPDEST CALLER PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND ISZERO ISZERO PUSH2 0x939 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP3 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 CALLER DUP1 DUP6 MSTORE SWAP3 MSTORE SWAP1 SWAP2 KECCAK256 SLOAD DUP4 SWAP2 SWAP1 PUSH1 0xFF AND ISZERO ISZERO PUSH2 0x965 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP5 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x3 ADD SLOAD DUP5 SWAP1 PUSH1 0xFF AND ISZERO PUSH2 0x986 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP6 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 CALLER DUP1 DUP6 MSTORE SWAP3 MSTORE DUP1 DUP4 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE MLOAD DUP8 SWAP3 PUSH32 0xF6A317157440607F36269043EB55F1287A5A19BA2216AFEAB88CD46CBCFB88E9 SWAP2 LOG3 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x0 SWAP3 DUP4 MSTORE PUSH1 0x40 DUP1 DUP5 KECCAK256 SWAP1 SWAP2 MSTORE SWAP1 DUP3 MSTORE SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 DUP2 KECCAK256 PUSH1 0x3 ADD SLOAD DUP3 SWAP1 PUSH1 0xFF AND ISZERO PUSH2 0xA49 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 PUSH2 0xA53 DUP2 PUSH2 0x1180 JUMP JUMPDEST ISZERO ISZERO PUSH2 0xAC0 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x16 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x54585F4E4F545F46554C4C595F434F4E4649524D454400000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x0 DUP5 DUP2 MSTORE PUSH1 0x20 DUP2 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 DUP1 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP5 MSTORE PUSH1 0x8 SWAP1 SWAP3 MSTORE SWAP1 SWAP2 KECCAK256 SLOAD DUP6 SWAP2 SWAP1 PUSH1 0xFF AND ISZERO ISZERO PUSH2 0xB65 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x18 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x554E524547495354455245445F41535345545F50524F58590000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0x72656D6F7665417574686F72697A6564416464726573734174496E6465782861 DUP2 MSTORE PUSH32 0x6464726573732C75696E74323536290000000000000000000000000000000000 PUSH1 0x20 DUP1 DUP4 ADD SWAP2 SWAP1 SWAP2 MSTORE DUP3 MLOAD SWAP2 DUP3 SWAP1 SUB PUSH1 0x2F ADD DUP3 KECCAK256 PUSH1 0x2 DUP1 DUP7 ADD DUP1 SLOAD PUSH1 0x1F PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH2 0x100 PUSH1 0x1 DUP5 AND ISZERO MUL ADD SWAP1 SWAP2 AND SWAP3 SWAP1 SWAP3 DIV SWAP2 DUP3 ADD DUP5 SWAP1 DIV DUP5 MUL DUP6 ADD DUP5 ADD SWAP1 SWAP6 MSTORE DUP1 DUP5 MSTORE PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 SWAP1 SWAP2 AND SWAP4 PUSH2 0xCA1 SWAP4 PUSH1 0x0 SWAP4 SWAP1 SWAP3 SWAP1 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0xC8E JUMPI DUP1 PUSH1 0x1F LT PUSH2 0xC63 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0xC8E JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0xC71 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP PUSH2 0x1DFD SWAP1 SWAP2 SWAP1 PUSH4 0xFFFFFFFF AND JUMP JUMPDEST PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 AND EQ PUSH2 0xD2F JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x19 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x494E56414C49445F46554E4354494F4E5F53454C4543544F5200000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x0 DUP7 DUP2 MSTORE PUSH1 0x20 DUP2 DUP2 MSTORE PUSH1 0x40 SWAP2 DUP3 SWAP1 KECCAK256 PUSH1 0x3 DUP2 ADD DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 SWAP1 DUP2 OR SWAP1 SWAP2 SSTORE DUP2 SLOAD DUP2 DUP4 ADD SLOAD PUSH1 0x2 DUP1 DUP6 ADD DUP1 SLOAD DUP9 MLOAD PUSH1 0x1F PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP8 DUP4 AND ISZERO PUSH2 0x100 MUL SWAP8 SWAP1 SWAP8 ADD SWAP1 SWAP2 AND SWAP3 SWAP1 SWAP3 DIV SWAP5 DUP6 ADD DUP8 SWAP1 DIV DUP8 MUL DUP3 ADD DUP8 ADD SWAP1 SWAP8 MSTORE DUP4 DUP2 MSTORE SWAP4 SWAP11 POP PUSH2 0xE47 SWAP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND SWAP5 SWAP1 SWAP4 SWAP2 SWAP1 DUP4 SWAP1 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0xE3D JUMPI DUP1 PUSH1 0x1F LT PUSH2 0xE12 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0xE3D JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0xE20 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP PUSH2 0x1EC5 JUMP JUMPDEST ISZERO PUSH2 0xE7C JUMPI PUSH1 0x40 MLOAD DUP7 SWAP1 PUSH32 0x33E13ECB54C3076D8E8BB8C2881800A4D972B792045FFAE98FDF46DF365FED75 SWAP1 PUSH1 0x0 SWAP1 LOG2 PUSH2 0xED2 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP7 SWAP1 PUSH32 0x526441BB6C1ABA3C9A4A6CA1D6545DA9C2333C8C48343EF398EB858D72B79236 SWAP1 PUSH1 0x0 SWAP1 LOG2 PUSH1 0x3 DUP6 ADD DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE JUMPDEST POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x6 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 JUMPDEST PUSH1 0x5 SLOAD DUP2 LT ISZERO PUSH2 0xF45 JUMPI DUP4 DUP1 ISZERO PUSH2 0xF0D JUMPI POP PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x3 ADD SLOAD PUSH1 0xFF AND ISZERO JUMPDEST DUP1 PUSH2 0xF31 JUMPI POP DUP3 DUP1 ISZERO PUSH2 0xF31 JUMPI POP PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x3 ADD SLOAD PUSH1 0xFF AND JUMPDEST ISZERO PUSH2 0xF3D JUMPI PUSH1 0x1 DUP3 ADD SWAP2 POP JUMPDEST PUSH1 0x1 ADD PUSH2 0xEE4 JUMP JUMPDEST POP SWAP3 SWAP2 POP POP JUMP JUMPDEST CALLER ADDRESS EQ PUSH2 0xF58 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND ISZERO ISZERO PUSH2 0xF7B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x8 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP2 DUP3 SWAP1 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND DUP7 ISZERO ISZERO SWAP1 DUP2 OR SWAP1 SWAP2 SSTORE DUP3 MLOAD SWAP4 DUP5 MSTORE SWAP1 DUP4 ADD MSTORE DUP1 MLOAD PUSH32 0xDAEF8FF7DC66C5E34EB9C338AAB679D9F427F89868D9228494455A4D982EB2B0 SWAP3 DUP2 SWAP1 SUB SWAP1 SWAP2 ADD SWAP1 LOG1 POP POP POP JUMP JUMPDEST CALLER ADDRESS EQ PUSH2 0x1017 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP2 SWAP1 PUSH1 0xFF AND ISZERO PUSH2 0x104C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND ISZERO ISZERO PUSH2 0x106F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x3 DUP1 SLOAD SWAP1 POP PUSH1 0x1 ADD PUSH1 0x4 SLOAD PUSH1 0x32 DUP3 GT ISZERO DUP1 ISZERO PUSH2 0x108C JUMPI POP DUP2 DUP2 GT ISZERO JUMPDEST DUP1 ISZERO PUSH2 0x1097 JUMPI POP DUP1 ISZERO ISZERO JUMPDEST DUP1 ISZERO PUSH2 0x10A2 JUMPI POP DUP2 ISZERO ISZERO JUMPDEST ISZERO ISZERO PUSH2 0x10AD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP6 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 SWAP1 DUP2 OR SWAP1 SWAP2 SSTORE PUSH1 0x3 DUP1 SLOAD SWAP2 DUP3 ADD DUP2 SSTORE DUP4 MSTORE PUSH32 0xC2575A0E9E593C00F959F8C92F12DB2869C3395A3B0502D05E2516446F71F85B ADD DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND DUP5 OR SWAP1 SSTORE MLOAD PUSH32 0xF39E6E1EB0EDCF53C221607B54B00CD28F3196FED0A24994DC308B8F611B682D SWAP2 SWAP1 LOG2 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP1 JUMPDEST PUSH1 0x3 SLOAD DUP2 LT ISZERO PUSH2 0x120A JUMPI PUSH1 0x0 DUP5 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 DUP2 KECCAK256 PUSH1 0x3 DUP1 SLOAD SWAP2 SWAP3 SWAP2 DUP5 SWAP1 DUP2 LT PUSH2 0x11AE JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 DUP1 DUP4 KECCAK256 SWAP1 SWAP2 ADD SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP4 MSTORE DUP3 ADD SWAP3 SWAP1 SWAP3 MSTORE PUSH1 0x40 ADD SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x11EF JUMPI PUSH1 0x1 DUP3 ADD SWAP2 POP JUMPDEST PUSH1 0x4 SLOAD DUP3 EQ ISZERO PUSH2 0x1202 JUMPI PUSH1 0x1 SWAP3 POP PUSH2 0x120A JUMP JUMPDEST PUSH1 0x1 ADD PUSH2 0x1185 JUMP JUMPDEST POP POP SWAP2 SWAP1 POP JUMP JUMPDEST CALLER ADDRESS EQ PUSH2 0x121D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x6 DUP2 SWAP1 SSTORE PUSH1 0x40 DUP1 MLOAD DUP3 DUP2 MSTORE SWAP1 MLOAD PUSH32 0xD1C9101A34FEFF75CCCEF14A28785A0279CB0B49C1F321F21F5F422E746B4377 SWAP2 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 LOG1 POP JUMP JUMPDEST PUSH1 0x8 PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 JUMPDEST PUSH1 0x3 SLOAD DUP2 LT ISZERO PUSH2 0x12E3 JUMPI PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 DUP2 KECCAK256 PUSH1 0x3 DUP1 SLOAD SWAP2 SWAP3 SWAP2 DUP5 SWAP1 DUP2 LT PUSH2 0x129A JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 DUP1 DUP4 KECCAK256 SWAP1 SWAP2 ADD SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP4 MSTORE DUP3 ADD SWAP3 SWAP1 SWAP3 MSTORE PUSH1 0x40 ADD SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x12DB JUMPI PUSH1 0x1 DUP3 ADD SWAP2 POP JUMPDEST PUSH1 0x1 ADD PUSH2 0x1271 JUMP JUMPDEST POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP2 DUP2 MSTORE SWAP2 DUP2 MSTORE PUSH1 0x40 SWAP1 DUP2 SWAP1 KECCAK256 DUP1 SLOAD PUSH1 0x1 DUP1 DUP4 ADD SLOAD PUSH1 0x2 DUP1 DUP6 ADD DUP1 SLOAD DUP8 MLOAD PUSH2 0x100 SWAP6 DUP3 AND ISZERO SWAP6 SWAP1 SWAP6 MUL PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD AND SWAP2 SWAP1 SWAP2 DIV PUSH1 0x1F DUP2 ADD DUP9 SWAP1 DIV DUP9 MUL DUP5 ADD DUP9 ADD SWAP1 SWAP7 MSTORE DUP6 DUP4 MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP4 AND SWAP6 SWAP1 SWAP5 SWAP2 SWAP3 SWAP2 SWAP1 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0x13BF JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x1394 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x13BF JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x13A2 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP PUSH1 0x3 SWAP1 SWAP4 ADD SLOAD SWAP2 SWAP3 POP POP PUSH1 0xFF AND DUP5 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x3 DUP1 SLOAD DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD DUP1 ISZERO PUSH2 0x1437 JUMPI PUSH1 0x20 MUL DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x1 SWAP1 SWAP2 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x140C JUMPI JUMPDEST POP POP POP POP POP SWAP1 POP JUMPDEST SWAP1 JUMP JUMPDEST PUSH1 0x60 DUP1 PUSH1 0x0 DUP1 PUSH1 0x5 SLOAD PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x1474 JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CODESIZE DUP4 CODECOPY ADD SWAP1 POP JUMPDEST POP SWAP3 POP PUSH1 0x0 SWAP2 POP PUSH1 0x0 SWAP1 POP JUMPDEST PUSH1 0x5 SLOAD DUP2 LT ISZERO PUSH2 0x14FB JUMPI DUP6 DUP1 ISZERO PUSH2 0x14A9 JUMPI POP PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x3 ADD SLOAD PUSH1 0xFF AND ISZERO JUMPDEST DUP1 PUSH2 0x14CD JUMPI POP DUP5 DUP1 ISZERO PUSH2 0x14CD JUMPI POP PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x3 ADD SLOAD PUSH1 0xFF AND JUMPDEST ISZERO PUSH2 0x14F3 JUMPI DUP1 DUP4 DUP4 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x14E1 JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD MSTORE PUSH1 0x1 SWAP2 SWAP1 SWAP2 ADD SWAP1 JUMPDEST PUSH1 0x1 ADD PUSH2 0x1480 JUMP JUMPDEST DUP8 DUP8 SUB PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x1527 JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CODESIZE DUP4 CODECOPY ADD SWAP1 POP JUMPDEST POP SWAP4 POP DUP8 SWAP1 POP JUMPDEST DUP7 DUP2 LT ISZERO PUSH2 0x1570 JUMPI DUP3 DUP2 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1544 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP5 DUP10 DUP4 SUB DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x155E JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD MSTORE PUSH1 0x1 ADD PUSH2 0x152E JUMP JUMPDEST POP POP POP SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x60 DUP1 PUSH1 0x0 DUP1 PUSH1 0x3 DUP1 SLOAD SWAP1 POP PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x15B0 JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CODESIZE DUP4 CODECOPY ADD SWAP1 POP JUMPDEST POP SWAP3 POP PUSH1 0x0 SWAP2 POP PUSH1 0x0 SWAP1 POP JUMPDEST PUSH1 0x3 SLOAD DUP2 LT ISZERO PUSH2 0x1694 JUMPI PUSH1 0x0 DUP6 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 DUP2 KECCAK256 PUSH1 0x3 DUP1 SLOAD SWAP2 SWAP3 SWAP2 DUP5 SWAP1 DUP2 LT PUSH2 0x15E5 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 DUP1 DUP4 KECCAK256 SWAP1 SWAP2 ADD SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP4 MSTORE DUP3 ADD SWAP3 SWAP1 SWAP3 MSTORE PUSH1 0x40 ADD SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x168C JUMPI PUSH1 0x3 DUP1 SLOAD DUP3 SWAP1 DUP2 LT PUSH2 0x162D JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD DUP4 MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP2 AND SWAP1 DUP5 SWAP1 DUP5 SWAP1 DUP2 LT PUSH2 0x1660 JUMPI INVALID JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND PUSH1 0x20 SWAP3 DUP4 MUL SWAP1 SWAP2 ADD SWAP1 SWAP2 ADD MSTORE PUSH1 0x1 SWAP2 SWAP1 SWAP2 ADD SWAP1 JUMPDEST PUSH1 0x1 ADD PUSH2 0x15BC JUMP JUMPDEST DUP2 PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x16BE JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CODESIZE DUP4 CODECOPY ADD SWAP1 POP JUMPDEST POP SWAP4 POP PUSH1 0x0 SWAP1 POP JUMPDEST DUP2 DUP2 LT ISZERO PUSH2 0x1720 JUMPI DUP3 DUP2 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x16DC JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP5 DUP3 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x16F4 JUMPI INVALID JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND PUSH1 0x20 SWAP3 DUP4 MUL SWAP1 SWAP2 ADD SWAP1 SWAP2 ADD MSTORE PUSH1 0x1 ADD PUSH2 0x16C6 JUMP JUMPDEST POP POP POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x5 SLOAD DUP2 JUMP JUMPDEST CALLER ADDRESS EQ PUSH2 0x173A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x3 SLOAD DUP2 PUSH1 0x32 DUP3 GT DUP1 ISZERO SWAP1 PUSH2 0x174F JUMPI POP DUP2 DUP2 GT ISZERO JUMPDEST DUP1 ISZERO PUSH2 0x175A JUMPI POP DUP1 ISZERO ISZERO JUMPDEST DUP1 ISZERO PUSH2 0x1765 JUMPI POP DUP2 ISZERO ISZERO JUMPDEST ISZERO ISZERO PUSH2 0x1770 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x4 DUP4 SWAP1 SSTORE PUSH1 0x40 DUP1 MLOAD DUP5 DUP2 MSTORE SWAP1 MLOAD PUSH32 0xA3F1EE9126A074D9326C682F561767F710E927FAA811F7A99829D49DC421797A SWAP2 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 LOG1 POP POP POP JUMP JUMPDEST CALLER PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND ISZERO ISZERO PUSH2 0x17CB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP3 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP3 SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND ISZERO ISZERO PUSH2 0x17FD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 CALLER DUP1 DUP6 MSTORE SWAP3 MSTORE SWAP1 SWAP2 KECCAK256 SLOAD DUP5 SWAP2 SWAP1 PUSH1 0xFF AND ISZERO PUSH2 0x1828 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP5 PUSH2 0x1832 DUP2 PUSH2 0x1180 JUMP JUMPDEST ISZERO PUSH2 0x189E JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x12 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x54585F46554C4C595F434F4E4649524D45440000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x0 DUP7 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 DUP2 DUP2 MSTORE PUSH1 0x40 DUP1 DUP5 KECCAK256 CALLER DUP1 DUP7 MSTORE SWAP3 MSTORE DUP1 DUP5 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SWAP4 OR SWAP1 SWAP3 SSTORE SWAP1 MLOAD DUP9 SWAP3 PUSH32 0x4A504A94899432A9846E1AA406DCEB1BCFD538BB839071D49D1E5E23F5BE30EF SWAP2 LOG3 PUSH2 0x1912 DUP7 PUSH2 0x1180 JUMP JUMPDEST ISZERO PUSH2 0xED2 JUMPI PUSH2 0xED2 DUP7 TIMESTAMP PUSH2 0x1EE8 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x192E DUP5 DUP5 DUP5 PUSH2 0x1F33 JUMP JUMPDEST SWAP1 POP PUSH2 0x1939 DUP2 PUSH2 0x17AD JUMP JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x7 PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x32 DUP2 JUMP JUMPDEST PUSH1 0x4 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 CALLER ADDRESS EQ PUSH2 0x196B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP4 SWAP1 PUSH1 0xFF AND ISZERO ISZERO PUSH2 0x19A1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP4 SWAP1 PUSH1 0xFF AND ISZERO PUSH2 0x19D6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 SWAP3 POP JUMPDEST PUSH1 0x3 SLOAD DUP4 LT ISZERO PUSH2 0x1A9B JUMPI DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x3 DUP5 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1A0B JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0x1A90 JUMPI DUP4 PUSH1 0x3 DUP5 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1A43 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH2 0x1A9B JUMP JUMPDEST PUSH1 0x1 SWAP1 SWAP3 ADD SWAP2 PUSH2 0x19DB JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP7 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 SWAP1 DUP2 AND SWAP1 SWAP2 SSTORE SWAP4 DUP9 AND DUP3 MSTORE DUP1 DUP3 KECCAK256 DUP1 SLOAD SWAP1 SWAP5 AND PUSH1 0x1 OR SWAP1 SWAP4 SSTORE SWAP2 MLOAD SWAP1 SWAP2 PUSH32 0x8001553A916EF2F495D26A907CC54D96ED840D7BDA71E73194BF5A9DF7A76B90 SWAP2 LOG2 PUSH1 0x40 MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP6 AND SWAP1 PUSH32 0xF39E6E1EB0EDCF53C221607B54B00CD28F3196FED0A24994DC308B8F611B682D SWAP1 PUSH1 0x0 SWAP1 LOG2 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 DUP2 KECCAK256 PUSH1 0x3 ADD SLOAD DUP3 SWAP1 PUSH1 0xFF AND ISZERO PUSH2 0x1B8E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 PUSH2 0x1B98 DUP2 PUSH2 0x1180 JUMP JUMPDEST ISZERO ISZERO PUSH2 0x1C05 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x16 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x54585F4E4F545F46554C4C595F434F4E4649524D454400000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x6 SLOAD PUSH1 0x0 DUP6 DUP2 MSTORE PUSH1 0x7 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP6 SWAP2 ADD TIMESTAMP LT ISZERO PUSH2 0x1C88 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x14 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x54494D455F4C4F434B5F494E434F4D504C455445000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x0 DUP6 DUP2 MSTORE PUSH1 0x20 DUP2 DUP2 MSTORE PUSH1 0x40 SWAP2 DUP3 SWAP1 KECCAK256 PUSH1 0x3 DUP2 ADD DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 SWAP1 DUP2 OR SWAP1 SWAP2 SSTORE DUP2 SLOAD DUP2 DUP4 ADD SLOAD PUSH1 0x2 DUP1 DUP6 ADD DUP1 SLOAD DUP9 MLOAD PUSH1 0x1F PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP8 DUP4 AND ISZERO PUSH2 0x100 MUL SWAP8 SWAP1 SWAP8 ADD SWAP1 SWAP2 AND SWAP3 SWAP1 SWAP3 DIV SWAP5 DUP6 ADD DUP8 SWAP1 DIV DUP8 MUL DUP3 ADD DUP8 ADD SWAP1 SWAP8 MSTORE DUP4 DUP2 MSTORE SWAP4 SWAP10 POP PUSH2 0x1D6B SWAP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND SWAP5 SWAP1 SWAP4 SWAP2 SWAP1 DUP4 SWAP1 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0xE3D JUMPI DUP1 PUSH1 0x1F LT PUSH2 0xE12 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0xE3D JUMP JUMPDEST ISZERO PUSH2 0x1DA0 JUMPI PUSH1 0x40 MLOAD DUP6 SWAP1 PUSH32 0x33E13ECB54C3076D8E8BB8C2881800A4D972B792045FFAE98FDF46DF365FED75 SWAP1 PUSH1 0x0 SWAP1 LOG2 PUSH2 0x1DF6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP6 SWAP1 PUSH32 0x526441BB6C1ABA3C9A4A6CA1D6545DA9C2333C8C48343EF398EB858D72B79236 SWAP1 PUSH1 0x0 SWAP1 LOG2 PUSH1 0x3 DUP5 ADD DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE JUMPDEST POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x4 ADD DUP4 MLOAD LT ISZERO ISZERO ISZERO PUSH2 0x1E9A JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x25 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x475245415445525F4F525F455155414C5F544F5F345F4C454E4754485F524551 PUSH1 0x44 DUP3 ADD MSTORE PUSH32 0x5549524544000000000000000000000000000000000000000000000000000000 PUSH1 0x64 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x84 ADD SWAP1 REVERT JUMPDEST POP ADD PUSH1 0x20 ADD MLOAD PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 AND SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 MLOAD PUSH1 0x20 DUP5 ADD PUSH1 0x0 DUP3 DUP8 DUP4 DUP11 DUP13 PUSH2 0x8796 GAS SUB CALL SWAP9 SWAP8 POP POP POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP2 MSTORE PUSH1 0x7 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP2 DUP3 SWAP1 KECCAK256 DUP4 SWAP1 SSTORE DUP2 MLOAD DUP4 DUP2 MSTORE SWAP2 MLOAD DUP5 SWAP3 PUSH32 0xB237AFE65F1514FD7EA3F923EA4FE792BDD07000A912B6CD1602A8E7F573C8D SWAP3 SWAP1 DUP3 SWAP1 SUB ADD SWAP1 LOG2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND ISZERO ISZERO PUSH2 0x1F58 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x5 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x80 DUP2 ADD DUP3 MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP9 DUP2 AND DUP3 MSTORE PUSH1 0x20 DUP1 DUP4 ADD DUP10 DUP2 MSTORE DUP4 DUP6 ADD DUP10 DUP2 MSTORE PUSH1 0x0 PUSH1 0x60 DUP7 ADD DUP2 SWAP1 MSTORE DUP8 DUP2 MSTORE DUP1 DUP5 MSTORE SWAP6 SWAP1 SWAP6 KECCAK256 DUP5 MLOAD DUP2 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND SWAP5 AND SWAP4 SWAP1 SWAP4 OR DUP4 SSTORE MLOAD PUSH1 0x1 DUP4 ADD SSTORE SWAP3 MLOAD DUP1 MLOAD SWAP5 SWAP7 POP SWAP2 SWAP4 SWAP1 SWAP3 PUSH2 0x1FF0 SWAP3 PUSH1 0x2 DUP6 ADD SWAP3 SWAP2 ADD SWAP1 PUSH2 0x208F JUMP JUMPDEST POP PUSH1 0x60 SWAP2 SWAP1 SWAP2 ADD MLOAD PUSH1 0x3 SWAP1 SWAP2 ADD DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP2 ISZERO ISZERO SWAP2 SWAP1 SWAP2 OR SWAP1 SSTORE PUSH1 0x5 DUP1 SLOAD PUSH1 0x1 ADD SWAP1 SSTORE PUSH1 0x40 MLOAD DUP3 SWAP1 PUSH32 0xC0BA8FE4B176C1714197D43B9CC6BCF797A4A7461C5FE8D0EF6E184AE7601E51 SWAP1 PUSH1 0x0 SWAP1 LOG2 POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST DUP2 SLOAD DUP2 DUP4 SSTORE DUP2 DUP2 GT ISZERO PUSH2 0x208A JUMPI PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x20 SWAP1 KECCAK256 PUSH2 0x208A SWAP2 DUP2 ADD SWAP1 DUP4 ADD PUSH2 0x210D JUMP JUMPDEST POP POP POP JUMP JUMPDEST DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 PUSH1 0x1F ADD PUSH1 0x20 SWAP1 DIV DUP2 ADD SWAP3 DUP3 PUSH1 0x1F LT PUSH2 0x20D0 JUMPI DUP1 MLOAD PUSH1 0xFF NOT AND DUP4 DUP1 ADD OR DUP6 SSTORE PUSH2 0x20FD JUMP JUMPDEST DUP3 DUP1 ADD PUSH1 0x1 ADD DUP6 SSTORE DUP3 ISZERO PUSH2 0x20FD JUMPI SWAP2 DUP3 ADD JUMPDEST DUP3 DUP2 GT ISZERO PUSH2 0x20FD JUMPI DUP3 MLOAD DUP3 SSTORE SWAP2 PUSH1 0x20 ADD SWAP2 SWAP1 PUSH1 0x1 ADD SWAP1 PUSH2 0x20E2 JUMP JUMPDEST POP PUSH2 0x2109 SWAP3 SWAP2 POP PUSH2 0x210D JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST PUSH2 0x143F SWAP2 SWAP1 JUMPDEST DUP1 DUP3 GT ISZERO PUSH2 0x2109 JUMPI PUSH1 0x0 DUP2 SSTORE PUSH1 0x1 ADD PUSH2 0x2113 JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 MSTORE DUP14 0xb3 EXTCODESIZE CALLVALUE 0xdd RETURNDATASIZE DUP8 0xf9 0x27 PUSH6 0xDA5FAC3E1E5D SHL SWAP3 CODECOPY CALLDATALOAD 0x3f PUSH5 0x5405CA9BF 0xc9 0xce 0xe8 0xdb STOP 0x29 ",
- "sourceMap": "707:3438:20:-;;;2298:571;8:9:-1;5:2;;;30:1;27;20:12;5:2;2298:571:20;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2934:14:12;;2298:571:20;;;;;;;;;;2570:9;;;;2298:571;;;;;;;;;;2570:9;;2298:571;839:2:12;2273:29;;;;;:68;;;2331:10;2318:9;:23;;2273:68;:98;;;;-1:-1:-1;2357:14:12;;;2273:98;:129;;;;-1:-1:-1;2387:15:12;;;2273:129;2265:138;;;;;;;;2987:1;2980:8;;2975:151;2992:7;:14;2990:1;:16;2975:151;;;3036:7;:19;3044:7;3052:1;3044:10;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;3036:19:12;;;;;;;;;;;-1:-1:-1;3036:19:12;;;;3035:20;:39;;;;;3059:7;3067:1;3059:10;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;3059:15:12;3073:1;3059:15;;3035:39;3027:48;;;;;;;;3111:4;3089:7;:19;3097:7;3105:1;3097:10;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;3089:19:12;;;;;;;;;;;-1:-1:-1;3089:19:12;:26;;-1:-1:-1;;3089:26:12;;;;;;;;;;-1:-1:-1;3008:3:12;;;;;2975:151;;;3135:16;;;;:6;;:16;;;;;:::i;:::-;-1:-1:-1;;;3161:8:12;:20;;;;-1:-1:-1;;2245:17:13;:38;-1:-1:-1;;;;;2565:298:20;2589:20;:27;2585:1;:31;2565:298;;;2658:20;2679:1;2658:23;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;2720:24:20;;;;2695:102;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;2811:34:20;;;;;;:22;:34;;;;;:41;;-1:-1:-1;;2811:41:20;2848:4;2811:41;;;;;;2618:3;;;;;2565:298;;;2298:571;;;;;;707:3438;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;707:3438:20;-1:-1:-1;;;;;707:3438:20;;;;;;;;;;;-1:-1:-1;707:3438:20;;;;;;;-1:-1:-1;707:3438:20;;;-1:-1:-1;707:3438:20;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;-1:-1:-1;;;;;;707:3438:20;;;;;;;;;:::o;:::-;;;;;;;"
- },
- "deployedBytecode": {
- "linkReferences": {},
- "object": "0x60806040526004361061015e5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663025e7c2781146101a0578063173825d9146101e157806320ea8d861461020f5780632f54bf6e146102275780633411c81c146102695780633589b35c1461029a57806337bd78a0146102b257806354741525146102d95780635a1a66af146102f85780637065cb481461032b578063784547a7146103595780637ad28c511461037157806383250f79146103895780638b51d13f146103b75780639ace38c2146103cf578063a0e67e2b146104a4578063a8abe69a14610509578063b5dc40c31461052e578063b77bf60014610546578063ba51a6df1461055b578063c01a8c8414610573578063c64274741461058b578063d38f2d8214610601578063d74f8edd14610619578063dc8452cd1461062e578063e20056e614610643578063ee22610b14610677575b600034111561019e5760408051348152905133917fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c919081900360200190a25b005b3480156101ac57600080fd5b506101b860043561068f565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b3480156101ed57600080fd5b5061019e73ffffffffffffffffffffffffffffffffffffffff600435166106c4565b34801561021b57600080fd5b5061019e60043561091b565b34801561023357600080fd5b5061025573ffffffffffffffffffffffffffffffffffffffff600435166109f3565b604080519115158252519081900360200190f35b34801561027557600080fd5b5061025560043573ffffffffffffffffffffffffffffffffffffffff60243516610a08565b3480156102a657600080fd5b5061019e600435610a28565b3480156102be57600080fd5b506102c7610eda565b60408051918252519081900360200190f35b3480156102e557600080fd5b506102c760043515156024351515610ee0565b34801561030457600080fd5b5061019e73ffffffffffffffffffffffffffffffffffffffff600435166024351515610f4c565b34801561033757600080fd5b5061019e73ffffffffffffffffffffffffffffffffffffffff6004351661100b565b34801561036557600080fd5b50610255600435611180565b34801561037d57600080fd5b5061019e600435611211565b34801561039557600080fd5b5061025573ffffffffffffffffffffffffffffffffffffffff60043516611258565b3480156103c357600080fd5b506102c760043561126d565b3480156103db57600080fd5b506103e76004356112e9565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018060200183151515158152602001828103825284818151815260200191508051906020019080838360005b8381101561046657818101518382015260200161044e565b50505050905090810190601f1680156104935780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b3480156104b057600080fd5b506104b96113d2565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156104f55781810151838201526020016104dd565b505050509050019250505060405180910390f35b34801561051557600080fd5b506104b960043560243560443515156064351515611442565b34801561053a57600080fd5b506104b960043561157b565b34801561055257600080fd5b506102c7611728565b34801561056757600080fd5b5061019e60043561172e565b34801561057f57600080fd5b5061019e6004356117ad565b34801561059757600080fd5b50604080516020600460443581810135601f81018490048402850184019095528484526102c794823573ffffffffffffffffffffffffffffffffffffffff169460248035953695946064949201919081908401838280828437509497506119219650505050505050565b34801561060d57600080fd5b506102c7600435611940565b34801561062557600080fd5b506102c7611952565b34801561063a57600080fd5b506102c7611957565b34801561064f57600080fd5b5061019e73ffffffffffffffffffffffffffffffffffffffff6004358116906024351661195d565b34801561068357600080fd5b5061019e600435611b6d565b600380548290811061069d57fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b60003330146106d257600080fd5b73ffffffffffffffffffffffffffffffffffffffff8216600090815260026020526040902054829060ff16151561070857600080fd5b73ffffffffffffffffffffffffffffffffffffffff8316600090815260026020526040812080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905591505b6003547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0182101561088b578273ffffffffffffffffffffffffffffffffffffffff166003838154811015156107a857fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16141561088057600380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff810190811061080057fe5b6000918252602090912001546003805473ffffffffffffffffffffffffffffffffffffffff909216918490811061083357fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061088b565b600190910190610756565b600380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01906108bc9082612066565b5060035460045411156108d5576003546108d59061172e565b60405173ffffffffffffffffffffffffffffffffffffffff8416907f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9090600090a2505050565b3360008181526002602052604090205460ff16151561093957600080fd5b60008281526001602090815260408083203380855292529091205483919060ff16151561096557600080fd5b600084815260208190526040902060030154849060ff161561098657600080fd5b600085815260016020908152604080832033808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690555187927ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e991a35050505050565b60026020526000908152604090205460ff1681565b600160209081526000928352604080842090915290825290205460ff1681565b600081815260208190526040812060030154829060ff1615610a4957600080fd5b82610a5381611180565b1515610ac057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f54585f4e4f545f46554c4c595f434f4e4649524d454400000000000000000000604482015290519081900360640190fd5b600084815260208181526040808320805473ffffffffffffffffffffffffffffffffffffffff16845260089092529091205485919060ff161515610b6557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f554e524547495354455245445f41535345545f50524f58590000000000000000604482015290519081900360640190fd5b604080517f72656d6f7665417574686f72697a6564416464726573734174496e646578286181527f6464726573732c75696e74323536290000000000000000000000000000000000602080830191909152825191829003602f01822060028086018054601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61010060018416150201909116929092049182018490048402850184019095528084527fffffffff0000000000000000000000000000000000000000000000000000000090911693610ca193600093909290830182828015610c8e5780601f10610c6357610100808354040283529160200191610c8e565b820191906000526020600020905b815481529060010190602001808311610c7157829003601f168201915b5050505050611dfd90919063ffffffff16565b7fffffffff000000000000000000000000000000000000000000000000000000001614610d2f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f494e56414c49445f46554e4354494f4e5f53454c4543544f5200000000000000604482015290519081900360640190fd5b600086815260208181526040918290206003810180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001908117909155815481830154600280850180548851601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff97831615610100029790970190911692909204948501879004870282018701909752838152939a50610e479573ffffffffffffffffffffffffffffffffffffffff90921694909391908390830182828015610e3d5780601f10610e1257610100808354040283529160200191610e3d565b820191906000526020600020905b815481529060010190602001808311610e2057829003601f168201915b5050505050611ec5565b15610e7c5760405186907f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7590600090a2610ed2565b60405186907f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923690600090a26003850180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690555b505050505050565b60065481565b6000805b600554811015610f4557838015610f0d575060008181526020819052604090206003015460ff16155b80610f315750828015610f31575060008181526020819052604090206003015460ff165b15610f3d576001820191505b600101610ee4565b5092915050565b333014610f5857600080fd5b8173ffffffffffffffffffffffffffffffffffffffff81161515610f7b57600080fd5b73ffffffffffffffffffffffffffffffffffffffff831660008181526008602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001686151590811790915582519384529083015280517fdaef8ff7dc66c5e34eb9c338aab679d9f427f89868d9228494455a4d982eb2b09281900390910190a1505050565b33301461101757600080fd5b73ffffffffffffffffffffffffffffffffffffffff8116600090815260026020526040902054819060ff161561104c57600080fd5b8173ffffffffffffffffffffffffffffffffffffffff8116151561106f57600080fd5b6003805490506001016004546032821115801561108c5750818111155b801561109757508015155b80156110a257508115155b15156110ad57600080fd5b73ffffffffffffffffffffffffffffffffffffffff851660008181526002602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600190811790915560038054918201815583527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001684179055517ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d9190a25050505050565b600080805b60035481101561120a57600084815260016020526040812060038054919291849081106111ae57fe5b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff16835282019290925260400190205460ff16156111ef576001820191505b600454821415611202576001925061120a565b600101611185565b5050919050565b33301461121d57600080fd5b60068190556040805182815290517fd1c9101a34feff75cccef14a28785a0279cb0b49c1f321f21f5f422e746b43779181900360200190a150565b60086020526000908152604090205460ff1681565b6000805b6003548110156112e3576000838152600160205260408120600380549192918490811061129a57fe5b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff16835282019290925260400190205460ff16156112db576001820191505b600101611271565b50919050565b60006020818152918152604090819020805460018083015460028085018054875161010095821615959095027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff011691909104601f810188900488028401880190965285835273ffffffffffffffffffffffffffffffffffffffff909316959094919291908301828280156113bf5780601f10611394576101008083540402835291602001916113bf565b820191906000526020600020905b8154815290600101906020018083116113a257829003601f168201915b5050506003909301549192505060ff1684565b6060600380548060200260200160405190810160405280929190818152602001828054801561143757602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff16815260019091019060200180831161140c575b505050505090505b90565b606080600080600554604051908082528060200260200182016040528015611474578160200160208202803883390190505b50925060009150600090505b6005548110156114fb578580156114a9575060008181526020819052604090206003015460ff16155b806114cd57508480156114cd575060008181526020819052604090206003015460ff165b156114f3578083838151811015156114e157fe5b60209081029091010152600191909101905b600101611480565b878703604051908082528060200260200182016040528015611527578160200160208202803883390190505b5093508790505b8681101561157057828181518110151561154457fe5b906020019060200201518489830381518110151561155e57fe5b6020908102909101015260010161152e565b505050949350505050565b6060806000806003805490506040519080825280602002602001820160405280156115b0578160200160208202803883390190505b50925060009150600090505b60035481101561169457600085815260016020526040812060038054919291849081106115e557fe5b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff16835282019290925260400190205460ff161561168c57600380548290811061162d57fe5b600091825260209091200154835173ffffffffffffffffffffffffffffffffffffffff9091169084908490811061166057fe5b73ffffffffffffffffffffffffffffffffffffffff909216602092830290910190910152600191909101905b6001016115bc565b816040519080825280602002602001820160405280156116be578160200160208202803883390190505b509350600090505b818110156117205782818151811015156116dc57fe5b9060200190602002015184828151811015156116f457fe5b73ffffffffffffffffffffffffffffffffffffffff9092166020928302909101909101526001016116c6565b505050919050565b60055481565b33301461173a57600080fd5b600354816032821180159061174f5750818111155b801561175a57508015155b801561176557508115155b151561177057600080fd5b60048390556040805184815290517fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a9181900360200190a1505050565b3360008181526002602052604090205460ff1615156117cb57600080fd5b600082815260208190526040902054829073ffffffffffffffffffffffffffffffffffffffff1615156117fd57600080fd5b60008381526001602090815260408083203380855292529091205484919060ff161561182857600080fd5b8461183281611180565b1561189e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f54585f46554c4c595f434f4e4649524d45440000000000000000000000000000604482015290519081900360640190fd5b600086815260016020818152604080842033808652925280842080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016909317909255905188927f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef91a361191286611180565b15610ed257610ed28642611ee8565b600061192e848484611f33565b9050611939816117ad565b9392505050565b60076020526000908152604090205481565b603281565b60045481565b600033301461196b57600080fd5b73ffffffffffffffffffffffffffffffffffffffff8316600090815260026020526040902054839060ff1615156119a157600080fd5b73ffffffffffffffffffffffffffffffffffffffff8316600090815260026020526040902054839060ff16156119d657600080fd5b600092505b600354831015611a9b578473ffffffffffffffffffffffffffffffffffffffff16600384815481101515611a0b57fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff161415611a905783600384815481101515611a4357fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611a9b565b6001909201916119db565b73ffffffffffffffffffffffffffffffffffffffff80861660008181526002602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0090811690915593881682528082208054909416600117909355915190917f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9091a260405173ffffffffffffffffffffffffffffffffffffffff8516907ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d90600090a25050505050565b600081815260208190526040812060030154829060ff1615611b8e57600080fd5b82611b9881611180565b1515611c0557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f54585f4e4f545f46554c4c595f434f4e4649524d454400000000000000000000604482015290519081900360640190fd5b600654600085815260076020526040902054859101421015611c8857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f54494d455f4c4f434b5f494e434f4d504c455445000000000000000000000000604482015290519081900360640190fd5b600085815260208181526040918290206003810180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001908117909155815481830154600280850180548851601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff97831615610100029790970190911692909204948501879004870282018701909752838152939950611d6b9573ffffffffffffffffffffffffffffffffffffffff90921694909391908390830182828015610e3d5780601f10610e1257610100808354040283529160200191610e3d565b15611da05760405185907f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7590600090a2611df6565b60405185907f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923690600090a26003840180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690555b5050505050565b600081600401835110151515611e9a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f475245415445525f4f525f455155414c5f544f5f345f4c454e4754485f52455160448201527f5549524544000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b5001602001517fffffffff000000000000000000000000000000000000000000000000000000001690565b6000806040516020840160008287838a8c6187965a03f198975050505050505050565b6000828152600760209081526040918290208390558151838152915184927f0b237afe65f1514fd7ea3f923ea4fe792bdd07000a912b6cd1602a8e7f573c8d92908290030190a25050565b60008373ffffffffffffffffffffffffffffffffffffffff81161515611f5857600080fd5b6005546040805160808101825273ffffffffffffffffffffffffffffffffffffffff8881168252602080830189815283850189815260006060860181905287815280845295909520845181547fffffffffffffffffffffffff00000000000000000000000000000000000000001694169390931783555160018301559251805194965091939092611ff092600285019291019061208f565b5060609190910151600390910180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001691151591909117905560058054600101905560405182907fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5190600090a2509392505050565b81548183558181111561208a5760008381526020902061208a91810190830161210d565b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106120d057805160ff19168380011785556120fd565b828001600101855582156120fd579182015b828111156120fd5782518255916020019190600101906120e2565b5061210992915061210d565b5090565b61143f91905b8082111561210957600081556001016121135600a165627a7a72305820528db33b34dd3d87f92765da5fac3e1e5d1b9239353f6405405ca9bfc9cee8db0029",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x15E JUMPI PUSH4 0xFFFFFFFF PUSH29 0x100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD DIV AND PUSH4 0x25E7C27 DUP2 EQ PUSH2 0x1A0 JUMPI DUP1 PUSH4 0x173825D9 EQ PUSH2 0x1E1 JUMPI DUP1 PUSH4 0x20EA8D86 EQ PUSH2 0x20F JUMPI DUP1 PUSH4 0x2F54BF6E EQ PUSH2 0x227 JUMPI DUP1 PUSH4 0x3411C81C EQ PUSH2 0x269 JUMPI DUP1 PUSH4 0x3589B35C EQ PUSH2 0x29A JUMPI DUP1 PUSH4 0x37BD78A0 EQ PUSH2 0x2B2 JUMPI DUP1 PUSH4 0x54741525 EQ PUSH2 0x2D9 JUMPI DUP1 PUSH4 0x5A1A66AF EQ PUSH2 0x2F8 JUMPI DUP1 PUSH4 0x7065CB48 EQ PUSH2 0x32B JUMPI DUP1 PUSH4 0x784547A7 EQ PUSH2 0x359 JUMPI DUP1 PUSH4 0x7AD28C51 EQ PUSH2 0x371 JUMPI DUP1 PUSH4 0x83250F79 EQ PUSH2 0x389 JUMPI DUP1 PUSH4 0x8B51D13F EQ PUSH2 0x3B7 JUMPI DUP1 PUSH4 0x9ACE38C2 EQ PUSH2 0x3CF JUMPI DUP1 PUSH4 0xA0E67E2B EQ PUSH2 0x4A4 JUMPI DUP1 PUSH4 0xA8ABE69A EQ PUSH2 0x509 JUMPI DUP1 PUSH4 0xB5DC40C3 EQ PUSH2 0x52E JUMPI DUP1 PUSH4 0xB77BF600 EQ PUSH2 0x546 JUMPI DUP1 PUSH4 0xBA51A6DF EQ PUSH2 0x55B JUMPI DUP1 PUSH4 0xC01A8C84 EQ PUSH2 0x573 JUMPI DUP1 PUSH4 0xC6427474 EQ PUSH2 0x58B JUMPI DUP1 PUSH4 0xD38F2D82 EQ PUSH2 0x601 JUMPI DUP1 PUSH4 0xD74F8EDD EQ PUSH2 0x619 JUMPI DUP1 PUSH4 0xDC8452CD EQ PUSH2 0x62E JUMPI DUP1 PUSH4 0xE20056E6 EQ PUSH2 0x643 JUMPI DUP1 PUSH4 0xEE22610B EQ PUSH2 0x677 JUMPI JUMPDEST PUSH1 0x0 CALLVALUE GT ISZERO PUSH2 0x19E JUMPI PUSH1 0x40 DUP1 MLOAD CALLVALUE DUP2 MSTORE SWAP1 MLOAD CALLER SWAP2 PUSH32 0xE1FFFCC4923D04B559F4D29A8BFC6CDA04EB5B0D3C460751C2402C5C5CC9109C SWAP2 SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 LOG2 JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1AC JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1B8 PUSH1 0x4 CALLDATALOAD PUSH2 0x68F JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1ED JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19E PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x6C4 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x21B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19E PUSH1 0x4 CALLDATALOAD PUSH2 0x91B JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x233 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x255 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x9F3 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 ISZERO ISZERO DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x275 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x255 PUSH1 0x4 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x24 CALLDATALOAD AND PUSH2 0xA08 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2A6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19E PUSH1 0x4 CALLDATALOAD PUSH2 0xA28 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2BE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2C7 PUSH2 0xEDA JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2E5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2C7 PUSH1 0x4 CALLDATALOAD ISZERO ISZERO PUSH1 0x24 CALLDATALOAD ISZERO ISZERO PUSH2 0xEE0 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x304 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19E PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD ISZERO ISZERO PUSH2 0xF4C JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x337 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19E PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x100B JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x365 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x255 PUSH1 0x4 CALLDATALOAD PUSH2 0x1180 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x37D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19E PUSH1 0x4 CALLDATALOAD PUSH2 0x1211 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x395 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x255 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x1258 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3C3 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2C7 PUSH1 0x4 CALLDATALOAD PUSH2 0x126D JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3DB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x3E7 PUSH1 0x4 CALLDATALOAD PUSH2 0x12E9 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP5 DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP4 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE DUP5 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x466 JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH2 0x44E JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x493 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP6 POP POP POP POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x4B0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x4B9 PUSH2 0x13D2 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 DUP1 DUP3 MSTORE DUP4 MLOAD DUP2 DUP4 ADD MSTORE DUP4 MLOAD SWAP2 SWAP3 DUP4 SWAP3 SWAP1 DUP4 ADD SWAP2 DUP6 DUP2 ADD SWAP2 MUL DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x4F5 JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH2 0x4DD JUMP JUMPDEST POP POP POP POP SWAP1 POP ADD SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x515 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x4B9 PUSH1 0x4 CALLDATALOAD PUSH1 0x24 CALLDATALOAD PUSH1 0x44 CALLDATALOAD ISZERO ISZERO PUSH1 0x64 CALLDATALOAD ISZERO ISZERO PUSH2 0x1442 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x53A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x4B9 PUSH1 0x4 CALLDATALOAD PUSH2 0x157B JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x552 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2C7 PUSH2 0x1728 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x567 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19E PUSH1 0x4 CALLDATALOAD PUSH2 0x172E JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x57F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19E PUSH1 0x4 CALLDATALOAD PUSH2 0x17AD JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x597 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 PUSH1 0x4 PUSH1 0x44 CALLDATALOAD DUP2 DUP2 ADD CALLDATALOAD PUSH1 0x1F DUP2 ADD DUP5 SWAP1 DIV DUP5 MUL DUP6 ADD DUP5 ADD SWAP1 SWAP6 MSTORE DUP5 DUP5 MSTORE PUSH2 0x2C7 SWAP5 DUP3 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP5 PUSH1 0x24 DUP1 CALLDATALOAD SWAP6 CALLDATASIZE SWAP6 SWAP5 PUSH1 0x64 SWAP5 SWAP3 ADD SWAP2 SWAP1 DUP2 SWAP1 DUP5 ADD DUP4 DUP3 DUP1 DUP3 DUP5 CALLDATACOPY POP SWAP5 SWAP8 POP PUSH2 0x1921 SWAP7 POP POP POP POP POP POP POP JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x60D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2C7 PUSH1 0x4 CALLDATALOAD PUSH2 0x1940 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x625 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2C7 PUSH2 0x1952 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x63A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2C7 PUSH2 0x1957 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x64F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19E PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH2 0x195D JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x683 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19E PUSH1 0x4 CALLDATALOAD PUSH2 0x1B6D JUMP JUMPDEST PUSH1 0x3 DUP1 SLOAD DUP3 SWAP1 DUP2 LT PUSH2 0x69D JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 POP DUP2 JUMP JUMPDEST PUSH1 0x0 CALLER ADDRESS EQ PUSH2 0x6D2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP3 SWAP1 PUSH1 0xFF AND ISZERO ISZERO PUSH2 0x708 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 DUP2 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE SWAP2 POP JUMPDEST PUSH1 0x3 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD DUP3 LT ISZERO PUSH2 0x88B JUMPI DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x3 DUP4 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x7A8 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0x880 JUMPI PUSH1 0x3 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 ADD SWAP1 DUP2 LT PUSH2 0x800 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH1 0x3 DUP1 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND SWAP2 DUP5 SWAP1 DUP2 LT PUSH2 0x833 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH2 0x88B JUMP JUMPDEST PUSH1 0x1 SWAP1 SWAP2 ADD SWAP1 PUSH2 0x756 JUMP JUMPDEST PUSH1 0x3 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 PUSH2 0x8BC SWAP1 DUP3 PUSH2 0x2066 JUMP JUMPDEST POP PUSH1 0x3 SLOAD PUSH1 0x4 SLOAD GT ISZERO PUSH2 0x8D5 JUMPI PUSH1 0x3 SLOAD PUSH2 0x8D5 SWAP1 PUSH2 0x172E JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND SWAP1 PUSH32 0x8001553A916EF2F495D26A907CC54D96ED840D7BDA71E73194BF5A9DF7A76B90 SWAP1 PUSH1 0x0 SWAP1 LOG2 POP POP POP JUMP JUMPDEST CALLER PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND ISZERO ISZERO PUSH2 0x939 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP3 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 CALLER DUP1 DUP6 MSTORE SWAP3 MSTORE SWAP1 SWAP2 KECCAK256 SLOAD DUP4 SWAP2 SWAP1 PUSH1 0xFF AND ISZERO ISZERO PUSH2 0x965 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP5 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x3 ADD SLOAD DUP5 SWAP1 PUSH1 0xFF AND ISZERO PUSH2 0x986 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP6 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 CALLER DUP1 DUP6 MSTORE SWAP3 MSTORE DUP1 DUP4 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE MLOAD DUP8 SWAP3 PUSH32 0xF6A317157440607F36269043EB55F1287A5A19BA2216AFEAB88CD46CBCFB88E9 SWAP2 LOG3 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x0 SWAP3 DUP4 MSTORE PUSH1 0x40 DUP1 DUP5 KECCAK256 SWAP1 SWAP2 MSTORE SWAP1 DUP3 MSTORE SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 DUP2 KECCAK256 PUSH1 0x3 ADD SLOAD DUP3 SWAP1 PUSH1 0xFF AND ISZERO PUSH2 0xA49 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 PUSH2 0xA53 DUP2 PUSH2 0x1180 JUMP JUMPDEST ISZERO ISZERO PUSH2 0xAC0 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x16 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x54585F4E4F545F46554C4C595F434F4E4649524D454400000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x0 DUP5 DUP2 MSTORE PUSH1 0x20 DUP2 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 DUP1 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP5 MSTORE PUSH1 0x8 SWAP1 SWAP3 MSTORE SWAP1 SWAP2 KECCAK256 SLOAD DUP6 SWAP2 SWAP1 PUSH1 0xFF AND ISZERO ISZERO PUSH2 0xB65 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x18 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x554E524547495354455245445F41535345545F50524F58590000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0x72656D6F7665417574686F72697A6564416464726573734174496E6465782861 DUP2 MSTORE PUSH32 0x6464726573732C75696E74323536290000000000000000000000000000000000 PUSH1 0x20 DUP1 DUP4 ADD SWAP2 SWAP1 SWAP2 MSTORE DUP3 MLOAD SWAP2 DUP3 SWAP1 SUB PUSH1 0x2F ADD DUP3 KECCAK256 PUSH1 0x2 DUP1 DUP7 ADD DUP1 SLOAD PUSH1 0x1F PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH2 0x100 PUSH1 0x1 DUP5 AND ISZERO MUL ADD SWAP1 SWAP2 AND SWAP3 SWAP1 SWAP3 DIV SWAP2 DUP3 ADD DUP5 SWAP1 DIV DUP5 MUL DUP6 ADD DUP5 ADD SWAP1 SWAP6 MSTORE DUP1 DUP5 MSTORE PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 SWAP1 SWAP2 AND SWAP4 PUSH2 0xCA1 SWAP4 PUSH1 0x0 SWAP4 SWAP1 SWAP3 SWAP1 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0xC8E JUMPI DUP1 PUSH1 0x1F LT PUSH2 0xC63 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0xC8E JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0xC71 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP PUSH2 0x1DFD SWAP1 SWAP2 SWAP1 PUSH4 0xFFFFFFFF AND JUMP JUMPDEST PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 AND EQ PUSH2 0xD2F JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x19 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x494E56414C49445F46554E4354494F4E5F53454C4543544F5200000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x0 DUP7 DUP2 MSTORE PUSH1 0x20 DUP2 DUP2 MSTORE PUSH1 0x40 SWAP2 DUP3 SWAP1 KECCAK256 PUSH1 0x3 DUP2 ADD DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 SWAP1 DUP2 OR SWAP1 SWAP2 SSTORE DUP2 SLOAD DUP2 DUP4 ADD SLOAD PUSH1 0x2 DUP1 DUP6 ADD DUP1 SLOAD DUP9 MLOAD PUSH1 0x1F PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP8 DUP4 AND ISZERO PUSH2 0x100 MUL SWAP8 SWAP1 SWAP8 ADD SWAP1 SWAP2 AND SWAP3 SWAP1 SWAP3 DIV SWAP5 DUP6 ADD DUP8 SWAP1 DIV DUP8 MUL DUP3 ADD DUP8 ADD SWAP1 SWAP8 MSTORE DUP4 DUP2 MSTORE SWAP4 SWAP11 POP PUSH2 0xE47 SWAP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND SWAP5 SWAP1 SWAP4 SWAP2 SWAP1 DUP4 SWAP1 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0xE3D JUMPI DUP1 PUSH1 0x1F LT PUSH2 0xE12 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0xE3D JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0xE20 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP PUSH2 0x1EC5 JUMP JUMPDEST ISZERO PUSH2 0xE7C JUMPI PUSH1 0x40 MLOAD DUP7 SWAP1 PUSH32 0x33E13ECB54C3076D8E8BB8C2881800A4D972B792045FFAE98FDF46DF365FED75 SWAP1 PUSH1 0x0 SWAP1 LOG2 PUSH2 0xED2 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP7 SWAP1 PUSH32 0x526441BB6C1ABA3C9A4A6CA1D6545DA9C2333C8C48343EF398EB858D72B79236 SWAP1 PUSH1 0x0 SWAP1 LOG2 PUSH1 0x3 DUP6 ADD DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE JUMPDEST POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x6 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 JUMPDEST PUSH1 0x5 SLOAD DUP2 LT ISZERO PUSH2 0xF45 JUMPI DUP4 DUP1 ISZERO PUSH2 0xF0D JUMPI POP PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x3 ADD SLOAD PUSH1 0xFF AND ISZERO JUMPDEST DUP1 PUSH2 0xF31 JUMPI POP DUP3 DUP1 ISZERO PUSH2 0xF31 JUMPI POP PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x3 ADD SLOAD PUSH1 0xFF AND JUMPDEST ISZERO PUSH2 0xF3D JUMPI PUSH1 0x1 DUP3 ADD SWAP2 POP JUMPDEST PUSH1 0x1 ADD PUSH2 0xEE4 JUMP JUMPDEST POP SWAP3 SWAP2 POP POP JUMP JUMPDEST CALLER ADDRESS EQ PUSH2 0xF58 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND ISZERO ISZERO PUSH2 0xF7B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x8 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP2 DUP3 SWAP1 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND DUP7 ISZERO ISZERO SWAP1 DUP2 OR SWAP1 SWAP2 SSTORE DUP3 MLOAD SWAP4 DUP5 MSTORE SWAP1 DUP4 ADD MSTORE DUP1 MLOAD PUSH32 0xDAEF8FF7DC66C5E34EB9C338AAB679D9F427F89868D9228494455A4D982EB2B0 SWAP3 DUP2 SWAP1 SUB SWAP1 SWAP2 ADD SWAP1 LOG1 POP POP POP JUMP JUMPDEST CALLER ADDRESS EQ PUSH2 0x1017 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP2 SWAP1 PUSH1 0xFF AND ISZERO PUSH2 0x104C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND ISZERO ISZERO PUSH2 0x106F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x3 DUP1 SLOAD SWAP1 POP PUSH1 0x1 ADD PUSH1 0x4 SLOAD PUSH1 0x32 DUP3 GT ISZERO DUP1 ISZERO PUSH2 0x108C JUMPI POP DUP2 DUP2 GT ISZERO JUMPDEST DUP1 ISZERO PUSH2 0x1097 JUMPI POP DUP1 ISZERO ISZERO JUMPDEST DUP1 ISZERO PUSH2 0x10A2 JUMPI POP DUP2 ISZERO ISZERO JUMPDEST ISZERO ISZERO PUSH2 0x10AD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP6 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 SWAP1 DUP2 OR SWAP1 SWAP2 SSTORE PUSH1 0x3 DUP1 SLOAD SWAP2 DUP3 ADD DUP2 SSTORE DUP4 MSTORE PUSH32 0xC2575A0E9E593C00F959F8C92F12DB2869C3395A3B0502D05E2516446F71F85B ADD DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND DUP5 OR SWAP1 SSTORE MLOAD PUSH32 0xF39E6E1EB0EDCF53C221607B54B00CD28F3196FED0A24994DC308B8F611B682D SWAP2 SWAP1 LOG2 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP1 JUMPDEST PUSH1 0x3 SLOAD DUP2 LT ISZERO PUSH2 0x120A JUMPI PUSH1 0x0 DUP5 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 DUP2 KECCAK256 PUSH1 0x3 DUP1 SLOAD SWAP2 SWAP3 SWAP2 DUP5 SWAP1 DUP2 LT PUSH2 0x11AE JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 DUP1 DUP4 KECCAK256 SWAP1 SWAP2 ADD SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP4 MSTORE DUP3 ADD SWAP3 SWAP1 SWAP3 MSTORE PUSH1 0x40 ADD SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x11EF JUMPI PUSH1 0x1 DUP3 ADD SWAP2 POP JUMPDEST PUSH1 0x4 SLOAD DUP3 EQ ISZERO PUSH2 0x1202 JUMPI PUSH1 0x1 SWAP3 POP PUSH2 0x120A JUMP JUMPDEST PUSH1 0x1 ADD PUSH2 0x1185 JUMP JUMPDEST POP POP SWAP2 SWAP1 POP JUMP JUMPDEST CALLER ADDRESS EQ PUSH2 0x121D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x6 DUP2 SWAP1 SSTORE PUSH1 0x40 DUP1 MLOAD DUP3 DUP2 MSTORE SWAP1 MLOAD PUSH32 0xD1C9101A34FEFF75CCCEF14A28785A0279CB0B49C1F321F21F5F422E746B4377 SWAP2 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 LOG1 POP JUMP JUMPDEST PUSH1 0x8 PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 JUMPDEST PUSH1 0x3 SLOAD DUP2 LT ISZERO PUSH2 0x12E3 JUMPI PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 DUP2 KECCAK256 PUSH1 0x3 DUP1 SLOAD SWAP2 SWAP3 SWAP2 DUP5 SWAP1 DUP2 LT PUSH2 0x129A JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 DUP1 DUP4 KECCAK256 SWAP1 SWAP2 ADD SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP4 MSTORE DUP3 ADD SWAP3 SWAP1 SWAP3 MSTORE PUSH1 0x40 ADD SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x12DB JUMPI PUSH1 0x1 DUP3 ADD SWAP2 POP JUMPDEST PUSH1 0x1 ADD PUSH2 0x1271 JUMP JUMPDEST POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP2 DUP2 MSTORE SWAP2 DUP2 MSTORE PUSH1 0x40 SWAP1 DUP2 SWAP1 KECCAK256 DUP1 SLOAD PUSH1 0x1 DUP1 DUP4 ADD SLOAD PUSH1 0x2 DUP1 DUP6 ADD DUP1 SLOAD DUP8 MLOAD PUSH2 0x100 SWAP6 DUP3 AND ISZERO SWAP6 SWAP1 SWAP6 MUL PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD AND SWAP2 SWAP1 SWAP2 DIV PUSH1 0x1F DUP2 ADD DUP9 SWAP1 DIV DUP9 MUL DUP5 ADD DUP9 ADD SWAP1 SWAP7 MSTORE DUP6 DUP4 MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP4 AND SWAP6 SWAP1 SWAP5 SWAP2 SWAP3 SWAP2 SWAP1 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0x13BF JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x1394 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x13BF JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x13A2 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP PUSH1 0x3 SWAP1 SWAP4 ADD SLOAD SWAP2 SWAP3 POP POP PUSH1 0xFF AND DUP5 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x3 DUP1 SLOAD DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD DUP1 ISZERO PUSH2 0x1437 JUMPI PUSH1 0x20 MUL DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x1 SWAP1 SWAP2 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x140C JUMPI JUMPDEST POP POP POP POP POP SWAP1 POP JUMPDEST SWAP1 JUMP JUMPDEST PUSH1 0x60 DUP1 PUSH1 0x0 DUP1 PUSH1 0x5 SLOAD PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x1474 JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CODESIZE DUP4 CODECOPY ADD SWAP1 POP JUMPDEST POP SWAP3 POP PUSH1 0x0 SWAP2 POP PUSH1 0x0 SWAP1 POP JUMPDEST PUSH1 0x5 SLOAD DUP2 LT ISZERO PUSH2 0x14FB JUMPI DUP6 DUP1 ISZERO PUSH2 0x14A9 JUMPI POP PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x3 ADD SLOAD PUSH1 0xFF AND ISZERO JUMPDEST DUP1 PUSH2 0x14CD JUMPI POP DUP5 DUP1 ISZERO PUSH2 0x14CD JUMPI POP PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x3 ADD SLOAD PUSH1 0xFF AND JUMPDEST ISZERO PUSH2 0x14F3 JUMPI DUP1 DUP4 DUP4 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x14E1 JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD MSTORE PUSH1 0x1 SWAP2 SWAP1 SWAP2 ADD SWAP1 JUMPDEST PUSH1 0x1 ADD PUSH2 0x1480 JUMP JUMPDEST DUP8 DUP8 SUB PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x1527 JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CODESIZE DUP4 CODECOPY ADD SWAP1 POP JUMPDEST POP SWAP4 POP DUP8 SWAP1 POP JUMPDEST DUP7 DUP2 LT ISZERO PUSH2 0x1570 JUMPI DUP3 DUP2 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1544 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP5 DUP10 DUP4 SUB DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x155E JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD MSTORE PUSH1 0x1 ADD PUSH2 0x152E JUMP JUMPDEST POP POP POP SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x60 DUP1 PUSH1 0x0 DUP1 PUSH1 0x3 DUP1 SLOAD SWAP1 POP PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x15B0 JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CODESIZE DUP4 CODECOPY ADD SWAP1 POP JUMPDEST POP SWAP3 POP PUSH1 0x0 SWAP2 POP PUSH1 0x0 SWAP1 POP JUMPDEST PUSH1 0x3 SLOAD DUP2 LT ISZERO PUSH2 0x1694 JUMPI PUSH1 0x0 DUP6 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 DUP2 KECCAK256 PUSH1 0x3 DUP1 SLOAD SWAP2 SWAP3 SWAP2 DUP5 SWAP1 DUP2 LT PUSH2 0x15E5 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 DUP1 DUP4 KECCAK256 SWAP1 SWAP2 ADD SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP4 MSTORE DUP3 ADD SWAP3 SWAP1 SWAP3 MSTORE PUSH1 0x40 ADD SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x168C JUMPI PUSH1 0x3 DUP1 SLOAD DUP3 SWAP1 DUP2 LT PUSH2 0x162D JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD DUP4 MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP2 AND SWAP1 DUP5 SWAP1 DUP5 SWAP1 DUP2 LT PUSH2 0x1660 JUMPI INVALID JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND PUSH1 0x20 SWAP3 DUP4 MUL SWAP1 SWAP2 ADD SWAP1 SWAP2 ADD MSTORE PUSH1 0x1 SWAP2 SWAP1 SWAP2 ADD SWAP1 JUMPDEST PUSH1 0x1 ADD PUSH2 0x15BC JUMP JUMPDEST DUP2 PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x16BE JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CODESIZE DUP4 CODECOPY ADD SWAP1 POP JUMPDEST POP SWAP4 POP PUSH1 0x0 SWAP1 POP JUMPDEST DUP2 DUP2 LT ISZERO PUSH2 0x1720 JUMPI DUP3 DUP2 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x16DC JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP5 DUP3 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x16F4 JUMPI INVALID JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND PUSH1 0x20 SWAP3 DUP4 MUL SWAP1 SWAP2 ADD SWAP1 SWAP2 ADD MSTORE PUSH1 0x1 ADD PUSH2 0x16C6 JUMP JUMPDEST POP POP POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x5 SLOAD DUP2 JUMP JUMPDEST CALLER ADDRESS EQ PUSH2 0x173A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x3 SLOAD DUP2 PUSH1 0x32 DUP3 GT DUP1 ISZERO SWAP1 PUSH2 0x174F JUMPI POP DUP2 DUP2 GT ISZERO JUMPDEST DUP1 ISZERO PUSH2 0x175A JUMPI POP DUP1 ISZERO ISZERO JUMPDEST DUP1 ISZERO PUSH2 0x1765 JUMPI POP DUP2 ISZERO ISZERO JUMPDEST ISZERO ISZERO PUSH2 0x1770 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x4 DUP4 SWAP1 SSTORE PUSH1 0x40 DUP1 MLOAD DUP5 DUP2 MSTORE SWAP1 MLOAD PUSH32 0xA3F1EE9126A074D9326C682F561767F710E927FAA811F7A99829D49DC421797A SWAP2 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 LOG1 POP POP POP JUMP JUMPDEST CALLER PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND ISZERO ISZERO PUSH2 0x17CB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP3 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP3 SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND ISZERO ISZERO PUSH2 0x17FD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 CALLER DUP1 DUP6 MSTORE SWAP3 MSTORE SWAP1 SWAP2 KECCAK256 SLOAD DUP5 SWAP2 SWAP1 PUSH1 0xFF AND ISZERO PUSH2 0x1828 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP5 PUSH2 0x1832 DUP2 PUSH2 0x1180 JUMP JUMPDEST ISZERO PUSH2 0x189E JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x12 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x54585F46554C4C595F434F4E4649524D45440000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x0 DUP7 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 DUP2 DUP2 MSTORE PUSH1 0x40 DUP1 DUP5 KECCAK256 CALLER DUP1 DUP7 MSTORE SWAP3 MSTORE DUP1 DUP5 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SWAP4 OR SWAP1 SWAP3 SSTORE SWAP1 MLOAD DUP9 SWAP3 PUSH32 0x4A504A94899432A9846E1AA406DCEB1BCFD538BB839071D49D1E5E23F5BE30EF SWAP2 LOG3 PUSH2 0x1912 DUP7 PUSH2 0x1180 JUMP JUMPDEST ISZERO PUSH2 0xED2 JUMPI PUSH2 0xED2 DUP7 TIMESTAMP PUSH2 0x1EE8 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x192E DUP5 DUP5 DUP5 PUSH2 0x1F33 JUMP JUMPDEST SWAP1 POP PUSH2 0x1939 DUP2 PUSH2 0x17AD JUMP JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x7 PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x32 DUP2 JUMP JUMPDEST PUSH1 0x4 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 CALLER ADDRESS EQ PUSH2 0x196B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP4 SWAP1 PUSH1 0xFF AND ISZERO ISZERO PUSH2 0x19A1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP4 SWAP1 PUSH1 0xFF AND ISZERO PUSH2 0x19D6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 SWAP3 POP JUMPDEST PUSH1 0x3 SLOAD DUP4 LT ISZERO PUSH2 0x1A9B JUMPI DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x3 DUP5 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1A0B JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0x1A90 JUMPI DUP4 PUSH1 0x3 DUP5 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1A43 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH2 0x1A9B JUMP JUMPDEST PUSH1 0x1 SWAP1 SWAP3 ADD SWAP2 PUSH2 0x19DB JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP7 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 SWAP1 DUP2 AND SWAP1 SWAP2 SSTORE SWAP4 DUP9 AND DUP3 MSTORE DUP1 DUP3 KECCAK256 DUP1 SLOAD SWAP1 SWAP5 AND PUSH1 0x1 OR SWAP1 SWAP4 SSTORE SWAP2 MLOAD SWAP1 SWAP2 PUSH32 0x8001553A916EF2F495D26A907CC54D96ED840D7BDA71E73194BF5A9DF7A76B90 SWAP2 LOG2 PUSH1 0x40 MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP6 AND SWAP1 PUSH32 0xF39E6E1EB0EDCF53C221607B54B00CD28F3196FED0A24994DC308B8F611B682D SWAP1 PUSH1 0x0 SWAP1 LOG2 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 DUP2 KECCAK256 PUSH1 0x3 ADD SLOAD DUP3 SWAP1 PUSH1 0xFF AND ISZERO PUSH2 0x1B8E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 PUSH2 0x1B98 DUP2 PUSH2 0x1180 JUMP JUMPDEST ISZERO ISZERO PUSH2 0x1C05 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x16 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x54585F4E4F545F46554C4C595F434F4E4649524D454400000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x6 SLOAD PUSH1 0x0 DUP6 DUP2 MSTORE PUSH1 0x7 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP6 SWAP2 ADD TIMESTAMP LT ISZERO PUSH2 0x1C88 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x14 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x54494D455F4C4F434B5F494E434F4D504C455445000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x0 DUP6 DUP2 MSTORE PUSH1 0x20 DUP2 DUP2 MSTORE PUSH1 0x40 SWAP2 DUP3 SWAP1 KECCAK256 PUSH1 0x3 DUP2 ADD DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 SWAP1 DUP2 OR SWAP1 SWAP2 SSTORE DUP2 SLOAD DUP2 DUP4 ADD SLOAD PUSH1 0x2 DUP1 DUP6 ADD DUP1 SLOAD DUP9 MLOAD PUSH1 0x1F PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP8 DUP4 AND ISZERO PUSH2 0x100 MUL SWAP8 SWAP1 SWAP8 ADD SWAP1 SWAP2 AND SWAP3 SWAP1 SWAP3 DIV SWAP5 DUP6 ADD DUP8 SWAP1 DIV DUP8 MUL DUP3 ADD DUP8 ADD SWAP1 SWAP8 MSTORE DUP4 DUP2 MSTORE SWAP4 SWAP10 POP PUSH2 0x1D6B SWAP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND SWAP5 SWAP1 SWAP4 SWAP2 SWAP1 DUP4 SWAP1 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0xE3D JUMPI DUP1 PUSH1 0x1F LT PUSH2 0xE12 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0xE3D JUMP JUMPDEST ISZERO PUSH2 0x1DA0 JUMPI PUSH1 0x40 MLOAD DUP6 SWAP1 PUSH32 0x33E13ECB54C3076D8E8BB8C2881800A4D972B792045FFAE98FDF46DF365FED75 SWAP1 PUSH1 0x0 SWAP1 LOG2 PUSH2 0x1DF6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP6 SWAP1 PUSH32 0x526441BB6C1ABA3C9A4A6CA1D6545DA9C2333C8C48343EF398EB858D72B79236 SWAP1 PUSH1 0x0 SWAP1 LOG2 PUSH1 0x3 DUP5 ADD DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE JUMPDEST POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x4 ADD DUP4 MLOAD LT ISZERO ISZERO ISZERO PUSH2 0x1E9A JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x25 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x475245415445525F4F525F455155414C5F544F5F345F4C454E4754485F524551 PUSH1 0x44 DUP3 ADD MSTORE PUSH32 0x5549524544000000000000000000000000000000000000000000000000000000 PUSH1 0x64 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x84 ADD SWAP1 REVERT JUMPDEST POP ADD PUSH1 0x20 ADD MLOAD PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 AND SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 MLOAD PUSH1 0x20 DUP5 ADD PUSH1 0x0 DUP3 DUP8 DUP4 DUP11 DUP13 PUSH2 0x8796 GAS SUB CALL SWAP9 SWAP8 POP POP POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP2 MSTORE PUSH1 0x7 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP2 DUP3 SWAP1 KECCAK256 DUP4 SWAP1 SSTORE DUP2 MLOAD DUP4 DUP2 MSTORE SWAP2 MLOAD DUP5 SWAP3 PUSH32 0xB237AFE65F1514FD7EA3F923EA4FE792BDD07000A912B6CD1602A8E7F573C8D SWAP3 SWAP1 DUP3 SWAP1 SUB ADD SWAP1 LOG2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND ISZERO ISZERO PUSH2 0x1F58 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x5 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x80 DUP2 ADD DUP3 MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP9 DUP2 AND DUP3 MSTORE PUSH1 0x20 DUP1 DUP4 ADD DUP10 DUP2 MSTORE DUP4 DUP6 ADD DUP10 DUP2 MSTORE PUSH1 0x0 PUSH1 0x60 DUP7 ADD DUP2 SWAP1 MSTORE DUP8 DUP2 MSTORE DUP1 DUP5 MSTORE SWAP6 SWAP1 SWAP6 KECCAK256 DUP5 MLOAD DUP2 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND SWAP5 AND SWAP4 SWAP1 SWAP4 OR DUP4 SSTORE MLOAD PUSH1 0x1 DUP4 ADD SSTORE SWAP3 MLOAD DUP1 MLOAD SWAP5 SWAP7 POP SWAP2 SWAP4 SWAP1 SWAP3 PUSH2 0x1FF0 SWAP3 PUSH1 0x2 DUP6 ADD SWAP3 SWAP2 ADD SWAP1 PUSH2 0x208F JUMP JUMPDEST POP PUSH1 0x60 SWAP2 SWAP1 SWAP2 ADD MLOAD PUSH1 0x3 SWAP1 SWAP2 ADD DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP2 ISZERO ISZERO SWAP2 SWAP1 SWAP2 OR SWAP1 SSTORE PUSH1 0x5 DUP1 SLOAD PUSH1 0x1 ADD SWAP1 SSTORE PUSH1 0x40 MLOAD DUP3 SWAP1 PUSH32 0xC0BA8FE4B176C1714197D43B9CC6BCF797A4A7461C5FE8D0EF6E184AE7601E51 SWAP1 PUSH1 0x0 SWAP1 LOG2 POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST DUP2 SLOAD DUP2 DUP4 SSTORE DUP2 DUP2 GT ISZERO PUSH2 0x208A JUMPI PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x20 SWAP1 KECCAK256 PUSH2 0x208A SWAP2 DUP2 ADD SWAP1 DUP4 ADD PUSH2 0x210D JUMP JUMPDEST POP POP POP JUMP JUMPDEST DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 PUSH1 0x1F ADD PUSH1 0x20 SWAP1 DIV DUP2 ADD SWAP3 DUP3 PUSH1 0x1F LT PUSH2 0x20D0 JUMPI DUP1 MLOAD PUSH1 0xFF NOT AND DUP4 DUP1 ADD OR DUP6 SSTORE PUSH2 0x20FD JUMP JUMPDEST DUP3 DUP1 ADD PUSH1 0x1 ADD DUP6 SSTORE DUP3 ISZERO PUSH2 0x20FD JUMPI SWAP2 DUP3 ADD JUMPDEST DUP3 DUP2 GT ISZERO PUSH2 0x20FD JUMPI DUP3 MLOAD DUP3 SSTORE SWAP2 PUSH1 0x20 ADD SWAP2 SWAP1 PUSH1 0x1 ADD SWAP1 PUSH2 0x20E2 JUMP JUMPDEST POP PUSH2 0x2109 SWAP3 SWAP2 POP PUSH2 0x210D JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST PUSH2 0x143F SWAP2 SWAP1 JUMPDEST DUP1 DUP3 GT ISZERO PUSH2 0x2109 JUMPI PUSH1 0x0 DUP2 SSTORE PUSH1 0x1 ADD PUSH2 0x2113 JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 MSTORE DUP14 0xb3 EXTCODESIZE CALLVALUE 0xdd RETURNDATASIZE DUP8 0xf9 0x27 PUSH6 0xDA5FAC3E1E5D SHL SWAP3 CODECOPY CALLDATALOAD 0x3f PUSH5 0x5405CA9BF 0xc9 0xce 0xe8 0xdb STOP 0x29 ",
- "sourceMap": "707:3438:20:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2540:1:12;2528:9;:13;2524:61;;;2555:30;;;2575:9;2555:30;;;;2563:10;;2555:30;;;;;;;;;;2524:61;707:3438:20;1050:23:12;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1050:23:12;;;;;;;;;;;;;;;;;;;;;;;;3715:460;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;3715:460:12;;;;;;;6281:291;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;6281:291:12;;;;;1004:40;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1004:40:12;;;;;;;;;;;;;;;;;;;;;;;;;934:64;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;934:64:12;;;;;;;;;3583:560:20;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;3583:560:20;;;;;1057:32:13;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1057:32:13;;;;;;;;;;;;;;;;;;;;10535:319:12;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;10535:319:12;;;;;;;;;;;3153:294:20;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;3153:294:20;;;;;;;;;;;3315:277:12;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;3315:277:12;;;;;;;8703:337;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;8703:337:12;;;;;2494:194:13;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2494:194:13;;;;;1055:55:20;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1055:55:20;;;;;;;10021:252:12;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;10021:252:12;;;;;879:49;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;879:49:12;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;879:49:12;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10938:115;;8:9:-1;5:2;;;30:1;27;20:12;5:2;10938:115:12;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:100:-1;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;10938:115:12;;;;;;;;;;;;;;;;;12156:676;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;12156:676:12;;;;;;;;;;;;;;;11232:575;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;11232:575:12;;;;;1105:28;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1105:28:12;;;;4997:207;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;4997:207:12;;;;;2794:467:13;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2794:467:13;;;;;5463:244:12;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;5463:244:12;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;5463:244:12;;-1:-1:-1;5463:244:12;;-1:-1:-1;;;;;;;5463:244:12;1096:53:13;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1096:53:13;;;;;800:41:12;;8:9:-1;5:2;;;30:1;27;20:12;5:2;800:41:12;;;;1079:20;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1079:20:12;;;;4377:449;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;4377:449:12;;;;;;;;;;;;3375:516:13;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;3375:516:13;;;;;1050:23:12;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1050:23:12;:::o;3715:460::-;3863:6;1337:10;1359:4;1337:27;1329:36;;;;;;1543:14;;;;;;;:7;:14;;;;;;3805:5;;1543:14;;1535:23;;;;;;;;3826:14;;;3843:5;3826:14;;;:7;:14;;;;;:22;;;;;;3843:5;-1:-1:-1;3858:170:12;3875:6;:13;:17;;3873:19;;3858:170;;;3928:5;3915:18;;:6;3922:1;3915:9;;;;;;;;;;;;;;;;;;;;;;:18;3911:117;;;3965:6;3972:13;;:17;;;;3965:25;;;;;;;;;;;;;;;;3953:6;:9;;3965:25;;;;;3960:1;;3953:9;;;;;;;;;;;;;;:37;;;;;;;;;;;;;;;;;;4008:5;;3911:117;3894:3;;;;;3858:170;;;4037:6;:18;;;;;;;;;:::i;:::-;-1:-1:-1;4080:6:12;:13;4069:8;;:24;4065:74;;;4125:6;:13;4107:32;;:17;:32::i;:::-;4149:19;;;;;;;;;;;1375:1;3715:460;;:::o;6281:291::-;6364:10;1543:14;;;;:7;:14;;;;;;;;1535:23;;;;;;;;1788:28;;;;:13;:28;;;;;;;;6409:10;1788:35;;;;;;;;;6394:13;;6409:10;1788:35;;1780:44;;;;;;;;2044:12;:27;;;;;;;;;;:36;;;6441:13;;2044:36;;2043:37;2035:46;;;;;;6513:5;6470:28;;;:13;:28;;;;;;;;6499:10;6470:40;;;;;;;;:48;;;;;;6528:37;6484:13;;6528:37;;;1834:1;1568;;6281:291;;:::o;1004:40::-;;;;;;;;;;;;;;;:::o;934:64::-;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;3583:560:20:-;3816:23;2044:27:12;;;;;;;;;;:36;;;3688:13:20;;2044:36:12;;2043:37;2035:46;;;;;;3726:13:20;1410:26:13;1422:13;1410:11;:26::i;:::-;1389:95;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1492:23:20;1518:27;;;;;;;;;;;1599:15;;;;1576:39;;:22;:39;;;;;;;3787:13;;1518:27;1576:39;;1555:110;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1195:60;;;;;;;;;;;;;;;;;;;;;;;;;1696:8;;;;:19;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:69;;;;;:22;;-1:-1:-1;;1195:60:20;;1696:19;;;:8;:19;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:22;;;;:::i;:::-;:69;;;1675:141;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3842:12;:27;;;;;;;;;;;;3879:12;;;:19;;;;3894:4;3879:19;;;;;;3926:15;;3943:9;;;;3954:8;;;;:15;;3912:68;;;3954:15;;;;;3879:19;3954:15;;;;;;;;;;;;3912:68;;;;;;;;;;;;;;;;;;3842:27;;-1:-1:-1;3912:68:20;;3926:15;;;;;3943:9;;3912:68;3954:8;:15;;3912:68;;3954:8;:15;3912:68;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:13;:68::i;:::-;3908:229;;;4001:24;;4011:13;;4001:24;;;;;3908:229;;;4061:31;;4078:13;;4061:31;;;;;4106:12;;;:20;;;;;;3908:229;1494:1:13;;2091::12;3583:560:20;;;:::o;1057:32:13:-;;;;:::o;10535:319:12:-;10642:10;;10668:179;10685:16;;10683:1;:18;10668:179;;;10727:7;:36;;;;-1:-1:-1;10739:12:12;:15;;;;;;;;;;:24;;;;;10738:25;10727:36;:92;;;;10783:8;:36;;;;-1:-1:-1;10795:12:12;:15;;;;;;;;;;:24;;;;;10783:36;10720:127;;;10846:1;10837:10;;;;10720:127;10703:3;;10668:179;;;10535:319;;;;;:::o;3153:294:20:-;1337:10:12;1359:4;1337:27;1329:36;;;;;;3278:18:20;2158:13:12;;;;;2150:22;;;;;;3312:42:20;;;;;;;:22;:42;;;;;;;;;:57;;;;;;;;;;;;;3384:56;;;;;;;;;;;;;;;;;;;;;1375:1:12;3153:294:20;;:::o;3315:277:12:-;1337:10;1359:4;1337:27;1329:36;;;;;;1450:14;;;;;;;:7;:14;;;;;;3408:5;;1450:14;;1449:15;1441:24;;;;;;3431:5;2158:13;;;;;2150:22;;;;;;3463:6;:13;;;;3479:1;3463:17;3482:8;;839:2;2273:10;:29;;:68;;;;;2331:10;2318:9;:23;;2273:68;:98;;;;-1:-1:-1;2357:14:12;;;2273:98;:129;;;;-1:-1:-1;2387:15:12;;;2273:129;2265:138;;;;;;;;3506:14;;;;;;;:7;:14;;;;;;:21;;;;3523:4;3506:21;;;;;;3537:6;27:10:-1;;23:18;;;45:23;;3537:18:12;;;;;;;;;;;;3565:20;;;3506:14;3565:20;2182:1;;1475;1375;3315:277;:::o;8703:337::-;8793:4;;;8837:197;8854:6;:13;8852:15;;8837:197;;;8892:28;;;;:13;:28;;;;;8921:6;:9;;8892:28;;;8928:1;;8921:9;;;;;;;;;;;;;;;;;;;;8892:39;;;;;;;;;;;;;;;8888:71;;;8958:1;8949:10;;;;8888:71;8986:8;;8977:5;:17;8973:50;;;9019:4;9012:11;;;;8973:50;8869:3;;8837:197;;;8703:337;;;;;:::o;2494:194:13:-;1337:10:12;1359:4;1337:27;1329:36;;;;;;2594:17:13;:38;;;2647:34;;;;;;;;;;;;;;;;;2494:194;:::o;1055:55:20:-;;;;;;;;;;;;;;;:::o;10021:252:12:-;10120:10;;10146:120;10163:6;:13;10161:15;;10146:120;;;10199:28;;;;:13;:28;;;;;10228:6;:9;;10199:28;;;10235:1;;10228:9;;;;;;;;;;;;;;;;;;;;10199:39;;;;;;;;;;;;;;;10195:71;;;10265:1;10256:10;;;;10195:71;10178:3;;10146:120;;;10021:252;;;;:::o;879:49::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;879:49:12;;;;;;;-1:-1:-1;;879:49:12;;;:::o;10938:115::-;11008:9;11040:6;11033:13;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10938:115;;:::o;12156:676::-;12281:22;12319:32;12392:10;12416:6;12365:16;;12354:28;;;;;;;;;;;;;;;;;;;;;;29:2:-1;21:6;17:15;117:4;105:10;97:6;88:34;136:17;;-1:-1;12354:28:12;;12319:63;;12405:1;12392:14;;12439:1;12437:3;;12432:250;12444:16;;12442:1;:18;12432:250;;;12486:7;:36;;;;-1:-1:-1;12498:12:12;:15;;;;;;;;;;:24;;;;;12497:25;12486:36;:92;;;;12542:8;:36;;;;-1:-1:-1;12554:12:12;:15;;;;;;;;;;:24;;;;;12542:36;12479:203;;;12638:1;12610:18;12629:5;12610:25;;;;;;;;;;;;;;;;;;:29;12666:1;12657:10;;;;;12479:203;12462:3;;12432:250;;;12725:4;12720:2;:9;12709:21;;;;;;;;;;;;;;;;;;;;;;29:2:-1;21:6;17:15;117:4;105:10;97:6;88:34;136:17;;-1:-1;12709:21:12;;12691:39;;12747:4;12745:6;;12740:85;12755:2;12753:1;:4;12740:85;;;12804:18;12823:1;12804:21;;;;;;;;;;;;;;;;;;12776:15;12796:4;12792:1;:8;12776:25;;;;;;;;;;;;;;;;;;:49;12759:3;;12740:85;;;12156:676;;;;;;;;;:::o;11232:575::-;11327:24;11367:34;11442:10;11466:6;11418;:13;;;;11404:28;;;;;;;;;;;;;;;;;;;;;;29:2:-1;21:6;17:15;117:4;105:10;97:6;88:34;136:17;;-1:-1;11404:28:12;;11367:65;;11455:1;11442:14;;11489:1;11487:3;;11482:186;11494:6;:13;11492:15;;11482:186;;;11530:28;;;;:13;:28;;;;;11559:6;:9;;11530:28;;;11566:1;;11559:9;;;;;;;;;;;;;;;;;;;;11530:39;;;;;;;;;;;;;;;11526:142;;;11616:6;:9;;11623:1;;11616:9;;;;;;;;;;;;;;;;11589:24;;11616:9;;;;;11589:17;;11607:5;;11589:24;;;;;;:36;;;;:24;;;;;;;;;;:36;11652:1;11643:10;;;;;11526:142;11509:3;;11482:186;;;11708:5;11694:20;;;;;;;;;;;;;;;;;;;;;;29:2:-1;21:6;17:15;117:4;105:10;97:6;88:34;136:17;;-1:-1;11694:20:12;;11677:37;;11731:1;11729:3;;11724:76;11736:5;11734:1;:7;11724:76;;;11780:17;11798:1;11780:20;;;;;;;;;;;;;;;;;;11760:14;11775:1;11760:17;;;;;;;;;;:40;;;;:17;;;;;;;;;;:40;11743:3;;11724:76;;;11232:575;;;;;;:::o;1105:28::-;;;;:::o;4997:207::-;1337:10;1359:4;1337:27;1329:36;;;;;;5099:6;:13;5114:9;839:2;2273:29;;;;;:68;;;2331:10;2318:9;:23;;2273:68;:98;;;;-1:-1:-1;2357:14:12;;;2273:98;:129;;;;-1:-1:-1;2387:15:12;;;2273:129;2265:138;;;;;;;;5139:8;:20;;;5169:28;;;;;;;;;;;;;;;;;1375:1;;4997:207;:::o;2794:467:13:-;2880:10;1543:14:12;;;;:7;:14;;;;;;;;1535:23;;;;;;;;1647:12;:27;;;;;;;;;;:39;2918:13:13;;1647:39:12;;:44;;1639:53;;;;;;1924:28;;;;:13;:28;;;;;;;;2969:10:13;1924:35:12;;;;;;;;;2954:13:13;;2969:10;1924:35:12;;1923:36;1915:45;;;;;;3007:13:13;1238:26;1250:13;1238:11;:26::i;:::-;1237:27;1216:92;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3036:28;;;;3079:4;3036:28;;;;;;;;3065:10;3036:40;;;;;;;;:47;;;;;;;;;;3098:39;;3050:13;;3098:39;;;3151:26;3163:13;3151:11;:26::i;:::-;3147:108;;;3193:51;3213:13;3228:15;3193:19;:51::i;5463:244:12:-;5567:18;5617:40;5632:11;5645:5;5652:4;5617:14;:40::i;:::-;5601:56;;5667:33;5686:13;5667:18;:33::i;:::-;5463:244;;;;;:::o;1096:53:13:-;;;;;;;;;;;;;:::o;800:41:12:-;839:2;800:41;:::o;1079:20::-;;;;:::o;4377:449::-;4548:6;1337:10;1359:4;1337:27;1329:36;;;;;;1543:14;;;;;;;:7;:14;;;;;;4486:5;;1543:14;;1535:23;;;;;;;;1450:14;;;;;;;:7;:14;;;;;;4519:8;;1450:14;;1449:15;1441:24;;;;;;4555:1;4548:8;;4543:149;4560:6;:13;4558:15;;4543:149;;;4609:5;4596:18;;:6;4603:1;4596:9;;;;;;;;;;;;;;;;;;;;;;:18;4592:100;;;4646:8;4634:6;4641:1;4634:9;;;;;;;;;;;;;;;;;;:20;;;;;;;;;;;;;;;;;;4672:5;;4592:100;4575:3;;;;;4543:149;;;4701:14;;;;4718:5;4701:14;;;:7;:14;;;;;;:22;;;;;;;;;4733:17;;;;;;;;:24;;;;;4701:22;4733:24;;;;4767:19;;4701:14;;4767:19;;;4796:23;;;;;;;;;;;1568:1;1375;4377:449;;;:::o;3375:516:13:-;3564:23;2044:27:12;;;;;;;;;;:36;;;3461:13:13;;2044:36:12;;2043:37;2035:46;;;;;;3499:13:13;1410:26;1422:13;1410:11;:26::i;:::-;1389:95;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1638:17;;1603:32;;;;:17;:32;;;;;;3535:13;;1603:52;1584:15;:71;;1563:138;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3590:12;:27;;;;;;;;;;;;3627:12;;;:19;;;;3642:4;3627:19;;;;;;3674:15;;3691:9;;;;3702:8;;;;:15;;3660:68;;;3702:15;;;;;3627:19;3702:15;;;;;;;;;;;;3660:68;;;;;;;;;;;;;;;;;;3590:27;;-1:-1:-1;3660:68:13;;3674:15;;;;;3691:9;;3660:68;3702:8;:15;;3660:68;;3702:8;:15;3660:68;;;;;;;;;;;;;;;;;;;;;;;;3656:229;;;3749:24;;3759:13;;3749:24;;;;;3656:229;;;3809:31;;3826:13;;3809:31;;;;;3854:12;;;:20;;;;;;3656:229;1494:1;2091::12;3375:516:13;;;:::o;15593:687:53:-;15713:13;15775:5;15783:1;15775:9;15763:1;:8;:21;;15742:105;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;16021:13:53;15924:2;16021:13;16015:20;16174:66;16162:79;;15593:687::o;7449:1103:12:-;7552:4;7568:11;7627:4;7621:11;7760:2;7754:4;7750:13;8425:1;8406;8298:10;8279:1;8256:5;8227:11;7882:5;7877:3;7873:15;7851:662;7841:672;7449:1103;-1:-1:-1;;;;;;;;7449:1103:12:o;3959:234:13:-;4068:32;;;;:17;:32;;;;;;;;;:51;;;4134:52;;;;;;;4086:13;;4134:52;;;;;;;;;3959:234;;:::o;9373:451:12:-;9505:18;9475:11;2158:13;;;;;2150:22;;;;;;9555:16;;9611:140;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;9611:140:12;;;;;;9581:27;;;;;;;;;;:170;;;;;;;;;;;;;;;-1:-1:-1;9581:170:12;;;;;;;9555:16;;-1:-1:-1;9611:140:12;;9581:27;;:170;;;;;;;;;;:::i;:::-;-1:-1:-1;9581:170:12;;;;;;;;;;;;;;;;;;;;;;;9761:16;:21;;-1:-1:-1;9761:21:12;;;9792:25;;9803:13;;9792:25;;-1:-1:-1;;9792:25:12;9373:451;;;;;;:::o;707:3438:20:-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;707:3438:20;;;-1:-1:-1;707:3438:20;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;"
- }
- }
- },
- "sources": {
- "2.0.0/extensions/Forwarder/Forwarder.sol": {
- "id": 0
- },
- "2.0.0/extensions/Forwarder/MixinAssets.sol": {
- "id": 1
- },
- "2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol": {
- "id": 2
- },
- "2.0.0/extensions/Forwarder/MixinForwarderCore.sol": {
- "id": 3
- },
- "2.0.0/extensions/Forwarder/MixinWeth.sol": {
- "id": 4
- },
- "2.0.0/extensions/Forwarder/interfaces/IAssets.sol": {
- "id": 5
- },
- "2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol": {
- "id": 6
- },
- "2.0.0/extensions/Forwarder/libs/LibConstants.sol": {
- "id": 7
- },
- "2.0.0/extensions/Forwarder/mixins/MAssets.sol": {
- "id": 8
- },
- "2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol": {
- "id": 9
- },
- "2.0.0/extensions/Forwarder/mixins/MWeth.sol": {
- "id": 10
- },
- "2.0.0/extensions/OrderValidator/OrderValidator.sol": {
- "id": 11
- },
- "2.0.0/multisig/MultiSigWallet.sol": {
- "id": 12
- },
- "2.0.0/multisig/MultiSigWalletWithTimeLock.sol": {
- "id": 13
- },
- "2.0.0/protocol/AssetProxy/ERC20Proxy.sol": {
- "id": 14
- },
- "2.0.0/protocol/AssetProxy/ERC721Proxy.sol": {
- "id": 15
- },
- "2.0.0/protocol/AssetProxy/MixinAuthorizable.sol": {
- "id": 16
- },
- "2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol": {
- "id": 17
- },
- "2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol": {
- "id": 18
- },
- "2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol": {
- "id": 19
- },
- "2.0.0/protocol/AssetProxyOwner/AssetProxyOwner.sol": {
- "id": 20
- },
- "2.0.0/protocol/Exchange/Exchange.sol": {
- "id": 21
- },
- "2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol": {
- "id": 22
- },
- "2.0.0/protocol/Exchange/MixinExchangeCore.sol": {
- "id": 23
- },
- "2.0.0/protocol/Exchange/MixinMatchOrders.sol": {
- "id": 24
- },
- "2.0.0/protocol/Exchange/MixinSignatureValidator.sol": {
- "id": 25
- },
- "2.0.0/protocol/Exchange/MixinTransactions.sol": {
- "id": 26
- },
- "2.0.0/protocol/Exchange/MixinWrapperFunctions.sol": {
- "id": 27
- },
- "2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol": {
- "id": 28
- },
- "2.0.0/protocol/Exchange/interfaces/IExchange.sol": {
- "id": 29
- },
- "2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol": {
- "id": 30
- },
- "2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol": {
- "id": 31
- },
- "2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol": {
- "id": 32
- },
- "2.0.0/protocol/Exchange/interfaces/ITransactions.sol": {
- "id": 33
- },
- "2.0.0/protocol/Exchange/interfaces/IValidator.sol": {
- "id": 34
- },
- "2.0.0/protocol/Exchange/interfaces/IWallet.sol": {
- "id": 35
- },
- "2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol": {
- "id": 36
- },
- "2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol": {
- "id": 37
- },
- "2.0.0/protocol/Exchange/libs/LibConstants.sol": {
- "id": 38
- },
- "2.0.0/protocol/Exchange/libs/LibEIP712.sol": {
- "id": 39
- },
- "2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol": {
- "id": 40
- },
- "2.0.0/protocol/Exchange/libs/LibFillResults.sol": {
- "id": 41
- },
- "2.0.0/protocol/Exchange/libs/LibMath.sol": {
- "id": 42
- },
- "2.0.0/protocol/Exchange/libs/LibOrder.sol": {
- "id": 43
- },
- "2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol": {
- "id": 44
- },
- "2.0.0/protocol/Exchange/mixins/MExchangeCore.sol": {
- "id": 45
- },
- "2.0.0/protocol/Exchange/mixins/MMatchOrders.sol": {
- "id": 46
- },
- "2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol": {
- "id": 47
- },
- "2.0.0/protocol/Exchange/mixins/MTransactions.sol": {
- "id": 48
- },
- "2.0.0/protocol/Exchange/mixins/MWrapperFunctions.sol": {
- "id": 49
- },
- "2.0.0/tokens/ERC20Token/IERC20Token.sol": {
- "id": 50
- },
- "2.0.0/tokens/ERC721Token/IERC721Token.sol": {
- "id": 51
- },
- "2.0.0/tokens/EtherToken/IEtherToken.sol": {
- "id": 52
- },
- "2.0.0/utils/LibBytes/LibBytes.sol": {
- "id": 53
- },
- "2.0.0/utils/Ownable/IOwnable.sol": {
- "id": 54
- },
- "2.0.0/utils/Ownable/Ownable.sol": {
- "id": 55
- },
- "2.0.0/utils/ReentrancyGuard/ReentrancyGuard.sol": {
- "id": 56
- },
- "2.0.0/utils/SafeMath/SafeMath.sol": {
- "id": 57
- }
- },
- "sourceCodes": {
- "2.0.0/extensions/Forwarder/Forwarder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./MixinWeth.sol\";\nimport \"./MixinForwarderCore.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./MixinAssets.sol\";\nimport \"./MixinExchangeWrapper.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract Forwarder is\n LibConstants,\n MixinWeth,\n MixinAssets,\n MixinExchangeWrapper,\n MixinForwarderCore\n{\n constructor (\n address _exchange,\n bytes memory _zrxAssetData,\n bytes memory _wethAssetData\n )\n public\n LibConstants(\n _exchange,\n _zrxAssetData,\n _wethAssetData\n )\n MixinForwarderCore()\n {}\n}\n",
- "2.0.0/extensions/Forwarder/MixinAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"../../tokens/ERC20Token/IERC20Token.sol\";\nimport \"../../tokens/ERC721Token/IERC721Token.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MAssets.sol\";\n\n\ncontract MixinAssets is\n Ownable,\n LibConstants,\n MAssets\n{\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_TRANSFER_SELECTOR = bytes4(keccak256(\"transfer(address,uint256)\"));\n\n /// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to \n /// function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be\n /// used to withdraw assets that were accidentally sent to this contract.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of ERC20 token to withdraw.\n function withdrawAsset(\n bytes assetData,\n uint256 amount\n )\n external\n onlyOwner\n {\n transferAssetToSender(assetData, amount);\n }\n\n /// @dev Transfers given amount of asset to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferAssetToSender(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n bytes4 proxyId = assetData.readBytes4(0);\n\n if (proxyId == ERC20_DATA_ID) {\n transferERC20Token(assetData, amount);\n } else if (proxyId == ERC721_DATA_ID) {\n transferERC721Token(assetData, amount);\n } else {\n revert(\"UNSUPPORTED_ASSET_PROXY\");\n }\n }\n\n /// @dev Decodes ERC20 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC20Token(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n address token = assetData.readAddress(16);\n\n // Transfer tokens.\n // We do a raw call so we can check the success separate\n // from the return data.\n bool success = token.call(abi.encodeWithSelector(\n ERC20_TRANSFER_SELECTOR,\n msg.sender,\n amount\n ));\n require(\n success,\n \"TRANSFER_FAILED\"\n );\n \n // Check return data.\n // If there is no return data, we assume the token incorrectly\n // does not return a bool. In this case we expect it to revert\n // on failure, which was handled above.\n // If the token does return data, we require that it is a single\n // value that evaluates to true.\n assembly {\n if returndatasize {\n success := 0\n if eq(returndatasize, 32) {\n // First 64 bytes of memory are reserved scratch space\n returndatacopy(0, 0, 32)\n success := mload(0)\n }\n }\n }\n require(\n success,\n \"TRANSFER_FAILED\"\n );\n }\n\n /// @dev Decodes ERC721 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC721Token(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n require(\n amount == 1,\n \"INVALID_AMOUNT\"\n );\n // Decode asset data.\n address token = assetData.readAddress(16);\n uint256 tokenId = assetData.readUint256(36);\n\n // Perform transfer.\n IERC721Token(token).transferFrom(\n address(this),\n msg.sender,\n tokenId\n );\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MExchangeWrapper.sol\";\nimport \"../../protocol/Exchange/libs/LibAbiEncoder.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../protocol/Exchange/libs/LibFillResults.sol\";\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\n\n\ncontract MixinExchangeWrapper is\n LibAbiEncoder,\n LibFillResults,\n LibMath,\n LibConstants,\n MExchangeWrapper\n{\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n // ABI encode calldata for `fillOrder`\n bytes memory fillOrderCalldata = abiEncodeFillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n\n address exchange = address(EXCHANGE);\n\n // Call `fillOrder` and handle any exceptions gracefully\n assembly {\n let success := call(\n gas, // forward all gas\n exchange, // call address of Exchange contract\n 0, // transfer 0 wei\n add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes)\n mload(fillOrderCalldata), // length of input\n fillOrderCalldata, // write output over input\n 128 // output size is 128 bytes\n )\n if success {\n mstore(fillResults, mload(fillOrderCalldata))\n mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32)))\n mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64)))\n mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96)))\n }\n }\n // fillResults values will be 0 by default if call was unsuccessful\n return fillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of WETH has been sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param wethSellAmount Desired amount of WETH to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellWeth(\n LibOrder.Order[] memory orders,\n uint256 wethSellAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // We assume that asset being sold by taker is WETH for each order.\n orders[i].makerAssetData = makerAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of WETH to sell\n uint256 remainingTakerAssetFillAmount = safeSub(wethSellAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of WETH\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= wethSellAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// The asset being sold by taker must always be WETH.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyExactAmountWithWeth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // We assume that asset being sold by taker is WETH for each order.\n orders[i].makerAssetData = makerAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n uint256 makerAssetFilledAmount = totalFillResults.makerAssetFilledAmount;\n if (makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n\n require(\n makerAssetFilledAmount >= makerAssetFillAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return totalFillResults;\n }\n\n /// @dev Buys zrxBuyAmount of ZRX fee tokens, taking into account ZRX fees for each order. This will guarantee\n /// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues).\n /// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX\n /// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases.\n /// The asset being sold by taker must always be WETH. \n /// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset.\n /// @param zrxBuyAmount Desired amount of ZRX to buy.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return totalFillResults Amounts filled and fees paid by maker and taker.\n function marketBuyExactZrxWithWeth(\n LibOrder.Order[] memory orders,\n uint256 zrxBuyAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n // Do nothing if zrxBuyAmount == 0\n if (zrxBuyAmount == 0) {\n return totalFillResults;\n }\n\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n uint256 zrxPurchased = 0;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // All of these are ZRX/WETH, so we can drop the respective assetData from calldata.\n orders[i].makerAssetData = zrxAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of ZRX to buy.\n uint256 remainingZrxBuyAmount = safeSub(zrxBuyAmount, zrxPurchased);\n\n // Convert the remaining amount of ZRX to buy into remaining amount\n // of WETH to sell, assuming entire amount can be sold in the current order.\n uint256 remainingWethSellAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n safeSub(orders[i].makerAssetAmount, orders[i].takerFee), // our exchange rate after fees \n remainingZrxBuyAmount\n );\n\n // Attempt to sell the remaining amount of WETH.\n FillResults memory singleFillResult = fillOrderNoThrow(\n orders[i],\n safeAdd(remainingWethSellAmount, 1), // we add 1 wei to the fill amount to make up for rounding errors\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker.\n addFillResults(totalFillResults, singleFillResult);\n zrxPurchased = safeSub(totalFillResults.makerAssetFilledAmount, totalFillResults.takerFeePaid);\n\n // Stop execution if the entire amount of ZRX has been bought.\n if (zrxPurchased >= zrxBuyAmount) {\n break;\n }\n }\n\n require(\n zrxPurchased >= zrxBuyAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return totalFillResults;\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinForwarderCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MWeth.sol\";\nimport \"./mixins/MAssets.sol\";\nimport \"./mixins/MExchangeWrapper.sol\";\nimport \"./interfaces/IForwarderCore.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../protocol/Exchange/libs/LibFillResults.sol\";\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\n\n\ncontract MixinForwarderCore is\n LibFillResults,\n LibMath,\n LibConstants,\n MWeth,\n MAssets,\n MExchangeWrapper,\n IForwarderCore\n{\n using LibBytes for bytes;\n\n /// @dev Constructor approves ERC20 proxy to transfer ZRX and WETH on this contract's behalf.\n constructor ()\n public\n {\n address proxyAddress = EXCHANGE.getAssetProxy(ERC20_DATA_ID);\n require(\n proxyAddress != address(0),\n \"UNREGISTERED_ASSET_PROXY\"\n );\n ETHER_TOKEN.approve(proxyAddress, MAX_UINT);\n ZRX_TOKEN.approve(proxyAddress, MAX_UINT);\n }\n\n /// @dev Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketSellOrdersWithEth(\n LibOrder.Order[] memory orders,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n FillResults memory orderFillResults,\n FillResults memory feeOrderFillResults\n )\n {\n // Convert ETH to WETH.\n convertEthToWeth();\n\n uint256 wethSellAmount;\n uint256 zrxBuyAmount;\n uint256 makerAssetAmountPurchased;\n if (orders[0].makerAssetData.equals(ZRX_ASSET_DATA)) {\n // Calculate amount of WETH that won't be spent on ETH fees.\n wethSellAmount = getPartialAmountFloor(\n PERCENTAGE_DENOMINATOR,\n safeAdd(PERCENTAGE_DENOMINATOR, feePercentage),\n msg.value\n );\n // Market sell available WETH.\n // ZRX fees are paid with this contract's balance.\n orderFillResults = marketSellWeth(\n orders,\n wethSellAmount,\n signatures\n );\n // The fee amount must be deducted from the amount transfered back to sender.\n makerAssetAmountPurchased = safeSub(orderFillResults.makerAssetFilledAmount, orderFillResults.takerFeePaid);\n } else {\n // 5% of WETH is reserved for filling feeOrders and paying feeRecipient.\n wethSellAmount = getPartialAmountFloor(\n MAX_WETH_FILL_PERCENTAGE,\n PERCENTAGE_DENOMINATOR,\n msg.value\n );\n // Market sell 95% of WETH.\n // ZRX fees are payed with this contract's balance.\n orderFillResults = marketSellWeth(\n orders,\n wethSellAmount,\n signatures\n );\n // Buy back all ZRX spent on fees.\n zrxBuyAmount = orderFillResults.takerFeePaid;\n feeOrderFillResults = marketBuyExactZrxWithWeth(\n feeOrders,\n zrxBuyAmount,\n feeSignatures\n );\n makerAssetAmountPurchased = orderFillResults.makerAssetFilledAmount;\n }\n\n // Transfer feePercentage of total ETH spent on primary orders to feeRecipient.\n // Refund remaining ETH to msg.sender.\n transferEthFeeAndRefund(\n orderFillResults.takerAssetFilledAmount,\n feeOrderFillResults.takerAssetFilledAmount,\n feePercentage,\n feeRecipient\n );\n\n // Transfer purchased assets to msg.sender.\n transferAssetToSender(orders[0].makerAssetData, makerAssetAmountPurchased);\n }\n\n /// @dev Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param makerAssetFillAmount Desired amount of makerAsset to purchase.\n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketBuyOrdersWithEth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n FillResults memory orderFillResults,\n FillResults memory feeOrderFillResults\n )\n {\n // Convert ETH to WETH.\n convertEthToWeth();\n\n uint256 zrxBuyAmount;\n uint256 makerAssetAmountPurchased;\n if (orders[0].makerAssetData.equals(ZRX_ASSET_DATA)) {\n // If the makerAsset is ZRX, it is not necessary to pay fees out of this\n // contracts's ZRX balance because fees are factored into the price of the order.\n orderFillResults = marketBuyExactZrxWithWeth(\n orders,\n makerAssetFillAmount,\n signatures\n );\n // The fee amount must be deducted from the amount transfered back to sender.\n makerAssetAmountPurchased = safeSub(orderFillResults.makerAssetFilledAmount, orderFillResults.takerFeePaid);\n } else {\n // Attemp to purchase desired amount of makerAsset.\n // ZRX fees are payed with this contract's balance.\n orderFillResults = marketBuyExactAmountWithWeth(\n orders,\n makerAssetFillAmount,\n signatures\n );\n // Buy back all ZRX spent on fees.\n zrxBuyAmount = orderFillResults.takerFeePaid;\n feeOrderFillResults = marketBuyExactZrxWithWeth(\n feeOrders,\n zrxBuyAmount,\n feeSignatures\n );\n makerAssetAmountPurchased = orderFillResults.makerAssetFilledAmount;\n }\n\n // Transfer feePercentage of total ETH spent on primary orders to feeRecipient.\n // Refund remaining ETH to msg.sender.\n transferEthFeeAndRefund(\n orderFillResults.takerAssetFilledAmount,\n feeOrderFillResults.takerAssetFilledAmount,\n feePercentage,\n feeRecipient\n );\n\n // Transfer purchased assets to msg.sender.\n transferAssetToSender(orders[0].makerAssetData, makerAssetAmountPurchased);\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinWeth.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MWeth.sol\";\n\n\ncontract MixinWeth is\n LibMath,\n LibConstants,\n MWeth\n{\n /// @dev Default payabale function, this allows us to withdraw WETH\n function ()\n public\n payable\n {\n require(\n msg.sender == address(ETHER_TOKEN),\n \"DEFAULT_FUNCTION_WETH_CONTRACT_ONLY\"\n );\n }\n\n /// @dev Converts message call's ETH value into WETH.\n function convertEthToWeth()\n internal\n {\n require(\n msg.value > 0,\n \"INVALID_MSG_VALUE\"\n );\n ETHER_TOKEN.deposit.value(msg.value)();\n }\n\n /// @dev Transfers feePercentage of WETH spent on primary orders to feeRecipient.\n /// Refunds any excess ETH to msg.sender.\n /// @param wethSoldExcludingFeeOrders Amount of WETH sold when filling primary orders.\n /// @param wethSoldForZrx Amount of WETH sold when purchasing ZRX required for primary order fees.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n function transferEthFeeAndRefund(\n uint256 wethSoldExcludingFeeOrders,\n uint256 wethSoldForZrx,\n uint256 feePercentage,\n address feeRecipient\n )\n internal\n {\n // Ensure feePercentage is less than 5%.\n require(\n feePercentage <= MAX_FEE_PERCENTAGE,\n \"FEE_PERCENTAGE_TOO_LARGE\"\n );\n\n // Ensure that no extra WETH owned by this contract has been sold.\n uint256 wethSold = safeAdd(wethSoldExcludingFeeOrders, wethSoldForZrx);\n require(\n wethSold <= msg.value,\n \"OVERSOLD_WETH\"\n );\n\n // Calculate amount of WETH that hasn't been sold.\n uint256 wethRemaining = safeSub(msg.value, wethSold);\n\n // Calculate ETH fee to pay to feeRecipient.\n uint256 ethFee = getPartialAmountFloor(\n feePercentage,\n PERCENTAGE_DENOMINATOR,\n wethSoldExcludingFeeOrders\n );\n\n // Ensure fee is less than amount of WETH remaining.\n require(\n ethFee <= wethRemaining,\n \"INSUFFICIENT_ETH_REMAINING\"\n );\n \n // Do nothing if no WETH remaining\n if (wethRemaining > 0) {\n // Convert remaining WETH to ETH\n ETHER_TOKEN.withdraw(wethRemaining);\n\n // Pay ETH to feeRecipient\n if (ethFee > 0) {\n feeRecipient.transfer(ethFee);\n }\n\n // Refund remaining ETH to msg.sender.\n uint256 ethRefund = safeSub(wethRemaining, ethFee);\n if (ethRefund > 0) {\n msg.sender.transfer(ethRefund);\n }\n }\n }\n}\n",
- "2.0.0/extensions/Forwarder/interfaces/IAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IAssets {\n\n /// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to \n /// function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be\n /// used to withdraw assets that were accidentally sent to this contract.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of ERC20 token to withdraw.\n function withdrawAsset(\n bytes assetData,\n uint256 amount\n )\n external;\n}\n",
- "2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../../protocol/Exchange/libs/LibFillResults.sol\";\n\n\ncontract IForwarderCore {\n\n /// @dev Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketSellOrdersWithEth(\n LibOrder.Order[] memory orders,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n LibFillResults.FillResults memory orderFillResults,\n LibFillResults.FillResults memory feeOrderFillResults\n );\n\n /// @dev Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param makerAssetFillAmount Desired amount of makerAsset to purchase.\n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketBuyOrdersWithEth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n LibFillResults.FillResults memory orderFillResults,\n LibFillResults.FillResults memory feeOrderFillResults\n );\n}\n",
- "2.0.0/extensions/Forwarder/libs/LibConstants.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/LibBytes/LibBytes.sol\";\nimport \"../../../protocol/Exchange/interfaces/IExchange.sol\";\nimport \"../../../tokens/EtherToken/IEtherToken.sol\";\nimport \"../../../tokens/ERC20Token/IERC20Token.sol\";\n\n\ncontract LibConstants {\n\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n uint256 constant internal MAX_UINT = 2**256 - 1;\n uint256 constant internal PERCENTAGE_DENOMINATOR = 10**18; \n uint256 constant internal MAX_FEE_PERCENTAGE = 5 * PERCENTAGE_DENOMINATOR / 100; // 5%\n uint256 constant internal MAX_WETH_FILL_PERCENTAGE = 95 * PERCENTAGE_DENOMINATOR / 100; // 95%\n \n // solhint-disable var-name-mixedcase\n IExchange internal EXCHANGE;\n IEtherToken internal ETHER_TOKEN;\n IERC20Token internal ZRX_TOKEN;\n bytes internal ZRX_ASSET_DATA;\n bytes internal WETH_ASSET_DATA;\n // solhint-enable var-name-mixedcase\n\n constructor (\n address _exchange,\n bytes memory _zrxAssetData,\n bytes memory _wethAssetData\n )\n public\n {\n EXCHANGE = IExchange(_exchange);\n ZRX_ASSET_DATA = _zrxAssetData;\n WETH_ASSET_DATA = _wethAssetData;\n\n address etherToken = _wethAssetData.readAddress(16);\n address zrxToken = _zrxAssetData.readAddress(16);\n ETHER_TOKEN = IEtherToken(etherToken);\n ZRX_TOKEN = IERC20Token(zrxToken);\n }\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAssets.sol\";\n\n\ncontract MAssets is\n IAssets\n{\n /// @dev Transfers given amount of asset to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferAssetToSender(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n\n /// @dev Decodes ERC20 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC20Token(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n\n /// @dev Decodes ERC721 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC721Token(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../../protocol/Exchange/libs/LibFillResults.sol\";\n\n\ncontract MExchangeWrapper {\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of WETH has been sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param wethSellAmount Desired amount of WETH to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellWeth(\n LibOrder.Order[] memory orders,\n uint256 wethSellAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// The asset being sold by taker must always be WETH.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyExactAmountWithWeth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Buys zrxBuyAmount of ZRX fee tokens, taking into account ZRX fees for each order. This will guarantee\n /// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues).\n /// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX\n /// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases.\n /// The asset being sold by taker must always be WETH. \n /// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset.\n /// @param zrxBuyAmount Desired amount of ZRX to buy.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return totalFillResults Amounts filled and fees paid by maker and taker.\n function marketBuyExactZrxWithWeth(\n LibOrder.Order[] memory orders,\n uint256 zrxBuyAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MWeth.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract MWeth {\n\n /// @dev Converts message call's ETH value into WETH.\n function convertEthToWeth()\n internal;\n\n /// @dev Transfers feePercentage of WETH spent on primary orders to feeRecipient.\n /// Refunds any excess ETH to msg.sender.\n /// @param wethSoldExcludingFeeOrders Amount of WETH sold when filling primary orders.\n /// @param wethSoldForZrx Amount of WETH sold when purchasing ZRX required for primary order fees.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n function transferEthFeeAndRefund(\n uint256 wethSoldExcludingFeeOrders,\n uint256 wethSoldForZrx,\n uint256 feePercentage,\n address feeRecipient\n )\n internal;\n}\n",
- "2.0.0/extensions/OrderValidator/OrderValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../protocol/Exchange/interfaces/IExchange.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../tokens/ERC20Token/IERC20Token.sol\";\nimport \"../../tokens/ERC721Token/IERC721Token.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\n\n\ncontract OrderValidator {\n\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n\n struct TraderInfo {\n uint256 makerBalance; // Maker's balance of makerAsset\n uint256 makerAllowance; // Maker's allowance to corresponding AssetProxy\n uint256 takerBalance; // Taker's balance of takerAsset\n uint256 takerAllowance; // Taker's allowance to corresponding AssetProxy\n uint256 makerZrxBalance; // Maker's balance of ZRX\n uint256 makerZrxAllowance; // Maker's allowance of ZRX to ERC20Proxy\n uint256 takerZrxBalance; // Taker's balance of ZRX\n uint256 takerZrxAllowance; // Taker's allowance of ZRX to ERC20Proxy\n }\n\n // solhint-disable var-name-mixedcase\n IExchange internal EXCHANGE;\n bytes internal ZRX_ASSET_DATA;\n // solhint-enable var-name-mixedcase\n\n constructor (address _exchange, bytes memory _zrxAssetData)\n public\n {\n EXCHANGE = IExchange(_exchange);\n ZRX_ASSET_DATA = _zrxAssetData;\n }\n\n /// @dev Fetches information for order and maker/taker of order.\n /// @param order The order structure.\n /// @param takerAddress Address that will be filling the order.\n /// @return OrderInfo and TraderInfo instances for given order.\n function getOrderAndTraderInfo(LibOrder.Order memory order, address takerAddress)\n public\n view\n returns (LibOrder.OrderInfo memory orderInfo, TraderInfo memory traderInfo)\n {\n orderInfo = EXCHANGE.getOrderInfo(order);\n traderInfo = getTraderInfo(order, takerAddress);\n return (orderInfo, traderInfo);\n }\n\n /// @dev Fetches information for all passed in orders and the makers/takers of each order.\n /// @param orders Array of order specifications.\n /// @param takerAddresses Array of taker addresses corresponding to each order.\n /// @return Arrays of OrderInfo and TraderInfo instances that correspond to each order.\n function getOrdersAndTradersInfo(LibOrder.Order[] memory orders, address[] memory takerAddresses)\n public\n view\n returns (LibOrder.OrderInfo[] memory ordersInfo, TraderInfo[] memory tradersInfo)\n {\n ordersInfo = EXCHANGE.getOrdersInfo(orders);\n tradersInfo = getTradersInfo(orders, takerAddresses);\n return (ordersInfo, tradersInfo);\n }\n\n /// @dev Fetches balance and allowances for maker and taker of order.\n /// @param order The order structure.\n /// @param takerAddress Address that will be filling the order.\n /// @return Balances and allowances of maker and taker of order.\n function getTraderInfo(LibOrder.Order memory order, address takerAddress)\n public\n view\n returns (TraderInfo memory traderInfo)\n {\n (traderInfo.makerBalance, traderInfo.makerAllowance) = getBalanceAndAllowance(order.makerAddress, order.makerAssetData);\n (traderInfo.takerBalance, traderInfo.takerAllowance) = getBalanceAndAllowance(takerAddress, order.takerAssetData);\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n (traderInfo.makerZrxBalance, traderInfo.makerZrxAllowance) = getBalanceAndAllowance(order.makerAddress, zrxAssetData);\n (traderInfo.takerZrxBalance, traderInfo.takerZrxAllowance) = getBalanceAndAllowance(takerAddress, zrxAssetData);\n return traderInfo;\n }\n\n /// @dev Fetches balances and allowances of maker and taker for each provided order.\n /// @param orders Array of order specifications.\n /// @param takerAddresses Array of taker addresses corresponding to each order.\n /// @return Array of balances and allowances for maker and taker of each order.\n function getTradersInfo(LibOrder.Order[] memory orders, address[] memory takerAddresses)\n public\n view\n returns (TraderInfo[] memory)\n {\n uint256 ordersLength = orders.length;\n TraderInfo[] memory tradersInfo = new TraderInfo[](ordersLength);\n for (uint256 i = 0; i != ordersLength; i++) {\n tradersInfo[i] = getTraderInfo(orders[i], takerAddresses[i]);\n }\n return tradersInfo;\n }\n\n /// @dev Fetches token balances and allowances of an address to given assetProxy. Supports ERC20 and ERC721.\n /// @param target Address to fetch balances and allowances of.\n /// @param assetData Encoded data that can be decoded by a specified proxy contract when transferring asset.\n /// @return Balance of asset and allowance set to given proxy of asset.\n /// For ERC721 tokens, these values will always be 1 or 0.\n function getBalanceAndAllowance(address target, bytes memory assetData)\n public\n view\n returns (uint256 balance, uint256 allowance)\n {\n bytes4 assetProxyId = assetData.readBytes4(0);\n address token = assetData.readAddress(16);\n address assetProxy = EXCHANGE.getAssetProxy(assetProxyId);\n\n if (assetProxyId == ERC20_DATA_ID) {\n // Query balance\n balance = IERC20Token(token).balanceOf(target);\n\n // Query allowance\n allowance = IERC20Token(token).allowance(target, assetProxy);\n } else if (assetProxyId == ERC721_DATA_ID) {\n uint256 tokenId = assetData.readUint256(36);\n\n // Query owner of tokenId\n address owner = getERC721TokenOwner(token, tokenId);\n\n // Set balance to 1 if tokenId is owned by target\n balance = target == owner ? 1 : 0;\n\n // Check if ERC721Proxy is approved to spend tokenId\n bool isApproved = IERC721Token(token).isApprovedForAll(target, assetProxy) || IERC721Token(token).getApproved(tokenId) == assetProxy;\n \n // Set alowance to 1 if ERC721Proxy is approved to spend tokenId\n allowance = isApproved ? 1 : 0;\n } else {\n revert(\"UNSUPPORTED_ASSET_PROXY\");\n }\n return (balance, allowance);\n }\n\n /// @dev Fetches token balances and allowances of an address for each given assetProxy. Supports ERC20 and ERC721.\n /// @param target Address to fetch balances and allowances of.\n /// @param assetData Array of encoded byte arrays that can be decoded by a specified proxy contract when transferring asset.\n /// @return Balances and allowances of assets.\n /// For ERC721 tokens, these values will always be 1 or 0.\n function getBalancesAndAllowances(address target, bytes[] memory assetData)\n public\n view\n returns (uint256[] memory, uint256[] memory)\n {\n uint256 length = assetData.length;\n uint256[] memory balances = new uint256[](length);\n uint256[] memory allowances = new uint256[](length);\n for (uint256 i = 0; i != length; i++) {\n (balances[i], allowances[i]) = getBalanceAndAllowance(target, assetData[i]);\n }\n return (balances, allowances);\n }\n\n /// @dev Calls `token.ownerOf(tokenId)`, but returns a null owner instead of reverting on an unowned token.\n /// @param token Address of ERC721 token.\n /// @param tokenId The identifier for the specific NFT.\n /// @return Owner of tokenId or null address if unowned.\n function getERC721TokenOwner(address token, uint256 tokenId)\n public\n view\n returns (address owner)\n {\n assembly {\n // load free memory pointer\n let cdStart := mload(64)\n\n // bytes4(keccak256(ownerOf(uint256))) = 0x6352211e\n mstore(cdStart, 0x6352211e00000000000000000000000000000000000000000000000000000000)\n mstore(add(cdStart, 4), tokenId)\n\n // staticcall `ownerOf(tokenId)`\n // `ownerOf` will revert if tokenId is not owned\n let success := staticcall(\n gas, // forward all gas\n token, // call token contract\n cdStart, // start of calldata\n 36, // length of input is 36 bytes\n cdStart, // write output over input\n 32 // size of output is 32 bytes\n )\n\n // Success implies that tokenId is owned\n // Copy owner from return data if successful\n if success {\n owner := mload(cdStart)\n } \n }\n\n // Owner initialized to address(0), no need to modify if call is unsuccessful\n return owner;\n }\n}\n",
- "2.0.0/multisig/MultiSigWallet.sol": "// solhint-disable\npragma solidity ^0.4.15;\n\n\n/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.\n/// @author Stefan George - <stefan.george@consensys.net>\ncontract MultiSigWallet {\n\n /*\n * Events\n */\n event Confirmation(address indexed sender, uint indexed transactionId);\n event Revocation(address indexed sender, uint indexed transactionId);\n event Submission(uint indexed transactionId);\n event Execution(uint indexed transactionId);\n event ExecutionFailure(uint indexed transactionId);\n event Deposit(address indexed sender, uint value);\n event OwnerAddition(address indexed owner);\n event OwnerRemoval(address indexed owner);\n event RequirementChange(uint required);\n\n /*\n * Constants\n */\n uint constant public MAX_OWNER_COUNT = 50;\n\n /*\n * Storage\n */\n mapping (uint => Transaction) public transactions;\n mapping (uint => mapping (address => bool)) public confirmations;\n mapping (address => bool) public isOwner;\n address[] public owners;\n uint public required;\n uint public transactionCount;\n\n struct Transaction {\n address destination;\n uint value;\n bytes data;\n bool executed;\n }\n\n /*\n * Modifiers\n */\n modifier onlyWallet() {\n require(msg.sender == address(this));\n _;\n }\n\n modifier ownerDoesNotExist(address owner) {\n require(!isOwner[owner]);\n _;\n }\n\n modifier ownerExists(address owner) {\n require(isOwner[owner]);\n _;\n }\n\n modifier transactionExists(uint transactionId) {\n require(transactions[transactionId].destination != 0);\n _;\n }\n\n modifier confirmed(uint transactionId, address owner) {\n require(confirmations[transactionId][owner]);\n _;\n }\n\n modifier notConfirmed(uint transactionId, address owner) {\n require(!confirmations[transactionId][owner]);\n _;\n }\n\n modifier notExecuted(uint transactionId) {\n require(!transactions[transactionId].executed);\n _;\n }\n\n modifier notNull(address _address) {\n require(_address != 0);\n _;\n }\n\n modifier validRequirement(uint ownerCount, uint _required) {\n require(ownerCount <= MAX_OWNER_COUNT\n && _required <= ownerCount\n && _required != 0\n && ownerCount != 0);\n _;\n }\n\n /// @dev Fallback function allows to deposit ether.\n function()\n payable\n {\n if (msg.value > 0)\n Deposit(msg.sender, msg.value);\n }\n\n /*\n * Public functions\n */\n /// @dev Contract constructor sets initial owners and required number of confirmations.\n /// @param _owners List of initial owners.\n /// @param _required Number of required confirmations.\n function MultiSigWallet(address[] _owners, uint _required)\n public\n validRequirement(_owners.length, _required)\n {\n for (uint i=0; i<_owners.length; i++) {\n require(!isOwner[_owners[i]] && _owners[i] != 0);\n isOwner[_owners[i]] = true;\n }\n owners = _owners;\n required = _required;\n }\n\n /// @dev Allows to add a new owner. Transaction has to be sent by wallet.\n /// @param owner Address of new owner.\n function addOwner(address owner)\n public\n onlyWallet\n ownerDoesNotExist(owner)\n notNull(owner)\n validRequirement(owners.length + 1, required)\n {\n isOwner[owner] = true;\n owners.push(owner);\n OwnerAddition(owner);\n }\n\n /// @dev Allows to remove an owner. Transaction has to be sent by wallet.\n /// @param owner Address of owner.\n function removeOwner(address owner)\n public\n onlyWallet\n ownerExists(owner)\n {\n isOwner[owner] = false;\n for (uint i=0; i<owners.length - 1; i++)\n if (owners[i] == owner) {\n owners[i] = owners[owners.length - 1];\n break;\n }\n owners.length -= 1;\n if (required > owners.length)\n changeRequirement(owners.length);\n OwnerRemoval(owner);\n }\n\n /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet.\n /// @param owner Address of owner to be replaced.\n /// @param newOwner Address of new owner.\n function replaceOwner(address owner, address newOwner)\n public\n onlyWallet\n ownerExists(owner)\n ownerDoesNotExist(newOwner)\n {\n for (uint i=0; i<owners.length; i++)\n if (owners[i] == owner) {\n owners[i] = newOwner;\n break;\n }\n isOwner[owner] = false;\n isOwner[newOwner] = true;\n OwnerRemoval(owner);\n OwnerAddition(newOwner);\n }\n\n /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet.\n /// @param _required Number of required confirmations.\n function changeRequirement(uint _required)\n public\n onlyWallet\n validRequirement(owners.length, _required)\n {\n required = _required;\n RequirementChange(_required);\n }\n\n /// @dev Allows an owner to submit and confirm a transaction.\n /// @param destination Transaction target address.\n /// @param value Transaction ether value.\n /// @param data Transaction data payload.\n /// @return Returns transaction ID.\n function submitTransaction(address destination, uint value, bytes data)\n public\n returns (uint transactionId)\n {\n transactionId = addTransaction(destination, value, data);\n confirmTransaction(transactionId);\n }\n\n /// @dev Allows an owner to confirm a transaction.\n /// @param transactionId Transaction ID.\n function confirmTransaction(uint transactionId)\n public\n ownerExists(msg.sender)\n transactionExists(transactionId)\n notConfirmed(transactionId, msg.sender)\n {\n confirmations[transactionId][msg.sender] = true;\n Confirmation(msg.sender, transactionId);\n executeTransaction(transactionId);\n }\n\n /// @dev Allows an owner to revoke a confirmation for a transaction.\n /// @param transactionId Transaction ID.\n function revokeConfirmation(uint transactionId)\n public\n ownerExists(msg.sender)\n confirmed(transactionId, msg.sender)\n notExecuted(transactionId)\n {\n confirmations[transactionId][msg.sender] = false;\n Revocation(msg.sender, transactionId);\n }\n\n /// @dev Allows anyone to execute a confirmed transaction.\n /// @param transactionId Transaction ID.\n function executeTransaction(uint transactionId)\n public\n ownerExists(msg.sender)\n confirmed(transactionId, msg.sender)\n notExecuted(transactionId)\n {\n if (isConfirmed(transactionId)) {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data))\n Execution(transactionId);\n else {\n ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n }\n\n // call has been separated into its own function in order to take advantage\n // of the Solidity's code generator to produce a loop that copies tx.data into memory.\n function external_call(address destination, uint value, uint dataLength, bytes data) internal returns (bool) {\n bool result;\n assembly {\n let x := mload(0x40) // \"Allocate\" memory for output (0x40 is where \"free memory\" pointer is stored by convention)\n let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that\n result := call(\n sub(gas, 34710), // 34710 is the value that solidity is currently emitting\n // It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) +\n // callNewAccountGas (25000, in case the destination address does not exist and needs creating)\n destination,\n value,\n d,\n dataLength, // Size of the input (in bytes) - this is what fixes the padding problem\n x,\n 0 // Output is ignored, therefore the output size is zero\n )\n }\n return result;\n }\n\n /// @dev Returns the confirmation status of a transaction.\n /// @param transactionId Transaction ID.\n /// @return Confirmation status.\n function isConfirmed(uint transactionId)\n public\n constant\n returns (bool)\n {\n uint count = 0;\n for (uint i=0; i<owners.length; i++) {\n if (confirmations[transactionId][owners[i]])\n count += 1;\n if (count == required)\n return true;\n }\n }\n\n /*\n * Internal functions\n */\n /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet.\n /// @param destination Transaction target address.\n /// @param value Transaction ether value.\n /// @param data Transaction data payload.\n /// @return Returns transaction ID.\n function addTransaction(address destination, uint value, bytes data)\n internal\n notNull(destination)\n returns (uint transactionId)\n {\n transactionId = transactionCount;\n transactions[transactionId] = Transaction({\n destination: destination,\n value: value,\n data: data,\n executed: false\n });\n transactionCount += 1;\n Submission(transactionId);\n }\n\n /*\n * Web3 call functions\n */\n /// @dev Returns number of confirmations of a transaction.\n /// @param transactionId Transaction ID.\n /// @return Number of confirmations.\n function getConfirmationCount(uint transactionId)\n public\n constant\n returns (uint count)\n {\n for (uint i=0; i<owners.length; i++)\n if (confirmations[transactionId][owners[i]])\n count += 1;\n }\n\n /// @dev Returns total number of transactions after filers are applied.\n /// @param pending Include pending transactions.\n /// @param executed Include executed transactions.\n /// @return Total number of transactions after filters are applied.\n function getTransactionCount(bool pending, bool executed)\n public\n constant\n returns (uint count)\n {\n for (uint i=0; i<transactionCount; i++)\n if ( pending && !transactions[i].executed\n || executed && transactions[i].executed)\n count += 1;\n }\n\n /// @dev Returns list of owners.\n /// @return List of owner addresses.\n function getOwners()\n public\n constant\n returns (address[])\n {\n return owners;\n }\n\n /// @dev Returns array with owner addresses, which confirmed transaction.\n /// @param transactionId Transaction ID.\n /// @return Returns array of owner addresses.\n function getConfirmations(uint transactionId)\n public\n constant\n returns (address[] _confirmations)\n {\n address[] memory confirmationsTemp = new address[](owners.length);\n uint count = 0;\n uint i;\n for (i=0; i<owners.length; i++)\n if (confirmations[transactionId][owners[i]]) {\n confirmationsTemp[count] = owners[i];\n count += 1;\n }\n _confirmations = new address[](count);\n for (i=0; i<count; i++)\n _confirmations[i] = confirmationsTemp[i];\n }\n\n /// @dev Returns list of transaction IDs in defined range.\n /// @param from Index start position of transaction array.\n /// @param to Index end position of transaction array.\n /// @param pending Include pending transactions.\n /// @param executed Include executed transactions.\n /// @return Returns array of transaction IDs.\n function getTransactionIds(uint from, uint to, bool pending, bool executed)\n public\n constant\n returns (uint[] _transactionIds)\n {\n uint[] memory transactionIdsTemp = new uint[](transactionCount);\n uint count = 0;\n uint i;\n for (i=0; i<transactionCount; i++)\n if ( pending && !transactions[i].executed\n || executed && transactions[i].executed)\n {\n transactionIdsTemp[count] = i;\n count += 1;\n }\n _transactionIds = new uint[](to - from);\n for (i=from; i<to; i++)\n _transactionIds[i - from] = transactionIdsTemp[i];\n }\n}",
- "2.0.0/multisig/MultiSigWalletWithTimeLock.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MultiSigWallet.sol\";\n\n\n/// @title Multisignature wallet with time lock- Allows multiple parties to execute a transaction after a time lock has passed.\n/// @author Amir Bandeali - <amir@0xProject.com>\n// solhint-disable not-rely-on-time\ncontract MultiSigWalletWithTimeLock is\n MultiSigWallet\n{\n event ConfirmationTimeSet(uint256 indexed transactionId, uint256 confirmationTime);\n event TimeLockChange(uint256 secondsTimeLocked);\n\n uint256 public secondsTimeLocked;\n\n mapping (uint256 => uint256) public confirmationTimes;\n\n modifier notFullyConfirmed(uint256 transactionId) {\n require(\n !isConfirmed(transactionId),\n \"TX_FULLY_CONFIRMED\"\n );\n _;\n }\n\n modifier fullyConfirmed(uint256 transactionId) {\n require(\n isConfirmed(transactionId),\n \"TX_NOT_FULLY_CONFIRMED\"\n );\n _;\n }\n\n modifier pastTimeLock(uint256 transactionId) {\n require(\n block.timestamp >= confirmationTimes[transactionId] + secondsTimeLocked,\n \"TIME_LOCK_INCOMPLETE\"\n );\n _;\n }\n\n /// @dev Contract constructor sets initial owners, required number of confirmations, and time lock.\n /// @param _owners List of initial owners.\n /// @param _required Number of required confirmations.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n constructor (\n address[] _owners,\n uint256 _required,\n uint256 _secondsTimeLocked\n )\n public\n MultiSigWallet(_owners, _required)\n {\n secondsTimeLocked = _secondsTimeLocked;\n }\n\n /// @dev Changes the duration of the time lock for transactions.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n function changeTimeLock(uint256 _secondsTimeLocked)\n public\n onlyWallet\n {\n secondsTimeLocked = _secondsTimeLocked;\n emit TimeLockChange(_secondsTimeLocked);\n }\n\n /// @dev Allows an owner to confirm a transaction.\n /// @param transactionId Transaction ID.\n function confirmTransaction(uint256 transactionId)\n public\n ownerExists(msg.sender)\n transactionExists(transactionId)\n notConfirmed(transactionId, msg.sender)\n notFullyConfirmed(transactionId)\n {\n confirmations[transactionId][msg.sender] = true;\n emit Confirmation(msg.sender, transactionId);\n if (isConfirmed(transactionId)) {\n setConfirmationTime(transactionId, block.timestamp);\n }\n }\n\n /// @dev Allows anyone to execute a confirmed transaction.\n /// @param transactionId Transaction ID.\n function executeTransaction(uint256 transactionId)\n public\n notExecuted(transactionId)\n fullyConfirmed(transactionId)\n pastTimeLock(transactionId)\n {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) {\n emit Execution(transactionId);\n } else {\n emit ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n\n /// @dev Sets the time of when a submission first passed.\n function setConfirmationTime(uint256 transactionId, uint256 confirmationTime)\n internal\n {\n confirmationTimes[transactionId] = confirmationTime;\n emit ConfirmationTimeSet(transactionId, confirmationTime);\n }\n}\n",
- "2.0.0/protocol/AssetProxy/ERC20Proxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MixinAuthorizable.sol\";\n\n\ncontract ERC20Proxy is\n MixinAuthorizable\n{\n // Id of this proxy.\n bytes4 constant internal PROXY_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n \n // solhint-disable-next-line payable-fallback\n function () \n external\n {\n assembly {\n // The first 4 bytes of calldata holds the function selector\n let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)\n\n // `transferFrom` will be called with the following parameters:\n // assetData Encoded byte array.\n // from Address to transfer asset from.\n // to Address to transfer asset to.\n // amount Amount of asset to transfer.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {\n\n // To lookup a value in a mapping, we load from the storage location keccak256(k, p),\n // where k is the key left padded to 32 bytes and p is the storage slot\n let start := mload(64)\n mstore(start, and(caller, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(start, 32), authorized_slot)\n\n // Revert if authorized[msg.sender] == false\n if iszero(sload(keccak256(start, 64))) {\n // Revert with `Error(\"SENDER_NOT_AUTHORIZED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // `transferFrom`.\n // The function is marked `external`, so no abi decodeding is done for\n // us. Instead, we expect the `calldata` memory to contain the\n // following:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n //\n // (*): offset is computed from start of function parameters, so offset\n // by an additional 4 bytes in the calldata.\n //\n // (**): see table below to compute length of assetData Contents\n //\n // WARNING: The ABIv2 specification allows additional padding between\n // the Params and Data section. This will result in a larger\n // offset to assetData.\n\n // Asset data itself is encoded as follows:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 1 * 32 | function parameters: |\n // | | 4 | 12 + 20 | 1. token address |\n\n // We construct calldata for the `token.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 4 | | 1. from |\n // | | 36 | | 2. to |\n // | | 68 | | 3. amount |\n\n /////// Read token address from calldata ///////\n // * The token address is stored in `assetData`.\n //\n // * The \"offset to assetData\" is stored at offset 4 in the calldata (table 1).\n // [assetDataOffsetFromParams = calldataload(4)]\n //\n // * Notes that the \"offset to assetData\" is relative to the \"Params\" area of calldata;\n // add 4 bytes to account for the length of the \"Header\" area (table 1).\n // [assetDataOffsetFromHeader = assetDataOffsetFromParams + 4]\n //\n // * The \"token address\" is offset 32+4=36 bytes into \"assetData\" (tables 1 & 2).\n // [tokenOffset = assetDataOffsetFromHeader + 36 = calldataload(4) + 4 + 36]\n let token := calldataload(add(calldataload(4), 40))\n \n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFrom` selector.\n // Any trailing data in transferFromSelector will be\n // overwritten in the next `mstore` call.\n mstore(0, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // We copy the fields `from`, `to` and `amount` in bulk\n // from our own calldata to the new calldata.\n calldatacopy(4, 36, 96)\n\n /////// Call `token.transferFrom` using the calldata ///////\n let success := call(\n gas, // forward all gas\n token, // call address of token contract\n 0, // don't send any ETH\n 0, // pointer to start of input\n 100, // length of input\n 0, // write output over input\n 32 // output size should be 32 bytes\n )\n\n /////// Check return data. ///////\n // If there is no return data, we assume the token incorrectly\n // does not return a bool. In this case we expect it to revert\n // on failure, which was handled above.\n // If the token does return data, we require that it is a single\n // nonzero 32 bytes value.\n // So the transfer succeeded if the call succeeded and either\n // returned nothing, or returned a non-zero 32 byte value. \n success := and(success, or(\n iszero(returndatasize),\n and(\n eq(returndatasize, 32),\n gt(mload(0), 0)\n )\n ))\n if success {\n return(0, 0)\n }\n \n // Revert with `Error(\"TRANSFER_FAILED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // Revert if undefined function is called\n revert(0, 0)\n }\n }\n\n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4)\n {\n return PROXY_ID;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/ERC721Proxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MixinAuthorizable.sol\";\n\n\ncontract ERC721Proxy is\n MixinAuthorizable\n{\n // Id of this proxy.\n bytes4 constant internal PROXY_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n\n // solhint-disable-next-line payable-fallback\n function () \n external\n {\n assembly {\n // The first 4 bytes of calldata holds the function selector\n let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)\n\n // `transferFrom` will be called with the following parameters:\n // assetData Encoded byte array.\n // from Address to transfer asset from.\n // to Address to transfer asset to.\n // amount Amount of asset to transfer.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {\n\n // To lookup a value in a mapping, we load from the storage location keccak256(k, p),\n // where k is the key left padded to 32 bytes and p is the storage slot\n let start := mload(64)\n mstore(start, and(caller, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(start, 32), authorized_slot)\n\n // Revert if authorized[msg.sender] == false\n if iszero(sload(keccak256(start, 64))) {\n // Revert with `Error(\"SENDER_NOT_AUTHORIZED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // `transferFrom`.\n // The function is marked `external`, so no abi decodeding is done for\n // us. Instead, we expect the `calldata` memory to contain the\n // following:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n //\n // (*): offset is computed from start of function parameters, so offset\n // by an additional 4 bytes in the calldata.\n //\n // (**): see table below to compute length of assetData Contents\n //\n // WARNING: The ABIv2 specification allows additional padding between\n // the Params and Data section. This will result in a larger\n // offset to assetData.\n\n // Asset data itself is encoded as follows:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 2 * 32 | function parameters: |\n // | | 4 | 12 + 20 | 1. token address |\n // | | 36 | | 2. tokenId |\n \n // We construct calldata for the `token.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n // \n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 4 | | 1. from |\n // | | 36 | | 2. to |\n // | | 68 | | 3. tokenId |\n\n // There exists only 1 of each token.\n // require(amount == 1, \"INVALID_AMOUNT\")\n if sub(calldataload(100), 1) {\n // Revert with `Error(\"INVALID_AMOUNT\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000e494e56414c49445f414d4f554e540000000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFrom` selector.\n // Any trailing data in transferFromSelector will be\n // overwritten in the next `mstore` call.\n mstore(0, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // We copy the fields `from` and `to` in bulk\n // from our own calldata to the new calldata.\n calldatacopy(4, 36, 64)\n\n // Copy `tokenId` field from our own calldata to the new calldata.\n let assetDataOffset := calldataload(4)\n calldatacopy(68, add(assetDataOffset, 72), 32)\n\n /////// Call `token.transferFrom` using the calldata ///////\n let token := calldataload(add(assetDataOffset, 40))\n let success := call(\n gas, // forward all gas\n token, // call address of token contract\n 0, // don't send any ETH\n 0, // pointer to start of input\n 100, // length of input\n 0, // write output to null\n 0 // output size is 0 bytes\n )\n if success {\n return(0, 0)\n }\n \n // Revert with `Error(\"TRANSFER_FAILED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // Revert if undefined function is called\n revert(0, 0)\n }\n }\n\n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4)\n {\n return PROXY_ID;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/MixinAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"./mixins/MAuthorizable.sol\";\n\n\ncontract MixinAuthorizable is\n Ownable,\n MAuthorizable\n{\n /// @dev Only authorized addresses can invoke functions with this modifier.\n modifier onlyAuthorized {\n require(\n authorized[msg.sender],\n \"SENDER_NOT_AUTHORIZED\"\n );\n _;\n }\n\n mapping (address => bool) public authorized;\n address[] public authorities;\n\n /// @dev Authorizes an address.\n /// @param target Address to authorize.\n function addAuthorizedAddress(address target)\n external\n onlyOwner\n {\n require(\n !authorized[target],\n \"TARGET_ALREADY_AUTHORIZED\"\n );\n\n authorized[target] = true;\n authorities.push(target);\n emit AuthorizedAddressAdded(target, msg.sender);\n }\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n function removeAuthorizedAddress(address target)\n external\n onlyOwner\n {\n require(\n authorized[target],\n \"TARGET_NOT_AUTHORIZED\"\n );\n\n delete authorized[target];\n for (uint256 i = 0; i < authorities.length; i++) {\n if (authorities[i] == target) {\n authorities[i] = authorities[authorities.length - 1];\n authorities.length -= 1;\n break;\n }\n }\n emit AuthorizedAddressRemoved(target, msg.sender);\n }\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n /// @param index Index of target in authorities array.\n function removeAuthorizedAddressAtIndex(\n address target,\n uint256 index\n )\n external\n onlyOwner\n {\n require(\n authorized[target],\n \"TARGET_NOT_AUTHORIZED\"\n );\n require(\n index < authorities.length,\n \"INDEX_OUT_OF_BOUNDS\"\n );\n require(\n authorities[index] == target,\n \"AUTHORIZED_ADDRESS_MISMATCH\"\n );\n\n delete authorized[target];\n authorities[index] = authorities[authorities.length - 1];\n authorities.length -= 1;\n emit AuthorizedAddressRemoved(target, msg.sender);\n }\n\n /// @dev Gets all authorized addresses.\n /// @return Array of authorized addresses.\n function getAuthorizedAddresses()\n external\n view\n returns (address[] memory)\n {\n return authorities;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IAuthorizable.sol\";\n\n\ncontract IAssetProxy is\n IAuthorizable\n{\n /// @dev Transfers assets. Either succeeds or throws.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param from Address to transfer asset from.\n /// @param to Address to transfer asset to.\n /// @param amount Amount of asset to transfer.\n function transferFrom(\n bytes assetData,\n address from,\n address to,\n uint256 amount\n )\n external;\n \n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4);\n}\n",
- "2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/Ownable/IOwnable.sol\";\n\n\ncontract IAuthorizable is\n IOwnable\n{\n /// @dev Authorizes an address.\n /// @param target Address to authorize.\n function addAuthorizedAddress(address target)\n external;\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n function removeAuthorizedAddress(address target)\n external;\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n /// @param index Index of target in authorities array.\n function removeAuthorizedAddressAtIndex(\n address target,\n uint256 index\n )\n external;\n \n /// @dev Gets all authorized addresses.\n /// @return Array of authorized addresses.\n function getAuthorizedAddresses()\n external\n view\n returns (address[] memory);\n}\n",
- "2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAuthorizable.sol\";\n\n\ncontract MAuthorizable is\n IAuthorizable\n{\n // Event logged when a new address is authorized.\n event AuthorizedAddressAdded(\n address indexed target,\n address indexed caller\n );\n\n // Event logged when a currently authorized address is unauthorized.\n event AuthorizedAddressRemoved(\n address indexed target,\n address indexed caller\n );\n\n /// @dev Only authorized addresses can invoke functions with this modifier.\n modifier onlyAuthorized { revert(); _; }\n}\n",
- "2.0.0/protocol/AssetProxyOwner/AssetProxyOwner.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../multisig/MultiSigWalletWithTimeLock.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\n\n\ncontract AssetProxyOwner is\n MultiSigWalletWithTimeLock\n{\n using LibBytes for bytes;\n\n event AssetProxyRegistration(address assetProxyContract, bool isRegistered);\n\n // Mapping of AssetProxy contract address =>\n // if this contract is allowed to call the AssetProxy's `removeAuthorizedAddressAtIndex` method without a time lock.\n mapping (address => bool) public isAssetProxyRegistered;\n\n bytes4 constant internal REMOVE_AUTHORIZED_ADDRESS_AT_INDEX_SELECTOR = bytes4(keccak256(\"removeAuthorizedAddressAtIndex(address,uint256)\"));\n\n /// @dev Function will revert if the transaction does not call `removeAuthorizedAddressAtIndex`\n /// on an approved AssetProxy contract.\n modifier validRemoveAuthorizedAddressAtIndexTx(uint256 transactionId) {\n Transaction storage txn = transactions[transactionId];\n require(\n isAssetProxyRegistered[txn.destination],\n \"UNREGISTERED_ASSET_PROXY\"\n );\n require(\n txn.data.readBytes4(0) == REMOVE_AUTHORIZED_ADDRESS_AT_INDEX_SELECTOR,\n \"INVALID_FUNCTION_SELECTOR\"\n );\n _;\n }\n\n /// @dev Contract constructor sets initial owners, required number of confirmations,\n /// time lock, and list of AssetProxy addresses.\n /// @param _owners List of initial owners.\n /// @param _assetProxyContracts Array of AssetProxy contract addresses.\n /// @param _required Number of required confirmations.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n constructor (\n address[] memory _owners,\n address[] memory _assetProxyContracts,\n uint256 _required,\n uint256 _secondsTimeLocked\n )\n public\n MultiSigWalletWithTimeLock(_owners, _required, _secondsTimeLocked)\n {\n for (uint256 i = 0; i < _assetProxyContracts.length; i++) {\n address assetProxy = _assetProxyContracts[i];\n require(\n assetProxy != address(0),\n \"INVALID_ASSET_PROXY\"\n );\n isAssetProxyRegistered[assetProxy] = true;\n }\n }\n\n /// @dev Registers or deregisters an AssetProxy to be able to execute\n /// `removeAuthorizedAddressAtIndex` without a timelock.\n /// @param assetProxyContract Address of AssetProxy contract.\n /// @param isRegistered Status of approval for AssetProxy contract.\n function registerAssetProxy(address assetProxyContract, bool isRegistered)\n public\n onlyWallet\n notNull(assetProxyContract)\n {\n isAssetProxyRegistered[assetProxyContract] = isRegistered;\n emit AssetProxyRegistration(assetProxyContract, isRegistered);\n }\n\n /// @dev Allows execution of `removeAuthorizedAddressAtIndex` without time lock.\n /// @param transactionId Transaction ID.\n function executeRemoveAuthorizedAddressAtIndex(uint256 transactionId)\n public\n notExecuted(transactionId)\n fullyConfirmed(transactionId)\n validRemoveAuthorizedAddressAtIndexTx(transactionId)\n {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) {\n emit Execution(transactionId);\n } else {\n emit ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/Exchange.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./MixinExchangeCore.sol\";\nimport \"./MixinSignatureValidator.sol\";\nimport \"./MixinWrapperFunctions.sol\";\nimport \"./MixinAssetProxyDispatcher.sol\";\nimport \"./MixinTransactions.sol\";\nimport \"./MixinMatchOrders.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract Exchange is\n MixinExchangeCore,\n MixinMatchOrders,\n MixinSignatureValidator,\n MixinTransactions,\n MixinAssetProxyDispatcher,\n MixinWrapperFunctions\n{\n string constant public VERSION = \"2.0.0\";\n\n // Mixins are instantiated in the order they are inherited\n constructor ()\n public\n MixinExchangeCore()\n MixinMatchOrders()\n MixinSignatureValidator()\n MixinTransactions()\n MixinAssetProxyDispatcher()\n MixinWrapperFunctions()\n {}\n}\n",
- "2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\nimport \"../AssetProxy/interfaces/IAssetProxy.sol\";\n\n\ncontract MixinAssetProxyDispatcher is\n Ownable,\n MAssetProxyDispatcher\n{\n // Mapping from Asset Proxy Id's to their respective Asset Proxy\n mapping (bytes4 => IAssetProxy) public assetProxies;\n\n /// @dev Registers an asset proxy to its asset proxy id.\n /// Once an asset proxy is registered, it cannot be unregistered.\n /// @param assetProxy Address of new asset proxy to register.\n function registerAssetProxy(address assetProxy)\n external\n onlyOwner\n {\n IAssetProxy assetProxyContract = IAssetProxy(assetProxy);\n\n // Ensure that no asset proxy exists with current id.\n bytes4 assetProxyId = assetProxyContract.getProxyId();\n address currentAssetProxy = assetProxies[assetProxyId];\n require(\n currentAssetProxy == address(0),\n \"ASSET_PROXY_ALREADY_EXISTS\"\n );\n\n // Add asset proxy and log registration.\n assetProxies[assetProxyId] = assetProxyContract;\n emit AssetProxyRegistered(\n assetProxyId,\n assetProxy\n );\n }\n\n /// @dev Gets an asset proxy.\n /// @param assetProxyId Id of the asset proxy.\n /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered.\n function getAssetProxy(bytes4 assetProxyId)\n external\n view\n returns (address)\n {\n return assetProxies[assetProxyId];\n }\n\n /// @dev Forwards arguments to assetProxy and calls `transferFrom`. Either succeeds or throws.\n /// @param assetData Byte array encoded for the asset.\n /// @param from Address to transfer token from.\n /// @param to Address to transfer token to.\n /// @param amount Amount of token to transfer.\n function dispatchTransferFrom(\n bytes memory assetData,\n address from,\n address to,\n uint256 amount\n )\n internal\n {\n // Do nothing if no amount should be transferred.\n if (amount > 0 && from != to) {\n // Ensure assetData length is valid\n require(\n assetData.length > 3,\n \"LENGTH_GREATER_THAN_3_REQUIRED\"\n );\n \n // Lookup assetProxy. We do not use `LibBytes.readBytes4` for gas efficiency reasons.\n bytes4 assetProxyId;\n assembly {\n assetProxyId := and(mload(\n add(assetData, 32)),\n 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000\n )\n }\n address assetProxy = assetProxies[assetProxyId];\n\n // Ensure that assetProxy exists\n require(\n assetProxy != address(0),\n \"ASSET_PROXY_DOES_NOT_EXIST\"\n );\n \n // We construct calldata for the `assetProxy.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n // \n // | Area | Offset | Length | Contents |\n // | -------- |--------|---------|-------------------------------------------- |\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n\n assembly {\n /////// Setup State ///////\n // `cdStart` is the start of the calldata for `assetProxy.transferFrom` (equal to free memory ptr).\n let cdStart := mload(64)\n // `dataAreaLength` is the total number of words needed to store `assetData`\n // As-per the ABI spec, this value is padded up to the nearest multiple of 32,\n // and includes 32-bytes for length.\n let dataAreaLength := and(add(mload(assetData), 63), 0xFFFFFFFFFFFE0)\n // `cdEnd` is the end of the calldata for `assetProxy.transferFrom`.\n let cdEnd := add(cdStart, add(132, dataAreaLength))\n\n \n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFromSelector`.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n mstore(cdStart, 0xa85e59e400000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // Each parameter is padded to 32-bytes. The entire Params Area is 128 bytes.\n // Notes:\n // 1. The offset to `assetData` is the length of the Params Area (128 bytes).\n // 2. A 20-byte mask is applied to addresses to zero-out the unused bytes.\n mstore(add(cdStart, 4), 128)\n mstore(add(cdStart, 36), and(from, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(cdStart, 68), and(to, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(cdStart, 100), amount)\n \n /////// Setup Data Area ///////\n // This area holds `assetData`.\n let dataArea := add(cdStart, 132)\n // solhint-disable-next-line no-empty-blocks\n for {} lt(dataArea, cdEnd) {} {\n mstore(dataArea, mload(assetData))\n dataArea := add(dataArea, 32)\n assetData := add(assetData, 32)\n }\n\n /////// Call `assetProxy.transferFrom` using the constructed calldata ///////\n let success := call(\n gas, // forward all gas\n assetProxy, // call address of asset proxy\n 0, // don't send any ETH\n cdStart, // pointer to start of input\n sub(cdEnd, cdStart), // length of input \n cdStart, // write output over input\n 512 // reserve 512 bytes for output\n )\n if iszero(success) {\n revert(cdStart, returndatasize())\n }\n }\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\n\n\ncontract MixinExchangeCore is\n ReentrancyGuard,\n LibConstants,\n LibMath,\n LibOrder,\n LibFillResults,\n MAssetProxyDispatcher,\n MExchangeCore,\n MSignatureValidator,\n MTransactions\n{\n // Mapping of orderHash => amount of takerAsset already bought by maker\n mapping (bytes32 => uint256) public filled;\n\n // Mapping of orderHash => cancelled\n mapping (bytes32 => bool) public cancelled;\n\n // Mapping of makerAddress => senderAddress => lowest salt an order can have in order to be fillable\n // Orders with specified senderAddress and with a salt less than their epoch are considered cancelled\n mapping (address => mapping (address => uint256)) public orderEpoch;\n\n /// @dev Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch\n /// and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress).\n /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled.\n function cancelOrdersUpTo(uint256 targetOrderEpoch)\n external\n nonReentrant\n {\n address makerAddress = getCurrentContextAddress();\n // If this function is called via `executeTransaction`, we only update the orderEpoch for the makerAddress/msg.sender combination.\n // This allows external filter contracts to add rules to how orders are cancelled via this function.\n address senderAddress = makerAddress == msg.sender ? address(0) : msg.sender;\n\n // orderEpoch is initialized to 0, so to cancelUpTo we need salt + 1\n uint256 newOrderEpoch = targetOrderEpoch + 1; \n uint256 oldOrderEpoch = orderEpoch[makerAddress][senderAddress];\n\n // Ensure orderEpoch is monotonically increasing\n require(\n newOrderEpoch > oldOrderEpoch, \n \"INVALID_NEW_ORDER_EPOCH\"\n );\n\n // Update orderEpoch\n orderEpoch[makerAddress][senderAddress] = newOrderEpoch;\n emit CancelUpTo(\n makerAddress,\n senderAddress,\n newOrderEpoch\n );\n }\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrder(\n Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n nonReentrant\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n return fillResults;\n }\n\n /// @dev After calling, the order can not be filled anymore.\n /// Throws if order is invalid or sender does not have permission to cancel.\n /// @param order Order to cancel. Order must be OrderStatus.FILLABLE.\n function cancelOrder(Order memory order)\n public\n nonReentrant\n {\n cancelOrderInternal(order);\n }\n\n /// @dev Gets information about an order: status, hash, and amount filled.\n /// @param order Order to gather information on.\n /// @return OrderInfo Information about the order and its state.\n /// See LibOrder.OrderInfo for a complete description.\n function getOrderInfo(Order memory order)\n public\n view\n returns (OrderInfo memory orderInfo)\n {\n // Compute the order hash\n orderInfo.orderHash = getOrderHash(order);\n\n // Fetch filled amount\n orderInfo.orderTakerAssetFilledAmount = filled[orderInfo.orderHash];\n\n // If order.makerAssetAmount is zero, we also reject the order.\n // While the Exchange contract handles them correctly, they create\n // edge cases in the supporting infrastructure because they have\n // an 'infinite' price when computed by a simple division.\n if (order.makerAssetAmount == 0) {\n orderInfo.orderStatus = uint8(OrderStatus.INVALID_MAKER_ASSET_AMOUNT);\n return orderInfo;\n }\n\n // If order.takerAssetAmount is zero, then the order will always\n // be considered filled because 0 == takerAssetAmount == orderTakerAssetFilledAmount\n // Instead of distinguishing between unfilled and filled zero taker\n // amount orders, we choose not to support them.\n if (order.takerAssetAmount == 0) {\n orderInfo.orderStatus = uint8(OrderStatus.INVALID_TAKER_ASSET_AMOUNT);\n return orderInfo;\n }\n\n // Validate order availability\n if (orderInfo.orderTakerAssetFilledAmount >= order.takerAssetAmount) {\n orderInfo.orderStatus = uint8(OrderStatus.FULLY_FILLED);\n return orderInfo;\n }\n\n // Validate order expiration\n // solhint-disable-next-line not-rely-on-time\n if (block.timestamp >= order.expirationTimeSeconds) {\n orderInfo.orderStatus = uint8(OrderStatus.EXPIRED);\n return orderInfo;\n }\n\n // Check if order has been cancelled\n if (cancelled[orderInfo.orderHash]) {\n orderInfo.orderStatus = uint8(OrderStatus.CANCELLED);\n return orderInfo;\n }\n if (orderEpoch[order.makerAddress][order.senderAddress] > order.salt) {\n orderInfo.orderStatus = uint8(OrderStatus.CANCELLED);\n return orderInfo;\n }\n\n // All other statuses are ruled out: order is Fillable\n orderInfo.orderStatus = uint8(OrderStatus.FILLABLE);\n return orderInfo;\n }\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderInternal(\n Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n // Fetch order info\n OrderInfo memory orderInfo = getOrderInfo(order);\n\n // Fetch taker address\n address takerAddress = getCurrentContextAddress();\n \n // Assert that the order is fillable by taker\n assertFillableOrder(\n order,\n orderInfo,\n takerAddress,\n signature\n );\n \n // Get amount of takerAsset to fill\n uint256 remainingTakerAssetAmount = safeSub(order.takerAssetAmount, orderInfo.orderTakerAssetFilledAmount);\n uint256 takerAssetFilledAmount = min256(takerAssetFillAmount, remainingTakerAssetAmount);\n\n // Validate context\n assertValidFill(\n order,\n orderInfo,\n takerAssetFillAmount,\n takerAssetFilledAmount,\n fillResults.makerAssetFilledAmount\n );\n\n // Compute proportional fill amounts\n fillResults = calculateFillResults(order, takerAssetFilledAmount);\n\n // Update exchange internal state\n updateFilledState(\n order,\n takerAddress,\n orderInfo.orderHash,\n orderInfo.orderTakerAssetFilledAmount,\n fillResults\n );\n \n // Settle order\n settleOrder(\n order,\n takerAddress,\n fillResults\n );\n\n return fillResults;\n }\n\n /// @dev After calling, the order can not be filled anymore.\n /// Throws if order is invalid or sender does not have permission to cancel.\n /// @param order Order to cancel. Order must be OrderStatus.FILLABLE.\n function cancelOrderInternal(Order memory order)\n internal\n {\n // Fetch current order status\n OrderInfo memory orderInfo = getOrderInfo(order);\n\n // Validate context\n assertValidCancel(order, orderInfo);\n\n // Perform cancel\n updateCancelledState(order, orderInfo.orderHash);\n }\n\n /// @dev Updates state with results of a fill order.\n /// @param order that was filled.\n /// @param takerAddress Address of taker who filled the order.\n /// @param orderTakerAssetFilledAmount Amount of order already filled.\n function updateFilledState(\n Order memory order,\n address takerAddress,\n bytes32 orderHash,\n uint256 orderTakerAssetFilledAmount,\n FillResults memory fillResults\n )\n internal\n {\n // Update state\n filled[orderHash] = safeAdd(orderTakerAssetFilledAmount, fillResults.takerAssetFilledAmount);\n\n // Log order\n emit Fill(\n order.makerAddress,\n order.feeRecipientAddress,\n takerAddress,\n msg.sender,\n fillResults.makerAssetFilledAmount,\n fillResults.takerAssetFilledAmount,\n fillResults.makerFeePaid,\n fillResults.takerFeePaid,\n orderHash,\n order.makerAssetData,\n order.takerAssetData\n );\n }\n\n /// @dev Updates state with results of cancelling an order.\n /// State is only updated if the order is currently fillable.\n /// Otherwise, updating state would have no effect.\n /// @param order that was cancelled.\n /// @param orderHash Hash of order that was cancelled.\n function updateCancelledState(\n Order memory order,\n bytes32 orderHash\n )\n internal\n {\n // Perform cancel\n cancelled[orderHash] = true;\n\n // Log cancel\n emit Cancel(\n order.makerAddress,\n order.feeRecipientAddress,\n msg.sender,\n orderHash,\n order.makerAssetData,\n order.takerAssetData\n );\n }\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAddress Address of order taker.\n /// @param signature Proof that the orders was created by its maker.\n function assertFillableOrder(\n Order memory order,\n OrderInfo memory orderInfo,\n address takerAddress,\n bytes memory signature\n )\n internal\n view\n {\n // An order can only be filled if its status is FILLABLE.\n require(\n orderInfo.orderStatus == uint8(OrderStatus.FILLABLE),\n \"ORDER_UNFILLABLE\"\n );\n \n // Validate sender is allowed to fill this order\n if (order.senderAddress != address(0)) {\n require(\n order.senderAddress == msg.sender,\n \"INVALID_SENDER\"\n );\n }\n \n // Validate taker is allowed to fill this order\n if (order.takerAddress != address(0)) {\n require(\n order.takerAddress == takerAddress,\n \"INVALID_TAKER\"\n );\n }\n \n // Validate Maker signature (check only if first time seen)\n if (orderInfo.orderTakerAssetFilledAmount == 0) {\n require(\n isValidSignature(\n orderInfo.orderHash,\n order.makerAddress,\n signature\n ),\n \"INVALID_ORDER_SIGNATURE\"\n );\n }\n }\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAssetFillAmount Desired amount of order to fill by taker.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @param makerAssetFilledAmount Amount of makerAsset that will be transfered.\n function assertValidFill(\n Order memory order,\n OrderInfo memory orderInfo,\n uint256 takerAssetFillAmount, // TODO: use FillResults\n uint256 takerAssetFilledAmount,\n uint256 makerAssetFilledAmount\n )\n internal\n view\n {\n // Revert if fill amount is invalid\n // TODO: reconsider necessity for v2.1\n require(\n takerAssetFillAmount != 0,\n \"INVALID_TAKER_AMOUNT\"\n );\n \n // Make sure taker does not pay more than desired amount\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n takerAssetFilledAmount <= takerAssetFillAmount,\n \"TAKER_OVERPAY\"\n );\n \n // Make sure order is not overfilled\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n safeAdd(orderInfo.orderTakerAssetFilledAmount, takerAssetFilledAmount) <= order.takerAssetAmount,\n \"ORDER_OVERFILL\"\n );\n \n // Make sure order is filled at acceptable price.\n // The order has an implied price from the makers perspective:\n // order price = order.makerAssetAmount / order.takerAssetAmount\n // i.e. the number of makerAsset maker is paying per takerAsset. The\n // maker is guaranteed to get this price or a better (lower) one. The\n // actual price maker is getting in this fill is:\n // fill price = makerAssetFilledAmount / takerAssetFilledAmount\n // We need `fill price <= order price` for the fill to be fair to maker.\n // This amounts to:\n // makerAssetFilledAmount order.makerAssetAmount\n // ------------------------ <= -----------------------\n // takerAssetFilledAmount order.takerAssetAmount\n // or, equivalently:\n // makerAssetFilledAmount * order.takerAssetAmount <=\n // order.makerAssetAmount * takerAssetFilledAmount\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n safeMul(makerAssetFilledAmount, order.takerAssetAmount)\n <= \n safeMul(order.makerAssetAmount, takerAssetFilledAmount),\n \"INVALID_FILL_PRICE\"\n );\n }\n\n /// @dev Validates context for cancelOrder. Succeeds or throws.\n /// @param order to be cancelled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n function assertValidCancel(\n Order memory order,\n OrderInfo memory orderInfo\n )\n internal\n view\n {\n // Ensure order is valid\n // An order can only be cancelled if its status is FILLABLE.\n require(\n orderInfo.orderStatus == uint8(OrderStatus.FILLABLE),\n \"ORDER_UNFILLABLE\"\n );\n\n // Validate sender is allowed to cancel this order\n if (order.senderAddress != address(0)) {\n require(\n order.senderAddress == msg.sender,\n \"INVALID_SENDER\"\n );\n }\n\n // Validate transaction signed by maker\n address makerAddress = getCurrentContextAddress();\n require(\n order.makerAddress == makerAddress,\n \"INVALID_MAKER\"\n );\n }\n\n /// @dev Calculates amounts filled and fees paid by maker and taker.\n /// @param order to be filled.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function calculateFillResults(\n Order memory order,\n uint256 takerAssetFilledAmount\n )\n internal\n pure\n returns (FillResults memory fillResults)\n {\n // Compute proportional transfer amounts\n fillResults.takerAssetFilledAmount = takerAssetFilledAmount;\n fillResults.makerAssetFilledAmount = safeGetPartialAmountFloor(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.makerAssetAmount\n );\n fillResults.makerFeePaid = safeGetPartialAmountFloor(\n fillResults.makerAssetFilledAmount,\n order.makerAssetAmount,\n order.makerFee\n );\n fillResults.takerFeePaid = safeGetPartialAmountFloor(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.takerFee\n );\n\n return fillResults;\n }\n\n /// @dev Settles an order by transferring assets between counterparties.\n /// @param order Order struct containing order specifications.\n /// @param takerAddress Address selling takerAsset and buying makerAsset.\n /// @param fillResults Amounts to be filled and fees paid by maker and taker.\n function settleOrder(\n LibOrder.Order memory order,\n address takerAddress,\n LibFillResults.FillResults memory fillResults\n )\n private\n {\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n dispatchTransferFrom(\n order.makerAssetData,\n order.makerAddress,\n takerAddress,\n fillResults.makerAssetFilledAmount\n );\n dispatchTransferFrom(\n order.takerAssetData,\n takerAddress,\n order.makerAddress,\n fillResults.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n zrxAssetData,\n order.makerAddress,\n order.feeRecipientAddress,\n fillResults.makerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n order.feeRecipientAddress,\n fillResults.takerFeePaid\n );\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinMatchOrders.sol": "/*\n Copyright 2018 ZeroEx Intl.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n http://www.apache.org/licenses/LICENSE-2.0\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MMatchOrders.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\n\n\ncontract MixinMatchOrders is\n ReentrancyGuard,\n LibConstants,\n LibMath,\n MAssetProxyDispatcher,\n MExchangeCore,\n MMatchOrders,\n MTransactions\n{\n /// @dev Match two complementary orders that have a profitable spread.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the left order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftSignature Proof that order was created by the left maker.\n /// @param rightSignature Proof that order was created by the right maker.\n /// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.\n function matchOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n bytes memory leftSignature,\n bytes memory rightSignature\n )\n public\n nonReentrant\n returns (LibFillResults.MatchedFillResults memory matchedFillResults)\n {\n // We assume that rightOrder.takerAssetData == leftOrder.makerAssetData and rightOrder.makerAssetData == leftOrder.takerAssetData.\n // If this assumption isn't true, the match will fail at signature validation.\n rightOrder.makerAssetData = leftOrder.takerAssetData;\n rightOrder.takerAssetData = leftOrder.makerAssetData;\n\n // Get left & right order info\n LibOrder.OrderInfo memory leftOrderInfo = getOrderInfo(leftOrder);\n LibOrder.OrderInfo memory rightOrderInfo = getOrderInfo(rightOrder);\n\n // Fetch taker address\n address takerAddress = getCurrentContextAddress();\n \n // Either our context is valid or we revert\n assertFillableOrder(\n leftOrder,\n leftOrderInfo,\n takerAddress,\n leftSignature\n );\n assertFillableOrder(\n rightOrder,\n rightOrderInfo,\n takerAddress,\n rightSignature\n );\n assertValidMatch(leftOrder, rightOrder);\n\n // Compute proportional fill amounts\n matchedFillResults = calculateMatchedFillResults(\n leftOrder,\n rightOrder,\n leftOrderInfo.orderTakerAssetFilledAmount,\n rightOrderInfo.orderTakerAssetFilledAmount\n );\n\n // Validate fill contexts\n assertValidFill(\n leftOrder,\n leftOrderInfo,\n matchedFillResults.left.takerAssetFilledAmount,\n matchedFillResults.left.takerAssetFilledAmount,\n matchedFillResults.left.makerAssetFilledAmount\n );\n assertValidFill(\n rightOrder,\n rightOrderInfo,\n matchedFillResults.right.takerAssetFilledAmount,\n matchedFillResults.right.takerAssetFilledAmount,\n matchedFillResults.right.makerAssetFilledAmount\n );\n \n // Update exchange state\n updateFilledState(\n leftOrder,\n takerAddress,\n leftOrderInfo.orderHash,\n leftOrderInfo.orderTakerAssetFilledAmount,\n matchedFillResults.left\n );\n updateFilledState(\n rightOrder,\n takerAddress,\n rightOrderInfo.orderHash,\n rightOrderInfo.orderTakerAssetFilledAmount,\n matchedFillResults.right\n );\n\n // Settle matched orders. Succeeds or throws.\n settleMatchedOrders(\n leftOrder,\n rightOrder,\n takerAddress,\n matchedFillResults\n );\n\n return matchedFillResults;\n }\n\n /// @dev Validates context for matchOrders. Succeeds or throws.\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n function assertValidMatch(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder\n )\n internal\n pure\n {\n // Make sure there is a profitable spread.\n // There is a profitable spread iff the cost per unit bought (OrderA.MakerAmount/OrderA.TakerAmount) for each order is greater\n // than the profit per unit sold of the matched order (OrderB.TakerAmount/OrderB.MakerAmount).\n // This is satisfied by the equations below:\n // <leftOrder.makerAssetAmount> / <leftOrder.takerAssetAmount> >= <rightOrder.takerAssetAmount> / <rightOrder.makerAssetAmount>\n // AND\n // <rightOrder.makerAssetAmount> / <rightOrder.takerAssetAmount> >= <leftOrder.takerAssetAmount> / <leftOrder.makerAssetAmount>\n // These equations can be combined to get the following:\n require(\n safeMul(leftOrder.makerAssetAmount, rightOrder.makerAssetAmount) >=\n safeMul(leftOrder.takerAssetAmount, rightOrder.takerAssetAmount),\n \"NEGATIVE_SPREAD_REQUIRED\"\n );\n }\n\n /// @dev Calculates fill amounts for the matched orders.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the leftOrder order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftOrderTakerAssetFilledAmount Amount of left order already filled.\n /// @param rightOrderTakerAssetFilledAmount Amount of right order already filled.\n /// @param matchedFillResults Amounts to fill and fees to pay by maker and taker of matched orders.\n function calculateMatchedFillResults(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n uint256 leftOrderTakerAssetFilledAmount,\n uint256 rightOrderTakerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.MatchedFillResults memory matchedFillResults)\n {\n // Derive maker asset amounts for left & right orders, given store taker assert amounts\n uint256 leftTakerAssetAmountRemaining = safeSub(leftOrder.takerAssetAmount, leftOrderTakerAssetFilledAmount);\n uint256 leftMakerAssetAmountRemaining = safeGetPartialAmountFloor(\n leftOrder.makerAssetAmount,\n leftOrder.takerAssetAmount,\n leftTakerAssetAmountRemaining\n );\n uint256 rightTakerAssetAmountRemaining = safeSub(rightOrder.takerAssetAmount, rightOrderTakerAssetFilledAmount);\n uint256 rightMakerAssetAmountRemaining = safeGetPartialAmountFloor(\n rightOrder.makerAssetAmount,\n rightOrder.takerAssetAmount,\n rightTakerAssetAmountRemaining\n );\n\n // Calculate fill results for maker and taker assets: at least one order will be fully filled.\n // The maximum amount the left maker can buy is `leftTakerAssetAmountRemaining`\n // The maximum amount the right maker can sell is `rightMakerAssetAmountRemaining`\n // We have two distinct cases for calculating the fill results:\n // Case 1.\n // If the left maker can buy more than the right maker can sell, then only the right order is fully filled.\n // If the left maker can buy exactly what the right maker can sell, then both orders are fully filled.\n // Case 2.\n // If the left maker cannot buy more than the right maker can sell, then only the left order is fully filled.\n if (leftTakerAssetAmountRemaining >= rightMakerAssetAmountRemaining) {\n // Case 1: Right order is fully filled\n matchedFillResults.right.makerAssetFilledAmount = rightMakerAssetAmountRemaining;\n matchedFillResults.right.takerAssetFilledAmount = rightTakerAssetAmountRemaining;\n matchedFillResults.left.takerAssetFilledAmount = matchedFillResults.right.makerAssetFilledAmount;\n // Round down to ensure the maker's exchange rate does not exceed the price specified by the order. \n // We favor the maker when the exchange rate must be rounded.\n matchedFillResults.left.makerAssetFilledAmount = safeGetPartialAmountFloor(\n leftOrder.makerAssetAmount,\n leftOrder.takerAssetAmount,\n matchedFillResults.left.takerAssetFilledAmount\n );\n } else {\n // Case 2: Left order is fully filled\n matchedFillResults.left.makerAssetFilledAmount = leftMakerAssetAmountRemaining;\n matchedFillResults.left.takerAssetFilledAmount = leftTakerAssetAmountRemaining;\n matchedFillResults.right.makerAssetFilledAmount = matchedFillResults.left.takerAssetFilledAmount;\n // Round up to ensure the maker's exchange rate does not exceed the price specified by the order.\n // We favor the maker when the exchange rate must be rounded.\n matchedFillResults.right.takerAssetFilledAmount = safeGetPartialAmountCeil(\n rightOrder.takerAssetAmount,\n rightOrder.makerAssetAmount,\n matchedFillResults.right.makerAssetFilledAmount\n );\n }\n\n // Calculate amount given to taker\n matchedFillResults.leftMakerAssetSpreadAmount = safeSub(\n matchedFillResults.left.makerAssetFilledAmount,\n matchedFillResults.right.takerAssetFilledAmount\n );\n\n // Compute fees for left order\n matchedFillResults.left.makerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.left.makerAssetFilledAmount,\n leftOrder.makerAssetAmount,\n leftOrder.makerFee\n );\n matchedFillResults.left.takerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.left.takerAssetFilledAmount,\n leftOrder.takerAssetAmount,\n leftOrder.takerFee\n );\n\n // Compute fees for right order\n matchedFillResults.right.makerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.right.makerAssetFilledAmount,\n rightOrder.makerAssetAmount,\n rightOrder.makerFee\n );\n matchedFillResults.right.takerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.right.takerAssetFilledAmount,\n rightOrder.takerAssetAmount,\n rightOrder.takerFee\n );\n\n // Return fill results\n return matchedFillResults;\n }\n\n /// @dev Settles matched order by transferring appropriate funds between order makers, taker, and fee recipient.\n /// @param leftOrder First matched order.\n /// @param rightOrder Second matched order.\n /// @param takerAddress Address that matched the orders. The taker receives the spread between orders as profit.\n /// @param matchedFillResults Struct holding amounts to transfer between makers, taker, and fee recipients.\n function settleMatchedOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n address takerAddress,\n LibFillResults.MatchedFillResults memory matchedFillResults\n )\n private\n {\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n // Order makers and taker\n dispatchTransferFrom(\n leftOrder.makerAssetData,\n leftOrder.makerAddress,\n rightOrder.makerAddress,\n matchedFillResults.right.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n rightOrder.makerAssetData,\n rightOrder.makerAddress,\n leftOrder.makerAddress,\n matchedFillResults.left.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n leftOrder.makerAssetData,\n leftOrder.makerAddress,\n takerAddress,\n matchedFillResults.leftMakerAssetSpreadAmount\n );\n\n // Maker fees\n dispatchTransferFrom(\n zrxAssetData,\n leftOrder.makerAddress,\n leftOrder.feeRecipientAddress,\n matchedFillResults.left.makerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n rightOrder.makerAddress,\n rightOrder.feeRecipientAddress,\n matchedFillResults.right.makerFeePaid\n );\n\n // Taker fees\n if (leftOrder.feeRecipientAddress == rightOrder.feeRecipientAddress) {\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n leftOrder.feeRecipientAddress,\n safeAdd(\n matchedFillResults.left.takerFeePaid,\n matchedFillResults.right.takerFeePaid\n )\n );\n } else {\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n leftOrder.feeRecipientAddress,\n matchedFillResults.left.takerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n rightOrder.feeRecipientAddress,\n matchedFillResults.right.takerFeePaid\n );\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinSignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./interfaces/IWallet.sol\";\nimport \"./interfaces/IValidator.sol\";\n\n\ncontract MixinSignatureValidator is\n ReentrancyGuard,\n MSignatureValidator,\n MTransactions\n{\n using LibBytes for bytes;\n \n // Mapping of hash => signer => signed\n mapping (bytes32 => mapping (address => bool)) public preSigned;\n\n // Mapping of signer => validator => approved\n mapping (address => mapping (address => bool)) public allowedValidators;\n\n /// @dev Approves a hash on-chain using any valid signature type.\n /// After presigning a hash, the preSign signature type will become valid for that hash and signer.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n function preSign(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external\n {\n if (signerAddress != msg.sender) {\n require(\n isValidSignature(\n hash,\n signerAddress,\n signature\n ),\n \"INVALID_SIGNATURE\"\n );\n }\n preSigned[hash][signerAddress] = true;\n }\n\n /// @dev Approves/unnapproves a Validator contract to verify signatures on signer's behalf.\n /// @param validatorAddress Address of Validator contract.\n /// @param approval Approval or disapproval of Validator contract.\n function setSignatureValidatorApproval(\n address validatorAddress,\n bool approval\n )\n external\n nonReentrant\n {\n address signerAddress = getCurrentContextAddress();\n allowedValidators[signerAddress][validatorAddress] = approval;\n emit SignatureValidatorApproval(\n signerAddress,\n validatorAddress,\n approval\n );\n }\n\n /// @dev Verifies that a hash has been signed by the given signer.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes memory signature\n )\n public\n view\n returns (bool isValid)\n {\n require(\n signature.length > 0,\n \"LENGTH_GREATER_THAN_0_REQUIRED\"\n );\n\n // Pop last byte off of signature byte array.\n uint8 signatureTypeRaw = uint8(signature.popLastByte());\n\n // Ensure signature is supported\n require(\n signatureTypeRaw < uint8(SignatureType.NSignatureTypes),\n \"SIGNATURE_UNSUPPORTED\"\n );\n\n SignatureType signatureType = SignatureType(signatureTypeRaw);\n\n // Variables are not scoped in Solidity.\n uint8 v;\n bytes32 r;\n bytes32 s;\n address recovered;\n\n // Always illegal signature.\n // This is always an implicit option since a signer can create a\n // signature array with invalid type or length. We may as well make\n // it an explicit option. This aids testing and analysis. It is\n // also the initialization value for the enum type.\n if (signatureType == SignatureType.Illegal) {\n revert(\"SIGNATURE_ILLEGAL\");\n\n // Always invalid signature.\n // Like Illegal, this is always implicitly available and therefore\n // offered explicitly. It can be implicitly created by providing\n // a correctly formatted but incorrect signature.\n } else if (signatureType == SignatureType.Invalid) {\n require(\n signature.length == 0,\n \"LENGTH_0_REQUIRED\"\n );\n isValid = false;\n return isValid;\n\n // Signature using EIP712\n } else if (signatureType == SignatureType.EIP712) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n hash,\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n\n // Signed using web3.eth_sign\n } else if (signatureType == SignatureType.EthSign) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n keccak256(abi.encodePacked(\n \"\\x19Ethereum Signed Message:\\n32\",\n hash\n )),\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n\n // Signature verified by wallet contract.\n // If used with an order, the maker of the order is the wallet contract.\n } else if (signatureType == SignatureType.Wallet) {\n isValid = isValidWalletSignature(\n hash,\n signerAddress,\n signature\n );\n return isValid;\n\n // Signature verified by validator contract.\n // If used with an order, the maker of the order can still be an EOA.\n // A signature using this type should be encoded as:\n // | Offset | Length | Contents |\n // | 0x00 | x | Signature to validate |\n // | 0x00 + x | 20 | Address of validator contract |\n // | 0x14 + x | 1 | Signature type is always \"\\x06\" |\n } else if (signatureType == SignatureType.Validator) {\n // Pop last 20 bytes off of signature byte array.\n address validatorAddress = signature.popLast20Bytes();\n \n // Ensure signer has approved validator.\n if (!allowedValidators[signerAddress][validatorAddress]) {\n return false;\n }\n isValid = isValidValidatorSignature(\n validatorAddress,\n hash,\n signerAddress,\n signature\n );\n return isValid;\n\n // Signer signed hash previously using the preSign function.\n } else if (signatureType == SignatureType.PreSigned) {\n isValid = preSigned[hash][signerAddress];\n return isValid;\n }\n\n // Anything else is illegal (We do not return false because\n // the signature may actually be valid, just not in a format\n // that we currently support. In this case returning false\n // may lead the caller to incorrectly believe that the\n // signature was invalid.)\n revert(\"SIGNATURE_UNSUPPORTED\");\n }\n\n /// @dev Verifies signature using logic defined by Wallet contract.\n /// @param hash Any 32 byte hash.\n /// @param walletAddress Address that should have signed the given hash\n /// and defines its own signature verification method.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if signature is valid for given wallet..\n function isValidWalletSignature(\n bytes32 hash,\n address walletAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid)\n {\n bytes memory calldata = abi.encodeWithSelector(\n IWallet(walletAddress).isValidSignature.selector,\n hash,\n signature\n );\n assembly {\n let cdStart := add(calldata, 32)\n let success := staticcall(\n gas, // forward all gas\n walletAddress, // address of Wallet contract\n cdStart, // pointer to start of input\n mload(calldata), // length of input\n cdStart, // write output over input\n 32 // output size is 32 bytes\n )\n\n switch success\n case 0 {\n // Revert with `Error(\"WALLET_ERROR\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000c57414c4c45545f4552524f5200000000000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n case 1 {\n // Signature is valid if call did not revert and returned true\n isValid := mload(cdStart)\n }\n }\n return isValid;\n }\n\n /// @dev Verifies signature using logic defined by Validator contract.\n /// @param validatorAddress Address of validator contract.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidValidatorSignature(\n address validatorAddress,\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid)\n {\n bytes memory calldata = abi.encodeWithSelector(\n IValidator(signerAddress).isValidSignature.selector,\n hash,\n signerAddress,\n signature\n );\n assembly {\n let cdStart := add(calldata, 32)\n let success := staticcall(\n gas, // forward all gas\n validatorAddress, // address of Validator contract\n cdStart, // pointer to start of input\n mload(calldata), // length of input\n cdStart, // write output over input\n 32 // output size is 32 bytes\n )\n\n switch success\n case 0 {\n // Revert with `Error(\"VALIDATOR_ERROR\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f56414c494441544f525f4552524f5200000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n case 1 {\n // Signature is valid if call did not revert and returned true\n isValid := mload(cdStart)\n }\n }\n return isValid;\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinTransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\nimport \"./libs/LibExchangeErrors.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./libs/LibEIP712.sol\";\n\n\ncontract MixinTransactions is\n LibEIP712,\n MSignatureValidator,\n MTransactions\n{\n // Mapping of transaction hash => executed\n // This prevents transactions from being executed more than once.\n mapping (bytes32 => bool) public transactions;\n\n // Address of current transaction signer\n address public currentContextAddress;\n\n /// @dev Executes an exchange method call in the context of signer.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @param signature Proof of signer transaction by signer.\n function executeTransaction(\n uint256 salt,\n address signerAddress,\n bytes data,\n bytes signature\n )\n external\n {\n // Prevent reentrancy\n require(\n currentContextAddress == address(0),\n \"REENTRANCY_ILLEGAL\"\n );\n\n bytes32 transactionHash = hashEIP712Message(hashZeroExTransaction(\n salt,\n signerAddress,\n data\n ));\n\n // Validate transaction has not been executed\n require(\n !transactions[transactionHash],\n \"INVALID_TX_HASH\"\n );\n\n // Transaction always valid if signer is sender of transaction\n if (signerAddress != msg.sender) {\n // Validate signature\n require(\n isValidSignature(\n transactionHash,\n signerAddress,\n signature\n ),\n \"INVALID_TX_SIGNATURE\"\n );\n\n // Set the current transaction signer\n currentContextAddress = signerAddress;\n }\n\n // Execute transaction\n transactions[transactionHash] = true;\n require(\n address(this).delegatecall(data),\n \"FAILED_EXECUTION\"\n );\n\n // Reset current transaction signer if it was previously updated\n if (signerAddress != msg.sender) {\n currentContextAddress = address(0);\n }\n }\n\n /// @dev Calculates EIP712 hash of the Transaction.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @return EIP712 hash of the Transaction.\n function hashZeroExTransaction(\n uint256 salt,\n address signerAddress,\n bytes memory data\n )\n internal\n pure\n returns (bytes32 result)\n {\n bytes32 schemaHash = EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH;\n bytes32 dataHash = keccak256(data);\n\n // Assembly for more efficiently computing:\n // keccak256(abi.encodePacked(\n // EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH,\n // salt,\n // bytes32(signerAddress),\n // keccak256(data)\n // ));\n\n assembly {\n // Load free memory pointer\n let memPtr := mload(64)\n\n mstore(memPtr, schemaHash) // hash of schema\n mstore(add(memPtr, 32), salt) // salt\n mstore(add(memPtr, 64), and(signerAddress, 0xffffffffffffffffffffffffffffffffffffffff)) // signerAddress\n mstore(add(memPtr, 96), dataHash) // hash of data\n\n // Compute hash\n result := keccak256(memPtr, 128)\n }\n return result;\n }\n\n /// @dev The current function will be called in the context of this address (either 0x transaction signer or `msg.sender`).\n /// If calling a fill function, this address will represent the taker.\n /// If calling a cancel function, this address will represent the maker.\n /// @return Signer of 0x transaction if entry point is `executeTransaction`.\n /// `msg.sender` if entry point is any other function.\n function getCurrentContextAddress()\n internal\n view\n returns (address)\n {\n address currentContextAddress_ = currentContextAddress;\n address contextAddress = currentContextAddress_ == address(0) ? msg.sender : currentContextAddress_;\n return contextAddress;\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./libs/LibAbiEncoder.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MWrapperFunctions.sol\";\n\n\ncontract MixinWrapperFunctions is\n ReentrancyGuard,\n LibMath,\n LibFillResults,\n LibAbiEncoder,\n MExchangeCore,\n MWrapperFunctions\n{\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n nonReentrant\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrKillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n return fillResults;\n }\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (FillResults memory fillResults)\n {\n // ABI encode calldata for `fillOrder`\n bytes memory fillOrderCalldata = abiEncodeFillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n\n // Delegate to `fillOrder` and handle any exceptions gracefully\n assembly {\n let success := delegatecall(\n gas, // forward all gas\n address, // call address of this contract\n add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes)\n mload(fillOrderCalldata), // length of input\n fillOrderCalldata, // write output over input\n 128 // output size is 128 bytes\n )\n if success {\n mstore(fillResults, mload(fillOrderCalldata))\n mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32)))\n mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64)))\n mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96)))\n }\n }\n // fillResults values will be 0 by default if call was unsuccessful\n return fillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrKill.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrKillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrKillOrderInternal(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrders(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n bytes memory takerAssetData = orders[0].takerAssetData;\n \n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being sold by taker is the same for each order.\n // Rather than passing this in as calldata, we use the takerAssetData from the first order in all later orders.\n orders[i].takerAssetData = takerAssetData;\n\n // Calculate the remaining amount of takerAsset to sell\n uint256 remainingTakerAssetFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= takerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory takerAssetData = orders[0].takerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being sold by taker is the same for each order.\n // Rather than passing this in as calldata, we use the takerAssetData from the first order in all later orders.\n orders[i].takerAssetData = takerAssetData;\n\n // Calculate the remaining amount of takerAsset to sell\n uint256 remainingTakerAssetFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= takerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerAsset is bought by taker.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrders(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // Rather than passing this in as calldata, we copy the makerAssetData from the first order onto all later orders.\n orders[i].makerAssetData = makerAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n if (totalFillResults.makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // Rather than passing this in as calldata, we copy the makerAssetData from the first order onto all later orders.\n orders[i].makerAssetData = makerAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n if (totalFillResults.makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously cancels multiple orders in a single transaction.\n /// @param orders Array of order specifications.\n function batchCancelOrders(LibOrder.Order[] memory orders)\n public\n nonReentrant\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n cancelOrderInternal(orders[i]);\n }\n }\n\n /// @dev Fetches information for all passed in orders.\n /// @param orders Array of order specifications.\n /// @return Array of OrderInfo instances that correspond to each order.\n function getOrdersInfo(LibOrder.Order[] memory orders)\n public\n view\n returns (LibOrder.OrderInfo[] memory)\n {\n uint256 ordersLength = orders.length;\n LibOrder.OrderInfo[] memory ordersInfo = new LibOrder.OrderInfo[](ordersLength);\n for (uint256 i = 0; i != ordersLength; i++) {\n ordersInfo[i] = getOrderInfo(orders[i]);\n }\n return ordersInfo;\n }\n\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n require(\n fillResults.takerAssetFilledAmount == takerAssetFillAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return fillResults;\n }\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IAssetProxyDispatcher {\n\n /// @dev Registers an asset proxy to its asset proxy id.\n /// Once an asset proxy is registered, it cannot be unregistered.\n /// @param assetProxy Address of new asset proxy to register.\n function registerAssetProxy(address assetProxy)\n external;\n\n /// @dev Gets an asset proxy.\n /// @param assetProxyId Id of the asset proxy.\n /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered.\n function getAssetProxy(bytes4 assetProxyId)\n external\n view\n returns (address);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IExchange.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./IExchangeCore.sol\";\nimport \"./IMatchOrders.sol\";\nimport \"./ISignatureValidator.sol\";\nimport \"./ITransactions.sol\";\nimport \"./IAssetProxyDispatcher.sol\";\nimport \"./IWrapperFunctions.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract IExchange is\n IExchangeCore,\n IMatchOrders,\n ISignatureValidator,\n ITransactions,\n IAssetProxyDispatcher,\n IWrapperFunctions\n{}\n",
- "2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IExchangeCore {\n\n /// @dev Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch\n /// and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress).\n /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled.\n function cancelOrdersUpTo(uint256 targetOrderEpoch)\n external;\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev After calling, the order can not be filled anymore.\n /// @param order Order struct containing order specifications.\n function cancelOrder(LibOrder.Order memory order)\n public;\n\n /// @dev Gets information about an order: status, hash, and amount filled.\n /// @param order Order to gather information on.\n /// @return OrderInfo Information about the order and its state.\n /// See LibOrder.OrderInfo for a complete description.\n function getOrderInfo(LibOrder.Order memory order)\n public\n view\n returns (LibOrder.OrderInfo memory orderInfo);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IMatchOrders {\n\n /// @dev Match two complementary orders that have a profitable spread.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the left order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftSignature Proof that order was created by the left maker.\n /// @param rightSignature Proof that order was created by the right maker.\n /// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.\n function matchOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n bytes memory leftSignature,\n bytes memory rightSignature\n )\n public\n returns (LibFillResults.MatchedFillResults memory matchedFillResults);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract ISignatureValidator {\n\n /// @dev Approves a hash on-chain using any valid signature type.\n /// After presigning a hash, the preSign signature type will become valid for that hash and signer.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n function preSign(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external;\n \n /// @dev Approves/unnapproves a Validator contract to verify signatures on signer's behalf.\n /// @param validatorAddress Address of Validator contract.\n /// @param approval Approval or disapproval of Validator contract.\n function setSignatureValidatorApproval(\n address validatorAddress,\n bool approval\n )\n external;\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signerAddress Address of signer.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes memory signature\n )\n public\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/ITransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\n\ncontract ITransactions {\n\n /// @dev Executes an exchange method call in the context of signer.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @param signature Proof of signer transaction by signer.\n function executeTransaction(\n uint256 salt,\n address signerAddress,\n bytes data,\n bytes signature\n )\n external;\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IValidator {\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IWallet.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IWallet {\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n bytes signature\n )\n external\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IWrapperFunctions {\n\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrKill.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrKillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrders(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerAsset is bought by taker.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrders(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously cancels multiple orders in a single transaction.\n /// @param orders Array of order specifications.\n function batchCancelOrders(LibOrder.Order[] memory orders)\n public;\n\n /// @dev Fetches information for all passed in orders\n /// @param orders Array of order specifications.\n /// @return Array of OrderInfo instances that correspond to each order.\n function getOrdersInfo(LibOrder.Order[] memory orders)\n public\n view\n returns (LibOrder.OrderInfo[] memory);\n}\n",
- "2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./LibOrder.sol\";\n\n\ncontract LibAbiEncoder {\n\n /// @dev ABI encodes calldata for `fillOrder`.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return ABI encoded calldata for `fillOrder`.\n function abiEncodeFillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n pure\n returns (bytes memory fillOrderCalldata)\n {\n // We need to call MExchangeCore.fillOrder using a delegatecall in\n // assembly so that we can intercept a call that throws. For this, we\n // need the input encoded in memory in the Ethereum ABIv2 format [1].\n\n // | Area | Offset | Length | Contents |\n // | -------- |--------|---------|-------------------------------------------- |\n // | Header | 0x00 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 0x00 | | 1. offset to order (*) |\n // | | 0x20 | | 2. takerAssetFillAmount |\n // | | 0x40 | | 3. offset to signature (*) |\n // | Data | | 12 * 32 | order: |\n // | | 0x000 | | 1. senderAddress |\n // | | 0x020 | | 2. makerAddress |\n // | | 0x040 | | 3. takerAddress |\n // | | 0x060 | | 4. feeRecipientAddress |\n // | | 0x080 | | 5. makerAssetAmount |\n // | | 0x0A0 | | 6. takerAssetAmount |\n // | | 0x0C0 | | 7. makerFeeAmount |\n // | | 0x0E0 | | 8. takerFeeAmount |\n // | | 0x100 | | 9. expirationTimeSeconds |\n // | | 0x120 | | 10. salt |\n // | | 0x140 | | 11. Offset to makerAssetData (*) |\n // | | 0x160 | | 12. Offset to takerAssetData (*) |\n // | | 0x180 | 32 | makerAssetData Length |\n // | | 0x1A0 | ** | makerAssetData Contents |\n // | | 0x1C0 | 32 | takerAssetData Length |\n // | | 0x1E0 | ** | takerAssetData Contents |\n // | | 0x200 | 32 | signature Length |\n // | | 0x220 | ** | signature Contents |\n\n // * Offsets are calculated from the beginning of the current area: Header, Params, Data:\n // An offset stored in the Params area is calculated from the beginning of the Params section.\n // An offset stored in the Data area is calculated from the beginning of the Data section.\n\n // ** The length of dynamic array contents are stored in the field immediately preceeding the contents.\n\n // [1]: https://solidity.readthedocs.io/en/develop/abi-spec.html\n\n assembly {\n\n // Areas below may use the following variables:\n // 1. <area>Start -- Start of this area in memory\n // 2. <area>End -- End of this area in memory. This value may\n // be precomputed (before writing contents),\n // or it may be computed as contents are written.\n // 3. <area>Offset -- Current offset into area. If an area's End\n // is precomputed, this variable tracks the\n // offsets of contents as they are written.\n\n /////// Setup Header Area ///////\n // Load free memory pointer\n fillOrderCalldata := mload(0x40)\n // bytes4(keccak256(\"fillOrder((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),uint256,bytes)\"))\n // = 0xb4be83d5\n // Leave 0x20 bytes to store the length\n mstore(add(fillOrderCalldata, 0x20), 0xb4be83d500000000000000000000000000000000000000000000000000000000)\n let headerAreaEnd := add(fillOrderCalldata, 0x24)\n\n /////// Setup Params Area ///////\n // This area is preallocated and written to later.\n // This is because we need to fill in offsets that have not yet been calculated.\n let paramsAreaStart := headerAreaEnd\n let paramsAreaEnd := add(paramsAreaStart, 0x60)\n let paramsAreaOffset := paramsAreaStart\n\n /////// Setup Data Area ///////\n let dataAreaStart := paramsAreaEnd\n let dataAreaEnd := dataAreaStart\n\n // Offset from the source data we're reading from\n let sourceOffset := order\n // arrayLenBytes and arrayLenWords track the length of a dynamically-allocated bytes array.\n let arrayLenBytes := 0\n let arrayLenWords := 0\n\n /////// Write order Struct ///////\n // Write memory location of Order, relative to the start of the\n // parameter list, then increment the paramsAreaOffset respectively.\n mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))\n paramsAreaOffset := add(paramsAreaOffset, 0x20)\n\n // Write values for each field in the order\n // It would be nice to use a loop, but we save on gas by writing\n // the stores sequentially.\n mstore(dataAreaEnd, mload(sourceOffset)) // makerAddress\n mstore(add(dataAreaEnd, 0x20), mload(add(sourceOffset, 0x20))) // takerAddress\n mstore(add(dataAreaEnd, 0x40), mload(add(sourceOffset, 0x40))) // feeRecipientAddress\n mstore(add(dataAreaEnd, 0x60), mload(add(sourceOffset, 0x60))) // senderAddress\n mstore(add(dataAreaEnd, 0x80), mload(add(sourceOffset, 0x80))) // makerAssetAmount\n mstore(add(dataAreaEnd, 0xA0), mload(add(sourceOffset, 0xA0))) // takerAssetAmount\n mstore(add(dataAreaEnd, 0xC0), mload(add(sourceOffset, 0xC0))) // makerFeeAmount\n mstore(add(dataAreaEnd, 0xE0), mload(add(sourceOffset, 0xE0))) // takerFeeAmount\n mstore(add(dataAreaEnd, 0x100), mload(add(sourceOffset, 0x100))) // expirationTimeSeconds\n mstore(add(dataAreaEnd, 0x120), mload(add(sourceOffset, 0x120))) // salt\n mstore(add(dataAreaEnd, 0x140), mload(add(sourceOffset, 0x140))) // Offset to makerAssetData\n mstore(add(dataAreaEnd, 0x160), mload(add(sourceOffset, 0x160))) // Offset to takerAssetData\n dataAreaEnd := add(dataAreaEnd, 0x180)\n sourceOffset := add(sourceOffset, 0x180)\n\n // Write offset to <order.makerAssetData>\n mstore(add(dataAreaStart, mul(10, 0x20)), sub(dataAreaEnd, dataAreaStart))\n\n // Calculate length of <order.makerAssetData>\n sourceOffset := mload(add(order, 0x140)) // makerAssetData\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of <order.makerAssetData>\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of <order.makerAssetData>\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n // Write offset to <order.takerAssetData>\n mstore(add(dataAreaStart, mul(11, 0x20)), sub(dataAreaEnd, dataAreaStart))\n\n // Calculate length of <order.takerAssetData>\n sourceOffset := mload(add(order, 0x160)) // takerAssetData\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of <order.takerAssetData>\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of <order.takerAssetData>\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n /////// Write takerAssetFillAmount ///////\n mstore(paramsAreaOffset, takerAssetFillAmount)\n paramsAreaOffset := add(paramsAreaOffset, 0x20)\n\n /////// Write signature ///////\n // Write offset to paramsArea\n mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))\n\n // Calculate length of signature\n sourceOffset := signature\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of signature\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of signature\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n // Set length of calldata\n mstore(fillOrderCalldata, sub(dataAreaEnd, add(fillOrderCalldata, 0x20)))\n\n // Increment free memory pointer\n mstore(0x40, dataAreaEnd)\n }\n\n return fillOrderCalldata;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibConstants.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\n// solhint-disable max-line-length\ncontract LibConstants {\n \n // Asset data for ZRX token. Used for fee transfers.\n // @TODO: Hardcode constant when we deploy. Currently \n // not constant to make testing easier.\n\n // The proxyId for ZRX_ASSET_DATA is bytes4(keccak256(\"ERC20Token(address)\")) = 0xf47261b0\n \n // Kovan ZRX address is 0x6ff6c0ff1d68b964901f986d4c9fa3ac68346570.\n // The ABI encoded proxyId and address is 0xf47261b00000000000000000000000006ff6c0ff1d68b964901f986d4c9fa3ac68346570\n // bytes constant public ZRX_ASSET_DATA = \"\\xf4\\x72\\x61\\xb0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x6f\\xf6\\xc0\\xff\\x1d\\x68\\xb9\\x64\\x90\\x1f\\x98\\x6d\\x4c\\x9f\\xa3\\xac\\x68\\x34\\x65\\x70\";\n \n // Mainnet ZRX address is 0xe41d2489571d322189246dafa5ebde1f4699f498.\n // The ABI encoded proxyId and address is 0xf47261b0000000000000000000000000e41d2489571d322189246dafa5ebde1f4699f498\n bytes constant public ZRX_ASSET_DATA = \"\\xf4\\x72\\x61\\xb0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xe4\\x1d\\x24\\x89\\x57\\x1d\\x32\\x21\\x89\\x24\\x6d\\xaf\\xa5\\xeb\\xde\\x1f\\x46\\x99\\xf4\\x98\";\n}\n// solhint-enable max-line-length\n",
- "2.0.0/protocol/Exchange/libs/LibEIP712.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract LibEIP712 {\n\n // EIP191 header for EIP712 prefix\n string constant internal EIP191_HEADER = \"\\x19\\x01\";\n\n // EIP712 Domain Name value\n string constant internal EIP712_DOMAIN_NAME = \"0x Protocol\";\n\n // EIP712 Domain Version value\n string constant internal EIP712_DOMAIN_VERSION = \"2\";\n\n // Hash of the EIP712 Domain Separator Schema\n bytes32 constant internal EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"EIP712Domain(\",\n \"string name,\",\n \"string version,\",\n \"address verifyingContract\",\n \")\"\n ));\n\n // Hash of the EIP712 Domain Separator data\n // solhint-disable-next-line var-name-mixedcase\n bytes32 public EIP712_DOMAIN_HASH;\n\n constructor ()\n public\n {\n EIP712_DOMAIN_HASH = keccak256(abi.encodePacked(\n EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH,\n keccak256(bytes(EIP712_DOMAIN_NAME)),\n keccak256(bytes(EIP712_DOMAIN_VERSION)),\n bytes32(address(this))\n ));\n }\n\n /// @dev Calculates EIP712 encoding for a hash struct in this EIP712 Domain.\n /// @param hashStruct The EIP712 hash struct.\n /// @return EIP712 hash applied to this EIP712 Domain.\n function hashEIP712Message(bytes32 hashStruct)\n internal\n view\n returns (bytes32 result)\n {\n bytes32 eip712DomainHash = EIP712_DOMAIN_HASH;\n\n // Assembly for more efficient computing:\n // keccak256(abi.encodePacked(\n // EIP191_HEADER,\n // EIP712_DOMAIN_HASH,\n // hashStruct \n // ));\n\n assembly {\n // Load free memory pointer\n let memPtr := mload(64)\n\n mstore(memPtr, 0x1901000000000000000000000000000000000000000000000000000000000000) // EIP191 header\n mstore(add(memPtr, 2), eip712DomainHash) // EIP712 domain hash\n mstore(add(memPtr, 34), hashStruct) // Hash of struct\n\n // Compute hash\n result := keccak256(memPtr, 66)\n }\n return result;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\n// solhint-disable\npragma solidity 0.4.24;\n\n\n/// @dev This contract documents the revert reasons used in the Exchange contract.\n/// This contract is intended to serve as a reference, but is not actually used for efficiency reasons.\ncontract LibExchangeErrors {\n\n /// Order validation errors ///\n string constant ORDER_UNFILLABLE = \"ORDER_UNFILLABLE\"; // Order cannot be filled.\n string constant INVALID_MAKER = \"INVALID_MAKER\"; // Invalid makerAddress.\n string constant INVALID_TAKER = \"INVALID_TAKER\"; // Invalid takerAddress.\n string constant INVALID_SENDER = \"INVALID_SENDER\"; // Invalid `msg.sender`.\n string constant INVALID_ORDER_SIGNATURE = \"INVALID_ORDER_SIGNATURE\"; // Signature validation failed. \n \n /// fillOrder validation errors ///\n string constant INVALID_TAKER_AMOUNT = \"INVALID_TAKER_AMOUNT\"; // takerAssetFillAmount cannot equal 0.\n string constant ROUNDING_ERROR = \"ROUNDING_ERROR\"; // Rounding error greater than 0.1% of takerAssetFillAmount. \n \n /// Signature validation errors ///\n string constant INVALID_SIGNATURE = \"INVALID_SIGNATURE\"; // Signature validation failed. \n string constant SIGNATURE_ILLEGAL = \"SIGNATURE_ILLEGAL\"; // Signature type is illegal.\n string constant SIGNATURE_UNSUPPORTED = \"SIGNATURE_UNSUPPORTED\"; // Signature type unsupported.\n \n /// cancelOrdersUptTo errors ///\n string constant INVALID_NEW_ORDER_EPOCH = \"INVALID_NEW_ORDER_EPOCH\"; // Specified salt must be greater than or equal to existing orderEpoch.\n\n /// fillOrKillOrder errors ///\n string constant COMPLETE_FILL_FAILED = \"COMPLETE_FILL_FAILED\"; // Desired takerAssetFillAmount could not be completely filled. \n\n /// matchOrders errors ///\n string constant NEGATIVE_SPREAD_REQUIRED = \"NEGATIVE_SPREAD_REQUIRED\"; // Matched orders must have a negative spread.\n\n /// Transaction errors ///\n string constant REENTRANCY_ILLEGAL = \"REENTRANCY_ILLEGAL\"; // Recursive reentrancy is not allowed. \n string constant INVALID_TX_HASH = \"INVALID_TX_HASH\"; // Transaction has already been executed. \n string constant INVALID_TX_SIGNATURE = \"INVALID_TX_SIGNATURE\"; // Signature validation failed. \n string constant FAILED_EXECUTION = \"FAILED_EXECUTION\"; // Transaction execution failed. \n \n /// registerAssetProxy errors ///\n string constant ASSET_PROXY_ALREADY_EXISTS = \"ASSET_PROXY_ALREADY_EXISTS\"; // AssetProxy with same id already exists.\n\n /// dispatchTransferFrom errors ///\n string constant ASSET_PROXY_DOES_NOT_EXIST = \"ASSET_PROXY_DOES_NOT_EXIST\"; // No assetProxy registered at given id.\n string constant TRANSFER_FAILED = \"TRANSFER_FAILED\"; // Asset transfer unsuccesful.\n\n /// Length validation errors ///\n string constant LENGTH_GREATER_THAN_0_REQUIRED = \"LENGTH_GREATER_THAN_0_REQUIRED\"; // Byte array must have a length greater than 0.\n string constant LENGTH_GREATER_THAN_3_REQUIRED = \"LENGTH_GREATER_THAN_3_REQUIRED\"; // Byte array must have a length greater than 3.\n string constant LENGTH_0_REQUIRED = \"LENGTH_0_REQUIRED\"; // Byte array must have a length of 0.\n string constant LENGTH_65_REQUIRED = \"LENGTH_65_REQUIRED\"; // Byte array must have a length of 65.\n}\n",
- "2.0.0/protocol/Exchange/libs/LibFillResults.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract LibFillResults is\n SafeMath\n{\n struct FillResults {\n uint256 makerAssetFilledAmount; // Total amount of makerAsset(s) filled.\n uint256 takerAssetFilledAmount; // Total amount of takerAsset(s) filled.\n uint256 makerFeePaid; // Total amount of ZRX paid by maker(s) to feeRecipient(s).\n uint256 takerFeePaid; // Total amount of ZRX paid by taker to feeRecipients(s).\n }\n\n struct MatchedFillResults {\n FillResults left; // Amounts filled and fees paid of left order.\n FillResults right; // Amounts filled and fees paid of right order.\n uint256 leftMakerAssetSpreadAmount; // Spread between price of left and right order, denominated in the left order's makerAsset, paid to taker.\n }\n\n /// @dev Adds properties of both FillResults instances.\n /// Modifies the first FillResults instance specified.\n /// @param totalFillResults Fill results instance that will be added onto.\n /// @param singleFillResults Fill results instance that will be added to totalFillResults.\n function addFillResults(FillResults memory totalFillResults, FillResults memory singleFillResults)\n internal\n pure\n {\n totalFillResults.makerAssetFilledAmount = safeAdd(totalFillResults.makerAssetFilledAmount, singleFillResults.makerAssetFilledAmount);\n totalFillResults.takerAssetFilledAmount = safeAdd(totalFillResults.takerAssetFilledAmount, singleFillResults.takerAssetFilledAmount);\n totalFillResults.makerFeePaid = safeAdd(totalFillResults.makerFeePaid, singleFillResults.makerFeePaid);\n totalFillResults.takerFeePaid = safeAdd(totalFillResults.takerFeePaid, singleFillResults.takerFeePaid);\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibMath.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract LibMath is\n SafeMath\n{\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// Reverts if rounding error is >= 0.1%\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded down.\n function safeGetPartialAmountFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n require(\n !isRoundingErrorFloor(\n numerator,\n denominator,\n target\n ),\n \"ROUNDING_ERROR\"\n );\n \n partialAmount = safeDiv(\n safeMul(numerator, target),\n denominator\n );\n return partialAmount;\n }\n\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// Reverts if rounding error is >= 0.1%\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded up.\n function safeGetPartialAmountCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n require(\n !isRoundingErrorCeil(\n numerator,\n denominator,\n target\n ),\n \"ROUNDING_ERROR\"\n );\n \n // safeDiv computes `floor(a / b)`. We use the identity (a, b integer):\n // ceil(a / b) = floor((a + b - 1) / b)\n // To implement `ceil(a / b)` using safeDiv.\n partialAmount = safeDiv(\n safeAdd(\n safeMul(numerator, target),\n safeSub(denominator, 1)\n ),\n denominator\n );\n return partialAmount;\n }\n\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded down.\n function getPartialAmountFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n partialAmount = safeDiv(\n safeMul(numerator, target),\n denominator\n );\n return partialAmount;\n }\n \n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded up.\n function getPartialAmountCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n // safeDiv computes `floor(a / b)`. We use the identity (a, b integer):\n // ceil(a / b) = floor((a + b - 1) / b)\n // To implement `ceil(a / b)` using safeDiv.\n partialAmount = safeDiv(\n safeAdd(\n safeMul(numerator, target),\n safeSub(denominator, 1)\n ),\n denominator\n );\n return partialAmount;\n }\n \n /// @dev Checks if rounding error >= 0.1% when rounding down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to multiply with numerator/denominator.\n /// @return Rounding error is present.\n function isRoundingErrorFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (bool isError)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n \n // The absolute rounding error is the difference between the rounded\n // value and the ideal value. The relative rounding error is the\n // absolute rounding error divided by the absolute value of the\n // ideal value. This is undefined when the ideal value is zero.\n //\n // The ideal value is `numerator * target / denominator`.\n // Let's call `numerator * target % denominator` the remainder.\n // The absolute error is `remainder / denominator`.\n //\n // When the ideal value is zero, we require the absolute error to\n // be zero. Fortunately, this is always the case. The ideal value is\n // zero iff `numerator == 0` and/or `target == 0`. In this case the\n // remainder and absolute error are also zero. \n if (target == 0 || numerator == 0) {\n return false;\n }\n \n // Otherwise, we want the relative rounding error to be strictly\n // less than 0.1%.\n // The relative error is `remainder / (numerator * target)`.\n // We want the relative error less than 1 / 1000:\n // remainder / (numerator * denominator) < 1 / 1000\n // or equivalently:\n // 1000 * remainder < numerator * target\n // so we have a rounding error iff:\n // 1000 * remainder >= numerator * target\n uint256 remainder = mulmod(\n target,\n numerator,\n denominator\n );\n isError = safeMul(1000, remainder) >= safeMul(numerator, target);\n return isError;\n }\n \n /// @dev Checks if rounding error >= 0.1% when rounding up.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to multiply with numerator/denominator.\n /// @return Rounding error is present.\n function isRoundingErrorCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (bool isError)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n \n // See the comments in `isRoundingError`.\n if (target == 0 || numerator == 0) {\n // When either is zero, the ideal value and rounded value are zero\n // and there is no rounding error. (Although the relative error\n // is undefined.)\n return false;\n }\n // Compute remainder as before\n uint256 remainder = mulmod(\n target,\n numerator,\n denominator\n );\n remainder = safeSub(denominator, remainder) % denominator;\n isError = safeMul(1000, remainder) >= safeMul(numerator, target);\n return isError;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibOrder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./LibEIP712.sol\";\n\n\ncontract LibOrder is\n LibEIP712\n{\n // Hash for the EIP712 Order Schema\n bytes32 constant internal EIP712_ORDER_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"Order(\",\n \"address makerAddress,\",\n \"address takerAddress,\",\n \"address feeRecipientAddress,\",\n \"address senderAddress,\",\n \"uint256 makerAssetAmount,\",\n \"uint256 takerAssetAmount,\",\n \"uint256 makerFee,\",\n \"uint256 takerFee,\",\n \"uint256 expirationTimeSeconds,\",\n \"uint256 salt,\",\n \"bytes makerAssetData,\",\n \"bytes takerAssetData\",\n \")\"\n ));\n\n // A valid order remains fillable until it is expired, fully filled, or cancelled.\n // An order's state is unaffected by external factors, like account balances.\n enum OrderStatus {\n INVALID, // Default value\n INVALID_MAKER_ASSET_AMOUNT, // Order does not have a valid maker asset amount\n INVALID_TAKER_ASSET_AMOUNT, // Order does not have a valid taker asset amount\n FILLABLE, // Order is fillable\n EXPIRED, // Order has already expired\n FULLY_FILLED, // Order is fully filled\n CANCELLED // Order has been cancelled\n }\n\n // solhint-disable max-line-length\n struct Order {\n address makerAddress; // Address that created the order. \n address takerAddress; // Address that is allowed to fill the order. If set to 0, any address is allowed to fill the order. \n address feeRecipientAddress; // Address that will recieve fees when order is filled. \n address senderAddress; // Address that is allowed to call Exchange contract methods that affect this order. If set to 0, any address is allowed to call these methods.\n uint256 makerAssetAmount; // Amount of makerAsset being offered by maker. Must be greater than 0. \n uint256 takerAssetAmount; // Amount of takerAsset being bid on by maker. Must be greater than 0. \n uint256 makerFee; // Amount of ZRX paid to feeRecipient by maker when order is filled. If set to 0, no transfer of ZRX from maker to feeRecipient will be attempted.\n uint256 takerFee; // Amount of ZRX paid to feeRecipient by taker when order is filled. If set to 0, no transfer of ZRX from taker to feeRecipient will be attempted.\n uint256 expirationTimeSeconds; // Timestamp in seconds at which order expires. \n uint256 salt; // Arbitrary number to facilitate uniqueness of the order's hash. \n bytes makerAssetData; // Encoded data that can be decoded by a specified proxy contract when transferring makerAsset. The last byte references the id of this proxy.\n bytes takerAssetData; // Encoded data that can be decoded by a specified proxy contract when transferring takerAsset. The last byte references the id of this proxy.\n }\n // solhint-enable max-line-length\n\n struct OrderInfo {\n uint8 orderStatus; // Status that describes order's validity and fillability.\n bytes32 orderHash; // EIP712 hash of the order (see LibOrder.getOrderHash).\n uint256 orderTakerAssetFilledAmount; // Amount of order that has already been filled.\n }\n\n /// @dev Calculates Keccak-256 hash of the order.\n /// @param order The order structure.\n /// @return Keccak-256 EIP712 hash of the order.\n function getOrderHash(Order memory order)\n internal\n view\n returns (bytes32 orderHash)\n {\n orderHash = hashEIP712Message(hashOrder(order));\n return orderHash;\n }\n\n /// @dev Calculates EIP712 hash of the order.\n /// @param order The order structure.\n /// @return EIP712 hash of the order.\n function hashOrder(Order memory order)\n internal\n pure\n returns (bytes32 result)\n {\n bytes32 schemaHash = EIP712_ORDER_SCHEMA_HASH;\n bytes32 makerAssetDataHash = keccak256(order.makerAssetData);\n bytes32 takerAssetDataHash = keccak256(order.takerAssetData);\n\n // Assembly for more efficiently computing:\n // keccak256(abi.encodePacked(\n // EIP712_ORDER_SCHEMA_HASH,\n // bytes32(order.makerAddress),\n // bytes32(order.takerAddress),\n // bytes32(order.feeRecipientAddress),\n // bytes32(order.senderAddress),\n // order.makerAssetAmount,\n // order.takerAssetAmount,\n // order.makerFee,\n // order.takerFee,\n // order.expirationTimeSeconds,\n // order.salt,\n // keccak256(order.makerAssetData),\n // keccak256(order.takerAssetData)\n // ));\n\n assembly {\n // Calculate memory addresses that will be swapped out before hashing\n let pos1 := sub(order, 32)\n let pos2 := add(order, 320)\n let pos3 := add(order, 352)\n\n // Backup\n let temp1 := mload(pos1)\n let temp2 := mload(pos2)\n let temp3 := mload(pos3)\n \n // Hash in place\n mstore(pos1, schemaHash)\n mstore(pos2, makerAssetDataHash)\n mstore(pos3, takerAssetDataHash)\n result := keccak256(pos1, 416)\n \n // Restore\n mstore(pos1, temp1)\n mstore(pos2, temp2)\n mstore(pos3, temp3)\n }\n return result;\n }\n}\n",
- "2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAssetProxyDispatcher.sol\";\n\n\ncontract MAssetProxyDispatcher is\n IAssetProxyDispatcher\n{\n // Logs registration of new asset proxy\n event AssetProxyRegistered(\n bytes4 id, // Id of new registered AssetProxy.\n address assetProxy // Address of new registered AssetProxy.\n );\n\n /// @dev Forwards arguments to assetProxy and calls `transferFrom`. Either succeeds or throws.\n /// @param assetData Byte array encoded for the asset.\n /// @param from Address to transfer token from.\n /// @param to Address to transfer token to.\n /// @param amount Amount of token to transfer.\n function dispatchTransferFrom(\n bytes memory assetData,\n address from,\n address to,\n uint256 amount\n )\n internal;\n}\n",
- "2.0.0/protocol/Exchange/mixins/MExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IExchangeCore.sol\";\n\n\ncontract MExchangeCore is\n IExchangeCore\n{\n // Fill event is emitted whenever an order is filled.\n event Fill(\n address indexed makerAddress, // Address that created the order. \n address indexed feeRecipientAddress, // Address that received fees.\n address takerAddress, // Address that filled the order.\n address senderAddress, // Address that called the Exchange contract (msg.sender).\n uint256 makerAssetFilledAmount, // Amount of makerAsset sold by maker and bought by taker. \n uint256 takerAssetFilledAmount, // Amount of takerAsset sold by taker and bought by maker.\n uint256 makerFeePaid, // Amount of ZRX paid to feeRecipient by maker.\n uint256 takerFeePaid, // Amount of ZRX paid to feeRecipient by taker.\n bytes32 indexed orderHash, // EIP712 hash of order (see LibOrder.getOrderHash).\n bytes makerAssetData, // Encoded data specific to makerAsset. \n bytes takerAssetData // Encoded data specific to takerAsset.\n );\n\n // Cancel event is emitted whenever an individual order is cancelled.\n event Cancel(\n address indexed makerAddress, // Address that created the order. \n address indexed feeRecipientAddress, // Address that would have recieved fees if order was filled. \n address senderAddress, // Address that called the Exchange contract (msg.sender).\n bytes32 indexed orderHash, // EIP712 hash of order (see LibOrder.getOrderHash).\n bytes makerAssetData, // Encoded data specific to makerAsset. \n bytes takerAssetData // Encoded data specific to takerAsset.\n );\n\n // CancelUpTo event is emitted whenever `cancelOrdersUpTo` is executed succesfully.\n event CancelUpTo(\n address indexed makerAddress, // Orders cancelled must have been created by this address.\n address indexed senderAddress, // Orders cancelled must have a `senderAddress` equal to this address.\n uint256 orderEpoch // Orders with specified makerAddress and senderAddress with a salt less than this value are considered cancelled.\n );\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev After calling, the order can not be filled anymore.\n /// @param order Order struct containing order specifications.\n function cancelOrderInternal(LibOrder.Order memory order)\n internal;\n\n /// @dev Updates state with results of a fill order.\n /// @param order that was filled.\n /// @param takerAddress Address of taker who filled the order.\n /// @param orderTakerAssetFilledAmount Amount of order already filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function updateFilledState(\n LibOrder.Order memory order,\n address takerAddress,\n bytes32 orderHash,\n uint256 orderTakerAssetFilledAmount,\n LibFillResults.FillResults memory fillResults\n )\n internal;\n\n /// @dev Updates state with results of cancelling an order.\n /// State is only updated if the order is currently fillable.\n /// Otherwise, updating state would have no effect.\n /// @param order that was cancelled.\n /// @param orderHash Hash of order that was cancelled.\n function updateCancelledState(\n LibOrder.Order memory order,\n bytes32 orderHash\n )\n internal;\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAddress Address of order taker.\n /// @param signature Proof that the orders was created by its maker.\n function assertFillableOrder(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo,\n address takerAddress,\n bytes memory signature\n )\n internal\n view;\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo Status, orderHash, and amount already filled of order.\n /// @param takerAssetFillAmount Desired amount of order to fill by taker.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @param makerAssetFilledAmount Amount of makerAsset that will be transfered.\n function assertValidFill(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo,\n uint256 takerAssetFillAmount,\n uint256 takerAssetFilledAmount,\n uint256 makerAssetFilledAmount\n )\n internal\n view;\n\n /// @dev Validates context for cancelOrder. Succeeds or throws.\n /// @param order to be cancelled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n function assertValidCancel(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo\n )\n internal\n view;\n\n /// @dev Calculates amounts filled and fees paid by maker and taker.\n /// @param order to be filled.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function calculateFillResults(\n LibOrder.Order memory order,\n uint256 takerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.FillResults memory fillResults);\n\n}\n",
- "2.0.0/protocol/Exchange/mixins/MMatchOrders.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IMatchOrders.sol\";\n\n\ncontract MMatchOrders is\n IMatchOrders\n{\n /// @dev Validates context for matchOrders. Succeeds or throws.\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n function assertValidMatch(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder\n )\n internal\n pure;\n\n /// @dev Calculates fill amounts for the matched orders.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the leftOrder order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftOrderTakerAssetFilledAmount Amount of left order already filled.\n /// @param rightOrderTakerAssetFilledAmount Amount of right order already filled.\n /// @param matchedFillResults Amounts to fill and fees to pay by maker and taker of matched orders.\n function calculateMatchedFillResults(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n uint256 leftOrderTakerAssetFilledAmount,\n uint256 rightOrderTakerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.MatchedFillResults memory matchedFillResults);\n\n}\n",
- "2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/ISignatureValidator.sol\";\n\n\ncontract MSignatureValidator is\n ISignatureValidator\n{\n event SignatureValidatorApproval(\n address indexed signerAddress, // Address that approves or disapproves a contract to verify signatures.\n address indexed validatorAddress, // Address of signature validator contract.\n bool approved // Approval or disapproval of validator contract.\n );\n\n // Allowed signature types.\n enum SignatureType {\n Illegal, // 0x00, default value\n Invalid, // 0x01\n EIP712, // 0x02\n EthSign, // 0x03\n Wallet, // 0x04\n Validator, // 0x05\n PreSigned, // 0x06\n NSignatureTypes // 0x07, number of signature types. Always leave at end.\n }\n\n /// @dev Verifies signature using logic defined by Wallet contract.\n /// @param hash Any 32 byte hash.\n /// @param walletAddress Address that should have signed the given hash\n /// and defines its own signature verification method.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidWalletSignature(\n bytes32 hash,\n address walletAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid);\n\n /// @dev Verifies signature using logic defined by Validator contract.\n /// @param validatorAddress Address of validator contract.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidValidatorSignature(\n address validatorAddress,\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/mixins/MTransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\nimport \"../interfaces/ITransactions.sol\";\n\n\ncontract MTransactions is\n ITransactions\n{\n // Hash for the EIP712 ZeroEx Transaction Schema\n bytes32 constant internal EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"ZeroExTransaction(\",\n \"uint256 salt,\",\n \"address signerAddress,\",\n \"bytes data\",\n \")\"\n ));\n\n /// @dev Calculates EIP712 hash of the Transaction.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @return EIP712 hash of the Transaction.\n function hashZeroExTransaction(\n uint256 salt,\n address signerAddress,\n bytes memory data\n )\n internal\n pure\n returns (bytes32 result);\n\n /// @dev The current function will be called in the context of this address (either 0x transaction signer or `msg.sender`).\n /// If calling a fill function, this address will represent the taker.\n /// If calling a cancel function, this address will represent the maker.\n /// @return Signer of 0x transaction if entry point is `executeTransaction`.\n /// `msg.sender` if entry point is any other function.\n function getCurrentContextAddress()\n internal\n view\n returns (address);\n}\n",
- "2.0.0/protocol/Exchange/mixins/MWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IWrapperFunctions.sol\";\n\n\ncontract MWrapperFunctions is \n IWrapperFunctions\n{\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n}\n",
- "2.0.0/tokens/ERC20Token/IERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC20Token {\n\n // solhint-disable no-simple-event-func-name\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 _value\n );\n\n event Approval(\n address indexed _owner,\n address indexed _spender,\n uint256 _value\n );\n\n /// @dev send `value` token to `to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transfer(address _to, uint256 _value)\n external\n returns (bool);\n\n /// @dev send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool);\n \n /// @dev `msg.sender` approves `_spender` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Always true if the call has enough gas to complete execution\n function approve(address _spender, uint256 _value)\n external\n returns (bool);\n\n /// @dev Query total supply of token\n /// @return Total supply of token\n function totalSupply()\n external\n view\n returns (uint256);\n \n /// @param _owner The address from which the balance will be retrieved\n /// @return Balance of owner\n function balanceOf(address _owner)\n external\n view\n returns (uint256);\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender)\n external\n view\n returns (uint256);\n}\n",
- "2.0.0/tokens/ERC721Token/IERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC721Token {\n\n /// @dev This emits when ownership of any NFT changes by any mechanism.\n /// This event emits when NFTs are created (`from` == 0) and destroyed\n /// (`to` == 0). Exception: during contract creation, any number of NFTs\n /// may be created and assigned without emitting Transfer. At the time of\n /// any transfer, the approved address for that NFT (if any) is reset to none.\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 indexed _tokenId\n );\n\n /// @dev This emits when the approved address for an NFT is changed or\n /// reaffirmed. The zero address indicates there is no approved address.\n /// When a Transfer event emits, this also indicates that the approved\n /// address for that NFT (if any) is reset to none.\n event Approval(\n address indexed _owner,\n address indexed _approved,\n uint256 indexed _tokenId\n );\n\n /// @dev This emits when an operator is enabled or disabled for an owner.\n /// The operator can manage all NFTs of the owner.\n event ApprovalForAll(\n address indexed _owner,\n address indexed _operator,\n bool _approved\n );\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// perator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT. When transfer is complete, this function\n /// checks if `_to` is a smart contract (code size > 0). If so, it calls\n /// `onERC721Received` on `_to` and throws if the return value is not\n /// `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n /// @param _data Additional data with no specified format, sent in call to `_to`\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId,\n bytes _data\n )\n external;\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev This works identically to the other function with an extra data parameter,\n /// except this function just sets data to \"\".\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n external;\n\n /// @notice Change or reaffirm the approved address for an NFT\n /// @dev The zero address indicates there is no approved address.\n /// Throws unless `msg.sender` is the current NFT owner, or an authorized\n /// operator of the current owner.\n /// @param _approved The new approved NFT controller\n /// @param _tokenId The NFT to approve\n function approve(address _approved, uint256 _tokenId)\n external;\n\n /// @notice Enable or disable approval for a third party (\"operator\") to manage\n /// all of `msg.sender`'s assets\n /// @dev Emits the ApprovalForAll event. The contract MUST allow\n /// multiple operators per owner.\n /// @param _operator Address to add to the set of authorized operators\n /// @param _approved True if the operator is approved, false to revoke approval\n function setApprovalForAll(address _operator, bool _approved)\n external;\n\n /// @notice Count all NFTs assigned to an owner\n /// @dev NFTs assigned to the zero address are considered invalid, and this\n /// function throws for queries about the zero address.\n /// @param _owner An address for whom to query the balance\n /// @return The number of NFTs owned by `_owner`, possibly zero\n function balanceOf(address _owner)\n external\n view\n returns (uint256);\n\n /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE\n /// TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE\n /// THEY MAY BE PERMANENTLY LOST\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function transferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n public;\n\n /// @notice Find the owner of an NFT\n /// @dev NFTs assigned to zero address are considered invalid, and queries\n /// about them do throw.\n /// @param _tokenId The identifier for an NFT\n /// @return The address of the owner of the NFT\n function ownerOf(uint256 _tokenId)\n public\n view\n returns (address);\n\n /// @notice Get the approved address for a single NFT\n /// @dev Throws if `_tokenId` is not a valid NFT.\n /// @param _tokenId The NFT to find the approved address for\n /// @return The approved address for this NFT, or the zero address if there is none\n function getApproved(uint256 _tokenId) \n public\n view\n returns (address);\n \n /// @notice Query if an address is an authorized operator for another address\n /// @param _owner The address that owns the NFTs\n /// @param _operator The address that acts on behalf of the owner\n /// @return True if `_operator` is an approved operator for `_owner`, false otherwise\n function isApprovedForAll(address _owner, address _operator)\n public\n view\n returns (bool);\n}\n",
- "2.0.0/tokens/EtherToken/IEtherToken.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../ERC20Token/IERC20Token.sol\";\n\n\ncontract IEtherToken is\n IERC20Token\n{\n function deposit()\n public\n payable;\n \n function withdraw(uint256 amount)\n public;\n}\n",
- "2.0.0/utils/LibBytes/LibBytes.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\nlibrary LibBytes {\n\n using LibBytes for bytes;\n\n /// @dev Gets the memory address for a byte array.\n /// @param input Byte array to lookup.\n /// @return memoryAddress Memory address of byte array. This\n /// points to the header of the byte array which contains\n /// the length.\n function rawAddress(bytes memory input)\n internal\n pure\n returns (uint256 memoryAddress)\n {\n assembly {\n memoryAddress := input\n }\n return memoryAddress;\n }\n \n /// @dev Gets the memory address for the contents of a byte array.\n /// @param input Byte array to lookup.\n /// @return memoryAddress Memory address of the contents of the byte array.\n function contentAddress(bytes memory input)\n internal\n pure\n returns (uint256 memoryAddress)\n {\n assembly {\n memoryAddress := add(input, 32)\n }\n return memoryAddress;\n }\n\n /// @dev Copies `length` bytes from memory location `source` to `dest`.\n /// @param dest memory address to copy bytes to.\n /// @param source memory address to copy bytes from.\n /// @param length number of bytes to copy.\n function memCopy(\n uint256 dest,\n uint256 source,\n uint256 length\n )\n internal\n pure\n {\n if (length < 32) {\n // Handle a partial word by reading destination and masking\n // off the bits we are interested in.\n // This correctly handles overlap, zero lengths and source == dest\n assembly {\n let mask := sub(exp(256, sub(32, length)), 1)\n let s := and(mload(source), not(mask))\n let d := and(mload(dest), mask)\n mstore(dest, or(s, d))\n }\n } else {\n // Skip the O(length) loop when source == dest.\n if (source == dest) {\n return;\n }\n\n // For large copies we copy whole words at a time. The final\n // word is aligned to the end of the range (instead of after the\n // previous) to handle partial words. So a copy will look like this:\n //\n // ####\n // ####\n // ####\n // ####\n //\n // We handle overlap in the source and destination range by\n // changing the copying direction. This prevents us from\n // overwriting parts of source that we still need to copy.\n //\n // This correctly handles source == dest\n //\n if (source > dest) {\n assembly {\n // We subtract 32 from `sEnd` and `dEnd` because it\n // is easier to compare with in the loop, and these\n // are also the addresses we need for copying the\n // last bytes.\n length := sub(length, 32)\n let sEnd := add(source, length)\n let dEnd := add(dest, length)\n\n // Remember the last 32 bytes of source\n // This needs to be done here and not after the loop\n // because we may have overwritten the last bytes in\n // source already due to overlap.\n let last := mload(sEnd)\n\n // Copy whole words front to back\n // Note: the first check is always true,\n // this could have been a do-while loop.\n // solhint-disable-next-line no-empty-blocks\n for {} lt(source, sEnd) {} {\n mstore(dest, mload(source))\n source := add(source, 32)\n dest := add(dest, 32)\n }\n \n // Write the last 32 bytes\n mstore(dEnd, last)\n }\n } else {\n assembly {\n // We subtract 32 from `sEnd` and `dEnd` because those\n // are the starting points when copying a word at the end.\n length := sub(length, 32)\n let sEnd := add(source, length)\n let dEnd := add(dest, length)\n\n // Remember the first 32 bytes of source\n // This needs to be done here and not after the loop\n // because we may have overwritten the first bytes in\n // source already due to overlap.\n let first := mload(source)\n\n // Copy whole words back to front\n // We use a signed comparisson here to allow dEnd to become\n // negative (happens when source and dest < 32). Valid\n // addresses in local memory will never be larger than\n // 2**255, so they can be safely re-interpreted as signed.\n // Note: the first check is always true,\n // this could have been a do-while loop.\n // solhint-disable-next-line no-empty-blocks\n for {} slt(dest, dEnd) {} {\n mstore(dEnd, mload(sEnd))\n sEnd := sub(sEnd, 32)\n dEnd := sub(dEnd, 32)\n }\n \n // Write the first 32 bytes\n mstore(dest, first)\n }\n }\n }\n }\n\n /// @dev Returns a slices from a byte array.\n /// @param b The byte array to take a slice from.\n /// @param from The starting index for the slice (inclusive).\n /// @param to The final index for the slice (exclusive).\n /// @return result The slice containing bytes at indices [from, to)\n function slice(\n bytes memory b,\n uint256 from,\n uint256 to\n )\n internal\n pure\n returns (bytes memory result)\n {\n require(\n from <= to,\n \"FROM_LESS_THAN_TO_REQUIRED\"\n );\n require(\n to < b.length,\n \"TO_LESS_THAN_LENGTH_REQUIRED\"\n );\n \n // Create a new bytes structure and copy contents\n result = new bytes(to - from);\n memCopy(\n result.contentAddress(),\n b.contentAddress() + from,\n result.length\n );\n return result;\n }\n \n /// @dev Returns a slice from a byte array without preserving the input.\n /// @param b The byte array to take a slice from. Will be destroyed in the process.\n /// @param from The starting index for the slice (inclusive).\n /// @param to The final index for the slice (exclusive).\n /// @return result The slice containing bytes at indices [from, to)\n /// @dev When `from == 0`, the original array will match the slice. In other cases its state will be corrupted.\n function sliceDestructive(\n bytes memory b,\n uint256 from,\n uint256 to\n )\n internal\n pure\n returns (bytes memory result)\n {\n require(\n from <= to,\n \"FROM_LESS_THAN_TO_REQUIRED\"\n );\n require(\n to < b.length,\n \"TO_LESS_THAN_LENGTH_REQUIRED\"\n );\n \n // Create a new bytes structure around [from, to) in-place.\n assembly {\n result := add(b, from)\n mstore(result, sub(to, from))\n }\n return result;\n }\n\n /// @dev Pops the last byte off of a byte array by modifying its length.\n /// @param b Byte array that will be modified.\n /// @return The byte that was popped off.\n function popLastByte(bytes memory b)\n internal\n pure\n returns (bytes1 result)\n {\n require(\n b.length > 0,\n \"GREATER_THAN_ZERO_LENGTH_REQUIRED\"\n );\n\n // Store last byte.\n result = b[b.length - 1];\n\n assembly {\n // Decrement length of byte array.\n let newLen := sub(mload(b), 1)\n mstore(b, newLen)\n }\n return result;\n }\n\n /// @dev Pops the last 20 bytes off of a byte array by modifying its length.\n /// @param b Byte array that will be modified.\n /// @return The 20 byte address that was popped off.\n function popLast20Bytes(bytes memory b)\n internal\n pure\n returns (address result)\n {\n require(\n b.length >= 20,\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Store last 20 bytes.\n result = readAddress(b, b.length - 20);\n\n assembly {\n // Subtract 20 from byte array length.\n let newLen := sub(mload(b), 20)\n mstore(b, newLen)\n }\n return result;\n }\n\n /// @dev Tests equality of two byte arrays.\n /// @param lhs First byte array to compare.\n /// @param rhs Second byte array to compare.\n /// @return True if arrays are the same. False otherwise.\n function equals(\n bytes memory lhs,\n bytes memory rhs\n )\n internal\n pure\n returns (bool equal)\n {\n // Keccak gas cost is 30 + numWords * 6. This is a cheap way to compare.\n // We early exit on unequal lengths, but keccak would also correctly\n // handle this.\n return lhs.length == rhs.length && keccak256(lhs) == keccak256(rhs);\n }\n\n /// @dev Reads an address from a position in a byte array.\n /// @param b Byte array containing an address.\n /// @param index Index in byte array of address.\n /// @return address from byte array.\n function readAddress(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (address result)\n {\n require(\n b.length >= index + 20, // 20 is length of address\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Add offset to index:\n // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)\n // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)\n index += 20;\n\n // Read address from array memory\n assembly {\n // 1. Add index to address of bytes array\n // 2. Load 32-byte word from memory\n // 3. Apply 20-byte mask to obtain address\n result := and(mload(add(b, index)), 0xffffffffffffffffffffffffffffffffffffffff)\n }\n return result;\n }\n\n /// @dev Writes an address into a specific position in a byte array.\n /// @param b Byte array to insert address into.\n /// @param index Index in byte array of address.\n /// @param input Address to put into byte array.\n function writeAddress(\n bytes memory b,\n uint256 index,\n address input\n )\n internal\n pure\n {\n require(\n b.length >= index + 20, // 20 is length of address\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Add offset to index:\n // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)\n // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)\n index += 20;\n\n // Store address into array memory\n assembly {\n // The address occupies 20 bytes and mstore stores 32 bytes.\n // First fetch the 32-byte word where we'll be storing the address, then\n // apply a mask so we have only the bytes in the word that the address will not occupy.\n // Then combine these bytes with the address and store the 32 bytes back to memory with mstore.\n\n // 1. Add index to address of bytes array\n // 2. Load 32-byte word from memory\n // 3. Apply 12-byte mask to obtain extra bytes occupying word of memory where we'll store the address\n let neighbors := and(\n mload(add(b, index)),\n 0xffffffffffffffffffffffff0000000000000000000000000000000000000000\n )\n \n // Make sure input address is clean.\n // (Solidity does not guarantee this)\n input := and(input, 0xffffffffffffffffffffffffffffffffffffffff)\n\n // Store the neighbors and address into memory\n mstore(add(b, index), xor(input, neighbors))\n }\n }\n\n /// @dev Reads a bytes32 value from a position in a byte array.\n /// @param b Byte array containing a bytes32 value.\n /// @param index Index in byte array of bytes32 value.\n /// @return bytes32 value from byte array.\n function readBytes32(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes32 result)\n {\n require(\n b.length >= index + 32,\n \"GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 256 bit length parameter\n index += 32;\n\n // Read the bytes32 from array memory\n assembly {\n result := mload(add(b, index))\n }\n return result;\n }\n\n /// @dev Writes a bytes32 into a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input bytes32 to put into byte array.\n function writeBytes32(\n bytes memory b,\n uint256 index,\n bytes32 input\n )\n internal\n pure\n {\n require(\n b.length >= index + 32,\n \"GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 256 bit length parameter\n index += 32;\n\n // Read the bytes32 from array memory\n assembly {\n mstore(add(b, index), input)\n }\n }\n\n /// @dev Reads a uint256 value from a position in a byte array.\n /// @param b Byte array containing a uint256 value.\n /// @param index Index in byte array of uint256 value.\n /// @return uint256 value from byte array.\n function readUint256(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (uint256 result)\n {\n result = uint256(readBytes32(b, index));\n return result;\n }\n\n /// @dev Writes a uint256 into a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input uint256 to put into byte array.\n function writeUint256(\n bytes memory b,\n uint256 index,\n uint256 input\n )\n internal\n pure\n {\n writeBytes32(b, index, bytes32(input));\n }\n\n /// @dev Reads an unpadded bytes4 value from a position in a byte array.\n /// @param b Byte array containing a bytes4 value.\n /// @param index Index in byte array of bytes4 value.\n /// @return bytes4 value from byte array.\n function readBytes4(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes4 result)\n {\n require(\n b.length >= index + 4,\n \"GREATER_OR_EQUAL_TO_4_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 32 byte length field\n index += 32;\n\n // Read the bytes4 from array memory\n assembly {\n result := mload(add(b, index))\n // Solidity does not require us to clean the trailing bytes.\n // We do it anyway\n result := and(result, 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000)\n }\n return result;\n }\n\n /// @dev Reads nested bytes from a specific position.\n /// @dev NOTE: the returned value overlaps with the input value.\n /// Both should be treated as immutable.\n /// @param b Byte array containing nested bytes.\n /// @param index Index of nested bytes.\n /// @return result Nested bytes.\n function readBytesWithLength(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes memory result)\n {\n // Read length of nested bytes\n uint256 nestedBytesLength = readUint256(b, index);\n index += 32;\n\n // Assert length of <b> is valid, given\n // length of nested bytes\n require(\n b.length >= index + nestedBytesLength,\n \"GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED\"\n );\n \n // Return a pointer to the byte array as it exists inside `b`\n assembly {\n result := add(b, index)\n }\n return result;\n }\n\n /// @dev Inserts bytes at a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input bytes to insert.\n function writeBytesWithLength(\n bytes memory b,\n uint256 index,\n bytes memory input\n )\n internal\n pure\n {\n // Assert length of <b> is valid, given\n // length of input\n require(\n b.length >= index + 32 + input.length, // 32 bytes to store length\n \"GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED\"\n );\n\n // Copy <input> into <b>\n memCopy(\n b.contentAddress() + index,\n input.rawAddress(), // includes length of <input>\n input.length + 32 // +32 bytes to store <input> length\n );\n }\n\n /// @dev Performs a deep copy of a byte array onto another byte array of greater than or equal length.\n /// @param dest Byte array that will be overwritten with source bytes.\n /// @param source Byte array to copy onto dest bytes.\n function deepCopyBytes(\n bytes memory dest,\n bytes memory source\n )\n internal\n pure\n {\n uint256 sourceLen = source.length;\n // Dest length must be >= source length, or some bytes would not be copied.\n require(\n dest.length >= sourceLen,\n \"GREATER_OR_EQUAL_TO_SOURCE_BYTES_LENGTH_REQUIRED\"\n );\n memCopy(\n dest.contentAddress(),\n source.contentAddress(),\n sourceLen\n );\n }\n}\n",
- "2.0.0/utils/Ownable/IOwnable.sol": "pragma solidity 0.4.24;\n\n\ncontract IOwnable {\n\n function transferOwnership(address newOwner)\n public;\n}\n",
- "2.0.0/utils/Ownable/Ownable.sol": "pragma solidity 0.4.24;\n\nimport \"./IOwnable.sol\";\n\n\ncontract Ownable is\n IOwnable\n{\n address public owner;\n\n constructor ()\n public\n {\n owner = msg.sender;\n }\n\n modifier onlyOwner() {\n require(\n msg.sender == owner,\n \"ONLY_CONTRACT_OWNER\"\n );\n _;\n }\n\n function transferOwnership(address newOwner)\n public\n onlyOwner\n {\n if (newOwner != address(0)) {\n owner = newOwner;\n }\n }\n}\n",
- "2.0.0/utils/ReentrancyGuard/ReentrancyGuard.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract ReentrancyGuard {\n\n // Locked state of mutex\n bool private locked = false;\n\n /// @dev Functions with this modifer cannot be reentered. The mutex will be locked\n /// before function execution and unlocked after.\n modifier nonReentrant() {\n // Ensure mutex is unlocked\n require(\n !locked,\n \"REENTRANCY_ILLEGAL\"\n );\n\n // Lock mutex before function call\n locked = true;\n\n // Perform function call\n _;\n\n // Unlock mutex after function call\n locked = false;\n }\n}\n",
- "2.0.0/utils/SafeMath/SafeMath.sol": "pragma solidity 0.4.24;\n\n\ncontract SafeMath {\n\n function safeMul(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n if (a == 0) {\n return 0;\n }\n uint256 c = a * b;\n require(\n c / a == b,\n \"UINT256_OVERFLOW\"\n );\n return c;\n }\n\n function safeDiv(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n uint256 c = a / b;\n return c;\n }\n\n function safeSub(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n require(\n b <= a,\n \"UINT256_UNDERFLOW\"\n );\n return a - b;\n }\n\n function safeAdd(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n uint256 c = a + b;\n require(\n c >= a,\n \"UINT256_OVERFLOW\"\n );\n return c;\n }\n\n function max64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n\n function max256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n}\n"
- },
- "sourceTreeHashHex": "0xc1a03719bb35a579c3db5156280faf7fea3944100a90a5b2abe1840a4bcfea20",
- "compiler": {
- "name": "solc",
- "version": "soljson-v0.4.24+commit.e67f0147.js",
- "settings": {
- "optimizer": {
- "enabled": true,
- "runs": 1000000
- },
- "outputSelection": {
- "*": {
- "*": [
- "abi",
- "evm.bytecode.object",
- "evm.bytecode.sourceMap",
- "evm.deployedBytecode.object",
- "evm.deployedBytecode.sourceMap"
- ]
- }
- }
- }
- },
- "networks": {
- "1": {
- "address": "0x17992e4ffb22730138e4b62aaa6367fa9d3699a6",
- "links": {},
- "constructorArgs": "[[\"0x257619b7155d247e43c8b6d90c8c17278ae481f0\",\"0x5ee2a00f8f01d099451844af7f894f26a57fcbf2\",\"0x894d623e0e0e8ed12c4a73dada999e275684a37d\"],[\"0x2240dab907db71e64d3e0dba4800c83b5c502d4e\",\"0x208e41fb445f1bb1b6780d58356e81405f3e6127\"],\"2\",\"1209600\"]"
- },
- "3": {
- "address": "0xf5fa5b5fed2727a0e44ac67f6772e97977aa358b",
- "links": {},
- "constructorArgs": "[[\"0x9df8137872ac09a8fee71d0da5c7539923fb9bf0\",\"0xcf34d44db312d188789f43a63d11cf2bebb4da15\",\"0x73fd50f2a6beac9cdac9fe87ef68a18edc415831\"],[\"0xb1408f4c245a23c31b98d2c626777d4c0d766caa\",\"0xe654aac058bfbf9f83fcaee7793311dd82f6ddb4\"],\"1\",\"0\"]"
- },
- "42": {
- "address": "0x2c824d2882baa668e0d5202b1e7f2922278703f8",
- "links": {},
- "constructorArgs": "[[\"0x9df8137872ac09a8fee71d0da5c7539923fb9bf0\",\"0xcf34d44db312d188789f43a63d11cf2bebb4da15\",\"0x73fd50f2a6beac9cdac9fe87ef68a18edc415831\"],[\"0xf1ec01d6236d3cd881a0bf0130ea25fe4234003e\",\"0x2a9127c745688a165106c11cd4d647d2220af821\"],\"1\",\"0\"]"
- },
- "50": {
- "address": "0x34d402f14d58e001d8efbe6585051bf9706aa064",
- "links": {},
- "constructorArgs": "[[\"0x9df8137872ac09a8fee71d0da5c7539923fb9bf0\",\"0xcf34d44db312d188789f43a63d11cf2bebb4da15\",\"0x73fd50f2a6beac9cdac9fe87ef68a18edc415831\"],[\"0x1dc4c1cefef38a777b15aa20260a54e584b16c48\",\"0x1d7022f5b17d2f8b695918fb48fa1089c9f85401\"],\"1\",\"0\"]"
- }
- }
-}
diff --git a/packages/migrations/artifacts/2.0.0/DummyERC20Token.json b/packages/migrations/artifacts/2.0.0/DummyERC20Token.json
deleted file mode 100644
index e0c5eb5dd..000000000
--- a/packages/migrations/artifacts/2.0.0/DummyERC20Token.json
+++ /dev/null
@@ -1,641 +0,0 @@
-{
- "schemaVersion": "2.0.0",
- "contractName": "DummyERC20Token",
- "compilerOutput": {
- "abi": [
- {
- "constant": true,
- "inputs": [],
- "name": "name",
- "outputs": [
- {
- "name": "",
- "type": "string"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_spender",
- "type": "address"
- },
- {
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "approve",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "totalSupply",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_from",
- "type": "address"
- },
- {
- "name": "_to",
- "type": "address"
- },
- {
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "transferFrom",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "decimals",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "_owner",
- "type": "address"
- }
- ],
- "name": "balanceOf",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "owner",
- "outputs": [
- {
- "name": "",
- "type": "address"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "symbol",
- "outputs": [
- {
- "name": "",
- "type": "string"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "mint",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_to",
- "type": "address"
- },
- {
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "transfer",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "_owner",
- "type": "address"
- },
- {
- "name": "_spender",
- "type": "address"
- }
- ],
- "name": "allowance",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_target",
- "type": "address"
- },
- {
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "setBalance",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "newOwner",
- "type": "address"
- }
- ],
- "name": "transferOwnership",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "MAX_MINT_AMOUNT",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "inputs": [
- {
- "name": "_name",
- "type": "string"
- },
- {
- "name": "_symbol",
- "type": "string"
- },
- {
- "name": "_decimals",
- "type": "uint256"
- },
- {
- "name": "_totalSupply",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "constructor"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "_from",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "_to",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "Transfer",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "_owner",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "_spender",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "Approval",
- "type": "event"
- }
- ],
- "evm": {
- "bytecode": {
- "linkReferences": {},
- "object": "0x608060405234801561001057600080fd5b5060405162000fa438038062000fa4833981016040908152815160208084015192840151606085015160008054600160a060020a031916331790559285018051909594909401939092916100699160049187019061009c565b50825161007d90600590602086019061009c565b5060069190915533600090815260016020526040902055506101379050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106100dd57805160ff191683800117855561010a565b8280016001018555821561010a579182015b8281111561010a5782518255916020019190600101906100ef565b5061011692915061011a565b5090565b61013491905b808211156101165760008155600101610120565b90565b610e5d80620001476000396000f3006080604052600436106100cf5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100d4578063095ea7b31461015e57806318160ddd146101a357806323b872dd146101ca578063313ce5671461020157806370a08231146102165780638da5cb5b1461024457806395d89b4114610282578063a0712d6814610297578063a9059cbb146102b1578063dd62ed3e146102e2578063e30443bc14610316578063f2fde38b14610347578063fa9b701814610375575b600080fd5b3480156100e057600080fd5b506100e961038a565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561012357818101518382015260200161010b565b50505050905090810190601f1680156101505780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561016a57600080fd5b5061018f73ffffffffffffffffffffffffffffffffffffffff60043516602435610436565b604080519115158252519081900360200190f35b3480156101af57600080fd5b506101b86104a9565b60408051918252519081900360200190f35b3480156101d657600080fd5b5061018f73ffffffffffffffffffffffffffffffffffffffff600435811690602435166044356104af565b34801561020d57600080fd5b506101b861076b565b34801561022257600080fd5b506101b873ffffffffffffffffffffffffffffffffffffffff60043516610771565b34801561025057600080fd5b50610259610799565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b34801561028e57600080fd5b506100e96107b5565b3480156102a357600080fd5b506102af60043561082e565b005b3480156102bd57600080fd5b5061018f73ffffffffffffffffffffffffffffffffffffffff600435166024356108b4565b3480156102ee57600080fd5b506101b873ffffffffffffffffffffffffffffffffffffffff60043581169060243516610a43565b34801561032257600080fd5b506102af73ffffffffffffffffffffffffffffffffffffffff60043516602435610a7b565b34801561035357600080fd5b506102af73ffffffffffffffffffffffffffffffffffffffff60043516610b91565b34801561038157600080fd5b506101b8610c78565b6004805460408051602060026001851615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f8101849004840282018401909252818152929183018282801561042e5780601f106104035761010080835404028352916020019161042e565b820191906000526020600020905b81548152906001019060200180831161041157829003601f168201915b505050505081565b33600081815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60035490565b73ffffffffffffffffffffffffffffffffffffffff83166000818152600260209081526040808320338452825280832054938352600190915281205490919083111561055c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f45524332305f494e53554646494349454e545f42414c414e4345000000000000604482015290519081900360640190fd5b828110156105cb57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f45524332305f494e53554646494349454e545f414c4c4f57414e434500000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8416600090815260016020526040902054838101101561066157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f55494e543235365f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff808516600090815260016020526040808220805487019055918716815220805484900390557fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8110156106fb5773ffffffffffffffffffffffffffffffffffffffff851660009081526002602090815260408083203384529091529020805484900390555b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3506001949350505050565b60065481565b73ffffffffffffffffffffffffffffffffffffffff1660009081526001602052604090205490565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b6005805460408051602060026001851615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f8101849004840282018401909252818152929183018282801561042e5780601f106104035761010080835404028352916020019161042e565b69021e19e0c9bab24000008111156108a757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f56414c55455f544f4f5f4c415247450000000000000000000000000000000000604482015290519081900360640190fd5b6108b13382610c86565b50565b3360009081526001602052604081205482111561093257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f45524332305f494e53554646494349454e545f42414c414e4345000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff831660009081526001602052604090205482810110156109c857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f55494e543235365f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b3360008181526001602090815260408083208054879003905573ffffffffffffffffffffffffffffffffffffffff871680845292819020805487019055805186815290519293927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a350600192915050565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260026020908152604080832093909416825291909152205490565b6000805473ffffffffffffffffffffffffffffffffffffffff163314610b0257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b5073ffffffffffffffffffffffffffffffffffffffff821660009081526001602052604090205480821015610b4e57610b46600354610b418385610d3f565b610d3f565b600355610b67565b610b63600354610b5e8484610d3f565b610db6565b6003555b5073ffffffffffffffffffffffffffffffffffffffff909116600090815260016020526040902055565b60005473ffffffffffffffffffffffffffffffffffffffff163314610c1757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8116156108b1576000805473ffffffffffffffffffffffffffffffffffffffff83167fffffffffffffffffffffffff000000000000000000000000000000000000000090911617905550565b69021e19e0c9bab240000081565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260016020526040902054610cb7908290610db6565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260016020526040902055600354610cea9082610db6565b60035560408051828152905173ffffffffffffffffffffffffffffffffffffffff8416916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b600082821115610db057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f55494e543235365f554e444552464c4f57000000000000000000000000000000604482015290519081900360640190fd5b50900390565b600082820183811015610e2a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f55494e543235365f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b93925050505600a165627a7a72305820bf15f8b157047a3248e2c7bf50ad7dd5d360d0bb36a780e3bad9229fc4bad5d20029",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x40 MLOAD PUSH3 0xFA4 CODESIZE SUB DUP1 PUSH3 0xFA4 DUP4 CODECOPY DUP2 ADD PUSH1 0x40 SWAP1 DUP2 MSTORE DUP2 MLOAD PUSH1 0x20 DUP1 DUP5 ADD MLOAD SWAP3 DUP5 ADD MLOAD PUSH1 0x60 DUP6 ADD MLOAD PUSH1 0x0 DUP1 SLOAD PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB NOT AND CALLER OR SWAP1 SSTORE SWAP3 DUP6 ADD DUP1 MLOAD SWAP1 SWAP6 SWAP5 SWAP1 SWAP5 ADD SWAP4 SWAP1 SWAP3 SWAP2 PUSH2 0x69 SWAP2 PUSH1 0x4 SWAP2 DUP8 ADD SWAP1 PUSH2 0x9C JUMP JUMPDEST POP DUP3 MLOAD PUSH2 0x7D SWAP1 PUSH1 0x5 SWAP1 PUSH1 0x20 DUP7 ADD SWAP1 PUSH2 0x9C JUMP JUMPDEST POP PUSH1 0x6 SWAP2 SWAP1 SWAP2 SSTORE CALLER PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SSTORE POP PUSH2 0x137 SWAP1 POP JUMP JUMPDEST DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 PUSH1 0x1F ADD PUSH1 0x20 SWAP1 DIV DUP2 ADD SWAP3 DUP3 PUSH1 0x1F LT PUSH2 0xDD JUMPI DUP1 MLOAD PUSH1 0xFF NOT AND DUP4 DUP1 ADD OR DUP6 SSTORE PUSH2 0x10A JUMP JUMPDEST DUP3 DUP1 ADD PUSH1 0x1 ADD DUP6 SSTORE DUP3 ISZERO PUSH2 0x10A JUMPI SWAP2 DUP3 ADD JUMPDEST DUP3 DUP2 GT ISZERO PUSH2 0x10A JUMPI DUP3 MLOAD DUP3 SSTORE SWAP2 PUSH1 0x20 ADD SWAP2 SWAP1 PUSH1 0x1 ADD SWAP1 PUSH2 0xEF JUMP JUMPDEST POP PUSH2 0x116 SWAP3 SWAP2 POP PUSH2 0x11A JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST PUSH2 0x134 SWAP2 SWAP1 JUMPDEST DUP1 DUP3 GT ISZERO PUSH2 0x116 JUMPI PUSH1 0x0 DUP2 SSTORE PUSH1 0x1 ADD PUSH2 0x120 JUMP JUMPDEST SWAP1 JUMP JUMPDEST PUSH2 0xE5D DUP1 PUSH3 0x147 PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN STOP PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0xCF JUMPI PUSH4 0xFFFFFFFF PUSH29 0x100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD DIV AND PUSH4 0x6FDDE03 DUP2 EQ PUSH2 0xD4 JUMPI DUP1 PUSH4 0x95EA7B3 EQ PUSH2 0x15E JUMPI DUP1 PUSH4 0x18160DDD EQ PUSH2 0x1A3 JUMPI DUP1 PUSH4 0x23B872DD EQ PUSH2 0x1CA JUMPI DUP1 PUSH4 0x313CE567 EQ PUSH2 0x201 JUMPI DUP1 PUSH4 0x70A08231 EQ PUSH2 0x216 JUMPI DUP1 PUSH4 0x8DA5CB5B EQ PUSH2 0x244 JUMPI DUP1 PUSH4 0x95D89B41 EQ PUSH2 0x282 JUMPI DUP1 PUSH4 0xA0712D68 EQ PUSH2 0x297 JUMPI DUP1 PUSH4 0xA9059CBB EQ PUSH2 0x2B1 JUMPI DUP1 PUSH4 0xDD62ED3E EQ PUSH2 0x2E2 JUMPI DUP1 PUSH4 0xE30443BC EQ PUSH2 0x316 JUMPI DUP1 PUSH4 0xF2FDE38B EQ PUSH2 0x347 JUMPI DUP1 PUSH4 0xFA9B7018 EQ PUSH2 0x375 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xE0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xE9 PUSH2 0x38A JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 DUP1 DUP3 MSTORE DUP4 MLOAD DUP2 DUP4 ADD MSTORE DUP4 MLOAD SWAP2 SWAP3 DUP4 SWAP3 SWAP1 DUP4 ADD SWAP2 DUP6 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x123 JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH2 0x10B JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x150 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x16A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x18F PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x436 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 ISZERO ISZERO DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1AF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1B8 PUSH2 0x4A9 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1D6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x18F PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH1 0x44 CALLDATALOAD PUSH2 0x4AF JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x20D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1B8 PUSH2 0x76B JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x222 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1B8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x771 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x250 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x259 PUSH2 0x799 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x28E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xE9 PUSH2 0x7B5 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2A3 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2AF PUSH1 0x4 CALLDATALOAD PUSH2 0x82E JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2BD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x18F PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x8B4 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2EE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1B8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH2 0xA43 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x322 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2AF PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0xA7B JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x353 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2AF PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0xB91 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x381 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1B8 PUSH2 0xC78 JUMP JUMPDEST PUSH1 0x4 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 PUSH1 0x2 PUSH1 0x1 DUP6 AND ISZERO PUSH2 0x100 MUL PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 SWAP5 AND SWAP4 SWAP1 SWAP4 DIV PUSH1 0x1F DUP2 ADD DUP5 SWAP1 DIV DUP5 MUL DUP3 ADD DUP5 ADD SWAP1 SWAP3 MSTORE DUP2 DUP2 MSTORE SWAP3 SWAP2 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0x42E JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x403 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x42E JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x411 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP DUP2 JUMP JUMPDEST CALLER PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 AND DUP1 DUP6 MSTORE SWAP1 DUP4 MSTORE DUP2 DUP5 KECCAK256 DUP7 SWAP1 SSTORE DUP2 MLOAD DUP7 DUP2 MSTORE SWAP2 MLOAD SWAP4 SWAP5 SWAP1 SWAP4 SWAP1 SWAP3 PUSH32 0x8C5BE1E5EBEC7D5BD14F71427D1E84F3DD0314C0F7B2291E5B200AC8C7C3B925 SWAP3 DUP3 SWAP1 SUB ADD SWAP1 LOG3 POP PUSH1 0x1 SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x3 SLOAD SWAP1 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 CALLER DUP5 MSTORE DUP3 MSTORE DUP1 DUP4 KECCAK256 SLOAD SWAP4 DUP4 MSTORE PUSH1 0x1 SWAP1 SWAP2 MSTORE DUP2 KECCAK256 SLOAD SWAP1 SWAP2 SWAP1 DUP4 GT ISZERO PUSH2 0x55C JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x1A PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x45524332305F494E53554646494349454E545F42414C414E4345000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST DUP3 DUP2 LT ISZERO PUSH2 0x5CB JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x1C PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x45524332305F494E53554646494349454E545F414C4C4F57414E434500000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP4 DUP2 ADD LT ISZERO PUSH2 0x661 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x10 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x55494E543235365F4F564552464C4F5700000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP6 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 DUP1 SLOAD DUP8 ADD SWAP1 SSTORE SWAP2 DUP8 AND DUP2 MSTORE KECCAK256 DUP1 SLOAD DUP5 SWAP1 SUB SWAP1 SSTORE PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 LT ISZERO PUSH2 0x6FB JUMPI PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP6 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 CALLER DUP5 MSTORE SWAP1 SWAP2 MSTORE SWAP1 KECCAK256 DUP1 SLOAD DUP5 SWAP1 SUB SWAP1 SSTORE JUMPDEST DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF DUP6 PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 POP PUSH1 0x1 SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x6 SLOAD DUP2 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x5 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 PUSH1 0x2 PUSH1 0x1 DUP6 AND ISZERO PUSH2 0x100 MUL PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 SWAP5 AND SWAP4 SWAP1 SWAP4 DIV PUSH1 0x1F DUP2 ADD DUP5 SWAP1 DIV DUP5 MUL DUP3 ADD DUP5 ADD SWAP1 SWAP3 MSTORE DUP2 DUP2 MSTORE SWAP3 SWAP2 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0x42E JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x403 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x42E JUMP JUMPDEST PUSH10 0x21E19E0C9BAB2400000 DUP2 GT ISZERO PUSH2 0x8A7 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0xF PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x56414C55455F544F4F5F4C415247450000000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH2 0x8B1 CALLER DUP3 PUSH2 0xC86 JUMP JUMPDEST POP JUMP JUMPDEST CALLER PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 DUP2 KECCAK256 SLOAD DUP3 GT ISZERO PUSH2 0x932 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x1A PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x45524332305F494E53554646494349454E545F42414C414E4345000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP3 DUP2 ADD LT ISZERO PUSH2 0x9C8 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x10 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x55494E543235365F4F564552464C4F5700000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST CALLER PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 DUP1 SLOAD DUP8 SWAP1 SUB SWAP1 SSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 AND DUP1 DUP5 MSTORE SWAP3 DUP2 SWAP1 KECCAK256 DUP1 SLOAD DUP8 ADD SWAP1 SSTORE DUP1 MLOAD DUP7 DUP2 MSTORE SWAP1 MLOAD SWAP3 SWAP4 SWAP3 PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF SWAP3 SWAP2 DUP2 SWAP1 SUB SWAP1 SWAP2 ADD SWAP1 LOG3 POP PUSH1 0x1 SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP2 DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 SWAP4 SWAP1 SWAP5 AND DUP3 MSTORE SWAP2 SWAP1 SWAP2 MSTORE KECCAK256 SLOAD SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0xB02 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP1 DUP3 LT ISZERO PUSH2 0xB4E JUMPI PUSH2 0xB46 PUSH1 0x3 SLOAD PUSH2 0xB41 DUP4 DUP6 PUSH2 0xD3F JUMP JUMPDEST PUSH2 0xD3F JUMP JUMPDEST PUSH1 0x3 SSTORE PUSH2 0xB67 JUMP JUMPDEST PUSH2 0xB63 PUSH1 0x3 SLOAD PUSH2 0xB5E DUP5 DUP5 PUSH2 0xD3F JUMP JUMPDEST PUSH2 0xDB6 JUMP JUMPDEST PUSH1 0x3 SSTORE JUMPDEST POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP2 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SSTORE JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0xC17 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND ISZERO PUSH2 0x8B1 JUMPI PUSH1 0x0 DUP1 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 SWAP1 SWAP2 AND OR SWAP1 SSTORE POP JUMP JUMPDEST PUSH10 0x21E19E0C9BAB2400000 DUP2 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH2 0xCB7 SWAP1 DUP3 SWAP1 PUSH2 0xDB6 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SSTORE PUSH1 0x3 SLOAD PUSH2 0xCEA SWAP1 DUP3 PUSH2 0xDB6 JUMP JUMPDEST PUSH1 0x3 SSTORE PUSH1 0x40 DUP1 MLOAD DUP3 DUP2 MSTORE SWAP1 MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND SWAP2 PUSH1 0x0 SWAP2 PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF SWAP2 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 LOG3 POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 GT ISZERO PUSH2 0xDB0 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x11 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x55494E543235365F554E444552464C4F57000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP SWAP1 SUB SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 ADD DUP4 DUP2 LT ISZERO PUSH2 0xE2A JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x10 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x55494E543235365F4F564552464C4F5700000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST SWAP4 SWAP3 POP POP POP JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 0xbf ISZERO 0xf8 0xb1 JUMPI DIV PUSH27 0x3248E2C7BF50AD7DD5D360D0BB36A780E3BAD9229FC4BAD5D20029 ",
- "sourceMap": "706:1394:50:-;;;928:308;8:9:-1;5:2;;;30:1;27;20:12;5:2;928:308:50;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;162:5:63;:18;;-1:-1:-1;;;;;;162:18:63;170:10;162:18;;;928:308:50;;;1079:12;;928:308;;;;;;;;;;1079:12;;:4;;:12;;;;:::i;:::-;-1:-1:-1;1101:16:50;;;;:6;;:16;;;;;:::i;:::-;-1:-1:-1;1127:8:50;:20;;;;1203:10;1194:20;;;;:8;:20;;;;;:35;-1:-1:-1;706:1394:50;;-1:-1:-1;706:1394:50;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;706:1394:50;;;-1:-1:-1;706:1394:50;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;"
- },
- "deployedBytecode": {
- "linkReferences": {},
- "object": "0x6080604052600436106100cf5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100d4578063095ea7b31461015e57806318160ddd146101a357806323b872dd146101ca578063313ce5671461020157806370a08231146102165780638da5cb5b1461024457806395d89b4114610282578063a0712d6814610297578063a9059cbb146102b1578063dd62ed3e146102e2578063e30443bc14610316578063f2fde38b14610347578063fa9b701814610375575b600080fd5b3480156100e057600080fd5b506100e961038a565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561012357818101518382015260200161010b565b50505050905090810190601f1680156101505780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561016a57600080fd5b5061018f73ffffffffffffffffffffffffffffffffffffffff60043516602435610436565b604080519115158252519081900360200190f35b3480156101af57600080fd5b506101b86104a9565b60408051918252519081900360200190f35b3480156101d657600080fd5b5061018f73ffffffffffffffffffffffffffffffffffffffff600435811690602435166044356104af565b34801561020d57600080fd5b506101b861076b565b34801561022257600080fd5b506101b873ffffffffffffffffffffffffffffffffffffffff60043516610771565b34801561025057600080fd5b50610259610799565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b34801561028e57600080fd5b506100e96107b5565b3480156102a357600080fd5b506102af60043561082e565b005b3480156102bd57600080fd5b5061018f73ffffffffffffffffffffffffffffffffffffffff600435166024356108b4565b3480156102ee57600080fd5b506101b873ffffffffffffffffffffffffffffffffffffffff60043581169060243516610a43565b34801561032257600080fd5b506102af73ffffffffffffffffffffffffffffffffffffffff60043516602435610a7b565b34801561035357600080fd5b506102af73ffffffffffffffffffffffffffffffffffffffff60043516610b91565b34801561038157600080fd5b506101b8610c78565b6004805460408051602060026001851615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f8101849004840282018401909252818152929183018282801561042e5780601f106104035761010080835404028352916020019161042e565b820191906000526020600020905b81548152906001019060200180831161041157829003601f168201915b505050505081565b33600081815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60035490565b73ffffffffffffffffffffffffffffffffffffffff83166000818152600260209081526040808320338452825280832054938352600190915281205490919083111561055c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f45524332305f494e53554646494349454e545f42414c414e4345000000000000604482015290519081900360640190fd5b828110156105cb57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f45524332305f494e53554646494349454e545f414c4c4f57414e434500000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8416600090815260016020526040902054838101101561066157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f55494e543235365f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff808516600090815260016020526040808220805487019055918716815220805484900390557fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8110156106fb5773ffffffffffffffffffffffffffffffffffffffff851660009081526002602090815260408083203384529091529020805484900390555b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3506001949350505050565b60065481565b73ffffffffffffffffffffffffffffffffffffffff1660009081526001602052604090205490565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b6005805460408051602060026001851615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f8101849004840282018401909252818152929183018282801561042e5780601f106104035761010080835404028352916020019161042e565b69021e19e0c9bab24000008111156108a757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f56414c55455f544f4f5f4c415247450000000000000000000000000000000000604482015290519081900360640190fd5b6108b13382610c86565b50565b3360009081526001602052604081205482111561093257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f45524332305f494e53554646494349454e545f42414c414e4345000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff831660009081526001602052604090205482810110156109c857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f55494e543235365f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b3360008181526001602090815260408083208054879003905573ffffffffffffffffffffffffffffffffffffffff871680845292819020805487019055805186815290519293927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a350600192915050565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260026020908152604080832093909416825291909152205490565b6000805473ffffffffffffffffffffffffffffffffffffffff163314610b0257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b5073ffffffffffffffffffffffffffffffffffffffff821660009081526001602052604090205480821015610b4e57610b46600354610b418385610d3f565b610d3f565b600355610b67565b610b63600354610b5e8484610d3f565b610db6565b6003555b5073ffffffffffffffffffffffffffffffffffffffff909116600090815260016020526040902055565b60005473ffffffffffffffffffffffffffffffffffffffff163314610c1757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8116156108b1576000805473ffffffffffffffffffffffffffffffffffffffff83167fffffffffffffffffffffffff000000000000000000000000000000000000000090911617905550565b69021e19e0c9bab240000081565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260016020526040902054610cb7908290610db6565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260016020526040902055600354610cea9082610db6565b60035560408051828152905173ffffffffffffffffffffffffffffffffffffffff8416916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b600082821115610db057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f55494e543235365f554e444552464c4f57000000000000000000000000000000604482015290519081900360640190fd5b50900390565b600082820183811015610e2a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f55494e543235365f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b93925050505600a165627a7a72305820bf15f8b157047a3248e2c7bf50ad7dd5d360d0bb36a780e3bad9229fc4bad5d20029",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0xCF JUMPI PUSH4 0xFFFFFFFF PUSH29 0x100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD DIV AND PUSH4 0x6FDDE03 DUP2 EQ PUSH2 0xD4 JUMPI DUP1 PUSH4 0x95EA7B3 EQ PUSH2 0x15E JUMPI DUP1 PUSH4 0x18160DDD EQ PUSH2 0x1A3 JUMPI DUP1 PUSH4 0x23B872DD EQ PUSH2 0x1CA JUMPI DUP1 PUSH4 0x313CE567 EQ PUSH2 0x201 JUMPI DUP1 PUSH4 0x70A08231 EQ PUSH2 0x216 JUMPI DUP1 PUSH4 0x8DA5CB5B EQ PUSH2 0x244 JUMPI DUP1 PUSH4 0x95D89B41 EQ PUSH2 0x282 JUMPI DUP1 PUSH4 0xA0712D68 EQ PUSH2 0x297 JUMPI DUP1 PUSH4 0xA9059CBB EQ PUSH2 0x2B1 JUMPI DUP1 PUSH4 0xDD62ED3E EQ PUSH2 0x2E2 JUMPI DUP1 PUSH4 0xE30443BC EQ PUSH2 0x316 JUMPI DUP1 PUSH4 0xF2FDE38B EQ PUSH2 0x347 JUMPI DUP1 PUSH4 0xFA9B7018 EQ PUSH2 0x375 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xE0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xE9 PUSH2 0x38A JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 DUP1 DUP3 MSTORE DUP4 MLOAD DUP2 DUP4 ADD MSTORE DUP4 MLOAD SWAP2 SWAP3 DUP4 SWAP3 SWAP1 DUP4 ADD SWAP2 DUP6 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x123 JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH2 0x10B JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x150 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x16A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x18F PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x436 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 ISZERO ISZERO DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1AF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1B8 PUSH2 0x4A9 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1D6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x18F PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH1 0x44 CALLDATALOAD PUSH2 0x4AF JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x20D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1B8 PUSH2 0x76B JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x222 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1B8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x771 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x250 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x259 PUSH2 0x799 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x28E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xE9 PUSH2 0x7B5 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2A3 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2AF PUSH1 0x4 CALLDATALOAD PUSH2 0x82E JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2BD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x18F PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x8B4 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2EE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1B8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH2 0xA43 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x322 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2AF PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0xA7B JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x353 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2AF PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0xB91 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x381 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1B8 PUSH2 0xC78 JUMP JUMPDEST PUSH1 0x4 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 PUSH1 0x2 PUSH1 0x1 DUP6 AND ISZERO PUSH2 0x100 MUL PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 SWAP5 AND SWAP4 SWAP1 SWAP4 DIV PUSH1 0x1F DUP2 ADD DUP5 SWAP1 DIV DUP5 MUL DUP3 ADD DUP5 ADD SWAP1 SWAP3 MSTORE DUP2 DUP2 MSTORE SWAP3 SWAP2 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0x42E JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x403 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x42E JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x411 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP DUP2 JUMP JUMPDEST CALLER PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 AND DUP1 DUP6 MSTORE SWAP1 DUP4 MSTORE DUP2 DUP5 KECCAK256 DUP7 SWAP1 SSTORE DUP2 MLOAD DUP7 DUP2 MSTORE SWAP2 MLOAD SWAP4 SWAP5 SWAP1 SWAP4 SWAP1 SWAP3 PUSH32 0x8C5BE1E5EBEC7D5BD14F71427D1E84F3DD0314C0F7B2291E5B200AC8C7C3B925 SWAP3 DUP3 SWAP1 SUB ADD SWAP1 LOG3 POP PUSH1 0x1 SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x3 SLOAD SWAP1 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 CALLER DUP5 MSTORE DUP3 MSTORE DUP1 DUP4 KECCAK256 SLOAD SWAP4 DUP4 MSTORE PUSH1 0x1 SWAP1 SWAP2 MSTORE DUP2 KECCAK256 SLOAD SWAP1 SWAP2 SWAP1 DUP4 GT ISZERO PUSH2 0x55C JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x1A PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x45524332305F494E53554646494349454E545F42414C414E4345000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST DUP3 DUP2 LT ISZERO PUSH2 0x5CB JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x1C PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x45524332305F494E53554646494349454E545F414C4C4F57414E434500000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP4 DUP2 ADD LT ISZERO PUSH2 0x661 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x10 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x55494E543235365F4F564552464C4F5700000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP6 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 DUP1 SLOAD DUP8 ADD SWAP1 SSTORE SWAP2 DUP8 AND DUP2 MSTORE KECCAK256 DUP1 SLOAD DUP5 SWAP1 SUB SWAP1 SSTORE PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 LT ISZERO PUSH2 0x6FB JUMPI PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP6 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 CALLER DUP5 MSTORE SWAP1 SWAP2 MSTORE SWAP1 KECCAK256 DUP1 SLOAD DUP5 SWAP1 SUB SWAP1 SSTORE JUMPDEST DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF DUP6 PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 POP PUSH1 0x1 SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x6 SLOAD DUP2 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x5 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 PUSH1 0x2 PUSH1 0x1 DUP6 AND ISZERO PUSH2 0x100 MUL PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 SWAP5 AND SWAP4 SWAP1 SWAP4 DIV PUSH1 0x1F DUP2 ADD DUP5 SWAP1 DIV DUP5 MUL DUP3 ADD DUP5 ADD SWAP1 SWAP3 MSTORE DUP2 DUP2 MSTORE SWAP3 SWAP2 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0x42E JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x403 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x42E JUMP JUMPDEST PUSH10 0x21E19E0C9BAB2400000 DUP2 GT ISZERO PUSH2 0x8A7 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0xF PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x56414C55455F544F4F5F4C415247450000000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH2 0x8B1 CALLER DUP3 PUSH2 0xC86 JUMP JUMPDEST POP JUMP JUMPDEST CALLER PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 DUP2 KECCAK256 SLOAD DUP3 GT ISZERO PUSH2 0x932 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x1A PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x45524332305F494E53554646494349454E545F42414C414E4345000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP3 DUP2 ADD LT ISZERO PUSH2 0x9C8 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x10 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x55494E543235365F4F564552464C4F5700000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST CALLER PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 DUP1 SLOAD DUP8 SWAP1 SUB SWAP1 SSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 AND DUP1 DUP5 MSTORE SWAP3 DUP2 SWAP1 KECCAK256 DUP1 SLOAD DUP8 ADD SWAP1 SSTORE DUP1 MLOAD DUP7 DUP2 MSTORE SWAP1 MLOAD SWAP3 SWAP4 SWAP3 PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF SWAP3 SWAP2 DUP2 SWAP1 SUB SWAP1 SWAP2 ADD SWAP1 LOG3 POP PUSH1 0x1 SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP2 DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 SWAP4 SWAP1 SWAP5 AND DUP3 MSTORE SWAP2 SWAP1 SWAP2 MSTORE KECCAK256 SLOAD SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0xB02 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP1 DUP3 LT ISZERO PUSH2 0xB4E JUMPI PUSH2 0xB46 PUSH1 0x3 SLOAD PUSH2 0xB41 DUP4 DUP6 PUSH2 0xD3F JUMP JUMPDEST PUSH2 0xD3F JUMP JUMPDEST PUSH1 0x3 SSTORE PUSH2 0xB67 JUMP JUMPDEST PUSH2 0xB63 PUSH1 0x3 SLOAD PUSH2 0xB5E DUP5 DUP5 PUSH2 0xD3F JUMP JUMPDEST PUSH2 0xDB6 JUMP JUMPDEST PUSH1 0x3 SSTORE JUMPDEST POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP2 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SSTORE JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0xC17 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND ISZERO PUSH2 0x8B1 JUMPI PUSH1 0x0 DUP1 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 SWAP1 SWAP2 AND OR SWAP1 SSTORE POP JUMP JUMPDEST PUSH10 0x21E19E0C9BAB2400000 DUP2 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH2 0xCB7 SWAP1 DUP3 SWAP1 PUSH2 0xDB6 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SSTORE PUSH1 0x3 SLOAD PUSH2 0xCEA SWAP1 DUP3 PUSH2 0xDB6 JUMP JUMPDEST PUSH1 0x3 SSTORE PUSH1 0x40 DUP1 MLOAD DUP3 DUP2 MSTORE SWAP1 MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND SWAP2 PUSH1 0x0 SWAP2 PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF SWAP2 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 LOG3 POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 GT ISZERO PUSH2 0xDB0 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x11 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x55494E543235365F554E444552464C4F57000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP SWAP1 SUB SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 ADD DUP4 DUP2 LT ISZERO PUSH2 0xE2A JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x10 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x55494E543235365F4F564552464C4F5700000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST SWAP4 SWAP3 POP POP POP JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 0xbf ISZERO 0xf8 0xb1 JUMPI DIV PUSH27 0x3248E2C7BF50AD7DD5D360D0BB36A780E3BAD9229FC4BAD5D20029 ",
- "sourceMap": "706:1394:50:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;777:18;;8:9:-1;5:2;;;30:1;27;20:12;5:2;777:18:50;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:100:-1;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;777:18:50;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2896:270:52;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2896:270:52;;;;;;;;;;;;;;;;;;;;;;;;;;;3251:119;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3251:119:52;;;;;;;;;;;;;;;;;;;;1091:804:55;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1091:804:55;;;;;;;;;;;;;;827:23:50;;8:9:-1;5:2;;;30:1;27;20:12;5:2;827:23:50;;;;3524:135:52;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;3524:135:52;;;;;;;91:20:63;;8:9:-1;5:2;;;30:1;27;20:12;5:2;91:20:63;;;;;;;;;;;;;;;;;;;;;;;801::50;;8:9:-1;5:2;;;30:1;27;20:12;5:2;801:20:50;;;;1907:191;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1907:191:50;;;;;;;1055:514:52;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1055:514:52;;;;;;;;;3867:162;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;3867:162:52;;;;;;;;;;;;1406:407:50;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1406:407:50;;;;;;;;;333:167:63;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;333:167:63;;;;;;;856:65:50;;8:9:-1;5:2;;;30:1;27;20:12;5:2;856:65:50;;;;777:18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;2896:270:52:-;3009:10;2981:4;3001:19;;;:7;:19;;;;;;;;;:29;;;;;;;;;;;:38;;;3054:84;;;;;;;2981:4;;3001:29;;3009:10;;3054:84;;;;;;;;-1:-1:-1;3155:4:52;2896:270;;;;:::o;3251:119::-;3351:12;;3251:119;:::o;1091:804:55:-;1261:14;;;1221:4;1261:14;;;:7;:14;;;;;;;;1276:10;1261:26;;;;;;;;1318:15;;;:8;:15;;;;;;1221:4;;1261:26;1318:25;-1:-1:-1;1318:25:55;1297:98;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1426:19;;;;1405:94;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1556:13;;;;;;;:8;:13;;;;;;1530:22;;;:39;;1509:102;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1622:13;;;;;;;;:8;:13;;;;;;:23;;;;;;1655:15;;;;;;:25;;;;;;;745:10;1694:20;;1690:87;;;1730:14;;;;;;;:7;:14;;;;;;;;1745:10;1730:26;;;;;;;:36;;;;;;;1690:87;1833:3;1792:74;;1814:5;1792:74;;;1850:6;1792:74;;;;;;;;;;;;;;;;;;-1:-1:-1;1884:4:55;;1091:804;-1:-1:-1;;;;1091:804:55:o;827:23:50:-;;;;:::o;3524:135:52:-;3636:16;;3606:7;3636:16;;;:8;:16;;;;;;;3524:135::o;91:20:63:-;;;;;;:::o;801::50:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1907:191;898:23;1989:25;;;1968:87;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2066:25;2072:10;2084:6;2066:5;:25::i;:::-;1907:191;:::o;1055:514:52:-;1186:10;1136:4;1177:20;;;:8;:20;;;;;;:30;-1:-1:-1;1177:30:52;1156:103;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1316:13;;;;;;;:8;:13;;;;;;1290:22;;;:39;;1269:102;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1391:10;1382:20;;;;:8;:20;;;;;;;;:30;;;;;;;:20;1422:13;;;;;;;;;:23;;;;;;1461:79;;;;;;;1422:13;;1391:10;1461:79;;;;;;;;;;;-1:-1:-1;1558:4:52;1055:514;;;;:::o;3867:162::-;3997:15;;;;3967:7;3997:15;;;:7;:15;;;;;;;;:25;;;;;;;;;;;;;3867:162::o;1406:407:50:-;1508:19;259:5:63;;;;245:10;:19;224:85;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1530:17:50;;;;;;;:8;:17;;;;;;1561:20;;;1557:214;;;1612:51;1620:12;;1634:28;1642:11;1655:6;1634:7;:28::i;:::-;1612:7;:51::i;:::-;1597:12;:66;1557:214;;;1709:51;1717:12;;1731:28;1739:6;1747:11;1731:7;:28::i;:::-;1709:7;:51::i;:::-;1694:12;:66;1557:214;-1:-1:-1;1780:17:50;;;;;;;;:8;:17;;;;;:26;1406:407::o;333:167:63:-;259:5;;;;245:10;:19;224:85;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;429:22;;;;425:69;;467:5;:16;;;;;;;;;;;;333:167;:::o;856:65:50:-;898:23;856:65;:::o;935:277:54:-;1042:13;;;;;;;:8;:13;;;;;;1026:30;;1034:6;;1026:7;:30::i;:::-;1010:13;;;;;;;:8;:13;;;;;:46;1089:12;;1081:29;;1103:6;1081:7;:29::i;:::-;1066:12;:44;1126:79;;;;;;;;;;;;1156:1;;1126:79;;;;;;;;;935:277;;:::o;502:208:65:-;588:7;632:6;;;;611:70;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;698:5:65;;;502:208::o;716:230::-;802:7;837:5;;;873:6;;;;852:69;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;938:1;716:230;-1:-1:-1;;;716:230:65:o"
- }
- }
- },
- "sources": {
- "2.0.0/extensions/Forwarder/Forwarder.sol": {
- "id": 0
- },
- "2.0.0/extensions/Forwarder/MixinAssets.sol": {
- "id": 1
- },
- "2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol": {
- "id": 2
- },
- "2.0.0/extensions/Forwarder/MixinForwarderCore.sol": {
- "id": 3
- },
- "2.0.0/extensions/Forwarder/MixinWeth.sol": {
- "id": 4
- },
- "2.0.0/extensions/Forwarder/interfaces/IAssets.sol": {
- "id": 5
- },
- "2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol": {
- "id": 6
- },
- "2.0.0/extensions/Forwarder/libs/LibConstants.sol": {
- "id": 7
- },
- "2.0.0/extensions/Forwarder/mixins/MAssets.sol": {
- "id": 8
- },
- "2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol": {
- "id": 9
- },
- "2.0.0/extensions/Forwarder/mixins/MWeth.sol": {
- "id": 10
- },
- "2.0.0/extensions/OrderValidator/OrderValidator.sol": {
- "id": 11
- },
- "2.0.0/multisig/MultiSigWallet.sol": {
- "id": 12
- },
- "2.0.0/multisig/MultiSigWalletWithTimeLock.sol": {
- "id": 13
- },
- "2.0.0/protocol/AssetProxy/ERC20Proxy.sol": {
- "id": 14
- },
- "2.0.0/protocol/AssetProxy/ERC721Proxy.sol": {
- "id": 15
- },
- "2.0.0/protocol/AssetProxy/MixinAuthorizable.sol": {
- "id": 16
- },
- "2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol": {
- "id": 17
- },
- "2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol": {
- "id": 18
- },
- "2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol": {
- "id": 19
- },
- "2.0.0/protocol/AssetProxyOwner/AssetProxyOwner.sol": {
- "id": 20
- },
- "2.0.0/protocol/Exchange/Exchange.sol": {
- "id": 21
- },
- "2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol": {
- "id": 22
- },
- "2.0.0/protocol/Exchange/MixinExchangeCore.sol": {
- "id": 23
- },
- "2.0.0/protocol/Exchange/MixinMatchOrders.sol": {
- "id": 24
- },
- "2.0.0/protocol/Exchange/MixinSignatureValidator.sol": {
- "id": 25
- },
- "2.0.0/protocol/Exchange/MixinTransactions.sol": {
- "id": 26
- },
- "2.0.0/protocol/Exchange/MixinWrapperFunctions.sol": {
- "id": 27
- },
- "2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol": {
- "id": 28
- },
- "2.0.0/protocol/Exchange/interfaces/IExchange.sol": {
- "id": 29
- },
- "2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol": {
- "id": 30
- },
- "2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol": {
- "id": 31
- },
- "2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol": {
- "id": 32
- },
- "2.0.0/protocol/Exchange/interfaces/ITransactions.sol": {
- "id": 33
- },
- "2.0.0/protocol/Exchange/interfaces/IValidator.sol": {
- "id": 34
- },
- "2.0.0/protocol/Exchange/interfaces/IWallet.sol": {
- "id": 35
- },
- "2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol": {
- "id": 36
- },
- "2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol": {
- "id": 37
- },
- "2.0.0/protocol/Exchange/libs/LibConstants.sol": {
- "id": 38
- },
- "2.0.0/protocol/Exchange/libs/LibEIP712.sol": {
- "id": 39
- },
- "2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol": {
- "id": 40
- },
- "2.0.0/protocol/Exchange/libs/LibFillResults.sol": {
- "id": 41
- },
- "2.0.0/protocol/Exchange/libs/LibMath.sol": {
- "id": 42
- },
- "2.0.0/protocol/Exchange/libs/LibOrder.sol": {
- "id": 43
- },
- "2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol": {
- "id": 44
- },
- "2.0.0/protocol/Exchange/mixins/MExchangeCore.sol": {
- "id": 45
- },
- "2.0.0/protocol/Exchange/mixins/MMatchOrders.sol": {
- "id": 46
- },
- "2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol": {
- "id": 47
- },
- "2.0.0/protocol/Exchange/mixins/MTransactions.sol": {
- "id": 48
- },
- "2.0.0/protocol/Exchange/mixins/MWrapperFunctions.sol": {
- "id": 49
- },
- "2.0.0/test/DummyERC20Token/DummyERC20Token.sol": {
- "id": 50
- },
- "2.0.0/test/DummyERC721Token/DummyERC721Token.sol": {
- "id": 51
- },
- "2.0.0/tokens/ERC20Token/ERC20Token.sol": {
- "id": 52
- },
- "2.0.0/tokens/ERC20Token/IERC20Token.sol": {
- "id": 53
- },
- "2.0.0/tokens/ERC20Token/MintableERC20Token.sol": {
- "id": 54
- },
- "2.0.0/tokens/ERC20Token/UnlimitedAllowanceERC20Token.sol": {
- "id": 55
- },
- "2.0.0/tokens/ERC721Token/ERC721Token.sol": {
- "id": 56
- },
- "2.0.0/tokens/ERC721Token/IERC721Receiver.sol": {
- "id": 57
- },
- "2.0.0/tokens/ERC721Token/IERC721Token.sol": {
- "id": 58
- },
- "2.0.0/tokens/ERC721Token/MintableERC721Token.sol": {
- "id": 59
- },
- "2.0.0/tokens/EtherToken/IEtherToken.sol": {
- "id": 60
- },
- "2.0.0/utils/LibBytes/LibBytes.sol": {
- "id": 61
- },
- "2.0.0/utils/Ownable/IOwnable.sol": {
- "id": 62
- },
- "2.0.0/utils/Ownable/Ownable.sol": {
- "id": 63
- },
- "2.0.0/utils/ReentrancyGuard/ReentrancyGuard.sol": {
- "id": 64
- },
- "2.0.0/utils/SafeMath/SafeMath.sol": {
- "id": 65
- }
- },
- "sourceCodes": {
- "2.0.0/extensions/Forwarder/Forwarder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./MixinWeth.sol\";\nimport \"./MixinForwarderCore.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./MixinAssets.sol\";\nimport \"./MixinExchangeWrapper.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract Forwarder is\n LibConstants,\n MixinWeth,\n MixinAssets,\n MixinExchangeWrapper,\n MixinForwarderCore\n{\n constructor (\n address _exchange,\n bytes memory _zrxAssetData,\n bytes memory _wethAssetData\n )\n public\n LibConstants(\n _exchange,\n _zrxAssetData,\n _wethAssetData\n )\n MixinForwarderCore()\n {}\n}\n",
- "2.0.0/extensions/Forwarder/MixinAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"../../tokens/ERC20Token/IERC20Token.sol\";\nimport \"../../tokens/ERC721Token/IERC721Token.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MAssets.sol\";\n\n\ncontract MixinAssets is\n Ownable,\n LibConstants,\n MAssets\n{\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_TRANSFER_SELECTOR = bytes4(keccak256(\"transfer(address,uint256)\"));\n\n /// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to \n /// function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be\n /// used to withdraw assets that were accidentally sent to this contract.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of ERC20 token to withdraw.\n function withdrawAsset(\n bytes assetData,\n uint256 amount\n )\n external\n onlyOwner\n {\n transferAssetToSender(assetData, amount);\n }\n\n /// @dev Transfers given amount of asset to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferAssetToSender(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n bytes4 proxyId = assetData.readBytes4(0);\n\n if (proxyId == ERC20_DATA_ID) {\n transferERC20Token(assetData, amount);\n } else if (proxyId == ERC721_DATA_ID) {\n transferERC721Token(assetData, amount);\n } else {\n revert(\"UNSUPPORTED_ASSET_PROXY\");\n }\n }\n\n /// @dev Decodes ERC20 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC20Token(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n address token = assetData.readAddress(16);\n\n // Transfer tokens.\n // We do a raw call so we can check the success separate\n // from the return data.\n bool success = token.call(abi.encodeWithSelector(\n ERC20_TRANSFER_SELECTOR,\n msg.sender,\n amount\n ));\n require(\n success,\n \"TRANSFER_FAILED\"\n );\n \n // Check return data.\n // If there is no return data, we assume the token incorrectly\n // does not return a bool. In this case we expect it to revert\n // on failure, which was handled above.\n // If the token does return data, we require that it is a single\n // value that evaluates to true.\n assembly {\n if returndatasize {\n success := 0\n if eq(returndatasize, 32) {\n // First 64 bytes of memory are reserved scratch space\n returndatacopy(0, 0, 32)\n success := mload(0)\n }\n }\n }\n require(\n success,\n \"TRANSFER_FAILED\"\n );\n }\n\n /// @dev Decodes ERC721 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC721Token(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n require(\n amount == 1,\n \"INVALID_AMOUNT\"\n );\n // Decode asset data.\n address token = assetData.readAddress(16);\n uint256 tokenId = assetData.readUint256(36);\n\n // Perform transfer.\n IERC721Token(token).transferFrom(\n address(this),\n msg.sender,\n tokenId\n );\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MExchangeWrapper.sol\";\nimport \"../../protocol/Exchange/libs/LibAbiEncoder.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../protocol/Exchange/libs/LibFillResults.sol\";\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\n\n\ncontract MixinExchangeWrapper is\n LibAbiEncoder,\n LibFillResults,\n LibMath,\n LibConstants,\n MExchangeWrapper\n{\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n // ABI encode calldata for `fillOrder`\n bytes memory fillOrderCalldata = abiEncodeFillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n\n address exchange = address(EXCHANGE);\n\n // Call `fillOrder` and handle any exceptions gracefully\n assembly {\n let success := call(\n gas, // forward all gas\n exchange, // call address of Exchange contract\n 0, // transfer 0 wei\n add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes)\n mload(fillOrderCalldata), // length of input\n fillOrderCalldata, // write output over input\n 128 // output size is 128 bytes\n )\n if success {\n mstore(fillResults, mload(fillOrderCalldata))\n mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32)))\n mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64)))\n mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96)))\n }\n }\n // fillResults values will be 0 by default if call was unsuccessful\n return fillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of WETH has been sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param wethSellAmount Desired amount of WETH to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellWeth(\n LibOrder.Order[] memory orders,\n uint256 wethSellAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // We assume that asset being sold by taker is WETH for each order.\n orders[i].makerAssetData = makerAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of WETH to sell\n uint256 remainingTakerAssetFillAmount = safeSub(wethSellAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of WETH\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= wethSellAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// The asset being sold by taker must always be WETH.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyExactAmountWithWeth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // We assume that asset being sold by taker is WETH for each order.\n orders[i].makerAssetData = makerAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n uint256 makerAssetFilledAmount = totalFillResults.makerAssetFilledAmount;\n if (makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n\n require(\n makerAssetFilledAmount >= makerAssetFillAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return totalFillResults;\n }\n\n /// @dev Buys zrxBuyAmount of ZRX fee tokens, taking into account ZRX fees for each order. This will guarantee\n /// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues).\n /// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX\n /// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases.\n /// The asset being sold by taker must always be WETH. \n /// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset.\n /// @param zrxBuyAmount Desired amount of ZRX to buy.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return totalFillResults Amounts filled and fees paid by maker and taker.\n function marketBuyExactZrxWithWeth(\n LibOrder.Order[] memory orders,\n uint256 zrxBuyAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n // Do nothing if zrxBuyAmount == 0\n if (zrxBuyAmount == 0) {\n return totalFillResults;\n }\n\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n uint256 zrxPurchased = 0;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // All of these are ZRX/WETH, so we can drop the respective assetData from calldata.\n orders[i].makerAssetData = zrxAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of ZRX to buy.\n uint256 remainingZrxBuyAmount = safeSub(zrxBuyAmount, zrxPurchased);\n\n // Convert the remaining amount of ZRX to buy into remaining amount\n // of WETH to sell, assuming entire amount can be sold in the current order.\n uint256 remainingWethSellAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n safeSub(orders[i].makerAssetAmount, orders[i].takerFee), // our exchange rate after fees \n remainingZrxBuyAmount\n );\n\n // Attempt to sell the remaining amount of WETH.\n FillResults memory singleFillResult = fillOrderNoThrow(\n orders[i],\n safeAdd(remainingWethSellAmount, 1), // we add 1 wei to the fill amount to make up for rounding errors\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker.\n addFillResults(totalFillResults, singleFillResult);\n zrxPurchased = safeSub(totalFillResults.makerAssetFilledAmount, totalFillResults.takerFeePaid);\n\n // Stop execution if the entire amount of ZRX has been bought.\n if (zrxPurchased >= zrxBuyAmount) {\n break;\n }\n }\n\n require(\n zrxPurchased >= zrxBuyAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return totalFillResults;\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinForwarderCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MWeth.sol\";\nimport \"./mixins/MAssets.sol\";\nimport \"./mixins/MExchangeWrapper.sol\";\nimport \"./interfaces/IForwarderCore.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../protocol/Exchange/libs/LibFillResults.sol\";\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\n\n\ncontract MixinForwarderCore is\n LibFillResults,\n LibMath,\n LibConstants,\n MWeth,\n MAssets,\n MExchangeWrapper,\n IForwarderCore\n{\n using LibBytes for bytes;\n\n /// @dev Constructor approves ERC20 proxy to transfer ZRX and WETH on this contract's behalf.\n constructor ()\n public\n {\n address proxyAddress = EXCHANGE.getAssetProxy(ERC20_DATA_ID);\n require(\n proxyAddress != address(0),\n \"UNREGISTERED_ASSET_PROXY\"\n );\n ETHER_TOKEN.approve(proxyAddress, MAX_UINT);\n ZRX_TOKEN.approve(proxyAddress, MAX_UINT);\n }\n\n /// @dev Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketSellOrdersWithEth(\n LibOrder.Order[] memory orders,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n FillResults memory orderFillResults,\n FillResults memory feeOrderFillResults\n )\n {\n // Convert ETH to WETH.\n convertEthToWeth();\n\n uint256 wethSellAmount;\n uint256 zrxBuyAmount;\n uint256 makerAssetAmountPurchased;\n if (orders[0].makerAssetData.equals(ZRX_ASSET_DATA)) {\n // Calculate amount of WETH that won't be spent on ETH fees.\n wethSellAmount = getPartialAmountFloor(\n PERCENTAGE_DENOMINATOR,\n safeAdd(PERCENTAGE_DENOMINATOR, feePercentage),\n msg.value\n );\n // Market sell available WETH.\n // ZRX fees are paid with this contract's balance.\n orderFillResults = marketSellWeth(\n orders,\n wethSellAmount,\n signatures\n );\n // The fee amount must be deducted from the amount transfered back to sender.\n makerAssetAmountPurchased = safeSub(orderFillResults.makerAssetFilledAmount, orderFillResults.takerFeePaid);\n } else {\n // 5% of WETH is reserved for filling feeOrders and paying feeRecipient.\n wethSellAmount = getPartialAmountFloor(\n MAX_WETH_FILL_PERCENTAGE,\n PERCENTAGE_DENOMINATOR,\n msg.value\n );\n // Market sell 95% of WETH.\n // ZRX fees are payed with this contract's balance.\n orderFillResults = marketSellWeth(\n orders,\n wethSellAmount,\n signatures\n );\n // Buy back all ZRX spent on fees.\n zrxBuyAmount = orderFillResults.takerFeePaid;\n feeOrderFillResults = marketBuyExactZrxWithWeth(\n feeOrders,\n zrxBuyAmount,\n feeSignatures\n );\n makerAssetAmountPurchased = orderFillResults.makerAssetFilledAmount;\n }\n\n // Transfer feePercentage of total ETH spent on primary orders to feeRecipient.\n // Refund remaining ETH to msg.sender.\n transferEthFeeAndRefund(\n orderFillResults.takerAssetFilledAmount,\n feeOrderFillResults.takerAssetFilledAmount,\n feePercentage,\n feeRecipient\n );\n\n // Transfer purchased assets to msg.sender.\n transferAssetToSender(orders[0].makerAssetData, makerAssetAmountPurchased);\n }\n\n /// @dev Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param makerAssetFillAmount Desired amount of makerAsset to purchase.\n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketBuyOrdersWithEth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n FillResults memory orderFillResults,\n FillResults memory feeOrderFillResults\n )\n {\n // Convert ETH to WETH.\n convertEthToWeth();\n\n uint256 zrxBuyAmount;\n uint256 makerAssetAmountPurchased;\n if (orders[0].makerAssetData.equals(ZRX_ASSET_DATA)) {\n // If the makerAsset is ZRX, it is not necessary to pay fees out of this\n // contracts's ZRX balance because fees are factored into the price of the order.\n orderFillResults = marketBuyExactZrxWithWeth(\n orders,\n makerAssetFillAmount,\n signatures\n );\n // The fee amount must be deducted from the amount transfered back to sender.\n makerAssetAmountPurchased = safeSub(orderFillResults.makerAssetFilledAmount, orderFillResults.takerFeePaid);\n } else {\n // Attemp to purchase desired amount of makerAsset.\n // ZRX fees are payed with this contract's balance.\n orderFillResults = marketBuyExactAmountWithWeth(\n orders,\n makerAssetFillAmount,\n signatures\n );\n // Buy back all ZRX spent on fees.\n zrxBuyAmount = orderFillResults.takerFeePaid;\n feeOrderFillResults = marketBuyExactZrxWithWeth(\n feeOrders,\n zrxBuyAmount,\n feeSignatures\n );\n makerAssetAmountPurchased = orderFillResults.makerAssetFilledAmount;\n }\n\n // Transfer feePercentage of total ETH spent on primary orders to feeRecipient.\n // Refund remaining ETH to msg.sender.\n transferEthFeeAndRefund(\n orderFillResults.takerAssetFilledAmount,\n feeOrderFillResults.takerAssetFilledAmount,\n feePercentage,\n feeRecipient\n );\n\n // Transfer purchased assets to msg.sender.\n transferAssetToSender(orders[0].makerAssetData, makerAssetAmountPurchased);\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinWeth.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MWeth.sol\";\n\n\ncontract MixinWeth is\n LibMath,\n LibConstants,\n MWeth\n{\n /// @dev Default payabale function, this allows us to withdraw WETH\n function ()\n public\n payable\n {\n require(\n msg.sender == address(ETHER_TOKEN),\n \"DEFAULT_FUNCTION_WETH_CONTRACT_ONLY\"\n );\n }\n\n /// @dev Converts message call's ETH value into WETH.\n function convertEthToWeth()\n internal\n {\n require(\n msg.value > 0,\n \"INVALID_MSG_VALUE\"\n );\n ETHER_TOKEN.deposit.value(msg.value)();\n }\n\n /// @dev Transfers feePercentage of WETH spent on primary orders to feeRecipient.\n /// Refunds any excess ETH to msg.sender.\n /// @param wethSoldExcludingFeeOrders Amount of WETH sold when filling primary orders.\n /// @param wethSoldForZrx Amount of WETH sold when purchasing ZRX required for primary order fees.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n function transferEthFeeAndRefund(\n uint256 wethSoldExcludingFeeOrders,\n uint256 wethSoldForZrx,\n uint256 feePercentage,\n address feeRecipient\n )\n internal\n {\n // Ensure feePercentage is less than 5%.\n require(\n feePercentage <= MAX_FEE_PERCENTAGE,\n \"FEE_PERCENTAGE_TOO_LARGE\"\n );\n\n // Ensure that no extra WETH owned by this contract has been sold.\n uint256 wethSold = safeAdd(wethSoldExcludingFeeOrders, wethSoldForZrx);\n require(\n wethSold <= msg.value,\n \"OVERSOLD_WETH\"\n );\n\n // Calculate amount of WETH that hasn't been sold.\n uint256 wethRemaining = safeSub(msg.value, wethSold);\n\n // Calculate ETH fee to pay to feeRecipient.\n uint256 ethFee = getPartialAmountFloor(\n feePercentage,\n PERCENTAGE_DENOMINATOR,\n wethSoldExcludingFeeOrders\n );\n\n // Ensure fee is less than amount of WETH remaining.\n require(\n ethFee <= wethRemaining,\n \"INSUFFICIENT_ETH_REMAINING\"\n );\n \n // Do nothing if no WETH remaining\n if (wethRemaining > 0) {\n // Convert remaining WETH to ETH\n ETHER_TOKEN.withdraw(wethRemaining);\n\n // Pay ETH to feeRecipient\n if (ethFee > 0) {\n feeRecipient.transfer(ethFee);\n }\n\n // Refund remaining ETH to msg.sender.\n uint256 ethRefund = safeSub(wethRemaining, ethFee);\n if (ethRefund > 0) {\n msg.sender.transfer(ethRefund);\n }\n }\n }\n}\n",
- "2.0.0/extensions/Forwarder/interfaces/IAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IAssets {\n\n /// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to \n /// function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be\n /// used to withdraw assets that were accidentally sent to this contract.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of ERC20 token to withdraw.\n function withdrawAsset(\n bytes assetData,\n uint256 amount\n )\n external;\n}\n",
- "2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../../protocol/Exchange/libs/LibFillResults.sol\";\n\n\ncontract IForwarderCore {\n\n /// @dev Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketSellOrdersWithEth(\n LibOrder.Order[] memory orders,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n LibFillResults.FillResults memory orderFillResults,\n LibFillResults.FillResults memory feeOrderFillResults\n );\n\n /// @dev Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param makerAssetFillAmount Desired amount of makerAsset to purchase.\n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketBuyOrdersWithEth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n LibFillResults.FillResults memory orderFillResults,\n LibFillResults.FillResults memory feeOrderFillResults\n );\n}\n",
- "2.0.0/extensions/Forwarder/libs/LibConstants.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/LibBytes/LibBytes.sol\";\nimport \"../../../protocol/Exchange/interfaces/IExchange.sol\";\nimport \"../../../tokens/EtherToken/IEtherToken.sol\";\nimport \"../../../tokens/ERC20Token/IERC20Token.sol\";\n\n\ncontract LibConstants {\n\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n uint256 constant internal MAX_UINT = 2**256 - 1;\n uint256 constant internal PERCENTAGE_DENOMINATOR = 10**18; \n uint256 constant internal MAX_FEE_PERCENTAGE = 5 * PERCENTAGE_DENOMINATOR / 100; // 5%\n uint256 constant internal MAX_WETH_FILL_PERCENTAGE = 95 * PERCENTAGE_DENOMINATOR / 100; // 95%\n \n // solhint-disable var-name-mixedcase\n IExchange internal EXCHANGE;\n IEtherToken internal ETHER_TOKEN;\n IERC20Token internal ZRX_TOKEN;\n bytes internal ZRX_ASSET_DATA;\n bytes internal WETH_ASSET_DATA;\n // solhint-enable var-name-mixedcase\n\n constructor (\n address _exchange,\n bytes memory _zrxAssetData,\n bytes memory _wethAssetData\n )\n public\n {\n EXCHANGE = IExchange(_exchange);\n ZRX_ASSET_DATA = _zrxAssetData;\n WETH_ASSET_DATA = _wethAssetData;\n\n address etherToken = _wethAssetData.readAddress(16);\n address zrxToken = _zrxAssetData.readAddress(16);\n ETHER_TOKEN = IEtherToken(etherToken);\n ZRX_TOKEN = IERC20Token(zrxToken);\n }\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAssets.sol\";\n\n\ncontract MAssets is\n IAssets\n{\n /// @dev Transfers given amount of asset to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferAssetToSender(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n\n /// @dev Decodes ERC20 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC20Token(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n\n /// @dev Decodes ERC721 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC721Token(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../../protocol/Exchange/libs/LibFillResults.sol\";\n\n\ncontract MExchangeWrapper {\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of WETH has been sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param wethSellAmount Desired amount of WETH to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellWeth(\n LibOrder.Order[] memory orders,\n uint256 wethSellAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// The asset being sold by taker must always be WETH.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyExactAmountWithWeth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Buys zrxBuyAmount of ZRX fee tokens, taking into account ZRX fees for each order. This will guarantee\n /// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues).\n /// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX\n /// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases.\n /// The asset being sold by taker must always be WETH. \n /// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset.\n /// @param zrxBuyAmount Desired amount of ZRX to buy.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return totalFillResults Amounts filled and fees paid by maker and taker.\n function marketBuyExactZrxWithWeth(\n LibOrder.Order[] memory orders,\n uint256 zrxBuyAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MWeth.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract MWeth {\n\n /// @dev Converts message call's ETH value into WETH.\n function convertEthToWeth()\n internal;\n\n /// @dev Transfers feePercentage of WETH spent on primary orders to feeRecipient.\n /// Refunds any excess ETH to msg.sender.\n /// @param wethSoldExcludingFeeOrders Amount of WETH sold when filling primary orders.\n /// @param wethSoldForZrx Amount of WETH sold when purchasing ZRX required for primary order fees.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n function transferEthFeeAndRefund(\n uint256 wethSoldExcludingFeeOrders,\n uint256 wethSoldForZrx,\n uint256 feePercentage,\n address feeRecipient\n )\n internal;\n}\n",
- "2.0.0/extensions/OrderValidator/OrderValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../protocol/Exchange/interfaces/IExchange.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../tokens/ERC20Token/IERC20Token.sol\";\nimport \"../../tokens/ERC721Token/IERC721Token.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\n\n\ncontract OrderValidator {\n\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n\n struct TraderInfo {\n uint256 makerBalance; // Maker's balance of makerAsset\n uint256 makerAllowance; // Maker's allowance to corresponding AssetProxy\n uint256 takerBalance; // Taker's balance of takerAsset\n uint256 takerAllowance; // Taker's allowance to corresponding AssetProxy\n uint256 makerZrxBalance; // Maker's balance of ZRX\n uint256 makerZrxAllowance; // Maker's allowance of ZRX to ERC20Proxy\n uint256 takerZrxBalance; // Taker's balance of ZRX\n uint256 takerZrxAllowance; // Taker's allowance of ZRX to ERC20Proxy\n }\n\n // solhint-disable var-name-mixedcase\n IExchange internal EXCHANGE;\n bytes internal ZRX_ASSET_DATA;\n // solhint-enable var-name-mixedcase\n\n constructor (address _exchange, bytes memory _zrxAssetData)\n public\n {\n EXCHANGE = IExchange(_exchange);\n ZRX_ASSET_DATA = _zrxAssetData;\n }\n\n /// @dev Fetches information for order and maker/taker of order.\n /// @param order The order structure.\n /// @param takerAddress Address that will be filling the order.\n /// @return OrderInfo and TraderInfo instances for given order.\n function getOrderAndTraderInfo(LibOrder.Order memory order, address takerAddress)\n public\n view\n returns (LibOrder.OrderInfo memory orderInfo, TraderInfo memory traderInfo)\n {\n orderInfo = EXCHANGE.getOrderInfo(order);\n traderInfo = getTraderInfo(order, takerAddress);\n return (orderInfo, traderInfo);\n }\n\n /// @dev Fetches information for all passed in orders and the makers/takers of each order.\n /// @param orders Array of order specifications.\n /// @param takerAddresses Array of taker addresses corresponding to each order.\n /// @return Arrays of OrderInfo and TraderInfo instances that correspond to each order.\n function getOrdersAndTradersInfo(LibOrder.Order[] memory orders, address[] memory takerAddresses)\n public\n view\n returns (LibOrder.OrderInfo[] memory ordersInfo, TraderInfo[] memory tradersInfo)\n {\n ordersInfo = EXCHANGE.getOrdersInfo(orders);\n tradersInfo = getTradersInfo(orders, takerAddresses);\n return (ordersInfo, tradersInfo);\n }\n\n /// @dev Fetches balance and allowances for maker and taker of order.\n /// @param order The order structure.\n /// @param takerAddress Address that will be filling the order.\n /// @return Balances and allowances of maker and taker of order.\n function getTraderInfo(LibOrder.Order memory order, address takerAddress)\n public\n view\n returns (TraderInfo memory traderInfo)\n {\n (traderInfo.makerBalance, traderInfo.makerAllowance) = getBalanceAndAllowance(order.makerAddress, order.makerAssetData);\n (traderInfo.takerBalance, traderInfo.takerAllowance) = getBalanceAndAllowance(takerAddress, order.takerAssetData);\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n (traderInfo.makerZrxBalance, traderInfo.makerZrxAllowance) = getBalanceAndAllowance(order.makerAddress, zrxAssetData);\n (traderInfo.takerZrxBalance, traderInfo.takerZrxAllowance) = getBalanceAndAllowance(takerAddress, zrxAssetData);\n return traderInfo;\n }\n\n /// @dev Fetches balances and allowances of maker and taker for each provided order.\n /// @param orders Array of order specifications.\n /// @param takerAddresses Array of taker addresses corresponding to each order.\n /// @return Array of balances and allowances for maker and taker of each order.\n function getTradersInfo(LibOrder.Order[] memory orders, address[] memory takerAddresses)\n public\n view\n returns (TraderInfo[] memory)\n {\n uint256 ordersLength = orders.length;\n TraderInfo[] memory tradersInfo = new TraderInfo[](ordersLength);\n for (uint256 i = 0; i != ordersLength; i++) {\n tradersInfo[i] = getTraderInfo(orders[i], takerAddresses[i]);\n }\n return tradersInfo;\n }\n\n /// @dev Fetches token balances and allowances of an address to given assetProxy. Supports ERC20 and ERC721.\n /// @param target Address to fetch balances and allowances of.\n /// @param assetData Encoded data that can be decoded by a specified proxy contract when transferring asset.\n /// @return Balance of asset and allowance set to given proxy of asset.\n /// For ERC721 tokens, these values will always be 1 or 0.\n function getBalanceAndAllowance(address target, bytes memory assetData)\n public\n view\n returns (uint256 balance, uint256 allowance)\n {\n bytes4 assetProxyId = assetData.readBytes4(0);\n address token = assetData.readAddress(16);\n address assetProxy = EXCHANGE.getAssetProxy(assetProxyId);\n\n if (assetProxyId == ERC20_DATA_ID) {\n // Query balance\n balance = IERC20Token(token).balanceOf(target);\n\n // Query allowance\n allowance = IERC20Token(token).allowance(target, assetProxy);\n } else if (assetProxyId == ERC721_DATA_ID) {\n uint256 tokenId = assetData.readUint256(36);\n\n // Query owner of tokenId\n address owner = getERC721TokenOwner(token, tokenId);\n\n // Set balance to 1 if tokenId is owned by target\n balance = target == owner ? 1 : 0;\n\n // Check if ERC721Proxy is approved to spend tokenId\n bool isApproved = IERC721Token(token).isApprovedForAll(target, assetProxy) || IERC721Token(token).getApproved(tokenId) == assetProxy;\n \n // Set alowance to 1 if ERC721Proxy is approved to spend tokenId\n allowance = isApproved ? 1 : 0;\n } else {\n revert(\"UNSUPPORTED_ASSET_PROXY\");\n }\n return (balance, allowance);\n }\n\n /// @dev Fetches token balances and allowances of an address for each given assetProxy. Supports ERC20 and ERC721.\n /// @param target Address to fetch balances and allowances of.\n /// @param assetData Array of encoded byte arrays that can be decoded by a specified proxy contract when transferring asset.\n /// @return Balances and allowances of assets.\n /// For ERC721 tokens, these values will always be 1 or 0.\n function getBalancesAndAllowances(address target, bytes[] memory assetData)\n public\n view\n returns (uint256[] memory, uint256[] memory)\n {\n uint256 length = assetData.length;\n uint256[] memory balances = new uint256[](length);\n uint256[] memory allowances = new uint256[](length);\n for (uint256 i = 0; i != length; i++) {\n (balances[i], allowances[i]) = getBalanceAndAllowance(target, assetData[i]);\n }\n return (balances, allowances);\n }\n\n /// @dev Calls `token.ownerOf(tokenId)`, but returns a null owner instead of reverting on an unowned token.\n /// @param token Address of ERC721 token.\n /// @param tokenId The identifier for the specific NFT.\n /// @return Owner of tokenId or null address if unowned.\n function getERC721TokenOwner(address token, uint256 tokenId)\n public\n view\n returns (address owner)\n {\n assembly {\n // load free memory pointer\n let cdStart := mload(64)\n\n // bytes4(keccak256(ownerOf(uint256))) = 0x6352211e\n mstore(cdStart, 0x6352211e00000000000000000000000000000000000000000000000000000000)\n mstore(add(cdStart, 4), tokenId)\n\n // staticcall `ownerOf(tokenId)`\n // `ownerOf` will revert if tokenId is not owned\n let success := staticcall(\n gas, // forward all gas\n token, // call token contract\n cdStart, // start of calldata\n 36, // length of input is 36 bytes\n cdStart, // write output over input\n 32 // size of output is 32 bytes\n )\n\n // Success implies that tokenId is owned\n // Copy owner from return data if successful\n if success {\n owner := mload(cdStart)\n } \n }\n\n // Owner initialized to address(0), no need to modify if call is unsuccessful\n return owner;\n }\n}\n",
- "2.0.0/multisig/MultiSigWallet.sol": "// solhint-disable\npragma solidity ^0.4.15;\n\n\n/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.\n/// @author Stefan George - <stefan.george@consensys.net>\ncontract MultiSigWallet {\n\n /*\n * Events\n */\n event Confirmation(address indexed sender, uint indexed transactionId);\n event Revocation(address indexed sender, uint indexed transactionId);\n event Submission(uint indexed transactionId);\n event Execution(uint indexed transactionId);\n event ExecutionFailure(uint indexed transactionId);\n event Deposit(address indexed sender, uint value);\n event OwnerAddition(address indexed owner);\n event OwnerRemoval(address indexed owner);\n event RequirementChange(uint required);\n\n /*\n * Constants\n */\n uint constant public MAX_OWNER_COUNT = 50;\n\n /*\n * Storage\n */\n mapping (uint => Transaction) public transactions;\n mapping (uint => mapping (address => bool)) public confirmations;\n mapping (address => bool) public isOwner;\n address[] public owners;\n uint public required;\n uint public transactionCount;\n\n struct Transaction {\n address destination;\n uint value;\n bytes data;\n bool executed;\n }\n\n /*\n * Modifiers\n */\n modifier onlyWallet() {\n require(msg.sender == address(this));\n _;\n }\n\n modifier ownerDoesNotExist(address owner) {\n require(!isOwner[owner]);\n _;\n }\n\n modifier ownerExists(address owner) {\n require(isOwner[owner]);\n _;\n }\n\n modifier transactionExists(uint transactionId) {\n require(transactions[transactionId].destination != 0);\n _;\n }\n\n modifier confirmed(uint transactionId, address owner) {\n require(confirmations[transactionId][owner]);\n _;\n }\n\n modifier notConfirmed(uint transactionId, address owner) {\n require(!confirmations[transactionId][owner]);\n _;\n }\n\n modifier notExecuted(uint transactionId) {\n require(!transactions[transactionId].executed);\n _;\n }\n\n modifier notNull(address _address) {\n require(_address != 0);\n _;\n }\n\n modifier validRequirement(uint ownerCount, uint _required) {\n require(ownerCount <= MAX_OWNER_COUNT\n && _required <= ownerCount\n && _required != 0\n && ownerCount != 0);\n _;\n }\n\n /// @dev Fallback function allows to deposit ether.\n function()\n payable\n {\n if (msg.value > 0)\n Deposit(msg.sender, msg.value);\n }\n\n /*\n * Public functions\n */\n /// @dev Contract constructor sets initial owners and required number of confirmations.\n /// @param _owners List of initial owners.\n /// @param _required Number of required confirmations.\n function MultiSigWallet(address[] _owners, uint _required)\n public\n validRequirement(_owners.length, _required)\n {\n for (uint i=0; i<_owners.length; i++) {\n require(!isOwner[_owners[i]] && _owners[i] != 0);\n isOwner[_owners[i]] = true;\n }\n owners = _owners;\n required = _required;\n }\n\n /// @dev Allows to add a new owner. Transaction has to be sent by wallet.\n /// @param owner Address of new owner.\n function addOwner(address owner)\n public\n onlyWallet\n ownerDoesNotExist(owner)\n notNull(owner)\n validRequirement(owners.length + 1, required)\n {\n isOwner[owner] = true;\n owners.push(owner);\n OwnerAddition(owner);\n }\n\n /// @dev Allows to remove an owner. Transaction has to be sent by wallet.\n /// @param owner Address of owner.\n function removeOwner(address owner)\n public\n onlyWallet\n ownerExists(owner)\n {\n isOwner[owner] = false;\n for (uint i=0; i<owners.length - 1; i++)\n if (owners[i] == owner) {\n owners[i] = owners[owners.length - 1];\n break;\n }\n owners.length -= 1;\n if (required > owners.length)\n changeRequirement(owners.length);\n OwnerRemoval(owner);\n }\n\n /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet.\n /// @param owner Address of owner to be replaced.\n /// @param newOwner Address of new owner.\n function replaceOwner(address owner, address newOwner)\n public\n onlyWallet\n ownerExists(owner)\n ownerDoesNotExist(newOwner)\n {\n for (uint i=0; i<owners.length; i++)\n if (owners[i] == owner) {\n owners[i] = newOwner;\n break;\n }\n isOwner[owner] = false;\n isOwner[newOwner] = true;\n OwnerRemoval(owner);\n OwnerAddition(newOwner);\n }\n\n /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet.\n /// @param _required Number of required confirmations.\n function changeRequirement(uint _required)\n public\n onlyWallet\n validRequirement(owners.length, _required)\n {\n required = _required;\n RequirementChange(_required);\n }\n\n /// @dev Allows an owner to submit and confirm a transaction.\n /// @param destination Transaction target address.\n /// @param value Transaction ether value.\n /// @param data Transaction data payload.\n /// @return Returns transaction ID.\n function submitTransaction(address destination, uint value, bytes data)\n public\n returns (uint transactionId)\n {\n transactionId = addTransaction(destination, value, data);\n confirmTransaction(transactionId);\n }\n\n /// @dev Allows an owner to confirm a transaction.\n /// @param transactionId Transaction ID.\n function confirmTransaction(uint transactionId)\n public\n ownerExists(msg.sender)\n transactionExists(transactionId)\n notConfirmed(transactionId, msg.sender)\n {\n confirmations[transactionId][msg.sender] = true;\n Confirmation(msg.sender, transactionId);\n executeTransaction(transactionId);\n }\n\n /// @dev Allows an owner to revoke a confirmation for a transaction.\n /// @param transactionId Transaction ID.\n function revokeConfirmation(uint transactionId)\n public\n ownerExists(msg.sender)\n confirmed(transactionId, msg.sender)\n notExecuted(transactionId)\n {\n confirmations[transactionId][msg.sender] = false;\n Revocation(msg.sender, transactionId);\n }\n\n /// @dev Allows anyone to execute a confirmed transaction.\n /// @param transactionId Transaction ID.\n function executeTransaction(uint transactionId)\n public\n ownerExists(msg.sender)\n confirmed(transactionId, msg.sender)\n notExecuted(transactionId)\n {\n if (isConfirmed(transactionId)) {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data))\n Execution(transactionId);\n else {\n ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n }\n\n // call has been separated into its own function in order to take advantage\n // of the Solidity's code generator to produce a loop that copies tx.data into memory.\n function external_call(address destination, uint value, uint dataLength, bytes data) internal returns (bool) {\n bool result;\n assembly {\n let x := mload(0x40) // \"Allocate\" memory for output (0x40 is where \"free memory\" pointer is stored by convention)\n let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that\n result := call(\n sub(gas, 34710), // 34710 is the value that solidity is currently emitting\n // It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) +\n // callNewAccountGas (25000, in case the destination address does not exist and needs creating)\n destination,\n value,\n d,\n dataLength, // Size of the input (in bytes) - this is what fixes the padding problem\n x,\n 0 // Output is ignored, therefore the output size is zero\n )\n }\n return result;\n }\n\n /// @dev Returns the confirmation status of a transaction.\n /// @param transactionId Transaction ID.\n /// @return Confirmation status.\n function isConfirmed(uint transactionId)\n public\n constant\n returns (bool)\n {\n uint count = 0;\n for (uint i=0; i<owners.length; i++) {\n if (confirmations[transactionId][owners[i]])\n count += 1;\n if (count == required)\n return true;\n }\n }\n\n /*\n * Internal functions\n */\n /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet.\n /// @param destination Transaction target address.\n /// @param value Transaction ether value.\n /// @param data Transaction data payload.\n /// @return Returns transaction ID.\n function addTransaction(address destination, uint value, bytes data)\n internal\n notNull(destination)\n returns (uint transactionId)\n {\n transactionId = transactionCount;\n transactions[transactionId] = Transaction({\n destination: destination,\n value: value,\n data: data,\n executed: false\n });\n transactionCount += 1;\n Submission(transactionId);\n }\n\n /*\n * Web3 call functions\n */\n /// @dev Returns number of confirmations of a transaction.\n /// @param transactionId Transaction ID.\n /// @return Number of confirmations.\n function getConfirmationCount(uint transactionId)\n public\n constant\n returns (uint count)\n {\n for (uint i=0; i<owners.length; i++)\n if (confirmations[transactionId][owners[i]])\n count += 1;\n }\n\n /// @dev Returns total number of transactions after filers are applied.\n /// @param pending Include pending transactions.\n /// @param executed Include executed transactions.\n /// @return Total number of transactions after filters are applied.\n function getTransactionCount(bool pending, bool executed)\n public\n constant\n returns (uint count)\n {\n for (uint i=0; i<transactionCount; i++)\n if ( pending && !transactions[i].executed\n || executed && transactions[i].executed)\n count += 1;\n }\n\n /// @dev Returns list of owners.\n /// @return List of owner addresses.\n function getOwners()\n public\n constant\n returns (address[])\n {\n return owners;\n }\n\n /// @dev Returns array with owner addresses, which confirmed transaction.\n /// @param transactionId Transaction ID.\n /// @return Returns array of owner addresses.\n function getConfirmations(uint transactionId)\n public\n constant\n returns (address[] _confirmations)\n {\n address[] memory confirmationsTemp = new address[](owners.length);\n uint count = 0;\n uint i;\n for (i=0; i<owners.length; i++)\n if (confirmations[transactionId][owners[i]]) {\n confirmationsTemp[count] = owners[i];\n count += 1;\n }\n _confirmations = new address[](count);\n for (i=0; i<count; i++)\n _confirmations[i] = confirmationsTemp[i];\n }\n\n /// @dev Returns list of transaction IDs in defined range.\n /// @param from Index start position of transaction array.\n /// @param to Index end position of transaction array.\n /// @param pending Include pending transactions.\n /// @param executed Include executed transactions.\n /// @return Returns array of transaction IDs.\n function getTransactionIds(uint from, uint to, bool pending, bool executed)\n public\n constant\n returns (uint[] _transactionIds)\n {\n uint[] memory transactionIdsTemp = new uint[](transactionCount);\n uint count = 0;\n uint i;\n for (i=0; i<transactionCount; i++)\n if ( pending && !transactions[i].executed\n || executed && transactions[i].executed)\n {\n transactionIdsTemp[count] = i;\n count += 1;\n }\n _transactionIds = new uint[](to - from);\n for (i=from; i<to; i++)\n _transactionIds[i - from] = transactionIdsTemp[i];\n }\n}",
- "2.0.0/multisig/MultiSigWalletWithTimeLock.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MultiSigWallet.sol\";\n\n\n/// @title Multisignature wallet with time lock- Allows multiple parties to execute a transaction after a time lock has passed.\n/// @author Amir Bandeali - <amir@0xProject.com>\n// solhint-disable not-rely-on-time\ncontract MultiSigWalletWithTimeLock is\n MultiSigWallet\n{\n event ConfirmationTimeSet(uint256 indexed transactionId, uint256 confirmationTime);\n event TimeLockChange(uint256 secondsTimeLocked);\n\n uint256 public secondsTimeLocked;\n\n mapping (uint256 => uint256) public confirmationTimes;\n\n modifier notFullyConfirmed(uint256 transactionId) {\n require(\n !isConfirmed(transactionId),\n \"TX_FULLY_CONFIRMED\"\n );\n _;\n }\n\n modifier fullyConfirmed(uint256 transactionId) {\n require(\n isConfirmed(transactionId),\n \"TX_NOT_FULLY_CONFIRMED\"\n );\n _;\n }\n\n modifier pastTimeLock(uint256 transactionId) {\n require(\n block.timestamp >= confirmationTimes[transactionId] + secondsTimeLocked,\n \"TIME_LOCK_INCOMPLETE\"\n );\n _;\n }\n\n /// @dev Contract constructor sets initial owners, required number of confirmations, and time lock.\n /// @param _owners List of initial owners.\n /// @param _required Number of required confirmations.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n constructor (\n address[] _owners,\n uint256 _required,\n uint256 _secondsTimeLocked\n )\n public\n MultiSigWallet(_owners, _required)\n {\n secondsTimeLocked = _secondsTimeLocked;\n }\n\n /// @dev Changes the duration of the time lock for transactions.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n function changeTimeLock(uint256 _secondsTimeLocked)\n public\n onlyWallet\n {\n secondsTimeLocked = _secondsTimeLocked;\n emit TimeLockChange(_secondsTimeLocked);\n }\n\n /// @dev Allows an owner to confirm a transaction.\n /// @param transactionId Transaction ID.\n function confirmTransaction(uint256 transactionId)\n public\n ownerExists(msg.sender)\n transactionExists(transactionId)\n notConfirmed(transactionId, msg.sender)\n notFullyConfirmed(transactionId)\n {\n confirmations[transactionId][msg.sender] = true;\n emit Confirmation(msg.sender, transactionId);\n if (isConfirmed(transactionId)) {\n setConfirmationTime(transactionId, block.timestamp);\n }\n }\n\n /// @dev Allows anyone to execute a confirmed transaction.\n /// @param transactionId Transaction ID.\n function executeTransaction(uint256 transactionId)\n public\n notExecuted(transactionId)\n fullyConfirmed(transactionId)\n pastTimeLock(transactionId)\n {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) {\n emit Execution(transactionId);\n } else {\n emit ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n\n /// @dev Sets the time of when a submission first passed.\n function setConfirmationTime(uint256 transactionId, uint256 confirmationTime)\n internal\n {\n confirmationTimes[transactionId] = confirmationTime;\n emit ConfirmationTimeSet(transactionId, confirmationTime);\n }\n}\n",
- "2.0.0/protocol/AssetProxy/ERC20Proxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MixinAuthorizable.sol\";\n\n\ncontract ERC20Proxy is\n MixinAuthorizable\n{\n // Id of this proxy.\n bytes4 constant internal PROXY_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n \n // solhint-disable-next-line payable-fallback\n function () \n external\n {\n assembly {\n // The first 4 bytes of calldata holds the function selector\n let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)\n\n // `transferFrom` will be called with the following parameters:\n // assetData Encoded byte array.\n // from Address to transfer asset from.\n // to Address to transfer asset to.\n // amount Amount of asset to transfer.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {\n\n // To lookup a value in a mapping, we load from the storage location keccak256(k, p),\n // where k is the key left padded to 32 bytes and p is the storage slot\n let start := mload(64)\n mstore(start, and(caller, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(start, 32), authorized_slot)\n\n // Revert if authorized[msg.sender] == false\n if iszero(sload(keccak256(start, 64))) {\n // Revert with `Error(\"SENDER_NOT_AUTHORIZED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // `transferFrom`.\n // The function is marked `external`, so no abi decodeding is done for\n // us. Instead, we expect the `calldata` memory to contain the\n // following:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n //\n // (*): offset is computed from start of function parameters, so offset\n // by an additional 4 bytes in the calldata.\n //\n // (**): see table below to compute length of assetData Contents\n //\n // WARNING: The ABIv2 specification allows additional padding between\n // the Params and Data section. This will result in a larger\n // offset to assetData.\n\n // Asset data itself is encoded as follows:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 1 * 32 | function parameters: |\n // | | 4 | 12 + 20 | 1. token address |\n\n // We construct calldata for the `token.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 4 | | 1. from |\n // | | 36 | | 2. to |\n // | | 68 | | 3. amount |\n\n /////// Read token address from calldata ///////\n // * The token address is stored in `assetData`.\n //\n // * The \"offset to assetData\" is stored at offset 4 in the calldata (table 1).\n // [assetDataOffsetFromParams = calldataload(4)]\n //\n // * Notes that the \"offset to assetData\" is relative to the \"Params\" area of calldata;\n // add 4 bytes to account for the length of the \"Header\" area (table 1).\n // [assetDataOffsetFromHeader = assetDataOffsetFromParams + 4]\n //\n // * The \"token address\" is offset 32+4=36 bytes into \"assetData\" (tables 1 & 2).\n // [tokenOffset = assetDataOffsetFromHeader + 36 = calldataload(4) + 4 + 36]\n let token := calldataload(add(calldataload(4), 40))\n \n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFrom` selector.\n // Any trailing data in transferFromSelector will be\n // overwritten in the next `mstore` call.\n mstore(0, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // We copy the fields `from`, `to` and `amount` in bulk\n // from our own calldata to the new calldata.\n calldatacopy(4, 36, 96)\n\n /////// Call `token.transferFrom` using the calldata ///////\n let success := call(\n gas, // forward all gas\n token, // call address of token contract\n 0, // don't send any ETH\n 0, // pointer to start of input\n 100, // length of input\n 0, // write output over input\n 32 // output size should be 32 bytes\n )\n\n /////// Check return data. ///////\n // If there is no return data, we assume the token incorrectly\n // does not return a bool. In this case we expect it to revert\n // on failure, which was handled above.\n // If the token does return data, we require that it is a single\n // nonzero 32 bytes value.\n // So the transfer succeeded if the call succeeded and either\n // returned nothing, or returned a non-zero 32 byte value. \n success := and(success, or(\n iszero(returndatasize),\n and(\n eq(returndatasize, 32),\n gt(mload(0), 0)\n )\n ))\n if success {\n return(0, 0)\n }\n \n // Revert with `Error(\"TRANSFER_FAILED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // Revert if undefined function is called\n revert(0, 0)\n }\n }\n\n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4)\n {\n return PROXY_ID;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/ERC721Proxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MixinAuthorizable.sol\";\n\n\ncontract ERC721Proxy is\n MixinAuthorizable\n{\n // Id of this proxy.\n bytes4 constant internal PROXY_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n\n // solhint-disable-next-line payable-fallback\n function () \n external\n {\n assembly {\n // The first 4 bytes of calldata holds the function selector\n let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)\n\n // `transferFrom` will be called with the following parameters:\n // assetData Encoded byte array.\n // from Address to transfer asset from.\n // to Address to transfer asset to.\n // amount Amount of asset to transfer.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {\n\n // To lookup a value in a mapping, we load from the storage location keccak256(k, p),\n // where k is the key left padded to 32 bytes and p is the storage slot\n let start := mload(64)\n mstore(start, and(caller, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(start, 32), authorized_slot)\n\n // Revert if authorized[msg.sender] == false\n if iszero(sload(keccak256(start, 64))) {\n // Revert with `Error(\"SENDER_NOT_AUTHORIZED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // `transferFrom`.\n // The function is marked `external`, so no abi decodeding is done for\n // us. Instead, we expect the `calldata` memory to contain the\n // following:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n //\n // (*): offset is computed from start of function parameters, so offset\n // by an additional 4 bytes in the calldata.\n //\n // (**): see table below to compute length of assetData Contents\n //\n // WARNING: The ABIv2 specification allows additional padding between\n // the Params and Data section. This will result in a larger\n // offset to assetData.\n\n // Asset data itself is encoded as follows:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 2 * 32 | function parameters: |\n // | | 4 | 12 + 20 | 1. token address |\n // | | 36 | | 2. tokenId |\n \n // We construct calldata for the `token.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n // \n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 4 | | 1. from |\n // | | 36 | | 2. to |\n // | | 68 | | 3. tokenId |\n\n // There exists only 1 of each token.\n // require(amount == 1, \"INVALID_AMOUNT\")\n if sub(calldataload(100), 1) {\n // Revert with `Error(\"INVALID_AMOUNT\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000e494e56414c49445f414d4f554e540000000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFrom` selector.\n // Any trailing data in transferFromSelector will be\n // overwritten in the next `mstore` call.\n mstore(0, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // We copy the fields `from` and `to` in bulk\n // from our own calldata to the new calldata.\n calldatacopy(4, 36, 64)\n\n // Copy `tokenId` field from our own calldata to the new calldata.\n let assetDataOffset := calldataload(4)\n calldatacopy(68, add(assetDataOffset, 72), 32)\n\n /////// Call `token.transferFrom` using the calldata ///////\n let token := calldataload(add(assetDataOffset, 40))\n let success := call(\n gas, // forward all gas\n token, // call address of token contract\n 0, // don't send any ETH\n 0, // pointer to start of input\n 100, // length of input\n 0, // write output to null\n 0 // output size is 0 bytes\n )\n if success {\n return(0, 0)\n }\n \n // Revert with `Error(\"TRANSFER_FAILED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // Revert if undefined function is called\n revert(0, 0)\n }\n }\n\n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4)\n {\n return PROXY_ID;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/MixinAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"./mixins/MAuthorizable.sol\";\n\n\ncontract MixinAuthorizable is\n Ownable,\n MAuthorizable\n{\n /// @dev Only authorized addresses can invoke functions with this modifier.\n modifier onlyAuthorized {\n require(\n authorized[msg.sender],\n \"SENDER_NOT_AUTHORIZED\"\n );\n _;\n }\n\n mapping (address => bool) public authorized;\n address[] public authorities;\n\n /// @dev Authorizes an address.\n /// @param target Address to authorize.\n function addAuthorizedAddress(address target)\n external\n onlyOwner\n {\n require(\n !authorized[target],\n \"TARGET_ALREADY_AUTHORIZED\"\n );\n\n authorized[target] = true;\n authorities.push(target);\n emit AuthorizedAddressAdded(target, msg.sender);\n }\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n function removeAuthorizedAddress(address target)\n external\n onlyOwner\n {\n require(\n authorized[target],\n \"TARGET_NOT_AUTHORIZED\"\n );\n\n delete authorized[target];\n for (uint256 i = 0; i < authorities.length; i++) {\n if (authorities[i] == target) {\n authorities[i] = authorities[authorities.length - 1];\n authorities.length -= 1;\n break;\n }\n }\n emit AuthorizedAddressRemoved(target, msg.sender);\n }\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n /// @param index Index of target in authorities array.\n function removeAuthorizedAddressAtIndex(\n address target,\n uint256 index\n )\n external\n onlyOwner\n {\n require(\n authorized[target],\n \"TARGET_NOT_AUTHORIZED\"\n );\n require(\n index < authorities.length,\n \"INDEX_OUT_OF_BOUNDS\"\n );\n require(\n authorities[index] == target,\n \"AUTHORIZED_ADDRESS_MISMATCH\"\n );\n\n delete authorized[target];\n authorities[index] = authorities[authorities.length - 1];\n authorities.length -= 1;\n emit AuthorizedAddressRemoved(target, msg.sender);\n }\n\n /// @dev Gets all authorized addresses.\n /// @return Array of authorized addresses.\n function getAuthorizedAddresses()\n external\n view\n returns (address[] memory)\n {\n return authorities;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IAuthorizable.sol\";\n\n\ncontract IAssetProxy is\n IAuthorizable\n{\n /// @dev Transfers assets. Either succeeds or throws.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param from Address to transfer asset from.\n /// @param to Address to transfer asset to.\n /// @param amount Amount of asset to transfer.\n function transferFrom(\n bytes assetData,\n address from,\n address to,\n uint256 amount\n )\n external;\n \n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4);\n}\n",
- "2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/Ownable/IOwnable.sol\";\n\n\ncontract IAuthorizable is\n IOwnable\n{\n /// @dev Authorizes an address.\n /// @param target Address to authorize.\n function addAuthorizedAddress(address target)\n external;\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n function removeAuthorizedAddress(address target)\n external;\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n /// @param index Index of target in authorities array.\n function removeAuthorizedAddressAtIndex(\n address target,\n uint256 index\n )\n external;\n \n /// @dev Gets all authorized addresses.\n /// @return Array of authorized addresses.\n function getAuthorizedAddresses()\n external\n view\n returns (address[] memory);\n}\n",
- "2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAuthorizable.sol\";\n\n\ncontract MAuthorizable is\n IAuthorizable\n{\n // Event logged when a new address is authorized.\n event AuthorizedAddressAdded(\n address indexed target,\n address indexed caller\n );\n\n // Event logged when a currently authorized address is unauthorized.\n event AuthorizedAddressRemoved(\n address indexed target,\n address indexed caller\n );\n\n /// @dev Only authorized addresses can invoke functions with this modifier.\n modifier onlyAuthorized { revert(); _; }\n}\n",
- "2.0.0/protocol/AssetProxyOwner/AssetProxyOwner.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../multisig/MultiSigWalletWithTimeLock.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\n\n\ncontract AssetProxyOwner is\n MultiSigWalletWithTimeLock\n{\n using LibBytes for bytes;\n\n event AssetProxyRegistration(address assetProxyContract, bool isRegistered);\n\n // Mapping of AssetProxy contract address =>\n // if this contract is allowed to call the AssetProxy's `removeAuthorizedAddressAtIndex` method without a time lock.\n mapping (address => bool) public isAssetProxyRegistered;\n\n bytes4 constant internal REMOVE_AUTHORIZED_ADDRESS_AT_INDEX_SELECTOR = bytes4(keccak256(\"removeAuthorizedAddressAtIndex(address,uint256)\"));\n\n /// @dev Function will revert if the transaction does not call `removeAuthorizedAddressAtIndex`\n /// on an approved AssetProxy contract.\n modifier validRemoveAuthorizedAddressAtIndexTx(uint256 transactionId) {\n Transaction storage txn = transactions[transactionId];\n require(\n isAssetProxyRegistered[txn.destination],\n \"UNREGISTERED_ASSET_PROXY\"\n );\n require(\n txn.data.readBytes4(0) == REMOVE_AUTHORIZED_ADDRESS_AT_INDEX_SELECTOR,\n \"INVALID_FUNCTION_SELECTOR\"\n );\n _;\n }\n\n /// @dev Contract constructor sets initial owners, required number of confirmations,\n /// time lock, and list of AssetProxy addresses.\n /// @param _owners List of initial owners.\n /// @param _assetProxyContracts Array of AssetProxy contract addresses.\n /// @param _required Number of required confirmations.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n constructor (\n address[] memory _owners,\n address[] memory _assetProxyContracts,\n uint256 _required,\n uint256 _secondsTimeLocked\n )\n public\n MultiSigWalletWithTimeLock(_owners, _required, _secondsTimeLocked)\n {\n for (uint256 i = 0; i < _assetProxyContracts.length; i++) {\n address assetProxy = _assetProxyContracts[i];\n require(\n assetProxy != address(0),\n \"INVALID_ASSET_PROXY\"\n );\n isAssetProxyRegistered[assetProxy] = true;\n }\n }\n\n /// @dev Registers or deregisters an AssetProxy to be able to execute\n /// `removeAuthorizedAddressAtIndex` without a timelock.\n /// @param assetProxyContract Address of AssetProxy contract.\n /// @param isRegistered Status of approval for AssetProxy contract.\n function registerAssetProxy(address assetProxyContract, bool isRegistered)\n public\n onlyWallet\n notNull(assetProxyContract)\n {\n isAssetProxyRegistered[assetProxyContract] = isRegistered;\n emit AssetProxyRegistration(assetProxyContract, isRegistered);\n }\n\n /// @dev Allows execution of `removeAuthorizedAddressAtIndex` without time lock.\n /// @param transactionId Transaction ID.\n function executeRemoveAuthorizedAddressAtIndex(uint256 transactionId)\n public\n notExecuted(transactionId)\n fullyConfirmed(transactionId)\n validRemoveAuthorizedAddressAtIndexTx(transactionId)\n {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) {\n emit Execution(transactionId);\n } else {\n emit ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/Exchange.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./MixinExchangeCore.sol\";\nimport \"./MixinSignatureValidator.sol\";\nimport \"./MixinWrapperFunctions.sol\";\nimport \"./MixinAssetProxyDispatcher.sol\";\nimport \"./MixinTransactions.sol\";\nimport \"./MixinMatchOrders.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract Exchange is\n MixinExchangeCore,\n MixinMatchOrders,\n MixinSignatureValidator,\n MixinTransactions,\n MixinAssetProxyDispatcher,\n MixinWrapperFunctions\n{\n string constant public VERSION = \"2.0.1-alpha\";\n\n // Mixins are instantiated in the order they are inherited\n constructor (bytes memory _zrxAssetData)\n public\n LibConstants(_zrxAssetData) // @TODO: Remove when we deploy.\n MixinExchangeCore()\n MixinMatchOrders()\n MixinSignatureValidator()\n MixinTransactions()\n MixinAssetProxyDispatcher()\n MixinWrapperFunctions()\n {}\n}\n",
- "2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\nimport \"../AssetProxy/interfaces/IAssetProxy.sol\";\n\n\ncontract MixinAssetProxyDispatcher is\n Ownable,\n MAssetProxyDispatcher\n{\n // Mapping from Asset Proxy Id's to their respective Asset Proxy\n mapping (bytes4 => IAssetProxy) public assetProxies;\n\n /// @dev Registers an asset proxy to its asset proxy id.\n /// Once an asset proxy is registered, it cannot be unregistered.\n /// @param assetProxy Address of new asset proxy to register.\n function registerAssetProxy(address assetProxy)\n external\n onlyOwner\n {\n IAssetProxy assetProxyContract = IAssetProxy(assetProxy);\n\n // Ensure that no asset proxy exists with current id.\n bytes4 assetProxyId = assetProxyContract.getProxyId();\n address currentAssetProxy = assetProxies[assetProxyId];\n require(\n currentAssetProxy == address(0),\n \"ASSET_PROXY_ALREADY_EXISTS\"\n );\n\n // Add asset proxy and log registration.\n assetProxies[assetProxyId] = assetProxyContract;\n emit AssetProxyRegistered(\n assetProxyId,\n assetProxy\n );\n }\n\n /// @dev Gets an asset proxy.\n /// @param assetProxyId Id of the asset proxy.\n /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered.\n function getAssetProxy(bytes4 assetProxyId)\n external\n view\n returns (address)\n {\n return assetProxies[assetProxyId];\n }\n\n /// @dev Forwards arguments to assetProxy and calls `transferFrom`. Either succeeds or throws.\n /// @param assetData Byte array encoded for the asset.\n /// @param from Address to transfer token from.\n /// @param to Address to transfer token to.\n /// @param amount Amount of token to transfer.\n function dispatchTransferFrom(\n bytes memory assetData,\n address from,\n address to,\n uint256 amount\n )\n internal\n {\n // Do nothing if no amount should be transferred.\n if (amount > 0 && from != to) {\n // Ensure assetData length is valid\n require(\n assetData.length > 3,\n \"LENGTH_GREATER_THAN_3_REQUIRED\"\n );\n \n // Lookup assetProxy. We do not use `LibBytes.readBytes4` for gas efficiency reasons.\n bytes4 assetProxyId;\n assembly {\n assetProxyId := and(mload(\n add(assetData, 32)),\n 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000\n )\n }\n address assetProxy = assetProxies[assetProxyId];\n\n // Ensure that assetProxy exists\n require(\n assetProxy != address(0),\n \"ASSET_PROXY_DOES_NOT_EXIST\"\n );\n \n // We construct calldata for the `assetProxy.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n // \n // | Area | Offset | Length | Contents |\n // | -------- |--------|---------|-------------------------------------------- |\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n\n assembly {\n /////// Setup State ///////\n // `cdStart` is the start of the calldata for `assetProxy.transferFrom` (equal to free memory ptr).\n let cdStart := mload(64)\n // `dataAreaLength` is the total number of words needed to store `assetData`\n // As-per the ABI spec, this value is padded up to the nearest multiple of 32,\n // and includes 32-bytes for length.\n let dataAreaLength := and(add(mload(assetData), 63), 0xFFFFFFFFFFFE0)\n // `cdEnd` is the end of the calldata for `assetProxy.transferFrom`.\n let cdEnd := add(cdStart, add(132, dataAreaLength))\n\n \n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFromSelector`.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n mstore(cdStart, 0xa85e59e400000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // Each parameter is padded to 32-bytes. The entire Params Area is 128 bytes.\n // Notes:\n // 1. The offset to `assetData` is the length of the Params Area (128 bytes).\n // 2. A 20-byte mask is applied to addresses to zero-out the unused bytes.\n mstore(add(cdStart, 4), 128)\n mstore(add(cdStart, 36), and(from, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(cdStart, 68), and(to, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(cdStart, 100), amount)\n \n /////// Setup Data Area ///////\n // This area holds `assetData`.\n let dataArea := add(cdStart, 132)\n // solhint-disable-next-line no-empty-blocks\n for {} lt(dataArea, cdEnd) {} {\n mstore(dataArea, mload(assetData))\n dataArea := add(dataArea, 32)\n assetData := add(assetData, 32)\n }\n\n /////// Call `assetProxy.transferFrom` using the constructed calldata ///////\n let success := call(\n gas, // forward all gas\n assetProxy, // call address of asset proxy\n 0, // don't send any ETH\n cdStart, // pointer to start of input\n sub(cdEnd, cdStart), // length of input \n cdStart, // write output over input\n 512 // reserve 512 bytes for output\n )\n if iszero(success) {\n revert(cdStart, returndatasize())\n }\n }\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\n\n\ncontract MixinExchangeCore is\n ReentrancyGuard,\n LibConstants,\n LibMath,\n LibOrder,\n LibFillResults,\n MAssetProxyDispatcher,\n MExchangeCore,\n MSignatureValidator,\n MTransactions\n{\n // Mapping of orderHash => amount of takerAsset already bought by maker\n mapping (bytes32 => uint256) public filled;\n\n // Mapping of orderHash => cancelled\n mapping (bytes32 => bool) public cancelled;\n\n // Mapping of makerAddress => senderAddress => lowest salt an order can have in order to be fillable\n // Orders with specified senderAddress and with a salt less than their epoch are considered cancelled\n mapping (address => mapping (address => uint256)) public orderEpoch;\n\n /// @dev Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch\n /// and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress).\n /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled.\n function cancelOrdersUpTo(uint256 targetOrderEpoch)\n external\n nonReentrant\n {\n address makerAddress = getCurrentContextAddress();\n // If this function is called via `executeTransaction`, we only update the orderEpoch for the makerAddress/msg.sender combination.\n // This allows external filter contracts to add rules to how orders are cancelled via this function.\n address senderAddress = makerAddress == msg.sender ? address(0) : msg.sender;\n\n // orderEpoch is initialized to 0, so to cancelUpTo we need salt + 1\n uint256 newOrderEpoch = targetOrderEpoch + 1; \n uint256 oldOrderEpoch = orderEpoch[makerAddress][senderAddress];\n\n // Ensure orderEpoch is monotonically increasing\n require(\n newOrderEpoch > oldOrderEpoch, \n \"INVALID_NEW_ORDER_EPOCH\"\n );\n\n // Update orderEpoch\n orderEpoch[makerAddress][senderAddress] = newOrderEpoch;\n emit CancelUpTo(\n makerAddress,\n senderAddress,\n newOrderEpoch\n );\n }\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrder(\n Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n nonReentrant\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n return fillResults;\n }\n\n /// @dev After calling, the order can not be filled anymore.\n /// Throws if order is invalid or sender does not have permission to cancel.\n /// @param order Order to cancel. Order must be OrderStatus.FILLABLE.\n function cancelOrder(Order memory order)\n public\n nonReentrant\n {\n cancelOrderInternal(order);\n }\n\n /// @dev Gets information about an order: status, hash, and amount filled.\n /// @param order Order to gather information on.\n /// @return OrderInfo Information about the order and its state.\n /// See LibOrder.OrderInfo for a complete description.\n function getOrderInfo(Order memory order)\n public\n view\n returns (OrderInfo memory orderInfo)\n {\n // Compute the order hash\n orderInfo.orderHash = getOrderHash(order);\n\n // Fetch filled amount\n orderInfo.orderTakerAssetFilledAmount = filled[orderInfo.orderHash];\n\n // If order.makerAssetAmount is zero, we also reject the order.\n // While the Exchange contract handles them correctly, they create\n // edge cases in the supporting infrastructure because they have\n // an 'infinite' price when computed by a simple division.\n if (order.makerAssetAmount == 0) {\n orderInfo.orderStatus = uint8(OrderStatus.INVALID_MAKER_ASSET_AMOUNT);\n return orderInfo;\n }\n\n // If order.takerAssetAmount is zero, then the order will always\n // be considered filled because 0 == takerAssetAmount == orderTakerAssetFilledAmount\n // Instead of distinguishing between unfilled and filled zero taker\n // amount orders, we choose not to support them.\n if (order.takerAssetAmount == 0) {\n orderInfo.orderStatus = uint8(OrderStatus.INVALID_TAKER_ASSET_AMOUNT);\n return orderInfo;\n }\n\n // Validate order availability\n if (orderInfo.orderTakerAssetFilledAmount >= order.takerAssetAmount) {\n orderInfo.orderStatus = uint8(OrderStatus.FULLY_FILLED);\n return orderInfo;\n }\n\n // Validate order expiration\n // solhint-disable-next-line not-rely-on-time\n if (block.timestamp >= order.expirationTimeSeconds) {\n orderInfo.orderStatus = uint8(OrderStatus.EXPIRED);\n return orderInfo;\n }\n\n // Check if order has been cancelled\n if (cancelled[orderInfo.orderHash]) {\n orderInfo.orderStatus = uint8(OrderStatus.CANCELLED);\n return orderInfo;\n }\n if (orderEpoch[order.makerAddress][order.senderAddress] > order.salt) {\n orderInfo.orderStatus = uint8(OrderStatus.CANCELLED);\n return orderInfo;\n }\n\n // All other statuses are ruled out: order is Fillable\n orderInfo.orderStatus = uint8(OrderStatus.FILLABLE);\n return orderInfo;\n }\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderInternal(\n Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n // Fetch order info\n OrderInfo memory orderInfo = getOrderInfo(order);\n\n // Fetch taker address\n address takerAddress = getCurrentContextAddress();\n \n // Assert that the order is fillable by taker\n assertFillableOrder(\n order,\n orderInfo,\n takerAddress,\n signature\n );\n \n // Get amount of takerAsset to fill\n uint256 remainingTakerAssetAmount = safeSub(order.takerAssetAmount, orderInfo.orderTakerAssetFilledAmount);\n uint256 takerAssetFilledAmount = min256(takerAssetFillAmount, remainingTakerAssetAmount);\n\n // Validate context\n assertValidFill(\n order,\n orderInfo,\n takerAssetFillAmount,\n takerAssetFilledAmount,\n fillResults.makerAssetFilledAmount\n );\n\n // Compute proportional fill amounts\n fillResults = calculateFillResults(order, takerAssetFilledAmount);\n\n // Update exchange internal state\n updateFilledState(\n order,\n takerAddress,\n orderInfo.orderHash,\n orderInfo.orderTakerAssetFilledAmount,\n fillResults\n );\n \n // Settle order\n settleOrder(\n order,\n takerAddress,\n fillResults\n );\n\n return fillResults;\n }\n\n /// @dev After calling, the order can not be filled anymore.\n /// Throws if order is invalid or sender does not have permission to cancel.\n /// @param order Order to cancel. Order must be OrderStatus.FILLABLE.\n function cancelOrderInternal(Order memory order)\n internal\n {\n // Fetch current order status\n OrderInfo memory orderInfo = getOrderInfo(order);\n\n // Validate context\n assertValidCancel(order, orderInfo);\n\n // Perform cancel\n updateCancelledState(order, orderInfo.orderHash);\n }\n\n /// @dev Updates state with results of a fill order.\n /// @param order that was filled.\n /// @param takerAddress Address of taker who filled the order.\n /// @param orderTakerAssetFilledAmount Amount of order already filled.\n function updateFilledState(\n Order memory order,\n address takerAddress,\n bytes32 orderHash,\n uint256 orderTakerAssetFilledAmount,\n FillResults memory fillResults\n )\n internal\n {\n // Update state\n filled[orderHash] = safeAdd(orderTakerAssetFilledAmount, fillResults.takerAssetFilledAmount);\n\n // Log order\n emit Fill(\n order.makerAddress,\n order.feeRecipientAddress,\n takerAddress,\n msg.sender,\n fillResults.makerAssetFilledAmount,\n fillResults.takerAssetFilledAmount,\n fillResults.makerFeePaid,\n fillResults.takerFeePaid,\n orderHash,\n order.makerAssetData,\n order.takerAssetData\n );\n }\n\n /// @dev Updates state with results of cancelling an order.\n /// State is only updated if the order is currently fillable.\n /// Otherwise, updating state would have no effect.\n /// @param order that was cancelled.\n /// @param orderHash Hash of order that was cancelled.\n function updateCancelledState(\n Order memory order,\n bytes32 orderHash\n )\n internal\n {\n // Perform cancel\n cancelled[orderHash] = true;\n\n // Log cancel\n emit Cancel(\n order.makerAddress,\n order.feeRecipientAddress,\n msg.sender,\n orderHash,\n order.makerAssetData,\n order.takerAssetData\n );\n }\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAddress Address of order taker.\n /// @param signature Proof that the orders was created by its maker.\n function assertFillableOrder(\n Order memory order,\n OrderInfo memory orderInfo,\n address takerAddress,\n bytes memory signature\n )\n internal\n view\n {\n // An order can only be filled if its status is FILLABLE.\n require(\n orderInfo.orderStatus == uint8(OrderStatus.FILLABLE),\n \"ORDER_UNFILLABLE\"\n );\n \n // Validate sender is allowed to fill this order\n if (order.senderAddress != address(0)) {\n require(\n order.senderAddress == msg.sender,\n \"INVALID_SENDER\"\n );\n }\n \n // Validate taker is allowed to fill this order\n if (order.takerAddress != address(0)) {\n require(\n order.takerAddress == takerAddress,\n \"INVALID_TAKER\"\n );\n }\n \n // Validate Maker signature (check only if first time seen)\n if (orderInfo.orderTakerAssetFilledAmount == 0) {\n require(\n isValidSignature(\n orderInfo.orderHash,\n order.makerAddress,\n signature\n ),\n \"INVALID_ORDER_SIGNATURE\"\n );\n }\n }\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAssetFillAmount Desired amount of order to fill by taker.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @param makerAssetFilledAmount Amount of makerAsset that will be transfered.\n function assertValidFill(\n Order memory order,\n OrderInfo memory orderInfo,\n uint256 takerAssetFillAmount, // TODO: use FillResults\n uint256 takerAssetFilledAmount,\n uint256 makerAssetFilledAmount\n )\n internal\n view\n {\n // Revert if fill amount is invalid\n // TODO: reconsider necessity for v2.1\n require(\n takerAssetFillAmount != 0,\n \"INVALID_TAKER_AMOUNT\"\n );\n \n // Make sure taker does not pay more than desired amount\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n takerAssetFilledAmount <= takerAssetFillAmount,\n \"TAKER_OVERPAY\"\n );\n \n // Make sure order is not overfilled\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n safeAdd(orderInfo.orderTakerAssetFilledAmount, takerAssetFilledAmount) <= order.takerAssetAmount,\n \"ORDER_OVERFILL\"\n );\n \n // Make sure order is filled at acceptable price.\n // The order has an implied price from the makers perspective:\n // order price = order.makerAssetAmount / order.takerAssetAmount\n // i.e. the number of makerAsset maker is paying per takerAsset. The\n // maker is guaranteed to get this price or a better (lower) one. The\n // actual price maker is getting in this fill is:\n // fill price = makerAssetFilledAmount / takerAssetFilledAmount\n // We need `fill price <= order price` for the fill to be fair to maker.\n // This amounts to:\n // makerAssetFilledAmount order.makerAssetAmount\n // ------------------------ <= -----------------------\n // takerAssetFilledAmount order.takerAssetAmount\n // or, equivalently:\n // makerAssetFilledAmount * order.takerAssetAmount <=\n // order.makerAssetAmount * takerAssetFilledAmount\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n safeMul(makerAssetFilledAmount, order.takerAssetAmount)\n <= \n safeMul(order.makerAssetAmount, takerAssetFilledAmount),\n \"INVALID_FILL_PRICE\"\n );\n }\n\n /// @dev Validates context for cancelOrder. Succeeds or throws.\n /// @param order to be cancelled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n function assertValidCancel(\n Order memory order,\n OrderInfo memory orderInfo\n )\n internal\n view\n {\n // Ensure order is valid\n // An order can only be cancelled if its status is FILLABLE.\n require(\n orderInfo.orderStatus == uint8(OrderStatus.FILLABLE),\n \"ORDER_UNFILLABLE\"\n );\n\n // Validate sender is allowed to cancel this order\n if (order.senderAddress != address(0)) {\n require(\n order.senderAddress == msg.sender,\n \"INVALID_SENDER\"\n );\n }\n\n // Validate transaction signed by maker\n address makerAddress = getCurrentContextAddress();\n require(\n order.makerAddress == makerAddress,\n \"INVALID_MAKER\"\n );\n }\n\n /// @dev Calculates amounts filled and fees paid by maker and taker.\n /// @param order to be filled.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function calculateFillResults(\n Order memory order,\n uint256 takerAssetFilledAmount\n )\n internal\n pure\n returns (FillResults memory fillResults)\n {\n // Compute proportional transfer amounts\n fillResults.takerAssetFilledAmount = takerAssetFilledAmount;\n fillResults.makerAssetFilledAmount = safeGetPartialAmountFloor(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.makerAssetAmount\n );\n fillResults.makerFeePaid = safeGetPartialAmountFloor(\n fillResults.makerAssetFilledAmount,\n order.makerAssetAmount,\n order.makerFee\n );\n fillResults.takerFeePaid = safeGetPartialAmountFloor(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.takerFee\n );\n\n return fillResults;\n }\n\n /// @dev Settles an order by transferring assets between counterparties.\n /// @param order Order struct containing order specifications.\n /// @param takerAddress Address selling takerAsset and buying makerAsset.\n /// @param fillResults Amounts to be filled and fees paid by maker and taker.\n function settleOrder(\n LibOrder.Order memory order,\n address takerAddress,\n LibFillResults.FillResults memory fillResults\n )\n private\n {\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n dispatchTransferFrom(\n order.makerAssetData,\n order.makerAddress,\n takerAddress,\n fillResults.makerAssetFilledAmount\n );\n dispatchTransferFrom(\n order.takerAssetData,\n takerAddress,\n order.makerAddress,\n fillResults.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n zrxAssetData,\n order.makerAddress,\n order.feeRecipientAddress,\n fillResults.makerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n order.feeRecipientAddress,\n fillResults.takerFeePaid\n );\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinMatchOrders.sol": "/*\n Copyright 2018 ZeroEx Intl.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n http://www.apache.org/licenses/LICENSE-2.0\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MMatchOrders.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\n\n\ncontract MixinMatchOrders is\n ReentrancyGuard,\n LibConstants,\n LibMath,\n MAssetProxyDispatcher,\n MExchangeCore,\n MMatchOrders,\n MTransactions\n{\n /// @dev Match two complementary orders that have a profitable spread.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the left order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftSignature Proof that order was created by the left maker.\n /// @param rightSignature Proof that order was created by the right maker.\n /// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.\n function matchOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n bytes memory leftSignature,\n bytes memory rightSignature\n )\n public\n nonReentrant\n returns (LibFillResults.MatchedFillResults memory matchedFillResults)\n {\n // We assume that rightOrder.takerAssetData == leftOrder.makerAssetData and rightOrder.makerAssetData == leftOrder.takerAssetData.\n // If this assumption isn't true, the match will fail at signature validation.\n rightOrder.makerAssetData = leftOrder.takerAssetData;\n rightOrder.takerAssetData = leftOrder.makerAssetData;\n\n // Get left & right order info\n LibOrder.OrderInfo memory leftOrderInfo = getOrderInfo(leftOrder);\n LibOrder.OrderInfo memory rightOrderInfo = getOrderInfo(rightOrder);\n\n // Fetch taker address\n address takerAddress = getCurrentContextAddress();\n \n // Either our context is valid or we revert\n assertFillableOrder(\n leftOrder,\n leftOrderInfo,\n takerAddress,\n leftSignature\n );\n assertFillableOrder(\n rightOrder,\n rightOrderInfo,\n takerAddress,\n rightSignature\n );\n assertValidMatch(leftOrder, rightOrder);\n\n // Compute proportional fill amounts\n matchedFillResults = calculateMatchedFillResults(\n leftOrder,\n rightOrder,\n leftOrderInfo.orderTakerAssetFilledAmount,\n rightOrderInfo.orderTakerAssetFilledAmount\n );\n\n // Validate fill contexts\n assertValidFill(\n leftOrder,\n leftOrderInfo,\n matchedFillResults.left.takerAssetFilledAmount,\n matchedFillResults.left.takerAssetFilledAmount,\n matchedFillResults.left.makerAssetFilledAmount\n );\n assertValidFill(\n rightOrder,\n rightOrderInfo,\n matchedFillResults.right.takerAssetFilledAmount,\n matchedFillResults.right.takerAssetFilledAmount,\n matchedFillResults.right.makerAssetFilledAmount\n );\n \n // Update exchange state\n updateFilledState(\n leftOrder,\n takerAddress,\n leftOrderInfo.orderHash,\n leftOrderInfo.orderTakerAssetFilledAmount,\n matchedFillResults.left\n );\n updateFilledState(\n rightOrder,\n takerAddress,\n rightOrderInfo.orderHash,\n rightOrderInfo.orderTakerAssetFilledAmount,\n matchedFillResults.right\n );\n\n // Settle matched orders. Succeeds or throws.\n settleMatchedOrders(\n leftOrder,\n rightOrder,\n takerAddress,\n matchedFillResults\n );\n\n return matchedFillResults;\n }\n\n /// @dev Validates context for matchOrders. Succeeds or throws.\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n function assertValidMatch(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder\n )\n internal\n pure\n {\n // Make sure there is a profitable spread.\n // There is a profitable spread iff the cost per unit bought (OrderA.MakerAmount/OrderA.TakerAmount) for each order is greater\n // than the profit per unit sold of the matched order (OrderB.TakerAmount/OrderB.MakerAmount).\n // This is satisfied by the equations below:\n // <leftOrder.makerAssetAmount> / <leftOrder.takerAssetAmount> >= <rightOrder.takerAssetAmount> / <rightOrder.makerAssetAmount>\n // AND\n // <rightOrder.makerAssetAmount> / <rightOrder.takerAssetAmount> >= <leftOrder.takerAssetAmount> / <leftOrder.makerAssetAmount>\n // These equations can be combined to get the following:\n require(\n safeMul(leftOrder.makerAssetAmount, rightOrder.makerAssetAmount) >=\n safeMul(leftOrder.takerAssetAmount, rightOrder.takerAssetAmount),\n \"NEGATIVE_SPREAD_REQUIRED\"\n );\n }\n\n /// @dev Calculates fill amounts for the matched orders.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the leftOrder order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftOrderTakerAssetFilledAmount Amount of left order already filled.\n /// @param rightOrderTakerAssetFilledAmount Amount of right order already filled.\n /// @param matchedFillResults Amounts to fill and fees to pay by maker and taker of matched orders.\n function calculateMatchedFillResults(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n uint256 leftOrderTakerAssetFilledAmount,\n uint256 rightOrderTakerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.MatchedFillResults memory matchedFillResults)\n {\n // Derive maker asset amounts for left & right orders, given store taker assert amounts\n uint256 leftTakerAssetAmountRemaining = safeSub(leftOrder.takerAssetAmount, leftOrderTakerAssetFilledAmount);\n uint256 leftMakerAssetAmountRemaining = safeGetPartialAmountFloor(\n leftOrder.makerAssetAmount,\n leftOrder.takerAssetAmount,\n leftTakerAssetAmountRemaining\n );\n uint256 rightTakerAssetAmountRemaining = safeSub(rightOrder.takerAssetAmount, rightOrderTakerAssetFilledAmount);\n uint256 rightMakerAssetAmountRemaining = safeGetPartialAmountFloor(\n rightOrder.makerAssetAmount,\n rightOrder.takerAssetAmount,\n rightTakerAssetAmountRemaining\n );\n\n // Calculate fill results for maker and taker assets: at least one order will be fully filled.\n // The maximum amount the left maker can buy is `leftTakerAssetAmountRemaining`\n // The maximum amount the right maker can sell is `rightMakerAssetAmountRemaining`\n // We have two distinct cases for calculating the fill results:\n // Case 1.\n // If the left maker can buy more than the right maker can sell, then only the right order is fully filled.\n // If the left maker can buy exactly what the right maker can sell, then both orders are fully filled.\n // Case 2.\n // If the left maker cannot buy more than the right maker can sell, then only the left order is fully filled.\n if (leftTakerAssetAmountRemaining >= rightMakerAssetAmountRemaining) {\n // Case 1: Right order is fully filled\n matchedFillResults.right.makerAssetFilledAmount = rightMakerAssetAmountRemaining;\n matchedFillResults.right.takerAssetFilledAmount = rightTakerAssetAmountRemaining;\n matchedFillResults.left.takerAssetFilledAmount = matchedFillResults.right.makerAssetFilledAmount;\n // Round down to ensure the maker's exchange rate does not exceed the price specified by the order. \n // We favor the maker when the exchange rate must be rounded.\n matchedFillResults.left.makerAssetFilledAmount = safeGetPartialAmountFloor(\n leftOrder.makerAssetAmount,\n leftOrder.takerAssetAmount,\n matchedFillResults.left.takerAssetFilledAmount\n );\n } else {\n // Case 2: Left order is fully filled\n matchedFillResults.left.makerAssetFilledAmount = leftMakerAssetAmountRemaining;\n matchedFillResults.left.takerAssetFilledAmount = leftTakerAssetAmountRemaining;\n matchedFillResults.right.makerAssetFilledAmount = matchedFillResults.left.takerAssetFilledAmount;\n // Round up to ensure the maker's exchange rate does not exceed the price specified by the order.\n // We favor the maker when the exchange rate must be rounded.\n matchedFillResults.right.takerAssetFilledAmount = safeGetPartialAmountCeil(\n rightOrder.takerAssetAmount,\n rightOrder.makerAssetAmount,\n matchedFillResults.right.makerAssetFilledAmount\n );\n }\n\n // Calculate amount given to taker\n matchedFillResults.leftMakerAssetSpreadAmount = safeSub(\n matchedFillResults.left.makerAssetFilledAmount,\n matchedFillResults.right.takerAssetFilledAmount\n );\n\n // Compute fees for left order\n matchedFillResults.left.makerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.left.makerAssetFilledAmount,\n leftOrder.makerAssetAmount,\n leftOrder.makerFee\n );\n matchedFillResults.left.takerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.left.takerAssetFilledAmount,\n leftOrder.takerAssetAmount,\n leftOrder.takerFee\n );\n\n // Compute fees for right order\n matchedFillResults.right.makerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.right.makerAssetFilledAmount,\n rightOrder.makerAssetAmount,\n rightOrder.makerFee\n );\n matchedFillResults.right.takerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.right.takerAssetFilledAmount,\n rightOrder.takerAssetAmount,\n rightOrder.takerFee\n );\n\n // Return fill results\n return matchedFillResults;\n }\n\n /// @dev Settles matched order by transferring appropriate funds between order makers, taker, and fee recipient.\n /// @param leftOrder First matched order.\n /// @param rightOrder Second matched order.\n /// @param takerAddress Address that matched the orders. The taker receives the spread between orders as profit.\n /// @param matchedFillResults Struct holding amounts to transfer between makers, taker, and fee recipients.\n function settleMatchedOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n address takerAddress,\n LibFillResults.MatchedFillResults memory matchedFillResults\n )\n private\n {\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n // Order makers and taker\n dispatchTransferFrom(\n leftOrder.makerAssetData,\n leftOrder.makerAddress,\n rightOrder.makerAddress,\n matchedFillResults.right.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n rightOrder.makerAssetData,\n rightOrder.makerAddress,\n leftOrder.makerAddress,\n matchedFillResults.left.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n leftOrder.makerAssetData,\n leftOrder.makerAddress,\n takerAddress,\n matchedFillResults.leftMakerAssetSpreadAmount\n );\n\n // Maker fees\n dispatchTransferFrom(\n zrxAssetData,\n leftOrder.makerAddress,\n leftOrder.feeRecipientAddress,\n matchedFillResults.left.makerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n rightOrder.makerAddress,\n rightOrder.feeRecipientAddress,\n matchedFillResults.right.makerFeePaid\n );\n\n // Taker fees\n if (leftOrder.feeRecipientAddress == rightOrder.feeRecipientAddress) {\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n leftOrder.feeRecipientAddress,\n safeAdd(\n matchedFillResults.left.takerFeePaid,\n matchedFillResults.right.takerFeePaid\n )\n );\n } else {\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n leftOrder.feeRecipientAddress,\n matchedFillResults.left.takerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n rightOrder.feeRecipientAddress,\n matchedFillResults.right.takerFeePaid\n );\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinSignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./interfaces/IWallet.sol\";\nimport \"./interfaces/IValidator.sol\";\n\n\ncontract MixinSignatureValidator is\n ReentrancyGuard,\n MSignatureValidator,\n MTransactions\n{\n using LibBytes for bytes;\n \n // Mapping of hash => signer => signed\n mapping (bytes32 => mapping (address => bool)) public preSigned;\n\n // Mapping of signer => validator => approved\n mapping (address => mapping (address => bool)) public allowedValidators;\n\n /// @dev Approves a hash on-chain using any valid signature type.\n /// After presigning a hash, the preSign signature type will become valid for that hash and signer.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n function preSign(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external\n {\n if (signerAddress != msg.sender) {\n require(\n isValidSignature(\n hash,\n signerAddress,\n signature\n ),\n \"INVALID_SIGNATURE\"\n );\n }\n preSigned[hash][signerAddress] = true;\n }\n\n /// @dev Approves/unnapproves a Validator contract to verify signatures on signer's behalf.\n /// @param validatorAddress Address of Validator contract.\n /// @param approval Approval or disapproval of Validator contract.\n function setSignatureValidatorApproval(\n address validatorAddress,\n bool approval\n )\n external\n nonReentrant\n {\n address signerAddress = getCurrentContextAddress();\n allowedValidators[signerAddress][validatorAddress] = approval;\n emit SignatureValidatorApproval(\n signerAddress,\n validatorAddress,\n approval\n );\n }\n\n /// @dev Verifies that a hash has been signed by the given signer.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes memory signature\n )\n public\n view\n returns (bool isValid)\n {\n require(\n signature.length > 0,\n \"LENGTH_GREATER_THAN_0_REQUIRED\"\n );\n\n // Pop last byte off of signature byte array.\n uint8 signatureTypeRaw = uint8(signature.popLastByte());\n\n // Ensure signature is supported\n require(\n signatureTypeRaw < uint8(SignatureType.NSignatureTypes),\n \"SIGNATURE_UNSUPPORTED\"\n );\n\n SignatureType signatureType = SignatureType(signatureTypeRaw);\n\n // Variables are not scoped in Solidity.\n uint8 v;\n bytes32 r;\n bytes32 s;\n address recovered;\n\n // Always illegal signature.\n // This is always an implicit option since a signer can create a\n // signature array with invalid type or length. We may as well make\n // it an explicit option. This aids testing and analysis. It is\n // also the initialization value for the enum type.\n if (signatureType == SignatureType.Illegal) {\n revert(\"SIGNATURE_ILLEGAL\");\n\n // Always invalid signature.\n // Like Illegal, this is always implicitly available and therefore\n // offered explicitly. It can be implicitly created by providing\n // a correctly formatted but incorrect signature.\n } else if (signatureType == SignatureType.Invalid) {\n require(\n signature.length == 0,\n \"LENGTH_0_REQUIRED\"\n );\n isValid = false;\n return isValid;\n\n // Signature using EIP712\n } else if (signatureType == SignatureType.EIP712) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n hash,\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n\n // Signed using web3.eth_sign\n } else if (signatureType == SignatureType.EthSign) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n keccak256(abi.encodePacked(\n \"\\x19Ethereum Signed Message:\\n32\",\n hash\n )),\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n\n // Signature verified by wallet contract.\n // If used with an order, the maker of the order is the wallet contract.\n } else if (signatureType == SignatureType.Wallet) {\n isValid = isValidWalletSignature(\n hash,\n signerAddress,\n signature\n );\n return isValid;\n\n // Signature verified by validator contract.\n // If used with an order, the maker of the order can still be an EOA.\n // A signature using this type should be encoded as:\n // | Offset | Length | Contents |\n // | 0x00 | x | Signature to validate |\n // | 0x00 + x | 20 | Address of validator contract |\n // | 0x14 + x | 1 | Signature type is always \"\\x06\" |\n } else if (signatureType == SignatureType.Validator) {\n // Pop last 20 bytes off of signature byte array.\n address validatorAddress = signature.popLast20Bytes();\n \n // Ensure signer has approved validator.\n if (!allowedValidators[signerAddress][validatorAddress]) {\n return false;\n }\n isValid = isValidValidatorSignature(\n validatorAddress,\n hash,\n signerAddress,\n signature\n );\n return isValid;\n\n // Signer signed hash previously using the preSign function.\n } else if (signatureType == SignatureType.PreSigned) {\n isValid = preSigned[hash][signerAddress];\n return isValid;\n }\n\n // Anything else is illegal (We do not return false because\n // the signature may actually be valid, just not in a format\n // that we currently support. In this case returning false\n // may lead the caller to incorrectly believe that the\n // signature was invalid.)\n revert(\"SIGNATURE_UNSUPPORTED\");\n }\n\n /// @dev Verifies signature using logic defined by Wallet contract.\n /// @param hash Any 32 byte hash.\n /// @param walletAddress Address that should have signed the given hash\n /// and defines its own signature verification method.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if signature is valid for given wallet..\n function isValidWalletSignature(\n bytes32 hash,\n address walletAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid)\n {\n bytes memory calldata = abi.encodeWithSelector(\n IWallet(walletAddress).isValidSignature.selector,\n hash,\n signature\n );\n assembly {\n let cdStart := add(calldata, 32)\n let success := staticcall(\n gas, // forward all gas\n walletAddress, // address of Wallet contract\n cdStart, // pointer to start of input\n mload(calldata), // length of input\n cdStart, // write output over input\n 32 // output size is 32 bytes\n )\n\n switch success\n case 0 {\n // Revert with `Error(\"WALLET_ERROR\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000c57414c4c45545f4552524f5200000000000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n case 1 {\n // Signature is valid if call did not revert and returned true\n isValid := mload(cdStart)\n }\n }\n return isValid;\n }\n\n /// @dev Verifies signature using logic defined by Validator contract.\n /// @param validatorAddress Address of validator contract.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidValidatorSignature(\n address validatorAddress,\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid)\n {\n bytes memory calldata = abi.encodeWithSelector(\n IValidator(signerAddress).isValidSignature.selector,\n hash,\n signerAddress,\n signature\n );\n assembly {\n let cdStart := add(calldata, 32)\n let success := staticcall(\n gas, // forward all gas\n validatorAddress, // address of Validator contract\n cdStart, // pointer to start of input\n mload(calldata), // length of input\n cdStart, // write output over input\n 32 // output size is 32 bytes\n )\n\n switch success\n case 0 {\n // Revert with `Error(\"VALIDATOR_ERROR\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f56414c494441544f525f4552524f5200000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n case 1 {\n // Signature is valid if call did not revert and returned true\n isValid := mload(cdStart)\n }\n }\n return isValid;\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinTransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\nimport \"./libs/LibExchangeErrors.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./libs/LibEIP712.sol\";\n\n\ncontract MixinTransactions is\n LibEIP712,\n MSignatureValidator,\n MTransactions\n{\n // Mapping of transaction hash => executed\n // This prevents transactions from being executed more than once.\n mapping (bytes32 => bool) public transactions;\n\n // Address of current transaction signer\n address public currentContextAddress;\n\n /// @dev Executes an exchange method call in the context of signer.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @param signature Proof of signer transaction by signer.\n function executeTransaction(\n uint256 salt,\n address signerAddress,\n bytes data,\n bytes signature\n )\n external\n {\n // Prevent reentrancy\n require(\n currentContextAddress == address(0),\n \"REENTRANCY_ILLEGAL\"\n );\n\n bytes32 transactionHash = hashEIP712Message(hashZeroExTransaction(\n salt,\n signerAddress,\n data\n ));\n\n // Validate transaction has not been executed\n require(\n !transactions[transactionHash],\n \"INVALID_TX_HASH\"\n );\n\n // Transaction always valid if signer is sender of transaction\n if (signerAddress != msg.sender) {\n // Validate signature\n require(\n isValidSignature(\n transactionHash,\n signerAddress,\n signature\n ),\n \"INVALID_TX_SIGNATURE\"\n );\n\n // Set the current transaction signer\n currentContextAddress = signerAddress;\n }\n\n // Execute transaction\n transactions[transactionHash] = true;\n require(\n address(this).delegatecall(data),\n \"FAILED_EXECUTION\"\n );\n\n // Reset current transaction signer if it was previously updated\n if (signerAddress != msg.sender) {\n currentContextAddress = address(0);\n }\n }\n\n /// @dev Calculates EIP712 hash of the Transaction.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @return EIP712 hash of the Transaction.\n function hashZeroExTransaction(\n uint256 salt,\n address signerAddress,\n bytes memory data\n )\n internal\n pure\n returns (bytes32 result)\n {\n bytes32 schemaHash = EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH;\n bytes32 dataHash = keccak256(data);\n\n // Assembly for more efficiently computing:\n // keccak256(abi.encodePacked(\n // EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH,\n // salt,\n // bytes32(signerAddress),\n // keccak256(data)\n // ));\n\n assembly {\n // Load free memory pointer\n let memPtr := mload(64)\n\n mstore(memPtr, schemaHash) // hash of schema\n mstore(add(memPtr, 32), salt) // salt\n mstore(add(memPtr, 64), and(signerAddress, 0xffffffffffffffffffffffffffffffffffffffff)) // signerAddress\n mstore(add(memPtr, 96), dataHash) // hash of data\n\n // Compute hash\n result := keccak256(memPtr, 128)\n }\n return result;\n }\n\n /// @dev The current function will be called in the context of this address (either 0x transaction signer or `msg.sender`).\n /// If calling a fill function, this address will represent the taker.\n /// If calling a cancel function, this address will represent the maker.\n /// @return Signer of 0x transaction if entry point is `executeTransaction`.\n /// `msg.sender` if entry point is any other function.\n function getCurrentContextAddress()\n internal\n view\n returns (address)\n {\n address currentContextAddress_ = currentContextAddress;\n address contextAddress = currentContextAddress_ == address(0) ? msg.sender : currentContextAddress_;\n return contextAddress;\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./libs/LibAbiEncoder.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MWrapperFunctions.sol\";\n\n\ncontract MixinWrapperFunctions is\n ReentrancyGuard,\n LibMath,\n LibFillResults,\n LibAbiEncoder,\n MExchangeCore,\n MWrapperFunctions\n{\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n nonReentrant\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrKillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n return fillResults;\n }\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (FillResults memory fillResults)\n {\n // ABI encode calldata for `fillOrder`\n bytes memory fillOrderCalldata = abiEncodeFillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n\n // Delegate to `fillOrder` and handle any exceptions gracefully\n assembly {\n let success := delegatecall(\n gas, // forward all gas\n address, // call address of this contract\n add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes)\n mload(fillOrderCalldata), // length of input\n fillOrderCalldata, // write output over input\n 128 // output size is 128 bytes\n )\n if success {\n mstore(fillResults, mload(fillOrderCalldata))\n mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32)))\n mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64)))\n mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96)))\n }\n }\n // fillResults values will be 0 by default if call was unsuccessful\n return fillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrKill.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrKillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrKillOrderInternal(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrders(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n bytes memory takerAssetData = orders[0].takerAssetData;\n \n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being sold by taker is the same for each order.\n // Rather than passing this in as calldata, we use the takerAssetData from the first order in all later orders.\n orders[i].takerAssetData = takerAssetData;\n\n // Calculate the remaining amount of takerAsset to sell\n uint256 remainingTakerAssetFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= takerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory takerAssetData = orders[0].takerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being sold by taker is the same for each order.\n // Rather than passing this in as calldata, we use the takerAssetData from the first order in all later orders.\n orders[i].takerAssetData = takerAssetData;\n\n // Calculate the remaining amount of takerAsset to sell\n uint256 remainingTakerAssetFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= takerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerAsset is bought by taker.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrders(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // Rather than passing this in as calldata, we copy the makerAssetData from the first order onto all later orders.\n orders[i].makerAssetData = makerAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n if (totalFillResults.makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // Rather than passing this in as calldata, we copy the makerAssetData from the first order onto all later orders.\n orders[i].makerAssetData = makerAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n if (totalFillResults.makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously cancels multiple orders in a single transaction.\n /// @param orders Array of order specifications.\n function batchCancelOrders(LibOrder.Order[] memory orders)\n public\n nonReentrant\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n cancelOrderInternal(orders[i]);\n }\n }\n\n /// @dev Fetches information for all passed in orders.\n /// @param orders Array of order specifications.\n /// @return Array of OrderInfo instances that correspond to each order.\n function getOrdersInfo(LibOrder.Order[] memory orders)\n public\n view\n returns (LibOrder.OrderInfo[] memory)\n {\n uint256 ordersLength = orders.length;\n LibOrder.OrderInfo[] memory ordersInfo = new LibOrder.OrderInfo[](ordersLength);\n for (uint256 i = 0; i != ordersLength; i++) {\n ordersInfo[i] = getOrderInfo(orders[i]);\n }\n return ordersInfo;\n }\n\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n require(\n fillResults.takerAssetFilledAmount == takerAssetFillAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return fillResults;\n }\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IAssetProxyDispatcher {\n\n /// @dev Registers an asset proxy to its asset proxy id.\n /// Once an asset proxy is registered, it cannot be unregistered.\n /// @param assetProxy Address of new asset proxy to register.\n function registerAssetProxy(address assetProxy)\n external;\n\n /// @dev Gets an asset proxy.\n /// @param assetProxyId Id of the asset proxy.\n /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered.\n function getAssetProxy(bytes4 assetProxyId)\n external\n view\n returns (address);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IExchange.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./IExchangeCore.sol\";\nimport \"./IMatchOrders.sol\";\nimport \"./ISignatureValidator.sol\";\nimport \"./ITransactions.sol\";\nimport \"./IAssetProxyDispatcher.sol\";\nimport \"./IWrapperFunctions.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract IExchange is\n IExchangeCore,\n IMatchOrders,\n ISignatureValidator,\n ITransactions,\n IAssetProxyDispatcher,\n IWrapperFunctions\n{}\n",
- "2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IExchangeCore {\n\n /// @dev Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch\n /// and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress).\n /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled.\n function cancelOrdersUpTo(uint256 targetOrderEpoch)\n external;\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev After calling, the order can not be filled anymore.\n /// @param order Order struct containing order specifications.\n function cancelOrder(LibOrder.Order memory order)\n public;\n\n /// @dev Gets information about an order: status, hash, and amount filled.\n /// @param order Order to gather information on.\n /// @return OrderInfo Information about the order and its state.\n /// See LibOrder.OrderInfo for a complete description.\n function getOrderInfo(LibOrder.Order memory order)\n public\n view\n returns (LibOrder.OrderInfo memory orderInfo);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IMatchOrders {\n\n /// @dev Match two complementary orders that have a profitable spread.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the left order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftSignature Proof that order was created by the left maker.\n /// @param rightSignature Proof that order was created by the right maker.\n /// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.\n function matchOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n bytes memory leftSignature,\n bytes memory rightSignature\n )\n public\n returns (LibFillResults.MatchedFillResults memory matchedFillResults);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract ISignatureValidator {\n\n /// @dev Approves a hash on-chain using any valid signature type.\n /// After presigning a hash, the preSign signature type will become valid for that hash and signer.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n function preSign(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external;\n \n /// @dev Approves/unnapproves a Validator contract to verify signatures on signer's behalf.\n /// @param validatorAddress Address of Validator contract.\n /// @param approval Approval or disapproval of Validator contract.\n function setSignatureValidatorApproval(\n address validatorAddress,\n bool approval\n )\n external;\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signerAddress Address of signer.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes memory signature\n )\n public\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/ITransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\n\ncontract ITransactions {\n\n /// @dev Executes an exchange method call in the context of signer.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @param signature Proof of signer transaction by signer.\n function executeTransaction(\n uint256 salt,\n address signerAddress,\n bytes data,\n bytes signature\n )\n external;\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IValidator {\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IWallet.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IWallet {\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n bytes signature\n )\n external\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IWrapperFunctions {\n\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrKill.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrKillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrders(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerAsset is bought by taker.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrders(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously cancels multiple orders in a single transaction.\n /// @param orders Array of order specifications.\n function batchCancelOrders(LibOrder.Order[] memory orders)\n public;\n\n /// @dev Fetches information for all passed in orders\n /// @param orders Array of order specifications.\n /// @return Array of OrderInfo instances that correspond to each order.\n function getOrdersInfo(LibOrder.Order[] memory orders)\n public\n view\n returns (LibOrder.OrderInfo[] memory);\n}\n",
- "2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./LibOrder.sol\";\n\n\ncontract LibAbiEncoder {\n\n /// @dev ABI encodes calldata for `fillOrder`.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return ABI encoded calldata for `fillOrder`.\n function abiEncodeFillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n pure\n returns (bytes memory fillOrderCalldata)\n {\n // We need to call MExchangeCore.fillOrder using a delegatecall in\n // assembly so that we can intercept a call that throws. For this, we\n // need the input encoded in memory in the Ethereum ABIv2 format [1].\n\n // | Area | Offset | Length | Contents |\n // | -------- |--------|---------|-------------------------------------------- |\n // | Header | 0x00 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 0x00 | | 1. offset to order (*) |\n // | | 0x20 | | 2. takerAssetFillAmount |\n // | | 0x40 | | 3. offset to signature (*) |\n // | Data | | 12 * 32 | order: |\n // | | 0x000 | | 1. senderAddress |\n // | | 0x020 | | 2. makerAddress |\n // | | 0x040 | | 3. takerAddress |\n // | | 0x060 | | 4. feeRecipientAddress |\n // | | 0x080 | | 5. makerAssetAmount |\n // | | 0x0A0 | | 6. takerAssetAmount |\n // | | 0x0C0 | | 7. makerFeeAmount |\n // | | 0x0E0 | | 8. takerFeeAmount |\n // | | 0x100 | | 9. expirationTimeSeconds |\n // | | 0x120 | | 10. salt |\n // | | 0x140 | | 11. Offset to makerAssetData (*) |\n // | | 0x160 | | 12. Offset to takerAssetData (*) |\n // | | 0x180 | 32 | makerAssetData Length |\n // | | 0x1A0 | ** | makerAssetData Contents |\n // | | 0x1C0 | 32 | takerAssetData Length |\n // | | 0x1E0 | ** | takerAssetData Contents |\n // | | 0x200 | 32 | signature Length |\n // | | 0x220 | ** | signature Contents |\n\n // * Offsets are calculated from the beginning of the current area: Header, Params, Data:\n // An offset stored in the Params area is calculated from the beginning of the Params section.\n // An offset stored in the Data area is calculated from the beginning of the Data section.\n\n // ** The length of dynamic array contents are stored in the field immediately preceeding the contents.\n\n // [1]: https://solidity.readthedocs.io/en/develop/abi-spec.html\n\n assembly {\n\n // Areas below may use the following variables:\n // 1. <area>Start -- Start of this area in memory\n // 2. <area>End -- End of this area in memory. This value may\n // be precomputed (before writing contents),\n // or it may be computed as contents are written.\n // 3. <area>Offset -- Current offset into area. If an area's End\n // is precomputed, this variable tracks the\n // offsets of contents as they are written.\n\n /////// Setup Header Area ///////\n // Load free memory pointer\n fillOrderCalldata := mload(0x40)\n // bytes4(keccak256(\"fillOrder((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),uint256,bytes)\"))\n // = 0xb4be83d5\n // Leave 0x20 bytes to store the length\n mstore(add(fillOrderCalldata, 0x20), 0xb4be83d500000000000000000000000000000000000000000000000000000000)\n let headerAreaEnd := add(fillOrderCalldata, 0x24)\n\n /////// Setup Params Area ///////\n // This area is preallocated and written to later.\n // This is because we need to fill in offsets that have not yet been calculated.\n let paramsAreaStart := headerAreaEnd\n let paramsAreaEnd := add(paramsAreaStart, 0x60)\n let paramsAreaOffset := paramsAreaStart\n\n /////// Setup Data Area ///////\n let dataAreaStart := paramsAreaEnd\n let dataAreaEnd := dataAreaStart\n\n // Offset from the source data we're reading from\n let sourceOffset := order\n // arrayLenBytes and arrayLenWords track the length of a dynamically-allocated bytes array.\n let arrayLenBytes := 0\n let arrayLenWords := 0\n\n /////// Write order Struct ///////\n // Write memory location of Order, relative to the start of the\n // parameter list, then increment the paramsAreaOffset respectively.\n mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))\n paramsAreaOffset := add(paramsAreaOffset, 0x20)\n\n // Write values for each field in the order\n // It would be nice to use a loop, but we save on gas by writing\n // the stores sequentially.\n mstore(dataAreaEnd, mload(sourceOffset)) // makerAddress\n mstore(add(dataAreaEnd, 0x20), mload(add(sourceOffset, 0x20))) // takerAddress\n mstore(add(dataAreaEnd, 0x40), mload(add(sourceOffset, 0x40))) // feeRecipientAddress\n mstore(add(dataAreaEnd, 0x60), mload(add(sourceOffset, 0x60))) // senderAddress\n mstore(add(dataAreaEnd, 0x80), mload(add(sourceOffset, 0x80))) // makerAssetAmount\n mstore(add(dataAreaEnd, 0xA0), mload(add(sourceOffset, 0xA0))) // takerAssetAmount\n mstore(add(dataAreaEnd, 0xC0), mload(add(sourceOffset, 0xC0))) // makerFeeAmount\n mstore(add(dataAreaEnd, 0xE0), mload(add(sourceOffset, 0xE0))) // takerFeeAmount\n mstore(add(dataAreaEnd, 0x100), mload(add(sourceOffset, 0x100))) // expirationTimeSeconds\n mstore(add(dataAreaEnd, 0x120), mload(add(sourceOffset, 0x120))) // salt\n mstore(add(dataAreaEnd, 0x140), mload(add(sourceOffset, 0x140))) // Offset to makerAssetData\n mstore(add(dataAreaEnd, 0x160), mload(add(sourceOffset, 0x160))) // Offset to takerAssetData\n dataAreaEnd := add(dataAreaEnd, 0x180)\n sourceOffset := add(sourceOffset, 0x180)\n\n // Write offset to <order.makerAssetData>\n mstore(add(dataAreaStart, mul(10, 0x20)), sub(dataAreaEnd, dataAreaStart))\n\n // Calculate length of <order.makerAssetData>\n sourceOffset := mload(add(order, 0x140)) // makerAssetData\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of <order.makerAssetData>\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of <order.makerAssetData>\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n // Write offset to <order.takerAssetData>\n mstore(add(dataAreaStart, mul(11, 0x20)), sub(dataAreaEnd, dataAreaStart))\n\n // Calculate length of <order.takerAssetData>\n sourceOffset := mload(add(order, 0x160)) // takerAssetData\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of <order.takerAssetData>\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of <order.takerAssetData>\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n /////// Write takerAssetFillAmount ///////\n mstore(paramsAreaOffset, takerAssetFillAmount)\n paramsAreaOffset := add(paramsAreaOffset, 0x20)\n\n /////// Write signature ///////\n // Write offset to paramsArea\n mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))\n\n // Calculate length of signature\n sourceOffset := signature\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of signature\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of signature\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n // Set length of calldata\n mstore(fillOrderCalldata, sub(dataAreaEnd, add(fillOrderCalldata, 0x20)))\n\n // Increment free memory pointer\n mstore(0x40, dataAreaEnd)\n }\n\n return fillOrderCalldata;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibConstants.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\n// solhint-disable max-line-length\ncontract LibConstants {\n \n // Asset data for ZRX token. Used for fee transfers.\n // @TODO: Hardcode constant when we deploy. Currently \n // not constant to make testing easier.\n\n // The proxyId for ZRX_ASSET_DATA is bytes4(keccak256(\"ERC20Token(address)\")) = 0xf47261b0\n \n // Kovan ZRX address is 0x6ff6c0ff1d68b964901f986d4c9fa3ac68346570.\n // The ABI encoded proxyId and address is 0xf47261b00000000000000000000000006ff6c0ff1d68b964901f986d4c9fa3ac68346570\n // bytes constant public ZRX_ASSET_DATA = \"\\xf4\\x72\\x61\\xb0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x6f\\xf6\\xc0\\xff\\x1d\\x68\\xb9\\x64\\x90\\x1f\\x98\\x6d\\x4c\\x9f\\xa3\\xac\\x68\\x34\\x65\\x70\";\n \n // Mainnet ZRX address is 0xe41d2489571d322189246dafa5ebde1f4699f498.\n // The ABI encoded proxyId and address is 0xf47261b0000000000000000000000000e41d2489571d322189246dafa5ebde1f4699f498\n // bytes constant public ZRX_ASSET_DATA = \"\\xf4\\x72\\x61\\xb0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xe4\\x1d\\x24\\x89\\x57\\x1d\\x32\\x21\\x89\\x24\\x6d\\xaf\\xa5\\xeb\\xde\\x1f\\x46\\x99\\xf4\\x98\";\n \n // solhint-disable-next-line var-name-mixedcase\n bytes public ZRX_ASSET_DATA;\n\n // @TODO: Remove when we deploy.\n constructor (bytes memory zrxAssetData)\n public\n {\n ZRX_ASSET_DATA = zrxAssetData;\n }\n}\n// solhint-enable max-line-length\n",
- "2.0.0/protocol/Exchange/libs/LibEIP712.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract LibEIP712 {\n\n // EIP191 header for EIP712 prefix\n string constant internal EIP191_HEADER = \"\\x19\\x01\";\n\n // EIP712 Domain Name value\n string constant internal EIP712_DOMAIN_NAME = \"0x Protocol\";\n\n // EIP712 Domain Version value\n string constant internal EIP712_DOMAIN_VERSION = \"2\";\n\n // Hash of the EIP712 Domain Separator Schema\n bytes32 constant internal EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"EIP712Domain(\",\n \"string name,\",\n \"string version,\",\n \"address verifyingContract\",\n \")\"\n ));\n\n // Hash of the EIP712 Domain Separator data\n // solhint-disable-next-line var-name-mixedcase\n bytes32 public EIP712_DOMAIN_HASH;\n\n constructor ()\n public\n {\n EIP712_DOMAIN_HASH = keccak256(abi.encodePacked(\n EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH,\n keccak256(bytes(EIP712_DOMAIN_NAME)),\n keccak256(bytes(EIP712_DOMAIN_VERSION)),\n bytes32(address(this))\n ));\n }\n\n /// @dev Calculates EIP712 encoding for a hash struct in this EIP712 Domain.\n /// @param hashStruct The EIP712 hash struct.\n /// @return EIP712 hash applied to this EIP712 Domain.\n function hashEIP712Message(bytes32 hashStruct)\n internal\n view\n returns (bytes32 result)\n {\n bytes32 eip712DomainHash = EIP712_DOMAIN_HASH;\n\n // Assembly for more efficient computing:\n // keccak256(abi.encodePacked(\n // EIP191_HEADER,\n // EIP712_DOMAIN_HASH,\n // hashStruct \n // ));\n\n assembly {\n // Load free memory pointer\n let memPtr := mload(64)\n\n mstore(memPtr, 0x1901000000000000000000000000000000000000000000000000000000000000) // EIP191 header\n mstore(add(memPtr, 2), eip712DomainHash) // EIP712 domain hash\n mstore(add(memPtr, 34), hashStruct) // Hash of struct\n\n // Compute hash\n result := keccak256(memPtr, 66)\n }\n return result;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\n// solhint-disable\npragma solidity 0.4.24;\n\n\n/// @dev This contract documents the revert reasons used in the Exchange contract.\n/// This contract is intended to serve as a reference, but is not actually used for efficiency reasons.\ncontract LibExchangeErrors {\n\n /// Order validation errors ///\n string constant ORDER_UNFILLABLE = \"ORDER_UNFILLABLE\"; // Order cannot be filled.\n string constant INVALID_MAKER = \"INVALID_MAKER\"; // Invalid makerAddress.\n string constant INVALID_TAKER = \"INVALID_TAKER\"; // Invalid takerAddress.\n string constant INVALID_SENDER = \"INVALID_SENDER\"; // Invalid `msg.sender`.\n string constant INVALID_ORDER_SIGNATURE = \"INVALID_ORDER_SIGNATURE\"; // Signature validation failed. \n \n /// fillOrder validation errors ///\n string constant INVALID_TAKER_AMOUNT = \"INVALID_TAKER_AMOUNT\"; // takerAssetFillAmount cannot equal 0.\n string constant ROUNDING_ERROR = \"ROUNDING_ERROR\"; // Rounding error greater than 0.1% of takerAssetFillAmount. \n \n /// Signature validation errors ///\n string constant INVALID_SIGNATURE = \"INVALID_SIGNATURE\"; // Signature validation failed. \n string constant SIGNATURE_ILLEGAL = \"SIGNATURE_ILLEGAL\"; // Signature type is illegal.\n string constant SIGNATURE_UNSUPPORTED = \"SIGNATURE_UNSUPPORTED\"; // Signature type unsupported.\n \n /// cancelOrdersUptTo errors ///\n string constant INVALID_NEW_ORDER_EPOCH = \"INVALID_NEW_ORDER_EPOCH\"; // Specified salt must be greater than or equal to existing orderEpoch.\n\n /// fillOrKillOrder errors ///\n string constant COMPLETE_FILL_FAILED = \"COMPLETE_FILL_FAILED\"; // Desired takerAssetFillAmount could not be completely filled. \n\n /// matchOrders errors ///\n string constant NEGATIVE_SPREAD_REQUIRED = \"NEGATIVE_SPREAD_REQUIRED\"; // Matched orders must have a negative spread.\n\n /// Transaction errors ///\n string constant REENTRANCY_ILLEGAL = \"REENTRANCY_ILLEGAL\"; // Recursive reentrancy is not allowed. \n string constant INVALID_TX_HASH = \"INVALID_TX_HASH\"; // Transaction has already been executed. \n string constant INVALID_TX_SIGNATURE = \"INVALID_TX_SIGNATURE\"; // Signature validation failed. \n string constant FAILED_EXECUTION = \"FAILED_EXECUTION\"; // Transaction execution failed. \n \n /// registerAssetProxy errors ///\n string constant ASSET_PROXY_ALREADY_EXISTS = \"ASSET_PROXY_ALREADY_EXISTS\"; // AssetProxy with same id already exists.\n\n /// dispatchTransferFrom errors ///\n string constant ASSET_PROXY_DOES_NOT_EXIST = \"ASSET_PROXY_DOES_NOT_EXIST\"; // No assetProxy registered at given id.\n string constant TRANSFER_FAILED = \"TRANSFER_FAILED\"; // Asset transfer unsuccesful.\n\n /// Length validation errors ///\n string constant LENGTH_GREATER_THAN_0_REQUIRED = \"LENGTH_GREATER_THAN_0_REQUIRED\"; // Byte array must have a length greater than 0.\n string constant LENGTH_GREATER_THAN_3_REQUIRED = \"LENGTH_GREATER_THAN_3_REQUIRED\"; // Byte array must have a length greater than 3.\n string constant LENGTH_0_REQUIRED = \"LENGTH_0_REQUIRED\"; // Byte array must have a length of 0.\n string constant LENGTH_65_REQUIRED = \"LENGTH_65_REQUIRED\"; // Byte array must have a length of 65.\n}\n",
- "2.0.0/protocol/Exchange/libs/LibFillResults.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract LibFillResults is\n SafeMath\n{\n struct FillResults {\n uint256 makerAssetFilledAmount; // Total amount of makerAsset(s) filled.\n uint256 takerAssetFilledAmount; // Total amount of takerAsset(s) filled.\n uint256 makerFeePaid; // Total amount of ZRX paid by maker(s) to feeRecipient(s).\n uint256 takerFeePaid; // Total amount of ZRX paid by taker to feeRecipients(s).\n }\n\n struct MatchedFillResults {\n FillResults left; // Amounts filled and fees paid of left order.\n FillResults right; // Amounts filled and fees paid of right order.\n uint256 leftMakerAssetSpreadAmount; // Spread between price of left and right order, denominated in the left order's makerAsset, paid to taker.\n }\n\n /// @dev Adds properties of both FillResults instances.\n /// Modifies the first FillResults instance specified.\n /// @param totalFillResults Fill results instance that will be added onto.\n /// @param singleFillResults Fill results instance that will be added to totalFillResults.\n function addFillResults(FillResults memory totalFillResults, FillResults memory singleFillResults)\n internal\n pure\n {\n totalFillResults.makerAssetFilledAmount = safeAdd(totalFillResults.makerAssetFilledAmount, singleFillResults.makerAssetFilledAmount);\n totalFillResults.takerAssetFilledAmount = safeAdd(totalFillResults.takerAssetFilledAmount, singleFillResults.takerAssetFilledAmount);\n totalFillResults.makerFeePaid = safeAdd(totalFillResults.makerFeePaid, singleFillResults.makerFeePaid);\n totalFillResults.takerFeePaid = safeAdd(totalFillResults.takerFeePaid, singleFillResults.takerFeePaid);\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibMath.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract LibMath is\n SafeMath\n{\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// Reverts if rounding error is >= 0.1%\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded down.\n function safeGetPartialAmountFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n require(\n !isRoundingErrorFloor(\n numerator,\n denominator,\n target\n ),\n \"ROUNDING_ERROR\"\n );\n \n partialAmount = safeDiv(\n safeMul(numerator, target),\n denominator\n );\n return partialAmount;\n }\n\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// Reverts if rounding error is >= 0.1%\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded up.\n function safeGetPartialAmountCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n require(\n !isRoundingErrorCeil(\n numerator,\n denominator,\n target\n ),\n \"ROUNDING_ERROR\"\n );\n \n // safeDiv computes `floor(a / b)`. We use the identity (a, b integer):\n // ceil(a / b) = floor((a + b - 1) / b)\n // To implement `ceil(a / b)` using safeDiv.\n partialAmount = safeDiv(\n safeAdd(\n safeMul(numerator, target),\n safeSub(denominator, 1)\n ),\n denominator\n );\n return partialAmount;\n }\n\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded down.\n function getPartialAmountFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n partialAmount = safeDiv(\n safeMul(numerator, target),\n denominator\n );\n return partialAmount;\n }\n \n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded up.\n function getPartialAmountCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n // safeDiv computes `floor(a / b)`. We use the identity (a, b integer):\n // ceil(a / b) = floor((a + b - 1) / b)\n // To implement `ceil(a / b)` using safeDiv.\n partialAmount = safeDiv(\n safeAdd(\n safeMul(numerator, target),\n safeSub(denominator, 1)\n ),\n denominator\n );\n return partialAmount;\n }\n \n /// @dev Checks if rounding error >= 0.1% when rounding down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to multiply with numerator/denominator.\n /// @return Rounding error is present.\n function isRoundingErrorFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (bool isError)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n \n // The absolute rounding error is the difference between the rounded\n // value and the ideal value. The relative rounding error is the\n // absolute rounding error divided by the absolute value of the\n // ideal value. This is undefined when the ideal value is zero.\n //\n // The ideal value is `numerator * target / denominator`.\n // Let's call `numerator * target % denominator` the remainder.\n // The absolute error is `remainder / denominator`.\n //\n // When the ideal value is zero, we require the absolute error to\n // be zero. Fortunately, this is always the case. The ideal value is\n // zero iff `numerator == 0` and/or `target == 0`. In this case the\n // remainder and absolute error are also zero. \n if (target == 0 || numerator == 0) {\n return false;\n }\n \n // Otherwise, we want the relative rounding error to be strictly\n // less than 0.1%.\n // The relative error is `remainder / (numerator * target)`.\n // We want the relative error less than 1 / 1000:\n // remainder / (numerator * denominator) < 1 / 1000\n // or equivalently:\n // 1000 * remainder < numerator * target\n // so we have a rounding error iff:\n // 1000 * remainder >= numerator * target\n uint256 remainder = mulmod(\n target,\n numerator,\n denominator\n );\n isError = safeMul(1000, remainder) >= safeMul(numerator, target);\n return isError;\n }\n \n /// @dev Checks if rounding error >= 0.1% when rounding up.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to multiply with numerator/denominator.\n /// @return Rounding error is present.\n function isRoundingErrorCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (bool isError)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n \n // See the comments in `isRoundingError`.\n if (target == 0 || numerator == 0) {\n // When either is zero, the ideal value and rounded value are zero\n // and there is no rounding error. (Although the relative error\n // is undefined.)\n return false;\n }\n // Compute remainder as before\n uint256 remainder = mulmod(\n target,\n numerator,\n denominator\n );\n remainder = safeSub(denominator, remainder) % denominator;\n isError = safeMul(1000, remainder) >= safeMul(numerator, target);\n return isError;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibOrder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./LibEIP712.sol\";\n\n\ncontract LibOrder is\n LibEIP712\n{\n // Hash for the EIP712 Order Schema\n bytes32 constant internal EIP712_ORDER_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"Order(\",\n \"address makerAddress,\",\n \"address takerAddress,\",\n \"address feeRecipientAddress,\",\n \"address senderAddress,\",\n \"uint256 makerAssetAmount,\",\n \"uint256 takerAssetAmount,\",\n \"uint256 makerFee,\",\n \"uint256 takerFee,\",\n \"uint256 expirationTimeSeconds,\",\n \"uint256 salt,\",\n \"bytes makerAssetData,\",\n \"bytes takerAssetData\",\n \")\"\n ));\n\n // A valid order remains fillable until it is expired, fully filled, or cancelled.\n // An order's state is unaffected by external factors, like account balances.\n enum OrderStatus {\n INVALID, // Default value\n INVALID_MAKER_ASSET_AMOUNT, // Order does not have a valid maker asset amount\n INVALID_TAKER_ASSET_AMOUNT, // Order does not have a valid taker asset amount\n FILLABLE, // Order is fillable\n EXPIRED, // Order has already expired\n FULLY_FILLED, // Order is fully filled\n CANCELLED // Order has been cancelled\n }\n\n // solhint-disable max-line-length\n struct Order {\n address makerAddress; // Address that created the order. \n address takerAddress; // Address that is allowed to fill the order. If set to 0, any address is allowed to fill the order. \n address feeRecipientAddress; // Address that will recieve fees when order is filled. \n address senderAddress; // Address that is allowed to call Exchange contract methods that affect this order. If set to 0, any address is allowed to call these methods.\n uint256 makerAssetAmount; // Amount of makerAsset being offered by maker. Must be greater than 0. \n uint256 takerAssetAmount; // Amount of takerAsset being bid on by maker. Must be greater than 0. \n uint256 makerFee; // Amount of ZRX paid to feeRecipient by maker when order is filled. If set to 0, no transfer of ZRX from maker to feeRecipient will be attempted.\n uint256 takerFee; // Amount of ZRX paid to feeRecipient by taker when order is filled. If set to 0, no transfer of ZRX from taker to feeRecipient will be attempted.\n uint256 expirationTimeSeconds; // Timestamp in seconds at which order expires. \n uint256 salt; // Arbitrary number to facilitate uniqueness of the order's hash. \n bytes makerAssetData; // Encoded data that can be decoded by a specified proxy contract when transferring makerAsset. The last byte references the id of this proxy.\n bytes takerAssetData; // Encoded data that can be decoded by a specified proxy contract when transferring takerAsset. The last byte references the id of this proxy.\n }\n // solhint-enable max-line-length\n\n struct OrderInfo {\n uint8 orderStatus; // Status that describes order's validity and fillability.\n bytes32 orderHash; // EIP712 hash of the order (see LibOrder.getOrderHash).\n uint256 orderTakerAssetFilledAmount; // Amount of order that has already been filled.\n }\n\n /// @dev Calculates Keccak-256 hash of the order.\n /// @param order The order structure.\n /// @return Keccak-256 EIP712 hash of the order.\n function getOrderHash(Order memory order)\n internal\n view\n returns (bytes32 orderHash)\n {\n orderHash = hashEIP712Message(hashOrder(order));\n return orderHash;\n }\n\n /// @dev Calculates EIP712 hash of the order.\n /// @param order The order structure.\n /// @return EIP712 hash of the order.\n function hashOrder(Order memory order)\n internal\n pure\n returns (bytes32 result)\n {\n bytes32 schemaHash = EIP712_ORDER_SCHEMA_HASH;\n bytes32 makerAssetDataHash = keccak256(order.makerAssetData);\n bytes32 takerAssetDataHash = keccak256(order.takerAssetData);\n\n // Assembly for more efficiently computing:\n // keccak256(abi.encodePacked(\n // EIP712_ORDER_SCHEMA_HASH,\n // bytes32(order.makerAddress),\n // bytes32(order.takerAddress),\n // bytes32(order.feeRecipientAddress),\n // bytes32(order.senderAddress),\n // order.makerAssetAmount,\n // order.takerAssetAmount,\n // order.makerFee,\n // order.takerFee,\n // order.expirationTimeSeconds,\n // order.salt,\n // keccak256(order.makerAssetData),\n // keccak256(order.takerAssetData)\n // ));\n\n assembly {\n // Calculate memory addresses that will be swapped out before hashing\n let pos1 := sub(order, 32)\n let pos2 := add(order, 320)\n let pos3 := add(order, 352)\n\n // Backup\n let temp1 := mload(pos1)\n let temp2 := mload(pos2)\n let temp3 := mload(pos3)\n \n // Hash in place\n mstore(pos1, schemaHash)\n mstore(pos2, makerAssetDataHash)\n mstore(pos3, takerAssetDataHash)\n result := keccak256(pos1, 416)\n \n // Restore\n mstore(pos1, temp1)\n mstore(pos2, temp2)\n mstore(pos3, temp3)\n }\n return result;\n }\n}\n",
- "2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAssetProxyDispatcher.sol\";\n\n\ncontract MAssetProxyDispatcher is\n IAssetProxyDispatcher\n{\n // Logs registration of new asset proxy\n event AssetProxyRegistered(\n bytes4 id, // Id of new registered AssetProxy.\n address assetProxy // Address of new registered AssetProxy.\n );\n\n /// @dev Forwards arguments to assetProxy and calls `transferFrom`. Either succeeds or throws.\n /// @param assetData Byte array encoded for the asset.\n /// @param from Address to transfer token from.\n /// @param to Address to transfer token to.\n /// @param amount Amount of token to transfer.\n function dispatchTransferFrom(\n bytes memory assetData,\n address from,\n address to,\n uint256 amount\n )\n internal;\n}\n",
- "2.0.0/protocol/Exchange/mixins/MExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IExchangeCore.sol\";\n\n\ncontract MExchangeCore is\n IExchangeCore\n{\n // Fill event is emitted whenever an order is filled.\n event Fill(\n address indexed makerAddress, // Address that created the order. \n address indexed feeRecipientAddress, // Address that received fees.\n address takerAddress, // Address that filled the order.\n address senderAddress, // Address that called the Exchange contract (msg.sender).\n uint256 makerAssetFilledAmount, // Amount of makerAsset sold by maker and bought by taker. \n uint256 takerAssetFilledAmount, // Amount of takerAsset sold by taker and bought by maker.\n uint256 makerFeePaid, // Amount of ZRX paid to feeRecipient by maker.\n uint256 takerFeePaid, // Amount of ZRX paid to feeRecipient by taker.\n bytes32 indexed orderHash, // EIP712 hash of order (see LibOrder.getOrderHash).\n bytes makerAssetData, // Encoded data specific to makerAsset. \n bytes takerAssetData // Encoded data specific to takerAsset.\n );\n\n // Cancel event is emitted whenever an individual order is cancelled.\n event Cancel(\n address indexed makerAddress, // Address that created the order. \n address indexed feeRecipientAddress, // Address that would have recieved fees if order was filled. \n address senderAddress, // Address that called the Exchange contract (msg.sender).\n bytes32 indexed orderHash, // EIP712 hash of order (see LibOrder.getOrderHash).\n bytes makerAssetData, // Encoded data specific to makerAsset. \n bytes takerAssetData // Encoded data specific to takerAsset.\n );\n\n // CancelUpTo event is emitted whenever `cancelOrdersUpTo` is executed succesfully.\n event CancelUpTo(\n address indexed makerAddress, // Orders cancelled must have been created by this address.\n address indexed senderAddress, // Orders cancelled must have a `senderAddress` equal to this address.\n uint256 orderEpoch // Orders with specified makerAddress and senderAddress with a salt less than this value are considered cancelled.\n );\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev After calling, the order can not be filled anymore.\n /// @param order Order struct containing order specifications.\n function cancelOrderInternal(LibOrder.Order memory order)\n internal;\n\n /// @dev Updates state with results of a fill order.\n /// @param order that was filled.\n /// @param takerAddress Address of taker who filled the order.\n /// @param orderTakerAssetFilledAmount Amount of order already filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function updateFilledState(\n LibOrder.Order memory order,\n address takerAddress,\n bytes32 orderHash,\n uint256 orderTakerAssetFilledAmount,\n LibFillResults.FillResults memory fillResults\n )\n internal;\n\n /// @dev Updates state with results of cancelling an order.\n /// State is only updated if the order is currently fillable.\n /// Otherwise, updating state would have no effect.\n /// @param order that was cancelled.\n /// @param orderHash Hash of order that was cancelled.\n function updateCancelledState(\n LibOrder.Order memory order,\n bytes32 orderHash\n )\n internal;\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAddress Address of order taker.\n /// @param signature Proof that the orders was created by its maker.\n function assertFillableOrder(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo,\n address takerAddress,\n bytes memory signature\n )\n internal\n view;\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo Status, orderHash, and amount already filled of order.\n /// @param takerAssetFillAmount Desired amount of order to fill by taker.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @param makerAssetFilledAmount Amount of makerAsset that will be transfered.\n function assertValidFill(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo,\n uint256 takerAssetFillAmount,\n uint256 takerAssetFilledAmount,\n uint256 makerAssetFilledAmount\n )\n internal\n view;\n\n /// @dev Validates context for cancelOrder. Succeeds or throws.\n /// @param order to be cancelled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n function assertValidCancel(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo\n )\n internal\n view;\n\n /// @dev Calculates amounts filled and fees paid by maker and taker.\n /// @param order to be filled.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function calculateFillResults(\n LibOrder.Order memory order,\n uint256 takerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.FillResults memory fillResults);\n\n}\n",
- "2.0.0/protocol/Exchange/mixins/MMatchOrders.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IMatchOrders.sol\";\n\n\ncontract MMatchOrders is\n IMatchOrders\n{\n /// @dev Validates context for matchOrders. Succeeds or throws.\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n function assertValidMatch(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder\n )\n internal\n pure;\n\n /// @dev Calculates fill amounts for the matched orders.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the leftOrder order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftOrderTakerAssetFilledAmount Amount of left order already filled.\n /// @param rightOrderTakerAssetFilledAmount Amount of right order already filled.\n /// @param matchedFillResults Amounts to fill and fees to pay by maker and taker of matched orders.\n function calculateMatchedFillResults(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n uint256 leftOrderTakerAssetFilledAmount,\n uint256 rightOrderTakerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.MatchedFillResults memory matchedFillResults);\n\n}\n",
- "2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/ISignatureValidator.sol\";\n\n\ncontract MSignatureValidator is\n ISignatureValidator\n{\n event SignatureValidatorApproval(\n address indexed signerAddress, // Address that approves or disapproves a contract to verify signatures.\n address indexed validatorAddress, // Address of signature validator contract.\n bool approved // Approval or disapproval of validator contract.\n );\n\n // Allowed signature types.\n enum SignatureType {\n Illegal, // 0x00, default value\n Invalid, // 0x01\n EIP712, // 0x02\n EthSign, // 0x03\n Wallet, // 0x04\n Validator, // 0x05\n PreSigned, // 0x06\n NSignatureTypes // 0x07, number of signature types. Always leave at end.\n }\n\n /// @dev Verifies signature using logic defined by Wallet contract.\n /// @param hash Any 32 byte hash.\n /// @param walletAddress Address that should have signed the given hash\n /// and defines its own signature verification method.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidWalletSignature(\n bytes32 hash,\n address walletAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid);\n\n /// @dev Verifies signature using logic defined by Validator contract.\n /// @param validatorAddress Address of validator contract.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidValidatorSignature(\n address validatorAddress,\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/mixins/MTransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\nimport \"../interfaces/ITransactions.sol\";\n\n\ncontract MTransactions is\n ITransactions\n{\n // Hash for the EIP712 ZeroEx Transaction Schema\n bytes32 constant internal EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"ZeroExTransaction(\",\n \"uint256 salt,\",\n \"address signerAddress,\",\n \"bytes data\",\n \")\"\n ));\n\n /// @dev Calculates EIP712 hash of the Transaction.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @return EIP712 hash of the Transaction.\n function hashZeroExTransaction(\n uint256 salt,\n address signerAddress,\n bytes memory data\n )\n internal\n pure\n returns (bytes32 result);\n\n /// @dev The current function will be called in the context of this address (either 0x transaction signer or `msg.sender`).\n /// If calling a fill function, this address will represent the taker.\n /// If calling a cancel function, this address will represent the maker.\n /// @return Signer of 0x transaction if entry point is `executeTransaction`.\n /// `msg.sender` if entry point is any other function.\n function getCurrentContextAddress()\n internal\n view\n returns (address);\n}\n",
- "2.0.0/protocol/Exchange/mixins/MWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IWrapperFunctions.sol\";\n\n\ncontract MWrapperFunctions is \n IWrapperFunctions\n{\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n}\n",
- "2.0.0/test/DummyERC20Token/DummyERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"../../tokens/ERC20Token/MintableERC20Token.sol\";\n\n\ncontract DummyERC20Token is \n Ownable,\n MintableERC20Token\n{\n string public name;\n string public symbol;\n uint256 public decimals;\n uint256 public constant MAX_MINT_AMOUNT = 10000000000000000000000;\n\n constructor (\n string _name,\n string _symbol,\n uint256 _decimals,\n uint256 _totalSupply\n )\n public\n {\n name = _name;\n symbol = _symbol;\n decimals = _decimals;\n _totalSupply = _totalSupply;\n balances[msg.sender] = _totalSupply;\n }\n\n /// @dev Sets the balance of target address\n /// @param _target Address or which balance will be updated\n /// @param _value New balance of target address\n function setBalance(address _target, uint256 _value)\n external\n onlyOwner\n {\n uint256 currBalance = balances[_target];\n if (_value < currBalance) {\n _totalSupply = safeSub(_totalSupply, safeSub(currBalance, _value));\n } else {\n _totalSupply = safeAdd(_totalSupply, safeSub(_value, currBalance));\n }\n balances[_target] = _value;\n }\n\n /// @dev Mints new tokens for sender\n /// @param _value Amount of tokens to mint\n function mint(uint256 _value)\n external\n {\n require(\n _value <= MAX_MINT_AMOUNT,\n \"VALUE_TOO_LARGE\"\n );\n\n _mint(msg.sender, _value);\n }\n}\n",
- "2.0.0/test/DummyERC721Token/DummyERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../tokens/ERC721Token/MintableERC721Token.sol\";\nimport \"../../utils/Ownable/Ownable.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract DummyERC721Token is\n Ownable,\n MintableERC721Token\n{\n string public name;\n string public symbol;\n\n constructor (\n string _name,\n string _symbol\n )\n public\n {\n name = _name;\n symbol = _symbol;\n }\n\n /// @dev Function to mint a new token\n /// Reverts if the given token ID already exists\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _tokenId ID of the token to be minted by the msg.sender \n function mint(address _to, uint256 _tokenId)\n external\n {\n _mint(_to, _tokenId);\n }\n\n /// @dev Function to burn a token\n /// Reverts if the given token ID doesn't exist or not called by contract owner\n /// @param _owner Owner of token with given token ID\n /// @param _tokenId ID of the token to be burned by the msg.sender\n function burn(address _owner, uint256 _tokenId)\n external\n onlyOwner\n {\n _burn(_owner, _tokenId);\n }\n}\n",
- "2.0.0/tokens/ERC20Token/ERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IERC20Token.sol\";\n\n\ncontract ERC20Token is\n IERC20Token\n{\n mapping (address => uint256) internal balances;\n mapping (address => mapping (address => uint256)) internal allowed;\n\n uint256 internal _totalSupply;\n\n /// @dev send `value` token to `to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transfer(address _to, uint256 _value)\n external\n returns (bool)\n {\n require(\n balances[msg.sender] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[msg.sender] -= _value;\n balances[_to] += _value;\n\n emit Transfer(\n msg.sender,\n _to,\n _value\n );\n\n return true;\n }\n\n /// @dev send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool)\n {\n require(\n balances[_from] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n allowed[_from][msg.sender] >= _value,\n \"ERC20_INSUFFICIENT_ALLOWANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[_to] += _value;\n balances[_from] -= _value;\n allowed[_from][msg.sender] -= _value;\n \n emit Transfer(\n _from,\n _to,\n _value\n );\n \n return true;\n }\n\n /// @dev `msg.sender` approves `_spender` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Always true if the call has enough gas to complete execution\n function approve(address _spender, uint256 _value)\n external\n returns (bool)\n {\n allowed[msg.sender][_spender] = _value;\n emit Approval(\n msg.sender,\n _spender,\n _value\n );\n return true;\n }\n\n /// @dev Query total supply of token\n /// @return Total supply of token\n function totalSupply()\n external\n view\n returns (uint256)\n {\n return _totalSupply;\n }\n\n /// @dev Query the balance of owner\n /// @param _owner The address from which the balance will be retrieved\n /// @return Balance of owner\n function balanceOf(address _owner)\n external\n view\n returns (uint256)\n {\n return balances[_owner];\n }\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender)\n external\n view\n returns (uint256)\n {\n return allowed[_owner][_spender];\n }\n}\n",
- "2.0.0/tokens/ERC20Token/IERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC20Token {\n\n // solhint-disable no-simple-event-func-name\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 _value\n );\n\n event Approval(\n address indexed _owner,\n address indexed _spender,\n uint256 _value\n );\n\n /// @dev send `value` token to `to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transfer(address _to, uint256 _value)\n external\n returns (bool);\n\n /// @dev send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool);\n \n /// @dev `msg.sender` approves `_spender` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Always true if the call has enough gas to complete execution\n function approve(address _spender, uint256 _value)\n external\n returns (bool);\n\n /// @dev Query total supply of token\n /// @return Total supply of token\n function totalSupply()\n external\n view\n returns (uint256);\n \n /// @param _owner The address from which the balance will be retrieved\n /// @return Balance of owner\n function balanceOf(address _owner)\n external\n view\n returns (uint256);\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender)\n external\n view\n returns (uint256);\n}\n",
- "2.0.0/tokens/ERC20Token/MintableERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/SafeMath/SafeMath.sol\";\nimport \"./UnlimitedAllowanceERC20Token.sol\";\n\n\ncontract MintableERC20Token is \n SafeMath,\n UnlimitedAllowanceERC20Token\n{\n /// @dev Mints new tokens\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _value Amount of tokens to mint\n function _mint(address _to, uint256 _value)\n internal\n {\n balances[_to] = safeAdd(_value, balances[_to]);\n _totalSupply = safeAdd(_totalSupply, _value);\n\n emit Transfer(\n address(0),\n _to,\n _value\n );\n }\n\n /// @dev Mints new tokens\n /// @param _owner Owner of tokens that will be burned\n /// @param _value Amount of tokens to burn\n function _burn(address _owner, uint256 _value)\n internal\n {\n balances[_owner] = safeSub(balances[_owner], _value);\n _totalSupply = safeSub(_totalSupply, _value);\n\n emit Transfer(\n _owner,\n address(0),\n _value\n );\n }\n}\n",
- "2.0.0/tokens/ERC20Token/UnlimitedAllowanceERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../ERC20Token/ERC20Token.sol\";\n\n\ncontract UnlimitedAllowanceERC20Token is\n ERC20Token\n{\n uint256 constant internal MAX_UINT = 2**256 - 1;\n\n /// @dev ERC20 transferFrom, modified such that an allowance of MAX_UINT represents an unlimited allowance. See https://github.com/ethereum/EIPs/issues/717\n /// @param _from Address to transfer from.\n /// @param _to Address to transfer to.\n /// @param _value Amount to transfer.\n /// @return Success of transfer.\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool)\n {\n uint256 allowance = allowed[_from][msg.sender];\n require(\n balances[_from] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n allowance >= _value,\n \"ERC20_INSUFFICIENT_ALLOWANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[_to] += _value;\n balances[_from] -= _value;\n if (allowance < MAX_UINT) {\n allowed[_from][msg.sender] -= _value;\n }\n\n emit Transfer(\n _from,\n _to,\n _value\n );\n\n return true;\n }\n}\n",
- "2.0.0/tokens/ERC721Token/ERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IERC721Token.sol\";\nimport \"./IERC721Receiver.sol\";\nimport \"../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract ERC721Token is\n IERC721Token,\n SafeMath\n{\n // Function selector for ERC721Receiver.onERC721Received\n // 0x150b7a02\n bytes4 constant internal ERC721_RECEIVED = bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"));\n\n // Mapping of tokenId => owner\n mapping (uint256 => address) internal owners;\n\n // Mapping of tokenId => approved address\n mapping (uint256 => address) internal approvals;\n\n // Mapping of owner => number of tokens owned\n mapping (address => uint256) internal balances;\n\n // Mapping of owner => operator => approved\n mapping (address => mapping (address => bool)) internal operatorApprovals;\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT. When transfer is complete, this function\n /// checks if `_to` is a smart contract (code size > 0). If so, it calls\n /// `onERC721Received` on `_to` and throws if the return value is not\n /// `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n /// @param _data Additional data with no specified format, sent in call to `_to`\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId,\n bytes _data\n )\n external\n {\n transferFrom(\n _from,\n _to,\n _tokenId\n );\n\n uint256 receiverCodeSize;\n assembly {\n receiverCodeSize := extcodesize(_to)\n }\n if (receiverCodeSize > 0) {\n bytes4 selector = IERC721Receiver(_to).onERC721Received(\n msg.sender,\n _from,\n _tokenId,\n _data\n );\n require(\n selector == ERC721_RECEIVED,\n \"ERC721_INVALID_SELECTOR\"\n );\n }\n }\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev This works identically to the other function with an extra data parameter,\n /// except this function just sets data to \"\".\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n external\n {\n transferFrom(\n _from,\n _to,\n _tokenId\n );\n\n uint256 receiverCodeSize;\n assembly {\n receiverCodeSize := extcodesize(_to)\n }\n if (receiverCodeSize > 0) {\n bytes4 selector = IERC721Receiver(_to).onERC721Received(\n msg.sender,\n _from,\n _tokenId,\n \"\"\n );\n require(\n selector == ERC721_RECEIVED,\n \"ERC721_INVALID_SELECTOR\"\n );\n }\n }\n\n /// @notice Change or reaffirm the approved address for an NFT\n /// @dev The zero address indicates there is no approved address.\n /// Throws unless `msg.sender` is the current NFT owner, or an authorized\n /// operator of the current owner.\n /// @param _approved The new approved NFT controller\n /// @param _tokenId The NFT to approve\n function approve(address _approved, uint256 _tokenId)\n external\n {\n address owner = ownerOf(_tokenId);\n require(\n msg.sender == owner || isApprovedForAll(owner, msg.sender),\n \"ERC721_INVALID_SENDER\"\n );\n\n approvals[_tokenId] = _approved;\n emit Approval(\n owner,\n _approved,\n _tokenId\n );\n }\n\n /// @notice Enable or disable approval for a third party (\"operator\") to manage\n /// all of `msg.sender`'s assets\n /// @dev Emits the ApprovalForAll event. The contract MUST allow\n /// multiple operators per owner.\n /// @param _operator Address to add to the set of authorized operators\n /// @param _approved True if the operator is approved, false to revoke approval\n function setApprovalForAll(address _operator, bool _approved)\n external\n {\n operatorApprovals[msg.sender][_operator] = _approved;\n emit ApprovalForAll(\n msg.sender,\n _operator,\n _approved\n );\n }\n \n /// @notice Count all NFTs assigned to an owner\n /// @dev NFTs assigned to the zero address are considered invalid, and this\n /// function throws for queries about the zero address.\n /// @param _owner An address for whom to query the balance\n /// @return The number of NFTs owned by `_owner`, possibly zero\n function balanceOf(address _owner)\n external\n view\n returns (uint256)\n {\n require(\n _owner != address(0),\n \"ERC721_ZERO_OWNER\"\n );\n return balances[_owner];\n }\n\n /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE\n /// TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE\n /// THEY MAY BE PERMANENTLY LOST\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function transferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n public\n {\n require(\n _to != address(0),\n \"ERC721_ZERO_TO_ADDRESS\"\n );\n\n address owner = ownerOf(_tokenId);\n require(\n _from == owner,\n \"ERC721_OWNER_MISMATCH\"\n );\n\n address spender = msg.sender;\n address approvedAddress = getApproved(_tokenId);\n require(\n spender == owner ||\n isApprovedForAll(owner, spender) ||\n approvedAddress == spender,\n \"ERC721_INVALID_SPENDER\"\n );\n\n if (approvedAddress != address(0)) {\n approvals[_tokenId] = address(0);\n }\n\n owners[_tokenId] = _to;\n balances[_from] = safeSub(balances[_from], 1);\n balances[_to] = safeAdd(balances[_to], 1);\n \n emit Transfer(\n _from,\n _to,\n _tokenId\n );\n }\n\n /// @notice Find the owner of an NFT\n /// @dev NFTs assigned to zero address are considered invalid, and queries\n /// about them do throw.\n /// @param _tokenId The identifier for an NFT\n /// @return The address of the owner of the NFT\n function ownerOf(uint256 _tokenId)\n public\n view\n returns (address)\n {\n address owner = owners[_tokenId];\n require(\n owner != address(0),\n \"ERC721_ZERO_OWNER\"\n );\n return owner;\n }\n\n /// @notice Get the approved address for a single NFT\n /// @dev Throws if `_tokenId` is not a valid NFT.\n /// @param _tokenId The NFT to find the approved address for\n /// @return The approved address for this NFT, or the zero address if there is none\n function getApproved(uint256 _tokenId)\n public\n view\n returns (address)\n {\n return approvals[_tokenId];\n }\n\n /// @notice Query if an address is an authorized operator for another address\n /// @param _owner The address that owns the NFTs\n /// @param _operator The address that acts on behalf of the owner\n /// @return True if `_operator` is an approved operator for `_owner`, false otherwise\n function isApprovedForAll(address _owner, address _operator)\n public\n view\n returns (bool)\n {\n return operatorApprovals[_owner][_operator];\n }\n}\n",
- "2.0.0/tokens/ERC721Token/IERC721Receiver.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC721Receiver {\n\n /// @notice Handle the receipt of an NFT\n /// @dev The ERC721 smart contract calls this function on the recipient\n /// after a `transfer`. This function MAY throw to revert and reject the\n /// transfer. Return of other than the magic value MUST result in the\n /// transaction being reverted.\n /// Note: the contract address is always the message sender.\n /// @param _operator The address which called `safeTransferFrom` function\n /// @param _from The address which previously owned the token\n /// @param _tokenId The NFT identifier which is being transferred\n /// @param _data Additional data with no specified format\n /// @return `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`\n /// unless throwing\n function onERC721Received(\n address _operator,\n address _from,\n uint256 _tokenId,\n bytes _data\n )\n external\n returns (bytes4);\n}\n",
- "2.0.0/tokens/ERC721Token/IERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC721Token {\n\n /// @dev This emits when ownership of any NFT changes by any mechanism.\n /// This event emits when NFTs are created (`from` == 0) and destroyed\n /// (`to` == 0). Exception: during contract creation, any number of NFTs\n /// may be created and assigned without emitting Transfer. At the time of\n /// any transfer, the approved address for that NFT (if any) is reset to none.\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 indexed _tokenId\n );\n\n /// @dev This emits when the approved address for an NFT is changed or\n /// reaffirmed. The zero address indicates there is no approved address.\n /// When a Transfer event emits, this also indicates that the approved\n /// address for that NFT (if any) is reset to none.\n event Approval(\n address indexed _owner,\n address indexed _approved,\n uint256 indexed _tokenId\n );\n\n /// @dev This emits when an operator is enabled or disabled for an owner.\n /// The operator can manage all NFTs of the owner.\n event ApprovalForAll(\n address indexed _owner,\n address indexed _operator,\n bool _approved\n );\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// perator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT. When transfer is complete, this function\n /// checks if `_to` is a smart contract (code size > 0). If so, it calls\n /// `onERC721Received` on `_to` and throws if the return value is not\n /// `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n /// @param _data Additional data with no specified format, sent in call to `_to`\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId,\n bytes _data\n )\n external;\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev This works identically to the other function with an extra data parameter,\n /// except this function just sets data to \"\".\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n external;\n\n /// @notice Change or reaffirm the approved address for an NFT\n /// @dev The zero address indicates there is no approved address.\n /// Throws unless `msg.sender` is the current NFT owner, or an authorized\n /// operator of the current owner.\n /// @param _approved The new approved NFT controller\n /// @param _tokenId The NFT to approve\n function approve(address _approved, uint256 _tokenId)\n external;\n\n /// @notice Enable or disable approval for a third party (\"operator\") to manage\n /// all of `msg.sender`'s assets\n /// @dev Emits the ApprovalForAll event. The contract MUST allow\n /// multiple operators per owner.\n /// @param _operator Address to add to the set of authorized operators\n /// @param _approved True if the operator is approved, false to revoke approval\n function setApprovalForAll(address _operator, bool _approved)\n external;\n\n /// @notice Count all NFTs assigned to an owner\n /// @dev NFTs assigned to the zero address are considered invalid, and this\n /// function throws for queries about the zero address.\n /// @param _owner An address for whom to query the balance\n /// @return The number of NFTs owned by `_owner`, possibly zero\n function balanceOf(address _owner)\n external\n view\n returns (uint256);\n\n /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE\n /// TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE\n /// THEY MAY BE PERMANENTLY LOST\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function transferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n public;\n\n /// @notice Find the owner of an NFT\n /// @dev NFTs assigned to zero address are considered invalid, and queries\n /// about them do throw.\n /// @param _tokenId The identifier for an NFT\n /// @return The address of the owner of the NFT\n function ownerOf(uint256 _tokenId)\n public\n view\n returns (address);\n\n /// @notice Get the approved address for a single NFT\n /// @dev Throws if `_tokenId` is not a valid NFT.\n /// @param _tokenId The NFT to find the approved address for\n /// @return The approved address for this NFT, or the zero address if there is none\n function getApproved(uint256 _tokenId) \n public\n view\n returns (address);\n \n /// @notice Query if an address is an authorized operator for another address\n /// @param _owner The address that owns the NFTs\n /// @param _operator The address that acts on behalf of the owner\n /// @return True if `_operator` is an approved operator for `_owner`, false otherwise\n function isApprovedForAll(address _owner, address _operator)\n public\n view\n returns (bool);\n}\n",
- "2.0.0/tokens/ERC721Token/MintableERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./ERC721Token.sol\";\n\n\ncontract MintableERC721Token is\n ERC721Token\n{\n /// @dev Function to mint a new token\n /// Reverts if the given token ID already exists\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _tokenId ID of the token to be minted by the msg.sender \n function _mint(address _to, uint256 _tokenId)\n internal\n {\n require(\n _to != address(0),\n \"ERC721_ZERO_TO_ADDRESS\"\n );\n\n address owner = owners[_tokenId];\n require(\n owner == address(0),\n \"ERC721_OWNER_ALREADY_EXISTS\"\n );\n\n owners[_tokenId] = _to;\n balances[_to] = safeAdd(balances[_to], 1);\n\n emit Transfer(\n address(0),\n _to,\n _tokenId\n );\n }\n\n /// @dev Function to burn a token\n /// Reverts if the given token ID doesn't exist\n /// @param _owner Owner of token with given token ID\n /// @param _tokenId ID of the token to be burned by the msg.sender\n function _burn(address _owner, uint256 _tokenId)\n internal\n {\n require(\n _owner != address(0),\n \"ERC721_ZERO_OWNER_ADDRESS\"\n );\n\n address owner = owners[_tokenId];\n require(\n owner == _owner,\n \"ERC721_OWNER_MISMATCH\"\n );\n\n owners[_tokenId] = address(0);\n balances[_owner] = safeSub(balances[_owner], 1);\n\n emit Transfer(\n _owner,\n address(0),\n _tokenId\n );\n }\n}\n",
- "2.0.0/tokens/EtherToken/IEtherToken.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../ERC20Token/IERC20Token.sol\";\n\n\ncontract IEtherToken is\n IERC20Token\n{\n function deposit()\n public\n payable;\n \n function withdraw(uint256 amount)\n public;\n}\n",
- "2.0.0/utils/LibBytes/LibBytes.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\nlibrary LibBytes {\n\n using LibBytes for bytes;\n\n /// @dev Gets the memory address for a byte array.\n /// @param input Byte array to lookup.\n /// @return memoryAddress Memory address of byte array. This\n /// points to the header of the byte array which contains\n /// the length.\n function rawAddress(bytes memory input)\n internal\n pure\n returns (uint256 memoryAddress)\n {\n assembly {\n memoryAddress := input\n }\n return memoryAddress;\n }\n \n /// @dev Gets the memory address for the contents of a byte array.\n /// @param input Byte array to lookup.\n /// @return memoryAddress Memory address of the contents of the byte array.\n function contentAddress(bytes memory input)\n internal\n pure\n returns (uint256 memoryAddress)\n {\n assembly {\n memoryAddress := add(input, 32)\n }\n return memoryAddress;\n }\n\n /// @dev Copies `length` bytes from memory location `source` to `dest`.\n /// @param dest memory address to copy bytes to.\n /// @param source memory address to copy bytes from.\n /// @param length number of bytes to copy.\n function memCopy(\n uint256 dest,\n uint256 source,\n uint256 length\n )\n internal\n pure\n {\n if (length < 32) {\n // Handle a partial word by reading destination and masking\n // off the bits we are interested in.\n // This correctly handles overlap, zero lengths and source == dest\n assembly {\n let mask := sub(exp(256, sub(32, length)), 1)\n let s := and(mload(source), not(mask))\n let d := and(mload(dest), mask)\n mstore(dest, or(s, d))\n }\n } else {\n // Skip the O(length) loop when source == dest.\n if (source == dest) {\n return;\n }\n\n // For large copies we copy whole words at a time. The final\n // word is aligned to the end of the range (instead of after the\n // previous) to handle partial words. So a copy will look like this:\n //\n // ####\n // ####\n // ####\n // ####\n //\n // We handle overlap in the source and destination range by\n // changing the copying direction. This prevents us from\n // overwriting parts of source that we still need to copy.\n //\n // This correctly handles source == dest\n //\n if (source > dest) {\n assembly {\n // We subtract 32 from `sEnd` and `dEnd` because it\n // is easier to compare with in the loop, and these\n // are also the addresses we need for copying the\n // last bytes.\n length := sub(length, 32)\n let sEnd := add(source, length)\n let dEnd := add(dest, length)\n\n // Remember the last 32 bytes of source\n // This needs to be done here and not after the loop\n // because we may have overwritten the last bytes in\n // source already due to overlap.\n let last := mload(sEnd)\n\n // Copy whole words front to back\n // Note: the first check is always true,\n // this could have been a do-while loop.\n // solhint-disable-next-line no-empty-blocks\n for {} lt(source, sEnd) {} {\n mstore(dest, mload(source))\n source := add(source, 32)\n dest := add(dest, 32)\n }\n \n // Write the last 32 bytes\n mstore(dEnd, last)\n }\n } else {\n assembly {\n // We subtract 32 from `sEnd` and `dEnd` because those\n // are the starting points when copying a word at the end.\n length := sub(length, 32)\n let sEnd := add(source, length)\n let dEnd := add(dest, length)\n\n // Remember the first 32 bytes of source\n // This needs to be done here and not after the loop\n // because we may have overwritten the first bytes in\n // source already due to overlap.\n let first := mload(source)\n\n // Copy whole words back to front\n // We use a signed comparisson here to allow dEnd to become\n // negative (happens when source and dest < 32). Valid\n // addresses in local memory will never be larger than\n // 2**255, so they can be safely re-interpreted as signed.\n // Note: the first check is always true,\n // this could have been a do-while loop.\n // solhint-disable-next-line no-empty-blocks\n for {} slt(dest, dEnd) {} {\n mstore(dEnd, mload(sEnd))\n sEnd := sub(sEnd, 32)\n dEnd := sub(dEnd, 32)\n }\n \n // Write the first 32 bytes\n mstore(dest, first)\n }\n }\n }\n }\n\n /// @dev Returns a slices from a byte array.\n /// @param b The byte array to take a slice from.\n /// @param from The starting index for the slice (inclusive).\n /// @param to The final index for the slice (exclusive).\n /// @return result The slice containing bytes at indices [from, to)\n function slice(\n bytes memory b,\n uint256 from,\n uint256 to\n )\n internal\n pure\n returns (bytes memory result)\n {\n require(\n from <= to,\n \"FROM_LESS_THAN_TO_REQUIRED\"\n );\n require(\n to < b.length,\n \"TO_LESS_THAN_LENGTH_REQUIRED\"\n );\n \n // Create a new bytes structure and copy contents\n result = new bytes(to - from);\n memCopy(\n result.contentAddress(),\n b.contentAddress() + from,\n result.length\n );\n return result;\n }\n \n /// @dev Returns a slice from a byte array without preserving the input.\n /// @param b The byte array to take a slice from. Will be destroyed in the process.\n /// @param from The starting index for the slice (inclusive).\n /// @param to The final index for the slice (exclusive).\n /// @return result The slice containing bytes at indices [from, to)\n /// @dev When `from == 0`, the original array will match the slice. In other cases its state will be corrupted.\n function sliceDestructive(\n bytes memory b,\n uint256 from,\n uint256 to\n )\n internal\n pure\n returns (bytes memory result)\n {\n require(\n from <= to,\n \"FROM_LESS_THAN_TO_REQUIRED\"\n );\n require(\n to < b.length,\n \"TO_LESS_THAN_LENGTH_REQUIRED\"\n );\n \n // Create a new bytes structure around [from, to) in-place.\n assembly {\n result := add(b, from)\n mstore(result, sub(to, from))\n }\n return result;\n }\n\n /// @dev Pops the last byte off of a byte array by modifying its length.\n /// @param b Byte array that will be modified.\n /// @return The byte that was popped off.\n function popLastByte(bytes memory b)\n internal\n pure\n returns (bytes1 result)\n {\n require(\n b.length > 0,\n \"GREATER_THAN_ZERO_LENGTH_REQUIRED\"\n );\n\n // Store last byte.\n result = b[b.length - 1];\n\n assembly {\n // Decrement length of byte array.\n let newLen := sub(mload(b), 1)\n mstore(b, newLen)\n }\n return result;\n }\n\n /// @dev Pops the last 20 bytes off of a byte array by modifying its length.\n /// @param b Byte array that will be modified.\n /// @return The 20 byte address that was popped off.\n function popLast20Bytes(bytes memory b)\n internal\n pure\n returns (address result)\n {\n require(\n b.length >= 20,\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Store last 20 bytes.\n result = readAddress(b, b.length - 20);\n\n assembly {\n // Subtract 20 from byte array length.\n let newLen := sub(mload(b), 20)\n mstore(b, newLen)\n }\n return result;\n }\n\n /// @dev Tests equality of two byte arrays.\n /// @param lhs First byte array to compare.\n /// @param rhs Second byte array to compare.\n /// @return True if arrays are the same. False otherwise.\n function equals(\n bytes memory lhs,\n bytes memory rhs\n )\n internal\n pure\n returns (bool equal)\n {\n // Keccak gas cost is 30 + numWords * 6. This is a cheap way to compare.\n // We early exit on unequal lengths, but keccak would also correctly\n // handle this.\n return lhs.length == rhs.length && keccak256(lhs) == keccak256(rhs);\n }\n\n /// @dev Reads an address from a position in a byte array.\n /// @param b Byte array containing an address.\n /// @param index Index in byte array of address.\n /// @return address from byte array.\n function readAddress(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (address result)\n {\n require(\n b.length >= index + 20, // 20 is length of address\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Add offset to index:\n // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)\n // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)\n index += 20;\n\n // Read address from array memory\n assembly {\n // 1. Add index to address of bytes array\n // 2. Load 32-byte word from memory\n // 3. Apply 20-byte mask to obtain address\n result := and(mload(add(b, index)), 0xffffffffffffffffffffffffffffffffffffffff)\n }\n return result;\n }\n\n /// @dev Writes an address into a specific position in a byte array.\n /// @param b Byte array to insert address into.\n /// @param index Index in byte array of address.\n /// @param input Address to put into byte array.\n function writeAddress(\n bytes memory b,\n uint256 index,\n address input\n )\n internal\n pure\n {\n require(\n b.length >= index + 20, // 20 is length of address\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Add offset to index:\n // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)\n // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)\n index += 20;\n\n // Store address into array memory\n assembly {\n // The address occupies 20 bytes and mstore stores 32 bytes.\n // First fetch the 32-byte word where we'll be storing the address, then\n // apply a mask so we have only the bytes in the word that the address will not occupy.\n // Then combine these bytes with the address and store the 32 bytes back to memory with mstore.\n\n // 1. Add index to address of bytes array\n // 2. Load 32-byte word from memory\n // 3. Apply 12-byte mask to obtain extra bytes occupying word of memory where we'll store the address\n let neighbors := and(\n mload(add(b, index)),\n 0xffffffffffffffffffffffff0000000000000000000000000000000000000000\n )\n \n // Make sure input address is clean.\n // (Solidity does not guarantee this)\n input := and(input, 0xffffffffffffffffffffffffffffffffffffffff)\n\n // Store the neighbors and address into memory\n mstore(add(b, index), xor(input, neighbors))\n }\n }\n\n /// @dev Reads a bytes32 value from a position in a byte array.\n /// @param b Byte array containing a bytes32 value.\n /// @param index Index in byte array of bytes32 value.\n /// @return bytes32 value from byte array.\n function readBytes32(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes32 result)\n {\n require(\n b.length >= index + 32,\n \"GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 256 bit length parameter\n index += 32;\n\n // Read the bytes32 from array memory\n assembly {\n result := mload(add(b, index))\n }\n return result;\n }\n\n /// @dev Writes a bytes32 into a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input bytes32 to put into byte array.\n function writeBytes32(\n bytes memory b,\n uint256 index,\n bytes32 input\n )\n internal\n pure\n {\n require(\n b.length >= index + 32,\n \"GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 256 bit length parameter\n index += 32;\n\n // Read the bytes32 from array memory\n assembly {\n mstore(add(b, index), input)\n }\n }\n\n /// @dev Reads a uint256 value from a position in a byte array.\n /// @param b Byte array containing a uint256 value.\n /// @param index Index in byte array of uint256 value.\n /// @return uint256 value from byte array.\n function readUint256(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (uint256 result)\n {\n result = uint256(readBytes32(b, index));\n return result;\n }\n\n /// @dev Writes a uint256 into a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input uint256 to put into byte array.\n function writeUint256(\n bytes memory b,\n uint256 index,\n uint256 input\n )\n internal\n pure\n {\n writeBytes32(b, index, bytes32(input));\n }\n\n /// @dev Reads an unpadded bytes4 value from a position in a byte array.\n /// @param b Byte array containing a bytes4 value.\n /// @param index Index in byte array of bytes4 value.\n /// @return bytes4 value from byte array.\n function readBytes4(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes4 result)\n {\n require(\n b.length >= index + 4,\n \"GREATER_OR_EQUAL_TO_4_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 32 byte length field\n index += 32;\n\n // Read the bytes4 from array memory\n assembly {\n result := mload(add(b, index))\n // Solidity does not require us to clean the trailing bytes.\n // We do it anyway\n result := and(result, 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000)\n }\n return result;\n }\n\n /// @dev Reads nested bytes from a specific position.\n /// @dev NOTE: the returned value overlaps with the input value.\n /// Both should be treated as immutable.\n /// @param b Byte array containing nested bytes.\n /// @param index Index of nested bytes.\n /// @return result Nested bytes.\n function readBytesWithLength(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes memory result)\n {\n // Read length of nested bytes\n uint256 nestedBytesLength = readUint256(b, index);\n index += 32;\n\n // Assert length of <b> is valid, given\n // length of nested bytes\n require(\n b.length >= index + nestedBytesLength,\n \"GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED\"\n );\n \n // Return a pointer to the byte array as it exists inside `b`\n assembly {\n result := add(b, index)\n }\n return result;\n }\n\n /// @dev Inserts bytes at a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input bytes to insert.\n function writeBytesWithLength(\n bytes memory b,\n uint256 index,\n bytes memory input\n )\n internal\n pure\n {\n // Assert length of <b> is valid, given\n // length of input\n require(\n b.length >= index + 32 + input.length, // 32 bytes to store length\n \"GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED\"\n );\n\n // Copy <input> into <b>\n memCopy(\n b.contentAddress() + index,\n input.rawAddress(), // includes length of <input>\n input.length + 32 // +32 bytes to store <input> length\n );\n }\n\n /// @dev Performs a deep copy of a byte array onto another byte array of greater than or equal length.\n /// @param dest Byte array that will be overwritten with source bytes.\n /// @param source Byte array to copy onto dest bytes.\n function deepCopyBytes(\n bytes memory dest,\n bytes memory source\n )\n internal\n pure\n {\n uint256 sourceLen = source.length;\n // Dest length must be >= source length, or some bytes would not be copied.\n require(\n dest.length >= sourceLen,\n \"GREATER_OR_EQUAL_TO_SOURCE_BYTES_LENGTH_REQUIRED\"\n );\n memCopy(\n dest.contentAddress(),\n source.contentAddress(),\n sourceLen\n );\n }\n}\n",
- "2.0.0/utils/Ownable/IOwnable.sol": "pragma solidity 0.4.24;\n\n\ncontract IOwnable {\n\n function transferOwnership(address newOwner)\n public;\n}\n",
- "2.0.0/utils/Ownable/Ownable.sol": "pragma solidity 0.4.24;\n\nimport \"./IOwnable.sol\";\n\n\ncontract Ownable is\n IOwnable\n{\n address public owner;\n\n constructor ()\n public\n {\n owner = msg.sender;\n }\n\n modifier onlyOwner() {\n require(\n msg.sender == owner,\n \"ONLY_CONTRACT_OWNER\"\n );\n _;\n }\n\n function transferOwnership(address newOwner)\n public\n onlyOwner\n {\n if (newOwner != address(0)) {\n owner = newOwner;\n }\n }\n}\n",
- "2.0.0/utils/ReentrancyGuard/ReentrancyGuard.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract ReentrancyGuard {\n\n // Locked state of mutex\n bool private locked = false;\n\n /// @dev Functions with this modifer cannot be reentered. The mutex will be locked\n /// before function execution and unlocked after.\n modifier nonReentrant() {\n // Ensure mutex is unlocked\n require(\n !locked,\n \"REENTRANCY_ILLEGAL\"\n );\n\n // Lock mutex before function call\n locked = true;\n\n // Perform function call\n _;\n\n // Unlock mutex after function call\n locked = false;\n }\n}\n",
- "2.0.0/utils/SafeMath/SafeMath.sol": "pragma solidity 0.4.24;\n\n\ncontract SafeMath {\n\n function safeMul(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n if (a == 0) {\n return 0;\n }\n uint256 c = a * b;\n require(\n c / a == b,\n \"UINT256_OVERFLOW\"\n );\n return c;\n }\n\n function safeDiv(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n uint256 c = a / b;\n return c;\n }\n\n function safeSub(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n require(\n b <= a,\n \"UINT256_UNDERFLOW\"\n );\n return a - b;\n }\n\n function safeAdd(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n uint256 c = a + b;\n require(\n c >= a,\n \"UINT256_OVERFLOW\"\n );\n return c;\n }\n\n function max64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n\n function max256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n}\n"
- },
- "sourceTreeHashHex": "0xbd0ac9751d7681f909fd16b969568f4dfcee9893e0b084aa1b198b6bb38f8f48",
- "compiler": {
- "name": "solc",
- "version": "soljson-v0.4.24+commit.e67f0147.js",
- "settings": {
- "optimizer": {
- "enabled": true,
- "runs": 1000000
- },
- "outputSelection": {
- "*": {
- "*": [
- "abi",
- "evm.bytecode.object",
- "evm.bytecode.sourceMap",
- "evm.deployedBytecode.object",
- "evm.deployedBytecode.sourceMap"
- ]
- }
- }
- }
- },
- "networks": {
- "3": {
- "address": "0xff67881f8d12f372d91baae9752eb3631ff0ed00",
- "links": {},
- "constructorArgs": "[\"0x Protocol Token\",\"ZRX\",\"18\",\"1000000000000000000000000000\"]"
- },
- "42": {
- "address": "0x2002d3812f58e35f0ea1ffbf80a75a38c32175fa",
- "links": {},
- "constructorArgs": "[\"0x Protocol Token\",\"ZRX\",\"18\",\"1000000000000000000000000000\"]"
- },
- "50": {
- "address": "0x871dd7c2b4b25e1aa18728e9d5f2af4c4e431f5c",
- "links": {},
- "constructorArgs": "[\"0x Protocol Token\",\"ZRX\",\"18\",\"115792089237316195423570985008687907853269984665640564039457584007913129639935\"]"
- }
- }
-}
diff --git a/packages/migrations/artifacts/2.0.0/DummyERC721Token.json b/packages/migrations/artifacts/2.0.0/DummyERC721Token.json
deleted file mode 100644
index f0363ad81..000000000
--- a/packages/migrations/artifacts/2.0.0/DummyERC721Token.json
+++ /dev/null
@@ -1,672 +0,0 @@
-{
- "schemaVersion": "2.0.0",
- "contractName": "DummyERC721Token",
- "compilerOutput": {
- "abi": [
- {
- "constant": true,
- "inputs": [],
- "name": "name",
- "outputs": [
- {
- "name": "",
- "type": "string"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "_tokenId",
- "type": "uint256"
- }
- ],
- "name": "getApproved",
- "outputs": [
- {
- "name": "",
- "type": "address"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_approved",
- "type": "address"
- },
- {
- "name": "_tokenId",
- "type": "uint256"
- }
- ],
- "name": "approve",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_from",
- "type": "address"
- },
- {
- "name": "_to",
- "type": "address"
- },
- {
- "name": "_tokenId",
- "type": "uint256"
- }
- ],
- "name": "transferFrom",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_to",
- "type": "address"
- },
- {
- "name": "_tokenId",
- "type": "uint256"
- }
- ],
- "name": "mint",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_from",
- "type": "address"
- },
- {
- "name": "_to",
- "type": "address"
- },
- {
- "name": "_tokenId",
- "type": "uint256"
- }
- ],
- "name": "safeTransferFrom",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "_tokenId",
- "type": "uint256"
- }
- ],
- "name": "ownerOf",
- "outputs": [
- {
- "name": "",
- "type": "address"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "_owner",
- "type": "address"
- }
- ],
- "name": "balanceOf",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "owner",
- "outputs": [
- {
- "name": "",
- "type": "address"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "symbol",
- "outputs": [
- {
- "name": "",
- "type": "string"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_owner",
- "type": "address"
- },
- {
- "name": "_tokenId",
- "type": "uint256"
- }
- ],
- "name": "burn",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_operator",
- "type": "address"
- },
- {
- "name": "_approved",
- "type": "bool"
- }
- ],
- "name": "setApprovalForAll",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_from",
- "type": "address"
- },
- {
- "name": "_to",
- "type": "address"
- },
- {
- "name": "_tokenId",
- "type": "uint256"
- },
- {
- "name": "_data",
- "type": "bytes"
- }
- ],
- "name": "safeTransferFrom",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "_owner",
- "type": "address"
- },
- {
- "name": "_operator",
- "type": "address"
- }
- ],
- "name": "isApprovedForAll",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "newOwner",
- "type": "address"
- }
- ],
- "name": "transferOwnership",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "inputs": [
- {
- "name": "_name",
- "type": "string"
- },
- {
- "name": "_symbol",
- "type": "string"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "constructor"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "_from",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "_to",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "_tokenId",
- "type": "uint256"
- }
- ],
- "name": "Transfer",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "_owner",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "_approved",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "_tokenId",
- "type": "uint256"
- }
- ],
- "name": "Approval",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "_owner",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "_operator",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "_approved",
- "type": "bool"
- }
- ],
- "name": "ApprovalForAll",
- "type": "event"
- }
- ],
- "evm": {
- "bytecode": {
- "linkReferences": {},
- "object": "0x60806040523480156200001157600080fd5b506040516200175e3803806200175e83398101604052805160208083015160008054600160a060020a031916331790559183018051909392909201916200005f91600591908501906200007e565b508051620000759060069060208401906200007e565b50505062000123565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10620000c157805160ff1916838001178555620000f1565b82800160010185558215620000f1579182015b82811115620000f1578251825591602001919060010190620000d4565b50620000ff92915062000103565b5090565b6200012091905b80821115620000ff57600081556001016200010a565b90565b61162b80620001336000396000f3006080604052600436106100da5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100df578063081812fc14610169578063095ea7b3146101aa57806323b872dd146101dd57806340c10f191461021457806342842e0e146102455780636352211e1461027c57806370a08231146102945780638da5cb5b146102d457806395d89b41146102e95780639dc29fac146102fe578063a22cb4651461032f578063b88d4fde14610362578063e985e9c5146103a8578063f2fde38b146103f0575b600080fd5b3480156100eb57600080fd5b506100f461041e565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561012e578181015183820152602001610116565b50505050905090810190601f16801561015b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561017557600080fd5b506101816004356104ca565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b3480156101b657600080fd5b506101db73ffffffffffffffffffffffffffffffffffffffff600435166024356104f2565b005b3480156101e957600080fd5b506101db73ffffffffffffffffffffffffffffffffffffffff60043581169060243516604435610616565b34801561022057600080fd5b506101db73ffffffffffffffffffffffffffffffffffffffff60043516602435610977565b34801561025157600080fd5b506101db73ffffffffffffffffffffffffffffffffffffffff60043581169060243516604435610985565b34801561028857600080fd5b50610181600435610b50565b3480156102a057600080fd5b506102c273ffffffffffffffffffffffffffffffffffffffff60043516610be9565b60408051918252519081900360200190f35b3480156102e057600080fd5b50610181610c98565b3480156102f557600080fd5b506100f4610cb4565b34801561030a57600080fd5b506101db73ffffffffffffffffffffffffffffffffffffffff60043516602435610d2d565b34801561033b57600080fd5b506101db73ffffffffffffffffffffffffffffffffffffffff600435166024351515610dbd565b34801561036e57600080fd5b506101db73ffffffffffffffffffffffffffffffffffffffff60048035821691602480359091169160443591606435908101910135610e56565b3480156103b457600080fd5b506103dc73ffffffffffffffffffffffffffffffffffffffff6004358116906024351661103a565b604080519115158252519081900360200190f35b3480156103fc57600080fd5b506101db73ffffffffffffffffffffffffffffffffffffffff60043516611075565b6005805460408051602060026001851615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f810184900484028201840190925281815292918301828280156104c25780601f10610497576101008083540402835291602001916104c2565b820191906000526020600020905b8154815290600101906020018083116104a557829003601f168201915b505050505081565b60009081526002602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b60006104fd82610b50565b90503373ffffffffffffffffffffffffffffffffffffffff821614806105285750610528813361103a565b151561059557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4552433732315f494e56414c49445f53454e4445520000000000000000000000604482015290519081900360640190fd5b60008281526002602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff87811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6000808073ffffffffffffffffffffffffffffffffffffffff8516151561069e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4552433732315f5a45524f5f544f5f4144445245535300000000000000000000604482015290519081900360640190fd5b6106a784610b50565b925073ffffffffffffffffffffffffffffffffffffffff8681169084161461073057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4552433732315f4f574e45525f4d49534d415443480000000000000000000000604482015290519081900360640190fd5b33915061073c846104ca565b90508273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148061077d575061077d838361103a565b806107b357508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b151561082057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4552433732315f494e56414c49445f5350454e44455200000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff81161561087157600084815260026020526040902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001690555b600084815260016020818152604080842080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8b8116919091179091558a1684526003909152909120546108db9161115b565b73ffffffffffffffffffffffffffffffffffffffff80881660009081526003602052604080822093909355908716815220546109189060016111d2565b73ffffffffffffffffffffffffffffffffffffffff808716600081815260036020526040808220949094559251879391928a16917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050505050565b610981828261124d565b5050565b600080610993858585610616565b833b91506000821115610b4957604080517f150b7a0200000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff8781166024830152604482018690526080606483015260006084830181905292519087169263150b7a029260c480820193602093909283900390910190829087803b158015610a3057600080fd5b505af1158015610a44573d6000803e3d6000fd5b505050506040513d6020811015610a5a57600080fd5b5051604080517f6f6e455243373231526563656976656428616464726573732c6164647265737381527f2c75696e743235362c62797465732900000000000000000000000000000000006020820152905190819003602f0190209091507fffffffff00000000000000000000000000000000000000000000000000000000808316911614610b4957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4552433732315f494e56414c49445f53454c4543544f52000000000000000000604482015290519081900360640190fd5b5050505050565b60008181526001602052604081205473ffffffffffffffffffffffffffffffffffffffff16801515610be357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f4552433732315f5a45524f5f4f574e4552000000000000000000000000000000604482015290519081900360640190fd5b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82161515610c6f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f4552433732315f5a45524f5f4f574e4552000000000000000000000000000000604482015290519081900360640190fd5b5073ffffffffffffffffffffffffffffffffffffffff1660009081526003602052604090205490565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b6006805460408051602060026001851615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f810184900484028201840190925281815292918301828280156104c25780601f10610497576101008083540402835291602001916104c2565b60005473ffffffffffffffffffffffffffffffffffffffff163314610db357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b6109818282611425565b33600081815260046020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168085529083529281902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016861515908117909155815190815290519293927f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31929181900390910190a35050565b600080610e64878787610616565b853b91506000821115611031576040517f150b7a02000000000000000000000000000000000000000000000000000000008152336004820181815273ffffffffffffffffffffffffffffffffffffffff8a811660248501526044840189905260806064850190815260848501889052908a169363150b7a0293928c928b928b928b92909160a40184848082843782019150509650505050505050602060405180830381600087803b158015610f1857600080fd5b505af1158015610f2c573d6000803e3d6000fd5b505050506040513d6020811015610f4257600080fd5b5051604080517f6f6e455243373231526563656976656428616464726573732c6164647265737381527f2c75696e743235362c62797465732900000000000000000000000000000000006020820152905190819003602f0190209091507fffffffff0000000000000000000000000000000000000000000000000000000080831691161461103157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4552433732315f494e56414c49445f53454c4543544f52000000000000000000604482015290519081900360640190fd5b50505050505050565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260046020908152604080832093909416825291909152205460ff1690565b60005473ffffffffffffffffffffffffffffffffffffffff1633146110fb57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff81161561115857600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83161790555b50565b6000828211156111cc57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f55494e543235365f554e444552464c4f57000000000000000000000000000000604482015290519081900360640190fd5b50900390565b60008282018381101561124657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f55494e543235365f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b9392505050565b600073ffffffffffffffffffffffffffffffffffffffff831615156112d357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4552433732315f5a45524f5f544f5f4144445245535300000000000000000000604482015290519081900360640190fd5b5060008181526001602052604090205473ffffffffffffffffffffffffffffffffffffffff16801561136657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f4552433732315f4f574e45525f414c52454144595f4558495354530000000000604482015290519081900360640190fd5b600082815260016020818152604080842080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff891690811790915584526003909152909120546113cc916111d2565b73ffffffffffffffffffffffffffffffffffffffff84166000818152600360205260408082209390935591518492907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4505050565b600073ffffffffffffffffffffffffffffffffffffffff831615156114ab57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4552433732315f5a45524f5f4f574e45525f4144445245535300000000000000604482015290519081900360640190fd5b5060008181526001602052604090205473ffffffffffffffffffffffffffffffffffffffff908116908316811461154357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4552433732315f4f574e45525f4d49534d415443480000000000000000000000604482015290519081900360640190fd5b600082815260016020818152604080842080547fffffffffffffffffffffffff000000000000000000000000000000000000000016905573ffffffffffffffffffffffffffffffffffffffff871684526003909152909120546115a59161115b565b73ffffffffffffffffffffffffffffffffffffffff8416600081815260036020526040808220939093559151849291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050505600a165627a7a72305820b4f0e9923df681b39c750c35907b3b53e3d18d5d27a56215be103c035936a9e00029",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH3 0x11 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x40 MLOAD PUSH3 0x175E CODESIZE SUB DUP1 PUSH3 0x175E DUP4 CODECOPY DUP2 ADD PUSH1 0x40 MSTORE DUP1 MLOAD PUSH1 0x20 DUP1 DUP4 ADD MLOAD PUSH1 0x0 DUP1 SLOAD PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB NOT AND CALLER OR SWAP1 SSTORE SWAP2 DUP4 ADD DUP1 MLOAD SWAP1 SWAP4 SWAP3 SWAP1 SWAP3 ADD SWAP2 PUSH3 0x5F SWAP2 PUSH1 0x5 SWAP2 SWAP1 DUP6 ADD SWAP1 PUSH3 0x7E JUMP JUMPDEST POP DUP1 MLOAD PUSH3 0x75 SWAP1 PUSH1 0x6 SWAP1 PUSH1 0x20 DUP5 ADD SWAP1 PUSH3 0x7E JUMP JUMPDEST POP POP POP PUSH3 0x123 JUMP JUMPDEST DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 PUSH1 0x1F ADD PUSH1 0x20 SWAP1 DIV DUP2 ADD SWAP3 DUP3 PUSH1 0x1F LT PUSH3 0xC1 JUMPI DUP1 MLOAD PUSH1 0xFF NOT AND DUP4 DUP1 ADD OR DUP6 SSTORE PUSH3 0xF1 JUMP JUMPDEST DUP3 DUP1 ADD PUSH1 0x1 ADD DUP6 SSTORE DUP3 ISZERO PUSH3 0xF1 JUMPI SWAP2 DUP3 ADD JUMPDEST DUP3 DUP2 GT ISZERO PUSH3 0xF1 JUMPI DUP3 MLOAD DUP3 SSTORE SWAP2 PUSH1 0x20 ADD SWAP2 SWAP1 PUSH1 0x1 ADD SWAP1 PUSH3 0xD4 JUMP JUMPDEST POP PUSH3 0xFF SWAP3 SWAP2 POP PUSH3 0x103 JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST PUSH3 0x120 SWAP2 SWAP1 JUMPDEST DUP1 DUP3 GT ISZERO PUSH3 0xFF JUMPI PUSH1 0x0 DUP2 SSTORE PUSH1 0x1 ADD PUSH3 0x10A JUMP JUMPDEST SWAP1 JUMP JUMPDEST PUSH2 0x162B DUP1 PUSH3 0x133 PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN STOP PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0xDA JUMPI PUSH4 0xFFFFFFFF PUSH29 0x100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD DIV AND PUSH4 0x6FDDE03 DUP2 EQ PUSH2 0xDF JUMPI DUP1 PUSH4 0x81812FC EQ PUSH2 0x169 JUMPI DUP1 PUSH4 0x95EA7B3 EQ PUSH2 0x1AA JUMPI DUP1 PUSH4 0x23B872DD EQ PUSH2 0x1DD JUMPI DUP1 PUSH4 0x40C10F19 EQ PUSH2 0x214 JUMPI DUP1 PUSH4 0x42842E0E EQ PUSH2 0x245 JUMPI DUP1 PUSH4 0x6352211E EQ PUSH2 0x27C JUMPI DUP1 PUSH4 0x70A08231 EQ PUSH2 0x294 JUMPI DUP1 PUSH4 0x8DA5CB5B EQ PUSH2 0x2D4 JUMPI DUP1 PUSH4 0x95D89B41 EQ PUSH2 0x2E9 JUMPI DUP1 PUSH4 0x9DC29FAC EQ PUSH2 0x2FE JUMPI DUP1 PUSH4 0xA22CB465 EQ PUSH2 0x32F JUMPI DUP1 PUSH4 0xB88D4FDE EQ PUSH2 0x362 JUMPI DUP1 PUSH4 0xE985E9C5 EQ PUSH2 0x3A8 JUMPI DUP1 PUSH4 0xF2FDE38B EQ PUSH2 0x3F0 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xEB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xF4 PUSH2 0x41E JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 DUP1 DUP3 MSTORE DUP4 MLOAD DUP2 DUP4 ADD MSTORE DUP4 MLOAD SWAP2 SWAP3 DUP4 SWAP3 SWAP1 DUP4 ADD SWAP2 DUP6 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x12E JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH2 0x116 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x15B JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x175 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x181 PUSH1 0x4 CALLDATALOAD PUSH2 0x4CA JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1B6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1DB PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x4F2 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1E9 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1DB PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH1 0x44 CALLDATALOAD PUSH2 0x616 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x220 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1DB PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x977 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x251 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1DB PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH1 0x44 CALLDATALOAD PUSH2 0x985 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x288 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x181 PUSH1 0x4 CALLDATALOAD PUSH2 0xB50 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2A0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2C2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0xBE9 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2E0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x181 PUSH2 0xC98 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2F5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xF4 PUSH2 0xCB4 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x30A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1DB PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0xD2D JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x33B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1DB PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD ISZERO ISZERO PUSH2 0xDBD JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x36E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1DB PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 DUP1 CALLDATALOAD DUP3 AND SWAP2 PUSH1 0x24 DUP1 CALLDATALOAD SWAP1 SWAP2 AND SWAP2 PUSH1 0x44 CALLDATALOAD SWAP2 PUSH1 0x64 CALLDATALOAD SWAP1 DUP2 ADD SWAP2 ADD CALLDATALOAD PUSH2 0xE56 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3B4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x3DC PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH2 0x103A JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 ISZERO ISZERO DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3FC JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1DB PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x1075 JUMP JUMPDEST PUSH1 0x5 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 PUSH1 0x2 PUSH1 0x1 DUP6 AND ISZERO PUSH2 0x100 MUL PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 SWAP5 AND SWAP4 SWAP1 SWAP4 DIV PUSH1 0x1F DUP2 ADD DUP5 SWAP1 DIV DUP5 MUL DUP3 ADD DUP5 ADD SWAP1 SWAP3 MSTORE DUP2 DUP2 MSTORE SWAP3 SWAP2 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0x4C2 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x497 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x4C2 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x4A5 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP DUP2 JUMP JUMPDEST PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x4FD DUP3 PUSH2 0xB50 JUMP JUMPDEST SWAP1 POP CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND EQ DUP1 PUSH2 0x528 JUMPI POP PUSH2 0x528 DUP2 CALLER PUSH2 0x103A JUMP JUMPDEST ISZERO ISZERO PUSH2 0x595 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x15 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F494E56414C49445F53454E4445520000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x0 DUP3 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 DUP2 AND SWAP2 DUP3 OR SWAP1 SWAP3 SSTORE SWAP2 MLOAD DUP6 SWAP4 SWAP2 DUP6 AND SWAP2 PUSH32 0x8C5BE1E5EBEC7D5BD14F71427D1E84F3DD0314C0F7B2291E5B200AC8C7C3B925 SWAP2 LOG4 POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP6 AND ISZERO ISZERO PUSH2 0x69E JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x16 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F5A45524F5F544F5F4144445245535300000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH2 0x6A7 DUP5 PUSH2 0xB50 JUMP JUMPDEST SWAP3 POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP7 DUP2 AND SWAP1 DUP5 AND EQ PUSH2 0x730 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x15 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F4F574E45525F4D49534D415443480000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST CALLER SWAP2 POP PUSH2 0x73C DUP5 PUSH2 0x4CA JUMP JUMPDEST SWAP1 POP DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ DUP1 PUSH2 0x77D JUMPI POP PUSH2 0x77D DUP4 DUP4 PUSH2 0x103A JUMP JUMPDEST DUP1 PUSH2 0x7B3 JUMPI POP DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ JUMPDEST ISZERO ISZERO PUSH2 0x820 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x16 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F494E56414C49445F5350454E44455200000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND ISZERO PUSH2 0x871 JUMPI PUSH1 0x0 DUP5 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND SWAP1 SSTORE JUMPDEST PUSH1 0x0 DUP5 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 DUP2 DUP2 MSTORE PUSH1 0x40 DUP1 DUP5 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP12 DUP2 AND SWAP2 SWAP1 SWAP2 OR SWAP1 SWAP2 SSTORE DUP11 AND DUP5 MSTORE PUSH1 0x3 SWAP1 SWAP2 MSTORE SWAP1 SWAP2 KECCAK256 SLOAD PUSH2 0x8DB SWAP2 PUSH2 0x115B JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP9 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x3 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 SWAP4 SWAP1 SWAP4 SSTORE SWAP1 DUP8 AND DUP2 MSTORE KECCAK256 SLOAD PUSH2 0x918 SWAP1 PUSH1 0x1 PUSH2 0x11D2 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP8 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x3 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 SWAP5 SWAP1 SWAP5 SSTORE SWAP3 MLOAD DUP8 SWAP4 SWAP2 SWAP3 DUP11 AND SWAP2 PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF SWAP2 LOG4 POP POP POP POP POP POP JUMP JUMPDEST PUSH2 0x981 DUP3 DUP3 PUSH2 0x124D JUMP JUMPDEST POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x993 DUP6 DUP6 DUP6 PUSH2 0x616 JUMP JUMPDEST DUP4 EXTCODESIZE SWAP2 POP PUSH1 0x0 DUP3 GT ISZERO PUSH2 0xB49 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x150B7A0200000000000000000000000000000000000000000000000000000000 DUP2 MSTORE CALLER PUSH1 0x4 DUP3 ADD MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 DUP2 AND PUSH1 0x24 DUP4 ADD MSTORE PUSH1 0x44 DUP3 ADD DUP7 SWAP1 MSTORE PUSH1 0x80 PUSH1 0x64 DUP4 ADD MSTORE PUSH1 0x0 PUSH1 0x84 DUP4 ADD DUP2 SWAP1 MSTORE SWAP3 MLOAD SWAP1 DUP8 AND SWAP3 PUSH4 0x150B7A02 SWAP3 PUSH1 0xC4 DUP1 DUP3 ADD SWAP4 PUSH1 0x20 SWAP4 SWAP1 SWAP3 DUP4 SWAP1 SUB SWAP1 SWAP2 ADD SWAP1 DUP3 SWAP1 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0xA30 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0xA44 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x20 DUP2 LT ISZERO PUSH2 0xA5A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP MLOAD PUSH1 0x40 DUP1 MLOAD PUSH32 0x6F6E455243373231526563656976656428616464726573732C61646472657373 DUP2 MSTORE PUSH32 0x2C75696E743235362C6279746573290000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x2F ADD SWAP1 KECCAK256 SWAP1 SWAP2 POP PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 DUP1 DUP4 AND SWAP2 AND EQ PUSH2 0xB49 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x17 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F494E56414C49445F53454C4543544F52000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 DUP2 KECCAK256 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP1 ISZERO ISZERO PUSH2 0xBE3 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x11 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F5A45524F5F4F574E4552000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND ISZERO ISZERO PUSH2 0xC6F JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x11 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F5A45524F5F4F574E4552000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x3 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x6 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 PUSH1 0x2 PUSH1 0x1 DUP6 AND ISZERO PUSH2 0x100 MUL PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 SWAP5 AND SWAP4 SWAP1 SWAP4 DIV PUSH1 0x1F DUP2 ADD DUP5 SWAP1 DIV DUP5 MUL DUP3 ADD DUP5 ADD SWAP1 SWAP3 MSTORE DUP2 DUP2 MSTORE SWAP3 SWAP2 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0x4C2 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x497 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x4C2 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0xDB3 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH2 0x981 DUP3 DUP3 PUSH2 0x1425 JUMP JUMPDEST CALLER PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x4 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 AND DUP1 DUP6 MSTORE SWAP1 DUP4 MSTORE SWAP3 DUP2 SWAP1 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND DUP7 ISZERO ISZERO SWAP1 DUP2 OR SWAP1 SWAP2 SSTORE DUP2 MLOAD SWAP1 DUP2 MSTORE SWAP1 MLOAD SWAP3 SWAP4 SWAP3 PUSH32 0x17307EAB39AB6107E8899845AD3D59BD9653F200F220920489CA2B5937696C31 SWAP3 SWAP2 DUP2 SWAP1 SUB SWAP1 SWAP2 ADD SWAP1 LOG3 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0xE64 DUP8 DUP8 DUP8 PUSH2 0x616 JUMP JUMPDEST DUP6 EXTCODESIZE SWAP2 POP PUSH1 0x0 DUP3 GT ISZERO PUSH2 0x1031 JUMPI PUSH1 0x40 MLOAD PUSH32 0x150B7A0200000000000000000000000000000000000000000000000000000000 DUP2 MSTORE CALLER PUSH1 0x4 DUP3 ADD DUP2 DUP2 MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP11 DUP2 AND PUSH1 0x24 DUP6 ADD MSTORE PUSH1 0x44 DUP5 ADD DUP10 SWAP1 MSTORE PUSH1 0x80 PUSH1 0x64 DUP6 ADD SWAP1 DUP2 MSTORE PUSH1 0x84 DUP6 ADD DUP9 SWAP1 MSTORE SWAP1 DUP11 AND SWAP4 PUSH4 0x150B7A02 SWAP4 SWAP3 DUP13 SWAP3 DUP12 SWAP3 DUP12 SWAP3 DUP12 SWAP3 SWAP1 SWAP2 PUSH1 0xA4 ADD DUP5 DUP5 DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP SWAP7 POP POP POP POP POP POP POP PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0xF18 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0xF2C JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x20 DUP2 LT ISZERO PUSH2 0xF42 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP MLOAD PUSH1 0x40 DUP1 MLOAD PUSH32 0x6F6E455243373231526563656976656428616464726573732C61646472657373 DUP2 MSTORE PUSH32 0x2C75696E743235362C6279746573290000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x2F ADD SWAP1 KECCAK256 SWAP1 SWAP2 POP PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 DUP1 DUP4 AND SWAP2 AND EQ PUSH2 0x1031 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x17 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F494E56414C49445F53454C4543544F52000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP POP POP POP POP POP POP JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP2 DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x4 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 SWAP4 SWAP1 SWAP5 AND DUP3 MSTORE SWAP2 SWAP1 SWAP2 MSTORE KECCAK256 SLOAD PUSH1 0xFF AND SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0x10FB JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND ISZERO PUSH2 0x1158 JUMPI PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND OR SWAP1 SSTORE JUMPDEST POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 GT ISZERO PUSH2 0x11CC JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x11 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x55494E543235365F554E444552464C4F57000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP SWAP1 SUB SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 ADD DUP4 DUP2 LT ISZERO PUSH2 0x1246 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x10 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x55494E543235365F4F564552464C4F5700000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND ISZERO ISZERO PUSH2 0x12D3 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x16 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F5A45524F5F544F5F4144445245535300000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP1 ISZERO PUSH2 0x1366 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x1B PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F4F574E45525F414C52454144595F4558495354530000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x0 DUP3 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 DUP2 DUP2 MSTORE PUSH1 0x40 DUP1 DUP5 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP10 AND SWAP1 DUP2 OR SWAP1 SWAP2 SSTORE DUP5 MSTORE PUSH1 0x3 SWAP1 SWAP2 MSTORE SWAP1 SWAP2 KECCAK256 SLOAD PUSH2 0x13CC SWAP2 PUSH2 0x11D2 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x3 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 SWAP4 SWAP1 SWAP4 SSTORE SWAP2 MLOAD DUP5 SWAP3 SWAP1 PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF SWAP1 DUP3 SWAP1 LOG4 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND ISZERO ISZERO PUSH2 0x14AB JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x19 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F5A45524F5F4F574E45525F4144445245535300000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 DUP2 AND SWAP1 DUP4 AND DUP2 EQ PUSH2 0x1543 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x15 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F4F574E45525F4D49534D415443480000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x0 DUP3 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 DUP2 DUP2 MSTORE PUSH1 0x40 DUP1 DUP5 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND SWAP1 SSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 AND DUP5 MSTORE PUSH1 0x3 SWAP1 SWAP2 MSTORE SWAP1 SWAP2 KECCAK256 SLOAD PUSH2 0x15A5 SWAP2 PUSH2 0x115B JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x3 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 SWAP4 SWAP1 SWAP4 SSTORE SWAP2 MLOAD DUP5 SWAP3 SWAP2 SWAP1 PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF SWAP1 DUP4 SWAP1 LOG4 POP POP POP JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 0xb4 CREATE 0xe9 SWAP3 RETURNDATASIZE 0xf6 DUP2 0xb3 SWAP13 PUSH22 0xC35907B3B53E3D18D5D27A56215BE103C035936A9E0 STOP 0x29 ",
- "sourceMap": "743:1013:51:-;;;866:139;8:9:-1;5:2;;;30:1;27;20:12;5:2;866:139:51;;;;;;;;;;;;;;;;;;;;;162:5:63;:18;;-1:-1:-1;;;;;;162:18:63;170:10;162:18;;;866:139:51;;;960:12;;866:139;;;;;;;960:12;;:4;;:12;;;;;:::i;:::-;-1:-1:-1;982:16:51;;;;:6;;:16;;;;;:::i;:::-;;866:139;;743:1013;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;743:1013:51;;;-1:-1:-1;743:1013:51;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;"
- },
- "deployedBytecode": {
- "linkReferences": {},
- "object": "0x6080604052600436106100da5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100df578063081812fc14610169578063095ea7b3146101aa57806323b872dd146101dd57806340c10f191461021457806342842e0e146102455780636352211e1461027c57806370a08231146102945780638da5cb5b146102d457806395d89b41146102e95780639dc29fac146102fe578063a22cb4651461032f578063b88d4fde14610362578063e985e9c5146103a8578063f2fde38b146103f0575b600080fd5b3480156100eb57600080fd5b506100f461041e565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561012e578181015183820152602001610116565b50505050905090810190601f16801561015b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561017557600080fd5b506101816004356104ca565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b3480156101b657600080fd5b506101db73ffffffffffffffffffffffffffffffffffffffff600435166024356104f2565b005b3480156101e957600080fd5b506101db73ffffffffffffffffffffffffffffffffffffffff60043581169060243516604435610616565b34801561022057600080fd5b506101db73ffffffffffffffffffffffffffffffffffffffff60043516602435610977565b34801561025157600080fd5b506101db73ffffffffffffffffffffffffffffffffffffffff60043581169060243516604435610985565b34801561028857600080fd5b50610181600435610b50565b3480156102a057600080fd5b506102c273ffffffffffffffffffffffffffffffffffffffff60043516610be9565b60408051918252519081900360200190f35b3480156102e057600080fd5b50610181610c98565b3480156102f557600080fd5b506100f4610cb4565b34801561030a57600080fd5b506101db73ffffffffffffffffffffffffffffffffffffffff60043516602435610d2d565b34801561033b57600080fd5b506101db73ffffffffffffffffffffffffffffffffffffffff600435166024351515610dbd565b34801561036e57600080fd5b506101db73ffffffffffffffffffffffffffffffffffffffff60048035821691602480359091169160443591606435908101910135610e56565b3480156103b457600080fd5b506103dc73ffffffffffffffffffffffffffffffffffffffff6004358116906024351661103a565b604080519115158252519081900360200190f35b3480156103fc57600080fd5b506101db73ffffffffffffffffffffffffffffffffffffffff60043516611075565b6005805460408051602060026001851615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f810184900484028201840190925281815292918301828280156104c25780601f10610497576101008083540402835291602001916104c2565b820191906000526020600020905b8154815290600101906020018083116104a557829003601f168201915b505050505081565b60009081526002602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b60006104fd82610b50565b90503373ffffffffffffffffffffffffffffffffffffffff821614806105285750610528813361103a565b151561059557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4552433732315f494e56414c49445f53454e4445520000000000000000000000604482015290519081900360640190fd5b60008281526002602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff87811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6000808073ffffffffffffffffffffffffffffffffffffffff8516151561069e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4552433732315f5a45524f5f544f5f4144445245535300000000000000000000604482015290519081900360640190fd5b6106a784610b50565b925073ffffffffffffffffffffffffffffffffffffffff8681169084161461073057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4552433732315f4f574e45525f4d49534d415443480000000000000000000000604482015290519081900360640190fd5b33915061073c846104ca565b90508273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148061077d575061077d838361103a565b806107b357508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b151561082057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4552433732315f494e56414c49445f5350454e44455200000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff81161561087157600084815260026020526040902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001690555b600084815260016020818152604080842080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8b8116919091179091558a1684526003909152909120546108db9161115b565b73ffffffffffffffffffffffffffffffffffffffff80881660009081526003602052604080822093909355908716815220546109189060016111d2565b73ffffffffffffffffffffffffffffffffffffffff808716600081815260036020526040808220949094559251879391928a16917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050505050565b610981828261124d565b5050565b600080610993858585610616565b833b91506000821115610b4957604080517f150b7a0200000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff8781166024830152604482018690526080606483015260006084830181905292519087169263150b7a029260c480820193602093909283900390910190829087803b158015610a3057600080fd5b505af1158015610a44573d6000803e3d6000fd5b505050506040513d6020811015610a5a57600080fd5b5051604080517f6f6e455243373231526563656976656428616464726573732c6164647265737381527f2c75696e743235362c62797465732900000000000000000000000000000000006020820152905190819003602f0190209091507fffffffff00000000000000000000000000000000000000000000000000000000808316911614610b4957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4552433732315f494e56414c49445f53454c4543544f52000000000000000000604482015290519081900360640190fd5b5050505050565b60008181526001602052604081205473ffffffffffffffffffffffffffffffffffffffff16801515610be357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f4552433732315f5a45524f5f4f574e4552000000000000000000000000000000604482015290519081900360640190fd5b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82161515610c6f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f4552433732315f5a45524f5f4f574e4552000000000000000000000000000000604482015290519081900360640190fd5b5073ffffffffffffffffffffffffffffffffffffffff1660009081526003602052604090205490565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b6006805460408051602060026001851615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f810184900484028201840190925281815292918301828280156104c25780601f10610497576101008083540402835291602001916104c2565b60005473ffffffffffffffffffffffffffffffffffffffff163314610db357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b6109818282611425565b33600081815260046020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168085529083529281902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016861515908117909155815190815290519293927f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31929181900390910190a35050565b600080610e64878787610616565b853b91506000821115611031576040517f150b7a02000000000000000000000000000000000000000000000000000000008152336004820181815273ffffffffffffffffffffffffffffffffffffffff8a811660248501526044840189905260806064850190815260848501889052908a169363150b7a0293928c928b928b928b92909160a40184848082843782019150509650505050505050602060405180830381600087803b158015610f1857600080fd5b505af1158015610f2c573d6000803e3d6000fd5b505050506040513d6020811015610f4257600080fd5b5051604080517f6f6e455243373231526563656976656428616464726573732c6164647265737381527f2c75696e743235362c62797465732900000000000000000000000000000000006020820152905190819003602f0190209091507fffffffff0000000000000000000000000000000000000000000000000000000080831691161461103157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4552433732315f494e56414c49445f53454c4543544f52000000000000000000604482015290519081900360640190fd5b50505050505050565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260046020908152604080832093909416825291909152205460ff1690565b60005473ffffffffffffffffffffffffffffffffffffffff1633146110fb57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff81161561115857600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83161790555b50565b6000828211156111cc57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f55494e543235365f554e444552464c4f57000000000000000000000000000000604482015290519081900360640190fd5b50900390565b60008282018381101561124657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f55494e543235365f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b9392505050565b600073ffffffffffffffffffffffffffffffffffffffff831615156112d357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4552433732315f5a45524f5f544f5f4144445245535300000000000000000000604482015290519081900360640190fd5b5060008181526001602052604090205473ffffffffffffffffffffffffffffffffffffffff16801561136657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f4552433732315f4f574e45525f414c52454144595f4558495354530000000000604482015290519081900360640190fd5b600082815260016020818152604080842080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff891690811790915584526003909152909120546113cc916111d2565b73ffffffffffffffffffffffffffffffffffffffff84166000818152600360205260408082209390935591518492907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4505050565b600073ffffffffffffffffffffffffffffffffffffffff831615156114ab57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4552433732315f5a45524f5f4f574e45525f4144445245535300000000000000604482015290519081900360640190fd5b5060008181526001602052604090205473ffffffffffffffffffffffffffffffffffffffff908116908316811461154357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4552433732315f4f574e45525f4d49534d415443480000000000000000000000604482015290519081900360640190fd5b600082815260016020818152604080842080547fffffffffffffffffffffffff000000000000000000000000000000000000000016905573ffffffffffffffffffffffffffffffffffffffff871684526003909152909120546115a59161115b565b73ffffffffffffffffffffffffffffffffffffffff8416600081815260036020526040808220939093559151849291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050505600a165627a7a72305820b4f0e9923df681b39c750c35907b3b53e3d18d5d27a56215be103c035936a9e00029",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0xDA JUMPI PUSH4 0xFFFFFFFF PUSH29 0x100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD DIV AND PUSH4 0x6FDDE03 DUP2 EQ PUSH2 0xDF JUMPI DUP1 PUSH4 0x81812FC EQ PUSH2 0x169 JUMPI DUP1 PUSH4 0x95EA7B3 EQ PUSH2 0x1AA JUMPI DUP1 PUSH4 0x23B872DD EQ PUSH2 0x1DD JUMPI DUP1 PUSH4 0x40C10F19 EQ PUSH2 0x214 JUMPI DUP1 PUSH4 0x42842E0E EQ PUSH2 0x245 JUMPI DUP1 PUSH4 0x6352211E EQ PUSH2 0x27C JUMPI DUP1 PUSH4 0x70A08231 EQ PUSH2 0x294 JUMPI DUP1 PUSH4 0x8DA5CB5B EQ PUSH2 0x2D4 JUMPI DUP1 PUSH4 0x95D89B41 EQ PUSH2 0x2E9 JUMPI DUP1 PUSH4 0x9DC29FAC EQ PUSH2 0x2FE JUMPI DUP1 PUSH4 0xA22CB465 EQ PUSH2 0x32F JUMPI DUP1 PUSH4 0xB88D4FDE EQ PUSH2 0x362 JUMPI DUP1 PUSH4 0xE985E9C5 EQ PUSH2 0x3A8 JUMPI DUP1 PUSH4 0xF2FDE38B EQ PUSH2 0x3F0 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xEB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xF4 PUSH2 0x41E JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 DUP1 DUP3 MSTORE DUP4 MLOAD DUP2 DUP4 ADD MSTORE DUP4 MLOAD SWAP2 SWAP3 DUP4 SWAP3 SWAP1 DUP4 ADD SWAP2 DUP6 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x12E JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH2 0x116 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x15B JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x175 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x181 PUSH1 0x4 CALLDATALOAD PUSH2 0x4CA JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1B6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1DB PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x4F2 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1E9 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1DB PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH1 0x44 CALLDATALOAD PUSH2 0x616 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x220 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1DB PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x977 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x251 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1DB PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH1 0x44 CALLDATALOAD PUSH2 0x985 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x288 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x181 PUSH1 0x4 CALLDATALOAD PUSH2 0xB50 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2A0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2C2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0xBE9 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2E0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x181 PUSH2 0xC98 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2F5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xF4 PUSH2 0xCB4 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x30A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1DB PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0xD2D JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x33B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1DB PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD ISZERO ISZERO PUSH2 0xDBD JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x36E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1DB PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 DUP1 CALLDATALOAD DUP3 AND SWAP2 PUSH1 0x24 DUP1 CALLDATALOAD SWAP1 SWAP2 AND SWAP2 PUSH1 0x44 CALLDATALOAD SWAP2 PUSH1 0x64 CALLDATALOAD SWAP1 DUP2 ADD SWAP2 ADD CALLDATALOAD PUSH2 0xE56 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3B4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x3DC PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH2 0x103A JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 ISZERO ISZERO DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3FC JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1DB PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x1075 JUMP JUMPDEST PUSH1 0x5 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 PUSH1 0x2 PUSH1 0x1 DUP6 AND ISZERO PUSH2 0x100 MUL PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 SWAP5 AND SWAP4 SWAP1 SWAP4 DIV PUSH1 0x1F DUP2 ADD DUP5 SWAP1 DIV DUP5 MUL DUP3 ADD DUP5 ADD SWAP1 SWAP3 MSTORE DUP2 DUP2 MSTORE SWAP3 SWAP2 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0x4C2 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x497 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x4C2 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x4A5 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP DUP2 JUMP JUMPDEST PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x4FD DUP3 PUSH2 0xB50 JUMP JUMPDEST SWAP1 POP CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND EQ DUP1 PUSH2 0x528 JUMPI POP PUSH2 0x528 DUP2 CALLER PUSH2 0x103A JUMP JUMPDEST ISZERO ISZERO PUSH2 0x595 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x15 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F494E56414C49445F53454E4445520000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x0 DUP3 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 DUP2 AND SWAP2 DUP3 OR SWAP1 SWAP3 SSTORE SWAP2 MLOAD DUP6 SWAP4 SWAP2 DUP6 AND SWAP2 PUSH32 0x8C5BE1E5EBEC7D5BD14F71427D1E84F3DD0314C0F7B2291E5B200AC8C7C3B925 SWAP2 LOG4 POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP6 AND ISZERO ISZERO PUSH2 0x69E JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x16 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F5A45524F5F544F5F4144445245535300000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH2 0x6A7 DUP5 PUSH2 0xB50 JUMP JUMPDEST SWAP3 POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP7 DUP2 AND SWAP1 DUP5 AND EQ PUSH2 0x730 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x15 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F4F574E45525F4D49534D415443480000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST CALLER SWAP2 POP PUSH2 0x73C DUP5 PUSH2 0x4CA JUMP JUMPDEST SWAP1 POP DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ DUP1 PUSH2 0x77D JUMPI POP PUSH2 0x77D DUP4 DUP4 PUSH2 0x103A JUMP JUMPDEST DUP1 PUSH2 0x7B3 JUMPI POP DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ JUMPDEST ISZERO ISZERO PUSH2 0x820 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x16 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F494E56414C49445F5350454E44455200000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND ISZERO PUSH2 0x871 JUMPI PUSH1 0x0 DUP5 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND SWAP1 SSTORE JUMPDEST PUSH1 0x0 DUP5 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 DUP2 DUP2 MSTORE PUSH1 0x40 DUP1 DUP5 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP12 DUP2 AND SWAP2 SWAP1 SWAP2 OR SWAP1 SWAP2 SSTORE DUP11 AND DUP5 MSTORE PUSH1 0x3 SWAP1 SWAP2 MSTORE SWAP1 SWAP2 KECCAK256 SLOAD PUSH2 0x8DB SWAP2 PUSH2 0x115B JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP9 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x3 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 SWAP4 SWAP1 SWAP4 SSTORE SWAP1 DUP8 AND DUP2 MSTORE KECCAK256 SLOAD PUSH2 0x918 SWAP1 PUSH1 0x1 PUSH2 0x11D2 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP8 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x3 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 SWAP5 SWAP1 SWAP5 SSTORE SWAP3 MLOAD DUP8 SWAP4 SWAP2 SWAP3 DUP11 AND SWAP2 PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF SWAP2 LOG4 POP POP POP POP POP POP JUMP JUMPDEST PUSH2 0x981 DUP3 DUP3 PUSH2 0x124D JUMP JUMPDEST POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x993 DUP6 DUP6 DUP6 PUSH2 0x616 JUMP JUMPDEST DUP4 EXTCODESIZE SWAP2 POP PUSH1 0x0 DUP3 GT ISZERO PUSH2 0xB49 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x150B7A0200000000000000000000000000000000000000000000000000000000 DUP2 MSTORE CALLER PUSH1 0x4 DUP3 ADD MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 DUP2 AND PUSH1 0x24 DUP4 ADD MSTORE PUSH1 0x44 DUP3 ADD DUP7 SWAP1 MSTORE PUSH1 0x80 PUSH1 0x64 DUP4 ADD MSTORE PUSH1 0x0 PUSH1 0x84 DUP4 ADD DUP2 SWAP1 MSTORE SWAP3 MLOAD SWAP1 DUP8 AND SWAP3 PUSH4 0x150B7A02 SWAP3 PUSH1 0xC4 DUP1 DUP3 ADD SWAP4 PUSH1 0x20 SWAP4 SWAP1 SWAP3 DUP4 SWAP1 SUB SWAP1 SWAP2 ADD SWAP1 DUP3 SWAP1 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0xA30 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0xA44 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x20 DUP2 LT ISZERO PUSH2 0xA5A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP MLOAD PUSH1 0x40 DUP1 MLOAD PUSH32 0x6F6E455243373231526563656976656428616464726573732C61646472657373 DUP2 MSTORE PUSH32 0x2C75696E743235362C6279746573290000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x2F ADD SWAP1 KECCAK256 SWAP1 SWAP2 POP PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 DUP1 DUP4 AND SWAP2 AND EQ PUSH2 0xB49 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x17 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F494E56414C49445F53454C4543544F52000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 DUP2 KECCAK256 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP1 ISZERO ISZERO PUSH2 0xBE3 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x11 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F5A45524F5F4F574E4552000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND ISZERO ISZERO PUSH2 0xC6F JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x11 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F5A45524F5F4F574E4552000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x3 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x6 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 PUSH1 0x2 PUSH1 0x1 DUP6 AND ISZERO PUSH2 0x100 MUL PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 SWAP5 AND SWAP4 SWAP1 SWAP4 DIV PUSH1 0x1F DUP2 ADD DUP5 SWAP1 DIV DUP5 MUL DUP3 ADD DUP5 ADD SWAP1 SWAP3 MSTORE DUP2 DUP2 MSTORE SWAP3 SWAP2 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0x4C2 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x497 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x4C2 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0xDB3 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH2 0x981 DUP3 DUP3 PUSH2 0x1425 JUMP JUMPDEST CALLER PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x4 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 AND DUP1 DUP6 MSTORE SWAP1 DUP4 MSTORE SWAP3 DUP2 SWAP1 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND DUP7 ISZERO ISZERO SWAP1 DUP2 OR SWAP1 SWAP2 SSTORE DUP2 MLOAD SWAP1 DUP2 MSTORE SWAP1 MLOAD SWAP3 SWAP4 SWAP3 PUSH32 0x17307EAB39AB6107E8899845AD3D59BD9653F200F220920489CA2B5937696C31 SWAP3 SWAP2 DUP2 SWAP1 SUB SWAP1 SWAP2 ADD SWAP1 LOG3 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0xE64 DUP8 DUP8 DUP8 PUSH2 0x616 JUMP JUMPDEST DUP6 EXTCODESIZE SWAP2 POP PUSH1 0x0 DUP3 GT ISZERO PUSH2 0x1031 JUMPI PUSH1 0x40 MLOAD PUSH32 0x150B7A0200000000000000000000000000000000000000000000000000000000 DUP2 MSTORE CALLER PUSH1 0x4 DUP3 ADD DUP2 DUP2 MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP11 DUP2 AND PUSH1 0x24 DUP6 ADD MSTORE PUSH1 0x44 DUP5 ADD DUP10 SWAP1 MSTORE PUSH1 0x80 PUSH1 0x64 DUP6 ADD SWAP1 DUP2 MSTORE PUSH1 0x84 DUP6 ADD DUP9 SWAP1 MSTORE SWAP1 DUP11 AND SWAP4 PUSH4 0x150B7A02 SWAP4 SWAP3 DUP13 SWAP3 DUP12 SWAP3 DUP12 SWAP3 DUP12 SWAP3 SWAP1 SWAP2 PUSH1 0xA4 ADD DUP5 DUP5 DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP SWAP7 POP POP POP POP POP POP POP PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0xF18 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0xF2C JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x20 DUP2 LT ISZERO PUSH2 0xF42 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP MLOAD PUSH1 0x40 DUP1 MLOAD PUSH32 0x6F6E455243373231526563656976656428616464726573732C61646472657373 DUP2 MSTORE PUSH32 0x2C75696E743235362C6279746573290000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x2F ADD SWAP1 KECCAK256 SWAP1 SWAP2 POP PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 DUP1 DUP4 AND SWAP2 AND EQ PUSH2 0x1031 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x17 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F494E56414C49445F53454C4543544F52000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP POP POP POP POP POP POP JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP2 DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x4 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 SWAP4 SWAP1 SWAP5 AND DUP3 MSTORE SWAP2 SWAP1 SWAP2 MSTORE KECCAK256 SLOAD PUSH1 0xFF AND SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0x10FB JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND ISZERO PUSH2 0x1158 JUMPI PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND OR SWAP1 SSTORE JUMPDEST POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 GT ISZERO PUSH2 0x11CC JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x11 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x55494E543235365F554E444552464C4F57000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP SWAP1 SUB SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 ADD DUP4 DUP2 LT ISZERO PUSH2 0x1246 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x10 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x55494E543235365F4F564552464C4F5700000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND ISZERO ISZERO PUSH2 0x12D3 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x16 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F5A45524F5F544F5F4144445245535300000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP1 ISZERO PUSH2 0x1366 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x1B PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F4F574E45525F414C52454144595F4558495354530000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x0 DUP3 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 DUP2 DUP2 MSTORE PUSH1 0x40 DUP1 DUP5 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP10 AND SWAP1 DUP2 OR SWAP1 SWAP2 SSTORE DUP5 MSTORE PUSH1 0x3 SWAP1 SWAP2 MSTORE SWAP1 SWAP2 KECCAK256 SLOAD PUSH2 0x13CC SWAP2 PUSH2 0x11D2 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x3 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 SWAP4 SWAP1 SWAP4 SSTORE SWAP2 MLOAD DUP5 SWAP3 SWAP1 PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF SWAP1 DUP3 SWAP1 LOG4 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND ISZERO ISZERO PUSH2 0x14AB JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x19 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F5A45524F5F4F574E45525F4144445245535300000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 DUP2 AND SWAP1 DUP4 AND DUP2 EQ PUSH2 0x1543 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x15 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F4F574E45525F4D49534D415443480000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x0 DUP3 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 DUP2 DUP2 MSTORE PUSH1 0x40 DUP1 DUP5 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND SWAP1 SSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 AND DUP5 MSTORE PUSH1 0x3 SWAP1 SWAP2 MSTORE SWAP1 SWAP2 KECCAK256 SLOAD PUSH2 0x15A5 SWAP2 PUSH2 0x115B JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x3 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 SWAP4 SWAP1 SWAP4 SSTORE SWAP2 MLOAD DUP5 SWAP3 SWAP2 SWAP1 PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF SWAP1 DUP4 SWAP1 LOG4 POP POP POP JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 0xb4 CREATE 0xe9 SWAP3 RETURNDATASIZE 0xf6 DUP2 0xb3 SWAP13 PUSH22 0xC35907B3B53E3D18D5D27A56215BE103C035936A9E0 STOP 0x29 ",
- "sourceMap": "743:1013:51:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;815:18;;8:9:-1;5:2;;;30:1;27;20:12;5:2;815:18:51;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:100:-1;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;815:18:51;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8388:140:56;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;8388:140:56;;;;;;;;;;;;;;;;;;;;;;;;4378:400;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;4378:400:56;;;;;;;;;;;6624:974;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;6624:974:56;;;;;;;;;;;;;;1263:103:51;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1263:103:51;;;;;;;;;3326:682:56;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;3326:682:56;;;;;;;;;;;;;;7860:257;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;7860:257:56;;;;;5783:229;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;5783:229:56;;;;;;;;;;;;;;;;;;;;;;;91:20:63;;8:9:-1;5:2;;;30:1;27;20:12;5:2;91:20:63;;;;839::51;;8:9:-1;5:2;;;30:1;27;20:12;5:2;839:20:51;;;;1627:127;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1627:127:51;;;;;;;;;5184:261:56;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;5184:261:56;;;;;;;;;;;2257:706;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2257:706:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;8829:176;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;8829:176:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;333:167:63;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;333:167:63;;;;;;;815:18:51;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;8388:140:56:-;8472:7;8502:19;;;:9;:19;;;;;;;;;8388:140::o;4378:400::-;4463:13;4479:17;4487:8;4479:7;:17::i;:::-;4463:33;-1:-1:-1;4527:10:56;:19;;;;;:58;;;4550:35;4567:5;4574:10;4550:16;:35::i;:::-;4506:126;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4643:19;;;;:9;:19;;;;;;:31;;;;;;;;;;;;;;4689:82;;4643:19;;4689:82;;;;;;;4378:400;;;:::o;6624:974::-;6848:13;;;6772:17;;;;;6751:86;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6864:17;6872:8;6864:7;:17::i;:::-;6848:33;-1:-1:-1;6912:14:56;;;;;;;;6891:82;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7002:10;6984:28;;7048:21;7060:8;7048:11;:21::i;:::-;7022:47;;7111:5;7100:16;;:7;:16;;;:64;;;;7132:32;7149:5;7156:7;7132:16;:32::i;:::-;7100:106;;;;7199:7;7180:26;;:15;:26;;;7100:106;7079:175;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7269:29;;;;7265:92;;7344:1;7314:19;;;:9;:19;;;;;:32;;;;;;7265:92;7367:16;;;;:6;:16;;;;;;;;:22;;;;;;;;;;;;;;;7425:15;;;;:8;:15;;;;;;;7417:27;;:7;:27::i;:::-;7399:15;;;;;;;;:8;:15;;;;;;:45;;;;7478:13;;;;;;;7470:25;;7493:1;7470:7;:25::i;:::-;7454:13;;;;;;;;:8;:13;;;;;;:41;;;;7515:76;;7573:8;;7454:13;;7515:76;;;;;;6624:974;;;;;;:::o;1263:103:51:-;1339:20;1345:3;1350:8;1339:5;:20::i;:::-;1263:103;;:::o;3326:682:56:-;3550:24;3702:15;3459:80;3485:5;3504:3;3521:8;3459:12;:80::i;:::-;3639:3;3627:16;3607:36;;3685:1;3666:16;:20;3662:340;;;3720:148;;;;;;3775:10;3720:148;;;;:37;:148;;;;;;;;;;;;;;;;;;-1:-1:-1;3720:148:56;;;;;;;;:37;;;;;;:148;;;;;;;;;;;;;;;;;;:37;:148;;;5:2:-1;;;;30:1;27;20:12;5:2;3720:148:56;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3720:148:56;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3720:148:56;902:60;;;;;;;3720:148;902:60;;;;;;;;;;;;;3720:148;;-1:-1:-1;3907:27:56;;;;;;;3882:109;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3326:682;;;;;:::o;7860:257::-;7940:7;7979:16;;;:6;:16;;;;;;;;8026:19;;;8005:83;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8105:5;7860:257;-1:-1:-1;;7860:257:56:o;5783:229::-;5865:7;5909:20;;;;;5888:84;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;5989:16:56;;;;;;:8;:16;;;;;;;5783:229::o;91:20:63:-;;;;;;:::o;839::51:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1627:127;259:5:63;;;;245:10;:19;224:85;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1724:23:51;1730:6;1738:8;1724:5;:23::i;5184:261:56:-;5295:10;5277:29;;;;:17;:29;;;;;;;;;:40;;;;;;;;;;;;:52;;;;;;;;;;;;;5344:94;;;;;;;5277:40;;5295:10;5344:94;;;;;;;;;;;5184:261;;:::o;2257:706::-;2502:24;2654:15;2411:80;2437:5;2456:3;2473:8;2411:12;:80::i;:::-;2591:3;2579:16;2559:36;;2637:1;2618:16;:20;2614:343;;;2672:151;;;;;2727:10;2672:151;;;;;;:37;:151;;;;;;;;;;;;;;;;;;;;;;;;;;:37;;;;;;2727:10;2755:5;;2778:8;;2804:5;;;;2672:151;;;;2804:5;;;;2672:151;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2672:151:56;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2672:151:56;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2672:151:56;902:60;;;;;;;2672:151;902:60;;;;;;;;;;;;;2672:151;;-1:-1:-1;2862:27:56;;;;;;;2837:109;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2257:706;;;;;;;:::o;8829:176::-;8962:25;;;;8935:4;8962:25;;;:17;:25;;;;;;;;:36;;;;;;;;;;;;;;;8829:176::o;333:167:63:-;259:5;;;;245:10;:19;224:85;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;429:22;;;;425:69;;467:5;:16;;;;;;;;;;425:69;333:167;:::o;502:208:65:-;588:7;632:6;;;;611:70;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;698:5:65;;;502:208::o;716:230::-;802:7;837:5;;;873:6;;;;852:69;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;938:1;716:230;-1:-1:-1;;;716:230:65:o;941:497:59:-;1115:13;1039:17;;;;;1018:86;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1131:16:59;;;;:6;:16;;;;;;;;1178:19;;1157:93;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1261:16;;;;:6;:16;;;;;;;;:22;;;;;;;;;;;;;1317:13;;:8;:13;;;;;;;1309:25;;:7;:25::i;:::-;1293:13;;;;;;;:8;:13;;;;;;:41;;;;1350:81;;1413:8;;1293:13;1350:81;;1293:13;;1350:81;941:497;;;:::o;1667:512::-;1850:13;1768:20;;;;;1747:92;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1866:16:59;;;;:6;:16;;;;;;;;;;;1913:15;;;;1892:83;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2013:1;1986:16;;;:6;:16;;;;;;;;:29;;;;;;;2052:16;;;;:8;:16;;;;;;;2044:28;;:7;:28::i;:::-;2025:16;;;;;;;:8;:16;;;;;;:47;;;;2088:84;;2154:8;;2025:16;;2088:84;;2025:16;;2088:84;1667:512;;;:::o"
- }
- }
- },
- "sources": {
- "2.0.0/extensions/Forwarder/Forwarder.sol": {
- "id": 0
- },
- "2.0.0/extensions/Forwarder/MixinAssets.sol": {
- "id": 1
- },
- "2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol": {
- "id": 2
- },
- "2.0.0/extensions/Forwarder/MixinForwarderCore.sol": {
- "id": 3
- },
- "2.0.0/extensions/Forwarder/MixinWeth.sol": {
- "id": 4
- },
- "2.0.0/extensions/Forwarder/interfaces/IAssets.sol": {
- "id": 5
- },
- "2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol": {
- "id": 6
- },
- "2.0.0/extensions/Forwarder/libs/LibConstants.sol": {
- "id": 7
- },
- "2.0.0/extensions/Forwarder/mixins/MAssets.sol": {
- "id": 8
- },
- "2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol": {
- "id": 9
- },
- "2.0.0/extensions/Forwarder/mixins/MWeth.sol": {
- "id": 10
- },
- "2.0.0/extensions/OrderValidator/OrderValidator.sol": {
- "id": 11
- },
- "2.0.0/multisig/MultiSigWallet.sol": {
- "id": 12
- },
- "2.0.0/multisig/MultiSigWalletWithTimeLock.sol": {
- "id": 13
- },
- "2.0.0/protocol/AssetProxy/ERC20Proxy.sol": {
- "id": 14
- },
- "2.0.0/protocol/AssetProxy/ERC721Proxy.sol": {
- "id": 15
- },
- "2.0.0/protocol/AssetProxy/MixinAuthorizable.sol": {
- "id": 16
- },
- "2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol": {
- "id": 17
- },
- "2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol": {
- "id": 18
- },
- "2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol": {
- "id": 19
- },
- "2.0.0/protocol/AssetProxyOwner/AssetProxyOwner.sol": {
- "id": 20
- },
- "2.0.0/protocol/Exchange/Exchange.sol": {
- "id": 21
- },
- "2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol": {
- "id": 22
- },
- "2.0.0/protocol/Exchange/MixinExchangeCore.sol": {
- "id": 23
- },
- "2.0.0/protocol/Exchange/MixinMatchOrders.sol": {
- "id": 24
- },
- "2.0.0/protocol/Exchange/MixinSignatureValidator.sol": {
- "id": 25
- },
- "2.0.0/protocol/Exchange/MixinTransactions.sol": {
- "id": 26
- },
- "2.0.0/protocol/Exchange/MixinWrapperFunctions.sol": {
- "id": 27
- },
- "2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol": {
- "id": 28
- },
- "2.0.0/protocol/Exchange/interfaces/IExchange.sol": {
- "id": 29
- },
- "2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol": {
- "id": 30
- },
- "2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol": {
- "id": 31
- },
- "2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol": {
- "id": 32
- },
- "2.0.0/protocol/Exchange/interfaces/ITransactions.sol": {
- "id": 33
- },
- "2.0.0/protocol/Exchange/interfaces/IValidator.sol": {
- "id": 34
- },
- "2.0.0/protocol/Exchange/interfaces/IWallet.sol": {
- "id": 35
- },
- "2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol": {
- "id": 36
- },
- "2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol": {
- "id": 37
- },
- "2.0.0/protocol/Exchange/libs/LibConstants.sol": {
- "id": 38
- },
- "2.0.0/protocol/Exchange/libs/LibEIP712.sol": {
- "id": 39
- },
- "2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol": {
- "id": 40
- },
- "2.0.0/protocol/Exchange/libs/LibFillResults.sol": {
- "id": 41
- },
- "2.0.0/protocol/Exchange/libs/LibMath.sol": {
- "id": 42
- },
- "2.0.0/protocol/Exchange/libs/LibOrder.sol": {
- "id": 43
- },
- "2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol": {
- "id": 44
- },
- "2.0.0/protocol/Exchange/mixins/MExchangeCore.sol": {
- "id": 45
- },
- "2.0.0/protocol/Exchange/mixins/MMatchOrders.sol": {
- "id": 46
- },
- "2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol": {
- "id": 47
- },
- "2.0.0/protocol/Exchange/mixins/MTransactions.sol": {
- "id": 48
- },
- "2.0.0/protocol/Exchange/mixins/MWrapperFunctions.sol": {
- "id": 49
- },
- "2.0.0/test/DummyERC20Token/DummyERC20Token.sol": {
- "id": 50
- },
- "2.0.0/test/DummyERC721Token/DummyERC721Token.sol": {
- "id": 51
- },
- "2.0.0/tokens/ERC20Token/ERC20Token.sol": {
- "id": 52
- },
- "2.0.0/tokens/ERC20Token/IERC20Token.sol": {
- "id": 53
- },
- "2.0.0/tokens/ERC20Token/MintableERC20Token.sol": {
- "id": 54
- },
- "2.0.0/tokens/ERC20Token/UnlimitedAllowanceERC20Token.sol": {
- "id": 55
- },
- "2.0.0/tokens/ERC721Token/ERC721Token.sol": {
- "id": 56
- },
- "2.0.0/tokens/ERC721Token/IERC721Receiver.sol": {
- "id": 57
- },
- "2.0.0/tokens/ERC721Token/IERC721Token.sol": {
- "id": 58
- },
- "2.0.0/tokens/ERC721Token/MintableERC721Token.sol": {
- "id": 59
- },
- "2.0.0/tokens/EtherToken/IEtherToken.sol": {
- "id": 60
- },
- "2.0.0/utils/LibBytes/LibBytes.sol": {
- "id": 61
- },
- "2.0.0/utils/Ownable/IOwnable.sol": {
- "id": 62
- },
- "2.0.0/utils/Ownable/Ownable.sol": {
- "id": 63
- },
- "2.0.0/utils/ReentrancyGuard/ReentrancyGuard.sol": {
- "id": 64
- },
- "2.0.0/utils/SafeMath/SafeMath.sol": {
- "id": 65
- }
- },
- "sourceCodes": {
- "2.0.0/extensions/Forwarder/Forwarder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./MixinWeth.sol\";\nimport \"./MixinForwarderCore.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./MixinAssets.sol\";\nimport \"./MixinExchangeWrapper.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract Forwarder is\n LibConstants,\n MixinWeth,\n MixinAssets,\n MixinExchangeWrapper,\n MixinForwarderCore\n{\n constructor (\n address _exchange,\n bytes memory _zrxAssetData,\n bytes memory _wethAssetData\n )\n public\n LibConstants(\n _exchange,\n _zrxAssetData,\n _wethAssetData\n )\n MixinForwarderCore()\n {}\n}\n",
- "2.0.0/extensions/Forwarder/MixinAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"../../tokens/ERC20Token/IERC20Token.sol\";\nimport \"../../tokens/ERC721Token/IERC721Token.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MAssets.sol\";\n\n\ncontract MixinAssets is\n Ownable,\n LibConstants,\n MAssets\n{\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_TRANSFER_SELECTOR = bytes4(keccak256(\"transfer(address,uint256)\"));\n\n /// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to \n /// function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be\n /// used to withdraw assets that were accidentally sent to this contract.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of ERC20 token to withdraw.\n function withdrawAsset(\n bytes assetData,\n uint256 amount\n )\n external\n onlyOwner\n {\n transferAssetToSender(assetData, amount);\n }\n\n /// @dev Transfers given amount of asset to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferAssetToSender(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n bytes4 proxyId = assetData.readBytes4(0);\n\n if (proxyId == ERC20_DATA_ID) {\n transferERC20Token(assetData, amount);\n } else if (proxyId == ERC721_DATA_ID) {\n transferERC721Token(assetData, amount);\n } else {\n revert(\"UNSUPPORTED_ASSET_PROXY\");\n }\n }\n\n /// @dev Decodes ERC20 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC20Token(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n address token = assetData.readAddress(16);\n\n // Transfer tokens.\n // We do a raw call so we can check the success separate\n // from the return data.\n bool success = token.call(abi.encodeWithSelector(\n ERC20_TRANSFER_SELECTOR,\n msg.sender,\n amount\n ));\n require(\n success,\n \"TRANSFER_FAILED\"\n );\n \n // Check return data.\n // If there is no return data, we assume the token incorrectly\n // does not return a bool. In this case we expect it to revert\n // on failure, which was handled above.\n // If the token does return data, we require that it is a single\n // value that evaluates to true.\n assembly {\n if returndatasize {\n success := 0\n if eq(returndatasize, 32) {\n // First 64 bytes of memory are reserved scratch space\n returndatacopy(0, 0, 32)\n success := mload(0)\n }\n }\n }\n require(\n success,\n \"TRANSFER_FAILED\"\n );\n }\n\n /// @dev Decodes ERC721 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC721Token(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n require(\n amount == 1,\n \"INVALID_AMOUNT\"\n );\n // Decode asset data.\n address token = assetData.readAddress(16);\n uint256 tokenId = assetData.readUint256(36);\n\n // Perform transfer.\n IERC721Token(token).transferFrom(\n address(this),\n msg.sender,\n tokenId\n );\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MExchangeWrapper.sol\";\nimport \"../../protocol/Exchange/libs/LibAbiEncoder.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../protocol/Exchange/libs/LibFillResults.sol\";\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\n\n\ncontract MixinExchangeWrapper is\n LibAbiEncoder,\n LibFillResults,\n LibMath,\n LibConstants,\n MExchangeWrapper\n{\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n // ABI encode calldata for `fillOrder`\n bytes memory fillOrderCalldata = abiEncodeFillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n\n address exchange = address(EXCHANGE);\n\n // Call `fillOrder` and handle any exceptions gracefully\n assembly {\n let success := call(\n gas, // forward all gas\n exchange, // call address of Exchange contract\n 0, // transfer 0 wei\n add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes)\n mload(fillOrderCalldata), // length of input\n fillOrderCalldata, // write output over input\n 128 // output size is 128 bytes\n )\n if success {\n mstore(fillResults, mload(fillOrderCalldata))\n mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32)))\n mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64)))\n mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96)))\n }\n }\n // fillResults values will be 0 by default if call was unsuccessful\n return fillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of WETH has been sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param wethSellAmount Desired amount of WETH to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellWeth(\n LibOrder.Order[] memory orders,\n uint256 wethSellAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // We assume that asset being sold by taker is WETH for each order.\n orders[i].makerAssetData = makerAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of WETH to sell\n uint256 remainingTakerAssetFillAmount = safeSub(wethSellAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of WETH\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= wethSellAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// The asset being sold by taker must always be WETH.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyExactAmountWithWeth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // We assume that asset being sold by taker is WETH for each order.\n orders[i].makerAssetData = makerAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n uint256 makerAssetFilledAmount = totalFillResults.makerAssetFilledAmount;\n if (makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n\n require(\n makerAssetFilledAmount >= makerAssetFillAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return totalFillResults;\n }\n\n /// @dev Buys zrxBuyAmount of ZRX fee tokens, taking into account ZRX fees for each order. This will guarantee\n /// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues).\n /// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX\n /// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases.\n /// The asset being sold by taker must always be WETH. \n /// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset.\n /// @param zrxBuyAmount Desired amount of ZRX to buy.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return totalFillResults Amounts filled and fees paid by maker and taker.\n function marketBuyExactZrxWithWeth(\n LibOrder.Order[] memory orders,\n uint256 zrxBuyAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n // Do nothing if zrxBuyAmount == 0\n if (zrxBuyAmount == 0) {\n return totalFillResults;\n }\n\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n uint256 zrxPurchased = 0;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // All of these are ZRX/WETH, so we can drop the respective assetData from calldata.\n orders[i].makerAssetData = zrxAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of ZRX to buy.\n uint256 remainingZrxBuyAmount = safeSub(zrxBuyAmount, zrxPurchased);\n\n // Convert the remaining amount of ZRX to buy into remaining amount\n // of WETH to sell, assuming entire amount can be sold in the current order.\n uint256 remainingWethSellAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n safeSub(orders[i].makerAssetAmount, orders[i].takerFee), // our exchange rate after fees \n remainingZrxBuyAmount\n );\n\n // Attempt to sell the remaining amount of WETH.\n FillResults memory singleFillResult = fillOrderNoThrow(\n orders[i],\n safeAdd(remainingWethSellAmount, 1), // we add 1 wei to the fill amount to make up for rounding errors\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker.\n addFillResults(totalFillResults, singleFillResult);\n zrxPurchased = safeSub(totalFillResults.makerAssetFilledAmount, totalFillResults.takerFeePaid);\n\n // Stop execution if the entire amount of ZRX has been bought.\n if (zrxPurchased >= zrxBuyAmount) {\n break;\n }\n }\n\n require(\n zrxPurchased >= zrxBuyAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return totalFillResults;\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinForwarderCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MWeth.sol\";\nimport \"./mixins/MAssets.sol\";\nimport \"./mixins/MExchangeWrapper.sol\";\nimport \"./interfaces/IForwarderCore.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../protocol/Exchange/libs/LibFillResults.sol\";\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\n\n\ncontract MixinForwarderCore is\n LibFillResults,\n LibMath,\n LibConstants,\n MWeth,\n MAssets,\n MExchangeWrapper,\n IForwarderCore\n{\n using LibBytes for bytes;\n\n /// @dev Constructor approves ERC20 proxy to transfer ZRX and WETH on this contract's behalf.\n constructor ()\n public\n {\n address proxyAddress = EXCHANGE.getAssetProxy(ERC20_DATA_ID);\n require(\n proxyAddress != address(0),\n \"UNREGISTERED_ASSET_PROXY\"\n );\n ETHER_TOKEN.approve(proxyAddress, MAX_UINT);\n ZRX_TOKEN.approve(proxyAddress, MAX_UINT);\n }\n\n /// @dev Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketSellOrdersWithEth(\n LibOrder.Order[] memory orders,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n FillResults memory orderFillResults,\n FillResults memory feeOrderFillResults\n )\n {\n // Convert ETH to WETH.\n convertEthToWeth();\n\n uint256 wethSellAmount;\n uint256 zrxBuyAmount;\n uint256 makerAssetAmountPurchased;\n if (orders[0].makerAssetData.equals(ZRX_ASSET_DATA)) {\n // Calculate amount of WETH that won't be spent on ETH fees.\n wethSellAmount = getPartialAmountFloor(\n PERCENTAGE_DENOMINATOR,\n safeAdd(PERCENTAGE_DENOMINATOR, feePercentage),\n msg.value\n );\n // Market sell available WETH.\n // ZRX fees are paid with this contract's balance.\n orderFillResults = marketSellWeth(\n orders,\n wethSellAmount,\n signatures\n );\n // The fee amount must be deducted from the amount transfered back to sender.\n makerAssetAmountPurchased = safeSub(orderFillResults.makerAssetFilledAmount, orderFillResults.takerFeePaid);\n } else {\n // 5% of WETH is reserved for filling feeOrders and paying feeRecipient.\n wethSellAmount = getPartialAmountFloor(\n MAX_WETH_FILL_PERCENTAGE,\n PERCENTAGE_DENOMINATOR,\n msg.value\n );\n // Market sell 95% of WETH.\n // ZRX fees are payed with this contract's balance.\n orderFillResults = marketSellWeth(\n orders,\n wethSellAmount,\n signatures\n );\n // Buy back all ZRX spent on fees.\n zrxBuyAmount = orderFillResults.takerFeePaid;\n feeOrderFillResults = marketBuyExactZrxWithWeth(\n feeOrders,\n zrxBuyAmount,\n feeSignatures\n );\n makerAssetAmountPurchased = orderFillResults.makerAssetFilledAmount;\n }\n\n // Transfer feePercentage of total ETH spent on primary orders to feeRecipient.\n // Refund remaining ETH to msg.sender.\n transferEthFeeAndRefund(\n orderFillResults.takerAssetFilledAmount,\n feeOrderFillResults.takerAssetFilledAmount,\n feePercentage,\n feeRecipient\n );\n\n // Transfer purchased assets to msg.sender.\n transferAssetToSender(orders[0].makerAssetData, makerAssetAmountPurchased);\n }\n\n /// @dev Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param makerAssetFillAmount Desired amount of makerAsset to purchase.\n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketBuyOrdersWithEth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n FillResults memory orderFillResults,\n FillResults memory feeOrderFillResults\n )\n {\n // Convert ETH to WETH.\n convertEthToWeth();\n\n uint256 zrxBuyAmount;\n uint256 makerAssetAmountPurchased;\n if (orders[0].makerAssetData.equals(ZRX_ASSET_DATA)) {\n // If the makerAsset is ZRX, it is not necessary to pay fees out of this\n // contracts's ZRX balance because fees are factored into the price of the order.\n orderFillResults = marketBuyExactZrxWithWeth(\n orders,\n makerAssetFillAmount,\n signatures\n );\n // The fee amount must be deducted from the amount transfered back to sender.\n makerAssetAmountPurchased = safeSub(orderFillResults.makerAssetFilledAmount, orderFillResults.takerFeePaid);\n } else {\n // Attemp to purchase desired amount of makerAsset.\n // ZRX fees are payed with this contract's balance.\n orderFillResults = marketBuyExactAmountWithWeth(\n orders,\n makerAssetFillAmount,\n signatures\n );\n // Buy back all ZRX spent on fees.\n zrxBuyAmount = orderFillResults.takerFeePaid;\n feeOrderFillResults = marketBuyExactZrxWithWeth(\n feeOrders,\n zrxBuyAmount,\n feeSignatures\n );\n makerAssetAmountPurchased = orderFillResults.makerAssetFilledAmount;\n }\n\n // Transfer feePercentage of total ETH spent on primary orders to feeRecipient.\n // Refund remaining ETH to msg.sender.\n transferEthFeeAndRefund(\n orderFillResults.takerAssetFilledAmount,\n feeOrderFillResults.takerAssetFilledAmount,\n feePercentage,\n feeRecipient\n );\n\n // Transfer purchased assets to msg.sender.\n transferAssetToSender(orders[0].makerAssetData, makerAssetAmountPurchased);\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinWeth.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MWeth.sol\";\n\n\ncontract MixinWeth is\n LibMath,\n LibConstants,\n MWeth\n{\n /// @dev Default payabale function, this allows us to withdraw WETH\n function ()\n public\n payable\n {\n require(\n msg.sender == address(ETHER_TOKEN),\n \"DEFAULT_FUNCTION_WETH_CONTRACT_ONLY\"\n );\n }\n\n /// @dev Converts message call's ETH value into WETH.\n function convertEthToWeth()\n internal\n {\n require(\n msg.value > 0,\n \"INVALID_MSG_VALUE\"\n );\n ETHER_TOKEN.deposit.value(msg.value)();\n }\n\n /// @dev Transfers feePercentage of WETH spent on primary orders to feeRecipient.\n /// Refunds any excess ETH to msg.sender.\n /// @param wethSoldExcludingFeeOrders Amount of WETH sold when filling primary orders.\n /// @param wethSoldForZrx Amount of WETH sold when purchasing ZRX required for primary order fees.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n function transferEthFeeAndRefund(\n uint256 wethSoldExcludingFeeOrders,\n uint256 wethSoldForZrx,\n uint256 feePercentage,\n address feeRecipient\n )\n internal\n {\n // Ensure feePercentage is less than 5%.\n require(\n feePercentage <= MAX_FEE_PERCENTAGE,\n \"FEE_PERCENTAGE_TOO_LARGE\"\n );\n\n // Ensure that no extra WETH owned by this contract has been sold.\n uint256 wethSold = safeAdd(wethSoldExcludingFeeOrders, wethSoldForZrx);\n require(\n wethSold <= msg.value,\n \"OVERSOLD_WETH\"\n );\n\n // Calculate amount of WETH that hasn't been sold.\n uint256 wethRemaining = safeSub(msg.value, wethSold);\n\n // Calculate ETH fee to pay to feeRecipient.\n uint256 ethFee = getPartialAmountFloor(\n feePercentage,\n PERCENTAGE_DENOMINATOR,\n wethSoldExcludingFeeOrders\n );\n\n // Ensure fee is less than amount of WETH remaining.\n require(\n ethFee <= wethRemaining,\n \"INSUFFICIENT_ETH_REMAINING\"\n );\n \n // Do nothing if no WETH remaining\n if (wethRemaining > 0) {\n // Convert remaining WETH to ETH\n ETHER_TOKEN.withdraw(wethRemaining);\n\n // Pay ETH to feeRecipient\n if (ethFee > 0) {\n feeRecipient.transfer(ethFee);\n }\n\n // Refund remaining ETH to msg.sender.\n uint256 ethRefund = safeSub(wethRemaining, ethFee);\n if (ethRefund > 0) {\n msg.sender.transfer(ethRefund);\n }\n }\n }\n}\n",
- "2.0.0/extensions/Forwarder/interfaces/IAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IAssets {\n\n /// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to \n /// function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be\n /// used to withdraw assets that were accidentally sent to this contract.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of ERC20 token to withdraw.\n function withdrawAsset(\n bytes assetData,\n uint256 amount\n )\n external;\n}\n",
- "2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../../protocol/Exchange/libs/LibFillResults.sol\";\n\n\ncontract IForwarderCore {\n\n /// @dev Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketSellOrdersWithEth(\n LibOrder.Order[] memory orders,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n LibFillResults.FillResults memory orderFillResults,\n LibFillResults.FillResults memory feeOrderFillResults\n );\n\n /// @dev Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param makerAssetFillAmount Desired amount of makerAsset to purchase.\n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketBuyOrdersWithEth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n LibFillResults.FillResults memory orderFillResults,\n LibFillResults.FillResults memory feeOrderFillResults\n );\n}\n",
- "2.0.0/extensions/Forwarder/libs/LibConstants.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/LibBytes/LibBytes.sol\";\nimport \"../../../protocol/Exchange/interfaces/IExchange.sol\";\nimport \"../../../tokens/EtherToken/IEtherToken.sol\";\nimport \"../../../tokens/ERC20Token/IERC20Token.sol\";\n\n\ncontract LibConstants {\n\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n uint256 constant internal MAX_UINT = 2**256 - 1;\n uint256 constant internal PERCENTAGE_DENOMINATOR = 10**18; \n uint256 constant internal MAX_FEE_PERCENTAGE = 5 * PERCENTAGE_DENOMINATOR / 100; // 5%\n uint256 constant internal MAX_WETH_FILL_PERCENTAGE = 95 * PERCENTAGE_DENOMINATOR / 100; // 95%\n \n // solhint-disable var-name-mixedcase\n IExchange internal EXCHANGE;\n IEtherToken internal ETHER_TOKEN;\n IERC20Token internal ZRX_TOKEN;\n bytes internal ZRX_ASSET_DATA;\n bytes internal WETH_ASSET_DATA;\n // solhint-enable var-name-mixedcase\n\n constructor (\n address _exchange,\n bytes memory _zrxAssetData,\n bytes memory _wethAssetData\n )\n public\n {\n EXCHANGE = IExchange(_exchange);\n ZRX_ASSET_DATA = _zrxAssetData;\n WETH_ASSET_DATA = _wethAssetData;\n\n address etherToken = _wethAssetData.readAddress(16);\n address zrxToken = _zrxAssetData.readAddress(16);\n ETHER_TOKEN = IEtherToken(etherToken);\n ZRX_TOKEN = IERC20Token(zrxToken);\n }\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAssets.sol\";\n\n\ncontract MAssets is\n IAssets\n{\n /// @dev Transfers given amount of asset to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferAssetToSender(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n\n /// @dev Decodes ERC20 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC20Token(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n\n /// @dev Decodes ERC721 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC721Token(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../../protocol/Exchange/libs/LibFillResults.sol\";\n\n\ncontract MExchangeWrapper {\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of WETH has been sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param wethSellAmount Desired amount of WETH to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellWeth(\n LibOrder.Order[] memory orders,\n uint256 wethSellAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// The asset being sold by taker must always be WETH.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyExactAmountWithWeth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Buys zrxBuyAmount of ZRX fee tokens, taking into account ZRX fees for each order. This will guarantee\n /// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues).\n /// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX\n /// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases.\n /// The asset being sold by taker must always be WETH. \n /// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset.\n /// @param zrxBuyAmount Desired amount of ZRX to buy.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return totalFillResults Amounts filled and fees paid by maker and taker.\n function marketBuyExactZrxWithWeth(\n LibOrder.Order[] memory orders,\n uint256 zrxBuyAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MWeth.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract MWeth {\n\n /// @dev Converts message call's ETH value into WETH.\n function convertEthToWeth()\n internal;\n\n /// @dev Transfers feePercentage of WETH spent on primary orders to feeRecipient.\n /// Refunds any excess ETH to msg.sender.\n /// @param wethSoldExcludingFeeOrders Amount of WETH sold when filling primary orders.\n /// @param wethSoldForZrx Amount of WETH sold when purchasing ZRX required for primary order fees.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n function transferEthFeeAndRefund(\n uint256 wethSoldExcludingFeeOrders,\n uint256 wethSoldForZrx,\n uint256 feePercentage,\n address feeRecipient\n )\n internal;\n}\n",
- "2.0.0/extensions/OrderValidator/OrderValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../protocol/Exchange/interfaces/IExchange.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../tokens/ERC20Token/IERC20Token.sol\";\nimport \"../../tokens/ERC721Token/IERC721Token.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\n\n\ncontract OrderValidator {\n\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n\n struct TraderInfo {\n uint256 makerBalance; // Maker's balance of makerAsset\n uint256 makerAllowance; // Maker's allowance to corresponding AssetProxy\n uint256 takerBalance; // Taker's balance of takerAsset\n uint256 takerAllowance; // Taker's allowance to corresponding AssetProxy\n uint256 makerZrxBalance; // Maker's balance of ZRX\n uint256 makerZrxAllowance; // Maker's allowance of ZRX to ERC20Proxy\n uint256 takerZrxBalance; // Taker's balance of ZRX\n uint256 takerZrxAllowance; // Taker's allowance of ZRX to ERC20Proxy\n }\n\n // solhint-disable var-name-mixedcase\n IExchange internal EXCHANGE;\n bytes internal ZRX_ASSET_DATA;\n // solhint-enable var-name-mixedcase\n\n constructor (address _exchange, bytes memory _zrxAssetData)\n public\n {\n EXCHANGE = IExchange(_exchange);\n ZRX_ASSET_DATA = _zrxAssetData;\n }\n\n /// @dev Fetches information for order and maker/taker of order.\n /// @param order The order structure.\n /// @param takerAddress Address that will be filling the order.\n /// @return OrderInfo and TraderInfo instances for given order.\n function getOrderAndTraderInfo(LibOrder.Order memory order, address takerAddress)\n public\n view\n returns (LibOrder.OrderInfo memory orderInfo, TraderInfo memory traderInfo)\n {\n orderInfo = EXCHANGE.getOrderInfo(order);\n traderInfo = getTraderInfo(order, takerAddress);\n return (orderInfo, traderInfo);\n }\n\n /// @dev Fetches information for all passed in orders and the makers/takers of each order.\n /// @param orders Array of order specifications.\n /// @param takerAddresses Array of taker addresses corresponding to each order.\n /// @return Arrays of OrderInfo and TraderInfo instances that correspond to each order.\n function getOrdersAndTradersInfo(LibOrder.Order[] memory orders, address[] memory takerAddresses)\n public\n view\n returns (LibOrder.OrderInfo[] memory ordersInfo, TraderInfo[] memory tradersInfo)\n {\n ordersInfo = EXCHANGE.getOrdersInfo(orders);\n tradersInfo = getTradersInfo(orders, takerAddresses);\n return (ordersInfo, tradersInfo);\n }\n\n /// @dev Fetches balance and allowances for maker and taker of order.\n /// @param order The order structure.\n /// @param takerAddress Address that will be filling the order.\n /// @return Balances and allowances of maker and taker of order.\n function getTraderInfo(LibOrder.Order memory order, address takerAddress)\n public\n view\n returns (TraderInfo memory traderInfo)\n {\n (traderInfo.makerBalance, traderInfo.makerAllowance) = getBalanceAndAllowance(order.makerAddress, order.makerAssetData);\n (traderInfo.takerBalance, traderInfo.takerAllowance) = getBalanceAndAllowance(takerAddress, order.takerAssetData);\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n (traderInfo.makerZrxBalance, traderInfo.makerZrxAllowance) = getBalanceAndAllowance(order.makerAddress, zrxAssetData);\n (traderInfo.takerZrxBalance, traderInfo.takerZrxAllowance) = getBalanceAndAllowance(takerAddress, zrxAssetData);\n return traderInfo;\n }\n\n /// @dev Fetches balances and allowances of maker and taker for each provided order.\n /// @param orders Array of order specifications.\n /// @param takerAddresses Array of taker addresses corresponding to each order.\n /// @return Array of balances and allowances for maker and taker of each order.\n function getTradersInfo(LibOrder.Order[] memory orders, address[] memory takerAddresses)\n public\n view\n returns (TraderInfo[] memory)\n {\n uint256 ordersLength = orders.length;\n TraderInfo[] memory tradersInfo = new TraderInfo[](ordersLength);\n for (uint256 i = 0; i != ordersLength; i++) {\n tradersInfo[i] = getTraderInfo(orders[i], takerAddresses[i]);\n }\n return tradersInfo;\n }\n\n /// @dev Fetches token balances and allowances of an address to given assetProxy. Supports ERC20 and ERC721.\n /// @param target Address to fetch balances and allowances of.\n /// @param assetData Encoded data that can be decoded by a specified proxy contract when transferring asset.\n /// @return Balance of asset and allowance set to given proxy of asset.\n /// For ERC721 tokens, these values will always be 1 or 0.\n function getBalanceAndAllowance(address target, bytes memory assetData)\n public\n view\n returns (uint256 balance, uint256 allowance)\n {\n bytes4 assetProxyId = assetData.readBytes4(0);\n address token = assetData.readAddress(16);\n address assetProxy = EXCHANGE.getAssetProxy(assetProxyId);\n\n if (assetProxyId == ERC20_DATA_ID) {\n // Query balance\n balance = IERC20Token(token).balanceOf(target);\n\n // Query allowance\n allowance = IERC20Token(token).allowance(target, assetProxy);\n } else if (assetProxyId == ERC721_DATA_ID) {\n uint256 tokenId = assetData.readUint256(36);\n\n // Query owner of tokenId\n address owner = getERC721TokenOwner(token, tokenId);\n\n // Set balance to 1 if tokenId is owned by target\n balance = target == owner ? 1 : 0;\n\n // Check if ERC721Proxy is approved to spend tokenId\n bool isApproved = IERC721Token(token).isApprovedForAll(target, assetProxy) || IERC721Token(token).getApproved(tokenId) == assetProxy;\n \n // Set alowance to 1 if ERC721Proxy is approved to spend tokenId\n allowance = isApproved ? 1 : 0;\n } else {\n revert(\"UNSUPPORTED_ASSET_PROXY\");\n }\n return (balance, allowance);\n }\n\n /// @dev Fetches token balances and allowances of an address for each given assetProxy. Supports ERC20 and ERC721.\n /// @param target Address to fetch balances and allowances of.\n /// @param assetData Array of encoded byte arrays that can be decoded by a specified proxy contract when transferring asset.\n /// @return Balances and allowances of assets.\n /// For ERC721 tokens, these values will always be 1 or 0.\n function getBalancesAndAllowances(address target, bytes[] memory assetData)\n public\n view\n returns (uint256[] memory, uint256[] memory)\n {\n uint256 length = assetData.length;\n uint256[] memory balances = new uint256[](length);\n uint256[] memory allowances = new uint256[](length);\n for (uint256 i = 0; i != length; i++) {\n (balances[i], allowances[i]) = getBalanceAndAllowance(target, assetData[i]);\n }\n return (balances, allowances);\n }\n\n /// @dev Calls `token.ownerOf(tokenId)`, but returns a null owner instead of reverting on an unowned token.\n /// @param token Address of ERC721 token.\n /// @param tokenId The identifier for the specific NFT.\n /// @return Owner of tokenId or null address if unowned.\n function getERC721TokenOwner(address token, uint256 tokenId)\n public\n view\n returns (address owner)\n {\n assembly {\n // load free memory pointer\n let cdStart := mload(64)\n\n // bytes4(keccak256(ownerOf(uint256))) = 0x6352211e\n mstore(cdStart, 0x6352211e00000000000000000000000000000000000000000000000000000000)\n mstore(add(cdStart, 4), tokenId)\n\n // staticcall `ownerOf(tokenId)`\n // `ownerOf` will revert if tokenId is not owned\n let success := staticcall(\n gas, // forward all gas\n token, // call token contract\n cdStart, // start of calldata\n 36, // length of input is 36 bytes\n cdStart, // write output over input\n 32 // size of output is 32 bytes\n )\n\n // Success implies that tokenId is owned\n // Copy owner from return data if successful\n if success {\n owner := mload(cdStart)\n } \n }\n\n // Owner initialized to address(0), no need to modify if call is unsuccessful\n return owner;\n }\n}\n",
- "2.0.0/multisig/MultiSigWallet.sol": "// solhint-disable\npragma solidity ^0.4.15;\n\n\n/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.\n/// @author Stefan George - <stefan.george@consensys.net>\ncontract MultiSigWallet {\n\n /*\n * Events\n */\n event Confirmation(address indexed sender, uint indexed transactionId);\n event Revocation(address indexed sender, uint indexed transactionId);\n event Submission(uint indexed transactionId);\n event Execution(uint indexed transactionId);\n event ExecutionFailure(uint indexed transactionId);\n event Deposit(address indexed sender, uint value);\n event OwnerAddition(address indexed owner);\n event OwnerRemoval(address indexed owner);\n event RequirementChange(uint required);\n\n /*\n * Constants\n */\n uint constant public MAX_OWNER_COUNT = 50;\n\n /*\n * Storage\n */\n mapping (uint => Transaction) public transactions;\n mapping (uint => mapping (address => bool)) public confirmations;\n mapping (address => bool) public isOwner;\n address[] public owners;\n uint public required;\n uint public transactionCount;\n\n struct Transaction {\n address destination;\n uint value;\n bytes data;\n bool executed;\n }\n\n /*\n * Modifiers\n */\n modifier onlyWallet() {\n require(msg.sender == address(this));\n _;\n }\n\n modifier ownerDoesNotExist(address owner) {\n require(!isOwner[owner]);\n _;\n }\n\n modifier ownerExists(address owner) {\n require(isOwner[owner]);\n _;\n }\n\n modifier transactionExists(uint transactionId) {\n require(transactions[transactionId].destination != 0);\n _;\n }\n\n modifier confirmed(uint transactionId, address owner) {\n require(confirmations[transactionId][owner]);\n _;\n }\n\n modifier notConfirmed(uint transactionId, address owner) {\n require(!confirmations[transactionId][owner]);\n _;\n }\n\n modifier notExecuted(uint transactionId) {\n require(!transactions[transactionId].executed);\n _;\n }\n\n modifier notNull(address _address) {\n require(_address != 0);\n _;\n }\n\n modifier validRequirement(uint ownerCount, uint _required) {\n require(ownerCount <= MAX_OWNER_COUNT\n && _required <= ownerCount\n && _required != 0\n && ownerCount != 0);\n _;\n }\n\n /// @dev Fallback function allows to deposit ether.\n function()\n payable\n {\n if (msg.value > 0)\n Deposit(msg.sender, msg.value);\n }\n\n /*\n * Public functions\n */\n /// @dev Contract constructor sets initial owners and required number of confirmations.\n /// @param _owners List of initial owners.\n /// @param _required Number of required confirmations.\n function MultiSigWallet(address[] _owners, uint _required)\n public\n validRequirement(_owners.length, _required)\n {\n for (uint i=0; i<_owners.length; i++) {\n require(!isOwner[_owners[i]] && _owners[i] != 0);\n isOwner[_owners[i]] = true;\n }\n owners = _owners;\n required = _required;\n }\n\n /// @dev Allows to add a new owner. Transaction has to be sent by wallet.\n /// @param owner Address of new owner.\n function addOwner(address owner)\n public\n onlyWallet\n ownerDoesNotExist(owner)\n notNull(owner)\n validRequirement(owners.length + 1, required)\n {\n isOwner[owner] = true;\n owners.push(owner);\n OwnerAddition(owner);\n }\n\n /// @dev Allows to remove an owner. Transaction has to be sent by wallet.\n /// @param owner Address of owner.\n function removeOwner(address owner)\n public\n onlyWallet\n ownerExists(owner)\n {\n isOwner[owner] = false;\n for (uint i=0; i<owners.length - 1; i++)\n if (owners[i] == owner) {\n owners[i] = owners[owners.length - 1];\n break;\n }\n owners.length -= 1;\n if (required > owners.length)\n changeRequirement(owners.length);\n OwnerRemoval(owner);\n }\n\n /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet.\n /// @param owner Address of owner to be replaced.\n /// @param newOwner Address of new owner.\n function replaceOwner(address owner, address newOwner)\n public\n onlyWallet\n ownerExists(owner)\n ownerDoesNotExist(newOwner)\n {\n for (uint i=0; i<owners.length; i++)\n if (owners[i] == owner) {\n owners[i] = newOwner;\n break;\n }\n isOwner[owner] = false;\n isOwner[newOwner] = true;\n OwnerRemoval(owner);\n OwnerAddition(newOwner);\n }\n\n /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet.\n /// @param _required Number of required confirmations.\n function changeRequirement(uint _required)\n public\n onlyWallet\n validRequirement(owners.length, _required)\n {\n required = _required;\n RequirementChange(_required);\n }\n\n /// @dev Allows an owner to submit and confirm a transaction.\n /// @param destination Transaction target address.\n /// @param value Transaction ether value.\n /// @param data Transaction data payload.\n /// @return Returns transaction ID.\n function submitTransaction(address destination, uint value, bytes data)\n public\n returns (uint transactionId)\n {\n transactionId = addTransaction(destination, value, data);\n confirmTransaction(transactionId);\n }\n\n /// @dev Allows an owner to confirm a transaction.\n /// @param transactionId Transaction ID.\n function confirmTransaction(uint transactionId)\n public\n ownerExists(msg.sender)\n transactionExists(transactionId)\n notConfirmed(transactionId, msg.sender)\n {\n confirmations[transactionId][msg.sender] = true;\n Confirmation(msg.sender, transactionId);\n executeTransaction(transactionId);\n }\n\n /// @dev Allows an owner to revoke a confirmation for a transaction.\n /// @param transactionId Transaction ID.\n function revokeConfirmation(uint transactionId)\n public\n ownerExists(msg.sender)\n confirmed(transactionId, msg.sender)\n notExecuted(transactionId)\n {\n confirmations[transactionId][msg.sender] = false;\n Revocation(msg.sender, transactionId);\n }\n\n /// @dev Allows anyone to execute a confirmed transaction.\n /// @param transactionId Transaction ID.\n function executeTransaction(uint transactionId)\n public\n ownerExists(msg.sender)\n confirmed(transactionId, msg.sender)\n notExecuted(transactionId)\n {\n if (isConfirmed(transactionId)) {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data))\n Execution(transactionId);\n else {\n ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n }\n\n // call has been separated into its own function in order to take advantage\n // of the Solidity's code generator to produce a loop that copies tx.data into memory.\n function external_call(address destination, uint value, uint dataLength, bytes data) internal returns (bool) {\n bool result;\n assembly {\n let x := mload(0x40) // \"Allocate\" memory for output (0x40 is where \"free memory\" pointer is stored by convention)\n let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that\n result := call(\n sub(gas, 34710), // 34710 is the value that solidity is currently emitting\n // It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) +\n // callNewAccountGas (25000, in case the destination address does not exist and needs creating)\n destination,\n value,\n d,\n dataLength, // Size of the input (in bytes) - this is what fixes the padding problem\n x,\n 0 // Output is ignored, therefore the output size is zero\n )\n }\n return result;\n }\n\n /// @dev Returns the confirmation status of a transaction.\n /// @param transactionId Transaction ID.\n /// @return Confirmation status.\n function isConfirmed(uint transactionId)\n public\n constant\n returns (bool)\n {\n uint count = 0;\n for (uint i=0; i<owners.length; i++) {\n if (confirmations[transactionId][owners[i]])\n count += 1;\n if (count == required)\n return true;\n }\n }\n\n /*\n * Internal functions\n */\n /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet.\n /// @param destination Transaction target address.\n /// @param value Transaction ether value.\n /// @param data Transaction data payload.\n /// @return Returns transaction ID.\n function addTransaction(address destination, uint value, bytes data)\n internal\n notNull(destination)\n returns (uint transactionId)\n {\n transactionId = transactionCount;\n transactions[transactionId] = Transaction({\n destination: destination,\n value: value,\n data: data,\n executed: false\n });\n transactionCount += 1;\n Submission(transactionId);\n }\n\n /*\n * Web3 call functions\n */\n /// @dev Returns number of confirmations of a transaction.\n /// @param transactionId Transaction ID.\n /// @return Number of confirmations.\n function getConfirmationCount(uint transactionId)\n public\n constant\n returns (uint count)\n {\n for (uint i=0; i<owners.length; i++)\n if (confirmations[transactionId][owners[i]])\n count += 1;\n }\n\n /// @dev Returns total number of transactions after filers are applied.\n /// @param pending Include pending transactions.\n /// @param executed Include executed transactions.\n /// @return Total number of transactions after filters are applied.\n function getTransactionCount(bool pending, bool executed)\n public\n constant\n returns (uint count)\n {\n for (uint i=0; i<transactionCount; i++)\n if ( pending && !transactions[i].executed\n || executed && transactions[i].executed)\n count += 1;\n }\n\n /// @dev Returns list of owners.\n /// @return List of owner addresses.\n function getOwners()\n public\n constant\n returns (address[])\n {\n return owners;\n }\n\n /// @dev Returns array with owner addresses, which confirmed transaction.\n /// @param transactionId Transaction ID.\n /// @return Returns array of owner addresses.\n function getConfirmations(uint transactionId)\n public\n constant\n returns (address[] _confirmations)\n {\n address[] memory confirmationsTemp = new address[](owners.length);\n uint count = 0;\n uint i;\n for (i=0; i<owners.length; i++)\n if (confirmations[transactionId][owners[i]]) {\n confirmationsTemp[count] = owners[i];\n count += 1;\n }\n _confirmations = new address[](count);\n for (i=0; i<count; i++)\n _confirmations[i] = confirmationsTemp[i];\n }\n\n /// @dev Returns list of transaction IDs in defined range.\n /// @param from Index start position of transaction array.\n /// @param to Index end position of transaction array.\n /// @param pending Include pending transactions.\n /// @param executed Include executed transactions.\n /// @return Returns array of transaction IDs.\n function getTransactionIds(uint from, uint to, bool pending, bool executed)\n public\n constant\n returns (uint[] _transactionIds)\n {\n uint[] memory transactionIdsTemp = new uint[](transactionCount);\n uint count = 0;\n uint i;\n for (i=0; i<transactionCount; i++)\n if ( pending && !transactions[i].executed\n || executed && transactions[i].executed)\n {\n transactionIdsTemp[count] = i;\n count += 1;\n }\n _transactionIds = new uint[](to - from);\n for (i=from; i<to; i++)\n _transactionIds[i - from] = transactionIdsTemp[i];\n }\n}",
- "2.0.0/multisig/MultiSigWalletWithTimeLock.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MultiSigWallet.sol\";\n\n\n/// @title Multisignature wallet with time lock- Allows multiple parties to execute a transaction after a time lock has passed.\n/// @author Amir Bandeali - <amir@0xProject.com>\n// solhint-disable not-rely-on-time\ncontract MultiSigWalletWithTimeLock is\n MultiSigWallet\n{\n event ConfirmationTimeSet(uint256 indexed transactionId, uint256 confirmationTime);\n event TimeLockChange(uint256 secondsTimeLocked);\n\n uint256 public secondsTimeLocked;\n\n mapping (uint256 => uint256) public confirmationTimes;\n\n modifier notFullyConfirmed(uint256 transactionId) {\n require(\n !isConfirmed(transactionId),\n \"TX_FULLY_CONFIRMED\"\n );\n _;\n }\n\n modifier fullyConfirmed(uint256 transactionId) {\n require(\n isConfirmed(transactionId),\n \"TX_NOT_FULLY_CONFIRMED\"\n );\n _;\n }\n\n modifier pastTimeLock(uint256 transactionId) {\n require(\n block.timestamp >= confirmationTimes[transactionId] + secondsTimeLocked,\n \"TIME_LOCK_INCOMPLETE\"\n );\n _;\n }\n\n /// @dev Contract constructor sets initial owners, required number of confirmations, and time lock.\n /// @param _owners List of initial owners.\n /// @param _required Number of required confirmations.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n constructor (\n address[] _owners,\n uint256 _required,\n uint256 _secondsTimeLocked\n )\n public\n MultiSigWallet(_owners, _required)\n {\n secondsTimeLocked = _secondsTimeLocked;\n }\n\n /// @dev Changes the duration of the time lock for transactions.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n function changeTimeLock(uint256 _secondsTimeLocked)\n public\n onlyWallet\n {\n secondsTimeLocked = _secondsTimeLocked;\n emit TimeLockChange(_secondsTimeLocked);\n }\n\n /// @dev Allows an owner to confirm a transaction.\n /// @param transactionId Transaction ID.\n function confirmTransaction(uint256 transactionId)\n public\n ownerExists(msg.sender)\n transactionExists(transactionId)\n notConfirmed(transactionId, msg.sender)\n notFullyConfirmed(transactionId)\n {\n confirmations[transactionId][msg.sender] = true;\n emit Confirmation(msg.sender, transactionId);\n if (isConfirmed(transactionId)) {\n setConfirmationTime(transactionId, block.timestamp);\n }\n }\n\n /// @dev Allows anyone to execute a confirmed transaction.\n /// @param transactionId Transaction ID.\n function executeTransaction(uint256 transactionId)\n public\n notExecuted(transactionId)\n fullyConfirmed(transactionId)\n pastTimeLock(transactionId)\n {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) {\n emit Execution(transactionId);\n } else {\n emit ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n\n /// @dev Sets the time of when a submission first passed.\n function setConfirmationTime(uint256 transactionId, uint256 confirmationTime)\n internal\n {\n confirmationTimes[transactionId] = confirmationTime;\n emit ConfirmationTimeSet(transactionId, confirmationTime);\n }\n}\n",
- "2.0.0/protocol/AssetProxy/ERC20Proxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MixinAuthorizable.sol\";\n\n\ncontract ERC20Proxy is\n MixinAuthorizable\n{\n // Id of this proxy.\n bytes4 constant internal PROXY_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n \n // solhint-disable-next-line payable-fallback\n function () \n external\n {\n assembly {\n // The first 4 bytes of calldata holds the function selector\n let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)\n\n // `transferFrom` will be called with the following parameters:\n // assetData Encoded byte array.\n // from Address to transfer asset from.\n // to Address to transfer asset to.\n // amount Amount of asset to transfer.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {\n\n // To lookup a value in a mapping, we load from the storage location keccak256(k, p),\n // where k is the key left padded to 32 bytes and p is the storage slot\n let start := mload(64)\n mstore(start, and(caller, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(start, 32), authorized_slot)\n\n // Revert if authorized[msg.sender] == false\n if iszero(sload(keccak256(start, 64))) {\n // Revert with `Error(\"SENDER_NOT_AUTHORIZED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // `transferFrom`.\n // The function is marked `external`, so no abi decodeding is done for\n // us. Instead, we expect the `calldata` memory to contain the\n // following:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n //\n // (*): offset is computed from start of function parameters, so offset\n // by an additional 4 bytes in the calldata.\n //\n // (**): see table below to compute length of assetData Contents\n //\n // WARNING: The ABIv2 specification allows additional padding between\n // the Params and Data section. This will result in a larger\n // offset to assetData.\n\n // Asset data itself is encoded as follows:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 1 * 32 | function parameters: |\n // | | 4 | 12 + 20 | 1. token address |\n\n // We construct calldata for the `token.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 4 | | 1. from |\n // | | 36 | | 2. to |\n // | | 68 | | 3. amount |\n\n /////// Read token address from calldata ///////\n // * The token address is stored in `assetData`.\n //\n // * The \"offset to assetData\" is stored at offset 4 in the calldata (table 1).\n // [assetDataOffsetFromParams = calldataload(4)]\n //\n // * Notes that the \"offset to assetData\" is relative to the \"Params\" area of calldata;\n // add 4 bytes to account for the length of the \"Header\" area (table 1).\n // [assetDataOffsetFromHeader = assetDataOffsetFromParams + 4]\n //\n // * The \"token address\" is offset 32+4=36 bytes into \"assetData\" (tables 1 & 2).\n // [tokenOffset = assetDataOffsetFromHeader + 36 = calldataload(4) + 4 + 36]\n let token := calldataload(add(calldataload(4), 40))\n \n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFrom` selector.\n // Any trailing data in transferFromSelector will be\n // overwritten in the next `mstore` call.\n mstore(0, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // We copy the fields `from`, `to` and `amount` in bulk\n // from our own calldata to the new calldata.\n calldatacopy(4, 36, 96)\n\n /////// Call `token.transferFrom` using the calldata ///////\n let success := call(\n gas, // forward all gas\n token, // call address of token contract\n 0, // don't send any ETH\n 0, // pointer to start of input\n 100, // length of input\n 0, // write output over input\n 32 // output size should be 32 bytes\n )\n\n /////// Check return data. ///////\n // If there is no return data, we assume the token incorrectly\n // does not return a bool. In this case we expect it to revert\n // on failure, which was handled above.\n // If the token does return data, we require that it is a single\n // nonzero 32 bytes value.\n // So the transfer succeeded if the call succeeded and either\n // returned nothing, or returned a non-zero 32 byte value. \n success := and(success, or(\n iszero(returndatasize),\n and(\n eq(returndatasize, 32),\n gt(mload(0), 0)\n )\n ))\n if success {\n return(0, 0)\n }\n \n // Revert with `Error(\"TRANSFER_FAILED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // Revert if undefined function is called\n revert(0, 0)\n }\n }\n\n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4)\n {\n return PROXY_ID;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/ERC721Proxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MixinAuthorizable.sol\";\n\n\ncontract ERC721Proxy is\n MixinAuthorizable\n{\n // Id of this proxy.\n bytes4 constant internal PROXY_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n\n // solhint-disable-next-line payable-fallback\n function () \n external\n {\n assembly {\n // The first 4 bytes of calldata holds the function selector\n let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)\n\n // `transferFrom` will be called with the following parameters:\n // assetData Encoded byte array.\n // from Address to transfer asset from.\n // to Address to transfer asset to.\n // amount Amount of asset to transfer.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {\n\n // To lookup a value in a mapping, we load from the storage location keccak256(k, p),\n // where k is the key left padded to 32 bytes and p is the storage slot\n let start := mload(64)\n mstore(start, and(caller, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(start, 32), authorized_slot)\n\n // Revert if authorized[msg.sender] == false\n if iszero(sload(keccak256(start, 64))) {\n // Revert with `Error(\"SENDER_NOT_AUTHORIZED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // `transferFrom`.\n // The function is marked `external`, so no abi decodeding is done for\n // us. Instead, we expect the `calldata` memory to contain the\n // following:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n //\n // (*): offset is computed from start of function parameters, so offset\n // by an additional 4 bytes in the calldata.\n //\n // (**): see table below to compute length of assetData Contents\n //\n // WARNING: The ABIv2 specification allows additional padding between\n // the Params and Data section. This will result in a larger\n // offset to assetData.\n\n // Asset data itself is encoded as follows:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 2 * 32 | function parameters: |\n // | | 4 | 12 + 20 | 1. token address |\n // | | 36 | | 2. tokenId |\n \n // We construct calldata for the `token.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n // \n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 4 | | 1. from |\n // | | 36 | | 2. to |\n // | | 68 | | 3. tokenId |\n\n // There exists only 1 of each token.\n // require(amount == 1, \"INVALID_AMOUNT\")\n if sub(calldataload(100), 1) {\n // Revert with `Error(\"INVALID_AMOUNT\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000e494e56414c49445f414d4f554e540000000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFrom` selector.\n // Any trailing data in transferFromSelector will be\n // overwritten in the next `mstore` call.\n mstore(0, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // We copy the fields `from` and `to` in bulk\n // from our own calldata to the new calldata.\n calldatacopy(4, 36, 64)\n\n // Copy `tokenId` field from our own calldata to the new calldata.\n let assetDataOffset := calldataload(4)\n calldatacopy(68, add(assetDataOffset, 72), 32)\n\n /////// Call `token.transferFrom` using the calldata ///////\n let token := calldataload(add(assetDataOffset, 40))\n let success := call(\n gas, // forward all gas\n token, // call address of token contract\n 0, // don't send any ETH\n 0, // pointer to start of input\n 100, // length of input\n 0, // write output to null\n 0 // output size is 0 bytes\n )\n if success {\n return(0, 0)\n }\n \n // Revert with `Error(\"TRANSFER_FAILED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // Revert if undefined function is called\n revert(0, 0)\n }\n }\n\n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4)\n {\n return PROXY_ID;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/MixinAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"./mixins/MAuthorizable.sol\";\n\n\ncontract MixinAuthorizable is\n Ownable,\n MAuthorizable\n{\n /// @dev Only authorized addresses can invoke functions with this modifier.\n modifier onlyAuthorized {\n require(\n authorized[msg.sender],\n \"SENDER_NOT_AUTHORIZED\"\n );\n _;\n }\n\n mapping (address => bool) public authorized;\n address[] public authorities;\n\n /// @dev Authorizes an address.\n /// @param target Address to authorize.\n function addAuthorizedAddress(address target)\n external\n onlyOwner\n {\n require(\n !authorized[target],\n \"TARGET_ALREADY_AUTHORIZED\"\n );\n\n authorized[target] = true;\n authorities.push(target);\n emit AuthorizedAddressAdded(target, msg.sender);\n }\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n function removeAuthorizedAddress(address target)\n external\n onlyOwner\n {\n require(\n authorized[target],\n \"TARGET_NOT_AUTHORIZED\"\n );\n\n delete authorized[target];\n for (uint256 i = 0; i < authorities.length; i++) {\n if (authorities[i] == target) {\n authorities[i] = authorities[authorities.length - 1];\n authorities.length -= 1;\n break;\n }\n }\n emit AuthorizedAddressRemoved(target, msg.sender);\n }\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n /// @param index Index of target in authorities array.\n function removeAuthorizedAddressAtIndex(\n address target,\n uint256 index\n )\n external\n onlyOwner\n {\n require(\n authorized[target],\n \"TARGET_NOT_AUTHORIZED\"\n );\n require(\n index < authorities.length,\n \"INDEX_OUT_OF_BOUNDS\"\n );\n require(\n authorities[index] == target,\n \"AUTHORIZED_ADDRESS_MISMATCH\"\n );\n\n delete authorized[target];\n authorities[index] = authorities[authorities.length - 1];\n authorities.length -= 1;\n emit AuthorizedAddressRemoved(target, msg.sender);\n }\n\n /// @dev Gets all authorized addresses.\n /// @return Array of authorized addresses.\n function getAuthorizedAddresses()\n external\n view\n returns (address[] memory)\n {\n return authorities;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IAuthorizable.sol\";\n\n\ncontract IAssetProxy is\n IAuthorizable\n{\n /// @dev Transfers assets. Either succeeds or throws.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param from Address to transfer asset from.\n /// @param to Address to transfer asset to.\n /// @param amount Amount of asset to transfer.\n function transferFrom(\n bytes assetData,\n address from,\n address to,\n uint256 amount\n )\n external;\n \n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4);\n}\n",
- "2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/Ownable/IOwnable.sol\";\n\n\ncontract IAuthorizable is\n IOwnable\n{\n /// @dev Authorizes an address.\n /// @param target Address to authorize.\n function addAuthorizedAddress(address target)\n external;\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n function removeAuthorizedAddress(address target)\n external;\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n /// @param index Index of target in authorities array.\n function removeAuthorizedAddressAtIndex(\n address target,\n uint256 index\n )\n external;\n \n /// @dev Gets all authorized addresses.\n /// @return Array of authorized addresses.\n function getAuthorizedAddresses()\n external\n view\n returns (address[] memory);\n}\n",
- "2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAuthorizable.sol\";\n\n\ncontract MAuthorizable is\n IAuthorizable\n{\n // Event logged when a new address is authorized.\n event AuthorizedAddressAdded(\n address indexed target,\n address indexed caller\n );\n\n // Event logged when a currently authorized address is unauthorized.\n event AuthorizedAddressRemoved(\n address indexed target,\n address indexed caller\n );\n\n /// @dev Only authorized addresses can invoke functions with this modifier.\n modifier onlyAuthorized { revert(); _; }\n}\n",
- "2.0.0/protocol/AssetProxyOwner/AssetProxyOwner.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../multisig/MultiSigWalletWithTimeLock.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\n\n\ncontract AssetProxyOwner is\n MultiSigWalletWithTimeLock\n{\n using LibBytes for bytes;\n\n event AssetProxyRegistration(address assetProxyContract, bool isRegistered);\n\n // Mapping of AssetProxy contract address =>\n // if this contract is allowed to call the AssetProxy's `removeAuthorizedAddressAtIndex` method without a time lock.\n mapping (address => bool) public isAssetProxyRegistered;\n\n bytes4 constant internal REMOVE_AUTHORIZED_ADDRESS_AT_INDEX_SELECTOR = bytes4(keccak256(\"removeAuthorizedAddressAtIndex(address,uint256)\"));\n\n /// @dev Function will revert if the transaction does not call `removeAuthorizedAddressAtIndex`\n /// on an approved AssetProxy contract.\n modifier validRemoveAuthorizedAddressAtIndexTx(uint256 transactionId) {\n Transaction storage txn = transactions[transactionId];\n require(\n isAssetProxyRegistered[txn.destination],\n \"UNREGISTERED_ASSET_PROXY\"\n );\n require(\n txn.data.readBytes4(0) == REMOVE_AUTHORIZED_ADDRESS_AT_INDEX_SELECTOR,\n \"INVALID_FUNCTION_SELECTOR\"\n );\n _;\n }\n\n /// @dev Contract constructor sets initial owners, required number of confirmations,\n /// time lock, and list of AssetProxy addresses.\n /// @param _owners List of initial owners.\n /// @param _assetProxyContracts Array of AssetProxy contract addresses.\n /// @param _required Number of required confirmations.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n constructor (\n address[] memory _owners,\n address[] memory _assetProxyContracts,\n uint256 _required,\n uint256 _secondsTimeLocked\n )\n public\n MultiSigWalletWithTimeLock(_owners, _required, _secondsTimeLocked)\n {\n for (uint256 i = 0; i < _assetProxyContracts.length; i++) {\n address assetProxy = _assetProxyContracts[i];\n require(\n assetProxy != address(0),\n \"INVALID_ASSET_PROXY\"\n );\n isAssetProxyRegistered[assetProxy] = true;\n }\n }\n\n /// @dev Registers or deregisters an AssetProxy to be able to execute\n /// `removeAuthorizedAddressAtIndex` without a timelock.\n /// @param assetProxyContract Address of AssetProxy contract.\n /// @param isRegistered Status of approval for AssetProxy contract.\n function registerAssetProxy(address assetProxyContract, bool isRegistered)\n public\n onlyWallet\n notNull(assetProxyContract)\n {\n isAssetProxyRegistered[assetProxyContract] = isRegistered;\n emit AssetProxyRegistration(assetProxyContract, isRegistered);\n }\n\n /// @dev Allows execution of `removeAuthorizedAddressAtIndex` without time lock.\n /// @param transactionId Transaction ID.\n function executeRemoveAuthorizedAddressAtIndex(uint256 transactionId)\n public\n notExecuted(transactionId)\n fullyConfirmed(transactionId)\n validRemoveAuthorizedAddressAtIndexTx(transactionId)\n {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) {\n emit Execution(transactionId);\n } else {\n emit ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/Exchange.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./MixinExchangeCore.sol\";\nimport \"./MixinSignatureValidator.sol\";\nimport \"./MixinWrapperFunctions.sol\";\nimport \"./MixinAssetProxyDispatcher.sol\";\nimport \"./MixinTransactions.sol\";\nimport \"./MixinMatchOrders.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract Exchange is\n MixinExchangeCore,\n MixinMatchOrders,\n MixinSignatureValidator,\n MixinTransactions,\n MixinAssetProxyDispatcher,\n MixinWrapperFunctions\n{\n string constant public VERSION = \"2.0.1-alpha\";\n\n // Mixins are instantiated in the order they are inherited\n constructor (bytes memory _zrxAssetData)\n public\n LibConstants(_zrxAssetData) // @TODO: Remove when we deploy.\n MixinExchangeCore()\n MixinMatchOrders()\n MixinSignatureValidator()\n MixinTransactions()\n MixinAssetProxyDispatcher()\n MixinWrapperFunctions()\n {}\n}\n",
- "2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\nimport \"../AssetProxy/interfaces/IAssetProxy.sol\";\n\n\ncontract MixinAssetProxyDispatcher is\n Ownable,\n MAssetProxyDispatcher\n{\n // Mapping from Asset Proxy Id's to their respective Asset Proxy\n mapping (bytes4 => IAssetProxy) public assetProxies;\n\n /// @dev Registers an asset proxy to its asset proxy id.\n /// Once an asset proxy is registered, it cannot be unregistered.\n /// @param assetProxy Address of new asset proxy to register.\n function registerAssetProxy(address assetProxy)\n external\n onlyOwner\n {\n IAssetProxy assetProxyContract = IAssetProxy(assetProxy);\n\n // Ensure that no asset proxy exists with current id.\n bytes4 assetProxyId = assetProxyContract.getProxyId();\n address currentAssetProxy = assetProxies[assetProxyId];\n require(\n currentAssetProxy == address(0),\n \"ASSET_PROXY_ALREADY_EXISTS\"\n );\n\n // Add asset proxy and log registration.\n assetProxies[assetProxyId] = assetProxyContract;\n emit AssetProxyRegistered(\n assetProxyId,\n assetProxy\n );\n }\n\n /// @dev Gets an asset proxy.\n /// @param assetProxyId Id of the asset proxy.\n /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered.\n function getAssetProxy(bytes4 assetProxyId)\n external\n view\n returns (address)\n {\n return assetProxies[assetProxyId];\n }\n\n /// @dev Forwards arguments to assetProxy and calls `transferFrom`. Either succeeds or throws.\n /// @param assetData Byte array encoded for the asset.\n /// @param from Address to transfer token from.\n /// @param to Address to transfer token to.\n /// @param amount Amount of token to transfer.\n function dispatchTransferFrom(\n bytes memory assetData,\n address from,\n address to,\n uint256 amount\n )\n internal\n {\n // Do nothing if no amount should be transferred.\n if (amount > 0 && from != to) {\n // Ensure assetData length is valid\n require(\n assetData.length > 3,\n \"LENGTH_GREATER_THAN_3_REQUIRED\"\n );\n \n // Lookup assetProxy. We do not use `LibBytes.readBytes4` for gas efficiency reasons.\n bytes4 assetProxyId;\n assembly {\n assetProxyId := and(mload(\n add(assetData, 32)),\n 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000\n )\n }\n address assetProxy = assetProxies[assetProxyId];\n\n // Ensure that assetProxy exists\n require(\n assetProxy != address(0),\n \"ASSET_PROXY_DOES_NOT_EXIST\"\n );\n \n // We construct calldata for the `assetProxy.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n // \n // | Area | Offset | Length | Contents |\n // | -------- |--------|---------|-------------------------------------------- |\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n\n assembly {\n /////// Setup State ///////\n // `cdStart` is the start of the calldata for `assetProxy.transferFrom` (equal to free memory ptr).\n let cdStart := mload(64)\n // `dataAreaLength` is the total number of words needed to store `assetData`\n // As-per the ABI spec, this value is padded up to the nearest multiple of 32,\n // and includes 32-bytes for length.\n let dataAreaLength := and(add(mload(assetData), 63), 0xFFFFFFFFFFFE0)\n // `cdEnd` is the end of the calldata for `assetProxy.transferFrom`.\n let cdEnd := add(cdStart, add(132, dataAreaLength))\n\n \n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFromSelector`.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n mstore(cdStart, 0xa85e59e400000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // Each parameter is padded to 32-bytes. The entire Params Area is 128 bytes.\n // Notes:\n // 1. The offset to `assetData` is the length of the Params Area (128 bytes).\n // 2. A 20-byte mask is applied to addresses to zero-out the unused bytes.\n mstore(add(cdStart, 4), 128)\n mstore(add(cdStart, 36), and(from, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(cdStart, 68), and(to, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(cdStart, 100), amount)\n \n /////// Setup Data Area ///////\n // This area holds `assetData`.\n let dataArea := add(cdStart, 132)\n // solhint-disable-next-line no-empty-blocks\n for {} lt(dataArea, cdEnd) {} {\n mstore(dataArea, mload(assetData))\n dataArea := add(dataArea, 32)\n assetData := add(assetData, 32)\n }\n\n /////// Call `assetProxy.transferFrom` using the constructed calldata ///////\n let success := call(\n gas, // forward all gas\n assetProxy, // call address of asset proxy\n 0, // don't send any ETH\n cdStart, // pointer to start of input\n sub(cdEnd, cdStart), // length of input \n cdStart, // write output over input\n 512 // reserve 512 bytes for output\n )\n if iszero(success) {\n revert(cdStart, returndatasize())\n }\n }\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\n\n\ncontract MixinExchangeCore is\n ReentrancyGuard,\n LibConstants,\n LibMath,\n LibOrder,\n LibFillResults,\n MAssetProxyDispatcher,\n MExchangeCore,\n MSignatureValidator,\n MTransactions\n{\n // Mapping of orderHash => amount of takerAsset already bought by maker\n mapping (bytes32 => uint256) public filled;\n\n // Mapping of orderHash => cancelled\n mapping (bytes32 => bool) public cancelled;\n\n // Mapping of makerAddress => senderAddress => lowest salt an order can have in order to be fillable\n // Orders with specified senderAddress and with a salt less than their epoch are considered cancelled\n mapping (address => mapping (address => uint256)) public orderEpoch;\n\n /// @dev Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch\n /// and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress).\n /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled.\n function cancelOrdersUpTo(uint256 targetOrderEpoch)\n external\n nonReentrant\n {\n address makerAddress = getCurrentContextAddress();\n // If this function is called via `executeTransaction`, we only update the orderEpoch for the makerAddress/msg.sender combination.\n // This allows external filter contracts to add rules to how orders are cancelled via this function.\n address senderAddress = makerAddress == msg.sender ? address(0) : msg.sender;\n\n // orderEpoch is initialized to 0, so to cancelUpTo we need salt + 1\n uint256 newOrderEpoch = targetOrderEpoch + 1; \n uint256 oldOrderEpoch = orderEpoch[makerAddress][senderAddress];\n\n // Ensure orderEpoch is monotonically increasing\n require(\n newOrderEpoch > oldOrderEpoch, \n \"INVALID_NEW_ORDER_EPOCH\"\n );\n\n // Update orderEpoch\n orderEpoch[makerAddress][senderAddress] = newOrderEpoch;\n emit CancelUpTo(\n makerAddress,\n senderAddress,\n newOrderEpoch\n );\n }\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrder(\n Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n nonReentrant\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n return fillResults;\n }\n\n /// @dev After calling, the order can not be filled anymore.\n /// Throws if order is invalid or sender does not have permission to cancel.\n /// @param order Order to cancel. Order must be OrderStatus.FILLABLE.\n function cancelOrder(Order memory order)\n public\n nonReentrant\n {\n cancelOrderInternal(order);\n }\n\n /// @dev Gets information about an order: status, hash, and amount filled.\n /// @param order Order to gather information on.\n /// @return OrderInfo Information about the order and its state.\n /// See LibOrder.OrderInfo for a complete description.\n function getOrderInfo(Order memory order)\n public\n view\n returns (OrderInfo memory orderInfo)\n {\n // Compute the order hash\n orderInfo.orderHash = getOrderHash(order);\n\n // Fetch filled amount\n orderInfo.orderTakerAssetFilledAmount = filled[orderInfo.orderHash];\n\n // If order.makerAssetAmount is zero, we also reject the order.\n // While the Exchange contract handles them correctly, they create\n // edge cases in the supporting infrastructure because they have\n // an 'infinite' price when computed by a simple division.\n if (order.makerAssetAmount == 0) {\n orderInfo.orderStatus = uint8(OrderStatus.INVALID_MAKER_ASSET_AMOUNT);\n return orderInfo;\n }\n\n // If order.takerAssetAmount is zero, then the order will always\n // be considered filled because 0 == takerAssetAmount == orderTakerAssetFilledAmount\n // Instead of distinguishing between unfilled and filled zero taker\n // amount orders, we choose not to support them.\n if (order.takerAssetAmount == 0) {\n orderInfo.orderStatus = uint8(OrderStatus.INVALID_TAKER_ASSET_AMOUNT);\n return orderInfo;\n }\n\n // Validate order availability\n if (orderInfo.orderTakerAssetFilledAmount >= order.takerAssetAmount) {\n orderInfo.orderStatus = uint8(OrderStatus.FULLY_FILLED);\n return orderInfo;\n }\n\n // Validate order expiration\n // solhint-disable-next-line not-rely-on-time\n if (block.timestamp >= order.expirationTimeSeconds) {\n orderInfo.orderStatus = uint8(OrderStatus.EXPIRED);\n return orderInfo;\n }\n\n // Check if order has been cancelled\n if (cancelled[orderInfo.orderHash]) {\n orderInfo.orderStatus = uint8(OrderStatus.CANCELLED);\n return orderInfo;\n }\n if (orderEpoch[order.makerAddress][order.senderAddress] > order.salt) {\n orderInfo.orderStatus = uint8(OrderStatus.CANCELLED);\n return orderInfo;\n }\n\n // All other statuses are ruled out: order is Fillable\n orderInfo.orderStatus = uint8(OrderStatus.FILLABLE);\n return orderInfo;\n }\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderInternal(\n Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n // Fetch order info\n OrderInfo memory orderInfo = getOrderInfo(order);\n\n // Fetch taker address\n address takerAddress = getCurrentContextAddress();\n \n // Assert that the order is fillable by taker\n assertFillableOrder(\n order,\n orderInfo,\n takerAddress,\n signature\n );\n \n // Get amount of takerAsset to fill\n uint256 remainingTakerAssetAmount = safeSub(order.takerAssetAmount, orderInfo.orderTakerAssetFilledAmount);\n uint256 takerAssetFilledAmount = min256(takerAssetFillAmount, remainingTakerAssetAmount);\n\n // Validate context\n assertValidFill(\n order,\n orderInfo,\n takerAssetFillAmount,\n takerAssetFilledAmount,\n fillResults.makerAssetFilledAmount\n );\n\n // Compute proportional fill amounts\n fillResults = calculateFillResults(order, takerAssetFilledAmount);\n\n // Update exchange internal state\n updateFilledState(\n order,\n takerAddress,\n orderInfo.orderHash,\n orderInfo.orderTakerAssetFilledAmount,\n fillResults\n );\n \n // Settle order\n settleOrder(\n order,\n takerAddress,\n fillResults\n );\n\n return fillResults;\n }\n\n /// @dev After calling, the order can not be filled anymore.\n /// Throws if order is invalid or sender does not have permission to cancel.\n /// @param order Order to cancel. Order must be OrderStatus.FILLABLE.\n function cancelOrderInternal(Order memory order)\n internal\n {\n // Fetch current order status\n OrderInfo memory orderInfo = getOrderInfo(order);\n\n // Validate context\n assertValidCancel(order, orderInfo);\n\n // Perform cancel\n updateCancelledState(order, orderInfo.orderHash);\n }\n\n /// @dev Updates state with results of a fill order.\n /// @param order that was filled.\n /// @param takerAddress Address of taker who filled the order.\n /// @param orderTakerAssetFilledAmount Amount of order already filled.\n function updateFilledState(\n Order memory order,\n address takerAddress,\n bytes32 orderHash,\n uint256 orderTakerAssetFilledAmount,\n FillResults memory fillResults\n )\n internal\n {\n // Update state\n filled[orderHash] = safeAdd(orderTakerAssetFilledAmount, fillResults.takerAssetFilledAmount);\n\n // Log order\n emit Fill(\n order.makerAddress,\n order.feeRecipientAddress,\n takerAddress,\n msg.sender,\n fillResults.makerAssetFilledAmount,\n fillResults.takerAssetFilledAmount,\n fillResults.makerFeePaid,\n fillResults.takerFeePaid,\n orderHash,\n order.makerAssetData,\n order.takerAssetData\n );\n }\n\n /// @dev Updates state with results of cancelling an order.\n /// State is only updated if the order is currently fillable.\n /// Otherwise, updating state would have no effect.\n /// @param order that was cancelled.\n /// @param orderHash Hash of order that was cancelled.\n function updateCancelledState(\n Order memory order,\n bytes32 orderHash\n )\n internal\n {\n // Perform cancel\n cancelled[orderHash] = true;\n\n // Log cancel\n emit Cancel(\n order.makerAddress,\n order.feeRecipientAddress,\n msg.sender,\n orderHash,\n order.makerAssetData,\n order.takerAssetData\n );\n }\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAddress Address of order taker.\n /// @param signature Proof that the orders was created by its maker.\n function assertFillableOrder(\n Order memory order,\n OrderInfo memory orderInfo,\n address takerAddress,\n bytes memory signature\n )\n internal\n view\n {\n // An order can only be filled if its status is FILLABLE.\n require(\n orderInfo.orderStatus == uint8(OrderStatus.FILLABLE),\n \"ORDER_UNFILLABLE\"\n );\n \n // Validate sender is allowed to fill this order\n if (order.senderAddress != address(0)) {\n require(\n order.senderAddress == msg.sender,\n \"INVALID_SENDER\"\n );\n }\n \n // Validate taker is allowed to fill this order\n if (order.takerAddress != address(0)) {\n require(\n order.takerAddress == takerAddress,\n \"INVALID_TAKER\"\n );\n }\n \n // Validate Maker signature (check only if first time seen)\n if (orderInfo.orderTakerAssetFilledAmount == 0) {\n require(\n isValidSignature(\n orderInfo.orderHash,\n order.makerAddress,\n signature\n ),\n \"INVALID_ORDER_SIGNATURE\"\n );\n }\n }\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAssetFillAmount Desired amount of order to fill by taker.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @param makerAssetFilledAmount Amount of makerAsset that will be transfered.\n function assertValidFill(\n Order memory order,\n OrderInfo memory orderInfo,\n uint256 takerAssetFillAmount, // TODO: use FillResults\n uint256 takerAssetFilledAmount,\n uint256 makerAssetFilledAmount\n )\n internal\n view\n {\n // Revert if fill amount is invalid\n // TODO: reconsider necessity for v2.1\n require(\n takerAssetFillAmount != 0,\n \"INVALID_TAKER_AMOUNT\"\n );\n \n // Make sure taker does not pay more than desired amount\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n takerAssetFilledAmount <= takerAssetFillAmount,\n \"TAKER_OVERPAY\"\n );\n \n // Make sure order is not overfilled\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n safeAdd(orderInfo.orderTakerAssetFilledAmount, takerAssetFilledAmount) <= order.takerAssetAmount,\n \"ORDER_OVERFILL\"\n );\n \n // Make sure order is filled at acceptable price.\n // The order has an implied price from the makers perspective:\n // order price = order.makerAssetAmount / order.takerAssetAmount\n // i.e. the number of makerAsset maker is paying per takerAsset. The\n // maker is guaranteed to get this price or a better (lower) one. The\n // actual price maker is getting in this fill is:\n // fill price = makerAssetFilledAmount / takerAssetFilledAmount\n // We need `fill price <= order price` for the fill to be fair to maker.\n // This amounts to:\n // makerAssetFilledAmount order.makerAssetAmount\n // ------------------------ <= -----------------------\n // takerAssetFilledAmount order.takerAssetAmount\n // or, equivalently:\n // makerAssetFilledAmount * order.takerAssetAmount <=\n // order.makerAssetAmount * takerAssetFilledAmount\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n safeMul(makerAssetFilledAmount, order.takerAssetAmount)\n <= \n safeMul(order.makerAssetAmount, takerAssetFilledAmount),\n \"INVALID_FILL_PRICE\"\n );\n }\n\n /// @dev Validates context for cancelOrder. Succeeds or throws.\n /// @param order to be cancelled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n function assertValidCancel(\n Order memory order,\n OrderInfo memory orderInfo\n )\n internal\n view\n {\n // Ensure order is valid\n // An order can only be cancelled if its status is FILLABLE.\n require(\n orderInfo.orderStatus == uint8(OrderStatus.FILLABLE),\n \"ORDER_UNFILLABLE\"\n );\n\n // Validate sender is allowed to cancel this order\n if (order.senderAddress != address(0)) {\n require(\n order.senderAddress == msg.sender,\n \"INVALID_SENDER\"\n );\n }\n\n // Validate transaction signed by maker\n address makerAddress = getCurrentContextAddress();\n require(\n order.makerAddress == makerAddress,\n \"INVALID_MAKER\"\n );\n }\n\n /// @dev Calculates amounts filled and fees paid by maker and taker.\n /// @param order to be filled.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function calculateFillResults(\n Order memory order,\n uint256 takerAssetFilledAmount\n )\n internal\n pure\n returns (FillResults memory fillResults)\n {\n // Compute proportional transfer amounts\n fillResults.takerAssetFilledAmount = takerAssetFilledAmount;\n fillResults.makerAssetFilledAmount = safeGetPartialAmountFloor(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.makerAssetAmount\n );\n fillResults.makerFeePaid = safeGetPartialAmountFloor(\n fillResults.makerAssetFilledAmount,\n order.makerAssetAmount,\n order.makerFee\n );\n fillResults.takerFeePaid = safeGetPartialAmountFloor(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.takerFee\n );\n\n return fillResults;\n }\n\n /// @dev Settles an order by transferring assets between counterparties.\n /// @param order Order struct containing order specifications.\n /// @param takerAddress Address selling takerAsset and buying makerAsset.\n /// @param fillResults Amounts to be filled and fees paid by maker and taker.\n function settleOrder(\n LibOrder.Order memory order,\n address takerAddress,\n LibFillResults.FillResults memory fillResults\n )\n private\n {\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n dispatchTransferFrom(\n order.makerAssetData,\n order.makerAddress,\n takerAddress,\n fillResults.makerAssetFilledAmount\n );\n dispatchTransferFrom(\n order.takerAssetData,\n takerAddress,\n order.makerAddress,\n fillResults.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n zrxAssetData,\n order.makerAddress,\n order.feeRecipientAddress,\n fillResults.makerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n order.feeRecipientAddress,\n fillResults.takerFeePaid\n );\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinMatchOrders.sol": "/*\n Copyright 2018 ZeroEx Intl.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n http://www.apache.org/licenses/LICENSE-2.0\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MMatchOrders.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\n\n\ncontract MixinMatchOrders is\n ReentrancyGuard,\n LibConstants,\n LibMath,\n MAssetProxyDispatcher,\n MExchangeCore,\n MMatchOrders,\n MTransactions\n{\n /// @dev Match two complementary orders that have a profitable spread.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the left order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftSignature Proof that order was created by the left maker.\n /// @param rightSignature Proof that order was created by the right maker.\n /// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.\n function matchOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n bytes memory leftSignature,\n bytes memory rightSignature\n )\n public\n nonReentrant\n returns (LibFillResults.MatchedFillResults memory matchedFillResults)\n {\n // We assume that rightOrder.takerAssetData == leftOrder.makerAssetData and rightOrder.makerAssetData == leftOrder.takerAssetData.\n // If this assumption isn't true, the match will fail at signature validation.\n rightOrder.makerAssetData = leftOrder.takerAssetData;\n rightOrder.takerAssetData = leftOrder.makerAssetData;\n\n // Get left & right order info\n LibOrder.OrderInfo memory leftOrderInfo = getOrderInfo(leftOrder);\n LibOrder.OrderInfo memory rightOrderInfo = getOrderInfo(rightOrder);\n\n // Fetch taker address\n address takerAddress = getCurrentContextAddress();\n \n // Either our context is valid or we revert\n assertFillableOrder(\n leftOrder,\n leftOrderInfo,\n takerAddress,\n leftSignature\n );\n assertFillableOrder(\n rightOrder,\n rightOrderInfo,\n takerAddress,\n rightSignature\n );\n assertValidMatch(leftOrder, rightOrder);\n\n // Compute proportional fill amounts\n matchedFillResults = calculateMatchedFillResults(\n leftOrder,\n rightOrder,\n leftOrderInfo.orderTakerAssetFilledAmount,\n rightOrderInfo.orderTakerAssetFilledAmount\n );\n\n // Validate fill contexts\n assertValidFill(\n leftOrder,\n leftOrderInfo,\n matchedFillResults.left.takerAssetFilledAmount,\n matchedFillResults.left.takerAssetFilledAmount,\n matchedFillResults.left.makerAssetFilledAmount\n );\n assertValidFill(\n rightOrder,\n rightOrderInfo,\n matchedFillResults.right.takerAssetFilledAmount,\n matchedFillResults.right.takerAssetFilledAmount,\n matchedFillResults.right.makerAssetFilledAmount\n );\n \n // Update exchange state\n updateFilledState(\n leftOrder,\n takerAddress,\n leftOrderInfo.orderHash,\n leftOrderInfo.orderTakerAssetFilledAmount,\n matchedFillResults.left\n );\n updateFilledState(\n rightOrder,\n takerAddress,\n rightOrderInfo.orderHash,\n rightOrderInfo.orderTakerAssetFilledAmount,\n matchedFillResults.right\n );\n\n // Settle matched orders. Succeeds or throws.\n settleMatchedOrders(\n leftOrder,\n rightOrder,\n takerAddress,\n matchedFillResults\n );\n\n return matchedFillResults;\n }\n\n /// @dev Validates context for matchOrders. Succeeds or throws.\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n function assertValidMatch(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder\n )\n internal\n pure\n {\n // Make sure there is a profitable spread.\n // There is a profitable spread iff the cost per unit bought (OrderA.MakerAmount/OrderA.TakerAmount) for each order is greater\n // than the profit per unit sold of the matched order (OrderB.TakerAmount/OrderB.MakerAmount).\n // This is satisfied by the equations below:\n // <leftOrder.makerAssetAmount> / <leftOrder.takerAssetAmount> >= <rightOrder.takerAssetAmount> / <rightOrder.makerAssetAmount>\n // AND\n // <rightOrder.makerAssetAmount> / <rightOrder.takerAssetAmount> >= <leftOrder.takerAssetAmount> / <leftOrder.makerAssetAmount>\n // These equations can be combined to get the following:\n require(\n safeMul(leftOrder.makerAssetAmount, rightOrder.makerAssetAmount) >=\n safeMul(leftOrder.takerAssetAmount, rightOrder.takerAssetAmount),\n \"NEGATIVE_SPREAD_REQUIRED\"\n );\n }\n\n /// @dev Calculates fill amounts for the matched orders.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the leftOrder order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftOrderTakerAssetFilledAmount Amount of left order already filled.\n /// @param rightOrderTakerAssetFilledAmount Amount of right order already filled.\n /// @param matchedFillResults Amounts to fill and fees to pay by maker and taker of matched orders.\n function calculateMatchedFillResults(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n uint256 leftOrderTakerAssetFilledAmount,\n uint256 rightOrderTakerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.MatchedFillResults memory matchedFillResults)\n {\n // Derive maker asset amounts for left & right orders, given store taker assert amounts\n uint256 leftTakerAssetAmountRemaining = safeSub(leftOrder.takerAssetAmount, leftOrderTakerAssetFilledAmount);\n uint256 leftMakerAssetAmountRemaining = safeGetPartialAmountFloor(\n leftOrder.makerAssetAmount,\n leftOrder.takerAssetAmount,\n leftTakerAssetAmountRemaining\n );\n uint256 rightTakerAssetAmountRemaining = safeSub(rightOrder.takerAssetAmount, rightOrderTakerAssetFilledAmount);\n uint256 rightMakerAssetAmountRemaining = safeGetPartialAmountFloor(\n rightOrder.makerAssetAmount,\n rightOrder.takerAssetAmount,\n rightTakerAssetAmountRemaining\n );\n\n // Calculate fill results for maker and taker assets: at least one order will be fully filled.\n // The maximum amount the left maker can buy is `leftTakerAssetAmountRemaining`\n // The maximum amount the right maker can sell is `rightMakerAssetAmountRemaining`\n // We have two distinct cases for calculating the fill results:\n // Case 1.\n // If the left maker can buy more than the right maker can sell, then only the right order is fully filled.\n // If the left maker can buy exactly what the right maker can sell, then both orders are fully filled.\n // Case 2.\n // If the left maker cannot buy more than the right maker can sell, then only the left order is fully filled.\n if (leftTakerAssetAmountRemaining >= rightMakerAssetAmountRemaining) {\n // Case 1: Right order is fully filled\n matchedFillResults.right.makerAssetFilledAmount = rightMakerAssetAmountRemaining;\n matchedFillResults.right.takerAssetFilledAmount = rightTakerAssetAmountRemaining;\n matchedFillResults.left.takerAssetFilledAmount = matchedFillResults.right.makerAssetFilledAmount;\n // Round down to ensure the maker's exchange rate does not exceed the price specified by the order. \n // We favor the maker when the exchange rate must be rounded.\n matchedFillResults.left.makerAssetFilledAmount = safeGetPartialAmountFloor(\n leftOrder.makerAssetAmount,\n leftOrder.takerAssetAmount,\n matchedFillResults.left.takerAssetFilledAmount\n );\n } else {\n // Case 2: Left order is fully filled\n matchedFillResults.left.makerAssetFilledAmount = leftMakerAssetAmountRemaining;\n matchedFillResults.left.takerAssetFilledAmount = leftTakerAssetAmountRemaining;\n matchedFillResults.right.makerAssetFilledAmount = matchedFillResults.left.takerAssetFilledAmount;\n // Round up to ensure the maker's exchange rate does not exceed the price specified by the order.\n // We favor the maker when the exchange rate must be rounded.\n matchedFillResults.right.takerAssetFilledAmount = safeGetPartialAmountCeil(\n rightOrder.takerAssetAmount,\n rightOrder.makerAssetAmount,\n matchedFillResults.right.makerAssetFilledAmount\n );\n }\n\n // Calculate amount given to taker\n matchedFillResults.leftMakerAssetSpreadAmount = safeSub(\n matchedFillResults.left.makerAssetFilledAmount,\n matchedFillResults.right.takerAssetFilledAmount\n );\n\n // Compute fees for left order\n matchedFillResults.left.makerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.left.makerAssetFilledAmount,\n leftOrder.makerAssetAmount,\n leftOrder.makerFee\n );\n matchedFillResults.left.takerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.left.takerAssetFilledAmount,\n leftOrder.takerAssetAmount,\n leftOrder.takerFee\n );\n\n // Compute fees for right order\n matchedFillResults.right.makerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.right.makerAssetFilledAmount,\n rightOrder.makerAssetAmount,\n rightOrder.makerFee\n );\n matchedFillResults.right.takerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.right.takerAssetFilledAmount,\n rightOrder.takerAssetAmount,\n rightOrder.takerFee\n );\n\n // Return fill results\n return matchedFillResults;\n }\n\n /// @dev Settles matched order by transferring appropriate funds between order makers, taker, and fee recipient.\n /// @param leftOrder First matched order.\n /// @param rightOrder Second matched order.\n /// @param takerAddress Address that matched the orders. The taker receives the spread between orders as profit.\n /// @param matchedFillResults Struct holding amounts to transfer between makers, taker, and fee recipients.\n function settleMatchedOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n address takerAddress,\n LibFillResults.MatchedFillResults memory matchedFillResults\n )\n private\n {\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n // Order makers and taker\n dispatchTransferFrom(\n leftOrder.makerAssetData,\n leftOrder.makerAddress,\n rightOrder.makerAddress,\n matchedFillResults.right.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n rightOrder.makerAssetData,\n rightOrder.makerAddress,\n leftOrder.makerAddress,\n matchedFillResults.left.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n leftOrder.makerAssetData,\n leftOrder.makerAddress,\n takerAddress,\n matchedFillResults.leftMakerAssetSpreadAmount\n );\n\n // Maker fees\n dispatchTransferFrom(\n zrxAssetData,\n leftOrder.makerAddress,\n leftOrder.feeRecipientAddress,\n matchedFillResults.left.makerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n rightOrder.makerAddress,\n rightOrder.feeRecipientAddress,\n matchedFillResults.right.makerFeePaid\n );\n\n // Taker fees\n if (leftOrder.feeRecipientAddress == rightOrder.feeRecipientAddress) {\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n leftOrder.feeRecipientAddress,\n safeAdd(\n matchedFillResults.left.takerFeePaid,\n matchedFillResults.right.takerFeePaid\n )\n );\n } else {\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n leftOrder.feeRecipientAddress,\n matchedFillResults.left.takerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n rightOrder.feeRecipientAddress,\n matchedFillResults.right.takerFeePaid\n );\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinSignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./interfaces/IWallet.sol\";\nimport \"./interfaces/IValidator.sol\";\n\n\ncontract MixinSignatureValidator is\n ReentrancyGuard,\n MSignatureValidator,\n MTransactions\n{\n using LibBytes for bytes;\n \n // Mapping of hash => signer => signed\n mapping (bytes32 => mapping (address => bool)) public preSigned;\n\n // Mapping of signer => validator => approved\n mapping (address => mapping (address => bool)) public allowedValidators;\n\n /// @dev Approves a hash on-chain using any valid signature type.\n /// After presigning a hash, the preSign signature type will become valid for that hash and signer.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n function preSign(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external\n {\n if (signerAddress != msg.sender) {\n require(\n isValidSignature(\n hash,\n signerAddress,\n signature\n ),\n \"INVALID_SIGNATURE\"\n );\n }\n preSigned[hash][signerAddress] = true;\n }\n\n /// @dev Approves/unnapproves a Validator contract to verify signatures on signer's behalf.\n /// @param validatorAddress Address of Validator contract.\n /// @param approval Approval or disapproval of Validator contract.\n function setSignatureValidatorApproval(\n address validatorAddress,\n bool approval\n )\n external\n nonReentrant\n {\n address signerAddress = getCurrentContextAddress();\n allowedValidators[signerAddress][validatorAddress] = approval;\n emit SignatureValidatorApproval(\n signerAddress,\n validatorAddress,\n approval\n );\n }\n\n /// @dev Verifies that a hash has been signed by the given signer.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes memory signature\n )\n public\n view\n returns (bool isValid)\n {\n require(\n signature.length > 0,\n \"LENGTH_GREATER_THAN_0_REQUIRED\"\n );\n\n // Pop last byte off of signature byte array.\n uint8 signatureTypeRaw = uint8(signature.popLastByte());\n\n // Ensure signature is supported\n require(\n signatureTypeRaw < uint8(SignatureType.NSignatureTypes),\n \"SIGNATURE_UNSUPPORTED\"\n );\n\n SignatureType signatureType = SignatureType(signatureTypeRaw);\n\n // Variables are not scoped in Solidity.\n uint8 v;\n bytes32 r;\n bytes32 s;\n address recovered;\n\n // Always illegal signature.\n // This is always an implicit option since a signer can create a\n // signature array with invalid type or length. We may as well make\n // it an explicit option. This aids testing and analysis. It is\n // also the initialization value for the enum type.\n if (signatureType == SignatureType.Illegal) {\n revert(\"SIGNATURE_ILLEGAL\");\n\n // Always invalid signature.\n // Like Illegal, this is always implicitly available and therefore\n // offered explicitly. It can be implicitly created by providing\n // a correctly formatted but incorrect signature.\n } else if (signatureType == SignatureType.Invalid) {\n require(\n signature.length == 0,\n \"LENGTH_0_REQUIRED\"\n );\n isValid = false;\n return isValid;\n\n // Signature using EIP712\n } else if (signatureType == SignatureType.EIP712) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n hash,\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n\n // Signed using web3.eth_sign\n } else if (signatureType == SignatureType.EthSign) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n keccak256(abi.encodePacked(\n \"\\x19Ethereum Signed Message:\\n32\",\n hash\n )),\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n\n // Signature verified by wallet contract.\n // If used with an order, the maker of the order is the wallet contract.\n } else if (signatureType == SignatureType.Wallet) {\n isValid = isValidWalletSignature(\n hash,\n signerAddress,\n signature\n );\n return isValid;\n\n // Signature verified by validator contract.\n // If used with an order, the maker of the order can still be an EOA.\n // A signature using this type should be encoded as:\n // | Offset | Length | Contents |\n // | 0x00 | x | Signature to validate |\n // | 0x00 + x | 20 | Address of validator contract |\n // | 0x14 + x | 1 | Signature type is always \"\\x06\" |\n } else if (signatureType == SignatureType.Validator) {\n // Pop last 20 bytes off of signature byte array.\n address validatorAddress = signature.popLast20Bytes();\n \n // Ensure signer has approved validator.\n if (!allowedValidators[signerAddress][validatorAddress]) {\n return false;\n }\n isValid = isValidValidatorSignature(\n validatorAddress,\n hash,\n signerAddress,\n signature\n );\n return isValid;\n\n // Signer signed hash previously using the preSign function.\n } else if (signatureType == SignatureType.PreSigned) {\n isValid = preSigned[hash][signerAddress];\n return isValid;\n }\n\n // Anything else is illegal (We do not return false because\n // the signature may actually be valid, just not in a format\n // that we currently support. In this case returning false\n // may lead the caller to incorrectly believe that the\n // signature was invalid.)\n revert(\"SIGNATURE_UNSUPPORTED\");\n }\n\n /// @dev Verifies signature using logic defined by Wallet contract.\n /// @param hash Any 32 byte hash.\n /// @param walletAddress Address that should have signed the given hash\n /// and defines its own signature verification method.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if signature is valid for given wallet..\n function isValidWalletSignature(\n bytes32 hash,\n address walletAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid)\n {\n bytes memory calldata = abi.encodeWithSelector(\n IWallet(walletAddress).isValidSignature.selector,\n hash,\n signature\n );\n assembly {\n let cdStart := add(calldata, 32)\n let success := staticcall(\n gas, // forward all gas\n walletAddress, // address of Wallet contract\n cdStart, // pointer to start of input\n mload(calldata), // length of input\n cdStart, // write output over input\n 32 // output size is 32 bytes\n )\n\n switch success\n case 0 {\n // Revert with `Error(\"WALLET_ERROR\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000c57414c4c45545f4552524f5200000000000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n case 1 {\n // Signature is valid if call did not revert and returned true\n isValid := mload(cdStart)\n }\n }\n return isValid;\n }\n\n /// @dev Verifies signature using logic defined by Validator contract.\n /// @param validatorAddress Address of validator contract.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidValidatorSignature(\n address validatorAddress,\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid)\n {\n bytes memory calldata = abi.encodeWithSelector(\n IValidator(signerAddress).isValidSignature.selector,\n hash,\n signerAddress,\n signature\n );\n assembly {\n let cdStart := add(calldata, 32)\n let success := staticcall(\n gas, // forward all gas\n validatorAddress, // address of Validator contract\n cdStart, // pointer to start of input\n mload(calldata), // length of input\n cdStart, // write output over input\n 32 // output size is 32 bytes\n )\n\n switch success\n case 0 {\n // Revert with `Error(\"VALIDATOR_ERROR\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f56414c494441544f525f4552524f5200000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n case 1 {\n // Signature is valid if call did not revert and returned true\n isValid := mload(cdStart)\n }\n }\n return isValid;\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinTransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\nimport \"./libs/LibExchangeErrors.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./libs/LibEIP712.sol\";\n\n\ncontract MixinTransactions is\n LibEIP712,\n MSignatureValidator,\n MTransactions\n{\n // Mapping of transaction hash => executed\n // This prevents transactions from being executed more than once.\n mapping (bytes32 => bool) public transactions;\n\n // Address of current transaction signer\n address public currentContextAddress;\n\n /// @dev Executes an exchange method call in the context of signer.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @param signature Proof of signer transaction by signer.\n function executeTransaction(\n uint256 salt,\n address signerAddress,\n bytes data,\n bytes signature\n )\n external\n {\n // Prevent reentrancy\n require(\n currentContextAddress == address(0),\n \"REENTRANCY_ILLEGAL\"\n );\n\n bytes32 transactionHash = hashEIP712Message(hashZeroExTransaction(\n salt,\n signerAddress,\n data\n ));\n\n // Validate transaction has not been executed\n require(\n !transactions[transactionHash],\n \"INVALID_TX_HASH\"\n );\n\n // Transaction always valid if signer is sender of transaction\n if (signerAddress != msg.sender) {\n // Validate signature\n require(\n isValidSignature(\n transactionHash,\n signerAddress,\n signature\n ),\n \"INVALID_TX_SIGNATURE\"\n );\n\n // Set the current transaction signer\n currentContextAddress = signerAddress;\n }\n\n // Execute transaction\n transactions[transactionHash] = true;\n require(\n address(this).delegatecall(data),\n \"FAILED_EXECUTION\"\n );\n\n // Reset current transaction signer if it was previously updated\n if (signerAddress != msg.sender) {\n currentContextAddress = address(0);\n }\n }\n\n /// @dev Calculates EIP712 hash of the Transaction.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @return EIP712 hash of the Transaction.\n function hashZeroExTransaction(\n uint256 salt,\n address signerAddress,\n bytes memory data\n )\n internal\n pure\n returns (bytes32 result)\n {\n bytes32 schemaHash = EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH;\n bytes32 dataHash = keccak256(data);\n\n // Assembly for more efficiently computing:\n // keccak256(abi.encodePacked(\n // EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH,\n // salt,\n // bytes32(signerAddress),\n // keccak256(data)\n // ));\n\n assembly {\n // Load free memory pointer\n let memPtr := mload(64)\n\n mstore(memPtr, schemaHash) // hash of schema\n mstore(add(memPtr, 32), salt) // salt\n mstore(add(memPtr, 64), and(signerAddress, 0xffffffffffffffffffffffffffffffffffffffff)) // signerAddress\n mstore(add(memPtr, 96), dataHash) // hash of data\n\n // Compute hash\n result := keccak256(memPtr, 128)\n }\n return result;\n }\n\n /// @dev The current function will be called in the context of this address (either 0x transaction signer or `msg.sender`).\n /// If calling a fill function, this address will represent the taker.\n /// If calling a cancel function, this address will represent the maker.\n /// @return Signer of 0x transaction if entry point is `executeTransaction`.\n /// `msg.sender` if entry point is any other function.\n function getCurrentContextAddress()\n internal\n view\n returns (address)\n {\n address currentContextAddress_ = currentContextAddress;\n address contextAddress = currentContextAddress_ == address(0) ? msg.sender : currentContextAddress_;\n return contextAddress;\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./libs/LibAbiEncoder.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MWrapperFunctions.sol\";\n\n\ncontract MixinWrapperFunctions is\n ReentrancyGuard,\n LibMath,\n LibFillResults,\n LibAbiEncoder,\n MExchangeCore,\n MWrapperFunctions\n{\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n nonReentrant\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrKillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n return fillResults;\n }\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (FillResults memory fillResults)\n {\n // ABI encode calldata for `fillOrder`\n bytes memory fillOrderCalldata = abiEncodeFillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n\n // Delegate to `fillOrder` and handle any exceptions gracefully\n assembly {\n let success := delegatecall(\n gas, // forward all gas\n address, // call address of this contract\n add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes)\n mload(fillOrderCalldata), // length of input\n fillOrderCalldata, // write output over input\n 128 // output size is 128 bytes\n )\n if success {\n mstore(fillResults, mload(fillOrderCalldata))\n mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32)))\n mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64)))\n mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96)))\n }\n }\n // fillResults values will be 0 by default if call was unsuccessful\n return fillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrKill.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrKillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrKillOrderInternal(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrders(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n bytes memory takerAssetData = orders[0].takerAssetData;\n \n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being sold by taker is the same for each order.\n // Rather than passing this in as calldata, we use the takerAssetData from the first order in all later orders.\n orders[i].takerAssetData = takerAssetData;\n\n // Calculate the remaining amount of takerAsset to sell\n uint256 remainingTakerAssetFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= takerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory takerAssetData = orders[0].takerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being sold by taker is the same for each order.\n // Rather than passing this in as calldata, we use the takerAssetData from the first order in all later orders.\n orders[i].takerAssetData = takerAssetData;\n\n // Calculate the remaining amount of takerAsset to sell\n uint256 remainingTakerAssetFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= takerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerAsset is bought by taker.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrders(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // Rather than passing this in as calldata, we copy the makerAssetData from the first order onto all later orders.\n orders[i].makerAssetData = makerAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n if (totalFillResults.makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // Rather than passing this in as calldata, we copy the makerAssetData from the first order onto all later orders.\n orders[i].makerAssetData = makerAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n if (totalFillResults.makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously cancels multiple orders in a single transaction.\n /// @param orders Array of order specifications.\n function batchCancelOrders(LibOrder.Order[] memory orders)\n public\n nonReentrant\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n cancelOrderInternal(orders[i]);\n }\n }\n\n /// @dev Fetches information for all passed in orders.\n /// @param orders Array of order specifications.\n /// @return Array of OrderInfo instances that correspond to each order.\n function getOrdersInfo(LibOrder.Order[] memory orders)\n public\n view\n returns (LibOrder.OrderInfo[] memory)\n {\n uint256 ordersLength = orders.length;\n LibOrder.OrderInfo[] memory ordersInfo = new LibOrder.OrderInfo[](ordersLength);\n for (uint256 i = 0; i != ordersLength; i++) {\n ordersInfo[i] = getOrderInfo(orders[i]);\n }\n return ordersInfo;\n }\n\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n require(\n fillResults.takerAssetFilledAmount == takerAssetFillAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return fillResults;\n }\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IAssetProxyDispatcher {\n\n /// @dev Registers an asset proxy to its asset proxy id.\n /// Once an asset proxy is registered, it cannot be unregistered.\n /// @param assetProxy Address of new asset proxy to register.\n function registerAssetProxy(address assetProxy)\n external;\n\n /// @dev Gets an asset proxy.\n /// @param assetProxyId Id of the asset proxy.\n /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered.\n function getAssetProxy(bytes4 assetProxyId)\n external\n view\n returns (address);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IExchange.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./IExchangeCore.sol\";\nimport \"./IMatchOrders.sol\";\nimport \"./ISignatureValidator.sol\";\nimport \"./ITransactions.sol\";\nimport \"./IAssetProxyDispatcher.sol\";\nimport \"./IWrapperFunctions.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract IExchange is\n IExchangeCore,\n IMatchOrders,\n ISignatureValidator,\n ITransactions,\n IAssetProxyDispatcher,\n IWrapperFunctions\n{}\n",
- "2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IExchangeCore {\n\n /// @dev Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch\n /// and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress).\n /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled.\n function cancelOrdersUpTo(uint256 targetOrderEpoch)\n external;\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev After calling, the order can not be filled anymore.\n /// @param order Order struct containing order specifications.\n function cancelOrder(LibOrder.Order memory order)\n public;\n\n /// @dev Gets information about an order: status, hash, and amount filled.\n /// @param order Order to gather information on.\n /// @return OrderInfo Information about the order and its state.\n /// See LibOrder.OrderInfo for a complete description.\n function getOrderInfo(LibOrder.Order memory order)\n public\n view\n returns (LibOrder.OrderInfo memory orderInfo);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IMatchOrders {\n\n /// @dev Match two complementary orders that have a profitable spread.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the left order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftSignature Proof that order was created by the left maker.\n /// @param rightSignature Proof that order was created by the right maker.\n /// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.\n function matchOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n bytes memory leftSignature,\n bytes memory rightSignature\n )\n public\n returns (LibFillResults.MatchedFillResults memory matchedFillResults);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract ISignatureValidator {\n\n /// @dev Approves a hash on-chain using any valid signature type.\n /// After presigning a hash, the preSign signature type will become valid for that hash and signer.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n function preSign(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external;\n \n /// @dev Approves/unnapproves a Validator contract to verify signatures on signer's behalf.\n /// @param validatorAddress Address of Validator contract.\n /// @param approval Approval or disapproval of Validator contract.\n function setSignatureValidatorApproval(\n address validatorAddress,\n bool approval\n )\n external;\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signerAddress Address of signer.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes memory signature\n )\n public\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/ITransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\n\ncontract ITransactions {\n\n /// @dev Executes an exchange method call in the context of signer.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @param signature Proof of signer transaction by signer.\n function executeTransaction(\n uint256 salt,\n address signerAddress,\n bytes data,\n bytes signature\n )\n external;\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IValidator {\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IWallet.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IWallet {\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n bytes signature\n )\n external\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IWrapperFunctions {\n\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrKill.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrKillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrders(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerAsset is bought by taker.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrders(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously cancels multiple orders in a single transaction.\n /// @param orders Array of order specifications.\n function batchCancelOrders(LibOrder.Order[] memory orders)\n public;\n\n /// @dev Fetches information for all passed in orders\n /// @param orders Array of order specifications.\n /// @return Array of OrderInfo instances that correspond to each order.\n function getOrdersInfo(LibOrder.Order[] memory orders)\n public\n view\n returns (LibOrder.OrderInfo[] memory);\n}\n",
- "2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./LibOrder.sol\";\n\n\ncontract LibAbiEncoder {\n\n /// @dev ABI encodes calldata for `fillOrder`.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return ABI encoded calldata for `fillOrder`.\n function abiEncodeFillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n pure\n returns (bytes memory fillOrderCalldata)\n {\n // We need to call MExchangeCore.fillOrder using a delegatecall in\n // assembly so that we can intercept a call that throws. For this, we\n // need the input encoded in memory in the Ethereum ABIv2 format [1].\n\n // | Area | Offset | Length | Contents |\n // | -------- |--------|---------|-------------------------------------------- |\n // | Header | 0x00 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 0x00 | | 1. offset to order (*) |\n // | | 0x20 | | 2. takerAssetFillAmount |\n // | | 0x40 | | 3. offset to signature (*) |\n // | Data | | 12 * 32 | order: |\n // | | 0x000 | | 1. senderAddress |\n // | | 0x020 | | 2. makerAddress |\n // | | 0x040 | | 3. takerAddress |\n // | | 0x060 | | 4. feeRecipientAddress |\n // | | 0x080 | | 5. makerAssetAmount |\n // | | 0x0A0 | | 6. takerAssetAmount |\n // | | 0x0C0 | | 7. makerFeeAmount |\n // | | 0x0E0 | | 8. takerFeeAmount |\n // | | 0x100 | | 9. expirationTimeSeconds |\n // | | 0x120 | | 10. salt |\n // | | 0x140 | | 11. Offset to makerAssetData (*) |\n // | | 0x160 | | 12. Offset to takerAssetData (*) |\n // | | 0x180 | 32 | makerAssetData Length |\n // | | 0x1A0 | ** | makerAssetData Contents |\n // | | 0x1C0 | 32 | takerAssetData Length |\n // | | 0x1E0 | ** | takerAssetData Contents |\n // | | 0x200 | 32 | signature Length |\n // | | 0x220 | ** | signature Contents |\n\n // * Offsets are calculated from the beginning of the current area: Header, Params, Data:\n // An offset stored in the Params area is calculated from the beginning of the Params section.\n // An offset stored in the Data area is calculated from the beginning of the Data section.\n\n // ** The length of dynamic array contents are stored in the field immediately preceeding the contents.\n\n // [1]: https://solidity.readthedocs.io/en/develop/abi-spec.html\n\n assembly {\n\n // Areas below may use the following variables:\n // 1. <area>Start -- Start of this area in memory\n // 2. <area>End -- End of this area in memory. This value may\n // be precomputed (before writing contents),\n // or it may be computed as contents are written.\n // 3. <area>Offset -- Current offset into area. If an area's End\n // is precomputed, this variable tracks the\n // offsets of contents as they are written.\n\n /////// Setup Header Area ///////\n // Load free memory pointer\n fillOrderCalldata := mload(0x40)\n // bytes4(keccak256(\"fillOrder((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),uint256,bytes)\"))\n // = 0xb4be83d5\n // Leave 0x20 bytes to store the length\n mstore(add(fillOrderCalldata, 0x20), 0xb4be83d500000000000000000000000000000000000000000000000000000000)\n let headerAreaEnd := add(fillOrderCalldata, 0x24)\n\n /////// Setup Params Area ///////\n // This area is preallocated and written to later.\n // This is because we need to fill in offsets that have not yet been calculated.\n let paramsAreaStart := headerAreaEnd\n let paramsAreaEnd := add(paramsAreaStart, 0x60)\n let paramsAreaOffset := paramsAreaStart\n\n /////// Setup Data Area ///////\n let dataAreaStart := paramsAreaEnd\n let dataAreaEnd := dataAreaStart\n\n // Offset from the source data we're reading from\n let sourceOffset := order\n // arrayLenBytes and arrayLenWords track the length of a dynamically-allocated bytes array.\n let arrayLenBytes := 0\n let arrayLenWords := 0\n\n /////// Write order Struct ///////\n // Write memory location of Order, relative to the start of the\n // parameter list, then increment the paramsAreaOffset respectively.\n mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))\n paramsAreaOffset := add(paramsAreaOffset, 0x20)\n\n // Write values for each field in the order\n // It would be nice to use a loop, but we save on gas by writing\n // the stores sequentially.\n mstore(dataAreaEnd, mload(sourceOffset)) // makerAddress\n mstore(add(dataAreaEnd, 0x20), mload(add(sourceOffset, 0x20))) // takerAddress\n mstore(add(dataAreaEnd, 0x40), mload(add(sourceOffset, 0x40))) // feeRecipientAddress\n mstore(add(dataAreaEnd, 0x60), mload(add(sourceOffset, 0x60))) // senderAddress\n mstore(add(dataAreaEnd, 0x80), mload(add(sourceOffset, 0x80))) // makerAssetAmount\n mstore(add(dataAreaEnd, 0xA0), mload(add(sourceOffset, 0xA0))) // takerAssetAmount\n mstore(add(dataAreaEnd, 0xC0), mload(add(sourceOffset, 0xC0))) // makerFeeAmount\n mstore(add(dataAreaEnd, 0xE0), mload(add(sourceOffset, 0xE0))) // takerFeeAmount\n mstore(add(dataAreaEnd, 0x100), mload(add(sourceOffset, 0x100))) // expirationTimeSeconds\n mstore(add(dataAreaEnd, 0x120), mload(add(sourceOffset, 0x120))) // salt\n mstore(add(dataAreaEnd, 0x140), mload(add(sourceOffset, 0x140))) // Offset to makerAssetData\n mstore(add(dataAreaEnd, 0x160), mload(add(sourceOffset, 0x160))) // Offset to takerAssetData\n dataAreaEnd := add(dataAreaEnd, 0x180)\n sourceOffset := add(sourceOffset, 0x180)\n\n // Write offset to <order.makerAssetData>\n mstore(add(dataAreaStart, mul(10, 0x20)), sub(dataAreaEnd, dataAreaStart))\n\n // Calculate length of <order.makerAssetData>\n sourceOffset := mload(add(order, 0x140)) // makerAssetData\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of <order.makerAssetData>\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of <order.makerAssetData>\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n // Write offset to <order.takerAssetData>\n mstore(add(dataAreaStart, mul(11, 0x20)), sub(dataAreaEnd, dataAreaStart))\n\n // Calculate length of <order.takerAssetData>\n sourceOffset := mload(add(order, 0x160)) // takerAssetData\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of <order.takerAssetData>\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of <order.takerAssetData>\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n /////// Write takerAssetFillAmount ///////\n mstore(paramsAreaOffset, takerAssetFillAmount)\n paramsAreaOffset := add(paramsAreaOffset, 0x20)\n\n /////// Write signature ///////\n // Write offset to paramsArea\n mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))\n\n // Calculate length of signature\n sourceOffset := signature\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of signature\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of signature\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n // Set length of calldata\n mstore(fillOrderCalldata, sub(dataAreaEnd, add(fillOrderCalldata, 0x20)))\n\n // Increment free memory pointer\n mstore(0x40, dataAreaEnd)\n }\n\n return fillOrderCalldata;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibConstants.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\n// solhint-disable max-line-length\ncontract LibConstants {\n \n // Asset data for ZRX token. Used for fee transfers.\n // @TODO: Hardcode constant when we deploy. Currently \n // not constant to make testing easier.\n\n // The proxyId for ZRX_ASSET_DATA is bytes4(keccak256(\"ERC20Token(address)\")) = 0xf47261b0\n \n // Kovan ZRX address is 0x6ff6c0ff1d68b964901f986d4c9fa3ac68346570.\n // The ABI encoded proxyId and address is 0xf47261b00000000000000000000000006ff6c0ff1d68b964901f986d4c9fa3ac68346570\n // bytes constant public ZRX_ASSET_DATA = \"\\xf4\\x72\\x61\\xb0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x6f\\xf6\\xc0\\xff\\x1d\\x68\\xb9\\x64\\x90\\x1f\\x98\\x6d\\x4c\\x9f\\xa3\\xac\\x68\\x34\\x65\\x70\";\n \n // Mainnet ZRX address is 0xe41d2489571d322189246dafa5ebde1f4699f498.\n // The ABI encoded proxyId and address is 0xf47261b0000000000000000000000000e41d2489571d322189246dafa5ebde1f4699f498\n // bytes constant public ZRX_ASSET_DATA = \"\\xf4\\x72\\x61\\xb0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xe4\\x1d\\x24\\x89\\x57\\x1d\\x32\\x21\\x89\\x24\\x6d\\xaf\\xa5\\xeb\\xde\\x1f\\x46\\x99\\xf4\\x98\";\n \n // solhint-disable-next-line var-name-mixedcase\n bytes public ZRX_ASSET_DATA;\n\n // @TODO: Remove when we deploy.\n constructor (bytes memory zrxAssetData)\n public\n {\n ZRX_ASSET_DATA = zrxAssetData;\n }\n}\n// solhint-enable max-line-length\n",
- "2.0.0/protocol/Exchange/libs/LibEIP712.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract LibEIP712 {\n\n // EIP191 header for EIP712 prefix\n string constant internal EIP191_HEADER = \"\\x19\\x01\";\n\n // EIP712 Domain Name value\n string constant internal EIP712_DOMAIN_NAME = \"0x Protocol\";\n\n // EIP712 Domain Version value\n string constant internal EIP712_DOMAIN_VERSION = \"2\";\n\n // Hash of the EIP712 Domain Separator Schema\n bytes32 constant internal EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"EIP712Domain(\",\n \"string name,\",\n \"string version,\",\n \"address verifyingContract\",\n \")\"\n ));\n\n // Hash of the EIP712 Domain Separator data\n // solhint-disable-next-line var-name-mixedcase\n bytes32 public EIP712_DOMAIN_HASH;\n\n constructor ()\n public\n {\n EIP712_DOMAIN_HASH = keccak256(abi.encodePacked(\n EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH,\n keccak256(bytes(EIP712_DOMAIN_NAME)),\n keccak256(bytes(EIP712_DOMAIN_VERSION)),\n bytes32(address(this))\n ));\n }\n\n /// @dev Calculates EIP712 encoding for a hash struct in this EIP712 Domain.\n /// @param hashStruct The EIP712 hash struct.\n /// @return EIP712 hash applied to this EIP712 Domain.\n function hashEIP712Message(bytes32 hashStruct)\n internal\n view\n returns (bytes32 result)\n {\n bytes32 eip712DomainHash = EIP712_DOMAIN_HASH;\n\n // Assembly for more efficient computing:\n // keccak256(abi.encodePacked(\n // EIP191_HEADER,\n // EIP712_DOMAIN_HASH,\n // hashStruct \n // ));\n\n assembly {\n // Load free memory pointer\n let memPtr := mload(64)\n\n mstore(memPtr, 0x1901000000000000000000000000000000000000000000000000000000000000) // EIP191 header\n mstore(add(memPtr, 2), eip712DomainHash) // EIP712 domain hash\n mstore(add(memPtr, 34), hashStruct) // Hash of struct\n\n // Compute hash\n result := keccak256(memPtr, 66)\n }\n return result;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\n// solhint-disable\npragma solidity 0.4.24;\n\n\n/// @dev This contract documents the revert reasons used in the Exchange contract.\n/// This contract is intended to serve as a reference, but is not actually used for efficiency reasons.\ncontract LibExchangeErrors {\n\n /// Order validation errors ///\n string constant ORDER_UNFILLABLE = \"ORDER_UNFILLABLE\"; // Order cannot be filled.\n string constant INVALID_MAKER = \"INVALID_MAKER\"; // Invalid makerAddress.\n string constant INVALID_TAKER = \"INVALID_TAKER\"; // Invalid takerAddress.\n string constant INVALID_SENDER = \"INVALID_SENDER\"; // Invalid `msg.sender`.\n string constant INVALID_ORDER_SIGNATURE = \"INVALID_ORDER_SIGNATURE\"; // Signature validation failed. \n \n /// fillOrder validation errors ///\n string constant INVALID_TAKER_AMOUNT = \"INVALID_TAKER_AMOUNT\"; // takerAssetFillAmount cannot equal 0.\n string constant ROUNDING_ERROR = \"ROUNDING_ERROR\"; // Rounding error greater than 0.1% of takerAssetFillAmount. \n \n /// Signature validation errors ///\n string constant INVALID_SIGNATURE = \"INVALID_SIGNATURE\"; // Signature validation failed. \n string constant SIGNATURE_ILLEGAL = \"SIGNATURE_ILLEGAL\"; // Signature type is illegal.\n string constant SIGNATURE_UNSUPPORTED = \"SIGNATURE_UNSUPPORTED\"; // Signature type unsupported.\n \n /// cancelOrdersUptTo errors ///\n string constant INVALID_NEW_ORDER_EPOCH = \"INVALID_NEW_ORDER_EPOCH\"; // Specified salt must be greater than or equal to existing orderEpoch.\n\n /// fillOrKillOrder errors ///\n string constant COMPLETE_FILL_FAILED = \"COMPLETE_FILL_FAILED\"; // Desired takerAssetFillAmount could not be completely filled. \n\n /// matchOrders errors ///\n string constant NEGATIVE_SPREAD_REQUIRED = \"NEGATIVE_SPREAD_REQUIRED\"; // Matched orders must have a negative spread.\n\n /// Transaction errors ///\n string constant REENTRANCY_ILLEGAL = \"REENTRANCY_ILLEGAL\"; // Recursive reentrancy is not allowed. \n string constant INVALID_TX_HASH = \"INVALID_TX_HASH\"; // Transaction has already been executed. \n string constant INVALID_TX_SIGNATURE = \"INVALID_TX_SIGNATURE\"; // Signature validation failed. \n string constant FAILED_EXECUTION = \"FAILED_EXECUTION\"; // Transaction execution failed. \n \n /// registerAssetProxy errors ///\n string constant ASSET_PROXY_ALREADY_EXISTS = \"ASSET_PROXY_ALREADY_EXISTS\"; // AssetProxy with same id already exists.\n\n /// dispatchTransferFrom errors ///\n string constant ASSET_PROXY_DOES_NOT_EXIST = \"ASSET_PROXY_DOES_NOT_EXIST\"; // No assetProxy registered at given id.\n string constant TRANSFER_FAILED = \"TRANSFER_FAILED\"; // Asset transfer unsuccesful.\n\n /// Length validation errors ///\n string constant LENGTH_GREATER_THAN_0_REQUIRED = \"LENGTH_GREATER_THAN_0_REQUIRED\"; // Byte array must have a length greater than 0.\n string constant LENGTH_GREATER_THAN_3_REQUIRED = \"LENGTH_GREATER_THAN_3_REQUIRED\"; // Byte array must have a length greater than 3.\n string constant LENGTH_0_REQUIRED = \"LENGTH_0_REQUIRED\"; // Byte array must have a length of 0.\n string constant LENGTH_65_REQUIRED = \"LENGTH_65_REQUIRED\"; // Byte array must have a length of 65.\n}\n",
- "2.0.0/protocol/Exchange/libs/LibFillResults.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract LibFillResults is\n SafeMath\n{\n struct FillResults {\n uint256 makerAssetFilledAmount; // Total amount of makerAsset(s) filled.\n uint256 takerAssetFilledAmount; // Total amount of takerAsset(s) filled.\n uint256 makerFeePaid; // Total amount of ZRX paid by maker(s) to feeRecipient(s).\n uint256 takerFeePaid; // Total amount of ZRX paid by taker to feeRecipients(s).\n }\n\n struct MatchedFillResults {\n FillResults left; // Amounts filled and fees paid of left order.\n FillResults right; // Amounts filled and fees paid of right order.\n uint256 leftMakerAssetSpreadAmount; // Spread between price of left and right order, denominated in the left order's makerAsset, paid to taker.\n }\n\n /// @dev Adds properties of both FillResults instances.\n /// Modifies the first FillResults instance specified.\n /// @param totalFillResults Fill results instance that will be added onto.\n /// @param singleFillResults Fill results instance that will be added to totalFillResults.\n function addFillResults(FillResults memory totalFillResults, FillResults memory singleFillResults)\n internal\n pure\n {\n totalFillResults.makerAssetFilledAmount = safeAdd(totalFillResults.makerAssetFilledAmount, singleFillResults.makerAssetFilledAmount);\n totalFillResults.takerAssetFilledAmount = safeAdd(totalFillResults.takerAssetFilledAmount, singleFillResults.takerAssetFilledAmount);\n totalFillResults.makerFeePaid = safeAdd(totalFillResults.makerFeePaid, singleFillResults.makerFeePaid);\n totalFillResults.takerFeePaid = safeAdd(totalFillResults.takerFeePaid, singleFillResults.takerFeePaid);\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibMath.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract LibMath is\n SafeMath\n{\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// Reverts if rounding error is >= 0.1%\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded down.\n function safeGetPartialAmountFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n require(\n !isRoundingErrorFloor(\n numerator,\n denominator,\n target\n ),\n \"ROUNDING_ERROR\"\n );\n \n partialAmount = safeDiv(\n safeMul(numerator, target),\n denominator\n );\n return partialAmount;\n }\n\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// Reverts if rounding error is >= 0.1%\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded up.\n function safeGetPartialAmountCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n require(\n !isRoundingErrorCeil(\n numerator,\n denominator,\n target\n ),\n \"ROUNDING_ERROR\"\n );\n \n // safeDiv computes `floor(a / b)`. We use the identity (a, b integer):\n // ceil(a / b) = floor((a + b - 1) / b)\n // To implement `ceil(a / b)` using safeDiv.\n partialAmount = safeDiv(\n safeAdd(\n safeMul(numerator, target),\n safeSub(denominator, 1)\n ),\n denominator\n );\n return partialAmount;\n }\n\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded down.\n function getPartialAmountFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n partialAmount = safeDiv(\n safeMul(numerator, target),\n denominator\n );\n return partialAmount;\n }\n \n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded up.\n function getPartialAmountCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n // safeDiv computes `floor(a / b)`. We use the identity (a, b integer):\n // ceil(a / b) = floor((a + b - 1) / b)\n // To implement `ceil(a / b)` using safeDiv.\n partialAmount = safeDiv(\n safeAdd(\n safeMul(numerator, target),\n safeSub(denominator, 1)\n ),\n denominator\n );\n return partialAmount;\n }\n \n /// @dev Checks if rounding error >= 0.1% when rounding down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to multiply with numerator/denominator.\n /// @return Rounding error is present.\n function isRoundingErrorFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (bool isError)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n \n // The absolute rounding error is the difference between the rounded\n // value and the ideal value. The relative rounding error is the\n // absolute rounding error divided by the absolute value of the\n // ideal value. This is undefined when the ideal value is zero.\n //\n // The ideal value is `numerator * target / denominator`.\n // Let's call `numerator * target % denominator` the remainder.\n // The absolute error is `remainder / denominator`.\n //\n // When the ideal value is zero, we require the absolute error to\n // be zero. Fortunately, this is always the case. The ideal value is\n // zero iff `numerator == 0` and/or `target == 0`. In this case the\n // remainder and absolute error are also zero. \n if (target == 0 || numerator == 0) {\n return false;\n }\n \n // Otherwise, we want the relative rounding error to be strictly\n // less than 0.1%.\n // The relative error is `remainder / (numerator * target)`.\n // We want the relative error less than 1 / 1000:\n // remainder / (numerator * denominator) < 1 / 1000\n // or equivalently:\n // 1000 * remainder < numerator * target\n // so we have a rounding error iff:\n // 1000 * remainder >= numerator * target\n uint256 remainder = mulmod(\n target,\n numerator,\n denominator\n );\n isError = safeMul(1000, remainder) >= safeMul(numerator, target);\n return isError;\n }\n \n /// @dev Checks if rounding error >= 0.1% when rounding up.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to multiply with numerator/denominator.\n /// @return Rounding error is present.\n function isRoundingErrorCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (bool isError)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n \n // See the comments in `isRoundingError`.\n if (target == 0 || numerator == 0) {\n // When either is zero, the ideal value and rounded value are zero\n // and there is no rounding error. (Although the relative error\n // is undefined.)\n return false;\n }\n // Compute remainder as before\n uint256 remainder = mulmod(\n target,\n numerator,\n denominator\n );\n remainder = safeSub(denominator, remainder) % denominator;\n isError = safeMul(1000, remainder) >= safeMul(numerator, target);\n return isError;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibOrder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./LibEIP712.sol\";\n\n\ncontract LibOrder is\n LibEIP712\n{\n // Hash for the EIP712 Order Schema\n bytes32 constant internal EIP712_ORDER_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"Order(\",\n \"address makerAddress,\",\n \"address takerAddress,\",\n \"address feeRecipientAddress,\",\n \"address senderAddress,\",\n \"uint256 makerAssetAmount,\",\n \"uint256 takerAssetAmount,\",\n \"uint256 makerFee,\",\n \"uint256 takerFee,\",\n \"uint256 expirationTimeSeconds,\",\n \"uint256 salt,\",\n \"bytes makerAssetData,\",\n \"bytes takerAssetData\",\n \")\"\n ));\n\n // A valid order remains fillable until it is expired, fully filled, or cancelled.\n // An order's state is unaffected by external factors, like account balances.\n enum OrderStatus {\n INVALID, // Default value\n INVALID_MAKER_ASSET_AMOUNT, // Order does not have a valid maker asset amount\n INVALID_TAKER_ASSET_AMOUNT, // Order does not have a valid taker asset amount\n FILLABLE, // Order is fillable\n EXPIRED, // Order has already expired\n FULLY_FILLED, // Order is fully filled\n CANCELLED // Order has been cancelled\n }\n\n // solhint-disable max-line-length\n struct Order {\n address makerAddress; // Address that created the order. \n address takerAddress; // Address that is allowed to fill the order. If set to 0, any address is allowed to fill the order. \n address feeRecipientAddress; // Address that will recieve fees when order is filled. \n address senderAddress; // Address that is allowed to call Exchange contract methods that affect this order. If set to 0, any address is allowed to call these methods.\n uint256 makerAssetAmount; // Amount of makerAsset being offered by maker. Must be greater than 0. \n uint256 takerAssetAmount; // Amount of takerAsset being bid on by maker. Must be greater than 0. \n uint256 makerFee; // Amount of ZRX paid to feeRecipient by maker when order is filled. If set to 0, no transfer of ZRX from maker to feeRecipient will be attempted.\n uint256 takerFee; // Amount of ZRX paid to feeRecipient by taker when order is filled. If set to 0, no transfer of ZRX from taker to feeRecipient will be attempted.\n uint256 expirationTimeSeconds; // Timestamp in seconds at which order expires. \n uint256 salt; // Arbitrary number to facilitate uniqueness of the order's hash. \n bytes makerAssetData; // Encoded data that can be decoded by a specified proxy contract when transferring makerAsset. The last byte references the id of this proxy.\n bytes takerAssetData; // Encoded data that can be decoded by a specified proxy contract when transferring takerAsset. The last byte references the id of this proxy.\n }\n // solhint-enable max-line-length\n\n struct OrderInfo {\n uint8 orderStatus; // Status that describes order's validity and fillability.\n bytes32 orderHash; // EIP712 hash of the order (see LibOrder.getOrderHash).\n uint256 orderTakerAssetFilledAmount; // Amount of order that has already been filled.\n }\n\n /// @dev Calculates Keccak-256 hash of the order.\n /// @param order The order structure.\n /// @return Keccak-256 EIP712 hash of the order.\n function getOrderHash(Order memory order)\n internal\n view\n returns (bytes32 orderHash)\n {\n orderHash = hashEIP712Message(hashOrder(order));\n return orderHash;\n }\n\n /// @dev Calculates EIP712 hash of the order.\n /// @param order The order structure.\n /// @return EIP712 hash of the order.\n function hashOrder(Order memory order)\n internal\n pure\n returns (bytes32 result)\n {\n bytes32 schemaHash = EIP712_ORDER_SCHEMA_HASH;\n bytes32 makerAssetDataHash = keccak256(order.makerAssetData);\n bytes32 takerAssetDataHash = keccak256(order.takerAssetData);\n\n // Assembly for more efficiently computing:\n // keccak256(abi.encodePacked(\n // EIP712_ORDER_SCHEMA_HASH,\n // bytes32(order.makerAddress),\n // bytes32(order.takerAddress),\n // bytes32(order.feeRecipientAddress),\n // bytes32(order.senderAddress),\n // order.makerAssetAmount,\n // order.takerAssetAmount,\n // order.makerFee,\n // order.takerFee,\n // order.expirationTimeSeconds,\n // order.salt,\n // keccak256(order.makerAssetData),\n // keccak256(order.takerAssetData)\n // ));\n\n assembly {\n // Calculate memory addresses that will be swapped out before hashing\n let pos1 := sub(order, 32)\n let pos2 := add(order, 320)\n let pos3 := add(order, 352)\n\n // Backup\n let temp1 := mload(pos1)\n let temp2 := mload(pos2)\n let temp3 := mload(pos3)\n \n // Hash in place\n mstore(pos1, schemaHash)\n mstore(pos2, makerAssetDataHash)\n mstore(pos3, takerAssetDataHash)\n result := keccak256(pos1, 416)\n \n // Restore\n mstore(pos1, temp1)\n mstore(pos2, temp2)\n mstore(pos3, temp3)\n }\n return result;\n }\n}\n",
- "2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAssetProxyDispatcher.sol\";\n\n\ncontract MAssetProxyDispatcher is\n IAssetProxyDispatcher\n{\n // Logs registration of new asset proxy\n event AssetProxyRegistered(\n bytes4 id, // Id of new registered AssetProxy.\n address assetProxy // Address of new registered AssetProxy.\n );\n\n /// @dev Forwards arguments to assetProxy and calls `transferFrom`. Either succeeds or throws.\n /// @param assetData Byte array encoded for the asset.\n /// @param from Address to transfer token from.\n /// @param to Address to transfer token to.\n /// @param amount Amount of token to transfer.\n function dispatchTransferFrom(\n bytes memory assetData,\n address from,\n address to,\n uint256 amount\n )\n internal;\n}\n",
- "2.0.0/protocol/Exchange/mixins/MExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IExchangeCore.sol\";\n\n\ncontract MExchangeCore is\n IExchangeCore\n{\n // Fill event is emitted whenever an order is filled.\n event Fill(\n address indexed makerAddress, // Address that created the order. \n address indexed feeRecipientAddress, // Address that received fees.\n address takerAddress, // Address that filled the order.\n address senderAddress, // Address that called the Exchange contract (msg.sender).\n uint256 makerAssetFilledAmount, // Amount of makerAsset sold by maker and bought by taker. \n uint256 takerAssetFilledAmount, // Amount of takerAsset sold by taker and bought by maker.\n uint256 makerFeePaid, // Amount of ZRX paid to feeRecipient by maker.\n uint256 takerFeePaid, // Amount of ZRX paid to feeRecipient by taker.\n bytes32 indexed orderHash, // EIP712 hash of order (see LibOrder.getOrderHash).\n bytes makerAssetData, // Encoded data specific to makerAsset. \n bytes takerAssetData // Encoded data specific to takerAsset.\n );\n\n // Cancel event is emitted whenever an individual order is cancelled.\n event Cancel(\n address indexed makerAddress, // Address that created the order. \n address indexed feeRecipientAddress, // Address that would have recieved fees if order was filled. \n address senderAddress, // Address that called the Exchange contract (msg.sender).\n bytes32 indexed orderHash, // EIP712 hash of order (see LibOrder.getOrderHash).\n bytes makerAssetData, // Encoded data specific to makerAsset. \n bytes takerAssetData // Encoded data specific to takerAsset.\n );\n\n // CancelUpTo event is emitted whenever `cancelOrdersUpTo` is executed succesfully.\n event CancelUpTo(\n address indexed makerAddress, // Orders cancelled must have been created by this address.\n address indexed senderAddress, // Orders cancelled must have a `senderAddress` equal to this address.\n uint256 orderEpoch // Orders with specified makerAddress and senderAddress with a salt less than this value are considered cancelled.\n );\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev After calling, the order can not be filled anymore.\n /// @param order Order struct containing order specifications.\n function cancelOrderInternal(LibOrder.Order memory order)\n internal;\n\n /// @dev Updates state with results of a fill order.\n /// @param order that was filled.\n /// @param takerAddress Address of taker who filled the order.\n /// @param orderTakerAssetFilledAmount Amount of order already filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function updateFilledState(\n LibOrder.Order memory order,\n address takerAddress,\n bytes32 orderHash,\n uint256 orderTakerAssetFilledAmount,\n LibFillResults.FillResults memory fillResults\n )\n internal;\n\n /// @dev Updates state with results of cancelling an order.\n /// State is only updated if the order is currently fillable.\n /// Otherwise, updating state would have no effect.\n /// @param order that was cancelled.\n /// @param orderHash Hash of order that was cancelled.\n function updateCancelledState(\n LibOrder.Order memory order,\n bytes32 orderHash\n )\n internal;\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAddress Address of order taker.\n /// @param signature Proof that the orders was created by its maker.\n function assertFillableOrder(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo,\n address takerAddress,\n bytes memory signature\n )\n internal\n view;\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo Status, orderHash, and amount already filled of order.\n /// @param takerAssetFillAmount Desired amount of order to fill by taker.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @param makerAssetFilledAmount Amount of makerAsset that will be transfered.\n function assertValidFill(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo,\n uint256 takerAssetFillAmount,\n uint256 takerAssetFilledAmount,\n uint256 makerAssetFilledAmount\n )\n internal\n view;\n\n /// @dev Validates context for cancelOrder. Succeeds or throws.\n /// @param order to be cancelled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n function assertValidCancel(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo\n )\n internal\n view;\n\n /// @dev Calculates amounts filled and fees paid by maker and taker.\n /// @param order to be filled.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function calculateFillResults(\n LibOrder.Order memory order,\n uint256 takerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.FillResults memory fillResults);\n\n}\n",
- "2.0.0/protocol/Exchange/mixins/MMatchOrders.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IMatchOrders.sol\";\n\n\ncontract MMatchOrders is\n IMatchOrders\n{\n /// @dev Validates context for matchOrders. Succeeds or throws.\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n function assertValidMatch(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder\n )\n internal\n pure;\n\n /// @dev Calculates fill amounts for the matched orders.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the leftOrder order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftOrderTakerAssetFilledAmount Amount of left order already filled.\n /// @param rightOrderTakerAssetFilledAmount Amount of right order already filled.\n /// @param matchedFillResults Amounts to fill and fees to pay by maker and taker of matched orders.\n function calculateMatchedFillResults(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n uint256 leftOrderTakerAssetFilledAmount,\n uint256 rightOrderTakerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.MatchedFillResults memory matchedFillResults);\n\n}\n",
- "2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/ISignatureValidator.sol\";\n\n\ncontract MSignatureValidator is\n ISignatureValidator\n{\n event SignatureValidatorApproval(\n address indexed signerAddress, // Address that approves or disapproves a contract to verify signatures.\n address indexed validatorAddress, // Address of signature validator contract.\n bool approved // Approval or disapproval of validator contract.\n );\n\n // Allowed signature types.\n enum SignatureType {\n Illegal, // 0x00, default value\n Invalid, // 0x01\n EIP712, // 0x02\n EthSign, // 0x03\n Wallet, // 0x04\n Validator, // 0x05\n PreSigned, // 0x06\n NSignatureTypes // 0x07, number of signature types. Always leave at end.\n }\n\n /// @dev Verifies signature using logic defined by Wallet contract.\n /// @param hash Any 32 byte hash.\n /// @param walletAddress Address that should have signed the given hash\n /// and defines its own signature verification method.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidWalletSignature(\n bytes32 hash,\n address walletAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid);\n\n /// @dev Verifies signature using logic defined by Validator contract.\n /// @param validatorAddress Address of validator contract.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidValidatorSignature(\n address validatorAddress,\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/mixins/MTransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\nimport \"../interfaces/ITransactions.sol\";\n\n\ncontract MTransactions is\n ITransactions\n{\n // Hash for the EIP712 ZeroEx Transaction Schema\n bytes32 constant internal EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"ZeroExTransaction(\",\n \"uint256 salt,\",\n \"address signerAddress,\",\n \"bytes data\",\n \")\"\n ));\n\n /// @dev Calculates EIP712 hash of the Transaction.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @return EIP712 hash of the Transaction.\n function hashZeroExTransaction(\n uint256 salt,\n address signerAddress,\n bytes memory data\n )\n internal\n pure\n returns (bytes32 result);\n\n /// @dev The current function will be called in the context of this address (either 0x transaction signer or `msg.sender`).\n /// If calling a fill function, this address will represent the taker.\n /// If calling a cancel function, this address will represent the maker.\n /// @return Signer of 0x transaction if entry point is `executeTransaction`.\n /// `msg.sender` if entry point is any other function.\n function getCurrentContextAddress()\n internal\n view\n returns (address);\n}\n",
- "2.0.0/protocol/Exchange/mixins/MWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IWrapperFunctions.sol\";\n\n\ncontract MWrapperFunctions is \n IWrapperFunctions\n{\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n}\n",
- "2.0.0/test/DummyERC20Token/DummyERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"../../tokens/ERC20Token/MintableERC20Token.sol\";\n\n\ncontract DummyERC20Token is \n Ownable,\n MintableERC20Token\n{\n string public name;\n string public symbol;\n uint256 public decimals;\n uint256 public constant MAX_MINT_AMOUNT = 10000000000000000000000;\n\n constructor (\n string _name,\n string _symbol,\n uint256 _decimals,\n uint256 _totalSupply\n )\n public\n {\n name = _name;\n symbol = _symbol;\n decimals = _decimals;\n _totalSupply = _totalSupply;\n balances[msg.sender] = _totalSupply;\n }\n\n /// @dev Sets the balance of target address\n /// @param _target Address or which balance will be updated\n /// @param _value New balance of target address\n function setBalance(address _target, uint256 _value)\n external\n onlyOwner\n {\n uint256 currBalance = balances[_target];\n if (_value < currBalance) {\n _totalSupply = safeSub(_totalSupply, safeSub(currBalance, _value));\n } else {\n _totalSupply = safeAdd(_totalSupply, safeSub(_value, currBalance));\n }\n balances[_target] = _value;\n }\n\n /// @dev Mints new tokens for sender\n /// @param _value Amount of tokens to mint\n function mint(uint256 _value)\n external\n {\n require(\n _value <= MAX_MINT_AMOUNT,\n \"VALUE_TOO_LARGE\"\n );\n\n _mint(msg.sender, _value);\n }\n}\n",
- "2.0.0/test/DummyERC721Token/DummyERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../tokens/ERC721Token/MintableERC721Token.sol\";\nimport \"../../utils/Ownable/Ownable.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract DummyERC721Token is\n Ownable,\n MintableERC721Token\n{\n string public name;\n string public symbol;\n\n constructor (\n string _name,\n string _symbol\n )\n public\n {\n name = _name;\n symbol = _symbol;\n }\n\n /// @dev Function to mint a new token\n /// Reverts if the given token ID already exists\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _tokenId ID of the token to be minted by the msg.sender \n function mint(address _to, uint256 _tokenId)\n external\n {\n _mint(_to, _tokenId);\n }\n\n /// @dev Function to burn a token\n /// Reverts if the given token ID doesn't exist or not called by contract owner\n /// @param _owner Owner of token with given token ID\n /// @param _tokenId ID of the token to be burned by the msg.sender\n function burn(address _owner, uint256 _tokenId)\n external\n onlyOwner\n {\n _burn(_owner, _tokenId);\n }\n}\n",
- "2.0.0/tokens/ERC20Token/ERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IERC20Token.sol\";\n\n\ncontract ERC20Token is\n IERC20Token\n{\n mapping (address => uint256) internal balances;\n mapping (address => mapping (address => uint256)) internal allowed;\n\n uint256 internal _totalSupply;\n\n /// @dev send `value` token to `to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transfer(address _to, uint256 _value)\n external\n returns (bool)\n {\n require(\n balances[msg.sender] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[msg.sender] -= _value;\n balances[_to] += _value;\n\n emit Transfer(\n msg.sender,\n _to,\n _value\n );\n\n return true;\n }\n\n /// @dev send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool)\n {\n require(\n balances[_from] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n allowed[_from][msg.sender] >= _value,\n \"ERC20_INSUFFICIENT_ALLOWANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[_to] += _value;\n balances[_from] -= _value;\n allowed[_from][msg.sender] -= _value;\n \n emit Transfer(\n _from,\n _to,\n _value\n );\n \n return true;\n }\n\n /// @dev `msg.sender` approves `_spender` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Always true if the call has enough gas to complete execution\n function approve(address _spender, uint256 _value)\n external\n returns (bool)\n {\n allowed[msg.sender][_spender] = _value;\n emit Approval(\n msg.sender,\n _spender,\n _value\n );\n return true;\n }\n\n /// @dev Query total supply of token\n /// @return Total supply of token\n function totalSupply()\n external\n view\n returns (uint256)\n {\n return _totalSupply;\n }\n\n /// @dev Query the balance of owner\n /// @param _owner The address from which the balance will be retrieved\n /// @return Balance of owner\n function balanceOf(address _owner)\n external\n view\n returns (uint256)\n {\n return balances[_owner];\n }\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender)\n external\n view\n returns (uint256)\n {\n return allowed[_owner][_spender];\n }\n}\n",
- "2.0.0/tokens/ERC20Token/IERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC20Token {\n\n // solhint-disable no-simple-event-func-name\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 _value\n );\n\n event Approval(\n address indexed _owner,\n address indexed _spender,\n uint256 _value\n );\n\n /// @dev send `value` token to `to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transfer(address _to, uint256 _value)\n external\n returns (bool);\n\n /// @dev send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool);\n \n /// @dev `msg.sender` approves `_spender` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Always true if the call has enough gas to complete execution\n function approve(address _spender, uint256 _value)\n external\n returns (bool);\n\n /// @dev Query total supply of token\n /// @return Total supply of token\n function totalSupply()\n external\n view\n returns (uint256);\n \n /// @param _owner The address from which the balance will be retrieved\n /// @return Balance of owner\n function balanceOf(address _owner)\n external\n view\n returns (uint256);\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender)\n external\n view\n returns (uint256);\n}\n",
- "2.0.0/tokens/ERC20Token/MintableERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/SafeMath/SafeMath.sol\";\nimport \"./UnlimitedAllowanceERC20Token.sol\";\n\n\ncontract MintableERC20Token is \n SafeMath,\n UnlimitedAllowanceERC20Token\n{\n /// @dev Mints new tokens\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _value Amount of tokens to mint\n function _mint(address _to, uint256 _value)\n internal\n {\n balances[_to] = safeAdd(_value, balances[_to]);\n _totalSupply = safeAdd(_totalSupply, _value);\n\n emit Transfer(\n address(0),\n _to,\n _value\n );\n }\n\n /// @dev Mints new tokens\n /// @param _owner Owner of tokens that will be burned\n /// @param _value Amount of tokens to burn\n function _burn(address _owner, uint256 _value)\n internal\n {\n balances[_owner] = safeSub(balances[_owner], _value);\n _totalSupply = safeSub(_totalSupply, _value);\n\n emit Transfer(\n _owner,\n address(0),\n _value\n );\n }\n}\n",
- "2.0.0/tokens/ERC20Token/UnlimitedAllowanceERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../ERC20Token/ERC20Token.sol\";\n\n\ncontract UnlimitedAllowanceERC20Token is\n ERC20Token\n{\n uint256 constant internal MAX_UINT = 2**256 - 1;\n\n /// @dev ERC20 transferFrom, modified such that an allowance of MAX_UINT represents an unlimited allowance. See https://github.com/ethereum/EIPs/issues/717\n /// @param _from Address to transfer from.\n /// @param _to Address to transfer to.\n /// @param _value Amount to transfer.\n /// @return Success of transfer.\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool)\n {\n uint256 allowance = allowed[_from][msg.sender];\n require(\n balances[_from] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n allowance >= _value,\n \"ERC20_INSUFFICIENT_ALLOWANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[_to] += _value;\n balances[_from] -= _value;\n if (allowance < MAX_UINT) {\n allowed[_from][msg.sender] -= _value;\n }\n\n emit Transfer(\n _from,\n _to,\n _value\n );\n\n return true;\n }\n}\n",
- "2.0.0/tokens/ERC721Token/ERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IERC721Token.sol\";\nimport \"./IERC721Receiver.sol\";\nimport \"../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract ERC721Token is\n IERC721Token,\n SafeMath\n{\n // Function selector for ERC721Receiver.onERC721Received\n // 0x150b7a02\n bytes4 constant internal ERC721_RECEIVED = bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"));\n\n // Mapping of tokenId => owner\n mapping (uint256 => address) internal owners;\n\n // Mapping of tokenId => approved address\n mapping (uint256 => address) internal approvals;\n\n // Mapping of owner => number of tokens owned\n mapping (address => uint256) internal balances;\n\n // Mapping of owner => operator => approved\n mapping (address => mapping (address => bool)) internal operatorApprovals;\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT. When transfer is complete, this function\n /// checks if `_to` is a smart contract (code size > 0). If so, it calls\n /// `onERC721Received` on `_to` and throws if the return value is not\n /// `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n /// @param _data Additional data with no specified format, sent in call to `_to`\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId,\n bytes _data\n )\n external\n {\n transferFrom(\n _from,\n _to,\n _tokenId\n );\n\n uint256 receiverCodeSize;\n assembly {\n receiverCodeSize := extcodesize(_to)\n }\n if (receiverCodeSize > 0) {\n bytes4 selector = IERC721Receiver(_to).onERC721Received(\n msg.sender,\n _from,\n _tokenId,\n _data\n );\n require(\n selector == ERC721_RECEIVED,\n \"ERC721_INVALID_SELECTOR\"\n );\n }\n }\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev This works identically to the other function with an extra data parameter,\n /// except this function just sets data to \"\".\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n external\n {\n transferFrom(\n _from,\n _to,\n _tokenId\n );\n\n uint256 receiverCodeSize;\n assembly {\n receiverCodeSize := extcodesize(_to)\n }\n if (receiverCodeSize > 0) {\n bytes4 selector = IERC721Receiver(_to).onERC721Received(\n msg.sender,\n _from,\n _tokenId,\n \"\"\n );\n require(\n selector == ERC721_RECEIVED,\n \"ERC721_INVALID_SELECTOR\"\n );\n }\n }\n\n /// @notice Change or reaffirm the approved address for an NFT\n /// @dev The zero address indicates there is no approved address.\n /// Throws unless `msg.sender` is the current NFT owner, or an authorized\n /// operator of the current owner.\n /// @param _approved The new approved NFT controller\n /// @param _tokenId The NFT to approve\n function approve(address _approved, uint256 _tokenId)\n external\n {\n address owner = ownerOf(_tokenId);\n require(\n msg.sender == owner || isApprovedForAll(owner, msg.sender),\n \"ERC721_INVALID_SENDER\"\n );\n\n approvals[_tokenId] = _approved;\n emit Approval(\n owner,\n _approved,\n _tokenId\n );\n }\n\n /// @notice Enable or disable approval for a third party (\"operator\") to manage\n /// all of `msg.sender`'s assets\n /// @dev Emits the ApprovalForAll event. The contract MUST allow\n /// multiple operators per owner.\n /// @param _operator Address to add to the set of authorized operators\n /// @param _approved True if the operator is approved, false to revoke approval\n function setApprovalForAll(address _operator, bool _approved)\n external\n {\n operatorApprovals[msg.sender][_operator] = _approved;\n emit ApprovalForAll(\n msg.sender,\n _operator,\n _approved\n );\n }\n \n /// @notice Count all NFTs assigned to an owner\n /// @dev NFTs assigned to the zero address are considered invalid, and this\n /// function throws for queries about the zero address.\n /// @param _owner An address for whom to query the balance\n /// @return The number of NFTs owned by `_owner`, possibly zero\n function balanceOf(address _owner)\n external\n view\n returns (uint256)\n {\n require(\n _owner != address(0),\n \"ERC721_ZERO_OWNER\"\n );\n return balances[_owner];\n }\n\n /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE\n /// TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE\n /// THEY MAY BE PERMANENTLY LOST\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function transferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n public\n {\n require(\n _to != address(0),\n \"ERC721_ZERO_TO_ADDRESS\"\n );\n\n address owner = ownerOf(_tokenId);\n require(\n _from == owner,\n \"ERC721_OWNER_MISMATCH\"\n );\n\n address spender = msg.sender;\n address approvedAddress = getApproved(_tokenId);\n require(\n spender == owner ||\n isApprovedForAll(owner, spender) ||\n approvedAddress == spender,\n \"ERC721_INVALID_SPENDER\"\n );\n\n if (approvedAddress != address(0)) {\n approvals[_tokenId] = address(0);\n }\n\n owners[_tokenId] = _to;\n balances[_from] = safeSub(balances[_from], 1);\n balances[_to] = safeAdd(balances[_to], 1);\n \n emit Transfer(\n _from,\n _to,\n _tokenId\n );\n }\n\n /// @notice Find the owner of an NFT\n /// @dev NFTs assigned to zero address are considered invalid, and queries\n /// about them do throw.\n /// @param _tokenId The identifier for an NFT\n /// @return The address of the owner of the NFT\n function ownerOf(uint256 _tokenId)\n public\n view\n returns (address)\n {\n address owner = owners[_tokenId];\n require(\n owner != address(0),\n \"ERC721_ZERO_OWNER\"\n );\n return owner;\n }\n\n /// @notice Get the approved address for a single NFT\n /// @dev Throws if `_tokenId` is not a valid NFT.\n /// @param _tokenId The NFT to find the approved address for\n /// @return The approved address for this NFT, or the zero address if there is none\n function getApproved(uint256 _tokenId)\n public\n view\n returns (address)\n {\n return approvals[_tokenId];\n }\n\n /// @notice Query if an address is an authorized operator for another address\n /// @param _owner The address that owns the NFTs\n /// @param _operator The address that acts on behalf of the owner\n /// @return True if `_operator` is an approved operator for `_owner`, false otherwise\n function isApprovedForAll(address _owner, address _operator)\n public\n view\n returns (bool)\n {\n return operatorApprovals[_owner][_operator];\n }\n}\n",
- "2.0.0/tokens/ERC721Token/IERC721Receiver.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC721Receiver {\n\n /// @notice Handle the receipt of an NFT\n /// @dev The ERC721 smart contract calls this function on the recipient\n /// after a `transfer`. This function MAY throw to revert and reject the\n /// transfer. Return of other than the magic value MUST result in the\n /// transaction being reverted.\n /// Note: the contract address is always the message sender.\n /// @param _operator The address which called `safeTransferFrom` function\n /// @param _from The address which previously owned the token\n /// @param _tokenId The NFT identifier which is being transferred\n /// @param _data Additional data with no specified format\n /// @return `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`\n /// unless throwing\n function onERC721Received(\n address _operator,\n address _from,\n uint256 _tokenId,\n bytes _data\n )\n external\n returns (bytes4);\n}\n",
- "2.0.0/tokens/ERC721Token/IERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC721Token {\n\n /// @dev This emits when ownership of any NFT changes by any mechanism.\n /// This event emits when NFTs are created (`from` == 0) and destroyed\n /// (`to` == 0). Exception: during contract creation, any number of NFTs\n /// may be created and assigned without emitting Transfer. At the time of\n /// any transfer, the approved address for that NFT (if any) is reset to none.\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 indexed _tokenId\n );\n\n /// @dev This emits when the approved address for an NFT is changed or\n /// reaffirmed. The zero address indicates there is no approved address.\n /// When a Transfer event emits, this also indicates that the approved\n /// address for that NFT (if any) is reset to none.\n event Approval(\n address indexed _owner,\n address indexed _approved,\n uint256 indexed _tokenId\n );\n\n /// @dev This emits when an operator is enabled or disabled for an owner.\n /// The operator can manage all NFTs of the owner.\n event ApprovalForAll(\n address indexed _owner,\n address indexed _operator,\n bool _approved\n );\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// perator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT. When transfer is complete, this function\n /// checks if `_to` is a smart contract (code size > 0). If so, it calls\n /// `onERC721Received` on `_to` and throws if the return value is not\n /// `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n /// @param _data Additional data with no specified format, sent in call to `_to`\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId,\n bytes _data\n )\n external;\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev This works identically to the other function with an extra data parameter,\n /// except this function just sets data to \"\".\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n external;\n\n /// @notice Change or reaffirm the approved address for an NFT\n /// @dev The zero address indicates there is no approved address.\n /// Throws unless `msg.sender` is the current NFT owner, or an authorized\n /// operator of the current owner.\n /// @param _approved The new approved NFT controller\n /// @param _tokenId The NFT to approve\n function approve(address _approved, uint256 _tokenId)\n external;\n\n /// @notice Enable or disable approval for a third party (\"operator\") to manage\n /// all of `msg.sender`'s assets\n /// @dev Emits the ApprovalForAll event. The contract MUST allow\n /// multiple operators per owner.\n /// @param _operator Address to add to the set of authorized operators\n /// @param _approved True if the operator is approved, false to revoke approval\n function setApprovalForAll(address _operator, bool _approved)\n external;\n\n /// @notice Count all NFTs assigned to an owner\n /// @dev NFTs assigned to the zero address are considered invalid, and this\n /// function throws for queries about the zero address.\n /// @param _owner An address for whom to query the balance\n /// @return The number of NFTs owned by `_owner`, possibly zero\n function balanceOf(address _owner)\n external\n view\n returns (uint256);\n\n /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE\n /// TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE\n /// THEY MAY BE PERMANENTLY LOST\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function transferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n public;\n\n /// @notice Find the owner of an NFT\n /// @dev NFTs assigned to zero address are considered invalid, and queries\n /// about them do throw.\n /// @param _tokenId The identifier for an NFT\n /// @return The address of the owner of the NFT\n function ownerOf(uint256 _tokenId)\n public\n view\n returns (address);\n\n /// @notice Get the approved address for a single NFT\n /// @dev Throws if `_tokenId` is not a valid NFT.\n /// @param _tokenId The NFT to find the approved address for\n /// @return The approved address for this NFT, or the zero address if there is none\n function getApproved(uint256 _tokenId) \n public\n view\n returns (address);\n \n /// @notice Query if an address is an authorized operator for another address\n /// @param _owner The address that owns the NFTs\n /// @param _operator The address that acts on behalf of the owner\n /// @return True if `_operator` is an approved operator for `_owner`, false otherwise\n function isApprovedForAll(address _owner, address _operator)\n public\n view\n returns (bool);\n}\n",
- "2.0.0/tokens/ERC721Token/MintableERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./ERC721Token.sol\";\n\n\ncontract MintableERC721Token is\n ERC721Token\n{\n /// @dev Function to mint a new token\n /// Reverts if the given token ID already exists\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _tokenId ID of the token to be minted by the msg.sender \n function _mint(address _to, uint256 _tokenId)\n internal\n {\n require(\n _to != address(0),\n \"ERC721_ZERO_TO_ADDRESS\"\n );\n\n address owner = owners[_tokenId];\n require(\n owner == address(0),\n \"ERC721_OWNER_ALREADY_EXISTS\"\n );\n\n owners[_tokenId] = _to;\n balances[_to] = safeAdd(balances[_to], 1);\n\n emit Transfer(\n address(0),\n _to,\n _tokenId\n );\n }\n\n /// @dev Function to burn a token\n /// Reverts if the given token ID doesn't exist\n /// @param _owner Owner of token with given token ID\n /// @param _tokenId ID of the token to be burned by the msg.sender\n function _burn(address _owner, uint256 _tokenId)\n internal\n {\n require(\n _owner != address(0),\n \"ERC721_ZERO_OWNER_ADDRESS\"\n );\n\n address owner = owners[_tokenId];\n require(\n owner == _owner,\n \"ERC721_OWNER_MISMATCH\"\n );\n\n owners[_tokenId] = address(0);\n balances[_owner] = safeSub(balances[_owner], 1);\n\n emit Transfer(\n _owner,\n address(0),\n _tokenId\n );\n }\n}\n",
- "2.0.0/tokens/EtherToken/IEtherToken.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../ERC20Token/IERC20Token.sol\";\n\n\ncontract IEtherToken is\n IERC20Token\n{\n function deposit()\n public\n payable;\n \n function withdraw(uint256 amount)\n public;\n}\n",
- "2.0.0/utils/LibBytes/LibBytes.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\nlibrary LibBytes {\n\n using LibBytes for bytes;\n\n /// @dev Gets the memory address for a byte array.\n /// @param input Byte array to lookup.\n /// @return memoryAddress Memory address of byte array. This\n /// points to the header of the byte array which contains\n /// the length.\n function rawAddress(bytes memory input)\n internal\n pure\n returns (uint256 memoryAddress)\n {\n assembly {\n memoryAddress := input\n }\n return memoryAddress;\n }\n \n /// @dev Gets the memory address for the contents of a byte array.\n /// @param input Byte array to lookup.\n /// @return memoryAddress Memory address of the contents of the byte array.\n function contentAddress(bytes memory input)\n internal\n pure\n returns (uint256 memoryAddress)\n {\n assembly {\n memoryAddress := add(input, 32)\n }\n return memoryAddress;\n }\n\n /// @dev Copies `length` bytes from memory location `source` to `dest`.\n /// @param dest memory address to copy bytes to.\n /// @param source memory address to copy bytes from.\n /// @param length number of bytes to copy.\n function memCopy(\n uint256 dest,\n uint256 source,\n uint256 length\n )\n internal\n pure\n {\n if (length < 32) {\n // Handle a partial word by reading destination and masking\n // off the bits we are interested in.\n // This correctly handles overlap, zero lengths and source == dest\n assembly {\n let mask := sub(exp(256, sub(32, length)), 1)\n let s := and(mload(source), not(mask))\n let d := and(mload(dest), mask)\n mstore(dest, or(s, d))\n }\n } else {\n // Skip the O(length) loop when source == dest.\n if (source == dest) {\n return;\n }\n\n // For large copies we copy whole words at a time. The final\n // word is aligned to the end of the range (instead of after the\n // previous) to handle partial words. So a copy will look like this:\n //\n // ####\n // ####\n // ####\n // ####\n //\n // We handle overlap in the source and destination range by\n // changing the copying direction. This prevents us from\n // overwriting parts of source that we still need to copy.\n //\n // This correctly handles source == dest\n //\n if (source > dest) {\n assembly {\n // We subtract 32 from `sEnd` and `dEnd` because it\n // is easier to compare with in the loop, and these\n // are also the addresses we need for copying the\n // last bytes.\n length := sub(length, 32)\n let sEnd := add(source, length)\n let dEnd := add(dest, length)\n\n // Remember the last 32 bytes of source\n // This needs to be done here and not after the loop\n // because we may have overwritten the last bytes in\n // source already due to overlap.\n let last := mload(sEnd)\n\n // Copy whole words front to back\n // Note: the first check is always true,\n // this could have been a do-while loop.\n // solhint-disable-next-line no-empty-blocks\n for {} lt(source, sEnd) {} {\n mstore(dest, mload(source))\n source := add(source, 32)\n dest := add(dest, 32)\n }\n \n // Write the last 32 bytes\n mstore(dEnd, last)\n }\n } else {\n assembly {\n // We subtract 32 from `sEnd` and `dEnd` because those\n // are the starting points when copying a word at the end.\n length := sub(length, 32)\n let sEnd := add(source, length)\n let dEnd := add(dest, length)\n\n // Remember the first 32 bytes of source\n // This needs to be done here and not after the loop\n // because we may have overwritten the first bytes in\n // source already due to overlap.\n let first := mload(source)\n\n // Copy whole words back to front\n // We use a signed comparisson here to allow dEnd to become\n // negative (happens when source and dest < 32). Valid\n // addresses in local memory will never be larger than\n // 2**255, so they can be safely re-interpreted as signed.\n // Note: the first check is always true,\n // this could have been a do-while loop.\n // solhint-disable-next-line no-empty-blocks\n for {} slt(dest, dEnd) {} {\n mstore(dEnd, mload(sEnd))\n sEnd := sub(sEnd, 32)\n dEnd := sub(dEnd, 32)\n }\n \n // Write the first 32 bytes\n mstore(dest, first)\n }\n }\n }\n }\n\n /// @dev Returns a slices from a byte array.\n /// @param b The byte array to take a slice from.\n /// @param from The starting index for the slice (inclusive).\n /// @param to The final index for the slice (exclusive).\n /// @return result The slice containing bytes at indices [from, to)\n function slice(\n bytes memory b,\n uint256 from,\n uint256 to\n )\n internal\n pure\n returns (bytes memory result)\n {\n require(\n from <= to,\n \"FROM_LESS_THAN_TO_REQUIRED\"\n );\n require(\n to < b.length,\n \"TO_LESS_THAN_LENGTH_REQUIRED\"\n );\n \n // Create a new bytes structure and copy contents\n result = new bytes(to - from);\n memCopy(\n result.contentAddress(),\n b.contentAddress() + from,\n result.length\n );\n return result;\n }\n \n /// @dev Returns a slice from a byte array without preserving the input.\n /// @param b The byte array to take a slice from. Will be destroyed in the process.\n /// @param from The starting index for the slice (inclusive).\n /// @param to The final index for the slice (exclusive).\n /// @return result The slice containing bytes at indices [from, to)\n /// @dev When `from == 0`, the original array will match the slice. In other cases its state will be corrupted.\n function sliceDestructive(\n bytes memory b,\n uint256 from,\n uint256 to\n )\n internal\n pure\n returns (bytes memory result)\n {\n require(\n from <= to,\n \"FROM_LESS_THAN_TO_REQUIRED\"\n );\n require(\n to < b.length,\n \"TO_LESS_THAN_LENGTH_REQUIRED\"\n );\n \n // Create a new bytes structure around [from, to) in-place.\n assembly {\n result := add(b, from)\n mstore(result, sub(to, from))\n }\n return result;\n }\n\n /// @dev Pops the last byte off of a byte array by modifying its length.\n /// @param b Byte array that will be modified.\n /// @return The byte that was popped off.\n function popLastByte(bytes memory b)\n internal\n pure\n returns (bytes1 result)\n {\n require(\n b.length > 0,\n \"GREATER_THAN_ZERO_LENGTH_REQUIRED\"\n );\n\n // Store last byte.\n result = b[b.length - 1];\n\n assembly {\n // Decrement length of byte array.\n let newLen := sub(mload(b), 1)\n mstore(b, newLen)\n }\n return result;\n }\n\n /// @dev Pops the last 20 bytes off of a byte array by modifying its length.\n /// @param b Byte array that will be modified.\n /// @return The 20 byte address that was popped off.\n function popLast20Bytes(bytes memory b)\n internal\n pure\n returns (address result)\n {\n require(\n b.length >= 20,\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Store last 20 bytes.\n result = readAddress(b, b.length - 20);\n\n assembly {\n // Subtract 20 from byte array length.\n let newLen := sub(mload(b), 20)\n mstore(b, newLen)\n }\n return result;\n }\n\n /// @dev Tests equality of two byte arrays.\n /// @param lhs First byte array to compare.\n /// @param rhs Second byte array to compare.\n /// @return True if arrays are the same. False otherwise.\n function equals(\n bytes memory lhs,\n bytes memory rhs\n )\n internal\n pure\n returns (bool equal)\n {\n // Keccak gas cost is 30 + numWords * 6. This is a cheap way to compare.\n // We early exit on unequal lengths, but keccak would also correctly\n // handle this.\n return lhs.length == rhs.length && keccak256(lhs) == keccak256(rhs);\n }\n\n /// @dev Reads an address from a position in a byte array.\n /// @param b Byte array containing an address.\n /// @param index Index in byte array of address.\n /// @return address from byte array.\n function readAddress(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (address result)\n {\n require(\n b.length >= index + 20, // 20 is length of address\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Add offset to index:\n // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)\n // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)\n index += 20;\n\n // Read address from array memory\n assembly {\n // 1. Add index to address of bytes array\n // 2. Load 32-byte word from memory\n // 3. Apply 20-byte mask to obtain address\n result := and(mload(add(b, index)), 0xffffffffffffffffffffffffffffffffffffffff)\n }\n return result;\n }\n\n /// @dev Writes an address into a specific position in a byte array.\n /// @param b Byte array to insert address into.\n /// @param index Index in byte array of address.\n /// @param input Address to put into byte array.\n function writeAddress(\n bytes memory b,\n uint256 index,\n address input\n )\n internal\n pure\n {\n require(\n b.length >= index + 20, // 20 is length of address\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Add offset to index:\n // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)\n // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)\n index += 20;\n\n // Store address into array memory\n assembly {\n // The address occupies 20 bytes and mstore stores 32 bytes.\n // First fetch the 32-byte word where we'll be storing the address, then\n // apply a mask so we have only the bytes in the word that the address will not occupy.\n // Then combine these bytes with the address and store the 32 bytes back to memory with mstore.\n\n // 1. Add index to address of bytes array\n // 2. Load 32-byte word from memory\n // 3. Apply 12-byte mask to obtain extra bytes occupying word of memory where we'll store the address\n let neighbors := and(\n mload(add(b, index)),\n 0xffffffffffffffffffffffff0000000000000000000000000000000000000000\n )\n \n // Make sure input address is clean.\n // (Solidity does not guarantee this)\n input := and(input, 0xffffffffffffffffffffffffffffffffffffffff)\n\n // Store the neighbors and address into memory\n mstore(add(b, index), xor(input, neighbors))\n }\n }\n\n /// @dev Reads a bytes32 value from a position in a byte array.\n /// @param b Byte array containing a bytes32 value.\n /// @param index Index in byte array of bytes32 value.\n /// @return bytes32 value from byte array.\n function readBytes32(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes32 result)\n {\n require(\n b.length >= index + 32,\n \"GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 256 bit length parameter\n index += 32;\n\n // Read the bytes32 from array memory\n assembly {\n result := mload(add(b, index))\n }\n return result;\n }\n\n /// @dev Writes a bytes32 into a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input bytes32 to put into byte array.\n function writeBytes32(\n bytes memory b,\n uint256 index,\n bytes32 input\n )\n internal\n pure\n {\n require(\n b.length >= index + 32,\n \"GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 256 bit length parameter\n index += 32;\n\n // Read the bytes32 from array memory\n assembly {\n mstore(add(b, index), input)\n }\n }\n\n /// @dev Reads a uint256 value from a position in a byte array.\n /// @param b Byte array containing a uint256 value.\n /// @param index Index in byte array of uint256 value.\n /// @return uint256 value from byte array.\n function readUint256(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (uint256 result)\n {\n result = uint256(readBytes32(b, index));\n return result;\n }\n\n /// @dev Writes a uint256 into a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input uint256 to put into byte array.\n function writeUint256(\n bytes memory b,\n uint256 index,\n uint256 input\n )\n internal\n pure\n {\n writeBytes32(b, index, bytes32(input));\n }\n\n /// @dev Reads an unpadded bytes4 value from a position in a byte array.\n /// @param b Byte array containing a bytes4 value.\n /// @param index Index in byte array of bytes4 value.\n /// @return bytes4 value from byte array.\n function readBytes4(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes4 result)\n {\n require(\n b.length >= index + 4,\n \"GREATER_OR_EQUAL_TO_4_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 32 byte length field\n index += 32;\n\n // Read the bytes4 from array memory\n assembly {\n result := mload(add(b, index))\n // Solidity does not require us to clean the trailing bytes.\n // We do it anyway\n result := and(result, 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000)\n }\n return result;\n }\n\n /// @dev Reads nested bytes from a specific position.\n /// @dev NOTE: the returned value overlaps with the input value.\n /// Both should be treated as immutable.\n /// @param b Byte array containing nested bytes.\n /// @param index Index of nested bytes.\n /// @return result Nested bytes.\n function readBytesWithLength(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes memory result)\n {\n // Read length of nested bytes\n uint256 nestedBytesLength = readUint256(b, index);\n index += 32;\n\n // Assert length of <b> is valid, given\n // length of nested bytes\n require(\n b.length >= index + nestedBytesLength,\n \"GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED\"\n );\n \n // Return a pointer to the byte array as it exists inside `b`\n assembly {\n result := add(b, index)\n }\n return result;\n }\n\n /// @dev Inserts bytes at a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input bytes to insert.\n function writeBytesWithLength(\n bytes memory b,\n uint256 index,\n bytes memory input\n )\n internal\n pure\n {\n // Assert length of <b> is valid, given\n // length of input\n require(\n b.length >= index + 32 + input.length, // 32 bytes to store length\n \"GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED\"\n );\n\n // Copy <input> into <b>\n memCopy(\n b.contentAddress() + index,\n input.rawAddress(), // includes length of <input>\n input.length + 32 // +32 bytes to store <input> length\n );\n }\n\n /// @dev Performs a deep copy of a byte array onto another byte array of greater than or equal length.\n /// @param dest Byte array that will be overwritten with source bytes.\n /// @param source Byte array to copy onto dest bytes.\n function deepCopyBytes(\n bytes memory dest,\n bytes memory source\n )\n internal\n pure\n {\n uint256 sourceLen = source.length;\n // Dest length must be >= source length, or some bytes would not be copied.\n require(\n dest.length >= sourceLen,\n \"GREATER_OR_EQUAL_TO_SOURCE_BYTES_LENGTH_REQUIRED\"\n );\n memCopy(\n dest.contentAddress(),\n source.contentAddress(),\n sourceLen\n );\n }\n}\n",
- "2.0.0/utils/Ownable/IOwnable.sol": "pragma solidity 0.4.24;\n\n\ncontract IOwnable {\n\n function transferOwnership(address newOwner)\n public;\n}\n",
- "2.0.0/utils/Ownable/Ownable.sol": "pragma solidity 0.4.24;\n\nimport \"./IOwnable.sol\";\n\n\ncontract Ownable is\n IOwnable\n{\n address public owner;\n\n constructor ()\n public\n {\n owner = msg.sender;\n }\n\n modifier onlyOwner() {\n require(\n msg.sender == owner,\n \"ONLY_CONTRACT_OWNER\"\n );\n _;\n }\n\n function transferOwnership(address newOwner)\n public\n onlyOwner\n {\n if (newOwner != address(0)) {\n owner = newOwner;\n }\n }\n}\n",
- "2.0.0/utils/ReentrancyGuard/ReentrancyGuard.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract ReentrancyGuard {\n\n // Locked state of mutex\n bool private locked = false;\n\n /// @dev Functions with this modifer cannot be reentered. The mutex will be locked\n /// before function execution and unlocked after.\n modifier nonReentrant() {\n // Ensure mutex is unlocked\n require(\n !locked,\n \"REENTRANCY_ILLEGAL\"\n );\n\n // Lock mutex before function call\n locked = true;\n\n // Perform function call\n _;\n\n // Unlock mutex after function call\n locked = false;\n }\n}\n",
- "2.0.0/utils/SafeMath/SafeMath.sol": "pragma solidity 0.4.24;\n\n\ncontract SafeMath {\n\n function safeMul(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n if (a == 0) {\n return 0;\n }\n uint256 c = a * b;\n require(\n c / a == b,\n \"UINT256_OVERFLOW\"\n );\n return c;\n }\n\n function safeDiv(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n uint256 c = a / b;\n return c;\n }\n\n function safeSub(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n require(\n b <= a,\n \"UINT256_UNDERFLOW\"\n );\n return a - b;\n }\n\n function safeAdd(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n uint256 c = a + b;\n require(\n c >= a,\n \"UINT256_OVERFLOW\"\n );\n return c;\n }\n\n function max64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n\n function max256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n}\n"
- },
- "sourceTreeHashHex": "0x7c03657f568331e5dbdd3212ed6be6074760e096f601ee84ad8c0fa46acd293f",
- "compiler": {
- "name": "solc",
- "version": "soljson-v0.4.24+commit.e67f0147.js",
- "settings": {
- "optimizer": {
- "enabled": true,
- "runs": 1000000
- },
- "outputSelection": {
- "*": {
- "*": [
- "abi",
- "evm.bytecode.object",
- "evm.bytecode.sourceMap",
- "evm.deployedBytecode.object",
- "evm.deployedBytecode.sourceMap"
- ]
- }
- }
- }
- },
- "networks": {}
-} \ No newline at end of file
diff --git a/packages/migrations/artifacts/2.0.0/ERC20Proxy.json b/packages/migrations/artifacts/2.0.0/ERC20Proxy.json
deleted file mode 100644
index 5bd37ef26..000000000
--- a/packages/migrations/artifacts/2.0.0/ERC20Proxy.json
+++ /dev/null
@@ -1,481 +0,0 @@
-{
- "schemaVersion": "2.0.0",
- "contractName": "ERC20Proxy",
- "compilerOutput": {
- "abi": [
- {
- "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": 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": 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"
- }
- ],
- "evm": {
- "bytecode": {
- "linkReferences": {},
- "object": "0x608060405260008054600160a060020a03191633179055610f4a806100256000396000f3006080604052600436106100985763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166342f1181e8114610248578063494503d41461027857806370712939146102b95780638da5cb5b146102e75780639ad26744146102fc578063ae25532e1461032d578063b918161114610377578063d39de6e9146103b9578063f2fde38b1461041e575b3480156100a457600080fd5b507fffffffff00000000000000000000000000000000000000000000000000000000600035167fa85e59e40000000000000000000000000000000000000000000000000000000081141561024357604080513381526001602082015290812054151561017b577f08c379a0000000000000000000000000000000000000000000000000000000006000527c20000000000000000000000000000000000000000000000000000000006020527c1553454e4445525f4e4f545f415554484f52495a454400000000000000604052600060605260646000fd5b602860043501357f23b872dd0000000000000000000000000000000000000000000000000000000060005260606024600437602060006064600080855af1600080511160203d14163d15178116905080156101d257005b7f08c379a0000000000000000000000000000000000000000000000000000000006000527c20000000000000000000000000000000000000000000000000000000006020527c0f5452414e534645525f4641494c454400000000000000000000000000604052600060605260646000fd5b600080fd5b34801561025457600080fd5b5061027673ffffffffffffffffffffffffffffffffffffffff6004351661044c565b005b34801561028457600080fd5b50610290600435610638565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b3480156102c557600080fd5b5061027673ffffffffffffffffffffffffffffffffffffffff6004351661066d565b3480156102f357600080fd5b50610290610966565b34801561030857600080fd5b5061027673ffffffffffffffffffffffffffffffffffffffff60043516602435610982565b34801561033957600080fd5b50610342610d37565b604080517fffffffff000000000000000000000000000000000000000000000000000000009092168252519081900360200190f35b34801561038357600080fd5b506103a573ffffffffffffffffffffffffffffffffffffffff60043516610d6d565b604080519115158252519081900360200190f35b3480156103c557600080fd5b506103ce610d82565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561040a5781810151838201526020016103f2565b505050509050019250505060405180910390f35b34801561042a57600080fd5b5061027673ffffffffffffffffffffffffffffffffffffffff60043516610df1565b60005473ffffffffffffffffffffffffffffffffffffffff1633146104d257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff811660009081526001602052604090205460ff161561056757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f5441524745545f414c52454144595f415554484f52495a454400000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8116600081815260016020819052604080832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168317905560028054928301815583527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace90910180547fffffffffffffffffffffffff00000000000000000000000000000000000000001684179055513392917f3147867c59d17e8fa9d522465651d44aae0a9e38f902f3475b97e58072f0ed4c91a350565b600280548290811061064657fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b6000805473ffffffffffffffffffffffffffffffffffffffff1633146106f457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff821660009081526001602052604090205460ff16151561078a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f5441524745545f4e4f545f415554484f52495a45440000000000000000000000604482015290519081900360640190fd5b5073ffffffffffffffffffffffffffffffffffffffff8116600090815260016020526040812080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690555b60025481101561091f578173ffffffffffffffffffffffffffffffffffffffff1660028281548110151561080757fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16141561091757600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff810190811061085f57fe5b6000918252602090912001546002805473ffffffffffffffffffffffffffffffffffffffff909216918390811061089257fe5b600091825260209091200180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01906109119082610ed7565b5061091f565b6001016107d7565b604051339073ffffffffffffffffffffffffffffffffffffffff8416907f1f32c1b084e2de0713b8fb16bd46bb9df710a3dbeae2f3ca93af46e016dcc6b090600090a35050565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b60005473ffffffffffffffffffffffffffffffffffffffff163314610a0857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff821660009081526001602052604090205460ff161515610a9e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f5441524745545f4e4f545f415554484f52495a45440000000000000000000000604482015290519081900360640190fd5b6002548110610b0e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f494e4445585f4f55545f4f465f424f554e445300000000000000000000000000604482015290519081900360640190fd5b8173ffffffffffffffffffffffffffffffffffffffff16600282815481101515610b3457fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff1614610bc257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f415554484f52495a45445f414444524553535f4d49534d415443480000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8216600090815260016020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8101908110610c3d57fe5b6000918252602090912001546002805473ffffffffffffffffffffffffffffffffffffffff9092169183908110610c7057fe5b600091825260209091200180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190610cef9082610ed7565b50604051339073ffffffffffffffffffffffffffffffffffffffff8416907f1f32c1b084e2de0713b8fb16bd46bb9df710a3dbeae2f3ca93af46e016dcc6b090600090a35050565b604080517f4552433230546f6b656e28616464726573732900000000000000000000000000815290519081900360130190205b90565b60016020526000908152604090205460ff1681565b60606002805480602002602001604051908101604052809291908181526020018280548015610de757602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610dbc575b5050505050905090565b60005473ffffffffffffffffffffffffffffffffffffffff163314610e7757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff811615610ed457600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83161790555b50565b815481835581811115610efb57600083815260209020610efb918101908301610f00565b505050565b610d6a91905b80821115610f1a5760008155600101610f06565b50905600a165627a7a72305820f6b2cadda0be9b47f37ed4a850b096e49b5e2e8bb7446d65481adecf980824a00029",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 SLOAD PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB NOT AND CALLER OR SWAP1 SSTORE PUSH2 0xF4A DUP1 PUSH2 0x25 PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN STOP PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x98 JUMPI PUSH4 0xFFFFFFFF PUSH29 0x100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD DIV AND PUSH4 0x42F1181E DUP2 EQ PUSH2 0x248 JUMPI DUP1 PUSH4 0x494503D4 EQ PUSH2 0x278 JUMPI DUP1 PUSH4 0x70712939 EQ PUSH2 0x2B9 JUMPI DUP1 PUSH4 0x8DA5CB5B EQ PUSH2 0x2E7 JUMPI DUP1 PUSH4 0x9AD26744 EQ PUSH2 0x2FC JUMPI DUP1 PUSH4 0xAE25532E EQ PUSH2 0x32D JUMPI DUP1 PUSH4 0xB9181611 EQ PUSH2 0x377 JUMPI DUP1 PUSH4 0xD39DE6E9 EQ PUSH2 0x3B9 JUMPI DUP1 PUSH4 0xF2FDE38B EQ PUSH2 0x41E JUMPI JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xA4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD AND PUSH32 0xA85E59E400000000000000000000000000000000000000000000000000000000 DUP2 EQ ISZERO PUSH2 0x243 JUMPI PUSH1 0x40 DUP1 MLOAD CALLER DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 DUP3 ADD MSTORE SWAP1 DUP2 KECCAK256 SLOAD ISZERO ISZERO PUSH2 0x17B JUMPI PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH29 0x2000000000000000000000000000000000000000000000000000000000 PUSH1 0x20 MSTORE PUSH29 0x1553454E4445525F4E4F545F415554484F52495A454400000000000000 PUSH1 0x40 MSTORE PUSH1 0x0 PUSH1 0x60 MSTORE PUSH1 0x64 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x28 PUSH1 0x4 CALLDATALOAD ADD CALLDATALOAD PUSH32 0x23B872DD00000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x60 PUSH1 0x24 PUSH1 0x4 CALLDATACOPY PUSH1 0x20 PUSH1 0x0 PUSH1 0x64 PUSH1 0x0 DUP1 DUP6 GAS CALL PUSH1 0x0 DUP1 MLOAD GT PUSH1 0x20 RETURNDATASIZE EQ AND RETURNDATASIZE ISZERO OR DUP2 AND SWAP1 POP DUP1 ISZERO PUSH2 0x1D2 JUMPI STOP JUMPDEST PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH29 0x2000000000000000000000000000000000000000000000000000000000 PUSH1 0x20 MSTORE PUSH29 0xF5452414E534645525F4641494C454400000000000000000000000000 PUSH1 0x40 MSTORE PUSH1 0x0 PUSH1 0x60 MSTORE PUSH1 0x64 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x254 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x276 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x44C JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x284 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x290 PUSH1 0x4 CALLDATALOAD PUSH2 0x638 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2C5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x276 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x66D JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2F3 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x290 PUSH2 0x966 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x308 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x276 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x982 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x339 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x342 PUSH2 0xD37 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 SWAP1 SWAP3 AND DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x383 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x3A5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0xD6D JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 ISZERO ISZERO DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3C5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x3CE PUSH2 0xD82 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 DUP1 DUP3 MSTORE DUP4 MLOAD DUP2 DUP4 ADD MSTORE DUP4 MLOAD SWAP2 SWAP3 DUP4 SWAP3 SWAP1 DUP4 ADD SWAP2 DUP6 DUP2 ADD SWAP2 MUL DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x40A JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH2 0x3F2 JUMP JUMPDEST POP POP POP POP SWAP1 POP ADD SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x42A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x276 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0xDF1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0x4D2 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x567 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x19 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x5441524745545F414C52454144595F415554484F52495A454400000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND DUP4 OR SWAP1 SSTORE PUSH1 0x2 DUP1 SLOAD SWAP3 DUP4 ADD DUP2 SSTORE DUP4 MSTORE PUSH32 0x405787FA12A823E0F2B7631CC41B3BA8828B3321CA811111FA75CD3AA3BB5ACE SWAP1 SWAP2 ADD DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND DUP5 OR SWAP1 SSTORE MLOAD CALLER SWAP3 SWAP2 PUSH32 0x3147867C59D17E8FA9D522465651D44AAE0A9E38F902F3475B97E58072F0ED4C SWAP2 LOG3 POP JUMP JUMPDEST PUSH1 0x2 DUP1 SLOAD DUP3 SWAP1 DUP2 LT PUSH2 0x646 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 POP DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0x6F4 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND ISZERO ISZERO PUSH2 0x78A JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x15 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x5441524745545F4E4F545F415554484F52495A45440000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 DUP2 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE JUMPDEST PUSH1 0x2 SLOAD DUP2 LT ISZERO PUSH2 0x91F JUMPI DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x2 DUP3 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x807 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0x917 JUMPI PUSH1 0x2 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 ADD SWAP1 DUP2 LT PUSH2 0x85F JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH1 0x2 DUP1 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND SWAP2 DUP4 SWAP1 DUP2 LT PUSH2 0x892 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP3 SWAP1 SWAP3 AND SWAP2 SWAP1 SWAP2 OR SWAP1 SSTORE PUSH1 0x2 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 PUSH2 0x911 SWAP1 DUP3 PUSH2 0xED7 JUMP JUMPDEST POP PUSH2 0x91F JUMP JUMPDEST PUSH1 0x1 ADD PUSH2 0x7D7 JUMP JUMPDEST PUSH1 0x40 MLOAD CALLER SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND SWAP1 PUSH32 0x1F32C1B084E2DE0713B8FB16BD46BB9DF710A3DBEAE2F3CA93AF46E016DCC6B0 SWAP1 PUSH1 0x0 SWAP1 LOG3 POP POP JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0xA08 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND ISZERO ISZERO PUSH2 0xA9E JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x15 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x5441524745545F4E4F545F415554484F52495A45440000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x2 SLOAD DUP2 LT PUSH2 0xB0E JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x494E4445585F4F55545F4F465F424F554E445300000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x2 DUP3 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0xB34 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0xBC2 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x1B PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x415554484F52495A45445F414444524553535F4D49534D415443480000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE PUSH1 0x2 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 ADD SWAP1 DUP2 LT PUSH2 0xC3D JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH1 0x2 DUP1 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND SWAP2 DUP4 SWAP1 DUP2 LT PUSH2 0xC70 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP3 SWAP1 SWAP3 AND SWAP2 SWAP1 SWAP2 OR SWAP1 SSTORE PUSH1 0x2 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 PUSH2 0xCEF SWAP1 DUP3 PUSH2 0xED7 JUMP JUMPDEST POP PUSH1 0x40 MLOAD CALLER SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND SWAP1 PUSH32 0x1F32C1B084E2DE0713B8FB16BD46BB9DF710A3DBEAE2F3CA93AF46E016DCC6B0 SWAP1 PUSH1 0x0 SWAP1 LOG3 POP POP JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0x4552433230546F6B656E28616464726573732900000000000000000000000000 DUP2 MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x13 ADD SWAP1 KECCAK256 JUMPDEST SWAP1 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x2 DUP1 SLOAD DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD DUP1 ISZERO PUSH2 0xDE7 JUMPI PUSH1 0x20 MUL DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x1 SWAP1 SWAP2 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0xDBC JUMPI JUMPDEST POP POP POP POP POP SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0xE77 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND ISZERO PUSH2 0xED4 JUMPI PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND OR SWAP1 SSTORE JUMPDEST POP JUMP JUMPDEST DUP2 SLOAD DUP2 DUP4 SSTORE DUP2 DUP2 GT ISZERO PUSH2 0xEFB JUMPI PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x20 SWAP1 KECCAK256 PUSH2 0xEFB SWAP2 DUP2 ADD SWAP1 DUP4 ADD PUSH2 0xF00 JUMP JUMPDEST POP POP POP JUMP JUMPDEST PUSH2 0xD6A SWAP2 SWAP1 JUMPDEST DUP1 DUP3 GT ISZERO PUSH2 0xF1A JUMPI PUSH1 0x0 DUP2 SSTORE PUSH1 0x1 ADD PUSH2 0xF06 JUMP JUMPDEST POP SWAP1 JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 0xf6 0xb2 0xca 0xdd LOG0 0xbe SWAP12 0x47 RETURN PUSH31 0xD4A850B096E49B5E2E8BB7446D65481ADECF980824A0002900000000000000 ",
- "sourceMap": "641:8586:14:-;;;162:5:55;:18;;-1:-1:-1;;;;;;162:18:55;170:10;162:18;;;641:8586:14;;;;;;"
- },
- "deployedBytecode": {
- "linkReferences": {},
- "object": "0x6080604052600436106100985763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166342f1181e8114610248578063494503d41461027857806370712939146102b95780638da5cb5b146102e75780639ad26744146102fc578063ae25532e1461032d578063b918161114610377578063d39de6e9146103b9578063f2fde38b1461041e575b3480156100a457600080fd5b507fffffffff00000000000000000000000000000000000000000000000000000000600035167fa85e59e40000000000000000000000000000000000000000000000000000000081141561024357604080513381526001602082015290812054151561017b577f08c379a0000000000000000000000000000000000000000000000000000000006000527c20000000000000000000000000000000000000000000000000000000006020527c1553454e4445525f4e4f545f415554484f52495a454400000000000000604052600060605260646000fd5b602860043501357f23b872dd0000000000000000000000000000000000000000000000000000000060005260606024600437602060006064600080855af1600080511160203d14163d15178116905080156101d257005b7f08c379a0000000000000000000000000000000000000000000000000000000006000527c20000000000000000000000000000000000000000000000000000000006020527c0f5452414e534645525f4641494c454400000000000000000000000000604052600060605260646000fd5b600080fd5b34801561025457600080fd5b5061027673ffffffffffffffffffffffffffffffffffffffff6004351661044c565b005b34801561028457600080fd5b50610290600435610638565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b3480156102c557600080fd5b5061027673ffffffffffffffffffffffffffffffffffffffff6004351661066d565b3480156102f357600080fd5b50610290610966565b34801561030857600080fd5b5061027673ffffffffffffffffffffffffffffffffffffffff60043516602435610982565b34801561033957600080fd5b50610342610d37565b604080517fffffffff000000000000000000000000000000000000000000000000000000009092168252519081900360200190f35b34801561038357600080fd5b506103a573ffffffffffffffffffffffffffffffffffffffff60043516610d6d565b604080519115158252519081900360200190f35b3480156103c557600080fd5b506103ce610d82565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561040a5781810151838201526020016103f2565b505050509050019250505060405180910390f35b34801561042a57600080fd5b5061027673ffffffffffffffffffffffffffffffffffffffff60043516610df1565b60005473ffffffffffffffffffffffffffffffffffffffff1633146104d257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff811660009081526001602052604090205460ff161561056757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f5441524745545f414c52454144595f415554484f52495a454400000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8116600081815260016020819052604080832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168317905560028054928301815583527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace90910180547fffffffffffffffffffffffff00000000000000000000000000000000000000001684179055513392917f3147867c59d17e8fa9d522465651d44aae0a9e38f902f3475b97e58072f0ed4c91a350565b600280548290811061064657fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b6000805473ffffffffffffffffffffffffffffffffffffffff1633146106f457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff821660009081526001602052604090205460ff16151561078a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f5441524745545f4e4f545f415554484f52495a45440000000000000000000000604482015290519081900360640190fd5b5073ffffffffffffffffffffffffffffffffffffffff8116600090815260016020526040812080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690555b60025481101561091f578173ffffffffffffffffffffffffffffffffffffffff1660028281548110151561080757fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16141561091757600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff810190811061085f57fe5b6000918252602090912001546002805473ffffffffffffffffffffffffffffffffffffffff909216918390811061089257fe5b600091825260209091200180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01906109119082610ed7565b5061091f565b6001016107d7565b604051339073ffffffffffffffffffffffffffffffffffffffff8416907f1f32c1b084e2de0713b8fb16bd46bb9df710a3dbeae2f3ca93af46e016dcc6b090600090a35050565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b60005473ffffffffffffffffffffffffffffffffffffffff163314610a0857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff821660009081526001602052604090205460ff161515610a9e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f5441524745545f4e4f545f415554484f52495a45440000000000000000000000604482015290519081900360640190fd5b6002548110610b0e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f494e4445585f4f55545f4f465f424f554e445300000000000000000000000000604482015290519081900360640190fd5b8173ffffffffffffffffffffffffffffffffffffffff16600282815481101515610b3457fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff1614610bc257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f415554484f52495a45445f414444524553535f4d49534d415443480000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8216600090815260016020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8101908110610c3d57fe5b6000918252602090912001546002805473ffffffffffffffffffffffffffffffffffffffff9092169183908110610c7057fe5b600091825260209091200180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190610cef9082610ed7565b50604051339073ffffffffffffffffffffffffffffffffffffffff8416907f1f32c1b084e2de0713b8fb16bd46bb9df710a3dbeae2f3ca93af46e016dcc6b090600090a35050565b604080517f4552433230546f6b656e28616464726573732900000000000000000000000000815290519081900360130190205b90565b60016020526000908152604090205460ff1681565b60606002805480602002602001604051908101604052809291908181526020018280548015610de757602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610dbc575b5050505050905090565b60005473ffffffffffffffffffffffffffffffffffffffff163314610e7757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff811615610ed457600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83161790555b50565b815481835581811115610efb57600083815260209020610efb918101908301610f00565b505050565b610d6a91905b80821115610f1a5760008155600101610f06565b50905600a165627a7a72305820f6b2cadda0be9b47f37ed4a850b096e49b5e2e8bb7446d65481adecf980824a00029",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x98 JUMPI PUSH4 0xFFFFFFFF PUSH29 0x100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD DIV AND PUSH4 0x42F1181E DUP2 EQ PUSH2 0x248 JUMPI DUP1 PUSH4 0x494503D4 EQ PUSH2 0x278 JUMPI DUP1 PUSH4 0x70712939 EQ PUSH2 0x2B9 JUMPI DUP1 PUSH4 0x8DA5CB5B EQ PUSH2 0x2E7 JUMPI DUP1 PUSH4 0x9AD26744 EQ PUSH2 0x2FC JUMPI DUP1 PUSH4 0xAE25532E EQ PUSH2 0x32D JUMPI DUP1 PUSH4 0xB9181611 EQ PUSH2 0x377 JUMPI DUP1 PUSH4 0xD39DE6E9 EQ PUSH2 0x3B9 JUMPI DUP1 PUSH4 0xF2FDE38B EQ PUSH2 0x41E JUMPI JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xA4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD AND PUSH32 0xA85E59E400000000000000000000000000000000000000000000000000000000 DUP2 EQ ISZERO PUSH2 0x243 JUMPI PUSH1 0x40 DUP1 MLOAD CALLER DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 DUP3 ADD MSTORE SWAP1 DUP2 KECCAK256 SLOAD ISZERO ISZERO PUSH2 0x17B JUMPI PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH29 0x2000000000000000000000000000000000000000000000000000000000 PUSH1 0x20 MSTORE PUSH29 0x1553454E4445525F4E4F545F415554484F52495A454400000000000000 PUSH1 0x40 MSTORE PUSH1 0x0 PUSH1 0x60 MSTORE PUSH1 0x64 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x28 PUSH1 0x4 CALLDATALOAD ADD CALLDATALOAD PUSH32 0x23B872DD00000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x60 PUSH1 0x24 PUSH1 0x4 CALLDATACOPY PUSH1 0x20 PUSH1 0x0 PUSH1 0x64 PUSH1 0x0 DUP1 DUP6 GAS CALL PUSH1 0x0 DUP1 MLOAD GT PUSH1 0x20 RETURNDATASIZE EQ AND RETURNDATASIZE ISZERO OR DUP2 AND SWAP1 POP DUP1 ISZERO PUSH2 0x1D2 JUMPI STOP JUMPDEST PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH29 0x2000000000000000000000000000000000000000000000000000000000 PUSH1 0x20 MSTORE PUSH29 0xF5452414E534645525F4641494C454400000000000000000000000000 PUSH1 0x40 MSTORE PUSH1 0x0 PUSH1 0x60 MSTORE PUSH1 0x64 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x254 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x276 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x44C JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x284 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x290 PUSH1 0x4 CALLDATALOAD PUSH2 0x638 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2C5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x276 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x66D JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2F3 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x290 PUSH2 0x966 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x308 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x276 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x982 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x339 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x342 PUSH2 0xD37 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 SWAP1 SWAP3 AND DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x383 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x3A5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0xD6D JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 ISZERO ISZERO DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3C5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x3CE PUSH2 0xD82 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 DUP1 DUP3 MSTORE DUP4 MLOAD DUP2 DUP4 ADD MSTORE DUP4 MLOAD SWAP2 SWAP3 DUP4 SWAP3 SWAP1 DUP4 ADD SWAP2 DUP6 DUP2 ADD SWAP2 MUL DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x40A JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH2 0x3F2 JUMP JUMPDEST POP POP POP POP SWAP1 POP ADD SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x42A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x276 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0xDF1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0x4D2 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x567 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x19 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x5441524745545F414C52454144595F415554484F52495A454400000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND DUP4 OR SWAP1 SSTORE PUSH1 0x2 DUP1 SLOAD SWAP3 DUP4 ADD DUP2 SSTORE DUP4 MSTORE PUSH32 0x405787FA12A823E0F2B7631CC41B3BA8828B3321CA811111FA75CD3AA3BB5ACE SWAP1 SWAP2 ADD DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND DUP5 OR SWAP1 SSTORE MLOAD CALLER SWAP3 SWAP2 PUSH32 0x3147867C59D17E8FA9D522465651D44AAE0A9E38F902F3475B97E58072F0ED4C SWAP2 LOG3 POP JUMP JUMPDEST PUSH1 0x2 DUP1 SLOAD DUP3 SWAP1 DUP2 LT PUSH2 0x646 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 POP DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0x6F4 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND ISZERO ISZERO PUSH2 0x78A JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x15 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x5441524745545F4E4F545F415554484F52495A45440000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 DUP2 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE JUMPDEST PUSH1 0x2 SLOAD DUP2 LT ISZERO PUSH2 0x91F JUMPI DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x2 DUP3 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x807 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0x917 JUMPI PUSH1 0x2 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 ADD SWAP1 DUP2 LT PUSH2 0x85F JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH1 0x2 DUP1 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND SWAP2 DUP4 SWAP1 DUP2 LT PUSH2 0x892 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP3 SWAP1 SWAP3 AND SWAP2 SWAP1 SWAP2 OR SWAP1 SSTORE PUSH1 0x2 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 PUSH2 0x911 SWAP1 DUP3 PUSH2 0xED7 JUMP JUMPDEST POP PUSH2 0x91F JUMP JUMPDEST PUSH1 0x1 ADD PUSH2 0x7D7 JUMP JUMPDEST PUSH1 0x40 MLOAD CALLER SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND SWAP1 PUSH32 0x1F32C1B084E2DE0713B8FB16BD46BB9DF710A3DBEAE2F3CA93AF46E016DCC6B0 SWAP1 PUSH1 0x0 SWAP1 LOG3 POP POP JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0xA08 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND ISZERO ISZERO PUSH2 0xA9E JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x15 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x5441524745545F4E4F545F415554484F52495A45440000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x2 SLOAD DUP2 LT PUSH2 0xB0E JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x494E4445585F4F55545F4F465F424F554E445300000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x2 DUP3 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0xB34 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0xBC2 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x1B PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x415554484F52495A45445F414444524553535F4D49534D415443480000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE PUSH1 0x2 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 ADD SWAP1 DUP2 LT PUSH2 0xC3D JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH1 0x2 DUP1 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND SWAP2 DUP4 SWAP1 DUP2 LT PUSH2 0xC70 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP3 SWAP1 SWAP3 AND SWAP2 SWAP1 SWAP2 OR SWAP1 SSTORE PUSH1 0x2 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 PUSH2 0xCEF SWAP1 DUP3 PUSH2 0xED7 JUMP JUMPDEST POP PUSH1 0x40 MLOAD CALLER SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND SWAP1 PUSH32 0x1F32C1B084E2DE0713B8FB16BD46BB9DF710A3DBEAE2F3CA93AF46E016DCC6B0 SWAP1 PUSH1 0x0 SWAP1 LOG3 POP POP JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0x4552433230546F6B656E28616464726573732900000000000000000000000000 DUP2 MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x13 ADD SWAP1 KECCAK256 JUMPDEST SWAP1 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x2 DUP1 SLOAD DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD DUP1 ISZERO PUSH2 0xDE7 JUMPI PUSH1 0x20 MUL DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x1 SWAP1 SWAP2 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0xDBC JUMPI JUMPDEST POP POP POP POP POP SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0xE77 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND ISZERO PUSH2 0xED4 JUMPI PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND OR SWAP1 SSTORE JUMPDEST POP JUMP JUMPDEST DUP2 SLOAD DUP2 DUP4 SSTORE DUP2 DUP2 GT ISZERO PUSH2 0xEFB JUMPI PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x20 SWAP1 KECCAK256 PUSH2 0xEFB SWAP2 DUP2 ADD SWAP1 DUP4 ADD PUSH2 0xF00 JUMP JUMPDEST POP POP POP JUMP JUMPDEST PUSH2 0xD6A SWAP2 SWAP1 JUMPDEST DUP1 DUP3 GT ISZERO PUSH2 0xF1A JUMPI PUSH1 0x0 DUP2 SSTORE PUSH1 0x1 ADD PUSH2 0xF06 JUMP JUMPDEST POP SWAP1 JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 0xf6 0xb2 0xca 0xdd LOG0 0xbe SWAP12 0x47 RETURN PUSH31 0xD4A850B096E49B5E2E8BB7446D65481ADECF980824A0002900000000000000 ",
- "sourceMap": "641:8586:14:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;641:8586:14;1031:66;1027:1;1014:15;1010:88;1493:66;1483:8;1480:80;1477:2;;;1789;1783:9;;1827:6;1809:70;;1919:15;1914:2;1903:14;;1896:39;2030:20;;;2024:27;2017:35;2014:2;;;2153:66;2150:1;2143:77;2252:66;2248:2;2241:78;2351:66;2347:2;2340:78;2450:1;2446:2;2439:13;2483:3;2480:1;2473:14;2014:2;6445;6441:1;6428:15;6424:24;6411:38;6741:66;6738:1;6731:77;7046:2;7042;7039:1;7026:23;7551:2;7488:1;7433:3;7368:1;7310;7240:5;7185:3;7159:459;8361:1;8357;8351:8;8348:15;8319:2;8303:14;8300:22;8271:114;8234:14;8227:22;8203:200;8194:7;8190:214;8179:225;;8424:7;8421:2;;;8454:12;8421:2;8586:66;8583:1;8576:77;8681:66;8677:2;8670:78;8776:66;8772:2;8765:78;8871:1;8867:2;8860:13;8900:3;8897:1;8890:14;1477:2;8996:1;8993;8986:12;1145:320:16;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1145:320:16;;;;;;;;;1030:28;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1030:28:16;;;;;;;;;;;;;;;;;;;;;;;;1579:547;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1579:547:16;;;;;;;91:20:55;;8:9:-1;5:2;;;30:1;27;20:12;5:2;91:20:55;;;;2299:643:16;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2299:643:16;;;;;;;;;9112:113:14;;8:9:-1;5:2;;;30:1;27;20:12;5:2;9112:113:14;;;;;;;;;;;;;;;;;;;;;;;981:43:16;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;981:43:16;;;;;;;;;;;;;;;;;;;;;;;;;3039:138;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3039:138:16;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:100:-1;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;3039:138:16;;;;;;;;;;;;;;;;;333:167:55;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;333:167:55;;;;;;;1145:320:16;259:5:55;;;;245:10;:19;224:85;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1262:18:16;;;;;;;:10;:18;;;;;;;;1261:19;1240:91;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1342:18;;;;;;;1363:4;1342:18;;;;;;;;:25;;;;;;;;1377:11;27:10:-1;;23:18;;;45:23;;1377:24:16;;;;;;;;;;;;;;1416:42;1447:10;;1342:18;1416:42;;;1145:320;:::o;1030:28::-;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1030:28:16;:::o;1579:547::-;1814:9;259:5:55;;;;245:10;:19;224:85;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1698:18:16;;;;;;;:10;:18;;;;;;;;1677:86;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1781:18:16;;;;;;;:10;:18;;;;;1774:25;;;;;;1809:252;1833:11;:18;1829:22;;1809:252;;;1894:6;1876:24;;:11;1888:1;1876:14;;;;;;;;;;;;;;;;;;;;;;:24;1872:179;;;1937:11;1949:18;;:22;;;;1937:35;;;;;;;;;;;;;;;;1920:11;:14;;1937:35;;;;;1932:1;;1920:14;;;;;;;;;;;;;;;:52;;;;;;;;;;;;;;;1990:11;:23;;;;;;;;;:::i;:::-;;2031:5;;1872:179;1853:3;;1809:252;;;2075:44;;2108:10;;2075:44;;;;;;;;;1579:547;;:::o;91:20:55:-;;;;;;:::o;2299:643:16:-;259:5:55;;;;245:10;:19;224:85;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2462:18:16;;;;;;;:10;:18;;;;;;;;2441:86;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2566:11;:18;2558:26;;2537:92;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2682:6;2660:28;;:11;2672:5;2660:18;;;;;;;;;;;;;;;;;;;;;;:28;2639:102;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2759:18;;;;;;;:10;:18;;;;;2752:25;;;;;;2808:11;2820:18;;:22;;;;2808:35;;;;;;;;;;;;;;;;2787:11;:18;;2808:35;;;;;2799:5;;2787:18;;;;;;;;;;;;;;;:56;;;;;;;;;;;;;;;2853:11;:23;;;;;;;;;:::i;:::-;-1:-1:-1;2891:44:16;;2924:10;;2891:44;;;;;;;;;2299:643;;:::o;9112:113:14:-;760:32;;;;;;;;;;;;;;;;9112:113;;:::o;981:43:16:-;;;;;;;;;;;;;;;:::o;3039:138::-;3120:9;3159:11;3152:18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3039:138;:::o;333:167:55:-;259:5;;;;245:10;:19;224:85;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;429:22;;;;425:69;;467:5;:16;;;;;;;;;;425:69;333:167;:::o;641:8586:14:-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;"
- }
- }
- },
- "sources": {
- "2.0.0/extensions/Forwarder/Forwarder.sol": {
- "id": 0
- },
- "2.0.0/extensions/Forwarder/MixinAssets.sol": {
- "id": 1
- },
- "2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol": {
- "id": 2
- },
- "2.0.0/extensions/Forwarder/MixinForwarderCore.sol": {
- "id": 3
- },
- "2.0.0/extensions/Forwarder/MixinWeth.sol": {
- "id": 4
- },
- "2.0.0/extensions/Forwarder/interfaces/IAssets.sol": {
- "id": 5
- },
- "2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol": {
- "id": 6
- },
- "2.0.0/extensions/Forwarder/libs/LibConstants.sol": {
- "id": 7
- },
- "2.0.0/extensions/Forwarder/mixins/MAssets.sol": {
- "id": 8
- },
- "2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol": {
- "id": 9
- },
- "2.0.0/extensions/Forwarder/mixins/MWeth.sol": {
- "id": 10
- },
- "2.0.0/extensions/OrderValidator/OrderValidator.sol": {
- "id": 11
- },
- "2.0.0/multisig/MultiSigWallet.sol": {
- "id": 12
- },
- "2.0.0/multisig/MultiSigWalletWithTimeLock.sol": {
- "id": 13
- },
- "2.0.0/protocol/AssetProxy/ERC20Proxy.sol": {
- "id": 14
- },
- "2.0.0/protocol/AssetProxy/ERC721Proxy.sol": {
- "id": 15
- },
- "2.0.0/protocol/AssetProxy/MixinAuthorizable.sol": {
- "id": 16
- },
- "2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol": {
- "id": 17
- },
- "2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol": {
- "id": 18
- },
- "2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol": {
- "id": 19
- },
- "2.0.0/protocol/AssetProxyOwner/AssetProxyOwner.sol": {
- "id": 20
- },
- "2.0.0/protocol/Exchange/Exchange.sol": {
- "id": 21
- },
- "2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol": {
- "id": 22
- },
- "2.0.0/protocol/Exchange/MixinExchangeCore.sol": {
- "id": 23
- },
- "2.0.0/protocol/Exchange/MixinMatchOrders.sol": {
- "id": 24
- },
- "2.0.0/protocol/Exchange/MixinSignatureValidator.sol": {
- "id": 25
- },
- "2.0.0/protocol/Exchange/MixinTransactions.sol": {
- "id": 26
- },
- "2.0.0/protocol/Exchange/MixinWrapperFunctions.sol": {
- "id": 27
- },
- "2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol": {
- "id": 28
- },
- "2.0.0/protocol/Exchange/interfaces/IExchange.sol": {
- "id": 29
- },
- "2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol": {
- "id": 30
- },
- "2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol": {
- "id": 31
- },
- "2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol": {
- "id": 32
- },
- "2.0.0/protocol/Exchange/interfaces/ITransactions.sol": {
- "id": 33
- },
- "2.0.0/protocol/Exchange/interfaces/IValidator.sol": {
- "id": 34
- },
- "2.0.0/protocol/Exchange/interfaces/IWallet.sol": {
- "id": 35
- },
- "2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol": {
- "id": 36
- },
- "2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol": {
- "id": 37
- },
- "2.0.0/protocol/Exchange/libs/LibConstants.sol": {
- "id": 38
- },
- "2.0.0/protocol/Exchange/libs/LibEIP712.sol": {
- "id": 39
- },
- "2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol": {
- "id": 40
- },
- "2.0.0/protocol/Exchange/libs/LibFillResults.sol": {
- "id": 41
- },
- "2.0.0/protocol/Exchange/libs/LibMath.sol": {
- "id": 42
- },
- "2.0.0/protocol/Exchange/libs/LibOrder.sol": {
- "id": 43
- },
- "2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol": {
- "id": 44
- },
- "2.0.0/protocol/Exchange/mixins/MExchangeCore.sol": {
- "id": 45
- },
- "2.0.0/protocol/Exchange/mixins/MMatchOrders.sol": {
- "id": 46
- },
- "2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol": {
- "id": 47
- },
- "2.0.0/protocol/Exchange/mixins/MTransactions.sol": {
- "id": 48
- },
- "2.0.0/protocol/Exchange/mixins/MWrapperFunctions.sol": {
- "id": 49
- },
- "2.0.0/tokens/ERC20Token/IERC20Token.sol": {
- "id": 50
- },
- "2.0.0/tokens/ERC721Token/IERC721Token.sol": {
- "id": 51
- },
- "2.0.0/tokens/EtherToken/IEtherToken.sol": {
- "id": 52
- },
- "2.0.0/utils/LibBytes/LibBytes.sol": {
- "id": 53
- },
- "2.0.0/utils/Ownable/IOwnable.sol": {
- "id": 54
- },
- "2.0.0/utils/Ownable/Ownable.sol": {
- "id": 55
- },
- "2.0.0/utils/ReentrancyGuard/ReentrancyGuard.sol": {
- "id": 56
- },
- "2.0.0/utils/SafeMath/SafeMath.sol": {
- "id": 57
- }
- },
- "sourceCodes": {
- "2.0.0/extensions/Forwarder/Forwarder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./MixinWeth.sol\";\nimport \"./MixinForwarderCore.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./MixinAssets.sol\";\nimport \"./MixinExchangeWrapper.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract Forwarder is\n LibConstants,\n MixinWeth,\n MixinAssets,\n MixinExchangeWrapper,\n MixinForwarderCore\n{\n constructor (\n address _exchange,\n bytes memory _zrxAssetData,\n bytes memory _wethAssetData\n )\n public\n LibConstants(\n _exchange,\n _zrxAssetData,\n _wethAssetData\n )\n MixinForwarderCore()\n {}\n}\n",
- "2.0.0/extensions/Forwarder/MixinAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"../../tokens/ERC20Token/IERC20Token.sol\";\nimport \"../../tokens/ERC721Token/IERC721Token.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MAssets.sol\";\n\n\ncontract MixinAssets is\n Ownable,\n LibConstants,\n MAssets\n{\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_TRANSFER_SELECTOR = bytes4(keccak256(\"transfer(address,uint256)\"));\n\n /// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to \n /// function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be\n /// used to withdraw assets that were accidentally sent to this contract.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of ERC20 token to withdraw.\n function withdrawAsset(\n bytes assetData,\n uint256 amount\n )\n external\n onlyOwner\n {\n transferAssetToSender(assetData, amount);\n }\n\n /// @dev Transfers given amount of asset to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferAssetToSender(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n bytes4 proxyId = assetData.readBytes4(0);\n\n if (proxyId == ERC20_DATA_ID) {\n transferERC20Token(assetData, amount);\n } else if (proxyId == ERC721_DATA_ID) {\n transferERC721Token(assetData, amount);\n } else {\n revert(\"UNSUPPORTED_ASSET_PROXY\");\n }\n }\n\n /// @dev Decodes ERC20 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC20Token(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n address token = assetData.readAddress(16);\n\n // Transfer tokens.\n // We do a raw call so we can check the success separate\n // from the return data.\n bool success = token.call(abi.encodeWithSelector(\n ERC20_TRANSFER_SELECTOR,\n msg.sender,\n amount\n ));\n require(\n success,\n \"TRANSFER_FAILED\"\n );\n \n // Check return data.\n // If there is no return data, we assume the token incorrectly\n // does not return a bool. In this case we expect it to revert\n // on failure, which was handled above.\n // If the token does return data, we require that it is a single\n // value that evaluates to true.\n assembly {\n if returndatasize {\n success := 0\n if eq(returndatasize, 32) {\n // First 64 bytes of memory are reserved scratch space\n returndatacopy(0, 0, 32)\n success := mload(0)\n }\n }\n }\n require(\n success,\n \"TRANSFER_FAILED\"\n );\n }\n\n /// @dev Decodes ERC721 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC721Token(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n require(\n amount == 1,\n \"INVALID_AMOUNT\"\n );\n // Decode asset data.\n address token = assetData.readAddress(16);\n uint256 tokenId = assetData.readUint256(36);\n\n // Perform transfer.\n IERC721Token(token).transferFrom(\n address(this),\n msg.sender,\n tokenId\n );\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MExchangeWrapper.sol\";\nimport \"../../protocol/Exchange/libs/LibAbiEncoder.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../protocol/Exchange/libs/LibFillResults.sol\";\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\n\n\ncontract MixinExchangeWrapper is\n LibAbiEncoder,\n LibFillResults,\n LibMath,\n LibConstants,\n MExchangeWrapper\n{\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n // ABI encode calldata for `fillOrder`\n bytes memory fillOrderCalldata = abiEncodeFillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n\n address exchange = address(EXCHANGE);\n\n // Call `fillOrder` and handle any exceptions gracefully\n assembly {\n let success := call(\n gas, // forward all gas\n exchange, // call address of Exchange contract\n 0, // transfer 0 wei\n add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes)\n mload(fillOrderCalldata), // length of input\n fillOrderCalldata, // write output over input\n 128 // output size is 128 bytes\n )\n if success {\n mstore(fillResults, mload(fillOrderCalldata))\n mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32)))\n mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64)))\n mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96)))\n }\n }\n // fillResults values will be 0 by default if call was unsuccessful\n return fillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of WETH has been sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param wethSellAmount Desired amount of WETH to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellWeth(\n LibOrder.Order[] memory orders,\n uint256 wethSellAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // We assume that asset being sold by taker is WETH for each order.\n orders[i].makerAssetData = makerAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of WETH to sell\n uint256 remainingTakerAssetFillAmount = safeSub(wethSellAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of WETH\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= wethSellAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// The asset being sold by taker must always be WETH.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyExactAmountWithWeth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // We assume that asset being sold by taker is WETH for each order.\n orders[i].makerAssetData = makerAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n uint256 makerAssetFilledAmount = totalFillResults.makerAssetFilledAmount;\n if (makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n\n require(\n makerAssetFilledAmount >= makerAssetFillAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return totalFillResults;\n }\n\n /// @dev Buys zrxBuyAmount of ZRX fee tokens, taking into account ZRX fees for each order. This will guarantee\n /// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues).\n /// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX\n /// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases.\n /// The asset being sold by taker must always be WETH. \n /// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset.\n /// @param zrxBuyAmount Desired amount of ZRX to buy.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return totalFillResults Amounts filled and fees paid by maker and taker.\n function marketBuyExactZrxWithWeth(\n LibOrder.Order[] memory orders,\n uint256 zrxBuyAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n // Do nothing if zrxBuyAmount == 0\n if (zrxBuyAmount == 0) {\n return totalFillResults;\n }\n\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n uint256 zrxPurchased = 0;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // All of these are ZRX/WETH, so we can drop the respective assetData from calldata.\n orders[i].makerAssetData = zrxAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of ZRX to buy.\n uint256 remainingZrxBuyAmount = safeSub(zrxBuyAmount, zrxPurchased);\n\n // Convert the remaining amount of ZRX to buy into remaining amount\n // of WETH to sell, assuming entire amount can be sold in the current order.\n uint256 remainingWethSellAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n safeSub(orders[i].makerAssetAmount, orders[i].takerFee), // our exchange rate after fees \n remainingZrxBuyAmount\n );\n\n // Attempt to sell the remaining amount of WETH.\n FillResults memory singleFillResult = fillOrderNoThrow(\n orders[i],\n safeAdd(remainingWethSellAmount, 1), // we add 1 wei to the fill amount to make up for rounding errors\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker.\n addFillResults(totalFillResults, singleFillResult);\n zrxPurchased = safeSub(totalFillResults.makerAssetFilledAmount, totalFillResults.takerFeePaid);\n\n // Stop execution if the entire amount of ZRX has been bought.\n if (zrxPurchased >= zrxBuyAmount) {\n break;\n }\n }\n\n require(\n zrxPurchased >= zrxBuyAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return totalFillResults;\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinForwarderCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MWeth.sol\";\nimport \"./mixins/MAssets.sol\";\nimport \"./mixins/MExchangeWrapper.sol\";\nimport \"./interfaces/IForwarderCore.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../protocol/Exchange/libs/LibFillResults.sol\";\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\n\n\ncontract MixinForwarderCore is\n LibFillResults,\n LibMath,\n LibConstants,\n MWeth,\n MAssets,\n MExchangeWrapper,\n IForwarderCore\n{\n using LibBytes for bytes;\n\n /// @dev Constructor approves ERC20 proxy to transfer ZRX and WETH on this contract's behalf.\n constructor ()\n public\n {\n address proxyAddress = EXCHANGE.getAssetProxy(ERC20_DATA_ID);\n require(\n proxyAddress != address(0),\n \"UNREGISTERED_ASSET_PROXY\"\n );\n ETHER_TOKEN.approve(proxyAddress, MAX_UINT);\n ZRX_TOKEN.approve(proxyAddress, MAX_UINT);\n }\n\n /// @dev Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketSellOrdersWithEth(\n LibOrder.Order[] memory orders,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n FillResults memory orderFillResults,\n FillResults memory feeOrderFillResults\n )\n {\n // Convert ETH to WETH.\n convertEthToWeth();\n\n uint256 wethSellAmount;\n uint256 zrxBuyAmount;\n uint256 makerAssetAmountPurchased;\n if (orders[0].makerAssetData.equals(ZRX_ASSET_DATA)) {\n // Calculate amount of WETH that won't be spent on ETH fees.\n wethSellAmount = getPartialAmountFloor(\n PERCENTAGE_DENOMINATOR,\n safeAdd(PERCENTAGE_DENOMINATOR, feePercentage),\n msg.value\n );\n // Market sell available WETH.\n // ZRX fees are paid with this contract's balance.\n orderFillResults = marketSellWeth(\n orders,\n wethSellAmount,\n signatures\n );\n // The fee amount must be deducted from the amount transfered back to sender.\n makerAssetAmountPurchased = safeSub(orderFillResults.makerAssetFilledAmount, orderFillResults.takerFeePaid);\n } else {\n // 5% of WETH is reserved for filling feeOrders and paying feeRecipient.\n wethSellAmount = getPartialAmountFloor(\n MAX_WETH_FILL_PERCENTAGE,\n PERCENTAGE_DENOMINATOR,\n msg.value\n );\n // Market sell 95% of WETH.\n // ZRX fees are payed with this contract's balance.\n orderFillResults = marketSellWeth(\n orders,\n wethSellAmount,\n signatures\n );\n // Buy back all ZRX spent on fees.\n zrxBuyAmount = orderFillResults.takerFeePaid;\n feeOrderFillResults = marketBuyExactZrxWithWeth(\n feeOrders,\n zrxBuyAmount,\n feeSignatures\n );\n makerAssetAmountPurchased = orderFillResults.makerAssetFilledAmount;\n }\n\n // Transfer feePercentage of total ETH spent on primary orders to feeRecipient.\n // Refund remaining ETH to msg.sender.\n transferEthFeeAndRefund(\n orderFillResults.takerAssetFilledAmount,\n feeOrderFillResults.takerAssetFilledAmount,\n feePercentage,\n feeRecipient\n );\n\n // Transfer purchased assets to msg.sender.\n transferAssetToSender(orders[0].makerAssetData, makerAssetAmountPurchased);\n }\n\n /// @dev Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param makerAssetFillAmount Desired amount of makerAsset to purchase.\n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketBuyOrdersWithEth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n FillResults memory orderFillResults,\n FillResults memory feeOrderFillResults\n )\n {\n // Convert ETH to WETH.\n convertEthToWeth();\n\n uint256 zrxBuyAmount;\n uint256 makerAssetAmountPurchased;\n if (orders[0].makerAssetData.equals(ZRX_ASSET_DATA)) {\n // If the makerAsset is ZRX, it is not necessary to pay fees out of this\n // contracts's ZRX balance because fees are factored into the price of the order.\n orderFillResults = marketBuyExactZrxWithWeth(\n orders,\n makerAssetFillAmount,\n signatures\n );\n // The fee amount must be deducted from the amount transfered back to sender.\n makerAssetAmountPurchased = safeSub(orderFillResults.makerAssetFilledAmount, orderFillResults.takerFeePaid);\n } else {\n // Attemp to purchase desired amount of makerAsset.\n // ZRX fees are payed with this contract's balance.\n orderFillResults = marketBuyExactAmountWithWeth(\n orders,\n makerAssetFillAmount,\n signatures\n );\n // Buy back all ZRX spent on fees.\n zrxBuyAmount = orderFillResults.takerFeePaid;\n feeOrderFillResults = marketBuyExactZrxWithWeth(\n feeOrders,\n zrxBuyAmount,\n feeSignatures\n );\n makerAssetAmountPurchased = orderFillResults.makerAssetFilledAmount;\n }\n\n // Transfer feePercentage of total ETH spent on primary orders to feeRecipient.\n // Refund remaining ETH to msg.sender.\n transferEthFeeAndRefund(\n orderFillResults.takerAssetFilledAmount,\n feeOrderFillResults.takerAssetFilledAmount,\n feePercentage,\n feeRecipient\n );\n\n // Transfer purchased assets to msg.sender.\n transferAssetToSender(orders[0].makerAssetData, makerAssetAmountPurchased);\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinWeth.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MWeth.sol\";\n\n\ncontract MixinWeth is\n LibMath,\n LibConstants,\n MWeth\n{\n /// @dev Default payabale function, this allows us to withdraw WETH\n function ()\n public\n payable\n {\n require(\n msg.sender == address(ETHER_TOKEN),\n \"DEFAULT_FUNCTION_WETH_CONTRACT_ONLY\"\n );\n }\n\n /// @dev Converts message call's ETH value into WETH.\n function convertEthToWeth()\n internal\n {\n require(\n msg.value > 0,\n \"INVALID_MSG_VALUE\"\n );\n ETHER_TOKEN.deposit.value(msg.value)();\n }\n\n /// @dev Transfers feePercentage of WETH spent on primary orders to feeRecipient.\n /// Refunds any excess ETH to msg.sender.\n /// @param wethSoldExcludingFeeOrders Amount of WETH sold when filling primary orders.\n /// @param wethSoldForZrx Amount of WETH sold when purchasing ZRX required for primary order fees.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n function transferEthFeeAndRefund(\n uint256 wethSoldExcludingFeeOrders,\n uint256 wethSoldForZrx,\n uint256 feePercentage,\n address feeRecipient\n )\n internal\n {\n // Ensure feePercentage is less than 5%.\n require(\n feePercentage <= MAX_FEE_PERCENTAGE,\n \"FEE_PERCENTAGE_TOO_LARGE\"\n );\n\n // Ensure that no extra WETH owned by this contract has been sold.\n uint256 wethSold = safeAdd(wethSoldExcludingFeeOrders, wethSoldForZrx);\n require(\n wethSold <= msg.value,\n \"OVERSOLD_WETH\"\n );\n\n // Calculate amount of WETH that hasn't been sold.\n uint256 wethRemaining = safeSub(msg.value, wethSold);\n\n // Calculate ETH fee to pay to feeRecipient.\n uint256 ethFee = getPartialAmountFloor(\n feePercentage,\n PERCENTAGE_DENOMINATOR,\n wethSoldExcludingFeeOrders\n );\n\n // Ensure fee is less than amount of WETH remaining.\n require(\n ethFee <= wethRemaining,\n \"INSUFFICIENT_ETH_REMAINING\"\n );\n \n // Do nothing if no WETH remaining\n if (wethRemaining > 0) {\n // Convert remaining WETH to ETH\n ETHER_TOKEN.withdraw(wethRemaining);\n\n // Pay ETH to feeRecipient\n if (ethFee > 0) {\n feeRecipient.transfer(ethFee);\n }\n\n // Refund remaining ETH to msg.sender.\n uint256 ethRefund = safeSub(wethRemaining, ethFee);\n if (ethRefund > 0) {\n msg.sender.transfer(ethRefund);\n }\n }\n }\n}\n",
- "2.0.0/extensions/Forwarder/interfaces/IAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IAssets {\n\n /// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to \n /// function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be\n /// used to withdraw assets that were accidentally sent to this contract.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of ERC20 token to withdraw.\n function withdrawAsset(\n bytes assetData,\n uint256 amount\n )\n external;\n}\n",
- "2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../../protocol/Exchange/libs/LibFillResults.sol\";\n\n\ncontract IForwarderCore {\n\n /// @dev Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketSellOrdersWithEth(\n LibOrder.Order[] memory orders,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n LibFillResults.FillResults memory orderFillResults,\n LibFillResults.FillResults memory feeOrderFillResults\n );\n\n /// @dev Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param makerAssetFillAmount Desired amount of makerAsset to purchase.\n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketBuyOrdersWithEth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n LibFillResults.FillResults memory orderFillResults,\n LibFillResults.FillResults memory feeOrderFillResults\n );\n}\n",
- "2.0.0/extensions/Forwarder/libs/LibConstants.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/LibBytes/LibBytes.sol\";\nimport \"../../../protocol/Exchange/interfaces/IExchange.sol\";\nimport \"../../../tokens/EtherToken/IEtherToken.sol\";\nimport \"../../../tokens/ERC20Token/IERC20Token.sol\";\n\n\ncontract LibConstants {\n\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n uint256 constant internal MAX_UINT = 2**256 - 1;\n uint256 constant internal PERCENTAGE_DENOMINATOR = 10**18; \n uint256 constant internal MAX_FEE_PERCENTAGE = 5 * PERCENTAGE_DENOMINATOR / 100; // 5%\n uint256 constant internal MAX_WETH_FILL_PERCENTAGE = 95 * PERCENTAGE_DENOMINATOR / 100; // 95%\n \n // solhint-disable var-name-mixedcase\n IExchange internal EXCHANGE;\n IEtherToken internal ETHER_TOKEN;\n IERC20Token internal ZRX_TOKEN;\n bytes internal ZRX_ASSET_DATA;\n bytes internal WETH_ASSET_DATA;\n // solhint-enable var-name-mixedcase\n\n constructor (\n address _exchange,\n bytes memory _zrxAssetData,\n bytes memory _wethAssetData\n )\n public\n {\n EXCHANGE = IExchange(_exchange);\n ZRX_ASSET_DATA = _zrxAssetData;\n WETH_ASSET_DATA = _wethAssetData;\n\n address etherToken = _wethAssetData.readAddress(16);\n address zrxToken = _zrxAssetData.readAddress(16);\n ETHER_TOKEN = IEtherToken(etherToken);\n ZRX_TOKEN = IERC20Token(zrxToken);\n }\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAssets.sol\";\n\n\ncontract MAssets is\n IAssets\n{\n /// @dev Transfers given amount of asset to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferAssetToSender(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n\n /// @dev Decodes ERC20 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC20Token(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n\n /// @dev Decodes ERC721 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC721Token(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../../protocol/Exchange/libs/LibFillResults.sol\";\n\n\ncontract MExchangeWrapper {\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of WETH has been sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param wethSellAmount Desired amount of WETH to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellWeth(\n LibOrder.Order[] memory orders,\n uint256 wethSellAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// The asset being sold by taker must always be WETH.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyExactAmountWithWeth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Buys zrxBuyAmount of ZRX fee tokens, taking into account ZRX fees for each order. This will guarantee\n /// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues).\n /// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX\n /// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases.\n /// The asset being sold by taker must always be WETH. \n /// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset.\n /// @param zrxBuyAmount Desired amount of ZRX to buy.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return totalFillResults Amounts filled and fees paid by maker and taker.\n function marketBuyExactZrxWithWeth(\n LibOrder.Order[] memory orders,\n uint256 zrxBuyAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MWeth.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract MWeth {\n\n /// @dev Converts message call's ETH value into WETH.\n function convertEthToWeth()\n internal;\n\n /// @dev Transfers feePercentage of WETH spent on primary orders to feeRecipient.\n /// Refunds any excess ETH to msg.sender.\n /// @param wethSoldExcludingFeeOrders Amount of WETH sold when filling primary orders.\n /// @param wethSoldForZrx Amount of WETH sold when purchasing ZRX required for primary order fees.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n function transferEthFeeAndRefund(\n uint256 wethSoldExcludingFeeOrders,\n uint256 wethSoldForZrx,\n uint256 feePercentage,\n address feeRecipient\n )\n internal;\n}\n",
- "2.0.0/extensions/OrderValidator/OrderValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../protocol/Exchange/interfaces/IExchange.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../tokens/ERC20Token/IERC20Token.sol\";\nimport \"../../tokens/ERC721Token/IERC721Token.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\n\n\ncontract OrderValidator {\n\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n\n struct TraderInfo {\n uint256 makerBalance; // Maker's balance of makerAsset\n uint256 makerAllowance; // Maker's allowance to corresponding AssetProxy\n uint256 takerBalance; // Taker's balance of takerAsset\n uint256 takerAllowance; // Taker's allowance to corresponding AssetProxy\n uint256 makerZrxBalance; // Maker's balance of ZRX\n uint256 makerZrxAllowance; // Maker's allowance of ZRX to ERC20Proxy\n uint256 takerZrxBalance; // Taker's balance of ZRX\n uint256 takerZrxAllowance; // Taker's allowance of ZRX to ERC20Proxy\n }\n\n // solhint-disable var-name-mixedcase\n IExchange internal EXCHANGE;\n bytes internal ZRX_ASSET_DATA;\n // solhint-enable var-name-mixedcase\n\n constructor (address _exchange, bytes memory _zrxAssetData)\n public\n {\n EXCHANGE = IExchange(_exchange);\n ZRX_ASSET_DATA = _zrxAssetData;\n }\n\n /// @dev Fetches information for order and maker/taker of order.\n /// @param order The order structure.\n /// @param takerAddress Address that will be filling the order.\n /// @return OrderInfo and TraderInfo instances for given order.\n function getOrderAndTraderInfo(LibOrder.Order memory order, address takerAddress)\n public\n view\n returns (LibOrder.OrderInfo memory orderInfo, TraderInfo memory traderInfo)\n {\n orderInfo = EXCHANGE.getOrderInfo(order);\n traderInfo = getTraderInfo(order, takerAddress);\n return (orderInfo, traderInfo);\n }\n\n /// @dev Fetches information for all passed in orders and the makers/takers of each order.\n /// @param orders Array of order specifications.\n /// @param takerAddresses Array of taker addresses corresponding to each order.\n /// @return Arrays of OrderInfo and TraderInfo instances that correspond to each order.\n function getOrdersAndTradersInfo(LibOrder.Order[] memory orders, address[] memory takerAddresses)\n public\n view\n returns (LibOrder.OrderInfo[] memory ordersInfo, TraderInfo[] memory tradersInfo)\n {\n ordersInfo = EXCHANGE.getOrdersInfo(orders);\n tradersInfo = getTradersInfo(orders, takerAddresses);\n return (ordersInfo, tradersInfo);\n }\n\n /// @dev Fetches balance and allowances for maker and taker of order.\n /// @param order The order structure.\n /// @param takerAddress Address that will be filling the order.\n /// @return Balances and allowances of maker and taker of order.\n function getTraderInfo(LibOrder.Order memory order, address takerAddress)\n public\n view\n returns (TraderInfo memory traderInfo)\n {\n (traderInfo.makerBalance, traderInfo.makerAllowance) = getBalanceAndAllowance(order.makerAddress, order.makerAssetData);\n (traderInfo.takerBalance, traderInfo.takerAllowance) = getBalanceAndAllowance(takerAddress, order.takerAssetData);\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n (traderInfo.makerZrxBalance, traderInfo.makerZrxAllowance) = getBalanceAndAllowance(order.makerAddress, zrxAssetData);\n (traderInfo.takerZrxBalance, traderInfo.takerZrxAllowance) = getBalanceAndAllowance(takerAddress, zrxAssetData);\n return traderInfo;\n }\n\n /// @dev Fetches balances and allowances of maker and taker for each provided order.\n /// @param orders Array of order specifications.\n /// @param takerAddresses Array of taker addresses corresponding to each order.\n /// @return Array of balances and allowances for maker and taker of each order.\n function getTradersInfo(LibOrder.Order[] memory orders, address[] memory takerAddresses)\n public\n view\n returns (TraderInfo[] memory)\n {\n uint256 ordersLength = orders.length;\n TraderInfo[] memory tradersInfo = new TraderInfo[](ordersLength);\n for (uint256 i = 0; i != ordersLength; i++) {\n tradersInfo[i] = getTraderInfo(orders[i], takerAddresses[i]);\n }\n return tradersInfo;\n }\n\n /// @dev Fetches token balances and allowances of an address to given assetProxy. Supports ERC20 and ERC721.\n /// @param target Address to fetch balances and allowances of.\n /// @param assetData Encoded data that can be decoded by a specified proxy contract when transferring asset.\n /// @return Balance of asset and allowance set to given proxy of asset.\n /// For ERC721 tokens, these values will always be 1 or 0.\n function getBalanceAndAllowance(address target, bytes memory assetData)\n public\n view\n returns (uint256 balance, uint256 allowance)\n {\n bytes4 assetProxyId = assetData.readBytes4(0);\n address token = assetData.readAddress(16);\n address assetProxy = EXCHANGE.getAssetProxy(assetProxyId);\n\n if (assetProxyId == ERC20_DATA_ID) {\n // Query balance\n balance = IERC20Token(token).balanceOf(target);\n\n // Query allowance\n allowance = IERC20Token(token).allowance(target, assetProxy);\n } else if (assetProxyId == ERC721_DATA_ID) {\n uint256 tokenId = assetData.readUint256(36);\n\n // Query owner of tokenId\n address owner = getERC721TokenOwner(token, tokenId);\n\n // Set balance to 1 if tokenId is owned by target\n balance = target == owner ? 1 : 0;\n\n // Check if ERC721Proxy is approved to spend tokenId\n bool isApproved = IERC721Token(token).isApprovedForAll(target, assetProxy) || IERC721Token(token).getApproved(tokenId) == assetProxy;\n \n // Set alowance to 1 if ERC721Proxy is approved to spend tokenId\n allowance = isApproved ? 1 : 0;\n } else {\n revert(\"UNSUPPORTED_ASSET_PROXY\");\n }\n return (balance, allowance);\n }\n\n /// @dev Fetches token balances and allowances of an address for each given assetProxy. Supports ERC20 and ERC721.\n /// @param target Address to fetch balances and allowances of.\n /// @param assetData Array of encoded byte arrays that can be decoded by a specified proxy contract when transferring asset.\n /// @return Balances and allowances of assets.\n /// For ERC721 tokens, these values will always be 1 or 0.\n function getBalancesAndAllowances(address target, bytes[] memory assetData)\n public\n view\n returns (uint256[] memory, uint256[] memory)\n {\n uint256 length = assetData.length;\n uint256[] memory balances = new uint256[](length);\n uint256[] memory allowances = new uint256[](length);\n for (uint256 i = 0; i != length; i++) {\n (balances[i], allowances[i]) = getBalanceAndAllowance(target, assetData[i]);\n }\n return (balances, allowances);\n }\n\n /// @dev Calls `token.ownerOf(tokenId)`, but returns a null owner instead of reverting on an unowned token.\n /// @param token Address of ERC721 token.\n /// @param tokenId The identifier for the specific NFT.\n /// @return Owner of tokenId or null address if unowned.\n function getERC721TokenOwner(address token, uint256 tokenId)\n public\n view\n returns (address owner)\n {\n assembly {\n // load free memory pointer\n let cdStart := mload(64)\n\n // bytes4(keccak256(ownerOf(uint256))) = 0x6352211e\n mstore(cdStart, 0x6352211e00000000000000000000000000000000000000000000000000000000)\n mstore(add(cdStart, 4), tokenId)\n\n // staticcall `ownerOf(tokenId)`\n // `ownerOf` will revert if tokenId is not owned\n let success := staticcall(\n gas, // forward all gas\n token, // call token contract\n cdStart, // start of calldata\n 36, // length of input is 36 bytes\n cdStart, // write output over input\n 32 // size of output is 32 bytes\n )\n\n // Success implies that tokenId is owned\n // Copy owner from return data if successful\n if success {\n owner := mload(cdStart)\n } \n }\n\n // Owner initialized to address(0), no need to modify if call is unsuccessful\n return owner;\n }\n}\n",
- "2.0.0/multisig/MultiSigWallet.sol": "// solhint-disable\npragma solidity ^0.4.15;\n\n\n/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.\n/// @author Stefan George - <stefan.george@consensys.net>\ncontract MultiSigWallet {\n\n /*\n * Events\n */\n event Confirmation(address indexed sender, uint indexed transactionId);\n event Revocation(address indexed sender, uint indexed transactionId);\n event Submission(uint indexed transactionId);\n event Execution(uint indexed transactionId);\n event ExecutionFailure(uint indexed transactionId);\n event Deposit(address indexed sender, uint value);\n event OwnerAddition(address indexed owner);\n event OwnerRemoval(address indexed owner);\n event RequirementChange(uint required);\n\n /*\n * Constants\n */\n uint constant public MAX_OWNER_COUNT = 50;\n\n /*\n * Storage\n */\n mapping (uint => Transaction) public transactions;\n mapping (uint => mapping (address => bool)) public confirmations;\n mapping (address => bool) public isOwner;\n address[] public owners;\n uint public required;\n uint public transactionCount;\n\n struct Transaction {\n address destination;\n uint value;\n bytes data;\n bool executed;\n }\n\n /*\n * Modifiers\n */\n modifier onlyWallet() {\n require(msg.sender == address(this));\n _;\n }\n\n modifier ownerDoesNotExist(address owner) {\n require(!isOwner[owner]);\n _;\n }\n\n modifier ownerExists(address owner) {\n require(isOwner[owner]);\n _;\n }\n\n modifier transactionExists(uint transactionId) {\n require(transactions[transactionId].destination != 0);\n _;\n }\n\n modifier confirmed(uint transactionId, address owner) {\n require(confirmations[transactionId][owner]);\n _;\n }\n\n modifier notConfirmed(uint transactionId, address owner) {\n require(!confirmations[transactionId][owner]);\n _;\n }\n\n modifier notExecuted(uint transactionId) {\n require(!transactions[transactionId].executed);\n _;\n }\n\n modifier notNull(address _address) {\n require(_address != 0);\n _;\n }\n\n modifier validRequirement(uint ownerCount, uint _required) {\n require(ownerCount <= MAX_OWNER_COUNT\n && _required <= ownerCount\n && _required != 0\n && ownerCount != 0);\n _;\n }\n\n /// @dev Fallback function allows to deposit ether.\n function()\n payable\n {\n if (msg.value > 0)\n Deposit(msg.sender, msg.value);\n }\n\n /*\n * Public functions\n */\n /// @dev Contract constructor sets initial owners and required number of confirmations.\n /// @param _owners List of initial owners.\n /// @param _required Number of required confirmations.\n function MultiSigWallet(address[] _owners, uint _required)\n public\n validRequirement(_owners.length, _required)\n {\n for (uint i=0; i<_owners.length; i++) {\n require(!isOwner[_owners[i]] && _owners[i] != 0);\n isOwner[_owners[i]] = true;\n }\n owners = _owners;\n required = _required;\n }\n\n /// @dev Allows to add a new owner. Transaction has to be sent by wallet.\n /// @param owner Address of new owner.\n function addOwner(address owner)\n public\n onlyWallet\n ownerDoesNotExist(owner)\n notNull(owner)\n validRequirement(owners.length + 1, required)\n {\n isOwner[owner] = true;\n owners.push(owner);\n OwnerAddition(owner);\n }\n\n /// @dev Allows to remove an owner. Transaction has to be sent by wallet.\n /// @param owner Address of owner.\n function removeOwner(address owner)\n public\n onlyWallet\n ownerExists(owner)\n {\n isOwner[owner] = false;\n for (uint i=0; i<owners.length - 1; i++)\n if (owners[i] == owner) {\n owners[i] = owners[owners.length - 1];\n break;\n }\n owners.length -= 1;\n if (required > owners.length)\n changeRequirement(owners.length);\n OwnerRemoval(owner);\n }\n\n /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet.\n /// @param owner Address of owner to be replaced.\n /// @param newOwner Address of new owner.\n function replaceOwner(address owner, address newOwner)\n public\n onlyWallet\n ownerExists(owner)\n ownerDoesNotExist(newOwner)\n {\n for (uint i=0; i<owners.length; i++)\n if (owners[i] == owner) {\n owners[i] = newOwner;\n break;\n }\n isOwner[owner] = false;\n isOwner[newOwner] = true;\n OwnerRemoval(owner);\n OwnerAddition(newOwner);\n }\n\n /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet.\n /// @param _required Number of required confirmations.\n function changeRequirement(uint _required)\n public\n onlyWallet\n validRequirement(owners.length, _required)\n {\n required = _required;\n RequirementChange(_required);\n }\n\n /// @dev Allows an owner to submit and confirm a transaction.\n /// @param destination Transaction target address.\n /// @param value Transaction ether value.\n /// @param data Transaction data payload.\n /// @return Returns transaction ID.\n function submitTransaction(address destination, uint value, bytes data)\n public\n returns (uint transactionId)\n {\n transactionId = addTransaction(destination, value, data);\n confirmTransaction(transactionId);\n }\n\n /// @dev Allows an owner to confirm a transaction.\n /// @param transactionId Transaction ID.\n function confirmTransaction(uint transactionId)\n public\n ownerExists(msg.sender)\n transactionExists(transactionId)\n notConfirmed(transactionId, msg.sender)\n {\n confirmations[transactionId][msg.sender] = true;\n Confirmation(msg.sender, transactionId);\n executeTransaction(transactionId);\n }\n\n /// @dev Allows an owner to revoke a confirmation for a transaction.\n /// @param transactionId Transaction ID.\n function revokeConfirmation(uint transactionId)\n public\n ownerExists(msg.sender)\n confirmed(transactionId, msg.sender)\n notExecuted(transactionId)\n {\n confirmations[transactionId][msg.sender] = false;\n Revocation(msg.sender, transactionId);\n }\n\n /// @dev Allows anyone to execute a confirmed transaction.\n /// @param transactionId Transaction ID.\n function executeTransaction(uint transactionId)\n public\n ownerExists(msg.sender)\n confirmed(transactionId, msg.sender)\n notExecuted(transactionId)\n {\n if (isConfirmed(transactionId)) {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data))\n Execution(transactionId);\n else {\n ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n }\n\n // call has been separated into its own function in order to take advantage\n // of the Solidity's code generator to produce a loop that copies tx.data into memory.\n function external_call(address destination, uint value, uint dataLength, bytes data) internal returns (bool) {\n bool result;\n assembly {\n let x := mload(0x40) // \"Allocate\" memory for output (0x40 is where \"free memory\" pointer is stored by convention)\n let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that\n result := call(\n sub(gas, 34710), // 34710 is the value that solidity is currently emitting\n // It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) +\n // callNewAccountGas (25000, in case the destination address does not exist and needs creating)\n destination,\n value,\n d,\n dataLength, // Size of the input (in bytes) - this is what fixes the padding problem\n x,\n 0 // Output is ignored, therefore the output size is zero\n )\n }\n return result;\n }\n\n /// @dev Returns the confirmation status of a transaction.\n /// @param transactionId Transaction ID.\n /// @return Confirmation status.\n function isConfirmed(uint transactionId)\n public\n constant\n returns (bool)\n {\n uint count = 0;\n for (uint i=0; i<owners.length; i++) {\n if (confirmations[transactionId][owners[i]])\n count += 1;\n if (count == required)\n return true;\n }\n }\n\n /*\n * Internal functions\n */\n /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet.\n /// @param destination Transaction target address.\n /// @param value Transaction ether value.\n /// @param data Transaction data payload.\n /// @return Returns transaction ID.\n function addTransaction(address destination, uint value, bytes data)\n internal\n notNull(destination)\n returns (uint transactionId)\n {\n transactionId = transactionCount;\n transactions[transactionId] = Transaction({\n destination: destination,\n value: value,\n data: data,\n executed: false\n });\n transactionCount += 1;\n Submission(transactionId);\n }\n\n /*\n * Web3 call functions\n */\n /// @dev Returns number of confirmations of a transaction.\n /// @param transactionId Transaction ID.\n /// @return Number of confirmations.\n function getConfirmationCount(uint transactionId)\n public\n constant\n returns (uint count)\n {\n for (uint i=0; i<owners.length; i++)\n if (confirmations[transactionId][owners[i]])\n count += 1;\n }\n\n /// @dev Returns total number of transactions after filers are applied.\n /// @param pending Include pending transactions.\n /// @param executed Include executed transactions.\n /// @return Total number of transactions after filters are applied.\n function getTransactionCount(bool pending, bool executed)\n public\n constant\n returns (uint count)\n {\n for (uint i=0; i<transactionCount; i++)\n if ( pending && !transactions[i].executed\n || executed && transactions[i].executed)\n count += 1;\n }\n\n /// @dev Returns list of owners.\n /// @return List of owner addresses.\n function getOwners()\n public\n constant\n returns (address[])\n {\n return owners;\n }\n\n /// @dev Returns array with owner addresses, which confirmed transaction.\n /// @param transactionId Transaction ID.\n /// @return Returns array of owner addresses.\n function getConfirmations(uint transactionId)\n public\n constant\n returns (address[] _confirmations)\n {\n address[] memory confirmationsTemp = new address[](owners.length);\n uint count = 0;\n uint i;\n for (i=0; i<owners.length; i++)\n if (confirmations[transactionId][owners[i]]) {\n confirmationsTemp[count] = owners[i];\n count += 1;\n }\n _confirmations = new address[](count);\n for (i=0; i<count; i++)\n _confirmations[i] = confirmationsTemp[i];\n }\n\n /// @dev Returns list of transaction IDs in defined range.\n /// @param from Index start position of transaction array.\n /// @param to Index end position of transaction array.\n /// @param pending Include pending transactions.\n /// @param executed Include executed transactions.\n /// @return Returns array of transaction IDs.\n function getTransactionIds(uint from, uint to, bool pending, bool executed)\n public\n constant\n returns (uint[] _transactionIds)\n {\n uint[] memory transactionIdsTemp = new uint[](transactionCount);\n uint count = 0;\n uint i;\n for (i=0; i<transactionCount; i++)\n if ( pending && !transactions[i].executed\n || executed && transactions[i].executed)\n {\n transactionIdsTemp[count] = i;\n count += 1;\n }\n _transactionIds = new uint[](to - from);\n for (i=from; i<to; i++)\n _transactionIds[i - from] = transactionIdsTemp[i];\n }\n}",
- "2.0.0/multisig/MultiSigWalletWithTimeLock.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MultiSigWallet.sol\";\n\n\n/// @title Multisignature wallet with time lock- Allows multiple parties to execute a transaction after a time lock has passed.\n/// @author Amir Bandeali - <amir@0xProject.com>\n// solhint-disable not-rely-on-time\ncontract MultiSigWalletWithTimeLock is\n MultiSigWallet\n{\n event ConfirmationTimeSet(uint256 indexed transactionId, uint256 confirmationTime);\n event TimeLockChange(uint256 secondsTimeLocked);\n\n uint256 public secondsTimeLocked;\n\n mapping (uint256 => uint256) public confirmationTimes;\n\n modifier notFullyConfirmed(uint256 transactionId) {\n require(\n !isConfirmed(transactionId),\n \"TX_FULLY_CONFIRMED\"\n );\n _;\n }\n\n modifier fullyConfirmed(uint256 transactionId) {\n require(\n isConfirmed(transactionId),\n \"TX_NOT_FULLY_CONFIRMED\"\n );\n _;\n }\n\n modifier pastTimeLock(uint256 transactionId) {\n require(\n block.timestamp >= confirmationTimes[transactionId] + secondsTimeLocked,\n \"TIME_LOCK_INCOMPLETE\"\n );\n _;\n }\n\n /// @dev Contract constructor sets initial owners, required number of confirmations, and time lock.\n /// @param _owners List of initial owners.\n /// @param _required Number of required confirmations.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n constructor (\n address[] _owners,\n uint256 _required,\n uint256 _secondsTimeLocked\n )\n public\n MultiSigWallet(_owners, _required)\n {\n secondsTimeLocked = _secondsTimeLocked;\n }\n\n /// @dev Changes the duration of the time lock for transactions.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n function changeTimeLock(uint256 _secondsTimeLocked)\n public\n onlyWallet\n {\n secondsTimeLocked = _secondsTimeLocked;\n emit TimeLockChange(_secondsTimeLocked);\n }\n\n /// @dev Allows an owner to confirm a transaction.\n /// @param transactionId Transaction ID.\n function confirmTransaction(uint256 transactionId)\n public\n ownerExists(msg.sender)\n transactionExists(transactionId)\n notConfirmed(transactionId, msg.sender)\n notFullyConfirmed(transactionId)\n {\n confirmations[transactionId][msg.sender] = true;\n emit Confirmation(msg.sender, transactionId);\n if (isConfirmed(transactionId)) {\n setConfirmationTime(transactionId, block.timestamp);\n }\n }\n\n /// @dev Allows anyone to execute a confirmed transaction.\n /// @param transactionId Transaction ID.\n function executeTransaction(uint256 transactionId)\n public\n notExecuted(transactionId)\n fullyConfirmed(transactionId)\n pastTimeLock(transactionId)\n {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) {\n emit Execution(transactionId);\n } else {\n emit ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n\n /// @dev Sets the time of when a submission first passed.\n function setConfirmationTime(uint256 transactionId, uint256 confirmationTime)\n internal\n {\n confirmationTimes[transactionId] = confirmationTime;\n emit ConfirmationTimeSet(transactionId, confirmationTime);\n }\n}\n",
- "2.0.0/protocol/AssetProxy/ERC20Proxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MixinAuthorizable.sol\";\n\n\ncontract ERC20Proxy is\n MixinAuthorizable\n{\n // Id of this proxy.\n bytes4 constant internal PROXY_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n \n // solhint-disable-next-line payable-fallback\n function () \n external\n {\n assembly {\n // The first 4 bytes of calldata holds the function selector\n let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)\n\n // `transferFrom` will be called with the following parameters:\n // assetData Encoded byte array.\n // from Address to transfer asset from.\n // to Address to transfer asset to.\n // amount Amount of asset to transfer.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {\n\n // To lookup a value in a mapping, we load from the storage location keccak256(k, p),\n // where k is the key left padded to 32 bytes and p is the storage slot\n let start := mload(64)\n mstore(start, and(caller, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(start, 32), authorized_slot)\n\n // Revert if authorized[msg.sender] == false\n if iszero(sload(keccak256(start, 64))) {\n // Revert with `Error(\"SENDER_NOT_AUTHORIZED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // `transferFrom`.\n // The function is marked `external`, so no abi decodeding is done for\n // us. Instead, we expect the `calldata` memory to contain the\n // following:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n //\n // (*): offset is computed from start of function parameters, so offset\n // by an additional 4 bytes in the calldata.\n //\n // (**): see table below to compute length of assetData Contents\n //\n // WARNING: The ABIv2 specification allows additional padding between\n // the Params and Data section. This will result in a larger\n // offset to assetData.\n\n // Asset data itself is encoded as follows:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 1 * 32 | function parameters: |\n // | | 4 | 12 + 20 | 1. token address |\n\n // We construct calldata for the `token.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 4 | | 1. from |\n // | | 36 | | 2. to |\n // | | 68 | | 3. amount |\n\n /////// Read token address from calldata ///////\n // * The token address is stored in `assetData`.\n //\n // * The \"offset to assetData\" is stored at offset 4 in the calldata (table 1).\n // [assetDataOffsetFromParams = calldataload(4)]\n //\n // * Notes that the \"offset to assetData\" is relative to the \"Params\" area of calldata;\n // add 4 bytes to account for the length of the \"Header\" area (table 1).\n // [assetDataOffsetFromHeader = assetDataOffsetFromParams + 4]\n //\n // * The \"token address\" is offset 32+4=36 bytes into \"assetData\" (tables 1 & 2).\n // [tokenOffset = assetDataOffsetFromHeader + 36 = calldataload(4) + 4 + 36]\n let token := calldataload(add(calldataload(4), 40))\n \n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFrom` selector.\n // Any trailing data in transferFromSelector will be\n // overwritten in the next `mstore` call.\n mstore(0, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // We copy the fields `from`, `to` and `amount` in bulk\n // from our own calldata to the new calldata.\n calldatacopy(4, 36, 96)\n\n /////// Call `token.transferFrom` using the calldata ///////\n let success := call(\n gas, // forward all gas\n token, // call address of token contract\n 0, // don't send any ETH\n 0, // pointer to start of input\n 100, // length of input\n 0, // write output over input\n 32 // output size should be 32 bytes\n )\n\n /////// Check return data. ///////\n // If there is no return data, we assume the token incorrectly\n // does not return a bool. In this case we expect it to revert\n // on failure, which was handled above.\n // If the token does return data, we require that it is a single\n // nonzero 32 bytes value.\n // So the transfer succeeded if the call succeeded and either\n // returned nothing, or returned a non-zero 32 byte value. \n success := and(success, or(\n iszero(returndatasize),\n and(\n eq(returndatasize, 32),\n gt(mload(0), 0)\n )\n ))\n if success {\n return(0, 0)\n }\n \n // Revert with `Error(\"TRANSFER_FAILED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // Revert if undefined function is called\n revert(0, 0)\n }\n }\n\n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4)\n {\n return PROXY_ID;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/ERC721Proxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MixinAuthorizable.sol\";\n\n\ncontract ERC721Proxy is\n MixinAuthorizable\n{\n // Id of this proxy.\n bytes4 constant internal PROXY_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n\n // solhint-disable-next-line payable-fallback\n function () \n external\n {\n assembly {\n // The first 4 bytes of calldata holds the function selector\n let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)\n\n // `transferFrom` will be called with the following parameters:\n // assetData Encoded byte array.\n // from Address to transfer asset from.\n // to Address to transfer asset to.\n // amount Amount of asset to transfer.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {\n\n // To lookup a value in a mapping, we load from the storage location keccak256(k, p),\n // where k is the key left padded to 32 bytes and p is the storage slot\n let start := mload(64)\n mstore(start, and(caller, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(start, 32), authorized_slot)\n\n // Revert if authorized[msg.sender] == false\n if iszero(sload(keccak256(start, 64))) {\n // Revert with `Error(\"SENDER_NOT_AUTHORIZED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // `transferFrom`.\n // The function is marked `external`, so no abi decodeding is done for\n // us. Instead, we expect the `calldata` memory to contain the\n // following:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n //\n // (*): offset is computed from start of function parameters, so offset\n // by an additional 4 bytes in the calldata.\n //\n // (**): see table below to compute length of assetData Contents\n //\n // WARNING: The ABIv2 specification allows additional padding between\n // the Params and Data section. This will result in a larger\n // offset to assetData.\n\n // Asset data itself is encoded as follows:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 2 * 32 | function parameters: |\n // | | 4 | 12 + 20 | 1. token address |\n // | | 36 | | 2. tokenId |\n \n // We construct calldata for the `token.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n // \n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 4 | | 1. from |\n // | | 36 | | 2. to |\n // | | 68 | | 3. tokenId |\n\n // There exists only 1 of each token.\n // require(amount == 1, \"INVALID_AMOUNT\")\n if sub(calldataload(100), 1) {\n // Revert with `Error(\"INVALID_AMOUNT\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000e494e56414c49445f414d4f554e540000000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFrom` selector.\n // Any trailing data in transferFromSelector will be\n // overwritten in the next `mstore` call.\n mstore(0, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // We copy the fields `from` and `to` in bulk\n // from our own calldata to the new calldata.\n calldatacopy(4, 36, 64)\n\n // Copy `tokenId` field from our own calldata to the new calldata.\n let assetDataOffset := calldataload(4)\n calldatacopy(68, add(assetDataOffset, 72), 32)\n\n /////// Call `token.transferFrom` using the calldata ///////\n let token := calldataload(add(assetDataOffset, 40))\n let success := call(\n gas, // forward all gas\n token, // call address of token contract\n 0, // don't send any ETH\n 0, // pointer to start of input\n 100, // length of input\n 0, // write output to null\n 0 // output size is 0 bytes\n )\n if success {\n return(0, 0)\n }\n \n // Revert with `Error(\"TRANSFER_FAILED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // Revert if undefined function is called\n revert(0, 0)\n }\n }\n\n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4)\n {\n return PROXY_ID;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/MixinAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"./mixins/MAuthorizable.sol\";\n\n\ncontract MixinAuthorizable is\n Ownable,\n MAuthorizable\n{\n /// @dev Only authorized addresses can invoke functions with this modifier.\n modifier onlyAuthorized {\n require(\n authorized[msg.sender],\n \"SENDER_NOT_AUTHORIZED\"\n );\n _;\n }\n\n mapping (address => bool) public authorized;\n address[] public authorities;\n\n /// @dev Authorizes an address.\n /// @param target Address to authorize.\n function addAuthorizedAddress(address target)\n external\n onlyOwner\n {\n require(\n !authorized[target],\n \"TARGET_ALREADY_AUTHORIZED\"\n );\n\n authorized[target] = true;\n authorities.push(target);\n emit AuthorizedAddressAdded(target, msg.sender);\n }\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n function removeAuthorizedAddress(address target)\n external\n onlyOwner\n {\n require(\n authorized[target],\n \"TARGET_NOT_AUTHORIZED\"\n );\n\n delete authorized[target];\n for (uint256 i = 0; i < authorities.length; i++) {\n if (authorities[i] == target) {\n authorities[i] = authorities[authorities.length - 1];\n authorities.length -= 1;\n break;\n }\n }\n emit AuthorizedAddressRemoved(target, msg.sender);\n }\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n /// @param index Index of target in authorities array.\n function removeAuthorizedAddressAtIndex(\n address target,\n uint256 index\n )\n external\n onlyOwner\n {\n require(\n authorized[target],\n \"TARGET_NOT_AUTHORIZED\"\n );\n require(\n index < authorities.length,\n \"INDEX_OUT_OF_BOUNDS\"\n );\n require(\n authorities[index] == target,\n \"AUTHORIZED_ADDRESS_MISMATCH\"\n );\n\n delete authorized[target];\n authorities[index] = authorities[authorities.length - 1];\n authorities.length -= 1;\n emit AuthorizedAddressRemoved(target, msg.sender);\n }\n\n /// @dev Gets all authorized addresses.\n /// @return Array of authorized addresses.\n function getAuthorizedAddresses()\n external\n view\n returns (address[] memory)\n {\n return authorities;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IAuthorizable.sol\";\n\n\ncontract IAssetProxy is\n IAuthorizable\n{\n /// @dev Transfers assets. Either succeeds or throws.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param from Address to transfer asset from.\n /// @param to Address to transfer asset to.\n /// @param amount Amount of asset to transfer.\n function transferFrom(\n bytes assetData,\n address from,\n address to,\n uint256 amount\n )\n external;\n \n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4);\n}\n",
- "2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/Ownable/IOwnable.sol\";\n\n\ncontract IAuthorizable is\n IOwnable\n{\n /// @dev Authorizes an address.\n /// @param target Address to authorize.\n function addAuthorizedAddress(address target)\n external;\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n function removeAuthorizedAddress(address target)\n external;\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n /// @param index Index of target in authorities array.\n function removeAuthorizedAddressAtIndex(\n address target,\n uint256 index\n )\n external;\n \n /// @dev Gets all authorized addresses.\n /// @return Array of authorized addresses.\n function getAuthorizedAddresses()\n external\n view\n returns (address[] memory);\n}\n",
- "2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAuthorizable.sol\";\n\n\ncontract MAuthorizable is\n IAuthorizable\n{\n // Event logged when a new address is authorized.\n event AuthorizedAddressAdded(\n address indexed target,\n address indexed caller\n );\n\n // Event logged when a currently authorized address is unauthorized.\n event AuthorizedAddressRemoved(\n address indexed target,\n address indexed caller\n );\n\n /// @dev Only authorized addresses can invoke functions with this modifier.\n modifier onlyAuthorized { revert(); _; }\n}\n",
- "2.0.0/protocol/AssetProxyOwner/AssetProxyOwner.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../multisig/MultiSigWalletWithTimeLock.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\n\n\ncontract AssetProxyOwner is\n MultiSigWalletWithTimeLock\n{\n using LibBytes for bytes;\n\n event AssetProxyRegistration(address assetProxyContract, bool isRegistered);\n\n // Mapping of AssetProxy contract address =>\n // if this contract is allowed to call the AssetProxy's `removeAuthorizedAddressAtIndex` method without a time lock.\n mapping (address => bool) public isAssetProxyRegistered;\n\n bytes4 constant internal REMOVE_AUTHORIZED_ADDRESS_AT_INDEX_SELECTOR = bytes4(keccak256(\"removeAuthorizedAddressAtIndex(address,uint256)\"));\n\n /// @dev Function will revert if the transaction does not call `removeAuthorizedAddressAtIndex`\n /// on an approved AssetProxy contract.\n modifier validRemoveAuthorizedAddressAtIndexTx(uint256 transactionId) {\n Transaction storage txn = transactions[transactionId];\n require(\n isAssetProxyRegistered[txn.destination],\n \"UNREGISTERED_ASSET_PROXY\"\n );\n require(\n txn.data.readBytes4(0) == REMOVE_AUTHORIZED_ADDRESS_AT_INDEX_SELECTOR,\n \"INVALID_FUNCTION_SELECTOR\"\n );\n _;\n }\n\n /// @dev Contract constructor sets initial owners, required number of confirmations,\n /// time lock, and list of AssetProxy addresses.\n /// @param _owners List of initial owners.\n /// @param _assetProxyContracts Array of AssetProxy contract addresses.\n /// @param _required Number of required confirmations.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n constructor (\n address[] memory _owners,\n address[] memory _assetProxyContracts,\n uint256 _required,\n uint256 _secondsTimeLocked\n )\n public\n MultiSigWalletWithTimeLock(_owners, _required, _secondsTimeLocked)\n {\n for (uint256 i = 0; i < _assetProxyContracts.length; i++) {\n address assetProxy = _assetProxyContracts[i];\n require(\n assetProxy != address(0),\n \"INVALID_ASSET_PROXY\"\n );\n isAssetProxyRegistered[assetProxy] = true;\n }\n }\n\n /// @dev Registers or deregisters an AssetProxy to be able to execute\n /// `removeAuthorizedAddressAtIndex` without a timelock.\n /// @param assetProxyContract Address of AssetProxy contract.\n /// @param isRegistered Status of approval for AssetProxy contract.\n function registerAssetProxy(address assetProxyContract, bool isRegistered)\n public\n onlyWallet\n notNull(assetProxyContract)\n {\n isAssetProxyRegistered[assetProxyContract] = isRegistered;\n emit AssetProxyRegistration(assetProxyContract, isRegistered);\n }\n\n /// @dev Allows execution of `removeAuthorizedAddressAtIndex` without time lock.\n /// @param transactionId Transaction ID.\n function executeRemoveAuthorizedAddressAtIndex(uint256 transactionId)\n public\n notExecuted(transactionId)\n fullyConfirmed(transactionId)\n validRemoveAuthorizedAddressAtIndexTx(transactionId)\n {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) {\n emit Execution(transactionId);\n } else {\n emit ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/Exchange.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./MixinExchangeCore.sol\";\nimport \"./MixinSignatureValidator.sol\";\nimport \"./MixinWrapperFunctions.sol\";\nimport \"./MixinAssetProxyDispatcher.sol\";\nimport \"./MixinTransactions.sol\";\nimport \"./MixinMatchOrders.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract Exchange is\n MixinExchangeCore,\n MixinMatchOrders,\n MixinSignatureValidator,\n MixinTransactions,\n MixinAssetProxyDispatcher,\n MixinWrapperFunctions\n{\n string constant public VERSION = \"2.0.0\";\n\n // Mixins are instantiated in the order they are inherited\n constructor ()\n public\n MixinExchangeCore()\n MixinMatchOrders()\n MixinSignatureValidator()\n MixinTransactions()\n MixinAssetProxyDispatcher()\n MixinWrapperFunctions()\n {}\n}\n",
- "2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\nimport \"../AssetProxy/interfaces/IAssetProxy.sol\";\n\n\ncontract MixinAssetProxyDispatcher is\n Ownable,\n MAssetProxyDispatcher\n{\n // Mapping from Asset Proxy Id's to their respective Asset Proxy\n mapping (bytes4 => IAssetProxy) public assetProxies;\n\n /// @dev Registers an asset proxy to its asset proxy id.\n /// Once an asset proxy is registered, it cannot be unregistered.\n /// @param assetProxy Address of new asset proxy to register.\n function registerAssetProxy(address assetProxy)\n external\n onlyOwner\n {\n IAssetProxy assetProxyContract = IAssetProxy(assetProxy);\n\n // Ensure that no asset proxy exists with current id.\n bytes4 assetProxyId = assetProxyContract.getProxyId();\n address currentAssetProxy = assetProxies[assetProxyId];\n require(\n currentAssetProxy == address(0),\n \"ASSET_PROXY_ALREADY_EXISTS\"\n );\n\n // Add asset proxy and log registration.\n assetProxies[assetProxyId] = assetProxyContract;\n emit AssetProxyRegistered(\n assetProxyId,\n assetProxy\n );\n }\n\n /// @dev Gets an asset proxy.\n /// @param assetProxyId Id of the asset proxy.\n /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered.\n function getAssetProxy(bytes4 assetProxyId)\n external\n view\n returns (address)\n {\n return assetProxies[assetProxyId];\n }\n\n /// @dev Forwards arguments to assetProxy and calls `transferFrom`. Either succeeds or throws.\n /// @param assetData Byte array encoded for the asset.\n /// @param from Address to transfer token from.\n /// @param to Address to transfer token to.\n /// @param amount Amount of token to transfer.\n function dispatchTransferFrom(\n bytes memory assetData,\n address from,\n address to,\n uint256 amount\n )\n internal\n {\n // Do nothing if no amount should be transferred.\n if (amount > 0 && from != to) {\n // Ensure assetData length is valid\n require(\n assetData.length > 3,\n \"LENGTH_GREATER_THAN_3_REQUIRED\"\n );\n \n // Lookup assetProxy. We do not use `LibBytes.readBytes4` for gas efficiency reasons.\n bytes4 assetProxyId;\n assembly {\n assetProxyId := and(mload(\n add(assetData, 32)),\n 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000\n )\n }\n address assetProxy = assetProxies[assetProxyId];\n\n // Ensure that assetProxy exists\n require(\n assetProxy != address(0),\n \"ASSET_PROXY_DOES_NOT_EXIST\"\n );\n \n // We construct calldata for the `assetProxy.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n // \n // | Area | Offset | Length | Contents |\n // | -------- |--------|---------|-------------------------------------------- |\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n\n assembly {\n /////// Setup State ///////\n // `cdStart` is the start of the calldata for `assetProxy.transferFrom` (equal to free memory ptr).\n let cdStart := mload(64)\n // `dataAreaLength` is the total number of words needed to store `assetData`\n // As-per the ABI spec, this value is padded up to the nearest multiple of 32,\n // and includes 32-bytes for length.\n let dataAreaLength := and(add(mload(assetData), 63), 0xFFFFFFFFFFFE0)\n // `cdEnd` is the end of the calldata for `assetProxy.transferFrom`.\n let cdEnd := add(cdStart, add(132, dataAreaLength))\n\n \n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFromSelector`.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n mstore(cdStart, 0xa85e59e400000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // Each parameter is padded to 32-bytes. The entire Params Area is 128 bytes.\n // Notes:\n // 1. The offset to `assetData` is the length of the Params Area (128 bytes).\n // 2. A 20-byte mask is applied to addresses to zero-out the unused bytes.\n mstore(add(cdStart, 4), 128)\n mstore(add(cdStart, 36), and(from, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(cdStart, 68), and(to, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(cdStart, 100), amount)\n \n /////// Setup Data Area ///////\n // This area holds `assetData`.\n let dataArea := add(cdStart, 132)\n // solhint-disable-next-line no-empty-blocks\n for {} lt(dataArea, cdEnd) {} {\n mstore(dataArea, mload(assetData))\n dataArea := add(dataArea, 32)\n assetData := add(assetData, 32)\n }\n\n /////// Call `assetProxy.transferFrom` using the constructed calldata ///////\n let success := call(\n gas, // forward all gas\n assetProxy, // call address of asset proxy\n 0, // don't send any ETH\n cdStart, // pointer to start of input\n sub(cdEnd, cdStart), // length of input \n cdStart, // write output over input\n 512 // reserve 512 bytes for output\n )\n if iszero(success) {\n revert(cdStart, returndatasize())\n }\n }\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\n\n\ncontract MixinExchangeCore is\n ReentrancyGuard,\n LibConstants,\n LibMath,\n LibOrder,\n LibFillResults,\n MAssetProxyDispatcher,\n MExchangeCore,\n MSignatureValidator,\n MTransactions\n{\n // Mapping of orderHash => amount of takerAsset already bought by maker\n mapping (bytes32 => uint256) public filled;\n\n // Mapping of orderHash => cancelled\n mapping (bytes32 => bool) public cancelled;\n\n // Mapping of makerAddress => senderAddress => lowest salt an order can have in order to be fillable\n // Orders with specified senderAddress and with a salt less than their epoch are considered cancelled\n mapping (address => mapping (address => uint256)) public orderEpoch;\n\n /// @dev Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch\n /// and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress).\n /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled.\n function cancelOrdersUpTo(uint256 targetOrderEpoch)\n external\n nonReentrant\n {\n address makerAddress = getCurrentContextAddress();\n // If this function is called via `executeTransaction`, we only update the orderEpoch for the makerAddress/msg.sender combination.\n // This allows external filter contracts to add rules to how orders are cancelled via this function.\n address senderAddress = makerAddress == msg.sender ? address(0) : msg.sender;\n\n // orderEpoch is initialized to 0, so to cancelUpTo we need salt + 1\n uint256 newOrderEpoch = targetOrderEpoch + 1; \n uint256 oldOrderEpoch = orderEpoch[makerAddress][senderAddress];\n\n // Ensure orderEpoch is monotonically increasing\n require(\n newOrderEpoch > oldOrderEpoch, \n \"INVALID_NEW_ORDER_EPOCH\"\n );\n\n // Update orderEpoch\n orderEpoch[makerAddress][senderAddress] = newOrderEpoch;\n emit CancelUpTo(\n makerAddress,\n senderAddress,\n newOrderEpoch\n );\n }\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrder(\n Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n nonReentrant\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n return fillResults;\n }\n\n /// @dev After calling, the order can not be filled anymore.\n /// Throws if order is invalid or sender does not have permission to cancel.\n /// @param order Order to cancel. Order must be OrderStatus.FILLABLE.\n function cancelOrder(Order memory order)\n public\n nonReentrant\n {\n cancelOrderInternal(order);\n }\n\n /// @dev Gets information about an order: status, hash, and amount filled.\n /// @param order Order to gather information on.\n /// @return OrderInfo Information about the order and its state.\n /// See LibOrder.OrderInfo for a complete description.\n function getOrderInfo(Order memory order)\n public\n view\n returns (OrderInfo memory orderInfo)\n {\n // Compute the order hash\n orderInfo.orderHash = getOrderHash(order);\n\n // Fetch filled amount\n orderInfo.orderTakerAssetFilledAmount = filled[orderInfo.orderHash];\n\n // If order.makerAssetAmount is zero, we also reject the order.\n // While the Exchange contract handles them correctly, they create\n // edge cases in the supporting infrastructure because they have\n // an 'infinite' price when computed by a simple division.\n if (order.makerAssetAmount == 0) {\n orderInfo.orderStatus = uint8(OrderStatus.INVALID_MAKER_ASSET_AMOUNT);\n return orderInfo;\n }\n\n // If order.takerAssetAmount is zero, then the order will always\n // be considered filled because 0 == takerAssetAmount == orderTakerAssetFilledAmount\n // Instead of distinguishing between unfilled and filled zero taker\n // amount orders, we choose not to support them.\n if (order.takerAssetAmount == 0) {\n orderInfo.orderStatus = uint8(OrderStatus.INVALID_TAKER_ASSET_AMOUNT);\n return orderInfo;\n }\n\n // Validate order availability\n if (orderInfo.orderTakerAssetFilledAmount >= order.takerAssetAmount) {\n orderInfo.orderStatus = uint8(OrderStatus.FULLY_FILLED);\n return orderInfo;\n }\n\n // Validate order expiration\n // solhint-disable-next-line not-rely-on-time\n if (block.timestamp >= order.expirationTimeSeconds) {\n orderInfo.orderStatus = uint8(OrderStatus.EXPIRED);\n return orderInfo;\n }\n\n // Check if order has been cancelled\n if (cancelled[orderInfo.orderHash]) {\n orderInfo.orderStatus = uint8(OrderStatus.CANCELLED);\n return orderInfo;\n }\n if (orderEpoch[order.makerAddress][order.senderAddress] > order.salt) {\n orderInfo.orderStatus = uint8(OrderStatus.CANCELLED);\n return orderInfo;\n }\n\n // All other statuses are ruled out: order is Fillable\n orderInfo.orderStatus = uint8(OrderStatus.FILLABLE);\n return orderInfo;\n }\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderInternal(\n Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n // Fetch order info\n OrderInfo memory orderInfo = getOrderInfo(order);\n\n // Fetch taker address\n address takerAddress = getCurrentContextAddress();\n \n // Assert that the order is fillable by taker\n assertFillableOrder(\n order,\n orderInfo,\n takerAddress,\n signature\n );\n \n // Get amount of takerAsset to fill\n uint256 remainingTakerAssetAmount = safeSub(order.takerAssetAmount, orderInfo.orderTakerAssetFilledAmount);\n uint256 takerAssetFilledAmount = min256(takerAssetFillAmount, remainingTakerAssetAmount);\n\n // Validate context\n assertValidFill(\n order,\n orderInfo,\n takerAssetFillAmount,\n takerAssetFilledAmount,\n fillResults.makerAssetFilledAmount\n );\n\n // Compute proportional fill amounts\n fillResults = calculateFillResults(order, takerAssetFilledAmount);\n\n // Update exchange internal state\n updateFilledState(\n order,\n takerAddress,\n orderInfo.orderHash,\n orderInfo.orderTakerAssetFilledAmount,\n fillResults\n );\n \n // Settle order\n settleOrder(\n order,\n takerAddress,\n fillResults\n );\n\n return fillResults;\n }\n\n /// @dev After calling, the order can not be filled anymore.\n /// Throws if order is invalid or sender does not have permission to cancel.\n /// @param order Order to cancel. Order must be OrderStatus.FILLABLE.\n function cancelOrderInternal(Order memory order)\n internal\n {\n // Fetch current order status\n OrderInfo memory orderInfo = getOrderInfo(order);\n\n // Validate context\n assertValidCancel(order, orderInfo);\n\n // Perform cancel\n updateCancelledState(order, orderInfo.orderHash);\n }\n\n /// @dev Updates state with results of a fill order.\n /// @param order that was filled.\n /// @param takerAddress Address of taker who filled the order.\n /// @param orderTakerAssetFilledAmount Amount of order already filled.\n function updateFilledState(\n Order memory order,\n address takerAddress,\n bytes32 orderHash,\n uint256 orderTakerAssetFilledAmount,\n FillResults memory fillResults\n )\n internal\n {\n // Update state\n filled[orderHash] = safeAdd(orderTakerAssetFilledAmount, fillResults.takerAssetFilledAmount);\n\n // Log order\n emit Fill(\n order.makerAddress,\n order.feeRecipientAddress,\n takerAddress,\n msg.sender,\n fillResults.makerAssetFilledAmount,\n fillResults.takerAssetFilledAmount,\n fillResults.makerFeePaid,\n fillResults.takerFeePaid,\n orderHash,\n order.makerAssetData,\n order.takerAssetData\n );\n }\n\n /// @dev Updates state with results of cancelling an order.\n /// State is only updated if the order is currently fillable.\n /// Otherwise, updating state would have no effect.\n /// @param order that was cancelled.\n /// @param orderHash Hash of order that was cancelled.\n function updateCancelledState(\n Order memory order,\n bytes32 orderHash\n )\n internal\n {\n // Perform cancel\n cancelled[orderHash] = true;\n\n // Log cancel\n emit Cancel(\n order.makerAddress,\n order.feeRecipientAddress,\n msg.sender,\n orderHash,\n order.makerAssetData,\n order.takerAssetData\n );\n }\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAddress Address of order taker.\n /// @param signature Proof that the orders was created by its maker.\n function assertFillableOrder(\n Order memory order,\n OrderInfo memory orderInfo,\n address takerAddress,\n bytes memory signature\n )\n internal\n view\n {\n // An order can only be filled if its status is FILLABLE.\n require(\n orderInfo.orderStatus == uint8(OrderStatus.FILLABLE),\n \"ORDER_UNFILLABLE\"\n );\n \n // Validate sender is allowed to fill this order\n if (order.senderAddress != address(0)) {\n require(\n order.senderAddress == msg.sender,\n \"INVALID_SENDER\"\n );\n }\n \n // Validate taker is allowed to fill this order\n if (order.takerAddress != address(0)) {\n require(\n order.takerAddress == takerAddress,\n \"INVALID_TAKER\"\n );\n }\n \n // Validate Maker signature (check only if first time seen)\n if (orderInfo.orderTakerAssetFilledAmount == 0) {\n require(\n isValidSignature(\n orderInfo.orderHash,\n order.makerAddress,\n signature\n ),\n \"INVALID_ORDER_SIGNATURE\"\n );\n }\n }\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAssetFillAmount Desired amount of order to fill by taker.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @param makerAssetFilledAmount Amount of makerAsset that will be transfered.\n function assertValidFill(\n Order memory order,\n OrderInfo memory orderInfo,\n uint256 takerAssetFillAmount, // TODO: use FillResults\n uint256 takerAssetFilledAmount,\n uint256 makerAssetFilledAmount\n )\n internal\n view\n {\n // Revert if fill amount is invalid\n // TODO: reconsider necessity for v2.1\n require(\n takerAssetFillAmount != 0,\n \"INVALID_TAKER_AMOUNT\"\n );\n \n // Make sure taker does not pay more than desired amount\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n takerAssetFilledAmount <= takerAssetFillAmount,\n \"TAKER_OVERPAY\"\n );\n \n // Make sure order is not overfilled\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n safeAdd(orderInfo.orderTakerAssetFilledAmount, takerAssetFilledAmount) <= order.takerAssetAmount,\n \"ORDER_OVERFILL\"\n );\n \n // Make sure order is filled at acceptable price.\n // The order has an implied price from the makers perspective:\n // order price = order.makerAssetAmount / order.takerAssetAmount\n // i.e. the number of makerAsset maker is paying per takerAsset. The\n // maker is guaranteed to get this price or a better (lower) one. The\n // actual price maker is getting in this fill is:\n // fill price = makerAssetFilledAmount / takerAssetFilledAmount\n // We need `fill price <= order price` for the fill to be fair to maker.\n // This amounts to:\n // makerAssetFilledAmount order.makerAssetAmount\n // ------------------------ <= -----------------------\n // takerAssetFilledAmount order.takerAssetAmount\n // or, equivalently:\n // makerAssetFilledAmount * order.takerAssetAmount <=\n // order.makerAssetAmount * takerAssetFilledAmount\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n safeMul(makerAssetFilledAmount, order.takerAssetAmount)\n <= \n safeMul(order.makerAssetAmount, takerAssetFilledAmount),\n \"INVALID_FILL_PRICE\"\n );\n }\n\n /// @dev Validates context for cancelOrder. Succeeds or throws.\n /// @param order to be cancelled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n function assertValidCancel(\n Order memory order,\n OrderInfo memory orderInfo\n )\n internal\n view\n {\n // Ensure order is valid\n // An order can only be cancelled if its status is FILLABLE.\n require(\n orderInfo.orderStatus == uint8(OrderStatus.FILLABLE),\n \"ORDER_UNFILLABLE\"\n );\n\n // Validate sender is allowed to cancel this order\n if (order.senderAddress != address(0)) {\n require(\n order.senderAddress == msg.sender,\n \"INVALID_SENDER\"\n );\n }\n\n // Validate transaction signed by maker\n address makerAddress = getCurrentContextAddress();\n require(\n order.makerAddress == makerAddress,\n \"INVALID_MAKER\"\n );\n }\n\n /// @dev Calculates amounts filled and fees paid by maker and taker.\n /// @param order to be filled.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function calculateFillResults(\n Order memory order,\n uint256 takerAssetFilledAmount\n )\n internal\n pure\n returns (FillResults memory fillResults)\n {\n // Compute proportional transfer amounts\n fillResults.takerAssetFilledAmount = takerAssetFilledAmount;\n fillResults.makerAssetFilledAmount = safeGetPartialAmountFloor(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.makerAssetAmount\n );\n fillResults.makerFeePaid = safeGetPartialAmountFloor(\n fillResults.makerAssetFilledAmount,\n order.makerAssetAmount,\n order.makerFee\n );\n fillResults.takerFeePaid = safeGetPartialAmountFloor(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.takerFee\n );\n\n return fillResults;\n }\n\n /// @dev Settles an order by transferring assets between counterparties.\n /// @param order Order struct containing order specifications.\n /// @param takerAddress Address selling takerAsset and buying makerAsset.\n /// @param fillResults Amounts to be filled and fees paid by maker and taker.\n function settleOrder(\n LibOrder.Order memory order,\n address takerAddress,\n LibFillResults.FillResults memory fillResults\n )\n private\n {\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n dispatchTransferFrom(\n order.makerAssetData,\n order.makerAddress,\n takerAddress,\n fillResults.makerAssetFilledAmount\n );\n dispatchTransferFrom(\n order.takerAssetData,\n takerAddress,\n order.makerAddress,\n fillResults.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n zrxAssetData,\n order.makerAddress,\n order.feeRecipientAddress,\n fillResults.makerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n order.feeRecipientAddress,\n fillResults.takerFeePaid\n );\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinMatchOrders.sol": "/*\n Copyright 2018 ZeroEx Intl.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n http://www.apache.org/licenses/LICENSE-2.0\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MMatchOrders.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\n\n\ncontract MixinMatchOrders is\n ReentrancyGuard,\n LibConstants,\n LibMath,\n MAssetProxyDispatcher,\n MExchangeCore,\n MMatchOrders,\n MTransactions\n{\n /// @dev Match two complementary orders that have a profitable spread.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the left order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftSignature Proof that order was created by the left maker.\n /// @param rightSignature Proof that order was created by the right maker.\n /// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.\n function matchOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n bytes memory leftSignature,\n bytes memory rightSignature\n )\n public\n nonReentrant\n returns (LibFillResults.MatchedFillResults memory matchedFillResults)\n {\n // We assume that rightOrder.takerAssetData == leftOrder.makerAssetData and rightOrder.makerAssetData == leftOrder.takerAssetData.\n // If this assumption isn't true, the match will fail at signature validation.\n rightOrder.makerAssetData = leftOrder.takerAssetData;\n rightOrder.takerAssetData = leftOrder.makerAssetData;\n\n // Get left & right order info\n LibOrder.OrderInfo memory leftOrderInfo = getOrderInfo(leftOrder);\n LibOrder.OrderInfo memory rightOrderInfo = getOrderInfo(rightOrder);\n\n // Fetch taker address\n address takerAddress = getCurrentContextAddress();\n \n // Either our context is valid or we revert\n assertFillableOrder(\n leftOrder,\n leftOrderInfo,\n takerAddress,\n leftSignature\n );\n assertFillableOrder(\n rightOrder,\n rightOrderInfo,\n takerAddress,\n rightSignature\n );\n assertValidMatch(leftOrder, rightOrder);\n\n // Compute proportional fill amounts\n matchedFillResults = calculateMatchedFillResults(\n leftOrder,\n rightOrder,\n leftOrderInfo.orderTakerAssetFilledAmount,\n rightOrderInfo.orderTakerAssetFilledAmount\n );\n\n // Validate fill contexts\n assertValidFill(\n leftOrder,\n leftOrderInfo,\n matchedFillResults.left.takerAssetFilledAmount,\n matchedFillResults.left.takerAssetFilledAmount,\n matchedFillResults.left.makerAssetFilledAmount\n );\n assertValidFill(\n rightOrder,\n rightOrderInfo,\n matchedFillResults.right.takerAssetFilledAmount,\n matchedFillResults.right.takerAssetFilledAmount,\n matchedFillResults.right.makerAssetFilledAmount\n );\n \n // Update exchange state\n updateFilledState(\n leftOrder,\n takerAddress,\n leftOrderInfo.orderHash,\n leftOrderInfo.orderTakerAssetFilledAmount,\n matchedFillResults.left\n );\n updateFilledState(\n rightOrder,\n takerAddress,\n rightOrderInfo.orderHash,\n rightOrderInfo.orderTakerAssetFilledAmount,\n matchedFillResults.right\n );\n\n // Settle matched orders. Succeeds or throws.\n settleMatchedOrders(\n leftOrder,\n rightOrder,\n takerAddress,\n matchedFillResults\n );\n\n return matchedFillResults;\n }\n\n /// @dev Validates context for matchOrders. Succeeds or throws.\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n function assertValidMatch(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder\n )\n internal\n pure\n {\n // Make sure there is a profitable spread.\n // There is a profitable spread iff the cost per unit bought (OrderA.MakerAmount/OrderA.TakerAmount) for each order is greater\n // than the profit per unit sold of the matched order (OrderB.TakerAmount/OrderB.MakerAmount).\n // This is satisfied by the equations below:\n // <leftOrder.makerAssetAmount> / <leftOrder.takerAssetAmount> >= <rightOrder.takerAssetAmount> / <rightOrder.makerAssetAmount>\n // AND\n // <rightOrder.makerAssetAmount> / <rightOrder.takerAssetAmount> >= <leftOrder.takerAssetAmount> / <leftOrder.makerAssetAmount>\n // These equations can be combined to get the following:\n require(\n safeMul(leftOrder.makerAssetAmount, rightOrder.makerAssetAmount) >=\n safeMul(leftOrder.takerAssetAmount, rightOrder.takerAssetAmount),\n \"NEGATIVE_SPREAD_REQUIRED\"\n );\n }\n\n /// @dev Calculates fill amounts for the matched orders.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the leftOrder order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftOrderTakerAssetFilledAmount Amount of left order already filled.\n /// @param rightOrderTakerAssetFilledAmount Amount of right order already filled.\n /// @param matchedFillResults Amounts to fill and fees to pay by maker and taker of matched orders.\n function calculateMatchedFillResults(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n uint256 leftOrderTakerAssetFilledAmount,\n uint256 rightOrderTakerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.MatchedFillResults memory matchedFillResults)\n {\n // Derive maker asset amounts for left & right orders, given store taker assert amounts\n uint256 leftTakerAssetAmountRemaining = safeSub(leftOrder.takerAssetAmount, leftOrderTakerAssetFilledAmount);\n uint256 leftMakerAssetAmountRemaining = safeGetPartialAmountFloor(\n leftOrder.makerAssetAmount,\n leftOrder.takerAssetAmount,\n leftTakerAssetAmountRemaining\n );\n uint256 rightTakerAssetAmountRemaining = safeSub(rightOrder.takerAssetAmount, rightOrderTakerAssetFilledAmount);\n uint256 rightMakerAssetAmountRemaining = safeGetPartialAmountFloor(\n rightOrder.makerAssetAmount,\n rightOrder.takerAssetAmount,\n rightTakerAssetAmountRemaining\n );\n\n // Calculate fill results for maker and taker assets: at least one order will be fully filled.\n // The maximum amount the left maker can buy is `leftTakerAssetAmountRemaining`\n // The maximum amount the right maker can sell is `rightMakerAssetAmountRemaining`\n // We have two distinct cases for calculating the fill results:\n // Case 1.\n // If the left maker can buy more than the right maker can sell, then only the right order is fully filled.\n // If the left maker can buy exactly what the right maker can sell, then both orders are fully filled.\n // Case 2.\n // If the left maker cannot buy more than the right maker can sell, then only the left order is fully filled.\n if (leftTakerAssetAmountRemaining >= rightMakerAssetAmountRemaining) {\n // Case 1: Right order is fully filled\n matchedFillResults.right.makerAssetFilledAmount = rightMakerAssetAmountRemaining;\n matchedFillResults.right.takerAssetFilledAmount = rightTakerAssetAmountRemaining;\n matchedFillResults.left.takerAssetFilledAmount = matchedFillResults.right.makerAssetFilledAmount;\n // Round down to ensure the maker's exchange rate does not exceed the price specified by the order. \n // We favor the maker when the exchange rate must be rounded.\n matchedFillResults.left.makerAssetFilledAmount = safeGetPartialAmountFloor(\n leftOrder.makerAssetAmount,\n leftOrder.takerAssetAmount,\n matchedFillResults.left.takerAssetFilledAmount\n );\n } else {\n // Case 2: Left order is fully filled\n matchedFillResults.left.makerAssetFilledAmount = leftMakerAssetAmountRemaining;\n matchedFillResults.left.takerAssetFilledAmount = leftTakerAssetAmountRemaining;\n matchedFillResults.right.makerAssetFilledAmount = matchedFillResults.left.takerAssetFilledAmount;\n // Round up to ensure the maker's exchange rate does not exceed the price specified by the order.\n // We favor the maker when the exchange rate must be rounded.\n matchedFillResults.right.takerAssetFilledAmount = safeGetPartialAmountCeil(\n rightOrder.takerAssetAmount,\n rightOrder.makerAssetAmount,\n matchedFillResults.right.makerAssetFilledAmount\n );\n }\n\n // Calculate amount given to taker\n matchedFillResults.leftMakerAssetSpreadAmount = safeSub(\n matchedFillResults.left.makerAssetFilledAmount,\n matchedFillResults.right.takerAssetFilledAmount\n );\n\n // Compute fees for left order\n matchedFillResults.left.makerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.left.makerAssetFilledAmount,\n leftOrder.makerAssetAmount,\n leftOrder.makerFee\n );\n matchedFillResults.left.takerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.left.takerAssetFilledAmount,\n leftOrder.takerAssetAmount,\n leftOrder.takerFee\n );\n\n // Compute fees for right order\n matchedFillResults.right.makerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.right.makerAssetFilledAmount,\n rightOrder.makerAssetAmount,\n rightOrder.makerFee\n );\n matchedFillResults.right.takerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.right.takerAssetFilledAmount,\n rightOrder.takerAssetAmount,\n rightOrder.takerFee\n );\n\n // Return fill results\n return matchedFillResults;\n }\n\n /// @dev Settles matched order by transferring appropriate funds between order makers, taker, and fee recipient.\n /// @param leftOrder First matched order.\n /// @param rightOrder Second matched order.\n /// @param takerAddress Address that matched the orders. The taker receives the spread between orders as profit.\n /// @param matchedFillResults Struct holding amounts to transfer between makers, taker, and fee recipients.\n function settleMatchedOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n address takerAddress,\n LibFillResults.MatchedFillResults memory matchedFillResults\n )\n private\n {\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n // Order makers and taker\n dispatchTransferFrom(\n leftOrder.makerAssetData,\n leftOrder.makerAddress,\n rightOrder.makerAddress,\n matchedFillResults.right.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n rightOrder.makerAssetData,\n rightOrder.makerAddress,\n leftOrder.makerAddress,\n matchedFillResults.left.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n leftOrder.makerAssetData,\n leftOrder.makerAddress,\n takerAddress,\n matchedFillResults.leftMakerAssetSpreadAmount\n );\n\n // Maker fees\n dispatchTransferFrom(\n zrxAssetData,\n leftOrder.makerAddress,\n leftOrder.feeRecipientAddress,\n matchedFillResults.left.makerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n rightOrder.makerAddress,\n rightOrder.feeRecipientAddress,\n matchedFillResults.right.makerFeePaid\n );\n\n // Taker fees\n if (leftOrder.feeRecipientAddress == rightOrder.feeRecipientAddress) {\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n leftOrder.feeRecipientAddress,\n safeAdd(\n matchedFillResults.left.takerFeePaid,\n matchedFillResults.right.takerFeePaid\n )\n );\n } else {\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n leftOrder.feeRecipientAddress,\n matchedFillResults.left.takerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n rightOrder.feeRecipientAddress,\n matchedFillResults.right.takerFeePaid\n );\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinSignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./interfaces/IWallet.sol\";\nimport \"./interfaces/IValidator.sol\";\n\n\ncontract MixinSignatureValidator is\n ReentrancyGuard,\n MSignatureValidator,\n MTransactions\n{\n using LibBytes for bytes;\n \n // Mapping of hash => signer => signed\n mapping (bytes32 => mapping (address => bool)) public preSigned;\n\n // Mapping of signer => validator => approved\n mapping (address => mapping (address => bool)) public allowedValidators;\n\n /// @dev Approves a hash on-chain using any valid signature type.\n /// After presigning a hash, the preSign signature type will become valid for that hash and signer.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n function preSign(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external\n {\n if (signerAddress != msg.sender) {\n require(\n isValidSignature(\n hash,\n signerAddress,\n signature\n ),\n \"INVALID_SIGNATURE\"\n );\n }\n preSigned[hash][signerAddress] = true;\n }\n\n /// @dev Approves/unnapproves a Validator contract to verify signatures on signer's behalf.\n /// @param validatorAddress Address of Validator contract.\n /// @param approval Approval or disapproval of Validator contract.\n function setSignatureValidatorApproval(\n address validatorAddress,\n bool approval\n )\n external\n nonReentrant\n {\n address signerAddress = getCurrentContextAddress();\n allowedValidators[signerAddress][validatorAddress] = approval;\n emit SignatureValidatorApproval(\n signerAddress,\n validatorAddress,\n approval\n );\n }\n\n /// @dev Verifies that a hash has been signed by the given signer.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes memory signature\n )\n public\n view\n returns (bool isValid)\n {\n require(\n signature.length > 0,\n \"LENGTH_GREATER_THAN_0_REQUIRED\"\n );\n\n // Pop last byte off of signature byte array.\n uint8 signatureTypeRaw = uint8(signature.popLastByte());\n\n // Ensure signature is supported\n require(\n signatureTypeRaw < uint8(SignatureType.NSignatureTypes),\n \"SIGNATURE_UNSUPPORTED\"\n );\n\n SignatureType signatureType = SignatureType(signatureTypeRaw);\n\n // Variables are not scoped in Solidity.\n uint8 v;\n bytes32 r;\n bytes32 s;\n address recovered;\n\n // Always illegal signature.\n // This is always an implicit option since a signer can create a\n // signature array with invalid type or length. We may as well make\n // it an explicit option. This aids testing and analysis. It is\n // also the initialization value for the enum type.\n if (signatureType == SignatureType.Illegal) {\n revert(\"SIGNATURE_ILLEGAL\");\n\n // Always invalid signature.\n // Like Illegal, this is always implicitly available and therefore\n // offered explicitly. It can be implicitly created by providing\n // a correctly formatted but incorrect signature.\n } else if (signatureType == SignatureType.Invalid) {\n require(\n signature.length == 0,\n \"LENGTH_0_REQUIRED\"\n );\n isValid = false;\n return isValid;\n\n // Signature using EIP712\n } else if (signatureType == SignatureType.EIP712) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n hash,\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n\n // Signed using web3.eth_sign\n } else if (signatureType == SignatureType.EthSign) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n keccak256(abi.encodePacked(\n \"\\x19Ethereum Signed Message:\\n32\",\n hash\n )),\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n\n // Signature verified by wallet contract.\n // If used with an order, the maker of the order is the wallet contract.\n } else if (signatureType == SignatureType.Wallet) {\n isValid = isValidWalletSignature(\n hash,\n signerAddress,\n signature\n );\n return isValid;\n\n // Signature verified by validator contract.\n // If used with an order, the maker of the order can still be an EOA.\n // A signature using this type should be encoded as:\n // | Offset | Length | Contents |\n // | 0x00 | x | Signature to validate |\n // | 0x00 + x | 20 | Address of validator contract |\n // | 0x14 + x | 1 | Signature type is always \"\\x06\" |\n } else if (signatureType == SignatureType.Validator) {\n // Pop last 20 bytes off of signature byte array.\n address validatorAddress = signature.popLast20Bytes();\n \n // Ensure signer has approved validator.\n if (!allowedValidators[signerAddress][validatorAddress]) {\n return false;\n }\n isValid = isValidValidatorSignature(\n validatorAddress,\n hash,\n signerAddress,\n signature\n );\n return isValid;\n\n // Signer signed hash previously using the preSign function.\n } else if (signatureType == SignatureType.PreSigned) {\n isValid = preSigned[hash][signerAddress];\n return isValid;\n }\n\n // Anything else is illegal (We do not return false because\n // the signature may actually be valid, just not in a format\n // that we currently support. In this case returning false\n // may lead the caller to incorrectly believe that the\n // signature was invalid.)\n revert(\"SIGNATURE_UNSUPPORTED\");\n }\n\n /// @dev Verifies signature using logic defined by Wallet contract.\n /// @param hash Any 32 byte hash.\n /// @param walletAddress Address that should have signed the given hash\n /// and defines its own signature verification method.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if signature is valid for given wallet..\n function isValidWalletSignature(\n bytes32 hash,\n address walletAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid)\n {\n bytes memory calldata = abi.encodeWithSelector(\n IWallet(walletAddress).isValidSignature.selector,\n hash,\n signature\n );\n assembly {\n let cdStart := add(calldata, 32)\n let success := staticcall(\n gas, // forward all gas\n walletAddress, // address of Wallet contract\n cdStart, // pointer to start of input\n mload(calldata), // length of input\n cdStart, // write output over input\n 32 // output size is 32 bytes\n )\n\n switch success\n case 0 {\n // Revert with `Error(\"WALLET_ERROR\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000c57414c4c45545f4552524f5200000000000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n case 1 {\n // Signature is valid if call did not revert and returned true\n isValid := mload(cdStart)\n }\n }\n return isValid;\n }\n\n /// @dev Verifies signature using logic defined by Validator contract.\n /// @param validatorAddress Address of validator contract.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidValidatorSignature(\n address validatorAddress,\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid)\n {\n bytes memory calldata = abi.encodeWithSelector(\n IValidator(signerAddress).isValidSignature.selector,\n hash,\n signerAddress,\n signature\n );\n assembly {\n let cdStart := add(calldata, 32)\n let success := staticcall(\n gas, // forward all gas\n validatorAddress, // address of Validator contract\n cdStart, // pointer to start of input\n mload(calldata), // length of input\n cdStart, // write output over input\n 32 // output size is 32 bytes\n )\n\n switch success\n case 0 {\n // Revert with `Error(\"VALIDATOR_ERROR\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f56414c494441544f525f4552524f5200000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n case 1 {\n // Signature is valid if call did not revert and returned true\n isValid := mload(cdStart)\n }\n }\n return isValid;\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinTransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\nimport \"./libs/LibExchangeErrors.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./libs/LibEIP712.sol\";\n\n\ncontract MixinTransactions is\n LibEIP712,\n MSignatureValidator,\n MTransactions\n{\n // Mapping of transaction hash => executed\n // This prevents transactions from being executed more than once.\n mapping (bytes32 => bool) public transactions;\n\n // Address of current transaction signer\n address public currentContextAddress;\n\n /// @dev Executes an exchange method call in the context of signer.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @param signature Proof of signer transaction by signer.\n function executeTransaction(\n uint256 salt,\n address signerAddress,\n bytes data,\n bytes signature\n )\n external\n {\n // Prevent reentrancy\n require(\n currentContextAddress == address(0),\n \"REENTRANCY_ILLEGAL\"\n );\n\n bytes32 transactionHash = hashEIP712Message(hashZeroExTransaction(\n salt,\n signerAddress,\n data\n ));\n\n // Validate transaction has not been executed\n require(\n !transactions[transactionHash],\n \"INVALID_TX_HASH\"\n );\n\n // Transaction always valid if signer is sender of transaction\n if (signerAddress != msg.sender) {\n // Validate signature\n require(\n isValidSignature(\n transactionHash,\n signerAddress,\n signature\n ),\n \"INVALID_TX_SIGNATURE\"\n );\n\n // Set the current transaction signer\n currentContextAddress = signerAddress;\n }\n\n // Execute transaction\n transactions[transactionHash] = true;\n require(\n address(this).delegatecall(data),\n \"FAILED_EXECUTION\"\n );\n\n // Reset current transaction signer if it was previously updated\n if (signerAddress != msg.sender) {\n currentContextAddress = address(0);\n }\n }\n\n /// @dev Calculates EIP712 hash of the Transaction.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @return EIP712 hash of the Transaction.\n function hashZeroExTransaction(\n uint256 salt,\n address signerAddress,\n bytes memory data\n )\n internal\n pure\n returns (bytes32 result)\n {\n bytes32 schemaHash = EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH;\n bytes32 dataHash = keccak256(data);\n\n // Assembly for more efficiently computing:\n // keccak256(abi.encodePacked(\n // EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH,\n // salt,\n // bytes32(signerAddress),\n // keccak256(data)\n // ));\n\n assembly {\n // Load free memory pointer\n let memPtr := mload(64)\n\n mstore(memPtr, schemaHash) // hash of schema\n mstore(add(memPtr, 32), salt) // salt\n mstore(add(memPtr, 64), and(signerAddress, 0xffffffffffffffffffffffffffffffffffffffff)) // signerAddress\n mstore(add(memPtr, 96), dataHash) // hash of data\n\n // Compute hash\n result := keccak256(memPtr, 128)\n }\n return result;\n }\n\n /// @dev The current function will be called in the context of this address (either 0x transaction signer or `msg.sender`).\n /// If calling a fill function, this address will represent the taker.\n /// If calling a cancel function, this address will represent the maker.\n /// @return Signer of 0x transaction if entry point is `executeTransaction`.\n /// `msg.sender` if entry point is any other function.\n function getCurrentContextAddress()\n internal\n view\n returns (address)\n {\n address currentContextAddress_ = currentContextAddress;\n address contextAddress = currentContextAddress_ == address(0) ? msg.sender : currentContextAddress_;\n return contextAddress;\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./libs/LibAbiEncoder.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MWrapperFunctions.sol\";\n\n\ncontract MixinWrapperFunctions is\n ReentrancyGuard,\n LibMath,\n LibFillResults,\n LibAbiEncoder,\n MExchangeCore,\n MWrapperFunctions\n{\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n nonReentrant\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrKillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n return fillResults;\n }\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (FillResults memory fillResults)\n {\n // ABI encode calldata for `fillOrder`\n bytes memory fillOrderCalldata = abiEncodeFillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n\n // Delegate to `fillOrder` and handle any exceptions gracefully\n assembly {\n let success := delegatecall(\n gas, // forward all gas\n address, // call address of this contract\n add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes)\n mload(fillOrderCalldata), // length of input\n fillOrderCalldata, // write output over input\n 128 // output size is 128 bytes\n )\n if success {\n mstore(fillResults, mload(fillOrderCalldata))\n mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32)))\n mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64)))\n mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96)))\n }\n }\n // fillResults values will be 0 by default if call was unsuccessful\n return fillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrKill.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrKillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrKillOrderInternal(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrders(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n bytes memory takerAssetData = orders[0].takerAssetData;\n \n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being sold by taker is the same for each order.\n // Rather than passing this in as calldata, we use the takerAssetData from the first order in all later orders.\n orders[i].takerAssetData = takerAssetData;\n\n // Calculate the remaining amount of takerAsset to sell\n uint256 remainingTakerAssetFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= takerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory takerAssetData = orders[0].takerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being sold by taker is the same for each order.\n // Rather than passing this in as calldata, we use the takerAssetData from the first order in all later orders.\n orders[i].takerAssetData = takerAssetData;\n\n // Calculate the remaining amount of takerAsset to sell\n uint256 remainingTakerAssetFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= takerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerAsset is bought by taker.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrders(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // Rather than passing this in as calldata, we copy the makerAssetData from the first order onto all later orders.\n orders[i].makerAssetData = makerAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n if (totalFillResults.makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // Rather than passing this in as calldata, we copy the makerAssetData from the first order onto all later orders.\n orders[i].makerAssetData = makerAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n if (totalFillResults.makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously cancels multiple orders in a single transaction.\n /// @param orders Array of order specifications.\n function batchCancelOrders(LibOrder.Order[] memory orders)\n public\n nonReentrant\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n cancelOrderInternal(orders[i]);\n }\n }\n\n /// @dev Fetches information for all passed in orders.\n /// @param orders Array of order specifications.\n /// @return Array of OrderInfo instances that correspond to each order.\n function getOrdersInfo(LibOrder.Order[] memory orders)\n public\n view\n returns (LibOrder.OrderInfo[] memory)\n {\n uint256 ordersLength = orders.length;\n LibOrder.OrderInfo[] memory ordersInfo = new LibOrder.OrderInfo[](ordersLength);\n for (uint256 i = 0; i != ordersLength; i++) {\n ordersInfo[i] = getOrderInfo(orders[i]);\n }\n return ordersInfo;\n }\n\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n require(\n fillResults.takerAssetFilledAmount == takerAssetFillAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return fillResults;\n }\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IAssetProxyDispatcher {\n\n /// @dev Registers an asset proxy to its asset proxy id.\n /// Once an asset proxy is registered, it cannot be unregistered.\n /// @param assetProxy Address of new asset proxy to register.\n function registerAssetProxy(address assetProxy)\n external;\n\n /// @dev Gets an asset proxy.\n /// @param assetProxyId Id of the asset proxy.\n /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered.\n function getAssetProxy(bytes4 assetProxyId)\n external\n view\n returns (address);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IExchange.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./IExchangeCore.sol\";\nimport \"./IMatchOrders.sol\";\nimport \"./ISignatureValidator.sol\";\nimport \"./ITransactions.sol\";\nimport \"./IAssetProxyDispatcher.sol\";\nimport \"./IWrapperFunctions.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract IExchange is\n IExchangeCore,\n IMatchOrders,\n ISignatureValidator,\n ITransactions,\n IAssetProxyDispatcher,\n IWrapperFunctions\n{}\n",
- "2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IExchangeCore {\n\n /// @dev Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch\n /// and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress).\n /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled.\n function cancelOrdersUpTo(uint256 targetOrderEpoch)\n external;\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev After calling, the order can not be filled anymore.\n /// @param order Order struct containing order specifications.\n function cancelOrder(LibOrder.Order memory order)\n public;\n\n /// @dev Gets information about an order: status, hash, and amount filled.\n /// @param order Order to gather information on.\n /// @return OrderInfo Information about the order and its state.\n /// See LibOrder.OrderInfo for a complete description.\n function getOrderInfo(LibOrder.Order memory order)\n public\n view\n returns (LibOrder.OrderInfo memory orderInfo);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IMatchOrders {\n\n /// @dev Match two complementary orders that have a profitable spread.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the left order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftSignature Proof that order was created by the left maker.\n /// @param rightSignature Proof that order was created by the right maker.\n /// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.\n function matchOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n bytes memory leftSignature,\n bytes memory rightSignature\n )\n public\n returns (LibFillResults.MatchedFillResults memory matchedFillResults);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract ISignatureValidator {\n\n /// @dev Approves a hash on-chain using any valid signature type.\n /// After presigning a hash, the preSign signature type will become valid for that hash and signer.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n function preSign(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external;\n \n /// @dev Approves/unnapproves a Validator contract to verify signatures on signer's behalf.\n /// @param validatorAddress Address of Validator contract.\n /// @param approval Approval or disapproval of Validator contract.\n function setSignatureValidatorApproval(\n address validatorAddress,\n bool approval\n )\n external;\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signerAddress Address of signer.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes memory signature\n )\n public\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/ITransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\n\ncontract ITransactions {\n\n /// @dev Executes an exchange method call in the context of signer.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @param signature Proof of signer transaction by signer.\n function executeTransaction(\n uint256 salt,\n address signerAddress,\n bytes data,\n bytes signature\n )\n external;\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IValidator {\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IWallet.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IWallet {\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n bytes signature\n )\n external\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IWrapperFunctions {\n\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrKill.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrKillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrders(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerAsset is bought by taker.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrders(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously cancels multiple orders in a single transaction.\n /// @param orders Array of order specifications.\n function batchCancelOrders(LibOrder.Order[] memory orders)\n public;\n\n /// @dev Fetches information for all passed in orders\n /// @param orders Array of order specifications.\n /// @return Array of OrderInfo instances that correspond to each order.\n function getOrdersInfo(LibOrder.Order[] memory orders)\n public\n view\n returns (LibOrder.OrderInfo[] memory);\n}\n",
- "2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./LibOrder.sol\";\n\n\ncontract LibAbiEncoder {\n\n /// @dev ABI encodes calldata for `fillOrder`.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return ABI encoded calldata for `fillOrder`.\n function abiEncodeFillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n pure\n returns (bytes memory fillOrderCalldata)\n {\n // We need to call MExchangeCore.fillOrder using a delegatecall in\n // assembly so that we can intercept a call that throws. For this, we\n // need the input encoded in memory in the Ethereum ABIv2 format [1].\n\n // | Area | Offset | Length | Contents |\n // | -------- |--------|---------|-------------------------------------------- |\n // | Header | 0x00 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 0x00 | | 1. offset to order (*) |\n // | | 0x20 | | 2. takerAssetFillAmount |\n // | | 0x40 | | 3. offset to signature (*) |\n // | Data | | 12 * 32 | order: |\n // | | 0x000 | | 1. senderAddress |\n // | | 0x020 | | 2. makerAddress |\n // | | 0x040 | | 3. takerAddress |\n // | | 0x060 | | 4. feeRecipientAddress |\n // | | 0x080 | | 5. makerAssetAmount |\n // | | 0x0A0 | | 6. takerAssetAmount |\n // | | 0x0C0 | | 7. makerFeeAmount |\n // | | 0x0E0 | | 8. takerFeeAmount |\n // | | 0x100 | | 9. expirationTimeSeconds |\n // | | 0x120 | | 10. salt |\n // | | 0x140 | | 11. Offset to makerAssetData (*) |\n // | | 0x160 | | 12. Offset to takerAssetData (*) |\n // | | 0x180 | 32 | makerAssetData Length |\n // | | 0x1A0 | ** | makerAssetData Contents |\n // | | 0x1C0 | 32 | takerAssetData Length |\n // | | 0x1E0 | ** | takerAssetData Contents |\n // | | 0x200 | 32 | signature Length |\n // | | 0x220 | ** | signature Contents |\n\n // * Offsets are calculated from the beginning of the current area: Header, Params, Data:\n // An offset stored in the Params area is calculated from the beginning of the Params section.\n // An offset stored in the Data area is calculated from the beginning of the Data section.\n\n // ** The length of dynamic array contents are stored in the field immediately preceeding the contents.\n\n // [1]: https://solidity.readthedocs.io/en/develop/abi-spec.html\n\n assembly {\n\n // Areas below may use the following variables:\n // 1. <area>Start -- Start of this area in memory\n // 2. <area>End -- End of this area in memory. This value may\n // be precomputed (before writing contents),\n // or it may be computed as contents are written.\n // 3. <area>Offset -- Current offset into area. If an area's End\n // is precomputed, this variable tracks the\n // offsets of contents as they are written.\n\n /////// Setup Header Area ///////\n // Load free memory pointer\n fillOrderCalldata := mload(0x40)\n // bytes4(keccak256(\"fillOrder((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),uint256,bytes)\"))\n // = 0xb4be83d5\n // Leave 0x20 bytes to store the length\n mstore(add(fillOrderCalldata, 0x20), 0xb4be83d500000000000000000000000000000000000000000000000000000000)\n let headerAreaEnd := add(fillOrderCalldata, 0x24)\n\n /////// Setup Params Area ///////\n // This area is preallocated and written to later.\n // This is because we need to fill in offsets that have not yet been calculated.\n let paramsAreaStart := headerAreaEnd\n let paramsAreaEnd := add(paramsAreaStart, 0x60)\n let paramsAreaOffset := paramsAreaStart\n\n /////// Setup Data Area ///////\n let dataAreaStart := paramsAreaEnd\n let dataAreaEnd := dataAreaStart\n\n // Offset from the source data we're reading from\n let sourceOffset := order\n // arrayLenBytes and arrayLenWords track the length of a dynamically-allocated bytes array.\n let arrayLenBytes := 0\n let arrayLenWords := 0\n\n /////// Write order Struct ///////\n // Write memory location of Order, relative to the start of the\n // parameter list, then increment the paramsAreaOffset respectively.\n mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))\n paramsAreaOffset := add(paramsAreaOffset, 0x20)\n\n // Write values for each field in the order\n // It would be nice to use a loop, but we save on gas by writing\n // the stores sequentially.\n mstore(dataAreaEnd, mload(sourceOffset)) // makerAddress\n mstore(add(dataAreaEnd, 0x20), mload(add(sourceOffset, 0x20))) // takerAddress\n mstore(add(dataAreaEnd, 0x40), mload(add(sourceOffset, 0x40))) // feeRecipientAddress\n mstore(add(dataAreaEnd, 0x60), mload(add(sourceOffset, 0x60))) // senderAddress\n mstore(add(dataAreaEnd, 0x80), mload(add(sourceOffset, 0x80))) // makerAssetAmount\n mstore(add(dataAreaEnd, 0xA0), mload(add(sourceOffset, 0xA0))) // takerAssetAmount\n mstore(add(dataAreaEnd, 0xC0), mload(add(sourceOffset, 0xC0))) // makerFeeAmount\n mstore(add(dataAreaEnd, 0xE0), mload(add(sourceOffset, 0xE0))) // takerFeeAmount\n mstore(add(dataAreaEnd, 0x100), mload(add(sourceOffset, 0x100))) // expirationTimeSeconds\n mstore(add(dataAreaEnd, 0x120), mload(add(sourceOffset, 0x120))) // salt\n mstore(add(dataAreaEnd, 0x140), mload(add(sourceOffset, 0x140))) // Offset to makerAssetData\n mstore(add(dataAreaEnd, 0x160), mload(add(sourceOffset, 0x160))) // Offset to takerAssetData\n dataAreaEnd := add(dataAreaEnd, 0x180)\n sourceOffset := add(sourceOffset, 0x180)\n\n // Write offset to <order.makerAssetData>\n mstore(add(dataAreaStart, mul(10, 0x20)), sub(dataAreaEnd, dataAreaStart))\n\n // Calculate length of <order.makerAssetData>\n sourceOffset := mload(add(order, 0x140)) // makerAssetData\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of <order.makerAssetData>\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of <order.makerAssetData>\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n // Write offset to <order.takerAssetData>\n mstore(add(dataAreaStart, mul(11, 0x20)), sub(dataAreaEnd, dataAreaStart))\n\n // Calculate length of <order.takerAssetData>\n sourceOffset := mload(add(order, 0x160)) // takerAssetData\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of <order.takerAssetData>\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of <order.takerAssetData>\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n /////// Write takerAssetFillAmount ///////\n mstore(paramsAreaOffset, takerAssetFillAmount)\n paramsAreaOffset := add(paramsAreaOffset, 0x20)\n\n /////// Write signature ///////\n // Write offset to paramsArea\n mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))\n\n // Calculate length of signature\n sourceOffset := signature\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of signature\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of signature\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n // Set length of calldata\n mstore(fillOrderCalldata, sub(dataAreaEnd, add(fillOrderCalldata, 0x20)))\n\n // Increment free memory pointer\n mstore(0x40, dataAreaEnd)\n }\n\n return fillOrderCalldata;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibConstants.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\n// solhint-disable max-line-length\ncontract LibConstants {\n \n // Asset data for ZRX token. Used for fee transfers.\n // @TODO: Hardcode constant when we deploy. Currently \n // not constant to make testing easier.\n\n // The proxyId for ZRX_ASSET_DATA is bytes4(keccak256(\"ERC20Token(address)\")) = 0xf47261b0\n \n // Kovan ZRX address is 0x6ff6c0ff1d68b964901f986d4c9fa3ac68346570.\n // The ABI encoded proxyId and address is 0xf47261b00000000000000000000000006ff6c0ff1d68b964901f986d4c9fa3ac68346570\n // bytes constant public ZRX_ASSET_DATA = \"\\xf4\\x72\\x61\\xb0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x6f\\xf6\\xc0\\xff\\x1d\\x68\\xb9\\x64\\x90\\x1f\\x98\\x6d\\x4c\\x9f\\xa3\\xac\\x68\\x34\\x65\\x70\";\n \n // Mainnet ZRX address is 0xe41d2489571d322189246dafa5ebde1f4699f498.\n // The ABI encoded proxyId and address is 0xf47261b0000000000000000000000000e41d2489571d322189246dafa5ebde1f4699f498\n bytes constant public ZRX_ASSET_DATA = \"\\xf4\\x72\\x61\\xb0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xe4\\x1d\\x24\\x89\\x57\\x1d\\x32\\x21\\x89\\x24\\x6d\\xaf\\xa5\\xeb\\xde\\x1f\\x46\\x99\\xf4\\x98\";\n}\n// solhint-enable max-line-length\n",
- "2.0.0/protocol/Exchange/libs/LibEIP712.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract LibEIP712 {\n\n // EIP191 header for EIP712 prefix\n string constant internal EIP191_HEADER = \"\\x19\\x01\";\n\n // EIP712 Domain Name value\n string constant internal EIP712_DOMAIN_NAME = \"0x Protocol\";\n\n // EIP712 Domain Version value\n string constant internal EIP712_DOMAIN_VERSION = \"2\";\n\n // Hash of the EIP712 Domain Separator Schema\n bytes32 constant internal EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"EIP712Domain(\",\n \"string name,\",\n \"string version,\",\n \"address verifyingContract\",\n \")\"\n ));\n\n // Hash of the EIP712 Domain Separator data\n // solhint-disable-next-line var-name-mixedcase\n bytes32 public EIP712_DOMAIN_HASH;\n\n constructor ()\n public\n {\n EIP712_DOMAIN_HASH = keccak256(abi.encodePacked(\n EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH,\n keccak256(bytes(EIP712_DOMAIN_NAME)),\n keccak256(bytes(EIP712_DOMAIN_VERSION)),\n bytes32(address(this))\n ));\n }\n\n /// @dev Calculates EIP712 encoding for a hash struct in this EIP712 Domain.\n /// @param hashStruct The EIP712 hash struct.\n /// @return EIP712 hash applied to this EIP712 Domain.\n function hashEIP712Message(bytes32 hashStruct)\n internal\n view\n returns (bytes32 result)\n {\n bytes32 eip712DomainHash = EIP712_DOMAIN_HASH;\n\n // Assembly for more efficient computing:\n // keccak256(abi.encodePacked(\n // EIP191_HEADER,\n // EIP712_DOMAIN_HASH,\n // hashStruct \n // ));\n\n assembly {\n // Load free memory pointer\n let memPtr := mload(64)\n\n mstore(memPtr, 0x1901000000000000000000000000000000000000000000000000000000000000) // EIP191 header\n mstore(add(memPtr, 2), eip712DomainHash) // EIP712 domain hash\n mstore(add(memPtr, 34), hashStruct) // Hash of struct\n\n // Compute hash\n result := keccak256(memPtr, 66)\n }\n return result;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\n// solhint-disable\npragma solidity 0.4.24;\n\n\n/// @dev This contract documents the revert reasons used in the Exchange contract.\n/// This contract is intended to serve as a reference, but is not actually used for efficiency reasons.\ncontract LibExchangeErrors {\n\n /// Order validation errors ///\n string constant ORDER_UNFILLABLE = \"ORDER_UNFILLABLE\"; // Order cannot be filled.\n string constant INVALID_MAKER = \"INVALID_MAKER\"; // Invalid makerAddress.\n string constant INVALID_TAKER = \"INVALID_TAKER\"; // Invalid takerAddress.\n string constant INVALID_SENDER = \"INVALID_SENDER\"; // Invalid `msg.sender`.\n string constant INVALID_ORDER_SIGNATURE = \"INVALID_ORDER_SIGNATURE\"; // Signature validation failed. \n \n /// fillOrder validation errors ///\n string constant INVALID_TAKER_AMOUNT = \"INVALID_TAKER_AMOUNT\"; // takerAssetFillAmount cannot equal 0.\n string constant ROUNDING_ERROR = \"ROUNDING_ERROR\"; // Rounding error greater than 0.1% of takerAssetFillAmount. \n \n /// Signature validation errors ///\n string constant INVALID_SIGNATURE = \"INVALID_SIGNATURE\"; // Signature validation failed. \n string constant SIGNATURE_ILLEGAL = \"SIGNATURE_ILLEGAL\"; // Signature type is illegal.\n string constant SIGNATURE_UNSUPPORTED = \"SIGNATURE_UNSUPPORTED\"; // Signature type unsupported.\n \n /// cancelOrdersUptTo errors ///\n string constant INVALID_NEW_ORDER_EPOCH = \"INVALID_NEW_ORDER_EPOCH\"; // Specified salt must be greater than or equal to existing orderEpoch.\n\n /// fillOrKillOrder errors ///\n string constant COMPLETE_FILL_FAILED = \"COMPLETE_FILL_FAILED\"; // Desired takerAssetFillAmount could not be completely filled. \n\n /// matchOrders errors ///\n string constant NEGATIVE_SPREAD_REQUIRED = \"NEGATIVE_SPREAD_REQUIRED\"; // Matched orders must have a negative spread.\n\n /// Transaction errors ///\n string constant REENTRANCY_ILLEGAL = \"REENTRANCY_ILLEGAL\"; // Recursive reentrancy is not allowed. \n string constant INVALID_TX_HASH = \"INVALID_TX_HASH\"; // Transaction has already been executed. \n string constant INVALID_TX_SIGNATURE = \"INVALID_TX_SIGNATURE\"; // Signature validation failed. \n string constant FAILED_EXECUTION = \"FAILED_EXECUTION\"; // Transaction execution failed. \n \n /// registerAssetProxy errors ///\n string constant ASSET_PROXY_ALREADY_EXISTS = \"ASSET_PROXY_ALREADY_EXISTS\"; // AssetProxy with same id already exists.\n\n /// dispatchTransferFrom errors ///\n string constant ASSET_PROXY_DOES_NOT_EXIST = \"ASSET_PROXY_DOES_NOT_EXIST\"; // No assetProxy registered at given id.\n string constant TRANSFER_FAILED = \"TRANSFER_FAILED\"; // Asset transfer unsuccesful.\n\n /// Length validation errors ///\n string constant LENGTH_GREATER_THAN_0_REQUIRED = \"LENGTH_GREATER_THAN_0_REQUIRED\"; // Byte array must have a length greater than 0.\n string constant LENGTH_GREATER_THAN_3_REQUIRED = \"LENGTH_GREATER_THAN_3_REQUIRED\"; // Byte array must have a length greater than 3.\n string constant LENGTH_0_REQUIRED = \"LENGTH_0_REQUIRED\"; // Byte array must have a length of 0.\n string constant LENGTH_65_REQUIRED = \"LENGTH_65_REQUIRED\"; // Byte array must have a length of 65.\n}\n",
- "2.0.0/protocol/Exchange/libs/LibFillResults.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract LibFillResults is\n SafeMath\n{\n struct FillResults {\n uint256 makerAssetFilledAmount; // Total amount of makerAsset(s) filled.\n uint256 takerAssetFilledAmount; // Total amount of takerAsset(s) filled.\n uint256 makerFeePaid; // Total amount of ZRX paid by maker(s) to feeRecipient(s).\n uint256 takerFeePaid; // Total amount of ZRX paid by taker to feeRecipients(s).\n }\n\n struct MatchedFillResults {\n FillResults left; // Amounts filled and fees paid of left order.\n FillResults right; // Amounts filled and fees paid of right order.\n uint256 leftMakerAssetSpreadAmount; // Spread between price of left and right order, denominated in the left order's makerAsset, paid to taker.\n }\n\n /// @dev Adds properties of both FillResults instances.\n /// Modifies the first FillResults instance specified.\n /// @param totalFillResults Fill results instance that will be added onto.\n /// @param singleFillResults Fill results instance that will be added to totalFillResults.\n function addFillResults(FillResults memory totalFillResults, FillResults memory singleFillResults)\n internal\n pure\n {\n totalFillResults.makerAssetFilledAmount = safeAdd(totalFillResults.makerAssetFilledAmount, singleFillResults.makerAssetFilledAmount);\n totalFillResults.takerAssetFilledAmount = safeAdd(totalFillResults.takerAssetFilledAmount, singleFillResults.takerAssetFilledAmount);\n totalFillResults.makerFeePaid = safeAdd(totalFillResults.makerFeePaid, singleFillResults.makerFeePaid);\n totalFillResults.takerFeePaid = safeAdd(totalFillResults.takerFeePaid, singleFillResults.takerFeePaid);\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibMath.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract LibMath is\n SafeMath\n{\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// Reverts if rounding error is >= 0.1%\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded down.\n function safeGetPartialAmountFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n require(\n !isRoundingErrorFloor(\n numerator,\n denominator,\n target\n ),\n \"ROUNDING_ERROR\"\n );\n \n partialAmount = safeDiv(\n safeMul(numerator, target),\n denominator\n );\n return partialAmount;\n }\n\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// Reverts if rounding error is >= 0.1%\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded up.\n function safeGetPartialAmountCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n require(\n !isRoundingErrorCeil(\n numerator,\n denominator,\n target\n ),\n \"ROUNDING_ERROR\"\n );\n \n // safeDiv computes `floor(a / b)`. We use the identity (a, b integer):\n // ceil(a / b) = floor((a + b - 1) / b)\n // To implement `ceil(a / b)` using safeDiv.\n partialAmount = safeDiv(\n safeAdd(\n safeMul(numerator, target),\n safeSub(denominator, 1)\n ),\n denominator\n );\n return partialAmount;\n }\n\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded down.\n function getPartialAmountFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n partialAmount = safeDiv(\n safeMul(numerator, target),\n denominator\n );\n return partialAmount;\n }\n \n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded up.\n function getPartialAmountCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n // safeDiv computes `floor(a / b)`. We use the identity (a, b integer):\n // ceil(a / b) = floor((a + b - 1) / b)\n // To implement `ceil(a / b)` using safeDiv.\n partialAmount = safeDiv(\n safeAdd(\n safeMul(numerator, target),\n safeSub(denominator, 1)\n ),\n denominator\n );\n return partialAmount;\n }\n \n /// @dev Checks if rounding error >= 0.1% when rounding down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to multiply with numerator/denominator.\n /// @return Rounding error is present.\n function isRoundingErrorFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (bool isError)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n \n // The absolute rounding error is the difference between the rounded\n // value and the ideal value. The relative rounding error is the\n // absolute rounding error divided by the absolute value of the\n // ideal value. This is undefined when the ideal value is zero.\n //\n // The ideal value is `numerator * target / denominator`.\n // Let's call `numerator * target % denominator` the remainder.\n // The absolute error is `remainder / denominator`.\n //\n // When the ideal value is zero, we require the absolute error to\n // be zero. Fortunately, this is always the case. The ideal value is\n // zero iff `numerator == 0` and/or `target == 0`. In this case the\n // remainder and absolute error are also zero. \n if (target == 0 || numerator == 0) {\n return false;\n }\n \n // Otherwise, we want the relative rounding error to be strictly\n // less than 0.1%.\n // The relative error is `remainder / (numerator * target)`.\n // We want the relative error less than 1 / 1000:\n // remainder / (numerator * denominator) < 1 / 1000\n // or equivalently:\n // 1000 * remainder < numerator * target\n // so we have a rounding error iff:\n // 1000 * remainder >= numerator * target\n uint256 remainder = mulmod(\n target,\n numerator,\n denominator\n );\n isError = safeMul(1000, remainder) >= safeMul(numerator, target);\n return isError;\n }\n \n /// @dev Checks if rounding error >= 0.1% when rounding up.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to multiply with numerator/denominator.\n /// @return Rounding error is present.\n function isRoundingErrorCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (bool isError)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n \n // See the comments in `isRoundingError`.\n if (target == 0 || numerator == 0) {\n // When either is zero, the ideal value and rounded value are zero\n // and there is no rounding error. (Although the relative error\n // is undefined.)\n return false;\n }\n // Compute remainder as before\n uint256 remainder = mulmod(\n target,\n numerator,\n denominator\n );\n remainder = safeSub(denominator, remainder) % denominator;\n isError = safeMul(1000, remainder) >= safeMul(numerator, target);\n return isError;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibOrder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./LibEIP712.sol\";\n\n\ncontract LibOrder is\n LibEIP712\n{\n // Hash for the EIP712 Order Schema\n bytes32 constant internal EIP712_ORDER_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"Order(\",\n \"address makerAddress,\",\n \"address takerAddress,\",\n \"address feeRecipientAddress,\",\n \"address senderAddress,\",\n \"uint256 makerAssetAmount,\",\n \"uint256 takerAssetAmount,\",\n \"uint256 makerFee,\",\n \"uint256 takerFee,\",\n \"uint256 expirationTimeSeconds,\",\n \"uint256 salt,\",\n \"bytes makerAssetData,\",\n \"bytes takerAssetData\",\n \")\"\n ));\n\n // A valid order remains fillable until it is expired, fully filled, or cancelled.\n // An order's state is unaffected by external factors, like account balances.\n enum OrderStatus {\n INVALID, // Default value\n INVALID_MAKER_ASSET_AMOUNT, // Order does not have a valid maker asset amount\n INVALID_TAKER_ASSET_AMOUNT, // Order does not have a valid taker asset amount\n FILLABLE, // Order is fillable\n EXPIRED, // Order has already expired\n FULLY_FILLED, // Order is fully filled\n CANCELLED // Order has been cancelled\n }\n\n // solhint-disable max-line-length\n struct Order {\n address makerAddress; // Address that created the order. \n address takerAddress; // Address that is allowed to fill the order. If set to 0, any address is allowed to fill the order. \n address feeRecipientAddress; // Address that will recieve fees when order is filled. \n address senderAddress; // Address that is allowed to call Exchange contract methods that affect this order. If set to 0, any address is allowed to call these methods.\n uint256 makerAssetAmount; // Amount of makerAsset being offered by maker. Must be greater than 0. \n uint256 takerAssetAmount; // Amount of takerAsset being bid on by maker. Must be greater than 0. \n uint256 makerFee; // Amount of ZRX paid to feeRecipient by maker when order is filled. If set to 0, no transfer of ZRX from maker to feeRecipient will be attempted.\n uint256 takerFee; // Amount of ZRX paid to feeRecipient by taker when order is filled. If set to 0, no transfer of ZRX from taker to feeRecipient will be attempted.\n uint256 expirationTimeSeconds; // Timestamp in seconds at which order expires. \n uint256 salt; // Arbitrary number to facilitate uniqueness of the order's hash. \n bytes makerAssetData; // Encoded data that can be decoded by a specified proxy contract when transferring makerAsset. The last byte references the id of this proxy.\n bytes takerAssetData; // Encoded data that can be decoded by a specified proxy contract when transferring takerAsset. The last byte references the id of this proxy.\n }\n // solhint-enable max-line-length\n\n struct OrderInfo {\n uint8 orderStatus; // Status that describes order's validity and fillability.\n bytes32 orderHash; // EIP712 hash of the order (see LibOrder.getOrderHash).\n uint256 orderTakerAssetFilledAmount; // Amount of order that has already been filled.\n }\n\n /// @dev Calculates Keccak-256 hash of the order.\n /// @param order The order structure.\n /// @return Keccak-256 EIP712 hash of the order.\n function getOrderHash(Order memory order)\n internal\n view\n returns (bytes32 orderHash)\n {\n orderHash = hashEIP712Message(hashOrder(order));\n return orderHash;\n }\n\n /// @dev Calculates EIP712 hash of the order.\n /// @param order The order structure.\n /// @return EIP712 hash of the order.\n function hashOrder(Order memory order)\n internal\n pure\n returns (bytes32 result)\n {\n bytes32 schemaHash = EIP712_ORDER_SCHEMA_HASH;\n bytes32 makerAssetDataHash = keccak256(order.makerAssetData);\n bytes32 takerAssetDataHash = keccak256(order.takerAssetData);\n\n // Assembly for more efficiently computing:\n // keccak256(abi.encodePacked(\n // EIP712_ORDER_SCHEMA_HASH,\n // bytes32(order.makerAddress),\n // bytes32(order.takerAddress),\n // bytes32(order.feeRecipientAddress),\n // bytes32(order.senderAddress),\n // order.makerAssetAmount,\n // order.takerAssetAmount,\n // order.makerFee,\n // order.takerFee,\n // order.expirationTimeSeconds,\n // order.salt,\n // keccak256(order.makerAssetData),\n // keccak256(order.takerAssetData)\n // ));\n\n assembly {\n // Calculate memory addresses that will be swapped out before hashing\n let pos1 := sub(order, 32)\n let pos2 := add(order, 320)\n let pos3 := add(order, 352)\n\n // Backup\n let temp1 := mload(pos1)\n let temp2 := mload(pos2)\n let temp3 := mload(pos3)\n \n // Hash in place\n mstore(pos1, schemaHash)\n mstore(pos2, makerAssetDataHash)\n mstore(pos3, takerAssetDataHash)\n result := keccak256(pos1, 416)\n \n // Restore\n mstore(pos1, temp1)\n mstore(pos2, temp2)\n mstore(pos3, temp3)\n }\n return result;\n }\n}\n",
- "2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAssetProxyDispatcher.sol\";\n\n\ncontract MAssetProxyDispatcher is\n IAssetProxyDispatcher\n{\n // Logs registration of new asset proxy\n event AssetProxyRegistered(\n bytes4 id, // Id of new registered AssetProxy.\n address assetProxy // Address of new registered AssetProxy.\n );\n\n /// @dev Forwards arguments to assetProxy and calls `transferFrom`. Either succeeds or throws.\n /// @param assetData Byte array encoded for the asset.\n /// @param from Address to transfer token from.\n /// @param to Address to transfer token to.\n /// @param amount Amount of token to transfer.\n function dispatchTransferFrom(\n bytes memory assetData,\n address from,\n address to,\n uint256 amount\n )\n internal;\n}\n",
- "2.0.0/protocol/Exchange/mixins/MExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IExchangeCore.sol\";\n\n\ncontract MExchangeCore is\n IExchangeCore\n{\n // Fill event is emitted whenever an order is filled.\n event Fill(\n address indexed makerAddress, // Address that created the order. \n address indexed feeRecipientAddress, // Address that received fees.\n address takerAddress, // Address that filled the order.\n address senderAddress, // Address that called the Exchange contract (msg.sender).\n uint256 makerAssetFilledAmount, // Amount of makerAsset sold by maker and bought by taker. \n uint256 takerAssetFilledAmount, // Amount of takerAsset sold by taker and bought by maker.\n uint256 makerFeePaid, // Amount of ZRX paid to feeRecipient by maker.\n uint256 takerFeePaid, // Amount of ZRX paid to feeRecipient by taker.\n bytes32 indexed orderHash, // EIP712 hash of order (see LibOrder.getOrderHash).\n bytes makerAssetData, // Encoded data specific to makerAsset. \n bytes takerAssetData // Encoded data specific to takerAsset.\n );\n\n // Cancel event is emitted whenever an individual order is cancelled.\n event Cancel(\n address indexed makerAddress, // Address that created the order. \n address indexed feeRecipientAddress, // Address that would have recieved fees if order was filled. \n address senderAddress, // Address that called the Exchange contract (msg.sender).\n bytes32 indexed orderHash, // EIP712 hash of order (see LibOrder.getOrderHash).\n bytes makerAssetData, // Encoded data specific to makerAsset. \n bytes takerAssetData // Encoded data specific to takerAsset.\n );\n\n // CancelUpTo event is emitted whenever `cancelOrdersUpTo` is executed succesfully.\n event CancelUpTo(\n address indexed makerAddress, // Orders cancelled must have been created by this address.\n address indexed senderAddress, // Orders cancelled must have a `senderAddress` equal to this address.\n uint256 orderEpoch // Orders with specified makerAddress and senderAddress with a salt less than this value are considered cancelled.\n );\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev After calling, the order can not be filled anymore.\n /// @param order Order struct containing order specifications.\n function cancelOrderInternal(LibOrder.Order memory order)\n internal;\n\n /// @dev Updates state with results of a fill order.\n /// @param order that was filled.\n /// @param takerAddress Address of taker who filled the order.\n /// @param orderTakerAssetFilledAmount Amount of order already filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function updateFilledState(\n LibOrder.Order memory order,\n address takerAddress,\n bytes32 orderHash,\n uint256 orderTakerAssetFilledAmount,\n LibFillResults.FillResults memory fillResults\n )\n internal;\n\n /// @dev Updates state with results of cancelling an order.\n /// State is only updated if the order is currently fillable.\n /// Otherwise, updating state would have no effect.\n /// @param order that was cancelled.\n /// @param orderHash Hash of order that was cancelled.\n function updateCancelledState(\n LibOrder.Order memory order,\n bytes32 orderHash\n )\n internal;\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAddress Address of order taker.\n /// @param signature Proof that the orders was created by its maker.\n function assertFillableOrder(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo,\n address takerAddress,\n bytes memory signature\n )\n internal\n view;\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo Status, orderHash, and amount already filled of order.\n /// @param takerAssetFillAmount Desired amount of order to fill by taker.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @param makerAssetFilledAmount Amount of makerAsset that will be transfered.\n function assertValidFill(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo,\n uint256 takerAssetFillAmount,\n uint256 takerAssetFilledAmount,\n uint256 makerAssetFilledAmount\n )\n internal\n view;\n\n /// @dev Validates context for cancelOrder. Succeeds or throws.\n /// @param order to be cancelled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n function assertValidCancel(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo\n )\n internal\n view;\n\n /// @dev Calculates amounts filled and fees paid by maker and taker.\n /// @param order to be filled.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function calculateFillResults(\n LibOrder.Order memory order,\n uint256 takerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.FillResults memory fillResults);\n\n}\n",
- "2.0.0/protocol/Exchange/mixins/MMatchOrders.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IMatchOrders.sol\";\n\n\ncontract MMatchOrders is\n IMatchOrders\n{\n /// @dev Validates context for matchOrders. Succeeds or throws.\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n function assertValidMatch(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder\n )\n internal\n pure;\n\n /// @dev Calculates fill amounts for the matched orders.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the leftOrder order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftOrderTakerAssetFilledAmount Amount of left order already filled.\n /// @param rightOrderTakerAssetFilledAmount Amount of right order already filled.\n /// @param matchedFillResults Amounts to fill and fees to pay by maker and taker of matched orders.\n function calculateMatchedFillResults(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n uint256 leftOrderTakerAssetFilledAmount,\n uint256 rightOrderTakerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.MatchedFillResults memory matchedFillResults);\n\n}\n",
- "2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/ISignatureValidator.sol\";\n\n\ncontract MSignatureValidator is\n ISignatureValidator\n{\n event SignatureValidatorApproval(\n address indexed signerAddress, // Address that approves or disapproves a contract to verify signatures.\n address indexed validatorAddress, // Address of signature validator contract.\n bool approved // Approval or disapproval of validator contract.\n );\n\n // Allowed signature types.\n enum SignatureType {\n Illegal, // 0x00, default value\n Invalid, // 0x01\n EIP712, // 0x02\n EthSign, // 0x03\n Wallet, // 0x04\n Validator, // 0x05\n PreSigned, // 0x06\n NSignatureTypes // 0x07, number of signature types. Always leave at end.\n }\n\n /// @dev Verifies signature using logic defined by Wallet contract.\n /// @param hash Any 32 byte hash.\n /// @param walletAddress Address that should have signed the given hash\n /// and defines its own signature verification method.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidWalletSignature(\n bytes32 hash,\n address walletAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid);\n\n /// @dev Verifies signature using logic defined by Validator contract.\n /// @param validatorAddress Address of validator contract.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidValidatorSignature(\n address validatorAddress,\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/mixins/MTransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\nimport \"../interfaces/ITransactions.sol\";\n\n\ncontract MTransactions is\n ITransactions\n{\n // Hash for the EIP712 ZeroEx Transaction Schema\n bytes32 constant internal EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"ZeroExTransaction(\",\n \"uint256 salt,\",\n \"address signerAddress,\",\n \"bytes data\",\n \")\"\n ));\n\n /// @dev Calculates EIP712 hash of the Transaction.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @return EIP712 hash of the Transaction.\n function hashZeroExTransaction(\n uint256 salt,\n address signerAddress,\n bytes memory data\n )\n internal\n pure\n returns (bytes32 result);\n\n /// @dev The current function will be called in the context of this address (either 0x transaction signer or `msg.sender`).\n /// If calling a fill function, this address will represent the taker.\n /// If calling a cancel function, this address will represent the maker.\n /// @return Signer of 0x transaction if entry point is `executeTransaction`.\n /// `msg.sender` if entry point is any other function.\n function getCurrentContextAddress()\n internal\n view\n returns (address);\n}\n",
- "2.0.0/protocol/Exchange/mixins/MWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IWrapperFunctions.sol\";\n\n\ncontract MWrapperFunctions is \n IWrapperFunctions\n{\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n}\n",
- "2.0.0/tokens/ERC20Token/IERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC20Token {\n\n // solhint-disable no-simple-event-func-name\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 _value\n );\n\n event Approval(\n address indexed _owner,\n address indexed _spender,\n uint256 _value\n );\n\n /// @dev send `value` token to `to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transfer(address _to, uint256 _value)\n external\n returns (bool);\n\n /// @dev send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool);\n \n /// @dev `msg.sender` approves `_spender` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Always true if the call has enough gas to complete execution\n function approve(address _spender, uint256 _value)\n external\n returns (bool);\n\n /// @dev Query total supply of token\n /// @return Total supply of token\n function totalSupply()\n external\n view\n returns (uint256);\n \n /// @param _owner The address from which the balance will be retrieved\n /// @return Balance of owner\n function balanceOf(address _owner)\n external\n view\n returns (uint256);\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender)\n external\n view\n returns (uint256);\n}\n",
- "2.0.0/tokens/ERC721Token/IERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC721Token {\n\n /// @dev This emits when ownership of any NFT changes by any mechanism.\n /// This event emits when NFTs are created (`from` == 0) and destroyed\n /// (`to` == 0). Exception: during contract creation, any number of NFTs\n /// may be created and assigned without emitting Transfer. At the time of\n /// any transfer, the approved address for that NFT (if any) is reset to none.\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 indexed _tokenId\n );\n\n /// @dev This emits when the approved address for an NFT is changed or\n /// reaffirmed. The zero address indicates there is no approved address.\n /// When a Transfer event emits, this also indicates that the approved\n /// address for that NFT (if any) is reset to none.\n event Approval(\n address indexed _owner,\n address indexed _approved,\n uint256 indexed _tokenId\n );\n\n /// @dev This emits when an operator is enabled or disabled for an owner.\n /// The operator can manage all NFTs of the owner.\n event ApprovalForAll(\n address indexed _owner,\n address indexed _operator,\n bool _approved\n );\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// perator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT. When transfer is complete, this function\n /// checks if `_to` is a smart contract (code size > 0). If so, it calls\n /// `onERC721Received` on `_to` and throws if the return value is not\n /// `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n /// @param _data Additional data with no specified format, sent in call to `_to`\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId,\n bytes _data\n )\n external;\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev This works identically to the other function with an extra data parameter,\n /// except this function just sets data to \"\".\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n external;\n\n /// @notice Change or reaffirm the approved address for an NFT\n /// @dev The zero address indicates there is no approved address.\n /// Throws unless `msg.sender` is the current NFT owner, or an authorized\n /// operator of the current owner.\n /// @param _approved The new approved NFT controller\n /// @param _tokenId The NFT to approve\n function approve(address _approved, uint256 _tokenId)\n external;\n\n /// @notice Enable or disable approval for a third party (\"operator\") to manage\n /// all of `msg.sender`'s assets\n /// @dev Emits the ApprovalForAll event. The contract MUST allow\n /// multiple operators per owner.\n /// @param _operator Address to add to the set of authorized operators\n /// @param _approved True if the operator is approved, false to revoke approval\n function setApprovalForAll(address _operator, bool _approved)\n external;\n\n /// @notice Count all NFTs assigned to an owner\n /// @dev NFTs assigned to the zero address are considered invalid, and this\n /// function throws for queries about the zero address.\n /// @param _owner An address for whom to query the balance\n /// @return The number of NFTs owned by `_owner`, possibly zero\n function balanceOf(address _owner)\n external\n view\n returns (uint256);\n\n /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE\n /// TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE\n /// THEY MAY BE PERMANENTLY LOST\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function transferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n public;\n\n /// @notice Find the owner of an NFT\n /// @dev NFTs assigned to zero address are considered invalid, and queries\n /// about them do throw.\n /// @param _tokenId The identifier for an NFT\n /// @return The address of the owner of the NFT\n function ownerOf(uint256 _tokenId)\n public\n view\n returns (address);\n\n /// @notice Get the approved address for a single NFT\n /// @dev Throws if `_tokenId` is not a valid NFT.\n /// @param _tokenId The NFT to find the approved address for\n /// @return The approved address for this NFT, or the zero address if there is none\n function getApproved(uint256 _tokenId) \n public\n view\n returns (address);\n \n /// @notice Query if an address is an authorized operator for another address\n /// @param _owner The address that owns the NFTs\n /// @param _operator The address that acts on behalf of the owner\n /// @return True if `_operator` is an approved operator for `_owner`, false otherwise\n function isApprovedForAll(address _owner, address _operator)\n public\n view\n returns (bool);\n}\n",
- "2.0.0/tokens/EtherToken/IEtherToken.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../ERC20Token/IERC20Token.sol\";\n\n\ncontract IEtherToken is\n IERC20Token\n{\n function deposit()\n public\n payable;\n \n function withdraw(uint256 amount)\n public;\n}\n",
- "2.0.0/utils/LibBytes/LibBytes.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\nlibrary LibBytes {\n\n using LibBytes for bytes;\n\n /// @dev Gets the memory address for a byte array.\n /// @param input Byte array to lookup.\n /// @return memoryAddress Memory address of byte array. This\n /// points to the header of the byte array which contains\n /// the length.\n function rawAddress(bytes memory input)\n internal\n pure\n returns (uint256 memoryAddress)\n {\n assembly {\n memoryAddress := input\n }\n return memoryAddress;\n }\n \n /// @dev Gets the memory address for the contents of a byte array.\n /// @param input Byte array to lookup.\n /// @return memoryAddress Memory address of the contents of the byte array.\n function contentAddress(bytes memory input)\n internal\n pure\n returns (uint256 memoryAddress)\n {\n assembly {\n memoryAddress := add(input, 32)\n }\n return memoryAddress;\n }\n\n /// @dev Copies `length` bytes from memory location `source` to `dest`.\n /// @param dest memory address to copy bytes to.\n /// @param source memory address to copy bytes from.\n /// @param length number of bytes to copy.\n function memCopy(\n uint256 dest,\n uint256 source,\n uint256 length\n )\n internal\n pure\n {\n if (length < 32) {\n // Handle a partial word by reading destination and masking\n // off the bits we are interested in.\n // This correctly handles overlap, zero lengths and source == dest\n assembly {\n let mask := sub(exp(256, sub(32, length)), 1)\n let s := and(mload(source), not(mask))\n let d := and(mload(dest), mask)\n mstore(dest, or(s, d))\n }\n } else {\n // Skip the O(length) loop when source == dest.\n if (source == dest) {\n return;\n }\n\n // For large copies we copy whole words at a time. The final\n // word is aligned to the end of the range (instead of after the\n // previous) to handle partial words. So a copy will look like this:\n //\n // ####\n // ####\n // ####\n // ####\n //\n // We handle overlap in the source and destination range by\n // changing the copying direction. This prevents us from\n // overwriting parts of source that we still need to copy.\n //\n // This correctly handles source == dest\n //\n if (source > dest) {\n assembly {\n // We subtract 32 from `sEnd` and `dEnd` because it\n // is easier to compare with in the loop, and these\n // are also the addresses we need for copying the\n // last bytes.\n length := sub(length, 32)\n let sEnd := add(source, length)\n let dEnd := add(dest, length)\n\n // Remember the last 32 bytes of source\n // This needs to be done here and not after the loop\n // because we may have overwritten the last bytes in\n // source already due to overlap.\n let last := mload(sEnd)\n\n // Copy whole words front to back\n // Note: the first check is always true,\n // this could have been a do-while loop.\n // solhint-disable-next-line no-empty-blocks\n for {} lt(source, sEnd) {} {\n mstore(dest, mload(source))\n source := add(source, 32)\n dest := add(dest, 32)\n }\n \n // Write the last 32 bytes\n mstore(dEnd, last)\n }\n } else {\n assembly {\n // We subtract 32 from `sEnd` and `dEnd` because those\n // are the starting points when copying a word at the end.\n length := sub(length, 32)\n let sEnd := add(source, length)\n let dEnd := add(dest, length)\n\n // Remember the first 32 bytes of source\n // This needs to be done here and not after the loop\n // because we may have overwritten the first bytes in\n // source already due to overlap.\n let first := mload(source)\n\n // Copy whole words back to front\n // We use a signed comparisson here to allow dEnd to become\n // negative (happens when source and dest < 32). Valid\n // addresses in local memory will never be larger than\n // 2**255, so they can be safely re-interpreted as signed.\n // Note: the first check is always true,\n // this could have been a do-while loop.\n // solhint-disable-next-line no-empty-blocks\n for {} slt(dest, dEnd) {} {\n mstore(dEnd, mload(sEnd))\n sEnd := sub(sEnd, 32)\n dEnd := sub(dEnd, 32)\n }\n \n // Write the first 32 bytes\n mstore(dest, first)\n }\n }\n }\n }\n\n /// @dev Returns a slices from a byte array.\n /// @param b The byte array to take a slice from.\n /// @param from The starting index for the slice (inclusive).\n /// @param to The final index for the slice (exclusive).\n /// @return result The slice containing bytes at indices [from, to)\n function slice(\n bytes memory b,\n uint256 from,\n uint256 to\n )\n internal\n pure\n returns (bytes memory result)\n {\n require(\n from <= to,\n \"FROM_LESS_THAN_TO_REQUIRED\"\n );\n require(\n to < b.length,\n \"TO_LESS_THAN_LENGTH_REQUIRED\"\n );\n \n // Create a new bytes structure and copy contents\n result = new bytes(to - from);\n memCopy(\n result.contentAddress(),\n b.contentAddress() + from,\n result.length\n );\n return result;\n }\n \n /// @dev Returns a slice from a byte array without preserving the input.\n /// @param b The byte array to take a slice from. Will be destroyed in the process.\n /// @param from The starting index for the slice (inclusive).\n /// @param to The final index for the slice (exclusive).\n /// @return result The slice containing bytes at indices [from, to)\n /// @dev When `from == 0`, the original array will match the slice. In other cases its state will be corrupted.\n function sliceDestructive(\n bytes memory b,\n uint256 from,\n uint256 to\n )\n internal\n pure\n returns (bytes memory result)\n {\n require(\n from <= to,\n \"FROM_LESS_THAN_TO_REQUIRED\"\n );\n require(\n to < b.length,\n \"TO_LESS_THAN_LENGTH_REQUIRED\"\n );\n \n // Create a new bytes structure around [from, to) in-place.\n assembly {\n result := add(b, from)\n mstore(result, sub(to, from))\n }\n return result;\n }\n\n /// @dev Pops the last byte off of a byte array by modifying its length.\n /// @param b Byte array that will be modified.\n /// @return The byte that was popped off.\n function popLastByte(bytes memory b)\n internal\n pure\n returns (bytes1 result)\n {\n require(\n b.length > 0,\n \"GREATER_THAN_ZERO_LENGTH_REQUIRED\"\n );\n\n // Store last byte.\n result = b[b.length - 1];\n\n assembly {\n // Decrement length of byte array.\n let newLen := sub(mload(b), 1)\n mstore(b, newLen)\n }\n return result;\n }\n\n /// @dev Pops the last 20 bytes off of a byte array by modifying its length.\n /// @param b Byte array that will be modified.\n /// @return The 20 byte address that was popped off.\n function popLast20Bytes(bytes memory b)\n internal\n pure\n returns (address result)\n {\n require(\n b.length >= 20,\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Store last 20 bytes.\n result = readAddress(b, b.length - 20);\n\n assembly {\n // Subtract 20 from byte array length.\n let newLen := sub(mload(b), 20)\n mstore(b, newLen)\n }\n return result;\n }\n\n /// @dev Tests equality of two byte arrays.\n /// @param lhs First byte array to compare.\n /// @param rhs Second byte array to compare.\n /// @return True if arrays are the same. False otherwise.\n function equals(\n bytes memory lhs,\n bytes memory rhs\n )\n internal\n pure\n returns (bool equal)\n {\n // Keccak gas cost is 30 + numWords * 6. This is a cheap way to compare.\n // We early exit on unequal lengths, but keccak would also correctly\n // handle this.\n return lhs.length == rhs.length && keccak256(lhs) == keccak256(rhs);\n }\n\n /// @dev Reads an address from a position in a byte array.\n /// @param b Byte array containing an address.\n /// @param index Index in byte array of address.\n /// @return address from byte array.\n function readAddress(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (address result)\n {\n require(\n b.length >= index + 20, // 20 is length of address\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Add offset to index:\n // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)\n // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)\n index += 20;\n\n // Read address from array memory\n assembly {\n // 1. Add index to address of bytes array\n // 2. Load 32-byte word from memory\n // 3. Apply 20-byte mask to obtain address\n result := and(mload(add(b, index)), 0xffffffffffffffffffffffffffffffffffffffff)\n }\n return result;\n }\n\n /// @dev Writes an address into a specific position in a byte array.\n /// @param b Byte array to insert address into.\n /// @param index Index in byte array of address.\n /// @param input Address to put into byte array.\n function writeAddress(\n bytes memory b,\n uint256 index,\n address input\n )\n internal\n pure\n {\n require(\n b.length >= index + 20, // 20 is length of address\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Add offset to index:\n // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)\n // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)\n index += 20;\n\n // Store address into array memory\n assembly {\n // The address occupies 20 bytes and mstore stores 32 bytes.\n // First fetch the 32-byte word where we'll be storing the address, then\n // apply a mask so we have only the bytes in the word that the address will not occupy.\n // Then combine these bytes with the address and store the 32 bytes back to memory with mstore.\n\n // 1. Add index to address of bytes array\n // 2. Load 32-byte word from memory\n // 3. Apply 12-byte mask to obtain extra bytes occupying word of memory where we'll store the address\n let neighbors := and(\n mload(add(b, index)),\n 0xffffffffffffffffffffffff0000000000000000000000000000000000000000\n )\n \n // Make sure input address is clean.\n // (Solidity does not guarantee this)\n input := and(input, 0xffffffffffffffffffffffffffffffffffffffff)\n\n // Store the neighbors and address into memory\n mstore(add(b, index), xor(input, neighbors))\n }\n }\n\n /// @dev Reads a bytes32 value from a position in a byte array.\n /// @param b Byte array containing a bytes32 value.\n /// @param index Index in byte array of bytes32 value.\n /// @return bytes32 value from byte array.\n function readBytes32(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes32 result)\n {\n require(\n b.length >= index + 32,\n \"GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 256 bit length parameter\n index += 32;\n\n // Read the bytes32 from array memory\n assembly {\n result := mload(add(b, index))\n }\n return result;\n }\n\n /// @dev Writes a bytes32 into a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input bytes32 to put into byte array.\n function writeBytes32(\n bytes memory b,\n uint256 index,\n bytes32 input\n )\n internal\n pure\n {\n require(\n b.length >= index + 32,\n \"GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 256 bit length parameter\n index += 32;\n\n // Read the bytes32 from array memory\n assembly {\n mstore(add(b, index), input)\n }\n }\n\n /// @dev Reads a uint256 value from a position in a byte array.\n /// @param b Byte array containing a uint256 value.\n /// @param index Index in byte array of uint256 value.\n /// @return uint256 value from byte array.\n function readUint256(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (uint256 result)\n {\n result = uint256(readBytes32(b, index));\n return result;\n }\n\n /// @dev Writes a uint256 into a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input uint256 to put into byte array.\n function writeUint256(\n bytes memory b,\n uint256 index,\n uint256 input\n )\n internal\n pure\n {\n writeBytes32(b, index, bytes32(input));\n }\n\n /// @dev Reads an unpadded bytes4 value from a position in a byte array.\n /// @param b Byte array containing a bytes4 value.\n /// @param index Index in byte array of bytes4 value.\n /// @return bytes4 value from byte array.\n function readBytes4(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes4 result)\n {\n require(\n b.length >= index + 4,\n \"GREATER_OR_EQUAL_TO_4_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 32 byte length field\n index += 32;\n\n // Read the bytes4 from array memory\n assembly {\n result := mload(add(b, index))\n // Solidity does not require us to clean the trailing bytes.\n // We do it anyway\n result := and(result, 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000)\n }\n return result;\n }\n\n /// @dev Reads nested bytes from a specific position.\n /// @dev NOTE: the returned value overlaps with the input value.\n /// Both should be treated as immutable.\n /// @param b Byte array containing nested bytes.\n /// @param index Index of nested bytes.\n /// @return result Nested bytes.\n function readBytesWithLength(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes memory result)\n {\n // Read length of nested bytes\n uint256 nestedBytesLength = readUint256(b, index);\n index += 32;\n\n // Assert length of <b> is valid, given\n // length of nested bytes\n require(\n b.length >= index + nestedBytesLength,\n \"GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED\"\n );\n \n // Return a pointer to the byte array as it exists inside `b`\n assembly {\n result := add(b, index)\n }\n return result;\n }\n\n /// @dev Inserts bytes at a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input bytes to insert.\n function writeBytesWithLength(\n bytes memory b,\n uint256 index,\n bytes memory input\n )\n internal\n pure\n {\n // Assert length of <b> is valid, given\n // length of input\n require(\n b.length >= index + 32 + input.length, // 32 bytes to store length\n \"GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED\"\n );\n\n // Copy <input> into <b>\n memCopy(\n b.contentAddress() + index,\n input.rawAddress(), // includes length of <input>\n input.length + 32 // +32 bytes to store <input> length\n );\n }\n\n /// @dev Performs a deep copy of a byte array onto another byte array of greater than or equal length.\n /// @param dest Byte array that will be overwritten with source bytes.\n /// @param source Byte array to copy onto dest bytes.\n function deepCopyBytes(\n bytes memory dest,\n bytes memory source\n )\n internal\n pure\n {\n uint256 sourceLen = source.length;\n // Dest length must be >= source length, or some bytes would not be copied.\n require(\n dest.length >= sourceLen,\n \"GREATER_OR_EQUAL_TO_SOURCE_BYTES_LENGTH_REQUIRED\"\n );\n memCopy(\n dest.contentAddress(),\n source.contentAddress(),\n sourceLen\n );\n }\n}\n",
- "2.0.0/utils/Ownable/IOwnable.sol": "pragma solidity 0.4.24;\n\n\ncontract IOwnable {\n\n function transferOwnership(address newOwner)\n public;\n}\n",
- "2.0.0/utils/Ownable/Ownable.sol": "pragma solidity 0.4.24;\n\nimport \"./IOwnable.sol\";\n\n\ncontract Ownable is\n IOwnable\n{\n address public owner;\n\n constructor ()\n public\n {\n owner = msg.sender;\n }\n\n modifier onlyOwner() {\n require(\n msg.sender == owner,\n \"ONLY_CONTRACT_OWNER\"\n );\n _;\n }\n\n function transferOwnership(address newOwner)\n public\n onlyOwner\n {\n if (newOwner != address(0)) {\n owner = newOwner;\n }\n }\n}\n",
- "2.0.0/utils/ReentrancyGuard/ReentrancyGuard.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract ReentrancyGuard {\n\n // Locked state of mutex\n bool private locked = false;\n\n /// @dev Functions with this modifer cannot be reentered. The mutex will be locked\n /// before function execution and unlocked after.\n modifier nonReentrant() {\n // Ensure mutex is unlocked\n require(\n !locked,\n \"REENTRANCY_ILLEGAL\"\n );\n\n // Lock mutex before function call\n locked = true;\n\n // Perform function call\n _;\n\n // Unlock mutex after function call\n locked = false;\n }\n}\n",
- "2.0.0/utils/SafeMath/SafeMath.sol": "pragma solidity 0.4.24;\n\n\ncontract SafeMath {\n\n function safeMul(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n if (a == 0) {\n return 0;\n }\n uint256 c = a * b;\n require(\n c / a == b,\n \"UINT256_OVERFLOW\"\n );\n return c;\n }\n\n function safeDiv(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n uint256 c = a / b;\n return c;\n }\n\n function safeSub(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n require(\n b <= a,\n \"UINT256_UNDERFLOW\"\n );\n return a - b;\n }\n\n function safeAdd(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n uint256 c = a + b;\n require(\n c >= a,\n \"UINT256_OVERFLOW\"\n );\n return c;\n }\n\n function max64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n\n function max256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n}\n"
- },
- "sourceTreeHashHex": "0x61b379850639517b46c6d60f6c12c18bf568c6d475f90938b2653446bd018009",
- "compiler": {
- "name": "solc",
- "version": "soljson-v0.4.24+commit.e67f0147.js",
- "settings": {
- "optimizer": {
- "enabled": true,
- "runs": 1000000
- },
- "outputSelection": {
- "*": {
- "*": [
- "abi",
- "evm.bytecode.object",
- "evm.bytecode.sourceMap",
- "evm.deployedBytecode.object",
- "evm.deployedBytecode.sourceMap"
- ]
- }
- }
- }
- },
- "networks": {
- "1": {
- "address": "0x2240dab907db71e64d3e0dba4800c83b5c502d4e",
- "links": {},
- "constructorArgs": "[]"
- },
- "3": {
- "address": "0xb1408f4c245a23c31b98d2c626777d4c0d766caa",
- "links": {},
- "constructorArgs": "[]"
- },
- "42": {
- "address": "0xf1ec01d6236d3cd881a0bf0130ea25fe4234003e",
- "links": {},
- "constructorArgs": "[]"
- },
- "50": {
- "address": "0x1dc4c1cefef38a777b15aa20260a54e584b16c48",
- "links": {},
- "constructorArgs": "[]"
- }
- }
-}
diff --git a/packages/migrations/artifacts/2.0.0/ERC20Token.json b/packages/migrations/artifacts/2.0.0/ERC20Token.json
deleted file mode 100644
index 11ec4b57a..000000000
--- a/packages/migrations/artifacts/2.0.0/ERC20Token.json
+++ /dev/null
@@ -1,486 +0,0 @@
-{
- "schemaVersion": "2.0.0",
- "contractName": "ERC20Token",
- "compilerOutput": {
- "abi": [
- {
- "constant": false,
- "inputs": [
- {
- "name": "_spender",
- "type": "address"
- },
- {
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "approve",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "totalSupply",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_from",
- "type": "address"
- },
- {
- "name": "_to",
- "type": "address"
- },
- {
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "transferFrom",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "_owner",
- "type": "address"
- }
- ],
- "name": "balanceOf",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_to",
- "type": "address"
- },
- {
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "transfer",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "_owner",
- "type": "address"
- },
- {
- "name": "_spender",
- "type": "address"
- }
- ],
- "name": "allowance",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "_from",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "_to",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "Transfer",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "_owner",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "_spender",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "Approval",
- "type": "event"
- }
- ],
- "evm": {
- "bytecode": {
- "linkReferences": {},
- "object": "0x608060405234801561001057600080fd5b506106a0806100206000396000f3006080604052600436106100775763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663095ea7b3811461007c57806318160ddd146100c157806323b872dd146100e857806370a082311461011f578063a9059cbb1461014d578063dd62ed3e1461017e575b600080fd5b34801561008857600080fd5b506100ad73ffffffffffffffffffffffffffffffffffffffff600435166024356101b2565b604080519115158252519081900360200190f35b3480156100cd57600080fd5b506100d6610225565b60408051918252519081900360200190f35b3480156100f457600080fd5b506100ad73ffffffffffffffffffffffffffffffffffffffff6004358116906024351660443561022b565b34801561012b57600080fd5b506100d673ffffffffffffffffffffffffffffffffffffffff60043516610487565b34801561015957600080fd5b506100ad73ffffffffffffffffffffffffffffffffffffffff600435166024356104af565b34801561018a57600080fd5b506100d673ffffffffffffffffffffffffffffffffffffffff6004358116906024351661063c565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60025490565b73ffffffffffffffffffffffffffffffffffffffff83166000908152602081905260408120548211156102bf57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f45524332305f494e53554646494349454e545f42414c414e4345000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8416600090815260016020908152604080832033845290915290205482111561035e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f45524332305f494e53554646494349454e545f414c4c4f57414e434500000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205482810110156103f457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f55494e543235365f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff80841660008181526020818152604080832080548801905593881680835284832080548890039055600182528483203384528252918490208054879003905583518681529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35060019392505050565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b3360009081526020819052604081205482111561052d57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f45524332305f494e53554646494349454e545f42414c414e4345000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205482810110156105c357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f55494e543235365f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b336000818152602081815260408083208054879003905573ffffffffffffffffffffffffffffffffffffffff871680845292819020805487019055805186815290519293927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a350600192915050565b73ffffffffffffffffffffffffffffffffffffffff9182166000908152600160209081526040808320939094168252919091522054905600a165627a7a72305820203a592c9390a8a005821d7dffa1c27ae97bf827d8ef17cfee3a8a70776b22d90029",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x6A0 DUP1 PUSH2 0x20 PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN STOP PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x77 JUMPI PUSH4 0xFFFFFFFF PUSH29 0x100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD DIV AND PUSH4 0x95EA7B3 DUP2 EQ PUSH2 0x7C JUMPI DUP1 PUSH4 0x18160DDD EQ PUSH2 0xC1 JUMPI DUP1 PUSH4 0x23B872DD EQ PUSH2 0xE8 JUMPI DUP1 PUSH4 0x70A08231 EQ PUSH2 0x11F JUMPI DUP1 PUSH4 0xA9059CBB EQ PUSH2 0x14D JUMPI DUP1 PUSH4 0xDD62ED3E EQ PUSH2 0x17E JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x88 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x1B2 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 ISZERO ISZERO DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xCD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xD6 PUSH2 0x225 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xF4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH1 0x44 CALLDATALOAD PUSH2 0x22B JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x12B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xD6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x487 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x159 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x4AF JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x18A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xD6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH2 0x63C JUMP JUMPDEST CALLER PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 AND DUP1 DUP6 MSTORE SWAP1 DUP4 MSTORE DUP2 DUP5 KECCAK256 DUP7 SWAP1 SSTORE DUP2 MLOAD DUP7 DUP2 MSTORE SWAP2 MLOAD SWAP4 SWAP5 SWAP1 SWAP4 SWAP1 SWAP3 PUSH32 0x8C5BE1E5EBEC7D5BD14F71427D1E84F3DD0314C0F7B2291E5B200AC8C7C3B925 SWAP3 DUP3 SWAP1 SUB ADD SWAP1 LOG3 POP PUSH1 0x1 SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x2 SLOAD SWAP1 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 DUP2 KECCAK256 SLOAD DUP3 GT ISZERO PUSH2 0x2BF JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x1A PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x45524332305F494E53554646494349454E545F42414C414E4345000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 CALLER DUP5 MSTORE SWAP1 SWAP2 MSTORE SWAP1 KECCAK256 SLOAD DUP3 GT ISZERO PUSH2 0x35E JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x1C PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x45524332305F494E53554646494349454E545F414C4C4F57414E434500000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP3 DUP2 ADD LT ISZERO PUSH2 0x3F4 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x10 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x55494E543235365F4F564552464C4F5700000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP5 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x20 DUP2 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 DUP1 SLOAD DUP9 ADD SWAP1 SSTORE SWAP4 DUP9 AND DUP1 DUP4 MSTORE DUP5 DUP4 KECCAK256 DUP1 SLOAD DUP9 SWAP1 SUB SWAP1 SSTORE PUSH1 0x1 DUP3 MSTORE DUP5 DUP4 KECCAK256 CALLER DUP5 MSTORE DUP3 MSTORE SWAP2 DUP5 SWAP1 KECCAK256 DUP1 SLOAD DUP8 SWAP1 SUB SWAP1 SSTORE DUP4 MLOAD DUP7 DUP2 MSTORE SWAP4 MLOAD SWAP3 SWAP4 SWAP2 SWAP3 PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF SWAP3 DUP2 SWAP1 SUB SWAP1 SWAP2 ADD SWAP1 LOG3 POP PUSH1 0x1 SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD SWAP1 JUMP JUMPDEST CALLER PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 DUP2 KECCAK256 SLOAD DUP3 GT ISZERO PUSH2 0x52D JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x1A PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x45524332305F494E53554646494349454E545F42414C414E4345000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP3 DUP2 ADD LT ISZERO PUSH2 0x5C3 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x10 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x55494E543235365F4F564552464C4F5700000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST CALLER PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x20 DUP2 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 DUP1 SLOAD DUP8 SWAP1 SUB SWAP1 SSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 AND DUP1 DUP5 MSTORE SWAP3 DUP2 SWAP1 KECCAK256 DUP1 SLOAD DUP8 ADD SWAP1 SSTORE DUP1 MLOAD DUP7 DUP2 MSTORE SWAP1 MLOAD SWAP3 SWAP4 SWAP3 PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF SWAP3 SWAP2 DUP2 SWAP1 SUB SWAP1 SWAP2 ADD SWAP1 LOG3 POP PUSH1 0x1 SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP2 DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 SWAP4 SWAP1 SWAP5 AND DUP3 MSTORE SWAP2 SWAP1 SWAP2 MSTORE KECCAK256 SLOAD SWAP1 JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 KECCAK256 GASPRICE MSIZE 0x2c SWAP4 SWAP1 0xa8 LOG0 SDIV DUP3 SAR PUSH30 0xFFA1C27AE97BF827D8EF17CFEE3A8A70776B22D900290000000000000000 ",
- "sourceMap": "635:3396:52:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;635:3396:52;;;;;;;"
- },
- "deployedBytecode": {
- "linkReferences": {},
- "object": "0x6080604052600436106100775763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663095ea7b3811461007c57806318160ddd146100c157806323b872dd146100e857806370a082311461011f578063a9059cbb1461014d578063dd62ed3e1461017e575b600080fd5b34801561008857600080fd5b506100ad73ffffffffffffffffffffffffffffffffffffffff600435166024356101b2565b604080519115158252519081900360200190f35b3480156100cd57600080fd5b506100d6610225565b60408051918252519081900360200190f35b3480156100f457600080fd5b506100ad73ffffffffffffffffffffffffffffffffffffffff6004358116906024351660443561022b565b34801561012b57600080fd5b506100d673ffffffffffffffffffffffffffffffffffffffff60043516610487565b34801561015957600080fd5b506100ad73ffffffffffffffffffffffffffffffffffffffff600435166024356104af565b34801561018a57600080fd5b506100d673ffffffffffffffffffffffffffffffffffffffff6004358116906024351661063c565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60025490565b73ffffffffffffffffffffffffffffffffffffffff83166000908152602081905260408120548211156102bf57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f45524332305f494e53554646494349454e545f42414c414e4345000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8416600090815260016020908152604080832033845290915290205482111561035e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f45524332305f494e53554646494349454e545f414c4c4f57414e434500000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205482810110156103f457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f55494e543235365f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff80841660008181526020818152604080832080548801905593881680835284832080548890039055600182528483203384528252918490208054879003905583518681529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35060019392505050565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b3360009081526020819052604081205482111561052d57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f45524332305f494e53554646494349454e545f42414c414e4345000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205482810110156105c357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f55494e543235365f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b336000818152602081815260408083208054879003905573ffffffffffffffffffffffffffffffffffffffff871680845292819020805487019055805186815290519293927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a350600192915050565b73ffffffffffffffffffffffffffffffffffffffff9182166000908152600160209081526040808320939094168252919091522054905600a165627a7a72305820203a592c9390a8a005821d7dffa1c27ae97bf827d8ef17cfee3a8a70776b22d90029",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x77 JUMPI PUSH4 0xFFFFFFFF PUSH29 0x100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD DIV AND PUSH4 0x95EA7B3 DUP2 EQ PUSH2 0x7C JUMPI DUP1 PUSH4 0x18160DDD EQ PUSH2 0xC1 JUMPI DUP1 PUSH4 0x23B872DD EQ PUSH2 0xE8 JUMPI DUP1 PUSH4 0x70A08231 EQ PUSH2 0x11F JUMPI DUP1 PUSH4 0xA9059CBB EQ PUSH2 0x14D JUMPI DUP1 PUSH4 0xDD62ED3E EQ PUSH2 0x17E JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x88 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x1B2 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 ISZERO ISZERO DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xCD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xD6 PUSH2 0x225 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xF4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH1 0x44 CALLDATALOAD PUSH2 0x22B JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x12B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xD6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x487 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x159 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x4AF JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x18A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xD6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH2 0x63C JUMP JUMPDEST CALLER PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 AND DUP1 DUP6 MSTORE SWAP1 DUP4 MSTORE DUP2 DUP5 KECCAK256 DUP7 SWAP1 SSTORE DUP2 MLOAD DUP7 DUP2 MSTORE SWAP2 MLOAD SWAP4 SWAP5 SWAP1 SWAP4 SWAP1 SWAP3 PUSH32 0x8C5BE1E5EBEC7D5BD14F71427D1E84F3DD0314C0F7B2291E5B200AC8C7C3B925 SWAP3 DUP3 SWAP1 SUB ADD SWAP1 LOG3 POP PUSH1 0x1 SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x2 SLOAD SWAP1 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 DUP2 KECCAK256 SLOAD DUP3 GT ISZERO PUSH2 0x2BF JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x1A PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x45524332305F494E53554646494349454E545F42414C414E4345000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 CALLER DUP5 MSTORE SWAP1 SWAP2 MSTORE SWAP1 KECCAK256 SLOAD DUP3 GT ISZERO PUSH2 0x35E JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x1C PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x45524332305F494E53554646494349454E545F414C4C4F57414E434500000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP3 DUP2 ADD LT ISZERO PUSH2 0x3F4 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x10 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x55494E543235365F4F564552464C4F5700000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP5 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x20 DUP2 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 DUP1 SLOAD DUP9 ADD SWAP1 SSTORE SWAP4 DUP9 AND DUP1 DUP4 MSTORE DUP5 DUP4 KECCAK256 DUP1 SLOAD DUP9 SWAP1 SUB SWAP1 SSTORE PUSH1 0x1 DUP3 MSTORE DUP5 DUP4 KECCAK256 CALLER DUP5 MSTORE DUP3 MSTORE SWAP2 DUP5 SWAP1 KECCAK256 DUP1 SLOAD DUP8 SWAP1 SUB SWAP1 SSTORE DUP4 MLOAD DUP7 DUP2 MSTORE SWAP4 MLOAD SWAP3 SWAP4 SWAP2 SWAP3 PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF SWAP3 DUP2 SWAP1 SUB SWAP1 SWAP2 ADD SWAP1 LOG3 POP PUSH1 0x1 SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD SWAP1 JUMP JUMPDEST CALLER PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 DUP2 KECCAK256 SLOAD DUP3 GT ISZERO PUSH2 0x52D JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x1A PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x45524332305F494E53554646494349454E545F42414C414E4345000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP3 DUP2 ADD LT ISZERO PUSH2 0x5C3 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x10 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x55494E543235365F4F564552464C4F5700000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST CALLER PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x20 DUP2 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 DUP1 SLOAD DUP8 SWAP1 SUB SWAP1 SSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 AND DUP1 DUP5 MSTORE SWAP3 DUP2 SWAP1 KECCAK256 DUP1 SLOAD DUP8 ADD SWAP1 SSTORE DUP1 MLOAD DUP7 DUP2 MSTORE SWAP1 MLOAD SWAP3 SWAP4 SWAP3 PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF SWAP3 SWAP2 DUP2 SWAP1 SUB SWAP1 SWAP2 ADD SWAP1 LOG3 POP PUSH1 0x1 SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP2 DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 SWAP4 SWAP1 SWAP5 AND DUP3 MSTORE SWAP2 SWAP1 SWAP2 MSTORE KECCAK256 SLOAD SWAP1 JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 KECCAK256 GASPRICE MSIZE 0x2c SWAP4 SWAP1 0xa8 LOG0 SDIV DUP3 SAR PUSH30 0xFFA1C27AE97BF827D8EF17CFEE3A8A70776B22D900290000000000000000 ",
- "sourceMap": "635:3396:52:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2896:270;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2896:270:52;;;;;;;;;;;;;;;;;;;;;;;;;;;3251:119;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3251:119:52;;;;;;;;;;;;;;;;;;;;1872:723;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1872:723:52;;;;;;;;;;;;;;3524:135;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;3524:135:52;;;;;;;1055:514;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1055:514:52;;;;;;;;;3867:162;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;3867:162:52;;;;;;;;;;;;2896:270;3009:10;2981:4;3001:19;;;:7;:19;;;;;;;;;:29;;;;;;;;;;;:38;;;3054:84;;;;;;;2981:4;;3001:29;;3009:10;;3054:84;;;;;;;;-1:-1:-1;3155:4:52;2896:270;;;;:::o;3251:119::-;3351:12;;3251:119;:::o;1872:723::-;2043:15;;;2002:4;2043:15;;;;;;;;;;;:25;-1:-1:-1;2043:25:52;2022:98;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2151:14;;;;;;;:7;:14;;;;;;;;2166:10;2151:26;;;;;;;;:36;-1:-1:-1;2151:36:52;2130:111;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2298:13;;;:8;:13;;;;;;;;;;;2272:22;;;:39;;2251:102;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2364:13;;;;:8;:13;;;;;;;;;;;:23;;;;;;2397:15;;;;;;;;;:25;;;;;;;-1:-1:-1;2432:14:52;;;;;2447:10;2432:26;;;;;;;;:36;;;;;;;2488:74;;;;;;;2364:13;;2397:15;;2488:74;;;;;;;;;;-1:-1:-1;2584:4:52;1872:723;;;;;:::o;3524:135::-;3636:16;;3606:7;3636:16;;;;;;;;;;;;3524:135::o;1055:514::-;1186:10;1136:4;1177:20;;;;;;;;;;;:30;-1:-1:-1;1177:30:52;1156:103;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1316:13;;;:8;:13;;;;;;;;;;;1290:22;;;:39;;1269:102;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1391:10;1382:8;:20;;;;;;;;;;;:30;;;;;;;:20;1422:13;;;;;;;;;:23;;;;;;1461:79;;;;;;;1422:13;;1391:10;1461:79;;;;;;;;;;;-1:-1:-1;1558:4:52;1055:514;;;;:::o;3867:162::-;3997:15;;;;3967:7;3997:15;;;:7;:15;;;;;;;;:25;;;;;;;;;;;;;3867:162::o"
- }
- }
- },
- "sources": {
- "2.0.0/extensions/Forwarder/Forwarder.sol": {
- "id": 0
- },
- "2.0.0/extensions/Forwarder/MixinAssets.sol": {
- "id": 1
- },
- "2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol": {
- "id": 2
- },
- "2.0.0/extensions/Forwarder/MixinForwarderCore.sol": {
- "id": 3
- },
- "2.0.0/extensions/Forwarder/MixinWeth.sol": {
- "id": 4
- },
- "2.0.0/extensions/Forwarder/interfaces/IAssets.sol": {
- "id": 5
- },
- "2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol": {
- "id": 6
- },
- "2.0.0/extensions/Forwarder/libs/LibConstants.sol": {
- "id": 7
- },
- "2.0.0/extensions/Forwarder/mixins/MAssets.sol": {
- "id": 8
- },
- "2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol": {
- "id": 9
- },
- "2.0.0/extensions/Forwarder/mixins/MWeth.sol": {
- "id": 10
- },
- "2.0.0/extensions/OrderValidator/OrderValidator.sol": {
- "id": 11
- },
- "2.0.0/multisig/MultiSigWallet.sol": {
- "id": 12
- },
- "2.0.0/multisig/MultiSigWalletWithTimeLock.sol": {
- "id": 13
- },
- "2.0.0/protocol/AssetProxy/ERC20Proxy.sol": {
- "id": 14
- },
- "2.0.0/protocol/AssetProxy/ERC721Proxy.sol": {
- "id": 15
- },
- "2.0.0/protocol/AssetProxy/MixinAuthorizable.sol": {
- "id": 16
- },
- "2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol": {
- "id": 17
- },
- "2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol": {
- "id": 18
- },
- "2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol": {
- "id": 19
- },
- "2.0.0/protocol/AssetProxyOwner/AssetProxyOwner.sol": {
- "id": 20
- },
- "2.0.0/protocol/Exchange/Exchange.sol": {
- "id": 21
- },
- "2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol": {
- "id": 22
- },
- "2.0.0/protocol/Exchange/MixinExchangeCore.sol": {
- "id": 23
- },
- "2.0.0/protocol/Exchange/MixinMatchOrders.sol": {
- "id": 24
- },
- "2.0.0/protocol/Exchange/MixinSignatureValidator.sol": {
- "id": 25
- },
- "2.0.0/protocol/Exchange/MixinTransactions.sol": {
- "id": 26
- },
- "2.0.0/protocol/Exchange/MixinWrapperFunctions.sol": {
- "id": 27
- },
- "2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol": {
- "id": 28
- },
- "2.0.0/protocol/Exchange/interfaces/IExchange.sol": {
- "id": 29
- },
- "2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol": {
- "id": 30
- },
- "2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol": {
- "id": 31
- },
- "2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol": {
- "id": 32
- },
- "2.0.0/protocol/Exchange/interfaces/ITransactions.sol": {
- "id": 33
- },
- "2.0.0/protocol/Exchange/interfaces/IValidator.sol": {
- "id": 34
- },
- "2.0.0/protocol/Exchange/interfaces/IWallet.sol": {
- "id": 35
- },
- "2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol": {
- "id": 36
- },
- "2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol": {
- "id": 37
- },
- "2.0.0/protocol/Exchange/libs/LibConstants.sol": {
- "id": 38
- },
- "2.0.0/protocol/Exchange/libs/LibEIP712.sol": {
- "id": 39
- },
- "2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol": {
- "id": 40
- },
- "2.0.0/protocol/Exchange/libs/LibFillResults.sol": {
- "id": 41
- },
- "2.0.0/protocol/Exchange/libs/LibMath.sol": {
- "id": 42
- },
- "2.0.0/protocol/Exchange/libs/LibOrder.sol": {
- "id": 43
- },
- "2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol": {
- "id": 44
- },
- "2.0.0/protocol/Exchange/mixins/MExchangeCore.sol": {
- "id": 45
- },
- "2.0.0/protocol/Exchange/mixins/MMatchOrders.sol": {
- "id": 46
- },
- "2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol": {
- "id": 47
- },
- "2.0.0/protocol/Exchange/mixins/MTransactions.sol": {
- "id": 48
- },
- "2.0.0/protocol/Exchange/mixins/MWrapperFunctions.sol": {
- "id": 49
- },
- "2.0.0/test/DummyERC20Token/DummyERC20Token.sol": {
- "id": 50
- },
- "2.0.0/test/DummyERC721Token/DummyERC721Token.sol": {
- "id": 51
- },
- "2.0.0/tokens/ERC20Token/ERC20Token.sol": {
- "id": 52
- },
- "2.0.0/tokens/ERC20Token/IERC20Token.sol": {
- "id": 53
- },
- "2.0.0/tokens/ERC20Token/MintableERC20Token.sol": {
- "id": 54
- },
- "2.0.0/tokens/ERC20Token/UnlimitedAllowanceERC20Token.sol": {
- "id": 55
- },
- "2.0.0/tokens/ERC721Token/ERC721Token.sol": {
- "id": 56
- },
- "2.0.0/tokens/ERC721Token/IERC721Receiver.sol": {
- "id": 57
- },
- "2.0.0/tokens/ERC721Token/IERC721Token.sol": {
- "id": 58
- },
- "2.0.0/tokens/ERC721Token/MintableERC721Token.sol": {
- "id": 59
- },
- "2.0.0/tokens/EtherToken/IEtherToken.sol": {
- "id": 60
- },
- "2.0.0/utils/LibBytes/LibBytes.sol": {
- "id": 61
- },
- "2.0.0/utils/Ownable/IOwnable.sol": {
- "id": 62
- },
- "2.0.0/utils/Ownable/Ownable.sol": {
- "id": 63
- },
- "2.0.0/utils/ReentrancyGuard/ReentrancyGuard.sol": {
- "id": 64
- },
- "2.0.0/utils/SafeMath/SafeMath.sol": {
- "id": 65
- }
- },
- "sourceCodes": {
- "2.0.0/extensions/Forwarder/Forwarder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./MixinWeth.sol\";\nimport \"./MixinForwarderCore.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./MixinAssets.sol\";\nimport \"./MixinExchangeWrapper.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract Forwarder is\n LibConstants,\n MixinWeth,\n MixinAssets,\n MixinExchangeWrapper,\n MixinForwarderCore\n{\n constructor (\n address _exchange,\n bytes memory _zrxAssetData,\n bytes memory _wethAssetData\n )\n public\n LibConstants(\n _exchange,\n _zrxAssetData,\n _wethAssetData\n )\n MixinForwarderCore()\n {}\n}\n",
- "2.0.0/extensions/Forwarder/MixinAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"../../tokens/ERC20Token/IERC20Token.sol\";\nimport \"../../tokens/ERC721Token/IERC721Token.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MAssets.sol\";\n\n\ncontract MixinAssets is\n Ownable,\n LibConstants,\n MAssets\n{\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_TRANSFER_SELECTOR = bytes4(keccak256(\"transfer(address,uint256)\"));\n\n /// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to \n /// function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be\n /// used to withdraw assets that were accidentally sent to this contract.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of ERC20 token to withdraw.\n function withdrawAsset(\n bytes assetData,\n uint256 amount\n )\n external\n onlyOwner\n {\n transferAssetToSender(assetData, amount);\n }\n\n /// @dev Transfers given amount of asset to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferAssetToSender(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n bytes4 proxyId = assetData.readBytes4(0);\n\n if (proxyId == ERC20_DATA_ID) {\n transferERC20Token(assetData, amount);\n } else if (proxyId == ERC721_DATA_ID) {\n transferERC721Token(assetData, amount);\n } else {\n revert(\"UNSUPPORTED_ASSET_PROXY\");\n }\n }\n\n /// @dev Decodes ERC20 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC20Token(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n address token = assetData.readAddress(16);\n\n // Transfer tokens.\n // We do a raw call so we can check the success separate\n // from the return data.\n bool success = token.call(abi.encodeWithSelector(\n ERC20_TRANSFER_SELECTOR,\n msg.sender,\n amount\n ));\n require(\n success,\n \"TRANSFER_FAILED\"\n );\n \n // Check return data.\n // If there is no return data, we assume the token incorrectly\n // does not return a bool. In this case we expect it to revert\n // on failure, which was handled above.\n // If the token does return data, we require that it is a single\n // value that evaluates to true.\n assembly {\n if returndatasize {\n success := 0\n if eq(returndatasize, 32) {\n // First 64 bytes of memory are reserved scratch space\n returndatacopy(0, 0, 32)\n success := mload(0)\n }\n }\n }\n require(\n success,\n \"TRANSFER_FAILED\"\n );\n }\n\n /// @dev Decodes ERC721 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC721Token(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n require(\n amount == 1,\n \"INVALID_AMOUNT\"\n );\n // Decode asset data.\n address token = assetData.readAddress(16);\n uint256 tokenId = assetData.readUint256(36);\n\n // Perform transfer.\n IERC721Token(token).transferFrom(\n address(this),\n msg.sender,\n tokenId\n );\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MExchangeWrapper.sol\";\nimport \"../../protocol/Exchange/libs/LibAbiEncoder.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../protocol/Exchange/libs/LibFillResults.sol\";\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\n\n\ncontract MixinExchangeWrapper is\n LibAbiEncoder,\n LibFillResults,\n LibMath,\n LibConstants,\n MExchangeWrapper\n{\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n // ABI encode calldata for `fillOrder`\n bytes memory fillOrderCalldata = abiEncodeFillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n\n address exchange = address(EXCHANGE);\n\n // Call `fillOrder` and handle any exceptions gracefully\n assembly {\n let success := call(\n gas, // forward all gas\n exchange, // call address of Exchange contract\n 0, // transfer 0 wei\n add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes)\n mload(fillOrderCalldata), // length of input\n fillOrderCalldata, // write output over input\n 128 // output size is 128 bytes\n )\n if success {\n mstore(fillResults, mload(fillOrderCalldata))\n mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32)))\n mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64)))\n mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96)))\n }\n }\n // fillResults values will be 0 by default if call was unsuccessful\n return fillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of WETH has been sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param wethSellAmount Desired amount of WETH to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellWeth(\n LibOrder.Order[] memory orders,\n uint256 wethSellAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // We assume that asset being sold by taker is WETH for each order.\n orders[i].makerAssetData = makerAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of WETH to sell\n uint256 remainingTakerAssetFillAmount = safeSub(wethSellAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of WETH\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= wethSellAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// The asset being sold by taker must always be WETH.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyExactAmountWithWeth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // We assume that asset being sold by taker is WETH for each order.\n orders[i].makerAssetData = makerAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n uint256 makerAssetFilledAmount = totalFillResults.makerAssetFilledAmount;\n if (makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n\n require(\n makerAssetFilledAmount >= makerAssetFillAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return totalFillResults;\n }\n\n /// @dev Buys zrxBuyAmount of ZRX fee tokens, taking into account ZRX fees for each order. This will guarantee\n /// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues).\n /// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX\n /// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases.\n /// The asset being sold by taker must always be WETH. \n /// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset.\n /// @param zrxBuyAmount Desired amount of ZRX to buy.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return totalFillResults Amounts filled and fees paid by maker and taker.\n function marketBuyExactZrxWithWeth(\n LibOrder.Order[] memory orders,\n uint256 zrxBuyAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n // Do nothing if zrxBuyAmount == 0\n if (zrxBuyAmount == 0) {\n return totalFillResults;\n }\n\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n uint256 zrxPurchased = 0;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // All of these are ZRX/WETH, so we can drop the respective assetData from calldata.\n orders[i].makerAssetData = zrxAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of ZRX to buy.\n uint256 remainingZrxBuyAmount = safeSub(zrxBuyAmount, zrxPurchased);\n\n // Convert the remaining amount of ZRX to buy into remaining amount\n // of WETH to sell, assuming entire amount can be sold in the current order.\n uint256 remainingWethSellAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n safeSub(orders[i].makerAssetAmount, orders[i].takerFee), // our exchange rate after fees \n remainingZrxBuyAmount\n );\n\n // Attempt to sell the remaining amount of WETH.\n FillResults memory singleFillResult = fillOrderNoThrow(\n orders[i],\n safeAdd(remainingWethSellAmount, 1), // we add 1 wei to the fill amount to make up for rounding errors\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker.\n addFillResults(totalFillResults, singleFillResult);\n zrxPurchased = safeSub(totalFillResults.makerAssetFilledAmount, totalFillResults.takerFeePaid);\n\n // Stop execution if the entire amount of ZRX has been bought.\n if (zrxPurchased >= zrxBuyAmount) {\n break;\n }\n }\n\n require(\n zrxPurchased >= zrxBuyAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return totalFillResults;\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinForwarderCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MWeth.sol\";\nimport \"./mixins/MAssets.sol\";\nimport \"./mixins/MExchangeWrapper.sol\";\nimport \"./interfaces/IForwarderCore.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../protocol/Exchange/libs/LibFillResults.sol\";\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\n\n\ncontract MixinForwarderCore is\n LibFillResults,\n LibMath,\n LibConstants,\n MWeth,\n MAssets,\n MExchangeWrapper,\n IForwarderCore\n{\n using LibBytes for bytes;\n\n /// @dev Constructor approves ERC20 proxy to transfer ZRX and WETH on this contract's behalf.\n constructor ()\n public\n {\n address proxyAddress = EXCHANGE.getAssetProxy(ERC20_DATA_ID);\n require(\n proxyAddress != address(0),\n \"UNREGISTERED_ASSET_PROXY\"\n );\n ETHER_TOKEN.approve(proxyAddress, MAX_UINT);\n ZRX_TOKEN.approve(proxyAddress, MAX_UINT);\n }\n\n /// @dev Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketSellOrdersWithEth(\n LibOrder.Order[] memory orders,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n FillResults memory orderFillResults,\n FillResults memory feeOrderFillResults\n )\n {\n // Convert ETH to WETH.\n convertEthToWeth();\n\n uint256 wethSellAmount;\n uint256 zrxBuyAmount;\n uint256 makerAssetAmountPurchased;\n if (orders[0].makerAssetData.equals(ZRX_ASSET_DATA)) {\n // Calculate amount of WETH that won't be spent on ETH fees.\n wethSellAmount = getPartialAmountFloor(\n PERCENTAGE_DENOMINATOR,\n safeAdd(PERCENTAGE_DENOMINATOR, feePercentage),\n msg.value\n );\n // Market sell available WETH.\n // ZRX fees are paid with this contract's balance.\n orderFillResults = marketSellWeth(\n orders,\n wethSellAmount,\n signatures\n );\n // The fee amount must be deducted from the amount transfered back to sender.\n makerAssetAmountPurchased = safeSub(orderFillResults.makerAssetFilledAmount, orderFillResults.takerFeePaid);\n } else {\n // 5% of WETH is reserved for filling feeOrders and paying feeRecipient.\n wethSellAmount = getPartialAmountFloor(\n MAX_WETH_FILL_PERCENTAGE,\n PERCENTAGE_DENOMINATOR,\n msg.value\n );\n // Market sell 95% of WETH.\n // ZRX fees are payed with this contract's balance.\n orderFillResults = marketSellWeth(\n orders,\n wethSellAmount,\n signatures\n );\n // Buy back all ZRX spent on fees.\n zrxBuyAmount = orderFillResults.takerFeePaid;\n feeOrderFillResults = marketBuyExactZrxWithWeth(\n feeOrders,\n zrxBuyAmount,\n feeSignatures\n );\n makerAssetAmountPurchased = orderFillResults.makerAssetFilledAmount;\n }\n\n // Transfer feePercentage of total ETH spent on primary orders to feeRecipient.\n // Refund remaining ETH to msg.sender.\n transferEthFeeAndRefund(\n orderFillResults.takerAssetFilledAmount,\n feeOrderFillResults.takerAssetFilledAmount,\n feePercentage,\n feeRecipient\n );\n\n // Transfer purchased assets to msg.sender.\n transferAssetToSender(orders[0].makerAssetData, makerAssetAmountPurchased);\n }\n\n /// @dev Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param makerAssetFillAmount Desired amount of makerAsset to purchase.\n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketBuyOrdersWithEth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n FillResults memory orderFillResults,\n FillResults memory feeOrderFillResults\n )\n {\n // Convert ETH to WETH.\n convertEthToWeth();\n\n uint256 zrxBuyAmount;\n uint256 makerAssetAmountPurchased;\n if (orders[0].makerAssetData.equals(ZRX_ASSET_DATA)) {\n // If the makerAsset is ZRX, it is not necessary to pay fees out of this\n // contracts's ZRX balance because fees are factored into the price of the order.\n orderFillResults = marketBuyExactZrxWithWeth(\n orders,\n makerAssetFillAmount,\n signatures\n );\n // The fee amount must be deducted from the amount transfered back to sender.\n makerAssetAmountPurchased = safeSub(orderFillResults.makerAssetFilledAmount, orderFillResults.takerFeePaid);\n } else {\n // Attemp to purchase desired amount of makerAsset.\n // ZRX fees are payed with this contract's balance.\n orderFillResults = marketBuyExactAmountWithWeth(\n orders,\n makerAssetFillAmount,\n signatures\n );\n // Buy back all ZRX spent on fees.\n zrxBuyAmount = orderFillResults.takerFeePaid;\n feeOrderFillResults = marketBuyExactZrxWithWeth(\n feeOrders,\n zrxBuyAmount,\n feeSignatures\n );\n makerAssetAmountPurchased = orderFillResults.makerAssetFilledAmount;\n }\n\n // Transfer feePercentage of total ETH spent on primary orders to feeRecipient.\n // Refund remaining ETH to msg.sender.\n transferEthFeeAndRefund(\n orderFillResults.takerAssetFilledAmount,\n feeOrderFillResults.takerAssetFilledAmount,\n feePercentage,\n feeRecipient\n );\n\n // Transfer purchased assets to msg.sender.\n transferAssetToSender(orders[0].makerAssetData, makerAssetAmountPurchased);\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinWeth.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MWeth.sol\";\n\n\ncontract MixinWeth is\n LibMath,\n LibConstants,\n MWeth\n{\n /// @dev Default payabale function, this allows us to withdraw WETH\n function ()\n public\n payable\n {\n require(\n msg.sender == address(ETHER_TOKEN),\n \"DEFAULT_FUNCTION_WETH_CONTRACT_ONLY\"\n );\n }\n\n /// @dev Converts message call's ETH value into WETH.\n function convertEthToWeth()\n internal\n {\n require(\n msg.value > 0,\n \"INVALID_MSG_VALUE\"\n );\n ETHER_TOKEN.deposit.value(msg.value)();\n }\n\n /// @dev Transfers feePercentage of WETH spent on primary orders to feeRecipient.\n /// Refunds any excess ETH to msg.sender.\n /// @param wethSoldExcludingFeeOrders Amount of WETH sold when filling primary orders.\n /// @param wethSoldForZrx Amount of WETH sold when purchasing ZRX required for primary order fees.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n function transferEthFeeAndRefund(\n uint256 wethSoldExcludingFeeOrders,\n uint256 wethSoldForZrx,\n uint256 feePercentage,\n address feeRecipient\n )\n internal\n {\n // Ensure feePercentage is less than 5%.\n require(\n feePercentage <= MAX_FEE_PERCENTAGE,\n \"FEE_PERCENTAGE_TOO_LARGE\"\n );\n\n // Ensure that no extra WETH owned by this contract has been sold.\n uint256 wethSold = safeAdd(wethSoldExcludingFeeOrders, wethSoldForZrx);\n require(\n wethSold <= msg.value,\n \"OVERSOLD_WETH\"\n );\n\n // Calculate amount of WETH that hasn't been sold.\n uint256 wethRemaining = safeSub(msg.value, wethSold);\n\n // Calculate ETH fee to pay to feeRecipient.\n uint256 ethFee = getPartialAmountFloor(\n feePercentage,\n PERCENTAGE_DENOMINATOR,\n wethSoldExcludingFeeOrders\n );\n\n // Ensure fee is less than amount of WETH remaining.\n require(\n ethFee <= wethRemaining,\n \"INSUFFICIENT_ETH_REMAINING\"\n );\n \n // Do nothing if no WETH remaining\n if (wethRemaining > 0) {\n // Convert remaining WETH to ETH\n ETHER_TOKEN.withdraw(wethRemaining);\n\n // Pay ETH to feeRecipient\n if (ethFee > 0) {\n feeRecipient.transfer(ethFee);\n }\n\n // Refund remaining ETH to msg.sender.\n uint256 ethRefund = safeSub(wethRemaining, ethFee);\n if (ethRefund > 0) {\n msg.sender.transfer(ethRefund);\n }\n }\n }\n}\n",
- "2.0.0/extensions/Forwarder/interfaces/IAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IAssets {\n\n /// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to \n /// function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be\n /// used to withdraw assets that were accidentally sent to this contract.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of ERC20 token to withdraw.\n function withdrawAsset(\n bytes assetData,\n uint256 amount\n )\n external;\n}\n",
- "2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../../protocol/Exchange/libs/LibFillResults.sol\";\n\n\ncontract IForwarderCore {\n\n /// @dev Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketSellOrdersWithEth(\n LibOrder.Order[] memory orders,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n LibFillResults.FillResults memory orderFillResults,\n LibFillResults.FillResults memory feeOrderFillResults\n );\n\n /// @dev Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param makerAssetFillAmount Desired amount of makerAsset to purchase.\n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketBuyOrdersWithEth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n LibFillResults.FillResults memory orderFillResults,\n LibFillResults.FillResults memory feeOrderFillResults\n );\n}\n",
- "2.0.0/extensions/Forwarder/libs/LibConstants.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/LibBytes/LibBytes.sol\";\nimport \"../../../protocol/Exchange/interfaces/IExchange.sol\";\nimport \"../../../tokens/EtherToken/IEtherToken.sol\";\nimport \"../../../tokens/ERC20Token/IERC20Token.sol\";\n\n\ncontract LibConstants {\n\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n uint256 constant internal MAX_UINT = 2**256 - 1;\n uint256 constant internal PERCENTAGE_DENOMINATOR = 10**18; \n uint256 constant internal MAX_FEE_PERCENTAGE = 5 * PERCENTAGE_DENOMINATOR / 100; // 5%\n uint256 constant internal MAX_WETH_FILL_PERCENTAGE = 95 * PERCENTAGE_DENOMINATOR / 100; // 95%\n \n // solhint-disable var-name-mixedcase\n IExchange internal EXCHANGE;\n IEtherToken internal ETHER_TOKEN;\n IERC20Token internal ZRX_TOKEN;\n bytes internal ZRX_ASSET_DATA;\n bytes internal WETH_ASSET_DATA;\n // solhint-enable var-name-mixedcase\n\n constructor (\n address _exchange,\n bytes memory _zrxAssetData,\n bytes memory _wethAssetData\n )\n public\n {\n EXCHANGE = IExchange(_exchange);\n ZRX_ASSET_DATA = _zrxAssetData;\n WETH_ASSET_DATA = _wethAssetData;\n\n address etherToken = _wethAssetData.readAddress(16);\n address zrxToken = _zrxAssetData.readAddress(16);\n ETHER_TOKEN = IEtherToken(etherToken);\n ZRX_TOKEN = IERC20Token(zrxToken);\n }\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAssets.sol\";\n\n\ncontract MAssets is\n IAssets\n{\n /// @dev Transfers given amount of asset to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferAssetToSender(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n\n /// @dev Decodes ERC20 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC20Token(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n\n /// @dev Decodes ERC721 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC721Token(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../../protocol/Exchange/libs/LibFillResults.sol\";\n\n\ncontract MExchangeWrapper {\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of WETH has been sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param wethSellAmount Desired amount of WETH to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellWeth(\n LibOrder.Order[] memory orders,\n uint256 wethSellAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// The asset being sold by taker must always be WETH.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyExactAmountWithWeth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Buys zrxBuyAmount of ZRX fee tokens, taking into account ZRX fees for each order. This will guarantee\n /// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues).\n /// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX\n /// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases.\n /// The asset being sold by taker must always be WETH. \n /// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset.\n /// @param zrxBuyAmount Desired amount of ZRX to buy.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return totalFillResults Amounts filled and fees paid by maker and taker.\n function marketBuyExactZrxWithWeth(\n LibOrder.Order[] memory orders,\n uint256 zrxBuyAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MWeth.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract MWeth {\n\n /// @dev Converts message call's ETH value into WETH.\n function convertEthToWeth()\n internal;\n\n /// @dev Transfers feePercentage of WETH spent on primary orders to feeRecipient.\n /// Refunds any excess ETH to msg.sender.\n /// @param wethSoldExcludingFeeOrders Amount of WETH sold when filling primary orders.\n /// @param wethSoldForZrx Amount of WETH sold when purchasing ZRX required for primary order fees.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n function transferEthFeeAndRefund(\n uint256 wethSoldExcludingFeeOrders,\n uint256 wethSoldForZrx,\n uint256 feePercentage,\n address feeRecipient\n )\n internal;\n}\n",
- "2.0.0/extensions/OrderValidator/OrderValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../protocol/Exchange/interfaces/IExchange.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../tokens/ERC20Token/IERC20Token.sol\";\nimport \"../../tokens/ERC721Token/IERC721Token.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\n\n\ncontract OrderValidator {\n\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n\n struct TraderInfo {\n uint256 makerBalance; // Maker's balance of makerAsset\n uint256 makerAllowance; // Maker's allowance to corresponding AssetProxy\n uint256 takerBalance; // Taker's balance of takerAsset\n uint256 takerAllowance; // Taker's allowance to corresponding AssetProxy\n uint256 makerZrxBalance; // Maker's balance of ZRX\n uint256 makerZrxAllowance; // Maker's allowance of ZRX to ERC20Proxy\n uint256 takerZrxBalance; // Taker's balance of ZRX\n uint256 takerZrxAllowance; // Taker's allowance of ZRX to ERC20Proxy\n }\n\n // solhint-disable var-name-mixedcase\n IExchange internal EXCHANGE;\n bytes internal ZRX_ASSET_DATA;\n // solhint-enable var-name-mixedcase\n\n constructor (address _exchange, bytes memory _zrxAssetData)\n public\n {\n EXCHANGE = IExchange(_exchange);\n ZRX_ASSET_DATA = _zrxAssetData;\n }\n\n /// @dev Fetches information for order and maker/taker of order.\n /// @param order The order structure.\n /// @param takerAddress Address that will be filling the order.\n /// @return OrderInfo and TraderInfo instances for given order.\n function getOrderAndTraderInfo(LibOrder.Order memory order, address takerAddress)\n public\n view\n returns (LibOrder.OrderInfo memory orderInfo, TraderInfo memory traderInfo)\n {\n orderInfo = EXCHANGE.getOrderInfo(order);\n traderInfo = getTraderInfo(order, takerAddress);\n return (orderInfo, traderInfo);\n }\n\n /// @dev Fetches information for all passed in orders and the makers/takers of each order.\n /// @param orders Array of order specifications.\n /// @param takerAddresses Array of taker addresses corresponding to each order.\n /// @return Arrays of OrderInfo and TraderInfo instances that correspond to each order.\n function getOrdersAndTradersInfo(LibOrder.Order[] memory orders, address[] memory takerAddresses)\n public\n view\n returns (LibOrder.OrderInfo[] memory ordersInfo, TraderInfo[] memory tradersInfo)\n {\n ordersInfo = EXCHANGE.getOrdersInfo(orders);\n tradersInfo = getTradersInfo(orders, takerAddresses);\n return (ordersInfo, tradersInfo);\n }\n\n /// @dev Fetches balance and allowances for maker and taker of order.\n /// @param order The order structure.\n /// @param takerAddress Address that will be filling the order.\n /// @return Balances and allowances of maker and taker of order.\n function getTraderInfo(LibOrder.Order memory order, address takerAddress)\n public\n view\n returns (TraderInfo memory traderInfo)\n {\n (traderInfo.makerBalance, traderInfo.makerAllowance) = getBalanceAndAllowance(order.makerAddress, order.makerAssetData);\n (traderInfo.takerBalance, traderInfo.takerAllowance) = getBalanceAndAllowance(takerAddress, order.takerAssetData);\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n (traderInfo.makerZrxBalance, traderInfo.makerZrxAllowance) = getBalanceAndAllowance(order.makerAddress, zrxAssetData);\n (traderInfo.takerZrxBalance, traderInfo.takerZrxAllowance) = getBalanceAndAllowance(takerAddress, zrxAssetData);\n return traderInfo;\n }\n\n /// @dev Fetches balances and allowances of maker and taker for each provided order.\n /// @param orders Array of order specifications.\n /// @param takerAddresses Array of taker addresses corresponding to each order.\n /// @return Array of balances and allowances for maker and taker of each order.\n function getTradersInfo(LibOrder.Order[] memory orders, address[] memory takerAddresses)\n public\n view\n returns (TraderInfo[] memory)\n {\n uint256 ordersLength = orders.length;\n TraderInfo[] memory tradersInfo = new TraderInfo[](ordersLength);\n for (uint256 i = 0; i != ordersLength; i++) {\n tradersInfo[i] = getTraderInfo(orders[i], takerAddresses[i]);\n }\n return tradersInfo;\n }\n\n /// @dev Fetches token balances and allowances of an address to given assetProxy. Supports ERC20 and ERC721.\n /// @param target Address to fetch balances and allowances of.\n /// @param assetData Encoded data that can be decoded by a specified proxy contract when transferring asset.\n /// @return Balance of asset and allowance set to given proxy of asset.\n /// For ERC721 tokens, these values will always be 1 or 0.\n function getBalanceAndAllowance(address target, bytes memory assetData)\n public\n view\n returns (uint256 balance, uint256 allowance)\n {\n bytes4 assetProxyId = assetData.readBytes4(0);\n address token = assetData.readAddress(16);\n address assetProxy = EXCHANGE.getAssetProxy(assetProxyId);\n\n if (assetProxyId == ERC20_DATA_ID) {\n // Query balance\n balance = IERC20Token(token).balanceOf(target);\n\n // Query allowance\n allowance = IERC20Token(token).allowance(target, assetProxy);\n } else if (assetProxyId == ERC721_DATA_ID) {\n uint256 tokenId = assetData.readUint256(36);\n\n // Query owner of tokenId\n address owner = getERC721TokenOwner(token, tokenId);\n\n // Set balance to 1 if tokenId is owned by target\n balance = target == owner ? 1 : 0;\n\n // Check if ERC721Proxy is approved to spend tokenId\n bool isApproved = IERC721Token(token).isApprovedForAll(target, assetProxy) || IERC721Token(token).getApproved(tokenId) == assetProxy;\n \n // Set alowance to 1 if ERC721Proxy is approved to spend tokenId\n allowance = isApproved ? 1 : 0;\n } else {\n revert(\"UNSUPPORTED_ASSET_PROXY\");\n }\n return (balance, allowance);\n }\n\n /// @dev Fetches token balances and allowances of an address for each given assetProxy. Supports ERC20 and ERC721.\n /// @param target Address to fetch balances and allowances of.\n /// @param assetData Array of encoded byte arrays that can be decoded by a specified proxy contract when transferring asset.\n /// @return Balances and allowances of assets.\n /// For ERC721 tokens, these values will always be 1 or 0.\n function getBalancesAndAllowances(address target, bytes[] memory assetData)\n public\n view\n returns (uint256[] memory, uint256[] memory)\n {\n uint256 length = assetData.length;\n uint256[] memory balances = new uint256[](length);\n uint256[] memory allowances = new uint256[](length);\n for (uint256 i = 0; i != length; i++) {\n (balances[i], allowances[i]) = getBalanceAndAllowance(target, assetData[i]);\n }\n return (balances, allowances);\n }\n\n /// @dev Calls `token.ownerOf(tokenId)`, but returns a null owner instead of reverting on an unowned token.\n /// @param token Address of ERC721 token.\n /// @param tokenId The identifier for the specific NFT.\n /// @return Owner of tokenId or null address if unowned.\n function getERC721TokenOwner(address token, uint256 tokenId)\n public\n view\n returns (address owner)\n {\n assembly {\n // load free memory pointer\n let cdStart := mload(64)\n\n // bytes4(keccak256(ownerOf(uint256))) = 0x6352211e\n mstore(cdStart, 0x6352211e00000000000000000000000000000000000000000000000000000000)\n mstore(add(cdStart, 4), tokenId)\n\n // staticcall `ownerOf(tokenId)`\n // `ownerOf` will revert if tokenId is not owned\n let success := staticcall(\n gas, // forward all gas\n token, // call token contract\n cdStart, // start of calldata\n 36, // length of input is 36 bytes\n cdStart, // write output over input\n 32 // size of output is 32 bytes\n )\n\n // Success implies that tokenId is owned\n // Copy owner from return data if successful\n if success {\n owner := mload(cdStart)\n } \n }\n\n // Owner initialized to address(0), no need to modify if call is unsuccessful\n return owner;\n }\n}\n",
- "2.0.0/multisig/MultiSigWallet.sol": "// solhint-disable\npragma solidity ^0.4.15;\n\n\n/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.\n/// @author Stefan George - <stefan.george@consensys.net>\ncontract MultiSigWallet {\n\n /*\n * Events\n */\n event Confirmation(address indexed sender, uint indexed transactionId);\n event Revocation(address indexed sender, uint indexed transactionId);\n event Submission(uint indexed transactionId);\n event Execution(uint indexed transactionId);\n event ExecutionFailure(uint indexed transactionId);\n event Deposit(address indexed sender, uint value);\n event OwnerAddition(address indexed owner);\n event OwnerRemoval(address indexed owner);\n event RequirementChange(uint required);\n\n /*\n * Constants\n */\n uint constant public MAX_OWNER_COUNT = 50;\n\n /*\n * Storage\n */\n mapping (uint => Transaction) public transactions;\n mapping (uint => mapping (address => bool)) public confirmations;\n mapping (address => bool) public isOwner;\n address[] public owners;\n uint public required;\n uint public transactionCount;\n\n struct Transaction {\n address destination;\n uint value;\n bytes data;\n bool executed;\n }\n\n /*\n * Modifiers\n */\n modifier onlyWallet() {\n require(msg.sender == address(this));\n _;\n }\n\n modifier ownerDoesNotExist(address owner) {\n require(!isOwner[owner]);\n _;\n }\n\n modifier ownerExists(address owner) {\n require(isOwner[owner]);\n _;\n }\n\n modifier transactionExists(uint transactionId) {\n require(transactions[transactionId].destination != 0);\n _;\n }\n\n modifier confirmed(uint transactionId, address owner) {\n require(confirmations[transactionId][owner]);\n _;\n }\n\n modifier notConfirmed(uint transactionId, address owner) {\n require(!confirmations[transactionId][owner]);\n _;\n }\n\n modifier notExecuted(uint transactionId) {\n require(!transactions[transactionId].executed);\n _;\n }\n\n modifier notNull(address _address) {\n require(_address != 0);\n _;\n }\n\n modifier validRequirement(uint ownerCount, uint _required) {\n require(ownerCount <= MAX_OWNER_COUNT\n && _required <= ownerCount\n && _required != 0\n && ownerCount != 0);\n _;\n }\n\n /// @dev Fallback function allows to deposit ether.\n function()\n payable\n {\n if (msg.value > 0)\n Deposit(msg.sender, msg.value);\n }\n\n /*\n * Public functions\n */\n /// @dev Contract constructor sets initial owners and required number of confirmations.\n /// @param _owners List of initial owners.\n /// @param _required Number of required confirmations.\n function MultiSigWallet(address[] _owners, uint _required)\n public\n validRequirement(_owners.length, _required)\n {\n for (uint i=0; i<_owners.length; i++) {\n require(!isOwner[_owners[i]] && _owners[i] != 0);\n isOwner[_owners[i]] = true;\n }\n owners = _owners;\n required = _required;\n }\n\n /// @dev Allows to add a new owner. Transaction has to be sent by wallet.\n /// @param owner Address of new owner.\n function addOwner(address owner)\n public\n onlyWallet\n ownerDoesNotExist(owner)\n notNull(owner)\n validRequirement(owners.length + 1, required)\n {\n isOwner[owner] = true;\n owners.push(owner);\n OwnerAddition(owner);\n }\n\n /// @dev Allows to remove an owner. Transaction has to be sent by wallet.\n /// @param owner Address of owner.\n function removeOwner(address owner)\n public\n onlyWallet\n ownerExists(owner)\n {\n isOwner[owner] = false;\n for (uint i=0; i<owners.length - 1; i++)\n if (owners[i] == owner) {\n owners[i] = owners[owners.length - 1];\n break;\n }\n owners.length -= 1;\n if (required > owners.length)\n changeRequirement(owners.length);\n OwnerRemoval(owner);\n }\n\n /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet.\n /// @param owner Address of owner to be replaced.\n /// @param newOwner Address of new owner.\n function replaceOwner(address owner, address newOwner)\n public\n onlyWallet\n ownerExists(owner)\n ownerDoesNotExist(newOwner)\n {\n for (uint i=0; i<owners.length; i++)\n if (owners[i] == owner) {\n owners[i] = newOwner;\n break;\n }\n isOwner[owner] = false;\n isOwner[newOwner] = true;\n OwnerRemoval(owner);\n OwnerAddition(newOwner);\n }\n\n /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet.\n /// @param _required Number of required confirmations.\n function changeRequirement(uint _required)\n public\n onlyWallet\n validRequirement(owners.length, _required)\n {\n required = _required;\n RequirementChange(_required);\n }\n\n /// @dev Allows an owner to submit and confirm a transaction.\n /// @param destination Transaction target address.\n /// @param value Transaction ether value.\n /// @param data Transaction data payload.\n /// @return Returns transaction ID.\n function submitTransaction(address destination, uint value, bytes data)\n public\n returns (uint transactionId)\n {\n transactionId = addTransaction(destination, value, data);\n confirmTransaction(transactionId);\n }\n\n /// @dev Allows an owner to confirm a transaction.\n /// @param transactionId Transaction ID.\n function confirmTransaction(uint transactionId)\n public\n ownerExists(msg.sender)\n transactionExists(transactionId)\n notConfirmed(transactionId, msg.sender)\n {\n confirmations[transactionId][msg.sender] = true;\n Confirmation(msg.sender, transactionId);\n executeTransaction(transactionId);\n }\n\n /// @dev Allows an owner to revoke a confirmation for a transaction.\n /// @param transactionId Transaction ID.\n function revokeConfirmation(uint transactionId)\n public\n ownerExists(msg.sender)\n confirmed(transactionId, msg.sender)\n notExecuted(transactionId)\n {\n confirmations[transactionId][msg.sender] = false;\n Revocation(msg.sender, transactionId);\n }\n\n /// @dev Allows anyone to execute a confirmed transaction.\n /// @param transactionId Transaction ID.\n function executeTransaction(uint transactionId)\n public\n ownerExists(msg.sender)\n confirmed(transactionId, msg.sender)\n notExecuted(transactionId)\n {\n if (isConfirmed(transactionId)) {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data))\n Execution(transactionId);\n else {\n ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n }\n\n // call has been separated into its own function in order to take advantage\n // of the Solidity's code generator to produce a loop that copies tx.data into memory.\n function external_call(address destination, uint value, uint dataLength, bytes data) internal returns (bool) {\n bool result;\n assembly {\n let x := mload(0x40) // \"Allocate\" memory for output (0x40 is where \"free memory\" pointer is stored by convention)\n let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that\n result := call(\n sub(gas, 34710), // 34710 is the value that solidity is currently emitting\n // It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) +\n // callNewAccountGas (25000, in case the destination address does not exist and needs creating)\n destination,\n value,\n d,\n dataLength, // Size of the input (in bytes) - this is what fixes the padding problem\n x,\n 0 // Output is ignored, therefore the output size is zero\n )\n }\n return result;\n }\n\n /// @dev Returns the confirmation status of a transaction.\n /// @param transactionId Transaction ID.\n /// @return Confirmation status.\n function isConfirmed(uint transactionId)\n public\n constant\n returns (bool)\n {\n uint count = 0;\n for (uint i=0; i<owners.length; i++) {\n if (confirmations[transactionId][owners[i]])\n count += 1;\n if (count == required)\n return true;\n }\n }\n\n /*\n * Internal functions\n */\n /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet.\n /// @param destination Transaction target address.\n /// @param value Transaction ether value.\n /// @param data Transaction data payload.\n /// @return Returns transaction ID.\n function addTransaction(address destination, uint value, bytes data)\n internal\n notNull(destination)\n returns (uint transactionId)\n {\n transactionId = transactionCount;\n transactions[transactionId] = Transaction({\n destination: destination,\n value: value,\n data: data,\n executed: false\n });\n transactionCount += 1;\n Submission(transactionId);\n }\n\n /*\n * Web3 call functions\n */\n /// @dev Returns number of confirmations of a transaction.\n /// @param transactionId Transaction ID.\n /// @return Number of confirmations.\n function getConfirmationCount(uint transactionId)\n public\n constant\n returns (uint count)\n {\n for (uint i=0; i<owners.length; i++)\n if (confirmations[transactionId][owners[i]])\n count += 1;\n }\n\n /// @dev Returns total number of transactions after filers are applied.\n /// @param pending Include pending transactions.\n /// @param executed Include executed transactions.\n /// @return Total number of transactions after filters are applied.\n function getTransactionCount(bool pending, bool executed)\n public\n constant\n returns (uint count)\n {\n for (uint i=0; i<transactionCount; i++)\n if ( pending && !transactions[i].executed\n || executed && transactions[i].executed)\n count += 1;\n }\n\n /// @dev Returns list of owners.\n /// @return List of owner addresses.\n function getOwners()\n public\n constant\n returns (address[])\n {\n return owners;\n }\n\n /// @dev Returns array with owner addresses, which confirmed transaction.\n /// @param transactionId Transaction ID.\n /// @return Returns array of owner addresses.\n function getConfirmations(uint transactionId)\n public\n constant\n returns (address[] _confirmations)\n {\n address[] memory confirmationsTemp = new address[](owners.length);\n uint count = 0;\n uint i;\n for (i=0; i<owners.length; i++)\n if (confirmations[transactionId][owners[i]]) {\n confirmationsTemp[count] = owners[i];\n count += 1;\n }\n _confirmations = new address[](count);\n for (i=0; i<count; i++)\n _confirmations[i] = confirmationsTemp[i];\n }\n\n /// @dev Returns list of transaction IDs in defined range.\n /// @param from Index start position of transaction array.\n /// @param to Index end position of transaction array.\n /// @param pending Include pending transactions.\n /// @param executed Include executed transactions.\n /// @return Returns array of transaction IDs.\n function getTransactionIds(uint from, uint to, bool pending, bool executed)\n public\n constant\n returns (uint[] _transactionIds)\n {\n uint[] memory transactionIdsTemp = new uint[](transactionCount);\n uint count = 0;\n uint i;\n for (i=0; i<transactionCount; i++)\n if ( pending && !transactions[i].executed\n || executed && transactions[i].executed)\n {\n transactionIdsTemp[count] = i;\n count += 1;\n }\n _transactionIds = new uint[](to - from);\n for (i=from; i<to; i++)\n _transactionIds[i - from] = transactionIdsTemp[i];\n }\n}",
- "2.0.0/multisig/MultiSigWalletWithTimeLock.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MultiSigWallet.sol\";\n\n\n/// @title Multisignature wallet with time lock- Allows multiple parties to execute a transaction after a time lock has passed.\n/// @author Amir Bandeali - <amir@0xProject.com>\n// solhint-disable not-rely-on-time\ncontract MultiSigWalletWithTimeLock is\n MultiSigWallet\n{\n event ConfirmationTimeSet(uint256 indexed transactionId, uint256 confirmationTime);\n event TimeLockChange(uint256 secondsTimeLocked);\n\n uint256 public secondsTimeLocked;\n\n mapping (uint256 => uint256) public confirmationTimes;\n\n modifier notFullyConfirmed(uint256 transactionId) {\n require(\n !isConfirmed(transactionId),\n \"TX_FULLY_CONFIRMED\"\n );\n _;\n }\n\n modifier fullyConfirmed(uint256 transactionId) {\n require(\n isConfirmed(transactionId),\n \"TX_NOT_FULLY_CONFIRMED\"\n );\n _;\n }\n\n modifier pastTimeLock(uint256 transactionId) {\n require(\n block.timestamp >= confirmationTimes[transactionId] + secondsTimeLocked,\n \"TIME_LOCK_INCOMPLETE\"\n );\n _;\n }\n\n /// @dev Contract constructor sets initial owners, required number of confirmations, and time lock.\n /// @param _owners List of initial owners.\n /// @param _required Number of required confirmations.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n constructor (\n address[] _owners,\n uint256 _required,\n uint256 _secondsTimeLocked\n )\n public\n MultiSigWallet(_owners, _required)\n {\n secondsTimeLocked = _secondsTimeLocked;\n }\n\n /// @dev Changes the duration of the time lock for transactions.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n function changeTimeLock(uint256 _secondsTimeLocked)\n public\n onlyWallet\n {\n secondsTimeLocked = _secondsTimeLocked;\n emit TimeLockChange(_secondsTimeLocked);\n }\n\n /// @dev Allows an owner to confirm a transaction.\n /// @param transactionId Transaction ID.\n function confirmTransaction(uint256 transactionId)\n public\n ownerExists(msg.sender)\n transactionExists(transactionId)\n notConfirmed(transactionId, msg.sender)\n notFullyConfirmed(transactionId)\n {\n confirmations[transactionId][msg.sender] = true;\n emit Confirmation(msg.sender, transactionId);\n if (isConfirmed(transactionId)) {\n setConfirmationTime(transactionId, block.timestamp);\n }\n }\n\n /// @dev Allows anyone to execute a confirmed transaction.\n /// @param transactionId Transaction ID.\n function executeTransaction(uint256 transactionId)\n public\n notExecuted(transactionId)\n fullyConfirmed(transactionId)\n pastTimeLock(transactionId)\n {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) {\n emit Execution(transactionId);\n } else {\n emit ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n\n /// @dev Sets the time of when a submission first passed.\n function setConfirmationTime(uint256 transactionId, uint256 confirmationTime)\n internal\n {\n confirmationTimes[transactionId] = confirmationTime;\n emit ConfirmationTimeSet(transactionId, confirmationTime);\n }\n}\n",
- "2.0.0/protocol/AssetProxy/ERC20Proxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MixinAuthorizable.sol\";\n\n\ncontract ERC20Proxy is\n MixinAuthorizable\n{\n // Id of this proxy.\n bytes4 constant internal PROXY_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n \n // solhint-disable-next-line payable-fallback\n function () \n external\n {\n assembly {\n // The first 4 bytes of calldata holds the function selector\n let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)\n\n // `transferFrom` will be called with the following parameters:\n // assetData Encoded byte array.\n // from Address to transfer asset from.\n // to Address to transfer asset to.\n // amount Amount of asset to transfer.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {\n\n // To lookup a value in a mapping, we load from the storage location keccak256(k, p),\n // where k is the key left padded to 32 bytes and p is the storage slot\n let start := mload(64)\n mstore(start, and(caller, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(start, 32), authorized_slot)\n\n // Revert if authorized[msg.sender] == false\n if iszero(sload(keccak256(start, 64))) {\n // Revert with `Error(\"SENDER_NOT_AUTHORIZED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // `transferFrom`.\n // The function is marked `external`, so no abi decodeding is done for\n // us. Instead, we expect the `calldata` memory to contain the\n // following:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n //\n // (*): offset is computed from start of function parameters, so offset\n // by an additional 4 bytes in the calldata.\n //\n // (**): see table below to compute length of assetData Contents\n //\n // WARNING: The ABIv2 specification allows additional padding between\n // the Params and Data section. This will result in a larger\n // offset to assetData.\n\n // Asset data itself is encoded as follows:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 1 * 32 | function parameters: |\n // | | 4 | 12 + 20 | 1. token address |\n\n // We construct calldata for the `token.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 4 | | 1. from |\n // | | 36 | | 2. to |\n // | | 68 | | 3. amount |\n\n /////// Read token address from calldata ///////\n // * The token address is stored in `assetData`.\n //\n // * The \"offset to assetData\" is stored at offset 4 in the calldata (table 1).\n // [assetDataOffsetFromParams = calldataload(4)]\n //\n // * Notes that the \"offset to assetData\" is relative to the \"Params\" area of calldata;\n // add 4 bytes to account for the length of the \"Header\" area (table 1).\n // [assetDataOffsetFromHeader = assetDataOffsetFromParams + 4]\n //\n // * The \"token address\" is offset 32+4=36 bytes into \"assetData\" (tables 1 & 2).\n // [tokenOffset = assetDataOffsetFromHeader + 36 = calldataload(4) + 4 + 36]\n let token := calldataload(add(calldataload(4), 40))\n \n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFrom` selector.\n // Any trailing data in transferFromSelector will be\n // overwritten in the next `mstore` call.\n mstore(0, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // We copy the fields `from`, `to` and `amount` in bulk\n // from our own calldata to the new calldata.\n calldatacopy(4, 36, 96)\n\n /////// Call `token.transferFrom` using the calldata ///////\n let success := call(\n gas, // forward all gas\n token, // call address of token contract\n 0, // don't send any ETH\n 0, // pointer to start of input\n 100, // length of input\n 0, // write output over input\n 32 // output size should be 32 bytes\n )\n\n /////// Check return data. ///////\n // If there is no return data, we assume the token incorrectly\n // does not return a bool. In this case we expect it to revert\n // on failure, which was handled above.\n // If the token does return data, we require that it is a single\n // nonzero 32 bytes value.\n // So the transfer succeeded if the call succeeded and either\n // returned nothing, or returned a non-zero 32 byte value. \n success := and(success, or(\n iszero(returndatasize),\n and(\n eq(returndatasize, 32),\n gt(mload(0), 0)\n )\n ))\n if success {\n return(0, 0)\n }\n \n // Revert with `Error(\"TRANSFER_FAILED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // Revert if undefined function is called\n revert(0, 0)\n }\n }\n\n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4)\n {\n return PROXY_ID;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/ERC721Proxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MixinAuthorizable.sol\";\n\n\ncontract ERC721Proxy is\n MixinAuthorizable\n{\n // Id of this proxy.\n bytes4 constant internal PROXY_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n\n // solhint-disable-next-line payable-fallback\n function () \n external\n {\n assembly {\n // The first 4 bytes of calldata holds the function selector\n let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)\n\n // `transferFrom` will be called with the following parameters:\n // assetData Encoded byte array.\n // from Address to transfer asset from.\n // to Address to transfer asset to.\n // amount Amount of asset to transfer.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {\n\n // To lookup a value in a mapping, we load from the storage location keccak256(k, p),\n // where k is the key left padded to 32 bytes and p is the storage slot\n let start := mload(64)\n mstore(start, and(caller, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(start, 32), authorized_slot)\n\n // Revert if authorized[msg.sender] == false\n if iszero(sload(keccak256(start, 64))) {\n // Revert with `Error(\"SENDER_NOT_AUTHORIZED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // `transferFrom`.\n // The function is marked `external`, so no abi decodeding is done for\n // us. Instead, we expect the `calldata` memory to contain the\n // following:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n //\n // (*): offset is computed from start of function parameters, so offset\n // by an additional 4 bytes in the calldata.\n //\n // (**): see table below to compute length of assetData Contents\n //\n // WARNING: The ABIv2 specification allows additional padding between\n // the Params and Data section. This will result in a larger\n // offset to assetData.\n\n // Asset data itself is encoded as follows:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 2 * 32 | function parameters: |\n // | | 4 | 12 + 20 | 1. token address |\n // | | 36 | | 2. tokenId |\n \n // We construct calldata for the `token.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n // \n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 4 | | 1. from |\n // | | 36 | | 2. to |\n // | | 68 | | 3. tokenId |\n\n // There exists only 1 of each token.\n // require(amount == 1, \"INVALID_AMOUNT\")\n if sub(calldataload(100), 1) {\n // Revert with `Error(\"INVALID_AMOUNT\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000e494e56414c49445f414d4f554e540000000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFrom` selector.\n // Any trailing data in transferFromSelector will be\n // overwritten in the next `mstore` call.\n mstore(0, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // We copy the fields `from` and `to` in bulk\n // from our own calldata to the new calldata.\n calldatacopy(4, 36, 64)\n\n // Copy `tokenId` field from our own calldata to the new calldata.\n let assetDataOffset := calldataload(4)\n calldatacopy(68, add(assetDataOffset, 72), 32)\n\n /////// Call `token.transferFrom` using the calldata ///////\n let token := calldataload(add(assetDataOffset, 40))\n let success := call(\n gas, // forward all gas\n token, // call address of token contract\n 0, // don't send any ETH\n 0, // pointer to start of input\n 100, // length of input\n 0, // write output to null\n 0 // output size is 0 bytes\n )\n if success {\n return(0, 0)\n }\n \n // Revert with `Error(\"TRANSFER_FAILED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // Revert if undefined function is called\n revert(0, 0)\n }\n }\n\n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4)\n {\n return PROXY_ID;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/MixinAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"./mixins/MAuthorizable.sol\";\n\n\ncontract MixinAuthorizable is\n Ownable,\n MAuthorizable\n{\n /// @dev Only authorized addresses can invoke functions with this modifier.\n modifier onlyAuthorized {\n require(\n authorized[msg.sender],\n \"SENDER_NOT_AUTHORIZED\"\n );\n _;\n }\n\n mapping (address => bool) public authorized;\n address[] public authorities;\n\n /// @dev Authorizes an address.\n /// @param target Address to authorize.\n function addAuthorizedAddress(address target)\n external\n onlyOwner\n {\n require(\n !authorized[target],\n \"TARGET_ALREADY_AUTHORIZED\"\n );\n\n authorized[target] = true;\n authorities.push(target);\n emit AuthorizedAddressAdded(target, msg.sender);\n }\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n function removeAuthorizedAddress(address target)\n external\n onlyOwner\n {\n require(\n authorized[target],\n \"TARGET_NOT_AUTHORIZED\"\n );\n\n delete authorized[target];\n for (uint256 i = 0; i < authorities.length; i++) {\n if (authorities[i] == target) {\n authorities[i] = authorities[authorities.length - 1];\n authorities.length -= 1;\n break;\n }\n }\n emit AuthorizedAddressRemoved(target, msg.sender);\n }\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n /// @param index Index of target in authorities array.\n function removeAuthorizedAddressAtIndex(\n address target,\n uint256 index\n )\n external\n onlyOwner\n {\n require(\n authorized[target],\n \"TARGET_NOT_AUTHORIZED\"\n );\n require(\n index < authorities.length,\n \"INDEX_OUT_OF_BOUNDS\"\n );\n require(\n authorities[index] == target,\n \"AUTHORIZED_ADDRESS_MISMATCH\"\n );\n\n delete authorized[target];\n authorities[index] = authorities[authorities.length - 1];\n authorities.length -= 1;\n emit AuthorizedAddressRemoved(target, msg.sender);\n }\n\n /// @dev Gets all authorized addresses.\n /// @return Array of authorized addresses.\n function getAuthorizedAddresses()\n external\n view\n returns (address[] memory)\n {\n return authorities;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IAuthorizable.sol\";\n\n\ncontract IAssetProxy is\n IAuthorizable\n{\n /// @dev Transfers assets. Either succeeds or throws.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param from Address to transfer asset from.\n /// @param to Address to transfer asset to.\n /// @param amount Amount of asset to transfer.\n function transferFrom(\n bytes assetData,\n address from,\n address to,\n uint256 amount\n )\n external;\n \n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4);\n}\n",
- "2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/Ownable/IOwnable.sol\";\n\n\ncontract IAuthorizable is\n IOwnable\n{\n /// @dev Authorizes an address.\n /// @param target Address to authorize.\n function addAuthorizedAddress(address target)\n external;\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n function removeAuthorizedAddress(address target)\n external;\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n /// @param index Index of target in authorities array.\n function removeAuthorizedAddressAtIndex(\n address target,\n uint256 index\n )\n external;\n \n /// @dev Gets all authorized addresses.\n /// @return Array of authorized addresses.\n function getAuthorizedAddresses()\n external\n view\n returns (address[] memory);\n}\n",
- "2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAuthorizable.sol\";\n\n\ncontract MAuthorizable is\n IAuthorizable\n{\n // Event logged when a new address is authorized.\n event AuthorizedAddressAdded(\n address indexed target,\n address indexed caller\n );\n\n // Event logged when a currently authorized address is unauthorized.\n event AuthorizedAddressRemoved(\n address indexed target,\n address indexed caller\n );\n\n /// @dev Only authorized addresses can invoke functions with this modifier.\n modifier onlyAuthorized { revert(); _; }\n}\n",
- "2.0.0/protocol/AssetProxyOwner/AssetProxyOwner.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../multisig/MultiSigWalletWithTimeLock.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\n\n\ncontract AssetProxyOwner is\n MultiSigWalletWithTimeLock\n{\n using LibBytes for bytes;\n\n event AssetProxyRegistration(address assetProxyContract, bool isRegistered);\n\n // Mapping of AssetProxy contract address =>\n // if this contract is allowed to call the AssetProxy's `removeAuthorizedAddressAtIndex` method without a time lock.\n mapping (address => bool) public isAssetProxyRegistered;\n\n bytes4 constant internal REMOVE_AUTHORIZED_ADDRESS_AT_INDEX_SELECTOR = bytes4(keccak256(\"removeAuthorizedAddressAtIndex(address,uint256)\"));\n\n /// @dev Function will revert if the transaction does not call `removeAuthorizedAddressAtIndex`\n /// on an approved AssetProxy contract.\n modifier validRemoveAuthorizedAddressAtIndexTx(uint256 transactionId) {\n Transaction storage txn = transactions[transactionId];\n require(\n isAssetProxyRegistered[txn.destination],\n \"UNREGISTERED_ASSET_PROXY\"\n );\n require(\n txn.data.readBytes4(0) == REMOVE_AUTHORIZED_ADDRESS_AT_INDEX_SELECTOR,\n \"INVALID_FUNCTION_SELECTOR\"\n );\n _;\n }\n\n /// @dev Contract constructor sets initial owners, required number of confirmations,\n /// time lock, and list of AssetProxy addresses.\n /// @param _owners List of initial owners.\n /// @param _assetProxyContracts Array of AssetProxy contract addresses.\n /// @param _required Number of required confirmations.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n constructor (\n address[] memory _owners,\n address[] memory _assetProxyContracts,\n uint256 _required,\n uint256 _secondsTimeLocked\n )\n public\n MultiSigWalletWithTimeLock(_owners, _required, _secondsTimeLocked)\n {\n for (uint256 i = 0; i < _assetProxyContracts.length; i++) {\n address assetProxy = _assetProxyContracts[i];\n require(\n assetProxy != address(0),\n \"INVALID_ASSET_PROXY\"\n );\n isAssetProxyRegistered[assetProxy] = true;\n }\n }\n\n /// @dev Registers or deregisters an AssetProxy to be able to execute\n /// `removeAuthorizedAddressAtIndex` without a timelock.\n /// @param assetProxyContract Address of AssetProxy contract.\n /// @param isRegistered Status of approval for AssetProxy contract.\n function registerAssetProxy(address assetProxyContract, bool isRegistered)\n public\n onlyWallet\n notNull(assetProxyContract)\n {\n isAssetProxyRegistered[assetProxyContract] = isRegistered;\n emit AssetProxyRegistration(assetProxyContract, isRegistered);\n }\n\n /// @dev Allows execution of `removeAuthorizedAddressAtIndex` without time lock.\n /// @param transactionId Transaction ID.\n function executeRemoveAuthorizedAddressAtIndex(uint256 transactionId)\n public\n notExecuted(transactionId)\n fullyConfirmed(transactionId)\n validRemoveAuthorizedAddressAtIndexTx(transactionId)\n {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) {\n emit Execution(transactionId);\n } else {\n emit ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/Exchange.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./MixinExchangeCore.sol\";\nimport \"./MixinSignatureValidator.sol\";\nimport \"./MixinWrapperFunctions.sol\";\nimport \"./MixinAssetProxyDispatcher.sol\";\nimport \"./MixinTransactions.sol\";\nimport \"./MixinMatchOrders.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract Exchange is\n MixinExchangeCore,\n MixinMatchOrders,\n MixinSignatureValidator,\n MixinTransactions,\n MixinAssetProxyDispatcher,\n MixinWrapperFunctions\n{\n string constant public VERSION = \"2.0.1-alpha\";\n\n // Mixins are instantiated in the order they are inherited\n constructor (bytes memory _zrxAssetData)\n public\n LibConstants(_zrxAssetData) // @TODO: Remove when we deploy.\n MixinExchangeCore()\n MixinMatchOrders()\n MixinSignatureValidator()\n MixinTransactions()\n MixinAssetProxyDispatcher()\n MixinWrapperFunctions()\n {}\n}\n",
- "2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\nimport \"../AssetProxy/interfaces/IAssetProxy.sol\";\n\n\ncontract MixinAssetProxyDispatcher is\n Ownable,\n MAssetProxyDispatcher\n{\n // Mapping from Asset Proxy Id's to their respective Asset Proxy\n mapping (bytes4 => IAssetProxy) public assetProxies;\n\n /// @dev Registers an asset proxy to its asset proxy id.\n /// Once an asset proxy is registered, it cannot be unregistered.\n /// @param assetProxy Address of new asset proxy to register.\n function registerAssetProxy(address assetProxy)\n external\n onlyOwner\n {\n IAssetProxy assetProxyContract = IAssetProxy(assetProxy);\n\n // Ensure that no asset proxy exists with current id.\n bytes4 assetProxyId = assetProxyContract.getProxyId();\n address currentAssetProxy = assetProxies[assetProxyId];\n require(\n currentAssetProxy == address(0),\n \"ASSET_PROXY_ALREADY_EXISTS\"\n );\n\n // Add asset proxy and log registration.\n assetProxies[assetProxyId] = assetProxyContract;\n emit AssetProxyRegistered(\n assetProxyId,\n assetProxy\n );\n }\n\n /// @dev Gets an asset proxy.\n /// @param assetProxyId Id of the asset proxy.\n /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered.\n function getAssetProxy(bytes4 assetProxyId)\n external\n view\n returns (address)\n {\n return assetProxies[assetProxyId];\n }\n\n /// @dev Forwards arguments to assetProxy and calls `transferFrom`. Either succeeds or throws.\n /// @param assetData Byte array encoded for the asset.\n /// @param from Address to transfer token from.\n /// @param to Address to transfer token to.\n /// @param amount Amount of token to transfer.\n function dispatchTransferFrom(\n bytes memory assetData,\n address from,\n address to,\n uint256 amount\n )\n internal\n {\n // Do nothing if no amount should be transferred.\n if (amount > 0 && from != to) {\n // Ensure assetData length is valid\n require(\n assetData.length > 3,\n \"LENGTH_GREATER_THAN_3_REQUIRED\"\n );\n \n // Lookup assetProxy. We do not use `LibBytes.readBytes4` for gas efficiency reasons.\n bytes4 assetProxyId;\n assembly {\n assetProxyId := and(mload(\n add(assetData, 32)),\n 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000\n )\n }\n address assetProxy = assetProxies[assetProxyId];\n\n // Ensure that assetProxy exists\n require(\n assetProxy != address(0),\n \"ASSET_PROXY_DOES_NOT_EXIST\"\n );\n \n // We construct calldata for the `assetProxy.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n // \n // | Area | Offset | Length | Contents |\n // | -------- |--------|---------|-------------------------------------------- |\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n\n assembly {\n /////// Setup State ///////\n // `cdStart` is the start of the calldata for `assetProxy.transferFrom` (equal to free memory ptr).\n let cdStart := mload(64)\n // `dataAreaLength` is the total number of words needed to store `assetData`\n // As-per the ABI spec, this value is padded up to the nearest multiple of 32,\n // and includes 32-bytes for length.\n let dataAreaLength := and(add(mload(assetData), 63), 0xFFFFFFFFFFFE0)\n // `cdEnd` is the end of the calldata for `assetProxy.transferFrom`.\n let cdEnd := add(cdStart, add(132, dataAreaLength))\n\n \n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFromSelector`.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n mstore(cdStart, 0xa85e59e400000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // Each parameter is padded to 32-bytes. The entire Params Area is 128 bytes.\n // Notes:\n // 1. The offset to `assetData` is the length of the Params Area (128 bytes).\n // 2. A 20-byte mask is applied to addresses to zero-out the unused bytes.\n mstore(add(cdStart, 4), 128)\n mstore(add(cdStart, 36), and(from, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(cdStart, 68), and(to, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(cdStart, 100), amount)\n \n /////// Setup Data Area ///////\n // This area holds `assetData`.\n let dataArea := add(cdStart, 132)\n // solhint-disable-next-line no-empty-blocks\n for {} lt(dataArea, cdEnd) {} {\n mstore(dataArea, mload(assetData))\n dataArea := add(dataArea, 32)\n assetData := add(assetData, 32)\n }\n\n /////// Call `assetProxy.transferFrom` using the constructed calldata ///////\n let success := call(\n gas, // forward all gas\n assetProxy, // call address of asset proxy\n 0, // don't send any ETH\n cdStart, // pointer to start of input\n sub(cdEnd, cdStart), // length of input \n cdStart, // write output over input\n 512 // reserve 512 bytes for output\n )\n if iszero(success) {\n revert(cdStart, returndatasize())\n }\n }\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\n\n\ncontract MixinExchangeCore is\n ReentrancyGuard,\n LibConstants,\n LibMath,\n LibOrder,\n LibFillResults,\n MAssetProxyDispatcher,\n MExchangeCore,\n MSignatureValidator,\n MTransactions\n{\n // Mapping of orderHash => amount of takerAsset already bought by maker\n mapping (bytes32 => uint256) public filled;\n\n // Mapping of orderHash => cancelled\n mapping (bytes32 => bool) public cancelled;\n\n // Mapping of makerAddress => senderAddress => lowest salt an order can have in order to be fillable\n // Orders with specified senderAddress and with a salt less than their epoch are considered cancelled\n mapping (address => mapping (address => uint256)) public orderEpoch;\n\n /// @dev Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch\n /// and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress).\n /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled.\n function cancelOrdersUpTo(uint256 targetOrderEpoch)\n external\n nonReentrant\n {\n address makerAddress = getCurrentContextAddress();\n // If this function is called via `executeTransaction`, we only update the orderEpoch for the makerAddress/msg.sender combination.\n // This allows external filter contracts to add rules to how orders are cancelled via this function.\n address senderAddress = makerAddress == msg.sender ? address(0) : msg.sender;\n\n // orderEpoch is initialized to 0, so to cancelUpTo we need salt + 1\n uint256 newOrderEpoch = targetOrderEpoch + 1; \n uint256 oldOrderEpoch = orderEpoch[makerAddress][senderAddress];\n\n // Ensure orderEpoch is monotonically increasing\n require(\n newOrderEpoch > oldOrderEpoch, \n \"INVALID_NEW_ORDER_EPOCH\"\n );\n\n // Update orderEpoch\n orderEpoch[makerAddress][senderAddress] = newOrderEpoch;\n emit CancelUpTo(\n makerAddress,\n senderAddress,\n newOrderEpoch\n );\n }\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrder(\n Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n nonReentrant\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n return fillResults;\n }\n\n /// @dev After calling, the order can not be filled anymore.\n /// Throws if order is invalid or sender does not have permission to cancel.\n /// @param order Order to cancel. Order must be OrderStatus.FILLABLE.\n function cancelOrder(Order memory order)\n public\n nonReentrant\n {\n cancelOrderInternal(order);\n }\n\n /// @dev Gets information about an order: status, hash, and amount filled.\n /// @param order Order to gather information on.\n /// @return OrderInfo Information about the order and its state.\n /// See LibOrder.OrderInfo for a complete description.\n function getOrderInfo(Order memory order)\n public\n view\n returns (OrderInfo memory orderInfo)\n {\n // Compute the order hash\n orderInfo.orderHash = getOrderHash(order);\n\n // Fetch filled amount\n orderInfo.orderTakerAssetFilledAmount = filled[orderInfo.orderHash];\n\n // If order.makerAssetAmount is zero, we also reject the order.\n // While the Exchange contract handles them correctly, they create\n // edge cases in the supporting infrastructure because they have\n // an 'infinite' price when computed by a simple division.\n if (order.makerAssetAmount == 0) {\n orderInfo.orderStatus = uint8(OrderStatus.INVALID_MAKER_ASSET_AMOUNT);\n return orderInfo;\n }\n\n // If order.takerAssetAmount is zero, then the order will always\n // be considered filled because 0 == takerAssetAmount == orderTakerAssetFilledAmount\n // Instead of distinguishing between unfilled and filled zero taker\n // amount orders, we choose not to support them.\n if (order.takerAssetAmount == 0) {\n orderInfo.orderStatus = uint8(OrderStatus.INVALID_TAKER_ASSET_AMOUNT);\n return orderInfo;\n }\n\n // Validate order availability\n if (orderInfo.orderTakerAssetFilledAmount >= order.takerAssetAmount) {\n orderInfo.orderStatus = uint8(OrderStatus.FULLY_FILLED);\n return orderInfo;\n }\n\n // Validate order expiration\n // solhint-disable-next-line not-rely-on-time\n if (block.timestamp >= order.expirationTimeSeconds) {\n orderInfo.orderStatus = uint8(OrderStatus.EXPIRED);\n return orderInfo;\n }\n\n // Check if order has been cancelled\n if (cancelled[orderInfo.orderHash]) {\n orderInfo.orderStatus = uint8(OrderStatus.CANCELLED);\n return orderInfo;\n }\n if (orderEpoch[order.makerAddress][order.senderAddress] > order.salt) {\n orderInfo.orderStatus = uint8(OrderStatus.CANCELLED);\n return orderInfo;\n }\n\n // All other statuses are ruled out: order is Fillable\n orderInfo.orderStatus = uint8(OrderStatus.FILLABLE);\n return orderInfo;\n }\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderInternal(\n Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n // Fetch order info\n OrderInfo memory orderInfo = getOrderInfo(order);\n\n // Fetch taker address\n address takerAddress = getCurrentContextAddress();\n \n // Assert that the order is fillable by taker\n assertFillableOrder(\n order,\n orderInfo,\n takerAddress,\n signature\n );\n \n // Get amount of takerAsset to fill\n uint256 remainingTakerAssetAmount = safeSub(order.takerAssetAmount, orderInfo.orderTakerAssetFilledAmount);\n uint256 takerAssetFilledAmount = min256(takerAssetFillAmount, remainingTakerAssetAmount);\n\n // Validate context\n assertValidFill(\n order,\n orderInfo,\n takerAssetFillAmount,\n takerAssetFilledAmount,\n fillResults.makerAssetFilledAmount\n );\n\n // Compute proportional fill amounts\n fillResults = calculateFillResults(order, takerAssetFilledAmount);\n\n // Update exchange internal state\n updateFilledState(\n order,\n takerAddress,\n orderInfo.orderHash,\n orderInfo.orderTakerAssetFilledAmount,\n fillResults\n );\n \n // Settle order\n settleOrder(\n order,\n takerAddress,\n fillResults\n );\n\n return fillResults;\n }\n\n /// @dev After calling, the order can not be filled anymore.\n /// Throws if order is invalid or sender does not have permission to cancel.\n /// @param order Order to cancel. Order must be OrderStatus.FILLABLE.\n function cancelOrderInternal(Order memory order)\n internal\n {\n // Fetch current order status\n OrderInfo memory orderInfo = getOrderInfo(order);\n\n // Validate context\n assertValidCancel(order, orderInfo);\n\n // Perform cancel\n updateCancelledState(order, orderInfo.orderHash);\n }\n\n /// @dev Updates state with results of a fill order.\n /// @param order that was filled.\n /// @param takerAddress Address of taker who filled the order.\n /// @param orderTakerAssetFilledAmount Amount of order already filled.\n function updateFilledState(\n Order memory order,\n address takerAddress,\n bytes32 orderHash,\n uint256 orderTakerAssetFilledAmount,\n FillResults memory fillResults\n )\n internal\n {\n // Update state\n filled[orderHash] = safeAdd(orderTakerAssetFilledAmount, fillResults.takerAssetFilledAmount);\n\n // Log order\n emit Fill(\n order.makerAddress,\n order.feeRecipientAddress,\n takerAddress,\n msg.sender,\n fillResults.makerAssetFilledAmount,\n fillResults.takerAssetFilledAmount,\n fillResults.makerFeePaid,\n fillResults.takerFeePaid,\n orderHash,\n order.makerAssetData,\n order.takerAssetData\n );\n }\n\n /// @dev Updates state with results of cancelling an order.\n /// State is only updated if the order is currently fillable.\n /// Otherwise, updating state would have no effect.\n /// @param order that was cancelled.\n /// @param orderHash Hash of order that was cancelled.\n function updateCancelledState(\n Order memory order,\n bytes32 orderHash\n )\n internal\n {\n // Perform cancel\n cancelled[orderHash] = true;\n\n // Log cancel\n emit Cancel(\n order.makerAddress,\n order.feeRecipientAddress,\n msg.sender,\n orderHash,\n order.makerAssetData,\n order.takerAssetData\n );\n }\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAddress Address of order taker.\n /// @param signature Proof that the orders was created by its maker.\n function assertFillableOrder(\n Order memory order,\n OrderInfo memory orderInfo,\n address takerAddress,\n bytes memory signature\n )\n internal\n view\n {\n // An order can only be filled if its status is FILLABLE.\n require(\n orderInfo.orderStatus == uint8(OrderStatus.FILLABLE),\n \"ORDER_UNFILLABLE\"\n );\n \n // Validate sender is allowed to fill this order\n if (order.senderAddress != address(0)) {\n require(\n order.senderAddress == msg.sender,\n \"INVALID_SENDER\"\n );\n }\n \n // Validate taker is allowed to fill this order\n if (order.takerAddress != address(0)) {\n require(\n order.takerAddress == takerAddress,\n \"INVALID_TAKER\"\n );\n }\n \n // Validate Maker signature (check only if first time seen)\n if (orderInfo.orderTakerAssetFilledAmount == 0) {\n require(\n isValidSignature(\n orderInfo.orderHash,\n order.makerAddress,\n signature\n ),\n \"INVALID_ORDER_SIGNATURE\"\n );\n }\n }\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAssetFillAmount Desired amount of order to fill by taker.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @param makerAssetFilledAmount Amount of makerAsset that will be transfered.\n function assertValidFill(\n Order memory order,\n OrderInfo memory orderInfo,\n uint256 takerAssetFillAmount, // TODO: use FillResults\n uint256 takerAssetFilledAmount,\n uint256 makerAssetFilledAmount\n )\n internal\n view\n {\n // Revert if fill amount is invalid\n // TODO: reconsider necessity for v2.1\n require(\n takerAssetFillAmount != 0,\n \"INVALID_TAKER_AMOUNT\"\n );\n \n // Make sure taker does not pay more than desired amount\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n takerAssetFilledAmount <= takerAssetFillAmount,\n \"TAKER_OVERPAY\"\n );\n \n // Make sure order is not overfilled\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n safeAdd(orderInfo.orderTakerAssetFilledAmount, takerAssetFilledAmount) <= order.takerAssetAmount,\n \"ORDER_OVERFILL\"\n );\n \n // Make sure order is filled at acceptable price.\n // The order has an implied price from the makers perspective:\n // order price = order.makerAssetAmount / order.takerAssetAmount\n // i.e. the number of makerAsset maker is paying per takerAsset. The\n // maker is guaranteed to get this price or a better (lower) one. The\n // actual price maker is getting in this fill is:\n // fill price = makerAssetFilledAmount / takerAssetFilledAmount\n // We need `fill price <= order price` for the fill to be fair to maker.\n // This amounts to:\n // makerAssetFilledAmount order.makerAssetAmount\n // ------------------------ <= -----------------------\n // takerAssetFilledAmount order.takerAssetAmount\n // or, equivalently:\n // makerAssetFilledAmount * order.takerAssetAmount <=\n // order.makerAssetAmount * takerAssetFilledAmount\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n safeMul(makerAssetFilledAmount, order.takerAssetAmount)\n <= \n safeMul(order.makerAssetAmount, takerAssetFilledAmount),\n \"INVALID_FILL_PRICE\"\n );\n }\n\n /// @dev Validates context for cancelOrder. Succeeds or throws.\n /// @param order to be cancelled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n function assertValidCancel(\n Order memory order,\n OrderInfo memory orderInfo\n )\n internal\n view\n {\n // Ensure order is valid\n // An order can only be cancelled if its status is FILLABLE.\n require(\n orderInfo.orderStatus == uint8(OrderStatus.FILLABLE),\n \"ORDER_UNFILLABLE\"\n );\n\n // Validate sender is allowed to cancel this order\n if (order.senderAddress != address(0)) {\n require(\n order.senderAddress == msg.sender,\n \"INVALID_SENDER\"\n );\n }\n\n // Validate transaction signed by maker\n address makerAddress = getCurrentContextAddress();\n require(\n order.makerAddress == makerAddress,\n \"INVALID_MAKER\"\n );\n }\n\n /// @dev Calculates amounts filled and fees paid by maker and taker.\n /// @param order to be filled.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function calculateFillResults(\n Order memory order,\n uint256 takerAssetFilledAmount\n )\n internal\n pure\n returns (FillResults memory fillResults)\n {\n // Compute proportional transfer amounts\n fillResults.takerAssetFilledAmount = takerAssetFilledAmount;\n fillResults.makerAssetFilledAmount = safeGetPartialAmountFloor(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.makerAssetAmount\n );\n fillResults.makerFeePaid = safeGetPartialAmountFloor(\n fillResults.makerAssetFilledAmount,\n order.makerAssetAmount,\n order.makerFee\n );\n fillResults.takerFeePaid = safeGetPartialAmountFloor(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.takerFee\n );\n\n return fillResults;\n }\n\n /// @dev Settles an order by transferring assets between counterparties.\n /// @param order Order struct containing order specifications.\n /// @param takerAddress Address selling takerAsset and buying makerAsset.\n /// @param fillResults Amounts to be filled and fees paid by maker and taker.\n function settleOrder(\n LibOrder.Order memory order,\n address takerAddress,\n LibFillResults.FillResults memory fillResults\n )\n private\n {\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n dispatchTransferFrom(\n order.makerAssetData,\n order.makerAddress,\n takerAddress,\n fillResults.makerAssetFilledAmount\n );\n dispatchTransferFrom(\n order.takerAssetData,\n takerAddress,\n order.makerAddress,\n fillResults.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n zrxAssetData,\n order.makerAddress,\n order.feeRecipientAddress,\n fillResults.makerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n order.feeRecipientAddress,\n fillResults.takerFeePaid\n );\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinMatchOrders.sol": "/*\n Copyright 2018 ZeroEx Intl.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n http://www.apache.org/licenses/LICENSE-2.0\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MMatchOrders.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\n\n\ncontract MixinMatchOrders is\n ReentrancyGuard,\n LibConstants,\n LibMath,\n MAssetProxyDispatcher,\n MExchangeCore,\n MMatchOrders,\n MTransactions\n{\n /// @dev Match two complementary orders that have a profitable spread.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the left order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftSignature Proof that order was created by the left maker.\n /// @param rightSignature Proof that order was created by the right maker.\n /// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.\n function matchOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n bytes memory leftSignature,\n bytes memory rightSignature\n )\n public\n nonReentrant\n returns (LibFillResults.MatchedFillResults memory matchedFillResults)\n {\n // We assume that rightOrder.takerAssetData == leftOrder.makerAssetData and rightOrder.makerAssetData == leftOrder.takerAssetData.\n // If this assumption isn't true, the match will fail at signature validation.\n rightOrder.makerAssetData = leftOrder.takerAssetData;\n rightOrder.takerAssetData = leftOrder.makerAssetData;\n\n // Get left & right order info\n LibOrder.OrderInfo memory leftOrderInfo = getOrderInfo(leftOrder);\n LibOrder.OrderInfo memory rightOrderInfo = getOrderInfo(rightOrder);\n\n // Fetch taker address\n address takerAddress = getCurrentContextAddress();\n \n // Either our context is valid or we revert\n assertFillableOrder(\n leftOrder,\n leftOrderInfo,\n takerAddress,\n leftSignature\n );\n assertFillableOrder(\n rightOrder,\n rightOrderInfo,\n takerAddress,\n rightSignature\n );\n assertValidMatch(leftOrder, rightOrder);\n\n // Compute proportional fill amounts\n matchedFillResults = calculateMatchedFillResults(\n leftOrder,\n rightOrder,\n leftOrderInfo.orderTakerAssetFilledAmount,\n rightOrderInfo.orderTakerAssetFilledAmount\n );\n\n // Validate fill contexts\n assertValidFill(\n leftOrder,\n leftOrderInfo,\n matchedFillResults.left.takerAssetFilledAmount,\n matchedFillResults.left.takerAssetFilledAmount,\n matchedFillResults.left.makerAssetFilledAmount\n );\n assertValidFill(\n rightOrder,\n rightOrderInfo,\n matchedFillResults.right.takerAssetFilledAmount,\n matchedFillResults.right.takerAssetFilledAmount,\n matchedFillResults.right.makerAssetFilledAmount\n );\n \n // Update exchange state\n updateFilledState(\n leftOrder,\n takerAddress,\n leftOrderInfo.orderHash,\n leftOrderInfo.orderTakerAssetFilledAmount,\n matchedFillResults.left\n );\n updateFilledState(\n rightOrder,\n takerAddress,\n rightOrderInfo.orderHash,\n rightOrderInfo.orderTakerAssetFilledAmount,\n matchedFillResults.right\n );\n\n // Settle matched orders. Succeeds or throws.\n settleMatchedOrders(\n leftOrder,\n rightOrder,\n takerAddress,\n matchedFillResults\n );\n\n return matchedFillResults;\n }\n\n /// @dev Validates context for matchOrders. Succeeds or throws.\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n function assertValidMatch(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder\n )\n internal\n pure\n {\n // Make sure there is a profitable spread.\n // There is a profitable spread iff the cost per unit bought (OrderA.MakerAmount/OrderA.TakerAmount) for each order is greater\n // than the profit per unit sold of the matched order (OrderB.TakerAmount/OrderB.MakerAmount).\n // This is satisfied by the equations below:\n // <leftOrder.makerAssetAmount> / <leftOrder.takerAssetAmount> >= <rightOrder.takerAssetAmount> / <rightOrder.makerAssetAmount>\n // AND\n // <rightOrder.makerAssetAmount> / <rightOrder.takerAssetAmount> >= <leftOrder.takerAssetAmount> / <leftOrder.makerAssetAmount>\n // These equations can be combined to get the following:\n require(\n safeMul(leftOrder.makerAssetAmount, rightOrder.makerAssetAmount) >=\n safeMul(leftOrder.takerAssetAmount, rightOrder.takerAssetAmount),\n \"NEGATIVE_SPREAD_REQUIRED\"\n );\n }\n\n /// @dev Calculates fill amounts for the matched orders.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the leftOrder order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftOrderTakerAssetFilledAmount Amount of left order already filled.\n /// @param rightOrderTakerAssetFilledAmount Amount of right order already filled.\n /// @param matchedFillResults Amounts to fill and fees to pay by maker and taker of matched orders.\n function calculateMatchedFillResults(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n uint256 leftOrderTakerAssetFilledAmount,\n uint256 rightOrderTakerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.MatchedFillResults memory matchedFillResults)\n {\n // Derive maker asset amounts for left & right orders, given store taker assert amounts\n uint256 leftTakerAssetAmountRemaining = safeSub(leftOrder.takerAssetAmount, leftOrderTakerAssetFilledAmount);\n uint256 leftMakerAssetAmountRemaining = safeGetPartialAmountFloor(\n leftOrder.makerAssetAmount,\n leftOrder.takerAssetAmount,\n leftTakerAssetAmountRemaining\n );\n uint256 rightTakerAssetAmountRemaining = safeSub(rightOrder.takerAssetAmount, rightOrderTakerAssetFilledAmount);\n uint256 rightMakerAssetAmountRemaining = safeGetPartialAmountFloor(\n rightOrder.makerAssetAmount,\n rightOrder.takerAssetAmount,\n rightTakerAssetAmountRemaining\n );\n\n // Calculate fill results for maker and taker assets: at least one order will be fully filled.\n // The maximum amount the left maker can buy is `leftTakerAssetAmountRemaining`\n // The maximum amount the right maker can sell is `rightMakerAssetAmountRemaining`\n // We have two distinct cases for calculating the fill results:\n // Case 1.\n // If the left maker can buy more than the right maker can sell, then only the right order is fully filled.\n // If the left maker can buy exactly what the right maker can sell, then both orders are fully filled.\n // Case 2.\n // If the left maker cannot buy more than the right maker can sell, then only the left order is fully filled.\n if (leftTakerAssetAmountRemaining >= rightMakerAssetAmountRemaining) {\n // Case 1: Right order is fully filled\n matchedFillResults.right.makerAssetFilledAmount = rightMakerAssetAmountRemaining;\n matchedFillResults.right.takerAssetFilledAmount = rightTakerAssetAmountRemaining;\n matchedFillResults.left.takerAssetFilledAmount = matchedFillResults.right.makerAssetFilledAmount;\n // Round down to ensure the maker's exchange rate does not exceed the price specified by the order. \n // We favor the maker when the exchange rate must be rounded.\n matchedFillResults.left.makerAssetFilledAmount = safeGetPartialAmountFloor(\n leftOrder.makerAssetAmount,\n leftOrder.takerAssetAmount,\n matchedFillResults.left.takerAssetFilledAmount\n );\n } else {\n // Case 2: Left order is fully filled\n matchedFillResults.left.makerAssetFilledAmount = leftMakerAssetAmountRemaining;\n matchedFillResults.left.takerAssetFilledAmount = leftTakerAssetAmountRemaining;\n matchedFillResults.right.makerAssetFilledAmount = matchedFillResults.left.takerAssetFilledAmount;\n // Round up to ensure the maker's exchange rate does not exceed the price specified by the order.\n // We favor the maker when the exchange rate must be rounded.\n matchedFillResults.right.takerAssetFilledAmount = safeGetPartialAmountCeil(\n rightOrder.takerAssetAmount,\n rightOrder.makerAssetAmount,\n matchedFillResults.right.makerAssetFilledAmount\n );\n }\n\n // Calculate amount given to taker\n matchedFillResults.leftMakerAssetSpreadAmount = safeSub(\n matchedFillResults.left.makerAssetFilledAmount,\n matchedFillResults.right.takerAssetFilledAmount\n );\n\n // Compute fees for left order\n matchedFillResults.left.makerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.left.makerAssetFilledAmount,\n leftOrder.makerAssetAmount,\n leftOrder.makerFee\n );\n matchedFillResults.left.takerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.left.takerAssetFilledAmount,\n leftOrder.takerAssetAmount,\n leftOrder.takerFee\n );\n\n // Compute fees for right order\n matchedFillResults.right.makerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.right.makerAssetFilledAmount,\n rightOrder.makerAssetAmount,\n rightOrder.makerFee\n );\n matchedFillResults.right.takerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.right.takerAssetFilledAmount,\n rightOrder.takerAssetAmount,\n rightOrder.takerFee\n );\n\n // Return fill results\n return matchedFillResults;\n }\n\n /// @dev Settles matched order by transferring appropriate funds between order makers, taker, and fee recipient.\n /// @param leftOrder First matched order.\n /// @param rightOrder Second matched order.\n /// @param takerAddress Address that matched the orders. The taker receives the spread between orders as profit.\n /// @param matchedFillResults Struct holding amounts to transfer between makers, taker, and fee recipients.\n function settleMatchedOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n address takerAddress,\n LibFillResults.MatchedFillResults memory matchedFillResults\n )\n private\n {\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n // Order makers and taker\n dispatchTransferFrom(\n leftOrder.makerAssetData,\n leftOrder.makerAddress,\n rightOrder.makerAddress,\n matchedFillResults.right.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n rightOrder.makerAssetData,\n rightOrder.makerAddress,\n leftOrder.makerAddress,\n matchedFillResults.left.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n leftOrder.makerAssetData,\n leftOrder.makerAddress,\n takerAddress,\n matchedFillResults.leftMakerAssetSpreadAmount\n );\n\n // Maker fees\n dispatchTransferFrom(\n zrxAssetData,\n leftOrder.makerAddress,\n leftOrder.feeRecipientAddress,\n matchedFillResults.left.makerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n rightOrder.makerAddress,\n rightOrder.feeRecipientAddress,\n matchedFillResults.right.makerFeePaid\n );\n\n // Taker fees\n if (leftOrder.feeRecipientAddress == rightOrder.feeRecipientAddress) {\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n leftOrder.feeRecipientAddress,\n safeAdd(\n matchedFillResults.left.takerFeePaid,\n matchedFillResults.right.takerFeePaid\n )\n );\n } else {\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n leftOrder.feeRecipientAddress,\n matchedFillResults.left.takerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n rightOrder.feeRecipientAddress,\n matchedFillResults.right.takerFeePaid\n );\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinSignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./interfaces/IWallet.sol\";\nimport \"./interfaces/IValidator.sol\";\n\n\ncontract MixinSignatureValidator is\n ReentrancyGuard,\n MSignatureValidator,\n MTransactions\n{\n using LibBytes for bytes;\n \n // Mapping of hash => signer => signed\n mapping (bytes32 => mapping (address => bool)) public preSigned;\n\n // Mapping of signer => validator => approved\n mapping (address => mapping (address => bool)) public allowedValidators;\n\n /// @dev Approves a hash on-chain using any valid signature type.\n /// After presigning a hash, the preSign signature type will become valid for that hash and signer.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n function preSign(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external\n {\n if (signerAddress != msg.sender) {\n require(\n isValidSignature(\n hash,\n signerAddress,\n signature\n ),\n \"INVALID_SIGNATURE\"\n );\n }\n preSigned[hash][signerAddress] = true;\n }\n\n /// @dev Approves/unnapproves a Validator contract to verify signatures on signer's behalf.\n /// @param validatorAddress Address of Validator contract.\n /// @param approval Approval or disapproval of Validator contract.\n function setSignatureValidatorApproval(\n address validatorAddress,\n bool approval\n )\n external\n nonReentrant\n {\n address signerAddress = getCurrentContextAddress();\n allowedValidators[signerAddress][validatorAddress] = approval;\n emit SignatureValidatorApproval(\n signerAddress,\n validatorAddress,\n approval\n );\n }\n\n /// @dev Verifies that a hash has been signed by the given signer.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes memory signature\n )\n public\n view\n returns (bool isValid)\n {\n require(\n signature.length > 0,\n \"LENGTH_GREATER_THAN_0_REQUIRED\"\n );\n\n // Pop last byte off of signature byte array.\n uint8 signatureTypeRaw = uint8(signature.popLastByte());\n\n // Ensure signature is supported\n require(\n signatureTypeRaw < uint8(SignatureType.NSignatureTypes),\n \"SIGNATURE_UNSUPPORTED\"\n );\n\n SignatureType signatureType = SignatureType(signatureTypeRaw);\n\n // Variables are not scoped in Solidity.\n uint8 v;\n bytes32 r;\n bytes32 s;\n address recovered;\n\n // Always illegal signature.\n // This is always an implicit option since a signer can create a\n // signature array with invalid type or length. We may as well make\n // it an explicit option. This aids testing and analysis. It is\n // also the initialization value for the enum type.\n if (signatureType == SignatureType.Illegal) {\n revert(\"SIGNATURE_ILLEGAL\");\n\n // Always invalid signature.\n // Like Illegal, this is always implicitly available and therefore\n // offered explicitly. It can be implicitly created by providing\n // a correctly formatted but incorrect signature.\n } else if (signatureType == SignatureType.Invalid) {\n require(\n signature.length == 0,\n \"LENGTH_0_REQUIRED\"\n );\n isValid = false;\n return isValid;\n\n // Signature using EIP712\n } else if (signatureType == SignatureType.EIP712) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n hash,\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n\n // Signed using web3.eth_sign\n } else if (signatureType == SignatureType.EthSign) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n keccak256(abi.encodePacked(\n \"\\x19Ethereum Signed Message:\\n32\",\n hash\n )),\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n\n // Signature verified by wallet contract.\n // If used with an order, the maker of the order is the wallet contract.\n } else if (signatureType == SignatureType.Wallet) {\n isValid = isValidWalletSignature(\n hash,\n signerAddress,\n signature\n );\n return isValid;\n\n // Signature verified by validator contract.\n // If used with an order, the maker of the order can still be an EOA.\n // A signature using this type should be encoded as:\n // | Offset | Length | Contents |\n // | 0x00 | x | Signature to validate |\n // | 0x00 + x | 20 | Address of validator contract |\n // | 0x14 + x | 1 | Signature type is always \"\\x06\" |\n } else if (signatureType == SignatureType.Validator) {\n // Pop last 20 bytes off of signature byte array.\n address validatorAddress = signature.popLast20Bytes();\n \n // Ensure signer has approved validator.\n if (!allowedValidators[signerAddress][validatorAddress]) {\n return false;\n }\n isValid = isValidValidatorSignature(\n validatorAddress,\n hash,\n signerAddress,\n signature\n );\n return isValid;\n\n // Signer signed hash previously using the preSign function.\n } else if (signatureType == SignatureType.PreSigned) {\n isValid = preSigned[hash][signerAddress];\n return isValid;\n }\n\n // Anything else is illegal (We do not return false because\n // the signature may actually be valid, just not in a format\n // that we currently support. In this case returning false\n // may lead the caller to incorrectly believe that the\n // signature was invalid.)\n revert(\"SIGNATURE_UNSUPPORTED\");\n }\n\n /// @dev Verifies signature using logic defined by Wallet contract.\n /// @param hash Any 32 byte hash.\n /// @param walletAddress Address that should have signed the given hash\n /// and defines its own signature verification method.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if signature is valid for given wallet..\n function isValidWalletSignature(\n bytes32 hash,\n address walletAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid)\n {\n bytes memory calldata = abi.encodeWithSelector(\n IWallet(walletAddress).isValidSignature.selector,\n hash,\n signature\n );\n assembly {\n let cdStart := add(calldata, 32)\n let success := staticcall(\n gas, // forward all gas\n walletAddress, // address of Wallet contract\n cdStart, // pointer to start of input\n mload(calldata), // length of input\n cdStart, // write output over input\n 32 // output size is 32 bytes\n )\n\n switch success\n case 0 {\n // Revert with `Error(\"WALLET_ERROR\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000c57414c4c45545f4552524f5200000000000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n case 1 {\n // Signature is valid if call did not revert and returned true\n isValid := mload(cdStart)\n }\n }\n return isValid;\n }\n\n /// @dev Verifies signature using logic defined by Validator contract.\n /// @param validatorAddress Address of validator contract.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidValidatorSignature(\n address validatorAddress,\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid)\n {\n bytes memory calldata = abi.encodeWithSelector(\n IValidator(signerAddress).isValidSignature.selector,\n hash,\n signerAddress,\n signature\n );\n assembly {\n let cdStart := add(calldata, 32)\n let success := staticcall(\n gas, // forward all gas\n validatorAddress, // address of Validator contract\n cdStart, // pointer to start of input\n mload(calldata), // length of input\n cdStart, // write output over input\n 32 // output size is 32 bytes\n )\n\n switch success\n case 0 {\n // Revert with `Error(\"VALIDATOR_ERROR\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f56414c494441544f525f4552524f5200000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n case 1 {\n // Signature is valid if call did not revert and returned true\n isValid := mload(cdStart)\n }\n }\n return isValid;\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinTransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\nimport \"./libs/LibExchangeErrors.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./libs/LibEIP712.sol\";\n\n\ncontract MixinTransactions is\n LibEIP712,\n MSignatureValidator,\n MTransactions\n{\n // Mapping of transaction hash => executed\n // This prevents transactions from being executed more than once.\n mapping (bytes32 => bool) public transactions;\n\n // Address of current transaction signer\n address public currentContextAddress;\n\n /// @dev Executes an exchange method call in the context of signer.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @param signature Proof of signer transaction by signer.\n function executeTransaction(\n uint256 salt,\n address signerAddress,\n bytes data,\n bytes signature\n )\n external\n {\n // Prevent reentrancy\n require(\n currentContextAddress == address(0),\n \"REENTRANCY_ILLEGAL\"\n );\n\n bytes32 transactionHash = hashEIP712Message(hashZeroExTransaction(\n salt,\n signerAddress,\n data\n ));\n\n // Validate transaction has not been executed\n require(\n !transactions[transactionHash],\n \"INVALID_TX_HASH\"\n );\n\n // Transaction always valid if signer is sender of transaction\n if (signerAddress != msg.sender) {\n // Validate signature\n require(\n isValidSignature(\n transactionHash,\n signerAddress,\n signature\n ),\n \"INVALID_TX_SIGNATURE\"\n );\n\n // Set the current transaction signer\n currentContextAddress = signerAddress;\n }\n\n // Execute transaction\n transactions[transactionHash] = true;\n require(\n address(this).delegatecall(data),\n \"FAILED_EXECUTION\"\n );\n\n // Reset current transaction signer if it was previously updated\n if (signerAddress != msg.sender) {\n currentContextAddress = address(0);\n }\n }\n\n /// @dev Calculates EIP712 hash of the Transaction.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @return EIP712 hash of the Transaction.\n function hashZeroExTransaction(\n uint256 salt,\n address signerAddress,\n bytes memory data\n )\n internal\n pure\n returns (bytes32 result)\n {\n bytes32 schemaHash = EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH;\n bytes32 dataHash = keccak256(data);\n\n // Assembly for more efficiently computing:\n // keccak256(abi.encodePacked(\n // EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH,\n // salt,\n // bytes32(signerAddress),\n // keccak256(data)\n // ));\n\n assembly {\n // Load free memory pointer\n let memPtr := mload(64)\n\n mstore(memPtr, schemaHash) // hash of schema\n mstore(add(memPtr, 32), salt) // salt\n mstore(add(memPtr, 64), and(signerAddress, 0xffffffffffffffffffffffffffffffffffffffff)) // signerAddress\n mstore(add(memPtr, 96), dataHash) // hash of data\n\n // Compute hash\n result := keccak256(memPtr, 128)\n }\n return result;\n }\n\n /// @dev The current function will be called in the context of this address (either 0x transaction signer or `msg.sender`).\n /// If calling a fill function, this address will represent the taker.\n /// If calling a cancel function, this address will represent the maker.\n /// @return Signer of 0x transaction if entry point is `executeTransaction`.\n /// `msg.sender` if entry point is any other function.\n function getCurrentContextAddress()\n internal\n view\n returns (address)\n {\n address currentContextAddress_ = currentContextAddress;\n address contextAddress = currentContextAddress_ == address(0) ? msg.sender : currentContextAddress_;\n return contextAddress;\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./libs/LibAbiEncoder.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MWrapperFunctions.sol\";\n\n\ncontract MixinWrapperFunctions is\n ReentrancyGuard,\n LibMath,\n LibFillResults,\n LibAbiEncoder,\n MExchangeCore,\n MWrapperFunctions\n{\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n nonReentrant\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrKillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n return fillResults;\n }\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (FillResults memory fillResults)\n {\n // ABI encode calldata for `fillOrder`\n bytes memory fillOrderCalldata = abiEncodeFillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n\n // Delegate to `fillOrder` and handle any exceptions gracefully\n assembly {\n let success := delegatecall(\n gas, // forward all gas\n address, // call address of this contract\n add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes)\n mload(fillOrderCalldata), // length of input\n fillOrderCalldata, // write output over input\n 128 // output size is 128 bytes\n )\n if success {\n mstore(fillResults, mload(fillOrderCalldata))\n mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32)))\n mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64)))\n mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96)))\n }\n }\n // fillResults values will be 0 by default if call was unsuccessful\n return fillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrKill.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrKillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrKillOrderInternal(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrders(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n bytes memory takerAssetData = orders[0].takerAssetData;\n \n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being sold by taker is the same for each order.\n // Rather than passing this in as calldata, we use the takerAssetData from the first order in all later orders.\n orders[i].takerAssetData = takerAssetData;\n\n // Calculate the remaining amount of takerAsset to sell\n uint256 remainingTakerAssetFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= takerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory takerAssetData = orders[0].takerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being sold by taker is the same for each order.\n // Rather than passing this in as calldata, we use the takerAssetData from the first order in all later orders.\n orders[i].takerAssetData = takerAssetData;\n\n // Calculate the remaining amount of takerAsset to sell\n uint256 remainingTakerAssetFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= takerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerAsset is bought by taker.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrders(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // Rather than passing this in as calldata, we copy the makerAssetData from the first order onto all later orders.\n orders[i].makerAssetData = makerAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n if (totalFillResults.makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // Rather than passing this in as calldata, we copy the makerAssetData from the first order onto all later orders.\n orders[i].makerAssetData = makerAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n if (totalFillResults.makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously cancels multiple orders in a single transaction.\n /// @param orders Array of order specifications.\n function batchCancelOrders(LibOrder.Order[] memory orders)\n public\n nonReentrant\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n cancelOrderInternal(orders[i]);\n }\n }\n\n /// @dev Fetches information for all passed in orders.\n /// @param orders Array of order specifications.\n /// @return Array of OrderInfo instances that correspond to each order.\n function getOrdersInfo(LibOrder.Order[] memory orders)\n public\n view\n returns (LibOrder.OrderInfo[] memory)\n {\n uint256 ordersLength = orders.length;\n LibOrder.OrderInfo[] memory ordersInfo = new LibOrder.OrderInfo[](ordersLength);\n for (uint256 i = 0; i != ordersLength; i++) {\n ordersInfo[i] = getOrderInfo(orders[i]);\n }\n return ordersInfo;\n }\n\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n require(\n fillResults.takerAssetFilledAmount == takerAssetFillAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return fillResults;\n }\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IAssetProxyDispatcher {\n\n /// @dev Registers an asset proxy to its asset proxy id.\n /// Once an asset proxy is registered, it cannot be unregistered.\n /// @param assetProxy Address of new asset proxy to register.\n function registerAssetProxy(address assetProxy)\n external;\n\n /// @dev Gets an asset proxy.\n /// @param assetProxyId Id of the asset proxy.\n /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered.\n function getAssetProxy(bytes4 assetProxyId)\n external\n view\n returns (address);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IExchange.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./IExchangeCore.sol\";\nimport \"./IMatchOrders.sol\";\nimport \"./ISignatureValidator.sol\";\nimport \"./ITransactions.sol\";\nimport \"./IAssetProxyDispatcher.sol\";\nimport \"./IWrapperFunctions.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract IExchange is\n IExchangeCore,\n IMatchOrders,\n ISignatureValidator,\n ITransactions,\n IAssetProxyDispatcher,\n IWrapperFunctions\n{}\n",
- "2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IExchangeCore {\n\n /// @dev Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch\n /// and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress).\n /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled.\n function cancelOrdersUpTo(uint256 targetOrderEpoch)\n external;\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev After calling, the order can not be filled anymore.\n /// @param order Order struct containing order specifications.\n function cancelOrder(LibOrder.Order memory order)\n public;\n\n /// @dev Gets information about an order: status, hash, and amount filled.\n /// @param order Order to gather information on.\n /// @return OrderInfo Information about the order and its state.\n /// See LibOrder.OrderInfo for a complete description.\n function getOrderInfo(LibOrder.Order memory order)\n public\n view\n returns (LibOrder.OrderInfo memory orderInfo);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IMatchOrders {\n\n /// @dev Match two complementary orders that have a profitable spread.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the left order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftSignature Proof that order was created by the left maker.\n /// @param rightSignature Proof that order was created by the right maker.\n /// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.\n function matchOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n bytes memory leftSignature,\n bytes memory rightSignature\n )\n public\n returns (LibFillResults.MatchedFillResults memory matchedFillResults);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract ISignatureValidator {\n\n /// @dev Approves a hash on-chain using any valid signature type.\n /// After presigning a hash, the preSign signature type will become valid for that hash and signer.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n function preSign(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external;\n \n /// @dev Approves/unnapproves a Validator contract to verify signatures on signer's behalf.\n /// @param validatorAddress Address of Validator contract.\n /// @param approval Approval or disapproval of Validator contract.\n function setSignatureValidatorApproval(\n address validatorAddress,\n bool approval\n )\n external;\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signerAddress Address of signer.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes memory signature\n )\n public\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/ITransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\n\ncontract ITransactions {\n\n /// @dev Executes an exchange method call in the context of signer.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @param signature Proof of signer transaction by signer.\n function executeTransaction(\n uint256 salt,\n address signerAddress,\n bytes data,\n bytes signature\n )\n external;\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IValidator {\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IWallet.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IWallet {\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n bytes signature\n )\n external\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IWrapperFunctions {\n\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrKill.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrKillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrders(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerAsset is bought by taker.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrders(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously cancels multiple orders in a single transaction.\n /// @param orders Array of order specifications.\n function batchCancelOrders(LibOrder.Order[] memory orders)\n public;\n\n /// @dev Fetches information for all passed in orders\n /// @param orders Array of order specifications.\n /// @return Array of OrderInfo instances that correspond to each order.\n function getOrdersInfo(LibOrder.Order[] memory orders)\n public\n view\n returns (LibOrder.OrderInfo[] memory);\n}\n",
- "2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./LibOrder.sol\";\n\n\ncontract LibAbiEncoder {\n\n /// @dev ABI encodes calldata for `fillOrder`.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return ABI encoded calldata for `fillOrder`.\n function abiEncodeFillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n pure\n returns (bytes memory fillOrderCalldata)\n {\n // We need to call MExchangeCore.fillOrder using a delegatecall in\n // assembly so that we can intercept a call that throws. For this, we\n // need the input encoded in memory in the Ethereum ABIv2 format [1].\n\n // | Area | Offset | Length | Contents |\n // | -------- |--------|---------|-------------------------------------------- |\n // | Header | 0x00 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 0x00 | | 1. offset to order (*) |\n // | | 0x20 | | 2. takerAssetFillAmount |\n // | | 0x40 | | 3. offset to signature (*) |\n // | Data | | 12 * 32 | order: |\n // | | 0x000 | | 1. senderAddress |\n // | | 0x020 | | 2. makerAddress |\n // | | 0x040 | | 3. takerAddress |\n // | | 0x060 | | 4. feeRecipientAddress |\n // | | 0x080 | | 5. makerAssetAmount |\n // | | 0x0A0 | | 6. takerAssetAmount |\n // | | 0x0C0 | | 7. makerFeeAmount |\n // | | 0x0E0 | | 8. takerFeeAmount |\n // | | 0x100 | | 9. expirationTimeSeconds |\n // | | 0x120 | | 10. salt |\n // | | 0x140 | | 11. Offset to makerAssetData (*) |\n // | | 0x160 | | 12. Offset to takerAssetData (*) |\n // | | 0x180 | 32 | makerAssetData Length |\n // | | 0x1A0 | ** | makerAssetData Contents |\n // | | 0x1C0 | 32 | takerAssetData Length |\n // | | 0x1E0 | ** | takerAssetData Contents |\n // | | 0x200 | 32 | signature Length |\n // | | 0x220 | ** | signature Contents |\n\n // * Offsets are calculated from the beginning of the current area: Header, Params, Data:\n // An offset stored in the Params area is calculated from the beginning of the Params section.\n // An offset stored in the Data area is calculated from the beginning of the Data section.\n\n // ** The length of dynamic array contents are stored in the field immediately preceeding the contents.\n\n // [1]: https://solidity.readthedocs.io/en/develop/abi-spec.html\n\n assembly {\n\n // Areas below may use the following variables:\n // 1. <area>Start -- Start of this area in memory\n // 2. <area>End -- End of this area in memory. This value may\n // be precomputed (before writing contents),\n // or it may be computed as contents are written.\n // 3. <area>Offset -- Current offset into area. If an area's End\n // is precomputed, this variable tracks the\n // offsets of contents as they are written.\n\n /////// Setup Header Area ///////\n // Load free memory pointer\n fillOrderCalldata := mload(0x40)\n // bytes4(keccak256(\"fillOrder((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),uint256,bytes)\"))\n // = 0xb4be83d5\n // Leave 0x20 bytes to store the length\n mstore(add(fillOrderCalldata, 0x20), 0xb4be83d500000000000000000000000000000000000000000000000000000000)\n let headerAreaEnd := add(fillOrderCalldata, 0x24)\n\n /////// Setup Params Area ///////\n // This area is preallocated and written to later.\n // This is because we need to fill in offsets that have not yet been calculated.\n let paramsAreaStart := headerAreaEnd\n let paramsAreaEnd := add(paramsAreaStart, 0x60)\n let paramsAreaOffset := paramsAreaStart\n\n /////// Setup Data Area ///////\n let dataAreaStart := paramsAreaEnd\n let dataAreaEnd := dataAreaStart\n\n // Offset from the source data we're reading from\n let sourceOffset := order\n // arrayLenBytes and arrayLenWords track the length of a dynamically-allocated bytes array.\n let arrayLenBytes := 0\n let arrayLenWords := 0\n\n /////// Write order Struct ///////\n // Write memory location of Order, relative to the start of the\n // parameter list, then increment the paramsAreaOffset respectively.\n mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))\n paramsAreaOffset := add(paramsAreaOffset, 0x20)\n\n // Write values for each field in the order\n // It would be nice to use a loop, but we save on gas by writing\n // the stores sequentially.\n mstore(dataAreaEnd, mload(sourceOffset)) // makerAddress\n mstore(add(dataAreaEnd, 0x20), mload(add(sourceOffset, 0x20))) // takerAddress\n mstore(add(dataAreaEnd, 0x40), mload(add(sourceOffset, 0x40))) // feeRecipientAddress\n mstore(add(dataAreaEnd, 0x60), mload(add(sourceOffset, 0x60))) // senderAddress\n mstore(add(dataAreaEnd, 0x80), mload(add(sourceOffset, 0x80))) // makerAssetAmount\n mstore(add(dataAreaEnd, 0xA0), mload(add(sourceOffset, 0xA0))) // takerAssetAmount\n mstore(add(dataAreaEnd, 0xC0), mload(add(sourceOffset, 0xC0))) // makerFeeAmount\n mstore(add(dataAreaEnd, 0xE0), mload(add(sourceOffset, 0xE0))) // takerFeeAmount\n mstore(add(dataAreaEnd, 0x100), mload(add(sourceOffset, 0x100))) // expirationTimeSeconds\n mstore(add(dataAreaEnd, 0x120), mload(add(sourceOffset, 0x120))) // salt\n mstore(add(dataAreaEnd, 0x140), mload(add(sourceOffset, 0x140))) // Offset to makerAssetData\n mstore(add(dataAreaEnd, 0x160), mload(add(sourceOffset, 0x160))) // Offset to takerAssetData\n dataAreaEnd := add(dataAreaEnd, 0x180)\n sourceOffset := add(sourceOffset, 0x180)\n\n // Write offset to <order.makerAssetData>\n mstore(add(dataAreaStart, mul(10, 0x20)), sub(dataAreaEnd, dataAreaStart))\n\n // Calculate length of <order.makerAssetData>\n sourceOffset := mload(add(order, 0x140)) // makerAssetData\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of <order.makerAssetData>\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of <order.makerAssetData>\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n // Write offset to <order.takerAssetData>\n mstore(add(dataAreaStart, mul(11, 0x20)), sub(dataAreaEnd, dataAreaStart))\n\n // Calculate length of <order.takerAssetData>\n sourceOffset := mload(add(order, 0x160)) // takerAssetData\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of <order.takerAssetData>\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of <order.takerAssetData>\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n /////// Write takerAssetFillAmount ///////\n mstore(paramsAreaOffset, takerAssetFillAmount)\n paramsAreaOffset := add(paramsAreaOffset, 0x20)\n\n /////// Write signature ///////\n // Write offset to paramsArea\n mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))\n\n // Calculate length of signature\n sourceOffset := signature\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of signature\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of signature\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n // Set length of calldata\n mstore(fillOrderCalldata, sub(dataAreaEnd, add(fillOrderCalldata, 0x20)))\n\n // Increment free memory pointer\n mstore(0x40, dataAreaEnd)\n }\n\n return fillOrderCalldata;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibConstants.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\n// solhint-disable max-line-length\ncontract LibConstants {\n \n // Asset data for ZRX token. Used for fee transfers.\n // @TODO: Hardcode constant when we deploy. Currently \n // not constant to make testing easier.\n\n // The proxyId for ZRX_ASSET_DATA is bytes4(keccak256(\"ERC20Token(address)\")) = 0xf47261b0\n \n // Kovan ZRX address is 0x6ff6c0ff1d68b964901f986d4c9fa3ac68346570.\n // The ABI encoded proxyId and address is 0xf47261b00000000000000000000000006ff6c0ff1d68b964901f986d4c9fa3ac68346570\n // bytes constant public ZRX_ASSET_DATA = \"\\xf4\\x72\\x61\\xb0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x6f\\xf6\\xc0\\xff\\x1d\\x68\\xb9\\x64\\x90\\x1f\\x98\\x6d\\x4c\\x9f\\xa3\\xac\\x68\\x34\\x65\\x70\";\n \n // Mainnet ZRX address is 0xe41d2489571d322189246dafa5ebde1f4699f498.\n // The ABI encoded proxyId and address is 0xf47261b0000000000000000000000000e41d2489571d322189246dafa5ebde1f4699f498\n // bytes constant public ZRX_ASSET_DATA = \"\\xf4\\x72\\x61\\xb0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xe4\\x1d\\x24\\x89\\x57\\x1d\\x32\\x21\\x89\\x24\\x6d\\xaf\\xa5\\xeb\\xde\\x1f\\x46\\x99\\xf4\\x98\";\n \n // solhint-disable-next-line var-name-mixedcase\n bytes public ZRX_ASSET_DATA;\n\n // @TODO: Remove when we deploy.\n constructor (bytes memory zrxAssetData)\n public\n {\n ZRX_ASSET_DATA = zrxAssetData;\n }\n}\n// solhint-enable max-line-length\n",
- "2.0.0/protocol/Exchange/libs/LibEIP712.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract LibEIP712 {\n\n // EIP191 header for EIP712 prefix\n string constant internal EIP191_HEADER = \"\\x19\\x01\";\n\n // EIP712 Domain Name value\n string constant internal EIP712_DOMAIN_NAME = \"0x Protocol\";\n\n // EIP712 Domain Version value\n string constant internal EIP712_DOMAIN_VERSION = \"2\";\n\n // Hash of the EIP712 Domain Separator Schema\n bytes32 constant internal EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"EIP712Domain(\",\n \"string name,\",\n \"string version,\",\n \"address verifyingContract\",\n \")\"\n ));\n\n // Hash of the EIP712 Domain Separator data\n // solhint-disable-next-line var-name-mixedcase\n bytes32 public EIP712_DOMAIN_HASH;\n\n constructor ()\n public\n {\n EIP712_DOMAIN_HASH = keccak256(abi.encodePacked(\n EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH,\n keccak256(bytes(EIP712_DOMAIN_NAME)),\n keccak256(bytes(EIP712_DOMAIN_VERSION)),\n bytes32(address(this))\n ));\n }\n\n /// @dev Calculates EIP712 encoding for a hash struct in this EIP712 Domain.\n /// @param hashStruct The EIP712 hash struct.\n /// @return EIP712 hash applied to this EIP712 Domain.\n function hashEIP712Message(bytes32 hashStruct)\n internal\n view\n returns (bytes32 result)\n {\n bytes32 eip712DomainHash = EIP712_DOMAIN_HASH;\n\n // Assembly for more efficient computing:\n // keccak256(abi.encodePacked(\n // EIP191_HEADER,\n // EIP712_DOMAIN_HASH,\n // hashStruct \n // ));\n\n assembly {\n // Load free memory pointer\n let memPtr := mload(64)\n\n mstore(memPtr, 0x1901000000000000000000000000000000000000000000000000000000000000) // EIP191 header\n mstore(add(memPtr, 2), eip712DomainHash) // EIP712 domain hash\n mstore(add(memPtr, 34), hashStruct) // Hash of struct\n\n // Compute hash\n result := keccak256(memPtr, 66)\n }\n return result;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\n// solhint-disable\npragma solidity 0.4.24;\n\n\n/// @dev This contract documents the revert reasons used in the Exchange contract.\n/// This contract is intended to serve as a reference, but is not actually used for efficiency reasons.\ncontract LibExchangeErrors {\n\n /// Order validation errors ///\n string constant ORDER_UNFILLABLE = \"ORDER_UNFILLABLE\"; // Order cannot be filled.\n string constant INVALID_MAKER = \"INVALID_MAKER\"; // Invalid makerAddress.\n string constant INVALID_TAKER = \"INVALID_TAKER\"; // Invalid takerAddress.\n string constant INVALID_SENDER = \"INVALID_SENDER\"; // Invalid `msg.sender`.\n string constant INVALID_ORDER_SIGNATURE = \"INVALID_ORDER_SIGNATURE\"; // Signature validation failed. \n \n /// fillOrder validation errors ///\n string constant INVALID_TAKER_AMOUNT = \"INVALID_TAKER_AMOUNT\"; // takerAssetFillAmount cannot equal 0.\n string constant ROUNDING_ERROR = \"ROUNDING_ERROR\"; // Rounding error greater than 0.1% of takerAssetFillAmount. \n \n /// Signature validation errors ///\n string constant INVALID_SIGNATURE = \"INVALID_SIGNATURE\"; // Signature validation failed. \n string constant SIGNATURE_ILLEGAL = \"SIGNATURE_ILLEGAL\"; // Signature type is illegal.\n string constant SIGNATURE_UNSUPPORTED = \"SIGNATURE_UNSUPPORTED\"; // Signature type unsupported.\n \n /// cancelOrdersUptTo errors ///\n string constant INVALID_NEW_ORDER_EPOCH = \"INVALID_NEW_ORDER_EPOCH\"; // Specified salt must be greater than or equal to existing orderEpoch.\n\n /// fillOrKillOrder errors ///\n string constant COMPLETE_FILL_FAILED = \"COMPLETE_FILL_FAILED\"; // Desired takerAssetFillAmount could not be completely filled. \n\n /// matchOrders errors ///\n string constant NEGATIVE_SPREAD_REQUIRED = \"NEGATIVE_SPREAD_REQUIRED\"; // Matched orders must have a negative spread.\n\n /// Transaction errors ///\n string constant REENTRANCY_ILLEGAL = \"REENTRANCY_ILLEGAL\"; // Recursive reentrancy is not allowed. \n string constant INVALID_TX_HASH = \"INVALID_TX_HASH\"; // Transaction has already been executed. \n string constant INVALID_TX_SIGNATURE = \"INVALID_TX_SIGNATURE\"; // Signature validation failed. \n string constant FAILED_EXECUTION = \"FAILED_EXECUTION\"; // Transaction execution failed. \n \n /// registerAssetProxy errors ///\n string constant ASSET_PROXY_ALREADY_EXISTS = \"ASSET_PROXY_ALREADY_EXISTS\"; // AssetProxy with same id already exists.\n\n /// dispatchTransferFrom errors ///\n string constant ASSET_PROXY_DOES_NOT_EXIST = \"ASSET_PROXY_DOES_NOT_EXIST\"; // No assetProxy registered at given id.\n string constant TRANSFER_FAILED = \"TRANSFER_FAILED\"; // Asset transfer unsuccesful.\n\n /// Length validation errors ///\n string constant LENGTH_GREATER_THAN_0_REQUIRED = \"LENGTH_GREATER_THAN_0_REQUIRED\"; // Byte array must have a length greater than 0.\n string constant LENGTH_GREATER_THAN_3_REQUIRED = \"LENGTH_GREATER_THAN_3_REQUIRED\"; // Byte array must have a length greater than 3.\n string constant LENGTH_0_REQUIRED = \"LENGTH_0_REQUIRED\"; // Byte array must have a length of 0.\n string constant LENGTH_65_REQUIRED = \"LENGTH_65_REQUIRED\"; // Byte array must have a length of 65.\n}\n",
- "2.0.0/protocol/Exchange/libs/LibFillResults.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract LibFillResults is\n SafeMath\n{\n struct FillResults {\n uint256 makerAssetFilledAmount; // Total amount of makerAsset(s) filled.\n uint256 takerAssetFilledAmount; // Total amount of takerAsset(s) filled.\n uint256 makerFeePaid; // Total amount of ZRX paid by maker(s) to feeRecipient(s).\n uint256 takerFeePaid; // Total amount of ZRX paid by taker to feeRecipients(s).\n }\n\n struct MatchedFillResults {\n FillResults left; // Amounts filled and fees paid of left order.\n FillResults right; // Amounts filled and fees paid of right order.\n uint256 leftMakerAssetSpreadAmount; // Spread between price of left and right order, denominated in the left order's makerAsset, paid to taker.\n }\n\n /// @dev Adds properties of both FillResults instances.\n /// Modifies the first FillResults instance specified.\n /// @param totalFillResults Fill results instance that will be added onto.\n /// @param singleFillResults Fill results instance that will be added to totalFillResults.\n function addFillResults(FillResults memory totalFillResults, FillResults memory singleFillResults)\n internal\n pure\n {\n totalFillResults.makerAssetFilledAmount = safeAdd(totalFillResults.makerAssetFilledAmount, singleFillResults.makerAssetFilledAmount);\n totalFillResults.takerAssetFilledAmount = safeAdd(totalFillResults.takerAssetFilledAmount, singleFillResults.takerAssetFilledAmount);\n totalFillResults.makerFeePaid = safeAdd(totalFillResults.makerFeePaid, singleFillResults.makerFeePaid);\n totalFillResults.takerFeePaid = safeAdd(totalFillResults.takerFeePaid, singleFillResults.takerFeePaid);\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibMath.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract LibMath is\n SafeMath\n{\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// Reverts if rounding error is >= 0.1%\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded down.\n function safeGetPartialAmountFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n require(\n !isRoundingErrorFloor(\n numerator,\n denominator,\n target\n ),\n \"ROUNDING_ERROR\"\n );\n \n partialAmount = safeDiv(\n safeMul(numerator, target),\n denominator\n );\n return partialAmount;\n }\n\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// Reverts if rounding error is >= 0.1%\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded up.\n function safeGetPartialAmountCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n require(\n !isRoundingErrorCeil(\n numerator,\n denominator,\n target\n ),\n \"ROUNDING_ERROR\"\n );\n \n // safeDiv computes `floor(a / b)`. We use the identity (a, b integer):\n // ceil(a / b) = floor((a + b - 1) / b)\n // To implement `ceil(a / b)` using safeDiv.\n partialAmount = safeDiv(\n safeAdd(\n safeMul(numerator, target),\n safeSub(denominator, 1)\n ),\n denominator\n );\n return partialAmount;\n }\n\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded down.\n function getPartialAmountFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n partialAmount = safeDiv(\n safeMul(numerator, target),\n denominator\n );\n return partialAmount;\n }\n \n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded up.\n function getPartialAmountCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n // safeDiv computes `floor(a / b)`. We use the identity (a, b integer):\n // ceil(a / b) = floor((a + b - 1) / b)\n // To implement `ceil(a / b)` using safeDiv.\n partialAmount = safeDiv(\n safeAdd(\n safeMul(numerator, target),\n safeSub(denominator, 1)\n ),\n denominator\n );\n return partialAmount;\n }\n \n /// @dev Checks if rounding error >= 0.1% when rounding down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to multiply with numerator/denominator.\n /// @return Rounding error is present.\n function isRoundingErrorFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (bool isError)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n \n // The absolute rounding error is the difference between the rounded\n // value and the ideal value. The relative rounding error is the\n // absolute rounding error divided by the absolute value of the\n // ideal value. This is undefined when the ideal value is zero.\n //\n // The ideal value is `numerator * target / denominator`.\n // Let's call `numerator * target % denominator` the remainder.\n // The absolute error is `remainder / denominator`.\n //\n // When the ideal value is zero, we require the absolute error to\n // be zero. Fortunately, this is always the case. The ideal value is\n // zero iff `numerator == 0` and/or `target == 0`. In this case the\n // remainder and absolute error are also zero. \n if (target == 0 || numerator == 0) {\n return false;\n }\n \n // Otherwise, we want the relative rounding error to be strictly\n // less than 0.1%.\n // The relative error is `remainder / (numerator * target)`.\n // We want the relative error less than 1 / 1000:\n // remainder / (numerator * denominator) < 1 / 1000\n // or equivalently:\n // 1000 * remainder < numerator * target\n // so we have a rounding error iff:\n // 1000 * remainder >= numerator * target\n uint256 remainder = mulmod(\n target,\n numerator,\n denominator\n );\n isError = safeMul(1000, remainder) >= safeMul(numerator, target);\n return isError;\n }\n \n /// @dev Checks if rounding error >= 0.1% when rounding up.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to multiply with numerator/denominator.\n /// @return Rounding error is present.\n function isRoundingErrorCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (bool isError)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n \n // See the comments in `isRoundingError`.\n if (target == 0 || numerator == 0) {\n // When either is zero, the ideal value and rounded value are zero\n // and there is no rounding error. (Although the relative error\n // is undefined.)\n return false;\n }\n // Compute remainder as before\n uint256 remainder = mulmod(\n target,\n numerator,\n denominator\n );\n remainder = safeSub(denominator, remainder) % denominator;\n isError = safeMul(1000, remainder) >= safeMul(numerator, target);\n return isError;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibOrder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./LibEIP712.sol\";\n\n\ncontract LibOrder is\n LibEIP712\n{\n // Hash for the EIP712 Order Schema\n bytes32 constant internal EIP712_ORDER_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"Order(\",\n \"address makerAddress,\",\n \"address takerAddress,\",\n \"address feeRecipientAddress,\",\n \"address senderAddress,\",\n \"uint256 makerAssetAmount,\",\n \"uint256 takerAssetAmount,\",\n \"uint256 makerFee,\",\n \"uint256 takerFee,\",\n \"uint256 expirationTimeSeconds,\",\n \"uint256 salt,\",\n \"bytes makerAssetData,\",\n \"bytes takerAssetData\",\n \")\"\n ));\n\n // A valid order remains fillable until it is expired, fully filled, or cancelled.\n // An order's state is unaffected by external factors, like account balances.\n enum OrderStatus {\n INVALID, // Default value\n INVALID_MAKER_ASSET_AMOUNT, // Order does not have a valid maker asset amount\n INVALID_TAKER_ASSET_AMOUNT, // Order does not have a valid taker asset amount\n FILLABLE, // Order is fillable\n EXPIRED, // Order has already expired\n FULLY_FILLED, // Order is fully filled\n CANCELLED // Order has been cancelled\n }\n\n // solhint-disable max-line-length\n struct Order {\n address makerAddress; // Address that created the order. \n address takerAddress; // Address that is allowed to fill the order. If set to 0, any address is allowed to fill the order. \n address feeRecipientAddress; // Address that will recieve fees when order is filled. \n address senderAddress; // Address that is allowed to call Exchange contract methods that affect this order. If set to 0, any address is allowed to call these methods.\n uint256 makerAssetAmount; // Amount of makerAsset being offered by maker. Must be greater than 0. \n uint256 takerAssetAmount; // Amount of takerAsset being bid on by maker. Must be greater than 0. \n uint256 makerFee; // Amount of ZRX paid to feeRecipient by maker when order is filled. If set to 0, no transfer of ZRX from maker to feeRecipient will be attempted.\n uint256 takerFee; // Amount of ZRX paid to feeRecipient by taker when order is filled. If set to 0, no transfer of ZRX from taker to feeRecipient will be attempted.\n uint256 expirationTimeSeconds; // Timestamp in seconds at which order expires. \n uint256 salt; // Arbitrary number to facilitate uniqueness of the order's hash. \n bytes makerAssetData; // Encoded data that can be decoded by a specified proxy contract when transferring makerAsset. The last byte references the id of this proxy.\n bytes takerAssetData; // Encoded data that can be decoded by a specified proxy contract when transferring takerAsset. The last byte references the id of this proxy.\n }\n // solhint-enable max-line-length\n\n struct OrderInfo {\n uint8 orderStatus; // Status that describes order's validity and fillability.\n bytes32 orderHash; // EIP712 hash of the order (see LibOrder.getOrderHash).\n uint256 orderTakerAssetFilledAmount; // Amount of order that has already been filled.\n }\n\n /// @dev Calculates Keccak-256 hash of the order.\n /// @param order The order structure.\n /// @return Keccak-256 EIP712 hash of the order.\n function getOrderHash(Order memory order)\n internal\n view\n returns (bytes32 orderHash)\n {\n orderHash = hashEIP712Message(hashOrder(order));\n return orderHash;\n }\n\n /// @dev Calculates EIP712 hash of the order.\n /// @param order The order structure.\n /// @return EIP712 hash of the order.\n function hashOrder(Order memory order)\n internal\n pure\n returns (bytes32 result)\n {\n bytes32 schemaHash = EIP712_ORDER_SCHEMA_HASH;\n bytes32 makerAssetDataHash = keccak256(order.makerAssetData);\n bytes32 takerAssetDataHash = keccak256(order.takerAssetData);\n\n // Assembly for more efficiently computing:\n // keccak256(abi.encodePacked(\n // EIP712_ORDER_SCHEMA_HASH,\n // bytes32(order.makerAddress),\n // bytes32(order.takerAddress),\n // bytes32(order.feeRecipientAddress),\n // bytes32(order.senderAddress),\n // order.makerAssetAmount,\n // order.takerAssetAmount,\n // order.makerFee,\n // order.takerFee,\n // order.expirationTimeSeconds,\n // order.salt,\n // keccak256(order.makerAssetData),\n // keccak256(order.takerAssetData)\n // ));\n\n assembly {\n // Calculate memory addresses that will be swapped out before hashing\n let pos1 := sub(order, 32)\n let pos2 := add(order, 320)\n let pos3 := add(order, 352)\n\n // Backup\n let temp1 := mload(pos1)\n let temp2 := mload(pos2)\n let temp3 := mload(pos3)\n \n // Hash in place\n mstore(pos1, schemaHash)\n mstore(pos2, makerAssetDataHash)\n mstore(pos3, takerAssetDataHash)\n result := keccak256(pos1, 416)\n \n // Restore\n mstore(pos1, temp1)\n mstore(pos2, temp2)\n mstore(pos3, temp3)\n }\n return result;\n }\n}\n",
- "2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAssetProxyDispatcher.sol\";\n\n\ncontract MAssetProxyDispatcher is\n IAssetProxyDispatcher\n{\n // Logs registration of new asset proxy\n event AssetProxyRegistered(\n bytes4 id, // Id of new registered AssetProxy.\n address assetProxy // Address of new registered AssetProxy.\n );\n\n /// @dev Forwards arguments to assetProxy and calls `transferFrom`. Either succeeds or throws.\n /// @param assetData Byte array encoded for the asset.\n /// @param from Address to transfer token from.\n /// @param to Address to transfer token to.\n /// @param amount Amount of token to transfer.\n function dispatchTransferFrom(\n bytes memory assetData,\n address from,\n address to,\n uint256 amount\n )\n internal;\n}\n",
- "2.0.0/protocol/Exchange/mixins/MExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IExchangeCore.sol\";\n\n\ncontract MExchangeCore is\n IExchangeCore\n{\n // Fill event is emitted whenever an order is filled.\n event Fill(\n address indexed makerAddress, // Address that created the order. \n address indexed feeRecipientAddress, // Address that received fees.\n address takerAddress, // Address that filled the order.\n address senderAddress, // Address that called the Exchange contract (msg.sender).\n uint256 makerAssetFilledAmount, // Amount of makerAsset sold by maker and bought by taker. \n uint256 takerAssetFilledAmount, // Amount of takerAsset sold by taker and bought by maker.\n uint256 makerFeePaid, // Amount of ZRX paid to feeRecipient by maker.\n uint256 takerFeePaid, // Amount of ZRX paid to feeRecipient by taker.\n bytes32 indexed orderHash, // EIP712 hash of order (see LibOrder.getOrderHash).\n bytes makerAssetData, // Encoded data specific to makerAsset. \n bytes takerAssetData // Encoded data specific to takerAsset.\n );\n\n // Cancel event is emitted whenever an individual order is cancelled.\n event Cancel(\n address indexed makerAddress, // Address that created the order. \n address indexed feeRecipientAddress, // Address that would have recieved fees if order was filled. \n address senderAddress, // Address that called the Exchange contract (msg.sender).\n bytes32 indexed orderHash, // EIP712 hash of order (see LibOrder.getOrderHash).\n bytes makerAssetData, // Encoded data specific to makerAsset. \n bytes takerAssetData // Encoded data specific to takerAsset.\n );\n\n // CancelUpTo event is emitted whenever `cancelOrdersUpTo` is executed succesfully.\n event CancelUpTo(\n address indexed makerAddress, // Orders cancelled must have been created by this address.\n address indexed senderAddress, // Orders cancelled must have a `senderAddress` equal to this address.\n uint256 orderEpoch // Orders with specified makerAddress and senderAddress with a salt less than this value are considered cancelled.\n );\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev After calling, the order can not be filled anymore.\n /// @param order Order struct containing order specifications.\n function cancelOrderInternal(LibOrder.Order memory order)\n internal;\n\n /// @dev Updates state with results of a fill order.\n /// @param order that was filled.\n /// @param takerAddress Address of taker who filled the order.\n /// @param orderTakerAssetFilledAmount Amount of order already filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function updateFilledState(\n LibOrder.Order memory order,\n address takerAddress,\n bytes32 orderHash,\n uint256 orderTakerAssetFilledAmount,\n LibFillResults.FillResults memory fillResults\n )\n internal;\n\n /// @dev Updates state with results of cancelling an order.\n /// State is only updated if the order is currently fillable.\n /// Otherwise, updating state would have no effect.\n /// @param order that was cancelled.\n /// @param orderHash Hash of order that was cancelled.\n function updateCancelledState(\n LibOrder.Order memory order,\n bytes32 orderHash\n )\n internal;\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAddress Address of order taker.\n /// @param signature Proof that the orders was created by its maker.\n function assertFillableOrder(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo,\n address takerAddress,\n bytes memory signature\n )\n internal\n view;\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo Status, orderHash, and amount already filled of order.\n /// @param takerAssetFillAmount Desired amount of order to fill by taker.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @param makerAssetFilledAmount Amount of makerAsset that will be transfered.\n function assertValidFill(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo,\n uint256 takerAssetFillAmount,\n uint256 takerAssetFilledAmount,\n uint256 makerAssetFilledAmount\n )\n internal\n view;\n\n /// @dev Validates context for cancelOrder. Succeeds or throws.\n /// @param order to be cancelled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n function assertValidCancel(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo\n )\n internal\n view;\n\n /// @dev Calculates amounts filled and fees paid by maker and taker.\n /// @param order to be filled.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function calculateFillResults(\n LibOrder.Order memory order,\n uint256 takerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.FillResults memory fillResults);\n\n}\n",
- "2.0.0/protocol/Exchange/mixins/MMatchOrders.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IMatchOrders.sol\";\n\n\ncontract MMatchOrders is\n IMatchOrders\n{\n /// @dev Validates context for matchOrders. Succeeds or throws.\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n function assertValidMatch(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder\n )\n internal\n pure;\n\n /// @dev Calculates fill amounts for the matched orders.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the leftOrder order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftOrderTakerAssetFilledAmount Amount of left order already filled.\n /// @param rightOrderTakerAssetFilledAmount Amount of right order already filled.\n /// @param matchedFillResults Amounts to fill and fees to pay by maker and taker of matched orders.\n function calculateMatchedFillResults(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n uint256 leftOrderTakerAssetFilledAmount,\n uint256 rightOrderTakerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.MatchedFillResults memory matchedFillResults);\n\n}\n",
- "2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/ISignatureValidator.sol\";\n\n\ncontract MSignatureValidator is\n ISignatureValidator\n{\n event SignatureValidatorApproval(\n address indexed signerAddress, // Address that approves or disapproves a contract to verify signatures.\n address indexed validatorAddress, // Address of signature validator contract.\n bool approved // Approval or disapproval of validator contract.\n );\n\n // Allowed signature types.\n enum SignatureType {\n Illegal, // 0x00, default value\n Invalid, // 0x01\n EIP712, // 0x02\n EthSign, // 0x03\n Wallet, // 0x04\n Validator, // 0x05\n PreSigned, // 0x06\n NSignatureTypes // 0x07, number of signature types. Always leave at end.\n }\n\n /// @dev Verifies signature using logic defined by Wallet contract.\n /// @param hash Any 32 byte hash.\n /// @param walletAddress Address that should have signed the given hash\n /// and defines its own signature verification method.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidWalletSignature(\n bytes32 hash,\n address walletAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid);\n\n /// @dev Verifies signature using logic defined by Validator contract.\n /// @param validatorAddress Address of validator contract.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidValidatorSignature(\n address validatorAddress,\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/mixins/MTransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\nimport \"../interfaces/ITransactions.sol\";\n\n\ncontract MTransactions is\n ITransactions\n{\n // Hash for the EIP712 ZeroEx Transaction Schema\n bytes32 constant internal EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"ZeroExTransaction(\",\n \"uint256 salt,\",\n \"address signerAddress,\",\n \"bytes data\",\n \")\"\n ));\n\n /// @dev Calculates EIP712 hash of the Transaction.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @return EIP712 hash of the Transaction.\n function hashZeroExTransaction(\n uint256 salt,\n address signerAddress,\n bytes memory data\n )\n internal\n pure\n returns (bytes32 result);\n\n /// @dev The current function will be called in the context of this address (either 0x transaction signer or `msg.sender`).\n /// If calling a fill function, this address will represent the taker.\n /// If calling a cancel function, this address will represent the maker.\n /// @return Signer of 0x transaction if entry point is `executeTransaction`.\n /// `msg.sender` if entry point is any other function.\n function getCurrentContextAddress()\n internal\n view\n returns (address);\n}\n",
- "2.0.0/protocol/Exchange/mixins/MWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IWrapperFunctions.sol\";\n\n\ncontract MWrapperFunctions is \n IWrapperFunctions\n{\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n}\n",
- "2.0.0/test/DummyERC20Token/DummyERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"../../tokens/ERC20Token/MintableERC20Token.sol\";\n\n\ncontract DummyERC20Token is \n Ownable,\n MintableERC20Token\n{\n string public name;\n string public symbol;\n uint256 public decimals;\n uint256 public constant MAX_MINT_AMOUNT = 10000000000000000000000;\n\n constructor (\n string _name,\n string _symbol,\n uint256 _decimals,\n uint256 _totalSupply\n )\n public\n {\n name = _name;\n symbol = _symbol;\n decimals = _decimals;\n _totalSupply = _totalSupply;\n balances[msg.sender] = _totalSupply;\n }\n\n /// @dev Sets the balance of target address\n /// @param _target Address or which balance will be updated\n /// @param _value New balance of target address\n function setBalance(address _target, uint256 _value)\n external\n onlyOwner\n {\n uint256 currBalance = balances[_target];\n if (_value < currBalance) {\n _totalSupply = safeSub(_totalSupply, safeSub(currBalance, _value));\n } else {\n _totalSupply = safeAdd(_totalSupply, safeSub(_value, currBalance));\n }\n balances[_target] = _value;\n }\n\n /// @dev Mints new tokens for sender\n /// @param _value Amount of tokens to mint\n function mint(uint256 _value)\n external\n {\n require(\n _value <= MAX_MINT_AMOUNT,\n \"VALUE_TOO_LARGE\"\n );\n\n _mint(msg.sender, _value);\n }\n}\n",
- "2.0.0/test/DummyERC721Token/DummyERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../tokens/ERC721Token/MintableERC721Token.sol\";\nimport \"../../utils/Ownable/Ownable.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract DummyERC721Token is\n Ownable,\n MintableERC721Token\n{\n string public name;\n string public symbol;\n\n constructor (\n string _name,\n string _symbol\n )\n public\n {\n name = _name;\n symbol = _symbol;\n }\n\n /// @dev Function to mint a new token\n /// Reverts if the given token ID already exists\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _tokenId ID of the token to be minted by the msg.sender \n function mint(address _to, uint256 _tokenId)\n external\n {\n _mint(_to, _tokenId);\n }\n\n /// @dev Function to burn a token\n /// Reverts if the given token ID doesn't exist or not called by contract owner\n /// @param _owner Owner of token with given token ID\n /// @param _tokenId ID of the token to be burned by the msg.sender\n function burn(address _owner, uint256 _tokenId)\n external\n onlyOwner\n {\n _burn(_owner, _tokenId);\n }\n}\n",
- "2.0.0/tokens/ERC20Token/ERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IERC20Token.sol\";\n\n\ncontract ERC20Token is\n IERC20Token\n{\n mapping (address => uint256) internal balances;\n mapping (address => mapping (address => uint256)) internal allowed;\n\n uint256 internal _totalSupply;\n\n /// @dev send `value` token to `to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transfer(address _to, uint256 _value)\n external\n returns (bool)\n {\n require(\n balances[msg.sender] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[msg.sender] -= _value;\n balances[_to] += _value;\n\n emit Transfer(\n msg.sender,\n _to,\n _value\n );\n\n return true;\n }\n\n /// @dev send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool)\n {\n require(\n balances[_from] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n allowed[_from][msg.sender] >= _value,\n \"ERC20_INSUFFICIENT_ALLOWANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[_to] += _value;\n balances[_from] -= _value;\n allowed[_from][msg.sender] -= _value;\n \n emit Transfer(\n _from,\n _to,\n _value\n );\n \n return true;\n }\n\n /// @dev `msg.sender` approves `_spender` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Always true if the call has enough gas to complete execution\n function approve(address _spender, uint256 _value)\n external\n returns (bool)\n {\n allowed[msg.sender][_spender] = _value;\n emit Approval(\n msg.sender,\n _spender,\n _value\n );\n return true;\n }\n\n /// @dev Query total supply of token\n /// @return Total supply of token\n function totalSupply()\n external\n view\n returns (uint256)\n {\n return _totalSupply;\n }\n\n /// @dev Query the balance of owner\n /// @param _owner The address from which the balance will be retrieved\n /// @return Balance of owner\n function balanceOf(address _owner)\n external\n view\n returns (uint256)\n {\n return balances[_owner];\n }\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender)\n external\n view\n returns (uint256)\n {\n return allowed[_owner][_spender];\n }\n}\n",
- "2.0.0/tokens/ERC20Token/IERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC20Token {\n\n // solhint-disable no-simple-event-func-name\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 _value\n );\n\n event Approval(\n address indexed _owner,\n address indexed _spender,\n uint256 _value\n );\n\n /// @dev send `value` token to `to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transfer(address _to, uint256 _value)\n external\n returns (bool);\n\n /// @dev send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool);\n \n /// @dev `msg.sender` approves `_spender` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Always true if the call has enough gas to complete execution\n function approve(address _spender, uint256 _value)\n external\n returns (bool);\n\n /// @dev Query total supply of token\n /// @return Total supply of token\n function totalSupply()\n external\n view\n returns (uint256);\n \n /// @param _owner The address from which the balance will be retrieved\n /// @return Balance of owner\n function balanceOf(address _owner)\n external\n view\n returns (uint256);\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender)\n external\n view\n returns (uint256);\n}\n",
- "2.0.0/tokens/ERC20Token/MintableERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/SafeMath/SafeMath.sol\";\nimport \"./UnlimitedAllowanceERC20Token.sol\";\n\n\ncontract MintableERC20Token is \n SafeMath,\n UnlimitedAllowanceERC20Token\n{\n /// @dev Mints new tokens\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _value Amount of tokens to mint\n function _mint(address _to, uint256 _value)\n internal\n {\n balances[_to] = safeAdd(_value, balances[_to]);\n _totalSupply = safeAdd(_totalSupply, _value);\n\n emit Transfer(\n address(0),\n _to,\n _value\n );\n }\n\n /// @dev Mints new tokens\n /// @param _owner Owner of tokens that will be burned\n /// @param _value Amount of tokens to burn\n function _burn(address _owner, uint256 _value)\n internal\n {\n balances[_owner] = safeSub(balances[_owner], _value);\n _totalSupply = safeSub(_totalSupply, _value);\n\n emit Transfer(\n _owner,\n address(0),\n _value\n );\n }\n}\n",
- "2.0.0/tokens/ERC20Token/UnlimitedAllowanceERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../ERC20Token/ERC20Token.sol\";\n\n\ncontract UnlimitedAllowanceERC20Token is\n ERC20Token\n{\n uint256 constant internal MAX_UINT = 2**256 - 1;\n\n /// @dev ERC20 transferFrom, modified such that an allowance of MAX_UINT represents an unlimited allowance. See https://github.com/ethereum/EIPs/issues/717\n /// @param _from Address to transfer from.\n /// @param _to Address to transfer to.\n /// @param _value Amount to transfer.\n /// @return Success of transfer.\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool)\n {\n uint256 allowance = allowed[_from][msg.sender];\n require(\n balances[_from] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n allowance >= _value,\n \"ERC20_INSUFFICIENT_ALLOWANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[_to] += _value;\n balances[_from] -= _value;\n if (allowance < MAX_UINT) {\n allowed[_from][msg.sender] -= _value;\n }\n\n emit Transfer(\n _from,\n _to,\n _value\n );\n\n return true;\n }\n}\n",
- "2.0.0/tokens/ERC721Token/ERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IERC721Token.sol\";\nimport \"./IERC721Receiver.sol\";\nimport \"../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract ERC721Token is\n IERC721Token,\n SafeMath\n{\n // Function selector for ERC721Receiver.onERC721Received\n // 0x150b7a02\n bytes4 constant internal ERC721_RECEIVED = bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"));\n\n // Mapping of tokenId => owner\n mapping (uint256 => address) internal owners;\n\n // Mapping of tokenId => approved address\n mapping (uint256 => address) internal approvals;\n\n // Mapping of owner => number of tokens owned\n mapping (address => uint256) internal balances;\n\n // Mapping of owner => operator => approved\n mapping (address => mapping (address => bool)) internal operatorApprovals;\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT. When transfer is complete, this function\n /// checks if `_to` is a smart contract (code size > 0). If so, it calls\n /// `onERC721Received` on `_to` and throws if the return value is not\n /// `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n /// @param _data Additional data with no specified format, sent in call to `_to`\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId,\n bytes _data\n )\n external\n {\n transferFrom(\n _from,\n _to,\n _tokenId\n );\n\n uint256 receiverCodeSize;\n assembly {\n receiverCodeSize := extcodesize(_to)\n }\n if (receiverCodeSize > 0) {\n bytes4 selector = IERC721Receiver(_to).onERC721Received(\n msg.sender,\n _from,\n _tokenId,\n _data\n );\n require(\n selector == ERC721_RECEIVED,\n \"ERC721_INVALID_SELECTOR\"\n );\n }\n }\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev This works identically to the other function with an extra data parameter,\n /// except this function just sets data to \"\".\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n external\n {\n transferFrom(\n _from,\n _to,\n _tokenId\n );\n\n uint256 receiverCodeSize;\n assembly {\n receiverCodeSize := extcodesize(_to)\n }\n if (receiverCodeSize > 0) {\n bytes4 selector = IERC721Receiver(_to).onERC721Received(\n msg.sender,\n _from,\n _tokenId,\n \"\"\n );\n require(\n selector == ERC721_RECEIVED,\n \"ERC721_INVALID_SELECTOR\"\n );\n }\n }\n\n /// @notice Change or reaffirm the approved address for an NFT\n /// @dev The zero address indicates there is no approved address.\n /// Throws unless `msg.sender` is the current NFT owner, or an authorized\n /// operator of the current owner.\n /// @param _approved The new approved NFT controller\n /// @param _tokenId The NFT to approve\n function approve(address _approved, uint256 _tokenId)\n external\n {\n address owner = ownerOf(_tokenId);\n require(\n msg.sender == owner || isApprovedForAll(owner, msg.sender),\n \"ERC721_INVALID_SENDER\"\n );\n\n approvals[_tokenId] = _approved;\n emit Approval(\n owner,\n _approved,\n _tokenId\n );\n }\n\n /// @notice Enable or disable approval for a third party (\"operator\") to manage\n /// all of `msg.sender`'s assets\n /// @dev Emits the ApprovalForAll event. The contract MUST allow\n /// multiple operators per owner.\n /// @param _operator Address to add to the set of authorized operators\n /// @param _approved True if the operator is approved, false to revoke approval\n function setApprovalForAll(address _operator, bool _approved)\n external\n {\n operatorApprovals[msg.sender][_operator] = _approved;\n emit ApprovalForAll(\n msg.sender,\n _operator,\n _approved\n );\n }\n \n /// @notice Count all NFTs assigned to an owner\n /// @dev NFTs assigned to the zero address are considered invalid, and this\n /// function throws for queries about the zero address.\n /// @param _owner An address for whom to query the balance\n /// @return The number of NFTs owned by `_owner`, possibly zero\n function balanceOf(address _owner)\n external\n view\n returns (uint256)\n {\n require(\n _owner != address(0),\n \"ERC721_ZERO_OWNER\"\n );\n return balances[_owner];\n }\n\n /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE\n /// TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE\n /// THEY MAY BE PERMANENTLY LOST\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function transferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n public\n {\n require(\n _to != address(0),\n \"ERC721_ZERO_TO_ADDRESS\"\n );\n\n address owner = ownerOf(_tokenId);\n require(\n _from == owner,\n \"ERC721_OWNER_MISMATCH\"\n );\n\n address spender = msg.sender;\n address approvedAddress = getApproved(_tokenId);\n require(\n spender == owner ||\n isApprovedForAll(owner, spender) ||\n approvedAddress == spender,\n \"ERC721_INVALID_SPENDER\"\n );\n\n if (approvedAddress != address(0)) {\n approvals[_tokenId] = address(0);\n }\n\n owners[_tokenId] = _to;\n balances[_from] = safeSub(balances[_from], 1);\n balances[_to] = safeAdd(balances[_to], 1);\n \n emit Transfer(\n _from,\n _to,\n _tokenId\n );\n }\n\n /// @notice Find the owner of an NFT\n /// @dev NFTs assigned to zero address are considered invalid, and queries\n /// about them do throw.\n /// @param _tokenId The identifier for an NFT\n /// @return The address of the owner of the NFT\n function ownerOf(uint256 _tokenId)\n public\n view\n returns (address)\n {\n address owner = owners[_tokenId];\n require(\n owner != address(0),\n \"ERC721_ZERO_OWNER\"\n );\n return owner;\n }\n\n /// @notice Get the approved address for a single NFT\n /// @dev Throws if `_tokenId` is not a valid NFT.\n /// @param _tokenId The NFT to find the approved address for\n /// @return The approved address for this NFT, or the zero address if there is none\n function getApproved(uint256 _tokenId)\n public\n view\n returns (address)\n {\n return approvals[_tokenId];\n }\n\n /// @notice Query if an address is an authorized operator for another address\n /// @param _owner The address that owns the NFTs\n /// @param _operator The address that acts on behalf of the owner\n /// @return True if `_operator` is an approved operator for `_owner`, false otherwise\n function isApprovedForAll(address _owner, address _operator)\n public\n view\n returns (bool)\n {\n return operatorApprovals[_owner][_operator];\n }\n}\n",
- "2.0.0/tokens/ERC721Token/IERC721Receiver.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC721Receiver {\n\n /// @notice Handle the receipt of an NFT\n /// @dev The ERC721 smart contract calls this function on the recipient\n /// after a `transfer`. This function MAY throw to revert and reject the\n /// transfer. Return of other than the magic value MUST result in the\n /// transaction being reverted.\n /// Note: the contract address is always the message sender.\n /// @param _operator The address which called `safeTransferFrom` function\n /// @param _from The address which previously owned the token\n /// @param _tokenId The NFT identifier which is being transferred\n /// @param _data Additional data with no specified format\n /// @return `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`\n /// unless throwing\n function onERC721Received(\n address _operator,\n address _from,\n uint256 _tokenId,\n bytes _data\n )\n external\n returns (bytes4);\n}\n",
- "2.0.0/tokens/ERC721Token/IERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC721Token {\n\n /// @dev This emits when ownership of any NFT changes by any mechanism.\n /// This event emits when NFTs are created (`from` == 0) and destroyed\n /// (`to` == 0). Exception: during contract creation, any number of NFTs\n /// may be created and assigned without emitting Transfer. At the time of\n /// any transfer, the approved address for that NFT (if any) is reset to none.\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 indexed _tokenId\n );\n\n /// @dev This emits when the approved address for an NFT is changed or\n /// reaffirmed. The zero address indicates there is no approved address.\n /// When a Transfer event emits, this also indicates that the approved\n /// address for that NFT (if any) is reset to none.\n event Approval(\n address indexed _owner,\n address indexed _approved,\n uint256 indexed _tokenId\n );\n\n /// @dev This emits when an operator is enabled or disabled for an owner.\n /// The operator can manage all NFTs of the owner.\n event ApprovalForAll(\n address indexed _owner,\n address indexed _operator,\n bool _approved\n );\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// perator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT. When transfer is complete, this function\n /// checks if `_to` is a smart contract (code size > 0). If so, it calls\n /// `onERC721Received` on `_to` and throws if the return value is not\n /// `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n /// @param _data Additional data with no specified format, sent in call to `_to`\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId,\n bytes _data\n )\n external;\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev This works identically to the other function with an extra data parameter,\n /// except this function just sets data to \"\".\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n external;\n\n /// @notice Change or reaffirm the approved address for an NFT\n /// @dev The zero address indicates there is no approved address.\n /// Throws unless `msg.sender` is the current NFT owner, or an authorized\n /// operator of the current owner.\n /// @param _approved The new approved NFT controller\n /// @param _tokenId The NFT to approve\n function approve(address _approved, uint256 _tokenId)\n external;\n\n /// @notice Enable or disable approval for a third party (\"operator\") to manage\n /// all of `msg.sender`'s assets\n /// @dev Emits the ApprovalForAll event. The contract MUST allow\n /// multiple operators per owner.\n /// @param _operator Address to add to the set of authorized operators\n /// @param _approved True if the operator is approved, false to revoke approval\n function setApprovalForAll(address _operator, bool _approved)\n external;\n\n /// @notice Count all NFTs assigned to an owner\n /// @dev NFTs assigned to the zero address are considered invalid, and this\n /// function throws for queries about the zero address.\n /// @param _owner An address for whom to query the balance\n /// @return The number of NFTs owned by `_owner`, possibly zero\n function balanceOf(address _owner)\n external\n view\n returns (uint256);\n\n /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE\n /// TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE\n /// THEY MAY BE PERMANENTLY LOST\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function transferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n public;\n\n /// @notice Find the owner of an NFT\n /// @dev NFTs assigned to zero address are considered invalid, and queries\n /// about them do throw.\n /// @param _tokenId The identifier for an NFT\n /// @return The address of the owner of the NFT\n function ownerOf(uint256 _tokenId)\n public\n view\n returns (address);\n\n /// @notice Get the approved address for a single NFT\n /// @dev Throws if `_tokenId` is not a valid NFT.\n /// @param _tokenId The NFT to find the approved address for\n /// @return The approved address for this NFT, or the zero address if there is none\n function getApproved(uint256 _tokenId) \n public\n view\n returns (address);\n \n /// @notice Query if an address is an authorized operator for another address\n /// @param _owner The address that owns the NFTs\n /// @param _operator The address that acts on behalf of the owner\n /// @return True if `_operator` is an approved operator for `_owner`, false otherwise\n function isApprovedForAll(address _owner, address _operator)\n public\n view\n returns (bool);\n}\n",
- "2.0.0/tokens/ERC721Token/MintableERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./ERC721Token.sol\";\n\n\ncontract MintableERC721Token is\n ERC721Token\n{\n /// @dev Function to mint a new token\n /// Reverts if the given token ID already exists\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _tokenId ID of the token to be minted by the msg.sender \n function _mint(address _to, uint256 _tokenId)\n internal\n {\n require(\n _to != address(0),\n \"ERC721_ZERO_TO_ADDRESS\"\n );\n\n address owner = owners[_tokenId];\n require(\n owner == address(0),\n \"ERC721_OWNER_ALREADY_EXISTS\"\n );\n\n owners[_tokenId] = _to;\n balances[_to] = safeAdd(balances[_to], 1);\n\n emit Transfer(\n address(0),\n _to,\n _tokenId\n );\n }\n\n /// @dev Function to burn a token\n /// Reverts if the given token ID doesn't exist\n /// @param _owner Owner of token with given token ID\n /// @param _tokenId ID of the token to be burned by the msg.sender\n function _burn(address _owner, uint256 _tokenId)\n internal\n {\n require(\n _owner != address(0),\n \"ERC721_ZERO_OWNER_ADDRESS\"\n );\n\n address owner = owners[_tokenId];\n require(\n owner == _owner,\n \"ERC721_OWNER_MISMATCH\"\n );\n\n owners[_tokenId] = address(0);\n balances[_owner] = safeSub(balances[_owner], 1);\n\n emit Transfer(\n _owner,\n address(0),\n _tokenId\n );\n }\n}\n",
- "2.0.0/tokens/EtherToken/IEtherToken.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../ERC20Token/IERC20Token.sol\";\n\n\ncontract IEtherToken is\n IERC20Token\n{\n function deposit()\n public\n payable;\n \n function withdraw(uint256 amount)\n public;\n}\n",
- "2.0.0/utils/LibBytes/LibBytes.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\nlibrary LibBytes {\n\n using LibBytes for bytes;\n\n /// @dev Gets the memory address for a byte array.\n /// @param input Byte array to lookup.\n /// @return memoryAddress Memory address of byte array. This\n /// points to the header of the byte array which contains\n /// the length.\n function rawAddress(bytes memory input)\n internal\n pure\n returns (uint256 memoryAddress)\n {\n assembly {\n memoryAddress := input\n }\n return memoryAddress;\n }\n \n /// @dev Gets the memory address for the contents of a byte array.\n /// @param input Byte array to lookup.\n /// @return memoryAddress Memory address of the contents of the byte array.\n function contentAddress(bytes memory input)\n internal\n pure\n returns (uint256 memoryAddress)\n {\n assembly {\n memoryAddress := add(input, 32)\n }\n return memoryAddress;\n }\n\n /// @dev Copies `length` bytes from memory location `source` to `dest`.\n /// @param dest memory address to copy bytes to.\n /// @param source memory address to copy bytes from.\n /// @param length number of bytes to copy.\n function memCopy(\n uint256 dest,\n uint256 source,\n uint256 length\n )\n internal\n pure\n {\n if (length < 32) {\n // Handle a partial word by reading destination and masking\n // off the bits we are interested in.\n // This correctly handles overlap, zero lengths and source == dest\n assembly {\n let mask := sub(exp(256, sub(32, length)), 1)\n let s := and(mload(source), not(mask))\n let d := and(mload(dest), mask)\n mstore(dest, or(s, d))\n }\n } else {\n // Skip the O(length) loop when source == dest.\n if (source == dest) {\n return;\n }\n\n // For large copies we copy whole words at a time. The final\n // word is aligned to the end of the range (instead of after the\n // previous) to handle partial words. So a copy will look like this:\n //\n // ####\n // ####\n // ####\n // ####\n //\n // We handle overlap in the source and destination range by\n // changing the copying direction. This prevents us from\n // overwriting parts of source that we still need to copy.\n //\n // This correctly handles source == dest\n //\n if (source > dest) {\n assembly {\n // We subtract 32 from `sEnd` and `dEnd` because it\n // is easier to compare with in the loop, and these\n // are also the addresses we need for copying the\n // last bytes.\n length := sub(length, 32)\n let sEnd := add(source, length)\n let dEnd := add(dest, length)\n\n // Remember the last 32 bytes of source\n // This needs to be done here and not after the loop\n // because we may have overwritten the last bytes in\n // source already due to overlap.\n let last := mload(sEnd)\n\n // Copy whole words front to back\n // Note: the first check is always true,\n // this could have been a do-while loop.\n // solhint-disable-next-line no-empty-blocks\n for {} lt(source, sEnd) {} {\n mstore(dest, mload(source))\n source := add(source, 32)\n dest := add(dest, 32)\n }\n \n // Write the last 32 bytes\n mstore(dEnd, last)\n }\n } else {\n assembly {\n // We subtract 32 from `sEnd` and `dEnd` because those\n // are the starting points when copying a word at the end.\n length := sub(length, 32)\n let sEnd := add(source, length)\n let dEnd := add(dest, length)\n\n // Remember the first 32 bytes of source\n // This needs to be done here and not after the loop\n // because we may have overwritten the first bytes in\n // source already due to overlap.\n let first := mload(source)\n\n // Copy whole words back to front\n // We use a signed comparisson here to allow dEnd to become\n // negative (happens when source and dest < 32). Valid\n // addresses in local memory will never be larger than\n // 2**255, so they can be safely re-interpreted as signed.\n // Note: the first check is always true,\n // this could have been a do-while loop.\n // solhint-disable-next-line no-empty-blocks\n for {} slt(dest, dEnd) {} {\n mstore(dEnd, mload(sEnd))\n sEnd := sub(sEnd, 32)\n dEnd := sub(dEnd, 32)\n }\n \n // Write the first 32 bytes\n mstore(dest, first)\n }\n }\n }\n }\n\n /// @dev Returns a slices from a byte array.\n /// @param b The byte array to take a slice from.\n /// @param from The starting index for the slice (inclusive).\n /// @param to The final index for the slice (exclusive).\n /// @return result The slice containing bytes at indices [from, to)\n function slice(\n bytes memory b,\n uint256 from,\n uint256 to\n )\n internal\n pure\n returns (bytes memory result)\n {\n require(\n from <= to,\n \"FROM_LESS_THAN_TO_REQUIRED\"\n );\n require(\n to < b.length,\n \"TO_LESS_THAN_LENGTH_REQUIRED\"\n );\n \n // Create a new bytes structure and copy contents\n result = new bytes(to - from);\n memCopy(\n result.contentAddress(),\n b.contentAddress() + from,\n result.length\n );\n return result;\n }\n \n /// @dev Returns a slice from a byte array without preserving the input.\n /// @param b The byte array to take a slice from. Will be destroyed in the process.\n /// @param from The starting index for the slice (inclusive).\n /// @param to The final index for the slice (exclusive).\n /// @return result The slice containing bytes at indices [from, to)\n /// @dev When `from == 0`, the original array will match the slice. In other cases its state will be corrupted.\n function sliceDestructive(\n bytes memory b,\n uint256 from,\n uint256 to\n )\n internal\n pure\n returns (bytes memory result)\n {\n require(\n from <= to,\n \"FROM_LESS_THAN_TO_REQUIRED\"\n );\n require(\n to < b.length,\n \"TO_LESS_THAN_LENGTH_REQUIRED\"\n );\n \n // Create a new bytes structure around [from, to) in-place.\n assembly {\n result := add(b, from)\n mstore(result, sub(to, from))\n }\n return result;\n }\n\n /// @dev Pops the last byte off of a byte array by modifying its length.\n /// @param b Byte array that will be modified.\n /// @return The byte that was popped off.\n function popLastByte(bytes memory b)\n internal\n pure\n returns (bytes1 result)\n {\n require(\n b.length > 0,\n \"GREATER_THAN_ZERO_LENGTH_REQUIRED\"\n );\n\n // Store last byte.\n result = b[b.length - 1];\n\n assembly {\n // Decrement length of byte array.\n let newLen := sub(mload(b), 1)\n mstore(b, newLen)\n }\n return result;\n }\n\n /// @dev Pops the last 20 bytes off of a byte array by modifying its length.\n /// @param b Byte array that will be modified.\n /// @return The 20 byte address that was popped off.\n function popLast20Bytes(bytes memory b)\n internal\n pure\n returns (address result)\n {\n require(\n b.length >= 20,\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Store last 20 bytes.\n result = readAddress(b, b.length - 20);\n\n assembly {\n // Subtract 20 from byte array length.\n let newLen := sub(mload(b), 20)\n mstore(b, newLen)\n }\n return result;\n }\n\n /// @dev Tests equality of two byte arrays.\n /// @param lhs First byte array to compare.\n /// @param rhs Second byte array to compare.\n /// @return True if arrays are the same. False otherwise.\n function equals(\n bytes memory lhs,\n bytes memory rhs\n )\n internal\n pure\n returns (bool equal)\n {\n // Keccak gas cost is 30 + numWords * 6. This is a cheap way to compare.\n // We early exit on unequal lengths, but keccak would also correctly\n // handle this.\n return lhs.length == rhs.length && keccak256(lhs) == keccak256(rhs);\n }\n\n /// @dev Reads an address from a position in a byte array.\n /// @param b Byte array containing an address.\n /// @param index Index in byte array of address.\n /// @return address from byte array.\n function readAddress(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (address result)\n {\n require(\n b.length >= index + 20, // 20 is length of address\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Add offset to index:\n // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)\n // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)\n index += 20;\n\n // Read address from array memory\n assembly {\n // 1. Add index to address of bytes array\n // 2. Load 32-byte word from memory\n // 3. Apply 20-byte mask to obtain address\n result := and(mload(add(b, index)), 0xffffffffffffffffffffffffffffffffffffffff)\n }\n return result;\n }\n\n /// @dev Writes an address into a specific position in a byte array.\n /// @param b Byte array to insert address into.\n /// @param index Index in byte array of address.\n /// @param input Address to put into byte array.\n function writeAddress(\n bytes memory b,\n uint256 index,\n address input\n )\n internal\n pure\n {\n require(\n b.length >= index + 20, // 20 is length of address\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Add offset to index:\n // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)\n // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)\n index += 20;\n\n // Store address into array memory\n assembly {\n // The address occupies 20 bytes and mstore stores 32 bytes.\n // First fetch the 32-byte word where we'll be storing the address, then\n // apply a mask so we have only the bytes in the word that the address will not occupy.\n // Then combine these bytes with the address and store the 32 bytes back to memory with mstore.\n\n // 1. Add index to address of bytes array\n // 2. Load 32-byte word from memory\n // 3. Apply 12-byte mask to obtain extra bytes occupying word of memory where we'll store the address\n let neighbors := and(\n mload(add(b, index)),\n 0xffffffffffffffffffffffff0000000000000000000000000000000000000000\n )\n \n // Make sure input address is clean.\n // (Solidity does not guarantee this)\n input := and(input, 0xffffffffffffffffffffffffffffffffffffffff)\n\n // Store the neighbors and address into memory\n mstore(add(b, index), xor(input, neighbors))\n }\n }\n\n /// @dev Reads a bytes32 value from a position in a byte array.\n /// @param b Byte array containing a bytes32 value.\n /// @param index Index in byte array of bytes32 value.\n /// @return bytes32 value from byte array.\n function readBytes32(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes32 result)\n {\n require(\n b.length >= index + 32,\n \"GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 256 bit length parameter\n index += 32;\n\n // Read the bytes32 from array memory\n assembly {\n result := mload(add(b, index))\n }\n return result;\n }\n\n /// @dev Writes a bytes32 into a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input bytes32 to put into byte array.\n function writeBytes32(\n bytes memory b,\n uint256 index,\n bytes32 input\n )\n internal\n pure\n {\n require(\n b.length >= index + 32,\n \"GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 256 bit length parameter\n index += 32;\n\n // Read the bytes32 from array memory\n assembly {\n mstore(add(b, index), input)\n }\n }\n\n /// @dev Reads a uint256 value from a position in a byte array.\n /// @param b Byte array containing a uint256 value.\n /// @param index Index in byte array of uint256 value.\n /// @return uint256 value from byte array.\n function readUint256(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (uint256 result)\n {\n result = uint256(readBytes32(b, index));\n return result;\n }\n\n /// @dev Writes a uint256 into a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input uint256 to put into byte array.\n function writeUint256(\n bytes memory b,\n uint256 index,\n uint256 input\n )\n internal\n pure\n {\n writeBytes32(b, index, bytes32(input));\n }\n\n /// @dev Reads an unpadded bytes4 value from a position in a byte array.\n /// @param b Byte array containing a bytes4 value.\n /// @param index Index in byte array of bytes4 value.\n /// @return bytes4 value from byte array.\n function readBytes4(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes4 result)\n {\n require(\n b.length >= index + 4,\n \"GREATER_OR_EQUAL_TO_4_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 32 byte length field\n index += 32;\n\n // Read the bytes4 from array memory\n assembly {\n result := mload(add(b, index))\n // Solidity does not require us to clean the trailing bytes.\n // We do it anyway\n result := and(result, 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000)\n }\n return result;\n }\n\n /// @dev Reads nested bytes from a specific position.\n /// @dev NOTE: the returned value overlaps with the input value.\n /// Both should be treated as immutable.\n /// @param b Byte array containing nested bytes.\n /// @param index Index of nested bytes.\n /// @return result Nested bytes.\n function readBytesWithLength(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes memory result)\n {\n // Read length of nested bytes\n uint256 nestedBytesLength = readUint256(b, index);\n index += 32;\n\n // Assert length of <b> is valid, given\n // length of nested bytes\n require(\n b.length >= index + nestedBytesLength,\n \"GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED\"\n );\n \n // Return a pointer to the byte array as it exists inside `b`\n assembly {\n result := add(b, index)\n }\n return result;\n }\n\n /// @dev Inserts bytes at a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input bytes to insert.\n function writeBytesWithLength(\n bytes memory b,\n uint256 index,\n bytes memory input\n )\n internal\n pure\n {\n // Assert length of <b> is valid, given\n // length of input\n require(\n b.length >= index + 32 + input.length, // 32 bytes to store length\n \"GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED\"\n );\n\n // Copy <input> into <b>\n memCopy(\n b.contentAddress() + index,\n input.rawAddress(), // includes length of <input>\n input.length + 32 // +32 bytes to store <input> length\n );\n }\n\n /// @dev Performs a deep copy of a byte array onto another byte array of greater than or equal length.\n /// @param dest Byte array that will be overwritten with source bytes.\n /// @param source Byte array to copy onto dest bytes.\n function deepCopyBytes(\n bytes memory dest,\n bytes memory source\n )\n internal\n pure\n {\n uint256 sourceLen = source.length;\n // Dest length must be >= source length, or some bytes would not be copied.\n require(\n dest.length >= sourceLen,\n \"GREATER_OR_EQUAL_TO_SOURCE_BYTES_LENGTH_REQUIRED\"\n );\n memCopy(\n dest.contentAddress(),\n source.contentAddress(),\n sourceLen\n );\n }\n}\n",
- "2.0.0/utils/Ownable/IOwnable.sol": "pragma solidity 0.4.24;\n\n\ncontract IOwnable {\n\n function transferOwnership(address newOwner)\n public;\n}\n",
- "2.0.0/utils/Ownable/Ownable.sol": "pragma solidity 0.4.24;\n\nimport \"./IOwnable.sol\";\n\n\ncontract Ownable is\n IOwnable\n{\n address public owner;\n\n constructor ()\n public\n {\n owner = msg.sender;\n }\n\n modifier onlyOwner() {\n require(\n msg.sender == owner,\n \"ONLY_CONTRACT_OWNER\"\n );\n _;\n }\n\n function transferOwnership(address newOwner)\n public\n onlyOwner\n {\n if (newOwner != address(0)) {\n owner = newOwner;\n }\n }\n}\n",
- "2.0.0/utils/ReentrancyGuard/ReentrancyGuard.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract ReentrancyGuard {\n\n // Locked state of mutex\n bool private locked = false;\n\n /// @dev Functions with this modifer cannot be reentered. The mutex will be locked\n /// before function execution and unlocked after.\n modifier nonReentrant() {\n // Ensure mutex is unlocked\n require(\n !locked,\n \"REENTRANCY_ILLEGAL\"\n );\n\n // Lock mutex before function call\n locked = true;\n\n // Perform function call\n _;\n\n // Unlock mutex after function call\n locked = false;\n }\n}\n",
- "2.0.0/utils/SafeMath/SafeMath.sol": "pragma solidity 0.4.24;\n\n\ncontract SafeMath {\n\n function safeMul(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n if (a == 0) {\n return 0;\n }\n uint256 c = a * b;\n require(\n c / a == b,\n \"UINT256_OVERFLOW\"\n );\n return c;\n }\n\n function safeDiv(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n uint256 c = a / b;\n return c;\n }\n\n function safeSub(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n require(\n b <= a,\n \"UINT256_UNDERFLOW\"\n );\n return a - b;\n }\n\n function safeAdd(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n uint256 c = a + b;\n require(\n c >= a,\n \"UINT256_OVERFLOW\"\n );\n return c;\n }\n\n function max64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n\n function max256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n}\n"
- },
- "sourceTreeHashHex": "0xee0dcd8415ba0737890f13994332b71d7fbed7c79041929a551c334c497db064",
- "compiler": {
- "name": "solc",
- "version": "soljson-v0.4.24+commit.e67f0147.js",
- "settings": {
- "optimizer": {
- "enabled": true,
- "runs": 1000000
- },
- "outputSelection": {
- "*": {
- "*": [
- "abi",
- "evm.bytecode.object",
- "evm.bytecode.sourceMap",
- "evm.deployedBytecode.object",
- "evm.deployedBytecode.sourceMap"
- ]
- }
- }
- }
- },
- "networks": {}
-} \ No newline at end of file
diff --git a/packages/migrations/artifacts/2.0.0/ERC721Proxy.json b/packages/migrations/artifacts/2.0.0/ERC721Proxy.json
deleted file mode 100644
index 2359c0519..000000000
--- a/packages/migrations/artifacts/2.0.0/ERC721Proxy.json
+++ /dev/null
@@ -1,481 +0,0 @@
-{
- "schemaVersion": "2.0.0",
- "contractName": "ERC721Proxy",
- "compilerOutput": {
- "abi": [
- {
- "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": 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": 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"
- }
- ],
- "evm": {
- "bytecode": {
- "linkReferences": {},
- "object": "0x608060405260008054600160a060020a03191633179055610fbe806100256000396000f3006080604052600436106100985763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166342f1181e81146102bc578063494503d4146102ec578063707129391461032d5780638da5cb5b1461035b5780639ad2674414610370578063ae25532e146103a1578063b9181611146103eb578063d39de6e91461042d578063f2fde38b14610492575b3480156100a457600080fd5b507fffffffff00000000000000000000000000000000000000000000000000000000600035167fa85e59e4000000000000000000000000000000000000000000000000000000008114156102b757604080513381526001602082015290812054151561017b577f08c379a0000000000000000000000000000000000000000000000000000000006000527c20000000000000000000000000000000000000000000000000000000006020527c1553454e4445525f4e4f545f415554484f52495a454400000000000000604052600060605260646000fd5b600160643503156101f7577f08c379a0000000000000000000000000000000000000000000000000000000006000527c20000000000000000000000000000000000000000000000000000000006020527c0e494e56414c49445f414d4f554e540000000000000000000000000000604052600060605260646000fd5b7f23b872dd000000000000000000000000000000000000000000000000000000006000526040602460043760043560206048820160443760288101356000806064600080855af1801561024657005b7f08c379a0000000000000000000000000000000000000000000000000000000006000527c20000000000000000000000000000000000000000000000000000000006020527c0f5452414e534645525f4641494c454400000000000000000000000000604052600060605260646000fd5b600080fd5b3480156102c857600080fd5b506102ea73ffffffffffffffffffffffffffffffffffffffff600435166104c0565b005b3480156102f857600080fd5b506103046004356106ac565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b34801561033957600080fd5b506102ea73ffffffffffffffffffffffffffffffffffffffff600435166106e1565b34801561036757600080fd5b506103046109da565b34801561037c57600080fd5b506102ea73ffffffffffffffffffffffffffffffffffffffff600435166024356109f6565b3480156103ad57600080fd5b506103b6610dab565b604080517fffffffff000000000000000000000000000000000000000000000000000000009092168252519081900360200190f35b3480156103f757600080fd5b5061041973ffffffffffffffffffffffffffffffffffffffff60043516610de1565b604080519115158252519081900360200190f35b34801561043957600080fd5b50610442610df6565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561047e578181015183820152602001610466565b505050509050019250505060405180910390f35b34801561049e57600080fd5b506102ea73ffffffffffffffffffffffffffffffffffffffff60043516610e65565b60005473ffffffffffffffffffffffffffffffffffffffff16331461054657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff811660009081526001602052604090205460ff16156105db57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f5441524745545f414c52454144595f415554484f52495a454400000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8116600081815260016020819052604080832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168317905560028054928301815583527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace90910180547fffffffffffffffffffffffff00000000000000000000000000000000000000001684179055513392917f3147867c59d17e8fa9d522465651d44aae0a9e38f902f3475b97e58072f0ed4c91a350565b60028054829081106106ba57fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b6000805473ffffffffffffffffffffffffffffffffffffffff16331461076857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff821660009081526001602052604090205460ff1615156107fe57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f5441524745545f4e4f545f415554484f52495a45440000000000000000000000604482015290519081900360640190fd5b5073ffffffffffffffffffffffffffffffffffffffff8116600090815260016020526040812080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690555b600254811015610993578173ffffffffffffffffffffffffffffffffffffffff1660028281548110151561087b57fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16141561098b57600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81019081106108d357fe5b6000918252602090912001546002805473ffffffffffffffffffffffffffffffffffffffff909216918390811061090657fe5b600091825260209091200180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01906109859082610f4b565b50610993565b60010161084b565b604051339073ffffffffffffffffffffffffffffffffffffffff8416907f1f32c1b084e2de0713b8fb16bd46bb9df710a3dbeae2f3ca93af46e016dcc6b090600090a35050565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b60005473ffffffffffffffffffffffffffffffffffffffff163314610a7c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff821660009081526001602052604090205460ff161515610b1257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f5441524745545f4e4f545f415554484f52495a45440000000000000000000000604482015290519081900360640190fd5b6002548110610b8257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f494e4445585f4f55545f4f465f424f554e445300000000000000000000000000604482015290519081900360640190fd5b8173ffffffffffffffffffffffffffffffffffffffff16600282815481101515610ba857fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff1614610c3657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f415554484f52495a45445f414444524553535f4d49534d415443480000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8216600090815260016020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8101908110610cb157fe5b6000918252602090912001546002805473ffffffffffffffffffffffffffffffffffffffff9092169183908110610ce457fe5b600091825260209091200180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190610d639082610f4b565b50604051339073ffffffffffffffffffffffffffffffffffffffff8416907f1f32c1b084e2de0713b8fb16bd46bb9df710a3dbeae2f3ca93af46e016dcc6b090600090a35050565b604080517f455243373231546f6b656e28616464726573732c75696e7432353629000000008152905190819003601c0190205b90565b60016020526000908152604090205460ff1681565b60606002805480602002602001604051908101604052809291908181526020018280548015610e5b57602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610e30575b5050505050905090565b60005473ffffffffffffffffffffffffffffffffffffffff163314610eeb57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff811615610f4857600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83161790555b50565b815481835581811115610f6f57600083815260209020610f6f918101908301610f74565b505050565b610dde91905b80821115610f8e5760008155600101610f7a565b50905600a165627a7a7230582051377ae1ca7b3f3d032510ea8cba18dc3e6ce467f660ab6b18edebeb780449c60029",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 SLOAD PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB NOT AND CALLER OR SWAP1 SSTORE PUSH2 0xFBE DUP1 PUSH2 0x25 PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN STOP PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x98 JUMPI PUSH4 0xFFFFFFFF PUSH29 0x100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD DIV AND PUSH4 0x42F1181E DUP2 EQ PUSH2 0x2BC JUMPI DUP1 PUSH4 0x494503D4 EQ PUSH2 0x2EC JUMPI DUP1 PUSH4 0x70712939 EQ PUSH2 0x32D JUMPI DUP1 PUSH4 0x8DA5CB5B EQ PUSH2 0x35B JUMPI DUP1 PUSH4 0x9AD26744 EQ PUSH2 0x370 JUMPI DUP1 PUSH4 0xAE25532E EQ PUSH2 0x3A1 JUMPI DUP1 PUSH4 0xB9181611 EQ PUSH2 0x3EB JUMPI DUP1 PUSH4 0xD39DE6E9 EQ PUSH2 0x42D JUMPI DUP1 PUSH4 0xF2FDE38B EQ PUSH2 0x492 JUMPI JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xA4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD AND PUSH32 0xA85E59E400000000000000000000000000000000000000000000000000000000 DUP2 EQ ISZERO PUSH2 0x2B7 JUMPI PUSH1 0x40 DUP1 MLOAD CALLER DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 DUP3 ADD MSTORE SWAP1 DUP2 KECCAK256 SLOAD ISZERO ISZERO PUSH2 0x17B JUMPI PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH29 0x2000000000000000000000000000000000000000000000000000000000 PUSH1 0x20 MSTORE PUSH29 0x1553454E4445525F4E4F545F415554484F52495A454400000000000000 PUSH1 0x40 MSTORE PUSH1 0x0 PUSH1 0x60 MSTORE PUSH1 0x64 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x1 PUSH1 0x64 CALLDATALOAD SUB ISZERO PUSH2 0x1F7 JUMPI PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH29 0x2000000000000000000000000000000000000000000000000000000000 PUSH1 0x20 MSTORE PUSH29 0xE494E56414C49445F414D4F554E540000000000000000000000000000 PUSH1 0x40 MSTORE PUSH1 0x0 PUSH1 0x60 MSTORE PUSH1 0x64 PUSH1 0x0 REVERT JUMPDEST PUSH32 0x23B872DD00000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x24 PUSH1 0x4 CALLDATACOPY PUSH1 0x4 CALLDATALOAD PUSH1 0x20 PUSH1 0x48 DUP3 ADD PUSH1 0x44 CALLDATACOPY PUSH1 0x28 DUP2 ADD CALLDATALOAD PUSH1 0x0 DUP1 PUSH1 0x64 PUSH1 0x0 DUP1 DUP6 GAS CALL DUP1 ISZERO PUSH2 0x246 JUMPI STOP JUMPDEST PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH29 0x2000000000000000000000000000000000000000000000000000000000 PUSH1 0x20 MSTORE PUSH29 0xF5452414E534645525F4641494C454400000000000000000000000000 PUSH1 0x40 MSTORE PUSH1 0x0 PUSH1 0x60 MSTORE PUSH1 0x64 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2C8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2EA PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x4C0 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2F8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x304 PUSH1 0x4 CALLDATALOAD PUSH2 0x6AC JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x339 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2EA PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x6E1 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x367 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x304 PUSH2 0x9DA JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x37C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2EA PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x9F6 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3AD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x3B6 PUSH2 0xDAB JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 SWAP1 SWAP3 AND DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3F7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x419 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0xDE1 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 ISZERO ISZERO DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x439 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x442 PUSH2 0xDF6 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 DUP1 DUP3 MSTORE DUP4 MLOAD DUP2 DUP4 ADD MSTORE DUP4 MLOAD SWAP2 SWAP3 DUP4 SWAP3 SWAP1 DUP4 ADD SWAP2 DUP6 DUP2 ADD SWAP2 MUL DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x47E JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH2 0x466 JUMP JUMPDEST POP POP POP POP SWAP1 POP ADD SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x49E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2EA PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0xE65 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0x546 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x5DB JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x19 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x5441524745545F414C52454144595F415554484F52495A454400000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND DUP4 OR SWAP1 SSTORE PUSH1 0x2 DUP1 SLOAD SWAP3 DUP4 ADD DUP2 SSTORE DUP4 MSTORE PUSH32 0x405787FA12A823E0F2B7631CC41B3BA8828B3321CA811111FA75CD3AA3BB5ACE SWAP1 SWAP2 ADD DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND DUP5 OR SWAP1 SSTORE MLOAD CALLER SWAP3 SWAP2 PUSH32 0x3147867C59D17E8FA9D522465651D44AAE0A9E38F902F3475B97E58072F0ED4C SWAP2 LOG3 POP JUMP JUMPDEST PUSH1 0x2 DUP1 SLOAD DUP3 SWAP1 DUP2 LT PUSH2 0x6BA JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 POP DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0x768 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND ISZERO ISZERO PUSH2 0x7FE JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x15 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x5441524745545F4E4F545F415554484F52495A45440000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 DUP2 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE JUMPDEST PUSH1 0x2 SLOAD DUP2 LT ISZERO PUSH2 0x993 JUMPI DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x2 DUP3 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x87B JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0x98B JUMPI PUSH1 0x2 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 ADD SWAP1 DUP2 LT PUSH2 0x8D3 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH1 0x2 DUP1 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND SWAP2 DUP4 SWAP1 DUP2 LT PUSH2 0x906 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP3 SWAP1 SWAP3 AND SWAP2 SWAP1 SWAP2 OR SWAP1 SSTORE PUSH1 0x2 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 PUSH2 0x985 SWAP1 DUP3 PUSH2 0xF4B JUMP JUMPDEST POP PUSH2 0x993 JUMP JUMPDEST PUSH1 0x1 ADD PUSH2 0x84B JUMP JUMPDEST PUSH1 0x40 MLOAD CALLER SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND SWAP1 PUSH32 0x1F32C1B084E2DE0713B8FB16BD46BB9DF710A3DBEAE2F3CA93AF46E016DCC6B0 SWAP1 PUSH1 0x0 SWAP1 LOG3 POP POP JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0xA7C JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND ISZERO ISZERO PUSH2 0xB12 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x15 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x5441524745545F4E4F545F415554484F52495A45440000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x2 SLOAD DUP2 LT PUSH2 0xB82 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x494E4445585F4F55545F4F465F424F554E445300000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x2 DUP3 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0xBA8 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0xC36 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x1B PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x415554484F52495A45445F414444524553535F4D49534D415443480000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE PUSH1 0x2 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 ADD SWAP1 DUP2 LT PUSH2 0xCB1 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH1 0x2 DUP1 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND SWAP2 DUP4 SWAP1 DUP2 LT PUSH2 0xCE4 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP3 SWAP1 SWAP3 AND SWAP2 SWAP1 SWAP2 OR SWAP1 SSTORE PUSH1 0x2 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 PUSH2 0xD63 SWAP1 DUP3 PUSH2 0xF4B JUMP JUMPDEST POP PUSH1 0x40 MLOAD CALLER SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND SWAP1 PUSH32 0x1F32C1B084E2DE0713B8FB16BD46BB9DF710A3DBEAE2F3CA93AF46E016DCC6B0 SWAP1 PUSH1 0x0 SWAP1 LOG3 POP POP JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0x455243373231546F6B656E28616464726573732C75696E743235362900000000 DUP2 MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x1C ADD SWAP1 KECCAK256 JUMPDEST SWAP1 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x2 DUP1 SLOAD DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD DUP1 ISZERO PUSH2 0xE5B JUMPI PUSH1 0x20 MUL DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x1 SWAP1 SWAP2 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0xE30 JUMPI JUMPDEST POP POP POP POP POP SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0xEEB JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND ISZERO PUSH2 0xF48 JUMPI PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND OR SWAP1 SSTORE JUMPDEST POP JUMP JUMPDEST DUP2 SLOAD DUP2 DUP4 SSTORE DUP2 DUP2 GT ISZERO PUSH2 0xF6F JUMPI PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x20 SWAP1 KECCAK256 PUSH2 0xF6F SWAP2 DUP2 ADD SWAP1 DUP4 ADD PUSH2 0xF74 JUMP JUMPDEST POP POP POP JUMP JUMPDEST PUSH2 0xDDE SWAP2 SWAP1 JUMPDEST DUP1 DUP3 GT ISZERO PUSH2 0xF8E JUMPI PUSH1 0x0 DUP2 SSTORE PUSH1 0x1 ADD PUSH2 0xF7A JUMP JUMPDEST POP SWAP1 JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 MLOAD CALLDATACOPY PUSH27 0xE1CA7B3F3D032510EA8CBA18DC3E6CE467F660AB6B18EDEBEB7804 0x49 0xc6 STOP 0x29 ",
- "sourceMap": "641:7861:15:-;;;162:5:55;:18;;-1:-1:-1;;;;;;162:18:55;170:10;162:18;;;641:7861:15;;;;;;"
- },
- "deployedBytecode": {
- "linkReferences": {},
- "object": "0x6080604052600436106100985763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166342f1181e81146102bc578063494503d4146102ec578063707129391461032d5780638da5cb5b1461035b5780639ad2674414610370578063ae25532e146103a1578063b9181611146103eb578063d39de6e91461042d578063f2fde38b14610492575b3480156100a457600080fd5b507fffffffff00000000000000000000000000000000000000000000000000000000600035167fa85e59e4000000000000000000000000000000000000000000000000000000008114156102b757604080513381526001602082015290812054151561017b577f08c379a0000000000000000000000000000000000000000000000000000000006000527c20000000000000000000000000000000000000000000000000000000006020527c1553454e4445525f4e4f545f415554484f52495a454400000000000000604052600060605260646000fd5b600160643503156101f7577f08c379a0000000000000000000000000000000000000000000000000000000006000527c20000000000000000000000000000000000000000000000000000000006020527c0e494e56414c49445f414d4f554e540000000000000000000000000000604052600060605260646000fd5b7f23b872dd000000000000000000000000000000000000000000000000000000006000526040602460043760043560206048820160443760288101356000806064600080855af1801561024657005b7f08c379a0000000000000000000000000000000000000000000000000000000006000527c20000000000000000000000000000000000000000000000000000000006020527c0f5452414e534645525f4641494c454400000000000000000000000000604052600060605260646000fd5b600080fd5b3480156102c857600080fd5b506102ea73ffffffffffffffffffffffffffffffffffffffff600435166104c0565b005b3480156102f857600080fd5b506103046004356106ac565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b34801561033957600080fd5b506102ea73ffffffffffffffffffffffffffffffffffffffff600435166106e1565b34801561036757600080fd5b506103046109da565b34801561037c57600080fd5b506102ea73ffffffffffffffffffffffffffffffffffffffff600435166024356109f6565b3480156103ad57600080fd5b506103b6610dab565b604080517fffffffff000000000000000000000000000000000000000000000000000000009092168252519081900360200190f35b3480156103f757600080fd5b5061041973ffffffffffffffffffffffffffffffffffffffff60043516610de1565b604080519115158252519081900360200190f35b34801561043957600080fd5b50610442610df6565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561047e578181015183820152602001610466565b505050509050019250505060405180910390f35b34801561049e57600080fd5b506102ea73ffffffffffffffffffffffffffffffffffffffff60043516610e65565b60005473ffffffffffffffffffffffffffffffffffffffff16331461054657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff811660009081526001602052604090205460ff16156105db57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f5441524745545f414c52454144595f415554484f52495a454400000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8116600081815260016020819052604080832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168317905560028054928301815583527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace90910180547fffffffffffffffffffffffff00000000000000000000000000000000000000001684179055513392917f3147867c59d17e8fa9d522465651d44aae0a9e38f902f3475b97e58072f0ed4c91a350565b60028054829081106106ba57fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b6000805473ffffffffffffffffffffffffffffffffffffffff16331461076857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff821660009081526001602052604090205460ff1615156107fe57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f5441524745545f4e4f545f415554484f52495a45440000000000000000000000604482015290519081900360640190fd5b5073ffffffffffffffffffffffffffffffffffffffff8116600090815260016020526040812080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690555b600254811015610993578173ffffffffffffffffffffffffffffffffffffffff1660028281548110151561087b57fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16141561098b57600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81019081106108d357fe5b6000918252602090912001546002805473ffffffffffffffffffffffffffffffffffffffff909216918390811061090657fe5b600091825260209091200180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01906109859082610f4b565b50610993565b60010161084b565b604051339073ffffffffffffffffffffffffffffffffffffffff8416907f1f32c1b084e2de0713b8fb16bd46bb9df710a3dbeae2f3ca93af46e016dcc6b090600090a35050565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b60005473ffffffffffffffffffffffffffffffffffffffff163314610a7c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff821660009081526001602052604090205460ff161515610b1257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f5441524745545f4e4f545f415554484f52495a45440000000000000000000000604482015290519081900360640190fd5b6002548110610b8257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f494e4445585f4f55545f4f465f424f554e445300000000000000000000000000604482015290519081900360640190fd5b8173ffffffffffffffffffffffffffffffffffffffff16600282815481101515610ba857fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff1614610c3657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f415554484f52495a45445f414444524553535f4d49534d415443480000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8216600090815260016020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8101908110610cb157fe5b6000918252602090912001546002805473ffffffffffffffffffffffffffffffffffffffff9092169183908110610ce457fe5b600091825260209091200180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190610d639082610f4b565b50604051339073ffffffffffffffffffffffffffffffffffffffff8416907f1f32c1b084e2de0713b8fb16bd46bb9df710a3dbeae2f3ca93af46e016dcc6b090600090a35050565b604080517f455243373231546f6b656e28616464726573732c75696e7432353629000000008152905190819003601c0190205b90565b60016020526000908152604090205460ff1681565b60606002805480602002602001604051908101604052809291908181526020018280548015610e5b57602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610e30575b5050505050905090565b60005473ffffffffffffffffffffffffffffffffffffffff163314610eeb57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff811615610f4857600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83161790555b50565b815481835581811115610f6f57600083815260209020610f6f918101908301610f74565b505050565b610dde91905b80821115610f8e5760008155600101610f7a565b50905600a165627a7a7230582051377ae1ca7b3f3d032510ea8cba18dc3e6ce467f660ab6b18edebeb780449c60029",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x98 JUMPI PUSH4 0xFFFFFFFF PUSH29 0x100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD DIV AND PUSH4 0x42F1181E DUP2 EQ PUSH2 0x2BC JUMPI DUP1 PUSH4 0x494503D4 EQ PUSH2 0x2EC JUMPI DUP1 PUSH4 0x70712939 EQ PUSH2 0x32D JUMPI DUP1 PUSH4 0x8DA5CB5B EQ PUSH2 0x35B JUMPI DUP1 PUSH4 0x9AD26744 EQ PUSH2 0x370 JUMPI DUP1 PUSH4 0xAE25532E EQ PUSH2 0x3A1 JUMPI DUP1 PUSH4 0xB9181611 EQ PUSH2 0x3EB JUMPI DUP1 PUSH4 0xD39DE6E9 EQ PUSH2 0x42D JUMPI DUP1 PUSH4 0xF2FDE38B EQ PUSH2 0x492 JUMPI JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xA4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD AND PUSH32 0xA85E59E400000000000000000000000000000000000000000000000000000000 DUP2 EQ ISZERO PUSH2 0x2B7 JUMPI PUSH1 0x40 DUP1 MLOAD CALLER DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 DUP3 ADD MSTORE SWAP1 DUP2 KECCAK256 SLOAD ISZERO ISZERO PUSH2 0x17B JUMPI PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH29 0x2000000000000000000000000000000000000000000000000000000000 PUSH1 0x20 MSTORE PUSH29 0x1553454E4445525F4E4F545F415554484F52495A454400000000000000 PUSH1 0x40 MSTORE PUSH1 0x0 PUSH1 0x60 MSTORE PUSH1 0x64 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x1 PUSH1 0x64 CALLDATALOAD SUB ISZERO PUSH2 0x1F7 JUMPI PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH29 0x2000000000000000000000000000000000000000000000000000000000 PUSH1 0x20 MSTORE PUSH29 0xE494E56414C49445F414D4F554E540000000000000000000000000000 PUSH1 0x40 MSTORE PUSH1 0x0 PUSH1 0x60 MSTORE PUSH1 0x64 PUSH1 0x0 REVERT JUMPDEST PUSH32 0x23B872DD00000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x24 PUSH1 0x4 CALLDATACOPY PUSH1 0x4 CALLDATALOAD PUSH1 0x20 PUSH1 0x48 DUP3 ADD PUSH1 0x44 CALLDATACOPY PUSH1 0x28 DUP2 ADD CALLDATALOAD PUSH1 0x0 DUP1 PUSH1 0x64 PUSH1 0x0 DUP1 DUP6 GAS CALL DUP1 ISZERO PUSH2 0x246 JUMPI STOP JUMPDEST PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH29 0x2000000000000000000000000000000000000000000000000000000000 PUSH1 0x20 MSTORE PUSH29 0xF5452414E534645525F4641494C454400000000000000000000000000 PUSH1 0x40 MSTORE PUSH1 0x0 PUSH1 0x60 MSTORE PUSH1 0x64 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2C8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2EA PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x4C0 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2F8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x304 PUSH1 0x4 CALLDATALOAD PUSH2 0x6AC JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x339 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2EA PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x6E1 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x367 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x304 PUSH2 0x9DA JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x37C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2EA PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x9F6 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3AD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x3B6 PUSH2 0xDAB JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 SWAP1 SWAP3 AND DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3F7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x419 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0xDE1 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 ISZERO ISZERO DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x439 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x442 PUSH2 0xDF6 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 DUP1 DUP3 MSTORE DUP4 MLOAD DUP2 DUP4 ADD MSTORE DUP4 MLOAD SWAP2 SWAP3 DUP4 SWAP3 SWAP1 DUP4 ADD SWAP2 DUP6 DUP2 ADD SWAP2 MUL DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x47E JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH2 0x466 JUMP JUMPDEST POP POP POP POP SWAP1 POP ADD SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x49E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2EA PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0xE65 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0x546 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x5DB JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x19 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x5441524745545F414C52454144595F415554484F52495A454400000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND DUP4 OR SWAP1 SSTORE PUSH1 0x2 DUP1 SLOAD SWAP3 DUP4 ADD DUP2 SSTORE DUP4 MSTORE PUSH32 0x405787FA12A823E0F2B7631CC41B3BA8828B3321CA811111FA75CD3AA3BB5ACE SWAP1 SWAP2 ADD DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND DUP5 OR SWAP1 SSTORE MLOAD CALLER SWAP3 SWAP2 PUSH32 0x3147867C59D17E8FA9D522465651D44AAE0A9E38F902F3475B97E58072F0ED4C SWAP2 LOG3 POP JUMP JUMPDEST PUSH1 0x2 DUP1 SLOAD DUP3 SWAP1 DUP2 LT PUSH2 0x6BA JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 POP DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0x768 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND ISZERO ISZERO PUSH2 0x7FE JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x15 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x5441524745545F4E4F545F415554484F52495A45440000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 DUP2 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE JUMPDEST PUSH1 0x2 SLOAD DUP2 LT ISZERO PUSH2 0x993 JUMPI DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x2 DUP3 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0x87B JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0x98B JUMPI PUSH1 0x2 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 ADD SWAP1 DUP2 LT PUSH2 0x8D3 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH1 0x2 DUP1 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND SWAP2 DUP4 SWAP1 DUP2 LT PUSH2 0x906 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP3 SWAP1 SWAP3 AND SWAP2 SWAP1 SWAP2 OR SWAP1 SSTORE PUSH1 0x2 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 PUSH2 0x985 SWAP1 DUP3 PUSH2 0xF4B JUMP JUMPDEST POP PUSH2 0x993 JUMP JUMPDEST PUSH1 0x1 ADD PUSH2 0x84B JUMP JUMPDEST PUSH1 0x40 MLOAD CALLER SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND SWAP1 PUSH32 0x1F32C1B084E2DE0713B8FB16BD46BB9DF710A3DBEAE2F3CA93AF46E016DCC6B0 SWAP1 PUSH1 0x0 SWAP1 LOG3 POP POP JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0xA7C JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND ISZERO ISZERO PUSH2 0xB12 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x15 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x5441524745545F4E4F545F415554484F52495A45440000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x2 SLOAD DUP2 LT PUSH2 0xB82 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x494E4445585F4F55545F4F465F424F554E445300000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x2 DUP3 DUP2 SLOAD DUP2 LT ISZERO ISZERO PUSH2 0xBA8 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0xC36 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x1B PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x415554484F52495A45445F414444524553535F4D49534D415443480000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE PUSH1 0x2 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 ADD SWAP1 DUP2 LT PUSH2 0xCB1 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD SLOAD PUSH1 0x2 DUP1 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND SWAP2 DUP4 SWAP1 DUP2 LT PUSH2 0xCE4 JUMPI INVALID JUMPDEST PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x20 SWAP1 SWAP2 KECCAK256 ADD DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP3 SWAP1 SWAP3 AND SWAP2 SWAP1 SWAP2 OR SWAP1 SSTORE PUSH1 0x2 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 PUSH2 0xD63 SWAP1 DUP3 PUSH2 0xF4B JUMP JUMPDEST POP PUSH1 0x40 MLOAD CALLER SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND SWAP1 PUSH32 0x1F32C1B084E2DE0713B8FB16BD46BB9DF710A3DBEAE2F3CA93AF46E016DCC6B0 SWAP1 PUSH1 0x0 SWAP1 LOG3 POP POP JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0x455243373231546F6B656E28616464726573732C75696E743235362900000000 DUP2 MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x1C ADD SWAP1 KECCAK256 JUMPDEST SWAP1 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x2 DUP1 SLOAD DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD DUP1 ISZERO PUSH2 0xE5B JUMPI PUSH1 0x20 MUL DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x1 SWAP1 SWAP2 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0xE30 JUMPI JUMPDEST POP POP POP POP POP SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0xEEB JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x13 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND ISZERO PUSH2 0xF48 JUMPI PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND OR SWAP1 SSTORE JUMPDEST POP JUMP JUMPDEST DUP2 SLOAD DUP2 DUP4 SSTORE DUP2 DUP2 GT ISZERO PUSH2 0xF6F JUMPI PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x20 SWAP1 KECCAK256 PUSH2 0xF6F SWAP2 DUP2 ADD SWAP1 DUP4 ADD PUSH2 0xF74 JUMP JUMPDEST POP POP POP JUMP JUMPDEST PUSH2 0xDDE SWAP2 SWAP1 JUMPDEST DUP1 DUP3 GT ISZERO PUSH2 0xF8E JUMPI PUSH1 0x0 DUP2 SSTORE PUSH1 0x1 ADD PUSH2 0xF7A JUMP JUMPDEST POP SWAP1 JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 MLOAD CALLDATACOPY PUSH27 0xE1CA7B3F3D032510EA8CBA18DC3E6CE467F660AB6B18EDEBEB7804 0x49 0xc6 STOP 0x29 ",
- "sourceMap": "641:7861:15:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;641:7861:15;1037:66;1033:1;1020:15;1016:88;1499:66;1489:8;1486:80;1483:2;;;1795;1789:9;;1833:6;1815:70;;1925:15;1920:2;1909:14;;1902:39;2036:20;;;2030:27;2023:35;2020:2;;;2159:66;2156:1;2149:77;2258:66;2254:2;2247:78;2357:66;2353:2;2346:78;2456:1;2452:2;2445:13;2489:3;2486:1;2479:14;2020:2;5829:1;5823:3;5810:17;5806:25;5803:2;;;5925:66;5922:1;5915:77;6024:66;6020:2;6013:78;6123:66;6119:2;6112:78;6222:1;6218:2;6211:13;6255:3;6252:1;6245:14;5803:2;6553:66;6550:1;6543:77;6848:2;6844;6841:1;6828:23;6988:1;6975:15;7050:2;7045;7028:15;7024:24;7020:2;7007:46;7195:2;7178:15;7174:24;7161:38;7620:1;7560;7505:3;7440:1;7382;7312:5;7257:3;7231:448;7699:7;7696:2;;;7729:12;7696:2;7861:66;7858:1;7851:77;7956:66;7952:2;7945:78;8051:66;8047:2;8040:78;8146:1;8142:2;8135:13;8175:3;8172:1;8165:14;1483:2;8271:1;8268;8261:12;1145:320:16;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1145:320:16;;;;;;;;;1030:28;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1030:28:16;;;;;;;;;;;;;;;;;;;;;;;;1579:547;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1579:547:16;;;;;;;91:20:55;;8:9:-1;5:2;;;30:1;27;20:12;5:2;91:20:55;;;;2299:643:16;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2299:643:16;;;;;;;;;8387:113:15;;8:9:-1;5:2;;;30:1;27;20:12;5:2;8387:113:15;;;;;;;;;;;;;;;;;;;;;;;981:43:16;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;981:43:16;;;;;;;;;;;;;;;;;;;;;;;;;3039:138;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3039:138:16;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:100:-1;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;3039:138:16;;;;;;;;;;;;;;;;;333:167:55;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;333:167:55;;;;;;;1145:320:16;259:5:55;;;;245:10;:19;224:85;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1262:18:16;;;;;;;:10;:18;;;;;;;;1261:19;1240:91;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1342:18;;;;;;;1363:4;1342:18;;;;;;;;:25;;;;;;;;1377:11;27:10:-1;;23:18;;;45:23;;1377:24:16;;;;;;;;;;;;;;1416:42;1447:10;;1342:18;1416:42;;;1145:320;:::o;1030:28::-;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1030:28:16;:::o;1579:547::-;1814:9;259:5:55;;;;245:10;:19;224:85;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1698:18:16;;;;;;;:10;:18;;;;;;;;1677:86;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1781:18:16;;;;;;;:10;:18;;;;;1774:25;;;;;;1809:252;1833:11;:18;1829:22;;1809:252;;;1894:6;1876:24;;:11;1888:1;1876:14;;;;;;;;;;;;;;;;;;;;;;:24;1872:179;;;1937:11;1949:18;;:22;;;;1937:35;;;;;;;;;;;;;;;;1920:11;:14;;1937:35;;;;;1932:1;;1920:14;;;;;;;;;;;;;;;:52;;;;;;;;;;;;;;;1990:11;:23;;;;;;;;;:::i;:::-;;2031:5;;1872:179;1853:3;;1809:252;;;2075:44;;2108:10;;2075:44;;;;;;;;;1579:547;;:::o;91:20:55:-;;;;;;:::o;2299:643:16:-;259:5:55;;;;245:10;:19;224:85;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2462:18:16;;;;;;;:10;:18;;;;;;;;2441:86;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2566:11;:18;2558:26;;2537:92;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2682:6;2660:28;;:11;2672:5;2660:18;;;;;;;;;;;;;;;;;;;;;;:28;2639:102;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2759:18;;;;;;;:10;:18;;;;;2752:25;;;;;;2808:11;2820:18;;:22;;;;2808:35;;;;;;;;;;;;;;;;2787:11;:18;;2808:35;;;;;2799:5;;2787:18;;;;;;;;;;;;;;;:56;;;;;;;;;;;;;;;2853:11;:23;;;;;;;;;:::i;:::-;-1:-1:-1;2891:44:16;;2924:10;;2891:44;;;;;;;;;2299:643;;:::o;8387:113:15:-;761:41;;;;;;;;;;;;;;;;8387:113;;:::o;981:43:16:-;;;;;;;;;;;;;;;:::o;3039:138::-;3120:9;3159:11;3152:18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3039:138;:::o;333:167:55:-;259:5;;;;245:10;:19;224:85;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;429:22;;;;425:69;;467:5;:16;;;;;;;;;;425:69;333:167;:::o;641:7861:15:-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;"
- }
- }
- },
- "sources": {
- "2.0.0/extensions/Forwarder/Forwarder.sol": {
- "id": 0
- },
- "2.0.0/extensions/Forwarder/MixinAssets.sol": {
- "id": 1
- },
- "2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol": {
- "id": 2
- },
- "2.0.0/extensions/Forwarder/MixinForwarderCore.sol": {
- "id": 3
- },
- "2.0.0/extensions/Forwarder/MixinWeth.sol": {
- "id": 4
- },
- "2.0.0/extensions/Forwarder/interfaces/IAssets.sol": {
- "id": 5
- },
- "2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol": {
- "id": 6
- },
- "2.0.0/extensions/Forwarder/libs/LibConstants.sol": {
- "id": 7
- },
- "2.0.0/extensions/Forwarder/mixins/MAssets.sol": {
- "id": 8
- },
- "2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol": {
- "id": 9
- },
- "2.0.0/extensions/Forwarder/mixins/MWeth.sol": {
- "id": 10
- },
- "2.0.0/extensions/OrderValidator/OrderValidator.sol": {
- "id": 11
- },
- "2.0.0/multisig/MultiSigWallet.sol": {
- "id": 12
- },
- "2.0.0/multisig/MultiSigWalletWithTimeLock.sol": {
- "id": 13
- },
- "2.0.0/protocol/AssetProxy/ERC20Proxy.sol": {
- "id": 14
- },
- "2.0.0/protocol/AssetProxy/ERC721Proxy.sol": {
- "id": 15
- },
- "2.0.0/protocol/AssetProxy/MixinAuthorizable.sol": {
- "id": 16
- },
- "2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol": {
- "id": 17
- },
- "2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol": {
- "id": 18
- },
- "2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol": {
- "id": 19
- },
- "2.0.0/protocol/AssetProxyOwner/AssetProxyOwner.sol": {
- "id": 20
- },
- "2.0.0/protocol/Exchange/Exchange.sol": {
- "id": 21
- },
- "2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol": {
- "id": 22
- },
- "2.0.0/protocol/Exchange/MixinExchangeCore.sol": {
- "id": 23
- },
- "2.0.0/protocol/Exchange/MixinMatchOrders.sol": {
- "id": 24
- },
- "2.0.0/protocol/Exchange/MixinSignatureValidator.sol": {
- "id": 25
- },
- "2.0.0/protocol/Exchange/MixinTransactions.sol": {
- "id": 26
- },
- "2.0.0/protocol/Exchange/MixinWrapperFunctions.sol": {
- "id": 27
- },
- "2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol": {
- "id": 28
- },
- "2.0.0/protocol/Exchange/interfaces/IExchange.sol": {
- "id": 29
- },
- "2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol": {
- "id": 30
- },
- "2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol": {
- "id": 31
- },
- "2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol": {
- "id": 32
- },
- "2.0.0/protocol/Exchange/interfaces/ITransactions.sol": {
- "id": 33
- },
- "2.0.0/protocol/Exchange/interfaces/IValidator.sol": {
- "id": 34
- },
- "2.0.0/protocol/Exchange/interfaces/IWallet.sol": {
- "id": 35
- },
- "2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol": {
- "id": 36
- },
- "2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol": {
- "id": 37
- },
- "2.0.0/protocol/Exchange/libs/LibConstants.sol": {
- "id": 38
- },
- "2.0.0/protocol/Exchange/libs/LibEIP712.sol": {
- "id": 39
- },
- "2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol": {
- "id": 40
- },
- "2.0.0/protocol/Exchange/libs/LibFillResults.sol": {
- "id": 41
- },
- "2.0.0/protocol/Exchange/libs/LibMath.sol": {
- "id": 42
- },
- "2.0.0/protocol/Exchange/libs/LibOrder.sol": {
- "id": 43
- },
- "2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol": {
- "id": 44
- },
- "2.0.0/protocol/Exchange/mixins/MExchangeCore.sol": {
- "id": 45
- },
- "2.0.0/protocol/Exchange/mixins/MMatchOrders.sol": {
- "id": 46
- },
- "2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol": {
- "id": 47
- },
- "2.0.0/protocol/Exchange/mixins/MTransactions.sol": {
- "id": 48
- },
- "2.0.0/protocol/Exchange/mixins/MWrapperFunctions.sol": {
- "id": 49
- },
- "2.0.0/tokens/ERC20Token/IERC20Token.sol": {
- "id": 50
- },
- "2.0.0/tokens/ERC721Token/IERC721Token.sol": {
- "id": 51
- },
- "2.0.0/tokens/EtherToken/IEtherToken.sol": {
- "id": 52
- },
- "2.0.0/utils/LibBytes/LibBytes.sol": {
- "id": 53
- },
- "2.0.0/utils/Ownable/IOwnable.sol": {
- "id": 54
- },
- "2.0.0/utils/Ownable/Ownable.sol": {
- "id": 55
- },
- "2.0.0/utils/ReentrancyGuard/ReentrancyGuard.sol": {
- "id": 56
- },
- "2.0.0/utils/SafeMath/SafeMath.sol": {
- "id": 57
- }
- },
- "sourceCodes": {
- "2.0.0/extensions/Forwarder/Forwarder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./MixinWeth.sol\";\nimport \"./MixinForwarderCore.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./MixinAssets.sol\";\nimport \"./MixinExchangeWrapper.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract Forwarder is\n LibConstants,\n MixinWeth,\n MixinAssets,\n MixinExchangeWrapper,\n MixinForwarderCore\n{\n constructor (\n address _exchange,\n bytes memory _zrxAssetData,\n bytes memory _wethAssetData\n )\n public\n LibConstants(\n _exchange,\n _zrxAssetData,\n _wethAssetData\n )\n MixinForwarderCore()\n {}\n}\n",
- "2.0.0/extensions/Forwarder/MixinAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"../../tokens/ERC20Token/IERC20Token.sol\";\nimport \"../../tokens/ERC721Token/IERC721Token.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MAssets.sol\";\n\n\ncontract MixinAssets is\n Ownable,\n LibConstants,\n MAssets\n{\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_TRANSFER_SELECTOR = bytes4(keccak256(\"transfer(address,uint256)\"));\n\n /// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to \n /// function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be\n /// used to withdraw assets that were accidentally sent to this contract.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of ERC20 token to withdraw.\n function withdrawAsset(\n bytes assetData,\n uint256 amount\n )\n external\n onlyOwner\n {\n transferAssetToSender(assetData, amount);\n }\n\n /// @dev Transfers given amount of asset to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferAssetToSender(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n bytes4 proxyId = assetData.readBytes4(0);\n\n if (proxyId == ERC20_DATA_ID) {\n transferERC20Token(assetData, amount);\n } else if (proxyId == ERC721_DATA_ID) {\n transferERC721Token(assetData, amount);\n } else {\n revert(\"UNSUPPORTED_ASSET_PROXY\");\n }\n }\n\n /// @dev Decodes ERC20 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC20Token(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n address token = assetData.readAddress(16);\n\n // Transfer tokens.\n // We do a raw call so we can check the success separate\n // from the return data.\n bool success = token.call(abi.encodeWithSelector(\n ERC20_TRANSFER_SELECTOR,\n msg.sender,\n amount\n ));\n require(\n success,\n \"TRANSFER_FAILED\"\n );\n \n // Check return data.\n // If there is no return data, we assume the token incorrectly\n // does not return a bool. In this case we expect it to revert\n // on failure, which was handled above.\n // If the token does return data, we require that it is a single\n // value that evaluates to true.\n assembly {\n if returndatasize {\n success := 0\n if eq(returndatasize, 32) {\n // First 64 bytes of memory are reserved scratch space\n returndatacopy(0, 0, 32)\n success := mload(0)\n }\n }\n }\n require(\n success,\n \"TRANSFER_FAILED\"\n );\n }\n\n /// @dev Decodes ERC721 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC721Token(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n require(\n amount == 1,\n \"INVALID_AMOUNT\"\n );\n // Decode asset data.\n address token = assetData.readAddress(16);\n uint256 tokenId = assetData.readUint256(36);\n\n // Perform transfer.\n IERC721Token(token).transferFrom(\n address(this),\n msg.sender,\n tokenId\n );\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MExchangeWrapper.sol\";\nimport \"../../protocol/Exchange/libs/LibAbiEncoder.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../protocol/Exchange/libs/LibFillResults.sol\";\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\n\n\ncontract MixinExchangeWrapper is\n LibAbiEncoder,\n LibFillResults,\n LibMath,\n LibConstants,\n MExchangeWrapper\n{\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n // ABI encode calldata for `fillOrder`\n bytes memory fillOrderCalldata = abiEncodeFillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n\n address exchange = address(EXCHANGE);\n\n // Call `fillOrder` and handle any exceptions gracefully\n assembly {\n let success := call(\n gas, // forward all gas\n exchange, // call address of Exchange contract\n 0, // transfer 0 wei\n add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes)\n mload(fillOrderCalldata), // length of input\n fillOrderCalldata, // write output over input\n 128 // output size is 128 bytes\n )\n if success {\n mstore(fillResults, mload(fillOrderCalldata))\n mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32)))\n mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64)))\n mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96)))\n }\n }\n // fillResults values will be 0 by default if call was unsuccessful\n return fillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of WETH has been sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param wethSellAmount Desired amount of WETH to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellWeth(\n LibOrder.Order[] memory orders,\n uint256 wethSellAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // We assume that asset being sold by taker is WETH for each order.\n orders[i].makerAssetData = makerAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of WETH to sell\n uint256 remainingTakerAssetFillAmount = safeSub(wethSellAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of WETH\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= wethSellAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// The asset being sold by taker must always be WETH.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyExactAmountWithWeth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // We assume that asset being sold by taker is WETH for each order.\n orders[i].makerAssetData = makerAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n uint256 makerAssetFilledAmount = totalFillResults.makerAssetFilledAmount;\n if (makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n\n require(\n makerAssetFilledAmount >= makerAssetFillAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return totalFillResults;\n }\n\n /// @dev Buys zrxBuyAmount of ZRX fee tokens, taking into account ZRX fees for each order. This will guarantee\n /// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues).\n /// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX\n /// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases.\n /// The asset being sold by taker must always be WETH. \n /// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset.\n /// @param zrxBuyAmount Desired amount of ZRX to buy.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return totalFillResults Amounts filled and fees paid by maker and taker.\n function marketBuyExactZrxWithWeth(\n LibOrder.Order[] memory orders,\n uint256 zrxBuyAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n // Do nothing if zrxBuyAmount == 0\n if (zrxBuyAmount == 0) {\n return totalFillResults;\n }\n\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n uint256 zrxPurchased = 0;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // All of these are ZRX/WETH, so we can drop the respective assetData from calldata.\n orders[i].makerAssetData = zrxAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of ZRX to buy.\n uint256 remainingZrxBuyAmount = safeSub(zrxBuyAmount, zrxPurchased);\n\n // Convert the remaining amount of ZRX to buy into remaining amount\n // of WETH to sell, assuming entire amount can be sold in the current order.\n uint256 remainingWethSellAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n safeSub(orders[i].makerAssetAmount, orders[i].takerFee), // our exchange rate after fees \n remainingZrxBuyAmount\n );\n\n // Attempt to sell the remaining amount of WETH.\n FillResults memory singleFillResult = fillOrderNoThrow(\n orders[i],\n safeAdd(remainingWethSellAmount, 1), // we add 1 wei to the fill amount to make up for rounding errors\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker.\n addFillResults(totalFillResults, singleFillResult);\n zrxPurchased = safeSub(totalFillResults.makerAssetFilledAmount, totalFillResults.takerFeePaid);\n\n // Stop execution if the entire amount of ZRX has been bought.\n if (zrxPurchased >= zrxBuyAmount) {\n break;\n }\n }\n\n require(\n zrxPurchased >= zrxBuyAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return totalFillResults;\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinForwarderCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MWeth.sol\";\nimport \"./mixins/MAssets.sol\";\nimport \"./mixins/MExchangeWrapper.sol\";\nimport \"./interfaces/IForwarderCore.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../protocol/Exchange/libs/LibFillResults.sol\";\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\n\n\ncontract MixinForwarderCore is\n LibFillResults,\n LibMath,\n LibConstants,\n MWeth,\n MAssets,\n MExchangeWrapper,\n IForwarderCore\n{\n using LibBytes for bytes;\n\n /// @dev Constructor approves ERC20 proxy to transfer ZRX and WETH on this contract's behalf.\n constructor ()\n public\n {\n address proxyAddress = EXCHANGE.getAssetProxy(ERC20_DATA_ID);\n require(\n proxyAddress != address(0),\n \"UNREGISTERED_ASSET_PROXY\"\n );\n ETHER_TOKEN.approve(proxyAddress, MAX_UINT);\n ZRX_TOKEN.approve(proxyAddress, MAX_UINT);\n }\n\n /// @dev Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketSellOrdersWithEth(\n LibOrder.Order[] memory orders,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n FillResults memory orderFillResults,\n FillResults memory feeOrderFillResults\n )\n {\n // Convert ETH to WETH.\n convertEthToWeth();\n\n uint256 wethSellAmount;\n uint256 zrxBuyAmount;\n uint256 makerAssetAmountPurchased;\n if (orders[0].makerAssetData.equals(ZRX_ASSET_DATA)) {\n // Calculate amount of WETH that won't be spent on ETH fees.\n wethSellAmount = getPartialAmountFloor(\n PERCENTAGE_DENOMINATOR,\n safeAdd(PERCENTAGE_DENOMINATOR, feePercentage),\n msg.value\n );\n // Market sell available WETH.\n // ZRX fees are paid with this contract's balance.\n orderFillResults = marketSellWeth(\n orders,\n wethSellAmount,\n signatures\n );\n // The fee amount must be deducted from the amount transfered back to sender.\n makerAssetAmountPurchased = safeSub(orderFillResults.makerAssetFilledAmount, orderFillResults.takerFeePaid);\n } else {\n // 5% of WETH is reserved for filling feeOrders and paying feeRecipient.\n wethSellAmount = getPartialAmountFloor(\n MAX_WETH_FILL_PERCENTAGE,\n PERCENTAGE_DENOMINATOR,\n msg.value\n );\n // Market sell 95% of WETH.\n // ZRX fees are payed with this contract's balance.\n orderFillResults = marketSellWeth(\n orders,\n wethSellAmount,\n signatures\n );\n // Buy back all ZRX spent on fees.\n zrxBuyAmount = orderFillResults.takerFeePaid;\n feeOrderFillResults = marketBuyExactZrxWithWeth(\n feeOrders,\n zrxBuyAmount,\n feeSignatures\n );\n makerAssetAmountPurchased = orderFillResults.makerAssetFilledAmount;\n }\n\n // Transfer feePercentage of total ETH spent on primary orders to feeRecipient.\n // Refund remaining ETH to msg.sender.\n transferEthFeeAndRefund(\n orderFillResults.takerAssetFilledAmount,\n feeOrderFillResults.takerAssetFilledAmount,\n feePercentage,\n feeRecipient\n );\n\n // Transfer purchased assets to msg.sender.\n transferAssetToSender(orders[0].makerAssetData, makerAssetAmountPurchased);\n }\n\n /// @dev Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param makerAssetFillAmount Desired amount of makerAsset to purchase.\n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketBuyOrdersWithEth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n FillResults memory orderFillResults,\n FillResults memory feeOrderFillResults\n )\n {\n // Convert ETH to WETH.\n convertEthToWeth();\n\n uint256 zrxBuyAmount;\n uint256 makerAssetAmountPurchased;\n if (orders[0].makerAssetData.equals(ZRX_ASSET_DATA)) {\n // If the makerAsset is ZRX, it is not necessary to pay fees out of this\n // contracts's ZRX balance because fees are factored into the price of the order.\n orderFillResults = marketBuyExactZrxWithWeth(\n orders,\n makerAssetFillAmount,\n signatures\n );\n // The fee amount must be deducted from the amount transfered back to sender.\n makerAssetAmountPurchased = safeSub(orderFillResults.makerAssetFilledAmount, orderFillResults.takerFeePaid);\n } else {\n // Attemp to purchase desired amount of makerAsset.\n // ZRX fees are payed with this contract's balance.\n orderFillResults = marketBuyExactAmountWithWeth(\n orders,\n makerAssetFillAmount,\n signatures\n );\n // Buy back all ZRX spent on fees.\n zrxBuyAmount = orderFillResults.takerFeePaid;\n feeOrderFillResults = marketBuyExactZrxWithWeth(\n feeOrders,\n zrxBuyAmount,\n feeSignatures\n );\n makerAssetAmountPurchased = orderFillResults.makerAssetFilledAmount;\n }\n\n // Transfer feePercentage of total ETH spent on primary orders to feeRecipient.\n // Refund remaining ETH to msg.sender.\n transferEthFeeAndRefund(\n orderFillResults.takerAssetFilledAmount,\n feeOrderFillResults.takerAssetFilledAmount,\n feePercentage,\n feeRecipient\n );\n\n // Transfer purchased assets to msg.sender.\n transferAssetToSender(orders[0].makerAssetData, makerAssetAmountPurchased);\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinWeth.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MWeth.sol\";\n\n\ncontract MixinWeth is\n LibMath,\n LibConstants,\n MWeth\n{\n /// @dev Default payabale function, this allows us to withdraw WETH\n function ()\n public\n payable\n {\n require(\n msg.sender == address(ETHER_TOKEN),\n \"DEFAULT_FUNCTION_WETH_CONTRACT_ONLY\"\n );\n }\n\n /// @dev Converts message call's ETH value into WETH.\n function convertEthToWeth()\n internal\n {\n require(\n msg.value > 0,\n \"INVALID_MSG_VALUE\"\n );\n ETHER_TOKEN.deposit.value(msg.value)();\n }\n\n /// @dev Transfers feePercentage of WETH spent on primary orders to feeRecipient.\n /// Refunds any excess ETH to msg.sender.\n /// @param wethSoldExcludingFeeOrders Amount of WETH sold when filling primary orders.\n /// @param wethSoldForZrx Amount of WETH sold when purchasing ZRX required for primary order fees.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n function transferEthFeeAndRefund(\n uint256 wethSoldExcludingFeeOrders,\n uint256 wethSoldForZrx,\n uint256 feePercentage,\n address feeRecipient\n )\n internal\n {\n // Ensure feePercentage is less than 5%.\n require(\n feePercentage <= MAX_FEE_PERCENTAGE,\n \"FEE_PERCENTAGE_TOO_LARGE\"\n );\n\n // Ensure that no extra WETH owned by this contract has been sold.\n uint256 wethSold = safeAdd(wethSoldExcludingFeeOrders, wethSoldForZrx);\n require(\n wethSold <= msg.value,\n \"OVERSOLD_WETH\"\n );\n\n // Calculate amount of WETH that hasn't been sold.\n uint256 wethRemaining = safeSub(msg.value, wethSold);\n\n // Calculate ETH fee to pay to feeRecipient.\n uint256 ethFee = getPartialAmountFloor(\n feePercentage,\n PERCENTAGE_DENOMINATOR,\n wethSoldExcludingFeeOrders\n );\n\n // Ensure fee is less than amount of WETH remaining.\n require(\n ethFee <= wethRemaining,\n \"INSUFFICIENT_ETH_REMAINING\"\n );\n \n // Do nothing if no WETH remaining\n if (wethRemaining > 0) {\n // Convert remaining WETH to ETH\n ETHER_TOKEN.withdraw(wethRemaining);\n\n // Pay ETH to feeRecipient\n if (ethFee > 0) {\n feeRecipient.transfer(ethFee);\n }\n\n // Refund remaining ETH to msg.sender.\n uint256 ethRefund = safeSub(wethRemaining, ethFee);\n if (ethRefund > 0) {\n msg.sender.transfer(ethRefund);\n }\n }\n }\n}\n",
- "2.0.0/extensions/Forwarder/interfaces/IAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IAssets {\n\n /// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to \n /// function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be\n /// used to withdraw assets that were accidentally sent to this contract.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of ERC20 token to withdraw.\n function withdrawAsset(\n bytes assetData,\n uint256 amount\n )\n external;\n}\n",
- "2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../../protocol/Exchange/libs/LibFillResults.sol\";\n\n\ncontract IForwarderCore {\n\n /// @dev Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketSellOrdersWithEth(\n LibOrder.Order[] memory orders,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n LibFillResults.FillResults memory orderFillResults,\n LibFillResults.FillResults memory feeOrderFillResults\n );\n\n /// @dev Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param makerAssetFillAmount Desired amount of makerAsset to purchase.\n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketBuyOrdersWithEth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n LibFillResults.FillResults memory orderFillResults,\n LibFillResults.FillResults memory feeOrderFillResults\n );\n}\n",
- "2.0.0/extensions/Forwarder/libs/LibConstants.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/LibBytes/LibBytes.sol\";\nimport \"../../../protocol/Exchange/interfaces/IExchange.sol\";\nimport \"../../../tokens/EtherToken/IEtherToken.sol\";\nimport \"../../../tokens/ERC20Token/IERC20Token.sol\";\n\n\ncontract LibConstants {\n\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n uint256 constant internal MAX_UINT = 2**256 - 1;\n uint256 constant internal PERCENTAGE_DENOMINATOR = 10**18; \n uint256 constant internal MAX_FEE_PERCENTAGE = 5 * PERCENTAGE_DENOMINATOR / 100; // 5%\n uint256 constant internal MAX_WETH_FILL_PERCENTAGE = 95 * PERCENTAGE_DENOMINATOR / 100; // 95%\n \n // solhint-disable var-name-mixedcase\n IExchange internal EXCHANGE;\n IEtherToken internal ETHER_TOKEN;\n IERC20Token internal ZRX_TOKEN;\n bytes internal ZRX_ASSET_DATA;\n bytes internal WETH_ASSET_DATA;\n // solhint-enable var-name-mixedcase\n\n constructor (\n address _exchange,\n bytes memory _zrxAssetData,\n bytes memory _wethAssetData\n )\n public\n {\n EXCHANGE = IExchange(_exchange);\n ZRX_ASSET_DATA = _zrxAssetData;\n WETH_ASSET_DATA = _wethAssetData;\n\n address etherToken = _wethAssetData.readAddress(16);\n address zrxToken = _zrxAssetData.readAddress(16);\n ETHER_TOKEN = IEtherToken(etherToken);\n ZRX_TOKEN = IERC20Token(zrxToken);\n }\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAssets.sol\";\n\n\ncontract MAssets is\n IAssets\n{\n /// @dev Transfers given amount of asset to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferAssetToSender(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n\n /// @dev Decodes ERC20 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC20Token(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n\n /// @dev Decodes ERC721 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC721Token(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../../protocol/Exchange/libs/LibFillResults.sol\";\n\n\ncontract MExchangeWrapper {\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of WETH has been sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param wethSellAmount Desired amount of WETH to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellWeth(\n LibOrder.Order[] memory orders,\n uint256 wethSellAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// The asset being sold by taker must always be WETH.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyExactAmountWithWeth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Buys zrxBuyAmount of ZRX fee tokens, taking into account ZRX fees for each order. This will guarantee\n /// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues).\n /// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX\n /// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases.\n /// The asset being sold by taker must always be WETH. \n /// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset.\n /// @param zrxBuyAmount Desired amount of ZRX to buy.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return totalFillResults Amounts filled and fees paid by maker and taker.\n function marketBuyExactZrxWithWeth(\n LibOrder.Order[] memory orders,\n uint256 zrxBuyAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MWeth.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract MWeth {\n\n /// @dev Converts message call's ETH value into WETH.\n function convertEthToWeth()\n internal;\n\n /// @dev Transfers feePercentage of WETH spent on primary orders to feeRecipient.\n /// Refunds any excess ETH to msg.sender.\n /// @param wethSoldExcludingFeeOrders Amount of WETH sold when filling primary orders.\n /// @param wethSoldForZrx Amount of WETH sold when purchasing ZRX required for primary order fees.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n function transferEthFeeAndRefund(\n uint256 wethSoldExcludingFeeOrders,\n uint256 wethSoldForZrx,\n uint256 feePercentage,\n address feeRecipient\n )\n internal;\n}\n",
- "2.0.0/extensions/OrderValidator/OrderValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../protocol/Exchange/interfaces/IExchange.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../tokens/ERC20Token/IERC20Token.sol\";\nimport \"../../tokens/ERC721Token/IERC721Token.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\n\n\ncontract OrderValidator {\n\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n\n struct TraderInfo {\n uint256 makerBalance; // Maker's balance of makerAsset\n uint256 makerAllowance; // Maker's allowance to corresponding AssetProxy\n uint256 takerBalance; // Taker's balance of takerAsset\n uint256 takerAllowance; // Taker's allowance to corresponding AssetProxy\n uint256 makerZrxBalance; // Maker's balance of ZRX\n uint256 makerZrxAllowance; // Maker's allowance of ZRX to ERC20Proxy\n uint256 takerZrxBalance; // Taker's balance of ZRX\n uint256 takerZrxAllowance; // Taker's allowance of ZRX to ERC20Proxy\n }\n\n // solhint-disable var-name-mixedcase\n IExchange internal EXCHANGE;\n bytes internal ZRX_ASSET_DATA;\n // solhint-enable var-name-mixedcase\n\n constructor (address _exchange, bytes memory _zrxAssetData)\n public\n {\n EXCHANGE = IExchange(_exchange);\n ZRX_ASSET_DATA = _zrxAssetData;\n }\n\n /// @dev Fetches information for order and maker/taker of order.\n /// @param order The order structure.\n /// @param takerAddress Address that will be filling the order.\n /// @return OrderInfo and TraderInfo instances for given order.\n function getOrderAndTraderInfo(LibOrder.Order memory order, address takerAddress)\n public\n view\n returns (LibOrder.OrderInfo memory orderInfo, TraderInfo memory traderInfo)\n {\n orderInfo = EXCHANGE.getOrderInfo(order);\n traderInfo = getTraderInfo(order, takerAddress);\n return (orderInfo, traderInfo);\n }\n\n /// @dev Fetches information for all passed in orders and the makers/takers of each order.\n /// @param orders Array of order specifications.\n /// @param takerAddresses Array of taker addresses corresponding to each order.\n /// @return Arrays of OrderInfo and TraderInfo instances that correspond to each order.\n function getOrdersAndTradersInfo(LibOrder.Order[] memory orders, address[] memory takerAddresses)\n public\n view\n returns (LibOrder.OrderInfo[] memory ordersInfo, TraderInfo[] memory tradersInfo)\n {\n ordersInfo = EXCHANGE.getOrdersInfo(orders);\n tradersInfo = getTradersInfo(orders, takerAddresses);\n return (ordersInfo, tradersInfo);\n }\n\n /// @dev Fetches balance and allowances for maker and taker of order.\n /// @param order The order structure.\n /// @param takerAddress Address that will be filling the order.\n /// @return Balances and allowances of maker and taker of order.\n function getTraderInfo(LibOrder.Order memory order, address takerAddress)\n public\n view\n returns (TraderInfo memory traderInfo)\n {\n (traderInfo.makerBalance, traderInfo.makerAllowance) = getBalanceAndAllowance(order.makerAddress, order.makerAssetData);\n (traderInfo.takerBalance, traderInfo.takerAllowance) = getBalanceAndAllowance(takerAddress, order.takerAssetData);\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n (traderInfo.makerZrxBalance, traderInfo.makerZrxAllowance) = getBalanceAndAllowance(order.makerAddress, zrxAssetData);\n (traderInfo.takerZrxBalance, traderInfo.takerZrxAllowance) = getBalanceAndAllowance(takerAddress, zrxAssetData);\n return traderInfo;\n }\n\n /// @dev Fetches balances and allowances of maker and taker for each provided order.\n /// @param orders Array of order specifications.\n /// @param takerAddresses Array of taker addresses corresponding to each order.\n /// @return Array of balances and allowances for maker and taker of each order.\n function getTradersInfo(LibOrder.Order[] memory orders, address[] memory takerAddresses)\n public\n view\n returns (TraderInfo[] memory)\n {\n uint256 ordersLength = orders.length;\n TraderInfo[] memory tradersInfo = new TraderInfo[](ordersLength);\n for (uint256 i = 0; i != ordersLength; i++) {\n tradersInfo[i] = getTraderInfo(orders[i], takerAddresses[i]);\n }\n return tradersInfo;\n }\n\n /// @dev Fetches token balances and allowances of an address to given assetProxy. Supports ERC20 and ERC721.\n /// @param target Address to fetch balances and allowances of.\n /// @param assetData Encoded data that can be decoded by a specified proxy contract when transferring asset.\n /// @return Balance of asset and allowance set to given proxy of asset.\n /// For ERC721 tokens, these values will always be 1 or 0.\n function getBalanceAndAllowance(address target, bytes memory assetData)\n public\n view\n returns (uint256 balance, uint256 allowance)\n {\n bytes4 assetProxyId = assetData.readBytes4(0);\n address token = assetData.readAddress(16);\n address assetProxy = EXCHANGE.getAssetProxy(assetProxyId);\n\n if (assetProxyId == ERC20_DATA_ID) {\n // Query balance\n balance = IERC20Token(token).balanceOf(target);\n\n // Query allowance\n allowance = IERC20Token(token).allowance(target, assetProxy);\n } else if (assetProxyId == ERC721_DATA_ID) {\n uint256 tokenId = assetData.readUint256(36);\n\n // Query owner of tokenId\n address owner = getERC721TokenOwner(token, tokenId);\n\n // Set balance to 1 if tokenId is owned by target\n balance = target == owner ? 1 : 0;\n\n // Check if ERC721Proxy is approved to spend tokenId\n bool isApproved = IERC721Token(token).isApprovedForAll(target, assetProxy) || IERC721Token(token).getApproved(tokenId) == assetProxy;\n \n // Set alowance to 1 if ERC721Proxy is approved to spend tokenId\n allowance = isApproved ? 1 : 0;\n } else {\n revert(\"UNSUPPORTED_ASSET_PROXY\");\n }\n return (balance, allowance);\n }\n\n /// @dev Fetches token balances and allowances of an address for each given assetProxy. Supports ERC20 and ERC721.\n /// @param target Address to fetch balances and allowances of.\n /// @param assetData Array of encoded byte arrays that can be decoded by a specified proxy contract when transferring asset.\n /// @return Balances and allowances of assets.\n /// For ERC721 tokens, these values will always be 1 or 0.\n function getBalancesAndAllowances(address target, bytes[] memory assetData)\n public\n view\n returns (uint256[] memory, uint256[] memory)\n {\n uint256 length = assetData.length;\n uint256[] memory balances = new uint256[](length);\n uint256[] memory allowances = new uint256[](length);\n for (uint256 i = 0; i != length; i++) {\n (balances[i], allowances[i]) = getBalanceAndAllowance(target, assetData[i]);\n }\n return (balances, allowances);\n }\n\n /// @dev Calls `token.ownerOf(tokenId)`, but returns a null owner instead of reverting on an unowned token.\n /// @param token Address of ERC721 token.\n /// @param tokenId The identifier for the specific NFT.\n /// @return Owner of tokenId or null address if unowned.\n function getERC721TokenOwner(address token, uint256 tokenId)\n public\n view\n returns (address owner)\n {\n assembly {\n // load free memory pointer\n let cdStart := mload(64)\n\n // bytes4(keccak256(ownerOf(uint256))) = 0x6352211e\n mstore(cdStart, 0x6352211e00000000000000000000000000000000000000000000000000000000)\n mstore(add(cdStart, 4), tokenId)\n\n // staticcall `ownerOf(tokenId)`\n // `ownerOf` will revert if tokenId is not owned\n let success := staticcall(\n gas, // forward all gas\n token, // call token contract\n cdStart, // start of calldata\n 36, // length of input is 36 bytes\n cdStart, // write output over input\n 32 // size of output is 32 bytes\n )\n\n // Success implies that tokenId is owned\n // Copy owner from return data if successful\n if success {\n owner := mload(cdStart)\n } \n }\n\n // Owner initialized to address(0), no need to modify if call is unsuccessful\n return owner;\n }\n}\n",
- "2.0.0/multisig/MultiSigWallet.sol": "// solhint-disable\npragma solidity ^0.4.15;\n\n\n/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.\n/// @author Stefan George - <stefan.george@consensys.net>\ncontract MultiSigWallet {\n\n /*\n * Events\n */\n event Confirmation(address indexed sender, uint indexed transactionId);\n event Revocation(address indexed sender, uint indexed transactionId);\n event Submission(uint indexed transactionId);\n event Execution(uint indexed transactionId);\n event ExecutionFailure(uint indexed transactionId);\n event Deposit(address indexed sender, uint value);\n event OwnerAddition(address indexed owner);\n event OwnerRemoval(address indexed owner);\n event RequirementChange(uint required);\n\n /*\n * Constants\n */\n uint constant public MAX_OWNER_COUNT = 50;\n\n /*\n * Storage\n */\n mapping (uint => Transaction) public transactions;\n mapping (uint => mapping (address => bool)) public confirmations;\n mapping (address => bool) public isOwner;\n address[] public owners;\n uint public required;\n uint public transactionCount;\n\n struct Transaction {\n address destination;\n uint value;\n bytes data;\n bool executed;\n }\n\n /*\n * Modifiers\n */\n modifier onlyWallet() {\n require(msg.sender == address(this));\n _;\n }\n\n modifier ownerDoesNotExist(address owner) {\n require(!isOwner[owner]);\n _;\n }\n\n modifier ownerExists(address owner) {\n require(isOwner[owner]);\n _;\n }\n\n modifier transactionExists(uint transactionId) {\n require(transactions[transactionId].destination != 0);\n _;\n }\n\n modifier confirmed(uint transactionId, address owner) {\n require(confirmations[transactionId][owner]);\n _;\n }\n\n modifier notConfirmed(uint transactionId, address owner) {\n require(!confirmations[transactionId][owner]);\n _;\n }\n\n modifier notExecuted(uint transactionId) {\n require(!transactions[transactionId].executed);\n _;\n }\n\n modifier notNull(address _address) {\n require(_address != 0);\n _;\n }\n\n modifier validRequirement(uint ownerCount, uint _required) {\n require(ownerCount <= MAX_OWNER_COUNT\n && _required <= ownerCount\n && _required != 0\n && ownerCount != 0);\n _;\n }\n\n /// @dev Fallback function allows to deposit ether.\n function()\n payable\n {\n if (msg.value > 0)\n Deposit(msg.sender, msg.value);\n }\n\n /*\n * Public functions\n */\n /// @dev Contract constructor sets initial owners and required number of confirmations.\n /// @param _owners List of initial owners.\n /// @param _required Number of required confirmations.\n function MultiSigWallet(address[] _owners, uint _required)\n public\n validRequirement(_owners.length, _required)\n {\n for (uint i=0; i<_owners.length; i++) {\n require(!isOwner[_owners[i]] && _owners[i] != 0);\n isOwner[_owners[i]] = true;\n }\n owners = _owners;\n required = _required;\n }\n\n /// @dev Allows to add a new owner. Transaction has to be sent by wallet.\n /// @param owner Address of new owner.\n function addOwner(address owner)\n public\n onlyWallet\n ownerDoesNotExist(owner)\n notNull(owner)\n validRequirement(owners.length + 1, required)\n {\n isOwner[owner] = true;\n owners.push(owner);\n OwnerAddition(owner);\n }\n\n /// @dev Allows to remove an owner. Transaction has to be sent by wallet.\n /// @param owner Address of owner.\n function removeOwner(address owner)\n public\n onlyWallet\n ownerExists(owner)\n {\n isOwner[owner] = false;\n for (uint i=0; i<owners.length - 1; i++)\n if (owners[i] == owner) {\n owners[i] = owners[owners.length - 1];\n break;\n }\n owners.length -= 1;\n if (required > owners.length)\n changeRequirement(owners.length);\n OwnerRemoval(owner);\n }\n\n /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet.\n /// @param owner Address of owner to be replaced.\n /// @param newOwner Address of new owner.\n function replaceOwner(address owner, address newOwner)\n public\n onlyWallet\n ownerExists(owner)\n ownerDoesNotExist(newOwner)\n {\n for (uint i=0; i<owners.length; i++)\n if (owners[i] == owner) {\n owners[i] = newOwner;\n break;\n }\n isOwner[owner] = false;\n isOwner[newOwner] = true;\n OwnerRemoval(owner);\n OwnerAddition(newOwner);\n }\n\n /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet.\n /// @param _required Number of required confirmations.\n function changeRequirement(uint _required)\n public\n onlyWallet\n validRequirement(owners.length, _required)\n {\n required = _required;\n RequirementChange(_required);\n }\n\n /// @dev Allows an owner to submit and confirm a transaction.\n /// @param destination Transaction target address.\n /// @param value Transaction ether value.\n /// @param data Transaction data payload.\n /// @return Returns transaction ID.\n function submitTransaction(address destination, uint value, bytes data)\n public\n returns (uint transactionId)\n {\n transactionId = addTransaction(destination, value, data);\n confirmTransaction(transactionId);\n }\n\n /// @dev Allows an owner to confirm a transaction.\n /// @param transactionId Transaction ID.\n function confirmTransaction(uint transactionId)\n public\n ownerExists(msg.sender)\n transactionExists(transactionId)\n notConfirmed(transactionId, msg.sender)\n {\n confirmations[transactionId][msg.sender] = true;\n Confirmation(msg.sender, transactionId);\n executeTransaction(transactionId);\n }\n\n /// @dev Allows an owner to revoke a confirmation for a transaction.\n /// @param transactionId Transaction ID.\n function revokeConfirmation(uint transactionId)\n public\n ownerExists(msg.sender)\n confirmed(transactionId, msg.sender)\n notExecuted(transactionId)\n {\n confirmations[transactionId][msg.sender] = false;\n Revocation(msg.sender, transactionId);\n }\n\n /// @dev Allows anyone to execute a confirmed transaction.\n /// @param transactionId Transaction ID.\n function executeTransaction(uint transactionId)\n public\n ownerExists(msg.sender)\n confirmed(transactionId, msg.sender)\n notExecuted(transactionId)\n {\n if (isConfirmed(transactionId)) {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data))\n Execution(transactionId);\n else {\n ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n }\n\n // call has been separated into its own function in order to take advantage\n // of the Solidity's code generator to produce a loop that copies tx.data into memory.\n function external_call(address destination, uint value, uint dataLength, bytes data) internal returns (bool) {\n bool result;\n assembly {\n let x := mload(0x40) // \"Allocate\" memory for output (0x40 is where \"free memory\" pointer is stored by convention)\n let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that\n result := call(\n sub(gas, 34710), // 34710 is the value that solidity is currently emitting\n // It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) +\n // callNewAccountGas (25000, in case the destination address does not exist and needs creating)\n destination,\n value,\n d,\n dataLength, // Size of the input (in bytes) - this is what fixes the padding problem\n x,\n 0 // Output is ignored, therefore the output size is zero\n )\n }\n return result;\n }\n\n /// @dev Returns the confirmation status of a transaction.\n /// @param transactionId Transaction ID.\n /// @return Confirmation status.\n function isConfirmed(uint transactionId)\n public\n constant\n returns (bool)\n {\n uint count = 0;\n for (uint i=0; i<owners.length; i++) {\n if (confirmations[transactionId][owners[i]])\n count += 1;\n if (count == required)\n return true;\n }\n }\n\n /*\n * Internal functions\n */\n /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet.\n /// @param destination Transaction target address.\n /// @param value Transaction ether value.\n /// @param data Transaction data payload.\n /// @return Returns transaction ID.\n function addTransaction(address destination, uint value, bytes data)\n internal\n notNull(destination)\n returns (uint transactionId)\n {\n transactionId = transactionCount;\n transactions[transactionId] = Transaction({\n destination: destination,\n value: value,\n data: data,\n executed: false\n });\n transactionCount += 1;\n Submission(transactionId);\n }\n\n /*\n * Web3 call functions\n */\n /// @dev Returns number of confirmations of a transaction.\n /// @param transactionId Transaction ID.\n /// @return Number of confirmations.\n function getConfirmationCount(uint transactionId)\n public\n constant\n returns (uint count)\n {\n for (uint i=0; i<owners.length; i++)\n if (confirmations[transactionId][owners[i]])\n count += 1;\n }\n\n /// @dev Returns total number of transactions after filers are applied.\n /// @param pending Include pending transactions.\n /// @param executed Include executed transactions.\n /// @return Total number of transactions after filters are applied.\n function getTransactionCount(bool pending, bool executed)\n public\n constant\n returns (uint count)\n {\n for (uint i=0; i<transactionCount; i++)\n if ( pending && !transactions[i].executed\n || executed && transactions[i].executed)\n count += 1;\n }\n\n /// @dev Returns list of owners.\n /// @return List of owner addresses.\n function getOwners()\n public\n constant\n returns (address[])\n {\n return owners;\n }\n\n /// @dev Returns array with owner addresses, which confirmed transaction.\n /// @param transactionId Transaction ID.\n /// @return Returns array of owner addresses.\n function getConfirmations(uint transactionId)\n public\n constant\n returns (address[] _confirmations)\n {\n address[] memory confirmationsTemp = new address[](owners.length);\n uint count = 0;\n uint i;\n for (i=0; i<owners.length; i++)\n if (confirmations[transactionId][owners[i]]) {\n confirmationsTemp[count] = owners[i];\n count += 1;\n }\n _confirmations = new address[](count);\n for (i=0; i<count; i++)\n _confirmations[i] = confirmationsTemp[i];\n }\n\n /// @dev Returns list of transaction IDs in defined range.\n /// @param from Index start position of transaction array.\n /// @param to Index end position of transaction array.\n /// @param pending Include pending transactions.\n /// @param executed Include executed transactions.\n /// @return Returns array of transaction IDs.\n function getTransactionIds(uint from, uint to, bool pending, bool executed)\n public\n constant\n returns (uint[] _transactionIds)\n {\n uint[] memory transactionIdsTemp = new uint[](transactionCount);\n uint count = 0;\n uint i;\n for (i=0; i<transactionCount; i++)\n if ( pending && !transactions[i].executed\n || executed && transactions[i].executed)\n {\n transactionIdsTemp[count] = i;\n count += 1;\n }\n _transactionIds = new uint[](to - from);\n for (i=from; i<to; i++)\n _transactionIds[i - from] = transactionIdsTemp[i];\n }\n}",
- "2.0.0/multisig/MultiSigWalletWithTimeLock.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MultiSigWallet.sol\";\n\n\n/// @title Multisignature wallet with time lock- Allows multiple parties to execute a transaction after a time lock has passed.\n/// @author Amir Bandeali - <amir@0xProject.com>\n// solhint-disable not-rely-on-time\ncontract MultiSigWalletWithTimeLock is\n MultiSigWallet\n{\n event ConfirmationTimeSet(uint256 indexed transactionId, uint256 confirmationTime);\n event TimeLockChange(uint256 secondsTimeLocked);\n\n uint256 public secondsTimeLocked;\n\n mapping (uint256 => uint256) public confirmationTimes;\n\n modifier notFullyConfirmed(uint256 transactionId) {\n require(\n !isConfirmed(transactionId),\n \"TX_FULLY_CONFIRMED\"\n );\n _;\n }\n\n modifier fullyConfirmed(uint256 transactionId) {\n require(\n isConfirmed(transactionId),\n \"TX_NOT_FULLY_CONFIRMED\"\n );\n _;\n }\n\n modifier pastTimeLock(uint256 transactionId) {\n require(\n block.timestamp >= confirmationTimes[transactionId] + secondsTimeLocked,\n \"TIME_LOCK_INCOMPLETE\"\n );\n _;\n }\n\n /// @dev Contract constructor sets initial owners, required number of confirmations, and time lock.\n /// @param _owners List of initial owners.\n /// @param _required Number of required confirmations.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n constructor (\n address[] _owners,\n uint256 _required,\n uint256 _secondsTimeLocked\n )\n public\n MultiSigWallet(_owners, _required)\n {\n secondsTimeLocked = _secondsTimeLocked;\n }\n\n /// @dev Changes the duration of the time lock for transactions.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n function changeTimeLock(uint256 _secondsTimeLocked)\n public\n onlyWallet\n {\n secondsTimeLocked = _secondsTimeLocked;\n emit TimeLockChange(_secondsTimeLocked);\n }\n\n /// @dev Allows an owner to confirm a transaction.\n /// @param transactionId Transaction ID.\n function confirmTransaction(uint256 transactionId)\n public\n ownerExists(msg.sender)\n transactionExists(transactionId)\n notConfirmed(transactionId, msg.sender)\n notFullyConfirmed(transactionId)\n {\n confirmations[transactionId][msg.sender] = true;\n emit Confirmation(msg.sender, transactionId);\n if (isConfirmed(transactionId)) {\n setConfirmationTime(transactionId, block.timestamp);\n }\n }\n\n /// @dev Allows anyone to execute a confirmed transaction.\n /// @param transactionId Transaction ID.\n function executeTransaction(uint256 transactionId)\n public\n notExecuted(transactionId)\n fullyConfirmed(transactionId)\n pastTimeLock(transactionId)\n {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) {\n emit Execution(transactionId);\n } else {\n emit ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n\n /// @dev Sets the time of when a submission first passed.\n function setConfirmationTime(uint256 transactionId, uint256 confirmationTime)\n internal\n {\n confirmationTimes[transactionId] = confirmationTime;\n emit ConfirmationTimeSet(transactionId, confirmationTime);\n }\n}\n",
- "2.0.0/protocol/AssetProxy/ERC20Proxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MixinAuthorizable.sol\";\n\n\ncontract ERC20Proxy is\n MixinAuthorizable\n{\n // Id of this proxy.\n bytes4 constant internal PROXY_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n \n // solhint-disable-next-line payable-fallback\n function () \n external\n {\n assembly {\n // The first 4 bytes of calldata holds the function selector\n let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)\n\n // `transferFrom` will be called with the following parameters:\n // assetData Encoded byte array.\n // from Address to transfer asset from.\n // to Address to transfer asset to.\n // amount Amount of asset to transfer.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {\n\n // To lookup a value in a mapping, we load from the storage location keccak256(k, p),\n // where k is the key left padded to 32 bytes and p is the storage slot\n let start := mload(64)\n mstore(start, and(caller, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(start, 32), authorized_slot)\n\n // Revert if authorized[msg.sender] == false\n if iszero(sload(keccak256(start, 64))) {\n // Revert with `Error(\"SENDER_NOT_AUTHORIZED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // `transferFrom`.\n // The function is marked `external`, so no abi decodeding is done for\n // us. Instead, we expect the `calldata` memory to contain the\n // following:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n //\n // (*): offset is computed from start of function parameters, so offset\n // by an additional 4 bytes in the calldata.\n //\n // (**): see table below to compute length of assetData Contents\n //\n // WARNING: The ABIv2 specification allows additional padding between\n // the Params and Data section. This will result in a larger\n // offset to assetData.\n\n // Asset data itself is encoded as follows:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 1 * 32 | function parameters: |\n // | | 4 | 12 + 20 | 1. token address |\n\n // We construct calldata for the `token.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 4 | | 1. from |\n // | | 36 | | 2. to |\n // | | 68 | | 3. amount |\n\n /////// Read token address from calldata ///////\n // * The token address is stored in `assetData`.\n //\n // * The \"offset to assetData\" is stored at offset 4 in the calldata (table 1).\n // [assetDataOffsetFromParams = calldataload(4)]\n //\n // * Notes that the \"offset to assetData\" is relative to the \"Params\" area of calldata;\n // add 4 bytes to account for the length of the \"Header\" area (table 1).\n // [assetDataOffsetFromHeader = assetDataOffsetFromParams + 4]\n //\n // * The \"token address\" is offset 32+4=36 bytes into \"assetData\" (tables 1 & 2).\n // [tokenOffset = assetDataOffsetFromHeader + 36 = calldataload(4) + 4 + 36]\n let token := calldataload(add(calldataload(4), 40))\n \n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFrom` selector.\n // Any trailing data in transferFromSelector will be\n // overwritten in the next `mstore` call.\n mstore(0, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // We copy the fields `from`, `to` and `amount` in bulk\n // from our own calldata to the new calldata.\n calldatacopy(4, 36, 96)\n\n /////// Call `token.transferFrom` using the calldata ///////\n let success := call(\n gas, // forward all gas\n token, // call address of token contract\n 0, // don't send any ETH\n 0, // pointer to start of input\n 100, // length of input\n 0, // write output over input\n 32 // output size should be 32 bytes\n )\n\n /////// Check return data. ///////\n // If there is no return data, we assume the token incorrectly\n // does not return a bool. In this case we expect it to revert\n // on failure, which was handled above.\n // If the token does return data, we require that it is a single\n // nonzero 32 bytes value.\n // So the transfer succeeded if the call succeeded and either\n // returned nothing, or returned a non-zero 32 byte value. \n success := and(success, or(\n iszero(returndatasize),\n and(\n eq(returndatasize, 32),\n gt(mload(0), 0)\n )\n ))\n if success {\n return(0, 0)\n }\n \n // Revert with `Error(\"TRANSFER_FAILED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // Revert if undefined function is called\n revert(0, 0)\n }\n }\n\n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4)\n {\n return PROXY_ID;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/ERC721Proxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MixinAuthorizable.sol\";\n\n\ncontract ERC721Proxy is\n MixinAuthorizable\n{\n // Id of this proxy.\n bytes4 constant internal PROXY_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n\n // solhint-disable-next-line payable-fallback\n function () \n external\n {\n assembly {\n // The first 4 bytes of calldata holds the function selector\n let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)\n\n // `transferFrom` will be called with the following parameters:\n // assetData Encoded byte array.\n // from Address to transfer asset from.\n // to Address to transfer asset to.\n // amount Amount of asset to transfer.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {\n\n // To lookup a value in a mapping, we load from the storage location keccak256(k, p),\n // where k is the key left padded to 32 bytes and p is the storage slot\n let start := mload(64)\n mstore(start, and(caller, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(start, 32), authorized_slot)\n\n // Revert if authorized[msg.sender] == false\n if iszero(sload(keccak256(start, 64))) {\n // Revert with `Error(\"SENDER_NOT_AUTHORIZED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // `transferFrom`.\n // The function is marked `external`, so no abi decodeding is done for\n // us. Instead, we expect the `calldata` memory to contain the\n // following:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n //\n // (*): offset is computed from start of function parameters, so offset\n // by an additional 4 bytes in the calldata.\n //\n // (**): see table below to compute length of assetData Contents\n //\n // WARNING: The ABIv2 specification allows additional padding between\n // the Params and Data section. This will result in a larger\n // offset to assetData.\n\n // Asset data itself is encoded as follows:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 2 * 32 | function parameters: |\n // | | 4 | 12 + 20 | 1. token address |\n // | | 36 | | 2. tokenId |\n \n // We construct calldata for the `token.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n // \n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 4 | | 1. from |\n // | | 36 | | 2. to |\n // | | 68 | | 3. tokenId |\n\n // There exists only 1 of each token.\n // require(amount == 1, \"INVALID_AMOUNT\")\n if sub(calldataload(100), 1) {\n // Revert with `Error(\"INVALID_AMOUNT\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000e494e56414c49445f414d4f554e540000000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFrom` selector.\n // Any trailing data in transferFromSelector will be\n // overwritten in the next `mstore` call.\n mstore(0, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // We copy the fields `from` and `to` in bulk\n // from our own calldata to the new calldata.\n calldatacopy(4, 36, 64)\n\n // Copy `tokenId` field from our own calldata to the new calldata.\n let assetDataOffset := calldataload(4)\n calldatacopy(68, add(assetDataOffset, 72), 32)\n\n /////// Call `token.transferFrom` using the calldata ///////\n let token := calldataload(add(assetDataOffset, 40))\n let success := call(\n gas, // forward all gas\n token, // call address of token contract\n 0, // don't send any ETH\n 0, // pointer to start of input\n 100, // length of input\n 0, // write output to null\n 0 // output size is 0 bytes\n )\n if success {\n return(0, 0)\n }\n \n // Revert with `Error(\"TRANSFER_FAILED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // Revert if undefined function is called\n revert(0, 0)\n }\n }\n\n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4)\n {\n return PROXY_ID;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/MixinAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"./mixins/MAuthorizable.sol\";\n\n\ncontract MixinAuthorizable is\n Ownable,\n MAuthorizable\n{\n /// @dev Only authorized addresses can invoke functions with this modifier.\n modifier onlyAuthorized {\n require(\n authorized[msg.sender],\n \"SENDER_NOT_AUTHORIZED\"\n );\n _;\n }\n\n mapping (address => bool) public authorized;\n address[] public authorities;\n\n /// @dev Authorizes an address.\n /// @param target Address to authorize.\n function addAuthorizedAddress(address target)\n external\n onlyOwner\n {\n require(\n !authorized[target],\n \"TARGET_ALREADY_AUTHORIZED\"\n );\n\n authorized[target] = true;\n authorities.push(target);\n emit AuthorizedAddressAdded(target, msg.sender);\n }\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n function removeAuthorizedAddress(address target)\n external\n onlyOwner\n {\n require(\n authorized[target],\n \"TARGET_NOT_AUTHORIZED\"\n );\n\n delete authorized[target];\n for (uint256 i = 0; i < authorities.length; i++) {\n if (authorities[i] == target) {\n authorities[i] = authorities[authorities.length - 1];\n authorities.length -= 1;\n break;\n }\n }\n emit AuthorizedAddressRemoved(target, msg.sender);\n }\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n /// @param index Index of target in authorities array.\n function removeAuthorizedAddressAtIndex(\n address target,\n uint256 index\n )\n external\n onlyOwner\n {\n require(\n authorized[target],\n \"TARGET_NOT_AUTHORIZED\"\n );\n require(\n index < authorities.length,\n \"INDEX_OUT_OF_BOUNDS\"\n );\n require(\n authorities[index] == target,\n \"AUTHORIZED_ADDRESS_MISMATCH\"\n );\n\n delete authorized[target];\n authorities[index] = authorities[authorities.length - 1];\n authorities.length -= 1;\n emit AuthorizedAddressRemoved(target, msg.sender);\n }\n\n /// @dev Gets all authorized addresses.\n /// @return Array of authorized addresses.\n function getAuthorizedAddresses()\n external\n view\n returns (address[] memory)\n {\n return authorities;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IAuthorizable.sol\";\n\n\ncontract IAssetProxy is\n IAuthorizable\n{\n /// @dev Transfers assets. Either succeeds or throws.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param from Address to transfer asset from.\n /// @param to Address to transfer asset to.\n /// @param amount Amount of asset to transfer.\n function transferFrom(\n bytes assetData,\n address from,\n address to,\n uint256 amount\n )\n external;\n \n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4);\n}\n",
- "2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/Ownable/IOwnable.sol\";\n\n\ncontract IAuthorizable is\n IOwnable\n{\n /// @dev Authorizes an address.\n /// @param target Address to authorize.\n function addAuthorizedAddress(address target)\n external;\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n function removeAuthorizedAddress(address target)\n external;\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n /// @param index Index of target in authorities array.\n function removeAuthorizedAddressAtIndex(\n address target,\n uint256 index\n )\n external;\n \n /// @dev Gets all authorized addresses.\n /// @return Array of authorized addresses.\n function getAuthorizedAddresses()\n external\n view\n returns (address[] memory);\n}\n",
- "2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAuthorizable.sol\";\n\n\ncontract MAuthorizable is\n IAuthorizable\n{\n // Event logged when a new address is authorized.\n event AuthorizedAddressAdded(\n address indexed target,\n address indexed caller\n );\n\n // Event logged when a currently authorized address is unauthorized.\n event AuthorizedAddressRemoved(\n address indexed target,\n address indexed caller\n );\n\n /// @dev Only authorized addresses can invoke functions with this modifier.\n modifier onlyAuthorized { revert(); _; }\n}\n",
- "2.0.0/protocol/AssetProxyOwner/AssetProxyOwner.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../multisig/MultiSigWalletWithTimeLock.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\n\n\ncontract AssetProxyOwner is\n MultiSigWalletWithTimeLock\n{\n using LibBytes for bytes;\n\n event AssetProxyRegistration(address assetProxyContract, bool isRegistered);\n\n // Mapping of AssetProxy contract address =>\n // if this contract is allowed to call the AssetProxy's `removeAuthorizedAddressAtIndex` method without a time lock.\n mapping (address => bool) public isAssetProxyRegistered;\n\n bytes4 constant internal REMOVE_AUTHORIZED_ADDRESS_AT_INDEX_SELECTOR = bytes4(keccak256(\"removeAuthorizedAddressAtIndex(address,uint256)\"));\n\n /// @dev Function will revert if the transaction does not call `removeAuthorizedAddressAtIndex`\n /// on an approved AssetProxy contract.\n modifier validRemoveAuthorizedAddressAtIndexTx(uint256 transactionId) {\n Transaction storage txn = transactions[transactionId];\n require(\n isAssetProxyRegistered[txn.destination],\n \"UNREGISTERED_ASSET_PROXY\"\n );\n require(\n txn.data.readBytes4(0) == REMOVE_AUTHORIZED_ADDRESS_AT_INDEX_SELECTOR,\n \"INVALID_FUNCTION_SELECTOR\"\n );\n _;\n }\n\n /// @dev Contract constructor sets initial owners, required number of confirmations,\n /// time lock, and list of AssetProxy addresses.\n /// @param _owners List of initial owners.\n /// @param _assetProxyContracts Array of AssetProxy contract addresses.\n /// @param _required Number of required confirmations.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n constructor (\n address[] memory _owners,\n address[] memory _assetProxyContracts,\n uint256 _required,\n uint256 _secondsTimeLocked\n )\n public\n MultiSigWalletWithTimeLock(_owners, _required, _secondsTimeLocked)\n {\n for (uint256 i = 0; i < _assetProxyContracts.length; i++) {\n address assetProxy = _assetProxyContracts[i];\n require(\n assetProxy != address(0),\n \"INVALID_ASSET_PROXY\"\n );\n isAssetProxyRegistered[assetProxy] = true;\n }\n }\n\n /// @dev Registers or deregisters an AssetProxy to be able to execute\n /// `removeAuthorizedAddressAtIndex` without a timelock.\n /// @param assetProxyContract Address of AssetProxy contract.\n /// @param isRegistered Status of approval for AssetProxy contract.\n function registerAssetProxy(address assetProxyContract, bool isRegistered)\n public\n onlyWallet\n notNull(assetProxyContract)\n {\n isAssetProxyRegistered[assetProxyContract] = isRegistered;\n emit AssetProxyRegistration(assetProxyContract, isRegistered);\n }\n\n /// @dev Allows execution of `removeAuthorizedAddressAtIndex` without time lock.\n /// @param transactionId Transaction ID.\n function executeRemoveAuthorizedAddressAtIndex(uint256 transactionId)\n public\n notExecuted(transactionId)\n fullyConfirmed(transactionId)\n validRemoveAuthorizedAddressAtIndexTx(transactionId)\n {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) {\n emit Execution(transactionId);\n } else {\n emit ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/Exchange.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./MixinExchangeCore.sol\";\nimport \"./MixinSignatureValidator.sol\";\nimport \"./MixinWrapperFunctions.sol\";\nimport \"./MixinAssetProxyDispatcher.sol\";\nimport \"./MixinTransactions.sol\";\nimport \"./MixinMatchOrders.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract Exchange is\n MixinExchangeCore,\n MixinMatchOrders,\n MixinSignatureValidator,\n MixinTransactions,\n MixinAssetProxyDispatcher,\n MixinWrapperFunctions\n{\n string constant public VERSION = \"2.0.0\";\n\n // Mixins are instantiated in the order they are inherited\n constructor ()\n public\n MixinExchangeCore()\n MixinMatchOrders()\n MixinSignatureValidator()\n MixinTransactions()\n MixinAssetProxyDispatcher()\n MixinWrapperFunctions()\n {}\n}\n",
- "2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\nimport \"../AssetProxy/interfaces/IAssetProxy.sol\";\n\n\ncontract MixinAssetProxyDispatcher is\n Ownable,\n MAssetProxyDispatcher\n{\n // Mapping from Asset Proxy Id's to their respective Asset Proxy\n mapping (bytes4 => IAssetProxy) public assetProxies;\n\n /// @dev Registers an asset proxy to its asset proxy id.\n /// Once an asset proxy is registered, it cannot be unregistered.\n /// @param assetProxy Address of new asset proxy to register.\n function registerAssetProxy(address assetProxy)\n external\n onlyOwner\n {\n IAssetProxy assetProxyContract = IAssetProxy(assetProxy);\n\n // Ensure that no asset proxy exists with current id.\n bytes4 assetProxyId = assetProxyContract.getProxyId();\n address currentAssetProxy = assetProxies[assetProxyId];\n require(\n currentAssetProxy == address(0),\n \"ASSET_PROXY_ALREADY_EXISTS\"\n );\n\n // Add asset proxy and log registration.\n assetProxies[assetProxyId] = assetProxyContract;\n emit AssetProxyRegistered(\n assetProxyId,\n assetProxy\n );\n }\n\n /// @dev Gets an asset proxy.\n /// @param assetProxyId Id of the asset proxy.\n /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered.\n function getAssetProxy(bytes4 assetProxyId)\n external\n view\n returns (address)\n {\n return assetProxies[assetProxyId];\n }\n\n /// @dev Forwards arguments to assetProxy and calls `transferFrom`. Either succeeds or throws.\n /// @param assetData Byte array encoded for the asset.\n /// @param from Address to transfer token from.\n /// @param to Address to transfer token to.\n /// @param amount Amount of token to transfer.\n function dispatchTransferFrom(\n bytes memory assetData,\n address from,\n address to,\n uint256 amount\n )\n internal\n {\n // Do nothing if no amount should be transferred.\n if (amount > 0 && from != to) {\n // Ensure assetData length is valid\n require(\n assetData.length > 3,\n \"LENGTH_GREATER_THAN_3_REQUIRED\"\n );\n \n // Lookup assetProxy. We do not use `LibBytes.readBytes4` for gas efficiency reasons.\n bytes4 assetProxyId;\n assembly {\n assetProxyId := and(mload(\n add(assetData, 32)),\n 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000\n )\n }\n address assetProxy = assetProxies[assetProxyId];\n\n // Ensure that assetProxy exists\n require(\n assetProxy != address(0),\n \"ASSET_PROXY_DOES_NOT_EXIST\"\n );\n \n // We construct calldata for the `assetProxy.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n // \n // | Area | Offset | Length | Contents |\n // | -------- |--------|---------|-------------------------------------------- |\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n\n assembly {\n /////// Setup State ///////\n // `cdStart` is the start of the calldata for `assetProxy.transferFrom` (equal to free memory ptr).\n let cdStart := mload(64)\n // `dataAreaLength` is the total number of words needed to store `assetData`\n // As-per the ABI spec, this value is padded up to the nearest multiple of 32,\n // and includes 32-bytes for length.\n let dataAreaLength := and(add(mload(assetData), 63), 0xFFFFFFFFFFFE0)\n // `cdEnd` is the end of the calldata for `assetProxy.transferFrom`.\n let cdEnd := add(cdStart, add(132, dataAreaLength))\n\n \n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFromSelector`.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n mstore(cdStart, 0xa85e59e400000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // Each parameter is padded to 32-bytes. The entire Params Area is 128 bytes.\n // Notes:\n // 1. The offset to `assetData` is the length of the Params Area (128 bytes).\n // 2. A 20-byte mask is applied to addresses to zero-out the unused bytes.\n mstore(add(cdStart, 4), 128)\n mstore(add(cdStart, 36), and(from, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(cdStart, 68), and(to, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(cdStart, 100), amount)\n \n /////// Setup Data Area ///////\n // This area holds `assetData`.\n let dataArea := add(cdStart, 132)\n // solhint-disable-next-line no-empty-blocks\n for {} lt(dataArea, cdEnd) {} {\n mstore(dataArea, mload(assetData))\n dataArea := add(dataArea, 32)\n assetData := add(assetData, 32)\n }\n\n /////// Call `assetProxy.transferFrom` using the constructed calldata ///////\n let success := call(\n gas, // forward all gas\n assetProxy, // call address of asset proxy\n 0, // don't send any ETH\n cdStart, // pointer to start of input\n sub(cdEnd, cdStart), // length of input \n cdStart, // write output over input\n 512 // reserve 512 bytes for output\n )\n if iszero(success) {\n revert(cdStart, returndatasize())\n }\n }\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\n\n\ncontract MixinExchangeCore is\n ReentrancyGuard,\n LibConstants,\n LibMath,\n LibOrder,\n LibFillResults,\n MAssetProxyDispatcher,\n MExchangeCore,\n MSignatureValidator,\n MTransactions\n{\n // Mapping of orderHash => amount of takerAsset already bought by maker\n mapping (bytes32 => uint256) public filled;\n\n // Mapping of orderHash => cancelled\n mapping (bytes32 => bool) public cancelled;\n\n // Mapping of makerAddress => senderAddress => lowest salt an order can have in order to be fillable\n // Orders with specified senderAddress and with a salt less than their epoch are considered cancelled\n mapping (address => mapping (address => uint256)) public orderEpoch;\n\n /// @dev Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch\n /// and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress).\n /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled.\n function cancelOrdersUpTo(uint256 targetOrderEpoch)\n external\n nonReentrant\n {\n address makerAddress = getCurrentContextAddress();\n // If this function is called via `executeTransaction`, we only update the orderEpoch for the makerAddress/msg.sender combination.\n // This allows external filter contracts to add rules to how orders are cancelled via this function.\n address senderAddress = makerAddress == msg.sender ? address(0) : msg.sender;\n\n // orderEpoch is initialized to 0, so to cancelUpTo we need salt + 1\n uint256 newOrderEpoch = targetOrderEpoch + 1; \n uint256 oldOrderEpoch = orderEpoch[makerAddress][senderAddress];\n\n // Ensure orderEpoch is monotonically increasing\n require(\n newOrderEpoch > oldOrderEpoch, \n \"INVALID_NEW_ORDER_EPOCH\"\n );\n\n // Update orderEpoch\n orderEpoch[makerAddress][senderAddress] = newOrderEpoch;\n emit CancelUpTo(\n makerAddress,\n senderAddress,\n newOrderEpoch\n );\n }\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrder(\n Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n nonReentrant\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n return fillResults;\n }\n\n /// @dev After calling, the order can not be filled anymore.\n /// Throws if order is invalid or sender does not have permission to cancel.\n /// @param order Order to cancel. Order must be OrderStatus.FILLABLE.\n function cancelOrder(Order memory order)\n public\n nonReentrant\n {\n cancelOrderInternal(order);\n }\n\n /// @dev Gets information about an order: status, hash, and amount filled.\n /// @param order Order to gather information on.\n /// @return OrderInfo Information about the order and its state.\n /// See LibOrder.OrderInfo for a complete description.\n function getOrderInfo(Order memory order)\n public\n view\n returns (OrderInfo memory orderInfo)\n {\n // Compute the order hash\n orderInfo.orderHash = getOrderHash(order);\n\n // Fetch filled amount\n orderInfo.orderTakerAssetFilledAmount = filled[orderInfo.orderHash];\n\n // If order.makerAssetAmount is zero, we also reject the order.\n // While the Exchange contract handles them correctly, they create\n // edge cases in the supporting infrastructure because they have\n // an 'infinite' price when computed by a simple division.\n if (order.makerAssetAmount == 0) {\n orderInfo.orderStatus = uint8(OrderStatus.INVALID_MAKER_ASSET_AMOUNT);\n return orderInfo;\n }\n\n // If order.takerAssetAmount is zero, then the order will always\n // be considered filled because 0 == takerAssetAmount == orderTakerAssetFilledAmount\n // Instead of distinguishing between unfilled and filled zero taker\n // amount orders, we choose not to support them.\n if (order.takerAssetAmount == 0) {\n orderInfo.orderStatus = uint8(OrderStatus.INVALID_TAKER_ASSET_AMOUNT);\n return orderInfo;\n }\n\n // Validate order availability\n if (orderInfo.orderTakerAssetFilledAmount >= order.takerAssetAmount) {\n orderInfo.orderStatus = uint8(OrderStatus.FULLY_FILLED);\n return orderInfo;\n }\n\n // Validate order expiration\n // solhint-disable-next-line not-rely-on-time\n if (block.timestamp >= order.expirationTimeSeconds) {\n orderInfo.orderStatus = uint8(OrderStatus.EXPIRED);\n return orderInfo;\n }\n\n // Check if order has been cancelled\n if (cancelled[orderInfo.orderHash]) {\n orderInfo.orderStatus = uint8(OrderStatus.CANCELLED);\n return orderInfo;\n }\n if (orderEpoch[order.makerAddress][order.senderAddress] > order.salt) {\n orderInfo.orderStatus = uint8(OrderStatus.CANCELLED);\n return orderInfo;\n }\n\n // All other statuses are ruled out: order is Fillable\n orderInfo.orderStatus = uint8(OrderStatus.FILLABLE);\n return orderInfo;\n }\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderInternal(\n Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n // Fetch order info\n OrderInfo memory orderInfo = getOrderInfo(order);\n\n // Fetch taker address\n address takerAddress = getCurrentContextAddress();\n \n // Assert that the order is fillable by taker\n assertFillableOrder(\n order,\n orderInfo,\n takerAddress,\n signature\n );\n \n // Get amount of takerAsset to fill\n uint256 remainingTakerAssetAmount = safeSub(order.takerAssetAmount, orderInfo.orderTakerAssetFilledAmount);\n uint256 takerAssetFilledAmount = min256(takerAssetFillAmount, remainingTakerAssetAmount);\n\n // Validate context\n assertValidFill(\n order,\n orderInfo,\n takerAssetFillAmount,\n takerAssetFilledAmount,\n fillResults.makerAssetFilledAmount\n );\n\n // Compute proportional fill amounts\n fillResults = calculateFillResults(order, takerAssetFilledAmount);\n\n // Update exchange internal state\n updateFilledState(\n order,\n takerAddress,\n orderInfo.orderHash,\n orderInfo.orderTakerAssetFilledAmount,\n fillResults\n );\n \n // Settle order\n settleOrder(\n order,\n takerAddress,\n fillResults\n );\n\n return fillResults;\n }\n\n /// @dev After calling, the order can not be filled anymore.\n /// Throws if order is invalid or sender does not have permission to cancel.\n /// @param order Order to cancel. Order must be OrderStatus.FILLABLE.\n function cancelOrderInternal(Order memory order)\n internal\n {\n // Fetch current order status\n OrderInfo memory orderInfo = getOrderInfo(order);\n\n // Validate context\n assertValidCancel(order, orderInfo);\n\n // Perform cancel\n updateCancelledState(order, orderInfo.orderHash);\n }\n\n /// @dev Updates state with results of a fill order.\n /// @param order that was filled.\n /// @param takerAddress Address of taker who filled the order.\n /// @param orderTakerAssetFilledAmount Amount of order already filled.\n function updateFilledState(\n Order memory order,\n address takerAddress,\n bytes32 orderHash,\n uint256 orderTakerAssetFilledAmount,\n FillResults memory fillResults\n )\n internal\n {\n // Update state\n filled[orderHash] = safeAdd(orderTakerAssetFilledAmount, fillResults.takerAssetFilledAmount);\n\n // Log order\n emit Fill(\n order.makerAddress,\n order.feeRecipientAddress,\n takerAddress,\n msg.sender,\n fillResults.makerAssetFilledAmount,\n fillResults.takerAssetFilledAmount,\n fillResults.makerFeePaid,\n fillResults.takerFeePaid,\n orderHash,\n order.makerAssetData,\n order.takerAssetData\n );\n }\n\n /// @dev Updates state with results of cancelling an order.\n /// State is only updated if the order is currently fillable.\n /// Otherwise, updating state would have no effect.\n /// @param order that was cancelled.\n /// @param orderHash Hash of order that was cancelled.\n function updateCancelledState(\n Order memory order,\n bytes32 orderHash\n )\n internal\n {\n // Perform cancel\n cancelled[orderHash] = true;\n\n // Log cancel\n emit Cancel(\n order.makerAddress,\n order.feeRecipientAddress,\n msg.sender,\n orderHash,\n order.makerAssetData,\n order.takerAssetData\n );\n }\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAddress Address of order taker.\n /// @param signature Proof that the orders was created by its maker.\n function assertFillableOrder(\n Order memory order,\n OrderInfo memory orderInfo,\n address takerAddress,\n bytes memory signature\n )\n internal\n view\n {\n // An order can only be filled if its status is FILLABLE.\n require(\n orderInfo.orderStatus == uint8(OrderStatus.FILLABLE),\n \"ORDER_UNFILLABLE\"\n );\n \n // Validate sender is allowed to fill this order\n if (order.senderAddress != address(0)) {\n require(\n order.senderAddress == msg.sender,\n \"INVALID_SENDER\"\n );\n }\n \n // Validate taker is allowed to fill this order\n if (order.takerAddress != address(0)) {\n require(\n order.takerAddress == takerAddress,\n \"INVALID_TAKER\"\n );\n }\n \n // Validate Maker signature (check only if first time seen)\n if (orderInfo.orderTakerAssetFilledAmount == 0) {\n require(\n isValidSignature(\n orderInfo.orderHash,\n order.makerAddress,\n signature\n ),\n \"INVALID_ORDER_SIGNATURE\"\n );\n }\n }\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAssetFillAmount Desired amount of order to fill by taker.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @param makerAssetFilledAmount Amount of makerAsset that will be transfered.\n function assertValidFill(\n Order memory order,\n OrderInfo memory orderInfo,\n uint256 takerAssetFillAmount, // TODO: use FillResults\n uint256 takerAssetFilledAmount,\n uint256 makerAssetFilledAmount\n )\n internal\n view\n {\n // Revert if fill amount is invalid\n // TODO: reconsider necessity for v2.1\n require(\n takerAssetFillAmount != 0,\n \"INVALID_TAKER_AMOUNT\"\n );\n \n // Make sure taker does not pay more than desired amount\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n takerAssetFilledAmount <= takerAssetFillAmount,\n \"TAKER_OVERPAY\"\n );\n \n // Make sure order is not overfilled\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n safeAdd(orderInfo.orderTakerAssetFilledAmount, takerAssetFilledAmount) <= order.takerAssetAmount,\n \"ORDER_OVERFILL\"\n );\n \n // Make sure order is filled at acceptable price.\n // The order has an implied price from the makers perspective:\n // order price = order.makerAssetAmount / order.takerAssetAmount\n // i.e. the number of makerAsset maker is paying per takerAsset. The\n // maker is guaranteed to get this price or a better (lower) one. The\n // actual price maker is getting in this fill is:\n // fill price = makerAssetFilledAmount / takerAssetFilledAmount\n // We need `fill price <= order price` for the fill to be fair to maker.\n // This amounts to:\n // makerAssetFilledAmount order.makerAssetAmount\n // ------------------------ <= -----------------------\n // takerAssetFilledAmount order.takerAssetAmount\n // or, equivalently:\n // makerAssetFilledAmount * order.takerAssetAmount <=\n // order.makerAssetAmount * takerAssetFilledAmount\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n safeMul(makerAssetFilledAmount, order.takerAssetAmount)\n <= \n safeMul(order.makerAssetAmount, takerAssetFilledAmount),\n \"INVALID_FILL_PRICE\"\n );\n }\n\n /// @dev Validates context for cancelOrder. Succeeds or throws.\n /// @param order to be cancelled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n function assertValidCancel(\n Order memory order,\n OrderInfo memory orderInfo\n )\n internal\n view\n {\n // Ensure order is valid\n // An order can only be cancelled if its status is FILLABLE.\n require(\n orderInfo.orderStatus == uint8(OrderStatus.FILLABLE),\n \"ORDER_UNFILLABLE\"\n );\n\n // Validate sender is allowed to cancel this order\n if (order.senderAddress != address(0)) {\n require(\n order.senderAddress == msg.sender,\n \"INVALID_SENDER\"\n );\n }\n\n // Validate transaction signed by maker\n address makerAddress = getCurrentContextAddress();\n require(\n order.makerAddress == makerAddress,\n \"INVALID_MAKER\"\n );\n }\n\n /// @dev Calculates amounts filled and fees paid by maker and taker.\n /// @param order to be filled.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function calculateFillResults(\n Order memory order,\n uint256 takerAssetFilledAmount\n )\n internal\n pure\n returns (FillResults memory fillResults)\n {\n // Compute proportional transfer amounts\n fillResults.takerAssetFilledAmount = takerAssetFilledAmount;\n fillResults.makerAssetFilledAmount = safeGetPartialAmountFloor(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.makerAssetAmount\n );\n fillResults.makerFeePaid = safeGetPartialAmountFloor(\n fillResults.makerAssetFilledAmount,\n order.makerAssetAmount,\n order.makerFee\n );\n fillResults.takerFeePaid = safeGetPartialAmountFloor(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.takerFee\n );\n\n return fillResults;\n }\n\n /// @dev Settles an order by transferring assets between counterparties.\n /// @param order Order struct containing order specifications.\n /// @param takerAddress Address selling takerAsset and buying makerAsset.\n /// @param fillResults Amounts to be filled and fees paid by maker and taker.\n function settleOrder(\n LibOrder.Order memory order,\n address takerAddress,\n LibFillResults.FillResults memory fillResults\n )\n private\n {\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n dispatchTransferFrom(\n order.makerAssetData,\n order.makerAddress,\n takerAddress,\n fillResults.makerAssetFilledAmount\n );\n dispatchTransferFrom(\n order.takerAssetData,\n takerAddress,\n order.makerAddress,\n fillResults.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n zrxAssetData,\n order.makerAddress,\n order.feeRecipientAddress,\n fillResults.makerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n order.feeRecipientAddress,\n fillResults.takerFeePaid\n );\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinMatchOrders.sol": "/*\n Copyright 2018 ZeroEx Intl.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n http://www.apache.org/licenses/LICENSE-2.0\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MMatchOrders.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\n\n\ncontract MixinMatchOrders is\n ReentrancyGuard,\n LibConstants,\n LibMath,\n MAssetProxyDispatcher,\n MExchangeCore,\n MMatchOrders,\n MTransactions\n{\n /// @dev Match two complementary orders that have a profitable spread.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the left order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftSignature Proof that order was created by the left maker.\n /// @param rightSignature Proof that order was created by the right maker.\n /// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.\n function matchOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n bytes memory leftSignature,\n bytes memory rightSignature\n )\n public\n nonReentrant\n returns (LibFillResults.MatchedFillResults memory matchedFillResults)\n {\n // We assume that rightOrder.takerAssetData == leftOrder.makerAssetData and rightOrder.makerAssetData == leftOrder.takerAssetData.\n // If this assumption isn't true, the match will fail at signature validation.\n rightOrder.makerAssetData = leftOrder.takerAssetData;\n rightOrder.takerAssetData = leftOrder.makerAssetData;\n\n // Get left & right order info\n LibOrder.OrderInfo memory leftOrderInfo = getOrderInfo(leftOrder);\n LibOrder.OrderInfo memory rightOrderInfo = getOrderInfo(rightOrder);\n\n // Fetch taker address\n address takerAddress = getCurrentContextAddress();\n \n // Either our context is valid or we revert\n assertFillableOrder(\n leftOrder,\n leftOrderInfo,\n takerAddress,\n leftSignature\n );\n assertFillableOrder(\n rightOrder,\n rightOrderInfo,\n takerAddress,\n rightSignature\n );\n assertValidMatch(leftOrder, rightOrder);\n\n // Compute proportional fill amounts\n matchedFillResults = calculateMatchedFillResults(\n leftOrder,\n rightOrder,\n leftOrderInfo.orderTakerAssetFilledAmount,\n rightOrderInfo.orderTakerAssetFilledAmount\n );\n\n // Validate fill contexts\n assertValidFill(\n leftOrder,\n leftOrderInfo,\n matchedFillResults.left.takerAssetFilledAmount,\n matchedFillResults.left.takerAssetFilledAmount,\n matchedFillResults.left.makerAssetFilledAmount\n );\n assertValidFill(\n rightOrder,\n rightOrderInfo,\n matchedFillResults.right.takerAssetFilledAmount,\n matchedFillResults.right.takerAssetFilledAmount,\n matchedFillResults.right.makerAssetFilledAmount\n );\n \n // Update exchange state\n updateFilledState(\n leftOrder,\n takerAddress,\n leftOrderInfo.orderHash,\n leftOrderInfo.orderTakerAssetFilledAmount,\n matchedFillResults.left\n );\n updateFilledState(\n rightOrder,\n takerAddress,\n rightOrderInfo.orderHash,\n rightOrderInfo.orderTakerAssetFilledAmount,\n matchedFillResults.right\n );\n\n // Settle matched orders. Succeeds or throws.\n settleMatchedOrders(\n leftOrder,\n rightOrder,\n takerAddress,\n matchedFillResults\n );\n\n return matchedFillResults;\n }\n\n /// @dev Validates context for matchOrders. Succeeds or throws.\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n function assertValidMatch(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder\n )\n internal\n pure\n {\n // Make sure there is a profitable spread.\n // There is a profitable spread iff the cost per unit bought (OrderA.MakerAmount/OrderA.TakerAmount) for each order is greater\n // than the profit per unit sold of the matched order (OrderB.TakerAmount/OrderB.MakerAmount).\n // This is satisfied by the equations below:\n // <leftOrder.makerAssetAmount> / <leftOrder.takerAssetAmount> >= <rightOrder.takerAssetAmount> / <rightOrder.makerAssetAmount>\n // AND\n // <rightOrder.makerAssetAmount> / <rightOrder.takerAssetAmount> >= <leftOrder.takerAssetAmount> / <leftOrder.makerAssetAmount>\n // These equations can be combined to get the following:\n require(\n safeMul(leftOrder.makerAssetAmount, rightOrder.makerAssetAmount) >=\n safeMul(leftOrder.takerAssetAmount, rightOrder.takerAssetAmount),\n \"NEGATIVE_SPREAD_REQUIRED\"\n );\n }\n\n /// @dev Calculates fill amounts for the matched orders.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the leftOrder order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftOrderTakerAssetFilledAmount Amount of left order already filled.\n /// @param rightOrderTakerAssetFilledAmount Amount of right order already filled.\n /// @param matchedFillResults Amounts to fill and fees to pay by maker and taker of matched orders.\n function calculateMatchedFillResults(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n uint256 leftOrderTakerAssetFilledAmount,\n uint256 rightOrderTakerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.MatchedFillResults memory matchedFillResults)\n {\n // Derive maker asset amounts for left & right orders, given store taker assert amounts\n uint256 leftTakerAssetAmountRemaining = safeSub(leftOrder.takerAssetAmount, leftOrderTakerAssetFilledAmount);\n uint256 leftMakerAssetAmountRemaining = safeGetPartialAmountFloor(\n leftOrder.makerAssetAmount,\n leftOrder.takerAssetAmount,\n leftTakerAssetAmountRemaining\n );\n uint256 rightTakerAssetAmountRemaining = safeSub(rightOrder.takerAssetAmount, rightOrderTakerAssetFilledAmount);\n uint256 rightMakerAssetAmountRemaining = safeGetPartialAmountFloor(\n rightOrder.makerAssetAmount,\n rightOrder.takerAssetAmount,\n rightTakerAssetAmountRemaining\n );\n\n // Calculate fill results for maker and taker assets: at least one order will be fully filled.\n // The maximum amount the left maker can buy is `leftTakerAssetAmountRemaining`\n // The maximum amount the right maker can sell is `rightMakerAssetAmountRemaining`\n // We have two distinct cases for calculating the fill results:\n // Case 1.\n // If the left maker can buy more than the right maker can sell, then only the right order is fully filled.\n // If the left maker can buy exactly what the right maker can sell, then both orders are fully filled.\n // Case 2.\n // If the left maker cannot buy more than the right maker can sell, then only the left order is fully filled.\n if (leftTakerAssetAmountRemaining >= rightMakerAssetAmountRemaining) {\n // Case 1: Right order is fully filled\n matchedFillResults.right.makerAssetFilledAmount = rightMakerAssetAmountRemaining;\n matchedFillResults.right.takerAssetFilledAmount = rightTakerAssetAmountRemaining;\n matchedFillResults.left.takerAssetFilledAmount = matchedFillResults.right.makerAssetFilledAmount;\n // Round down to ensure the maker's exchange rate does not exceed the price specified by the order. \n // We favor the maker when the exchange rate must be rounded.\n matchedFillResults.left.makerAssetFilledAmount = safeGetPartialAmountFloor(\n leftOrder.makerAssetAmount,\n leftOrder.takerAssetAmount,\n matchedFillResults.left.takerAssetFilledAmount\n );\n } else {\n // Case 2: Left order is fully filled\n matchedFillResults.left.makerAssetFilledAmount = leftMakerAssetAmountRemaining;\n matchedFillResults.left.takerAssetFilledAmount = leftTakerAssetAmountRemaining;\n matchedFillResults.right.makerAssetFilledAmount = matchedFillResults.left.takerAssetFilledAmount;\n // Round up to ensure the maker's exchange rate does not exceed the price specified by the order.\n // We favor the maker when the exchange rate must be rounded.\n matchedFillResults.right.takerAssetFilledAmount = safeGetPartialAmountCeil(\n rightOrder.takerAssetAmount,\n rightOrder.makerAssetAmount,\n matchedFillResults.right.makerAssetFilledAmount\n );\n }\n\n // Calculate amount given to taker\n matchedFillResults.leftMakerAssetSpreadAmount = safeSub(\n matchedFillResults.left.makerAssetFilledAmount,\n matchedFillResults.right.takerAssetFilledAmount\n );\n\n // Compute fees for left order\n matchedFillResults.left.makerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.left.makerAssetFilledAmount,\n leftOrder.makerAssetAmount,\n leftOrder.makerFee\n );\n matchedFillResults.left.takerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.left.takerAssetFilledAmount,\n leftOrder.takerAssetAmount,\n leftOrder.takerFee\n );\n\n // Compute fees for right order\n matchedFillResults.right.makerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.right.makerAssetFilledAmount,\n rightOrder.makerAssetAmount,\n rightOrder.makerFee\n );\n matchedFillResults.right.takerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.right.takerAssetFilledAmount,\n rightOrder.takerAssetAmount,\n rightOrder.takerFee\n );\n\n // Return fill results\n return matchedFillResults;\n }\n\n /// @dev Settles matched order by transferring appropriate funds between order makers, taker, and fee recipient.\n /// @param leftOrder First matched order.\n /// @param rightOrder Second matched order.\n /// @param takerAddress Address that matched the orders. The taker receives the spread between orders as profit.\n /// @param matchedFillResults Struct holding amounts to transfer between makers, taker, and fee recipients.\n function settleMatchedOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n address takerAddress,\n LibFillResults.MatchedFillResults memory matchedFillResults\n )\n private\n {\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n // Order makers and taker\n dispatchTransferFrom(\n leftOrder.makerAssetData,\n leftOrder.makerAddress,\n rightOrder.makerAddress,\n matchedFillResults.right.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n rightOrder.makerAssetData,\n rightOrder.makerAddress,\n leftOrder.makerAddress,\n matchedFillResults.left.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n leftOrder.makerAssetData,\n leftOrder.makerAddress,\n takerAddress,\n matchedFillResults.leftMakerAssetSpreadAmount\n );\n\n // Maker fees\n dispatchTransferFrom(\n zrxAssetData,\n leftOrder.makerAddress,\n leftOrder.feeRecipientAddress,\n matchedFillResults.left.makerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n rightOrder.makerAddress,\n rightOrder.feeRecipientAddress,\n matchedFillResults.right.makerFeePaid\n );\n\n // Taker fees\n if (leftOrder.feeRecipientAddress == rightOrder.feeRecipientAddress) {\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n leftOrder.feeRecipientAddress,\n safeAdd(\n matchedFillResults.left.takerFeePaid,\n matchedFillResults.right.takerFeePaid\n )\n );\n } else {\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n leftOrder.feeRecipientAddress,\n matchedFillResults.left.takerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n rightOrder.feeRecipientAddress,\n matchedFillResults.right.takerFeePaid\n );\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinSignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./interfaces/IWallet.sol\";\nimport \"./interfaces/IValidator.sol\";\n\n\ncontract MixinSignatureValidator is\n ReentrancyGuard,\n MSignatureValidator,\n MTransactions\n{\n using LibBytes for bytes;\n \n // Mapping of hash => signer => signed\n mapping (bytes32 => mapping (address => bool)) public preSigned;\n\n // Mapping of signer => validator => approved\n mapping (address => mapping (address => bool)) public allowedValidators;\n\n /// @dev Approves a hash on-chain using any valid signature type.\n /// After presigning a hash, the preSign signature type will become valid for that hash and signer.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n function preSign(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external\n {\n if (signerAddress != msg.sender) {\n require(\n isValidSignature(\n hash,\n signerAddress,\n signature\n ),\n \"INVALID_SIGNATURE\"\n );\n }\n preSigned[hash][signerAddress] = true;\n }\n\n /// @dev Approves/unnapproves a Validator contract to verify signatures on signer's behalf.\n /// @param validatorAddress Address of Validator contract.\n /// @param approval Approval or disapproval of Validator contract.\n function setSignatureValidatorApproval(\n address validatorAddress,\n bool approval\n )\n external\n nonReentrant\n {\n address signerAddress = getCurrentContextAddress();\n allowedValidators[signerAddress][validatorAddress] = approval;\n emit SignatureValidatorApproval(\n signerAddress,\n validatorAddress,\n approval\n );\n }\n\n /// @dev Verifies that a hash has been signed by the given signer.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes memory signature\n )\n public\n view\n returns (bool isValid)\n {\n require(\n signature.length > 0,\n \"LENGTH_GREATER_THAN_0_REQUIRED\"\n );\n\n // Pop last byte off of signature byte array.\n uint8 signatureTypeRaw = uint8(signature.popLastByte());\n\n // Ensure signature is supported\n require(\n signatureTypeRaw < uint8(SignatureType.NSignatureTypes),\n \"SIGNATURE_UNSUPPORTED\"\n );\n\n SignatureType signatureType = SignatureType(signatureTypeRaw);\n\n // Variables are not scoped in Solidity.\n uint8 v;\n bytes32 r;\n bytes32 s;\n address recovered;\n\n // Always illegal signature.\n // This is always an implicit option since a signer can create a\n // signature array with invalid type or length. We may as well make\n // it an explicit option. This aids testing and analysis. It is\n // also the initialization value for the enum type.\n if (signatureType == SignatureType.Illegal) {\n revert(\"SIGNATURE_ILLEGAL\");\n\n // Always invalid signature.\n // Like Illegal, this is always implicitly available and therefore\n // offered explicitly. It can be implicitly created by providing\n // a correctly formatted but incorrect signature.\n } else if (signatureType == SignatureType.Invalid) {\n require(\n signature.length == 0,\n \"LENGTH_0_REQUIRED\"\n );\n isValid = false;\n return isValid;\n\n // Signature using EIP712\n } else if (signatureType == SignatureType.EIP712) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n hash,\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n\n // Signed using web3.eth_sign\n } else if (signatureType == SignatureType.EthSign) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n keccak256(abi.encodePacked(\n \"\\x19Ethereum Signed Message:\\n32\",\n hash\n )),\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n\n // Signature verified by wallet contract.\n // If used with an order, the maker of the order is the wallet contract.\n } else if (signatureType == SignatureType.Wallet) {\n isValid = isValidWalletSignature(\n hash,\n signerAddress,\n signature\n );\n return isValid;\n\n // Signature verified by validator contract.\n // If used with an order, the maker of the order can still be an EOA.\n // A signature using this type should be encoded as:\n // | Offset | Length | Contents |\n // | 0x00 | x | Signature to validate |\n // | 0x00 + x | 20 | Address of validator contract |\n // | 0x14 + x | 1 | Signature type is always \"\\x06\" |\n } else if (signatureType == SignatureType.Validator) {\n // Pop last 20 bytes off of signature byte array.\n address validatorAddress = signature.popLast20Bytes();\n \n // Ensure signer has approved validator.\n if (!allowedValidators[signerAddress][validatorAddress]) {\n return false;\n }\n isValid = isValidValidatorSignature(\n validatorAddress,\n hash,\n signerAddress,\n signature\n );\n return isValid;\n\n // Signer signed hash previously using the preSign function.\n } else if (signatureType == SignatureType.PreSigned) {\n isValid = preSigned[hash][signerAddress];\n return isValid;\n }\n\n // Anything else is illegal (We do not return false because\n // the signature may actually be valid, just not in a format\n // that we currently support. In this case returning false\n // may lead the caller to incorrectly believe that the\n // signature was invalid.)\n revert(\"SIGNATURE_UNSUPPORTED\");\n }\n\n /// @dev Verifies signature using logic defined by Wallet contract.\n /// @param hash Any 32 byte hash.\n /// @param walletAddress Address that should have signed the given hash\n /// and defines its own signature verification method.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if signature is valid for given wallet..\n function isValidWalletSignature(\n bytes32 hash,\n address walletAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid)\n {\n bytes memory calldata = abi.encodeWithSelector(\n IWallet(walletAddress).isValidSignature.selector,\n hash,\n signature\n );\n assembly {\n let cdStart := add(calldata, 32)\n let success := staticcall(\n gas, // forward all gas\n walletAddress, // address of Wallet contract\n cdStart, // pointer to start of input\n mload(calldata), // length of input\n cdStart, // write output over input\n 32 // output size is 32 bytes\n )\n\n switch success\n case 0 {\n // Revert with `Error(\"WALLET_ERROR\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000c57414c4c45545f4552524f5200000000000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n case 1 {\n // Signature is valid if call did not revert and returned true\n isValid := mload(cdStart)\n }\n }\n return isValid;\n }\n\n /// @dev Verifies signature using logic defined by Validator contract.\n /// @param validatorAddress Address of validator contract.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidValidatorSignature(\n address validatorAddress,\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid)\n {\n bytes memory calldata = abi.encodeWithSelector(\n IValidator(signerAddress).isValidSignature.selector,\n hash,\n signerAddress,\n signature\n );\n assembly {\n let cdStart := add(calldata, 32)\n let success := staticcall(\n gas, // forward all gas\n validatorAddress, // address of Validator contract\n cdStart, // pointer to start of input\n mload(calldata), // length of input\n cdStart, // write output over input\n 32 // output size is 32 bytes\n )\n\n switch success\n case 0 {\n // Revert with `Error(\"VALIDATOR_ERROR\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f56414c494441544f525f4552524f5200000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n case 1 {\n // Signature is valid if call did not revert and returned true\n isValid := mload(cdStart)\n }\n }\n return isValid;\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinTransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\nimport \"./libs/LibExchangeErrors.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./libs/LibEIP712.sol\";\n\n\ncontract MixinTransactions is\n LibEIP712,\n MSignatureValidator,\n MTransactions\n{\n // Mapping of transaction hash => executed\n // This prevents transactions from being executed more than once.\n mapping (bytes32 => bool) public transactions;\n\n // Address of current transaction signer\n address public currentContextAddress;\n\n /// @dev Executes an exchange method call in the context of signer.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @param signature Proof of signer transaction by signer.\n function executeTransaction(\n uint256 salt,\n address signerAddress,\n bytes data,\n bytes signature\n )\n external\n {\n // Prevent reentrancy\n require(\n currentContextAddress == address(0),\n \"REENTRANCY_ILLEGAL\"\n );\n\n bytes32 transactionHash = hashEIP712Message(hashZeroExTransaction(\n salt,\n signerAddress,\n data\n ));\n\n // Validate transaction has not been executed\n require(\n !transactions[transactionHash],\n \"INVALID_TX_HASH\"\n );\n\n // Transaction always valid if signer is sender of transaction\n if (signerAddress != msg.sender) {\n // Validate signature\n require(\n isValidSignature(\n transactionHash,\n signerAddress,\n signature\n ),\n \"INVALID_TX_SIGNATURE\"\n );\n\n // Set the current transaction signer\n currentContextAddress = signerAddress;\n }\n\n // Execute transaction\n transactions[transactionHash] = true;\n require(\n address(this).delegatecall(data),\n \"FAILED_EXECUTION\"\n );\n\n // Reset current transaction signer if it was previously updated\n if (signerAddress != msg.sender) {\n currentContextAddress = address(0);\n }\n }\n\n /// @dev Calculates EIP712 hash of the Transaction.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @return EIP712 hash of the Transaction.\n function hashZeroExTransaction(\n uint256 salt,\n address signerAddress,\n bytes memory data\n )\n internal\n pure\n returns (bytes32 result)\n {\n bytes32 schemaHash = EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH;\n bytes32 dataHash = keccak256(data);\n\n // Assembly for more efficiently computing:\n // keccak256(abi.encodePacked(\n // EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH,\n // salt,\n // bytes32(signerAddress),\n // keccak256(data)\n // ));\n\n assembly {\n // Load free memory pointer\n let memPtr := mload(64)\n\n mstore(memPtr, schemaHash) // hash of schema\n mstore(add(memPtr, 32), salt) // salt\n mstore(add(memPtr, 64), and(signerAddress, 0xffffffffffffffffffffffffffffffffffffffff)) // signerAddress\n mstore(add(memPtr, 96), dataHash) // hash of data\n\n // Compute hash\n result := keccak256(memPtr, 128)\n }\n return result;\n }\n\n /// @dev The current function will be called in the context of this address (either 0x transaction signer or `msg.sender`).\n /// If calling a fill function, this address will represent the taker.\n /// If calling a cancel function, this address will represent the maker.\n /// @return Signer of 0x transaction if entry point is `executeTransaction`.\n /// `msg.sender` if entry point is any other function.\n function getCurrentContextAddress()\n internal\n view\n returns (address)\n {\n address currentContextAddress_ = currentContextAddress;\n address contextAddress = currentContextAddress_ == address(0) ? msg.sender : currentContextAddress_;\n return contextAddress;\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./libs/LibAbiEncoder.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MWrapperFunctions.sol\";\n\n\ncontract MixinWrapperFunctions is\n ReentrancyGuard,\n LibMath,\n LibFillResults,\n LibAbiEncoder,\n MExchangeCore,\n MWrapperFunctions\n{\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n nonReentrant\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrKillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n return fillResults;\n }\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (FillResults memory fillResults)\n {\n // ABI encode calldata for `fillOrder`\n bytes memory fillOrderCalldata = abiEncodeFillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n\n // Delegate to `fillOrder` and handle any exceptions gracefully\n assembly {\n let success := delegatecall(\n gas, // forward all gas\n address, // call address of this contract\n add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes)\n mload(fillOrderCalldata), // length of input\n fillOrderCalldata, // write output over input\n 128 // output size is 128 bytes\n )\n if success {\n mstore(fillResults, mload(fillOrderCalldata))\n mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32)))\n mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64)))\n mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96)))\n }\n }\n // fillResults values will be 0 by default if call was unsuccessful\n return fillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrKill.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrKillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrKillOrderInternal(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrders(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n bytes memory takerAssetData = orders[0].takerAssetData;\n \n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being sold by taker is the same for each order.\n // Rather than passing this in as calldata, we use the takerAssetData from the first order in all later orders.\n orders[i].takerAssetData = takerAssetData;\n\n // Calculate the remaining amount of takerAsset to sell\n uint256 remainingTakerAssetFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= takerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory takerAssetData = orders[0].takerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being sold by taker is the same for each order.\n // Rather than passing this in as calldata, we use the takerAssetData from the first order in all later orders.\n orders[i].takerAssetData = takerAssetData;\n\n // Calculate the remaining amount of takerAsset to sell\n uint256 remainingTakerAssetFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= takerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerAsset is bought by taker.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrders(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // Rather than passing this in as calldata, we copy the makerAssetData from the first order onto all later orders.\n orders[i].makerAssetData = makerAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n if (totalFillResults.makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // Rather than passing this in as calldata, we copy the makerAssetData from the first order onto all later orders.\n orders[i].makerAssetData = makerAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n if (totalFillResults.makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously cancels multiple orders in a single transaction.\n /// @param orders Array of order specifications.\n function batchCancelOrders(LibOrder.Order[] memory orders)\n public\n nonReentrant\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n cancelOrderInternal(orders[i]);\n }\n }\n\n /// @dev Fetches information for all passed in orders.\n /// @param orders Array of order specifications.\n /// @return Array of OrderInfo instances that correspond to each order.\n function getOrdersInfo(LibOrder.Order[] memory orders)\n public\n view\n returns (LibOrder.OrderInfo[] memory)\n {\n uint256 ordersLength = orders.length;\n LibOrder.OrderInfo[] memory ordersInfo = new LibOrder.OrderInfo[](ordersLength);\n for (uint256 i = 0; i != ordersLength; i++) {\n ordersInfo[i] = getOrderInfo(orders[i]);\n }\n return ordersInfo;\n }\n\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n require(\n fillResults.takerAssetFilledAmount == takerAssetFillAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return fillResults;\n }\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IAssetProxyDispatcher {\n\n /// @dev Registers an asset proxy to its asset proxy id.\n /// Once an asset proxy is registered, it cannot be unregistered.\n /// @param assetProxy Address of new asset proxy to register.\n function registerAssetProxy(address assetProxy)\n external;\n\n /// @dev Gets an asset proxy.\n /// @param assetProxyId Id of the asset proxy.\n /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered.\n function getAssetProxy(bytes4 assetProxyId)\n external\n view\n returns (address);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IExchange.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./IExchangeCore.sol\";\nimport \"./IMatchOrders.sol\";\nimport \"./ISignatureValidator.sol\";\nimport \"./ITransactions.sol\";\nimport \"./IAssetProxyDispatcher.sol\";\nimport \"./IWrapperFunctions.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract IExchange is\n IExchangeCore,\n IMatchOrders,\n ISignatureValidator,\n ITransactions,\n IAssetProxyDispatcher,\n IWrapperFunctions\n{}\n",
- "2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IExchangeCore {\n\n /// @dev Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch\n /// and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress).\n /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled.\n function cancelOrdersUpTo(uint256 targetOrderEpoch)\n external;\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev After calling, the order can not be filled anymore.\n /// @param order Order struct containing order specifications.\n function cancelOrder(LibOrder.Order memory order)\n public;\n\n /// @dev Gets information about an order: status, hash, and amount filled.\n /// @param order Order to gather information on.\n /// @return OrderInfo Information about the order and its state.\n /// See LibOrder.OrderInfo for a complete description.\n function getOrderInfo(LibOrder.Order memory order)\n public\n view\n returns (LibOrder.OrderInfo memory orderInfo);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IMatchOrders {\n\n /// @dev Match two complementary orders that have a profitable spread.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the left order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftSignature Proof that order was created by the left maker.\n /// @param rightSignature Proof that order was created by the right maker.\n /// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.\n function matchOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n bytes memory leftSignature,\n bytes memory rightSignature\n )\n public\n returns (LibFillResults.MatchedFillResults memory matchedFillResults);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract ISignatureValidator {\n\n /// @dev Approves a hash on-chain using any valid signature type.\n /// After presigning a hash, the preSign signature type will become valid for that hash and signer.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n function preSign(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external;\n \n /// @dev Approves/unnapproves a Validator contract to verify signatures on signer's behalf.\n /// @param validatorAddress Address of Validator contract.\n /// @param approval Approval or disapproval of Validator contract.\n function setSignatureValidatorApproval(\n address validatorAddress,\n bool approval\n )\n external;\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signerAddress Address of signer.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes memory signature\n )\n public\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/ITransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\n\ncontract ITransactions {\n\n /// @dev Executes an exchange method call in the context of signer.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @param signature Proof of signer transaction by signer.\n function executeTransaction(\n uint256 salt,\n address signerAddress,\n bytes data,\n bytes signature\n )\n external;\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IValidator {\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IWallet.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IWallet {\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n bytes signature\n )\n external\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IWrapperFunctions {\n\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrKill.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrKillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrders(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerAsset is bought by taker.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrders(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously cancels multiple orders in a single transaction.\n /// @param orders Array of order specifications.\n function batchCancelOrders(LibOrder.Order[] memory orders)\n public;\n\n /// @dev Fetches information for all passed in orders\n /// @param orders Array of order specifications.\n /// @return Array of OrderInfo instances that correspond to each order.\n function getOrdersInfo(LibOrder.Order[] memory orders)\n public\n view\n returns (LibOrder.OrderInfo[] memory);\n}\n",
- "2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./LibOrder.sol\";\n\n\ncontract LibAbiEncoder {\n\n /// @dev ABI encodes calldata for `fillOrder`.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return ABI encoded calldata for `fillOrder`.\n function abiEncodeFillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n pure\n returns (bytes memory fillOrderCalldata)\n {\n // We need to call MExchangeCore.fillOrder using a delegatecall in\n // assembly so that we can intercept a call that throws. For this, we\n // need the input encoded in memory in the Ethereum ABIv2 format [1].\n\n // | Area | Offset | Length | Contents |\n // | -------- |--------|---------|-------------------------------------------- |\n // | Header | 0x00 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 0x00 | | 1. offset to order (*) |\n // | | 0x20 | | 2. takerAssetFillAmount |\n // | | 0x40 | | 3. offset to signature (*) |\n // | Data | | 12 * 32 | order: |\n // | | 0x000 | | 1. senderAddress |\n // | | 0x020 | | 2. makerAddress |\n // | | 0x040 | | 3. takerAddress |\n // | | 0x060 | | 4. feeRecipientAddress |\n // | | 0x080 | | 5. makerAssetAmount |\n // | | 0x0A0 | | 6. takerAssetAmount |\n // | | 0x0C0 | | 7. makerFeeAmount |\n // | | 0x0E0 | | 8. takerFeeAmount |\n // | | 0x100 | | 9. expirationTimeSeconds |\n // | | 0x120 | | 10. salt |\n // | | 0x140 | | 11. Offset to makerAssetData (*) |\n // | | 0x160 | | 12. Offset to takerAssetData (*) |\n // | | 0x180 | 32 | makerAssetData Length |\n // | | 0x1A0 | ** | makerAssetData Contents |\n // | | 0x1C0 | 32 | takerAssetData Length |\n // | | 0x1E0 | ** | takerAssetData Contents |\n // | | 0x200 | 32 | signature Length |\n // | | 0x220 | ** | signature Contents |\n\n // * Offsets are calculated from the beginning of the current area: Header, Params, Data:\n // An offset stored in the Params area is calculated from the beginning of the Params section.\n // An offset stored in the Data area is calculated from the beginning of the Data section.\n\n // ** The length of dynamic array contents are stored in the field immediately preceeding the contents.\n\n // [1]: https://solidity.readthedocs.io/en/develop/abi-spec.html\n\n assembly {\n\n // Areas below may use the following variables:\n // 1. <area>Start -- Start of this area in memory\n // 2. <area>End -- End of this area in memory. This value may\n // be precomputed (before writing contents),\n // or it may be computed as contents are written.\n // 3. <area>Offset -- Current offset into area. If an area's End\n // is precomputed, this variable tracks the\n // offsets of contents as they are written.\n\n /////// Setup Header Area ///////\n // Load free memory pointer\n fillOrderCalldata := mload(0x40)\n // bytes4(keccak256(\"fillOrder((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),uint256,bytes)\"))\n // = 0xb4be83d5\n // Leave 0x20 bytes to store the length\n mstore(add(fillOrderCalldata, 0x20), 0xb4be83d500000000000000000000000000000000000000000000000000000000)\n let headerAreaEnd := add(fillOrderCalldata, 0x24)\n\n /////// Setup Params Area ///////\n // This area is preallocated and written to later.\n // This is because we need to fill in offsets that have not yet been calculated.\n let paramsAreaStart := headerAreaEnd\n let paramsAreaEnd := add(paramsAreaStart, 0x60)\n let paramsAreaOffset := paramsAreaStart\n\n /////// Setup Data Area ///////\n let dataAreaStart := paramsAreaEnd\n let dataAreaEnd := dataAreaStart\n\n // Offset from the source data we're reading from\n let sourceOffset := order\n // arrayLenBytes and arrayLenWords track the length of a dynamically-allocated bytes array.\n let arrayLenBytes := 0\n let arrayLenWords := 0\n\n /////// Write order Struct ///////\n // Write memory location of Order, relative to the start of the\n // parameter list, then increment the paramsAreaOffset respectively.\n mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))\n paramsAreaOffset := add(paramsAreaOffset, 0x20)\n\n // Write values for each field in the order\n // It would be nice to use a loop, but we save on gas by writing\n // the stores sequentially.\n mstore(dataAreaEnd, mload(sourceOffset)) // makerAddress\n mstore(add(dataAreaEnd, 0x20), mload(add(sourceOffset, 0x20))) // takerAddress\n mstore(add(dataAreaEnd, 0x40), mload(add(sourceOffset, 0x40))) // feeRecipientAddress\n mstore(add(dataAreaEnd, 0x60), mload(add(sourceOffset, 0x60))) // senderAddress\n mstore(add(dataAreaEnd, 0x80), mload(add(sourceOffset, 0x80))) // makerAssetAmount\n mstore(add(dataAreaEnd, 0xA0), mload(add(sourceOffset, 0xA0))) // takerAssetAmount\n mstore(add(dataAreaEnd, 0xC0), mload(add(sourceOffset, 0xC0))) // makerFeeAmount\n mstore(add(dataAreaEnd, 0xE0), mload(add(sourceOffset, 0xE0))) // takerFeeAmount\n mstore(add(dataAreaEnd, 0x100), mload(add(sourceOffset, 0x100))) // expirationTimeSeconds\n mstore(add(dataAreaEnd, 0x120), mload(add(sourceOffset, 0x120))) // salt\n mstore(add(dataAreaEnd, 0x140), mload(add(sourceOffset, 0x140))) // Offset to makerAssetData\n mstore(add(dataAreaEnd, 0x160), mload(add(sourceOffset, 0x160))) // Offset to takerAssetData\n dataAreaEnd := add(dataAreaEnd, 0x180)\n sourceOffset := add(sourceOffset, 0x180)\n\n // Write offset to <order.makerAssetData>\n mstore(add(dataAreaStart, mul(10, 0x20)), sub(dataAreaEnd, dataAreaStart))\n\n // Calculate length of <order.makerAssetData>\n sourceOffset := mload(add(order, 0x140)) // makerAssetData\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of <order.makerAssetData>\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of <order.makerAssetData>\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n // Write offset to <order.takerAssetData>\n mstore(add(dataAreaStart, mul(11, 0x20)), sub(dataAreaEnd, dataAreaStart))\n\n // Calculate length of <order.takerAssetData>\n sourceOffset := mload(add(order, 0x160)) // takerAssetData\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of <order.takerAssetData>\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of <order.takerAssetData>\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n /////// Write takerAssetFillAmount ///////\n mstore(paramsAreaOffset, takerAssetFillAmount)\n paramsAreaOffset := add(paramsAreaOffset, 0x20)\n\n /////// Write signature ///////\n // Write offset to paramsArea\n mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))\n\n // Calculate length of signature\n sourceOffset := signature\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of signature\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of signature\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n // Set length of calldata\n mstore(fillOrderCalldata, sub(dataAreaEnd, add(fillOrderCalldata, 0x20)))\n\n // Increment free memory pointer\n mstore(0x40, dataAreaEnd)\n }\n\n return fillOrderCalldata;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibConstants.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\n// solhint-disable max-line-length\ncontract LibConstants {\n \n // Asset data for ZRX token. Used for fee transfers.\n // @TODO: Hardcode constant when we deploy. Currently \n // not constant to make testing easier.\n\n // The proxyId for ZRX_ASSET_DATA is bytes4(keccak256(\"ERC20Token(address)\")) = 0xf47261b0\n \n // Kovan ZRX address is 0x6ff6c0ff1d68b964901f986d4c9fa3ac68346570.\n // The ABI encoded proxyId and address is 0xf47261b00000000000000000000000006ff6c0ff1d68b964901f986d4c9fa3ac68346570\n // bytes constant public ZRX_ASSET_DATA = \"\\xf4\\x72\\x61\\xb0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x6f\\xf6\\xc0\\xff\\x1d\\x68\\xb9\\x64\\x90\\x1f\\x98\\x6d\\x4c\\x9f\\xa3\\xac\\x68\\x34\\x65\\x70\";\n \n // Mainnet ZRX address is 0xe41d2489571d322189246dafa5ebde1f4699f498.\n // The ABI encoded proxyId and address is 0xf47261b0000000000000000000000000e41d2489571d322189246dafa5ebde1f4699f498\n bytes constant public ZRX_ASSET_DATA = \"\\xf4\\x72\\x61\\xb0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xe4\\x1d\\x24\\x89\\x57\\x1d\\x32\\x21\\x89\\x24\\x6d\\xaf\\xa5\\xeb\\xde\\x1f\\x46\\x99\\xf4\\x98\";\n}\n// solhint-enable max-line-length\n",
- "2.0.0/protocol/Exchange/libs/LibEIP712.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract LibEIP712 {\n\n // EIP191 header for EIP712 prefix\n string constant internal EIP191_HEADER = \"\\x19\\x01\";\n\n // EIP712 Domain Name value\n string constant internal EIP712_DOMAIN_NAME = \"0x Protocol\";\n\n // EIP712 Domain Version value\n string constant internal EIP712_DOMAIN_VERSION = \"2\";\n\n // Hash of the EIP712 Domain Separator Schema\n bytes32 constant internal EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"EIP712Domain(\",\n \"string name,\",\n \"string version,\",\n \"address verifyingContract\",\n \")\"\n ));\n\n // Hash of the EIP712 Domain Separator data\n // solhint-disable-next-line var-name-mixedcase\n bytes32 public EIP712_DOMAIN_HASH;\n\n constructor ()\n public\n {\n EIP712_DOMAIN_HASH = keccak256(abi.encodePacked(\n EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH,\n keccak256(bytes(EIP712_DOMAIN_NAME)),\n keccak256(bytes(EIP712_DOMAIN_VERSION)),\n bytes32(address(this))\n ));\n }\n\n /// @dev Calculates EIP712 encoding for a hash struct in this EIP712 Domain.\n /// @param hashStruct The EIP712 hash struct.\n /// @return EIP712 hash applied to this EIP712 Domain.\n function hashEIP712Message(bytes32 hashStruct)\n internal\n view\n returns (bytes32 result)\n {\n bytes32 eip712DomainHash = EIP712_DOMAIN_HASH;\n\n // Assembly for more efficient computing:\n // keccak256(abi.encodePacked(\n // EIP191_HEADER,\n // EIP712_DOMAIN_HASH,\n // hashStruct \n // ));\n\n assembly {\n // Load free memory pointer\n let memPtr := mload(64)\n\n mstore(memPtr, 0x1901000000000000000000000000000000000000000000000000000000000000) // EIP191 header\n mstore(add(memPtr, 2), eip712DomainHash) // EIP712 domain hash\n mstore(add(memPtr, 34), hashStruct) // Hash of struct\n\n // Compute hash\n result := keccak256(memPtr, 66)\n }\n return result;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\n// solhint-disable\npragma solidity 0.4.24;\n\n\n/// @dev This contract documents the revert reasons used in the Exchange contract.\n/// This contract is intended to serve as a reference, but is not actually used for efficiency reasons.\ncontract LibExchangeErrors {\n\n /// Order validation errors ///\n string constant ORDER_UNFILLABLE = \"ORDER_UNFILLABLE\"; // Order cannot be filled.\n string constant INVALID_MAKER = \"INVALID_MAKER\"; // Invalid makerAddress.\n string constant INVALID_TAKER = \"INVALID_TAKER\"; // Invalid takerAddress.\n string constant INVALID_SENDER = \"INVALID_SENDER\"; // Invalid `msg.sender`.\n string constant INVALID_ORDER_SIGNATURE = \"INVALID_ORDER_SIGNATURE\"; // Signature validation failed. \n \n /// fillOrder validation errors ///\n string constant INVALID_TAKER_AMOUNT = \"INVALID_TAKER_AMOUNT\"; // takerAssetFillAmount cannot equal 0.\n string constant ROUNDING_ERROR = \"ROUNDING_ERROR\"; // Rounding error greater than 0.1% of takerAssetFillAmount. \n \n /// Signature validation errors ///\n string constant INVALID_SIGNATURE = \"INVALID_SIGNATURE\"; // Signature validation failed. \n string constant SIGNATURE_ILLEGAL = \"SIGNATURE_ILLEGAL\"; // Signature type is illegal.\n string constant SIGNATURE_UNSUPPORTED = \"SIGNATURE_UNSUPPORTED\"; // Signature type unsupported.\n \n /// cancelOrdersUptTo errors ///\n string constant INVALID_NEW_ORDER_EPOCH = \"INVALID_NEW_ORDER_EPOCH\"; // Specified salt must be greater than or equal to existing orderEpoch.\n\n /// fillOrKillOrder errors ///\n string constant COMPLETE_FILL_FAILED = \"COMPLETE_FILL_FAILED\"; // Desired takerAssetFillAmount could not be completely filled. \n\n /// matchOrders errors ///\n string constant NEGATIVE_SPREAD_REQUIRED = \"NEGATIVE_SPREAD_REQUIRED\"; // Matched orders must have a negative spread.\n\n /// Transaction errors ///\n string constant REENTRANCY_ILLEGAL = \"REENTRANCY_ILLEGAL\"; // Recursive reentrancy is not allowed. \n string constant INVALID_TX_HASH = \"INVALID_TX_HASH\"; // Transaction has already been executed. \n string constant INVALID_TX_SIGNATURE = \"INVALID_TX_SIGNATURE\"; // Signature validation failed. \n string constant FAILED_EXECUTION = \"FAILED_EXECUTION\"; // Transaction execution failed. \n \n /// registerAssetProxy errors ///\n string constant ASSET_PROXY_ALREADY_EXISTS = \"ASSET_PROXY_ALREADY_EXISTS\"; // AssetProxy with same id already exists.\n\n /// dispatchTransferFrom errors ///\n string constant ASSET_PROXY_DOES_NOT_EXIST = \"ASSET_PROXY_DOES_NOT_EXIST\"; // No assetProxy registered at given id.\n string constant TRANSFER_FAILED = \"TRANSFER_FAILED\"; // Asset transfer unsuccesful.\n\n /// Length validation errors ///\n string constant LENGTH_GREATER_THAN_0_REQUIRED = \"LENGTH_GREATER_THAN_0_REQUIRED\"; // Byte array must have a length greater than 0.\n string constant LENGTH_GREATER_THAN_3_REQUIRED = \"LENGTH_GREATER_THAN_3_REQUIRED\"; // Byte array must have a length greater than 3.\n string constant LENGTH_0_REQUIRED = \"LENGTH_0_REQUIRED\"; // Byte array must have a length of 0.\n string constant LENGTH_65_REQUIRED = \"LENGTH_65_REQUIRED\"; // Byte array must have a length of 65.\n}\n",
- "2.0.0/protocol/Exchange/libs/LibFillResults.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract LibFillResults is\n SafeMath\n{\n struct FillResults {\n uint256 makerAssetFilledAmount; // Total amount of makerAsset(s) filled.\n uint256 takerAssetFilledAmount; // Total amount of takerAsset(s) filled.\n uint256 makerFeePaid; // Total amount of ZRX paid by maker(s) to feeRecipient(s).\n uint256 takerFeePaid; // Total amount of ZRX paid by taker to feeRecipients(s).\n }\n\n struct MatchedFillResults {\n FillResults left; // Amounts filled and fees paid of left order.\n FillResults right; // Amounts filled and fees paid of right order.\n uint256 leftMakerAssetSpreadAmount; // Spread between price of left and right order, denominated in the left order's makerAsset, paid to taker.\n }\n\n /// @dev Adds properties of both FillResults instances.\n /// Modifies the first FillResults instance specified.\n /// @param totalFillResults Fill results instance that will be added onto.\n /// @param singleFillResults Fill results instance that will be added to totalFillResults.\n function addFillResults(FillResults memory totalFillResults, FillResults memory singleFillResults)\n internal\n pure\n {\n totalFillResults.makerAssetFilledAmount = safeAdd(totalFillResults.makerAssetFilledAmount, singleFillResults.makerAssetFilledAmount);\n totalFillResults.takerAssetFilledAmount = safeAdd(totalFillResults.takerAssetFilledAmount, singleFillResults.takerAssetFilledAmount);\n totalFillResults.makerFeePaid = safeAdd(totalFillResults.makerFeePaid, singleFillResults.makerFeePaid);\n totalFillResults.takerFeePaid = safeAdd(totalFillResults.takerFeePaid, singleFillResults.takerFeePaid);\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibMath.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract LibMath is\n SafeMath\n{\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// Reverts if rounding error is >= 0.1%\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded down.\n function safeGetPartialAmountFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n require(\n !isRoundingErrorFloor(\n numerator,\n denominator,\n target\n ),\n \"ROUNDING_ERROR\"\n );\n \n partialAmount = safeDiv(\n safeMul(numerator, target),\n denominator\n );\n return partialAmount;\n }\n\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// Reverts if rounding error is >= 0.1%\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded up.\n function safeGetPartialAmountCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n require(\n !isRoundingErrorCeil(\n numerator,\n denominator,\n target\n ),\n \"ROUNDING_ERROR\"\n );\n \n // safeDiv computes `floor(a / b)`. We use the identity (a, b integer):\n // ceil(a / b) = floor((a + b - 1) / b)\n // To implement `ceil(a / b)` using safeDiv.\n partialAmount = safeDiv(\n safeAdd(\n safeMul(numerator, target),\n safeSub(denominator, 1)\n ),\n denominator\n );\n return partialAmount;\n }\n\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded down.\n function getPartialAmountFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n partialAmount = safeDiv(\n safeMul(numerator, target),\n denominator\n );\n return partialAmount;\n }\n \n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded up.\n function getPartialAmountCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n // safeDiv computes `floor(a / b)`. We use the identity (a, b integer):\n // ceil(a / b) = floor((a + b - 1) / b)\n // To implement `ceil(a / b)` using safeDiv.\n partialAmount = safeDiv(\n safeAdd(\n safeMul(numerator, target),\n safeSub(denominator, 1)\n ),\n denominator\n );\n return partialAmount;\n }\n \n /// @dev Checks if rounding error >= 0.1% when rounding down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to multiply with numerator/denominator.\n /// @return Rounding error is present.\n function isRoundingErrorFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (bool isError)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n \n // The absolute rounding error is the difference between the rounded\n // value and the ideal value. The relative rounding error is the\n // absolute rounding error divided by the absolute value of the\n // ideal value. This is undefined when the ideal value is zero.\n //\n // The ideal value is `numerator * target / denominator`.\n // Let's call `numerator * target % denominator` the remainder.\n // The absolute error is `remainder / denominator`.\n //\n // When the ideal value is zero, we require the absolute error to\n // be zero. Fortunately, this is always the case. The ideal value is\n // zero iff `numerator == 0` and/or `target == 0`. In this case the\n // remainder and absolute error are also zero. \n if (target == 0 || numerator == 0) {\n return false;\n }\n \n // Otherwise, we want the relative rounding error to be strictly\n // less than 0.1%.\n // The relative error is `remainder / (numerator * target)`.\n // We want the relative error less than 1 / 1000:\n // remainder / (numerator * denominator) < 1 / 1000\n // or equivalently:\n // 1000 * remainder < numerator * target\n // so we have a rounding error iff:\n // 1000 * remainder >= numerator * target\n uint256 remainder = mulmod(\n target,\n numerator,\n denominator\n );\n isError = safeMul(1000, remainder) >= safeMul(numerator, target);\n return isError;\n }\n \n /// @dev Checks if rounding error >= 0.1% when rounding up.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to multiply with numerator/denominator.\n /// @return Rounding error is present.\n function isRoundingErrorCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (bool isError)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n \n // See the comments in `isRoundingError`.\n if (target == 0 || numerator == 0) {\n // When either is zero, the ideal value and rounded value are zero\n // and there is no rounding error. (Although the relative error\n // is undefined.)\n return false;\n }\n // Compute remainder as before\n uint256 remainder = mulmod(\n target,\n numerator,\n denominator\n );\n remainder = safeSub(denominator, remainder) % denominator;\n isError = safeMul(1000, remainder) >= safeMul(numerator, target);\n return isError;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibOrder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./LibEIP712.sol\";\n\n\ncontract LibOrder is\n LibEIP712\n{\n // Hash for the EIP712 Order Schema\n bytes32 constant internal EIP712_ORDER_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"Order(\",\n \"address makerAddress,\",\n \"address takerAddress,\",\n \"address feeRecipientAddress,\",\n \"address senderAddress,\",\n \"uint256 makerAssetAmount,\",\n \"uint256 takerAssetAmount,\",\n \"uint256 makerFee,\",\n \"uint256 takerFee,\",\n \"uint256 expirationTimeSeconds,\",\n \"uint256 salt,\",\n \"bytes makerAssetData,\",\n \"bytes takerAssetData\",\n \")\"\n ));\n\n // A valid order remains fillable until it is expired, fully filled, or cancelled.\n // An order's state is unaffected by external factors, like account balances.\n enum OrderStatus {\n INVALID, // Default value\n INVALID_MAKER_ASSET_AMOUNT, // Order does not have a valid maker asset amount\n INVALID_TAKER_ASSET_AMOUNT, // Order does not have a valid taker asset amount\n FILLABLE, // Order is fillable\n EXPIRED, // Order has already expired\n FULLY_FILLED, // Order is fully filled\n CANCELLED // Order has been cancelled\n }\n\n // solhint-disable max-line-length\n struct Order {\n address makerAddress; // Address that created the order. \n address takerAddress; // Address that is allowed to fill the order. If set to 0, any address is allowed to fill the order. \n address feeRecipientAddress; // Address that will recieve fees when order is filled. \n address senderAddress; // Address that is allowed to call Exchange contract methods that affect this order. If set to 0, any address is allowed to call these methods.\n uint256 makerAssetAmount; // Amount of makerAsset being offered by maker. Must be greater than 0. \n uint256 takerAssetAmount; // Amount of takerAsset being bid on by maker. Must be greater than 0. \n uint256 makerFee; // Amount of ZRX paid to feeRecipient by maker when order is filled. If set to 0, no transfer of ZRX from maker to feeRecipient will be attempted.\n uint256 takerFee; // Amount of ZRX paid to feeRecipient by taker when order is filled. If set to 0, no transfer of ZRX from taker to feeRecipient will be attempted.\n uint256 expirationTimeSeconds; // Timestamp in seconds at which order expires. \n uint256 salt; // Arbitrary number to facilitate uniqueness of the order's hash. \n bytes makerAssetData; // Encoded data that can be decoded by a specified proxy contract when transferring makerAsset. The last byte references the id of this proxy.\n bytes takerAssetData; // Encoded data that can be decoded by a specified proxy contract when transferring takerAsset. The last byte references the id of this proxy.\n }\n // solhint-enable max-line-length\n\n struct OrderInfo {\n uint8 orderStatus; // Status that describes order's validity and fillability.\n bytes32 orderHash; // EIP712 hash of the order (see LibOrder.getOrderHash).\n uint256 orderTakerAssetFilledAmount; // Amount of order that has already been filled.\n }\n\n /// @dev Calculates Keccak-256 hash of the order.\n /// @param order The order structure.\n /// @return Keccak-256 EIP712 hash of the order.\n function getOrderHash(Order memory order)\n internal\n view\n returns (bytes32 orderHash)\n {\n orderHash = hashEIP712Message(hashOrder(order));\n return orderHash;\n }\n\n /// @dev Calculates EIP712 hash of the order.\n /// @param order The order structure.\n /// @return EIP712 hash of the order.\n function hashOrder(Order memory order)\n internal\n pure\n returns (bytes32 result)\n {\n bytes32 schemaHash = EIP712_ORDER_SCHEMA_HASH;\n bytes32 makerAssetDataHash = keccak256(order.makerAssetData);\n bytes32 takerAssetDataHash = keccak256(order.takerAssetData);\n\n // Assembly for more efficiently computing:\n // keccak256(abi.encodePacked(\n // EIP712_ORDER_SCHEMA_HASH,\n // bytes32(order.makerAddress),\n // bytes32(order.takerAddress),\n // bytes32(order.feeRecipientAddress),\n // bytes32(order.senderAddress),\n // order.makerAssetAmount,\n // order.takerAssetAmount,\n // order.makerFee,\n // order.takerFee,\n // order.expirationTimeSeconds,\n // order.salt,\n // keccak256(order.makerAssetData),\n // keccak256(order.takerAssetData)\n // ));\n\n assembly {\n // Calculate memory addresses that will be swapped out before hashing\n let pos1 := sub(order, 32)\n let pos2 := add(order, 320)\n let pos3 := add(order, 352)\n\n // Backup\n let temp1 := mload(pos1)\n let temp2 := mload(pos2)\n let temp3 := mload(pos3)\n \n // Hash in place\n mstore(pos1, schemaHash)\n mstore(pos2, makerAssetDataHash)\n mstore(pos3, takerAssetDataHash)\n result := keccak256(pos1, 416)\n \n // Restore\n mstore(pos1, temp1)\n mstore(pos2, temp2)\n mstore(pos3, temp3)\n }\n return result;\n }\n}\n",
- "2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAssetProxyDispatcher.sol\";\n\n\ncontract MAssetProxyDispatcher is\n IAssetProxyDispatcher\n{\n // Logs registration of new asset proxy\n event AssetProxyRegistered(\n bytes4 id, // Id of new registered AssetProxy.\n address assetProxy // Address of new registered AssetProxy.\n );\n\n /// @dev Forwards arguments to assetProxy and calls `transferFrom`. Either succeeds or throws.\n /// @param assetData Byte array encoded for the asset.\n /// @param from Address to transfer token from.\n /// @param to Address to transfer token to.\n /// @param amount Amount of token to transfer.\n function dispatchTransferFrom(\n bytes memory assetData,\n address from,\n address to,\n uint256 amount\n )\n internal;\n}\n",
- "2.0.0/protocol/Exchange/mixins/MExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IExchangeCore.sol\";\n\n\ncontract MExchangeCore is\n IExchangeCore\n{\n // Fill event is emitted whenever an order is filled.\n event Fill(\n address indexed makerAddress, // Address that created the order. \n address indexed feeRecipientAddress, // Address that received fees.\n address takerAddress, // Address that filled the order.\n address senderAddress, // Address that called the Exchange contract (msg.sender).\n uint256 makerAssetFilledAmount, // Amount of makerAsset sold by maker and bought by taker. \n uint256 takerAssetFilledAmount, // Amount of takerAsset sold by taker and bought by maker.\n uint256 makerFeePaid, // Amount of ZRX paid to feeRecipient by maker.\n uint256 takerFeePaid, // Amount of ZRX paid to feeRecipient by taker.\n bytes32 indexed orderHash, // EIP712 hash of order (see LibOrder.getOrderHash).\n bytes makerAssetData, // Encoded data specific to makerAsset. \n bytes takerAssetData // Encoded data specific to takerAsset.\n );\n\n // Cancel event is emitted whenever an individual order is cancelled.\n event Cancel(\n address indexed makerAddress, // Address that created the order. \n address indexed feeRecipientAddress, // Address that would have recieved fees if order was filled. \n address senderAddress, // Address that called the Exchange contract (msg.sender).\n bytes32 indexed orderHash, // EIP712 hash of order (see LibOrder.getOrderHash).\n bytes makerAssetData, // Encoded data specific to makerAsset. \n bytes takerAssetData // Encoded data specific to takerAsset.\n );\n\n // CancelUpTo event is emitted whenever `cancelOrdersUpTo` is executed succesfully.\n event CancelUpTo(\n address indexed makerAddress, // Orders cancelled must have been created by this address.\n address indexed senderAddress, // Orders cancelled must have a `senderAddress` equal to this address.\n uint256 orderEpoch // Orders with specified makerAddress and senderAddress with a salt less than this value are considered cancelled.\n );\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev After calling, the order can not be filled anymore.\n /// @param order Order struct containing order specifications.\n function cancelOrderInternal(LibOrder.Order memory order)\n internal;\n\n /// @dev Updates state with results of a fill order.\n /// @param order that was filled.\n /// @param takerAddress Address of taker who filled the order.\n /// @param orderTakerAssetFilledAmount Amount of order already filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function updateFilledState(\n LibOrder.Order memory order,\n address takerAddress,\n bytes32 orderHash,\n uint256 orderTakerAssetFilledAmount,\n LibFillResults.FillResults memory fillResults\n )\n internal;\n\n /// @dev Updates state with results of cancelling an order.\n /// State is only updated if the order is currently fillable.\n /// Otherwise, updating state would have no effect.\n /// @param order that was cancelled.\n /// @param orderHash Hash of order that was cancelled.\n function updateCancelledState(\n LibOrder.Order memory order,\n bytes32 orderHash\n )\n internal;\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAddress Address of order taker.\n /// @param signature Proof that the orders was created by its maker.\n function assertFillableOrder(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo,\n address takerAddress,\n bytes memory signature\n )\n internal\n view;\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo Status, orderHash, and amount already filled of order.\n /// @param takerAssetFillAmount Desired amount of order to fill by taker.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @param makerAssetFilledAmount Amount of makerAsset that will be transfered.\n function assertValidFill(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo,\n uint256 takerAssetFillAmount,\n uint256 takerAssetFilledAmount,\n uint256 makerAssetFilledAmount\n )\n internal\n view;\n\n /// @dev Validates context for cancelOrder. Succeeds or throws.\n /// @param order to be cancelled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n function assertValidCancel(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo\n )\n internal\n view;\n\n /// @dev Calculates amounts filled and fees paid by maker and taker.\n /// @param order to be filled.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function calculateFillResults(\n LibOrder.Order memory order,\n uint256 takerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.FillResults memory fillResults);\n\n}\n",
- "2.0.0/protocol/Exchange/mixins/MMatchOrders.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IMatchOrders.sol\";\n\n\ncontract MMatchOrders is\n IMatchOrders\n{\n /// @dev Validates context for matchOrders. Succeeds or throws.\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n function assertValidMatch(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder\n )\n internal\n pure;\n\n /// @dev Calculates fill amounts for the matched orders.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the leftOrder order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftOrderTakerAssetFilledAmount Amount of left order already filled.\n /// @param rightOrderTakerAssetFilledAmount Amount of right order already filled.\n /// @param matchedFillResults Amounts to fill and fees to pay by maker and taker of matched orders.\n function calculateMatchedFillResults(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n uint256 leftOrderTakerAssetFilledAmount,\n uint256 rightOrderTakerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.MatchedFillResults memory matchedFillResults);\n\n}\n",
- "2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/ISignatureValidator.sol\";\n\n\ncontract MSignatureValidator is\n ISignatureValidator\n{\n event SignatureValidatorApproval(\n address indexed signerAddress, // Address that approves or disapproves a contract to verify signatures.\n address indexed validatorAddress, // Address of signature validator contract.\n bool approved // Approval or disapproval of validator contract.\n );\n\n // Allowed signature types.\n enum SignatureType {\n Illegal, // 0x00, default value\n Invalid, // 0x01\n EIP712, // 0x02\n EthSign, // 0x03\n Wallet, // 0x04\n Validator, // 0x05\n PreSigned, // 0x06\n NSignatureTypes // 0x07, number of signature types. Always leave at end.\n }\n\n /// @dev Verifies signature using logic defined by Wallet contract.\n /// @param hash Any 32 byte hash.\n /// @param walletAddress Address that should have signed the given hash\n /// and defines its own signature verification method.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidWalletSignature(\n bytes32 hash,\n address walletAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid);\n\n /// @dev Verifies signature using logic defined by Validator contract.\n /// @param validatorAddress Address of validator contract.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidValidatorSignature(\n address validatorAddress,\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/mixins/MTransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\nimport \"../interfaces/ITransactions.sol\";\n\n\ncontract MTransactions is\n ITransactions\n{\n // Hash for the EIP712 ZeroEx Transaction Schema\n bytes32 constant internal EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"ZeroExTransaction(\",\n \"uint256 salt,\",\n \"address signerAddress,\",\n \"bytes data\",\n \")\"\n ));\n\n /// @dev Calculates EIP712 hash of the Transaction.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @return EIP712 hash of the Transaction.\n function hashZeroExTransaction(\n uint256 salt,\n address signerAddress,\n bytes memory data\n )\n internal\n pure\n returns (bytes32 result);\n\n /// @dev The current function will be called in the context of this address (either 0x transaction signer or `msg.sender`).\n /// If calling a fill function, this address will represent the taker.\n /// If calling a cancel function, this address will represent the maker.\n /// @return Signer of 0x transaction if entry point is `executeTransaction`.\n /// `msg.sender` if entry point is any other function.\n function getCurrentContextAddress()\n internal\n view\n returns (address);\n}\n",
- "2.0.0/protocol/Exchange/mixins/MWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IWrapperFunctions.sol\";\n\n\ncontract MWrapperFunctions is \n IWrapperFunctions\n{\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n}\n",
- "2.0.0/tokens/ERC20Token/IERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC20Token {\n\n // solhint-disable no-simple-event-func-name\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 _value\n );\n\n event Approval(\n address indexed _owner,\n address indexed _spender,\n uint256 _value\n );\n\n /// @dev send `value` token to `to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transfer(address _to, uint256 _value)\n external\n returns (bool);\n\n /// @dev send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool);\n \n /// @dev `msg.sender` approves `_spender` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Always true if the call has enough gas to complete execution\n function approve(address _spender, uint256 _value)\n external\n returns (bool);\n\n /// @dev Query total supply of token\n /// @return Total supply of token\n function totalSupply()\n external\n view\n returns (uint256);\n \n /// @param _owner The address from which the balance will be retrieved\n /// @return Balance of owner\n function balanceOf(address _owner)\n external\n view\n returns (uint256);\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender)\n external\n view\n returns (uint256);\n}\n",
- "2.0.0/tokens/ERC721Token/IERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC721Token {\n\n /// @dev This emits when ownership of any NFT changes by any mechanism.\n /// This event emits when NFTs are created (`from` == 0) and destroyed\n /// (`to` == 0). Exception: during contract creation, any number of NFTs\n /// may be created and assigned without emitting Transfer. At the time of\n /// any transfer, the approved address for that NFT (if any) is reset to none.\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 indexed _tokenId\n );\n\n /// @dev This emits when the approved address for an NFT is changed or\n /// reaffirmed. The zero address indicates there is no approved address.\n /// When a Transfer event emits, this also indicates that the approved\n /// address for that NFT (if any) is reset to none.\n event Approval(\n address indexed _owner,\n address indexed _approved,\n uint256 indexed _tokenId\n );\n\n /// @dev This emits when an operator is enabled or disabled for an owner.\n /// The operator can manage all NFTs of the owner.\n event ApprovalForAll(\n address indexed _owner,\n address indexed _operator,\n bool _approved\n );\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// perator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT. When transfer is complete, this function\n /// checks if `_to` is a smart contract (code size > 0). If so, it calls\n /// `onERC721Received` on `_to` and throws if the return value is not\n /// `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n /// @param _data Additional data with no specified format, sent in call to `_to`\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId,\n bytes _data\n )\n external;\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev This works identically to the other function with an extra data parameter,\n /// except this function just sets data to \"\".\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n external;\n\n /// @notice Change or reaffirm the approved address for an NFT\n /// @dev The zero address indicates there is no approved address.\n /// Throws unless `msg.sender` is the current NFT owner, or an authorized\n /// operator of the current owner.\n /// @param _approved The new approved NFT controller\n /// @param _tokenId The NFT to approve\n function approve(address _approved, uint256 _tokenId)\n external;\n\n /// @notice Enable or disable approval for a third party (\"operator\") to manage\n /// all of `msg.sender`'s assets\n /// @dev Emits the ApprovalForAll event. The contract MUST allow\n /// multiple operators per owner.\n /// @param _operator Address to add to the set of authorized operators\n /// @param _approved True if the operator is approved, false to revoke approval\n function setApprovalForAll(address _operator, bool _approved)\n external;\n\n /// @notice Count all NFTs assigned to an owner\n /// @dev NFTs assigned to the zero address are considered invalid, and this\n /// function throws for queries about the zero address.\n /// @param _owner An address for whom to query the balance\n /// @return The number of NFTs owned by `_owner`, possibly zero\n function balanceOf(address _owner)\n external\n view\n returns (uint256);\n\n /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE\n /// TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE\n /// THEY MAY BE PERMANENTLY LOST\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function transferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n public;\n\n /// @notice Find the owner of an NFT\n /// @dev NFTs assigned to zero address are considered invalid, and queries\n /// about them do throw.\n /// @param _tokenId The identifier for an NFT\n /// @return The address of the owner of the NFT\n function ownerOf(uint256 _tokenId)\n public\n view\n returns (address);\n\n /// @notice Get the approved address for a single NFT\n /// @dev Throws if `_tokenId` is not a valid NFT.\n /// @param _tokenId The NFT to find the approved address for\n /// @return The approved address for this NFT, or the zero address if there is none\n function getApproved(uint256 _tokenId) \n public\n view\n returns (address);\n \n /// @notice Query if an address is an authorized operator for another address\n /// @param _owner The address that owns the NFTs\n /// @param _operator The address that acts on behalf of the owner\n /// @return True if `_operator` is an approved operator for `_owner`, false otherwise\n function isApprovedForAll(address _owner, address _operator)\n public\n view\n returns (bool);\n}\n",
- "2.0.0/tokens/EtherToken/IEtherToken.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../ERC20Token/IERC20Token.sol\";\n\n\ncontract IEtherToken is\n IERC20Token\n{\n function deposit()\n public\n payable;\n \n function withdraw(uint256 amount)\n public;\n}\n",
- "2.0.0/utils/LibBytes/LibBytes.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\nlibrary LibBytes {\n\n using LibBytes for bytes;\n\n /// @dev Gets the memory address for a byte array.\n /// @param input Byte array to lookup.\n /// @return memoryAddress Memory address of byte array. This\n /// points to the header of the byte array which contains\n /// the length.\n function rawAddress(bytes memory input)\n internal\n pure\n returns (uint256 memoryAddress)\n {\n assembly {\n memoryAddress := input\n }\n return memoryAddress;\n }\n \n /// @dev Gets the memory address for the contents of a byte array.\n /// @param input Byte array to lookup.\n /// @return memoryAddress Memory address of the contents of the byte array.\n function contentAddress(bytes memory input)\n internal\n pure\n returns (uint256 memoryAddress)\n {\n assembly {\n memoryAddress := add(input, 32)\n }\n return memoryAddress;\n }\n\n /// @dev Copies `length` bytes from memory location `source` to `dest`.\n /// @param dest memory address to copy bytes to.\n /// @param source memory address to copy bytes from.\n /// @param length number of bytes to copy.\n function memCopy(\n uint256 dest,\n uint256 source,\n uint256 length\n )\n internal\n pure\n {\n if (length < 32) {\n // Handle a partial word by reading destination and masking\n // off the bits we are interested in.\n // This correctly handles overlap, zero lengths and source == dest\n assembly {\n let mask := sub(exp(256, sub(32, length)), 1)\n let s := and(mload(source), not(mask))\n let d := and(mload(dest), mask)\n mstore(dest, or(s, d))\n }\n } else {\n // Skip the O(length) loop when source == dest.\n if (source == dest) {\n return;\n }\n\n // For large copies we copy whole words at a time. The final\n // word is aligned to the end of the range (instead of after the\n // previous) to handle partial words. So a copy will look like this:\n //\n // ####\n // ####\n // ####\n // ####\n //\n // We handle overlap in the source and destination range by\n // changing the copying direction. This prevents us from\n // overwriting parts of source that we still need to copy.\n //\n // This correctly handles source == dest\n //\n if (source > dest) {\n assembly {\n // We subtract 32 from `sEnd` and `dEnd` because it\n // is easier to compare with in the loop, and these\n // are also the addresses we need for copying the\n // last bytes.\n length := sub(length, 32)\n let sEnd := add(source, length)\n let dEnd := add(dest, length)\n\n // Remember the last 32 bytes of source\n // This needs to be done here and not after the loop\n // because we may have overwritten the last bytes in\n // source already due to overlap.\n let last := mload(sEnd)\n\n // Copy whole words front to back\n // Note: the first check is always true,\n // this could have been a do-while loop.\n // solhint-disable-next-line no-empty-blocks\n for {} lt(source, sEnd) {} {\n mstore(dest, mload(source))\n source := add(source, 32)\n dest := add(dest, 32)\n }\n \n // Write the last 32 bytes\n mstore(dEnd, last)\n }\n } else {\n assembly {\n // We subtract 32 from `sEnd` and `dEnd` because those\n // are the starting points when copying a word at the end.\n length := sub(length, 32)\n let sEnd := add(source, length)\n let dEnd := add(dest, length)\n\n // Remember the first 32 bytes of source\n // This needs to be done here and not after the loop\n // because we may have overwritten the first bytes in\n // source already due to overlap.\n let first := mload(source)\n\n // Copy whole words back to front\n // We use a signed comparisson here to allow dEnd to become\n // negative (happens when source and dest < 32). Valid\n // addresses in local memory will never be larger than\n // 2**255, so they can be safely re-interpreted as signed.\n // Note: the first check is always true,\n // this could have been a do-while loop.\n // solhint-disable-next-line no-empty-blocks\n for {} slt(dest, dEnd) {} {\n mstore(dEnd, mload(sEnd))\n sEnd := sub(sEnd, 32)\n dEnd := sub(dEnd, 32)\n }\n \n // Write the first 32 bytes\n mstore(dest, first)\n }\n }\n }\n }\n\n /// @dev Returns a slices from a byte array.\n /// @param b The byte array to take a slice from.\n /// @param from The starting index for the slice (inclusive).\n /// @param to The final index for the slice (exclusive).\n /// @return result The slice containing bytes at indices [from, to)\n function slice(\n bytes memory b,\n uint256 from,\n uint256 to\n )\n internal\n pure\n returns (bytes memory result)\n {\n require(\n from <= to,\n \"FROM_LESS_THAN_TO_REQUIRED\"\n );\n require(\n to < b.length,\n \"TO_LESS_THAN_LENGTH_REQUIRED\"\n );\n \n // Create a new bytes structure and copy contents\n result = new bytes(to - from);\n memCopy(\n result.contentAddress(),\n b.contentAddress() + from,\n result.length\n );\n return result;\n }\n \n /// @dev Returns a slice from a byte array without preserving the input.\n /// @param b The byte array to take a slice from. Will be destroyed in the process.\n /// @param from The starting index for the slice (inclusive).\n /// @param to The final index for the slice (exclusive).\n /// @return result The slice containing bytes at indices [from, to)\n /// @dev When `from == 0`, the original array will match the slice. In other cases its state will be corrupted.\n function sliceDestructive(\n bytes memory b,\n uint256 from,\n uint256 to\n )\n internal\n pure\n returns (bytes memory result)\n {\n require(\n from <= to,\n \"FROM_LESS_THAN_TO_REQUIRED\"\n );\n require(\n to < b.length,\n \"TO_LESS_THAN_LENGTH_REQUIRED\"\n );\n \n // Create a new bytes structure around [from, to) in-place.\n assembly {\n result := add(b, from)\n mstore(result, sub(to, from))\n }\n return result;\n }\n\n /// @dev Pops the last byte off of a byte array by modifying its length.\n /// @param b Byte array that will be modified.\n /// @return The byte that was popped off.\n function popLastByte(bytes memory b)\n internal\n pure\n returns (bytes1 result)\n {\n require(\n b.length > 0,\n \"GREATER_THAN_ZERO_LENGTH_REQUIRED\"\n );\n\n // Store last byte.\n result = b[b.length - 1];\n\n assembly {\n // Decrement length of byte array.\n let newLen := sub(mload(b), 1)\n mstore(b, newLen)\n }\n return result;\n }\n\n /// @dev Pops the last 20 bytes off of a byte array by modifying its length.\n /// @param b Byte array that will be modified.\n /// @return The 20 byte address that was popped off.\n function popLast20Bytes(bytes memory b)\n internal\n pure\n returns (address result)\n {\n require(\n b.length >= 20,\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Store last 20 bytes.\n result = readAddress(b, b.length - 20);\n\n assembly {\n // Subtract 20 from byte array length.\n let newLen := sub(mload(b), 20)\n mstore(b, newLen)\n }\n return result;\n }\n\n /// @dev Tests equality of two byte arrays.\n /// @param lhs First byte array to compare.\n /// @param rhs Second byte array to compare.\n /// @return True if arrays are the same. False otherwise.\n function equals(\n bytes memory lhs,\n bytes memory rhs\n )\n internal\n pure\n returns (bool equal)\n {\n // Keccak gas cost is 30 + numWords * 6. This is a cheap way to compare.\n // We early exit on unequal lengths, but keccak would also correctly\n // handle this.\n return lhs.length == rhs.length && keccak256(lhs) == keccak256(rhs);\n }\n\n /// @dev Reads an address from a position in a byte array.\n /// @param b Byte array containing an address.\n /// @param index Index in byte array of address.\n /// @return address from byte array.\n function readAddress(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (address result)\n {\n require(\n b.length >= index + 20, // 20 is length of address\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Add offset to index:\n // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)\n // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)\n index += 20;\n\n // Read address from array memory\n assembly {\n // 1. Add index to address of bytes array\n // 2. Load 32-byte word from memory\n // 3. Apply 20-byte mask to obtain address\n result := and(mload(add(b, index)), 0xffffffffffffffffffffffffffffffffffffffff)\n }\n return result;\n }\n\n /// @dev Writes an address into a specific position in a byte array.\n /// @param b Byte array to insert address into.\n /// @param index Index in byte array of address.\n /// @param input Address to put into byte array.\n function writeAddress(\n bytes memory b,\n uint256 index,\n address input\n )\n internal\n pure\n {\n require(\n b.length >= index + 20, // 20 is length of address\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Add offset to index:\n // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)\n // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)\n index += 20;\n\n // Store address into array memory\n assembly {\n // The address occupies 20 bytes and mstore stores 32 bytes.\n // First fetch the 32-byte word where we'll be storing the address, then\n // apply a mask so we have only the bytes in the word that the address will not occupy.\n // Then combine these bytes with the address and store the 32 bytes back to memory with mstore.\n\n // 1. Add index to address of bytes array\n // 2. Load 32-byte word from memory\n // 3. Apply 12-byte mask to obtain extra bytes occupying word of memory where we'll store the address\n let neighbors := and(\n mload(add(b, index)),\n 0xffffffffffffffffffffffff0000000000000000000000000000000000000000\n )\n \n // Make sure input address is clean.\n // (Solidity does not guarantee this)\n input := and(input, 0xffffffffffffffffffffffffffffffffffffffff)\n\n // Store the neighbors and address into memory\n mstore(add(b, index), xor(input, neighbors))\n }\n }\n\n /// @dev Reads a bytes32 value from a position in a byte array.\n /// @param b Byte array containing a bytes32 value.\n /// @param index Index in byte array of bytes32 value.\n /// @return bytes32 value from byte array.\n function readBytes32(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes32 result)\n {\n require(\n b.length >= index + 32,\n \"GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 256 bit length parameter\n index += 32;\n\n // Read the bytes32 from array memory\n assembly {\n result := mload(add(b, index))\n }\n return result;\n }\n\n /// @dev Writes a bytes32 into a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input bytes32 to put into byte array.\n function writeBytes32(\n bytes memory b,\n uint256 index,\n bytes32 input\n )\n internal\n pure\n {\n require(\n b.length >= index + 32,\n \"GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 256 bit length parameter\n index += 32;\n\n // Read the bytes32 from array memory\n assembly {\n mstore(add(b, index), input)\n }\n }\n\n /// @dev Reads a uint256 value from a position in a byte array.\n /// @param b Byte array containing a uint256 value.\n /// @param index Index in byte array of uint256 value.\n /// @return uint256 value from byte array.\n function readUint256(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (uint256 result)\n {\n result = uint256(readBytes32(b, index));\n return result;\n }\n\n /// @dev Writes a uint256 into a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input uint256 to put into byte array.\n function writeUint256(\n bytes memory b,\n uint256 index,\n uint256 input\n )\n internal\n pure\n {\n writeBytes32(b, index, bytes32(input));\n }\n\n /// @dev Reads an unpadded bytes4 value from a position in a byte array.\n /// @param b Byte array containing a bytes4 value.\n /// @param index Index in byte array of bytes4 value.\n /// @return bytes4 value from byte array.\n function readBytes4(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes4 result)\n {\n require(\n b.length >= index + 4,\n \"GREATER_OR_EQUAL_TO_4_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 32 byte length field\n index += 32;\n\n // Read the bytes4 from array memory\n assembly {\n result := mload(add(b, index))\n // Solidity does not require us to clean the trailing bytes.\n // We do it anyway\n result := and(result, 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000)\n }\n return result;\n }\n\n /// @dev Reads nested bytes from a specific position.\n /// @dev NOTE: the returned value overlaps with the input value.\n /// Both should be treated as immutable.\n /// @param b Byte array containing nested bytes.\n /// @param index Index of nested bytes.\n /// @return result Nested bytes.\n function readBytesWithLength(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes memory result)\n {\n // Read length of nested bytes\n uint256 nestedBytesLength = readUint256(b, index);\n index += 32;\n\n // Assert length of <b> is valid, given\n // length of nested bytes\n require(\n b.length >= index + nestedBytesLength,\n \"GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED\"\n );\n \n // Return a pointer to the byte array as it exists inside `b`\n assembly {\n result := add(b, index)\n }\n return result;\n }\n\n /// @dev Inserts bytes at a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input bytes to insert.\n function writeBytesWithLength(\n bytes memory b,\n uint256 index,\n bytes memory input\n )\n internal\n pure\n {\n // Assert length of <b> is valid, given\n // length of input\n require(\n b.length >= index + 32 + input.length, // 32 bytes to store length\n \"GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED\"\n );\n\n // Copy <input> into <b>\n memCopy(\n b.contentAddress() + index,\n input.rawAddress(), // includes length of <input>\n input.length + 32 // +32 bytes to store <input> length\n );\n }\n\n /// @dev Performs a deep copy of a byte array onto another byte array of greater than or equal length.\n /// @param dest Byte array that will be overwritten with source bytes.\n /// @param source Byte array to copy onto dest bytes.\n function deepCopyBytes(\n bytes memory dest,\n bytes memory source\n )\n internal\n pure\n {\n uint256 sourceLen = source.length;\n // Dest length must be >= source length, or some bytes would not be copied.\n require(\n dest.length >= sourceLen,\n \"GREATER_OR_EQUAL_TO_SOURCE_BYTES_LENGTH_REQUIRED\"\n );\n memCopy(\n dest.contentAddress(),\n source.contentAddress(),\n sourceLen\n );\n }\n}\n",
- "2.0.0/utils/Ownable/IOwnable.sol": "pragma solidity 0.4.24;\n\n\ncontract IOwnable {\n\n function transferOwnership(address newOwner)\n public;\n}\n",
- "2.0.0/utils/Ownable/Ownable.sol": "pragma solidity 0.4.24;\n\nimport \"./IOwnable.sol\";\n\n\ncontract Ownable is\n IOwnable\n{\n address public owner;\n\n constructor ()\n public\n {\n owner = msg.sender;\n }\n\n modifier onlyOwner() {\n require(\n msg.sender == owner,\n \"ONLY_CONTRACT_OWNER\"\n );\n _;\n }\n\n function transferOwnership(address newOwner)\n public\n onlyOwner\n {\n if (newOwner != address(0)) {\n owner = newOwner;\n }\n }\n}\n",
- "2.0.0/utils/ReentrancyGuard/ReentrancyGuard.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract ReentrancyGuard {\n\n // Locked state of mutex\n bool private locked = false;\n\n /// @dev Functions with this modifer cannot be reentered. The mutex will be locked\n /// before function execution and unlocked after.\n modifier nonReentrant() {\n // Ensure mutex is unlocked\n require(\n !locked,\n \"REENTRANCY_ILLEGAL\"\n );\n\n // Lock mutex before function call\n locked = true;\n\n // Perform function call\n _;\n\n // Unlock mutex after function call\n locked = false;\n }\n}\n",
- "2.0.0/utils/SafeMath/SafeMath.sol": "pragma solidity 0.4.24;\n\n\ncontract SafeMath {\n\n function safeMul(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n if (a == 0) {\n return 0;\n }\n uint256 c = a * b;\n require(\n c / a == b,\n \"UINT256_OVERFLOW\"\n );\n return c;\n }\n\n function safeDiv(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n uint256 c = a / b;\n return c;\n }\n\n function safeSub(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n require(\n b <= a,\n \"UINT256_UNDERFLOW\"\n );\n return a - b;\n }\n\n function safeAdd(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n uint256 c = a + b;\n require(\n c >= a,\n \"UINT256_OVERFLOW\"\n );\n return c;\n }\n\n function max64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n\n function max256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n}\n"
- },
- "sourceTreeHashHex": "0x93eec0587c0db8b68951a9c0c348c14e22831361b7fe38bb2d29a09ad670e10d",
- "compiler": {
- "name": "solc",
- "version": "soljson-v0.4.24+commit.e67f0147.js",
- "settings": {
- "optimizer": {
- "enabled": true,
- "runs": 1000000
- },
- "outputSelection": {
- "*": {
- "*": [
- "abi",
- "evm.bytecode.object",
- "evm.bytecode.sourceMap",
- "evm.deployedBytecode.object",
- "evm.deployedBytecode.sourceMap"
- ]
- }
- }
- }
- },
- "networks": {
- "1": {
- "address": "0x208e41fb445f1bb1b6780d58356e81405f3e6127",
- "links": {},
- "constructorArgs": "[]"
- },
- "3": {
- "address": "0xe654aac058bfbf9f83fcaee7793311dd82f6ddb4",
- "links": {},
- "constructorArgs": "[]"
- },
- "42": {
- "address": "0x2a9127c745688a165106c11cd4d647d2220af821",
- "links": {},
- "constructorArgs": "[]"
- },
- "50": {
- "address": "0x1d7022f5b17d2f8b695918fb48fa1089c9f85401",
- "links": {},
- "constructorArgs": "[]"
- }
- }
-}
diff --git a/packages/migrations/artifacts/2.0.0/ERC721Token.json b/packages/migrations/artifacts/2.0.0/ERC721Token.json
deleted file mode 100644
index ceb374730..000000000
--- a/packages/migrations/artifacts/2.0.0/ERC721Token.json
+++ /dev/null
@@ -1,565 +0,0 @@
-{
- "schemaVersion": "2.0.0",
- "contractName": "ERC721Token",
- "compilerOutput": {
- "abi": [
- {
- "constant": true,
- "inputs": [
- {
- "name": "_tokenId",
- "type": "uint256"
- }
- ],
- "name": "getApproved",
- "outputs": [
- {
- "name": "",
- "type": "address"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_approved",
- "type": "address"
- },
- {
- "name": "_tokenId",
- "type": "uint256"
- }
- ],
- "name": "approve",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_from",
- "type": "address"
- },
- {
- "name": "_to",
- "type": "address"
- },
- {
- "name": "_tokenId",
- "type": "uint256"
- }
- ],
- "name": "transferFrom",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_from",
- "type": "address"
- },
- {
- "name": "_to",
- "type": "address"
- },
- {
- "name": "_tokenId",
- "type": "uint256"
- }
- ],
- "name": "safeTransferFrom",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "_tokenId",
- "type": "uint256"
- }
- ],
- "name": "ownerOf",
- "outputs": [
- {
- "name": "",
- "type": "address"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "_owner",
- "type": "address"
- }
- ],
- "name": "balanceOf",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_operator",
- "type": "address"
- },
- {
- "name": "_approved",
- "type": "bool"
- }
- ],
- "name": "setApprovalForAll",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_from",
- "type": "address"
- },
- {
- "name": "_to",
- "type": "address"
- },
- {
- "name": "_tokenId",
- "type": "uint256"
- },
- {
- "name": "_data",
- "type": "bytes"
- }
- ],
- "name": "safeTransferFrom",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "_owner",
- "type": "address"
- },
- {
- "name": "_operator",
- "type": "address"
- }
- ],
- "name": "isApprovedForAll",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "_from",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "_to",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "_tokenId",
- "type": "uint256"
- }
- ],
- "name": "Transfer",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "_owner",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "_approved",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "_tokenId",
- "type": "uint256"
- }
- ],
- "name": "Approval",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "_owner",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "_operator",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "_approved",
- "type": "bool"
- }
- ],
- "name": "ApprovalForAll",
- "type": "event"
- }
- ],
- "evm": {
- "bytecode": {
- "linkReferences": {},
- "object": "0x608060405234801561001057600080fd5b50610e2d806100206000396000f3006080604052600436106100985763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663081812fc811461009d578063095ea7b3146100de57806323b872dd1461011157806342842e0e146101485780636352211e1461017f57806370a0823114610197578063a22cb465146101d7578063b88d4fde1461020a578063e985e9c514610250575b600080fd5b3480156100a957600080fd5b506100b5600435610298565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b3480156100ea57600080fd5b5061010f73ffffffffffffffffffffffffffffffffffffffff600435166024356102c0565b005b34801561011d57600080fd5b5061010f73ffffffffffffffffffffffffffffffffffffffff600435811690602435166044356103e4565b34801561015457600080fd5b5061010f73ffffffffffffffffffffffffffffffffffffffff60043581169060243516604435610744565b34801561018b57600080fd5b506100b560043561090f565b3480156101a357600080fd5b506101c573ffffffffffffffffffffffffffffffffffffffff600435166109a8565b60408051918252519081900360200190f35b3480156101e357600080fd5b5061010f73ffffffffffffffffffffffffffffffffffffffff600435166024351515610a57565b34801561021657600080fd5b5061010f73ffffffffffffffffffffffffffffffffffffffff60048035821691602480359091169160443591606435908101910135610af0565b34801561025c57600080fd5b5061028473ffffffffffffffffffffffffffffffffffffffff60043581169060243516610cd4565b604080519115158252519081900360200190f35b60009081526001602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b60006102cb8261090f565b90503373ffffffffffffffffffffffffffffffffffffffff821614806102f657506102f68133610cd4565b151561036357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4552433732315f494e56414c49445f53454e4445520000000000000000000000604482015290519081900360640190fd5b60008281526001602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff87811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6000808073ffffffffffffffffffffffffffffffffffffffff8516151561046c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4552433732315f5a45524f5f544f5f4144445245535300000000000000000000604482015290519081900360640190fd5b6104758461090f565b925073ffffffffffffffffffffffffffffffffffffffff868116908416146104fe57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4552433732315f4f574e45525f4d49534d415443480000000000000000000000604482015290519081900360640190fd5b33915061050a84610298565b90508273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148061054b575061054b8383610cd4565b8061058157508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b15156105ee57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4552433732315f494e56414c49445f5350454e44455200000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff81161561063f57600084815260016020526040902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001690555b60008481526020818152604080832080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8a8116919091179091558916835260029091529020546106a8906001610d0f565b73ffffffffffffffffffffffffffffffffffffffff80881660009081526002602052604080822093909355908716815220546106e5906001610d86565b73ffffffffffffffffffffffffffffffffffffffff808716600081815260026020526040808220949094559251879391928a16917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050505050565b6000806107528585856103e4565b833b9150600082111561090857604080517f150b7a0200000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff8781166024830152604482018690526080606483015260006084830181905292519087169263150b7a029260c480820193602093909283900390910190829087803b1580156107ef57600080fd5b505af1158015610803573d6000803e3d6000fd5b505050506040513d602081101561081957600080fd5b5051604080517f6f6e455243373231526563656976656428616464726573732c6164647265737381527f2c75696e743235362c62797465732900000000000000000000000000000000006020820152905190819003602f0190209091507fffffffff0000000000000000000000000000000000000000000000000000000080831691161461090857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4552433732315f494e56414c49445f53454c4543544f52000000000000000000604482015290519081900360640190fd5b5050505050565b60008181526020819052604081205473ffffffffffffffffffffffffffffffffffffffff168015156109a257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f4552433732315f5a45524f5f4f574e4552000000000000000000000000000000604482015290519081900360640190fd5b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82161515610a2e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f4552433732315f5a45524f5f4f574e4552000000000000000000000000000000604482015290519081900360640190fd5b5073ffffffffffffffffffffffffffffffffffffffff1660009081526002602052604090205490565b33600081815260036020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168085529083529281902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016861515908117909155815190815290519293927f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31929181900390910190a35050565b600080610afe8787876103e4565b853b91506000821115610ccb576040517f150b7a02000000000000000000000000000000000000000000000000000000008152336004820181815273ffffffffffffffffffffffffffffffffffffffff8a811660248501526044840189905260806064850190815260848501889052908a169363150b7a0293928c928b928b928b92909160a40184848082843782019150509650505050505050602060405180830381600087803b158015610bb257600080fd5b505af1158015610bc6573d6000803e3d6000fd5b505050506040513d6020811015610bdc57600080fd5b5051604080517f6f6e455243373231526563656976656428616464726573732c6164647265737381527f2c75696e743235362c62797465732900000000000000000000000000000000006020820152905190819003602f0190209091507fffffffff00000000000000000000000000000000000000000000000000000000808316911614610ccb57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4552433732315f494e56414c49445f53454c4543544f52000000000000000000604482015290519081900360640190fd5b50505050505050565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260036020908152604080832093909416825291909152205460ff1690565b600082821115610d8057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f55494e543235365f554e444552464c4f57000000000000000000000000000000604482015290519081900360640190fd5b50900390565b600082820183811015610dfa57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f55494e543235365f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b93925050505600a165627a7a723058207318c14c91209a554964c5f972b95a90fe384dd7dd96ccfd0609544e6439c3c90029",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xE2D DUP1 PUSH2 0x20 PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN STOP PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x98 JUMPI PUSH4 0xFFFFFFFF PUSH29 0x100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD DIV AND PUSH4 0x81812FC DUP2 EQ PUSH2 0x9D JUMPI DUP1 PUSH4 0x95EA7B3 EQ PUSH2 0xDE JUMPI DUP1 PUSH4 0x23B872DD EQ PUSH2 0x111 JUMPI DUP1 PUSH4 0x42842E0E EQ PUSH2 0x148 JUMPI DUP1 PUSH4 0x6352211E EQ PUSH2 0x17F JUMPI DUP1 PUSH4 0x70A08231 EQ PUSH2 0x197 JUMPI DUP1 PUSH4 0xA22CB465 EQ PUSH2 0x1D7 JUMPI DUP1 PUSH4 0xB88D4FDE EQ PUSH2 0x20A JUMPI DUP1 PUSH4 0xE985E9C5 EQ PUSH2 0x250 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xA9 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xB5 PUSH1 0x4 CALLDATALOAD PUSH2 0x298 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xEA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x10F PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x2C0 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x11D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x10F PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH1 0x44 CALLDATALOAD PUSH2 0x3E4 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x154 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x10F PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH1 0x44 CALLDATALOAD PUSH2 0x744 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x18B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xB5 PUSH1 0x4 CALLDATALOAD PUSH2 0x90F JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1A3 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1C5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x9A8 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1E3 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x10F PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD ISZERO ISZERO PUSH2 0xA57 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x216 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x10F PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 DUP1 CALLDATALOAD DUP3 AND SWAP2 PUSH1 0x24 DUP1 CALLDATALOAD SWAP1 SWAP2 AND SWAP2 PUSH1 0x44 CALLDATALOAD SWAP2 PUSH1 0x64 CALLDATALOAD SWAP1 DUP2 ADD SWAP2 ADD CALLDATALOAD PUSH2 0xAF0 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x25C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x284 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH2 0xCD4 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 ISZERO ISZERO DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x2CB DUP3 PUSH2 0x90F JUMP JUMPDEST SWAP1 POP CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND EQ DUP1 PUSH2 0x2F6 JUMPI POP PUSH2 0x2F6 DUP2 CALLER PUSH2 0xCD4 JUMP JUMPDEST ISZERO ISZERO PUSH2 0x363 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x15 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F494E56414C49445F53454E4445520000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x0 DUP3 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 DUP2 AND SWAP2 DUP3 OR SWAP1 SWAP3 SSTORE SWAP2 MLOAD DUP6 SWAP4 SWAP2 DUP6 AND SWAP2 PUSH32 0x8C5BE1E5EBEC7D5BD14F71427D1E84F3DD0314C0F7B2291E5B200AC8C7C3B925 SWAP2 LOG4 POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP6 AND ISZERO ISZERO PUSH2 0x46C JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x16 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F5A45524F5F544F5F4144445245535300000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH2 0x475 DUP5 PUSH2 0x90F JUMP JUMPDEST SWAP3 POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP7 DUP2 AND SWAP1 DUP5 AND EQ PUSH2 0x4FE JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x15 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F4F574E45525F4D49534D415443480000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST CALLER SWAP2 POP PUSH2 0x50A DUP5 PUSH2 0x298 JUMP JUMPDEST SWAP1 POP DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ DUP1 PUSH2 0x54B JUMPI POP PUSH2 0x54B DUP4 DUP4 PUSH2 0xCD4 JUMP JUMPDEST DUP1 PUSH2 0x581 JUMPI POP DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ JUMPDEST ISZERO ISZERO PUSH2 0x5EE JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x16 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F494E56414C49445F5350454E44455200000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND ISZERO PUSH2 0x63F JUMPI PUSH1 0x0 DUP5 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND SWAP1 SSTORE JUMPDEST PUSH1 0x0 DUP5 DUP2 MSTORE PUSH1 0x20 DUP2 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP11 DUP2 AND SWAP2 SWAP1 SWAP2 OR SWAP1 SWAP2 SSTORE DUP10 AND DUP4 MSTORE PUSH1 0x2 SWAP1 SWAP2 MSTORE SWAP1 KECCAK256 SLOAD PUSH2 0x6A8 SWAP1 PUSH1 0x1 PUSH2 0xD0F JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP9 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 SWAP4 SWAP1 SWAP4 SSTORE SWAP1 DUP8 AND DUP2 MSTORE KECCAK256 SLOAD PUSH2 0x6E5 SWAP1 PUSH1 0x1 PUSH2 0xD86 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP8 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 SWAP5 SWAP1 SWAP5 SSTORE SWAP3 MLOAD DUP8 SWAP4 SWAP2 SWAP3 DUP11 AND SWAP2 PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF SWAP2 LOG4 POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x752 DUP6 DUP6 DUP6 PUSH2 0x3E4 JUMP JUMPDEST DUP4 EXTCODESIZE SWAP2 POP PUSH1 0x0 DUP3 GT ISZERO PUSH2 0x908 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x150B7A0200000000000000000000000000000000000000000000000000000000 DUP2 MSTORE CALLER PUSH1 0x4 DUP3 ADD MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 DUP2 AND PUSH1 0x24 DUP4 ADD MSTORE PUSH1 0x44 DUP3 ADD DUP7 SWAP1 MSTORE PUSH1 0x80 PUSH1 0x64 DUP4 ADD MSTORE PUSH1 0x0 PUSH1 0x84 DUP4 ADD DUP2 SWAP1 MSTORE SWAP3 MLOAD SWAP1 DUP8 AND SWAP3 PUSH4 0x150B7A02 SWAP3 PUSH1 0xC4 DUP1 DUP3 ADD SWAP4 PUSH1 0x20 SWAP4 SWAP1 SWAP3 DUP4 SWAP1 SUB SWAP1 SWAP2 ADD SWAP1 DUP3 SWAP1 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x7EF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x803 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x20 DUP2 LT ISZERO PUSH2 0x819 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP MLOAD PUSH1 0x40 DUP1 MLOAD PUSH32 0x6F6E455243373231526563656976656428616464726573732C61646472657373 DUP2 MSTORE PUSH32 0x2C75696E743235362C6279746573290000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x2F ADD SWAP1 KECCAK256 SWAP1 SWAP2 POP PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 DUP1 DUP4 AND SWAP2 AND EQ PUSH2 0x908 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x17 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F494E56414C49445F53454C4543544F52000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 DUP2 KECCAK256 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP1 ISZERO ISZERO PUSH2 0x9A2 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x11 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F5A45524F5F4F574E4552000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND ISZERO ISZERO PUSH2 0xA2E JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x11 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F5A45524F5F4F574E4552000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD SWAP1 JUMP JUMPDEST CALLER PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x3 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 AND DUP1 DUP6 MSTORE SWAP1 DUP4 MSTORE SWAP3 DUP2 SWAP1 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND DUP7 ISZERO ISZERO SWAP1 DUP2 OR SWAP1 SWAP2 SSTORE DUP2 MLOAD SWAP1 DUP2 MSTORE SWAP1 MLOAD SWAP3 SWAP4 SWAP3 PUSH32 0x17307EAB39AB6107E8899845AD3D59BD9653F200F220920489CA2B5937696C31 SWAP3 SWAP2 DUP2 SWAP1 SUB SWAP1 SWAP2 ADD SWAP1 LOG3 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0xAFE DUP8 DUP8 DUP8 PUSH2 0x3E4 JUMP JUMPDEST DUP6 EXTCODESIZE SWAP2 POP PUSH1 0x0 DUP3 GT ISZERO PUSH2 0xCCB JUMPI PUSH1 0x40 MLOAD PUSH32 0x150B7A0200000000000000000000000000000000000000000000000000000000 DUP2 MSTORE CALLER PUSH1 0x4 DUP3 ADD DUP2 DUP2 MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP11 DUP2 AND PUSH1 0x24 DUP6 ADD MSTORE PUSH1 0x44 DUP5 ADD DUP10 SWAP1 MSTORE PUSH1 0x80 PUSH1 0x64 DUP6 ADD SWAP1 DUP2 MSTORE PUSH1 0x84 DUP6 ADD DUP9 SWAP1 MSTORE SWAP1 DUP11 AND SWAP4 PUSH4 0x150B7A02 SWAP4 SWAP3 DUP13 SWAP3 DUP12 SWAP3 DUP12 SWAP3 DUP12 SWAP3 SWAP1 SWAP2 PUSH1 0xA4 ADD DUP5 DUP5 DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP SWAP7 POP POP POP POP POP POP POP PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0xBB2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0xBC6 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x20 DUP2 LT ISZERO PUSH2 0xBDC JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP MLOAD PUSH1 0x40 DUP1 MLOAD PUSH32 0x6F6E455243373231526563656976656428616464726573732C61646472657373 DUP2 MSTORE PUSH32 0x2C75696E743235362C6279746573290000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x2F ADD SWAP1 KECCAK256 SWAP1 SWAP2 POP PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 DUP1 DUP4 AND SWAP2 AND EQ PUSH2 0xCCB JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x17 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F494E56414C49445F53454C4543544F52000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP POP POP POP POP POP POP JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP2 DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x3 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 SWAP4 SWAP1 SWAP5 AND DUP3 MSTORE SWAP2 SWAP1 SWAP2 MSTORE KECCAK256 SLOAD PUSH1 0xFF AND SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 GT ISZERO PUSH2 0xD80 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x11 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x55494E543235365F554E444552464C4F57000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP SWAP1 SUB SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 ADD DUP4 DUP2 LT ISZERO PUSH2 0xDFA JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x10 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x55494E543235365F4F564552464C4F5700000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST SWAP4 SWAP3 POP POP POP JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 PUSH20 0x18C14C91209A554964C5F972B95A90FE384DD7DD SWAP7 0xcc REVERT MOD MULMOD SLOAD 0x4e PUSH5 0x39C3C90029 ",
- "sourceMap": "712:8295:56:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;712:8295:56;;;;;;;"
- },
- "deployedBytecode": {
- "linkReferences": {},
- "object": "0x6080604052600436106100985763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663081812fc811461009d578063095ea7b3146100de57806323b872dd1461011157806342842e0e146101485780636352211e1461017f57806370a0823114610197578063a22cb465146101d7578063b88d4fde1461020a578063e985e9c514610250575b600080fd5b3480156100a957600080fd5b506100b5600435610298565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b3480156100ea57600080fd5b5061010f73ffffffffffffffffffffffffffffffffffffffff600435166024356102c0565b005b34801561011d57600080fd5b5061010f73ffffffffffffffffffffffffffffffffffffffff600435811690602435166044356103e4565b34801561015457600080fd5b5061010f73ffffffffffffffffffffffffffffffffffffffff60043581169060243516604435610744565b34801561018b57600080fd5b506100b560043561090f565b3480156101a357600080fd5b506101c573ffffffffffffffffffffffffffffffffffffffff600435166109a8565b60408051918252519081900360200190f35b3480156101e357600080fd5b5061010f73ffffffffffffffffffffffffffffffffffffffff600435166024351515610a57565b34801561021657600080fd5b5061010f73ffffffffffffffffffffffffffffffffffffffff60048035821691602480359091169160443591606435908101910135610af0565b34801561025c57600080fd5b5061028473ffffffffffffffffffffffffffffffffffffffff60043581169060243516610cd4565b604080519115158252519081900360200190f35b60009081526001602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b60006102cb8261090f565b90503373ffffffffffffffffffffffffffffffffffffffff821614806102f657506102f68133610cd4565b151561036357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4552433732315f494e56414c49445f53454e4445520000000000000000000000604482015290519081900360640190fd5b60008281526001602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff87811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6000808073ffffffffffffffffffffffffffffffffffffffff8516151561046c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4552433732315f5a45524f5f544f5f4144445245535300000000000000000000604482015290519081900360640190fd5b6104758461090f565b925073ffffffffffffffffffffffffffffffffffffffff868116908416146104fe57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4552433732315f4f574e45525f4d49534d415443480000000000000000000000604482015290519081900360640190fd5b33915061050a84610298565b90508273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148061054b575061054b8383610cd4565b8061058157508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b15156105ee57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4552433732315f494e56414c49445f5350454e44455200000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff81161561063f57600084815260016020526040902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001690555b60008481526020818152604080832080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8a8116919091179091558916835260029091529020546106a8906001610d0f565b73ffffffffffffffffffffffffffffffffffffffff80881660009081526002602052604080822093909355908716815220546106e5906001610d86565b73ffffffffffffffffffffffffffffffffffffffff808716600081815260026020526040808220949094559251879391928a16917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050505050565b6000806107528585856103e4565b833b9150600082111561090857604080517f150b7a0200000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff8781166024830152604482018690526080606483015260006084830181905292519087169263150b7a029260c480820193602093909283900390910190829087803b1580156107ef57600080fd5b505af1158015610803573d6000803e3d6000fd5b505050506040513d602081101561081957600080fd5b5051604080517f6f6e455243373231526563656976656428616464726573732c6164647265737381527f2c75696e743235362c62797465732900000000000000000000000000000000006020820152905190819003602f0190209091507fffffffff0000000000000000000000000000000000000000000000000000000080831691161461090857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4552433732315f494e56414c49445f53454c4543544f52000000000000000000604482015290519081900360640190fd5b5050505050565b60008181526020819052604081205473ffffffffffffffffffffffffffffffffffffffff168015156109a257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f4552433732315f5a45524f5f4f574e4552000000000000000000000000000000604482015290519081900360640190fd5b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82161515610a2e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f4552433732315f5a45524f5f4f574e4552000000000000000000000000000000604482015290519081900360640190fd5b5073ffffffffffffffffffffffffffffffffffffffff1660009081526002602052604090205490565b33600081815260036020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168085529083529281902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016861515908117909155815190815290519293927f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31929181900390910190a35050565b600080610afe8787876103e4565b853b91506000821115610ccb576040517f150b7a02000000000000000000000000000000000000000000000000000000008152336004820181815273ffffffffffffffffffffffffffffffffffffffff8a811660248501526044840189905260806064850190815260848501889052908a169363150b7a0293928c928b928b928b92909160a40184848082843782019150509650505050505050602060405180830381600087803b158015610bb257600080fd5b505af1158015610bc6573d6000803e3d6000fd5b505050506040513d6020811015610bdc57600080fd5b5051604080517f6f6e455243373231526563656976656428616464726573732c6164647265737381527f2c75696e743235362c62797465732900000000000000000000000000000000006020820152905190819003602f0190209091507fffffffff00000000000000000000000000000000000000000000000000000000808316911614610ccb57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4552433732315f494e56414c49445f53454c4543544f52000000000000000000604482015290519081900360640190fd5b50505050505050565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260036020908152604080832093909416825291909152205460ff1690565b600082821115610d8057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f55494e543235365f554e444552464c4f57000000000000000000000000000000604482015290519081900360640190fd5b50900390565b600082820183811015610dfa57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f55494e543235365f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b93925050505600a165627a7a723058207318c14c91209a554964c5f972b95a90fe384dd7dd96ccfd0609544e6439c3c90029",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x98 JUMPI PUSH4 0xFFFFFFFF PUSH29 0x100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD DIV AND PUSH4 0x81812FC DUP2 EQ PUSH2 0x9D JUMPI DUP1 PUSH4 0x95EA7B3 EQ PUSH2 0xDE JUMPI DUP1 PUSH4 0x23B872DD EQ PUSH2 0x111 JUMPI DUP1 PUSH4 0x42842E0E EQ PUSH2 0x148 JUMPI DUP1 PUSH4 0x6352211E EQ PUSH2 0x17F JUMPI DUP1 PUSH4 0x70A08231 EQ PUSH2 0x197 JUMPI DUP1 PUSH4 0xA22CB465 EQ PUSH2 0x1D7 JUMPI DUP1 PUSH4 0xB88D4FDE EQ PUSH2 0x20A JUMPI DUP1 PUSH4 0xE985E9C5 EQ PUSH2 0x250 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xA9 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xB5 PUSH1 0x4 CALLDATALOAD PUSH2 0x298 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP3 AND DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xEA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x10F PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x2C0 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x11D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x10F PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH1 0x44 CALLDATALOAD PUSH2 0x3E4 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x154 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x10F PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH1 0x44 CALLDATALOAD PUSH2 0x744 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x18B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xB5 PUSH1 0x4 CALLDATALOAD PUSH2 0x90F JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1A3 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1C5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x9A8 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1E3 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x10F PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD ISZERO ISZERO PUSH2 0xA57 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x216 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x10F PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 DUP1 CALLDATALOAD DUP3 AND SWAP2 PUSH1 0x24 DUP1 CALLDATALOAD SWAP1 SWAP2 AND SWAP2 PUSH1 0x44 CALLDATALOAD SWAP2 PUSH1 0x64 CALLDATALOAD SWAP1 DUP2 ADD SWAP2 ADD CALLDATALOAD PUSH2 0xAF0 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x25C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x284 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH2 0xCD4 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 ISZERO ISZERO DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x2CB DUP3 PUSH2 0x90F JUMP JUMPDEST SWAP1 POP CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND EQ DUP1 PUSH2 0x2F6 JUMPI POP PUSH2 0x2F6 DUP2 CALLER PUSH2 0xCD4 JUMP JUMPDEST ISZERO ISZERO PUSH2 0x363 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x15 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F494E56414C49445F53454E4445520000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x0 DUP3 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 DUP2 AND SWAP2 DUP3 OR SWAP1 SWAP3 SSTORE SWAP2 MLOAD DUP6 SWAP4 SWAP2 DUP6 AND SWAP2 PUSH32 0x8C5BE1E5EBEC7D5BD14F71427D1E84F3DD0314C0F7B2291E5B200AC8C7C3B925 SWAP2 LOG4 POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP6 AND ISZERO ISZERO PUSH2 0x46C JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x16 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F5A45524F5F544F5F4144445245535300000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH2 0x475 DUP5 PUSH2 0x90F JUMP JUMPDEST SWAP3 POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP7 DUP2 AND SWAP1 DUP5 AND EQ PUSH2 0x4FE JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x15 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F4F574E45525F4D49534D415443480000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST CALLER SWAP2 POP PUSH2 0x50A DUP5 PUSH2 0x298 JUMP JUMPDEST SWAP1 POP DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ DUP1 PUSH2 0x54B JUMPI POP PUSH2 0x54B DUP4 DUP4 PUSH2 0xCD4 JUMP JUMPDEST DUP1 PUSH2 0x581 JUMPI POP DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ JUMPDEST ISZERO ISZERO PUSH2 0x5EE JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x16 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F494E56414C49445F5350454E44455200000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND ISZERO PUSH2 0x63F JUMPI PUSH1 0x0 DUP5 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND SWAP1 SSTORE JUMPDEST PUSH1 0x0 DUP5 DUP2 MSTORE PUSH1 0x20 DUP2 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP11 DUP2 AND SWAP2 SWAP1 SWAP2 OR SWAP1 SWAP2 SSTORE DUP10 AND DUP4 MSTORE PUSH1 0x2 SWAP1 SWAP2 MSTORE SWAP1 KECCAK256 SLOAD PUSH2 0x6A8 SWAP1 PUSH1 0x1 PUSH2 0xD0F JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP9 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 SWAP4 SWAP1 SWAP4 SSTORE SWAP1 DUP8 AND DUP2 MSTORE KECCAK256 SLOAD PUSH2 0x6E5 SWAP1 PUSH1 0x1 PUSH2 0xD86 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP8 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 SWAP5 SWAP1 SWAP5 SSTORE SWAP3 MLOAD DUP8 SWAP4 SWAP2 SWAP3 DUP11 AND SWAP2 PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF SWAP2 LOG4 POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x752 DUP6 DUP6 DUP6 PUSH2 0x3E4 JUMP JUMPDEST DUP4 EXTCODESIZE SWAP2 POP PUSH1 0x0 DUP3 GT ISZERO PUSH2 0x908 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x150B7A0200000000000000000000000000000000000000000000000000000000 DUP2 MSTORE CALLER PUSH1 0x4 DUP3 ADD MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 DUP2 AND PUSH1 0x24 DUP4 ADD MSTORE PUSH1 0x44 DUP3 ADD DUP7 SWAP1 MSTORE PUSH1 0x80 PUSH1 0x64 DUP4 ADD MSTORE PUSH1 0x0 PUSH1 0x84 DUP4 ADD DUP2 SWAP1 MSTORE SWAP3 MLOAD SWAP1 DUP8 AND SWAP3 PUSH4 0x150B7A02 SWAP3 PUSH1 0xC4 DUP1 DUP3 ADD SWAP4 PUSH1 0x20 SWAP4 SWAP1 SWAP3 DUP4 SWAP1 SUB SWAP1 SWAP2 ADD SWAP1 DUP3 SWAP1 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x7EF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x803 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x20 DUP2 LT ISZERO PUSH2 0x819 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP MLOAD PUSH1 0x40 DUP1 MLOAD PUSH32 0x6F6E455243373231526563656976656428616464726573732C61646472657373 DUP2 MSTORE PUSH32 0x2C75696E743235362C6279746573290000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x2F ADD SWAP1 KECCAK256 SWAP1 SWAP2 POP PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 DUP1 DUP4 AND SWAP2 AND EQ PUSH2 0x908 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x17 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F494E56414C49445F53454C4543544F52000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 DUP2 KECCAK256 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP1 ISZERO ISZERO PUSH2 0x9A2 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x11 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F5A45524F5F4F574E4552000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND ISZERO ISZERO PUSH2 0xA2E JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x11 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F5A45524F5F4F574E4552000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x2 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD SWAP1 JUMP JUMPDEST CALLER PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x3 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 AND DUP1 DUP6 MSTORE SWAP1 DUP4 MSTORE SWAP3 DUP2 SWAP1 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND DUP7 ISZERO ISZERO SWAP1 DUP2 OR SWAP1 SWAP2 SSTORE DUP2 MLOAD SWAP1 DUP2 MSTORE SWAP1 MLOAD SWAP3 SWAP4 SWAP3 PUSH32 0x17307EAB39AB6107E8899845AD3D59BD9653F200F220920489CA2B5937696C31 SWAP3 SWAP2 DUP2 SWAP1 SUB SWAP1 SWAP2 ADD SWAP1 LOG3 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0xAFE DUP8 DUP8 DUP8 PUSH2 0x3E4 JUMP JUMPDEST DUP6 EXTCODESIZE SWAP2 POP PUSH1 0x0 DUP3 GT ISZERO PUSH2 0xCCB JUMPI PUSH1 0x40 MLOAD PUSH32 0x150B7A0200000000000000000000000000000000000000000000000000000000 DUP2 MSTORE CALLER PUSH1 0x4 DUP3 ADD DUP2 DUP2 MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP11 DUP2 AND PUSH1 0x24 DUP6 ADD MSTORE PUSH1 0x44 DUP5 ADD DUP10 SWAP1 MSTORE PUSH1 0x80 PUSH1 0x64 DUP6 ADD SWAP1 DUP2 MSTORE PUSH1 0x84 DUP6 ADD DUP9 SWAP1 MSTORE SWAP1 DUP11 AND SWAP4 PUSH4 0x150B7A02 SWAP4 SWAP3 DUP13 SWAP3 DUP12 SWAP3 DUP12 SWAP3 DUP12 SWAP3 SWAP1 SWAP2 PUSH1 0xA4 ADD DUP5 DUP5 DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP SWAP7 POP POP POP POP POP POP POP PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0xBB2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0xBC6 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x20 DUP2 LT ISZERO PUSH2 0xBDC JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP MLOAD PUSH1 0x40 DUP1 MLOAD PUSH32 0x6F6E455243373231526563656976656428616464726573732C61646472657373 DUP2 MSTORE PUSH32 0x2C75696E743235362C6279746573290000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x2F ADD SWAP1 KECCAK256 SWAP1 SWAP2 POP PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 DUP1 DUP4 AND SWAP2 AND EQ PUSH2 0xCCB JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x17 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4552433732315F494E56414C49445F53454C4543544F52000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP POP POP POP POP POP POP JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP2 DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x3 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 SWAP4 SWAP1 SWAP5 AND DUP3 MSTORE SWAP2 SWAP1 SWAP2 MSTORE KECCAK256 SLOAD PUSH1 0xFF AND SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 GT ISZERO PUSH2 0xD80 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x11 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x55494E543235365F554E444552464C4F57000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST POP SWAP1 SUB SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 ADD DUP4 DUP2 LT ISZERO PUSH2 0xDFA JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x10 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x55494E543235365F4F564552464C4F5700000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST SWAP4 SWAP3 POP POP POP JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 PUSH20 0x18C14C91209A554964C5F972B95A90FE384DD7DD SWAP7 0xcc REVERT MOD MULMOD SLOAD 0x4e PUSH5 0x39C3C90029 ",
- "sourceMap": "712:8295:56:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8388:140;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;8388:140:56;;;;;;;;;;;;;;;;;;;;;;;;4378:400;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;4378:400:56;;;;;;;;;;;6624:974;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;6624:974:56;;;;;;;;;;;;;;3326:682;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;3326:682:56;;;;;;;;;;;;;;7860:257;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;7860:257:56;;;;;5783:229;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;5783:229:56;;;;;;;;;;;;;;;;;;;;;;;5184:261;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;5184:261:56;;;;;;;;;;;2257:706;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2257:706:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;8829:176;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;8829:176:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8388:140;8472:7;8502:19;;;:9;:19;;;;;;;;;8388:140::o;4378:400::-;4463:13;4479:17;4487:8;4479:7;:17::i;:::-;4463:33;-1:-1:-1;4527:10:56;:19;;;;;:58;;;4550:35;4567:5;4574:10;4550:16;:35::i;:::-;4506:126;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4643:19;;;;:9;:19;;;;;;:31;;;;;;;;;;;;;;4689:82;;4643:19;;4689:82;;;;;;;4378:400;;;:::o;6624:974::-;6848:13;;;6772:17;;;;;6751:86;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6864:17;6872:8;6864:7;:17::i;:::-;6848:33;-1:-1:-1;6912:14:56;;;;;;;;6891:82;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7002:10;6984:28;;7048:21;7060:8;7048:11;:21::i;:::-;7022:47;;7111:5;7100:16;;:7;:16;;;:64;;;;7132:32;7149:5;7156:7;7132:16;:32::i;:::-;7100:106;;;;7199:7;7180:26;;:15;:26;;;7100:106;7079:175;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7269:29;;;;7265:92;;7344:1;7314:19;;;:9;:19;;;;;:32;;;;;;7265:92;7367:6;:16;;;;;;;;;;;:22;;;;;;;;;;;;;;;7425:15;;;;:8;:15;;;;;;7417:27;;-1:-1:-1;7417:7:56;:27::i;:::-;7399:15;;;;;;;;:8;:15;;;;;;:45;;;;7478:13;;;;;;;7470:25;;7493:1;7470:7;:25::i;:::-;7454:13;;;;;;;;:8;:13;;;;;;:41;;;;7515:76;;7573:8;;7454:13;;7515:76;;;;;;6624:974;;;;;;:::o;3326:682::-;3550:24;3702:15;3459:80;3485:5;3504:3;3521:8;3459:12;:80::i;:::-;3639:3;3627:16;3607:36;;3685:1;3666:16;:20;3662:340;;;3720:148;;;;;;3775:10;3720:148;;;;:37;:148;;;;;;;;;;;;;;;;;;-1:-1:-1;3720:148:56;;;;;;;;:37;;;;;;:148;;;;;;;;;;;;;;;;;;:37;:148;;;5:2:-1;;;;30:1;27;20:12;5:2;3720:148:56;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3720:148:56;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3720:148:56;902:60;;;;;;;3720:148;902:60;;;;;;;;;;;;;3720:148;;-1:-1:-1;3907:27:56;;;;;;;3882:109;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3326:682;;;;;:::o;7860:257::-;7940:7;7979:16;;;;;;;;;;;;;8026:19;;;8005:83;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8105:5;7860:257;-1:-1:-1;;7860:257:56:o;5783:229::-;5865:7;5909:20;;;;;5888:84;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;5989:16:56;;;;;;:8;:16;;;;;;;5783:229::o;5184:261::-;5295:10;5277:29;;;;:17;:29;;;;;;;;;:40;;;;;;;;;;;;:52;;;;;;;;;;;;;5344:94;;;;;;;5277:40;;5295:10;5344:94;;;;;;;;;;;5184:261;;:::o;2257:706::-;2502:24;2654:15;2411:80;2437:5;2456:3;2473:8;2411:12;:80::i;:::-;2591:3;2579:16;2559:36;;2637:1;2618:16;:20;2614:343;;;2672:151;;;;;2727:10;2672:151;;;;;;:37;:151;;;;;;;;;;;;;;;;;;;;;;;;;;:37;;;;;;2727:10;2755:5;;2778:8;;2804:5;;;;2672:151;;;;2804:5;;;;2672:151;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2672:151:56;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2672:151:56;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2672:151:56;902:60;;;;;;;2672:151;902:60;;;;;;;;;;;;;2672:151;;-1:-1:-1;2862:27:56;;;;;;;2837:109;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2257:706;;;;;;;:::o;8829:176::-;8962:25;;;;8935:4;8962:25;;;:17;:25;;;;;;;;:36;;;;;;;;;;;;;;;8829:176::o;502:208:65:-;588:7;632:6;;;;611:70;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;698:5:65;;;502:208::o;716:230::-;802:7;837:5;;;873:6;;;;852:69;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;938:1;716:230;-1:-1:-1;;;716:230:65:o"
- }
- }
- },
- "sources": {
- "2.0.0/extensions/Forwarder/Forwarder.sol": {
- "id": 0
- },
- "2.0.0/extensions/Forwarder/MixinAssets.sol": {
- "id": 1
- },
- "2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol": {
- "id": 2
- },
- "2.0.0/extensions/Forwarder/MixinForwarderCore.sol": {
- "id": 3
- },
- "2.0.0/extensions/Forwarder/MixinWeth.sol": {
- "id": 4
- },
- "2.0.0/extensions/Forwarder/interfaces/IAssets.sol": {
- "id": 5
- },
- "2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol": {
- "id": 6
- },
- "2.0.0/extensions/Forwarder/libs/LibConstants.sol": {
- "id": 7
- },
- "2.0.0/extensions/Forwarder/mixins/MAssets.sol": {
- "id": 8
- },
- "2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol": {
- "id": 9
- },
- "2.0.0/extensions/Forwarder/mixins/MWeth.sol": {
- "id": 10
- },
- "2.0.0/extensions/OrderValidator/OrderValidator.sol": {
- "id": 11
- },
- "2.0.0/multisig/MultiSigWallet.sol": {
- "id": 12
- },
- "2.0.0/multisig/MultiSigWalletWithTimeLock.sol": {
- "id": 13
- },
- "2.0.0/protocol/AssetProxy/ERC20Proxy.sol": {
- "id": 14
- },
- "2.0.0/protocol/AssetProxy/ERC721Proxy.sol": {
- "id": 15
- },
- "2.0.0/protocol/AssetProxy/MixinAuthorizable.sol": {
- "id": 16
- },
- "2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol": {
- "id": 17
- },
- "2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol": {
- "id": 18
- },
- "2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol": {
- "id": 19
- },
- "2.0.0/protocol/AssetProxyOwner/AssetProxyOwner.sol": {
- "id": 20
- },
- "2.0.0/protocol/Exchange/Exchange.sol": {
- "id": 21
- },
- "2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol": {
- "id": 22
- },
- "2.0.0/protocol/Exchange/MixinExchangeCore.sol": {
- "id": 23
- },
- "2.0.0/protocol/Exchange/MixinMatchOrders.sol": {
- "id": 24
- },
- "2.0.0/protocol/Exchange/MixinSignatureValidator.sol": {
- "id": 25
- },
- "2.0.0/protocol/Exchange/MixinTransactions.sol": {
- "id": 26
- },
- "2.0.0/protocol/Exchange/MixinWrapperFunctions.sol": {
- "id": 27
- },
- "2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol": {
- "id": 28
- },
- "2.0.0/protocol/Exchange/interfaces/IExchange.sol": {
- "id": 29
- },
- "2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol": {
- "id": 30
- },
- "2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol": {
- "id": 31
- },
- "2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol": {
- "id": 32
- },
- "2.0.0/protocol/Exchange/interfaces/ITransactions.sol": {
- "id": 33
- },
- "2.0.0/protocol/Exchange/interfaces/IValidator.sol": {
- "id": 34
- },
- "2.0.0/protocol/Exchange/interfaces/IWallet.sol": {
- "id": 35
- },
- "2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol": {
- "id": 36
- },
- "2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol": {
- "id": 37
- },
- "2.0.0/protocol/Exchange/libs/LibConstants.sol": {
- "id": 38
- },
- "2.0.0/protocol/Exchange/libs/LibEIP712.sol": {
- "id": 39
- },
- "2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol": {
- "id": 40
- },
- "2.0.0/protocol/Exchange/libs/LibFillResults.sol": {
- "id": 41
- },
- "2.0.0/protocol/Exchange/libs/LibMath.sol": {
- "id": 42
- },
- "2.0.0/protocol/Exchange/libs/LibOrder.sol": {
- "id": 43
- },
- "2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol": {
- "id": 44
- },
- "2.0.0/protocol/Exchange/mixins/MExchangeCore.sol": {
- "id": 45
- },
- "2.0.0/protocol/Exchange/mixins/MMatchOrders.sol": {
- "id": 46
- },
- "2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol": {
- "id": 47
- },
- "2.0.0/protocol/Exchange/mixins/MTransactions.sol": {
- "id": 48
- },
- "2.0.0/protocol/Exchange/mixins/MWrapperFunctions.sol": {
- "id": 49
- },
- "2.0.0/test/DummyERC20Token/DummyERC20Token.sol": {
- "id": 50
- },
- "2.0.0/test/DummyERC721Token/DummyERC721Token.sol": {
- "id": 51
- },
- "2.0.0/tokens/ERC20Token/ERC20Token.sol": {
- "id": 52
- },
- "2.0.0/tokens/ERC20Token/IERC20Token.sol": {
- "id": 53
- },
- "2.0.0/tokens/ERC20Token/MintableERC20Token.sol": {
- "id": 54
- },
- "2.0.0/tokens/ERC20Token/UnlimitedAllowanceERC20Token.sol": {
- "id": 55
- },
- "2.0.0/tokens/ERC721Token/ERC721Token.sol": {
- "id": 56
- },
- "2.0.0/tokens/ERC721Token/IERC721Receiver.sol": {
- "id": 57
- },
- "2.0.0/tokens/ERC721Token/IERC721Token.sol": {
- "id": 58
- },
- "2.0.0/tokens/ERC721Token/MintableERC721Token.sol": {
- "id": 59
- },
- "2.0.0/tokens/EtherToken/IEtherToken.sol": {
- "id": 60
- },
- "2.0.0/utils/LibBytes/LibBytes.sol": {
- "id": 61
- },
- "2.0.0/utils/Ownable/IOwnable.sol": {
- "id": 62
- },
- "2.0.0/utils/Ownable/Ownable.sol": {
- "id": 63
- },
- "2.0.0/utils/ReentrancyGuard/ReentrancyGuard.sol": {
- "id": 64
- },
- "2.0.0/utils/SafeMath/SafeMath.sol": {
- "id": 65
- }
- },
- "sourceCodes": {
- "2.0.0/extensions/Forwarder/Forwarder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./MixinWeth.sol\";\nimport \"./MixinForwarderCore.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./MixinAssets.sol\";\nimport \"./MixinExchangeWrapper.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract Forwarder is\n LibConstants,\n MixinWeth,\n MixinAssets,\n MixinExchangeWrapper,\n MixinForwarderCore\n{\n constructor (\n address _exchange,\n bytes memory _zrxAssetData,\n bytes memory _wethAssetData\n )\n public\n LibConstants(\n _exchange,\n _zrxAssetData,\n _wethAssetData\n )\n MixinForwarderCore()\n {}\n}\n",
- "2.0.0/extensions/Forwarder/MixinAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"../../tokens/ERC20Token/IERC20Token.sol\";\nimport \"../../tokens/ERC721Token/IERC721Token.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MAssets.sol\";\n\n\ncontract MixinAssets is\n Ownable,\n LibConstants,\n MAssets\n{\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_TRANSFER_SELECTOR = bytes4(keccak256(\"transfer(address,uint256)\"));\n\n /// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to \n /// function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be\n /// used to withdraw assets that were accidentally sent to this contract.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of ERC20 token to withdraw.\n function withdrawAsset(\n bytes assetData,\n uint256 amount\n )\n external\n onlyOwner\n {\n transferAssetToSender(assetData, amount);\n }\n\n /// @dev Transfers given amount of asset to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferAssetToSender(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n bytes4 proxyId = assetData.readBytes4(0);\n\n if (proxyId == ERC20_DATA_ID) {\n transferERC20Token(assetData, amount);\n } else if (proxyId == ERC721_DATA_ID) {\n transferERC721Token(assetData, amount);\n } else {\n revert(\"UNSUPPORTED_ASSET_PROXY\");\n }\n }\n\n /// @dev Decodes ERC20 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC20Token(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n address token = assetData.readAddress(16);\n\n // Transfer tokens.\n // We do a raw call so we can check the success separate\n // from the return data.\n bool success = token.call(abi.encodeWithSelector(\n ERC20_TRANSFER_SELECTOR,\n msg.sender,\n amount\n ));\n require(\n success,\n \"TRANSFER_FAILED\"\n );\n \n // Check return data.\n // If there is no return data, we assume the token incorrectly\n // does not return a bool. In this case we expect it to revert\n // on failure, which was handled above.\n // If the token does return data, we require that it is a single\n // value that evaluates to true.\n assembly {\n if returndatasize {\n success := 0\n if eq(returndatasize, 32) {\n // First 64 bytes of memory are reserved scratch space\n returndatacopy(0, 0, 32)\n success := mload(0)\n }\n }\n }\n require(\n success,\n \"TRANSFER_FAILED\"\n );\n }\n\n /// @dev Decodes ERC721 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC721Token(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n require(\n amount == 1,\n \"INVALID_AMOUNT\"\n );\n // Decode asset data.\n address token = assetData.readAddress(16);\n uint256 tokenId = assetData.readUint256(36);\n\n // Perform transfer.\n IERC721Token(token).transferFrom(\n address(this),\n msg.sender,\n tokenId\n );\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MExchangeWrapper.sol\";\nimport \"../../protocol/Exchange/libs/LibAbiEncoder.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../protocol/Exchange/libs/LibFillResults.sol\";\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\n\n\ncontract MixinExchangeWrapper is\n LibAbiEncoder,\n LibFillResults,\n LibMath,\n LibConstants,\n MExchangeWrapper\n{\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n // ABI encode calldata for `fillOrder`\n bytes memory fillOrderCalldata = abiEncodeFillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n\n address exchange = address(EXCHANGE);\n\n // Call `fillOrder` and handle any exceptions gracefully\n assembly {\n let success := call(\n gas, // forward all gas\n exchange, // call address of Exchange contract\n 0, // transfer 0 wei\n add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes)\n mload(fillOrderCalldata), // length of input\n fillOrderCalldata, // write output over input\n 128 // output size is 128 bytes\n )\n if success {\n mstore(fillResults, mload(fillOrderCalldata))\n mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32)))\n mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64)))\n mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96)))\n }\n }\n // fillResults values will be 0 by default if call was unsuccessful\n return fillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of WETH has been sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param wethSellAmount Desired amount of WETH to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellWeth(\n LibOrder.Order[] memory orders,\n uint256 wethSellAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // We assume that asset being sold by taker is WETH for each order.\n orders[i].makerAssetData = makerAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of WETH to sell\n uint256 remainingTakerAssetFillAmount = safeSub(wethSellAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of WETH\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= wethSellAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// The asset being sold by taker must always be WETH.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyExactAmountWithWeth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // We assume that asset being sold by taker is WETH for each order.\n orders[i].makerAssetData = makerAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n uint256 makerAssetFilledAmount = totalFillResults.makerAssetFilledAmount;\n if (makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n\n require(\n makerAssetFilledAmount >= makerAssetFillAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return totalFillResults;\n }\n\n /// @dev Buys zrxBuyAmount of ZRX fee tokens, taking into account ZRX fees for each order. This will guarantee\n /// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues).\n /// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX\n /// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases.\n /// The asset being sold by taker must always be WETH. \n /// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset.\n /// @param zrxBuyAmount Desired amount of ZRX to buy.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return totalFillResults Amounts filled and fees paid by maker and taker.\n function marketBuyExactZrxWithWeth(\n LibOrder.Order[] memory orders,\n uint256 zrxBuyAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n // Do nothing if zrxBuyAmount == 0\n if (zrxBuyAmount == 0) {\n return totalFillResults;\n }\n\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n uint256 zrxPurchased = 0;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // All of these are ZRX/WETH, so we can drop the respective assetData from calldata.\n orders[i].makerAssetData = zrxAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of ZRX to buy.\n uint256 remainingZrxBuyAmount = safeSub(zrxBuyAmount, zrxPurchased);\n\n // Convert the remaining amount of ZRX to buy into remaining amount\n // of WETH to sell, assuming entire amount can be sold in the current order.\n uint256 remainingWethSellAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n safeSub(orders[i].makerAssetAmount, orders[i].takerFee), // our exchange rate after fees \n remainingZrxBuyAmount\n );\n\n // Attempt to sell the remaining amount of WETH.\n FillResults memory singleFillResult = fillOrderNoThrow(\n orders[i],\n safeAdd(remainingWethSellAmount, 1), // we add 1 wei to the fill amount to make up for rounding errors\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker.\n addFillResults(totalFillResults, singleFillResult);\n zrxPurchased = safeSub(totalFillResults.makerAssetFilledAmount, totalFillResults.takerFeePaid);\n\n // Stop execution if the entire amount of ZRX has been bought.\n if (zrxPurchased >= zrxBuyAmount) {\n break;\n }\n }\n\n require(\n zrxPurchased >= zrxBuyAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return totalFillResults;\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinForwarderCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MWeth.sol\";\nimport \"./mixins/MAssets.sol\";\nimport \"./mixins/MExchangeWrapper.sol\";\nimport \"./interfaces/IForwarderCore.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../protocol/Exchange/libs/LibFillResults.sol\";\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\n\n\ncontract MixinForwarderCore is\n LibFillResults,\n LibMath,\n LibConstants,\n MWeth,\n MAssets,\n MExchangeWrapper,\n IForwarderCore\n{\n using LibBytes for bytes;\n\n /// @dev Constructor approves ERC20 proxy to transfer ZRX and WETH on this contract's behalf.\n constructor ()\n public\n {\n address proxyAddress = EXCHANGE.getAssetProxy(ERC20_DATA_ID);\n require(\n proxyAddress != address(0),\n \"UNREGISTERED_ASSET_PROXY\"\n );\n ETHER_TOKEN.approve(proxyAddress, MAX_UINT);\n ZRX_TOKEN.approve(proxyAddress, MAX_UINT);\n }\n\n /// @dev Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketSellOrdersWithEth(\n LibOrder.Order[] memory orders,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n FillResults memory orderFillResults,\n FillResults memory feeOrderFillResults\n )\n {\n // Convert ETH to WETH.\n convertEthToWeth();\n\n uint256 wethSellAmount;\n uint256 zrxBuyAmount;\n uint256 makerAssetAmountPurchased;\n if (orders[0].makerAssetData.equals(ZRX_ASSET_DATA)) {\n // Calculate amount of WETH that won't be spent on ETH fees.\n wethSellAmount = getPartialAmountFloor(\n PERCENTAGE_DENOMINATOR,\n safeAdd(PERCENTAGE_DENOMINATOR, feePercentage),\n msg.value\n );\n // Market sell available WETH.\n // ZRX fees are paid with this contract's balance.\n orderFillResults = marketSellWeth(\n orders,\n wethSellAmount,\n signatures\n );\n // The fee amount must be deducted from the amount transfered back to sender.\n makerAssetAmountPurchased = safeSub(orderFillResults.makerAssetFilledAmount, orderFillResults.takerFeePaid);\n } else {\n // 5% of WETH is reserved for filling feeOrders and paying feeRecipient.\n wethSellAmount = getPartialAmountFloor(\n MAX_WETH_FILL_PERCENTAGE,\n PERCENTAGE_DENOMINATOR,\n msg.value\n );\n // Market sell 95% of WETH.\n // ZRX fees are payed with this contract's balance.\n orderFillResults = marketSellWeth(\n orders,\n wethSellAmount,\n signatures\n );\n // Buy back all ZRX spent on fees.\n zrxBuyAmount = orderFillResults.takerFeePaid;\n feeOrderFillResults = marketBuyExactZrxWithWeth(\n feeOrders,\n zrxBuyAmount,\n feeSignatures\n );\n makerAssetAmountPurchased = orderFillResults.makerAssetFilledAmount;\n }\n\n // Transfer feePercentage of total ETH spent on primary orders to feeRecipient.\n // Refund remaining ETH to msg.sender.\n transferEthFeeAndRefund(\n orderFillResults.takerAssetFilledAmount,\n feeOrderFillResults.takerAssetFilledAmount,\n feePercentage,\n feeRecipient\n );\n\n // Transfer purchased assets to msg.sender.\n transferAssetToSender(orders[0].makerAssetData, makerAssetAmountPurchased);\n }\n\n /// @dev Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param makerAssetFillAmount Desired amount of makerAsset to purchase.\n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketBuyOrdersWithEth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n FillResults memory orderFillResults,\n FillResults memory feeOrderFillResults\n )\n {\n // Convert ETH to WETH.\n convertEthToWeth();\n\n uint256 zrxBuyAmount;\n uint256 makerAssetAmountPurchased;\n if (orders[0].makerAssetData.equals(ZRX_ASSET_DATA)) {\n // If the makerAsset is ZRX, it is not necessary to pay fees out of this\n // contracts's ZRX balance because fees are factored into the price of the order.\n orderFillResults = marketBuyExactZrxWithWeth(\n orders,\n makerAssetFillAmount,\n signatures\n );\n // The fee amount must be deducted from the amount transfered back to sender.\n makerAssetAmountPurchased = safeSub(orderFillResults.makerAssetFilledAmount, orderFillResults.takerFeePaid);\n } else {\n // Attemp to purchase desired amount of makerAsset.\n // ZRX fees are payed with this contract's balance.\n orderFillResults = marketBuyExactAmountWithWeth(\n orders,\n makerAssetFillAmount,\n signatures\n );\n // Buy back all ZRX spent on fees.\n zrxBuyAmount = orderFillResults.takerFeePaid;\n feeOrderFillResults = marketBuyExactZrxWithWeth(\n feeOrders,\n zrxBuyAmount,\n feeSignatures\n );\n makerAssetAmountPurchased = orderFillResults.makerAssetFilledAmount;\n }\n\n // Transfer feePercentage of total ETH spent on primary orders to feeRecipient.\n // Refund remaining ETH to msg.sender.\n transferEthFeeAndRefund(\n orderFillResults.takerAssetFilledAmount,\n feeOrderFillResults.takerAssetFilledAmount,\n feePercentage,\n feeRecipient\n );\n\n // Transfer purchased assets to msg.sender.\n transferAssetToSender(orders[0].makerAssetData, makerAssetAmountPurchased);\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinWeth.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MWeth.sol\";\n\n\ncontract MixinWeth is\n LibMath,\n LibConstants,\n MWeth\n{\n /// @dev Default payabale function, this allows us to withdraw WETH\n function ()\n public\n payable\n {\n require(\n msg.sender == address(ETHER_TOKEN),\n \"DEFAULT_FUNCTION_WETH_CONTRACT_ONLY\"\n );\n }\n\n /// @dev Converts message call's ETH value into WETH.\n function convertEthToWeth()\n internal\n {\n require(\n msg.value > 0,\n \"INVALID_MSG_VALUE\"\n );\n ETHER_TOKEN.deposit.value(msg.value)();\n }\n\n /// @dev Transfers feePercentage of WETH spent on primary orders to feeRecipient.\n /// Refunds any excess ETH to msg.sender.\n /// @param wethSoldExcludingFeeOrders Amount of WETH sold when filling primary orders.\n /// @param wethSoldForZrx Amount of WETH sold when purchasing ZRX required for primary order fees.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n function transferEthFeeAndRefund(\n uint256 wethSoldExcludingFeeOrders,\n uint256 wethSoldForZrx,\n uint256 feePercentage,\n address feeRecipient\n )\n internal\n {\n // Ensure feePercentage is less than 5%.\n require(\n feePercentage <= MAX_FEE_PERCENTAGE,\n \"FEE_PERCENTAGE_TOO_LARGE\"\n );\n\n // Ensure that no extra WETH owned by this contract has been sold.\n uint256 wethSold = safeAdd(wethSoldExcludingFeeOrders, wethSoldForZrx);\n require(\n wethSold <= msg.value,\n \"OVERSOLD_WETH\"\n );\n\n // Calculate amount of WETH that hasn't been sold.\n uint256 wethRemaining = safeSub(msg.value, wethSold);\n\n // Calculate ETH fee to pay to feeRecipient.\n uint256 ethFee = getPartialAmountFloor(\n feePercentage,\n PERCENTAGE_DENOMINATOR,\n wethSoldExcludingFeeOrders\n );\n\n // Ensure fee is less than amount of WETH remaining.\n require(\n ethFee <= wethRemaining,\n \"INSUFFICIENT_ETH_REMAINING\"\n );\n \n // Do nothing if no WETH remaining\n if (wethRemaining > 0) {\n // Convert remaining WETH to ETH\n ETHER_TOKEN.withdraw(wethRemaining);\n\n // Pay ETH to feeRecipient\n if (ethFee > 0) {\n feeRecipient.transfer(ethFee);\n }\n\n // Refund remaining ETH to msg.sender.\n uint256 ethRefund = safeSub(wethRemaining, ethFee);\n if (ethRefund > 0) {\n msg.sender.transfer(ethRefund);\n }\n }\n }\n}\n",
- "2.0.0/extensions/Forwarder/interfaces/IAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IAssets {\n\n /// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to \n /// function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be\n /// used to withdraw assets that were accidentally sent to this contract.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of ERC20 token to withdraw.\n function withdrawAsset(\n bytes assetData,\n uint256 amount\n )\n external;\n}\n",
- "2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../../protocol/Exchange/libs/LibFillResults.sol\";\n\n\ncontract IForwarderCore {\n\n /// @dev Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketSellOrdersWithEth(\n LibOrder.Order[] memory orders,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n LibFillResults.FillResults memory orderFillResults,\n LibFillResults.FillResults memory feeOrderFillResults\n );\n\n /// @dev Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param makerAssetFillAmount Desired amount of makerAsset to purchase.\n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketBuyOrdersWithEth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n LibFillResults.FillResults memory orderFillResults,\n LibFillResults.FillResults memory feeOrderFillResults\n );\n}\n",
- "2.0.0/extensions/Forwarder/libs/LibConstants.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/LibBytes/LibBytes.sol\";\nimport \"../../../protocol/Exchange/interfaces/IExchange.sol\";\nimport \"../../../tokens/EtherToken/IEtherToken.sol\";\nimport \"../../../tokens/ERC20Token/IERC20Token.sol\";\n\n\ncontract LibConstants {\n\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n uint256 constant internal MAX_UINT = 2**256 - 1;\n uint256 constant internal PERCENTAGE_DENOMINATOR = 10**18; \n uint256 constant internal MAX_FEE_PERCENTAGE = 5 * PERCENTAGE_DENOMINATOR / 100; // 5%\n uint256 constant internal MAX_WETH_FILL_PERCENTAGE = 95 * PERCENTAGE_DENOMINATOR / 100; // 95%\n \n // solhint-disable var-name-mixedcase\n IExchange internal EXCHANGE;\n IEtherToken internal ETHER_TOKEN;\n IERC20Token internal ZRX_TOKEN;\n bytes internal ZRX_ASSET_DATA;\n bytes internal WETH_ASSET_DATA;\n // solhint-enable var-name-mixedcase\n\n constructor (\n address _exchange,\n bytes memory _zrxAssetData,\n bytes memory _wethAssetData\n )\n public\n {\n EXCHANGE = IExchange(_exchange);\n ZRX_ASSET_DATA = _zrxAssetData;\n WETH_ASSET_DATA = _wethAssetData;\n\n address etherToken = _wethAssetData.readAddress(16);\n address zrxToken = _zrxAssetData.readAddress(16);\n ETHER_TOKEN = IEtherToken(etherToken);\n ZRX_TOKEN = IERC20Token(zrxToken);\n }\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAssets.sol\";\n\n\ncontract MAssets is\n IAssets\n{\n /// @dev Transfers given amount of asset to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferAssetToSender(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n\n /// @dev Decodes ERC20 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC20Token(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n\n /// @dev Decodes ERC721 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC721Token(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../../protocol/Exchange/libs/LibFillResults.sol\";\n\n\ncontract MExchangeWrapper {\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of WETH has been sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param wethSellAmount Desired amount of WETH to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellWeth(\n LibOrder.Order[] memory orders,\n uint256 wethSellAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// The asset being sold by taker must always be WETH.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyExactAmountWithWeth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Buys zrxBuyAmount of ZRX fee tokens, taking into account ZRX fees for each order. This will guarantee\n /// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues).\n /// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX\n /// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases.\n /// The asset being sold by taker must always be WETH. \n /// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset.\n /// @param zrxBuyAmount Desired amount of ZRX to buy.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return totalFillResults Amounts filled and fees paid by maker and taker.\n function marketBuyExactZrxWithWeth(\n LibOrder.Order[] memory orders,\n uint256 zrxBuyAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MWeth.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract MWeth {\n\n /// @dev Converts message call's ETH value into WETH.\n function convertEthToWeth()\n internal;\n\n /// @dev Transfers feePercentage of WETH spent on primary orders to feeRecipient.\n /// Refunds any excess ETH to msg.sender.\n /// @param wethSoldExcludingFeeOrders Amount of WETH sold when filling primary orders.\n /// @param wethSoldForZrx Amount of WETH sold when purchasing ZRX required for primary order fees.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n function transferEthFeeAndRefund(\n uint256 wethSoldExcludingFeeOrders,\n uint256 wethSoldForZrx,\n uint256 feePercentage,\n address feeRecipient\n )\n internal;\n}\n",
- "2.0.0/extensions/OrderValidator/OrderValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../protocol/Exchange/interfaces/IExchange.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../tokens/ERC20Token/IERC20Token.sol\";\nimport \"../../tokens/ERC721Token/IERC721Token.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\n\n\ncontract OrderValidator {\n\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n\n struct TraderInfo {\n uint256 makerBalance; // Maker's balance of makerAsset\n uint256 makerAllowance; // Maker's allowance to corresponding AssetProxy\n uint256 takerBalance; // Taker's balance of takerAsset\n uint256 takerAllowance; // Taker's allowance to corresponding AssetProxy\n uint256 makerZrxBalance; // Maker's balance of ZRX\n uint256 makerZrxAllowance; // Maker's allowance of ZRX to ERC20Proxy\n uint256 takerZrxBalance; // Taker's balance of ZRX\n uint256 takerZrxAllowance; // Taker's allowance of ZRX to ERC20Proxy\n }\n\n // solhint-disable var-name-mixedcase\n IExchange internal EXCHANGE;\n bytes internal ZRX_ASSET_DATA;\n // solhint-enable var-name-mixedcase\n\n constructor (address _exchange, bytes memory _zrxAssetData)\n public\n {\n EXCHANGE = IExchange(_exchange);\n ZRX_ASSET_DATA = _zrxAssetData;\n }\n\n /// @dev Fetches information for order and maker/taker of order.\n /// @param order The order structure.\n /// @param takerAddress Address that will be filling the order.\n /// @return OrderInfo and TraderInfo instances for given order.\n function getOrderAndTraderInfo(LibOrder.Order memory order, address takerAddress)\n public\n view\n returns (LibOrder.OrderInfo memory orderInfo, TraderInfo memory traderInfo)\n {\n orderInfo = EXCHANGE.getOrderInfo(order);\n traderInfo = getTraderInfo(order, takerAddress);\n return (orderInfo, traderInfo);\n }\n\n /// @dev Fetches information for all passed in orders and the makers/takers of each order.\n /// @param orders Array of order specifications.\n /// @param takerAddresses Array of taker addresses corresponding to each order.\n /// @return Arrays of OrderInfo and TraderInfo instances that correspond to each order.\n function getOrdersAndTradersInfo(LibOrder.Order[] memory orders, address[] memory takerAddresses)\n public\n view\n returns (LibOrder.OrderInfo[] memory ordersInfo, TraderInfo[] memory tradersInfo)\n {\n ordersInfo = EXCHANGE.getOrdersInfo(orders);\n tradersInfo = getTradersInfo(orders, takerAddresses);\n return (ordersInfo, tradersInfo);\n }\n\n /// @dev Fetches balance and allowances for maker and taker of order.\n /// @param order The order structure.\n /// @param takerAddress Address that will be filling the order.\n /// @return Balances and allowances of maker and taker of order.\n function getTraderInfo(LibOrder.Order memory order, address takerAddress)\n public\n view\n returns (TraderInfo memory traderInfo)\n {\n (traderInfo.makerBalance, traderInfo.makerAllowance) = getBalanceAndAllowance(order.makerAddress, order.makerAssetData);\n (traderInfo.takerBalance, traderInfo.takerAllowance) = getBalanceAndAllowance(takerAddress, order.takerAssetData);\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n (traderInfo.makerZrxBalance, traderInfo.makerZrxAllowance) = getBalanceAndAllowance(order.makerAddress, zrxAssetData);\n (traderInfo.takerZrxBalance, traderInfo.takerZrxAllowance) = getBalanceAndAllowance(takerAddress, zrxAssetData);\n return traderInfo;\n }\n\n /// @dev Fetches balances and allowances of maker and taker for each provided order.\n /// @param orders Array of order specifications.\n /// @param takerAddresses Array of taker addresses corresponding to each order.\n /// @return Array of balances and allowances for maker and taker of each order.\n function getTradersInfo(LibOrder.Order[] memory orders, address[] memory takerAddresses)\n public\n view\n returns (TraderInfo[] memory)\n {\n uint256 ordersLength = orders.length;\n TraderInfo[] memory tradersInfo = new TraderInfo[](ordersLength);\n for (uint256 i = 0; i != ordersLength; i++) {\n tradersInfo[i] = getTraderInfo(orders[i], takerAddresses[i]);\n }\n return tradersInfo;\n }\n\n /// @dev Fetches token balances and allowances of an address to given assetProxy. Supports ERC20 and ERC721.\n /// @param target Address to fetch balances and allowances of.\n /// @param assetData Encoded data that can be decoded by a specified proxy contract when transferring asset.\n /// @return Balance of asset and allowance set to given proxy of asset.\n /// For ERC721 tokens, these values will always be 1 or 0.\n function getBalanceAndAllowance(address target, bytes memory assetData)\n public\n view\n returns (uint256 balance, uint256 allowance)\n {\n bytes4 assetProxyId = assetData.readBytes4(0);\n address token = assetData.readAddress(16);\n address assetProxy = EXCHANGE.getAssetProxy(assetProxyId);\n\n if (assetProxyId == ERC20_DATA_ID) {\n // Query balance\n balance = IERC20Token(token).balanceOf(target);\n\n // Query allowance\n allowance = IERC20Token(token).allowance(target, assetProxy);\n } else if (assetProxyId == ERC721_DATA_ID) {\n uint256 tokenId = assetData.readUint256(36);\n\n // Query owner of tokenId\n address owner = getERC721TokenOwner(token, tokenId);\n\n // Set balance to 1 if tokenId is owned by target\n balance = target == owner ? 1 : 0;\n\n // Check if ERC721Proxy is approved to spend tokenId\n bool isApproved = IERC721Token(token).isApprovedForAll(target, assetProxy) || IERC721Token(token).getApproved(tokenId) == assetProxy;\n \n // Set alowance to 1 if ERC721Proxy is approved to spend tokenId\n allowance = isApproved ? 1 : 0;\n } else {\n revert(\"UNSUPPORTED_ASSET_PROXY\");\n }\n return (balance, allowance);\n }\n\n /// @dev Fetches token balances and allowances of an address for each given assetProxy. Supports ERC20 and ERC721.\n /// @param target Address to fetch balances and allowances of.\n /// @param assetData Array of encoded byte arrays that can be decoded by a specified proxy contract when transferring asset.\n /// @return Balances and allowances of assets.\n /// For ERC721 tokens, these values will always be 1 or 0.\n function getBalancesAndAllowances(address target, bytes[] memory assetData)\n public\n view\n returns (uint256[] memory, uint256[] memory)\n {\n uint256 length = assetData.length;\n uint256[] memory balances = new uint256[](length);\n uint256[] memory allowances = new uint256[](length);\n for (uint256 i = 0; i != length; i++) {\n (balances[i], allowances[i]) = getBalanceAndAllowance(target, assetData[i]);\n }\n return (balances, allowances);\n }\n\n /// @dev Calls `token.ownerOf(tokenId)`, but returns a null owner instead of reverting on an unowned token.\n /// @param token Address of ERC721 token.\n /// @param tokenId The identifier for the specific NFT.\n /// @return Owner of tokenId or null address if unowned.\n function getERC721TokenOwner(address token, uint256 tokenId)\n public\n view\n returns (address owner)\n {\n assembly {\n // load free memory pointer\n let cdStart := mload(64)\n\n // bytes4(keccak256(ownerOf(uint256))) = 0x6352211e\n mstore(cdStart, 0x6352211e00000000000000000000000000000000000000000000000000000000)\n mstore(add(cdStart, 4), tokenId)\n\n // staticcall `ownerOf(tokenId)`\n // `ownerOf` will revert if tokenId is not owned\n let success := staticcall(\n gas, // forward all gas\n token, // call token contract\n cdStart, // start of calldata\n 36, // length of input is 36 bytes\n cdStart, // write output over input\n 32 // size of output is 32 bytes\n )\n\n // Success implies that tokenId is owned\n // Copy owner from return data if successful\n if success {\n owner := mload(cdStart)\n } \n }\n\n // Owner initialized to address(0), no need to modify if call is unsuccessful\n return owner;\n }\n}\n",
- "2.0.0/multisig/MultiSigWallet.sol": "// solhint-disable\npragma solidity ^0.4.15;\n\n\n/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.\n/// @author Stefan George - <stefan.george@consensys.net>\ncontract MultiSigWallet {\n\n /*\n * Events\n */\n event Confirmation(address indexed sender, uint indexed transactionId);\n event Revocation(address indexed sender, uint indexed transactionId);\n event Submission(uint indexed transactionId);\n event Execution(uint indexed transactionId);\n event ExecutionFailure(uint indexed transactionId);\n event Deposit(address indexed sender, uint value);\n event OwnerAddition(address indexed owner);\n event OwnerRemoval(address indexed owner);\n event RequirementChange(uint required);\n\n /*\n * Constants\n */\n uint constant public MAX_OWNER_COUNT = 50;\n\n /*\n * Storage\n */\n mapping (uint => Transaction) public transactions;\n mapping (uint => mapping (address => bool)) public confirmations;\n mapping (address => bool) public isOwner;\n address[] public owners;\n uint public required;\n uint public transactionCount;\n\n struct Transaction {\n address destination;\n uint value;\n bytes data;\n bool executed;\n }\n\n /*\n * Modifiers\n */\n modifier onlyWallet() {\n require(msg.sender == address(this));\n _;\n }\n\n modifier ownerDoesNotExist(address owner) {\n require(!isOwner[owner]);\n _;\n }\n\n modifier ownerExists(address owner) {\n require(isOwner[owner]);\n _;\n }\n\n modifier transactionExists(uint transactionId) {\n require(transactions[transactionId].destination != 0);\n _;\n }\n\n modifier confirmed(uint transactionId, address owner) {\n require(confirmations[transactionId][owner]);\n _;\n }\n\n modifier notConfirmed(uint transactionId, address owner) {\n require(!confirmations[transactionId][owner]);\n _;\n }\n\n modifier notExecuted(uint transactionId) {\n require(!transactions[transactionId].executed);\n _;\n }\n\n modifier notNull(address _address) {\n require(_address != 0);\n _;\n }\n\n modifier validRequirement(uint ownerCount, uint _required) {\n require(ownerCount <= MAX_OWNER_COUNT\n && _required <= ownerCount\n && _required != 0\n && ownerCount != 0);\n _;\n }\n\n /// @dev Fallback function allows to deposit ether.\n function()\n payable\n {\n if (msg.value > 0)\n Deposit(msg.sender, msg.value);\n }\n\n /*\n * Public functions\n */\n /// @dev Contract constructor sets initial owners and required number of confirmations.\n /// @param _owners List of initial owners.\n /// @param _required Number of required confirmations.\n function MultiSigWallet(address[] _owners, uint _required)\n public\n validRequirement(_owners.length, _required)\n {\n for (uint i=0; i<_owners.length; i++) {\n require(!isOwner[_owners[i]] && _owners[i] != 0);\n isOwner[_owners[i]] = true;\n }\n owners = _owners;\n required = _required;\n }\n\n /// @dev Allows to add a new owner. Transaction has to be sent by wallet.\n /// @param owner Address of new owner.\n function addOwner(address owner)\n public\n onlyWallet\n ownerDoesNotExist(owner)\n notNull(owner)\n validRequirement(owners.length + 1, required)\n {\n isOwner[owner] = true;\n owners.push(owner);\n OwnerAddition(owner);\n }\n\n /// @dev Allows to remove an owner. Transaction has to be sent by wallet.\n /// @param owner Address of owner.\n function removeOwner(address owner)\n public\n onlyWallet\n ownerExists(owner)\n {\n isOwner[owner] = false;\n for (uint i=0; i<owners.length - 1; i++)\n if (owners[i] == owner) {\n owners[i] = owners[owners.length - 1];\n break;\n }\n owners.length -= 1;\n if (required > owners.length)\n changeRequirement(owners.length);\n OwnerRemoval(owner);\n }\n\n /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet.\n /// @param owner Address of owner to be replaced.\n /// @param newOwner Address of new owner.\n function replaceOwner(address owner, address newOwner)\n public\n onlyWallet\n ownerExists(owner)\n ownerDoesNotExist(newOwner)\n {\n for (uint i=0; i<owners.length; i++)\n if (owners[i] == owner) {\n owners[i] = newOwner;\n break;\n }\n isOwner[owner] = false;\n isOwner[newOwner] = true;\n OwnerRemoval(owner);\n OwnerAddition(newOwner);\n }\n\n /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet.\n /// @param _required Number of required confirmations.\n function changeRequirement(uint _required)\n public\n onlyWallet\n validRequirement(owners.length, _required)\n {\n required = _required;\n RequirementChange(_required);\n }\n\n /// @dev Allows an owner to submit and confirm a transaction.\n /// @param destination Transaction target address.\n /// @param value Transaction ether value.\n /// @param data Transaction data payload.\n /// @return Returns transaction ID.\n function submitTransaction(address destination, uint value, bytes data)\n public\n returns (uint transactionId)\n {\n transactionId = addTransaction(destination, value, data);\n confirmTransaction(transactionId);\n }\n\n /// @dev Allows an owner to confirm a transaction.\n /// @param transactionId Transaction ID.\n function confirmTransaction(uint transactionId)\n public\n ownerExists(msg.sender)\n transactionExists(transactionId)\n notConfirmed(transactionId, msg.sender)\n {\n confirmations[transactionId][msg.sender] = true;\n Confirmation(msg.sender, transactionId);\n executeTransaction(transactionId);\n }\n\n /// @dev Allows an owner to revoke a confirmation for a transaction.\n /// @param transactionId Transaction ID.\n function revokeConfirmation(uint transactionId)\n public\n ownerExists(msg.sender)\n confirmed(transactionId, msg.sender)\n notExecuted(transactionId)\n {\n confirmations[transactionId][msg.sender] = false;\n Revocation(msg.sender, transactionId);\n }\n\n /// @dev Allows anyone to execute a confirmed transaction.\n /// @param transactionId Transaction ID.\n function executeTransaction(uint transactionId)\n public\n ownerExists(msg.sender)\n confirmed(transactionId, msg.sender)\n notExecuted(transactionId)\n {\n if (isConfirmed(transactionId)) {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data))\n Execution(transactionId);\n else {\n ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n }\n\n // call has been separated into its own function in order to take advantage\n // of the Solidity's code generator to produce a loop that copies tx.data into memory.\n function external_call(address destination, uint value, uint dataLength, bytes data) internal returns (bool) {\n bool result;\n assembly {\n let x := mload(0x40) // \"Allocate\" memory for output (0x40 is where \"free memory\" pointer is stored by convention)\n let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that\n result := call(\n sub(gas, 34710), // 34710 is the value that solidity is currently emitting\n // It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) +\n // callNewAccountGas (25000, in case the destination address does not exist and needs creating)\n destination,\n value,\n d,\n dataLength, // Size of the input (in bytes) - this is what fixes the padding problem\n x,\n 0 // Output is ignored, therefore the output size is zero\n )\n }\n return result;\n }\n\n /// @dev Returns the confirmation status of a transaction.\n /// @param transactionId Transaction ID.\n /// @return Confirmation status.\n function isConfirmed(uint transactionId)\n public\n constant\n returns (bool)\n {\n uint count = 0;\n for (uint i=0; i<owners.length; i++) {\n if (confirmations[transactionId][owners[i]])\n count += 1;\n if (count == required)\n return true;\n }\n }\n\n /*\n * Internal functions\n */\n /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet.\n /// @param destination Transaction target address.\n /// @param value Transaction ether value.\n /// @param data Transaction data payload.\n /// @return Returns transaction ID.\n function addTransaction(address destination, uint value, bytes data)\n internal\n notNull(destination)\n returns (uint transactionId)\n {\n transactionId = transactionCount;\n transactions[transactionId] = Transaction({\n destination: destination,\n value: value,\n data: data,\n executed: false\n });\n transactionCount += 1;\n Submission(transactionId);\n }\n\n /*\n * Web3 call functions\n */\n /// @dev Returns number of confirmations of a transaction.\n /// @param transactionId Transaction ID.\n /// @return Number of confirmations.\n function getConfirmationCount(uint transactionId)\n public\n constant\n returns (uint count)\n {\n for (uint i=0; i<owners.length; i++)\n if (confirmations[transactionId][owners[i]])\n count += 1;\n }\n\n /// @dev Returns total number of transactions after filers are applied.\n /// @param pending Include pending transactions.\n /// @param executed Include executed transactions.\n /// @return Total number of transactions after filters are applied.\n function getTransactionCount(bool pending, bool executed)\n public\n constant\n returns (uint count)\n {\n for (uint i=0; i<transactionCount; i++)\n if ( pending && !transactions[i].executed\n || executed && transactions[i].executed)\n count += 1;\n }\n\n /// @dev Returns list of owners.\n /// @return List of owner addresses.\n function getOwners()\n public\n constant\n returns (address[])\n {\n return owners;\n }\n\n /// @dev Returns array with owner addresses, which confirmed transaction.\n /// @param transactionId Transaction ID.\n /// @return Returns array of owner addresses.\n function getConfirmations(uint transactionId)\n public\n constant\n returns (address[] _confirmations)\n {\n address[] memory confirmationsTemp = new address[](owners.length);\n uint count = 0;\n uint i;\n for (i=0; i<owners.length; i++)\n if (confirmations[transactionId][owners[i]]) {\n confirmationsTemp[count] = owners[i];\n count += 1;\n }\n _confirmations = new address[](count);\n for (i=0; i<count; i++)\n _confirmations[i] = confirmationsTemp[i];\n }\n\n /// @dev Returns list of transaction IDs in defined range.\n /// @param from Index start position of transaction array.\n /// @param to Index end position of transaction array.\n /// @param pending Include pending transactions.\n /// @param executed Include executed transactions.\n /// @return Returns array of transaction IDs.\n function getTransactionIds(uint from, uint to, bool pending, bool executed)\n public\n constant\n returns (uint[] _transactionIds)\n {\n uint[] memory transactionIdsTemp = new uint[](transactionCount);\n uint count = 0;\n uint i;\n for (i=0; i<transactionCount; i++)\n if ( pending && !transactions[i].executed\n || executed && transactions[i].executed)\n {\n transactionIdsTemp[count] = i;\n count += 1;\n }\n _transactionIds = new uint[](to - from);\n for (i=from; i<to; i++)\n _transactionIds[i - from] = transactionIdsTemp[i];\n }\n}",
- "2.0.0/multisig/MultiSigWalletWithTimeLock.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MultiSigWallet.sol\";\n\n\n/// @title Multisignature wallet with time lock- Allows multiple parties to execute a transaction after a time lock has passed.\n/// @author Amir Bandeali - <amir@0xProject.com>\n// solhint-disable not-rely-on-time\ncontract MultiSigWalletWithTimeLock is\n MultiSigWallet\n{\n event ConfirmationTimeSet(uint256 indexed transactionId, uint256 confirmationTime);\n event TimeLockChange(uint256 secondsTimeLocked);\n\n uint256 public secondsTimeLocked;\n\n mapping (uint256 => uint256) public confirmationTimes;\n\n modifier notFullyConfirmed(uint256 transactionId) {\n require(\n !isConfirmed(transactionId),\n \"TX_FULLY_CONFIRMED\"\n );\n _;\n }\n\n modifier fullyConfirmed(uint256 transactionId) {\n require(\n isConfirmed(transactionId),\n \"TX_NOT_FULLY_CONFIRMED\"\n );\n _;\n }\n\n modifier pastTimeLock(uint256 transactionId) {\n require(\n block.timestamp >= confirmationTimes[transactionId] + secondsTimeLocked,\n \"TIME_LOCK_INCOMPLETE\"\n );\n _;\n }\n\n /// @dev Contract constructor sets initial owners, required number of confirmations, and time lock.\n /// @param _owners List of initial owners.\n /// @param _required Number of required confirmations.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n constructor (\n address[] _owners,\n uint256 _required,\n uint256 _secondsTimeLocked\n )\n public\n MultiSigWallet(_owners, _required)\n {\n secondsTimeLocked = _secondsTimeLocked;\n }\n\n /// @dev Changes the duration of the time lock for transactions.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n function changeTimeLock(uint256 _secondsTimeLocked)\n public\n onlyWallet\n {\n secondsTimeLocked = _secondsTimeLocked;\n emit TimeLockChange(_secondsTimeLocked);\n }\n\n /// @dev Allows an owner to confirm a transaction.\n /// @param transactionId Transaction ID.\n function confirmTransaction(uint256 transactionId)\n public\n ownerExists(msg.sender)\n transactionExists(transactionId)\n notConfirmed(transactionId, msg.sender)\n notFullyConfirmed(transactionId)\n {\n confirmations[transactionId][msg.sender] = true;\n emit Confirmation(msg.sender, transactionId);\n if (isConfirmed(transactionId)) {\n setConfirmationTime(transactionId, block.timestamp);\n }\n }\n\n /// @dev Allows anyone to execute a confirmed transaction.\n /// @param transactionId Transaction ID.\n function executeTransaction(uint256 transactionId)\n public\n notExecuted(transactionId)\n fullyConfirmed(transactionId)\n pastTimeLock(transactionId)\n {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) {\n emit Execution(transactionId);\n } else {\n emit ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n\n /// @dev Sets the time of when a submission first passed.\n function setConfirmationTime(uint256 transactionId, uint256 confirmationTime)\n internal\n {\n confirmationTimes[transactionId] = confirmationTime;\n emit ConfirmationTimeSet(transactionId, confirmationTime);\n }\n}\n",
- "2.0.0/protocol/AssetProxy/ERC20Proxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MixinAuthorizable.sol\";\n\n\ncontract ERC20Proxy is\n MixinAuthorizable\n{\n // Id of this proxy.\n bytes4 constant internal PROXY_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n \n // solhint-disable-next-line payable-fallback\n function () \n external\n {\n assembly {\n // The first 4 bytes of calldata holds the function selector\n let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)\n\n // `transferFrom` will be called with the following parameters:\n // assetData Encoded byte array.\n // from Address to transfer asset from.\n // to Address to transfer asset to.\n // amount Amount of asset to transfer.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {\n\n // To lookup a value in a mapping, we load from the storage location keccak256(k, p),\n // where k is the key left padded to 32 bytes and p is the storage slot\n let start := mload(64)\n mstore(start, and(caller, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(start, 32), authorized_slot)\n\n // Revert if authorized[msg.sender] == false\n if iszero(sload(keccak256(start, 64))) {\n // Revert with `Error(\"SENDER_NOT_AUTHORIZED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // `transferFrom`.\n // The function is marked `external`, so no abi decodeding is done for\n // us. Instead, we expect the `calldata` memory to contain the\n // following:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n //\n // (*): offset is computed from start of function parameters, so offset\n // by an additional 4 bytes in the calldata.\n //\n // (**): see table below to compute length of assetData Contents\n //\n // WARNING: The ABIv2 specification allows additional padding between\n // the Params and Data section. This will result in a larger\n // offset to assetData.\n\n // Asset data itself is encoded as follows:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 1 * 32 | function parameters: |\n // | | 4 | 12 + 20 | 1. token address |\n\n // We construct calldata for the `token.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 4 | | 1. from |\n // | | 36 | | 2. to |\n // | | 68 | | 3. amount |\n\n /////// Read token address from calldata ///////\n // * The token address is stored in `assetData`.\n //\n // * The \"offset to assetData\" is stored at offset 4 in the calldata (table 1).\n // [assetDataOffsetFromParams = calldataload(4)]\n //\n // * Notes that the \"offset to assetData\" is relative to the \"Params\" area of calldata;\n // add 4 bytes to account for the length of the \"Header\" area (table 1).\n // [assetDataOffsetFromHeader = assetDataOffsetFromParams + 4]\n //\n // * The \"token address\" is offset 32+4=36 bytes into \"assetData\" (tables 1 & 2).\n // [tokenOffset = assetDataOffsetFromHeader + 36 = calldataload(4) + 4 + 36]\n let token := calldataload(add(calldataload(4), 40))\n \n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFrom` selector.\n // Any trailing data in transferFromSelector will be\n // overwritten in the next `mstore` call.\n mstore(0, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // We copy the fields `from`, `to` and `amount` in bulk\n // from our own calldata to the new calldata.\n calldatacopy(4, 36, 96)\n\n /////// Call `token.transferFrom` using the calldata ///////\n let success := call(\n gas, // forward all gas\n token, // call address of token contract\n 0, // don't send any ETH\n 0, // pointer to start of input\n 100, // length of input\n 0, // write output over input\n 32 // output size should be 32 bytes\n )\n\n /////// Check return data. ///////\n // If there is no return data, we assume the token incorrectly\n // does not return a bool. In this case we expect it to revert\n // on failure, which was handled above.\n // If the token does return data, we require that it is a single\n // nonzero 32 bytes value.\n // So the transfer succeeded if the call succeeded and either\n // returned nothing, or returned a non-zero 32 byte value. \n success := and(success, or(\n iszero(returndatasize),\n and(\n eq(returndatasize, 32),\n gt(mload(0), 0)\n )\n ))\n if success {\n return(0, 0)\n }\n \n // Revert with `Error(\"TRANSFER_FAILED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // Revert if undefined function is called\n revert(0, 0)\n }\n }\n\n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4)\n {\n return PROXY_ID;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/ERC721Proxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MixinAuthorizable.sol\";\n\n\ncontract ERC721Proxy is\n MixinAuthorizable\n{\n // Id of this proxy.\n bytes4 constant internal PROXY_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n\n // solhint-disable-next-line payable-fallback\n function () \n external\n {\n assembly {\n // The first 4 bytes of calldata holds the function selector\n let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)\n\n // `transferFrom` will be called with the following parameters:\n // assetData Encoded byte array.\n // from Address to transfer asset from.\n // to Address to transfer asset to.\n // amount Amount of asset to transfer.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {\n\n // To lookup a value in a mapping, we load from the storage location keccak256(k, p),\n // where k is the key left padded to 32 bytes and p is the storage slot\n let start := mload(64)\n mstore(start, and(caller, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(start, 32), authorized_slot)\n\n // Revert if authorized[msg.sender] == false\n if iszero(sload(keccak256(start, 64))) {\n // Revert with `Error(\"SENDER_NOT_AUTHORIZED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // `transferFrom`.\n // The function is marked `external`, so no abi decodeding is done for\n // us. Instead, we expect the `calldata` memory to contain the\n // following:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n //\n // (*): offset is computed from start of function parameters, so offset\n // by an additional 4 bytes in the calldata.\n //\n // (**): see table below to compute length of assetData Contents\n //\n // WARNING: The ABIv2 specification allows additional padding between\n // the Params and Data section. This will result in a larger\n // offset to assetData.\n\n // Asset data itself is encoded as follows:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 2 * 32 | function parameters: |\n // | | 4 | 12 + 20 | 1. token address |\n // | | 36 | | 2. tokenId |\n \n // We construct calldata for the `token.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n // \n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 4 | | 1. from |\n // | | 36 | | 2. to |\n // | | 68 | | 3. tokenId |\n\n // There exists only 1 of each token.\n // require(amount == 1, \"INVALID_AMOUNT\")\n if sub(calldataload(100), 1) {\n // Revert with `Error(\"INVALID_AMOUNT\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000e494e56414c49445f414d4f554e540000000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFrom` selector.\n // Any trailing data in transferFromSelector will be\n // overwritten in the next `mstore` call.\n mstore(0, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // We copy the fields `from` and `to` in bulk\n // from our own calldata to the new calldata.\n calldatacopy(4, 36, 64)\n\n // Copy `tokenId` field from our own calldata to the new calldata.\n let assetDataOffset := calldataload(4)\n calldatacopy(68, add(assetDataOffset, 72), 32)\n\n /////// Call `token.transferFrom` using the calldata ///////\n let token := calldataload(add(assetDataOffset, 40))\n let success := call(\n gas, // forward all gas\n token, // call address of token contract\n 0, // don't send any ETH\n 0, // pointer to start of input\n 100, // length of input\n 0, // write output to null\n 0 // output size is 0 bytes\n )\n if success {\n return(0, 0)\n }\n \n // Revert with `Error(\"TRANSFER_FAILED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // Revert if undefined function is called\n revert(0, 0)\n }\n }\n\n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4)\n {\n return PROXY_ID;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/MixinAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"./mixins/MAuthorizable.sol\";\n\n\ncontract MixinAuthorizable is\n Ownable,\n MAuthorizable\n{\n /// @dev Only authorized addresses can invoke functions with this modifier.\n modifier onlyAuthorized {\n require(\n authorized[msg.sender],\n \"SENDER_NOT_AUTHORIZED\"\n );\n _;\n }\n\n mapping (address => bool) public authorized;\n address[] public authorities;\n\n /// @dev Authorizes an address.\n /// @param target Address to authorize.\n function addAuthorizedAddress(address target)\n external\n onlyOwner\n {\n require(\n !authorized[target],\n \"TARGET_ALREADY_AUTHORIZED\"\n );\n\n authorized[target] = true;\n authorities.push(target);\n emit AuthorizedAddressAdded(target, msg.sender);\n }\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n function removeAuthorizedAddress(address target)\n external\n onlyOwner\n {\n require(\n authorized[target],\n \"TARGET_NOT_AUTHORIZED\"\n );\n\n delete authorized[target];\n for (uint256 i = 0; i < authorities.length; i++) {\n if (authorities[i] == target) {\n authorities[i] = authorities[authorities.length - 1];\n authorities.length -= 1;\n break;\n }\n }\n emit AuthorizedAddressRemoved(target, msg.sender);\n }\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n /// @param index Index of target in authorities array.\n function removeAuthorizedAddressAtIndex(\n address target,\n uint256 index\n )\n external\n onlyOwner\n {\n require(\n authorized[target],\n \"TARGET_NOT_AUTHORIZED\"\n );\n require(\n index < authorities.length,\n \"INDEX_OUT_OF_BOUNDS\"\n );\n require(\n authorities[index] == target,\n \"AUTHORIZED_ADDRESS_MISMATCH\"\n );\n\n delete authorized[target];\n authorities[index] = authorities[authorities.length - 1];\n authorities.length -= 1;\n emit AuthorizedAddressRemoved(target, msg.sender);\n }\n\n /// @dev Gets all authorized addresses.\n /// @return Array of authorized addresses.\n function getAuthorizedAddresses()\n external\n view\n returns (address[] memory)\n {\n return authorities;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IAuthorizable.sol\";\n\n\ncontract IAssetProxy is\n IAuthorizable\n{\n /// @dev Transfers assets. Either succeeds or throws.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param from Address to transfer asset from.\n /// @param to Address to transfer asset to.\n /// @param amount Amount of asset to transfer.\n function transferFrom(\n bytes assetData,\n address from,\n address to,\n uint256 amount\n )\n external;\n \n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4);\n}\n",
- "2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/Ownable/IOwnable.sol\";\n\n\ncontract IAuthorizable is\n IOwnable\n{\n /// @dev Authorizes an address.\n /// @param target Address to authorize.\n function addAuthorizedAddress(address target)\n external;\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n function removeAuthorizedAddress(address target)\n external;\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n /// @param index Index of target in authorities array.\n function removeAuthorizedAddressAtIndex(\n address target,\n uint256 index\n )\n external;\n \n /// @dev Gets all authorized addresses.\n /// @return Array of authorized addresses.\n function getAuthorizedAddresses()\n external\n view\n returns (address[] memory);\n}\n",
- "2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAuthorizable.sol\";\n\n\ncontract MAuthorizable is\n IAuthorizable\n{\n // Event logged when a new address is authorized.\n event AuthorizedAddressAdded(\n address indexed target,\n address indexed caller\n );\n\n // Event logged when a currently authorized address is unauthorized.\n event AuthorizedAddressRemoved(\n address indexed target,\n address indexed caller\n );\n\n /// @dev Only authorized addresses can invoke functions with this modifier.\n modifier onlyAuthorized { revert(); _; }\n}\n",
- "2.0.0/protocol/AssetProxyOwner/AssetProxyOwner.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../multisig/MultiSigWalletWithTimeLock.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\n\n\ncontract AssetProxyOwner is\n MultiSigWalletWithTimeLock\n{\n using LibBytes for bytes;\n\n event AssetProxyRegistration(address assetProxyContract, bool isRegistered);\n\n // Mapping of AssetProxy contract address =>\n // if this contract is allowed to call the AssetProxy's `removeAuthorizedAddressAtIndex` method without a time lock.\n mapping (address => bool) public isAssetProxyRegistered;\n\n bytes4 constant internal REMOVE_AUTHORIZED_ADDRESS_AT_INDEX_SELECTOR = bytes4(keccak256(\"removeAuthorizedAddressAtIndex(address,uint256)\"));\n\n /// @dev Function will revert if the transaction does not call `removeAuthorizedAddressAtIndex`\n /// on an approved AssetProxy contract.\n modifier validRemoveAuthorizedAddressAtIndexTx(uint256 transactionId) {\n Transaction storage txn = transactions[transactionId];\n require(\n isAssetProxyRegistered[txn.destination],\n \"UNREGISTERED_ASSET_PROXY\"\n );\n require(\n txn.data.readBytes4(0) == REMOVE_AUTHORIZED_ADDRESS_AT_INDEX_SELECTOR,\n \"INVALID_FUNCTION_SELECTOR\"\n );\n _;\n }\n\n /// @dev Contract constructor sets initial owners, required number of confirmations,\n /// time lock, and list of AssetProxy addresses.\n /// @param _owners List of initial owners.\n /// @param _assetProxyContracts Array of AssetProxy contract addresses.\n /// @param _required Number of required confirmations.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n constructor (\n address[] memory _owners,\n address[] memory _assetProxyContracts,\n uint256 _required,\n uint256 _secondsTimeLocked\n )\n public\n MultiSigWalletWithTimeLock(_owners, _required, _secondsTimeLocked)\n {\n for (uint256 i = 0; i < _assetProxyContracts.length; i++) {\n address assetProxy = _assetProxyContracts[i];\n require(\n assetProxy != address(0),\n \"INVALID_ASSET_PROXY\"\n );\n isAssetProxyRegistered[assetProxy] = true;\n }\n }\n\n /// @dev Registers or deregisters an AssetProxy to be able to execute\n /// `removeAuthorizedAddressAtIndex` without a timelock.\n /// @param assetProxyContract Address of AssetProxy contract.\n /// @param isRegistered Status of approval for AssetProxy contract.\n function registerAssetProxy(address assetProxyContract, bool isRegistered)\n public\n onlyWallet\n notNull(assetProxyContract)\n {\n isAssetProxyRegistered[assetProxyContract] = isRegistered;\n emit AssetProxyRegistration(assetProxyContract, isRegistered);\n }\n\n /// @dev Allows execution of `removeAuthorizedAddressAtIndex` without time lock.\n /// @param transactionId Transaction ID.\n function executeRemoveAuthorizedAddressAtIndex(uint256 transactionId)\n public\n notExecuted(transactionId)\n fullyConfirmed(transactionId)\n validRemoveAuthorizedAddressAtIndexTx(transactionId)\n {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) {\n emit Execution(transactionId);\n } else {\n emit ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/Exchange.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./MixinExchangeCore.sol\";\nimport \"./MixinSignatureValidator.sol\";\nimport \"./MixinWrapperFunctions.sol\";\nimport \"./MixinAssetProxyDispatcher.sol\";\nimport \"./MixinTransactions.sol\";\nimport \"./MixinMatchOrders.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract Exchange is\n MixinExchangeCore,\n MixinMatchOrders,\n MixinSignatureValidator,\n MixinTransactions,\n MixinAssetProxyDispatcher,\n MixinWrapperFunctions\n{\n string constant public VERSION = \"2.0.1-alpha\";\n\n // Mixins are instantiated in the order they are inherited\n constructor (bytes memory _zrxAssetData)\n public\n LibConstants(_zrxAssetData) // @TODO: Remove when we deploy.\n MixinExchangeCore()\n MixinMatchOrders()\n MixinSignatureValidator()\n MixinTransactions()\n MixinAssetProxyDispatcher()\n MixinWrapperFunctions()\n {}\n}\n",
- "2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\nimport \"../AssetProxy/interfaces/IAssetProxy.sol\";\n\n\ncontract MixinAssetProxyDispatcher is\n Ownable,\n MAssetProxyDispatcher\n{\n // Mapping from Asset Proxy Id's to their respective Asset Proxy\n mapping (bytes4 => IAssetProxy) public assetProxies;\n\n /// @dev Registers an asset proxy to its asset proxy id.\n /// Once an asset proxy is registered, it cannot be unregistered.\n /// @param assetProxy Address of new asset proxy to register.\n function registerAssetProxy(address assetProxy)\n external\n onlyOwner\n {\n IAssetProxy assetProxyContract = IAssetProxy(assetProxy);\n\n // Ensure that no asset proxy exists with current id.\n bytes4 assetProxyId = assetProxyContract.getProxyId();\n address currentAssetProxy = assetProxies[assetProxyId];\n require(\n currentAssetProxy == address(0),\n \"ASSET_PROXY_ALREADY_EXISTS\"\n );\n\n // Add asset proxy and log registration.\n assetProxies[assetProxyId] = assetProxyContract;\n emit AssetProxyRegistered(\n assetProxyId,\n assetProxy\n );\n }\n\n /// @dev Gets an asset proxy.\n /// @param assetProxyId Id of the asset proxy.\n /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered.\n function getAssetProxy(bytes4 assetProxyId)\n external\n view\n returns (address)\n {\n return assetProxies[assetProxyId];\n }\n\n /// @dev Forwards arguments to assetProxy and calls `transferFrom`. Either succeeds or throws.\n /// @param assetData Byte array encoded for the asset.\n /// @param from Address to transfer token from.\n /// @param to Address to transfer token to.\n /// @param amount Amount of token to transfer.\n function dispatchTransferFrom(\n bytes memory assetData,\n address from,\n address to,\n uint256 amount\n )\n internal\n {\n // Do nothing if no amount should be transferred.\n if (amount > 0 && from != to) {\n // Ensure assetData length is valid\n require(\n assetData.length > 3,\n \"LENGTH_GREATER_THAN_3_REQUIRED\"\n );\n \n // Lookup assetProxy. We do not use `LibBytes.readBytes4` for gas efficiency reasons.\n bytes4 assetProxyId;\n assembly {\n assetProxyId := and(mload(\n add(assetData, 32)),\n 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000\n )\n }\n address assetProxy = assetProxies[assetProxyId];\n\n // Ensure that assetProxy exists\n require(\n assetProxy != address(0),\n \"ASSET_PROXY_DOES_NOT_EXIST\"\n );\n \n // We construct calldata for the `assetProxy.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n // \n // | Area | Offset | Length | Contents |\n // | -------- |--------|---------|-------------------------------------------- |\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n\n assembly {\n /////// Setup State ///////\n // `cdStart` is the start of the calldata for `assetProxy.transferFrom` (equal to free memory ptr).\n let cdStart := mload(64)\n // `dataAreaLength` is the total number of words needed to store `assetData`\n // As-per the ABI spec, this value is padded up to the nearest multiple of 32,\n // and includes 32-bytes for length.\n let dataAreaLength := and(add(mload(assetData), 63), 0xFFFFFFFFFFFE0)\n // `cdEnd` is the end of the calldata for `assetProxy.transferFrom`.\n let cdEnd := add(cdStart, add(132, dataAreaLength))\n\n \n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFromSelector`.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n mstore(cdStart, 0xa85e59e400000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // Each parameter is padded to 32-bytes. The entire Params Area is 128 bytes.\n // Notes:\n // 1. The offset to `assetData` is the length of the Params Area (128 bytes).\n // 2. A 20-byte mask is applied to addresses to zero-out the unused bytes.\n mstore(add(cdStart, 4), 128)\n mstore(add(cdStart, 36), and(from, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(cdStart, 68), and(to, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(cdStart, 100), amount)\n \n /////// Setup Data Area ///////\n // This area holds `assetData`.\n let dataArea := add(cdStart, 132)\n // solhint-disable-next-line no-empty-blocks\n for {} lt(dataArea, cdEnd) {} {\n mstore(dataArea, mload(assetData))\n dataArea := add(dataArea, 32)\n assetData := add(assetData, 32)\n }\n\n /////// Call `assetProxy.transferFrom` using the constructed calldata ///////\n let success := call(\n gas, // forward all gas\n assetProxy, // call address of asset proxy\n 0, // don't send any ETH\n cdStart, // pointer to start of input\n sub(cdEnd, cdStart), // length of input \n cdStart, // write output over input\n 512 // reserve 512 bytes for output\n )\n if iszero(success) {\n revert(cdStart, returndatasize())\n }\n }\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\n\n\ncontract MixinExchangeCore is\n ReentrancyGuard,\n LibConstants,\n LibMath,\n LibOrder,\n LibFillResults,\n MAssetProxyDispatcher,\n MExchangeCore,\n MSignatureValidator,\n MTransactions\n{\n // Mapping of orderHash => amount of takerAsset already bought by maker\n mapping (bytes32 => uint256) public filled;\n\n // Mapping of orderHash => cancelled\n mapping (bytes32 => bool) public cancelled;\n\n // Mapping of makerAddress => senderAddress => lowest salt an order can have in order to be fillable\n // Orders with specified senderAddress and with a salt less than their epoch are considered cancelled\n mapping (address => mapping (address => uint256)) public orderEpoch;\n\n /// @dev Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch\n /// and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress).\n /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled.\n function cancelOrdersUpTo(uint256 targetOrderEpoch)\n external\n nonReentrant\n {\n address makerAddress = getCurrentContextAddress();\n // If this function is called via `executeTransaction`, we only update the orderEpoch for the makerAddress/msg.sender combination.\n // This allows external filter contracts to add rules to how orders are cancelled via this function.\n address senderAddress = makerAddress == msg.sender ? address(0) : msg.sender;\n\n // orderEpoch is initialized to 0, so to cancelUpTo we need salt + 1\n uint256 newOrderEpoch = targetOrderEpoch + 1; \n uint256 oldOrderEpoch = orderEpoch[makerAddress][senderAddress];\n\n // Ensure orderEpoch is monotonically increasing\n require(\n newOrderEpoch > oldOrderEpoch, \n \"INVALID_NEW_ORDER_EPOCH\"\n );\n\n // Update orderEpoch\n orderEpoch[makerAddress][senderAddress] = newOrderEpoch;\n emit CancelUpTo(\n makerAddress,\n senderAddress,\n newOrderEpoch\n );\n }\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrder(\n Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n nonReentrant\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n return fillResults;\n }\n\n /// @dev After calling, the order can not be filled anymore.\n /// Throws if order is invalid or sender does not have permission to cancel.\n /// @param order Order to cancel. Order must be OrderStatus.FILLABLE.\n function cancelOrder(Order memory order)\n public\n nonReentrant\n {\n cancelOrderInternal(order);\n }\n\n /// @dev Gets information about an order: status, hash, and amount filled.\n /// @param order Order to gather information on.\n /// @return OrderInfo Information about the order and its state.\n /// See LibOrder.OrderInfo for a complete description.\n function getOrderInfo(Order memory order)\n public\n view\n returns (OrderInfo memory orderInfo)\n {\n // Compute the order hash\n orderInfo.orderHash = getOrderHash(order);\n\n // Fetch filled amount\n orderInfo.orderTakerAssetFilledAmount = filled[orderInfo.orderHash];\n\n // If order.makerAssetAmount is zero, we also reject the order.\n // While the Exchange contract handles them correctly, they create\n // edge cases in the supporting infrastructure because they have\n // an 'infinite' price when computed by a simple division.\n if (order.makerAssetAmount == 0) {\n orderInfo.orderStatus = uint8(OrderStatus.INVALID_MAKER_ASSET_AMOUNT);\n return orderInfo;\n }\n\n // If order.takerAssetAmount is zero, then the order will always\n // be considered filled because 0 == takerAssetAmount == orderTakerAssetFilledAmount\n // Instead of distinguishing between unfilled and filled zero taker\n // amount orders, we choose not to support them.\n if (order.takerAssetAmount == 0) {\n orderInfo.orderStatus = uint8(OrderStatus.INVALID_TAKER_ASSET_AMOUNT);\n return orderInfo;\n }\n\n // Validate order availability\n if (orderInfo.orderTakerAssetFilledAmount >= order.takerAssetAmount) {\n orderInfo.orderStatus = uint8(OrderStatus.FULLY_FILLED);\n return orderInfo;\n }\n\n // Validate order expiration\n // solhint-disable-next-line not-rely-on-time\n if (block.timestamp >= order.expirationTimeSeconds) {\n orderInfo.orderStatus = uint8(OrderStatus.EXPIRED);\n return orderInfo;\n }\n\n // Check if order has been cancelled\n if (cancelled[orderInfo.orderHash]) {\n orderInfo.orderStatus = uint8(OrderStatus.CANCELLED);\n return orderInfo;\n }\n if (orderEpoch[order.makerAddress][order.senderAddress] > order.salt) {\n orderInfo.orderStatus = uint8(OrderStatus.CANCELLED);\n return orderInfo;\n }\n\n // All other statuses are ruled out: order is Fillable\n orderInfo.orderStatus = uint8(OrderStatus.FILLABLE);\n return orderInfo;\n }\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderInternal(\n Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n // Fetch order info\n OrderInfo memory orderInfo = getOrderInfo(order);\n\n // Fetch taker address\n address takerAddress = getCurrentContextAddress();\n \n // Assert that the order is fillable by taker\n assertFillableOrder(\n order,\n orderInfo,\n takerAddress,\n signature\n );\n \n // Get amount of takerAsset to fill\n uint256 remainingTakerAssetAmount = safeSub(order.takerAssetAmount, orderInfo.orderTakerAssetFilledAmount);\n uint256 takerAssetFilledAmount = min256(takerAssetFillAmount, remainingTakerAssetAmount);\n\n // Validate context\n assertValidFill(\n order,\n orderInfo,\n takerAssetFillAmount,\n takerAssetFilledAmount,\n fillResults.makerAssetFilledAmount\n );\n\n // Compute proportional fill amounts\n fillResults = calculateFillResults(order, takerAssetFilledAmount);\n\n // Update exchange internal state\n updateFilledState(\n order,\n takerAddress,\n orderInfo.orderHash,\n orderInfo.orderTakerAssetFilledAmount,\n fillResults\n );\n \n // Settle order\n settleOrder(\n order,\n takerAddress,\n fillResults\n );\n\n return fillResults;\n }\n\n /// @dev After calling, the order can not be filled anymore.\n /// Throws if order is invalid or sender does not have permission to cancel.\n /// @param order Order to cancel. Order must be OrderStatus.FILLABLE.\n function cancelOrderInternal(Order memory order)\n internal\n {\n // Fetch current order status\n OrderInfo memory orderInfo = getOrderInfo(order);\n\n // Validate context\n assertValidCancel(order, orderInfo);\n\n // Perform cancel\n updateCancelledState(order, orderInfo.orderHash);\n }\n\n /// @dev Updates state with results of a fill order.\n /// @param order that was filled.\n /// @param takerAddress Address of taker who filled the order.\n /// @param orderTakerAssetFilledAmount Amount of order already filled.\n function updateFilledState(\n Order memory order,\n address takerAddress,\n bytes32 orderHash,\n uint256 orderTakerAssetFilledAmount,\n FillResults memory fillResults\n )\n internal\n {\n // Update state\n filled[orderHash] = safeAdd(orderTakerAssetFilledAmount, fillResults.takerAssetFilledAmount);\n\n // Log order\n emit Fill(\n order.makerAddress,\n order.feeRecipientAddress,\n takerAddress,\n msg.sender,\n fillResults.makerAssetFilledAmount,\n fillResults.takerAssetFilledAmount,\n fillResults.makerFeePaid,\n fillResults.takerFeePaid,\n orderHash,\n order.makerAssetData,\n order.takerAssetData\n );\n }\n\n /// @dev Updates state with results of cancelling an order.\n /// State is only updated if the order is currently fillable.\n /// Otherwise, updating state would have no effect.\n /// @param order that was cancelled.\n /// @param orderHash Hash of order that was cancelled.\n function updateCancelledState(\n Order memory order,\n bytes32 orderHash\n )\n internal\n {\n // Perform cancel\n cancelled[orderHash] = true;\n\n // Log cancel\n emit Cancel(\n order.makerAddress,\n order.feeRecipientAddress,\n msg.sender,\n orderHash,\n order.makerAssetData,\n order.takerAssetData\n );\n }\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAddress Address of order taker.\n /// @param signature Proof that the orders was created by its maker.\n function assertFillableOrder(\n Order memory order,\n OrderInfo memory orderInfo,\n address takerAddress,\n bytes memory signature\n )\n internal\n view\n {\n // An order can only be filled if its status is FILLABLE.\n require(\n orderInfo.orderStatus == uint8(OrderStatus.FILLABLE),\n \"ORDER_UNFILLABLE\"\n );\n \n // Validate sender is allowed to fill this order\n if (order.senderAddress != address(0)) {\n require(\n order.senderAddress == msg.sender,\n \"INVALID_SENDER\"\n );\n }\n \n // Validate taker is allowed to fill this order\n if (order.takerAddress != address(0)) {\n require(\n order.takerAddress == takerAddress,\n \"INVALID_TAKER\"\n );\n }\n \n // Validate Maker signature (check only if first time seen)\n if (orderInfo.orderTakerAssetFilledAmount == 0) {\n require(\n isValidSignature(\n orderInfo.orderHash,\n order.makerAddress,\n signature\n ),\n \"INVALID_ORDER_SIGNATURE\"\n );\n }\n }\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAssetFillAmount Desired amount of order to fill by taker.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @param makerAssetFilledAmount Amount of makerAsset that will be transfered.\n function assertValidFill(\n Order memory order,\n OrderInfo memory orderInfo,\n uint256 takerAssetFillAmount, // TODO: use FillResults\n uint256 takerAssetFilledAmount,\n uint256 makerAssetFilledAmount\n )\n internal\n view\n {\n // Revert if fill amount is invalid\n // TODO: reconsider necessity for v2.1\n require(\n takerAssetFillAmount != 0,\n \"INVALID_TAKER_AMOUNT\"\n );\n \n // Make sure taker does not pay more than desired amount\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n takerAssetFilledAmount <= takerAssetFillAmount,\n \"TAKER_OVERPAY\"\n );\n \n // Make sure order is not overfilled\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n safeAdd(orderInfo.orderTakerAssetFilledAmount, takerAssetFilledAmount) <= order.takerAssetAmount,\n \"ORDER_OVERFILL\"\n );\n \n // Make sure order is filled at acceptable price.\n // The order has an implied price from the makers perspective:\n // order price = order.makerAssetAmount / order.takerAssetAmount\n // i.e. the number of makerAsset maker is paying per takerAsset. The\n // maker is guaranteed to get this price or a better (lower) one. The\n // actual price maker is getting in this fill is:\n // fill price = makerAssetFilledAmount / takerAssetFilledAmount\n // We need `fill price <= order price` for the fill to be fair to maker.\n // This amounts to:\n // makerAssetFilledAmount order.makerAssetAmount\n // ------------------------ <= -----------------------\n // takerAssetFilledAmount order.takerAssetAmount\n // or, equivalently:\n // makerAssetFilledAmount * order.takerAssetAmount <=\n // order.makerAssetAmount * takerAssetFilledAmount\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n safeMul(makerAssetFilledAmount, order.takerAssetAmount)\n <= \n safeMul(order.makerAssetAmount, takerAssetFilledAmount),\n \"INVALID_FILL_PRICE\"\n );\n }\n\n /// @dev Validates context for cancelOrder. Succeeds or throws.\n /// @param order to be cancelled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n function assertValidCancel(\n Order memory order,\n OrderInfo memory orderInfo\n )\n internal\n view\n {\n // Ensure order is valid\n // An order can only be cancelled if its status is FILLABLE.\n require(\n orderInfo.orderStatus == uint8(OrderStatus.FILLABLE),\n \"ORDER_UNFILLABLE\"\n );\n\n // Validate sender is allowed to cancel this order\n if (order.senderAddress != address(0)) {\n require(\n order.senderAddress == msg.sender,\n \"INVALID_SENDER\"\n );\n }\n\n // Validate transaction signed by maker\n address makerAddress = getCurrentContextAddress();\n require(\n order.makerAddress == makerAddress,\n \"INVALID_MAKER\"\n );\n }\n\n /// @dev Calculates amounts filled and fees paid by maker and taker.\n /// @param order to be filled.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function calculateFillResults(\n Order memory order,\n uint256 takerAssetFilledAmount\n )\n internal\n pure\n returns (FillResults memory fillResults)\n {\n // Compute proportional transfer amounts\n fillResults.takerAssetFilledAmount = takerAssetFilledAmount;\n fillResults.makerAssetFilledAmount = safeGetPartialAmountFloor(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.makerAssetAmount\n );\n fillResults.makerFeePaid = safeGetPartialAmountFloor(\n fillResults.makerAssetFilledAmount,\n order.makerAssetAmount,\n order.makerFee\n );\n fillResults.takerFeePaid = safeGetPartialAmountFloor(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.takerFee\n );\n\n return fillResults;\n }\n\n /// @dev Settles an order by transferring assets between counterparties.\n /// @param order Order struct containing order specifications.\n /// @param takerAddress Address selling takerAsset and buying makerAsset.\n /// @param fillResults Amounts to be filled and fees paid by maker and taker.\n function settleOrder(\n LibOrder.Order memory order,\n address takerAddress,\n LibFillResults.FillResults memory fillResults\n )\n private\n {\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n dispatchTransferFrom(\n order.makerAssetData,\n order.makerAddress,\n takerAddress,\n fillResults.makerAssetFilledAmount\n );\n dispatchTransferFrom(\n order.takerAssetData,\n takerAddress,\n order.makerAddress,\n fillResults.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n zrxAssetData,\n order.makerAddress,\n order.feeRecipientAddress,\n fillResults.makerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n order.feeRecipientAddress,\n fillResults.takerFeePaid\n );\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinMatchOrders.sol": "/*\n Copyright 2018 ZeroEx Intl.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n http://www.apache.org/licenses/LICENSE-2.0\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MMatchOrders.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\n\n\ncontract MixinMatchOrders is\n ReentrancyGuard,\n LibConstants,\n LibMath,\n MAssetProxyDispatcher,\n MExchangeCore,\n MMatchOrders,\n MTransactions\n{\n /// @dev Match two complementary orders that have a profitable spread.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the left order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftSignature Proof that order was created by the left maker.\n /// @param rightSignature Proof that order was created by the right maker.\n /// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.\n function matchOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n bytes memory leftSignature,\n bytes memory rightSignature\n )\n public\n nonReentrant\n returns (LibFillResults.MatchedFillResults memory matchedFillResults)\n {\n // We assume that rightOrder.takerAssetData == leftOrder.makerAssetData and rightOrder.makerAssetData == leftOrder.takerAssetData.\n // If this assumption isn't true, the match will fail at signature validation.\n rightOrder.makerAssetData = leftOrder.takerAssetData;\n rightOrder.takerAssetData = leftOrder.makerAssetData;\n\n // Get left & right order info\n LibOrder.OrderInfo memory leftOrderInfo = getOrderInfo(leftOrder);\n LibOrder.OrderInfo memory rightOrderInfo = getOrderInfo(rightOrder);\n\n // Fetch taker address\n address takerAddress = getCurrentContextAddress();\n \n // Either our context is valid or we revert\n assertFillableOrder(\n leftOrder,\n leftOrderInfo,\n takerAddress,\n leftSignature\n );\n assertFillableOrder(\n rightOrder,\n rightOrderInfo,\n takerAddress,\n rightSignature\n );\n assertValidMatch(leftOrder, rightOrder);\n\n // Compute proportional fill amounts\n matchedFillResults = calculateMatchedFillResults(\n leftOrder,\n rightOrder,\n leftOrderInfo.orderTakerAssetFilledAmount,\n rightOrderInfo.orderTakerAssetFilledAmount\n );\n\n // Validate fill contexts\n assertValidFill(\n leftOrder,\n leftOrderInfo,\n matchedFillResults.left.takerAssetFilledAmount,\n matchedFillResults.left.takerAssetFilledAmount,\n matchedFillResults.left.makerAssetFilledAmount\n );\n assertValidFill(\n rightOrder,\n rightOrderInfo,\n matchedFillResults.right.takerAssetFilledAmount,\n matchedFillResults.right.takerAssetFilledAmount,\n matchedFillResults.right.makerAssetFilledAmount\n );\n \n // Update exchange state\n updateFilledState(\n leftOrder,\n takerAddress,\n leftOrderInfo.orderHash,\n leftOrderInfo.orderTakerAssetFilledAmount,\n matchedFillResults.left\n );\n updateFilledState(\n rightOrder,\n takerAddress,\n rightOrderInfo.orderHash,\n rightOrderInfo.orderTakerAssetFilledAmount,\n matchedFillResults.right\n );\n\n // Settle matched orders. Succeeds or throws.\n settleMatchedOrders(\n leftOrder,\n rightOrder,\n takerAddress,\n matchedFillResults\n );\n\n return matchedFillResults;\n }\n\n /// @dev Validates context for matchOrders. Succeeds or throws.\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n function assertValidMatch(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder\n )\n internal\n pure\n {\n // Make sure there is a profitable spread.\n // There is a profitable spread iff the cost per unit bought (OrderA.MakerAmount/OrderA.TakerAmount) for each order is greater\n // than the profit per unit sold of the matched order (OrderB.TakerAmount/OrderB.MakerAmount).\n // This is satisfied by the equations below:\n // <leftOrder.makerAssetAmount> / <leftOrder.takerAssetAmount> >= <rightOrder.takerAssetAmount> / <rightOrder.makerAssetAmount>\n // AND\n // <rightOrder.makerAssetAmount> / <rightOrder.takerAssetAmount> >= <leftOrder.takerAssetAmount> / <leftOrder.makerAssetAmount>\n // These equations can be combined to get the following:\n require(\n safeMul(leftOrder.makerAssetAmount, rightOrder.makerAssetAmount) >=\n safeMul(leftOrder.takerAssetAmount, rightOrder.takerAssetAmount),\n \"NEGATIVE_SPREAD_REQUIRED\"\n );\n }\n\n /// @dev Calculates fill amounts for the matched orders.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the leftOrder order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftOrderTakerAssetFilledAmount Amount of left order already filled.\n /// @param rightOrderTakerAssetFilledAmount Amount of right order already filled.\n /// @param matchedFillResults Amounts to fill and fees to pay by maker and taker of matched orders.\n function calculateMatchedFillResults(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n uint256 leftOrderTakerAssetFilledAmount,\n uint256 rightOrderTakerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.MatchedFillResults memory matchedFillResults)\n {\n // Derive maker asset amounts for left & right orders, given store taker assert amounts\n uint256 leftTakerAssetAmountRemaining = safeSub(leftOrder.takerAssetAmount, leftOrderTakerAssetFilledAmount);\n uint256 leftMakerAssetAmountRemaining = safeGetPartialAmountFloor(\n leftOrder.makerAssetAmount,\n leftOrder.takerAssetAmount,\n leftTakerAssetAmountRemaining\n );\n uint256 rightTakerAssetAmountRemaining = safeSub(rightOrder.takerAssetAmount, rightOrderTakerAssetFilledAmount);\n uint256 rightMakerAssetAmountRemaining = safeGetPartialAmountFloor(\n rightOrder.makerAssetAmount,\n rightOrder.takerAssetAmount,\n rightTakerAssetAmountRemaining\n );\n\n // Calculate fill results for maker and taker assets: at least one order will be fully filled.\n // The maximum amount the left maker can buy is `leftTakerAssetAmountRemaining`\n // The maximum amount the right maker can sell is `rightMakerAssetAmountRemaining`\n // We have two distinct cases for calculating the fill results:\n // Case 1.\n // If the left maker can buy more than the right maker can sell, then only the right order is fully filled.\n // If the left maker can buy exactly what the right maker can sell, then both orders are fully filled.\n // Case 2.\n // If the left maker cannot buy more than the right maker can sell, then only the left order is fully filled.\n if (leftTakerAssetAmountRemaining >= rightMakerAssetAmountRemaining) {\n // Case 1: Right order is fully filled\n matchedFillResults.right.makerAssetFilledAmount = rightMakerAssetAmountRemaining;\n matchedFillResults.right.takerAssetFilledAmount = rightTakerAssetAmountRemaining;\n matchedFillResults.left.takerAssetFilledAmount = matchedFillResults.right.makerAssetFilledAmount;\n // Round down to ensure the maker's exchange rate does not exceed the price specified by the order. \n // We favor the maker when the exchange rate must be rounded.\n matchedFillResults.left.makerAssetFilledAmount = safeGetPartialAmountFloor(\n leftOrder.makerAssetAmount,\n leftOrder.takerAssetAmount,\n matchedFillResults.left.takerAssetFilledAmount\n );\n } else {\n // Case 2: Left order is fully filled\n matchedFillResults.left.makerAssetFilledAmount = leftMakerAssetAmountRemaining;\n matchedFillResults.left.takerAssetFilledAmount = leftTakerAssetAmountRemaining;\n matchedFillResults.right.makerAssetFilledAmount = matchedFillResults.left.takerAssetFilledAmount;\n // Round up to ensure the maker's exchange rate does not exceed the price specified by the order.\n // We favor the maker when the exchange rate must be rounded.\n matchedFillResults.right.takerAssetFilledAmount = safeGetPartialAmountCeil(\n rightOrder.takerAssetAmount,\n rightOrder.makerAssetAmount,\n matchedFillResults.right.makerAssetFilledAmount\n );\n }\n\n // Calculate amount given to taker\n matchedFillResults.leftMakerAssetSpreadAmount = safeSub(\n matchedFillResults.left.makerAssetFilledAmount,\n matchedFillResults.right.takerAssetFilledAmount\n );\n\n // Compute fees for left order\n matchedFillResults.left.makerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.left.makerAssetFilledAmount,\n leftOrder.makerAssetAmount,\n leftOrder.makerFee\n );\n matchedFillResults.left.takerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.left.takerAssetFilledAmount,\n leftOrder.takerAssetAmount,\n leftOrder.takerFee\n );\n\n // Compute fees for right order\n matchedFillResults.right.makerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.right.makerAssetFilledAmount,\n rightOrder.makerAssetAmount,\n rightOrder.makerFee\n );\n matchedFillResults.right.takerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.right.takerAssetFilledAmount,\n rightOrder.takerAssetAmount,\n rightOrder.takerFee\n );\n\n // Return fill results\n return matchedFillResults;\n }\n\n /// @dev Settles matched order by transferring appropriate funds between order makers, taker, and fee recipient.\n /// @param leftOrder First matched order.\n /// @param rightOrder Second matched order.\n /// @param takerAddress Address that matched the orders. The taker receives the spread between orders as profit.\n /// @param matchedFillResults Struct holding amounts to transfer between makers, taker, and fee recipients.\n function settleMatchedOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n address takerAddress,\n LibFillResults.MatchedFillResults memory matchedFillResults\n )\n private\n {\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n // Order makers and taker\n dispatchTransferFrom(\n leftOrder.makerAssetData,\n leftOrder.makerAddress,\n rightOrder.makerAddress,\n matchedFillResults.right.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n rightOrder.makerAssetData,\n rightOrder.makerAddress,\n leftOrder.makerAddress,\n matchedFillResults.left.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n leftOrder.makerAssetData,\n leftOrder.makerAddress,\n takerAddress,\n matchedFillResults.leftMakerAssetSpreadAmount\n );\n\n // Maker fees\n dispatchTransferFrom(\n zrxAssetData,\n leftOrder.makerAddress,\n leftOrder.feeRecipientAddress,\n matchedFillResults.left.makerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n rightOrder.makerAddress,\n rightOrder.feeRecipientAddress,\n matchedFillResults.right.makerFeePaid\n );\n\n // Taker fees\n if (leftOrder.feeRecipientAddress == rightOrder.feeRecipientAddress) {\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n leftOrder.feeRecipientAddress,\n safeAdd(\n matchedFillResults.left.takerFeePaid,\n matchedFillResults.right.takerFeePaid\n )\n );\n } else {\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n leftOrder.feeRecipientAddress,\n matchedFillResults.left.takerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n rightOrder.feeRecipientAddress,\n matchedFillResults.right.takerFeePaid\n );\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinSignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./interfaces/IWallet.sol\";\nimport \"./interfaces/IValidator.sol\";\n\n\ncontract MixinSignatureValidator is\n ReentrancyGuard,\n MSignatureValidator,\n MTransactions\n{\n using LibBytes for bytes;\n \n // Mapping of hash => signer => signed\n mapping (bytes32 => mapping (address => bool)) public preSigned;\n\n // Mapping of signer => validator => approved\n mapping (address => mapping (address => bool)) public allowedValidators;\n\n /// @dev Approves a hash on-chain using any valid signature type.\n /// After presigning a hash, the preSign signature type will become valid for that hash and signer.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n function preSign(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external\n {\n if (signerAddress != msg.sender) {\n require(\n isValidSignature(\n hash,\n signerAddress,\n signature\n ),\n \"INVALID_SIGNATURE\"\n );\n }\n preSigned[hash][signerAddress] = true;\n }\n\n /// @dev Approves/unnapproves a Validator contract to verify signatures on signer's behalf.\n /// @param validatorAddress Address of Validator contract.\n /// @param approval Approval or disapproval of Validator contract.\n function setSignatureValidatorApproval(\n address validatorAddress,\n bool approval\n )\n external\n nonReentrant\n {\n address signerAddress = getCurrentContextAddress();\n allowedValidators[signerAddress][validatorAddress] = approval;\n emit SignatureValidatorApproval(\n signerAddress,\n validatorAddress,\n approval\n );\n }\n\n /// @dev Verifies that a hash has been signed by the given signer.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes memory signature\n )\n public\n view\n returns (bool isValid)\n {\n require(\n signature.length > 0,\n \"LENGTH_GREATER_THAN_0_REQUIRED\"\n );\n\n // Pop last byte off of signature byte array.\n uint8 signatureTypeRaw = uint8(signature.popLastByte());\n\n // Ensure signature is supported\n require(\n signatureTypeRaw < uint8(SignatureType.NSignatureTypes),\n \"SIGNATURE_UNSUPPORTED\"\n );\n\n SignatureType signatureType = SignatureType(signatureTypeRaw);\n\n // Variables are not scoped in Solidity.\n uint8 v;\n bytes32 r;\n bytes32 s;\n address recovered;\n\n // Always illegal signature.\n // This is always an implicit option since a signer can create a\n // signature array with invalid type or length. We may as well make\n // it an explicit option. This aids testing and analysis. It is\n // also the initialization value for the enum type.\n if (signatureType == SignatureType.Illegal) {\n revert(\"SIGNATURE_ILLEGAL\");\n\n // Always invalid signature.\n // Like Illegal, this is always implicitly available and therefore\n // offered explicitly. It can be implicitly created by providing\n // a correctly formatted but incorrect signature.\n } else if (signatureType == SignatureType.Invalid) {\n require(\n signature.length == 0,\n \"LENGTH_0_REQUIRED\"\n );\n isValid = false;\n return isValid;\n\n // Signature using EIP712\n } else if (signatureType == SignatureType.EIP712) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n hash,\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n\n // Signed using web3.eth_sign\n } else if (signatureType == SignatureType.EthSign) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n keccak256(abi.encodePacked(\n \"\\x19Ethereum Signed Message:\\n32\",\n hash\n )),\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n\n // Signature verified by wallet contract.\n // If used with an order, the maker of the order is the wallet contract.\n } else if (signatureType == SignatureType.Wallet) {\n isValid = isValidWalletSignature(\n hash,\n signerAddress,\n signature\n );\n return isValid;\n\n // Signature verified by validator contract.\n // If used with an order, the maker of the order can still be an EOA.\n // A signature using this type should be encoded as:\n // | Offset | Length | Contents |\n // | 0x00 | x | Signature to validate |\n // | 0x00 + x | 20 | Address of validator contract |\n // | 0x14 + x | 1 | Signature type is always \"\\x06\" |\n } else if (signatureType == SignatureType.Validator) {\n // Pop last 20 bytes off of signature byte array.\n address validatorAddress = signature.popLast20Bytes();\n \n // Ensure signer has approved validator.\n if (!allowedValidators[signerAddress][validatorAddress]) {\n return false;\n }\n isValid = isValidValidatorSignature(\n validatorAddress,\n hash,\n signerAddress,\n signature\n );\n return isValid;\n\n // Signer signed hash previously using the preSign function.\n } else if (signatureType == SignatureType.PreSigned) {\n isValid = preSigned[hash][signerAddress];\n return isValid;\n }\n\n // Anything else is illegal (We do not return false because\n // the signature may actually be valid, just not in a format\n // that we currently support. In this case returning false\n // may lead the caller to incorrectly believe that the\n // signature was invalid.)\n revert(\"SIGNATURE_UNSUPPORTED\");\n }\n\n /// @dev Verifies signature using logic defined by Wallet contract.\n /// @param hash Any 32 byte hash.\n /// @param walletAddress Address that should have signed the given hash\n /// and defines its own signature verification method.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if signature is valid for given wallet..\n function isValidWalletSignature(\n bytes32 hash,\n address walletAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid)\n {\n bytes memory calldata = abi.encodeWithSelector(\n IWallet(walletAddress).isValidSignature.selector,\n hash,\n signature\n );\n assembly {\n let cdStart := add(calldata, 32)\n let success := staticcall(\n gas, // forward all gas\n walletAddress, // address of Wallet contract\n cdStart, // pointer to start of input\n mload(calldata), // length of input\n cdStart, // write output over input\n 32 // output size is 32 bytes\n )\n\n switch success\n case 0 {\n // Revert with `Error(\"WALLET_ERROR\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000c57414c4c45545f4552524f5200000000000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n case 1 {\n // Signature is valid if call did not revert and returned true\n isValid := mload(cdStart)\n }\n }\n return isValid;\n }\n\n /// @dev Verifies signature using logic defined by Validator contract.\n /// @param validatorAddress Address of validator contract.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidValidatorSignature(\n address validatorAddress,\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid)\n {\n bytes memory calldata = abi.encodeWithSelector(\n IValidator(signerAddress).isValidSignature.selector,\n hash,\n signerAddress,\n signature\n );\n assembly {\n let cdStart := add(calldata, 32)\n let success := staticcall(\n gas, // forward all gas\n validatorAddress, // address of Validator contract\n cdStart, // pointer to start of input\n mload(calldata), // length of input\n cdStart, // write output over input\n 32 // output size is 32 bytes\n )\n\n switch success\n case 0 {\n // Revert with `Error(\"VALIDATOR_ERROR\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f56414c494441544f525f4552524f5200000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n case 1 {\n // Signature is valid if call did not revert and returned true\n isValid := mload(cdStart)\n }\n }\n return isValid;\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinTransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\nimport \"./libs/LibExchangeErrors.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./libs/LibEIP712.sol\";\n\n\ncontract MixinTransactions is\n LibEIP712,\n MSignatureValidator,\n MTransactions\n{\n // Mapping of transaction hash => executed\n // This prevents transactions from being executed more than once.\n mapping (bytes32 => bool) public transactions;\n\n // Address of current transaction signer\n address public currentContextAddress;\n\n /// @dev Executes an exchange method call in the context of signer.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @param signature Proof of signer transaction by signer.\n function executeTransaction(\n uint256 salt,\n address signerAddress,\n bytes data,\n bytes signature\n )\n external\n {\n // Prevent reentrancy\n require(\n currentContextAddress == address(0),\n \"REENTRANCY_ILLEGAL\"\n );\n\n bytes32 transactionHash = hashEIP712Message(hashZeroExTransaction(\n salt,\n signerAddress,\n data\n ));\n\n // Validate transaction has not been executed\n require(\n !transactions[transactionHash],\n \"INVALID_TX_HASH\"\n );\n\n // Transaction always valid if signer is sender of transaction\n if (signerAddress != msg.sender) {\n // Validate signature\n require(\n isValidSignature(\n transactionHash,\n signerAddress,\n signature\n ),\n \"INVALID_TX_SIGNATURE\"\n );\n\n // Set the current transaction signer\n currentContextAddress = signerAddress;\n }\n\n // Execute transaction\n transactions[transactionHash] = true;\n require(\n address(this).delegatecall(data),\n \"FAILED_EXECUTION\"\n );\n\n // Reset current transaction signer if it was previously updated\n if (signerAddress != msg.sender) {\n currentContextAddress = address(0);\n }\n }\n\n /// @dev Calculates EIP712 hash of the Transaction.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @return EIP712 hash of the Transaction.\n function hashZeroExTransaction(\n uint256 salt,\n address signerAddress,\n bytes memory data\n )\n internal\n pure\n returns (bytes32 result)\n {\n bytes32 schemaHash = EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH;\n bytes32 dataHash = keccak256(data);\n\n // Assembly for more efficiently computing:\n // keccak256(abi.encodePacked(\n // EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH,\n // salt,\n // bytes32(signerAddress),\n // keccak256(data)\n // ));\n\n assembly {\n // Load free memory pointer\n let memPtr := mload(64)\n\n mstore(memPtr, schemaHash) // hash of schema\n mstore(add(memPtr, 32), salt) // salt\n mstore(add(memPtr, 64), and(signerAddress, 0xffffffffffffffffffffffffffffffffffffffff)) // signerAddress\n mstore(add(memPtr, 96), dataHash) // hash of data\n\n // Compute hash\n result := keccak256(memPtr, 128)\n }\n return result;\n }\n\n /// @dev The current function will be called in the context of this address (either 0x transaction signer or `msg.sender`).\n /// If calling a fill function, this address will represent the taker.\n /// If calling a cancel function, this address will represent the maker.\n /// @return Signer of 0x transaction if entry point is `executeTransaction`.\n /// `msg.sender` if entry point is any other function.\n function getCurrentContextAddress()\n internal\n view\n returns (address)\n {\n address currentContextAddress_ = currentContextAddress;\n address contextAddress = currentContextAddress_ == address(0) ? msg.sender : currentContextAddress_;\n return contextAddress;\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./libs/LibAbiEncoder.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MWrapperFunctions.sol\";\n\n\ncontract MixinWrapperFunctions is\n ReentrancyGuard,\n LibMath,\n LibFillResults,\n LibAbiEncoder,\n MExchangeCore,\n MWrapperFunctions\n{\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n nonReentrant\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrKillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n return fillResults;\n }\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (FillResults memory fillResults)\n {\n // ABI encode calldata for `fillOrder`\n bytes memory fillOrderCalldata = abiEncodeFillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n\n // Delegate to `fillOrder` and handle any exceptions gracefully\n assembly {\n let success := delegatecall(\n gas, // forward all gas\n address, // call address of this contract\n add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes)\n mload(fillOrderCalldata), // length of input\n fillOrderCalldata, // write output over input\n 128 // output size is 128 bytes\n )\n if success {\n mstore(fillResults, mload(fillOrderCalldata))\n mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32)))\n mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64)))\n mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96)))\n }\n }\n // fillResults values will be 0 by default if call was unsuccessful\n return fillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrKill.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrKillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrKillOrderInternal(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrders(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n bytes memory takerAssetData = orders[0].takerAssetData;\n \n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being sold by taker is the same for each order.\n // Rather than passing this in as calldata, we use the takerAssetData from the first order in all later orders.\n orders[i].takerAssetData = takerAssetData;\n\n // Calculate the remaining amount of takerAsset to sell\n uint256 remainingTakerAssetFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= takerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory takerAssetData = orders[0].takerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being sold by taker is the same for each order.\n // Rather than passing this in as calldata, we use the takerAssetData from the first order in all later orders.\n orders[i].takerAssetData = takerAssetData;\n\n // Calculate the remaining amount of takerAsset to sell\n uint256 remainingTakerAssetFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= takerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerAsset is bought by taker.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrders(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // Rather than passing this in as calldata, we copy the makerAssetData from the first order onto all later orders.\n orders[i].makerAssetData = makerAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n if (totalFillResults.makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // Rather than passing this in as calldata, we copy the makerAssetData from the first order onto all later orders.\n orders[i].makerAssetData = makerAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n if (totalFillResults.makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously cancels multiple orders in a single transaction.\n /// @param orders Array of order specifications.\n function batchCancelOrders(LibOrder.Order[] memory orders)\n public\n nonReentrant\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n cancelOrderInternal(orders[i]);\n }\n }\n\n /// @dev Fetches information for all passed in orders.\n /// @param orders Array of order specifications.\n /// @return Array of OrderInfo instances that correspond to each order.\n function getOrdersInfo(LibOrder.Order[] memory orders)\n public\n view\n returns (LibOrder.OrderInfo[] memory)\n {\n uint256 ordersLength = orders.length;\n LibOrder.OrderInfo[] memory ordersInfo = new LibOrder.OrderInfo[](ordersLength);\n for (uint256 i = 0; i != ordersLength; i++) {\n ordersInfo[i] = getOrderInfo(orders[i]);\n }\n return ordersInfo;\n }\n\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n require(\n fillResults.takerAssetFilledAmount == takerAssetFillAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return fillResults;\n }\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IAssetProxyDispatcher {\n\n /// @dev Registers an asset proxy to its asset proxy id.\n /// Once an asset proxy is registered, it cannot be unregistered.\n /// @param assetProxy Address of new asset proxy to register.\n function registerAssetProxy(address assetProxy)\n external;\n\n /// @dev Gets an asset proxy.\n /// @param assetProxyId Id of the asset proxy.\n /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered.\n function getAssetProxy(bytes4 assetProxyId)\n external\n view\n returns (address);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IExchange.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./IExchangeCore.sol\";\nimport \"./IMatchOrders.sol\";\nimport \"./ISignatureValidator.sol\";\nimport \"./ITransactions.sol\";\nimport \"./IAssetProxyDispatcher.sol\";\nimport \"./IWrapperFunctions.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract IExchange is\n IExchangeCore,\n IMatchOrders,\n ISignatureValidator,\n ITransactions,\n IAssetProxyDispatcher,\n IWrapperFunctions\n{}\n",
- "2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IExchangeCore {\n\n /// @dev Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch\n /// and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress).\n /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled.\n function cancelOrdersUpTo(uint256 targetOrderEpoch)\n external;\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev After calling, the order can not be filled anymore.\n /// @param order Order struct containing order specifications.\n function cancelOrder(LibOrder.Order memory order)\n public;\n\n /// @dev Gets information about an order: status, hash, and amount filled.\n /// @param order Order to gather information on.\n /// @return OrderInfo Information about the order and its state.\n /// See LibOrder.OrderInfo for a complete description.\n function getOrderInfo(LibOrder.Order memory order)\n public\n view\n returns (LibOrder.OrderInfo memory orderInfo);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IMatchOrders {\n\n /// @dev Match two complementary orders that have a profitable spread.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the left order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftSignature Proof that order was created by the left maker.\n /// @param rightSignature Proof that order was created by the right maker.\n /// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.\n function matchOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n bytes memory leftSignature,\n bytes memory rightSignature\n )\n public\n returns (LibFillResults.MatchedFillResults memory matchedFillResults);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract ISignatureValidator {\n\n /// @dev Approves a hash on-chain using any valid signature type.\n /// After presigning a hash, the preSign signature type will become valid for that hash and signer.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n function preSign(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external;\n \n /// @dev Approves/unnapproves a Validator contract to verify signatures on signer's behalf.\n /// @param validatorAddress Address of Validator contract.\n /// @param approval Approval or disapproval of Validator contract.\n function setSignatureValidatorApproval(\n address validatorAddress,\n bool approval\n )\n external;\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signerAddress Address of signer.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes memory signature\n )\n public\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/ITransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\n\ncontract ITransactions {\n\n /// @dev Executes an exchange method call in the context of signer.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @param signature Proof of signer transaction by signer.\n function executeTransaction(\n uint256 salt,\n address signerAddress,\n bytes data,\n bytes signature\n )\n external;\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IValidator {\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IWallet.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IWallet {\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n bytes signature\n )\n external\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IWrapperFunctions {\n\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrKill.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrKillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrders(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerAsset is bought by taker.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrders(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously cancels multiple orders in a single transaction.\n /// @param orders Array of order specifications.\n function batchCancelOrders(LibOrder.Order[] memory orders)\n public;\n\n /// @dev Fetches information for all passed in orders\n /// @param orders Array of order specifications.\n /// @return Array of OrderInfo instances that correspond to each order.\n function getOrdersInfo(LibOrder.Order[] memory orders)\n public\n view\n returns (LibOrder.OrderInfo[] memory);\n}\n",
- "2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./LibOrder.sol\";\n\n\ncontract LibAbiEncoder {\n\n /// @dev ABI encodes calldata for `fillOrder`.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return ABI encoded calldata for `fillOrder`.\n function abiEncodeFillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n pure\n returns (bytes memory fillOrderCalldata)\n {\n // We need to call MExchangeCore.fillOrder using a delegatecall in\n // assembly so that we can intercept a call that throws. For this, we\n // need the input encoded in memory in the Ethereum ABIv2 format [1].\n\n // | Area | Offset | Length | Contents |\n // | -------- |--------|---------|-------------------------------------------- |\n // | Header | 0x00 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 0x00 | | 1. offset to order (*) |\n // | | 0x20 | | 2. takerAssetFillAmount |\n // | | 0x40 | | 3. offset to signature (*) |\n // | Data | | 12 * 32 | order: |\n // | | 0x000 | | 1. senderAddress |\n // | | 0x020 | | 2. makerAddress |\n // | | 0x040 | | 3. takerAddress |\n // | | 0x060 | | 4. feeRecipientAddress |\n // | | 0x080 | | 5. makerAssetAmount |\n // | | 0x0A0 | | 6. takerAssetAmount |\n // | | 0x0C0 | | 7. makerFeeAmount |\n // | | 0x0E0 | | 8. takerFeeAmount |\n // | | 0x100 | | 9. expirationTimeSeconds |\n // | | 0x120 | | 10. salt |\n // | | 0x140 | | 11. Offset to makerAssetData (*) |\n // | | 0x160 | | 12. Offset to takerAssetData (*) |\n // | | 0x180 | 32 | makerAssetData Length |\n // | | 0x1A0 | ** | makerAssetData Contents |\n // | | 0x1C0 | 32 | takerAssetData Length |\n // | | 0x1E0 | ** | takerAssetData Contents |\n // | | 0x200 | 32 | signature Length |\n // | | 0x220 | ** | signature Contents |\n\n // * Offsets are calculated from the beginning of the current area: Header, Params, Data:\n // An offset stored in the Params area is calculated from the beginning of the Params section.\n // An offset stored in the Data area is calculated from the beginning of the Data section.\n\n // ** The length of dynamic array contents are stored in the field immediately preceeding the contents.\n\n // [1]: https://solidity.readthedocs.io/en/develop/abi-spec.html\n\n assembly {\n\n // Areas below may use the following variables:\n // 1. <area>Start -- Start of this area in memory\n // 2. <area>End -- End of this area in memory. This value may\n // be precomputed (before writing contents),\n // or it may be computed as contents are written.\n // 3. <area>Offset -- Current offset into area. If an area's End\n // is precomputed, this variable tracks the\n // offsets of contents as they are written.\n\n /////// Setup Header Area ///////\n // Load free memory pointer\n fillOrderCalldata := mload(0x40)\n // bytes4(keccak256(\"fillOrder((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),uint256,bytes)\"))\n // = 0xb4be83d5\n // Leave 0x20 bytes to store the length\n mstore(add(fillOrderCalldata, 0x20), 0xb4be83d500000000000000000000000000000000000000000000000000000000)\n let headerAreaEnd := add(fillOrderCalldata, 0x24)\n\n /////// Setup Params Area ///////\n // This area is preallocated and written to later.\n // This is because we need to fill in offsets that have not yet been calculated.\n let paramsAreaStart := headerAreaEnd\n let paramsAreaEnd := add(paramsAreaStart, 0x60)\n let paramsAreaOffset := paramsAreaStart\n\n /////// Setup Data Area ///////\n let dataAreaStart := paramsAreaEnd\n let dataAreaEnd := dataAreaStart\n\n // Offset from the source data we're reading from\n let sourceOffset := order\n // arrayLenBytes and arrayLenWords track the length of a dynamically-allocated bytes array.\n let arrayLenBytes := 0\n let arrayLenWords := 0\n\n /////// Write order Struct ///////\n // Write memory location of Order, relative to the start of the\n // parameter list, then increment the paramsAreaOffset respectively.\n mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))\n paramsAreaOffset := add(paramsAreaOffset, 0x20)\n\n // Write values for each field in the order\n // It would be nice to use a loop, but we save on gas by writing\n // the stores sequentially.\n mstore(dataAreaEnd, mload(sourceOffset)) // makerAddress\n mstore(add(dataAreaEnd, 0x20), mload(add(sourceOffset, 0x20))) // takerAddress\n mstore(add(dataAreaEnd, 0x40), mload(add(sourceOffset, 0x40))) // feeRecipientAddress\n mstore(add(dataAreaEnd, 0x60), mload(add(sourceOffset, 0x60))) // senderAddress\n mstore(add(dataAreaEnd, 0x80), mload(add(sourceOffset, 0x80))) // makerAssetAmount\n mstore(add(dataAreaEnd, 0xA0), mload(add(sourceOffset, 0xA0))) // takerAssetAmount\n mstore(add(dataAreaEnd, 0xC0), mload(add(sourceOffset, 0xC0))) // makerFeeAmount\n mstore(add(dataAreaEnd, 0xE0), mload(add(sourceOffset, 0xE0))) // takerFeeAmount\n mstore(add(dataAreaEnd, 0x100), mload(add(sourceOffset, 0x100))) // expirationTimeSeconds\n mstore(add(dataAreaEnd, 0x120), mload(add(sourceOffset, 0x120))) // salt\n mstore(add(dataAreaEnd, 0x140), mload(add(sourceOffset, 0x140))) // Offset to makerAssetData\n mstore(add(dataAreaEnd, 0x160), mload(add(sourceOffset, 0x160))) // Offset to takerAssetData\n dataAreaEnd := add(dataAreaEnd, 0x180)\n sourceOffset := add(sourceOffset, 0x180)\n\n // Write offset to <order.makerAssetData>\n mstore(add(dataAreaStart, mul(10, 0x20)), sub(dataAreaEnd, dataAreaStart))\n\n // Calculate length of <order.makerAssetData>\n sourceOffset := mload(add(order, 0x140)) // makerAssetData\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of <order.makerAssetData>\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of <order.makerAssetData>\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n // Write offset to <order.takerAssetData>\n mstore(add(dataAreaStart, mul(11, 0x20)), sub(dataAreaEnd, dataAreaStart))\n\n // Calculate length of <order.takerAssetData>\n sourceOffset := mload(add(order, 0x160)) // takerAssetData\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of <order.takerAssetData>\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of <order.takerAssetData>\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n /////// Write takerAssetFillAmount ///////\n mstore(paramsAreaOffset, takerAssetFillAmount)\n paramsAreaOffset := add(paramsAreaOffset, 0x20)\n\n /////// Write signature ///////\n // Write offset to paramsArea\n mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))\n\n // Calculate length of signature\n sourceOffset := signature\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of signature\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of signature\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n // Set length of calldata\n mstore(fillOrderCalldata, sub(dataAreaEnd, add(fillOrderCalldata, 0x20)))\n\n // Increment free memory pointer\n mstore(0x40, dataAreaEnd)\n }\n\n return fillOrderCalldata;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibConstants.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\n// solhint-disable max-line-length\ncontract LibConstants {\n \n // Asset data for ZRX token. Used for fee transfers.\n // @TODO: Hardcode constant when we deploy. Currently \n // not constant to make testing easier.\n\n // The proxyId for ZRX_ASSET_DATA is bytes4(keccak256(\"ERC20Token(address)\")) = 0xf47261b0\n \n // Kovan ZRX address is 0x6ff6c0ff1d68b964901f986d4c9fa3ac68346570.\n // The ABI encoded proxyId and address is 0xf47261b00000000000000000000000006ff6c0ff1d68b964901f986d4c9fa3ac68346570\n // bytes constant public ZRX_ASSET_DATA = \"\\xf4\\x72\\x61\\xb0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x6f\\xf6\\xc0\\xff\\x1d\\x68\\xb9\\x64\\x90\\x1f\\x98\\x6d\\x4c\\x9f\\xa3\\xac\\x68\\x34\\x65\\x70\";\n \n // Mainnet ZRX address is 0xe41d2489571d322189246dafa5ebde1f4699f498.\n // The ABI encoded proxyId and address is 0xf47261b0000000000000000000000000e41d2489571d322189246dafa5ebde1f4699f498\n // bytes constant public ZRX_ASSET_DATA = \"\\xf4\\x72\\x61\\xb0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xe4\\x1d\\x24\\x89\\x57\\x1d\\x32\\x21\\x89\\x24\\x6d\\xaf\\xa5\\xeb\\xde\\x1f\\x46\\x99\\xf4\\x98\";\n \n // solhint-disable-next-line var-name-mixedcase\n bytes public ZRX_ASSET_DATA;\n\n // @TODO: Remove when we deploy.\n constructor (bytes memory zrxAssetData)\n public\n {\n ZRX_ASSET_DATA = zrxAssetData;\n }\n}\n// solhint-enable max-line-length\n",
- "2.0.0/protocol/Exchange/libs/LibEIP712.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract LibEIP712 {\n\n // EIP191 header for EIP712 prefix\n string constant internal EIP191_HEADER = \"\\x19\\x01\";\n\n // EIP712 Domain Name value\n string constant internal EIP712_DOMAIN_NAME = \"0x Protocol\";\n\n // EIP712 Domain Version value\n string constant internal EIP712_DOMAIN_VERSION = \"2\";\n\n // Hash of the EIP712 Domain Separator Schema\n bytes32 constant internal EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"EIP712Domain(\",\n \"string name,\",\n \"string version,\",\n \"address verifyingContract\",\n \")\"\n ));\n\n // Hash of the EIP712 Domain Separator data\n // solhint-disable-next-line var-name-mixedcase\n bytes32 public EIP712_DOMAIN_HASH;\n\n constructor ()\n public\n {\n EIP712_DOMAIN_HASH = keccak256(abi.encodePacked(\n EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH,\n keccak256(bytes(EIP712_DOMAIN_NAME)),\n keccak256(bytes(EIP712_DOMAIN_VERSION)),\n bytes32(address(this))\n ));\n }\n\n /// @dev Calculates EIP712 encoding for a hash struct in this EIP712 Domain.\n /// @param hashStruct The EIP712 hash struct.\n /// @return EIP712 hash applied to this EIP712 Domain.\n function hashEIP712Message(bytes32 hashStruct)\n internal\n view\n returns (bytes32 result)\n {\n bytes32 eip712DomainHash = EIP712_DOMAIN_HASH;\n\n // Assembly for more efficient computing:\n // keccak256(abi.encodePacked(\n // EIP191_HEADER,\n // EIP712_DOMAIN_HASH,\n // hashStruct \n // ));\n\n assembly {\n // Load free memory pointer\n let memPtr := mload(64)\n\n mstore(memPtr, 0x1901000000000000000000000000000000000000000000000000000000000000) // EIP191 header\n mstore(add(memPtr, 2), eip712DomainHash) // EIP712 domain hash\n mstore(add(memPtr, 34), hashStruct) // Hash of struct\n\n // Compute hash\n result := keccak256(memPtr, 66)\n }\n return result;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\n// solhint-disable\npragma solidity 0.4.24;\n\n\n/// @dev This contract documents the revert reasons used in the Exchange contract.\n/// This contract is intended to serve as a reference, but is not actually used for efficiency reasons.\ncontract LibExchangeErrors {\n\n /// Order validation errors ///\n string constant ORDER_UNFILLABLE = \"ORDER_UNFILLABLE\"; // Order cannot be filled.\n string constant INVALID_MAKER = \"INVALID_MAKER\"; // Invalid makerAddress.\n string constant INVALID_TAKER = \"INVALID_TAKER\"; // Invalid takerAddress.\n string constant INVALID_SENDER = \"INVALID_SENDER\"; // Invalid `msg.sender`.\n string constant INVALID_ORDER_SIGNATURE = \"INVALID_ORDER_SIGNATURE\"; // Signature validation failed. \n \n /// fillOrder validation errors ///\n string constant INVALID_TAKER_AMOUNT = \"INVALID_TAKER_AMOUNT\"; // takerAssetFillAmount cannot equal 0.\n string constant ROUNDING_ERROR = \"ROUNDING_ERROR\"; // Rounding error greater than 0.1% of takerAssetFillAmount. \n \n /// Signature validation errors ///\n string constant INVALID_SIGNATURE = \"INVALID_SIGNATURE\"; // Signature validation failed. \n string constant SIGNATURE_ILLEGAL = \"SIGNATURE_ILLEGAL\"; // Signature type is illegal.\n string constant SIGNATURE_UNSUPPORTED = \"SIGNATURE_UNSUPPORTED\"; // Signature type unsupported.\n \n /// cancelOrdersUptTo errors ///\n string constant INVALID_NEW_ORDER_EPOCH = \"INVALID_NEW_ORDER_EPOCH\"; // Specified salt must be greater than or equal to existing orderEpoch.\n\n /// fillOrKillOrder errors ///\n string constant COMPLETE_FILL_FAILED = \"COMPLETE_FILL_FAILED\"; // Desired takerAssetFillAmount could not be completely filled. \n\n /// matchOrders errors ///\n string constant NEGATIVE_SPREAD_REQUIRED = \"NEGATIVE_SPREAD_REQUIRED\"; // Matched orders must have a negative spread.\n\n /// Transaction errors ///\n string constant REENTRANCY_ILLEGAL = \"REENTRANCY_ILLEGAL\"; // Recursive reentrancy is not allowed. \n string constant INVALID_TX_HASH = \"INVALID_TX_HASH\"; // Transaction has already been executed. \n string constant INVALID_TX_SIGNATURE = \"INVALID_TX_SIGNATURE\"; // Signature validation failed. \n string constant FAILED_EXECUTION = \"FAILED_EXECUTION\"; // Transaction execution failed. \n \n /// registerAssetProxy errors ///\n string constant ASSET_PROXY_ALREADY_EXISTS = \"ASSET_PROXY_ALREADY_EXISTS\"; // AssetProxy with same id already exists.\n\n /// dispatchTransferFrom errors ///\n string constant ASSET_PROXY_DOES_NOT_EXIST = \"ASSET_PROXY_DOES_NOT_EXIST\"; // No assetProxy registered at given id.\n string constant TRANSFER_FAILED = \"TRANSFER_FAILED\"; // Asset transfer unsuccesful.\n\n /// Length validation errors ///\n string constant LENGTH_GREATER_THAN_0_REQUIRED = \"LENGTH_GREATER_THAN_0_REQUIRED\"; // Byte array must have a length greater than 0.\n string constant LENGTH_GREATER_THAN_3_REQUIRED = \"LENGTH_GREATER_THAN_3_REQUIRED\"; // Byte array must have a length greater than 3.\n string constant LENGTH_0_REQUIRED = \"LENGTH_0_REQUIRED\"; // Byte array must have a length of 0.\n string constant LENGTH_65_REQUIRED = \"LENGTH_65_REQUIRED\"; // Byte array must have a length of 65.\n}\n",
- "2.0.0/protocol/Exchange/libs/LibFillResults.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract LibFillResults is\n SafeMath\n{\n struct FillResults {\n uint256 makerAssetFilledAmount; // Total amount of makerAsset(s) filled.\n uint256 takerAssetFilledAmount; // Total amount of takerAsset(s) filled.\n uint256 makerFeePaid; // Total amount of ZRX paid by maker(s) to feeRecipient(s).\n uint256 takerFeePaid; // Total amount of ZRX paid by taker to feeRecipients(s).\n }\n\n struct MatchedFillResults {\n FillResults left; // Amounts filled and fees paid of left order.\n FillResults right; // Amounts filled and fees paid of right order.\n uint256 leftMakerAssetSpreadAmount; // Spread between price of left and right order, denominated in the left order's makerAsset, paid to taker.\n }\n\n /// @dev Adds properties of both FillResults instances.\n /// Modifies the first FillResults instance specified.\n /// @param totalFillResults Fill results instance that will be added onto.\n /// @param singleFillResults Fill results instance that will be added to totalFillResults.\n function addFillResults(FillResults memory totalFillResults, FillResults memory singleFillResults)\n internal\n pure\n {\n totalFillResults.makerAssetFilledAmount = safeAdd(totalFillResults.makerAssetFilledAmount, singleFillResults.makerAssetFilledAmount);\n totalFillResults.takerAssetFilledAmount = safeAdd(totalFillResults.takerAssetFilledAmount, singleFillResults.takerAssetFilledAmount);\n totalFillResults.makerFeePaid = safeAdd(totalFillResults.makerFeePaid, singleFillResults.makerFeePaid);\n totalFillResults.takerFeePaid = safeAdd(totalFillResults.takerFeePaid, singleFillResults.takerFeePaid);\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibMath.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract LibMath is\n SafeMath\n{\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// Reverts if rounding error is >= 0.1%\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded down.\n function safeGetPartialAmountFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n require(\n !isRoundingErrorFloor(\n numerator,\n denominator,\n target\n ),\n \"ROUNDING_ERROR\"\n );\n \n partialAmount = safeDiv(\n safeMul(numerator, target),\n denominator\n );\n return partialAmount;\n }\n\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// Reverts if rounding error is >= 0.1%\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded up.\n function safeGetPartialAmountCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n require(\n !isRoundingErrorCeil(\n numerator,\n denominator,\n target\n ),\n \"ROUNDING_ERROR\"\n );\n \n // safeDiv computes `floor(a / b)`. We use the identity (a, b integer):\n // ceil(a / b) = floor((a + b - 1) / b)\n // To implement `ceil(a / b)` using safeDiv.\n partialAmount = safeDiv(\n safeAdd(\n safeMul(numerator, target),\n safeSub(denominator, 1)\n ),\n denominator\n );\n return partialAmount;\n }\n\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded down.\n function getPartialAmountFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n partialAmount = safeDiv(\n safeMul(numerator, target),\n denominator\n );\n return partialAmount;\n }\n \n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded up.\n function getPartialAmountCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n // safeDiv computes `floor(a / b)`. We use the identity (a, b integer):\n // ceil(a / b) = floor((a + b - 1) / b)\n // To implement `ceil(a / b)` using safeDiv.\n partialAmount = safeDiv(\n safeAdd(\n safeMul(numerator, target),\n safeSub(denominator, 1)\n ),\n denominator\n );\n return partialAmount;\n }\n \n /// @dev Checks if rounding error >= 0.1% when rounding down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to multiply with numerator/denominator.\n /// @return Rounding error is present.\n function isRoundingErrorFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (bool isError)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n \n // The absolute rounding error is the difference between the rounded\n // value and the ideal value. The relative rounding error is the\n // absolute rounding error divided by the absolute value of the\n // ideal value. This is undefined when the ideal value is zero.\n //\n // The ideal value is `numerator * target / denominator`.\n // Let's call `numerator * target % denominator` the remainder.\n // The absolute error is `remainder / denominator`.\n //\n // When the ideal value is zero, we require the absolute error to\n // be zero. Fortunately, this is always the case. The ideal value is\n // zero iff `numerator == 0` and/or `target == 0`. In this case the\n // remainder and absolute error are also zero. \n if (target == 0 || numerator == 0) {\n return false;\n }\n \n // Otherwise, we want the relative rounding error to be strictly\n // less than 0.1%.\n // The relative error is `remainder / (numerator * target)`.\n // We want the relative error less than 1 / 1000:\n // remainder / (numerator * denominator) < 1 / 1000\n // or equivalently:\n // 1000 * remainder < numerator * target\n // so we have a rounding error iff:\n // 1000 * remainder >= numerator * target\n uint256 remainder = mulmod(\n target,\n numerator,\n denominator\n );\n isError = safeMul(1000, remainder) >= safeMul(numerator, target);\n return isError;\n }\n \n /// @dev Checks if rounding error >= 0.1% when rounding up.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to multiply with numerator/denominator.\n /// @return Rounding error is present.\n function isRoundingErrorCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (bool isError)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n \n // See the comments in `isRoundingError`.\n if (target == 0 || numerator == 0) {\n // When either is zero, the ideal value and rounded value are zero\n // and there is no rounding error. (Although the relative error\n // is undefined.)\n return false;\n }\n // Compute remainder as before\n uint256 remainder = mulmod(\n target,\n numerator,\n denominator\n );\n remainder = safeSub(denominator, remainder) % denominator;\n isError = safeMul(1000, remainder) >= safeMul(numerator, target);\n return isError;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibOrder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./LibEIP712.sol\";\n\n\ncontract LibOrder is\n LibEIP712\n{\n // Hash for the EIP712 Order Schema\n bytes32 constant internal EIP712_ORDER_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"Order(\",\n \"address makerAddress,\",\n \"address takerAddress,\",\n \"address feeRecipientAddress,\",\n \"address senderAddress,\",\n \"uint256 makerAssetAmount,\",\n \"uint256 takerAssetAmount,\",\n \"uint256 makerFee,\",\n \"uint256 takerFee,\",\n \"uint256 expirationTimeSeconds,\",\n \"uint256 salt,\",\n \"bytes makerAssetData,\",\n \"bytes takerAssetData\",\n \")\"\n ));\n\n // A valid order remains fillable until it is expired, fully filled, or cancelled.\n // An order's state is unaffected by external factors, like account balances.\n enum OrderStatus {\n INVALID, // Default value\n INVALID_MAKER_ASSET_AMOUNT, // Order does not have a valid maker asset amount\n INVALID_TAKER_ASSET_AMOUNT, // Order does not have a valid taker asset amount\n FILLABLE, // Order is fillable\n EXPIRED, // Order has already expired\n FULLY_FILLED, // Order is fully filled\n CANCELLED // Order has been cancelled\n }\n\n // solhint-disable max-line-length\n struct Order {\n address makerAddress; // Address that created the order. \n address takerAddress; // Address that is allowed to fill the order. If set to 0, any address is allowed to fill the order. \n address feeRecipientAddress; // Address that will recieve fees when order is filled. \n address senderAddress; // Address that is allowed to call Exchange contract methods that affect this order. If set to 0, any address is allowed to call these methods.\n uint256 makerAssetAmount; // Amount of makerAsset being offered by maker. Must be greater than 0. \n uint256 takerAssetAmount; // Amount of takerAsset being bid on by maker. Must be greater than 0. \n uint256 makerFee; // Amount of ZRX paid to feeRecipient by maker when order is filled. If set to 0, no transfer of ZRX from maker to feeRecipient will be attempted.\n uint256 takerFee; // Amount of ZRX paid to feeRecipient by taker when order is filled. If set to 0, no transfer of ZRX from taker to feeRecipient will be attempted.\n uint256 expirationTimeSeconds; // Timestamp in seconds at which order expires. \n uint256 salt; // Arbitrary number to facilitate uniqueness of the order's hash. \n bytes makerAssetData; // Encoded data that can be decoded by a specified proxy contract when transferring makerAsset. The last byte references the id of this proxy.\n bytes takerAssetData; // Encoded data that can be decoded by a specified proxy contract when transferring takerAsset. The last byte references the id of this proxy.\n }\n // solhint-enable max-line-length\n\n struct OrderInfo {\n uint8 orderStatus; // Status that describes order's validity and fillability.\n bytes32 orderHash; // EIP712 hash of the order (see LibOrder.getOrderHash).\n uint256 orderTakerAssetFilledAmount; // Amount of order that has already been filled.\n }\n\n /// @dev Calculates Keccak-256 hash of the order.\n /// @param order The order structure.\n /// @return Keccak-256 EIP712 hash of the order.\n function getOrderHash(Order memory order)\n internal\n view\n returns (bytes32 orderHash)\n {\n orderHash = hashEIP712Message(hashOrder(order));\n return orderHash;\n }\n\n /// @dev Calculates EIP712 hash of the order.\n /// @param order The order structure.\n /// @return EIP712 hash of the order.\n function hashOrder(Order memory order)\n internal\n pure\n returns (bytes32 result)\n {\n bytes32 schemaHash = EIP712_ORDER_SCHEMA_HASH;\n bytes32 makerAssetDataHash = keccak256(order.makerAssetData);\n bytes32 takerAssetDataHash = keccak256(order.takerAssetData);\n\n // Assembly for more efficiently computing:\n // keccak256(abi.encodePacked(\n // EIP712_ORDER_SCHEMA_HASH,\n // bytes32(order.makerAddress),\n // bytes32(order.takerAddress),\n // bytes32(order.feeRecipientAddress),\n // bytes32(order.senderAddress),\n // order.makerAssetAmount,\n // order.takerAssetAmount,\n // order.makerFee,\n // order.takerFee,\n // order.expirationTimeSeconds,\n // order.salt,\n // keccak256(order.makerAssetData),\n // keccak256(order.takerAssetData)\n // ));\n\n assembly {\n // Calculate memory addresses that will be swapped out before hashing\n let pos1 := sub(order, 32)\n let pos2 := add(order, 320)\n let pos3 := add(order, 352)\n\n // Backup\n let temp1 := mload(pos1)\n let temp2 := mload(pos2)\n let temp3 := mload(pos3)\n \n // Hash in place\n mstore(pos1, schemaHash)\n mstore(pos2, makerAssetDataHash)\n mstore(pos3, takerAssetDataHash)\n result := keccak256(pos1, 416)\n \n // Restore\n mstore(pos1, temp1)\n mstore(pos2, temp2)\n mstore(pos3, temp3)\n }\n return result;\n }\n}\n",
- "2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAssetProxyDispatcher.sol\";\n\n\ncontract MAssetProxyDispatcher is\n IAssetProxyDispatcher\n{\n // Logs registration of new asset proxy\n event AssetProxyRegistered(\n bytes4 id, // Id of new registered AssetProxy.\n address assetProxy // Address of new registered AssetProxy.\n );\n\n /// @dev Forwards arguments to assetProxy and calls `transferFrom`. Either succeeds or throws.\n /// @param assetData Byte array encoded for the asset.\n /// @param from Address to transfer token from.\n /// @param to Address to transfer token to.\n /// @param amount Amount of token to transfer.\n function dispatchTransferFrom(\n bytes memory assetData,\n address from,\n address to,\n uint256 amount\n )\n internal;\n}\n",
- "2.0.0/protocol/Exchange/mixins/MExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IExchangeCore.sol\";\n\n\ncontract MExchangeCore is\n IExchangeCore\n{\n // Fill event is emitted whenever an order is filled.\n event Fill(\n address indexed makerAddress, // Address that created the order. \n address indexed feeRecipientAddress, // Address that received fees.\n address takerAddress, // Address that filled the order.\n address senderAddress, // Address that called the Exchange contract (msg.sender).\n uint256 makerAssetFilledAmount, // Amount of makerAsset sold by maker and bought by taker. \n uint256 takerAssetFilledAmount, // Amount of takerAsset sold by taker and bought by maker.\n uint256 makerFeePaid, // Amount of ZRX paid to feeRecipient by maker.\n uint256 takerFeePaid, // Amount of ZRX paid to feeRecipient by taker.\n bytes32 indexed orderHash, // EIP712 hash of order (see LibOrder.getOrderHash).\n bytes makerAssetData, // Encoded data specific to makerAsset. \n bytes takerAssetData // Encoded data specific to takerAsset.\n );\n\n // Cancel event is emitted whenever an individual order is cancelled.\n event Cancel(\n address indexed makerAddress, // Address that created the order. \n address indexed feeRecipientAddress, // Address that would have recieved fees if order was filled. \n address senderAddress, // Address that called the Exchange contract (msg.sender).\n bytes32 indexed orderHash, // EIP712 hash of order (see LibOrder.getOrderHash).\n bytes makerAssetData, // Encoded data specific to makerAsset. \n bytes takerAssetData // Encoded data specific to takerAsset.\n );\n\n // CancelUpTo event is emitted whenever `cancelOrdersUpTo` is executed succesfully.\n event CancelUpTo(\n address indexed makerAddress, // Orders cancelled must have been created by this address.\n address indexed senderAddress, // Orders cancelled must have a `senderAddress` equal to this address.\n uint256 orderEpoch // Orders with specified makerAddress and senderAddress with a salt less than this value are considered cancelled.\n );\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev After calling, the order can not be filled anymore.\n /// @param order Order struct containing order specifications.\n function cancelOrderInternal(LibOrder.Order memory order)\n internal;\n\n /// @dev Updates state with results of a fill order.\n /// @param order that was filled.\n /// @param takerAddress Address of taker who filled the order.\n /// @param orderTakerAssetFilledAmount Amount of order already filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function updateFilledState(\n LibOrder.Order memory order,\n address takerAddress,\n bytes32 orderHash,\n uint256 orderTakerAssetFilledAmount,\n LibFillResults.FillResults memory fillResults\n )\n internal;\n\n /// @dev Updates state with results of cancelling an order.\n /// State is only updated if the order is currently fillable.\n /// Otherwise, updating state would have no effect.\n /// @param order that was cancelled.\n /// @param orderHash Hash of order that was cancelled.\n function updateCancelledState(\n LibOrder.Order memory order,\n bytes32 orderHash\n )\n internal;\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAddress Address of order taker.\n /// @param signature Proof that the orders was created by its maker.\n function assertFillableOrder(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo,\n address takerAddress,\n bytes memory signature\n )\n internal\n view;\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo Status, orderHash, and amount already filled of order.\n /// @param takerAssetFillAmount Desired amount of order to fill by taker.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @param makerAssetFilledAmount Amount of makerAsset that will be transfered.\n function assertValidFill(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo,\n uint256 takerAssetFillAmount,\n uint256 takerAssetFilledAmount,\n uint256 makerAssetFilledAmount\n )\n internal\n view;\n\n /// @dev Validates context for cancelOrder. Succeeds or throws.\n /// @param order to be cancelled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n function assertValidCancel(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo\n )\n internal\n view;\n\n /// @dev Calculates amounts filled and fees paid by maker and taker.\n /// @param order to be filled.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function calculateFillResults(\n LibOrder.Order memory order,\n uint256 takerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.FillResults memory fillResults);\n\n}\n",
- "2.0.0/protocol/Exchange/mixins/MMatchOrders.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IMatchOrders.sol\";\n\n\ncontract MMatchOrders is\n IMatchOrders\n{\n /// @dev Validates context for matchOrders. Succeeds or throws.\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n function assertValidMatch(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder\n )\n internal\n pure;\n\n /// @dev Calculates fill amounts for the matched orders.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the leftOrder order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftOrderTakerAssetFilledAmount Amount of left order already filled.\n /// @param rightOrderTakerAssetFilledAmount Amount of right order already filled.\n /// @param matchedFillResults Amounts to fill and fees to pay by maker and taker of matched orders.\n function calculateMatchedFillResults(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n uint256 leftOrderTakerAssetFilledAmount,\n uint256 rightOrderTakerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.MatchedFillResults memory matchedFillResults);\n\n}\n",
- "2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/ISignatureValidator.sol\";\n\n\ncontract MSignatureValidator is\n ISignatureValidator\n{\n event SignatureValidatorApproval(\n address indexed signerAddress, // Address that approves or disapproves a contract to verify signatures.\n address indexed validatorAddress, // Address of signature validator contract.\n bool approved // Approval or disapproval of validator contract.\n );\n\n // Allowed signature types.\n enum SignatureType {\n Illegal, // 0x00, default value\n Invalid, // 0x01\n EIP712, // 0x02\n EthSign, // 0x03\n Wallet, // 0x04\n Validator, // 0x05\n PreSigned, // 0x06\n NSignatureTypes // 0x07, number of signature types. Always leave at end.\n }\n\n /// @dev Verifies signature using logic defined by Wallet contract.\n /// @param hash Any 32 byte hash.\n /// @param walletAddress Address that should have signed the given hash\n /// and defines its own signature verification method.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidWalletSignature(\n bytes32 hash,\n address walletAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid);\n\n /// @dev Verifies signature using logic defined by Validator contract.\n /// @param validatorAddress Address of validator contract.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidValidatorSignature(\n address validatorAddress,\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/mixins/MTransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\nimport \"../interfaces/ITransactions.sol\";\n\n\ncontract MTransactions is\n ITransactions\n{\n // Hash for the EIP712 ZeroEx Transaction Schema\n bytes32 constant internal EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"ZeroExTransaction(\",\n \"uint256 salt,\",\n \"address signerAddress,\",\n \"bytes data\",\n \")\"\n ));\n\n /// @dev Calculates EIP712 hash of the Transaction.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @return EIP712 hash of the Transaction.\n function hashZeroExTransaction(\n uint256 salt,\n address signerAddress,\n bytes memory data\n )\n internal\n pure\n returns (bytes32 result);\n\n /// @dev The current function will be called in the context of this address (either 0x transaction signer or `msg.sender`).\n /// If calling a fill function, this address will represent the taker.\n /// If calling a cancel function, this address will represent the maker.\n /// @return Signer of 0x transaction if entry point is `executeTransaction`.\n /// `msg.sender` if entry point is any other function.\n function getCurrentContextAddress()\n internal\n view\n returns (address);\n}\n",
- "2.0.0/protocol/Exchange/mixins/MWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IWrapperFunctions.sol\";\n\n\ncontract MWrapperFunctions is \n IWrapperFunctions\n{\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n}\n",
- "2.0.0/test/DummyERC20Token/DummyERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"../../tokens/ERC20Token/MintableERC20Token.sol\";\n\n\ncontract DummyERC20Token is \n Ownable,\n MintableERC20Token\n{\n string public name;\n string public symbol;\n uint256 public decimals;\n uint256 public constant MAX_MINT_AMOUNT = 10000000000000000000000;\n\n constructor (\n string _name,\n string _symbol,\n uint256 _decimals,\n uint256 _totalSupply\n )\n public\n {\n name = _name;\n symbol = _symbol;\n decimals = _decimals;\n _totalSupply = _totalSupply;\n balances[msg.sender] = _totalSupply;\n }\n\n /// @dev Sets the balance of target address\n /// @param _target Address or which balance will be updated\n /// @param _value New balance of target address\n function setBalance(address _target, uint256 _value)\n external\n onlyOwner\n {\n uint256 currBalance = balances[_target];\n if (_value < currBalance) {\n _totalSupply = safeSub(_totalSupply, safeSub(currBalance, _value));\n } else {\n _totalSupply = safeAdd(_totalSupply, safeSub(_value, currBalance));\n }\n balances[_target] = _value;\n }\n\n /// @dev Mints new tokens for sender\n /// @param _value Amount of tokens to mint\n function mint(uint256 _value)\n external\n {\n require(\n _value <= MAX_MINT_AMOUNT,\n \"VALUE_TOO_LARGE\"\n );\n\n _mint(msg.sender, _value);\n }\n}\n",
- "2.0.0/test/DummyERC721Token/DummyERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../tokens/ERC721Token/MintableERC721Token.sol\";\nimport \"../../utils/Ownable/Ownable.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract DummyERC721Token is\n Ownable,\n MintableERC721Token\n{\n string public name;\n string public symbol;\n\n constructor (\n string _name,\n string _symbol\n )\n public\n {\n name = _name;\n symbol = _symbol;\n }\n\n /// @dev Function to mint a new token\n /// Reverts if the given token ID already exists\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _tokenId ID of the token to be minted by the msg.sender \n function mint(address _to, uint256 _tokenId)\n external\n {\n _mint(_to, _tokenId);\n }\n\n /// @dev Function to burn a token\n /// Reverts if the given token ID doesn't exist or not called by contract owner\n /// @param _owner Owner of token with given token ID\n /// @param _tokenId ID of the token to be burned by the msg.sender\n function burn(address _owner, uint256 _tokenId)\n external\n onlyOwner\n {\n _burn(_owner, _tokenId);\n }\n}\n",
- "2.0.0/tokens/ERC20Token/ERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IERC20Token.sol\";\n\n\ncontract ERC20Token is\n IERC20Token\n{\n mapping (address => uint256) internal balances;\n mapping (address => mapping (address => uint256)) internal allowed;\n\n uint256 internal _totalSupply;\n\n /// @dev send `value` token to `to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transfer(address _to, uint256 _value)\n external\n returns (bool)\n {\n require(\n balances[msg.sender] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[msg.sender] -= _value;\n balances[_to] += _value;\n\n emit Transfer(\n msg.sender,\n _to,\n _value\n );\n\n return true;\n }\n\n /// @dev send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool)\n {\n require(\n balances[_from] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n allowed[_from][msg.sender] >= _value,\n \"ERC20_INSUFFICIENT_ALLOWANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[_to] += _value;\n balances[_from] -= _value;\n allowed[_from][msg.sender] -= _value;\n \n emit Transfer(\n _from,\n _to,\n _value\n );\n \n return true;\n }\n\n /// @dev `msg.sender` approves `_spender` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Always true if the call has enough gas to complete execution\n function approve(address _spender, uint256 _value)\n external\n returns (bool)\n {\n allowed[msg.sender][_spender] = _value;\n emit Approval(\n msg.sender,\n _spender,\n _value\n );\n return true;\n }\n\n /// @dev Query total supply of token\n /// @return Total supply of token\n function totalSupply()\n external\n view\n returns (uint256)\n {\n return _totalSupply;\n }\n\n /// @dev Query the balance of owner\n /// @param _owner The address from which the balance will be retrieved\n /// @return Balance of owner\n function balanceOf(address _owner)\n external\n view\n returns (uint256)\n {\n return balances[_owner];\n }\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender)\n external\n view\n returns (uint256)\n {\n return allowed[_owner][_spender];\n }\n}\n",
- "2.0.0/tokens/ERC20Token/IERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC20Token {\n\n // solhint-disable no-simple-event-func-name\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 _value\n );\n\n event Approval(\n address indexed _owner,\n address indexed _spender,\n uint256 _value\n );\n\n /// @dev send `value` token to `to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transfer(address _to, uint256 _value)\n external\n returns (bool);\n\n /// @dev send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool);\n \n /// @dev `msg.sender` approves `_spender` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Always true if the call has enough gas to complete execution\n function approve(address _spender, uint256 _value)\n external\n returns (bool);\n\n /// @dev Query total supply of token\n /// @return Total supply of token\n function totalSupply()\n external\n view\n returns (uint256);\n \n /// @param _owner The address from which the balance will be retrieved\n /// @return Balance of owner\n function balanceOf(address _owner)\n external\n view\n returns (uint256);\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender)\n external\n view\n returns (uint256);\n}\n",
- "2.0.0/tokens/ERC20Token/MintableERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/SafeMath/SafeMath.sol\";\nimport \"./UnlimitedAllowanceERC20Token.sol\";\n\n\ncontract MintableERC20Token is \n SafeMath,\n UnlimitedAllowanceERC20Token\n{\n /// @dev Mints new tokens\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _value Amount of tokens to mint\n function _mint(address _to, uint256 _value)\n internal\n {\n balances[_to] = safeAdd(_value, balances[_to]);\n _totalSupply = safeAdd(_totalSupply, _value);\n\n emit Transfer(\n address(0),\n _to,\n _value\n );\n }\n\n /// @dev Mints new tokens\n /// @param _owner Owner of tokens that will be burned\n /// @param _value Amount of tokens to burn\n function _burn(address _owner, uint256 _value)\n internal\n {\n balances[_owner] = safeSub(balances[_owner], _value);\n _totalSupply = safeSub(_totalSupply, _value);\n\n emit Transfer(\n _owner,\n address(0),\n _value\n );\n }\n}\n",
- "2.0.0/tokens/ERC20Token/UnlimitedAllowanceERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../ERC20Token/ERC20Token.sol\";\n\n\ncontract UnlimitedAllowanceERC20Token is\n ERC20Token\n{\n uint256 constant internal MAX_UINT = 2**256 - 1;\n\n /// @dev ERC20 transferFrom, modified such that an allowance of MAX_UINT represents an unlimited allowance. See https://github.com/ethereum/EIPs/issues/717\n /// @param _from Address to transfer from.\n /// @param _to Address to transfer to.\n /// @param _value Amount to transfer.\n /// @return Success of transfer.\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool)\n {\n uint256 allowance = allowed[_from][msg.sender];\n require(\n balances[_from] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n allowance >= _value,\n \"ERC20_INSUFFICIENT_ALLOWANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[_to] += _value;\n balances[_from] -= _value;\n if (allowance < MAX_UINT) {\n allowed[_from][msg.sender] -= _value;\n }\n\n emit Transfer(\n _from,\n _to,\n _value\n );\n\n return true;\n }\n}\n",
- "2.0.0/tokens/ERC721Token/ERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IERC721Token.sol\";\nimport \"./IERC721Receiver.sol\";\nimport \"../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract ERC721Token is\n IERC721Token,\n SafeMath\n{\n // Function selector for ERC721Receiver.onERC721Received\n // 0x150b7a02\n bytes4 constant internal ERC721_RECEIVED = bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"));\n\n // Mapping of tokenId => owner\n mapping (uint256 => address) internal owners;\n\n // Mapping of tokenId => approved address\n mapping (uint256 => address) internal approvals;\n\n // Mapping of owner => number of tokens owned\n mapping (address => uint256) internal balances;\n\n // Mapping of owner => operator => approved\n mapping (address => mapping (address => bool)) internal operatorApprovals;\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT. When transfer is complete, this function\n /// checks if `_to` is a smart contract (code size > 0). If so, it calls\n /// `onERC721Received` on `_to` and throws if the return value is not\n /// `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n /// @param _data Additional data with no specified format, sent in call to `_to`\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId,\n bytes _data\n )\n external\n {\n transferFrom(\n _from,\n _to,\n _tokenId\n );\n\n uint256 receiverCodeSize;\n assembly {\n receiverCodeSize := extcodesize(_to)\n }\n if (receiverCodeSize > 0) {\n bytes4 selector = IERC721Receiver(_to).onERC721Received(\n msg.sender,\n _from,\n _tokenId,\n _data\n );\n require(\n selector == ERC721_RECEIVED,\n \"ERC721_INVALID_SELECTOR\"\n );\n }\n }\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev This works identically to the other function with an extra data parameter,\n /// except this function just sets data to \"\".\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n external\n {\n transferFrom(\n _from,\n _to,\n _tokenId\n );\n\n uint256 receiverCodeSize;\n assembly {\n receiverCodeSize := extcodesize(_to)\n }\n if (receiverCodeSize > 0) {\n bytes4 selector = IERC721Receiver(_to).onERC721Received(\n msg.sender,\n _from,\n _tokenId,\n \"\"\n );\n require(\n selector == ERC721_RECEIVED,\n \"ERC721_INVALID_SELECTOR\"\n );\n }\n }\n\n /// @notice Change or reaffirm the approved address for an NFT\n /// @dev The zero address indicates there is no approved address.\n /// Throws unless `msg.sender` is the current NFT owner, or an authorized\n /// operator of the current owner.\n /// @param _approved The new approved NFT controller\n /// @param _tokenId The NFT to approve\n function approve(address _approved, uint256 _tokenId)\n external\n {\n address owner = ownerOf(_tokenId);\n require(\n msg.sender == owner || isApprovedForAll(owner, msg.sender),\n \"ERC721_INVALID_SENDER\"\n );\n\n approvals[_tokenId] = _approved;\n emit Approval(\n owner,\n _approved,\n _tokenId\n );\n }\n\n /// @notice Enable or disable approval for a third party (\"operator\") to manage\n /// all of `msg.sender`'s assets\n /// @dev Emits the ApprovalForAll event. The contract MUST allow\n /// multiple operators per owner.\n /// @param _operator Address to add to the set of authorized operators\n /// @param _approved True if the operator is approved, false to revoke approval\n function setApprovalForAll(address _operator, bool _approved)\n external\n {\n operatorApprovals[msg.sender][_operator] = _approved;\n emit ApprovalForAll(\n msg.sender,\n _operator,\n _approved\n );\n }\n \n /// @notice Count all NFTs assigned to an owner\n /// @dev NFTs assigned to the zero address are considered invalid, and this\n /// function throws for queries about the zero address.\n /// @param _owner An address for whom to query the balance\n /// @return The number of NFTs owned by `_owner`, possibly zero\n function balanceOf(address _owner)\n external\n view\n returns (uint256)\n {\n require(\n _owner != address(0),\n \"ERC721_ZERO_OWNER\"\n );\n return balances[_owner];\n }\n\n /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE\n /// TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE\n /// THEY MAY BE PERMANENTLY LOST\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function transferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n public\n {\n require(\n _to != address(0),\n \"ERC721_ZERO_TO_ADDRESS\"\n );\n\n address owner = ownerOf(_tokenId);\n require(\n _from == owner,\n \"ERC721_OWNER_MISMATCH\"\n );\n\n address spender = msg.sender;\n address approvedAddress = getApproved(_tokenId);\n require(\n spender == owner ||\n isApprovedForAll(owner, spender) ||\n approvedAddress == spender,\n \"ERC721_INVALID_SPENDER\"\n );\n\n if (approvedAddress != address(0)) {\n approvals[_tokenId] = address(0);\n }\n\n owners[_tokenId] = _to;\n balances[_from] = safeSub(balances[_from], 1);\n balances[_to] = safeAdd(balances[_to], 1);\n \n emit Transfer(\n _from,\n _to,\n _tokenId\n );\n }\n\n /// @notice Find the owner of an NFT\n /// @dev NFTs assigned to zero address are considered invalid, and queries\n /// about them do throw.\n /// @param _tokenId The identifier for an NFT\n /// @return The address of the owner of the NFT\n function ownerOf(uint256 _tokenId)\n public\n view\n returns (address)\n {\n address owner = owners[_tokenId];\n require(\n owner != address(0),\n \"ERC721_ZERO_OWNER\"\n );\n return owner;\n }\n\n /// @notice Get the approved address for a single NFT\n /// @dev Throws if `_tokenId` is not a valid NFT.\n /// @param _tokenId The NFT to find the approved address for\n /// @return The approved address for this NFT, or the zero address if there is none\n function getApproved(uint256 _tokenId)\n public\n view\n returns (address)\n {\n return approvals[_tokenId];\n }\n\n /// @notice Query if an address is an authorized operator for another address\n /// @param _owner The address that owns the NFTs\n /// @param _operator The address that acts on behalf of the owner\n /// @return True if `_operator` is an approved operator for `_owner`, false otherwise\n function isApprovedForAll(address _owner, address _operator)\n public\n view\n returns (bool)\n {\n return operatorApprovals[_owner][_operator];\n }\n}\n",
- "2.0.0/tokens/ERC721Token/IERC721Receiver.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC721Receiver {\n\n /// @notice Handle the receipt of an NFT\n /// @dev The ERC721 smart contract calls this function on the recipient\n /// after a `transfer`. This function MAY throw to revert and reject the\n /// transfer. Return of other than the magic value MUST result in the\n /// transaction being reverted.\n /// Note: the contract address is always the message sender.\n /// @param _operator The address which called `safeTransferFrom` function\n /// @param _from The address which previously owned the token\n /// @param _tokenId The NFT identifier which is being transferred\n /// @param _data Additional data with no specified format\n /// @return `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`\n /// unless throwing\n function onERC721Received(\n address _operator,\n address _from,\n uint256 _tokenId,\n bytes _data\n )\n external\n returns (bytes4);\n}\n",
- "2.0.0/tokens/ERC721Token/IERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC721Token {\n\n /// @dev This emits when ownership of any NFT changes by any mechanism.\n /// This event emits when NFTs are created (`from` == 0) and destroyed\n /// (`to` == 0). Exception: during contract creation, any number of NFTs\n /// may be created and assigned without emitting Transfer. At the time of\n /// any transfer, the approved address for that NFT (if any) is reset to none.\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 indexed _tokenId\n );\n\n /// @dev This emits when the approved address for an NFT is changed or\n /// reaffirmed. The zero address indicates there is no approved address.\n /// When a Transfer event emits, this also indicates that the approved\n /// address for that NFT (if any) is reset to none.\n event Approval(\n address indexed _owner,\n address indexed _approved,\n uint256 indexed _tokenId\n );\n\n /// @dev This emits when an operator is enabled or disabled for an owner.\n /// The operator can manage all NFTs of the owner.\n event ApprovalForAll(\n address indexed _owner,\n address indexed _operator,\n bool _approved\n );\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// perator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT. When transfer is complete, this function\n /// checks if `_to` is a smart contract (code size > 0). If so, it calls\n /// `onERC721Received` on `_to` and throws if the return value is not\n /// `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n /// @param _data Additional data with no specified format, sent in call to `_to`\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId,\n bytes _data\n )\n external;\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev This works identically to the other function with an extra data parameter,\n /// except this function just sets data to \"\".\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n external;\n\n /// @notice Change or reaffirm the approved address for an NFT\n /// @dev The zero address indicates there is no approved address.\n /// Throws unless `msg.sender` is the current NFT owner, or an authorized\n /// operator of the current owner.\n /// @param _approved The new approved NFT controller\n /// @param _tokenId The NFT to approve\n function approve(address _approved, uint256 _tokenId)\n external;\n\n /// @notice Enable or disable approval for a third party (\"operator\") to manage\n /// all of `msg.sender`'s assets\n /// @dev Emits the ApprovalForAll event. The contract MUST allow\n /// multiple operators per owner.\n /// @param _operator Address to add to the set of authorized operators\n /// @param _approved True if the operator is approved, false to revoke approval\n function setApprovalForAll(address _operator, bool _approved)\n external;\n\n /// @notice Count all NFTs assigned to an owner\n /// @dev NFTs assigned to the zero address are considered invalid, and this\n /// function throws for queries about the zero address.\n /// @param _owner An address for whom to query the balance\n /// @return The number of NFTs owned by `_owner`, possibly zero\n function balanceOf(address _owner)\n external\n view\n returns (uint256);\n\n /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE\n /// TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE\n /// THEY MAY BE PERMANENTLY LOST\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function transferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n public;\n\n /// @notice Find the owner of an NFT\n /// @dev NFTs assigned to zero address are considered invalid, and queries\n /// about them do throw.\n /// @param _tokenId The identifier for an NFT\n /// @return The address of the owner of the NFT\n function ownerOf(uint256 _tokenId)\n public\n view\n returns (address);\n\n /// @notice Get the approved address for a single NFT\n /// @dev Throws if `_tokenId` is not a valid NFT.\n /// @param _tokenId The NFT to find the approved address for\n /// @return The approved address for this NFT, or the zero address if there is none\n function getApproved(uint256 _tokenId) \n public\n view\n returns (address);\n \n /// @notice Query if an address is an authorized operator for another address\n /// @param _owner The address that owns the NFTs\n /// @param _operator The address that acts on behalf of the owner\n /// @return True if `_operator` is an approved operator for `_owner`, false otherwise\n function isApprovedForAll(address _owner, address _operator)\n public\n view\n returns (bool);\n}\n",
- "2.0.0/tokens/ERC721Token/MintableERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./ERC721Token.sol\";\n\n\ncontract MintableERC721Token is\n ERC721Token\n{\n /// @dev Function to mint a new token\n /// Reverts if the given token ID already exists\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _tokenId ID of the token to be minted by the msg.sender \n function _mint(address _to, uint256 _tokenId)\n internal\n {\n require(\n _to != address(0),\n \"ERC721_ZERO_TO_ADDRESS\"\n );\n\n address owner = owners[_tokenId];\n require(\n owner == address(0),\n \"ERC721_OWNER_ALREADY_EXISTS\"\n );\n\n owners[_tokenId] = _to;\n balances[_to] = safeAdd(balances[_to], 1);\n\n emit Transfer(\n address(0),\n _to,\n _tokenId\n );\n }\n\n /// @dev Function to burn a token\n /// Reverts if the given token ID doesn't exist\n /// @param _owner Owner of token with given token ID\n /// @param _tokenId ID of the token to be burned by the msg.sender\n function _burn(address _owner, uint256 _tokenId)\n internal\n {\n require(\n _owner != address(0),\n \"ERC721_ZERO_OWNER_ADDRESS\"\n );\n\n address owner = owners[_tokenId];\n require(\n owner == _owner,\n \"ERC721_OWNER_MISMATCH\"\n );\n\n owners[_tokenId] = address(0);\n balances[_owner] = safeSub(balances[_owner], 1);\n\n emit Transfer(\n _owner,\n address(0),\n _tokenId\n );\n }\n}\n",
- "2.0.0/tokens/EtherToken/IEtherToken.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../ERC20Token/IERC20Token.sol\";\n\n\ncontract IEtherToken is\n IERC20Token\n{\n function deposit()\n public\n payable;\n \n function withdraw(uint256 amount)\n public;\n}\n",
- "2.0.0/utils/LibBytes/LibBytes.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\nlibrary LibBytes {\n\n using LibBytes for bytes;\n\n /// @dev Gets the memory address for a byte array.\n /// @param input Byte array to lookup.\n /// @return memoryAddress Memory address of byte array. This\n /// points to the header of the byte array which contains\n /// the length.\n function rawAddress(bytes memory input)\n internal\n pure\n returns (uint256 memoryAddress)\n {\n assembly {\n memoryAddress := input\n }\n return memoryAddress;\n }\n \n /// @dev Gets the memory address for the contents of a byte array.\n /// @param input Byte array to lookup.\n /// @return memoryAddress Memory address of the contents of the byte array.\n function contentAddress(bytes memory input)\n internal\n pure\n returns (uint256 memoryAddress)\n {\n assembly {\n memoryAddress := add(input, 32)\n }\n return memoryAddress;\n }\n\n /// @dev Copies `length` bytes from memory location `source` to `dest`.\n /// @param dest memory address to copy bytes to.\n /// @param source memory address to copy bytes from.\n /// @param length number of bytes to copy.\n function memCopy(\n uint256 dest,\n uint256 source,\n uint256 length\n )\n internal\n pure\n {\n if (length < 32) {\n // Handle a partial word by reading destination and masking\n // off the bits we are interested in.\n // This correctly handles overlap, zero lengths and source == dest\n assembly {\n let mask := sub(exp(256, sub(32, length)), 1)\n let s := and(mload(source), not(mask))\n let d := and(mload(dest), mask)\n mstore(dest, or(s, d))\n }\n } else {\n // Skip the O(length) loop when source == dest.\n if (source == dest) {\n return;\n }\n\n // For large copies we copy whole words at a time. The final\n // word is aligned to the end of the range (instead of after the\n // previous) to handle partial words. So a copy will look like this:\n //\n // ####\n // ####\n // ####\n // ####\n //\n // We handle overlap in the source and destination range by\n // changing the copying direction. This prevents us from\n // overwriting parts of source that we still need to copy.\n //\n // This correctly handles source == dest\n //\n if (source > dest) {\n assembly {\n // We subtract 32 from `sEnd` and `dEnd` because it\n // is easier to compare with in the loop, and these\n // are also the addresses we need for copying the\n // last bytes.\n length := sub(length, 32)\n let sEnd := add(source, length)\n let dEnd := add(dest, length)\n\n // Remember the last 32 bytes of source\n // This needs to be done here and not after the loop\n // because we may have overwritten the last bytes in\n // source already due to overlap.\n let last := mload(sEnd)\n\n // Copy whole words front to back\n // Note: the first check is always true,\n // this could have been a do-while loop.\n // solhint-disable-next-line no-empty-blocks\n for {} lt(source, sEnd) {} {\n mstore(dest, mload(source))\n source := add(source, 32)\n dest := add(dest, 32)\n }\n \n // Write the last 32 bytes\n mstore(dEnd, last)\n }\n } else {\n assembly {\n // We subtract 32 from `sEnd` and `dEnd` because those\n // are the starting points when copying a word at the end.\n length := sub(length, 32)\n let sEnd := add(source, length)\n let dEnd := add(dest, length)\n\n // Remember the first 32 bytes of source\n // This needs to be done here and not after the loop\n // because we may have overwritten the first bytes in\n // source already due to overlap.\n let first := mload(source)\n\n // Copy whole words back to front\n // We use a signed comparisson here to allow dEnd to become\n // negative (happens when source and dest < 32). Valid\n // addresses in local memory will never be larger than\n // 2**255, so they can be safely re-interpreted as signed.\n // Note: the first check is always true,\n // this could have been a do-while loop.\n // solhint-disable-next-line no-empty-blocks\n for {} slt(dest, dEnd) {} {\n mstore(dEnd, mload(sEnd))\n sEnd := sub(sEnd, 32)\n dEnd := sub(dEnd, 32)\n }\n \n // Write the first 32 bytes\n mstore(dest, first)\n }\n }\n }\n }\n\n /// @dev Returns a slices from a byte array.\n /// @param b The byte array to take a slice from.\n /// @param from The starting index for the slice (inclusive).\n /// @param to The final index for the slice (exclusive).\n /// @return result The slice containing bytes at indices [from, to)\n function slice(\n bytes memory b,\n uint256 from,\n uint256 to\n )\n internal\n pure\n returns (bytes memory result)\n {\n require(\n from <= to,\n \"FROM_LESS_THAN_TO_REQUIRED\"\n );\n require(\n to < b.length,\n \"TO_LESS_THAN_LENGTH_REQUIRED\"\n );\n \n // Create a new bytes structure and copy contents\n result = new bytes(to - from);\n memCopy(\n result.contentAddress(),\n b.contentAddress() + from,\n result.length\n );\n return result;\n }\n \n /// @dev Returns a slice from a byte array without preserving the input.\n /// @param b The byte array to take a slice from. Will be destroyed in the process.\n /// @param from The starting index for the slice (inclusive).\n /// @param to The final index for the slice (exclusive).\n /// @return result The slice containing bytes at indices [from, to)\n /// @dev When `from == 0`, the original array will match the slice. In other cases its state will be corrupted.\n function sliceDestructive(\n bytes memory b,\n uint256 from,\n uint256 to\n )\n internal\n pure\n returns (bytes memory result)\n {\n require(\n from <= to,\n \"FROM_LESS_THAN_TO_REQUIRED\"\n );\n require(\n to < b.length,\n \"TO_LESS_THAN_LENGTH_REQUIRED\"\n );\n \n // Create a new bytes structure around [from, to) in-place.\n assembly {\n result := add(b, from)\n mstore(result, sub(to, from))\n }\n return result;\n }\n\n /// @dev Pops the last byte off of a byte array by modifying its length.\n /// @param b Byte array that will be modified.\n /// @return The byte that was popped off.\n function popLastByte(bytes memory b)\n internal\n pure\n returns (bytes1 result)\n {\n require(\n b.length > 0,\n \"GREATER_THAN_ZERO_LENGTH_REQUIRED\"\n );\n\n // Store last byte.\n result = b[b.length - 1];\n\n assembly {\n // Decrement length of byte array.\n let newLen := sub(mload(b), 1)\n mstore(b, newLen)\n }\n return result;\n }\n\n /// @dev Pops the last 20 bytes off of a byte array by modifying its length.\n /// @param b Byte array that will be modified.\n /// @return The 20 byte address that was popped off.\n function popLast20Bytes(bytes memory b)\n internal\n pure\n returns (address result)\n {\n require(\n b.length >= 20,\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Store last 20 bytes.\n result = readAddress(b, b.length - 20);\n\n assembly {\n // Subtract 20 from byte array length.\n let newLen := sub(mload(b), 20)\n mstore(b, newLen)\n }\n return result;\n }\n\n /// @dev Tests equality of two byte arrays.\n /// @param lhs First byte array to compare.\n /// @param rhs Second byte array to compare.\n /// @return True if arrays are the same. False otherwise.\n function equals(\n bytes memory lhs,\n bytes memory rhs\n )\n internal\n pure\n returns (bool equal)\n {\n // Keccak gas cost is 30 + numWords * 6. This is a cheap way to compare.\n // We early exit on unequal lengths, but keccak would also correctly\n // handle this.\n return lhs.length == rhs.length && keccak256(lhs) == keccak256(rhs);\n }\n\n /// @dev Reads an address from a position in a byte array.\n /// @param b Byte array containing an address.\n /// @param index Index in byte array of address.\n /// @return address from byte array.\n function readAddress(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (address result)\n {\n require(\n b.length >= index + 20, // 20 is length of address\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Add offset to index:\n // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)\n // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)\n index += 20;\n\n // Read address from array memory\n assembly {\n // 1. Add index to address of bytes array\n // 2. Load 32-byte word from memory\n // 3. Apply 20-byte mask to obtain address\n result := and(mload(add(b, index)), 0xffffffffffffffffffffffffffffffffffffffff)\n }\n return result;\n }\n\n /// @dev Writes an address into a specific position in a byte array.\n /// @param b Byte array to insert address into.\n /// @param index Index in byte array of address.\n /// @param input Address to put into byte array.\n function writeAddress(\n bytes memory b,\n uint256 index,\n address input\n )\n internal\n pure\n {\n require(\n b.length >= index + 20, // 20 is length of address\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Add offset to index:\n // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)\n // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)\n index += 20;\n\n // Store address into array memory\n assembly {\n // The address occupies 20 bytes and mstore stores 32 bytes.\n // First fetch the 32-byte word where we'll be storing the address, then\n // apply a mask so we have only the bytes in the word that the address will not occupy.\n // Then combine these bytes with the address and store the 32 bytes back to memory with mstore.\n\n // 1. Add index to address of bytes array\n // 2. Load 32-byte word from memory\n // 3. Apply 12-byte mask to obtain extra bytes occupying word of memory where we'll store the address\n let neighbors := and(\n mload(add(b, index)),\n 0xffffffffffffffffffffffff0000000000000000000000000000000000000000\n )\n \n // Make sure input address is clean.\n // (Solidity does not guarantee this)\n input := and(input, 0xffffffffffffffffffffffffffffffffffffffff)\n\n // Store the neighbors and address into memory\n mstore(add(b, index), xor(input, neighbors))\n }\n }\n\n /// @dev Reads a bytes32 value from a position in a byte array.\n /// @param b Byte array containing a bytes32 value.\n /// @param index Index in byte array of bytes32 value.\n /// @return bytes32 value from byte array.\n function readBytes32(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes32 result)\n {\n require(\n b.length >= index + 32,\n \"GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 256 bit length parameter\n index += 32;\n\n // Read the bytes32 from array memory\n assembly {\n result := mload(add(b, index))\n }\n return result;\n }\n\n /// @dev Writes a bytes32 into a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input bytes32 to put into byte array.\n function writeBytes32(\n bytes memory b,\n uint256 index,\n bytes32 input\n )\n internal\n pure\n {\n require(\n b.length >= index + 32,\n \"GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 256 bit length parameter\n index += 32;\n\n // Read the bytes32 from array memory\n assembly {\n mstore(add(b, index), input)\n }\n }\n\n /// @dev Reads a uint256 value from a position in a byte array.\n /// @param b Byte array containing a uint256 value.\n /// @param index Index in byte array of uint256 value.\n /// @return uint256 value from byte array.\n function readUint256(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (uint256 result)\n {\n result = uint256(readBytes32(b, index));\n return result;\n }\n\n /// @dev Writes a uint256 into a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input uint256 to put into byte array.\n function writeUint256(\n bytes memory b,\n uint256 index,\n uint256 input\n )\n internal\n pure\n {\n writeBytes32(b, index, bytes32(input));\n }\n\n /// @dev Reads an unpadded bytes4 value from a position in a byte array.\n /// @param b Byte array containing a bytes4 value.\n /// @param index Index in byte array of bytes4 value.\n /// @return bytes4 value from byte array.\n function readBytes4(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes4 result)\n {\n require(\n b.length >= index + 4,\n \"GREATER_OR_EQUAL_TO_4_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 32 byte length field\n index += 32;\n\n // Read the bytes4 from array memory\n assembly {\n result := mload(add(b, index))\n // Solidity does not require us to clean the trailing bytes.\n // We do it anyway\n result := and(result, 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000)\n }\n return result;\n }\n\n /// @dev Reads nested bytes from a specific position.\n /// @dev NOTE: the returned value overlaps with the input value.\n /// Both should be treated as immutable.\n /// @param b Byte array containing nested bytes.\n /// @param index Index of nested bytes.\n /// @return result Nested bytes.\n function readBytesWithLength(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes memory result)\n {\n // Read length of nested bytes\n uint256 nestedBytesLength = readUint256(b, index);\n index += 32;\n\n // Assert length of <b> is valid, given\n // length of nested bytes\n require(\n b.length >= index + nestedBytesLength,\n \"GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED\"\n );\n \n // Return a pointer to the byte array as it exists inside `b`\n assembly {\n result := add(b, index)\n }\n return result;\n }\n\n /// @dev Inserts bytes at a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input bytes to insert.\n function writeBytesWithLength(\n bytes memory b,\n uint256 index,\n bytes memory input\n )\n internal\n pure\n {\n // Assert length of <b> is valid, given\n // length of input\n require(\n b.length >= index + 32 + input.length, // 32 bytes to store length\n \"GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED\"\n );\n\n // Copy <input> into <b>\n memCopy(\n b.contentAddress() + index,\n input.rawAddress(), // includes length of <input>\n input.length + 32 // +32 bytes to store <input> length\n );\n }\n\n /// @dev Performs a deep copy of a byte array onto another byte array of greater than or equal length.\n /// @param dest Byte array that will be overwritten with source bytes.\n /// @param source Byte array to copy onto dest bytes.\n function deepCopyBytes(\n bytes memory dest,\n bytes memory source\n )\n internal\n pure\n {\n uint256 sourceLen = source.length;\n // Dest length must be >= source length, or some bytes would not be copied.\n require(\n dest.length >= sourceLen,\n \"GREATER_OR_EQUAL_TO_SOURCE_BYTES_LENGTH_REQUIRED\"\n );\n memCopy(\n dest.contentAddress(),\n source.contentAddress(),\n sourceLen\n );\n }\n}\n",
- "2.0.0/utils/Ownable/IOwnable.sol": "pragma solidity 0.4.24;\n\n\ncontract IOwnable {\n\n function transferOwnership(address newOwner)\n public;\n}\n",
- "2.0.0/utils/Ownable/Ownable.sol": "pragma solidity 0.4.24;\n\nimport \"./IOwnable.sol\";\n\n\ncontract Ownable is\n IOwnable\n{\n address public owner;\n\n constructor ()\n public\n {\n owner = msg.sender;\n }\n\n modifier onlyOwner() {\n require(\n msg.sender == owner,\n \"ONLY_CONTRACT_OWNER\"\n );\n _;\n }\n\n function transferOwnership(address newOwner)\n public\n onlyOwner\n {\n if (newOwner != address(0)) {\n owner = newOwner;\n }\n }\n}\n",
- "2.0.0/utils/ReentrancyGuard/ReentrancyGuard.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract ReentrancyGuard {\n\n // Locked state of mutex\n bool private locked = false;\n\n /// @dev Functions with this modifer cannot be reentered. The mutex will be locked\n /// before function execution and unlocked after.\n modifier nonReentrant() {\n // Ensure mutex is unlocked\n require(\n !locked,\n \"REENTRANCY_ILLEGAL\"\n );\n\n // Lock mutex before function call\n locked = true;\n\n // Perform function call\n _;\n\n // Unlock mutex after function call\n locked = false;\n }\n}\n",
- "2.0.0/utils/SafeMath/SafeMath.sol": "pragma solidity 0.4.24;\n\n\ncontract SafeMath {\n\n function safeMul(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n if (a == 0) {\n return 0;\n }\n uint256 c = a * b;\n require(\n c / a == b,\n \"UINT256_OVERFLOW\"\n );\n return c;\n }\n\n function safeDiv(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n uint256 c = a / b;\n return c;\n }\n\n function safeSub(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n require(\n b <= a,\n \"UINT256_UNDERFLOW\"\n );\n return a - b;\n }\n\n function safeAdd(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n uint256 c = a + b;\n require(\n c >= a,\n \"UINT256_OVERFLOW\"\n );\n return c;\n }\n\n function max64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n\n function max256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n}\n"
- },
- "sourceTreeHashHex": "0xf4217ae1c8ee6ad15913d86a30747907f26acfb4a1970ea3c8a30d45ce9171d0",
- "compiler": {
- "name": "solc",
- "version": "soljson-v0.4.24+commit.e67f0147.js",
- "settings": {
- "optimizer": {
- "enabled": true,
- "runs": 1000000
- },
- "outputSelection": {
- "*": {
- "*": [
- "abi",
- "evm.bytecode.object",
- "evm.bytecode.sourceMap",
- "evm.deployedBytecode.object",
- "evm.deployedBytecode.sourceMap"
- ]
- }
- }
- }
- },
- "networks": {}
-} \ No newline at end of file
diff --git a/packages/migrations/artifacts/2.0.0/Exchange.json b/packages/migrations/artifacts/2.0.0/Exchange.json
deleted file mode 100644
index 631bba974..000000000
--- a/packages/migrations/artifacts/2.0.0/Exchange.json
+++ /dev/null
@@ -1,2262 +0,0 @@
-{
- "schemaVersion": "2.0.0",
- "contractName": "Exchange",
- "compilerOutput": {
- "abi": [
- {
- "constant": true,
- "inputs": [
- {
- "name": "",
- "type": "bytes32"
- }
- ],
- "name": "filled",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "orders",
- "type": "tuple[]"
- },
- {
- "name": "takerAssetFillAmounts",
- "type": "uint256[]"
- },
- {
- "name": "signatures",
- "type": "bytes[]"
- }
- ],
- "name": "batchFillOrders",
- "outputs": [
- {
- "components": [
- {
- "name": "makerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "makerFeePaid",
- "type": "uint256"
- },
- {
- "name": "takerFeePaid",
- "type": "uint256"
- }
- ],
- "name": "totalFillResults",
- "type": "tuple"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "",
- "type": "bytes32"
- }
- ],
- "name": "cancelled",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "hash",
- "type": "bytes32"
- },
- {
- "name": "signerAddress",
- "type": "address"
- },
- {
- "name": "signature",
- "type": "bytes"
- }
- ],
- "name": "preSign",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "leftOrder",
- "type": "tuple"
- },
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "rightOrder",
- "type": "tuple"
- },
- {
- "name": "leftSignature",
- "type": "bytes"
- },
- {
- "name": "rightSignature",
- "type": "bytes"
- }
- ],
- "name": "matchOrders",
- "outputs": [
- {
- "components": [
- {
- "components": [
- {
- "name": "makerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "makerFeePaid",
- "type": "uint256"
- },
- {
- "name": "takerFeePaid",
- "type": "uint256"
- }
- ],
- "name": "left",
- "type": "tuple"
- },
- {
- "components": [
- {
- "name": "makerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "makerFeePaid",
- "type": "uint256"
- },
- {
- "name": "takerFeePaid",
- "type": "uint256"
- }
- ],
- "name": "right",
- "type": "tuple"
- },
- {
- "name": "leftMakerAssetSpreadAmount",
- "type": "uint256"
- }
- ],
- "name": "matchedFillResults",
- "type": "tuple"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "order",
- "type": "tuple"
- },
- {
- "name": "takerAssetFillAmount",
- "type": "uint256"
- },
- {
- "name": "signature",
- "type": "bytes"
- }
- ],
- "name": "fillOrderNoThrow",
- "outputs": [
- {
- "components": [
- {
- "name": "makerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "makerFeePaid",
- "type": "uint256"
- },
- {
- "name": "takerFeePaid",
- "type": "uint256"
- }
- ],
- "name": "fillResults",
- "type": "tuple"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "",
- "type": "bytes4"
- }
- ],
- "name": "assetProxies",
- "outputs": [
- {
- "name": "",
- "type": "address"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "orders",
- "type": "tuple[]"
- }
- ],
- "name": "batchCancelOrders",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "orders",
- "type": "tuple[]"
- },
- {
- "name": "takerAssetFillAmounts",
- "type": "uint256[]"
- },
- {
- "name": "signatures",
- "type": "bytes[]"
- }
- ],
- "name": "batchFillOrKillOrders",
- "outputs": [
- {
- "components": [
- {
- "name": "makerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "makerFeePaid",
- "type": "uint256"
- },
- {
- "name": "takerFeePaid",
- "type": "uint256"
- }
- ],
- "name": "totalFillResults",
- "type": "tuple"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "targetOrderEpoch",
- "type": "uint256"
- }
- ],
- "name": "cancelOrdersUpTo",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "orders",
- "type": "tuple[]"
- },
- {
- "name": "takerAssetFillAmounts",
- "type": "uint256[]"
- },
- {
- "name": "signatures",
- "type": "bytes[]"
- }
- ],
- "name": "batchFillOrdersNoThrow",
- "outputs": [
- {
- "components": [
- {
- "name": "makerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "makerFeePaid",
- "type": "uint256"
- },
- {
- "name": "takerFeePaid",
- "type": "uint256"
- }
- ],
- "name": "totalFillResults",
- "type": "tuple"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "assetProxyId",
- "type": "bytes4"
- }
- ],
- "name": "getAssetProxy",
- "outputs": [
- {
- "name": "",
- "type": "address"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "",
- "type": "bytes32"
- }
- ],
- "name": "transactions",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "order",
- "type": "tuple"
- },
- {
- "name": "takerAssetFillAmount",
- "type": "uint256"
- },
- {
- "name": "signature",
- "type": "bytes"
- }
- ],
- "name": "fillOrKillOrder",
- "outputs": [
- {
- "components": [
- {
- "name": "makerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "makerFeePaid",
- "type": "uint256"
- },
- {
- "name": "takerFeePaid",
- "type": "uint256"
- }
- ],
- "name": "fillResults",
- "type": "tuple"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "validatorAddress",
- "type": "address"
- },
- {
- "name": "approval",
- "type": "bool"
- }
- ],
- "name": "setSignatureValidatorApproval",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "",
- "type": "address"
- },
- {
- "name": "",
- "type": "address"
- }
- ],
- "name": "allowedValidators",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "orders",
- "type": "tuple[]"
- },
- {
- "name": "takerAssetFillAmount",
- "type": "uint256"
- },
- {
- "name": "signatures",
- "type": "bytes[]"
- }
- ],
- "name": "marketSellOrders",
- "outputs": [
- {
- "components": [
- {
- "name": "makerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "makerFeePaid",
- "type": "uint256"
- },
- {
- "name": "takerFeePaid",
- "type": "uint256"
- }
- ],
- "name": "totalFillResults",
- "type": "tuple"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "orders",
- "type": "tuple[]"
- }
- ],
- "name": "getOrdersInfo",
- "outputs": [
- {
- "components": [
- {
- "name": "orderStatus",
- "type": "uint8"
- },
- {
- "name": "orderHash",
- "type": "bytes32"
- },
- {
- "name": "orderTakerAssetFilledAmount",
- "type": "uint256"
- }
- ],
- "name": "",
- "type": "tuple[]"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "",
- "type": "bytes32"
- },
- {
- "name": "",
- "type": "address"
- }
- ],
- "name": "preSigned",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "owner",
- "outputs": [
- {
- "name": "",
- "type": "address"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "hash",
- "type": "bytes32"
- },
- {
- "name": "signerAddress",
- "type": "address"
- },
- {
- "name": "signature",
- "type": "bytes"
- }
- ],
- "name": "isValidSignature",
- "outputs": [
- {
- "name": "isValid",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "orders",
- "type": "tuple[]"
- },
- {
- "name": "makerAssetFillAmount",
- "type": "uint256"
- },
- {
- "name": "signatures",
- "type": "bytes[]"
- }
- ],
- "name": "marketBuyOrdersNoThrow",
- "outputs": [
- {
- "components": [
- {
- "name": "makerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "makerFeePaid",
- "type": "uint256"
- },
- {
- "name": "takerFeePaid",
- "type": "uint256"
- }
- ],
- "name": "totalFillResults",
- "type": "tuple"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "order",
- "type": "tuple"
- },
- {
- "name": "takerAssetFillAmount",
- "type": "uint256"
- },
- {
- "name": "signature",
- "type": "bytes"
- }
- ],
- "name": "fillOrder",
- "outputs": [
- {
- "components": [
- {
- "name": "makerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "makerFeePaid",
- "type": "uint256"
- },
- {
- "name": "takerFeePaid",
- "type": "uint256"
- }
- ],
- "name": "fillResults",
- "type": "tuple"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "signerAddress",
- "type": "address"
- },
- {
- "name": "data",
- "type": "bytes"
- },
- {
- "name": "signature",
- "type": "bytes"
- }
- ],
- "name": "executeTransaction",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "assetProxy",
- "type": "address"
- }
- ],
- "name": "registerAssetProxy",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "order",
- "type": "tuple"
- }
- ],
- "name": "getOrderInfo",
- "outputs": [
- {
- "components": [
- {
- "name": "orderStatus",
- "type": "uint8"
- },
- {
- "name": "orderHash",
- "type": "bytes32"
- },
- {
- "name": "orderTakerAssetFilledAmount",
- "type": "uint256"
- }
- ],
- "name": "orderInfo",
- "type": "tuple"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "order",
- "type": "tuple"
- }
- ],
- "name": "cancelOrder",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "",
- "type": "address"
- },
- {
- "name": "",
- "type": "address"
- }
- ],
- "name": "orderEpoch",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "ZRX_ASSET_DATA",
- "outputs": [
- {
- "name": "",
- "type": "bytes"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "orders",
- "type": "tuple[]"
- },
- {
- "name": "takerAssetFillAmount",
- "type": "uint256"
- },
- {
- "name": "signatures",
- "type": "bytes[]"
- }
- ],
- "name": "marketSellOrdersNoThrow",
- "outputs": [
- {
- "components": [
- {
- "name": "makerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "makerFeePaid",
- "type": "uint256"
- },
- {
- "name": "takerFeePaid",
- "type": "uint256"
- }
- ],
- "name": "totalFillResults",
- "type": "tuple"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "EIP712_DOMAIN_HASH",
- "outputs": [
- {
- "name": "",
- "type": "bytes32"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "orders",
- "type": "tuple[]"
- },
- {
- "name": "makerAssetFillAmount",
- "type": "uint256"
- },
- {
- "name": "signatures",
- "type": "bytes[]"
- }
- ],
- "name": "marketBuyOrders",
- "outputs": [
- {
- "components": [
- {
- "name": "makerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "makerFeePaid",
- "type": "uint256"
- },
- {
- "name": "takerFeePaid",
- "type": "uint256"
- }
- ],
- "name": "totalFillResults",
- "type": "tuple"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "currentContextAddress",
- "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"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "VERSION",
- "outputs": [
- {
- "name": "",
- "type": "string"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "inputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "constructor"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "signerAddress",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "validatorAddress",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "approved",
- "type": "bool"
- }
- ],
- "name": "SignatureValidatorApproval",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "makerAddress",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "takerAddress",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "senderAddress",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "makerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "indexed": false,
- "name": "takerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "indexed": false,
- "name": "makerFeePaid",
- "type": "uint256"
- },
- {
- "indexed": false,
- "name": "takerFeePaid",
- "type": "uint256"
- },
- {
- "indexed": true,
- "name": "orderHash",
- "type": "bytes32"
- },
- {
- "indexed": false,
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "indexed": false,
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "Fill",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "makerAddress",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "senderAddress",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "orderHash",
- "type": "bytes32"
- },
- {
- "indexed": false,
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "indexed": false,
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "Cancel",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "makerAddress",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "senderAddress",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "orderEpoch",
- "type": "uint256"
- }
- ],
- "name": "CancelUpTo",
- "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": "0x60806040526000805460ff191690553480156200001b57600080fd5b50604080517f454950373132446f6d61696e28000000000000000000000000000000000000006020808301919091527f737472696e67206e616d652c0000000000000000000000000000000000000000602d8301527f737472696e672076657273696f6e2c000000000000000000000000000000000060398301527f6164647265737320766572696679696e67436f6e74726163740000000000000060488301527f2900000000000000000000000000000000000000000000000000000000000000606183015282516042818403018152606290920192839052815191929182918401908083835b60208310620001245780518252601f19909201916020918201910162000103565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208285018552600b8084527f30782050726f746f636f6c000000000000000000000000000000000000000000928401928352945190965091945090928392508083835b60208310620001ae5780518252601f1990920191602091820191016200018d565b51815160209384036101000a600019018019909216911617905260408051929094018290038220828501855260018084527f3200000000000000000000000000000000000000000000000000000000000000928401928352945190965091945090928392508083835b60208310620002385780518252601f19909201916020918201910162000217565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208282019890985281840196909652606081019690965250306080808701919091528151808703909101815260a09095019081905284519093849350850191508083835b60208310620002c35780518252601f199092019160209182019101620002a2565b5181516000196020949094036101000a939093019283169219169190911790526040519201829003909120600155505060028054600160a060020a03191633179055506158b380620003166000396000f3006080604052600436106101b65763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663288cdc9181146101bb578063297bb70b146101f15780632ac126221461021e5780633683ef8e1461024b5780633c28d8611461026d5780633e228bae1461029a5780633fd3c997146102ba5780634ac14782146102e75780634d0ae546146103075780634f9559b11461032757806350dde190146103475780636070410814610367578063642f2eaf1461039457806364a3bc15146103b457806377fcce68146103d45780637b8e3514146103f45780637e1d9808146104145780637e9d74dc1461043457806382c174d0146104615780638da5cb5b146104815780639363470214610496578063a3e20380146104b6578063b4be83d5146104d6578063bfc8bfce146104f6578063c585bb9314610516578063c75e0a8114610536578063d46b02c314610563578063d9bfa73e14610583578063db123b1a146105a3578063dd1c7d18146105c5578063e306f779146105e5578063e5fa431b146105fa578063eea086ba1461061a578063f2fde38b1461062f578063ffa1ad741461064f575b600080fd5b3480156101c757600080fd5b506101db6101d6366004614800565b610664565b6040516101e89190615425565b60405180910390f35b3480156101fd57600080fd5b5061021161020c366004614723565b610676565b6040516101e891906156ff565b34801561022a57600080fd5b5061023e610239366004614800565b6107a1565b6040516101e89190615417565b34801561025757600080fd5b5061026b61026636600461483d565b6107b6565b005b34801561027957600080fd5b5061028d610288366004614971565b6108a3565b6040516101e8919061570d565b3480156102a657600080fd5b506102116102b5366004614a31565b610a3a565b3480156102c657600080fd5b506102da6102d5366004614900565b610a90565b6040516101e891906154e1565b3480156102f357600080fd5b5061026b6103023660046146ee565b610ab8565b34801561031357600080fd5b50610211610322366004614723565b610b85565b34801561033357600080fd5b5061026b610342366004614800565b610c75565b34801561035357600080fd5b50610211610362366004614723565b610e2a565b34801561037357600080fd5b50610387610382366004614900565b610ebe565b6040516101e89190615337565b3480156103a057600080fd5b5061023e6103af366004614800565b610f0c565b3480156103c057600080fd5b506102116103cf366004614a31565b610f21565b3480156103e057600080fd5b5061026b6103ef3660046146be565b610fcc565b34801561040057600080fd5b5061023e61040f366004614684565b611106565b34801561042057600080fd5b5061021161042f3660046147b7565b611126565b34801561044057600080fd5b5061045461044f3660046146ee565b61128a565b6040516101e89190615406565b34801561046d57600080fd5b5061023e61047c36600461481e565b61131f565b34801561048d57600080fd5b5061038761133f565b3480156104a257600080fd5b5061023e6104b13660046148a5565b61135b565b3480156104c257600080fd5b506102116104d13660046147b7565b6118de565b3480156104e257600080fd5b506102116104f1366004614a31565b6119f1565b34801561050257600080fd5b5061026b610511366004614a7a565b611a6c565b34801561052257600080fd5b5061026b610531366004614666565b611d05565b34801561054257600080fd5b5061055661055136600461493c565b611f30565b6040516101e8919061571c565b34801561056f57600080fd5b5061026b61057e36600461493c565b61202a565b34801561058f57600080fd5b506101db61059e366004614684565b6120c6565b3480156105af57600080fd5b506105b86120e3565b6040516101e891906154d0565b3480156105d157600080fd5b506102116105e03660046147b7565b612143565b3480156105f157600080fd5b506101db612218565b34801561060657600080fd5b506102116106153660046147b7565b61221e565b34801561062657600080fd5b50610387612390565b34801561063b57600080fd5b5061026b61064a366004614666565b6123ac565b34801561065b57600080fd5b506105b861245d565b60036020526000908152604090205481565b61067e614298565b600080610689614298565b60005460ff16156106cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061567f565b60405180910390fd5b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011781558751935091505b81831461076f57610758878381518110151561071957fe5b90602001906020020151878481518110151561073157fe5b90602001906020020151878581518110151561074957fe5b90602001906020020151612494565b90506107648482612532565b600190910190610701565b5050600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055509392505050565b60046020526000908152604090205460ff1681565b73ffffffffffffffffffffffffffffffffffffffff831633146108465761080e848484848080601f0160208091040260200160405190810160405280939291908181526020018383808284375061135b945050505050565b1515610846576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906155af565b5050600091825260066020908152604080842073ffffffffffffffffffffffffffffffffffffffff9093168452919052902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b6108ab6142c1565b6108b36142f0565b6108bb6142f0565b6000805460ff16156108f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061567f565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905561016080890151610140808a01919091528901519088015261094588611f30565b925061095087611f30565b915061095a612594565b9050610968888483896125c6565b610974878383886125c6565b61097e888861275e565b6109928888856040015185604001516127be565b8051602081015190519195506109ad918a9186918190612945565b6020808501519081015190516109c99189918591908190612945565b6109e28882856020015186604001518860000151612a5e565b6109fb8782846020015185604001518860200151612a5e565b610a0788888387612b0a565b5050600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905550949350505050565b610a42614298565b6060610a4f858585612c92565b9050608081825160208401305af48015610a8657815183526020820151602084015260408201516040840152606082015160608401525b505b509392505050565b600a6020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b60008054819060ff1615610af8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061567f565b5050600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011781558151905b808214610b5857610b508382815181101515610b4157fe5b90602001906020020151612e64565b600101610b29565b5050600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905550565b610b8d614298565b600080610b98614298565b60005460ff1615610bd5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061567f565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011781558751935091505b81831461076f57610c5e8783815181101515610c1f57fe5b906020019060200201518784815181101515610c3757fe5b906020019060200201518785815181101515610c4f57fe5b90602001906020020151612e8f565b9050610c6a8482612532565b600190910190610c07565b6000805481908190819060ff1615610cb9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061567f565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055610cec612594565b935073ffffffffffffffffffffffffffffffffffffffff84163314610d115733610d14565b60005b73ffffffffffffffffffffffffffffffffffffffff8086166000908152600560209081526040808320938516835292905220549093506001860192509050808211610d8b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061563f565b73ffffffffffffffffffffffffffffffffffffffff80851660008181526005602090815260408083209488168084529490915290819020859055517f82af639571738f4ebd4268fb0363d8957ebe1bbb9e78dba5ebd69eed39b154f090610df3908690615425565b60405180910390a35050600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055505050565b610e32614298565b600080610e3d614298565b86519250600091505b818314610eb457610e9d8783815181101515610e5e57fe5b906020019060200201518784815181101515610e7657fe5b906020019060200201518785815181101515610e8e57fe5b90602001906020020151610a3a565b9050610ea98482612532565b600190910190610e46565b5050509392505050565b7fffffffff0000000000000000000000000000000000000000000000000000000081166000908152600a602052604090205473ffffffffffffffffffffffffffffffffffffffff165b919050565b60086020526000908152604090205460ff1681565b610f29614298565b60005460ff1615610f66576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061567f565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055610f9c848484612e8f565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055949350505050565b6000805460ff161561100a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061567f565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905561103d612594565b73ffffffffffffffffffffffffffffffffffffffff8181166000818152600760209081526040808320948916808452949091529081902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168715151790555192935090917fa8656e308026eeabce8f0bc18048433252318ab80ac79da0b3d3d8697dfba891906110d1908690615417565b60405180910390a35050600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905550565b600760209081526000928352604080842090915290825290205460ff1681565b61112e614298565b6060600080600061113d614298565b60005460ff161561117a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061567f565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117815589518a919081106111b257fe5b906020019060200201516101600151945088519350600092505b828414611255578489848151811015156111e257fe5b906020019060200201516101600181905250611202888760200151612ee2565b915061122e898481518110151561121557fe5b9060200190602002015183898681518110151561074957fe5b905061123a8682612532565b6020860151881161124a57611255565b6001909201916111cc565b5050600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055509195945050505050565b606060006060600084519250826040519080825280602002602001820160405280156112d057816020015b6112bd6142f0565b8152602001906001900390816112b55790505b509150600090505b808314610a88576112ff85828151811015156112f057fe5b90602001906020020151611f30565b828281518110151561130d57fe5b602090810290910101526001016112d8565b600660209081526000928352604080842090915290825290205460ff1681565b60025473ffffffffffffffffffffffffffffffffffffffff1681565b600080600080600080600080600089511115156113a4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061562f565b6113ad89612f29565b7f010000000000000000000000000000000000000000000000000000000000000090049650600760ff88161061140f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061554f565b8660ff16600781111561141e57fe5b9550600086600781111561142e57fe5b1415611466576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061561f565b600186600781111561147457fe5b14156114bc578851156114b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906156ef565b600097506118d0565b60028660078111156114ca57fe5b141561160557885160411461150b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906154ef565b88600081518110151561151a57fe5b01602001517f010000000000000000000000000000000000000000000000000000000000000090819004810204945061155a89600163ffffffff612fed16565b935061156d89602163ffffffff612fed16565b925060018b868686604051600081526020016040526040516115929493929190615480565b60206040516020810390808403906000865af11580156115b6573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015173ffffffffffffffffffffffffffffffffffffffff8c811690821614995092506118d09050565b600386600781111561161357fe5b14156117b9578851604114611654576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906154ef565b88600081518110151561166357fe5b01602001517f01000000000000000000000000000000000000000000000000000000000000009081900481020494506116a389600163ffffffff612fed16565b93506116b689602163ffffffff612fed16565b925060018b60405160200180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c0182600019166000191681526020019150506040516020818303038152906040526040518082805190602001908083835b6020831061175757805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161171a565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018019909216911617905260408051929094018290038220600083529101928390526115929450925089918991508890615480565b60048660078111156117c757fe5b14156117df576117d88b8b8b613038565b97506118d0565b60058660078111156117ed57fe5b1415611850576117fc8961318d565b73ffffffffffffffffffffffffffffffffffffffff808c1660009081526007602090815260408083209385168352929052205490915060ff16151561184457600097506118d0565b6117d8818c8c8c613206565b600686600781111561185e57fe5b141561189e5760008b815260066020908152604080832073ffffffffffffffffffffffffffffffffffffffff8e16845290915290205460ff1697506118d0565b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061554f565b505050505050509392505050565b6118e6614298565b60606000806000806118f6614298565b89600081518110151561190557fe5b906020019060200201516101400151955089519450600093505b8385146119e457858a8581518110151561193557fe5b6020908102909101015161014001528651611951908a90612ee2565b92506119948a8581518110151561196457fe5b9060200190602002015160a001518b8681518110151561198057fe5b906020019060200201516080015185613362565b91506119c08a858151811015156119a757fe5b90602001906020020151838a87815181101515610e8e57fe5b90506119cc8782612532565b865189116119d9576119e4565b60019093019261191f565b5050505050509392505050565b6119f9614298565b60005460ff1615611a36576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061567f565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055610f9c848484612494565b60095460009073ffffffffffffffffffffffffffffffffffffffff1615611abf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061567f565b611b02611afd888888888080601f016020809104026020016040519081016040528093929190818152602001838380828437506133b8945050505050565b6135f9565b60008181526008602052604090205490915060ff1615611b4e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061559f565b73ffffffffffffffffffffffffffffffffffffffff86163314611c1f57611ba6818785858080601f0160208091040260200160405190810160405280939291908181526020018383808284375061135b945050505050565b1515611bde576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906156df565b600980547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff88161790555b6000818152600860205260409081902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555130908690869080838380828437820191505092505050600060405180830381855af49150501515611cb6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906155cf565b73ffffffffffffffffffffffffffffffffffffffff86163314611cfc57600980547fffffffffffffffffffffffff00000000000000000000000000000000000000001690555b50505050505050565b6002546000908190819073ffffffffffffffffffffffffffffffffffffffff163314611d5d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061568f565b8392508273ffffffffffffffffffffffffffffffffffffffff1663ae25532e6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b158015611dc457600080fd5b505af1158015611dd8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611dfc919081019061491e565b7fffffffff0000000000000000000000000000000000000000000000000000000081166000908152600a602052604090205490925073ffffffffffffffffffffffffffffffffffffffff1690508015611e81576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061552f565b7fffffffff0000000000000000000000000000000000000000000000000000000082166000908152600a60205260409081902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8616179055517fd2c6b762299c609bdb96520b58a49bfb80186934d4f71a86a367571a15c0319490611f2290849087906154b5565b60405180910390a150505050565b611f386142f0565b611f4182613639565b6020808301829052600091825260039052604090819020549082015260808201511515611f755760015b60ff168152610f07565b60a08201511515611f87576002611f6b565b60a0820151604082015110611f9d576005611f6b565b6101008201514210611fb0576004611f6b565b60208082015160009081526004909152604090205460ff1615611fd4576006611f6b565b610120820151825173ffffffffffffffffffffffffffffffffffffffff90811660009081526005602090815260408083206060880151909416835292905220541115612021576006611f6b565b60038152919050565b60005460ff1615612067576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061567f565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905561209b81612e64565b50600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055565b600560209081526000928352604080842090915290825290205481565b606060405190810160405280602481526020017ff47261b0000000000000000000000000e41d2489571d322189246dafa5ebde1f81526020017f4699f4980000000000000000000000000000000000000000000000000000000081525081565b61214b614298565b6060600080600061215a614298565b88600081518110151561216957fe5b906020019060200201516101600151945088519350600092505b82841461220c5784898481518110151561219957fe5b9060200190602002015161016001819052506121b9888760200151612ee2565b91506121e589848151811015156121cc57fe5b90602001906020020151838986815181101515610e8e57fe5b90506121f18682612532565b602086015188116122015761220c565b600190920191612183565b50505050509392505050565b60015481565b612226614298565b6060600080600080612236614298565b60005460ff1615612273576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061567f565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011781558a518b919081106122ab57fe5b906020019060200201516101400151955089519450600093505b83851461235a57858a858151811015156122db57fe5b60209081029091010151610140015286516122f7908a90612ee2565b925061230a8a8581518110151561196457fe5b91506123368a8581518110151561231d57fe5b90602001906020020151838a8781518110151561074957fe5b90506123428782612532565b8651891161234f5761235a565b6001909301926122c5565b5050600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905550929695505050505050565b60095473ffffffffffffffffffffffffffffffffffffffff1681565b60025473ffffffffffffffffffffffffffffffffffffffff1633146123fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061568f565b73ffffffffffffffffffffffffffffffffffffffff81161561245a57600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83161790555b50565b60408051808201909152600581527f322e302e30000000000000000000000000000000000000000000000000000000602082015281565b61249c614298565b6124a46142f0565b60008060006124b288611f30565b93506124bc612594565b92506124ca888585896125c6565b6124dc8860a001518560400151612ee2565b91506124e88783613647565b90506124fb888589848960000151612945565b612505888261365d565b945061251c88848660200151876040015189612a5e565b6125278884876136be565b505050509392505050565b815181516125409190613776565b8252602080830151908201516125569190613776565b60208301526040808301519082015161256f9190613776565b6040830152606080830151908201516125889190613776565b60609092019190915250565b60095460009073ffffffffffffffffffffffffffffffffffffffff168181156125bd57816125bf565b335b9392505050565b825160ff16600314612604576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906156af565b606084015173ffffffffffffffffffffffffffffffffffffffff161561267757606084015173ffffffffffffffffffffffffffffffffffffffff163314612677576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906156bf565b602084015173ffffffffffffffffffffffffffffffffffffffff1615612702578173ffffffffffffffffffffffffffffffffffffffff16846020015173ffffffffffffffffffffffffffffffffffffffff16141515612702576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906154ff565b6040830151151561275857612720836020015185600001518361135b565b1515612758576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061556f565b50505050565b6127708260a001518260a001516137c0565b612782836080015183608001516137c0565b10156127ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906156cf565b5050565b6127c66142c1565b6000806000806127da8960a0015188612ee2565b93506127ef89608001518a60a001518661381b565b92506127ff8860a0015187612ee2565b915061281488608001518960a001518461381b565b90508084106128575760208086018051839052805182018490525151865182015260808a015160a08b015187519092015161284f929061381b565b855152612894565b845183905284516020908101859052855181015190860180519190915260a089015160808a015191515161288b9290613898565b60208087015101525b84515160208087015101516128a99190612ee2565b604086015284515160808a015160c08b01516128c692919061381b565b85516040015284516020015160a08a015160e08b01516128e792919061381b565b855160600152602085015151608089015160c08a015161290892919061381b565b856020015160400181815250506129308560200151602001518960a001518a60e0015161381b565b60208601516060015250505050949350505050565b82151561297e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906155ef565b828211156129b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906155df565b8460a001516129cb856040015184613776565b1115612a03576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061550f565b612a118560800151836137c0565b612a1f828760a001516137c0565b1115612a57576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061566f565b5050505050565b612a6c828260200151613776565b600084815260036020908152604091829020929092558681015187518451938501518584015160608701516101408c01516101608d015196518b9873ffffffffffffffffffffffffffffffffffffffff9788169897909616967f0bcc4c97732e47d9946f229edb95f5b6323f601300e4690de719993f3c37112996612afb968f96339692959194909390615345565b60405180910390a45050505050565b60608060405190810160405280602481526020017ff47261b0000000000000000000000000e41d2489571d322189246dafa5ebde1f81526020017f4699f498000000000000000000000000000000000000000000000000000000008152509050612b8b85610140015186600001518660000151856020015160200151613935565b61014084015184518651845160200151612ba793929190613935565b612bc08561014001518660000151858560400151613935565b612bdc8186600001518760400151856000015160400151613935565b612bf88185600001518660400151856020015160400151613935565b836040015173ffffffffffffffffffffffffffffffffffffffff16856040015173ffffffffffffffffffffffffffffffffffffffff161415612c6257612c5d81848760400151612c58866000015160600151876020015160600151613776565b613935565b612a57565b612c7a81848760400151856000015160600151613935565b612a5781848660400151856020015160600151613935565b604080517fb4be83d5000000000000000000000000000000000000000000000000000000006020808301919091526060602483018181528751608485019081528884015160a48601529488015160c48501529087015160e4840152608087015161010484015260a087015161012484015260c087015161014484015260e08701516101648401526101008701516101848401526101208701516101a4840152610140870180516101c485019081526101608901516101e4860152610180905251805161020485018190529394919384936044870192849261022489019291820191601f82010460005b81811015612d99578351855260209485019490930192600101612d7b565b50505050818103610160808401919091528a0151805180835260209283019291820191601f82010460005b81811015612de2578351855260209485019490930192600101612dc4565b50505089845250848103602093840190815288518083529093918201918981019190601f82010460005b81811015612e2a578351855260209485019490930192600101612e0c565b5050507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08883030188525060405250505050509392505050565b612e6c6142f0565b612e7582611f30565b9050612e818282613aff565b6127ba828260200151613c16565b612e97614298565b612ea2848484612494565b602081015190915083146125bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061565f565b600082821115612f1e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061551f565b508082035b92915050565b6000808251111515612f67576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061560f565b815182907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8101908110612f9757fe5b016020015182517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01909252507f0100000000000000000000000000000000000000000000000000000000000000908190040290565b60008160200183511015151561302f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061553f565b50016020015190565b6040516000906060907f1626ba7e00000000000000000000000000000000000000000000000000000000906130739087908690602401615460565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152919052602080820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909416939093178352815191935090829081885afa808015613110576001811461318157612527565b7f08c379a0000000000000000000000000000000000000000000000000000000006000527c20000000000000000000000000000000000000000000000000000000006020527c0c57414c4c45545f4552524f5200000000000000000000000000000000604052600060605260646000fd5b50505195945050505050565b600060148251101515156131cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061569f565b6131db826014845103613cbd565b82517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec019092525090565b6040516000906060907f93634702000000000000000000000000000000000000000000000000000000009061324390879087908790602401615433565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152919052602080820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009094169390931783528151919350908290818a5afa8080156132e0576001811461335157613356565b7f08c379a0000000000000000000000000000000000000000000000000000000006000527c20000000000000000000000000000000000000000000000000000000006020527c0f56414c494441544f525f4552524f5200000000000000000000000000604052600060605260646000fd5b825194505b50505050949350505050565b600080831161339d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061555f565b6133b06133aa85846137c0565b84613d1e565b949350505050565b604080517f5a65726f45785472616e73616374696f6e2800000000000000000000000000006020808301919091527f75696e743235362073616c742c0000000000000000000000000000000000000060328301527f61646472657373207369676e6572416464726573732c00000000000000000000603f8301527f627974657320646174610000000000000000000000000000000000000000000060558301527f2900000000000000000000000000000000000000000000000000000000000000605f830152825180830384018152606090920192839052815160009384938493909282918401908083835b602083106134e157805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016134a4565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018019909216911617905260405191909301819003812089519097508995509093508392850191508083835b6020831061357757805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161353a565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040805192909401829003822097825281019a909a525073ffffffffffffffffffffffffffffffffffffffff97909716968801969096525050606085015250506080909120919050565b6001546040517f19010000000000000000000000000000000000000000000000000000000000008152600281019190915260228101919091526042902090565b6000612f23611afd83613d35565b600081831061365657816125bf565b5090919050565b613665614298565b6020810182905260a0830151608084015161368191849161381b565b808252608084015160c085015161369992919061381b565b604082015260a083015160e08401516136b391849161381b565b606082015292915050565b60408051606081018252602481527ff47261b0000000000000000000000000e41d2489571d322189246dafa5ebde1f60208201527f4699f4980000000000000000000000000000000000000000000000000000000091810191909152610140840151845183516137319291908690613935565b61374a8461016001518486600001518560200151613935565b61376281856000015186604001518560400151613935565b612758818486604001518560600151613935565b6000828201838110156137b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061558f565b8091505b5092915050565b6000808315156137d357600091506137b9565b508282028284828115156137e357fe5b04146137b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061558f565b6000808311613856576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061555f565b61386184848461418e565b1561339d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906155bf565b60008083116138d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061555f565b6138de848484614213565b15613915576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906155bf565b6133b06133aa61392586856137c0565b613930866001612ee2565b613776565b60008060008311801561397457508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b15613af75785516003106139b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061564f565b50506020848101517fffffffff00000000000000000000000000000000000000000000000000000000166000818152600a90925260409091205473ffffffffffffffffffffffffffffffffffffffff16801515613a3d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906155ff565b604051660fffffffffffe0603f885101168060840182017fa85e59e40000000000000000000000000000000000000000000000000000000083526080600484015273ffffffffffffffffffffffffffffffffffffffff8816602484015273ffffffffffffffffffffffffffffffffffffffff87166044840152856064840152608483015b81811015613ad957895181526020998a019901613ac1565b61020084858403866000895af1801515613af1573d85fd5b50505050505b505050505050565b805160009060ff16600314613b40576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906156af565b606083015173ffffffffffffffffffffffffffffffffffffffff1615613bb357606083015173ffffffffffffffffffffffffffffffffffffffff163314613bb3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906156bf565b613bbb612594565b835190915073ffffffffffffffffffffffffffffffffffffffff808316911614613c11576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061557f565b505050565b6000818152600460205260409081902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558281015183516101408501516101608601519351859473ffffffffffffffffffffffffffffffffffffffff9485169493909316927fdc47b3613d9fe400085f6dbdc99453462279057e6207385042827ed6b1a62cf792613cb1923392906153c9565b60405180910390a45050565b600081601401835110151515613cff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061569f565b50016014015173ffffffffffffffffffffffffffffffffffffffff1690565b6000808284811515613d2c57fe5b04949350505050565b604080517f4f726465722800000000000000000000000000000000000000000000000000006020808301919091527f61646472657373206d616b6572416464726573732c000000000000000000000060268301527f616464726573732074616b6572416464726573732c0000000000000000000000603b8301527f6164647265737320666565526563697069656e74416464726573732c0000000060508301527f616464726573732073656e646572416464726573732c00000000000000000000606c8301527f75696e74323536206d616b65724173736574416d6f756e742c0000000000000060828301527f75696e743235362074616b65724173736574416d6f756e742c00000000000000609b8301527f75696e74323536206d616b65724665652c00000000000000000000000000000060b48301527f75696e743235362074616b65724665652c00000000000000000000000000000060c58301527f75696e743235362065787069726174696f6e54696d655365636f6e64732c000060d68301527f75696e743235362073616c742c0000000000000000000000000000000000000060f48301527f6279746573206d616b65724173736574446174612c00000000000000000000006101018301527f62797465732074616b65724173736574446174610000000000000000000000006101168301527f290000000000000000000000000000000000000000000000000000000000000061012a830152825161010b81840301815261012b90920192839052815160009384938493849391929182918401908083835b60208310613fbd57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101613f80565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930181900381206101408b0151805191995095509093508392850191508083835b6020831061405857805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161401b565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930181900381206101608b0151805191985095509093508392850191508083835b602083106140f357805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016140b6565b5181516020939093036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018019909116921691909117905260405192018290039091207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0890180516101408b018051610160909c0180519a84529881529288526101a0822091529890525050509190525090919050565b6000808084116141ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061555f565b8215806141d5575084155b156141e35760009150610a88565b838015156141ed57fe5b85840990506141fc85846137c0565b6142086103e8836137c0565b101595945050505050565b60008080841161424f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061555f565b82158061425a575084155b156142685760009150610a88565b8380151561427257fe5b8584099050836142828583612ee2565b81151561428b57fe5b0690506141fc85846137c0565b608060405190810160405280600081526020016000815260200160008152602001600081525090565b610120604051908101604052806142d6614298565b81526020016142e3614298565b8152602001600081525090565b604080516060810182526000808252602082018190529181019190915290565b60006125bf82356157c2565b6000601f8201831361432d57600080fd5b813561434061433b82615751565b61572a565b81815260209384019390925082018360005b8381101561437e578135860161436888826144ce565b8452506020928301929190910190600101614352565b5050505092915050565b6000601f8201831361439957600080fd5b81356143a761433b82615751565b81815260209384019390925082018360005b8381101561437e57813586016143cf888261451d565b84525060209283019291909101906001016143b9565b6000601f820183136143f657600080fd5b813561440461433b82615751565b9150818183526020840193506020810190508385602084028201111561442957600080fd5b60005b8381101561437e578161443f8882614461565b845250602092830192919091019060010161442c565b60006125bf82356157db565b60006125bf82356157e0565b60006125bf82356157e3565b60006125bf82516157e3565b600080601f8301841361449757600080fd5b50813567ffffffffffffffff8111156144af57600080fd5b6020830191508360018202830111156144c757600080fd5b9250929050565b6000601f820183136144df57600080fd5b81356144ed61433b82615772565b9150808252602083016020830185838301111561450957600080fd5b614514838284615819565b50505092915050565b6000610180828403121561453057600080fd5b61453b61018061572a565b905060006145498484614310565b825250602061455a84848301614310565b602083015250604061456e84828501614310565b604083015250606061458284828501614310565b606083015250608061459684828501614461565b60808301525060a06145aa84828501614461565b60a08301525060c06145be84828501614461565b60c08301525060e06145d284828501614461565b60e0830152506101006145e784828501614461565b610100830152506101206145fd84828501614461565b6101208301525061014082013567ffffffffffffffff81111561461f57600080fd5b61462b848285016144ce565b6101408301525061016082013567ffffffffffffffff81111561464d57600080fd5b614659848285016144ce565b6101608301525092915050565b60006020828403121561467857600080fd5b60006133b08484614310565b6000806040838503121561469757600080fd5b60006146a38585614310565b92505060206146b485828601614310565b9150509250929050565b600080604083850312156146d157600080fd5b60006146dd8585614310565b92505060206146b485828601614455565b60006020828403121561470057600080fd5b813567ffffffffffffffff81111561471757600080fd5b6133b084828501614388565b60008060006060848603121561473857600080fd5b833567ffffffffffffffff81111561474f57600080fd5b61475b86828701614388565b935050602084013567ffffffffffffffff81111561477857600080fd5b614784868287016143e5565b925050604084013567ffffffffffffffff8111156147a157600080fd5b6147ad8682870161431c565b9150509250925092565b6000806000606084860312156147cc57600080fd5b833567ffffffffffffffff8111156147e357600080fd5b6147ef86828701614388565b935050602061478486828701614461565b60006020828403121561481257600080fd5b60006133b08484614461565b6000806040838503121561483157600080fd5b60006146a38585614461565b6000806000806060858703121561485357600080fd5b600061485f8787614461565b945050602061487087828801614310565b935050604085013567ffffffffffffffff81111561488d57600080fd5b61489987828801614485565b95989497509550505050565b6000806000606084860312156148ba57600080fd5b60006148c68686614461565b93505060206148d786828701614310565b925050604084013567ffffffffffffffff8111156148f457600080fd5b6147ad868287016144ce565b60006020828403121561491257600080fd5b60006133b0848461446d565b60006020828403121561493057600080fd5b60006133b08484614479565b60006020828403121561494e57600080fd5b813567ffffffffffffffff81111561496557600080fd5b6133b08482850161451d565b6000806000806080858703121561498757600080fd5b843567ffffffffffffffff81111561499e57600080fd5b6149aa8782880161451d565b945050602085013567ffffffffffffffff8111156149c757600080fd5b6149d38782880161451d565b935050604085013567ffffffffffffffff8111156149f057600080fd5b6149fc878288016144ce565b925050606085013567ffffffffffffffff811115614a1957600080fd5b614a25878288016144ce565b91505092959194509250565b600080600060608486031215614a4657600080fd5b833567ffffffffffffffff811115614a5d57600080fd5b614a698682870161451d565b93505060206148d786828701614461565b60008060008060008060808789031215614a9357600080fd5b6000614a9f8989614461565b9650506020614ab089828a01614310565b955050604087013567ffffffffffffffff811115614acd57600080fd5b614ad989828a01614485565b9450945050606087013567ffffffffffffffff811115614af857600080fd5b614b0489828a01614485565b92509250509295509295509295565b614b1c816157c2565b82525050565b6000614b2d826157be565b808452602084019350614b3f836157b8565b60005b82811015614b6f57614b558683516152f7565b614b5e826157b8565b606096909601959150600101614b42565b5093949350505050565b614b1c816157db565b614b1c816157e0565b614b1c816157e3565b6000614b9f826157be565b808452614bb3816020860160208601615825565b614bbc81615851565b9093016020019392505050565b614b1c8161580e565b601281527f4c454e4754485f36355f52455155495245440000000000000000000000000000602082015260400190565b600d81527f494e56414c49445f54414b455200000000000000000000000000000000000000602082015260400190565b600e81527f4f524445525f4f56455246494c4c000000000000000000000000000000000000602082015260400190565b601181527f55494e543235365f554e444552464c4f57000000000000000000000000000000602082015260400190565b601a81527f41535345545f50524f58595f414c52454144595f455849535453000000000000602082015260400190565b602681527f475245415445525f4f525f455155414c5f544f5f33325f4c454e4754485f524560208201527f5155495245440000000000000000000000000000000000000000000000000000604082015260600190565b601581527f5349474e41545552455f554e535550504f525445440000000000000000000000602082015260400190565b601081527f4449564953494f4e5f42595f5a45524f00000000000000000000000000000000602082015260400190565b601781527f494e56414c49445f4f524445525f5349474e4154555245000000000000000000602082015260400190565b600d81527f494e56414c49445f4d414b455200000000000000000000000000000000000000602082015260400190565b601081527f55494e543235365f4f564552464c4f5700000000000000000000000000000000602082015260400190565b600f81527f494e56414c49445f54585f484153480000000000000000000000000000000000602082015260400190565b601181527f494e56414c49445f5349474e4154555245000000000000000000000000000000602082015260400190565b600e81527f524f554e44494e475f4552524f52000000000000000000000000000000000000602082015260400190565b601081527f4641494c45445f455845435554494f4e00000000000000000000000000000000602082015260400190565b600d81527f54414b45525f4f56455250415900000000000000000000000000000000000000602082015260400190565b601481527f494e56414c49445f54414b45525f414d4f554e54000000000000000000000000602082015260400190565b601a81527f41535345545f50524f58595f444f45535f4e4f545f4558495354000000000000602082015260400190565b602181527f475245415445525f5448414e5f5a45524f5f4c454e4754485f5245515549524560208201527f4400000000000000000000000000000000000000000000000000000000000000604082015260600190565b601181527f5349474e41545552455f494c4c4547414c000000000000000000000000000000602082015260400190565b601e81527f4c454e4754485f475245415445525f5448414e5f305f52455155495245440000602082015260400190565b601781527f494e56414c49445f4e45575f4f524445525f45504f4348000000000000000000602082015260400190565b601e81527f4c454e4754485f475245415445525f5448414e5f335f52455155495245440000602082015260400190565b601481527f434f4d504c4554455f46494c4c5f4641494c4544000000000000000000000000602082015260400190565b601281527f494e56414c49445f46494c4c5f50524943450000000000000000000000000000602082015260400190565b601281527f5245454e5452414e43595f494c4c4547414c0000000000000000000000000000602082015260400190565b601381527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000602082015260400190565b602681527f475245415445525f4f525f455155414c5f544f5f32305f4c454e4754485f524560208201527f5155495245440000000000000000000000000000000000000000000000000000604082015260600190565b601081527f4f524445525f554e46494c4c41424c4500000000000000000000000000000000602082015260400190565b600e81527f494e56414c49445f53454e444552000000000000000000000000000000000000602082015260400190565b601881527f4e454741544956455f5350524541445f52455155495245440000000000000000602082015260400190565b601481527f494e56414c49445f54585f5349474e4154555245000000000000000000000000602082015260400190565b601181527f4c454e4754485f305f5245515549524544000000000000000000000000000000602082015260400190565b805160808301906152858482614b82565b5060208201516152986020850182614b82565b5060408201516152ab6040850182614b82565b5060608201516127586060850182614b82565b80516101208301906152d08482615274565b5060208201516152e36080850182615274565b506040820151612758610100850182614b82565b80516060830190615308848261532e565b50602082015161531b6020850182614b82565b5060408201516127586040850182614b82565b614b1c81615808565b60208101612f238284614b13565b6101008101615354828b614b13565b615361602083018a614b13565b61536e6040830189614b82565b61537b6060830188614b82565b6153886080830187614b82565b61539560a0830186614b82565b81810360c08301526153a78185614b94565b905081810360e08301526153bb8184614b94565b9a9950505050505050505050565b606081016153d78286614b13565b81810360208301526153e98185614b94565b905081810360408301526153fd8184614b94565b95945050505050565b602080825281016125bf8184614b22565b60208101612f238284614b79565b60208101612f238284614b82565b606081016154418286614b82565b61544e6020830185614b13565b81810360408301526153fd8184614b94565b6040810161546e8285614b82565b81810360208301526133b08184614b94565b6080810161548e8287614b82565b61549b602083018661532e565b6154a86040830185614b82565b6153fd6060830184614b82565b604081016154c38285614b8b565b6125bf6020830184614b13565b602080825281016125bf8184614b94565b60208101612f238284614bc9565b60208082528101612f2381614bd2565b60208082528101612f2381614c02565b60208082528101612f2381614c32565b60208082528101612f2381614c62565b60208082528101612f2381614c92565b60208082528101612f2381614cc2565b60208082528101612f2381614d18565b60208082528101612f2381614d48565b60208082528101612f2381614d78565b60208082528101612f2381614da8565b60208082528101612f2381614dd8565b60208082528101612f2381614e08565b60208082528101612f2381614e38565b60208082528101612f2381614e68565b60208082528101612f2381614e98565b60208082528101612f2381614ec8565b60208082528101612f2381614ef8565b60208082528101612f2381614f28565b60208082528101612f2381614f58565b60208082528101612f2381614fae565b60208082528101612f2381614fde565b60208082528101612f238161500e565b60208082528101612f238161503e565b60208082528101612f238161506e565b60208082528101612f238161509e565b60208082528101612f23816150ce565b60208082528101612f23816150fe565b60208082528101612f238161512e565b60208082528101612f2381615184565b60208082528101612f23816151b4565b60208082528101612f23816151e4565b60208082528101612f2381615214565b60208082528101612f2381615244565b60808101612f238284615274565b6101208101612f2382846152be565b60608101612f2382846152f7565b60405181810167ffffffffffffffff8111828210171561574957600080fd5b604052919050565b600067ffffffffffffffff82111561576857600080fd5b5060209081020190565b600067ffffffffffffffff82111561578957600080fd5b506020601f919091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0160190565b60200190565b5190565b73ffffffffffffffffffffffffffffffffffffffff1690565b151590565b90565b7fffffffff000000000000000000000000000000000000000000000000000000001690565b60ff1690565b6000612f23826157c2565b82818337506000910152565b60005b83811015615840578181015183820152602001615828565b838111156127585750506000910152565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016905600a265627a7a72305820b19c92201032603398c007dccf80930c626ef89fa6c848c8b7ef5267d07cd4ed6c6578706572696d656e74616cf50037",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 SLOAD PUSH1 0xFF NOT AND SWAP1 SSTORE CALLVALUE DUP1 ISZERO PUSH3 0x1B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x40 DUP1 MLOAD PUSH32 0x454950373132446F6D61696E2800000000000000000000000000000000000000 PUSH1 0x20 DUP1 DUP4 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH32 0x737472696E67206E616D652C0000000000000000000000000000000000000000 PUSH1 0x2D DUP4 ADD MSTORE PUSH32 0x737472696E672076657273696F6E2C0000000000000000000000000000000000 PUSH1 0x39 DUP4 ADD MSTORE PUSH32 0x6164647265737320766572696679696E67436F6E747261637400000000000000 PUSH1 0x48 DUP4 ADD MSTORE PUSH32 0x2900000000000000000000000000000000000000000000000000000000000000 PUSH1 0x61 DUP4 ADD MSTORE DUP3 MLOAD PUSH1 0x42 DUP2 DUP5 SUB ADD DUP2 MSTORE PUSH1 0x62 SWAP1 SWAP3 ADD SWAP3 DUP4 SWAP1 MSTORE DUP2 MLOAD SWAP2 SWAP3 SWAP2 DUP3 SWAP2 DUP5 ADD SWAP1 DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT PUSH3 0x124 JUMPI DUP1 MLOAD DUP3 MSTORE PUSH1 0x1F NOT SWAP1 SWAP3 ADD SWAP2 PUSH1 0x20 SWAP2 DUP3 ADD SWAP2 ADD PUSH3 0x103 JUMP JUMPDEST MLOAD DUP2 MLOAD PUSH1 0x20 SWAP4 DUP5 SUB PUSH2 0x100 EXP PUSH1 0x0 NOT ADD DUP1 NOT SWAP1 SWAP3 AND SWAP2 AND OR SWAP1 MSTORE PUSH1 0x40 DUP1 MLOAD SWAP3 SWAP1 SWAP5 ADD DUP3 SWAP1 SUB DUP3 KECCAK256 DUP3 DUP6 ADD DUP6 MSTORE PUSH1 0xB DUP1 DUP5 MSTORE PUSH32 0x30782050726F746F636F6C000000000000000000000000000000000000000000 SWAP3 DUP5 ADD SWAP3 DUP4 MSTORE SWAP5 MLOAD SWAP1 SWAP7 POP SWAP2 SWAP5 POP SWAP1 SWAP3 DUP4 SWAP3 POP DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT PUSH3 0x1AE JUMPI DUP1 MLOAD DUP3 MSTORE PUSH1 0x1F NOT SWAP1 SWAP3 ADD SWAP2 PUSH1 0x20 SWAP2 DUP3 ADD SWAP2 ADD PUSH3 0x18D JUMP JUMPDEST MLOAD DUP2 MLOAD PUSH1 0x20 SWAP4 DUP5 SUB PUSH2 0x100 EXP PUSH1 0x0 NOT ADD DUP1 NOT SWAP1 SWAP3 AND SWAP2 AND OR SWAP1 MSTORE PUSH1 0x40 DUP1 MLOAD SWAP3 SWAP1 SWAP5 ADD DUP3 SWAP1 SUB DUP3 KECCAK256 DUP3 DUP6 ADD DUP6 MSTORE PUSH1 0x1 DUP1 DUP5 MSTORE PUSH32 0x3200000000000000000000000000000000000000000000000000000000000000 SWAP3 DUP5 ADD SWAP3 DUP4 MSTORE SWAP5 MLOAD SWAP1 SWAP7 POP SWAP2 SWAP5 POP SWAP1 SWAP3 DUP4 SWAP3 POP DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT PUSH3 0x238 JUMPI DUP1 MLOAD DUP3 MSTORE PUSH1 0x1F NOT SWAP1 SWAP3 ADD SWAP2 PUSH1 0x20 SWAP2 DUP3 ADD SWAP2 ADD PUSH3 0x217 JUMP JUMPDEST MLOAD DUP2 MLOAD PUSH1 0x20 SWAP4 DUP5 SUB PUSH2 0x100 EXP PUSH1 0x0 NOT ADD DUP1 NOT SWAP1 SWAP3 AND SWAP2 AND OR SWAP1 MSTORE PUSH1 0x40 DUP1 MLOAD SWAP3 SWAP1 SWAP5 ADD DUP3 SWAP1 SUB DUP3 KECCAK256 DUP3 DUP3 ADD SWAP9 SWAP1 SWAP9 MSTORE DUP2 DUP5 ADD SWAP7 SWAP1 SWAP7 MSTORE PUSH1 0x60 DUP2 ADD SWAP7 SWAP1 SWAP7 MSTORE POP ADDRESS PUSH1 0x80 DUP1 DUP8 ADD SWAP2 SWAP1 SWAP2 MSTORE DUP2 MLOAD DUP1 DUP8 SUB SWAP1 SWAP2 ADD DUP2 MSTORE PUSH1 0xA0 SWAP1 SWAP6 ADD SWAP1 DUP2 SWAP1 MSTORE DUP5 MLOAD SWAP1 SWAP4 DUP5 SWAP4 POP DUP6 ADD SWAP2 POP DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT PUSH3 0x2C3 JUMPI DUP1 MLOAD DUP3 MSTORE PUSH1 0x1F NOT SWAP1 SWAP3 ADD SWAP2 PUSH1 0x20 SWAP2 DUP3 ADD SWAP2 ADD PUSH3 0x2A2 JUMP JUMPDEST MLOAD DUP2 MLOAD PUSH1 0x0 NOT PUSH1 0x20 SWAP5 SWAP1 SWAP5 SUB PUSH2 0x100 EXP SWAP4 SWAP1 SWAP4 ADD SWAP3 DUP4 AND SWAP3 NOT AND SWAP2 SWAP1 SWAP2 OR SWAP1 MSTORE PUSH1 0x40 MLOAD SWAP3 ADD DUP3 SWAP1 SUB SWAP1 SWAP2 KECCAK256 PUSH1 0x1 SSTORE POP POP PUSH1 0x2 DUP1 SLOAD PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB NOT AND CALLER OR SWAP1 SSTORE POP PUSH2 0x58B3 DUP1 PUSH3 0x316 PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN STOP PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x1B6 JUMPI PUSH4 0xFFFFFFFF PUSH29 0x100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD DIV AND PUSH4 0x288CDC91 DUP2 EQ PUSH2 0x1BB JUMPI DUP1 PUSH4 0x297BB70B EQ PUSH2 0x1F1 JUMPI DUP1 PUSH4 0x2AC12622 EQ PUSH2 0x21E JUMPI DUP1 PUSH4 0x3683EF8E EQ PUSH2 0x24B JUMPI DUP1 PUSH4 0x3C28D861 EQ PUSH2 0x26D JUMPI DUP1 PUSH4 0x3E228BAE EQ PUSH2 0x29A JUMPI DUP1 PUSH4 0x3FD3C997 EQ PUSH2 0x2BA JUMPI DUP1 PUSH4 0x4AC14782 EQ PUSH2 0x2E7 JUMPI DUP1 PUSH4 0x4D0AE546 EQ PUSH2 0x307 JUMPI DUP1 PUSH4 0x4F9559B1 EQ PUSH2 0x327 JUMPI DUP1 PUSH4 0x50DDE190 EQ PUSH2 0x347 JUMPI DUP1 PUSH4 0x60704108 EQ PUSH2 0x367 JUMPI DUP1 PUSH4 0x642F2EAF EQ PUSH2 0x394 JUMPI DUP1 PUSH4 0x64A3BC15 EQ PUSH2 0x3B4 JUMPI DUP1 PUSH4 0x77FCCE68 EQ PUSH2 0x3D4 JUMPI DUP1 PUSH4 0x7B8E3514 EQ PUSH2 0x3F4 JUMPI DUP1 PUSH4 0x7E1D9808 EQ PUSH2 0x414 JUMPI DUP1 PUSH4 0x7E9D74DC EQ PUSH2 0x434 JUMPI DUP1 PUSH4 0x82C174D0 EQ PUSH2 0x461 JUMPI DUP1 PUSH4 0x8DA5CB5B EQ PUSH2 0x481 JUMPI DUP1 PUSH4 0x93634702 EQ PUSH2 0x496 JUMPI DUP1 PUSH4 0xA3E20380 EQ PUSH2 0x4B6 JUMPI DUP1 PUSH4 0xB4BE83D5 EQ PUSH2 0x4D6 JUMPI DUP1 PUSH4 0xBFC8BFCE EQ PUSH2 0x4F6 JUMPI DUP1 PUSH4 0xC585BB93 EQ PUSH2 0x516 JUMPI DUP1 PUSH4 0xC75E0A81 EQ PUSH2 0x536 JUMPI DUP1 PUSH4 0xD46B02C3 EQ PUSH2 0x563 JUMPI DUP1 PUSH4 0xD9BFA73E EQ PUSH2 0x583 JUMPI DUP1 PUSH4 0xDB123B1A EQ PUSH2 0x5A3 JUMPI DUP1 PUSH4 0xDD1C7D18 EQ PUSH2 0x5C5 JUMPI DUP1 PUSH4 0xE306F779 EQ PUSH2 0x5E5 JUMPI DUP1 PUSH4 0xE5FA431B EQ PUSH2 0x5FA JUMPI DUP1 PUSH4 0xEEA086BA EQ PUSH2 0x61A JUMPI DUP1 PUSH4 0xF2FDE38B EQ PUSH2 0x62F JUMPI DUP1 PUSH4 0xFFA1AD74 EQ PUSH2 0x64F JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1C7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1DB PUSH2 0x1D6 CALLDATASIZE PUSH1 0x4 PUSH2 0x4800 JUMP JUMPDEST PUSH2 0x664 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1E8 SWAP2 SWAP1 PUSH2 0x5425 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1FD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x211 PUSH2 0x20C CALLDATASIZE PUSH1 0x4 PUSH2 0x4723 JUMP JUMPDEST PUSH2 0x676 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1E8 SWAP2 SWAP1 PUSH2 0x56FF JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x22A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x23E PUSH2 0x239 CALLDATASIZE PUSH1 0x4 PUSH2 0x4800 JUMP JUMPDEST PUSH2 0x7A1 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1E8 SWAP2 SWAP1 PUSH2 0x5417 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x257 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x26B PUSH2 0x266 CALLDATASIZE PUSH1 0x4 PUSH2 0x483D JUMP JUMPDEST PUSH2 0x7B6 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x279 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x28D PUSH2 0x288 CALLDATASIZE PUSH1 0x4 PUSH2 0x4971 JUMP JUMPDEST PUSH2 0x8A3 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1E8 SWAP2 SWAP1 PUSH2 0x570D JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2A6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x211 PUSH2 0x2B5 CALLDATASIZE PUSH1 0x4 PUSH2 0x4A31 JUMP JUMPDEST PUSH2 0xA3A JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2C6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2DA PUSH2 0x2D5 CALLDATASIZE PUSH1 0x4 PUSH2 0x4900 JUMP JUMPDEST PUSH2 0xA90 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1E8 SWAP2 SWAP1 PUSH2 0x54E1 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2F3 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x26B PUSH2 0x302 CALLDATASIZE PUSH1 0x4 PUSH2 0x46EE JUMP JUMPDEST PUSH2 0xAB8 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x313 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x211 PUSH2 0x322 CALLDATASIZE PUSH1 0x4 PUSH2 0x4723 JUMP JUMPDEST PUSH2 0xB85 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x333 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x26B PUSH2 0x342 CALLDATASIZE PUSH1 0x4 PUSH2 0x4800 JUMP JUMPDEST PUSH2 0xC75 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x353 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x211 PUSH2 0x362 CALLDATASIZE PUSH1 0x4 PUSH2 0x4723 JUMP JUMPDEST PUSH2 0xE2A JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x373 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x387 PUSH2 0x382 CALLDATASIZE PUSH1 0x4 PUSH2 0x4900 JUMP JUMPDEST PUSH2 0xEBE JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1E8 SWAP2 SWAP1 PUSH2 0x5337 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3A0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x23E PUSH2 0x3AF CALLDATASIZE PUSH1 0x4 PUSH2 0x4800 JUMP JUMPDEST PUSH2 0xF0C JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3C0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x211 PUSH2 0x3CF CALLDATASIZE PUSH1 0x4 PUSH2 0x4A31 JUMP JUMPDEST PUSH2 0xF21 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3E0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x26B PUSH2 0x3EF CALLDATASIZE PUSH1 0x4 PUSH2 0x46BE JUMP JUMPDEST PUSH2 0xFCC JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x400 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x23E PUSH2 0x40F CALLDATASIZE PUSH1 0x4 PUSH2 0x4684 JUMP JUMPDEST PUSH2 0x1106 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x420 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x211 PUSH2 0x42F CALLDATASIZE PUSH1 0x4 PUSH2 0x47B7 JUMP JUMPDEST PUSH2 0x1126 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x440 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x454 PUSH2 0x44F CALLDATASIZE PUSH1 0x4 PUSH2 0x46EE JUMP JUMPDEST PUSH2 0x128A JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1E8 SWAP2 SWAP1 PUSH2 0x5406 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x46D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x23E PUSH2 0x47C CALLDATASIZE PUSH1 0x4 PUSH2 0x481E JUMP JUMPDEST PUSH2 0x131F JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x48D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x387 PUSH2 0x133F JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x4A2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x23E PUSH2 0x4B1 CALLDATASIZE PUSH1 0x4 PUSH2 0x48A5 JUMP JUMPDEST PUSH2 0x135B JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x4C2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x211 PUSH2 0x4D1 CALLDATASIZE PUSH1 0x4 PUSH2 0x47B7 JUMP JUMPDEST PUSH2 0x18DE JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x4E2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x211 PUSH2 0x4F1 CALLDATASIZE PUSH1 0x4 PUSH2 0x4A31 JUMP JUMPDEST PUSH2 0x19F1 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x502 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x26B PUSH2 0x511 CALLDATASIZE PUSH1 0x4 PUSH2 0x4A7A JUMP JUMPDEST PUSH2 0x1A6C JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x522 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x26B PUSH2 0x531 CALLDATASIZE PUSH1 0x4 PUSH2 0x4666 JUMP JUMPDEST PUSH2 0x1D05 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x542 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x556 PUSH2 0x551 CALLDATASIZE PUSH1 0x4 PUSH2 0x493C JUMP JUMPDEST PUSH2 0x1F30 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1E8 SWAP2 SWAP1 PUSH2 0x571C JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x56F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x26B PUSH2 0x57E CALLDATASIZE PUSH1 0x4 PUSH2 0x493C JUMP JUMPDEST PUSH2 0x202A JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x58F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1DB PUSH2 0x59E CALLDATASIZE PUSH1 0x4 PUSH2 0x4684 JUMP JUMPDEST PUSH2 0x20C6 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x5AF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x5B8 PUSH2 0x20E3 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1E8 SWAP2 SWAP1 PUSH2 0x54D0 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x5D1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x211 PUSH2 0x5E0 CALLDATASIZE PUSH1 0x4 PUSH2 0x47B7 JUMP JUMPDEST PUSH2 0x2143 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x5F1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1DB PUSH2 0x2218 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x606 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x211 PUSH2 0x615 CALLDATASIZE PUSH1 0x4 PUSH2 0x47B7 JUMP JUMPDEST PUSH2 0x221E JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x626 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x387 PUSH2 0x2390 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x63B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x26B PUSH2 0x64A CALLDATASIZE PUSH1 0x4 PUSH2 0x4666 JUMP JUMPDEST PUSH2 0x23AC JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x65B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x5B8 PUSH2 0x245D JUMP JUMPDEST PUSH1 0x3 PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP2 JUMP JUMPDEST PUSH2 0x67E PUSH2 0x4298 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x689 PUSH2 0x4298 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x6CF JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x567F JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR DUP2 SSTORE DUP8 MLOAD SWAP4 POP SWAP2 POP JUMPDEST DUP2 DUP4 EQ PUSH2 0x76F JUMPI PUSH2 0x758 DUP8 DUP4 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x719 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP8 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x731 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP8 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x749 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x2494 JUMP JUMPDEST SWAP1 POP PUSH2 0x764 DUP5 DUP3 PUSH2 0x2532 JUMP JUMPDEST PUSH1 0x1 SWAP1 SWAP2 ADD SWAP1 PUSH2 0x701 JUMP JUMPDEST POP POP PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x4 PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND CALLER EQ PUSH2 0x846 JUMPI PUSH2 0x80E DUP5 DUP5 DUP5 DUP5 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY POP PUSH2 0x135B SWAP5 POP POP POP POP POP JUMP JUMPDEST ISZERO ISZERO PUSH2 0x846 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x55AF JUMP JUMPDEST POP POP PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x6 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP5 KECCAK256 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP4 AND DUP5 MSTORE SWAP2 SWAP1 MSTORE SWAP1 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR SWAP1 SSTORE JUMP JUMPDEST PUSH2 0x8AB PUSH2 0x42C1 JUMP JUMPDEST PUSH2 0x8B3 PUSH2 0x42F0 JUMP JUMPDEST PUSH2 0x8BB PUSH2 0x42F0 JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x8F9 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x567F JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR SWAP1 SSTORE PUSH2 0x160 DUP1 DUP10 ADD MLOAD PUSH2 0x140 DUP1 DUP11 ADD SWAP2 SWAP1 SWAP2 MSTORE DUP10 ADD MLOAD SWAP1 DUP9 ADD MSTORE PUSH2 0x945 DUP9 PUSH2 0x1F30 JUMP JUMPDEST SWAP3 POP PUSH2 0x950 DUP8 PUSH2 0x1F30 JUMP JUMPDEST SWAP2 POP PUSH2 0x95A PUSH2 0x2594 JUMP JUMPDEST SWAP1 POP PUSH2 0x968 DUP9 DUP5 DUP4 DUP10 PUSH2 0x25C6 JUMP JUMPDEST PUSH2 0x974 DUP8 DUP4 DUP4 DUP9 PUSH2 0x25C6 JUMP JUMPDEST PUSH2 0x97E DUP9 DUP9 PUSH2 0x275E JUMP JUMPDEST PUSH2 0x992 DUP9 DUP9 DUP6 PUSH1 0x40 ADD MLOAD DUP6 PUSH1 0x40 ADD MLOAD PUSH2 0x27BE JUMP JUMPDEST DUP1 MLOAD PUSH1 0x20 DUP2 ADD MLOAD SWAP1 MLOAD SWAP2 SWAP6 POP PUSH2 0x9AD SWAP2 DUP11 SWAP2 DUP7 SWAP2 DUP2 SWAP1 PUSH2 0x2945 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP6 ADD MLOAD SWAP1 DUP2 ADD MLOAD SWAP1 MLOAD PUSH2 0x9C9 SWAP2 DUP10 SWAP2 DUP6 SWAP2 SWAP1 DUP2 SWAP1 PUSH2 0x2945 JUMP JUMPDEST PUSH2 0x9E2 DUP9 DUP3 DUP6 PUSH1 0x20 ADD MLOAD DUP7 PUSH1 0x40 ADD MLOAD DUP9 PUSH1 0x0 ADD MLOAD PUSH2 0x2A5E JUMP JUMPDEST PUSH2 0x9FB DUP8 DUP3 DUP5 PUSH1 0x20 ADD MLOAD DUP6 PUSH1 0x40 ADD MLOAD DUP9 PUSH1 0x20 ADD MLOAD PUSH2 0x2A5E JUMP JUMPDEST PUSH2 0xA07 DUP9 DUP9 DUP4 DUP8 PUSH2 0x2B0A JUMP JUMPDEST POP POP PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE POP SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH2 0xA42 PUSH2 0x4298 JUMP JUMPDEST PUSH1 0x60 PUSH2 0xA4F DUP6 DUP6 DUP6 PUSH2 0x2C92 JUMP JUMPDEST SWAP1 POP PUSH1 0x80 DUP2 DUP3 MLOAD PUSH1 0x20 DUP5 ADD ADDRESS GAS DELEGATECALL DUP1 ISZERO PUSH2 0xA86 JUMPI DUP2 MLOAD DUP4 MSTORE PUSH1 0x20 DUP3 ADD MLOAD PUSH1 0x20 DUP5 ADD MSTORE PUSH1 0x40 DUP3 ADD MLOAD PUSH1 0x40 DUP5 ADD MSTORE PUSH1 0x60 DUP3 ADD MLOAD PUSH1 0x60 DUP5 ADD MSTORE JUMPDEST POP JUMPDEST POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0xA PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD DUP2 SWAP1 PUSH1 0xFF AND ISZERO PUSH2 0xAF8 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x567F JUMP JUMPDEST POP POP PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR DUP2 SSTORE DUP2 MLOAD SWAP1 JUMPDEST DUP1 DUP3 EQ PUSH2 0xB58 JUMPI PUSH2 0xB50 DUP4 DUP3 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xB41 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x2E64 JUMP JUMPDEST PUSH1 0x1 ADD PUSH2 0xB29 JUMP JUMPDEST POP POP PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE POP JUMP JUMPDEST PUSH2 0xB8D PUSH2 0x4298 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0xB98 PUSH2 0x4298 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0xBD5 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x567F JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR DUP2 SSTORE DUP8 MLOAD SWAP4 POP SWAP2 POP JUMPDEST DUP2 DUP4 EQ PUSH2 0x76F JUMPI PUSH2 0xC5E DUP8 DUP4 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xC1F JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP8 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xC37 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP8 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xC4F JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x2E8F JUMP JUMPDEST SWAP1 POP PUSH2 0xC6A DUP5 DUP3 PUSH2 0x2532 JUMP JUMPDEST PUSH1 0x1 SWAP1 SWAP2 ADD SWAP1 PUSH2 0xC07 JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD DUP2 SWAP1 DUP2 SWAP1 DUP2 SWAP1 PUSH1 0xFF AND ISZERO PUSH2 0xCB9 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x567F JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR SWAP1 SSTORE PUSH2 0xCEC PUSH2 0x2594 JUMP JUMPDEST SWAP4 POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND CALLER EQ PUSH2 0xD11 JUMPI CALLER PUSH2 0xD14 JUMP JUMPDEST PUSH1 0x0 JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP7 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x5 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 SWAP4 DUP6 AND DUP4 MSTORE SWAP3 SWAP1 MSTORE KECCAK256 SLOAD SWAP1 SWAP4 POP PUSH1 0x1 DUP7 ADD SWAP3 POP SWAP1 POP DUP1 DUP3 GT PUSH2 0xD8B JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x563F JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP6 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x5 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 SWAP5 DUP9 AND DUP1 DUP5 MSTORE SWAP5 SWAP1 SWAP2 MSTORE SWAP1 DUP2 SWAP1 KECCAK256 DUP6 SWAP1 SSTORE MLOAD PUSH32 0x82AF639571738F4EBD4268FB0363D8957EBE1BBB9E78DBA5EBD69EED39B154F0 SWAP1 PUSH2 0xDF3 SWAP1 DUP7 SWAP1 PUSH2 0x5425 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 POP POP PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE POP POP POP JUMP JUMPDEST PUSH2 0xE32 PUSH2 0x4298 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0xE3D PUSH2 0x4298 JUMP JUMPDEST DUP7 MLOAD SWAP3 POP PUSH1 0x0 SWAP2 POP JUMPDEST DUP2 DUP4 EQ PUSH2 0xEB4 JUMPI PUSH2 0xE9D DUP8 DUP4 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xE5E JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP8 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xE76 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP8 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xE8E JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0xA3A JUMP JUMPDEST SWAP1 POP PUSH2 0xEA9 DUP5 DUP3 PUSH2 0x2532 JUMP JUMPDEST PUSH1 0x1 SWAP1 SWAP2 ADD SWAP1 PUSH2 0xE46 JUMP JUMPDEST POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 DUP2 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0xA PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND JUMPDEST SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x8 PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH2 0xF29 PUSH2 0x4298 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0xF66 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x567F JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR SWAP1 SSTORE PUSH2 0xF9C DUP5 DUP5 DUP5 PUSH2 0x2E8F JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x100A JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x567F JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR SWAP1 SSTORE PUSH2 0x103D PUSH2 0x2594 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 DUP2 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x7 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 SWAP5 DUP10 AND DUP1 DUP5 MSTORE SWAP5 SWAP1 SWAP2 MSTORE SWAP1 DUP2 SWAP1 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND DUP8 ISZERO ISZERO OR SWAP1 SSTORE MLOAD SWAP3 SWAP4 POP SWAP1 SWAP2 PUSH32 0xA8656E308026EEABCE8F0BC18048433252318AB80AC79DA0B3D3D8697DFBA891 SWAP1 PUSH2 0x10D1 SWAP1 DUP7 SWAP1 PUSH2 0x5417 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 POP POP PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE POP JUMP JUMPDEST PUSH1 0x7 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x0 SWAP3 DUP4 MSTORE PUSH1 0x40 DUP1 DUP5 KECCAK256 SWAP1 SWAP2 MSTORE SWAP1 DUP3 MSTORE SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH2 0x112E PUSH2 0x4298 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x0 DUP1 PUSH1 0x0 PUSH2 0x113D PUSH2 0x4298 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x117A JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x567F JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR DUP2 SSTORE DUP10 MLOAD DUP11 SWAP2 SWAP1 DUP2 LT PUSH2 0x11B2 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x160 ADD MLOAD SWAP5 POP DUP9 MLOAD SWAP4 POP PUSH1 0x0 SWAP3 POP JUMPDEST DUP3 DUP5 EQ PUSH2 0x1255 JUMPI DUP5 DUP10 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x11E2 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x160 ADD DUP2 SWAP1 MSTORE POP PUSH2 0x1202 DUP9 DUP8 PUSH1 0x20 ADD MLOAD PUSH2 0x2EE2 JUMP JUMPDEST SWAP2 POP PUSH2 0x122E DUP10 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1215 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP4 DUP10 DUP7 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x749 JUMPI INVALID JUMPDEST SWAP1 POP PUSH2 0x123A DUP7 DUP3 PUSH2 0x2532 JUMP JUMPDEST PUSH1 0x20 DUP7 ADD MLOAD DUP9 GT PUSH2 0x124A JUMPI PUSH2 0x1255 JUMP JUMPDEST PUSH1 0x1 SWAP1 SWAP3 ADD SWAP2 PUSH2 0x11CC JUMP JUMPDEST POP POP PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE POP SWAP2 SWAP6 SWAP5 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x60 PUSH1 0x0 PUSH1 0x60 PUSH1 0x0 DUP5 MLOAD SWAP3 POP DUP3 PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x12D0 JUMPI DUP2 PUSH1 0x20 ADD JUMPDEST PUSH2 0x12BD PUSH2 0x42F0 JUMP JUMPDEST DUP2 MSTORE PUSH1 0x20 ADD SWAP1 PUSH1 0x1 SWAP1 SUB SWAP1 DUP2 PUSH2 0x12B5 JUMPI SWAP1 POP JUMPDEST POP SWAP2 POP PUSH1 0x0 SWAP1 POP JUMPDEST DUP1 DUP4 EQ PUSH2 0xA88 JUMPI PUSH2 0x12FF DUP6 DUP3 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x12F0 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x1F30 JUMP JUMPDEST DUP3 DUP3 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x130D JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD MSTORE PUSH1 0x1 ADD PUSH2 0x12D8 JUMP JUMPDEST PUSH1 0x6 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x0 SWAP3 DUP4 MSTORE PUSH1 0x40 DUP1 DUP5 KECCAK256 SWAP1 SWAP2 MSTORE SWAP1 DUP3 MSTORE SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH1 0x2 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 DUP10 MLOAD GT ISZERO ISZERO PUSH2 0x13A4 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x562F JUMP JUMPDEST PUSH2 0x13AD DUP10 PUSH2 0x2F29 JUMP JUMPDEST PUSH32 0x100000000000000000000000000000000000000000000000000000000000000 SWAP1 DIV SWAP7 POP PUSH1 0x7 PUSH1 0xFF DUP9 AND LT PUSH2 0x140F JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x554F JUMP JUMPDEST DUP7 PUSH1 0xFF AND PUSH1 0x7 DUP2 GT ISZERO PUSH2 0x141E JUMPI INVALID JUMPDEST SWAP6 POP PUSH1 0x0 DUP7 PUSH1 0x7 DUP2 GT ISZERO PUSH2 0x142E JUMPI INVALID JUMPDEST EQ ISZERO PUSH2 0x1466 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x561F JUMP JUMPDEST PUSH1 0x1 DUP7 PUSH1 0x7 DUP2 GT ISZERO PUSH2 0x1474 JUMPI INVALID JUMPDEST EQ ISZERO PUSH2 0x14BC JUMPI DUP9 MLOAD ISZERO PUSH2 0x14B3 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x56EF JUMP JUMPDEST PUSH1 0x0 SWAP8 POP PUSH2 0x18D0 JUMP JUMPDEST PUSH1 0x2 DUP7 PUSH1 0x7 DUP2 GT ISZERO PUSH2 0x14CA JUMPI INVALID JUMPDEST EQ ISZERO PUSH2 0x1605 JUMPI DUP9 MLOAD PUSH1 0x41 EQ PUSH2 0x150B JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x54EF JUMP JUMPDEST DUP9 PUSH1 0x0 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x151A JUMPI INVALID JUMPDEST ADD PUSH1 0x20 ADD MLOAD PUSH32 0x100000000000000000000000000000000000000000000000000000000000000 SWAP1 DUP2 SWAP1 DIV DUP2 MUL DIV SWAP5 POP PUSH2 0x155A DUP10 PUSH1 0x1 PUSH4 0xFFFFFFFF PUSH2 0x2FED AND JUMP JUMPDEST SWAP4 POP PUSH2 0x156D DUP10 PUSH1 0x21 PUSH4 0xFFFFFFFF PUSH2 0x2FED AND JUMP JUMPDEST SWAP3 POP PUSH1 0x1 DUP12 DUP7 DUP7 DUP7 PUSH1 0x40 MLOAD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MSTORE PUSH1 0x40 MLOAD PUSH2 0x1592 SWAP5 SWAP4 SWAP3 SWAP2 SWAP1 PUSH2 0x5480 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 SUB SWAP1 DUP1 DUP5 SUB SWAP1 PUSH1 0x0 DUP7 GAS CALL ISZERO DUP1 ISZERO PUSH2 0x15B6 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP PUSH1 0x40 MLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP13 DUP2 AND SWAP1 DUP3 AND EQ SWAP10 POP SWAP3 POP PUSH2 0x18D0 SWAP1 POP JUMP JUMPDEST PUSH1 0x3 DUP7 PUSH1 0x7 DUP2 GT ISZERO PUSH2 0x1613 JUMPI INVALID JUMPDEST EQ ISZERO PUSH2 0x17B9 JUMPI DUP9 MLOAD PUSH1 0x41 EQ PUSH2 0x1654 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x54EF JUMP JUMPDEST DUP9 PUSH1 0x0 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1663 JUMPI INVALID JUMPDEST ADD PUSH1 0x20 ADD MLOAD PUSH32 0x100000000000000000000000000000000000000000000000000000000000000 SWAP1 DUP2 SWAP1 DIV DUP2 MUL DIV SWAP5 POP PUSH2 0x16A3 DUP10 PUSH1 0x1 PUSH4 0xFFFFFFFF PUSH2 0x2FED AND JUMP JUMPDEST SWAP4 POP PUSH2 0x16B6 DUP10 PUSH1 0x21 PUSH4 0xFFFFFFFF PUSH2 0x2FED AND JUMP JUMPDEST SWAP3 POP PUSH1 0x1 DUP12 PUSH1 0x40 MLOAD PUSH1 0x20 ADD DUP1 DUP1 PUSH32 0x19457468657265756D205369676E6564204D6573736167653A0A333200000000 DUP2 MSTORE POP PUSH1 0x1C ADD DUP3 PUSH1 0x0 NOT AND PUSH1 0x0 NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE PUSH1 0x40 MLOAD DUP1 DUP3 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT PUSH2 0x1757 JUMPI DUP1 MLOAD DUP3 MSTORE PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 SWAP1 SWAP3 ADD SWAP2 PUSH1 0x20 SWAP2 DUP3 ADD SWAP2 ADD PUSH2 0x171A JUMP JUMPDEST MLOAD DUP2 MLOAD PUSH1 0x20 SWAP4 DUP5 SUB PUSH2 0x100 EXP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD DUP1 NOT SWAP1 SWAP3 AND SWAP2 AND OR SWAP1 MSTORE PUSH1 0x40 DUP1 MLOAD SWAP3 SWAP1 SWAP5 ADD DUP3 SWAP1 SUB DUP3 KECCAK256 PUSH1 0x0 DUP4 MSTORE SWAP2 ADD SWAP3 DUP4 SWAP1 MSTORE PUSH2 0x1592 SWAP5 POP SWAP3 POP DUP10 SWAP2 DUP10 SWAP2 POP DUP9 SWAP1 PUSH2 0x5480 JUMP JUMPDEST PUSH1 0x4 DUP7 PUSH1 0x7 DUP2 GT ISZERO PUSH2 0x17C7 JUMPI INVALID JUMPDEST EQ ISZERO PUSH2 0x17DF JUMPI PUSH2 0x17D8 DUP12 DUP12 DUP12 PUSH2 0x3038 JUMP JUMPDEST SWAP8 POP PUSH2 0x18D0 JUMP JUMPDEST PUSH1 0x5 DUP7 PUSH1 0x7 DUP2 GT ISZERO PUSH2 0x17ED JUMPI INVALID JUMPDEST EQ ISZERO PUSH2 0x1850 JUMPI PUSH2 0x17FC DUP10 PUSH2 0x318D JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP13 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x7 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 SWAP4 DUP6 AND DUP4 MSTORE SWAP3 SWAP1 MSTORE KECCAK256 SLOAD SWAP1 SWAP2 POP PUSH1 0xFF AND ISZERO ISZERO PUSH2 0x1844 JUMPI PUSH1 0x0 SWAP8 POP PUSH2 0x18D0 JUMP JUMPDEST PUSH2 0x17D8 DUP2 DUP13 DUP13 DUP13 PUSH2 0x3206 JUMP JUMPDEST PUSH1 0x6 DUP7 PUSH1 0x7 DUP2 GT ISZERO PUSH2 0x185E JUMPI INVALID JUMPDEST EQ ISZERO PUSH2 0x189E JUMPI PUSH1 0x0 DUP12 DUP2 MSTORE PUSH1 0x6 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP15 AND DUP5 MSTORE SWAP1 SWAP2 MSTORE SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND SWAP8 POP PUSH2 0x18D0 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x554F JUMP JUMPDEST POP POP POP POP POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH2 0x18E6 PUSH2 0x4298 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH2 0x18F6 PUSH2 0x4298 JUMP JUMPDEST DUP10 PUSH1 0x0 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1905 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x140 ADD MLOAD SWAP6 POP DUP10 MLOAD SWAP5 POP PUSH1 0x0 SWAP4 POP JUMPDEST DUP4 DUP6 EQ PUSH2 0x19E4 JUMPI DUP6 DUP11 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1935 JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD MLOAD PUSH2 0x140 ADD MSTORE DUP7 MLOAD PUSH2 0x1951 SWAP1 DUP11 SWAP1 PUSH2 0x2EE2 JUMP JUMPDEST SWAP3 POP PUSH2 0x1994 DUP11 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1964 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH1 0xA0 ADD MLOAD DUP12 DUP7 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1980 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH1 0x80 ADD MLOAD DUP6 PUSH2 0x3362 JUMP JUMPDEST SWAP2 POP PUSH2 0x19C0 DUP11 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x19A7 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP4 DUP11 DUP8 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xE8E JUMPI INVALID JUMPDEST SWAP1 POP PUSH2 0x19CC DUP8 DUP3 PUSH2 0x2532 JUMP JUMPDEST DUP7 MLOAD DUP10 GT PUSH2 0x19D9 JUMPI PUSH2 0x19E4 JUMP JUMPDEST PUSH1 0x1 SWAP1 SWAP4 ADD SWAP3 PUSH2 0x191F JUMP JUMPDEST POP POP POP POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH2 0x19F9 PUSH2 0x4298 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x1A36 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x567F JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR SWAP1 SSTORE PUSH2 0xF9C DUP5 DUP5 DUP5 PUSH2 0x2494 JUMP JUMPDEST PUSH1 0x9 SLOAD PUSH1 0x0 SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND ISZERO PUSH2 0x1ABF JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x567F JUMP JUMPDEST PUSH2 0x1B02 PUSH2 0x1AFD DUP9 DUP9 DUP9 DUP9 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY POP PUSH2 0x33B8 SWAP5 POP POP POP POP POP JUMP JUMPDEST PUSH2 0x35F9 JUMP JUMPDEST PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x8 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD SWAP1 SWAP2 POP PUSH1 0xFF AND ISZERO PUSH2 0x1B4E JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x559F JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP7 AND CALLER EQ PUSH2 0x1C1F JUMPI PUSH2 0x1BA6 DUP2 DUP8 DUP6 DUP6 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY POP PUSH2 0x135B SWAP5 POP POP POP POP POP JUMP JUMPDEST ISZERO ISZERO PUSH2 0x1BDE JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x56DF JUMP JUMPDEST PUSH1 0x9 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP9 AND OR SWAP1 SSTORE JUMPDEST PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x8 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 DUP2 SWAP1 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR SWAP1 SSTORE MLOAD ADDRESS SWAP1 DUP7 SWAP1 DUP7 SWAP1 DUP1 DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP SWAP3 POP POP POP PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP6 GAS DELEGATECALL SWAP2 POP POP ISZERO ISZERO PUSH2 0x1CB6 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x55CF JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP7 AND CALLER EQ PUSH2 0x1CFC JUMPI PUSH1 0x9 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND SWAP1 SSTORE JUMPDEST POP POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x2 SLOAD PUSH1 0x0 SWAP1 DUP2 SWAP1 DUP2 SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0x1D5D JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x568F JUMP JUMPDEST DUP4 SWAP3 POP DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0xAE25532E PUSH1 0x40 MLOAD DUP2 PUSH4 0xFFFFFFFF AND PUSH29 0x100000000000000000000000000000000000000000000000000000000 MUL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x1DC4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x1DD8 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP PUSH2 0x1DFC SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x491E JUMP JUMPDEST PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 DUP2 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0xA PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD SWAP1 SWAP3 POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 POP DUP1 ISZERO PUSH2 0x1E81 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x552F JUMP JUMPDEST PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0xA PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 DUP2 SWAP1 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP7 AND OR SWAP1 SSTORE MLOAD PUSH32 0xD2C6B762299C609BDB96520B58A49BFB80186934D4F71A86A367571A15C03194 SWAP1 PUSH2 0x1F22 SWAP1 DUP5 SWAP1 DUP8 SWAP1 PUSH2 0x54B5 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG1 POP POP POP POP JUMP JUMPDEST PUSH2 0x1F38 PUSH2 0x42F0 JUMP JUMPDEST PUSH2 0x1F41 DUP3 PUSH2 0x3639 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP4 ADD DUP3 SWAP1 MSTORE PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x3 SWAP1 MSTORE PUSH1 0x40 SWAP1 DUP2 SWAP1 KECCAK256 SLOAD SWAP1 DUP3 ADD MSTORE PUSH1 0x80 DUP3 ADD MLOAD ISZERO ISZERO PUSH2 0x1F75 JUMPI PUSH1 0x1 JUMPDEST PUSH1 0xFF AND DUP2 MSTORE PUSH2 0xF07 JUMP JUMPDEST PUSH1 0xA0 DUP3 ADD MLOAD ISZERO ISZERO PUSH2 0x1F87 JUMPI PUSH1 0x2 PUSH2 0x1F6B JUMP JUMPDEST PUSH1 0xA0 DUP3 ADD MLOAD PUSH1 0x40 DUP3 ADD MLOAD LT PUSH2 0x1F9D JUMPI PUSH1 0x5 PUSH2 0x1F6B JUMP JUMPDEST PUSH2 0x100 DUP3 ADD MLOAD TIMESTAMP LT PUSH2 0x1FB0 JUMPI PUSH1 0x4 PUSH2 0x1F6B JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 ADD MLOAD PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x4 SWAP1 SWAP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x1FD4 JUMPI PUSH1 0x6 PUSH2 0x1F6B JUMP JUMPDEST PUSH2 0x120 DUP3 ADD MLOAD DUP3 MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 DUP2 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x5 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 PUSH1 0x60 DUP9 ADD MLOAD SWAP1 SWAP5 AND DUP4 MSTORE SWAP3 SWAP1 MSTORE KECCAK256 SLOAD GT ISZERO PUSH2 0x2021 JUMPI PUSH1 0x6 PUSH2 0x1F6B JUMP JUMPDEST PUSH1 0x3 DUP2 MSTORE SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x2067 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x567F JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR SWAP1 SSTORE PUSH2 0x209B DUP2 PUSH2 0x2E64 JUMP JUMPDEST POP PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE JUMP JUMPDEST PUSH1 0x5 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x0 SWAP3 DUP4 MSTORE PUSH1 0x40 DUP1 DUP5 KECCAK256 SWAP1 SWAP2 MSTORE SWAP1 DUP3 MSTORE SWAP1 KECCAK256 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x24 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0xF47261B0000000000000000000000000E41D2489571D322189246DAFA5EBDE1F DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x4699F49800000000000000000000000000000000000000000000000000000000 DUP2 MSTORE POP DUP2 JUMP JUMPDEST PUSH2 0x214B PUSH2 0x4298 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x0 DUP1 PUSH1 0x0 PUSH2 0x215A PUSH2 0x4298 JUMP JUMPDEST DUP9 PUSH1 0x0 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x2169 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x160 ADD MLOAD SWAP5 POP DUP9 MLOAD SWAP4 POP PUSH1 0x0 SWAP3 POP JUMPDEST DUP3 DUP5 EQ PUSH2 0x220C JUMPI DUP5 DUP10 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x2199 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x160 ADD DUP2 SWAP1 MSTORE POP PUSH2 0x21B9 DUP9 DUP8 PUSH1 0x20 ADD MLOAD PUSH2 0x2EE2 JUMP JUMPDEST SWAP2 POP PUSH2 0x21E5 DUP10 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x21CC JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP4 DUP10 DUP7 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xE8E JUMPI INVALID JUMPDEST SWAP1 POP PUSH2 0x21F1 DUP7 DUP3 PUSH2 0x2532 JUMP JUMPDEST PUSH1 0x20 DUP7 ADD MLOAD DUP9 GT PUSH2 0x2201 JUMPI PUSH2 0x220C JUMP JUMPDEST PUSH1 0x1 SWAP1 SWAP3 ADD SWAP2 PUSH2 0x2183 JUMP JUMPDEST POP POP POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x1 SLOAD DUP2 JUMP JUMPDEST PUSH2 0x2226 PUSH2 0x4298 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH2 0x2236 PUSH2 0x4298 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x2273 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x567F JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR DUP2 SSTORE DUP11 MLOAD DUP12 SWAP2 SWAP1 DUP2 LT PUSH2 0x22AB JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x140 ADD MLOAD SWAP6 POP DUP10 MLOAD SWAP5 POP PUSH1 0x0 SWAP4 POP JUMPDEST DUP4 DUP6 EQ PUSH2 0x235A JUMPI DUP6 DUP11 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x22DB JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD MLOAD PUSH2 0x140 ADD MSTORE DUP7 MLOAD PUSH2 0x22F7 SWAP1 DUP11 SWAP1 PUSH2 0x2EE2 JUMP JUMPDEST SWAP3 POP PUSH2 0x230A DUP11 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1964 JUMPI INVALID JUMPDEST SWAP2 POP PUSH2 0x2336 DUP11 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x231D JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP4 DUP11 DUP8 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x749 JUMPI INVALID JUMPDEST SWAP1 POP PUSH2 0x2342 DUP8 DUP3 PUSH2 0x2532 JUMP JUMPDEST DUP7 MLOAD DUP10 GT PUSH2 0x234F JUMPI PUSH2 0x235A JUMP JUMPDEST PUSH1 0x1 SWAP1 SWAP4 ADD SWAP3 PUSH2 0x22C5 JUMP JUMPDEST POP POP PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE POP SWAP3 SWAP7 SWAP6 POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x9 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x2 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0x23FD JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x568F JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND ISZERO PUSH2 0x245A JUMPI PUSH1 0x2 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND OR SWAP1 SSTORE JUMPDEST POP JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD DUP1 DUP3 ADD SWAP1 SWAP2 MSTORE PUSH1 0x5 DUP2 MSTORE PUSH32 0x322E302E30000000000000000000000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE DUP2 JUMP JUMPDEST PUSH2 0x249C PUSH2 0x4298 JUMP JUMPDEST PUSH2 0x24A4 PUSH2 0x42F0 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH2 0x24B2 DUP9 PUSH2 0x1F30 JUMP JUMPDEST SWAP4 POP PUSH2 0x24BC PUSH2 0x2594 JUMP JUMPDEST SWAP3 POP PUSH2 0x24CA DUP9 DUP6 DUP6 DUP10 PUSH2 0x25C6 JUMP JUMPDEST PUSH2 0x24DC DUP9 PUSH1 0xA0 ADD MLOAD DUP6 PUSH1 0x40 ADD MLOAD PUSH2 0x2EE2 JUMP JUMPDEST SWAP2 POP PUSH2 0x24E8 DUP8 DUP4 PUSH2 0x3647 JUMP JUMPDEST SWAP1 POP PUSH2 0x24FB DUP9 DUP6 DUP10 DUP5 DUP10 PUSH1 0x0 ADD MLOAD PUSH2 0x2945 JUMP JUMPDEST PUSH2 0x2505 DUP9 DUP3 PUSH2 0x365D JUMP JUMPDEST SWAP5 POP PUSH2 0x251C DUP9 DUP5 DUP7 PUSH1 0x20 ADD MLOAD DUP8 PUSH1 0x40 ADD MLOAD DUP10 PUSH2 0x2A5E JUMP JUMPDEST PUSH2 0x2527 DUP9 DUP5 DUP8 PUSH2 0x36BE JUMP JUMPDEST POP POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST DUP2 MLOAD DUP2 MLOAD PUSH2 0x2540 SWAP2 SWAP1 PUSH2 0x3776 JUMP JUMPDEST DUP3 MSTORE PUSH1 0x20 DUP1 DUP4 ADD MLOAD SWAP1 DUP3 ADD MLOAD PUSH2 0x2556 SWAP2 SWAP1 PUSH2 0x3776 JUMP JUMPDEST PUSH1 0x20 DUP4 ADD MSTORE PUSH1 0x40 DUP1 DUP4 ADD MLOAD SWAP1 DUP3 ADD MLOAD PUSH2 0x256F SWAP2 SWAP1 PUSH2 0x3776 JUMP JUMPDEST PUSH1 0x40 DUP4 ADD MSTORE PUSH1 0x60 DUP1 DUP4 ADD MLOAD SWAP1 DUP3 ADD MLOAD PUSH2 0x2588 SWAP2 SWAP1 PUSH2 0x3776 JUMP JUMPDEST PUSH1 0x60 SWAP1 SWAP3 ADD SWAP2 SWAP1 SWAP2 MSTORE POP JUMP JUMPDEST PUSH1 0x9 SLOAD PUSH1 0x0 SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 DUP2 ISZERO PUSH2 0x25BD JUMPI DUP2 PUSH2 0x25BF JUMP JUMPDEST CALLER JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST DUP3 MLOAD PUSH1 0xFF AND PUSH1 0x3 EQ PUSH2 0x2604 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x56AF JUMP JUMPDEST PUSH1 0x60 DUP5 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND ISZERO PUSH2 0x2677 JUMPI PUSH1 0x60 DUP5 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0x2677 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x56BF JUMP JUMPDEST PUSH1 0x20 DUP5 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND ISZERO PUSH2 0x2702 JUMPI DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP5 PUSH1 0x20 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x2702 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x54FF JUMP JUMPDEST PUSH1 0x40 DUP4 ADD MLOAD ISZERO ISZERO PUSH2 0x2758 JUMPI PUSH2 0x2720 DUP4 PUSH1 0x20 ADD MLOAD DUP6 PUSH1 0x0 ADD MLOAD DUP4 PUSH2 0x135B JUMP JUMPDEST ISZERO ISZERO PUSH2 0x2758 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x556F JUMP JUMPDEST POP POP POP POP JUMP JUMPDEST PUSH2 0x2770 DUP3 PUSH1 0xA0 ADD MLOAD DUP3 PUSH1 0xA0 ADD MLOAD PUSH2 0x37C0 JUMP JUMPDEST PUSH2 0x2782 DUP4 PUSH1 0x80 ADD MLOAD DUP4 PUSH1 0x80 ADD MLOAD PUSH2 0x37C0 JUMP JUMPDEST LT ISZERO PUSH2 0x27BA JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x56CF JUMP JUMPDEST POP POP JUMP JUMPDEST PUSH2 0x27C6 PUSH2 0x42C1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH2 0x27DA DUP10 PUSH1 0xA0 ADD MLOAD DUP9 PUSH2 0x2EE2 JUMP JUMPDEST SWAP4 POP PUSH2 0x27EF DUP10 PUSH1 0x80 ADD MLOAD DUP11 PUSH1 0xA0 ADD MLOAD DUP7 PUSH2 0x381B JUMP JUMPDEST SWAP3 POP PUSH2 0x27FF DUP9 PUSH1 0xA0 ADD MLOAD DUP8 PUSH2 0x2EE2 JUMP JUMPDEST SWAP2 POP PUSH2 0x2814 DUP9 PUSH1 0x80 ADD MLOAD DUP10 PUSH1 0xA0 ADD MLOAD DUP5 PUSH2 0x381B JUMP JUMPDEST SWAP1 POP DUP1 DUP5 LT PUSH2 0x2857 JUMPI PUSH1 0x20 DUP1 DUP7 ADD DUP1 MLOAD DUP4 SWAP1 MSTORE DUP1 MLOAD DUP3 ADD DUP5 SWAP1 MSTORE MLOAD MLOAD DUP7 MLOAD DUP3 ADD MSTORE PUSH1 0x80 DUP11 ADD MLOAD PUSH1 0xA0 DUP12 ADD MLOAD DUP8 MLOAD SWAP1 SWAP3 ADD MLOAD PUSH2 0x284F SWAP3 SWAP1 PUSH2 0x381B JUMP JUMPDEST DUP6 MLOAD MSTORE PUSH2 0x2894 JUMP JUMPDEST DUP5 MLOAD DUP4 SWAP1 MSTORE DUP5 MLOAD PUSH1 0x20 SWAP1 DUP2 ADD DUP6 SWAP1 MSTORE DUP6 MLOAD DUP2 ADD MLOAD SWAP1 DUP7 ADD DUP1 MLOAD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0xA0 DUP10 ADD MLOAD PUSH1 0x80 DUP11 ADD MLOAD SWAP2 MLOAD MLOAD PUSH2 0x288B SWAP3 SWAP1 PUSH2 0x3898 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP8 ADD MLOAD ADD MSTORE JUMPDEST DUP5 MLOAD MLOAD PUSH1 0x20 DUP1 DUP8 ADD MLOAD ADD MLOAD PUSH2 0x28A9 SWAP2 SWAP1 PUSH2 0x2EE2 JUMP JUMPDEST PUSH1 0x40 DUP7 ADD MSTORE DUP5 MLOAD MLOAD PUSH1 0x80 DUP11 ADD MLOAD PUSH1 0xC0 DUP12 ADD MLOAD PUSH2 0x28C6 SWAP3 SWAP2 SWAP1 PUSH2 0x381B JUMP JUMPDEST DUP6 MLOAD PUSH1 0x40 ADD MSTORE DUP5 MLOAD PUSH1 0x20 ADD MLOAD PUSH1 0xA0 DUP11 ADD MLOAD PUSH1 0xE0 DUP12 ADD MLOAD PUSH2 0x28E7 SWAP3 SWAP2 SWAP1 PUSH2 0x381B JUMP JUMPDEST DUP6 MLOAD PUSH1 0x60 ADD MSTORE PUSH1 0x20 DUP6 ADD MLOAD MLOAD PUSH1 0x80 DUP10 ADD MLOAD PUSH1 0xC0 DUP11 ADD MLOAD PUSH2 0x2908 SWAP3 SWAP2 SWAP1 PUSH2 0x381B JUMP JUMPDEST DUP6 PUSH1 0x20 ADD MLOAD PUSH1 0x40 ADD DUP2 DUP2 MSTORE POP POP PUSH2 0x2930 DUP6 PUSH1 0x20 ADD MLOAD PUSH1 0x20 ADD MLOAD DUP10 PUSH1 0xA0 ADD MLOAD DUP11 PUSH1 0xE0 ADD MLOAD PUSH2 0x381B JUMP JUMPDEST PUSH1 0x20 DUP7 ADD MLOAD PUSH1 0x60 ADD MSTORE POP POP POP POP SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST DUP3 ISZERO ISZERO PUSH2 0x297E JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x55EF JUMP JUMPDEST DUP3 DUP3 GT ISZERO PUSH2 0x29B8 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x55DF JUMP JUMPDEST DUP5 PUSH1 0xA0 ADD MLOAD PUSH2 0x29CB DUP6 PUSH1 0x40 ADD MLOAD DUP5 PUSH2 0x3776 JUMP JUMPDEST GT ISZERO PUSH2 0x2A03 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x550F JUMP JUMPDEST PUSH2 0x2A11 DUP6 PUSH1 0x80 ADD MLOAD DUP4 PUSH2 0x37C0 JUMP JUMPDEST PUSH2 0x2A1F DUP3 DUP8 PUSH1 0xA0 ADD MLOAD PUSH2 0x37C0 JUMP JUMPDEST GT ISZERO PUSH2 0x2A57 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x566F JUMP JUMPDEST POP POP POP POP POP JUMP JUMPDEST PUSH2 0x2A6C DUP3 DUP3 PUSH1 0x20 ADD MLOAD PUSH2 0x3776 JUMP JUMPDEST PUSH1 0x0 DUP5 DUP2 MSTORE PUSH1 0x3 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP2 DUP3 SWAP1 KECCAK256 SWAP3 SWAP1 SWAP3 SSTORE DUP7 DUP2 ADD MLOAD DUP8 MLOAD DUP5 MLOAD SWAP4 DUP6 ADD MLOAD DUP6 DUP5 ADD MLOAD PUSH1 0x60 DUP8 ADD MLOAD PUSH2 0x140 DUP13 ADD MLOAD PUSH2 0x160 DUP14 ADD MLOAD SWAP7 MLOAD DUP12 SWAP9 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP8 DUP9 AND SWAP9 SWAP8 SWAP1 SWAP7 AND SWAP7 PUSH32 0xBCC4C97732E47D9946F229EDB95F5B6323F601300E4690DE719993F3C371129 SWAP7 PUSH2 0x2AFB SWAP7 DUP16 SWAP7 CALLER SWAP7 SWAP3 SWAP6 SWAP2 SWAP5 SWAP1 SWAP4 SWAP1 PUSH2 0x5345 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG4 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x60 DUP1 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x24 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0xF47261B0000000000000000000000000E41D2489571D322189246DAFA5EBDE1F DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x4699F49800000000000000000000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 POP PUSH2 0x2B8B DUP6 PUSH2 0x140 ADD MLOAD DUP7 PUSH1 0x0 ADD MLOAD DUP7 PUSH1 0x0 ADD MLOAD DUP6 PUSH1 0x20 ADD MLOAD PUSH1 0x20 ADD MLOAD PUSH2 0x3935 JUMP JUMPDEST PUSH2 0x140 DUP5 ADD MLOAD DUP5 MLOAD DUP7 MLOAD DUP5 MLOAD PUSH1 0x20 ADD MLOAD PUSH2 0x2BA7 SWAP4 SWAP3 SWAP2 SWAP1 PUSH2 0x3935 JUMP JUMPDEST PUSH2 0x2BC0 DUP6 PUSH2 0x140 ADD MLOAD DUP7 PUSH1 0x0 ADD MLOAD DUP6 DUP6 PUSH1 0x40 ADD MLOAD PUSH2 0x3935 JUMP JUMPDEST PUSH2 0x2BDC DUP2 DUP7 PUSH1 0x0 ADD MLOAD DUP8 PUSH1 0x40 ADD MLOAD DUP6 PUSH1 0x0 ADD MLOAD PUSH1 0x40 ADD MLOAD PUSH2 0x3935 JUMP JUMPDEST PUSH2 0x2BF8 DUP2 DUP6 PUSH1 0x0 ADD MLOAD DUP7 PUSH1 0x40 ADD MLOAD DUP6 PUSH1 0x20 ADD MLOAD PUSH1 0x40 ADD MLOAD PUSH2 0x3935 JUMP JUMPDEST DUP4 PUSH1 0x40 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP6 PUSH1 0x40 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0x2C62 JUMPI PUSH2 0x2C5D DUP2 DUP5 DUP8 PUSH1 0x40 ADD MLOAD PUSH2 0x2C58 DUP7 PUSH1 0x0 ADD MLOAD PUSH1 0x60 ADD MLOAD DUP8 PUSH1 0x20 ADD MLOAD PUSH1 0x60 ADD MLOAD PUSH2 0x3776 JUMP JUMPDEST PUSH2 0x3935 JUMP JUMPDEST PUSH2 0x2A57 JUMP JUMPDEST PUSH2 0x2C7A DUP2 DUP5 DUP8 PUSH1 0x40 ADD MLOAD DUP6 PUSH1 0x0 ADD MLOAD PUSH1 0x60 ADD MLOAD PUSH2 0x3935 JUMP JUMPDEST PUSH2 0x2A57 DUP2 DUP5 DUP7 PUSH1 0x40 ADD MLOAD DUP6 PUSH1 0x20 ADD MLOAD PUSH1 0x60 ADD MLOAD PUSH2 0x3935 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0xB4BE83D500000000000000000000000000000000000000000000000000000000 PUSH1 0x20 DUP1 DUP4 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x60 PUSH1 0x24 DUP4 ADD DUP2 DUP2 MSTORE DUP8 MLOAD PUSH1 0x84 DUP6 ADD SWAP1 DUP2 MSTORE DUP9 DUP5 ADD MLOAD PUSH1 0xA4 DUP7 ADD MSTORE SWAP5 DUP9 ADD MLOAD PUSH1 0xC4 DUP6 ADD MSTORE SWAP1 DUP8 ADD MLOAD PUSH1 0xE4 DUP5 ADD MSTORE PUSH1 0x80 DUP8 ADD MLOAD PUSH2 0x104 DUP5 ADD MSTORE PUSH1 0xA0 DUP8 ADD MLOAD PUSH2 0x124 DUP5 ADD MSTORE PUSH1 0xC0 DUP8 ADD MLOAD PUSH2 0x144 DUP5 ADD MSTORE PUSH1 0xE0 DUP8 ADD MLOAD PUSH2 0x164 DUP5 ADD MSTORE PUSH2 0x100 DUP8 ADD MLOAD PUSH2 0x184 DUP5 ADD MSTORE PUSH2 0x120 DUP8 ADD MLOAD PUSH2 0x1A4 DUP5 ADD MSTORE PUSH2 0x140 DUP8 ADD DUP1 MLOAD PUSH2 0x1C4 DUP6 ADD SWAP1 DUP2 MSTORE PUSH2 0x160 DUP10 ADD MLOAD PUSH2 0x1E4 DUP7 ADD MSTORE PUSH2 0x180 SWAP1 MSTORE MLOAD DUP1 MLOAD PUSH2 0x204 DUP6 ADD DUP2 SWAP1 MSTORE SWAP4 SWAP5 SWAP2 SWAP4 DUP5 SWAP4 PUSH1 0x44 DUP8 ADD SWAP3 DUP5 SWAP3 PUSH2 0x224 DUP10 ADD SWAP3 SWAP2 DUP3 ADD SWAP2 PUSH1 0x1F DUP3 ADD DIV PUSH1 0x0 JUMPDEST DUP2 DUP2 LT ISZERO PUSH2 0x2D99 JUMPI DUP4 MLOAD DUP6 MSTORE PUSH1 0x20 SWAP5 DUP6 ADD SWAP5 SWAP1 SWAP4 ADD SWAP3 PUSH1 0x1 ADD PUSH2 0x2D7B JUMP JUMPDEST POP POP POP POP DUP2 DUP2 SUB PUSH2 0x160 DUP1 DUP5 ADD SWAP2 SWAP1 SWAP2 MSTORE DUP11 ADD MLOAD DUP1 MLOAD DUP1 DUP4 MSTORE PUSH1 0x20 SWAP3 DUP4 ADD SWAP3 SWAP2 DUP3 ADD SWAP2 PUSH1 0x1F DUP3 ADD DIV PUSH1 0x0 JUMPDEST DUP2 DUP2 LT ISZERO PUSH2 0x2DE2 JUMPI DUP4 MLOAD DUP6 MSTORE PUSH1 0x20 SWAP5 DUP6 ADD SWAP5 SWAP1 SWAP4 ADD SWAP3 PUSH1 0x1 ADD PUSH2 0x2DC4 JUMP JUMPDEST POP POP POP DUP10 DUP5 MSTORE POP DUP5 DUP2 SUB PUSH1 0x20 SWAP4 DUP5 ADD SWAP1 DUP2 MSTORE DUP9 MLOAD DUP1 DUP4 MSTORE SWAP1 SWAP4 SWAP2 DUP3 ADD SWAP2 DUP10 DUP2 ADD SWAP2 SWAP1 PUSH1 0x1F DUP3 ADD DIV PUSH1 0x0 JUMPDEST DUP2 DUP2 LT ISZERO PUSH2 0x2E2A JUMPI DUP4 MLOAD DUP6 MSTORE PUSH1 0x20 SWAP5 DUP6 ADD SWAP5 SWAP1 SWAP4 ADD SWAP3 PUSH1 0x1 ADD PUSH2 0x2E0C JUMP JUMPDEST POP POP POP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 DUP9 DUP4 SUB ADD DUP9 MSTORE POP PUSH1 0x40 MSTORE POP POP POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH2 0x2E6C PUSH2 0x42F0 JUMP JUMPDEST PUSH2 0x2E75 DUP3 PUSH2 0x1F30 JUMP JUMPDEST SWAP1 POP PUSH2 0x2E81 DUP3 DUP3 PUSH2 0x3AFF JUMP JUMPDEST PUSH2 0x27BA DUP3 DUP3 PUSH1 0x20 ADD MLOAD PUSH2 0x3C16 JUMP JUMPDEST PUSH2 0x2E97 PUSH2 0x4298 JUMP JUMPDEST PUSH2 0x2EA2 DUP5 DUP5 DUP5 PUSH2 0x2494 JUMP JUMPDEST PUSH1 0x20 DUP2 ADD MLOAD SWAP1 SWAP2 POP DUP4 EQ PUSH2 0x25BF JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x565F JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 GT ISZERO PUSH2 0x2F1E JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x551F JUMP JUMPDEST POP DUP1 DUP3 SUB JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP3 MLOAD GT ISZERO ISZERO PUSH2 0x2F67 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x560F JUMP JUMPDEST DUP2 MLOAD DUP3 SWAP1 PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 ADD SWAP1 DUP2 LT PUSH2 0x2F97 JUMPI INVALID JUMPDEST ADD PUSH1 0x20 ADD MLOAD DUP3 MLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 SWAP3 MSTORE POP PUSH32 0x100000000000000000000000000000000000000000000000000000000000000 SWAP1 DUP2 SWAP1 DIV MUL SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x20 ADD DUP4 MLOAD LT ISZERO ISZERO ISZERO PUSH2 0x302F JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x553F JUMP JUMPDEST POP ADD PUSH1 0x20 ADD MLOAD SWAP1 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x0 SWAP1 PUSH1 0x60 SWAP1 PUSH32 0x1626BA7E00000000000000000000000000000000000000000000000000000000 SWAP1 PUSH2 0x3073 SWAP1 DUP8 SWAP1 DUP7 SWAP1 PUSH1 0x24 ADD PUSH2 0x5460 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 DUP2 DUP5 SUB ADD DUP2 MSTORE SWAP2 SWAP1 MSTORE PUSH1 0x20 DUP1 DUP3 ADD DUP1 MLOAD PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 SWAP1 SWAP5 AND SWAP4 SWAP1 SWAP4 OR DUP4 MSTORE DUP2 MLOAD SWAP2 SWAP4 POP SWAP1 DUP3 SWAP1 DUP2 DUP9 GAS STATICCALL DUP1 DUP1 ISZERO PUSH2 0x3110 JUMPI PUSH1 0x1 DUP2 EQ PUSH2 0x3181 JUMPI PUSH2 0x2527 JUMP JUMPDEST PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH29 0x2000000000000000000000000000000000000000000000000000000000 PUSH1 0x20 MSTORE PUSH29 0xC57414C4C45545F4552524F5200000000000000000000000000000000 PUSH1 0x40 MSTORE PUSH1 0x0 PUSH1 0x60 MSTORE PUSH1 0x64 PUSH1 0x0 REVERT JUMPDEST POP POP MLOAD SWAP6 SWAP5 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x14 DUP3 MLOAD LT ISZERO ISZERO ISZERO PUSH2 0x31CD JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x569F JUMP JUMPDEST PUSH2 0x31DB DUP3 PUSH1 0x14 DUP5 MLOAD SUB PUSH2 0x3CBD JUMP JUMPDEST DUP3 MLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEC ADD SWAP1 SWAP3 MSTORE POP SWAP1 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x0 SWAP1 PUSH1 0x60 SWAP1 PUSH32 0x9363470200000000000000000000000000000000000000000000000000000000 SWAP1 PUSH2 0x3243 SWAP1 DUP8 SWAP1 DUP8 SWAP1 DUP8 SWAP1 PUSH1 0x24 ADD PUSH2 0x5433 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 DUP2 DUP5 SUB ADD DUP2 MSTORE SWAP2 SWAP1 MSTORE PUSH1 0x20 DUP1 DUP3 ADD DUP1 MLOAD PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 SWAP1 SWAP5 AND SWAP4 SWAP1 SWAP4 OR DUP4 MSTORE DUP2 MLOAD SWAP2 SWAP4 POP SWAP1 DUP3 SWAP1 DUP2 DUP11 GAS STATICCALL DUP1 DUP1 ISZERO PUSH2 0x32E0 JUMPI PUSH1 0x1 DUP2 EQ PUSH2 0x3351 JUMPI PUSH2 0x3356 JUMP JUMPDEST PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH29 0x2000000000000000000000000000000000000000000000000000000000 PUSH1 0x20 MSTORE PUSH29 0xF56414C494441544F525F4552524F5200000000000000000000000000 PUSH1 0x40 MSTORE PUSH1 0x0 PUSH1 0x60 MSTORE PUSH1 0x64 PUSH1 0x0 REVERT JUMPDEST DUP3 MLOAD SWAP5 POP JUMPDEST POP POP POP POP SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP4 GT PUSH2 0x339D JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x555F JUMP JUMPDEST PUSH2 0x33B0 PUSH2 0x33AA DUP6 DUP5 PUSH2 0x37C0 JUMP JUMPDEST DUP5 PUSH2 0x3D1E JUMP JUMPDEST SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0x5A65726F45785472616E73616374696F6E280000000000000000000000000000 PUSH1 0x20 DUP1 DUP4 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH32 0x75696E743235362073616C742C00000000000000000000000000000000000000 PUSH1 0x32 DUP4 ADD MSTORE PUSH32 0x61646472657373207369676E6572416464726573732C00000000000000000000 PUSH1 0x3F DUP4 ADD MSTORE PUSH32 0x6279746573206461746100000000000000000000000000000000000000000000 PUSH1 0x55 DUP4 ADD MSTORE PUSH32 0x2900000000000000000000000000000000000000000000000000000000000000 PUSH1 0x5F DUP4 ADD MSTORE DUP3 MLOAD DUP1 DUP4 SUB DUP5 ADD DUP2 MSTORE PUSH1 0x60 SWAP1 SWAP3 ADD SWAP3 DUP4 SWAP1 MSTORE DUP2 MLOAD PUSH1 0x0 SWAP4 DUP5 SWAP4 DUP5 SWAP4 SWAP1 SWAP3 DUP3 SWAP2 DUP5 ADD SWAP1 DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT PUSH2 0x34E1 JUMPI DUP1 MLOAD DUP3 MSTORE PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 SWAP1 SWAP3 ADD SWAP2 PUSH1 0x20 SWAP2 DUP3 ADD SWAP2 ADD PUSH2 0x34A4 JUMP JUMPDEST MLOAD DUP2 MLOAD PUSH1 0x20 SWAP4 DUP5 SUB PUSH2 0x100 EXP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD DUP1 NOT SWAP1 SWAP3 AND SWAP2 AND OR SWAP1 MSTORE PUSH1 0x40 MLOAD SWAP2 SWAP1 SWAP4 ADD DUP2 SWAP1 SUB DUP2 KECCAK256 DUP10 MLOAD SWAP1 SWAP8 POP DUP10 SWAP6 POP SWAP1 SWAP4 POP DUP4 SWAP3 DUP6 ADD SWAP2 POP DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT PUSH2 0x3577 JUMPI DUP1 MLOAD DUP3 MSTORE PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 SWAP1 SWAP3 ADD SWAP2 PUSH1 0x20 SWAP2 DUP3 ADD SWAP2 ADD PUSH2 0x353A JUMP JUMPDEST MLOAD DUP2 MLOAD PUSH1 0x20 SWAP4 DUP5 SUB PUSH2 0x100 EXP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD DUP1 NOT SWAP1 SWAP3 AND SWAP2 AND OR SWAP1 MSTORE PUSH1 0x40 DUP1 MLOAD SWAP3 SWAP1 SWAP5 ADD DUP3 SWAP1 SUB DUP3 KECCAK256 SWAP8 DUP3 MSTORE DUP2 ADD SWAP11 SWAP1 SWAP11 MSTORE POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP8 SWAP1 SWAP8 AND SWAP7 DUP9 ADD SWAP7 SWAP1 SWAP7 MSTORE POP POP PUSH1 0x60 DUP6 ADD MSTORE POP POP PUSH1 0x80 SWAP1 SWAP2 KECCAK256 SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x1 SLOAD PUSH1 0x40 MLOAD PUSH32 0x1901000000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x2 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x22 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x42 SWAP1 KECCAK256 SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x2F23 PUSH2 0x1AFD DUP4 PUSH2 0x3D35 JUMP JUMPDEST PUSH1 0x0 DUP2 DUP4 LT PUSH2 0x3656 JUMPI DUP2 PUSH2 0x25BF JUMP JUMPDEST POP SWAP1 SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0x3665 PUSH2 0x4298 JUMP JUMPDEST PUSH1 0x20 DUP2 ADD DUP3 SWAP1 MSTORE PUSH1 0xA0 DUP4 ADD MLOAD PUSH1 0x80 DUP5 ADD MLOAD PUSH2 0x3681 SWAP2 DUP5 SWAP2 PUSH2 0x381B JUMP JUMPDEST DUP1 DUP3 MSTORE PUSH1 0x80 DUP5 ADD MLOAD PUSH1 0xC0 DUP6 ADD MLOAD PUSH2 0x3699 SWAP3 SWAP2 SWAP1 PUSH2 0x381B JUMP JUMPDEST PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0xA0 DUP4 ADD MLOAD PUSH1 0xE0 DUP5 ADD MLOAD PUSH2 0x36B3 SWAP2 DUP5 SWAP2 PUSH2 0x381B JUMP JUMPDEST PUSH1 0x60 DUP3 ADD MSTORE SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x60 DUP2 ADD DUP3 MSTORE PUSH1 0x24 DUP2 MSTORE PUSH32 0xF47261B0000000000000000000000000E41D2489571D322189246DAFA5EBDE1F PUSH1 0x20 DUP3 ADD MSTORE PUSH32 0x4699F49800000000000000000000000000000000000000000000000000000000 SWAP2 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH2 0x140 DUP5 ADD MLOAD DUP5 MLOAD DUP4 MLOAD PUSH2 0x3731 SWAP3 SWAP2 SWAP1 DUP7 SWAP1 PUSH2 0x3935 JUMP JUMPDEST PUSH2 0x374A DUP5 PUSH2 0x160 ADD MLOAD DUP5 DUP7 PUSH1 0x0 ADD MLOAD DUP6 PUSH1 0x20 ADD MLOAD PUSH2 0x3935 JUMP JUMPDEST PUSH2 0x3762 DUP2 DUP6 PUSH1 0x0 ADD MLOAD DUP7 PUSH1 0x40 ADD MLOAD DUP6 PUSH1 0x40 ADD MLOAD PUSH2 0x3935 JUMP JUMPDEST PUSH2 0x2758 DUP2 DUP5 DUP7 PUSH1 0x40 ADD MLOAD DUP6 PUSH1 0x60 ADD MLOAD PUSH2 0x3935 JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 ADD DUP4 DUP2 LT ISZERO PUSH2 0x37B5 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x558F JUMP JUMPDEST DUP1 SWAP2 POP JUMPDEST POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP4 ISZERO ISZERO PUSH2 0x37D3 JUMPI PUSH1 0x0 SWAP2 POP PUSH2 0x37B9 JUMP JUMPDEST POP DUP3 DUP3 MUL DUP3 DUP5 DUP3 DUP2 ISZERO ISZERO PUSH2 0x37E3 JUMPI INVALID JUMPDEST DIV EQ PUSH2 0x37B5 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x558F JUMP JUMPDEST PUSH1 0x0 DUP1 DUP4 GT PUSH2 0x3856 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x555F JUMP JUMPDEST PUSH2 0x3861 DUP5 DUP5 DUP5 PUSH2 0x418E JUMP JUMPDEST ISZERO PUSH2 0x339D JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x55BF JUMP JUMPDEST PUSH1 0x0 DUP1 DUP4 GT PUSH2 0x38D3 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x555F JUMP JUMPDEST PUSH2 0x38DE DUP5 DUP5 DUP5 PUSH2 0x4213 JUMP JUMPDEST ISZERO PUSH2 0x3915 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x55BF JUMP JUMPDEST PUSH2 0x33B0 PUSH2 0x33AA PUSH2 0x3925 DUP7 DUP6 PUSH2 0x37C0 JUMP JUMPDEST PUSH2 0x3930 DUP7 PUSH1 0x1 PUSH2 0x2EE2 JUMP JUMPDEST PUSH2 0x3776 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP4 GT DUP1 ISZERO PUSH2 0x3974 JUMPI POP DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO JUMPDEST ISZERO PUSH2 0x3AF7 JUMPI DUP6 MLOAD PUSH1 0x3 LT PUSH2 0x39B4 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x564F JUMP JUMPDEST POP POP PUSH1 0x20 DUP5 DUP2 ADD MLOAD PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0xA SWAP1 SWAP3 MSTORE PUSH1 0x40 SWAP1 SWAP2 KECCAK256 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP1 ISZERO ISZERO PUSH2 0x3A3D JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x55FF JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH7 0xFFFFFFFFFFFE0 PUSH1 0x3F DUP9 MLOAD ADD AND DUP1 PUSH1 0x84 ADD DUP3 ADD PUSH32 0xA85E59E400000000000000000000000000000000000000000000000000000000 DUP4 MSTORE PUSH1 0x80 PUSH1 0x4 DUP5 ADD MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP9 AND PUSH1 0x24 DUP5 ADD MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 AND PUSH1 0x44 DUP5 ADD MSTORE DUP6 PUSH1 0x64 DUP5 ADD MSTORE PUSH1 0x84 DUP4 ADD JUMPDEST DUP2 DUP2 LT ISZERO PUSH2 0x3AD9 JUMPI DUP10 MLOAD DUP2 MSTORE PUSH1 0x20 SWAP10 DUP11 ADD SWAP10 ADD PUSH2 0x3AC1 JUMP JUMPDEST PUSH2 0x200 DUP5 DUP6 DUP5 SUB DUP7 PUSH1 0x0 DUP10 GAS CALL DUP1 ISZERO ISZERO PUSH2 0x3AF1 JUMPI RETURNDATASIZE DUP6 REVERT JUMPDEST POP POP POP POP POP JUMPDEST POP POP POP POP POP POP JUMP JUMPDEST DUP1 MLOAD PUSH1 0x0 SWAP1 PUSH1 0xFF AND PUSH1 0x3 EQ PUSH2 0x3B40 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x56AF JUMP JUMPDEST PUSH1 0x60 DUP4 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND ISZERO PUSH2 0x3BB3 JUMPI PUSH1 0x60 DUP4 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0x3BB3 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x56BF JUMP JUMPDEST PUSH2 0x3BBB PUSH2 0x2594 JUMP JUMPDEST DUP4 MLOAD SWAP1 SWAP2 POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP4 AND SWAP2 AND EQ PUSH2 0x3C11 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x557F JUMP JUMPDEST POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x4 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 DUP2 SWAP1 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR SWAP1 SSTORE DUP3 DUP2 ADD MLOAD DUP4 MLOAD PUSH2 0x140 DUP6 ADD MLOAD PUSH2 0x160 DUP7 ADD MLOAD SWAP4 MLOAD DUP6 SWAP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP5 DUP6 AND SWAP5 SWAP4 SWAP1 SWAP4 AND SWAP3 PUSH32 0xDC47B3613D9FE400085F6DBDC99453462279057E6207385042827ED6B1A62CF7 SWAP3 PUSH2 0x3CB1 SWAP3 CALLER SWAP3 SWAP1 PUSH2 0x53C9 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG4 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x14 ADD DUP4 MLOAD LT ISZERO ISZERO ISZERO PUSH2 0x3CFF JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x569F JUMP JUMPDEST POP ADD PUSH1 0x14 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 DUP3 DUP5 DUP2 ISZERO ISZERO PUSH2 0x3D2C JUMPI INVALID JUMPDEST DIV SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0x4F72646572280000000000000000000000000000000000000000000000000000 PUSH1 0x20 DUP1 DUP4 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH32 0x61646472657373206D616B6572416464726573732C0000000000000000000000 PUSH1 0x26 DUP4 ADD MSTORE PUSH32 0x616464726573732074616B6572416464726573732C0000000000000000000000 PUSH1 0x3B DUP4 ADD MSTORE PUSH32 0x6164647265737320666565526563697069656E74416464726573732C00000000 PUSH1 0x50 DUP4 ADD MSTORE PUSH32 0x616464726573732073656E646572416464726573732C00000000000000000000 PUSH1 0x6C DUP4 ADD MSTORE PUSH32 0x75696E74323536206D616B65724173736574416D6F756E742C00000000000000 PUSH1 0x82 DUP4 ADD MSTORE PUSH32 0x75696E743235362074616B65724173736574416D6F756E742C00000000000000 PUSH1 0x9B DUP4 ADD MSTORE PUSH32 0x75696E74323536206D616B65724665652C000000000000000000000000000000 PUSH1 0xB4 DUP4 ADD MSTORE PUSH32 0x75696E743235362074616B65724665652C000000000000000000000000000000 PUSH1 0xC5 DUP4 ADD MSTORE PUSH32 0x75696E743235362065787069726174696F6E54696D655365636F6E64732C0000 PUSH1 0xD6 DUP4 ADD MSTORE PUSH32 0x75696E743235362073616C742C00000000000000000000000000000000000000 PUSH1 0xF4 DUP4 ADD MSTORE PUSH32 0x6279746573206D616B65724173736574446174612C0000000000000000000000 PUSH2 0x101 DUP4 ADD MSTORE PUSH32 0x62797465732074616B6572417373657444617461000000000000000000000000 PUSH2 0x116 DUP4 ADD MSTORE PUSH32 0x2900000000000000000000000000000000000000000000000000000000000000 PUSH2 0x12A DUP4 ADD MSTORE DUP3 MLOAD PUSH2 0x10B DUP2 DUP5 SUB ADD DUP2 MSTORE PUSH2 0x12B SWAP1 SWAP3 ADD SWAP3 DUP4 SWAP1 MSTORE DUP2 MLOAD PUSH1 0x0 SWAP4 DUP5 SWAP4 DUP5 SWAP4 DUP5 SWAP4 SWAP2 SWAP3 SWAP2 DUP3 SWAP2 DUP5 ADD SWAP1 DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT PUSH2 0x3FBD JUMPI DUP1 MLOAD DUP3 MSTORE PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 SWAP1 SWAP3 ADD SWAP2 PUSH1 0x20 SWAP2 DUP3 ADD SWAP2 ADD PUSH2 0x3F80 JUMP JUMPDEST MLOAD DUP2 MLOAD PUSH1 0x20 SWAP4 DUP5 SUB PUSH2 0x100 EXP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD DUP1 NOT SWAP1 SWAP3 AND SWAP2 AND OR SWAP1 MSTORE PUSH1 0x40 MLOAD SWAP2 SWAP1 SWAP4 ADD DUP2 SWAP1 SUB DUP2 KECCAK256 PUSH2 0x140 DUP12 ADD MLOAD DUP1 MLOAD SWAP2 SWAP10 POP SWAP6 POP SWAP1 SWAP4 POP DUP4 SWAP3 DUP6 ADD SWAP2 POP DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT PUSH2 0x4058 JUMPI DUP1 MLOAD DUP3 MSTORE PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 SWAP1 SWAP3 ADD SWAP2 PUSH1 0x20 SWAP2 DUP3 ADD SWAP2 ADD PUSH2 0x401B JUMP JUMPDEST MLOAD DUP2 MLOAD PUSH1 0x20 SWAP4 DUP5 SUB PUSH2 0x100 EXP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD DUP1 NOT SWAP1 SWAP3 AND SWAP2 AND OR SWAP1 MSTORE PUSH1 0x40 MLOAD SWAP2 SWAP1 SWAP4 ADD DUP2 SWAP1 SUB DUP2 KECCAK256 PUSH2 0x160 DUP12 ADD MLOAD DUP1 MLOAD SWAP2 SWAP9 POP SWAP6 POP SWAP1 SWAP4 POP DUP4 SWAP3 DUP6 ADD SWAP2 POP DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT PUSH2 0x40F3 JUMPI DUP1 MLOAD DUP3 MSTORE PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 SWAP1 SWAP3 ADD SWAP2 PUSH1 0x20 SWAP2 DUP3 ADD SWAP2 ADD PUSH2 0x40B6 JUMP JUMPDEST MLOAD DUP2 MLOAD PUSH1 0x20 SWAP4 SWAP1 SWAP4 SUB PUSH2 0x100 EXP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD DUP1 NOT SWAP1 SWAP2 AND SWAP3 AND SWAP2 SWAP1 SWAP2 OR SWAP1 MSTORE PUSH1 0x40 MLOAD SWAP3 ADD DUP3 SWAP1 SUB SWAP1 SWAP2 KECCAK256 PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 DUP10 ADD DUP1 MLOAD PUSH2 0x140 DUP12 ADD DUP1 MLOAD PUSH2 0x160 SWAP1 SWAP13 ADD DUP1 MLOAD SWAP11 DUP5 MSTORE SWAP9 DUP2 MSTORE SWAP3 DUP9 MSTORE PUSH2 0x1A0 DUP3 KECCAK256 SWAP2 MSTORE SWAP9 SWAP1 MSTORE POP POP POP SWAP2 SWAP1 MSTORE POP SWAP1 SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP1 DUP5 GT PUSH2 0x41CA JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x555F JUMP JUMPDEST DUP3 ISZERO DUP1 PUSH2 0x41D5 JUMPI POP DUP5 ISZERO JUMPDEST ISZERO PUSH2 0x41E3 JUMPI PUSH1 0x0 SWAP2 POP PUSH2 0xA88 JUMP JUMPDEST DUP4 DUP1 ISZERO ISZERO PUSH2 0x41ED JUMPI INVALID JUMPDEST DUP6 DUP5 MULMOD SWAP1 POP PUSH2 0x41FC DUP6 DUP5 PUSH2 0x37C0 JUMP JUMPDEST PUSH2 0x4208 PUSH2 0x3E8 DUP4 PUSH2 0x37C0 JUMP JUMPDEST LT ISZERO SWAP6 SWAP5 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP1 DUP5 GT PUSH2 0x424F JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x555F JUMP JUMPDEST DUP3 ISZERO DUP1 PUSH2 0x425A JUMPI POP DUP5 ISZERO JUMPDEST ISZERO PUSH2 0x4268 JUMPI PUSH1 0x0 SWAP2 POP PUSH2 0xA88 JUMP JUMPDEST DUP4 DUP1 ISZERO ISZERO PUSH2 0x4272 JUMPI INVALID JUMPDEST DUP6 DUP5 MULMOD SWAP1 POP DUP4 PUSH2 0x4282 DUP6 DUP4 PUSH2 0x2EE2 JUMP JUMPDEST DUP2 ISZERO ISZERO PUSH2 0x428B JUMPI INVALID JUMPDEST MOD SWAP1 POP PUSH2 0x41FC DUP6 DUP5 PUSH2 0x37C0 JUMP JUMPDEST PUSH1 0x80 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE POP SWAP1 JUMP JUMPDEST PUSH2 0x120 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH2 0x42D6 PUSH2 0x4298 JUMP JUMPDEST DUP2 MSTORE PUSH1 0x20 ADD PUSH2 0x42E3 PUSH2 0x4298 JUMP JUMPDEST DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE POP SWAP1 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x60 DUP2 ADD DUP3 MSTORE PUSH1 0x0 DUP1 DUP3 MSTORE PUSH1 0x20 DUP3 ADD DUP2 SWAP1 MSTORE SWAP2 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x25BF DUP3 CALLDATALOAD PUSH2 0x57C2 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH2 0x432D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0x4340 PUSH2 0x433B DUP3 PUSH2 0x5751 JUMP JUMPDEST PUSH2 0x572A JUMP JUMPDEST DUP2 DUP2 MSTORE PUSH1 0x20 SWAP4 DUP5 ADD SWAP4 SWAP1 SWAP3 POP DUP3 ADD DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x437E JUMPI DUP2 CALLDATALOAD DUP7 ADD PUSH2 0x4368 DUP9 DUP3 PUSH2 0x44CE JUMP JUMPDEST DUP5 MSTORE POP PUSH1 0x20 SWAP3 DUP4 ADD SWAP3 SWAP2 SWAP1 SWAP2 ADD SWAP1 PUSH1 0x1 ADD PUSH2 0x4352 JUMP JUMPDEST POP POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH2 0x4399 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0x43A7 PUSH2 0x433B DUP3 PUSH2 0x5751 JUMP JUMPDEST DUP2 DUP2 MSTORE PUSH1 0x20 SWAP4 DUP5 ADD SWAP4 SWAP1 SWAP3 POP DUP3 ADD DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x437E JUMPI DUP2 CALLDATALOAD DUP7 ADD PUSH2 0x43CF DUP9 DUP3 PUSH2 0x451D JUMP JUMPDEST DUP5 MSTORE POP PUSH1 0x20 SWAP3 DUP4 ADD SWAP3 SWAP2 SWAP1 SWAP2 ADD SWAP1 PUSH1 0x1 ADD PUSH2 0x43B9 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH2 0x43F6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0x4404 PUSH2 0x433B DUP3 PUSH2 0x5751 JUMP JUMPDEST SWAP2 POP DUP2 DUP2 DUP4 MSTORE PUSH1 0x20 DUP5 ADD SWAP4 POP PUSH1 0x20 DUP2 ADD SWAP1 POP DUP4 DUP6 PUSH1 0x20 DUP5 MUL DUP3 ADD GT ISZERO PUSH2 0x4429 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x437E JUMPI DUP2 PUSH2 0x443F DUP9 DUP3 PUSH2 0x4461 JUMP JUMPDEST DUP5 MSTORE POP PUSH1 0x20 SWAP3 DUP4 ADD SWAP3 SWAP2 SWAP1 SWAP2 ADD SWAP1 PUSH1 0x1 ADD PUSH2 0x442C JUMP JUMPDEST PUSH1 0x0 PUSH2 0x25BF DUP3 CALLDATALOAD PUSH2 0x57DB JUMP JUMPDEST PUSH1 0x0 PUSH2 0x25BF DUP3 CALLDATALOAD PUSH2 0x57E0 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x25BF DUP3 CALLDATALOAD PUSH2 0x57E3 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x25BF DUP3 MLOAD PUSH2 0x57E3 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x1F DUP4 ADD DUP5 SGT PUSH2 0x4497 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP DUP2 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x44AF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x20 DUP4 ADD SWAP2 POP DUP4 PUSH1 0x1 DUP3 MUL DUP4 ADD GT ISZERO PUSH2 0x44C7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH2 0x44DF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0x44ED PUSH2 0x433B DUP3 PUSH2 0x5772 JUMP JUMPDEST SWAP2 POP DUP1 DUP3 MSTORE PUSH1 0x20 DUP4 ADD PUSH1 0x20 DUP4 ADD DUP6 DUP4 DUP4 ADD GT ISZERO PUSH2 0x4509 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4514 DUP4 DUP3 DUP5 PUSH2 0x5819 JUMP JUMPDEST POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x180 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x4530 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x453B PUSH2 0x180 PUSH2 0x572A JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0x4549 DUP5 DUP5 PUSH2 0x4310 JUMP JUMPDEST DUP3 MSTORE POP PUSH1 0x20 PUSH2 0x455A DUP5 DUP5 DUP4 ADD PUSH2 0x4310 JUMP JUMPDEST PUSH1 0x20 DUP4 ADD MSTORE POP PUSH1 0x40 PUSH2 0x456E DUP5 DUP3 DUP6 ADD PUSH2 0x4310 JUMP JUMPDEST PUSH1 0x40 DUP4 ADD MSTORE POP PUSH1 0x60 PUSH2 0x4582 DUP5 DUP3 DUP6 ADD PUSH2 0x4310 JUMP JUMPDEST PUSH1 0x60 DUP4 ADD MSTORE POP PUSH1 0x80 PUSH2 0x4596 DUP5 DUP3 DUP6 ADD PUSH2 0x4461 JUMP JUMPDEST PUSH1 0x80 DUP4 ADD MSTORE POP PUSH1 0xA0 PUSH2 0x45AA DUP5 DUP3 DUP6 ADD PUSH2 0x4461 JUMP JUMPDEST PUSH1 0xA0 DUP4 ADD MSTORE POP PUSH1 0xC0 PUSH2 0x45BE DUP5 DUP3 DUP6 ADD PUSH2 0x4461 JUMP JUMPDEST PUSH1 0xC0 DUP4 ADD MSTORE POP PUSH1 0xE0 PUSH2 0x45D2 DUP5 DUP3 DUP6 ADD PUSH2 0x4461 JUMP JUMPDEST PUSH1 0xE0 DUP4 ADD MSTORE POP PUSH2 0x100 PUSH2 0x45E7 DUP5 DUP3 DUP6 ADD PUSH2 0x4461 JUMP JUMPDEST PUSH2 0x100 DUP4 ADD MSTORE POP PUSH2 0x120 PUSH2 0x45FD DUP5 DUP3 DUP6 ADD PUSH2 0x4461 JUMP JUMPDEST PUSH2 0x120 DUP4 ADD MSTORE POP PUSH2 0x140 DUP3 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x461F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x462B DUP5 DUP3 DUP6 ADD PUSH2 0x44CE JUMP JUMPDEST PUSH2 0x140 DUP4 ADD MSTORE POP PUSH2 0x160 DUP3 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x464D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4659 DUP5 DUP3 DUP6 ADD PUSH2 0x44CE JUMP JUMPDEST PUSH2 0x160 DUP4 ADD MSTORE POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x4678 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x33B0 DUP5 DUP5 PUSH2 0x4310 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x4697 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x46A3 DUP6 DUP6 PUSH2 0x4310 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0x46B4 DUP6 DUP3 DUP7 ADD PUSH2 0x4310 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x46D1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x46DD DUP6 DUP6 PUSH2 0x4310 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0x46B4 DUP6 DUP3 DUP7 ADD PUSH2 0x4455 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x4700 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x4717 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x33B0 DUP5 DUP3 DUP6 ADD PUSH2 0x4388 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x60 DUP5 DUP7 SUB SLT ISZERO PUSH2 0x4738 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP4 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x474F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x475B DUP7 DUP3 DUP8 ADD PUSH2 0x4388 JUMP JUMPDEST SWAP4 POP POP PUSH1 0x20 DUP5 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x4778 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4784 DUP7 DUP3 DUP8 ADD PUSH2 0x43E5 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x40 DUP5 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x47A1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x47AD DUP7 DUP3 DUP8 ADD PUSH2 0x431C JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 POP SWAP3 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x60 DUP5 DUP7 SUB SLT ISZERO PUSH2 0x47CC JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP4 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x47E3 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x47EF DUP7 DUP3 DUP8 ADD PUSH2 0x4388 JUMP JUMPDEST SWAP4 POP POP PUSH1 0x20 PUSH2 0x4784 DUP7 DUP3 DUP8 ADD PUSH2 0x4461 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x4812 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x33B0 DUP5 DUP5 PUSH2 0x4461 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x4831 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x46A3 DUP6 DUP6 PUSH2 0x4461 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x60 DUP6 DUP8 SUB SLT ISZERO PUSH2 0x4853 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x485F DUP8 DUP8 PUSH2 0x4461 JUMP JUMPDEST SWAP5 POP POP PUSH1 0x20 PUSH2 0x4870 DUP8 DUP3 DUP9 ADD PUSH2 0x4310 JUMP JUMPDEST SWAP4 POP POP PUSH1 0x40 DUP6 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x488D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4899 DUP8 DUP3 DUP9 ADD PUSH2 0x4485 JUMP JUMPDEST SWAP6 SWAP9 SWAP5 SWAP8 POP SWAP6 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x60 DUP5 DUP7 SUB SLT ISZERO PUSH2 0x48BA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x48C6 DUP7 DUP7 PUSH2 0x4461 JUMP JUMPDEST SWAP4 POP POP PUSH1 0x20 PUSH2 0x48D7 DUP7 DUP3 DUP8 ADD PUSH2 0x4310 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x40 DUP5 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x48F4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x47AD DUP7 DUP3 DUP8 ADD PUSH2 0x44CE JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x4912 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x33B0 DUP5 DUP5 PUSH2 0x446D JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x4930 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x33B0 DUP5 DUP5 PUSH2 0x4479 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x494E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x4965 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x33B0 DUP5 DUP3 DUP6 ADD PUSH2 0x451D JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x80 DUP6 DUP8 SUB SLT ISZERO PUSH2 0x4987 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP5 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x499E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x49AA DUP8 DUP3 DUP9 ADD PUSH2 0x451D JUMP JUMPDEST SWAP5 POP POP PUSH1 0x20 DUP6 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x49C7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x49D3 DUP8 DUP3 DUP9 ADD PUSH2 0x451D JUMP JUMPDEST SWAP4 POP POP PUSH1 0x40 DUP6 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x49F0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x49FC DUP8 DUP3 DUP9 ADD PUSH2 0x44CE JUMP JUMPDEST SWAP3 POP POP PUSH1 0x60 DUP6 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x4A19 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4A25 DUP8 DUP3 DUP9 ADD PUSH2 0x44CE JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP6 SWAP2 SWAP5 POP SWAP3 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x60 DUP5 DUP7 SUB SLT ISZERO PUSH2 0x4A46 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP4 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x4A5D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4A69 DUP7 DUP3 DUP8 ADD PUSH2 0x451D JUMP JUMPDEST SWAP4 POP POP PUSH1 0x20 PUSH2 0x48D7 DUP7 DUP3 DUP8 ADD PUSH2 0x4461 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x80 DUP8 DUP10 SUB SLT ISZERO PUSH2 0x4A93 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x4A9F DUP10 DUP10 PUSH2 0x4461 JUMP JUMPDEST SWAP7 POP POP PUSH1 0x20 PUSH2 0x4AB0 DUP10 DUP3 DUP11 ADD PUSH2 0x4310 JUMP JUMPDEST SWAP6 POP POP PUSH1 0x40 DUP8 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x4ACD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4AD9 DUP10 DUP3 DUP11 ADD PUSH2 0x4485 JUMP JUMPDEST SWAP5 POP SWAP5 POP POP PUSH1 0x60 DUP8 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x4AF8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4B04 DUP10 DUP3 DUP11 ADD PUSH2 0x4485 JUMP JUMPDEST SWAP3 POP SWAP3 POP POP SWAP3 SWAP6 POP SWAP3 SWAP6 POP SWAP3 SWAP6 JUMP JUMPDEST PUSH2 0x4B1C DUP2 PUSH2 0x57C2 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x4B2D DUP3 PUSH2 0x57BE JUMP JUMPDEST DUP1 DUP5 MSTORE PUSH1 0x20 DUP5 ADD SWAP4 POP PUSH2 0x4B3F DUP4 PUSH2 0x57B8 JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP3 DUP2 LT ISZERO PUSH2 0x4B6F JUMPI PUSH2 0x4B55 DUP7 DUP4 MLOAD PUSH2 0x52F7 JUMP JUMPDEST PUSH2 0x4B5E DUP3 PUSH2 0x57B8 JUMP JUMPDEST PUSH1 0x60 SWAP7 SWAP1 SWAP7 ADD SWAP6 SWAP2 POP PUSH1 0x1 ADD PUSH2 0x4B42 JUMP JUMPDEST POP SWAP4 SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH2 0x4B1C DUP2 PUSH2 0x57DB JUMP JUMPDEST PUSH2 0x4B1C DUP2 PUSH2 0x57E0 JUMP JUMPDEST PUSH2 0x4B1C DUP2 PUSH2 0x57E3 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x4B9F DUP3 PUSH2 0x57BE JUMP JUMPDEST DUP1 DUP5 MSTORE PUSH2 0x4BB3 DUP2 PUSH1 0x20 DUP7 ADD PUSH1 0x20 DUP7 ADD PUSH2 0x5825 JUMP JUMPDEST PUSH2 0x4BBC DUP2 PUSH2 0x5851 JUMP JUMPDEST SWAP1 SWAP4 ADD PUSH1 0x20 ADD SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH2 0x4B1C DUP2 PUSH2 0x580E JUMP JUMPDEST PUSH1 0x12 DUP2 MSTORE PUSH32 0x4C454E4754485F36355F52455155495245440000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0xD DUP2 MSTORE PUSH32 0x494E56414C49445F54414B455200000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0xE DUP2 MSTORE PUSH32 0x4F524445525F4F56455246494C4C000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x11 DUP2 MSTORE PUSH32 0x55494E543235365F554E444552464C4F57000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x1A DUP2 MSTORE PUSH32 0x41535345545F50524F58595F414C52454144595F455849535453000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x26 DUP2 MSTORE PUSH32 0x475245415445525F4F525F455155414C5F544F5F33325F4C454E4754485F5245 PUSH1 0x20 DUP3 ADD MSTORE PUSH32 0x5155495245440000000000000000000000000000000000000000000000000000 PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x60 ADD SWAP1 JUMP JUMPDEST PUSH1 0x15 DUP2 MSTORE PUSH32 0x5349474E41545552455F554E535550504F525445440000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x10 DUP2 MSTORE PUSH32 0x4449564953494F4E5F42595F5A45524F00000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x17 DUP2 MSTORE PUSH32 0x494E56414C49445F4F524445525F5349474E4154555245000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0xD DUP2 MSTORE PUSH32 0x494E56414C49445F4D414B455200000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x10 DUP2 MSTORE PUSH32 0x55494E543235365F4F564552464C4F5700000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0xF DUP2 MSTORE PUSH32 0x494E56414C49445F54585F484153480000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x11 DUP2 MSTORE PUSH32 0x494E56414C49445F5349474E4154555245000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0xE DUP2 MSTORE PUSH32 0x524F554E44494E475F4552524F52000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x10 DUP2 MSTORE PUSH32 0x4641494C45445F455845435554494F4E00000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0xD DUP2 MSTORE PUSH32 0x54414B45525F4F56455250415900000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x14 DUP2 MSTORE PUSH32 0x494E56414C49445F54414B45525F414D4F554E54000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x1A DUP2 MSTORE PUSH32 0x41535345545F50524F58595F444F45535F4E4F545F4558495354000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x21 DUP2 MSTORE PUSH32 0x475245415445525F5448414E5F5A45524F5F4C454E4754485F52455155495245 PUSH1 0x20 DUP3 ADD MSTORE PUSH32 0x4400000000000000000000000000000000000000000000000000000000000000 PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x60 ADD SWAP1 JUMP JUMPDEST PUSH1 0x11 DUP2 MSTORE PUSH32 0x5349474E41545552455F494C4C4547414C000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x1E DUP2 MSTORE PUSH32 0x4C454E4754485F475245415445525F5448414E5F305F52455155495245440000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x17 DUP2 MSTORE PUSH32 0x494E56414C49445F4E45575F4F524445525F45504F4348000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x1E DUP2 MSTORE PUSH32 0x4C454E4754485F475245415445525F5448414E5F335F52455155495245440000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x14 DUP2 MSTORE PUSH32 0x434F4D504C4554455F46494C4C5F4641494C4544000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x12 DUP2 MSTORE PUSH32 0x494E56414C49445F46494C4C5F50524943450000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x12 DUP2 MSTORE PUSH32 0x5245454E5452414E43595F494C4C4547414C0000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x13 DUP2 MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x26 DUP2 MSTORE PUSH32 0x475245415445525F4F525F455155414C5F544F5F32305F4C454E4754485F5245 PUSH1 0x20 DUP3 ADD MSTORE PUSH32 0x5155495245440000000000000000000000000000000000000000000000000000 PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x60 ADD SWAP1 JUMP JUMPDEST PUSH1 0x10 DUP2 MSTORE PUSH32 0x4F524445525F554E46494C4C41424C4500000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0xE DUP2 MSTORE PUSH32 0x494E56414C49445F53454E444552000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x18 DUP2 MSTORE PUSH32 0x4E454741544956455F5350524541445F52455155495245440000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x14 DUP2 MSTORE PUSH32 0x494E56414C49445F54585F5349474E4154555245000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x11 DUP2 MSTORE PUSH32 0x4C454E4754485F305F5245515549524544000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST DUP1 MLOAD PUSH1 0x80 DUP4 ADD SWAP1 PUSH2 0x5285 DUP5 DUP3 PUSH2 0x4B82 JUMP JUMPDEST POP PUSH1 0x20 DUP3 ADD MLOAD PUSH2 0x5298 PUSH1 0x20 DUP6 ADD DUP3 PUSH2 0x4B82 JUMP JUMPDEST POP PUSH1 0x40 DUP3 ADD MLOAD PUSH2 0x52AB PUSH1 0x40 DUP6 ADD DUP3 PUSH2 0x4B82 JUMP JUMPDEST POP PUSH1 0x60 DUP3 ADD MLOAD PUSH2 0x2758 PUSH1 0x60 DUP6 ADD DUP3 PUSH2 0x4B82 JUMP JUMPDEST DUP1 MLOAD PUSH2 0x120 DUP4 ADD SWAP1 PUSH2 0x52D0 DUP5 DUP3 PUSH2 0x5274 JUMP JUMPDEST POP PUSH1 0x20 DUP3 ADD MLOAD PUSH2 0x52E3 PUSH1 0x80 DUP6 ADD DUP3 PUSH2 0x5274 JUMP JUMPDEST POP PUSH1 0x40 DUP3 ADD MLOAD PUSH2 0x2758 PUSH2 0x100 DUP6 ADD DUP3 PUSH2 0x4B82 JUMP JUMPDEST DUP1 MLOAD PUSH1 0x60 DUP4 ADD SWAP1 PUSH2 0x5308 DUP5 DUP3 PUSH2 0x532E JUMP JUMPDEST POP PUSH1 0x20 DUP3 ADD MLOAD PUSH2 0x531B PUSH1 0x20 DUP6 ADD DUP3 PUSH2 0x4B82 JUMP JUMPDEST POP PUSH1 0x40 DUP3 ADD MLOAD PUSH2 0x2758 PUSH1 0x40 DUP6 ADD DUP3 PUSH2 0x4B82 JUMP JUMPDEST PUSH2 0x4B1C DUP2 PUSH2 0x5808 JUMP JUMPDEST PUSH1 0x20 DUP2 ADD PUSH2 0x2F23 DUP3 DUP5 PUSH2 0x4B13 JUMP JUMPDEST PUSH2 0x100 DUP2 ADD PUSH2 0x5354 DUP3 DUP12 PUSH2 0x4B13 JUMP JUMPDEST PUSH2 0x5361 PUSH1 0x20 DUP4 ADD DUP11 PUSH2 0x4B13 JUMP JUMPDEST PUSH2 0x536E PUSH1 0x40 DUP4 ADD DUP10 PUSH2 0x4B82 JUMP JUMPDEST PUSH2 0x537B PUSH1 0x60 DUP4 ADD DUP9 PUSH2 0x4B82 JUMP JUMPDEST PUSH2 0x5388 PUSH1 0x80 DUP4 ADD DUP8 PUSH2 0x4B82 JUMP JUMPDEST PUSH2 0x5395 PUSH1 0xA0 DUP4 ADD DUP7 PUSH2 0x4B82 JUMP JUMPDEST DUP2 DUP2 SUB PUSH1 0xC0 DUP4 ADD MSTORE PUSH2 0x53A7 DUP2 DUP6 PUSH2 0x4B94 JUMP JUMPDEST SWAP1 POP DUP2 DUP2 SUB PUSH1 0xE0 DUP4 ADD MSTORE PUSH2 0x53BB DUP2 DUP5 PUSH2 0x4B94 JUMP JUMPDEST SWAP11 SWAP10 POP POP POP POP POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x60 DUP2 ADD PUSH2 0x53D7 DUP3 DUP7 PUSH2 0x4B13 JUMP JUMPDEST DUP2 DUP2 SUB PUSH1 0x20 DUP4 ADD MSTORE PUSH2 0x53E9 DUP2 DUP6 PUSH2 0x4B94 JUMP JUMPDEST SWAP1 POP DUP2 DUP2 SUB PUSH1 0x40 DUP4 ADD MSTORE PUSH2 0x53FD DUP2 DUP5 PUSH2 0x4B94 JUMP JUMPDEST SWAP6 SWAP5 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x25BF DUP2 DUP5 PUSH2 0x4B22 JUMP JUMPDEST PUSH1 0x20 DUP2 ADD PUSH2 0x2F23 DUP3 DUP5 PUSH2 0x4B79 JUMP JUMPDEST PUSH1 0x20 DUP2 ADD PUSH2 0x2F23 DUP3 DUP5 PUSH2 0x4B82 JUMP JUMPDEST PUSH1 0x60 DUP2 ADD PUSH2 0x5441 DUP3 DUP7 PUSH2 0x4B82 JUMP JUMPDEST PUSH2 0x544E PUSH1 0x20 DUP4 ADD DUP6 PUSH2 0x4B13 JUMP JUMPDEST DUP2 DUP2 SUB PUSH1 0x40 DUP4 ADD MSTORE PUSH2 0x53FD DUP2 DUP5 PUSH2 0x4B94 JUMP JUMPDEST PUSH1 0x40 DUP2 ADD PUSH2 0x546E DUP3 DUP6 PUSH2 0x4B82 JUMP JUMPDEST DUP2 DUP2 SUB PUSH1 0x20 DUP4 ADD MSTORE PUSH2 0x33B0 DUP2 DUP5 PUSH2 0x4B94 JUMP JUMPDEST PUSH1 0x80 DUP2 ADD PUSH2 0x548E DUP3 DUP8 PUSH2 0x4B82 JUMP JUMPDEST PUSH2 0x549B PUSH1 0x20 DUP4 ADD DUP7 PUSH2 0x532E JUMP JUMPDEST PUSH2 0x54A8 PUSH1 0x40 DUP4 ADD DUP6 PUSH2 0x4B82 JUMP JUMPDEST PUSH2 0x53FD PUSH1 0x60 DUP4 ADD DUP5 PUSH2 0x4B82 JUMP JUMPDEST PUSH1 0x40 DUP2 ADD PUSH2 0x54C3 DUP3 DUP6 PUSH2 0x4B8B JUMP JUMPDEST PUSH2 0x25BF PUSH1 0x20 DUP4 ADD DUP5 PUSH2 0x4B13 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x25BF DUP2 DUP5 PUSH2 0x4B94 JUMP JUMPDEST PUSH1 0x20 DUP2 ADD PUSH2 0x2F23 DUP3 DUP5 PUSH2 0x4BC9 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x4BD2 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x4C02 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x4C32 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x4C62 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x4C92 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x4CC2 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x4D18 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x4D48 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x4D78 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x4DA8 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x4DD8 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x4E08 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x4E38 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x4E68 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x4E98 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x4EC8 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x4EF8 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x4F28 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x4F58 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x4FAE JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x4FDE JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x500E JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x503E JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x506E JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x509E JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x50CE JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x50FE JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x512E JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x5184 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x51B4 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x51E4 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x5214 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x5244 JUMP JUMPDEST PUSH1 0x80 DUP2 ADD PUSH2 0x2F23 DUP3 DUP5 PUSH2 0x5274 JUMP JUMPDEST PUSH2 0x120 DUP2 ADD PUSH2 0x2F23 DUP3 DUP5 PUSH2 0x52BE JUMP JUMPDEST PUSH1 0x60 DUP2 ADD PUSH2 0x2F23 DUP3 DUP5 PUSH2 0x52F7 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP2 DUP2 ADD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT DUP3 DUP3 LT OR ISZERO PUSH2 0x5749 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x40 MSTORE SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH8 0xFFFFFFFFFFFFFFFF DUP3 GT ISZERO PUSH2 0x5768 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x20 SWAP1 DUP2 MUL ADD SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH8 0xFFFFFFFFFFFFFFFF DUP3 GT ISZERO PUSH2 0x5789 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x20 PUSH1 0x1F SWAP2 SWAP1 SWAP2 ADD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 AND ADD SWAP1 JUMP JUMPDEST PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST MLOAD SWAP1 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 JUMP JUMPDEST ISZERO ISZERO SWAP1 JUMP JUMPDEST SWAP1 JUMP JUMPDEST PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 AND SWAP1 JUMP JUMPDEST PUSH1 0xFF AND SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x2F23 DUP3 PUSH2 0x57C2 JUMP JUMPDEST DUP3 DUP2 DUP4 CALLDATACOPY POP PUSH1 0x0 SWAP2 ADD MSTORE JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x5840 JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH2 0x5828 JUMP JUMPDEST DUP4 DUP2 GT ISZERO PUSH2 0x2758 JUMPI POP POP PUSH1 0x0 SWAP2 ADD MSTORE JUMP JUMPDEST PUSH1 0x1F ADD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 AND SWAP1 JUMP STOP LOG2 PUSH6 0x627A7A723058 KECCAK256 0xb1 SWAP13 SWAP3 KECCAK256 LT ORIGIN PUSH1 0x33 SWAP9 0xc0 SMOD 0xdc 0xcf DUP1 SWAP4 0xc PUSH3 0x6EF89F 0xa6 0xc8 0x48 0xc8 0xb7 0xef MSTORE PUSH8 0xD07CD4ED6C657870 PUSH6 0x72696D656E74 PUSH2 0x6CF5 STOP CALLDATACOPY ",
- "sourceMap": "897:514:21:-;;;689:5:56;667:27;;-1:-1:-1;;667:27:56;;;1188:221:21;5:2:-1;;;;30:1;27;20:12;5:2;-1:-1;1045:148:39;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;22:32:-1;26:21;;;22:32;6:49;;1045:148:39;;;;;;;;1035:159;;1045:148;;;;;1035:159;;;;1045:148;1035:159;36:153:-1;66:2;58:11;;36:153;;176:10;;164:23;;-1:-1;;139:12;;;;98:2;89:12;;;;114;36:153;;;299:10;344;;263:2;259:12;;;254:3;250:22;-1:-1;;246:30;311:9;;295:26;;;340:21;;377:20;365:33;;1035:159:39;;;;;;;;;;;;1511:18;;;;;;;;;;;;;;;;1495:36;;1035:159;;-1:-1:-1;1035:159:39;;-1:-1:-1;1495:36:39;;;;-1:-1:-1;1511:18:39;1495:36;1511:18;36:153:-1;66:2;58:11;;36:153;;176:10;;164:23;;-1:-1;;139:12;;;;98:2;89:12;;;;114;36:153;;;299:10;344;;263:2;259:12;;;254:3;250:22;-1:-1;;246:30;311:9;;295:26;;;340:21;;377:20;365:33;;1495:36:39;;;;;;;;;;;;1561:21;;;;;274:1:-1;1561:21:39;;;;;;;;;;1545:39;;1495:36;;-1:-1:-1;1495:36:39;;-1:-1:-1;1545:39:39;;;;-1:-1:-1;274:1;1545:39:39;1561:21;36:153:-1;66:2;58:11;;36:153;;176:10;;164:23;;-1:-1;;139:12;;;;98:2;89:12;;;;114;36:153;;;299:10;344;;263:2;259:12;;;254:3;250:22;-1:-1;;246:30;311:9;;295:26;;;340:21;;377:20;365:33;;1545:39:39;;;;;;;;;;;;1416:214;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1614:4:39;1416:214;;;;;;;;;;26:21:-1;;;22:32;;;6:49;;1416:214:39;;;;;;;;1406:225;;1416:214;;;;-1:-1:-1;1406:225:39;;;-1:-1:-1;1406:225:39;1416:214;1406:225;36:153:-1;66:2;58:11;;36:153;;176:10;;164:23;;-1:-1;;139:12;;;;98:2;89:12;;;;114;36:153;;;299:10;344;;-1:-1;;263:2;259:12;;;;254:3;250:22;246:30;;;;340:21;;;311:9;;295:26;377:20;;;;365:33;;1406:225:39;;;;;;;;;;274:1:-1;1385:246:39;-1:-1:-1;;162:5:55;:18;;-1:-1:-1;;;;;;162:18:55;170:10;162:18;;;-1:-1:-1;897:514:21;;;;;;"
- },
- "deployedBytecode": {
- "linkReferences": {},
- "object": "0x6080604052600436106101b65763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663288cdc9181146101bb578063297bb70b146101f15780632ac126221461021e5780633683ef8e1461024b5780633c28d8611461026d5780633e228bae1461029a5780633fd3c997146102ba5780634ac14782146102e75780634d0ae546146103075780634f9559b11461032757806350dde190146103475780636070410814610367578063642f2eaf1461039457806364a3bc15146103b457806377fcce68146103d45780637b8e3514146103f45780637e1d9808146104145780637e9d74dc1461043457806382c174d0146104615780638da5cb5b146104815780639363470214610496578063a3e20380146104b6578063b4be83d5146104d6578063bfc8bfce146104f6578063c585bb9314610516578063c75e0a8114610536578063d46b02c314610563578063d9bfa73e14610583578063db123b1a146105a3578063dd1c7d18146105c5578063e306f779146105e5578063e5fa431b146105fa578063eea086ba1461061a578063f2fde38b1461062f578063ffa1ad741461064f575b600080fd5b3480156101c757600080fd5b506101db6101d6366004614800565b610664565b6040516101e89190615425565b60405180910390f35b3480156101fd57600080fd5b5061021161020c366004614723565b610676565b6040516101e891906156ff565b34801561022a57600080fd5b5061023e610239366004614800565b6107a1565b6040516101e89190615417565b34801561025757600080fd5b5061026b61026636600461483d565b6107b6565b005b34801561027957600080fd5b5061028d610288366004614971565b6108a3565b6040516101e8919061570d565b3480156102a657600080fd5b506102116102b5366004614a31565b610a3a565b3480156102c657600080fd5b506102da6102d5366004614900565b610a90565b6040516101e891906154e1565b3480156102f357600080fd5b5061026b6103023660046146ee565b610ab8565b34801561031357600080fd5b50610211610322366004614723565b610b85565b34801561033357600080fd5b5061026b610342366004614800565b610c75565b34801561035357600080fd5b50610211610362366004614723565b610e2a565b34801561037357600080fd5b50610387610382366004614900565b610ebe565b6040516101e89190615337565b3480156103a057600080fd5b5061023e6103af366004614800565b610f0c565b3480156103c057600080fd5b506102116103cf366004614a31565b610f21565b3480156103e057600080fd5b5061026b6103ef3660046146be565b610fcc565b34801561040057600080fd5b5061023e61040f366004614684565b611106565b34801561042057600080fd5b5061021161042f3660046147b7565b611126565b34801561044057600080fd5b5061045461044f3660046146ee565b61128a565b6040516101e89190615406565b34801561046d57600080fd5b5061023e61047c36600461481e565b61131f565b34801561048d57600080fd5b5061038761133f565b3480156104a257600080fd5b5061023e6104b13660046148a5565b61135b565b3480156104c257600080fd5b506102116104d13660046147b7565b6118de565b3480156104e257600080fd5b506102116104f1366004614a31565b6119f1565b34801561050257600080fd5b5061026b610511366004614a7a565b611a6c565b34801561052257600080fd5b5061026b610531366004614666565b611d05565b34801561054257600080fd5b5061055661055136600461493c565b611f30565b6040516101e8919061571c565b34801561056f57600080fd5b5061026b61057e36600461493c565b61202a565b34801561058f57600080fd5b506101db61059e366004614684565b6120c6565b3480156105af57600080fd5b506105b86120e3565b6040516101e891906154d0565b3480156105d157600080fd5b506102116105e03660046147b7565b612143565b3480156105f157600080fd5b506101db612218565b34801561060657600080fd5b506102116106153660046147b7565b61221e565b34801561062657600080fd5b50610387612390565b34801561063b57600080fd5b5061026b61064a366004614666565b6123ac565b34801561065b57600080fd5b506105b861245d565b60036020526000908152604090205481565b61067e614298565b600080610689614298565b60005460ff16156106cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061567f565b60405180910390fd5b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011781558751935091505b81831461076f57610758878381518110151561071957fe5b90602001906020020151878481518110151561073157fe5b90602001906020020151878581518110151561074957fe5b90602001906020020151612494565b90506107648482612532565b600190910190610701565b5050600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055509392505050565b60046020526000908152604090205460ff1681565b73ffffffffffffffffffffffffffffffffffffffff831633146108465761080e848484848080601f0160208091040260200160405190810160405280939291908181526020018383808284375061135b945050505050565b1515610846576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906155af565b5050600091825260066020908152604080842073ffffffffffffffffffffffffffffffffffffffff9093168452919052902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b6108ab6142c1565b6108b36142f0565b6108bb6142f0565b6000805460ff16156108f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061567f565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905561016080890151610140808a01919091528901519088015261094588611f30565b925061095087611f30565b915061095a612594565b9050610968888483896125c6565b610974878383886125c6565b61097e888861275e565b6109928888856040015185604001516127be565b8051602081015190519195506109ad918a9186918190612945565b6020808501519081015190516109c99189918591908190612945565b6109e28882856020015186604001518860000151612a5e565b6109fb8782846020015185604001518860200151612a5e565b610a0788888387612b0a565b5050600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905550949350505050565b610a42614298565b6060610a4f858585612c92565b9050608081825160208401305af48015610a8657815183526020820151602084015260408201516040840152606082015160608401525b505b509392505050565b600a6020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b60008054819060ff1615610af8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061567f565b5050600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011781558151905b808214610b5857610b508382815181101515610b4157fe5b90602001906020020151612e64565b600101610b29565b5050600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905550565b610b8d614298565b600080610b98614298565b60005460ff1615610bd5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061567f565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011781558751935091505b81831461076f57610c5e8783815181101515610c1f57fe5b906020019060200201518784815181101515610c3757fe5b906020019060200201518785815181101515610c4f57fe5b90602001906020020151612e8f565b9050610c6a8482612532565b600190910190610c07565b6000805481908190819060ff1615610cb9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061567f565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055610cec612594565b935073ffffffffffffffffffffffffffffffffffffffff84163314610d115733610d14565b60005b73ffffffffffffffffffffffffffffffffffffffff8086166000908152600560209081526040808320938516835292905220549093506001860192509050808211610d8b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061563f565b73ffffffffffffffffffffffffffffffffffffffff80851660008181526005602090815260408083209488168084529490915290819020859055517f82af639571738f4ebd4268fb0363d8957ebe1bbb9e78dba5ebd69eed39b154f090610df3908690615425565b60405180910390a35050600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055505050565b610e32614298565b600080610e3d614298565b86519250600091505b818314610eb457610e9d8783815181101515610e5e57fe5b906020019060200201518784815181101515610e7657fe5b906020019060200201518785815181101515610e8e57fe5b90602001906020020151610a3a565b9050610ea98482612532565b600190910190610e46565b5050509392505050565b7fffffffff0000000000000000000000000000000000000000000000000000000081166000908152600a602052604090205473ffffffffffffffffffffffffffffffffffffffff165b919050565b60086020526000908152604090205460ff1681565b610f29614298565b60005460ff1615610f66576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061567f565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055610f9c848484612e8f565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055949350505050565b6000805460ff161561100a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061567f565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905561103d612594565b73ffffffffffffffffffffffffffffffffffffffff8181166000818152600760209081526040808320948916808452949091529081902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168715151790555192935090917fa8656e308026eeabce8f0bc18048433252318ab80ac79da0b3d3d8697dfba891906110d1908690615417565b60405180910390a35050600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905550565b600760209081526000928352604080842090915290825290205460ff1681565b61112e614298565b6060600080600061113d614298565b60005460ff161561117a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061567f565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117815589518a919081106111b257fe5b906020019060200201516101600151945088519350600092505b828414611255578489848151811015156111e257fe5b906020019060200201516101600181905250611202888760200151612ee2565b915061122e898481518110151561121557fe5b9060200190602002015183898681518110151561074957fe5b905061123a8682612532565b6020860151881161124a57611255565b6001909201916111cc565b5050600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055509195945050505050565b606060006060600084519250826040519080825280602002602001820160405280156112d057816020015b6112bd6142f0565b8152602001906001900390816112b55790505b509150600090505b808314610a88576112ff85828151811015156112f057fe5b90602001906020020151611f30565b828281518110151561130d57fe5b602090810290910101526001016112d8565b600660209081526000928352604080842090915290825290205460ff1681565b60025473ffffffffffffffffffffffffffffffffffffffff1681565b600080600080600080600080600089511115156113a4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061562f565b6113ad89612f29565b7f010000000000000000000000000000000000000000000000000000000000000090049650600760ff88161061140f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061554f565b8660ff16600781111561141e57fe5b9550600086600781111561142e57fe5b1415611466576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061561f565b600186600781111561147457fe5b14156114bc578851156114b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906156ef565b600097506118d0565b60028660078111156114ca57fe5b141561160557885160411461150b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906154ef565b88600081518110151561151a57fe5b01602001517f010000000000000000000000000000000000000000000000000000000000000090819004810204945061155a89600163ffffffff612fed16565b935061156d89602163ffffffff612fed16565b925060018b868686604051600081526020016040526040516115929493929190615480565b60206040516020810390808403906000865af11580156115b6573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015173ffffffffffffffffffffffffffffffffffffffff8c811690821614995092506118d09050565b600386600781111561161357fe5b14156117b9578851604114611654576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906154ef565b88600081518110151561166357fe5b01602001517f01000000000000000000000000000000000000000000000000000000000000009081900481020494506116a389600163ffffffff612fed16565b93506116b689602163ffffffff612fed16565b925060018b60405160200180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c0182600019166000191681526020019150506040516020818303038152906040526040518082805190602001908083835b6020831061175757805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161171a565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018019909216911617905260408051929094018290038220600083529101928390526115929450925089918991508890615480565b60048660078111156117c757fe5b14156117df576117d88b8b8b613038565b97506118d0565b60058660078111156117ed57fe5b1415611850576117fc8961318d565b73ffffffffffffffffffffffffffffffffffffffff808c1660009081526007602090815260408083209385168352929052205490915060ff16151561184457600097506118d0565b6117d8818c8c8c613206565b600686600781111561185e57fe5b141561189e5760008b815260066020908152604080832073ffffffffffffffffffffffffffffffffffffffff8e16845290915290205460ff1697506118d0565b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061554f565b505050505050509392505050565b6118e6614298565b60606000806000806118f6614298565b89600081518110151561190557fe5b906020019060200201516101400151955089519450600093505b8385146119e457858a8581518110151561193557fe5b6020908102909101015161014001528651611951908a90612ee2565b92506119948a8581518110151561196457fe5b9060200190602002015160a001518b8681518110151561198057fe5b906020019060200201516080015185613362565b91506119c08a858151811015156119a757fe5b90602001906020020151838a87815181101515610e8e57fe5b90506119cc8782612532565b865189116119d9576119e4565b60019093019261191f565b5050505050509392505050565b6119f9614298565b60005460ff1615611a36576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061567f565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055610f9c848484612494565b60095460009073ffffffffffffffffffffffffffffffffffffffff1615611abf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061567f565b611b02611afd888888888080601f016020809104026020016040519081016040528093929190818152602001838380828437506133b8945050505050565b6135f9565b60008181526008602052604090205490915060ff1615611b4e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061559f565b73ffffffffffffffffffffffffffffffffffffffff86163314611c1f57611ba6818785858080601f0160208091040260200160405190810160405280939291908181526020018383808284375061135b945050505050565b1515611bde576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906156df565b600980547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff88161790555b6000818152600860205260409081902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555130908690869080838380828437820191505092505050600060405180830381855af49150501515611cb6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906155cf565b73ffffffffffffffffffffffffffffffffffffffff86163314611cfc57600980547fffffffffffffffffffffffff00000000000000000000000000000000000000001690555b50505050505050565b6002546000908190819073ffffffffffffffffffffffffffffffffffffffff163314611d5d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061568f565b8392508273ffffffffffffffffffffffffffffffffffffffff1663ae25532e6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b158015611dc457600080fd5b505af1158015611dd8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611dfc919081019061491e565b7fffffffff0000000000000000000000000000000000000000000000000000000081166000908152600a602052604090205490925073ffffffffffffffffffffffffffffffffffffffff1690508015611e81576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061552f565b7fffffffff0000000000000000000000000000000000000000000000000000000082166000908152600a60205260409081902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8616179055517fd2c6b762299c609bdb96520b58a49bfb80186934d4f71a86a367571a15c0319490611f2290849087906154b5565b60405180910390a150505050565b611f386142f0565b611f4182613639565b6020808301829052600091825260039052604090819020549082015260808201511515611f755760015b60ff168152610f07565b60a08201511515611f87576002611f6b565b60a0820151604082015110611f9d576005611f6b565b6101008201514210611fb0576004611f6b565b60208082015160009081526004909152604090205460ff1615611fd4576006611f6b565b610120820151825173ffffffffffffffffffffffffffffffffffffffff90811660009081526005602090815260408083206060880151909416835292905220541115612021576006611f6b565b60038152919050565b60005460ff1615612067576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061567f565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905561209b81612e64565b50600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055565b600560209081526000928352604080842090915290825290205481565b606060405190810160405280602481526020017ff47261b0000000000000000000000000e41d2489571d322189246dafa5ebde1f81526020017f4699f4980000000000000000000000000000000000000000000000000000000081525081565b61214b614298565b6060600080600061215a614298565b88600081518110151561216957fe5b906020019060200201516101600151945088519350600092505b82841461220c5784898481518110151561219957fe5b9060200190602002015161016001819052506121b9888760200151612ee2565b91506121e589848151811015156121cc57fe5b90602001906020020151838986815181101515610e8e57fe5b90506121f18682612532565b602086015188116122015761220c565b600190920191612183565b50505050509392505050565b60015481565b612226614298565b6060600080600080612236614298565b60005460ff1615612273576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061567f565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011781558a518b919081106122ab57fe5b906020019060200201516101400151955089519450600093505b83851461235a57858a858151811015156122db57fe5b60209081029091010151610140015286516122f7908a90612ee2565b925061230a8a8581518110151561196457fe5b91506123368a8581518110151561231d57fe5b90602001906020020151838a8781518110151561074957fe5b90506123428782612532565b8651891161234f5761235a565b6001909301926122c5565b5050600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905550929695505050505050565b60095473ffffffffffffffffffffffffffffffffffffffff1681565b60025473ffffffffffffffffffffffffffffffffffffffff1633146123fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061568f565b73ffffffffffffffffffffffffffffffffffffffff81161561245a57600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83161790555b50565b60408051808201909152600581527f322e302e30000000000000000000000000000000000000000000000000000000602082015281565b61249c614298565b6124a46142f0565b60008060006124b288611f30565b93506124bc612594565b92506124ca888585896125c6565b6124dc8860a001518560400151612ee2565b91506124e88783613647565b90506124fb888589848960000151612945565b612505888261365d565b945061251c88848660200151876040015189612a5e565b6125278884876136be565b505050509392505050565b815181516125409190613776565b8252602080830151908201516125569190613776565b60208301526040808301519082015161256f9190613776565b6040830152606080830151908201516125889190613776565b60609092019190915250565b60095460009073ffffffffffffffffffffffffffffffffffffffff168181156125bd57816125bf565b335b9392505050565b825160ff16600314612604576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906156af565b606084015173ffffffffffffffffffffffffffffffffffffffff161561267757606084015173ffffffffffffffffffffffffffffffffffffffff163314612677576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906156bf565b602084015173ffffffffffffffffffffffffffffffffffffffff1615612702578173ffffffffffffffffffffffffffffffffffffffff16846020015173ffffffffffffffffffffffffffffffffffffffff16141515612702576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906154ff565b6040830151151561275857612720836020015185600001518361135b565b1515612758576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061556f565b50505050565b6127708260a001518260a001516137c0565b612782836080015183608001516137c0565b10156127ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906156cf565b5050565b6127c66142c1565b6000806000806127da8960a0015188612ee2565b93506127ef89608001518a60a001518661381b565b92506127ff8860a0015187612ee2565b915061281488608001518960a001518461381b565b90508084106128575760208086018051839052805182018490525151865182015260808a015160a08b015187519092015161284f929061381b565b855152612894565b845183905284516020908101859052855181015190860180519190915260a089015160808a015191515161288b9290613898565b60208087015101525b84515160208087015101516128a99190612ee2565b604086015284515160808a015160c08b01516128c692919061381b565b85516040015284516020015160a08a015160e08b01516128e792919061381b565b855160600152602085015151608089015160c08a015161290892919061381b565b856020015160400181815250506129308560200151602001518960a001518a60e0015161381b565b60208601516060015250505050949350505050565b82151561297e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906155ef565b828211156129b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906155df565b8460a001516129cb856040015184613776565b1115612a03576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061550f565b612a118560800151836137c0565b612a1f828760a001516137c0565b1115612a57576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061566f565b5050505050565b612a6c828260200151613776565b600084815260036020908152604091829020929092558681015187518451938501518584015160608701516101408c01516101608d015196518b9873ffffffffffffffffffffffffffffffffffffffff9788169897909616967f0bcc4c97732e47d9946f229edb95f5b6323f601300e4690de719993f3c37112996612afb968f96339692959194909390615345565b60405180910390a45050505050565b60608060405190810160405280602481526020017ff47261b0000000000000000000000000e41d2489571d322189246dafa5ebde1f81526020017f4699f498000000000000000000000000000000000000000000000000000000008152509050612b8b85610140015186600001518660000151856020015160200151613935565b61014084015184518651845160200151612ba793929190613935565b612bc08561014001518660000151858560400151613935565b612bdc8186600001518760400151856000015160400151613935565b612bf88185600001518660400151856020015160400151613935565b836040015173ffffffffffffffffffffffffffffffffffffffff16856040015173ffffffffffffffffffffffffffffffffffffffff161415612c6257612c5d81848760400151612c58866000015160600151876020015160600151613776565b613935565b612a57565b612c7a81848760400151856000015160600151613935565b612a5781848660400151856020015160600151613935565b604080517fb4be83d5000000000000000000000000000000000000000000000000000000006020808301919091526060602483018181528751608485019081528884015160a48601529488015160c48501529087015160e4840152608087015161010484015260a087015161012484015260c087015161014484015260e08701516101648401526101008701516101848401526101208701516101a4840152610140870180516101c485019081526101608901516101e4860152610180905251805161020485018190529394919384936044870192849261022489019291820191601f82010460005b81811015612d99578351855260209485019490930192600101612d7b565b50505050818103610160808401919091528a0151805180835260209283019291820191601f82010460005b81811015612de2578351855260209485019490930192600101612dc4565b50505089845250848103602093840190815288518083529093918201918981019190601f82010460005b81811015612e2a578351855260209485019490930192600101612e0c565b5050507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08883030188525060405250505050509392505050565b612e6c6142f0565b612e7582611f30565b9050612e818282613aff565b6127ba828260200151613c16565b612e97614298565b612ea2848484612494565b602081015190915083146125bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061565f565b600082821115612f1e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061551f565b508082035b92915050565b6000808251111515612f67576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061560f565b815182907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8101908110612f9757fe5b016020015182517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01909252507f0100000000000000000000000000000000000000000000000000000000000000908190040290565b60008160200183511015151561302f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061553f565b50016020015190565b6040516000906060907f1626ba7e00000000000000000000000000000000000000000000000000000000906130739087908690602401615460565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152919052602080820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909416939093178352815191935090829081885afa808015613110576001811461318157612527565b7f08c379a0000000000000000000000000000000000000000000000000000000006000527c20000000000000000000000000000000000000000000000000000000006020527c0c57414c4c45545f4552524f5200000000000000000000000000000000604052600060605260646000fd5b50505195945050505050565b600060148251101515156131cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061569f565b6131db826014845103613cbd565b82517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec019092525090565b6040516000906060907f93634702000000000000000000000000000000000000000000000000000000009061324390879087908790602401615433565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152919052602080820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009094169390931783528151919350908290818a5afa8080156132e0576001811461335157613356565b7f08c379a0000000000000000000000000000000000000000000000000000000006000527c20000000000000000000000000000000000000000000000000000000006020527c0f56414c494441544f525f4552524f5200000000000000000000000000604052600060605260646000fd5b825194505b50505050949350505050565b600080831161339d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061555f565b6133b06133aa85846137c0565b84613d1e565b949350505050565b604080517f5a65726f45785472616e73616374696f6e2800000000000000000000000000006020808301919091527f75696e743235362073616c742c0000000000000000000000000000000000000060328301527f61646472657373207369676e6572416464726573732c00000000000000000000603f8301527f627974657320646174610000000000000000000000000000000000000000000060558301527f2900000000000000000000000000000000000000000000000000000000000000605f830152825180830384018152606090920192839052815160009384938493909282918401908083835b602083106134e157805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016134a4565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018019909216911617905260405191909301819003812089519097508995509093508392850191508083835b6020831061357757805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161353a565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040805192909401829003822097825281019a909a525073ffffffffffffffffffffffffffffffffffffffff97909716968801969096525050606085015250506080909120919050565b6001546040517f19010000000000000000000000000000000000000000000000000000000000008152600281019190915260228101919091526042902090565b6000612f23611afd83613d35565b600081831061365657816125bf565b5090919050565b613665614298565b6020810182905260a0830151608084015161368191849161381b565b808252608084015160c085015161369992919061381b565b604082015260a083015160e08401516136b391849161381b565b606082015292915050565b60408051606081018252602481527ff47261b0000000000000000000000000e41d2489571d322189246dafa5ebde1f60208201527f4699f4980000000000000000000000000000000000000000000000000000000091810191909152610140840151845183516137319291908690613935565b61374a8461016001518486600001518560200151613935565b61376281856000015186604001518560400151613935565b612758818486604001518560600151613935565b6000828201838110156137b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061558f565b8091505b5092915050565b6000808315156137d357600091506137b9565b508282028284828115156137e357fe5b04146137b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061558f565b6000808311613856576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061555f565b61386184848461418e565b1561339d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906155bf565b60008083116138d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061555f565b6138de848484614213565b15613915576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906155bf565b6133b06133aa61392586856137c0565b613930866001612ee2565b613776565b60008060008311801561397457508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b15613af75785516003106139b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061564f565b50506020848101517fffffffff00000000000000000000000000000000000000000000000000000000166000818152600a90925260409091205473ffffffffffffffffffffffffffffffffffffffff16801515613a3d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906155ff565b604051660fffffffffffe0603f885101168060840182017fa85e59e40000000000000000000000000000000000000000000000000000000083526080600484015273ffffffffffffffffffffffffffffffffffffffff8816602484015273ffffffffffffffffffffffffffffffffffffffff87166044840152856064840152608483015b81811015613ad957895181526020998a019901613ac1565b61020084858403866000895af1801515613af1573d85fd5b50505050505b505050505050565b805160009060ff16600314613b40576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906156af565b606083015173ffffffffffffffffffffffffffffffffffffffff1615613bb357606083015173ffffffffffffffffffffffffffffffffffffffff163314613bb3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906156bf565b613bbb612594565b835190915073ffffffffffffffffffffffffffffffffffffffff808316911614613c11576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061557f565b505050565b6000818152600460205260409081902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558281015183516101408501516101608601519351859473ffffffffffffffffffffffffffffffffffffffff9485169493909316927fdc47b3613d9fe400085f6dbdc99453462279057e6207385042827ed6b1a62cf792613cb1923392906153c9565b60405180910390a45050565b600081601401835110151515613cff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061569f565b50016014015173ffffffffffffffffffffffffffffffffffffffff1690565b6000808284811515613d2c57fe5b04949350505050565b604080517f4f726465722800000000000000000000000000000000000000000000000000006020808301919091527f61646472657373206d616b6572416464726573732c000000000000000000000060268301527f616464726573732074616b6572416464726573732c0000000000000000000000603b8301527f6164647265737320666565526563697069656e74416464726573732c0000000060508301527f616464726573732073656e646572416464726573732c00000000000000000000606c8301527f75696e74323536206d616b65724173736574416d6f756e742c0000000000000060828301527f75696e743235362074616b65724173736574416d6f756e742c00000000000000609b8301527f75696e74323536206d616b65724665652c00000000000000000000000000000060b48301527f75696e743235362074616b65724665652c00000000000000000000000000000060c58301527f75696e743235362065787069726174696f6e54696d655365636f6e64732c000060d68301527f75696e743235362073616c742c0000000000000000000000000000000000000060f48301527f6279746573206d616b65724173736574446174612c00000000000000000000006101018301527f62797465732074616b65724173736574446174610000000000000000000000006101168301527f290000000000000000000000000000000000000000000000000000000000000061012a830152825161010b81840301815261012b90920192839052815160009384938493849391929182918401908083835b60208310613fbd57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101613f80565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930181900381206101408b0151805191995095509093508392850191508083835b6020831061405857805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161401b565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930181900381206101608b0151805191985095509093508392850191508083835b602083106140f357805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016140b6565b5181516020939093036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018019909116921691909117905260405192018290039091207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0890180516101408b018051610160909c0180519a84529881529288526101a0822091529890525050509190525090919050565b6000808084116141ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061555f565b8215806141d5575084155b156141e35760009150610a88565b838015156141ed57fe5b85840990506141fc85846137c0565b6142086103e8836137c0565b101595945050505050565b60008080841161424f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061555f565b82158061425a575084155b156142685760009150610a88565b8380151561427257fe5b8584099050836142828583612ee2565b81151561428b57fe5b0690506141fc85846137c0565b608060405190810160405280600081526020016000815260200160008152602001600081525090565b610120604051908101604052806142d6614298565b81526020016142e3614298565b8152602001600081525090565b604080516060810182526000808252602082018190529181019190915290565b60006125bf82356157c2565b6000601f8201831361432d57600080fd5b813561434061433b82615751565b61572a565b81815260209384019390925082018360005b8381101561437e578135860161436888826144ce565b8452506020928301929190910190600101614352565b5050505092915050565b6000601f8201831361439957600080fd5b81356143a761433b82615751565b81815260209384019390925082018360005b8381101561437e57813586016143cf888261451d565b84525060209283019291909101906001016143b9565b6000601f820183136143f657600080fd5b813561440461433b82615751565b9150818183526020840193506020810190508385602084028201111561442957600080fd5b60005b8381101561437e578161443f8882614461565b845250602092830192919091019060010161442c565b60006125bf82356157db565b60006125bf82356157e0565b60006125bf82356157e3565b60006125bf82516157e3565b600080601f8301841361449757600080fd5b50813567ffffffffffffffff8111156144af57600080fd5b6020830191508360018202830111156144c757600080fd5b9250929050565b6000601f820183136144df57600080fd5b81356144ed61433b82615772565b9150808252602083016020830185838301111561450957600080fd5b614514838284615819565b50505092915050565b6000610180828403121561453057600080fd5b61453b61018061572a565b905060006145498484614310565b825250602061455a84848301614310565b602083015250604061456e84828501614310565b604083015250606061458284828501614310565b606083015250608061459684828501614461565b60808301525060a06145aa84828501614461565b60a08301525060c06145be84828501614461565b60c08301525060e06145d284828501614461565b60e0830152506101006145e784828501614461565b610100830152506101206145fd84828501614461565b6101208301525061014082013567ffffffffffffffff81111561461f57600080fd5b61462b848285016144ce565b6101408301525061016082013567ffffffffffffffff81111561464d57600080fd5b614659848285016144ce565b6101608301525092915050565b60006020828403121561467857600080fd5b60006133b08484614310565b6000806040838503121561469757600080fd5b60006146a38585614310565b92505060206146b485828601614310565b9150509250929050565b600080604083850312156146d157600080fd5b60006146dd8585614310565b92505060206146b485828601614455565b60006020828403121561470057600080fd5b813567ffffffffffffffff81111561471757600080fd5b6133b084828501614388565b60008060006060848603121561473857600080fd5b833567ffffffffffffffff81111561474f57600080fd5b61475b86828701614388565b935050602084013567ffffffffffffffff81111561477857600080fd5b614784868287016143e5565b925050604084013567ffffffffffffffff8111156147a157600080fd5b6147ad8682870161431c565b9150509250925092565b6000806000606084860312156147cc57600080fd5b833567ffffffffffffffff8111156147e357600080fd5b6147ef86828701614388565b935050602061478486828701614461565b60006020828403121561481257600080fd5b60006133b08484614461565b6000806040838503121561483157600080fd5b60006146a38585614461565b6000806000806060858703121561485357600080fd5b600061485f8787614461565b945050602061487087828801614310565b935050604085013567ffffffffffffffff81111561488d57600080fd5b61489987828801614485565b95989497509550505050565b6000806000606084860312156148ba57600080fd5b60006148c68686614461565b93505060206148d786828701614310565b925050604084013567ffffffffffffffff8111156148f457600080fd5b6147ad868287016144ce565b60006020828403121561491257600080fd5b60006133b0848461446d565b60006020828403121561493057600080fd5b60006133b08484614479565b60006020828403121561494e57600080fd5b813567ffffffffffffffff81111561496557600080fd5b6133b08482850161451d565b6000806000806080858703121561498757600080fd5b843567ffffffffffffffff81111561499e57600080fd5b6149aa8782880161451d565b945050602085013567ffffffffffffffff8111156149c757600080fd5b6149d38782880161451d565b935050604085013567ffffffffffffffff8111156149f057600080fd5b6149fc878288016144ce565b925050606085013567ffffffffffffffff811115614a1957600080fd5b614a25878288016144ce565b91505092959194509250565b600080600060608486031215614a4657600080fd5b833567ffffffffffffffff811115614a5d57600080fd5b614a698682870161451d565b93505060206148d786828701614461565b60008060008060008060808789031215614a9357600080fd5b6000614a9f8989614461565b9650506020614ab089828a01614310565b955050604087013567ffffffffffffffff811115614acd57600080fd5b614ad989828a01614485565b9450945050606087013567ffffffffffffffff811115614af857600080fd5b614b0489828a01614485565b92509250509295509295509295565b614b1c816157c2565b82525050565b6000614b2d826157be565b808452602084019350614b3f836157b8565b60005b82811015614b6f57614b558683516152f7565b614b5e826157b8565b606096909601959150600101614b42565b5093949350505050565b614b1c816157db565b614b1c816157e0565b614b1c816157e3565b6000614b9f826157be565b808452614bb3816020860160208601615825565b614bbc81615851565b9093016020019392505050565b614b1c8161580e565b601281527f4c454e4754485f36355f52455155495245440000000000000000000000000000602082015260400190565b600d81527f494e56414c49445f54414b455200000000000000000000000000000000000000602082015260400190565b600e81527f4f524445525f4f56455246494c4c000000000000000000000000000000000000602082015260400190565b601181527f55494e543235365f554e444552464c4f57000000000000000000000000000000602082015260400190565b601a81527f41535345545f50524f58595f414c52454144595f455849535453000000000000602082015260400190565b602681527f475245415445525f4f525f455155414c5f544f5f33325f4c454e4754485f524560208201527f5155495245440000000000000000000000000000000000000000000000000000604082015260600190565b601581527f5349474e41545552455f554e535550504f525445440000000000000000000000602082015260400190565b601081527f4449564953494f4e5f42595f5a45524f00000000000000000000000000000000602082015260400190565b601781527f494e56414c49445f4f524445525f5349474e4154555245000000000000000000602082015260400190565b600d81527f494e56414c49445f4d414b455200000000000000000000000000000000000000602082015260400190565b601081527f55494e543235365f4f564552464c4f5700000000000000000000000000000000602082015260400190565b600f81527f494e56414c49445f54585f484153480000000000000000000000000000000000602082015260400190565b601181527f494e56414c49445f5349474e4154555245000000000000000000000000000000602082015260400190565b600e81527f524f554e44494e475f4552524f52000000000000000000000000000000000000602082015260400190565b601081527f4641494c45445f455845435554494f4e00000000000000000000000000000000602082015260400190565b600d81527f54414b45525f4f56455250415900000000000000000000000000000000000000602082015260400190565b601481527f494e56414c49445f54414b45525f414d4f554e54000000000000000000000000602082015260400190565b601a81527f41535345545f50524f58595f444f45535f4e4f545f4558495354000000000000602082015260400190565b602181527f475245415445525f5448414e5f5a45524f5f4c454e4754485f5245515549524560208201527f4400000000000000000000000000000000000000000000000000000000000000604082015260600190565b601181527f5349474e41545552455f494c4c4547414c000000000000000000000000000000602082015260400190565b601e81527f4c454e4754485f475245415445525f5448414e5f305f52455155495245440000602082015260400190565b601781527f494e56414c49445f4e45575f4f524445525f45504f4348000000000000000000602082015260400190565b601e81527f4c454e4754485f475245415445525f5448414e5f335f52455155495245440000602082015260400190565b601481527f434f4d504c4554455f46494c4c5f4641494c4544000000000000000000000000602082015260400190565b601281527f494e56414c49445f46494c4c5f50524943450000000000000000000000000000602082015260400190565b601281527f5245454e5452414e43595f494c4c4547414c0000000000000000000000000000602082015260400190565b601381527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000602082015260400190565b602681527f475245415445525f4f525f455155414c5f544f5f32305f4c454e4754485f524560208201527f5155495245440000000000000000000000000000000000000000000000000000604082015260600190565b601081527f4f524445525f554e46494c4c41424c4500000000000000000000000000000000602082015260400190565b600e81527f494e56414c49445f53454e444552000000000000000000000000000000000000602082015260400190565b601881527f4e454741544956455f5350524541445f52455155495245440000000000000000602082015260400190565b601481527f494e56414c49445f54585f5349474e4154555245000000000000000000000000602082015260400190565b601181527f4c454e4754485f305f5245515549524544000000000000000000000000000000602082015260400190565b805160808301906152858482614b82565b5060208201516152986020850182614b82565b5060408201516152ab6040850182614b82565b5060608201516127586060850182614b82565b80516101208301906152d08482615274565b5060208201516152e36080850182615274565b506040820151612758610100850182614b82565b80516060830190615308848261532e565b50602082015161531b6020850182614b82565b5060408201516127586040850182614b82565b614b1c81615808565b60208101612f238284614b13565b6101008101615354828b614b13565b615361602083018a614b13565b61536e6040830189614b82565b61537b6060830188614b82565b6153886080830187614b82565b61539560a0830186614b82565b81810360c08301526153a78185614b94565b905081810360e08301526153bb8184614b94565b9a9950505050505050505050565b606081016153d78286614b13565b81810360208301526153e98185614b94565b905081810360408301526153fd8184614b94565b95945050505050565b602080825281016125bf8184614b22565b60208101612f238284614b79565b60208101612f238284614b82565b606081016154418286614b82565b61544e6020830185614b13565b81810360408301526153fd8184614b94565b6040810161546e8285614b82565b81810360208301526133b08184614b94565b6080810161548e8287614b82565b61549b602083018661532e565b6154a86040830185614b82565b6153fd6060830184614b82565b604081016154c38285614b8b565b6125bf6020830184614b13565b602080825281016125bf8184614b94565b60208101612f238284614bc9565b60208082528101612f2381614bd2565b60208082528101612f2381614c02565b60208082528101612f2381614c32565b60208082528101612f2381614c62565b60208082528101612f2381614c92565b60208082528101612f2381614cc2565b60208082528101612f2381614d18565b60208082528101612f2381614d48565b60208082528101612f2381614d78565b60208082528101612f2381614da8565b60208082528101612f2381614dd8565b60208082528101612f2381614e08565b60208082528101612f2381614e38565b60208082528101612f2381614e68565b60208082528101612f2381614e98565b60208082528101612f2381614ec8565b60208082528101612f2381614ef8565b60208082528101612f2381614f28565b60208082528101612f2381614f58565b60208082528101612f2381614fae565b60208082528101612f2381614fde565b60208082528101612f238161500e565b60208082528101612f238161503e565b60208082528101612f238161506e565b60208082528101612f238161509e565b60208082528101612f23816150ce565b60208082528101612f23816150fe565b60208082528101612f238161512e565b60208082528101612f2381615184565b60208082528101612f23816151b4565b60208082528101612f23816151e4565b60208082528101612f2381615214565b60208082528101612f2381615244565b60808101612f238284615274565b6101208101612f2382846152be565b60608101612f2382846152f7565b60405181810167ffffffffffffffff8111828210171561574957600080fd5b604052919050565b600067ffffffffffffffff82111561576857600080fd5b5060209081020190565b600067ffffffffffffffff82111561578957600080fd5b506020601f919091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0160190565b60200190565b5190565b73ffffffffffffffffffffffffffffffffffffffff1690565b151590565b90565b7fffffffff000000000000000000000000000000000000000000000000000000001690565b60ff1690565b6000612f23826157c2565b82818337506000910152565b60005b83811015615840578181015183820152602001615828565b838111156127585750506000910152565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016905600a265627a7a72305820b19c92201032603398c007dccf80930c626ef89fa6c848c8b7ef5267d07cd4ed6c6578706572696d656e74616cf50037",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x1B6 JUMPI PUSH4 0xFFFFFFFF PUSH29 0x100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD DIV AND PUSH4 0x288CDC91 DUP2 EQ PUSH2 0x1BB JUMPI DUP1 PUSH4 0x297BB70B EQ PUSH2 0x1F1 JUMPI DUP1 PUSH4 0x2AC12622 EQ PUSH2 0x21E JUMPI DUP1 PUSH4 0x3683EF8E EQ PUSH2 0x24B JUMPI DUP1 PUSH4 0x3C28D861 EQ PUSH2 0x26D JUMPI DUP1 PUSH4 0x3E228BAE EQ PUSH2 0x29A JUMPI DUP1 PUSH4 0x3FD3C997 EQ PUSH2 0x2BA JUMPI DUP1 PUSH4 0x4AC14782 EQ PUSH2 0x2E7 JUMPI DUP1 PUSH4 0x4D0AE546 EQ PUSH2 0x307 JUMPI DUP1 PUSH4 0x4F9559B1 EQ PUSH2 0x327 JUMPI DUP1 PUSH4 0x50DDE190 EQ PUSH2 0x347 JUMPI DUP1 PUSH4 0x60704108 EQ PUSH2 0x367 JUMPI DUP1 PUSH4 0x642F2EAF EQ PUSH2 0x394 JUMPI DUP1 PUSH4 0x64A3BC15 EQ PUSH2 0x3B4 JUMPI DUP1 PUSH4 0x77FCCE68 EQ PUSH2 0x3D4 JUMPI DUP1 PUSH4 0x7B8E3514 EQ PUSH2 0x3F4 JUMPI DUP1 PUSH4 0x7E1D9808 EQ PUSH2 0x414 JUMPI DUP1 PUSH4 0x7E9D74DC EQ PUSH2 0x434 JUMPI DUP1 PUSH4 0x82C174D0 EQ PUSH2 0x461 JUMPI DUP1 PUSH4 0x8DA5CB5B EQ PUSH2 0x481 JUMPI DUP1 PUSH4 0x93634702 EQ PUSH2 0x496 JUMPI DUP1 PUSH4 0xA3E20380 EQ PUSH2 0x4B6 JUMPI DUP1 PUSH4 0xB4BE83D5 EQ PUSH2 0x4D6 JUMPI DUP1 PUSH4 0xBFC8BFCE EQ PUSH2 0x4F6 JUMPI DUP1 PUSH4 0xC585BB93 EQ PUSH2 0x516 JUMPI DUP1 PUSH4 0xC75E0A81 EQ PUSH2 0x536 JUMPI DUP1 PUSH4 0xD46B02C3 EQ PUSH2 0x563 JUMPI DUP1 PUSH4 0xD9BFA73E EQ PUSH2 0x583 JUMPI DUP1 PUSH4 0xDB123B1A EQ PUSH2 0x5A3 JUMPI DUP1 PUSH4 0xDD1C7D18 EQ PUSH2 0x5C5 JUMPI DUP1 PUSH4 0xE306F779 EQ PUSH2 0x5E5 JUMPI DUP1 PUSH4 0xE5FA431B EQ PUSH2 0x5FA JUMPI DUP1 PUSH4 0xEEA086BA EQ PUSH2 0x61A JUMPI DUP1 PUSH4 0xF2FDE38B EQ PUSH2 0x62F JUMPI DUP1 PUSH4 0xFFA1AD74 EQ PUSH2 0x64F JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1C7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1DB PUSH2 0x1D6 CALLDATASIZE PUSH1 0x4 PUSH2 0x4800 JUMP JUMPDEST PUSH2 0x664 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1E8 SWAP2 SWAP1 PUSH2 0x5425 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1FD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x211 PUSH2 0x20C CALLDATASIZE PUSH1 0x4 PUSH2 0x4723 JUMP JUMPDEST PUSH2 0x676 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1E8 SWAP2 SWAP1 PUSH2 0x56FF JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x22A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x23E PUSH2 0x239 CALLDATASIZE PUSH1 0x4 PUSH2 0x4800 JUMP JUMPDEST PUSH2 0x7A1 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1E8 SWAP2 SWAP1 PUSH2 0x5417 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x257 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x26B PUSH2 0x266 CALLDATASIZE PUSH1 0x4 PUSH2 0x483D JUMP JUMPDEST PUSH2 0x7B6 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x279 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x28D PUSH2 0x288 CALLDATASIZE PUSH1 0x4 PUSH2 0x4971 JUMP JUMPDEST PUSH2 0x8A3 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1E8 SWAP2 SWAP1 PUSH2 0x570D JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2A6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x211 PUSH2 0x2B5 CALLDATASIZE PUSH1 0x4 PUSH2 0x4A31 JUMP JUMPDEST PUSH2 0xA3A JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2C6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2DA PUSH2 0x2D5 CALLDATASIZE PUSH1 0x4 PUSH2 0x4900 JUMP JUMPDEST PUSH2 0xA90 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1E8 SWAP2 SWAP1 PUSH2 0x54E1 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2F3 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x26B PUSH2 0x302 CALLDATASIZE PUSH1 0x4 PUSH2 0x46EE JUMP JUMPDEST PUSH2 0xAB8 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x313 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x211 PUSH2 0x322 CALLDATASIZE PUSH1 0x4 PUSH2 0x4723 JUMP JUMPDEST PUSH2 0xB85 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x333 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x26B PUSH2 0x342 CALLDATASIZE PUSH1 0x4 PUSH2 0x4800 JUMP JUMPDEST PUSH2 0xC75 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x353 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x211 PUSH2 0x362 CALLDATASIZE PUSH1 0x4 PUSH2 0x4723 JUMP JUMPDEST PUSH2 0xE2A JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x373 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x387 PUSH2 0x382 CALLDATASIZE PUSH1 0x4 PUSH2 0x4900 JUMP JUMPDEST PUSH2 0xEBE JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1E8 SWAP2 SWAP1 PUSH2 0x5337 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3A0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x23E PUSH2 0x3AF CALLDATASIZE PUSH1 0x4 PUSH2 0x4800 JUMP JUMPDEST PUSH2 0xF0C JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3C0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x211 PUSH2 0x3CF CALLDATASIZE PUSH1 0x4 PUSH2 0x4A31 JUMP JUMPDEST PUSH2 0xF21 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3E0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x26B PUSH2 0x3EF CALLDATASIZE PUSH1 0x4 PUSH2 0x46BE JUMP JUMPDEST PUSH2 0xFCC JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x400 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x23E PUSH2 0x40F CALLDATASIZE PUSH1 0x4 PUSH2 0x4684 JUMP JUMPDEST PUSH2 0x1106 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x420 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x211 PUSH2 0x42F CALLDATASIZE PUSH1 0x4 PUSH2 0x47B7 JUMP JUMPDEST PUSH2 0x1126 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x440 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x454 PUSH2 0x44F CALLDATASIZE PUSH1 0x4 PUSH2 0x46EE JUMP JUMPDEST PUSH2 0x128A JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1E8 SWAP2 SWAP1 PUSH2 0x5406 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x46D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x23E PUSH2 0x47C CALLDATASIZE PUSH1 0x4 PUSH2 0x481E JUMP JUMPDEST PUSH2 0x131F JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x48D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x387 PUSH2 0x133F JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x4A2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x23E PUSH2 0x4B1 CALLDATASIZE PUSH1 0x4 PUSH2 0x48A5 JUMP JUMPDEST PUSH2 0x135B JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x4C2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x211 PUSH2 0x4D1 CALLDATASIZE PUSH1 0x4 PUSH2 0x47B7 JUMP JUMPDEST PUSH2 0x18DE JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x4E2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x211 PUSH2 0x4F1 CALLDATASIZE PUSH1 0x4 PUSH2 0x4A31 JUMP JUMPDEST PUSH2 0x19F1 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x502 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x26B PUSH2 0x511 CALLDATASIZE PUSH1 0x4 PUSH2 0x4A7A JUMP JUMPDEST PUSH2 0x1A6C JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x522 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x26B PUSH2 0x531 CALLDATASIZE PUSH1 0x4 PUSH2 0x4666 JUMP JUMPDEST PUSH2 0x1D05 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x542 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x556 PUSH2 0x551 CALLDATASIZE PUSH1 0x4 PUSH2 0x493C JUMP JUMPDEST PUSH2 0x1F30 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1E8 SWAP2 SWAP1 PUSH2 0x571C JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x56F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x26B PUSH2 0x57E CALLDATASIZE PUSH1 0x4 PUSH2 0x493C JUMP JUMPDEST PUSH2 0x202A JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x58F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1DB PUSH2 0x59E CALLDATASIZE PUSH1 0x4 PUSH2 0x4684 JUMP JUMPDEST PUSH2 0x20C6 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x5AF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x5B8 PUSH2 0x20E3 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1E8 SWAP2 SWAP1 PUSH2 0x54D0 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x5D1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x211 PUSH2 0x5E0 CALLDATASIZE PUSH1 0x4 PUSH2 0x47B7 JUMP JUMPDEST PUSH2 0x2143 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x5F1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1DB PUSH2 0x2218 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x606 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x211 PUSH2 0x615 CALLDATASIZE PUSH1 0x4 PUSH2 0x47B7 JUMP JUMPDEST PUSH2 0x221E JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x626 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x387 PUSH2 0x2390 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x63B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x26B PUSH2 0x64A CALLDATASIZE PUSH1 0x4 PUSH2 0x4666 JUMP JUMPDEST PUSH2 0x23AC JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x65B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x5B8 PUSH2 0x245D JUMP JUMPDEST PUSH1 0x3 PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP2 JUMP JUMPDEST PUSH2 0x67E PUSH2 0x4298 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x689 PUSH2 0x4298 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x6CF JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x567F JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR DUP2 SSTORE DUP8 MLOAD SWAP4 POP SWAP2 POP JUMPDEST DUP2 DUP4 EQ PUSH2 0x76F JUMPI PUSH2 0x758 DUP8 DUP4 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x719 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP8 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x731 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP8 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x749 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x2494 JUMP JUMPDEST SWAP1 POP PUSH2 0x764 DUP5 DUP3 PUSH2 0x2532 JUMP JUMPDEST PUSH1 0x1 SWAP1 SWAP2 ADD SWAP1 PUSH2 0x701 JUMP JUMPDEST POP POP PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x4 PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND CALLER EQ PUSH2 0x846 JUMPI PUSH2 0x80E DUP5 DUP5 DUP5 DUP5 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY POP PUSH2 0x135B SWAP5 POP POP POP POP POP JUMP JUMPDEST ISZERO ISZERO PUSH2 0x846 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x55AF JUMP JUMPDEST POP POP PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x6 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP5 KECCAK256 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP4 AND DUP5 MSTORE SWAP2 SWAP1 MSTORE SWAP1 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR SWAP1 SSTORE JUMP JUMPDEST PUSH2 0x8AB PUSH2 0x42C1 JUMP JUMPDEST PUSH2 0x8B3 PUSH2 0x42F0 JUMP JUMPDEST PUSH2 0x8BB PUSH2 0x42F0 JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x8F9 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x567F JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR SWAP1 SSTORE PUSH2 0x160 DUP1 DUP10 ADD MLOAD PUSH2 0x140 DUP1 DUP11 ADD SWAP2 SWAP1 SWAP2 MSTORE DUP10 ADD MLOAD SWAP1 DUP9 ADD MSTORE PUSH2 0x945 DUP9 PUSH2 0x1F30 JUMP JUMPDEST SWAP3 POP PUSH2 0x950 DUP8 PUSH2 0x1F30 JUMP JUMPDEST SWAP2 POP PUSH2 0x95A PUSH2 0x2594 JUMP JUMPDEST SWAP1 POP PUSH2 0x968 DUP9 DUP5 DUP4 DUP10 PUSH2 0x25C6 JUMP JUMPDEST PUSH2 0x974 DUP8 DUP4 DUP4 DUP9 PUSH2 0x25C6 JUMP JUMPDEST PUSH2 0x97E DUP9 DUP9 PUSH2 0x275E JUMP JUMPDEST PUSH2 0x992 DUP9 DUP9 DUP6 PUSH1 0x40 ADD MLOAD DUP6 PUSH1 0x40 ADD MLOAD PUSH2 0x27BE JUMP JUMPDEST DUP1 MLOAD PUSH1 0x20 DUP2 ADD MLOAD SWAP1 MLOAD SWAP2 SWAP6 POP PUSH2 0x9AD SWAP2 DUP11 SWAP2 DUP7 SWAP2 DUP2 SWAP1 PUSH2 0x2945 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP6 ADD MLOAD SWAP1 DUP2 ADD MLOAD SWAP1 MLOAD PUSH2 0x9C9 SWAP2 DUP10 SWAP2 DUP6 SWAP2 SWAP1 DUP2 SWAP1 PUSH2 0x2945 JUMP JUMPDEST PUSH2 0x9E2 DUP9 DUP3 DUP6 PUSH1 0x20 ADD MLOAD DUP7 PUSH1 0x40 ADD MLOAD DUP9 PUSH1 0x0 ADD MLOAD PUSH2 0x2A5E JUMP JUMPDEST PUSH2 0x9FB DUP8 DUP3 DUP5 PUSH1 0x20 ADD MLOAD DUP6 PUSH1 0x40 ADD MLOAD DUP9 PUSH1 0x20 ADD MLOAD PUSH2 0x2A5E JUMP JUMPDEST PUSH2 0xA07 DUP9 DUP9 DUP4 DUP8 PUSH2 0x2B0A JUMP JUMPDEST POP POP PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE POP SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH2 0xA42 PUSH2 0x4298 JUMP JUMPDEST PUSH1 0x60 PUSH2 0xA4F DUP6 DUP6 DUP6 PUSH2 0x2C92 JUMP JUMPDEST SWAP1 POP PUSH1 0x80 DUP2 DUP3 MLOAD PUSH1 0x20 DUP5 ADD ADDRESS GAS DELEGATECALL DUP1 ISZERO PUSH2 0xA86 JUMPI DUP2 MLOAD DUP4 MSTORE PUSH1 0x20 DUP3 ADD MLOAD PUSH1 0x20 DUP5 ADD MSTORE PUSH1 0x40 DUP3 ADD MLOAD PUSH1 0x40 DUP5 ADD MSTORE PUSH1 0x60 DUP3 ADD MLOAD PUSH1 0x60 DUP5 ADD MSTORE JUMPDEST POP JUMPDEST POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0xA PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD DUP2 SWAP1 PUSH1 0xFF AND ISZERO PUSH2 0xAF8 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x567F JUMP JUMPDEST POP POP PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR DUP2 SSTORE DUP2 MLOAD SWAP1 JUMPDEST DUP1 DUP3 EQ PUSH2 0xB58 JUMPI PUSH2 0xB50 DUP4 DUP3 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xB41 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x2E64 JUMP JUMPDEST PUSH1 0x1 ADD PUSH2 0xB29 JUMP JUMPDEST POP POP PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE POP JUMP JUMPDEST PUSH2 0xB8D PUSH2 0x4298 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0xB98 PUSH2 0x4298 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0xBD5 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x567F JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR DUP2 SSTORE DUP8 MLOAD SWAP4 POP SWAP2 POP JUMPDEST DUP2 DUP4 EQ PUSH2 0x76F JUMPI PUSH2 0xC5E DUP8 DUP4 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xC1F JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP8 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xC37 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP8 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xC4F JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x2E8F JUMP JUMPDEST SWAP1 POP PUSH2 0xC6A DUP5 DUP3 PUSH2 0x2532 JUMP JUMPDEST PUSH1 0x1 SWAP1 SWAP2 ADD SWAP1 PUSH2 0xC07 JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD DUP2 SWAP1 DUP2 SWAP1 DUP2 SWAP1 PUSH1 0xFF AND ISZERO PUSH2 0xCB9 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x567F JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR SWAP1 SSTORE PUSH2 0xCEC PUSH2 0x2594 JUMP JUMPDEST SWAP4 POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND CALLER EQ PUSH2 0xD11 JUMPI CALLER PUSH2 0xD14 JUMP JUMPDEST PUSH1 0x0 JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP7 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x5 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 SWAP4 DUP6 AND DUP4 MSTORE SWAP3 SWAP1 MSTORE KECCAK256 SLOAD SWAP1 SWAP4 POP PUSH1 0x1 DUP7 ADD SWAP3 POP SWAP1 POP DUP1 DUP3 GT PUSH2 0xD8B JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x563F JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP6 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x5 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 SWAP5 DUP9 AND DUP1 DUP5 MSTORE SWAP5 SWAP1 SWAP2 MSTORE SWAP1 DUP2 SWAP1 KECCAK256 DUP6 SWAP1 SSTORE MLOAD PUSH32 0x82AF639571738F4EBD4268FB0363D8957EBE1BBB9E78DBA5EBD69EED39B154F0 SWAP1 PUSH2 0xDF3 SWAP1 DUP7 SWAP1 PUSH2 0x5425 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 POP POP PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE POP POP POP JUMP JUMPDEST PUSH2 0xE32 PUSH2 0x4298 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0xE3D PUSH2 0x4298 JUMP JUMPDEST DUP7 MLOAD SWAP3 POP PUSH1 0x0 SWAP2 POP JUMPDEST DUP2 DUP4 EQ PUSH2 0xEB4 JUMPI PUSH2 0xE9D DUP8 DUP4 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xE5E JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP8 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xE76 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP8 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xE8E JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0xA3A JUMP JUMPDEST SWAP1 POP PUSH2 0xEA9 DUP5 DUP3 PUSH2 0x2532 JUMP JUMPDEST PUSH1 0x1 SWAP1 SWAP2 ADD SWAP1 PUSH2 0xE46 JUMP JUMPDEST POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 DUP2 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0xA PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND JUMPDEST SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x8 PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH2 0xF29 PUSH2 0x4298 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0xF66 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x567F JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR SWAP1 SSTORE PUSH2 0xF9C DUP5 DUP5 DUP5 PUSH2 0x2E8F JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x100A JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x567F JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR SWAP1 SSTORE PUSH2 0x103D PUSH2 0x2594 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 DUP2 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x7 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 SWAP5 DUP10 AND DUP1 DUP5 MSTORE SWAP5 SWAP1 SWAP2 MSTORE SWAP1 DUP2 SWAP1 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND DUP8 ISZERO ISZERO OR SWAP1 SSTORE MLOAD SWAP3 SWAP4 POP SWAP1 SWAP2 PUSH32 0xA8656E308026EEABCE8F0BC18048433252318AB80AC79DA0B3D3D8697DFBA891 SWAP1 PUSH2 0x10D1 SWAP1 DUP7 SWAP1 PUSH2 0x5417 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 POP POP PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE POP JUMP JUMPDEST PUSH1 0x7 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x0 SWAP3 DUP4 MSTORE PUSH1 0x40 DUP1 DUP5 KECCAK256 SWAP1 SWAP2 MSTORE SWAP1 DUP3 MSTORE SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH2 0x112E PUSH2 0x4298 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x0 DUP1 PUSH1 0x0 PUSH2 0x113D PUSH2 0x4298 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x117A JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x567F JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR DUP2 SSTORE DUP10 MLOAD DUP11 SWAP2 SWAP1 DUP2 LT PUSH2 0x11B2 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x160 ADD MLOAD SWAP5 POP DUP9 MLOAD SWAP4 POP PUSH1 0x0 SWAP3 POP JUMPDEST DUP3 DUP5 EQ PUSH2 0x1255 JUMPI DUP5 DUP10 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x11E2 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x160 ADD DUP2 SWAP1 MSTORE POP PUSH2 0x1202 DUP9 DUP8 PUSH1 0x20 ADD MLOAD PUSH2 0x2EE2 JUMP JUMPDEST SWAP2 POP PUSH2 0x122E DUP10 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1215 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP4 DUP10 DUP7 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x749 JUMPI INVALID JUMPDEST SWAP1 POP PUSH2 0x123A DUP7 DUP3 PUSH2 0x2532 JUMP JUMPDEST PUSH1 0x20 DUP7 ADD MLOAD DUP9 GT PUSH2 0x124A JUMPI PUSH2 0x1255 JUMP JUMPDEST PUSH1 0x1 SWAP1 SWAP3 ADD SWAP2 PUSH2 0x11CC JUMP JUMPDEST POP POP PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE POP SWAP2 SWAP6 SWAP5 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x60 PUSH1 0x0 PUSH1 0x60 PUSH1 0x0 DUP5 MLOAD SWAP3 POP DUP3 PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x12D0 JUMPI DUP2 PUSH1 0x20 ADD JUMPDEST PUSH2 0x12BD PUSH2 0x42F0 JUMP JUMPDEST DUP2 MSTORE PUSH1 0x20 ADD SWAP1 PUSH1 0x1 SWAP1 SUB SWAP1 DUP2 PUSH2 0x12B5 JUMPI SWAP1 POP JUMPDEST POP SWAP2 POP PUSH1 0x0 SWAP1 POP JUMPDEST DUP1 DUP4 EQ PUSH2 0xA88 JUMPI PUSH2 0x12FF DUP6 DUP3 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x12F0 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x1F30 JUMP JUMPDEST DUP3 DUP3 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x130D JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD MSTORE PUSH1 0x1 ADD PUSH2 0x12D8 JUMP JUMPDEST PUSH1 0x6 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x0 SWAP3 DUP4 MSTORE PUSH1 0x40 DUP1 DUP5 KECCAK256 SWAP1 SWAP2 MSTORE SWAP1 DUP3 MSTORE SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH1 0x2 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 DUP10 MLOAD GT ISZERO ISZERO PUSH2 0x13A4 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x562F JUMP JUMPDEST PUSH2 0x13AD DUP10 PUSH2 0x2F29 JUMP JUMPDEST PUSH32 0x100000000000000000000000000000000000000000000000000000000000000 SWAP1 DIV SWAP7 POP PUSH1 0x7 PUSH1 0xFF DUP9 AND LT PUSH2 0x140F JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x554F JUMP JUMPDEST DUP7 PUSH1 0xFF AND PUSH1 0x7 DUP2 GT ISZERO PUSH2 0x141E JUMPI INVALID JUMPDEST SWAP6 POP PUSH1 0x0 DUP7 PUSH1 0x7 DUP2 GT ISZERO PUSH2 0x142E JUMPI INVALID JUMPDEST EQ ISZERO PUSH2 0x1466 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x561F JUMP JUMPDEST PUSH1 0x1 DUP7 PUSH1 0x7 DUP2 GT ISZERO PUSH2 0x1474 JUMPI INVALID JUMPDEST EQ ISZERO PUSH2 0x14BC JUMPI DUP9 MLOAD ISZERO PUSH2 0x14B3 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x56EF JUMP JUMPDEST PUSH1 0x0 SWAP8 POP PUSH2 0x18D0 JUMP JUMPDEST PUSH1 0x2 DUP7 PUSH1 0x7 DUP2 GT ISZERO PUSH2 0x14CA JUMPI INVALID JUMPDEST EQ ISZERO PUSH2 0x1605 JUMPI DUP9 MLOAD PUSH1 0x41 EQ PUSH2 0x150B JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x54EF JUMP JUMPDEST DUP9 PUSH1 0x0 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x151A JUMPI INVALID JUMPDEST ADD PUSH1 0x20 ADD MLOAD PUSH32 0x100000000000000000000000000000000000000000000000000000000000000 SWAP1 DUP2 SWAP1 DIV DUP2 MUL DIV SWAP5 POP PUSH2 0x155A DUP10 PUSH1 0x1 PUSH4 0xFFFFFFFF PUSH2 0x2FED AND JUMP JUMPDEST SWAP4 POP PUSH2 0x156D DUP10 PUSH1 0x21 PUSH4 0xFFFFFFFF PUSH2 0x2FED AND JUMP JUMPDEST SWAP3 POP PUSH1 0x1 DUP12 DUP7 DUP7 DUP7 PUSH1 0x40 MLOAD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MSTORE PUSH1 0x40 MLOAD PUSH2 0x1592 SWAP5 SWAP4 SWAP3 SWAP2 SWAP1 PUSH2 0x5480 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 SUB SWAP1 DUP1 DUP5 SUB SWAP1 PUSH1 0x0 DUP7 GAS CALL ISZERO DUP1 ISZERO PUSH2 0x15B6 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP PUSH1 0x40 MLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP13 DUP2 AND SWAP1 DUP3 AND EQ SWAP10 POP SWAP3 POP PUSH2 0x18D0 SWAP1 POP JUMP JUMPDEST PUSH1 0x3 DUP7 PUSH1 0x7 DUP2 GT ISZERO PUSH2 0x1613 JUMPI INVALID JUMPDEST EQ ISZERO PUSH2 0x17B9 JUMPI DUP9 MLOAD PUSH1 0x41 EQ PUSH2 0x1654 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x54EF JUMP JUMPDEST DUP9 PUSH1 0x0 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1663 JUMPI INVALID JUMPDEST ADD PUSH1 0x20 ADD MLOAD PUSH32 0x100000000000000000000000000000000000000000000000000000000000000 SWAP1 DUP2 SWAP1 DIV DUP2 MUL DIV SWAP5 POP PUSH2 0x16A3 DUP10 PUSH1 0x1 PUSH4 0xFFFFFFFF PUSH2 0x2FED AND JUMP JUMPDEST SWAP4 POP PUSH2 0x16B6 DUP10 PUSH1 0x21 PUSH4 0xFFFFFFFF PUSH2 0x2FED AND JUMP JUMPDEST SWAP3 POP PUSH1 0x1 DUP12 PUSH1 0x40 MLOAD PUSH1 0x20 ADD DUP1 DUP1 PUSH32 0x19457468657265756D205369676E6564204D6573736167653A0A333200000000 DUP2 MSTORE POP PUSH1 0x1C ADD DUP3 PUSH1 0x0 NOT AND PUSH1 0x0 NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE PUSH1 0x40 MLOAD DUP1 DUP3 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT PUSH2 0x1757 JUMPI DUP1 MLOAD DUP3 MSTORE PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 SWAP1 SWAP3 ADD SWAP2 PUSH1 0x20 SWAP2 DUP3 ADD SWAP2 ADD PUSH2 0x171A JUMP JUMPDEST MLOAD DUP2 MLOAD PUSH1 0x20 SWAP4 DUP5 SUB PUSH2 0x100 EXP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD DUP1 NOT SWAP1 SWAP3 AND SWAP2 AND OR SWAP1 MSTORE PUSH1 0x40 DUP1 MLOAD SWAP3 SWAP1 SWAP5 ADD DUP3 SWAP1 SUB DUP3 KECCAK256 PUSH1 0x0 DUP4 MSTORE SWAP2 ADD SWAP3 DUP4 SWAP1 MSTORE PUSH2 0x1592 SWAP5 POP SWAP3 POP DUP10 SWAP2 DUP10 SWAP2 POP DUP9 SWAP1 PUSH2 0x5480 JUMP JUMPDEST PUSH1 0x4 DUP7 PUSH1 0x7 DUP2 GT ISZERO PUSH2 0x17C7 JUMPI INVALID JUMPDEST EQ ISZERO PUSH2 0x17DF JUMPI PUSH2 0x17D8 DUP12 DUP12 DUP12 PUSH2 0x3038 JUMP JUMPDEST SWAP8 POP PUSH2 0x18D0 JUMP JUMPDEST PUSH1 0x5 DUP7 PUSH1 0x7 DUP2 GT ISZERO PUSH2 0x17ED JUMPI INVALID JUMPDEST EQ ISZERO PUSH2 0x1850 JUMPI PUSH2 0x17FC DUP10 PUSH2 0x318D JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP13 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x7 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 SWAP4 DUP6 AND DUP4 MSTORE SWAP3 SWAP1 MSTORE KECCAK256 SLOAD SWAP1 SWAP2 POP PUSH1 0xFF AND ISZERO ISZERO PUSH2 0x1844 JUMPI PUSH1 0x0 SWAP8 POP PUSH2 0x18D0 JUMP JUMPDEST PUSH2 0x17D8 DUP2 DUP13 DUP13 DUP13 PUSH2 0x3206 JUMP JUMPDEST PUSH1 0x6 DUP7 PUSH1 0x7 DUP2 GT ISZERO PUSH2 0x185E JUMPI INVALID JUMPDEST EQ ISZERO PUSH2 0x189E JUMPI PUSH1 0x0 DUP12 DUP2 MSTORE PUSH1 0x6 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP15 AND DUP5 MSTORE SWAP1 SWAP2 MSTORE SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND SWAP8 POP PUSH2 0x18D0 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x554F JUMP JUMPDEST POP POP POP POP POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH2 0x18E6 PUSH2 0x4298 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH2 0x18F6 PUSH2 0x4298 JUMP JUMPDEST DUP10 PUSH1 0x0 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1905 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x140 ADD MLOAD SWAP6 POP DUP10 MLOAD SWAP5 POP PUSH1 0x0 SWAP4 POP JUMPDEST DUP4 DUP6 EQ PUSH2 0x19E4 JUMPI DUP6 DUP11 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1935 JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD MLOAD PUSH2 0x140 ADD MSTORE DUP7 MLOAD PUSH2 0x1951 SWAP1 DUP11 SWAP1 PUSH2 0x2EE2 JUMP JUMPDEST SWAP3 POP PUSH2 0x1994 DUP11 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1964 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH1 0xA0 ADD MLOAD DUP12 DUP7 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1980 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH1 0x80 ADD MLOAD DUP6 PUSH2 0x3362 JUMP JUMPDEST SWAP2 POP PUSH2 0x19C0 DUP11 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x19A7 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP4 DUP11 DUP8 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xE8E JUMPI INVALID JUMPDEST SWAP1 POP PUSH2 0x19CC DUP8 DUP3 PUSH2 0x2532 JUMP JUMPDEST DUP7 MLOAD DUP10 GT PUSH2 0x19D9 JUMPI PUSH2 0x19E4 JUMP JUMPDEST PUSH1 0x1 SWAP1 SWAP4 ADD SWAP3 PUSH2 0x191F JUMP JUMPDEST POP POP POP POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH2 0x19F9 PUSH2 0x4298 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x1A36 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x567F JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR SWAP1 SSTORE PUSH2 0xF9C DUP5 DUP5 DUP5 PUSH2 0x2494 JUMP JUMPDEST PUSH1 0x9 SLOAD PUSH1 0x0 SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND ISZERO PUSH2 0x1ABF JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x567F JUMP JUMPDEST PUSH2 0x1B02 PUSH2 0x1AFD DUP9 DUP9 DUP9 DUP9 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY POP PUSH2 0x33B8 SWAP5 POP POP POP POP POP JUMP JUMPDEST PUSH2 0x35F9 JUMP JUMPDEST PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x8 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD SWAP1 SWAP2 POP PUSH1 0xFF AND ISZERO PUSH2 0x1B4E JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x559F JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP7 AND CALLER EQ PUSH2 0x1C1F JUMPI PUSH2 0x1BA6 DUP2 DUP8 DUP6 DUP6 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY POP PUSH2 0x135B SWAP5 POP POP POP POP POP JUMP JUMPDEST ISZERO ISZERO PUSH2 0x1BDE JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x56DF JUMP JUMPDEST PUSH1 0x9 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP9 AND OR SWAP1 SSTORE JUMPDEST PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x8 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 DUP2 SWAP1 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR SWAP1 SSTORE MLOAD ADDRESS SWAP1 DUP7 SWAP1 DUP7 SWAP1 DUP1 DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP SWAP3 POP POP POP PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP6 GAS DELEGATECALL SWAP2 POP POP ISZERO ISZERO PUSH2 0x1CB6 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x55CF JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP7 AND CALLER EQ PUSH2 0x1CFC JUMPI PUSH1 0x9 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND SWAP1 SSTORE JUMPDEST POP POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x2 SLOAD PUSH1 0x0 SWAP1 DUP2 SWAP1 DUP2 SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0x1D5D JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x568F JUMP JUMPDEST DUP4 SWAP3 POP DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0xAE25532E PUSH1 0x40 MLOAD DUP2 PUSH4 0xFFFFFFFF AND PUSH29 0x100000000000000000000000000000000000000000000000000000000 MUL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x1DC4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x1DD8 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP PUSH2 0x1DFC SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x491E JUMP JUMPDEST PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 DUP2 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0xA PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD SWAP1 SWAP3 POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 POP DUP1 ISZERO PUSH2 0x1E81 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x552F JUMP JUMPDEST PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0xA PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 DUP2 SWAP1 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP7 AND OR SWAP1 SSTORE MLOAD PUSH32 0xD2C6B762299C609BDB96520B58A49BFB80186934D4F71A86A367571A15C03194 SWAP1 PUSH2 0x1F22 SWAP1 DUP5 SWAP1 DUP8 SWAP1 PUSH2 0x54B5 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG1 POP POP POP POP JUMP JUMPDEST PUSH2 0x1F38 PUSH2 0x42F0 JUMP JUMPDEST PUSH2 0x1F41 DUP3 PUSH2 0x3639 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP4 ADD DUP3 SWAP1 MSTORE PUSH1 0x0 SWAP2 DUP3 MSTORE PUSH1 0x3 SWAP1 MSTORE PUSH1 0x40 SWAP1 DUP2 SWAP1 KECCAK256 SLOAD SWAP1 DUP3 ADD MSTORE PUSH1 0x80 DUP3 ADD MLOAD ISZERO ISZERO PUSH2 0x1F75 JUMPI PUSH1 0x1 JUMPDEST PUSH1 0xFF AND DUP2 MSTORE PUSH2 0xF07 JUMP JUMPDEST PUSH1 0xA0 DUP3 ADD MLOAD ISZERO ISZERO PUSH2 0x1F87 JUMPI PUSH1 0x2 PUSH2 0x1F6B JUMP JUMPDEST PUSH1 0xA0 DUP3 ADD MLOAD PUSH1 0x40 DUP3 ADD MLOAD LT PUSH2 0x1F9D JUMPI PUSH1 0x5 PUSH2 0x1F6B JUMP JUMPDEST PUSH2 0x100 DUP3 ADD MLOAD TIMESTAMP LT PUSH2 0x1FB0 JUMPI PUSH1 0x4 PUSH2 0x1F6B JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 ADD MLOAD PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x4 SWAP1 SWAP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x1FD4 JUMPI PUSH1 0x6 PUSH2 0x1F6B JUMP JUMPDEST PUSH2 0x120 DUP3 ADD MLOAD DUP3 MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 DUP2 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x5 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 PUSH1 0x60 DUP9 ADD MLOAD SWAP1 SWAP5 AND DUP4 MSTORE SWAP3 SWAP1 MSTORE KECCAK256 SLOAD GT ISZERO PUSH2 0x2021 JUMPI PUSH1 0x6 PUSH2 0x1F6B JUMP JUMPDEST PUSH1 0x3 DUP2 MSTORE SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x2067 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x567F JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR SWAP1 SSTORE PUSH2 0x209B DUP2 PUSH2 0x2E64 JUMP JUMPDEST POP PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE JUMP JUMPDEST PUSH1 0x5 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x0 SWAP3 DUP4 MSTORE PUSH1 0x40 DUP1 DUP5 KECCAK256 SWAP1 SWAP2 MSTORE SWAP1 DUP3 MSTORE SWAP1 KECCAK256 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x24 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0xF47261B0000000000000000000000000E41D2489571D322189246DAFA5EBDE1F DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x4699F49800000000000000000000000000000000000000000000000000000000 DUP2 MSTORE POP DUP2 JUMP JUMPDEST PUSH2 0x214B PUSH2 0x4298 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x0 DUP1 PUSH1 0x0 PUSH2 0x215A PUSH2 0x4298 JUMP JUMPDEST DUP9 PUSH1 0x0 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x2169 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x160 ADD MLOAD SWAP5 POP DUP9 MLOAD SWAP4 POP PUSH1 0x0 SWAP3 POP JUMPDEST DUP3 DUP5 EQ PUSH2 0x220C JUMPI DUP5 DUP10 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x2199 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x160 ADD DUP2 SWAP1 MSTORE POP PUSH2 0x21B9 DUP9 DUP8 PUSH1 0x20 ADD MLOAD PUSH2 0x2EE2 JUMP JUMPDEST SWAP2 POP PUSH2 0x21E5 DUP10 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x21CC JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP4 DUP10 DUP7 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xE8E JUMPI INVALID JUMPDEST SWAP1 POP PUSH2 0x21F1 DUP7 DUP3 PUSH2 0x2532 JUMP JUMPDEST PUSH1 0x20 DUP7 ADD MLOAD DUP9 GT PUSH2 0x2201 JUMPI PUSH2 0x220C JUMP JUMPDEST PUSH1 0x1 SWAP1 SWAP3 ADD SWAP2 PUSH2 0x2183 JUMP JUMPDEST POP POP POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x1 SLOAD DUP2 JUMP JUMPDEST PUSH2 0x2226 PUSH2 0x4298 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH2 0x2236 PUSH2 0x4298 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0xFF AND ISZERO PUSH2 0x2273 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x567F JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR DUP2 SSTORE DUP11 MLOAD DUP12 SWAP2 SWAP1 DUP2 LT PUSH2 0x22AB JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x140 ADD MLOAD SWAP6 POP DUP10 MLOAD SWAP5 POP PUSH1 0x0 SWAP4 POP JUMPDEST DUP4 DUP6 EQ PUSH2 0x235A JUMPI DUP6 DUP11 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x22DB JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD MLOAD PUSH2 0x140 ADD MSTORE DUP7 MLOAD PUSH2 0x22F7 SWAP1 DUP11 SWAP1 PUSH2 0x2EE2 JUMP JUMPDEST SWAP3 POP PUSH2 0x230A DUP11 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1964 JUMPI INVALID JUMPDEST SWAP2 POP PUSH2 0x2336 DUP11 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x231D JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP4 DUP11 DUP8 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x749 JUMPI INVALID JUMPDEST SWAP1 POP PUSH2 0x2342 DUP8 DUP3 PUSH2 0x2532 JUMP JUMPDEST DUP7 MLOAD DUP10 GT PUSH2 0x234F JUMPI PUSH2 0x235A JUMP JUMPDEST PUSH1 0x1 SWAP1 SWAP4 ADD SWAP3 PUSH2 0x22C5 JUMP JUMPDEST POP POP PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND SWAP1 SSTORE POP SWAP3 SWAP7 SWAP6 POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x9 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x2 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0x23FD JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x568F JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND ISZERO PUSH2 0x245A JUMPI PUSH1 0x2 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND OR SWAP1 SSTORE JUMPDEST POP JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD DUP1 DUP3 ADD SWAP1 SWAP2 MSTORE PUSH1 0x5 DUP2 MSTORE PUSH32 0x322E302E30000000000000000000000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE DUP2 JUMP JUMPDEST PUSH2 0x249C PUSH2 0x4298 JUMP JUMPDEST PUSH2 0x24A4 PUSH2 0x42F0 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH2 0x24B2 DUP9 PUSH2 0x1F30 JUMP JUMPDEST SWAP4 POP PUSH2 0x24BC PUSH2 0x2594 JUMP JUMPDEST SWAP3 POP PUSH2 0x24CA DUP9 DUP6 DUP6 DUP10 PUSH2 0x25C6 JUMP JUMPDEST PUSH2 0x24DC DUP9 PUSH1 0xA0 ADD MLOAD DUP6 PUSH1 0x40 ADD MLOAD PUSH2 0x2EE2 JUMP JUMPDEST SWAP2 POP PUSH2 0x24E8 DUP8 DUP4 PUSH2 0x3647 JUMP JUMPDEST SWAP1 POP PUSH2 0x24FB DUP9 DUP6 DUP10 DUP5 DUP10 PUSH1 0x0 ADD MLOAD PUSH2 0x2945 JUMP JUMPDEST PUSH2 0x2505 DUP9 DUP3 PUSH2 0x365D JUMP JUMPDEST SWAP5 POP PUSH2 0x251C DUP9 DUP5 DUP7 PUSH1 0x20 ADD MLOAD DUP8 PUSH1 0x40 ADD MLOAD DUP10 PUSH2 0x2A5E JUMP JUMPDEST PUSH2 0x2527 DUP9 DUP5 DUP8 PUSH2 0x36BE JUMP JUMPDEST POP POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST DUP2 MLOAD DUP2 MLOAD PUSH2 0x2540 SWAP2 SWAP1 PUSH2 0x3776 JUMP JUMPDEST DUP3 MSTORE PUSH1 0x20 DUP1 DUP4 ADD MLOAD SWAP1 DUP3 ADD MLOAD PUSH2 0x2556 SWAP2 SWAP1 PUSH2 0x3776 JUMP JUMPDEST PUSH1 0x20 DUP4 ADD MSTORE PUSH1 0x40 DUP1 DUP4 ADD MLOAD SWAP1 DUP3 ADD MLOAD PUSH2 0x256F SWAP2 SWAP1 PUSH2 0x3776 JUMP JUMPDEST PUSH1 0x40 DUP4 ADD MSTORE PUSH1 0x60 DUP1 DUP4 ADD MLOAD SWAP1 DUP3 ADD MLOAD PUSH2 0x2588 SWAP2 SWAP1 PUSH2 0x3776 JUMP JUMPDEST PUSH1 0x60 SWAP1 SWAP3 ADD SWAP2 SWAP1 SWAP2 MSTORE POP JUMP JUMPDEST PUSH1 0x9 SLOAD PUSH1 0x0 SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 DUP2 ISZERO PUSH2 0x25BD JUMPI DUP2 PUSH2 0x25BF JUMP JUMPDEST CALLER JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST DUP3 MLOAD PUSH1 0xFF AND PUSH1 0x3 EQ PUSH2 0x2604 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x56AF JUMP JUMPDEST PUSH1 0x60 DUP5 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND ISZERO PUSH2 0x2677 JUMPI PUSH1 0x60 DUP5 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0x2677 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x56BF JUMP JUMPDEST PUSH1 0x20 DUP5 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND ISZERO PUSH2 0x2702 JUMPI DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP5 PUSH1 0x20 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x2702 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x54FF JUMP JUMPDEST PUSH1 0x40 DUP4 ADD MLOAD ISZERO ISZERO PUSH2 0x2758 JUMPI PUSH2 0x2720 DUP4 PUSH1 0x20 ADD MLOAD DUP6 PUSH1 0x0 ADD MLOAD DUP4 PUSH2 0x135B JUMP JUMPDEST ISZERO ISZERO PUSH2 0x2758 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x556F JUMP JUMPDEST POP POP POP POP JUMP JUMPDEST PUSH2 0x2770 DUP3 PUSH1 0xA0 ADD MLOAD DUP3 PUSH1 0xA0 ADD MLOAD PUSH2 0x37C0 JUMP JUMPDEST PUSH2 0x2782 DUP4 PUSH1 0x80 ADD MLOAD DUP4 PUSH1 0x80 ADD MLOAD PUSH2 0x37C0 JUMP JUMPDEST LT ISZERO PUSH2 0x27BA JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x56CF JUMP JUMPDEST POP POP JUMP JUMPDEST PUSH2 0x27C6 PUSH2 0x42C1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH2 0x27DA DUP10 PUSH1 0xA0 ADD MLOAD DUP9 PUSH2 0x2EE2 JUMP JUMPDEST SWAP4 POP PUSH2 0x27EF DUP10 PUSH1 0x80 ADD MLOAD DUP11 PUSH1 0xA0 ADD MLOAD DUP7 PUSH2 0x381B JUMP JUMPDEST SWAP3 POP PUSH2 0x27FF DUP9 PUSH1 0xA0 ADD MLOAD DUP8 PUSH2 0x2EE2 JUMP JUMPDEST SWAP2 POP PUSH2 0x2814 DUP9 PUSH1 0x80 ADD MLOAD DUP10 PUSH1 0xA0 ADD MLOAD DUP5 PUSH2 0x381B JUMP JUMPDEST SWAP1 POP DUP1 DUP5 LT PUSH2 0x2857 JUMPI PUSH1 0x20 DUP1 DUP7 ADD DUP1 MLOAD DUP4 SWAP1 MSTORE DUP1 MLOAD DUP3 ADD DUP5 SWAP1 MSTORE MLOAD MLOAD DUP7 MLOAD DUP3 ADD MSTORE PUSH1 0x80 DUP11 ADD MLOAD PUSH1 0xA0 DUP12 ADD MLOAD DUP8 MLOAD SWAP1 SWAP3 ADD MLOAD PUSH2 0x284F SWAP3 SWAP1 PUSH2 0x381B JUMP JUMPDEST DUP6 MLOAD MSTORE PUSH2 0x2894 JUMP JUMPDEST DUP5 MLOAD DUP4 SWAP1 MSTORE DUP5 MLOAD PUSH1 0x20 SWAP1 DUP2 ADD DUP6 SWAP1 MSTORE DUP6 MLOAD DUP2 ADD MLOAD SWAP1 DUP7 ADD DUP1 MLOAD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0xA0 DUP10 ADD MLOAD PUSH1 0x80 DUP11 ADD MLOAD SWAP2 MLOAD MLOAD PUSH2 0x288B SWAP3 SWAP1 PUSH2 0x3898 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP8 ADD MLOAD ADD MSTORE JUMPDEST DUP5 MLOAD MLOAD PUSH1 0x20 DUP1 DUP8 ADD MLOAD ADD MLOAD PUSH2 0x28A9 SWAP2 SWAP1 PUSH2 0x2EE2 JUMP JUMPDEST PUSH1 0x40 DUP7 ADD MSTORE DUP5 MLOAD MLOAD PUSH1 0x80 DUP11 ADD MLOAD PUSH1 0xC0 DUP12 ADD MLOAD PUSH2 0x28C6 SWAP3 SWAP2 SWAP1 PUSH2 0x381B JUMP JUMPDEST DUP6 MLOAD PUSH1 0x40 ADD MSTORE DUP5 MLOAD PUSH1 0x20 ADD MLOAD PUSH1 0xA0 DUP11 ADD MLOAD PUSH1 0xE0 DUP12 ADD MLOAD PUSH2 0x28E7 SWAP3 SWAP2 SWAP1 PUSH2 0x381B JUMP JUMPDEST DUP6 MLOAD PUSH1 0x60 ADD MSTORE PUSH1 0x20 DUP6 ADD MLOAD MLOAD PUSH1 0x80 DUP10 ADD MLOAD PUSH1 0xC0 DUP11 ADD MLOAD PUSH2 0x2908 SWAP3 SWAP2 SWAP1 PUSH2 0x381B JUMP JUMPDEST DUP6 PUSH1 0x20 ADD MLOAD PUSH1 0x40 ADD DUP2 DUP2 MSTORE POP POP PUSH2 0x2930 DUP6 PUSH1 0x20 ADD MLOAD PUSH1 0x20 ADD MLOAD DUP10 PUSH1 0xA0 ADD MLOAD DUP11 PUSH1 0xE0 ADD MLOAD PUSH2 0x381B JUMP JUMPDEST PUSH1 0x20 DUP7 ADD MLOAD PUSH1 0x60 ADD MSTORE POP POP POP POP SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST DUP3 ISZERO ISZERO PUSH2 0x297E JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x55EF JUMP JUMPDEST DUP3 DUP3 GT ISZERO PUSH2 0x29B8 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x55DF JUMP JUMPDEST DUP5 PUSH1 0xA0 ADD MLOAD PUSH2 0x29CB DUP6 PUSH1 0x40 ADD MLOAD DUP5 PUSH2 0x3776 JUMP JUMPDEST GT ISZERO PUSH2 0x2A03 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x550F JUMP JUMPDEST PUSH2 0x2A11 DUP6 PUSH1 0x80 ADD MLOAD DUP4 PUSH2 0x37C0 JUMP JUMPDEST PUSH2 0x2A1F DUP3 DUP8 PUSH1 0xA0 ADD MLOAD PUSH2 0x37C0 JUMP JUMPDEST GT ISZERO PUSH2 0x2A57 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x566F JUMP JUMPDEST POP POP POP POP POP JUMP JUMPDEST PUSH2 0x2A6C DUP3 DUP3 PUSH1 0x20 ADD MLOAD PUSH2 0x3776 JUMP JUMPDEST PUSH1 0x0 DUP5 DUP2 MSTORE PUSH1 0x3 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP2 DUP3 SWAP1 KECCAK256 SWAP3 SWAP1 SWAP3 SSTORE DUP7 DUP2 ADD MLOAD DUP8 MLOAD DUP5 MLOAD SWAP4 DUP6 ADD MLOAD DUP6 DUP5 ADD MLOAD PUSH1 0x60 DUP8 ADD MLOAD PUSH2 0x140 DUP13 ADD MLOAD PUSH2 0x160 DUP14 ADD MLOAD SWAP7 MLOAD DUP12 SWAP9 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP8 DUP9 AND SWAP9 SWAP8 SWAP1 SWAP7 AND SWAP7 PUSH32 0xBCC4C97732E47D9946F229EDB95F5B6323F601300E4690DE719993F3C371129 SWAP7 PUSH2 0x2AFB SWAP7 DUP16 SWAP7 CALLER SWAP7 SWAP3 SWAP6 SWAP2 SWAP5 SWAP1 SWAP4 SWAP1 PUSH2 0x5345 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG4 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x60 DUP1 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x24 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0xF47261B0000000000000000000000000E41D2489571D322189246DAFA5EBDE1F DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x4699F49800000000000000000000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 POP PUSH2 0x2B8B DUP6 PUSH2 0x140 ADD MLOAD DUP7 PUSH1 0x0 ADD MLOAD DUP7 PUSH1 0x0 ADD MLOAD DUP6 PUSH1 0x20 ADD MLOAD PUSH1 0x20 ADD MLOAD PUSH2 0x3935 JUMP JUMPDEST PUSH2 0x140 DUP5 ADD MLOAD DUP5 MLOAD DUP7 MLOAD DUP5 MLOAD PUSH1 0x20 ADD MLOAD PUSH2 0x2BA7 SWAP4 SWAP3 SWAP2 SWAP1 PUSH2 0x3935 JUMP JUMPDEST PUSH2 0x2BC0 DUP6 PUSH2 0x140 ADD MLOAD DUP7 PUSH1 0x0 ADD MLOAD DUP6 DUP6 PUSH1 0x40 ADD MLOAD PUSH2 0x3935 JUMP JUMPDEST PUSH2 0x2BDC DUP2 DUP7 PUSH1 0x0 ADD MLOAD DUP8 PUSH1 0x40 ADD MLOAD DUP6 PUSH1 0x0 ADD MLOAD PUSH1 0x40 ADD MLOAD PUSH2 0x3935 JUMP JUMPDEST PUSH2 0x2BF8 DUP2 DUP6 PUSH1 0x0 ADD MLOAD DUP7 PUSH1 0x40 ADD MLOAD DUP6 PUSH1 0x20 ADD MLOAD PUSH1 0x40 ADD MLOAD PUSH2 0x3935 JUMP JUMPDEST DUP4 PUSH1 0x40 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP6 PUSH1 0x40 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0x2C62 JUMPI PUSH2 0x2C5D DUP2 DUP5 DUP8 PUSH1 0x40 ADD MLOAD PUSH2 0x2C58 DUP7 PUSH1 0x0 ADD MLOAD PUSH1 0x60 ADD MLOAD DUP8 PUSH1 0x20 ADD MLOAD PUSH1 0x60 ADD MLOAD PUSH2 0x3776 JUMP JUMPDEST PUSH2 0x3935 JUMP JUMPDEST PUSH2 0x2A57 JUMP JUMPDEST PUSH2 0x2C7A DUP2 DUP5 DUP8 PUSH1 0x40 ADD MLOAD DUP6 PUSH1 0x0 ADD MLOAD PUSH1 0x60 ADD MLOAD PUSH2 0x3935 JUMP JUMPDEST PUSH2 0x2A57 DUP2 DUP5 DUP7 PUSH1 0x40 ADD MLOAD DUP6 PUSH1 0x20 ADD MLOAD PUSH1 0x60 ADD MLOAD PUSH2 0x3935 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0xB4BE83D500000000000000000000000000000000000000000000000000000000 PUSH1 0x20 DUP1 DUP4 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x60 PUSH1 0x24 DUP4 ADD DUP2 DUP2 MSTORE DUP8 MLOAD PUSH1 0x84 DUP6 ADD SWAP1 DUP2 MSTORE DUP9 DUP5 ADD MLOAD PUSH1 0xA4 DUP7 ADD MSTORE SWAP5 DUP9 ADD MLOAD PUSH1 0xC4 DUP6 ADD MSTORE SWAP1 DUP8 ADD MLOAD PUSH1 0xE4 DUP5 ADD MSTORE PUSH1 0x80 DUP8 ADD MLOAD PUSH2 0x104 DUP5 ADD MSTORE PUSH1 0xA0 DUP8 ADD MLOAD PUSH2 0x124 DUP5 ADD MSTORE PUSH1 0xC0 DUP8 ADD MLOAD PUSH2 0x144 DUP5 ADD MSTORE PUSH1 0xE0 DUP8 ADD MLOAD PUSH2 0x164 DUP5 ADD MSTORE PUSH2 0x100 DUP8 ADD MLOAD PUSH2 0x184 DUP5 ADD MSTORE PUSH2 0x120 DUP8 ADD MLOAD PUSH2 0x1A4 DUP5 ADD MSTORE PUSH2 0x140 DUP8 ADD DUP1 MLOAD PUSH2 0x1C4 DUP6 ADD SWAP1 DUP2 MSTORE PUSH2 0x160 DUP10 ADD MLOAD PUSH2 0x1E4 DUP7 ADD MSTORE PUSH2 0x180 SWAP1 MSTORE MLOAD DUP1 MLOAD PUSH2 0x204 DUP6 ADD DUP2 SWAP1 MSTORE SWAP4 SWAP5 SWAP2 SWAP4 DUP5 SWAP4 PUSH1 0x44 DUP8 ADD SWAP3 DUP5 SWAP3 PUSH2 0x224 DUP10 ADD SWAP3 SWAP2 DUP3 ADD SWAP2 PUSH1 0x1F DUP3 ADD DIV PUSH1 0x0 JUMPDEST DUP2 DUP2 LT ISZERO PUSH2 0x2D99 JUMPI DUP4 MLOAD DUP6 MSTORE PUSH1 0x20 SWAP5 DUP6 ADD SWAP5 SWAP1 SWAP4 ADD SWAP3 PUSH1 0x1 ADD PUSH2 0x2D7B JUMP JUMPDEST POP POP POP POP DUP2 DUP2 SUB PUSH2 0x160 DUP1 DUP5 ADD SWAP2 SWAP1 SWAP2 MSTORE DUP11 ADD MLOAD DUP1 MLOAD DUP1 DUP4 MSTORE PUSH1 0x20 SWAP3 DUP4 ADD SWAP3 SWAP2 DUP3 ADD SWAP2 PUSH1 0x1F DUP3 ADD DIV PUSH1 0x0 JUMPDEST DUP2 DUP2 LT ISZERO PUSH2 0x2DE2 JUMPI DUP4 MLOAD DUP6 MSTORE PUSH1 0x20 SWAP5 DUP6 ADD SWAP5 SWAP1 SWAP4 ADD SWAP3 PUSH1 0x1 ADD PUSH2 0x2DC4 JUMP JUMPDEST POP POP POP DUP10 DUP5 MSTORE POP DUP5 DUP2 SUB PUSH1 0x20 SWAP4 DUP5 ADD SWAP1 DUP2 MSTORE DUP9 MLOAD DUP1 DUP4 MSTORE SWAP1 SWAP4 SWAP2 DUP3 ADD SWAP2 DUP10 DUP2 ADD SWAP2 SWAP1 PUSH1 0x1F DUP3 ADD DIV PUSH1 0x0 JUMPDEST DUP2 DUP2 LT ISZERO PUSH2 0x2E2A JUMPI DUP4 MLOAD DUP6 MSTORE PUSH1 0x20 SWAP5 DUP6 ADD SWAP5 SWAP1 SWAP4 ADD SWAP3 PUSH1 0x1 ADD PUSH2 0x2E0C JUMP JUMPDEST POP POP POP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 DUP9 DUP4 SUB ADD DUP9 MSTORE POP PUSH1 0x40 MSTORE POP POP POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH2 0x2E6C PUSH2 0x42F0 JUMP JUMPDEST PUSH2 0x2E75 DUP3 PUSH2 0x1F30 JUMP JUMPDEST SWAP1 POP PUSH2 0x2E81 DUP3 DUP3 PUSH2 0x3AFF JUMP JUMPDEST PUSH2 0x27BA DUP3 DUP3 PUSH1 0x20 ADD MLOAD PUSH2 0x3C16 JUMP JUMPDEST PUSH2 0x2E97 PUSH2 0x4298 JUMP JUMPDEST PUSH2 0x2EA2 DUP5 DUP5 DUP5 PUSH2 0x2494 JUMP JUMPDEST PUSH1 0x20 DUP2 ADD MLOAD SWAP1 SWAP2 POP DUP4 EQ PUSH2 0x25BF JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x565F JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 GT ISZERO PUSH2 0x2F1E JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x551F JUMP JUMPDEST POP DUP1 DUP3 SUB JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP3 MLOAD GT ISZERO ISZERO PUSH2 0x2F67 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x560F JUMP JUMPDEST DUP2 MLOAD DUP3 SWAP1 PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 ADD SWAP1 DUP2 LT PUSH2 0x2F97 JUMPI INVALID JUMPDEST ADD PUSH1 0x20 ADD MLOAD DUP3 MLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 SWAP3 MSTORE POP PUSH32 0x100000000000000000000000000000000000000000000000000000000000000 SWAP1 DUP2 SWAP1 DIV MUL SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x20 ADD DUP4 MLOAD LT ISZERO ISZERO ISZERO PUSH2 0x302F JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x553F JUMP JUMPDEST POP ADD PUSH1 0x20 ADD MLOAD SWAP1 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x0 SWAP1 PUSH1 0x60 SWAP1 PUSH32 0x1626BA7E00000000000000000000000000000000000000000000000000000000 SWAP1 PUSH2 0x3073 SWAP1 DUP8 SWAP1 DUP7 SWAP1 PUSH1 0x24 ADD PUSH2 0x5460 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 DUP2 DUP5 SUB ADD DUP2 MSTORE SWAP2 SWAP1 MSTORE PUSH1 0x20 DUP1 DUP3 ADD DUP1 MLOAD PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 SWAP1 SWAP5 AND SWAP4 SWAP1 SWAP4 OR DUP4 MSTORE DUP2 MLOAD SWAP2 SWAP4 POP SWAP1 DUP3 SWAP1 DUP2 DUP9 GAS STATICCALL DUP1 DUP1 ISZERO PUSH2 0x3110 JUMPI PUSH1 0x1 DUP2 EQ PUSH2 0x3181 JUMPI PUSH2 0x2527 JUMP JUMPDEST PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH29 0x2000000000000000000000000000000000000000000000000000000000 PUSH1 0x20 MSTORE PUSH29 0xC57414C4C45545F4552524F5200000000000000000000000000000000 PUSH1 0x40 MSTORE PUSH1 0x0 PUSH1 0x60 MSTORE PUSH1 0x64 PUSH1 0x0 REVERT JUMPDEST POP POP MLOAD SWAP6 SWAP5 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x14 DUP3 MLOAD LT ISZERO ISZERO ISZERO PUSH2 0x31CD JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x569F JUMP JUMPDEST PUSH2 0x31DB DUP3 PUSH1 0x14 DUP5 MLOAD SUB PUSH2 0x3CBD JUMP JUMPDEST DUP3 MLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEC ADD SWAP1 SWAP3 MSTORE POP SWAP1 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x0 SWAP1 PUSH1 0x60 SWAP1 PUSH32 0x9363470200000000000000000000000000000000000000000000000000000000 SWAP1 PUSH2 0x3243 SWAP1 DUP8 SWAP1 DUP8 SWAP1 DUP8 SWAP1 PUSH1 0x24 ADD PUSH2 0x5433 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 DUP2 DUP5 SUB ADD DUP2 MSTORE SWAP2 SWAP1 MSTORE PUSH1 0x20 DUP1 DUP3 ADD DUP1 MLOAD PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 SWAP1 SWAP5 AND SWAP4 SWAP1 SWAP4 OR DUP4 MSTORE DUP2 MLOAD SWAP2 SWAP4 POP SWAP1 DUP3 SWAP1 DUP2 DUP11 GAS STATICCALL DUP1 DUP1 ISZERO PUSH2 0x32E0 JUMPI PUSH1 0x1 DUP2 EQ PUSH2 0x3351 JUMPI PUSH2 0x3356 JUMP JUMPDEST PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH29 0x2000000000000000000000000000000000000000000000000000000000 PUSH1 0x20 MSTORE PUSH29 0xF56414C494441544F525F4552524F5200000000000000000000000000 PUSH1 0x40 MSTORE PUSH1 0x0 PUSH1 0x60 MSTORE PUSH1 0x64 PUSH1 0x0 REVERT JUMPDEST DUP3 MLOAD SWAP5 POP JUMPDEST POP POP POP POP SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP4 GT PUSH2 0x339D JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x555F JUMP JUMPDEST PUSH2 0x33B0 PUSH2 0x33AA DUP6 DUP5 PUSH2 0x37C0 JUMP JUMPDEST DUP5 PUSH2 0x3D1E JUMP JUMPDEST SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0x5A65726F45785472616E73616374696F6E280000000000000000000000000000 PUSH1 0x20 DUP1 DUP4 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH32 0x75696E743235362073616C742C00000000000000000000000000000000000000 PUSH1 0x32 DUP4 ADD MSTORE PUSH32 0x61646472657373207369676E6572416464726573732C00000000000000000000 PUSH1 0x3F DUP4 ADD MSTORE PUSH32 0x6279746573206461746100000000000000000000000000000000000000000000 PUSH1 0x55 DUP4 ADD MSTORE PUSH32 0x2900000000000000000000000000000000000000000000000000000000000000 PUSH1 0x5F DUP4 ADD MSTORE DUP3 MLOAD DUP1 DUP4 SUB DUP5 ADD DUP2 MSTORE PUSH1 0x60 SWAP1 SWAP3 ADD SWAP3 DUP4 SWAP1 MSTORE DUP2 MLOAD PUSH1 0x0 SWAP4 DUP5 SWAP4 DUP5 SWAP4 SWAP1 SWAP3 DUP3 SWAP2 DUP5 ADD SWAP1 DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT PUSH2 0x34E1 JUMPI DUP1 MLOAD DUP3 MSTORE PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 SWAP1 SWAP3 ADD SWAP2 PUSH1 0x20 SWAP2 DUP3 ADD SWAP2 ADD PUSH2 0x34A4 JUMP JUMPDEST MLOAD DUP2 MLOAD PUSH1 0x20 SWAP4 DUP5 SUB PUSH2 0x100 EXP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD DUP1 NOT SWAP1 SWAP3 AND SWAP2 AND OR SWAP1 MSTORE PUSH1 0x40 MLOAD SWAP2 SWAP1 SWAP4 ADD DUP2 SWAP1 SUB DUP2 KECCAK256 DUP10 MLOAD SWAP1 SWAP8 POP DUP10 SWAP6 POP SWAP1 SWAP4 POP DUP4 SWAP3 DUP6 ADD SWAP2 POP DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT PUSH2 0x3577 JUMPI DUP1 MLOAD DUP3 MSTORE PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 SWAP1 SWAP3 ADD SWAP2 PUSH1 0x20 SWAP2 DUP3 ADD SWAP2 ADD PUSH2 0x353A JUMP JUMPDEST MLOAD DUP2 MLOAD PUSH1 0x20 SWAP4 DUP5 SUB PUSH2 0x100 EXP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD DUP1 NOT SWAP1 SWAP3 AND SWAP2 AND OR SWAP1 MSTORE PUSH1 0x40 DUP1 MLOAD SWAP3 SWAP1 SWAP5 ADD DUP3 SWAP1 SUB DUP3 KECCAK256 SWAP8 DUP3 MSTORE DUP2 ADD SWAP11 SWAP1 SWAP11 MSTORE POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP8 SWAP1 SWAP8 AND SWAP7 DUP9 ADD SWAP7 SWAP1 SWAP7 MSTORE POP POP PUSH1 0x60 DUP6 ADD MSTORE POP POP PUSH1 0x80 SWAP1 SWAP2 KECCAK256 SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x1 SLOAD PUSH1 0x40 MLOAD PUSH32 0x1901000000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x2 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x22 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x42 SWAP1 KECCAK256 SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x2F23 PUSH2 0x1AFD DUP4 PUSH2 0x3D35 JUMP JUMPDEST PUSH1 0x0 DUP2 DUP4 LT PUSH2 0x3656 JUMPI DUP2 PUSH2 0x25BF JUMP JUMPDEST POP SWAP1 SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0x3665 PUSH2 0x4298 JUMP JUMPDEST PUSH1 0x20 DUP2 ADD DUP3 SWAP1 MSTORE PUSH1 0xA0 DUP4 ADD MLOAD PUSH1 0x80 DUP5 ADD MLOAD PUSH2 0x3681 SWAP2 DUP5 SWAP2 PUSH2 0x381B JUMP JUMPDEST DUP1 DUP3 MSTORE PUSH1 0x80 DUP5 ADD MLOAD PUSH1 0xC0 DUP6 ADD MLOAD PUSH2 0x3699 SWAP3 SWAP2 SWAP1 PUSH2 0x381B JUMP JUMPDEST PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0xA0 DUP4 ADD MLOAD PUSH1 0xE0 DUP5 ADD MLOAD PUSH2 0x36B3 SWAP2 DUP5 SWAP2 PUSH2 0x381B JUMP JUMPDEST PUSH1 0x60 DUP3 ADD MSTORE SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x60 DUP2 ADD DUP3 MSTORE PUSH1 0x24 DUP2 MSTORE PUSH32 0xF47261B0000000000000000000000000E41D2489571D322189246DAFA5EBDE1F PUSH1 0x20 DUP3 ADD MSTORE PUSH32 0x4699F49800000000000000000000000000000000000000000000000000000000 SWAP2 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH2 0x140 DUP5 ADD MLOAD DUP5 MLOAD DUP4 MLOAD PUSH2 0x3731 SWAP3 SWAP2 SWAP1 DUP7 SWAP1 PUSH2 0x3935 JUMP JUMPDEST PUSH2 0x374A DUP5 PUSH2 0x160 ADD MLOAD DUP5 DUP7 PUSH1 0x0 ADD MLOAD DUP6 PUSH1 0x20 ADD MLOAD PUSH2 0x3935 JUMP JUMPDEST PUSH2 0x3762 DUP2 DUP6 PUSH1 0x0 ADD MLOAD DUP7 PUSH1 0x40 ADD MLOAD DUP6 PUSH1 0x40 ADD MLOAD PUSH2 0x3935 JUMP JUMPDEST PUSH2 0x2758 DUP2 DUP5 DUP7 PUSH1 0x40 ADD MLOAD DUP6 PUSH1 0x60 ADD MLOAD PUSH2 0x3935 JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 ADD DUP4 DUP2 LT ISZERO PUSH2 0x37B5 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x558F JUMP JUMPDEST DUP1 SWAP2 POP JUMPDEST POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP4 ISZERO ISZERO PUSH2 0x37D3 JUMPI PUSH1 0x0 SWAP2 POP PUSH2 0x37B9 JUMP JUMPDEST POP DUP3 DUP3 MUL DUP3 DUP5 DUP3 DUP2 ISZERO ISZERO PUSH2 0x37E3 JUMPI INVALID JUMPDEST DIV EQ PUSH2 0x37B5 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x558F JUMP JUMPDEST PUSH1 0x0 DUP1 DUP4 GT PUSH2 0x3856 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x555F JUMP JUMPDEST PUSH2 0x3861 DUP5 DUP5 DUP5 PUSH2 0x418E JUMP JUMPDEST ISZERO PUSH2 0x339D JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x55BF JUMP JUMPDEST PUSH1 0x0 DUP1 DUP4 GT PUSH2 0x38D3 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x555F JUMP JUMPDEST PUSH2 0x38DE DUP5 DUP5 DUP5 PUSH2 0x4213 JUMP JUMPDEST ISZERO PUSH2 0x3915 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x55BF JUMP JUMPDEST PUSH2 0x33B0 PUSH2 0x33AA PUSH2 0x3925 DUP7 DUP6 PUSH2 0x37C0 JUMP JUMPDEST PUSH2 0x3930 DUP7 PUSH1 0x1 PUSH2 0x2EE2 JUMP JUMPDEST PUSH2 0x3776 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP4 GT DUP1 ISZERO PUSH2 0x3974 JUMPI POP DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO JUMPDEST ISZERO PUSH2 0x3AF7 JUMPI DUP6 MLOAD PUSH1 0x3 LT PUSH2 0x39B4 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x564F JUMP JUMPDEST POP POP PUSH1 0x20 DUP5 DUP2 ADD MLOAD PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0xA SWAP1 SWAP3 MSTORE PUSH1 0x40 SWAP1 SWAP2 KECCAK256 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP1 ISZERO ISZERO PUSH2 0x3A3D JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x55FF JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH7 0xFFFFFFFFFFFE0 PUSH1 0x3F DUP9 MLOAD ADD AND DUP1 PUSH1 0x84 ADD DUP3 ADD PUSH32 0xA85E59E400000000000000000000000000000000000000000000000000000000 DUP4 MSTORE PUSH1 0x80 PUSH1 0x4 DUP5 ADD MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP9 AND PUSH1 0x24 DUP5 ADD MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 AND PUSH1 0x44 DUP5 ADD MSTORE DUP6 PUSH1 0x64 DUP5 ADD MSTORE PUSH1 0x84 DUP4 ADD JUMPDEST DUP2 DUP2 LT ISZERO PUSH2 0x3AD9 JUMPI DUP10 MLOAD DUP2 MSTORE PUSH1 0x20 SWAP10 DUP11 ADD SWAP10 ADD PUSH2 0x3AC1 JUMP JUMPDEST PUSH2 0x200 DUP5 DUP6 DUP5 SUB DUP7 PUSH1 0x0 DUP10 GAS CALL DUP1 ISZERO ISZERO PUSH2 0x3AF1 JUMPI RETURNDATASIZE DUP6 REVERT JUMPDEST POP POP POP POP POP JUMPDEST POP POP POP POP POP POP JUMP JUMPDEST DUP1 MLOAD PUSH1 0x0 SWAP1 PUSH1 0xFF AND PUSH1 0x3 EQ PUSH2 0x3B40 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x56AF JUMP JUMPDEST PUSH1 0x60 DUP4 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND ISZERO PUSH2 0x3BB3 JUMPI PUSH1 0x60 DUP4 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0x3BB3 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x56BF JUMP JUMPDEST PUSH2 0x3BBB PUSH2 0x2594 JUMP JUMPDEST DUP4 MLOAD SWAP1 SWAP2 POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP4 AND SWAP2 AND EQ PUSH2 0x3C11 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x557F JUMP JUMPDEST POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x4 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 DUP2 SWAP1 KECCAK256 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 AND PUSH1 0x1 OR SWAP1 SSTORE DUP3 DUP2 ADD MLOAD DUP4 MLOAD PUSH2 0x140 DUP6 ADD MLOAD PUSH2 0x160 DUP7 ADD MLOAD SWAP4 MLOAD DUP6 SWAP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP5 DUP6 AND SWAP5 SWAP4 SWAP1 SWAP4 AND SWAP3 PUSH32 0xDC47B3613D9FE400085F6DBDC99453462279057E6207385042827ED6B1A62CF7 SWAP3 PUSH2 0x3CB1 SWAP3 CALLER SWAP3 SWAP1 PUSH2 0x53C9 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG4 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x14 ADD DUP4 MLOAD LT ISZERO ISZERO ISZERO PUSH2 0x3CFF JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x569F JUMP JUMPDEST POP ADD PUSH1 0x14 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 DUP3 DUP5 DUP2 ISZERO ISZERO PUSH2 0x3D2C JUMPI INVALID JUMPDEST DIV SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0x4F72646572280000000000000000000000000000000000000000000000000000 PUSH1 0x20 DUP1 DUP4 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH32 0x61646472657373206D616B6572416464726573732C0000000000000000000000 PUSH1 0x26 DUP4 ADD MSTORE PUSH32 0x616464726573732074616B6572416464726573732C0000000000000000000000 PUSH1 0x3B DUP4 ADD MSTORE PUSH32 0x6164647265737320666565526563697069656E74416464726573732C00000000 PUSH1 0x50 DUP4 ADD MSTORE PUSH32 0x616464726573732073656E646572416464726573732C00000000000000000000 PUSH1 0x6C DUP4 ADD MSTORE PUSH32 0x75696E74323536206D616B65724173736574416D6F756E742C00000000000000 PUSH1 0x82 DUP4 ADD MSTORE PUSH32 0x75696E743235362074616B65724173736574416D6F756E742C00000000000000 PUSH1 0x9B DUP4 ADD MSTORE PUSH32 0x75696E74323536206D616B65724665652C000000000000000000000000000000 PUSH1 0xB4 DUP4 ADD MSTORE PUSH32 0x75696E743235362074616B65724665652C000000000000000000000000000000 PUSH1 0xC5 DUP4 ADD MSTORE PUSH32 0x75696E743235362065787069726174696F6E54696D655365636F6E64732C0000 PUSH1 0xD6 DUP4 ADD MSTORE PUSH32 0x75696E743235362073616C742C00000000000000000000000000000000000000 PUSH1 0xF4 DUP4 ADD MSTORE PUSH32 0x6279746573206D616B65724173736574446174612C0000000000000000000000 PUSH2 0x101 DUP4 ADD MSTORE PUSH32 0x62797465732074616B6572417373657444617461000000000000000000000000 PUSH2 0x116 DUP4 ADD MSTORE PUSH32 0x2900000000000000000000000000000000000000000000000000000000000000 PUSH2 0x12A DUP4 ADD MSTORE DUP3 MLOAD PUSH2 0x10B DUP2 DUP5 SUB ADD DUP2 MSTORE PUSH2 0x12B SWAP1 SWAP3 ADD SWAP3 DUP4 SWAP1 MSTORE DUP2 MLOAD PUSH1 0x0 SWAP4 DUP5 SWAP4 DUP5 SWAP4 DUP5 SWAP4 SWAP2 SWAP3 SWAP2 DUP3 SWAP2 DUP5 ADD SWAP1 DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT PUSH2 0x3FBD JUMPI DUP1 MLOAD DUP3 MSTORE PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 SWAP1 SWAP3 ADD SWAP2 PUSH1 0x20 SWAP2 DUP3 ADD SWAP2 ADD PUSH2 0x3F80 JUMP JUMPDEST MLOAD DUP2 MLOAD PUSH1 0x20 SWAP4 DUP5 SUB PUSH2 0x100 EXP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD DUP1 NOT SWAP1 SWAP3 AND SWAP2 AND OR SWAP1 MSTORE PUSH1 0x40 MLOAD SWAP2 SWAP1 SWAP4 ADD DUP2 SWAP1 SUB DUP2 KECCAK256 PUSH2 0x140 DUP12 ADD MLOAD DUP1 MLOAD SWAP2 SWAP10 POP SWAP6 POP SWAP1 SWAP4 POP DUP4 SWAP3 DUP6 ADD SWAP2 POP DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT PUSH2 0x4058 JUMPI DUP1 MLOAD DUP3 MSTORE PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 SWAP1 SWAP3 ADD SWAP2 PUSH1 0x20 SWAP2 DUP3 ADD SWAP2 ADD PUSH2 0x401B JUMP JUMPDEST MLOAD DUP2 MLOAD PUSH1 0x20 SWAP4 DUP5 SUB PUSH2 0x100 EXP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD DUP1 NOT SWAP1 SWAP3 AND SWAP2 AND OR SWAP1 MSTORE PUSH1 0x40 MLOAD SWAP2 SWAP1 SWAP4 ADD DUP2 SWAP1 SUB DUP2 KECCAK256 PUSH2 0x160 DUP12 ADD MLOAD DUP1 MLOAD SWAP2 SWAP9 POP SWAP6 POP SWAP1 SWAP4 POP DUP4 SWAP3 DUP6 ADD SWAP2 POP DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT PUSH2 0x40F3 JUMPI DUP1 MLOAD DUP3 MSTORE PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 SWAP1 SWAP3 ADD SWAP2 PUSH1 0x20 SWAP2 DUP3 ADD SWAP2 ADD PUSH2 0x40B6 JUMP JUMPDEST MLOAD DUP2 MLOAD PUSH1 0x20 SWAP4 SWAP1 SWAP4 SUB PUSH2 0x100 EXP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD DUP1 NOT SWAP1 SWAP2 AND SWAP3 AND SWAP2 SWAP1 SWAP2 OR SWAP1 MSTORE PUSH1 0x40 MLOAD SWAP3 ADD DUP3 SWAP1 SUB SWAP1 SWAP2 KECCAK256 PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 DUP10 ADD DUP1 MLOAD PUSH2 0x140 DUP12 ADD DUP1 MLOAD PUSH2 0x160 SWAP1 SWAP13 ADD DUP1 MLOAD SWAP11 DUP5 MSTORE SWAP9 DUP2 MSTORE SWAP3 DUP9 MSTORE PUSH2 0x1A0 DUP3 KECCAK256 SWAP2 MSTORE SWAP9 SWAP1 MSTORE POP POP POP SWAP2 SWAP1 MSTORE POP SWAP1 SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP1 DUP5 GT PUSH2 0x41CA JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x555F JUMP JUMPDEST DUP3 ISZERO DUP1 PUSH2 0x41D5 JUMPI POP DUP5 ISZERO JUMPDEST ISZERO PUSH2 0x41E3 JUMPI PUSH1 0x0 SWAP2 POP PUSH2 0xA88 JUMP JUMPDEST DUP4 DUP1 ISZERO ISZERO PUSH2 0x41ED JUMPI INVALID JUMPDEST DUP6 DUP5 MULMOD SWAP1 POP PUSH2 0x41FC DUP6 DUP5 PUSH2 0x37C0 JUMP JUMPDEST PUSH2 0x4208 PUSH2 0x3E8 DUP4 PUSH2 0x37C0 JUMP JUMPDEST LT ISZERO SWAP6 SWAP5 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP1 DUP5 GT PUSH2 0x424F JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6C6 SWAP1 PUSH2 0x555F JUMP JUMPDEST DUP3 ISZERO DUP1 PUSH2 0x425A JUMPI POP DUP5 ISZERO JUMPDEST ISZERO PUSH2 0x4268 JUMPI PUSH1 0x0 SWAP2 POP PUSH2 0xA88 JUMP JUMPDEST DUP4 DUP1 ISZERO ISZERO PUSH2 0x4272 JUMPI INVALID JUMPDEST DUP6 DUP5 MULMOD SWAP1 POP DUP4 PUSH2 0x4282 DUP6 DUP4 PUSH2 0x2EE2 JUMP JUMPDEST DUP2 ISZERO ISZERO PUSH2 0x428B JUMPI INVALID JUMPDEST MOD SWAP1 POP PUSH2 0x41FC DUP6 DUP5 PUSH2 0x37C0 JUMP JUMPDEST PUSH1 0x80 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE POP SWAP1 JUMP JUMPDEST PUSH2 0x120 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH2 0x42D6 PUSH2 0x4298 JUMP JUMPDEST DUP2 MSTORE PUSH1 0x20 ADD PUSH2 0x42E3 PUSH2 0x4298 JUMP JUMPDEST DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE POP SWAP1 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x60 DUP2 ADD DUP3 MSTORE PUSH1 0x0 DUP1 DUP3 MSTORE PUSH1 0x20 DUP3 ADD DUP2 SWAP1 MSTORE SWAP2 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x25BF DUP3 CALLDATALOAD PUSH2 0x57C2 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH2 0x432D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0x4340 PUSH2 0x433B DUP3 PUSH2 0x5751 JUMP JUMPDEST PUSH2 0x572A JUMP JUMPDEST DUP2 DUP2 MSTORE PUSH1 0x20 SWAP4 DUP5 ADD SWAP4 SWAP1 SWAP3 POP DUP3 ADD DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x437E JUMPI DUP2 CALLDATALOAD DUP7 ADD PUSH2 0x4368 DUP9 DUP3 PUSH2 0x44CE JUMP JUMPDEST DUP5 MSTORE POP PUSH1 0x20 SWAP3 DUP4 ADD SWAP3 SWAP2 SWAP1 SWAP2 ADD SWAP1 PUSH1 0x1 ADD PUSH2 0x4352 JUMP JUMPDEST POP POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH2 0x4399 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0x43A7 PUSH2 0x433B DUP3 PUSH2 0x5751 JUMP JUMPDEST DUP2 DUP2 MSTORE PUSH1 0x20 SWAP4 DUP5 ADD SWAP4 SWAP1 SWAP3 POP DUP3 ADD DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x437E JUMPI DUP2 CALLDATALOAD DUP7 ADD PUSH2 0x43CF DUP9 DUP3 PUSH2 0x451D JUMP JUMPDEST DUP5 MSTORE POP PUSH1 0x20 SWAP3 DUP4 ADD SWAP3 SWAP2 SWAP1 SWAP2 ADD SWAP1 PUSH1 0x1 ADD PUSH2 0x43B9 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH2 0x43F6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0x4404 PUSH2 0x433B DUP3 PUSH2 0x5751 JUMP JUMPDEST SWAP2 POP DUP2 DUP2 DUP4 MSTORE PUSH1 0x20 DUP5 ADD SWAP4 POP PUSH1 0x20 DUP2 ADD SWAP1 POP DUP4 DUP6 PUSH1 0x20 DUP5 MUL DUP3 ADD GT ISZERO PUSH2 0x4429 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x437E JUMPI DUP2 PUSH2 0x443F DUP9 DUP3 PUSH2 0x4461 JUMP JUMPDEST DUP5 MSTORE POP PUSH1 0x20 SWAP3 DUP4 ADD SWAP3 SWAP2 SWAP1 SWAP2 ADD SWAP1 PUSH1 0x1 ADD PUSH2 0x442C JUMP JUMPDEST PUSH1 0x0 PUSH2 0x25BF DUP3 CALLDATALOAD PUSH2 0x57DB JUMP JUMPDEST PUSH1 0x0 PUSH2 0x25BF DUP3 CALLDATALOAD PUSH2 0x57E0 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x25BF DUP3 CALLDATALOAD PUSH2 0x57E3 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x25BF DUP3 MLOAD PUSH2 0x57E3 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x1F DUP4 ADD DUP5 SGT PUSH2 0x4497 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP DUP2 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x44AF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x20 DUP4 ADD SWAP2 POP DUP4 PUSH1 0x1 DUP3 MUL DUP4 ADD GT ISZERO PUSH2 0x44C7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH2 0x44DF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0x44ED PUSH2 0x433B DUP3 PUSH2 0x5772 JUMP JUMPDEST SWAP2 POP DUP1 DUP3 MSTORE PUSH1 0x20 DUP4 ADD PUSH1 0x20 DUP4 ADD DUP6 DUP4 DUP4 ADD GT ISZERO PUSH2 0x4509 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4514 DUP4 DUP3 DUP5 PUSH2 0x5819 JUMP JUMPDEST POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x180 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x4530 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x453B PUSH2 0x180 PUSH2 0x572A JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0x4549 DUP5 DUP5 PUSH2 0x4310 JUMP JUMPDEST DUP3 MSTORE POP PUSH1 0x20 PUSH2 0x455A DUP5 DUP5 DUP4 ADD PUSH2 0x4310 JUMP JUMPDEST PUSH1 0x20 DUP4 ADD MSTORE POP PUSH1 0x40 PUSH2 0x456E DUP5 DUP3 DUP6 ADD PUSH2 0x4310 JUMP JUMPDEST PUSH1 0x40 DUP4 ADD MSTORE POP PUSH1 0x60 PUSH2 0x4582 DUP5 DUP3 DUP6 ADD PUSH2 0x4310 JUMP JUMPDEST PUSH1 0x60 DUP4 ADD MSTORE POP PUSH1 0x80 PUSH2 0x4596 DUP5 DUP3 DUP6 ADD PUSH2 0x4461 JUMP JUMPDEST PUSH1 0x80 DUP4 ADD MSTORE POP PUSH1 0xA0 PUSH2 0x45AA DUP5 DUP3 DUP6 ADD PUSH2 0x4461 JUMP JUMPDEST PUSH1 0xA0 DUP4 ADD MSTORE POP PUSH1 0xC0 PUSH2 0x45BE DUP5 DUP3 DUP6 ADD PUSH2 0x4461 JUMP JUMPDEST PUSH1 0xC0 DUP4 ADD MSTORE POP PUSH1 0xE0 PUSH2 0x45D2 DUP5 DUP3 DUP6 ADD PUSH2 0x4461 JUMP JUMPDEST PUSH1 0xE0 DUP4 ADD MSTORE POP PUSH2 0x100 PUSH2 0x45E7 DUP5 DUP3 DUP6 ADD PUSH2 0x4461 JUMP JUMPDEST PUSH2 0x100 DUP4 ADD MSTORE POP PUSH2 0x120 PUSH2 0x45FD DUP5 DUP3 DUP6 ADD PUSH2 0x4461 JUMP JUMPDEST PUSH2 0x120 DUP4 ADD MSTORE POP PUSH2 0x140 DUP3 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x461F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x462B DUP5 DUP3 DUP6 ADD PUSH2 0x44CE JUMP JUMPDEST PUSH2 0x140 DUP4 ADD MSTORE POP PUSH2 0x160 DUP3 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x464D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4659 DUP5 DUP3 DUP6 ADD PUSH2 0x44CE JUMP JUMPDEST PUSH2 0x160 DUP4 ADD MSTORE POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x4678 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x33B0 DUP5 DUP5 PUSH2 0x4310 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x4697 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x46A3 DUP6 DUP6 PUSH2 0x4310 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0x46B4 DUP6 DUP3 DUP7 ADD PUSH2 0x4310 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x46D1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x46DD DUP6 DUP6 PUSH2 0x4310 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0x46B4 DUP6 DUP3 DUP7 ADD PUSH2 0x4455 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x4700 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x4717 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x33B0 DUP5 DUP3 DUP6 ADD PUSH2 0x4388 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x60 DUP5 DUP7 SUB SLT ISZERO PUSH2 0x4738 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP4 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x474F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x475B DUP7 DUP3 DUP8 ADD PUSH2 0x4388 JUMP JUMPDEST SWAP4 POP POP PUSH1 0x20 DUP5 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x4778 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4784 DUP7 DUP3 DUP8 ADD PUSH2 0x43E5 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x40 DUP5 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x47A1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x47AD DUP7 DUP3 DUP8 ADD PUSH2 0x431C JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 POP SWAP3 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x60 DUP5 DUP7 SUB SLT ISZERO PUSH2 0x47CC JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP4 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x47E3 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x47EF DUP7 DUP3 DUP8 ADD PUSH2 0x4388 JUMP JUMPDEST SWAP4 POP POP PUSH1 0x20 PUSH2 0x4784 DUP7 DUP3 DUP8 ADD PUSH2 0x4461 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x4812 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x33B0 DUP5 DUP5 PUSH2 0x4461 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x4831 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x46A3 DUP6 DUP6 PUSH2 0x4461 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x60 DUP6 DUP8 SUB SLT ISZERO PUSH2 0x4853 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x485F DUP8 DUP8 PUSH2 0x4461 JUMP JUMPDEST SWAP5 POP POP PUSH1 0x20 PUSH2 0x4870 DUP8 DUP3 DUP9 ADD PUSH2 0x4310 JUMP JUMPDEST SWAP4 POP POP PUSH1 0x40 DUP6 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x488D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4899 DUP8 DUP3 DUP9 ADD PUSH2 0x4485 JUMP JUMPDEST SWAP6 SWAP9 SWAP5 SWAP8 POP SWAP6 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x60 DUP5 DUP7 SUB SLT ISZERO PUSH2 0x48BA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x48C6 DUP7 DUP7 PUSH2 0x4461 JUMP JUMPDEST SWAP4 POP POP PUSH1 0x20 PUSH2 0x48D7 DUP7 DUP3 DUP8 ADD PUSH2 0x4310 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x40 DUP5 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x48F4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x47AD DUP7 DUP3 DUP8 ADD PUSH2 0x44CE JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x4912 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x33B0 DUP5 DUP5 PUSH2 0x446D JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x4930 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x33B0 DUP5 DUP5 PUSH2 0x4479 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x494E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x4965 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x33B0 DUP5 DUP3 DUP6 ADD PUSH2 0x451D JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x80 DUP6 DUP8 SUB SLT ISZERO PUSH2 0x4987 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP5 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x499E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x49AA DUP8 DUP3 DUP9 ADD PUSH2 0x451D JUMP JUMPDEST SWAP5 POP POP PUSH1 0x20 DUP6 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x49C7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x49D3 DUP8 DUP3 DUP9 ADD PUSH2 0x451D JUMP JUMPDEST SWAP4 POP POP PUSH1 0x40 DUP6 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x49F0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x49FC DUP8 DUP3 DUP9 ADD PUSH2 0x44CE JUMP JUMPDEST SWAP3 POP POP PUSH1 0x60 DUP6 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x4A19 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4A25 DUP8 DUP3 DUP9 ADD PUSH2 0x44CE JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP6 SWAP2 SWAP5 POP SWAP3 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x60 DUP5 DUP7 SUB SLT ISZERO PUSH2 0x4A46 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP4 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x4A5D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4A69 DUP7 DUP3 DUP8 ADD PUSH2 0x451D JUMP JUMPDEST SWAP4 POP POP PUSH1 0x20 PUSH2 0x48D7 DUP7 DUP3 DUP8 ADD PUSH2 0x4461 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x80 DUP8 DUP10 SUB SLT ISZERO PUSH2 0x4A93 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x4A9F DUP10 DUP10 PUSH2 0x4461 JUMP JUMPDEST SWAP7 POP POP PUSH1 0x20 PUSH2 0x4AB0 DUP10 DUP3 DUP11 ADD PUSH2 0x4310 JUMP JUMPDEST SWAP6 POP POP PUSH1 0x40 DUP8 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x4ACD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4AD9 DUP10 DUP3 DUP11 ADD PUSH2 0x4485 JUMP JUMPDEST SWAP5 POP SWAP5 POP POP PUSH1 0x60 DUP8 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x4AF8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4B04 DUP10 DUP3 DUP11 ADD PUSH2 0x4485 JUMP JUMPDEST SWAP3 POP SWAP3 POP POP SWAP3 SWAP6 POP SWAP3 SWAP6 POP SWAP3 SWAP6 JUMP JUMPDEST PUSH2 0x4B1C DUP2 PUSH2 0x57C2 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x4B2D DUP3 PUSH2 0x57BE JUMP JUMPDEST DUP1 DUP5 MSTORE PUSH1 0x20 DUP5 ADD SWAP4 POP PUSH2 0x4B3F DUP4 PUSH2 0x57B8 JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP3 DUP2 LT ISZERO PUSH2 0x4B6F JUMPI PUSH2 0x4B55 DUP7 DUP4 MLOAD PUSH2 0x52F7 JUMP JUMPDEST PUSH2 0x4B5E DUP3 PUSH2 0x57B8 JUMP JUMPDEST PUSH1 0x60 SWAP7 SWAP1 SWAP7 ADD SWAP6 SWAP2 POP PUSH1 0x1 ADD PUSH2 0x4B42 JUMP JUMPDEST POP SWAP4 SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH2 0x4B1C DUP2 PUSH2 0x57DB JUMP JUMPDEST PUSH2 0x4B1C DUP2 PUSH2 0x57E0 JUMP JUMPDEST PUSH2 0x4B1C DUP2 PUSH2 0x57E3 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x4B9F DUP3 PUSH2 0x57BE JUMP JUMPDEST DUP1 DUP5 MSTORE PUSH2 0x4BB3 DUP2 PUSH1 0x20 DUP7 ADD PUSH1 0x20 DUP7 ADD PUSH2 0x5825 JUMP JUMPDEST PUSH2 0x4BBC DUP2 PUSH2 0x5851 JUMP JUMPDEST SWAP1 SWAP4 ADD PUSH1 0x20 ADD SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH2 0x4B1C DUP2 PUSH2 0x580E JUMP JUMPDEST PUSH1 0x12 DUP2 MSTORE PUSH32 0x4C454E4754485F36355F52455155495245440000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0xD DUP2 MSTORE PUSH32 0x494E56414C49445F54414B455200000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0xE DUP2 MSTORE PUSH32 0x4F524445525F4F56455246494C4C000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x11 DUP2 MSTORE PUSH32 0x55494E543235365F554E444552464C4F57000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x1A DUP2 MSTORE PUSH32 0x41535345545F50524F58595F414C52454144595F455849535453000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x26 DUP2 MSTORE PUSH32 0x475245415445525F4F525F455155414C5F544F5F33325F4C454E4754485F5245 PUSH1 0x20 DUP3 ADD MSTORE PUSH32 0x5155495245440000000000000000000000000000000000000000000000000000 PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x60 ADD SWAP1 JUMP JUMPDEST PUSH1 0x15 DUP2 MSTORE PUSH32 0x5349474E41545552455F554E535550504F525445440000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x10 DUP2 MSTORE PUSH32 0x4449564953494F4E5F42595F5A45524F00000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x17 DUP2 MSTORE PUSH32 0x494E56414C49445F4F524445525F5349474E4154555245000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0xD DUP2 MSTORE PUSH32 0x494E56414C49445F4D414B455200000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x10 DUP2 MSTORE PUSH32 0x55494E543235365F4F564552464C4F5700000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0xF DUP2 MSTORE PUSH32 0x494E56414C49445F54585F484153480000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x11 DUP2 MSTORE PUSH32 0x494E56414C49445F5349474E4154555245000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0xE DUP2 MSTORE PUSH32 0x524F554E44494E475F4552524F52000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x10 DUP2 MSTORE PUSH32 0x4641494C45445F455845435554494F4E00000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0xD DUP2 MSTORE PUSH32 0x54414B45525F4F56455250415900000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x14 DUP2 MSTORE PUSH32 0x494E56414C49445F54414B45525F414D4F554E54000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x1A DUP2 MSTORE PUSH32 0x41535345545F50524F58595F444F45535F4E4F545F4558495354000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x21 DUP2 MSTORE PUSH32 0x475245415445525F5448414E5F5A45524F5F4C454E4754485F52455155495245 PUSH1 0x20 DUP3 ADD MSTORE PUSH32 0x4400000000000000000000000000000000000000000000000000000000000000 PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x60 ADD SWAP1 JUMP JUMPDEST PUSH1 0x11 DUP2 MSTORE PUSH32 0x5349474E41545552455F494C4C4547414C000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x1E DUP2 MSTORE PUSH32 0x4C454E4754485F475245415445525F5448414E5F305F52455155495245440000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x17 DUP2 MSTORE PUSH32 0x494E56414C49445F4E45575F4F524445525F45504F4348000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x1E DUP2 MSTORE PUSH32 0x4C454E4754485F475245415445525F5448414E5F335F52455155495245440000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x14 DUP2 MSTORE PUSH32 0x434F4D504C4554455F46494C4C5F4641494C4544000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x12 DUP2 MSTORE PUSH32 0x494E56414C49445F46494C4C5F50524943450000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x12 DUP2 MSTORE PUSH32 0x5245454E5452414E43595F494C4C4547414C0000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x13 DUP2 MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x26 DUP2 MSTORE PUSH32 0x475245415445525F4F525F455155414C5F544F5F32305F4C454E4754485F5245 PUSH1 0x20 DUP3 ADD MSTORE PUSH32 0x5155495245440000000000000000000000000000000000000000000000000000 PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x60 ADD SWAP1 JUMP JUMPDEST PUSH1 0x10 DUP2 MSTORE PUSH32 0x4F524445525F554E46494C4C41424C4500000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0xE DUP2 MSTORE PUSH32 0x494E56414C49445F53454E444552000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x18 DUP2 MSTORE PUSH32 0x4E454741544956455F5350524541445F52455155495245440000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x14 DUP2 MSTORE PUSH32 0x494E56414C49445F54585F5349474E4154555245000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x11 DUP2 MSTORE PUSH32 0x4C454E4754485F305F5245515549524544000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST DUP1 MLOAD PUSH1 0x80 DUP4 ADD SWAP1 PUSH2 0x5285 DUP5 DUP3 PUSH2 0x4B82 JUMP JUMPDEST POP PUSH1 0x20 DUP3 ADD MLOAD PUSH2 0x5298 PUSH1 0x20 DUP6 ADD DUP3 PUSH2 0x4B82 JUMP JUMPDEST POP PUSH1 0x40 DUP3 ADD MLOAD PUSH2 0x52AB PUSH1 0x40 DUP6 ADD DUP3 PUSH2 0x4B82 JUMP JUMPDEST POP PUSH1 0x60 DUP3 ADD MLOAD PUSH2 0x2758 PUSH1 0x60 DUP6 ADD DUP3 PUSH2 0x4B82 JUMP JUMPDEST DUP1 MLOAD PUSH2 0x120 DUP4 ADD SWAP1 PUSH2 0x52D0 DUP5 DUP3 PUSH2 0x5274 JUMP JUMPDEST POP PUSH1 0x20 DUP3 ADD MLOAD PUSH2 0x52E3 PUSH1 0x80 DUP6 ADD DUP3 PUSH2 0x5274 JUMP JUMPDEST POP PUSH1 0x40 DUP3 ADD MLOAD PUSH2 0x2758 PUSH2 0x100 DUP6 ADD DUP3 PUSH2 0x4B82 JUMP JUMPDEST DUP1 MLOAD PUSH1 0x60 DUP4 ADD SWAP1 PUSH2 0x5308 DUP5 DUP3 PUSH2 0x532E JUMP JUMPDEST POP PUSH1 0x20 DUP3 ADD MLOAD PUSH2 0x531B PUSH1 0x20 DUP6 ADD DUP3 PUSH2 0x4B82 JUMP JUMPDEST POP PUSH1 0x40 DUP3 ADD MLOAD PUSH2 0x2758 PUSH1 0x40 DUP6 ADD DUP3 PUSH2 0x4B82 JUMP JUMPDEST PUSH2 0x4B1C DUP2 PUSH2 0x5808 JUMP JUMPDEST PUSH1 0x20 DUP2 ADD PUSH2 0x2F23 DUP3 DUP5 PUSH2 0x4B13 JUMP JUMPDEST PUSH2 0x100 DUP2 ADD PUSH2 0x5354 DUP3 DUP12 PUSH2 0x4B13 JUMP JUMPDEST PUSH2 0x5361 PUSH1 0x20 DUP4 ADD DUP11 PUSH2 0x4B13 JUMP JUMPDEST PUSH2 0x536E PUSH1 0x40 DUP4 ADD DUP10 PUSH2 0x4B82 JUMP JUMPDEST PUSH2 0x537B PUSH1 0x60 DUP4 ADD DUP9 PUSH2 0x4B82 JUMP JUMPDEST PUSH2 0x5388 PUSH1 0x80 DUP4 ADD DUP8 PUSH2 0x4B82 JUMP JUMPDEST PUSH2 0x5395 PUSH1 0xA0 DUP4 ADD DUP7 PUSH2 0x4B82 JUMP JUMPDEST DUP2 DUP2 SUB PUSH1 0xC0 DUP4 ADD MSTORE PUSH2 0x53A7 DUP2 DUP6 PUSH2 0x4B94 JUMP JUMPDEST SWAP1 POP DUP2 DUP2 SUB PUSH1 0xE0 DUP4 ADD MSTORE PUSH2 0x53BB DUP2 DUP5 PUSH2 0x4B94 JUMP JUMPDEST SWAP11 SWAP10 POP POP POP POP POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x60 DUP2 ADD PUSH2 0x53D7 DUP3 DUP7 PUSH2 0x4B13 JUMP JUMPDEST DUP2 DUP2 SUB PUSH1 0x20 DUP4 ADD MSTORE PUSH2 0x53E9 DUP2 DUP6 PUSH2 0x4B94 JUMP JUMPDEST SWAP1 POP DUP2 DUP2 SUB PUSH1 0x40 DUP4 ADD MSTORE PUSH2 0x53FD DUP2 DUP5 PUSH2 0x4B94 JUMP JUMPDEST SWAP6 SWAP5 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x25BF DUP2 DUP5 PUSH2 0x4B22 JUMP JUMPDEST PUSH1 0x20 DUP2 ADD PUSH2 0x2F23 DUP3 DUP5 PUSH2 0x4B79 JUMP JUMPDEST PUSH1 0x20 DUP2 ADD PUSH2 0x2F23 DUP3 DUP5 PUSH2 0x4B82 JUMP JUMPDEST PUSH1 0x60 DUP2 ADD PUSH2 0x5441 DUP3 DUP7 PUSH2 0x4B82 JUMP JUMPDEST PUSH2 0x544E PUSH1 0x20 DUP4 ADD DUP6 PUSH2 0x4B13 JUMP JUMPDEST DUP2 DUP2 SUB PUSH1 0x40 DUP4 ADD MSTORE PUSH2 0x53FD DUP2 DUP5 PUSH2 0x4B94 JUMP JUMPDEST PUSH1 0x40 DUP2 ADD PUSH2 0x546E DUP3 DUP6 PUSH2 0x4B82 JUMP JUMPDEST DUP2 DUP2 SUB PUSH1 0x20 DUP4 ADD MSTORE PUSH2 0x33B0 DUP2 DUP5 PUSH2 0x4B94 JUMP JUMPDEST PUSH1 0x80 DUP2 ADD PUSH2 0x548E DUP3 DUP8 PUSH2 0x4B82 JUMP JUMPDEST PUSH2 0x549B PUSH1 0x20 DUP4 ADD DUP7 PUSH2 0x532E JUMP JUMPDEST PUSH2 0x54A8 PUSH1 0x40 DUP4 ADD DUP6 PUSH2 0x4B82 JUMP JUMPDEST PUSH2 0x53FD PUSH1 0x60 DUP4 ADD DUP5 PUSH2 0x4B82 JUMP JUMPDEST PUSH1 0x40 DUP2 ADD PUSH2 0x54C3 DUP3 DUP6 PUSH2 0x4B8B JUMP JUMPDEST PUSH2 0x25BF PUSH1 0x20 DUP4 ADD DUP5 PUSH2 0x4B13 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x25BF DUP2 DUP5 PUSH2 0x4B94 JUMP JUMPDEST PUSH1 0x20 DUP2 ADD PUSH2 0x2F23 DUP3 DUP5 PUSH2 0x4BC9 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x4BD2 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x4C02 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x4C32 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x4C62 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x4C92 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x4CC2 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x4D18 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x4D48 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x4D78 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x4DA8 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x4DD8 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x4E08 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x4E38 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x4E68 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x4E98 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x4EC8 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x4EF8 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x4F28 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x4F58 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x4FAE JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x4FDE JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x500E JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x503E JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x506E JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x509E JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x50CE JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x50FE JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x512E JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x5184 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x51B4 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x51E4 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x5214 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x2F23 DUP2 PUSH2 0x5244 JUMP JUMPDEST PUSH1 0x80 DUP2 ADD PUSH2 0x2F23 DUP3 DUP5 PUSH2 0x5274 JUMP JUMPDEST PUSH2 0x120 DUP2 ADD PUSH2 0x2F23 DUP3 DUP5 PUSH2 0x52BE JUMP JUMPDEST PUSH1 0x60 DUP2 ADD PUSH2 0x2F23 DUP3 DUP5 PUSH2 0x52F7 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP2 DUP2 ADD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT DUP3 DUP3 LT OR ISZERO PUSH2 0x5749 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x40 MSTORE SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH8 0xFFFFFFFFFFFFFFFF DUP3 GT ISZERO PUSH2 0x5768 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x20 SWAP1 DUP2 MUL ADD SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH8 0xFFFFFFFFFFFFFFFF DUP3 GT ISZERO PUSH2 0x5789 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x20 PUSH1 0x1F SWAP2 SWAP1 SWAP2 ADD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 AND ADD SWAP1 JUMP JUMPDEST PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST MLOAD SWAP1 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 JUMP JUMPDEST ISZERO ISZERO SWAP1 JUMP JUMPDEST SWAP1 JUMP JUMPDEST PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 AND SWAP1 JUMP JUMPDEST PUSH1 0xFF AND SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x2F23 DUP3 PUSH2 0x57C2 JUMP JUMPDEST DUP3 DUP2 DUP4 CALLDATACOPY POP PUSH1 0x0 SWAP2 ADD MSTORE JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x5840 JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH2 0x5828 JUMP JUMPDEST DUP4 DUP2 GT ISZERO PUSH2 0x2758 JUMPI POP POP PUSH1 0x0 SWAP2 ADD MSTORE JUMP JUMPDEST PUSH1 0x1F ADD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 AND SWAP1 JUMP STOP LOG2 PUSH6 0x627A7A723058 KECCAK256 0xb1 SWAP13 SWAP3 KECCAK256 LT ORIGIN PUSH1 0x33 SWAP9 0xc0 SMOD 0xdc 0xcf DUP1 SWAP4 0xc PUSH3 0x6EF89F 0xa6 0xc8 0x48 0xc8 0xb7 0xef MSTORE PUSH8 0xD07CD4ED6C657870 PUSH6 0x72696D656E74 PUSH2 0x6CF5 STOP CALLDATACOPY ",
- "sourceMap": "897:514:21:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1277:42:23;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1277:42:23;;;;;;;;;;;;;;;;;;;;;;;;;4133:647:27;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;4133:647:27;;;;;;;;;;;;;;;;;1367:42:23;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1367:42:23;;;;;;;;;;;;;;;;;1572:445:25;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1572:445:25;;;;;;;;;;;1870:2891:24;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1870:2891:24;;;;;;;;;;;;;;;;;2139:1515:27;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2139:1515:27;;;;;;;;;897:51:22;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;897:51:22;;;;;;;;;;;;;;;;;15747:260:27;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;15747:260:27;;;;;;;;;5260:659;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;5260:659:27;;;;;;;;;2018:1079:23;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2018:1079:23;;;;;;;;;6478:632:27;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;6478:632:27;;;;;;;;;2013:154:22;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2013:154:22;;;;;;;;;;;;;;;;;967:45:26;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;967:45:26;;;;;;;;;1357:395:27;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1357:395:27;;;;;;;;;2254:412:25;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2254:412:25;;;;;;;;;1166:71;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1166:71:25;;;;;;;;;7498:1507:27;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;7498:1507:27;;;;;;;;;16201:419;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;16201:419:27;;;;;;;;;;;;;;;;;1046:63:25;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1046:63:25;;;;;;;;;91:20:55;;8:9:-1;5:2;;;30:1;27;20:12;5:2;91:20:55;;;;3038:4848:25;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;3038:4848:25;;;;;;;;;13713:1899:27;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;13713:1899:27;;;;;;;;;3414:374:23;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;3414:374:23;;;;;;;;;1426:1456:26;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1426:1456:26;;;;;;;;;1157:666:22;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1157:666:22;;;;;;;;;4417:2261:23;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;4417:2261:23;;;;;;;;;;;;;;;;;4019:124;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;4019:124:23;;;;;;;;;1627:67;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1627:67:23;;;;;;;;;1528:185:38;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1528:185:38;;;;;;;;;;;;9462:1488:27;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;9462:1488:27;;;;;;;;;1301:33:39;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1301:33:39;;;;11338:1914:27;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;11338:1914:27;;;;;;;;;1064:36:26;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1064:36:26;;;;333:167:55;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;333:167:55;;;;;;;;;1078:40:21;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1078:40:21;;;;1277:42:23;;;;;;;;;;;;;:::o;4133:647:27:-;4340:35;;:::i;:::-;4391:20;4442:9;4495:36;;:::i;:::-;939:6:56;;;;938:7;917:72;;;;;;;;;;;;;;;;;;;;;;1043:6;:13;;;;1052:4;1043:13;;;4414::27;;;-1:-1:-1;1043:6:56;-1:-1:-1;4437:304:27;4457:17;;;4437:304;;4534:131;4569:6;4576:1;4569:9;;;;;;;;;;;;;;;;;;4596:21;4618:1;4596:24;;;;;;;;;;;;;;;;;;4638:10;4649:1;4638:13;;;;;;;;;;;;;;;;;;4534:17;:131::i;:::-;4495:170;;4679:51;4694:16;4712:17;4679:14;:51::i;:::-;4476:3;;;;;4437:304;;;-1:-1:-1;;1165:5:56;1156:14;;;;;;-1:-1:-1;4133:647:27;;-1:-1:-1;;;4133:647:27:o;1367:42:23:-;;;;;;;;;;;;;;;:::o;1572:445:25:-;1708:27;;;1725:10;1708:27;1704:260;;1776:126;1814:4;1840:13;1875:9;;1776:126;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1776:16:25;;-1:-1:-1;;;;;1776:126:25:i;:::-;1751:202;;;;;;;;;;;;;;;;-1:-1:-1;;1973:15:25;;;;:9;:15;;;;;;;;:30;;;;;;;;;;;:37;;;;2006:4;1973:37;;;1572:445::o;1870:2891:24:-;2106:59;;:::i;:::-;2571:39;;:::i;:::-;2646:40;;:::i;:::-;2755:20;939:6:56;;;;938:7;917:72;;;;;;;;;;;;;;1043:6;:13;;;;1052:4;1043:13;;;2435:24:24;;;;;2407:25;;;;:52;;;;2497:24;;;2469:25;;;:52;2613:23;2435:9;2613:12;:23::i;:::-;2571:65;;2689:24;2702:10;2689:12;:24::i;:::-;2646:67;;2778:26;:24;:26::i;:::-;2755:49;;2875:132;2908:9;2931:13;2958:12;2984:13;2875:19;:132::i;:::-;3017:135;3050:10;3074:14;3102:12;3128:14;3017:19;:135::i;:::-;3162:39;3179:9;3190:10;3162:16;:39::i;:::-;3278:195;3319:9;3342:10;3366:13;:41;;;3421:14;:42;;;3278:27;:195::i;:::-;3597:23;;:46;;;;3717;;3257:216;;-1:-1:-1;3518:255:24;;3547:9;;3570:13;;3597:46;;3518:15;:255::i;:::-;3864:24;;;;;:47;;;;3986;;3783:260;;3812:10;;3836:14;;3864:47;;;3783:15;:260::i;:::-;4095:205;4126:9;4149:12;4175:13;:23;;;4212:13;:41;;;4267:18;:23;;;4095:17;:205::i;:::-;4310:209;4341:10;4365:12;4391:14;:24;;;4429:14;:42;;;4485:18;:24;;;4310:17;:209::i;:::-;4584:134;4617:9;4640:10;4664:12;4690:18;4584:19;:134::i;:::-;-1:-1:-1;;1165:5:56;1156:14;;;;;;-1:-1:-1;1870:2891:24;;-1:-1:-1;;;;1870:2891:24:o;2139:1515:27:-;2310:30;;:::i;:::-;2403;2436:104;2468:5;2487:20;2521:9;2436:18;:104::i;:::-;2403:137;;3116:3;3037:17;2972;2966:24;2870:2;2851:17;2847:26;2762:7;2691:3;2661:532;3209:7;3206:2;;;3261:17;3255:24;3242:11;3235:45;3355:2;3336:17;3332:26;3326:33;3321:2;3308:11;3304:20;3297:63;3435:2;3416:17;3412:26;3406:33;3401:2;3388:11;3384:20;3377:63;3515:2;3496:17;3492:26;3486:33;3481:2;3468:11;3464:20;3457:63;3206:2;-1:-1:-1;2139:1515:27;;;;;;;:::o;897:51:22:-;;;;;;;;;;;;;;;:::o;15747:260:27:-;15856:20;939:6:56;;15856:20:27;;939:6:56;;938:7;917:72;;;;;;;;;;;;;;-1:-1:-1;;1043:6:56;:13;;;;1052:4;1043:13;;;15879::27;;;15902:99;15922:17;;;15902:99;;15960:30;15980:6;15987:1;15980:9;;;;;;;;;;;;;;;;;;15960:19;:30::i;:::-;15941:3;;15902:99;;;-1:-1:-1;;1165:5:56;1156:14;;;;;;-1:-1:-1;15747:260:27:o;5260:659::-;5473:35;;:::i;:::-;5524:20;5575:9;5628:36;;:::i;:::-;939:6:56;;;;938:7;917:72;;;;;;;;;;;;;;1043:6;:13;;;;1052:4;1043:13;;;5547::27;;;-1:-1:-1;1043:6:56;-1:-1:-1;5570:310:27;5590:17;;;5570:310;;5667:137;5708:6;5715:1;5708:9;;;;;;;;;;;;;;;;;;5735:21;5757:1;5735:24;;;;;;;;;;;;;;;;;;5777:10;5788:1;5777:13;;;;;;;;;;;;;;;;;;5667:23;:137::i;:::-;5628:176;;5818:51;5833:16;5851:17;5818:14;:51::i;:::-;5609:3;;;;;5570:310;;2018:1079:23;2122:20;939:6:56;;2122:20:23;;;;;;939:6:56;;938:7;917:72;;;;;;;;;;;;;;1043:6;:13;;;;1052:4;1043:13;;;2145:26:23;:24;:26::i;:::-;2122:49;-1:-1:-1;2453:26:23;;;2469:10;2453:26;:52;;2495:10;2453:52;;;2490:1;2453:52;2673:24;;;;;;;;:10;:24;;;;;;;;:39;;;;;;;;;;2429:76;;-1:-1:-1;2636:1:23;2617:20;;;-1:-1:-1;2673:39:23;-1:-1:-1;2801:29:23;;;2780:100;;;;;;;;;;;;;;2920:24;;;;;;;;:10;:24;;;;;;;;:39;;;;;;;;;;;;;;:55;;;2990:100;;;;;2962:13;;2990:100;;;;;;;;;;-1:-1:-1;;1165:5:56;1156:14;;;;;;-1:-1:-1;;;2018:1079:23:o;6478:632:27:-;6671:35;;:::i;:::-;6722:20;6773:9;6826:36;;:::i;:::-;6745:6;:13;6722:36;;6785:1;6773:13;;6768:303;6788:17;;;6768:303;;6865:130;6899:6;6906:1;6899:9;;;;;;;;;;;;;;;;;;6926:21;6948:1;6926:24;;;;;;;;;;;;;;;;;;6968:10;6979:1;6968:13;;;;;;;;;;;;;;;;;;6865:16;:130::i;:::-;6826:169;;7009:51;7024:16;7042:17;7009:14;:51::i;:::-;6807:3;;;;;6768:303;;;6478:632;;;;;;;;:::o;2013:154:22:-;2134:26;;;2104:7;2134:26;;;:12;:26;;;;;;;;2013:154;;;;:::o;967:45:26:-;;;;;;;;;;;;;;;:::o;1357:395:27:-;1548:30;;:::i;:::-;939:6:56;;;;938:7;917:72;;;;;;;;;;;;;;1043:6;:13;;;;1052:4;1043:13;;;1608:109:27;1645:5;1664:20;1698:9;1608:23;:109::i;:::-;1165:5:56;1156:14;;;;;;1594:123:27;1357:395;-1:-1:-1;;;;1357:395:27:o;2254:412:25:-;2408:21;939:6:56;;;;938:7;917:72;;;;;;;;;;;;;;1043:6;:13;;;;1052:4;1043:13;;;2432:26:25;:24;:26::i;:::-;2468:32;;;;;;;;:17;:32;;;;;;;;:50;;;;;;;;;;;;;;:61;;;;;;;;;;2544:115;2468:32;;-1:-1:-1;2468:50:25;;2544:115;;;;2468:61;;2544:115;;;;;;;;;;-1:-1:-1;;1165:5:56;1156:14;;;;;;-1:-1:-1;2254:412:25:o;1166:71::-;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;7498:1507:27:-;7696:35;;:::i;:::-;7747:27;7816:20;7867:9;8253:37;8444:36;;:::i;:::-;939:6:56;;;;938:7;917:72;;;;;;;;;;;;;;1043:6;:13;;;;1052:4;1043:13;;;7777:9:27;;:6;;1043::56;7777:9:27;;;;;;;;;;;;;;:24;;;7747:54;;7839:6;:13;7816:36;;7879:1;7867:13;;7862:1104;7882:17;;;7862:1104;;8156:14;8129:6;8136:1;8129:9;;;;;;;;;;;;;;;;;;:24;;:41;;;;8293:70;8301:20;8323:16;:39;;;8293:7;:70::i;:::-;8253:110;;8483:136;8518:6;8525:1;8518:9;;;;;;;;;;;;;;;;;;8545:29;8592:10;8603:1;8592:13;;;;;;;;;8483:136;8444:175;;8704:51;8719:16;8737:17;8704:14;:51::i;:::-;8853:39;;;;:63;-1:-1:-1;8849:107:27;;8936:5;;8849:107;7901:3;;;;;7862:1104;;;-1:-1:-1;;1165:5:56;1156:14;;;;;;-1:-1:-1;7498:1507:27;;;-1:-1:-1;;;;;7498:1507:27:o;16201:419::-;16301:20;16344;16390:38;16484:9;16367:6;:13;16344:36;;16456:12;16431:38;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;16390:79;;16496:1;16484:13;;16479:108;16499:17;;;16479:108;;16553:23;16566:6;16573:1;16566:9;;;;;;;;;;;;;;;;;;16553:12;:23::i;:::-;16537:10;16548:1;16537:13;;;;;;;;;;;;;;;;;;:39;16518:3;;16479:108;;1046:63:25;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;91:20:55:-;;;;;;:::o;3038:4848:25:-;3200:12;3390:22;3631:27;3752:7;3769:9;3788;3807:17;6871:24;3268:1;3249:9;:16;:20;3228:97;;;;;;;;;;;;;;;;3421:23;:9;:21;:23::i;:::-;3415:30;;;;-1:-1:-1;3543:29:25;3518:55;;;;3497:123;;;;;;;;;;;;;;3675:16;3661:31;;;;;;;;;;3631:61;-1:-1:-1;4174:21:25;4157:13;:38;;;;;;;;;4153:3383;;;4211:27;;;;;;;;;;;4153:3383;4520:21;4503:13;:38;;;;;;;;;4499:3037;;;4582:16;;:21;4557:97;;;;;;;;;;;;;;4678:5;;-1:-1:-1;4697:14:25;;4499:3037;4784:20;4767:13;:37;;;;;;;;;4763:2773;;;4845:16;;4865:2;4845:22;4820:99;;;;;;;;;;;;;;4943:9;4953:1;4943:12;;;;;;;;;;;;;;;;;;;;;4937:19;;-1:-1:-1;4974:24:25;:9;4996:1;4974:24;:21;:24;:::i;:::-;4970:28;-1:-1:-1;5016:25:25;:9;5038:2;5016:25;:21;:25;:::i;:::-;5012:29;;5067:102;5094:4;5116:1;5135;5154;5067:102;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;-1:-1;;5067:102:25;;;;;5193:26;;;;;;;;;-1:-1:-1;5067:102:25;-1:-1:-1;5233:14:25;;-1:-1:-1;5233:14:25;4763:2773;5324:21;5307:13;:38;;;;;;;;;5303:2233;;;5386:16;;5406:2;5386:22;5361:99;;;;;;;;;;;;;;5484:9;5494:1;5484:12;;;;;;;;;;;;;;;;;;;;;5478:19;;-1:-1:-1;5515:24:25;:9;5537:1;5515:24;:21;:24;:::i;:::-;5511:28;-1:-1:-1;5557:25:25;:9;5579:2;5557:25;:21;:25;:::i;:::-;5553:29;;5608:225;5739:4;5645:116;;;;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;5645:116:25;;;5635:127;;;;;;;;;;;;;36:153:-1;66:2;58:11;;36:153;;176:10;;164:23;;139:12;;;;;98:2;89:12;;;;114;36:153;;;299:10;344;;263:2;259:12;;;254:3;250:22;246:30;;311:9;;295:26;;;340:21;;377:20;365:33;;5635:127:25;;;;;;;;;;;;-1:-1:-1;5608:225:25;;;;;;;;;;-1:-1:-1;5635:127:25;-1:-1:-1;5780:1:25;;5799;;-1:-1:-1;5818:1:25;;5608:225;;5303:2233;6081:20;6064:13;:37;;;;;;;;;6060:1476;;;6127:116;6167:4;6189:13;6220:9;6127:22;:116::i;:::-;6117:126;-1:-1:-1;6257:14:25;;6060:1476;6770:23;6753:13;:40;;;;;;;;;6749:787;;;6898:26;:9;:24;:26::i;:::-;7009:32;;;;;;;;:17;:32;;;;;;;;:50;;;;;;;;;;6871:53;;-1:-1:-1;7009:50:25;;7008:51;7004:102;;;7086:5;7079:12;;;;7004:102;7129:153;7172:16;7206:4;7228:13;7259:9;7129:25;:153::i;6749:787::-;7418:23;7401:13;:40;;;;;;;;;7397:139;;;7467:15;;;;:9;:15;;;;;;;;:30;;;;;;;;;;;;;;-1:-1:-1;7511:14:25;;7397:139;7848:31;;;;;;;;;;;3038:4848;;;;;;;;;;;;;:::o;13713:1899:27:-;13896:35;;:::i;:::-;13947:27;14012:20;14063:9;14453:37;14759;15050:36;;:::i;:::-;13977:6;13984:1;13977:9;;;;;;;;;;;;;;;;;;:24;;;13947:54;;14035:6;:13;14012:36;;14075:1;14063:13;;14058:1515;14078:17;;;14058:1515;;14357:14;14330:6;14337:1;14330:9;;;;;;;;;;;;;;;;;;;:24;;:41;14523:39;;14493:70;;14501:20;;14493:7;:70::i;:::-;14453:110;;14799:170;14838:6;14845:1;14838:9;;;;;;;;;;;;;;;;;;:26;;;14882:6;14889:1;14882:9;;;;;;;;;;;;;;;;;;:26;;;14926:29;14799:21;:170::i;:::-;14759:210;;15089:135;15123:6;15130:1;15123:9;;;;;;;;;;;;;;;;;;15150:29;15197:10;15208:1;15197:13;;;;;;;;;15089:135;15050:174;;15309:51;15324:16;15342:17;15309:14;:51::i;:::-;15460:39;;:63;-1:-1:-1;15456:107:27;;15543:5;;15456:107;14097:3;;;;;14058:1515;;;13713:1899;;;;;;;;;;;:::o;3414:374:23:-;3590:30;;:::i;:::-;939:6:56;;;;938:7;917:72;;;;;;;;;;;;;;1043:6;:13;;;;1052:4;1043:13;;;3650:103:23;3681:5;3700:20;3734:9;3650:17;:103::i;1426:1456:26:-;1640:21;;1730:23;;1640:35;:21;:35;1619:100;;;;;;;;;;;;;;1756:113;1774:94;1809:4;1827:13;1854:4;;1774:94;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1774:21:26;;-1:-1:-1;;;;;1774:94:26:i;:::-;1756:17;:113::i;:::-;1956:29;;;;:12;:29;;;;;;1730:139;;-1:-1:-1;1956:29:26;;1955:30;1934:92;;;;;;;;;;;;;;2112:27;;;2129:10;2112:27;2108:410;;2214:137;2252:15;2289:13;2324:9;;2214:137;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;2214:16:26;;-1:-1:-1;;;;;2214:137:26:i;:::-;2189:216;;;;;;;;;;;;;;;;2470:21;:37;;;;;;;;;;2108:410;2559:29;;;;:12;:29;;;;;;;:36;;;;2591:4;2559:36;;;2626:32;2634:4;;2653;;;;2626:32;2653:4;;;;2626:32;;;;;;;;;;;;;;;;;;;;;;;;2605:95;;;;;;;;;;;;;;;;2788:27;;;2805:10;2788:27;2784:92;;2831:21;:34;;;;;;2784:92;1426:1456;;;;;;;:::o;1157:666:22:-;259:5:55;;1254:30:22;;;;;;259:5:55;;245:10;:19;224:85;;;;;;;;;;;;;;1299:10:22;1254:56;;1405:18;:29;;;:31;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1405:31:22;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1405:31:22;;;;;;;101:4:-1;97:9;90:4;84;80:15;76:31;69:5;65:43;126:6;120:4;113:20;0:138;1405:31:22;;;;;;;;;1474:26;;;;;;;:12;:26;;;;;;1383:53;;-1:-1:-1;1474:26:22;;;-1:-1:-1;1531:31:22;;1510:104;;;;;;;;;;;;;;1674:26;;;;;;;:12;:26;;;;;;;:47;;;;;;;;;;1736:80;;;;;1674:26;;1796:10;;1736:80;;;;;;;;;;1157:666;;;;:::o;4417:2261:23:-;4504:26;;:::i;:::-;4602:19;4615:5;4602:12;:19::i;:::-;4580;;;;:41;;;;4703:27;;;:6;:27;;;;;;;;4663:37;;;:67;5032:22;;;;:27;5028:157;;;5105:38;5099:45;5075:69;;;;5158:16;;5028:157;5498:22;;;;:27;5494:157;;;5571:38;5565:45;;5494:157;5745:22;;;;5704:37;;;;:63;5700:179;;5813:24;5807:31;;5700:179;6003:27;;;;5984:15;:46;5980:157;;6076:19;6070:26;;5980:157;6206:19;;;;;6196:30;;;;:9;:30;;;;;;;;;6192:143;;;6272:21;6266:28;;6192:143;6402:10;;;;6359:18;;6348:30;;;;;;;;:10;:30;;;;;;;;6379:19;;;;6348:51;;;;;;;;;;:64;6344:177;;;6458:21;6452:28;;6344:177;6624:20;6594:51;;;4417:2261;-1:-1:-1;4417:2261:23:o;4019:124::-;939:6:56;;;;938:7;917:72;;;;;;;;;;;;;;1043:6;:13;;;;1052:4;1043:13;;;4110:26:23;4130:5;4110:19;:26::i;:::-;-1:-1:-1;1165:5:56;1156:14;;;;;;4019:124:23:o;1627:67::-;;;;;;;;;;;;;;;;;;;;;;;;:::o;1528:185:38:-;;;;;;;;;;;;;;;;;;;;;;;;;:::o;9462:1488:27:-;9646:35;;:::i;:::-;9697:27;9762:20;9813:9;10199:37;10390:36;;:::i;:::-;9727:6;9734:1;9727:9;;;;;;;;;;;;;;;;;;:24;;;9697:54;;9785:6;:13;9762:36;;9825:1;9813:13;;9808:1103;9828:17;;;9808:1103;;10102:14;10075:6;10082:1;10075:9;;;;;;;;;;;;;;;;;;:24;;:41;;;;10239:70;10247:20;10269:16;:39;;;10239:7;:70::i;:::-;10199:110;;10429:135;10463:6;10470:1;10463:9;;;;;;;;;;;;;;;;;;10490:29;10537:10;10548:1;10537:13;;;;;;;;;10429:135;10390:174;;10649:51;10664:16;10682:17;10649:14;:51::i;:::-;10798:39;;;;:63;-1:-1:-1;10794:107:27;;10881:5;;10794:107;9847:3;;;;;9808:1103;;;9462:1488;;;;;;;;;;:::o;1301:33:39:-;;;;:::o;11338:1914:27:-;11535:35;;:::i;:::-;11586:27;11651:20;11702:9;12092:37;12398;12689:36;;:::i;:::-;939:6:56;;;;938:7;917:72;;;;;;;;;;;;;;1043:6;:13;;;;1052:4;1043:13;;;11616:9:27;;:6;;1043::56;11616:9:27;;;;;;;;;;;;;;:24;;;11586:54;;11674:6;:13;11651:36;;11714:1;11702:13;;11697:1516;11717:17;;;11697:1516;;11996:14;11969:6;11976:1;11969:9;;;;;;;;;;;;;;;;;;;:24;;:41;12162:39;;12132:70;;12140:20;;12132:7;:70::i;:::-;12092:110;;12438:170;12477:6;12484:1;12477:9;;;;;;;;;12438:170;12398:210;;12728:136;12763:6;12770:1;12763:9;;;;;;;;;;;;;;;;;;12790:29;12837:10;12848:1;12837:13;;;;;;;;;12728:136;12689:175;;12949:51;12964:16;12982:17;12949:14;:51::i;:::-;13100:39;;:63;-1:-1:-1;13096:107:27;;13183:5;;13096:107;11736:3;;;;;11697:1516;;;-1:-1:-1;;1165:5:56;1156:14;;;;;;-1:-1:-1;11338:1914:27;;;-1:-1:-1;;;;;;11338:1914:27:o;1064:36:26:-;;;;;;:::o;333:167:55:-;259:5;;;;245:10;:19;224:85;;;;;;;;;;;;;;429:22;;;;425:69;;467:5;:16;;;;;;;;;;425:69;333:167;:::o;1078:40:21:-;;;;;;;;;;;;;;;;;;;:::o;6995:1583:23:-;7160:30;;:::i;:::-;7234:26;;:::i;:::-;7324:20;7629:33;7745:30;7263:19;7276:5;7263:12;:19::i;:::-;7234:48;;7347:26;:24;:26::i;:::-;7324:49;;7446:120;7479:5;7498:9;7521:12;7547:9;7446:19;:120::i;:::-;7665:70;7673:5;:22;;;7697:9;:37;;;7665:7;:70::i;:::-;7629:106;;7778:55;7785:20;7807:25;7778:6;:55::i;:::-;7745:88;;7872:185;7901:5;7920:9;7943:20;7977:22;8013:11;:34;;;7872:15;:185::i;:::-;8127:51;8148:5;8155:22;8127:20;:51::i;:::-;8113:65;;8231:181;8262:5;8281:12;8307:9;:19;;;8340:9;:37;;;8391:11;8231:17;:181::i;:::-;8451:91;8476:5;8495:12;8521:11;8451;:91::i;:::-;6995:1583;;;;;;;;;:::o;1771:648:41:-;1964:39;;2005:40;;1956:90;;1964:39;1956:7;:90::i;:::-;1914:132;;2106:39;;;;;2147:40;;;;2098:90;;2106:39;2098:7;:90::i;:::-;2056:39;;;:132;2238:29;;;;;2269:30;;;;2230:70;;2238:29;2230:7;:70::i;:::-;2198:29;;;:102;2350:29;;;;;2381:30;;;;2342:70;;2350:29;2342:7;:70::i;:::-;2310:29;;;;:102;;;;-1:-1:-1;1771:648:41:o;4841:307:26:-;4980:21;;4924:7;;4980:21;;4924:7;5036:36;;:74;;5088:22;5036:74;;;5075:10;5036:74;5011:99;4841:307;-1:-1:-1;;;4841:307:26:o;11221:1268:23:-;11513:21;;:52;;11544:20;11513:52;11492:115;;;;;;;;;;;;;;11687:19;;;;:33;;;11683:170;;11761:19;;;;:33;;11784:10;11761:33;11736:106;;;;;;;;;;;;;;11931:18;;;;:32;;;11927:169;;12026:12;12004:34;;:5;:18;;;:34;;;11979:106;;;;;;;;;;;;;;;;12186:37;;;;:42;12182:301;;;12269:146;12307:9;:19;;;12348:5;:18;;;12388:9;12269:16;:146::i;:::-;12244:228;;;;;;;;;;;;;;;;11221:1268;;;;:::o;4931:1075:24:-;5885:64;5893:9;:26;;;5921:10;:27;;;5885:7;:64::i;:::-;5805;5813:9;:26;;;5841:10;:27;;;5805:7;:64::i;:::-;:144;;5784:215;;;;;;;;;;;;;;4931:1075;;:::o;6742:4784::-;7014:59;;:::i;:::-;7185:37;7303;7511:38;7632;7225:68;7233:9;:26;;;7261:31;7225:7;:68::i;:::-;7185:108;;7343:158;7382:9;:26;;;7422:9;:26;;;7462:29;7343:25;:158::i;:::-;7303:198;;7552:70;7560:10;:27;;;7589:32;7552:7;:70::i;:::-;7511:111;;7673:161;7712:10;:27;;;7753:10;:27;;;7794:30;7673:25;:161::i;:::-;7632:202;-1:-1:-1;8592:63:24;;;8588:1672;;8722:24;;;;;;:80;;;8816:24;;:47;;:80;;;8959:24;:47;8910:23;;:46;;:96;9299:26;;;;9343;;;;9387:23;;:46;;;;9256:191;;9343:26;9256:25;:191::i;:::-;9207:23;;:240;8588:1672;;;9528:23;;:78;;;9620:23;;:46;;;;:78;;;9762:23;;:46;;;9712:24;;;;;:96;;;;10098:27;;;;10143;;;;10188:24;;:47;10056:193;;10143:27;10056:24;:193::i;:::-;10006:24;;;;;:47;:243;8588:1672;10382:23;;:46;10442:24;;;;;:47;;10361:138;;10382:46;10361:7;:138::i;:::-;10313:45;;;:186;10627:23;;:46;10687:26;;;;10727:18;;;;10588:167;;10627:46;10687:26;10588:25;:167::i;:::-;10549:23;;:36;;:206;10843:23;;:46;;;10903:26;;;;10943:18;;;;10804:167;;10843:46;10903:26;10804:25;:167::i;:::-;10765:23;;:36;;:206;11101:24;;;;:47;11162:27;;;;11203:19;;;;11062:170;;11101:47;11162:27;11062:25;:170::i;:::-;11022:18;:24;;;:37;;:210;;;;;11282:170;11321:18;:24;;;:47;;;11382:10;:27;;;11423:10;:19;;;11282:25;:170::i;:::-;11242:24;;;;:37;;:210;6742:4784;;;;;;;;;;:::o;12927:2440:23:-;13322:25;;;13301:92;;;;;;;;;;;;;;13621:46;;;;13600:106;;;;;;;;;;;;;;13988:5;:22;;;13914:70;13922:9;:37;;;13961:22;13914:7;:70::i;:::-;:96;;13893:157;;;;;;;;;;;;;;15261:55;15269:5;:22;;;15293;15261:7;:55::i;:::-;15177;15185:22;15209:5;:22;;;15177:7;:55::i;:::-;:139;;15156:204;;;;;;;;;;;;;;12927:2440;;;;;:::o;9384:792::-;9662:72;9670:27;9699:11;:34;;;9662:7;:72::i;:::-;9642:17;;;;:6;:17;;;;;;;;;:92;;;;9821:25;;;;9789:18;;9910:34;;9958;;;;10006:24;;;;10044;;;;10105:20;;;;10139;;;;9771:398;;9642:17;;9771:398;;;;;;;;;;;;;;9860:12;;9886:10;;9910:34;;9958;;10006:24;;10139:20;9771:398;;;;;;;;;;9384:792;;;;;:::o;11972:2233:24:-;12219:25;12247:14;;;;;;;;;;;;;;;;;;;;;;;12219:42;;12305:202;12339:9;:24;;;12377:9;:22;;;12413:10;:23;;;12450:18;:24;;;:47;;;12305:20;:202::i;:::-;12551:25;;;;12590:23;;12627:22;;12663:23;;:46;;;12517:202;;12551:25;12590:23;12627:22;12517:20;:202::i;:::-;12729:189;12763:9;:24;;;12801:9;:22;;;12837:12;12863:18;:45;;;12729:20;:189::i;:::-;12951:185;12985:12;13011:9;:22;;;13047:9;:29;;;13090:18;:23;;;:36;;;12951:20;:185::i;:::-;13146:188;13180:12;13206:10;:23;;;13243:10;:30;;;13287:18;:24;;;:37;;;13146:20;:188::i;:::-;13404:10;:30;;;13371:63;;:9;:29;;;:63;;;13367:832;;;13450:301;13488:12;13518;13548:9;:29;;;13595:142;13624:18;:23;;;:36;;;13682:18;:24;;;:37;;;13595:7;:142::i;:::-;13450:20;:301::i;:::-;13367:832;;;13782:195;13820:12;13850;13880:9;:29;;;13927:18;:23;;;:36;;;13782:20;:195::i;:::-;13991:197;14029:12;14059;14089:10;:30;;;14137:18;:24;;;:37;;;13991:20;:197::i;1011:10099:37:-;5031:4;5025:11;;5321:66;5314:4;5291:28;;;5284:104;;;;1199:30;5445:4;5422:28;;6444:59;;;6770:19;;5736:26;;;6750:40;;;6883:23;;;6877:30;6853:22;;;6846:62;6979:23;;;6973:30;6949:22;;;6942:62;7082:23;;;7076:30;7052:22;;;7045:62;7197:4;7179:23;;7173:30;7149:22;;;7142:62;7297:4;7279:23;;7273:30;7249:22;;;7242:62;7397:4;7379:23;;7373:30;7349:22;;;7342:62;7495:4;7477:23;;7471:30;7447:22;;;7440:62;7594:5;7576:24;;7570:31;7545:23;;;7538:64;7699:5;7681:24;;7675:31;7650:23;;;7643:64;7787:5;7769:24;;7763:31;;7738:23;;;7731:64;;;7895:5;7877:24;;7871:31;7846:23;;;7839:64;7979:5;8106:74;;8268:24;8340:19;;7962:23;;;8544:34;;;5025:11;;5422:28;;;;6536:27;;;;5736:26;;8606:22;;;;8388:23;;;;8464:4;8445:24;;8441:35;6190:1;8698:237;8721:13;8718:1;8715:20;8698:237;;;8791:19;;8771:40;;8860:4;8843:22;;;;8898:23;;;;8749:1;8742:9;8698:237;;;-1:-1:-1;;;;9045:31:37;;;9029:13;9010:33;;;9003:74;;;;9171:17;;9165:24;9237:19;;9441:34;;;9037:4;9503:22;;;;9285:23;;;;9361:4;9342:24;;9338:35;9610:1;9596:237;9619:13;9616:1;9613:20;9596:237;;;9689:19;;9669:40;;9758:4;9741:22;;;;9796:23;;;;9647:1;9640:9;9596:237;;;-1:-1:-1;;;9902:46:37;;;-1:-1:-1;10133:33:37;;;10003:4;9981:27;;;10108:59;;;10281:19;;10472:34;;;9981:27;;10534:22;;;;10329:23;;;;10281:19;10405:4;10386:24;;10382:35;-1:-1:-1;10613:237:37;10636:13;10633:1;10630:20;10613:237;;;10706:19;;10686:40;;10775:4;10758:22;;;;10813:23;;;;10664:1;10657:9;10613:237;;;-1:-1:-1;;;10928:46:37;;;;;10902:73;;-1:-1:-1;11041:4:37;11034:25;-1:-1:-1;;;;;1011:10099:37;;;;;:::o;8809:332:23:-;8927:26;;:::i;:::-;8956:19;8969:5;8956:12;:19::i;:::-;8927:48;;9014:35;9032:5;9039:9;9014:17;:35::i;:::-;9086:48;9107:5;9114:9;:19;;;9086:20;:48::i;16922:513:27:-;17102:30;;:::i;:::-;17162:103;17193:5;17212:20;17246:9;17162:17;:103::i;:::-;17296:34;;;;17148:117;;-1:-1:-1;17296:58:27;;17275:125;;;;;;;;;;;;;502:208:57;588:7;632:6;;;;611:70;;;;;;;;;;;;;;-1:-1:-1;698:5:57;;;502:208;;;;;:::o;8313:448:53:-;8397:13;8458:1;8447;:8;:12;8426:92;;;;;;;;;;;;;;;;8568:8;;8566:1;;8568:12;;;;8566:15;;;;;;;;;;8680:8;;8676:16;;8705:17;;;-1:-1:-1;8566:15:53;;;;;;;8313:448::o;13290:490::-;13411:14;13474:5;13482:2;13474:10;13462:1;:8;:22;;13441:107;;;;;;;;;;;;;;;;-1:-1:-1;13727:13:53;13629:2;13727:13;13721:20;;13290:490::o;8292:1482:25:-;8507:135;;8455:12;;8483:21;;8543:48;;8507:135;;8605:4;;8623:9;;8507:135;;;;;;;;22:32:-1;26:21;;;22:32;6:49;;8507:135:25;;;49:4:-1;25:18;;;61:17;;8507:135:25;182:15:-1;8507:135:25;;;;179:29:-1;;;;160:49;;8943:15:25;;8507:135;;-1:-1:-1;49:4;25:18;;;8816:13:25;8763:3;8735:380;9136:7;9156:422;;;;9596:1;9591:143;;;;9129:605;;9156:422;9246:66;9243:1;9236:77;9341:66;9337:2;9330:78;9436:66;9432:2;9425:78;9531:1;9527:2;9520:13;9560:3;9557:1;9550:14;9591:143;-1:-1:-1;;9706:14:25;;8292:1482;-1:-1:-1;;;;;8292:1482:25:o;8956:482:53:-;9043:14;9106:2;9094:1;:8;:14;;9073:99;;;;;;;;;;;;;;;;9224:29;9236:1;9250:2;9239:1;:8;:13;9224:11;:29::i;:::-;9356:8;;9352:17;;9382;;;-1:-1:-1;9215:38:53;8956:482::o;10213:1561:25:-;10465:165;;10413:12;;10441:21;;10501:51;;10465:165;;10566:4;;10512:13;;10611:9;;10465:165;;;;;;;;22:32:-1;26:21;;;22:32;6:49;;10465:165:25;;;49:4:-1;25:18;;;61:17;;10465:165:25;182:15:-1;10465:165:25;;;;179:29:-1;;;;160:49;;10937:15:25;;10465:165;;-1:-1:-1;49:4;25:18;;;10805:16:25;10751:3;10723:389;11133:7;11153:425;;;;11596:1;11591:143;;;;11126:608;;11153:425;11246:66;11243:1;11236:77;11341:66;11337:2;11330:78;11436:66;11432:2;11425:78;11531:1;11527:2;11520:13;11560:3;11557:1;11550:14;11591:143;11712:7;11706:14;11695:25;;11126:608;-1:-1:-1;;;10213:1561:25;;;;;;;:::o;3123:425:42:-;3287:21;3345:15;;;3324:78;;;;;;;;;;;;;;3429:82;3450:26;3458:9;3469:6;3450:7;:26::i;:::-;3490:11;3429:7;:82::i;:::-;3413:98;3123:425;-1:-1:-1;;;;3123:425:42:o;3175:1222:26:-;827:146:48;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;26:21:-1;;;22:32;;6:49;;827:146:48;;;;;;;;817:157;;3339:14:26;;;;;;827:146:48;;;;817:157;;;;827:146;817:157;36:153:-1;66:2;58:11;;36:153;;176:10;;164:23;;139:12;;;;;98:2;89:12;;;;114;36:153;;;299:10;344;;263:2;259:12;;;254:3;250:22;246:30;;311:9;;295:26;;;340:21;;377:20;365:33;;817:157:48;;;;;;;;;;;3456:15:26;;817:157:48;;-1:-1:-1;3456:15:26;;-1:-1:-1;817:157:48;;-1:-1:-1;817:157:48;;3456:15:26;;;-1:-1:-1;3456:15:26;817:157:48;3456:15:26;36:153:-1;66:2;58:11;;36:153;;176:10;;164:23;;139:12;;;;;98:2;89:12;;;;114;36:153;;;299:10;344;;263:2;259:12;;;254:3;250:22;246:30;;311:9;;295:26;;;340:21;;377:20;365:33;;3456:15:26;;;;;;;;;;;;3834:26;;;3960:15;;3953:29;;;;-1:-1:-1;4105:42:26;4086:62;;;;4069:15;;;4062:87;;;;-1:-1:-1;;4199:2:26;4187:15;;4180:33;-1:-1:-1;;4354:3:26;4336:22;;;;3175:1222;-1:-1:-1;3175:1222:26:o;1834:924:39:-;1985:18;;2297:2;2291:9;2329:66;2314:82;;2446:1;2434:14;;2427:40;;;;2564:2;2552:15;;2545:35;;;;2716:2;2698:21;;;1834:924::o;4211:202:43:-;4300:17;4345:35;4363:16;4373:5;4363:9;:16::i;1371:135:57:-;1456:7;1490:1;1486;:5;:13;;1498:1;1486:13;;;-1:-1:-1;1494:1:57;;1479:20;-1:-1:-1;1371:135:57:o;16651:887:23:-;16802:30;;:::i;:::-;16897:34;;;:59;;;17078:22;;;;17114;;;;17003:143;;16934:22;;17003:25;:143::i;:::-;16966:180;;;17270:22;;;;17306:14;;;;17183:147;;16966:180;17270:22;17183:25;:147::i;:::-;17156:24;;;:174;17442:22;;;;17478:14;;;;17367:135;;17406:22;;17367:25;:135::i;:::-;17340:24;;;:162;16651:887;;;;:::o;17848:932::-;18055:14;;;18027:25;18055:14;;;;;;;;;;;;;;;;;;;;18113:20;;;;18147:18;;18205:34;;18079:170;;18113:20;18147:18;18179:12;;18079:20;:170::i;:::-;18259;18293:5;:20;;;18327:12;18353:5;:18;;;18385:11;:34;;;18259:20;:170::i;:::-;18439:165;18473:12;18499:5;:18;;;18531:5;:25;;;18570:11;:24;;;18439:20;:165::i;:::-;18614:159;18648:12;18674;18700:5;:25;;;18739:11;:24;;;18614:20;:159::i;716:230:57:-;802:7;837:5;;;873:6;;;;852:69;;;;;;;;;;;;;;938:1;931:8;;716:230;;;;;;:::o;51:288::-;137:7;;164:6;;160:45;;;193:1;186:8;;;;160:45;-1:-1:-1;226:5:57;;;230:1;226;:5;262;;;;;;;;:10;241:73;;;;;;;;;;;;;1012:624:42;1180:21;1238:15;;;1217:78;;;;;;;;;;;;;;1328:114;1366:9;1393:11;1422:6;1328:20;:114::i;:::-;1327:115;1306:176;;;;;;;;;;;;;1959:889;2126:21;2184:15;;;2163:78;;;;;;;;;;;;;;2274:113;2311:9;2338:11;2367:6;2274:19;:113::i;:::-;2273:114;2252:175;;;;;;;;;;;;;;2649:162;2670:106;2695:26;2703:9;2714:6;2695:7;:26::i;:::-;2739:23;2747:11;2760:1;2739:7;:23::i;:::-;2670:7;:106::i;2482:5147:22:-;3031:19;3290:18;2718:1;2709:6;:10;:24;;;;;2731:2;2723:10;;:4;:10;;;;2709:24;2705:4918;;;2822:16;;2841:1;-1:-1:-1;2797:109:22;;;;;;;;;;;;;;-1:-1:-1;;3153:2:22;3138:18;;;3111:46;3179:66;3107:156;3311:26;;;;:12;:26;;;;;;;;;;3422:24;;;3397:109;;;;;;;;;;;;;;4923:2;4917:9;5239:15;5234:2;5222:9;5216:16;5212:25;5208:47;5392:14;5387:3;5383:24;5374:7;5370:38;5676:66;5667:7;5660:83;6160:3;6156:1;6147:7;6143:15;6136:28;6216:42;6210:4;6206:53;6201:2;6192:7;6188:16;6181:79;6310:42;6306:2;6302:51;6297:2;6288:7;6284:16;6277:77;6397:6;6391:3;6382:7;6378:17;6371:33;6563:3;6554:7;6550:17;6645:206;6665:5;6655:8;6652:19;6645:206;;;6714:16;;6697:34;;6778:2;6815:18;;;;6764:17;6645:206;;;7417:3;7346:7;7292;7285:5;7281:19;7208:7;7142:1;7067:10;7004:3;6978:512;7517:7;7510:15;7507:2;;;7564:16;7555:7;7548:33;7507:2;4724:2889;;;;;;2482:5147;;;;;;:::o;15564:816:23:-;15828:21;;16220:20;;15828:52;;15859:20;15828:52;15807:115;;;;;;;;;;;;;;15996:19;;;;:33;;;15992:170;;16070:19;;;;:33;;16093:10;16070:33;16045:106;;;;;;;;;;;;;;16243:26;:24;:26::i;:::-;16300:18;;16220:49;;-1:-1:-1;16300:34:23;;;;;;;16279:94;;;;;;;;;;;;;;15564:816;;;:::o;10478:422::-;10626:20;;;;:9;:20;;;;;;;:27;;;;10649:4;10626:27;;;10743:25;;;;10711:18;;10829:20;;;;10863;;;;10691:202;;10636:9;;10691:202;;;;;;;;;;;;;;10782:10;;10863:20;10691:202;;;;;;;;;;10478:422;;:::o;10268:886:53:-;10389:14;10452:5;10460:2;10452:10;10440:1;:8;:22;;10419:135;;;;;;;;;;;;;;;;-1:-1:-1;11056:13:53;10801:2;11056:13;11050:20;11072:42;11046:69;;10268:886::o;345:151:57:-;431:7;454:9;470:1;466;:5;;;;;;;;;345:151;-1:-1:-1;;;;345:151:57:o;4553:1678:43:-;777:457;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;22:32:-1;26:21;;;22:32;6:49;;777:457:43;;;;;;;;767:468;;4639:14;;;;;;;;777:457;;;;;767:468;;;;777:457;767:468;36:153:-1;66:2;58:11;;36:153;;176:10;;164:23;;139:12;;;;;98:2;89:12;;;;114;36:153;;;299:10;344;;263:2;259:12;;;254:3;250:22;246:30;;311:9;;295:26;;;340:21;;377:20;365:33;;767:468:43;;;;;;;;;;;4763:20;;;;4753:31;;767:468;;-1:-1:-1;4763:20:43;-1:-1:-1;767:468:43;;-1:-1:-1;767:468:43;;4753:31;;;-1:-1:-1;4753:31:43;767:468;4753:31;36:153:-1;66:2;58:11;;36:153;;176:10;;164:23;;139:12;;;;;98:2;89:12;;;;114;36:153;;;299:10;344;;263:2;259:12;;;254:3;250:22;246:30;;311:9;;295:26;;;340:21;;377:20;365:33;;4753:31:43;;;;;;;;;;;4833:20;;;;4823:31;;4753;;-1:-1:-1;4833:20:43;-1:-1:-1;4753:31:43;;-1:-1:-1;4753:31:43;;4823;;;-1:-1:-1;4823:31:43;4753;4823;36:153:-1;66:2;58:11;;36:153;;176:10;;164:23;;139:12;;;;;98:2;89:12;;;;114;36:153;;;299:10;344;;263:2;259:12;;;;254:3;250:22;246:30;;311:9;;295:26;;;340:21;;377:20;;;;365:33;;4823:31:43;;;;;;;;;;5620:14;;;5763:11;;5670:3;5659:15;;5800:11;;5710:3;5699:15;;;5837:11;;5903:24;;;5940:32;;;5985;;;6056:3;6040:20;;6109:19;;6141;;;-1:-1:-1;;;6173:19:43;;;-1:-1:-1;6040:20:43;;4553:1678;-1:-1:-1;4553:1678:43:o;4779:1869:42:-;4942:12;;4991:15;;;4970:78;;;;;;;;;;;;;;5868:11;;;:29;;-1:-1:-1;5883:14:42;;5868:29;5864:72;;;5920:5;5913:12;;;;5864:72;6522:11;6459:84;;;;;;;6499:9;6479:6;6459:84;6439:104;;6591:26;6599:9;6610:6;6591:7;:26::i;:::-;6563:24;6571:4;6577:9;6563:7;:24::i;:::-;:54;;;4779:1869;-1:-1:-1;;;;;4779:1869:42:o;6909:918::-;7071:12;;7120:15;;;7099:78;;;;;;;;;;;;;;7250:11;;;:29;;-1:-1:-1;7265:14:42;;7250:29;7246:257;;;7487:5;7480:12;;;;7246:257;7634:11;7571:84;;;;;;;7611:9;7591:6;7571:84;7551:104;;7711:11;7677:31;7685:11;7698:9;7677:7;:31::i;:::-;:45;;;;;;;;7665:57;;7770:26;7778:9;7789:6;7770:7;:26::i;897:514:21:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;;;:::o;:::-;;;;;;;;;-1:-1:-1;897:514:21;;;;;;;;;;;;;;;;;:::o;5:118:-1:-;;72:46;110:6;97:20;72:46;;146:693;;261:4;249:17;;245:27;-1:-1;235:2;;286:1;283;276:12;235:2;323:6;310:20;345:85;360:69;422:6;360:69;;;345:85;;;458:21;;;502:4;490:17;;;;336:94;;-1:-1;515:14;;490:17;610:1;595:238;620:6;617:1;614:13;595:238;;;703:3;690:17;682:6;678:30;727:42;765:3;753:10;727:42;;;715:55;;-1:-1;793:4;784:14;;;;812;;;;;642:1;635:9;595:238;;;599:14;228:611;;;;;;;;879:735;;1008:4;996:17;;992:27;-1:-1;982:2;;1033:1;1030;1023:12;982:2;1070:6;1057:20;1092:99;1107:83;1183:6;1107:83;;1092:99;1219:21;;;1263:4;1251:17;;;;1083:108;;-1:-1;1276:14;;1251:17;1371:1;1356:252;1381:6;1378:1;1375:13;1356:252;;;1464:3;1451:17;1443:6;1439:30;1488:56;1540:3;1528:10;1488:56;;;1476:69;;-1:-1;1568:4;1559:14;;;;1587;;;;;1403:1;1396:9;1356:252;;1640:707;;1750:4;1738:17;;1734:27;-1:-1;1724:2;;1775:1;1772;1765:12;1724:2;1812:6;1799:20;1834:80;1849:64;1906:6;1849:64;;1834:80;1825:89;;1931:5;1956:6;1949:5;1942:21;1986:4;1978:6;1974:17;1964:27;;2008:4;2003:3;1999:14;1992:21;;2061:6;2108:3;2100:4;2092:6;2088:17;2083:3;2079:27;2076:36;2073:2;;;2125:1;2122;2115:12;2073:2;2150:1;2135:206;2160:6;2157:1;2154:13;2135:206;;;2218:3;2240:37;2273:3;2261:10;2240:37;;;2228:50;;-1:-1;2301:4;2292:14;;;;2320;;;;;2182:1;2175:9;2135:206;;2355:112;;2419:43;2454:6;2441:20;2419:43;;2474:118;;2541:46;2579:6;2566:20;2541:46;;2599:116;;2665:45;2702:6;2689:20;2665:45;;2722:120;;2799:38;2829:6;2823:13;2799:38;;2863:335;;;2970:4;2958:17;;2954:27;-1:-1;2944:2;;2995:1;2992;2985:12;2944:2;-1:-1;3015:20;;3055:18;3044:30;;3041:2;;;3087:1;3084;3077:12;3041:2;3121:4;3113:6;3109:17;3097:29;;3171:3;3164;3156:6;3152:16;3142:8;3138:31;3135:40;3132:2;;;3188:1;3185;3178:12;3132:2;2937:261;;;;;;3207:432;;3297:4;3285:17;;3281:27;-1:-1;3271:2;;3322:1;3319;3312:12;3271:2;3359:6;3346:20;3381:60;3396:44;3433:6;3396:44;;3381:60;3372:69;;3461:6;3454:5;3447:21;3497:4;3489:6;3485:17;3530:4;3523:5;3519:16;3565:3;3556:6;3551:3;3547:16;3544:25;3541:2;;;3582:1;3579;3572:12;3541:2;3592:41;3626:6;3621:3;3616;3592:41;;;3264:375;;;;;;;;4124:2205;;4232:5;4220:9;4215:3;4211:19;4207:31;4204:2;;;4251:1;4248;4241:12;4204:2;4269:21;4284:5;4269:21;;;4260:30;-1:-1;4348:1;4379:49;4424:3;4404:9;4379:49;;;4355:74;;-1:-1;4498:2;4531:49;4576:3;4552:22;;;4531:49;;;4524:4;4517:5;4513:16;4506:75;4450:142;4657:2;4690:49;4735:3;4726:6;4715:9;4711:22;4690:49;;;4683:4;4676:5;4672:16;4665:75;4602:149;4810:2;4843:49;4888:3;4879:6;4868:9;4864:22;4843:49;;;4836:4;4829:5;4825:16;4818:75;4761:143;4966:3;5000:49;5045:3;5036:6;5025:9;5021:22;5000:49;;;4993:4;4986:5;4982:16;4975:75;4914:147;5123:3;5157:49;5202:3;5193:6;5182:9;5178:22;5157:49;;;5150:4;5143:5;5139:16;5132:75;5071:147;5272:3;5306:49;5351:3;5342:6;5331:9;5327:22;5306:49;;;5299:4;5292:5;5288:16;5281:75;5228:139;5421:3;5455:49;5500:3;5491:6;5480:9;5476:22;5455:49;;;5448:4;5441:5;5437:16;5430:75;5377:139;5583:3;5618:49;5663:3;5654:6;5643:9;5639:22;5618:49;;;5610:5;5603;5599:17;5592:76;5526:153;5729:3;5764:49;5809:3;5800:6;5789:9;5785:22;5764:49;;;5756:5;5749;5745:17;5738:76;5689:136;5913:3;5902:9;5898:19;5885:33;5938:18;5930:6;5927:30;5924:2;;;5970:1;5967;5960:12;5924:2;6006:54;6056:3;6047:6;6036:9;6032:22;6006:54;;;5998:5;5991;5987:17;5980:81;5835:237;6160:3;6149:9;6145:19;6132:33;6185:18;6177:6;6174:30;6171:2;;;6217:1;6214;6207:12;6171:2;6253:54;6303:3;6294:6;6283:9;6279:22;6253:54;;;6245:5;6238;6234:17;6227:81;6082:237;4198:2131;;;;;8705:241;;8809:2;8797:9;8788:7;8784:23;8780:32;8777:2;;;8825:1;8822;8815:12;8777:2;8860:1;8877:53;8922:7;8902:9;8877:53;;8953:366;;;9074:2;9062:9;9053:7;9049:23;9045:32;9042:2;;;9090:1;9087;9080:12;9042:2;9125:1;9142:53;9187:7;9167:9;9142:53;;;9132:63;;9104:97;9232:2;9250:53;9295:7;9286:6;9275:9;9271:22;9250:53;;;9240:63;;9211:98;9036:283;;;;;;9326:360;;;9444:2;9432:9;9423:7;9419:23;9415:32;9412:2;;;9460:1;9457;9450:12;9412:2;9495:1;9512:53;9557:7;9537:9;9512:53;;;9502:63;;9474:97;9602:2;9620:50;9662:7;9653:6;9642:9;9638:22;9620:50;;9693:415;;9841:2;9829:9;9820:7;9816:23;9812:32;9809:2;;;9857:1;9854;9847:12;9809:2;9892:31;;9943:18;9932:30;;9929:2;;;9975:1;9972;9965:12;9929:2;9995:97;10084:7;10075:6;10064:9;10060:22;9995:97;;10115:947;;;;10352:2;10340:9;10331:7;10327:23;10323:32;10320:2;;;10368:1;10365;10358:12;10320:2;10403:31;;10454:18;10443:30;;10440:2;;;10486:1;10483;10476:12;10440:2;10506:97;10595:7;10586:6;10575:9;10571:22;10506:97;;;10496:107;;10382:227;10668:2;10657:9;10653:18;10640:32;10692:18;10684:6;10681:30;10678:2;;;10724:1;10721;10714:12;10678:2;10744:78;10814:7;10805:6;10794:9;10790:22;10744:78;;;10734:88;;10619:209;10887:2;10876:9;10872:18;10859:32;10911:18;10903:6;10900:30;10897:2;;;10943:1;10940;10933:12;10897:2;10963:83;11038:7;11029:6;11018:9;11014:22;10963:83;;;10953:93;;10838:214;10314:748;;;;;;11069:811;;;;11281:2;11269:9;11260:7;11256:23;11252:32;11249:2;;;11297:1;11294;11287:12;11249:2;11332:31;;11383:18;11372:30;;11369:2;;;11415:1;11412;11405:12;11369:2;11435:97;11524:7;11515:6;11504:9;11500:22;11435:97;;;11425:107;;11311:227;11569:2;11587:53;11632:7;11623:6;11612:9;11608:22;11587:53;;11887:241;;11991:2;11979:9;11970:7;11966:23;11962:32;11959:2;;;12007:1;12004;11997:12;11959:2;12042:1;12059:53;12104:7;12084:9;12059:53;;12135:366;;;12256:2;12244:9;12235:7;12231:23;12227:32;12224:2;;;12272:1;12269;12262:12;12224:2;12307:1;12324:53;12369:7;12349:9;12324:53;;12508:615;;;;;12665:2;12653:9;12644:7;12640:23;12636:32;12633:2;;;12681:1;12678;12671:12;12633:2;12716:1;12733:53;12778:7;12758:9;12733:53;;;12723:63;;12695:97;12823:2;12841:53;12886:7;12877:6;12866:9;12862:22;12841:53;;;12831:63;;12802:98;12959:2;12948:9;12944:18;12931:32;12983:18;12975:6;12972:30;12969:2;;;13015:1;13012;13005:12;12969:2;13043:64;13099:7;13090:6;13079:9;13075:22;13043:64;;;12627:496;;;;-1:-1;13025:82;-1:-1;;;;12627:496;13130:595;;;;13277:2;13265:9;13256:7;13252:23;13248:32;13245:2;;;13293:1;13290;13283:12;13245:2;13328:1;13345:53;13390:7;13370:9;13345:53;;;13335:63;;13307:97;13435:2;13453:53;13498:7;13489:6;13478:9;13474:22;13453:53;;;13443:63;;13414:98;13571:2;13560:9;13556:18;13543:32;13595:18;13587:6;13584:30;13581:2;;;13627:1;13624;13617:12;13581:2;13647:62;13701:7;13692:6;13681:9;13677:22;13647:62;;13732:239;;13835:2;13823:9;13814:7;13810:23;13806:32;13803:2;;;13851:1;13848;13841:12;13803:2;13886:1;13903:52;13947:7;13927:9;13903:52;;13978:261;;14092:2;14080:9;14071:7;14067:23;14063:32;14060:2;;;14108:1;14105;14098:12;14060:2;14143:1;14160:63;14215:7;14195:9;14160:63;;14246:373;;14373:2;14361:9;14352:7;14348:23;14344:32;14341:2;;;14389:1;14386;14379:12;14341:2;14424:31;;14475:18;14464:30;;14461:2;;;14507:1;14504;14497:12;14461:2;14527:76;14595:7;14586:6;14575:9;14571:22;14527:76;;14626:1089;;;;;14845:3;14833:9;14824:7;14820:23;14816:33;14813:2;;;14862:1;14859;14852:12;14813:2;14897:31;;14948:18;14937:30;;14934:2;;;14980:1;14977;14970:12;14934:2;15000:76;15068:7;15059:6;15048:9;15044:22;15000:76;;;14990:86;;14876:206;15141:2;15130:9;15126:18;15113:32;15165:18;15157:6;15154:30;15151:2;;;15197:1;15194;15187:12;15151:2;15217:76;15285:7;15276:6;15265:9;15261:22;15217:76;;;15207:86;;15092:207;15358:2;15347:9;15343:18;15330:32;15382:18;15374:6;15371:30;15368:2;;;15414:1;15411;15404:12;15368:2;15434:62;15488:7;15479:6;15468:9;15464:22;15434:62;;;15424:72;;15309:193;15561:2;15550:9;15546:18;15533:32;15585:18;15577:6;15574:30;15571:2;;;15617:1;15614;15607:12;15571:2;15637:62;15691:7;15682:6;15671:9;15667:22;15637:62;;;15627:72;;15512:193;14807:908;;;;;;;;15722:727;;;;15892:2;15880:9;15871:7;15867:23;15863:32;15860:2;;;15908:1;15905;15898:12;15860:2;15943:31;;15994:18;15983:30;;15980:2;;;16026:1;16023;16016:12;15980:2;16046:76;16114:7;16105:6;16094:9;16090:22;16046:76;;;16036:86;;15922:206;16159:2;16177:53;16222:7;16213:6;16202:9;16198:22;16177:53;;16704:865;;;;;;;16897:3;16885:9;16876:7;16872:23;16868:33;16865:2;;;16914:1;16911;16904:12;16865:2;16949:1;16966:53;17011:7;16991:9;16966:53;;;16956:63;;16928:97;17056:2;17074:53;17119:7;17110:6;17099:9;17095:22;17074:53;;;17064:63;;17035:98;17192:2;17181:9;17177:18;17164:32;17216:18;17208:6;17205:30;17202:2;;;17248:1;17245;17238:12;17202:2;17276:64;17332:7;17323:6;17312:9;17308:22;17276:64;;;17258:82;;;;17143:203;17405:2;17394:9;17390:18;17377:32;17429:18;17421:6;17418:30;17415:2;;;17461:1;17458;17451:12;17415:2;17489:64;17545:7;17536:6;17525:9;17521:22;17489:64;;;17471:82;;;;17356:203;16859:710;;;;;;;;;17576:110;17649:31;17674:5;17649:31;;;17644:3;17637:44;17631:55;;;17760:755;;17941:77;18012:5;17941:77;;;18036:6;18031:3;18024:19;18060:4;18055:3;18051:14;18044:21;;18105:79;18178:5;18105:79;;;18205:1;18190:303;18215:6;18212:1;18209:13;18190:303;;;18255:103;18354:3;18345:6;18339:13;18255:103;;;18375:83;18451:6;18375:83;;;18481:4;18472:14;;;;;18365:93;-1:-1;18237:1;18230:9;18190:303;;;-1:-1;18506:3;;17920:595;-1:-1;;;;17920:595;18523:101;18590:28;18612:5;18590:28;;18631:110;18704:31;18729:5;18704:31;;18748:107;18819:30;18843:5;18819:30;;18862:297;;18962:38;18994:5;18962:38;;;19017:6;19012:3;19005:19;19029:63;19085:6;19078:4;19073:3;19069:14;19062:4;19055:5;19051:16;19029:63;;;19124:29;19146:6;19124:29;;;19104:50;;;19117:4;19104:50;;18942:217;-1:-1;;;18942:217;19462:156;19555:57;19606:5;19555:57;;19925:296;20080:2;20068:15;;20117:66;20112:2;20103:12;;20096:88;20212:2;20203:12;;20061:160;20230:296;20385:2;20373:15;;20422:66;20417:2;20408:12;;20401:88;20517:2;20508:12;;20366:160;20535:296;20690:2;20678:15;;20727:66;20722:2;20713:12;;20706:88;20822:2;20813:12;;20671:160;20840:296;20995:2;20983:15;;21032:66;21027:2;21018:12;;21011:88;21127:2;21118:12;;20976:160;21145:296;21300:2;21288:15;;21337:66;21332:2;21323:12;;21316:88;21432:2;21423:12;;21281:160;21450:397;21605:2;21593:15;;21642:66;21637:2;21628:12;;21621:88;21743:66;21738:2;21729:12;;21722:88;21838:2;21829:12;;21586:261;21856:296;22011:2;21999:15;;22048:66;22043:2;22034:12;;22027:88;22143:2;22134:12;;21992:160;22161:296;22316:2;22304:15;;22353:66;22348:2;22339:12;;22332:88;22448:2;22439:12;;22297:160;22466:296;22621:2;22609:15;;22658:66;22653:2;22644:12;;22637:88;22753:2;22744:12;;22602:160;22771:296;22926:2;22914:15;;22963:66;22958:2;22949:12;;22942:88;23058:2;23049:12;;22907:160;23076:296;23231:2;23219:15;;23268:66;23263:2;23254:12;;23247:88;23363:2;23354:12;;23212:160;23381:296;23536:2;23524:15;;23573:66;23568:2;23559:12;;23552:88;23668:2;23659:12;;23517:160;23686:296;23841:2;23829:15;;23878:66;23873:2;23864:12;;23857:88;23973:2;23964:12;;23822:160;23991:296;24146:2;24134:15;;24183:66;24178:2;24169:12;;24162:88;24278:2;24269:12;;24127:160;24296:296;24451:2;24439:15;;24488:66;24483:2;24474:12;;24467:88;24583:2;24574:12;;24432:160;24601:296;24756:2;24744:15;;24793:66;24788:2;24779:12;;24772:88;24888:2;24879:12;;24737:160;24906:296;25061:2;25049:15;;25098:66;25093:2;25084:12;;25077:88;25193:2;25184:12;;25042:160;25211:296;25366:2;25354:15;;25403:66;25398:2;25389:12;;25382:88;25498:2;25489:12;;25347:160;25516:397;25671:2;25659:15;;25708:66;25703:2;25694:12;;25687:88;25809:66;25804:2;25795:12;;25788:88;25904:2;25895:12;;25652:261;25922:296;26077:2;26065:15;;26114:66;26109:2;26100:12;;26093:88;26209:2;26200:12;;26058:160;26227:296;26382:2;26370:15;;26419:66;26414:2;26405:12;;26398:88;26514:2;26505:12;;26363:160;26532:296;26687:2;26675:15;;26724:66;26719:2;26710:12;;26703:88;26819:2;26810:12;;26668:160;26837:296;26992:2;26980:15;;27029:66;27024:2;27015:12;;27008:88;27124:2;27115:12;;26973:160;27142:296;27297:2;27285:15;;27334:66;27329:2;27320:12;;27313:88;27429:2;27420:12;;27278:160;27447:296;27602:2;27590:15;;27639:66;27634:2;27625:12;;27618:88;27734:2;27725:12;;27583:160;27752:296;27907:2;27895:15;;27944:66;27939:2;27930:12;;27923:88;28039:2;28030:12;;27888:160;28057:296;28212:2;28200:15;;28249:66;28244:2;28235:12;;28228:88;28344:2;28335:12;;28193:160;28362:397;28517:2;28505:15;;28554:66;28549:2;28540:12;;28533:88;28655:66;28650:2;28641:12;;28634:88;28750:2;28741:12;;28498:261;28768:296;28923:2;28911:15;;28960:66;28955:2;28946:12;;28939:88;29055:2;29046:12;;28904:160;29073:296;29228:2;29216:15;;29265:66;29260:2;29251:12;;29244:88;29360:2;29351:12;;29209:160;29378:296;29533:2;29521:15;;29570:66;29565:2;29556:12;;29549:88;29665:2;29656:12;;29514:160;29683:296;29838:2;29826:15;;29875:66;29870:2;29861:12;;29854:88;29970:2;29961:12;;29819:160;29988:296;30143:2;30131:15;;30180:66;30175:2;30166:12;;30159:88;30275:2;30266:12;;30124:160;30369:888;30597:22;;30510:4;30501:14;;;30631:61;30505:3;30597:22;30631:61;;;30530:174;30798:4;30791:5;30787:16;30781:23;30816:62;30872:4;30867:3;30863:14;30850:11;30816:62;;;30714:176;30974:4;30967:5;30963:16;30957:23;30992:62;31048:4;31043:3;31039:14;31026:11;30992:62;;;30900:166;31150:4;31143:5;31139:16;31133:23;31168:62;31224:4;31219:3;31215:14;31202:11;31168:62;;32323:815;32548:22;;32478:5;32469:15;;;32582:115;32473:3;32548:22;32582:115;;;32499:210;32786:4;32779:5;32775:16;32769:23;32804:116;32914:4;32909:3;32905:14;32892:11;32804:116;;;32719:213;33030:4;33023:5;33019:16;33013:23;33048:63;33104:5;33099:3;33095:15;33082:11;33048:63;;33206:695;33419:22;;33343:4;33334:14;;;33453:57;33338:3;33419:22;33453:57;;;33363:159;33603:4;33596:5;33592:16;33586:23;33621:62;33677:4;33672:3;33668:14;33655:11;33621:62;;;33532:163;33794:4;33787:5;33783:16;33777:23;33812:62;33868:4;33863:3;33859:14;33846:11;33812:62;;34784:104;34853:29;34876:5;34853:29;;34895:193;35003:2;34988:18;;35017:61;34992:9;35051:6;35017:61;;35095:1057;35427:3;35412:19;;35442:61;35416:9;35476:6;35442:61;;;35514:62;35572:2;35561:9;35557:18;35548:6;35514:62;;;35587;35645:2;35634:9;35630:18;35621:6;35587:62;;;35660;35718:2;35707:9;35703:18;35694:6;35660:62;;;35733:63;35791:3;35780:9;35776:19;35767:6;35733:63;;;35807;35865:3;35854:9;35850:19;35841:6;35807:63;;;35919:9;35913:4;35909:20;35903:3;35892:9;35888:19;35881:49;35944:62;36001:4;35992:6;35944:62;;;35936:70;;36055:9;36049:4;36045:20;36039:3;36028:9;36024:19;36017:49;36080:62;36137:4;36128:6;36080:62;;;36072:70;35398:754;-1:-1;;;;;;;;;;35398:754;36159:547;36351:2;36336:18;;36365:61;36340:9;36399:6;36365:61;;;36474:9;36468:4;36464:20;36459:2;36448:9;36444:18;36437:48;36499:62;36556:4;36547:6;36499:62;;;36491:70;;36609:9;36603:4;36599:20;36594:2;36583:9;36579:18;36572:48;36634:62;36691:4;36682:6;36634:62;;;36626:70;36322:384;-1:-1;;;;;36322:384;36713:433;36917:2;36931:47;;;36902:18;;36992:144;36902:18;37122:6;36992:144;;37153:181;37255:2;37240:18;;37269:55;37244:9;37297:6;37269:55;;37341:193;37449:2;37434:18;;37463:61;37438:9;37497:6;37463:61;;37541:479;37723:2;37708:18;;37737:61;37712:9;37771:6;37737:61;;;37809:62;37867:2;37856:9;37852:18;37843:6;37809:62;;;37919:9;37913:4;37909:20;37904:2;37893:9;37889:18;37882:48;37944:66;38005:4;37996:6;37944:66;;38027:378;38181:2;38166:18;;38195:61;38170:9;38229:6;38195:61;;;38304:9;38298:4;38294:20;38289:2;38278:9;38274:18;38267:48;38329:66;38390:4;38381:6;38329:66;;38412:489;38600:3;38585:19;;38615:61;38589:9;38649:6;38615:61;;;38687:58;38741:2;38730:9;38726:18;38717:6;38687:58;;;38756:62;38814:2;38803:9;38799:18;38790:6;38756:62;;;38829;38887:2;38876:9;38872:18;38863:6;38829:62;;38908:290;39042:2;39027:18;;39056:59;39031:9;39088:6;39056:59;;;39126:62;39184:2;39173:9;39169:18;39160:6;39126:62;;39205:269;39327:2;39341:47;;;39312:18;;39402:62;39312:18;39450:6;39402:62;;39481:233;39609:2;39594:18;;39623:81;39598:9;39677:6;39623:81;;40001:387;40182:2;40196:47;;;40167:18;;40257:121;40167:18;40257:121;;40395:387;40576:2;40590:47;;;40561:18;;40651:121;40561:18;40651:121;;40789:387;40970:2;40984:47;;;40955:18;;41045:121;40955:18;41045:121;;41183:387;41364:2;41378:47;;;41349:18;;41439:121;41349:18;41439:121;;41577:387;41758:2;41772:47;;;41743:18;;41833:121;41743:18;41833:121;;41971:387;42152:2;42166:47;;;42137:18;;42227:121;42137:18;42227:121;;42365:387;42546:2;42560:47;;;42531:18;;42621:121;42531:18;42621:121;;42759:387;42940:2;42954:47;;;42925:18;;43015:121;42925:18;43015:121;;43153:387;43334:2;43348:47;;;43319:18;;43409:121;43319:18;43409:121;;43547:387;43728:2;43742:47;;;43713:18;;43803:121;43713:18;43803:121;;43941:387;44122:2;44136:47;;;44107:18;;44197:121;44107:18;44197:121;;44335:387;44516:2;44530:47;;;44501:18;;44591:121;44501:18;44591:121;;44729:387;44910:2;44924:47;;;44895:18;;44985:121;44895:18;44985:121;;45123:387;45304:2;45318:47;;;45289:18;;45379:121;45289:18;45379:121;;45517:387;45698:2;45712:47;;;45683:18;;45773:121;45683:18;45773:121;;45911:387;46092:2;46106:47;;;46077:18;;46167:121;46077:18;46167:121;;46305:387;46486:2;46500:47;;;46471:18;;46561:121;46471:18;46561:121;;46699:387;46880:2;46894:47;;;46865:18;;46955:121;46865:18;46955:121;;47093:387;47274:2;47288:47;;;47259:18;;47349:121;47259:18;47349:121;;47487:387;47668:2;47682:47;;;47653:18;;47743:121;47653:18;47743:121;;47881:387;48062:2;48076:47;;;48047:18;;48137:121;48047:18;48137:121;;48275:387;48456:2;48470:47;;;48441:18;;48531:121;48441:18;48531:121;;48669:387;48850:2;48864:47;;;48835:18;;48925:121;48835:18;48925:121;;49063:387;49244:2;49258:47;;;49229:18;;49319:121;49229:18;49319:121;;49457:387;49638:2;49652:47;;;49623:18;;49713:121;49623:18;49713:121;;49851:387;50032:2;50046:47;;;50017:18;;50107:121;50017:18;50107:121;;50245:387;50426:2;50440:47;;;50411:18;;50501:121;50411:18;50501:121;;50639:387;50820:2;50834:47;;;50805:18;;50895:121;50805:18;50895:121;;51033:387;51214:2;51228:47;;;51199:18;;51289:121;51199:18;51289:121;;51427:387;51608:2;51622:47;;;51593:18;;51683:121;51593:18;51683:121;;51821:387;52002:2;52016:47;;;51987:18;;52077:121;51987:18;52077:121;;52215:387;52396:2;52410:47;;;52381:18;;52471:121;52381:18;52471:121;;52609:387;52790:2;52804:47;;;52775:18;;52865:121;52775:18;52865:121;;53003:310;53169:3;53154:19;;53184:119;53158:9;53276:6;53184:119;;53320:338;53500:3;53485:19;;53515:133;53489:9;53621:6;53515:133;;53665:301;53827:2;53812:18;;53841:115;53816:9;53929:6;53841:115;;54173:256;54235:2;54229:9;54261:17;;;54336:18;54321:34;;54357:22;;;54318:62;54315:2;;;54393:1;54390;54383:12;54315:2;54409;54402:22;54213:216;;-1:-1;54213:216;54436:263;;54600:18;54592:6;54589:30;54586:2;;;54632:1;54629;54622:12;54586:2;-1:-1;54661:4;54649:17;;;54679:15;;54523:176;55255:254;;55394:18;55386:6;55383:30;55380:2;;;55426:1;55423;55416:12;55380:2;-1:-1;55499:4;55470;55447:17;;;;55466:9;55443:33;55489:15;;55317:192;55783:144;55915:4;55903:17;;55884:43;55936:130;56049:12;;56033:33;56514:128;56594:42;56583:54;;56566:76;56649:92;56722:13;56715:21;;56698:43;56748:79;56817:5;56800:27;56834:151;56913:66;56902:78;;56885:100;57078:88;57156:4;57145:16;;57128:38;57737:135;;57836:31;57861:5;57836:31;;57880:145;57961:6;57956:3;57951;57938:30;-1:-1;58017:1;57999:16;;57992:27;57931:94;58034:268;58099:1;58106:101;58120:6;58117:1;58114:13;58106:101;;;58187:11;;;58181:18;58168:11;;;58161:39;58142:2;58135:10;58106:101;;;58222:6;58219:1;58216:13;58213:2;;;-1:-1;;58287:1;58269:16;;58262:27;58083:219;58310:97;58398:2;58378:14;58394:7;58374:28;;58358:49"
- }
- }
- },
- "sources": {
- "2.0.0/extensions/Forwarder/Forwarder.sol": {
- "id": 0
- },
- "2.0.0/extensions/Forwarder/MixinAssets.sol": {
- "id": 1
- },
- "2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol": {
- "id": 2
- },
- "2.0.0/extensions/Forwarder/MixinForwarderCore.sol": {
- "id": 3
- },
- "2.0.0/extensions/Forwarder/MixinWeth.sol": {
- "id": 4
- },
- "2.0.0/extensions/Forwarder/interfaces/IAssets.sol": {
- "id": 5
- },
- "2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol": {
- "id": 6
- },
- "2.0.0/extensions/Forwarder/libs/LibConstants.sol": {
- "id": 7
- },
- "2.0.0/extensions/Forwarder/mixins/MAssets.sol": {
- "id": 8
- },
- "2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol": {
- "id": 9
- },
- "2.0.0/extensions/Forwarder/mixins/MWeth.sol": {
- "id": 10
- },
- "2.0.0/extensions/OrderValidator/OrderValidator.sol": {
- "id": 11
- },
- "2.0.0/multisig/MultiSigWallet.sol": {
- "id": 12
- },
- "2.0.0/multisig/MultiSigWalletWithTimeLock.sol": {
- "id": 13
- },
- "2.0.0/protocol/AssetProxy/ERC20Proxy.sol": {
- "id": 14
- },
- "2.0.0/protocol/AssetProxy/ERC721Proxy.sol": {
- "id": 15
- },
- "2.0.0/protocol/AssetProxy/MixinAuthorizable.sol": {
- "id": 16
- },
- "2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol": {
- "id": 17
- },
- "2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol": {
- "id": 18
- },
- "2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol": {
- "id": 19
- },
- "2.0.0/protocol/AssetProxyOwner/AssetProxyOwner.sol": {
- "id": 20
- },
- "2.0.0/protocol/Exchange/Exchange.sol": {
- "id": 21
- },
- "2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol": {
- "id": 22
- },
- "2.0.0/protocol/Exchange/MixinExchangeCore.sol": {
- "id": 23
- },
- "2.0.0/protocol/Exchange/MixinMatchOrders.sol": {
- "id": 24
- },
- "2.0.0/protocol/Exchange/MixinSignatureValidator.sol": {
- "id": 25
- },
- "2.0.0/protocol/Exchange/MixinTransactions.sol": {
- "id": 26
- },
- "2.0.0/protocol/Exchange/MixinWrapperFunctions.sol": {
- "id": 27
- },
- "2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol": {
- "id": 28
- },
- "2.0.0/protocol/Exchange/interfaces/IExchange.sol": {
- "id": 29
- },
- "2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol": {
- "id": 30
- },
- "2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol": {
- "id": 31
- },
- "2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol": {
- "id": 32
- },
- "2.0.0/protocol/Exchange/interfaces/ITransactions.sol": {
- "id": 33
- },
- "2.0.0/protocol/Exchange/interfaces/IValidator.sol": {
- "id": 34
- },
- "2.0.0/protocol/Exchange/interfaces/IWallet.sol": {
- "id": 35
- },
- "2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol": {
- "id": 36
- },
- "2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol": {
- "id": 37
- },
- "2.0.0/protocol/Exchange/libs/LibConstants.sol": {
- "id": 38
- },
- "2.0.0/protocol/Exchange/libs/LibEIP712.sol": {
- "id": 39
- },
- "2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol": {
- "id": 40
- },
- "2.0.0/protocol/Exchange/libs/LibFillResults.sol": {
- "id": 41
- },
- "2.0.0/protocol/Exchange/libs/LibMath.sol": {
- "id": 42
- },
- "2.0.0/protocol/Exchange/libs/LibOrder.sol": {
- "id": 43
- },
- "2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol": {
- "id": 44
- },
- "2.0.0/protocol/Exchange/mixins/MExchangeCore.sol": {
- "id": 45
- },
- "2.0.0/protocol/Exchange/mixins/MMatchOrders.sol": {
- "id": 46
- },
- "2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol": {
- "id": 47
- },
- "2.0.0/protocol/Exchange/mixins/MTransactions.sol": {
- "id": 48
- },
- "2.0.0/protocol/Exchange/mixins/MWrapperFunctions.sol": {
- "id": 49
- },
- "2.0.0/tokens/ERC20Token/IERC20Token.sol": {
- "id": 50
- },
- "2.0.0/tokens/ERC721Token/IERC721Token.sol": {
- "id": 51
- },
- "2.0.0/tokens/EtherToken/IEtherToken.sol": {
- "id": 52
- },
- "2.0.0/utils/LibBytes/LibBytes.sol": {
- "id": 53
- },
- "2.0.0/utils/Ownable/IOwnable.sol": {
- "id": 54
- },
- "2.0.0/utils/Ownable/Ownable.sol": {
- "id": 55
- },
- "2.0.0/utils/ReentrancyGuard/ReentrancyGuard.sol": {
- "id": 56
- },
- "2.0.0/utils/SafeMath/SafeMath.sol": {
- "id": 57
- }
- },
- "sourceCodes": {
- "2.0.0/extensions/Forwarder/Forwarder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./MixinWeth.sol\";\nimport \"./MixinForwarderCore.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./MixinAssets.sol\";\nimport \"./MixinExchangeWrapper.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract Forwarder is\n LibConstants,\n MixinWeth,\n MixinAssets,\n MixinExchangeWrapper,\n MixinForwarderCore\n{\n constructor (\n address _exchange,\n bytes memory _zrxAssetData,\n bytes memory _wethAssetData\n )\n public\n LibConstants(\n _exchange,\n _zrxAssetData,\n _wethAssetData\n )\n MixinForwarderCore()\n {}\n}\n",
- "2.0.0/extensions/Forwarder/MixinAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"../../tokens/ERC20Token/IERC20Token.sol\";\nimport \"../../tokens/ERC721Token/IERC721Token.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MAssets.sol\";\n\n\ncontract MixinAssets is\n Ownable,\n LibConstants,\n MAssets\n{\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_TRANSFER_SELECTOR = bytes4(keccak256(\"transfer(address,uint256)\"));\n\n /// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to \n /// function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be\n /// used to withdraw assets that were accidentally sent to this contract.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of ERC20 token to withdraw.\n function withdrawAsset(\n bytes assetData,\n uint256 amount\n )\n external\n onlyOwner\n {\n transferAssetToSender(assetData, amount);\n }\n\n /// @dev Transfers given amount of asset to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferAssetToSender(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n bytes4 proxyId = assetData.readBytes4(0);\n\n if (proxyId == ERC20_DATA_ID) {\n transferERC20Token(assetData, amount);\n } else if (proxyId == ERC721_DATA_ID) {\n transferERC721Token(assetData, amount);\n } else {\n revert(\"UNSUPPORTED_ASSET_PROXY\");\n }\n }\n\n /// @dev Decodes ERC20 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC20Token(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n address token = assetData.readAddress(16);\n\n // Transfer tokens.\n // We do a raw call so we can check the success separate\n // from the return data.\n bool success = token.call(abi.encodeWithSelector(\n ERC20_TRANSFER_SELECTOR,\n msg.sender,\n amount\n ));\n require(\n success,\n \"TRANSFER_FAILED\"\n );\n \n // Check return data.\n // If there is no return data, we assume the token incorrectly\n // does not return a bool. In this case we expect it to revert\n // on failure, which was handled above.\n // If the token does return data, we require that it is a single\n // value that evaluates to true.\n assembly {\n if returndatasize {\n success := 0\n if eq(returndatasize, 32) {\n // First 64 bytes of memory are reserved scratch space\n returndatacopy(0, 0, 32)\n success := mload(0)\n }\n }\n }\n require(\n success,\n \"TRANSFER_FAILED\"\n );\n }\n\n /// @dev Decodes ERC721 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC721Token(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n require(\n amount == 1,\n \"INVALID_AMOUNT\"\n );\n // Decode asset data.\n address token = assetData.readAddress(16);\n uint256 tokenId = assetData.readUint256(36);\n\n // Perform transfer.\n IERC721Token(token).transferFrom(\n address(this),\n msg.sender,\n tokenId\n );\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MExchangeWrapper.sol\";\nimport \"../../protocol/Exchange/libs/LibAbiEncoder.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../protocol/Exchange/libs/LibFillResults.sol\";\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\n\n\ncontract MixinExchangeWrapper is\n LibAbiEncoder,\n LibFillResults,\n LibMath,\n LibConstants,\n MExchangeWrapper\n{\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n // ABI encode calldata for `fillOrder`\n bytes memory fillOrderCalldata = abiEncodeFillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n\n address exchange = address(EXCHANGE);\n\n // Call `fillOrder` and handle any exceptions gracefully\n assembly {\n let success := call(\n gas, // forward all gas\n exchange, // call address of Exchange contract\n 0, // transfer 0 wei\n add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes)\n mload(fillOrderCalldata), // length of input\n fillOrderCalldata, // write output over input\n 128 // output size is 128 bytes\n )\n if success {\n mstore(fillResults, mload(fillOrderCalldata))\n mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32)))\n mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64)))\n mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96)))\n }\n }\n // fillResults values will be 0 by default if call was unsuccessful\n return fillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of WETH has been sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param wethSellAmount Desired amount of WETH to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellWeth(\n LibOrder.Order[] memory orders,\n uint256 wethSellAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // We assume that asset being sold by taker is WETH for each order.\n orders[i].makerAssetData = makerAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of WETH to sell\n uint256 remainingTakerAssetFillAmount = safeSub(wethSellAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of WETH\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= wethSellAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// The asset being sold by taker must always be WETH.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyExactAmountWithWeth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // We assume that asset being sold by taker is WETH for each order.\n orders[i].makerAssetData = makerAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n uint256 makerAssetFilledAmount = totalFillResults.makerAssetFilledAmount;\n if (makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n\n require(\n makerAssetFilledAmount >= makerAssetFillAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return totalFillResults;\n }\n\n /// @dev Buys zrxBuyAmount of ZRX fee tokens, taking into account ZRX fees for each order. This will guarantee\n /// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues).\n /// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX\n /// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases.\n /// The asset being sold by taker must always be WETH. \n /// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset.\n /// @param zrxBuyAmount Desired amount of ZRX to buy.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return totalFillResults Amounts filled and fees paid by maker and taker.\n function marketBuyExactZrxWithWeth(\n LibOrder.Order[] memory orders,\n uint256 zrxBuyAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n // Do nothing if zrxBuyAmount == 0\n if (zrxBuyAmount == 0) {\n return totalFillResults;\n }\n\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n uint256 zrxPurchased = 0;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // All of these are ZRX/WETH, so we can drop the respective assetData from calldata.\n orders[i].makerAssetData = zrxAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of ZRX to buy.\n uint256 remainingZrxBuyAmount = safeSub(zrxBuyAmount, zrxPurchased);\n\n // Convert the remaining amount of ZRX to buy into remaining amount\n // of WETH to sell, assuming entire amount can be sold in the current order.\n uint256 remainingWethSellAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n safeSub(orders[i].makerAssetAmount, orders[i].takerFee), // our exchange rate after fees \n remainingZrxBuyAmount\n );\n\n // Attempt to sell the remaining amount of WETH.\n FillResults memory singleFillResult = fillOrderNoThrow(\n orders[i],\n safeAdd(remainingWethSellAmount, 1), // we add 1 wei to the fill amount to make up for rounding errors\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker.\n addFillResults(totalFillResults, singleFillResult);\n zrxPurchased = safeSub(totalFillResults.makerAssetFilledAmount, totalFillResults.takerFeePaid);\n\n // Stop execution if the entire amount of ZRX has been bought.\n if (zrxPurchased >= zrxBuyAmount) {\n break;\n }\n }\n\n require(\n zrxPurchased >= zrxBuyAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return totalFillResults;\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinForwarderCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MWeth.sol\";\nimport \"./mixins/MAssets.sol\";\nimport \"./mixins/MExchangeWrapper.sol\";\nimport \"./interfaces/IForwarderCore.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../protocol/Exchange/libs/LibFillResults.sol\";\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\n\n\ncontract MixinForwarderCore is\n LibFillResults,\n LibMath,\n LibConstants,\n MWeth,\n MAssets,\n MExchangeWrapper,\n IForwarderCore\n{\n using LibBytes for bytes;\n\n /// @dev Constructor approves ERC20 proxy to transfer ZRX and WETH on this contract's behalf.\n constructor ()\n public\n {\n address proxyAddress = EXCHANGE.getAssetProxy(ERC20_DATA_ID);\n require(\n proxyAddress != address(0),\n \"UNREGISTERED_ASSET_PROXY\"\n );\n ETHER_TOKEN.approve(proxyAddress, MAX_UINT);\n ZRX_TOKEN.approve(proxyAddress, MAX_UINT);\n }\n\n /// @dev Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketSellOrdersWithEth(\n LibOrder.Order[] memory orders,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n FillResults memory orderFillResults,\n FillResults memory feeOrderFillResults\n )\n {\n // Convert ETH to WETH.\n convertEthToWeth();\n\n uint256 wethSellAmount;\n uint256 zrxBuyAmount;\n uint256 makerAssetAmountPurchased;\n if (orders[0].makerAssetData.equals(ZRX_ASSET_DATA)) {\n // Calculate amount of WETH that won't be spent on ETH fees.\n wethSellAmount = getPartialAmountFloor(\n PERCENTAGE_DENOMINATOR,\n safeAdd(PERCENTAGE_DENOMINATOR, feePercentage),\n msg.value\n );\n // Market sell available WETH.\n // ZRX fees are paid with this contract's balance.\n orderFillResults = marketSellWeth(\n orders,\n wethSellAmount,\n signatures\n );\n // The fee amount must be deducted from the amount transfered back to sender.\n makerAssetAmountPurchased = safeSub(orderFillResults.makerAssetFilledAmount, orderFillResults.takerFeePaid);\n } else {\n // 5% of WETH is reserved for filling feeOrders and paying feeRecipient.\n wethSellAmount = getPartialAmountFloor(\n MAX_WETH_FILL_PERCENTAGE,\n PERCENTAGE_DENOMINATOR,\n msg.value\n );\n // Market sell 95% of WETH.\n // ZRX fees are payed with this contract's balance.\n orderFillResults = marketSellWeth(\n orders,\n wethSellAmount,\n signatures\n );\n // Buy back all ZRX spent on fees.\n zrxBuyAmount = orderFillResults.takerFeePaid;\n feeOrderFillResults = marketBuyExactZrxWithWeth(\n feeOrders,\n zrxBuyAmount,\n feeSignatures\n );\n makerAssetAmountPurchased = orderFillResults.makerAssetFilledAmount;\n }\n\n // Transfer feePercentage of total ETH spent on primary orders to feeRecipient.\n // Refund remaining ETH to msg.sender.\n transferEthFeeAndRefund(\n orderFillResults.takerAssetFilledAmount,\n feeOrderFillResults.takerAssetFilledAmount,\n feePercentage,\n feeRecipient\n );\n\n // Transfer purchased assets to msg.sender.\n transferAssetToSender(orders[0].makerAssetData, makerAssetAmountPurchased);\n }\n\n /// @dev Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param makerAssetFillAmount Desired amount of makerAsset to purchase.\n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketBuyOrdersWithEth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n FillResults memory orderFillResults,\n FillResults memory feeOrderFillResults\n )\n {\n // Convert ETH to WETH.\n convertEthToWeth();\n\n uint256 zrxBuyAmount;\n uint256 makerAssetAmountPurchased;\n if (orders[0].makerAssetData.equals(ZRX_ASSET_DATA)) {\n // If the makerAsset is ZRX, it is not necessary to pay fees out of this\n // contracts's ZRX balance because fees are factored into the price of the order.\n orderFillResults = marketBuyExactZrxWithWeth(\n orders,\n makerAssetFillAmount,\n signatures\n );\n // The fee amount must be deducted from the amount transfered back to sender.\n makerAssetAmountPurchased = safeSub(orderFillResults.makerAssetFilledAmount, orderFillResults.takerFeePaid);\n } else {\n // Attemp to purchase desired amount of makerAsset.\n // ZRX fees are payed with this contract's balance.\n orderFillResults = marketBuyExactAmountWithWeth(\n orders,\n makerAssetFillAmount,\n signatures\n );\n // Buy back all ZRX spent on fees.\n zrxBuyAmount = orderFillResults.takerFeePaid;\n feeOrderFillResults = marketBuyExactZrxWithWeth(\n feeOrders,\n zrxBuyAmount,\n feeSignatures\n );\n makerAssetAmountPurchased = orderFillResults.makerAssetFilledAmount;\n }\n\n // Transfer feePercentage of total ETH spent on primary orders to feeRecipient.\n // Refund remaining ETH to msg.sender.\n transferEthFeeAndRefund(\n orderFillResults.takerAssetFilledAmount,\n feeOrderFillResults.takerAssetFilledAmount,\n feePercentage,\n feeRecipient\n );\n\n // Transfer purchased assets to msg.sender.\n transferAssetToSender(orders[0].makerAssetData, makerAssetAmountPurchased);\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinWeth.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MWeth.sol\";\n\n\ncontract MixinWeth is\n LibMath,\n LibConstants,\n MWeth\n{\n /// @dev Default payabale function, this allows us to withdraw WETH\n function ()\n public\n payable\n {\n require(\n msg.sender == address(ETHER_TOKEN),\n \"DEFAULT_FUNCTION_WETH_CONTRACT_ONLY\"\n );\n }\n\n /// @dev Converts message call's ETH value into WETH.\n function convertEthToWeth()\n internal\n {\n require(\n msg.value > 0,\n \"INVALID_MSG_VALUE\"\n );\n ETHER_TOKEN.deposit.value(msg.value)();\n }\n\n /// @dev Transfers feePercentage of WETH spent on primary orders to feeRecipient.\n /// Refunds any excess ETH to msg.sender.\n /// @param wethSoldExcludingFeeOrders Amount of WETH sold when filling primary orders.\n /// @param wethSoldForZrx Amount of WETH sold when purchasing ZRX required for primary order fees.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n function transferEthFeeAndRefund(\n uint256 wethSoldExcludingFeeOrders,\n uint256 wethSoldForZrx,\n uint256 feePercentage,\n address feeRecipient\n )\n internal\n {\n // Ensure feePercentage is less than 5%.\n require(\n feePercentage <= MAX_FEE_PERCENTAGE,\n \"FEE_PERCENTAGE_TOO_LARGE\"\n );\n\n // Ensure that no extra WETH owned by this contract has been sold.\n uint256 wethSold = safeAdd(wethSoldExcludingFeeOrders, wethSoldForZrx);\n require(\n wethSold <= msg.value,\n \"OVERSOLD_WETH\"\n );\n\n // Calculate amount of WETH that hasn't been sold.\n uint256 wethRemaining = safeSub(msg.value, wethSold);\n\n // Calculate ETH fee to pay to feeRecipient.\n uint256 ethFee = getPartialAmountFloor(\n feePercentage,\n PERCENTAGE_DENOMINATOR,\n wethSoldExcludingFeeOrders\n );\n\n // Ensure fee is less than amount of WETH remaining.\n require(\n ethFee <= wethRemaining,\n \"INSUFFICIENT_ETH_REMAINING\"\n );\n \n // Do nothing if no WETH remaining\n if (wethRemaining > 0) {\n // Convert remaining WETH to ETH\n ETHER_TOKEN.withdraw(wethRemaining);\n\n // Pay ETH to feeRecipient\n if (ethFee > 0) {\n feeRecipient.transfer(ethFee);\n }\n\n // Refund remaining ETH to msg.sender.\n uint256 ethRefund = safeSub(wethRemaining, ethFee);\n if (ethRefund > 0) {\n msg.sender.transfer(ethRefund);\n }\n }\n }\n}\n",
- "2.0.0/extensions/Forwarder/interfaces/IAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IAssets {\n\n /// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to \n /// function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be\n /// used to withdraw assets that were accidentally sent to this contract.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of ERC20 token to withdraw.\n function withdrawAsset(\n bytes assetData,\n uint256 amount\n )\n external;\n}\n",
- "2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../../protocol/Exchange/libs/LibFillResults.sol\";\n\n\ncontract IForwarderCore {\n\n /// @dev Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketSellOrdersWithEth(\n LibOrder.Order[] memory orders,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n LibFillResults.FillResults memory orderFillResults,\n LibFillResults.FillResults memory feeOrderFillResults\n );\n\n /// @dev Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param makerAssetFillAmount Desired amount of makerAsset to purchase.\n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketBuyOrdersWithEth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n LibFillResults.FillResults memory orderFillResults,\n LibFillResults.FillResults memory feeOrderFillResults\n );\n}\n",
- "2.0.0/extensions/Forwarder/libs/LibConstants.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/LibBytes/LibBytes.sol\";\nimport \"../../../protocol/Exchange/interfaces/IExchange.sol\";\nimport \"../../../tokens/EtherToken/IEtherToken.sol\";\nimport \"../../../tokens/ERC20Token/IERC20Token.sol\";\n\n\ncontract LibConstants {\n\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n uint256 constant internal MAX_UINT = 2**256 - 1;\n uint256 constant internal PERCENTAGE_DENOMINATOR = 10**18; \n uint256 constant internal MAX_FEE_PERCENTAGE = 5 * PERCENTAGE_DENOMINATOR / 100; // 5%\n uint256 constant internal MAX_WETH_FILL_PERCENTAGE = 95 * PERCENTAGE_DENOMINATOR / 100; // 95%\n \n // solhint-disable var-name-mixedcase\n IExchange internal EXCHANGE;\n IEtherToken internal ETHER_TOKEN;\n IERC20Token internal ZRX_TOKEN;\n bytes internal ZRX_ASSET_DATA;\n bytes internal WETH_ASSET_DATA;\n // solhint-enable var-name-mixedcase\n\n constructor (\n address _exchange,\n bytes memory _zrxAssetData,\n bytes memory _wethAssetData\n )\n public\n {\n EXCHANGE = IExchange(_exchange);\n ZRX_ASSET_DATA = _zrxAssetData;\n WETH_ASSET_DATA = _wethAssetData;\n\n address etherToken = _wethAssetData.readAddress(16);\n address zrxToken = _zrxAssetData.readAddress(16);\n ETHER_TOKEN = IEtherToken(etherToken);\n ZRX_TOKEN = IERC20Token(zrxToken);\n }\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAssets.sol\";\n\n\ncontract MAssets is\n IAssets\n{\n /// @dev Transfers given amount of asset to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferAssetToSender(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n\n /// @dev Decodes ERC20 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC20Token(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n\n /// @dev Decodes ERC721 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC721Token(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../../protocol/Exchange/libs/LibFillResults.sol\";\n\n\ncontract MExchangeWrapper {\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of WETH has been sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param wethSellAmount Desired amount of WETH to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellWeth(\n LibOrder.Order[] memory orders,\n uint256 wethSellAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// The asset being sold by taker must always be WETH.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyExactAmountWithWeth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Buys zrxBuyAmount of ZRX fee tokens, taking into account ZRX fees for each order. This will guarantee\n /// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues).\n /// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX\n /// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases.\n /// The asset being sold by taker must always be WETH. \n /// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset.\n /// @param zrxBuyAmount Desired amount of ZRX to buy.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return totalFillResults Amounts filled and fees paid by maker and taker.\n function marketBuyExactZrxWithWeth(\n LibOrder.Order[] memory orders,\n uint256 zrxBuyAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MWeth.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract MWeth {\n\n /// @dev Converts message call's ETH value into WETH.\n function convertEthToWeth()\n internal;\n\n /// @dev Transfers feePercentage of WETH spent on primary orders to feeRecipient.\n /// Refunds any excess ETH to msg.sender.\n /// @param wethSoldExcludingFeeOrders Amount of WETH sold when filling primary orders.\n /// @param wethSoldForZrx Amount of WETH sold when purchasing ZRX required for primary order fees.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n function transferEthFeeAndRefund(\n uint256 wethSoldExcludingFeeOrders,\n uint256 wethSoldForZrx,\n uint256 feePercentage,\n address feeRecipient\n )\n internal;\n}\n",
- "2.0.0/extensions/OrderValidator/OrderValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../protocol/Exchange/interfaces/IExchange.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../tokens/ERC20Token/IERC20Token.sol\";\nimport \"../../tokens/ERC721Token/IERC721Token.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\n\n\ncontract OrderValidator {\n\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n\n struct TraderInfo {\n uint256 makerBalance; // Maker's balance of makerAsset\n uint256 makerAllowance; // Maker's allowance to corresponding AssetProxy\n uint256 takerBalance; // Taker's balance of takerAsset\n uint256 takerAllowance; // Taker's allowance to corresponding AssetProxy\n uint256 makerZrxBalance; // Maker's balance of ZRX\n uint256 makerZrxAllowance; // Maker's allowance of ZRX to ERC20Proxy\n uint256 takerZrxBalance; // Taker's balance of ZRX\n uint256 takerZrxAllowance; // Taker's allowance of ZRX to ERC20Proxy\n }\n\n // solhint-disable var-name-mixedcase\n IExchange internal EXCHANGE;\n bytes internal ZRX_ASSET_DATA;\n // solhint-enable var-name-mixedcase\n\n constructor (address _exchange, bytes memory _zrxAssetData)\n public\n {\n EXCHANGE = IExchange(_exchange);\n ZRX_ASSET_DATA = _zrxAssetData;\n }\n\n /// @dev Fetches information for order and maker/taker of order.\n /// @param order The order structure.\n /// @param takerAddress Address that will be filling the order.\n /// @return OrderInfo and TraderInfo instances for given order.\n function getOrderAndTraderInfo(LibOrder.Order memory order, address takerAddress)\n public\n view\n returns (LibOrder.OrderInfo memory orderInfo, TraderInfo memory traderInfo)\n {\n orderInfo = EXCHANGE.getOrderInfo(order);\n traderInfo = getTraderInfo(order, takerAddress);\n return (orderInfo, traderInfo);\n }\n\n /// @dev Fetches information for all passed in orders and the makers/takers of each order.\n /// @param orders Array of order specifications.\n /// @param takerAddresses Array of taker addresses corresponding to each order.\n /// @return Arrays of OrderInfo and TraderInfo instances that correspond to each order.\n function getOrdersAndTradersInfo(LibOrder.Order[] memory orders, address[] memory takerAddresses)\n public\n view\n returns (LibOrder.OrderInfo[] memory ordersInfo, TraderInfo[] memory tradersInfo)\n {\n ordersInfo = EXCHANGE.getOrdersInfo(orders);\n tradersInfo = getTradersInfo(orders, takerAddresses);\n return (ordersInfo, tradersInfo);\n }\n\n /// @dev Fetches balance and allowances for maker and taker of order.\n /// @param order The order structure.\n /// @param takerAddress Address that will be filling the order.\n /// @return Balances and allowances of maker and taker of order.\n function getTraderInfo(LibOrder.Order memory order, address takerAddress)\n public\n view\n returns (TraderInfo memory traderInfo)\n {\n (traderInfo.makerBalance, traderInfo.makerAllowance) = getBalanceAndAllowance(order.makerAddress, order.makerAssetData);\n (traderInfo.takerBalance, traderInfo.takerAllowance) = getBalanceAndAllowance(takerAddress, order.takerAssetData);\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n (traderInfo.makerZrxBalance, traderInfo.makerZrxAllowance) = getBalanceAndAllowance(order.makerAddress, zrxAssetData);\n (traderInfo.takerZrxBalance, traderInfo.takerZrxAllowance) = getBalanceAndAllowance(takerAddress, zrxAssetData);\n return traderInfo;\n }\n\n /// @dev Fetches balances and allowances of maker and taker for each provided order.\n /// @param orders Array of order specifications.\n /// @param takerAddresses Array of taker addresses corresponding to each order.\n /// @return Array of balances and allowances for maker and taker of each order.\n function getTradersInfo(LibOrder.Order[] memory orders, address[] memory takerAddresses)\n public\n view\n returns (TraderInfo[] memory)\n {\n uint256 ordersLength = orders.length;\n TraderInfo[] memory tradersInfo = new TraderInfo[](ordersLength);\n for (uint256 i = 0; i != ordersLength; i++) {\n tradersInfo[i] = getTraderInfo(orders[i], takerAddresses[i]);\n }\n return tradersInfo;\n }\n\n /// @dev Fetches token balances and allowances of an address to given assetProxy. Supports ERC20 and ERC721.\n /// @param target Address to fetch balances and allowances of.\n /// @param assetData Encoded data that can be decoded by a specified proxy contract when transferring asset.\n /// @return Balance of asset and allowance set to given proxy of asset.\n /// For ERC721 tokens, these values will always be 1 or 0.\n function getBalanceAndAllowance(address target, bytes memory assetData)\n public\n view\n returns (uint256 balance, uint256 allowance)\n {\n bytes4 assetProxyId = assetData.readBytes4(0);\n address token = assetData.readAddress(16);\n address assetProxy = EXCHANGE.getAssetProxy(assetProxyId);\n\n if (assetProxyId == ERC20_DATA_ID) {\n // Query balance\n balance = IERC20Token(token).balanceOf(target);\n\n // Query allowance\n allowance = IERC20Token(token).allowance(target, assetProxy);\n } else if (assetProxyId == ERC721_DATA_ID) {\n uint256 tokenId = assetData.readUint256(36);\n\n // Query owner of tokenId\n address owner = getERC721TokenOwner(token, tokenId);\n\n // Set balance to 1 if tokenId is owned by target\n balance = target == owner ? 1 : 0;\n\n // Check if ERC721Proxy is approved to spend tokenId\n bool isApproved = IERC721Token(token).isApprovedForAll(target, assetProxy) || IERC721Token(token).getApproved(tokenId) == assetProxy;\n \n // Set alowance to 1 if ERC721Proxy is approved to spend tokenId\n allowance = isApproved ? 1 : 0;\n } else {\n revert(\"UNSUPPORTED_ASSET_PROXY\");\n }\n return (balance, allowance);\n }\n\n /// @dev Fetches token balances and allowances of an address for each given assetProxy. Supports ERC20 and ERC721.\n /// @param target Address to fetch balances and allowances of.\n /// @param assetData Array of encoded byte arrays that can be decoded by a specified proxy contract when transferring asset.\n /// @return Balances and allowances of assets.\n /// For ERC721 tokens, these values will always be 1 or 0.\n function getBalancesAndAllowances(address target, bytes[] memory assetData)\n public\n view\n returns (uint256[] memory, uint256[] memory)\n {\n uint256 length = assetData.length;\n uint256[] memory balances = new uint256[](length);\n uint256[] memory allowances = new uint256[](length);\n for (uint256 i = 0; i != length; i++) {\n (balances[i], allowances[i]) = getBalanceAndAllowance(target, assetData[i]);\n }\n return (balances, allowances);\n }\n\n /// @dev Calls `token.ownerOf(tokenId)`, but returns a null owner instead of reverting on an unowned token.\n /// @param token Address of ERC721 token.\n /// @param tokenId The identifier for the specific NFT.\n /// @return Owner of tokenId or null address if unowned.\n function getERC721TokenOwner(address token, uint256 tokenId)\n public\n view\n returns (address owner)\n {\n assembly {\n // load free memory pointer\n let cdStart := mload(64)\n\n // bytes4(keccak256(ownerOf(uint256))) = 0x6352211e\n mstore(cdStart, 0x6352211e00000000000000000000000000000000000000000000000000000000)\n mstore(add(cdStart, 4), tokenId)\n\n // staticcall `ownerOf(tokenId)`\n // `ownerOf` will revert if tokenId is not owned\n let success := staticcall(\n gas, // forward all gas\n token, // call token contract\n cdStart, // start of calldata\n 36, // length of input is 36 bytes\n cdStart, // write output over input\n 32 // size of output is 32 bytes\n )\n\n // Success implies that tokenId is owned\n // Copy owner from return data if successful\n if success {\n owner := mload(cdStart)\n } \n }\n\n // Owner initialized to address(0), no need to modify if call is unsuccessful\n return owner;\n }\n}\n",
- "2.0.0/multisig/MultiSigWallet.sol": "// solhint-disable\npragma solidity ^0.4.15;\n\n\n/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.\n/// @author Stefan George - <stefan.george@consensys.net>\ncontract MultiSigWallet {\n\n /*\n * Events\n */\n event Confirmation(address indexed sender, uint indexed transactionId);\n event Revocation(address indexed sender, uint indexed transactionId);\n event Submission(uint indexed transactionId);\n event Execution(uint indexed transactionId);\n event ExecutionFailure(uint indexed transactionId);\n event Deposit(address indexed sender, uint value);\n event OwnerAddition(address indexed owner);\n event OwnerRemoval(address indexed owner);\n event RequirementChange(uint required);\n\n /*\n * Constants\n */\n uint constant public MAX_OWNER_COUNT = 50;\n\n /*\n * Storage\n */\n mapping (uint => Transaction) public transactions;\n mapping (uint => mapping (address => bool)) public confirmations;\n mapping (address => bool) public isOwner;\n address[] public owners;\n uint public required;\n uint public transactionCount;\n\n struct Transaction {\n address destination;\n uint value;\n bytes data;\n bool executed;\n }\n\n /*\n * Modifiers\n */\n modifier onlyWallet() {\n require(msg.sender == address(this));\n _;\n }\n\n modifier ownerDoesNotExist(address owner) {\n require(!isOwner[owner]);\n _;\n }\n\n modifier ownerExists(address owner) {\n require(isOwner[owner]);\n _;\n }\n\n modifier transactionExists(uint transactionId) {\n require(transactions[transactionId].destination != 0);\n _;\n }\n\n modifier confirmed(uint transactionId, address owner) {\n require(confirmations[transactionId][owner]);\n _;\n }\n\n modifier notConfirmed(uint transactionId, address owner) {\n require(!confirmations[transactionId][owner]);\n _;\n }\n\n modifier notExecuted(uint transactionId) {\n require(!transactions[transactionId].executed);\n _;\n }\n\n modifier notNull(address _address) {\n require(_address != 0);\n _;\n }\n\n modifier validRequirement(uint ownerCount, uint _required) {\n require(ownerCount <= MAX_OWNER_COUNT\n && _required <= ownerCount\n && _required != 0\n && ownerCount != 0);\n _;\n }\n\n /// @dev Fallback function allows to deposit ether.\n function()\n payable\n {\n if (msg.value > 0)\n Deposit(msg.sender, msg.value);\n }\n\n /*\n * Public functions\n */\n /// @dev Contract constructor sets initial owners and required number of confirmations.\n /// @param _owners List of initial owners.\n /// @param _required Number of required confirmations.\n function MultiSigWallet(address[] _owners, uint _required)\n public\n validRequirement(_owners.length, _required)\n {\n for (uint i=0; i<_owners.length; i++) {\n require(!isOwner[_owners[i]] && _owners[i] != 0);\n isOwner[_owners[i]] = true;\n }\n owners = _owners;\n required = _required;\n }\n\n /// @dev Allows to add a new owner. Transaction has to be sent by wallet.\n /// @param owner Address of new owner.\n function addOwner(address owner)\n public\n onlyWallet\n ownerDoesNotExist(owner)\n notNull(owner)\n validRequirement(owners.length + 1, required)\n {\n isOwner[owner] = true;\n owners.push(owner);\n OwnerAddition(owner);\n }\n\n /// @dev Allows to remove an owner. Transaction has to be sent by wallet.\n /// @param owner Address of owner.\n function removeOwner(address owner)\n public\n onlyWallet\n ownerExists(owner)\n {\n isOwner[owner] = false;\n for (uint i=0; i<owners.length - 1; i++)\n if (owners[i] == owner) {\n owners[i] = owners[owners.length - 1];\n break;\n }\n owners.length -= 1;\n if (required > owners.length)\n changeRequirement(owners.length);\n OwnerRemoval(owner);\n }\n\n /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet.\n /// @param owner Address of owner to be replaced.\n /// @param newOwner Address of new owner.\n function replaceOwner(address owner, address newOwner)\n public\n onlyWallet\n ownerExists(owner)\n ownerDoesNotExist(newOwner)\n {\n for (uint i=0; i<owners.length; i++)\n if (owners[i] == owner) {\n owners[i] = newOwner;\n break;\n }\n isOwner[owner] = false;\n isOwner[newOwner] = true;\n OwnerRemoval(owner);\n OwnerAddition(newOwner);\n }\n\n /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet.\n /// @param _required Number of required confirmations.\n function changeRequirement(uint _required)\n public\n onlyWallet\n validRequirement(owners.length, _required)\n {\n required = _required;\n RequirementChange(_required);\n }\n\n /// @dev Allows an owner to submit and confirm a transaction.\n /// @param destination Transaction target address.\n /// @param value Transaction ether value.\n /// @param data Transaction data payload.\n /// @return Returns transaction ID.\n function submitTransaction(address destination, uint value, bytes data)\n public\n returns (uint transactionId)\n {\n transactionId = addTransaction(destination, value, data);\n confirmTransaction(transactionId);\n }\n\n /// @dev Allows an owner to confirm a transaction.\n /// @param transactionId Transaction ID.\n function confirmTransaction(uint transactionId)\n public\n ownerExists(msg.sender)\n transactionExists(transactionId)\n notConfirmed(transactionId, msg.sender)\n {\n confirmations[transactionId][msg.sender] = true;\n Confirmation(msg.sender, transactionId);\n executeTransaction(transactionId);\n }\n\n /// @dev Allows an owner to revoke a confirmation for a transaction.\n /// @param transactionId Transaction ID.\n function revokeConfirmation(uint transactionId)\n public\n ownerExists(msg.sender)\n confirmed(transactionId, msg.sender)\n notExecuted(transactionId)\n {\n confirmations[transactionId][msg.sender] = false;\n Revocation(msg.sender, transactionId);\n }\n\n /// @dev Allows anyone to execute a confirmed transaction.\n /// @param transactionId Transaction ID.\n function executeTransaction(uint transactionId)\n public\n ownerExists(msg.sender)\n confirmed(transactionId, msg.sender)\n notExecuted(transactionId)\n {\n if (isConfirmed(transactionId)) {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data))\n Execution(transactionId);\n else {\n ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n }\n\n // call has been separated into its own function in order to take advantage\n // of the Solidity's code generator to produce a loop that copies tx.data into memory.\n function external_call(address destination, uint value, uint dataLength, bytes data) internal returns (bool) {\n bool result;\n assembly {\n let x := mload(0x40) // \"Allocate\" memory for output (0x40 is where \"free memory\" pointer is stored by convention)\n let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that\n result := call(\n sub(gas, 34710), // 34710 is the value that solidity is currently emitting\n // It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) +\n // callNewAccountGas (25000, in case the destination address does not exist and needs creating)\n destination,\n value,\n d,\n dataLength, // Size of the input (in bytes) - this is what fixes the padding problem\n x,\n 0 // Output is ignored, therefore the output size is zero\n )\n }\n return result;\n }\n\n /// @dev Returns the confirmation status of a transaction.\n /// @param transactionId Transaction ID.\n /// @return Confirmation status.\n function isConfirmed(uint transactionId)\n public\n constant\n returns (bool)\n {\n uint count = 0;\n for (uint i=0; i<owners.length; i++) {\n if (confirmations[transactionId][owners[i]])\n count += 1;\n if (count == required)\n return true;\n }\n }\n\n /*\n * Internal functions\n */\n /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet.\n /// @param destination Transaction target address.\n /// @param value Transaction ether value.\n /// @param data Transaction data payload.\n /// @return Returns transaction ID.\n function addTransaction(address destination, uint value, bytes data)\n internal\n notNull(destination)\n returns (uint transactionId)\n {\n transactionId = transactionCount;\n transactions[transactionId] = Transaction({\n destination: destination,\n value: value,\n data: data,\n executed: false\n });\n transactionCount += 1;\n Submission(transactionId);\n }\n\n /*\n * Web3 call functions\n */\n /// @dev Returns number of confirmations of a transaction.\n /// @param transactionId Transaction ID.\n /// @return Number of confirmations.\n function getConfirmationCount(uint transactionId)\n public\n constant\n returns (uint count)\n {\n for (uint i=0; i<owners.length; i++)\n if (confirmations[transactionId][owners[i]])\n count += 1;\n }\n\n /// @dev Returns total number of transactions after filers are applied.\n /// @param pending Include pending transactions.\n /// @param executed Include executed transactions.\n /// @return Total number of transactions after filters are applied.\n function getTransactionCount(bool pending, bool executed)\n public\n constant\n returns (uint count)\n {\n for (uint i=0; i<transactionCount; i++)\n if ( pending && !transactions[i].executed\n || executed && transactions[i].executed)\n count += 1;\n }\n\n /// @dev Returns list of owners.\n /// @return List of owner addresses.\n function getOwners()\n public\n constant\n returns (address[])\n {\n return owners;\n }\n\n /// @dev Returns array with owner addresses, which confirmed transaction.\n /// @param transactionId Transaction ID.\n /// @return Returns array of owner addresses.\n function getConfirmations(uint transactionId)\n public\n constant\n returns (address[] _confirmations)\n {\n address[] memory confirmationsTemp = new address[](owners.length);\n uint count = 0;\n uint i;\n for (i=0; i<owners.length; i++)\n if (confirmations[transactionId][owners[i]]) {\n confirmationsTemp[count] = owners[i];\n count += 1;\n }\n _confirmations = new address[](count);\n for (i=0; i<count; i++)\n _confirmations[i] = confirmationsTemp[i];\n }\n\n /// @dev Returns list of transaction IDs in defined range.\n /// @param from Index start position of transaction array.\n /// @param to Index end position of transaction array.\n /// @param pending Include pending transactions.\n /// @param executed Include executed transactions.\n /// @return Returns array of transaction IDs.\n function getTransactionIds(uint from, uint to, bool pending, bool executed)\n public\n constant\n returns (uint[] _transactionIds)\n {\n uint[] memory transactionIdsTemp = new uint[](transactionCount);\n uint count = 0;\n uint i;\n for (i=0; i<transactionCount; i++)\n if ( pending && !transactions[i].executed\n || executed && transactions[i].executed)\n {\n transactionIdsTemp[count] = i;\n count += 1;\n }\n _transactionIds = new uint[](to - from);\n for (i=from; i<to; i++)\n _transactionIds[i - from] = transactionIdsTemp[i];\n }\n}",
- "2.0.0/multisig/MultiSigWalletWithTimeLock.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MultiSigWallet.sol\";\n\n\n/// @title Multisignature wallet with time lock- Allows multiple parties to execute a transaction after a time lock has passed.\n/// @author Amir Bandeali - <amir@0xProject.com>\n// solhint-disable not-rely-on-time\ncontract MultiSigWalletWithTimeLock is\n MultiSigWallet\n{\n event ConfirmationTimeSet(uint256 indexed transactionId, uint256 confirmationTime);\n event TimeLockChange(uint256 secondsTimeLocked);\n\n uint256 public secondsTimeLocked;\n\n mapping (uint256 => uint256) public confirmationTimes;\n\n modifier notFullyConfirmed(uint256 transactionId) {\n require(\n !isConfirmed(transactionId),\n \"TX_FULLY_CONFIRMED\"\n );\n _;\n }\n\n modifier fullyConfirmed(uint256 transactionId) {\n require(\n isConfirmed(transactionId),\n \"TX_NOT_FULLY_CONFIRMED\"\n );\n _;\n }\n\n modifier pastTimeLock(uint256 transactionId) {\n require(\n block.timestamp >= confirmationTimes[transactionId] + secondsTimeLocked,\n \"TIME_LOCK_INCOMPLETE\"\n );\n _;\n }\n\n /// @dev Contract constructor sets initial owners, required number of confirmations, and time lock.\n /// @param _owners List of initial owners.\n /// @param _required Number of required confirmations.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n constructor (\n address[] _owners,\n uint256 _required,\n uint256 _secondsTimeLocked\n )\n public\n MultiSigWallet(_owners, _required)\n {\n secondsTimeLocked = _secondsTimeLocked;\n }\n\n /// @dev Changes the duration of the time lock for transactions.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n function changeTimeLock(uint256 _secondsTimeLocked)\n public\n onlyWallet\n {\n secondsTimeLocked = _secondsTimeLocked;\n emit TimeLockChange(_secondsTimeLocked);\n }\n\n /// @dev Allows an owner to confirm a transaction.\n /// @param transactionId Transaction ID.\n function confirmTransaction(uint256 transactionId)\n public\n ownerExists(msg.sender)\n transactionExists(transactionId)\n notConfirmed(transactionId, msg.sender)\n notFullyConfirmed(transactionId)\n {\n confirmations[transactionId][msg.sender] = true;\n emit Confirmation(msg.sender, transactionId);\n if (isConfirmed(transactionId)) {\n setConfirmationTime(transactionId, block.timestamp);\n }\n }\n\n /// @dev Allows anyone to execute a confirmed transaction.\n /// @param transactionId Transaction ID.\n function executeTransaction(uint256 transactionId)\n public\n notExecuted(transactionId)\n fullyConfirmed(transactionId)\n pastTimeLock(transactionId)\n {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) {\n emit Execution(transactionId);\n } else {\n emit ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n\n /// @dev Sets the time of when a submission first passed.\n function setConfirmationTime(uint256 transactionId, uint256 confirmationTime)\n internal\n {\n confirmationTimes[transactionId] = confirmationTime;\n emit ConfirmationTimeSet(transactionId, confirmationTime);\n }\n}\n",
- "2.0.0/protocol/AssetProxy/ERC20Proxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MixinAuthorizable.sol\";\n\n\ncontract ERC20Proxy is\n MixinAuthorizable\n{\n // Id of this proxy.\n bytes4 constant internal PROXY_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n \n // solhint-disable-next-line payable-fallback\n function () \n external\n {\n assembly {\n // The first 4 bytes of calldata holds the function selector\n let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)\n\n // `transferFrom` will be called with the following parameters:\n // assetData Encoded byte array.\n // from Address to transfer asset from.\n // to Address to transfer asset to.\n // amount Amount of asset to transfer.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {\n\n // To lookup a value in a mapping, we load from the storage location keccak256(k, p),\n // where k is the key left padded to 32 bytes and p is the storage slot\n let start := mload(64)\n mstore(start, and(caller, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(start, 32), authorized_slot)\n\n // Revert if authorized[msg.sender] == false\n if iszero(sload(keccak256(start, 64))) {\n // Revert with `Error(\"SENDER_NOT_AUTHORIZED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // `transferFrom`.\n // The function is marked `external`, so no abi decodeding is done for\n // us. Instead, we expect the `calldata` memory to contain the\n // following:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n //\n // (*): offset is computed from start of function parameters, so offset\n // by an additional 4 bytes in the calldata.\n //\n // (**): see table below to compute length of assetData Contents\n //\n // WARNING: The ABIv2 specification allows additional padding between\n // the Params and Data section. This will result in a larger\n // offset to assetData.\n\n // Asset data itself is encoded as follows:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 1 * 32 | function parameters: |\n // | | 4 | 12 + 20 | 1. token address |\n\n // We construct calldata for the `token.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 4 | | 1. from |\n // | | 36 | | 2. to |\n // | | 68 | | 3. amount |\n\n /////// Read token address from calldata ///////\n // * The token address is stored in `assetData`.\n //\n // * The \"offset to assetData\" is stored at offset 4 in the calldata (table 1).\n // [assetDataOffsetFromParams = calldataload(4)]\n //\n // * Notes that the \"offset to assetData\" is relative to the \"Params\" area of calldata;\n // add 4 bytes to account for the length of the \"Header\" area (table 1).\n // [assetDataOffsetFromHeader = assetDataOffsetFromParams + 4]\n //\n // * The \"token address\" is offset 32+4=36 bytes into \"assetData\" (tables 1 & 2).\n // [tokenOffset = assetDataOffsetFromHeader + 36 = calldataload(4) + 4 + 36]\n let token := calldataload(add(calldataload(4), 40))\n \n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFrom` selector.\n // Any trailing data in transferFromSelector will be\n // overwritten in the next `mstore` call.\n mstore(0, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // We copy the fields `from`, `to` and `amount` in bulk\n // from our own calldata to the new calldata.\n calldatacopy(4, 36, 96)\n\n /////// Call `token.transferFrom` using the calldata ///////\n let success := call(\n gas, // forward all gas\n token, // call address of token contract\n 0, // don't send any ETH\n 0, // pointer to start of input\n 100, // length of input\n 0, // write output over input\n 32 // output size should be 32 bytes\n )\n\n /////// Check return data. ///////\n // If there is no return data, we assume the token incorrectly\n // does not return a bool. In this case we expect it to revert\n // on failure, which was handled above.\n // If the token does return data, we require that it is a single\n // nonzero 32 bytes value.\n // So the transfer succeeded if the call succeeded and either\n // returned nothing, or returned a non-zero 32 byte value. \n success := and(success, or(\n iszero(returndatasize),\n and(\n eq(returndatasize, 32),\n gt(mload(0), 0)\n )\n ))\n if success {\n return(0, 0)\n }\n \n // Revert with `Error(\"TRANSFER_FAILED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // Revert if undefined function is called\n revert(0, 0)\n }\n }\n\n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4)\n {\n return PROXY_ID;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/ERC721Proxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MixinAuthorizable.sol\";\n\n\ncontract ERC721Proxy is\n MixinAuthorizable\n{\n // Id of this proxy.\n bytes4 constant internal PROXY_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n\n // solhint-disable-next-line payable-fallback\n function () \n external\n {\n assembly {\n // The first 4 bytes of calldata holds the function selector\n let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)\n\n // `transferFrom` will be called with the following parameters:\n // assetData Encoded byte array.\n // from Address to transfer asset from.\n // to Address to transfer asset to.\n // amount Amount of asset to transfer.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {\n\n // To lookup a value in a mapping, we load from the storage location keccak256(k, p),\n // where k is the key left padded to 32 bytes and p is the storage slot\n let start := mload(64)\n mstore(start, and(caller, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(start, 32), authorized_slot)\n\n // Revert if authorized[msg.sender] == false\n if iszero(sload(keccak256(start, 64))) {\n // Revert with `Error(\"SENDER_NOT_AUTHORIZED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // `transferFrom`.\n // The function is marked `external`, so no abi decodeding is done for\n // us. Instead, we expect the `calldata` memory to contain the\n // following:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n //\n // (*): offset is computed from start of function parameters, so offset\n // by an additional 4 bytes in the calldata.\n //\n // (**): see table below to compute length of assetData Contents\n //\n // WARNING: The ABIv2 specification allows additional padding between\n // the Params and Data section. This will result in a larger\n // offset to assetData.\n\n // Asset data itself is encoded as follows:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 2 * 32 | function parameters: |\n // | | 4 | 12 + 20 | 1. token address |\n // | | 36 | | 2. tokenId |\n \n // We construct calldata for the `token.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n // \n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 4 | | 1. from |\n // | | 36 | | 2. to |\n // | | 68 | | 3. tokenId |\n\n // There exists only 1 of each token.\n // require(amount == 1, \"INVALID_AMOUNT\")\n if sub(calldataload(100), 1) {\n // Revert with `Error(\"INVALID_AMOUNT\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000e494e56414c49445f414d4f554e540000000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFrom` selector.\n // Any trailing data in transferFromSelector will be\n // overwritten in the next `mstore` call.\n mstore(0, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // We copy the fields `from` and `to` in bulk\n // from our own calldata to the new calldata.\n calldatacopy(4, 36, 64)\n\n // Copy `tokenId` field from our own calldata to the new calldata.\n let assetDataOffset := calldataload(4)\n calldatacopy(68, add(assetDataOffset, 72), 32)\n\n /////// Call `token.transferFrom` using the calldata ///////\n let token := calldataload(add(assetDataOffset, 40))\n let success := call(\n gas, // forward all gas\n token, // call address of token contract\n 0, // don't send any ETH\n 0, // pointer to start of input\n 100, // length of input\n 0, // write output to null\n 0 // output size is 0 bytes\n )\n if success {\n return(0, 0)\n }\n \n // Revert with `Error(\"TRANSFER_FAILED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // Revert if undefined function is called\n revert(0, 0)\n }\n }\n\n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4)\n {\n return PROXY_ID;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/MixinAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"./mixins/MAuthorizable.sol\";\n\n\ncontract MixinAuthorizable is\n Ownable,\n MAuthorizable\n{\n /// @dev Only authorized addresses can invoke functions with this modifier.\n modifier onlyAuthorized {\n require(\n authorized[msg.sender],\n \"SENDER_NOT_AUTHORIZED\"\n );\n _;\n }\n\n mapping (address => bool) public authorized;\n address[] public authorities;\n\n /// @dev Authorizes an address.\n /// @param target Address to authorize.\n function addAuthorizedAddress(address target)\n external\n onlyOwner\n {\n require(\n !authorized[target],\n \"TARGET_ALREADY_AUTHORIZED\"\n );\n\n authorized[target] = true;\n authorities.push(target);\n emit AuthorizedAddressAdded(target, msg.sender);\n }\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n function removeAuthorizedAddress(address target)\n external\n onlyOwner\n {\n require(\n authorized[target],\n \"TARGET_NOT_AUTHORIZED\"\n );\n\n delete authorized[target];\n for (uint256 i = 0; i < authorities.length; i++) {\n if (authorities[i] == target) {\n authorities[i] = authorities[authorities.length - 1];\n authorities.length -= 1;\n break;\n }\n }\n emit AuthorizedAddressRemoved(target, msg.sender);\n }\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n /// @param index Index of target in authorities array.\n function removeAuthorizedAddressAtIndex(\n address target,\n uint256 index\n )\n external\n onlyOwner\n {\n require(\n authorized[target],\n \"TARGET_NOT_AUTHORIZED\"\n );\n require(\n index < authorities.length,\n \"INDEX_OUT_OF_BOUNDS\"\n );\n require(\n authorities[index] == target,\n \"AUTHORIZED_ADDRESS_MISMATCH\"\n );\n\n delete authorized[target];\n authorities[index] = authorities[authorities.length - 1];\n authorities.length -= 1;\n emit AuthorizedAddressRemoved(target, msg.sender);\n }\n\n /// @dev Gets all authorized addresses.\n /// @return Array of authorized addresses.\n function getAuthorizedAddresses()\n external\n view\n returns (address[] memory)\n {\n return authorities;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IAuthorizable.sol\";\n\n\ncontract IAssetProxy is\n IAuthorizable\n{\n /// @dev Transfers assets. Either succeeds or throws.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param from Address to transfer asset from.\n /// @param to Address to transfer asset to.\n /// @param amount Amount of asset to transfer.\n function transferFrom(\n bytes assetData,\n address from,\n address to,\n uint256 amount\n )\n external;\n \n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4);\n}\n",
- "2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/Ownable/IOwnable.sol\";\n\n\ncontract IAuthorizable is\n IOwnable\n{\n /// @dev Authorizes an address.\n /// @param target Address to authorize.\n function addAuthorizedAddress(address target)\n external;\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n function removeAuthorizedAddress(address target)\n external;\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n /// @param index Index of target in authorities array.\n function removeAuthorizedAddressAtIndex(\n address target,\n uint256 index\n )\n external;\n \n /// @dev Gets all authorized addresses.\n /// @return Array of authorized addresses.\n function getAuthorizedAddresses()\n external\n view\n returns (address[] memory);\n}\n",
- "2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAuthorizable.sol\";\n\n\ncontract MAuthorizable is\n IAuthorizable\n{\n // Event logged when a new address is authorized.\n event AuthorizedAddressAdded(\n address indexed target,\n address indexed caller\n );\n\n // Event logged when a currently authorized address is unauthorized.\n event AuthorizedAddressRemoved(\n address indexed target,\n address indexed caller\n );\n\n /// @dev Only authorized addresses can invoke functions with this modifier.\n modifier onlyAuthorized { revert(); _; }\n}\n",
- "2.0.0/protocol/AssetProxyOwner/AssetProxyOwner.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../multisig/MultiSigWalletWithTimeLock.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\n\n\ncontract AssetProxyOwner is\n MultiSigWalletWithTimeLock\n{\n using LibBytes for bytes;\n\n event AssetProxyRegistration(address assetProxyContract, bool isRegistered);\n\n // Mapping of AssetProxy contract address =>\n // if this contract is allowed to call the AssetProxy's `removeAuthorizedAddressAtIndex` method without a time lock.\n mapping (address => bool) public isAssetProxyRegistered;\n\n bytes4 constant internal REMOVE_AUTHORIZED_ADDRESS_AT_INDEX_SELECTOR = bytes4(keccak256(\"removeAuthorizedAddressAtIndex(address,uint256)\"));\n\n /// @dev Function will revert if the transaction does not call `removeAuthorizedAddressAtIndex`\n /// on an approved AssetProxy contract.\n modifier validRemoveAuthorizedAddressAtIndexTx(uint256 transactionId) {\n Transaction storage txn = transactions[transactionId];\n require(\n isAssetProxyRegistered[txn.destination],\n \"UNREGISTERED_ASSET_PROXY\"\n );\n require(\n txn.data.readBytes4(0) == REMOVE_AUTHORIZED_ADDRESS_AT_INDEX_SELECTOR,\n \"INVALID_FUNCTION_SELECTOR\"\n );\n _;\n }\n\n /// @dev Contract constructor sets initial owners, required number of confirmations,\n /// time lock, and list of AssetProxy addresses.\n /// @param _owners List of initial owners.\n /// @param _assetProxyContracts Array of AssetProxy contract addresses.\n /// @param _required Number of required confirmations.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n constructor (\n address[] memory _owners,\n address[] memory _assetProxyContracts,\n uint256 _required,\n uint256 _secondsTimeLocked\n )\n public\n MultiSigWalletWithTimeLock(_owners, _required, _secondsTimeLocked)\n {\n for (uint256 i = 0; i < _assetProxyContracts.length; i++) {\n address assetProxy = _assetProxyContracts[i];\n require(\n assetProxy != address(0),\n \"INVALID_ASSET_PROXY\"\n );\n isAssetProxyRegistered[assetProxy] = true;\n }\n }\n\n /// @dev Registers or deregisters an AssetProxy to be able to execute\n /// `removeAuthorizedAddressAtIndex` without a timelock.\n /// @param assetProxyContract Address of AssetProxy contract.\n /// @param isRegistered Status of approval for AssetProxy contract.\n function registerAssetProxy(address assetProxyContract, bool isRegistered)\n public\n onlyWallet\n notNull(assetProxyContract)\n {\n isAssetProxyRegistered[assetProxyContract] = isRegistered;\n emit AssetProxyRegistration(assetProxyContract, isRegistered);\n }\n\n /// @dev Allows execution of `removeAuthorizedAddressAtIndex` without time lock.\n /// @param transactionId Transaction ID.\n function executeRemoveAuthorizedAddressAtIndex(uint256 transactionId)\n public\n notExecuted(transactionId)\n fullyConfirmed(transactionId)\n validRemoveAuthorizedAddressAtIndexTx(transactionId)\n {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) {\n emit Execution(transactionId);\n } else {\n emit ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/Exchange.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./MixinExchangeCore.sol\";\nimport \"./MixinSignatureValidator.sol\";\nimport \"./MixinWrapperFunctions.sol\";\nimport \"./MixinAssetProxyDispatcher.sol\";\nimport \"./MixinTransactions.sol\";\nimport \"./MixinMatchOrders.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract Exchange is\n MixinExchangeCore,\n MixinMatchOrders,\n MixinSignatureValidator,\n MixinTransactions,\n MixinAssetProxyDispatcher,\n MixinWrapperFunctions\n{\n string constant public VERSION = \"2.0.0\";\n\n // Mixins are instantiated in the order they are inherited\n constructor ()\n public\n MixinExchangeCore()\n MixinMatchOrders()\n MixinSignatureValidator()\n MixinTransactions()\n MixinAssetProxyDispatcher()\n MixinWrapperFunctions()\n {}\n}\n",
- "2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\nimport \"../AssetProxy/interfaces/IAssetProxy.sol\";\n\n\ncontract MixinAssetProxyDispatcher is\n Ownable,\n MAssetProxyDispatcher\n{\n // Mapping from Asset Proxy Id's to their respective Asset Proxy\n mapping (bytes4 => IAssetProxy) public assetProxies;\n\n /// @dev Registers an asset proxy to its asset proxy id.\n /// Once an asset proxy is registered, it cannot be unregistered.\n /// @param assetProxy Address of new asset proxy to register.\n function registerAssetProxy(address assetProxy)\n external\n onlyOwner\n {\n IAssetProxy assetProxyContract = IAssetProxy(assetProxy);\n\n // Ensure that no asset proxy exists with current id.\n bytes4 assetProxyId = assetProxyContract.getProxyId();\n address currentAssetProxy = assetProxies[assetProxyId];\n require(\n currentAssetProxy == address(0),\n \"ASSET_PROXY_ALREADY_EXISTS\"\n );\n\n // Add asset proxy and log registration.\n assetProxies[assetProxyId] = assetProxyContract;\n emit AssetProxyRegistered(\n assetProxyId,\n assetProxy\n );\n }\n\n /// @dev Gets an asset proxy.\n /// @param assetProxyId Id of the asset proxy.\n /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered.\n function getAssetProxy(bytes4 assetProxyId)\n external\n view\n returns (address)\n {\n return assetProxies[assetProxyId];\n }\n\n /// @dev Forwards arguments to assetProxy and calls `transferFrom`. Either succeeds or throws.\n /// @param assetData Byte array encoded for the asset.\n /// @param from Address to transfer token from.\n /// @param to Address to transfer token to.\n /// @param amount Amount of token to transfer.\n function dispatchTransferFrom(\n bytes memory assetData,\n address from,\n address to,\n uint256 amount\n )\n internal\n {\n // Do nothing if no amount should be transferred.\n if (amount > 0 && from != to) {\n // Ensure assetData length is valid\n require(\n assetData.length > 3,\n \"LENGTH_GREATER_THAN_3_REQUIRED\"\n );\n \n // Lookup assetProxy. We do not use `LibBytes.readBytes4` for gas efficiency reasons.\n bytes4 assetProxyId;\n assembly {\n assetProxyId := and(mload(\n add(assetData, 32)),\n 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000\n )\n }\n address assetProxy = assetProxies[assetProxyId];\n\n // Ensure that assetProxy exists\n require(\n assetProxy != address(0),\n \"ASSET_PROXY_DOES_NOT_EXIST\"\n );\n \n // We construct calldata for the `assetProxy.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n // \n // | Area | Offset | Length | Contents |\n // | -------- |--------|---------|-------------------------------------------- |\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n\n assembly {\n /////// Setup State ///////\n // `cdStart` is the start of the calldata for `assetProxy.transferFrom` (equal to free memory ptr).\n let cdStart := mload(64)\n // `dataAreaLength` is the total number of words needed to store `assetData`\n // As-per the ABI spec, this value is padded up to the nearest multiple of 32,\n // and includes 32-bytes for length.\n let dataAreaLength := and(add(mload(assetData), 63), 0xFFFFFFFFFFFE0)\n // `cdEnd` is the end of the calldata for `assetProxy.transferFrom`.\n let cdEnd := add(cdStart, add(132, dataAreaLength))\n\n \n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFromSelector`.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n mstore(cdStart, 0xa85e59e400000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // Each parameter is padded to 32-bytes. The entire Params Area is 128 bytes.\n // Notes:\n // 1. The offset to `assetData` is the length of the Params Area (128 bytes).\n // 2. A 20-byte mask is applied to addresses to zero-out the unused bytes.\n mstore(add(cdStart, 4), 128)\n mstore(add(cdStart, 36), and(from, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(cdStart, 68), and(to, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(cdStart, 100), amount)\n \n /////// Setup Data Area ///////\n // This area holds `assetData`.\n let dataArea := add(cdStart, 132)\n // solhint-disable-next-line no-empty-blocks\n for {} lt(dataArea, cdEnd) {} {\n mstore(dataArea, mload(assetData))\n dataArea := add(dataArea, 32)\n assetData := add(assetData, 32)\n }\n\n /////// Call `assetProxy.transferFrom` using the constructed calldata ///////\n let success := call(\n gas, // forward all gas\n assetProxy, // call address of asset proxy\n 0, // don't send any ETH\n cdStart, // pointer to start of input\n sub(cdEnd, cdStart), // length of input \n cdStart, // write output over input\n 512 // reserve 512 bytes for output\n )\n if iszero(success) {\n revert(cdStart, returndatasize())\n }\n }\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\n\n\ncontract MixinExchangeCore is\n ReentrancyGuard,\n LibConstants,\n LibMath,\n LibOrder,\n LibFillResults,\n MAssetProxyDispatcher,\n MExchangeCore,\n MSignatureValidator,\n MTransactions\n{\n // Mapping of orderHash => amount of takerAsset already bought by maker\n mapping (bytes32 => uint256) public filled;\n\n // Mapping of orderHash => cancelled\n mapping (bytes32 => bool) public cancelled;\n\n // Mapping of makerAddress => senderAddress => lowest salt an order can have in order to be fillable\n // Orders with specified senderAddress and with a salt less than their epoch are considered cancelled\n mapping (address => mapping (address => uint256)) public orderEpoch;\n\n /// @dev Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch\n /// and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress).\n /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled.\n function cancelOrdersUpTo(uint256 targetOrderEpoch)\n external\n nonReentrant\n {\n address makerAddress = getCurrentContextAddress();\n // If this function is called via `executeTransaction`, we only update the orderEpoch for the makerAddress/msg.sender combination.\n // This allows external filter contracts to add rules to how orders are cancelled via this function.\n address senderAddress = makerAddress == msg.sender ? address(0) : msg.sender;\n\n // orderEpoch is initialized to 0, so to cancelUpTo we need salt + 1\n uint256 newOrderEpoch = targetOrderEpoch + 1; \n uint256 oldOrderEpoch = orderEpoch[makerAddress][senderAddress];\n\n // Ensure orderEpoch is monotonically increasing\n require(\n newOrderEpoch > oldOrderEpoch, \n \"INVALID_NEW_ORDER_EPOCH\"\n );\n\n // Update orderEpoch\n orderEpoch[makerAddress][senderAddress] = newOrderEpoch;\n emit CancelUpTo(\n makerAddress,\n senderAddress,\n newOrderEpoch\n );\n }\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrder(\n Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n nonReentrant\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n return fillResults;\n }\n\n /// @dev After calling, the order can not be filled anymore.\n /// Throws if order is invalid or sender does not have permission to cancel.\n /// @param order Order to cancel. Order must be OrderStatus.FILLABLE.\n function cancelOrder(Order memory order)\n public\n nonReentrant\n {\n cancelOrderInternal(order);\n }\n\n /// @dev Gets information about an order: status, hash, and amount filled.\n /// @param order Order to gather information on.\n /// @return OrderInfo Information about the order and its state.\n /// See LibOrder.OrderInfo for a complete description.\n function getOrderInfo(Order memory order)\n public\n view\n returns (OrderInfo memory orderInfo)\n {\n // Compute the order hash\n orderInfo.orderHash = getOrderHash(order);\n\n // Fetch filled amount\n orderInfo.orderTakerAssetFilledAmount = filled[orderInfo.orderHash];\n\n // If order.makerAssetAmount is zero, we also reject the order.\n // While the Exchange contract handles them correctly, they create\n // edge cases in the supporting infrastructure because they have\n // an 'infinite' price when computed by a simple division.\n if (order.makerAssetAmount == 0) {\n orderInfo.orderStatus = uint8(OrderStatus.INVALID_MAKER_ASSET_AMOUNT);\n return orderInfo;\n }\n\n // If order.takerAssetAmount is zero, then the order will always\n // be considered filled because 0 == takerAssetAmount == orderTakerAssetFilledAmount\n // Instead of distinguishing between unfilled and filled zero taker\n // amount orders, we choose not to support them.\n if (order.takerAssetAmount == 0) {\n orderInfo.orderStatus = uint8(OrderStatus.INVALID_TAKER_ASSET_AMOUNT);\n return orderInfo;\n }\n\n // Validate order availability\n if (orderInfo.orderTakerAssetFilledAmount >= order.takerAssetAmount) {\n orderInfo.orderStatus = uint8(OrderStatus.FULLY_FILLED);\n return orderInfo;\n }\n\n // Validate order expiration\n // solhint-disable-next-line not-rely-on-time\n if (block.timestamp >= order.expirationTimeSeconds) {\n orderInfo.orderStatus = uint8(OrderStatus.EXPIRED);\n return orderInfo;\n }\n\n // Check if order has been cancelled\n if (cancelled[orderInfo.orderHash]) {\n orderInfo.orderStatus = uint8(OrderStatus.CANCELLED);\n return orderInfo;\n }\n if (orderEpoch[order.makerAddress][order.senderAddress] > order.salt) {\n orderInfo.orderStatus = uint8(OrderStatus.CANCELLED);\n return orderInfo;\n }\n\n // All other statuses are ruled out: order is Fillable\n orderInfo.orderStatus = uint8(OrderStatus.FILLABLE);\n return orderInfo;\n }\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderInternal(\n Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n // Fetch order info\n OrderInfo memory orderInfo = getOrderInfo(order);\n\n // Fetch taker address\n address takerAddress = getCurrentContextAddress();\n \n // Assert that the order is fillable by taker\n assertFillableOrder(\n order,\n orderInfo,\n takerAddress,\n signature\n );\n \n // Get amount of takerAsset to fill\n uint256 remainingTakerAssetAmount = safeSub(order.takerAssetAmount, orderInfo.orderTakerAssetFilledAmount);\n uint256 takerAssetFilledAmount = min256(takerAssetFillAmount, remainingTakerAssetAmount);\n\n // Validate context\n assertValidFill(\n order,\n orderInfo,\n takerAssetFillAmount,\n takerAssetFilledAmount,\n fillResults.makerAssetFilledAmount\n );\n\n // Compute proportional fill amounts\n fillResults = calculateFillResults(order, takerAssetFilledAmount);\n\n // Update exchange internal state\n updateFilledState(\n order,\n takerAddress,\n orderInfo.orderHash,\n orderInfo.orderTakerAssetFilledAmount,\n fillResults\n );\n \n // Settle order\n settleOrder(\n order,\n takerAddress,\n fillResults\n );\n\n return fillResults;\n }\n\n /// @dev After calling, the order can not be filled anymore.\n /// Throws if order is invalid or sender does not have permission to cancel.\n /// @param order Order to cancel. Order must be OrderStatus.FILLABLE.\n function cancelOrderInternal(Order memory order)\n internal\n {\n // Fetch current order status\n OrderInfo memory orderInfo = getOrderInfo(order);\n\n // Validate context\n assertValidCancel(order, orderInfo);\n\n // Perform cancel\n updateCancelledState(order, orderInfo.orderHash);\n }\n\n /// @dev Updates state with results of a fill order.\n /// @param order that was filled.\n /// @param takerAddress Address of taker who filled the order.\n /// @param orderTakerAssetFilledAmount Amount of order already filled.\n function updateFilledState(\n Order memory order,\n address takerAddress,\n bytes32 orderHash,\n uint256 orderTakerAssetFilledAmount,\n FillResults memory fillResults\n )\n internal\n {\n // Update state\n filled[orderHash] = safeAdd(orderTakerAssetFilledAmount, fillResults.takerAssetFilledAmount);\n\n // Log order\n emit Fill(\n order.makerAddress,\n order.feeRecipientAddress,\n takerAddress,\n msg.sender,\n fillResults.makerAssetFilledAmount,\n fillResults.takerAssetFilledAmount,\n fillResults.makerFeePaid,\n fillResults.takerFeePaid,\n orderHash,\n order.makerAssetData,\n order.takerAssetData\n );\n }\n\n /// @dev Updates state with results of cancelling an order.\n /// State is only updated if the order is currently fillable.\n /// Otherwise, updating state would have no effect.\n /// @param order that was cancelled.\n /// @param orderHash Hash of order that was cancelled.\n function updateCancelledState(\n Order memory order,\n bytes32 orderHash\n )\n internal\n {\n // Perform cancel\n cancelled[orderHash] = true;\n\n // Log cancel\n emit Cancel(\n order.makerAddress,\n order.feeRecipientAddress,\n msg.sender,\n orderHash,\n order.makerAssetData,\n order.takerAssetData\n );\n }\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAddress Address of order taker.\n /// @param signature Proof that the orders was created by its maker.\n function assertFillableOrder(\n Order memory order,\n OrderInfo memory orderInfo,\n address takerAddress,\n bytes memory signature\n )\n internal\n view\n {\n // An order can only be filled if its status is FILLABLE.\n require(\n orderInfo.orderStatus == uint8(OrderStatus.FILLABLE),\n \"ORDER_UNFILLABLE\"\n );\n \n // Validate sender is allowed to fill this order\n if (order.senderAddress != address(0)) {\n require(\n order.senderAddress == msg.sender,\n \"INVALID_SENDER\"\n );\n }\n \n // Validate taker is allowed to fill this order\n if (order.takerAddress != address(0)) {\n require(\n order.takerAddress == takerAddress,\n \"INVALID_TAKER\"\n );\n }\n \n // Validate Maker signature (check only if first time seen)\n if (orderInfo.orderTakerAssetFilledAmount == 0) {\n require(\n isValidSignature(\n orderInfo.orderHash,\n order.makerAddress,\n signature\n ),\n \"INVALID_ORDER_SIGNATURE\"\n );\n }\n }\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAssetFillAmount Desired amount of order to fill by taker.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @param makerAssetFilledAmount Amount of makerAsset that will be transfered.\n function assertValidFill(\n Order memory order,\n OrderInfo memory orderInfo,\n uint256 takerAssetFillAmount, // TODO: use FillResults\n uint256 takerAssetFilledAmount,\n uint256 makerAssetFilledAmount\n )\n internal\n view\n {\n // Revert if fill amount is invalid\n // TODO: reconsider necessity for v2.1\n require(\n takerAssetFillAmount != 0,\n \"INVALID_TAKER_AMOUNT\"\n );\n \n // Make sure taker does not pay more than desired amount\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n takerAssetFilledAmount <= takerAssetFillAmount,\n \"TAKER_OVERPAY\"\n );\n \n // Make sure order is not overfilled\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n safeAdd(orderInfo.orderTakerAssetFilledAmount, takerAssetFilledAmount) <= order.takerAssetAmount,\n \"ORDER_OVERFILL\"\n );\n \n // Make sure order is filled at acceptable price.\n // The order has an implied price from the makers perspective:\n // order price = order.makerAssetAmount / order.takerAssetAmount\n // i.e. the number of makerAsset maker is paying per takerAsset. The\n // maker is guaranteed to get this price or a better (lower) one. The\n // actual price maker is getting in this fill is:\n // fill price = makerAssetFilledAmount / takerAssetFilledAmount\n // We need `fill price <= order price` for the fill to be fair to maker.\n // This amounts to:\n // makerAssetFilledAmount order.makerAssetAmount\n // ------------------------ <= -----------------------\n // takerAssetFilledAmount order.takerAssetAmount\n // or, equivalently:\n // makerAssetFilledAmount * order.takerAssetAmount <=\n // order.makerAssetAmount * takerAssetFilledAmount\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n safeMul(makerAssetFilledAmount, order.takerAssetAmount)\n <= \n safeMul(order.makerAssetAmount, takerAssetFilledAmount),\n \"INVALID_FILL_PRICE\"\n );\n }\n\n /// @dev Validates context for cancelOrder. Succeeds or throws.\n /// @param order to be cancelled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n function assertValidCancel(\n Order memory order,\n OrderInfo memory orderInfo\n )\n internal\n view\n {\n // Ensure order is valid\n // An order can only be cancelled if its status is FILLABLE.\n require(\n orderInfo.orderStatus == uint8(OrderStatus.FILLABLE),\n \"ORDER_UNFILLABLE\"\n );\n\n // Validate sender is allowed to cancel this order\n if (order.senderAddress != address(0)) {\n require(\n order.senderAddress == msg.sender,\n \"INVALID_SENDER\"\n );\n }\n\n // Validate transaction signed by maker\n address makerAddress = getCurrentContextAddress();\n require(\n order.makerAddress == makerAddress,\n \"INVALID_MAKER\"\n );\n }\n\n /// @dev Calculates amounts filled and fees paid by maker and taker.\n /// @param order to be filled.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function calculateFillResults(\n Order memory order,\n uint256 takerAssetFilledAmount\n )\n internal\n pure\n returns (FillResults memory fillResults)\n {\n // Compute proportional transfer amounts\n fillResults.takerAssetFilledAmount = takerAssetFilledAmount;\n fillResults.makerAssetFilledAmount = safeGetPartialAmountFloor(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.makerAssetAmount\n );\n fillResults.makerFeePaid = safeGetPartialAmountFloor(\n fillResults.makerAssetFilledAmount,\n order.makerAssetAmount,\n order.makerFee\n );\n fillResults.takerFeePaid = safeGetPartialAmountFloor(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.takerFee\n );\n\n return fillResults;\n }\n\n /// @dev Settles an order by transferring assets between counterparties.\n /// @param order Order struct containing order specifications.\n /// @param takerAddress Address selling takerAsset and buying makerAsset.\n /// @param fillResults Amounts to be filled and fees paid by maker and taker.\n function settleOrder(\n LibOrder.Order memory order,\n address takerAddress,\n LibFillResults.FillResults memory fillResults\n )\n private\n {\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n dispatchTransferFrom(\n order.makerAssetData,\n order.makerAddress,\n takerAddress,\n fillResults.makerAssetFilledAmount\n );\n dispatchTransferFrom(\n order.takerAssetData,\n takerAddress,\n order.makerAddress,\n fillResults.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n zrxAssetData,\n order.makerAddress,\n order.feeRecipientAddress,\n fillResults.makerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n order.feeRecipientAddress,\n fillResults.takerFeePaid\n );\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinMatchOrders.sol": "/*\n Copyright 2018 ZeroEx Intl.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n http://www.apache.org/licenses/LICENSE-2.0\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MMatchOrders.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\n\n\ncontract MixinMatchOrders is\n ReentrancyGuard,\n LibConstants,\n LibMath,\n MAssetProxyDispatcher,\n MExchangeCore,\n MMatchOrders,\n MTransactions\n{\n /// @dev Match two complementary orders that have a profitable spread.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the left order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftSignature Proof that order was created by the left maker.\n /// @param rightSignature Proof that order was created by the right maker.\n /// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.\n function matchOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n bytes memory leftSignature,\n bytes memory rightSignature\n )\n public\n nonReentrant\n returns (LibFillResults.MatchedFillResults memory matchedFillResults)\n {\n // We assume that rightOrder.takerAssetData == leftOrder.makerAssetData and rightOrder.makerAssetData == leftOrder.takerAssetData.\n // If this assumption isn't true, the match will fail at signature validation.\n rightOrder.makerAssetData = leftOrder.takerAssetData;\n rightOrder.takerAssetData = leftOrder.makerAssetData;\n\n // Get left & right order info\n LibOrder.OrderInfo memory leftOrderInfo = getOrderInfo(leftOrder);\n LibOrder.OrderInfo memory rightOrderInfo = getOrderInfo(rightOrder);\n\n // Fetch taker address\n address takerAddress = getCurrentContextAddress();\n \n // Either our context is valid or we revert\n assertFillableOrder(\n leftOrder,\n leftOrderInfo,\n takerAddress,\n leftSignature\n );\n assertFillableOrder(\n rightOrder,\n rightOrderInfo,\n takerAddress,\n rightSignature\n );\n assertValidMatch(leftOrder, rightOrder);\n\n // Compute proportional fill amounts\n matchedFillResults = calculateMatchedFillResults(\n leftOrder,\n rightOrder,\n leftOrderInfo.orderTakerAssetFilledAmount,\n rightOrderInfo.orderTakerAssetFilledAmount\n );\n\n // Validate fill contexts\n assertValidFill(\n leftOrder,\n leftOrderInfo,\n matchedFillResults.left.takerAssetFilledAmount,\n matchedFillResults.left.takerAssetFilledAmount,\n matchedFillResults.left.makerAssetFilledAmount\n );\n assertValidFill(\n rightOrder,\n rightOrderInfo,\n matchedFillResults.right.takerAssetFilledAmount,\n matchedFillResults.right.takerAssetFilledAmount,\n matchedFillResults.right.makerAssetFilledAmount\n );\n \n // Update exchange state\n updateFilledState(\n leftOrder,\n takerAddress,\n leftOrderInfo.orderHash,\n leftOrderInfo.orderTakerAssetFilledAmount,\n matchedFillResults.left\n );\n updateFilledState(\n rightOrder,\n takerAddress,\n rightOrderInfo.orderHash,\n rightOrderInfo.orderTakerAssetFilledAmount,\n matchedFillResults.right\n );\n\n // Settle matched orders. Succeeds or throws.\n settleMatchedOrders(\n leftOrder,\n rightOrder,\n takerAddress,\n matchedFillResults\n );\n\n return matchedFillResults;\n }\n\n /// @dev Validates context for matchOrders. Succeeds or throws.\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n function assertValidMatch(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder\n )\n internal\n pure\n {\n // Make sure there is a profitable spread.\n // There is a profitable spread iff the cost per unit bought (OrderA.MakerAmount/OrderA.TakerAmount) for each order is greater\n // than the profit per unit sold of the matched order (OrderB.TakerAmount/OrderB.MakerAmount).\n // This is satisfied by the equations below:\n // <leftOrder.makerAssetAmount> / <leftOrder.takerAssetAmount> >= <rightOrder.takerAssetAmount> / <rightOrder.makerAssetAmount>\n // AND\n // <rightOrder.makerAssetAmount> / <rightOrder.takerAssetAmount> >= <leftOrder.takerAssetAmount> / <leftOrder.makerAssetAmount>\n // These equations can be combined to get the following:\n require(\n safeMul(leftOrder.makerAssetAmount, rightOrder.makerAssetAmount) >=\n safeMul(leftOrder.takerAssetAmount, rightOrder.takerAssetAmount),\n \"NEGATIVE_SPREAD_REQUIRED\"\n );\n }\n\n /// @dev Calculates fill amounts for the matched orders.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the leftOrder order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftOrderTakerAssetFilledAmount Amount of left order already filled.\n /// @param rightOrderTakerAssetFilledAmount Amount of right order already filled.\n /// @param matchedFillResults Amounts to fill and fees to pay by maker and taker of matched orders.\n function calculateMatchedFillResults(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n uint256 leftOrderTakerAssetFilledAmount,\n uint256 rightOrderTakerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.MatchedFillResults memory matchedFillResults)\n {\n // Derive maker asset amounts for left & right orders, given store taker assert amounts\n uint256 leftTakerAssetAmountRemaining = safeSub(leftOrder.takerAssetAmount, leftOrderTakerAssetFilledAmount);\n uint256 leftMakerAssetAmountRemaining = safeGetPartialAmountFloor(\n leftOrder.makerAssetAmount,\n leftOrder.takerAssetAmount,\n leftTakerAssetAmountRemaining\n );\n uint256 rightTakerAssetAmountRemaining = safeSub(rightOrder.takerAssetAmount, rightOrderTakerAssetFilledAmount);\n uint256 rightMakerAssetAmountRemaining = safeGetPartialAmountFloor(\n rightOrder.makerAssetAmount,\n rightOrder.takerAssetAmount,\n rightTakerAssetAmountRemaining\n );\n\n // Calculate fill results for maker and taker assets: at least one order will be fully filled.\n // The maximum amount the left maker can buy is `leftTakerAssetAmountRemaining`\n // The maximum amount the right maker can sell is `rightMakerAssetAmountRemaining`\n // We have two distinct cases for calculating the fill results:\n // Case 1.\n // If the left maker can buy more than the right maker can sell, then only the right order is fully filled.\n // If the left maker can buy exactly what the right maker can sell, then both orders are fully filled.\n // Case 2.\n // If the left maker cannot buy more than the right maker can sell, then only the left order is fully filled.\n if (leftTakerAssetAmountRemaining >= rightMakerAssetAmountRemaining) {\n // Case 1: Right order is fully filled\n matchedFillResults.right.makerAssetFilledAmount = rightMakerAssetAmountRemaining;\n matchedFillResults.right.takerAssetFilledAmount = rightTakerAssetAmountRemaining;\n matchedFillResults.left.takerAssetFilledAmount = matchedFillResults.right.makerAssetFilledAmount;\n // Round down to ensure the maker's exchange rate does not exceed the price specified by the order. \n // We favor the maker when the exchange rate must be rounded.\n matchedFillResults.left.makerAssetFilledAmount = safeGetPartialAmountFloor(\n leftOrder.makerAssetAmount,\n leftOrder.takerAssetAmount,\n matchedFillResults.left.takerAssetFilledAmount\n );\n } else {\n // Case 2: Left order is fully filled\n matchedFillResults.left.makerAssetFilledAmount = leftMakerAssetAmountRemaining;\n matchedFillResults.left.takerAssetFilledAmount = leftTakerAssetAmountRemaining;\n matchedFillResults.right.makerAssetFilledAmount = matchedFillResults.left.takerAssetFilledAmount;\n // Round up to ensure the maker's exchange rate does not exceed the price specified by the order.\n // We favor the maker when the exchange rate must be rounded.\n matchedFillResults.right.takerAssetFilledAmount = safeGetPartialAmountCeil(\n rightOrder.takerAssetAmount,\n rightOrder.makerAssetAmount,\n matchedFillResults.right.makerAssetFilledAmount\n );\n }\n\n // Calculate amount given to taker\n matchedFillResults.leftMakerAssetSpreadAmount = safeSub(\n matchedFillResults.left.makerAssetFilledAmount,\n matchedFillResults.right.takerAssetFilledAmount\n );\n\n // Compute fees for left order\n matchedFillResults.left.makerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.left.makerAssetFilledAmount,\n leftOrder.makerAssetAmount,\n leftOrder.makerFee\n );\n matchedFillResults.left.takerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.left.takerAssetFilledAmount,\n leftOrder.takerAssetAmount,\n leftOrder.takerFee\n );\n\n // Compute fees for right order\n matchedFillResults.right.makerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.right.makerAssetFilledAmount,\n rightOrder.makerAssetAmount,\n rightOrder.makerFee\n );\n matchedFillResults.right.takerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.right.takerAssetFilledAmount,\n rightOrder.takerAssetAmount,\n rightOrder.takerFee\n );\n\n // Return fill results\n return matchedFillResults;\n }\n\n /// @dev Settles matched order by transferring appropriate funds between order makers, taker, and fee recipient.\n /// @param leftOrder First matched order.\n /// @param rightOrder Second matched order.\n /// @param takerAddress Address that matched the orders. The taker receives the spread between orders as profit.\n /// @param matchedFillResults Struct holding amounts to transfer between makers, taker, and fee recipients.\n function settleMatchedOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n address takerAddress,\n LibFillResults.MatchedFillResults memory matchedFillResults\n )\n private\n {\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n // Order makers and taker\n dispatchTransferFrom(\n leftOrder.makerAssetData,\n leftOrder.makerAddress,\n rightOrder.makerAddress,\n matchedFillResults.right.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n rightOrder.makerAssetData,\n rightOrder.makerAddress,\n leftOrder.makerAddress,\n matchedFillResults.left.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n leftOrder.makerAssetData,\n leftOrder.makerAddress,\n takerAddress,\n matchedFillResults.leftMakerAssetSpreadAmount\n );\n\n // Maker fees\n dispatchTransferFrom(\n zrxAssetData,\n leftOrder.makerAddress,\n leftOrder.feeRecipientAddress,\n matchedFillResults.left.makerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n rightOrder.makerAddress,\n rightOrder.feeRecipientAddress,\n matchedFillResults.right.makerFeePaid\n );\n\n // Taker fees\n if (leftOrder.feeRecipientAddress == rightOrder.feeRecipientAddress) {\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n leftOrder.feeRecipientAddress,\n safeAdd(\n matchedFillResults.left.takerFeePaid,\n matchedFillResults.right.takerFeePaid\n )\n );\n } else {\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n leftOrder.feeRecipientAddress,\n matchedFillResults.left.takerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n rightOrder.feeRecipientAddress,\n matchedFillResults.right.takerFeePaid\n );\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinSignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./interfaces/IWallet.sol\";\nimport \"./interfaces/IValidator.sol\";\n\n\ncontract MixinSignatureValidator is\n ReentrancyGuard,\n MSignatureValidator,\n MTransactions\n{\n using LibBytes for bytes;\n \n // Mapping of hash => signer => signed\n mapping (bytes32 => mapping (address => bool)) public preSigned;\n\n // Mapping of signer => validator => approved\n mapping (address => mapping (address => bool)) public allowedValidators;\n\n /// @dev Approves a hash on-chain using any valid signature type.\n /// After presigning a hash, the preSign signature type will become valid for that hash and signer.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n function preSign(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external\n {\n if (signerAddress != msg.sender) {\n require(\n isValidSignature(\n hash,\n signerAddress,\n signature\n ),\n \"INVALID_SIGNATURE\"\n );\n }\n preSigned[hash][signerAddress] = true;\n }\n\n /// @dev Approves/unnapproves a Validator contract to verify signatures on signer's behalf.\n /// @param validatorAddress Address of Validator contract.\n /// @param approval Approval or disapproval of Validator contract.\n function setSignatureValidatorApproval(\n address validatorAddress,\n bool approval\n )\n external\n nonReentrant\n {\n address signerAddress = getCurrentContextAddress();\n allowedValidators[signerAddress][validatorAddress] = approval;\n emit SignatureValidatorApproval(\n signerAddress,\n validatorAddress,\n approval\n );\n }\n\n /// @dev Verifies that a hash has been signed by the given signer.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes memory signature\n )\n public\n view\n returns (bool isValid)\n {\n require(\n signature.length > 0,\n \"LENGTH_GREATER_THAN_0_REQUIRED\"\n );\n\n // Pop last byte off of signature byte array.\n uint8 signatureTypeRaw = uint8(signature.popLastByte());\n\n // Ensure signature is supported\n require(\n signatureTypeRaw < uint8(SignatureType.NSignatureTypes),\n \"SIGNATURE_UNSUPPORTED\"\n );\n\n SignatureType signatureType = SignatureType(signatureTypeRaw);\n\n // Variables are not scoped in Solidity.\n uint8 v;\n bytes32 r;\n bytes32 s;\n address recovered;\n\n // Always illegal signature.\n // This is always an implicit option since a signer can create a\n // signature array with invalid type or length. We may as well make\n // it an explicit option. This aids testing and analysis. It is\n // also the initialization value for the enum type.\n if (signatureType == SignatureType.Illegal) {\n revert(\"SIGNATURE_ILLEGAL\");\n\n // Always invalid signature.\n // Like Illegal, this is always implicitly available and therefore\n // offered explicitly. It can be implicitly created by providing\n // a correctly formatted but incorrect signature.\n } else if (signatureType == SignatureType.Invalid) {\n require(\n signature.length == 0,\n \"LENGTH_0_REQUIRED\"\n );\n isValid = false;\n return isValid;\n\n // Signature using EIP712\n } else if (signatureType == SignatureType.EIP712) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n hash,\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n\n // Signed using web3.eth_sign\n } else if (signatureType == SignatureType.EthSign) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n keccak256(abi.encodePacked(\n \"\\x19Ethereum Signed Message:\\n32\",\n hash\n )),\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n\n // Signature verified by wallet contract.\n // If used with an order, the maker of the order is the wallet contract.\n } else if (signatureType == SignatureType.Wallet) {\n isValid = isValidWalletSignature(\n hash,\n signerAddress,\n signature\n );\n return isValid;\n\n // Signature verified by validator contract.\n // If used with an order, the maker of the order can still be an EOA.\n // A signature using this type should be encoded as:\n // | Offset | Length | Contents |\n // | 0x00 | x | Signature to validate |\n // | 0x00 + x | 20 | Address of validator contract |\n // | 0x14 + x | 1 | Signature type is always \"\\x06\" |\n } else if (signatureType == SignatureType.Validator) {\n // Pop last 20 bytes off of signature byte array.\n address validatorAddress = signature.popLast20Bytes();\n \n // Ensure signer has approved validator.\n if (!allowedValidators[signerAddress][validatorAddress]) {\n return false;\n }\n isValid = isValidValidatorSignature(\n validatorAddress,\n hash,\n signerAddress,\n signature\n );\n return isValid;\n\n // Signer signed hash previously using the preSign function.\n } else if (signatureType == SignatureType.PreSigned) {\n isValid = preSigned[hash][signerAddress];\n return isValid;\n }\n\n // Anything else is illegal (We do not return false because\n // the signature may actually be valid, just not in a format\n // that we currently support. In this case returning false\n // may lead the caller to incorrectly believe that the\n // signature was invalid.)\n revert(\"SIGNATURE_UNSUPPORTED\");\n }\n\n /// @dev Verifies signature using logic defined by Wallet contract.\n /// @param hash Any 32 byte hash.\n /// @param walletAddress Address that should have signed the given hash\n /// and defines its own signature verification method.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if signature is valid for given wallet..\n function isValidWalletSignature(\n bytes32 hash,\n address walletAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid)\n {\n bytes memory calldata = abi.encodeWithSelector(\n IWallet(walletAddress).isValidSignature.selector,\n hash,\n signature\n );\n assembly {\n let cdStart := add(calldata, 32)\n let success := staticcall(\n gas, // forward all gas\n walletAddress, // address of Wallet contract\n cdStart, // pointer to start of input\n mload(calldata), // length of input\n cdStart, // write output over input\n 32 // output size is 32 bytes\n )\n\n switch success\n case 0 {\n // Revert with `Error(\"WALLET_ERROR\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000c57414c4c45545f4552524f5200000000000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n case 1 {\n // Signature is valid if call did not revert and returned true\n isValid := mload(cdStart)\n }\n }\n return isValid;\n }\n\n /// @dev Verifies signature using logic defined by Validator contract.\n /// @param validatorAddress Address of validator contract.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidValidatorSignature(\n address validatorAddress,\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid)\n {\n bytes memory calldata = abi.encodeWithSelector(\n IValidator(signerAddress).isValidSignature.selector,\n hash,\n signerAddress,\n signature\n );\n assembly {\n let cdStart := add(calldata, 32)\n let success := staticcall(\n gas, // forward all gas\n validatorAddress, // address of Validator contract\n cdStart, // pointer to start of input\n mload(calldata), // length of input\n cdStart, // write output over input\n 32 // output size is 32 bytes\n )\n\n switch success\n case 0 {\n // Revert with `Error(\"VALIDATOR_ERROR\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f56414c494441544f525f4552524f5200000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n case 1 {\n // Signature is valid if call did not revert and returned true\n isValid := mload(cdStart)\n }\n }\n return isValid;\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinTransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\nimport \"./libs/LibExchangeErrors.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./libs/LibEIP712.sol\";\n\n\ncontract MixinTransactions is\n LibEIP712,\n MSignatureValidator,\n MTransactions\n{\n // Mapping of transaction hash => executed\n // This prevents transactions from being executed more than once.\n mapping (bytes32 => bool) public transactions;\n\n // Address of current transaction signer\n address public currentContextAddress;\n\n /// @dev Executes an exchange method call in the context of signer.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @param signature Proof of signer transaction by signer.\n function executeTransaction(\n uint256 salt,\n address signerAddress,\n bytes data,\n bytes signature\n )\n external\n {\n // Prevent reentrancy\n require(\n currentContextAddress == address(0),\n \"REENTRANCY_ILLEGAL\"\n );\n\n bytes32 transactionHash = hashEIP712Message(hashZeroExTransaction(\n salt,\n signerAddress,\n data\n ));\n\n // Validate transaction has not been executed\n require(\n !transactions[transactionHash],\n \"INVALID_TX_HASH\"\n );\n\n // Transaction always valid if signer is sender of transaction\n if (signerAddress != msg.sender) {\n // Validate signature\n require(\n isValidSignature(\n transactionHash,\n signerAddress,\n signature\n ),\n \"INVALID_TX_SIGNATURE\"\n );\n\n // Set the current transaction signer\n currentContextAddress = signerAddress;\n }\n\n // Execute transaction\n transactions[transactionHash] = true;\n require(\n address(this).delegatecall(data),\n \"FAILED_EXECUTION\"\n );\n\n // Reset current transaction signer if it was previously updated\n if (signerAddress != msg.sender) {\n currentContextAddress = address(0);\n }\n }\n\n /// @dev Calculates EIP712 hash of the Transaction.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @return EIP712 hash of the Transaction.\n function hashZeroExTransaction(\n uint256 salt,\n address signerAddress,\n bytes memory data\n )\n internal\n pure\n returns (bytes32 result)\n {\n bytes32 schemaHash = EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH;\n bytes32 dataHash = keccak256(data);\n\n // Assembly for more efficiently computing:\n // keccak256(abi.encodePacked(\n // EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH,\n // salt,\n // bytes32(signerAddress),\n // keccak256(data)\n // ));\n\n assembly {\n // Load free memory pointer\n let memPtr := mload(64)\n\n mstore(memPtr, schemaHash) // hash of schema\n mstore(add(memPtr, 32), salt) // salt\n mstore(add(memPtr, 64), and(signerAddress, 0xffffffffffffffffffffffffffffffffffffffff)) // signerAddress\n mstore(add(memPtr, 96), dataHash) // hash of data\n\n // Compute hash\n result := keccak256(memPtr, 128)\n }\n return result;\n }\n\n /// @dev The current function will be called in the context of this address (either 0x transaction signer or `msg.sender`).\n /// If calling a fill function, this address will represent the taker.\n /// If calling a cancel function, this address will represent the maker.\n /// @return Signer of 0x transaction if entry point is `executeTransaction`.\n /// `msg.sender` if entry point is any other function.\n function getCurrentContextAddress()\n internal\n view\n returns (address)\n {\n address currentContextAddress_ = currentContextAddress;\n address contextAddress = currentContextAddress_ == address(0) ? msg.sender : currentContextAddress_;\n return contextAddress;\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./libs/LibAbiEncoder.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MWrapperFunctions.sol\";\n\n\ncontract MixinWrapperFunctions is\n ReentrancyGuard,\n LibMath,\n LibFillResults,\n LibAbiEncoder,\n MExchangeCore,\n MWrapperFunctions\n{\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n nonReentrant\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrKillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n return fillResults;\n }\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (FillResults memory fillResults)\n {\n // ABI encode calldata for `fillOrder`\n bytes memory fillOrderCalldata = abiEncodeFillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n\n // Delegate to `fillOrder` and handle any exceptions gracefully\n assembly {\n let success := delegatecall(\n gas, // forward all gas\n address, // call address of this contract\n add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes)\n mload(fillOrderCalldata), // length of input\n fillOrderCalldata, // write output over input\n 128 // output size is 128 bytes\n )\n if success {\n mstore(fillResults, mload(fillOrderCalldata))\n mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32)))\n mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64)))\n mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96)))\n }\n }\n // fillResults values will be 0 by default if call was unsuccessful\n return fillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrKill.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrKillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrKillOrderInternal(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrders(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n bytes memory takerAssetData = orders[0].takerAssetData;\n \n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being sold by taker is the same for each order.\n // Rather than passing this in as calldata, we use the takerAssetData from the first order in all later orders.\n orders[i].takerAssetData = takerAssetData;\n\n // Calculate the remaining amount of takerAsset to sell\n uint256 remainingTakerAssetFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= takerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory takerAssetData = orders[0].takerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being sold by taker is the same for each order.\n // Rather than passing this in as calldata, we use the takerAssetData from the first order in all later orders.\n orders[i].takerAssetData = takerAssetData;\n\n // Calculate the remaining amount of takerAsset to sell\n uint256 remainingTakerAssetFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= takerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerAsset is bought by taker.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrders(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // Rather than passing this in as calldata, we copy the makerAssetData from the first order onto all later orders.\n orders[i].makerAssetData = makerAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n if (totalFillResults.makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // Rather than passing this in as calldata, we copy the makerAssetData from the first order onto all later orders.\n orders[i].makerAssetData = makerAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n if (totalFillResults.makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously cancels multiple orders in a single transaction.\n /// @param orders Array of order specifications.\n function batchCancelOrders(LibOrder.Order[] memory orders)\n public\n nonReentrant\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n cancelOrderInternal(orders[i]);\n }\n }\n\n /// @dev Fetches information for all passed in orders.\n /// @param orders Array of order specifications.\n /// @return Array of OrderInfo instances that correspond to each order.\n function getOrdersInfo(LibOrder.Order[] memory orders)\n public\n view\n returns (LibOrder.OrderInfo[] memory)\n {\n uint256 ordersLength = orders.length;\n LibOrder.OrderInfo[] memory ordersInfo = new LibOrder.OrderInfo[](ordersLength);\n for (uint256 i = 0; i != ordersLength; i++) {\n ordersInfo[i] = getOrderInfo(orders[i]);\n }\n return ordersInfo;\n }\n\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n require(\n fillResults.takerAssetFilledAmount == takerAssetFillAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return fillResults;\n }\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IAssetProxyDispatcher {\n\n /// @dev Registers an asset proxy to its asset proxy id.\n /// Once an asset proxy is registered, it cannot be unregistered.\n /// @param assetProxy Address of new asset proxy to register.\n function registerAssetProxy(address assetProxy)\n external;\n\n /// @dev Gets an asset proxy.\n /// @param assetProxyId Id of the asset proxy.\n /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered.\n function getAssetProxy(bytes4 assetProxyId)\n external\n view\n returns (address);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IExchange.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./IExchangeCore.sol\";\nimport \"./IMatchOrders.sol\";\nimport \"./ISignatureValidator.sol\";\nimport \"./ITransactions.sol\";\nimport \"./IAssetProxyDispatcher.sol\";\nimport \"./IWrapperFunctions.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract IExchange is\n IExchangeCore,\n IMatchOrders,\n ISignatureValidator,\n ITransactions,\n IAssetProxyDispatcher,\n IWrapperFunctions\n{}\n",
- "2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IExchangeCore {\n\n /// @dev Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch\n /// and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress).\n /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled.\n function cancelOrdersUpTo(uint256 targetOrderEpoch)\n external;\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev After calling, the order can not be filled anymore.\n /// @param order Order struct containing order specifications.\n function cancelOrder(LibOrder.Order memory order)\n public;\n\n /// @dev Gets information about an order: status, hash, and amount filled.\n /// @param order Order to gather information on.\n /// @return OrderInfo Information about the order and its state.\n /// See LibOrder.OrderInfo for a complete description.\n function getOrderInfo(LibOrder.Order memory order)\n public\n view\n returns (LibOrder.OrderInfo memory orderInfo);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IMatchOrders {\n\n /// @dev Match two complementary orders that have a profitable spread.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the left order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftSignature Proof that order was created by the left maker.\n /// @param rightSignature Proof that order was created by the right maker.\n /// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.\n function matchOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n bytes memory leftSignature,\n bytes memory rightSignature\n )\n public\n returns (LibFillResults.MatchedFillResults memory matchedFillResults);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract ISignatureValidator {\n\n /// @dev Approves a hash on-chain using any valid signature type.\n /// After presigning a hash, the preSign signature type will become valid for that hash and signer.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n function preSign(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external;\n \n /// @dev Approves/unnapproves a Validator contract to verify signatures on signer's behalf.\n /// @param validatorAddress Address of Validator contract.\n /// @param approval Approval or disapproval of Validator contract.\n function setSignatureValidatorApproval(\n address validatorAddress,\n bool approval\n )\n external;\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signerAddress Address of signer.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes memory signature\n )\n public\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/ITransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\n\ncontract ITransactions {\n\n /// @dev Executes an exchange method call in the context of signer.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @param signature Proof of signer transaction by signer.\n function executeTransaction(\n uint256 salt,\n address signerAddress,\n bytes data,\n bytes signature\n )\n external;\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IValidator {\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IWallet.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IWallet {\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n bytes signature\n )\n external\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IWrapperFunctions {\n\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrKill.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrKillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrders(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerAsset is bought by taker.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrders(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously cancels multiple orders in a single transaction.\n /// @param orders Array of order specifications.\n function batchCancelOrders(LibOrder.Order[] memory orders)\n public;\n\n /// @dev Fetches information for all passed in orders\n /// @param orders Array of order specifications.\n /// @return Array of OrderInfo instances that correspond to each order.\n function getOrdersInfo(LibOrder.Order[] memory orders)\n public\n view\n returns (LibOrder.OrderInfo[] memory);\n}\n",
- "2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./LibOrder.sol\";\n\n\ncontract LibAbiEncoder {\n\n /// @dev ABI encodes calldata for `fillOrder`.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return ABI encoded calldata for `fillOrder`.\n function abiEncodeFillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n pure\n returns (bytes memory fillOrderCalldata)\n {\n // We need to call MExchangeCore.fillOrder using a delegatecall in\n // assembly so that we can intercept a call that throws. For this, we\n // need the input encoded in memory in the Ethereum ABIv2 format [1].\n\n // | Area | Offset | Length | Contents |\n // | -------- |--------|---------|-------------------------------------------- |\n // | Header | 0x00 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 0x00 | | 1. offset to order (*) |\n // | | 0x20 | | 2. takerAssetFillAmount |\n // | | 0x40 | | 3. offset to signature (*) |\n // | Data | | 12 * 32 | order: |\n // | | 0x000 | | 1. senderAddress |\n // | | 0x020 | | 2. makerAddress |\n // | | 0x040 | | 3. takerAddress |\n // | | 0x060 | | 4. feeRecipientAddress |\n // | | 0x080 | | 5. makerAssetAmount |\n // | | 0x0A0 | | 6. takerAssetAmount |\n // | | 0x0C0 | | 7. makerFeeAmount |\n // | | 0x0E0 | | 8. takerFeeAmount |\n // | | 0x100 | | 9. expirationTimeSeconds |\n // | | 0x120 | | 10. salt |\n // | | 0x140 | | 11. Offset to makerAssetData (*) |\n // | | 0x160 | | 12. Offset to takerAssetData (*) |\n // | | 0x180 | 32 | makerAssetData Length |\n // | | 0x1A0 | ** | makerAssetData Contents |\n // | | 0x1C0 | 32 | takerAssetData Length |\n // | | 0x1E0 | ** | takerAssetData Contents |\n // | | 0x200 | 32 | signature Length |\n // | | 0x220 | ** | signature Contents |\n\n // * Offsets are calculated from the beginning of the current area: Header, Params, Data:\n // An offset stored in the Params area is calculated from the beginning of the Params section.\n // An offset stored in the Data area is calculated from the beginning of the Data section.\n\n // ** The length of dynamic array contents are stored in the field immediately preceeding the contents.\n\n // [1]: https://solidity.readthedocs.io/en/develop/abi-spec.html\n\n assembly {\n\n // Areas below may use the following variables:\n // 1. <area>Start -- Start of this area in memory\n // 2. <area>End -- End of this area in memory. This value may\n // be precomputed (before writing contents),\n // or it may be computed as contents are written.\n // 3. <area>Offset -- Current offset into area. If an area's End\n // is precomputed, this variable tracks the\n // offsets of contents as they are written.\n\n /////// Setup Header Area ///////\n // Load free memory pointer\n fillOrderCalldata := mload(0x40)\n // bytes4(keccak256(\"fillOrder((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),uint256,bytes)\"))\n // = 0xb4be83d5\n // Leave 0x20 bytes to store the length\n mstore(add(fillOrderCalldata, 0x20), 0xb4be83d500000000000000000000000000000000000000000000000000000000)\n let headerAreaEnd := add(fillOrderCalldata, 0x24)\n\n /////// Setup Params Area ///////\n // This area is preallocated and written to later.\n // This is because we need to fill in offsets that have not yet been calculated.\n let paramsAreaStart := headerAreaEnd\n let paramsAreaEnd := add(paramsAreaStart, 0x60)\n let paramsAreaOffset := paramsAreaStart\n\n /////// Setup Data Area ///////\n let dataAreaStart := paramsAreaEnd\n let dataAreaEnd := dataAreaStart\n\n // Offset from the source data we're reading from\n let sourceOffset := order\n // arrayLenBytes and arrayLenWords track the length of a dynamically-allocated bytes array.\n let arrayLenBytes := 0\n let arrayLenWords := 0\n\n /////// Write order Struct ///////\n // Write memory location of Order, relative to the start of the\n // parameter list, then increment the paramsAreaOffset respectively.\n mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))\n paramsAreaOffset := add(paramsAreaOffset, 0x20)\n\n // Write values for each field in the order\n // It would be nice to use a loop, but we save on gas by writing\n // the stores sequentially.\n mstore(dataAreaEnd, mload(sourceOffset)) // makerAddress\n mstore(add(dataAreaEnd, 0x20), mload(add(sourceOffset, 0x20))) // takerAddress\n mstore(add(dataAreaEnd, 0x40), mload(add(sourceOffset, 0x40))) // feeRecipientAddress\n mstore(add(dataAreaEnd, 0x60), mload(add(sourceOffset, 0x60))) // senderAddress\n mstore(add(dataAreaEnd, 0x80), mload(add(sourceOffset, 0x80))) // makerAssetAmount\n mstore(add(dataAreaEnd, 0xA0), mload(add(sourceOffset, 0xA0))) // takerAssetAmount\n mstore(add(dataAreaEnd, 0xC0), mload(add(sourceOffset, 0xC0))) // makerFeeAmount\n mstore(add(dataAreaEnd, 0xE0), mload(add(sourceOffset, 0xE0))) // takerFeeAmount\n mstore(add(dataAreaEnd, 0x100), mload(add(sourceOffset, 0x100))) // expirationTimeSeconds\n mstore(add(dataAreaEnd, 0x120), mload(add(sourceOffset, 0x120))) // salt\n mstore(add(dataAreaEnd, 0x140), mload(add(sourceOffset, 0x140))) // Offset to makerAssetData\n mstore(add(dataAreaEnd, 0x160), mload(add(sourceOffset, 0x160))) // Offset to takerAssetData\n dataAreaEnd := add(dataAreaEnd, 0x180)\n sourceOffset := add(sourceOffset, 0x180)\n\n // Write offset to <order.makerAssetData>\n mstore(add(dataAreaStart, mul(10, 0x20)), sub(dataAreaEnd, dataAreaStart))\n\n // Calculate length of <order.makerAssetData>\n sourceOffset := mload(add(order, 0x140)) // makerAssetData\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of <order.makerAssetData>\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of <order.makerAssetData>\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n // Write offset to <order.takerAssetData>\n mstore(add(dataAreaStart, mul(11, 0x20)), sub(dataAreaEnd, dataAreaStart))\n\n // Calculate length of <order.takerAssetData>\n sourceOffset := mload(add(order, 0x160)) // takerAssetData\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of <order.takerAssetData>\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of <order.takerAssetData>\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n /////// Write takerAssetFillAmount ///////\n mstore(paramsAreaOffset, takerAssetFillAmount)\n paramsAreaOffset := add(paramsAreaOffset, 0x20)\n\n /////// Write signature ///////\n // Write offset to paramsArea\n mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))\n\n // Calculate length of signature\n sourceOffset := signature\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of signature\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of signature\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n // Set length of calldata\n mstore(fillOrderCalldata, sub(dataAreaEnd, add(fillOrderCalldata, 0x20)))\n\n // Increment free memory pointer\n mstore(0x40, dataAreaEnd)\n }\n\n return fillOrderCalldata;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibConstants.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\n// solhint-disable max-line-length\ncontract LibConstants {\n \n // Asset data for ZRX token. Used for fee transfers.\n // @TODO: Hardcode constant when we deploy. Currently \n // not constant to make testing easier.\n\n // The proxyId for ZRX_ASSET_DATA is bytes4(keccak256(\"ERC20Token(address)\")) = 0xf47261b0\n \n // Kovan ZRX address is 0x6ff6c0ff1d68b964901f986d4c9fa3ac68346570.\n // The ABI encoded proxyId and address is 0xf47261b00000000000000000000000006ff6c0ff1d68b964901f986d4c9fa3ac68346570\n // bytes constant public ZRX_ASSET_DATA = \"\\xf4\\x72\\x61\\xb0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x6f\\xf6\\xc0\\xff\\x1d\\x68\\xb9\\x64\\x90\\x1f\\x98\\x6d\\x4c\\x9f\\xa3\\xac\\x68\\x34\\x65\\x70\";\n \n // Mainnet ZRX address is 0xe41d2489571d322189246dafa5ebde1f4699f498.\n // The ABI encoded proxyId and address is 0xf47261b0000000000000000000000000e41d2489571d322189246dafa5ebde1f4699f498\n bytes constant public ZRX_ASSET_DATA = \"\\xf4\\x72\\x61\\xb0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xe4\\x1d\\x24\\x89\\x57\\x1d\\x32\\x21\\x89\\x24\\x6d\\xaf\\xa5\\xeb\\xde\\x1f\\x46\\x99\\xf4\\x98\";\n}\n// solhint-enable max-line-length\n",
- "2.0.0/protocol/Exchange/libs/LibEIP712.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract LibEIP712 {\n\n // EIP191 header for EIP712 prefix\n string constant internal EIP191_HEADER = \"\\x19\\x01\";\n\n // EIP712 Domain Name value\n string constant internal EIP712_DOMAIN_NAME = \"0x Protocol\";\n\n // EIP712 Domain Version value\n string constant internal EIP712_DOMAIN_VERSION = \"2\";\n\n // Hash of the EIP712 Domain Separator Schema\n bytes32 constant internal EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"EIP712Domain(\",\n \"string name,\",\n \"string version,\",\n \"address verifyingContract\",\n \")\"\n ));\n\n // Hash of the EIP712 Domain Separator data\n // solhint-disable-next-line var-name-mixedcase\n bytes32 public EIP712_DOMAIN_HASH;\n\n constructor ()\n public\n {\n EIP712_DOMAIN_HASH = keccak256(abi.encodePacked(\n EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH,\n keccak256(bytes(EIP712_DOMAIN_NAME)),\n keccak256(bytes(EIP712_DOMAIN_VERSION)),\n bytes32(address(this))\n ));\n }\n\n /// @dev Calculates EIP712 encoding for a hash struct in this EIP712 Domain.\n /// @param hashStruct The EIP712 hash struct.\n /// @return EIP712 hash applied to this EIP712 Domain.\n function hashEIP712Message(bytes32 hashStruct)\n internal\n view\n returns (bytes32 result)\n {\n bytes32 eip712DomainHash = EIP712_DOMAIN_HASH;\n\n // Assembly for more efficient computing:\n // keccak256(abi.encodePacked(\n // EIP191_HEADER,\n // EIP712_DOMAIN_HASH,\n // hashStruct \n // ));\n\n assembly {\n // Load free memory pointer\n let memPtr := mload(64)\n\n mstore(memPtr, 0x1901000000000000000000000000000000000000000000000000000000000000) // EIP191 header\n mstore(add(memPtr, 2), eip712DomainHash) // EIP712 domain hash\n mstore(add(memPtr, 34), hashStruct) // Hash of struct\n\n // Compute hash\n result := keccak256(memPtr, 66)\n }\n return result;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\n// solhint-disable\npragma solidity 0.4.24;\n\n\n/// @dev This contract documents the revert reasons used in the Exchange contract.\n/// This contract is intended to serve as a reference, but is not actually used for efficiency reasons.\ncontract LibExchangeErrors {\n\n /// Order validation errors ///\n string constant ORDER_UNFILLABLE = \"ORDER_UNFILLABLE\"; // Order cannot be filled.\n string constant INVALID_MAKER = \"INVALID_MAKER\"; // Invalid makerAddress.\n string constant INVALID_TAKER = \"INVALID_TAKER\"; // Invalid takerAddress.\n string constant INVALID_SENDER = \"INVALID_SENDER\"; // Invalid `msg.sender`.\n string constant INVALID_ORDER_SIGNATURE = \"INVALID_ORDER_SIGNATURE\"; // Signature validation failed. \n \n /// fillOrder validation errors ///\n string constant INVALID_TAKER_AMOUNT = \"INVALID_TAKER_AMOUNT\"; // takerAssetFillAmount cannot equal 0.\n string constant ROUNDING_ERROR = \"ROUNDING_ERROR\"; // Rounding error greater than 0.1% of takerAssetFillAmount. \n \n /// Signature validation errors ///\n string constant INVALID_SIGNATURE = \"INVALID_SIGNATURE\"; // Signature validation failed. \n string constant SIGNATURE_ILLEGAL = \"SIGNATURE_ILLEGAL\"; // Signature type is illegal.\n string constant SIGNATURE_UNSUPPORTED = \"SIGNATURE_UNSUPPORTED\"; // Signature type unsupported.\n \n /// cancelOrdersUptTo errors ///\n string constant INVALID_NEW_ORDER_EPOCH = \"INVALID_NEW_ORDER_EPOCH\"; // Specified salt must be greater than or equal to existing orderEpoch.\n\n /// fillOrKillOrder errors ///\n string constant COMPLETE_FILL_FAILED = \"COMPLETE_FILL_FAILED\"; // Desired takerAssetFillAmount could not be completely filled. \n\n /// matchOrders errors ///\n string constant NEGATIVE_SPREAD_REQUIRED = \"NEGATIVE_SPREAD_REQUIRED\"; // Matched orders must have a negative spread.\n\n /// Transaction errors ///\n string constant REENTRANCY_ILLEGAL = \"REENTRANCY_ILLEGAL\"; // Recursive reentrancy is not allowed. \n string constant INVALID_TX_HASH = \"INVALID_TX_HASH\"; // Transaction has already been executed. \n string constant INVALID_TX_SIGNATURE = \"INVALID_TX_SIGNATURE\"; // Signature validation failed. \n string constant FAILED_EXECUTION = \"FAILED_EXECUTION\"; // Transaction execution failed. \n \n /// registerAssetProxy errors ///\n string constant ASSET_PROXY_ALREADY_EXISTS = \"ASSET_PROXY_ALREADY_EXISTS\"; // AssetProxy with same id already exists.\n\n /// dispatchTransferFrom errors ///\n string constant ASSET_PROXY_DOES_NOT_EXIST = \"ASSET_PROXY_DOES_NOT_EXIST\"; // No assetProxy registered at given id.\n string constant TRANSFER_FAILED = \"TRANSFER_FAILED\"; // Asset transfer unsuccesful.\n\n /// Length validation errors ///\n string constant LENGTH_GREATER_THAN_0_REQUIRED = \"LENGTH_GREATER_THAN_0_REQUIRED\"; // Byte array must have a length greater than 0.\n string constant LENGTH_GREATER_THAN_3_REQUIRED = \"LENGTH_GREATER_THAN_3_REQUIRED\"; // Byte array must have a length greater than 3.\n string constant LENGTH_0_REQUIRED = \"LENGTH_0_REQUIRED\"; // Byte array must have a length of 0.\n string constant LENGTH_65_REQUIRED = \"LENGTH_65_REQUIRED\"; // Byte array must have a length of 65.\n}\n",
- "2.0.0/protocol/Exchange/libs/LibFillResults.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract LibFillResults is\n SafeMath\n{\n struct FillResults {\n uint256 makerAssetFilledAmount; // Total amount of makerAsset(s) filled.\n uint256 takerAssetFilledAmount; // Total amount of takerAsset(s) filled.\n uint256 makerFeePaid; // Total amount of ZRX paid by maker(s) to feeRecipient(s).\n uint256 takerFeePaid; // Total amount of ZRX paid by taker to feeRecipients(s).\n }\n\n struct MatchedFillResults {\n FillResults left; // Amounts filled and fees paid of left order.\n FillResults right; // Amounts filled and fees paid of right order.\n uint256 leftMakerAssetSpreadAmount; // Spread between price of left and right order, denominated in the left order's makerAsset, paid to taker.\n }\n\n /// @dev Adds properties of both FillResults instances.\n /// Modifies the first FillResults instance specified.\n /// @param totalFillResults Fill results instance that will be added onto.\n /// @param singleFillResults Fill results instance that will be added to totalFillResults.\n function addFillResults(FillResults memory totalFillResults, FillResults memory singleFillResults)\n internal\n pure\n {\n totalFillResults.makerAssetFilledAmount = safeAdd(totalFillResults.makerAssetFilledAmount, singleFillResults.makerAssetFilledAmount);\n totalFillResults.takerAssetFilledAmount = safeAdd(totalFillResults.takerAssetFilledAmount, singleFillResults.takerAssetFilledAmount);\n totalFillResults.makerFeePaid = safeAdd(totalFillResults.makerFeePaid, singleFillResults.makerFeePaid);\n totalFillResults.takerFeePaid = safeAdd(totalFillResults.takerFeePaid, singleFillResults.takerFeePaid);\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibMath.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract LibMath is\n SafeMath\n{\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// Reverts if rounding error is >= 0.1%\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded down.\n function safeGetPartialAmountFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n require(\n !isRoundingErrorFloor(\n numerator,\n denominator,\n target\n ),\n \"ROUNDING_ERROR\"\n );\n \n partialAmount = safeDiv(\n safeMul(numerator, target),\n denominator\n );\n return partialAmount;\n }\n\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// Reverts if rounding error is >= 0.1%\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded up.\n function safeGetPartialAmountCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n require(\n !isRoundingErrorCeil(\n numerator,\n denominator,\n target\n ),\n \"ROUNDING_ERROR\"\n );\n \n // safeDiv computes `floor(a / b)`. We use the identity (a, b integer):\n // ceil(a / b) = floor((a + b - 1) / b)\n // To implement `ceil(a / b)` using safeDiv.\n partialAmount = safeDiv(\n safeAdd(\n safeMul(numerator, target),\n safeSub(denominator, 1)\n ),\n denominator\n );\n return partialAmount;\n }\n\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded down.\n function getPartialAmountFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n partialAmount = safeDiv(\n safeMul(numerator, target),\n denominator\n );\n return partialAmount;\n }\n \n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded up.\n function getPartialAmountCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n // safeDiv computes `floor(a / b)`. We use the identity (a, b integer):\n // ceil(a / b) = floor((a + b - 1) / b)\n // To implement `ceil(a / b)` using safeDiv.\n partialAmount = safeDiv(\n safeAdd(\n safeMul(numerator, target),\n safeSub(denominator, 1)\n ),\n denominator\n );\n return partialAmount;\n }\n \n /// @dev Checks if rounding error >= 0.1% when rounding down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to multiply with numerator/denominator.\n /// @return Rounding error is present.\n function isRoundingErrorFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (bool isError)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n \n // The absolute rounding error is the difference between the rounded\n // value and the ideal value. The relative rounding error is the\n // absolute rounding error divided by the absolute value of the\n // ideal value. This is undefined when the ideal value is zero.\n //\n // The ideal value is `numerator * target / denominator`.\n // Let's call `numerator * target % denominator` the remainder.\n // The absolute error is `remainder / denominator`.\n //\n // When the ideal value is zero, we require the absolute error to\n // be zero. Fortunately, this is always the case. The ideal value is\n // zero iff `numerator == 0` and/or `target == 0`. In this case the\n // remainder and absolute error are also zero. \n if (target == 0 || numerator == 0) {\n return false;\n }\n \n // Otherwise, we want the relative rounding error to be strictly\n // less than 0.1%.\n // The relative error is `remainder / (numerator * target)`.\n // We want the relative error less than 1 / 1000:\n // remainder / (numerator * denominator) < 1 / 1000\n // or equivalently:\n // 1000 * remainder < numerator * target\n // so we have a rounding error iff:\n // 1000 * remainder >= numerator * target\n uint256 remainder = mulmod(\n target,\n numerator,\n denominator\n );\n isError = safeMul(1000, remainder) >= safeMul(numerator, target);\n return isError;\n }\n \n /// @dev Checks if rounding error >= 0.1% when rounding up.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to multiply with numerator/denominator.\n /// @return Rounding error is present.\n function isRoundingErrorCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (bool isError)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n \n // See the comments in `isRoundingError`.\n if (target == 0 || numerator == 0) {\n // When either is zero, the ideal value and rounded value are zero\n // and there is no rounding error. (Although the relative error\n // is undefined.)\n return false;\n }\n // Compute remainder as before\n uint256 remainder = mulmod(\n target,\n numerator,\n denominator\n );\n remainder = safeSub(denominator, remainder) % denominator;\n isError = safeMul(1000, remainder) >= safeMul(numerator, target);\n return isError;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibOrder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./LibEIP712.sol\";\n\n\ncontract LibOrder is\n LibEIP712\n{\n // Hash for the EIP712 Order Schema\n bytes32 constant internal EIP712_ORDER_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"Order(\",\n \"address makerAddress,\",\n \"address takerAddress,\",\n \"address feeRecipientAddress,\",\n \"address senderAddress,\",\n \"uint256 makerAssetAmount,\",\n \"uint256 takerAssetAmount,\",\n \"uint256 makerFee,\",\n \"uint256 takerFee,\",\n \"uint256 expirationTimeSeconds,\",\n \"uint256 salt,\",\n \"bytes makerAssetData,\",\n \"bytes takerAssetData\",\n \")\"\n ));\n\n // A valid order remains fillable until it is expired, fully filled, or cancelled.\n // An order's state is unaffected by external factors, like account balances.\n enum OrderStatus {\n INVALID, // Default value\n INVALID_MAKER_ASSET_AMOUNT, // Order does not have a valid maker asset amount\n INVALID_TAKER_ASSET_AMOUNT, // Order does not have a valid taker asset amount\n FILLABLE, // Order is fillable\n EXPIRED, // Order has already expired\n FULLY_FILLED, // Order is fully filled\n CANCELLED // Order has been cancelled\n }\n\n // solhint-disable max-line-length\n struct Order {\n address makerAddress; // Address that created the order. \n address takerAddress; // Address that is allowed to fill the order. If set to 0, any address is allowed to fill the order. \n address feeRecipientAddress; // Address that will recieve fees when order is filled. \n address senderAddress; // Address that is allowed to call Exchange contract methods that affect this order. If set to 0, any address is allowed to call these methods.\n uint256 makerAssetAmount; // Amount of makerAsset being offered by maker. Must be greater than 0. \n uint256 takerAssetAmount; // Amount of takerAsset being bid on by maker. Must be greater than 0. \n uint256 makerFee; // Amount of ZRX paid to feeRecipient by maker when order is filled. If set to 0, no transfer of ZRX from maker to feeRecipient will be attempted.\n uint256 takerFee; // Amount of ZRX paid to feeRecipient by taker when order is filled. If set to 0, no transfer of ZRX from taker to feeRecipient will be attempted.\n uint256 expirationTimeSeconds; // Timestamp in seconds at which order expires. \n uint256 salt; // Arbitrary number to facilitate uniqueness of the order's hash. \n bytes makerAssetData; // Encoded data that can be decoded by a specified proxy contract when transferring makerAsset. The last byte references the id of this proxy.\n bytes takerAssetData; // Encoded data that can be decoded by a specified proxy contract when transferring takerAsset. The last byte references the id of this proxy.\n }\n // solhint-enable max-line-length\n\n struct OrderInfo {\n uint8 orderStatus; // Status that describes order's validity and fillability.\n bytes32 orderHash; // EIP712 hash of the order (see LibOrder.getOrderHash).\n uint256 orderTakerAssetFilledAmount; // Amount of order that has already been filled.\n }\n\n /// @dev Calculates Keccak-256 hash of the order.\n /// @param order The order structure.\n /// @return Keccak-256 EIP712 hash of the order.\n function getOrderHash(Order memory order)\n internal\n view\n returns (bytes32 orderHash)\n {\n orderHash = hashEIP712Message(hashOrder(order));\n return orderHash;\n }\n\n /// @dev Calculates EIP712 hash of the order.\n /// @param order The order structure.\n /// @return EIP712 hash of the order.\n function hashOrder(Order memory order)\n internal\n pure\n returns (bytes32 result)\n {\n bytes32 schemaHash = EIP712_ORDER_SCHEMA_HASH;\n bytes32 makerAssetDataHash = keccak256(order.makerAssetData);\n bytes32 takerAssetDataHash = keccak256(order.takerAssetData);\n\n // Assembly for more efficiently computing:\n // keccak256(abi.encodePacked(\n // EIP712_ORDER_SCHEMA_HASH,\n // bytes32(order.makerAddress),\n // bytes32(order.takerAddress),\n // bytes32(order.feeRecipientAddress),\n // bytes32(order.senderAddress),\n // order.makerAssetAmount,\n // order.takerAssetAmount,\n // order.makerFee,\n // order.takerFee,\n // order.expirationTimeSeconds,\n // order.salt,\n // keccak256(order.makerAssetData),\n // keccak256(order.takerAssetData)\n // ));\n\n assembly {\n // Calculate memory addresses that will be swapped out before hashing\n let pos1 := sub(order, 32)\n let pos2 := add(order, 320)\n let pos3 := add(order, 352)\n\n // Backup\n let temp1 := mload(pos1)\n let temp2 := mload(pos2)\n let temp3 := mload(pos3)\n \n // Hash in place\n mstore(pos1, schemaHash)\n mstore(pos2, makerAssetDataHash)\n mstore(pos3, takerAssetDataHash)\n result := keccak256(pos1, 416)\n \n // Restore\n mstore(pos1, temp1)\n mstore(pos2, temp2)\n mstore(pos3, temp3)\n }\n return result;\n }\n}\n",
- "2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAssetProxyDispatcher.sol\";\n\n\ncontract MAssetProxyDispatcher is\n IAssetProxyDispatcher\n{\n // Logs registration of new asset proxy\n event AssetProxyRegistered(\n bytes4 id, // Id of new registered AssetProxy.\n address assetProxy // Address of new registered AssetProxy.\n );\n\n /// @dev Forwards arguments to assetProxy and calls `transferFrom`. Either succeeds or throws.\n /// @param assetData Byte array encoded for the asset.\n /// @param from Address to transfer token from.\n /// @param to Address to transfer token to.\n /// @param amount Amount of token to transfer.\n function dispatchTransferFrom(\n bytes memory assetData,\n address from,\n address to,\n uint256 amount\n )\n internal;\n}\n",
- "2.0.0/protocol/Exchange/mixins/MExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IExchangeCore.sol\";\n\n\ncontract MExchangeCore is\n IExchangeCore\n{\n // Fill event is emitted whenever an order is filled.\n event Fill(\n address indexed makerAddress, // Address that created the order. \n address indexed feeRecipientAddress, // Address that received fees.\n address takerAddress, // Address that filled the order.\n address senderAddress, // Address that called the Exchange contract (msg.sender).\n uint256 makerAssetFilledAmount, // Amount of makerAsset sold by maker and bought by taker. \n uint256 takerAssetFilledAmount, // Amount of takerAsset sold by taker and bought by maker.\n uint256 makerFeePaid, // Amount of ZRX paid to feeRecipient by maker.\n uint256 takerFeePaid, // Amount of ZRX paid to feeRecipient by taker.\n bytes32 indexed orderHash, // EIP712 hash of order (see LibOrder.getOrderHash).\n bytes makerAssetData, // Encoded data specific to makerAsset. \n bytes takerAssetData // Encoded data specific to takerAsset.\n );\n\n // Cancel event is emitted whenever an individual order is cancelled.\n event Cancel(\n address indexed makerAddress, // Address that created the order. \n address indexed feeRecipientAddress, // Address that would have recieved fees if order was filled. \n address senderAddress, // Address that called the Exchange contract (msg.sender).\n bytes32 indexed orderHash, // EIP712 hash of order (see LibOrder.getOrderHash).\n bytes makerAssetData, // Encoded data specific to makerAsset. \n bytes takerAssetData // Encoded data specific to takerAsset.\n );\n\n // CancelUpTo event is emitted whenever `cancelOrdersUpTo` is executed succesfully.\n event CancelUpTo(\n address indexed makerAddress, // Orders cancelled must have been created by this address.\n address indexed senderAddress, // Orders cancelled must have a `senderAddress` equal to this address.\n uint256 orderEpoch // Orders with specified makerAddress and senderAddress with a salt less than this value are considered cancelled.\n );\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev After calling, the order can not be filled anymore.\n /// @param order Order struct containing order specifications.\n function cancelOrderInternal(LibOrder.Order memory order)\n internal;\n\n /// @dev Updates state with results of a fill order.\n /// @param order that was filled.\n /// @param takerAddress Address of taker who filled the order.\n /// @param orderTakerAssetFilledAmount Amount of order already filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function updateFilledState(\n LibOrder.Order memory order,\n address takerAddress,\n bytes32 orderHash,\n uint256 orderTakerAssetFilledAmount,\n LibFillResults.FillResults memory fillResults\n )\n internal;\n\n /// @dev Updates state with results of cancelling an order.\n /// State is only updated if the order is currently fillable.\n /// Otherwise, updating state would have no effect.\n /// @param order that was cancelled.\n /// @param orderHash Hash of order that was cancelled.\n function updateCancelledState(\n LibOrder.Order memory order,\n bytes32 orderHash\n )\n internal;\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAddress Address of order taker.\n /// @param signature Proof that the orders was created by its maker.\n function assertFillableOrder(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo,\n address takerAddress,\n bytes memory signature\n )\n internal\n view;\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo Status, orderHash, and amount already filled of order.\n /// @param takerAssetFillAmount Desired amount of order to fill by taker.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @param makerAssetFilledAmount Amount of makerAsset that will be transfered.\n function assertValidFill(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo,\n uint256 takerAssetFillAmount,\n uint256 takerAssetFilledAmount,\n uint256 makerAssetFilledAmount\n )\n internal\n view;\n\n /// @dev Validates context for cancelOrder. Succeeds or throws.\n /// @param order to be cancelled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n function assertValidCancel(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo\n )\n internal\n view;\n\n /// @dev Calculates amounts filled and fees paid by maker and taker.\n /// @param order to be filled.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function calculateFillResults(\n LibOrder.Order memory order,\n uint256 takerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.FillResults memory fillResults);\n\n}\n",
- "2.0.0/protocol/Exchange/mixins/MMatchOrders.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IMatchOrders.sol\";\n\n\ncontract MMatchOrders is\n IMatchOrders\n{\n /// @dev Validates context for matchOrders. Succeeds or throws.\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n function assertValidMatch(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder\n )\n internal\n pure;\n\n /// @dev Calculates fill amounts for the matched orders.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the leftOrder order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftOrderTakerAssetFilledAmount Amount of left order already filled.\n /// @param rightOrderTakerAssetFilledAmount Amount of right order already filled.\n /// @param matchedFillResults Amounts to fill and fees to pay by maker and taker of matched orders.\n function calculateMatchedFillResults(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n uint256 leftOrderTakerAssetFilledAmount,\n uint256 rightOrderTakerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.MatchedFillResults memory matchedFillResults);\n\n}\n",
- "2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/ISignatureValidator.sol\";\n\n\ncontract MSignatureValidator is\n ISignatureValidator\n{\n event SignatureValidatorApproval(\n address indexed signerAddress, // Address that approves or disapproves a contract to verify signatures.\n address indexed validatorAddress, // Address of signature validator contract.\n bool approved // Approval or disapproval of validator contract.\n );\n\n // Allowed signature types.\n enum SignatureType {\n Illegal, // 0x00, default value\n Invalid, // 0x01\n EIP712, // 0x02\n EthSign, // 0x03\n Wallet, // 0x04\n Validator, // 0x05\n PreSigned, // 0x06\n NSignatureTypes // 0x07, number of signature types. Always leave at end.\n }\n\n /// @dev Verifies signature using logic defined by Wallet contract.\n /// @param hash Any 32 byte hash.\n /// @param walletAddress Address that should have signed the given hash\n /// and defines its own signature verification method.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidWalletSignature(\n bytes32 hash,\n address walletAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid);\n\n /// @dev Verifies signature using logic defined by Validator contract.\n /// @param validatorAddress Address of validator contract.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidValidatorSignature(\n address validatorAddress,\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/mixins/MTransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\nimport \"../interfaces/ITransactions.sol\";\n\n\ncontract MTransactions is\n ITransactions\n{\n // Hash for the EIP712 ZeroEx Transaction Schema\n bytes32 constant internal EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"ZeroExTransaction(\",\n \"uint256 salt,\",\n \"address signerAddress,\",\n \"bytes data\",\n \")\"\n ));\n\n /// @dev Calculates EIP712 hash of the Transaction.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @return EIP712 hash of the Transaction.\n function hashZeroExTransaction(\n uint256 salt,\n address signerAddress,\n bytes memory data\n )\n internal\n pure\n returns (bytes32 result);\n\n /// @dev The current function will be called in the context of this address (either 0x transaction signer or `msg.sender`).\n /// If calling a fill function, this address will represent the taker.\n /// If calling a cancel function, this address will represent the maker.\n /// @return Signer of 0x transaction if entry point is `executeTransaction`.\n /// `msg.sender` if entry point is any other function.\n function getCurrentContextAddress()\n internal\n view\n returns (address);\n}\n",
- "2.0.0/protocol/Exchange/mixins/MWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IWrapperFunctions.sol\";\n\n\ncontract MWrapperFunctions is \n IWrapperFunctions\n{\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n}\n",
- "2.0.0/tokens/ERC20Token/IERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC20Token {\n\n // solhint-disable no-simple-event-func-name\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 _value\n );\n\n event Approval(\n address indexed _owner,\n address indexed _spender,\n uint256 _value\n );\n\n /// @dev send `value` token to `to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transfer(address _to, uint256 _value)\n external\n returns (bool);\n\n /// @dev send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool);\n \n /// @dev `msg.sender` approves `_spender` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Always true if the call has enough gas to complete execution\n function approve(address _spender, uint256 _value)\n external\n returns (bool);\n\n /// @dev Query total supply of token\n /// @return Total supply of token\n function totalSupply()\n external\n view\n returns (uint256);\n \n /// @param _owner The address from which the balance will be retrieved\n /// @return Balance of owner\n function balanceOf(address _owner)\n external\n view\n returns (uint256);\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender)\n external\n view\n returns (uint256);\n}\n",
- "2.0.0/tokens/ERC721Token/IERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC721Token {\n\n /// @dev This emits when ownership of any NFT changes by any mechanism.\n /// This event emits when NFTs are created (`from` == 0) and destroyed\n /// (`to` == 0). Exception: during contract creation, any number of NFTs\n /// may be created and assigned without emitting Transfer. At the time of\n /// any transfer, the approved address for that NFT (if any) is reset to none.\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 indexed _tokenId\n );\n\n /// @dev This emits when the approved address for an NFT is changed or\n /// reaffirmed. The zero address indicates there is no approved address.\n /// When a Transfer event emits, this also indicates that the approved\n /// address for that NFT (if any) is reset to none.\n event Approval(\n address indexed _owner,\n address indexed _approved,\n uint256 indexed _tokenId\n );\n\n /// @dev This emits when an operator is enabled or disabled for an owner.\n /// The operator can manage all NFTs of the owner.\n event ApprovalForAll(\n address indexed _owner,\n address indexed _operator,\n bool _approved\n );\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// perator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT. When transfer is complete, this function\n /// checks if `_to` is a smart contract (code size > 0). If so, it calls\n /// `onERC721Received` on `_to` and throws if the return value is not\n /// `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n /// @param _data Additional data with no specified format, sent in call to `_to`\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId,\n bytes _data\n )\n external;\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev This works identically to the other function with an extra data parameter,\n /// except this function just sets data to \"\".\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n external;\n\n /// @notice Change or reaffirm the approved address for an NFT\n /// @dev The zero address indicates there is no approved address.\n /// Throws unless `msg.sender` is the current NFT owner, or an authorized\n /// operator of the current owner.\n /// @param _approved The new approved NFT controller\n /// @param _tokenId The NFT to approve\n function approve(address _approved, uint256 _tokenId)\n external;\n\n /// @notice Enable or disable approval for a third party (\"operator\") to manage\n /// all of `msg.sender`'s assets\n /// @dev Emits the ApprovalForAll event. The contract MUST allow\n /// multiple operators per owner.\n /// @param _operator Address to add to the set of authorized operators\n /// @param _approved True if the operator is approved, false to revoke approval\n function setApprovalForAll(address _operator, bool _approved)\n external;\n\n /// @notice Count all NFTs assigned to an owner\n /// @dev NFTs assigned to the zero address are considered invalid, and this\n /// function throws for queries about the zero address.\n /// @param _owner An address for whom to query the balance\n /// @return The number of NFTs owned by `_owner`, possibly zero\n function balanceOf(address _owner)\n external\n view\n returns (uint256);\n\n /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE\n /// TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE\n /// THEY MAY BE PERMANENTLY LOST\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function transferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n public;\n\n /// @notice Find the owner of an NFT\n /// @dev NFTs assigned to zero address are considered invalid, and queries\n /// about them do throw.\n /// @param _tokenId The identifier for an NFT\n /// @return The address of the owner of the NFT\n function ownerOf(uint256 _tokenId)\n public\n view\n returns (address);\n\n /// @notice Get the approved address for a single NFT\n /// @dev Throws if `_tokenId` is not a valid NFT.\n /// @param _tokenId The NFT to find the approved address for\n /// @return The approved address for this NFT, or the zero address if there is none\n function getApproved(uint256 _tokenId) \n public\n view\n returns (address);\n \n /// @notice Query if an address is an authorized operator for another address\n /// @param _owner The address that owns the NFTs\n /// @param _operator The address that acts on behalf of the owner\n /// @return True if `_operator` is an approved operator for `_owner`, false otherwise\n function isApprovedForAll(address _owner, address _operator)\n public\n view\n returns (bool);\n}\n",
- "2.0.0/tokens/EtherToken/IEtherToken.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../ERC20Token/IERC20Token.sol\";\n\n\ncontract IEtherToken is\n IERC20Token\n{\n function deposit()\n public\n payable;\n \n function withdraw(uint256 amount)\n public;\n}\n",
- "2.0.0/utils/LibBytes/LibBytes.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\nlibrary LibBytes {\n\n using LibBytes for bytes;\n\n /// @dev Gets the memory address for a byte array.\n /// @param input Byte array to lookup.\n /// @return memoryAddress Memory address of byte array. This\n /// points to the header of the byte array which contains\n /// the length.\n function rawAddress(bytes memory input)\n internal\n pure\n returns (uint256 memoryAddress)\n {\n assembly {\n memoryAddress := input\n }\n return memoryAddress;\n }\n \n /// @dev Gets the memory address for the contents of a byte array.\n /// @param input Byte array to lookup.\n /// @return memoryAddress Memory address of the contents of the byte array.\n function contentAddress(bytes memory input)\n internal\n pure\n returns (uint256 memoryAddress)\n {\n assembly {\n memoryAddress := add(input, 32)\n }\n return memoryAddress;\n }\n\n /// @dev Copies `length` bytes from memory location `source` to `dest`.\n /// @param dest memory address to copy bytes to.\n /// @param source memory address to copy bytes from.\n /// @param length number of bytes to copy.\n function memCopy(\n uint256 dest,\n uint256 source,\n uint256 length\n )\n internal\n pure\n {\n if (length < 32) {\n // Handle a partial word by reading destination and masking\n // off the bits we are interested in.\n // This correctly handles overlap, zero lengths and source == dest\n assembly {\n let mask := sub(exp(256, sub(32, length)), 1)\n let s := and(mload(source), not(mask))\n let d := and(mload(dest), mask)\n mstore(dest, or(s, d))\n }\n } else {\n // Skip the O(length) loop when source == dest.\n if (source == dest) {\n return;\n }\n\n // For large copies we copy whole words at a time. The final\n // word is aligned to the end of the range (instead of after the\n // previous) to handle partial words. So a copy will look like this:\n //\n // ####\n // ####\n // ####\n // ####\n //\n // We handle overlap in the source and destination range by\n // changing the copying direction. This prevents us from\n // overwriting parts of source that we still need to copy.\n //\n // This correctly handles source == dest\n //\n if (source > dest) {\n assembly {\n // We subtract 32 from `sEnd` and `dEnd` because it\n // is easier to compare with in the loop, and these\n // are also the addresses we need for copying the\n // last bytes.\n length := sub(length, 32)\n let sEnd := add(source, length)\n let dEnd := add(dest, length)\n\n // Remember the last 32 bytes of source\n // This needs to be done here and not after the loop\n // because we may have overwritten the last bytes in\n // source already due to overlap.\n let last := mload(sEnd)\n\n // Copy whole words front to back\n // Note: the first check is always true,\n // this could have been a do-while loop.\n // solhint-disable-next-line no-empty-blocks\n for {} lt(source, sEnd) {} {\n mstore(dest, mload(source))\n source := add(source, 32)\n dest := add(dest, 32)\n }\n \n // Write the last 32 bytes\n mstore(dEnd, last)\n }\n } else {\n assembly {\n // We subtract 32 from `sEnd` and `dEnd` because those\n // are the starting points when copying a word at the end.\n length := sub(length, 32)\n let sEnd := add(source, length)\n let dEnd := add(dest, length)\n\n // Remember the first 32 bytes of source\n // This needs to be done here and not after the loop\n // because we may have overwritten the first bytes in\n // source already due to overlap.\n let first := mload(source)\n\n // Copy whole words back to front\n // We use a signed comparisson here to allow dEnd to become\n // negative (happens when source and dest < 32). Valid\n // addresses in local memory will never be larger than\n // 2**255, so they can be safely re-interpreted as signed.\n // Note: the first check is always true,\n // this could have been a do-while loop.\n // solhint-disable-next-line no-empty-blocks\n for {} slt(dest, dEnd) {} {\n mstore(dEnd, mload(sEnd))\n sEnd := sub(sEnd, 32)\n dEnd := sub(dEnd, 32)\n }\n \n // Write the first 32 bytes\n mstore(dest, first)\n }\n }\n }\n }\n\n /// @dev Returns a slices from a byte array.\n /// @param b The byte array to take a slice from.\n /// @param from The starting index for the slice (inclusive).\n /// @param to The final index for the slice (exclusive).\n /// @return result The slice containing bytes at indices [from, to)\n function slice(\n bytes memory b,\n uint256 from,\n uint256 to\n )\n internal\n pure\n returns (bytes memory result)\n {\n require(\n from <= to,\n \"FROM_LESS_THAN_TO_REQUIRED\"\n );\n require(\n to < b.length,\n \"TO_LESS_THAN_LENGTH_REQUIRED\"\n );\n \n // Create a new bytes structure and copy contents\n result = new bytes(to - from);\n memCopy(\n result.contentAddress(),\n b.contentAddress() + from,\n result.length\n );\n return result;\n }\n \n /// @dev Returns a slice from a byte array without preserving the input.\n /// @param b The byte array to take a slice from. Will be destroyed in the process.\n /// @param from The starting index for the slice (inclusive).\n /// @param to The final index for the slice (exclusive).\n /// @return result The slice containing bytes at indices [from, to)\n /// @dev When `from == 0`, the original array will match the slice. In other cases its state will be corrupted.\n function sliceDestructive(\n bytes memory b,\n uint256 from,\n uint256 to\n )\n internal\n pure\n returns (bytes memory result)\n {\n require(\n from <= to,\n \"FROM_LESS_THAN_TO_REQUIRED\"\n );\n require(\n to < b.length,\n \"TO_LESS_THAN_LENGTH_REQUIRED\"\n );\n \n // Create a new bytes structure around [from, to) in-place.\n assembly {\n result := add(b, from)\n mstore(result, sub(to, from))\n }\n return result;\n }\n\n /// @dev Pops the last byte off of a byte array by modifying its length.\n /// @param b Byte array that will be modified.\n /// @return The byte that was popped off.\n function popLastByte(bytes memory b)\n internal\n pure\n returns (bytes1 result)\n {\n require(\n b.length > 0,\n \"GREATER_THAN_ZERO_LENGTH_REQUIRED\"\n );\n\n // Store last byte.\n result = b[b.length - 1];\n\n assembly {\n // Decrement length of byte array.\n let newLen := sub(mload(b), 1)\n mstore(b, newLen)\n }\n return result;\n }\n\n /// @dev Pops the last 20 bytes off of a byte array by modifying its length.\n /// @param b Byte array that will be modified.\n /// @return The 20 byte address that was popped off.\n function popLast20Bytes(bytes memory b)\n internal\n pure\n returns (address result)\n {\n require(\n b.length >= 20,\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Store last 20 bytes.\n result = readAddress(b, b.length - 20);\n\n assembly {\n // Subtract 20 from byte array length.\n let newLen := sub(mload(b), 20)\n mstore(b, newLen)\n }\n return result;\n }\n\n /// @dev Tests equality of two byte arrays.\n /// @param lhs First byte array to compare.\n /// @param rhs Second byte array to compare.\n /// @return True if arrays are the same. False otherwise.\n function equals(\n bytes memory lhs,\n bytes memory rhs\n )\n internal\n pure\n returns (bool equal)\n {\n // Keccak gas cost is 30 + numWords * 6. This is a cheap way to compare.\n // We early exit on unequal lengths, but keccak would also correctly\n // handle this.\n return lhs.length == rhs.length && keccak256(lhs) == keccak256(rhs);\n }\n\n /// @dev Reads an address from a position in a byte array.\n /// @param b Byte array containing an address.\n /// @param index Index in byte array of address.\n /// @return address from byte array.\n function readAddress(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (address result)\n {\n require(\n b.length >= index + 20, // 20 is length of address\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Add offset to index:\n // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)\n // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)\n index += 20;\n\n // Read address from array memory\n assembly {\n // 1. Add index to address of bytes array\n // 2. Load 32-byte word from memory\n // 3. Apply 20-byte mask to obtain address\n result := and(mload(add(b, index)), 0xffffffffffffffffffffffffffffffffffffffff)\n }\n return result;\n }\n\n /// @dev Writes an address into a specific position in a byte array.\n /// @param b Byte array to insert address into.\n /// @param index Index in byte array of address.\n /// @param input Address to put into byte array.\n function writeAddress(\n bytes memory b,\n uint256 index,\n address input\n )\n internal\n pure\n {\n require(\n b.length >= index + 20, // 20 is length of address\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Add offset to index:\n // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)\n // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)\n index += 20;\n\n // Store address into array memory\n assembly {\n // The address occupies 20 bytes and mstore stores 32 bytes.\n // First fetch the 32-byte word where we'll be storing the address, then\n // apply a mask so we have only the bytes in the word that the address will not occupy.\n // Then combine these bytes with the address and store the 32 bytes back to memory with mstore.\n\n // 1. Add index to address of bytes array\n // 2. Load 32-byte word from memory\n // 3. Apply 12-byte mask to obtain extra bytes occupying word of memory where we'll store the address\n let neighbors := and(\n mload(add(b, index)),\n 0xffffffffffffffffffffffff0000000000000000000000000000000000000000\n )\n \n // Make sure input address is clean.\n // (Solidity does not guarantee this)\n input := and(input, 0xffffffffffffffffffffffffffffffffffffffff)\n\n // Store the neighbors and address into memory\n mstore(add(b, index), xor(input, neighbors))\n }\n }\n\n /// @dev Reads a bytes32 value from a position in a byte array.\n /// @param b Byte array containing a bytes32 value.\n /// @param index Index in byte array of bytes32 value.\n /// @return bytes32 value from byte array.\n function readBytes32(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes32 result)\n {\n require(\n b.length >= index + 32,\n \"GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 256 bit length parameter\n index += 32;\n\n // Read the bytes32 from array memory\n assembly {\n result := mload(add(b, index))\n }\n return result;\n }\n\n /// @dev Writes a bytes32 into a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input bytes32 to put into byte array.\n function writeBytes32(\n bytes memory b,\n uint256 index,\n bytes32 input\n )\n internal\n pure\n {\n require(\n b.length >= index + 32,\n \"GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 256 bit length parameter\n index += 32;\n\n // Read the bytes32 from array memory\n assembly {\n mstore(add(b, index), input)\n }\n }\n\n /// @dev Reads a uint256 value from a position in a byte array.\n /// @param b Byte array containing a uint256 value.\n /// @param index Index in byte array of uint256 value.\n /// @return uint256 value from byte array.\n function readUint256(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (uint256 result)\n {\n result = uint256(readBytes32(b, index));\n return result;\n }\n\n /// @dev Writes a uint256 into a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input uint256 to put into byte array.\n function writeUint256(\n bytes memory b,\n uint256 index,\n uint256 input\n )\n internal\n pure\n {\n writeBytes32(b, index, bytes32(input));\n }\n\n /// @dev Reads an unpadded bytes4 value from a position in a byte array.\n /// @param b Byte array containing a bytes4 value.\n /// @param index Index in byte array of bytes4 value.\n /// @return bytes4 value from byte array.\n function readBytes4(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes4 result)\n {\n require(\n b.length >= index + 4,\n \"GREATER_OR_EQUAL_TO_4_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 32 byte length field\n index += 32;\n\n // Read the bytes4 from array memory\n assembly {\n result := mload(add(b, index))\n // Solidity does not require us to clean the trailing bytes.\n // We do it anyway\n result := and(result, 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000)\n }\n return result;\n }\n\n /// @dev Reads nested bytes from a specific position.\n /// @dev NOTE: the returned value overlaps with the input value.\n /// Both should be treated as immutable.\n /// @param b Byte array containing nested bytes.\n /// @param index Index of nested bytes.\n /// @return result Nested bytes.\n function readBytesWithLength(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes memory result)\n {\n // Read length of nested bytes\n uint256 nestedBytesLength = readUint256(b, index);\n index += 32;\n\n // Assert length of <b> is valid, given\n // length of nested bytes\n require(\n b.length >= index + nestedBytesLength,\n \"GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED\"\n );\n \n // Return a pointer to the byte array as it exists inside `b`\n assembly {\n result := add(b, index)\n }\n return result;\n }\n\n /// @dev Inserts bytes at a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input bytes to insert.\n function writeBytesWithLength(\n bytes memory b,\n uint256 index,\n bytes memory input\n )\n internal\n pure\n {\n // Assert length of <b> is valid, given\n // length of input\n require(\n b.length >= index + 32 + input.length, // 32 bytes to store length\n \"GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED\"\n );\n\n // Copy <input> into <b>\n memCopy(\n b.contentAddress() + index,\n input.rawAddress(), // includes length of <input>\n input.length + 32 // +32 bytes to store <input> length\n );\n }\n\n /// @dev Performs a deep copy of a byte array onto another byte array of greater than or equal length.\n /// @param dest Byte array that will be overwritten with source bytes.\n /// @param source Byte array to copy onto dest bytes.\n function deepCopyBytes(\n bytes memory dest,\n bytes memory source\n )\n internal\n pure\n {\n uint256 sourceLen = source.length;\n // Dest length must be >= source length, or some bytes would not be copied.\n require(\n dest.length >= sourceLen,\n \"GREATER_OR_EQUAL_TO_SOURCE_BYTES_LENGTH_REQUIRED\"\n );\n memCopy(\n dest.contentAddress(),\n source.contentAddress(),\n sourceLen\n );\n }\n}\n",
- "2.0.0/utils/Ownable/IOwnable.sol": "pragma solidity 0.4.24;\n\n\ncontract IOwnable {\n\n function transferOwnership(address newOwner)\n public;\n}\n",
- "2.0.0/utils/Ownable/Ownable.sol": "pragma solidity 0.4.24;\n\nimport \"./IOwnable.sol\";\n\n\ncontract Ownable is\n IOwnable\n{\n address public owner;\n\n constructor ()\n public\n {\n owner = msg.sender;\n }\n\n modifier onlyOwner() {\n require(\n msg.sender == owner,\n \"ONLY_CONTRACT_OWNER\"\n );\n _;\n }\n\n function transferOwnership(address newOwner)\n public\n onlyOwner\n {\n if (newOwner != address(0)) {\n owner = newOwner;\n }\n }\n}\n",
- "2.0.0/utils/ReentrancyGuard/ReentrancyGuard.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract ReentrancyGuard {\n\n // Locked state of mutex\n bool private locked = false;\n\n /// @dev Functions with this modifer cannot be reentered. The mutex will be locked\n /// before function execution and unlocked after.\n modifier nonReentrant() {\n // Ensure mutex is unlocked\n require(\n !locked,\n \"REENTRANCY_ILLEGAL\"\n );\n\n // Lock mutex before function call\n locked = true;\n\n // Perform function call\n _;\n\n // Unlock mutex after function call\n locked = false;\n }\n}\n",
- "2.0.0/utils/SafeMath/SafeMath.sol": "pragma solidity 0.4.24;\n\n\ncontract SafeMath {\n\n function safeMul(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n if (a == 0) {\n return 0;\n }\n uint256 c = a * b;\n require(\n c / a == b,\n \"UINT256_OVERFLOW\"\n );\n return c;\n }\n\n function safeDiv(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n uint256 c = a / b;\n return c;\n }\n\n function safeSub(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n require(\n b <= a,\n \"UINT256_UNDERFLOW\"\n );\n return a - b;\n }\n\n function safeAdd(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n uint256 c = a + b;\n require(\n c >= a,\n \"UINT256_OVERFLOW\"\n );\n return c;\n }\n\n function max64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n\n function max256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n}\n"
- },
- "sourceTreeHashHex": "0xd4b411ae8c566bfc879b9880fcf5306a0b0b7051368f0c84ad27da6b5a6f0637",
- "compiler": {
- "name": "solc",
- "version": "soljson-v0.4.24+commit.e67f0147.js",
- "settings": {
- "optimizer": {
- "enabled": true,
- "runs": 1000000
- },
- "outputSelection": {
- "*": {
- "*": [
- "abi",
- "evm.bytecode.object",
- "evm.bytecode.sourceMap",
- "evm.deployedBytecode.object",
- "evm.deployedBytecode.sourceMap"
- ]
- }
- }
- }
- },
- "networks": {
- "1": {
- "address": "0x4f833a24e1f95d70f028921e27040ca56e09ab0b",
- "links": {},
- "constructorArgs": "[]"
- },
- "3": {
- "address": "0x4530c0483a1633c7a1c97d2c53721caff2caaaaf",
- "links": {},
- "constructorArgs": "[\"0xf47261b0000000000000000000000000ff67881f8d12f372d91baae9752eb3631ff0ed00\"]"
- },
- "42": {
- "address": "0x35dd2932454449b14cee11a94d3674a936d5d7b2",
- "links": {},
- "constructorArgs": "[\"0xf47261b00000000000000000000000002002d3812f58e35f0ea1ffbf80a75a38c32175fa\"]"
- },
- "50": {
- "address": "0x48bacb9266a570d521063ef5dd96e61686dbe788",
- "links": {},
- "constructorArgs": "[\"0xf47261b0000000000000000000000000871dd7c2b4b25e1aa18728e9d5f2af4c4e431f5c\"]"
- }
- }
-}
diff --git a/packages/migrations/artifacts/2.0.0/Forwarder.json b/packages/migrations/artifacts/2.0.0/Forwarder.json
deleted file mode 100644
index 3879837e5..000000000
--- a/packages/migrations/artifacts/2.0.0/Forwarder.json
+++ /dev/null
@@ -1,734 +0,0 @@
-{
- "schemaVersion": "2.0.0",
- "contractName": "Forwarder",
- "compilerOutput": {
- "abi": [
- {
- "constant": false,
- "inputs": [
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "orders",
- "type": "tuple[]"
- },
- {
- "name": "makerAssetFillAmount",
- "type": "uint256"
- },
- {
- "name": "signatures",
- "type": "bytes[]"
- },
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "feeOrders",
- "type": "tuple[]"
- },
- {
- "name": "feeSignatures",
- "type": "bytes[]"
- },
- {
- "name": "feePercentage",
- "type": "uint256"
- },
- {
- "name": "feeRecipient",
- "type": "address"
- }
- ],
- "name": "marketBuyOrdersWithEth",
- "outputs": [
- {
- "components": [
- {
- "name": "makerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "makerFeePaid",
- "type": "uint256"
- },
- {
- "name": "takerFeePaid",
- "type": "uint256"
- }
- ],
- "name": "orderFillResults",
- "type": "tuple"
- },
- {
- "components": [
- {
- "name": "makerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "makerFeePaid",
- "type": "uint256"
- },
- {
- "name": "takerFeePaid",
- "type": "uint256"
- }
- ],
- "name": "feeOrderFillResults",
- "type": "tuple"
- }
- ],
- "payable": true,
- "stateMutability": "payable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "assetData",
- "type": "bytes"
- },
- {
- "name": "amount",
- "type": "uint256"
- }
- ],
- "name": "withdrawAsset",
- "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": [
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "orders",
- "type": "tuple[]"
- },
- {
- "name": "signatures",
- "type": "bytes[]"
- },
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "feeOrders",
- "type": "tuple[]"
- },
- {
- "name": "feeSignatures",
- "type": "bytes[]"
- },
- {
- "name": "feePercentage",
- "type": "uint256"
- },
- {
- "name": "feeRecipient",
- "type": "address"
- }
- ],
- "name": "marketSellOrdersWithEth",
- "outputs": [
- {
- "components": [
- {
- "name": "makerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "makerFeePaid",
- "type": "uint256"
- },
- {
- "name": "takerFeePaid",
- "type": "uint256"
- }
- ],
- "name": "orderFillResults",
- "type": "tuple"
- },
- {
- "components": [
- {
- "name": "makerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetFilledAmount",
- "type": "uint256"
- },
- {
- "name": "makerFeePaid",
- "type": "uint256"
- },
- {
- "name": "takerFeePaid",
- "type": "uint256"
- }
- ],
- "name": "feeOrderFillResults",
- "type": "tuple"
- }
- ],
- "payable": true,
- "stateMutability": "payable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "newOwner",
- "type": "address"
- }
- ],
- "name": "transferOwnership",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "inputs": [
- {
- "name": "_exchange",
- "type": "address"
- },
- {
- "name": "_zrxAssetData",
- "type": "bytes"
- },
- {
- "name": "_wethAssetData",
- "type": "bytes"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "constructor"
- },
- {
- "payable": true,
- "stateMutability": "payable",
- "type": "fallback"
- }
- ],
- "evm": {
- "bytecode": {
- "linkReferences": {},
- "object": "0x60806040523480156200001157600080fd5b5060405162002cdb38038062002cdb83398101806040526200003791908101906200051d565b6000805433600160a060020a031991821617825560018054909116600160a060020a0386161790558251849084908490849081906200007e906004906020870190620003d0565b50825162000094906005906020860190620003d0565b50620000b0836010640100000000620018f66200036f82021704565b9150620000cd846010640100000000620018f66200036f82021704565b60028054600160a060020a03948516600160a060020a031991821617909155600380549285169290911691909117905550600154604080517f4552433230546f6b656e28616464726573732900000000000000000000000000815290519081900360130181207f6070410800000000000000000000000000000000000000000000000000000000825291909216945063607041089350620001739250906004016200068e565b602060405180830381600087803b1580156200018e57600080fd5b505af1158015620001a3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250620001c99190810190620004f4565b9050600160a060020a038116151562000219576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200021090620006b0565b60405180910390fd5b6002546040517f095ea7b3000000000000000000000000000000000000000000000000000000008152600160a060020a039091169063095ea7b39062000268908490600019906004016200066f565b602060405180830381600087803b1580156200028357600080fd5b505af115801562000298573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250620002be9190810190620005a1565b506003546040517f095ea7b3000000000000000000000000000000000000000000000000000000008152600160a060020a039091169063095ea7b3906200030e908490600019906004016200066f565b602060405180830381600087803b1580156200032957600080fd5b505af11580156200033e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250620003649190810190620005a1565b50505050506200077a565b600081601401835110151515620003b4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040162000210906200069e565b506014818301810151910190600160a060020a03165b92915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200041357805160ff191683800117855562000443565b8280016001018555821562000443579182015b828111156200044357825182559160200191906001019062000426565b506200045192915062000455565b5090565b6200047291905b808211156200045157600081556001016200045c565b90565b600062000483825162000711565b9392505050565b600062000483825162000742565b6000601f82018313620004aa57600080fd5b8151620004c1620004bb82620006e9565b620006c2565b91508082526020830160208301858383011115620004de57600080fd5b620004eb83828462000747565b50505092915050565b6000602082840312156200050757600080fd5b600062000515848462000475565b949350505050565b6000806000606084860312156200053357600080fd5b600062000541868662000475565b93505060208401516001604060020a038111156200055e57600080fd5b6200056c8682870162000498565b92505060408401516001604060020a038111156200058957600080fd5b620005978682870162000498565b9150509250925092565b600060208284031215620005b457600080fd5b60006200051584846200048a565b620005cd8162000711565b82525050565b620005cd816200071d565b602681527f475245415445525f4f525f455155414c5f544f5f32305f4c454e4754485f524560208201527f5155495245440000000000000000000000000000000000000000000000000000604082015260600190565b601881527f554e524547495354455245445f41535345545f50524f58590000000000000000602082015260400190565b620005cd8162000472565b604081016200067f8285620005c2565b62000483602083018462000664565b60208101620003ca8284620005d3565b60208082528101620003ca81620005de565b60208082528101620003ca8162000634565b6040518181016001604060020a0381118282101715620006e157600080fd5b604052919050565b60006001604060020a038211156200070057600080fd5b506020601f91909101601f19160190565b600160a060020a031690565b7fffffffff000000000000000000000000000000000000000000000000000000001690565b151590565b60005b83811015620007645781810151838201526020016200074a565b8381111562000774576000848401525b50505050565b612551806200078a6000396000f30060806040526004361061006c5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166318978e8281146100c8578063630f1e6c146100f25780638da5cb5b146101125780639395525c14610134578063f2fde38b14610147575b60025473ffffffffffffffffffffffffffffffffffffffff1633146100c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612337565b60405180910390fd5b005b6100db6100d6366004611da0565b610167565b6040516100e9929190612437565b60405180910390f35b3480156100fe57600080fd5b506100c661010d366004611e9b565b6102f7565b34801561011e57600080fd5b50610127610388565b6040516100e991906122e6565b6100db610142366004611cba565b6103a4565b34801561015357600080fd5b506100c6610162366004611c94565b61050a565b61016f6119a9565b6101776119a9565b6000806101826105bb565b60048054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610100600188161502019095169490940493840181900481028201810190925282815261025c939092909183018282801561022d5780601f106102025761010080835404028352916020019161022d565b820191906000526020600020905b81548152906001019060200180831161021057829003601f168201915b50505050508c600081518110151561024157fe5b6020908102909101015161014001519063ffffffff61069616565b156102875761026c8b8b8b6107c3565b935061028084600001518560600151610acb565b90506102ae565b6102928b8b8b610b0d565b9350836060015191506102a68883896107c3565b845190935090505b6102c2846020015184602001518888610d1f565b6102e98b60008151811015156102d457fe5b90602001906020020151610140015182610f33565b505097509795505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610348576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123e7565b61038383838080601f01602080910402602001604051908101604052809392919081815260200183838082843750879450610f339350505050565b505050565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b6103ac6119a9565b6103b46119a9565b60008060006103c16105bb565b60048054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101006001881615020190951694909404938401819004810282018101909252828152610441939092909183018282801561022d5780601f106102025761010080835404028352916020019161022d565b156104925761046a670de0b6b3a7640000610464670de0b6b3a76400008a61104f565b34611099565b92506104778b848c6110f1565b945061048b85600001518660600151610acb565b90506104d6565b6104ad670d2f13f7789f0000670de0b6b3a764000034611099565b92506104ba8b848c6110f1565b9450846060015191506104ce89838a6107c3565b855190945090505b6104ea856020015185602001518989610d1f565b6104fc8b60008151811015156102d457fe5b505050965096945050505050565b60005473ffffffffffffffffffffffffffffffffffffffff16331461055b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123e7565b73ffffffffffffffffffffffffffffffffffffffff8116156105b857600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83161790555b50565b600034116105f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612347565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0e30db0346040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004016000604051808303818588803b15801561067b57600080fd5b505af115801561068f573d6000803e3d6000fd5b5050505050565b6000815183511480156107ba5750816040518082805190602001908083835b602083106106f257805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016106b5565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0180199092169116179052604051919093018190038120885190955088945090928392508401908083835b6020831061078757805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161074a565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060001916145b90505b92915050565b6107cb6119a9565b60608060008060008060006107de6119a9565b8a15156107ea57610abc565b6004805460408051602060026001851615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f8101849004840282018401909252818152929183018282801561088e5780601f106108635761010080835404028352916020019161088e565b820191906000526020600020905b81548152906001019060200180831161087157829003601f168201915b505060058054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101006001881615020190951694909404938401819004810282018101909252828152969e509194509250840190508282801561093d5780601f106109125761010080835404028352916020019161093d565b820191906000526020600020905b81548152906001019060200180831161092057829003601f168201915b50505050509650600095508b519450600093505b838514610a8257878c8581518110151561096757fe5b6020908102909101015161014001528b5187908d908690811061098657fe5b60209081029091010151610160015261099f8b87610acb565b9250610a068c858151811015156109b257fe5b9060200190602002015160a00151610a008e878151811015156109d157fe5b90602001906020020151608001518f888151811015156109ed57fe5b9060200190602002015160e00151610acb565b85611099565b9150610a4b8c85815181101515610a1957fe5b90602001906020020151610a2e84600161104f565b8c87815181101515610a3c57fe5b90602001906020020151611295565b9050610a57898261130d565b610a6989600001518a60600151610acb565b95508a8610610a7757610a82565b600190930192610951565b8a861015610abc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123c7565b50505050505050509392505050565b600082821115610b07576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612367565b50900390565b610b156119a9565b606080600080600080610b266119a9565b60008b6000815181101515610b3757fe5b6020908102919091018101516101400151600580546040805160026001841615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190931692909204601f8101869004860283018601909152808252929b5092909190830182828015610bef5780601f10610bc457610100808354040283529160200191610bef565b820191906000526020600020905b815481529060010190602001808311610bd257829003601f168201915b505050505096508b519550600094505b848614610ce557878c86815181101515610c1557fe5b6020908102909101015161014001528b5187908d9087908110610c3457fe5b6020908102909101015161016001528851610c50908c90610acb565b9350610c938c86815181101515610c6357fe5b9060200190602002015160a001518d87815181101515610c7f57fe5b906020019060200201516080015186611099565b9250610cbf8c86815181101515610ca657fe5b90602001906020020151848c88815181101515610a3c57fe5b9150610ccb898361130d565b5087518a8110610cda57610ce5565b600190940193610bff565b8a811015610abc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123c7565b600080808066b1a2bc2ec50000861115610d65576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123f7565b610d6f888861104f565b935034841115610dab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612357565b610db53485610acb565b9250610dca86670de0b6b3a76400008a611099565b915082821115610e06576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123d7565b6000831115610f29576002546040517f2e1a7d4d00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911690632e1a7d4d90610e65908690600401612453565b600060405180830381600087803b158015610e7f57600080fd5b505af1158015610e93573d6000803e3d6000fd5b505050506000821115610ee55760405173ffffffffffffffffffffffffffffffffffffffff86169083156108fc029084906000818181858888f19350505050158015610ee3573d6000803e3d6000fd5b505b610eef8383610acb565b90506000811115610f2957604051339082156108fc029083906000818181858888f19350505050158015610f27573d6000803e3d6000fd5b505b5050505050505050565b6000610f45838263ffffffff61136f16565b604080517f4552433230546f6b656e28616464726573732900000000000000000000000000815290519081900360130190209091507fffffffff0000000000000000000000000000000000000000000000000000000080831691161415610fb557610fb083836113dc565b610383565b604080517f455243373231546f6b656e28616464726573732c75696e7432353629000000008152905190819003601c0190207fffffffff000000000000000000000000000000000000000000000000000000008281169116141561101d57610fb083836115ca565b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123a7565b60008282018381101561108e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612397565b8091505b5092915050565b60008083116110d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612387565b6110e76110e185846116b2565b8461170d565b90505b9392505050565b6110f96119a9565b60608060008060006111096119a9565b89600081518110151561111857fe5b6020908102919091018101516101400151600580546040805160026001841615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190931692909204601f8101869004860283018601909152808252929950929091908301828280156111d05780601f106111a5576101008083540402835291602001916111d0565b820191906000526020600020905b8154815290600101906020018083116111b357829003601f168201915b5050505050945089519350600092505b82841461128857858a848151811015156111f657fe5b602090810290910101516101400152895185908b908590811061121557fe5b906020019060200201516101600181905250611235898860200151610acb565b91506112618a8481518110151561124857fe5b90602001906020020151838a86815181101515610a3c57fe5b905061126d878261130d565b6020870151891161127d57611288565b6001909201916111e0565b5050505050509392505050565b61129d6119a9565b606060006112ac868686611724565b600154815191935073ffffffffffffffffffffffffffffffffffffffff1691506080908390602082016000855af1801561130357825184526020830151602085015260408301516040850152606083015160608501525b5050509392505050565b8151815161131b919061104f565b825260208083015190820151611331919061104f565b60208301526040808301519082015161134a919061104f565b604083015260608083015190820151611363919061104f565b60609092019190915250565b6000816004018351101515156113b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612417565b5001602001517fffffffff000000000000000000000000000000000000000000000000000000001690565b6000806113f084601063ffffffff6118f616565b604080517f7472616e7366657228616464726573732c75696e7432353629000000000000008152905190819003601901812091935073ffffffffffffffffffffffffffffffffffffffff8416919061144e903390879060240161231c565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009094169390931783525181519192909182919080838360005b838110156114f25781810151838201526020016114da565b50505050905090810190601f16801561151f5780820380516001836020036101000a031916815260200191505b509150506000604051808303816000865af19250505080151561156e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123b7565b3d1561158b575060003d6020141561158b5760206000803e506000515b8015156115c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123b7565b50505050565b60008060018314611607576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612427565b61161884601063ffffffff6118f616565b915061162b84602463ffffffff61195716565b6040517f23b872dd00000000000000000000000000000000000000000000000000000000815290915073ffffffffffffffffffffffffffffffffffffffff8316906323b872dd90611684903090339086906004016122f4565b600060405180830381600087803b15801561169e57600080fd5b505af1158015610f29573d6000803e3d6000fd5b6000808315156116c55760009150611092565b508282028284828115156116d557fe5b041461108e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612397565b600080828481151561171b57fe5b04949350505050565b604080517fb4be83d5000000000000000000000000000000000000000000000000000000006020808301919091526060602483018181528751608485019081528884015160a48601529488015160c48501529087015160e4840152608087015161010484015260a087015161012484015260c087015161014484015260e08701516101648401526101008701516101848401526101208701516101a4840152610140870180516101c485019081526101608901516101e4860152610180905251805161020485018190529394919384936044870192849261022489019291820191601f82010460005b8181101561182b57835185526020948501949093019260010161180d565b50505050818103610160808401919091528a0151805180835260209283019291820191601f82010460005b81811015611874578351855260209485019490930192600101611856565b50505089845250848103602093840190815288518083529093918201918981019190601f82010460005b818110156118bc57835185526020948501949093019260010161189e565b5050507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08883030188525060405250505050509392505050565b600081601401835110151515611938576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612407565b50016014015173ffffffffffffffffffffffffffffffffffffffff1690565b60006107ba83836000816020018351101515156119a0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612377565b50016020015190565b608060405190810160405280600081526020016000815260200160008152602001600081525090565b60006107ba82356124ef565b6000601f820183136119ef57600080fd5b8135611a026119fd82612488565b612461565b81815260209384019390925082018360005b83811015611a405781358601611a2a8882611af0565b8452506020928301929190910190600101611a14565b5050505092915050565b6000601f82018313611a5b57600080fd5b8135611a696119fd82612488565b81815260209384019390925082018360005b83811015611a405781358601611a918882611b3f565b8452506020928301929190910190600101611a7b565b600080601f83018413611ab957600080fd5b50813567ffffffffffffffff811115611ad157600080fd5b602083019150836001820283011115611ae957600080fd5b9250929050565b6000601f82018313611b0157600080fd5b8135611b0f6119fd826124a9565b91508082526020830160208301858383011115611b2b57600080fd5b611b3683828461250b565b50505092915050565b60006101808284031215611b5257600080fd5b611b5d610180612461565b90506000611b6b84846119d2565b8252506020611b7c848483016119d2565b6020830152506040611b90848285016119d2565b6040830152506060611ba4848285016119d2565b6060830152506080611bb884828501611c88565b60808301525060a0611bcc84828501611c88565b60a08301525060c0611be084828501611c88565b60c08301525060e0611bf484828501611c88565b60e083015250610100611c0984828501611c88565b61010083015250610120611c1f84828501611c88565b6101208301525061014082013567ffffffffffffffff811115611c4157600080fd5b611c4d84828501611af0565b6101408301525061016082013567ffffffffffffffff811115611c6f57600080fd5b611c7b84828501611af0565b6101608301525092915050565b60006107ba8235612508565b600060208284031215611ca657600080fd5b6000611cb284846119d2565b949350505050565b60008060008060008060c08789031215611cd357600080fd5b863567ffffffffffffffff811115611cea57600080fd5b611cf689828a01611a4a565b965050602087013567ffffffffffffffff811115611d1357600080fd5b611d1f89828a016119de565b955050604087013567ffffffffffffffff811115611d3c57600080fd5b611d4889828a01611a4a565b945050606087013567ffffffffffffffff811115611d6557600080fd5b611d7189828a016119de565b9350506080611d8289828a01611c88565b92505060a0611d9389828a016119d2565b9150509295509295509295565b600080600080600080600060e0888a031215611dbb57600080fd5b873567ffffffffffffffff811115611dd257600080fd5b611dde8a828b01611a4a565b9750506020611def8a828b01611c88565b965050604088013567ffffffffffffffff811115611e0c57600080fd5b611e188a828b016119de565b955050606088013567ffffffffffffffff811115611e3557600080fd5b611e418a828b01611a4a565b945050608088013567ffffffffffffffff811115611e5e57600080fd5b611e6a8a828b016119de565b93505060a0611e7b8a828b01611c88565b92505060c0611e8c8a828b016119d2565b91505092959891949750929550565b600080600060408486031215611eb057600080fd5b833567ffffffffffffffff811115611ec757600080fd5b611ed386828701611aa7565b93509350506020611ee686828701611c88565b9150509250925092565b611ef9816124ef565b82525050565b602381527f44454641554c545f46554e4354494f4e5f574554485f434f4e54524143545f4f60208201527f4e4c590000000000000000000000000000000000000000000000000000000000604082015260600190565b601181527f494e56414c49445f4d53475f56414c5545000000000000000000000000000000602082015260400190565b600d81527f4f564552534f4c445f5745544800000000000000000000000000000000000000602082015260400190565b601181527f55494e543235365f554e444552464c4f57000000000000000000000000000000602082015260400190565b602681527f475245415445525f4f525f455155414c5f544f5f33325f4c454e4754485f524560208201527f5155495245440000000000000000000000000000000000000000000000000000604082015260600190565b601081527f4449564953494f4e5f42595f5a45524f00000000000000000000000000000000602082015260400190565b601081527f55494e543235365f4f564552464c4f5700000000000000000000000000000000602082015260400190565b601781527f554e535550504f525445445f41535345545f50524f5859000000000000000000602082015260400190565b600f81527f5452414e534645525f4641494c45440000000000000000000000000000000000602082015260400190565b601481527f434f4d504c4554455f46494c4c5f4641494c4544000000000000000000000000602082015260400190565b601a81527f494e53554646494349454e545f4554485f52454d41494e494e47000000000000602082015260400190565b601381527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000602082015260400190565b601881527f4645455f50455243454e544147455f544f4f5f4c415247450000000000000000602082015260400190565b602681527f475245415445525f4f525f455155414c5f544f5f32305f4c454e4754485f524560208201527f5155495245440000000000000000000000000000000000000000000000000000604082015260600190565b602581527f475245415445525f4f525f455155414c5f544f5f345f4c454e4754485f52455160208201527f5549524544000000000000000000000000000000000000000000000000000000604082015260600190565b600e81527f494e56414c49445f414d4f554e54000000000000000000000000000000000000602082015260400190565b805160808301906122a884826122dd565b5060208201516122bb60208501826122dd565b5060408201516122ce60408501826122dd565b5060608201516115c460608501825b611ef981612508565b602081016107bd8284611ef0565b606081016123028286611ef0565b61230f6020830185611ef0565b611cb260408301846122dd565b6040810161232a8285611ef0565b6110ea60208301846122dd565b602080825281016107bd81611eff565b602080825281016107bd81611f55565b602080825281016107bd81611f85565b602080825281016107bd81611fb5565b602080825281016107bd81611fe5565b602080825281016107bd8161203b565b602080825281016107bd8161206b565b602080825281016107bd8161209b565b602080825281016107bd816120cb565b602080825281016107bd816120fb565b602080825281016107bd8161212b565b602080825281016107bd8161215b565b602080825281016107bd8161218b565b602080825281016107bd816121bb565b602080825281016107bd81612211565b602080825281016107bd81612267565b61010081016124468285612297565b6110ea6080830184612297565b602081016107bd82846122dd565b60405181810167ffffffffffffffff8111828210171561248057600080fd5b604052919050565b600067ffffffffffffffff82111561249f57600080fd5b5060209081020190565b600067ffffffffffffffff8211156124c057600080fd5b506020601f919091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0160190565b73ffffffffffffffffffffffffffffffffffffffff1690565b90565b828183375060009101525600a265627a7a72305820185af4a5e8525b0c20983bf22c09773a1cab3f704716cba4c8da3b112601cd666c6578706572696d656e74616cf50037",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH3 0x11 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x40 MLOAD PUSH3 0x2CDB CODESIZE SUB DUP1 PUSH3 0x2CDB DUP4 CODECOPY DUP2 ADD DUP1 PUSH1 0x40 MSTORE PUSH3 0x37 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH3 0x51D JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD CALLER PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB NOT SWAP2 DUP3 AND OR DUP3 SSTORE PUSH1 0x1 DUP1 SLOAD SWAP1 SWAP2 AND PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB DUP7 AND OR SWAP1 SSTORE DUP3 MLOAD DUP5 SWAP1 DUP5 SWAP1 DUP5 SWAP1 DUP5 SWAP1 DUP2 SWAP1 PUSH3 0x7E SWAP1 PUSH1 0x4 SWAP1 PUSH1 0x20 DUP8 ADD SWAP1 PUSH3 0x3D0 JUMP JUMPDEST POP DUP3 MLOAD PUSH3 0x94 SWAP1 PUSH1 0x5 SWAP1 PUSH1 0x20 DUP7 ADD SWAP1 PUSH3 0x3D0 JUMP JUMPDEST POP PUSH3 0xB0 DUP4 PUSH1 0x10 PUSH5 0x100000000 PUSH3 0x18F6 PUSH3 0x36F DUP3 MUL OR DIV JUMP JUMPDEST SWAP2 POP PUSH3 0xCD DUP5 PUSH1 0x10 PUSH5 0x100000000 PUSH3 0x18F6 PUSH3 0x36F DUP3 MUL OR DIV JUMP JUMPDEST PUSH1 0x2 DUP1 SLOAD PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB SWAP5 DUP6 AND PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB NOT SWAP2 DUP3 AND OR SWAP1 SWAP2 SSTORE PUSH1 0x3 DUP1 SLOAD SWAP3 DUP6 AND SWAP3 SWAP1 SWAP2 AND SWAP2 SWAP1 SWAP2 OR SWAP1 SSTORE POP PUSH1 0x1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH32 0x4552433230546F6B656E28616464726573732900000000000000000000000000 DUP2 MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x13 ADD DUP2 KECCAK256 PUSH32 0x6070410800000000000000000000000000000000000000000000000000000000 DUP3 MSTORE SWAP2 SWAP1 SWAP3 AND SWAP5 POP PUSH4 0x60704108 SWAP4 POP PUSH3 0x173 SWAP3 POP SWAP1 PUSH1 0x4 ADD PUSH3 0x68E JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH3 0x18E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH3 0x1A3 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP PUSH3 0x1C9 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH3 0x4F4 JUMP JUMPDEST SWAP1 POP PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB DUP2 AND ISZERO ISZERO PUSH3 0x219 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH3 0x210 SWAP1 PUSH3 0x6B0 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x2 SLOAD PUSH1 0x40 MLOAD PUSH32 0x95EA7B300000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB SWAP1 SWAP2 AND SWAP1 PUSH4 0x95EA7B3 SWAP1 PUSH3 0x268 SWAP1 DUP5 SWAP1 PUSH1 0x0 NOT SWAP1 PUSH1 0x4 ADD PUSH3 0x66F JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH3 0x283 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH3 0x298 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP PUSH3 0x2BE SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH3 0x5A1 JUMP JUMPDEST POP PUSH1 0x3 SLOAD PUSH1 0x40 MLOAD PUSH32 0x95EA7B300000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB SWAP1 SWAP2 AND SWAP1 PUSH4 0x95EA7B3 SWAP1 PUSH3 0x30E SWAP1 DUP5 SWAP1 PUSH1 0x0 NOT SWAP1 PUSH1 0x4 ADD PUSH3 0x66F JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH3 0x329 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH3 0x33E JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP PUSH3 0x364 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH3 0x5A1 JUMP JUMPDEST POP POP POP POP POP PUSH3 0x77A JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x14 ADD DUP4 MLOAD LT ISZERO ISZERO ISZERO PUSH3 0x3B4 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH3 0x210 SWAP1 PUSH3 0x69E JUMP JUMPDEST POP PUSH1 0x14 DUP2 DUP4 ADD DUP2 ADD MLOAD SWAP2 ADD SWAP1 PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB AND JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 PUSH1 0x1F ADD PUSH1 0x20 SWAP1 DIV DUP2 ADD SWAP3 DUP3 PUSH1 0x1F LT PUSH3 0x413 JUMPI DUP1 MLOAD PUSH1 0xFF NOT AND DUP4 DUP1 ADD OR DUP6 SSTORE PUSH3 0x443 JUMP JUMPDEST DUP3 DUP1 ADD PUSH1 0x1 ADD DUP6 SSTORE DUP3 ISZERO PUSH3 0x443 JUMPI SWAP2 DUP3 ADD JUMPDEST DUP3 DUP2 GT ISZERO PUSH3 0x443 JUMPI DUP3 MLOAD DUP3 SSTORE SWAP2 PUSH1 0x20 ADD SWAP2 SWAP1 PUSH1 0x1 ADD SWAP1 PUSH3 0x426 JUMP JUMPDEST POP PUSH3 0x451 SWAP3 SWAP2 POP PUSH3 0x455 JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST PUSH3 0x472 SWAP2 SWAP1 JUMPDEST DUP1 DUP3 GT ISZERO PUSH3 0x451 JUMPI PUSH1 0x0 DUP2 SSTORE PUSH1 0x1 ADD PUSH3 0x45C JUMP JUMPDEST SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH3 0x483 DUP3 MLOAD PUSH3 0x711 JUMP JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH3 0x483 DUP3 MLOAD PUSH3 0x742 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH3 0x4AA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 MLOAD PUSH3 0x4C1 PUSH3 0x4BB DUP3 PUSH3 0x6E9 JUMP JUMPDEST PUSH3 0x6C2 JUMP JUMPDEST SWAP2 POP DUP1 DUP3 MSTORE PUSH1 0x20 DUP4 ADD PUSH1 0x20 DUP4 ADD DUP6 DUP4 DUP4 ADD GT ISZERO PUSH3 0x4DE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH3 0x4EB DUP4 DUP3 DUP5 PUSH3 0x747 JUMP JUMPDEST POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH3 0x507 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH3 0x515 DUP5 DUP5 PUSH3 0x475 JUMP JUMPDEST SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x60 DUP5 DUP7 SUB SLT ISZERO PUSH3 0x533 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH3 0x541 DUP7 DUP7 PUSH3 0x475 JUMP JUMPDEST SWAP4 POP POP PUSH1 0x20 DUP5 ADD MLOAD PUSH1 0x1 PUSH1 0x40 PUSH1 0x2 EXP SUB DUP2 GT ISZERO PUSH3 0x55E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH3 0x56C DUP7 DUP3 DUP8 ADD PUSH3 0x498 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x40 DUP5 ADD MLOAD PUSH1 0x1 PUSH1 0x40 PUSH1 0x2 EXP SUB DUP2 GT ISZERO PUSH3 0x589 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH3 0x597 DUP7 DUP3 DUP8 ADD PUSH3 0x498 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 POP SWAP3 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH3 0x5B4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH3 0x515 DUP5 DUP5 PUSH3 0x48A JUMP JUMPDEST PUSH3 0x5CD DUP2 PUSH3 0x711 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH3 0x5CD DUP2 PUSH3 0x71D JUMP JUMPDEST PUSH1 0x26 DUP2 MSTORE PUSH32 0x475245415445525F4F525F455155414C5F544F5F32305F4C454E4754485F5245 PUSH1 0x20 DUP3 ADD MSTORE PUSH32 0x5155495245440000000000000000000000000000000000000000000000000000 PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x60 ADD SWAP1 JUMP JUMPDEST PUSH1 0x18 DUP2 MSTORE PUSH32 0x554E524547495354455245445F41535345545F50524F58590000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH3 0x5CD DUP2 PUSH3 0x472 JUMP JUMPDEST PUSH1 0x40 DUP2 ADD PUSH3 0x67F DUP3 DUP6 PUSH3 0x5C2 JUMP JUMPDEST PUSH3 0x483 PUSH1 0x20 DUP4 ADD DUP5 PUSH3 0x664 JUMP JUMPDEST PUSH1 0x20 DUP2 ADD PUSH3 0x3CA DUP3 DUP5 PUSH3 0x5D3 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH3 0x3CA DUP2 PUSH3 0x5DE JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH3 0x3CA DUP2 PUSH3 0x634 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP2 DUP2 ADD PUSH1 0x1 PUSH1 0x40 PUSH1 0x2 EXP SUB DUP2 GT DUP3 DUP3 LT OR ISZERO PUSH3 0x6E1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x40 MSTORE SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1 PUSH1 0x40 PUSH1 0x2 EXP SUB DUP3 GT ISZERO PUSH3 0x700 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x20 PUSH1 0x1F SWAP2 SWAP1 SWAP2 ADD PUSH1 0x1F NOT AND ADD SWAP1 JUMP JUMPDEST PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB AND SWAP1 JUMP JUMPDEST PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 AND SWAP1 JUMP JUMPDEST ISZERO ISZERO SWAP1 JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH3 0x764 JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH3 0x74A JUMP JUMPDEST DUP4 DUP2 GT ISZERO PUSH3 0x774 JUMPI PUSH1 0x0 DUP5 DUP5 ADD MSTORE JUMPDEST POP POP POP POP JUMP JUMPDEST PUSH2 0x2551 DUP1 PUSH3 0x78A PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN STOP PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x6C JUMPI PUSH4 0xFFFFFFFF PUSH29 0x100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD DIV AND PUSH4 0x18978E82 DUP2 EQ PUSH2 0xC8 JUMPI DUP1 PUSH4 0x630F1E6C EQ PUSH2 0xF2 JUMPI DUP1 PUSH4 0x8DA5CB5B EQ PUSH2 0x112 JUMPI DUP1 PUSH4 0x9395525C EQ PUSH2 0x134 JUMPI DUP1 PUSH4 0xF2FDE38B EQ PUSH2 0x147 JUMPI JUMPDEST PUSH1 0x2 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0xC6 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x2337 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST STOP JUMPDEST PUSH2 0xDB PUSH2 0xD6 CALLDATASIZE PUSH1 0x4 PUSH2 0x1DA0 JUMP JUMPDEST PUSH2 0x167 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xE9 SWAP3 SWAP2 SWAP1 PUSH2 0x2437 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xFE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xC6 PUSH2 0x10D CALLDATASIZE PUSH1 0x4 PUSH2 0x1E9B JUMP JUMPDEST PUSH2 0x2F7 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x11E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x127 PUSH2 0x388 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xE9 SWAP2 SWAP1 PUSH2 0x22E6 JUMP JUMPDEST PUSH2 0xDB PUSH2 0x142 CALLDATASIZE PUSH1 0x4 PUSH2 0x1CBA JUMP JUMPDEST PUSH2 0x3A4 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x153 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xC6 PUSH2 0x162 CALLDATASIZE PUSH1 0x4 PUSH2 0x1C94 JUMP JUMPDEST PUSH2 0x50A JUMP JUMPDEST PUSH2 0x16F PUSH2 0x19A9 JUMP JUMPDEST PUSH2 0x177 PUSH2 0x19A9 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x182 PUSH2 0x5BB JUMP JUMPDEST PUSH1 0x4 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 PUSH1 0x1F PUSH1 0x2 PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH2 0x100 PUSH1 0x1 DUP9 AND ISZERO MUL ADD SWAP1 SWAP6 AND SWAP5 SWAP1 SWAP5 DIV SWAP4 DUP5 ADD DUP2 SWAP1 DIV DUP2 MUL DUP3 ADD DUP2 ADD SWAP1 SWAP3 MSTORE DUP3 DUP2 MSTORE PUSH2 0x25C SWAP4 SWAP1 SWAP3 SWAP1 SWAP2 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0x22D JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x202 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x22D JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x210 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP DUP13 PUSH1 0x0 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x241 JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD MLOAD PUSH2 0x140 ADD MLOAD SWAP1 PUSH4 0xFFFFFFFF PUSH2 0x696 AND JUMP JUMPDEST ISZERO PUSH2 0x287 JUMPI PUSH2 0x26C DUP12 DUP12 DUP12 PUSH2 0x7C3 JUMP JUMPDEST SWAP4 POP PUSH2 0x280 DUP5 PUSH1 0x0 ADD MLOAD DUP6 PUSH1 0x60 ADD MLOAD PUSH2 0xACB JUMP JUMPDEST SWAP1 POP PUSH2 0x2AE JUMP JUMPDEST PUSH2 0x292 DUP12 DUP12 DUP12 PUSH2 0xB0D JUMP JUMPDEST SWAP4 POP DUP4 PUSH1 0x60 ADD MLOAD SWAP2 POP PUSH2 0x2A6 DUP9 DUP4 DUP10 PUSH2 0x7C3 JUMP JUMPDEST DUP5 MLOAD SWAP1 SWAP4 POP SWAP1 POP JUMPDEST PUSH2 0x2C2 DUP5 PUSH1 0x20 ADD MLOAD DUP5 PUSH1 0x20 ADD MLOAD DUP9 DUP9 PUSH2 0xD1F JUMP JUMPDEST PUSH2 0x2E9 DUP12 PUSH1 0x0 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x2D4 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x140 ADD MLOAD DUP3 PUSH2 0xF33 JUMP JUMPDEST POP POP SWAP8 POP SWAP8 SWAP6 POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0x348 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x23E7 JUMP JUMPDEST PUSH2 0x383 DUP4 DUP4 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY POP DUP8 SWAP5 POP PUSH2 0xF33 SWAP4 POP POP POP POP JUMP JUMPDEST POP POP POP JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH2 0x3AC PUSH2 0x19A9 JUMP JUMPDEST PUSH2 0x3B4 PUSH2 0x19A9 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH2 0x3C1 PUSH2 0x5BB JUMP JUMPDEST PUSH1 0x4 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 PUSH1 0x1F PUSH1 0x2 PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH2 0x100 PUSH1 0x1 DUP9 AND ISZERO MUL ADD SWAP1 SWAP6 AND SWAP5 SWAP1 SWAP5 DIV SWAP4 DUP5 ADD DUP2 SWAP1 DIV DUP2 MUL DUP3 ADD DUP2 ADD SWAP1 SWAP3 MSTORE DUP3 DUP2 MSTORE PUSH2 0x441 SWAP4 SWAP1 SWAP3 SWAP1 SWAP2 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0x22D JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x202 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x22D JUMP JUMPDEST ISZERO PUSH2 0x492 JUMPI PUSH2 0x46A PUSH8 0xDE0B6B3A7640000 PUSH2 0x464 PUSH8 0xDE0B6B3A7640000 DUP11 PUSH2 0x104F JUMP JUMPDEST CALLVALUE PUSH2 0x1099 JUMP JUMPDEST SWAP3 POP PUSH2 0x477 DUP12 DUP5 DUP13 PUSH2 0x10F1 JUMP JUMPDEST SWAP5 POP PUSH2 0x48B DUP6 PUSH1 0x0 ADD MLOAD DUP7 PUSH1 0x60 ADD MLOAD PUSH2 0xACB JUMP JUMPDEST SWAP1 POP PUSH2 0x4D6 JUMP JUMPDEST PUSH2 0x4AD PUSH8 0xD2F13F7789F0000 PUSH8 0xDE0B6B3A7640000 CALLVALUE PUSH2 0x1099 JUMP JUMPDEST SWAP3 POP PUSH2 0x4BA DUP12 DUP5 DUP13 PUSH2 0x10F1 JUMP JUMPDEST SWAP5 POP DUP5 PUSH1 0x60 ADD MLOAD SWAP2 POP PUSH2 0x4CE DUP10 DUP4 DUP11 PUSH2 0x7C3 JUMP JUMPDEST DUP6 MLOAD SWAP1 SWAP5 POP SWAP1 POP JUMPDEST PUSH2 0x4EA DUP6 PUSH1 0x20 ADD MLOAD DUP6 PUSH1 0x20 ADD MLOAD DUP10 DUP10 PUSH2 0xD1F JUMP JUMPDEST PUSH2 0x4FC DUP12 PUSH1 0x0 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x2D4 JUMPI INVALID JUMPDEST POP POP POP SWAP7 POP SWAP7 SWAP5 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0x55B JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x23E7 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND ISZERO PUSH2 0x5B8 JUMPI PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND OR SWAP1 SSTORE JUMPDEST POP JUMP JUMPDEST PUSH1 0x0 CALLVALUE GT PUSH2 0x5F5 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x2347 JUMP JUMPDEST PUSH1 0x2 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0xD0E30DB0 CALLVALUE PUSH1 0x40 MLOAD DUP3 PUSH4 0xFFFFFFFF AND PUSH29 0x100000000000000000000000000000000000000000000000000000000 MUL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP6 DUP9 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x67B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x68F JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD DUP4 MLOAD EQ DUP1 ISZERO PUSH2 0x7BA JUMPI POP DUP2 PUSH1 0x40 MLOAD DUP1 DUP3 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT PUSH2 0x6F2 JUMPI DUP1 MLOAD DUP3 MSTORE PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 SWAP1 SWAP3 ADD SWAP2 PUSH1 0x20 SWAP2 DUP3 ADD SWAP2 ADD PUSH2 0x6B5 JUMP JUMPDEST MLOAD DUP2 MLOAD PUSH1 0x20 SWAP4 DUP5 SUB PUSH2 0x100 EXP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD DUP1 NOT SWAP1 SWAP3 AND SWAP2 AND OR SWAP1 MSTORE PUSH1 0x40 MLOAD SWAP2 SWAP1 SWAP4 ADD DUP2 SWAP1 SUB DUP2 KECCAK256 DUP9 MLOAD SWAP1 SWAP6 POP DUP9 SWAP5 POP SWAP1 SWAP3 DUP4 SWAP3 POP DUP5 ADD SWAP1 DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT PUSH2 0x787 JUMPI DUP1 MLOAD DUP3 MSTORE PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 SWAP1 SWAP3 ADD SWAP2 PUSH1 0x20 SWAP2 DUP3 ADD SWAP2 ADD PUSH2 0x74A JUMP JUMPDEST PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB DUP1 NOT DUP3 MLOAD AND DUP2 DUP5 MLOAD AND DUP1 DUP3 OR DUP6 MSTORE POP POP POP POP POP POP SWAP1 POP ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 KECCAK256 PUSH1 0x0 NOT AND EQ JUMPDEST SWAP1 POP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x7CB PUSH2 0x19A9 JUMP JUMPDEST PUSH1 0x60 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 PUSH2 0x7DE PUSH2 0x19A9 JUMP JUMPDEST DUP11 ISZERO ISZERO PUSH2 0x7EA JUMPI PUSH2 0xABC JUMP JUMPDEST PUSH1 0x4 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 PUSH1 0x2 PUSH1 0x1 DUP6 AND ISZERO PUSH2 0x100 MUL PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 SWAP5 AND SWAP4 SWAP1 SWAP4 DIV PUSH1 0x1F DUP2 ADD DUP5 SWAP1 DIV DUP5 MUL DUP3 ADD DUP5 ADD SWAP1 SWAP3 MSTORE DUP2 DUP2 MSTORE SWAP3 SWAP2 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0x88E JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x863 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x88E JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x871 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP PUSH1 0x5 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 PUSH1 0x1F PUSH1 0x2 PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH2 0x100 PUSH1 0x1 DUP9 AND ISZERO MUL ADD SWAP1 SWAP6 AND SWAP5 SWAP1 SWAP5 DIV SWAP4 DUP5 ADD DUP2 SWAP1 DIV DUP2 MUL DUP3 ADD DUP2 ADD SWAP1 SWAP3 MSTORE DUP3 DUP2 MSTORE SWAP7 SWAP15 POP SWAP2 SWAP5 POP SWAP3 POP DUP5 ADD SWAP1 POP DUP3 DUP3 DUP1 ISZERO PUSH2 0x93D JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x912 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x93D JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x920 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP7 POP PUSH1 0x0 SWAP6 POP DUP12 MLOAD SWAP5 POP PUSH1 0x0 SWAP4 POP JUMPDEST DUP4 DUP6 EQ PUSH2 0xA82 JUMPI DUP8 DUP13 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x967 JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD MLOAD PUSH2 0x140 ADD MSTORE DUP12 MLOAD DUP8 SWAP1 DUP14 SWAP1 DUP7 SWAP1 DUP2 LT PUSH2 0x986 JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD MLOAD PUSH2 0x160 ADD MSTORE PUSH2 0x99F DUP12 DUP8 PUSH2 0xACB JUMP JUMPDEST SWAP3 POP PUSH2 0xA06 DUP13 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x9B2 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH1 0xA0 ADD MLOAD PUSH2 0xA00 DUP15 DUP8 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x9D1 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH1 0x80 ADD MLOAD DUP16 DUP9 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x9ED JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH1 0xE0 ADD MLOAD PUSH2 0xACB JUMP JUMPDEST DUP6 PUSH2 0x1099 JUMP JUMPDEST SWAP2 POP PUSH2 0xA4B DUP13 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xA19 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0xA2E DUP5 PUSH1 0x1 PUSH2 0x104F JUMP JUMPDEST DUP13 DUP8 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xA3C JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x1295 JUMP JUMPDEST SWAP1 POP PUSH2 0xA57 DUP10 DUP3 PUSH2 0x130D JUMP JUMPDEST PUSH2 0xA69 DUP10 PUSH1 0x0 ADD MLOAD DUP11 PUSH1 0x60 ADD MLOAD PUSH2 0xACB JUMP JUMPDEST SWAP6 POP DUP11 DUP7 LT PUSH2 0xA77 JUMPI PUSH2 0xA82 JUMP JUMPDEST PUSH1 0x1 SWAP1 SWAP4 ADD SWAP3 PUSH2 0x951 JUMP JUMPDEST DUP11 DUP7 LT ISZERO PUSH2 0xABC JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x23C7 JUMP JUMPDEST POP POP POP POP POP POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 GT ISZERO PUSH2 0xB07 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x2367 JUMP JUMPDEST POP SWAP1 SUB SWAP1 JUMP JUMPDEST PUSH2 0xB15 PUSH2 0x19A9 JUMP JUMPDEST PUSH1 0x60 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH2 0xB26 PUSH2 0x19A9 JUMP JUMPDEST PUSH1 0x0 DUP12 PUSH1 0x0 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xB37 JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP2 SWAP1 SWAP2 ADD DUP2 ADD MLOAD PUSH2 0x140 ADD MLOAD PUSH1 0x5 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x2 PUSH1 0x1 DUP5 AND ISZERO PUSH2 0x100 MUL PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 SWAP4 AND SWAP3 SWAP1 SWAP3 DIV PUSH1 0x1F DUP2 ADD DUP7 SWAP1 DIV DUP7 MUL DUP4 ADD DUP7 ADD SWAP1 SWAP2 MSTORE DUP1 DUP3 MSTORE SWAP3 SWAP12 POP SWAP3 SWAP1 SWAP2 SWAP1 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0xBEF JUMPI DUP1 PUSH1 0x1F LT PUSH2 0xBC4 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0xBEF JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0xBD2 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP7 POP DUP12 MLOAD SWAP6 POP PUSH1 0x0 SWAP5 POP JUMPDEST DUP5 DUP7 EQ PUSH2 0xCE5 JUMPI DUP8 DUP13 DUP7 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xC15 JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD MLOAD PUSH2 0x140 ADD MSTORE DUP12 MLOAD DUP8 SWAP1 DUP14 SWAP1 DUP8 SWAP1 DUP2 LT PUSH2 0xC34 JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD MLOAD PUSH2 0x160 ADD MSTORE DUP9 MLOAD PUSH2 0xC50 SWAP1 DUP13 SWAP1 PUSH2 0xACB JUMP JUMPDEST SWAP4 POP PUSH2 0xC93 DUP13 DUP7 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xC63 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH1 0xA0 ADD MLOAD DUP14 DUP8 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xC7F JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH1 0x80 ADD MLOAD DUP7 PUSH2 0x1099 JUMP JUMPDEST SWAP3 POP PUSH2 0xCBF DUP13 DUP7 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xCA6 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP5 DUP13 DUP9 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xA3C JUMPI INVALID JUMPDEST SWAP2 POP PUSH2 0xCCB DUP10 DUP4 PUSH2 0x130D JUMP JUMPDEST POP DUP8 MLOAD DUP11 DUP2 LT PUSH2 0xCDA JUMPI PUSH2 0xCE5 JUMP JUMPDEST PUSH1 0x1 SWAP1 SWAP5 ADD SWAP4 PUSH2 0xBFF JUMP JUMPDEST DUP11 DUP2 LT ISZERO PUSH2 0xABC JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x23C7 JUMP JUMPDEST PUSH1 0x0 DUP1 DUP1 DUP1 PUSH7 0xB1A2BC2EC50000 DUP7 GT ISZERO PUSH2 0xD65 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x23F7 JUMP JUMPDEST PUSH2 0xD6F DUP9 DUP9 PUSH2 0x104F JUMP JUMPDEST SWAP4 POP CALLVALUE DUP5 GT ISZERO PUSH2 0xDAB JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x2357 JUMP JUMPDEST PUSH2 0xDB5 CALLVALUE DUP6 PUSH2 0xACB JUMP JUMPDEST SWAP3 POP PUSH2 0xDCA DUP7 PUSH8 0xDE0B6B3A7640000 DUP11 PUSH2 0x1099 JUMP JUMPDEST SWAP2 POP DUP3 DUP3 GT ISZERO PUSH2 0xE06 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x23D7 JUMP JUMPDEST PUSH1 0x0 DUP4 GT ISZERO PUSH2 0xF29 JUMPI PUSH1 0x2 SLOAD PUSH1 0x40 MLOAD PUSH32 0x2E1A7D4D00000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP2 AND SWAP1 PUSH4 0x2E1A7D4D SWAP1 PUSH2 0xE65 SWAP1 DUP7 SWAP1 PUSH1 0x4 ADD PUSH2 0x2453 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0xE7F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0xE93 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x0 DUP3 GT ISZERO PUSH2 0xEE5 JUMPI PUSH1 0x40 MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP7 AND SWAP1 DUP4 ISZERO PUSH2 0x8FC MUL SWAP1 DUP5 SWAP1 PUSH1 0x0 DUP2 DUP2 DUP2 DUP6 DUP9 DUP9 CALL SWAP4 POP POP POP POP ISZERO DUP1 ISZERO PUSH2 0xEE3 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP JUMPDEST PUSH2 0xEEF DUP4 DUP4 PUSH2 0xACB JUMP JUMPDEST SWAP1 POP PUSH1 0x0 DUP2 GT ISZERO PUSH2 0xF29 JUMPI PUSH1 0x40 MLOAD CALLER SWAP1 DUP3 ISZERO PUSH2 0x8FC MUL SWAP1 DUP4 SWAP1 PUSH1 0x0 DUP2 DUP2 DUP2 DUP6 DUP9 DUP9 CALL SWAP4 POP POP POP POP ISZERO DUP1 ISZERO PUSH2 0xF27 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP JUMPDEST POP POP POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0xF45 DUP4 DUP3 PUSH4 0xFFFFFFFF PUSH2 0x136F AND JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0x4552433230546F6B656E28616464726573732900000000000000000000000000 DUP2 MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x13 ADD SWAP1 KECCAK256 SWAP1 SWAP2 POP PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 DUP1 DUP4 AND SWAP2 AND EQ ISZERO PUSH2 0xFB5 JUMPI PUSH2 0xFB0 DUP4 DUP4 PUSH2 0x13DC JUMP JUMPDEST PUSH2 0x383 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0x455243373231546F6B656E28616464726573732C75696E743235362900000000 DUP2 MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x1C ADD SWAP1 KECCAK256 PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 DUP3 DUP2 AND SWAP2 AND EQ ISZERO PUSH2 0x101D JUMPI PUSH2 0xFB0 DUP4 DUP4 PUSH2 0x15CA JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x23A7 JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 ADD DUP4 DUP2 LT ISZERO PUSH2 0x108E JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x2397 JUMP JUMPDEST DUP1 SWAP2 POP JUMPDEST POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP4 GT PUSH2 0x10D4 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x2387 JUMP JUMPDEST PUSH2 0x10E7 PUSH2 0x10E1 DUP6 DUP5 PUSH2 0x16B2 JUMP JUMPDEST DUP5 PUSH2 0x170D JUMP JUMPDEST SWAP1 POP JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH2 0x10F9 PUSH2 0x19A9 JUMP JUMPDEST PUSH1 0x60 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 PUSH2 0x1109 PUSH2 0x19A9 JUMP JUMPDEST DUP10 PUSH1 0x0 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1118 JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP2 SWAP1 SWAP2 ADD DUP2 ADD MLOAD PUSH2 0x140 ADD MLOAD PUSH1 0x5 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x2 PUSH1 0x1 DUP5 AND ISZERO PUSH2 0x100 MUL PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 SWAP4 AND SWAP3 SWAP1 SWAP3 DIV PUSH1 0x1F DUP2 ADD DUP7 SWAP1 DIV DUP7 MUL DUP4 ADD DUP7 ADD SWAP1 SWAP2 MSTORE DUP1 DUP3 MSTORE SWAP3 SWAP10 POP SWAP3 SWAP1 SWAP2 SWAP1 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0x11D0 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x11A5 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x11D0 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x11B3 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP5 POP DUP10 MLOAD SWAP4 POP PUSH1 0x0 SWAP3 POP JUMPDEST DUP3 DUP5 EQ PUSH2 0x1288 JUMPI DUP6 DUP11 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x11F6 JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD MLOAD PUSH2 0x140 ADD MSTORE DUP10 MLOAD DUP6 SWAP1 DUP12 SWAP1 DUP6 SWAP1 DUP2 LT PUSH2 0x1215 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x160 ADD DUP2 SWAP1 MSTORE POP PUSH2 0x1235 DUP10 DUP9 PUSH1 0x20 ADD MLOAD PUSH2 0xACB JUMP JUMPDEST SWAP2 POP PUSH2 0x1261 DUP11 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1248 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP4 DUP11 DUP7 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xA3C JUMPI INVALID JUMPDEST SWAP1 POP PUSH2 0x126D DUP8 DUP3 PUSH2 0x130D JUMP JUMPDEST PUSH1 0x20 DUP8 ADD MLOAD DUP10 GT PUSH2 0x127D JUMPI PUSH2 0x1288 JUMP JUMPDEST PUSH1 0x1 SWAP1 SWAP3 ADD SWAP2 PUSH2 0x11E0 JUMP JUMPDEST POP POP POP POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH2 0x129D PUSH2 0x19A9 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x0 PUSH2 0x12AC DUP7 DUP7 DUP7 PUSH2 0x1724 JUMP JUMPDEST PUSH1 0x1 SLOAD DUP2 MLOAD SWAP2 SWAP4 POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP2 POP PUSH1 0x80 SWAP1 DUP4 SWAP1 PUSH1 0x20 DUP3 ADD PUSH1 0x0 DUP6 GAS CALL DUP1 ISZERO PUSH2 0x1303 JUMPI DUP3 MLOAD DUP5 MSTORE PUSH1 0x20 DUP4 ADD MLOAD PUSH1 0x20 DUP6 ADD MSTORE PUSH1 0x40 DUP4 ADD MLOAD PUSH1 0x40 DUP6 ADD MSTORE PUSH1 0x60 DUP4 ADD MLOAD PUSH1 0x60 DUP6 ADD MSTORE JUMPDEST POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST DUP2 MLOAD DUP2 MLOAD PUSH2 0x131B SWAP2 SWAP1 PUSH2 0x104F JUMP JUMPDEST DUP3 MSTORE PUSH1 0x20 DUP1 DUP4 ADD MLOAD SWAP1 DUP3 ADD MLOAD PUSH2 0x1331 SWAP2 SWAP1 PUSH2 0x104F JUMP JUMPDEST PUSH1 0x20 DUP4 ADD MSTORE PUSH1 0x40 DUP1 DUP4 ADD MLOAD SWAP1 DUP3 ADD MLOAD PUSH2 0x134A SWAP2 SWAP1 PUSH2 0x104F JUMP JUMPDEST PUSH1 0x40 DUP4 ADD MSTORE PUSH1 0x60 DUP1 DUP4 ADD MLOAD SWAP1 DUP3 ADD MLOAD PUSH2 0x1363 SWAP2 SWAP1 PUSH2 0x104F JUMP JUMPDEST PUSH1 0x60 SWAP1 SWAP3 ADD SWAP2 SWAP1 SWAP2 MSTORE POP JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x4 ADD DUP4 MLOAD LT ISZERO ISZERO ISZERO PUSH2 0x13B1 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x2417 JUMP JUMPDEST POP ADD PUSH1 0x20 ADD MLOAD PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 AND SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x13F0 DUP5 PUSH1 0x10 PUSH4 0xFFFFFFFF PUSH2 0x18F6 AND JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0x7472616E7366657228616464726573732C75696E743235362900000000000000 DUP2 MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x19 ADD DUP2 KECCAK256 SWAP2 SWAP4 POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND SWAP2 SWAP1 PUSH2 0x144E SWAP1 CALLER SWAP1 DUP8 SWAP1 PUSH1 0x24 ADD PUSH2 0x231C JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 DUP2 DUP5 SUB ADD DUP2 MSTORE SWAP2 DUP2 MSTORE PUSH1 0x20 DUP3 ADD DUP1 MLOAD PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 SWAP1 SWAP5 AND SWAP4 SWAP1 SWAP4 OR DUP4 MSTORE MLOAD DUP2 MLOAD SWAP2 SWAP3 SWAP1 SWAP2 DUP3 SWAP2 SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x14F2 JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH2 0x14DA JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x151F JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP2 POP POP PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP7 GAS CALL SWAP3 POP POP POP DUP1 ISZERO ISZERO PUSH2 0x156E JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x23B7 JUMP JUMPDEST RETURNDATASIZE ISZERO PUSH2 0x158B JUMPI POP PUSH1 0x0 RETURNDATASIZE PUSH1 0x20 EQ ISZERO PUSH2 0x158B JUMPI PUSH1 0x20 PUSH1 0x0 DUP1 RETURNDATACOPY POP PUSH1 0x0 MLOAD JUMPDEST DUP1 ISZERO ISZERO PUSH2 0x15C4 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x23B7 JUMP JUMPDEST POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x1 DUP4 EQ PUSH2 0x1607 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x2427 JUMP JUMPDEST PUSH2 0x1618 DUP5 PUSH1 0x10 PUSH4 0xFFFFFFFF PUSH2 0x18F6 AND JUMP JUMPDEST SWAP2 POP PUSH2 0x162B DUP5 PUSH1 0x24 PUSH4 0xFFFFFFFF PUSH2 0x1957 AND JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH32 0x23B872DD00000000000000000000000000000000000000000000000000000000 DUP2 MSTORE SWAP1 SWAP2 POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND SWAP1 PUSH4 0x23B872DD SWAP1 PUSH2 0x1684 SWAP1 ADDRESS SWAP1 CALLER SWAP1 DUP7 SWAP1 PUSH1 0x4 ADD PUSH2 0x22F4 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x169E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0xF29 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST PUSH1 0x0 DUP1 DUP4 ISZERO ISZERO PUSH2 0x16C5 JUMPI PUSH1 0x0 SWAP2 POP PUSH2 0x1092 JUMP JUMPDEST POP DUP3 DUP3 MUL DUP3 DUP5 DUP3 DUP2 ISZERO ISZERO PUSH2 0x16D5 JUMPI INVALID JUMPDEST DIV EQ PUSH2 0x108E JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x2397 JUMP JUMPDEST PUSH1 0x0 DUP1 DUP3 DUP5 DUP2 ISZERO ISZERO PUSH2 0x171B JUMPI INVALID JUMPDEST DIV SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0xB4BE83D500000000000000000000000000000000000000000000000000000000 PUSH1 0x20 DUP1 DUP4 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x60 PUSH1 0x24 DUP4 ADD DUP2 DUP2 MSTORE DUP8 MLOAD PUSH1 0x84 DUP6 ADD SWAP1 DUP2 MSTORE DUP9 DUP5 ADD MLOAD PUSH1 0xA4 DUP7 ADD MSTORE SWAP5 DUP9 ADD MLOAD PUSH1 0xC4 DUP6 ADD MSTORE SWAP1 DUP8 ADD MLOAD PUSH1 0xE4 DUP5 ADD MSTORE PUSH1 0x80 DUP8 ADD MLOAD PUSH2 0x104 DUP5 ADD MSTORE PUSH1 0xA0 DUP8 ADD MLOAD PUSH2 0x124 DUP5 ADD MSTORE PUSH1 0xC0 DUP8 ADD MLOAD PUSH2 0x144 DUP5 ADD MSTORE PUSH1 0xE0 DUP8 ADD MLOAD PUSH2 0x164 DUP5 ADD MSTORE PUSH2 0x100 DUP8 ADD MLOAD PUSH2 0x184 DUP5 ADD MSTORE PUSH2 0x120 DUP8 ADD MLOAD PUSH2 0x1A4 DUP5 ADD MSTORE PUSH2 0x140 DUP8 ADD DUP1 MLOAD PUSH2 0x1C4 DUP6 ADD SWAP1 DUP2 MSTORE PUSH2 0x160 DUP10 ADD MLOAD PUSH2 0x1E4 DUP7 ADD MSTORE PUSH2 0x180 SWAP1 MSTORE MLOAD DUP1 MLOAD PUSH2 0x204 DUP6 ADD DUP2 SWAP1 MSTORE SWAP4 SWAP5 SWAP2 SWAP4 DUP5 SWAP4 PUSH1 0x44 DUP8 ADD SWAP3 DUP5 SWAP3 PUSH2 0x224 DUP10 ADD SWAP3 SWAP2 DUP3 ADD SWAP2 PUSH1 0x1F DUP3 ADD DIV PUSH1 0x0 JUMPDEST DUP2 DUP2 LT ISZERO PUSH2 0x182B JUMPI DUP4 MLOAD DUP6 MSTORE PUSH1 0x20 SWAP5 DUP6 ADD SWAP5 SWAP1 SWAP4 ADD SWAP3 PUSH1 0x1 ADD PUSH2 0x180D JUMP JUMPDEST POP POP POP POP DUP2 DUP2 SUB PUSH2 0x160 DUP1 DUP5 ADD SWAP2 SWAP1 SWAP2 MSTORE DUP11 ADD MLOAD DUP1 MLOAD DUP1 DUP4 MSTORE PUSH1 0x20 SWAP3 DUP4 ADD SWAP3 SWAP2 DUP3 ADD SWAP2 PUSH1 0x1F DUP3 ADD DIV PUSH1 0x0 JUMPDEST DUP2 DUP2 LT ISZERO PUSH2 0x1874 JUMPI DUP4 MLOAD DUP6 MSTORE PUSH1 0x20 SWAP5 DUP6 ADD SWAP5 SWAP1 SWAP4 ADD SWAP3 PUSH1 0x1 ADD PUSH2 0x1856 JUMP JUMPDEST POP POP POP DUP10 DUP5 MSTORE POP DUP5 DUP2 SUB PUSH1 0x20 SWAP4 DUP5 ADD SWAP1 DUP2 MSTORE DUP9 MLOAD DUP1 DUP4 MSTORE SWAP1 SWAP4 SWAP2 DUP3 ADD SWAP2 DUP10 DUP2 ADD SWAP2 SWAP1 PUSH1 0x1F DUP3 ADD DIV PUSH1 0x0 JUMPDEST DUP2 DUP2 LT ISZERO PUSH2 0x18BC JUMPI DUP4 MLOAD DUP6 MSTORE PUSH1 0x20 SWAP5 DUP6 ADD SWAP5 SWAP1 SWAP4 ADD SWAP3 PUSH1 0x1 ADD PUSH2 0x189E JUMP JUMPDEST POP POP POP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 DUP9 DUP4 SUB ADD DUP9 MSTORE POP PUSH1 0x40 MSTORE POP POP POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x14 ADD DUP4 MLOAD LT ISZERO ISZERO ISZERO PUSH2 0x1938 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x2407 JUMP JUMPDEST POP ADD PUSH1 0x14 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x7BA DUP4 DUP4 PUSH1 0x0 DUP2 PUSH1 0x20 ADD DUP4 MLOAD LT ISZERO ISZERO ISZERO PUSH2 0x19A0 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x2377 JUMP JUMPDEST POP ADD PUSH1 0x20 ADD MLOAD SWAP1 JUMP JUMPDEST PUSH1 0x80 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE POP SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x7BA DUP3 CALLDATALOAD PUSH2 0x24EF JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH2 0x19EF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0x1A02 PUSH2 0x19FD DUP3 PUSH2 0x2488 JUMP JUMPDEST PUSH2 0x2461 JUMP JUMPDEST DUP2 DUP2 MSTORE PUSH1 0x20 SWAP4 DUP5 ADD SWAP4 SWAP1 SWAP3 POP DUP3 ADD DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x1A40 JUMPI DUP2 CALLDATALOAD DUP7 ADD PUSH2 0x1A2A DUP9 DUP3 PUSH2 0x1AF0 JUMP JUMPDEST DUP5 MSTORE POP PUSH1 0x20 SWAP3 DUP4 ADD SWAP3 SWAP2 SWAP1 SWAP2 ADD SWAP1 PUSH1 0x1 ADD PUSH2 0x1A14 JUMP JUMPDEST POP POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH2 0x1A5B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0x1A69 PUSH2 0x19FD DUP3 PUSH2 0x2488 JUMP JUMPDEST DUP2 DUP2 MSTORE PUSH1 0x20 SWAP4 DUP5 ADD SWAP4 SWAP1 SWAP3 POP DUP3 ADD DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x1A40 JUMPI DUP2 CALLDATALOAD DUP7 ADD PUSH2 0x1A91 DUP9 DUP3 PUSH2 0x1B3F JUMP JUMPDEST DUP5 MSTORE POP PUSH1 0x20 SWAP3 DUP4 ADD SWAP3 SWAP2 SWAP1 SWAP2 ADD SWAP1 PUSH1 0x1 ADD PUSH2 0x1A7B JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x1F DUP4 ADD DUP5 SGT PUSH2 0x1AB9 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP DUP2 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1AD1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x20 DUP4 ADD SWAP2 POP DUP4 PUSH1 0x1 DUP3 MUL DUP4 ADD GT ISZERO PUSH2 0x1AE9 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH2 0x1B01 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0x1B0F PUSH2 0x19FD DUP3 PUSH2 0x24A9 JUMP JUMPDEST SWAP2 POP DUP1 DUP3 MSTORE PUSH1 0x20 DUP4 ADD PUSH1 0x20 DUP4 ADD DUP6 DUP4 DUP4 ADD GT ISZERO PUSH2 0x1B2B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1B36 DUP4 DUP3 DUP5 PUSH2 0x250B JUMP JUMPDEST POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x180 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x1B52 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1B5D PUSH2 0x180 PUSH2 0x2461 JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0x1B6B DUP5 DUP5 PUSH2 0x19D2 JUMP JUMPDEST DUP3 MSTORE POP PUSH1 0x20 PUSH2 0x1B7C DUP5 DUP5 DUP4 ADD PUSH2 0x19D2 JUMP JUMPDEST PUSH1 0x20 DUP4 ADD MSTORE POP PUSH1 0x40 PUSH2 0x1B90 DUP5 DUP3 DUP6 ADD PUSH2 0x19D2 JUMP JUMPDEST PUSH1 0x40 DUP4 ADD MSTORE POP PUSH1 0x60 PUSH2 0x1BA4 DUP5 DUP3 DUP6 ADD PUSH2 0x19D2 JUMP JUMPDEST PUSH1 0x60 DUP4 ADD MSTORE POP PUSH1 0x80 PUSH2 0x1BB8 DUP5 DUP3 DUP6 ADD PUSH2 0x1C88 JUMP JUMPDEST PUSH1 0x80 DUP4 ADD MSTORE POP PUSH1 0xA0 PUSH2 0x1BCC DUP5 DUP3 DUP6 ADD PUSH2 0x1C88 JUMP JUMPDEST PUSH1 0xA0 DUP4 ADD MSTORE POP PUSH1 0xC0 PUSH2 0x1BE0 DUP5 DUP3 DUP6 ADD PUSH2 0x1C88 JUMP JUMPDEST PUSH1 0xC0 DUP4 ADD MSTORE POP PUSH1 0xE0 PUSH2 0x1BF4 DUP5 DUP3 DUP6 ADD PUSH2 0x1C88 JUMP JUMPDEST PUSH1 0xE0 DUP4 ADD MSTORE POP PUSH2 0x100 PUSH2 0x1C09 DUP5 DUP3 DUP6 ADD PUSH2 0x1C88 JUMP JUMPDEST PUSH2 0x100 DUP4 ADD MSTORE POP PUSH2 0x120 PUSH2 0x1C1F DUP5 DUP3 DUP6 ADD PUSH2 0x1C88 JUMP JUMPDEST PUSH2 0x120 DUP4 ADD MSTORE POP PUSH2 0x140 DUP3 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1C41 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1C4D DUP5 DUP3 DUP6 ADD PUSH2 0x1AF0 JUMP JUMPDEST PUSH2 0x140 DUP4 ADD MSTORE POP PUSH2 0x160 DUP3 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1C6F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1C7B DUP5 DUP3 DUP6 ADD PUSH2 0x1AF0 JUMP JUMPDEST PUSH2 0x160 DUP4 ADD MSTORE POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x7BA DUP3 CALLDATALOAD PUSH2 0x2508 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x1CA6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1CB2 DUP5 DUP5 PUSH2 0x19D2 JUMP JUMPDEST SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0xC0 DUP8 DUP10 SUB SLT ISZERO PUSH2 0x1CD3 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP7 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1CEA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1CF6 DUP10 DUP3 DUP11 ADD PUSH2 0x1A4A JUMP JUMPDEST SWAP7 POP POP PUSH1 0x20 DUP8 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1D13 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1D1F DUP10 DUP3 DUP11 ADD PUSH2 0x19DE JUMP JUMPDEST SWAP6 POP POP PUSH1 0x40 DUP8 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1D3C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1D48 DUP10 DUP3 DUP11 ADD PUSH2 0x1A4A JUMP JUMPDEST SWAP5 POP POP PUSH1 0x60 DUP8 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1D65 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1D71 DUP10 DUP3 DUP11 ADD PUSH2 0x19DE JUMP JUMPDEST SWAP4 POP POP PUSH1 0x80 PUSH2 0x1D82 DUP10 DUP3 DUP11 ADD PUSH2 0x1C88 JUMP JUMPDEST SWAP3 POP POP PUSH1 0xA0 PUSH2 0x1D93 DUP10 DUP3 DUP11 ADD PUSH2 0x19D2 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP6 POP SWAP3 SWAP6 POP SWAP3 SWAP6 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0xE0 DUP9 DUP11 SUB SLT ISZERO PUSH2 0x1DBB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP8 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1DD2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1DDE DUP11 DUP3 DUP12 ADD PUSH2 0x1A4A JUMP JUMPDEST SWAP8 POP POP PUSH1 0x20 PUSH2 0x1DEF DUP11 DUP3 DUP12 ADD PUSH2 0x1C88 JUMP JUMPDEST SWAP7 POP POP PUSH1 0x40 DUP9 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1E0C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1E18 DUP11 DUP3 DUP12 ADD PUSH2 0x19DE JUMP JUMPDEST SWAP6 POP POP PUSH1 0x60 DUP9 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1E35 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1E41 DUP11 DUP3 DUP12 ADD PUSH2 0x1A4A JUMP JUMPDEST SWAP5 POP POP PUSH1 0x80 DUP9 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1E5E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1E6A DUP11 DUP3 DUP12 ADD PUSH2 0x19DE JUMP JUMPDEST SWAP4 POP POP PUSH1 0xA0 PUSH2 0x1E7B DUP11 DUP3 DUP12 ADD PUSH2 0x1C88 JUMP JUMPDEST SWAP3 POP POP PUSH1 0xC0 PUSH2 0x1E8C DUP11 DUP3 DUP12 ADD PUSH2 0x19D2 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP6 SWAP9 SWAP2 SWAP5 SWAP8 POP SWAP3 SWAP6 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x40 DUP5 DUP7 SUB SLT ISZERO PUSH2 0x1EB0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP4 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1EC7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1ED3 DUP7 DUP3 DUP8 ADD PUSH2 0x1AA7 JUMP JUMPDEST SWAP4 POP SWAP4 POP POP PUSH1 0x20 PUSH2 0x1EE6 DUP7 DUP3 DUP8 ADD PUSH2 0x1C88 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 POP SWAP3 JUMP JUMPDEST PUSH2 0x1EF9 DUP2 PUSH2 0x24EF JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x23 DUP2 MSTORE PUSH32 0x44454641554C545F46554E4354494F4E5F574554485F434F4E54524143545F4F PUSH1 0x20 DUP3 ADD MSTORE PUSH32 0x4E4C590000000000000000000000000000000000000000000000000000000000 PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x60 ADD SWAP1 JUMP JUMPDEST PUSH1 0x11 DUP2 MSTORE PUSH32 0x494E56414C49445F4D53475F56414C5545000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0xD DUP2 MSTORE PUSH32 0x4F564552534F4C445F5745544800000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x11 DUP2 MSTORE PUSH32 0x55494E543235365F554E444552464C4F57000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x26 DUP2 MSTORE PUSH32 0x475245415445525F4F525F455155414C5F544F5F33325F4C454E4754485F5245 PUSH1 0x20 DUP3 ADD MSTORE PUSH32 0x5155495245440000000000000000000000000000000000000000000000000000 PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x60 ADD SWAP1 JUMP JUMPDEST PUSH1 0x10 DUP2 MSTORE PUSH32 0x4449564953494F4E5F42595F5A45524F00000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x10 DUP2 MSTORE PUSH32 0x55494E543235365F4F564552464C4F5700000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x17 DUP2 MSTORE PUSH32 0x554E535550504F525445445F41535345545F50524F5859000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0xF DUP2 MSTORE PUSH32 0x5452414E534645525F4641494C45440000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x14 DUP2 MSTORE PUSH32 0x434F4D504C4554455F46494C4C5F4641494C4544000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x1A DUP2 MSTORE PUSH32 0x494E53554646494349454E545F4554485F52454D41494E494E47000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x13 DUP2 MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x18 DUP2 MSTORE PUSH32 0x4645455F50455243454E544147455F544F4F5F4C415247450000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x26 DUP2 MSTORE PUSH32 0x475245415445525F4F525F455155414C5F544F5F32305F4C454E4754485F5245 PUSH1 0x20 DUP3 ADD MSTORE PUSH32 0x5155495245440000000000000000000000000000000000000000000000000000 PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x60 ADD SWAP1 JUMP JUMPDEST PUSH1 0x25 DUP2 MSTORE PUSH32 0x475245415445525F4F525F455155414C5F544F5F345F4C454E4754485F524551 PUSH1 0x20 DUP3 ADD MSTORE PUSH32 0x5549524544000000000000000000000000000000000000000000000000000000 PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x60 ADD SWAP1 JUMP JUMPDEST PUSH1 0xE DUP2 MSTORE PUSH32 0x494E56414C49445F414D4F554E54000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST DUP1 MLOAD PUSH1 0x80 DUP4 ADD SWAP1 PUSH2 0x22A8 DUP5 DUP3 PUSH2 0x22DD JUMP JUMPDEST POP PUSH1 0x20 DUP3 ADD MLOAD PUSH2 0x22BB PUSH1 0x20 DUP6 ADD DUP3 PUSH2 0x22DD JUMP JUMPDEST POP PUSH1 0x40 DUP3 ADD MLOAD PUSH2 0x22CE PUSH1 0x40 DUP6 ADD DUP3 PUSH2 0x22DD JUMP JUMPDEST POP PUSH1 0x60 DUP3 ADD MLOAD PUSH2 0x15C4 PUSH1 0x60 DUP6 ADD DUP3 JUMPDEST PUSH2 0x1EF9 DUP2 PUSH2 0x2508 JUMP JUMPDEST PUSH1 0x20 DUP2 ADD PUSH2 0x7BD DUP3 DUP5 PUSH2 0x1EF0 JUMP JUMPDEST PUSH1 0x60 DUP2 ADD PUSH2 0x2302 DUP3 DUP7 PUSH2 0x1EF0 JUMP JUMPDEST PUSH2 0x230F PUSH1 0x20 DUP4 ADD DUP6 PUSH2 0x1EF0 JUMP JUMPDEST PUSH2 0x1CB2 PUSH1 0x40 DUP4 ADD DUP5 PUSH2 0x22DD JUMP JUMPDEST PUSH1 0x40 DUP2 ADD PUSH2 0x232A DUP3 DUP6 PUSH2 0x1EF0 JUMP JUMPDEST PUSH2 0x10EA PUSH1 0x20 DUP4 ADD DUP5 PUSH2 0x22DD JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x1EFF JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x1F55 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x1F85 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x1FB5 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x1FE5 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x203B JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x206B JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x209B JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x20CB JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x20FB JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x212B JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x215B JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x218B JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x21BB JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x2211 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x2267 JUMP JUMPDEST PUSH2 0x100 DUP2 ADD PUSH2 0x2446 DUP3 DUP6 PUSH2 0x2297 JUMP JUMPDEST PUSH2 0x10EA PUSH1 0x80 DUP4 ADD DUP5 PUSH2 0x2297 JUMP JUMPDEST PUSH1 0x20 DUP2 ADD PUSH2 0x7BD DUP3 DUP5 PUSH2 0x22DD JUMP JUMPDEST PUSH1 0x40 MLOAD DUP2 DUP2 ADD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT DUP3 DUP3 LT OR ISZERO PUSH2 0x2480 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x40 MSTORE SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH8 0xFFFFFFFFFFFFFFFF DUP3 GT ISZERO PUSH2 0x249F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x20 SWAP1 DUP2 MUL ADD SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH8 0xFFFFFFFFFFFFFFFF DUP3 GT ISZERO PUSH2 0x24C0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x20 PUSH1 0x1F SWAP2 SWAP1 SWAP2 ADD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 AND ADD SWAP1 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 JUMP JUMPDEST SWAP1 JUMP JUMPDEST DUP3 DUP2 DUP4 CALLDATACOPY POP PUSH1 0x0 SWAP2 ADD MSTORE JUMP STOP LOG2 PUSH6 0x627A7A723058 KECCAK256 XOR GAS DELEGATECALL 0xa5 0xe8 MSTORE JUMPDEST 0xc KECCAK256 SWAP9 EXTCODESIZE CALLCODE 0x2c MULMOD PUSH24 0x3A1CAB3F704716CBA4C8DA3B112601CD666C657870657269 PUSH14 0x656E74616CF50037000000000000 ",
- "sourceMap": "836:407:0:-;;;963:278;8:9:-1;5:2;;;30:1;27;20:12;5:2;963:278:0;;;;;;;;;;;;;;;;;;;;;;;;1348:20:3;162:18:55;;170:10;-1:-1:-1;;;;;;162:18:55;;;;;;-1:-1:-1;1795:31:7;;;;;-1:-1:-1;;;;;1795:31:7;;;;;1836:30;;1795:31;;1836:30;;1181:14:0;;1348:20:3;;;;1836:30:7;;:14;;:30;;;;;:::i;:::-;-1:-1:-1;1876:32:7;;;;:15;;:32;;;;;:::i;:::-;-1:-1:-1;1940:30:7;:14;1967:2;1940:26;;;;;;:30;:::i;:::-;1919:51;-1:-1:-1;1999:29:7;:13;2025:2;1999:25;;;;;;:29;:::i;:::-;2038:11;:37;;-1:-1:-1;;;;;2038:37:7;;;-1:-1:-1;;;;;;2038:37:7;;;;;;;2085:9;:33;;;;;;;;;;;;;;;-1:-1:-1;2038:37:7;1371:8:3;930:32:7;;;;;;;;;;;;;;;;1371:37:3;;;:8;;;;;-1:-1:-1;1371:22:3;;-1:-1:-1;1371:37:3;;-1:-1:-1;930:32:7;1371:37:3;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1371:37:3;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1371:37:3;;;;;;;101:4:-1;97:9;90:4;84;80:15;76:31;69:5;65:43;126:6;120:4;113:20;0:138;1371:37:3;;;;;;;;;1348:60;-1:-1:-1;;;;;;1439:26:3;;;;1418:97;;;;;;;;;;;;;;;;;;;;;;1525:11;;:43;;;;;-1:-1:-1;;;;;1525:11:3;;;;:19;;:43;;1545:12;;-1:-1:-1;;1103:10:7;1525:43:3;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1525:43:3;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1525:43:3;;;;;;;101:4:-1;97:9;90:4;84;80:15;76:31;69:5;65:43;126:6;120:4;113:20;0:138;1525:43:3;;;;;;;;;-1:-1:-1;1578:9:3;;:41;;;;;-1:-1:-1;;;;;1578:9:3;;;;:17;;:41;;1596:12;;-1:-1:-1;;1103:10:7;1578:41:3;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1578:41:3;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1578:41:3;;;;;;;101:4:-1;97:9;90:4;84;80:15;76:31;69:5;65:43;126:6;120:4;113:20;0:138;1578:41:3;;;;;;;;;;1304:322;963:278:0;;;836:407;;10268:886:53;10389:14;10452:5;10460:2;10452:10;10440:1;:8;:22;;10419:135;;;;;;;;;;;;;;;;-1:-1:-1;10801:2:53;11056:13;;;;;11050:20;10792:11;;;-1:-1:-1;;;;;11046:69:53;10268:886;;;;;:::o;836:407:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;836:407:0;;;-1:-1:-1;836:407:0;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;:::o;5:122:-1:-;;83:39;114:6;108:13;83:39;;;74:48;68:59;-1:-1;;;68:59;134:116;;209:36;237:6;231:13;209:36;;258:442;;363:4;351:17;;347:27;-1:-1;337:2;;388:1;385;378:12;337:2;418:6;412:13;440:64;455:48;496:6;455:48;;;440:64;;;431:73;;524:6;517:5;510:21;560:4;552:6;548:17;593:4;586:5;582:16;628:3;619:6;614:3;610:16;607:25;604:2;;;645:1;642;635:12;604:2;655:39;687:6;682:3;677;655:39;;;330:370;;;;;;;;708:263;;823:2;811:9;802:7;798:23;794:32;791:2;;;839:1;836;829:12;791:2;874:1;891:64;947:7;927:9;891:64;;;881:74;785:186;-1:-1;;;;785:186;978:729;;;;1145:2;1133:9;1124:7;1120:23;1116:32;1113:2;;;1161:1;1158;1151:12;1113:2;1196:1;1213:64;1269:7;1249:9;1213:64;;;1203:74;;1175:108;1335:2;1324:9;1320:18;1314:25;-1:-1;;;;;1351:6;1348:30;1345:2;;;1391:1;1388;1381:12;1345:2;1411:73;1476:7;1467:6;1456:9;1452:22;1411:73;;;1401:83;;1293:197;1542:2;1531:9;1527:18;1521:25;-1:-1;;;;;1558:6;1555:30;1552:2;;;1598:1;1595;1588:12;1552:2;1618:73;1683:7;1674:6;1663:9;1659:22;1618:73;;;1608:83;;1500:197;1107:600;;;;;;1714:257;;1826:2;1814:9;1805:7;1801:23;1797:32;1794:2;;;1842:1;1839;1832:12;1794:2;1877:1;1894:61;1947:7;1927:9;1894:61;;1978:110;2051:31;2076:5;2051:31;;;2046:3;2039:44;2033:55;;;2095:107;2166:30;2190:5;2166:30;;2210:397;2365:2;2353:15;;2402:66;2397:2;2388:12;;2381:88;2503:66;2498:2;2489:12;;2482:88;2598:2;2589:12;;2346:261;2616:296;2771:2;2759:15;;2808:66;2803:2;2794:12;;2787:88;2903:2;2894:12;;2752:160;2920:110;2993:31;3018:5;2993:31;;3037:294;3173:2;3158:18;;3187:61;3162:9;3221:6;3187:61;;;3259:62;3317:2;3306:9;3302:18;3293:6;3259:62;;3338:189;3444:2;3429:18;;3458:59;3433:9;3490:6;3458:59;;3534:387;3715:2;3729:47;;;3700:18;;3790:121;3700:18;3790:121;;3928:387;4109:2;4123:47;;;4094:18;;4184:121;4094:18;4184:121;;4322:256;4384:2;4378:9;4410:17;;;-1:-1;;;;;4470:34;;4506:22;;;4467:62;4464:2;;;4542:1;4539;4532:12;4464:2;4558;4551:22;4362:216;;-1:-1;4362:216;4585:258;;-1:-1;;;;;4720:6;4717:30;4714:2;;;4760:1;4757;4750:12;4714:2;-1:-1;4833:4;4804;4781:17;;;;-1:-1;;4777:33;4823:15;;4651:192;4850:128;-1:-1;;;;;4919:54;;4902:76;4985:151;5064:66;5053:78;;5036:100;5364:92;5437:13;5430:21;;5413:43;5464:268;5529:1;5536:101;5550:6;5547:1;5544:13;5536:101;;;5617:11;;;5611:18;5598:11;;;5591:39;5572:2;5565:10;5536:101;;;5652:6;5649:1;5646:13;5643:2;;;5717:1;5708:6;5703:3;5699:16;5692:27;5643:2;5513:219;;;;;;836:407:0;;;;;;"
- },
- "deployedBytecode": {
- "linkReferences": {},
- "object": "0x60806040526004361061006c5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166318978e8281146100c8578063630f1e6c146100f25780638da5cb5b146101125780639395525c14610134578063f2fde38b14610147575b60025473ffffffffffffffffffffffffffffffffffffffff1633146100c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612337565b60405180910390fd5b005b6100db6100d6366004611da0565b610167565b6040516100e9929190612437565b60405180910390f35b3480156100fe57600080fd5b506100c661010d366004611e9b565b6102f7565b34801561011e57600080fd5b50610127610388565b6040516100e991906122e6565b6100db610142366004611cba565b6103a4565b34801561015357600080fd5b506100c6610162366004611c94565b61050a565b61016f6119a9565b6101776119a9565b6000806101826105bb565b60048054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610100600188161502019095169490940493840181900481028201810190925282815261025c939092909183018282801561022d5780601f106102025761010080835404028352916020019161022d565b820191906000526020600020905b81548152906001019060200180831161021057829003601f168201915b50505050508c600081518110151561024157fe5b6020908102909101015161014001519063ffffffff61069616565b156102875761026c8b8b8b6107c3565b935061028084600001518560600151610acb565b90506102ae565b6102928b8b8b610b0d565b9350836060015191506102a68883896107c3565b845190935090505b6102c2846020015184602001518888610d1f565b6102e98b60008151811015156102d457fe5b90602001906020020151610140015182610f33565b505097509795505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610348576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123e7565b61038383838080601f01602080910402602001604051908101604052809392919081815260200183838082843750879450610f339350505050565b505050565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b6103ac6119a9565b6103b46119a9565b60008060006103c16105bb565b60048054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101006001881615020190951694909404938401819004810282018101909252828152610441939092909183018282801561022d5780601f106102025761010080835404028352916020019161022d565b156104925761046a670de0b6b3a7640000610464670de0b6b3a76400008a61104f565b34611099565b92506104778b848c6110f1565b945061048b85600001518660600151610acb565b90506104d6565b6104ad670d2f13f7789f0000670de0b6b3a764000034611099565b92506104ba8b848c6110f1565b9450846060015191506104ce89838a6107c3565b855190945090505b6104ea856020015185602001518989610d1f565b6104fc8b60008151811015156102d457fe5b505050965096945050505050565b60005473ffffffffffffffffffffffffffffffffffffffff16331461055b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123e7565b73ffffffffffffffffffffffffffffffffffffffff8116156105b857600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83161790555b50565b600034116105f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612347565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0e30db0346040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004016000604051808303818588803b15801561067b57600080fd5b505af115801561068f573d6000803e3d6000fd5b5050505050565b6000815183511480156107ba5750816040518082805190602001908083835b602083106106f257805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016106b5565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0180199092169116179052604051919093018190038120885190955088945090928392508401908083835b6020831061078757805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161074a565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060001916145b90505b92915050565b6107cb6119a9565b60608060008060008060006107de6119a9565b8a15156107ea57610abc565b6004805460408051602060026001851615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f8101849004840282018401909252818152929183018282801561088e5780601f106108635761010080835404028352916020019161088e565b820191906000526020600020905b81548152906001019060200180831161087157829003601f168201915b505060058054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101006001881615020190951694909404938401819004810282018101909252828152969e509194509250840190508282801561093d5780601f106109125761010080835404028352916020019161093d565b820191906000526020600020905b81548152906001019060200180831161092057829003601f168201915b50505050509650600095508b519450600093505b838514610a8257878c8581518110151561096757fe5b6020908102909101015161014001528b5187908d908690811061098657fe5b60209081029091010151610160015261099f8b87610acb565b9250610a068c858151811015156109b257fe5b9060200190602002015160a00151610a008e878151811015156109d157fe5b90602001906020020151608001518f888151811015156109ed57fe5b9060200190602002015160e00151610acb565b85611099565b9150610a4b8c85815181101515610a1957fe5b90602001906020020151610a2e84600161104f565b8c87815181101515610a3c57fe5b90602001906020020151611295565b9050610a57898261130d565b610a6989600001518a60600151610acb565b95508a8610610a7757610a82565b600190930192610951565b8a861015610abc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123c7565b50505050505050509392505050565b600082821115610b07576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612367565b50900390565b610b156119a9565b606080600080600080610b266119a9565b60008b6000815181101515610b3757fe5b6020908102919091018101516101400151600580546040805160026001841615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190931692909204601f8101869004860283018601909152808252929b5092909190830182828015610bef5780601f10610bc457610100808354040283529160200191610bef565b820191906000526020600020905b815481529060010190602001808311610bd257829003601f168201915b505050505096508b519550600094505b848614610ce557878c86815181101515610c1557fe5b6020908102909101015161014001528b5187908d9087908110610c3457fe5b6020908102909101015161016001528851610c50908c90610acb565b9350610c938c86815181101515610c6357fe5b9060200190602002015160a001518d87815181101515610c7f57fe5b906020019060200201516080015186611099565b9250610cbf8c86815181101515610ca657fe5b90602001906020020151848c88815181101515610a3c57fe5b9150610ccb898361130d565b5087518a8110610cda57610ce5565b600190940193610bff565b8a811015610abc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123c7565b600080808066b1a2bc2ec50000861115610d65576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123f7565b610d6f888861104f565b935034841115610dab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612357565b610db53485610acb565b9250610dca86670de0b6b3a76400008a611099565b915082821115610e06576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123d7565b6000831115610f29576002546040517f2e1a7d4d00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911690632e1a7d4d90610e65908690600401612453565b600060405180830381600087803b158015610e7f57600080fd5b505af1158015610e93573d6000803e3d6000fd5b505050506000821115610ee55760405173ffffffffffffffffffffffffffffffffffffffff86169083156108fc029084906000818181858888f19350505050158015610ee3573d6000803e3d6000fd5b505b610eef8383610acb565b90506000811115610f2957604051339082156108fc029083906000818181858888f19350505050158015610f27573d6000803e3d6000fd5b505b5050505050505050565b6000610f45838263ffffffff61136f16565b604080517f4552433230546f6b656e28616464726573732900000000000000000000000000815290519081900360130190209091507fffffffff0000000000000000000000000000000000000000000000000000000080831691161415610fb557610fb083836113dc565b610383565b604080517f455243373231546f6b656e28616464726573732c75696e7432353629000000008152905190819003601c0190207fffffffff000000000000000000000000000000000000000000000000000000008281169116141561101d57610fb083836115ca565b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123a7565b60008282018381101561108e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612397565b8091505b5092915050565b60008083116110d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612387565b6110e76110e185846116b2565b8461170d565b90505b9392505050565b6110f96119a9565b60608060008060006111096119a9565b89600081518110151561111857fe5b6020908102919091018101516101400151600580546040805160026001841615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190931692909204601f8101869004860283018601909152808252929950929091908301828280156111d05780601f106111a5576101008083540402835291602001916111d0565b820191906000526020600020905b8154815290600101906020018083116111b357829003601f168201915b5050505050945089519350600092505b82841461128857858a848151811015156111f657fe5b602090810290910101516101400152895185908b908590811061121557fe5b906020019060200201516101600181905250611235898860200151610acb565b91506112618a8481518110151561124857fe5b90602001906020020151838a86815181101515610a3c57fe5b905061126d878261130d565b6020870151891161127d57611288565b6001909201916111e0565b5050505050509392505050565b61129d6119a9565b606060006112ac868686611724565b600154815191935073ffffffffffffffffffffffffffffffffffffffff1691506080908390602082016000855af1801561130357825184526020830151602085015260408301516040850152606083015160608501525b5050509392505050565b8151815161131b919061104f565b825260208083015190820151611331919061104f565b60208301526040808301519082015161134a919061104f565b604083015260608083015190820151611363919061104f565b60609092019190915250565b6000816004018351101515156113b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612417565b5001602001517fffffffff000000000000000000000000000000000000000000000000000000001690565b6000806113f084601063ffffffff6118f616565b604080517f7472616e7366657228616464726573732c75696e7432353629000000000000008152905190819003601901812091935073ffffffffffffffffffffffffffffffffffffffff8416919061144e903390879060240161231c565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009094169390931783525181519192909182919080838360005b838110156114f25781810151838201526020016114da565b50505050905090810190601f16801561151f5780820380516001836020036101000a031916815260200191505b509150506000604051808303816000865af19250505080151561156e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123b7565b3d1561158b575060003d6020141561158b5760206000803e506000515b8015156115c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd906123b7565b50505050565b60008060018314611607576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612427565b61161884601063ffffffff6118f616565b915061162b84602463ffffffff61195716565b6040517f23b872dd00000000000000000000000000000000000000000000000000000000815290915073ffffffffffffffffffffffffffffffffffffffff8316906323b872dd90611684903090339086906004016122f4565b600060405180830381600087803b15801561169e57600080fd5b505af1158015610f29573d6000803e3d6000fd5b6000808315156116c55760009150611092565b508282028284828115156116d557fe5b041461108e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612397565b600080828481151561171b57fe5b04949350505050565b604080517fb4be83d5000000000000000000000000000000000000000000000000000000006020808301919091526060602483018181528751608485019081528884015160a48601529488015160c48501529087015160e4840152608087015161010484015260a087015161012484015260c087015161014484015260e08701516101648401526101008701516101848401526101208701516101a4840152610140870180516101c485019081526101608901516101e4860152610180905251805161020485018190529394919384936044870192849261022489019291820191601f82010460005b8181101561182b57835185526020948501949093019260010161180d565b50505050818103610160808401919091528a0151805180835260209283019291820191601f82010460005b81811015611874578351855260209485019490930192600101611856565b50505089845250848103602093840190815288518083529093918201918981019190601f82010460005b818110156118bc57835185526020948501949093019260010161189e565b5050507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08883030188525060405250505050509392505050565b600081601401835110151515611938576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612407565b50016014015173ffffffffffffffffffffffffffffffffffffffff1690565b60006107ba83836000816020018351101515156119a0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bd90612377565b50016020015190565b608060405190810160405280600081526020016000815260200160008152602001600081525090565b60006107ba82356124ef565b6000601f820183136119ef57600080fd5b8135611a026119fd82612488565b612461565b81815260209384019390925082018360005b83811015611a405781358601611a2a8882611af0565b8452506020928301929190910190600101611a14565b5050505092915050565b6000601f82018313611a5b57600080fd5b8135611a696119fd82612488565b81815260209384019390925082018360005b83811015611a405781358601611a918882611b3f565b8452506020928301929190910190600101611a7b565b600080601f83018413611ab957600080fd5b50813567ffffffffffffffff811115611ad157600080fd5b602083019150836001820283011115611ae957600080fd5b9250929050565b6000601f82018313611b0157600080fd5b8135611b0f6119fd826124a9565b91508082526020830160208301858383011115611b2b57600080fd5b611b3683828461250b565b50505092915050565b60006101808284031215611b5257600080fd5b611b5d610180612461565b90506000611b6b84846119d2565b8252506020611b7c848483016119d2565b6020830152506040611b90848285016119d2565b6040830152506060611ba4848285016119d2565b6060830152506080611bb884828501611c88565b60808301525060a0611bcc84828501611c88565b60a08301525060c0611be084828501611c88565b60c08301525060e0611bf484828501611c88565b60e083015250610100611c0984828501611c88565b61010083015250610120611c1f84828501611c88565b6101208301525061014082013567ffffffffffffffff811115611c4157600080fd5b611c4d84828501611af0565b6101408301525061016082013567ffffffffffffffff811115611c6f57600080fd5b611c7b84828501611af0565b6101608301525092915050565b60006107ba8235612508565b600060208284031215611ca657600080fd5b6000611cb284846119d2565b949350505050565b60008060008060008060c08789031215611cd357600080fd5b863567ffffffffffffffff811115611cea57600080fd5b611cf689828a01611a4a565b965050602087013567ffffffffffffffff811115611d1357600080fd5b611d1f89828a016119de565b955050604087013567ffffffffffffffff811115611d3c57600080fd5b611d4889828a01611a4a565b945050606087013567ffffffffffffffff811115611d6557600080fd5b611d7189828a016119de565b9350506080611d8289828a01611c88565b92505060a0611d9389828a016119d2565b9150509295509295509295565b600080600080600080600060e0888a031215611dbb57600080fd5b873567ffffffffffffffff811115611dd257600080fd5b611dde8a828b01611a4a565b9750506020611def8a828b01611c88565b965050604088013567ffffffffffffffff811115611e0c57600080fd5b611e188a828b016119de565b955050606088013567ffffffffffffffff811115611e3557600080fd5b611e418a828b01611a4a565b945050608088013567ffffffffffffffff811115611e5e57600080fd5b611e6a8a828b016119de565b93505060a0611e7b8a828b01611c88565b92505060c0611e8c8a828b016119d2565b91505092959891949750929550565b600080600060408486031215611eb057600080fd5b833567ffffffffffffffff811115611ec757600080fd5b611ed386828701611aa7565b93509350506020611ee686828701611c88565b9150509250925092565b611ef9816124ef565b82525050565b602381527f44454641554c545f46554e4354494f4e5f574554485f434f4e54524143545f4f60208201527f4e4c590000000000000000000000000000000000000000000000000000000000604082015260600190565b601181527f494e56414c49445f4d53475f56414c5545000000000000000000000000000000602082015260400190565b600d81527f4f564552534f4c445f5745544800000000000000000000000000000000000000602082015260400190565b601181527f55494e543235365f554e444552464c4f57000000000000000000000000000000602082015260400190565b602681527f475245415445525f4f525f455155414c5f544f5f33325f4c454e4754485f524560208201527f5155495245440000000000000000000000000000000000000000000000000000604082015260600190565b601081527f4449564953494f4e5f42595f5a45524f00000000000000000000000000000000602082015260400190565b601081527f55494e543235365f4f564552464c4f5700000000000000000000000000000000602082015260400190565b601781527f554e535550504f525445445f41535345545f50524f5859000000000000000000602082015260400190565b600f81527f5452414e534645525f4641494c45440000000000000000000000000000000000602082015260400190565b601481527f434f4d504c4554455f46494c4c5f4641494c4544000000000000000000000000602082015260400190565b601a81527f494e53554646494349454e545f4554485f52454d41494e494e47000000000000602082015260400190565b601381527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000602082015260400190565b601881527f4645455f50455243454e544147455f544f4f5f4c415247450000000000000000602082015260400190565b602681527f475245415445525f4f525f455155414c5f544f5f32305f4c454e4754485f524560208201527f5155495245440000000000000000000000000000000000000000000000000000604082015260600190565b602581527f475245415445525f4f525f455155414c5f544f5f345f4c454e4754485f52455160208201527f5549524544000000000000000000000000000000000000000000000000000000604082015260600190565b600e81527f494e56414c49445f414d4f554e54000000000000000000000000000000000000602082015260400190565b805160808301906122a884826122dd565b5060208201516122bb60208501826122dd565b5060408201516122ce60408501826122dd565b5060608201516115c460608501825b611ef981612508565b602081016107bd8284611ef0565b606081016123028286611ef0565b61230f6020830185611ef0565b611cb260408301846122dd565b6040810161232a8285611ef0565b6110ea60208301846122dd565b602080825281016107bd81611eff565b602080825281016107bd81611f55565b602080825281016107bd81611f85565b602080825281016107bd81611fb5565b602080825281016107bd81611fe5565b602080825281016107bd8161203b565b602080825281016107bd8161206b565b602080825281016107bd8161209b565b602080825281016107bd816120cb565b602080825281016107bd816120fb565b602080825281016107bd8161212b565b602080825281016107bd8161215b565b602080825281016107bd8161218b565b602080825281016107bd816121bb565b602080825281016107bd81612211565b602080825281016107bd81612267565b61010081016124468285612297565b6110ea6080830184612297565b602081016107bd82846122dd565b60405181810167ffffffffffffffff8111828210171561248057600080fd5b604052919050565b600067ffffffffffffffff82111561249f57600080fd5b5060209081020190565b600067ffffffffffffffff8211156124c057600080fd5b506020601f919091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0160190565b73ffffffffffffffffffffffffffffffffffffffff1690565b90565b828183375060009101525600a265627a7a72305820185af4a5e8525b0c20983bf22c09773a1cab3f704716cba4c8da3b112601cd666c6578706572696d656e74616cf50037",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x6C JUMPI PUSH4 0xFFFFFFFF PUSH29 0x100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD DIV AND PUSH4 0x18978E82 DUP2 EQ PUSH2 0xC8 JUMPI DUP1 PUSH4 0x630F1E6C EQ PUSH2 0xF2 JUMPI DUP1 PUSH4 0x8DA5CB5B EQ PUSH2 0x112 JUMPI DUP1 PUSH4 0x9395525C EQ PUSH2 0x134 JUMPI DUP1 PUSH4 0xF2FDE38B EQ PUSH2 0x147 JUMPI JUMPDEST PUSH1 0x2 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0xC6 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x2337 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST STOP JUMPDEST PUSH2 0xDB PUSH2 0xD6 CALLDATASIZE PUSH1 0x4 PUSH2 0x1DA0 JUMP JUMPDEST PUSH2 0x167 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xE9 SWAP3 SWAP2 SWAP1 PUSH2 0x2437 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xFE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xC6 PUSH2 0x10D CALLDATASIZE PUSH1 0x4 PUSH2 0x1E9B JUMP JUMPDEST PUSH2 0x2F7 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x11E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x127 PUSH2 0x388 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xE9 SWAP2 SWAP1 PUSH2 0x22E6 JUMP JUMPDEST PUSH2 0xDB PUSH2 0x142 CALLDATASIZE PUSH1 0x4 PUSH2 0x1CBA JUMP JUMPDEST PUSH2 0x3A4 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x153 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xC6 PUSH2 0x162 CALLDATASIZE PUSH1 0x4 PUSH2 0x1C94 JUMP JUMPDEST PUSH2 0x50A JUMP JUMPDEST PUSH2 0x16F PUSH2 0x19A9 JUMP JUMPDEST PUSH2 0x177 PUSH2 0x19A9 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x182 PUSH2 0x5BB JUMP JUMPDEST PUSH1 0x4 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 PUSH1 0x1F PUSH1 0x2 PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH2 0x100 PUSH1 0x1 DUP9 AND ISZERO MUL ADD SWAP1 SWAP6 AND SWAP5 SWAP1 SWAP5 DIV SWAP4 DUP5 ADD DUP2 SWAP1 DIV DUP2 MUL DUP3 ADD DUP2 ADD SWAP1 SWAP3 MSTORE DUP3 DUP2 MSTORE PUSH2 0x25C SWAP4 SWAP1 SWAP3 SWAP1 SWAP2 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0x22D JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x202 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x22D JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x210 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP DUP13 PUSH1 0x0 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x241 JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD MLOAD PUSH2 0x140 ADD MLOAD SWAP1 PUSH4 0xFFFFFFFF PUSH2 0x696 AND JUMP JUMPDEST ISZERO PUSH2 0x287 JUMPI PUSH2 0x26C DUP12 DUP12 DUP12 PUSH2 0x7C3 JUMP JUMPDEST SWAP4 POP PUSH2 0x280 DUP5 PUSH1 0x0 ADD MLOAD DUP6 PUSH1 0x60 ADD MLOAD PUSH2 0xACB JUMP JUMPDEST SWAP1 POP PUSH2 0x2AE JUMP JUMPDEST PUSH2 0x292 DUP12 DUP12 DUP12 PUSH2 0xB0D JUMP JUMPDEST SWAP4 POP DUP4 PUSH1 0x60 ADD MLOAD SWAP2 POP PUSH2 0x2A6 DUP9 DUP4 DUP10 PUSH2 0x7C3 JUMP JUMPDEST DUP5 MLOAD SWAP1 SWAP4 POP SWAP1 POP JUMPDEST PUSH2 0x2C2 DUP5 PUSH1 0x20 ADD MLOAD DUP5 PUSH1 0x20 ADD MLOAD DUP9 DUP9 PUSH2 0xD1F JUMP JUMPDEST PUSH2 0x2E9 DUP12 PUSH1 0x0 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x2D4 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x140 ADD MLOAD DUP3 PUSH2 0xF33 JUMP JUMPDEST POP POP SWAP8 POP SWAP8 SWAP6 POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0x348 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x23E7 JUMP JUMPDEST PUSH2 0x383 DUP4 DUP4 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY POP DUP8 SWAP5 POP PUSH2 0xF33 SWAP4 POP POP POP POP JUMP JUMPDEST POP POP POP JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH2 0x3AC PUSH2 0x19A9 JUMP JUMPDEST PUSH2 0x3B4 PUSH2 0x19A9 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH2 0x3C1 PUSH2 0x5BB JUMP JUMPDEST PUSH1 0x4 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 PUSH1 0x1F PUSH1 0x2 PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH2 0x100 PUSH1 0x1 DUP9 AND ISZERO MUL ADD SWAP1 SWAP6 AND SWAP5 SWAP1 SWAP5 DIV SWAP4 DUP5 ADD DUP2 SWAP1 DIV DUP2 MUL DUP3 ADD DUP2 ADD SWAP1 SWAP3 MSTORE DUP3 DUP2 MSTORE PUSH2 0x441 SWAP4 SWAP1 SWAP3 SWAP1 SWAP2 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0x22D JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x202 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x22D JUMP JUMPDEST ISZERO PUSH2 0x492 JUMPI PUSH2 0x46A PUSH8 0xDE0B6B3A7640000 PUSH2 0x464 PUSH8 0xDE0B6B3A7640000 DUP11 PUSH2 0x104F JUMP JUMPDEST CALLVALUE PUSH2 0x1099 JUMP JUMPDEST SWAP3 POP PUSH2 0x477 DUP12 DUP5 DUP13 PUSH2 0x10F1 JUMP JUMPDEST SWAP5 POP PUSH2 0x48B DUP6 PUSH1 0x0 ADD MLOAD DUP7 PUSH1 0x60 ADD MLOAD PUSH2 0xACB JUMP JUMPDEST SWAP1 POP PUSH2 0x4D6 JUMP JUMPDEST PUSH2 0x4AD PUSH8 0xD2F13F7789F0000 PUSH8 0xDE0B6B3A7640000 CALLVALUE PUSH2 0x1099 JUMP JUMPDEST SWAP3 POP PUSH2 0x4BA DUP12 DUP5 DUP13 PUSH2 0x10F1 JUMP JUMPDEST SWAP5 POP DUP5 PUSH1 0x60 ADD MLOAD SWAP2 POP PUSH2 0x4CE DUP10 DUP4 DUP11 PUSH2 0x7C3 JUMP JUMPDEST DUP6 MLOAD SWAP1 SWAP5 POP SWAP1 POP JUMPDEST PUSH2 0x4EA DUP6 PUSH1 0x20 ADD MLOAD DUP6 PUSH1 0x20 ADD MLOAD DUP10 DUP10 PUSH2 0xD1F JUMP JUMPDEST PUSH2 0x4FC DUP12 PUSH1 0x0 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x2D4 JUMPI INVALID JUMPDEST POP POP POP SWAP7 POP SWAP7 SWAP5 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER EQ PUSH2 0x55B JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x23E7 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND ISZERO PUSH2 0x5B8 JUMPI PUSH1 0x0 DUP1 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000 AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND OR SWAP1 SSTORE JUMPDEST POP JUMP JUMPDEST PUSH1 0x0 CALLVALUE GT PUSH2 0x5F5 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x2347 JUMP JUMPDEST PUSH1 0x2 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0xD0E30DB0 CALLVALUE PUSH1 0x40 MLOAD DUP3 PUSH4 0xFFFFFFFF AND PUSH29 0x100000000000000000000000000000000000000000000000000000000 MUL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP6 DUP9 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x67B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x68F JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD DUP4 MLOAD EQ DUP1 ISZERO PUSH2 0x7BA JUMPI POP DUP2 PUSH1 0x40 MLOAD DUP1 DUP3 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT PUSH2 0x6F2 JUMPI DUP1 MLOAD DUP3 MSTORE PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 SWAP1 SWAP3 ADD SWAP2 PUSH1 0x20 SWAP2 DUP3 ADD SWAP2 ADD PUSH2 0x6B5 JUMP JUMPDEST MLOAD DUP2 MLOAD PUSH1 0x20 SWAP4 DUP5 SUB PUSH2 0x100 EXP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD DUP1 NOT SWAP1 SWAP3 AND SWAP2 AND OR SWAP1 MSTORE PUSH1 0x40 MLOAD SWAP2 SWAP1 SWAP4 ADD DUP2 SWAP1 SUB DUP2 KECCAK256 DUP9 MLOAD SWAP1 SWAP6 POP DUP9 SWAP5 POP SWAP1 SWAP3 DUP4 SWAP3 POP DUP5 ADD SWAP1 DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT PUSH2 0x787 JUMPI DUP1 MLOAD DUP3 MSTORE PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 SWAP1 SWAP3 ADD SWAP2 PUSH1 0x20 SWAP2 DUP3 ADD SWAP2 ADD PUSH2 0x74A JUMP JUMPDEST PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB DUP1 NOT DUP3 MLOAD AND DUP2 DUP5 MLOAD AND DUP1 DUP3 OR DUP6 MSTORE POP POP POP POP POP POP SWAP1 POP ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 KECCAK256 PUSH1 0x0 NOT AND EQ JUMPDEST SWAP1 POP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x7CB PUSH2 0x19A9 JUMP JUMPDEST PUSH1 0x60 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 PUSH2 0x7DE PUSH2 0x19A9 JUMP JUMPDEST DUP11 ISZERO ISZERO PUSH2 0x7EA JUMPI PUSH2 0xABC JUMP JUMPDEST PUSH1 0x4 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 PUSH1 0x2 PUSH1 0x1 DUP6 AND ISZERO PUSH2 0x100 MUL PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 SWAP5 AND SWAP4 SWAP1 SWAP4 DIV PUSH1 0x1F DUP2 ADD DUP5 SWAP1 DIV DUP5 MUL DUP3 ADD DUP5 ADD SWAP1 SWAP3 MSTORE DUP2 DUP2 MSTORE SWAP3 SWAP2 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0x88E JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x863 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x88E JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x871 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP PUSH1 0x5 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 PUSH1 0x1F PUSH1 0x2 PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH2 0x100 PUSH1 0x1 DUP9 AND ISZERO MUL ADD SWAP1 SWAP6 AND SWAP5 SWAP1 SWAP5 DIV SWAP4 DUP5 ADD DUP2 SWAP1 DIV DUP2 MUL DUP3 ADD DUP2 ADD SWAP1 SWAP3 MSTORE DUP3 DUP2 MSTORE SWAP7 SWAP15 POP SWAP2 SWAP5 POP SWAP3 POP DUP5 ADD SWAP1 POP DUP3 DUP3 DUP1 ISZERO PUSH2 0x93D JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x912 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x93D JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x920 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP7 POP PUSH1 0x0 SWAP6 POP DUP12 MLOAD SWAP5 POP PUSH1 0x0 SWAP4 POP JUMPDEST DUP4 DUP6 EQ PUSH2 0xA82 JUMPI DUP8 DUP13 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x967 JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD MLOAD PUSH2 0x140 ADD MSTORE DUP12 MLOAD DUP8 SWAP1 DUP14 SWAP1 DUP7 SWAP1 DUP2 LT PUSH2 0x986 JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD MLOAD PUSH2 0x160 ADD MSTORE PUSH2 0x99F DUP12 DUP8 PUSH2 0xACB JUMP JUMPDEST SWAP3 POP PUSH2 0xA06 DUP13 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x9B2 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH1 0xA0 ADD MLOAD PUSH2 0xA00 DUP15 DUP8 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x9D1 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH1 0x80 ADD MLOAD DUP16 DUP9 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x9ED JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH1 0xE0 ADD MLOAD PUSH2 0xACB JUMP JUMPDEST DUP6 PUSH2 0x1099 JUMP JUMPDEST SWAP2 POP PUSH2 0xA4B DUP13 DUP6 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xA19 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0xA2E DUP5 PUSH1 0x1 PUSH2 0x104F JUMP JUMPDEST DUP13 DUP8 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xA3C JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x1295 JUMP JUMPDEST SWAP1 POP PUSH2 0xA57 DUP10 DUP3 PUSH2 0x130D JUMP JUMPDEST PUSH2 0xA69 DUP10 PUSH1 0x0 ADD MLOAD DUP11 PUSH1 0x60 ADD MLOAD PUSH2 0xACB JUMP JUMPDEST SWAP6 POP DUP11 DUP7 LT PUSH2 0xA77 JUMPI PUSH2 0xA82 JUMP JUMPDEST PUSH1 0x1 SWAP1 SWAP4 ADD SWAP3 PUSH2 0x951 JUMP JUMPDEST DUP11 DUP7 LT ISZERO PUSH2 0xABC JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x23C7 JUMP JUMPDEST POP POP POP POP POP POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 GT ISZERO PUSH2 0xB07 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x2367 JUMP JUMPDEST POP SWAP1 SUB SWAP1 JUMP JUMPDEST PUSH2 0xB15 PUSH2 0x19A9 JUMP JUMPDEST PUSH1 0x60 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH2 0xB26 PUSH2 0x19A9 JUMP JUMPDEST PUSH1 0x0 DUP12 PUSH1 0x0 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xB37 JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP2 SWAP1 SWAP2 ADD DUP2 ADD MLOAD PUSH2 0x140 ADD MLOAD PUSH1 0x5 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x2 PUSH1 0x1 DUP5 AND ISZERO PUSH2 0x100 MUL PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 SWAP4 AND SWAP3 SWAP1 SWAP3 DIV PUSH1 0x1F DUP2 ADD DUP7 SWAP1 DIV DUP7 MUL DUP4 ADD DUP7 ADD SWAP1 SWAP2 MSTORE DUP1 DUP3 MSTORE SWAP3 SWAP12 POP SWAP3 SWAP1 SWAP2 SWAP1 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0xBEF JUMPI DUP1 PUSH1 0x1F LT PUSH2 0xBC4 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0xBEF JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0xBD2 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP7 POP DUP12 MLOAD SWAP6 POP PUSH1 0x0 SWAP5 POP JUMPDEST DUP5 DUP7 EQ PUSH2 0xCE5 JUMPI DUP8 DUP13 DUP7 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xC15 JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD MLOAD PUSH2 0x140 ADD MSTORE DUP12 MLOAD DUP8 SWAP1 DUP14 SWAP1 DUP8 SWAP1 DUP2 LT PUSH2 0xC34 JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD MLOAD PUSH2 0x160 ADD MSTORE DUP9 MLOAD PUSH2 0xC50 SWAP1 DUP13 SWAP1 PUSH2 0xACB JUMP JUMPDEST SWAP4 POP PUSH2 0xC93 DUP13 DUP7 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xC63 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH1 0xA0 ADD MLOAD DUP14 DUP8 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xC7F JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH1 0x80 ADD MLOAD DUP7 PUSH2 0x1099 JUMP JUMPDEST SWAP3 POP PUSH2 0xCBF DUP13 DUP7 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xCA6 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP5 DUP13 DUP9 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xA3C JUMPI INVALID JUMPDEST SWAP2 POP PUSH2 0xCCB DUP10 DUP4 PUSH2 0x130D JUMP JUMPDEST POP DUP8 MLOAD DUP11 DUP2 LT PUSH2 0xCDA JUMPI PUSH2 0xCE5 JUMP JUMPDEST PUSH1 0x1 SWAP1 SWAP5 ADD SWAP4 PUSH2 0xBFF JUMP JUMPDEST DUP11 DUP2 LT ISZERO PUSH2 0xABC JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x23C7 JUMP JUMPDEST PUSH1 0x0 DUP1 DUP1 DUP1 PUSH7 0xB1A2BC2EC50000 DUP7 GT ISZERO PUSH2 0xD65 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x23F7 JUMP JUMPDEST PUSH2 0xD6F DUP9 DUP9 PUSH2 0x104F JUMP JUMPDEST SWAP4 POP CALLVALUE DUP5 GT ISZERO PUSH2 0xDAB JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x2357 JUMP JUMPDEST PUSH2 0xDB5 CALLVALUE DUP6 PUSH2 0xACB JUMP JUMPDEST SWAP3 POP PUSH2 0xDCA DUP7 PUSH8 0xDE0B6B3A7640000 DUP11 PUSH2 0x1099 JUMP JUMPDEST SWAP2 POP DUP3 DUP3 GT ISZERO PUSH2 0xE06 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x23D7 JUMP JUMPDEST PUSH1 0x0 DUP4 GT ISZERO PUSH2 0xF29 JUMPI PUSH1 0x2 SLOAD PUSH1 0x40 MLOAD PUSH32 0x2E1A7D4D00000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP2 AND SWAP1 PUSH4 0x2E1A7D4D SWAP1 PUSH2 0xE65 SWAP1 DUP7 SWAP1 PUSH1 0x4 ADD PUSH2 0x2453 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0xE7F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0xE93 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x0 DUP3 GT ISZERO PUSH2 0xEE5 JUMPI PUSH1 0x40 MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP7 AND SWAP1 DUP4 ISZERO PUSH2 0x8FC MUL SWAP1 DUP5 SWAP1 PUSH1 0x0 DUP2 DUP2 DUP2 DUP6 DUP9 DUP9 CALL SWAP4 POP POP POP POP ISZERO DUP1 ISZERO PUSH2 0xEE3 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP JUMPDEST PUSH2 0xEEF DUP4 DUP4 PUSH2 0xACB JUMP JUMPDEST SWAP1 POP PUSH1 0x0 DUP2 GT ISZERO PUSH2 0xF29 JUMPI PUSH1 0x40 MLOAD CALLER SWAP1 DUP3 ISZERO PUSH2 0x8FC MUL SWAP1 DUP4 SWAP1 PUSH1 0x0 DUP2 DUP2 DUP2 DUP6 DUP9 DUP9 CALL SWAP4 POP POP POP POP ISZERO DUP1 ISZERO PUSH2 0xF27 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP JUMPDEST POP POP POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0xF45 DUP4 DUP3 PUSH4 0xFFFFFFFF PUSH2 0x136F AND JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0x4552433230546F6B656E28616464726573732900000000000000000000000000 DUP2 MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x13 ADD SWAP1 KECCAK256 SWAP1 SWAP2 POP PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 DUP1 DUP4 AND SWAP2 AND EQ ISZERO PUSH2 0xFB5 JUMPI PUSH2 0xFB0 DUP4 DUP4 PUSH2 0x13DC JUMP JUMPDEST PUSH2 0x383 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0x455243373231546F6B656E28616464726573732C75696E743235362900000000 DUP2 MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x1C ADD SWAP1 KECCAK256 PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 DUP3 DUP2 AND SWAP2 AND EQ ISZERO PUSH2 0x101D JUMPI PUSH2 0xFB0 DUP4 DUP4 PUSH2 0x15CA JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x23A7 JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 ADD DUP4 DUP2 LT ISZERO PUSH2 0x108E JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x2397 JUMP JUMPDEST DUP1 SWAP2 POP JUMPDEST POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP4 GT PUSH2 0x10D4 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x2387 JUMP JUMPDEST PUSH2 0x10E7 PUSH2 0x10E1 DUP6 DUP5 PUSH2 0x16B2 JUMP JUMPDEST DUP5 PUSH2 0x170D JUMP JUMPDEST SWAP1 POP JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH2 0x10F9 PUSH2 0x19A9 JUMP JUMPDEST PUSH1 0x60 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 PUSH2 0x1109 PUSH2 0x19A9 JUMP JUMPDEST DUP10 PUSH1 0x0 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1118 JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP2 SWAP1 SWAP2 ADD DUP2 ADD MLOAD PUSH2 0x140 ADD MLOAD PUSH1 0x5 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x2 PUSH1 0x1 DUP5 AND ISZERO PUSH2 0x100 MUL PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 SWAP4 AND SWAP3 SWAP1 SWAP3 DIV PUSH1 0x1F DUP2 ADD DUP7 SWAP1 DIV DUP7 MUL DUP4 ADD DUP7 ADD SWAP1 SWAP2 MSTORE DUP1 DUP3 MSTORE SWAP3 SWAP10 POP SWAP3 SWAP1 SWAP2 SWAP1 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0x11D0 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x11A5 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x11D0 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x11B3 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP5 POP DUP10 MLOAD SWAP4 POP PUSH1 0x0 SWAP3 POP JUMPDEST DUP3 DUP5 EQ PUSH2 0x1288 JUMPI DUP6 DUP11 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x11F6 JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD MLOAD PUSH2 0x140 ADD MSTORE DUP10 MLOAD DUP6 SWAP1 DUP12 SWAP1 DUP6 SWAP1 DUP2 LT PUSH2 0x1215 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x160 ADD DUP2 SWAP1 MSTORE POP PUSH2 0x1235 DUP10 DUP9 PUSH1 0x20 ADD MLOAD PUSH2 0xACB JUMP JUMPDEST SWAP2 POP PUSH2 0x1261 DUP11 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x1248 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP4 DUP11 DUP7 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xA3C JUMPI INVALID JUMPDEST SWAP1 POP PUSH2 0x126D DUP8 DUP3 PUSH2 0x130D JUMP JUMPDEST PUSH1 0x20 DUP8 ADD MLOAD DUP10 GT PUSH2 0x127D JUMPI PUSH2 0x1288 JUMP JUMPDEST PUSH1 0x1 SWAP1 SWAP3 ADD SWAP2 PUSH2 0x11E0 JUMP JUMPDEST POP POP POP POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH2 0x129D PUSH2 0x19A9 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x0 PUSH2 0x12AC DUP7 DUP7 DUP7 PUSH2 0x1724 JUMP JUMPDEST PUSH1 0x1 SLOAD DUP2 MLOAD SWAP2 SWAP4 POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP2 POP PUSH1 0x80 SWAP1 DUP4 SWAP1 PUSH1 0x20 DUP3 ADD PUSH1 0x0 DUP6 GAS CALL DUP1 ISZERO PUSH2 0x1303 JUMPI DUP3 MLOAD DUP5 MSTORE PUSH1 0x20 DUP4 ADD MLOAD PUSH1 0x20 DUP6 ADD MSTORE PUSH1 0x40 DUP4 ADD MLOAD PUSH1 0x40 DUP6 ADD MSTORE PUSH1 0x60 DUP4 ADD MLOAD PUSH1 0x60 DUP6 ADD MSTORE JUMPDEST POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST DUP2 MLOAD DUP2 MLOAD PUSH2 0x131B SWAP2 SWAP1 PUSH2 0x104F JUMP JUMPDEST DUP3 MSTORE PUSH1 0x20 DUP1 DUP4 ADD MLOAD SWAP1 DUP3 ADD MLOAD PUSH2 0x1331 SWAP2 SWAP1 PUSH2 0x104F JUMP JUMPDEST PUSH1 0x20 DUP4 ADD MSTORE PUSH1 0x40 DUP1 DUP4 ADD MLOAD SWAP1 DUP3 ADD MLOAD PUSH2 0x134A SWAP2 SWAP1 PUSH2 0x104F JUMP JUMPDEST PUSH1 0x40 DUP4 ADD MSTORE PUSH1 0x60 DUP1 DUP4 ADD MLOAD SWAP1 DUP3 ADD MLOAD PUSH2 0x1363 SWAP2 SWAP1 PUSH2 0x104F JUMP JUMPDEST PUSH1 0x60 SWAP1 SWAP3 ADD SWAP2 SWAP1 SWAP2 MSTORE POP JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x4 ADD DUP4 MLOAD LT ISZERO ISZERO ISZERO PUSH2 0x13B1 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x2417 JUMP JUMPDEST POP ADD PUSH1 0x20 ADD MLOAD PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 AND SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x13F0 DUP5 PUSH1 0x10 PUSH4 0xFFFFFFFF PUSH2 0x18F6 AND JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0x7472616E7366657228616464726573732C75696E743235362900000000000000 DUP2 MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x19 ADD DUP2 KECCAK256 SWAP2 SWAP4 POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND SWAP2 SWAP1 PUSH2 0x144E SWAP1 CALLER SWAP1 DUP8 SWAP1 PUSH1 0x24 ADD PUSH2 0x231C JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 DUP2 DUP5 SUB ADD DUP2 MSTORE SWAP2 DUP2 MSTORE PUSH1 0x20 DUP3 ADD DUP1 MLOAD PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 SWAP1 SWAP5 AND SWAP4 SWAP1 SWAP4 OR DUP4 MSTORE MLOAD DUP2 MLOAD SWAP2 SWAP3 SWAP1 SWAP2 DUP3 SWAP2 SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x14F2 JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH2 0x14DA JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x151F JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP2 POP POP PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP7 GAS CALL SWAP3 POP POP POP DUP1 ISZERO ISZERO PUSH2 0x156E JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x23B7 JUMP JUMPDEST RETURNDATASIZE ISZERO PUSH2 0x158B JUMPI POP PUSH1 0x0 RETURNDATASIZE PUSH1 0x20 EQ ISZERO PUSH2 0x158B JUMPI PUSH1 0x20 PUSH1 0x0 DUP1 RETURNDATACOPY POP PUSH1 0x0 MLOAD JUMPDEST DUP1 ISZERO ISZERO PUSH2 0x15C4 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x23B7 JUMP JUMPDEST POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x1 DUP4 EQ PUSH2 0x1607 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x2427 JUMP JUMPDEST PUSH2 0x1618 DUP5 PUSH1 0x10 PUSH4 0xFFFFFFFF PUSH2 0x18F6 AND JUMP JUMPDEST SWAP2 POP PUSH2 0x162B DUP5 PUSH1 0x24 PUSH4 0xFFFFFFFF PUSH2 0x1957 AND JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH32 0x23B872DD00000000000000000000000000000000000000000000000000000000 DUP2 MSTORE SWAP1 SWAP2 POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND SWAP1 PUSH4 0x23B872DD SWAP1 PUSH2 0x1684 SWAP1 ADDRESS SWAP1 CALLER SWAP1 DUP7 SWAP1 PUSH1 0x4 ADD PUSH2 0x22F4 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x169E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0xF29 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST PUSH1 0x0 DUP1 DUP4 ISZERO ISZERO PUSH2 0x16C5 JUMPI PUSH1 0x0 SWAP2 POP PUSH2 0x1092 JUMP JUMPDEST POP DUP3 DUP3 MUL DUP3 DUP5 DUP3 DUP2 ISZERO ISZERO PUSH2 0x16D5 JUMPI INVALID JUMPDEST DIV EQ PUSH2 0x108E JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x2397 JUMP JUMPDEST PUSH1 0x0 DUP1 DUP3 DUP5 DUP2 ISZERO ISZERO PUSH2 0x171B JUMPI INVALID JUMPDEST DIV SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0xB4BE83D500000000000000000000000000000000000000000000000000000000 PUSH1 0x20 DUP1 DUP4 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x60 PUSH1 0x24 DUP4 ADD DUP2 DUP2 MSTORE DUP8 MLOAD PUSH1 0x84 DUP6 ADD SWAP1 DUP2 MSTORE DUP9 DUP5 ADD MLOAD PUSH1 0xA4 DUP7 ADD MSTORE SWAP5 DUP9 ADD MLOAD PUSH1 0xC4 DUP6 ADD MSTORE SWAP1 DUP8 ADD MLOAD PUSH1 0xE4 DUP5 ADD MSTORE PUSH1 0x80 DUP8 ADD MLOAD PUSH2 0x104 DUP5 ADD MSTORE PUSH1 0xA0 DUP8 ADD MLOAD PUSH2 0x124 DUP5 ADD MSTORE PUSH1 0xC0 DUP8 ADD MLOAD PUSH2 0x144 DUP5 ADD MSTORE PUSH1 0xE0 DUP8 ADD MLOAD PUSH2 0x164 DUP5 ADD MSTORE PUSH2 0x100 DUP8 ADD MLOAD PUSH2 0x184 DUP5 ADD MSTORE PUSH2 0x120 DUP8 ADD MLOAD PUSH2 0x1A4 DUP5 ADD MSTORE PUSH2 0x140 DUP8 ADD DUP1 MLOAD PUSH2 0x1C4 DUP6 ADD SWAP1 DUP2 MSTORE PUSH2 0x160 DUP10 ADD MLOAD PUSH2 0x1E4 DUP7 ADD MSTORE PUSH2 0x180 SWAP1 MSTORE MLOAD DUP1 MLOAD PUSH2 0x204 DUP6 ADD DUP2 SWAP1 MSTORE SWAP4 SWAP5 SWAP2 SWAP4 DUP5 SWAP4 PUSH1 0x44 DUP8 ADD SWAP3 DUP5 SWAP3 PUSH2 0x224 DUP10 ADD SWAP3 SWAP2 DUP3 ADD SWAP2 PUSH1 0x1F DUP3 ADD DIV PUSH1 0x0 JUMPDEST DUP2 DUP2 LT ISZERO PUSH2 0x182B JUMPI DUP4 MLOAD DUP6 MSTORE PUSH1 0x20 SWAP5 DUP6 ADD SWAP5 SWAP1 SWAP4 ADD SWAP3 PUSH1 0x1 ADD PUSH2 0x180D JUMP JUMPDEST POP POP POP POP DUP2 DUP2 SUB PUSH2 0x160 DUP1 DUP5 ADD SWAP2 SWAP1 SWAP2 MSTORE DUP11 ADD MLOAD DUP1 MLOAD DUP1 DUP4 MSTORE PUSH1 0x20 SWAP3 DUP4 ADD SWAP3 SWAP2 DUP3 ADD SWAP2 PUSH1 0x1F DUP3 ADD DIV PUSH1 0x0 JUMPDEST DUP2 DUP2 LT ISZERO PUSH2 0x1874 JUMPI DUP4 MLOAD DUP6 MSTORE PUSH1 0x20 SWAP5 DUP6 ADD SWAP5 SWAP1 SWAP4 ADD SWAP3 PUSH1 0x1 ADD PUSH2 0x1856 JUMP JUMPDEST POP POP POP DUP10 DUP5 MSTORE POP DUP5 DUP2 SUB PUSH1 0x20 SWAP4 DUP5 ADD SWAP1 DUP2 MSTORE DUP9 MLOAD DUP1 DUP4 MSTORE SWAP1 SWAP4 SWAP2 DUP3 ADD SWAP2 DUP10 DUP2 ADD SWAP2 SWAP1 PUSH1 0x1F DUP3 ADD DIV PUSH1 0x0 JUMPDEST DUP2 DUP2 LT ISZERO PUSH2 0x18BC JUMPI DUP4 MLOAD DUP6 MSTORE PUSH1 0x20 SWAP5 DUP6 ADD SWAP5 SWAP1 SWAP4 ADD SWAP3 PUSH1 0x1 ADD PUSH2 0x189E JUMP JUMPDEST POP POP POP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 DUP9 DUP4 SUB ADD DUP9 MSTORE POP PUSH1 0x40 MSTORE POP POP POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x14 ADD DUP4 MLOAD LT ISZERO ISZERO ISZERO PUSH2 0x1938 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x2407 JUMP JUMPDEST POP ADD PUSH1 0x14 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x7BA DUP4 DUP4 PUSH1 0x0 DUP2 PUSH1 0x20 ADD DUP4 MLOAD LT ISZERO ISZERO ISZERO PUSH2 0x19A0 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xBD SWAP1 PUSH2 0x2377 JUMP JUMPDEST POP ADD PUSH1 0x20 ADD MLOAD SWAP1 JUMP JUMPDEST PUSH1 0x80 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE POP SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x7BA DUP3 CALLDATALOAD PUSH2 0x24EF JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH2 0x19EF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0x1A02 PUSH2 0x19FD DUP3 PUSH2 0x2488 JUMP JUMPDEST PUSH2 0x2461 JUMP JUMPDEST DUP2 DUP2 MSTORE PUSH1 0x20 SWAP4 DUP5 ADD SWAP4 SWAP1 SWAP3 POP DUP3 ADD DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x1A40 JUMPI DUP2 CALLDATALOAD DUP7 ADD PUSH2 0x1A2A DUP9 DUP3 PUSH2 0x1AF0 JUMP JUMPDEST DUP5 MSTORE POP PUSH1 0x20 SWAP3 DUP4 ADD SWAP3 SWAP2 SWAP1 SWAP2 ADD SWAP1 PUSH1 0x1 ADD PUSH2 0x1A14 JUMP JUMPDEST POP POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH2 0x1A5B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0x1A69 PUSH2 0x19FD DUP3 PUSH2 0x2488 JUMP JUMPDEST DUP2 DUP2 MSTORE PUSH1 0x20 SWAP4 DUP5 ADD SWAP4 SWAP1 SWAP3 POP DUP3 ADD DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x1A40 JUMPI DUP2 CALLDATALOAD DUP7 ADD PUSH2 0x1A91 DUP9 DUP3 PUSH2 0x1B3F JUMP JUMPDEST DUP5 MSTORE POP PUSH1 0x20 SWAP3 DUP4 ADD SWAP3 SWAP2 SWAP1 SWAP2 ADD SWAP1 PUSH1 0x1 ADD PUSH2 0x1A7B JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x1F DUP4 ADD DUP5 SGT PUSH2 0x1AB9 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP DUP2 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1AD1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x20 DUP4 ADD SWAP2 POP DUP4 PUSH1 0x1 DUP3 MUL DUP4 ADD GT ISZERO PUSH2 0x1AE9 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH2 0x1B01 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0x1B0F PUSH2 0x19FD DUP3 PUSH2 0x24A9 JUMP JUMPDEST SWAP2 POP DUP1 DUP3 MSTORE PUSH1 0x20 DUP4 ADD PUSH1 0x20 DUP4 ADD DUP6 DUP4 DUP4 ADD GT ISZERO PUSH2 0x1B2B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1B36 DUP4 DUP3 DUP5 PUSH2 0x250B JUMP JUMPDEST POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x180 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x1B52 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1B5D PUSH2 0x180 PUSH2 0x2461 JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0x1B6B DUP5 DUP5 PUSH2 0x19D2 JUMP JUMPDEST DUP3 MSTORE POP PUSH1 0x20 PUSH2 0x1B7C DUP5 DUP5 DUP4 ADD PUSH2 0x19D2 JUMP JUMPDEST PUSH1 0x20 DUP4 ADD MSTORE POP PUSH1 0x40 PUSH2 0x1B90 DUP5 DUP3 DUP6 ADD PUSH2 0x19D2 JUMP JUMPDEST PUSH1 0x40 DUP4 ADD MSTORE POP PUSH1 0x60 PUSH2 0x1BA4 DUP5 DUP3 DUP6 ADD PUSH2 0x19D2 JUMP JUMPDEST PUSH1 0x60 DUP4 ADD MSTORE POP PUSH1 0x80 PUSH2 0x1BB8 DUP5 DUP3 DUP6 ADD PUSH2 0x1C88 JUMP JUMPDEST PUSH1 0x80 DUP4 ADD MSTORE POP PUSH1 0xA0 PUSH2 0x1BCC DUP5 DUP3 DUP6 ADD PUSH2 0x1C88 JUMP JUMPDEST PUSH1 0xA0 DUP4 ADD MSTORE POP PUSH1 0xC0 PUSH2 0x1BE0 DUP5 DUP3 DUP6 ADD PUSH2 0x1C88 JUMP JUMPDEST PUSH1 0xC0 DUP4 ADD MSTORE POP PUSH1 0xE0 PUSH2 0x1BF4 DUP5 DUP3 DUP6 ADD PUSH2 0x1C88 JUMP JUMPDEST PUSH1 0xE0 DUP4 ADD MSTORE POP PUSH2 0x100 PUSH2 0x1C09 DUP5 DUP3 DUP6 ADD PUSH2 0x1C88 JUMP JUMPDEST PUSH2 0x100 DUP4 ADD MSTORE POP PUSH2 0x120 PUSH2 0x1C1F DUP5 DUP3 DUP6 ADD PUSH2 0x1C88 JUMP JUMPDEST PUSH2 0x120 DUP4 ADD MSTORE POP PUSH2 0x140 DUP3 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1C41 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1C4D DUP5 DUP3 DUP6 ADD PUSH2 0x1AF0 JUMP JUMPDEST PUSH2 0x140 DUP4 ADD MSTORE POP PUSH2 0x160 DUP3 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1C6F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1C7B DUP5 DUP3 DUP6 ADD PUSH2 0x1AF0 JUMP JUMPDEST PUSH2 0x160 DUP4 ADD MSTORE POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x7BA DUP3 CALLDATALOAD PUSH2 0x2508 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x1CA6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1CB2 DUP5 DUP5 PUSH2 0x19D2 JUMP JUMPDEST SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0xC0 DUP8 DUP10 SUB SLT ISZERO PUSH2 0x1CD3 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP7 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1CEA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1CF6 DUP10 DUP3 DUP11 ADD PUSH2 0x1A4A JUMP JUMPDEST SWAP7 POP POP PUSH1 0x20 DUP8 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1D13 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1D1F DUP10 DUP3 DUP11 ADD PUSH2 0x19DE JUMP JUMPDEST SWAP6 POP POP PUSH1 0x40 DUP8 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1D3C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1D48 DUP10 DUP3 DUP11 ADD PUSH2 0x1A4A JUMP JUMPDEST SWAP5 POP POP PUSH1 0x60 DUP8 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1D65 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1D71 DUP10 DUP3 DUP11 ADD PUSH2 0x19DE JUMP JUMPDEST SWAP4 POP POP PUSH1 0x80 PUSH2 0x1D82 DUP10 DUP3 DUP11 ADD PUSH2 0x1C88 JUMP JUMPDEST SWAP3 POP POP PUSH1 0xA0 PUSH2 0x1D93 DUP10 DUP3 DUP11 ADD PUSH2 0x19D2 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP6 POP SWAP3 SWAP6 POP SWAP3 SWAP6 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0xE0 DUP9 DUP11 SUB SLT ISZERO PUSH2 0x1DBB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP8 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1DD2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1DDE DUP11 DUP3 DUP12 ADD PUSH2 0x1A4A JUMP JUMPDEST SWAP8 POP POP PUSH1 0x20 PUSH2 0x1DEF DUP11 DUP3 DUP12 ADD PUSH2 0x1C88 JUMP JUMPDEST SWAP7 POP POP PUSH1 0x40 DUP9 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1E0C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1E18 DUP11 DUP3 DUP12 ADD PUSH2 0x19DE JUMP JUMPDEST SWAP6 POP POP PUSH1 0x60 DUP9 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1E35 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1E41 DUP11 DUP3 DUP12 ADD PUSH2 0x1A4A JUMP JUMPDEST SWAP5 POP POP PUSH1 0x80 DUP9 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1E5E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1E6A DUP11 DUP3 DUP12 ADD PUSH2 0x19DE JUMP JUMPDEST SWAP4 POP POP PUSH1 0xA0 PUSH2 0x1E7B DUP11 DUP3 DUP12 ADD PUSH2 0x1C88 JUMP JUMPDEST SWAP3 POP POP PUSH1 0xC0 PUSH2 0x1E8C DUP11 DUP3 DUP12 ADD PUSH2 0x19D2 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP6 SWAP9 SWAP2 SWAP5 SWAP8 POP SWAP3 SWAP6 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x40 DUP5 DUP7 SUB SLT ISZERO PUSH2 0x1EB0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP4 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1EC7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1ED3 DUP7 DUP3 DUP8 ADD PUSH2 0x1AA7 JUMP JUMPDEST SWAP4 POP SWAP4 POP POP PUSH1 0x20 PUSH2 0x1EE6 DUP7 DUP3 DUP8 ADD PUSH2 0x1C88 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 POP SWAP3 JUMP JUMPDEST PUSH2 0x1EF9 DUP2 PUSH2 0x24EF JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x23 DUP2 MSTORE PUSH32 0x44454641554C545F46554E4354494F4E5F574554485F434F4E54524143545F4F PUSH1 0x20 DUP3 ADD MSTORE PUSH32 0x4E4C590000000000000000000000000000000000000000000000000000000000 PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x60 ADD SWAP1 JUMP JUMPDEST PUSH1 0x11 DUP2 MSTORE PUSH32 0x494E56414C49445F4D53475F56414C5545000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0xD DUP2 MSTORE PUSH32 0x4F564552534F4C445F5745544800000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x11 DUP2 MSTORE PUSH32 0x55494E543235365F554E444552464C4F57000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x26 DUP2 MSTORE PUSH32 0x475245415445525F4F525F455155414C5F544F5F33325F4C454E4754485F5245 PUSH1 0x20 DUP3 ADD MSTORE PUSH32 0x5155495245440000000000000000000000000000000000000000000000000000 PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x60 ADD SWAP1 JUMP JUMPDEST PUSH1 0x10 DUP2 MSTORE PUSH32 0x4449564953494F4E5F42595F5A45524F00000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x10 DUP2 MSTORE PUSH32 0x55494E543235365F4F564552464C4F5700000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x17 DUP2 MSTORE PUSH32 0x554E535550504F525445445F41535345545F50524F5859000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0xF DUP2 MSTORE PUSH32 0x5452414E534645525F4641494C45440000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x14 DUP2 MSTORE PUSH32 0x434F4D504C4554455F46494C4C5F4641494C4544000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x1A DUP2 MSTORE PUSH32 0x494E53554646494349454E545F4554485F52454D41494E494E47000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x13 DUP2 MSTORE PUSH32 0x4F4E4C595F434F4E54524143545F4F574E455200000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x18 DUP2 MSTORE PUSH32 0x4645455F50455243454E544147455F544F4F5F4C415247450000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x26 DUP2 MSTORE PUSH32 0x475245415445525F4F525F455155414C5F544F5F32305F4C454E4754485F5245 PUSH1 0x20 DUP3 ADD MSTORE PUSH32 0x5155495245440000000000000000000000000000000000000000000000000000 PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x60 ADD SWAP1 JUMP JUMPDEST PUSH1 0x25 DUP2 MSTORE PUSH32 0x475245415445525F4F525F455155414C5F544F5F345F4C454E4754485F524551 PUSH1 0x20 DUP3 ADD MSTORE PUSH32 0x5549524544000000000000000000000000000000000000000000000000000000 PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x60 ADD SWAP1 JUMP JUMPDEST PUSH1 0xE DUP2 MSTORE PUSH32 0x494E56414C49445F414D4F554E54000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST DUP1 MLOAD PUSH1 0x80 DUP4 ADD SWAP1 PUSH2 0x22A8 DUP5 DUP3 PUSH2 0x22DD JUMP JUMPDEST POP PUSH1 0x20 DUP3 ADD MLOAD PUSH2 0x22BB PUSH1 0x20 DUP6 ADD DUP3 PUSH2 0x22DD JUMP JUMPDEST POP PUSH1 0x40 DUP3 ADD MLOAD PUSH2 0x22CE PUSH1 0x40 DUP6 ADD DUP3 PUSH2 0x22DD JUMP JUMPDEST POP PUSH1 0x60 DUP3 ADD MLOAD PUSH2 0x15C4 PUSH1 0x60 DUP6 ADD DUP3 JUMPDEST PUSH2 0x1EF9 DUP2 PUSH2 0x2508 JUMP JUMPDEST PUSH1 0x20 DUP2 ADD PUSH2 0x7BD DUP3 DUP5 PUSH2 0x1EF0 JUMP JUMPDEST PUSH1 0x60 DUP2 ADD PUSH2 0x2302 DUP3 DUP7 PUSH2 0x1EF0 JUMP JUMPDEST PUSH2 0x230F PUSH1 0x20 DUP4 ADD DUP6 PUSH2 0x1EF0 JUMP JUMPDEST PUSH2 0x1CB2 PUSH1 0x40 DUP4 ADD DUP5 PUSH2 0x22DD JUMP JUMPDEST PUSH1 0x40 DUP2 ADD PUSH2 0x232A DUP3 DUP6 PUSH2 0x1EF0 JUMP JUMPDEST PUSH2 0x10EA PUSH1 0x20 DUP4 ADD DUP5 PUSH2 0x22DD JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x1EFF JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x1F55 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x1F85 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x1FB5 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x1FE5 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x203B JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x206B JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x209B JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x20CB JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x20FB JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x212B JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x215B JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x218B JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x21BB JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x2211 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x7BD DUP2 PUSH2 0x2267 JUMP JUMPDEST PUSH2 0x100 DUP2 ADD PUSH2 0x2446 DUP3 DUP6 PUSH2 0x2297 JUMP JUMPDEST PUSH2 0x10EA PUSH1 0x80 DUP4 ADD DUP5 PUSH2 0x2297 JUMP JUMPDEST PUSH1 0x20 DUP2 ADD PUSH2 0x7BD DUP3 DUP5 PUSH2 0x22DD JUMP JUMPDEST PUSH1 0x40 MLOAD DUP2 DUP2 ADD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT DUP3 DUP3 LT OR ISZERO PUSH2 0x2480 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x40 MSTORE SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH8 0xFFFFFFFFFFFFFFFF DUP3 GT ISZERO PUSH2 0x249F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x20 SWAP1 DUP2 MUL ADD SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH8 0xFFFFFFFFFFFFFFFF DUP3 GT ISZERO PUSH2 0x24C0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x20 PUSH1 0x1F SWAP2 SWAP1 SWAP2 ADD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 AND ADD SWAP1 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 JUMP JUMPDEST SWAP1 JUMP JUMPDEST DUP3 DUP2 DUP4 CALLDATACOPY POP PUSH1 0x0 SWAP2 ADD MSTORE JUMP STOP LOG2 PUSH6 0x627A7A723058 KECCAK256 XOR GAS DELEGATECALL 0xa5 0xe8 MSTORE JUMPDEST 0xc KECCAK256 SWAP9 EXTCODESIZE CALLCODE 0x2c MULMOD PUSH24 0x3A1CAB3F704716CBA4C8DA3B112601CD666C657870657269 PUSH14 0x656E74616CF50037000000000000 ",
- "sourceMap": "836:407:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;962:11:4;;;;940:10;:34;919:116;;;;;;;;;;;;;;;;;;;;;;836:407:0;6574:2360:3;;;;;;;;;;;;;;;;;;;;;;;;;;;1490:174:1;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1490:174:1;;;;;;;;;91:20:55;;8:9:-1;5:2;;;30:1;27;20:12;5:2;91:20:55;;;;;;;;;;;;2756:2751:3;;;;;;;;;;333:167:55;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;333:167:55;;;;;;;;;6574:2360:3;6929:35;;:::i;:::-;6978:38;;:::i;:::-;7102:20;7132:33;7073:18;:16;:18::i;:::-;7211:14;7179:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7211:14;;7179:47;;7211:14;7179:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:6;7186:1;7179:9;;;;;;;;;;;;;;;;;;;:24;;;;:47;:31;:47;:::i;:::-;7175:1275;;;7440:129;7483:6;7507:20;7545:10;7440:25;:129::i;:::-;7421:148;;7701:79;7709:16;:39;;;7750:16;:29;;;7701:7;:79::i;:::-;7673:107;;7175:1275;;;7958:132;8004:6;8028:20;8066:10;7958:28;:132::i;:::-;7939:151;;8166:16;:29;;;8151:44;;8231:127;8274:9;8301:12;8331:13;8231:25;:127::i;:::-;8400:39;;8209:149;;-1:-1:-1;8400:39:3;-1:-1:-1;7175:1275:3;8595:195;8632:16;:39;;;8685:19;:42;;;8741:13;8768:12;8595:23;:195::i;:::-;8853:74;8875:6;8882:1;8875:9;;;;;;;;;;;;;;;;;;:24;;;8901:25;8853:21;:74::i;:::-;6574:2360;;;;;;;;;;;;:::o;1490:174:1:-;259:5:55;;;;245:10;:19;224:85;;;;;;;;;;;;;;1617:40:1;1639:9;;1617:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1650:6:1;;-1:-1:-1;1617:21:1;;-1:-1:-1;;;;1617:40:1:i;:::-;1490:174;;;:::o;91:20:55:-;;;;;;:::o;2756:2751:3:-;3074:35;;:::i;:::-;3123:38;;:::i;:::-;3247:22;3279:20;3309:33;3218:18;:16;:18::i;:::-;3388:14;3356:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3388:14;;3356:47;;3388:14;3356:47;;;;;;;;;;;;;;;;;;;;;;;;;3352:1671;;;3509:166;1170:6:7;3588:46:3;1170:6:7;3620:13:3;3588:7;:46::i;:::-;3652:9;3509:21;:166::i;:::-;3492:183;;3814:112;3846:6;3870:14;3902:10;3814:14;:112::i;:::-;3795:131;;4058:79;4066:16;:39;;;4107:16;:29;;;4058:7;:79::i;:::-;4030:107;;3352:1671;;;4270:144;1335:33:7;1170:6;4391:9:3;4270:21;:144::i;:::-;4253:161;;4551:112;4583:6;4607:14;4639:10;4551:14;:112::i;:::-;4532:131;;4739:16;:29;;;4724:44;;4804:127;4847:9;4874:12;4904:13;4804:25;:127::i;:::-;4973:39;;4782:149;;-1:-1:-1;4973:39:3;-1:-1:-1;3352:1671:3;5168:195;5205:16;:39;;;5258:19;:42;;;5314:13;5341:12;5168:23;:195::i;:::-;5426:74;5448:6;5455:1;5448:9;;;;;;;;;5426:74;2756:2751;;;;;;;;;;;;:::o;333:167:55:-;259:5;;;;245:10;:19;224:85;;;;;;;;;;;;;;429:22;;;;425:69;;467:5;:16;;;;;;;;;;425:69;333:167;:::o;1106:191:4:-;1198:1;1186:9;:13;1165:77;;;;;;;;;;;;;;1252:11;;;;;;;;;;;:19;;;1278:9;1252:38;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1252:38:4;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1252:38:4;;;;;1106:191::o;9651:403:53:-;9772:10;10001:3;:10;9987:3;:10;:24;:60;;;;;10043:3;10033:14;;;;;;;;;;;;;36:153:-1;66:2;58:11;;36:153;;176:10;;164:23;;139:12;;;;;98:2;89:12;;;;114;36:153;;;299:10;344;;263:2;259:12;;;254:3;250:22;246:30;;311:9;;295:26;;;340:21;;377:20;365:33;;10033:14:53;;;;;;;;;;;10015;;10033;;-1:-1:-1;10015:14:53;;-1:-1:-1;10033:14:53;;;;-1:-1:-1;10015:14:53;;;;10033;10015;36:153:-1;66:2;58:11;;36:153;;176:10;;164:23;;139:12;;;;;98:2;89:12;;;;114;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;10015:14:53;;;;;;;;;;;;;;;;:32;;;;9987:60;9980:67;;9651:403;;;;;:::o;8545:2260:2:-;8725:35;;:::i;:::-;8900:25;8952:26;9006:20;9041;9092:9;9412:29;9663:31;9998:35;;:::i;:::-;8823:17;;8819:71;;;8856:23;;8819:71;8928:14;8900:42;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8928:14;8900:42;;8928:14;8900:42;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;8981:15:2;8952:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8900:42;;-1:-1:-1;8981:15:2;;-1:-1:-1;8952:44:2;-1:-1:-1;8952:44:2;;;-1:-1:-1;8981:15:2;8952:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9029:1;9006:24;;9064:6;:13;9041:36;;9104:1;9092:13;;9087:1573;9107:17;;;9087:1573;;9270:12;9243:6;9250:1;9243:9;;;;;;;;;;;;;;;;;;;:24;;:39;9296:9;;9323:13;;9296:6;;9303:1;;9296:9;;;;;;;;;;;;;;;:24;;:40;9444:35;9452:12;9466;9444:7;:35::i;:::-;9412:67;;9697:225;9736:6;9743:1;9736:9;;;;;;;;;;;;;;;;;;:26;;;9780:55;9788:6;9795:1;9788:9;;;;;;;;;;;;;;;;;;:26;;;9816:6;9823:1;9816:9;;;;;;;;;;;;;;;;;;:18;;;9780:7;:55::i;:::-;9887:21;9697;:225::i;:::-;9663:259;;10036:208;10070:6;10077:1;10070:9;;;;;;;;;;;;;;;;;;10097:35;10105:23;10130:1;10097:7;:35::i;:::-;10217:10;10228:1;10217:13;;;;;;;;;;;;;;;;;;10036:16;:208::i;:::-;9998:246;;10330:50;10345:16;10363;10330:14;:50::i;:::-;10409:79;10417:16;:39;;;10458:16;:29;;;10409:7;:79::i;:::-;10394:94;-1:-1:-1;10582:28:2;;;10578:72;;10630:5;;10578:72;9126:3;;;;;9087:1573;;;10691:28;;;;10670:95;;;;;;;;;;;;;;8545:2260;;;;;;;;;;;;;:::o;502:208:57:-;588:7;632:6;;;;611:70;;;;;;;;;;;;;;-1:-1:-1;698:5:57;;;502:208::o;5554:2161:2:-;5745:35;;:::i;:::-;5796:27;5860:26;5915:20;5966:9;6363:37;6669;6960:36;;:::i;:::-;7366:30;5826:6;5833:1;5826:9;;;;;;;;;;;;;;;;;;;;;:24;;;5889:15;5860:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5826:24;;-1:-1:-1;5860:44:2;5889:15;;5860:44;;;5889:15;5860:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5938:6;:13;5915:36;;5978:1;5966:13;;5961:1591;5981:17;;;5961:1591;;6213:14;6186:6;6193:1;6186:9;;;;;;;;;;;;;;;;;;;:24;;:41;6241:9;;6268:13;;6241:6;;6248:1;;6241:9;;;;;;;;;;;;;;;:24;;:40;6433:39;;6403:70;;6411:20;;6403:7;:70::i;:::-;6363:110;;6709:170;6748:6;6755:1;6748:9;;;;;;;;;;;;;;;;;;:26;;;6792:6;6799:1;6792:9;;;;;;;;;;;;;;;;;;:26;;;6836:29;6709:21;:170::i;:::-;6669:210;;6999:135;7033:6;7040:1;7033:9;;;;;;;;;;;;;;;;;;7060:29;7107:10;7118:1;7107:13;;;;;;;;;6999:135;6960:174;;7219:51;7234:16;7252:17;7219:14;:51::i;:::-;-1:-1:-1;7399:39:2;;7456:46;;;7452:90;;7522:5;;7452:90;6000:3;;;;;5961:1591;;;7583:46;;;;7562:113;;;;;;;;;;;;;1829:1648:4;2277:16;;;;1230:32:7;2106:35:4;;;2085:106;;;;;;;;;;;;;;2296:51;2304:26;2332:14;2296:7;:51::i;:::-;2277:70;-1:-1:-1;2390:9:4;2378:21;;;2357:81;;;;;;;;;;;;;;2532:28;2540:9;2551:8;2532:7;:28::i;:::-;2508:52;;2641:134;2676:13;1170:6:7;2739:26:4;2641:21;:134::i;:::-;2624:151;-1:-1:-1;2868:23:4;;;;2847:96;;;;;;;;;;;;;;3021:1;3005:13;:17;3001:470;;;3083:11;;:35;;;;;:11;;;;;:20;;:35;;3104:13;;3083:35;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3083:35:4;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3083:35:4;;;;3185:1;3176:6;:10;3172:78;;;3206:29;;:21;;;;:29;;;;;3228:6;;3206:29;;;;3228:6;3206:21;:29;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3206:29:4;3172:78;3335:30;3343:13;3358:6;3335:7;:30::i;:::-;3315:50;;3395:1;3383:9;:13;3379:82;;;3416:30;;:10;;:30;;;;;3436:9;;3416:30;;;;3436:9;3416:10;:30;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3416:30:4;3379:82;1829:1648;;;;;;;;:::o;1863:437:1:-;1987:14;2004:23;:9;1987:14;2004:23;:20;:23;:::i;:::-;930:32:7;;;;;;;;;;;;;;;;1987:40:1;;-1:-1:-1;2042:24:1;;;;;;;2038:256;;;2082:37;2101:9;2112:6;2082:18;:37::i;:::-;2038:256;;;1018:41:7;;;;;;;;;;;;;;;;2140:25:1;;;;;;;2136:158;;;2181:38;2201:9;2212:6;2181:19;:38::i;2136:158::-;2250:33;;;;;;;;;;;716:230:57;802:7;837:5;;;873:6;;;;852:69;;;;;;;;;;;;;;938:1;931:8;;716:230;;;;;;:::o;3123:425:42:-;3287:21;3345:15;;;3324:78;;;;;;;;;;;;;;3429:82;3450:26;3458:9;3469:6;3450:7;:26::i;:::-;3490:11;3429:7;:82::i;:::-;3413:98;-1:-1:-1;3123:425:42;;;;;;:::o;3512:1517:2:-;3683:35;;:::i;:::-;3734:27;3798:26;3853:20;3904:9;4296:37;4475:36;;:::i;:::-;3764:6;3771:1;3764:9;;;;;;;;;;;;;;;;;;;;;:24;;;3827:15;3798:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3764:24;;-1:-1:-1;3798:44:2;3827:15;;3798:44;;;3827:15;3798:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3876:6;:13;3853:36;;3916:1;3904:13;;3899:1091;3919:17;;;3899:1091;;4151:14;4124:6;4131:1;4124:9;;;;;;;;;;;;;;;;;;;:24;;:41;4179:9;;4206:13;;4179:6;;4186:1;;4179:9;;;;;;;;;;;;;;:24;;:40;;;;4336:64;4344:14;4360:16;:39;;;4336:7;:64::i;:::-;4296:104;;4514:135;4548:6;4555:1;4548:9;;;;;;;;;;;;;;;;;;4575:29;4622:10;4633:1;4622:13;;;;;;;;;4514:135;4475:174;;4734:51;4749:16;4767:17;4734:14;:51::i;:::-;4883:39;;;;:57;-1:-1:-1;4879:101:2;;4960:5;;4879:101;3938:3;;;;;3899:1091;;;3512:1517;;;;;;;;;;;:::o;1444:1623::-;1617:30;;:::i;:::-;1710;1858:16;1743:104;1775:5;1794:20;1828:9;1743:18;:104::i;:::-;1885:8;;2379:24;;1710:137;;-1:-1:-1;1885:8:2;;;-1:-1:-1;2529:3:2;;1710:137;;2283:2;2260:26;;1885:8;;2030:3;2008:598;2622:7;2619:2;;;2674:17;2668:24;2655:11;2648:45;2768:2;2749:17;2745:26;2739:33;2734:2;2721:11;2717:20;2710:63;2848:2;2829:17;2825:26;2819:33;2814:2;2801:11;2797:20;2790:63;2928:2;2909:17;2905:26;2899:33;2894:2;2881:11;2877:20;2870:63;2619:2;-1:-1:-1;1444:1623:2;;;;;;;:::o;1771:648:41:-;1964:39;;2005:40;;1956:90;;1964:39;1956:7;:90::i;:::-;1914:132;;2106:39;;;;;2147:40;;;;2098:90;;2106:39;2098:7;:90::i;:::-;2056:39;;;:132;2238:29;;;;;2269:30;;;;2230:70;;2238:29;2230:7;:70::i;:::-;2198:29;;;:102;2350:29;;;;;2381:30;;;;2342:70;;2350:29;2342:7;:70::i;:::-;2310:29;;;;:102;;;;-1:-1:-1;1771:648:41:o;15593:687:53:-;15713:13;15775:5;15783:1;15775:9;15763:1;:8;:21;;15742:105;;;;;;;;;;;;;;;;-1:-1:-1;16021:13:53;15924:2;16021:13;16015:20;16174:66;16162:79;;15593:687::o;2518:1273:1:-;2639:13;;2655:25;:9;2677:2;2655:25;:21;:25;:::i;:::-;1022:38;;;;;;;;;;;;;;;;2639:41;;-1:-1:-1;2832:10:1;;;;1022:38;2843:113;;2916:10;;2940:6;;2843:113;;;;;;;;22:32:-1;26:21;;;22:32;6:49;;2843:113:1;;;49:4:-1;25:18;;61:17;;2843:113:1;182:15:-1;2843:113:1;;;;179:29:-1;;;;160:49;;2832:125:1;;;2843:113;;2832:125;;;;25:18:-1;2832:125:1;;25:18:-1;-1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;2832:125:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;2967:69:1;;;;;;;;;;;;;;;;;3415:14;3412:2;;;-1:-1:-1;3459:1:1;3483:14;3499:2;3480:22;3477:2;;;3621;3618:1;3615;3600:24;-1:-1:-1;3662:1:1;3656:8;3477:2;3736:7;3715:69;;;;;;;;;;;;;;;;2518:1273;;;;:::o;4010:489::-;4244:13;;4163:1;4153:11;;4132:72;;;;;;;;;;;;;;4260:25;:9;4282:2;4260:25;:21;:25;:::i;:::-;4244:41;-1:-1:-1;4313:25:1;:9;4335:2;4313:25;:21;:25;:::i;:::-;4378:114;;;;;4295:43;;-1:-1:-1;4378:32:1;;;;;;:114;;4432:4;;4451:10;;4295:43;;4378:114;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;4378:114:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;51:288:57;137:7;;164:6;;160:45;;;193:1;186:8;;;;160:45;-1:-1:-1;226:5:57;;;230:1;226;:5;262;;;;;;;;:10;241:73;;;;;;;;;;;;;345:151;431:7;454:9;470:1;466;:5;;;;;;;;;345:151;-1:-1:-1;;;;345:151:57:o;1011:10099:37:-;5031:4;5025:11;;5321:66;5314:4;5291:28;;;5284:104;;;;1199:30;5445:4;5422:28;;6444:59;;;6770:19;;5736:26;;;6750:40;;;6883:23;;;6877:30;6853:22;;;6846:62;6979:23;;;6973:30;6949:22;;;6942:62;7082:23;;;7076:30;7052:22;;;7045:62;7197:4;7179:23;;7173:30;7149:22;;;7142:62;7297:4;7279:23;;7273:30;7249:22;;;7242:62;7397:4;7379:23;;7373:30;7349:22;;;7342:62;7495:4;7477:23;;7471:30;7447:22;;;7440:62;7594:5;7576:24;;7570:31;7545:23;;;7538:64;7699:5;7681:24;;7675:31;7650:23;;;7643:64;7787:5;7769:24;;7763:31;;7738:23;;;7731:64;;;7895:5;7877:24;;7871:31;7846:23;;;7839:64;7979:5;8106:74;;8268:24;8340:19;;7962:23;;;8544:34;;;5025:11;;5422:28;;;;6536:27;;;;5736:26;;8606:22;;;;8388:23;;;;8464:4;8445:24;;8441:35;6190:1;8698:237;8721:13;8718:1;8715:20;8698:237;;;8791:19;;8771:40;;8860:4;8843:22;;;;8898:23;;;;8749:1;8742:9;8698:237;;;-1:-1:-1;;;;9045:31:37;;;9029:13;9010:33;;;9003:74;;;;9171:17;;9165:24;9237:19;;9441:34;;;9037:4;9503:22;;;;9285:23;;;;9361:4;9342:24;;9338:35;9610:1;9596:237;9619:13;9616:1;9613:20;9596:237;;;9689:19;;9669:40;;9758:4;9741:22;;;;9796:23;;;;9647:1;9640:9;9596:237;;;-1:-1:-1;;;9902:46:37;;;-1:-1:-1;10133:33:37;;;10003:4;9981:27;;;10108:59;;;10281:19;;10472:34;;;9981:27;;10534:22;;;;10329:23;;;;10281:19;10405:4;10386:24;;10382:35;-1:-1:-1;10613:237:37;10636:13;10633:1;10630:20;10613:237;;;10706:19;;10686:40;;10775:4;10758:22;;;;10813:23;;;;10664:1;10657:9;10613:237;;;-1:-1:-1;;;10928:46:37;;;;;10902:73;;-1:-1:-1;11041:4:37;11034:25;-1:-1:-1;;;;;1011:10099:37;;;;;:::o;10268:886:53:-;10389:14;10452:5;10460:2;10452:10;10440:1;:8;:22;;10419:135;;;;;;;;;;;;;;;;-1:-1:-1;11056:13:53;10801:2;11056:13;11050:20;11072:42;11046:69;;10268:886::o;14708:220::-;14829:14;14876:21;14888:1;14891:5;13411:14;13474:5;13482:2;13474:10;13462:1;:8;:22;;13441:107;;;;;;;;;;;;;;;;-1:-1:-1;13727:13:53;13629:2;13727:13;13721:20;;13290:490::o;836:407:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;5:118:-1:-;;72:46;110:6;97:20;72:46;;146:693;;261:4;249:17;;245:27;-1:-1;235:2;;286:1;283;276:12;235:2;323:6;310:20;345:85;360:69;422:6;360:69;;;345:85;;;458:21;;;502:4;490:17;;;;336:94;;-1:-1;515:14;;490:17;610:1;595:238;620:6;617:1;614:13;595:238;;;703:3;690:17;682:6;678:30;727:42;765:3;753:10;727:42;;;715:55;;-1:-1;793:4;784:14;;;;812;;;;;642:1;635:9;595:238;;;599:14;228:611;;;;;;;;879:735;;1008:4;996:17;;992:27;-1:-1;982:2;;1033:1;1030;1023:12;982:2;1070:6;1057:20;1092:99;1107:83;1183:6;1107:83;;1092:99;1219:21;;;1263:4;1251:17;;;;1083:108;;-1:-1;1276:14;;1251:17;1371:1;1356:252;1381:6;1378:1;1375:13;1356:252;;;1464:3;1451:17;1443:6;1439:30;1488:56;1540:3;1528:10;1488:56;;;1476:69;;-1:-1;1568:4;1559:14;;;;1587;;;;;1403:1;1396:9;1356:252;;1636:335;;;1743:4;1731:17;;1727:27;-1:-1;1717:2;;1768:1;1765;1758:12;1717:2;-1:-1;1788:20;;1828:18;1817:30;;1814:2;;;1860:1;1857;1850:12;1814:2;1894:4;1886:6;1882:17;1870:29;;1944:3;1937;1929:6;1925:16;1915:8;1911:31;1908:40;1905:2;;;1961:1;1958;1951:12;1905:2;1710:261;;;;;;1980:432;;2070:4;2058:17;;2054:27;-1:-1;2044:2;;2095:1;2092;2085:12;2044:2;2132:6;2119:20;2154:60;2169:44;2206:6;2169:44;;2154:60;2145:69;;2234:6;2227:5;2220:21;2270:4;2262:6;2258:17;2303:4;2296:5;2292:16;2338:3;2329:6;2324:3;2320:16;2317:25;2314:2;;;2355:1;2352;2345:12;2314:2;2365:41;2399:6;2394:3;2389;2365:41;;;2037:375;;;;;;;;2448:2205;;2556:5;2544:9;2539:3;2535:19;2531:31;2528:2;;;2575:1;2572;2565:12;2528:2;2593:21;2608:5;2593:21;;;2584:30;-1:-1;2672:1;2703:49;2748:3;2728:9;2703:49;;;2679:74;;-1:-1;2822:2;2855:49;2900:3;2876:22;;;2855:49;;;2848:4;2841:5;2837:16;2830:75;2774:142;2981:2;3014:49;3059:3;3050:6;3039:9;3035:22;3014:49;;;3007:4;3000:5;2996:16;2989:75;2926:149;3134:2;3167:49;3212:3;3203:6;3192:9;3188:22;3167:49;;;3160:4;3153:5;3149:16;3142:75;3085:143;3290:3;3324:49;3369:3;3360:6;3349:9;3345:22;3324:49;;;3317:4;3310:5;3306:16;3299:75;3238:147;3447:3;3481:49;3526:3;3517:6;3506:9;3502:22;3481:49;;;3474:4;3467:5;3463:16;3456:75;3395:147;3596:3;3630:49;3675:3;3666:6;3655:9;3651:22;3630:49;;;3623:4;3616:5;3612:16;3605:75;3552:139;3745:3;3779:49;3824:3;3815:6;3804:9;3800:22;3779:49;;;3772:4;3765:5;3761:16;3754:75;3701:139;3907:3;3942:49;3987:3;3978:6;3967:9;3963:22;3942:49;;;3934:5;3927;3923:17;3916:76;3850:153;4053:3;4088:49;4133:3;4124:6;4113:9;4109:22;4088:49;;;4080:5;4073;4069:17;4062:76;4013:136;4237:3;4226:9;4222:19;4209:33;4262:18;4254:6;4251:30;4248:2;;;4294:1;4291;4284:12;4248:2;4330:54;4380:3;4371:6;4360:9;4356:22;4330:54;;;4322:5;4315;4311:17;4304:81;4159:237;4484:3;4473:9;4469:19;4456:33;4509:18;4501:6;4498:30;4495:2;;;4541:1;4538;4531:12;4495:2;4577:54;4627:3;4618:6;4607:9;4603:22;4577:54;;;4569:5;4562;4558:17;4551:81;4406:237;2522:2131;;;;;4660:118;;4727:46;4765:6;4752:20;4727:46;;4785:241;;4889:2;4877:9;4868:7;4864:23;4860:32;4857:2;;;4905:1;4902;4895:12;4857:2;4940:1;4957:53;5002:7;4982:9;4957:53;;;4947:63;4851:175;-1:-1;;;;4851:175;5033:1509;;;;;;;5370:3;5358:9;5349:7;5345:23;5341:33;5338:2;;;5387:1;5384;5377:12;5338:2;5422:31;;5473:18;5462:30;;5459:2;;;5505:1;5502;5495:12;5459:2;5525:97;5614:7;5605:6;5594:9;5590:22;5525:97;;;5515:107;;5401:227;5687:2;5676:9;5672:18;5659:32;5711:18;5703:6;5700:30;5697:2;;;5743:1;5740;5733:12;5697:2;5763:83;5838:7;5829:6;5818:9;5814:22;5763:83;;;5753:93;;5638:214;5911:2;5900:9;5896:18;5883:32;5935:18;5927:6;5924:30;5921:2;;;5967:1;5964;5957:12;5921:2;5987:97;6076:7;6067:6;6056:9;6052:22;5987:97;;;5977:107;;5862:228;6149:2;6138:9;6134:18;6121:32;6173:18;6165:6;6162:30;6159:2;;;6205:1;6202;6195:12;6159:2;6225:83;6300:7;6291:6;6280:9;6276:22;6225:83;;;6215:93;;6100:214;6345:3;6364:53;6409:7;6400:6;6389:9;6385:22;6364:53;;;6354:63;;6324:99;6454:3;6473:53;6518:7;6509:6;6498:9;6494:22;6473:53;;;6463:63;;6433:99;5332:1210;;;;;;;;;6549:1635;;;;;;;;6903:3;6891:9;6882:7;6878:23;6874:33;6871:2;;;6920:1;6917;6910:12;6871:2;6955:31;;7006:18;6995:30;;6992:2;;;7038:1;7035;7028:12;6992:2;7058:97;7147:7;7138:6;7127:9;7123:22;7058:97;;;7048:107;;6934:227;7192:2;7210:53;7255:7;7246:6;7235:9;7231:22;7210:53;;;7200:63;;7171:98;7328:2;7317:9;7313:18;7300:32;7352:18;7344:6;7341:30;7338:2;;;7384:1;7381;7374:12;7338:2;7404:83;7479:7;7470:6;7459:9;7455:22;7404:83;;;7394:93;;7279:214;7552:2;7541:9;7537:18;7524:32;7576:18;7568:6;7565:30;7562:2;;;7608:1;7605;7598:12;7562:2;7628:97;7717:7;7708:6;7697:9;7693:22;7628:97;;;7618:107;;7503:228;7790:3;7779:9;7775:19;7762:33;7815:18;7807:6;7804:30;7801:2;;;7847:1;7844;7837:12;7801:2;7867:83;7942:7;7933:6;7922:9;7918:22;7867:83;;;7857:93;;7741:215;7987:3;8006:53;8051:7;8042:6;8031:9;8027:22;8006:53;;;7996:63;;7966:99;8096:3;8115:53;8160:7;8151:6;8140:9;8136:22;8115:53;;;8105:63;;8075:99;6865:1319;;;;;;;;;;;8191:490;;;;8331:2;8319:9;8310:7;8306:23;8302:32;8299:2;;;8347:1;8344;8337:12;8299:2;8382:31;;8433:18;8422:30;;8419:2;;;8465:1;8462;8455:12;8419:2;8493:64;8549:7;8540:6;8529:9;8525:22;8493:64;;;8475:82;;;;8361:202;8594:2;8612:53;8657:7;8648:6;8637:9;8633:22;8612:53;;;8602:63;;8573:98;8293:388;;;;;;8688:110;8761:31;8786:5;8761:31;;;8756:3;8749:44;8743:55;;;8806:397;8961:2;8949:15;;8998:66;8993:2;8984:12;;8977:88;9099:66;9094:2;9085:12;;9078:88;9194:2;9185:12;;8942:261;9212:296;9367:2;9355:15;;9404:66;9399:2;9390:12;;9383:88;9499:2;9490:12;;9348:160;9517:296;9672:2;9660:15;;9709:66;9704:2;9695:12;;9688:88;9804:2;9795:12;;9653:160;9822:296;9977:2;9965:15;;10014:66;10009:2;10000:12;;9993:88;10109:2;10100:12;;9958:160;10127:397;10282:2;10270:15;;10319:66;10314:2;10305:12;;10298:88;10420:66;10415:2;10406:12;;10399:88;10515:2;10506:12;;10263:261;10533:296;10688:2;10676:15;;10725:66;10720:2;10711:12;;10704:88;10820:2;10811:12;;10669:160;10838:296;10993:2;10981:15;;11030:66;11025:2;11016:12;;11009:88;11125:2;11116:12;;10974:160;11143:296;11298:2;11286:15;;11335:66;11330:2;11321:12;;11314:88;11430:2;11421:12;;11279:160;11448:296;11603:2;11591:15;;11640:66;11635:2;11626:12;;11619:88;11735:2;11726:12;;11584:160;11753:296;11908:2;11896:15;;11945:66;11940:2;11931:12;;11924:88;12040:2;12031:12;;11889:160;12058:296;12213:2;12201:15;;12250:66;12245:2;12236:12;;12229:88;12345:2;12336:12;;12194:160;12363:296;12518:2;12506:15;;12555:66;12550:2;12541:12;;12534:88;12650:2;12641:12;;12499:160;12668:296;12823:2;12811:15;;12860:66;12855:2;12846:12;;12839:88;12955:2;12946:12;;12804:160;12973:397;13128:2;13116:15;;13165:66;13160:2;13151:12;;13144:88;13266:66;13261:2;13252:12;;13245:88;13361:2;13352:12;;13109:261;13379:397;13534:2;13522:15;;13571:66;13566:2;13557:12;;13550:88;13672:66;13667:2;13658:12;;13651:88;13767:2;13758:12;;13515:261;13785:296;13940:2;13928:15;;13977:66;13972:2;13963:12;;13956:88;14072:2;14063:12;;13921:160;14166:888;14394:22;;14307:4;14298:14;;;14428:61;14302:3;14394:22;14428:61;;;14327:174;14595:4;14588:5;14584:16;14578:23;14613:62;14669:4;14664:3;14660:14;14647:11;14613:62;;;14511:176;14771:4;14764:5;14760:16;14754:23;14789:62;14845:4;14840:3;14836:14;14823:11;14789:62;;;14697:166;14947:4;14940:5;14936:16;14930:23;14965:62;15021:4;15016:3;15012:14;14999:11;15061:110;15134:31;15159:5;15134:31;;15178:193;15286:2;15271:18;;15300:61;15275:9;15334:6;15300:61;;15378:395;15542:2;15527:18;;15556:61;15531:9;15590:6;15556:61;;;15628:62;15686:2;15675:9;15671:18;15662:6;15628:62;;;15701;15759:2;15748:9;15744:18;15735:6;15701:62;;15780:294;15916:2;15901:18;;15930:61;15905:9;15964:6;15930:61;;;16002:62;16060:2;16049:9;16045:18;16036:6;16002:62;;16081:387;16262:2;16276:47;;;16247:18;;16337:121;16247:18;16337:121;;16475:387;16656:2;16670:47;;;16641:18;;16731:121;16641:18;16731:121;;16869:387;17050:2;17064:47;;;17035:18;;17125:121;17035:18;17125:121;;17263:387;17444:2;17458:47;;;17429:18;;17519:121;17429:18;17519:121;;17657:387;17838:2;17852:47;;;17823:18;;17913:121;17823:18;17913:121;;18051:387;18232:2;18246:47;;;18217:18;;18307:121;18217:18;18307:121;;18445:387;18626:2;18640:47;;;18611:18;;18701:121;18611:18;18701:121;;18839:387;19020:2;19034:47;;;19005:18;;19095:121;19005:18;19095:121;;19233:387;19414:2;19428:47;;;19399:18;;19489:121;19399:18;19489:121;;19627:387;19808:2;19822:47;;;19793:18;;19883:121;19793:18;19883:121;;20021:387;20202:2;20216:47;;;20187:18;;20277:121;20187:18;20277:121;;20415:387;20596:2;20610:47;;;20581:18;;20671:121;20581:18;20671:121;;20809:387;20990:2;21004:47;;;20975:18;;21065:121;20975:18;21065:121;;21203:387;21384:2;21398:47;;;21369:18;;21459:121;21369:18;21459:121;;21597:387;21778:2;21792:47;;;21763:18;;21853:121;21763:18;21853:121;;21991:387;22172:2;22186:47;;;22157:18;;22247:121;22157:18;22247:121;;22385:528;22637:3;22622:19;;22652:119;22626:9;22744:6;22652:119;;;22782:121;22898:3;22887:9;22883:19;22874:6;22782:121;;22920:193;23028:2;23013:18;;23042:61;23017:9;23076:6;23042:61;;23120:256;23182:2;23176:9;23208:17;;;23283:18;23268:34;;23304:22;;;23265:62;23262:2;;;23340:1;23337;23330:12;23262:2;23356;23349:22;23160:216;;-1:-1;23160:216;23383:263;;23547:18;23539:6;23536:30;23533:2;;;23579:1;23576;23569:12;23533:2;-1:-1;23608:4;23596:17;;;23626:15;;23470:176;23937:254;;24076:18;24068:6;24065:30;24062:2;;;24108:1;24105;24098:12;24062:2;-1:-1;24181:4;24152;24129:17;;;;24148:9;24125:33;24171:15;;23999:192;24198:128;24278:42;24267:54;;24250:76;24333:79;24402:5;24385:27;24641:145;24722:6;24717:3;24712;24699:30;-1:-1;24778:1;24760:16;;24753:27;24692:94"
- }
- }
- },
- "sources": {
- "2.0.0/extensions/Forwarder/Forwarder.sol": {
- "id": 0
- },
- "2.0.0/extensions/Forwarder/MixinAssets.sol": {
- "id": 1
- },
- "2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol": {
- "id": 2
- },
- "2.0.0/extensions/Forwarder/MixinForwarderCore.sol": {
- "id": 3
- },
- "2.0.0/extensions/Forwarder/MixinWeth.sol": {
- "id": 4
- },
- "2.0.0/extensions/Forwarder/interfaces/IAssets.sol": {
- "id": 5
- },
- "2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol": {
- "id": 6
- },
- "2.0.0/extensions/Forwarder/libs/LibConstants.sol": {
- "id": 7
- },
- "2.0.0/extensions/Forwarder/mixins/MAssets.sol": {
- "id": 8
- },
- "2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol": {
- "id": 9
- },
- "2.0.0/extensions/Forwarder/mixins/MWeth.sol": {
- "id": 10
- },
- "2.0.0/extensions/OrderValidator/OrderValidator.sol": {
- "id": 11
- },
- "2.0.0/multisig/MultiSigWallet.sol": {
- "id": 12
- },
- "2.0.0/multisig/MultiSigWalletWithTimeLock.sol": {
- "id": 13
- },
- "2.0.0/protocol/AssetProxy/ERC20Proxy.sol": {
- "id": 14
- },
- "2.0.0/protocol/AssetProxy/ERC721Proxy.sol": {
- "id": 15
- },
- "2.0.0/protocol/AssetProxy/MixinAuthorizable.sol": {
- "id": 16
- },
- "2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol": {
- "id": 17
- },
- "2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol": {
- "id": 18
- },
- "2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol": {
- "id": 19
- },
- "2.0.0/protocol/AssetProxyOwner/AssetProxyOwner.sol": {
- "id": 20
- },
- "2.0.0/protocol/Exchange/Exchange.sol": {
- "id": 21
- },
- "2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol": {
- "id": 22
- },
- "2.0.0/protocol/Exchange/MixinExchangeCore.sol": {
- "id": 23
- },
- "2.0.0/protocol/Exchange/MixinMatchOrders.sol": {
- "id": 24
- },
- "2.0.0/protocol/Exchange/MixinSignatureValidator.sol": {
- "id": 25
- },
- "2.0.0/protocol/Exchange/MixinTransactions.sol": {
- "id": 26
- },
- "2.0.0/protocol/Exchange/MixinWrapperFunctions.sol": {
- "id": 27
- },
- "2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol": {
- "id": 28
- },
- "2.0.0/protocol/Exchange/interfaces/IExchange.sol": {
- "id": 29
- },
- "2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol": {
- "id": 30
- },
- "2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol": {
- "id": 31
- },
- "2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol": {
- "id": 32
- },
- "2.0.0/protocol/Exchange/interfaces/ITransactions.sol": {
- "id": 33
- },
- "2.0.0/protocol/Exchange/interfaces/IValidator.sol": {
- "id": 34
- },
- "2.0.0/protocol/Exchange/interfaces/IWallet.sol": {
- "id": 35
- },
- "2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol": {
- "id": 36
- },
- "2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol": {
- "id": 37
- },
- "2.0.0/protocol/Exchange/libs/LibConstants.sol": {
- "id": 38
- },
- "2.0.0/protocol/Exchange/libs/LibEIP712.sol": {
- "id": 39
- },
- "2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol": {
- "id": 40
- },
- "2.0.0/protocol/Exchange/libs/LibFillResults.sol": {
- "id": 41
- },
- "2.0.0/protocol/Exchange/libs/LibMath.sol": {
- "id": 42
- },
- "2.0.0/protocol/Exchange/libs/LibOrder.sol": {
- "id": 43
- },
- "2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol": {
- "id": 44
- },
- "2.0.0/protocol/Exchange/mixins/MExchangeCore.sol": {
- "id": 45
- },
- "2.0.0/protocol/Exchange/mixins/MMatchOrders.sol": {
- "id": 46
- },
- "2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol": {
- "id": 47
- },
- "2.0.0/protocol/Exchange/mixins/MTransactions.sol": {
- "id": 48
- },
- "2.0.0/protocol/Exchange/mixins/MWrapperFunctions.sol": {
- "id": 49
- },
- "2.0.0/tokens/ERC20Token/IERC20Token.sol": {
- "id": 50
- },
- "2.0.0/tokens/ERC721Token/IERC721Token.sol": {
- "id": 51
- },
- "2.0.0/tokens/EtherToken/IEtherToken.sol": {
- "id": 52
- },
- "2.0.0/utils/LibBytes/LibBytes.sol": {
- "id": 53
- },
- "2.0.0/utils/Ownable/IOwnable.sol": {
- "id": 54
- },
- "2.0.0/utils/Ownable/Ownable.sol": {
- "id": 55
- },
- "2.0.0/utils/ReentrancyGuard/ReentrancyGuard.sol": {
- "id": 56
- },
- "2.0.0/utils/SafeMath/SafeMath.sol": {
- "id": 57
- }
- },
- "sourceCodes": {
- "2.0.0/extensions/Forwarder/Forwarder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./MixinWeth.sol\";\nimport \"./MixinForwarderCore.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./MixinAssets.sol\";\nimport \"./MixinExchangeWrapper.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract Forwarder is\n LibConstants,\n MixinWeth,\n MixinAssets,\n MixinExchangeWrapper,\n MixinForwarderCore\n{\n constructor (\n address _exchange,\n bytes memory _zrxAssetData,\n bytes memory _wethAssetData\n )\n public\n LibConstants(\n _exchange,\n _zrxAssetData,\n _wethAssetData\n )\n MixinForwarderCore()\n {}\n}\n",
- "2.0.0/extensions/Forwarder/MixinAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"../../tokens/ERC20Token/IERC20Token.sol\";\nimport \"../../tokens/ERC721Token/IERC721Token.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MAssets.sol\";\n\n\ncontract MixinAssets is\n Ownable,\n LibConstants,\n MAssets\n{\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_TRANSFER_SELECTOR = bytes4(keccak256(\"transfer(address,uint256)\"));\n\n /// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to \n /// function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be\n /// used to withdraw assets that were accidentally sent to this contract.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of ERC20 token to withdraw.\n function withdrawAsset(\n bytes assetData,\n uint256 amount\n )\n external\n onlyOwner\n {\n transferAssetToSender(assetData, amount);\n }\n\n /// @dev Transfers given amount of asset to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferAssetToSender(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n bytes4 proxyId = assetData.readBytes4(0);\n\n if (proxyId == ERC20_DATA_ID) {\n transferERC20Token(assetData, amount);\n } else if (proxyId == ERC721_DATA_ID) {\n transferERC721Token(assetData, amount);\n } else {\n revert(\"UNSUPPORTED_ASSET_PROXY\");\n }\n }\n\n /// @dev Decodes ERC20 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC20Token(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n address token = assetData.readAddress(16);\n\n // Transfer tokens.\n // We do a raw call so we can check the success separate\n // from the return data.\n bool success = token.call(abi.encodeWithSelector(\n ERC20_TRANSFER_SELECTOR,\n msg.sender,\n amount\n ));\n require(\n success,\n \"TRANSFER_FAILED\"\n );\n \n // Check return data.\n // If there is no return data, we assume the token incorrectly\n // does not return a bool. In this case we expect it to revert\n // on failure, which was handled above.\n // If the token does return data, we require that it is a single\n // value that evaluates to true.\n assembly {\n if returndatasize {\n success := 0\n if eq(returndatasize, 32) {\n // First 64 bytes of memory are reserved scratch space\n returndatacopy(0, 0, 32)\n success := mload(0)\n }\n }\n }\n require(\n success,\n \"TRANSFER_FAILED\"\n );\n }\n\n /// @dev Decodes ERC721 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC721Token(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n require(\n amount == 1,\n \"INVALID_AMOUNT\"\n );\n // Decode asset data.\n address token = assetData.readAddress(16);\n uint256 tokenId = assetData.readUint256(36);\n\n // Perform transfer.\n IERC721Token(token).transferFrom(\n address(this),\n msg.sender,\n tokenId\n );\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MExchangeWrapper.sol\";\nimport \"../../protocol/Exchange/libs/LibAbiEncoder.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../protocol/Exchange/libs/LibFillResults.sol\";\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\n\n\ncontract MixinExchangeWrapper is\n LibAbiEncoder,\n LibFillResults,\n LibMath,\n LibConstants,\n MExchangeWrapper\n{\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n // ABI encode calldata for `fillOrder`\n bytes memory fillOrderCalldata = abiEncodeFillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n\n address exchange = address(EXCHANGE);\n\n // Call `fillOrder` and handle any exceptions gracefully\n assembly {\n let success := call(\n gas, // forward all gas\n exchange, // call address of Exchange contract\n 0, // transfer 0 wei\n add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes)\n mload(fillOrderCalldata), // length of input\n fillOrderCalldata, // write output over input\n 128 // output size is 128 bytes\n )\n if success {\n mstore(fillResults, mload(fillOrderCalldata))\n mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32)))\n mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64)))\n mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96)))\n }\n }\n // fillResults values will be 0 by default if call was unsuccessful\n return fillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of WETH has been sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param wethSellAmount Desired amount of WETH to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellWeth(\n LibOrder.Order[] memory orders,\n uint256 wethSellAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // We assume that asset being sold by taker is WETH for each order.\n orders[i].makerAssetData = makerAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of WETH to sell\n uint256 remainingTakerAssetFillAmount = safeSub(wethSellAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of WETH\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= wethSellAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// The asset being sold by taker must always be WETH.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyExactAmountWithWeth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // We assume that asset being sold by taker is WETH for each order.\n orders[i].makerAssetData = makerAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n uint256 makerAssetFilledAmount = totalFillResults.makerAssetFilledAmount;\n if (makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n\n require(\n makerAssetFilledAmount >= makerAssetFillAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return totalFillResults;\n }\n\n /// @dev Buys zrxBuyAmount of ZRX fee tokens, taking into account ZRX fees for each order. This will guarantee\n /// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues).\n /// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX\n /// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases.\n /// The asset being sold by taker must always be WETH. \n /// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset.\n /// @param zrxBuyAmount Desired amount of ZRX to buy.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return totalFillResults Amounts filled and fees paid by maker and taker.\n function marketBuyExactZrxWithWeth(\n LibOrder.Order[] memory orders,\n uint256 zrxBuyAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n // Do nothing if zrxBuyAmount == 0\n if (zrxBuyAmount == 0) {\n return totalFillResults;\n }\n\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n uint256 zrxPurchased = 0;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // All of these are ZRX/WETH, so we can drop the respective assetData from calldata.\n orders[i].makerAssetData = zrxAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of ZRX to buy.\n uint256 remainingZrxBuyAmount = safeSub(zrxBuyAmount, zrxPurchased);\n\n // Convert the remaining amount of ZRX to buy into remaining amount\n // of WETH to sell, assuming entire amount can be sold in the current order.\n uint256 remainingWethSellAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n safeSub(orders[i].makerAssetAmount, orders[i].takerFee), // our exchange rate after fees \n remainingZrxBuyAmount\n );\n\n // Attempt to sell the remaining amount of WETH.\n FillResults memory singleFillResult = fillOrderNoThrow(\n orders[i],\n safeAdd(remainingWethSellAmount, 1), // we add 1 wei to the fill amount to make up for rounding errors\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker.\n addFillResults(totalFillResults, singleFillResult);\n zrxPurchased = safeSub(totalFillResults.makerAssetFilledAmount, totalFillResults.takerFeePaid);\n\n // Stop execution if the entire amount of ZRX has been bought.\n if (zrxPurchased >= zrxBuyAmount) {\n break;\n }\n }\n\n require(\n zrxPurchased >= zrxBuyAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return totalFillResults;\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinForwarderCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MWeth.sol\";\nimport \"./mixins/MAssets.sol\";\nimport \"./mixins/MExchangeWrapper.sol\";\nimport \"./interfaces/IForwarderCore.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../protocol/Exchange/libs/LibFillResults.sol\";\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\n\n\ncontract MixinForwarderCore is\n LibFillResults,\n LibMath,\n LibConstants,\n MWeth,\n MAssets,\n MExchangeWrapper,\n IForwarderCore\n{\n using LibBytes for bytes;\n\n /// @dev Constructor approves ERC20 proxy to transfer ZRX and WETH on this contract's behalf.\n constructor ()\n public\n {\n address proxyAddress = EXCHANGE.getAssetProxy(ERC20_DATA_ID);\n require(\n proxyAddress != address(0),\n \"UNREGISTERED_ASSET_PROXY\"\n );\n ETHER_TOKEN.approve(proxyAddress, MAX_UINT);\n ZRX_TOKEN.approve(proxyAddress, MAX_UINT);\n }\n\n /// @dev Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketSellOrdersWithEth(\n LibOrder.Order[] memory orders,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n FillResults memory orderFillResults,\n FillResults memory feeOrderFillResults\n )\n {\n // Convert ETH to WETH.\n convertEthToWeth();\n\n uint256 wethSellAmount;\n uint256 zrxBuyAmount;\n uint256 makerAssetAmountPurchased;\n if (orders[0].makerAssetData.equals(ZRX_ASSET_DATA)) {\n // Calculate amount of WETH that won't be spent on ETH fees.\n wethSellAmount = getPartialAmountFloor(\n PERCENTAGE_DENOMINATOR,\n safeAdd(PERCENTAGE_DENOMINATOR, feePercentage),\n msg.value\n );\n // Market sell available WETH.\n // ZRX fees are paid with this contract's balance.\n orderFillResults = marketSellWeth(\n orders,\n wethSellAmount,\n signatures\n );\n // The fee amount must be deducted from the amount transfered back to sender.\n makerAssetAmountPurchased = safeSub(orderFillResults.makerAssetFilledAmount, orderFillResults.takerFeePaid);\n } else {\n // 5% of WETH is reserved for filling feeOrders and paying feeRecipient.\n wethSellAmount = getPartialAmountFloor(\n MAX_WETH_FILL_PERCENTAGE,\n PERCENTAGE_DENOMINATOR,\n msg.value\n );\n // Market sell 95% of WETH.\n // ZRX fees are payed with this contract's balance.\n orderFillResults = marketSellWeth(\n orders,\n wethSellAmount,\n signatures\n );\n // Buy back all ZRX spent on fees.\n zrxBuyAmount = orderFillResults.takerFeePaid;\n feeOrderFillResults = marketBuyExactZrxWithWeth(\n feeOrders,\n zrxBuyAmount,\n feeSignatures\n );\n makerAssetAmountPurchased = orderFillResults.makerAssetFilledAmount;\n }\n\n // Transfer feePercentage of total ETH spent on primary orders to feeRecipient.\n // Refund remaining ETH to msg.sender.\n transferEthFeeAndRefund(\n orderFillResults.takerAssetFilledAmount,\n feeOrderFillResults.takerAssetFilledAmount,\n feePercentage,\n feeRecipient\n );\n\n // Transfer purchased assets to msg.sender.\n transferAssetToSender(orders[0].makerAssetData, makerAssetAmountPurchased);\n }\n\n /// @dev Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param makerAssetFillAmount Desired amount of makerAsset to purchase.\n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketBuyOrdersWithEth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n FillResults memory orderFillResults,\n FillResults memory feeOrderFillResults\n )\n {\n // Convert ETH to WETH.\n convertEthToWeth();\n\n uint256 zrxBuyAmount;\n uint256 makerAssetAmountPurchased;\n if (orders[0].makerAssetData.equals(ZRX_ASSET_DATA)) {\n // If the makerAsset is ZRX, it is not necessary to pay fees out of this\n // contracts's ZRX balance because fees are factored into the price of the order.\n orderFillResults = marketBuyExactZrxWithWeth(\n orders,\n makerAssetFillAmount,\n signatures\n );\n // The fee amount must be deducted from the amount transfered back to sender.\n makerAssetAmountPurchased = safeSub(orderFillResults.makerAssetFilledAmount, orderFillResults.takerFeePaid);\n } else {\n // Attemp to purchase desired amount of makerAsset.\n // ZRX fees are payed with this contract's balance.\n orderFillResults = marketBuyExactAmountWithWeth(\n orders,\n makerAssetFillAmount,\n signatures\n );\n // Buy back all ZRX spent on fees.\n zrxBuyAmount = orderFillResults.takerFeePaid;\n feeOrderFillResults = marketBuyExactZrxWithWeth(\n feeOrders,\n zrxBuyAmount,\n feeSignatures\n );\n makerAssetAmountPurchased = orderFillResults.makerAssetFilledAmount;\n }\n\n // Transfer feePercentage of total ETH spent on primary orders to feeRecipient.\n // Refund remaining ETH to msg.sender.\n transferEthFeeAndRefund(\n orderFillResults.takerAssetFilledAmount,\n feeOrderFillResults.takerAssetFilledAmount,\n feePercentage,\n feeRecipient\n );\n\n // Transfer purchased assets to msg.sender.\n transferAssetToSender(orders[0].makerAssetData, makerAssetAmountPurchased);\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinWeth.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MWeth.sol\";\n\n\ncontract MixinWeth is\n LibMath,\n LibConstants,\n MWeth\n{\n /// @dev Default payabale function, this allows us to withdraw WETH\n function ()\n public\n payable\n {\n require(\n msg.sender == address(ETHER_TOKEN),\n \"DEFAULT_FUNCTION_WETH_CONTRACT_ONLY\"\n );\n }\n\n /// @dev Converts message call's ETH value into WETH.\n function convertEthToWeth()\n internal\n {\n require(\n msg.value > 0,\n \"INVALID_MSG_VALUE\"\n );\n ETHER_TOKEN.deposit.value(msg.value)();\n }\n\n /// @dev Transfers feePercentage of WETH spent on primary orders to feeRecipient.\n /// Refunds any excess ETH to msg.sender.\n /// @param wethSoldExcludingFeeOrders Amount of WETH sold when filling primary orders.\n /// @param wethSoldForZrx Amount of WETH sold when purchasing ZRX required for primary order fees.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n function transferEthFeeAndRefund(\n uint256 wethSoldExcludingFeeOrders,\n uint256 wethSoldForZrx,\n uint256 feePercentage,\n address feeRecipient\n )\n internal\n {\n // Ensure feePercentage is less than 5%.\n require(\n feePercentage <= MAX_FEE_PERCENTAGE,\n \"FEE_PERCENTAGE_TOO_LARGE\"\n );\n\n // Ensure that no extra WETH owned by this contract has been sold.\n uint256 wethSold = safeAdd(wethSoldExcludingFeeOrders, wethSoldForZrx);\n require(\n wethSold <= msg.value,\n \"OVERSOLD_WETH\"\n );\n\n // Calculate amount of WETH that hasn't been sold.\n uint256 wethRemaining = safeSub(msg.value, wethSold);\n\n // Calculate ETH fee to pay to feeRecipient.\n uint256 ethFee = getPartialAmountFloor(\n feePercentage,\n PERCENTAGE_DENOMINATOR,\n wethSoldExcludingFeeOrders\n );\n\n // Ensure fee is less than amount of WETH remaining.\n require(\n ethFee <= wethRemaining,\n \"INSUFFICIENT_ETH_REMAINING\"\n );\n \n // Do nothing if no WETH remaining\n if (wethRemaining > 0) {\n // Convert remaining WETH to ETH\n ETHER_TOKEN.withdraw(wethRemaining);\n\n // Pay ETH to feeRecipient\n if (ethFee > 0) {\n feeRecipient.transfer(ethFee);\n }\n\n // Refund remaining ETH to msg.sender.\n uint256 ethRefund = safeSub(wethRemaining, ethFee);\n if (ethRefund > 0) {\n msg.sender.transfer(ethRefund);\n }\n }\n }\n}\n",
- "2.0.0/extensions/Forwarder/interfaces/IAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IAssets {\n\n /// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to \n /// function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be\n /// used to withdraw assets that were accidentally sent to this contract.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of ERC20 token to withdraw.\n function withdrawAsset(\n bytes assetData,\n uint256 amount\n )\n external;\n}\n",
- "2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../../protocol/Exchange/libs/LibFillResults.sol\";\n\n\ncontract IForwarderCore {\n\n /// @dev Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketSellOrdersWithEth(\n LibOrder.Order[] memory orders,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n LibFillResults.FillResults memory orderFillResults,\n LibFillResults.FillResults memory feeOrderFillResults\n );\n\n /// @dev Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param makerAssetFillAmount Desired amount of makerAsset to purchase.\n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketBuyOrdersWithEth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n LibFillResults.FillResults memory orderFillResults,\n LibFillResults.FillResults memory feeOrderFillResults\n );\n}\n",
- "2.0.0/extensions/Forwarder/libs/LibConstants.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/LibBytes/LibBytes.sol\";\nimport \"../../../protocol/Exchange/interfaces/IExchange.sol\";\nimport \"../../../tokens/EtherToken/IEtherToken.sol\";\nimport \"../../../tokens/ERC20Token/IERC20Token.sol\";\n\n\ncontract LibConstants {\n\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n uint256 constant internal MAX_UINT = 2**256 - 1;\n uint256 constant internal PERCENTAGE_DENOMINATOR = 10**18; \n uint256 constant internal MAX_FEE_PERCENTAGE = 5 * PERCENTAGE_DENOMINATOR / 100; // 5%\n uint256 constant internal MAX_WETH_FILL_PERCENTAGE = 95 * PERCENTAGE_DENOMINATOR / 100; // 95%\n \n // solhint-disable var-name-mixedcase\n IExchange internal EXCHANGE;\n IEtherToken internal ETHER_TOKEN;\n IERC20Token internal ZRX_TOKEN;\n bytes internal ZRX_ASSET_DATA;\n bytes internal WETH_ASSET_DATA;\n // solhint-enable var-name-mixedcase\n\n constructor (\n address _exchange,\n bytes memory _zrxAssetData,\n bytes memory _wethAssetData\n )\n public\n {\n EXCHANGE = IExchange(_exchange);\n ZRX_ASSET_DATA = _zrxAssetData;\n WETH_ASSET_DATA = _wethAssetData;\n\n address etherToken = _wethAssetData.readAddress(16);\n address zrxToken = _zrxAssetData.readAddress(16);\n ETHER_TOKEN = IEtherToken(etherToken);\n ZRX_TOKEN = IERC20Token(zrxToken);\n }\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAssets.sol\";\n\n\ncontract MAssets is\n IAssets\n{\n /// @dev Transfers given amount of asset to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferAssetToSender(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n\n /// @dev Decodes ERC20 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC20Token(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n\n /// @dev Decodes ERC721 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC721Token(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../../protocol/Exchange/libs/LibFillResults.sol\";\n\n\ncontract MExchangeWrapper {\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of WETH has been sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param wethSellAmount Desired amount of WETH to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellWeth(\n LibOrder.Order[] memory orders,\n uint256 wethSellAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// The asset being sold by taker must always be WETH.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyExactAmountWithWeth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Buys zrxBuyAmount of ZRX fee tokens, taking into account ZRX fees for each order. This will guarantee\n /// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues).\n /// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX\n /// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases.\n /// The asset being sold by taker must always be WETH. \n /// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset.\n /// @param zrxBuyAmount Desired amount of ZRX to buy.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return totalFillResults Amounts filled and fees paid by maker and taker.\n function marketBuyExactZrxWithWeth(\n LibOrder.Order[] memory orders,\n uint256 zrxBuyAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MWeth.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract MWeth {\n\n /// @dev Converts message call's ETH value into WETH.\n function convertEthToWeth()\n internal;\n\n /// @dev Transfers feePercentage of WETH spent on primary orders to feeRecipient.\n /// Refunds any excess ETH to msg.sender.\n /// @param wethSoldExcludingFeeOrders Amount of WETH sold when filling primary orders.\n /// @param wethSoldForZrx Amount of WETH sold when purchasing ZRX required for primary order fees.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n function transferEthFeeAndRefund(\n uint256 wethSoldExcludingFeeOrders,\n uint256 wethSoldForZrx,\n uint256 feePercentage,\n address feeRecipient\n )\n internal;\n}\n",
- "2.0.0/extensions/OrderValidator/OrderValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../protocol/Exchange/interfaces/IExchange.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../tokens/ERC20Token/IERC20Token.sol\";\nimport \"../../tokens/ERC721Token/IERC721Token.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\n\n\ncontract OrderValidator {\n\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n\n struct TraderInfo {\n uint256 makerBalance; // Maker's balance of makerAsset\n uint256 makerAllowance; // Maker's allowance to corresponding AssetProxy\n uint256 takerBalance; // Taker's balance of takerAsset\n uint256 takerAllowance; // Taker's allowance to corresponding AssetProxy\n uint256 makerZrxBalance; // Maker's balance of ZRX\n uint256 makerZrxAllowance; // Maker's allowance of ZRX to ERC20Proxy\n uint256 takerZrxBalance; // Taker's balance of ZRX\n uint256 takerZrxAllowance; // Taker's allowance of ZRX to ERC20Proxy\n }\n\n // solhint-disable var-name-mixedcase\n IExchange internal EXCHANGE;\n bytes internal ZRX_ASSET_DATA;\n // solhint-enable var-name-mixedcase\n\n constructor (address _exchange, bytes memory _zrxAssetData)\n public\n {\n EXCHANGE = IExchange(_exchange);\n ZRX_ASSET_DATA = _zrxAssetData;\n }\n\n /// @dev Fetches information for order and maker/taker of order.\n /// @param order The order structure.\n /// @param takerAddress Address that will be filling the order.\n /// @return OrderInfo and TraderInfo instances for given order.\n function getOrderAndTraderInfo(LibOrder.Order memory order, address takerAddress)\n public\n view\n returns (LibOrder.OrderInfo memory orderInfo, TraderInfo memory traderInfo)\n {\n orderInfo = EXCHANGE.getOrderInfo(order);\n traderInfo = getTraderInfo(order, takerAddress);\n return (orderInfo, traderInfo);\n }\n\n /// @dev Fetches information for all passed in orders and the makers/takers of each order.\n /// @param orders Array of order specifications.\n /// @param takerAddresses Array of taker addresses corresponding to each order.\n /// @return Arrays of OrderInfo and TraderInfo instances that correspond to each order.\n function getOrdersAndTradersInfo(LibOrder.Order[] memory orders, address[] memory takerAddresses)\n public\n view\n returns (LibOrder.OrderInfo[] memory ordersInfo, TraderInfo[] memory tradersInfo)\n {\n ordersInfo = EXCHANGE.getOrdersInfo(orders);\n tradersInfo = getTradersInfo(orders, takerAddresses);\n return (ordersInfo, tradersInfo);\n }\n\n /// @dev Fetches balance and allowances for maker and taker of order.\n /// @param order The order structure.\n /// @param takerAddress Address that will be filling the order.\n /// @return Balances and allowances of maker and taker of order.\n function getTraderInfo(LibOrder.Order memory order, address takerAddress)\n public\n view\n returns (TraderInfo memory traderInfo)\n {\n (traderInfo.makerBalance, traderInfo.makerAllowance) = getBalanceAndAllowance(order.makerAddress, order.makerAssetData);\n (traderInfo.takerBalance, traderInfo.takerAllowance) = getBalanceAndAllowance(takerAddress, order.takerAssetData);\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n (traderInfo.makerZrxBalance, traderInfo.makerZrxAllowance) = getBalanceAndAllowance(order.makerAddress, zrxAssetData);\n (traderInfo.takerZrxBalance, traderInfo.takerZrxAllowance) = getBalanceAndAllowance(takerAddress, zrxAssetData);\n return traderInfo;\n }\n\n /// @dev Fetches balances and allowances of maker and taker for each provided order.\n /// @param orders Array of order specifications.\n /// @param takerAddresses Array of taker addresses corresponding to each order.\n /// @return Array of balances and allowances for maker and taker of each order.\n function getTradersInfo(LibOrder.Order[] memory orders, address[] memory takerAddresses)\n public\n view\n returns (TraderInfo[] memory)\n {\n uint256 ordersLength = orders.length;\n TraderInfo[] memory tradersInfo = new TraderInfo[](ordersLength);\n for (uint256 i = 0; i != ordersLength; i++) {\n tradersInfo[i] = getTraderInfo(orders[i], takerAddresses[i]);\n }\n return tradersInfo;\n }\n\n /// @dev Fetches token balances and allowances of an address to given assetProxy. Supports ERC20 and ERC721.\n /// @param target Address to fetch balances and allowances of.\n /// @param assetData Encoded data that can be decoded by a specified proxy contract when transferring asset.\n /// @return Balance of asset and allowance set to given proxy of asset.\n /// For ERC721 tokens, these values will always be 1 or 0.\n function getBalanceAndAllowance(address target, bytes memory assetData)\n public\n view\n returns (uint256 balance, uint256 allowance)\n {\n bytes4 assetProxyId = assetData.readBytes4(0);\n address token = assetData.readAddress(16);\n address assetProxy = EXCHANGE.getAssetProxy(assetProxyId);\n\n if (assetProxyId == ERC20_DATA_ID) {\n // Query balance\n balance = IERC20Token(token).balanceOf(target);\n\n // Query allowance\n allowance = IERC20Token(token).allowance(target, assetProxy);\n } else if (assetProxyId == ERC721_DATA_ID) {\n uint256 tokenId = assetData.readUint256(36);\n\n // Query owner of tokenId\n address owner = getERC721TokenOwner(token, tokenId);\n\n // Set balance to 1 if tokenId is owned by target\n balance = target == owner ? 1 : 0;\n\n // Check if ERC721Proxy is approved to spend tokenId\n bool isApproved = IERC721Token(token).isApprovedForAll(target, assetProxy) || IERC721Token(token).getApproved(tokenId) == assetProxy;\n \n // Set alowance to 1 if ERC721Proxy is approved to spend tokenId\n allowance = isApproved ? 1 : 0;\n } else {\n revert(\"UNSUPPORTED_ASSET_PROXY\");\n }\n return (balance, allowance);\n }\n\n /// @dev Fetches token balances and allowances of an address for each given assetProxy. Supports ERC20 and ERC721.\n /// @param target Address to fetch balances and allowances of.\n /// @param assetData Array of encoded byte arrays that can be decoded by a specified proxy contract when transferring asset.\n /// @return Balances and allowances of assets.\n /// For ERC721 tokens, these values will always be 1 or 0.\n function getBalancesAndAllowances(address target, bytes[] memory assetData)\n public\n view\n returns (uint256[] memory, uint256[] memory)\n {\n uint256 length = assetData.length;\n uint256[] memory balances = new uint256[](length);\n uint256[] memory allowances = new uint256[](length);\n for (uint256 i = 0; i != length; i++) {\n (balances[i], allowances[i]) = getBalanceAndAllowance(target, assetData[i]);\n }\n return (balances, allowances);\n }\n\n /// @dev Calls `token.ownerOf(tokenId)`, but returns a null owner instead of reverting on an unowned token.\n /// @param token Address of ERC721 token.\n /// @param tokenId The identifier for the specific NFT.\n /// @return Owner of tokenId or null address if unowned.\n function getERC721TokenOwner(address token, uint256 tokenId)\n public\n view\n returns (address owner)\n {\n assembly {\n // load free memory pointer\n let cdStart := mload(64)\n\n // bytes4(keccak256(ownerOf(uint256))) = 0x6352211e\n mstore(cdStart, 0x6352211e00000000000000000000000000000000000000000000000000000000)\n mstore(add(cdStart, 4), tokenId)\n\n // staticcall `ownerOf(tokenId)`\n // `ownerOf` will revert if tokenId is not owned\n let success := staticcall(\n gas, // forward all gas\n token, // call token contract\n cdStart, // start of calldata\n 36, // length of input is 36 bytes\n cdStart, // write output over input\n 32 // size of output is 32 bytes\n )\n\n // Success implies that tokenId is owned\n // Copy owner from return data if successful\n if success {\n owner := mload(cdStart)\n } \n }\n\n // Owner initialized to address(0), no need to modify if call is unsuccessful\n return owner;\n }\n}\n",
- "2.0.0/multisig/MultiSigWallet.sol": "// solhint-disable\npragma solidity ^0.4.15;\n\n\n/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.\n/// @author Stefan George - <stefan.george@consensys.net>\ncontract MultiSigWallet {\n\n /*\n * Events\n */\n event Confirmation(address indexed sender, uint indexed transactionId);\n event Revocation(address indexed sender, uint indexed transactionId);\n event Submission(uint indexed transactionId);\n event Execution(uint indexed transactionId);\n event ExecutionFailure(uint indexed transactionId);\n event Deposit(address indexed sender, uint value);\n event OwnerAddition(address indexed owner);\n event OwnerRemoval(address indexed owner);\n event RequirementChange(uint required);\n\n /*\n * Constants\n */\n uint constant public MAX_OWNER_COUNT = 50;\n\n /*\n * Storage\n */\n mapping (uint => Transaction) public transactions;\n mapping (uint => mapping (address => bool)) public confirmations;\n mapping (address => bool) public isOwner;\n address[] public owners;\n uint public required;\n uint public transactionCount;\n\n struct Transaction {\n address destination;\n uint value;\n bytes data;\n bool executed;\n }\n\n /*\n * Modifiers\n */\n modifier onlyWallet() {\n require(msg.sender == address(this));\n _;\n }\n\n modifier ownerDoesNotExist(address owner) {\n require(!isOwner[owner]);\n _;\n }\n\n modifier ownerExists(address owner) {\n require(isOwner[owner]);\n _;\n }\n\n modifier transactionExists(uint transactionId) {\n require(transactions[transactionId].destination != 0);\n _;\n }\n\n modifier confirmed(uint transactionId, address owner) {\n require(confirmations[transactionId][owner]);\n _;\n }\n\n modifier notConfirmed(uint transactionId, address owner) {\n require(!confirmations[transactionId][owner]);\n _;\n }\n\n modifier notExecuted(uint transactionId) {\n require(!transactions[transactionId].executed);\n _;\n }\n\n modifier notNull(address _address) {\n require(_address != 0);\n _;\n }\n\n modifier validRequirement(uint ownerCount, uint _required) {\n require(ownerCount <= MAX_OWNER_COUNT\n && _required <= ownerCount\n && _required != 0\n && ownerCount != 0);\n _;\n }\n\n /// @dev Fallback function allows to deposit ether.\n function()\n payable\n {\n if (msg.value > 0)\n Deposit(msg.sender, msg.value);\n }\n\n /*\n * Public functions\n */\n /// @dev Contract constructor sets initial owners and required number of confirmations.\n /// @param _owners List of initial owners.\n /// @param _required Number of required confirmations.\n function MultiSigWallet(address[] _owners, uint _required)\n public\n validRequirement(_owners.length, _required)\n {\n for (uint i=0; i<_owners.length; i++) {\n require(!isOwner[_owners[i]] && _owners[i] != 0);\n isOwner[_owners[i]] = true;\n }\n owners = _owners;\n required = _required;\n }\n\n /// @dev Allows to add a new owner. Transaction has to be sent by wallet.\n /// @param owner Address of new owner.\n function addOwner(address owner)\n public\n onlyWallet\n ownerDoesNotExist(owner)\n notNull(owner)\n validRequirement(owners.length + 1, required)\n {\n isOwner[owner] = true;\n owners.push(owner);\n OwnerAddition(owner);\n }\n\n /// @dev Allows to remove an owner. Transaction has to be sent by wallet.\n /// @param owner Address of owner.\n function removeOwner(address owner)\n public\n onlyWallet\n ownerExists(owner)\n {\n isOwner[owner] = false;\n for (uint i=0; i<owners.length - 1; i++)\n if (owners[i] == owner) {\n owners[i] = owners[owners.length - 1];\n break;\n }\n owners.length -= 1;\n if (required > owners.length)\n changeRequirement(owners.length);\n OwnerRemoval(owner);\n }\n\n /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet.\n /// @param owner Address of owner to be replaced.\n /// @param newOwner Address of new owner.\n function replaceOwner(address owner, address newOwner)\n public\n onlyWallet\n ownerExists(owner)\n ownerDoesNotExist(newOwner)\n {\n for (uint i=0; i<owners.length; i++)\n if (owners[i] == owner) {\n owners[i] = newOwner;\n break;\n }\n isOwner[owner] = false;\n isOwner[newOwner] = true;\n OwnerRemoval(owner);\n OwnerAddition(newOwner);\n }\n\n /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet.\n /// @param _required Number of required confirmations.\n function changeRequirement(uint _required)\n public\n onlyWallet\n validRequirement(owners.length, _required)\n {\n required = _required;\n RequirementChange(_required);\n }\n\n /// @dev Allows an owner to submit and confirm a transaction.\n /// @param destination Transaction target address.\n /// @param value Transaction ether value.\n /// @param data Transaction data payload.\n /// @return Returns transaction ID.\n function submitTransaction(address destination, uint value, bytes data)\n public\n returns (uint transactionId)\n {\n transactionId = addTransaction(destination, value, data);\n confirmTransaction(transactionId);\n }\n\n /// @dev Allows an owner to confirm a transaction.\n /// @param transactionId Transaction ID.\n function confirmTransaction(uint transactionId)\n public\n ownerExists(msg.sender)\n transactionExists(transactionId)\n notConfirmed(transactionId, msg.sender)\n {\n confirmations[transactionId][msg.sender] = true;\n Confirmation(msg.sender, transactionId);\n executeTransaction(transactionId);\n }\n\n /// @dev Allows an owner to revoke a confirmation for a transaction.\n /// @param transactionId Transaction ID.\n function revokeConfirmation(uint transactionId)\n public\n ownerExists(msg.sender)\n confirmed(transactionId, msg.sender)\n notExecuted(transactionId)\n {\n confirmations[transactionId][msg.sender] = false;\n Revocation(msg.sender, transactionId);\n }\n\n /// @dev Allows anyone to execute a confirmed transaction.\n /// @param transactionId Transaction ID.\n function executeTransaction(uint transactionId)\n public\n ownerExists(msg.sender)\n confirmed(transactionId, msg.sender)\n notExecuted(transactionId)\n {\n if (isConfirmed(transactionId)) {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data))\n Execution(transactionId);\n else {\n ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n }\n\n // call has been separated into its own function in order to take advantage\n // of the Solidity's code generator to produce a loop that copies tx.data into memory.\n function external_call(address destination, uint value, uint dataLength, bytes data) internal returns (bool) {\n bool result;\n assembly {\n let x := mload(0x40) // \"Allocate\" memory for output (0x40 is where \"free memory\" pointer is stored by convention)\n let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that\n result := call(\n sub(gas, 34710), // 34710 is the value that solidity is currently emitting\n // It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) +\n // callNewAccountGas (25000, in case the destination address does not exist and needs creating)\n destination,\n value,\n d,\n dataLength, // Size of the input (in bytes) - this is what fixes the padding problem\n x,\n 0 // Output is ignored, therefore the output size is zero\n )\n }\n return result;\n }\n\n /// @dev Returns the confirmation status of a transaction.\n /// @param transactionId Transaction ID.\n /// @return Confirmation status.\n function isConfirmed(uint transactionId)\n public\n constant\n returns (bool)\n {\n uint count = 0;\n for (uint i=0; i<owners.length; i++) {\n if (confirmations[transactionId][owners[i]])\n count += 1;\n if (count == required)\n return true;\n }\n }\n\n /*\n * Internal functions\n */\n /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet.\n /// @param destination Transaction target address.\n /// @param value Transaction ether value.\n /// @param data Transaction data payload.\n /// @return Returns transaction ID.\n function addTransaction(address destination, uint value, bytes data)\n internal\n notNull(destination)\n returns (uint transactionId)\n {\n transactionId = transactionCount;\n transactions[transactionId] = Transaction({\n destination: destination,\n value: value,\n data: data,\n executed: false\n });\n transactionCount += 1;\n Submission(transactionId);\n }\n\n /*\n * Web3 call functions\n */\n /// @dev Returns number of confirmations of a transaction.\n /// @param transactionId Transaction ID.\n /// @return Number of confirmations.\n function getConfirmationCount(uint transactionId)\n public\n constant\n returns (uint count)\n {\n for (uint i=0; i<owners.length; i++)\n if (confirmations[transactionId][owners[i]])\n count += 1;\n }\n\n /// @dev Returns total number of transactions after filers are applied.\n /// @param pending Include pending transactions.\n /// @param executed Include executed transactions.\n /// @return Total number of transactions after filters are applied.\n function getTransactionCount(bool pending, bool executed)\n public\n constant\n returns (uint count)\n {\n for (uint i=0; i<transactionCount; i++)\n if ( pending && !transactions[i].executed\n || executed && transactions[i].executed)\n count += 1;\n }\n\n /// @dev Returns list of owners.\n /// @return List of owner addresses.\n function getOwners()\n public\n constant\n returns (address[])\n {\n return owners;\n }\n\n /// @dev Returns array with owner addresses, which confirmed transaction.\n /// @param transactionId Transaction ID.\n /// @return Returns array of owner addresses.\n function getConfirmations(uint transactionId)\n public\n constant\n returns (address[] _confirmations)\n {\n address[] memory confirmationsTemp = new address[](owners.length);\n uint count = 0;\n uint i;\n for (i=0; i<owners.length; i++)\n if (confirmations[transactionId][owners[i]]) {\n confirmationsTemp[count] = owners[i];\n count += 1;\n }\n _confirmations = new address[](count);\n for (i=0; i<count; i++)\n _confirmations[i] = confirmationsTemp[i];\n }\n\n /// @dev Returns list of transaction IDs in defined range.\n /// @param from Index start position of transaction array.\n /// @param to Index end position of transaction array.\n /// @param pending Include pending transactions.\n /// @param executed Include executed transactions.\n /// @return Returns array of transaction IDs.\n function getTransactionIds(uint from, uint to, bool pending, bool executed)\n public\n constant\n returns (uint[] _transactionIds)\n {\n uint[] memory transactionIdsTemp = new uint[](transactionCount);\n uint count = 0;\n uint i;\n for (i=0; i<transactionCount; i++)\n if ( pending && !transactions[i].executed\n || executed && transactions[i].executed)\n {\n transactionIdsTemp[count] = i;\n count += 1;\n }\n _transactionIds = new uint[](to - from);\n for (i=from; i<to; i++)\n _transactionIds[i - from] = transactionIdsTemp[i];\n }\n}",
- "2.0.0/multisig/MultiSigWalletWithTimeLock.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MultiSigWallet.sol\";\n\n\n/// @title Multisignature wallet with time lock- Allows multiple parties to execute a transaction after a time lock has passed.\n/// @author Amir Bandeali - <amir@0xProject.com>\n// solhint-disable not-rely-on-time\ncontract MultiSigWalletWithTimeLock is\n MultiSigWallet\n{\n event ConfirmationTimeSet(uint256 indexed transactionId, uint256 confirmationTime);\n event TimeLockChange(uint256 secondsTimeLocked);\n\n uint256 public secondsTimeLocked;\n\n mapping (uint256 => uint256) public confirmationTimes;\n\n modifier notFullyConfirmed(uint256 transactionId) {\n require(\n !isConfirmed(transactionId),\n \"TX_FULLY_CONFIRMED\"\n );\n _;\n }\n\n modifier fullyConfirmed(uint256 transactionId) {\n require(\n isConfirmed(transactionId),\n \"TX_NOT_FULLY_CONFIRMED\"\n );\n _;\n }\n\n modifier pastTimeLock(uint256 transactionId) {\n require(\n block.timestamp >= confirmationTimes[transactionId] + secondsTimeLocked,\n \"TIME_LOCK_INCOMPLETE\"\n );\n _;\n }\n\n /// @dev Contract constructor sets initial owners, required number of confirmations, and time lock.\n /// @param _owners List of initial owners.\n /// @param _required Number of required confirmations.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n constructor (\n address[] _owners,\n uint256 _required,\n uint256 _secondsTimeLocked\n )\n public\n MultiSigWallet(_owners, _required)\n {\n secondsTimeLocked = _secondsTimeLocked;\n }\n\n /// @dev Changes the duration of the time lock for transactions.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n function changeTimeLock(uint256 _secondsTimeLocked)\n public\n onlyWallet\n {\n secondsTimeLocked = _secondsTimeLocked;\n emit TimeLockChange(_secondsTimeLocked);\n }\n\n /// @dev Allows an owner to confirm a transaction.\n /// @param transactionId Transaction ID.\n function confirmTransaction(uint256 transactionId)\n public\n ownerExists(msg.sender)\n transactionExists(transactionId)\n notConfirmed(transactionId, msg.sender)\n notFullyConfirmed(transactionId)\n {\n confirmations[transactionId][msg.sender] = true;\n emit Confirmation(msg.sender, transactionId);\n if (isConfirmed(transactionId)) {\n setConfirmationTime(transactionId, block.timestamp);\n }\n }\n\n /// @dev Allows anyone to execute a confirmed transaction.\n /// @param transactionId Transaction ID.\n function executeTransaction(uint256 transactionId)\n public\n notExecuted(transactionId)\n fullyConfirmed(transactionId)\n pastTimeLock(transactionId)\n {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) {\n emit Execution(transactionId);\n } else {\n emit ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n\n /// @dev Sets the time of when a submission first passed.\n function setConfirmationTime(uint256 transactionId, uint256 confirmationTime)\n internal\n {\n confirmationTimes[transactionId] = confirmationTime;\n emit ConfirmationTimeSet(transactionId, confirmationTime);\n }\n}\n",
- "2.0.0/protocol/AssetProxy/ERC20Proxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MixinAuthorizable.sol\";\n\n\ncontract ERC20Proxy is\n MixinAuthorizable\n{\n // Id of this proxy.\n bytes4 constant internal PROXY_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n \n // solhint-disable-next-line payable-fallback\n function () \n external\n {\n assembly {\n // The first 4 bytes of calldata holds the function selector\n let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)\n\n // `transferFrom` will be called with the following parameters:\n // assetData Encoded byte array.\n // from Address to transfer asset from.\n // to Address to transfer asset to.\n // amount Amount of asset to transfer.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {\n\n // To lookup a value in a mapping, we load from the storage location keccak256(k, p),\n // where k is the key left padded to 32 bytes and p is the storage slot\n let start := mload(64)\n mstore(start, and(caller, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(start, 32), authorized_slot)\n\n // Revert if authorized[msg.sender] == false\n if iszero(sload(keccak256(start, 64))) {\n // Revert with `Error(\"SENDER_NOT_AUTHORIZED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // `transferFrom`.\n // The function is marked `external`, so no abi decodeding is done for\n // us. Instead, we expect the `calldata` memory to contain the\n // following:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n //\n // (*): offset is computed from start of function parameters, so offset\n // by an additional 4 bytes in the calldata.\n //\n // (**): see table below to compute length of assetData Contents\n //\n // WARNING: The ABIv2 specification allows additional padding between\n // the Params and Data section. This will result in a larger\n // offset to assetData.\n\n // Asset data itself is encoded as follows:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 1 * 32 | function parameters: |\n // | | 4 | 12 + 20 | 1. token address |\n\n // We construct calldata for the `token.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 4 | | 1. from |\n // | | 36 | | 2. to |\n // | | 68 | | 3. amount |\n\n /////// Read token address from calldata ///////\n // * The token address is stored in `assetData`.\n //\n // * The \"offset to assetData\" is stored at offset 4 in the calldata (table 1).\n // [assetDataOffsetFromParams = calldataload(4)]\n //\n // * Notes that the \"offset to assetData\" is relative to the \"Params\" area of calldata;\n // add 4 bytes to account for the length of the \"Header\" area (table 1).\n // [assetDataOffsetFromHeader = assetDataOffsetFromParams + 4]\n //\n // * The \"token address\" is offset 32+4=36 bytes into \"assetData\" (tables 1 & 2).\n // [tokenOffset = assetDataOffsetFromHeader + 36 = calldataload(4) + 4 + 36]\n let token := calldataload(add(calldataload(4), 40))\n \n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFrom` selector.\n // Any trailing data in transferFromSelector will be\n // overwritten in the next `mstore` call.\n mstore(0, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // We copy the fields `from`, `to` and `amount` in bulk\n // from our own calldata to the new calldata.\n calldatacopy(4, 36, 96)\n\n /////// Call `token.transferFrom` using the calldata ///////\n let success := call(\n gas, // forward all gas\n token, // call address of token contract\n 0, // don't send any ETH\n 0, // pointer to start of input\n 100, // length of input\n 0, // write output over input\n 32 // output size should be 32 bytes\n )\n\n /////// Check return data. ///////\n // If there is no return data, we assume the token incorrectly\n // does not return a bool. In this case we expect it to revert\n // on failure, which was handled above.\n // If the token does return data, we require that it is a single\n // nonzero 32 bytes value.\n // So the transfer succeeded if the call succeeded and either\n // returned nothing, or returned a non-zero 32 byte value. \n success := and(success, or(\n iszero(returndatasize),\n and(\n eq(returndatasize, 32),\n gt(mload(0), 0)\n )\n ))\n if success {\n return(0, 0)\n }\n \n // Revert with `Error(\"TRANSFER_FAILED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // Revert if undefined function is called\n revert(0, 0)\n }\n }\n\n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4)\n {\n return PROXY_ID;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/ERC721Proxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MixinAuthorizable.sol\";\n\n\ncontract ERC721Proxy is\n MixinAuthorizable\n{\n // Id of this proxy.\n bytes4 constant internal PROXY_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n\n // solhint-disable-next-line payable-fallback\n function () \n external\n {\n assembly {\n // The first 4 bytes of calldata holds the function selector\n let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)\n\n // `transferFrom` will be called with the following parameters:\n // assetData Encoded byte array.\n // from Address to transfer asset from.\n // to Address to transfer asset to.\n // amount Amount of asset to transfer.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {\n\n // To lookup a value in a mapping, we load from the storage location keccak256(k, p),\n // where k is the key left padded to 32 bytes and p is the storage slot\n let start := mload(64)\n mstore(start, and(caller, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(start, 32), authorized_slot)\n\n // Revert if authorized[msg.sender] == false\n if iszero(sload(keccak256(start, 64))) {\n // Revert with `Error(\"SENDER_NOT_AUTHORIZED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // `transferFrom`.\n // The function is marked `external`, so no abi decodeding is done for\n // us. Instead, we expect the `calldata` memory to contain the\n // following:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n //\n // (*): offset is computed from start of function parameters, so offset\n // by an additional 4 bytes in the calldata.\n //\n // (**): see table below to compute length of assetData Contents\n //\n // WARNING: The ABIv2 specification allows additional padding between\n // the Params and Data section. This will result in a larger\n // offset to assetData.\n\n // Asset data itself is encoded as follows:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 2 * 32 | function parameters: |\n // | | 4 | 12 + 20 | 1. token address |\n // | | 36 | | 2. tokenId |\n \n // We construct calldata for the `token.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n // \n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 4 | | 1. from |\n // | | 36 | | 2. to |\n // | | 68 | | 3. tokenId |\n\n // There exists only 1 of each token.\n // require(amount == 1, \"INVALID_AMOUNT\")\n if sub(calldataload(100), 1) {\n // Revert with `Error(\"INVALID_AMOUNT\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000e494e56414c49445f414d4f554e540000000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFrom` selector.\n // Any trailing data in transferFromSelector will be\n // overwritten in the next `mstore` call.\n mstore(0, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // We copy the fields `from` and `to` in bulk\n // from our own calldata to the new calldata.\n calldatacopy(4, 36, 64)\n\n // Copy `tokenId` field from our own calldata to the new calldata.\n let assetDataOffset := calldataload(4)\n calldatacopy(68, add(assetDataOffset, 72), 32)\n\n /////// Call `token.transferFrom` using the calldata ///////\n let token := calldataload(add(assetDataOffset, 40))\n let success := call(\n gas, // forward all gas\n token, // call address of token contract\n 0, // don't send any ETH\n 0, // pointer to start of input\n 100, // length of input\n 0, // write output to null\n 0 // output size is 0 bytes\n )\n if success {\n return(0, 0)\n }\n \n // Revert with `Error(\"TRANSFER_FAILED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // Revert if undefined function is called\n revert(0, 0)\n }\n }\n\n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4)\n {\n return PROXY_ID;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/MixinAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"./mixins/MAuthorizable.sol\";\n\n\ncontract MixinAuthorizable is\n Ownable,\n MAuthorizable\n{\n /// @dev Only authorized addresses can invoke functions with this modifier.\n modifier onlyAuthorized {\n require(\n authorized[msg.sender],\n \"SENDER_NOT_AUTHORIZED\"\n );\n _;\n }\n\n mapping (address => bool) public authorized;\n address[] public authorities;\n\n /// @dev Authorizes an address.\n /// @param target Address to authorize.\n function addAuthorizedAddress(address target)\n external\n onlyOwner\n {\n require(\n !authorized[target],\n \"TARGET_ALREADY_AUTHORIZED\"\n );\n\n authorized[target] = true;\n authorities.push(target);\n emit AuthorizedAddressAdded(target, msg.sender);\n }\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n function removeAuthorizedAddress(address target)\n external\n onlyOwner\n {\n require(\n authorized[target],\n \"TARGET_NOT_AUTHORIZED\"\n );\n\n delete authorized[target];\n for (uint256 i = 0; i < authorities.length; i++) {\n if (authorities[i] == target) {\n authorities[i] = authorities[authorities.length - 1];\n authorities.length -= 1;\n break;\n }\n }\n emit AuthorizedAddressRemoved(target, msg.sender);\n }\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n /// @param index Index of target in authorities array.\n function removeAuthorizedAddressAtIndex(\n address target,\n uint256 index\n )\n external\n onlyOwner\n {\n require(\n authorized[target],\n \"TARGET_NOT_AUTHORIZED\"\n );\n require(\n index < authorities.length,\n \"INDEX_OUT_OF_BOUNDS\"\n );\n require(\n authorities[index] == target,\n \"AUTHORIZED_ADDRESS_MISMATCH\"\n );\n\n delete authorized[target];\n authorities[index] = authorities[authorities.length - 1];\n authorities.length -= 1;\n emit AuthorizedAddressRemoved(target, msg.sender);\n }\n\n /// @dev Gets all authorized addresses.\n /// @return Array of authorized addresses.\n function getAuthorizedAddresses()\n external\n view\n returns (address[] memory)\n {\n return authorities;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IAuthorizable.sol\";\n\n\ncontract IAssetProxy is\n IAuthorizable\n{\n /// @dev Transfers assets. Either succeeds or throws.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param from Address to transfer asset from.\n /// @param to Address to transfer asset to.\n /// @param amount Amount of asset to transfer.\n function transferFrom(\n bytes assetData,\n address from,\n address to,\n uint256 amount\n )\n external;\n \n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4);\n}\n",
- "2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/Ownable/IOwnable.sol\";\n\n\ncontract IAuthorizable is\n IOwnable\n{\n /// @dev Authorizes an address.\n /// @param target Address to authorize.\n function addAuthorizedAddress(address target)\n external;\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n function removeAuthorizedAddress(address target)\n external;\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n /// @param index Index of target in authorities array.\n function removeAuthorizedAddressAtIndex(\n address target,\n uint256 index\n )\n external;\n \n /// @dev Gets all authorized addresses.\n /// @return Array of authorized addresses.\n function getAuthorizedAddresses()\n external\n view\n returns (address[] memory);\n}\n",
- "2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAuthorizable.sol\";\n\n\ncontract MAuthorizable is\n IAuthorizable\n{\n // Event logged when a new address is authorized.\n event AuthorizedAddressAdded(\n address indexed target,\n address indexed caller\n );\n\n // Event logged when a currently authorized address is unauthorized.\n event AuthorizedAddressRemoved(\n address indexed target,\n address indexed caller\n );\n\n /// @dev Only authorized addresses can invoke functions with this modifier.\n modifier onlyAuthorized { revert(); _; }\n}\n",
- "2.0.0/protocol/AssetProxyOwner/AssetProxyOwner.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../multisig/MultiSigWalletWithTimeLock.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\n\n\ncontract AssetProxyOwner is\n MultiSigWalletWithTimeLock\n{\n using LibBytes for bytes;\n\n event AssetProxyRegistration(address assetProxyContract, bool isRegistered);\n\n // Mapping of AssetProxy contract address =>\n // if this contract is allowed to call the AssetProxy's `removeAuthorizedAddressAtIndex` method without a time lock.\n mapping (address => bool) public isAssetProxyRegistered;\n\n bytes4 constant internal REMOVE_AUTHORIZED_ADDRESS_AT_INDEX_SELECTOR = bytes4(keccak256(\"removeAuthorizedAddressAtIndex(address,uint256)\"));\n\n /// @dev Function will revert if the transaction does not call `removeAuthorizedAddressAtIndex`\n /// on an approved AssetProxy contract.\n modifier validRemoveAuthorizedAddressAtIndexTx(uint256 transactionId) {\n Transaction storage txn = transactions[transactionId];\n require(\n isAssetProxyRegistered[txn.destination],\n \"UNREGISTERED_ASSET_PROXY\"\n );\n require(\n txn.data.readBytes4(0) == REMOVE_AUTHORIZED_ADDRESS_AT_INDEX_SELECTOR,\n \"INVALID_FUNCTION_SELECTOR\"\n );\n _;\n }\n\n /// @dev Contract constructor sets initial owners, required number of confirmations,\n /// time lock, and list of AssetProxy addresses.\n /// @param _owners List of initial owners.\n /// @param _assetProxyContracts Array of AssetProxy contract addresses.\n /// @param _required Number of required confirmations.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n constructor (\n address[] memory _owners,\n address[] memory _assetProxyContracts,\n uint256 _required,\n uint256 _secondsTimeLocked\n )\n public\n MultiSigWalletWithTimeLock(_owners, _required, _secondsTimeLocked)\n {\n for (uint256 i = 0; i < _assetProxyContracts.length; i++) {\n address assetProxy = _assetProxyContracts[i];\n require(\n assetProxy != address(0),\n \"INVALID_ASSET_PROXY\"\n );\n isAssetProxyRegistered[assetProxy] = true;\n }\n }\n\n /// @dev Registers or deregisters an AssetProxy to be able to execute\n /// `removeAuthorizedAddressAtIndex` without a timelock.\n /// @param assetProxyContract Address of AssetProxy contract.\n /// @param isRegistered Status of approval for AssetProxy contract.\n function registerAssetProxy(address assetProxyContract, bool isRegistered)\n public\n onlyWallet\n notNull(assetProxyContract)\n {\n isAssetProxyRegistered[assetProxyContract] = isRegistered;\n emit AssetProxyRegistration(assetProxyContract, isRegistered);\n }\n\n /// @dev Allows execution of `removeAuthorizedAddressAtIndex` without time lock.\n /// @param transactionId Transaction ID.\n function executeRemoveAuthorizedAddressAtIndex(uint256 transactionId)\n public\n notExecuted(transactionId)\n fullyConfirmed(transactionId)\n validRemoveAuthorizedAddressAtIndexTx(transactionId)\n {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) {\n emit Execution(transactionId);\n } else {\n emit ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/Exchange.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./MixinExchangeCore.sol\";\nimport \"./MixinSignatureValidator.sol\";\nimport \"./MixinWrapperFunctions.sol\";\nimport \"./MixinAssetProxyDispatcher.sol\";\nimport \"./MixinTransactions.sol\";\nimport \"./MixinMatchOrders.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract Exchange is\n MixinExchangeCore,\n MixinMatchOrders,\n MixinSignatureValidator,\n MixinTransactions,\n MixinAssetProxyDispatcher,\n MixinWrapperFunctions\n{\n string constant public VERSION = \"2.0.0\";\n\n // Mixins are instantiated in the order they are inherited\n constructor ()\n public\n MixinExchangeCore()\n MixinMatchOrders()\n MixinSignatureValidator()\n MixinTransactions()\n MixinAssetProxyDispatcher()\n MixinWrapperFunctions()\n {}\n}\n",
- "2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\nimport \"../AssetProxy/interfaces/IAssetProxy.sol\";\n\n\ncontract MixinAssetProxyDispatcher is\n Ownable,\n MAssetProxyDispatcher\n{\n // Mapping from Asset Proxy Id's to their respective Asset Proxy\n mapping (bytes4 => IAssetProxy) public assetProxies;\n\n /// @dev Registers an asset proxy to its asset proxy id.\n /// Once an asset proxy is registered, it cannot be unregistered.\n /// @param assetProxy Address of new asset proxy to register.\n function registerAssetProxy(address assetProxy)\n external\n onlyOwner\n {\n IAssetProxy assetProxyContract = IAssetProxy(assetProxy);\n\n // Ensure that no asset proxy exists with current id.\n bytes4 assetProxyId = assetProxyContract.getProxyId();\n address currentAssetProxy = assetProxies[assetProxyId];\n require(\n currentAssetProxy == address(0),\n \"ASSET_PROXY_ALREADY_EXISTS\"\n );\n\n // Add asset proxy and log registration.\n assetProxies[assetProxyId] = assetProxyContract;\n emit AssetProxyRegistered(\n assetProxyId,\n assetProxy\n );\n }\n\n /// @dev Gets an asset proxy.\n /// @param assetProxyId Id of the asset proxy.\n /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered.\n function getAssetProxy(bytes4 assetProxyId)\n external\n view\n returns (address)\n {\n return assetProxies[assetProxyId];\n }\n\n /// @dev Forwards arguments to assetProxy and calls `transferFrom`. Either succeeds or throws.\n /// @param assetData Byte array encoded for the asset.\n /// @param from Address to transfer token from.\n /// @param to Address to transfer token to.\n /// @param amount Amount of token to transfer.\n function dispatchTransferFrom(\n bytes memory assetData,\n address from,\n address to,\n uint256 amount\n )\n internal\n {\n // Do nothing if no amount should be transferred.\n if (amount > 0 && from != to) {\n // Ensure assetData length is valid\n require(\n assetData.length > 3,\n \"LENGTH_GREATER_THAN_3_REQUIRED\"\n );\n \n // Lookup assetProxy. We do not use `LibBytes.readBytes4` for gas efficiency reasons.\n bytes4 assetProxyId;\n assembly {\n assetProxyId := and(mload(\n add(assetData, 32)),\n 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000\n )\n }\n address assetProxy = assetProxies[assetProxyId];\n\n // Ensure that assetProxy exists\n require(\n assetProxy != address(0),\n \"ASSET_PROXY_DOES_NOT_EXIST\"\n );\n \n // We construct calldata for the `assetProxy.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n // \n // | Area | Offset | Length | Contents |\n // | -------- |--------|---------|-------------------------------------------- |\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n\n assembly {\n /////// Setup State ///////\n // `cdStart` is the start of the calldata for `assetProxy.transferFrom` (equal to free memory ptr).\n let cdStart := mload(64)\n // `dataAreaLength` is the total number of words needed to store `assetData`\n // As-per the ABI spec, this value is padded up to the nearest multiple of 32,\n // and includes 32-bytes for length.\n let dataAreaLength := and(add(mload(assetData), 63), 0xFFFFFFFFFFFE0)\n // `cdEnd` is the end of the calldata for `assetProxy.transferFrom`.\n let cdEnd := add(cdStart, add(132, dataAreaLength))\n\n \n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFromSelector`.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n mstore(cdStart, 0xa85e59e400000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // Each parameter is padded to 32-bytes. The entire Params Area is 128 bytes.\n // Notes:\n // 1. The offset to `assetData` is the length of the Params Area (128 bytes).\n // 2. A 20-byte mask is applied to addresses to zero-out the unused bytes.\n mstore(add(cdStart, 4), 128)\n mstore(add(cdStart, 36), and(from, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(cdStart, 68), and(to, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(cdStart, 100), amount)\n \n /////// Setup Data Area ///////\n // This area holds `assetData`.\n let dataArea := add(cdStart, 132)\n // solhint-disable-next-line no-empty-blocks\n for {} lt(dataArea, cdEnd) {} {\n mstore(dataArea, mload(assetData))\n dataArea := add(dataArea, 32)\n assetData := add(assetData, 32)\n }\n\n /////// Call `assetProxy.transferFrom` using the constructed calldata ///////\n let success := call(\n gas, // forward all gas\n assetProxy, // call address of asset proxy\n 0, // don't send any ETH\n cdStart, // pointer to start of input\n sub(cdEnd, cdStart), // length of input \n cdStart, // write output over input\n 512 // reserve 512 bytes for output\n )\n if iszero(success) {\n revert(cdStart, returndatasize())\n }\n }\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\n\n\ncontract MixinExchangeCore is\n ReentrancyGuard,\n LibConstants,\n LibMath,\n LibOrder,\n LibFillResults,\n MAssetProxyDispatcher,\n MExchangeCore,\n MSignatureValidator,\n MTransactions\n{\n // Mapping of orderHash => amount of takerAsset already bought by maker\n mapping (bytes32 => uint256) public filled;\n\n // Mapping of orderHash => cancelled\n mapping (bytes32 => bool) public cancelled;\n\n // Mapping of makerAddress => senderAddress => lowest salt an order can have in order to be fillable\n // Orders with specified senderAddress and with a salt less than their epoch are considered cancelled\n mapping (address => mapping (address => uint256)) public orderEpoch;\n\n /// @dev Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch\n /// and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress).\n /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled.\n function cancelOrdersUpTo(uint256 targetOrderEpoch)\n external\n nonReentrant\n {\n address makerAddress = getCurrentContextAddress();\n // If this function is called via `executeTransaction`, we only update the orderEpoch for the makerAddress/msg.sender combination.\n // This allows external filter contracts to add rules to how orders are cancelled via this function.\n address senderAddress = makerAddress == msg.sender ? address(0) : msg.sender;\n\n // orderEpoch is initialized to 0, so to cancelUpTo we need salt + 1\n uint256 newOrderEpoch = targetOrderEpoch + 1; \n uint256 oldOrderEpoch = orderEpoch[makerAddress][senderAddress];\n\n // Ensure orderEpoch is monotonically increasing\n require(\n newOrderEpoch > oldOrderEpoch, \n \"INVALID_NEW_ORDER_EPOCH\"\n );\n\n // Update orderEpoch\n orderEpoch[makerAddress][senderAddress] = newOrderEpoch;\n emit CancelUpTo(\n makerAddress,\n senderAddress,\n newOrderEpoch\n );\n }\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrder(\n Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n nonReentrant\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n return fillResults;\n }\n\n /// @dev After calling, the order can not be filled anymore.\n /// Throws if order is invalid or sender does not have permission to cancel.\n /// @param order Order to cancel. Order must be OrderStatus.FILLABLE.\n function cancelOrder(Order memory order)\n public\n nonReentrant\n {\n cancelOrderInternal(order);\n }\n\n /// @dev Gets information about an order: status, hash, and amount filled.\n /// @param order Order to gather information on.\n /// @return OrderInfo Information about the order and its state.\n /// See LibOrder.OrderInfo for a complete description.\n function getOrderInfo(Order memory order)\n public\n view\n returns (OrderInfo memory orderInfo)\n {\n // Compute the order hash\n orderInfo.orderHash = getOrderHash(order);\n\n // Fetch filled amount\n orderInfo.orderTakerAssetFilledAmount = filled[orderInfo.orderHash];\n\n // If order.makerAssetAmount is zero, we also reject the order.\n // While the Exchange contract handles them correctly, they create\n // edge cases in the supporting infrastructure because they have\n // an 'infinite' price when computed by a simple division.\n if (order.makerAssetAmount == 0) {\n orderInfo.orderStatus = uint8(OrderStatus.INVALID_MAKER_ASSET_AMOUNT);\n return orderInfo;\n }\n\n // If order.takerAssetAmount is zero, then the order will always\n // be considered filled because 0 == takerAssetAmount == orderTakerAssetFilledAmount\n // Instead of distinguishing between unfilled and filled zero taker\n // amount orders, we choose not to support them.\n if (order.takerAssetAmount == 0) {\n orderInfo.orderStatus = uint8(OrderStatus.INVALID_TAKER_ASSET_AMOUNT);\n return orderInfo;\n }\n\n // Validate order availability\n if (orderInfo.orderTakerAssetFilledAmount >= order.takerAssetAmount) {\n orderInfo.orderStatus = uint8(OrderStatus.FULLY_FILLED);\n return orderInfo;\n }\n\n // Validate order expiration\n // solhint-disable-next-line not-rely-on-time\n if (block.timestamp >= order.expirationTimeSeconds) {\n orderInfo.orderStatus = uint8(OrderStatus.EXPIRED);\n return orderInfo;\n }\n\n // Check if order has been cancelled\n if (cancelled[orderInfo.orderHash]) {\n orderInfo.orderStatus = uint8(OrderStatus.CANCELLED);\n return orderInfo;\n }\n if (orderEpoch[order.makerAddress][order.senderAddress] > order.salt) {\n orderInfo.orderStatus = uint8(OrderStatus.CANCELLED);\n return orderInfo;\n }\n\n // All other statuses are ruled out: order is Fillable\n orderInfo.orderStatus = uint8(OrderStatus.FILLABLE);\n return orderInfo;\n }\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderInternal(\n Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n // Fetch order info\n OrderInfo memory orderInfo = getOrderInfo(order);\n\n // Fetch taker address\n address takerAddress = getCurrentContextAddress();\n \n // Assert that the order is fillable by taker\n assertFillableOrder(\n order,\n orderInfo,\n takerAddress,\n signature\n );\n \n // Get amount of takerAsset to fill\n uint256 remainingTakerAssetAmount = safeSub(order.takerAssetAmount, orderInfo.orderTakerAssetFilledAmount);\n uint256 takerAssetFilledAmount = min256(takerAssetFillAmount, remainingTakerAssetAmount);\n\n // Validate context\n assertValidFill(\n order,\n orderInfo,\n takerAssetFillAmount,\n takerAssetFilledAmount,\n fillResults.makerAssetFilledAmount\n );\n\n // Compute proportional fill amounts\n fillResults = calculateFillResults(order, takerAssetFilledAmount);\n\n // Update exchange internal state\n updateFilledState(\n order,\n takerAddress,\n orderInfo.orderHash,\n orderInfo.orderTakerAssetFilledAmount,\n fillResults\n );\n \n // Settle order\n settleOrder(\n order,\n takerAddress,\n fillResults\n );\n\n return fillResults;\n }\n\n /// @dev After calling, the order can not be filled anymore.\n /// Throws if order is invalid or sender does not have permission to cancel.\n /// @param order Order to cancel. Order must be OrderStatus.FILLABLE.\n function cancelOrderInternal(Order memory order)\n internal\n {\n // Fetch current order status\n OrderInfo memory orderInfo = getOrderInfo(order);\n\n // Validate context\n assertValidCancel(order, orderInfo);\n\n // Perform cancel\n updateCancelledState(order, orderInfo.orderHash);\n }\n\n /// @dev Updates state with results of a fill order.\n /// @param order that was filled.\n /// @param takerAddress Address of taker who filled the order.\n /// @param orderTakerAssetFilledAmount Amount of order already filled.\n function updateFilledState(\n Order memory order,\n address takerAddress,\n bytes32 orderHash,\n uint256 orderTakerAssetFilledAmount,\n FillResults memory fillResults\n )\n internal\n {\n // Update state\n filled[orderHash] = safeAdd(orderTakerAssetFilledAmount, fillResults.takerAssetFilledAmount);\n\n // Log order\n emit Fill(\n order.makerAddress,\n order.feeRecipientAddress,\n takerAddress,\n msg.sender,\n fillResults.makerAssetFilledAmount,\n fillResults.takerAssetFilledAmount,\n fillResults.makerFeePaid,\n fillResults.takerFeePaid,\n orderHash,\n order.makerAssetData,\n order.takerAssetData\n );\n }\n\n /// @dev Updates state with results of cancelling an order.\n /// State is only updated if the order is currently fillable.\n /// Otherwise, updating state would have no effect.\n /// @param order that was cancelled.\n /// @param orderHash Hash of order that was cancelled.\n function updateCancelledState(\n Order memory order,\n bytes32 orderHash\n )\n internal\n {\n // Perform cancel\n cancelled[orderHash] = true;\n\n // Log cancel\n emit Cancel(\n order.makerAddress,\n order.feeRecipientAddress,\n msg.sender,\n orderHash,\n order.makerAssetData,\n order.takerAssetData\n );\n }\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAddress Address of order taker.\n /// @param signature Proof that the orders was created by its maker.\n function assertFillableOrder(\n Order memory order,\n OrderInfo memory orderInfo,\n address takerAddress,\n bytes memory signature\n )\n internal\n view\n {\n // An order can only be filled if its status is FILLABLE.\n require(\n orderInfo.orderStatus == uint8(OrderStatus.FILLABLE),\n \"ORDER_UNFILLABLE\"\n );\n \n // Validate sender is allowed to fill this order\n if (order.senderAddress != address(0)) {\n require(\n order.senderAddress == msg.sender,\n \"INVALID_SENDER\"\n );\n }\n \n // Validate taker is allowed to fill this order\n if (order.takerAddress != address(0)) {\n require(\n order.takerAddress == takerAddress,\n \"INVALID_TAKER\"\n );\n }\n \n // Validate Maker signature (check only if first time seen)\n if (orderInfo.orderTakerAssetFilledAmount == 0) {\n require(\n isValidSignature(\n orderInfo.orderHash,\n order.makerAddress,\n signature\n ),\n \"INVALID_ORDER_SIGNATURE\"\n );\n }\n }\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAssetFillAmount Desired amount of order to fill by taker.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @param makerAssetFilledAmount Amount of makerAsset that will be transfered.\n function assertValidFill(\n Order memory order,\n OrderInfo memory orderInfo,\n uint256 takerAssetFillAmount, // TODO: use FillResults\n uint256 takerAssetFilledAmount,\n uint256 makerAssetFilledAmount\n )\n internal\n view\n {\n // Revert if fill amount is invalid\n // TODO: reconsider necessity for v2.1\n require(\n takerAssetFillAmount != 0,\n \"INVALID_TAKER_AMOUNT\"\n );\n \n // Make sure taker does not pay more than desired amount\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n takerAssetFilledAmount <= takerAssetFillAmount,\n \"TAKER_OVERPAY\"\n );\n \n // Make sure order is not overfilled\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n safeAdd(orderInfo.orderTakerAssetFilledAmount, takerAssetFilledAmount) <= order.takerAssetAmount,\n \"ORDER_OVERFILL\"\n );\n \n // Make sure order is filled at acceptable price.\n // The order has an implied price from the makers perspective:\n // order price = order.makerAssetAmount / order.takerAssetAmount\n // i.e. the number of makerAsset maker is paying per takerAsset. The\n // maker is guaranteed to get this price or a better (lower) one. The\n // actual price maker is getting in this fill is:\n // fill price = makerAssetFilledAmount / takerAssetFilledAmount\n // We need `fill price <= order price` for the fill to be fair to maker.\n // This amounts to:\n // makerAssetFilledAmount order.makerAssetAmount\n // ------------------------ <= -----------------------\n // takerAssetFilledAmount order.takerAssetAmount\n // or, equivalently:\n // makerAssetFilledAmount * order.takerAssetAmount <=\n // order.makerAssetAmount * takerAssetFilledAmount\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n safeMul(makerAssetFilledAmount, order.takerAssetAmount)\n <= \n safeMul(order.makerAssetAmount, takerAssetFilledAmount),\n \"INVALID_FILL_PRICE\"\n );\n }\n\n /// @dev Validates context for cancelOrder. Succeeds or throws.\n /// @param order to be cancelled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n function assertValidCancel(\n Order memory order,\n OrderInfo memory orderInfo\n )\n internal\n view\n {\n // Ensure order is valid\n // An order can only be cancelled if its status is FILLABLE.\n require(\n orderInfo.orderStatus == uint8(OrderStatus.FILLABLE),\n \"ORDER_UNFILLABLE\"\n );\n\n // Validate sender is allowed to cancel this order\n if (order.senderAddress != address(0)) {\n require(\n order.senderAddress == msg.sender,\n \"INVALID_SENDER\"\n );\n }\n\n // Validate transaction signed by maker\n address makerAddress = getCurrentContextAddress();\n require(\n order.makerAddress == makerAddress,\n \"INVALID_MAKER\"\n );\n }\n\n /// @dev Calculates amounts filled and fees paid by maker and taker.\n /// @param order to be filled.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function calculateFillResults(\n Order memory order,\n uint256 takerAssetFilledAmount\n )\n internal\n pure\n returns (FillResults memory fillResults)\n {\n // Compute proportional transfer amounts\n fillResults.takerAssetFilledAmount = takerAssetFilledAmount;\n fillResults.makerAssetFilledAmount = safeGetPartialAmountFloor(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.makerAssetAmount\n );\n fillResults.makerFeePaid = safeGetPartialAmountFloor(\n fillResults.makerAssetFilledAmount,\n order.makerAssetAmount,\n order.makerFee\n );\n fillResults.takerFeePaid = safeGetPartialAmountFloor(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.takerFee\n );\n\n return fillResults;\n }\n\n /// @dev Settles an order by transferring assets between counterparties.\n /// @param order Order struct containing order specifications.\n /// @param takerAddress Address selling takerAsset and buying makerAsset.\n /// @param fillResults Amounts to be filled and fees paid by maker and taker.\n function settleOrder(\n LibOrder.Order memory order,\n address takerAddress,\n LibFillResults.FillResults memory fillResults\n )\n private\n {\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n dispatchTransferFrom(\n order.makerAssetData,\n order.makerAddress,\n takerAddress,\n fillResults.makerAssetFilledAmount\n );\n dispatchTransferFrom(\n order.takerAssetData,\n takerAddress,\n order.makerAddress,\n fillResults.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n zrxAssetData,\n order.makerAddress,\n order.feeRecipientAddress,\n fillResults.makerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n order.feeRecipientAddress,\n fillResults.takerFeePaid\n );\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinMatchOrders.sol": "/*\n Copyright 2018 ZeroEx Intl.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n http://www.apache.org/licenses/LICENSE-2.0\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MMatchOrders.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\n\n\ncontract MixinMatchOrders is\n ReentrancyGuard,\n LibConstants,\n LibMath,\n MAssetProxyDispatcher,\n MExchangeCore,\n MMatchOrders,\n MTransactions\n{\n /// @dev Match two complementary orders that have a profitable spread.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the left order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftSignature Proof that order was created by the left maker.\n /// @param rightSignature Proof that order was created by the right maker.\n /// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.\n function matchOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n bytes memory leftSignature,\n bytes memory rightSignature\n )\n public\n nonReentrant\n returns (LibFillResults.MatchedFillResults memory matchedFillResults)\n {\n // We assume that rightOrder.takerAssetData == leftOrder.makerAssetData and rightOrder.makerAssetData == leftOrder.takerAssetData.\n // If this assumption isn't true, the match will fail at signature validation.\n rightOrder.makerAssetData = leftOrder.takerAssetData;\n rightOrder.takerAssetData = leftOrder.makerAssetData;\n\n // Get left & right order info\n LibOrder.OrderInfo memory leftOrderInfo = getOrderInfo(leftOrder);\n LibOrder.OrderInfo memory rightOrderInfo = getOrderInfo(rightOrder);\n\n // Fetch taker address\n address takerAddress = getCurrentContextAddress();\n \n // Either our context is valid or we revert\n assertFillableOrder(\n leftOrder,\n leftOrderInfo,\n takerAddress,\n leftSignature\n );\n assertFillableOrder(\n rightOrder,\n rightOrderInfo,\n takerAddress,\n rightSignature\n );\n assertValidMatch(leftOrder, rightOrder);\n\n // Compute proportional fill amounts\n matchedFillResults = calculateMatchedFillResults(\n leftOrder,\n rightOrder,\n leftOrderInfo.orderTakerAssetFilledAmount,\n rightOrderInfo.orderTakerAssetFilledAmount\n );\n\n // Validate fill contexts\n assertValidFill(\n leftOrder,\n leftOrderInfo,\n matchedFillResults.left.takerAssetFilledAmount,\n matchedFillResults.left.takerAssetFilledAmount,\n matchedFillResults.left.makerAssetFilledAmount\n );\n assertValidFill(\n rightOrder,\n rightOrderInfo,\n matchedFillResults.right.takerAssetFilledAmount,\n matchedFillResults.right.takerAssetFilledAmount,\n matchedFillResults.right.makerAssetFilledAmount\n );\n \n // Update exchange state\n updateFilledState(\n leftOrder,\n takerAddress,\n leftOrderInfo.orderHash,\n leftOrderInfo.orderTakerAssetFilledAmount,\n matchedFillResults.left\n );\n updateFilledState(\n rightOrder,\n takerAddress,\n rightOrderInfo.orderHash,\n rightOrderInfo.orderTakerAssetFilledAmount,\n matchedFillResults.right\n );\n\n // Settle matched orders. Succeeds or throws.\n settleMatchedOrders(\n leftOrder,\n rightOrder,\n takerAddress,\n matchedFillResults\n );\n\n return matchedFillResults;\n }\n\n /// @dev Validates context for matchOrders. Succeeds or throws.\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n function assertValidMatch(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder\n )\n internal\n pure\n {\n // Make sure there is a profitable spread.\n // There is a profitable spread iff the cost per unit bought (OrderA.MakerAmount/OrderA.TakerAmount) for each order is greater\n // than the profit per unit sold of the matched order (OrderB.TakerAmount/OrderB.MakerAmount).\n // This is satisfied by the equations below:\n // <leftOrder.makerAssetAmount> / <leftOrder.takerAssetAmount> >= <rightOrder.takerAssetAmount> / <rightOrder.makerAssetAmount>\n // AND\n // <rightOrder.makerAssetAmount> / <rightOrder.takerAssetAmount> >= <leftOrder.takerAssetAmount> / <leftOrder.makerAssetAmount>\n // These equations can be combined to get the following:\n require(\n safeMul(leftOrder.makerAssetAmount, rightOrder.makerAssetAmount) >=\n safeMul(leftOrder.takerAssetAmount, rightOrder.takerAssetAmount),\n \"NEGATIVE_SPREAD_REQUIRED\"\n );\n }\n\n /// @dev Calculates fill amounts for the matched orders.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the leftOrder order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftOrderTakerAssetFilledAmount Amount of left order already filled.\n /// @param rightOrderTakerAssetFilledAmount Amount of right order already filled.\n /// @param matchedFillResults Amounts to fill and fees to pay by maker and taker of matched orders.\n function calculateMatchedFillResults(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n uint256 leftOrderTakerAssetFilledAmount,\n uint256 rightOrderTakerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.MatchedFillResults memory matchedFillResults)\n {\n // Derive maker asset amounts for left & right orders, given store taker assert amounts\n uint256 leftTakerAssetAmountRemaining = safeSub(leftOrder.takerAssetAmount, leftOrderTakerAssetFilledAmount);\n uint256 leftMakerAssetAmountRemaining = safeGetPartialAmountFloor(\n leftOrder.makerAssetAmount,\n leftOrder.takerAssetAmount,\n leftTakerAssetAmountRemaining\n );\n uint256 rightTakerAssetAmountRemaining = safeSub(rightOrder.takerAssetAmount, rightOrderTakerAssetFilledAmount);\n uint256 rightMakerAssetAmountRemaining = safeGetPartialAmountFloor(\n rightOrder.makerAssetAmount,\n rightOrder.takerAssetAmount,\n rightTakerAssetAmountRemaining\n );\n\n // Calculate fill results for maker and taker assets: at least one order will be fully filled.\n // The maximum amount the left maker can buy is `leftTakerAssetAmountRemaining`\n // The maximum amount the right maker can sell is `rightMakerAssetAmountRemaining`\n // We have two distinct cases for calculating the fill results:\n // Case 1.\n // If the left maker can buy more than the right maker can sell, then only the right order is fully filled.\n // If the left maker can buy exactly what the right maker can sell, then both orders are fully filled.\n // Case 2.\n // If the left maker cannot buy more than the right maker can sell, then only the left order is fully filled.\n if (leftTakerAssetAmountRemaining >= rightMakerAssetAmountRemaining) {\n // Case 1: Right order is fully filled\n matchedFillResults.right.makerAssetFilledAmount = rightMakerAssetAmountRemaining;\n matchedFillResults.right.takerAssetFilledAmount = rightTakerAssetAmountRemaining;\n matchedFillResults.left.takerAssetFilledAmount = matchedFillResults.right.makerAssetFilledAmount;\n // Round down to ensure the maker's exchange rate does not exceed the price specified by the order. \n // We favor the maker when the exchange rate must be rounded.\n matchedFillResults.left.makerAssetFilledAmount = safeGetPartialAmountFloor(\n leftOrder.makerAssetAmount,\n leftOrder.takerAssetAmount,\n matchedFillResults.left.takerAssetFilledAmount\n );\n } else {\n // Case 2: Left order is fully filled\n matchedFillResults.left.makerAssetFilledAmount = leftMakerAssetAmountRemaining;\n matchedFillResults.left.takerAssetFilledAmount = leftTakerAssetAmountRemaining;\n matchedFillResults.right.makerAssetFilledAmount = matchedFillResults.left.takerAssetFilledAmount;\n // Round up to ensure the maker's exchange rate does not exceed the price specified by the order.\n // We favor the maker when the exchange rate must be rounded.\n matchedFillResults.right.takerAssetFilledAmount = safeGetPartialAmountCeil(\n rightOrder.takerAssetAmount,\n rightOrder.makerAssetAmount,\n matchedFillResults.right.makerAssetFilledAmount\n );\n }\n\n // Calculate amount given to taker\n matchedFillResults.leftMakerAssetSpreadAmount = safeSub(\n matchedFillResults.left.makerAssetFilledAmount,\n matchedFillResults.right.takerAssetFilledAmount\n );\n\n // Compute fees for left order\n matchedFillResults.left.makerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.left.makerAssetFilledAmount,\n leftOrder.makerAssetAmount,\n leftOrder.makerFee\n );\n matchedFillResults.left.takerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.left.takerAssetFilledAmount,\n leftOrder.takerAssetAmount,\n leftOrder.takerFee\n );\n\n // Compute fees for right order\n matchedFillResults.right.makerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.right.makerAssetFilledAmount,\n rightOrder.makerAssetAmount,\n rightOrder.makerFee\n );\n matchedFillResults.right.takerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.right.takerAssetFilledAmount,\n rightOrder.takerAssetAmount,\n rightOrder.takerFee\n );\n\n // Return fill results\n return matchedFillResults;\n }\n\n /// @dev Settles matched order by transferring appropriate funds between order makers, taker, and fee recipient.\n /// @param leftOrder First matched order.\n /// @param rightOrder Second matched order.\n /// @param takerAddress Address that matched the orders. The taker receives the spread between orders as profit.\n /// @param matchedFillResults Struct holding amounts to transfer between makers, taker, and fee recipients.\n function settleMatchedOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n address takerAddress,\n LibFillResults.MatchedFillResults memory matchedFillResults\n )\n private\n {\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n // Order makers and taker\n dispatchTransferFrom(\n leftOrder.makerAssetData,\n leftOrder.makerAddress,\n rightOrder.makerAddress,\n matchedFillResults.right.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n rightOrder.makerAssetData,\n rightOrder.makerAddress,\n leftOrder.makerAddress,\n matchedFillResults.left.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n leftOrder.makerAssetData,\n leftOrder.makerAddress,\n takerAddress,\n matchedFillResults.leftMakerAssetSpreadAmount\n );\n\n // Maker fees\n dispatchTransferFrom(\n zrxAssetData,\n leftOrder.makerAddress,\n leftOrder.feeRecipientAddress,\n matchedFillResults.left.makerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n rightOrder.makerAddress,\n rightOrder.feeRecipientAddress,\n matchedFillResults.right.makerFeePaid\n );\n\n // Taker fees\n if (leftOrder.feeRecipientAddress == rightOrder.feeRecipientAddress) {\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n leftOrder.feeRecipientAddress,\n safeAdd(\n matchedFillResults.left.takerFeePaid,\n matchedFillResults.right.takerFeePaid\n )\n );\n } else {\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n leftOrder.feeRecipientAddress,\n matchedFillResults.left.takerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n rightOrder.feeRecipientAddress,\n matchedFillResults.right.takerFeePaid\n );\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinSignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./interfaces/IWallet.sol\";\nimport \"./interfaces/IValidator.sol\";\n\n\ncontract MixinSignatureValidator is\n ReentrancyGuard,\n MSignatureValidator,\n MTransactions\n{\n using LibBytes for bytes;\n \n // Mapping of hash => signer => signed\n mapping (bytes32 => mapping (address => bool)) public preSigned;\n\n // Mapping of signer => validator => approved\n mapping (address => mapping (address => bool)) public allowedValidators;\n\n /// @dev Approves a hash on-chain using any valid signature type.\n /// After presigning a hash, the preSign signature type will become valid for that hash and signer.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n function preSign(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external\n {\n if (signerAddress != msg.sender) {\n require(\n isValidSignature(\n hash,\n signerAddress,\n signature\n ),\n \"INVALID_SIGNATURE\"\n );\n }\n preSigned[hash][signerAddress] = true;\n }\n\n /// @dev Approves/unnapproves a Validator contract to verify signatures on signer's behalf.\n /// @param validatorAddress Address of Validator contract.\n /// @param approval Approval or disapproval of Validator contract.\n function setSignatureValidatorApproval(\n address validatorAddress,\n bool approval\n )\n external\n nonReentrant\n {\n address signerAddress = getCurrentContextAddress();\n allowedValidators[signerAddress][validatorAddress] = approval;\n emit SignatureValidatorApproval(\n signerAddress,\n validatorAddress,\n approval\n );\n }\n\n /// @dev Verifies that a hash has been signed by the given signer.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes memory signature\n )\n public\n view\n returns (bool isValid)\n {\n require(\n signature.length > 0,\n \"LENGTH_GREATER_THAN_0_REQUIRED\"\n );\n\n // Pop last byte off of signature byte array.\n uint8 signatureTypeRaw = uint8(signature.popLastByte());\n\n // Ensure signature is supported\n require(\n signatureTypeRaw < uint8(SignatureType.NSignatureTypes),\n \"SIGNATURE_UNSUPPORTED\"\n );\n\n SignatureType signatureType = SignatureType(signatureTypeRaw);\n\n // Variables are not scoped in Solidity.\n uint8 v;\n bytes32 r;\n bytes32 s;\n address recovered;\n\n // Always illegal signature.\n // This is always an implicit option since a signer can create a\n // signature array with invalid type or length. We may as well make\n // it an explicit option. This aids testing and analysis. It is\n // also the initialization value for the enum type.\n if (signatureType == SignatureType.Illegal) {\n revert(\"SIGNATURE_ILLEGAL\");\n\n // Always invalid signature.\n // Like Illegal, this is always implicitly available and therefore\n // offered explicitly. It can be implicitly created by providing\n // a correctly formatted but incorrect signature.\n } else if (signatureType == SignatureType.Invalid) {\n require(\n signature.length == 0,\n \"LENGTH_0_REQUIRED\"\n );\n isValid = false;\n return isValid;\n\n // Signature using EIP712\n } else if (signatureType == SignatureType.EIP712) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n hash,\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n\n // Signed using web3.eth_sign\n } else if (signatureType == SignatureType.EthSign) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n keccak256(abi.encodePacked(\n \"\\x19Ethereum Signed Message:\\n32\",\n hash\n )),\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n\n // Signature verified by wallet contract.\n // If used with an order, the maker of the order is the wallet contract.\n } else if (signatureType == SignatureType.Wallet) {\n isValid = isValidWalletSignature(\n hash,\n signerAddress,\n signature\n );\n return isValid;\n\n // Signature verified by validator contract.\n // If used with an order, the maker of the order can still be an EOA.\n // A signature using this type should be encoded as:\n // | Offset | Length | Contents |\n // | 0x00 | x | Signature to validate |\n // | 0x00 + x | 20 | Address of validator contract |\n // | 0x14 + x | 1 | Signature type is always \"\\x06\" |\n } else if (signatureType == SignatureType.Validator) {\n // Pop last 20 bytes off of signature byte array.\n address validatorAddress = signature.popLast20Bytes();\n \n // Ensure signer has approved validator.\n if (!allowedValidators[signerAddress][validatorAddress]) {\n return false;\n }\n isValid = isValidValidatorSignature(\n validatorAddress,\n hash,\n signerAddress,\n signature\n );\n return isValid;\n\n // Signer signed hash previously using the preSign function.\n } else if (signatureType == SignatureType.PreSigned) {\n isValid = preSigned[hash][signerAddress];\n return isValid;\n }\n\n // Anything else is illegal (We do not return false because\n // the signature may actually be valid, just not in a format\n // that we currently support. In this case returning false\n // may lead the caller to incorrectly believe that the\n // signature was invalid.)\n revert(\"SIGNATURE_UNSUPPORTED\");\n }\n\n /// @dev Verifies signature using logic defined by Wallet contract.\n /// @param hash Any 32 byte hash.\n /// @param walletAddress Address that should have signed the given hash\n /// and defines its own signature verification method.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if signature is valid for given wallet..\n function isValidWalletSignature(\n bytes32 hash,\n address walletAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid)\n {\n bytes memory calldata = abi.encodeWithSelector(\n IWallet(walletAddress).isValidSignature.selector,\n hash,\n signature\n );\n assembly {\n let cdStart := add(calldata, 32)\n let success := staticcall(\n gas, // forward all gas\n walletAddress, // address of Wallet contract\n cdStart, // pointer to start of input\n mload(calldata), // length of input\n cdStart, // write output over input\n 32 // output size is 32 bytes\n )\n\n switch success\n case 0 {\n // Revert with `Error(\"WALLET_ERROR\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000c57414c4c45545f4552524f5200000000000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n case 1 {\n // Signature is valid if call did not revert and returned true\n isValid := mload(cdStart)\n }\n }\n return isValid;\n }\n\n /// @dev Verifies signature using logic defined by Validator contract.\n /// @param validatorAddress Address of validator contract.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidValidatorSignature(\n address validatorAddress,\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid)\n {\n bytes memory calldata = abi.encodeWithSelector(\n IValidator(signerAddress).isValidSignature.selector,\n hash,\n signerAddress,\n signature\n );\n assembly {\n let cdStart := add(calldata, 32)\n let success := staticcall(\n gas, // forward all gas\n validatorAddress, // address of Validator contract\n cdStart, // pointer to start of input\n mload(calldata), // length of input\n cdStart, // write output over input\n 32 // output size is 32 bytes\n )\n\n switch success\n case 0 {\n // Revert with `Error(\"VALIDATOR_ERROR\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f56414c494441544f525f4552524f5200000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n case 1 {\n // Signature is valid if call did not revert and returned true\n isValid := mload(cdStart)\n }\n }\n return isValid;\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinTransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\nimport \"./libs/LibExchangeErrors.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./libs/LibEIP712.sol\";\n\n\ncontract MixinTransactions is\n LibEIP712,\n MSignatureValidator,\n MTransactions\n{\n // Mapping of transaction hash => executed\n // This prevents transactions from being executed more than once.\n mapping (bytes32 => bool) public transactions;\n\n // Address of current transaction signer\n address public currentContextAddress;\n\n /// @dev Executes an exchange method call in the context of signer.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @param signature Proof of signer transaction by signer.\n function executeTransaction(\n uint256 salt,\n address signerAddress,\n bytes data,\n bytes signature\n )\n external\n {\n // Prevent reentrancy\n require(\n currentContextAddress == address(0),\n \"REENTRANCY_ILLEGAL\"\n );\n\n bytes32 transactionHash = hashEIP712Message(hashZeroExTransaction(\n salt,\n signerAddress,\n data\n ));\n\n // Validate transaction has not been executed\n require(\n !transactions[transactionHash],\n \"INVALID_TX_HASH\"\n );\n\n // Transaction always valid if signer is sender of transaction\n if (signerAddress != msg.sender) {\n // Validate signature\n require(\n isValidSignature(\n transactionHash,\n signerAddress,\n signature\n ),\n \"INVALID_TX_SIGNATURE\"\n );\n\n // Set the current transaction signer\n currentContextAddress = signerAddress;\n }\n\n // Execute transaction\n transactions[transactionHash] = true;\n require(\n address(this).delegatecall(data),\n \"FAILED_EXECUTION\"\n );\n\n // Reset current transaction signer if it was previously updated\n if (signerAddress != msg.sender) {\n currentContextAddress = address(0);\n }\n }\n\n /// @dev Calculates EIP712 hash of the Transaction.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @return EIP712 hash of the Transaction.\n function hashZeroExTransaction(\n uint256 salt,\n address signerAddress,\n bytes memory data\n )\n internal\n pure\n returns (bytes32 result)\n {\n bytes32 schemaHash = EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH;\n bytes32 dataHash = keccak256(data);\n\n // Assembly for more efficiently computing:\n // keccak256(abi.encodePacked(\n // EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH,\n // salt,\n // bytes32(signerAddress),\n // keccak256(data)\n // ));\n\n assembly {\n // Load free memory pointer\n let memPtr := mload(64)\n\n mstore(memPtr, schemaHash) // hash of schema\n mstore(add(memPtr, 32), salt) // salt\n mstore(add(memPtr, 64), and(signerAddress, 0xffffffffffffffffffffffffffffffffffffffff)) // signerAddress\n mstore(add(memPtr, 96), dataHash) // hash of data\n\n // Compute hash\n result := keccak256(memPtr, 128)\n }\n return result;\n }\n\n /// @dev The current function will be called in the context of this address (either 0x transaction signer or `msg.sender`).\n /// If calling a fill function, this address will represent the taker.\n /// If calling a cancel function, this address will represent the maker.\n /// @return Signer of 0x transaction if entry point is `executeTransaction`.\n /// `msg.sender` if entry point is any other function.\n function getCurrentContextAddress()\n internal\n view\n returns (address)\n {\n address currentContextAddress_ = currentContextAddress;\n address contextAddress = currentContextAddress_ == address(0) ? msg.sender : currentContextAddress_;\n return contextAddress;\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./libs/LibAbiEncoder.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MWrapperFunctions.sol\";\n\n\ncontract MixinWrapperFunctions is\n ReentrancyGuard,\n LibMath,\n LibFillResults,\n LibAbiEncoder,\n MExchangeCore,\n MWrapperFunctions\n{\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n nonReentrant\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrKillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n return fillResults;\n }\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (FillResults memory fillResults)\n {\n // ABI encode calldata for `fillOrder`\n bytes memory fillOrderCalldata = abiEncodeFillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n\n // Delegate to `fillOrder` and handle any exceptions gracefully\n assembly {\n let success := delegatecall(\n gas, // forward all gas\n address, // call address of this contract\n add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes)\n mload(fillOrderCalldata), // length of input\n fillOrderCalldata, // write output over input\n 128 // output size is 128 bytes\n )\n if success {\n mstore(fillResults, mload(fillOrderCalldata))\n mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32)))\n mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64)))\n mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96)))\n }\n }\n // fillResults values will be 0 by default if call was unsuccessful\n return fillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrKill.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrKillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrKillOrderInternal(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrders(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n bytes memory takerAssetData = orders[0].takerAssetData;\n \n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being sold by taker is the same for each order.\n // Rather than passing this in as calldata, we use the takerAssetData from the first order in all later orders.\n orders[i].takerAssetData = takerAssetData;\n\n // Calculate the remaining amount of takerAsset to sell\n uint256 remainingTakerAssetFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= takerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory takerAssetData = orders[0].takerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being sold by taker is the same for each order.\n // Rather than passing this in as calldata, we use the takerAssetData from the first order in all later orders.\n orders[i].takerAssetData = takerAssetData;\n\n // Calculate the remaining amount of takerAsset to sell\n uint256 remainingTakerAssetFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= takerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerAsset is bought by taker.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrders(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // Rather than passing this in as calldata, we copy the makerAssetData from the first order onto all later orders.\n orders[i].makerAssetData = makerAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n if (totalFillResults.makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // Rather than passing this in as calldata, we copy the makerAssetData from the first order onto all later orders.\n orders[i].makerAssetData = makerAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n if (totalFillResults.makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously cancels multiple orders in a single transaction.\n /// @param orders Array of order specifications.\n function batchCancelOrders(LibOrder.Order[] memory orders)\n public\n nonReentrant\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n cancelOrderInternal(orders[i]);\n }\n }\n\n /// @dev Fetches information for all passed in orders.\n /// @param orders Array of order specifications.\n /// @return Array of OrderInfo instances that correspond to each order.\n function getOrdersInfo(LibOrder.Order[] memory orders)\n public\n view\n returns (LibOrder.OrderInfo[] memory)\n {\n uint256 ordersLength = orders.length;\n LibOrder.OrderInfo[] memory ordersInfo = new LibOrder.OrderInfo[](ordersLength);\n for (uint256 i = 0; i != ordersLength; i++) {\n ordersInfo[i] = getOrderInfo(orders[i]);\n }\n return ordersInfo;\n }\n\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n require(\n fillResults.takerAssetFilledAmount == takerAssetFillAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return fillResults;\n }\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IAssetProxyDispatcher {\n\n /// @dev Registers an asset proxy to its asset proxy id.\n /// Once an asset proxy is registered, it cannot be unregistered.\n /// @param assetProxy Address of new asset proxy to register.\n function registerAssetProxy(address assetProxy)\n external;\n\n /// @dev Gets an asset proxy.\n /// @param assetProxyId Id of the asset proxy.\n /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered.\n function getAssetProxy(bytes4 assetProxyId)\n external\n view\n returns (address);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IExchange.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./IExchangeCore.sol\";\nimport \"./IMatchOrders.sol\";\nimport \"./ISignatureValidator.sol\";\nimport \"./ITransactions.sol\";\nimport \"./IAssetProxyDispatcher.sol\";\nimport \"./IWrapperFunctions.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract IExchange is\n IExchangeCore,\n IMatchOrders,\n ISignatureValidator,\n ITransactions,\n IAssetProxyDispatcher,\n IWrapperFunctions\n{}\n",
- "2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IExchangeCore {\n\n /// @dev Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch\n /// and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress).\n /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled.\n function cancelOrdersUpTo(uint256 targetOrderEpoch)\n external;\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev After calling, the order can not be filled anymore.\n /// @param order Order struct containing order specifications.\n function cancelOrder(LibOrder.Order memory order)\n public;\n\n /// @dev Gets information about an order: status, hash, and amount filled.\n /// @param order Order to gather information on.\n /// @return OrderInfo Information about the order and its state.\n /// See LibOrder.OrderInfo for a complete description.\n function getOrderInfo(LibOrder.Order memory order)\n public\n view\n returns (LibOrder.OrderInfo memory orderInfo);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IMatchOrders {\n\n /// @dev Match two complementary orders that have a profitable spread.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the left order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftSignature Proof that order was created by the left maker.\n /// @param rightSignature Proof that order was created by the right maker.\n /// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.\n function matchOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n bytes memory leftSignature,\n bytes memory rightSignature\n )\n public\n returns (LibFillResults.MatchedFillResults memory matchedFillResults);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract ISignatureValidator {\n\n /// @dev Approves a hash on-chain using any valid signature type.\n /// After presigning a hash, the preSign signature type will become valid for that hash and signer.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n function preSign(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external;\n \n /// @dev Approves/unnapproves a Validator contract to verify signatures on signer's behalf.\n /// @param validatorAddress Address of Validator contract.\n /// @param approval Approval or disapproval of Validator contract.\n function setSignatureValidatorApproval(\n address validatorAddress,\n bool approval\n )\n external;\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signerAddress Address of signer.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes memory signature\n )\n public\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/ITransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\n\ncontract ITransactions {\n\n /// @dev Executes an exchange method call in the context of signer.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @param signature Proof of signer transaction by signer.\n function executeTransaction(\n uint256 salt,\n address signerAddress,\n bytes data,\n bytes signature\n )\n external;\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IValidator {\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IWallet.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IWallet {\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n bytes signature\n )\n external\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IWrapperFunctions {\n\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrKill.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrKillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrders(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerAsset is bought by taker.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrders(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously cancels multiple orders in a single transaction.\n /// @param orders Array of order specifications.\n function batchCancelOrders(LibOrder.Order[] memory orders)\n public;\n\n /// @dev Fetches information for all passed in orders\n /// @param orders Array of order specifications.\n /// @return Array of OrderInfo instances that correspond to each order.\n function getOrdersInfo(LibOrder.Order[] memory orders)\n public\n view\n returns (LibOrder.OrderInfo[] memory);\n}\n",
- "2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./LibOrder.sol\";\n\n\ncontract LibAbiEncoder {\n\n /// @dev ABI encodes calldata for `fillOrder`.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return ABI encoded calldata for `fillOrder`.\n function abiEncodeFillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n pure\n returns (bytes memory fillOrderCalldata)\n {\n // We need to call MExchangeCore.fillOrder using a delegatecall in\n // assembly so that we can intercept a call that throws. For this, we\n // need the input encoded in memory in the Ethereum ABIv2 format [1].\n\n // | Area | Offset | Length | Contents |\n // | -------- |--------|---------|-------------------------------------------- |\n // | Header | 0x00 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 0x00 | | 1. offset to order (*) |\n // | | 0x20 | | 2. takerAssetFillAmount |\n // | | 0x40 | | 3. offset to signature (*) |\n // | Data | | 12 * 32 | order: |\n // | | 0x000 | | 1. senderAddress |\n // | | 0x020 | | 2. makerAddress |\n // | | 0x040 | | 3. takerAddress |\n // | | 0x060 | | 4. feeRecipientAddress |\n // | | 0x080 | | 5. makerAssetAmount |\n // | | 0x0A0 | | 6. takerAssetAmount |\n // | | 0x0C0 | | 7. makerFeeAmount |\n // | | 0x0E0 | | 8. takerFeeAmount |\n // | | 0x100 | | 9. expirationTimeSeconds |\n // | | 0x120 | | 10. salt |\n // | | 0x140 | | 11. Offset to makerAssetData (*) |\n // | | 0x160 | | 12. Offset to takerAssetData (*) |\n // | | 0x180 | 32 | makerAssetData Length |\n // | | 0x1A0 | ** | makerAssetData Contents |\n // | | 0x1C0 | 32 | takerAssetData Length |\n // | | 0x1E0 | ** | takerAssetData Contents |\n // | | 0x200 | 32 | signature Length |\n // | | 0x220 | ** | signature Contents |\n\n // * Offsets are calculated from the beginning of the current area: Header, Params, Data:\n // An offset stored in the Params area is calculated from the beginning of the Params section.\n // An offset stored in the Data area is calculated from the beginning of the Data section.\n\n // ** The length of dynamic array contents are stored in the field immediately preceeding the contents.\n\n // [1]: https://solidity.readthedocs.io/en/develop/abi-spec.html\n\n assembly {\n\n // Areas below may use the following variables:\n // 1. <area>Start -- Start of this area in memory\n // 2. <area>End -- End of this area in memory. This value may\n // be precomputed (before writing contents),\n // or it may be computed as contents are written.\n // 3. <area>Offset -- Current offset into area. If an area's End\n // is precomputed, this variable tracks the\n // offsets of contents as they are written.\n\n /////// Setup Header Area ///////\n // Load free memory pointer\n fillOrderCalldata := mload(0x40)\n // bytes4(keccak256(\"fillOrder((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),uint256,bytes)\"))\n // = 0xb4be83d5\n // Leave 0x20 bytes to store the length\n mstore(add(fillOrderCalldata, 0x20), 0xb4be83d500000000000000000000000000000000000000000000000000000000)\n let headerAreaEnd := add(fillOrderCalldata, 0x24)\n\n /////// Setup Params Area ///////\n // This area is preallocated and written to later.\n // This is because we need to fill in offsets that have not yet been calculated.\n let paramsAreaStart := headerAreaEnd\n let paramsAreaEnd := add(paramsAreaStart, 0x60)\n let paramsAreaOffset := paramsAreaStart\n\n /////// Setup Data Area ///////\n let dataAreaStart := paramsAreaEnd\n let dataAreaEnd := dataAreaStart\n\n // Offset from the source data we're reading from\n let sourceOffset := order\n // arrayLenBytes and arrayLenWords track the length of a dynamically-allocated bytes array.\n let arrayLenBytes := 0\n let arrayLenWords := 0\n\n /////// Write order Struct ///////\n // Write memory location of Order, relative to the start of the\n // parameter list, then increment the paramsAreaOffset respectively.\n mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))\n paramsAreaOffset := add(paramsAreaOffset, 0x20)\n\n // Write values for each field in the order\n // It would be nice to use a loop, but we save on gas by writing\n // the stores sequentially.\n mstore(dataAreaEnd, mload(sourceOffset)) // makerAddress\n mstore(add(dataAreaEnd, 0x20), mload(add(sourceOffset, 0x20))) // takerAddress\n mstore(add(dataAreaEnd, 0x40), mload(add(sourceOffset, 0x40))) // feeRecipientAddress\n mstore(add(dataAreaEnd, 0x60), mload(add(sourceOffset, 0x60))) // senderAddress\n mstore(add(dataAreaEnd, 0x80), mload(add(sourceOffset, 0x80))) // makerAssetAmount\n mstore(add(dataAreaEnd, 0xA0), mload(add(sourceOffset, 0xA0))) // takerAssetAmount\n mstore(add(dataAreaEnd, 0xC0), mload(add(sourceOffset, 0xC0))) // makerFeeAmount\n mstore(add(dataAreaEnd, 0xE0), mload(add(sourceOffset, 0xE0))) // takerFeeAmount\n mstore(add(dataAreaEnd, 0x100), mload(add(sourceOffset, 0x100))) // expirationTimeSeconds\n mstore(add(dataAreaEnd, 0x120), mload(add(sourceOffset, 0x120))) // salt\n mstore(add(dataAreaEnd, 0x140), mload(add(sourceOffset, 0x140))) // Offset to makerAssetData\n mstore(add(dataAreaEnd, 0x160), mload(add(sourceOffset, 0x160))) // Offset to takerAssetData\n dataAreaEnd := add(dataAreaEnd, 0x180)\n sourceOffset := add(sourceOffset, 0x180)\n\n // Write offset to <order.makerAssetData>\n mstore(add(dataAreaStart, mul(10, 0x20)), sub(dataAreaEnd, dataAreaStart))\n\n // Calculate length of <order.makerAssetData>\n sourceOffset := mload(add(order, 0x140)) // makerAssetData\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of <order.makerAssetData>\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of <order.makerAssetData>\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n // Write offset to <order.takerAssetData>\n mstore(add(dataAreaStart, mul(11, 0x20)), sub(dataAreaEnd, dataAreaStart))\n\n // Calculate length of <order.takerAssetData>\n sourceOffset := mload(add(order, 0x160)) // takerAssetData\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of <order.takerAssetData>\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of <order.takerAssetData>\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n /////// Write takerAssetFillAmount ///////\n mstore(paramsAreaOffset, takerAssetFillAmount)\n paramsAreaOffset := add(paramsAreaOffset, 0x20)\n\n /////// Write signature ///////\n // Write offset to paramsArea\n mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))\n\n // Calculate length of signature\n sourceOffset := signature\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of signature\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of signature\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n // Set length of calldata\n mstore(fillOrderCalldata, sub(dataAreaEnd, add(fillOrderCalldata, 0x20)))\n\n // Increment free memory pointer\n mstore(0x40, dataAreaEnd)\n }\n\n return fillOrderCalldata;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibConstants.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\n// solhint-disable max-line-length\ncontract LibConstants {\n \n // Asset data for ZRX token. Used for fee transfers.\n // @TODO: Hardcode constant when we deploy. Currently \n // not constant to make testing easier.\n\n // The proxyId for ZRX_ASSET_DATA is bytes4(keccak256(\"ERC20Token(address)\")) = 0xf47261b0\n \n // Kovan ZRX address is 0x6ff6c0ff1d68b964901f986d4c9fa3ac68346570.\n // The ABI encoded proxyId and address is 0xf47261b00000000000000000000000006ff6c0ff1d68b964901f986d4c9fa3ac68346570\n // bytes constant public ZRX_ASSET_DATA = \"\\xf4\\x72\\x61\\xb0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x6f\\xf6\\xc0\\xff\\x1d\\x68\\xb9\\x64\\x90\\x1f\\x98\\x6d\\x4c\\x9f\\xa3\\xac\\x68\\x34\\x65\\x70\";\n \n // Mainnet ZRX address is 0xe41d2489571d322189246dafa5ebde1f4699f498.\n // The ABI encoded proxyId and address is 0xf47261b0000000000000000000000000e41d2489571d322189246dafa5ebde1f4699f498\n bytes constant public ZRX_ASSET_DATA = \"\\xf4\\x72\\x61\\xb0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xe4\\x1d\\x24\\x89\\x57\\x1d\\x32\\x21\\x89\\x24\\x6d\\xaf\\xa5\\xeb\\xde\\x1f\\x46\\x99\\xf4\\x98\";\n}\n// solhint-enable max-line-length\n",
- "2.0.0/protocol/Exchange/libs/LibEIP712.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract LibEIP712 {\n\n // EIP191 header for EIP712 prefix\n string constant internal EIP191_HEADER = \"\\x19\\x01\";\n\n // EIP712 Domain Name value\n string constant internal EIP712_DOMAIN_NAME = \"0x Protocol\";\n\n // EIP712 Domain Version value\n string constant internal EIP712_DOMAIN_VERSION = \"2\";\n\n // Hash of the EIP712 Domain Separator Schema\n bytes32 constant internal EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"EIP712Domain(\",\n \"string name,\",\n \"string version,\",\n \"address verifyingContract\",\n \")\"\n ));\n\n // Hash of the EIP712 Domain Separator data\n // solhint-disable-next-line var-name-mixedcase\n bytes32 public EIP712_DOMAIN_HASH;\n\n constructor ()\n public\n {\n EIP712_DOMAIN_HASH = keccak256(abi.encodePacked(\n EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH,\n keccak256(bytes(EIP712_DOMAIN_NAME)),\n keccak256(bytes(EIP712_DOMAIN_VERSION)),\n bytes32(address(this))\n ));\n }\n\n /// @dev Calculates EIP712 encoding for a hash struct in this EIP712 Domain.\n /// @param hashStruct The EIP712 hash struct.\n /// @return EIP712 hash applied to this EIP712 Domain.\n function hashEIP712Message(bytes32 hashStruct)\n internal\n view\n returns (bytes32 result)\n {\n bytes32 eip712DomainHash = EIP712_DOMAIN_HASH;\n\n // Assembly for more efficient computing:\n // keccak256(abi.encodePacked(\n // EIP191_HEADER,\n // EIP712_DOMAIN_HASH,\n // hashStruct \n // ));\n\n assembly {\n // Load free memory pointer\n let memPtr := mload(64)\n\n mstore(memPtr, 0x1901000000000000000000000000000000000000000000000000000000000000) // EIP191 header\n mstore(add(memPtr, 2), eip712DomainHash) // EIP712 domain hash\n mstore(add(memPtr, 34), hashStruct) // Hash of struct\n\n // Compute hash\n result := keccak256(memPtr, 66)\n }\n return result;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\n// solhint-disable\npragma solidity 0.4.24;\n\n\n/// @dev This contract documents the revert reasons used in the Exchange contract.\n/// This contract is intended to serve as a reference, but is not actually used for efficiency reasons.\ncontract LibExchangeErrors {\n\n /// Order validation errors ///\n string constant ORDER_UNFILLABLE = \"ORDER_UNFILLABLE\"; // Order cannot be filled.\n string constant INVALID_MAKER = \"INVALID_MAKER\"; // Invalid makerAddress.\n string constant INVALID_TAKER = \"INVALID_TAKER\"; // Invalid takerAddress.\n string constant INVALID_SENDER = \"INVALID_SENDER\"; // Invalid `msg.sender`.\n string constant INVALID_ORDER_SIGNATURE = \"INVALID_ORDER_SIGNATURE\"; // Signature validation failed. \n \n /// fillOrder validation errors ///\n string constant INVALID_TAKER_AMOUNT = \"INVALID_TAKER_AMOUNT\"; // takerAssetFillAmount cannot equal 0.\n string constant ROUNDING_ERROR = \"ROUNDING_ERROR\"; // Rounding error greater than 0.1% of takerAssetFillAmount. \n \n /// Signature validation errors ///\n string constant INVALID_SIGNATURE = \"INVALID_SIGNATURE\"; // Signature validation failed. \n string constant SIGNATURE_ILLEGAL = \"SIGNATURE_ILLEGAL\"; // Signature type is illegal.\n string constant SIGNATURE_UNSUPPORTED = \"SIGNATURE_UNSUPPORTED\"; // Signature type unsupported.\n \n /// cancelOrdersUptTo errors ///\n string constant INVALID_NEW_ORDER_EPOCH = \"INVALID_NEW_ORDER_EPOCH\"; // Specified salt must be greater than or equal to existing orderEpoch.\n\n /// fillOrKillOrder errors ///\n string constant COMPLETE_FILL_FAILED = \"COMPLETE_FILL_FAILED\"; // Desired takerAssetFillAmount could not be completely filled. \n\n /// matchOrders errors ///\n string constant NEGATIVE_SPREAD_REQUIRED = \"NEGATIVE_SPREAD_REQUIRED\"; // Matched orders must have a negative spread.\n\n /// Transaction errors ///\n string constant REENTRANCY_ILLEGAL = \"REENTRANCY_ILLEGAL\"; // Recursive reentrancy is not allowed. \n string constant INVALID_TX_HASH = \"INVALID_TX_HASH\"; // Transaction has already been executed. \n string constant INVALID_TX_SIGNATURE = \"INVALID_TX_SIGNATURE\"; // Signature validation failed. \n string constant FAILED_EXECUTION = \"FAILED_EXECUTION\"; // Transaction execution failed. \n \n /// registerAssetProxy errors ///\n string constant ASSET_PROXY_ALREADY_EXISTS = \"ASSET_PROXY_ALREADY_EXISTS\"; // AssetProxy with same id already exists.\n\n /// dispatchTransferFrom errors ///\n string constant ASSET_PROXY_DOES_NOT_EXIST = \"ASSET_PROXY_DOES_NOT_EXIST\"; // No assetProxy registered at given id.\n string constant TRANSFER_FAILED = \"TRANSFER_FAILED\"; // Asset transfer unsuccesful.\n\n /// Length validation errors ///\n string constant LENGTH_GREATER_THAN_0_REQUIRED = \"LENGTH_GREATER_THAN_0_REQUIRED\"; // Byte array must have a length greater than 0.\n string constant LENGTH_GREATER_THAN_3_REQUIRED = \"LENGTH_GREATER_THAN_3_REQUIRED\"; // Byte array must have a length greater than 3.\n string constant LENGTH_0_REQUIRED = \"LENGTH_0_REQUIRED\"; // Byte array must have a length of 0.\n string constant LENGTH_65_REQUIRED = \"LENGTH_65_REQUIRED\"; // Byte array must have a length of 65.\n}\n",
- "2.0.0/protocol/Exchange/libs/LibFillResults.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract LibFillResults is\n SafeMath\n{\n struct FillResults {\n uint256 makerAssetFilledAmount; // Total amount of makerAsset(s) filled.\n uint256 takerAssetFilledAmount; // Total amount of takerAsset(s) filled.\n uint256 makerFeePaid; // Total amount of ZRX paid by maker(s) to feeRecipient(s).\n uint256 takerFeePaid; // Total amount of ZRX paid by taker to feeRecipients(s).\n }\n\n struct MatchedFillResults {\n FillResults left; // Amounts filled and fees paid of left order.\n FillResults right; // Amounts filled and fees paid of right order.\n uint256 leftMakerAssetSpreadAmount; // Spread between price of left and right order, denominated in the left order's makerAsset, paid to taker.\n }\n\n /// @dev Adds properties of both FillResults instances.\n /// Modifies the first FillResults instance specified.\n /// @param totalFillResults Fill results instance that will be added onto.\n /// @param singleFillResults Fill results instance that will be added to totalFillResults.\n function addFillResults(FillResults memory totalFillResults, FillResults memory singleFillResults)\n internal\n pure\n {\n totalFillResults.makerAssetFilledAmount = safeAdd(totalFillResults.makerAssetFilledAmount, singleFillResults.makerAssetFilledAmount);\n totalFillResults.takerAssetFilledAmount = safeAdd(totalFillResults.takerAssetFilledAmount, singleFillResults.takerAssetFilledAmount);\n totalFillResults.makerFeePaid = safeAdd(totalFillResults.makerFeePaid, singleFillResults.makerFeePaid);\n totalFillResults.takerFeePaid = safeAdd(totalFillResults.takerFeePaid, singleFillResults.takerFeePaid);\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibMath.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract LibMath is\n SafeMath\n{\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// Reverts if rounding error is >= 0.1%\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded down.\n function safeGetPartialAmountFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n require(\n !isRoundingErrorFloor(\n numerator,\n denominator,\n target\n ),\n \"ROUNDING_ERROR\"\n );\n \n partialAmount = safeDiv(\n safeMul(numerator, target),\n denominator\n );\n return partialAmount;\n }\n\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// Reverts if rounding error is >= 0.1%\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded up.\n function safeGetPartialAmountCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n require(\n !isRoundingErrorCeil(\n numerator,\n denominator,\n target\n ),\n \"ROUNDING_ERROR\"\n );\n \n // safeDiv computes `floor(a / b)`. We use the identity (a, b integer):\n // ceil(a / b) = floor((a + b - 1) / b)\n // To implement `ceil(a / b)` using safeDiv.\n partialAmount = safeDiv(\n safeAdd(\n safeMul(numerator, target),\n safeSub(denominator, 1)\n ),\n denominator\n );\n return partialAmount;\n }\n\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded down.\n function getPartialAmountFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n partialAmount = safeDiv(\n safeMul(numerator, target),\n denominator\n );\n return partialAmount;\n }\n \n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded up.\n function getPartialAmountCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n // safeDiv computes `floor(a / b)`. We use the identity (a, b integer):\n // ceil(a / b) = floor((a + b - 1) / b)\n // To implement `ceil(a / b)` using safeDiv.\n partialAmount = safeDiv(\n safeAdd(\n safeMul(numerator, target),\n safeSub(denominator, 1)\n ),\n denominator\n );\n return partialAmount;\n }\n \n /// @dev Checks if rounding error >= 0.1% when rounding down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to multiply with numerator/denominator.\n /// @return Rounding error is present.\n function isRoundingErrorFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (bool isError)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n \n // The absolute rounding error is the difference between the rounded\n // value and the ideal value. The relative rounding error is the\n // absolute rounding error divided by the absolute value of the\n // ideal value. This is undefined when the ideal value is zero.\n //\n // The ideal value is `numerator * target / denominator`.\n // Let's call `numerator * target % denominator` the remainder.\n // The absolute error is `remainder / denominator`.\n //\n // When the ideal value is zero, we require the absolute error to\n // be zero. Fortunately, this is always the case. The ideal value is\n // zero iff `numerator == 0` and/or `target == 0`. In this case the\n // remainder and absolute error are also zero. \n if (target == 0 || numerator == 0) {\n return false;\n }\n \n // Otherwise, we want the relative rounding error to be strictly\n // less than 0.1%.\n // The relative error is `remainder / (numerator * target)`.\n // We want the relative error less than 1 / 1000:\n // remainder / (numerator * denominator) < 1 / 1000\n // or equivalently:\n // 1000 * remainder < numerator * target\n // so we have a rounding error iff:\n // 1000 * remainder >= numerator * target\n uint256 remainder = mulmod(\n target,\n numerator,\n denominator\n );\n isError = safeMul(1000, remainder) >= safeMul(numerator, target);\n return isError;\n }\n \n /// @dev Checks if rounding error >= 0.1% when rounding up.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to multiply with numerator/denominator.\n /// @return Rounding error is present.\n function isRoundingErrorCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (bool isError)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n \n // See the comments in `isRoundingError`.\n if (target == 0 || numerator == 0) {\n // When either is zero, the ideal value and rounded value are zero\n // and there is no rounding error. (Although the relative error\n // is undefined.)\n return false;\n }\n // Compute remainder as before\n uint256 remainder = mulmod(\n target,\n numerator,\n denominator\n );\n remainder = safeSub(denominator, remainder) % denominator;\n isError = safeMul(1000, remainder) >= safeMul(numerator, target);\n return isError;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibOrder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./LibEIP712.sol\";\n\n\ncontract LibOrder is\n LibEIP712\n{\n // Hash for the EIP712 Order Schema\n bytes32 constant internal EIP712_ORDER_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"Order(\",\n \"address makerAddress,\",\n \"address takerAddress,\",\n \"address feeRecipientAddress,\",\n \"address senderAddress,\",\n \"uint256 makerAssetAmount,\",\n \"uint256 takerAssetAmount,\",\n \"uint256 makerFee,\",\n \"uint256 takerFee,\",\n \"uint256 expirationTimeSeconds,\",\n \"uint256 salt,\",\n \"bytes makerAssetData,\",\n \"bytes takerAssetData\",\n \")\"\n ));\n\n // A valid order remains fillable until it is expired, fully filled, or cancelled.\n // An order's state is unaffected by external factors, like account balances.\n enum OrderStatus {\n INVALID, // Default value\n INVALID_MAKER_ASSET_AMOUNT, // Order does not have a valid maker asset amount\n INVALID_TAKER_ASSET_AMOUNT, // Order does not have a valid taker asset amount\n FILLABLE, // Order is fillable\n EXPIRED, // Order has already expired\n FULLY_FILLED, // Order is fully filled\n CANCELLED // Order has been cancelled\n }\n\n // solhint-disable max-line-length\n struct Order {\n address makerAddress; // Address that created the order. \n address takerAddress; // Address that is allowed to fill the order. If set to 0, any address is allowed to fill the order. \n address feeRecipientAddress; // Address that will recieve fees when order is filled. \n address senderAddress; // Address that is allowed to call Exchange contract methods that affect this order. If set to 0, any address is allowed to call these methods.\n uint256 makerAssetAmount; // Amount of makerAsset being offered by maker. Must be greater than 0. \n uint256 takerAssetAmount; // Amount of takerAsset being bid on by maker. Must be greater than 0. \n uint256 makerFee; // Amount of ZRX paid to feeRecipient by maker when order is filled. If set to 0, no transfer of ZRX from maker to feeRecipient will be attempted.\n uint256 takerFee; // Amount of ZRX paid to feeRecipient by taker when order is filled. If set to 0, no transfer of ZRX from taker to feeRecipient will be attempted.\n uint256 expirationTimeSeconds; // Timestamp in seconds at which order expires. \n uint256 salt; // Arbitrary number to facilitate uniqueness of the order's hash. \n bytes makerAssetData; // Encoded data that can be decoded by a specified proxy contract when transferring makerAsset. The last byte references the id of this proxy.\n bytes takerAssetData; // Encoded data that can be decoded by a specified proxy contract when transferring takerAsset. The last byte references the id of this proxy.\n }\n // solhint-enable max-line-length\n\n struct OrderInfo {\n uint8 orderStatus; // Status that describes order's validity and fillability.\n bytes32 orderHash; // EIP712 hash of the order (see LibOrder.getOrderHash).\n uint256 orderTakerAssetFilledAmount; // Amount of order that has already been filled.\n }\n\n /// @dev Calculates Keccak-256 hash of the order.\n /// @param order The order structure.\n /// @return Keccak-256 EIP712 hash of the order.\n function getOrderHash(Order memory order)\n internal\n view\n returns (bytes32 orderHash)\n {\n orderHash = hashEIP712Message(hashOrder(order));\n return orderHash;\n }\n\n /// @dev Calculates EIP712 hash of the order.\n /// @param order The order structure.\n /// @return EIP712 hash of the order.\n function hashOrder(Order memory order)\n internal\n pure\n returns (bytes32 result)\n {\n bytes32 schemaHash = EIP712_ORDER_SCHEMA_HASH;\n bytes32 makerAssetDataHash = keccak256(order.makerAssetData);\n bytes32 takerAssetDataHash = keccak256(order.takerAssetData);\n\n // Assembly for more efficiently computing:\n // keccak256(abi.encodePacked(\n // EIP712_ORDER_SCHEMA_HASH,\n // bytes32(order.makerAddress),\n // bytes32(order.takerAddress),\n // bytes32(order.feeRecipientAddress),\n // bytes32(order.senderAddress),\n // order.makerAssetAmount,\n // order.takerAssetAmount,\n // order.makerFee,\n // order.takerFee,\n // order.expirationTimeSeconds,\n // order.salt,\n // keccak256(order.makerAssetData),\n // keccak256(order.takerAssetData)\n // ));\n\n assembly {\n // Calculate memory addresses that will be swapped out before hashing\n let pos1 := sub(order, 32)\n let pos2 := add(order, 320)\n let pos3 := add(order, 352)\n\n // Backup\n let temp1 := mload(pos1)\n let temp2 := mload(pos2)\n let temp3 := mload(pos3)\n \n // Hash in place\n mstore(pos1, schemaHash)\n mstore(pos2, makerAssetDataHash)\n mstore(pos3, takerAssetDataHash)\n result := keccak256(pos1, 416)\n \n // Restore\n mstore(pos1, temp1)\n mstore(pos2, temp2)\n mstore(pos3, temp3)\n }\n return result;\n }\n}\n",
- "2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAssetProxyDispatcher.sol\";\n\n\ncontract MAssetProxyDispatcher is\n IAssetProxyDispatcher\n{\n // Logs registration of new asset proxy\n event AssetProxyRegistered(\n bytes4 id, // Id of new registered AssetProxy.\n address assetProxy // Address of new registered AssetProxy.\n );\n\n /// @dev Forwards arguments to assetProxy and calls `transferFrom`. Either succeeds or throws.\n /// @param assetData Byte array encoded for the asset.\n /// @param from Address to transfer token from.\n /// @param to Address to transfer token to.\n /// @param amount Amount of token to transfer.\n function dispatchTransferFrom(\n bytes memory assetData,\n address from,\n address to,\n uint256 amount\n )\n internal;\n}\n",
- "2.0.0/protocol/Exchange/mixins/MExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IExchangeCore.sol\";\n\n\ncontract MExchangeCore is\n IExchangeCore\n{\n // Fill event is emitted whenever an order is filled.\n event Fill(\n address indexed makerAddress, // Address that created the order. \n address indexed feeRecipientAddress, // Address that received fees.\n address takerAddress, // Address that filled the order.\n address senderAddress, // Address that called the Exchange contract (msg.sender).\n uint256 makerAssetFilledAmount, // Amount of makerAsset sold by maker and bought by taker. \n uint256 takerAssetFilledAmount, // Amount of takerAsset sold by taker and bought by maker.\n uint256 makerFeePaid, // Amount of ZRX paid to feeRecipient by maker.\n uint256 takerFeePaid, // Amount of ZRX paid to feeRecipient by taker.\n bytes32 indexed orderHash, // EIP712 hash of order (see LibOrder.getOrderHash).\n bytes makerAssetData, // Encoded data specific to makerAsset. \n bytes takerAssetData // Encoded data specific to takerAsset.\n );\n\n // Cancel event is emitted whenever an individual order is cancelled.\n event Cancel(\n address indexed makerAddress, // Address that created the order. \n address indexed feeRecipientAddress, // Address that would have recieved fees if order was filled. \n address senderAddress, // Address that called the Exchange contract (msg.sender).\n bytes32 indexed orderHash, // EIP712 hash of order (see LibOrder.getOrderHash).\n bytes makerAssetData, // Encoded data specific to makerAsset. \n bytes takerAssetData // Encoded data specific to takerAsset.\n );\n\n // CancelUpTo event is emitted whenever `cancelOrdersUpTo` is executed succesfully.\n event CancelUpTo(\n address indexed makerAddress, // Orders cancelled must have been created by this address.\n address indexed senderAddress, // Orders cancelled must have a `senderAddress` equal to this address.\n uint256 orderEpoch // Orders with specified makerAddress and senderAddress with a salt less than this value are considered cancelled.\n );\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev After calling, the order can not be filled anymore.\n /// @param order Order struct containing order specifications.\n function cancelOrderInternal(LibOrder.Order memory order)\n internal;\n\n /// @dev Updates state with results of a fill order.\n /// @param order that was filled.\n /// @param takerAddress Address of taker who filled the order.\n /// @param orderTakerAssetFilledAmount Amount of order already filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function updateFilledState(\n LibOrder.Order memory order,\n address takerAddress,\n bytes32 orderHash,\n uint256 orderTakerAssetFilledAmount,\n LibFillResults.FillResults memory fillResults\n )\n internal;\n\n /// @dev Updates state with results of cancelling an order.\n /// State is only updated if the order is currently fillable.\n /// Otherwise, updating state would have no effect.\n /// @param order that was cancelled.\n /// @param orderHash Hash of order that was cancelled.\n function updateCancelledState(\n LibOrder.Order memory order,\n bytes32 orderHash\n )\n internal;\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAddress Address of order taker.\n /// @param signature Proof that the orders was created by its maker.\n function assertFillableOrder(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo,\n address takerAddress,\n bytes memory signature\n )\n internal\n view;\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo Status, orderHash, and amount already filled of order.\n /// @param takerAssetFillAmount Desired amount of order to fill by taker.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @param makerAssetFilledAmount Amount of makerAsset that will be transfered.\n function assertValidFill(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo,\n uint256 takerAssetFillAmount,\n uint256 takerAssetFilledAmount,\n uint256 makerAssetFilledAmount\n )\n internal\n view;\n\n /// @dev Validates context for cancelOrder. Succeeds or throws.\n /// @param order to be cancelled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n function assertValidCancel(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo\n )\n internal\n view;\n\n /// @dev Calculates amounts filled and fees paid by maker and taker.\n /// @param order to be filled.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function calculateFillResults(\n LibOrder.Order memory order,\n uint256 takerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.FillResults memory fillResults);\n\n}\n",
- "2.0.0/protocol/Exchange/mixins/MMatchOrders.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IMatchOrders.sol\";\n\n\ncontract MMatchOrders is\n IMatchOrders\n{\n /// @dev Validates context for matchOrders. Succeeds or throws.\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n function assertValidMatch(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder\n )\n internal\n pure;\n\n /// @dev Calculates fill amounts for the matched orders.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the leftOrder order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftOrderTakerAssetFilledAmount Amount of left order already filled.\n /// @param rightOrderTakerAssetFilledAmount Amount of right order already filled.\n /// @param matchedFillResults Amounts to fill and fees to pay by maker and taker of matched orders.\n function calculateMatchedFillResults(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n uint256 leftOrderTakerAssetFilledAmount,\n uint256 rightOrderTakerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.MatchedFillResults memory matchedFillResults);\n\n}\n",
- "2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/ISignatureValidator.sol\";\n\n\ncontract MSignatureValidator is\n ISignatureValidator\n{\n event SignatureValidatorApproval(\n address indexed signerAddress, // Address that approves or disapproves a contract to verify signatures.\n address indexed validatorAddress, // Address of signature validator contract.\n bool approved // Approval or disapproval of validator contract.\n );\n\n // Allowed signature types.\n enum SignatureType {\n Illegal, // 0x00, default value\n Invalid, // 0x01\n EIP712, // 0x02\n EthSign, // 0x03\n Wallet, // 0x04\n Validator, // 0x05\n PreSigned, // 0x06\n NSignatureTypes // 0x07, number of signature types. Always leave at end.\n }\n\n /// @dev Verifies signature using logic defined by Wallet contract.\n /// @param hash Any 32 byte hash.\n /// @param walletAddress Address that should have signed the given hash\n /// and defines its own signature verification method.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidWalletSignature(\n bytes32 hash,\n address walletAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid);\n\n /// @dev Verifies signature using logic defined by Validator contract.\n /// @param validatorAddress Address of validator contract.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidValidatorSignature(\n address validatorAddress,\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/mixins/MTransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\nimport \"../interfaces/ITransactions.sol\";\n\n\ncontract MTransactions is\n ITransactions\n{\n // Hash for the EIP712 ZeroEx Transaction Schema\n bytes32 constant internal EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"ZeroExTransaction(\",\n \"uint256 salt,\",\n \"address signerAddress,\",\n \"bytes data\",\n \")\"\n ));\n\n /// @dev Calculates EIP712 hash of the Transaction.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @return EIP712 hash of the Transaction.\n function hashZeroExTransaction(\n uint256 salt,\n address signerAddress,\n bytes memory data\n )\n internal\n pure\n returns (bytes32 result);\n\n /// @dev The current function will be called in the context of this address (either 0x transaction signer or `msg.sender`).\n /// If calling a fill function, this address will represent the taker.\n /// If calling a cancel function, this address will represent the maker.\n /// @return Signer of 0x transaction if entry point is `executeTransaction`.\n /// `msg.sender` if entry point is any other function.\n function getCurrentContextAddress()\n internal\n view\n returns (address);\n}\n",
- "2.0.0/protocol/Exchange/mixins/MWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IWrapperFunctions.sol\";\n\n\ncontract MWrapperFunctions is \n IWrapperFunctions\n{\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n}\n",
- "2.0.0/tokens/ERC20Token/IERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC20Token {\n\n // solhint-disable no-simple-event-func-name\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 _value\n );\n\n event Approval(\n address indexed _owner,\n address indexed _spender,\n uint256 _value\n );\n\n /// @dev send `value` token to `to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transfer(address _to, uint256 _value)\n external\n returns (bool);\n\n /// @dev send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool);\n \n /// @dev `msg.sender` approves `_spender` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Always true if the call has enough gas to complete execution\n function approve(address _spender, uint256 _value)\n external\n returns (bool);\n\n /// @dev Query total supply of token\n /// @return Total supply of token\n function totalSupply()\n external\n view\n returns (uint256);\n \n /// @param _owner The address from which the balance will be retrieved\n /// @return Balance of owner\n function balanceOf(address _owner)\n external\n view\n returns (uint256);\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender)\n external\n view\n returns (uint256);\n}\n",
- "2.0.0/tokens/ERC721Token/IERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC721Token {\n\n /// @dev This emits when ownership of any NFT changes by any mechanism.\n /// This event emits when NFTs are created (`from` == 0) and destroyed\n /// (`to` == 0). Exception: during contract creation, any number of NFTs\n /// may be created and assigned without emitting Transfer. At the time of\n /// any transfer, the approved address for that NFT (if any) is reset to none.\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 indexed _tokenId\n );\n\n /// @dev This emits when the approved address for an NFT is changed or\n /// reaffirmed. The zero address indicates there is no approved address.\n /// When a Transfer event emits, this also indicates that the approved\n /// address for that NFT (if any) is reset to none.\n event Approval(\n address indexed _owner,\n address indexed _approved,\n uint256 indexed _tokenId\n );\n\n /// @dev This emits when an operator is enabled or disabled for an owner.\n /// The operator can manage all NFTs of the owner.\n event ApprovalForAll(\n address indexed _owner,\n address indexed _operator,\n bool _approved\n );\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// perator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT. When transfer is complete, this function\n /// checks if `_to` is a smart contract (code size > 0). If so, it calls\n /// `onERC721Received` on `_to` and throws if the return value is not\n /// `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n /// @param _data Additional data with no specified format, sent in call to `_to`\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId,\n bytes _data\n )\n external;\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev This works identically to the other function with an extra data parameter,\n /// except this function just sets data to \"\".\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n external;\n\n /// @notice Change or reaffirm the approved address for an NFT\n /// @dev The zero address indicates there is no approved address.\n /// Throws unless `msg.sender` is the current NFT owner, or an authorized\n /// operator of the current owner.\n /// @param _approved The new approved NFT controller\n /// @param _tokenId The NFT to approve\n function approve(address _approved, uint256 _tokenId)\n external;\n\n /// @notice Enable or disable approval for a third party (\"operator\") to manage\n /// all of `msg.sender`'s assets\n /// @dev Emits the ApprovalForAll event. The contract MUST allow\n /// multiple operators per owner.\n /// @param _operator Address to add to the set of authorized operators\n /// @param _approved True if the operator is approved, false to revoke approval\n function setApprovalForAll(address _operator, bool _approved)\n external;\n\n /// @notice Count all NFTs assigned to an owner\n /// @dev NFTs assigned to the zero address are considered invalid, and this\n /// function throws for queries about the zero address.\n /// @param _owner An address for whom to query the balance\n /// @return The number of NFTs owned by `_owner`, possibly zero\n function balanceOf(address _owner)\n external\n view\n returns (uint256);\n\n /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE\n /// TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE\n /// THEY MAY BE PERMANENTLY LOST\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function transferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n public;\n\n /// @notice Find the owner of an NFT\n /// @dev NFTs assigned to zero address are considered invalid, and queries\n /// about them do throw.\n /// @param _tokenId The identifier for an NFT\n /// @return The address of the owner of the NFT\n function ownerOf(uint256 _tokenId)\n public\n view\n returns (address);\n\n /// @notice Get the approved address for a single NFT\n /// @dev Throws if `_tokenId` is not a valid NFT.\n /// @param _tokenId The NFT to find the approved address for\n /// @return The approved address for this NFT, or the zero address if there is none\n function getApproved(uint256 _tokenId) \n public\n view\n returns (address);\n \n /// @notice Query if an address is an authorized operator for another address\n /// @param _owner The address that owns the NFTs\n /// @param _operator The address that acts on behalf of the owner\n /// @return True if `_operator` is an approved operator for `_owner`, false otherwise\n function isApprovedForAll(address _owner, address _operator)\n public\n view\n returns (bool);\n}\n",
- "2.0.0/tokens/EtherToken/IEtherToken.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../ERC20Token/IERC20Token.sol\";\n\n\ncontract IEtherToken is\n IERC20Token\n{\n function deposit()\n public\n payable;\n \n function withdraw(uint256 amount)\n public;\n}\n",
- "2.0.0/utils/LibBytes/LibBytes.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\nlibrary LibBytes {\n\n using LibBytes for bytes;\n\n /// @dev Gets the memory address for a byte array.\n /// @param input Byte array to lookup.\n /// @return memoryAddress Memory address of byte array. This\n /// points to the header of the byte array which contains\n /// the length.\n function rawAddress(bytes memory input)\n internal\n pure\n returns (uint256 memoryAddress)\n {\n assembly {\n memoryAddress := input\n }\n return memoryAddress;\n }\n \n /// @dev Gets the memory address for the contents of a byte array.\n /// @param input Byte array to lookup.\n /// @return memoryAddress Memory address of the contents of the byte array.\n function contentAddress(bytes memory input)\n internal\n pure\n returns (uint256 memoryAddress)\n {\n assembly {\n memoryAddress := add(input, 32)\n }\n return memoryAddress;\n }\n\n /// @dev Copies `length` bytes from memory location `source` to `dest`.\n /// @param dest memory address to copy bytes to.\n /// @param source memory address to copy bytes from.\n /// @param length number of bytes to copy.\n function memCopy(\n uint256 dest,\n uint256 source,\n uint256 length\n )\n internal\n pure\n {\n if (length < 32) {\n // Handle a partial word by reading destination and masking\n // off the bits we are interested in.\n // This correctly handles overlap, zero lengths and source == dest\n assembly {\n let mask := sub(exp(256, sub(32, length)), 1)\n let s := and(mload(source), not(mask))\n let d := and(mload(dest), mask)\n mstore(dest, or(s, d))\n }\n } else {\n // Skip the O(length) loop when source == dest.\n if (source == dest) {\n return;\n }\n\n // For large copies we copy whole words at a time. The final\n // word is aligned to the end of the range (instead of after the\n // previous) to handle partial words. So a copy will look like this:\n //\n // ####\n // ####\n // ####\n // ####\n //\n // We handle overlap in the source and destination range by\n // changing the copying direction. This prevents us from\n // overwriting parts of source that we still need to copy.\n //\n // This correctly handles source == dest\n //\n if (source > dest) {\n assembly {\n // We subtract 32 from `sEnd` and `dEnd` because it\n // is easier to compare with in the loop, and these\n // are also the addresses we need for copying the\n // last bytes.\n length := sub(length, 32)\n let sEnd := add(source, length)\n let dEnd := add(dest, length)\n\n // Remember the last 32 bytes of source\n // This needs to be done here and not after the loop\n // because we may have overwritten the last bytes in\n // source already due to overlap.\n let last := mload(sEnd)\n\n // Copy whole words front to back\n // Note: the first check is always true,\n // this could have been a do-while loop.\n // solhint-disable-next-line no-empty-blocks\n for {} lt(source, sEnd) {} {\n mstore(dest, mload(source))\n source := add(source, 32)\n dest := add(dest, 32)\n }\n \n // Write the last 32 bytes\n mstore(dEnd, last)\n }\n } else {\n assembly {\n // We subtract 32 from `sEnd` and `dEnd` because those\n // are the starting points when copying a word at the end.\n length := sub(length, 32)\n let sEnd := add(source, length)\n let dEnd := add(dest, length)\n\n // Remember the first 32 bytes of source\n // This needs to be done here and not after the loop\n // because we may have overwritten the first bytes in\n // source already due to overlap.\n let first := mload(source)\n\n // Copy whole words back to front\n // We use a signed comparisson here to allow dEnd to become\n // negative (happens when source and dest < 32). Valid\n // addresses in local memory will never be larger than\n // 2**255, so they can be safely re-interpreted as signed.\n // Note: the first check is always true,\n // this could have been a do-while loop.\n // solhint-disable-next-line no-empty-blocks\n for {} slt(dest, dEnd) {} {\n mstore(dEnd, mload(sEnd))\n sEnd := sub(sEnd, 32)\n dEnd := sub(dEnd, 32)\n }\n \n // Write the first 32 bytes\n mstore(dest, first)\n }\n }\n }\n }\n\n /// @dev Returns a slices from a byte array.\n /// @param b The byte array to take a slice from.\n /// @param from The starting index for the slice (inclusive).\n /// @param to The final index for the slice (exclusive).\n /// @return result The slice containing bytes at indices [from, to)\n function slice(\n bytes memory b,\n uint256 from,\n uint256 to\n )\n internal\n pure\n returns (bytes memory result)\n {\n require(\n from <= to,\n \"FROM_LESS_THAN_TO_REQUIRED\"\n );\n require(\n to < b.length,\n \"TO_LESS_THAN_LENGTH_REQUIRED\"\n );\n \n // Create a new bytes structure and copy contents\n result = new bytes(to - from);\n memCopy(\n result.contentAddress(),\n b.contentAddress() + from,\n result.length\n );\n return result;\n }\n \n /// @dev Returns a slice from a byte array without preserving the input.\n /// @param b The byte array to take a slice from. Will be destroyed in the process.\n /// @param from The starting index for the slice (inclusive).\n /// @param to The final index for the slice (exclusive).\n /// @return result The slice containing bytes at indices [from, to)\n /// @dev When `from == 0`, the original array will match the slice. In other cases its state will be corrupted.\n function sliceDestructive(\n bytes memory b,\n uint256 from,\n uint256 to\n )\n internal\n pure\n returns (bytes memory result)\n {\n require(\n from <= to,\n \"FROM_LESS_THAN_TO_REQUIRED\"\n );\n require(\n to < b.length,\n \"TO_LESS_THAN_LENGTH_REQUIRED\"\n );\n \n // Create a new bytes structure around [from, to) in-place.\n assembly {\n result := add(b, from)\n mstore(result, sub(to, from))\n }\n return result;\n }\n\n /// @dev Pops the last byte off of a byte array by modifying its length.\n /// @param b Byte array that will be modified.\n /// @return The byte that was popped off.\n function popLastByte(bytes memory b)\n internal\n pure\n returns (bytes1 result)\n {\n require(\n b.length > 0,\n \"GREATER_THAN_ZERO_LENGTH_REQUIRED\"\n );\n\n // Store last byte.\n result = b[b.length - 1];\n\n assembly {\n // Decrement length of byte array.\n let newLen := sub(mload(b), 1)\n mstore(b, newLen)\n }\n return result;\n }\n\n /// @dev Pops the last 20 bytes off of a byte array by modifying its length.\n /// @param b Byte array that will be modified.\n /// @return The 20 byte address that was popped off.\n function popLast20Bytes(bytes memory b)\n internal\n pure\n returns (address result)\n {\n require(\n b.length >= 20,\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Store last 20 bytes.\n result = readAddress(b, b.length - 20);\n\n assembly {\n // Subtract 20 from byte array length.\n let newLen := sub(mload(b), 20)\n mstore(b, newLen)\n }\n return result;\n }\n\n /// @dev Tests equality of two byte arrays.\n /// @param lhs First byte array to compare.\n /// @param rhs Second byte array to compare.\n /// @return True if arrays are the same. False otherwise.\n function equals(\n bytes memory lhs,\n bytes memory rhs\n )\n internal\n pure\n returns (bool equal)\n {\n // Keccak gas cost is 30 + numWords * 6. This is a cheap way to compare.\n // We early exit on unequal lengths, but keccak would also correctly\n // handle this.\n return lhs.length == rhs.length && keccak256(lhs) == keccak256(rhs);\n }\n\n /// @dev Reads an address from a position in a byte array.\n /// @param b Byte array containing an address.\n /// @param index Index in byte array of address.\n /// @return address from byte array.\n function readAddress(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (address result)\n {\n require(\n b.length >= index + 20, // 20 is length of address\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Add offset to index:\n // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)\n // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)\n index += 20;\n\n // Read address from array memory\n assembly {\n // 1. Add index to address of bytes array\n // 2. Load 32-byte word from memory\n // 3. Apply 20-byte mask to obtain address\n result := and(mload(add(b, index)), 0xffffffffffffffffffffffffffffffffffffffff)\n }\n return result;\n }\n\n /// @dev Writes an address into a specific position in a byte array.\n /// @param b Byte array to insert address into.\n /// @param index Index in byte array of address.\n /// @param input Address to put into byte array.\n function writeAddress(\n bytes memory b,\n uint256 index,\n address input\n )\n internal\n pure\n {\n require(\n b.length >= index + 20, // 20 is length of address\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Add offset to index:\n // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)\n // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)\n index += 20;\n\n // Store address into array memory\n assembly {\n // The address occupies 20 bytes and mstore stores 32 bytes.\n // First fetch the 32-byte word where we'll be storing the address, then\n // apply a mask so we have only the bytes in the word that the address will not occupy.\n // Then combine these bytes with the address and store the 32 bytes back to memory with mstore.\n\n // 1. Add index to address of bytes array\n // 2. Load 32-byte word from memory\n // 3. Apply 12-byte mask to obtain extra bytes occupying word of memory where we'll store the address\n let neighbors := and(\n mload(add(b, index)),\n 0xffffffffffffffffffffffff0000000000000000000000000000000000000000\n )\n \n // Make sure input address is clean.\n // (Solidity does not guarantee this)\n input := and(input, 0xffffffffffffffffffffffffffffffffffffffff)\n\n // Store the neighbors and address into memory\n mstore(add(b, index), xor(input, neighbors))\n }\n }\n\n /// @dev Reads a bytes32 value from a position in a byte array.\n /// @param b Byte array containing a bytes32 value.\n /// @param index Index in byte array of bytes32 value.\n /// @return bytes32 value from byte array.\n function readBytes32(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes32 result)\n {\n require(\n b.length >= index + 32,\n \"GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 256 bit length parameter\n index += 32;\n\n // Read the bytes32 from array memory\n assembly {\n result := mload(add(b, index))\n }\n return result;\n }\n\n /// @dev Writes a bytes32 into a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input bytes32 to put into byte array.\n function writeBytes32(\n bytes memory b,\n uint256 index,\n bytes32 input\n )\n internal\n pure\n {\n require(\n b.length >= index + 32,\n \"GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 256 bit length parameter\n index += 32;\n\n // Read the bytes32 from array memory\n assembly {\n mstore(add(b, index), input)\n }\n }\n\n /// @dev Reads a uint256 value from a position in a byte array.\n /// @param b Byte array containing a uint256 value.\n /// @param index Index in byte array of uint256 value.\n /// @return uint256 value from byte array.\n function readUint256(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (uint256 result)\n {\n result = uint256(readBytes32(b, index));\n return result;\n }\n\n /// @dev Writes a uint256 into a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input uint256 to put into byte array.\n function writeUint256(\n bytes memory b,\n uint256 index,\n uint256 input\n )\n internal\n pure\n {\n writeBytes32(b, index, bytes32(input));\n }\n\n /// @dev Reads an unpadded bytes4 value from a position in a byte array.\n /// @param b Byte array containing a bytes4 value.\n /// @param index Index in byte array of bytes4 value.\n /// @return bytes4 value from byte array.\n function readBytes4(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes4 result)\n {\n require(\n b.length >= index + 4,\n \"GREATER_OR_EQUAL_TO_4_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 32 byte length field\n index += 32;\n\n // Read the bytes4 from array memory\n assembly {\n result := mload(add(b, index))\n // Solidity does not require us to clean the trailing bytes.\n // We do it anyway\n result := and(result, 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000)\n }\n return result;\n }\n\n /// @dev Reads nested bytes from a specific position.\n /// @dev NOTE: the returned value overlaps with the input value.\n /// Both should be treated as immutable.\n /// @param b Byte array containing nested bytes.\n /// @param index Index of nested bytes.\n /// @return result Nested bytes.\n function readBytesWithLength(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes memory result)\n {\n // Read length of nested bytes\n uint256 nestedBytesLength = readUint256(b, index);\n index += 32;\n\n // Assert length of <b> is valid, given\n // length of nested bytes\n require(\n b.length >= index + nestedBytesLength,\n \"GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED\"\n );\n \n // Return a pointer to the byte array as it exists inside `b`\n assembly {\n result := add(b, index)\n }\n return result;\n }\n\n /// @dev Inserts bytes at a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input bytes to insert.\n function writeBytesWithLength(\n bytes memory b,\n uint256 index,\n bytes memory input\n )\n internal\n pure\n {\n // Assert length of <b> is valid, given\n // length of input\n require(\n b.length >= index + 32 + input.length, // 32 bytes to store length\n \"GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED\"\n );\n\n // Copy <input> into <b>\n memCopy(\n b.contentAddress() + index,\n input.rawAddress(), // includes length of <input>\n input.length + 32 // +32 bytes to store <input> length\n );\n }\n\n /// @dev Performs a deep copy of a byte array onto another byte array of greater than or equal length.\n /// @param dest Byte array that will be overwritten with source bytes.\n /// @param source Byte array to copy onto dest bytes.\n function deepCopyBytes(\n bytes memory dest,\n bytes memory source\n )\n internal\n pure\n {\n uint256 sourceLen = source.length;\n // Dest length must be >= source length, or some bytes would not be copied.\n require(\n dest.length >= sourceLen,\n \"GREATER_OR_EQUAL_TO_SOURCE_BYTES_LENGTH_REQUIRED\"\n );\n memCopy(\n dest.contentAddress(),\n source.contentAddress(),\n sourceLen\n );\n }\n}\n",
- "2.0.0/utils/Ownable/IOwnable.sol": "pragma solidity 0.4.24;\n\n\ncontract IOwnable {\n\n function transferOwnership(address newOwner)\n public;\n}\n",
- "2.0.0/utils/Ownable/Ownable.sol": "pragma solidity 0.4.24;\n\nimport \"./IOwnable.sol\";\n\n\ncontract Ownable is\n IOwnable\n{\n address public owner;\n\n constructor ()\n public\n {\n owner = msg.sender;\n }\n\n modifier onlyOwner() {\n require(\n msg.sender == owner,\n \"ONLY_CONTRACT_OWNER\"\n );\n _;\n }\n\n function transferOwnership(address newOwner)\n public\n onlyOwner\n {\n if (newOwner != address(0)) {\n owner = newOwner;\n }\n }\n}\n",
- "2.0.0/utils/ReentrancyGuard/ReentrancyGuard.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract ReentrancyGuard {\n\n // Locked state of mutex\n bool private locked = false;\n\n /// @dev Functions with this modifer cannot be reentered. The mutex will be locked\n /// before function execution and unlocked after.\n modifier nonReentrant() {\n // Ensure mutex is unlocked\n require(\n !locked,\n \"REENTRANCY_ILLEGAL\"\n );\n\n // Lock mutex before function call\n locked = true;\n\n // Perform function call\n _;\n\n // Unlock mutex after function call\n locked = false;\n }\n}\n",
- "2.0.0/utils/SafeMath/SafeMath.sol": "pragma solidity 0.4.24;\n\n\ncontract SafeMath {\n\n function safeMul(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n if (a == 0) {\n return 0;\n }\n uint256 c = a * b;\n require(\n c / a == b,\n \"UINT256_OVERFLOW\"\n );\n return c;\n }\n\n function safeDiv(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n uint256 c = a / b;\n return c;\n }\n\n function safeSub(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n require(\n b <= a,\n \"UINT256_UNDERFLOW\"\n );\n return a - b;\n }\n\n function safeAdd(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n uint256 c = a + b;\n require(\n c >= a,\n \"UINT256_OVERFLOW\"\n );\n return c;\n }\n\n function max64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n\n function max256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n}\n"
- },
- "sourceTreeHashHex": "0xb375308e9f71e2b537b4b9fe7d0dc45c38b7c936468e948958e6aa135dc204c1",
- "compiler": {
- "name": "solc",
- "version": "soljson-v0.4.24+commit.e67f0147.js",
- "settings": {
- "optimizer": {
- "enabled": true,
- "runs": 1000000
- },
- "outputSelection": {
- "*": {
- "*": [
- "abi",
- "evm.bytecode.object",
- "evm.bytecode.sourceMap",
- "evm.deployedBytecode.object",
- "evm.deployedBytecode.sourceMap"
- ]
- }
- }
- }
- },
- "networks": {
- "1": {
- "address": "0x7afc2d5107af94c462a194d2c21b5bdd238709d6",
- "links": {},
- "constructorArgs": "[\"0x4f833a24e1f95d70f028921e27040ca56e09ab0b\",\"0xf47261b0000000000000000000000000e41d2489571d322189246dafa5ebde1f4699f498\",\"0xf47261b0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2\"]"
- },
- "3": {
- "address": "0x3983e204b12b3c02fb0638caf2cd406a62e0ead3",
- "links": {},
- "constructorArgs": "[\"0x4530c0483a1633c7a1c97d2c53721caff2caaaaf\",\"0xf47261b0000000000000000000000000ff67881f8d12f372d91baae9752eb3631ff0ed00\",\"0xf47261b0000000000000000000000000c778417e063141139fce010982780140aa0cd5ab\"]"
- },
- "42": {
- "address": "0xd85e2fa7e7e252b27b01bf0d65c946959d2f45b8",
- "links": {},
- "constructorArgs": "[\"0x35dd2932454449b14cee11a94d3674a936d5d7b2\",\"0xf47261b00000000000000000000000002002d3812f58e35f0ea1ffbf80a75a38c32175fa\",\"0xf47261b0000000000000000000000000d0a1e359811322d97991e03f863a0c30c2cf029c\"]"
- },
- "50": {
- "address": "0xb69e673309512a9d726f87304c6984054f87a93b",
- "links": {},
- "constructorArgs": "[\"0x0b1ba0af832d7c05fd64161e0db78e85978e8082\",\"0xf47261b0000000000000000000000000871dd7c2b4b25e1aa18728e9d5f2af4c4e431f5c\",\"0xf47261b00000000000000000000000000000000000000000000000000000000000000000\"]"
- }
- }
-}
diff --git a/packages/migrations/artifacts/2.0.0/IValidator.json b/packages/migrations/artifacts/2.0.0/IValidator.json
deleted file mode 100644
index 0ccb7b343..000000000
--- a/packages/migrations/artifacts/2.0.0/IValidator.json
+++ /dev/null
@@ -1,320 +0,0 @@
-{
- "schemaVersion": "2.0.0",
- "contractName": "IValidator",
- "compilerOutput": {
- "abi": [
- {
- "constant": true,
- "inputs": [
- {
- "name": "hash",
- "type": "bytes32"
- },
- {
- "name": "signerAddress",
- "type": "address"
- },
- {
- "name": "signature",
- "type": "bytes"
- }
- ],
- "name": "isValidSignature",
- "outputs": [
- {
- "name": "isValid",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- }
- ],
- "evm": {
- "bytecode": {
- "linkReferences": {},
- "object": "0x",
- "opcodes": "",
- "sourceMap": ""
- },
- "deployedBytecode": {
- "linkReferences": {},
- "object": "0x",
- "opcodes": "",
- "sourceMap": ""
- }
- }
- },
- "sources": {
- "2.0.0/extensions/Forwarder/Forwarder.sol": {
- "id": 0
- },
- "2.0.0/extensions/Forwarder/MixinAssets.sol": {
- "id": 1
- },
- "2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol": {
- "id": 2
- },
- "2.0.0/extensions/Forwarder/MixinForwarderCore.sol": {
- "id": 3
- },
- "2.0.0/extensions/Forwarder/MixinWeth.sol": {
- "id": 4
- },
- "2.0.0/extensions/Forwarder/interfaces/IAssets.sol": {
- "id": 5
- },
- "2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol": {
- "id": 6
- },
- "2.0.0/extensions/Forwarder/libs/LibConstants.sol": {
- "id": 7
- },
- "2.0.0/extensions/Forwarder/mixins/MAssets.sol": {
- "id": 8
- },
- "2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol": {
- "id": 9
- },
- "2.0.0/extensions/Forwarder/mixins/MWeth.sol": {
- "id": 10
- },
- "2.0.0/extensions/OrderValidator/OrderValidator.sol": {
- "id": 11
- },
- "2.0.0/protocol/AssetProxy/ERC20Proxy.sol": {
- "id": 12
- },
- "2.0.0/protocol/AssetProxy/ERC721Proxy.sol": {
- "id": 13
- },
- "2.0.0/protocol/AssetProxy/MixinAuthorizable.sol": {
- "id": 14
- },
- "2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol": {
- "id": 15
- },
- "2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol": {
- "id": 16
- },
- "2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol": {
- "id": 17
- },
- "2.0.0/protocol/Exchange/Exchange.sol": {
- "id": 18
- },
- "2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol": {
- "id": 19
- },
- "2.0.0/protocol/Exchange/MixinExchangeCore.sol": {
- "id": 20
- },
- "2.0.0/protocol/Exchange/MixinMatchOrders.sol": {
- "id": 21
- },
- "2.0.0/protocol/Exchange/MixinSignatureValidator.sol": {
- "id": 22
- },
- "2.0.0/protocol/Exchange/MixinTransactions.sol": {
- "id": 23
- },
- "2.0.0/protocol/Exchange/MixinWrapperFunctions.sol": {
- "id": 24
- },
- "2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol": {
- "id": 25
- },
- "2.0.0/protocol/Exchange/interfaces/IExchange.sol": {
- "id": 26
- },
- "2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol": {
- "id": 27
- },
- "2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol": {
- "id": 28
- },
- "2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol": {
- "id": 29
- },
- "2.0.0/protocol/Exchange/interfaces/ITransactions.sol": {
- "id": 30
- },
- "2.0.0/protocol/Exchange/interfaces/IValidator.sol": {
- "id": 31
- },
- "2.0.0/protocol/Exchange/interfaces/IWallet.sol": {
- "id": 32
- },
- "2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol": {
- "id": 33
- },
- "2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol": {
- "id": 34
- },
- "2.0.0/protocol/Exchange/libs/LibConstants.sol": {
- "id": 35
- },
- "2.0.0/protocol/Exchange/libs/LibEIP712.sol": {
- "id": 36
- },
- "2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol": {
- "id": 37
- },
- "2.0.0/protocol/Exchange/libs/LibFillResults.sol": {
- "id": 38
- },
- "2.0.0/protocol/Exchange/libs/LibMath.sol": {
- "id": 39
- },
- "2.0.0/protocol/Exchange/libs/LibOrder.sol": {
- "id": 40
- },
- "2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol": {
- "id": 41
- },
- "2.0.0/protocol/Exchange/mixins/MExchangeCore.sol": {
- "id": 42
- },
- "2.0.0/protocol/Exchange/mixins/MMatchOrders.sol": {
- "id": 43
- },
- "2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol": {
- "id": 44
- },
- "2.0.0/protocol/Exchange/mixins/MTransactions.sol": {
- "id": 45
- },
- "2.0.0/test/DummyERC20Token/DummyERC20Token.sol": {
- "id": 46
- },
- "2.0.0/test/DummyERC721Token/DummyERC721Token.sol": {
- "id": 47
- },
- "2.0.0/tokens/ERC20Token/ERC20Token.sol": {
- "id": 48
- },
- "2.0.0/tokens/ERC20Token/IERC20Token.sol": {
- "id": 49
- },
- "2.0.0/tokens/ERC20Token/MintableERC20Token.sol": {
- "id": 50
- },
- "2.0.0/tokens/ERC20Token/UnlimitedAllowanceERC20Token.sol": {
- "id": 51
- },
- "2.0.0/tokens/ERC721Token/ERC721Token.sol": {
- "id": 52
- },
- "2.0.0/tokens/ERC721Token/IERC721Receiver.sol": {
- "id": 53
- },
- "2.0.0/tokens/ERC721Token/IERC721Token.sol": {
- "id": 54
- },
- "2.0.0/tokens/ERC721Token/MintableERC721Token.sol": {
- "id": 55
- },
- "2.0.0/tokens/EtherToken/IEtherToken.sol": {
- "id": 56
- },
- "2.0.0/utils/LibBytes/LibBytes.sol": {
- "id": 57
- },
- "2.0.0/utils/Ownable/IOwnable.sol": {
- "id": 58
- },
- "2.0.0/utils/Ownable/Ownable.sol": {
- "id": 59
- },
- "2.0.0/utils/SafeMath/SafeMath.sol": {
- "id": 60
- }
- },
- "sourceCodes": {
- "2.0.0/extensions/Forwarder/Forwarder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./MixinWeth.sol\";\nimport \"./MixinForwarderCore.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./MixinAssets.sol\";\nimport \"./MixinExchangeWrapper.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract Forwarder is\n LibConstants,\n MixinWeth,\n MixinAssets,\n MixinExchangeWrapper,\n MixinForwarderCore\n{\n\n constructor (\n address _exchange,\n bytes memory _zrxAssetData,\n bytes memory _wethAssetData\n )\n public\n LibConstants(\n _exchange,\n _zrxAssetData,\n _wethAssetData\n )\n MixinForwarderCore()\n {}\n}\n",
- "2.0.0/extensions/Forwarder/MixinAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"../../tokens/ERC20Token/IERC20Token.sol\";\nimport \"../../tokens/ERC721Token/IERC721Token.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MAssets.sol\";\n\n\ncontract MixinAssets is\n Ownable,\n LibConstants,\n MAssets\n{\n\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_TRANSFER_SELECTOR = bytes4(keccak256(\"transfer(address,uint256)\"));\n\n /// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to \n /// function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be\n /// used to withdraw assets that were accidentally sent to this contract.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of ERC20 token to withdraw.\n function withdrawAsset(\n bytes assetData,\n uint256 amount\n )\n external\n onlyOwner\n {\n transferAssetToSender(assetData, amount);\n }\n\n /// @dev Transfers given amount of asset to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferAssetToSender(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n bytes4 proxyId = assetData.readBytes4(0);\n\n if (proxyId == ERC20_DATA_ID) {\n transferERC20Token(assetData, amount);\n } else if (proxyId == ERC721_DATA_ID) {\n transferERC721Token(assetData, amount);\n } else {\n revert(\"UNSUPPORTED_ASSET_PROXY\");\n }\n }\n\n /// @dev Decodes ERC20 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC20Token(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n address token = assetData.readAddress(16);\n\n // Transfer tokens.\n // We do a raw call so we can check the success separate\n // from the return data.\n bool success = token.call(abi.encodeWithSelector(\n ERC20_TRANSFER_SELECTOR,\n msg.sender,\n amount\n ));\n require(\n success,\n \"TRANSFER_FAILED\"\n );\n \n // Check return data.\n // If there is no return data, we assume the token incorrectly\n // does not return a bool. In this case we expect it to revert\n // on failure, which was handled above.\n // If the token does return data, we require that it is a single\n // value that evaluates to true.\n assembly {\n if returndatasize {\n success := 0\n if eq(returndatasize, 32) {\n // First 64 bytes of memory are reserved scratch space\n returndatacopy(0, 0, 32)\n success := mload(0)\n }\n }\n }\n require(\n success,\n \"TRANSFER_FAILED\"\n );\n }\n\n /// @dev Decodes ERC721 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC721Token(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n require(\n amount == 1,\n \"INVALID_AMOUNT\"\n );\n // Decode asset data.\n address token = assetData.readAddress(16);\n uint256 tokenId = assetData.readUint256(36);\n\n // Perform transfer.\n IERC721Token(token).transferFrom(\n address(this),\n msg.sender,\n tokenId\n );\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MExchangeWrapper.sol\";\nimport \"../../protocol/Exchange/libs/LibAbiEncoder.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../protocol/Exchange/libs/LibFillResults.sol\";\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\n\n\ncontract MixinExchangeWrapper is\n LibAbiEncoder,\n LibFillResults,\n LibMath,\n LibConstants,\n MExchangeWrapper\n{\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n // ABI encode calldata for `fillOrder`\n bytes memory fillOrderCalldata = abiEncodeFillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n\n address exchange = address(EXCHANGE);\n\n // Call `fillOrder` and handle any exceptions gracefully\n assembly {\n let success := call(\n gas, // forward all gas, TODO: look into gas consumption of assert/throw\n exchange, // call address of Exchange contract\n 0, // transfer 0 wei\n add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes)\n mload(fillOrderCalldata), // length of input\n fillOrderCalldata, // write output over input\n 128 // output size is 128 bytes\n )\n switch success\n case 0 {\n mstore(fillResults, 0)\n mstore(add(fillResults, 32), 0)\n mstore(add(fillResults, 64), 0)\n mstore(add(fillResults, 96), 0)\n }\n case 1 {\n mstore(fillResults, mload(fillOrderCalldata))\n mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32)))\n mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64)))\n mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96)))\n }\n }\n return fillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of WETH has been sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param wethSellAmount Desired amount of WETH to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellWeth(\n LibOrder.Order[] memory orders,\n uint256 wethSellAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // We assume that asset being sold by taker is WETH for each order.\n orders[i].makerAssetData = makerAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of WETH to sell\n uint256 remainingTakerAssetFillAmount = safeSub(wethSellAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of WETH\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= wethSellAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// The asset being sold by taker must always be WETH.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyExactAmountWithWeth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // We assume that asset being sold by taker is WETH for each order.\n orders[i].makerAssetData = makerAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmount(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n uint256 makerAssetFilledAmount = totalFillResults.makerAssetFilledAmount;\n if (makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n\n require(\n makerAssetFilledAmount >= makerAssetFillAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return totalFillResults;\n }\n\n /// @dev Buys zrxBuyAmount of ZRX fee tokens, taking into account ZRX fees for each order. This will guarantee\n /// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues).\n /// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX\n /// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases.\n /// The asset being sold by taker must always be WETH. \n /// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset.\n /// @param zrxBuyAmount Desired amount of ZRX to buy.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return totalFillResults Amounts filled and fees paid by maker and taker.\n function marketBuyExactZrxWithWeth(\n LibOrder.Order[] memory orders,\n uint256 zrxBuyAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n // Do nothing if zrxBuyAmount == 0\n if (zrxBuyAmount == 0) {\n return totalFillResults;\n }\n\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n uint256 zrxPurchased = 0;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // All of these are ZRX/WETH, so we can drop the respective assetData from calldata.\n orders[i].makerAssetData = zrxAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of ZRX to buy.\n uint256 remainingZrxBuyAmount = safeSub(zrxBuyAmount, zrxPurchased);\n\n // Convert the remaining amount of ZRX to buy into remaining amount\n // of WETH to sell, assuming entire amount can be sold in the current order.\n uint256 remainingWethSellAmount = getPartialAmount(\n orders[i].takerAssetAmount,\n safeSub(orders[i].makerAssetAmount, orders[i].takerFee), // our exchange rate after fees \n remainingZrxBuyAmount\n );\n\n // Attempt to sell the remaining amount of WETH.\n FillResults memory singleFillResult = fillOrderNoThrow(\n orders[i],\n safeAdd(remainingWethSellAmount, 1), // we add 1 wei to the fill amount to make up for rounding errors\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker.\n addFillResults(totalFillResults, singleFillResult);\n zrxPurchased = safeSub(totalFillResults.makerAssetFilledAmount, totalFillResults.takerFeePaid);\n\n // Stop execution if the entire amount of ZRX has been bought.\n if (zrxPurchased >= zrxBuyAmount) {\n break;\n }\n }\n\n require(\n zrxPurchased >= zrxBuyAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return totalFillResults;\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinForwarderCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MWeth.sol\";\nimport \"./mixins/MAssets.sol\";\nimport \"./mixins/MExchangeWrapper.sol\";\nimport \"./interfaces/IForwarderCore.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../protocol/Exchange/libs/LibFillResults.sol\";\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\n\n\ncontract MixinForwarderCore is\n LibFillResults,\n LibMath,\n LibConstants,\n MWeth,\n MAssets,\n MExchangeWrapper,\n IForwarderCore\n{\n\n using LibBytes for bytes;\n\n /// @dev Constructor approves ERC20 proxy to transfer ZRX and WETH on this contract's behalf.\n constructor ()\n public\n {\n address proxyAddress = EXCHANGE.getAssetProxy(ERC20_DATA_ID);\n if (proxyAddress != address(0)) {\n ETHER_TOKEN.approve(proxyAddress, MAX_UINT);\n ZRX_TOKEN.approve(proxyAddress, MAX_UINT);\n }\n }\n\n /// @dev Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketSellOrdersWithEth(\n LibOrder.Order[] memory orders,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n FillResults memory orderFillResults,\n FillResults memory feeOrderFillResults\n )\n {\n // Convert ETH to WETH.\n convertEthToWeth();\n\n uint256 wethSellAmount;\n uint256 zrxBuyAmount;\n uint256 makerAssetAmountPurchased;\n if (orders[0].makerAssetData.equals(ZRX_ASSET_DATA)) {\n // Calculate amount of WETH that won't be spent on ETH fees.\n wethSellAmount = getPartialAmount(\n PERCENTAGE_DENOMINATOR,\n safeAdd(PERCENTAGE_DENOMINATOR, feePercentage),\n msg.value\n );\n // Market sell available WETH.\n // ZRX fees are paid with this contract's balance.\n orderFillResults = marketSellWeth(\n orders,\n wethSellAmount,\n signatures\n );\n // The fee amount must be deducted from the amount transfered back to sender.\n makerAssetAmountPurchased = safeSub(orderFillResults.makerAssetFilledAmount, orderFillResults.takerFeePaid);\n } else {\n // 5% of WETH is reserved for filling feeOrders and paying feeRecipient.\n wethSellAmount = getPartialAmount(\n MAX_WETH_FILL_PERCENTAGE,\n PERCENTAGE_DENOMINATOR,\n msg.value\n );\n // Market sell 95% of WETH.\n // ZRX fees are payed with this contract's balance.\n orderFillResults = marketSellWeth(\n orders,\n wethSellAmount,\n signatures\n );\n // Buy back all ZRX spent on fees.\n zrxBuyAmount = orderFillResults.takerFeePaid;\n feeOrderFillResults = marketBuyExactZrxWithWeth(\n feeOrders,\n zrxBuyAmount,\n feeSignatures\n );\n makerAssetAmountPurchased = orderFillResults.makerAssetFilledAmount;\n }\n\n // Transfer feePercentage of total ETH spent on primary orders to feeRecipient.\n // Refund remaining ETH to msg.sender.\n transferEthFeeAndRefund(\n orderFillResults.takerAssetFilledAmount,\n feeOrderFillResults.takerAssetFilledAmount,\n feePercentage,\n feeRecipient\n );\n\n // Transfer purchased assets to msg.sender.\n transferAssetToSender(orders[0].makerAssetData, makerAssetAmountPurchased);\n }\n\n /// @dev Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param makerAssetFillAmount Desired amount of makerAsset to purchase.\n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketBuyOrdersWithEth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n FillResults memory orderFillResults,\n FillResults memory feeOrderFillResults\n )\n {\n // Convert ETH to WETH.\n convertEthToWeth();\n\n uint256 zrxBuyAmount;\n uint256 makerAssetAmountPurchased;\n if (orders[0].makerAssetData.equals(ZRX_ASSET_DATA)) {\n // If the makerAsset is ZRX, it is not necessary to pay fees out of this\n // contracts's ZRX balance because fees are factored into the price of the order.\n orderFillResults = marketBuyExactZrxWithWeth(\n orders,\n makerAssetFillAmount,\n signatures\n );\n // The fee amount must be deducted from the amount transfered back to sender.\n makerAssetAmountPurchased = safeSub(orderFillResults.makerAssetFilledAmount, orderFillResults.takerFeePaid);\n } else {\n // Attemp to purchase desired amount of makerAsset.\n // ZRX fees are payed with this contract's balance.\n orderFillResults = marketBuyExactAmountWithWeth(\n orders,\n makerAssetFillAmount,\n signatures\n );\n // Buy back all ZRX spent on fees.\n zrxBuyAmount = orderFillResults.takerFeePaid;\n feeOrderFillResults = marketBuyExactZrxWithWeth(\n feeOrders,\n zrxBuyAmount,\n feeSignatures\n );\n makerAssetAmountPurchased = orderFillResults.makerAssetFilledAmount;\n }\n\n // Transfer feePercentage of total ETH spent on primary orders to feeRecipient.\n // Refund remaining ETH to msg.sender.\n transferEthFeeAndRefund(\n orderFillResults.takerAssetFilledAmount,\n feeOrderFillResults.takerAssetFilledAmount,\n feePercentage,\n feeRecipient\n );\n\n // Transfer purchased assets to msg.sender.\n transferAssetToSender(orders[0].makerAssetData, makerAssetAmountPurchased);\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinWeth.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MWeth.sol\";\n\n\ncontract MixinWeth is\n LibMath,\n LibConstants,\n MWeth\n{\n\n /// @dev Default payabale function, this allows us to withdraw WETH\n function ()\n public\n payable\n {\n require(\n msg.sender == address(ETHER_TOKEN),\n \"DEFAULT_FUNCTION_WETH_CONTRACT_ONLY\"\n );\n }\n\n /// @dev Converts message call's ETH value into WETH.\n function convertEthToWeth()\n internal\n {\n require(\n msg.value > 0,\n \"INVALID_MSG_VALUE\"\n );\n ETHER_TOKEN.deposit.value(msg.value)();\n }\n\n /// @dev Transfers feePercentage of WETH spent on primary orders to feeRecipient.\n /// Refunds any excess ETH to msg.sender.\n /// @param wethSoldExcludingFeeOrders Amount of WETH sold when filling primary orders.\n /// @param wethSoldForZrx Amount of WETH sold when purchasing ZRX required for primary order fees.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n function transferEthFeeAndRefund(\n uint256 wethSoldExcludingFeeOrders,\n uint256 wethSoldForZrx,\n uint256 feePercentage,\n address feeRecipient\n )\n internal\n {\n // Ensure feePercentage is less than 5%.\n require(\n feePercentage <= MAX_FEE_PERCENTAGE,\n \"FEE_PERCENTAGE_TOO_LARGE\"\n );\n\n // Ensure that no extra WETH owned by this contract has been sold.\n uint256 wethSold = safeAdd(wethSoldExcludingFeeOrders, wethSoldForZrx);\n require(\n wethSold <= msg.value,\n \"OVERSOLD_WETH\"\n );\n\n // Calculate amount of WETH that hasn't been sold.\n uint256 wethRemaining = safeSub(msg.value, wethSold);\n\n // Calculate ETH fee to pay to feeRecipient.\n uint256 ethFee = getPartialAmount(\n feePercentage,\n PERCENTAGE_DENOMINATOR,\n wethSoldExcludingFeeOrders\n );\n\n // Ensure fee is less than amount of WETH remaining.\n require(\n ethFee <= wethRemaining,\n \"INSUFFICIENT_ETH_REMAINING\"\n );\n \n // Do nothing if no WETH remaining\n if (wethRemaining > 0) {\n // Convert remaining WETH to ETH\n ETHER_TOKEN.withdraw(wethRemaining);\n\n // Pay ETH to feeRecipient\n if (ethFee > 0) {\n feeRecipient.transfer(ethFee);\n }\n\n // Refund remaining ETH to msg.sender.\n uint256 ethRefund = safeSub(wethRemaining, ethFee);\n if (ethRefund > 0) {\n msg.sender.transfer(ethRefund);\n }\n }\n }\n}\n",
- "2.0.0/extensions/Forwarder/interfaces/IAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IAssets {\n\n /// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to \n /// function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be\n /// used to withdraw assets that were accidentally sent to this contract.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of ERC20 token to withdraw.\n function withdrawAsset(\n bytes assetData,\n uint256 amount\n )\n external;\n}\n",
- "2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../../protocol/Exchange/libs/LibFillResults.sol\";\n\n\ncontract IForwarderCore {\n\n /// @dev Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketSellOrdersWithEth(\n LibOrder.Order[] memory orders,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n LibFillResults.FillResults memory orderFillResults,\n LibFillResults.FillResults memory feeOrderFillResults\n );\n\n /// @dev Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param makerAssetFillAmount Desired amount of makerAsset to purchase.\n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketBuyOrdersWithEth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n LibFillResults.FillResults memory orderFillResults,\n LibFillResults.FillResults memory feeOrderFillResults\n );\n}\n",
- "2.0.0/extensions/Forwarder/libs/LibConstants.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/LibBytes/LibBytes.sol\";\nimport \"../../../protocol/Exchange/interfaces/IExchange.sol\";\nimport \"../../../tokens/EtherToken/IEtherToken.sol\";\nimport \"../../../tokens/ERC20Token/IERC20Token.sol\";\n\n\ncontract LibConstants {\n\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n uint256 constant internal MAX_UINT = 2**256 - 1;\n uint256 constant internal PERCENTAGE_DENOMINATOR = 10**18; \n uint256 constant internal MAX_FEE_PERCENTAGE = 5 * PERCENTAGE_DENOMINATOR / 100; // 5%\n uint256 constant internal MAX_WETH_FILL_PERCENTAGE = 95 * PERCENTAGE_DENOMINATOR / 100; // 95%\n \n // solhint-disable var-name-mixedcase\n IExchange internal EXCHANGE;\n IEtherToken internal ETHER_TOKEN;\n IERC20Token internal ZRX_TOKEN;\n bytes internal ZRX_ASSET_DATA;\n bytes internal WETH_ASSET_DATA;\n // solhint-enable var-name-mixedcase\n\n constructor (\n address _exchange,\n bytes memory _zrxAssetData,\n bytes memory _wethAssetData\n )\n public\n {\n EXCHANGE = IExchange(_exchange);\n ZRX_ASSET_DATA = _zrxAssetData;\n WETH_ASSET_DATA = _wethAssetData;\n\n address etherToken = _wethAssetData.readAddress(16);\n address zrxToken = _zrxAssetData.readAddress(16);\n ETHER_TOKEN = IEtherToken(etherToken);\n ZRX_TOKEN = IERC20Token(zrxToken);\n }\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAssets.sol\";\n\n\ncontract MAssets is\n IAssets\n{\n\n /// @dev Transfers given amount of asset to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferAssetToSender(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n\n /// @dev Decodes ERC20 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC20Token(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n\n /// @dev Decodes ERC721 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC721Token(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../../protocol/Exchange/libs/LibFillResults.sol\";\n\n\ncontract MExchangeWrapper {\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of WETH has been sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param wethSellAmount Desired amount of WETH to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellWeth(\n LibOrder.Order[] memory orders,\n uint256 wethSellAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// The asset being sold by taker must always be WETH.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyExactAmountWithWeth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Buys zrxBuyAmount of ZRX fee tokens, taking into account ZRX fees for each order. This will guarantee\n /// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues).\n /// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX\n /// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases.\n /// The asset being sold by taker must always be WETH. \n /// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset.\n /// @param zrxBuyAmount Desired amount of ZRX to buy.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return totalFillResults Amounts filled and fees paid by maker and taker.\n function marketBuyExactZrxWithWeth(\n LibOrder.Order[] memory orders,\n uint256 zrxBuyAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MWeth.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract MWeth {\n\n /// @dev Converts message call's ETH value into WETH.\n function convertEthToWeth()\n internal;\n\n /// @dev Transfers feePercentage of WETH spent on primary orders to feeRecipient.\n /// Refunds any excess ETH to msg.sender.\n /// @param wethSoldExcludingFeeOrders Amount of WETH sold when filling primary orders.\n /// @param wethSoldForZrx Amount of WETH sold when purchasing ZRX required for primary order fees.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n function transferEthFeeAndRefund(\n uint256 wethSoldExcludingFeeOrders,\n uint256 wethSoldForZrx,\n uint256 feePercentage,\n address feeRecipient\n )\n internal;\n}\n",
- "2.0.0/extensions/OrderValidator/OrderValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../protocol/Exchange/interfaces/IExchange.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../tokens/ERC20Token/IERC20Token.sol\";\nimport \"../../tokens/ERC721Token/IERC721Token.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\n\n\ncontract OrderValidator {\n\n bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n\n using LibBytes for bytes;\n\n struct TraderInfo {\n uint256 makerBalance; // Maker's balance of makerAsset\n uint256 makerAllowance; // Maker's allowance to corresponding AssetProxy\n uint256 takerBalance; // Taker's balance of takerAsset\n uint256 takerAllowance; // Taker's allowance to corresponding AssetProxy\n uint256 makerZrxBalance; // Maker's balance of ZRX\n uint256 makerZrxAllowance; // Maker's allowance of ZRX to ERC20Proxy\n uint256 takerZrxBalance; // Taker's balance of ZRX\n uint256 takerZrxAllowance; // Taker's allowance of ZRX to ERC20Proxy\n }\n\n // solhint-disable var-name-mixedcase\n IExchange internal EXCHANGE;\n bytes internal ZRX_ASSET_DATA;\n // solhint-enable var-name-mixedcase\n\n constructor (address _exchange, bytes memory _zrxAssetData)\n public\n {\n EXCHANGE = IExchange(_exchange);\n ZRX_ASSET_DATA = _zrxAssetData;\n }\n\n /// @dev Fetches information for order and maker/taker of order.\n /// @param order The order structure.\n /// @param takerAddress Address that will be filling the order.\n /// @return OrderInfo and TraderInfo instances for given order.\n function getOrderAndTraderInfo(LibOrder.Order memory order, address takerAddress)\n public\n view\n returns (LibOrder.OrderInfo memory orderInfo, TraderInfo memory traderInfo)\n {\n orderInfo = EXCHANGE.getOrderInfo(order);\n traderInfo = getTraderInfo(order, takerAddress);\n return (orderInfo, traderInfo);\n }\n\n /// @dev Fetches information for all passed in orders and the makers/takers of each order.\n /// @param orders Array of order specifications.\n /// @param takerAddresses Array of taker addresses corresponding to each order.\n /// @return Arrays of OrderInfo and TraderInfo instances that correspond to each order.\n function getOrdersAndTradersInfo(LibOrder.Order[] memory orders, address[] memory takerAddresses)\n public\n view\n returns (LibOrder.OrderInfo[] memory ordersInfo, TraderInfo[] memory tradersInfo)\n {\n ordersInfo = EXCHANGE.getOrdersInfo(orders);\n tradersInfo = getTradersInfo(orders, takerAddresses);\n return (ordersInfo, tradersInfo);\n }\n\n /// @dev Fetches balance and allowances for maker and taker of order.\n /// @param order The order structure.\n /// @param takerAddress Address that will be filling the order.\n /// @return Balances and allowances of maker and taker of order.\n function getTraderInfo(LibOrder.Order memory order, address takerAddress)\n public\n view\n returns (TraderInfo memory traderInfo)\n {\n (traderInfo.makerBalance, traderInfo.makerAllowance) = getBalanceAndAllowance(order.makerAddress, order.makerAssetData);\n (traderInfo.takerBalance, traderInfo.takerAllowance) = getBalanceAndAllowance(takerAddress, order.takerAssetData);\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n (traderInfo.makerZrxBalance, traderInfo.makerZrxAllowance) = getBalanceAndAllowance(order.makerAddress, zrxAssetData);\n (traderInfo.takerZrxBalance, traderInfo.takerZrxAllowance) = getBalanceAndAllowance(takerAddress, zrxAssetData);\n return traderInfo;\n }\n\n /// @dev Fetches balances and allowances of maker and taker for each provided order.\n /// @param orders Array of order specifications.\n /// @param takerAddresses Array of taker addresses corresponding to each order.\n /// @return Array of balances and allowances for maker and taker of each order.\n function getTradersInfo(LibOrder.Order[] memory orders, address[] memory takerAddresses)\n public\n view\n returns (TraderInfo[] memory)\n {\n uint256 ordersLength = orders.length;\n TraderInfo[] memory tradersInfo = new TraderInfo[](ordersLength);\n for (uint256 i = 0; i != ordersLength; i++) {\n tradersInfo[i] = getTraderInfo(orders[i], takerAddresses[i]);\n }\n return tradersInfo;\n }\n\n /// @dev Fetches token balances and allowances of an address to given assetProxy. Supports ERC20 and ERC721.\n /// @param target Address to fetch balances and allowances of.\n /// @param assetData Encoded data that can be decoded by a specified proxy contract when transferring asset.\n /// @return Balance of asset and allowance set to given proxy of asset.\n /// For ERC721 tokens, these values will always be 1 or 0.\n function getBalanceAndAllowance(address target, bytes memory assetData)\n public\n view\n returns (uint256 balance, uint256 allowance)\n {\n bytes4 assetProxyId = assetData.readBytes4(0);\n address token = assetData.readAddress(16);\n address assetProxy = EXCHANGE.getAssetProxy(assetProxyId);\n\n if (assetProxyId == ERC20_DATA_ID) {\n // Query balance\n balance = IERC20Token(token).balanceOf(target);\n\n // Query allowance\n allowance = IERC20Token(token).allowance(target, assetProxy);\n } else if (assetProxyId == ERC721_DATA_ID) {\n uint256 tokenId = assetData.readUint256(36);\n\n // Query owner of tokenId\n address owner = getERC721TokenOwner(token, tokenId);\n\n // Set balance to 1 if tokenId is owned by target\n balance = target == owner ? 1 : 0;\n\n // Check if ERC721Proxy is approved to spend tokenId\n bool isApproved = IERC721Token(token).isApprovedForAll(target, assetProxy) || IERC721Token(token).getApproved(tokenId) == assetProxy;\n \n // Set alowance to 1 if ERC721Proxy is approved to spend tokenId\n allowance = isApproved ? 1 : 0;\n } else {\n revert(\"UNSUPPORTED_ASSET_PROXY\");\n }\n return (balance, allowance);\n }\n\n /// @dev Fetches token balances and allowances of an address for each given assetProxy. Supports ERC20 and ERC721.\n /// @param target Address to fetch balances and allowances of.\n /// @param assetData Array of encoded byte arrays that can be decoded by a specified proxy contract when transferring asset.\n /// @return Balances and allowances of assets.\n /// For ERC721 tokens, these values will always be 1 or 0.\n function getBalancesAndAllowances(address target, bytes[] memory assetData)\n public\n view\n returns (uint256[] memory, uint256[] memory)\n {\n uint256 length = assetData.length;\n uint256[] memory balances = new uint256[](length);\n uint256[] memory allowances = new uint256[](length);\n for (uint256 i = 0; i != length; i++) {\n (balances[i], allowances[i]) = getBalanceAndAllowance(target, assetData[i]);\n }\n return (balances, allowances);\n }\n\n /// @dev Calls `token.ownerOf(tokenId)`, but returns a null owner instead of reverting on an unowned token.\n /// @param token Address of ERC721 token.\n /// @param tokenId The identifier for the specific NFT.\n /// @return Owner of tokenId or null address if unowned.\n function getERC721TokenOwner(address token, uint256 tokenId)\n public\n view\n returns (address owner)\n {\n assembly {\n // load free memory pointer\n let cdStart := mload(64)\n\n // bytes4(keccak256(ownerOf(uint256))) = 0x6352211e\n mstore(cdStart, 0x6352211e00000000000000000000000000000000000000000000000000000000)\n mstore(add(cdStart, 4), tokenId)\n\n // staticcall `ownerOf(tokenId)`\n // `ownerOf` will revert if tokenId is not owned\n let success := staticcall(\n gas, // forward all gas\n token, // call token contract\n cdStart, // start of calldata\n 36, // length of input is 36 bytes\n cdStart, // write output over input\n 32 // size of output is 32 bytes\n )\n\n // Success implies that tokenId is owned\n // Copy owner from return data if successful\n if success {\n owner := mload(cdStart)\n } \n }\n\n // Owner initialized to address(0), no need to modify if call is unsuccessful\n return owner;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/ERC20Proxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"./MixinAuthorizable.sol\";\n\n\ncontract ERC20Proxy is\n MixinAuthorizable\n{\n // Id of this proxy.\n bytes4 constant internal PROXY_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n \n // solhint-disable-next-line payable-fallback\n function () \n external\n {\n assembly {\n // The first 4 bytes of calldata holds the function selector\n let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)\n\n // `transferFrom` will be called with the following parameters:\n // assetData Encoded byte array.\n // from Address to transfer asset from.\n // to Address to transfer asset to.\n // amount Amount of asset to transfer.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {\n\n // To lookup a value in a mapping, we load from the storage location keccak256(k, p),\n // where k is the key left padded to 32 bytes and p is the storage slot\n let start := mload(64)\n mstore(start, and(caller, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(start, 32), authorized_slot)\n\n // Revert if authorized[msg.sender] == false\n if iszero(sload(keccak256(start, 64))) {\n // Revert with `Error(\"SENDER_NOT_AUTHORIZED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n \n /////// Token contract address ///////\n // The token address is found as follows:\n // * It is stored at offset 4 in `assetData` contents.\n // * This is stored at offset 32 from `assetData`.\n // * The offset to `assetData` from Params is stored at offset\n // 4 in calldata.\n // * The offset of Params in calldata is 4.\n // So we read location 4 and add 32 + 4 + 4 to it.\n let token := calldataload(add(calldataload(4), 40))\n \n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFrom` selector.\n // Any trailing data in transferFromSelector will be\n // overwritten in the next `mstore` call.\n mstore(0, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // We copy the fields `from`, `to` and `amount` in bulk\n // from our own calldata to the new calldata.\n calldatacopy(4, 36, 96)\n\n /////// Call `token.transferFrom` using the calldata ///////\n let success := call(\n gas, // forward all gas\n token, // call address of token contract\n 0, // don't send any ETH\n 0, // pointer to start of input\n 100, // length of input\n 0, // write output over input\n 32 // output size should be 32 bytes\n )\n\n /////// Check return data. ///////\n // If there is no return data, we assume the token incorrectly\n // does not return a bool. In this case we expect it to revert\n // on failure, which was handled above.\n // If the token does return data, we require that it is a single\n // nonzero 32 bytes value.\n // So the transfer succeeded if the call succeeded and either\n // returned nothing, or returned a non-zero 32 byte value. \n success := and(success, or(\n iszero(returndatasize),\n and(\n eq(returndatasize, 32),\n gt(mload(0), 0)\n )\n ))\n if success {\n return(0, 0)\n }\n \n // Revert with `Error(\"TRANSFER_FAILED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n }\n }\n\n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4)\n {\n return PROXY_ID;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/ERC721Proxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"./MixinAuthorizable.sol\";\n\n\ncontract ERC721Proxy is\n MixinAuthorizable\n{\n // Id of this proxy.\n bytes4 constant internal PROXY_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n\n // solhint-disable-next-line payable-fallback\n function () \n external\n {\n assembly {\n // The first 4 bytes of calldata holds the function selector\n let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)\n\n // `transferFrom` will be called with the following parameters:\n // assetData Encoded byte array.\n // from Address to transfer asset from.\n // to Address to transfer asset to.\n // amount Amount of asset to transfer.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {\n\n // To lookup a value in a mapping, we load from the storage location keccak256(k, p),\n // where k is the key left padded to 32 bytes and p is the storage slot\n let start := mload(64)\n mstore(start, and(caller, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(start, 32), authorized_slot)\n\n // Revert if authorized[msg.sender] == false\n if iszero(sload(keccak256(start, 64))) {\n // Revert with `Error(\"SENDER_NOT_AUTHORIZED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // `transferFrom`.\n // The function is marked `external`, so no abi decodeding is done for\n // us. Instead, we expect the `calldata` memory to contain the\n // following:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n //\n // (*): offset is computed from start of function parameters, so offset\n // by an additional 4 bytes in the calldata.\n //\n // WARNING: The ABIv2 specification allows additional padding between\n // the Params and Data section. This will result in a larger\n // offset to assetData.\n\n // Asset data itself is encoded as follows:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 2 * 32 | function parameters: |\n // | | 4 | 12 + 20 | 1. token address |\n // | | 36 | | 2. tokenId |\n \n // We construct calldata for the `token.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n // \n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 4 | | 1. from |\n // | | 36 | | 2. to |\n // | | 68 | | 3. tokenId |\n\n // There exists only 1 of each token.\n // require(amount == 1, \"INVALID_AMOUNT\")\n if sub(calldataload(100), 1) {\n // Revert with `Error(\"INVALID_AMOUNT\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000e494e56414c49445f414d4f554e540000000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFrom` selector.\n // Any trailing data in transferFromSelector will be\n // overwritten in the next `mstore` call.\n mstore(0, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // We copy the fields `from` and `to` in bulk\n // from our own calldata to the new calldata.\n calldatacopy(4, 36, 64)\n\n // Copy `tokenId` field from our own calldata to the new calldata.\n let assetDataOffset := calldataload(4)\n calldatacopy(68, add(assetDataOffset, 72), 32)\n\n /////// Call `token.transferFrom` using the calldata ///////\n let token := calldataload(add(assetDataOffset, 40))\n let success := call(\n gas, // forward all gas\n token, // call address of token contract\n 0, // don't send any ETH\n 0, // pointer to start of input\n 100, // length of input\n 0, // write output to null\n 0 // output size is 0 bytes\n )\n if success {\n return(0, 0)\n }\n \n // Revert with `Error(\"TRANSFER_FAILED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n }\n }\n\n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4)\n {\n return PROXY_ID;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/MixinAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"./mixins/MAuthorizable.sol\";\n\n\ncontract MixinAuthorizable is\n Ownable,\n MAuthorizable\n{\n\n /// @dev Only authorized addresses can invoke functions with this modifier.\n modifier onlyAuthorized {\n require(\n authorized[msg.sender],\n \"SENDER_NOT_AUTHORIZED\"\n );\n _;\n }\n\n mapping (address => bool) public authorized;\n address[] public authorities;\n\n /// @dev Authorizes an address.\n /// @param target Address to authorize.\n function addAuthorizedAddress(address target)\n external\n onlyOwner\n {\n require(\n !authorized[target],\n \"TARGET_ALREADY_AUTHORIZED\"\n );\n\n authorized[target] = true;\n authorities.push(target);\n emit AuthorizedAddressAdded(target, msg.sender);\n }\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n function removeAuthorizedAddress(address target)\n external\n onlyOwner\n {\n require(\n authorized[target],\n \"TARGET_NOT_AUTHORIZED\"\n );\n\n delete authorized[target];\n for (uint256 i = 0; i < authorities.length; i++) {\n if (authorities[i] == target) {\n authorities[i] = authorities[authorities.length - 1];\n authorities.length -= 1;\n break;\n }\n }\n emit AuthorizedAddressRemoved(target, msg.sender);\n }\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n /// @param index Index of target in authorities array.\n function removeAuthorizedAddressAtIndex(\n address target,\n uint256 index\n )\n external\n onlyOwner\n {\n require(\n authorized[target],\n \"TARGET_NOT_AUTHORIZED\"\n );\n require(\n index < authorities.length,\n \"INDEX_OUT_OF_BOUNDS\"\n );\n require(\n authorities[index] == target,\n \"AUTHORIZED_ADDRESS_MISMATCH\"\n );\n\n delete authorized[target];\n authorities[index] = authorities[authorities.length - 1];\n authorities.length -= 1;\n emit AuthorizedAddressRemoved(target, msg.sender);\n }\n\n /// @dev Gets all authorized addresses.\n /// @return Array of authorized addresses.\n function getAuthorizedAddresses()\n external\n view\n returns (address[] memory)\n {\n return authorities;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IAuthorizable.sol\";\n\n\ncontract IAssetProxy is\n IAuthorizable\n{\n\n /// @dev Transfers assets. Either succeeds or throws.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param from Address to transfer asset from.\n /// @param to Address to transfer asset to.\n /// @param amount Amount of asset to transfer.\n function transferFrom(\n bytes assetData,\n address from,\n address to,\n uint256 amount\n )\n external;\n \n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4);\n}\n",
- "2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/Ownable/IOwnable.sol\";\n\n\ncontract IAuthorizable is\n IOwnable\n{\n\n /// @dev Authorizes an address.\n /// @param target Address to authorize.\n function addAuthorizedAddress(address target)\n external;\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n function removeAuthorizedAddress(address target)\n external;\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n /// @param index Index of target in authorities array.\n function removeAuthorizedAddressAtIndex(\n address target,\n uint256 index\n )\n external;\n \n /// @dev Gets all authorized addresses.\n /// @return Array of authorized addresses.\n function getAuthorizedAddresses()\n external\n view\n returns (address[] memory);\n}\n",
- "2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAuthorizable.sol\";\n\n\ncontract MAuthorizable is\n IAuthorizable\n{\n\n // Event logged when a new address is authorized.\n event AuthorizedAddressAdded(\n address indexed target,\n address indexed caller\n );\n\n // Event logged when a currently authorized address is unauthorized.\n event AuthorizedAddressRemoved(\n address indexed target,\n address indexed caller\n );\n\n /// @dev Only authorized addresses can invoke functions with this modifier.\n modifier onlyAuthorized { revert(); _; }\n}\n",
- "2.0.0/protocol/Exchange/Exchange.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./MixinExchangeCore.sol\";\nimport \"./MixinSignatureValidator.sol\";\nimport \"./MixinWrapperFunctions.sol\";\nimport \"./MixinAssetProxyDispatcher.sol\";\nimport \"./MixinTransactions.sol\";\nimport \"./MixinMatchOrders.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract Exchange is\n MixinExchangeCore,\n MixinMatchOrders,\n MixinSignatureValidator,\n MixinTransactions,\n MixinAssetProxyDispatcher,\n MixinWrapperFunctions\n{\n\n string constant public VERSION = \"2.0.1-alpha\";\n\n // Mixins are instantiated in the order they are inherited\n constructor (bytes memory _zrxAssetData)\n public\n LibConstants(_zrxAssetData) // @TODO: Remove when we deploy.\n MixinExchangeCore()\n MixinMatchOrders()\n MixinSignatureValidator()\n MixinTransactions()\n MixinAssetProxyDispatcher()\n MixinWrapperFunctions()\n {}\n}\n",
- "2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\nimport \"../AssetProxy/interfaces/IAssetProxy.sol\";\n\n\ncontract MixinAssetProxyDispatcher is\n Ownable,\n MAssetProxyDispatcher\n{\n using LibBytes for bytes;\n \n // Mapping from Asset Proxy Id's to their respective Asset Proxy\n mapping (bytes4 => IAssetProxy) public assetProxies;\n\n /// @dev Registers an asset proxy to its asset proxy id.\n /// Once an asset proxy is registered, it cannot be unregistered.\n /// @param assetProxy Address of new asset proxy to register.\n function registerAssetProxy(address assetProxy)\n external\n onlyOwner\n {\n IAssetProxy assetProxyContract = IAssetProxy(assetProxy);\n\n // Ensure that no asset proxy exists with current id.\n bytes4 assetProxyId = assetProxyContract.getProxyId();\n address currentAssetProxy = assetProxies[assetProxyId];\n require(\n currentAssetProxy == address(0),\n \"ASSET_PROXY_ALREADY_EXISTS\"\n );\n\n // Add asset proxy and log registration.\n assetProxies[assetProxyId] = assetProxyContract;\n emit AssetProxyRegistered(\n assetProxyId,\n assetProxy\n );\n }\n\n /// @dev Gets an asset proxy.\n /// @param assetProxyId Id of the asset proxy.\n /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered.\n function getAssetProxy(bytes4 assetProxyId)\n external\n view\n returns (address)\n {\n return assetProxies[assetProxyId];\n }\n\n /// @dev Forwards arguments to assetProxy and calls `transferFrom`. Either succeeds or throws.\n /// @param assetData Byte array encoded for the asset.\n /// @param from Address to transfer token from.\n /// @param to Address to transfer token to.\n /// @param amount Amount of token to transfer.\n function dispatchTransferFrom(\n bytes memory assetData,\n address from,\n address to,\n uint256 amount\n )\n internal\n {\n // Do nothing if no amount should be transferred.\n if (amount > 0) {\n // Ensure assetData length is valid\n require(\n assetData.length > 3,\n \"LENGTH_GREATER_THAN_3_REQUIRED\"\n );\n \n // Lookup assetProxy\n bytes4 assetProxyId;\n assembly {\n assetProxyId := and(mload(\n add(assetData, 32)),\n 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000\n )\n }\n address assetProxy = assetProxies[assetProxyId];\n\n // Ensure that assetProxy exists\n require(\n assetProxy != address(0),\n \"ASSET_PROXY_DOES_NOT_EXIST\"\n );\n \n // We construct calldata for the `assetProxy.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n // \n // | Area | Offset | Length | Contents |\n // | -------- |--------|---------|-------------------------------------------- |\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n\n assembly {\n /////// Setup State ///////\n // `cdStart` is the start of the calldata for `assetProxy.transferFrom` (equal to free memory ptr).\n let cdStart := mload(64)\n // `dataAreaLength` is the total number of words needed to store `assetData`\n // As-per the ABI spec, this value is padded up to the nearest multiple of 32,\n // and includes 32-bytes for length.\n let dataAreaLength := and(add(mload(assetData), 63), 0xFFFFFFFFFFFE0)\n // `cdEnd` is the end of the calldata for `assetProxy.transferFrom`.\n let cdEnd := add(cdStart, add(132, dataAreaLength))\n\n \n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFromSelector`.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n mstore(cdStart, 0xa85e59e400000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // Each parameter is padded to 32-bytes. The entire Params Area is 128 bytes.\n // Notes:\n // 1. The offset to `assetData` is the length of the Params Area (128 bytes).\n // 2. A 20-byte mask is applied to addresses to zero-out the unused bytes.\n mstore(add(cdStart, 4), 128)\n mstore(add(cdStart, 36), and(from, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(cdStart, 68), and(to, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(cdStart, 100), amount)\n \n /////// Setup Data Area ///////\n // This area holds `assetData`.\n let dataArea := add(cdStart, 132)\n // solhint-disable-next-line no-empty-blocks\n for {} lt(dataArea, cdEnd) {} {\n mstore(dataArea, mload(assetData))\n dataArea := add(dataArea, 32)\n assetData := add(assetData, 32)\n }\n\n /////// Call `assetProxy.transferFrom` using the constructed calldata ///////\n let success := call(\n gas, // forward all gas\n assetProxy, // call address of asset proxy\n 0, // don't send any ETH\n cdStart, // pointer to start of input\n sub(cdEnd, cdStart), // length of input \n cdStart, // write output over input\n 512 // reserve 512 bytes for output\n )\n if iszero(success) {\n revert(cdStart, returndatasize())\n }\n }\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\n\n\ncontract MixinExchangeCore is\n LibConstants,\n LibMath,\n LibOrder,\n LibFillResults,\n MAssetProxyDispatcher,\n MExchangeCore,\n MSignatureValidator,\n MTransactions\n{\n // Mapping of orderHash => amount of takerAsset already bought by maker\n mapping (bytes32 => uint256) public filled;\n\n // Mapping of orderHash => cancelled\n mapping (bytes32 => bool) public cancelled;\n\n // Mapping of makerAddress => senderAddress => lowest salt an order can have in order to be fillable\n // Orders with specified senderAddress and with a salt less than their epoch are considered cancelled\n mapping (address => mapping (address => uint256)) public orderEpoch;\n\n /// @dev Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch\n /// and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress).\n /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled.\n function cancelOrdersUpTo(uint256 targetOrderEpoch)\n external\n {\n address makerAddress = getCurrentContextAddress();\n // If this function is called via `executeTransaction`, we only update the orderEpoch for the makerAddress/msg.sender combination.\n // This allows external filter contracts to add rules to how orders are cancelled via this function.\n address senderAddress = makerAddress == msg.sender ? address(0) : msg.sender;\n\n // orderEpoch is initialized to 0, so to cancelUpTo we need salt + 1\n uint256 newOrderEpoch = targetOrderEpoch + 1; \n uint256 oldOrderEpoch = orderEpoch[makerAddress][senderAddress];\n\n // Ensure orderEpoch is monotonically increasing\n require(\n newOrderEpoch > oldOrderEpoch, \n \"INVALID_NEW_ORDER_EPOCH\"\n );\n\n // Update orderEpoch\n orderEpoch[makerAddress][senderAddress] = newOrderEpoch;\n emit CancelUpTo(makerAddress, senderAddress, newOrderEpoch);\n }\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrder(\n Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (FillResults memory fillResults)\n {\n // Fetch order info\n OrderInfo memory orderInfo = getOrderInfo(order);\n\n // Fetch taker address\n address takerAddress = getCurrentContextAddress();\n\n // Get amount of takerAsset to fill\n uint256 remainingTakerAssetAmount = safeSub(order.takerAssetAmount, orderInfo.orderTakerAssetFilledAmount);\n uint256 takerAssetFilledAmount = min256(takerAssetFillAmount, remainingTakerAssetAmount);\n\n // Validate context\n assertValidFill(\n order,\n orderInfo,\n takerAddress,\n takerAssetFillAmount,\n takerAssetFilledAmount,\n signature\n );\n\n // Compute proportional fill amounts\n fillResults = calculateFillResults(order, takerAssetFilledAmount);\n\n // Update exchange internal state\n updateFilledState(\n order,\n takerAddress,\n orderInfo.orderHash,\n orderInfo.orderTakerAssetFilledAmount,\n fillResults\n );\n \n // Settle order\n settleOrder(order, takerAddress, fillResults);\n\n return fillResults;\n }\n\n /// @dev After calling, the order can not be filled anymore.\n /// Throws if order is invalid or sender does not have permission to cancel.\n /// @param order Order to cancel. Order must be OrderStatus.FILLABLE.\n function cancelOrder(Order memory order)\n public\n {\n // Fetch current order status\n OrderInfo memory orderInfo = getOrderInfo(order);\n\n // Validate context\n assertValidCancel(order, orderInfo);\n\n // Perform cancel\n updateCancelledState(order, orderInfo.orderHash);\n }\n\n /// @dev Gets information about an order: status, hash, and amount filled.\n /// @param order Order to gather information on.\n /// @return OrderInfo Information about the order and its state.\n /// See LibOrder.OrderInfo for a complete description.\n function getOrderInfo(Order memory order)\n public\n view\n returns (OrderInfo memory orderInfo)\n {\n // Compute the order hash\n orderInfo.orderHash = getOrderHash(order);\n\n // Fetch filled amount\n orderInfo.orderTakerAssetFilledAmount = filled[orderInfo.orderHash];\n\n // If order.makerAssetAmount is zero, we also reject the order.\n // While the Exchange contract handles them correctly, they create\n // edge cases in the supporting infrastructure because they have\n // an 'infinite' price when computed by a simple division.\n if (order.makerAssetAmount == 0) {\n orderInfo.orderStatus = uint8(OrderStatus.INVALID_MAKER_ASSET_AMOUNT);\n return orderInfo;\n }\n\n // If order.takerAssetAmount is zero, then the order will always\n // be considered filled because 0 == takerAssetAmount == orderTakerAssetFilledAmount\n // Instead of distinguishing between unfilled and filled zero taker\n // amount orders, we choose not to support them.\n if (order.takerAssetAmount == 0) {\n orderInfo.orderStatus = uint8(OrderStatus.INVALID_TAKER_ASSET_AMOUNT);\n return orderInfo;\n }\n\n // Validate order availability\n if (orderInfo.orderTakerAssetFilledAmount >= order.takerAssetAmount) {\n orderInfo.orderStatus = uint8(OrderStatus.FULLY_FILLED);\n return orderInfo;\n }\n\n // Validate order expiration\n // solhint-disable-next-line not-rely-on-time\n if (block.timestamp >= order.expirationTimeSeconds) {\n orderInfo.orderStatus = uint8(OrderStatus.EXPIRED);\n return orderInfo;\n }\n\n // Check if order has been cancelled\n if (cancelled[orderInfo.orderHash]) {\n orderInfo.orderStatus = uint8(OrderStatus.CANCELLED);\n return orderInfo;\n }\n if (orderEpoch[order.makerAddress][order.senderAddress] > order.salt) {\n orderInfo.orderStatus = uint8(OrderStatus.CANCELLED);\n return orderInfo;\n }\n\n // All other statuses are ruled out: order is Fillable\n orderInfo.orderStatus = uint8(OrderStatus.FILLABLE);\n return orderInfo;\n }\n\n /// @dev Updates state with results of a fill order.\n /// @param order that was filled.\n /// @param takerAddress Address of taker who filled the order.\n /// @param orderTakerAssetFilledAmount Amount of order already filled.\n function updateFilledState(\n Order memory order,\n address takerAddress,\n bytes32 orderHash,\n uint256 orderTakerAssetFilledAmount,\n FillResults memory fillResults\n )\n internal\n {\n // Update state\n filled[orderHash] = safeAdd(orderTakerAssetFilledAmount, fillResults.takerAssetFilledAmount);\n\n // Log order\n emit Fill(\n order.makerAddress,\n order.feeRecipientAddress,\n takerAddress,\n msg.sender,\n fillResults.makerAssetFilledAmount,\n fillResults.takerAssetFilledAmount,\n fillResults.makerFeePaid,\n fillResults.takerFeePaid,\n orderHash,\n order.makerAssetData,\n order.takerAssetData\n );\n }\n\n /// @dev Updates state with results of cancelling an order.\n /// State is only updated if the order is currently fillable.\n /// Otherwise, updating state would have no effect.\n /// @param order that was cancelled.\n /// @param orderHash Hash of order that was cancelled.\n function updateCancelledState(\n Order memory order,\n bytes32 orderHash\n )\n internal\n {\n // Perform cancel\n cancelled[orderHash] = true;\n\n // Log cancel\n emit Cancel(\n order.makerAddress,\n order.feeRecipientAddress,\n msg.sender,\n orderHash,\n order.makerAssetData,\n order.takerAssetData\n );\n }\n\n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAddress Address of order taker.\n /// @param takerAssetFillAmount Desired amount of order to fill by taker.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @param signature Proof that the orders was created by its maker.\n function assertValidFill(\n Order memory order,\n OrderInfo memory orderInfo,\n address takerAddress,\n uint256 takerAssetFillAmount,\n uint256 takerAssetFilledAmount,\n bytes memory signature\n )\n internal\n view\n {\n // An order can only be filled if its status is FILLABLE.\n require(\n orderInfo.orderStatus == uint8(OrderStatus.FILLABLE),\n \"ORDER_UNFILLABLE\"\n );\n\n // Revert if fill amount is invalid\n require(\n takerAssetFillAmount != 0,\n \"INVALID_TAKER_AMOUNT\"\n );\n\n // Validate sender is allowed to fill this order\n if (order.senderAddress != address(0)) {\n require(\n order.senderAddress == msg.sender,\n \"INVALID_SENDER\"\n );\n }\n\n // Validate taker is allowed to fill this order\n if (order.takerAddress != address(0)) {\n require(\n order.takerAddress == takerAddress,\n \"INVALID_TAKER\"\n );\n }\n\n // Validate Maker signature (check only if first time seen)\n if (orderInfo.orderTakerAssetFilledAmount == 0) {\n require(\n isValidSignature(\n orderInfo.orderHash,\n order.makerAddress,\n signature\n ),\n \"INVALID_ORDER_SIGNATURE\"\n );\n }\n\n // Validate fill order rounding\n require(\n !isRoundingError(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.makerAssetAmount\n ),\n \"ROUNDING_ERROR\"\n );\n }\n\n /// @dev Validates context for cancelOrder. Succeeds or throws.\n /// @param order to be cancelled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n function assertValidCancel(\n Order memory order,\n OrderInfo memory orderInfo\n )\n internal\n view\n {\n // Ensure order is valid\n // An order can only be cancelled if its status is FILLABLE.\n require(\n orderInfo.orderStatus == uint8(OrderStatus.FILLABLE),\n \"ORDER_UNFILLABLE\"\n );\n\n // Validate sender is allowed to cancel this order\n if (order.senderAddress != address(0)) {\n require(\n order.senderAddress == msg.sender,\n \"INVALID_SENDER\"\n );\n }\n\n // Validate transaction signed by maker\n address makerAddress = getCurrentContextAddress();\n require(\n order.makerAddress == makerAddress,\n \"INVALID_MAKER\"\n );\n }\n\n /// @dev Calculates amounts filled and fees paid by maker and taker.\n /// @param order to be filled.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function calculateFillResults(\n Order memory order,\n uint256 takerAssetFilledAmount\n )\n internal\n pure\n returns (FillResults memory fillResults)\n {\n // Compute proportional transfer amounts\n fillResults.takerAssetFilledAmount = takerAssetFilledAmount;\n fillResults.makerAssetFilledAmount = getPartialAmount(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.makerAssetAmount\n );\n fillResults.makerFeePaid = getPartialAmount(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.makerFee\n );\n fillResults.takerFeePaid = getPartialAmount(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.takerFee\n );\n\n return fillResults;\n }\n\n /// @dev Settles an order by transferring assets between counterparties.\n /// @param order Order struct containing order specifications.\n /// @param takerAddress Address selling takerAsset and buying makerAsset.\n /// @param fillResults Amounts to be filled and fees paid by maker and taker.\n function settleOrder(\n LibOrder.Order memory order,\n address takerAddress,\n LibFillResults.FillResults memory fillResults\n )\n private\n {\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n dispatchTransferFrom(\n order.makerAssetData,\n order.makerAddress,\n takerAddress,\n fillResults.makerAssetFilledAmount\n );\n dispatchTransferFrom(\n order.takerAssetData,\n takerAddress,\n order.makerAddress,\n fillResults.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n zrxAssetData,\n order.makerAddress,\n order.feeRecipientAddress,\n fillResults.makerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n order.feeRecipientAddress,\n fillResults.takerFeePaid\n );\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinMatchOrders.sol": "/*\n Copyright 2018 ZeroEx Intl.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n http://www.apache.org/licenses/LICENSE-2.0\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MMatchOrders.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\n\n\ncontract MixinMatchOrders is\n LibConstants,\n LibMath,\n MAssetProxyDispatcher,\n MExchangeCore,\n MMatchOrders,\n MTransactions\n{\n /// @dev Match two complementary orders that have a profitable spread.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the left order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftSignature Proof that order was created by the left maker.\n /// @param rightSignature Proof that order was created by the right maker.\n /// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.\n function matchOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n bytes memory leftSignature,\n bytes memory rightSignature\n )\n public\n returns (LibFillResults.MatchedFillResults memory matchedFillResults)\n {\n // We assume that rightOrder.takerAssetData == leftOrder.makerAssetData and rightOrder.makerAssetData == leftOrder.takerAssetData.\n // If this assumption isn't true, the match will fail at signature validation.\n rightOrder.makerAssetData = leftOrder.takerAssetData;\n rightOrder.takerAssetData = leftOrder.makerAssetData;\n\n // Get left & right order info\n LibOrder.OrderInfo memory leftOrderInfo = getOrderInfo(leftOrder);\n LibOrder.OrderInfo memory rightOrderInfo = getOrderInfo(rightOrder);\n\n // Fetch taker address\n address takerAddress = getCurrentContextAddress();\n\n // Either our context is valid or we revert\n assertValidMatch(leftOrder, rightOrder);\n\n // Compute proportional fill amounts\n matchedFillResults = calculateMatchedFillResults(\n leftOrder,\n rightOrder,\n leftOrderInfo.orderTakerAssetFilledAmount,\n rightOrderInfo.orderTakerAssetFilledAmount\n );\n\n // Validate fill contexts\n assertValidFill(\n leftOrder,\n leftOrderInfo,\n takerAddress,\n matchedFillResults.left.takerAssetFilledAmount,\n matchedFillResults.left.takerAssetFilledAmount,\n leftSignature\n );\n assertValidFill(\n rightOrder,\n rightOrderInfo,\n takerAddress,\n matchedFillResults.right.takerAssetFilledAmount,\n matchedFillResults.right.takerAssetFilledAmount,\n rightSignature\n );\n\n // Update exchange state\n updateFilledState(\n leftOrder,\n takerAddress,\n leftOrderInfo.orderHash,\n leftOrderInfo.orderTakerAssetFilledAmount,\n matchedFillResults.left\n );\n updateFilledState(\n rightOrder,\n takerAddress,\n rightOrderInfo.orderHash,\n rightOrderInfo.orderTakerAssetFilledAmount,\n matchedFillResults.right\n );\n \n // Settle matched orders. Succeeds or throws.\n settleMatchedOrders(\n leftOrder,\n rightOrder,\n takerAddress,\n matchedFillResults\n );\n\n return matchedFillResults;\n }\n\n /// @dev Validates context for matchOrders. Succeeds or throws.\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n function assertValidMatch(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder\n )\n internal\n pure\n {\n // Make sure there is a profitable spread.\n // There is a profitable spread iff the cost per unit bought (OrderA.MakerAmount/OrderA.TakerAmount) for each order is greater\n // than the profit per unit sold of the matched order (OrderB.TakerAmount/OrderB.MakerAmount).\n // This is satisfied by the equations below:\n // <leftOrder.makerAssetAmount> / <leftOrder.takerAssetAmount> >= <rightOrder.takerAssetAmount> / <rightOrder.makerAssetAmount>\n // AND\n // <rightOrder.makerAssetAmount> / <rightOrder.takerAssetAmount> >= <leftOrder.takerAssetAmount> / <leftOrder.makerAssetAmount>\n // These equations can be combined to get the following:\n require(\n safeMul(leftOrder.makerAssetAmount, rightOrder.makerAssetAmount) >=\n safeMul(leftOrder.takerAssetAmount, rightOrder.takerAssetAmount),\n \"NEGATIVE_SPREAD_REQUIRED\"\n );\n }\n\n /// @dev Calculates fill amounts for the matched orders.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the leftOrder order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftOrderTakerAssetFilledAmount Amount of left order already filled.\n /// @param rightOrderTakerAssetFilledAmount Amount of right order already filled.\n /// @param matchedFillResults Amounts to fill and fees to pay by maker and taker of matched orders.\n function calculateMatchedFillResults(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n uint256 leftOrderTakerAssetFilledAmount,\n uint256 rightOrderTakerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.MatchedFillResults memory matchedFillResults)\n {\n // We settle orders at the exchange rate of the right order.\n // The amount saved by the left maker goes to the taker.\n // Either the left or right order will be fully filled; possibly both.\n // The left order is fully filled iff the right order can sell more than left can buy.\n // That is: the amount required to fill the left order is less than or equal to\n // the amount we can spend from the right order:\n // <leftTakerAssetAmountRemaining> <= <rightTakerAssetAmountRemaining> * <rightMakerToTakerRatio>\n // <leftTakerAssetAmountRemaining> <= <rightTakerAssetAmountRemaining> * <rightOrder.makerAssetAmount> / <rightOrder.takerAssetAmount>\n // <leftTakerAssetAmountRemaining> * <rightOrder.takerAssetAmount> <= <rightTakerAssetAmountRemaining> * <rightOrder.makerAssetAmount>\n uint256 leftTakerAssetAmountRemaining = safeSub(leftOrder.takerAssetAmount, leftOrderTakerAssetFilledAmount);\n uint256 rightTakerAssetAmountRemaining = safeSub(rightOrder.takerAssetAmount, rightOrderTakerAssetFilledAmount);\n uint256 leftTakerAssetFilledAmount;\n uint256 rightTakerAssetFilledAmount;\n if (\n safeMul(leftTakerAssetAmountRemaining, rightOrder.takerAssetAmount) <=\n safeMul(rightTakerAssetAmountRemaining, rightOrder.makerAssetAmount)\n ) {\n // Left order will be fully filled: maximally fill left\n leftTakerAssetFilledAmount = leftTakerAssetAmountRemaining;\n\n // The right order receives an amount proportional to how much was spent.\n rightTakerAssetFilledAmount = getPartialAmount(\n rightOrder.takerAssetAmount,\n rightOrder.makerAssetAmount,\n leftTakerAssetFilledAmount\n );\n } else {\n // Right order will be fully filled: maximally fill right\n rightTakerAssetFilledAmount = rightTakerAssetAmountRemaining;\n\n // The left order receives an amount proportional to how much was spent.\n leftTakerAssetFilledAmount = getPartialAmount(\n rightOrder.makerAssetAmount,\n rightOrder.takerAssetAmount,\n rightTakerAssetFilledAmount\n );\n }\n\n // Calculate fill results for left order\n matchedFillResults.left = calculateFillResults(\n leftOrder,\n leftTakerAssetFilledAmount\n );\n\n // Calculate fill results for right order\n matchedFillResults.right = calculateFillResults(\n rightOrder,\n rightTakerAssetFilledAmount\n );\n\n // Calculate amount given to taker\n matchedFillResults.leftMakerAssetSpreadAmount = safeSub(\n matchedFillResults.left.makerAssetFilledAmount,\n matchedFillResults.right.takerAssetFilledAmount\n );\n\n // Return fill results\n return matchedFillResults;\n }\n\n /// @dev Settles matched order by transferring appropriate funds between order makers, taker, and fee recipient.\n /// @param leftOrder First matched order.\n /// @param rightOrder Second matched order.\n /// @param takerAddress Address that matched the orders. The taker receives the spread between orders as profit.\n /// @param matchedFillResults Struct holding amounts to transfer between makers, taker, and fee recipients.\n function settleMatchedOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n address takerAddress,\n LibFillResults.MatchedFillResults memory matchedFillResults\n )\n private\n {\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n // Order makers and taker\n dispatchTransferFrom(\n leftOrder.makerAssetData,\n leftOrder.makerAddress,\n rightOrder.makerAddress,\n matchedFillResults.right.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n rightOrder.makerAssetData,\n rightOrder.makerAddress,\n leftOrder.makerAddress,\n matchedFillResults.left.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n leftOrder.makerAssetData,\n leftOrder.makerAddress,\n takerAddress,\n matchedFillResults.leftMakerAssetSpreadAmount\n );\n\n // Maker fees\n dispatchTransferFrom(\n zrxAssetData,\n leftOrder.makerAddress,\n leftOrder.feeRecipientAddress,\n matchedFillResults.left.makerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n rightOrder.makerAddress,\n rightOrder.feeRecipientAddress,\n matchedFillResults.right.makerFeePaid\n );\n\n // Taker fees\n if (leftOrder.feeRecipientAddress == rightOrder.feeRecipientAddress) {\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n leftOrder.feeRecipientAddress,\n safeAdd(\n matchedFillResults.left.takerFeePaid,\n matchedFillResults.right.takerFeePaid\n )\n );\n } else {\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n leftOrder.feeRecipientAddress,\n matchedFillResults.left.takerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n rightOrder.feeRecipientAddress,\n matchedFillResults.right.takerFeePaid\n );\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinSignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./interfaces/IWallet.sol\";\nimport \"./interfaces/IValidator.sol\";\n\n\ncontract MixinSignatureValidator is\n MSignatureValidator,\n MTransactions\n{\n using LibBytes for bytes;\n \n // Mapping of hash => signer => signed\n mapping (bytes32 => mapping (address => bool)) public preSigned;\n\n // Mapping of signer => validator => approved\n mapping (address => mapping (address => bool)) public allowedValidators;\n\n /// @dev Approves a hash on-chain using any valid signature type.\n /// After presigning a hash, the preSign signature type will become valid for that hash and signer.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n function preSign(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external\n {\n require(\n isValidSignature(\n hash,\n signerAddress,\n signature\n ),\n \"INVALID_SIGNATURE\"\n );\n preSigned[hash][signerAddress] = true;\n }\n\n /// @dev Approves/unnapproves a Validator contract to verify signatures on signer's behalf.\n /// @param validatorAddress Address of Validator contract.\n /// @param approval Approval or disapproval of Validator contract.\n function setSignatureValidatorApproval(\n address validatorAddress,\n bool approval\n )\n external\n {\n address signerAddress = getCurrentContextAddress();\n allowedValidators[signerAddress][validatorAddress] = approval;\n emit SignatureValidatorApproval(\n signerAddress,\n validatorAddress,\n approval\n );\n }\n\n /// @dev Verifies that a hash has been signed by the given signer.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes memory signature\n )\n public\n view\n returns (bool isValid)\n {\n require(\n signature.length > 0,\n \"LENGTH_GREATER_THAN_0_REQUIRED\"\n );\n\n // Pop last byte off of signature byte array.\n uint8 signatureTypeRaw = uint8(signature.popLastByte());\n\n // Ensure signature is supported\n require(\n signatureTypeRaw < uint8(SignatureType.NSignatureTypes),\n \"SIGNATURE_UNSUPPORTED\"\n );\n\n SignatureType signatureType = SignatureType(signatureTypeRaw);\n\n // Variables are not scoped in Solidity.\n uint8 v;\n bytes32 r;\n bytes32 s;\n address recovered;\n\n // Always illegal signature.\n // This is always an implicit option since a signer can create a\n // signature array with invalid type or length. We may as well make\n // it an explicit option. This aids testing and analysis. It is\n // also the initialization value for the enum type.\n if (signatureType == SignatureType.Illegal) {\n revert(\"SIGNATURE_ILLEGAL\");\n\n // Always invalid signature.\n // Like Illegal, this is always implicitly available and therefore\n // offered explicitly. It can be implicitly created by providing\n // a correctly formatted but incorrect signature.\n } else if (signatureType == SignatureType.Invalid) {\n require(\n signature.length == 0,\n \"LENGTH_0_REQUIRED\"\n );\n isValid = false;\n return isValid;\n\n // Signature using EIP712\n } else if (signatureType == SignatureType.EIP712) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n hash,\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n\n // Signed using web3.eth_sign\n } else if (signatureType == SignatureType.EthSign) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n keccak256(abi.encodePacked(\n \"\\x19Ethereum Signed Message:\\n32\",\n hash\n )),\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n\n // Implicitly signed by caller.\n // The signer has initiated the call. In the case of non-contract\n // accounts it means the transaction itself was signed.\n // Example: let's say for a particular operation three signatures\n // A, B and C are required. To submit the transaction, A and B can\n // give a signature to C, who can then submit the transaction using\n // `Caller` for his own signature. Or A and C can sign and B can\n // submit using `Caller`. Having `Caller` allows this flexibility.\n } else if (signatureType == SignatureType.Caller) {\n require(\n signature.length == 0,\n \"LENGTH_0_REQUIRED\"\n );\n isValid = signerAddress == msg.sender;\n return isValid;\n\n // Signature verified by wallet contract.\n // If used with an order, the maker of the order is the wallet contract.\n } else if (signatureType == SignatureType.Wallet) {\n isValid = IWallet(signerAddress).isValidSignature(hash, signature);\n return isValid;\n\n // Signature verified by validator contract.\n // If used with an order, the maker of the order can still be an EOA.\n // A signature using this type should be encoded as:\n // | Offset | Length | Contents |\n // | 0x00 | x | Signature to validate |\n // | 0x00 + x | 20 | Address of validator contract |\n // | 0x14 + x | 1 | Signature type is always \"\\x06\" |\n } else if (signatureType == SignatureType.Validator) {\n // Pop last 20 bytes off of signature byte array.\n address validatorAddress = signature.popLast20Bytes();\n \n // Ensure signer has approved validator.\n if (!allowedValidators[signerAddress][validatorAddress]) {\n return false;\n }\n isValid = IValidator(validatorAddress).isValidSignature(\n hash,\n signerAddress,\n signature\n );\n return isValid;\n\n // Signer signed hash previously using the preSign function.\n } else if (signatureType == SignatureType.PreSigned) {\n isValid = preSigned[hash][signerAddress];\n return isValid;\n\n // Signature from Trezor hardware wallet.\n // It differs from web3.eth_sign in the encoding of message length\n // (Bitcoin varint encoding vs ascii-decimal, the latter is not\n // self-terminating which leads to ambiguities).\n // See also:\n // https://en.bitcoin.it/wiki/Protocol_documentation#Variable_length_integer\n // https://github.com/trezor/trezor-mcu/blob/master/firmware/ethereum.c#L602\n // https://github.com/trezor/trezor-mcu/blob/master/firmware/crypto.c#L36\n } else if (signatureType == SignatureType.Trezor) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n keccak256(abi.encodePacked(\n \"\\x19Ethereum Signed Message:\\n\\x20\",\n hash\n )),\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n }\n\n // Anything else is illegal (We do not return false because\n // the signature may actually be valid, just not in a format\n // that we currently support. In this case returning false\n // may lead the caller to incorrectly believe that the\n // signature was invalid.)\n revert(\"SIGNATURE_UNSUPPORTED\");\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinTransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\nimport \"./libs/LibExchangeErrors.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./libs/LibEIP712.sol\";\n\n\ncontract MixinTransactions is\n LibEIP712,\n MSignatureValidator,\n MTransactions\n{\n\n // Mapping of transaction hash => executed\n // This prevents transactions from being executed more than once.\n mapping (bytes32 => bool) public transactions;\n\n // Address of current transaction signer\n address public currentContextAddress;\n\n // Hash for the EIP712 ZeroEx Transaction Schema\n bytes32 constant internal EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"ZeroExTransaction(\",\n \"uint256 salt,\",\n \"address signerAddress,\",\n \"bytes data\",\n \")\"\n ));\n\n /// @dev Executes an exchange method call in the context of signer.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @param signature Proof of signer transaction by signer.\n function executeTransaction(\n uint256 salt,\n address signerAddress,\n bytes data,\n bytes signature\n )\n external\n {\n // Prevent reentrancy\n require(\n currentContextAddress == address(0),\n \"REENTRANCY_ILLEGAL\"\n );\n\n bytes32 transactionHash = hashEIP712Message(hashZeroExTransaction(\n salt,\n signerAddress,\n data\n ));\n\n // Validate transaction has not been executed\n require(\n !transactions[transactionHash],\n \"INVALID_TX_HASH\"\n );\n\n // Transaction always valid if signer is sender of transaction\n if (signerAddress != msg.sender) {\n // Validate signature\n require(\n isValidSignature(\n transactionHash,\n signerAddress,\n signature\n ),\n \"INVALID_TX_SIGNATURE\"\n );\n\n // Set the current transaction signer\n currentContextAddress = signerAddress;\n }\n\n // Execute transaction\n transactions[transactionHash] = true;\n require(\n address(this).delegatecall(data),\n \"FAILED_EXECUTION\"\n );\n\n // Reset current transaction signer if it was previously updated\n if (signerAddress != msg.sender) {\n currentContextAddress = address(0);\n }\n }\n\n /// @dev Calculates EIP712 hash of the Transaction.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @return EIP712 hash of the Transaction.\n function hashZeroExTransaction(\n uint256 salt,\n address signerAddress,\n bytes memory data\n )\n internal\n pure\n returns (bytes32 result)\n {\n bytes32 schemaHash = EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH;\n bytes32 dataHash = keccak256(data);\n\n // Assembly for more efficiently computing:\n // keccak256(abi.encodePacked(\n // EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH,\n // salt,\n // bytes32(signerAddress),\n // keccak256(data)\n // ));\n\n assembly {\n // Load free memory pointer\n let memPtr := mload(64)\n\n mstore(memPtr, schemaHash) // hash of schema\n mstore(add(memPtr, 32), salt) // salt\n mstore(add(memPtr, 64), and(signerAddress, 0xffffffffffffffffffffffffffffffffffffffff)) // signerAddress\n mstore(add(memPtr, 96), dataHash) // hash of data\n\n // Compute hash\n result := keccak256(memPtr, 128)\n }\n return result;\n }\n\n /// @dev The current function will be called in the context of this address (either 0x transaction signer or `msg.sender`).\n /// If calling a fill function, this address will represent the taker.\n /// If calling a cancel function, this address will represent the maker.\n /// @return Signer of 0x transaction if entry point is `executeTransaction`.\n /// `msg.sender` if entry point is any other function.\n function getCurrentContextAddress()\n internal\n view\n returns (address)\n {\n address contextAddress = currentContextAddress == address(0) ? msg.sender : currentContextAddress;\n return contextAddress;\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibMath.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./libs/LibAbiEncoder.sol\";\nimport \"./mixins/MExchangeCore.sol\";\n\n\ncontract MixinWrapperFunctions is\n LibMath,\n LibFillResults,\n LibAbiEncoder,\n MExchangeCore\n{\n\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n require(\n fillResults.takerAssetFilledAmount == takerAssetFillAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return fillResults;\n }\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (FillResults memory fillResults)\n {\n // ABI encode calldata for `fillOrder`\n bytes memory fillOrderCalldata = abiEncodeFillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n\n // Delegate to `fillOrder` and handle any exceptions gracefully\n assembly {\n let success := delegatecall(\n gas, // forward all gas, TODO: look into gas consumption of assert/throw\n address, // call address of this contract\n add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes)\n mload(fillOrderCalldata), // length of input\n fillOrderCalldata, // write output over input\n 128 // output size is 128 bytes\n )\n switch success\n case 0 {\n mstore(fillResults, 0)\n mstore(add(fillResults, 32), 0)\n mstore(add(fillResults, 64), 0)\n mstore(add(fillResults, 96), 0)\n }\n case 1 {\n mstore(fillResults, mload(fillOrderCalldata))\n mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32)))\n mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64)))\n mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96)))\n }\n }\n return fillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrder(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrKill.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrKillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrKillOrder(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrders(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory takerAssetData = orders[0].takerAssetData;\n \n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being sold by taker is the same for each order.\n // Rather than passing this in as calldata, we use the takerAssetData from the first order in all later orders.\n orders[i].takerAssetData = takerAssetData;\n\n // Calculate the remaining amount of takerAsset to sell\n uint256 remainingTakerAssetFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrder(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= takerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory takerAssetData = orders[0].takerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being sold by taker is the same for each order.\n // Rather than passing this in as calldata, we use the takerAssetData from the first order in all later orders.\n orders[i].takerAssetData = takerAssetData;\n\n // Calculate the remaining amount of takerAsset to sell\n uint256 remainingTakerAssetFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= takerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerAsset is bought by taker.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrders(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // Rather than passing this in as calldata, we copy the makerAssetData from the first order onto all later orders.\n orders[i].makerAssetData = makerAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmount(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrder(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n if (totalFillResults.makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // Rather than passing this in as calldata, we copy the makerAssetData from the first order onto all later orders.\n orders[i].makerAssetData = makerAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmount(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n if (totalFillResults.makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously cancels multiple orders in a single transaction.\n /// @param orders Array of order specifications.\n function batchCancelOrders(LibOrder.Order[] memory orders)\n public\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n cancelOrder(orders[i]);\n }\n }\n\n /// @dev Fetches information for all passed in orders.\n /// @param orders Array of order specifications.\n /// @return Array of OrderInfo instances that correspond to each order.\n function getOrdersInfo(LibOrder.Order[] memory orders)\n public\n view\n returns (LibOrder.OrderInfo[] memory)\n {\n uint256 ordersLength = orders.length;\n LibOrder.OrderInfo[] memory ordersInfo = new LibOrder.OrderInfo[](ordersLength);\n for (uint256 i = 0; i != ordersLength; i++) {\n ordersInfo[i] = getOrderInfo(orders[i]);\n }\n return ordersInfo;\n }\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IAssetProxyDispatcher {\n\n /// @dev Registers an asset proxy to its asset proxy id.\n /// Once an asset proxy is registered, it cannot be unregistered.\n /// @param assetProxy Address of new asset proxy to register.\n function registerAssetProxy(address assetProxy)\n external;\n\n /// @dev Gets an asset proxy.\n /// @param assetProxyId Id of the asset proxy.\n /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered.\n function getAssetProxy(bytes4 assetProxyId)\n external\n view\n returns (address);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IExchange.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./IExchangeCore.sol\";\nimport \"./IMatchOrders.sol\";\nimport \"./ISignatureValidator.sol\";\nimport \"./ITransactions.sol\";\nimport \"./IAssetProxyDispatcher.sol\";\nimport \"./IWrapperFunctions.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract IExchange is\n IExchangeCore,\n IMatchOrders,\n ISignatureValidator,\n ITransactions,\n IAssetProxyDispatcher,\n IWrapperFunctions\n{}\n",
- "2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IExchangeCore {\n\n /// @dev Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch\n /// and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress).\n /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled.\n function cancelOrdersUpTo(uint256 targetOrderEpoch)\n external;\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev After calling, the order can not be filled anymore.\n /// @param order Order struct containing order specifications.\n function cancelOrder(LibOrder.Order memory order)\n public;\n\n /// @dev Gets information about an order: status, hash, and amount filled.\n /// @param order Order to gather information on.\n /// @return OrderInfo Information about the order and its state.\n /// See LibOrder.OrderInfo for a complete description.\n function getOrderInfo(LibOrder.Order memory order)\n public\n view\n returns (LibOrder.OrderInfo memory orderInfo);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IMatchOrders {\n\n /// @dev Match two complementary orders that have a profitable spread.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the left order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftSignature Proof that order was created by the left maker.\n /// @param rightSignature Proof that order was created by the right maker.\n /// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.\n function matchOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n bytes memory leftSignature,\n bytes memory rightSignature\n )\n public\n returns (LibFillResults.MatchedFillResults memory matchedFillResults);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract ISignatureValidator {\n\n /// @dev Approves a hash on-chain using any valid signature type.\n /// After presigning a hash, the preSign signature type will become valid for that hash and signer.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n function preSign(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external;\n \n /// @dev Approves/unnapproves a Validator contract to verify signatures on signer's behalf.\n /// @param validatorAddress Address of Validator contract.\n /// @param approval Approval or disapproval of Validator contract.\n function setSignatureValidatorApproval(\n address validatorAddress,\n bool approval\n )\n external;\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signerAddress Address of signer.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes memory signature\n )\n public\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/ITransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\n\ncontract ITransactions {\n\n /// @dev Executes an exchange method call in the context of signer.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @param signature Proof of signer transaction by signer.\n function executeTransaction(\n uint256 salt,\n address signerAddress,\n bytes data,\n bytes signature\n )\n external;\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IValidator {\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IWallet.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IWallet {\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n bytes signature\n )\n external\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IWrapperFunctions {\n\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrKill.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrKillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrders(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerAsset is bought by taker.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrders(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously cancels multiple orders in a single transaction.\n /// @param orders Array of order specifications.\n function batchCancelOrders(LibOrder.Order[] memory orders)\n public;\n\n /// @dev Fetches information for all passed in orders\n /// @param orders Array of order specifications.\n /// @return Array of OrderInfo instances that correspond to each order.\n function getOrdersInfo(LibOrder.Order[] memory orders)\n public\n view\n returns (LibOrder.OrderInfo[] memory);\n}\n",
- "2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./LibOrder.sol\";\n\n\ncontract LibAbiEncoder {\n\n /// @dev ABI encodes calldata for `fillOrder`.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return ABI encoded calldata for `fillOrder`.\n function abiEncodeFillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n pure\n returns (bytes memory fillOrderCalldata)\n {\n // We need to call MExchangeCore.fillOrder using a delegatecall in\n // assembly so that we can intercept a call that throws. For this, we\n // need the input encoded in memory in the Ethereum ABIv2 format [1].\n\n // | Area | Offset | Length | Contents |\n // | -------- |--------|---------|-------------------------------------------- |\n // | Header | 0x00 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 0x00 | | 1. offset to order (*) |\n // | | 0x20 | | 2. takerAssetFillAmount |\n // | | 0x40 | | 3. offset to signature (*) |\n // | Data | | 12 * 32 | order: |\n // | | 0x000 | | 1. senderAddress |\n // | | 0x020 | | 2. makerAddress |\n // | | 0x040 | | 3. takerAddress |\n // | | 0x060 | | 4. feeRecipientAddress |\n // | | 0x080 | | 5. makerAssetAmount |\n // | | 0x0A0 | | 6. takerAssetAmount |\n // | | 0x0C0 | | 7. makerFeeAmount |\n // | | 0x0E0 | | 8. takerFeeAmount |\n // | | 0x100 | | 9. expirationTimeSeconds |\n // | | 0x120 | | 10. salt |\n // | | 0x140 | | 11. Offset to makerAssetData (*) |\n // | | 0x160 | | 12. Offset to takerAssetData (*) |\n // | | 0x180 | 32 | makerAssetData Length |\n // | | 0x1A0 | ** | makerAssetData Contents |\n // | | 0x1C0 | 32 | takerAssetData Length |\n // | | 0x1E0 | ** | takerAssetData Contents |\n // | | 0x200 | 32 | signature Length |\n // | | 0x220 | ** | signature Contents |\n\n // * Offsets are calculated from the beginning of the current area: Header, Params, Data:\n // An offset stored in the Params area is calculated from the beginning of the Params section.\n // An offset stored in the Data area is calculated from the beginning of the Data section.\n\n // ** The length of dynamic array contents are stored in the field immediately preceeding the contents.\n\n // [1]: https://solidity.readthedocs.io/en/develop/abi-spec.html\n\n assembly {\n\n // Areas below may use the following variables:\n // 1. <area>Start -- Start of this area in memory\n // 2. <area>End -- End of this area in memory. This value may\n // be precomputed (before writing contents),\n // or it may be computed as contents are written.\n // 3. <area>Offset -- Current offset into area. If an area's End\n // is precomputed, this variable tracks the\n // offsets of contents as they are written.\n\n /////// Setup Header Area ///////\n // Load free memory pointer\n fillOrderCalldata := mload(0x40)\n // bytes4(keccak256(\"fillOrder((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),uint256,bytes)\"))\n // = 0xb4be83d5\n // Leave 0x20 bytes to store the length\n mstore(add(fillOrderCalldata, 0x20), 0xb4be83d500000000000000000000000000000000000000000000000000000000)\n let headerAreaEnd := add(fillOrderCalldata, 0x24)\n\n /////// Setup Params Area ///////\n // This area is preallocated and written to later.\n // This is because we need to fill in offsets that have not yet been calculated.\n let paramsAreaStart := headerAreaEnd\n let paramsAreaEnd := add(paramsAreaStart, 0x60)\n let paramsAreaOffset := paramsAreaStart\n\n /////// Setup Data Area ///////\n let dataAreaStart := paramsAreaEnd\n let dataAreaEnd := dataAreaStart\n\n // Offset from the source data we're reading from\n let sourceOffset := order\n // arrayLenBytes and arrayLenWords track the length of a dynamically-allocated bytes array.\n let arrayLenBytes := 0\n let arrayLenWords := 0\n\n /////// Write order Struct ///////\n // Write memory location of Order, relative to the start of the\n // parameter list, then increment the paramsAreaOffset respectively.\n mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))\n paramsAreaOffset := add(paramsAreaOffset, 0x20)\n\n // Write values for each field in the order\n // It would be nice to use a loop, but we save on gas by writing\n // the stores sequentially.\n mstore(dataAreaEnd, mload(sourceOffset)) // makerAddress\n mstore(add(dataAreaEnd, 0x20), mload(add(sourceOffset, 0x20))) // takerAddress\n mstore(add(dataAreaEnd, 0x40), mload(add(sourceOffset, 0x40))) // feeRecipientAddress\n mstore(add(dataAreaEnd, 0x60), mload(add(sourceOffset, 0x60))) // senderAddress\n mstore(add(dataAreaEnd, 0x80), mload(add(sourceOffset, 0x80))) // makerAssetAmount\n mstore(add(dataAreaEnd, 0xA0), mload(add(sourceOffset, 0xA0))) // takerAssetAmount\n mstore(add(dataAreaEnd, 0xC0), mload(add(sourceOffset, 0xC0))) // makerFeeAmount\n mstore(add(dataAreaEnd, 0xE0), mload(add(sourceOffset, 0xE0))) // takerFeeAmount\n mstore(add(dataAreaEnd, 0x100), mload(add(sourceOffset, 0x100))) // expirationTimeSeconds\n mstore(add(dataAreaEnd, 0x120), mload(add(sourceOffset, 0x120))) // salt\n mstore(add(dataAreaEnd, 0x140), mload(add(sourceOffset, 0x140))) // Offset to makerAssetData\n mstore(add(dataAreaEnd, 0x160), mload(add(sourceOffset, 0x160))) // Offset to takerAssetData\n dataAreaEnd := add(dataAreaEnd, 0x180)\n sourceOffset := add(sourceOffset, 0x180)\n\n // Write offset to <order.makerAssetData>\n mstore(add(dataAreaStart, mul(10, 0x20)), sub(dataAreaEnd, dataAreaStart))\n\n // Calculate length of <order.makerAssetData>\n sourceOffset := mload(add(order, 0x140)) // makerAssetData\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of <order.makerAssetData>\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of <order.makerAssetData>\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n // Write offset to <order.takerAssetData>\n mstore(add(dataAreaStart, mul(11, 0x20)), sub(dataAreaEnd, dataAreaStart))\n\n // Calculate length of <order.takerAssetData>\n sourceOffset := mload(add(order, 0x160)) // takerAssetData\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of <order.takerAssetData>\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of <order.takerAssetData>\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n /////// Write takerAssetFillAmount ///////\n mstore(paramsAreaOffset, takerAssetFillAmount)\n paramsAreaOffset := add(paramsAreaOffset, 0x20)\n\n /////// Write signature ///////\n // Write offset to paramsArea\n mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))\n\n // Calculate length of signature\n sourceOffset := signature\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of signature\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of signature\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n // Set length of calldata\n mstore(fillOrderCalldata, sub(dataAreaEnd, add(fillOrderCalldata, 0x20)))\n\n // Increment free memory pointer\n mstore(0x40, dataAreaEnd)\n }\n\n return fillOrderCalldata;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibConstants.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\n// solhint-disable max-line-length\ncontract LibConstants {\n \n // Asset data for ZRX token. Used for fee transfers.\n // @TODO: Hardcode constant when we deploy. Currently \n // not constant to make testing easier.\n\n // The proxyId for ZRX_ASSET_DATA is bytes4(keccak256(\"ERC20Token(address)\")) = 0xf47261b0\n \n // Kovan ZRX address is 0x6ff6c0ff1d68b964901f986d4c9fa3ac68346570.\n // The ABI encoded proxyId and address is 0xf47261b00000000000000000000000006ff6c0ff1d68b964901f986d4c9fa3ac68346570\n // bytes constant public ZRX_ASSET_DATA = \"\\xf4\\x72\\x61\\xb0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x6f\\xf6\\xc0\\xff\\x1d\\x68\\xb9\\x64\\x90\\x1f\\x98\\x6d\\x4c\\x9f\\xa3\\xac\\x68\\x34\\x65\\x70\";\n \n // Mainnet ZRX address is 0xe41d2489571d322189246dafa5ebde1f4699f498.\n // The ABI encoded proxyId and address is 0xf47261b0000000000000000000000000e41d2489571d322189246dafa5ebde1f4699f498\n // bytes constant public ZRX_ASSET_DATA = \"\\xf4\\x72\\x61\\xb0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xe4\\x1d\\x24\\x89\\x57\\x1d\\x32\\x21\\x89\\x24\\x6d\\xaf\\xa5\\xeb\\xde\\x1f\\x46\\x99\\xf4\\x98\";\n \n // solhint-disable-next-line var-name-mixedcase\n bytes public ZRX_ASSET_DATA;\n\n // @TODO: Remove when we deploy.\n constructor (bytes memory zrxAssetData)\n public\n {\n ZRX_ASSET_DATA = zrxAssetData;\n }\n}\n// solhint-enable max-line-length\n",
- "2.0.0/protocol/Exchange/libs/LibEIP712.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract LibEIP712 {\n // EIP191 header for EIP712 prefix\n string constant internal EIP191_HEADER = \"\\x19\\x01\";\n\n // EIP712 Domain Name value\n string constant internal EIP712_DOMAIN_NAME = \"0x Protocol\";\n\n // EIP712 Domain Version value\n string constant internal EIP712_DOMAIN_VERSION = \"2\";\n\n // Hash of the EIP712 Domain Separator Schema\n bytes32 constant internal EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"EIP712Domain(\",\n \"string name,\",\n \"string version,\",\n \"address verifyingContract\",\n \")\"\n ));\n\n // Hash of the EIP712 Domain Separator data\n // solhint-disable-next-line var-name-mixedcase\n bytes32 public EIP712_DOMAIN_HASH;\n\n constructor ()\n public\n {\n EIP712_DOMAIN_HASH = keccak256(abi.encodePacked(\n EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH,\n keccak256(bytes(EIP712_DOMAIN_NAME)),\n keccak256(bytes(EIP712_DOMAIN_VERSION)),\n bytes32(address(this))\n ));\n }\n\n /// @dev Calculates EIP712 encoding for a hash struct in this EIP712 Domain.\n /// @param hashStruct The EIP712 hash struct.\n /// @return EIP712 hash applied to this EIP712 Domain.\n function hashEIP712Message(bytes32 hashStruct)\n internal\n view\n returns (bytes32 result)\n {\n bytes32 eip712DomainHash = EIP712_DOMAIN_HASH;\n\n // Assembly for more efficient computing:\n // keccak256(abi.encodePacked(\n // EIP191_HEADER,\n // EIP712_DOMAIN_HASH,\n // hashStruct \n // ));\n\n assembly {\n // Load free memory pointer\n let memPtr := mload(64)\n\n mstore(memPtr, 0x1901000000000000000000000000000000000000000000000000000000000000) // EIP191 header\n mstore(add(memPtr, 2), eip712DomainHash) // EIP712 domain hash\n mstore(add(memPtr, 34), hashStruct) // Hash of struct\n\n // Compute hash\n result := keccak256(memPtr, 66)\n }\n return result;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\n// solhint-disable\npragma solidity 0.4.24;\n\n\n/// @dev This contract documents the revert reasons used in the Exchange contract.\n/// This contract is intended to serve as a reference, but is not actually used for efficiency reasons.\ncontract LibExchangeErrors {\n\n /// Order validation errors ///\n string constant ORDER_UNFILLABLE = \"ORDER_UNFILLABLE\"; // Order cannot be filled.\n string constant INVALID_MAKER = \"INVALID_MAKER\"; // Invalid makerAddress.\n string constant INVALID_TAKER = \"INVALID_TAKER\"; // Invalid takerAddress.\n string constant INVALID_SENDER = \"INVALID_SENDER\"; // Invalid `msg.sender`.\n string constant INVALID_ORDER_SIGNATURE = \"INVALID_ORDER_SIGNATURE\"; // Signature validation failed. \n \n /// fillOrder validation errors ///\n string constant INVALID_TAKER_AMOUNT = \"INVALID_TAKER_AMOUNT\"; // takerAssetFillAmount cannot equal 0.\n string constant ROUNDING_ERROR = \"ROUNDING_ERROR\"; // Rounding error greater than 0.1% of takerAssetFillAmount. \n \n /// Signature validation errors ///\n string constant INVALID_SIGNATURE = \"INVALID_SIGNATURE\"; // Signature validation failed. \n string constant SIGNATURE_ILLEGAL = \"SIGNATURE_ILLEGAL\"; // Signature type is illegal.\n string constant SIGNATURE_UNSUPPORTED = \"SIGNATURE_UNSUPPORTED\"; // Signature type unsupported.\n \n /// cancelOrdersUptTo errors ///\n string constant INVALID_NEW_ORDER_EPOCH = \"INVALID_NEW_ORDER_EPOCH\"; // Specified salt must be greater than or equal to existing orderEpoch.\n\n /// fillOrKillOrder errors ///\n string constant COMPLETE_FILL_FAILED = \"COMPLETE_FILL_FAILED\"; // Desired takerAssetFillAmount could not be completely filled. \n\n /// matchOrders errors ///\n string constant NEGATIVE_SPREAD_REQUIRED = \"NEGATIVE_SPREAD_REQUIRED\"; // Matched orders must have a negative spread.\n\n /// Transaction errors ///\n string constant REENTRANCY_ILLEGAL = \"REENTRANCY_ILLEGAL\"; // Recursive reentrancy is not allowed. \n string constant INVALID_TX_HASH = \"INVALID_TX_HASH\"; // Transaction has already been executed. \n string constant INVALID_TX_SIGNATURE = \"INVALID_TX_SIGNATURE\"; // Signature validation failed. \n string constant FAILED_EXECUTION = \"FAILED_EXECUTION\"; // Transaction execution failed. \n \n /// registerAssetProxy errors ///\n string constant ASSET_PROXY_ALREADY_EXISTS = \"ASSET_PROXY_ALREADY_EXISTS\"; // AssetProxy with same id already exists.\n\n /// dispatchTransferFrom errors ///\n string constant ASSET_PROXY_DOES_NOT_EXIST = \"ASSET_PROXY_DOES_NOT_EXIST\"; // No assetProxy registered at given id.\n string constant TRANSFER_FAILED = \"TRANSFER_FAILED\"; // Asset transfer unsuccesful.\n\n /// Length validation errors ///\n string constant LENGTH_GREATER_THAN_0_REQUIRED = \"LENGTH_GREATER_THAN_0_REQUIRED\"; // Byte array must have a length greater than 0.\n string constant LENGTH_GREATER_THAN_3_REQUIRED = \"LENGTH_GREATER_THAN_3_REQUIRED\"; // Byte array must have a length greater than 3.\n string constant LENGTH_0_REQUIRED = \"LENGTH_0_REQUIRED\"; // Byte array must have a length of 0.\n string constant LENGTH_65_REQUIRED = \"LENGTH_65_REQUIRED\"; // Byte array must have a length of 65.\n}\n",
- "2.0.0/protocol/Exchange/libs/LibFillResults.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract LibFillResults is\n SafeMath\n{\n\n struct FillResults {\n uint256 makerAssetFilledAmount; // Total amount of makerAsset(s) filled.\n uint256 takerAssetFilledAmount; // Total amount of takerAsset(s) filled.\n uint256 makerFeePaid; // Total amount of ZRX paid by maker(s) to feeRecipient(s).\n uint256 takerFeePaid; // Total amount of ZRX paid by taker to feeRecipients(s).\n }\n\n struct MatchedFillResults {\n FillResults left; // Amounts filled and fees paid of left order.\n FillResults right; // Amounts filled and fees paid of right order.\n uint256 leftMakerAssetSpreadAmount; // Spread between price of left and right order, denominated in the left order's makerAsset, paid to taker.\n }\n\n /// @dev Adds properties of both FillResults instances.\n /// Modifies the first FillResults instance specified.\n /// @param totalFillResults Fill results instance that will be added onto.\n /// @param singleFillResults Fill results instance that will be added to totalFillResults.\n function addFillResults(FillResults memory totalFillResults, FillResults memory singleFillResults)\n internal\n pure\n {\n totalFillResults.makerAssetFilledAmount = safeAdd(totalFillResults.makerAssetFilledAmount, singleFillResults.makerAssetFilledAmount);\n totalFillResults.takerAssetFilledAmount = safeAdd(totalFillResults.takerAssetFilledAmount, singleFillResults.takerAssetFilledAmount);\n totalFillResults.makerFeePaid = safeAdd(totalFillResults.makerFeePaid, singleFillResults.makerFeePaid);\n totalFillResults.takerFeePaid = safeAdd(totalFillResults.takerFeePaid, singleFillResults.takerFeePaid);\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibMath.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract LibMath is\n SafeMath\n{\n\n /// @dev Calculates partial value given a numerator and denominator.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target.\n function getPartialAmount(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n partialAmount = safeDiv(\n safeMul(numerator, target),\n denominator\n );\n return partialAmount;\n }\n\n /// @dev Checks if rounding error > 0.1%.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to multiply with numerator/denominator.\n /// @return Rounding error is present.\n function isRoundingError(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (bool isError)\n {\n uint256 remainder = mulmod(target, numerator, denominator);\n if (remainder == 0) {\n return false; // No rounding error.\n }\n\n uint256 errPercentageTimes1000000 = safeDiv(\n safeMul(remainder, 1000000),\n safeMul(numerator, target)\n );\n isError = errPercentageTimes1000000 > 1000;\n return isError;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibOrder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./LibEIP712.sol\";\n\n\ncontract LibOrder is\n LibEIP712\n{\n\n // Hash for the EIP712 Order Schema\n bytes32 constant internal EIP712_ORDER_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"Order(\",\n \"address makerAddress,\",\n \"address takerAddress,\",\n \"address feeRecipientAddress,\",\n \"address senderAddress,\",\n \"uint256 makerAssetAmount,\",\n \"uint256 takerAssetAmount,\",\n \"uint256 makerFee,\",\n \"uint256 takerFee,\",\n \"uint256 expirationTimeSeconds,\",\n \"uint256 salt,\",\n \"bytes makerAssetData,\",\n \"bytes takerAssetData\",\n \")\"\n ));\n\n // A valid order remains fillable until it is expired, fully filled, or cancelled.\n // An order's state is unaffected by external factors, like account balances.\n enum OrderStatus {\n INVALID, // Default value\n INVALID_MAKER_ASSET_AMOUNT, // Order does not have a valid maker asset amount\n INVALID_TAKER_ASSET_AMOUNT, // Order does not have a valid taker asset amount\n FILLABLE, // Order is fillable\n EXPIRED, // Order has already expired\n FULLY_FILLED, // Order is fully filled\n CANCELLED // Order has been cancelled\n }\n\n // solhint-disable max-line-length\n struct Order {\n address makerAddress; // Address that created the order. \n address takerAddress; // Address that is allowed to fill the order. If set to 0, any address is allowed to fill the order. \n address feeRecipientAddress; // Address that will recieve fees when order is filled. \n address senderAddress; // Address that is allowed to call Exchange contract methods that affect this order. If set to 0, any address is allowed to call these methods.\n uint256 makerAssetAmount; // Amount of makerAsset being offered by maker. Must be greater than 0. \n uint256 takerAssetAmount; // Amount of takerAsset being bid on by maker. Must be greater than 0. \n uint256 makerFee; // Amount of ZRX paid to feeRecipient by maker when order is filled. If set to 0, no transfer of ZRX from maker to feeRecipient will be attempted.\n uint256 takerFee; // Amount of ZRX paid to feeRecipient by taker when order is filled. If set to 0, no transfer of ZRX from taker to feeRecipient will be attempted.\n uint256 expirationTimeSeconds; // Timestamp in seconds at which order expires. \n uint256 salt; // Arbitrary number to facilitate uniqueness of the order's hash. \n bytes makerAssetData; // Encoded data that can be decoded by a specified proxy contract when transferring makerAsset. The last byte references the id of this proxy.\n bytes takerAssetData; // Encoded data that can be decoded by a specified proxy contract when transferring takerAsset. The last byte references the id of this proxy.\n }\n // solhint-enable max-line-length\n\n struct OrderInfo {\n uint8 orderStatus; // Status that describes order's validity and fillability.\n bytes32 orderHash; // EIP712 hash of the order (see LibOrder.getOrderHash).\n uint256 orderTakerAssetFilledAmount; // Amount of order that has already been filled.\n }\n\n /// @dev Calculates Keccak-256 hash of the order.\n /// @param order The order structure.\n /// @return Keccak-256 EIP712 hash of the order.\n function getOrderHash(Order memory order)\n internal\n view\n returns (bytes32 orderHash)\n {\n orderHash = hashEIP712Message(hashOrder(order));\n return orderHash;\n }\n\n /// @dev Calculates EIP712 hash of the order.\n /// @param order The order structure.\n /// @return EIP712 hash of the order.\n function hashOrder(Order memory order)\n internal\n pure\n returns (bytes32 result)\n {\n bytes32 schemaHash = EIP712_ORDER_SCHEMA_HASH;\n bytes32 makerAssetDataHash = keccak256(order.makerAssetData);\n bytes32 takerAssetDataHash = keccak256(order.takerAssetData);\n\n // Assembly for more efficiently computing:\n // keccak256(abi.encodePacked(\n // EIP712_ORDER_SCHEMA_HASH,\n // bytes32(order.makerAddress),\n // bytes32(order.takerAddress),\n // bytes32(order.feeRecipientAddress),\n // bytes32(order.senderAddress),\n // order.makerAssetAmount,\n // order.takerAssetAmount,\n // order.makerFee,\n // order.takerFee,\n // order.expirationTimeSeconds,\n // order.salt,\n // keccak256(order.makerAssetData),\n // keccak256(order.takerAssetData)\n // ));\n\n assembly {\n // Calculate memory addresses that will be swapped out before hashing\n let pos1 := sub(order, 32)\n let pos2 := add(order, 320)\n let pos3 := add(order, 352)\n\n // Backup\n let temp1 := mload(pos1)\n let temp2 := mload(pos2)\n let temp3 := mload(pos3)\n \n // Hash in place\n mstore(pos1, schemaHash)\n mstore(pos2, makerAssetDataHash)\n mstore(pos3, takerAssetDataHash)\n result := keccak256(pos1, 416)\n \n // Restore\n mstore(pos1, temp1)\n mstore(pos2, temp2)\n mstore(pos3, temp3)\n }\n return result;\n }\n}\n",
- "2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAssetProxyDispatcher.sol\";\n\n\ncontract MAssetProxyDispatcher is\n IAssetProxyDispatcher\n{\n\n // Logs registration of new asset proxy\n event AssetProxyRegistered(\n bytes4 id, // Id of new registered AssetProxy.\n address assetProxy // Address of new registered AssetProxy.\n );\n\n /// @dev Forwards arguments to assetProxy and calls `transferFrom`. Either succeeds or throws.\n /// @param assetData Byte array encoded for the asset.\n /// @param from Address to transfer token from.\n /// @param to Address to transfer token to.\n /// @param amount Amount of token to transfer.\n function dispatchTransferFrom(\n bytes memory assetData,\n address from,\n address to,\n uint256 amount\n )\n internal;\n}\n",
- "2.0.0/protocol/Exchange/mixins/MExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IExchangeCore.sol\";\n\n\ncontract MExchangeCore is\n IExchangeCore\n{\n // Fill event is emitted whenever an order is filled.\n event Fill(\n address indexed makerAddress, // Address that created the order. \n address indexed feeRecipientAddress, // Address that received fees.\n address takerAddress, // Address that filled the order.\n address senderAddress, // Address that called the Exchange contract (msg.sender).\n uint256 makerAssetFilledAmount, // Amount of makerAsset sold by maker and bought by taker. \n uint256 takerAssetFilledAmount, // Amount of takerAsset sold by taker and bought by maker.\n uint256 makerFeePaid, // Amount of ZRX paid to feeRecipient by maker.\n uint256 takerFeePaid, // Amount of ZRX paid to feeRecipient by taker.\n bytes32 indexed orderHash, // EIP712 hash of order (see LibOrder.getOrderHash).\n bytes makerAssetData, // Encoded data specific to makerAsset. \n bytes takerAssetData // Encoded data specific to takerAsset.\n );\n\n // Cancel event is emitted whenever an individual order is cancelled.\n event Cancel(\n address indexed makerAddress, // Address that created the order. \n address indexed feeRecipientAddress, // Address that would have recieved fees if order was filled. \n address senderAddress, // Address that called the Exchange contract (msg.sender).\n bytes32 indexed orderHash, // EIP712 hash of order (see LibOrder.getOrderHash).\n bytes makerAssetData, // Encoded data specific to makerAsset. \n bytes takerAssetData // Encoded data specific to takerAsset.\n );\n\n // CancelUpTo event is emitted whenever `cancelOrdersUpTo` is executed succesfully.\n event CancelUpTo(\n address indexed makerAddress, // Orders cancelled must have been created by this address.\n address indexed senderAddress, // Orders cancelled must have a `senderAddress` equal to this address.\n uint256 orderEpoch // Orders with specified makerAddress and senderAddress with a salt less than this value are considered cancelled.\n );\n\n /// @dev Updates state with results of a fill order.\n /// @param order that was filled.\n /// @param takerAddress Address of taker who filled the order.\n /// @param orderTakerAssetFilledAmount Amount of order already filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function updateFilledState(\n LibOrder.Order memory order,\n address takerAddress,\n bytes32 orderHash,\n uint256 orderTakerAssetFilledAmount,\n LibFillResults.FillResults memory fillResults\n )\n internal;\n\n /// @dev Updates state with results of cancelling an order.\n /// State is only updated if the order is currently fillable.\n /// Otherwise, updating state would have no effect.\n /// @param order that was cancelled.\n /// @param orderHash Hash of order that was cancelled.\n function updateCancelledState(\n LibOrder.Order memory order,\n bytes32 orderHash\n )\n internal;\n\n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo Status, orderHash, and amount already filled of order.\n /// @param takerAddress Address of order taker.\n /// @param takerAssetFillAmount Desired amount of order to fill by taker.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @param signature Proof that the orders was created by its maker.\n function assertValidFill(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo,\n address takerAddress,\n uint256 takerAssetFillAmount,\n uint256 takerAssetFilledAmount,\n bytes memory signature\n )\n internal\n view;\n\n /// @dev Validates context for cancelOrder. Succeeds or throws.\n /// @param order to be cancelled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n function assertValidCancel(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo\n )\n internal\n view;\n\n /// @dev Calculates amounts filled and fees paid by maker and taker.\n /// @param order to be filled.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function calculateFillResults(\n LibOrder.Order memory order,\n uint256 takerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.FillResults memory fillResults);\n\n}\n",
- "2.0.0/protocol/Exchange/mixins/MMatchOrders.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IMatchOrders.sol\";\n\n\ncontract MMatchOrders is\n IMatchOrders\n{\n\n /// @dev Validates context for matchOrders. Succeeds or throws.\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n function assertValidMatch(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder\n )\n internal\n pure;\n\n /// @dev Calculates fill amounts for the matched orders.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the leftOrder order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftOrderTakerAssetFilledAmount Amount of left order already filled.\n /// @param rightOrderTakerAssetFilledAmount Amount of right order already filled.\n /// @param matchedFillResults Amounts to fill and fees to pay by maker and taker of matched orders.\n function calculateMatchedFillResults(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n uint256 leftOrderTakerAssetFilledAmount,\n uint256 rightOrderTakerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.MatchedFillResults memory matchedFillResults);\n\n}\n",
- "2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/ISignatureValidator.sol\";\n\n\ncontract MSignatureValidator is\n ISignatureValidator\n{\n event SignatureValidatorApproval(\n address indexed signerAddress, // Address that approves or disapproves a contract to verify signatures.\n address indexed validatorAddress, // Address of signature validator contract.\n bool approved // Approval or disapproval of validator contract.\n );\n\n // Allowed signature types.\n enum SignatureType {\n Illegal, // 0x00, default value\n Invalid, // 0x01\n EIP712, // 0x02\n EthSign, // 0x03\n Caller, // 0x04\n Wallet, // 0x05\n Validator, // 0x06\n PreSigned, // 0x07\n Trezor, // 0x08\n NSignatureTypes // 0x09, number of signature types. Always leave at end.\n }\n}\n",
- "2.0.0/protocol/Exchange/mixins/MTransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\nimport \"../interfaces/ITransactions.sol\";\n\n\ncontract MTransactions is\n ITransactions\n{\n\n /// @dev The current function will be called in the context of this address (either 0x transaction signer or `msg.sender`).\n /// If calling a fill function, this address will represent the taker.\n /// If calling a cancel function, this address will represent the maker.\n /// @return Signer of 0x transaction if entry point is `executeTransaction`.\n /// `msg.sender` if entry point is any other function.\n function getCurrentContextAddress()\n internal\n view\n returns (address);\n}\n",
- "2.0.0/test/DummyERC20Token/DummyERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"../../tokens/ERC20Token/MintableERC20Token.sol\";\n\n\ncontract DummyERC20Token is \n Ownable,\n MintableERC20Token\n{\n string public name;\n string public symbol;\n uint256 public decimals;\n uint256 public constant MAX_MINT_AMOUNT = 10000000000000000000000;\n\n constructor (\n string _name,\n string _symbol,\n uint256 _decimals,\n uint256 _totalSupply\n )\n public\n {\n name = _name;\n symbol = _symbol;\n decimals = _decimals;\n _totalSupply = _totalSupply;\n balances[msg.sender] = _totalSupply;\n }\n\n /// @dev Sets the balance of target address\n /// @param _target Address or which balance will be updated\n /// @param _value New balance of target address\n function setBalance(address _target, uint256 _value)\n external\n onlyOwner\n {\n uint256 currBalance = balances[_target];\n if (_value < currBalance) {\n _totalSupply = safeSub(_totalSupply, safeSub(currBalance, _value));\n } else {\n _totalSupply = safeAdd(_totalSupply, safeSub(_value, currBalance));\n }\n balances[_target] = _value;\n }\n\n /// @dev Mints new tokens for sender\n /// @param _value Amount of tokens to mint\n function mint(uint256 _value)\n external\n {\n require(\n _value <= MAX_MINT_AMOUNT,\n \"VALUE_TOO_LARGE\"\n );\n\n _mint(msg.sender, _value);\n }\n}\n",
- "2.0.0/test/DummyERC721Token/DummyERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../tokens/ERC721Token/MintableERC721Token.sol\";\nimport \"../../utils/Ownable/Ownable.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract DummyERC721Token is\n Ownable,\n MintableERC721Token\n{\n string public name;\n string public symbol;\n\n constructor (\n string _name,\n string _symbol\n )\n public\n {\n name = _name;\n symbol = _symbol;\n }\n\n /// @dev Function to mint a new token\n /// Reverts if the given token ID already exists\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _tokenId ID of the token to be minted by the msg.sender \n function mint(address _to, uint256 _tokenId)\n external\n {\n _mint(_to, _tokenId);\n }\n\n /// @dev Function to burn a token\n /// Reverts if the given token ID doesn't exist or not called by contract owner\n /// @param _owner Owner of token with given token ID\n /// @param _tokenId ID of the token to be burned by the msg.sender\n function burn(address _owner, uint256 _tokenId)\n external\n onlyOwner\n {\n _burn(_owner, _tokenId);\n }\n}\n",
- "2.0.0/tokens/ERC20Token/ERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IERC20Token.sol\";\n\n\ncontract ERC20Token is\n IERC20Token\n{\n\n mapping (address => uint256) internal balances;\n mapping (address => mapping (address => uint256)) internal allowed;\n\n uint256 internal _totalSupply;\n\n /// @dev send `value` token to `to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transfer(address _to, uint256 _value)\n external\n returns (bool)\n {\n require(\n balances[msg.sender] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[msg.sender] -= _value;\n balances[_to] += _value;\n\n emit Transfer(\n msg.sender,\n _to,\n _value\n );\n\n return true;\n }\n\n /// @dev send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool)\n {\n require(\n balances[_from] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n allowed[_from][msg.sender] >= _value,\n \"ERC20_INSUFFICIENT_ALLOWANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[_to] += _value;\n balances[_from] -= _value;\n allowed[_from][msg.sender] -= _value;\n \n emit Transfer(\n _from,\n _to,\n _value\n );\n \n return true;\n }\n\n /// @dev `msg.sender` approves `_spender` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Always true if the call has enough gas to complete execution\n function approve(address _spender, uint256 _value)\n external\n returns (bool)\n {\n allowed[msg.sender][_spender] = _value;\n emit Approval(\n msg.sender,\n _spender,\n _value\n );\n return true;\n }\n\n /// @dev Query total supply of token\n /// @return Total supply of token\n function totalSupply()\n external\n view\n returns (uint256)\n {\n return _totalSupply;\n }\n\n /// @dev Query the balance of owner\n /// @param _owner The address from which the balance will be retrieved\n /// @return Balance of owner\n function balanceOf(address _owner)\n external\n view\n returns (uint256)\n {\n return balances[_owner];\n }\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender)\n external\n view\n returns (uint256)\n {\n return allowed[_owner][_spender];\n }\n}\n",
- "2.0.0/tokens/ERC20Token/IERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC20Token {\n\n // solhint-disable no-simple-event-func-name\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 _value\n );\n\n event Approval(\n address indexed _owner,\n address indexed _spender,\n uint256 _value\n );\n\n /// @dev send `value` token to `to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transfer(address _to, uint256 _value)\n external\n returns (bool);\n\n /// @dev send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool);\n \n /// @dev `msg.sender` approves `_spender` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Always true if the call has enough gas to complete execution\n function approve(address _spender, uint256 _value)\n external\n returns (bool);\n\n /// @dev Query total supply of token\n /// @return Total supply of token\n function totalSupply()\n external\n view\n returns (uint256);\n \n /// @param _owner The address from which the balance will be retrieved\n /// @return Balance of owner\n function balanceOf(address _owner)\n external\n view\n returns (uint256);\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender)\n external\n view\n returns (uint256);\n}\n",
- "2.0.0/tokens/ERC20Token/MintableERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/SafeMath/SafeMath.sol\";\nimport \"./UnlimitedAllowanceERC20Token.sol\";\n\n\ncontract MintableERC20Token is \n SafeMath,\n UnlimitedAllowanceERC20Token\n{\n\n /// @dev Mints new tokens\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _value Amount of tokens to mint\n function _mint(address _to, uint256 _value)\n internal\n {\n balances[_to] = safeAdd(_value, balances[_to]);\n _totalSupply = safeAdd(_totalSupply, _value);\n\n emit Transfer(\n address(0),\n _to,\n _value\n );\n }\n\n /// @dev Mints new tokens\n /// @param _owner Owner of tokens that will be burned\n /// @param _value Amount of tokens to burn\n function _burn(address _owner, uint256 _value)\n internal\n {\n balances[_owner] = safeSub(balances[_owner], _value);\n _totalSupply = safeSub(_totalSupply, _value);\n\n emit Transfer(\n _owner,\n address(0),\n _value\n );\n }\n}\n",
- "2.0.0/tokens/ERC20Token/UnlimitedAllowanceERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../ERC20Token/ERC20Token.sol\";\n\n\ncontract UnlimitedAllowanceERC20Token is\n ERC20Token\n{\n\n uint256 constant internal MAX_UINT = 2**256 - 1;\n\n /// @dev ERC20 transferFrom, modified such that an allowance of MAX_UINT represents an unlimited allowance. See https://github.com/ethereum/EIPs/issues/717\n /// @param _from Address to transfer from.\n /// @param _to Address to transfer to.\n /// @param _value Amount to transfer.\n /// @return Success of transfer.\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool)\n {\n uint256 allowance = allowed[_from][msg.sender];\n require(\n balances[_from] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n allowance >= _value,\n \"ERC20_INSUFFICIENT_ALLOWANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[_to] += _value;\n balances[_from] -= _value;\n if (allowance < MAX_UINT) {\n allowed[_from][msg.sender] -= _value;\n }\n\n emit Transfer(\n _from,\n _to,\n _value\n );\n\n return true;\n }\n}\n",
- "2.0.0/tokens/ERC721Token/ERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IERC721Token.sol\";\nimport \"./IERC721Receiver.sol\";\nimport \"../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract ERC721Token is\n IERC721Token,\n SafeMath\n{\n // Function selector for ERC721Receiver.onERC721Received\n // 0x150b7a02\n bytes4 constant internal ERC721_RECEIVED = bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"));\n\n // Mapping of tokenId => owner\n mapping (uint256 => address) internal owners;\n\n // Mapping of tokenId => approved address\n mapping (uint256 => address) internal approvals;\n\n // Mapping of owner => number of tokens owned\n mapping (address => uint256) internal balances;\n\n // Mapping of owner => operator => approved\n mapping (address => mapping (address => bool)) internal operatorApprovals;\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT. When transfer is complete, this function\n /// checks if `_to` is a smart contract (code size > 0). If so, it calls\n /// `onERC721Received` on `_to` and throws if the return value is not\n /// `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n /// @param _data Additional data with no specified format, sent in call to `_to`\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId,\n bytes _data\n )\n external\n {\n transferFrom(\n _from,\n _to,\n _tokenId\n );\n\n uint256 receiverCodeSize;\n assembly {\n receiverCodeSize := extcodesize(_to)\n }\n if (receiverCodeSize > 0) {\n bytes4 selector = IERC721Receiver(_to).onERC721Received(\n msg.sender,\n _from,\n _tokenId,\n _data\n );\n require(\n selector == ERC721_RECEIVED,\n \"ERC721_INVALID_SELECTOR\"\n );\n }\n }\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev This works identically to the other function with an extra data parameter,\n /// except this function just sets data to \"\".\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n external\n {\n transferFrom(\n _from,\n _to,\n _tokenId\n );\n\n uint256 receiverCodeSize;\n assembly {\n receiverCodeSize := extcodesize(_to)\n }\n if (receiverCodeSize > 0) {\n bytes4 selector = IERC721Receiver(_to).onERC721Received(\n msg.sender,\n _from,\n _tokenId,\n \"\"\n );\n require(\n selector == ERC721_RECEIVED,\n \"ERC721_INVALID_SELECTOR\"\n );\n }\n }\n\n /// @notice Change or reaffirm the approved address for an NFT\n /// @dev The zero address indicates there is no approved address.\n /// Throws unless `msg.sender` is the current NFT owner, or an authorized\n /// operator of the current owner.\n /// @param _approved The new approved NFT controller\n /// @param _tokenId The NFT to approve\n function approve(address _approved, uint256 _tokenId)\n external\n {\n address owner = ownerOf(_tokenId);\n require(\n msg.sender == owner || isApprovedForAll(owner, msg.sender),\n \"ERC721_INVALID_SENDER\"\n );\n\n approvals[_tokenId] = _approved;\n emit Approval(\n owner,\n _approved,\n _tokenId\n );\n }\n\n /// @notice Enable or disable approval for a third party (\"operator\") to manage\n /// all of `msg.sender`'s assets\n /// @dev Emits the ApprovalForAll event. The contract MUST allow\n /// multiple operators per owner.\n /// @param _operator Address to add to the set of authorized operators\n /// @param _approved True if the operator is approved, false to revoke approval\n function setApprovalForAll(address _operator, bool _approved)\n external\n {\n operatorApprovals[msg.sender][_operator] = _approved;\n emit ApprovalForAll(\n msg.sender,\n _operator,\n _approved\n );\n }\n \n /// @notice Count all NFTs assigned to an owner\n /// @dev NFTs assigned to the zero address are considered invalid, and this\n /// function throws for queries about the zero address.\n /// @param _owner An address for whom to query the balance\n /// @return The number of NFTs owned by `_owner`, possibly zero\n function balanceOf(address _owner)\n external\n view\n returns (uint256)\n {\n require(\n _owner != address(0),\n \"ERC721_ZERO_OWNER\"\n );\n return balances[_owner];\n }\n\n /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE\n /// TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE\n /// THEY MAY BE PERMANENTLY LOST\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function transferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n public\n {\n require(\n _to != address(0),\n \"ERC721_ZERO_TO_ADDRESS\"\n );\n\n address owner = ownerOf(_tokenId);\n require(\n _from == owner,\n \"ERC721_OWNER_MISMATCH\"\n );\n\n address spender = msg.sender;\n address approvedAddress = getApproved(_tokenId);\n require(\n spender == owner ||\n isApprovedForAll(owner, spender) ||\n approvedAddress == spender,\n \"ERC721_INVALID_SPENDER\"\n );\n\n if (approvedAddress != address(0)) {\n approvals[_tokenId] = address(0);\n }\n\n owners[_tokenId] = _to;\n balances[_from] = safeSub(balances[_from], 1);\n balances[_to] = safeAdd(balances[_to], 1);\n \n emit Transfer(\n _from,\n _to,\n _tokenId\n );\n }\n\n /// @notice Find the owner of an NFT\n /// @dev NFTs assigned to zero address are considered invalid, and queries\n /// about them do throw.\n /// @param _tokenId The identifier for an NFT\n /// @return The address of the owner of the NFT\n function ownerOf(uint256 _tokenId)\n public\n view\n returns (address)\n {\n address owner = owners[_tokenId];\n require(\n owner != address(0),\n \"ERC721_ZERO_OWNER\"\n );\n return owner;\n }\n\n /// @notice Get the approved address for a single NFT\n /// @dev Throws if `_tokenId` is not a valid NFT.\n /// @param _tokenId The NFT to find the approved address for\n /// @return The approved address for this NFT, or the zero address if there is none\n function getApproved(uint256 _tokenId)\n public\n view\n returns (address)\n {\n return approvals[_tokenId];\n }\n\n /// @notice Query if an address is an authorized operator for another address\n /// @param _owner The address that owns the NFTs\n /// @param _operator The address that acts on behalf of the owner\n /// @return True if `_operator` is an approved operator for `_owner`, false otherwise\n function isApprovedForAll(address _owner, address _operator)\n public\n view\n returns (bool)\n {\n return operatorApprovals[_owner][_operator];\n }\n}\n",
- "2.0.0/tokens/ERC721Token/IERC721Receiver.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC721Receiver {\n\n /// @notice Handle the receipt of an NFT\n /// @dev The ERC721 smart contract calls this function on the recipient\n /// after a `transfer`. This function MAY throw to revert and reject the\n /// transfer. Return of other than the magic value MUST result in the\n /// transaction being reverted.\n /// Note: the contract address is always the message sender.\n /// @param _operator The address which called `safeTransferFrom` function\n /// @param _from The address which previously owned the token\n /// @param _tokenId The NFT identifier which is being transferred\n /// @param _data Additional data with no specified format\n /// @return `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`\n /// unless throwing\n function onERC721Received(\n address _operator,\n address _from,\n uint256 _tokenId,\n bytes _data\n )\n external\n returns (bytes4);\n}\n",
- "2.0.0/tokens/ERC721Token/IERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC721Token {\n\n /// @dev This emits when ownership of any NFT changes by any mechanism.\n /// This event emits when NFTs are created (`from` == 0) and destroyed\n /// (`to` == 0). Exception: during contract creation, any number of NFTs\n /// may be created and assigned without emitting Transfer. At the time of\n /// any transfer, the approved address for that NFT (if any) is reset to none.\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 indexed _tokenId\n );\n\n /// @dev This emits when the approved address for an NFT is changed or\n /// reaffirmed. The zero address indicates there is no approved address.\n /// When a Transfer event emits, this also indicates that the approved\n /// address for that NFT (if any) is reset to none.\n event Approval(\n address indexed _owner,\n address indexed _approved,\n uint256 indexed _tokenId\n );\n\n /// @dev This emits when an operator is enabled or disabled for an owner.\n /// The operator can manage all NFTs of the owner.\n event ApprovalForAll(\n address indexed _owner,\n address indexed _operator,\n bool _approved\n );\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// perator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT. When transfer is complete, this function\n /// checks if `_to` is a smart contract (code size > 0). If so, it calls\n /// `onERC721Received` on `_to` and throws if the return value is not\n /// `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n /// @param _data Additional data with no specified format, sent in call to `_to`\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId,\n bytes _data\n )\n external;\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev This works identically to the other function with an extra data parameter,\n /// except this function just sets data to \"\".\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n external;\n\n /// @notice Change or reaffirm the approved address for an NFT\n /// @dev The zero address indicates there is no approved address.\n /// Throws unless `msg.sender` is the current NFT owner, or an authorized\n /// operator of the current owner.\n /// @param _approved The new approved NFT controller\n /// @param _tokenId The NFT to approve\n function approve(address _approved, uint256 _tokenId)\n external;\n\n /// @notice Enable or disable approval for a third party (\"operator\") to manage\n /// all of `msg.sender`'s assets\n /// @dev Emits the ApprovalForAll event. The contract MUST allow\n /// multiple operators per owner.\n /// @param _operator Address to add to the set of authorized operators\n /// @param _approved True if the operator is approved, false to revoke approval\n function setApprovalForAll(address _operator, bool _approved)\n external;\n\n /// @notice Count all NFTs assigned to an owner\n /// @dev NFTs assigned to the zero address are considered invalid, and this\n /// function throws for queries about the zero address.\n /// @param _owner An address for whom to query the balance\n /// @return The number of NFTs owned by `_owner`, possibly zero\n function balanceOf(address _owner)\n external\n view\n returns (uint256);\n\n /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE\n /// TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE\n /// THEY MAY BE PERMANENTLY LOST\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function transferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n public;\n\n /// @notice Find the owner of an NFT\n /// @dev NFTs assigned to zero address are considered invalid, and queries\n /// about them do throw.\n /// @param _tokenId The identifier for an NFT\n /// @return The address of the owner of the NFT\n function ownerOf(uint256 _tokenId)\n public\n view\n returns (address);\n\n /// @notice Get the approved address for a single NFT\n /// @dev Throws if `_tokenId` is not a valid NFT.\n /// @param _tokenId The NFT to find the approved address for\n /// @return The approved address for this NFT, or the zero address if there is none\n function getApproved(uint256 _tokenId) \n public\n view\n returns (address);\n \n /// @notice Query if an address is an authorized operator for another address\n /// @param _owner The address that owns the NFTs\n /// @param _operator The address that acts on behalf of the owner\n /// @return True if `_operator` is an approved operator for `_owner`, false otherwise\n function isApprovedForAll(address _owner, address _operator)\n public\n view\n returns (bool);\n}\n",
- "2.0.0/tokens/ERC721Token/MintableERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./ERC721Token.sol\";\n\n\ncontract MintableERC721Token is\n ERC721Token\n{\n\n /// @dev Function to mint a new token\n /// Reverts if the given token ID already exists\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _tokenId ID of the token to be minted by the msg.sender \n function _mint(address _to, uint256 _tokenId)\n internal\n {\n require(\n _to != address(0),\n \"ERC721_ZERO_TO_ADDRESS\"\n );\n\n address owner = owners[_tokenId];\n require(\n owner == address(0),\n \"ERC721_OWNER_ALREADY_EXISTS\"\n );\n\n owners[_tokenId] = _to;\n balances[_to] = safeAdd(balances[_to], 1);\n\n emit Transfer(\n address(0),\n _to,\n _tokenId\n );\n }\n\n /// @dev Function to burn a token\n /// Reverts if the given token ID doesn't exist\n /// @param _owner Owner of token with given token ID\n /// @param _tokenId ID of the token to be burned by the msg.sender\n function _burn(address _owner, uint256 _tokenId)\n internal\n {\n require(\n _owner != address(0),\n \"ERC721_ZERO_OWNER_ADDRESS\"\n );\n\n address owner = owners[_tokenId];\n require(\n owner == _owner,\n \"ERC721_OWNER_MISMATCH\"\n );\n\n owners[_tokenId] = address(0);\n balances[_owner] = safeSub(balances[_owner], 1);\n\n emit Transfer(\n _owner,\n address(0),\n _tokenId\n );\n }\n}\n",
- "2.0.0/tokens/EtherToken/IEtherToken.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../ERC20Token/IERC20Token.sol\";\n\n\ncontract IEtherToken is\n IERC20Token\n{\n function deposit()\n public\n payable;\n \n function withdraw(uint256 amount)\n public;\n}\n",
- "2.0.0/utils/LibBytes/LibBytes.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\nlibrary LibBytes {\n\n using LibBytes for bytes;\n\n /// @dev Gets the memory address for a byte array.\n /// @param input Byte array to lookup.\n /// @return memoryAddress Memory address of byte array. This\n /// points to the header of the byte array which contains\n /// the length.\n function rawAddress(bytes memory input)\n internal\n pure\n returns (uint256 memoryAddress)\n {\n assembly {\n memoryAddress := input\n }\n return memoryAddress;\n }\n \n /// @dev Gets the memory address for the contents of a byte array.\n /// @param input Byte array to lookup.\n /// @return memoryAddress Memory address of the contents of the byte array.\n function contentAddress(bytes memory input)\n internal\n pure\n returns (uint256 memoryAddress)\n {\n assembly {\n memoryAddress := add(input, 32)\n }\n return memoryAddress;\n }\n\n /// @dev Copies `length` bytes from memory location `source` to `dest`.\n /// @param dest memory address to copy bytes to.\n /// @param source memory address to copy bytes from.\n /// @param length number of bytes to copy.\n function memCopy(\n uint256 dest,\n uint256 source,\n uint256 length\n )\n internal\n pure\n {\n if (length < 32) {\n // Handle a partial word by reading destination and masking\n // off the bits we are interested in.\n // This correctly handles overlap, zero lengths and source == dest\n assembly {\n let mask := sub(exp(256, sub(32, length)), 1)\n let s := and(mload(source), not(mask))\n let d := and(mload(dest), mask)\n mstore(dest, or(s, d))\n }\n } else {\n // Skip the O(length) loop when source == dest.\n if (source == dest) {\n return;\n }\n\n // For large copies we copy whole words at a time. The final\n // word is aligned to the end of the range (instead of after the\n // previous) to handle partial words. So a copy will look like this:\n //\n // ####\n // ####\n // ####\n // ####\n //\n // We handle overlap in the source and destination range by\n // changing the copying direction. This prevents us from\n // overwriting parts of source that we still need to copy.\n //\n // This correctly handles source == dest\n //\n if (source > dest) {\n assembly {\n // We subtract 32 from `sEnd` and `dEnd` because it\n // is easier to compare with in the loop, and these\n // are also the addresses we need for copying the\n // last bytes.\n length := sub(length, 32)\n let sEnd := add(source, length)\n let dEnd := add(dest, length)\n\n // Remember the last 32 bytes of source\n // This needs to be done here and not after the loop\n // because we may have overwritten the last bytes in\n // source already due to overlap.\n let last := mload(sEnd)\n\n // Copy whole words front to back\n // Note: the first check is always true,\n // this could have been a do-while loop.\n // solhint-disable-next-line no-empty-blocks\n for {} lt(source, sEnd) {} {\n mstore(dest, mload(source))\n source := add(source, 32)\n dest := add(dest, 32)\n }\n \n // Write the last 32 bytes\n mstore(dEnd, last)\n }\n } else {\n assembly {\n // We subtract 32 from `sEnd` and `dEnd` because those\n // are the starting points when copying a word at the end.\n length := sub(length, 32)\n let sEnd := add(source, length)\n let dEnd := add(dest, length)\n\n // Remember the first 32 bytes of source\n // This needs to be done here and not after the loop\n // because we may have overwritten the first bytes in\n // source already due to overlap.\n let first := mload(source)\n\n // Copy whole words back to front\n // We use a signed comparisson here to allow dEnd to become\n // negative (happens when source and dest < 32). Valid\n // addresses in local memory will never be larger than\n // 2**255, so they can be safely re-interpreted as signed.\n // Note: the first check is always true,\n // this could have been a do-while loop.\n // solhint-disable-next-line no-empty-blocks\n for {} slt(dest, dEnd) {} {\n mstore(dEnd, mload(sEnd))\n sEnd := sub(sEnd, 32)\n dEnd := sub(dEnd, 32)\n }\n \n // Write the first 32 bytes\n mstore(dest, first)\n }\n }\n }\n }\n\n /// @dev Returns a slices from a byte array.\n /// @param b The byte array to take a slice from.\n /// @param from The starting index for the slice (inclusive).\n /// @param to The final index for the slice (exclusive).\n /// @return result The slice containing bytes at indices [from, to)\n function slice(\n bytes memory b,\n uint256 from,\n uint256 to\n )\n internal\n pure\n returns (bytes memory result)\n {\n require(\n from <= to,\n \"FROM_LESS_THAN_TO_REQUIRED\"\n );\n require(\n to < b.length,\n \"TO_LESS_THAN_LENGTH_REQUIRED\"\n );\n \n // Create a new bytes structure and copy contents\n result = new bytes(to - from);\n memCopy(\n result.contentAddress(),\n b.contentAddress() + from,\n result.length);\n return result;\n }\n \n /// @dev Returns a slice from a byte array without preserving the input.\n /// @param b The byte array to take a slice from. Will be destroyed in the process.\n /// @param from The starting index for the slice (inclusive).\n /// @param to The final index for the slice (exclusive).\n /// @return result The slice containing bytes at indices [from, to)\n /// @dev When `from == 0`, the original array will match the slice. In other cases its state will be corrupted.\n function sliceDestructive(\n bytes memory b,\n uint256 from,\n uint256 to\n )\n internal\n pure\n returns (bytes memory result)\n {\n require(\n from <= to,\n \"FROM_LESS_THAN_TO_REQUIRED\"\n );\n require(\n to < b.length,\n \"TO_LESS_THAN_LENGTH_REQUIRED\"\n );\n \n // Create a new bytes structure around [from, to) in-place.\n assembly {\n result := add(b, from)\n mstore(result, sub(to, from))\n }\n return result;\n }\n\n /// @dev Pops the last byte off of a byte array by modifying its length.\n /// @param b Byte array that will be modified.\n /// @return The byte that was popped off.\n function popLastByte(bytes memory b)\n internal\n pure\n returns (bytes1 result)\n {\n require(\n b.length > 0,\n \"GREATER_THAN_ZERO_LENGTH_REQUIRED\"\n );\n\n // Store last byte.\n result = b[b.length - 1];\n\n assembly {\n // Decrement length of byte array.\n let newLen := sub(mload(b), 1)\n mstore(b, newLen)\n }\n return result;\n }\n\n /// @dev Pops the last 20 bytes off of a byte array by modifying its length.\n /// @param b Byte array that will be modified.\n /// @return The 20 byte address that was popped off.\n function popLast20Bytes(bytes memory b)\n internal\n pure\n returns (address result)\n {\n require(\n b.length >= 20,\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Store last 20 bytes.\n result = readAddress(b, b.length - 20);\n\n assembly {\n // Subtract 20 from byte array length.\n let newLen := sub(mload(b), 20)\n mstore(b, newLen)\n }\n return result;\n }\n\n /// @dev Tests equality of two byte arrays.\n /// @param lhs First byte array to compare.\n /// @param rhs Second byte array to compare.\n /// @return True if arrays are the same. False otherwise.\n function equals(\n bytes memory lhs,\n bytes memory rhs\n )\n internal\n pure\n returns (bool equal)\n {\n // Keccak gas cost is 30 + numWords * 6. This is a cheap way to compare.\n // We early exit on unequal lengths, but keccak would also correctly\n // handle this.\n return lhs.length == rhs.length && keccak256(lhs) == keccak256(rhs);\n }\n\n /// @dev Reads an address from a position in a byte array.\n /// @param b Byte array containing an address.\n /// @param index Index in byte array of address.\n /// @return address from byte array.\n function readAddress(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (address result)\n {\n require(\n b.length >= index + 20, // 20 is length of address\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Add offset to index:\n // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)\n // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)\n index += 20;\n\n // Read address from array memory\n assembly {\n // 1. Add index to address of bytes array\n // 2. Load 32-byte word from memory\n // 3. Apply 20-byte mask to obtain address\n result := and(mload(add(b, index)), 0xffffffffffffffffffffffffffffffffffffffff)\n }\n return result;\n }\n\n /// @dev Writes an address into a specific position in a byte array.\n /// @param b Byte array to insert address into.\n /// @param index Index in byte array of address.\n /// @param input Address to put into byte array.\n function writeAddress(\n bytes memory b,\n uint256 index,\n address input\n )\n internal\n pure\n {\n require(\n b.length >= index + 20, // 20 is length of address\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Add offset to index:\n // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)\n // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)\n index += 20;\n\n // Store address into array memory\n assembly {\n // The address occupies 20 bytes and mstore stores 32 bytes.\n // First fetch the 32-byte word where we'll be storing the address, then\n // apply a mask so we have only the bytes in the word that the address will not occupy.\n // Then combine these bytes with the address and store the 32 bytes back to memory with mstore.\n\n // 1. Add index to address of bytes array\n // 2. Load 32-byte word from memory\n // 3. Apply 12-byte mask to obtain extra bytes occupying word of memory where we'll store the address\n let neighbors := and(\n mload(add(b, index)),\n 0xffffffffffffffffffffffff0000000000000000000000000000000000000000\n )\n \n // Make sure input address is clean.\n // (Solidity does not guarantee this)\n input := and(input, 0xffffffffffffffffffffffffffffffffffffffff)\n\n // Store the neighbors and address into memory\n mstore(add(b, index), xor(input, neighbors))\n }\n }\n\n /// @dev Reads a bytes32 value from a position in a byte array.\n /// @param b Byte array containing a bytes32 value.\n /// @param index Index in byte array of bytes32 value.\n /// @return bytes32 value from byte array.\n function readBytes32(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes32 result)\n {\n require(\n b.length >= index + 32,\n \"GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 256 bit length parameter\n index += 32;\n\n // Read the bytes32 from array memory\n assembly {\n result := mload(add(b, index))\n }\n return result;\n }\n\n /// @dev Writes a bytes32 into a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input bytes32 to put into byte array.\n function writeBytes32(\n bytes memory b,\n uint256 index,\n bytes32 input\n )\n internal\n pure\n {\n require(\n b.length >= index + 32,\n \"GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 256 bit length parameter\n index += 32;\n\n // Read the bytes32 from array memory\n assembly {\n mstore(add(b, index), input)\n }\n }\n\n /// @dev Reads a uint256 value from a position in a byte array.\n /// @param b Byte array containing a uint256 value.\n /// @param index Index in byte array of uint256 value.\n /// @return uint256 value from byte array.\n function readUint256(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (uint256 result)\n {\n return uint256(readBytes32(b, index));\n }\n\n /// @dev Writes a uint256 into a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input uint256 to put into byte array.\n function writeUint256(\n bytes memory b,\n uint256 index,\n uint256 input\n )\n internal\n pure\n {\n writeBytes32(b, index, bytes32(input));\n }\n\n /// @dev Reads an unpadded bytes4 value from a position in a byte array.\n /// @param b Byte array containing a bytes4 value.\n /// @param index Index in byte array of bytes4 value.\n /// @return bytes4 value from byte array.\n function readBytes4(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes4 result)\n {\n require(\n b.length >= index + 4,\n \"GREATER_OR_EQUAL_TO_4_LENGTH_REQUIRED\"\n );\n assembly {\n result := mload(add(b, 32))\n // Solidity does not require us to clean the trailing bytes.\n // We do it anyway\n result := and(result, 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000)\n }\n return result;\n }\n\n /// @dev Reads nested bytes from a specific position.\n /// @dev NOTE: the returned value overlaps with the input value.\n /// Both should be treated as immutable.\n /// @param b Byte array containing nested bytes.\n /// @param index Index of nested bytes.\n /// @return result Nested bytes.\n function readBytesWithLength(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes memory result)\n {\n // Read length of nested bytes\n uint256 nestedBytesLength = readUint256(b, index);\n index += 32;\n\n // Assert length of <b> is valid, given\n // length of nested bytes\n require(\n b.length >= index + nestedBytesLength,\n \"GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED\"\n );\n \n // Return a pointer to the byte array as it exists inside `b`\n assembly {\n result := add(b, index)\n }\n return result;\n }\n\n /// @dev Inserts bytes at a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input bytes to insert.\n function writeBytesWithLength(\n bytes memory b,\n uint256 index,\n bytes memory input\n )\n internal\n pure\n {\n // Assert length of <b> is valid, given\n // length of input\n require(\n b.length >= index + 32 + input.length, // 32 bytes to store length\n \"GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED\"\n );\n\n // Copy <input> into <b>\n memCopy(\n b.contentAddress() + index,\n input.rawAddress(), // includes length of <input>\n input.length + 32 // +32 bytes to store <input> length\n );\n }\n\n /// @dev Performs a deep copy of a byte array onto another byte array of greater than or equal length.\n /// @param dest Byte array that will be overwritten with source bytes.\n /// @param source Byte array to copy onto dest bytes.\n function deepCopyBytes(\n bytes memory dest,\n bytes memory source\n )\n internal\n pure\n {\n uint256 sourceLen = source.length;\n // Dest length must be >= source length, or some bytes would not be copied.\n require(\n dest.length >= sourceLen,\n \"GREATER_OR_EQUAL_TO_SOURCE_BYTES_LENGTH_REQUIRED\"\n );\n memCopy(\n dest.contentAddress(),\n source.contentAddress(),\n sourceLen\n );\n }\n}\n",
- "2.0.0/utils/Ownable/IOwnable.sol": "pragma solidity 0.4.24;\n\n/*\n * Ownable\n *\n * Base contract with an owner.\n * Provides onlyOwner modifier, which prevents function from running if it is called by anyone other than the owner.\n */\n\ncontract IOwnable {\n function transferOwnership(address newOwner)\n public;\n}\n",
- "2.0.0/utils/Ownable/Ownable.sol": "pragma solidity 0.4.24;\n\n/*\n * Ownable\n *\n * Base contract with an owner.\n * Provides onlyOwner modifier, which prevents function from running if it is called by anyone other than the owner.\n */\n\nimport \"./IOwnable.sol\";\n\n\ncontract Ownable is IOwnable {\n address public owner;\n\n constructor ()\n public\n {\n owner = msg.sender;\n }\n\n modifier onlyOwner() {\n require(\n msg.sender == owner,\n \"ONLY_CONTRACT_OWNER\"\n );\n _;\n }\n\n function transferOwnership(address newOwner)\n public\n onlyOwner\n {\n if (newOwner != address(0)) {\n owner = newOwner;\n }\n }\n}\n",
- "2.0.0/utils/SafeMath/SafeMath.sol": "pragma solidity 0.4.24;\n\n\ncontract SafeMath {\n function safeMul(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n if (a == 0) {\n return 0;\n }\n uint256 c = a * b;\n require(\n c / a == b,\n \"UINT256_OVERFLOW\"\n );\n return c;\n }\n\n function safeDiv(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n uint256 c = a / b;\n return c;\n }\n\n function safeSub(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n require(\n b <= a,\n \"UINT256_UNDERFLOW\"\n );\n return a - b;\n }\n\n function safeAdd(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n uint256 c = a + b;\n require(\n c >= a,\n \"UINT256_OVERFLOW\"\n );\n return c;\n }\n\n function max64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n\n function max256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n}\n"
- },
- "sourceTreeHashHex": "0x560b257f8a4e1420a4586d5ba0c40e74042ef5af0f53aad412951444ea710a7e",
- "compiler": {
- "name": "solc",
- "version": "soljson-v0.4.24+commit.e67f0147.js",
- "settings": {
- "optimizer": {
- "enabled": true,
- "runs": 1000000
- },
- "outputSelection": {
- "*": {
- "*": [
- "abi",
- "evm.bytecode.object",
- "evm.bytecode.sourceMap",
- "evm.deployedBytecode.object",
- "evm.deployedBytecode.sourceMap"
- ]
- }
- }
- }
- },
- "networks": {}
-} \ No newline at end of file
diff --git a/packages/migrations/artifacts/2.0.0/IWallet.json b/packages/migrations/artifacts/2.0.0/IWallet.json
deleted file mode 100644
index df892d360..000000000
--- a/packages/migrations/artifacts/2.0.0/IWallet.json
+++ /dev/null
@@ -1,316 +0,0 @@
-{
- "schemaVersion": "2.0.0",
- "contractName": "IWallet",
- "compilerOutput": {
- "abi": [
- {
- "constant": true,
- "inputs": [
- {
- "name": "hash",
- "type": "bytes32"
- },
- {
- "name": "signature",
- "type": "bytes"
- }
- ],
- "name": "isValidSignature",
- "outputs": [
- {
- "name": "isValid",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- }
- ],
- "evm": {
- "bytecode": {
- "linkReferences": {},
- "object": "0x",
- "opcodes": "",
- "sourceMap": ""
- },
- "deployedBytecode": {
- "linkReferences": {},
- "object": "0x",
- "opcodes": "",
- "sourceMap": ""
- }
- }
- },
- "sources": {
- "2.0.0/extensions/Forwarder/Forwarder.sol": {
- "id": 0
- },
- "2.0.0/extensions/Forwarder/MixinAssets.sol": {
- "id": 1
- },
- "2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol": {
- "id": 2
- },
- "2.0.0/extensions/Forwarder/MixinForwarderCore.sol": {
- "id": 3
- },
- "2.0.0/extensions/Forwarder/MixinWeth.sol": {
- "id": 4
- },
- "2.0.0/extensions/Forwarder/interfaces/IAssets.sol": {
- "id": 5
- },
- "2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol": {
- "id": 6
- },
- "2.0.0/extensions/Forwarder/libs/LibConstants.sol": {
- "id": 7
- },
- "2.0.0/extensions/Forwarder/mixins/MAssets.sol": {
- "id": 8
- },
- "2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol": {
- "id": 9
- },
- "2.0.0/extensions/Forwarder/mixins/MWeth.sol": {
- "id": 10
- },
- "2.0.0/extensions/OrderValidator/OrderValidator.sol": {
- "id": 11
- },
- "2.0.0/protocol/AssetProxy/ERC20Proxy.sol": {
- "id": 12
- },
- "2.0.0/protocol/AssetProxy/ERC721Proxy.sol": {
- "id": 13
- },
- "2.0.0/protocol/AssetProxy/MixinAuthorizable.sol": {
- "id": 14
- },
- "2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol": {
- "id": 15
- },
- "2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol": {
- "id": 16
- },
- "2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol": {
- "id": 17
- },
- "2.0.0/protocol/Exchange/Exchange.sol": {
- "id": 18
- },
- "2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol": {
- "id": 19
- },
- "2.0.0/protocol/Exchange/MixinExchangeCore.sol": {
- "id": 20
- },
- "2.0.0/protocol/Exchange/MixinMatchOrders.sol": {
- "id": 21
- },
- "2.0.0/protocol/Exchange/MixinSignatureValidator.sol": {
- "id": 22
- },
- "2.0.0/protocol/Exchange/MixinTransactions.sol": {
- "id": 23
- },
- "2.0.0/protocol/Exchange/MixinWrapperFunctions.sol": {
- "id": 24
- },
- "2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol": {
- "id": 25
- },
- "2.0.0/protocol/Exchange/interfaces/IExchange.sol": {
- "id": 26
- },
- "2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol": {
- "id": 27
- },
- "2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol": {
- "id": 28
- },
- "2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol": {
- "id": 29
- },
- "2.0.0/protocol/Exchange/interfaces/ITransactions.sol": {
- "id": 30
- },
- "2.0.0/protocol/Exchange/interfaces/IValidator.sol": {
- "id": 31
- },
- "2.0.0/protocol/Exchange/interfaces/IWallet.sol": {
- "id": 32
- },
- "2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol": {
- "id": 33
- },
- "2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol": {
- "id": 34
- },
- "2.0.0/protocol/Exchange/libs/LibConstants.sol": {
- "id": 35
- },
- "2.0.0/protocol/Exchange/libs/LibEIP712.sol": {
- "id": 36
- },
- "2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol": {
- "id": 37
- },
- "2.0.0/protocol/Exchange/libs/LibFillResults.sol": {
- "id": 38
- },
- "2.0.0/protocol/Exchange/libs/LibMath.sol": {
- "id": 39
- },
- "2.0.0/protocol/Exchange/libs/LibOrder.sol": {
- "id": 40
- },
- "2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol": {
- "id": 41
- },
- "2.0.0/protocol/Exchange/mixins/MExchangeCore.sol": {
- "id": 42
- },
- "2.0.0/protocol/Exchange/mixins/MMatchOrders.sol": {
- "id": 43
- },
- "2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol": {
- "id": 44
- },
- "2.0.0/protocol/Exchange/mixins/MTransactions.sol": {
- "id": 45
- },
- "2.0.0/test/DummyERC20Token/DummyERC20Token.sol": {
- "id": 46
- },
- "2.0.0/test/DummyERC721Token/DummyERC721Token.sol": {
- "id": 47
- },
- "2.0.0/tokens/ERC20Token/ERC20Token.sol": {
- "id": 48
- },
- "2.0.0/tokens/ERC20Token/IERC20Token.sol": {
- "id": 49
- },
- "2.0.0/tokens/ERC20Token/MintableERC20Token.sol": {
- "id": 50
- },
- "2.0.0/tokens/ERC20Token/UnlimitedAllowanceERC20Token.sol": {
- "id": 51
- },
- "2.0.0/tokens/ERC721Token/ERC721Token.sol": {
- "id": 52
- },
- "2.0.0/tokens/ERC721Token/IERC721Receiver.sol": {
- "id": 53
- },
- "2.0.0/tokens/ERC721Token/IERC721Token.sol": {
- "id": 54
- },
- "2.0.0/tokens/ERC721Token/MintableERC721Token.sol": {
- "id": 55
- },
- "2.0.0/tokens/EtherToken/IEtherToken.sol": {
- "id": 56
- },
- "2.0.0/utils/LibBytes/LibBytes.sol": {
- "id": 57
- },
- "2.0.0/utils/Ownable/IOwnable.sol": {
- "id": 58
- },
- "2.0.0/utils/Ownable/Ownable.sol": {
- "id": 59
- },
- "2.0.0/utils/SafeMath/SafeMath.sol": {
- "id": 60
- }
- },
- "sourceCodes": {
- "2.0.0/extensions/Forwarder/Forwarder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./MixinWeth.sol\";\nimport \"./MixinForwarderCore.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./MixinAssets.sol\";\nimport \"./MixinExchangeWrapper.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract Forwarder is\n LibConstants,\n MixinWeth,\n MixinAssets,\n MixinExchangeWrapper,\n MixinForwarderCore\n{\n\n constructor (\n address _exchange,\n bytes memory _zrxAssetData,\n bytes memory _wethAssetData\n )\n public\n LibConstants(\n _exchange,\n _zrxAssetData,\n _wethAssetData\n )\n MixinForwarderCore()\n {}\n}\n",
- "2.0.0/extensions/Forwarder/MixinAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"../../tokens/ERC20Token/IERC20Token.sol\";\nimport \"../../tokens/ERC721Token/IERC721Token.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MAssets.sol\";\n\n\ncontract MixinAssets is\n Ownable,\n LibConstants,\n MAssets\n{\n\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_TRANSFER_SELECTOR = bytes4(keccak256(\"transfer(address,uint256)\"));\n\n /// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to \n /// function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be\n /// used to withdraw assets that were accidentally sent to this contract.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of ERC20 token to withdraw.\n function withdrawAsset(\n bytes assetData,\n uint256 amount\n )\n external\n onlyOwner\n {\n transferAssetToSender(assetData, amount);\n }\n\n /// @dev Transfers given amount of asset to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferAssetToSender(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n bytes4 proxyId = assetData.readBytes4(0);\n\n if (proxyId == ERC20_DATA_ID) {\n transferERC20Token(assetData, amount);\n } else if (proxyId == ERC721_DATA_ID) {\n transferERC721Token(assetData, amount);\n } else {\n revert(\"UNSUPPORTED_ASSET_PROXY\");\n }\n }\n\n /// @dev Decodes ERC20 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC20Token(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n address token = assetData.readAddress(16);\n\n // Transfer tokens.\n // We do a raw call so we can check the success separate\n // from the return data.\n bool success = token.call(abi.encodeWithSelector(\n ERC20_TRANSFER_SELECTOR,\n msg.sender,\n amount\n ));\n require(\n success,\n \"TRANSFER_FAILED\"\n );\n \n // Check return data.\n // If there is no return data, we assume the token incorrectly\n // does not return a bool. In this case we expect it to revert\n // on failure, which was handled above.\n // If the token does return data, we require that it is a single\n // value that evaluates to true.\n assembly {\n if returndatasize {\n success := 0\n if eq(returndatasize, 32) {\n // First 64 bytes of memory are reserved scratch space\n returndatacopy(0, 0, 32)\n success := mload(0)\n }\n }\n }\n require(\n success,\n \"TRANSFER_FAILED\"\n );\n }\n\n /// @dev Decodes ERC721 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC721Token(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n require(\n amount == 1,\n \"INVALID_AMOUNT\"\n );\n // Decode asset data.\n address token = assetData.readAddress(16);\n uint256 tokenId = assetData.readUint256(36);\n\n // Perform transfer.\n IERC721Token(token).transferFrom(\n address(this),\n msg.sender,\n tokenId\n );\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MExchangeWrapper.sol\";\nimport \"../../protocol/Exchange/libs/LibAbiEncoder.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../protocol/Exchange/libs/LibFillResults.sol\";\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\n\n\ncontract MixinExchangeWrapper is\n LibAbiEncoder,\n LibFillResults,\n LibMath,\n LibConstants,\n MExchangeWrapper\n{\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n // ABI encode calldata for `fillOrder`\n bytes memory fillOrderCalldata = abiEncodeFillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n\n address exchange = address(EXCHANGE);\n\n // Call `fillOrder` and handle any exceptions gracefully\n assembly {\n let success := call(\n gas, // forward all gas, TODO: look into gas consumption of assert/throw\n exchange, // call address of Exchange contract\n 0, // transfer 0 wei\n add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes)\n mload(fillOrderCalldata), // length of input\n fillOrderCalldata, // write output over input\n 128 // output size is 128 bytes\n )\n switch success\n case 0 {\n mstore(fillResults, 0)\n mstore(add(fillResults, 32), 0)\n mstore(add(fillResults, 64), 0)\n mstore(add(fillResults, 96), 0)\n }\n case 1 {\n mstore(fillResults, mload(fillOrderCalldata))\n mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32)))\n mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64)))\n mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96)))\n }\n }\n return fillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of WETH has been sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param wethSellAmount Desired amount of WETH to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellWeth(\n LibOrder.Order[] memory orders,\n uint256 wethSellAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // We assume that asset being sold by taker is WETH for each order.\n orders[i].makerAssetData = makerAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of WETH to sell\n uint256 remainingTakerAssetFillAmount = safeSub(wethSellAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of WETH\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= wethSellAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// The asset being sold by taker must always be WETH.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyExactAmountWithWeth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // We assume that asset being sold by taker is WETH for each order.\n orders[i].makerAssetData = makerAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmount(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n uint256 makerAssetFilledAmount = totalFillResults.makerAssetFilledAmount;\n if (makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n\n require(\n makerAssetFilledAmount >= makerAssetFillAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return totalFillResults;\n }\n\n /// @dev Buys zrxBuyAmount of ZRX fee tokens, taking into account ZRX fees for each order. This will guarantee\n /// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues).\n /// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX\n /// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases.\n /// The asset being sold by taker must always be WETH. \n /// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset.\n /// @param zrxBuyAmount Desired amount of ZRX to buy.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return totalFillResults Amounts filled and fees paid by maker and taker.\n function marketBuyExactZrxWithWeth(\n LibOrder.Order[] memory orders,\n uint256 zrxBuyAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n // Do nothing if zrxBuyAmount == 0\n if (zrxBuyAmount == 0) {\n return totalFillResults;\n }\n\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n uint256 zrxPurchased = 0;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // All of these are ZRX/WETH, so we can drop the respective assetData from calldata.\n orders[i].makerAssetData = zrxAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of ZRX to buy.\n uint256 remainingZrxBuyAmount = safeSub(zrxBuyAmount, zrxPurchased);\n\n // Convert the remaining amount of ZRX to buy into remaining amount\n // of WETH to sell, assuming entire amount can be sold in the current order.\n uint256 remainingWethSellAmount = getPartialAmount(\n orders[i].takerAssetAmount,\n safeSub(orders[i].makerAssetAmount, orders[i].takerFee), // our exchange rate after fees \n remainingZrxBuyAmount\n );\n\n // Attempt to sell the remaining amount of WETH.\n FillResults memory singleFillResult = fillOrderNoThrow(\n orders[i],\n safeAdd(remainingWethSellAmount, 1), // we add 1 wei to the fill amount to make up for rounding errors\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker.\n addFillResults(totalFillResults, singleFillResult);\n zrxPurchased = safeSub(totalFillResults.makerAssetFilledAmount, totalFillResults.takerFeePaid);\n\n // Stop execution if the entire amount of ZRX has been bought.\n if (zrxPurchased >= zrxBuyAmount) {\n break;\n }\n }\n\n require(\n zrxPurchased >= zrxBuyAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return totalFillResults;\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinForwarderCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MWeth.sol\";\nimport \"./mixins/MAssets.sol\";\nimport \"./mixins/MExchangeWrapper.sol\";\nimport \"./interfaces/IForwarderCore.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../protocol/Exchange/libs/LibFillResults.sol\";\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\n\n\ncontract MixinForwarderCore is\n LibFillResults,\n LibMath,\n LibConstants,\n MWeth,\n MAssets,\n MExchangeWrapper,\n IForwarderCore\n{\n\n using LibBytes for bytes;\n\n /// @dev Constructor approves ERC20 proxy to transfer ZRX and WETH on this contract's behalf.\n constructor ()\n public\n {\n address proxyAddress = EXCHANGE.getAssetProxy(ERC20_DATA_ID);\n if (proxyAddress != address(0)) {\n ETHER_TOKEN.approve(proxyAddress, MAX_UINT);\n ZRX_TOKEN.approve(proxyAddress, MAX_UINT);\n }\n }\n\n /// @dev Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketSellOrdersWithEth(\n LibOrder.Order[] memory orders,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n FillResults memory orderFillResults,\n FillResults memory feeOrderFillResults\n )\n {\n // Convert ETH to WETH.\n convertEthToWeth();\n\n uint256 wethSellAmount;\n uint256 zrxBuyAmount;\n uint256 makerAssetAmountPurchased;\n if (orders[0].makerAssetData.equals(ZRX_ASSET_DATA)) {\n // Calculate amount of WETH that won't be spent on ETH fees.\n wethSellAmount = getPartialAmount(\n PERCENTAGE_DENOMINATOR,\n safeAdd(PERCENTAGE_DENOMINATOR, feePercentage),\n msg.value\n );\n // Market sell available WETH.\n // ZRX fees are paid with this contract's balance.\n orderFillResults = marketSellWeth(\n orders,\n wethSellAmount,\n signatures\n );\n // The fee amount must be deducted from the amount transfered back to sender.\n makerAssetAmountPurchased = safeSub(orderFillResults.makerAssetFilledAmount, orderFillResults.takerFeePaid);\n } else {\n // 5% of WETH is reserved for filling feeOrders and paying feeRecipient.\n wethSellAmount = getPartialAmount(\n MAX_WETH_FILL_PERCENTAGE,\n PERCENTAGE_DENOMINATOR,\n msg.value\n );\n // Market sell 95% of WETH.\n // ZRX fees are payed with this contract's balance.\n orderFillResults = marketSellWeth(\n orders,\n wethSellAmount,\n signatures\n );\n // Buy back all ZRX spent on fees.\n zrxBuyAmount = orderFillResults.takerFeePaid;\n feeOrderFillResults = marketBuyExactZrxWithWeth(\n feeOrders,\n zrxBuyAmount,\n feeSignatures\n );\n makerAssetAmountPurchased = orderFillResults.makerAssetFilledAmount;\n }\n\n // Transfer feePercentage of total ETH spent on primary orders to feeRecipient.\n // Refund remaining ETH to msg.sender.\n transferEthFeeAndRefund(\n orderFillResults.takerAssetFilledAmount,\n feeOrderFillResults.takerAssetFilledAmount,\n feePercentage,\n feeRecipient\n );\n\n // Transfer purchased assets to msg.sender.\n transferAssetToSender(orders[0].makerAssetData, makerAssetAmountPurchased);\n }\n\n /// @dev Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param makerAssetFillAmount Desired amount of makerAsset to purchase.\n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketBuyOrdersWithEth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n FillResults memory orderFillResults,\n FillResults memory feeOrderFillResults\n )\n {\n // Convert ETH to WETH.\n convertEthToWeth();\n\n uint256 zrxBuyAmount;\n uint256 makerAssetAmountPurchased;\n if (orders[0].makerAssetData.equals(ZRX_ASSET_DATA)) {\n // If the makerAsset is ZRX, it is not necessary to pay fees out of this\n // contracts's ZRX balance because fees are factored into the price of the order.\n orderFillResults = marketBuyExactZrxWithWeth(\n orders,\n makerAssetFillAmount,\n signatures\n );\n // The fee amount must be deducted from the amount transfered back to sender.\n makerAssetAmountPurchased = safeSub(orderFillResults.makerAssetFilledAmount, orderFillResults.takerFeePaid);\n } else {\n // Attemp to purchase desired amount of makerAsset.\n // ZRX fees are payed with this contract's balance.\n orderFillResults = marketBuyExactAmountWithWeth(\n orders,\n makerAssetFillAmount,\n signatures\n );\n // Buy back all ZRX spent on fees.\n zrxBuyAmount = orderFillResults.takerFeePaid;\n feeOrderFillResults = marketBuyExactZrxWithWeth(\n feeOrders,\n zrxBuyAmount,\n feeSignatures\n );\n makerAssetAmountPurchased = orderFillResults.makerAssetFilledAmount;\n }\n\n // Transfer feePercentage of total ETH spent on primary orders to feeRecipient.\n // Refund remaining ETH to msg.sender.\n transferEthFeeAndRefund(\n orderFillResults.takerAssetFilledAmount,\n feeOrderFillResults.takerAssetFilledAmount,\n feePercentage,\n feeRecipient\n );\n\n // Transfer purchased assets to msg.sender.\n transferAssetToSender(orders[0].makerAssetData, makerAssetAmountPurchased);\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinWeth.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MWeth.sol\";\n\n\ncontract MixinWeth is\n LibMath,\n LibConstants,\n MWeth\n{\n\n /// @dev Default payabale function, this allows us to withdraw WETH\n function ()\n public\n payable\n {\n require(\n msg.sender == address(ETHER_TOKEN),\n \"DEFAULT_FUNCTION_WETH_CONTRACT_ONLY\"\n );\n }\n\n /// @dev Converts message call's ETH value into WETH.\n function convertEthToWeth()\n internal\n {\n require(\n msg.value > 0,\n \"INVALID_MSG_VALUE\"\n );\n ETHER_TOKEN.deposit.value(msg.value)();\n }\n\n /// @dev Transfers feePercentage of WETH spent on primary orders to feeRecipient.\n /// Refunds any excess ETH to msg.sender.\n /// @param wethSoldExcludingFeeOrders Amount of WETH sold when filling primary orders.\n /// @param wethSoldForZrx Amount of WETH sold when purchasing ZRX required for primary order fees.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n function transferEthFeeAndRefund(\n uint256 wethSoldExcludingFeeOrders,\n uint256 wethSoldForZrx,\n uint256 feePercentage,\n address feeRecipient\n )\n internal\n {\n // Ensure feePercentage is less than 5%.\n require(\n feePercentage <= MAX_FEE_PERCENTAGE,\n \"FEE_PERCENTAGE_TOO_LARGE\"\n );\n\n // Ensure that no extra WETH owned by this contract has been sold.\n uint256 wethSold = safeAdd(wethSoldExcludingFeeOrders, wethSoldForZrx);\n require(\n wethSold <= msg.value,\n \"OVERSOLD_WETH\"\n );\n\n // Calculate amount of WETH that hasn't been sold.\n uint256 wethRemaining = safeSub(msg.value, wethSold);\n\n // Calculate ETH fee to pay to feeRecipient.\n uint256 ethFee = getPartialAmount(\n feePercentage,\n PERCENTAGE_DENOMINATOR,\n wethSoldExcludingFeeOrders\n );\n\n // Ensure fee is less than amount of WETH remaining.\n require(\n ethFee <= wethRemaining,\n \"INSUFFICIENT_ETH_REMAINING\"\n );\n \n // Do nothing if no WETH remaining\n if (wethRemaining > 0) {\n // Convert remaining WETH to ETH\n ETHER_TOKEN.withdraw(wethRemaining);\n\n // Pay ETH to feeRecipient\n if (ethFee > 0) {\n feeRecipient.transfer(ethFee);\n }\n\n // Refund remaining ETH to msg.sender.\n uint256 ethRefund = safeSub(wethRemaining, ethFee);\n if (ethRefund > 0) {\n msg.sender.transfer(ethRefund);\n }\n }\n }\n}\n",
- "2.0.0/extensions/Forwarder/interfaces/IAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IAssets {\n\n /// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to \n /// function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be\n /// used to withdraw assets that were accidentally sent to this contract.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of ERC20 token to withdraw.\n function withdrawAsset(\n bytes assetData,\n uint256 amount\n )\n external;\n}\n",
- "2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../../protocol/Exchange/libs/LibFillResults.sol\";\n\n\ncontract IForwarderCore {\n\n /// @dev Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketSellOrdersWithEth(\n LibOrder.Order[] memory orders,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n LibFillResults.FillResults memory orderFillResults,\n LibFillResults.FillResults memory feeOrderFillResults\n );\n\n /// @dev Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param makerAssetFillAmount Desired amount of makerAsset to purchase.\n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketBuyOrdersWithEth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n LibFillResults.FillResults memory orderFillResults,\n LibFillResults.FillResults memory feeOrderFillResults\n );\n}\n",
- "2.0.0/extensions/Forwarder/libs/LibConstants.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/LibBytes/LibBytes.sol\";\nimport \"../../../protocol/Exchange/interfaces/IExchange.sol\";\nimport \"../../../tokens/EtherToken/IEtherToken.sol\";\nimport \"../../../tokens/ERC20Token/IERC20Token.sol\";\n\n\ncontract LibConstants {\n\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n uint256 constant internal MAX_UINT = 2**256 - 1;\n uint256 constant internal PERCENTAGE_DENOMINATOR = 10**18; \n uint256 constant internal MAX_FEE_PERCENTAGE = 5 * PERCENTAGE_DENOMINATOR / 100; // 5%\n uint256 constant internal MAX_WETH_FILL_PERCENTAGE = 95 * PERCENTAGE_DENOMINATOR / 100; // 95%\n \n // solhint-disable var-name-mixedcase\n IExchange internal EXCHANGE;\n IEtherToken internal ETHER_TOKEN;\n IERC20Token internal ZRX_TOKEN;\n bytes internal ZRX_ASSET_DATA;\n bytes internal WETH_ASSET_DATA;\n // solhint-enable var-name-mixedcase\n\n constructor (\n address _exchange,\n bytes memory _zrxAssetData,\n bytes memory _wethAssetData\n )\n public\n {\n EXCHANGE = IExchange(_exchange);\n ZRX_ASSET_DATA = _zrxAssetData;\n WETH_ASSET_DATA = _wethAssetData;\n\n address etherToken = _wethAssetData.readAddress(16);\n address zrxToken = _zrxAssetData.readAddress(16);\n ETHER_TOKEN = IEtherToken(etherToken);\n ZRX_TOKEN = IERC20Token(zrxToken);\n }\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAssets.sol\";\n\n\ncontract MAssets is\n IAssets\n{\n\n /// @dev Transfers given amount of asset to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferAssetToSender(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n\n /// @dev Decodes ERC20 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC20Token(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n\n /// @dev Decodes ERC721 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC721Token(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../../protocol/Exchange/libs/LibFillResults.sol\";\n\n\ncontract MExchangeWrapper {\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of WETH has been sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param wethSellAmount Desired amount of WETH to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellWeth(\n LibOrder.Order[] memory orders,\n uint256 wethSellAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// The asset being sold by taker must always be WETH.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyExactAmountWithWeth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Buys zrxBuyAmount of ZRX fee tokens, taking into account ZRX fees for each order. This will guarantee\n /// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues).\n /// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX\n /// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases.\n /// The asset being sold by taker must always be WETH. \n /// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset.\n /// @param zrxBuyAmount Desired amount of ZRX to buy.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return totalFillResults Amounts filled and fees paid by maker and taker.\n function marketBuyExactZrxWithWeth(\n LibOrder.Order[] memory orders,\n uint256 zrxBuyAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MWeth.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract MWeth {\n\n /// @dev Converts message call's ETH value into WETH.\n function convertEthToWeth()\n internal;\n\n /// @dev Transfers feePercentage of WETH spent on primary orders to feeRecipient.\n /// Refunds any excess ETH to msg.sender.\n /// @param wethSoldExcludingFeeOrders Amount of WETH sold when filling primary orders.\n /// @param wethSoldForZrx Amount of WETH sold when purchasing ZRX required for primary order fees.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n function transferEthFeeAndRefund(\n uint256 wethSoldExcludingFeeOrders,\n uint256 wethSoldForZrx,\n uint256 feePercentage,\n address feeRecipient\n )\n internal;\n}\n",
- "2.0.0/extensions/OrderValidator/OrderValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../protocol/Exchange/interfaces/IExchange.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../tokens/ERC20Token/IERC20Token.sol\";\nimport \"../../tokens/ERC721Token/IERC721Token.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\n\n\ncontract OrderValidator {\n\n bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n\n using LibBytes for bytes;\n\n struct TraderInfo {\n uint256 makerBalance; // Maker's balance of makerAsset\n uint256 makerAllowance; // Maker's allowance to corresponding AssetProxy\n uint256 takerBalance; // Taker's balance of takerAsset\n uint256 takerAllowance; // Taker's allowance to corresponding AssetProxy\n uint256 makerZrxBalance; // Maker's balance of ZRX\n uint256 makerZrxAllowance; // Maker's allowance of ZRX to ERC20Proxy\n uint256 takerZrxBalance; // Taker's balance of ZRX\n uint256 takerZrxAllowance; // Taker's allowance of ZRX to ERC20Proxy\n }\n\n // solhint-disable var-name-mixedcase\n IExchange internal EXCHANGE;\n bytes internal ZRX_ASSET_DATA;\n // solhint-enable var-name-mixedcase\n\n constructor (address _exchange, bytes memory _zrxAssetData)\n public\n {\n EXCHANGE = IExchange(_exchange);\n ZRX_ASSET_DATA = _zrxAssetData;\n }\n\n /// @dev Fetches information for order and maker/taker of order.\n /// @param order The order structure.\n /// @param takerAddress Address that will be filling the order.\n /// @return OrderInfo and TraderInfo instances for given order.\n function getOrderAndTraderInfo(LibOrder.Order memory order, address takerAddress)\n public\n view\n returns (LibOrder.OrderInfo memory orderInfo, TraderInfo memory traderInfo)\n {\n orderInfo = EXCHANGE.getOrderInfo(order);\n traderInfo = getTraderInfo(order, takerAddress);\n return (orderInfo, traderInfo);\n }\n\n /// @dev Fetches information for all passed in orders and the makers/takers of each order.\n /// @param orders Array of order specifications.\n /// @param takerAddresses Array of taker addresses corresponding to each order.\n /// @return Arrays of OrderInfo and TraderInfo instances that correspond to each order.\n function getOrdersAndTradersInfo(LibOrder.Order[] memory orders, address[] memory takerAddresses)\n public\n view\n returns (LibOrder.OrderInfo[] memory ordersInfo, TraderInfo[] memory tradersInfo)\n {\n ordersInfo = EXCHANGE.getOrdersInfo(orders);\n tradersInfo = getTradersInfo(orders, takerAddresses);\n return (ordersInfo, tradersInfo);\n }\n\n /// @dev Fetches balance and allowances for maker and taker of order.\n /// @param order The order structure.\n /// @param takerAddress Address that will be filling the order.\n /// @return Balances and allowances of maker and taker of order.\n function getTraderInfo(LibOrder.Order memory order, address takerAddress)\n public\n view\n returns (TraderInfo memory traderInfo)\n {\n (traderInfo.makerBalance, traderInfo.makerAllowance) = getBalanceAndAllowance(order.makerAddress, order.makerAssetData);\n (traderInfo.takerBalance, traderInfo.takerAllowance) = getBalanceAndAllowance(takerAddress, order.takerAssetData);\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n (traderInfo.makerZrxBalance, traderInfo.makerZrxAllowance) = getBalanceAndAllowance(order.makerAddress, zrxAssetData);\n (traderInfo.takerZrxBalance, traderInfo.takerZrxAllowance) = getBalanceAndAllowance(takerAddress, zrxAssetData);\n return traderInfo;\n }\n\n /// @dev Fetches balances and allowances of maker and taker for each provided order.\n /// @param orders Array of order specifications.\n /// @param takerAddresses Array of taker addresses corresponding to each order.\n /// @return Array of balances and allowances for maker and taker of each order.\n function getTradersInfo(LibOrder.Order[] memory orders, address[] memory takerAddresses)\n public\n view\n returns (TraderInfo[] memory)\n {\n uint256 ordersLength = orders.length;\n TraderInfo[] memory tradersInfo = new TraderInfo[](ordersLength);\n for (uint256 i = 0; i != ordersLength; i++) {\n tradersInfo[i] = getTraderInfo(orders[i], takerAddresses[i]);\n }\n return tradersInfo;\n }\n\n /// @dev Fetches token balances and allowances of an address to given assetProxy. Supports ERC20 and ERC721.\n /// @param target Address to fetch balances and allowances of.\n /// @param assetData Encoded data that can be decoded by a specified proxy contract when transferring asset.\n /// @return Balance of asset and allowance set to given proxy of asset.\n /// For ERC721 tokens, these values will always be 1 or 0.\n function getBalanceAndAllowance(address target, bytes memory assetData)\n public\n view\n returns (uint256 balance, uint256 allowance)\n {\n bytes4 assetProxyId = assetData.readBytes4(0);\n address token = assetData.readAddress(16);\n address assetProxy = EXCHANGE.getAssetProxy(assetProxyId);\n\n if (assetProxyId == ERC20_DATA_ID) {\n // Query balance\n balance = IERC20Token(token).balanceOf(target);\n\n // Query allowance\n allowance = IERC20Token(token).allowance(target, assetProxy);\n } else if (assetProxyId == ERC721_DATA_ID) {\n uint256 tokenId = assetData.readUint256(36);\n\n // Query owner of tokenId\n address owner = getERC721TokenOwner(token, tokenId);\n\n // Set balance to 1 if tokenId is owned by target\n balance = target == owner ? 1 : 0;\n\n // Check if ERC721Proxy is approved to spend tokenId\n bool isApproved = IERC721Token(token).isApprovedForAll(target, assetProxy) || IERC721Token(token).getApproved(tokenId) == assetProxy;\n \n // Set alowance to 1 if ERC721Proxy is approved to spend tokenId\n allowance = isApproved ? 1 : 0;\n } else {\n revert(\"UNSUPPORTED_ASSET_PROXY\");\n }\n return (balance, allowance);\n }\n\n /// @dev Fetches token balances and allowances of an address for each given assetProxy. Supports ERC20 and ERC721.\n /// @param target Address to fetch balances and allowances of.\n /// @param assetData Array of encoded byte arrays that can be decoded by a specified proxy contract when transferring asset.\n /// @return Balances and allowances of assets.\n /// For ERC721 tokens, these values will always be 1 or 0.\n function getBalancesAndAllowances(address target, bytes[] memory assetData)\n public\n view\n returns (uint256[] memory, uint256[] memory)\n {\n uint256 length = assetData.length;\n uint256[] memory balances = new uint256[](length);\n uint256[] memory allowances = new uint256[](length);\n for (uint256 i = 0; i != length; i++) {\n (balances[i], allowances[i]) = getBalanceAndAllowance(target, assetData[i]);\n }\n return (balances, allowances);\n }\n\n /// @dev Calls `token.ownerOf(tokenId)`, but returns a null owner instead of reverting on an unowned token.\n /// @param token Address of ERC721 token.\n /// @param tokenId The identifier for the specific NFT.\n /// @return Owner of tokenId or null address if unowned.\n function getERC721TokenOwner(address token, uint256 tokenId)\n public\n view\n returns (address owner)\n {\n assembly {\n // load free memory pointer\n let cdStart := mload(64)\n\n // bytes4(keccak256(ownerOf(uint256))) = 0x6352211e\n mstore(cdStart, 0x6352211e00000000000000000000000000000000000000000000000000000000)\n mstore(add(cdStart, 4), tokenId)\n\n // staticcall `ownerOf(tokenId)`\n // `ownerOf` will revert if tokenId is not owned\n let success := staticcall(\n gas, // forward all gas\n token, // call token contract\n cdStart, // start of calldata\n 36, // length of input is 36 bytes\n cdStart, // write output over input\n 32 // size of output is 32 bytes\n )\n\n // Success implies that tokenId is owned\n // Copy owner from return data if successful\n if success {\n owner := mload(cdStart)\n } \n }\n\n // Owner initialized to address(0), no need to modify if call is unsuccessful\n return owner;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/ERC20Proxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"./MixinAuthorizable.sol\";\n\n\ncontract ERC20Proxy is\n MixinAuthorizable\n{\n // Id of this proxy.\n bytes4 constant internal PROXY_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n \n // solhint-disable-next-line payable-fallback\n function () \n external\n {\n assembly {\n // The first 4 bytes of calldata holds the function selector\n let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)\n\n // `transferFrom` will be called with the following parameters:\n // assetData Encoded byte array.\n // from Address to transfer asset from.\n // to Address to transfer asset to.\n // amount Amount of asset to transfer.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {\n\n // To lookup a value in a mapping, we load from the storage location keccak256(k, p),\n // where k is the key left padded to 32 bytes and p is the storage slot\n let start := mload(64)\n mstore(start, and(caller, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(start, 32), authorized_slot)\n\n // Revert if authorized[msg.sender] == false\n if iszero(sload(keccak256(start, 64))) {\n // Revert with `Error(\"SENDER_NOT_AUTHORIZED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n \n /////// Token contract address ///////\n // The token address is found as follows:\n // * It is stored at offset 4 in `assetData` contents.\n // * This is stored at offset 32 from `assetData`.\n // * The offset to `assetData` from Params is stored at offset\n // 4 in calldata.\n // * The offset of Params in calldata is 4.\n // So we read location 4 and add 32 + 4 + 4 to it.\n let token := calldataload(add(calldataload(4), 40))\n \n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFrom` selector.\n // Any trailing data in transferFromSelector will be\n // overwritten in the next `mstore` call.\n mstore(0, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // We copy the fields `from`, `to` and `amount` in bulk\n // from our own calldata to the new calldata.\n calldatacopy(4, 36, 96)\n\n /////// Call `token.transferFrom` using the calldata ///////\n let success := call(\n gas, // forward all gas\n token, // call address of token contract\n 0, // don't send any ETH\n 0, // pointer to start of input\n 100, // length of input\n 0, // write output over input\n 32 // output size should be 32 bytes\n )\n\n /////// Check return data. ///////\n // If there is no return data, we assume the token incorrectly\n // does not return a bool. In this case we expect it to revert\n // on failure, which was handled above.\n // If the token does return data, we require that it is a single\n // nonzero 32 bytes value.\n // So the transfer succeeded if the call succeeded and either\n // returned nothing, or returned a non-zero 32 byte value. \n success := and(success, or(\n iszero(returndatasize),\n and(\n eq(returndatasize, 32),\n gt(mload(0), 0)\n )\n ))\n if success {\n return(0, 0)\n }\n \n // Revert with `Error(\"TRANSFER_FAILED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n }\n }\n\n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4)\n {\n return PROXY_ID;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/ERC721Proxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"./MixinAuthorizable.sol\";\n\n\ncontract ERC721Proxy is\n MixinAuthorizable\n{\n // Id of this proxy.\n bytes4 constant internal PROXY_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n\n // solhint-disable-next-line payable-fallback\n function () \n external\n {\n assembly {\n // The first 4 bytes of calldata holds the function selector\n let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)\n\n // `transferFrom` will be called with the following parameters:\n // assetData Encoded byte array.\n // from Address to transfer asset from.\n // to Address to transfer asset to.\n // amount Amount of asset to transfer.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {\n\n // To lookup a value in a mapping, we load from the storage location keccak256(k, p),\n // where k is the key left padded to 32 bytes and p is the storage slot\n let start := mload(64)\n mstore(start, and(caller, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(start, 32), authorized_slot)\n\n // Revert if authorized[msg.sender] == false\n if iszero(sload(keccak256(start, 64))) {\n // Revert with `Error(\"SENDER_NOT_AUTHORIZED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // `transferFrom`.\n // The function is marked `external`, so no abi decodeding is done for\n // us. Instead, we expect the `calldata` memory to contain the\n // following:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n //\n // (*): offset is computed from start of function parameters, so offset\n // by an additional 4 bytes in the calldata.\n //\n // WARNING: The ABIv2 specification allows additional padding between\n // the Params and Data section. This will result in a larger\n // offset to assetData.\n\n // Asset data itself is encoded as follows:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 2 * 32 | function parameters: |\n // | | 4 | 12 + 20 | 1. token address |\n // | | 36 | | 2. tokenId |\n \n // We construct calldata for the `token.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n // \n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 4 | | 1. from |\n // | | 36 | | 2. to |\n // | | 68 | | 3. tokenId |\n\n // There exists only 1 of each token.\n // require(amount == 1, \"INVALID_AMOUNT\")\n if sub(calldataload(100), 1) {\n // Revert with `Error(\"INVALID_AMOUNT\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000e494e56414c49445f414d4f554e540000000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFrom` selector.\n // Any trailing data in transferFromSelector will be\n // overwritten in the next `mstore` call.\n mstore(0, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // We copy the fields `from` and `to` in bulk\n // from our own calldata to the new calldata.\n calldatacopy(4, 36, 64)\n\n // Copy `tokenId` field from our own calldata to the new calldata.\n let assetDataOffset := calldataload(4)\n calldatacopy(68, add(assetDataOffset, 72), 32)\n\n /////// Call `token.transferFrom` using the calldata ///////\n let token := calldataload(add(assetDataOffset, 40))\n let success := call(\n gas, // forward all gas\n token, // call address of token contract\n 0, // don't send any ETH\n 0, // pointer to start of input\n 100, // length of input\n 0, // write output to null\n 0 // output size is 0 bytes\n )\n if success {\n return(0, 0)\n }\n \n // Revert with `Error(\"TRANSFER_FAILED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n }\n }\n\n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4)\n {\n return PROXY_ID;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/MixinAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"./mixins/MAuthorizable.sol\";\n\n\ncontract MixinAuthorizable is\n Ownable,\n MAuthorizable\n{\n\n /// @dev Only authorized addresses can invoke functions with this modifier.\n modifier onlyAuthorized {\n require(\n authorized[msg.sender],\n \"SENDER_NOT_AUTHORIZED\"\n );\n _;\n }\n\n mapping (address => bool) public authorized;\n address[] public authorities;\n\n /// @dev Authorizes an address.\n /// @param target Address to authorize.\n function addAuthorizedAddress(address target)\n external\n onlyOwner\n {\n require(\n !authorized[target],\n \"TARGET_ALREADY_AUTHORIZED\"\n );\n\n authorized[target] = true;\n authorities.push(target);\n emit AuthorizedAddressAdded(target, msg.sender);\n }\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n function removeAuthorizedAddress(address target)\n external\n onlyOwner\n {\n require(\n authorized[target],\n \"TARGET_NOT_AUTHORIZED\"\n );\n\n delete authorized[target];\n for (uint256 i = 0; i < authorities.length; i++) {\n if (authorities[i] == target) {\n authorities[i] = authorities[authorities.length - 1];\n authorities.length -= 1;\n break;\n }\n }\n emit AuthorizedAddressRemoved(target, msg.sender);\n }\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n /// @param index Index of target in authorities array.\n function removeAuthorizedAddressAtIndex(\n address target,\n uint256 index\n )\n external\n onlyOwner\n {\n require(\n authorized[target],\n \"TARGET_NOT_AUTHORIZED\"\n );\n require(\n index < authorities.length,\n \"INDEX_OUT_OF_BOUNDS\"\n );\n require(\n authorities[index] == target,\n \"AUTHORIZED_ADDRESS_MISMATCH\"\n );\n\n delete authorized[target];\n authorities[index] = authorities[authorities.length - 1];\n authorities.length -= 1;\n emit AuthorizedAddressRemoved(target, msg.sender);\n }\n\n /// @dev Gets all authorized addresses.\n /// @return Array of authorized addresses.\n function getAuthorizedAddresses()\n external\n view\n returns (address[] memory)\n {\n return authorities;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IAuthorizable.sol\";\n\n\ncontract IAssetProxy is\n IAuthorizable\n{\n\n /// @dev Transfers assets. Either succeeds or throws.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param from Address to transfer asset from.\n /// @param to Address to transfer asset to.\n /// @param amount Amount of asset to transfer.\n function transferFrom(\n bytes assetData,\n address from,\n address to,\n uint256 amount\n )\n external;\n \n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4);\n}\n",
- "2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/Ownable/IOwnable.sol\";\n\n\ncontract IAuthorizable is\n IOwnable\n{\n\n /// @dev Authorizes an address.\n /// @param target Address to authorize.\n function addAuthorizedAddress(address target)\n external;\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n function removeAuthorizedAddress(address target)\n external;\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n /// @param index Index of target in authorities array.\n function removeAuthorizedAddressAtIndex(\n address target,\n uint256 index\n )\n external;\n \n /// @dev Gets all authorized addresses.\n /// @return Array of authorized addresses.\n function getAuthorizedAddresses()\n external\n view\n returns (address[] memory);\n}\n",
- "2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAuthorizable.sol\";\n\n\ncontract MAuthorizable is\n IAuthorizable\n{\n\n // Event logged when a new address is authorized.\n event AuthorizedAddressAdded(\n address indexed target,\n address indexed caller\n );\n\n // Event logged when a currently authorized address is unauthorized.\n event AuthorizedAddressRemoved(\n address indexed target,\n address indexed caller\n );\n\n /// @dev Only authorized addresses can invoke functions with this modifier.\n modifier onlyAuthorized { revert(); _; }\n}\n",
- "2.0.0/protocol/Exchange/Exchange.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./MixinExchangeCore.sol\";\nimport \"./MixinSignatureValidator.sol\";\nimport \"./MixinWrapperFunctions.sol\";\nimport \"./MixinAssetProxyDispatcher.sol\";\nimport \"./MixinTransactions.sol\";\nimport \"./MixinMatchOrders.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract Exchange is\n MixinExchangeCore,\n MixinMatchOrders,\n MixinSignatureValidator,\n MixinTransactions,\n MixinAssetProxyDispatcher,\n MixinWrapperFunctions\n{\n\n string constant public VERSION = \"2.0.1-alpha\";\n\n // Mixins are instantiated in the order they are inherited\n constructor (bytes memory _zrxAssetData)\n public\n LibConstants(_zrxAssetData) // @TODO: Remove when we deploy.\n MixinExchangeCore()\n MixinMatchOrders()\n MixinSignatureValidator()\n MixinTransactions()\n MixinAssetProxyDispatcher()\n MixinWrapperFunctions()\n {}\n}\n",
- "2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\nimport \"../AssetProxy/interfaces/IAssetProxy.sol\";\n\n\ncontract MixinAssetProxyDispatcher is\n Ownable,\n MAssetProxyDispatcher\n{\n using LibBytes for bytes;\n \n // Mapping from Asset Proxy Id's to their respective Asset Proxy\n mapping (bytes4 => IAssetProxy) public assetProxies;\n\n /// @dev Registers an asset proxy to its asset proxy id.\n /// Once an asset proxy is registered, it cannot be unregistered.\n /// @param assetProxy Address of new asset proxy to register.\n function registerAssetProxy(address assetProxy)\n external\n onlyOwner\n {\n IAssetProxy assetProxyContract = IAssetProxy(assetProxy);\n\n // Ensure that no asset proxy exists with current id.\n bytes4 assetProxyId = assetProxyContract.getProxyId();\n address currentAssetProxy = assetProxies[assetProxyId];\n require(\n currentAssetProxy == address(0),\n \"ASSET_PROXY_ALREADY_EXISTS\"\n );\n\n // Add asset proxy and log registration.\n assetProxies[assetProxyId] = assetProxyContract;\n emit AssetProxyRegistered(\n assetProxyId,\n assetProxy\n );\n }\n\n /// @dev Gets an asset proxy.\n /// @param assetProxyId Id of the asset proxy.\n /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered.\n function getAssetProxy(bytes4 assetProxyId)\n external\n view\n returns (address)\n {\n return assetProxies[assetProxyId];\n }\n\n /// @dev Forwards arguments to assetProxy and calls `transferFrom`. Either succeeds or throws.\n /// @param assetData Byte array encoded for the asset.\n /// @param from Address to transfer token from.\n /// @param to Address to transfer token to.\n /// @param amount Amount of token to transfer.\n function dispatchTransferFrom(\n bytes memory assetData,\n address from,\n address to,\n uint256 amount\n )\n internal\n {\n // Do nothing if no amount should be transferred.\n if (amount > 0) {\n // Ensure assetData length is valid\n require(\n assetData.length > 3,\n \"LENGTH_GREATER_THAN_3_REQUIRED\"\n );\n \n // Lookup assetProxy\n bytes4 assetProxyId;\n assembly {\n assetProxyId := and(mload(\n add(assetData, 32)),\n 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000\n )\n }\n address assetProxy = assetProxies[assetProxyId];\n\n // Ensure that assetProxy exists\n require(\n assetProxy != address(0),\n \"ASSET_PROXY_DOES_NOT_EXIST\"\n );\n \n // We construct calldata for the `assetProxy.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n // \n // | Area | Offset | Length | Contents |\n // | -------- |--------|---------|-------------------------------------------- |\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n\n assembly {\n /////// Setup State ///////\n // `cdStart` is the start of the calldata for `assetProxy.transferFrom` (equal to free memory ptr).\n let cdStart := mload(64)\n // `dataAreaLength` is the total number of words needed to store `assetData`\n // As-per the ABI spec, this value is padded up to the nearest multiple of 32,\n // and includes 32-bytes for length.\n let dataAreaLength := and(add(mload(assetData), 63), 0xFFFFFFFFFFFE0)\n // `cdEnd` is the end of the calldata for `assetProxy.transferFrom`.\n let cdEnd := add(cdStart, add(132, dataAreaLength))\n\n \n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFromSelector`.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n mstore(cdStart, 0xa85e59e400000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // Each parameter is padded to 32-bytes. The entire Params Area is 128 bytes.\n // Notes:\n // 1. The offset to `assetData` is the length of the Params Area (128 bytes).\n // 2. A 20-byte mask is applied to addresses to zero-out the unused bytes.\n mstore(add(cdStart, 4), 128)\n mstore(add(cdStart, 36), and(from, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(cdStart, 68), and(to, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(cdStart, 100), amount)\n \n /////// Setup Data Area ///////\n // This area holds `assetData`.\n let dataArea := add(cdStart, 132)\n // solhint-disable-next-line no-empty-blocks\n for {} lt(dataArea, cdEnd) {} {\n mstore(dataArea, mload(assetData))\n dataArea := add(dataArea, 32)\n assetData := add(assetData, 32)\n }\n\n /////// Call `assetProxy.transferFrom` using the constructed calldata ///////\n let success := call(\n gas, // forward all gas\n assetProxy, // call address of asset proxy\n 0, // don't send any ETH\n cdStart, // pointer to start of input\n sub(cdEnd, cdStart), // length of input \n cdStart, // write output over input\n 512 // reserve 512 bytes for output\n )\n if iszero(success) {\n revert(cdStart, returndatasize())\n }\n }\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\n\n\ncontract MixinExchangeCore is\n LibConstants,\n LibMath,\n LibOrder,\n LibFillResults,\n MAssetProxyDispatcher,\n MExchangeCore,\n MSignatureValidator,\n MTransactions\n{\n // Mapping of orderHash => amount of takerAsset already bought by maker\n mapping (bytes32 => uint256) public filled;\n\n // Mapping of orderHash => cancelled\n mapping (bytes32 => bool) public cancelled;\n\n // Mapping of makerAddress => senderAddress => lowest salt an order can have in order to be fillable\n // Orders with specified senderAddress and with a salt less than their epoch are considered cancelled\n mapping (address => mapping (address => uint256)) public orderEpoch;\n\n /// @dev Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch\n /// and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress).\n /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled.\n function cancelOrdersUpTo(uint256 targetOrderEpoch)\n external\n {\n address makerAddress = getCurrentContextAddress();\n // If this function is called via `executeTransaction`, we only update the orderEpoch for the makerAddress/msg.sender combination.\n // This allows external filter contracts to add rules to how orders are cancelled via this function.\n address senderAddress = makerAddress == msg.sender ? address(0) : msg.sender;\n\n // orderEpoch is initialized to 0, so to cancelUpTo we need salt + 1\n uint256 newOrderEpoch = targetOrderEpoch + 1; \n uint256 oldOrderEpoch = orderEpoch[makerAddress][senderAddress];\n\n // Ensure orderEpoch is monotonically increasing\n require(\n newOrderEpoch > oldOrderEpoch, \n \"INVALID_NEW_ORDER_EPOCH\"\n );\n\n // Update orderEpoch\n orderEpoch[makerAddress][senderAddress] = newOrderEpoch;\n emit CancelUpTo(makerAddress, senderAddress, newOrderEpoch);\n }\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrder(\n Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (FillResults memory fillResults)\n {\n // Fetch order info\n OrderInfo memory orderInfo = getOrderInfo(order);\n\n // Fetch taker address\n address takerAddress = getCurrentContextAddress();\n\n // Get amount of takerAsset to fill\n uint256 remainingTakerAssetAmount = safeSub(order.takerAssetAmount, orderInfo.orderTakerAssetFilledAmount);\n uint256 takerAssetFilledAmount = min256(takerAssetFillAmount, remainingTakerAssetAmount);\n\n // Validate context\n assertValidFill(\n order,\n orderInfo,\n takerAddress,\n takerAssetFillAmount,\n takerAssetFilledAmount,\n signature\n );\n\n // Compute proportional fill amounts\n fillResults = calculateFillResults(order, takerAssetFilledAmount);\n\n // Update exchange internal state\n updateFilledState(\n order,\n takerAddress,\n orderInfo.orderHash,\n orderInfo.orderTakerAssetFilledAmount,\n fillResults\n );\n \n // Settle order\n settleOrder(order, takerAddress, fillResults);\n\n return fillResults;\n }\n\n /// @dev After calling, the order can not be filled anymore.\n /// Throws if order is invalid or sender does not have permission to cancel.\n /// @param order Order to cancel. Order must be OrderStatus.FILLABLE.\n function cancelOrder(Order memory order)\n public\n {\n // Fetch current order status\n OrderInfo memory orderInfo = getOrderInfo(order);\n\n // Validate context\n assertValidCancel(order, orderInfo);\n\n // Perform cancel\n updateCancelledState(order, orderInfo.orderHash);\n }\n\n /// @dev Gets information about an order: status, hash, and amount filled.\n /// @param order Order to gather information on.\n /// @return OrderInfo Information about the order and its state.\n /// See LibOrder.OrderInfo for a complete description.\n function getOrderInfo(Order memory order)\n public\n view\n returns (OrderInfo memory orderInfo)\n {\n // Compute the order hash\n orderInfo.orderHash = getOrderHash(order);\n\n // Fetch filled amount\n orderInfo.orderTakerAssetFilledAmount = filled[orderInfo.orderHash];\n\n // If order.makerAssetAmount is zero, we also reject the order.\n // While the Exchange contract handles them correctly, they create\n // edge cases in the supporting infrastructure because they have\n // an 'infinite' price when computed by a simple division.\n if (order.makerAssetAmount == 0) {\n orderInfo.orderStatus = uint8(OrderStatus.INVALID_MAKER_ASSET_AMOUNT);\n return orderInfo;\n }\n\n // If order.takerAssetAmount is zero, then the order will always\n // be considered filled because 0 == takerAssetAmount == orderTakerAssetFilledAmount\n // Instead of distinguishing between unfilled and filled zero taker\n // amount orders, we choose not to support them.\n if (order.takerAssetAmount == 0) {\n orderInfo.orderStatus = uint8(OrderStatus.INVALID_TAKER_ASSET_AMOUNT);\n return orderInfo;\n }\n\n // Validate order availability\n if (orderInfo.orderTakerAssetFilledAmount >= order.takerAssetAmount) {\n orderInfo.orderStatus = uint8(OrderStatus.FULLY_FILLED);\n return orderInfo;\n }\n\n // Validate order expiration\n // solhint-disable-next-line not-rely-on-time\n if (block.timestamp >= order.expirationTimeSeconds) {\n orderInfo.orderStatus = uint8(OrderStatus.EXPIRED);\n return orderInfo;\n }\n\n // Check if order has been cancelled\n if (cancelled[orderInfo.orderHash]) {\n orderInfo.orderStatus = uint8(OrderStatus.CANCELLED);\n return orderInfo;\n }\n if (orderEpoch[order.makerAddress][order.senderAddress] > order.salt) {\n orderInfo.orderStatus = uint8(OrderStatus.CANCELLED);\n return orderInfo;\n }\n\n // All other statuses are ruled out: order is Fillable\n orderInfo.orderStatus = uint8(OrderStatus.FILLABLE);\n return orderInfo;\n }\n\n /// @dev Updates state with results of a fill order.\n /// @param order that was filled.\n /// @param takerAddress Address of taker who filled the order.\n /// @param orderTakerAssetFilledAmount Amount of order already filled.\n function updateFilledState(\n Order memory order,\n address takerAddress,\n bytes32 orderHash,\n uint256 orderTakerAssetFilledAmount,\n FillResults memory fillResults\n )\n internal\n {\n // Update state\n filled[orderHash] = safeAdd(orderTakerAssetFilledAmount, fillResults.takerAssetFilledAmount);\n\n // Log order\n emit Fill(\n order.makerAddress,\n order.feeRecipientAddress,\n takerAddress,\n msg.sender,\n fillResults.makerAssetFilledAmount,\n fillResults.takerAssetFilledAmount,\n fillResults.makerFeePaid,\n fillResults.takerFeePaid,\n orderHash,\n order.makerAssetData,\n order.takerAssetData\n );\n }\n\n /// @dev Updates state with results of cancelling an order.\n /// State is only updated if the order is currently fillable.\n /// Otherwise, updating state would have no effect.\n /// @param order that was cancelled.\n /// @param orderHash Hash of order that was cancelled.\n function updateCancelledState(\n Order memory order,\n bytes32 orderHash\n )\n internal\n {\n // Perform cancel\n cancelled[orderHash] = true;\n\n // Log cancel\n emit Cancel(\n order.makerAddress,\n order.feeRecipientAddress,\n msg.sender,\n orderHash,\n order.makerAssetData,\n order.takerAssetData\n );\n }\n\n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAddress Address of order taker.\n /// @param takerAssetFillAmount Desired amount of order to fill by taker.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @param signature Proof that the orders was created by its maker.\n function assertValidFill(\n Order memory order,\n OrderInfo memory orderInfo,\n address takerAddress,\n uint256 takerAssetFillAmount,\n uint256 takerAssetFilledAmount,\n bytes memory signature\n )\n internal\n view\n {\n // An order can only be filled if its status is FILLABLE.\n require(\n orderInfo.orderStatus == uint8(OrderStatus.FILLABLE),\n \"ORDER_UNFILLABLE\"\n );\n\n // Revert if fill amount is invalid\n require(\n takerAssetFillAmount != 0,\n \"INVALID_TAKER_AMOUNT\"\n );\n\n // Validate sender is allowed to fill this order\n if (order.senderAddress != address(0)) {\n require(\n order.senderAddress == msg.sender,\n \"INVALID_SENDER\"\n );\n }\n\n // Validate taker is allowed to fill this order\n if (order.takerAddress != address(0)) {\n require(\n order.takerAddress == takerAddress,\n \"INVALID_TAKER\"\n );\n }\n\n // Validate Maker signature (check only if first time seen)\n if (orderInfo.orderTakerAssetFilledAmount == 0) {\n require(\n isValidSignature(\n orderInfo.orderHash,\n order.makerAddress,\n signature\n ),\n \"INVALID_ORDER_SIGNATURE\"\n );\n }\n\n // Validate fill order rounding\n require(\n !isRoundingError(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.makerAssetAmount\n ),\n \"ROUNDING_ERROR\"\n );\n }\n\n /// @dev Validates context for cancelOrder. Succeeds or throws.\n /// @param order to be cancelled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n function assertValidCancel(\n Order memory order,\n OrderInfo memory orderInfo\n )\n internal\n view\n {\n // Ensure order is valid\n // An order can only be cancelled if its status is FILLABLE.\n require(\n orderInfo.orderStatus == uint8(OrderStatus.FILLABLE),\n \"ORDER_UNFILLABLE\"\n );\n\n // Validate sender is allowed to cancel this order\n if (order.senderAddress != address(0)) {\n require(\n order.senderAddress == msg.sender,\n \"INVALID_SENDER\"\n );\n }\n\n // Validate transaction signed by maker\n address makerAddress = getCurrentContextAddress();\n require(\n order.makerAddress == makerAddress,\n \"INVALID_MAKER\"\n );\n }\n\n /// @dev Calculates amounts filled and fees paid by maker and taker.\n /// @param order to be filled.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function calculateFillResults(\n Order memory order,\n uint256 takerAssetFilledAmount\n )\n internal\n pure\n returns (FillResults memory fillResults)\n {\n // Compute proportional transfer amounts\n fillResults.takerAssetFilledAmount = takerAssetFilledAmount;\n fillResults.makerAssetFilledAmount = getPartialAmount(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.makerAssetAmount\n );\n fillResults.makerFeePaid = getPartialAmount(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.makerFee\n );\n fillResults.takerFeePaid = getPartialAmount(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.takerFee\n );\n\n return fillResults;\n }\n\n /// @dev Settles an order by transferring assets between counterparties.\n /// @param order Order struct containing order specifications.\n /// @param takerAddress Address selling takerAsset and buying makerAsset.\n /// @param fillResults Amounts to be filled and fees paid by maker and taker.\n function settleOrder(\n LibOrder.Order memory order,\n address takerAddress,\n LibFillResults.FillResults memory fillResults\n )\n private\n {\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n dispatchTransferFrom(\n order.makerAssetData,\n order.makerAddress,\n takerAddress,\n fillResults.makerAssetFilledAmount\n );\n dispatchTransferFrom(\n order.takerAssetData,\n takerAddress,\n order.makerAddress,\n fillResults.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n zrxAssetData,\n order.makerAddress,\n order.feeRecipientAddress,\n fillResults.makerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n order.feeRecipientAddress,\n fillResults.takerFeePaid\n );\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinMatchOrders.sol": "/*\n Copyright 2018 ZeroEx Intl.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n http://www.apache.org/licenses/LICENSE-2.0\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MMatchOrders.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\n\n\ncontract MixinMatchOrders is\n LibConstants,\n LibMath,\n MAssetProxyDispatcher,\n MExchangeCore,\n MMatchOrders,\n MTransactions\n{\n /// @dev Match two complementary orders that have a profitable spread.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the left order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftSignature Proof that order was created by the left maker.\n /// @param rightSignature Proof that order was created by the right maker.\n /// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.\n function matchOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n bytes memory leftSignature,\n bytes memory rightSignature\n )\n public\n returns (LibFillResults.MatchedFillResults memory matchedFillResults)\n {\n // We assume that rightOrder.takerAssetData == leftOrder.makerAssetData and rightOrder.makerAssetData == leftOrder.takerAssetData.\n // If this assumption isn't true, the match will fail at signature validation.\n rightOrder.makerAssetData = leftOrder.takerAssetData;\n rightOrder.takerAssetData = leftOrder.makerAssetData;\n\n // Get left & right order info\n LibOrder.OrderInfo memory leftOrderInfo = getOrderInfo(leftOrder);\n LibOrder.OrderInfo memory rightOrderInfo = getOrderInfo(rightOrder);\n\n // Fetch taker address\n address takerAddress = getCurrentContextAddress();\n\n // Either our context is valid or we revert\n assertValidMatch(leftOrder, rightOrder);\n\n // Compute proportional fill amounts\n matchedFillResults = calculateMatchedFillResults(\n leftOrder,\n rightOrder,\n leftOrderInfo.orderTakerAssetFilledAmount,\n rightOrderInfo.orderTakerAssetFilledAmount\n );\n\n // Validate fill contexts\n assertValidFill(\n leftOrder,\n leftOrderInfo,\n takerAddress,\n matchedFillResults.left.takerAssetFilledAmount,\n matchedFillResults.left.takerAssetFilledAmount,\n leftSignature\n );\n assertValidFill(\n rightOrder,\n rightOrderInfo,\n takerAddress,\n matchedFillResults.right.takerAssetFilledAmount,\n matchedFillResults.right.takerAssetFilledAmount,\n rightSignature\n );\n\n // Update exchange state\n updateFilledState(\n leftOrder,\n takerAddress,\n leftOrderInfo.orderHash,\n leftOrderInfo.orderTakerAssetFilledAmount,\n matchedFillResults.left\n );\n updateFilledState(\n rightOrder,\n takerAddress,\n rightOrderInfo.orderHash,\n rightOrderInfo.orderTakerAssetFilledAmount,\n matchedFillResults.right\n );\n \n // Settle matched orders. Succeeds or throws.\n settleMatchedOrders(\n leftOrder,\n rightOrder,\n takerAddress,\n matchedFillResults\n );\n\n return matchedFillResults;\n }\n\n /// @dev Validates context for matchOrders. Succeeds or throws.\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n function assertValidMatch(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder\n )\n internal\n pure\n {\n // Make sure there is a profitable spread.\n // There is a profitable spread iff the cost per unit bought (OrderA.MakerAmount/OrderA.TakerAmount) for each order is greater\n // than the profit per unit sold of the matched order (OrderB.TakerAmount/OrderB.MakerAmount).\n // This is satisfied by the equations below:\n // <leftOrder.makerAssetAmount> / <leftOrder.takerAssetAmount> >= <rightOrder.takerAssetAmount> / <rightOrder.makerAssetAmount>\n // AND\n // <rightOrder.makerAssetAmount> / <rightOrder.takerAssetAmount> >= <leftOrder.takerAssetAmount> / <leftOrder.makerAssetAmount>\n // These equations can be combined to get the following:\n require(\n safeMul(leftOrder.makerAssetAmount, rightOrder.makerAssetAmount) >=\n safeMul(leftOrder.takerAssetAmount, rightOrder.takerAssetAmount),\n \"NEGATIVE_SPREAD_REQUIRED\"\n );\n }\n\n /// @dev Calculates fill amounts for the matched orders.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the leftOrder order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftOrderTakerAssetFilledAmount Amount of left order already filled.\n /// @param rightOrderTakerAssetFilledAmount Amount of right order already filled.\n /// @param matchedFillResults Amounts to fill and fees to pay by maker and taker of matched orders.\n function calculateMatchedFillResults(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n uint256 leftOrderTakerAssetFilledAmount,\n uint256 rightOrderTakerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.MatchedFillResults memory matchedFillResults)\n {\n // We settle orders at the exchange rate of the right order.\n // The amount saved by the left maker goes to the taker.\n // Either the left or right order will be fully filled; possibly both.\n // The left order is fully filled iff the right order can sell more than left can buy.\n // That is: the amount required to fill the left order is less than or equal to\n // the amount we can spend from the right order:\n // <leftTakerAssetAmountRemaining> <= <rightTakerAssetAmountRemaining> * <rightMakerToTakerRatio>\n // <leftTakerAssetAmountRemaining> <= <rightTakerAssetAmountRemaining> * <rightOrder.makerAssetAmount> / <rightOrder.takerAssetAmount>\n // <leftTakerAssetAmountRemaining> * <rightOrder.takerAssetAmount> <= <rightTakerAssetAmountRemaining> * <rightOrder.makerAssetAmount>\n uint256 leftTakerAssetAmountRemaining = safeSub(leftOrder.takerAssetAmount, leftOrderTakerAssetFilledAmount);\n uint256 rightTakerAssetAmountRemaining = safeSub(rightOrder.takerAssetAmount, rightOrderTakerAssetFilledAmount);\n uint256 leftTakerAssetFilledAmount;\n uint256 rightTakerAssetFilledAmount;\n if (\n safeMul(leftTakerAssetAmountRemaining, rightOrder.takerAssetAmount) <=\n safeMul(rightTakerAssetAmountRemaining, rightOrder.makerAssetAmount)\n ) {\n // Left order will be fully filled: maximally fill left\n leftTakerAssetFilledAmount = leftTakerAssetAmountRemaining;\n\n // The right order receives an amount proportional to how much was spent.\n rightTakerAssetFilledAmount = getPartialAmount(\n rightOrder.takerAssetAmount,\n rightOrder.makerAssetAmount,\n leftTakerAssetFilledAmount\n );\n } else {\n // Right order will be fully filled: maximally fill right\n rightTakerAssetFilledAmount = rightTakerAssetAmountRemaining;\n\n // The left order receives an amount proportional to how much was spent.\n leftTakerAssetFilledAmount = getPartialAmount(\n rightOrder.makerAssetAmount,\n rightOrder.takerAssetAmount,\n rightTakerAssetFilledAmount\n );\n }\n\n // Calculate fill results for left order\n matchedFillResults.left = calculateFillResults(\n leftOrder,\n leftTakerAssetFilledAmount\n );\n\n // Calculate fill results for right order\n matchedFillResults.right = calculateFillResults(\n rightOrder,\n rightTakerAssetFilledAmount\n );\n\n // Calculate amount given to taker\n matchedFillResults.leftMakerAssetSpreadAmount = safeSub(\n matchedFillResults.left.makerAssetFilledAmount,\n matchedFillResults.right.takerAssetFilledAmount\n );\n\n // Return fill results\n return matchedFillResults;\n }\n\n /// @dev Settles matched order by transferring appropriate funds between order makers, taker, and fee recipient.\n /// @param leftOrder First matched order.\n /// @param rightOrder Second matched order.\n /// @param takerAddress Address that matched the orders. The taker receives the spread between orders as profit.\n /// @param matchedFillResults Struct holding amounts to transfer between makers, taker, and fee recipients.\n function settleMatchedOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n address takerAddress,\n LibFillResults.MatchedFillResults memory matchedFillResults\n )\n private\n {\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n // Order makers and taker\n dispatchTransferFrom(\n leftOrder.makerAssetData,\n leftOrder.makerAddress,\n rightOrder.makerAddress,\n matchedFillResults.right.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n rightOrder.makerAssetData,\n rightOrder.makerAddress,\n leftOrder.makerAddress,\n matchedFillResults.left.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n leftOrder.makerAssetData,\n leftOrder.makerAddress,\n takerAddress,\n matchedFillResults.leftMakerAssetSpreadAmount\n );\n\n // Maker fees\n dispatchTransferFrom(\n zrxAssetData,\n leftOrder.makerAddress,\n leftOrder.feeRecipientAddress,\n matchedFillResults.left.makerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n rightOrder.makerAddress,\n rightOrder.feeRecipientAddress,\n matchedFillResults.right.makerFeePaid\n );\n\n // Taker fees\n if (leftOrder.feeRecipientAddress == rightOrder.feeRecipientAddress) {\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n leftOrder.feeRecipientAddress,\n safeAdd(\n matchedFillResults.left.takerFeePaid,\n matchedFillResults.right.takerFeePaid\n )\n );\n } else {\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n leftOrder.feeRecipientAddress,\n matchedFillResults.left.takerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n rightOrder.feeRecipientAddress,\n matchedFillResults.right.takerFeePaid\n );\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinSignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./interfaces/IWallet.sol\";\nimport \"./interfaces/IValidator.sol\";\n\n\ncontract MixinSignatureValidator is\n MSignatureValidator,\n MTransactions\n{\n using LibBytes for bytes;\n \n // Mapping of hash => signer => signed\n mapping (bytes32 => mapping (address => bool)) public preSigned;\n\n // Mapping of signer => validator => approved\n mapping (address => mapping (address => bool)) public allowedValidators;\n\n /// @dev Approves a hash on-chain using any valid signature type.\n /// After presigning a hash, the preSign signature type will become valid for that hash and signer.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n function preSign(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external\n {\n require(\n isValidSignature(\n hash,\n signerAddress,\n signature\n ),\n \"INVALID_SIGNATURE\"\n );\n preSigned[hash][signerAddress] = true;\n }\n\n /// @dev Approves/unnapproves a Validator contract to verify signatures on signer's behalf.\n /// @param validatorAddress Address of Validator contract.\n /// @param approval Approval or disapproval of Validator contract.\n function setSignatureValidatorApproval(\n address validatorAddress,\n bool approval\n )\n external\n {\n address signerAddress = getCurrentContextAddress();\n allowedValidators[signerAddress][validatorAddress] = approval;\n emit SignatureValidatorApproval(\n signerAddress,\n validatorAddress,\n approval\n );\n }\n\n /// @dev Verifies that a hash has been signed by the given signer.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes memory signature\n )\n public\n view\n returns (bool isValid)\n {\n require(\n signature.length > 0,\n \"LENGTH_GREATER_THAN_0_REQUIRED\"\n );\n\n // Pop last byte off of signature byte array.\n uint8 signatureTypeRaw = uint8(signature.popLastByte());\n\n // Ensure signature is supported\n require(\n signatureTypeRaw < uint8(SignatureType.NSignatureTypes),\n \"SIGNATURE_UNSUPPORTED\"\n );\n\n SignatureType signatureType = SignatureType(signatureTypeRaw);\n\n // Variables are not scoped in Solidity.\n uint8 v;\n bytes32 r;\n bytes32 s;\n address recovered;\n\n // Always illegal signature.\n // This is always an implicit option since a signer can create a\n // signature array with invalid type or length. We may as well make\n // it an explicit option. This aids testing and analysis. It is\n // also the initialization value for the enum type.\n if (signatureType == SignatureType.Illegal) {\n revert(\"SIGNATURE_ILLEGAL\");\n\n // Always invalid signature.\n // Like Illegal, this is always implicitly available and therefore\n // offered explicitly. It can be implicitly created by providing\n // a correctly formatted but incorrect signature.\n } else if (signatureType == SignatureType.Invalid) {\n require(\n signature.length == 0,\n \"LENGTH_0_REQUIRED\"\n );\n isValid = false;\n return isValid;\n\n // Signature using EIP712\n } else if (signatureType == SignatureType.EIP712) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n hash,\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n\n // Signed using web3.eth_sign\n } else if (signatureType == SignatureType.EthSign) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n keccak256(abi.encodePacked(\n \"\\x19Ethereum Signed Message:\\n32\",\n hash\n )),\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n\n // Implicitly signed by caller.\n // The signer has initiated the call. In the case of non-contract\n // accounts it means the transaction itself was signed.\n // Example: let's say for a particular operation three signatures\n // A, B and C are required. To submit the transaction, A and B can\n // give a signature to C, who can then submit the transaction using\n // `Caller` for his own signature. Or A and C can sign and B can\n // submit using `Caller`. Having `Caller` allows this flexibility.\n } else if (signatureType == SignatureType.Caller) {\n require(\n signature.length == 0,\n \"LENGTH_0_REQUIRED\"\n );\n isValid = signerAddress == msg.sender;\n return isValid;\n\n // Signature verified by wallet contract.\n // If used with an order, the maker of the order is the wallet contract.\n } else if (signatureType == SignatureType.Wallet) {\n isValid = IWallet(signerAddress).isValidSignature(hash, signature);\n return isValid;\n\n // Signature verified by validator contract.\n // If used with an order, the maker of the order can still be an EOA.\n // A signature using this type should be encoded as:\n // | Offset | Length | Contents |\n // | 0x00 | x | Signature to validate |\n // | 0x00 + x | 20 | Address of validator contract |\n // | 0x14 + x | 1 | Signature type is always \"\\x06\" |\n } else if (signatureType == SignatureType.Validator) {\n // Pop last 20 bytes off of signature byte array.\n address validatorAddress = signature.popLast20Bytes();\n \n // Ensure signer has approved validator.\n if (!allowedValidators[signerAddress][validatorAddress]) {\n return false;\n }\n isValid = IValidator(validatorAddress).isValidSignature(\n hash,\n signerAddress,\n signature\n );\n return isValid;\n\n // Signer signed hash previously using the preSign function.\n } else if (signatureType == SignatureType.PreSigned) {\n isValid = preSigned[hash][signerAddress];\n return isValid;\n\n // Signature from Trezor hardware wallet.\n // It differs from web3.eth_sign in the encoding of message length\n // (Bitcoin varint encoding vs ascii-decimal, the latter is not\n // self-terminating which leads to ambiguities).\n // See also:\n // https://en.bitcoin.it/wiki/Protocol_documentation#Variable_length_integer\n // https://github.com/trezor/trezor-mcu/blob/master/firmware/ethereum.c#L602\n // https://github.com/trezor/trezor-mcu/blob/master/firmware/crypto.c#L36\n } else if (signatureType == SignatureType.Trezor) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n keccak256(abi.encodePacked(\n \"\\x19Ethereum Signed Message:\\n\\x20\",\n hash\n )),\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n }\n\n // Anything else is illegal (We do not return false because\n // the signature may actually be valid, just not in a format\n // that we currently support. In this case returning false\n // may lead the caller to incorrectly believe that the\n // signature was invalid.)\n revert(\"SIGNATURE_UNSUPPORTED\");\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinTransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\nimport \"./libs/LibExchangeErrors.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./libs/LibEIP712.sol\";\n\n\ncontract MixinTransactions is\n LibEIP712,\n MSignatureValidator,\n MTransactions\n{\n\n // Mapping of transaction hash => executed\n // This prevents transactions from being executed more than once.\n mapping (bytes32 => bool) public transactions;\n\n // Address of current transaction signer\n address public currentContextAddress;\n\n // Hash for the EIP712 ZeroEx Transaction Schema\n bytes32 constant internal EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"ZeroExTransaction(\",\n \"uint256 salt,\",\n \"address signerAddress,\",\n \"bytes data\",\n \")\"\n ));\n\n /// @dev Executes an exchange method call in the context of signer.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @param signature Proof of signer transaction by signer.\n function executeTransaction(\n uint256 salt,\n address signerAddress,\n bytes data,\n bytes signature\n )\n external\n {\n // Prevent reentrancy\n require(\n currentContextAddress == address(0),\n \"REENTRANCY_ILLEGAL\"\n );\n\n bytes32 transactionHash = hashEIP712Message(hashZeroExTransaction(\n salt,\n signerAddress,\n data\n ));\n\n // Validate transaction has not been executed\n require(\n !transactions[transactionHash],\n \"INVALID_TX_HASH\"\n );\n\n // Transaction always valid if signer is sender of transaction\n if (signerAddress != msg.sender) {\n // Validate signature\n require(\n isValidSignature(\n transactionHash,\n signerAddress,\n signature\n ),\n \"INVALID_TX_SIGNATURE\"\n );\n\n // Set the current transaction signer\n currentContextAddress = signerAddress;\n }\n\n // Execute transaction\n transactions[transactionHash] = true;\n require(\n address(this).delegatecall(data),\n \"FAILED_EXECUTION\"\n );\n\n // Reset current transaction signer if it was previously updated\n if (signerAddress != msg.sender) {\n currentContextAddress = address(0);\n }\n }\n\n /// @dev Calculates EIP712 hash of the Transaction.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @return EIP712 hash of the Transaction.\n function hashZeroExTransaction(\n uint256 salt,\n address signerAddress,\n bytes memory data\n )\n internal\n pure\n returns (bytes32 result)\n {\n bytes32 schemaHash = EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH;\n bytes32 dataHash = keccak256(data);\n\n // Assembly for more efficiently computing:\n // keccak256(abi.encodePacked(\n // EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH,\n // salt,\n // bytes32(signerAddress),\n // keccak256(data)\n // ));\n\n assembly {\n // Load free memory pointer\n let memPtr := mload(64)\n\n mstore(memPtr, schemaHash) // hash of schema\n mstore(add(memPtr, 32), salt) // salt\n mstore(add(memPtr, 64), and(signerAddress, 0xffffffffffffffffffffffffffffffffffffffff)) // signerAddress\n mstore(add(memPtr, 96), dataHash) // hash of data\n\n // Compute hash\n result := keccak256(memPtr, 128)\n }\n return result;\n }\n\n /// @dev The current function will be called in the context of this address (either 0x transaction signer or `msg.sender`).\n /// If calling a fill function, this address will represent the taker.\n /// If calling a cancel function, this address will represent the maker.\n /// @return Signer of 0x transaction if entry point is `executeTransaction`.\n /// `msg.sender` if entry point is any other function.\n function getCurrentContextAddress()\n internal\n view\n returns (address)\n {\n address contextAddress = currentContextAddress == address(0) ? msg.sender : currentContextAddress;\n return contextAddress;\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibMath.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./libs/LibAbiEncoder.sol\";\nimport \"./mixins/MExchangeCore.sol\";\n\n\ncontract MixinWrapperFunctions is\n LibMath,\n LibFillResults,\n LibAbiEncoder,\n MExchangeCore\n{\n\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n require(\n fillResults.takerAssetFilledAmount == takerAssetFillAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return fillResults;\n }\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (FillResults memory fillResults)\n {\n // ABI encode calldata for `fillOrder`\n bytes memory fillOrderCalldata = abiEncodeFillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n\n // Delegate to `fillOrder` and handle any exceptions gracefully\n assembly {\n let success := delegatecall(\n gas, // forward all gas, TODO: look into gas consumption of assert/throw\n address, // call address of this contract\n add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes)\n mload(fillOrderCalldata), // length of input\n fillOrderCalldata, // write output over input\n 128 // output size is 128 bytes\n )\n switch success\n case 0 {\n mstore(fillResults, 0)\n mstore(add(fillResults, 32), 0)\n mstore(add(fillResults, 64), 0)\n mstore(add(fillResults, 96), 0)\n }\n case 1 {\n mstore(fillResults, mload(fillOrderCalldata))\n mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32)))\n mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64)))\n mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96)))\n }\n }\n return fillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrder(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrKill.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrKillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrKillOrder(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrders(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory takerAssetData = orders[0].takerAssetData;\n \n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being sold by taker is the same for each order.\n // Rather than passing this in as calldata, we use the takerAssetData from the first order in all later orders.\n orders[i].takerAssetData = takerAssetData;\n\n // Calculate the remaining amount of takerAsset to sell\n uint256 remainingTakerAssetFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrder(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= takerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory takerAssetData = orders[0].takerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being sold by taker is the same for each order.\n // Rather than passing this in as calldata, we use the takerAssetData from the first order in all later orders.\n orders[i].takerAssetData = takerAssetData;\n\n // Calculate the remaining amount of takerAsset to sell\n uint256 remainingTakerAssetFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= takerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerAsset is bought by taker.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrders(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // Rather than passing this in as calldata, we copy the makerAssetData from the first order onto all later orders.\n orders[i].makerAssetData = makerAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmount(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrder(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n if (totalFillResults.makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // Rather than passing this in as calldata, we copy the makerAssetData from the first order onto all later orders.\n orders[i].makerAssetData = makerAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmount(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n if (totalFillResults.makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously cancels multiple orders in a single transaction.\n /// @param orders Array of order specifications.\n function batchCancelOrders(LibOrder.Order[] memory orders)\n public\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n cancelOrder(orders[i]);\n }\n }\n\n /// @dev Fetches information for all passed in orders.\n /// @param orders Array of order specifications.\n /// @return Array of OrderInfo instances that correspond to each order.\n function getOrdersInfo(LibOrder.Order[] memory orders)\n public\n view\n returns (LibOrder.OrderInfo[] memory)\n {\n uint256 ordersLength = orders.length;\n LibOrder.OrderInfo[] memory ordersInfo = new LibOrder.OrderInfo[](ordersLength);\n for (uint256 i = 0; i != ordersLength; i++) {\n ordersInfo[i] = getOrderInfo(orders[i]);\n }\n return ordersInfo;\n }\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IAssetProxyDispatcher {\n\n /// @dev Registers an asset proxy to its asset proxy id.\n /// Once an asset proxy is registered, it cannot be unregistered.\n /// @param assetProxy Address of new asset proxy to register.\n function registerAssetProxy(address assetProxy)\n external;\n\n /// @dev Gets an asset proxy.\n /// @param assetProxyId Id of the asset proxy.\n /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered.\n function getAssetProxy(bytes4 assetProxyId)\n external\n view\n returns (address);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IExchange.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./IExchangeCore.sol\";\nimport \"./IMatchOrders.sol\";\nimport \"./ISignatureValidator.sol\";\nimport \"./ITransactions.sol\";\nimport \"./IAssetProxyDispatcher.sol\";\nimport \"./IWrapperFunctions.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract IExchange is\n IExchangeCore,\n IMatchOrders,\n ISignatureValidator,\n ITransactions,\n IAssetProxyDispatcher,\n IWrapperFunctions\n{}\n",
- "2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IExchangeCore {\n\n /// @dev Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch\n /// and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress).\n /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled.\n function cancelOrdersUpTo(uint256 targetOrderEpoch)\n external;\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev After calling, the order can not be filled anymore.\n /// @param order Order struct containing order specifications.\n function cancelOrder(LibOrder.Order memory order)\n public;\n\n /// @dev Gets information about an order: status, hash, and amount filled.\n /// @param order Order to gather information on.\n /// @return OrderInfo Information about the order and its state.\n /// See LibOrder.OrderInfo for a complete description.\n function getOrderInfo(LibOrder.Order memory order)\n public\n view\n returns (LibOrder.OrderInfo memory orderInfo);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IMatchOrders {\n\n /// @dev Match two complementary orders that have a profitable spread.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the left order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftSignature Proof that order was created by the left maker.\n /// @param rightSignature Proof that order was created by the right maker.\n /// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.\n function matchOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n bytes memory leftSignature,\n bytes memory rightSignature\n )\n public\n returns (LibFillResults.MatchedFillResults memory matchedFillResults);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract ISignatureValidator {\n\n /// @dev Approves a hash on-chain using any valid signature type.\n /// After presigning a hash, the preSign signature type will become valid for that hash and signer.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n function preSign(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external;\n \n /// @dev Approves/unnapproves a Validator contract to verify signatures on signer's behalf.\n /// @param validatorAddress Address of Validator contract.\n /// @param approval Approval or disapproval of Validator contract.\n function setSignatureValidatorApproval(\n address validatorAddress,\n bool approval\n )\n external;\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signerAddress Address of signer.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes memory signature\n )\n public\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/ITransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\n\ncontract ITransactions {\n\n /// @dev Executes an exchange method call in the context of signer.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @param signature Proof of signer transaction by signer.\n function executeTransaction(\n uint256 salt,\n address signerAddress,\n bytes data,\n bytes signature\n )\n external;\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IValidator {\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IWallet.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IWallet {\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n bytes signature\n )\n external\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IWrapperFunctions {\n\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrKill.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrKillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrders(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerAsset is bought by taker.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrders(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously cancels multiple orders in a single transaction.\n /// @param orders Array of order specifications.\n function batchCancelOrders(LibOrder.Order[] memory orders)\n public;\n\n /// @dev Fetches information for all passed in orders\n /// @param orders Array of order specifications.\n /// @return Array of OrderInfo instances that correspond to each order.\n function getOrdersInfo(LibOrder.Order[] memory orders)\n public\n view\n returns (LibOrder.OrderInfo[] memory);\n}\n",
- "2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./LibOrder.sol\";\n\n\ncontract LibAbiEncoder {\n\n /// @dev ABI encodes calldata for `fillOrder`.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return ABI encoded calldata for `fillOrder`.\n function abiEncodeFillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n pure\n returns (bytes memory fillOrderCalldata)\n {\n // We need to call MExchangeCore.fillOrder using a delegatecall in\n // assembly so that we can intercept a call that throws. For this, we\n // need the input encoded in memory in the Ethereum ABIv2 format [1].\n\n // | Area | Offset | Length | Contents |\n // | -------- |--------|---------|-------------------------------------------- |\n // | Header | 0x00 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 0x00 | | 1. offset to order (*) |\n // | | 0x20 | | 2. takerAssetFillAmount |\n // | | 0x40 | | 3. offset to signature (*) |\n // | Data | | 12 * 32 | order: |\n // | | 0x000 | | 1. senderAddress |\n // | | 0x020 | | 2. makerAddress |\n // | | 0x040 | | 3. takerAddress |\n // | | 0x060 | | 4. feeRecipientAddress |\n // | | 0x080 | | 5. makerAssetAmount |\n // | | 0x0A0 | | 6. takerAssetAmount |\n // | | 0x0C0 | | 7. makerFeeAmount |\n // | | 0x0E0 | | 8. takerFeeAmount |\n // | | 0x100 | | 9. expirationTimeSeconds |\n // | | 0x120 | | 10. salt |\n // | | 0x140 | | 11. Offset to makerAssetData (*) |\n // | | 0x160 | | 12. Offset to takerAssetData (*) |\n // | | 0x180 | 32 | makerAssetData Length |\n // | | 0x1A0 | ** | makerAssetData Contents |\n // | | 0x1C0 | 32 | takerAssetData Length |\n // | | 0x1E0 | ** | takerAssetData Contents |\n // | | 0x200 | 32 | signature Length |\n // | | 0x220 | ** | signature Contents |\n\n // * Offsets are calculated from the beginning of the current area: Header, Params, Data:\n // An offset stored in the Params area is calculated from the beginning of the Params section.\n // An offset stored in the Data area is calculated from the beginning of the Data section.\n\n // ** The length of dynamic array contents are stored in the field immediately preceeding the contents.\n\n // [1]: https://solidity.readthedocs.io/en/develop/abi-spec.html\n\n assembly {\n\n // Areas below may use the following variables:\n // 1. <area>Start -- Start of this area in memory\n // 2. <area>End -- End of this area in memory. This value may\n // be precomputed (before writing contents),\n // or it may be computed as contents are written.\n // 3. <area>Offset -- Current offset into area. If an area's End\n // is precomputed, this variable tracks the\n // offsets of contents as they are written.\n\n /////// Setup Header Area ///////\n // Load free memory pointer\n fillOrderCalldata := mload(0x40)\n // bytes4(keccak256(\"fillOrder((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),uint256,bytes)\"))\n // = 0xb4be83d5\n // Leave 0x20 bytes to store the length\n mstore(add(fillOrderCalldata, 0x20), 0xb4be83d500000000000000000000000000000000000000000000000000000000)\n let headerAreaEnd := add(fillOrderCalldata, 0x24)\n\n /////// Setup Params Area ///////\n // This area is preallocated and written to later.\n // This is because we need to fill in offsets that have not yet been calculated.\n let paramsAreaStart := headerAreaEnd\n let paramsAreaEnd := add(paramsAreaStart, 0x60)\n let paramsAreaOffset := paramsAreaStart\n\n /////// Setup Data Area ///////\n let dataAreaStart := paramsAreaEnd\n let dataAreaEnd := dataAreaStart\n\n // Offset from the source data we're reading from\n let sourceOffset := order\n // arrayLenBytes and arrayLenWords track the length of a dynamically-allocated bytes array.\n let arrayLenBytes := 0\n let arrayLenWords := 0\n\n /////// Write order Struct ///////\n // Write memory location of Order, relative to the start of the\n // parameter list, then increment the paramsAreaOffset respectively.\n mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))\n paramsAreaOffset := add(paramsAreaOffset, 0x20)\n\n // Write values for each field in the order\n // It would be nice to use a loop, but we save on gas by writing\n // the stores sequentially.\n mstore(dataAreaEnd, mload(sourceOffset)) // makerAddress\n mstore(add(dataAreaEnd, 0x20), mload(add(sourceOffset, 0x20))) // takerAddress\n mstore(add(dataAreaEnd, 0x40), mload(add(sourceOffset, 0x40))) // feeRecipientAddress\n mstore(add(dataAreaEnd, 0x60), mload(add(sourceOffset, 0x60))) // senderAddress\n mstore(add(dataAreaEnd, 0x80), mload(add(sourceOffset, 0x80))) // makerAssetAmount\n mstore(add(dataAreaEnd, 0xA0), mload(add(sourceOffset, 0xA0))) // takerAssetAmount\n mstore(add(dataAreaEnd, 0xC0), mload(add(sourceOffset, 0xC0))) // makerFeeAmount\n mstore(add(dataAreaEnd, 0xE0), mload(add(sourceOffset, 0xE0))) // takerFeeAmount\n mstore(add(dataAreaEnd, 0x100), mload(add(sourceOffset, 0x100))) // expirationTimeSeconds\n mstore(add(dataAreaEnd, 0x120), mload(add(sourceOffset, 0x120))) // salt\n mstore(add(dataAreaEnd, 0x140), mload(add(sourceOffset, 0x140))) // Offset to makerAssetData\n mstore(add(dataAreaEnd, 0x160), mload(add(sourceOffset, 0x160))) // Offset to takerAssetData\n dataAreaEnd := add(dataAreaEnd, 0x180)\n sourceOffset := add(sourceOffset, 0x180)\n\n // Write offset to <order.makerAssetData>\n mstore(add(dataAreaStart, mul(10, 0x20)), sub(dataAreaEnd, dataAreaStart))\n\n // Calculate length of <order.makerAssetData>\n sourceOffset := mload(add(order, 0x140)) // makerAssetData\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of <order.makerAssetData>\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of <order.makerAssetData>\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n // Write offset to <order.takerAssetData>\n mstore(add(dataAreaStart, mul(11, 0x20)), sub(dataAreaEnd, dataAreaStart))\n\n // Calculate length of <order.takerAssetData>\n sourceOffset := mload(add(order, 0x160)) // takerAssetData\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of <order.takerAssetData>\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of <order.takerAssetData>\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n /////// Write takerAssetFillAmount ///////\n mstore(paramsAreaOffset, takerAssetFillAmount)\n paramsAreaOffset := add(paramsAreaOffset, 0x20)\n\n /////// Write signature ///////\n // Write offset to paramsArea\n mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))\n\n // Calculate length of signature\n sourceOffset := signature\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of signature\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of signature\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n // Set length of calldata\n mstore(fillOrderCalldata, sub(dataAreaEnd, add(fillOrderCalldata, 0x20)))\n\n // Increment free memory pointer\n mstore(0x40, dataAreaEnd)\n }\n\n return fillOrderCalldata;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibConstants.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\n// solhint-disable max-line-length\ncontract LibConstants {\n \n // Asset data for ZRX token. Used for fee transfers.\n // @TODO: Hardcode constant when we deploy. Currently \n // not constant to make testing easier.\n\n // The proxyId for ZRX_ASSET_DATA is bytes4(keccak256(\"ERC20Token(address)\")) = 0xf47261b0\n \n // Kovan ZRX address is 0x6ff6c0ff1d68b964901f986d4c9fa3ac68346570.\n // The ABI encoded proxyId and address is 0xf47261b00000000000000000000000006ff6c0ff1d68b964901f986d4c9fa3ac68346570\n // bytes constant public ZRX_ASSET_DATA = \"\\xf4\\x72\\x61\\xb0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x6f\\xf6\\xc0\\xff\\x1d\\x68\\xb9\\x64\\x90\\x1f\\x98\\x6d\\x4c\\x9f\\xa3\\xac\\x68\\x34\\x65\\x70\";\n \n // Mainnet ZRX address is 0xe41d2489571d322189246dafa5ebde1f4699f498.\n // The ABI encoded proxyId and address is 0xf47261b0000000000000000000000000e41d2489571d322189246dafa5ebde1f4699f498\n // bytes constant public ZRX_ASSET_DATA = \"\\xf4\\x72\\x61\\xb0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xe4\\x1d\\x24\\x89\\x57\\x1d\\x32\\x21\\x89\\x24\\x6d\\xaf\\xa5\\xeb\\xde\\x1f\\x46\\x99\\xf4\\x98\";\n \n // solhint-disable-next-line var-name-mixedcase\n bytes public ZRX_ASSET_DATA;\n\n // @TODO: Remove when we deploy.\n constructor (bytes memory zrxAssetData)\n public\n {\n ZRX_ASSET_DATA = zrxAssetData;\n }\n}\n// solhint-enable max-line-length\n",
- "2.0.0/protocol/Exchange/libs/LibEIP712.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract LibEIP712 {\n // EIP191 header for EIP712 prefix\n string constant internal EIP191_HEADER = \"\\x19\\x01\";\n\n // EIP712 Domain Name value\n string constant internal EIP712_DOMAIN_NAME = \"0x Protocol\";\n\n // EIP712 Domain Version value\n string constant internal EIP712_DOMAIN_VERSION = \"2\";\n\n // Hash of the EIP712 Domain Separator Schema\n bytes32 constant internal EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"EIP712Domain(\",\n \"string name,\",\n \"string version,\",\n \"address verifyingContract\",\n \")\"\n ));\n\n // Hash of the EIP712 Domain Separator data\n // solhint-disable-next-line var-name-mixedcase\n bytes32 public EIP712_DOMAIN_HASH;\n\n constructor ()\n public\n {\n EIP712_DOMAIN_HASH = keccak256(abi.encodePacked(\n EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH,\n keccak256(bytes(EIP712_DOMAIN_NAME)),\n keccak256(bytes(EIP712_DOMAIN_VERSION)),\n bytes32(address(this))\n ));\n }\n\n /// @dev Calculates EIP712 encoding for a hash struct in this EIP712 Domain.\n /// @param hashStruct The EIP712 hash struct.\n /// @return EIP712 hash applied to this EIP712 Domain.\n function hashEIP712Message(bytes32 hashStruct)\n internal\n view\n returns (bytes32 result)\n {\n bytes32 eip712DomainHash = EIP712_DOMAIN_HASH;\n\n // Assembly for more efficient computing:\n // keccak256(abi.encodePacked(\n // EIP191_HEADER,\n // EIP712_DOMAIN_HASH,\n // hashStruct \n // ));\n\n assembly {\n // Load free memory pointer\n let memPtr := mload(64)\n\n mstore(memPtr, 0x1901000000000000000000000000000000000000000000000000000000000000) // EIP191 header\n mstore(add(memPtr, 2), eip712DomainHash) // EIP712 domain hash\n mstore(add(memPtr, 34), hashStruct) // Hash of struct\n\n // Compute hash\n result := keccak256(memPtr, 66)\n }\n return result;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\n// solhint-disable\npragma solidity 0.4.24;\n\n\n/// @dev This contract documents the revert reasons used in the Exchange contract.\n/// This contract is intended to serve as a reference, but is not actually used for efficiency reasons.\ncontract LibExchangeErrors {\n\n /// Order validation errors ///\n string constant ORDER_UNFILLABLE = \"ORDER_UNFILLABLE\"; // Order cannot be filled.\n string constant INVALID_MAKER = \"INVALID_MAKER\"; // Invalid makerAddress.\n string constant INVALID_TAKER = \"INVALID_TAKER\"; // Invalid takerAddress.\n string constant INVALID_SENDER = \"INVALID_SENDER\"; // Invalid `msg.sender`.\n string constant INVALID_ORDER_SIGNATURE = \"INVALID_ORDER_SIGNATURE\"; // Signature validation failed. \n \n /// fillOrder validation errors ///\n string constant INVALID_TAKER_AMOUNT = \"INVALID_TAKER_AMOUNT\"; // takerAssetFillAmount cannot equal 0.\n string constant ROUNDING_ERROR = \"ROUNDING_ERROR\"; // Rounding error greater than 0.1% of takerAssetFillAmount. \n \n /// Signature validation errors ///\n string constant INVALID_SIGNATURE = \"INVALID_SIGNATURE\"; // Signature validation failed. \n string constant SIGNATURE_ILLEGAL = \"SIGNATURE_ILLEGAL\"; // Signature type is illegal.\n string constant SIGNATURE_UNSUPPORTED = \"SIGNATURE_UNSUPPORTED\"; // Signature type unsupported.\n \n /// cancelOrdersUptTo errors ///\n string constant INVALID_NEW_ORDER_EPOCH = \"INVALID_NEW_ORDER_EPOCH\"; // Specified salt must be greater than or equal to existing orderEpoch.\n\n /// fillOrKillOrder errors ///\n string constant COMPLETE_FILL_FAILED = \"COMPLETE_FILL_FAILED\"; // Desired takerAssetFillAmount could not be completely filled. \n\n /// matchOrders errors ///\n string constant NEGATIVE_SPREAD_REQUIRED = \"NEGATIVE_SPREAD_REQUIRED\"; // Matched orders must have a negative spread.\n\n /// Transaction errors ///\n string constant REENTRANCY_ILLEGAL = \"REENTRANCY_ILLEGAL\"; // Recursive reentrancy is not allowed. \n string constant INVALID_TX_HASH = \"INVALID_TX_HASH\"; // Transaction has already been executed. \n string constant INVALID_TX_SIGNATURE = \"INVALID_TX_SIGNATURE\"; // Signature validation failed. \n string constant FAILED_EXECUTION = \"FAILED_EXECUTION\"; // Transaction execution failed. \n \n /// registerAssetProxy errors ///\n string constant ASSET_PROXY_ALREADY_EXISTS = \"ASSET_PROXY_ALREADY_EXISTS\"; // AssetProxy with same id already exists.\n\n /// dispatchTransferFrom errors ///\n string constant ASSET_PROXY_DOES_NOT_EXIST = \"ASSET_PROXY_DOES_NOT_EXIST\"; // No assetProxy registered at given id.\n string constant TRANSFER_FAILED = \"TRANSFER_FAILED\"; // Asset transfer unsuccesful.\n\n /// Length validation errors ///\n string constant LENGTH_GREATER_THAN_0_REQUIRED = \"LENGTH_GREATER_THAN_0_REQUIRED\"; // Byte array must have a length greater than 0.\n string constant LENGTH_GREATER_THAN_3_REQUIRED = \"LENGTH_GREATER_THAN_3_REQUIRED\"; // Byte array must have a length greater than 3.\n string constant LENGTH_0_REQUIRED = \"LENGTH_0_REQUIRED\"; // Byte array must have a length of 0.\n string constant LENGTH_65_REQUIRED = \"LENGTH_65_REQUIRED\"; // Byte array must have a length of 65.\n}\n",
- "2.0.0/protocol/Exchange/libs/LibFillResults.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract LibFillResults is\n SafeMath\n{\n\n struct FillResults {\n uint256 makerAssetFilledAmount; // Total amount of makerAsset(s) filled.\n uint256 takerAssetFilledAmount; // Total amount of takerAsset(s) filled.\n uint256 makerFeePaid; // Total amount of ZRX paid by maker(s) to feeRecipient(s).\n uint256 takerFeePaid; // Total amount of ZRX paid by taker to feeRecipients(s).\n }\n\n struct MatchedFillResults {\n FillResults left; // Amounts filled and fees paid of left order.\n FillResults right; // Amounts filled and fees paid of right order.\n uint256 leftMakerAssetSpreadAmount; // Spread between price of left and right order, denominated in the left order's makerAsset, paid to taker.\n }\n\n /// @dev Adds properties of both FillResults instances.\n /// Modifies the first FillResults instance specified.\n /// @param totalFillResults Fill results instance that will be added onto.\n /// @param singleFillResults Fill results instance that will be added to totalFillResults.\n function addFillResults(FillResults memory totalFillResults, FillResults memory singleFillResults)\n internal\n pure\n {\n totalFillResults.makerAssetFilledAmount = safeAdd(totalFillResults.makerAssetFilledAmount, singleFillResults.makerAssetFilledAmount);\n totalFillResults.takerAssetFilledAmount = safeAdd(totalFillResults.takerAssetFilledAmount, singleFillResults.takerAssetFilledAmount);\n totalFillResults.makerFeePaid = safeAdd(totalFillResults.makerFeePaid, singleFillResults.makerFeePaid);\n totalFillResults.takerFeePaid = safeAdd(totalFillResults.takerFeePaid, singleFillResults.takerFeePaid);\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibMath.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract LibMath is\n SafeMath\n{\n\n /// @dev Calculates partial value given a numerator and denominator.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target.\n function getPartialAmount(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n partialAmount = safeDiv(\n safeMul(numerator, target),\n denominator\n );\n return partialAmount;\n }\n\n /// @dev Checks if rounding error > 0.1%.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to multiply with numerator/denominator.\n /// @return Rounding error is present.\n function isRoundingError(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (bool isError)\n {\n uint256 remainder = mulmod(target, numerator, denominator);\n if (remainder == 0) {\n return false; // No rounding error.\n }\n\n uint256 errPercentageTimes1000000 = safeDiv(\n safeMul(remainder, 1000000),\n safeMul(numerator, target)\n );\n isError = errPercentageTimes1000000 > 1000;\n return isError;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibOrder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./LibEIP712.sol\";\n\n\ncontract LibOrder is\n LibEIP712\n{\n\n // Hash for the EIP712 Order Schema\n bytes32 constant internal EIP712_ORDER_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"Order(\",\n \"address makerAddress,\",\n \"address takerAddress,\",\n \"address feeRecipientAddress,\",\n \"address senderAddress,\",\n \"uint256 makerAssetAmount,\",\n \"uint256 takerAssetAmount,\",\n \"uint256 makerFee,\",\n \"uint256 takerFee,\",\n \"uint256 expirationTimeSeconds,\",\n \"uint256 salt,\",\n \"bytes makerAssetData,\",\n \"bytes takerAssetData\",\n \")\"\n ));\n\n // A valid order remains fillable until it is expired, fully filled, or cancelled.\n // An order's state is unaffected by external factors, like account balances.\n enum OrderStatus {\n INVALID, // Default value\n INVALID_MAKER_ASSET_AMOUNT, // Order does not have a valid maker asset amount\n INVALID_TAKER_ASSET_AMOUNT, // Order does not have a valid taker asset amount\n FILLABLE, // Order is fillable\n EXPIRED, // Order has already expired\n FULLY_FILLED, // Order is fully filled\n CANCELLED // Order has been cancelled\n }\n\n // solhint-disable max-line-length\n struct Order {\n address makerAddress; // Address that created the order. \n address takerAddress; // Address that is allowed to fill the order. If set to 0, any address is allowed to fill the order. \n address feeRecipientAddress; // Address that will recieve fees when order is filled. \n address senderAddress; // Address that is allowed to call Exchange contract methods that affect this order. If set to 0, any address is allowed to call these methods.\n uint256 makerAssetAmount; // Amount of makerAsset being offered by maker. Must be greater than 0. \n uint256 takerAssetAmount; // Amount of takerAsset being bid on by maker. Must be greater than 0. \n uint256 makerFee; // Amount of ZRX paid to feeRecipient by maker when order is filled. If set to 0, no transfer of ZRX from maker to feeRecipient will be attempted.\n uint256 takerFee; // Amount of ZRX paid to feeRecipient by taker when order is filled. If set to 0, no transfer of ZRX from taker to feeRecipient will be attempted.\n uint256 expirationTimeSeconds; // Timestamp in seconds at which order expires. \n uint256 salt; // Arbitrary number to facilitate uniqueness of the order's hash. \n bytes makerAssetData; // Encoded data that can be decoded by a specified proxy contract when transferring makerAsset. The last byte references the id of this proxy.\n bytes takerAssetData; // Encoded data that can be decoded by a specified proxy contract when transferring takerAsset. The last byte references the id of this proxy.\n }\n // solhint-enable max-line-length\n\n struct OrderInfo {\n uint8 orderStatus; // Status that describes order's validity and fillability.\n bytes32 orderHash; // EIP712 hash of the order (see LibOrder.getOrderHash).\n uint256 orderTakerAssetFilledAmount; // Amount of order that has already been filled.\n }\n\n /// @dev Calculates Keccak-256 hash of the order.\n /// @param order The order structure.\n /// @return Keccak-256 EIP712 hash of the order.\n function getOrderHash(Order memory order)\n internal\n view\n returns (bytes32 orderHash)\n {\n orderHash = hashEIP712Message(hashOrder(order));\n return orderHash;\n }\n\n /// @dev Calculates EIP712 hash of the order.\n /// @param order The order structure.\n /// @return EIP712 hash of the order.\n function hashOrder(Order memory order)\n internal\n pure\n returns (bytes32 result)\n {\n bytes32 schemaHash = EIP712_ORDER_SCHEMA_HASH;\n bytes32 makerAssetDataHash = keccak256(order.makerAssetData);\n bytes32 takerAssetDataHash = keccak256(order.takerAssetData);\n\n // Assembly for more efficiently computing:\n // keccak256(abi.encodePacked(\n // EIP712_ORDER_SCHEMA_HASH,\n // bytes32(order.makerAddress),\n // bytes32(order.takerAddress),\n // bytes32(order.feeRecipientAddress),\n // bytes32(order.senderAddress),\n // order.makerAssetAmount,\n // order.takerAssetAmount,\n // order.makerFee,\n // order.takerFee,\n // order.expirationTimeSeconds,\n // order.salt,\n // keccak256(order.makerAssetData),\n // keccak256(order.takerAssetData)\n // ));\n\n assembly {\n // Calculate memory addresses that will be swapped out before hashing\n let pos1 := sub(order, 32)\n let pos2 := add(order, 320)\n let pos3 := add(order, 352)\n\n // Backup\n let temp1 := mload(pos1)\n let temp2 := mload(pos2)\n let temp3 := mload(pos3)\n \n // Hash in place\n mstore(pos1, schemaHash)\n mstore(pos2, makerAssetDataHash)\n mstore(pos3, takerAssetDataHash)\n result := keccak256(pos1, 416)\n \n // Restore\n mstore(pos1, temp1)\n mstore(pos2, temp2)\n mstore(pos3, temp3)\n }\n return result;\n }\n}\n",
- "2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAssetProxyDispatcher.sol\";\n\n\ncontract MAssetProxyDispatcher is\n IAssetProxyDispatcher\n{\n\n // Logs registration of new asset proxy\n event AssetProxyRegistered(\n bytes4 id, // Id of new registered AssetProxy.\n address assetProxy // Address of new registered AssetProxy.\n );\n\n /// @dev Forwards arguments to assetProxy and calls `transferFrom`. Either succeeds or throws.\n /// @param assetData Byte array encoded for the asset.\n /// @param from Address to transfer token from.\n /// @param to Address to transfer token to.\n /// @param amount Amount of token to transfer.\n function dispatchTransferFrom(\n bytes memory assetData,\n address from,\n address to,\n uint256 amount\n )\n internal;\n}\n",
- "2.0.0/protocol/Exchange/mixins/MExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IExchangeCore.sol\";\n\n\ncontract MExchangeCore is\n IExchangeCore\n{\n // Fill event is emitted whenever an order is filled.\n event Fill(\n address indexed makerAddress, // Address that created the order. \n address indexed feeRecipientAddress, // Address that received fees.\n address takerAddress, // Address that filled the order.\n address senderAddress, // Address that called the Exchange contract (msg.sender).\n uint256 makerAssetFilledAmount, // Amount of makerAsset sold by maker and bought by taker. \n uint256 takerAssetFilledAmount, // Amount of takerAsset sold by taker and bought by maker.\n uint256 makerFeePaid, // Amount of ZRX paid to feeRecipient by maker.\n uint256 takerFeePaid, // Amount of ZRX paid to feeRecipient by taker.\n bytes32 indexed orderHash, // EIP712 hash of order (see LibOrder.getOrderHash).\n bytes makerAssetData, // Encoded data specific to makerAsset. \n bytes takerAssetData // Encoded data specific to takerAsset.\n );\n\n // Cancel event is emitted whenever an individual order is cancelled.\n event Cancel(\n address indexed makerAddress, // Address that created the order. \n address indexed feeRecipientAddress, // Address that would have recieved fees if order was filled. \n address senderAddress, // Address that called the Exchange contract (msg.sender).\n bytes32 indexed orderHash, // EIP712 hash of order (see LibOrder.getOrderHash).\n bytes makerAssetData, // Encoded data specific to makerAsset. \n bytes takerAssetData // Encoded data specific to takerAsset.\n );\n\n // CancelUpTo event is emitted whenever `cancelOrdersUpTo` is executed succesfully.\n event CancelUpTo(\n address indexed makerAddress, // Orders cancelled must have been created by this address.\n address indexed senderAddress, // Orders cancelled must have a `senderAddress` equal to this address.\n uint256 orderEpoch // Orders with specified makerAddress and senderAddress with a salt less than this value are considered cancelled.\n );\n\n /// @dev Updates state with results of a fill order.\n /// @param order that was filled.\n /// @param takerAddress Address of taker who filled the order.\n /// @param orderTakerAssetFilledAmount Amount of order already filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function updateFilledState(\n LibOrder.Order memory order,\n address takerAddress,\n bytes32 orderHash,\n uint256 orderTakerAssetFilledAmount,\n LibFillResults.FillResults memory fillResults\n )\n internal;\n\n /// @dev Updates state with results of cancelling an order.\n /// State is only updated if the order is currently fillable.\n /// Otherwise, updating state would have no effect.\n /// @param order that was cancelled.\n /// @param orderHash Hash of order that was cancelled.\n function updateCancelledState(\n LibOrder.Order memory order,\n bytes32 orderHash\n )\n internal;\n\n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo Status, orderHash, and amount already filled of order.\n /// @param takerAddress Address of order taker.\n /// @param takerAssetFillAmount Desired amount of order to fill by taker.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @param signature Proof that the orders was created by its maker.\n function assertValidFill(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo,\n address takerAddress,\n uint256 takerAssetFillAmount,\n uint256 takerAssetFilledAmount,\n bytes memory signature\n )\n internal\n view;\n\n /// @dev Validates context for cancelOrder. Succeeds or throws.\n /// @param order to be cancelled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n function assertValidCancel(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo\n )\n internal\n view;\n\n /// @dev Calculates amounts filled and fees paid by maker and taker.\n /// @param order to be filled.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function calculateFillResults(\n LibOrder.Order memory order,\n uint256 takerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.FillResults memory fillResults);\n\n}\n",
- "2.0.0/protocol/Exchange/mixins/MMatchOrders.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IMatchOrders.sol\";\n\n\ncontract MMatchOrders is\n IMatchOrders\n{\n\n /// @dev Validates context for matchOrders. Succeeds or throws.\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n function assertValidMatch(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder\n )\n internal\n pure;\n\n /// @dev Calculates fill amounts for the matched orders.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the leftOrder order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftOrderTakerAssetFilledAmount Amount of left order already filled.\n /// @param rightOrderTakerAssetFilledAmount Amount of right order already filled.\n /// @param matchedFillResults Amounts to fill and fees to pay by maker and taker of matched orders.\n function calculateMatchedFillResults(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n uint256 leftOrderTakerAssetFilledAmount,\n uint256 rightOrderTakerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.MatchedFillResults memory matchedFillResults);\n\n}\n",
- "2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/ISignatureValidator.sol\";\n\n\ncontract MSignatureValidator is\n ISignatureValidator\n{\n event SignatureValidatorApproval(\n address indexed signerAddress, // Address that approves or disapproves a contract to verify signatures.\n address indexed validatorAddress, // Address of signature validator contract.\n bool approved // Approval or disapproval of validator contract.\n );\n\n // Allowed signature types.\n enum SignatureType {\n Illegal, // 0x00, default value\n Invalid, // 0x01\n EIP712, // 0x02\n EthSign, // 0x03\n Caller, // 0x04\n Wallet, // 0x05\n Validator, // 0x06\n PreSigned, // 0x07\n Trezor, // 0x08\n NSignatureTypes // 0x09, number of signature types. Always leave at end.\n }\n}\n",
- "2.0.0/protocol/Exchange/mixins/MTransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\nimport \"../interfaces/ITransactions.sol\";\n\n\ncontract MTransactions is\n ITransactions\n{\n\n /// @dev The current function will be called in the context of this address (either 0x transaction signer or `msg.sender`).\n /// If calling a fill function, this address will represent the taker.\n /// If calling a cancel function, this address will represent the maker.\n /// @return Signer of 0x transaction if entry point is `executeTransaction`.\n /// `msg.sender` if entry point is any other function.\n function getCurrentContextAddress()\n internal\n view\n returns (address);\n}\n",
- "2.0.0/test/DummyERC20Token/DummyERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"../../tokens/ERC20Token/MintableERC20Token.sol\";\n\n\ncontract DummyERC20Token is \n Ownable,\n MintableERC20Token\n{\n string public name;\n string public symbol;\n uint256 public decimals;\n uint256 public constant MAX_MINT_AMOUNT = 10000000000000000000000;\n\n constructor (\n string _name,\n string _symbol,\n uint256 _decimals,\n uint256 _totalSupply\n )\n public\n {\n name = _name;\n symbol = _symbol;\n decimals = _decimals;\n _totalSupply = _totalSupply;\n balances[msg.sender] = _totalSupply;\n }\n\n /// @dev Sets the balance of target address\n /// @param _target Address or which balance will be updated\n /// @param _value New balance of target address\n function setBalance(address _target, uint256 _value)\n external\n onlyOwner\n {\n uint256 currBalance = balances[_target];\n if (_value < currBalance) {\n _totalSupply = safeSub(_totalSupply, safeSub(currBalance, _value));\n } else {\n _totalSupply = safeAdd(_totalSupply, safeSub(_value, currBalance));\n }\n balances[_target] = _value;\n }\n\n /// @dev Mints new tokens for sender\n /// @param _value Amount of tokens to mint\n function mint(uint256 _value)\n external\n {\n require(\n _value <= MAX_MINT_AMOUNT,\n \"VALUE_TOO_LARGE\"\n );\n\n _mint(msg.sender, _value);\n }\n}\n",
- "2.0.0/test/DummyERC721Token/DummyERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../tokens/ERC721Token/MintableERC721Token.sol\";\nimport \"../../utils/Ownable/Ownable.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract DummyERC721Token is\n Ownable,\n MintableERC721Token\n{\n string public name;\n string public symbol;\n\n constructor (\n string _name,\n string _symbol\n )\n public\n {\n name = _name;\n symbol = _symbol;\n }\n\n /// @dev Function to mint a new token\n /// Reverts if the given token ID already exists\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _tokenId ID of the token to be minted by the msg.sender \n function mint(address _to, uint256 _tokenId)\n external\n {\n _mint(_to, _tokenId);\n }\n\n /// @dev Function to burn a token\n /// Reverts if the given token ID doesn't exist or not called by contract owner\n /// @param _owner Owner of token with given token ID\n /// @param _tokenId ID of the token to be burned by the msg.sender\n function burn(address _owner, uint256 _tokenId)\n external\n onlyOwner\n {\n _burn(_owner, _tokenId);\n }\n}\n",
- "2.0.0/tokens/ERC20Token/ERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IERC20Token.sol\";\n\n\ncontract ERC20Token is\n IERC20Token\n{\n\n mapping (address => uint256) internal balances;\n mapping (address => mapping (address => uint256)) internal allowed;\n\n uint256 internal _totalSupply;\n\n /// @dev send `value` token to `to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transfer(address _to, uint256 _value)\n external\n returns (bool)\n {\n require(\n balances[msg.sender] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[msg.sender] -= _value;\n balances[_to] += _value;\n\n emit Transfer(\n msg.sender,\n _to,\n _value\n );\n\n return true;\n }\n\n /// @dev send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool)\n {\n require(\n balances[_from] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n allowed[_from][msg.sender] >= _value,\n \"ERC20_INSUFFICIENT_ALLOWANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[_to] += _value;\n balances[_from] -= _value;\n allowed[_from][msg.sender] -= _value;\n \n emit Transfer(\n _from,\n _to,\n _value\n );\n \n return true;\n }\n\n /// @dev `msg.sender` approves `_spender` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Always true if the call has enough gas to complete execution\n function approve(address _spender, uint256 _value)\n external\n returns (bool)\n {\n allowed[msg.sender][_spender] = _value;\n emit Approval(\n msg.sender,\n _spender,\n _value\n );\n return true;\n }\n\n /// @dev Query total supply of token\n /// @return Total supply of token\n function totalSupply()\n external\n view\n returns (uint256)\n {\n return _totalSupply;\n }\n\n /// @dev Query the balance of owner\n /// @param _owner The address from which the balance will be retrieved\n /// @return Balance of owner\n function balanceOf(address _owner)\n external\n view\n returns (uint256)\n {\n return balances[_owner];\n }\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender)\n external\n view\n returns (uint256)\n {\n return allowed[_owner][_spender];\n }\n}\n",
- "2.0.0/tokens/ERC20Token/IERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC20Token {\n\n // solhint-disable no-simple-event-func-name\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 _value\n );\n\n event Approval(\n address indexed _owner,\n address indexed _spender,\n uint256 _value\n );\n\n /// @dev send `value` token to `to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transfer(address _to, uint256 _value)\n external\n returns (bool);\n\n /// @dev send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool);\n \n /// @dev `msg.sender` approves `_spender` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Always true if the call has enough gas to complete execution\n function approve(address _spender, uint256 _value)\n external\n returns (bool);\n\n /// @dev Query total supply of token\n /// @return Total supply of token\n function totalSupply()\n external\n view\n returns (uint256);\n \n /// @param _owner The address from which the balance will be retrieved\n /// @return Balance of owner\n function balanceOf(address _owner)\n external\n view\n returns (uint256);\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender)\n external\n view\n returns (uint256);\n}\n",
- "2.0.0/tokens/ERC20Token/MintableERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/SafeMath/SafeMath.sol\";\nimport \"./UnlimitedAllowanceERC20Token.sol\";\n\n\ncontract MintableERC20Token is \n SafeMath,\n UnlimitedAllowanceERC20Token\n{\n\n /// @dev Mints new tokens\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _value Amount of tokens to mint\n function _mint(address _to, uint256 _value)\n internal\n {\n balances[_to] = safeAdd(_value, balances[_to]);\n _totalSupply = safeAdd(_totalSupply, _value);\n\n emit Transfer(\n address(0),\n _to,\n _value\n );\n }\n\n /// @dev Mints new tokens\n /// @param _owner Owner of tokens that will be burned\n /// @param _value Amount of tokens to burn\n function _burn(address _owner, uint256 _value)\n internal\n {\n balances[_owner] = safeSub(balances[_owner], _value);\n _totalSupply = safeSub(_totalSupply, _value);\n\n emit Transfer(\n _owner,\n address(0),\n _value\n );\n }\n}\n",
- "2.0.0/tokens/ERC20Token/UnlimitedAllowanceERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../ERC20Token/ERC20Token.sol\";\n\n\ncontract UnlimitedAllowanceERC20Token is\n ERC20Token\n{\n\n uint256 constant internal MAX_UINT = 2**256 - 1;\n\n /// @dev ERC20 transferFrom, modified such that an allowance of MAX_UINT represents an unlimited allowance. See https://github.com/ethereum/EIPs/issues/717\n /// @param _from Address to transfer from.\n /// @param _to Address to transfer to.\n /// @param _value Amount to transfer.\n /// @return Success of transfer.\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool)\n {\n uint256 allowance = allowed[_from][msg.sender];\n require(\n balances[_from] >= _value,\n \"ERC20_INSUFFICIENT_BALANCE\"\n );\n require(\n allowance >= _value,\n \"ERC20_INSUFFICIENT_ALLOWANCE\"\n );\n require(\n balances[_to] + _value >= balances[_to],\n \"UINT256_OVERFLOW\"\n );\n\n balances[_to] += _value;\n balances[_from] -= _value;\n if (allowance < MAX_UINT) {\n allowed[_from][msg.sender] -= _value;\n }\n\n emit Transfer(\n _from,\n _to,\n _value\n );\n\n return true;\n }\n}\n",
- "2.0.0/tokens/ERC721Token/ERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IERC721Token.sol\";\nimport \"./IERC721Receiver.sol\";\nimport \"../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract ERC721Token is\n IERC721Token,\n SafeMath\n{\n // Function selector for ERC721Receiver.onERC721Received\n // 0x150b7a02\n bytes4 constant internal ERC721_RECEIVED = bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"));\n\n // Mapping of tokenId => owner\n mapping (uint256 => address) internal owners;\n\n // Mapping of tokenId => approved address\n mapping (uint256 => address) internal approvals;\n\n // Mapping of owner => number of tokens owned\n mapping (address => uint256) internal balances;\n\n // Mapping of owner => operator => approved\n mapping (address => mapping (address => bool)) internal operatorApprovals;\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT. When transfer is complete, this function\n /// checks if `_to` is a smart contract (code size > 0). If so, it calls\n /// `onERC721Received` on `_to` and throws if the return value is not\n /// `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n /// @param _data Additional data with no specified format, sent in call to `_to`\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId,\n bytes _data\n )\n external\n {\n transferFrom(\n _from,\n _to,\n _tokenId\n );\n\n uint256 receiverCodeSize;\n assembly {\n receiverCodeSize := extcodesize(_to)\n }\n if (receiverCodeSize > 0) {\n bytes4 selector = IERC721Receiver(_to).onERC721Received(\n msg.sender,\n _from,\n _tokenId,\n _data\n );\n require(\n selector == ERC721_RECEIVED,\n \"ERC721_INVALID_SELECTOR\"\n );\n }\n }\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev This works identically to the other function with an extra data parameter,\n /// except this function just sets data to \"\".\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n external\n {\n transferFrom(\n _from,\n _to,\n _tokenId\n );\n\n uint256 receiverCodeSize;\n assembly {\n receiverCodeSize := extcodesize(_to)\n }\n if (receiverCodeSize > 0) {\n bytes4 selector = IERC721Receiver(_to).onERC721Received(\n msg.sender,\n _from,\n _tokenId,\n \"\"\n );\n require(\n selector == ERC721_RECEIVED,\n \"ERC721_INVALID_SELECTOR\"\n );\n }\n }\n\n /// @notice Change or reaffirm the approved address for an NFT\n /// @dev The zero address indicates there is no approved address.\n /// Throws unless `msg.sender` is the current NFT owner, or an authorized\n /// operator of the current owner.\n /// @param _approved The new approved NFT controller\n /// @param _tokenId The NFT to approve\n function approve(address _approved, uint256 _tokenId)\n external\n {\n address owner = ownerOf(_tokenId);\n require(\n msg.sender == owner || isApprovedForAll(owner, msg.sender),\n \"ERC721_INVALID_SENDER\"\n );\n\n approvals[_tokenId] = _approved;\n emit Approval(\n owner,\n _approved,\n _tokenId\n );\n }\n\n /// @notice Enable or disable approval for a third party (\"operator\") to manage\n /// all of `msg.sender`'s assets\n /// @dev Emits the ApprovalForAll event. The contract MUST allow\n /// multiple operators per owner.\n /// @param _operator Address to add to the set of authorized operators\n /// @param _approved True if the operator is approved, false to revoke approval\n function setApprovalForAll(address _operator, bool _approved)\n external\n {\n operatorApprovals[msg.sender][_operator] = _approved;\n emit ApprovalForAll(\n msg.sender,\n _operator,\n _approved\n );\n }\n \n /// @notice Count all NFTs assigned to an owner\n /// @dev NFTs assigned to the zero address are considered invalid, and this\n /// function throws for queries about the zero address.\n /// @param _owner An address for whom to query the balance\n /// @return The number of NFTs owned by `_owner`, possibly zero\n function balanceOf(address _owner)\n external\n view\n returns (uint256)\n {\n require(\n _owner != address(0),\n \"ERC721_ZERO_OWNER\"\n );\n return balances[_owner];\n }\n\n /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE\n /// TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE\n /// THEY MAY BE PERMANENTLY LOST\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function transferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n public\n {\n require(\n _to != address(0),\n \"ERC721_ZERO_TO_ADDRESS\"\n );\n\n address owner = ownerOf(_tokenId);\n require(\n _from == owner,\n \"ERC721_OWNER_MISMATCH\"\n );\n\n address spender = msg.sender;\n address approvedAddress = getApproved(_tokenId);\n require(\n spender == owner ||\n isApprovedForAll(owner, spender) ||\n approvedAddress == spender,\n \"ERC721_INVALID_SPENDER\"\n );\n\n if (approvedAddress != address(0)) {\n approvals[_tokenId] = address(0);\n }\n\n owners[_tokenId] = _to;\n balances[_from] = safeSub(balances[_from], 1);\n balances[_to] = safeAdd(balances[_to], 1);\n \n emit Transfer(\n _from,\n _to,\n _tokenId\n );\n }\n\n /// @notice Find the owner of an NFT\n /// @dev NFTs assigned to zero address are considered invalid, and queries\n /// about them do throw.\n /// @param _tokenId The identifier for an NFT\n /// @return The address of the owner of the NFT\n function ownerOf(uint256 _tokenId)\n public\n view\n returns (address)\n {\n address owner = owners[_tokenId];\n require(\n owner != address(0),\n \"ERC721_ZERO_OWNER\"\n );\n return owner;\n }\n\n /// @notice Get the approved address for a single NFT\n /// @dev Throws if `_tokenId` is not a valid NFT.\n /// @param _tokenId The NFT to find the approved address for\n /// @return The approved address for this NFT, or the zero address if there is none\n function getApproved(uint256 _tokenId)\n public\n view\n returns (address)\n {\n return approvals[_tokenId];\n }\n\n /// @notice Query if an address is an authorized operator for another address\n /// @param _owner The address that owns the NFTs\n /// @param _operator The address that acts on behalf of the owner\n /// @return True if `_operator` is an approved operator for `_owner`, false otherwise\n function isApprovedForAll(address _owner, address _operator)\n public\n view\n returns (bool)\n {\n return operatorApprovals[_owner][_operator];\n }\n}\n",
- "2.0.0/tokens/ERC721Token/IERC721Receiver.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC721Receiver {\n\n /// @notice Handle the receipt of an NFT\n /// @dev The ERC721 smart contract calls this function on the recipient\n /// after a `transfer`. This function MAY throw to revert and reject the\n /// transfer. Return of other than the magic value MUST result in the\n /// transaction being reverted.\n /// Note: the contract address is always the message sender.\n /// @param _operator The address which called `safeTransferFrom` function\n /// @param _from The address which previously owned the token\n /// @param _tokenId The NFT identifier which is being transferred\n /// @param _data Additional data with no specified format\n /// @return `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`\n /// unless throwing\n function onERC721Received(\n address _operator,\n address _from,\n uint256 _tokenId,\n bytes _data\n )\n external\n returns (bytes4);\n}\n",
- "2.0.0/tokens/ERC721Token/IERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC721Token {\n\n /// @dev This emits when ownership of any NFT changes by any mechanism.\n /// This event emits when NFTs are created (`from` == 0) and destroyed\n /// (`to` == 0). Exception: during contract creation, any number of NFTs\n /// may be created and assigned without emitting Transfer. At the time of\n /// any transfer, the approved address for that NFT (if any) is reset to none.\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 indexed _tokenId\n );\n\n /// @dev This emits when the approved address for an NFT is changed or\n /// reaffirmed. The zero address indicates there is no approved address.\n /// When a Transfer event emits, this also indicates that the approved\n /// address for that NFT (if any) is reset to none.\n event Approval(\n address indexed _owner,\n address indexed _approved,\n uint256 indexed _tokenId\n );\n\n /// @dev This emits when an operator is enabled or disabled for an owner.\n /// The operator can manage all NFTs of the owner.\n event ApprovalForAll(\n address indexed _owner,\n address indexed _operator,\n bool _approved\n );\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// perator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT. When transfer is complete, this function\n /// checks if `_to` is a smart contract (code size > 0). If so, it calls\n /// `onERC721Received` on `_to` and throws if the return value is not\n /// `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n /// @param _data Additional data with no specified format, sent in call to `_to`\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId,\n bytes _data\n )\n external;\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev This works identically to the other function with an extra data parameter,\n /// except this function just sets data to \"\".\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n external;\n\n /// @notice Change or reaffirm the approved address for an NFT\n /// @dev The zero address indicates there is no approved address.\n /// Throws unless `msg.sender` is the current NFT owner, or an authorized\n /// operator of the current owner.\n /// @param _approved The new approved NFT controller\n /// @param _tokenId The NFT to approve\n function approve(address _approved, uint256 _tokenId)\n external;\n\n /// @notice Enable or disable approval for a third party (\"operator\") to manage\n /// all of `msg.sender`'s assets\n /// @dev Emits the ApprovalForAll event. The contract MUST allow\n /// multiple operators per owner.\n /// @param _operator Address to add to the set of authorized operators\n /// @param _approved True if the operator is approved, false to revoke approval\n function setApprovalForAll(address _operator, bool _approved)\n external;\n\n /// @notice Count all NFTs assigned to an owner\n /// @dev NFTs assigned to the zero address are considered invalid, and this\n /// function throws for queries about the zero address.\n /// @param _owner An address for whom to query the balance\n /// @return The number of NFTs owned by `_owner`, possibly zero\n function balanceOf(address _owner)\n external\n view\n returns (uint256);\n\n /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE\n /// TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE\n /// THEY MAY BE PERMANENTLY LOST\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function transferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n public;\n\n /// @notice Find the owner of an NFT\n /// @dev NFTs assigned to zero address are considered invalid, and queries\n /// about them do throw.\n /// @param _tokenId The identifier for an NFT\n /// @return The address of the owner of the NFT\n function ownerOf(uint256 _tokenId)\n public\n view\n returns (address);\n\n /// @notice Get the approved address for a single NFT\n /// @dev Throws if `_tokenId` is not a valid NFT.\n /// @param _tokenId The NFT to find the approved address for\n /// @return The approved address for this NFT, or the zero address if there is none\n function getApproved(uint256 _tokenId) \n public\n view\n returns (address);\n \n /// @notice Query if an address is an authorized operator for another address\n /// @param _owner The address that owns the NFTs\n /// @param _operator The address that acts on behalf of the owner\n /// @return True if `_operator` is an approved operator for `_owner`, false otherwise\n function isApprovedForAll(address _owner, address _operator)\n public\n view\n returns (bool);\n}\n",
- "2.0.0/tokens/ERC721Token/MintableERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./ERC721Token.sol\";\n\n\ncontract MintableERC721Token is\n ERC721Token\n{\n\n /// @dev Function to mint a new token\n /// Reverts if the given token ID already exists\n /// @param _to Address of the beneficiary that will own the minted token\n /// @param _tokenId ID of the token to be minted by the msg.sender \n function _mint(address _to, uint256 _tokenId)\n internal\n {\n require(\n _to != address(0),\n \"ERC721_ZERO_TO_ADDRESS\"\n );\n\n address owner = owners[_tokenId];\n require(\n owner == address(0),\n \"ERC721_OWNER_ALREADY_EXISTS\"\n );\n\n owners[_tokenId] = _to;\n balances[_to] = safeAdd(balances[_to], 1);\n\n emit Transfer(\n address(0),\n _to,\n _tokenId\n );\n }\n\n /// @dev Function to burn a token\n /// Reverts if the given token ID doesn't exist\n /// @param _owner Owner of token with given token ID\n /// @param _tokenId ID of the token to be burned by the msg.sender\n function _burn(address _owner, uint256 _tokenId)\n internal\n {\n require(\n _owner != address(0),\n \"ERC721_ZERO_OWNER_ADDRESS\"\n );\n\n address owner = owners[_tokenId];\n require(\n owner == _owner,\n \"ERC721_OWNER_MISMATCH\"\n );\n\n owners[_tokenId] = address(0);\n balances[_owner] = safeSub(balances[_owner], 1);\n\n emit Transfer(\n _owner,\n address(0),\n _tokenId\n );\n }\n}\n",
- "2.0.0/tokens/EtherToken/IEtherToken.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../ERC20Token/IERC20Token.sol\";\n\n\ncontract IEtherToken is\n IERC20Token\n{\n function deposit()\n public\n payable;\n \n function withdraw(uint256 amount)\n public;\n}\n",
- "2.0.0/utils/LibBytes/LibBytes.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\nlibrary LibBytes {\n\n using LibBytes for bytes;\n\n /// @dev Gets the memory address for a byte array.\n /// @param input Byte array to lookup.\n /// @return memoryAddress Memory address of byte array. This\n /// points to the header of the byte array which contains\n /// the length.\n function rawAddress(bytes memory input)\n internal\n pure\n returns (uint256 memoryAddress)\n {\n assembly {\n memoryAddress := input\n }\n return memoryAddress;\n }\n \n /// @dev Gets the memory address for the contents of a byte array.\n /// @param input Byte array to lookup.\n /// @return memoryAddress Memory address of the contents of the byte array.\n function contentAddress(bytes memory input)\n internal\n pure\n returns (uint256 memoryAddress)\n {\n assembly {\n memoryAddress := add(input, 32)\n }\n return memoryAddress;\n }\n\n /// @dev Copies `length` bytes from memory location `source` to `dest`.\n /// @param dest memory address to copy bytes to.\n /// @param source memory address to copy bytes from.\n /// @param length number of bytes to copy.\n function memCopy(\n uint256 dest,\n uint256 source,\n uint256 length\n )\n internal\n pure\n {\n if (length < 32) {\n // Handle a partial word by reading destination and masking\n // off the bits we are interested in.\n // This correctly handles overlap, zero lengths and source == dest\n assembly {\n let mask := sub(exp(256, sub(32, length)), 1)\n let s := and(mload(source), not(mask))\n let d := and(mload(dest), mask)\n mstore(dest, or(s, d))\n }\n } else {\n // Skip the O(length) loop when source == dest.\n if (source == dest) {\n return;\n }\n\n // For large copies we copy whole words at a time. The final\n // word is aligned to the end of the range (instead of after the\n // previous) to handle partial words. So a copy will look like this:\n //\n // ####\n // ####\n // ####\n // ####\n //\n // We handle overlap in the source and destination range by\n // changing the copying direction. This prevents us from\n // overwriting parts of source that we still need to copy.\n //\n // This correctly handles source == dest\n //\n if (source > dest) {\n assembly {\n // We subtract 32 from `sEnd` and `dEnd` because it\n // is easier to compare with in the loop, and these\n // are also the addresses we need for copying the\n // last bytes.\n length := sub(length, 32)\n let sEnd := add(source, length)\n let dEnd := add(dest, length)\n\n // Remember the last 32 bytes of source\n // This needs to be done here and not after the loop\n // because we may have overwritten the last bytes in\n // source already due to overlap.\n let last := mload(sEnd)\n\n // Copy whole words front to back\n // Note: the first check is always true,\n // this could have been a do-while loop.\n // solhint-disable-next-line no-empty-blocks\n for {} lt(source, sEnd) {} {\n mstore(dest, mload(source))\n source := add(source, 32)\n dest := add(dest, 32)\n }\n \n // Write the last 32 bytes\n mstore(dEnd, last)\n }\n } else {\n assembly {\n // We subtract 32 from `sEnd` and `dEnd` because those\n // are the starting points when copying a word at the end.\n length := sub(length, 32)\n let sEnd := add(source, length)\n let dEnd := add(dest, length)\n\n // Remember the first 32 bytes of source\n // This needs to be done here and not after the loop\n // because we may have overwritten the first bytes in\n // source already due to overlap.\n let first := mload(source)\n\n // Copy whole words back to front\n // We use a signed comparisson here to allow dEnd to become\n // negative (happens when source and dest < 32). Valid\n // addresses in local memory will never be larger than\n // 2**255, so they can be safely re-interpreted as signed.\n // Note: the first check is always true,\n // this could have been a do-while loop.\n // solhint-disable-next-line no-empty-blocks\n for {} slt(dest, dEnd) {} {\n mstore(dEnd, mload(sEnd))\n sEnd := sub(sEnd, 32)\n dEnd := sub(dEnd, 32)\n }\n \n // Write the first 32 bytes\n mstore(dest, first)\n }\n }\n }\n }\n\n /// @dev Returns a slices from a byte array.\n /// @param b The byte array to take a slice from.\n /// @param from The starting index for the slice (inclusive).\n /// @param to The final index for the slice (exclusive).\n /// @return result The slice containing bytes at indices [from, to)\n function slice(\n bytes memory b,\n uint256 from,\n uint256 to\n )\n internal\n pure\n returns (bytes memory result)\n {\n require(\n from <= to,\n \"FROM_LESS_THAN_TO_REQUIRED\"\n );\n require(\n to < b.length,\n \"TO_LESS_THAN_LENGTH_REQUIRED\"\n );\n \n // Create a new bytes structure and copy contents\n result = new bytes(to - from);\n memCopy(\n result.contentAddress(),\n b.contentAddress() + from,\n result.length);\n return result;\n }\n \n /// @dev Returns a slice from a byte array without preserving the input.\n /// @param b The byte array to take a slice from. Will be destroyed in the process.\n /// @param from The starting index for the slice (inclusive).\n /// @param to The final index for the slice (exclusive).\n /// @return result The slice containing bytes at indices [from, to)\n /// @dev When `from == 0`, the original array will match the slice. In other cases its state will be corrupted.\n function sliceDestructive(\n bytes memory b,\n uint256 from,\n uint256 to\n )\n internal\n pure\n returns (bytes memory result)\n {\n require(\n from <= to,\n \"FROM_LESS_THAN_TO_REQUIRED\"\n );\n require(\n to < b.length,\n \"TO_LESS_THAN_LENGTH_REQUIRED\"\n );\n \n // Create a new bytes structure around [from, to) in-place.\n assembly {\n result := add(b, from)\n mstore(result, sub(to, from))\n }\n return result;\n }\n\n /// @dev Pops the last byte off of a byte array by modifying its length.\n /// @param b Byte array that will be modified.\n /// @return The byte that was popped off.\n function popLastByte(bytes memory b)\n internal\n pure\n returns (bytes1 result)\n {\n require(\n b.length > 0,\n \"GREATER_THAN_ZERO_LENGTH_REQUIRED\"\n );\n\n // Store last byte.\n result = b[b.length - 1];\n\n assembly {\n // Decrement length of byte array.\n let newLen := sub(mload(b), 1)\n mstore(b, newLen)\n }\n return result;\n }\n\n /// @dev Pops the last 20 bytes off of a byte array by modifying its length.\n /// @param b Byte array that will be modified.\n /// @return The 20 byte address that was popped off.\n function popLast20Bytes(bytes memory b)\n internal\n pure\n returns (address result)\n {\n require(\n b.length >= 20,\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Store last 20 bytes.\n result = readAddress(b, b.length - 20);\n\n assembly {\n // Subtract 20 from byte array length.\n let newLen := sub(mload(b), 20)\n mstore(b, newLen)\n }\n return result;\n }\n\n /// @dev Tests equality of two byte arrays.\n /// @param lhs First byte array to compare.\n /// @param rhs Second byte array to compare.\n /// @return True if arrays are the same. False otherwise.\n function equals(\n bytes memory lhs,\n bytes memory rhs\n )\n internal\n pure\n returns (bool equal)\n {\n // Keccak gas cost is 30 + numWords * 6. This is a cheap way to compare.\n // We early exit on unequal lengths, but keccak would also correctly\n // handle this.\n return lhs.length == rhs.length && keccak256(lhs) == keccak256(rhs);\n }\n\n /// @dev Reads an address from a position in a byte array.\n /// @param b Byte array containing an address.\n /// @param index Index in byte array of address.\n /// @return address from byte array.\n function readAddress(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (address result)\n {\n require(\n b.length >= index + 20, // 20 is length of address\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Add offset to index:\n // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)\n // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)\n index += 20;\n\n // Read address from array memory\n assembly {\n // 1. Add index to address of bytes array\n // 2. Load 32-byte word from memory\n // 3. Apply 20-byte mask to obtain address\n result := and(mload(add(b, index)), 0xffffffffffffffffffffffffffffffffffffffff)\n }\n return result;\n }\n\n /// @dev Writes an address into a specific position in a byte array.\n /// @param b Byte array to insert address into.\n /// @param index Index in byte array of address.\n /// @param input Address to put into byte array.\n function writeAddress(\n bytes memory b,\n uint256 index,\n address input\n )\n internal\n pure\n {\n require(\n b.length >= index + 20, // 20 is length of address\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Add offset to index:\n // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)\n // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)\n index += 20;\n\n // Store address into array memory\n assembly {\n // The address occupies 20 bytes and mstore stores 32 bytes.\n // First fetch the 32-byte word where we'll be storing the address, then\n // apply a mask so we have only the bytes in the word that the address will not occupy.\n // Then combine these bytes with the address and store the 32 bytes back to memory with mstore.\n\n // 1. Add index to address of bytes array\n // 2. Load 32-byte word from memory\n // 3. Apply 12-byte mask to obtain extra bytes occupying word of memory where we'll store the address\n let neighbors := and(\n mload(add(b, index)),\n 0xffffffffffffffffffffffff0000000000000000000000000000000000000000\n )\n \n // Make sure input address is clean.\n // (Solidity does not guarantee this)\n input := and(input, 0xffffffffffffffffffffffffffffffffffffffff)\n\n // Store the neighbors and address into memory\n mstore(add(b, index), xor(input, neighbors))\n }\n }\n\n /// @dev Reads a bytes32 value from a position in a byte array.\n /// @param b Byte array containing a bytes32 value.\n /// @param index Index in byte array of bytes32 value.\n /// @return bytes32 value from byte array.\n function readBytes32(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes32 result)\n {\n require(\n b.length >= index + 32,\n \"GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 256 bit length parameter\n index += 32;\n\n // Read the bytes32 from array memory\n assembly {\n result := mload(add(b, index))\n }\n return result;\n }\n\n /// @dev Writes a bytes32 into a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input bytes32 to put into byte array.\n function writeBytes32(\n bytes memory b,\n uint256 index,\n bytes32 input\n )\n internal\n pure\n {\n require(\n b.length >= index + 32,\n \"GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 256 bit length parameter\n index += 32;\n\n // Read the bytes32 from array memory\n assembly {\n mstore(add(b, index), input)\n }\n }\n\n /// @dev Reads a uint256 value from a position in a byte array.\n /// @param b Byte array containing a uint256 value.\n /// @param index Index in byte array of uint256 value.\n /// @return uint256 value from byte array.\n function readUint256(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (uint256 result)\n {\n return uint256(readBytes32(b, index));\n }\n\n /// @dev Writes a uint256 into a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input uint256 to put into byte array.\n function writeUint256(\n bytes memory b,\n uint256 index,\n uint256 input\n )\n internal\n pure\n {\n writeBytes32(b, index, bytes32(input));\n }\n\n /// @dev Reads an unpadded bytes4 value from a position in a byte array.\n /// @param b Byte array containing a bytes4 value.\n /// @param index Index in byte array of bytes4 value.\n /// @return bytes4 value from byte array.\n function readBytes4(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes4 result)\n {\n require(\n b.length >= index + 4,\n \"GREATER_OR_EQUAL_TO_4_LENGTH_REQUIRED\"\n );\n assembly {\n result := mload(add(b, 32))\n // Solidity does not require us to clean the trailing bytes.\n // We do it anyway\n result := and(result, 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000)\n }\n return result;\n }\n\n /// @dev Reads nested bytes from a specific position.\n /// @dev NOTE: the returned value overlaps with the input value.\n /// Both should be treated as immutable.\n /// @param b Byte array containing nested bytes.\n /// @param index Index of nested bytes.\n /// @return result Nested bytes.\n function readBytesWithLength(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes memory result)\n {\n // Read length of nested bytes\n uint256 nestedBytesLength = readUint256(b, index);\n index += 32;\n\n // Assert length of <b> is valid, given\n // length of nested bytes\n require(\n b.length >= index + nestedBytesLength,\n \"GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED\"\n );\n \n // Return a pointer to the byte array as it exists inside `b`\n assembly {\n result := add(b, index)\n }\n return result;\n }\n\n /// @dev Inserts bytes at a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input bytes to insert.\n function writeBytesWithLength(\n bytes memory b,\n uint256 index,\n bytes memory input\n )\n internal\n pure\n {\n // Assert length of <b> is valid, given\n // length of input\n require(\n b.length >= index + 32 + input.length, // 32 bytes to store length\n \"GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED\"\n );\n\n // Copy <input> into <b>\n memCopy(\n b.contentAddress() + index,\n input.rawAddress(), // includes length of <input>\n input.length + 32 // +32 bytes to store <input> length\n );\n }\n\n /// @dev Performs a deep copy of a byte array onto another byte array of greater than or equal length.\n /// @param dest Byte array that will be overwritten with source bytes.\n /// @param source Byte array to copy onto dest bytes.\n function deepCopyBytes(\n bytes memory dest,\n bytes memory source\n )\n internal\n pure\n {\n uint256 sourceLen = source.length;\n // Dest length must be >= source length, or some bytes would not be copied.\n require(\n dest.length >= sourceLen,\n \"GREATER_OR_EQUAL_TO_SOURCE_BYTES_LENGTH_REQUIRED\"\n );\n memCopy(\n dest.contentAddress(),\n source.contentAddress(),\n sourceLen\n );\n }\n}\n",
- "2.0.0/utils/Ownable/IOwnable.sol": "pragma solidity 0.4.24;\n\n/*\n * Ownable\n *\n * Base contract with an owner.\n * Provides onlyOwner modifier, which prevents function from running if it is called by anyone other than the owner.\n */\n\ncontract IOwnable {\n function transferOwnership(address newOwner)\n public;\n}\n",
- "2.0.0/utils/Ownable/Ownable.sol": "pragma solidity 0.4.24;\n\n/*\n * Ownable\n *\n * Base contract with an owner.\n * Provides onlyOwner modifier, which prevents function from running if it is called by anyone other than the owner.\n */\n\nimport \"./IOwnable.sol\";\n\n\ncontract Ownable is IOwnable {\n address public owner;\n\n constructor ()\n public\n {\n owner = msg.sender;\n }\n\n modifier onlyOwner() {\n require(\n msg.sender == owner,\n \"ONLY_CONTRACT_OWNER\"\n );\n _;\n }\n\n function transferOwnership(address newOwner)\n public\n onlyOwner\n {\n if (newOwner != address(0)) {\n owner = newOwner;\n }\n }\n}\n",
- "2.0.0/utils/SafeMath/SafeMath.sol": "pragma solidity 0.4.24;\n\n\ncontract SafeMath {\n function safeMul(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n if (a == 0) {\n return 0;\n }\n uint256 c = a * b;\n require(\n c / a == b,\n \"UINT256_OVERFLOW\"\n );\n return c;\n }\n\n function safeDiv(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n uint256 c = a / b;\n return c;\n }\n\n function safeSub(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n require(\n b <= a,\n \"UINT256_UNDERFLOW\"\n );\n return a - b;\n }\n\n function safeAdd(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n uint256 c = a + b;\n require(\n c >= a,\n \"UINT256_OVERFLOW\"\n );\n return c;\n }\n\n function max64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n\n function max256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n}\n"
- },
- "sourceTreeHashHex": "0x70b7d3c15ab87e6b4b1011d194282163232dfd88486038e4120d6bf245d58e44",
- "compiler": {
- "name": "solc",
- "version": "soljson-v0.4.24+commit.e67f0147.js",
- "settings": {
- "optimizer": {
- "enabled": true,
- "runs": 1000000
- },
- "outputSelection": {
- "*": {
- "*": [
- "abi",
- "evm.bytecode.object",
- "evm.bytecode.sourceMap",
- "evm.deployedBytecode.object",
- "evm.deployedBytecode.sourceMap"
- ]
- }
- }
- }
- },
- "networks": {}
-} \ No newline at end of file
diff --git a/packages/migrations/artifacts/2.0.0/OrderValidator.json b/packages/migrations/artifacts/2.0.0/OrderValidator.json
deleted file mode 100644
index c6af06d9c..000000000
--- a/packages/migrations/artifacts/2.0.0/OrderValidator.json
+++ /dev/null
@@ -1,858 +0,0 @@
-{
- "schemaVersion": "2.0.0",
- "contractName": "OrderValidator",
- "compilerOutput": {
- "abi": [
- {
- "constant": true,
- "inputs": [
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "order",
- "type": "tuple"
- },
- {
- "name": "takerAddress",
- "type": "address"
- }
- ],
- "name": "getOrderAndTraderInfo",
- "outputs": [
- {
- "components": [
- {
- "name": "orderStatus",
- "type": "uint8"
- },
- {
- "name": "orderHash",
- "type": "bytes32"
- },
- {
- "name": "orderTakerAssetFilledAmount",
- "type": "uint256"
- }
- ],
- "name": "orderInfo",
- "type": "tuple"
- },
- {
- "components": [
- {
- "name": "makerBalance",
- "type": "uint256"
- },
- {
- "name": "makerAllowance",
- "type": "uint256"
- },
- {
- "name": "takerBalance",
- "type": "uint256"
- },
- {
- "name": "takerAllowance",
- "type": "uint256"
- },
- {
- "name": "makerZrxBalance",
- "type": "uint256"
- },
- {
- "name": "makerZrxAllowance",
- "type": "uint256"
- },
- {
- "name": "takerZrxBalance",
- "type": "uint256"
- },
- {
- "name": "takerZrxAllowance",
- "type": "uint256"
- }
- ],
- "name": "traderInfo",
- "type": "tuple"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "target",
- "type": "address"
- },
- {
- "name": "assetData",
- "type": "bytes"
- }
- ],
- "name": "getBalanceAndAllowance",
- "outputs": [
- {
- "name": "balance",
- "type": "uint256"
- },
- {
- "name": "allowance",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "orders",
- "type": "tuple[]"
- },
- {
- "name": "takerAddresses",
- "type": "address[]"
- }
- ],
- "name": "getOrdersAndTradersInfo",
- "outputs": [
- {
- "components": [
- {
- "name": "orderStatus",
- "type": "uint8"
- },
- {
- "name": "orderHash",
- "type": "bytes32"
- },
- {
- "name": "orderTakerAssetFilledAmount",
- "type": "uint256"
- }
- ],
- "name": "ordersInfo",
- "type": "tuple[]"
- },
- {
- "components": [
- {
- "name": "makerBalance",
- "type": "uint256"
- },
- {
- "name": "makerAllowance",
- "type": "uint256"
- },
- {
- "name": "takerBalance",
- "type": "uint256"
- },
- {
- "name": "takerAllowance",
- "type": "uint256"
- },
- {
- "name": "makerZrxBalance",
- "type": "uint256"
- },
- {
- "name": "makerZrxAllowance",
- "type": "uint256"
- },
- {
- "name": "takerZrxBalance",
- "type": "uint256"
- },
- {
- "name": "takerZrxAllowance",
- "type": "uint256"
- }
- ],
- "name": "tradersInfo",
- "type": "tuple[]"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "orders",
- "type": "tuple[]"
- },
- {
- "name": "takerAddresses",
- "type": "address[]"
- }
- ],
- "name": "getTradersInfo",
- "outputs": [
- {
- "components": [
- {
- "name": "makerBalance",
- "type": "uint256"
- },
- {
- "name": "makerAllowance",
- "type": "uint256"
- },
- {
- "name": "takerBalance",
- "type": "uint256"
- },
- {
- "name": "takerAllowance",
- "type": "uint256"
- },
- {
- "name": "makerZrxBalance",
- "type": "uint256"
- },
- {
- "name": "makerZrxAllowance",
- "type": "uint256"
- },
- {
- "name": "takerZrxBalance",
- "type": "uint256"
- },
- {
- "name": "takerZrxAllowance",
- "type": "uint256"
- }
- ],
- "name": "",
- "type": "tuple[]"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "token",
- "type": "address"
- },
- {
- "name": "tokenId",
- "type": "uint256"
- }
- ],
- "name": "getERC721TokenOwner",
- "outputs": [
- {
- "name": "owner",
- "type": "address"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "target",
- "type": "address"
- },
- {
- "name": "assetData",
- "type": "bytes[]"
- }
- ],
- "name": "getBalancesAndAllowances",
- "outputs": [
- {
- "name": "",
- "type": "uint256[]"
- },
- {
- "name": "",
- "type": "uint256[]"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "components": [
- {
- "name": "makerAddress",
- "type": "address"
- },
- {
- "name": "takerAddress",
- "type": "address"
- },
- {
- "name": "feeRecipientAddress",
- "type": "address"
- },
- {
- "name": "senderAddress",
- "type": "address"
- },
- {
- "name": "makerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "takerAssetAmount",
- "type": "uint256"
- },
- {
- "name": "makerFee",
- "type": "uint256"
- },
- {
- "name": "takerFee",
- "type": "uint256"
- },
- {
- "name": "expirationTimeSeconds",
- "type": "uint256"
- },
- {
- "name": "salt",
- "type": "uint256"
- },
- {
- "name": "makerAssetData",
- "type": "bytes"
- },
- {
- "name": "takerAssetData",
- "type": "bytes"
- }
- ],
- "name": "order",
- "type": "tuple"
- },
- {
- "name": "takerAddress",
- "type": "address"
- }
- ],
- "name": "getTraderInfo",
- "outputs": [
- {
- "components": [
- {
- "name": "makerBalance",
- "type": "uint256"
- },
- {
- "name": "makerAllowance",
- "type": "uint256"
- },
- {
- "name": "takerBalance",
- "type": "uint256"
- },
- {
- "name": "takerAllowance",
- "type": "uint256"
- },
- {
- "name": "makerZrxBalance",
- "type": "uint256"
- },
- {
- "name": "makerZrxAllowance",
- "type": "uint256"
- },
- {
- "name": "takerZrxBalance",
- "type": "uint256"
- },
- {
- "name": "takerZrxAllowance",
- "type": "uint256"
- }
- ],
- "name": "traderInfo",
- "type": "tuple"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "inputs": [
- {
- "name": "_exchange",
- "type": "address"
- },
- {
- "name": "_zrxAssetData",
- "type": "bytes"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "constructor"
- }
- ],
- "evm": {
- "bytecode": {
- "linkReferences": {},
- "object": "0x60806040523480156200001157600080fd5b5060405162001d3a38038062001d3a833981018060405262000037919081019062000186565b60008054600160a060020a031916600160a060020a03841617905580516200006790600190602084019062000070565b5050506200026b565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10620000b357805160ff1916838001178555620000e3565b82800160010185558215620000e3579182015b82811115620000e3578251825591602001919060010190620000c6565b50620000f1929150620000f5565b5090565b6200011291905b80821115620000f15760008155600101620000fc565b90565b60006200012382516200022c565b9392505050565b6000601f820183136200013c57600080fd5b8151620001536200014d8262000204565b620001dd565b915080825260208301602083018583830111156200017057600080fd5b6200017d83828462000238565b50505092915050565b600080604083850312156200019a57600080fd5b6000620001a8858562000115565b92505060208301516001604060020a03811115620001c557600080fd5b620001d3858286016200012a565b9150509250929050565b6040518181016001604060020a0381118282101715620001fc57600080fd5b604052919050565b60006001604060020a038211156200021b57600080fd5b506020601f91909101601f19160190565b600160a060020a031690565b60005b83811015620002555781810151838201526020016200023b565b8381111562000265576000848401525b50505050565b611abf806200027b6000396000f3006080604052600436106100825763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166304ad1e5381146100875780632cd0fc73146100be5780634b95de13146100ec578063690d31141461011a578063b698846314610147578063c6b7f4ee14610174578063f241ffb0146101a2575b600080fd5b34801561009357600080fd5b506100a76100a23660046112d3565b6101cf565b6040516100b59291906118dc565b60405180910390f35b3480156100ca57600080fd5b506100de6100d936600461118b565b61029c565b6040516100b5929190611926565b3480156100f857600080fd5b5061010c610107366004611238565b6107cd565b6040516100b5929190611822565b34801561012657600080fd5b5061013a610135366004611238565b6108a4565b6040516100b59190611858565b34801561015357600080fd5b506101676101623660046111d3565b61095e565b6040516100b591906117f9565b34801561018057600080fd5b5061019461018f366004611139565b6109a9565b6040516100b5929190611869565b3480156101ae57600080fd5b506101c26101bd3660046112d3565b610a86565b6040516100b59190611909565b6101d7610cd0565b6101df610cf0565b6000546040517fc75e0a8100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091169063c75e0a81906102359087906004016118f8565b606060405180830381600087803b15801561024f57600080fd5b505af1158015610263573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061028791908101906112b5565b91506102938484610a86565b90509250929050565b6000808080808080806102b5898263ffffffff610ba416565b95506102c889601063ffffffff610c1116565b6000546040517f6070410800000000000000000000000000000000000000000000000000000000815291965073ffffffffffffffffffffffffffffffffffffffff169063607041089061031f90899060040161188e565b602060405180830381600087803b15801561033957600080fd5b505af115801561034d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506103719190810190611113565b604080517f4552433230546f6b656e28616464726573732900000000000000000000000000815290519081900360130190209094507fffffffff0000000000000000000000000000000000000000000000000000000087811691161415610526576040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8616906370a0823190610424908d906004016117f9565b602060405180830381600087803b15801561043e57600080fd5b505af1158015610452573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610476919081019061131a565b6040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815290985073ffffffffffffffffffffffffffffffffffffffff86169063dd62ed3e906104cd908d908890600401611807565b602060405180830381600087803b1580156104e757600080fd5b505af11580156104fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061051f919081019061131a565b96506107c0565b604080517f455243373231546f6b656e28616464726573732c75696e7432353629000000008152905190819003601c0190207fffffffff00000000000000000000000000000000000000000000000000000000878116911614156107855761059589602463ffffffff610c7216565b92506105a1858461095e565b91508173ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff16146105dd5760006105e0565b60015b60ff1697508473ffffffffffffffffffffffffffffffffffffffff1663e985e9c58b866040518363ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040161063c929190611807565b602060405180830381600087803b15801561065657600080fd5b505af115801561066a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061068e9190810190611297565b8061076a57508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1663081812fc856040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004016107009190611918565b602060405180830381600087803b15801561071a57600080fd5b505af115801561072e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506107529190810190611113565b73ffffffffffffffffffffffffffffffffffffffff16145b90508061077857600061077b565b60015b60ff1696506107c0565b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107b7906118ac565b60405180910390fd5b5050505050509250929050565b6000546040517f7e9d74dc000000000000000000000000000000000000000000000000000000008152606091829173ffffffffffffffffffffffffffffffffffffffff90911690637e9d74dc90610828908790600401611847565b600060405180830381600087803b15801561084257600080fd5b505af1158015610856573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405261089c9190810190611203565b915061029384845b606060006060600085519250826040519080825280602002602001820160405280156108ea57816020015b6108d7610cf0565b8152602001906001900390816108cf5790505b509150600090505b80831461095157610931868281518110151561090a57fe5b90602001906020020151868381518110151561092257fe5b90602001906020020151610a86565b828281518110151561093f57fe5b602090810290910101526001016108f2565b8193505b50505092915050565b60006040517f6352211e000000000000000000000000000000000000000000000000000000008152826004820152602081602483875afa80156109a057815192505b50505b92915050565b6060806000606080600086519350836040519080825280602002602001820160405280156109e1578160200160208202803883390190505b50925083604051908082528060200260200182016040528015610a0e578160200160208202803883390190505b509150600090505b808414610a7957610a3e888883815181101515610a2f57fe5b9060200190602002015161029c565b8483815181101515610a4c57fe5b9060200190602002018484815181101515610a6357fe5b6020908102909101019190915252600101610a16565b5090969095509350505050565b610a8e610cf0565b6060610aa3846000015185610140015161029c565b60208401528252610160840151610abb90849061029c565b60608401526040808401919091526001805482516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101008688161502019094169390930492830181900481028201810190945281815292830182828015610b6a5780601f10610b3f57610100808354040283529160200191610b6a565b820191906000526020600020905b815481529060010190602001808311610b4d57829003601f168201915b50505050509050610b7f84600001518261029c565b60a08401526080830152610b93838261029c565b60e084015260c08301525092915050565b600081600401835110151515610be6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107b7906118cc565b5001602001517fffffffff000000000000000000000000000000000000000000000000000000001690565b600081601401835110151515610c53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107b7906118bc565b50016014015173ffffffffffffffffffffffffffffffffffffffff1690565b6000610c7e8383610c85565b9392505050565b600081602001835110151515610cc7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107b79061189c565b50016020015190565b604080516060810182526000808252602082018190529181019190915290565b6101006040519081016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6000610c7e82356119d9565b6000610c7e82516119d9565b6000601f82018313610d5f57600080fd5b8135610d72610d6d82611968565b611941565b91508181835260208401935060208101905083856020840282011115610d9757600080fd5b60005b83811015610dc35781610dad8882610d36565b8452506020928301929190910190600101610d9a565b5050505092915050565b6000601f82018313610dde57600080fd5b8135610dec610d6d82611968565b81815260209384019390925082018360005b83811015610dc35781358601610e148882610f11565b8452506020928301929190910190600101610dfe565b6000601f82018313610e3b57600080fd5b8151610e49610d6d82611968565b91508181835260208401935060208101905083856060840282011115610e6e57600080fd5b60005b83811015610dc35781610e848882610f57565b84525060209092019160609190910190600101610e71565b6000601f82018313610ead57600080fd5b8135610ebb610d6d82611968565b81815260209384019390925082018360005b83811015610dc35781358601610ee38882610fb2565b8452506020928301929190910190600101610ecd565b6000610c7e8251611a20565b6000610c7e82516119f2565b6000601f82018313610f2257600080fd5b8135610f30610d6d82611989565b91508082526020830160208301858383011115610f4c57600080fd5b610955838284611a25565b600060608284031215610f6957600080fd5b610f736060611941565b90506000610f818484611107565b8252506020610f9284848301610f05565b6020830152506040610fa684828501610f05565b60408301525092915050565b60006101808284031215610fc557600080fd5b610fd0610180611941565b90506000610fde8484610d36565b8252506020610fef84848301610d36565b602083015250604061100384828501610d36565b604083015250606061101784828501610d36565b606083015250608061102b848285016110fb565b60808301525060a061103f848285016110fb565b60a08301525060c0611053848285016110fb565b60c08301525060e0611067848285016110fb565b60e08301525061010061107c848285016110fb565b61010083015250610120611092848285016110fb565b6101208301525061014082013567ffffffffffffffff8111156110b457600080fd5b6110c084828501610f11565b6101408301525061016082013567ffffffffffffffff8111156110e257600080fd5b6110ee84828501610f11565b6101608301525092915050565b6000610c7e82356119f2565b6000610c7e8251611a1a565b60006020828403121561112557600080fd5b60006111318484610d42565b949350505050565b6000806040838503121561114c57600080fd5b60006111588585610d36565b925050602083013567ffffffffffffffff81111561117557600080fd5b61118185828601610dcd565b9150509250929050565b6000806040838503121561119e57600080fd5b60006111aa8585610d36565b925050602083013567ffffffffffffffff8111156111c757600080fd5b61118185828601610f11565b600080604083850312156111e657600080fd5b60006111f28585610d36565b9250506020611181858286016110fb565b60006020828403121561121557600080fd5b815167ffffffffffffffff81111561122c57600080fd5b61113184828501610e2a565b6000806040838503121561124b57600080fd5b823567ffffffffffffffff81111561126257600080fd5b61126e85828601610e9c565b925050602083013567ffffffffffffffff81111561128b57600080fd5b61118185828601610d4e565b6000602082840312156112a957600080fd5b60006111318484610ef9565b6000606082840312156112c757600080fd5b60006111318484610f57565b600080604083850312156112e657600080fd5b823567ffffffffffffffff8111156112fd57600080fd5b61130985828601610fb2565b925050602061118185828601610d36565b60006020828403121561132c57600080fd5b60006111318484610f05565b611341816119d9565b82525050565b6000611352826119d5565b808452602084019350611364836119cf565b60005b828110156113945761137a868351611619565b611383826119cf565b606096909601959150600101611367565b5093949350505050565b60006113a9826119d5565b808452602084019350836020820285016113c2856119cf565b60005b848110156113f95783830388526113dd838351611656565b92506113e8826119cf565b6020989098019791506001016113c5565b50909695505050505050565b6000611410826119d5565b808452602084019350611422836119cf565b60005b8281101561139457611438868351611759565b611441826119cf565b61010096909601959150600101611425565b600061145e826119d5565b808452602084019350611470836119cf565b60005b82811015611394576114868683516114a0565b61148f826119cf565b602096909601959150600101611473565b611341816119f2565b611341816119f5565b60006114bd826119d5565b8084526114d1816020860160208601611a31565b6114da81611a5d565b9093016020019392505050565b602681527f475245415445525f4f525f455155414c5f544f5f33325f4c454e4754485f524560208201527f5155495245440000000000000000000000000000000000000000000000000000604082015260600190565b601781527f554e535550504f525445445f41535345545f50524f5859000000000000000000602082015260400190565b602681527f475245415445525f4f525f455155414c5f544f5f32305f4c454e4754485f524560208201527f5155495245440000000000000000000000000000000000000000000000000000604082015260600190565b602581527f475245415445525f4f525f455155414c5f544f5f345f4c454e4754485f52455160208201527f5549524544000000000000000000000000000000000000000000000000000000604082015260600190565b8051606083019061162a84826117f0565b50602082015161163d60208501826114a0565b50604082015161165060408501826114a0565b50505050565b805160009061018084019061166b8582611338565b50602083015161167e6020860182611338565b5060408301516116916040860182611338565b5060608301516116a46060860182611338565b5060808301516116b760808601826114a0565b5060a08301516116ca60a08601826114a0565b5060c08301516116dd60c08601826114a0565b5060e08301516116f060e08601826114a0565b506101008301516117056101008601826114a0565b5061012083015161171a6101208601826114a0565b5061014083015184820361014086015261173482826114b2565b91505061016083015184820361016086015261175082826114b2565b95945050505050565b805161010083019061176b84826114a0565b50602082015161177e60208501826114a0565b50604082015161179160408501826114a0565b5060608201516117a460608501826114a0565b5060808201516117b760808501826114a0565b5060a08201516117ca60a08501826114a0565b5060c08201516117dd60c08501826114a0565b5060e082015161165060e08501826114a0565b61134181611a1a565b602081016109a38284611338565b604081016118158285611338565b610c7e6020830184611338565b604080825281016118338185611347565b905081810360208301526111318184611405565b60208082528101610c7e818461139e565b60208082528101610c7e8184611405565b6040808252810161187a8185611453565b905081810360208301526111318184611453565b602081016109a382846114a9565b602080825281016109a3816114e7565b602080825281016109a38161153d565b602080825281016109a38161156d565b602080825281016109a3816115c3565b61016081016118eb8285611619565b610c7e6060830184611759565b60208082528101610c7e8184611656565b61010081016109a38284611759565b602081016109a382846114a0565b6040810161193482856114a0565b610c7e60208301846114a0565b60405181810167ffffffffffffffff8111828210171561196057600080fd5b604052919050565b600067ffffffffffffffff82111561197f57600080fd5b5060209081020190565b600067ffffffffffffffff8211156119a057600080fd5b506020601f919091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0160190565b60200190565b5190565b73ffffffffffffffffffffffffffffffffffffffff1690565b90565b7fffffffff000000000000000000000000000000000000000000000000000000001690565b60ff1690565b151590565b82818337506000910152565b60005b83811015611a4c578181015183820152602001611a34565b838111156116505750506000910152565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016905600a265627a7a72305820d2e97e29f930427e8936d11af9a8ee1660886400d9687abb10c976177f33449c6c6578706572696d656e74616cf50037",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH3 0x11 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x40 MLOAD PUSH3 0x1D3A CODESIZE SUB DUP1 PUSH3 0x1D3A DUP4 CODECOPY DUP2 ADD DUP1 PUSH1 0x40 MSTORE PUSH3 0x37 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH3 0x186 JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB NOT AND PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB DUP5 AND OR SWAP1 SSTORE DUP1 MLOAD PUSH3 0x67 SWAP1 PUSH1 0x1 SWAP1 PUSH1 0x20 DUP5 ADD SWAP1 PUSH3 0x70 JUMP JUMPDEST POP POP POP PUSH3 0x26B JUMP JUMPDEST DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 PUSH1 0x1F ADD PUSH1 0x20 SWAP1 DIV DUP2 ADD SWAP3 DUP3 PUSH1 0x1F LT PUSH3 0xB3 JUMPI DUP1 MLOAD PUSH1 0xFF NOT AND DUP4 DUP1 ADD OR DUP6 SSTORE PUSH3 0xE3 JUMP JUMPDEST DUP3 DUP1 ADD PUSH1 0x1 ADD DUP6 SSTORE DUP3 ISZERO PUSH3 0xE3 JUMPI SWAP2 DUP3 ADD JUMPDEST DUP3 DUP2 GT ISZERO PUSH3 0xE3 JUMPI DUP3 MLOAD DUP3 SSTORE SWAP2 PUSH1 0x20 ADD SWAP2 SWAP1 PUSH1 0x1 ADD SWAP1 PUSH3 0xC6 JUMP JUMPDEST POP PUSH3 0xF1 SWAP3 SWAP2 POP PUSH3 0xF5 JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST PUSH3 0x112 SWAP2 SWAP1 JUMPDEST DUP1 DUP3 GT ISZERO PUSH3 0xF1 JUMPI PUSH1 0x0 DUP2 SSTORE PUSH1 0x1 ADD PUSH3 0xFC JUMP JUMPDEST SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH3 0x123 DUP3 MLOAD PUSH3 0x22C JUMP JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH3 0x13C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 MLOAD PUSH3 0x153 PUSH3 0x14D DUP3 PUSH3 0x204 JUMP JUMPDEST PUSH3 0x1DD JUMP JUMPDEST SWAP2 POP DUP1 DUP3 MSTORE PUSH1 0x20 DUP4 ADD PUSH1 0x20 DUP4 ADD DUP6 DUP4 DUP4 ADD GT ISZERO PUSH3 0x170 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH3 0x17D DUP4 DUP3 DUP5 PUSH3 0x238 JUMP JUMPDEST POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH3 0x19A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH3 0x1A8 DUP6 DUP6 PUSH3 0x115 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 DUP4 ADD MLOAD PUSH1 0x1 PUSH1 0x40 PUSH1 0x2 EXP SUB DUP2 GT ISZERO PUSH3 0x1C5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH3 0x1D3 DUP6 DUP3 DUP7 ADD PUSH3 0x12A JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x40 MLOAD DUP2 DUP2 ADD PUSH1 0x1 PUSH1 0x40 PUSH1 0x2 EXP SUB DUP2 GT DUP3 DUP3 LT OR ISZERO PUSH3 0x1FC JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x40 MSTORE SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1 PUSH1 0x40 PUSH1 0x2 EXP SUB DUP3 GT ISZERO PUSH3 0x21B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x20 PUSH1 0x1F SWAP2 SWAP1 SWAP2 ADD PUSH1 0x1F NOT AND ADD SWAP1 JUMP JUMPDEST PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB AND SWAP1 JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH3 0x255 JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH3 0x23B JUMP JUMPDEST DUP4 DUP2 GT ISZERO PUSH3 0x265 JUMPI PUSH1 0x0 DUP5 DUP5 ADD MSTORE JUMPDEST POP POP POP POP JUMP JUMPDEST PUSH2 0x1ABF DUP1 PUSH3 0x27B PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN STOP PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x82 JUMPI PUSH4 0xFFFFFFFF PUSH29 0x100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD DIV AND PUSH4 0x4AD1E53 DUP2 EQ PUSH2 0x87 JUMPI DUP1 PUSH4 0x2CD0FC73 EQ PUSH2 0xBE JUMPI DUP1 PUSH4 0x4B95DE13 EQ PUSH2 0xEC JUMPI DUP1 PUSH4 0x690D3114 EQ PUSH2 0x11A JUMPI DUP1 PUSH4 0xB6988463 EQ PUSH2 0x147 JUMPI DUP1 PUSH4 0xC6B7F4EE EQ PUSH2 0x174 JUMPI DUP1 PUSH4 0xF241FFB0 EQ PUSH2 0x1A2 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x93 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xA7 PUSH2 0xA2 CALLDATASIZE PUSH1 0x4 PUSH2 0x12D3 JUMP JUMPDEST PUSH2 0x1CF JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xB5 SWAP3 SWAP2 SWAP1 PUSH2 0x18DC JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xCA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xDE PUSH2 0xD9 CALLDATASIZE PUSH1 0x4 PUSH2 0x118B JUMP JUMPDEST PUSH2 0x29C JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xB5 SWAP3 SWAP2 SWAP1 PUSH2 0x1926 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xF8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x10C PUSH2 0x107 CALLDATASIZE PUSH1 0x4 PUSH2 0x1238 JUMP JUMPDEST PUSH2 0x7CD JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xB5 SWAP3 SWAP2 SWAP1 PUSH2 0x1822 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x126 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x13A PUSH2 0x135 CALLDATASIZE PUSH1 0x4 PUSH2 0x1238 JUMP JUMPDEST PUSH2 0x8A4 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xB5 SWAP2 SWAP1 PUSH2 0x1858 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x153 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x167 PUSH2 0x162 CALLDATASIZE PUSH1 0x4 PUSH2 0x11D3 JUMP JUMPDEST PUSH2 0x95E JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xB5 SWAP2 SWAP1 PUSH2 0x17F9 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x180 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x194 PUSH2 0x18F CALLDATASIZE PUSH1 0x4 PUSH2 0x1139 JUMP JUMPDEST PUSH2 0x9A9 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xB5 SWAP3 SWAP2 SWAP1 PUSH2 0x1869 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1AE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1C2 PUSH2 0x1BD CALLDATASIZE PUSH1 0x4 PUSH2 0x12D3 JUMP JUMPDEST PUSH2 0xA86 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xB5 SWAP2 SWAP1 PUSH2 0x1909 JUMP JUMPDEST PUSH2 0x1D7 PUSH2 0xCD0 JUMP JUMPDEST PUSH2 0x1DF PUSH2 0xCF0 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x40 MLOAD PUSH32 0xC75E0A8100000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP2 AND SWAP1 PUSH4 0xC75E0A81 SWAP1 PUSH2 0x235 SWAP1 DUP8 SWAP1 PUSH1 0x4 ADD PUSH2 0x18F8 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x24F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x263 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP PUSH2 0x287 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x12B5 JUMP JUMPDEST SWAP2 POP PUSH2 0x293 DUP5 DUP5 PUSH2 0xA86 JUMP JUMPDEST SWAP1 POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP1 DUP1 DUP1 DUP1 DUP1 DUP1 PUSH2 0x2B5 DUP10 DUP3 PUSH4 0xFFFFFFFF PUSH2 0xBA4 AND JUMP JUMPDEST SWAP6 POP PUSH2 0x2C8 DUP10 PUSH1 0x10 PUSH4 0xFFFFFFFF PUSH2 0xC11 AND JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x40 MLOAD PUSH32 0x6070410800000000000000000000000000000000000000000000000000000000 DUP2 MSTORE SWAP2 SWAP7 POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH4 0x60704108 SWAP1 PUSH2 0x31F SWAP1 DUP10 SWAP1 PUSH1 0x4 ADD PUSH2 0x188E JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x339 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x34D JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP PUSH2 0x371 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x1113 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0x4552433230546F6B656E28616464726573732900000000000000000000000000 DUP2 MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x13 ADD SWAP1 KECCAK256 SWAP1 SWAP5 POP PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 DUP8 DUP2 AND SWAP2 AND EQ ISZERO PUSH2 0x526 JUMPI PUSH1 0x40 MLOAD PUSH32 0x70A0823100000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP7 AND SWAP1 PUSH4 0x70A08231 SWAP1 PUSH2 0x424 SWAP1 DUP14 SWAP1 PUSH1 0x4 ADD PUSH2 0x17F9 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x43E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x452 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP PUSH2 0x476 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x131A JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH32 0xDD62ED3E00000000000000000000000000000000000000000000000000000000 DUP2 MSTORE SWAP1 SWAP9 POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP7 AND SWAP1 PUSH4 0xDD62ED3E SWAP1 PUSH2 0x4CD SWAP1 DUP14 SWAP1 DUP9 SWAP1 PUSH1 0x4 ADD PUSH2 0x1807 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x4E7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x4FB JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP PUSH2 0x51F SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x131A JUMP JUMPDEST SWAP7 POP PUSH2 0x7C0 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0x455243373231546F6B656E28616464726573732C75696E743235362900000000 DUP2 MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x1C ADD SWAP1 KECCAK256 PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 DUP8 DUP2 AND SWAP2 AND EQ ISZERO PUSH2 0x785 JUMPI PUSH2 0x595 DUP10 PUSH1 0x24 PUSH4 0xFFFFFFFF PUSH2 0xC72 AND JUMP JUMPDEST SWAP3 POP PUSH2 0x5A1 DUP6 DUP5 PUSH2 0x95E JUMP JUMPDEST SWAP2 POP DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP11 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0x5DD JUMPI PUSH1 0x0 PUSH2 0x5E0 JUMP JUMPDEST PUSH1 0x1 JUMPDEST PUSH1 0xFF AND SWAP8 POP DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0xE985E9C5 DUP12 DUP7 PUSH1 0x40 MLOAD DUP4 PUSH4 0xFFFFFFFF AND PUSH29 0x100000000000000000000000000000000000000000000000000000000 MUL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x63C SWAP3 SWAP2 SWAP1 PUSH2 0x1807 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x656 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x66A JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP PUSH2 0x68E SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x1297 JUMP JUMPDEST DUP1 PUSH2 0x76A JUMPI POP DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0x81812FC DUP6 PUSH1 0x40 MLOAD DUP3 PUSH4 0xFFFFFFFF AND PUSH29 0x100000000000000000000000000000000000000000000000000000000 MUL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x700 SWAP2 SWAP1 PUSH2 0x1918 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x71A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x72E JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP PUSH2 0x752 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x1113 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ JUMPDEST SWAP1 POP DUP1 PUSH2 0x778 JUMPI PUSH1 0x0 PUSH2 0x77B JUMP JUMPDEST PUSH1 0x1 JUMPDEST PUSH1 0xFF AND SWAP7 POP PUSH2 0x7C0 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x7B7 SWAP1 PUSH2 0x18AC JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP POP POP POP POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x40 MLOAD PUSH32 0x7E9D74DC00000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x60 SWAP2 DUP3 SWAP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP2 AND SWAP1 PUSH4 0x7E9D74DC SWAP1 PUSH2 0x828 SWAP1 DUP8 SWAP1 PUSH1 0x4 ADD PUSH2 0x1847 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x842 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x856 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x0 DUP3 RETURNDATACOPY PUSH1 0x1F RETURNDATASIZE SWAP1 DUP2 ADD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 AND DUP3 ADD PUSH1 0x40 MSTORE PUSH2 0x89C SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x1203 JUMP JUMPDEST SWAP2 POP PUSH2 0x293 DUP5 DUP5 JUMPDEST PUSH1 0x60 PUSH1 0x0 PUSH1 0x60 PUSH1 0x0 DUP6 MLOAD SWAP3 POP DUP3 PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x8EA JUMPI DUP2 PUSH1 0x20 ADD JUMPDEST PUSH2 0x8D7 PUSH2 0xCF0 JUMP JUMPDEST DUP2 MSTORE PUSH1 0x20 ADD SWAP1 PUSH1 0x1 SWAP1 SUB SWAP1 DUP2 PUSH2 0x8CF JUMPI SWAP1 POP JUMPDEST POP SWAP2 POP PUSH1 0x0 SWAP1 POP JUMPDEST DUP1 DUP4 EQ PUSH2 0x951 JUMPI PUSH2 0x931 DUP7 DUP3 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x90A JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP7 DUP4 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x922 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0xA86 JUMP JUMPDEST DUP3 DUP3 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x93F JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD MSTORE PUSH1 0x1 ADD PUSH2 0x8F2 JUMP JUMPDEST DUP2 SWAP4 POP JUMPDEST POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD PUSH32 0x6352211E00000000000000000000000000000000000000000000000000000000 DUP2 MSTORE DUP3 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x20 DUP2 PUSH1 0x24 DUP4 DUP8 GAS STATICCALL DUP1 ISZERO PUSH2 0x9A0 JUMPI DUP2 MLOAD SWAP3 POP JUMPDEST POP POP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x60 DUP1 PUSH1 0x0 PUSH1 0x60 DUP1 PUSH1 0x0 DUP7 MLOAD SWAP4 POP DUP4 PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x9E1 JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CODESIZE DUP4 CODECOPY ADD SWAP1 POP JUMPDEST POP SWAP3 POP DUP4 PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0xA0E JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CODESIZE DUP4 CODECOPY ADD SWAP1 POP JUMPDEST POP SWAP2 POP PUSH1 0x0 SWAP1 POP JUMPDEST DUP1 DUP5 EQ PUSH2 0xA79 JUMPI PUSH2 0xA3E DUP9 DUP9 DUP4 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xA2F JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x29C JUMP JUMPDEST DUP5 DUP4 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xA4C JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD DUP5 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xA63 JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD SWAP2 SWAP1 SWAP2 MSTORE MSTORE PUSH1 0x1 ADD PUSH2 0xA16 JUMP JUMPDEST POP SWAP1 SWAP7 SWAP1 SWAP6 POP SWAP4 POP POP POP POP JUMP JUMPDEST PUSH2 0xA8E PUSH2 0xCF0 JUMP JUMPDEST PUSH1 0x60 PUSH2 0xAA3 DUP5 PUSH1 0x0 ADD MLOAD DUP6 PUSH2 0x140 ADD MLOAD PUSH2 0x29C JUMP JUMPDEST PUSH1 0x20 DUP5 ADD MSTORE DUP3 MSTORE PUSH2 0x160 DUP5 ADD MLOAD PUSH2 0xABB SWAP1 DUP5 SWAP1 PUSH2 0x29C JUMP JUMPDEST PUSH1 0x60 DUP5 ADD MSTORE PUSH1 0x40 DUP1 DUP5 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x1 DUP1 SLOAD DUP3 MLOAD PUSH1 0x20 PUSH1 0x1F PUSH1 0x2 PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH2 0x100 DUP7 DUP9 AND ISZERO MUL ADD SWAP1 SWAP5 AND SWAP4 SWAP1 SWAP4 DIV SWAP3 DUP4 ADD DUP2 SWAP1 DIV DUP2 MUL DUP3 ADD DUP2 ADD SWAP1 SWAP5 MSTORE DUP2 DUP2 MSTORE SWAP3 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0xB6A JUMPI DUP1 PUSH1 0x1F LT PUSH2 0xB3F JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0xB6A JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0xB4D JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP1 POP PUSH2 0xB7F DUP5 PUSH1 0x0 ADD MLOAD DUP3 PUSH2 0x29C JUMP JUMPDEST PUSH1 0xA0 DUP5 ADD MSTORE PUSH1 0x80 DUP4 ADD MSTORE PUSH2 0xB93 DUP4 DUP3 PUSH2 0x29C JUMP JUMPDEST PUSH1 0xE0 DUP5 ADD MSTORE PUSH1 0xC0 DUP4 ADD MSTORE POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x4 ADD DUP4 MLOAD LT ISZERO ISZERO ISZERO PUSH2 0xBE6 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x7B7 SWAP1 PUSH2 0x18CC JUMP JUMPDEST POP ADD PUSH1 0x20 ADD MLOAD PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 AND SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x14 ADD DUP4 MLOAD LT ISZERO ISZERO ISZERO PUSH2 0xC53 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x7B7 SWAP1 PUSH2 0x18BC JUMP JUMPDEST POP ADD PUSH1 0x14 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0xC7E DUP4 DUP4 PUSH2 0xC85 JUMP JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x20 ADD DUP4 MLOAD LT ISZERO ISZERO ISZERO PUSH2 0xCC7 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x7B7 SWAP1 PUSH2 0x189C JUMP JUMPDEST POP ADD PUSH1 0x20 ADD MLOAD SWAP1 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x60 DUP2 ADD DUP3 MSTORE PUSH1 0x0 DUP1 DUP3 MSTORE PUSH1 0x20 DUP3 ADD DUP2 SWAP1 MSTORE SWAP2 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE SWAP1 JUMP JUMPDEST PUSH2 0x100 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE POP SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0xC7E DUP3 CALLDATALOAD PUSH2 0x19D9 JUMP JUMPDEST PUSH1 0x0 PUSH2 0xC7E DUP3 MLOAD PUSH2 0x19D9 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH2 0xD5F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0xD72 PUSH2 0xD6D DUP3 PUSH2 0x1968 JUMP JUMPDEST PUSH2 0x1941 JUMP JUMPDEST SWAP2 POP DUP2 DUP2 DUP4 MSTORE PUSH1 0x20 DUP5 ADD SWAP4 POP PUSH1 0x20 DUP2 ADD SWAP1 POP DUP4 DUP6 PUSH1 0x20 DUP5 MUL DUP3 ADD GT ISZERO PUSH2 0xD97 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0xDC3 JUMPI DUP2 PUSH2 0xDAD DUP9 DUP3 PUSH2 0xD36 JUMP JUMPDEST DUP5 MSTORE POP PUSH1 0x20 SWAP3 DUP4 ADD SWAP3 SWAP2 SWAP1 SWAP2 ADD SWAP1 PUSH1 0x1 ADD PUSH2 0xD9A JUMP JUMPDEST POP POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH2 0xDDE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0xDEC PUSH2 0xD6D DUP3 PUSH2 0x1968 JUMP JUMPDEST DUP2 DUP2 MSTORE PUSH1 0x20 SWAP4 DUP5 ADD SWAP4 SWAP1 SWAP3 POP DUP3 ADD DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0xDC3 JUMPI DUP2 CALLDATALOAD DUP7 ADD PUSH2 0xE14 DUP9 DUP3 PUSH2 0xF11 JUMP JUMPDEST DUP5 MSTORE POP PUSH1 0x20 SWAP3 DUP4 ADD SWAP3 SWAP2 SWAP1 SWAP2 ADD SWAP1 PUSH1 0x1 ADD PUSH2 0xDFE JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH2 0xE3B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 MLOAD PUSH2 0xE49 PUSH2 0xD6D DUP3 PUSH2 0x1968 JUMP JUMPDEST SWAP2 POP DUP2 DUP2 DUP4 MSTORE PUSH1 0x20 DUP5 ADD SWAP4 POP PUSH1 0x20 DUP2 ADD SWAP1 POP DUP4 DUP6 PUSH1 0x60 DUP5 MUL DUP3 ADD GT ISZERO PUSH2 0xE6E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0xDC3 JUMPI DUP2 PUSH2 0xE84 DUP9 DUP3 PUSH2 0xF57 JUMP JUMPDEST DUP5 MSTORE POP PUSH1 0x20 SWAP1 SWAP3 ADD SWAP2 PUSH1 0x60 SWAP2 SWAP1 SWAP2 ADD SWAP1 PUSH1 0x1 ADD PUSH2 0xE71 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH2 0xEAD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0xEBB PUSH2 0xD6D DUP3 PUSH2 0x1968 JUMP JUMPDEST DUP2 DUP2 MSTORE PUSH1 0x20 SWAP4 DUP5 ADD SWAP4 SWAP1 SWAP3 POP DUP3 ADD DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0xDC3 JUMPI DUP2 CALLDATALOAD DUP7 ADD PUSH2 0xEE3 DUP9 DUP3 PUSH2 0xFB2 JUMP JUMPDEST DUP5 MSTORE POP PUSH1 0x20 SWAP3 DUP4 ADD SWAP3 SWAP2 SWAP1 SWAP2 ADD SWAP1 PUSH1 0x1 ADD PUSH2 0xECD JUMP JUMPDEST PUSH1 0x0 PUSH2 0xC7E DUP3 MLOAD PUSH2 0x1A20 JUMP JUMPDEST PUSH1 0x0 PUSH2 0xC7E DUP3 MLOAD PUSH2 0x19F2 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH2 0xF22 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0xF30 PUSH2 0xD6D DUP3 PUSH2 0x1989 JUMP JUMPDEST SWAP2 POP DUP1 DUP3 MSTORE PUSH1 0x20 DUP4 ADD PUSH1 0x20 DUP4 ADD DUP6 DUP4 DUP4 ADD GT ISZERO PUSH2 0xF4C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x955 DUP4 DUP3 DUP5 PUSH2 0x1A25 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x60 DUP3 DUP5 SUB SLT ISZERO PUSH2 0xF69 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0xF73 PUSH1 0x60 PUSH2 0x1941 JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0xF81 DUP5 DUP5 PUSH2 0x1107 JUMP JUMPDEST DUP3 MSTORE POP PUSH1 0x20 PUSH2 0xF92 DUP5 DUP5 DUP4 ADD PUSH2 0xF05 JUMP JUMPDEST PUSH1 0x20 DUP4 ADD MSTORE POP PUSH1 0x40 PUSH2 0xFA6 DUP5 DUP3 DUP6 ADD PUSH2 0xF05 JUMP JUMPDEST PUSH1 0x40 DUP4 ADD MSTORE POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x180 DUP3 DUP5 SUB SLT ISZERO PUSH2 0xFC5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0xFD0 PUSH2 0x180 PUSH2 0x1941 JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0xFDE DUP5 DUP5 PUSH2 0xD36 JUMP JUMPDEST DUP3 MSTORE POP PUSH1 0x20 PUSH2 0xFEF DUP5 DUP5 DUP4 ADD PUSH2 0xD36 JUMP JUMPDEST PUSH1 0x20 DUP4 ADD MSTORE POP PUSH1 0x40 PUSH2 0x1003 DUP5 DUP3 DUP6 ADD PUSH2 0xD36 JUMP JUMPDEST PUSH1 0x40 DUP4 ADD MSTORE POP PUSH1 0x60 PUSH2 0x1017 DUP5 DUP3 DUP6 ADD PUSH2 0xD36 JUMP JUMPDEST PUSH1 0x60 DUP4 ADD MSTORE POP PUSH1 0x80 PUSH2 0x102B DUP5 DUP3 DUP6 ADD PUSH2 0x10FB JUMP JUMPDEST PUSH1 0x80 DUP4 ADD MSTORE POP PUSH1 0xA0 PUSH2 0x103F DUP5 DUP3 DUP6 ADD PUSH2 0x10FB JUMP JUMPDEST PUSH1 0xA0 DUP4 ADD MSTORE POP PUSH1 0xC0 PUSH2 0x1053 DUP5 DUP3 DUP6 ADD PUSH2 0x10FB JUMP JUMPDEST PUSH1 0xC0 DUP4 ADD MSTORE POP PUSH1 0xE0 PUSH2 0x1067 DUP5 DUP3 DUP6 ADD PUSH2 0x10FB JUMP JUMPDEST PUSH1 0xE0 DUP4 ADD MSTORE POP PUSH2 0x100 PUSH2 0x107C DUP5 DUP3 DUP6 ADD PUSH2 0x10FB JUMP JUMPDEST PUSH2 0x100 DUP4 ADD MSTORE POP PUSH2 0x120 PUSH2 0x1092 DUP5 DUP3 DUP6 ADD PUSH2 0x10FB JUMP JUMPDEST PUSH2 0x120 DUP4 ADD MSTORE POP PUSH2 0x140 DUP3 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x10B4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x10C0 DUP5 DUP3 DUP6 ADD PUSH2 0xF11 JUMP JUMPDEST PUSH2 0x140 DUP4 ADD MSTORE POP PUSH2 0x160 DUP3 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x10E2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x10EE DUP5 DUP3 DUP6 ADD PUSH2 0xF11 JUMP JUMPDEST PUSH2 0x160 DUP4 ADD MSTORE POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0xC7E DUP3 CALLDATALOAD PUSH2 0x19F2 JUMP JUMPDEST PUSH1 0x0 PUSH2 0xC7E DUP3 MLOAD PUSH2 0x1A1A JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x1125 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1131 DUP5 DUP5 PUSH2 0xD42 JUMP JUMPDEST SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x114C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1158 DUP6 DUP6 PUSH2 0xD36 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 DUP4 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1175 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1181 DUP6 DUP3 DUP7 ADD PUSH2 0xDCD JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x119E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x11AA DUP6 DUP6 PUSH2 0xD36 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 DUP4 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x11C7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1181 DUP6 DUP3 DUP7 ADD PUSH2 0xF11 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x11E6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x11F2 DUP6 DUP6 PUSH2 0xD36 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0x1181 DUP6 DUP3 DUP7 ADD PUSH2 0x10FB JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x1215 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 MLOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x122C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1131 DUP5 DUP3 DUP6 ADD PUSH2 0xE2A JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x124B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1262 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x126E DUP6 DUP3 DUP7 ADD PUSH2 0xE9C JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 DUP4 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x128B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1181 DUP6 DUP3 DUP7 ADD PUSH2 0xD4E JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x12A9 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1131 DUP5 DUP5 PUSH2 0xEF9 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x60 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x12C7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1131 DUP5 DUP5 PUSH2 0xF57 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x12E6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x12FD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1309 DUP6 DUP3 DUP7 ADD PUSH2 0xFB2 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0x1181 DUP6 DUP3 DUP7 ADD PUSH2 0xD36 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x132C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1131 DUP5 DUP5 PUSH2 0xF05 JUMP JUMPDEST PUSH2 0x1341 DUP2 PUSH2 0x19D9 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x1352 DUP3 PUSH2 0x19D5 JUMP JUMPDEST DUP1 DUP5 MSTORE PUSH1 0x20 DUP5 ADD SWAP4 POP PUSH2 0x1364 DUP4 PUSH2 0x19CF JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP3 DUP2 LT ISZERO PUSH2 0x1394 JUMPI PUSH2 0x137A DUP7 DUP4 MLOAD PUSH2 0x1619 JUMP JUMPDEST PUSH2 0x1383 DUP3 PUSH2 0x19CF JUMP JUMPDEST PUSH1 0x60 SWAP7 SWAP1 SWAP7 ADD SWAP6 SWAP2 POP PUSH1 0x1 ADD PUSH2 0x1367 JUMP JUMPDEST POP SWAP4 SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x13A9 DUP3 PUSH2 0x19D5 JUMP JUMPDEST DUP1 DUP5 MSTORE PUSH1 0x20 DUP5 ADD SWAP4 POP DUP4 PUSH1 0x20 DUP3 MUL DUP6 ADD PUSH2 0x13C2 DUP6 PUSH2 0x19CF JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP5 DUP2 LT ISZERO PUSH2 0x13F9 JUMPI DUP4 DUP4 SUB DUP9 MSTORE PUSH2 0x13DD DUP4 DUP4 MLOAD PUSH2 0x1656 JUMP JUMPDEST SWAP3 POP PUSH2 0x13E8 DUP3 PUSH2 0x19CF JUMP JUMPDEST PUSH1 0x20 SWAP9 SWAP1 SWAP9 ADD SWAP8 SWAP2 POP PUSH1 0x1 ADD PUSH2 0x13C5 JUMP JUMPDEST POP SWAP1 SWAP7 SWAP6 POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x1410 DUP3 PUSH2 0x19D5 JUMP JUMPDEST DUP1 DUP5 MSTORE PUSH1 0x20 DUP5 ADD SWAP4 POP PUSH2 0x1422 DUP4 PUSH2 0x19CF JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP3 DUP2 LT ISZERO PUSH2 0x1394 JUMPI PUSH2 0x1438 DUP7 DUP4 MLOAD PUSH2 0x1759 JUMP JUMPDEST PUSH2 0x1441 DUP3 PUSH2 0x19CF JUMP JUMPDEST PUSH2 0x100 SWAP7 SWAP1 SWAP7 ADD SWAP6 SWAP2 POP PUSH1 0x1 ADD PUSH2 0x1425 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x145E DUP3 PUSH2 0x19D5 JUMP JUMPDEST DUP1 DUP5 MSTORE PUSH1 0x20 DUP5 ADD SWAP4 POP PUSH2 0x1470 DUP4 PUSH2 0x19CF JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP3 DUP2 LT ISZERO PUSH2 0x1394 JUMPI PUSH2 0x1486 DUP7 DUP4 MLOAD PUSH2 0x14A0 JUMP JUMPDEST PUSH2 0x148F DUP3 PUSH2 0x19CF JUMP JUMPDEST PUSH1 0x20 SWAP7 SWAP1 SWAP7 ADD SWAP6 SWAP2 POP PUSH1 0x1 ADD PUSH2 0x1473 JUMP JUMPDEST PUSH2 0x1341 DUP2 PUSH2 0x19F2 JUMP JUMPDEST PUSH2 0x1341 DUP2 PUSH2 0x19F5 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x14BD DUP3 PUSH2 0x19D5 JUMP JUMPDEST DUP1 DUP5 MSTORE PUSH2 0x14D1 DUP2 PUSH1 0x20 DUP7 ADD PUSH1 0x20 DUP7 ADD PUSH2 0x1A31 JUMP JUMPDEST PUSH2 0x14DA DUP2 PUSH2 0x1A5D JUMP JUMPDEST SWAP1 SWAP4 ADD PUSH1 0x20 ADD SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x26 DUP2 MSTORE PUSH32 0x475245415445525F4F525F455155414C5F544F5F33325F4C454E4754485F5245 PUSH1 0x20 DUP3 ADD MSTORE PUSH32 0x5155495245440000000000000000000000000000000000000000000000000000 PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x60 ADD SWAP1 JUMP JUMPDEST PUSH1 0x17 DUP2 MSTORE PUSH32 0x554E535550504F525445445F41535345545F50524F5859000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x26 DUP2 MSTORE PUSH32 0x475245415445525F4F525F455155414C5F544F5F32305F4C454E4754485F5245 PUSH1 0x20 DUP3 ADD MSTORE PUSH32 0x5155495245440000000000000000000000000000000000000000000000000000 PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x60 ADD SWAP1 JUMP JUMPDEST PUSH1 0x25 DUP2 MSTORE PUSH32 0x475245415445525F4F525F455155414C5F544F5F345F4C454E4754485F524551 PUSH1 0x20 DUP3 ADD MSTORE PUSH32 0x5549524544000000000000000000000000000000000000000000000000000000 PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x60 ADD SWAP1 JUMP JUMPDEST DUP1 MLOAD PUSH1 0x60 DUP4 ADD SWAP1 PUSH2 0x162A DUP5 DUP3 PUSH2 0x17F0 JUMP JUMPDEST POP PUSH1 0x20 DUP3 ADD MLOAD PUSH2 0x163D PUSH1 0x20 DUP6 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH1 0x40 DUP3 ADD MLOAD PUSH2 0x1650 PUSH1 0x40 DUP6 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP POP POP POP JUMP JUMPDEST DUP1 MLOAD PUSH1 0x0 SWAP1 PUSH2 0x180 DUP5 ADD SWAP1 PUSH2 0x166B DUP6 DUP3 PUSH2 0x1338 JUMP JUMPDEST POP PUSH1 0x20 DUP4 ADD MLOAD PUSH2 0x167E PUSH1 0x20 DUP7 ADD DUP3 PUSH2 0x1338 JUMP JUMPDEST POP PUSH1 0x40 DUP4 ADD MLOAD PUSH2 0x1691 PUSH1 0x40 DUP7 ADD DUP3 PUSH2 0x1338 JUMP JUMPDEST POP PUSH1 0x60 DUP4 ADD MLOAD PUSH2 0x16A4 PUSH1 0x60 DUP7 ADD DUP3 PUSH2 0x1338 JUMP JUMPDEST POP PUSH1 0x80 DUP4 ADD MLOAD PUSH2 0x16B7 PUSH1 0x80 DUP7 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH1 0xA0 DUP4 ADD MLOAD PUSH2 0x16CA PUSH1 0xA0 DUP7 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH1 0xC0 DUP4 ADD MLOAD PUSH2 0x16DD PUSH1 0xC0 DUP7 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH1 0xE0 DUP4 ADD MLOAD PUSH2 0x16F0 PUSH1 0xE0 DUP7 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH2 0x100 DUP4 ADD MLOAD PUSH2 0x1705 PUSH2 0x100 DUP7 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH2 0x120 DUP4 ADD MLOAD PUSH2 0x171A PUSH2 0x120 DUP7 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH2 0x140 DUP4 ADD MLOAD DUP5 DUP3 SUB PUSH2 0x140 DUP7 ADD MSTORE PUSH2 0x1734 DUP3 DUP3 PUSH2 0x14B2 JUMP JUMPDEST SWAP2 POP POP PUSH2 0x160 DUP4 ADD MLOAD DUP5 DUP3 SUB PUSH2 0x160 DUP7 ADD MSTORE PUSH2 0x1750 DUP3 DUP3 PUSH2 0x14B2 JUMP JUMPDEST SWAP6 SWAP5 POP POP POP POP POP JUMP JUMPDEST DUP1 MLOAD PUSH2 0x100 DUP4 ADD SWAP1 PUSH2 0x176B DUP5 DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH1 0x20 DUP3 ADD MLOAD PUSH2 0x177E PUSH1 0x20 DUP6 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH1 0x40 DUP3 ADD MLOAD PUSH2 0x1791 PUSH1 0x40 DUP6 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH1 0x60 DUP3 ADD MLOAD PUSH2 0x17A4 PUSH1 0x60 DUP6 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH1 0x80 DUP3 ADD MLOAD PUSH2 0x17B7 PUSH1 0x80 DUP6 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH1 0xA0 DUP3 ADD MLOAD PUSH2 0x17CA PUSH1 0xA0 DUP6 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH1 0xC0 DUP3 ADD MLOAD PUSH2 0x17DD PUSH1 0xC0 DUP6 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH1 0xE0 DUP3 ADD MLOAD PUSH2 0x1650 PUSH1 0xE0 DUP6 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST PUSH2 0x1341 DUP2 PUSH2 0x1A1A JUMP JUMPDEST PUSH1 0x20 DUP2 ADD PUSH2 0x9A3 DUP3 DUP5 PUSH2 0x1338 JUMP JUMPDEST PUSH1 0x40 DUP2 ADD PUSH2 0x1815 DUP3 DUP6 PUSH2 0x1338 JUMP JUMPDEST PUSH2 0xC7E PUSH1 0x20 DUP4 ADD DUP5 PUSH2 0x1338 JUMP JUMPDEST PUSH1 0x40 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x1833 DUP2 DUP6 PUSH2 0x1347 JUMP JUMPDEST SWAP1 POP DUP2 DUP2 SUB PUSH1 0x20 DUP4 ADD MSTORE PUSH2 0x1131 DUP2 DUP5 PUSH2 0x1405 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0xC7E DUP2 DUP5 PUSH2 0x139E JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0xC7E DUP2 DUP5 PUSH2 0x1405 JUMP JUMPDEST PUSH1 0x40 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x187A DUP2 DUP6 PUSH2 0x1453 JUMP JUMPDEST SWAP1 POP DUP2 DUP2 SUB PUSH1 0x20 DUP4 ADD MSTORE PUSH2 0x1131 DUP2 DUP5 PUSH2 0x1453 JUMP JUMPDEST PUSH1 0x20 DUP2 ADD PUSH2 0x9A3 DUP3 DUP5 PUSH2 0x14A9 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x9A3 DUP2 PUSH2 0x14E7 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x9A3 DUP2 PUSH2 0x153D JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x9A3 DUP2 PUSH2 0x156D JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x9A3 DUP2 PUSH2 0x15C3 JUMP JUMPDEST PUSH2 0x160 DUP2 ADD PUSH2 0x18EB DUP3 DUP6 PUSH2 0x1619 JUMP JUMPDEST PUSH2 0xC7E PUSH1 0x60 DUP4 ADD DUP5 PUSH2 0x1759 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0xC7E DUP2 DUP5 PUSH2 0x1656 JUMP JUMPDEST PUSH2 0x100 DUP2 ADD PUSH2 0x9A3 DUP3 DUP5 PUSH2 0x1759 JUMP JUMPDEST PUSH1 0x20 DUP2 ADD PUSH2 0x9A3 DUP3 DUP5 PUSH2 0x14A0 JUMP JUMPDEST PUSH1 0x40 DUP2 ADD PUSH2 0x1934 DUP3 DUP6 PUSH2 0x14A0 JUMP JUMPDEST PUSH2 0xC7E PUSH1 0x20 DUP4 ADD DUP5 PUSH2 0x14A0 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP2 DUP2 ADD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT DUP3 DUP3 LT OR ISZERO PUSH2 0x1960 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x40 MSTORE SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH8 0xFFFFFFFFFFFFFFFF DUP3 GT ISZERO PUSH2 0x197F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x20 SWAP1 DUP2 MUL ADD SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH8 0xFFFFFFFFFFFFFFFF DUP3 GT ISZERO PUSH2 0x19A0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x20 PUSH1 0x1F SWAP2 SWAP1 SWAP2 ADD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 AND ADD SWAP1 JUMP JUMPDEST PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST MLOAD SWAP1 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 JUMP JUMPDEST SWAP1 JUMP JUMPDEST PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 AND SWAP1 JUMP JUMPDEST PUSH1 0xFF AND SWAP1 JUMP JUMPDEST ISZERO ISZERO SWAP1 JUMP JUMPDEST DUP3 DUP2 DUP4 CALLDATACOPY POP PUSH1 0x0 SWAP2 ADD MSTORE JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x1A4C JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH2 0x1A34 JUMP JUMPDEST DUP4 DUP2 GT ISZERO PUSH2 0x1650 JUMPI POP POP PUSH1 0x0 SWAP2 ADD MSTORE JUMP JUMPDEST PUSH1 0x1F ADD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 AND SWAP1 JUMP STOP LOG2 PUSH6 0x627A7A723058 KECCAK256 0xd2 0xe9 PUSH31 0x29F930427E8936D11AF9A8EE1660886400D9687ABB10C976177F33449C6C65 PUSH25 0x706572696D656E74616CF50037000000000000000000000000 ",
- "sourceMap": "898:8536:11:-;;;1916:167;8:9:-1;5:2;;;30:1;27;20:12;5:2;1916:167:11;;;;;;;;;;;;;;;;;;;;;;;;2005:8;:31;;-1:-1:-1;;;;;;2005:31:11;-1:-1:-1;;;;;2005:31:11;;;;;2046:30;;;;-1:-1:-1;;2046:30:11;;;;;:::i;:::-;;1916:167;;898:8536;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;898:8536:11;;;-1:-1:-1;898:8536:11;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;:::o;5:122:-1:-;;83:39;114:6;108:13;83:39;;;74:48;68:59;-1:-1;;;68:59;135:442;;240:4;228:17;;224:27;-1:-1;214:2;;265:1;262;255:12;214:2;295:6;289:13;317:64;332:48;373:6;332:48;;;317:64;;;308:73;;401:6;394:5;387:21;437:4;429:6;425:17;470:4;463:5;459:16;505:3;496:6;491:3;487:16;484:25;481:2;;;522:1;519;512:12;481:2;532:39;564:6;559:3;554;532:39;;;207:370;;;;;;;;585:496;;;726:2;714:9;705:7;701:23;697:32;694:2;;;742:1;739;732:12;694:2;777:1;794:64;850:7;830:9;794:64;;;784:74;;756:108;916:2;905:9;901:18;895:25;-1:-1;;;;;932:6;929:30;926:2;;;972:1;969;962:12;926:2;992:73;1057:7;1048:6;1037:9;1033:22;992:73;;;982:83;;874:197;688:393;;;;;;1088:256;1150:2;1144:9;1176:17;;;-1:-1;;;;;1236:34;;1272:22;;;1233:62;1230:2;;;1308:1;1305;1298:12;1230:2;1324;1317:22;1128:216;;-1:-1;1128:216;1351:258;;-1:-1;;;;;1486:6;1483:30;1480:2;;;1526:1;1523;1516:12;1480:2;-1:-1;1599:4;1570;1547:17;;;;-1:-1;;1543:33;1589:15;;1417:192;1616:128;-1:-1;;;;;1685:54;;1668:76;1752:268;1817:1;1824:101;1838:6;1835:1;1832:13;1824:101;;;1905:11;;;1899:18;1886:11;;;1879:39;1860:2;1853:10;1824:101;;;1940:6;1937:1;1934:13;1931:2;;;2005:1;1996:6;1991:3;1987:16;1980:27;1931:2;1801:219;;;;;;898:8536:11;;;;;;"
- },
- "deployedBytecode": {
- "linkReferences": {},
- "object": "0x6080604052600436106100825763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166304ad1e5381146100875780632cd0fc73146100be5780634b95de13146100ec578063690d31141461011a578063b698846314610147578063c6b7f4ee14610174578063f241ffb0146101a2575b600080fd5b34801561009357600080fd5b506100a76100a23660046112d3565b6101cf565b6040516100b59291906118dc565b60405180910390f35b3480156100ca57600080fd5b506100de6100d936600461118b565b61029c565b6040516100b5929190611926565b3480156100f857600080fd5b5061010c610107366004611238565b6107cd565b6040516100b5929190611822565b34801561012657600080fd5b5061013a610135366004611238565b6108a4565b6040516100b59190611858565b34801561015357600080fd5b506101676101623660046111d3565b61095e565b6040516100b591906117f9565b34801561018057600080fd5b5061019461018f366004611139565b6109a9565b6040516100b5929190611869565b3480156101ae57600080fd5b506101c26101bd3660046112d3565b610a86565b6040516100b59190611909565b6101d7610cd0565b6101df610cf0565b6000546040517fc75e0a8100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091169063c75e0a81906102359087906004016118f8565b606060405180830381600087803b15801561024f57600080fd5b505af1158015610263573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061028791908101906112b5565b91506102938484610a86565b90509250929050565b6000808080808080806102b5898263ffffffff610ba416565b95506102c889601063ffffffff610c1116565b6000546040517f6070410800000000000000000000000000000000000000000000000000000000815291965073ffffffffffffffffffffffffffffffffffffffff169063607041089061031f90899060040161188e565b602060405180830381600087803b15801561033957600080fd5b505af115801561034d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506103719190810190611113565b604080517f4552433230546f6b656e28616464726573732900000000000000000000000000815290519081900360130190209094507fffffffff0000000000000000000000000000000000000000000000000000000087811691161415610526576040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8616906370a0823190610424908d906004016117f9565b602060405180830381600087803b15801561043e57600080fd5b505af1158015610452573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610476919081019061131a565b6040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815290985073ffffffffffffffffffffffffffffffffffffffff86169063dd62ed3e906104cd908d908890600401611807565b602060405180830381600087803b1580156104e757600080fd5b505af11580156104fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061051f919081019061131a565b96506107c0565b604080517f455243373231546f6b656e28616464726573732c75696e7432353629000000008152905190819003601c0190207fffffffff00000000000000000000000000000000000000000000000000000000878116911614156107855761059589602463ffffffff610c7216565b92506105a1858461095e565b91508173ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff16146105dd5760006105e0565b60015b60ff1697508473ffffffffffffffffffffffffffffffffffffffff1663e985e9c58b866040518363ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040161063c929190611807565b602060405180830381600087803b15801561065657600080fd5b505af115801561066a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061068e9190810190611297565b8061076a57508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1663081812fc856040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004016107009190611918565b602060405180830381600087803b15801561071a57600080fd5b505af115801561072e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506107529190810190611113565b73ffffffffffffffffffffffffffffffffffffffff16145b90508061077857600061077b565b60015b60ff1696506107c0565b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107b7906118ac565b60405180910390fd5b5050505050509250929050565b6000546040517f7e9d74dc000000000000000000000000000000000000000000000000000000008152606091829173ffffffffffffffffffffffffffffffffffffffff90911690637e9d74dc90610828908790600401611847565b600060405180830381600087803b15801561084257600080fd5b505af1158015610856573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405261089c9190810190611203565b915061029384845b606060006060600085519250826040519080825280602002602001820160405280156108ea57816020015b6108d7610cf0565b8152602001906001900390816108cf5790505b509150600090505b80831461095157610931868281518110151561090a57fe5b90602001906020020151868381518110151561092257fe5b90602001906020020151610a86565b828281518110151561093f57fe5b602090810290910101526001016108f2565b8193505b50505092915050565b60006040517f6352211e000000000000000000000000000000000000000000000000000000008152826004820152602081602483875afa80156109a057815192505b50505b92915050565b6060806000606080600086519350836040519080825280602002602001820160405280156109e1578160200160208202803883390190505b50925083604051908082528060200260200182016040528015610a0e578160200160208202803883390190505b509150600090505b808414610a7957610a3e888883815181101515610a2f57fe5b9060200190602002015161029c565b8483815181101515610a4c57fe5b9060200190602002018484815181101515610a6357fe5b6020908102909101019190915252600101610a16565b5090969095509350505050565b610a8e610cf0565b6060610aa3846000015185610140015161029c565b60208401528252610160840151610abb90849061029c565b60608401526040808401919091526001805482516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101008688161502019094169390930492830181900481028201810190945281815292830182828015610b6a5780601f10610b3f57610100808354040283529160200191610b6a565b820191906000526020600020905b815481529060010190602001808311610b4d57829003601f168201915b50505050509050610b7f84600001518261029c565b60a08401526080830152610b93838261029c565b60e084015260c08301525092915050565b600081600401835110151515610be6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107b7906118cc565b5001602001517fffffffff000000000000000000000000000000000000000000000000000000001690565b600081601401835110151515610c53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107b7906118bc565b50016014015173ffffffffffffffffffffffffffffffffffffffff1690565b6000610c7e8383610c85565b9392505050565b600081602001835110151515610cc7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107b79061189c565b50016020015190565b604080516060810182526000808252602082018190529181019190915290565b6101006040519081016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6000610c7e82356119d9565b6000610c7e82516119d9565b6000601f82018313610d5f57600080fd5b8135610d72610d6d82611968565b611941565b91508181835260208401935060208101905083856020840282011115610d9757600080fd5b60005b83811015610dc35781610dad8882610d36565b8452506020928301929190910190600101610d9a565b5050505092915050565b6000601f82018313610dde57600080fd5b8135610dec610d6d82611968565b81815260209384019390925082018360005b83811015610dc35781358601610e148882610f11565b8452506020928301929190910190600101610dfe565b6000601f82018313610e3b57600080fd5b8151610e49610d6d82611968565b91508181835260208401935060208101905083856060840282011115610e6e57600080fd5b60005b83811015610dc35781610e848882610f57565b84525060209092019160609190910190600101610e71565b6000601f82018313610ead57600080fd5b8135610ebb610d6d82611968565b81815260209384019390925082018360005b83811015610dc35781358601610ee38882610fb2565b8452506020928301929190910190600101610ecd565b6000610c7e8251611a20565b6000610c7e82516119f2565b6000601f82018313610f2257600080fd5b8135610f30610d6d82611989565b91508082526020830160208301858383011115610f4c57600080fd5b610955838284611a25565b600060608284031215610f6957600080fd5b610f736060611941565b90506000610f818484611107565b8252506020610f9284848301610f05565b6020830152506040610fa684828501610f05565b60408301525092915050565b60006101808284031215610fc557600080fd5b610fd0610180611941565b90506000610fde8484610d36565b8252506020610fef84848301610d36565b602083015250604061100384828501610d36565b604083015250606061101784828501610d36565b606083015250608061102b848285016110fb565b60808301525060a061103f848285016110fb565b60a08301525060c0611053848285016110fb565b60c08301525060e0611067848285016110fb565b60e08301525061010061107c848285016110fb565b61010083015250610120611092848285016110fb565b6101208301525061014082013567ffffffffffffffff8111156110b457600080fd5b6110c084828501610f11565b6101408301525061016082013567ffffffffffffffff8111156110e257600080fd5b6110ee84828501610f11565b6101608301525092915050565b6000610c7e82356119f2565b6000610c7e8251611a1a565b60006020828403121561112557600080fd5b60006111318484610d42565b949350505050565b6000806040838503121561114c57600080fd5b60006111588585610d36565b925050602083013567ffffffffffffffff81111561117557600080fd5b61118185828601610dcd565b9150509250929050565b6000806040838503121561119e57600080fd5b60006111aa8585610d36565b925050602083013567ffffffffffffffff8111156111c757600080fd5b61118185828601610f11565b600080604083850312156111e657600080fd5b60006111f28585610d36565b9250506020611181858286016110fb565b60006020828403121561121557600080fd5b815167ffffffffffffffff81111561122c57600080fd5b61113184828501610e2a565b6000806040838503121561124b57600080fd5b823567ffffffffffffffff81111561126257600080fd5b61126e85828601610e9c565b925050602083013567ffffffffffffffff81111561128b57600080fd5b61118185828601610d4e565b6000602082840312156112a957600080fd5b60006111318484610ef9565b6000606082840312156112c757600080fd5b60006111318484610f57565b600080604083850312156112e657600080fd5b823567ffffffffffffffff8111156112fd57600080fd5b61130985828601610fb2565b925050602061118185828601610d36565b60006020828403121561132c57600080fd5b60006111318484610f05565b611341816119d9565b82525050565b6000611352826119d5565b808452602084019350611364836119cf565b60005b828110156113945761137a868351611619565b611383826119cf565b606096909601959150600101611367565b5093949350505050565b60006113a9826119d5565b808452602084019350836020820285016113c2856119cf565b60005b848110156113f95783830388526113dd838351611656565b92506113e8826119cf565b6020989098019791506001016113c5565b50909695505050505050565b6000611410826119d5565b808452602084019350611422836119cf565b60005b8281101561139457611438868351611759565b611441826119cf565b61010096909601959150600101611425565b600061145e826119d5565b808452602084019350611470836119cf565b60005b82811015611394576114868683516114a0565b61148f826119cf565b602096909601959150600101611473565b611341816119f2565b611341816119f5565b60006114bd826119d5565b8084526114d1816020860160208601611a31565b6114da81611a5d565b9093016020019392505050565b602681527f475245415445525f4f525f455155414c5f544f5f33325f4c454e4754485f524560208201527f5155495245440000000000000000000000000000000000000000000000000000604082015260600190565b601781527f554e535550504f525445445f41535345545f50524f5859000000000000000000602082015260400190565b602681527f475245415445525f4f525f455155414c5f544f5f32305f4c454e4754485f524560208201527f5155495245440000000000000000000000000000000000000000000000000000604082015260600190565b602581527f475245415445525f4f525f455155414c5f544f5f345f4c454e4754485f52455160208201527f5549524544000000000000000000000000000000000000000000000000000000604082015260600190565b8051606083019061162a84826117f0565b50602082015161163d60208501826114a0565b50604082015161165060408501826114a0565b50505050565b805160009061018084019061166b8582611338565b50602083015161167e6020860182611338565b5060408301516116916040860182611338565b5060608301516116a46060860182611338565b5060808301516116b760808601826114a0565b5060a08301516116ca60a08601826114a0565b5060c08301516116dd60c08601826114a0565b5060e08301516116f060e08601826114a0565b506101008301516117056101008601826114a0565b5061012083015161171a6101208601826114a0565b5061014083015184820361014086015261173482826114b2565b91505061016083015184820361016086015261175082826114b2565b95945050505050565b805161010083019061176b84826114a0565b50602082015161177e60208501826114a0565b50604082015161179160408501826114a0565b5060608201516117a460608501826114a0565b5060808201516117b760808501826114a0565b5060a08201516117ca60a08501826114a0565b5060c08201516117dd60c08501826114a0565b5060e082015161165060e08501826114a0565b61134181611a1a565b602081016109a38284611338565b604081016118158285611338565b610c7e6020830184611338565b604080825281016118338185611347565b905081810360208301526111318184611405565b60208082528101610c7e818461139e565b60208082528101610c7e8184611405565b6040808252810161187a8185611453565b905081810360208301526111318184611453565b602081016109a382846114a9565b602080825281016109a3816114e7565b602080825281016109a38161153d565b602080825281016109a38161156d565b602080825281016109a3816115c3565b61016081016118eb8285611619565b610c7e6060830184611759565b60208082528101610c7e8184611656565b61010081016109a38284611759565b602081016109a382846114a0565b6040810161193482856114a0565b610c7e60208301846114a0565b60405181810167ffffffffffffffff8111828210171561196057600080fd5b604052919050565b600067ffffffffffffffff82111561197f57600080fd5b5060209081020190565b600067ffffffffffffffff8211156119a057600080fd5b506020601f919091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0160190565b60200190565b5190565b73ffffffffffffffffffffffffffffffffffffffff1690565b90565b7fffffffff000000000000000000000000000000000000000000000000000000001690565b60ff1690565b151590565b82818337506000910152565b60005b83811015611a4c578181015183820152602001611a34565b838111156116505750506000910152565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016905600a265627a7a72305820d2e97e29f930427e8936d11af9a8ee1660886400d9687abb10c976177f33449c6c6578706572696d656e74616cf50037",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x82 JUMPI PUSH4 0xFFFFFFFF PUSH29 0x100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD DIV AND PUSH4 0x4AD1E53 DUP2 EQ PUSH2 0x87 JUMPI DUP1 PUSH4 0x2CD0FC73 EQ PUSH2 0xBE JUMPI DUP1 PUSH4 0x4B95DE13 EQ PUSH2 0xEC JUMPI DUP1 PUSH4 0x690D3114 EQ PUSH2 0x11A JUMPI DUP1 PUSH4 0xB6988463 EQ PUSH2 0x147 JUMPI DUP1 PUSH4 0xC6B7F4EE EQ PUSH2 0x174 JUMPI DUP1 PUSH4 0xF241FFB0 EQ PUSH2 0x1A2 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x93 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xA7 PUSH2 0xA2 CALLDATASIZE PUSH1 0x4 PUSH2 0x12D3 JUMP JUMPDEST PUSH2 0x1CF JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xB5 SWAP3 SWAP2 SWAP1 PUSH2 0x18DC JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xCA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xDE PUSH2 0xD9 CALLDATASIZE PUSH1 0x4 PUSH2 0x118B JUMP JUMPDEST PUSH2 0x29C JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xB5 SWAP3 SWAP2 SWAP1 PUSH2 0x1926 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xF8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x10C PUSH2 0x107 CALLDATASIZE PUSH1 0x4 PUSH2 0x1238 JUMP JUMPDEST PUSH2 0x7CD JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xB5 SWAP3 SWAP2 SWAP1 PUSH2 0x1822 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x126 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x13A PUSH2 0x135 CALLDATASIZE PUSH1 0x4 PUSH2 0x1238 JUMP JUMPDEST PUSH2 0x8A4 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xB5 SWAP2 SWAP1 PUSH2 0x1858 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x153 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x167 PUSH2 0x162 CALLDATASIZE PUSH1 0x4 PUSH2 0x11D3 JUMP JUMPDEST PUSH2 0x95E JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xB5 SWAP2 SWAP1 PUSH2 0x17F9 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x180 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x194 PUSH2 0x18F CALLDATASIZE PUSH1 0x4 PUSH2 0x1139 JUMP JUMPDEST PUSH2 0x9A9 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xB5 SWAP3 SWAP2 SWAP1 PUSH2 0x1869 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1AE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1C2 PUSH2 0x1BD CALLDATASIZE PUSH1 0x4 PUSH2 0x12D3 JUMP JUMPDEST PUSH2 0xA86 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xB5 SWAP2 SWAP1 PUSH2 0x1909 JUMP JUMPDEST PUSH2 0x1D7 PUSH2 0xCD0 JUMP JUMPDEST PUSH2 0x1DF PUSH2 0xCF0 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x40 MLOAD PUSH32 0xC75E0A8100000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP2 AND SWAP1 PUSH4 0xC75E0A81 SWAP1 PUSH2 0x235 SWAP1 DUP8 SWAP1 PUSH1 0x4 ADD PUSH2 0x18F8 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x24F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x263 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP PUSH2 0x287 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x12B5 JUMP JUMPDEST SWAP2 POP PUSH2 0x293 DUP5 DUP5 PUSH2 0xA86 JUMP JUMPDEST SWAP1 POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP1 DUP1 DUP1 DUP1 DUP1 DUP1 PUSH2 0x2B5 DUP10 DUP3 PUSH4 0xFFFFFFFF PUSH2 0xBA4 AND JUMP JUMPDEST SWAP6 POP PUSH2 0x2C8 DUP10 PUSH1 0x10 PUSH4 0xFFFFFFFF PUSH2 0xC11 AND JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x40 MLOAD PUSH32 0x6070410800000000000000000000000000000000000000000000000000000000 DUP2 MSTORE SWAP2 SWAP7 POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH4 0x60704108 SWAP1 PUSH2 0x31F SWAP1 DUP10 SWAP1 PUSH1 0x4 ADD PUSH2 0x188E JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x339 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x34D JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP PUSH2 0x371 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x1113 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0x4552433230546F6B656E28616464726573732900000000000000000000000000 DUP2 MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x13 ADD SWAP1 KECCAK256 SWAP1 SWAP5 POP PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 DUP8 DUP2 AND SWAP2 AND EQ ISZERO PUSH2 0x526 JUMPI PUSH1 0x40 MLOAD PUSH32 0x70A0823100000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP7 AND SWAP1 PUSH4 0x70A08231 SWAP1 PUSH2 0x424 SWAP1 DUP14 SWAP1 PUSH1 0x4 ADD PUSH2 0x17F9 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x43E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x452 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP PUSH2 0x476 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x131A JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH32 0xDD62ED3E00000000000000000000000000000000000000000000000000000000 DUP2 MSTORE SWAP1 SWAP9 POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP7 AND SWAP1 PUSH4 0xDD62ED3E SWAP1 PUSH2 0x4CD SWAP1 DUP14 SWAP1 DUP9 SWAP1 PUSH1 0x4 ADD PUSH2 0x1807 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x4E7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x4FB JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP PUSH2 0x51F SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x131A JUMP JUMPDEST SWAP7 POP PUSH2 0x7C0 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0x455243373231546F6B656E28616464726573732C75696E743235362900000000 DUP2 MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x1C ADD SWAP1 KECCAK256 PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 DUP8 DUP2 AND SWAP2 AND EQ ISZERO PUSH2 0x785 JUMPI PUSH2 0x595 DUP10 PUSH1 0x24 PUSH4 0xFFFFFFFF PUSH2 0xC72 AND JUMP JUMPDEST SWAP3 POP PUSH2 0x5A1 DUP6 DUP5 PUSH2 0x95E JUMP JUMPDEST SWAP2 POP DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP11 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0x5DD JUMPI PUSH1 0x0 PUSH2 0x5E0 JUMP JUMPDEST PUSH1 0x1 JUMPDEST PUSH1 0xFF AND SWAP8 POP DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0xE985E9C5 DUP12 DUP7 PUSH1 0x40 MLOAD DUP4 PUSH4 0xFFFFFFFF AND PUSH29 0x100000000000000000000000000000000000000000000000000000000 MUL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x63C SWAP3 SWAP2 SWAP1 PUSH2 0x1807 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x656 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x66A JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP PUSH2 0x68E SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x1297 JUMP JUMPDEST DUP1 PUSH2 0x76A JUMPI POP DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0x81812FC DUP6 PUSH1 0x40 MLOAD DUP3 PUSH4 0xFFFFFFFF AND PUSH29 0x100000000000000000000000000000000000000000000000000000000 MUL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x700 SWAP2 SWAP1 PUSH2 0x1918 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x71A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x72E JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP PUSH2 0x752 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x1113 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ JUMPDEST SWAP1 POP DUP1 PUSH2 0x778 JUMPI PUSH1 0x0 PUSH2 0x77B JUMP JUMPDEST PUSH1 0x1 JUMPDEST PUSH1 0xFF AND SWAP7 POP PUSH2 0x7C0 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x7B7 SWAP1 PUSH2 0x18AC JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP POP POP POP POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x40 MLOAD PUSH32 0x7E9D74DC00000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x60 SWAP2 DUP3 SWAP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP2 AND SWAP1 PUSH4 0x7E9D74DC SWAP1 PUSH2 0x828 SWAP1 DUP8 SWAP1 PUSH1 0x4 ADD PUSH2 0x1847 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x842 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x856 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x0 DUP3 RETURNDATACOPY PUSH1 0x1F RETURNDATASIZE SWAP1 DUP2 ADD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 AND DUP3 ADD PUSH1 0x40 MSTORE PUSH2 0x89C SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x1203 JUMP JUMPDEST SWAP2 POP PUSH2 0x293 DUP5 DUP5 JUMPDEST PUSH1 0x60 PUSH1 0x0 PUSH1 0x60 PUSH1 0x0 DUP6 MLOAD SWAP3 POP DUP3 PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x8EA JUMPI DUP2 PUSH1 0x20 ADD JUMPDEST PUSH2 0x8D7 PUSH2 0xCF0 JUMP JUMPDEST DUP2 MSTORE PUSH1 0x20 ADD SWAP1 PUSH1 0x1 SWAP1 SUB SWAP1 DUP2 PUSH2 0x8CF JUMPI SWAP1 POP JUMPDEST POP SWAP2 POP PUSH1 0x0 SWAP1 POP JUMPDEST DUP1 DUP4 EQ PUSH2 0x951 JUMPI PUSH2 0x931 DUP7 DUP3 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x90A JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD DUP7 DUP4 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x922 JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0xA86 JUMP JUMPDEST DUP3 DUP3 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0x93F JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD MSTORE PUSH1 0x1 ADD PUSH2 0x8F2 JUMP JUMPDEST DUP2 SWAP4 POP JUMPDEST POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD PUSH32 0x6352211E00000000000000000000000000000000000000000000000000000000 DUP2 MSTORE DUP3 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x20 DUP2 PUSH1 0x24 DUP4 DUP8 GAS STATICCALL DUP1 ISZERO PUSH2 0x9A0 JUMPI DUP2 MLOAD SWAP3 POP JUMPDEST POP POP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x60 DUP1 PUSH1 0x0 PUSH1 0x60 DUP1 PUSH1 0x0 DUP7 MLOAD SWAP4 POP DUP4 PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x9E1 JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CODESIZE DUP4 CODECOPY ADD SWAP1 POP JUMPDEST POP SWAP3 POP DUP4 PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0xA0E JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CODESIZE DUP4 CODECOPY ADD SWAP1 POP JUMPDEST POP SWAP2 POP PUSH1 0x0 SWAP1 POP JUMPDEST DUP1 DUP5 EQ PUSH2 0xA79 JUMPI PUSH2 0xA3E DUP9 DUP9 DUP4 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xA2F JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD MLOAD PUSH2 0x29C JUMP JUMPDEST DUP5 DUP4 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xA4C JUMPI INVALID JUMPDEST SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL ADD DUP5 DUP5 DUP2 MLOAD DUP2 LT ISZERO ISZERO PUSH2 0xA63 JUMPI INVALID JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP1 SWAP2 ADD ADD SWAP2 SWAP1 SWAP2 MSTORE MSTORE PUSH1 0x1 ADD PUSH2 0xA16 JUMP JUMPDEST POP SWAP1 SWAP7 SWAP1 SWAP6 POP SWAP4 POP POP POP POP JUMP JUMPDEST PUSH2 0xA8E PUSH2 0xCF0 JUMP JUMPDEST PUSH1 0x60 PUSH2 0xAA3 DUP5 PUSH1 0x0 ADD MLOAD DUP6 PUSH2 0x140 ADD MLOAD PUSH2 0x29C JUMP JUMPDEST PUSH1 0x20 DUP5 ADD MSTORE DUP3 MSTORE PUSH2 0x160 DUP5 ADD MLOAD PUSH2 0xABB SWAP1 DUP5 SWAP1 PUSH2 0x29C JUMP JUMPDEST PUSH1 0x60 DUP5 ADD MSTORE PUSH1 0x40 DUP1 DUP5 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x1 DUP1 SLOAD DUP3 MLOAD PUSH1 0x20 PUSH1 0x1F PUSH1 0x2 PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH2 0x100 DUP7 DUP9 AND ISZERO MUL ADD SWAP1 SWAP5 AND SWAP4 SWAP1 SWAP4 DIV SWAP3 DUP4 ADD DUP2 SWAP1 DIV DUP2 MUL DUP3 ADD DUP2 ADD SWAP1 SWAP5 MSTORE DUP2 DUP2 MSTORE SWAP3 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0xB6A JUMPI DUP1 PUSH1 0x1F LT PUSH2 0xB3F JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0xB6A JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0xB4D JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP1 POP PUSH2 0xB7F DUP5 PUSH1 0x0 ADD MLOAD DUP3 PUSH2 0x29C JUMP JUMPDEST PUSH1 0xA0 DUP5 ADD MSTORE PUSH1 0x80 DUP4 ADD MSTORE PUSH2 0xB93 DUP4 DUP3 PUSH2 0x29C JUMP JUMPDEST PUSH1 0xE0 DUP5 ADD MSTORE PUSH1 0xC0 DUP4 ADD MSTORE POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x4 ADD DUP4 MLOAD LT ISZERO ISZERO ISZERO PUSH2 0xBE6 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x7B7 SWAP1 PUSH2 0x18CC JUMP JUMPDEST POP ADD PUSH1 0x20 ADD MLOAD PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 AND SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x14 ADD DUP4 MLOAD LT ISZERO ISZERO ISZERO PUSH2 0xC53 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x7B7 SWAP1 PUSH2 0x18BC JUMP JUMPDEST POP ADD PUSH1 0x14 ADD MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0xC7E DUP4 DUP4 PUSH2 0xC85 JUMP JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x20 ADD DUP4 MLOAD LT ISZERO ISZERO ISZERO PUSH2 0xCC7 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x7B7 SWAP1 PUSH2 0x189C JUMP JUMPDEST POP ADD PUSH1 0x20 ADD MLOAD SWAP1 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x60 DUP2 ADD DUP3 MSTORE PUSH1 0x0 DUP1 DUP3 MSTORE PUSH1 0x20 DUP3 ADD DUP2 SWAP1 MSTORE SWAP2 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE SWAP1 JUMP JUMPDEST PUSH2 0x100 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE POP SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0xC7E DUP3 CALLDATALOAD PUSH2 0x19D9 JUMP JUMPDEST PUSH1 0x0 PUSH2 0xC7E DUP3 MLOAD PUSH2 0x19D9 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH2 0xD5F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0xD72 PUSH2 0xD6D DUP3 PUSH2 0x1968 JUMP JUMPDEST PUSH2 0x1941 JUMP JUMPDEST SWAP2 POP DUP2 DUP2 DUP4 MSTORE PUSH1 0x20 DUP5 ADD SWAP4 POP PUSH1 0x20 DUP2 ADD SWAP1 POP DUP4 DUP6 PUSH1 0x20 DUP5 MUL DUP3 ADD GT ISZERO PUSH2 0xD97 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0xDC3 JUMPI DUP2 PUSH2 0xDAD DUP9 DUP3 PUSH2 0xD36 JUMP JUMPDEST DUP5 MSTORE POP PUSH1 0x20 SWAP3 DUP4 ADD SWAP3 SWAP2 SWAP1 SWAP2 ADD SWAP1 PUSH1 0x1 ADD PUSH2 0xD9A JUMP JUMPDEST POP POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH2 0xDDE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0xDEC PUSH2 0xD6D DUP3 PUSH2 0x1968 JUMP JUMPDEST DUP2 DUP2 MSTORE PUSH1 0x20 SWAP4 DUP5 ADD SWAP4 SWAP1 SWAP3 POP DUP3 ADD DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0xDC3 JUMPI DUP2 CALLDATALOAD DUP7 ADD PUSH2 0xE14 DUP9 DUP3 PUSH2 0xF11 JUMP JUMPDEST DUP5 MSTORE POP PUSH1 0x20 SWAP3 DUP4 ADD SWAP3 SWAP2 SWAP1 SWAP2 ADD SWAP1 PUSH1 0x1 ADD PUSH2 0xDFE JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH2 0xE3B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 MLOAD PUSH2 0xE49 PUSH2 0xD6D DUP3 PUSH2 0x1968 JUMP JUMPDEST SWAP2 POP DUP2 DUP2 DUP4 MSTORE PUSH1 0x20 DUP5 ADD SWAP4 POP PUSH1 0x20 DUP2 ADD SWAP1 POP DUP4 DUP6 PUSH1 0x60 DUP5 MUL DUP3 ADD GT ISZERO PUSH2 0xE6E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0xDC3 JUMPI DUP2 PUSH2 0xE84 DUP9 DUP3 PUSH2 0xF57 JUMP JUMPDEST DUP5 MSTORE POP PUSH1 0x20 SWAP1 SWAP3 ADD SWAP2 PUSH1 0x60 SWAP2 SWAP1 SWAP2 ADD SWAP1 PUSH1 0x1 ADD PUSH2 0xE71 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH2 0xEAD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0xEBB PUSH2 0xD6D DUP3 PUSH2 0x1968 JUMP JUMPDEST DUP2 DUP2 MSTORE PUSH1 0x20 SWAP4 DUP5 ADD SWAP4 SWAP1 SWAP3 POP DUP3 ADD DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0xDC3 JUMPI DUP2 CALLDATALOAD DUP7 ADD PUSH2 0xEE3 DUP9 DUP3 PUSH2 0xFB2 JUMP JUMPDEST DUP5 MSTORE POP PUSH1 0x20 SWAP3 DUP4 ADD SWAP3 SWAP2 SWAP1 SWAP2 ADD SWAP1 PUSH1 0x1 ADD PUSH2 0xECD JUMP JUMPDEST PUSH1 0x0 PUSH2 0xC7E DUP3 MLOAD PUSH2 0x1A20 JUMP JUMPDEST PUSH1 0x0 PUSH2 0xC7E DUP3 MLOAD PUSH2 0x19F2 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F DUP3 ADD DUP4 SGT PUSH2 0xF22 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0xF30 PUSH2 0xD6D DUP3 PUSH2 0x1989 JUMP JUMPDEST SWAP2 POP DUP1 DUP3 MSTORE PUSH1 0x20 DUP4 ADD PUSH1 0x20 DUP4 ADD DUP6 DUP4 DUP4 ADD GT ISZERO PUSH2 0xF4C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x955 DUP4 DUP3 DUP5 PUSH2 0x1A25 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x60 DUP3 DUP5 SUB SLT ISZERO PUSH2 0xF69 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0xF73 PUSH1 0x60 PUSH2 0x1941 JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0xF81 DUP5 DUP5 PUSH2 0x1107 JUMP JUMPDEST DUP3 MSTORE POP PUSH1 0x20 PUSH2 0xF92 DUP5 DUP5 DUP4 ADD PUSH2 0xF05 JUMP JUMPDEST PUSH1 0x20 DUP4 ADD MSTORE POP PUSH1 0x40 PUSH2 0xFA6 DUP5 DUP3 DUP6 ADD PUSH2 0xF05 JUMP JUMPDEST PUSH1 0x40 DUP4 ADD MSTORE POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x180 DUP3 DUP5 SUB SLT ISZERO PUSH2 0xFC5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0xFD0 PUSH2 0x180 PUSH2 0x1941 JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0xFDE DUP5 DUP5 PUSH2 0xD36 JUMP JUMPDEST DUP3 MSTORE POP PUSH1 0x20 PUSH2 0xFEF DUP5 DUP5 DUP4 ADD PUSH2 0xD36 JUMP JUMPDEST PUSH1 0x20 DUP4 ADD MSTORE POP PUSH1 0x40 PUSH2 0x1003 DUP5 DUP3 DUP6 ADD PUSH2 0xD36 JUMP JUMPDEST PUSH1 0x40 DUP4 ADD MSTORE POP PUSH1 0x60 PUSH2 0x1017 DUP5 DUP3 DUP6 ADD PUSH2 0xD36 JUMP JUMPDEST PUSH1 0x60 DUP4 ADD MSTORE POP PUSH1 0x80 PUSH2 0x102B DUP5 DUP3 DUP6 ADD PUSH2 0x10FB JUMP JUMPDEST PUSH1 0x80 DUP4 ADD MSTORE POP PUSH1 0xA0 PUSH2 0x103F DUP5 DUP3 DUP6 ADD PUSH2 0x10FB JUMP JUMPDEST PUSH1 0xA0 DUP4 ADD MSTORE POP PUSH1 0xC0 PUSH2 0x1053 DUP5 DUP3 DUP6 ADD PUSH2 0x10FB JUMP JUMPDEST PUSH1 0xC0 DUP4 ADD MSTORE POP PUSH1 0xE0 PUSH2 0x1067 DUP5 DUP3 DUP6 ADD PUSH2 0x10FB JUMP JUMPDEST PUSH1 0xE0 DUP4 ADD MSTORE POP PUSH2 0x100 PUSH2 0x107C DUP5 DUP3 DUP6 ADD PUSH2 0x10FB JUMP JUMPDEST PUSH2 0x100 DUP4 ADD MSTORE POP PUSH2 0x120 PUSH2 0x1092 DUP5 DUP3 DUP6 ADD PUSH2 0x10FB JUMP JUMPDEST PUSH2 0x120 DUP4 ADD MSTORE POP PUSH2 0x140 DUP3 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x10B4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x10C0 DUP5 DUP3 DUP6 ADD PUSH2 0xF11 JUMP JUMPDEST PUSH2 0x140 DUP4 ADD MSTORE POP PUSH2 0x160 DUP3 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x10E2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x10EE DUP5 DUP3 DUP6 ADD PUSH2 0xF11 JUMP JUMPDEST PUSH2 0x160 DUP4 ADD MSTORE POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0xC7E DUP3 CALLDATALOAD PUSH2 0x19F2 JUMP JUMPDEST PUSH1 0x0 PUSH2 0xC7E DUP3 MLOAD PUSH2 0x1A1A JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x1125 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1131 DUP5 DUP5 PUSH2 0xD42 JUMP JUMPDEST SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x114C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1158 DUP6 DUP6 PUSH2 0xD36 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 DUP4 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1175 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1181 DUP6 DUP3 DUP7 ADD PUSH2 0xDCD JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x119E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x11AA DUP6 DUP6 PUSH2 0xD36 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 DUP4 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x11C7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1181 DUP6 DUP3 DUP7 ADD PUSH2 0xF11 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x11E6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x11F2 DUP6 DUP6 PUSH2 0xD36 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0x1181 DUP6 DUP3 DUP7 ADD PUSH2 0x10FB JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x1215 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 MLOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x122C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1131 DUP5 DUP3 DUP6 ADD PUSH2 0xE2A JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x124B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1262 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x126E DUP6 DUP3 DUP7 ADD PUSH2 0xE9C JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 DUP4 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x128B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1181 DUP6 DUP3 DUP7 ADD PUSH2 0xD4E JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x12A9 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1131 DUP5 DUP5 PUSH2 0xEF9 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x60 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x12C7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1131 DUP5 DUP5 PUSH2 0xF57 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x12E6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x12FD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1309 DUP6 DUP3 DUP7 ADD PUSH2 0xFB2 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0x1181 DUP6 DUP3 DUP7 ADD PUSH2 0xD36 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x132C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1131 DUP5 DUP5 PUSH2 0xF05 JUMP JUMPDEST PUSH2 0x1341 DUP2 PUSH2 0x19D9 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x1352 DUP3 PUSH2 0x19D5 JUMP JUMPDEST DUP1 DUP5 MSTORE PUSH1 0x20 DUP5 ADD SWAP4 POP PUSH2 0x1364 DUP4 PUSH2 0x19CF JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP3 DUP2 LT ISZERO PUSH2 0x1394 JUMPI PUSH2 0x137A DUP7 DUP4 MLOAD PUSH2 0x1619 JUMP JUMPDEST PUSH2 0x1383 DUP3 PUSH2 0x19CF JUMP JUMPDEST PUSH1 0x60 SWAP7 SWAP1 SWAP7 ADD SWAP6 SWAP2 POP PUSH1 0x1 ADD PUSH2 0x1367 JUMP JUMPDEST POP SWAP4 SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x13A9 DUP3 PUSH2 0x19D5 JUMP JUMPDEST DUP1 DUP5 MSTORE PUSH1 0x20 DUP5 ADD SWAP4 POP DUP4 PUSH1 0x20 DUP3 MUL DUP6 ADD PUSH2 0x13C2 DUP6 PUSH2 0x19CF JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP5 DUP2 LT ISZERO PUSH2 0x13F9 JUMPI DUP4 DUP4 SUB DUP9 MSTORE PUSH2 0x13DD DUP4 DUP4 MLOAD PUSH2 0x1656 JUMP JUMPDEST SWAP3 POP PUSH2 0x13E8 DUP3 PUSH2 0x19CF JUMP JUMPDEST PUSH1 0x20 SWAP9 SWAP1 SWAP9 ADD SWAP8 SWAP2 POP PUSH1 0x1 ADD PUSH2 0x13C5 JUMP JUMPDEST POP SWAP1 SWAP7 SWAP6 POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x1410 DUP3 PUSH2 0x19D5 JUMP JUMPDEST DUP1 DUP5 MSTORE PUSH1 0x20 DUP5 ADD SWAP4 POP PUSH2 0x1422 DUP4 PUSH2 0x19CF JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP3 DUP2 LT ISZERO PUSH2 0x1394 JUMPI PUSH2 0x1438 DUP7 DUP4 MLOAD PUSH2 0x1759 JUMP JUMPDEST PUSH2 0x1441 DUP3 PUSH2 0x19CF JUMP JUMPDEST PUSH2 0x100 SWAP7 SWAP1 SWAP7 ADD SWAP6 SWAP2 POP PUSH1 0x1 ADD PUSH2 0x1425 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x145E DUP3 PUSH2 0x19D5 JUMP JUMPDEST DUP1 DUP5 MSTORE PUSH1 0x20 DUP5 ADD SWAP4 POP PUSH2 0x1470 DUP4 PUSH2 0x19CF JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP3 DUP2 LT ISZERO PUSH2 0x1394 JUMPI PUSH2 0x1486 DUP7 DUP4 MLOAD PUSH2 0x14A0 JUMP JUMPDEST PUSH2 0x148F DUP3 PUSH2 0x19CF JUMP JUMPDEST PUSH1 0x20 SWAP7 SWAP1 SWAP7 ADD SWAP6 SWAP2 POP PUSH1 0x1 ADD PUSH2 0x1473 JUMP JUMPDEST PUSH2 0x1341 DUP2 PUSH2 0x19F2 JUMP JUMPDEST PUSH2 0x1341 DUP2 PUSH2 0x19F5 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x14BD DUP3 PUSH2 0x19D5 JUMP JUMPDEST DUP1 DUP5 MSTORE PUSH2 0x14D1 DUP2 PUSH1 0x20 DUP7 ADD PUSH1 0x20 DUP7 ADD PUSH2 0x1A31 JUMP JUMPDEST PUSH2 0x14DA DUP2 PUSH2 0x1A5D JUMP JUMPDEST SWAP1 SWAP4 ADD PUSH1 0x20 ADD SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x26 DUP2 MSTORE PUSH32 0x475245415445525F4F525F455155414C5F544F5F33325F4C454E4754485F5245 PUSH1 0x20 DUP3 ADD MSTORE PUSH32 0x5155495245440000000000000000000000000000000000000000000000000000 PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x60 ADD SWAP1 JUMP JUMPDEST PUSH1 0x17 DUP2 MSTORE PUSH32 0x554E535550504F525445445F41535345545F50524F5859000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x26 DUP2 MSTORE PUSH32 0x475245415445525F4F525F455155414C5F544F5F32305F4C454E4754485F5245 PUSH1 0x20 DUP3 ADD MSTORE PUSH32 0x5155495245440000000000000000000000000000000000000000000000000000 PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x60 ADD SWAP1 JUMP JUMPDEST PUSH1 0x25 DUP2 MSTORE PUSH32 0x475245415445525F4F525F455155414C5F544F5F345F4C454E4754485F524551 PUSH1 0x20 DUP3 ADD MSTORE PUSH32 0x5549524544000000000000000000000000000000000000000000000000000000 PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x60 ADD SWAP1 JUMP JUMPDEST DUP1 MLOAD PUSH1 0x60 DUP4 ADD SWAP1 PUSH2 0x162A DUP5 DUP3 PUSH2 0x17F0 JUMP JUMPDEST POP PUSH1 0x20 DUP3 ADD MLOAD PUSH2 0x163D PUSH1 0x20 DUP6 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH1 0x40 DUP3 ADD MLOAD PUSH2 0x1650 PUSH1 0x40 DUP6 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP POP POP POP JUMP JUMPDEST DUP1 MLOAD PUSH1 0x0 SWAP1 PUSH2 0x180 DUP5 ADD SWAP1 PUSH2 0x166B DUP6 DUP3 PUSH2 0x1338 JUMP JUMPDEST POP PUSH1 0x20 DUP4 ADD MLOAD PUSH2 0x167E PUSH1 0x20 DUP7 ADD DUP3 PUSH2 0x1338 JUMP JUMPDEST POP PUSH1 0x40 DUP4 ADD MLOAD PUSH2 0x1691 PUSH1 0x40 DUP7 ADD DUP3 PUSH2 0x1338 JUMP JUMPDEST POP PUSH1 0x60 DUP4 ADD MLOAD PUSH2 0x16A4 PUSH1 0x60 DUP7 ADD DUP3 PUSH2 0x1338 JUMP JUMPDEST POP PUSH1 0x80 DUP4 ADD MLOAD PUSH2 0x16B7 PUSH1 0x80 DUP7 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH1 0xA0 DUP4 ADD MLOAD PUSH2 0x16CA PUSH1 0xA0 DUP7 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH1 0xC0 DUP4 ADD MLOAD PUSH2 0x16DD PUSH1 0xC0 DUP7 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH1 0xE0 DUP4 ADD MLOAD PUSH2 0x16F0 PUSH1 0xE0 DUP7 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH2 0x100 DUP4 ADD MLOAD PUSH2 0x1705 PUSH2 0x100 DUP7 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH2 0x120 DUP4 ADD MLOAD PUSH2 0x171A PUSH2 0x120 DUP7 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH2 0x140 DUP4 ADD MLOAD DUP5 DUP3 SUB PUSH2 0x140 DUP7 ADD MSTORE PUSH2 0x1734 DUP3 DUP3 PUSH2 0x14B2 JUMP JUMPDEST SWAP2 POP POP PUSH2 0x160 DUP4 ADD MLOAD DUP5 DUP3 SUB PUSH2 0x160 DUP7 ADD MSTORE PUSH2 0x1750 DUP3 DUP3 PUSH2 0x14B2 JUMP JUMPDEST SWAP6 SWAP5 POP POP POP POP POP JUMP JUMPDEST DUP1 MLOAD PUSH2 0x100 DUP4 ADD SWAP1 PUSH2 0x176B DUP5 DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH1 0x20 DUP3 ADD MLOAD PUSH2 0x177E PUSH1 0x20 DUP6 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH1 0x40 DUP3 ADD MLOAD PUSH2 0x1791 PUSH1 0x40 DUP6 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH1 0x60 DUP3 ADD MLOAD PUSH2 0x17A4 PUSH1 0x60 DUP6 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH1 0x80 DUP3 ADD MLOAD PUSH2 0x17B7 PUSH1 0x80 DUP6 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH1 0xA0 DUP3 ADD MLOAD PUSH2 0x17CA PUSH1 0xA0 DUP6 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH1 0xC0 DUP3 ADD MLOAD PUSH2 0x17DD PUSH1 0xC0 DUP6 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST POP PUSH1 0xE0 DUP3 ADD MLOAD PUSH2 0x1650 PUSH1 0xE0 DUP6 ADD DUP3 PUSH2 0x14A0 JUMP JUMPDEST PUSH2 0x1341 DUP2 PUSH2 0x1A1A JUMP JUMPDEST PUSH1 0x20 DUP2 ADD PUSH2 0x9A3 DUP3 DUP5 PUSH2 0x1338 JUMP JUMPDEST PUSH1 0x40 DUP2 ADD PUSH2 0x1815 DUP3 DUP6 PUSH2 0x1338 JUMP JUMPDEST PUSH2 0xC7E PUSH1 0x20 DUP4 ADD DUP5 PUSH2 0x1338 JUMP JUMPDEST PUSH1 0x40 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x1833 DUP2 DUP6 PUSH2 0x1347 JUMP JUMPDEST SWAP1 POP DUP2 DUP2 SUB PUSH1 0x20 DUP4 ADD MSTORE PUSH2 0x1131 DUP2 DUP5 PUSH2 0x1405 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0xC7E DUP2 DUP5 PUSH2 0x139E JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0xC7E DUP2 DUP5 PUSH2 0x1405 JUMP JUMPDEST PUSH1 0x40 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x187A DUP2 DUP6 PUSH2 0x1453 JUMP JUMPDEST SWAP1 POP DUP2 DUP2 SUB PUSH1 0x20 DUP4 ADD MSTORE PUSH2 0x1131 DUP2 DUP5 PUSH2 0x1453 JUMP JUMPDEST PUSH1 0x20 DUP2 ADD PUSH2 0x9A3 DUP3 DUP5 PUSH2 0x14A9 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x9A3 DUP2 PUSH2 0x14E7 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x9A3 DUP2 PUSH2 0x153D JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x9A3 DUP2 PUSH2 0x156D JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0x9A3 DUP2 PUSH2 0x15C3 JUMP JUMPDEST PUSH2 0x160 DUP2 ADD PUSH2 0x18EB DUP3 DUP6 PUSH2 0x1619 JUMP JUMPDEST PUSH2 0xC7E PUSH1 0x60 DUP4 ADD DUP5 PUSH2 0x1759 JUMP JUMPDEST PUSH1 0x20 DUP1 DUP3 MSTORE DUP2 ADD PUSH2 0xC7E DUP2 DUP5 PUSH2 0x1656 JUMP JUMPDEST PUSH2 0x100 DUP2 ADD PUSH2 0x9A3 DUP3 DUP5 PUSH2 0x1759 JUMP JUMPDEST PUSH1 0x20 DUP2 ADD PUSH2 0x9A3 DUP3 DUP5 PUSH2 0x14A0 JUMP JUMPDEST PUSH1 0x40 DUP2 ADD PUSH2 0x1934 DUP3 DUP6 PUSH2 0x14A0 JUMP JUMPDEST PUSH2 0xC7E PUSH1 0x20 DUP4 ADD DUP5 PUSH2 0x14A0 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP2 DUP2 ADD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT DUP3 DUP3 LT OR ISZERO PUSH2 0x1960 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x40 MSTORE SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH8 0xFFFFFFFFFFFFFFFF DUP3 GT ISZERO PUSH2 0x197F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x20 SWAP1 DUP2 MUL ADD SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH8 0xFFFFFFFFFFFFFFFF DUP3 GT ISZERO PUSH2 0x19A0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x20 PUSH1 0x1F SWAP2 SWAP1 SWAP2 ADD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 AND ADD SWAP1 JUMP JUMPDEST PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST MLOAD SWAP1 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 JUMP JUMPDEST SWAP1 JUMP JUMPDEST PUSH32 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 AND SWAP1 JUMP JUMPDEST PUSH1 0xFF AND SWAP1 JUMP JUMPDEST ISZERO ISZERO SWAP1 JUMP JUMPDEST DUP3 DUP2 DUP4 CALLDATACOPY POP PUSH1 0x0 SWAP2 ADD MSTORE JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x1A4C JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH2 0x1A34 JUMP JUMPDEST DUP4 DUP2 GT ISZERO PUSH2 0x1650 JUMPI POP POP PUSH1 0x0 SWAP2 ADD MSTORE JUMP JUMPDEST PUSH1 0x1F ADD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 AND SWAP1 JUMP STOP LOG2 PUSH6 0x627A7A723058 KECCAK256 0xd2 0xe9 PUSH31 0x29F930427E8936D11AF9A8EE1660886400D9687ABB10C976177F33449C6C65 PUSH25 0x706572696D656E74616CF50037000000000000000000000000 ",
- "sourceMap": "898:8536:11:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2336:352;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2336:352:11;;;;;;;;;;;;;;;;;;;;;;;;;;5614:1359;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;5614:1359:11;;;;;;;;;;;;;;;;;;3018:384;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;3018:384:11;;;;;;;;;;;;;;;;;;4716:452;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;4716:452:11;;;;;;;;;;;;;;;;;8218:1214;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;8218:1214:11;;;;;;;;;;;;;;;;;7416:517;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;7416:517:11;;;;;;;;;;;;;;;;;;3661:739;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;3661:739:11;;;;;;;;;;;;;;;;;2336:352;2463:35;;:::i;:::-;2500:28;;:::i;:::-;2556:8;;:28;;;;;:8;;;;;:21;;:28;;2578:5;;2556:28;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2556:28:11;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2556:28:11;;;;;;;101:4:-1;97:9;90:4;84;80:15;76:31;69:5;65:43;126:6;120:4;113:20;0:138;2556:28:11;;;;;;;;;2544:40;;2607:34;2621:5;2628:12;2607:13;:34::i;:::-;2594:47;-1:-1:-1;2336:352:11;;;;;:::o;5614:1359::-;5731:15;;;;;;;;5803:23;:9;5731:15;5803:23;:20;:23;:::i;:::-;5781:45;-1:-1:-1;5852:25:11;:9;5874:2;5852:25;:21;:25;:::i;:::-;5908:8;;:36;;;;;5836:41;;-1:-1:-1;5908:8:11;;;:22;;:36;;5931:12;;5908:36;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;5908:36:11;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;5908:36:11;;;;;;;101:4:-1;97:9;90:4;84;80:15;76:31;69:5;65:43;126:6;120:4;113:20;0:138;5908:36:11;;;;;;;;;1008:32;;;;;;;;;;;;;;;;5887:57;;-1:-1:-1;5959:29:11;;;;;;;5955:975;;;6043:36;;;;;:28;;;;;;:36;;6072:6;;6043:36;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;6043:36:11;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;6043:36:11;;;;;;;101:4:-1;97:9;90:4;84;80:15;76:31;69:5;65:43;126:6;120:4;113:20;0:138;6043:36:11;;;;;;;;;6137:48;;;;;6033:46;;-1:-1:-1;6137:28:11;;;;;;:48;;6166:6;;6174:10;;6137:48;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;6137:48:11;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;6137:48:11;;;;;;;101:4:-1;97:9;90:4;84;80:15;76:31;69:5;65:43;126:6;120:4;113:20;0:138;6137:48:11;;;;;;;;;6125:60;;5955:975;;;1096:41;;;;;;;;;;;;;;;;6206:30;;;;;;;6202:728;;;6270:25;:9;6292:2;6270:25;:21;:25;:::i;:::-;6252:43;;6364:35;6384:5;6391:7;6364:19;:35::i;:::-;6348:51;;6496:5;6486:15;;:6;:15;;;:23;;6508:1;6486:23;;;6504:1;6486:23;6476:33;;;;6620:5;6607:36;;;6644:6;6652:10;6607:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;6607:56:11;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;6607:56:11;;;;;;;101:4:-1;97:9;90:4;84;80:15;76:31;69:5;65:43;126:6;120:4;113:20;0:138;6607:56:11;;;;;;;;;:114;;;;6711:10;6667:54;;6680:5;6667:31;;;6699:7;6667:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;6667:40:11;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;6667:40:11;;;;;;;101:4:-1;97:9;90:4;84;80:15;76:31;69:5;65:43;126:6;120:4;113:20;0:138;6667:40:11;;;;;;;;;:54;;;6607:114;6589:132;;6837:10;:18;;6854:1;6837:18;;;6850:1;6837:18;6825:30;;;;6202:728;;;6886:33;;;;;;;;;;;;;;;;;;;6202:728;5614:1359;;;;;;;;;;;:::o;3018:384::-;3261:8;;:30;;;;;3161:38;;;;3261:8;;;;;:22;;:30;;3284:6;;3261:30;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3261:30:11;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3261:30:11;;;;;;39:16:-1;36:1;17:17;2:54;101:4;3261:30:11;80:15:-1;;;97:9;76:31;65:43;;120:4;113:20;3261:30:11;;;;;;;;;3248:43;;3315:38;3330:6;3338:14;4716:452;4850:12;4885:20;4931:31;5010:9;4908:6;:13;4885:36;;4982:12;4965:30;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;4931:64;;5022:1;5010:13;;5005:129;5025:17;;;5005:129;;5080:43;5094:6;5101:1;5094:9;;;;;;;;;;;;;;;;;;5105:14;5120:1;5105:17;;;;;;;;;;;;;;;;;;5080:13;:43::i;:::-;5063:11;5075:1;5063:14;;;;;;;;;;;;;;;;;;:60;5044:3;;5005:129;;;5150:11;5143:18;;4716:452;;;;;;;;:::o;8218:1214::-;8324:13;8437:2;8431:9;8534:66;8525:7;8518:83;8638:7;8634:1;8625:7;8621:15;8614:32;9060:2;9007:7;8950:2;8903:7;8854:5;8809:3;8781:332;9240:7;9237:2;;;9281:7;9275:14;9266:23;;9237:2;-1:-1:-1;;8218:1214:11;;;;;:::o;7416:517::-;7537:9;7555;7587:14;7630:25;7689:27;7755:9;7604;:16;7587:33;;7672:6;7658:21;;;;;;;;;;;;;;;;;;;;;;29:2:-1;21:6;17:15;117:4;105:10;97:6;88:34;136:17;;-1:-1;7658:21:11;;7630:49;;7733:6;7719:21;;;;;;;;;;;;;;;;;;;;;;29:2:-1;21:6;17:15;117:4;105:10;97:6;88:34;136:17;;-1:-1;7719:21:11;;7689:51;;7767:1;7755:13;;7750:138;7770:11;;;7750:138;;7833:44;7856:6;7864:9;7874:1;7864:12;;;;;;;;;;;;;;;;;;7833:22;:44::i;:::-;7803:8;7812:1;7803:11;;;;;;;;;;;;;;;;;7816:10;7827:1;7816:13;;;;;;;;;;;;;;;;;;7802:75;;;;;7783:3;;7750:138;;;-1:-1:-1;7905:8:11;;7915:10;;-1:-1:-1;7416:517:11;-1:-1:-1;;;;7416:517:11:o;3661:739::-;3780:28;;:::i;:::-;4076:25;3879:64;3902:5;:18;;;3922:5;:20;;;3879:22;:64::i;:::-;3850:25;;;3824:119;;;4045:20;;;;4008:58;;4031:12;;4008:22;:58::i;:::-;3979:25;;;3953:113;3954:23;;;;3953:113;;;;4104:14;4076:42;;;;-1:-1:-1;4076:42:11;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4104:14;4076:42;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4189:56;4212:5;:18;;;4232:12;4189:22;:56::i;:::-;4157:28;;;4128:117;4129:26;;;4128:117;4316:50;4339:12;4353;4316:22;:50::i;:::-;4284:28;;;4255:111;4256:26;;;4255:111;3661:739;;;;;:::o;15593:687:53:-;15713:13;15775:5;15783:1;15775:9;15763:1;:8;:21;;15742:105;;;;;;;;;;;;;;;;-1:-1:-1;16021:13:53;15924:2;16021:13;16015:20;16174:66;16162:79;;15593:687::o;10268:886::-;10389:14;10452:5;10460:2;10452:10;10440:1;:8;:22;;10419:135;;;;;;;;;;;;;;;;-1:-1:-1;11056:13:53;10801:2;11056:13;11050:20;11072:42;11046:69;;10268:886::o;14708:220::-;14829:14;14876:21;14888:1;14891:5;14876:11;:21::i;:::-;14868:30;14708:220;-1:-1:-1;;;14708:220:53:o;13290:490::-;13411:14;13474:5;13482:2;13474:10;13462:1;:8;:22;;13441:107;;;;;;;;;;;;;;;;-1:-1:-1;13727:13:53;13629:2;13727:13;13721:20;;13290:490::o;898:8536:11:-;;;;;;;;;-1:-1:-1;898:8536:11;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;5:118:-1:-;;72:46;110:6;97:20;72:46;;130:122;;208:39;239:6;233:13;208:39;;277:707;;387:4;375:17;;371:27;-1:-1;361:2;;412:1;409;402:12;361:2;449:6;436:20;471:80;486:64;543:6;486:64;;;471:80;;;462:89;;568:5;593:6;586:5;579:21;623:4;615:6;611:17;601:27;;645:4;640:3;636:14;629:21;;698:6;745:3;737:4;729:6;725:17;720:3;716:27;713:36;710:2;;;762:1;759;752:12;710:2;787:1;772:206;797:6;794:1;791:13;772:206;;;855:3;877:37;910:3;898:10;877:37;;;865:50;;-1:-1;938:4;929:14;;;;957;;;;;819:1;812:9;772:206;;;776:14;354:630;;;;;;;;1008:693;;1123:4;1111:17;;1107:27;-1:-1;1097:2;;1148:1;1145;1138:12;1097:2;1185:6;1172:20;1207:85;1222:69;1284:6;1222:69;;1207:85;1320:21;;;1364:4;1352:17;;;;1198:94;;-1:-1;1377:14;;1352:17;1472:1;1457:238;1482:6;1479:1;1476:13;1457:238;;;1565:3;1552:17;1544:6;1540:30;1589:42;1627:3;1615:10;1589:42;;;1577:55;;-1:-1;1655:4;1646:14;;;;1674;;;;;1504:1;1497:9;1457:238;;1745:791;;1889:4;1877:17;;1873:27;-1:-1;1863:2;;1914:1;1911;1904:12;1863:2;1944:6;1938:13;1966:103;1981:87;2061:6;1981:87;;1966:103;1957:112;;2086:5;2111:6;2104:5;2097:21;2141:4;2133:6;2129:17;2119:27;;2163:4;2158:3;2154:14;2147:21;;2216:6;2263:3;2255:4;2247:6;2243:17;2238:3;2234:27;2231:36;2228:2;;;2280:1;2277;2270:12;2228:2;2305:1;2290:240;2315:6;2312:1;2309:13;2290:240;;;2373:3;2395:71;2462:3;2450:10;2395:71;;;2383:84;;-1:-1;2490:4;2481:14;;;;2518:4;2509:14;;;;;2337:1;2330:9;2290:240;;2576:735;;2705:4;2693:17;;2689:27;-1:-1;2679:2;;2730:1;2727;2720:12;2679:2;2767:6;2754:20;2789:99;2804:83;2880:6;2804:83;;2789:99;2916:21;;;2960:4;2948:17;;;;2780:108;;-1:-1;2973:14;;2948:17;3068:1;3053:252;3078:6;3075:1;3072:13;3053:252;;;3161:3;3148:17;3140:6;3136:30;3185:56;3237:3;3225:10;3185:56;;;3173:69;;-1:-1;3265:4;3256:14;;;;3284;;;;;3100:1;3093:9;3053:252;;3319:116;;3394:36;3422:6;3416:13;3394:36;;3442:122;;3520:39;3551:6;3545:13;3520:39;;3572:432;;3662:4;3650:17;;3646:27;-1:-1;3636:2;;3687:1;3684;3677:12;3636:2;3724:6;3711:20;3746:60;3761:44;3798:6;3761:44;;3746:60;3737:69;;3826:6;3819:5;3812:21;3862:4;3854:6;3850:17;3895:4;3888:5;3884:16;3930:3;3921:6;3916:3;3912:16;3909:25;3906:2;;;3947:1;3944;3937:12;3906:2;3957:41;3991:6;3986:3;3981;3957:41;;4493:685;;4616:4;4604:9;4599:3;4595:19;4591:30;4588:2;;;4634:1;4631;4624:12;4588:2;4652:20;4667:4;4652:20;;;4643:29;-1:-1;4729:1;4760:58;4814:3;4794:9;4760:58;;;4736:83;;-1:-1;4885:2;4918:60;4974:3;4950:22;;;4918:60;;;4911:4;4904:5;4900:16;4893:86;4840:150;5063:2;5096:60;5152:3;5143:6;5132:9;5128:22;5096:60;;;5089:4;5082:5;5078:16;5071:86;5000:168;4582:596;;;;;5941:2205;;6049:5;6037:9;6032:3;6028:19;6024:31;6021:2;;;6068:1;6065;6058:12;6021:2;6086:21;6101:5;6086:21;;;6077:30;-1:-1;6165:1;6196:49;6241:3;6221:9;6196:49;;;6172:74;;-1:-1;6315:2;6348:49;6393:3;6369:22;;;6348:49;;;6341:4;6334:5;6330:16;6323:75;6267:142;6474:2;6507:49;6552:3;6543:6;6532:9;6528:22;6507:49;;;6500:4;6493:5;6489:16;6482:75;6419:149;6627:2;6660:49;6705:3;6696:6;6685:9;6681:22;6660:49;;;6653:4;6646:5;6642:16;6635:75;6578:143;6783:3;6817:49;6862:3;6853:6;6842:9;6838:22;6817:49;;;6810:4;6803:5;6799:16;6792:75;6731:147;6940:3;6974:49;7019:3;7010:6;6999:9;6995:22;6974:49;;;6967:4;6960:5;6956:16;6949:75;6888:147;7089:3;7123:49;7168:3;7159:6;7148:9;7144:22;7123:49;;;7116:4;7109:5;7105:16;7098:75;7045:139;7238:3;7272:49;7317:3;7308:6;7297:9;7293:22;7272:49;;;7265:4;7258:5;7254:16;7247:75;7194:139;7400:3;7435:49;7480:3;7471:6;7460:9;7456:22;7435:49;;;7427:5;7420;7416:17;7409:76;7343:153;7546:3;7581:49;7626:3;7617:6;7606:9;7602:22;7581:49;;;7573:5;7566;7562:17;7555:76;7506:136;7730:3;7719:9;7715:19;7702:33;7755:18;7747:6;7744:30;7741:2;;;7787:1;7784;7777:12;7741:2;7823:54;7873:3;7864:6;7853:9;7849:22;7823:54;;;7815:5;7808;7804:17;7797:81;7652:237;7977:3;7966:9;7962:19;7949:33;8002:18;7994:6;7991:30;7988:2;;;8034:1;8031;8024:12;7988:2;8070:54;8120:3;8111:6;8100:9;8096:22;8070:54;;;8062:5;8055;8051:17;8044:81;7899:237;6015:2131;;;;;10397:118;;10464:46;10502:6;10489:20;10464:46;;10651:118;;10727:37;10756:6;10750:13;10727:37;;10776:263;;10891:2;10879:9;10870:7;10866:23;10862:32;10859:2;;;10907:1;10904;10897:12;10859:2;10942:1;10959:64;11015:7;10995:9;10959:64;;;10949:74;10853:186;-1:-1;;;;10853:186;11046:512;;;11197:2;11185:9;11176:7;11172:23;11168:32;11165:2;;;11213:1;11210;11203:12;11165:2;11248:1;11265:53;11310:7;11290:9;11265:53;;;11255:63;;11227:97;11383:2;11372:9;11368:18;11355:32;11407:18;11399:6;11396:30;11393:2;;;11439:1;11436;11429:12;11393:2;11459:83;11534:7;11525:6;11514:9;11510:22;11459:83;;;11449:93;;11334:214;11159:399;;;;;;11565:470;;;11695:2;11683:9;11674:7;11670:23;11666:32;11663:2;;;11711:1;11708;11701:12;11663:2;11746:1;11763:53;11808:7;11788:9;11763:53;;;11753:63;;11725:97;11881:2;11870:9;11866:18;11853:32;11905:18;11897:6;11894:30;11891:2;;;11937:1;11934;11927:12;11891:2;11957:62;12011:7;12002:6;11991:9;11987:22;11957:62;;12042:366;;;12163:2;12151:9;12142:7;12138:23;12134:32;12131:2;;;12179:1;12176;12169:12;12131:2;12214:1;12231:53;12276:7;12256:9;12231:53;;;12221:63;;12193:97;12321:2;12339:53;12384:7;12375:6;12364:9;12360:22;12339:53;;12415:438;;12578:2;12566:9;12557:7;12553:23;12549:32;12546:2;;;12594:1;12591;12584:12;12546:2;12629:24;;12673:18;12662:30;;12659:2;;;12705:1;12702;12695:12;12659:2;12725:112;12829:7;12820:6;12809:9;12805:22;12725:112;;12860:676;;;13050:2;13038:9;13029:7;13025:23;13021:32;13018:2;;;13066:1;13063;13056:12;13018:2;13101:31;;13152:18;13141:30;;13138:2;;;13184:1;13181;13174:12;13138:2;13204:97;13293:7;13284:6;13273:9;13269:22;13204:97;;;13194:107;;13080:227;13366:2;13355:9;13351:18;13338:32;13390:18;13382:6;13379:30;13376:2;;;13422:1;13419;13412:12;13376:2;13442:78;13512:7;13503:6;13492:9;13488:22;13442:78;;13543:257;;13655:2;13643:9;13634:7;13630:23;13626:32;13623:2;;;13671:1;13668;13661:12;13623:2;13706:1;13723:61;13776:7;13756:9;13723:61;;13807:317;;13949:2;13937:9;13928:7;13924:23;13920:32;13917:2;;;13965:1;13962;13955:12;13917:2;14000:1;14017:91;14100:7;14080:9;14017:91;;14131:498;;;14275:2;14263:9;14254:7;14250:23;14246:32;14243:2;;;14291:1;14288;14281:12;14243:2;14326:31;;14377:18;14366:30;;14363:2;;;14409:1;14406;14399:12;14363:2;14429:76;14497:7;14488:6;14477:9;14473:22;14429:76;;;14419:86;;14305:206;14542:2;14560:53;14605:7;14596:6;14585:9;14581:22;14560:53;;14636:263;;14751:2;14739:9;14730:7;14726:23;14722:32;14719:2;;;14767:1;14764;14757:12;14719:2;14802:1;14819:64;14875:7;14855:9;14819:64;;14906:110;14979:31;15004:5;14979:31;;;14974:3;14967:44;14961:55;;;15090:755;;15271:77;15342:5;15271:77;;;15366:6;15361:3;15354:19;15390:4;15385:3;15381:14;15374:21;;15435:79;15508:5;15435:79;;;15535:1;15520:303;15545:6;15542:1;15539:13;15520:303;;;15585:103;15684:3;15675:6;15669:13;15585:103;;;15705:83;15781:6;15705:83;;;15811:4;15802:14;;;;;15695:93;-1:-1;15567:1;15560:9;15520:303;;;-1:-1;15836:3;;15250:595;-1:-1;;;;15250:595;15912:864;;16085:73;16152:5;16085:73;;;16176:6;16171:3;16164:19;16200:4;16195:3;16191:14;16184:21;;16248:3;16290:4;16282:6;16278:17;16273:3;16269:27;16316:75;16385:5;16316:75;;;16412:1;16397:340;16422:6;16419:1;16416:13;16397:340;;;16484:9;16478:4;16474:20;16469:3;16462:33;16510:96;16601:4;16592:6;16586:13;16510:96;;;16502:104;;16623:79;16695:6;16623:79;;;16725:4;16716:14;;;;;16613:89;-1:-1;16444:1;16437:9;16397:340;;;-1:-1;16750:4;;16064:712;-1:-1;;;;;;16064:712;16865:749;;17044:76;17114:5;17044:76;;;17138:6;17133:3;17126:19;17162:4;17157:3;17153:14;17146:21;;17207:78;17279:5;17207:78;;;17306:1;17291:301;17316:6;17313:1;17310:13;17291:301;;;17356:101;17453:3;17444:6;17438:13;17356:101;;;17474:82;17549:6;17474:82;;;17579:5;17570:15;;;;;17464:92;-1:-1;17338:1;17331:9;17291:301;;17653:590;;17788:54;17836:5;17788:54;;;17860:6;17855:3;17848:19;17884:4;17879:3;17875:14;17868:21;;17929:56;17979:5;17929:56;;;18006:1;17991:230;18016:6;18013:1;18010:13;17991:230;;;18056:53;18105:3;18096:6;18090:13;18056:53;;;18126:60;18179:6;18126:60;;;18209:4;18200:14;;;;;18116:70;-1:-1;18038:1;18031:9;17991:230;;18251:110;18324:31;18349:5;18324:31;;18368:107;18439:30;18463:5;18439:30;;18482:289;;18578:34;18606:5;18578:34;;;18629:6;18624:3;18617:19;18641:63;18697:6;18690:4;18685:3;18681:14;18674:4;18667:5;18663:16;18641:63;;;18736:29;18758:6;18736:29;;;18716:50;;;18729:4;18716:50;;18558:213;-1:-1;;;18558:213;18779:397;18934:2;18922:15;;18971:66;18966:2;18957:12;;18950:88;19072:66;19067:2;19058:12;;19051:88;19167:2;19158:12;;18915:261;19185:296;19340:2;19328:15;;19377:66;19372:2;19363:12;;19356:88;19472:2;19463:12;;19321:160;19490:397;19645:2;19633:15;;19682:66;19677:2;19668:12;;19661:88;19783:66;19778:2;19769:12;;19762:88;19878:2;19869:12;;19626:261;19896:397;20051:2;20039:15;;20088:66;20083:2;20074:12;;20067:88;20189:66;20184:2;20175:12;;20168:88;20284:2;20275:12;;20032:261;20362:695;20575:22;;20499:4;20490:14;;;20609:57;20494:3;20575:22;20609:57;;;20519:159;20759:4;20752:5;20748:16;20742:23;20777:62;20833:4;20828:3;20824:14;20811:11;20777:62;;;20688:163;20950:4;20943:5;20939:16;20933:23;20968:62;21024:4;21019:3;21015:14;21002:11;20968:62;;;20861:181;20472:585;;;;21876:2419;22091:22;;21876:2419;;22013:5;22004:15;;;22125:61;22008:3;22091:22;22125:61;;;22034:164;22282:4;22275:5;22271:16;22265:23;22300:62;22356:4;22351:3;22347:14;22334:11;22300:62;;;22208:166;22465:4;22458:5;22454:16;22448:23;22483:62;22539:4;22534:3;22530:14;22517:11;22483:62;;;22384:173;22642:4;22635:5;22631:16;22625:23;22660:62;22716:4;22711:3;22707:14;22694:11;22660:62;;;22567:167;22822:4;22815:5;22811:16;22805:23;22840:62;22896:4;22891:3;22887:14;22874:11;22840:62;;;22744:170;23002:4;22995:5;22991:16;22985:23;23020:62;23076:4;23071:3;23067:14;23054:11;23020:62;;;22924:170;23174:4;23167:5;23163:16;23157:23;23192:62;23248:4;23243:3;23239:14;23226:11;23192:62;;;23104:162;23346:4;23339:5;23335:16;23329:23;23364:62;23420:4;23415:3;23411:14;23398:11;23364:62;;;23276:162;23531:5;23524;23520:17;23514:24;23550:63;23606:5;23601:3;23597:15;23584:11;23550:63;;;23448:177;23701:5;23694;23690:17;23684:24;23720:63;23776:5;23771:3;23767:15;23754:11;23720:63;;;23635:160;23881:5;23874;23870:17;23864:24;23934:3;23928:4;23924:14;23916:5;23911:3;23907:15;23900:39;23954:66;24015:4;24002:11;23954:66;;;23946:74;;23805:227;24118:5;24111;24107:17;24101:24;24171:3;24165:4;24161:14;24153:5;24148:3;24144:15;24137:39;24191:66;24252:4;24239:11;24191:66;;;24183:74;21986:2309;-1:-1;;;;;21986:2309;26852:1587;27065:22;;26987:5;26978:15;;;27099:61;26982:3;27065:22;27099:61;;;27008:164;27258:4;27251:5;27247:16;27241:23;27276:62;27332:4;27327:3;27323:14;27310:11;27276:62;;;27182:168;27434:4;27427:5;27423:16;27417:23;27452:62;27508:4;27503:3;27499:14;27486:11;27452:62;;;27360:166;27612:4;27605:5;27601:16;27595:23;27630:62;27686:4;27681:3;27677:14;27664:11;27630:62;;;27536:168;27791:4;27784:5;27780:16;27774:23;27809:62;27865:4;27860:3;27856:14;27843:11;27809:62;;;27714:169;27972:4;27965:5;27961:16;27955:23;27990:62;28046:4;28041:3;28037:14;28024:11;27990:62;;;27893:171;28151:4;28144:5;28140:16;28134:23;28169:62;28225:4;28220:3;28216:14;28203:11;28169:62;;;28074:169;28332:4;28325:5;28321:16;28315:23;28350:62;28406:4;28401:3;28397:14;28384:11;28350:62;;30228:104;30297:29;30320:5;30297:29;;30339:193;30447:2;30432:18;;30461:61;30436:9;30495:6;30461:61;;30539:294;30675:2;30660:18;;30689:61;30664:9;30723:6;30689:61;;;30761:62;30819:2;30808:9;30804:18;30795:6;30761:62;;30840:770;31166:2;31180:47;;;31151:18;;31241:144;31151:18;31371:6;31241:144;;;31233:152;;31433:9;31427:4;31423:20;31418:2;31407:9;31403:18;31396:48;31458:142;31595:4;31586:6;31458:142;;31617:417;31813:2;31827:47;;;31798:18;;31888:136;31798:18;32010:6;31888:136;;32041:429;32243:2;32257:47;;;32228:18;;32318:142;32228:18;32446:6;32318:142;;32477:590;32713:2;32727:47;;;32698:18;;32788:98;32698:18;32872:6;32788:98;;;32780:106;;32934:9;32928:4;32924:20;32919:2;32908:9;32904:18;32897:48;32959:98;33052:4;33043:6;32959:98;;33074:189;33180:2;33165:18;;33194:59;33169:9;33226:6;33194:59;;33270:387;33451:2;33465:47;;;33436:18;;33526:121;33436:18;33526:121;;33664:387;33845:2;33859:47;;;33830:18;;33920:121;33830:18;33920:121;;34058:387;34239:2;34253:47;;;34224:18;;34314:121;34224:18;34314:121;;34452:387;34633:2;34647:47;;;34618:18;;34708:121;34618:18;34708:121;;34846:507;35088:3;35073:19;;35103:115;35077:9;35191:6;35103:115;;;35229:114;35339:2;35328:9;35324:18;35315:6;35229:114;;35360:333;35514:2;35528:47;;;35499:18;;35589:94;35499:18;35669:6;35589:94;;35700:298;35860:3;35845:19;;35875:113;35849:9;35961:6;35875:113;;36005:193;36113:2;36098:18;;36127:61;36102:9;36161:6;36127:61;;36205:294;36341:2;36326:18;;36355:61;36330:9;36389:6;36355:61;;;36427:62;36485:2;36474:9;36470:18;36461:6;36427:62;;36506:256;36568:2;36562:9;36594:17;;;36669:18;36654:34;;36690:22;;;36651:62;36648:2;;;36726:1;36723;36716:12;36648:2;36742;36735:22;36546:216;;-1:-1;36546:216;36769:258;;36928:18;36920:6;36917:30;36914:2;;;36960:1;36957;36950:12;36914:2;-1:-1;36989:4;36977:17;;;37007:15;;36851:176;37876:254;;38015:18;38007:6;38004:30;38001:2;;;38047:1;38044;38037:12;38001:2;-1:-1;38120:4;38091;38068:17;;;;38087:9;38064:33;38110:15;;37938:192;38404:144;38536:4;38524:17;;38505:43;38994:130;39107:12;;39091:33;40196:128;40276:42;40265:54;;40248:76;40331:79;40400:5;40383:27;40417:151;40496:66;40485:78;;40468:100;40661:88;40739:4;40728:16;;40711:38;40891:92;40964:13;40957:21;;40940:43;41258:145;41339:6;41334:3;41329;41316:30;-1:-1;41395:1;41377:16;;41370:27;41309:94;41412:268;41477:1;41484:101;41498:6;41495:1;41492:13;41484:101;;;41565:11;;;41559:18;41546:11;;;41539:39;41520:2;41513:10;41484:101;;;41600:6;41597:1;41594:13;41591:2;;;-1:-1;;41665:1;41647:16;;41640:27;41461:219;41688:97;41776:2;41756:14;41772:7;41752:28;;41736:49"
- }
- }
- },
- "sources": {
- "2.0.0/extensions/Forwarder/Forwarder.sol": {
- "id": 0
- },
- "2.0.0/extensions/Forwarder/MixinAssets.sol": {
- "id": 1
- },
- "2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol": {
- "id": 2
- },
- "2.0.0/extensions/Forwarder/MixinForwarderCore.sol": {
- "id": 3
- },
- "2.0.0/extensions/Forwarder/MixinWeth.sol": {
- "id": 4
- },
- "2.0.0/extensions/Forwarder/interfaces/IAssets.sol": {
- "id": 5
- },
- "2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol": {
- "id": 6
- },
- "2.0.0/extensions/Forwarder/libs/LibConstants.sol": {
- "id": 7
- },
- "2.0.0/extensions/Forwarder/mixins/MAssets.sol": {
- "id": 8
- },
- "2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol": {
- "id": 9
- },
- "2.0.0/extensions/Forwarder/mixins/MWeth.sol": {
- "id": 10
- },
- "2.0.0/extensions/OrderValidator/OrderValidator.sol": {
- "id": 11
- },
- "2.0.0/multisig/MultiSigWallet.sol": {
- "id": 12
- },
- "2.0.0/multisig/MultiSigWalletWithTimeLock.sol": {
- "id": 13
- },
- "2.0.0/protocol/AssetProxy/ERC20Proxy.sol": {
- "id": 14
- },
- "2.0.0/protocol/AssetProxy/ERC721Proxy.sol": {
- "id": 15
- },
- "2.0.0/protocol/AssetProxy/MixinAuthorizable.sol": {
- "id": 16
- },
- "2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol": {
- "id": 17
- },
- "2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol": {
- "id": 18
- },
- "2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol": {
- "id": 19
- },
- "2.0.0/protocol/AssetProxyOwner/AssetProxyOwner.sol": {
- "id": 20
- },
- "2.0.0/protocol/Exchange/Exchange.sol": {
- "id": 21
- },
- "2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol": {
- "id": 22
- },
- "2.0.0/protocol/Exchange/MixinExchangeCore.sol": {
- "id": 23
- },
- "2.0.0/protocol/Exchange/MixinMatchOrders.sol": {
- "id": 24
- },
- "2.0.0/protocol/Exchange/MixinSignatureValidator.sol": {
- "id": 25
- },
- "2.0.0/protocol/Exchange/MixinTransactions.sol": {
- "id": 26
- },
- "2.0.0/protocol/Exchange/MixinWrapperFunctions.sol": {
- "id": 27
- },
- "2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol": {
- "id": 28
- },
- "2.0.0/protocol/Exchange/interfaces/IExchange.sol": {
- "id": 29
- },
- "2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol": {
- "id": 30
- },
- "2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol": {
- "id": 31
- },
- "2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol": {
- "id": 32
- },
- "2.0.0/protocol/Exchange/interfaces/ITransactions.sol": {
- "id": 33
- },
- "2.0.0/protocol/Exchange/interfaces/IValidator.sol": {
- "id": 34
- },
- "2.0.0/protocol/Exchange/interfaces/IWallet.sol": {
- "id": 35
- },
- "2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol": {
- "id": 36
- },
- "2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol": {
- "id": 37
- },
- "2.0.0/protocol/Exchange/libs/LibConstants.sol": {
- "id": 38
- },
- "2.0.0/protocol/Exchange/libs/LibEIP712.sol": {
- "id": 39
- },
- "2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol": {
- "id": 40
- },
- "2.0.0/protocol/Exchange/libs/LibFillResults.sol": {
- "id": 41
- },
- "2.0.0/protocol/Exchange/libs/LibMath.sol": {
- "id": 42
- },
- "2.0.0/protocol/Exchange/libs/LibOrder.sol": {
- "id": 43
- },
- "2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol": {
- "id": 44
- },
- "2.0.0/protocol/Exchange/mixins/MExchangeCore.sol": {
- "id": 45
- },
- "2.0.0/protocol/Exchange/mixins/MMatchOrders.sol": {
- "id": 46
- },
- "2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol": {
- "id": 47
- },
- "2.0.0/protocol/Exchange/mixins/MTransactions.sol": {
- "id": 48
- },
- "2.0.0/protocol/Exchange/mixins/MWrapperFunctions.sol": {
- "id": 49
- },
- "2.0.0/tokens/ERC20Token/IERC20Token.sol": {
- "id": 50
- },
- "2.0.0/tokens/ERC721Token/IERC721Token.sol": {
- "id": 51
- },
- "2.0.0/tokens/EtherToken/IEtherToken.sol": {
- "id": 52
- },
- "2.0.0/utils/LibBytes/LibBytes.sol": {
- "id": 53
- },
- "2.0.0/utils/Ownable/IOwnable.sol": {
- "id": 54
- },
- "2.0.0/utils/Ownable/Ownable.sol": {
- "id": 55
- },
- "2.0.0/utils/ReentrancyGuard/ReentrancyGuard.sol": {
- "id": 56
- },
- "2.0.0/utils/SafeMath/SafeMath.sol": {
- "id": 57
- }
- },
- "sourceCodes": {
- "2.0.0/extensions/Forwarder/Forwarder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./MixinWeth.sol\";\nimport \"./MixinForwarderCore.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./MixinAssets.sol\";\nimport \"./MixinExchangeWrapper.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract Forwarder is\n LibConstants,\n MixinWeth,\n MixinAssets,\n MixinExchangeWrapper,\n MixinForwarderCore\n{\n constructor (\n address _exchange,\n bytes memory _zrxAssetData,\n bytes memory _wethAssetData\n )\n public\n LibConstants(\n _exchange,\n _zrxAssetData,\n _wethAssetData\n )\n MixinForwarderCore()\n {}\n}\n",
- "2.0.0/extensions/Forwarder/MixinAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"../../tokens/ERC20Token/IERC20Token.sol\";\nimport \"../../tokens/ERC721Token/IERC721Token.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MAssets.sol\";\n\n\ncontract MixinAssets is\n Ownable,\n LibConstants,\n MAssets\n{\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_TRANSFER_SELECTOR = bytes4(keccak256(\"transfer(address,uint256)\"));\n\n /// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to \n /// function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be\n /// used to withdraw assets that were accidentally sent to this contract.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of ERC20 token to withdraw.\n function withdrawAsset(\n bytes assetData,\n uint256 amount\n )\n external\n onlyOwner\n {\n transferAssetToSender(assetData, amount);\n }\n\n /// @dev Transfers given amount of asset to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferAssetToSender(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n bytes4 proxyId = assetData.readBytes4(0);\n\n if (proxyId == ERC20_DATA_ID) {\n transferERC20Token(assetData, amount);\n } else if (proxyId == ERC721_DATA_ID) {\n transferERC721Token(assetData, amount);\n } else {\n revert(\"UNSUPPORTED_ASSET_PROXY\");\n }\n }\n\n /// @dev Decodes ERC20 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC20Token(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n address token = assetData.readAddress(16);\n\n // Transfer tokens.\n // We do a raw call so we can check the success separate\n // from the return data.\n bool success = token.call(abi.encodeWithSelector(\n ERC20_TRANSFER_SELECTOR,\n msg.sender,\n amount\n ));\n require(\n success,\n \"TRANSFER_FAILED\"\n );\n \n // Check return data.\n // If there is no return data, we assume the token incorrectly\n // does not return a bool. In this case we expect it to revert\n // on failure, which was handled above.\n // If the token does return data, we require that it is a single\n // value that evaluates to true.\n assembly {\n if returndatasize {\n success := 0\n if eq(returndatasize, 32) {\n // First 64 bytes of memory are reserved scratch space\n returndatacopy(0, 0, 32)\n success := mload(0)\n }\n }\n }\n require(\n success,\n \"TRANSFER_FAILED\"\n );\n }\n\n /// @dev Decodes ERC721 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC721Token(\n bytes memory assetData,\n uint256 amount\n )\n internal\n {\n require(\n amount == 1,\n \"INVALID_AMOUNT\"\n );\n // Decode asset data.\n address token = assetData.readAddress(16);\n uint256 tokenId = assetData.readUint256(36);\n\n // Perform transfer.\n IERC721Token(token).transferFrom(\n address(this),\n msg.sender,\n tokenId\n );\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MExchangeWrapper.sol\";\nimport \"../../protocol/Exchange/libs/LibAbiEncoder.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../protocol/Exchange/libs/LibFillResults.sol\";\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\n\n\ncontract MixinExchangeWrapper is\n LibAbiEncoder,\n LibFillResults,\n LibMath,\n LibConstants,\n MExchangeWrapper\n{\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n // ABI encode calldata for `fillOrder`\n bytes memory fillOrderCalldata = abiEncodeFillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n\n address exchange = address(EXCHANGE);\n\n // Call `fillOrder` and handle any exceptions gracefully\n assembly {\n let success := call(\n gas, // forward all gas\n exchange, // call address of Exchange contract\n 0, // transfer 0 wei\n add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes)\n mload(fillOrderCalldata), // length of input\n fillOrderCalldata, // write output over input\n 128 // output size is 128 bytes\n )\n if success {\n mstore(fillResults, mload(fillOrderCalldata))\n mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32)))\n mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64)))\n mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96)))\n }\n }\n // fillResults values will be 0 by default if call was unsuccessful\n return fillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of WETH has been sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param wethSellAmount Desired amount of WETH to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellWeth(\n LibOrder.Order[] memory orders,\n uint256 wethSellAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // We assume that asset being sold by taker is WETH for each order.\n orders[i].makerAssetData = makerAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of WETH to sell\n uint256 remainingTakerAssetFillAmount = safeSub(wethSellAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of WETH\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= wethSellAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// The asset being sold by taker must always be WETH.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyExactAmountWithWeth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // We assume that asset being sold by taker is WETH for each order.\n orders[i].makerAssetData = makerAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n uint256 makerAssetFilledAmount = totalFillResults.makerAssetFilledAmount;\n if (makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n\n require(\n makerAssetFilledAmount >= makerAssetFillAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return totalFillResults;\n }\n\n /// @dev Buys zrxBuyAmount of ZRX fee tokens, taking into account ZRX fees for each order. This will guarantee\n /// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues).\n /// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX\n /// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases.\n /// The asset being sold by taker must always be WETH. \n /// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset.\n /// @param zrxBuyAmount Desired amount of ZRX to buy.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return totalFillResults Amounts filled and fees paid by maker and taker.\n function marketBuyExactZrxWithWeth(\n LibOrder.Order[] memory orders,\n uint256 zrxBuyAmount,\n bytes[] memory signatures\n )\n internal\n returns (FillResults memory totalFillResults)\n {\n // Do nothing if zrxBuyAmount == 0\n if (zrxBuyAmount == 0) {\n return totalFillResults;\n }\n\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n bytes memory wethAssetData = WETH_ASSET_DATA;\n uint256 zrxPurchased = 0;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // All of these are ZRX/WETH, so we can drop the respective assetData from calldata.\n orders[i].makerAssetData = zrxAssetData;\n orders[i].takerAssetData = wethAssetData;\n\n // Calculate the remaining amount of ZRX to buy.\n uint256 remainingZrxBuyAmount = safeSub(zrxBuyAmount, zrxPurchased);\n\n // Convert the remaining amount of ZRX to buy into remaining amount\n // of WETH to sell, assuming entire amount can be sold in the current order.\n uint256 remainingWethSellAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n safeSub(orders[i].makerAssetAmount, orders[i].takerFee), // our exchange rate after fees \n remainingZrxBuyAmount\n );\n\n // Attempt to sell the remaining amount of WETH.\n FillResults memory singleFillResult = fillOrderNoThrow(\n orders[i],\n safeAdd(remainingWethSellAmount, 1), // we add 1 wei to the fill amount to make up for rounding errors\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker.\n addFillResults(totalFillResults, singleFillResult);\n zrxPurchased = safeSub(totalFillResults.makerAssetFilledAmount, totalFillResults.takerFeePaid);\n\n // Stop execution if the entire amount of ZRX has been bought.\n if (zrxPurchased >= zrxBuyAmount) {\n break;\n }\n }\n\n require(\n zrxPurchased >= zrxBuyAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return totalFillResults;\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinForwarderCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MWeth.sol\";\nimport \"./mixins/MAssets.sol\";\nimport \"./mixins/MExchangeWrapper.sol\";\nimport \"./interfaces/IForwarderCore.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../protocol/Exchange/libs/LibFillResults.sol\";\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\n\n\ncontract MixinForwarderCore is\n LibFillResults,\n LibMath,\n LibConstants,\n MWeth,\n MAssets,\n MExchangeWrapper,\n IForwarderCore\n{\n using LibBytes for bytes;\n\n /// @dev Constructor approves ERC20 proxy to transfer ZRX and WETH on this contract's behalf.\n constructor ()\n public\n {\n address proxyAddress = EXCHANGE.getAssetProxy(ERC20_DATA_ID);\n require(\n proxyAddress != address(0),\n \"UNREGISTERED_ASSET_PROXY\"\n );\n ETHER_TOKEN.approve(proxyAddress, MAX_UINT);\n ZRX_TOKEN.approve(proxyAddress, MAX_UINT);\n }\n\n /// @dev Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketSellOrdersWithEth(\n LibOrder.Order[] memory orders,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n FillResults memory orderFillResults,\n FillResults memory feeOrderFillResults\n )\n {\n // Convert ETH to WETH.\n convertEthToWeth();\n\n uint256 wethSellAmount;\n uint256 zrxBuyAmount;\n uint256 makerAssetAmountPurchased;\n if (orders[0].makerAssetData.equals(ZRX_ASSET_DATA)) {\n // Calculate amount of WETH that won't be spent on ETH fees.\n wethSellAmount = getPartialAmountFloor(\n PERCENTAGE_DENOMINATOR,\n safeAdd(PERCENTAGE_DENOMINATOR, feePercentage),\n msg.value\n );\n // Market sell available WETH.\n // ZRX fees are paid with this contract's balance.\n orderFillResults = marketSellWeth(\n orders,\n wethSellAmount,\n signatures\n );\n // The fee amount must be deducted from the amount transfered back to sender.\n makerAssetAmountPurchased = safeSub(orderFillResults.makerAssetFilledAmount, orderFillResults.takerFeePaid);\n } else {\n // 5% of WETH is reserved for filling feeOrders and paying feeRecipient.\n wethSellAmount = getPartialAmountFloor(\n MAX_WETH_FILL_PERCENTAGE,\n PERCENTAGE_DENOMINATOR,\n msg.value\n );\n // Market sell 95% of WETH.\n // ZRX fees are payed with this contract's balance.\n orderFillResults = marketSellWeth(\n orders,\n wethSellAmount,\n signatures\n );\n // Buy back all ZRX spent on fees.\n zrxBuyAmount = orderFillResults.takerFeePaid;\n feeOrderFillResults = marketBuyExactZrxWithWeth(\n feeOrders,\n zrxBuyAmount,\n feeSignatures\n );\n makerAssetAmountPurchased = orderFillResults.makerAssetFilledAmount;\n }\n\n // Transfer feePercentage of total ETH spent on primary orders to feeRecipient.\n // Refund remaining ETH to msg.sender.\n transferEthFeeAndRefund(\n orderFillResults.takerAssetFilledAmount,\n feeOrderFillResults.takerAssetFilledAmount,\n feePercentage,\n feeRecipient\n );\n\n // Transfer purchased assets to msg.sender.\n transferAssetToSender(orders[0].makerAssetData, makerAssetAmountPurchased);\n }\n\n /// @dev Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param makerAssetFillAmount Desired amount of makerAsset to purchase.\n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketBuyOrdersWithEth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n FillResults memory orderFillResults,\n FillResults memory feeOrderFillResults\n )\n {\n // Convert ETH to WETH.\n convertEthToWeth();\n\n uint256 zrxBuyAmount;\n uint256 makerAssetAmountPurchased;\n if (orders[0].makerAssetData.equals(ZRX_ASSET_DATA)) {\n // If the makerAsset is ZRX, it is not necessary to pay fees out of this\n // contracts's ZRX balance because fees are factored into the price of the order.\n orderFillResults = marketBuyExactZrxWithWeth(\n orders,\n makerAssetFillAmount,\n signatures\n );\n // The fee amount must be deducted from the amount transfered back to sender.\n makerAssetAmountPurchased = safeSub(orderFillResults.makerAssetFilledAmount, orderFillResults.takerFeePaid);\n } else {\n // Attemp to purchase desired amount of makerAsset.\n // ZRX fees are payed with this contract's balance.\n orderFillResults = marketBuyExactAmountWithWeth(\n orders,\n makerAssetFillAmount,\n signatures\n );\n // Buy back all ZRX spent on fees.\n zrxBuyAmount = orderFillResults.takerFeePaid;\n feeOrderFillResults = marketBuyExactZrxWithWeth(\n feeOrders,\n zrxBuyAmount,\n feeSignatures\n );\n makerAssetAmountPurchased = orderFillResults.makerAssetFilledAmount;\n }\n\n // Transfer feePercentage of total ETH spent on primary orders to feeRecipient.\n // Refund remaining ETH to msg.sender.\n transferEthFeeAndRefund(\n orderFillResults.takerAssetFilledAmount,\n feeOrderFillResults.takerAssetFilledAmount,\n feePercentage,\n feeRecipient\n );\n\n // Transfer purchased assets to msg.sender.\n transferAssetToSender(orders[0].makerAssetData, makerAssetAmountPurchased);\n }\n}\n",
- "2.0.0/extensions/Forwarder/MixinWeth.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../protocol/Exchange/libs/LibMath.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./mixins/MWeth.sol\";\n\n\ncontract MixinWeth is\n LibMath,\n LibConstants,\n MWeth\n{\n /// @dev Default payabale function, this allows us to withdraw WETH\n function ()\n public\n payable\n {\n require(\n msg.sender == address(ETHER_TOKEN),\n \"DEFAULT_FUNCTION_WETH_CONTRACT_ONLY\"\n );\n }\n\n /// @dev Converts message call's ETH value into WETH.\n function convertEthToWeth()\n internal\n {\n require(\n msg.value > 0,\n \"INVALID_MSG_VALUE\"\n );\n ETHER_TOKEN.deposit.value(msg.value)();\n }\n\n /// @dev Transfers feePercentage of WETH spent on primary orders to feeRecipient.\n /// Refunds any excess ETH to msg.sender.\n /// @param wethSoldExcludingFeeOrders Amount of WETH sold when filling primary orders.\n /// @param wethSoldForZrx Amount of WETH sold when purchasing ZRX required for primary order fees.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n function transferEthFeeAndRefund(\n uint256 wethSoldExcludingFeeOrders,\n uint256 wethSoldForZrx,\n uint256 feePercentage,\n address feeRecipient\n )\n internal\n {\n // Ensure feePercentage is less than 5%.\n require(\n feePercentage <= MAX_FEE_PERCENTAGE,\n \"FEE_PERCENTAGE_TOO_LARGE\"\n );\n\n // Ensure that no extra WETH owned by this contract has been sold.\n uint256 wethSold = safeAdd(wethSoldExcludingFeeOrders, wethSoldForZrx);\n require(\n wethSold <= msg.value,\n \"OVERSOLD_WETH\"\n );\n\n // Calculate amount of WETH that hasn't been sold.\n uint256 wethRemaining = safeSub(msg.value, wethSold);\n\n // Calculate ETH fee to pay to feeRecipient.\n uint256 ethFee = getPartialAmountFloor(\n feePercentage,\n PERCENTAGE_DENOMINATOR,\n wethSoldExcludingFeeOrders\n );\n\n // Ensure fee is less than amount of WETH remaining.\n require(\n ethFee <= wethRemaining,\n \"INSUFFICIENT_ETH_REMAINING\"\n );\n \n // Do nothing if no WETH remaining\n if (wethRemaining > 0) {\n // Convert remaining WETH to ETH\n ETHER_TOKEN.withdraw(wethRemaining);\n\n // Pay ETH to feeRecipient\n if (ethFee > 0) {\n feeRecipient.transfer(ethFee);\n }\n\n // Refund remaining ETH to msg.sender.\n uint256 ethRefund = safeSub(wethRemaining, ethFee);\n if (ethRefund > 0) {\n msg.sender.transfer(ethRefund);\n }\n }\n }\n}\n",
- "2.0.0/extensions/Forwarder/interfaces/IAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IAssets {\n\n /// @dev Withdraws assets from this contract. The contract requires a ZRX balance in order to \n /// function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be\n /// used to withdraw assets that were accidentally sent to this contract.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of ERC20 token to withdraw.\n function withdrawAsset(\n bytes assetData,\n uint256 amount\n )\n external;\n}\n",
- "2.0.0/extensions/Forwarder/interfaces/IForwarderCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../../protocol/Exchange/libs/LibFillResults.sol\";\n\n\ncontract IForwarderCore {\n\n /// @dev Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketSellOrdersWithEth(\n LibOrder.Order[] memory orders,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n LibFillResults.FillResults memory orderFillResults,\n LibFillResults.FillResults memory feeOrderFillResults\n );\n\n /// @dev Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.\n /// Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.\n /// Any ETH not spent will be refunded to sender.\n /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. \n /// @param makerAssetFillAmount Desired amount of makerAsset to purchase.\n /// @param signatures Proofs that orders have been created by makers.\n /// @param feeOrders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. Used to purchase ZRX for primary order fees.\n /// @param feeSignatures Proofs that feeOrders have been created by makers.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n /// @return Amounts filled and fees paid by maker and taker for both sets of orders.\n function marketBuyOrdersWithEth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures,\n LibOrder.Order[] memory feeOrders,\n bytes[] memory feeSignatures,\n uint256 feePercentage,\n address feeRecipient\n )\n public\n payable\n returns (\n LibFillResults.FillResults memory orderFillResults,\n LibFillResults.FillResults memory feeOrderFillResults\n );\n}\n",
- "2.0.0/extensions/Forwarder/libs/LibConstants.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/LibBytes/LibBytes.sol\";\nimport \"../../../protocol/Exchange/interfaces/IExchange.sol\";\nimport \"../../../tokens/EtherToken/IEtherToken.sol\";\nimport \"../../../tokens/ERC20Token/IERC20Token.sol\";\n\n\ncontract LibConstants {\n\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n uint256 constant internal MAX_UINT = 2**256 - 1;\n uint256 constant internal PERCENTAGE_DENOMINATOR = 10**18; \n uint256 constant internal MAX_FEE_PERCENTAGE = 5 * PERCENTAGE_DENOMINATOR / 100; // 5%\n uint256 constant internal MAX_WETH_FILL_PERCENTAGE = 95 * PERCENTAGE_DENOMINATOR / 100; // 95%\n \n // solhint-disable var-name-mixedcase\n IExchange internal EXCHANGE;\n IEtherToken internal ETHER_TOKEN;\n IERC20Token internal ZRX_TOKEN;\n bytes internal ZRX_ASSET_DATA;\n bytes internal WETH_ASSET_DATA;\n // solhint-enable var-name-mixedcase\n\n constructor (\n address _exchange,\n bytes memory _zrxAssetData,\n bytes memory _wethAssetData\n )\n public\n {\n EXCHANGE = IExchange(_exchange);\n ZRX_ASSET_DATA = _zrxAssetData;\n WETH_ASSET_DATA = _wethAssetData;\n\n address etherToken = _wethAssetData.readAddress(16);\n address zrxToken = _zrxAssetData.readAddress(16);\n ETHER_TOKEN = IEtherToken(etherToken);\n ZRX_TOKEN = IERC20Token(zrxToken);\n }\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MAssets.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAssets.sol\";\n\n\ncontract MAssets is\n IAssets\n{\n /// @dev Transfers given amount of asset to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferAssetToSender(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n\n /// @dev Decodes ERC20 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC20Token(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n\n /// @dev Decodes ERC721 assetData and transfers given amount to sender.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param amount Amount of asset to transfer to sender.\n function transferERC721Token(\n bytes memory assetData,\n uint256 amount\n )\n internal;\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MExchangeWrapper.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../../protocol/Exchange/libs/LibFillResults.sol\";\n\n\ncontract MExchangeWrapper {\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of WETH has been sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param wethSellAmount Desired amount of WETH to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellWeth(\n LibOrder.Order[] memory orders,\n uint256 wethSellAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// The asset being sold by taker must always be WETH.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyExactAmountWithWeth(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Buys zrxBuyAmount of ZRX fee tokens, taking into account ZRX fees for each order. This will guarantee\n /// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues).\n /// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX\n /// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases.\n /// The asset being sold by taker must always be WETH. \n /// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset.\n /// @param zrxBuyAmount Desired amount of ZRX to buy.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return totalFillResults Amounts filled and fees paid by maker and taker.\n function marketBuyExactZrxWithWeth(\n LibOrder.Order[] memory orders,\n uint256 zrxBuyAmount,\n bytes[] memory signatures\n )\n internal\n returns (LibFillResults.FillResults memory totalFillResults);\n}\n",
- "2.0.0/extensions/Forwarder/mixins/MWeth.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract MWeth {\n\n /// @dev Converts message call's ETH value into WETH.\n function convertEthToWeth()\n internal;\n\n /// @dev Transfers feePercentage of WETH spent on primary orders to feeRecipient.\n /// Refunds any excess ETH to msg.sender.\n /// @param wethSoldExcludingFeeOrders Amount of WETH sold when filling primary orders.\n /// @param wethSoldForZrx Amount of WETH sold when purchasing ZRX required for primary order fees.\n /// @param feePercentage Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.\n /// @param feeRecipient Address that will receive ETH when orders are filled.\n function transferEthFeeAndRefund(\n uint256 wethSoldExcludingFeeOrders,\n uint256 wethSoldForZrx,\n uint256 feePercentage,\n address feeRecipient\n )\n internal;\n}\n",
- "2.0.0/extensions/OrderValidator/OrderValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../protocol/Exchange/interfaces/IExchange.sol\";\nimport \"../../protocol/Exchange/libs/LibOrder.sol\";\nimport \"../../tokens/ERC20Token/IERC20Token.sol\";\nimport \"../../tokens/ERC721Token/IERC721Token.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\n\n\ncontract OrderValidator {\n\n using LibBytes for bytes;\n\n bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n\n struct TraderInfo {\n uint256 makerBalance; // Maker's balance of makerAsset\n uint256 makerAllowance; // Maker's allowance to corresponding AssetProxy\n uint256 takerBalance; // Taker's balance of takerAsset\n uint256 takerAllowance; // Taker's allowance to corresponding AssetProxy\n uint256 makerZrxBalance; // Maker's balance of ZRX\n uint256 makerZrxAllowance; // Maker's allowance of ZRX to ERC20Proxy\n uint256 takerZrxBalance; // Taker's balance of ZRX\n uint256 takerZrxAllowance; // Taker's allowance of ZRX to ERC20Proxy\n }\n\n // solhint-disable var-name-mixedcase\n IExchange internal EXCHANGE;\n bytes internal ZRX_ASSET_DATA;\n // solhint-enable var-name-mixedcase\n\n constructor (address _exchange, bytes memory _zrxAssetData)\n public\n {\n EXCHANGE = IExchange(_exchange);\n ZRX_ASSET_DATA = _zrxAssetData;\n }\n\n /// @dev Fetches information for order and maker/taker of order.\n /// @param order The order structure.\n /// @param takerAddress Address that will be filling the order.\n /// @return OrderInfo and TraderInfo instances for given order.\n function getOrderAndTraderInfo(LibOrder.Order memory order, address takerAddress)\n public\n view\n returns (LibOrder.OrderInfo memory orderInfo, TraderInfo memory traderInfo)\n {\n orderInfo = EXCHANGE.getOrderInfo(order);\n traderInfo = getTraderInfo(order, takerAddress);\n return (orderInfo, traderInfo);\n }\n\n /// @dev Fetches information for all passed in orders and the makers/takers of each order.\n /// @param orders Array of order specifications.\n /// @param takerAddresses Array of taker addresses corresponding to each order.\n /// @return Arrays of OrderInfo and TraderInfo instances that correspond to each order.\n function getOrdersAndTradersInfo(LibOrder.Order[] memory orders, address[] memory takerAddresses)\n public\n view\n returns (LibOrder.OrderInfo[] memory ordersInfo, TraderInfo[] memory tradersInfo)\n {\n ordersInfo = EXCHANGE.getOrdersInfo(orders);\n tradersInfo = getTradersInfo(orders, takerAddresses);\n return (ordersInfo, tradersInfo);\n }\n\n /// @dev Fetches balance and allowances for maker and taker of order.\n /// @param order The order structure.\n /// @param takerAddress Address that will be filling the order.\n /// @return Balances and allowances of maker and taker of order.\n function getTraderInfo(LibOrder.Order memory order, address takerAddress)\n public\n view\n returns (TraderInfo memory traderInfo)\n {\n (traderInfo.makerBalance, traderInfo.makerAllowance) = getBalanceAndAllowance(order.makerAddress, order.makerAssetData);\n (traderInfo.takerBalance, traderInfo.takerAllowance) = getBalanceAndAllowance(takerAddress, order.takerAssetData);\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n (traderInfo.makerZrxBalance, traderInfo.makerZrxAllowance) = getBalanceAndAllowance(order.makerAddress, zrxAssetData);\n (traderInfo.takerZrxBalance, traderInfo.takerZrxAllowance) = getBalanceAndAllowance(takerAddress, zrxAssetData);\n return traderInfo;\n }\n\n /// @dev Fetches balances and allowances of maker and taker for each provided order.\n /// @param orders Array of order specifications.\n /// @param takerAddresses Array of taker addresses corresponding to each order.\n /// @return Array of balances and allowances for maker and taker of each order.\n function getTradersInfo(LibOrder.Order[] memory orders, address[] memory takerAddresses)\n public\n view\n returns (TraderInfo[] memory)\n {\n uint256 ordersLength = orders.length;\n TraderInfo[] memory tradersInfo = new TraderInfo[](ordersLength);\n for (uint256 i = 0; i != ordersLength; i++) {\n tradersInfo[i] = getTraderInfo(orders[i], takerAddresses[i]);\n }\n return tradersInfo;\n }\n\n /// @dev Fetches token balances and allowances of an address to given assetProxy. Supports ERC20 and ERC721.\n /// @param target Address to fetch balances and allowances of.\n /// @param assetData Encoded data that can be decoded by a specified proxy contract when transferring asset.\n /// @return Balance of asset and allowance set to given proxy of asset.\n /// For ERC721 tokens, these values will always be 1 or 0.\n function getBalanceAndAllowance(address target, bytes memory assetData)\n public\n view\n returns (uint256 balance, uint256 allowance)\n {\n bytes4 assetProxyId = assetData.readBytes4(0);\n address token = assetData.readAddress(16);\n address assetProxy = EXCHANGE.getAssetProxy(assetProxyId);\n\n if (assetProxyId == ERC20_DATA_ID) {\n // Query balance\n balance = IERC20Token(token).balanceOf(target);\n\n // Query allowance\n allowance = IERC20Token(token).allowance(target, assetProxy);\n } else if (assetProxyId == ERC721_DATA_ID) {\n uint256 tokenId = assetData.readUint256(36);\n\n // Query owner of tokenId\n address owner = getERC721TokenOwner(token, tokenId);\n\n // Set balance to 1 if tokenId is owned by target\n balance = target == owner ? 1 : 0;\n\n // Check if ERC721Proxy is approved to spend tokenId\n bool isApproved = IERC721Token(token).isApprovedForAll(target, assetProxy) || IERC721Token(token).getApproved(tokenId) == assetProxy;\n \n // Set alowance to 1 if ERC721Proxy is approved to spend tokenId\n allowance = isApproved ? 1 : 0;\n } else {\n revert(\"UNSUPPORTED_ASSET_PROXY\");\n }\n return (balance, allowance);\n }\n\n /// @dev Fetches token balances and allowances of an address for each given assetProxy. Supports ERC20 and ERC721.\n /// @param target Address to fetch balances and allowances of.\n /// @param assetData Array of encoded byte arrays that can be decoded by a specified proxy contract when transferring asset.\n /// @return Balances and allowances of assets.\n /// For ERC721 tokens, these values will always be 1 or 0.\n function getBalancesAndAllowances(address target, bytes[] memory assetData)\n public\n view\n returns (uint256[] memory, uint256[] memory)\n {\n uint256 length = assetData.length;\n uint256[] memory balances = new uint256[](length);\n uint256[] memory allowances = new uint256[](length);\n for (uint256 i = 0; i != length; i++) {\n (balances[i], allowances[i]) = getBalanceAndAllowance(target, assetData[i]);\n }\n return (balances, allowances);\n }\n\n /// @dev Calls `token.ownerOf(tokenId)`, but returns a null owner instead of reverting on an unowned token.\n /// @param token Address of ERC721 token.\n /// @param tokenId The identifier for the specific NFT.\n /// @return Owner of tokenId or null address if unowned.\n function getERC721TokenOwner(address token, uint256 tokenId)\n public\n view\n returns (address owner)\n {\n assembly {\n // load free memory pointer\n let cdStart := mload(64)\n\n // bytes4(keccak256(ownerOf(uint256))) = 0x6352211e\n mstore(cdStart, 0x6352211e00000000000000000000000000000000000000000000000000000000)\n mstore(add(cdStart, 4), tokenId)\n\n // staticcall `ownerOf(tokenId)`\n // `ownerOf` will revert if tokenId is not owned\n let success := staticcall(\n gas, // forward all gas\n token, // call token contract\n cdStart, // start of calldata\n 36, // length of input is 36 bytes\n cdStart, // write output over input\n 32 // size of output is 32 bytes\n )\n\n // Success implies that tokenId is owned\n // Copy owner from return data if successful\n if success {\n owner := mload(cdStart)\n } \n }\n\n // Owner initialized to address(0), no need to modify if call is unsuccessful\n return owner;\n }\n}\n",
- "2.0.0/multisig/MultiSigWallet.sol": "// solhint-disable\npragma solidity ^0.4.15;\n\n\n/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.\n/// @author Stefan George - <stefan.george@consensys.net>\ncontract MultiSigWallet {\n\n /*\n * Events\n */\n event Confirmation(address indexed sender, uint indexed transactionId);\n event Revocation(address indexed sender, uint indexed transactionId);\n event Submission(uint indexed transactionId);\n event Execution(uint indexed transactionId);\n event ExecutionFailure(uint indexed transactionId);\n event Deposit(address indexed sender, uint value);\n event OwnerAddition(address indexed owner);\n event OwnerRemoval(address indexed owner);\n event RequirementChange(uint required);\n\n /*\n * Constants\n */\n uint constant public MAX_OWNER_COUNT = 50;\n\n /*\n * Storage\n */\n mapping (uint => Transaction) public transactions;\n mapping (uint => mapping (address => bool)) public confirmations;\n mapping (address => bool) public isOwner;\n address[] public owners;\n uint public required;\n uint public transactionCount;\n\n struct Transaction {\n address destination;\n uint value;\n bytes data;\n bool executed;\n }\n\n /*\n * Modifiers\n */\n modifier onlyWallet() {\n require(msg.sender == address(this));\n _;\n }\n\n modifier ownerDoesNotExist(address owner) {\n require(!isOwner[owner]);\n _;\n }\n\n modifier ownerExists(address owner) {\n require(isOwner[owner]);\n _;\n }\n\n modifier transactionExists(uint transactionId) {\n require(transactions[transactionId].destination != 0);\n _;\n }\n\n modifier confirmed(uint transactionId, address owner) {\n require(confirmations[transactionId][owner]);\n _;\n }\n\n modifier notConfirmed(uint transactionId, address owner) {\n require(!confirmations[transactionId][owner]);\n _;\n }\n\n modifier notExecuted(uint transactionId) {\n require(!transactions[transactionId].executed);\n _;\n }\n\n modifier notNull(address _address) {\n require(_address != 0);\n _;\n }\n\n modifier validRequirement(uint ownerCount, uint _required) {\n require(ownerCount <= MAX_OWNER_COUNT\n && _required <= ownerCount\n && _required != 0\n && ownerCount != 0);\n _;\n }\n\n /// @dev Fallback function allows to deposit ether.\n function()\n payable\n {\n if (msg.value > 0)\n Deposit(msg.sender, msg.value);\n }\n\n /*\n * Public functions\n */\n /// @dev Contract constructor sets initial owners and required number of confirmations.\n /// @param _owners List of initial owners.\n /// @param _required Number of required confirmations.\n function MultiSigWallet(address[] _owners, uint _required)\n public\n validRequirement(_owners.length, _required)\n {\n for (uint i=0; i<_owners.length; i++) {\n require(!isOwner[_owners[i]] && _owners[i] != 0);\n isOwner[_owners[i]] = true;\n }\n owners = _owners;\n required = _required;\n }\n\n /// @dev Allows to add a new owner. Transaction has to be sent by wallet.\n /// @param owner Address of new owner.\n function addOwner(address owner)\n public\n onlyWallet\n ownerDoesNotExist(owner)\n notNull(owner)\n validRequirement(owners.length + 1, required)\n {\n isOwner[owner] = true;\n owners.push(owner);\n OwnerAddition(owner);\n }\n\n /// @dev Allows to remove an owner. Transaction has to be sent by wallet.\n /// @param owner Address of owner.\n function removeOwner(address owner)\n public\n onlyWallet\n ownerExists(owner)\n {\n isOwner[owner] = false;\n for (uint i=0; i<owners.length - 1; i++)\n if (owners[i] == owner) {\n owners[i] = owners[owners.length - 1];\n break;\n }\n owners.length -= 1;\n if (required > owners.length)\n changeRequirement(owners.length);\n OwnerRemoval(owner);\n }\n\n /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet.\n /// @param owner Address of owner to be replaced.\n /// @param newOwner Address of new owner.\n function replaceOwner(address owner, address newOwner)\n public\n onlyWallet\n ownerExists(owner)\n ownerDoesNotExist(newOwner)\n {\n for (uint i=0; i<owners.length; i++)\n if (owners[i] == owner) {\n owners[i] = newOwner;\n break;\n }\n isOwner[owner] = false;\n isOwner[newOwner] = true;\n OwnerRemoval(owner);\n OwnerAddition(newOwner);\n }\n\n /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet.\n /// @param _required Number of required confirmations.\n function changeRequirement(uint _required)\n public\n onlyWallet\n validRequirement(owners.length, _required)\n {\n required = _required;\n RequirementChange(_required);\n }\n\n /// @dev Allows an owner to submit and confirm a transaction.\n /// @param destination Transaction target address.\n /// @param value Transaction ether value.\n /// @param data Transaction data payload.\n /// @return Returns transaction ID.\n function submitTransaction(address destination, uint value, bytes data)\n public\n returns (uint transactionId)\n {\n transactionId = addTransaction(destination, value, data);\n confirmTransaction(transactionId);\n }\n\n /// @dev Allows an owner to confirm a transaction.\n /// @param transactionId Transaction ID.\n function confirmTransaction(uint transactionId)\n public\n ownerExists(msg.sender)\n transactionExists(transactionId)\n notConfirmed(transactionId, msg.sender)\n {\n confirmations[transactionId][msg.sender] = true;\n Confirmation(msg.sender, transactionId);\n executeTransaction(transactionId);\n }\n\n /// @dev Allows an owner to revoke a confirmation for a transaction.\n /// @param transactionId Transaction ID.\n function revokeConfirmation(uint transactionId)\n public\n ownerExists(msg.sender)\n confirmed(transactionId, msg.sender)\n notExecuted(transactionId)\n {\n confirmations[transactionId][msg.sender] = false;\n Revocation(msg.sender, transactionId);\n }\n\n /// @dev Allows anyone to execute a confirmed transaction.\n /// @param transactionId Transaction ID.\n function executeTransaction(uint transactionId)\n public\n ownerExists(msg.sender)\n confirmed(transactionId, msg.sender)\n notExecuted(transactionId)\n {\n if (isConfirmed(transactionId)) {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data))\n Execution(transactionId);\n else {\n ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n }\n\n // call has been separated into its own function in order to take advantage\n // of the Solidity's code generator to produce a loop that copies tx.data into memory.\n function external_call(address destination, uint value, uint dataLength, bytes data) internal returns (bool) {\n bool result;\n assembly {\n let x := mload(0x40) // \"Allocate\" memory for output (0x40 is where \"free memory\" pointer is stored by convention)\n let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that\n result := call(\n sub(gas, 34710), // 34710 is the value that solidity is currently emitting\n // It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) +\n // callNewAccountGas (25000, in case the destination address does not exist and needs creating)\n destination,\n value,\n d,\n dataLength, // Size of the input (in bytes) - this is what fixes the padding problem\n x,\n 0 // Output is ignored, therefore the output size is zero\n )\n }\n return result;\n }\n\n /// @dev Returns the confirmation status of a transaction.\n /// @param transactionId Transaction ID.\n /// @return Confirmation status.\n function isConfirmed(uint transactionId)\n public\n constant\n returns (bool)\n {\n uint count = 0;\n for (uint i=0; i<owners.length; i++) {\n if (confirmations[transactionId][owners[i]])\n count += 1;\n if (count == required)\n return true;\n }\n }\n\n /*\n * Internal functions\n */\n /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet.\n /// @param destination Transaction target address.\n /// @param value Transaction ether value.\n /// @param data Transaction data payload.\n /// @return Returns transaction ID.\n function addTransaction(address destination, uint value, bytes data)\n internal\n notNull(destination)\n returns (uint transactionId)\n {\n transactionId = transactionCount;\n transactions[transactionId] = Transaction({\n destination: destination,\n value: value,\n data: data,\n executed: false\n });\n transactionCount += 1;\n Submission(transactionId);\n }\n\n /*\n * Web3 call functions\n */\n /// @dev Returns number of confirmations of a transaction.\n /// @param transactionId Transaction ID.\n /// @return Number of confirmations.\n function getConfirmationCount(uint transactionId)\n public\n constant\n returns (uint count)\n {\n for (uint i=0; i<owners.length; i++)\n if (confirmations[transactionId][owners[i]])\n count += 1;\n }\n\n /// @dev Returns total number of transactions after filers are applied.\n /// @param pending Include pending transactions.\n /// @param executed Include executed transactions.\n /// @return Total number of transactions after filters are applied.\n function getTransactionCount(bool pending, bool executed)\n public\n constant\n returns (uint count)\n {\n for (uint i=0; i<transactionCount; i++)\n if ( pending && !transactions[i].executed\n || executed && transactions[i].executed)\n count += 1;\n }\n\n /// @dev Returns list of owners.\n /// @return List of owner addresses.\n function getOwners()\n public\n constant\n returns (address[])\n {\n return owners;\n }\n\n /// @dev Returns array with owner addresses, which confirmed transaction.\n /// @param transactionId Transaction ID.\n /// @return Returns array of owner addresses.\n function getConfirmations(uint transactionId)\n public\n constant\n returns (address[] _confirmations)\n {\n address[] memory confirmationsTemp = new address[](owners.length);\n uint count = 0;\n uint i;\n for (i=0; i<owners.length; i++)\n if (confirmations[transactionId][owners[i]]) {\n confirmationsTemp[count] = owners[i];\n count += 1;\n }\n _confirmations = new address[](count);\n for (i=0; i<count; i++)\n _confirmations[i] = confirmationsTemp[i];\n }\n\n /// @dev Returns list of transaction IDs in defined range.\n /// @param from Index start position of transaction array.\n /// @param to Index end position of transaction array.\n /// @param pending Include pending transactions.\n /// @param executed Include executed transactions.\n /// @return Returns array of transaction IDs.\n function getTransactionIds(uint from, uint to, bool pending, bool executed)\n public\n constant\n returns (uint[] _transactionIds)\n {\n uint[] memory transactionIdsTemp = new uint[](transactionCount);\n uint count = 0;\n uint i;\n for (i=0; i<transactionCount; i++)\n if ( pending && !transactions[i].executed\n || executed && transactions[i].executed)\n {\n transactionIdsTemp[count] = i;\n count += 1;\n }\n _transactionIds = new uint[](to - from);\n for (i=from; i<to; i++)\n _transactionIds[i - from] = transactionIdsTemp[i];\n }\n}",
- "2.0.0/multisig/MultiSigWalletWithTimeLock.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MultiSigWallet.sol\";\n\n\n/// @title Multisignature wallet with time lock- Allows multiple parties to execute a transaction after a time lock has passed.\n/// @author Amir Bandeali - <amir@0xProject.com>\n// solhint-disable not-rely-on-time\ncontract MultiSigWalletWithTimeLock is\n MultiSigWallet\n{\n event ConfirmationTimeSet(uint256 indexed transactionId, uint256 confirmationTime);\n event TimeLockChange(uint256 secondsTimeLocked);\n\n uint256 public secondsTimeLocked;\n\n mapping (uint256 => uint256) public confirmationTimes;\n\n modifier notFullyConfirmed(uint256 transactionId) {\n require(\n !isConfirmed(transactionId),\n \"TX_FULLY_CONFIRMED\"\n );\n _;\n }\n\n modifier fullyConfirmed(uint256 transactionId) {\n require(\n isConfirmed(transactionId),\n \"TX_NOT_FULLY_CONFIRMED\"\n );\n _;\n }\n\n modifier pastTimeLock(uint256 transactionId) {\n require(\n block.timestamp >= confirmationTimes[transactionId] + secondsTimeLocked,\n \"TIME_LOCK_INCOMPLETE\"\n );\n _;\n }\n\n /// @dev Contract constructor sets initial owners, required number of confirmations, and time lock.\n /// @param _owners List of initial owners.\n /// @param _required Number of required confirmations.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n constructor (\n address[] _owners,\n uint256 _required,\n uint256 _secondsTimeLocked\n )\n public\n MultiSigWallet(_owners, _required)\n {\n secondsTimeLocked = _secondsTimeLocked;\n }\n\n /// @dev Changes the duration of the time lock for transactions.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n function changeTimeLock(uint256 _secondsTimeLocked)\n public\n onlyWallet\n {\n secondsTimeLocked = _secondsTimeLocked;\n emit TimeLockChange(_secondsTimeLocked);\n }\n\n /// @dev Allows an owner to confirm a transaction.\n /// @param transactionId Transaction ID.\n function confirmTransaction(uint256 transactionId)\n public\n ownerExists(msg.sender)\n transactionExists(transactionId)\n notConfirmed(transactionId, msg.sender)\n notFullyConfirmed(transactionId)\n {\n confirmations[transactionId][msg.sender] = true;\n emit Confirmation(msg.sender, transactionId);\n if (isConfirmed(transactionId)) {\n setConfirmationTime(transactionId, block.timestamp);\n }\n }\n\n /// @dev Allows anyone to execute a confirmed transaction.\n /// @param transactionId Transaction ID.\n function executeTransaction(uint256 transactionId)\n public\n notExecuted(transactionId)\n fullyConfirmed(transactionId)\n pastTimeLock(transactionId)\n {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) {\n emit Execution(transactionId);\n } else {\n emit ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n\n /// @dev Sets the time of when a submission first passed.\n function setConfirmationTime(uint256 transactionId, uint256 confirmationTime)\n internal\n {\n confirmationTimes[transactionId] = confirmationTime;\n emit ConfirmationTimeSet(transactionId, confirmationTime);\n }\n}\n",
- "2.0.0/protocol/AssetProxy/ERC20Proxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MixinAuthorizable.sol\";\n\n\ncontract ERC20Proxy is\n MixinAuthorizable\n{\n // Id of this proxy.\n bytes4 constant internal PROXY_ID = bytes4(keccak256(\"ERC20Token(address)\"));\n \n // solhint-disable-next-line payable-fallback\n function () \n external\n {\n assembly {\n // The first 4 bytes of calldata holds the function selector\n let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)\n\n // `transferFrom` will be called with the following parameters:\n // assetData Encoded byte array.\n // from Address to transfer asset from.\n // to Address to transfer asset to.\n // amount Amount of asset to transfer.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {\n\n // To lookup a value in a mapping, we load from the storage location keccak256(k, p),\n // where k is the key left padded to 32 bytes and p is the storage slot\n let start := mload(64)\n mstore(start, and(caller, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(start, 32), authorized_slot)\n\n // Revert if authorized[msg.sender] == false\n if iszero(sload(keccak256(start, 64))) {\n // Revert with `Error(\"SENDER_NOT_AUTHORIZED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // `transferFrom`.\n // The function is marked `external`, so no abi decodeding is done for\n // us. Instead, we expect the `calldata` memory to contain the\n // following:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n //\n // (*): offset is computed from start of function parameters, so offset\n // by an additional 4 bytes in the calldata.\n //\n // (**): see table below to compute length of assetData Contents\n //\n // WARNING: The ABIv2 specification allows additional padding between\n // the Params and Data section. This will result in a larger\n // offset to assetData.\n\n // Asset data itself is encoded as follows:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 1 * 32 | function parameters: |\n // | | 4 | 12 + 20 | 1. token address |\n\n // We construct calldata for the `token.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 4 | | 1. from |\n // | | 36 | | 2. to |\n // | | 68 | | 3. amount |\n\n /////// Read token address from calldata ///////\n // * The token address is stored in `assetData`.\n //\n // * The \"offset to assetData\" is stored at offset 4 in the calldata (table 1).\n // [assetDataOffsetFromParams = calldataload(4)]\n //\n // * Notes that the \"offset to assetData\" is relative to the \"Params\" area of calldata;\n // add 4 bytes to account for the length of the \"Header\" area (table 1).\n // [assetDataOffsetFromHeader = assetDataOffsetFromParams + 4]\n //\n // * The \"token address\" is offset 32+4=36 bytes into \"assetData\" (tables 1 & 2).\n // [tokenOffset = assetDataOffsetFromHeader + 36 = calldataload(4) + 4 + 36]\n let token := calldataload(add(calldataload(4), 40))\n \n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFrom` selector.\n // Any trailing data in transferFromSelector will be\n // overwritten in the next `mstore` call.\n mstore(0, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // We copy the fields `from`, `to` and `amount` in bulk\n // from our own calldata to the new calldata.\n calldatacopy(4, 36, 96)\n\n /////// Call `token.transferFrom` using the calldata ///////\n let success := call(\n gas, // forward all gas\n token, // call address of token contract\n 0, // don't send any ETH\n 0, // pointer to start of input\n 100, // length of input\n 0, // write output over input\n 32 // output size should be 32 bytes\n )\n\n /////// Check return data. ///////\n // If there is no return data, we assume the token incorrectly\n // does not return a bool. In this case we expect it to revert\n // on failure, which was handled above.\n // If the token does return data, we require that it is a single\n // nonzero 32 bytes value.\n // So the transfer succeeded if the call succeeded and either\n // returned nothing, or returned a non-zero 32 byte value. \n success := and(success, or(\n iszero(returndatasize),\n and(\n eq(returndatasize, 32),\n gt(mload(0), 0)\n )\n ))\n if success {\n return(0, 0)\n }\n \n // Revert with `Error(\"TRANSFER_FAILED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // Revert if undefined function is called\n revert(0, 0)\n }\n }\n\n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4)\n {\n return PROXY_ID;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/ERC721Proxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./MixinAuthorizable.sol\";\n\n\ncontract ERC721Proxy is\n MixinAuthorizable\n{\n // Id of this proxy.\n bytes4 constant internal PROXY_ID = bytes4(keccak256(\"ERC721Token(address,uint256)\"));\n\n // solhint-disable-next-line payable-fallback\n function () \n external\n {\n assembly {\n // The first 4 bytes of calldata holds the function selector\n let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)\n\n // `transferFrom` will be called with the following parameters:\n // assetData Encoded byte array.\n // from Address to transfer asset from.\n // to Address to transfer asset to.\n // amount Amount of asset to transfer.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {\n\n // To lookup a value in a mapping, we load from the storage location keccak256(k, p),\n // where k is the key left padded to 32 bytes and p is the storage slot\n let start := mload(64)\n mstore(start, and(caller, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(start, 32), authorized_slot)\n\n // Revert if authorized[msg.sender] == false\n if iszero(sload(keccak256(start, 64))) {\n // Revert with `Error(\"SENDER_NOT_AUTHORIZED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // `transferFrom`.\n // The function is marked `external`, so no abi decodeding is done for\n // us. Instead, we expect the `calldata` memory to contain the\n // following:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n //\n // (*): offset is computed from start of function parameters, so offset\n // by an additional 4 bytes in the calldata.\n //\n // (**): see table below to compute length of assetData Contents\n //\n // WARNING: The ABIv2 specification allows additional padding between\n // the Params and Data section. This will result in a larger\n // offset to assetData.\n\n // Asset data itself is encoded as follows:\n //\n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 2 * 32 | function parameters: |\n // | | 4 | 12 + 20 | 1. token address |\n // | | 36 | | 2. tokenId |\n \n // We construct calldata for the `token.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n // \n // | Area | Offset | Length | Contents |\n // |----------|--------|---------|-------------------------------------|\n // | Header | 0 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 4 | | 1. from |\n // | | 36 | | 2. to |\n // | | 68 | | 3. tokenId |\n\n // There exists only 1 of each token.\n // require(amount == 1, \"INVALID_AMOUNT\")\n if sub(calldataload(100), 1) {\n // Revert with `Error(\"INVALID_AMOUNT\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000e494e56414c49445f414d4f554e540000000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFrom` selector.\n // Any trailing data in transferFromSelector will be\n // overwritten in the next `mstore` call.\n mstore(0, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // We copy the fields `from` and `to` in bulk\n // from our own calldata to the new calldata.\n calldatacopy(4, 36, 64)\n\n // Copy `tokenId` field from our own calldata to the new calldata.\n let assetDataOffset := calldataload(4)\n calldatacopy(68, add(assetDataOffset, 72), 32)\n\n /////// Call `token.transferFrom` using the calldata ///////\n let token := calldataload(add(assetDataOffset, 40))\n let success := call(\n gas, // forward all gas\n token, // call address of token contract\n 0, // don't send any ETH\n 0, // pointer to start of input\n 100, // length of input\n 0, // write output to null\n 0 // output size is 0 bytes\n )\n if success {\n return(0, 0)\n }\n \n // Revert with `Error(\"TRANSFER_FAILED\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f5452414e534645525f4641494c454400000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n\n // Revert if undefined function is called\n revert(0, 0)\n }\n }\n\n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4)\n {\n return PROXY_ID;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/MixinAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"./mixins/MAuthorizable.sol\";\n\n\ncontract MixinAuthorizable is\n Ownable,\n MAuthorizable\n{\n /// @dev Only authorized addresses can invoke functions with this modifier.\n modifier onlyAuthorized {\n require(\n authorized[msg.sender],\n \"SENDER_NOT_AUTHORIZED\"\n );\n _;\n }\n\n mapping (address => bool) public authorized;\n address[] public authorities;\n\n /// @dev Authorizes an address.\n /// @param target Address to authorize.\n function addAuthorizedAddress(address target)\n external\n onlyOwner\n {\n require(\n !authorized[target],\n \"TARGET_ALREADY_AUTHORIZED\"\n );\n\n authorized[target] = true;\n authorities.push(target);\n emit AuthorizedAddressAdded(target, msg.sender);\n }\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n function removeAuthorizedAddress(address target)\n external\n onlyOwner\n {\n require(\n authorized[target],\n \"TARGET_NOT_AUTHORIZED\"\n );\n\n delete authorized[target];\n for (uint256 i = 0; i < authorities.length; i++) {\n if (authorities[i] == target) {\n authorities[i] = authorities[authorities.length - 1];\n authorities.length -= 1;\n break;\n }\n }\n emit AuthorizedAddressRemoved(target, msg.sender);\n }\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n /// @param index Index of target in authorities array.\n function removeAuthorizedAddressAtIndex(\n address target,\n uint256 index\n )\n external\n onlyOwner\n {\n require(\n authorized[target],\n \"TARGET_NOT_AUTHORIZED\"\n );\n require(\n index < authorities.length,\n \"INDEX_OUT_OF_BOUNDS\"\n );\n require(\n authorities[index] == target,\n \"AUTHORIZED_ADDRESS_MISMATCH\"\n );\n\n delete authorized[target];\n authorities[index] = authorities[authorities.length - 1];\n authorities.length -= 1;\n emit AuthorizedAddressRemoved(target, msg.sender);\n }\n\n /// @dev Gets all authorized addresses.\n /// @return Array of authorized addresses.\n function getAuthorizedAddresses()\n external\n view\n returns (address[] memory)\n {\n return authorities;\n }\n}\n",
- "2.0.0/protocol/AssetProxy/interfaces/IAssetProxy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./IAuthorizable.sol\";\n\n\ncontract IAssetProxy is\n IAuthorizable\n{\n /// @dev Transfers assets. Either succeeds or throws.\n /// @param assetData Byte array encoded for the respective asset proxy.\n /// @param from Address to transfer asset from.\n /// @param to Address to transfer asset to.\n /// @param amount Amount of asset to transfer.\n function transferFrom(\n bytes assetData,\n address from,\n address to,\n uint256 amount\n )\n external;\n \n /// @dev Gets the proxy id associated with the proxy address.\n /// @return Proxy id.\n function getProxyId()\n external\n pure\n returns (bytes4);\n}\n",
- "2.0.0/protocol/AssetProxy/interfaces/IAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/Ownable/IOwnable.sol\";\n\n\ncontract IAuthorizable is\n IOwnable\n{\n /// @dev Authorizes an address.\n /// @param target Address to authorize.\n function addAuthorizedAddress(address target)\n external;\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n function removeAuthorizedAddress(address target)\n external;\n\n /// @dev Removes authorizion of an address.\n /// @param target Address to remove authorization from.\n /// @param index Index of target in authorities array.\n function removeAuthorizedAddressAtIndex(\n address target,\n uint256 index\n )\n external;\n \n /// @dev Gets all authorized addresses.\n /// @return Array of authorized addresses.\n function getAuthorizedAddresses()\n external\n view\n returns (address[] memory);\n}\n",
- "2.0.0/protocol/AssetProxy/mixins/MAuthorizable.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAuthorizable.sol\";\n\n\ncontract MAuthorizable is\n IAuthorizable\n{\n // Event logged when a new address is authorized.\n event AuthorizedAddressAdded(\n address indexed target,\n address indexed caller\n );\n\n // Event logged when a currently authorized address is unauthorized.\n event AuthorizedAddressRemoved(\n address indexed target,\n address indexed caller\n );\n\n /// @dev Only authorized addresses can invoke functions with this modifier.\n modifier onlyAuthorized { revert(); _; }\n}\n",
- "2.0.0/protocol/AssetProxyOwner/AssetProxyOwner.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../multisig/MultiSigWalletWithTimeLock.sol\";\nimport \"../../utils/LibBytes/LibBytes.sol\";\n\n\ncontract AssetProxyOwner is\n MultiSigWalletWithTimeLock\n{\n using LibBytes for bytes;\n\n event AssetProxyRegistration(address assetProxyContract, bool isRegistered);\n\n // Mapping of AssetProxy contract address =>\n // if this contract is allowed to call the AssetProxy's `removeAuthorizedAddressAtIndex` method without a time lock.\n mapping (address => bool) public isAssetProxyRegistered;\n\n bytes4 constant internal REMOVE_AUTHORIZED_ADDRESS_AT_INDEX_SELECTOR = bytes4(keccak256(\"removeAuthorizedAddressAtIndex(address,uint256)\"));\n\n /// @dev Function will revert if the transaction does not call `removeAuthorizedAddressAtIndex`\n /// on an approved AssetProxy contract.\n modifier validRemoveAuthorizedAddressAtIndexTx(uint256 transactionId) {\n Transaction storage txn = transactions[transactionId];\n require(\n isAssetProxyRegistered[txn.destination],\n \"UNREGISTERED_ASSET_PROXY\"\n );\n require(\n txn.data.readBytes4(0) == REMOVE_AUTHORIZED_ADDRESS_AT_INDEX_SELECTOR,\n \"INVALID_FUNCTION_SELECTOR\"\n );\n _;\n }\n\n /// @dev Contract constructor sets initial owners, required number of confirmations,\n /// time lock, and list of AssetProxy addresses.\n /// @param _owners List of initial owners.\n /// @param _assetProxyContracts Array of AssetProxy contract addresses.\n /// @param _required Number of required confirmations.\n /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.\n constructor (\n address[] memory _owners,\n address[] memory _assetProxyContracts,\n uint256 _required,\n uint256 _secondsTimeLocked\n )\n public\n MultiSigWalletWithTimeLock(_owners, _required, _secondsTimeLocked)\n {\n for (uint256 i = 0; i < _assetProxyContracts.length; i++) {\n address assetProxy = _assetProxyContracts[i];\n require(\n assetProxy != address(0),\n \"INVALID_ASSET_PROXY\"\n );\n isAssetProxyRegistered[assetProxy] = true;\n }\n }\n\n /// @dev Registers or deregisters an AssetProxy to be able to execute\n /// `removeAuthorizedAddressAtIndex` without a timelock.\n /// @param assetProxyContract Address of AssetProxy contract.\n /// @param isRegistered Status of approval for AssetProxy contract.\n function registerAssetProxy(address assetProxyContract, bool isRegistered)\n public\n onlyWallet\n notNull(assetProxyContract)\n {\n isAssetProxyRegistered[assetProxyContract] = isRegistered;\n emit AssetProxyRegistration(assetProxyContract, isRegistered);\n }\n\n /// @dev Allows execution of `removeAuthorizedAddressAtIndex` without time lock.\n /// @param transactionId Transaction ID.\n function executeRemoveAuthorizedAddressAtIndex(uint256 transactionId)\n public\n notExecuted(transactionId)\n fullyConfirmed(transactionId)\n validRemoveAuthorizedAddressAtIndexTx(transactionId)\n {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) {\n emit Execution(transactionId);\n } else {\n emit ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/Exchange.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./MixinExchangeCore.sol\";\nimport \"./MixinSignatureValidator.sol\";\nimport \"./MixinWrapperFunctions.sol\";\nimport \"./MixinAssetProxyDispatcher.sol\";\nimport \"./MixinTransactions.sol\";\nimport \"./MixinMatchOrders.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract Exchange is\n MixinExchangeCore,\n MixinMatchOrders,\n MixinSignatureValidator,\n MixinTransactions,\n MixinAssetProxyDispatcher,\n MixinWrapperFunctions\n{\n string constant public VERSION = \"2.0.0\";\n\n // Mixins are instantiated in the order they are inherited\n constructor ()\n public\n MixinExchangeCore()\n MixinMatchOrders()\n MixinSignatureValidator()\n MixinTransactions()\n MixinAssetProxyDispatcher()\n MixinWrapperFunctions()\n {}\n}\n",
- "2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/Ownable/Ownable.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\nimport \"../AssetProxy/interfaces/IAssetProxy.sol\";\n\n\ncontract MixinAssetProxyDispatcher is\n Ownable,\n MAssetProxyDispatcher\n{\n // Mapping from Asset Proxy Id's to their respective Asset Proxy\n mapping (bytes4 => IAssetProxy) public assetProxies;\n\n /// @dev Registers an asset proxy to its asset proxy id.\n /// Once an asset proxy is registered, it cannot be unregistered.\n /// @param assetProxy Address of new asset proxy to register.\n function registerAssetProxy(address assetProxy)\n external\n onlyOwner\n {\n IAssetProxy assetProxyContract = IAssetProxy(assetProxy);\n\n // Ensure that no asset proxy exists with current id.\n bytes4 assetProxyId = assetProxyContract.getProxyId();\n address currentAssetProxy = assetProxies[assetProxyId];\n require(\n currentAssetProxy == address(0),\n \"ASSET_PROXY_ALREADY_EXISTS\"\n );\n\n // Add asset proxy and log registration.\n assetProxies[assetProxyId] = assetProxyContract;\n emit AssetProxyRegistered(\n assetProxyId,\n assetProxy\n );\n }\n\n /// @dev Gets an asset proxy.\n /// @param assetProxyId Id of the asset proxy.\n /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered.\n function getAssetProxy(bytes4 assetProxyId)\n external\n view\n returns (address)\n {\n return assetProxies[assetProxyId];\n }\n\n /// @dev Forwards arguments to assetProxy and calls `transferFrom`. Either succeeds or throws.\n /// @param assetData Byte array encoded for the asset.\n /// @param from Address to transfer token from.\n /// @param to Address to transfer token to.\n /// @param amount Amount of token to transfer.\n function dispatchTransferFrom(\n bytes memory assetData,\n address from,\n address to,\n uint256 amount\n )\n internal\n {\n // Do nothing if no amount should be transferred.\n if (amount > 0 && from != to) {\n // Ensure assetData length is valid\n require(\n assetData.length > 3,\n \"LENGTH_GREATER_THAN_3_REQUIRED\"\n );\n \n // Lookup assetProxy. We do not use `LibBytes.readBytes4` for gas efficiency reasons.\n bytes4 assetProxyId;\n assembly {\n assetProxyId := and(mload(\n add(assetData, 32)),\n 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000\n )\n }\n address assetProxy = assetProxies[assetProxyId];\n\n // Ensure that assetProxy exists\n require(\n assetProxy != address(0),\n \"ASSET_PROXY_DOES_NOT_EXIST\"\n );\n \n // We construct calldata for the `assetProxy.transferFrom` ABI.\n // The layout of this calldata is in the table below.\n // \n // | Area | Offset | Length | Contents |\n // | -------- |--------|---------|-------------------------------------------- |\n // | Header | 0 | 4 | function selector |\n // | Params | | 4 * 32 | function parameters: |\n // | | 4 | | 1. offset to assetData (*) |\n // | | 36 | | 2. from |\n // | | 68 | | 3. to |\n // | | 100 | | 4. amount |\n // | Data | | | assetData: |\n // | | 132 | 32 | assetData Length |\n // | | 164 | ** | assetData Contents |\n\n assembly {\n /////// Setup State ///////\n // `cdStart` is the start of the calldata for `assetProxy.transferFrom` (equal to free memory ptr).\n let cdStart := mload(64)\n // `dataAreaLength` is the total number of words needed to store `assetData`\n // As-per the ABI spec, this value is padded up to the nearest multiple of 32,\n // and includes 32-bytes for length.\n let dataAreaLength := and(add(mload(assetData), 63), 0xFFFFFFFFFFFE0)\n // `cdEnd` is the end of the calldata for `assetProxy.transferFrom`.\n let cdEnd := add(cdStart, add(132, dataAreaLength))\n\n \n /////// Setup Header Area ///////\n // This area holds the 4-byte `transferFromSelector`.\n // bytes4(keccak256(\"transferFrom(bytes,address,address,uint256)\")) = 0xa85e59e4\n mstore(cdStart, 0xa85e59e400000000000000000000000000000000000000000000000000000000)\n \n /////// Setup Params Area ///////\n // Each parameter is padded to 32-bytes. The entire Params Area is 128 bytes.\n // Notes:\n // 1. The offset to `assetData` is the length of the Params Area (128 bytes).\n // 2. A 20-byte mask is applied to addresses to zero-out the unused bytes.\n mstore(add(cdStart, 4), 128)\n mstore(add(cdStart, 36), and(from, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(cdStart, 68), and(to, 0xffffffffffffffffffffffffffffffffffffffff))\n mstore(add(cdStart, 100), amount)\n \n /////// Setup Data Area ///////\n // This area holds `assetData`.\n let dataArea := add(cdStart, 132)\n // solhint-disable-next-line no-empty-blocks\n for {} lt(dataArea, cdEnd) {} {\n mstore(dataArea, mload(assetData))\n dataArea := add(dataArea, 32)\n assetData := add(assetData, 32)\n }\n\n /////// Call `assetProxy.transferFrom` using the constructed calldata ///////\n let success := call(\n gas, // forward all gas\n assetProxy, // call address of asset proxy\n 0, // don't send any ETH\n cdStart, // pointer to start of input\n sub(cdEnd, cdStart), // length of input \n cdStart, // write output over input\n 512 // reserve 512 bytes for output\n )\n if iszero(success) {\n revert(cdStart, returndatasize())\n }\n }\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\n\n\ncontract MixinExchangeCore is\n ReentrancyGuard,\n LibConstants,\n LibMath,\n LibOrder,\n LibFillResults,\n MAssetProxyDispatcher,\n MExchangeCore,\n MSignatureValidator,\n MTransactions\n{\n // Mapping of orderHash => amount of takerAsset already bought by maker\n mapping (bytes32 => uint256) public filled;\n\n // Mapping of orderHash => cancelled\n mapping (bytes32 => bool) public cancelled;\n\n // Mapping of makerAddress => senderAddress => lowest salt an order can have in order to be fillable\n // Orders with specified senderAddress and with a salt less than their epoch are considered cancelled\n mapping (address => mapping (address => uint256)) public orderEpoch;\n\n /// @dev Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch\n /// and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress).\n /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled.\n function cancelOrdersUpTo(uint256 targetOrderEpoch)\n external\n nonReentrant\n {\n address makerAddress = getCurrentContextAddress();\n // If this function is called via `executeTransaction`, we only update the orderEpoch for the makerAddress/msg.sender combination.\n // This allows external filter contracts to add rules to how orders are cancelled via this function.\n address senderAddress = makerAddress == msg.sender ? address(0) : msg.sender;\n\n // orderEpoch is initialized to 0, so to cancelUpTo we need salt + 1\n uint256 newOrderEpoch = targetOrderEpoch + 1; \n uint256 oldOrderEpoch = orderEpoch[makerAddress][senderAddress];\n\n // Ensure orderEpoch is monotonically increasing\n require(\n newOrderEpoch > oldOrderEpoch, \n \"INVALID_NEW_ORDER_EPOCH\"\n );\n\n // Update orderEpoch\n orderEpoch[makerAddress][senderAddress] = newOrderEpoch;\n emit CancelUpTo(\n makerAddress,\n senderAddress,\n newOrderEpoch\n );\n }\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrder(\n Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n nonReentrant\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n return fillResults;\n }\n\n /// @dev After calling, the order can not be filled anymore.\n /// Throws if order is invalid or sender does not have permission to cancel.\n /// @param order Order to cancel. Order must be OrderStatus.FILLABLE.\n function cancelOrder(Order memory order)\n public\n nonReentrant\n {\n cancelOrderInternal(order);\n }\n\n /// @dev Gets information about an order: status, hash, and amount filled.\n /// @param order Order to gather information on.\n /// @return OrderInfo Information about the order and its state.\n /// See LibOrder.OrderInfo for a complete description.\n function getOrderInfo(Order memory order)\n public\n view\n returns (OrderInfo memory orderInfo)\n {\n // Compute the order hash\n orderInfo.orderHash = getOrderHash(order);\n\n // Fetch filled amount\n orderInfo.orderTakerAssetFilledAmount = filled[orderInfo.orderHash];\n\n // If order.makerAssetAmount is zero, we also reject the order.\n // While the Exchange contract handles them correctly, they create\n // edge cases in the supporting infrastructure because they have\n // an 'infinite' price when computed by a simple division.\n if (order.makerAssetAmount == 0) {\n orderInfo.orderStatus = uint8(OrderStatus.INVALID_MAKER_ASSET_AMOUNT);\n return orderInfo;\n }\n\n // If order.takerAssetAmount is zero, then the order will always\n // be considered filled because 0 == takerAssetAmount == orderTakerAssetFilledAmount\n // Instead of distinguishing between unfilled and filled zero taker\n // amount orders, we choose not to support them.\n if (order.takerAssetAmount == 0) {\n orderInfo.orderStatus = uint8(OrderStatus.INVALID_TAKER_ASSET_AMOUNT);\n return orderInfo;\n }\n\n // Validate order availability\n if (orderInfo.orderTakerAssetFilledAmount >= order.takerAssetAmount) {\n orderInfo.orderStatus = uint8(OrderStatus.FULLY_FILLED);\n return orderInfo;\n }\n\n // Validate order expiration\n // solhint-disable-next-line not-rely-on-time\n if (block.timestamp >= order.expirationTimeSeconds) {\n orderInfo.orderStatus = uint8(OrderStatus.EXPIRED);\n return orderInfo;\n }\n\n // Check if order has been cancelled\n if (cancelled[orderInfo.orderHash]) {\n orderInfo.orderStatus = uint8(OrderStatus.CANCELLED);\n return orderInfo;\n }\n if (orderEpoch[order.makerAddress][order.senderAddress] > order.salt) {\n orderInfo.orderStatus = uint8(OrderStatus.CANCELLED);\n return orderInfo;\n }\n\n // All other statuses are ruled out: order is Fillable\n orderInfo.orderStatus = uint8(OrderStatus.FILLABLE);\n return orderInfo;\n }\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderInternal(\n Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n // Fetch order info\n OrderInfo memory orderInfo = getOrderInfo(order);\n\n // Fetch taker address\n address takerAddress = getCurrentContextAddress();\n \n // Assert that the order is fillable by taker\n assertFillableOrder(\n order,\n orderInfo,\n takerAddress,\n signature\n );\n \n // Get amount of takerAsset to fill\n uint256 remainingTakerAssetAmount = safeSub(order.takerAssetAmount, orderInfo.orderTakerAssetFilledAmount);\n uint256 takerAssetFilledAmount = min256(takerAssetFillAmount, remainingTakerAssetAmount);\n\n // Validate context\n assertValidFill(\n order,\n orderInfo,\n takerAssetFillAmount,\n takerAssetFilledAmount,\n fillResults.makerAssetFilledAmount\n );\n\n // Compute proportional fill amounts\n fillResults = calculateFillResults(order, takerAssetFilledAmount);\n\n // Update exchange internal state\n updateFilledState(\n order,\n takerAddress,\n orderInfo.orderHash,\n orderInfo.orderTakerAssetFilledAmount,\n fillResults\n );\n \n // Settle order\n settleOrder(\n order,\n takerAddress,\n fillResults\n );\n\n return fillResults;\n }\n\n /// @dev After calling, the order can not be filled anymore.\n /// Throws if order is invalid or sender does not have permission to cancel.\n /// @param order Order to cancel. Order must be OrderStatus.FILLABLE.\n function cancelOrderInternal(Order memory order)\n internal\n {\n // Fetch current order status\n OrderInfo memory orderInfo = getOrderInfo(order);\n\n // Validate context\n assertValidCancel(order, orderInfo);\n\n // Perform cancel\n updateCancelledState(order, orderInfo.orderHash);\n }\n\n /// @dev Updates state with results of a fill order.\n /// @param order that was filled.\n /// @param takerAddress Address of taker who filled the order.\n /// @param orderTakerAssetFilledAmount Amount of order already filled.\n function updateFilledState(\n Order memory order,\n address takerAddress,\n bytes32 orderHash,\n uint256 orderTakerAssetFilledAmount,\n FillResults memory fillResults\n )\n internal\n {\n // Update state\n filled[orderHash] = safeAdd(orderTakerAssetFilledAmount, fillResults.takerAssetFilledAmount);\n\n // Log order\n emit Fill(\n order.makerAddress,\n order.feeRecipientAddress,\n takerAddress,\n msg.sender,\n fillResults.makerAssetFilledAmount,\n fillResults.takerAssetFilledAmount,\n fillResults.makerFeePaid,\n fillResults.takerFeePaid,\n orderHash,\n order.makerAssetData,\n order.takerAssetData\n );\n }\n\n /// @dev Updates state with results of cancelling an order.\n /// State is only updated if the order is currently fillable.\n /// Otherwise, updating state would have no effect.\n /// @param order that was cancelled.\n /// @param orderHash Hash of order that was cancelled.\n function updateCancelledState(\n Order memory order,\n bytes32 orderHash\n )\n internal\n {\n // Perform cancel\n cancelled[orderHash] = true;\n\n // Log cancel\n emit Cancel(\n order.makerAddress,\n order.feeRecipientAddress,\n msg.sender,\n orderHash,\n order.makerAssetData,\n order.takerAssetData\n );\n }\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAddress Address of order taker.\n /// @param signature Proof that the orders was created by its maker.\n function assertFillableOrder(\n Order memory order,\n OrderInfo memory orderInfo,\n address takerAddress,\n bytes memory signature\n )\n internal\n view\n {\n // An order can only be filled if its status is FILLABLE.\n require(\n orderInfo.orderStatus == uint8(OrderStatus.FILLABLE),\n \"ORDER_UNFILLABLE\"\n );\n \n // Validate sender is allowed to fill this order\n if (order.senderAddress != address(0)) {\n require(\n order.senderAddress == msg.sender,\n \"INVALID_SENDER\"\n );\n }\n \n // Validate taker is allowed to fill this order\n if (order.takerAddress != address(0)) {\n require(\n order.takerAddress == takerAddress,\n \"INVALID_TAKER\"\n );\n }\n \n // Validate Maker signature (check only if first time seen)\n if (orderInfo.orderTakerAssetFilledAmount == 0) {\n require(\n isValidSignature(\n orderInfo.orderHash,\n order.makerAddress,\n signature\n ),\n \"INVALID_ORDER_SIGNATURE\"\n );\n }\n }\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAssetFillAmount Desired amount of order to fill by taker.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @param makerAssetFilledAmount Amount of makerAsset that will be transfered.\n function assertValidFill(\n Order memory order,\n OrderInfo memory orderInfo,\n uint256 takerAssetFillAmount, // TODO: use FillResults\n uint256 takerAssetFilledAmount,\n uint256 makerAssetFilledAmount\n )\n internal\n view\n {\n // Revert if fill amount is invalid\n // TODO: reconsider necessity for v2.1\n require(\n takerAssetFillAmount != 0,\n \"INVALID_TAKER_AMOUNT\"\n );\n \n // Make sure taker does not pay more than desired amount\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n takerAssetFilledAmount <= takerAssetFillAmount,\n \"TAKER_OVERPAY\"\n );\n \n // Make sure order is not overfilled\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n safeAdd(orderInfo.orderTakerAssetFilledAmount, takerAssetFilledAmount) <= order.takerAssetAmount,\n \"ORDER_OVERFILL\"\n );\n \n // Make sure order is filled at acceptable price.\n // The order has an implied price from the makers perspective:\n // order price = order.makerAssetAmount / order.takerAssetAmount\n // i.e. the number of makerAsset maker is paying per takerAsset. The\n // maker is guaranteed to get this price or a better (lower) one. The\n // actual price maker is getting in this fill is:\n // fill price = makerAssetFilledAmount / takerAssetFilledAmount\n // We need `fill price <= order price` for the fill to be fair to maker.\n // This amounts to:\n // makerAssetFilledAmount order.makerAssetAmount\n // ------------------------ <= -----------------------\n // takerAssetFilledAmount order.takerAssetAmount\n // or, equivalently:\n // makerAssetFilledAmount * order.takerAssetAmount <=\n // order.makerAssetAmount * takerAssetFilledAmount\n // NOTE: This assertion should never fail, it is here\n // as an extra defence against potential bugs.\n require(\n safeMul(makerAssetFilledAmount, order.takerAssetAmount)\n <= \n safeMul(order.makerAssetAmount, takerAssetFilledAmount),\n \"INVALID_FILL_PRICE\"\n );\n }\n\n /// @dev Validates context for cancelOrder. Succeeds or throws.\n /// @param order to be cancelled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n function assertValidCancel(\n Order memory order,\n OrderInfo memory orderInfo\n )\n internal\n view\n {\n // Ensure order is valid\n // An order can only be cancelled if its status is FILLABLE.\n require(\n orderInfo.orderStatus == uint8(OrderStatus.FILLABLE),\n \"ORDER_UNFILLABLE\"\n );\n\n // Validate sender is allowed to cancel this order\n if (order.senderAddress != address(0)) {\n require(\n order.senderAddress == msg.sender,\n \"INVALID_SENDER\"\n );\n }\n\n // Validate transaction signed by maker\n address makerAddress = getCurrentContextAddress();\n require(\n order.makerAddress == makerAddress,\n \"INVALID_MAKER\"\n );\n }\n\n /// @dev Calculates amounts filled and fees paid by maker and taker.\n /// @param order to be filled.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function calculateFillResults(\n Order memory order,\n uint256 takerAssetFilledAmount\n )\n internal\n pure\n returns (FillResults memory fillResults)\n {\n // Compute proportional transfer amounts\n fillResults.takerAssetFilledAmount = takerAssetFilledAmount;\n fillResults.makerAssetFilledAmount = safeGetPartialAmountFloor(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.makerAssetAmount\n );\n fillResults.makerFeePaid = safeGetPartialAmountFloor(\n fillResults.makerAssetFilledAmount,\n order.makerAssetAmount,\n order.makerFee\n );\n fillResults.takerFeePaid = safeGetPartialAmountFloor(\n takerAssetFilledAmount,\n order.takerAssetAmount,\n order.takerFee\n );\n\n return fillResults;\n }\n\n /// @dev Settles an order by transferring assets between counterparties.\n /// @param order Order struct containing order specifications.\n /// @param takerAddress Address selling takerAsset and buying makerAsset.\n /// @param fillResults Amounts to be filled and fees paid by maker and taker.\n function settleOrder(\n LibOrder.Order memory order,\n address takerAddress,\n LibFillResults.FillResults memory fillResults\n )\n private\n {\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n dispatchTransferFrom(\n order.makerAssetData,\n order.makerAddress,\n takerAddress,\n fillResults.makerAssetFilledAmount\n );\n dispatchTransferFrom(\n order.takerAssetData,\n takerAddress,\n order.makerAddress,\n fillResults.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n zrxAssetData,\n order.makerAddress,\n order.feeRecipientAddress,\n fillResults.makerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n order.feeRecipientAddress,\n fillResults.takerFeePaid\n );\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinMatchOrders.sol": "/*\n Copyright 2018 ZeroEx Intl.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n http://www.apache.org/licenses/LICENSE-2.0\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibConstants.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MMatchOrders.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./mixins/MAssetProxyDispatcher.sol\";\n\n\ncontract MixinMatchOrders is\n ReentrancyGuard,\n LibConstants,\n LibMath,\n MAssetProxyDispatcher,\n MExchangeCore,\n MMatchOrders,\n MTransactions\n{\n /// @dev Match two complementary orders that have a profitable spread.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the left order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftSignature Proof that order was created by the left maker.\n /// @param rightSignature Proof that order was created by the right maker.\n /// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.\n function matchOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n bytes memory leftSignature,\n bytes memory rightSignature\n )\n public\n nonReentrant\n returns (LibFillResults.MatchedFillResults memory matchedFillResults)\n {\n // We assume that rightOrder.takerAssetData == leftOrder.makerAssetData and rightOrder.makerAssetData == leftOrder.takerAssetData.\n // If this assumption isn't true, the match will fail at signature validation.\n rightOrder.makerAssetData = leftOrder.takerAssetData;\n rightOrder.takerAssetData = leftOrder.makerAssetData;\n\n // Get left & right order info\n LibOrder.OrderInfo memory leftOrderInfo = getOrderInfo(leftOrder);\n LibOrder.OrderInfo memory rightOrderInfo = getOrderInfo(rightOrder);\n\n // Fetch taker address\n address takerAddress = getCurrentContextAddress();\n \n // Either our context is valid or we revert\n assertFillableOrder(\n leftOrder,\n leftOrderInfo,\n takerAddress,\n leftSignature\n );\n assertFillableOrder(\n rightOrder,\n rightOrderInfo,\n takerAddress,\n rightSignature\n );\n assertValidMatch(leftOrder, rightOrder);\n\n // Compute proportional fill amounts\n matchedFillResults = calculateMatchedFillResults(\n leftOrder,\n rightOrder,\n leftOrderInfo.orderTakerAssetFilledAmount,\n rightOrderInfo.orderTakerAssetFilledAmount\n );\n\n // Validate fill contexts\n assertValidFill(\n leftOrder,\n leftOrderInfo,\n matchedFillResults.left.takerAssetFilledAmount,\n matchedFillResults.left.takerAssetFilledAmount,\n matchedFillResults.left.makerAssetFilledAmount\n );\n assertValidFill(\n rightOrder,\n rightOrderInfo,\n matchedFillResults.right.takerAssetFilledAmount,\n matchedFillResults.right.takerAssetFilledAmount,\n matchedFillResults.right.makerAssetFilledAmount\n );\n \n // Update exchange state\n updateFilledState(\n leftOrder,\n takerAddress,\n leftOrderInfo.orderHash,\n leftOrderInfo.orderTakerAssetFilledAmount,\n matchedFillResults.left\n );\n updateFilledState(\n rightOrder,\n takerAddress,\n rightOrderInfo.orderHash,\n rightOrderInfo.orderTakerAssetFilledAmount,\n matchedFillResults.right\n );\n\n // Settle matched orders. Succeeds or throws.\n settleMatchedOrders(\n leftOrder,\n rightOrder,\n takerAddress,\n matchedFillResults\n );\n\n return matchedFillResults;\n }\n\n /// @dev Validates context for matchOrders. Succeeds or throws.\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n function assertValidMatch(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder\n )\n internal\n pure\n {\n // Make sure there is a profitable spread.\n // There is a profitable spread iff the cost per unit bought (OrderA.MakerAmount/OrderA.TakerAmount) for each order is greater\n // than the profit per unit sold of the matched order (OrderB.TakerAmount/OrderB.MakerAmount).\n // This is satisfied by the equations below:\n // <leftOrder.makerAssetAmount> / <leftOrder.takerAssetAmount> >= <rightOrder.takerAssetAmount> / <rightOrder.makerAssetAmount>\n // AND\n // <rightOrder.makerAssetAmount> / <rightOrder.takerAssetAmount> >= <leftOrder.takerAssetAmount> / <leftOrder.makerAssetAmount>\n // These equations can be combined to get the following:\n require(\n safeMul(leftOrder.makerAssetAmount, rightOrder.makerAssetAmount) >=\n safeMul(leftOrder.takerAssetAmount, rightOrder.takerAssetAmount),\n \"NEGATIVE_SPREAD_REQUIRED\"\n );\n }\n\n /// @dev Calculates fill amounts for the matched orders.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the leftOrder order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftOrderTakerAssetFilledAmount Amount of left order already filled.\n /// @param rightOrderTakerAssetFilledAmount Amount of right order already filled.\n /// @param matchedFillResults Amounts to fill and fees to pay by maker and taker of matched orders.\n function calculateMatchedFillResults(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n uint256 leftOrderTakerAssetFilledAmount,\n uint256 rightOrderTakerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.MatchedFillResults memory matchedFillResults)\n {\n // Derive maker asset amounts for left & right orders, given store taker assert amounts\n uint256 leftTakerAssetAmountRemaining = safeSub(leftOrder.takerAssetAmount, leftOrderTakerAssetFilledAmount);\n uint256 leftMakerAssetAmountRemaining = safeGetPartialAmountFloor(\n leftOrder.makerAssetAmount,\n leftOrder.takerAssetAmount,\n leftTakerAssetAmountRemaining\n );\n uint256 rightTakerAssetAmountRemaining = safeSub(rightOrder.takerAssetAmount, rightOrderTakerAssetFilledAmount);\n uint256 rightMakerAssetAmountRemaining = safeGetPartialAmountFloor(\n rightOrder.makerAssetAmount,\n rightOrder.takerAssetAmount,\n rightTakerAssetAmountRemaining\n );\n\n // Calculate fill results for maker and taker assets: at least one order will be fully filled.\n // The maximum amount the left maker can buy is `leftTakerAssetAmountRemaining`\n // The maximum amount the right maker can sell is `rightMakerAssetAmountRemaining`\n // We have two distinct cases for calculating the fill results:\n // Case 1.\n // If the left maker can buy more than the right maker can sell, then only the right order is fully filled.\n // If the left maker can buy exactly what the right maker can sell, then both orders are fully filled.\n // Case 2.\n // If the left maker cannot buy more than the right maker can sell, then only the left order is fully filled.\n if (leftTakerAssetAmountRemaining >= rightMakerAssetAmountRemaining) {\n // Case 1: Right order is fully filled\n matchedFillResults.right.makerAssetFilledAmount = rightMakerAssetAmountRemaining;\n matchedFillResults.right.takerAssetFilledAmount = rightTakerAssetAmountRemaining;\n matchedFillResults.left.takerAssetFilledAmount = matchedFillResults.right.makerAssetFilledAmount;\n // Round down to ensure the maker's exchange rate does not exceed the price specified by the order. \n // We favor the maker when the exchange rate must be rounded.\n matchedFillResults.left.makerAssetFilledAmount = safeGetPartialAmountFloor(\n leftOrder.makerAssetAmount,\n leftOrder.takerAssetAmount,\n matchedFillResults.left.takerAssetFilledAmount\n );\n } else {\n // Case 2: Left order is fully filled\n matchedFillResults.left.makerAssetFilledAmount = leftMakerAssetAmountRemaining;\n matchedFillResults.left.takerAssetFilledAmount = leftTakerAssetAmountRemaining;\n matchedFillResults.right.makerAssetFilledAmount = matchedFillResults.left.takerAssetFilledAmount;\n // Round up to ensure the maker's exchange rate does not exceed the price specified by the order.\n // We favor the maker when the exchange rate must be rounded.\n matchedFillResults.right.takerAssetFilledAmount = safeGetPartialAmountCeil(\n rightOrder.takerAssetAmount,\n rightOrder.makerAssetAmount,\n matchedFillResults.right.makerAssetFilledAmount\n );\n }\n\n // Calculate amount given to taker\n matchedFillResults.leftMakerAssetSpreadAmount = safeSub(\n matchedFillResults.left.makerAssetFilledAmount,\n matchedFillResults.right.takerAssetFilledAmount\n );\n\n // Compute fees for left order\n matchedFillResults.left.makerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.left.makerAssetFilledAmount,\n leftOrder.makerAssetAmount,\n leftOrder.makerFee\n );\n matchedFillResults.left.takerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.left.takerAssetFilledAmount,\n leftOrder.takerAssetAmount,\n leftOrder.takerFee\n );\n\n // Compute fees for right order\n matchedFillResults.right.makerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.right.makerAssetFilledAmount,\n rightOrder.makerAssetAmount,\n rightOrder.makerFee\n );\n matchedFillResults.right.takerFeePaid = safeGetPartialAmountFloor(\n matchedFillResults.right.takerAssetFilledAmount,\n rightOrder.takerAssetAmount,\n rightOrder.takerFee\n );\n\n // Return fill results\n return matchedFillResults;\n }\n\n /// @dev Settles matched order by transferring appropriate funds between order makers, taker, and fee recipient.\n /// @param leftOrder First matched order.\n /// @param rightOrder Second matched order.\n /// @param takerAddress Address that matched the orders. The taker receives the spread between orders as profit.\n /// @param matchedFillResults Struct holding amounts to transfer between makers, taker, and fee recipients.\n function settleMatchedOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n address takerAddress,\n LibFillResults.MatchedFillResults memory matchedFillResults\n )\n private\n {\n bytes memory zrxAssetData = ZRX_ASSET_DATA;\n // Order makers and taker\n dispatchTransferFrom(\n leftOrder.makerAssetData,\n leftOrder.makerAddress,\n rightOrder.makerAddress,\n matchedFillResults.right.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n rightOrder.makerAssetData,\n rightOrder.makerAddress,\n leftOrder.makerAddress,\n matchedFillResults.left.takerAssetFilledAmount\n );\n dispatchTransferFrom(\n leftOrder.makerAssetData,\n leftOrder.makerAddress,\n takerAddress,\n matchedFillResults.leftMakerAssetSpreadAmount\n );\n\n // Maker fees\n dispatchTransferFrom(\n zrxAssetData,\n leftOrder.makerAddress,\n leftOrder.feeRecipientAddress,\n matchedFillResults.left.makerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n rightOrder.makerAddress,\n rightOrder.feeRecipientAddress,\n matchedFillResults.right.makerFeePaid\n );\n\n // Taker fees\n if (leftOrder.feeRecipientAddress == rightOrder.feeRecipientAddress) {\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n leftOrder.feeRecipientAddress,\n safeAdd(\n matchedFillResults.left.takerFeePaid,\n matchedFillResults.right.takerFeePaid\n )\n );\n } else {\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n leftOrder.feeRecipientAddress,\n matchedFillResults.left.takerFeePaid\n );\n dispatchTransferFrom(\n zrxAssetData,\n takerAddress,\n rightOrder.feeRecipientAddress,\n matchedFillResults.right.takerFeePaid\n );\n }\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinSignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../utils/LibBytes/LibBytes.sol\";\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./interfaces/IWallet.sol\";\nimport \"./interfaces/IValidator.sol\";\n\n\ncontract MixinSignatureValidator is\n ReentrancyGuard,\n MSignatureValidator,\n MTransactions\n{\n using LibBytes for bytes;\n \n // Mapping of hash => signer => signed\n mapping (bytes32 => mapping (address => bool)) public preSigned;\n\n // Mapping of signer => validator => approved\n mapping (address => mapping (address => bool)) public allowedValidators;\n\n /// @dev Approves a hash on-chain using any valid signature type.\n /// After presigning a hash, the preSign signature type will become valid for that hash and signer.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n function preSign(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external\n {\n if (signerAddress != msg.sender) {\n require(\n isValidSignature(\n hash,\n signerAddress,\n signature\n ),\n \"INVALID_SIGNATURE\"\n );\n }\n preSigned[hash][signerAddress] = true;\n }\n\n /// @dev Approves/unnapproves a Validator contract to verify signatures on signer's behalf.\n /// @param validatorAddress Address of Validator contract.\n /// @param approval Approval or disapproval of Validator contract.\n function setSignatureValidatorApproval(\n address validatorAddress,\n bool approval\n )\n external\n nonReentrant\n {\n address signerAddress = getCurrentContextAddress();\n allowedValidators[signerAddress][validatorAddress] = approval;\n emit SignatureValidatorApproval(\n signerAddress,\n validatorAddress,\n approval\n );\n }\n\n /// @dev Verifies that a hash has been signed by the given signer.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes memory signature\n )\n public\n view\n returns (bool isValid)\n {\n require(\n signature.length > 0,\n \"LENGTH_GREATER_THAN_0_REQUIRED\"\n );\n\n // Pop last byte off of signature byte array.\n uint8 signatureTypeRaw = uint8(signature.popLastByte());\n\n // Ensure signature is supported\n require(\n signatureTypeRaw < uint8(SignatureType.NSignatureTypes),\n \"SIGNATURE_UNSUPPORTED\"\n );\n\n SignatureType signatureType = SignatureType(signatureTypeRaw);\n\n // Variables are not scoped in Solidity.\n uint8 v;\n bytes32 r;\n bytes32 s;\n address recovered;\n\n // Always illegal signature.\n // This is always an implicit option since a signer can create a\n // signature array with invalid type or length. We may as well make\n // it an explicit option. This aids testing and analysis. It is\n // also the initialization value for the enum type.\n if (signatureType == SignatureType.Illegal) {\n revert(\"SIGNATURE_ILLEGAL\");\n\n // Always invalid signature.\n // Like Illegal, this is always implicitly available and therefore\n // offered explicitly. It can be implicitly created by providing\n // a correctly formatted but incorrect signature.\n } else if (signatureType == SignatureType.Invalid) {\n require(\n signature.length == 0,\n \"LENGTH_0_REQUIRED\"\n );\n isValid = false;\n return isValid;\n\n // Signature using EIP712\n } else if (signatureType == SignatureType.EIP712) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n hash,\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n\n // Signed using web3.eth_sign\n } else if (signatureType == SignatureType.EthSign) {\n require(\n signature.length == 65,\n \"LENGTH_65_REQUIRED\"\n );\n v = uint8(signature[0]);\n r = signature.readBytes32(1);\n s = signature.readBytes32(33);\n recovered = ecrecover(\n keccak256(abi.encodePacked(\n \"\\x19Ethereum Signed Message:\\n32\",\n hash\n )),\n v,\n r,\n s\n );\n isValid = signerAddress == recovered;\n return isValid;\n\n // Signature verified by wallet contract.\n // If used with an order, the maker of the order is the wallet contract.\n } else if (signatureType == SignatureType.Wallet) {\n isValid = isValidWalletSignature(\n hash,\n signerAddress,\n signature\n );\n return isValid;\n\n // Signature verified by validator contract.\n // If used with an order, the maker of the order can still be an EOA.\n // A signature using this type should be encoded as:\n // | Offset | Length | Contents |\n // | 0x00 | x | Signature to validate |\n // | 0x00 + x | 20 | Address of validator contract |\n // | 0x14 + x | 1 | Signature type is always \"\\x06\" |\n } else if (signatureType == SignatureType.Validator) {\n // Pop last 20 bytes off of signature byte array.\n address validatorAddress = signature.popLast20Bytes();\n \n // Ensure signer has approved validator.\n if (!allowedValidators[signerAddress][validatorAddress]) {\n return false;\n }\n isValid = isValidValidatorSignature(\n validatorAddress,\n hash,\n signerAddress,\n signature\n );\n return isValid;\n\n // Signer signed hash previously using the preSign function.\n } else if (signatureType == SignatureType.PreSigned) {\n isValid = preSigned[hash][signerAddress];\n return isValid;\n }\n\n // Anything else is illegal (We do not return false because\n // the signature may actually be valid, just not in a format\n // that we currently support. In this case returning false\n // may lead the caller to incorrectly believe that the\n // signature was invalid.)\n revert(\"SIGNATURE_UNSUPPORTED\");\n }\n\n /// @dev Verifies signature using logic defined by Wallet contract.\n /// @param hash Any 32 byte hash.\n /// @param walletAddress Address that should have signed the given hash\n /// and defines its own signature verification method.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if signature is valid for given wallet..\n function isValidWalletSignature(\n bytes32 hash,\n address walletAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid)\n {\n bytes memory calldata = abi.encodeWithSelector(\n IWallet(walletAddress).isValidSignature.selector,\n hash,\n signature\n );\n assembly {\n let cdStart := add(calldata, 32)\n let success := staticcall(\n gas, // forward all gas\n walletAddress, // address of Wallet contract\n cdStart, // pointer to start of input\n mload(calldata), // length of input\n cdStart, // write output over input\n 32 // output size is 32 bytes\n )\n\n switch success\n case 0 {\n // Revert with `Error(\"WALLET_ERROR\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000c57414c4c45545f4552524f5200000000000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n case 1 {\n // Signature is valid if call did not revert and returned true\n isValid := mload(cdStart)\n }\n }\n return isValid;\n }\n\n /// @dev Verifies signature using logic defined by Validator contract.\n /// @param validatorAddress Address of validator contract.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidValidatorSignature(\n address validatorAddress,\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid)\n {\n bytes memory calldata = abi.encodeWithSelector(\n IValidator(signerAddress).isValidSignature.selector,\n hash,\n signerAddress,\n signature\n );\n assembly {\n let cdStart := add(calldata, 32)\n let success := staticcall(\n gas, // forward all gas\n validatorAddress, // address of Validator contract\n cdStart, // pointer to start of input\n mload(calldata), // length of input\n cdStart, // write output over input\n 32 // output size is 32 bytes\n )\n\n switch success\n case 0 {\n // Revert with `Error(\"VALIDATOR_ERROR\")`\n mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)\n mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)\n mstore(64, 0x0000000f56414c494441544f525f4552524f5200000000000000000000000000)\n mstore(96, 0)\n revert(0, 100)\n }\n case 1 {\n // Signature is valid if call did not revert and returned true\n isValid := mload(cdStart)\n }\n }\n return isValid;\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinTransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\nimport \"./libs/LibExchangeErrors.sol\";\nimport \"./mixins/MSignatureValidator.sol\";\nimport \"./mixins/MTransactions.sol\";\nimport \"./libs/LibEIP712.sol\";\n\n\ncontract MixinTransactions is\n LibEIP712,\n MSignatureValidator,\n MTransactions\n{\n // Mapping of transaction hash => executed\n // This prevents transactions from being executed more than once.\n mapping (bytes32 => bool) public transactions;\n\n // Address of current transaction signer\n address public currentContextAddress;\n\n /// @dev Executes an exchange method call in the context of signer.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @param signature Proof of signer transaction by signer.\n function executeTransaction(\n uint256 salt,\n address signerAddress,\n bytes data,\n bytes signature\n )\n external\n {\n // Prevent reentrancy\n require(\n currentContextAddress == address(0),\n \"REENTRANCY_ILLEGAL\"\n );\n\n bytes32 transactionHash = hashEIP712Message(hashZeroExTransaction(\n salt,\n signerAddress,\n data\n ));\n\n // Validate transaction has not been executed\n require(\n !transactions[transactionHash],\n \"INVALID_TX_HASH\"\n );\n\n // Transaction always valid if signer is sender of transaction\n if (signerAddress != msg.sender) {\n // Validate signature\n require(\n isValidSignature(\n transactionHash,\n signerAddress,\n signature\n ),\n \"INVALID_TX_SIGNATURE\"\n );\n\n // Set the current transaction signer\n currentContextAddress = signerAddress;\n }\n\n // Execute transaction\n transactions[transactionHash] = true;\n require(\n address(this).delegatecall(data),\n \"FAILED_EXECUTION\"\n );\n\n // Reset current transaction signer if it was previously updated\n if (signerAddress != msg.sender) {\n currentContextAddress = address(0);\n }\n }\n\n /// @dev Calculates EIP712 hash of the Transaction.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @return EIP712 hash of the Transaction.\n function hashZeroExTransaction(\n uint256 salt,\n address signerAddress,\n bytes memory data\n )\n internal\n pure\n returns (bytes32 result)\n {\n bytes32 schemaHash = EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH;\n bytes32 dataHash = keccak256(data);\n\n // Assembly for more efficiently computing:\n // keccak256(abi.encodePacked(\n // EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH,\n // salt,\n // bytes32(signerAddress),\n // keccak256(data)\n // ));\n\n assembly {\n // Load free memory pointer\n let memPtr := mload(64)\n\n mstore(memPtr, schemaHash) // hash of schema\n mstore(add(memPtr, 32), salt) // salt\n mstore(add(memPtr, 64), and(signerAddress, 0xffffffffffffffffffffffffffffffffffffffff)) // signerAddress\n mstore(add(memPtr, 96), dataHash) // hash of data\n\n // Compute hash\n result := keccak256(memPtr, 128)\n }\n return result;\n }\n\n /// @dev The current function will be called in the context of this address (either 0x transaction signer or `msg.sender`).\n /// If calling a fill function, this address will represent the taker.\n /// If calling a cancel function, this address will represent the maker.\n /// @return Signer of 0x transaction if entry point is `executeTransaction`.\n /// `msg.sender` if entry point is any other function.\n function getCurrentContextAddress()\n internal\n view\n returns (address)\n {\n address currentContextAddress_ = currentContextAddress;\n address contextAddress = currentContextAddress_ == address(0) ? msg.sender : currentContextAddress_;\n return contextAddress;\n }\n}\n",
- "2.0.0/protocol/Exchange/MixinWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../utils/ReentrancyGuard/ReentrancyGuard.sol\";\nimport \"./libs/LibMath.sol\";\nimport \"./libs/LibOrder.sol\";\nimport \"./libs/LibFillResults.sol\";\nimport \"./libs/LibAbiEncoder.sol\";\nimport \"./mixins/MExchangeCore.sol\";\nimport \"./mixins/MWrapperFunctions.sol\";\n\n\ncontract MixinWrapperFunctions is\n ReentrancyGuard,\n LibMath,\n LibFillResults,\n LibAbiEncoder,\n MExchangeCore,\n MWrapperFunctions\n{\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n nonReentrant\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrKillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n return fillResults;\n }\n\n /// @dev Fills the input order.\n /// Returns false if the transaction would otherwise revert.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (FillResults memory fillResults)\n {\n // ABI encode calldata for `fillOrder`\n bytes memory fillOrderCalldata = abiEncodeFillOrder(\n order,\n takerAssetFillAmount,\n signature\n );\n\n // Delegate to `fillOrder` and handle any exceptions gracefully\n assembly {\n let success := delegatecall(\n gas, // forward all gas\n address, // call address of this contract\n add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes)\n mload(fillOrderCalldata), // length of input\n fillOrderCalldata, // write output over input\n 128 // output size is 128 bytes\n )\n if success {\n mstore(fillResults, mload(fillOrderCalldata))\n mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32)))\n mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64)))\n mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96)))\n }\n }\n // fillResults values will be 0 by default if call was unsuccessful\n return fillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrKill.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrKillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrKillOrderInternal(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n /// NOTE: makerAssetFilledAmount and takerAssetFilledAmount may include amounts filled of different assets.\n function batchFillOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n takerAssetFillAmounts[i],\n signatures[i]\n );\n addFillResults(totalFillResults, singleFillResults);\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrders(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n bytes memory takerAssetData = orders[0].takerAssetData;\n \n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being sold by taker is the same for each order.\n // Rather than passing this in as calldata, we use the takerAssetData from the first order in all later orders.\n orders[i].takerAssetData = takerAssetData;\n\n // Calculate the remaining amount of takerAsset to sell\n uint256 remainingTakerAssetFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= takerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory takerAssetData = orders[0].takerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being sold by taker is the same for each order.\n // Rather than passing this in as calldata, we use the takerAssetData from the first order in all later orders.\n orders[i].takerAssetData = takerAssetData;\n\n // Calculate the remaining amount of takerAsset to sell\n uint256 remainingTakerAssetFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount);\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of takerAsset has been sold\n if (totalFillResults.takerAssetFilledAmount >= takerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerAsset is bought by taker.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrders(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n nonReentrant\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // Rather than passing this in as calldata, we copy the makerAssetData from the first order onto all later orders.\n orders[i].makerAssetData = makerAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderInternal(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n if (totalFillResults.makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (FillResults memory totalFillResults)\n {\n bytes memory makerAssetData = orders[0].makerAssetData;\n\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n\n // We assume that asset being bought by taker is the same for each order.\n // Rather than passing this in as calldata, we copy the makerAssetData from the first order onto all later orders.\n orders[i].makerAssetData = makerAssetData;\n\n // Calculate the remaining amount of makerAsset to buy\n uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);\n\n // Convert the remaining amount of makerAsset to buy into remaining amount\n // of takerAsset to sell, assuming entire amount can be sold in the current order\n uint256 remainingTakerAssetFillAmount = getPartialAmountFloor(\n orders[i].takerAssetAmount,\n orders[i].makerAssetAmount,\n remainingMakerAssetFillAmount\n );\n\n // Attempt to sell the remaining amount of takerAsset\n FillResults memory singleFillResults = fillOrderNoThrow(\n orders[i],\n remainingTakerAssetFillAmount,\n signatures[i]\n );\n\n // Update amounts filled and fees paid by maker and taker\n addFillResults(totalFillResults, singleFillResults);\n\n // Stop execution if the entire amount of makerAsset has been bought\n if (totalFillResults.makerAssetFilledAmount >= makerAssetFillAmount) {\n break;\n }\n }\n return totalFillResults;\n }\n\n /// @dev Synchronously cancels multiple orders in a single transaction.\n /// @param orders Array of order specifications.\n function batchCancelOrders(LibOrder.Order[] memory orders)\n public\n nonReentrant\n {\n uint256 ordersLength = orders.length;\n for (uint256 i = 0; i != ordersLength; i++) {\n cancelOrderInternal(orders[i]);\n }\n }\n\n /// @dev Fetches information for all passed in orders.\n /// @param orders Array of order specifications.\n /// @return Array of OrderInfo instances that correspond to each order.\n function getOrdersInfo(LibOrder.Order[] memory orders)\n public\n view\n returns (LibOrder.OrderInfo[] memory)\n {\n uint256 ordersLength = orders.length;\n LibOrder.OrderInfo[] memory ordersInfo = new LibOrder.OrderInfo[](ordersLength);\n for (uint256 i = 0; i != ordersLength; i++) {\n ordersInfo[i] = getOrderInfo(orders[i]);\n }\n return ordersInfo;\n }\n\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (FillResults memory fillResults)\n {\n fillResults = fillOrderInternal(\n order,\n takerAssetFillAmount,\n signature\n );\n require(\n fillResults.takerAssetFilledAmount == takerAssetFillAmount,\n \"COMPLETE_FILL_FAILED\"\n );\n return fillResults;\n }\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IAssetProxyDispatcher {\n\n /// @dev Registers an asset proxy to its asset proxy id.\n /// Once an asset proxy is registered, it cannot be unregistered.\n /// @param assetProxy Address of new asset proxy to register.\n function registerAssetProxy(address assetProxy)\n external;\n\n /// @dev Gets an asset proxy.\n /// @param assetProxyId Id of the asset proxy.\n /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered.\n function getAssetProxy(bytes4 assetProxyId)\n external\n view\n returns (address);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IExchange.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./IExchangeCore.sol\";\nimport \"./IMatchOrders.sol\";\nimport \"./ISignatureValidator.sol\";\nimport \"./ITransactions.sol\";\nimport \"./IAssetProxyDispatcher.sol\";\nimport \"./IWrapperFunctions.sol\";\n\n\n// solhint-disable no-empty-blocks\ncontract IExchange is\n IExchangeCore,\n IMatchOrders,\n ISignatureValidator,\n ITransactions,\n IAssetProxyDispatcher,\n IWrapperFunctions\n{}\n",
- "2.0.0/protocol/Exchange/interfaces/IExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IExchangeCore {\n\n /// @dev Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch\n /// and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress).\n /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled.\n function cancelOrdersUpTo(uint256 targetOrderEpoch)\n external;\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev After calling, the order can not be filled anymore.\n /// @param order Order struct containing order specifications.\n function cancelOrder(LibOrder.Order memory order)\n public;\n\n /// @dev Gets information about an order: status, hash, and amount filled.\n /// @param order Order to gather information on.\n /// @return OrderInfo Information about the order and its state.\n /// See LibOrder.OrderInfo for a complete description.\n function getOrderInfo(LibOrder.Order memory order)\n public\n view\n returns (LibOrder.OrderInfo memory orderInfo);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IMatchOrders.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IMatchOrders {\n\n /// @dev Match two complementary orders that have a profitable spread.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the left order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftSignature Proof that order was created by the left maker.\n /// @param rightSignature Proof that order was created by the right maker.\n /// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.\n function matchOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n bytes memory leftSignature,\n bytes memory rightSignature\n )\n public\n returns (LibFillResults.MatchedFillResults memory matchedFillResults);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/ISignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract ISignatureValidator {\n\n /// @dev Approves a hash on-chain using any valid signature type.\n /// After presigning a hash, the preSign signature type will become valid for that hash and signer.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n function preSign(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external;\n \n /// @dev Approves/unnapproves a Validator contract to verify signatures on signer's behalf.\n /// @param validatorAddress Address of Validator contract.\n /// @param approval Approval or disapproval of Validator contract.\n function setSignatureValidatorApproval(\n address validatorAddress,\n bool approval\n )\n external;\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signerAddress Address of signer.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes memory signature\n )\n public\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/ITransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\n\ncontract ITransactions {\n\n /// @dev Executes an exchange method call in the context of signer.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @param signature Proof of signer transaction by signer.\n function executeTransaction(\n uint256 salt,\n address signerAddress,\n bytes data,\n bytes signature\n )\n external;\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IValidator {\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n external\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IWallet.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IWallet {\n\n /// @dev Verifies that a signature is valid.\n /// @param hash Message hash that is signed.\n /// @param signature Proof of signing.\n /// @return Validity of order signature.\n function isValidSignature(\n bytes32 hash,\n bytes signature\n )\n external\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\n\n\ncontract IWrapperFunctions {\n\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderNoThrow(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n public\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrKill.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrKillOrders(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Fills an order with specified parameters and ECDSA signature.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function batchFillOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256[] memory takerAssetFillAmounts,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been created by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrders(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketSellOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 takerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerAsset is bought by taker.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrders(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.\n /// Returns false if the transaction would otherwise revert.\n /// @param orders Array of order specifications.\n /// @param makerAssetFillAmount Desired amount of makerAsset to buy.\n /// @param signatures Proofs that orders have been signed by makers.\n /// @return Amounts filled and fees paid by makers and taker.\n function marketBuyOrdersNoThrow(\n LibOrder.Order[] memory orders,\n uint256 makerAssetFillAmount,\n bytes[] memory signatures\n )\n public\n returns (LibFillResults.FillResults memory totalFillResults);\n\n /// @dev Synchronously cancels multiple orders in a single transaction.\n /// @param orders Array of order specifications.\n function batchCancelOrders(LibOrder.Order[] memory orders)\n public;\n\n /// @dev Fetches information for all passed in orders\n /// @param orders Array of order specifications.\n /// @return Array of OrderInfo instances that correspond to each order.\n function getOrdersInfo(LibOrder.Order[] memory orders)\n public\n view\n returns (LibOrder.OrderInfo[] memory);\n}\n",
- "2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./LibOrder.sol\";\n\n\ncontract LibAbiEncoder {\n\n /// @dev ABI encodes calldata for `fillOrder`.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return ABI encoded calldata for `fillOrder`.\n function abiEncodeFillOrder(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n pure\n returns (bytes memory fillOrderCalldata)\n {\n // We need to call MExchangeCore.fillOrder using a delegatecall in\n // assembly so that we can intercept a call that throws. For this, we\n // need the input encoded in memory in the Ethereum ABIv2 format [1].\n\n // | Area | Offset | Length | Contents |\n // | -------- |--------|---------|-------------------------------------------- |\n // | Header | 0x00 | 4 | function selector |\n // | Params | | 3 * 32 | function parameters: |\n // | | 0x00 | | 1. offset to order (*) |\n // | | 0x20 | | 2. takerAssetFillAmount |\n // | | 0x40 | | 3. offset to signature (*) |\n // | Data | | 12 * 32 | order: |\n // | | 0x000 | | 1. senderAddress |\n // | | 0x020 | | 2. makerAddress |\n // | | 0x040 | | 3. takerAddress |\n // | | 0x060 | | 4. feeRecipientAddress |\n // | | 0x080 | | 5. makerAssetAmount |\n // | | 0x0A0 | | 6. takerAssetAmount |\n // | | 0x0C0 | | 7. makerFeeAmount |\n // | | 0x0E0 | | 8. takerFeeAmount |\n // | | 0x100 | | 9. expirationTimeSeconds |\n // | | 0x120 | | 10. salt |\n // | | 0x140 | | 11. Offset to makerAssetData (*) |\n // | | 0x160 | | 12. Offset to takerAssetData (*) |\n // | | 0x180 | 32 | makerAssetData Length |\n // | | 0x1A0 | ** | makerAssetData Contents |\n // | | 0x1C0 | 32 | takerAssetData Length |\n // | | 0x1E0 | ** | takerAssetData Contents |\n // | | 0x200 | 32 | signature Length |\n // | | 0x220 | ** | signature Contents |\n\n // * Offsets are calculated from the beginning of the current area: Header, Params, Data:\n // An offset stored in the Params area is calculated from the beginning of the Params section.\n // An offset stored in the Data area is calculated from the beginning of the Data section.\n\n // ** The length of dynamic array contents are stored in the field immediately preceeding the contents.\n\n // [1]: https://solidity.readthedocs.io/en/develop/abi-spec.html\n\n assembly {\n\n // Areas below may use the following variables:\n // 1. <area>Start -- Start of this area in memory\n // 2. <area>End -- End of this area in memory. This value may\n // be precomputed (before writing contents),\n // or it may be computed as contents are written.\n // 3. <area>Offset -- Current offset into area. If an area's End\n // is precomputed, this variable tracks the\n // offsets of contents as they are written.\n\n /////// Setup Header Area ///////\n // Load free memory pointer\n fillOrderCalldata := mload(0x40)\n // bytes4(keccak256(\"fillOrder((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),uint256,bytes)\"))\n // = 0xb4be83d5\n // Leave 0x20 bytes to store the length\n mstore(add(fillOrderCalldata, 0x20), 0xb4be83d500000000000000000000000000000000000000000000000000000000)\n let headerAreaEnd := add(fillOrderCalldata, 0x24)\n\n /////// Setup Params Area ///////\n // This area is preallocated and written to later.\n // This is because we need to fill in offsets that have not yet been calculated.\n let paramsAreaStart := headerAreaEnd\n let paramsAreaEnd := add(paramsAreaStart, 0x60)\n let paramsAreaOffset := paramsAreaStart\n\n /////// Setup Data Area ///////\n let dataAreaStart := paramsAreaEnd\n let dataAreaEnd := dataAreaStart\n\n // Offset from the source data we're reading from\n let sourceOffset := order\n // arrayLenBytes and arrayLenWords track the length of a dynamically-allocated bytes array.\n let arrayLenBytes := 0\n let arrayLenWords := 0\n\n /////// Write order Struct ///////\n // Write memory location of Order, relative to the start of the\n // parameter list, then increment the paramsAreaOffset respectively.\n mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))\n paramsAreaOffset := add(paramsAreaOffset, 0x20)\n\n // Write values for each field in the order\n // It would be nice to use a loop, but we save on gas by writing\n // the stores sequentially.\n mstore(dataAreaEnd, mload(sourceOffset)) // makerAddress\n mstore(add(dataAreaEnd, 0x20), mload(add(sourceOffset, 0x20))) // takerAddress\n mstore(add(dataAreaEnd, 0x40), mload(add(sourceOffset, 0x40))) // feeRecipientAddress\n mstore(add(dataAreaEnd, 0x60), mload(add(sourceOffset, 0x60))) // senderAddress\n mstore(add(dataAreaEnd, 0x80), mload(add(sourceOffset, 0x80))) // makerAssetAmount\n mstore(add(dataAreaEnd, 0xA0), mload(add(sourceOffset, 0xA0))) // takerAssetAmount\n mstore(add(dataAreaEnd, 0xC0), mload(add(sourceOffset, 0xC0))) // makerFeeAmount\n mstore(add(dataAreaEnd, 0xE0), mload(add(sourceOffset, 0xE0))) // takerFeeAmount\n mstore(add(dataAreaEnd, 0x100), mload(add(sourceOffset, 0x100))) // expirationTimeSeconds\n mstore(add(dataAreaEnd, 0x120), mload(add(sourceOffset, 0x120))) // salt\n mstore(add(dataAreaEnd, 0x140), mload(add(sourceOffset, 0x140))) // Offset to makerAssetData\n mstore(add(dataAreaEnd, 0x160), mload(add(sourceOffset, 0x160))) // Offset to takerAssetData\n dataAreaEnd := add(dataAreaEnd, 0x180)\n sourceOffset := add(sourceOffset, 0x180)\n\n // Write offset to <order.makerAssetData>\n mstore(add(dataAreaStart, mul(10, 0x20)), sub(dataAreaEnd, dataAreaStart))\n\n // Calculate length of <order.makerAssetData>\n sourceOffset := mload(add(order, 0x140)) // makerAssetData\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of <order.makerAssetData>\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of <order.makerAssetData>\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n // Write offset to <order.takerAssetData>\n mstore(add(dataAreaStart, mul(11, 0x20)), sub(dataAreaEnd, dataAreaStart))\n\n // Calculate length of <order.takerAssetData>\n sourceOffset := mload(add(order, 0x160)) // takerAssetData\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of <order.takerAssetData>\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of <order.takerAssetData>\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n /////// Write takerAssetFillAmount ///////\n mstore(paramsAreaOffset, takerAssetFillAmount)\n paramsAreaOffset := add(paramsAreaOffset, 0x20)\n\n /////// Write signature ///////\n // Write offset to paramsArea\n mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart))\n\n // Calculate length of signature\n sourceOffset := signature\n arrayLenBytes := mload(sourceOffset)\n sourceOffset := add(sourceOffset, 0x20)\n arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20)\n\n // Write length of signature\n mstore(dataAreaEnd, arrayLenBytes)\n dataAreaEnd := add(dataAreaEnd, 0x20)\n\n // Write contents of signature\n for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} {\n mstore(dataAreaEnd, mload(sourceOffset))\n dataAreaEnd := add(dataAreaEnd, 0x20)\n sourceOffset := add(sourceOffset, 0x20)\n }\n\n // Set length of calldata\n mstore(fillOrderCalldata, sub(dataAreaEnd, add(fillOrderCalldata, 0x20)))\n\n // Increment free memory pointer\n mstore(0x40, dataAreaEnd)\n }\n\n return fillOrderCalldata;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibConstants.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\n// solhint-disable max-line-length\ncontract LibConstants {\n \n // Asset data for ZRX token. Used for fee transfers.\n // @TODO: Hardcode constant when we deploy. Currently \n // not constant to make testing easier.\n\n // The proxyId for ZRX_ASSET_DATA is bytes4(keccak256(\"ERC20Token(address)\")) = 0xf47261b0\n \n // Kovan ZRX address is 0x6ff6c0ff1d68b964901f986d4c9fa3ac68346570.\n // The ABI encoded proxyId and address is 0xf47261b00000000000000000000000006ff6c0ff1d68b964901f986d4c9fa3ac68346570\n // bytes constant public ZRX_ASSET_DATA = \"\\xf4\\x72\\x61\\xb0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x6f\\xf6\\xc0\\xff\\x1d\\x68\\xb9\\x64\\x90\\x1f\\x98\\x6d\\x4c\\x9f\\xa3\\xac\\x68\\x34\\x65\\x70\";\n \n // Mainnet ZRX address is 0xe41d2489571d322189246dafa5ebde1f4699f498.\n // The ABI encoded proxyId and address is 0xf47261b0000000000000000000000000e41d2489571d322189246dafa5ebde1f4699f498\n bytes constant public ZRX_ASSET_DATA = \"\\xf4\\x72\\x61\\xb0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xe4\\x1d\\x24\\x89\\x57\\x1d\\x32\\x21\\x89\\x24\\x6d\\xaf\\xa5\\xeb\\xde\\x1f\\x46\\x99\\xf4\\x98\";\n}\n// solhint-enable max-line-length\n",
- "2.0.0/protocol/Exchange/libs/LibEIP712.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract LibEIP712 {\n\n // EIP191 header for EIP712 prefix\n string constant internal EIP191_HEADER = \"\\x19\\x01\";\n\n // EIP712 Domain Name value\n string constant internal EIP712_DOMAIN_NAME = \"0x Protocol\";\n\n // EIP712 Domain Version value\n string constant internal EIP712_DOMAIN_VERSION = \"2\";\n\n // Hash of the EIP712 Domain Separator Schema\n bytes32 constant internal EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"EIP712Domain(\",\n \"string name,\",\n \"string version,\",\n \"address verifyingContract\",\n \")\"\n ));\n\n // Hash of the EIP712 Domain Separator data\n // solhint-disable-next-line var-name-mixedcase\n bytes32 public EIP712_DOMAIN_HASH;\n\n constructor ()\n public\n {\n EIP712_DOMAIN_HASH = keccak256(abi.encodePacked(\n EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH,\n keccak256(bytes(EIP712_DOMAIN_NAME)),\n keccak256(bytes(EIP712_DOMAIN_VERSION)),\n bytes32(address(this))\n ));\n }\n\n /// @dev Calculates EIP712 encoding for a hash struct in this EIP712 Domain.\n /// @param hashStruct The EIP712 hash struct.\n /// @return EIP712 hash applied to this EIP712 Domain.\n function hashEIP712Message(bytes32 hashStruct)\n internal\n view\n returns (bytes32 result)\n {\n bytes32 eip712DomainHash = EIP712_DOMAIN_HASH;\n\n // Assembly for more efficient computing:\n // keccak256(abi.encodePacked(\n // EIP191_HEADER,\n // EIP712_DOMAIN_HASH,\n // hashStruct \n // ));\n\n assembly {\n // Load free memory pointer\n let memPtr := mload(64)\n\n mstore(memPtr, 0x1901000000000000000000000000000000000000000000000000000000000000) // EIP191 header\n mstore(add(memPtr, 2), eip712DomainHash) // EIP712 domain hash\n mstore(add(memPtr, 34), hashStruct) // Hash of struct\n\n // Compute hash\n result := keccak256(memPtr, 66)\n }\n return result;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibExchangeErrors.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\n// solhint-disable\npragma solidity 0.4.24;\n\n\n/// @dev This contract documents the revert reasons used in the Exchange contract.\n/// This contract is intended to serve as a reference, but is not actually used for efficiency reasons.\ncontract LibExchangeErrors {\n\n /// Order validation errors ///\n string constant ORDER_UNFILLABLE = \"ORDER_UNFILLABLE\"; // Order cannot be filled.\n string constant INVALID_MAKER = \"INVALID_MAKER\"; // Invalid makerAddress.\n string constant INVALID_TAKER = \"INVALID_TAKER\"; // Invalid takerAddress.\n string constant INVALID_SENDER = \"INVALID_SENDER\"; // Invalid `msg.sender`.\n string constant INVALID_ORDER_SIGNATURE = \"INVALID_ORDER_SIGNATURE\"; // Signature validation failed. \n \n /// fillOrder validation errors ///\n string constant INVALID_TAKER_AMOUNT = \"INVALID_TAKER_AMOUNT\"; // takerAssetFillAmount cannot equal 0.\n string constant ROUNDING_ERROR = \"ROUNDING_ERROR\"; // Rounding error greater than 0.1% of takerAssetFillAmount. \n \n /// Signature validation errors ///\n string constant INVALID_SIGNATURE = \"INVALID_SIGNATURE\"; // Signature validation failed. \n string constant SIGNATURE_ILLEGAL = \"SIGNATURE_ILLEGAL\"; // Signature type is illegal.\n string constant SIGNATURE_UNSUPPORTED = \"SIGNATURE_UNSUPPORTED\"; // Signature type unsupported.\n \n /// cancelOrdersUptTo errors ///\n string constant INVALID_NEW_ORDER_EPOCH = \"INVALID_NEW_ORDER_EPOCH\"; // Specified salt must be greater than or equal to existing orderEpoch.\n\n /// fillOrKillOrder errors ///\n string constant COMPLETE_FILL_FAILED = \"COMPLETE_FILL_FAILED\"; // Desired takerAssetFillAmount could not be completely filled. \n\n /// matchOrders errors ///\n string constant NEGATIVE_SPREAD_REQUIRED = \"NEGATIVE_SPREAD_REQUIRED\"; // Matched orders must have a negative spread.\n\n /// Transaction errors ///\n string constant REENTRANCY_ILLEGAL = \"REENTRANCY_ILLEGAL\"; // Recursive reentrancy is not allowed. \n string constant INVALID_TX_HASH = \"INVALID_TX_HASH\"; // Transaction has already been executed. \n string constant INVALID_TX_SIGNATURE = \"INVALID_TX_SIGNATURE\"; // Signature validation failed. \n string constant FAILED_EXECUTION = \"FAILED_EXECUTION\"; // Transaction execution failed. \n \n /// registerAssetProxy errors ///\n string constant ASSET_PROXY_ALREADY_EXISTS = \"ASSET_PROXY_ALREADY_EXISTS\"; // AssetProxy with same id already exists.\n\n /// dispatchTransferFrom errors ///\n string constant ASSET_PROXY_DOES_NOT_EXIST = \"ASSET_PROXY_DOES_NOT_EXIST\"; // No assetProxy registered at given id.\n string constant TRANSFER_FAILED = \"TRANSFER_FAILED\"; // Asset transfer unsuccesful.\n\n /// Length validation errors ///\n string constant LENGTH_GREATER_THAN_0_REQUIRED = \"LENGTH_GREATER_THAN_0_REQUIRED\"; // Byte array must have a length greater than 0.\n string constant LENGTH_GREATER_THAN_3_REQUIRED = \"LENGTH_GREATER_THAN_3_REQUIRED\"; // Byte array must have a length greater than 3.\n string constant LENGTH_0_REQUIRED = \"LENGTH_0_REQUIRED\"; // Byte array must have a length of 0.\n string constant LENGTH_65_REQUIRED = \"LENGTH_65_REQUIRED\"; // Byte array must have a length of 65.\n}\n",
- "2.0.0/protocol/Exchange/libs/LibFillResults.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract LibFillResults is\n SafeMath\n{\n struct FillResults {\n uint256 makerAssetFilledAmount; // Total amount of makerAsset(s) filled.\n uint256 takerAssetFilledAmount; // Total amount of takerAsset(s) filled.\n uint256 makerFeePaid; // Total amount of ZRX paid by maker(s) to feeRecipient(s).\n uint256 takerFeePaid; // Total amount of ZRX paid by taker to feeRecipients(s).\n }\n\n struct MatchedFillResults {\n FillResults left; // Amounts filled and fees paid of left order.\n FillResults right; // Amounts filled and fees paid of right order.\n uint256 leftMakerAssetSpreadAmount; // Spread between price of left and right order, denominated in the left order's makerAsset, paid to taker.\n }\n\n /// @dev Adds properties of both FillResults instances.\n /// Modifies the first FillResults instance specified.\n /// @param totalFillResults Fill results instance that will be added onto.\n /// @param singleFillResults Fill results instance that will be added to totalFillResults.\n function addFillResults(FillResults memory totalFillResults, FillResults memory singleFillResults)\n internal\n pure\n {\n totalFillResults.makerAssetFilledAmount = safeAdd(totalFillResults.makerAssetFilledAmount, singleFillResults.makerAssetFilledAmount);\n totalFillResults.takerAssetFilledAmount = safeAdd(totalFillResults.takerAssetFilledAmount, singleFillResults.takerAssetFilledAmount);\n totalFillResults.makerFeePaid = safeAdd(totalFillResults.makerFeePaid, singleFillResults.makerFeePaid);\n totalFillResults.takerFeePaid = safeAdd(totalFillResults.takerFeePaid, singleFillResults.takerFeePaid);\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibMath.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../../../utils/SafeMath/SafeMath.sol\";\n\n\ncontract LibMath is\n SafeMath\n{\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// Reverts if rounding error is >= 0.1%\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded down.\n function safeGetPartialAmountFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n require(\n !isRoundingErrorFloor(\n numerator,\n denominator,\n target\n ),\n \"ROUNDING_ERROR\"\n );\n \n partialAmount = safeDiv(\n safeMul(numerator, target),\n denominator\n );\n return partialAmount;\n }\n\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// Reverts if rounding error is >= 0.1%\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded up.\n function safeGetPartialAmountCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n require(\n !isRoundingErrorCeil(\n numerator,\n denominator,\n target\n ),\n \"ROUNDING_ERROR\"\n );\n \n // safeDiv computes `floor(a / b)`. We use the identity (a, b integer):\n // ceil(a / b) = floor((a + b - 1) / b)\n // To implement `ceil(a / b)` using safeDiv.\n partialAmount = safeDiv(\n safeAdd(\n safeMul(numerator, target),\n safeSub(denominator, 1)\n ),\n denominator\n );\n return partialAmount;\n }\n\n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded down.\n function getPartialAmountFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n partialAmount = safeDiv(\n safeMul(numerator, target),\n denominator\n );\n return partialAmount;\n }\n \n /// @dev Calculates partial value given a numerator and denominator rounded down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to calculate partial of.\n /// @return Partial value of target rounded up.\n function getPartialAmountCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (uint256 partialAmount)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n\n // safeDiv computes `floor(a / b)`. We use the identity (a, b integer):\n // ceil(a / b) = floor((a + b - 1) / b)\n // To implement `ceil(a / b)` using safeDiv.\n partialAmount = safeDiv(\n safeAdd(\n safeMul(numerator, target),\n safeSub(denominator, 1)\n ),\n denominator\n );\n return partialAmount;\n }\n \n /// @dev Checks if rounding error >= 0.1% when rounding down.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to multiply with numerator/denominator.\n /// @return Rounding error is present.\n function isRoundingErrorFloor(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (bool isError)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n \n // The absolute rounding error is the difference between the rounded\n // value and the ideal value. The relative rounding error is the\n // absolute rounding error divided by the absolute value of the\n // ideal value. This is undefined when the ideal value is zero.\n //\n // The ideal value is `numerator * target / denominator`.\n // Let's call `numerator * target % denominator` the remainder.\n // The absolute error is `remainder / denominator`.\n //\n // When the ideal value is zero, we require the absolute error to\n // be zero. Fortunately, this is always the case. The ideal value is\n // zero iff `numerator == 0` and/or `target == 0`. In this case the\n // remainder and absolute error are also zero. \n if (target == 0 || numerator == 0) {\n return false;\n }\n \n // Otherwise, we want the relative rounding error to be strictly\n // less than 0.1%.\n // The relative error is `remainder / (numerator * target)`.\n // We want the relative error less than 1 / 1000:\n // remainder / (numerator * denominator) < 1 / 1000\n // or equivalently:\n // 1000 * remainder < numerator * target\n // so we have a rounding error iff:\n // 1000 * remainder >= numerator * target\n uint256 remainder = mulmod(\n target,\n numerator,\n denominator\n );\n isError = safeMul(1000, remainder) >= safeMul(numerator, target);\n return isError;\n }\n \n /// @dev Checks if rounding error >= 0.1% when rounding up.\n /// @param numerator Numerator.\n /// @param denominator Denominator.\n /// @param target Value to multiply with numerator/denominator.\n /// @return Rounding error is present.\n function isRoundingErrorCeil(\n uint256 numerator,\n uint256 denominator,\n uint256 target\n )\n internal\n pure\n returns (bool isError)\n {\n require(\n denominator > 0,\n \"DIVISION_BY_ZERO\"\n );\n \n // See the comments in `isRoundingError`.\n if (target == 0 || numerator == 0) {\n // When either is zero, the ideal value and rounded value are zero\n // and there is no rounding error. (Although the relative error\n // is undefined.)\n return false;\n }\n // Compute remainder as before\n uint256 remainder = mulmod(\n target,\n numerator,\n denominator\n );\n remainder = safeSub(denominator, remainder) % denominator;\n isError = safeMul(1000, remainder) >= safeMul(numerator, target);\n return isError;\n }\n}\n",
- "2.0.0/protocol/Exchange/libs/LibOrder.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"./LibEIP712.sol\";\n\n\ncontract LibOrder is\n LibEIP712\n{\n // Hash for the EIP712 Order Schema\n bytes32 constant internal EIP712_ORDER_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"Order(\",\n \"address makerAddress,\",\n \"address takerAddress,\",\n \"address feeRecipientAddress,\",\n \"address senderAddress,\",\n \"uint256 makerAssetAmount,\",\n \"uint256 takerAssetAmount,\",\n \"uint256 makerFee,\",\n \"uint256 takerFee,\",\n \"uint256 expirationTimeSeconds,\",\n \"uint256 salt,\",\n \"bytes makerAssetData,\",\n \"bytes takerAssetData\",\n \")\"\n ));\n\n // A valid order remains fillable until it is expired, fully filled, or cancelled.\n // An order's state is unaffected by external factors, like account balances.\n enum OrderStatus {\n INVALID, // Default value\n INVALID_MAKER_ASSET_AMOUNT, // Order does not have a valid maker asset amount\n INVALID_TAKER_ASSET_AMOUNT, // Order does not have a valid taker asset amount\n FILLABLE, // Order is fillable\n EXPIRED, // Order has already expired\n FULLY_FILLED, // Order is fully filled\n CANCELLED // Order has been cancelled\n }\n\n // solhint-disable max-line-length\n struct Order {\n address makerAddress; // Address that created the order. \n address takerAddress; // Address that is allowed to fill the order. If set to 0, any address is allowed to fill the order. \n address feeRecipientAddress; // Address that will recieve fees when order is filled. \n address senderAddress; // Address that is allowed to call Exchange contract methods that affect this order. If set to 0, any address is allowed to call these methods.\n uint256 makerAssetAmount; // Amount of makerAsset being offered by maker. Must be greater than 0. \n uint256 takerAssetAmount; // Amount of takerAsset being bid on by maker. Must be greater than 0. \n uint256 makerFee; // Amount of ZRX paid to feeRecipient by maker when order is filled. If set to 0, no transfer of ZRX from maker to feeRecipient will be attempted.\n uint256 takerFee; // Amount of ZRX paid to feeRecipient by taker when order is filled. If set to 0, no transfer of ZRX from taker to feeRecipient will be attempted.\n uint256 expirationTimeSeconds; // Timestamp in seconds at which order expires. \n uint256 salt; // Arbitrary number to facilitate uniqueness of the order's hash. \n bytes makerAssetData; // Encoded data that can be decoded by a specified proxy contract when transferring makerAsset. The last byte references the id of this proxy.\n bytes takerAssetData; // Encoded data that can be decoded by a specified proxy contract when transferring takerAsset. The last byte references the id of this proxy.\n }\n // solhint-enable max-line-length\n\n struct OrderInfo {\n uint8 orderStatus; // Status that describes order's validity and fillability.\n bytes32 orderHash; // EIP712 hash of the order (see LibOrder.getOrderHash).\n uint256 orderTakerAssetFilledAmount; // Amount of order that has already been filled.\n }\n\n /// @dev Calculates Keccak-256 hash of the order.\n /// @param order The order structure.\n /// @return Keccak-256 EIP712 hash of the order.\n function getOrderHash(Order memory order)\n internal\n view\n returns (bytes32 orderHash)\n {\n orderHash = hashEIP712Message(hashOrder(order));\n return orderHash;\n }\n\n /// @dev Calculates EIP712 hash of the order.\n /// @param order The order structure.\n /// @return EIP712 hash of the order.\n function hashOrder(Order memory order)\n internal\n pure\n returns (bytes32 result)\n {\n bytes32 schemaHash = EIP712_ORDER_SCHEMA_HASH;\n bytes32 makerAssetDataHash = keccak256(order.makerAssetData);\n bytes32 takerAssetDataHash = keccak256(order.takerAssetData);\n\n // Assembly for more efficiently computing:\n // keccak256(abi.encodePacked(\n // EIP712_ORDER_SCHEMA_HASH,\n // bytes32(order.makerAddress),\n // bytes32(order.takerAddress),\n // bytes32(order.feeRecipientAddress),\n // bytes32(order.senderAddress),\n // order.makerAssetAmount,\n // order.takerAssetAmount,\n // order.makerFee,\n // order.takerFee,\n // order.expirationTimeSeconds,\n // order.salt,\n // keccak256(order.makerAssetData),\n // keccak256(order.takerAssetData)\n // ));\n\n assembly {\n // Calculate memory addresses that will be swapped out before hashing\n let pos1 := sub(order, 32)\n let pos2 := add(order, 320)\n let pos3 := add(order, 352)\n\n // Backup\n let temp1 := mload(pos1)\n let temp2 := mload(pos2)\n let temp3 := mload(pos3)\n \n // Hash in place\n mstore(pos1, schemaHash)\n mstore(pos2, makerAssetDataHash)\n mstore(pos3, takerAssetDataHash)\n result := keccak256(pos1, 416)\n \n // Restore\n mstore(pos1, temp1)\n mstore(pos2, temp2)\n mstore(pos3, temp3)\n }\n return result;\n }\n}\n",
- "2.0.0/protocol/Exchange/mixins/MAssetProxyDispatcher.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/IAssetProxyDispatcher.sol\";\n\n\ncontract MAssetProxyDispatcher is\n IAssetProxyDispatcher\n{\n // Logs registration of new asset proxy\n event AssetProxyRegistered(\n bytes4 id, // Id of new registered AssetProxy.\n address assetProxy // Address of new registered AssetProxy.\n );\n\n /// @dev Forwards arguments to assetProxy and calls `transferFrom`. Either succeeds or throws.\n /// @param assetData Byte array encoded for the asset.\n /// @param from Address to transfer token from.\n /// @param to Address to transfer token to.\n /// @param amount Amount of token to transfer.\n function dispatchTransferFrom(\n bytes memory assetData,\n address from,\n address to,\n uint256 amount\n )\n internal;\n}\n",
- "2.0.0/protocol/Exchange/mixins/MExchangeCore.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IExchangeCore.sol\";\n\n\ncontract MExchangeCore is\n IExchangeCore\n{\n // Fill event is emitted whenever an order is filled.\n event Fill(\n address indexed makerAddress, // Address that created the order. \n address indexed feeRecipientAddress, // Address that received fees.\n address takerAddress, // Address that filled the order.\n address senderAddress, // Address that called the Exchange contract (msg.sender).\n uint256 makerAssetFilledAmount, // Amount of makerAsset sold by maker and bought by taker. \n uint256 takerAssetFilledAmount, // Amount of takerAsset sold by taker and bought by maker.\n uint256 makerFeePaid, // Amount of ZRX paid to feeRecipient by maker.\n uint256 takerFeePaid, // Amount of ZRX paid to feeRecipient by taker.\n bytes32 indexed orderHash, // EIP712 hash of order (see LibOrder.getOrderHash).\n bytes makerAssetData, // Encoded data specific to makerAsset. \n bytes takerAssetData // Encoded data specific to takerAsset.\n );\n\n // Cancel event is emitted whenever an individual order is cancelled.\n event Cancel(\n address indexed makerAddress, // Address that created the order. \n address indexed feeRecipientAddress, // Address that would have recieved fees if order was filled. \n address senderAddress, // Address that called the Exchange contract (msg.sender).\n bytes32 indexed orderHash, // EIP712 hash of order (see LibOrder.getOrderHash).\n bytes makerAssetData, // Encoded data specific to makerAsset. \n bytes takerAssetData // Encoded data specific to takerAsset.\n );\n\n // CancelUpTo event is emitted whenever `cancelOrdersUpTo` is executed succesfully.\n event CancelUpTo(\n address indexed makerAddress, // Orders cancelled must have been created by this address.\n address indexed senderAddress, // Orders cancelled must have a `senderAddress` equal to this address.\n uint256 orderEpoch // Orders with specified makerAddress and senderAddress with a salt less than this value are considered cancelled.\n );\n\n /// @dev Fills the input order.\n /// @param order Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n /// @return Amounts filled and fees paid by maker and taker.\n function fillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n\n /// @dev After calling, the order can not be filled anymore.\n /// @param order Order struct containing order specifications.\n function cancelOrderInternal(LibOrder.Order memory order)\n internal;\n\n /// @dev Updates state with results of a fill order.\n /// @param order that was filled.\n /// @param takerAddress Address of taker who filled the order.\n /// @param orderTakerAssetFilledAmount Amount of order already filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function updateFilledState(\n LibOrder.Order memory order,\n address takerAddress,\n bytes32 orderHash,\n uint256 orderTakerAssetFilledAmount,\n LibFillResults.FillResults memory fillResults\n )\n internal;\n\n /// @dev Updates state with results of cancelling an order.\n /// State is only updated if the order is currently fillable.\n /// Otherwise, updating state would have no effect.\n /// @param order that was cancelled.\n /// @param orderHash Hash of order that was cancelled.\n function updateCancelledState(\n LibOrder.Order memory order,\n bytes32 orderHash\n )\n internal;\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n /// @param takerAddress Address of order taker.\n /// @param signature Proof that the orders was created by its maker.\n function assertFillableOrder(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo,\n address takerAddress,\n bytes memory signature\n )\n internal\n view;\n \n /// @dev Validates context for fillOrder. Succeeds or throws.\n /// @param order to be filled.\n /// @param orderInfo Status, orderHash, and amount already filled of order.\n /// @param takerAssetFillAmount Desired amount of order to fill by taker.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @param makerAssetFilledAmount Amount of makerAsset that will be transfered.\n function assertValidFill(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo,\n uint256 takerAssetFillAmount,\n uint256 takerAssetFilledAmount,\n uint256 makerAssetFilledAmount\n )\n internal\n view;\n\n /// @dev Validates context for cancelOrder. Succeeds or throws.\n /// @param order to be cancelled.\n /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.\n function assertValidCancel(\n LibOrder.Order memory order,\n LibOrder.OrderInfo memory orderInfo\n )\n internal\n view;\n\n /// @dev Calculates amounts filled and fees paid by maker and taker.\n /// @param order to be filled.\n /// @param takerAssetFilledAmount Amount of takerAsset that will be filled.\n /// @return fillResults Amounts filled and fees paid by maker and taker.\n function calculateFillResults(\n LibOrder.Order memory order,\n uint256 takerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.FillResults memory fillResults);\n\n}\n",
- "2.0.0/protocol/Exchange/mixins/MMatchOrders.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IMatchOrders.sol\";\n\n\ncontract MMatchOrders is\n IMatchOrders\n{\n /// @dev Validates context for matchOrders. Succeeds or throws.\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n function assertValidMatch(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder\n )\n internal\n pure;\n\n /// @dev Calculates fill amounts for the matched orders.\n /// Each order is filled at their respective price point. However, the calculations are\n /// carried out as though the orders are both being filled at the right order's price point.\n /// The profit made by the leftOrder order goes to the taker (who matched the two orders).\n /// @param leftOrder First order to match.\n /// @param rightOrder Second order to match.\n /// @param leftOrderTakerAssetFilledAmount Amount of left order already filled.\n /// @param rightOrderTakerAssetFilledAmount Amount of right order already filled.\n /// @param matchedFillResults Amounts to fill and fees to pay by maker and taker of matched orders.\n function calculateMatchedFillResults(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n uint256 leftOrderTakerAssetFilledAmount,\n uint256 rightOrderTakerAssetFilledAmount\n )\n internal\n pure\n returns (LibFillResults.MatchedFillResults memory matchedFillResults);\n\n}\n",
- "2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../interfaces/ISignatureValidator.sol\";\n\n\ncontract MSignatureValidator is\n ISignatureValidator\n{\n event SignatureValidatorApproval(\n address indexed signerAddress, // Address that approves or disapproves a contract to verify signatures.\n address indexed validatorAddress, // Address of signature validator contract.\n bool approved // Approval or disapproval of validator contract.\n );\n\n // Allowed signature types.\n enum SignatureType {\n Illegal, // 0x00, default value\n Invalid, // 0x01\n EIP712, // 0x02\n EthSign, // 0x03\n Wallet, // 0x04\n Validator, // 0x05\n PreSigned, // 0x06\n NSignatureTypes // 0x07, number of signature types. Always leave at end.\n }\n\n /// @dev Verifies signature using logic defined by Wallet contract.\n /// @param hash Any 32 byte hash.\n /// @param walletAddress Address that should have signed the given hash\n /// and defines its own signature verification method.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidWalletSignature(\n bytes32 hash,\n address walletAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid);\n\n /// @dev Verifies signature using logic defined by Validator contract.\n /// @param validatorAddress Address of validator contract.\n /// @param hash Any 32 byte hash.\n /// @param signerAddress Address that should have signed the given hash.\n /// @param signature Proof that the hash has been signed by signer.\n /// @return True if the address recovered from the provided signature matches the input signer address.\n function isValidValidatorSignature(\n address validatorAddress,\n bytes32 hash,\n address signerAddress,\n bytes signature\n )\n internal\n view\n returns (bool isValid);\n}\n",
- "2.0.0/protocol/Exchange/mixins/MTransactions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\npragma solidity 0.4.24;\n\nimport \"../interfaces/ITransactions.sol\";\n\n\ncontract MTransactions is\n ITransactions\n{\n // Hash for the EIP712 ZeroEx Transaction Schema\n bytes32 constant internal EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH = keccak256(abi.encodePacked(\n \"ZeroExTransaction(\",\n \"uint256 salt,\",\n \"address signerAddress,\",\n \"bytes data\",\n \")\"\n ));\n\n /// @dev Calculates EIP712 hash of the Transaction.\n /// @param salt Arbitrary number to ensure uniqueness of transaction hash.\n /// @param signerAddress Address of transaction signer.\n /// @param data AbiV2 encoded calldata.\n /// @return EIP712 hash of the Transaction.\n function hashZeroExTransaction(\n uint256 salt,\n address signerAddress,\n bytes memory data\n )\n internal\n pure\n returns (bytes32 result);\n\n /// @dev The current function will be called in the context of this address (either 0x transaction signer or `msg.sender`).\n /// If calling a fill function, this address will represent the taker.\n /// If calling a cancel function, this address will represent the maker.\n /// @return Signer of 0x transaction if entry point is `executeTransaction`.\n /// `msg.sender` if entry point is any other function.\n function getCurrentContextAddress()\n internal\n view\n returns (address);\n}\n",
- "2.0.0/protocol/Exchange/mixins/MWrapperFunctions.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../libs/LibOrder.sol\";\nimport \"../libs/LibFillResults.sol\";\nimport \"../interfaces/IWrapperFunctions.sol\";\n\n\ncontract MWrapperFunctions is \n IWrapperFunctions\n{\n /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.\n /// @param order LibOrder.Order struct containing order specifications.\n /// @param takerAssetFillAmount Desired amount of takerAsset to sell.\n /// @param signature Proof that order has been created by maker.\n function fillOrKillOrderInternal(\n LibOrder.Order memory order,\n uint256 takerAssetFillAmount,\n bytes memory signature\n )\n internal\n returns (LibFillResults.FillResults memory fillResults);\n}\n",
- "2.0.0/tokens/ERC20Token/IERC20Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC20Token {\n\n // solhint-disable no-simple-event-func-name\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 _value\n );\n\n event Approval(\n address indexed _owner,\n address indexed _spender,\n uint256 _value\n );\n\n /// @dev send `value` token to `to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transfer(address _to, uint256 _value)\n external\n returns (bool);\n\n /// @dev send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return True if transfer was successful\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n )\n external\n returns (bool);\n \n /// @dev `msg.sender` approves `_spender` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Always true if the call has enough gas to complete execution\n function approve(address _spender, uint256 _value)\n external\n returns (bool);\n\n /// @dev Query total supply of token\n /// @return Total supply of token\n function totalSupply()\n external\n view\n returns (uint256);\n \n /// @param _owner The address from which the balance will be retrieved\n /// @return Balance of owner\n function balanceOf(address _owner)\n external\n view\n returns (uint256);\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender)\n external\n view\n returns (uint256);\n}\n",
- "2.0.0/tokens/ERC721Token/IERC721Token.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract IERC721Token {\n\n /// @dev This emits when ownership of any NFT changes by any mechanism.\n /// This event emits when NFTs are created (`from` == 0) and destroyed\n /// (`to` == 0). Exception: during contract creation, any number of NFTs\n /// may be created and assigned without emitting Transfer. At the time of\n /// any transfer, the approved address for that NFT (if any) is reset to none.\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 indexed _tokenId\n );\n\n /// @dev This emits when the approved address for an NFT is changed or\n /// reaffirmed. The zero address indicates there is no approved address.\n /// When a Transfer event emits, this also indicates that the approved\n /// address for that NFT (if any) is reset to none.\n event Approval(\n address indexed _owner,\n address indexed _approved,\n uint256 indexed _tokenId\n );\n\n /// @dev This emits when an operator is enabled or disabled for an owner.\n /// The operator can manage all NFTs of the owner.\n event ApprovalForAll(\n address indexed _owner,\n address indexed _operator,\n bool _approved\n );\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// perator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT. When transfer is complete, this function\n /// checks if `_to` is a smart contract (code size > 0). If so, it calls\n /// `onERC721Received` on `_to` and throws if the return value is not\n /// `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n /// @param _data Additional data with no specified format, sent in call to `_to`\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId,\n bytes _data\n )\n external;\n\n /// @notice Transfers the ownership of an NFT from one address to another address\n /// @dev This works identically to the other function with an extra data parameter,\n /// except this function just sets data to \"\".\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function safeTransferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n external;\n\n /// @notice Change or reaffirm the approved address for an NFT\n /// @dev The zero address indicates there is no approved address.\n /// Throws unless `msg.sender` is the current NFT owner, or an authorized\n /// operator of the current owner.\n /// @param _approved The new approved NFT controller\n /// @param _tokenId The NFT to approve\n function approve(address _approved, uint256 _tokenId)\n external;\n\n /// @notice Enable or disable approval for a third party (\"operator\") to manage\n /// all of `msg.sender`'s assets\n /// @dev Emits the ApprovalForAll event. The contract MUST allow\n /// multiple operators per owner.\n /// @param _operator Address to add to the set of authorized operators\n /// @param _approved True if the operator is approved, false to revoke approval\n function setApprovalForAll(address _operator, bool _approved)\n external;\n\n /// @notice Count all NFTs assigned to an owner\n /// @dev NFTs assigned to the zero address are considered invalid, and this\n /// function throws for queries about the zero address.\n /// @param _owner An address for whom to query the balance\n /// @return The number of NFTs owned by `_owner`, possibly zero\n function balanceOf(address _owner)\n external\n view\n returns (uint256);\n\n /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE\n /// TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE\n /// THEY MAY BE PERMANENTLY LOST\n /// @dev Throws unless `msg.sender` is the current owner, an authorized\n /// operator, or the approved address for this NFT. Throws if `_from` is\n /// not the current owner. Throws if `_to` is the zero address. Throws if\n /// `_tokenId` is not a valid NFT.\n /// @param _from The current owner of the NFT\n /// @param _to The new owner\n /// @param _tokenId The NFT to transfer\n function transferFrom(\n address _from,\n address _to,\n uint256 _tokenId\n )\n public;\n\n /// @notice Find the owner of an NFT\n /// @dev NFTs assigned to zero address are considered invalid, and queries\n /// about them do throw.\n /// @param _tokenId The identifier for an NFT\n /// @return The address of the owner of the NFT\n function ownerOf(uint256 _tokenId)\n public\n view\n returns (address);\n\n /// @notice Get the approved address for a single NFT\n /// @dev Throws if `_tokenId` is not a valid NFT.\n /// @param _tokenId The NFT to find the approved address for\n /// @return The approved address for this NFT, or the zero address if there is none\n function getApproved(uint256 _tokenId) \n public\n view\n returns (address);\n \n /// @notice Query if an address is an authorized operator for another address\n /// @param _owner The address that owns the NFTs\n /// @param _operator The address that acts on behalf of the owner\n /// @return True if `_operator` is an approved operator for `_owner`, false otherwise\n function isApprovedForAll(address _owner, address _operator)\n public\n view\n returns (bool);\n}\n",
- "2.0.0/tokens/EtherToken/IEtherToken.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\nimport \"../ERC20Token/IERC20Token.sol\";\n\n\ncontract IEtherToken is\n IERC20Token\n{\n function deposit()\n public\n payable;\n \n function withdraw(uint256 amount)\n public;\n}\n",
- "2.0.0/utils/LibBytes/LibBytes.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\nlibrary LibBytes {\n\n using LibBytes for bytes;\n\n /// @dev Gets the memory address for a byte array.\n /// @param input Byte array to lookup.\n /// @return memoryAddress Memory address of byte array. This\n /// points to the header of the byte array which contains\n /// the length.\n function rawAddress(bytes memory input)\n internal\n pure\n returns (uint256 memoryAddress)\n {\n assembly {\n memoryAddress := input\n }\n return memoryAddress;\n }\n \n /// @dev Gets the memory address for the contents of a byte array.\n /// @param input Byte array to lookup.\n /// @return memoryAddress Memory address of the contents of the byte array.\n function contentAddress(bytes memory input)\n internal\n pure\n returns (uint256 memoryAddress)\n {\n assembly {\n memoryAddress := add(input, 32)\n }\n return memoryAddress;\n }\n\n /// @dev Copies `length` bytes from memory location `source` to `dest`.\n /// @param dest memory address to copy bytes to.\n /// @param source memory address to copy bytes from.\n /// @param length number of bytes to copy.\n function memCopy(\n uint256 dest,\n uint256 source,\n uint256 length\n )\n internal\n pure\n {\n if (length < 32) {\n // Handle a partial word by reading destination and masking\n // off the bits we are interested in.\n // This correctly handles overlap, zero lengths and source == dest\n assembly {\n let mask := sub(exp(256, sub(32, length)), 1)\n let s := and(mload(source), not(mask))\n let d := and(mload(dest), mask)\n mstore(dest, or(s, d))\n }\n } else {\n // Skip the O(length) loop when source == dest.\n if (source == dest) {\n return;\n }\n\n // For large copies we copy whole words at a time. The final\n // word is aligned to the end of the range (instead of after the\n // previous) to handle partial words. So a copy will look like this:\n //\n // ####\n // ####\n // ####\n // ####\n //\n // We handle overlap in the source and destination range by\n // changing the copying direction. This prevents us from\n // overwriting parts of source that we still need to copy.\n //\n // This correctly handles source == dest\n //\n if (source > dest) {\n assembly {\n // We subtract 32 from `sEnd` and `dEnd` because it\n // is easier to compare with in the loop, and these\n // are also the addresses we need for copying the\n // last bytes.\n length := sub(length, 32)\n let sEnd := add(source, length)\n let dEnd := add(dest, length)\n\n // Remember the last 32 bytes of source\n // This needs to be done here and not after the loop\n // because we may have overwritten the last bytes in\n // source already due to overlap.\n let last := mload(sEnd)\n\n // Copy whole words front to back\n // Note: the first check is always true,\n // this could have been a do-while loop.\n // solhint-disable-next-line no-empty-blocks\n for {} lt(source, sEnd) {} {\n mstore(dest, mload(source))\n source := add(source, 32)\n dest := add(dest, 32)\n }\n \n // Write the last 32 bytes\n mstore(dEnd, last)\n }\n } else {\n assembly {\n // We subtract 32 from `sEnd` and `dEnd` because those\n // are the starting points when copying a word at the end.\n length := sub(length, 32)\n let sEnd := add(source, length)\n let dEnd := add(dest, length)\n\n // Remember the first 32 bytes of source\n // This needs to be done here and not after the loop\n // because we may have overwritten the first bytes in\n // source already due to overlap.\n let first := mload(source)\n\n // Copy whole words back to front\n // We use a signed comparisson here to allow dEnd to become\n // negative (happens when source and dest < 32). Valid\n // addresses in local memory will never be larger than\n // 2**255, so they can be safely re-interpreted as signed.\n // Note: the first check is always true,\n // this could have been a do-while loop.\n // solhint-disable-next-line no-empty-blocks\n for {} slt(dest, dEnd) {} {\n mstore(dEnd, mload(sEnd))\n sEnd := sub(sEnd, 32)\n dEnd := sub(dEnd, 32)\n }\n \n // Write the first 32 bytes\n mstore(dest, first)\n }\n }\n }\n }\n\n /// @dev Returns a slices from a byte array.\n /// @param b The byte array to take a slice from.\n /// @param from The starting index for the slice (inclusive).\n /// @param to The final index for the slice (exclusive).\n /// @return result The slice containing bytes at indices [from, to)\n function slice(\n bytes memory b,\n uint256 from,\n uint256 to\n )\n internal\n pure\n returns (bytes memory result)\n {\n require(\n from <= to,\n \"FROM_LESS_THAN_TO_REQUIRED\"\n );\n require(\n to < b.length,\n \"TO_LESS_THAN_LENGTH_REQUIRED\"\n );\n \n // Create a new bytes structure and copy contents\n result = new bytes(to - from);\n memCopy(\n result.contentAddress(),\n b.contentAddress() + from,\n result.length\n );\n return result;\n }\n \n /// @dev Returns a slice from a byte array without preserving the input.\n /// @param b The byte array to take a slice from. Will be destroyed in the process.\n /// @param from The starting index for the slice (inclusive).\n /// @param to The final index for the slice (exclusive).\n /// @return result The slice containing bytes at indices [from, to)\n /// @dev When `from == 0`, the original array will match the slice. In other cases its state will be corrupted.\n function sliceDestructive(\n bytes memory b,\n uint256 from,\n uint256 to\n )\n internal\n pure\n returns (bytes memory result)\n {\n require(\n from <= to,\n \"FROM_LESS_THAN_TO_REQUIRED\"\n );\n require(\n to < b.length,\n \"TO_LESS_THAN_LENGTH_REQUIRED\"\n );\n \n // Create a new bytes structure around [from, to) in-place.\n assembly {\n result := add(b, from)\n mstore(result, sub(to, from))\n }\n return result;\n }\n\n /// @dev Pops the last byte off of a byte array by modifying its length.\n /// @param b Byte array that will be modified.\n /// @return The byte that was popped off.\n function popLastByte(bytes memory b)\n internal\n pure\n returns (bytes1 result)\n {\n require(\n b.length > 0,\n \"GREATER_THAN_ZERO_LENGTH_REQUIRED\"\n );\n\n // Store last byte.\n result = b[b.length - 1];\n\n assembly {\n // Decrement length of byte array.\n let newLen := sub(mload(b), 1)\n mstore(b, newLen)\n }\n return result;\n }\n\n /// @dev Pops the last 20 bytes off of a byte array by modifying its length.\n /// @param b Byte array that will be modified.\n /// @return The 20 byte address that was popped off.\n function popLast20Bytes(bytes memory b)\n internal\n pure\n returns (address result)\n {\n require(\n b.length >= 20,\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Store last 20 bytes.\n result = readAddress(b, b.length - 20);\n\n assembly {\n // Subtract 20 from byte array length.\n let newLen := sub(mload(b), 20)\n mstore(b, newLen)\n }\n return result;\n }\n\n /// @dev Tests equality of two byte arrays.\n /// @param lhs First byte array to compare.\n /// @param rhs Second byte array to compare.\n /// @return True if arrays are the same. False otherwise.\n function equals(\n bytes memory lhs,\n bytes memory rhs\n )\n internal\n pure\n returns (bool equal)\n {\n // Keccak gas cost is 30 + numWords * 6. This is a cheap way to compare.\n // We early exit on unequal lengths, but keccak would also correctly\n // handle this.\n return lhs.length == rhs.length && keccak256(lhs) == keccak256(rhs);\n }\n\n /// @dev Reads an address from a position in a byte array.\n /// @param b Byte array containing an address.\n /// @param index Index in byte array of address.\n /// @return address from byte array.\n function readAddress(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (address result)\n {\n require(\n b.length >= index + 20, // 20 is length of address\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Add offset to index:\n // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)\n // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)\n index += 20;\n\n // Read address from array memory\n assembly {\n // 1. Add index to address of bytes array\n // 2. Load 32-byte word from memory\n // 3. Apply 20-byte mask to obtain address\n result := and(mload(add(b, index)), 0xffffffffffffffffffffffffffffffffffffffff)\n }\n return result;\n }\n\n /// @dev Writes an address into a specific position in a byte array.\n /// @param b Byte array to insert address into.\n /// @param index Index in byte array of address.\n /// @param input Address to put into byte array.\n function writeAddress(\n bytes memory b,\n uint256 index,\n address input\n )\n internal\n pure\n {\n require(\n b.length >= index + 20, // 20 is length of address\n \"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED\"\n );\n\n // Add offset to index:\n // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)\n // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)\n index += 20;\n\n // Store address into array memory\n assembly {\n // The address occupies 20 bytes and mstore stores 32 bytes.\n // First fetch the 32-byte word where we'll be storing the address, then\n // apply a mask so we have only the bytes in the word that the address will not occupy.\n // Then combine these bytes with the address and store the 32 bytes back to memory with mstore.\n\n // 1. Add index to address of bytes array\n // 2. Load 32-byte word from memory\n // 3. Apply 12-byte mask to obtain extra bytes occupying word of memory where we'll store the address\n let neighbors := and(\n mload(add(b, index)),\n 0xffffffffffffffffffffffff0000000000000000000000000000000000000000\n )\n \n // Make sure input address is clean.\n // (Solidity does not guarantee this)\n input := and(input, 0xffffffffffffffffffffffffffffffffffffffff)\n\n // Store the neighbors and address into memory\n mstore(add(b, index), xor(input, neighbors))\n }\n }\n\n /// @dev Reads a bytes32 value from a position in a byte array.\n /// @param b Byte array containing a bytes32 value.\n /// @param index Index in byte array of bytes32 value.\n /// @return bytes32 value from byte array.\n function readBytes32(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes32 result)\n {\n require(\n b.length >= index + 32,\n \"GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 256 bit length parameter\n index += 32;\n\n // Read the bytes32 from array memory\n assembly {\n result := mload(add(b, index))\n }\n return result;\n }\n\n /// @dev Writes a bytes32 into a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input bytes32 to put into byte array.\n function writeBytes32(\n bytes memory b,\n uint256 index,\n bytes32 input\n )\n internal\n pure\n {\n require(\n b.length >= index + 32,\n \"GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 256 bit length parameter\n index += 32;\n\n // Read the bytes32 from array memory\n assembly {\n mstore(add(b, index), input)\n }\n }\n\n /// @dev Reads a uint256 value from a position in a byte array.\n /// @param b Byte array containing a uint256 value.\n /// @param index Index in byte array of uint256 value.\n /// @return uint256 value from byte array.\n function readUint256(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (uint256 result)\n {\n result = uint256(readBytes32(b, index));\n return result;\n }\n\n /// @dev Writes a uint256 into a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input uint256 to put into byte array.\n function writeUint256(\n bytes memory b,\n uint256 index,\n uint256 input\n )\n internal\n pure\n {\n writeBytes32(b, index, bytes32(input));\n }\n\n /// @dev Reads an unpadded bytes4 value from a position in a byte array.\n /// @param b Byte array containing a bytes4 value.\n /// @param index Index in byte array of bytes4 value.\n /// @return bytes4 value from byte array.\n function readBytes4(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes4 result)\n {\n require(\n b.length >= index + 4,\n \"GREATER_OR_EQUAL_TO_4_LENGTH_REQUIRED\"\n );\n\n // Arrays are prefixed by a 32 byte length field\n index += 32;\n\n // Read the bytes4 from array memory\n assembly {\n result := mload(add(b, index))\n // Solidity does not require us to clean the trailing bytes.\n // We do it anyway\n result := and(result, 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000)\n }\n return result;\n }\n\n /// @dev Reads nested bytes from a specific position.\n /// @dev NOTE: the returned value overlaps with the input value.\n /// Both should be treated as immutable.\n /// @param b Byte array containing nested bytes.\n /// @param index Index of nested bytes.\n /// @return result Nested bytes.\n function readBytesWithLength(\n bytes memory b,\n uint256 index\n )\n internal\n pure\n returns (bytes memory result)\n {\n // Read length of nested bytes\n uint256 nestedBytesLength = readUint256(b, index);\n index += 32;\n\n // Assert length of <b> is valid, given\n // length of nested bytes\n require(\n b.length >= index + nestedBytesLength,\n \"GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED\"\n );\n \n // Return a pointer to the byte array as it exists inside `b`\n assembly {\n result := add(b, index)\n }\n return result;\n }\n\n /// @dev Inserts bytes at a specific position in a byte array.\n /// @param b Byte array to insert <input> into.\n /// @param index Index in byte array of <input>.\n /// @param input bytes to insert.\n function writeBytesWithLength(\n bytes memory b,\n uint256 index,\n bytes memory input\n )\n internal\n pure\n {\n // Assert length of <b> is valid, given\n // length of input\n require(\n b.length >= index + 32 + input.length, // 32 bytes to store length\n \"GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED\"\n );\n\n // Copy <input> into <b>\n memCopy(\n b.contentAddress() + index,\n input.rawAddress(), // includes length of <input>\n input.length + 32 // +32 bytes to store <input> length\n );\n }\n\n /// @dev Performs a deep copy of a byte array onto another byte array of greater than or equal length.\n /// @param dest Byte array that will be overwritten with source bytes.\n /// @param source Byte array to copy onto dest bytes.\n function deepCopyBytes(\n bytes memory dest,\n bytes memory source\n )\n internal\n pure\n {\n uint256 sourceLen = source.length;\n // Dest length must be >= source length, or some bytes would not be copied.\n require(\n dest.length >= sourceLen,\n \"GREATER_OR_EQUAL_TO_SOURCE_BYTES_LENGTH_REQUIRED\"\n );\n memCopy(\n dest.contentAddress(),\n source.contentAddress(),\n sourceLen\n );\n }\n}\n",
- "2.0.0/utils/Ownable/IOwnable.sol": "pragma solidity 0.4.24;\n\n\ncontract IOwnable {\n\n function transferOwnership(address newOwner)\n public;\n}\n",
- "2.0.0/utils/Ownable/Ownable.sol": "pragma solidity 0.4.24;\n\nimport \"./IOwnable.sol\";\n\n\ncontract Ownable is\n IOwnable\n{\n address public owner;\n\n constructor ()\n public\n {\n owner = msg.sender;\n }\n\n modifier onlyOwner() {\n require(\n msg.sender == owner,\n \"ONLY_CONTRACT_OWNER\"\n );\n _;\n }\n\n function transferOwnership(address newOwner)\n public\n onlyOwner\n {\n if (newOwner != address(0)) {\n owner = newOwner;\n }\n }\n}\n",
- "2.0.0/utils/ReentrancyGuard/ReentrancyGuard.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.24;\n\n\ncontract ReentrancyGuard {\n\n // Locked state of mutex\n bool private locked = false;\n\n /// @dev Functions with this modifer cannot be reentered. The mutex will be locked\n /// before function execution and unlocked after.\n modifier nonReentrant() {\n // Ensure mutex is unlocked\n require(\n !locked,\n \"REENTRANCY_ILLEGAL\"\n );\n\n // Lock mutex before function call\n locked = true;\n\n // Perform function call\n _;\n\n // Unlock mutex after function call\n locked = false;\n }\n}\n",
- "2.0.0/utils/SafeMath/SafeMath.sol": "pragma solidity 0.4.24;\n\n\ncontract SafeMath {\n\n function safeMul(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n if (a == 0) {\n return 0;\n }\n uint256 c = a * b;\n require(\n c / a == b,\n \"UINT256_OVERFLOW\"\n );\n return c;\n }\n\n function safeDiv(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n uint256 c = a / b;\n return c;\n }\n\n function safeSub(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n require(\n b <= a,\n \"UINT256_UNDERFLOW\"\n );\n return a - b;\n }\n\n function safeAdd(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n uint256 c = a + b;\n require(\n c >= a,\n \"UINT256_OVERFLOW\"\n );\n return c;\n }\n\n function max64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n\n function max256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n}\n"
- },
- "sourceTreeHashHex": "0x95729ff69e872a60a92c7eef28cea3188d821ab1a379a46c12b21fc386a9855c",
- "compiler": {
- "name": "solc",
- "version": "soljson-v0.4.24+commit.e67f0147.js",
- "settings": {
- "optimizer": {
- "enabled": true,
- "runs": 1000000
- },
- "outputSelection": {
- "*": {
- "*": [
- "abi",
- "evm.bytecode.object",
- "evm.bytecode.sourceMap",
- "evm.deployedBytecode.object",
- "evm.deployedBytecode.sourceMap"
- ]
- }
- }
- }
- },
- "networks": {
- "1": {
- "address": "0x9463e518dea6810309563c81d5266c1b1d149138",
- "links": {},
- "constructorArgs": "[\"0x4f833a24e1f95d70f028921e27040ca56e09ab0b\",\"0xf47261b0000000000000000000000000e41d2489571d322189246dafa5ebde1f4699f498\"]"
- },
- "3": {
- "address": "0x90431a90516ab49af23a0530e04e8c7836e7122f",
- "links": {},
- "constructorArgs": "[\"0x4530c0483a1633c7a1c97d2c53721caff2caaaaf\",\"0xf47261b0000000000000000000000000ff67881f8d12f372d91baae9752eb3631ff0ed00\"]"
- },
- "42": {
- "address": "0xb389da3d204b412df2f75c6afb3d0a7ce0bc283d",
- "links": {},
- "constructorArgs": "[\"0x35dd2932454449b14cee11a94d3674a936d5d7b2\",\"0xf47261b00000000000000000000000002002d3812f58e35f0ea1ffbf80a75a38c32175fa\"]"
- },
- "50": {
- "address": "0xe86bb98fcf9bff3512c74589b78fb168200cc546",
- "links": {},
- "constructorArgs": "[\"0x48bacb9266a570d521063ef5dd96e61686dbe788\",\"0xf47261b0000000000000000000000000871dd7c2b4b25e1aa18728e9d5f2af4c4e431f5c\"]"
- }
- }
-}
diff --git a/packages/migrations/artifacts/2.0.0/WETH9.json b/packages/migrations/artifacts/2.0.0/WETH9.json
deleted file mode 100644
index a4f90ae2f..000000000
--- a/packages/migrations/artifacts/2.0.0/WETH9.json
+++ /dev/null
@@ -1,351 +0,0 @@
-{
- "schemaVersion": "2.0.0",
- "contractName": "WETH9",
- "compilerOutput": {
- "abi": [
- {
- "constant": true,
- "inputs": [],
- "name": "name",
- "outputs": [
- {
- "name": "",
- "type": "string"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "guy",
- "type": "address"
- },
- {
- "name": "wad",
- "type": "uint256"
- }
- ],
- "name": "approve",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "totalSupply",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "src",
- "type": "address"
- },
- {
- "name": "dst",
- "type": "address"
- },
- {
- "name": "wad",
- "type": "uint256"
- }
- ],
- "name": "transferFrom",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "wad",
- "type": "uint256"
- }
- ],
- "name": "withdraw",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "decimals",
- "outputs": [
- {
- "name": "",
- "type": "uint8"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "",
- "type": "address"
- }
- ],
- "name": "balanceOf",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "symbol",
- "outputs": [
- {
- "name": "",
- "type": "string"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "dst",
- "type": "address"
- },
- {
- "name": "wad",
- "type": "uint256"
- }
- ],
- "name": "transfer",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [],
- "name": "deposit",
- "outputs": [],
- "payable": true,
- "stateMutability": "payable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "",
- "type": "address"
- },
- {
- "name": "",
- "type": "address"
- }
- ],
- "name": "allowance",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "payable": true,
- "stateMutability": "payable",
- "type": "fallback"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "_owner",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "_spender",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "Approval",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "_from",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "_to",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "Transfer",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "_owner",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "Deposit",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "_owner",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "Withdrawal",
- "type": "event"
- }
- ],
- "evm": {
- "bytecode": {
- "linkReferences": {},
- "object": "0x60c0604052600d60808190527f577261707065642045746865720000000000000000000000000000000000000060a090815261003e91600091906100a3565b506040805180820190915260048082527f57455448000000000000000000000000000000000000000000000000000000006020909201918252610083916001916100a3565b506002805460ff1916601217905534801561009d57600080fd5b5061013e565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106100e457805160ff1916838001178555610111565b82800160010185558215610111579182015b828111156101115782518255916020019190600101906100f6565b5061011d929150610121565b5090565b61013b91905b8082111561011d5760008155600101610127565b90565b6107688061014d6000396000f3006080604052600436106100ae5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100b8578063095ea7b31461014257806318160ddd1461018757806323b872dd146101ae5780632e1a7d4d146101e5578063313ce567146101fd57806370a082311461022857806395d89b4114610256578063a9059cbb1461026b578063d0e30db0146100ae578063dd62ed3e1461029c575b6100b66102d0565b005b3480156100c457600080fd5b506100cd61031f565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101075781810151838201526020016100ef565b50505050905090810190601f1680156101345780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561014e57600080fd5b5061017373ffffffffffffffffffffffffffffffffffffffff600435166024356103cb565b604080519115158252519081900360200190f35b34801561019357600080fd5b5061019c61043e565b60408051918252519081900360200190f35b3480156101ba57600080fd5b5061017373ffffffffffffffffffffffffffffffffffffffff60043581169060243516604435610443565b3480156101f157600080fd5b506100b66004356105e3565b34801561020957600080fd5b50610212610678565b6040805160ff9092168252519081900360200190f35b34801561023457600080fd5b5061019c73ffffffffffffffffffffffffffffffffffffffff60043516610681565b34801561026257600080fd5b506100cd610693565b34801561027757600080fd5b5061017373ffffffffffffffffffffffffffffffffffffffff6004351660243561070b565b3480156102a857600080fd5b5061019c73ffffffffffffffffffffffffffffffffffffffff6004358116906024351661071f565b33600081815260036020908152604091829020805434908101909155825190815291517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9281900390910190a2565b6000805460408051602060026001851615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f810184900484028201840190925281815292918301828280156103c35780601f10610398576101008083540402835291602001916103c3565b820191906000526020600020905b8154815290600101906020018083116103a657829003601f168201915b505050505081565b33600081815260046020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b303190565b73ffffffffffffffffffffffffffffffffffffffff831660009081526003602052604081205482111561047557600080fd5b73ffffffffffffffffffffffffffffffffffffffff841633148015906104eb575073ffffffffffffffffffffffffffffffffffffffff841660009081526004602090815260408083203384529091529020547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14155b156105655773ffffffffffffffffffffffffffffffffffffffff8416600090815260046020908152604080832033845290915290205482111561052d57600080fd5b73ffffffffffffffffffffffffffffffffffffffff841660009081526004602090815260408083203384529091529020805483900390555b73ffffffffffffffffffffffffffffffffffffffff808516600081815260036020908152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35060019392505050565b336000908152600360205260409020548111156105ff57600080fd5b33600081815260036020526040808220805485900390555183156108fc0291849190818181858888f1935050505015801561063e573d6000803e3d6000fd5b5060408051828152905133917f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65919081900360200190a250565b60025460ff1681565b60036020526000908152604090205481565b60018054604080516020600284861615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f810184900484028201840190925281815292918301828280156103c35780601f10610398576101008083540402835291602001916103c3565b6000610718338484610443565b9392505050565b6004602090815260009283526040808420909152908252902054815600a165627a7a72305820228981f11f47ad9630080069b0a81423fcfba5aa8e0f478a579c4bc080ba7e820029",
- "opcodes": "PUSH1 0xC0 PUSH1 0x40 MSTORE PUSH1 0xD PUSH1 0x80 DUP2 SWAP1 MSTORE PUSH32 0x5772617070656420457468657200000000000000000000000000000000000000 PUSH1 0xA0 SWAP1 DUP2 MSTORE PUSH2 0x3E SWAP2 PUSH1 0x0 SWAP2 SWAP1 PUSH2 0xA3 JUMP JUMPDEST POP PUSH1 0x40 DUP1 MLOAD DUP1 DUP3 ADD SWAP1 SWAP2 MSTORE PUSH1 0x4 DUP1 DUP3 MSTORE PUSH32 0x5745544800000000000000000000000000000000000000000000000000000000 PUSH1 0x20 SWAP1 SWAP3 ADD SWAP2 DUP3 MSTORE PUSH2 0x83 SWAP2 PUSH1 0x1 SWAP2 PUSH2 0xA3 JUMP JUMPDEST POP PUSH1 0x2 DUP1 SLOAD PUSH1 0xFF NOT AND PUSH1 0x12 OR SWAP1 SSTORE CALLVALUE DUP1 ISZERO PUSH2 0x9D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x13E JUMP JUMPDEST DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 PUSH1 0x1F ADD PUSH1 0x20 SWAP1 DIV DUP2 ADD SWAP3 DUP3 PUSH1 0x1F LT PUSH2 0xE4 JUMPI DUP1 MLOAD PUSH1 0xFF NOT AND DUP4 DUP1 ADD OR DUP6 SSTORE PUSH2 0x111 JUMP JUMPDEST DUP3 DUP1 ADD PUSH1 0x1 ADD DUP6 SSTORE DUP3 ISZERO PUSH2 0x111 JUMPI SWAP2 DUP3 ADD JUMPDEST DUP3 DUP2 GT ISZERO PUSH2 0x111 JUMPI DUP3 MLOAD DUP3 SSTORE SWAP2 PUSH1 0x20 ADD SWAP2 SWAP1 PUSH1 0x1 ADD SWAP1 PUSH2 0xF6 JUMP JUMPDEST POP PUSH2 0x11D SWAP3 SWAP2 POP PUSH2 0x121 JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST PUSH2 0x13B SWAP2 SWAP1 JUMPDEST DUP1 DUP3 GT ISZERO PUSH2 0x11D JUMPI PUSH1 0x0 DUP2 SSTORE PUSH1 0x1 ADD PUSH2 0x127 JUMP JUMPDEST SWAP1 JUMP JUMPDEST PUSH2 0x768 DUP1 PUSH2 0x14D PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN STOP PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0xAE JUMPI PUSH4 0xFFFFFFFF PUSH29 0x100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD DIV AND PUSH4 0x6FDDE03 DUP2 EQ PUSH2 0xB8 JUMPI DUP1 PUSH4 0x95EA7B3 EQ PUSH2 0x142 JUMPI DUP1 PUSH4 0x18160DDD EQ PUSH2 0x187 JUMPI DUP1 PUSH4 0x23B872DD EQ PUSH2 0x1AE JUMPI DUP1 PUSH4 0x2E1A7D4D EQ PUSH2 0x1E5 JUMPI DUP1 PUSH4 0x313CE567 EQ PUSH2 0x1FD JUMPI DUP1 PUSH4 0x70A08231 EQ PUSH2 0x228 JUMPI DUP1 PUSH4 0x95D89B41 EQ PUSH2 0x256 JUMPI DUP1 PUSH4 0xA9059CBB EQ PUSH2 0x26B JUMPI DUP1 PUSH4 0xD0E30DB0 EQ PUSH2 0xAE JUMPI DUP1 PUSH4 0xDD62ED3E EQ PUSH2 0x29C JUMPI JUMPDEST PUSH2 0xB6 PUSH2 0x2D0 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xC4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xCD PUSH2 0x31F JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 DUP1 DUP3 MSTORE DUP4 MLOAD DUP2 DUP4 ADD MSTORE DUP4 MLOAD SWAP2 SWAP3 DUP4 SWAP3 SWAP1 DUP4 ADD SWAP2 DUP6 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x107 JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH2 0xEF JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x134 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x14E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x173 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x3CB JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 ISZERO ISZERO DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x193 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19C PUSH2 0x43E JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1BA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x173 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH1 0x44 CALLDATALOAD PUSH2 0x443 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1F1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xB6 PUSH1 0x4 CALLDATALOAD PUSH2 0x5E3 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x209 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x212 PUSH2 0x678 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0xFF SWAP1 SWAP3 AND DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x234 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19C PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x681 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x262 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xCD PUSH2 0x693 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x277 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x173 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x70B JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2A8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19C PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH2 0x71F JUMP JUMPDEST CALLER PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x3 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP2 DUP3 SWAP1 KECCAK256 DUP1 SLOAD CALLVALUE SWAP1 DUP2 ADD SWAP1 SWAP2 SSTORE DUP3 MLOAD SWAP1 DUP2 MSTORE SWAP2 MLOAD PUSH32 0xE1FFFCC4923D04B559F4D29A8BFC6CDA04EB5B0D3C460751C2402C5C5CC9109C SWAP3 DUP2 SWAP1 SUB SWAP1 SWAP2 ADD SWAP1 LOG2 JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 PUSH1 0x2 PUSH1 0x1 DUP6 AND ISZERO PUSH2 0x100 MUL PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 SWAP5 AND SWAP4 SWAP1 SWAP4 DIV PUSH1 0x1F DUP2 ADD DUP5 SWAP1 DIV DUP5 MUL DUP3 ADD DUP5 ADD SWAP1 SWAP3 MSTORE DUP2 DUP2 MSTORE SWAP3 SWAP2 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0x3C3 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x398 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x3C3 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x3A6 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP DUP2 JUMP JUMPDEST CALLER PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x4 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 AND DUP1 DUP6 MSTORE SWAP1 DUP4 MSTORE DUP2 DUP5 KECCAK256 DUP7 SWAP1 SSTORE DUP2 MLOAD DUP7 DUP2 MSTORE SWAP2 MLOAD SWAP4 SWAP5 SWAP1 SWAP4 SWAP1 SWAP3 PUSH32 0x8C5BE1E5EBEC7D5BD14F71427D1E84F3DD0314C0F7B2291E5B200AC8C7C3B925 SWAP3 DUP3 SWAP1 SUB ADD SWAP1 LOG3 POP PUSH1 0x1 SWAP3 SWAP2 POP POP JUMP JUMPDEST ADDRESS BALANCE SWAP1 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x3 PUSH1 0x20 MSTORE PUSH1 0x40 DUP2 KECCAK256 SLOAD DUP3 GT ISZERO PUSH2 0x475 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND CALLER EQ DUP1 ISZERO SWAP1 PUSH2 0x4EB JUMPI POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x4 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 CALLER DUP5 MSTORE SWAP1 SWAP2 MSTORE SWAP1 KECCAK256 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF EQ ISZERO JUMPDEST ISZERO PUSH2 0x565 JUMPI PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x4 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 CALLER DUP5 MSTORE SWAP1 SWAP2 MSTORE SWAP1 KECCAK256 SLOAD DUP3 GT ISZERO PUSH2 0x52D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x4 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 CALLER DUP5 MSTORE SWAP1 SWAP2 MSTORE SWAP1 KECCAK256 DUP1 SLOAD DUP4 SWAP1 SUB SWAP1 SSTORE JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP6 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x3 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 DUP1 SLOAD DUP9 SWAP1 SUB SWAP1 SSTORE SWAP4 DUP8 AND DUP1 DUP4 MSTORE SWAP2 DUP5 SWAP1 KECCAK256 DUP1 SLOAD DUP8 ADD SWAP1 SSTORE DUP4 MLOAD DUP7 DUP2 MSTORE SWAP4 MLOAD SWAP2 SWAP4 PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF SWAP3 SWAP1 DUP2 SWAP1 SUB SWAP1 SWAP2 ADD SWAP1 LOG3 POP PUSH1 0x1 SWAP4 SWAP3 POP POP POP JUMP JUMPDEST CALLER PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x3 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP2 GT ISZERO PUSH2 0x5FF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST CALLER PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x3 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 DUP1 SLOAD DUP6 SWAP1 SUB SWAP1 SSTORE MLOAD DUP4 ISZERO PUSH2 0x8FC MUL SWAP2 DUP5 SWAP2 SWAP1 DUP2 DUP2 DUP2 DUP6 DUP9 DUP9 CALL SWAP4 POP POP POP POP ISZERO DUP1 ISZERO PUSH2 0x63E JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP PUSH1 0x40 DUP1 MLOAD DUP3 DUP2 MSTORE SWAP1 MLOAD CALLER SWAP2 PUSH32 0x7FCF532C15F0A6DB0BD6D0E038BEA71D30D808C7D98CB3BF7268A95BF5081B65 SWAP2 SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 LOG2 POP JUMP JUMPDEST PUSH1 0x2 SLOAD PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH1 0x3 PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x1 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 PUSH1 0x2 DUP5 DUP7 AND ISZERO PUSH2 0x100 MUL PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 SWAP5 AND SWAP4 SWAP1 SWAP4 DIV PUSH1 0x1F DUP2 ADD DUP5 SWAP1 DIV DUP5 MUL DUP3 ADD DUP5 ADD SWAP1 SWAP3 MSTORE DUP2 DUP2 MSTORE SWAP3 SWAP2 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0x3C3 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x398 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x3C3 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x718 CALLER DUP5 DUP5 PUSH2 0x443 JUMP JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x4 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x0 SWAP3 DUP4 MSTORE PUSH1 0x40 DUP1 DUP5 KECCAK256 SWAP1 SWAP2 MSTORE SWAP1 DUP3 MSTORE SWAP1 KECCAK256 SLOAD DUP2 JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 0x22 DUP10 DUP2 CALL 0x1f 0x47 0xad SWAP7 ADDRESS ADDMOD STOP PUSH10 0xB0A81423FCFBA5AA8E0F 0x47 DUP11 JUMPI SWAP13 0x4b 0xc0 DUP1 0xba PUSH31 0x82002900000000000000000000000000000000000000000000000000000000 ",
- "sourceMap": "753:40:0:-;732:1806;753:40;;732:1806;753:40;;;;;;;;;;-1:-1:-1;;753:40:0;;:::i;:::-;-1:-1:-1;799:31:0;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;836:27:0;;;-1:-1:-1;;836:27:0;861:2;836:27;;;732:1806;5:2:-1;;;;30:1;27;20:12;5:2;732:1806:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;732:1806:0;;;-1:-1:-1;732:1806:0;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;"
- },
- "deployedBytecode": {
- "linkReferences": {},
- "object": "0x6080604052600436106100ae5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100b8578063095ea7b31461014257806318160ddd1461018757806323b872dd146101ae5780632e1a7d4d146101e5578063313ce567146101fd57806370a082311461022857806395d89b4114610256578063a9059cbb1461026b578063d0e30db0146100ae578063dd62ed3e1461029c575b6100b66102d0565b005b3480156100c457600080fd5b506100cd61031f565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101075781810151838201526020016100ef565b50505050905090810190601f1680156101345780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561014e57600080fd5b5061017373ffffffffffffffffffffffffffffffffffffffff600435166024356103cb565b604080519115158252519081900360200190f35b34801561019357600080fd5b5061019c61043e565b60408051918252519081900360200190f35b3480156101ba57600080fd5b5061017373ffffffffffffffffffffffffffffffffffffffff60043581169060243516604435610443565b3480156101f157600080fd5b506100b66004356105e3565b34801561020957600080fd5b50610212610678565b6040805160ff9092168252519081900360200190f35b34801561023457600080fd5b5061019c73ffffffffffffffffffffffffffffffffffffffff60043516610681565b34801561026257600080fd5b506100cd610693565b34801561027757600080fd5b5061017373ffffffffffffffffffffffffffffffffffffffff6004351660243561070b565b3480156102a857600080fd5b5061019c73ffffffffffffffffffffffffffffffffffffffff6004358116906024351661071f565b33600081815260036020908152604091829020805434908101909155825190815291517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9281900390910190a2565b6000805460408051602060026001851615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f810184900484028201840190925281815292918301828280156103c35780601f10610398576101008083540402835291602001916103c3565b820191906000526020600020905b8154815290600101906020018083116103a657829003601f168201915b505050505081565b33600081815260046020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b303190565b73ffffffffffffffffffffffffffffffffffffffff831660009081526003602052604081205482111561047557600080fd5b73ffffffffffffffffffffffffffffffffffffffff841633148015906104eb575073ffffffffffffffffffffffffffffffffffffffff841660009081526004602090815260408083203384529091529020547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14155b156105655773ffffffffffffffffffffffffffffffffffffffff8416600090815260046020908152604080832033845290915290205482111561052d57600080fd5b73ffffffffffffffffffffffffffffffffffffffff841660009081526004602090815260408083203384529091529020805483900390555b73ffffffffffffffffffffffffffffffffffffffff808516600081815260036020908152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35060019392505050565b336000908152600360205260409020548111156105ff57600080fd5b33600081815260036020526040808220805485900390555183156108fc0291849190818181858888f1935050505015801561063e573d6000803e3d6000fd5b5060408051828152905133917f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65919081900360200190a250565b60025460ff1681565b60036020526000908152604090205481565b60018054604080516020600284861615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f810184900484028201840190925281815292918301828280156103c35780601f10610398576101008083540402835291602001916103c3565b6000610718338484610443565b9392505050565b6004602090815260009283526040808420909152908252902054815600a165627a7a72305820228981f11f47ad9630080069b0a81423fcfba5aa8e0f478a579c4bc080ba7e820029",
- "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0xAE JUMPI PUSH4 0xFFFFFFFF PUSH29 0x100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD DIV AND PUSH4 0x6FDDE03 DUP2 EQ PUSH2 0xB8 JUMPI DUP1 PUSH4 0x95EA7B3 EQ PUSH2 0x142 JUMPI DUP1 PUSH4 0x18160DDD EQ PUSH2 0x187 JUMPI DUP1 PUSH4 0x23B872DD EQ PUSH2 0x1AE JUMPI DUP1 PUSH4 0x2E1A7D4D EQ PUSH2 0x1E5 JUMPI DUP1 PUSH4 0x313CE567 EQ PUSH2 0x1FD JUMPI DUP1 PUSH4 0x70A08231 EQ PUSH2 0x228 JUMPI DUP1 PUSH4 0x95D89B41 EQ PUSH2 0x256 JUMPI DUP1 PUSH4 0xA9059CBB EQ PUSH2 0x26B JUMPI DUP1 PUSH4 0xD0E30DB0 EQ PUSH2 0xAE JUMPI DUP1 PUSH4 0xDD62ED3E EQ PUSH2 0x29C JUMPI JUMPDEST PUSH2 0xB6 PUSH2 0x2D0 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xC4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xCD PUSH2 0x31F JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 DUP1 DUP3 MSTORE DUP4 MLOAD DUP2 DUP4 ADD MSTORE DUP4 MLOAD SWAP2 SWAP3 DUP4 SWAP3 SWAP1 DUP4 ADD SWAP2 DUP6 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x107 JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH2 0xEF JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x134 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x14E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x173 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x3CB JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 ISZERO ISZERO DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x193 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19C PUSH2 0x43E JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1BA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x173 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH1 0x44 CALLDATALOAD PUSH2 0x443 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1F1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xB6 PUSH1 0x4 CALLDATALOAD PUSH2 0x5E3 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x209 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x212 PUSH2 0x678 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0xFF SWAP1 SWAP3 AND DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x234 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19C PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x681 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x262 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xCD PUSH2 0x693 JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x277 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x173 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x70B JUMP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2A8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19C PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH2 0x71F JUMP JUMPDEST CALLER PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x3 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP2 DUP3 SWAP1 KECCAK256 DUP1 SLOAD CALLVALUE SWAP1 DUP2 ADD SWAP1 SWAP2 SSTORE DUP3 MLOAD SWAP1 DUP2 MSTORE SWAP2 MLOAD PUSH32 0xE1FFFCC4923D04B559F4D29A8BFC6CDA04EB5B0D3C460751C2402C5C5CC9109C SWAP3 DUP2 SWAP1 SUB SWAP1 SWAP2 ADD SWAP1 LOG2 JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 PUSH1 0x2 PUSH1 0x1 DUP6 AND ISZERO PUSH2 0x100 MUL PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 SWAP5 AND SWAP4 SWAP1 SWAP4 DIV PUSH1 0x1F DUP2 ADD DUP5 SWAP1 DIV DUP5 MUL DUP3 ADD DUP5 ADD SWAP1 SWAP3 MSTORE DUP2 DUP2 MSTORE SWAP3 SWAP2 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0x3C3 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x398 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x3C3 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x3A6 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP DUP2 JUMP JUMPDEST CALLER PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x4 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP8 AND DUP1 DUP6 MSTORE SWAP1 DUP4 MSTORE DUP2 DUP5 KECCAK256 DUP7 SWAP1 SSTORE DUP2 MLOAD DUP7 DUP2 MSTORE SWAP2 MLOAD SWAP4 SWAP5 SWAP1 SWAP4 SWAP1 SWAP3 PUSH32 0x8C5BE1E5EBEC7D5BD14F71427D1E84F3DD0314C0F7B2291E5B200AC8C7C3B925 SWAP3 DUP3 SWAP1 SUB ADD SWAP1 LOG3 POP PUSH1 0x1 SWAP3 SWAP2 POP POP JUMP JUMPDEST ADDRESS BALANCE SWAP1 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x3 PUSH1 0x20 MSTORE PUSH1 0x40 DUP2 KECCAK256 SLOAD DUP3 GT ISZERO PUSH2 0x475 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND CALLER EQ DUP1 ISZERO SWAP1 PUSH2 0x4EB JUMPI POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x4 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 CALLER DUP5 MSTORE SWAP1 SWAP2 MSTORE SWAP1 KECCAK256 SLOAD PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF EQ ISZERO JUMPDEST ISZERO PUSH2 0x565 JUMPI PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x4 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 CALLER DUP5 MSTORE SWAP1 SWAP2 MSTORE SWAP1 KECCAK256 SLOAD DUP3 GT ISZERO PUSH2 0x52D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x4 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 CALLER DUP5 MSTORE SWAP1 SWAP2 MSTORE SWAP1 KECCAK256 DUP1 SLOAD DUP4 SWAP1 SUB SWAP1 SSTORE JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP6 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x3 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 DUP1 SLOAD DUP9 SWAP1 SUB SWAP1 SSTORE SWAP4 DUP8 AND DUP1 DUP4 MSTORE SWAP2 DUP5 SWAP1 KECCAK256 DUP1 SLOAD DUP8 ADD SWAP1 SSTORE DUP4 MLOAD DUP7 DUP2 MSTORE SWAP4 MLOAD SWAP2 SWAP4 PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF SWAP3 SWAP1 DUP2 SWAP1 SUB SWAP1 SWAP2 ADD SWAP1 LOG3 POP PUSH1 0x1 SWAP4 SWAP3 POP POP POP JUMP JUMPDEST CALLER PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x3 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP2 GT ISZERO PUSH2 0x5FF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST CALLER PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x3 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 DUP1 SLOAD DUP6 SWAP1 SUB SWAP1 SSTORE MLOAD DUP4 ISZERO PUSH2 0x8FC MUL SWAP2 DUP5 SWAP2 SWAP1 DUP2 DUP2 DUP2 DUP6 DUP9 DUP9 CALL SWAP4 POP POP POP POP ISZERO DUP1 ISZERO PUSH2 0x63E JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP PUSH1 0x40 DUP1 MLOAD DUP3 DUP2 MSTORE SWAP1 MLOAD CALLER SWAP2 PUSH32 0x7FCF532C15F0A6DB0BD6D0E038BEA71D30D808C7D98CB3BF7268A95BF5081B65 SWAP2 SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 LOG2 POP JUMP JUMPDEST PUSH1 0x2 SLOAD PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH1 0x3 PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x1 DUP1 SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 PUSH1 0x2 DUP5 DUP7 AND ISZERO PUSH2 0x100 MUL PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ADD SWAP1 SWAP5 AND SWAP4 SWAP1 SWAP4 DIV PUSH1 0x1F DUP2 ADD DUP5 SWAP1 DIV DUP5 MUL DUP3 ADD DUP5 ADD SWAP1 SWAP3 MSTORE DUP2 DUP2 MSTORE SWAP3 SWAP2 DUP4 ADD DUP3 DUP3 DUP1 ISZERO PUSH2 0x3C3 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x398 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x3C3 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x718 CALLER DUP5 DUP5 PUSH2 0x443 JUMP JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x4 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x0 SWAP3 DUP4 MSTORE PUSH1 0x40 DUP1 DUP5 KECCAK256 SWAP1 SWAP2 MSTORE SWAP1 DUP3 MSTORE SWAP1 KECCAK256 SLOAD DUP2 JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 0x22 DUP10 DUP2 CALL 0x1f 0x47 0xad SWAP7 ADDRESS ADDMOD STOP PUSH10 0xB0A81423FCFBA5AA8E0F 0x47 DUP11 JUMPI SWAP13 0x4b 0xc0 DUP1 0xba PUSH31 0x82002900000000000000000000000000000000000000000000000000000000 ",
- "sourceMap": "732:1806:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1329:9;:7;:9::i;:::-;732:1806;753:40;;8:9:-1;5:2;;;30:1;27;20:12;5:2;753:40:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:100:-1;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;753:40:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1776:172;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1776:172:0;;;;;;;;;;;;;;;;;;;;;;;;;;;1684:86;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1684:86:0;;;;;;;;;;;;;;;;;;;;2081:455;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2081:455:0;;;;;;;;;;;;;;1480:198;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1480:198:0;;;;;836:27;;8:9:-1;5:2;;;30:1;27;20:12;5:2;836:27:0;;;;;;;;;;;;;;;;;;;;;;;1150:65;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1150:65:0;;;;;;;799:31;;8:9:-1;5:2;;;30:1;27;20:12;5:2;799:31:0;;;;1954:121;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1954:121:0;;;;;;;;;1221:65;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1221:65:0;;;;;;;;;;;;1350:125;1404:10;1394:21;;;;:9;:21;;;;;;;;;:34;;1419:9;1394:34;;;;;;1438:30;;;;;;;;;;;;;;;;;1350:125::o;753:40::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;1776:172::-;1858:10;1832:4;1848:21;;;:9;:21;;;;;;;;;:26;;;;;;;;;;;:32;;;1890:30;;;;;;;1832:4;;1848:26;;1858:10;;1890:30;;;;;;;;-1:-1:-1;1937:4:0;1776:172;;;;:::o;1684:86::-;1751:4;:12;1684:86;:::o;2081:455::-;2199:14;;;2171:4;2199:14;;;:9;:14;;;;;;:21;-1:-1:-1;2199:21:0;2191:30;;;;;;2236:17;;;2243:10;2236:17;;;;:59;;-1:-1:-1;2257:14:0;;;;;;;:9;:14;;;;;;;;2272:10;2257:26;;;;;;;;2292:2;2257:38;;2236:59;2232:179;;;2319:14;;;;;;;:9;:14;;;;;;;;2334:10;2319:26;;;;;;;;:33;-1:-1:-1;2319:33:0;2311:42;;;;;;2367:14;;;;;;;:9;:14;;;;;;;;2382:10;2367:26;;;;;;;:33;;;;;;;2232:179;2421:14;;;;;;;;:9;:14;;;;;;;;:21;;;;;;;2452:14;;;;;;;;;;:21;;;;;;2484:23;;;;;;;2452:14;;2484:23;;;;;;;;;;;-1:-1:-1;2525:4:0;2081:455;;;;;:::o;1480:198::-;1543:10;1533:21;;;;:9;:21;;;;;;:28;-1:-1:-1;1533:28:0;1525:37;;;;;;1582:10;1572:21;;;;:9;:21;;;;;;:28;;;;;;;1610:24;;;;;;1597:3;;1610:24;;1572:21;1610:24;1597:3;1582:10;1610:24;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;-1:-1;1644:27:0;;;;;;;;1655:10;;1644:27;;;;;;;;;;1480:198;:::o;836:27::-;;;;;;:::o;1150:65::-;;;;;;;;;;;;;:::o;799:31::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1954:121;2011:4;2034:34;2047:10;2059:3;2064;2034:12;:34::i;:::-;2027:41;1954:121;-1:-1:-1;;;1954:121:0:o;1221:65::-;;;;;;;;;;;;;;;;;;;;;;;;:::o"
- }
- }
- },
- "sources": {
- "2.0.0/tokens/EtherToken/WETH9.sol": {
- "id": 0
- }
- },
- "sourceCodes": {
- "2.0.0/tokens/EtherToken/WETH9.sol": "// Copyright (C) 2015, 2016, 2017 Dapphub\n\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see <http://www.gnu.org/licenses/>.\n\n// solhint-disable\npragma solidity ^0.4.18;\n\n\ncontract WETH9 {\n string public name = \"Wrapped Ether\";\n string public symbol = \"WETH\";\n uint8 public decimals = 18;\n\n event Approval(address indexed _owner, address indexed _spender, uint _value);\n event Transfer(address indexed _from, address indexed _to, uint _value);\n event Deposit(address indexed _owner, uint _value);\n event Withdrawal(address indexed _owner, uint _value);\n\n mapping (address => uint) public balanceOf;\n mapping (address => mapping (address => uint)) public allowance;\n\n function() public payable {\n deposit();\n }\n function deposit() public payable {\n balanceOf[msg.sender] += msg.value;\n Deposit(msg.sender, msg.value);\n }\n function withdraw(uint wad) public {\n require(balanceOf[msg.sender] >= wad);\n balanceOf[msg.sender] -= wad;\n msg.sender.transfer(wad);\n Withdrawal(msg.sender, wad);\n }\n\n function totalSupply() public view returns (uint) {\n return this.balance;\n }\n\n function approve(address guy, uint wad) public returns (bool) {\n allowance[msg.sender][guy] = wad;\n Approval(msg.sender, guy, wad);\n return true;\n }\n\n function transfer(address dst, uint wad) public returns (bool) {\n return transferFrom(msg.sender, dst, wad);\n }\n\n function transferFrom(address src, address dst, uint wad)\n public\n returns (bool)\n {\n require(balanceOf[src] >= wad);\n\n if (src != msg.sender && allowance[src][msg.sender] != uint(-1)) {\n require(allowance[src][msg.sender] >= wad);\n allowance[src][msg.sender] -= wad;\n }\n\n balanceOf[src] -= wad;\n balanceOf[dst] += wad;\n\n Transfer(src, dst, wad);\n\n return true;\n }\n}\n\n\n/*\n GNU GENERAL PUBLIC LICENSE\n Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n Preamble\n\n The GNU General Public License is a free, copyleft license for\nsoftware and other kinds of works.\n\n The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works. By contrast,\nthe GNU General Public License is intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users. We, the Free Software Foundation, use the\nGNU General Public License for most of our software; it applies also to\nany other work released this way by its authors. You can apply it to\nyour programs, too.\n\n When we speak of free software, we are referring to freedom, not\nprice. Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n To protect your rights, we need to prevent others from denying you\nthese rights or asking you to surrender the rights. Therefore, you have\ncertain responsibilities if you distribute copies of the software, or if\nyou modify it: responsibilities to respect the freedom of others.\n\n For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must pass on to the recipients the same\nfreedoms that you received. You must make sure that they, too, receive\nor can get the source code. And you must show them these terms so they\nknow their rights.\n\n Developers that use the GNU GPL protect your rights with two steps:\n(1) assert copyright on the software, and (2) offer you this License\ngiving you legal permission to copy, distribute and/or modify it.\n\n For the developers' and authors' protection, the GPL clearly explains\nthat there is no warranty for this free software. For both users' and\nauthors' sake, the GPL requires that modified versions be marked as\nchanged, so that their problems will not be attributed erroneously to\nauthors of previous versions.\n\n Some devices are designed to deny users access to install or run\nmodified versions of the software inside them, although the manufacturer\ncan do so. This is fundamentally incompatible with the aim of\nprotecting users' freedom to change the software. The systematic\npattern of such abuse occurs in the area of products for individuals to\nuse, which is precisely where it is most unacceptable. Therefore, we\nhave designed this version of the GPL to prohibit the practice for those\nproducts. If such problems arise substantially in other domains, we\nstand ready to extend this provision to those domains in future versions\nof the GPL, as needed to protect the freedom of users.\n\n Finally, every program is threatened constantly by software patents.\nStates should not allow patents to restrict development and use of\nsoftware on general-purpose computers, but in those that do, we wish to\navoid the special danger that patents applied to a free program could\nmake it effectively proprietary. To prevent this, the GPL assures that\npatents cannot be used to render the program non-free.\n\n The precise terms and conditions for copying, distribution and\nmodification follow.\n\n TERMS AND CONDITIONS\n\n 0. Definitions.\n\n \"This License\" refers to version 3 of the GNU General Public License.\n\n \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n \"The Program\" refers to any copyrightable work licensed under this\nLicense. Each licensee is addressed as \"you\". \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy. The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy. Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies. Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License. If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n 1. Source Code.\n\n The \"source code\" for a work means the preferred form of the work\nfor making modifications to it. \"Object code\" means any non-source\nform of a work.\n\n A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form. A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities. However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work. For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n The Corresponding Source for a work in source code form is that\nsame work.\n\n 2. Basic Permissions.\n\n All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met. This License explicitly affirms your unlimited\npermission to run the unmodified Program. The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work. This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force. You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright. Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n Conveying under any other circumstances is permitted solely under\nthe conditions stated below. Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n 3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n 4. Conveying Verbatim Copies.\n\n You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n 5. Conveying Modified Source Versions.\n\n You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n a) The work must carry prominent notices stating that you modified\n it, and giving a relevant date.\n\n b) The work must carry prominent notices stating that it is\n released under this License and any conditions added under section\n 7. This requirement modifies the requirement in section 4 to\n \"keep intact all notices\".\n\n c) You must license the entire work, as a whole, under this\n License to anyone who comes into possession of a copy. This\n License will therefore apply, along with any applicable section 7\n additional terms, to the whole of the work, and all its parts,\n regardless of how they are packaged. This License gives no\n permission to license the work in any other way, but it does not\n invalidate such permission if you have separately received it.\n\n d) If the work has interactive user interfaces, each must display\n Appropriate Legal Notices; however, if the Program has interactive\n interfaces that do not display Appropriate Legal Notices, your\n work need not make them do so.\n\n A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit. Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n 6. Conveying Non-Source Forms.\n\n You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n a) Convey the object code in, or embodied in, a physical product\n (including a physical distribution medium), accompanied by the\n Corresponding Source fixed on a durable physical medium\n customarily used for software interchange.\n\n b) Convey the object code in, or embodied in, a physical product\n (including a physical distribution medium), accompanied by a\n written offer, valid for at least three years and valid for as\n long as you offer spare parts or customer support for that product\n model, to give anyone who possesses the object code either (1) a\n copy of the Corresponding Source for all the software in the\n product that is covered by this License, on a durable physical\n medium customarily used for software interchange, for a price no\n more than your reasonable cost of physically performing this\n conveying of source, or (2) access to copy the\n Corresponding Source from a network server at no charge.\n\n c) Convey individual copies of the object code with a copy of the\n written offer to provide the Corresponding Source. This\n alternative is allowed only occasionally and noncommercially, and\n only if you received the object code with such an offer, in accord\n with subsection 6b.\n\n d) Convey the object code by offering access from a designated\n place (gratis or for a charge), and offer equivalent access to the\n Corresponding Source in the same way through the same place at no\n further charge. You need not require recipients to copy the\n Corresponding Source along with the object code. If the place to\n copy the object code is a network server, the Corresponding Source\n may be on a different server (operated by you or a third party)\n that supports equivalent copying facilities, provided you maintain\n clear directions next to the object code saying where to find the\n Corresponding Source. Regardless of what server hosts the\n Corresponding Source, you remain obligated to ensure that it is\n available for as long as needed to satisfy these requirements.\n\n e) Convey the object code using peer-to-peer transmission, provided\n you inform other peers where the object code and Corresponding\n Source of the work are being offered to the general public at no\n charge under subsection 6d.\n\n A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling. In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage. For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product. A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source. The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information. But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed. Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n 7. Additional Terms.\n\n \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law. If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit. (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.) You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n a) Disclaiming warranty or limiting liability differently from the\n terms of sections 15 and 16 of this License; or\n\n b) Requiring preservation of specified reasonable legal notices or\n author attributions in that material or in the Appropriate Legal\n Notices displayed by works containing it; or\n\n c) Prohibiting misrepresentation of the origin of that material, or\n requiring that modified versions of such material be marked in\n reasonable ways as different from the original version; or\n\n d) Limiting the use for publicity purposes of names of licensors or\n authors of the material; or\n\n e) Declining to grant rights under trademark law for use of some\n trade names, trademarks, or service marks; or\n\n f) Requiring indemnification of licensors and authors of that\n material by anyone who conveys the material (or modified versions of\n it) with contractual assumptions of liability to the recipient, for\n any liability that these contractual assumptions directly impose on\n those licensors and authors.\n\n All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10. If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term. If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n 8. Termination.\n\n You may not propagate or modify a covered work except as expressly\nprovided under this License. Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License. If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n 9. Acceptance Not Required for Having Copies.\n\n You are not required to accept this License in order to receive or\nrun a copy of the Program. Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance. However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work. These actions infringe copyright if you do\nnot accept this License. Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n 10. Automatic Licensing of Downstream Recipients.\n\n Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License. You are not responsible\nfor enforcing compliance by third parties with this License.\n\n An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations. If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License. For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n 11. Patents.\n\n A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based. The\nwork thus licensed is called the contributor's \"contributor version\".\n\n A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version. For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement). To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients. \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License. You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n 12. No Surrender of Others' Freedom.\n\n If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License. If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all. For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n 13. Use with the GNU Affero General Public License.\n\n Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU Affero General Public License into a single\ncombined work, and to convey the resulting work. The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the special requirements of the GNU Affero General Public License,\nsection 13, concerning interaction through a network will apply to the\ncombination as such.\n\n 14. Revised Versions of this License.\n\n The Free Software Foundation may publish revised and/or new versions of\nthe GNU General Public License from time to time. Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n Each version is given a distinguishing version number. If the\nProgram specifies that a certain numbered version of the GNU General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation. If the Program does not specify a version number of the\nGNU General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n If the Program specifies that a proxy can decide which future\nversions of the GNU General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n Later license versions may give you additional or different\npermissions. However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n 15. Disclaimer of Warranty.\n\n THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n 16. Limitation of Liability.\n\n IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n 17. Interpretation of Sections 15 and 16.\n\n If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n END OF TERMS AND CONDITIONS\n\n How to Apply These Terms to Your New Programs\n\n If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n To do so, attach the following notices to the program. It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n <one line to give the program's name and a brief idea of what it does.>\n Copyright (C) <year> <name of author>\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program. If not, see <http://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n If the program does terminal interaction, make it output a short\nnotice like this when it starts in an interactive mode:\n\n <program> Copyright (C) <year> <name of author>\n This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n This is free software, and you are welcome to redistribute it\n under certain conditions; type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' should show the appropriate\nparts of the General Public License. Of course, your program's commands\nmight be different; for a GUI interface, you would use an \"about box\".\n\n You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU GPL, see\n<http://www.gnu.org/licenses/>.\n\n The GNU General Public License does not permit incorporating your program\ninto proprietary programs. If your program is a subroutine library, you\nmay consider it more useful to permit linking proprietary applications with\nthe library. If this is what you want to do, use the GNU Lesser General\nPublic License instead of this License. But first, please read\n<http://www.gnu.org/philosophy/why-not-lgpl.html>.\n\n*/\n"
- },
- "sourceTreeHashHex": "0x08a4125fbc1137215308db8e8f4c0774b2adbec12342172c17216bcaa6e596c6",
- "compiler": {
- "name": "solc",
- "version": "soljson-v0.4.24+commit.e67f0147.js",
- "settings": {
- "optimizer": {
- "enabled": true,
- "runs": 1000000
- },
- "outputSelection": {
- "*": {
- "*": [
- "abi",
- "evm.bytecode.object",
- "evm.bytecode.sourceMap",
- "evm.deployedBytecode.object",
- "evm.deployedBytecode.sourceMap"
- ]
- }
- }
- }
- },
- "networks": {
- "1": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "links": {},
- "constructorArgs": "[]"
- },
- "3": {
- "address": "0xc778417e063141139fce010982780140aa0cd5ab",
- "links": {},
- "constructorArgs": "[]"
- },
- "42": {
- "address": "0xd0a1e359811322d97991e03f863a0c30c2cf029c",
- "links": {},
- "constructorArgs": "[]"
- },
- "50": {
- "address": "0x0b1ba0af832d7c05fd64161e0db78e85978e8082",
- "links": {},
- "constructorArgs": "[]"
- }
- }
-}
diff --git a/packages/migrations/artifacts/2.0.0/ZRXToken.json b/packages/migrations/artifacts/2.0.0/ZRXToken.json
deleted file mode 100644
index b984aa171..000000000
--- a/packages/migrations/artifacts/2.0.0/ZRXToken.json
+++ /dev/null
@@ -1,10046 +0,0 @@
-{
- "schemaVersion": "2.0.0",
- "contractName": "ZRXToken",
- "compilerOutput": {
- "abi": [
- {
- "constant": true,
- "inputs": [],
- "name": "name",
- "outputs": [
- {
- "name": "",
- "type": "string"
- }
- ],
- "payable": false,
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_spender",
- "type": "address"
- },
- {
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "approve",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "totalSupply",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_from",
- "type": "address"
- },
- {
- "name": "_to",
- "type": "address"
- },
- {
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "transferFrom",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "decimals",
- "outputs": [
- {
- "name": "",
- "type": "uint8"
- }
- ],
- "payable": false,
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "_owner",
- "type": "address"
- }
- ],
- "name": "balanceOf",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "symbol",
- "outputs": [
- {
- "name": "",
- "type": "string"
- }
- ],
- "payable": false,
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_to",
- "type": "address"
- },
- {
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "transfer",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "_owner",
- "type": "address"
- },
- {
- "name": "_spender",
- "type": "address"
- }
- ],
- "name": "allowance",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "type": "function"
- },
- {
- "inputs": [],
- "payable": false,
- "type": "constructor"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "_from",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "_to",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "Transfer",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "_owner",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "_spender",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "Approval",
- "type": "event"
- }
- ],
- "devdoc": {
- "methods": {
- "transferFrom(address,address,uint256)": {
- "details": "ERC20 transferFrom, modified such that an allowance of MAX_UINT represents an unlimited allowance.",
- "params": {
- "_from": "Address to transfer from.",
- "_to": "Address to transfer to.",
- "_value": "Amount to transfer."
- },
- "return": "Success of transfer."
- }
- }
- },
- "evm": {
- "assembly": " /* \"2.0.0/tokens/ZRXToken/ZRXToken.sol\":795:1250 contract ZRXToken is ... */\n mstore(0x40, 0x60)\n /* \"2.0.0/tokens/ZRXToken/ZRXToken.sol\":966:972 10**27 */\n 0x33b2e3c9fd0803ce8000000\n /* \"2.0.0/tokens/ZRXToken/ZRXToken.sol\":937:972 uint256 public totalSupply = 10**27 */\n 0x3\n sstore\n /* \"2.0.0/tokens/ZRXToken/ZRXToken.sol\":1158:1248 function ZRXToken()... */\n jumpi(tag_1, iszero(callvalue))\n invalid\ntag_1:\ntag_2:\n /* \"2.0.0/tokens/ZRXToken/ZRXToken.sol\":1230:1241 totalSupply */\n sload(0x3)\n sub(exp(0x2, 0xa0), 0x1)\n /* \"2.0.0/tokens/ZRXToken/ZRXToken.sol\":1216:1226 msg.sender */\n caller\n /* \"2.0.0/tokens/ZRXToken/ZRXToken.sol\":1207:1227 balances[msg.sender] */\n and\n /* \"2.0.0/tokens/ZRXToken/ZRXToken.sol\":1207:1215 balances */\n 0x0\n /* \"2.0.0/tokens/ZRXToken/ZRXToken.sol\":1207:1227 balances[msg.sender] */\n swap1\n dup2\n mstore\n 0x20\n dup2\n swap1\n mstore\n 0x40\n swap1\n sha3\n /* \"2.0.0/tokens/ZRXToken/ZRXToken.sol\":1207:1241 balances[msg.sender] = totalSupply */\n sstore\n /* \"2.0.0/tokens/ZRXToken/ZRXToken.sol\":1158:1248 function ZRXToken()... */\ntag_3:\n /* \"2.0.0/tokens/ZRXToken/ZRXToken.sol\":795:1250 contract ZRXToken is ... */\ntag_4:\n dataSize(sub_0)\n dup1\n dataOffset(sub_0)\n 0x0\n codecopy\n 0x0\n return\nstop\n\nsub_0: assembly {\n /* \"2.0.0/tokens/ZRXToken/ZRXToken.sol\":795:1250 contract ZRXToken is ... */\n mstore(0x40, 0x60)\n jumpi(tag_1, iszero(calldatasize))\n and(div(calldataload(0x0), 0x100000000000000000000000000000000000000000000000000000000), 0xffffffff)\n 0x6fdde03\n dup2\n eq\n tag_2\n jumpi\n dup1\n 0x95ea7b3\n eq\n tag_3\n jumpi\n dup1\n 0x18160ddd\n eq\n tag_4\n jumpi\n dup1\n 0x23b872dd\n eq\n tag_5\n jumpi\n dup1\n 0x313ce567\n eq\n tag_6\n jumpi\n dup1\n 0x70a08231\n eq\n tag_7\n jumpi\n dup1\n 0x95d89b41\n eq\n tag_8\n jumpi\n dup1\n 0xa9059cbb\n eq\n tag_9\n jumpi\n dup1\n 0xdd62ed3e\n eq\n tag_10\n jumpi\n tag_1:\n invalid\n /* \"2.0.0/tokens/ZRXToken/ZRXToken.sol\":1017:1066 string constant public name = \"0x Protocol Token\" */\n tag_2:\n jumpi(tag_11, iszero(callvalue))\n invalid\n tag_11:\n tag_12\n jump(tag_13)\n tag_12:\n 0x40\n dup1\n mload\n 0x20\n dup1\n dup3\n mstore\n dup4\n mload\n dup2\n dup4\n add\n mstore\n dup4\n mload\n swap2\n swap3\n dup4\n swap3\n swap1\n dup4\n add\n swap2\n dup6\n add\n swap1\n dup1\n dup4\n dup4\n /* \"--CODEGEN--\":18:20 */\n dup3\n iszero\n /* \"--CODEGEN--\":13:16 */\n tag_14\n /* \"--CODEGEN--\":7:12 */\n jumpi\n /* \"--CODEGEN--\":32:37 */\n tag_15:\n /* \"--CODEGEN--\":59:62 */\n dup1\n /* \"--CODEGEN--\":53:58 */\n mload\n /* \"--CODEGEN--\":48:51 */\n dup3\n /* \"--CODEGEN--\":41:47 */\n mstore\n /* \"--CODEGEN--\":93:95 */\n 0x20\n /* \"--CODEGEN--\":88:91 */\n dup4\n /* \"--CODEGEN--\":85:87 */\n gt\n /* \"--CODEGEN--\":78:84 */\n iszero\n /* \"--CODEGEN--\":73:76 */\n tag_14\n /* \"--CODEGEN--\":67:72 */\n jumpi\n /* \"--CODEGEN--\":152:155 */\n 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0\n swap1\n swap3\n add\n swap2\n /* \"--CODEGEN--\":117:119 */\n 0x20\n /* \"--CODEGEN--\":108:111 */\n swap2\n dup3\n add\n swap2\n /* \"--CODEGEN--\":130:133 */\n add\n /* \"--CODEGEN--\":172:177 */\n tag_15\n /* \"--CODEGEN--\":167:171 */\n jump\n /* \"--CODEGEN--\":181:184 */\n tag_14:\n /* \"--CODEGEN--\":3:189 */\n pop\n pop\n pop\n swap1\n pop\n swap1\n dup2\n add\n swap1\n 0x1f\n and\n dup1\n iszero\n tag_16\n jumpi\n dup1\n dup3\n sub\n dup1\n mload\n 0x1\n dup4\n 0x20\n sub\n 0x100\n exp\n sub\n not\n and\n dup2\n mstore\n 0x20\n add\n swap2\n pop\n tag_16:\n pop\n swap3\n pop\n pop\n pop\n mload(0x40)\n dup1\n swap2\n sub\n swap1\n return\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1087:1274 */\n tag_3:\n jumpi(tag_17, iszero(callvalue))\n invalid\n tag_17:\n tag_18\n and(calldataload(0x4), 0xffffffffffffffffffffffffffffffffffffffff)\n calldataload(0x24)\n jump(tag_19)\n tag_18:\n 0x40\n dup1\n mload\n swap2\n iszero\n iszero\n dup3\n mstore\n mload\n swap1\n dup2\n swap1\n sub\n 0x20\n add\n swap1\n return\n /* \"2.0.0/tokens/ZRXToken/ZRXToken.sol\":937:972 uint256 public totalSupply = 10**27 */\n tag_4:\n jumpi(tag_20, iszero(callvalue))\n invalid\n tag_20:\n tag_21\n jump(tag_22)\n tag_21:\n 0x40\n dup1\n mload\n swap2\n dup3\n mstore\n mload\n swap1\n dup2\n swap1\n sub\n 0x20\n add\n swap1\n return\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1066:1675 */\n tag_5:\n jumpi(tag_23, iszero(callvalue))\n invalid\n tag_23:\n tag_18\n 0xffffffffffffffffffffffffffffffffffffffff\n calldataload(0x4)\n dup2\n and\n swap1\n calldataload(0x24)\n and\n calldataload(0x44)\n jump(tag_25)\n tag_24:\n 0x40\n dup1\n mload\n swap2\n iszero\n iszero\n dup3\n mstore\n mload\n swap1\n dup2\n swap1\n sub\n 0x20\n add\n swap1\n return\n /* \"2.0.0/tokens/ZRXToken/ZRXToken.sol\":896:931 uint8 constant public decimals = 18 */\n tag_6:\n jumpi(tag_26, iszero(callvalue))\n invalid\n tag_26:\n tag_27\n jump(tag_28)\n tag_27:\n 0x40\n dup1\n mload\n 0xff\n swap1\n swap3\n and\n dup3\n mstore\n mload\n swap1\n dup2\n swap1\n sub\n 0x20\n add\n swap1\n return\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":982:1081 */\n tag_7:\n jumpi(tag_29, iszero(callvalue))\n invalid\n tag_29:\n tag_21\n and(calldataload(0x4), 0xffffffffffffffffffffffffffffffffffffffff)\n jump(tag_31)\n tag_30:\n 0x40\n dup1\n mload\n swap2\n dup3\n mstore\n mload\n swap1\n dup2\n swap1\n sub\n 0x20\n add\n swap1\n return\n /* \"2.0.0/tokens/ZRXToken/ZRXToken.sol\":1072:1109 string constant public symbol = \"ZRX\" */\n tag_8:\n jumpi(tag_32, iszero(callvalue))\n invalid\n tag_32:\n tag_12\n jump(tag_34)\n tag_33:\n 0x40\n dup1\n mload\n 0x20\n dup1\n dup3\n mstore\n dup4\n mload\n dup2\n dup4\n add\n mstore\n dup4\n mload\n swap2\n swap3\n dup4\n swap3\n swap1\n dup4\n add\n swap2\n dup6\n add\n swap1\n dup1\n dup4\n dup4\n /* \"--CODEGEN--\":18:20 */\n dup3\n iszero\n /* \"--CODEGEN--\":13:16 */\n tag_14\n /* \"--CODEGEN--\":7:12 */\n jumpi\n /* \"--CODEGEN--\":32:37 */\n tag_36:\n /* \"--CODEGEN--\":59:62 */\n dup1\n /* \"--CODEGEN--\":53:58 */\n mload\n /* \"--CODEGEN--\":48:51 */\n dup3\n /* \"--CODEGEN--\":41:47 */\n mstore\n /* \"--CODEGEN--\":93:95 */\n 0x20\n /* \"--CODEGEN--\":88:91 */\n dup4\n /* \"--CODEGEN--\":85:87 */\n gt\n /* \"--CODEGEN--\":78:84 */\n iszero\n /* \"--CODEGEN--\":73:76 */\n tag_14\n /* \"--CODEGEN--\":67:72 */\n jumpi\n /* \"--CODEGEN--\":152:155 */\n 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0\n swap1\n swap3\n add\n swap2\n /* \"--CODEGEN--\":117:119 */\n 0x20\n /* \"--CODEGEN--\":108:111 */\n swap2\n dup3\n add\n swap2\n /* \"--CODEGEN--\":130:133 */\n add\n /* \"--CODEGEN--\":172:177 */\n tag_15\n /* \"--CODEGEN--\":167:171 */\n jump\n /* \"--CODEGEN--\":181:184 */\n tag_35:\n /* \"--CODEGEN--\":3:189 */\n pop\n pop\n pop\n swap1\n pop\n swap1\n dup2\n add\n swap1\n 0x1f\n and\n dup1\n iszero\n tag_16\n jumpi\n dup1\n dup3\n sub\n dup1\n mload\n 0x1\n dup4\n 0x20\n sub\n 0x100\n exp\n sub\n not\n and\n dup2\n mstore\n 0x20\n add\n swap2\n pop\n tag_37:\n pop\n swap3\n pop\n pop\n pop\n mload(0x40)\n dup1\n swap2\n sub\n swap1\n return\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":125:535 */\n tag_9:\n jumpi(tag_38, iszero(callvalue))\n invalid\n tag_38:\n tag_18\n and(calldataload(0x4), 0xffffffffffffffffffffffffffffffffffffffff)\n calldataload(0x24)\n jump(tag_40)\n tag_39:\n 0x40\n dup1\n mload\n swap2\n iszero\n iszero\n dup3\n mstore\n mload\n swap1\n dup2\n swap1\n sub\n 0x20\n add\n swap1\n return\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1280:1406 */\n tag_10:\n jumpi(tag_41, iszero(callvalue))\n invalid\n tag_41:\n tag_21\n 0xffffffffffffffffffffffffffffffffffffffff\n calldataload(0x4)\n dup2\n and\n swap1\n calldataload(0x24)\n and\n jump(tag_43)\n tag_42:\n 0x40\n dup1\n mload\n swap2\n dup3\n mstore\n mload\n swap1\n dup2\n swap1\n sub\n 0x20\n add\n swap1\n return\n /* \"2.0.0/tokens/ZRXToken/ZRXToken.sol\":1017:1066 string constant public name = \"0x Protocol Token\" */\n tag_13:\n 0x40\n dup1\n mload\n dup1\n dup3\n add\n swap1\n swap2\n mstore\n 0x11\n dup2\n mstore\n 0x30782050726f746f636f6c20546f6b656e000000000000000000000000000000\n 0x20\n dup3\n add\n mstore\n dup2\n jump\t// out\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1087:1274 */\n tag_19:\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1160:1179 */\n 0xffffffffffffffffffffffffffffffffffffffff\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1168:1178 */\n caller\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1160:1179 */\n dup2\n and\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1144:1148 */\n 0x0\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1160:1179 */\n dup2\n dup2\n mstore\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1160:1167 */\n 0x1\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1160:1179 */\n 0x20\n swap1\n dup2\n mstore\n 0x40\n dup1\n dup4\n sha3\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1160:1189 */\n swap5\n dup8\n and\n dup1\n dup5\n mstore\n swap5\n dup3\n mstore\n dup1\n dup4\n sha3\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1160:1198 */\n dup7\n swap1\n sstore\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1208:1246 */\n dup1\n mload\n dup7\n dup2\n mstore\n swap1\n mload\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1144:1148 */\n swap3\n swap5\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1160:1189 */\n swap4\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1160:1179 */\n swap3\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1208:1246 */\n 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925\n swap3\n swap2\n dup2\n swap1\n sub\n swap1\n swap2\n add\n swap1\n log3\n pop\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1263:1267 */\n 0x1\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1087:1274 */\n tag_44:\n swap3\n swap2\n pop\n pop\n jump\t// out\n /* \"2.0.0/tokens/ZRXToken/ZRXToken.sol\":937:972 uint256 public totalSupply = 10**27 */\n tag_22:\n sload(0x3)\n dup2\n jump\t// out\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1066:1675 */\n tag_25:\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1198:1212 */\n 0xffffffffffffffffffffffffffffffffffffffff\n dup1\n dup5\n and\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1161:1165 */\n 0x0\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1198:1212 */\n dup2\n dup2\n mstore\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1198:1205 */\n 0x1\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1198:1212 */\n 0x20\n swap1\n dup2\n mstore\n 0x40\n dup1\n dup4\n sha3\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1213:1223 */\n caller\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1198:1224 */\n swap1\n swap6\n and\n dup4\n mstore\n swap4\n dup2\n mstore\n dup4\n dup3\n sha3\n sload\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1238:1253 */\n swap3\n dup3\n mstore\n dup2\n swap1\n mstore\n swap2\n dup3\n sha3\n sload\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1238:1263 */\n dup4\n swap1\n lt\n dup1\n iszero\n swap1\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1238:1298 */\n tag_46\n jumpi\n pop\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1292:1298 */\n dup3\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1279:1288 */\n dup2\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1279:1298 */\n lt\n iszero\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1238:1298 */\n tag_46:\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1238:1353 */\n dup1\n iszero\n tag_47\n jumpi\n pop\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1340:1353 */\n 0xffffffffffffffffffffffffffffffffffffffff\n dup5\n and\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1340:1348 */\n 0x0\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1340:1353 */\n swap1\n dup2\n mstore\n 0x20\n dup2\n swap1\n mstore\n 0x40\n swap1\n sha3\n sload\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1314:1336 */\n dup4\n dup2\n add\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1314:1353 */\n lt\n iszero\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1238:1353 */\n tag_47:\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1234:1669 */\n iszero\n tag_48\n jumpi\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1378:1391 */\n 0xffffffffffffffffffffffffffffffffffffffff\n dup1\n dup6\n and\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1378:1386 */\n 0x0\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1378:1391 */\n swap1\n dup2\n mstore\n 0x20\n dup2\n swap1\n mstore\n 0x40\n dup1\n dup3\n sha3\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1378:1401 */\n dup1\n sload\n dup8\n add\n swap1\n sstore\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1415:1430 */\n swap2\n dup8\n and\n dup2\n mstore\n sha3\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1415:1440 */\n dup1\n sload\n dup5\n swap1\n sub\n swap1\n sstore\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":768:778 */\n 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1458:1478 */\n dup2\n lt\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1454:1549 */\n iszero\n tag_49\n jumpi\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1498:1512 */\n 0xffffffffffffffffffffffffffffffffffffffff\n dup1\n dup7\n and\n 0x0\n swap1\n dup2\n mstore\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1498:1505 */\n 0x1\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1498:1512 */\n 0x20\n swap1\n dup2\n mstore\n 0x40\n dup1\n dup4\n sha3\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1513:1523 */\n caller\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1498:1524 */\n swap1\n swap5\n and\n dup4\n mstore\n swap3\n swap1\n mstore\n sha3\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1498:1534 */\n dup1\n sload\n dup5\n swap1\n sub\n swap1\n sstore\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1454:1549 */\n tag_49:\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1578:1581 */\n dup4\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1562:1590 */\n 0xffffffffffffffffffffffffffffffffffffffff\n and\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1571:1576 */\n dup6\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1562:1590 */\n 0xffffffffffffffffffffffffffffffffffffffff\n and\n 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1583:1589 */\n dup6\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1562:1590 */\n mload(0x40)\n dup1\n dup3\n dup2\n mstore\n 0x20\n add\n swap2\n pop\n pop\n mload(0x40)\n dup1\n swap2\n sub\n swap1\n log3\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1611:1615 */\n 0x1\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1604:1615 */\n swap2\n pop\n jump(tag_50)\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1234:1669 */\n tag_48:\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1653:1658 */\n 0x0\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1646:1658 */\n swap2\n pop\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1234:1669 */\n tag_50:\n /* \"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":1066:1675 */\n tag_45:\n pop\n swap4\n swap3\n pop\n pop\n pop\n jump\t// out\n /* \"2.0.0/tokens/ZRXToken/ZRXToken.sol\":896:931 uint8 constant public decimals = 18 */\n tag_28:\n /* \"2.0.0/tokens/ZRXToken/ZRXToken.sol\":929:931 18 */\n 0x12\n /* \"2.0.0/tokens/ZRXToken/ZRXToken.sol\":896:931 uint8 constant public decimals = 18 */\n dup2\n jump\t// out\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":982:1081 */\n tag_31:\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1058:1074 */\n 0xffffffffffffffffffffffffffffffffffffffff\n dup2\n and\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1035:1039 */\n 0x0\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1058:1074 */\n swap1\n dup2\n mstore\n 0x20\n dup2\n swap1\n mstore\n 0x40\n swap1\n sha3\n sload\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":982:1081 */\n tag_51:\n swap2\n swap1\n pop\n jump\t// out\n /* \"2.0.0/tokens/ZRXToken/ZRXToken.sol\":1072:1109 string constant public symbol = \"ZRX\" */\n tag_34:\n 0x40\n dup1\n mload\n dup1\n dup3\n add\n swap1\n swap2\n mstore\n 0x3\n dup2\n mstore\n 0x5a52580000000000000000000000000000000000000000000000000000000000\n 0x20\n dup3\n add\n mstore\n dup2\n jump\t// out\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":125:535 */\n tag_40:\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":267:287 */\n 0xffffffffffffffffffffffffffffffffffffffff\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":276:286 */\n caller\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":267:287 */\n and\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":178:182 */\n 0x0\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":267:287 */\n swap1\n dup2\n mstore\n 0x20\n dup2\n swap1\n mstore\n 0x40\n dup2\n sha3\n sload\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":267:297 */\n dup3\n swap1\n lt\n dup1\n iszero\n swap1\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":267:340 */\n tag_53\n jumpi\n pop\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":327:340 */\n 0xffffffffffffffffffffffffffffffffffffffff\n dup4\n and\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":327:335 */\n 0x0\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":327:340 */\n swap1\n dup2\n mstore\n 0x20\n dup2\n swap1\n mstore\n 0x40\n swap1\n sha3\n sload\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":301:323 */\n dup3\n dup2\n add\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":301:340 */\n lt\n iszero\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":267:340 */\n tag_53:\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":263:529 */\n iszero\n tag_54\n jumpi\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":356:376 */\n 0xffffffffffffffffffffffffffffffffffffffff\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":365:375 */\n caller\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":356:376 */\n dup2\n and\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":356:364 */\n 0x0\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":356:376 */\n dup2\n dup2\n mstore\n 0x20\n dup2\n dup2\n mstore\n 0x40\n dup1\n dup4\n sha3\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":356:386 */\n dup1\n sload\n dup9\n swap1\n sub\n swap1\n sstore\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":400:413 */\n swap4\n dup8\n and\n dup1\n dup4\n mstore\n swap2\n dup5\n swap1\n sha3\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":400:423 */\n dup1\n sload\n dup8\n add\n swap1\n sstore\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":437:470 */\n dup4\n mload\n dup7\n dup2\n mstore\n swap4\n mload\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":400:413 */\n swap2\n swap4\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":437:470 */\n 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef\n swap3\n swap1\n dup2\n swap1\n sub\n swap1\n swap2\n add\n swap1\n log3\n pop\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":491:495 */\n 0x1\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":484:495 */\n jump(tag_44)\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":263:529 */\n tag_54:\n pop\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":521:526 */\n 0x0\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":514:526 */\n jump(tag_44)\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":263:529 */\n tag_55:\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":125:535 */\n tag_52:\n swap3\n swap2\n pop\n pop\n jump\t// out\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1280:1406 */\n tag_43:\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1374:1389 */\n 0xffffffffffffffffffffffffffffffffffffffff\n dup1\n dup4\n and\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1351:1355 */\n 0x0\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1374:1389 */\n swap1\n dup2\n mstore\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1374:1381 */\n 0x1\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1374:1389 */\n 0x20\n swap1\n dup2\n mstore\n 0x40\n dup1\n dup4\n sha3\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1374:1399 */\n swap4\n dup6\n and\n dup4\n mstore\n swap3\n swap1\n mstore\n sha3\n sload\n /* \"1.0.0/ERC20Token/ERC20Token_v1.sol\":1280:1406 */\n tag_56:\n swap3\n swap2\n pop\n pop\n jump\t// out\n}\n",
- "bytecode": {
- "linkReferences": {},
- "object": "0x60606040526b033b2e3c9fd0803ce8000000600355341561001c57fe5b5b600354600160a060020a0333166000908152602081905260409020555b5b61078d8061004a6000396000f300606060405236156100965763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610098578063095ea7b31461014657806318160ddd1461018657806323b872dd146101a8578063313ce567146101ee57806370a082311461021457806395d89b411461024f578063a9059cbb146102fd578063dd62ed3e1461033d575bfe5b34156100a057fe5b6100a861037e565b60408051602080825283518183015283519192839290830191850190808383821561010c575b80518252602083111561010c577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016100ce565b505050905090810190601f1680156101385780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561014e57fe5b61017273ffffffffffffffffffffffffffffffffffffffff600435166024356103b5565b604080519115158252519081900360200190f35b341561018e57fe5b61019661042d565b60408051918252519081900360200190f35b34156101b057fe5b61017273ffffffffffffffffffffffffffffffffffffffff60043581169060243516604435610433565b604080519115158252519081900360200190f35b34156101f657fe5b6101fe6105d4565b6040805160ff9092168252519081900360200190f35b341561021c57fe5b61019673ffffffffffffffffffffffffffffffffffffffff600435166105d9565b60408051918252519081900360200190f35b341561025757fe5b6100a8610605565b60408051602080825283518183015283519192839290830191850190808383821561010c575b80518252602083111561010c577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016100ce565b505050905090810190601f1680156101385780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561030557fe5b61017273ffffffffffffffffffffffffffffffffffffffff6004351660243561063c565b604080519115158252519081900360200190f35b341561034557fe5b61019673ffffffffffffffffffffffffffffffffffffffff60043581169060243516610727565b60408051918252519081900360200190f35b60408051808201909152601181527f30782050726f746f636f6c20546f6b656e000000000000000000000000000000602082015281565b73ffffffffffffffffffffffffffffffffffffffff338116600081815260016020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b60035481565b73ffffffffffffffffffffffffffffffffffffffff808416600081815260016020908152604080832033909516835293815283822054928252819052918220548390108015906104835750828110155b80156104b6575073ffffffffffffffffffffffffffffffffffffffff841660009081526020819052604090205483810110155b156105c65773ffffffffffffffffffffffffffffffffffffffff808516600090815260208190526040808220805487019055918716815220805484900390557fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8110156105585773ffffffffffffffffffffffffffffffffffffffff808616600090815260016020908152604080832033909416835292905220805484900390555b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191506105cb565b600091505b5b509392505050565b601281565b73ffffffffffffffffffffffffffffffffffffffff81166000908152602081905260409020545b919050565b60408051808201909152600381527f5a52580000000000000000000000000000000000000000000000000000000000602082015281565b73ffffffffffffffffffffffffffffffffffffffff3316600090815260208190526040812054829010801590610699575073ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205482810110155b156107185773ffffffffffffffffffffffffffffffffffffffff33811660008181526020818152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a3506001610427565b506000610427565b5b92915050565b73ffffffffffffffffffffffffffffffffffffffff8083166000908152600160209081526040808320938516835292905220545b929150505600a165627a7a723058201b5b70cf82a73dec658c2e60ab9a0f8e2ba01a74b66a6f5b0402f56d2ea0ffcf0029",
- "opcodes": "PUSH1 0x60 PUSH1 0x40 MSTORE PUSH12 0x33B2E3C9FD0803CE8000000 PUSH1 0x3 SSTORE CALLVALUE ISZERO PUSH2 0x1C JUMPI INVALID JUMPDEST JUMPDEST PUSH1 0x3 SLOAD PUSH1 0x1 PUSH1 0xA0 PUSH1 0x2 EXP SUB CALLER AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 SWAP1 SHA3 SSTORE JUMPDEST JUMPDEST PUSH2 0x78D DUP1 PUSH2 0x4A PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN STOP PUSH1 0x60 PUSH1 0x40 MSTORE CALLDATASIZE ISZERO PUSH2 0x96 JUMPI PUSH4 0xFFFFFFFF PUSH29 0x100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD DIV AND PUSH4 0x6FDDE03 DUP2 EQ PUSH2 0x98 JUMPI DUP1 PUSH4 0x95EA7B3 EQ PUSH2 0x146 JUMPI DUP1 PUSH4 0x18160DDD EQ PUSH2 0x186 JUMPI DUP1 PUSH4 0x23B872DD EQ PUSH2 0x1A8 JUMPI DUP1 PUSH4 0x313CE567 EQ PUSH2 0x1EE JUMPI DUP1 PUSH4 0x70A08231 EQ PUSH2 0x214 JUMPI DUP1 PUSH4 0x95D89B41 EQ PUSH2 0x24F JUMPI DUP1 PUSH4 0xA9059CBB EQ PUSH2 0x2FD JUMPI DUP1 PUSH4 0xDD62ED3E EQ PUSH2 0x33D JUMPI JUMPDEST INVALID JUMPDEST CALLVALUE ISZERO PUSH2 0xA0 JUMPI INVALID JUMPDEST PUSH2 0xA8 PUSH2 0x37E JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 DUP1 DUP3 MSTORE DUP4 MLOAD DUP2 DUP4 ADD MSTORE DUP4 MLOAD SWAP2 SWAP3 DUP4 SWAP3 SWAP1 DUP4 ADD SWAP2 DUP6 ADD SWAP1 DUP1 DUP4 DUP4 DUP3 ISZERO PUSH2 0x10C JUMPI JUMPDEST DUP1 MLOAD DUP3 MSTORE PUSH1 0x20 DUP4 GT ISZERO PUSH2 0x10C JUMPI PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 SWAP1 SWAP3 ADD SWAP2 PUSH1 0x20 SWAP2 DUP3 ADD SWAP2 ADD PUSH2 0xCE JUMP JUMPDEST POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x138 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE ISZERO PUSH2 0x14E JUMPI INVALID JUMPDEST PUSH2 0x172 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x3B5 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 ISZERO ISZERO DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE ISZERO PUSH2 0x18E JUMPI INVALID JUMPDEST PUSH2 0x196 PUSH2 0x42D JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE ISZERO PUSH2 0x1B0 JUMPI INVALID JUMPDEST PUSH2 0x172 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH1 0x44 CALLDATALOAD PUSH2 0x433 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 ISZERO ISZERO DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE ISZERO PUSH2 0x1F6 JUMPI INVALID JUMPDEST PUSH2 0x1FE PUSH2 0x5D4 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0xFF SWAP1 SWAP3 AND DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE ISZERO PUSH2 0x21C JUMPI INVALID JUMPDEST PUSH2 0x196 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x5D9 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE ISZERO PUSH2 0x257 JUMPI INVALID JUMPDEST PUSH2 0xA8 PUSH2 0x605 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 DUP1 DUP3 MSTORE DUP4 MLOAD DUP2 DUP4 ADD MSTORE DUP4 MLOAD SWAP2 SWAP3 DUP4 SWAP3 SWAP1 DUP4 ADD SWAP2 DUP6 ADD SWAP1 DUP1 DUP4 DUP4 DUP3 ISZERO PUSH2 0x10C JUMPI JUMPDEST DUP1 MLOAD DUP3 MSTORE PUSH1 0x20 DUP4 GT ISZERO PUSH2 0x10C JUMPI PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 SWAP1 SWAP3 ADD SWAP2 PUSH1 0x20 SWAP2 DUP3 ADD SWAP2 ADD PUSH2 0xCE JUMP JUMPDEST POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x138 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE ISZERO PUSH2 0x305 JUMPI INVALID JUMPDEST PUSH2 0x172 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x63C JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 ISZERO ISZERO DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE ISZERO PUSH2 0x345 JUMPI INVALID JUMPDEST PUSH2 0x196 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH2 0x727 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST PUSH1 0x40 DUP1 MLOAD DUP1 DUP3 ADD SWAP1 SWAP2 MSTORE PUSH1 0x11 DUP2 MSTORE PUSH32 0x30782050726F746F636F6C20546F6B656E000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE DUP2 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF CALLER DUP2 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 SHA3 SWAP5 DUP8 AND DUP1 DUP5 MSTORE SWAP5 DUP3 MSTORE DUP1 DUP4 SHA3 DUP7 SWAP1 SSTORE DUP1 MLOAD DUP7 DUP2 MSTORE SWAP1 MLOAD SWAP3 SWAP5 SWAP4 SWAP3 PUSH32 0x8C5BE1E5EBEC7D5BD14F71427D1E84F3DD0314C0F7B2291E5B200AC8C7C3B925 SWAP3 SWAP2 DUP2 SWAP1 SUB SWAP1 SWAP2 ADD SWAP1 LOG3 POP PUSH1 0x1 JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x3 SLOAD DUP2 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP5 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 SHA3 CALLER SWAP1 SWAP6 AND DUP4 MSTORE SWAP4 DUP2 MSTORE DUP4 DUP3 SHA3 SLOAD SWAP3 DUP3 MSTORE DUP2 SWAP1 MSTORE SWAP2 DUP3 SHA3 SLOAD DUP4 SWAP1 LT DUP1 ISZERO SWAP1 PUSH2 0x483 JUMPI POP DUP3 DUP2 LT ISZERO JUMPDEST DUP1 ISZERO PUSH2 0x4B6 JUMPI POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 SWAP1 SHA3 SLOAD DUP4 DUP2 ADD LT ISZERO JUMPDEST ISZERO PUSH2 0x5C6 JUMPI PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP6 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 DUP1 DUP3 SHA3 DUP1 SLOAD DUP8 ADD SWAP1 SSTORE SWAP2 DUP8 AND DUP2 MSTORE SHA3 DUP1 SLOAD DUP5 SWAP1 SUB SWAP1 SSTORE PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 LT ISZERO PUSH2 0x558 JUMPI PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP7 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 SHA3 CALLER SWAP1 SWAP5 AND DUP4 MSTORE SWAP3 SWAP1 MSTORE SHA3 DUP1 SLOAD DUP5 SWAP1 SUB SWAP1 SSTORE JUMPDEST DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF DUP6 PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x1 SWAP2 POP PUSH2 0x5CB JUMP JUMPDEST PUSH1 0x0 SWAP2 POP JUMPDEST JUMPDEST POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x12 DUP2 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 SWAP1 SHA3 SLOAD JUMPDEST SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD DUP1 DUP3 ADD SWAP1 SWAP2 MSTORE PUSH1 0x3 DUP2 MSTORE PUSH32 0x5A52580000000000000000000000000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE DUP2 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF CALLER AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 DUP2 SHA3 SLOAD DUP3 SWAP1 LT DUP1 ISZERO SWAP1 PUSH2 0x699 JUMPI POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 SWAP1 SHA3 SLOAD DUP3 DUP2 ADD LT ISZERO JUMPDEST ISZERO PUSH2 0x718 JUMPI PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF CALLER DUP2 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x20 DUP2 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 SHA3 DUP1 SLOAD DUP9 SWAP1 SUB SWAP1 SSTORE SWAP4 DUP8 AND DUP1 DUP4 MSTORE SWAP2 DUP5 SWAP1 SHA3 DUP1 SLOAD DUP8 ADD SWAP1 SSTORE DUP4 MLOAD DUP7 DUP2 MSTORE SWAP4 MLOAD SWAP2 SWAP4 PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF SWAP3 SWAP1 DUP2 SWAP1 SUB SWAP1 SWAP2 ADD SWAP1 LOG3 POP PUSH1 0x1 PUSH2 0x427 JUMP JUMPDEST POP PUSH1 0x0 PUSH2 0x427 JUMP JUMPDEST JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP4 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 SHA3 SWAP4 DUP6 AND DUP4 MSTORE SWAP3 SWAP1 MSTORE SHA3 SLOAD JUMPDEST SWAP3 SWAP2 POP POP JUMP STOP LOG1 PUSH6 0x627A7A723058 SHA3 0x1b JUMPDEST PUSH17 0xCF82A73DEC658C2E60AB9A0F8E2BA01A74 0xb6 PUSH11 0x6F5B0402F56D2EA0FFCF00 0x29 ",
- "sourceMap": "795:455:3:-;;;966:6;937:35;;1158:90;;;;;;;1230:11;;-1:-1:-1;;;;;1216:10:3;1207:20;:8;:20;;;;;;;;;;:34;1158:90;795:455;;;;;;;"
- },
- "deployedBytecode": {
- "linkReferences": {},
- "object": "0x606060405236156100965763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610098578063095ea7b31461014657806318160ddd1461018657806323b872dd146101a8578063313ce567146101ee57806370a082311461021457806395d89b411461024f578063a9059cbb146102fd578063dd62ed3e1461033d575bfe5b34156100a057fe5b6100a861037e565b60408051602080825283518183015283519192839290830191850190808383821561010c575b80518252602083111561010c577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016100ce565b505050905090810190601f1680156101385780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561014e57fe5b61017273ffffffffffffffffffffffffffffffffffffffff600435166024356103b5565b604080519115158252519081900360200190f35b341561018e57fe5b61019661042d565b60408051918252519081900360200190f35b34156101b057fe5b61017273ffffffffffffffffffffffffffffffffffffffff60043581169060243516604435610433565b604080519115158252519081900360200190f35b34156101f657fe5b6101fe6105d4565b6040805160ff9092168252519081900360200190f35b341561021c57fe5b61019673ffffffffffffffffffffffffffffffffffffffff600435166105d9565b60408051918252519081900360200190f35b341561025757fe5b6100a8610605565b60408051602080825283518183015283519192839290830191850190808383821561010c575b80518252602083111561010c577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016100ce565b505050905090810190601f1680156101385780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561030557fe5b61017273ffffffffffffffffffffffffffffffffffffffff6004351660243561063c565b604080519115158252519081900360200190f35b341561034557fe5b61019673ffffffffffffffffffffffffffffffffffffffff60043581169060243516610727565b60408051918252519081900360200190f35b60408051808201909152601181527f30782050726f746f636f6c20546f6b656e000000000000000000000000000000602082015281565b73ffffffffffffffffffffffffffffffffffffffff338116600081815260016020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b60035481565b73ffffffffffffffffffffffffffffffffffffffff808416600081815260016020908152604080832033909516835293815283822054928252819052918220548390108015906104835750828110155b80156104b6575073ffffffffffffffffffffffffffffffffffffffff841660009081526020819052604090205483810110155b156105c65773ffffffffffffffffffffffffffffffffffffffff808516600090815260208190526040808220805487019055918716815220805484900390557fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8110156105585773ffffffffffffffffffffffffffffffffffffffff808616600090815260016020908152604080832033909416835292905220805484900390555b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191506105cb565b600091505b5b509392505050565b601281565b73ffffffffffffffffffffffffffffffffffffffff81166000908152602081905260409020545b919050565b60408051808201909152600381527f5a52580000000000000000000000000000000000000000000000000000000000602082015281565b73ffffffffffffffffffffffffffffffffffffffff3316600090815260208190526040812054829010801590610699575073ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205482810110155b156107185773ffffffffffffffffffffffffffffffffffffffff33811660008181526020818152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a3506001610427565b506000610427565b5b92915050565b73ffffffffffffffffffffffffffffffffffffffff8083166000908152600160209081526040808320938516835292905220545b929150505600a165627a7a723058201b5b70cf82a73dec658c2e60ab9a0f8e2ba01a74b66a6f5b0402f56d2ea0ffcf0029",
- "opcodes": "PUSH1 0x60 PUSH1 0x40 MSTORE CALLDATASIZE ISZERO PUSH2 0x96 JUMPI PUSH4 0xFFFFFFFF PUSH29 0x100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 CALLDATALOAD DIV AND PUSH4 0x6FDDE03 DUP2 EQ PUSH2 0x98 JUMPI DUP1 PUSH4 0x95EA7B3 EQ PUSH2 0x146 JUMPI DUP1 PUSH4 0x18160DDD EQ PUSH2 0x186 JUMPI DUP1 PUSH4 0x23B872DD EQ PUSH2 0x1A8 JUMPI DUP1 PUSH4 0x313CE567 EQ PUSH2 0x1EE JUMPI DUP1 PUSH4 0x70A08231 EQ PUSH2 0x214 JUMPI DUP1 PUSH4 0x95D89B41 EQ PUSH2 0x24F JUMPI DUP1 PUSH4 0xA9059CBB EQ PUSH2 0x2FD JUMPI DUP1 PUSH4 0xDD62ED3E EQ PUSH2 0x33D JUMPI JUMPDEST INVALID JUMPDEST CALLVALUE ISZERO PUSH2 0xA0 JUMPI INVALID JUMPDEST PUSH2 0xA8 PUSH2 0x37E JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 DUP1 DUP3 MSTORE DUP4 MLOAD DUP2 DUP4 ADD MSTORE DUP4 MLOAD SWAP2 SWAP3 DUP4 SWAP3 SWAP1 DUP4 ADD SWAP2 DUP6 ADD SWAP1 DUP1 DUP4 DUP4 DUP3 ISZERO PUSH2 0x10C JUMPI JUMPDEST DUP1 MLOAD DUP3 MSTORE PUSH1 0x20 DUP4 GT ISZERO PUSH2 0x10C JUMPI PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 SWAP1 SWAP3 ADD SWAP2 PUSH1 0x20 SWAP2 DUP3 ADD SWAP2 ADD PUSH2 0xCE JUMP JUMPDEST POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x138 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE ISZERO PUSH2 0x14E JUMPI INVALID JUMPDEST PUSH2 0x172 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x3B5 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 ISZERO ISZERO DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE ISZERO PUSH2 0x18E JUMPI INVALID JUMPDEST PUSH2 0x196 PUSH2 0x42D JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE ISZERO PUSH2 0x1B0 JUMPI INVALID JUMPDEST PUSH2 0x172 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH1 0x44 CALLDATALOAD PUSH2 0x433 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 ISZERO ISZERO DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE ISZERO PUSH2 0x1F6 JUMPI INVALID JUMPDEST PUSH2 0x1FE PUSH2 0x5D4 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0xFF SWAP1 SWAP3 AND DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE ISZERO PUSH2 0x21C JUMPI INVALID JUMPDEST PUSH2 0x196 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH2 0x5D9 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE ISZERO PUSH2 0x257 JUMPI INVALID JUMPDEST PUSH2 0xA8 PUSH2 0x605 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 DUP1 DUP3 MSTORE DUP4 MLOAD DUP2 DUP4 ADD MSTORE DUP4 MLOAD SWAP2 SWAP3 DUP4 SWAP3 SWAP1 DUP4 ADD SWAP2 DUP6 ADD SWAP1 DUP1 DUP4 DUP4 DUP3 ISZERO PUSH2 0x10C JUMPI JUMPDEST DUP1 MLOAD DUP3 MSTORE PUSH1 0x20 DUP4 GT ISZERO PUSH2 0x10C JUMPI PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 SWAP1 SWAP3 ADD SWAP2 PUSH1 0x20 SWAP2 DUP3 ADD SWAP2 ADD PUSH2 0xCE JUMP JUMPDEST POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x138 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE ISZERO PUSH2 0x305 JUMPI INVALID JUMPDEST PUSH2 0x172 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD AND PUSH1 0x24 CALLDATALOAD PUSH2 0x63C JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 ISZERO ISZERO DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST CALLVALUE ISZERO PUSH2 0x345 JUMPI INVALID JUMPDEST PUSH2 0x196 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH1 0x4 CALLDATALOAD DUP2 AND SWAP1 PUSH1 0x24 CALLDATALOAD AND PUSH2 0x727 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST PUSH1 0x40 DUP1 MLOAD DUP1 DUP3 ADD SWAP1 SWAP2 MSTORE PUSH1 0x11 DUP2 MSTORE PUSH32 0x30782050726F746F636F6C20546F6B656E000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE DUP2 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF CALLER DUP2 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 SHA3 SWAP5 DUP8 AND DUP1 DUP5 MSTORE SWAP5 DUP3 MSTORE DUP1 DUP4 SHA3 DUP7 SWAP1 SSTORE DUP1 MLOAD DUP7 DUP2 MSTORE SWAP1 MLOAD SWAP3 SWAP5 SWAP4 SWAP3 PUSH32 0x8C5BE1E5EBEC7D5BD14F71427D1E84F3DD0314C0F7B2291E5B200AC8C7C3B925 SWAP3 SWAP2 DUP2 SWAP1 SUB SWAP1 SWAP2 ADD SWAP1 LOG3 POP PUSH1 0x1 JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x3 SLOAD DUP2 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP5 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 SHA3 CALLER SWAP1 SWAP6 AND DUP4 MSTORE SWAP4 DUP2 MSTORE DUP4 DUP3 SHA3 SLOAD SWAP3 DUP3 MSTORE DUP2 SWAP1 MSTORE SWAP2 DUP3 SHA3 SLOAD DUP4 SWAP1 LT DUP1 ISZERO SWAP1 PUSH2 0x483 JUMPI POP DUP3 DUP2 LT ISZERO JUMPDEST DUP1 ISZERO PUSH2 0x4B6 JUMPI POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP5 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 SWAP1 SHA3 SLOAD DUP4 DUP2 ADD LT ISZERO JUMPDEST ISZERO PUSH2 0x5C6 JUMPI PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP6 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 DUP1 DUP3 SHA3 DUP1 SLOAD DUP8 ADD SWAP1 SSTORE SWAP2 DUP8 AND DUP2 MSTORE SHA3 DUP1 SLOAD DUP5 SWAP1 SUB SWAP1 SSTORE PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 LT ISZERO PUSH2 0x558 JUMPI PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP7 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 SHA3 CALLER SWAP1 SWAP5 AND DUP4 MSTORE SWAP3 SWAP1 MSTORE SHA3 DUP1 SLOAD DUP5 SWAP1 SUB SWAP1 SSTORE JUMPDEST DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF DUP6 PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x1 SWAP2 POP PUSH2 0x5CB JUMP JUMPDEST PUSH1 0x0 SWAP2 POP JUMPDEST JUMPDEST POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x12 DUP2 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 SWAP1 SHA3 SLOAD JUMPDEST SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD DUP1 DUP3 ADD SWAP1 SWAP2 MSTORE PUSH1 0x3 DUP2 MSTORE PUSH32 0x5A52580000000000000000000000000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE DUP2 JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF CALLER AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 DUP2 SHA3 SLOAD DUP3 SWAP1 LT DUP1 ISZERO SWAP1 PUSH2 0x699 JUMPI POP PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP2 SWAP1 MSTORE PUSH1 0x40 SWAP1 SHA3 SLOAD DUP3 DUP2 ADD LT ISZERO JUMPDEST ISZERO PUSH2 0x718 JUMPI PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF CALLER DUP2 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x20 DUP2 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 SHA3 DUP1 SLOAD DUP9 SWAP1 SUB SWAP1 SSTORE SWAP4 DUP8 AND DUP1 DUP4 MSTORE SWAP2 DUP5 SWAP1 SHA3 DUP1 SLOAD DUP8 ADD SWAP1 SSTORE DUP4 MLOAD DUP7 DUP2 MSTORE SWAP4 MLOAD SWAP2 SWAP4 PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF SWAP3 SWAP1 DUP2 SWAP1 SUB SWAP1 SWAP2 ADD SWAP1 LOG3 POP PUSH1 0x1 PUSH2 0x427 JUMP JUMPDEST POP PUSH1 0x0 PUSH2 0x427 JUMP JUMPDEST JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP1 DUP4 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 SHA3 SWAP4 DUP6 AND DUP4 MSTORE SWAP3 SWAP1 MSTORE SHA3 SLOAD JUMPDEST SWAP3 SWAP2 POP POP JUMP STOP LOG1 PUSH6 0x627A7A723058 SHA3 0x1b JUMPDEST PUSH17 0xCF82A73DEC658C2E60AB9A0F8E2BA01A74 0xb6 PUSH11 0x6F5B0402F56D2EA0FFCF00 0x29 ",
- "sourceMap": "795:455:3:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1017:49;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;18:2:-1;;13:3;7:5;32;59:3;53:5;48:3;41:6;93:2;88:3;85:2;78:6;73:3;67:5;152:3;;;;;117:2;108:3;;;;130;172:5;167:4;181:3;3:186;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1087:187:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;937:35:3;;;;;;;;;;;;;;;;;;;;;;;;;;1066:609:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;896:35:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;982:99:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1072:37:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;18:2:-1;;13:3;7:5;32;59:3;53:5;48:3;41:6;93:2;88:3;85:2;78:6;73:3;67:5;152:3;;;;;117:2;108:3;;;;130;172:5;167:4;181:3;3:186;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;125:410:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1280:126;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1017:49:3;;;;;;;;;;;;;;;;;;;:::o;1087:187:0:-;1160:19;1168:10;1160:19;;1144:4;1160:19;;;:7;:19;;;;;;;;:29;;;;;;;;;;;;:38;;;1208;;;;;;;1144:4;;1160:29;:19;1208:38;;;;;;;;;;;-1:-1:-1;1263:4:0;1087:187;;;;;:::o;937:35:3:-;;;;:::o;1066:609:2:-;1198:14;;;;1161:4;1198:14;;;:7;:14;;;;;;;;1213:10;1198:26;;;;;;;;;;;;1238:15;;;;;;;;;;:25;;;;;;:60;;;1292:6;1279:9;:19;;1238:60;:115;;;;-1:-1:-1;1340:13:2;;;:8;:13;;;;;;;;;;;1314:22;;;:39;;1238:115;1234:435;;;1378:13;;;;:8;:13;;;;;;;;;;;:23;;;;;;1415:15;;;;;;:25;;;;;;;768:10;1458:20;;1454:95;;;1498:14;;;;;;;;:7;:14;;;;;;;;1513:10;1498:26;;;;;;;;;:36;;;;;;;1454:95;1578:3;1562:28;;1571:5;1562:28;;;1583:6;1562:28;;;;;;;;;;;;;;;;;;1611:4;1604:11;;;;1234:435;1653:5;1646:12;;1234:435;1066:609;;;;;;;:::o;896:35:3:-;929:2;896:35;:::o;982:99:0:-;1058:16;;;1035:4;1058:16;;;;;;;;;;;982:99;;;;:::o;1072:37:3:-;;;;;;;;;;;;;;;;;;;:::o;125:410:0:-;267:20;276:10;267:20;178:4;267:20;;;;;;;;;;;:30;;;;;;:73;;-1:-1:-1;327:13:0;;;:8;:13;;;;;;;;;;;301:22;;;:39;;267:73;263:266;;;356:20;365:10;356:20;;:8;:20;;;;;;;;;;;:30;;;;;;;400:13;;;;;;;;;;:23;;;;;;437:33;;;;;;;400:13;;437:33;;;;;;;;;;;-1:-1:-1;491:4:0;484:11;;263:266;-1:-1:-1;521:5:0;514:12;;263:266;125:410;;;;;:::o;1280:126::-;1374:15;;;;1351:4;1374:15;;;:7;:15;;;;;;;;:25;;;;;;;;;;1280:126;;;;;:::o"
- },
- "gasEstimates": {
- "creation": {
- "codeDepositCost": "386600",
- "executionCost": "40780",
- "totalCost": "427380"
- },
- "external": {
- "allowance(address,address)": "737",
- "approve(address,uint256)": "22218",
- "balanceOf(address)": "579",
- "decimals()": "270",
- "name()": "530",
- "symbol()": "662",
- "totalSupply()": "417",
- "transfer(address,uint256)": "43393",
- "transferFrom(address,address,uint256)": "64116"
- }
- },
- "legacyAssembly": {
- ".code": [
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH",
- "value": "60"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "MSTORE"
- },
- {
- "begin": 966,
- "end": 972,
- "name": "PUSH",
- "value": "33B2E3C9FD0803CE8000000"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "PUSH",
- "value": "3"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "SSTORE"
- },
- {
- "begin": 1158,
- "end": 1248,
- "name": "CALLVALUE"
- },
- {
- "begin": 1158,
- "end": 1248,
- "name": "ISZERO"
- },
- {
- "begin": 1158,
- "end": 1248,
- "name": "PUSH [tag]",
- "value": "1"
- },
- {
- "begin": 1158,
- "end": 1248,
- "name": "JUMPI"
- },
- {
- "begin": 1158,
- "end": 1248,
- "name": "INVALID"
- },
- {
- "begin": 1158,
- "end": 1248,
- "name": "tag",
- "value": "1"
- },
- {
- "begin": 1158,
- "end": 1248,
- "name": "JUMPDEST"
- },
- {
- "begin": 1158,
- "end": 1248,
- "name": "tag",
- "value": "2"
- },
- {
- "begin": 1158,
- "end": 1248,
- "name": "JUMPDEST"
- },
- {
- "begin": 1230,
- "end": 1241,
- "name": "PUSH",
- "value": "3"
- },
- {
- "begin": 1230,
- "end": 1241,
- "name": "SLOAD"
- },
- {
- "begin": -1,
- "end": -1,
- "name": "PUSH",
- "value": "1"
- },
- {
- "begin": -1,
- "end": -1,
- "name": "PUSH",
- "value": "A0"
- },
- {
- "begin": -1,
- "end": -1,
- "name": "PUSH",
- "value": "2"
- },
- {
- "begin": -1,
- "end": -1,
- "name": "EXP"
- },
- {
- "begin": -1,
- "end": -1,
- "name": "SUB"
- },
- {
- "begin": 1216,
- "end": 1226,
- "name": "CALLER"
- },
- {
- "begin": 1207,
- "end": 1227,
- "name": "AND"
- },
- {
- "begin": 1207,
- "end": 1215,
- "name": "PUSH",
- "value": "0"
- },
- {
- "begin": 1207,
- "end": 1227,
- "name": "SWAP1"
- },
- {
- "begin": 1207,
- "end": 1227,
- "name": "DUP2"
- },
- {
- "begin": 1207,
- "end": 1227,
- "name": "MSTORE"
- },
- {
- "begin": 1207,
- "end": 1227,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 1207,
- "end": 1227,
- "name": "DUP2"
- },
- {
- "begin": 1207,
- "end": 1227,
- "name": "SWAP1"
- },
- {
- "begin": 1207,
- "end": 1227,
- "name": "MSTORE"
- },
- {
- "begin": 1207,
- "end": 1227,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 1207,
- "end": 1227,
- "name": "SWAP1"
- },
- {
- "begin": 1207,
- "end": 1227,
- "name": "SHA3"
- },
- {
- "begin": 1207,
- "end": 1241,
- "name": "SSTORE"
- },
- {
- "begin": 1158,
- "end": 1248,
- "name": "tag",
- "value": "3"
- },
- {
- "begin": 1158,
- "end": 1248,
- "name": "JUMPDEST"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "tag",
- "value": "4"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "JUMPDEST"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH #[$]",
- "value": "0000000000000000000000000000000000000000000000000000000000000000"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "DUP1"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH [$]",
- "value": "0000000000000000000000000000000000000000000000000000000000000000"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH",
- "value": "0"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "CODECOPY"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH",
- "value": "0"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "RETURN"
- }
- ],
- ".data": {
- "0": {
- ".code": [
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH",
- "value": "60"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "MSTORE"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "CALLDATASIZE"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "ISZERO"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH [tag]",
- "value": "1"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "JUMPI"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH",
- "value": "FFFFFFFF"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH",
- "value": "100000000000000000000000000000000000000000000000000000000"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH",
- "value": "0"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "CALLDATALOAD"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "DIV"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "AND"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH",
- "value": "6FDDE03"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "DUP2"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "EQ"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH [tag]",
- "value": "2"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "JUMPI"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "DUP1"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH",
- "value": "95EA7B3"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "EQ"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH [tag]",
- "value": "3"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "JUMPI"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "DUP1"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH",
- "value": "18160DDD"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "EQ"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH [tag]",
- "value": "4"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "JUMPI"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "DUP1"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH",
- "value": "23B872DD"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "EQ"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH [tag]",
- "value": "5"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "JUMPI"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "DUP1"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH",
- "value": "313CE567"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "EQ"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH [tag]",
- "value": "6"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "JUMPI"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "DUP1"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH",
- "value": "70A08231"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "EQ"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH [tag]",
- "value": "7"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "JUMPI"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "DUP1"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH",
- "value": "95D89B41"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "EQ"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH [tag]",
- "value": "8"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "JUMPI"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "DUP1"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH",
- "value": "A9059CBB"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "EQ"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH [tag]",
- "value": "9"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "JUMPI"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "DUP1"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH",
- "value": "DD62ED3E"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "EQ"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "PUSH [tag]",
- "value": "10"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "JUMPI"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "tag",
- "value": "1"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "JUMPDEST"
- },
- {
- "begin": 795,
- "end": 1250,
- "name": "INVALID"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "tag",
- "value": "2"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "JUMPDEST"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "CALLVALUE"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "ISZERO"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "PUSH [tag]",
- "value": "11"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "JUMPI"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "INVALID"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "tag",
- "value": "11"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "JUMPDEST"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "PUSH [tag]",
- "value": "12"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "PUSH [tag]",
- "value": "13"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "JUMP"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "tag",
- "value": "12"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "JUMPDEST"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "DUP1"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "MLOAD"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "DUP1"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "DUP3"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "MSTORE"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "DUP4"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "MLOAD"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "DUP2"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "DUP4"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "ADD"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "MSTORE"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "DUP4"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "MLOAD"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "SWAP2"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "SWAP3"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "DUP4"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "SWAP3"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "SWAP1"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "DUP4"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "ADD"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "SWAP2"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "DUP6"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "ADD"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "SWAP1"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "DUP1"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "DUP4"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "DUP4"
- },
- {
- "begin": 18,
- "end": 20,
- "name": "DUP3"
- },
- {
- "begin": 18,
- "end": 20,
- "name": "ISZERO"
- },
- {
- "begin": 13,
- "end": 16,
- "name": "PUSH [tag]",
- "value": "14"
- },
- {
- "begin": 7,
- "end": 12,
- "name": "JUMPI"
- },
- {
- "begin": 32,
- "end": 37,
- "name": "tag",
- "value": "15"
- },
- {
- "begin": 32,
- "end": 37,
- "name": "JUMPDEST"
- },
- {
- "begin": 59,
- "end": 62,
- "name": "DUP1"
- },
- {
- "begin": 53,
- "end": 58,
- "name": "MLOAD"
- },
- {
- "begin": 48,
- "end": 51,
- "name": "DUP3"
- },
- {
- "begin": 41,
- "end": 47,
- "name": "MSTORE"
- },
- {
- "begin": 93,
- "end": 95,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 88,
- "end": 91,
- "name": "DUP4"
- },
- {
- "begin": 85,
- "end": 87,
- "name": "GT"
- },
- {
- "begin": 78,
- "end": 84,
- "name": "ISZERO"
- },
- {
- "begin": 73,
- "end": 76,
- "name": "PUSH [tag]",
- "value": "14"
- },
- {
- "begin": 67,
- "end": 72,
- "name": "JUMPI"
- },
- {
- "begin": 152,
- "end": 155,
- "name": "PUSH",
- "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0"
- },
- {
- "begin": 152,
- "end": 155,
- "name": "SWAP1"
- },
- {
- "begin": 152,
- "end": 155,
- "name": "SWAP3"
- },
- {
- "begin": 152,
- "end": 155,
- "name": "ADD"
- },
- {
- "begin": 152,
- "end": 155,
- "name": "SWAP2"
- },
- {
- "begin": 117,
- "end": 119,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 108,
- "end": 111,
- "name": "SWAP2"
- },
- {
- "begin": 108,
- "end": 111,
- "name": "DUP3"
- },
- {
- "begin": 108,
- "end": 111,
- "name": "ADD"
- },
- {
- "begin": 108,
- "end": 111,
- "name": "SWAP2"
- },
- {
- "begin": 130,
- "end": 133,
- "name": "ADD"
- },
- {
- "begin": 172,
- "end": 177,
- "name": "PUSH [tag]",
- "value": "15"
- },
- {
- "begin": 167,
- "end": 171,
- "name": "JUMP"
- },
- {
- "begin": 181,
- "end": 184,
- "name": "tag",
- "value": "14"
- },
- {
- "begin": 181,
- "end": 184,
- "name": "JUMPDEST"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "POP"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "POP"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "POP"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "SWAP1"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "POP"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "SWAP1"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "DUP2"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "ADD"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "SWAP1"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "PUSH",
- "value": "1F"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "AND"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "DUP1"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "ISZERO"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "PUSH [tag]",
- "value": "16"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "JUMPI"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "DUP1"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "DUP3"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "SUB"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "DUP1"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "MLOAD"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "PUSH",
- "value": "1"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "DUP4"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "SUB"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "PUSH",
- "value": "100"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "EXP"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "SUB"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "NOT"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "AND"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "DUP2"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "MSTORE"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "ADD"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "SWAP2"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "POP"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "tag",
- "value": "16"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "JUMPDEST"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "POP"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "SWAP3"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "POP"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "POP"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "POP"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "MLOAD"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "DUP1"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "SWAP2"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "SUB"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "SWAP1"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "RETURN"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "tag",
- "value": "3"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "JUMPDEST"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "CALLVALUE"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "ISZERO"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "PUSH [tag]",
- "value": "17"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "JUMPI"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "INVALID"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "tag",
- "value": "17"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "JUMPDEST"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "PUSH [tag]",
- "value": "18"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "PUSH",
- "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "PUSH",
- "value": "4"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "CALLDATALOAD"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "AND"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "PUSH",
- "value": "24"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "CALLDATALOAD"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "PUSH [tag]",
- "value": "19"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "JUMP"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "tag",
- "value": "18"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "JUMPDEST"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "DUP1"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "MLOAD"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "SWAP2"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "ISZERO"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "ISZERO"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "DUP3"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "MSTORE"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "MLOAD"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "SWAP1"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "DUP2"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "SWAP1"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "SUB"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "ADD"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "SWAP1"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "RETURN"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "tag",
- "value": "4"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "JUMPDEST"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "CALLVALUE"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "ISZERO"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "PUSH [tag]",
- "value": "20"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "JUMPI"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "INVALID"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "tag",
- "value": "20"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "JUMPDEST"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "PUSH [tag]",
- "value": "21"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "PUSH [tag]",
- "value": "22"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "JUMP"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "tag",
- "value": "21"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "JUMPDEST"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "DUP1"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "MLOAD"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "SWAP2"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "DUP3"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "MSTORE"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "MLOAD"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "SWAP1"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "DUP2"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "SWAP1"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "SUB"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "ADD"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "SWAP1"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "RETURN"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "tag",
- "value": "5"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "JUMPDEST"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "CALLVALUE"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "ISZERO"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "PUSH [tag]",
- "value": "23"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "JUMPI"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "INVALID"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "tag",
- "value": "23"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "JUMPDEST"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "PUSH [tag]",
- "value": "18"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "PUSH",
- "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "PUSH",
- "value": "4"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "CALLDATALOAD"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "DUP2"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "AND"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "SWAP1"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "PUSH",
- "value": "24"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "CALLDATALOAD"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "AND"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "PUSH",
- "value": "44"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "CALLDATALOAD"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "PUSH [tag]",
- "value": "25"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "JUMP"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "tag",
- "value": "24"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "JUMPDEST"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "DUP1"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "MLOAD"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "SWAP2"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "ISZERO"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "ISZERO"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "DUP3"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "MSTORE"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "MLOAD"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "SWAP1"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "DUP2"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "SWAP1"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "SUB"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "ADD"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "SWAP1"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "RETURN"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "tag",
- "value": "6"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "JUMPDEST"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "CALLVALUE"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "ISZERO"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "PUSH [tag]",
- "value": "26"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "JUMPI"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "INVALID"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "tag",
- "value": "26"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "JUMPDEST"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "PUSH [tag]",
- "value": "27"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "PUSH [tag]",
- "value": "28"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "JUMP"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "tag",
- "value": "27"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "JUMPDEST"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "DUP1"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "MLOAD"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "PUSH",
- "value": "FF"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "SWAP1"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "SWAP3"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "AND"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "DUP3"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "MSTORE"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "MLOAD"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "SWAP1"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "DUP2"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "SWAP1"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "SUB"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "ADD"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "SWAP1"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "RETURN"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "tag",
- "value": "7"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "JUMPDEST"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "CALLVALUE"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "ISZERO"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "PUSH [tag]",
- "value": "29"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "JUMPI"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "INVALID"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "tag",
- "value": "29"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "JUMPDEST"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "PUSH [tag]",
- "value": "21"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "PUSH",
- "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "PUSH",
- "value": "4"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "CALLDATALOAD"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "AND"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "PUSH [tag]",
- "value": "31"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "JUMP"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "tag",
- "value": "30"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "JUMPDEST"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "DUP1"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "MLOAD"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "SWAP2"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "DUP3"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "MSTORE"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "MLOAD"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "SWAP1"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "DUP2"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "SWAP1"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "SUB"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "ADD"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "SWAP1"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "RETURN"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "tag",
- "value": "8"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "JUMPDEST"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "CALLVALUE"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "ISZERO"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "PUSH [tag]",
- "value": "32"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "JUMPI"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "INVALID"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "tag",
- "value": "32"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "JUMPDEST"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "PUSH [tag]",
- "value": "12"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "PUSH [tag]",
- "value": "34"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "JUMP"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "tag",
- "value": "33"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "JUMPDEST"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "DUP1"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "MLOAD"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "DUP1"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "DUP3"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "MSTORE"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "DUP4"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "MLOAD"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "DUP2"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "DUP4"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "ADD"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "MSTORE"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "DUP4"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "MLOAD"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "SWAP2"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "SWAP3"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "DUP4"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "SWAP3"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "SWAP1"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "DUP4"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "ADD"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "SWAP2"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "DUP6"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "ADD"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "SWAP1"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "DUP1"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "DUP4"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "DUP4"
- },
- {
- "begin": 18,
- "end": 20,
- "name": "DUP3"
- },
- {
- "begin": 18,
- "end": 20,
- "name": "ISZERO"
- },
- {
- "begin": 13,
- "end": 16,
- "name": "PUSH [tag]",
- "value": "14"
- },
- {
- "begin": 7,
- "end": 12,
- "name": "JUMPI"
- },
- {
- "begin": 32,
- "end": 37,
- "name": "tag",
- "value": "36"
- },
- {
- "begin": 32,
- "end": 37,
- "name": "JUMPDEST"
- },
- {
- "begin": 59,
- "end": 62,
- "name": "DUP1"
- },
- {
- "begin": 53,
- "end": 58,
- "name": "MLOAD"
- },
- {
- "begin": 48,
- "end": 51,
- "name": "DUP3"
- },
- {
- "begin": 41,
- "end": 47,
- "name": "MSTORE"
- },
- {
- "begin": 93,
- "end": 95,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 88,
- "end": 91,
- "name": "DUP4"
- },
- {
- "begin": 85,
- "end": 87,
- "name": "GT"
- },
- {
- "begin": 78,
- "end": 84,
- "name": "ISZERO"
- },
- {
- "begin": 73,
- "end": 76,
- "name": "PUSH [tag]",
- "value": "14"
- },
- {
- "begin": 67,
- "end": 72,
- "name": "JUMPI"
- },
- {
- "begin": 152,
- "end": 155,
- "name": "PUSH",
- "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0"
- },
- {
- "begin": 152,
- "end": 155,
- "name": "SWAP1"
- },
- {
- "begin": 152,
- "end": 155,
- "name": "SWAP3"
- },
- {
- "begin": 152,
- "end": 155,
- "name": "ADD"
- },
- {
- "begin": 152,
- "end": 155,
- "name": "SWAP2"
- },
- {
- "begin": 117,
- "end": 119,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 108,
- "end": 111,
- "name": "SWAP2"
- },
- {
- "begin": 108,
- "end": 111,
- "name": "DUP3"
- },
- {
- "begin": 108,
- "end": 111,
- "name": "ADD"
- },
- {
- "begin": 108,
- "end": 111,
- "name": "SWAP2"
- },
- {
- "begin": 130,
- "end": 133,
- "name": "ADD"
- },
- {
- "begin": 172,
- "end": 177,
- "name": "PUSH [tag]",
- "value": "15"
- },
- {
- "begin": 167,
- "end": 171,
- "name": "JUMP"
- },
- {
- "begin": 181,
- "end": 184,
- "name": "tag",
- "value": "35"
- },
- {
- "begin": 181,
- "end": 184,
- "name": "JUMPDEST"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "POP"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "POP"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "POP"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "SWAP1"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "POP"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "SWAP1"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "DUP2"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "ADD"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "SWAP1"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "PUSH",
- "value": "1F"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "AND"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "DUP1"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "ISZERO"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "PUSH [tag]",
- "value": "16"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "JUMPI"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "DUP1"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "DUP3"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "SUB"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "DUP1"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "MLOAD"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "PUSH",
- "value": "1"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "DUP4"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "SUB"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "PUSH",
- "value": "100"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "EXP"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "SUB"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "NOT"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "AND"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "DUP2"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "MSTORE"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "ADD"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "SWAP2"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "POP"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "tag",
- "value": "37"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "JUMPDEST"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "POP"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "SWAP3"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "POP"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "POP"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "POP"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "MLOAD"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "DUP1"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "SWAP2"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "SUB"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "SWAP1"
- },
- {
- "begin": 3,
- "end": 189,
- "name": "RETURN"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "tag",
- "value": "9"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "JUMPDEST"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "CALLVALUE"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "ISZERO"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "PUSH [tag]",
- "value": "38"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "JUMPI"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "INVALID"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "tag",
- "value": "38"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "JUMPDEST"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "PUSH [tag]",
- "value": "18"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "PUSH",
- "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "PUSH",
- "value": "4"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "CALLDATALOAD"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "AND"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "PUSH",
- "value": "24"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "CALLDATALOAD"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "PUSH [tag]",
- "value": "40"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "JUMP"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "tag",
- "value": "39"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "JUMPDEST"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "DUP1"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "MLOAD"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "SWAP2"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "ISZERO"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "ISZERO"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "DUP3"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "MSTORE"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "MLOAD"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "SWAP1"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "DUP2"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "SWAP1"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "SUB"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "ADD"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "SWAP1"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "RETURN"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "tag",
- "value": "10"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "JUMPDEST"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "CALLVALUE"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "ISZERO"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "PUSH [tag]",
- "value": "41"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "JUMPI"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "INVALID"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "tag",
- "value": "41"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "JUMPDEST"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "PUSH [tag]",
- "value": "21"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "PUSH",
- "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "PUSH",
- "value": "4"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "CALLDATALOAD"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "DUP2"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "AND"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "SWAP1"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "PUSH",
- "value": "24"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "CALLDATALOAD"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "AND"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "PUSH [tag]",
- "value": "43"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "JUMP"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "tag",
- "value": "42"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "JUMPDEST"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "DUP1"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "MLOAD"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "SWAP2"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "DUP3"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "MSTORE"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "MLOAD"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "SWAP1"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "DUP2"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "SWAP1"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "SUB"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "ADD"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "SWAP1"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "RETURN"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "tag",
- "value": "13"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "JUMPDEST"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "DUP1"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "MLOAD"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "DUP1"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "DUP3"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "ADD"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "SWAP1"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "SWAP2"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "MSTORE"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "PUSH",
- "value": "11"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "DUP2"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "MSTORE"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "PUSH",
- "value": "30782050726F746F636F6C20546F6B656E000000000000000000000000000000"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "DUP3"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "ADD"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "MSTORE"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "DUP2"
- },
- {
- "begin": 1017,
- "end": 1066,
- "name": "JUMP",
- "value": "[out]"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "tag",
- "value": "19"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "JUMPDEST"
- },
- {
- "begin": 1160,
- "end": 1179,
- "name": "PUSH",
- "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
- },
- {
- "begin": 1168,
- "end": 1178,
- "name": "CALLER"
- },
- {
- "begin": 1160,
- "end": 1179,
- "name": "DUP2"
- },
- {
- "begin": 1160,
- "end": 1179,
- "name": "AND"
- },
- {
- "begin": 1144,
- "end": 1148,
- "name": "PUSH",
- "value": "0"
- },
- {
- "begin": 1160,
- "end": 1179,
- "name": "DUP2"
- },
- {
- "begin": 1160,
- "end": 1179,
- "name": "DUP2"
- },
- {
- "begin": 1160,
- "end": 1179,
- "name": "MSTORE"
- },
- {
- "begin": 1160,
- "end": 1167,
- "name": "PUSH",
- "value": "1"
- },
- {
- "begin": 1160,
- "end": 1179,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 1160,
- "end": 1179,
- "name": "SWAP1"
- },
- {
- "begin": 1160,
- "end": 1179,
- "name": "DUP2"
- },
- {
- "begin": 1160,
- "end": 1179,
- "name": "MSTORE"
- },
- {
- "begin": 1160,
- "end": 1179,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 1160,
- "end": 1179,
- "name": "DUP1"
- },
- {
- "begin": 1160,
- "end": 1179,
- "name": "DUP4"
- },
- {
- "begin": 1160,
- "end": 1179,
- "name": "SHA3"
- },
- {
- "begin": 1160,
- "end": 1189,
- "name": "SWAP5"
- },
- {
- "begin": 1160,
- "end": 1189,
- "name": "DUP8"
- },
- {
- "begin": 1160,
- "end": 1189,
- "name": "AND"
- },
- {
- "begin": 1160,
- "end": 1189,
- "name": "DUP1"
- },
- {
- "begin": 1160,
- "end": 1189,
- "name": "DUP5"
- },
- {
- "begin": 1160,
- "end": 1189,
- "name": "MSTORE"
- },
- {
- "begin": 1160,
- "end": 1189,
- "name": "SWAP5"
- },
- {
- "begin": 1160,
- "end": 1189,
- "name": "DUP3"
- },
- {
- "begin": 1160,
- "end": 1189,
- "name": "MSTORE"
- },
- {
- "begin": 1160,
- "end": 1189,
- "name": "DUP1"
- },
- {
- "begin": 1160,
- "end": 1189,
- "name": "DUP4"
- },
- {
- "begin": 1160,
- "end": 1189,
- "name": "SHA3"
- },
- {
- "begin": 1160,
- "end": 1198,
- "name": "DUP7"
- },
- {
- "begin": 1160,
- "end": 1198,
- "name": "SWAP1"
- },
- {
- "begin": 1160,
- "end": 1198,
- "name": "SSTORE"
- },
- {
- "begin": 1208,
- "end": 1246,
- "name": "DUP1"
- },
- {
- "begin": 1208,
- "end": 1246,
- "name": "MLOAD"
- },
- {
- "begin": 1208,
- "end": 1246,
- "name": "DUP7"
- },
- {
- "begin": 1208,
- "end": 1246,
- "name": "DUP2"
- },
- {
- "begin": 1208,
- "end": 1246,
- "name": "MSTORE"
- },
- {
- "begin": 1208,
- "end": 1246,
- "name": "SWAP1"
- },
- {
- "begin": 1208,
- "end": 1246,
- "name": "MLOAD"
- },
- {
- "begin": 1144,
- "end": 1148,
- "name": "SWAP3"
- },
- {
- "begin": 1144,
- "end": 1148,
- "name": "SWAP5"
- },
- {
- "begin": 1160,
- "end": 1189,
- "name": "SWAP4"
- },
- {
- "begin": 1160,
- "end": 1179,
- "name": "SWAP3"
- },
- {
- "begin": 1208,
- "end": 1246,
- "name": "PUSH",
- "value": "8C5BE1E5EBEC7D5BD14F71427D1E84F3DD0314C0F7B2291E5B200AC8C7C3B925"
- },
- {
- "begin": 1208,
- "end": 1246,
- "name": "SWAP3"
- },
- {
- "begin": 1208,
- "end": 1246,
- "name": "SWAP2"
- },
- {
- "begin": 1208,
- "end": 1246,
- "name": "DUP2"
- },
- {
- "begin": 1208,
- "end": 1246,
- "name": "SWAP1"
- },
- {
- "begin": 1208,
- "end": 1246,
- "name": "SUB"
- },
- {
- "begin": 1208,
- "end": 1246,
- "name": "SWAP1"
- },
- {
- "begin": 1208,
- "end": 1246,
- "name": "SWAP2"
- },
- {
- "begin": 1208,
- "end": 1246,
- "name": "ADD"
- },
- {
- "begin": 1208,
- "end": 1246,
- "name": "SWAP1"
- },
- {
- "begin": 1208,
- "end": 1246,
- "name": "LOG3"
- },
- {
- "begin": -1,
- "end": -1,
- "name": "POP"
- },
- {
- "begin": 1263,
- "end": 1267,
- "name": "PUSH",
- "value": "1"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "tag",
- "value": "44"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "JUMPDEST"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "SWAP3"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "SWAP2"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "POP"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "POP"
- },
- {
- "begin": 1087,
- "end": 1274,
- "name": "JUMP",
- "value": "[out]"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "tag",
- "value": "22"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "JUMPDEST"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "PUSH",
- "value": "3"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "SLOAD"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "DUP2"
- },
- {
- "begin": 937,
- "end": 972,
- "name": "JUMP",
- "value": "[out]"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "tag",
- "value": "25"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "JUMPDEST"
- },
- {
- "begin": 1198,
- "end": 1212,
- "name": "PUSH",
- "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
- },
- {
- "begin": 1198,
- "end": 1212,
- "name": "DUP1"
- },
- {
- "begin": 1198,
- "end": 1212,
- "name": "DUP5"
- },
- {
- "begin": 1198,
- "end": 1212,
- "name": "AND"
- },
- {
- "begin": 1161,
- "end": 1165,
- "name": "PUSH",
- "value": "0"
- },
- {
- "begin": 1198,
- "end": 1212,
- "name": "DUP2"
- },
- {
- "begin": 1198,
- "end": 1212,
- "name": "DUP2"
- },
- {
- "begin": 1198,
- "end": 1212,
- "name": "MSTORE"
- },
- {
- "begin": 1198,
- "end": 1205,
- "name": "PUSH",
- "value": "1"
- },
- {
- "begin": 1198,
- "end": 1212,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 1198,
- "end": 1212,
- "name": "SWAP1"
- },
- {
- "begin": 1198,
- "end": 1212,
- "name": "DUP2"
- },
- {
- "begin": 1198,
- "end": 1212,
- "name": "MSTORE"
- },
- {
- "begin": 1198,
- "end": 1212,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 1198,
- "end": 1212,
- "name": "DUP1"
- },
- {
- "begin": 1198,
- "end": 1212,
- "name": "DUP4"
- },
- {
- "begin": 1198,
- "end": 1212,
- "name": "SHA3"
- },
- {
- "begin": 1213,
- "end": 1223,
- "name": "CALLER"
- },
- {
- "begin": 1198,
- "end": 1224,
- "name": "SWAP1"
- },
- {
- "begin": 1198,
- "end": 1224,
- "name": "SWAP6"
- },
- {
- "begin": 1198,
- "end": 1224,
- "name": "AND"
- },
- {
- "begin": 1198,
- "end": 1224,
- "name": "DUP4"
- },
- {
- "begin": 1198,
- "end": 1224,
- "name": "MSTORE"
- },
- {
- "begin": 1198,
- "end": 1224,
- "name": "SWAP4"
- },
- {
- "begin": 1198,
- "end": 1224,
- "name": "DUP2"
- },
- {
- "begin": 1198,
- "end": 1224,
- "name": "MSTORE"
- },
- {
- "begin": 1198,
- "end": 1224,
- "name": "DUP4"
- },
- {
- "begin": 1198,
- "end": 1224,
- "name": "DUP3"
- },
- {
- "begin": 1198,
- "end": 1224,
- "name": "SHA3"
- },
- {
- "begin": 1198,
- "end": 1224,
- "name": "SLOAD"
- },
- {
- "begin": 1238,
- "end": 1253,
- "name": "SWAP3"
- },
- {
- "begin": 1238,
- "end": 1253,
- "name": "DUP3"
- },
- {
- "begin": 1238,
- "end": 1253,
- "name": "MSTORE"
- },
- {
- "begin": 1238,
- "end": 1253,
- "name": "DUP2"
- },
- {
- "begin": 1238,
- "end": 1253,
- "name": "SWAP1"
- },
- {
- "begin": 1238,
- "end": 1253,
- "name": "MSTORE"
- },
- {
- "begin": 1238,
- "end": 1253,
- "name": "SWAP2"
- },
- {
- "begin": 1238,
- "end": 1253,
- "name": "DUP3"
- },
- {
- "begin": 1238,
- "end": 1253,
- "name": "SHA3"
- },
- {
- "begin": 1238,
- "end": 1253,
- "name": "SLOAD"
- },
- {
- "begin": 1238,
- "end": 1263,
- "name": "DUP4"
- },
- {
- "begin": 1238,
- "end": 1263,
- "name": "SWAP1"
- },
- {
- "begin": 1238,
- "end": 1263,
- "name": "LT"
- },
- {
- "begin": 1238,
- "end": 1263,
- "name": "DUP1"
- },
- {
- "begin": 1238,
- "end": 1263,
- "name": "ISZERO"
- },
- {
- "begin": 1238,
- "end": 1263,
- "name": "SWAP1"
- },
- {
- "begin": 1238,
- "end": 1298,
- "name": "PUSH [tag]",
- "value": "46"
- },
- {
- "begin": 1238,
- "end": 1298,
- "name": "JUMPI"
- },
- {
- "begin": 1238,
- "end": 1298,
- "name": "POP"
- },
- {
- "begin": 1292,
- "end": 1298,
- "name": "DUP3"
- },
- {
- "begin": 1279,
- "end": 1288,
- "name": "DUP2"
- },
- {
- "begin": 1279,
- "end": 1298,
- "name": "LT"
- },
- {
- "begin": 1279,
- "end": 1298,
- "name": "ISZERO"
- },
- {
- "begin": 1238,
- "end": 1298,
- "name": "tag",
- "value": "46"
- },
- {
- "begin": 1238,
- "end": 1298,
- "name": "JUMPDEST"
- },
- {
- "begin": 1238,
- "end": 1353,
- "name": "DUP1"
- },
- {
- "begin": 1238,
- "end": 1353,
- "name": "ISZERO"
- },
- {
- "begin": 1238,
- "end": 1353,
- "name": "PUSH [tag]",
- "value": "47"
- },
- {
- "begin": 1238,
- "end": 1353,
- "name": "JUMPI"
- },
- {
- "begin": -1,
- "end": -1,
- "name": "POP"
- },
- {
- "begin": 1340,
- "end": 1353,
- "name": "PUSH",
- "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
- },
- {
- "begin": 1340,
- "end": 1353,
- "name": "DUP5"
- },
- {
- "begin": 1340,
- "end": 1353,
- "name": "AND"
- },
- {
- "begin": 1340,
- "end": 1348,
- "name": "PUSH",
- "value": "0"
- },
- {
- "begin": 1340,
- "end": 1353,
- "name": "SWAP1"
- },
- {
- "begin": 1340,
- "end": 1353,
- "name": "DUP2"
- },
- {
- "begin": 1340,
- "end": 1353,
- "name": "MSTORE"
- },
- {
- "begin": 1340,
- "end": 1353,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 1340,
- "end": 1353,
- "name": "DUP2"
- },
- {
- "begin": 1340,
- "end": 1353,
- "name": "SWAP1"
- },
- {
- "begin": 1340,
- "end": 1353,
- "name": "MSTORE"
- },
- {
- "begin": 1340,
- "end": 1353,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 1340,
- "end": 1353,
- "name": "SWAP1"
- },
- {
- "begin": 1340,
- "end": 1353,
- "name": "SHA3"
- },
- {
- "begin": 1340,
- "end": 1353,
- "name": "SLOAD"
- },
- {
- "begin": 1314,
- "end": 1336,
- "name": "DUP4"
- },
- {
- "begin": 1314,
- "end": 1336,
- "name": "DUP2"
- },
- {
- "begin": 1314,
- "end": 1336,
- "name": "ADD"
- },
- {
- "begin": 1314,
- "end": 1353,
- "name": "LT"
- },
- {
- "begin": 1314,
- "end": 1353,
- "name": "ISZERO"
- },
- {
- "begin": 1238,
- "end": 1353,
- "name": "tag",
- "value": "47"
- },
- {
- "begin": 1238,
- "end": 1353,
- "name": "JUMPDEST"
- },
- {
- "begin": 1234,
- "end": 1669,
- "name": "ISZERO"
- },
- {
- "begin": 1234,
- "end": 1669,
- "name": "PUSH [tag]",
- "value": "48"
- },
- {
- "begin": 1234,
- "end": 1669,
- "name": "JUMPI"
- },
- {
- "begin": 1378,
- "end": 1391,
- "name": "PUSH",
- "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
- },
- {
- "begin": 1378,
- "end": 1391,
- "name": "DUP1"
- },
- {
- "begin": 1378,
- "end": 1391,
- "name": "DUP6"
- },
- {
- "begin": 1378,
- "end": 1391,
- "name": "AND"
- },
- {
- "begin": 1378,
- "end": 1386,
- "name": "PUSH",
- "value": "0"
- },
- {
- "begin": 1378,
- "end": 1391,
- "name": "SWAP1"
- },
- {
- "begin": 1378,
- "end": 1391,
- "name": "DUP2"
- },
- {
- "begin": 1378,
- "end": 1391,
- "name": "MSTORE"
- },
- {
- "begin": 1378,
- "end": 1391,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 1378,
- "end": 1391,
- "name": "DUP2"
- },
- {
- "begin": 1378,
- "end": 1391,
- "name": "SWAP1"
- },
- {
- "begin": 1378,
- "end": 1391,
- "name": "MSTORE"
- },
- {
- "begin": 1378,
- "end": 1391,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 1378,
- "end": 1391,
- "name": "DUP1"
- },
- {
- "begin": 1378,
- "end": 1391,
- "name": "DUP3"
- },
- {
- "begin": 1378,
- "end": 1391,
- "name": "SHA3"
- },
- {
- "begin": 1378,
- "end": 1401,
- "name": "DUP1"
- },
- {
- "begin": 1378,
- "end": 1401,
- "name": "SLOAD"
- },
- {
- "begin": 1378,
- "end": 1401,
- "name": "DUP8"
- },
- {
- "begin": 1378,
- "end": 1401,
- "name": "ADD"
- },
- {
- "begin": 1378,
- "end": 1401,
- "name": "SWAP1"
- },
- {
- "begin": 1378,
- "end": 1401,
- "name": "SSTORE"
- },
- {
- "begin": 1415,
- "end": 1430,
- "name": "SWAP2"
- },
- {
- "begin": 1415,
- "end": 1430,
- "name": "DUP8"
- },
- {
- "begin": 1415,
- "end": 1430,
- "name": "AND"
- },
- {
- "begin": 1415,
- "end": 1430,
- "name": "DUP2"
- },
- {
- "begin": 1415,
- "end": 1430,
- "name": "MSTORE"
- },
- {
- "begin": 1415,
- "end": 1430,
- "name": "SHA3"
- },
- {
- "begin": 1415,
- "end": 1440,
- "name": "DUP1"
- },
- {
- "begin": 1415,
- "end": 1440,
- "name": "SLOAD"
- },
- {
- "begin": 1415,
- "end": 1440,
- "name": "DUP5"
- },
- {
- "begin": 1415,
- "end": 1440,
- "name": "SWAP1"
- },
- {
- "begin": 1415,
- "end": 1440,
- "name": "SUB"
- },
- {
- "begin": 1415,
- "end": 1440,
- "name": "SWAP1"
- },
- {
- "begin": 1415,
- "end": 1440,
- "name": "SSTORE"
- },
- {
- "begin": 768,
- "end": 778,
- "name": "PUSH",
- "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
- },
- {
- "begin": 1458,
- "end": 1478,
- "name": "DUP2"
- },
- {
- "begin": 1458,
- "end": 1478,
- "name": "LT"
- },
- {
- "begin": 1454,
- "end": 1549,
- "name": "ISZERO"
- },
- {
- "begin": 1454,
- "end": 1549,
- "name": "PUSH [tag]",
- "value": "49"
- },
- {
- "begin": 1454,
- "end": 1549,
- "name": "JUMPI"
- },
- {
- "begin": 1498,
- "end": 1512,
- "name": "PUSH",
- "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
- },
- {
- "begin": 1498,
- "end": 1512,
- "name": "DUP1"
- },
- {
- "begin": 1498,
- "end": 1512,
- "name": "DUP7"
- },
- {
- "begin": 1498,
- "end": 1512,
- "name": "AND"
- },
- {
- "begin": 1498,
- "end": 1512,
- "name": "PUSH",
- "value": "0"
- },
- {
- "begin": 1498,
- "end": 1512,
- "name": "SWAP1"
- },
- {
- "begin": 1498,
- "end": 1512,
- "name": "DUP2"
- },
- {
- "begin": 1498,
- "end": 1512,
- "name": "MSTORE"
- },
- {
- "begin": 1498,
- "end": 1505,
- "name": "PUSH",
- "value": "1"
- },
- {
- "begin": 1498,
- "end": 1512,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 1498,
- "end": 1512,
- "name": "SWAP1"
- },
- {
- "begin": 1498,
- "end": 1512,
- "name": "DUP2"
- },
- {
- "begin": 1498,
- "end": 1512,
- "name": "MSTORE"
- },
- {
- "begin": 1498,
- "end": 1512,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 1498,
- "end": 1512,
- "name": "DUP1"
- },
- {
- "begin": 1498,
- "end": 1512,
- "name": "DUP4"
- },
- {
- "begin": 1498,
- "end": 1512,
- "name": "SHA3"
- },
- {
- "begin": 1513,
- "end": 1523,
- "name": "CALLER"
- },
- {
- "begin": 1498,
- "end": 1524,
- "name": "SWAP1"
- },
- {
- "begin": 1498,
- "end": 1524,
- "name": "SWAP5"
- },
- {
- "begin": 1498,
- "end": 1524,
- "name": "AND"
- },
- {
- "begin": 1498,
- "end": 1524,
- "name": "DUP4"
- },
- {
- "begin": 1498,
- "end": 1524,
- "name": "MSTORE"
- },
- {
- "begin": 1498,
- "end": 1524,
- "name": "SWAP3"
- },
- {
- "begin": 1498,
- "end": 1524,
- "name": "SWAP1"
- },
- {
- "begin": 1498,
- "end": 1524,
- "name": "MSTORE"
- },
- {
- "begin": 1498,
- "end": 1524,
- "name": "SHA3"
- },
- {
- "begin": 1498,
- "end": 1534,
- "name": "DUP1"
- },
- {
- "begin": 1498,
- "end": 1534,
- "name": "SLOAD"
- },
- {
- "begin": 1498,
- "end": 1534,
- "name": "DUP5"
- },
- {
- "begin": 1498,
- "end": 1534,
- "name": "SWAP1"
- },
- {
- "begin": 1498,
- "end": 1534,
- "name": "SUB"
- },
- {
- "begin": 1498,
- "end": 1534,
- "name": "SWAP1"
- },
- {
- "begin": 1498,
- "end": 1534,
- "name": "SSTORE"
- },
- {
- "begin": 1454,
- "end": 1549,
- "name": "tag",
- "value": "49"
- },
- {
- "begin": 1454,
- "end": 1549,
- "name": "JUMPDEST"
- },
- {
- "begin": 1578,
- "end": 1581,
- "name": "DUP4"
- },
- {
- "begin": 1562,
- "end": 1590,
- "name": "PUSH",
- "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
- },
- {
- "begin": 1562,
- "end": 1590,
- "name": "AND"
- },
- {
- "begin": 1571,
- "end": 1576,
- "name": "DUP6"
- },
- {
- "begin": 1562,
- "end": 1590,
- "name": "PUSH",
- "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
- },
- {
- "begin": 1562,
- "end": 1590,
- "name": "AND"
- },
- {
- "begin": 1562,
- "end": 1590,
- "name": "PUSH",
- "value": "DDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF"
- },
- {
- "begin": 1583,
- "end": 1589,
- "name": "DUP6"
- },
- {
- "begin": 1562,
- "end": 1590,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 1562,
- "end": 1590,
- "name": "MLOAD"
- },
- {
- "begin": 1562,
- "end": 1590,
- "name": "DUP1"
- },
- {
- "begin": 1562,
- "end": 1590,
- "name": "DUP3"
- },
- {
- "begin": 1562,
- "end": 1590,
- "name": "DUP2"
- },
- {
- "begin": 1562,
- "end": 1590,
- "name": "MSTORE"
- },
- {
- "begin": 1562,
- "end": 1590,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 1562,
- "end": 1590,
- "name": "ADD"
- },
- {
- "begin": 1562,
- "end": 1590,
- "name": "SWAP2"
- },
- {
- "begin": 1562,
- "end": 1590,
- "name": "POP"
- },
- {
- "begin": 1562,
- "end": 1590,
- "name": "POP"
- },
- {
- "begin": 1562,
- "end": 1590,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 1562,
- "end": 1590,
- "name": "MLOAD"
- },
- {
- "begin": 1562,
- "end": 1590,
- "name": "DUP1"
- },
- {
- "begin": 1562,
- "end": 1590,
- "name": "SWAP2"
- },
- {
- "begin": 1562,
- "end": 1590,
- "name": "SUB"
- },
- {
- "begin": 1562,
- "end": 1590,
- "name": "SWAP1"
- },
- {
- "begin": 1562,
- "end": 1590,
- "name": "LOG3"
- },
- {
- "begin": 1611,
- "end": 1615,
- "name": "PUSH",
- "value": "1"
- },
- {
- "begin": 1604,
- "end": 1615,
- "name": "SWAP2"
- },
- {
- "begin": 1604,
- "end": 1615,
- "name": "POP"
- },
- {
- "begin": 1604,
- "end": 1615,
- "name": "PUSH [tag]",
- "value": "50"
- },
- {
- "begin": 1604,
- "end": 1615,
- "name": "JUMP"
- },
- {
- "begin": 1234,
- "end": 1669,
- "name": "tag",
- "value": "48"
- },
- {
- "begin": 1234,
- "end": 1669,
- "name": "JUMPDEST"
- },
- {
- "begin": 1653,
- "end": 1658,
- "name": "PUSH",
- "value": "0"
- },
- {
- "begin": 1646,
- "end": 1658,
- "name": "SWAP2"
- },
- {
- "begin": 1646,
- "end": 1658,
- "name": "POP"
- },
- {
- "begin": 1234,
- "end": 1669,
- "name": "tag",
- "value": "50"
- },
- {
- "begin": 1234,
- "end": 1669,
- "name": "JUMPDEST"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "tag",
- "value": "45"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "JUMPDEST"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "POP"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "SWAP4"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "SWAP3"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "POP"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "POP"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "POP"
- },
- {
- "begin": 1066,
- "end": 1675,
- "name": "JUMP",
- "value": "[out]"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "tag",
- "value": "28"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "JUMPDEST"
- },
- {
- "begin": 929,
- "end": 931,
- "name": "PUSH",
- "value": "12"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "DUP2"
- },
- {
- "begin": 896,
- "end": 931,
- "name": "JUMP",
- "value": "[out]"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "tag",
- "value": "31"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "JUMPDEST"
- },
- {
- "begin": 1058,
- "end": 1074,
- "name": "PUSH",
- "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
- },
- {
- "begin": 1058,
- "end": 1074,
- "name": "DUP2"
- },
- {
- "begin": 1058,
- "end": 1074,
- "name": "AND"
- },
- {
- "begin": 1035,
- "end": 1039,
- "name": "PUSH",
- "value": "0"
- },
- {
- "begin": 1058,
- "end": 1074,
- "name": "SWAP1"
- },
- {
- "begin": 1058,
- "end": 1074,
- "name": "DUP2"
- },
- {
- "begin": 1058,
- "end": 1074,
- "name": "MSTORE"
- },
- {
- "begin": 1058,
- "end": 1074,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 1058,
- "end": 1074,
- "name": "DUP2"
- },
- {
- "begin": 1058,
- "end": 1074,
- "name": "SWAP1"
- },
- {
- "begin": 1058,
- "end": 1074,
- "name": "MSTORE"
- },
- {
- "begin": 1058,
- "end": 1074,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 1058,
- "end": 1074,
- "name": "SWAP1"
- },
- {
- "begin": 1058,
- "end": 1074,
- "name": "SHA3"
- },
- {
- "begin": 1058,
- "end": 1074,
- "name": "SLOAD"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "tag",
- "value": "51"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "JUMPDEST"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "SWAP2"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "SWAP1"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "POP"
- },
- {
- "begin": 982,
- "end": 1081,
- "name": "JUMP",
- "value": "[out]"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "tag",
- "value": "34"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "JUMPDEST"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "DUP1"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "MLOAD"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "DUP1"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "DUP3"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "ADD"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "SWAP1"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "SWAP2"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "MSTORE"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "PUSH",
- "value": "3"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "DUP2"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "MSTORE"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "PUSH",
- "value": "5A52580000000000000000000000000000000000000000000000000000000000"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "DUP3"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "ADD"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "MSTORE"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "DUP2"
- },
- {
- "begin": 1072,
- "end": 1109,
- "name": "JUMP",
- "value": "[out]"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "tag",
- "value": "40"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "JUMPDEST"
- },
- {
- "begin": 267,
- "end": 287,
- "name": "PUSH",
- "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
- },
- {
- "begin": 276,
- "end": 286,
- "name": "CALLER"
- },
- {
- "begin": 267,
- "end": 287,
- "name": "AND"
- },
- {
- "begin": 178,
- "end": 182,
- "name": "PUSH",
- "value": "0"
- },
- {
- "begin": 267,
- "end": 287,
- "name": "SWAP1"
- },
- {
- "begin": 267,
- "end": 287,
- "name": "DUP2"
- },
- {
- "begin": 267,
- "end": 287,
- "name": "MSTORE"
- },
- {
- "begin": 267,
- "end": 287,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 267,
- "end": 287,
- "name": "DUP2"
- },
- {
- "begin": 267,
- "end": 287,
- "name": "SWAP1"
- },
- {
- "begin": 267,
- "end": 287,
- "name": "MSTORE"
- },
- {
- "begin": 267,
- "end": 287,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 267,
- "end": 287,
- "name": "DUP2"
- },
- {
- "begin": 267,
- "end": 287,
- "name": "SHA3"
- },
- {
- "begin": 267,
- "end": 287,
- "name": "SLOAD"
- },
- {
- "begin": 267,
- "end": 297,
- "name": "DUP3"
- },
- {
- "begin": 267,
- "end": 297,
- "name": "SWAP1"
- },
- {
- "begin": 267,
- "end": 297,
- "name": "LT"
- },
- {
- "begin": 267,
- "end": 297,
- "name": "DUP1"
- },
- {
- "begin": 267,
- "end": 297,
- "name": "ISZERO"
- },
- {
- "begin": 267,
- "end": 297,
- "name": "SWAP1"
- },
- {
- "begin": 267,
- "end": 340,
- "name": "PUSH [tag]",
- "value": "53"
- },
- {
- "begin": 267,
- "end": 340,
- "name": "JUMPI"
- },
- {
- "begin": -1,
- "end": -1,
- "name": "POP"
- },
- {
- "begin": 327,
- "end": 340,
- "name": "PUSH",
- "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
- },
- {
- "begin": 327,
- "end": 340,
- "name": "DUP4"
- },
- {
- "begin": 327,
- "end": 340,
- "name": "AND"
- },
- {
- "begin": 327,
- "end": 335,
- "name": "PUSH",
- "value": "0"
- },
- {
- "begin": 327,
- "end": 340,
- "name": "SWAP1"
- },
- {
- "begin": 327,
- "end": 340,
- "name": "DUP2"
- },
- {
- "begin": 327,
- "end": 340,
- "name": "MSTORE"
- },
- {
- "begin": 327,
- "end": 340,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 327,
- "end": 340,
- "name": "DUP2"
- },
- {
- "begin": 327,
- "end": 340,
- "name": "SWAP1"
- },
- {
- "begin": 327,
- "end": 340,
- "name": "MSTORE"
- },
- {
- "begin": 327,
- "end": 340,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 327,
- "end": 340,
- "name": "SWAP1"
- },
- {
- "begin": 327,
- "end": 340,
- "name": "SHA3"
- },
- {
- "begin": 327,
- "end": 340,
- "name": "SLOAD"
- },
- {
- "begin": 301,
- "end": 323,
- "name": "DUP3"
- },
- {
- "begin": 301,
- "end": 323,
- "name": "DUP2"
- },
- {
- "begin": 301,
- "end": 323,
- "name": "ADD"
- },
- {
- "begin": 301,
- "end": 340,
- "name": "LT"
- },
- {
- "begin": 301,
- "end": 340,
- "name": "ISZERO"
- },
- {
- "begin": 267,
- "end": 340,
- "name": "tag",
- "value": "53"
- },
- {
- "begin": 267,
- "end": 340,
- "name": "JUMPDEST"
- },
- {
- "begin": 263,
- "end": 529,
- "name": "ISZERO"
- },
- {
- "begin": 263,
- "end": 529,
- "name": "PUSH [tag]",
- "value": "54"
- },
- {
- "begin": 263,
- "end": 529,
- "name": "JUMPI"
- },
- {
- "begin": 356,
- "end": 376,
- "name": "PUSH",
- "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
- },
- {
- "begin": 365,
- "end": 375,
- "name": "CALLER"
- },
- {
- "begin": 356,
- "end": 376,
- "name": "DUP2"
- },
- {
- "begin": 356,
- "end": 376,
- "name": "AND"
- },
- {
- "begin": 356,
- "end": 364,
- "name": "PUSH",
- "value": "0"
- },
- {
- "begin": 356,
- "end": 376,
- "name": "DUP2"
- },
- {
- "begin": 356,
- "end": 376,
- "name": "DUP2"
- },
- {
- "begin": 356,
- "end": 376,
- "name": "MSTORE"
- },
- {
- "begin": 356,
- "end": 376,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 356,
- "end": 376,
- "name": "DUP2"
- },
- {
- "begin": 356,
- "end": 376,
- "name": "DUP2"
- },
- {
- "begin": 356,
- "end": 376,
- "name": "MSTORE"
- },
- {
- "begin": 356,
- "end": 376,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 356,
- "end": 376,
- "name": "DUP1"
- },
- {
- "begin": 356,
- "end": 376,
- "name": "DUP4"
- },
- {
- "begin": 356,
- "end": 376,
- "name": "SHA3"
- },
- {
- "begin": 356,
- "end": 386,
- "name": "DUP1"
- },
- {
- "begin": 356,
- "end": 386,
- "name": "SLOAD"
- },
- {
- "begin": 356,
- "end": 386,
- "name": "DUP9"
- },
- {
- "begin": 356,
- "end": 386,
- "name": "SWAP1"
- },
- {
- "begin": 356,
- "end": 386,
- "name": "SUB"
- },
- {
- "begin": 356,
- "end": 386,
- "name": "SWAP1"
- },
- {
- "begin": 356,
- "end": 386,
- "name": "SSTORE"
- },
- {
- "begin": 400,
- "end": 413,
- "name": "SWAP4"
- },
- {
- "begin": 400,
- "end": 413,
- "name": "DUP8"
- },
- {
- "begin": 400,
- "end": 413,
- "name": "AND"
- },
- {
- "begin": 400,
- "end": 413,
- "name": "DUP1"
- },
- {
- "begin": 400,
- "end": 413,
- "name": "DUP4"
- },
- {
- "begin": 400,
- "end": 413,
- "name": "MSTORE"
- },
- {
- "begin": 400,
- "end": 413,
- "name": "SWAP2"
- },
- {
- "begin": 400,
- "end": 413,
- "name": "DUP5"
- },
- {
- "begin": 400,
- "end": 413,
- "name": "SWAP1"
- },
- {
- "begin": 400,
- "end": 413,
- "name": "SHA3"
- },
- {
- "begin": 400,
- "end": 423,
- "name": "DUP1"
- },
- {
- "begin": 400,
- "end": 423,
- "name": "SLOAD"
- },
- {
- "begin": 400,
- "end": 423,
- "name": "DUP8"
- },
- {
- "begin": 400,
- "end": 423,
- "name": "ADD"
- },
- {
- "begin": 400,
- "end": 423,
- "name": "SWAP1"
- },
- {
- "begin": 400,
- "end": 423,
- "name": "SSTORE"
- },
- {
- "begin": 437,
- "end": 470,
- "name": "DUP4"
- },
- {
- "begin": 437,
- "end": 470,
- "name": "MLOAD"
- },
- {
- "begin": 437,
- "end": 470,
- "name": "DUP7"
- },
- {
- "begin": 437,
- "end": 470,
- "name": "DUP2"
- },
- {
- "begin": 437,
- "end": 470,
- "name": "MSTORE"
- },
- {
- "begin": 437,
- "end": 470,
- "name": "SWAP4"
- },
- {
- "begin": 437,
- "end": 470,
- "name": "MLOAD"
- },
- {
- "begin": 400,
- "end": 413,
- "name": "SWAP2"
- },
- {
- "begin": 400,
- "end": 413,
- "name": "SWAP4"
- },
- {
- "begin": 437,
- "end": 470,
- "name": "PUSH",
- "value": "DDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF"
- },
- {
- "begin": 437,
- "end": 470,
- "name": "SWAP3"
- },
- {
- "begin": 437,
- "end": 470,
- "name": "SWAP1"
- },
- {
- "begin": 437,
- "end": 470,
- "name": "DUP2"
- },
- {
- "begin": 437,
- "end": 470,
- "name": "SWAP1"
- },
- {
- "begin": 437,
- "end": 470,
- "name": "SUB"
- },
- {
- "begin": 437,
- "end": 470,
- "name": "SWAP1"
- },
- {
- "begin": 437,
- "end": 470,
- "name": "SWAP2"
- },
- {
- "begin": 437,
- "end": 470,
- "name": "ADD"
- },
- {
- "begin": 437,
- "end": 470,
- "name": "SWAP1"
- },
- {
- "begin": 437,
- "end": 470,
- "name": "LOG3"
- },
- {
- "begin": -1,
- "end": -1,
- "name": "POP"
- },
- {
- "begin": 491,
- "end": 495,
- "name": "PUSH",
- "value": "1"
- },
- {
- "begin": 484,
- "end": 495,
- "name": "PUSH [tag]",
- "value": "44"
- },
- {
- "begin": 484,
- "end": 495,
- "name": "JUMP"
- },
- {
- "begin": 263,
- "end": 529,
- "name": "tag",
- "value": "54"
- },
- {
- "begin": 263,
- "end": 529,
- "name": "JUMPDEST"
- },
- {
- "begin": -1,
- "end": -1,
- "name": "POP"
- },
- {
- "begin": 521,
- "end": 526,
- "name": "PUSH",
- "value": "0"
- },
- {
- "begin": 514,
- "end": 526,
- "name": "PUSH [tag]",
- "value": "44"
- },
- {
- "begin": 514,
- "end": 526,
- "name": "JUMP"
- },
- {
- "begin": 263,
- "end": 529,
- "name": "tag",
- "value": "55"
- },
- {
- "begin": 263,
- "end": 529,
- "name": "JUMPDEST"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "tag",
- "value": "52"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "JUMPDEST"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "SWAP3"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "SWAP2"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "POP"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "POP"
- },
- {
- "begin": 125,
- "end": 535,
- "name": "JUMP",
- "value": "[out]"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "tag",
- "value": "43"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "JUMPDEST"
- },
- {
- "begin": 1374,
- "end": 1389,
- "name": "PUSH",
- "value": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
- },
- {
- "begin": 1374,
- "end": 1389,
- "name": "DUP1"
- },
- {
- "begin": 1374,
- "end": 1389,
- "name": "DUP4"
- },
- {
- "begin": 1374,
- "end": 1389,
- "name": "AND"
- },
- {
- "begin": 1351,
- "end": 1355,
- "name": "PUSH",
- "value": "0"
- },
- {
- "begin": 1374,
- "end": 1389,
- "name": "SWAP1"
- },
- {
- "begin": 1374,
- "end": 1389,
- "name": "DUP2"
- },
- {
- "begin": 1374,
- "end": 1389,
- "name": "MSTORE"
- },
- {
- "begin": 1374,
- "end": 1381,
- "name": "PUSH",
- "value": "1"
- },
- {
- "begin": 1374,
- "end": 1389,
- "name": "PUSH",
- "value": "20"
- },
- {
- "begin": 1374,
- "end": 1389,
- "name": "SWAP1"
- },
- {
- "begin": 1374,
- "end": 1389,
- "name": "DUP2"
- },
- {
- "begin": 1374,
- "end": 1389,
- "name": "MSTORE"
- },
- {
- "begin": 1374,
- "end": 1389,
- "name": "PUSH",
- "value": "40"
- },
- {
- "begin": 1374,
- "end": 1389,
- "name": "DUP1"
- },
- {
- "begin": 1374,
- "end": 1389,
- "name": "DUP4"
- },
- {
- "begin": 1374,
- "end": 1389,
- "name": "SHA3"
- },
- {
- "begin": 1374,
- "end": 1399,
- "name": "SWAP4"
- },
- {
- "begin": 1374,
- "end": 1399,
- "name": "DUP6"
- },
- {
- "begin": 1374,
- "end": 1399,
- "name": "AND"
- },
- {
- "begin": 1374,
- "end": 1399,
- "name": "DUP4"
- },
- {
- "begin": 1374,
- "end": 1399,
- "name": "MSTORE"
- },
- {
- "begin": 1374,
- "end": 1399,
- "name": "SWAP3"
- },
- {
- "begin": 1374,
- "end": 1399,
- "name": "SWAP1"
- },
- {
- "begin": 1374,
- "end": 1399,
- "name": "MSTORE"
- },
- {
- "begin": 1374,
- "end": 1399,
- "name": "SHA3"
- },
- {
- "begin": 1374,
- "end": 1399,
- "name": "SLOAD"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "tag",
- "value": "56"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "JUMPDEST"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "SWAP3"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "SWAP2"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "POP"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "POP"
- },
- {
- "begin": 1280,
- "end": 1406,
- "name": "JUMP",
- "value": "[out]"
- }
- ]
- }
- }
- },
- "methodIdentifiers": {
- "allowance(address,address)": "dd62ed3e",
- "approve(address,uint256)": "095ea7b3",
- "balanceOf(address)": "70a08231",
- "decimals()": "313ce567",
- "name()": "06fdde03",
- "symbol()": "95d89b41",
- "totalSupply()": "18160ddd",
- "transfer(address,uint256)": "a9059cbb",
- "transferFrom(address,address,uint256)": "23b872dd"
- }
- },
- "metadata": "{\"compiler\":{\"version\":\"0.4.11+commit.68ef5810\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":true,\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_spender\",\"type\":\"address\"},{\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_from\",\"type\":\"address\"},{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"},{\"name\":\"_spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"inputs\":[],\"payable\":false,\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"_from\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"_to\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"_owner\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"_spender\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"}],\"devdoc\":{\"methods\":{\"transferFrom(address,address,uint256)\":{\"details\":\"ERC20 transferFrom, modified such that an allowance of MAX_UINT represents an unlimited allowance.\",\"params\":{\"_from\":\"Address to transfer from.\",\"_to\":\"Address to transfer to.\",\"_value\":\"Amount to transfer.\"},\"return\":\"Success of transfer.\"}}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"2.0.0/tokens/ZRXToken/ZRXToken.sol\":\"ZRXToken\"},\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":1000000},\"remappings\":[]},\"sources\":{\"1.0.0/ERC20Token/ERC20Token_v1.sol\":{\"keccak256\":\"0x3d710b436c430d6fe49f64b091555405360d76da6454b93faa8e213eea34a96d\",\"urls\":[\"bzzr://d12710a563415ad98ff28ecb3aab0b68467b3d023e7c130c73ed9918ef86158e\"]},\"1.0.0/Token/Token_v1.sol\":{\"keccak256\":\"0x35a82bc7bc0994caa97f8ea44660b9b5e796acfe72705b5ff7ed8f2a3c47ff37\",\"urls\":[\"bzzr://a62ae857a4cf2e8948e36d02470c612ac1a5ac20ebe1c1b553ad1ed8becb634e\"]},\"1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\":{\"keccak256\":\"0x2e1f4b899081cedd8940a9cd0f0f7413264c883312ed0ba9c53885766fe0a1a5\",\"urls\":[\"bzzr://47c42a58e56ffe81e49c8aabd3c391f5fa807fea299b3a2178501e3669baeb52\"]},\"2.0.0/tokens/ZRXToken/ZRXToken.sol\":{\"keccak256\":\"0x8c1c3401023b24d6248391a1f4596f3552caf846c9dcb2450110d7b6cc91acf1\",\"urls\":[\"bzzr://57a9912b95029fdeb1cb791f085472bef8bf3f68885b82035939d4ed5dceaa8f\"]}},\"version\":1}",
- "userdoc": {
- "methods": {}
- }
- },
- "sources": {
- "1.0.0/ERC20Token/ERC20Token_v1.sol": {
- "id": 0,
- "legacyAST": {
- "children": [
- {
- "attributes": {
- "literals": [
- "solidity",
- "^",
- "0.4",
- ".11"
- ]
- },
- "id": 126,
- "name": "PragmaDirective",
- "src": "0:24:0"
- },
- {
- "attributes": {
- "file": "../Token/Token_v1.sol"
- },
- "id": 128,
- "name": "ImportDirective",
- "src": "26:58:0"
- },
- {
- "attributes": {
- "fullyImplemented": true,
- "isLibrary": false,
- "linearizedBaseContracts": [
- 322,
- 397
- ],
- "name": "ERC20Token_v1"
- },
- "children": [
- {
- "children": [
- {
- "attributes": {
- "name": "Token"
- },
- "id": 129,
- "name": "UserDefinedTypeName",
- "src": "112:5:0"
- }
- ],
- "id": 130,
- "name": "InheritanceSpecifier",
- "src": "112:5:0"
- },
- {
- "attributes": {
- "constant": false,
- "name": "transfer",
- "payable": false,
- "visibility": "public"
- },
- "children": [
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "name": "_to",
- "storageLocation": "default",
- "type": "address",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "address"
- },
- "id": 131,
- "name": "ElementaryTypeName",
- "src": "143:7:0"
- }
- ],
- "id": 132,
- "name": "VariableDeclaration",
- "src": "143:11:0"
- },
- {
- "attributes": {
- "constant": false,
- "name": "_value",
- "storageLocation": "default",
- "type": "uint256",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "uint"
- },
- "id": 133,
- "name": "ElementaryTypeName",
- "src": "156:4:0"
- }
- ],
- "id": 134,
- "name": "VariableDeclaration",
- "src": "156:11:0"
- }
- ],
- "id": 135,
- "name": "ParameterList",
- "src": "142:26:0"
- },
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "name": "",
- "storageLocation": "default",
- "type": "bool",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "bool"
- },
- "id": 136,
- "name": "ElementaryTypeName",
- "src": "178:4:0"
- }
- ],
- "id": 137,
- "name": "VariableDeclaration",
- "src": "178:4:0"
- }
- ],
- "id": 138,
- "name": "ParameterList",
- "src": "177:6:0"
- },
- {
- "children": [
- {
- "children": [
- {
- "attributes": {
- "operator": "&&",
- "type": "bool"
- },
- "children": [
- {
- "attributes": {
- "operator": ">=",
- "type": "bool"
- },
- "children": [
- {
- "attributes": {
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => uint256)",
- "value": "balances"
- },
- "id": 139,
- "name": "Identifier",
- "src": "267:8:0"
- },
- {
- "attributes": {
- "member_name": "sender",
- "type": "address"
- },
- "children": [
- {
- "attributes": {
- "type": "msg",
- "value": "msg"
- },
- "id": 140,
- "name": "Identifier",
- "src": "276:3:0"
- }
- ],
- "id": 141,
- "name": "MemberAccess",
- "src": "276:10:0"
- }
- ],
- "id": 142,
- "name": "IndexAccess",
- "src": "267:20:0"
- },
- {
- "attributes": {
- "type": "uint256",
- "value": "_value"
- },
- "id": 143,
- "name": "Identifier",
- "src": "291:6:0"
- }
- ],
- "id": 144,
- "name": "BinaryOperation",
- "src": "267:30:0"
- },
- {
- "attributes": {
- "operator": ">=",
- "type": "bool"
- },
- "children": [
- {
- "attributes": {
- "operator": "+",
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => uint256)",
- "value": "balances"
- },
- "id": 145,
- "name": "Identifier",
- "src": "301:8:0"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_to"
- },
- "id": 146,
- "name": "Identifier",
- "src": "310:3:0"
- }
- ],
- "id": 147,
- "name": "IndexAccess",
- "src": "301:13:0"
- },
- {
- "attributes": {
- "type": "uint256",
- "value": "_value"
- },
- "id": 148,
- "name": "Identifier",
- "src": "317:6:0"
- }
- ],
- "id": 149,
- "name": "BinaryOperation",
- "src": "301:22:0"
- },
- {
- "attributes": {
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => uint256)",
- "value": "balances"
- },
- "id": 150,
- "name": "Identifier",
- "src": "327:8:0"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_to"
- },
- "id": 151,
- "name": "Identifier",
- "src": "336:3:0"
- }
- ],
- "id": 152,
- "name": "IndexAccess",
- "src": "327:13:0"
- }
- ],
- "id": 153,
- "name": "BinaryOperation",
- "src": "301:39:0"
- }
- ],
- "id": 154,
- "name": "BinaryOperation",
- "src": "267:73:0"
- },
- {
- "children": [
- {
- "children": [
- {
- "attributes": {
- "operator": "-=",
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => uint256)",
- "value": "balances"
- },
- "id": 155,
- "name": "Identifier",
- "src": "356:8:0"
- },
- {
- "attributes": {
- "member_name": "sender",
- "type": "address"
- },
- "children": [
- {
- "attributes": {
- "type": "msg",
- "value": "msg"
- },
- "id": 156,
- "name": "Identifier",
- "src": "365:3:0"
- }
- ],
- "id": 157,
- "name": "MemberAccess",
- "src": "365:10:0"
- }
- ],
- "id": 158,
- "name": "IndexAccess",
- "src": "356:20:0"
- },
- {
- "attributes": {
- "type": "uint256",
- "value": "_value"
- },
- "id": 159,
- "name": "Identifier",
- "src": "380:6:0"
- }
- ],
- "id": 160,
- "name": "Assignment",
- "src": "356:30:0"
- }
- ],
- "id": 161,
- "name": "ExpressionStatement",
- "src": "356:30:0"
- },
- {
- "children": [
- {
- "attributes": {
- "operator": "+=",
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => uint256)",
- "value": "balances"
- },
- "id": 162,
- "name": "Identifier",
- "src": "400:8:0"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_to"
- },
- "id": 163,
- "name": "Identifier",
- "src": "409:3:0"
- }
- ],
- "id": 164,
- "name": "IndexAccess",
- "src": "400:13:0"
- },
- {
- "attributes": {
- "type": "uint256",
- "value": "_value"
- },
- "id": 165,
- "name": "Identifier",
- "src": "417:6:0"
- }
- ],
- "id": 166,
- "name": "Assignment",
- "src": "400:23:0"
- }
- ],
- "id": 167,
- "name": "ExpressionStatement",
- "src": "400:23:0"
- },
- {
- "children": [
- {
- "attributes": {
- "type": "tuple()",
- "type_conversion": false
- },
- "children": [
- {
- "attributes": {
- "type": "function (address,address,uint256) constant",
- "value": "Transfer"
- },
- "id": 168,
- "name": "Identifier",
- "src": "437:8:0"
- },
- {
- "attributes": {
- "member_name": "sender",
- "type": "address"
- },
- "children": [
- {
- "attributes": {
- "type": "msg",
- "value": "msg"
- },
- "id": 169,
- "name": "Identifier",
- "src": "446:3:0"
- }
- ],
- "id": 170,
- "name": "MemberAccess",
- "src": "446:10:0"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_to"
- },
- "id": 171,
- "name": "Identifier",
- "src": "458:3:0"
- },
- {
- "attributes": {
- "type": "uint256",
- "value": "_value"
- },
- "id": 172,
- "name": "Identifier",
- "src": "463:6:0"
- }
- ],
- "id": 173,
- "name": "FunctionCall",
- "src": "437:33:0"
- }
- ],
- "id": 174,
- "name": "ExpressionStatement",
- "src": "437:33:0"
- },
- {
- "children": [
- {
- "attributes": {
- "hexvalue": "74727565",
- "subdenomination": null,
- "token": "true",
- "type": "bool",
- "value": "true"
- },
- "id": 175,
- "name": "Literal",
- "src": "491:4:0"
- }
- ],
- "id": 176,
- "name": "Return",
- "src": "484:11:0"
- }
- ],
- "id": 177,
- "name": "Block",
- "src": "342:164:0"
- },
- {
- "children": [
- {
- "children": [
- {
- "attributes": {
- "hexvalue": "66616c7365",
- "subdenomination": null,
- "token": "false",
- "type": "bool",
- "value": "false"
- },
- "id": 178,
- "name": "Literal",
- "src": "521:5:0"
- }
- ],
- "id": 179,
- "name": "Return",
- "src": "514:12:0"
- }
- ],
- "id": 180,
- "name": "Block",
- "src": "512:17:0"
- }
- ],
- "id": 181,
- "name": "IfStatement",
- "src": "263:266:0"
- }
- ],
- "id": 182,
- "name": "Block",
- "src": "184:351:0"
- }
- ],
- "id": 183,
- "name": "FunctionDefinition",
- "src": "125:410:0"
- },
- {
- "attributes": {
- "constant": false,
- "name": "transferFrom",
- "payable": false,
- "visibility": "public"
- },
- "children": [
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "name": "_from",
- "storageLocation": "default",
- "type": "address",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "address"
- },
- "id": 184,
- "name": "ElementaryTypeName",
- "src": "563:7:0"
- }
- ],
- "id": 185,
- "name": "VariableDeclaration",
- "src": "563:13:0"
- },
- {
- "attributes": {
- "constant": false,
- "name": "_to",
- "storageLocation": "default",
- "type": "address",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "address"
- },
- "id": 186,
- "name": "ElementaryTypeName",
- "src": "578:7:0"
- }
- ],
- "id": 187,
- "name": "VariableDeclaration",
- "src": "578:11:0"
- },
- {
- "attributes": {
- "constant": false,
- "name": "_value",
- "storageLocation": "default",
- "type": "uint256",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "uint"
- },
- "id": 188,
- "name": "ElementaryTypeName",
- "src": "591:4:0"
- }
- ],
- "id": 189,
- "name": "VariableDeclaration",
- "src": "591:11:0"
- }
- ],
- "id": 190,
- "name": "ParameterList",
- "src": "562:41:0"
- },
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "name": "",
- "storageLocation": "default",
- "type": "bool",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "bool"
- },
- "id": 191,
- "name": "ElementaryTypeName",
- "src": "613:4:0"
- }
- ],
- "id": 192,
- "name": "VariableDeclaration",
- "src": "613:4:0"
- }
- ],
- "id": 193,
- "name": "ParameterList",
- "src": "612:6:0"
- },
- {
- "children": [
- {
- "children": [
- {
- "attributes": {
- "operator": "&&",
- "type": "bool"
- },
- "children": [
- {
- "attributes": {
- "operator": "&&",
- "type": "bool"
- },
- "children": [
- {
- "attributes": {
- "operator": ">=",
- "type": "bool"
- },
- "children": [
- {
- "attributes": {
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => uint256)",
- "value": "balances"
- },
- "id": 194,
- "name": "Identifier",
- "src": "633:8:0"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_from"
- },
- "id": 195,
- "name": "Identifier",
- "src": "642:5:0"
- }
- ],
- "id": 196,
- "name": "IndexAccess",
- "src": "633:15:0"
- },
- {
- "attributes": {
- "type": "uint256",
- "value": "_value"
- },
- "id": 197,
- "name": "Identifier",
- "src": "652:6:0"
- }
- ],
- "id": 198,
- "name": "BinaryOperation",
- "src": "633:25:0"
- },
- {
- "attributes": {
- "operator": ">=",
- "type": "bool"
- },
- "children": [
- {
- "attributes": {
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => uint256)"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => mapping(address => uint256))",
- "value": "allowed"
- },
- "id": 199,
- "name": "Identifier",
- "src": "662:7:0"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_from"
- },
- "id": 200,
- "name": "Identifier",
- "src": "670:5:0"
- }
- ],
- "id": 201,
- "name": "IndexAccess",
- "src": "662:14:0"
- },
- {
- "attributes": {
- "member_name": "sender",
- "type": "address"
- },
- "children": [
- {
- "attributes": {
- "type": "msg",
- "value": "msg"
- },
- "id": 202,
- "name": "Identifier",
- "src": "677:3:0"
- }
- ],
- "id": 203,
- "name": "MemberAccess",
- "src": "677:10:0"
- }
- ],
- "id": 204,
- "name": "IndexAccess",
- "src": "662:26:0"
- },
- {
- "attributes": {
- "type": "uint256",
- "value": "_value"
- },
- "id": 205,
- "name": "Identifier",
- "src": "692:6:0"
- }
- ],
- "id": 206,
- "name": "BinaryOperation",
- "src": "662:36:0"
- }
- ],
- "id": 207,
- "name": "BinaryOperation",
- "src": "633:65:0"
- },
- {
- "attributes": {
- "operator": ">=",
- "type": "bool"
- },
- "children": [
- {
- "attributes": {
- "operator": "+",
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => uint256)",
- "value": "balances"
- },
- "id": 208,
- "name": "Identifier",
- "src": "702:8:0"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_to"
- },
- "id": 209,
- "name": "Identifier",
- "src": "711:3:0"
- }
- ],
- "id": 210,
- "name": "IndexAccess",
- "src": "702:13:0"
- },
- {
- "attributes": {
- "type": "uint256",
- "value": "_value"
- },
- "id": 211,
- "name": "Identifier",
- "src": "718:6:0"
- }
- ],
- "id": 212,
- "name": "BinaryOperation",
- "src": "702:22:0"
- },
- {
- "attributes": {
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => uint256)",
- "value": "balances"
- },
- "id": 213,
- "name": "Identifier",
- "src": "728:8:0"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_to"
- },
- "id": 214,
- "name": "Identifier",
- "src": "737:3:0"
- }
- ],
- "id": 215,
- "name": "IndexAccess",
- "src": "728:13:0"
- }
- ],
- "id": 216,
- "name": "BinaryOperation",
- "src": "702:39:0"
- }
- ],
- "id": 217,
- "name": "BinaryOperation",
- "src": "633:108:0"
- },
- {
- "children": [
- {
- "children": [
- {
- "attributes": {
- "operator": "+=",
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => uint256)",
- "value": "balances"
- },
- "id": 218,
- "name": "Identifier",
- "src": "757:8:0"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_to"
- },
- "id": 219,
- "name": "Identifier",
- "src": "766:3:0"
- }
- ],
- "id": 220,
- "name": "IndexAccess",
- "src": "757:13:0"
- },
- {
- "attributes": {
- "type": "uint256",
- "value": "_value"
- },
- "id": 221,
- "name": "Identifier",
- "src": "774:6:0"
- }
- ],
- "id": 222,
- "name": "Assignment",
- "src": "757:23:0"
- }
- ],
- "id": 223,
- "name": "ExpressionStatement",
- "src": "757:23:0"
- },
- {
- "children": [
- {
- "attributes": {
- "operator": "-=",
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => uint256)",
- "value": "balances"
- },
- "id": 224,
- "name": "Identifier",
- "src": "794:8:0"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_from"
- },
- "id": 225,
- "name": "Identifier",
- "src": "803:5:0"
- }
- ],
- "id": 226,
- "name": "IndexAccess",
- "src": "794:15:0"
- },
- {
- "attributes": {
- "type": "uint256",
- "value": "_value"
- },
- "id": 227,
- "name": "Identifier",
- "src": "813:6:0"
- }
- ],
- "id": 228,
- "name": "Assignment",
- "src": "794:25:0"
- }
- ],
- "id": 229,
- "name": "ExpressionStatement",
- "src": "794:25:0"
- },
- {
- "children": [
- {
- "attributes": {
- "operator": "-=",
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => uint256)"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => mapping(address => uint256))",
- "value": "allowed"
- },
- "id": 230,
- "name": "Identifier",
- "src": "833:7:0"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_from"
- },
- "id": 231,
- "name": "Identifier",
- "src": "841:5:0"
- }
- ],
- "id": 234,
- "name": "IndexAccess",
- "src": "833:14:0"
- },
- {
- "attributes": {
- "member_name": "sender",
- "type": "address"
- },
- "children": [
- {
- "attributes": {
- "type": "msg",
- "value": "msg"
- },
- "id": 232,
- "name": "Identifier",
- "src": "848:3:0"
- }
- ],
- "id": 233,
- "name": "MemberAccess",
- "src": "848:10:0"
- }
- ],
- "id": 235,
- "name": "IndexAccess",
- "src": "833:26:0"
- },
- {
- "attributes": {
- "type": "uint256",
- "value": "_value"
- },
- "id": 236,
- "name": "Identifier",
- "src": "863:6:0"
- }
- ],
- "id": 237,
- "name": "Assignment",
- "src": "833:36:0"
- }
- ],
- "id": 238,
- "name": "ExpressionStatement",
- "src": "833:36:0"
- },
- {
- "children": [
- {
- "attributes": {
- "type": "tuple()",
- "type_conversion": false
- },
- "children": [
- {
- "attributes": {
- "type": "function (address,address,uint256) constant",
- "value": "Transfer"
- },
- "id": 239,
- "name": "Identifier",
- "src": "883:8:0"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_from"
- },
- "id": 240,
- "name": "Identifier",
- "src": "892:5:0"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_to"
- },
- "id": 241,
- "name": "Identifier",
- "src": "899:3:0"
- },
- {
- "attributes": {
- "type": "uint256",
- "value": "_value"
- },
- "id": 242,
- "name": "Identifier",
- "src": "904:6:0"
- }
- ],
- "id": 243,
- "name": "FunctionCall",
- "src": "883:28:0"
- }
- ],
- "id": 244,
- "name": "ExpressionStatement",
- "src": "883:28:0"
- },
- {
- "children": [
- {
- "attributes": {
- "hexvalue": "74727565",
- "subdenomination": null,
- "token": "true",
- "type": "bool",
- "value": "true"
- },
- "id": 245,
- "name": "Literal",
- "src": "932:4:0"
- }
- ],
- "id": 246,
- "name": "Return",
- "src": "925:11:0"
- }
- ],
- "id": 247,
- "name": "Block",
- "src": "743:204:0"
- },
- {
- "children": [
- {
- "children": [
- {
- "attributes": {
- "hexvalue": "66616c7365",
- "subdenomination": null,
- "token": "false",
- "type": "bool",
- "value": "false"
- },
- "id": 248,
- "name": "Literal",
- "src": "962:5:0"
- }
- ],
- "id": 249,
- "name": "Return",
- "src": "955:12:0"
- }
- ],
- "id": 250,
- "name": "Block",
- "src": "953:17:0"
- }
- ],
- "id": 251,
- "name": "IfStatement",
- "src": "629:341:0"
- }
- ],
- "id": 252,
- "name": "Block",
- "src": "619:357:0"
- }
- ],
- "id": 253,
- "name": "FunctionDefinition",
- "src": "541:435:0"
- },
- {
- "attributes": {
- "constant": true,
- "name": "balanceOf",
- "payable": false,
- "visibility": "public"
- },
- "children": [
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "name": "_owner",
- "storageLocation": "default",
- "type": "address",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "address"
- },
- "id": 254,
- "name": "ElementaryTypeName",
- "src": "1001:7:0"
- }
- ],
- "id": 255,
- "name": "VariableDeclaration",
- "src": "1001:14:0"
- }
- ],
- "id": 256,
- "name": "ParameterList",
- "src": "1000:16:0"
- },
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "name": "",
- "storageLocation": "default",
- "type": "uint256",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "uint"
- },
- "id": 257,
- "name": "ElementaryTypeName",
- "src": "1035:4:0"
- }
- ],
- "id": 258,
- "name": "VariableDeclaration",
- "src": "1035:4:0"
- }
- ],
- "id": 259,
- "name": "ParameterList",
- "src": "1034:6:0"
- },
- {
- "children": [
- {
- "children": [
- {
- "attributes": {
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => uint256)",
- "value": "balances"
- },
- "id": 260,
- "name": "Identifier",
- "src": "1058:8:0"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_owner"
- },
- "id": 261,
- "name": "Identifier",
- "src": "1067:6:0"
- }
- ],
- "id": 262,
- "name": "IndexAccess",
- "src": "1058:16:0"
- }
- ],
- "id": 263,
- "name": "Return",
- "src": "1051:23:0"
- }
- ],
- "id": 264,
- "name": "Block",
- "src": "1041:40:0"
- }
- ],
- "id": 265,
- "name": "FunctionDefinition",
- "src": "982:99:0"
- },
- {
- "attributes": {
- "constant": false,
- "name": "approve",
- "payable": false,
- "visibility": "public"
- },
- "children": [
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "name": "_spender",
- "storageLocation": "default",
- "type": "address",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "address"
- },
- "id": 266,
- "name": "ElementaryTypeName",
- "src": "1104:7:0"
- }
- ],
- "id": 267,
- "name": "VariableDeclaration",
- "src": "1104:16:0"
- },
- {
- "attributes": {
- "constant": false,
- "name": "_value",
- "storageLocation": "default",
- "type": "uint256",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "uint"
- },
- "id": 268,
- "name": "ElementaryTypeName",
- "src": "1122:4:0"
- }
- ],
- "id": 269,
- "name": "VariableDeclaration",
- "src": "1122:11:0"
- }
- ],
- "id": 270,
- "name": "ParameterList",
- "src": "1103:31:0"
- },
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "name": "",
- "storageLocation": "default",
- "type": "bool",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "bool"
- },
- "id": 271,
- "name": "ElementaryTypeName",
- "src": "1144:4:0"
- }
- ],
- "id": 272,
- "name": "VariableDeclaration",
- "src": "1144:4:0"
- }
- ],
- "id": 273,
- "name": "ParameterList",
- "src": "1143:6:0"
- },
- {
- "children": [
- {
- "children": [
- {
- "attributes": {
- "operator": "=",
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => uint256)"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => mapping(address => uint256))",
- "value": "allowed"
- },
- "id": 274,
- "name": "Identifier",
- "src": "1160:7:0"
- },
- {
- "attributes": {
- "member_name": "sender",
- "type": "address"
- },
- "children": [
- {
- "attributes": {
- "type": "msg",
- "value": "msg"
- },
- "id": 275,
- "name": "Identifier",
- "src": "1168:3:0"
- }
- ],
- "id": 276,
- "name": "MemberAccess",
- "src": "1168:10:0"
- }
- ],
- "id": 278,
- "name": "IndexAccess",
- "src": "1160:19:0"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_spender"
- },
- "id": 277,
- "name": "Identifier",
- "src": "1180:8:0"
- }
- ],
- "id": 279,
- "name": "IndexAccess",
- "src": "1160:29:0"
- },
- {
- "attributes": {
- "type": "uint256",
- "value": "_value"
- },
- "id": 280,
- "name": "Identifier",
- "src": "1192:6:0"
- }
- ],
- "id": 281,
- "name": "Assignment",
- "src": "1160:38:0"
- }
- ],
- "id": 282,
- "name": "ExpressionStatement",
- "src": "1160:38:0"
- },
- {
- "children": [
- {
- "attributes": {
- "type": "tuple()",
- "type_conversion": false
- },
- "children": [
- {
- "attributes": {
- "type": "function (address,address,uint256) constant",
- "value": "Approval"
- },
- "id": 283,
- "name": "Identifier",
- "src": "1208:8:0"
- },
- {
- "attributes": {
- "member_name": "sender",
- "type": "address"
- },
- "children": [
- {
- "attributes": {
- "type": "msg",
- "value": "msg"
- },
- "id": 284,
- "name": "Identifier",
- "src": "1217:3:0"
- }
- ],
- "id": 285,
- "name": "MemberAccess",
- "src": "1217:10:0"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_spender"
- },
- "id": 286,
- "name": "Identifier",
- "src": "1229:8:0"
- },
- {
- "attributes": {
- "type": "uint256",
- "value": "_value"
- },
- "id": 287,
- "name": "Identifier",
- "src": "1239:6:0"
- }
- ],
- "id": 288,
- "name": "FunctionCall",
- "src": "1208:38:0"
- }
- ],
- "id": 289,
- "name": "ExpressionStatement",
- "src": "1208:38:0"
- },
- {
- "children": [
- {
- "attributes": {
- "hexvalue": "74727565",
- "subdenomination": null,
- "token": "true",
- "type": "bool",
- "value": "true"
- },
- "id": 290,
- "name": "Literal",
- "src": "1263:4:0"
- }
- ],
- "id": 291,
- "name": "Return",
- "src": "1256:11:0"
- }
- ],
- "id": 292,
- "name": "Block",
- "src": "1150:124:0"
- }
- ],
- "id": 293,
- "name": "FunctionDefinition",
- "src": "1087:187:0"
- },
- {
- "attributes": {
- "constant": true,
- "name": "allowance",
- "payable": false,
- "visibility": "public"
- },
- "children": [
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "name": "_owner",
- "storageLocation": "default",
- "type": "address",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "address"
- },
- "id": 294,
- "name": "ElementaryTypeName",
- "src": "1299:7:0"
- }
- ],
- "id": 295,
- "name": "VariableDeclaration",
- "src": "1299:14:0"
- },
- {
- "attributes": {
- "constant": false,
- "name": "_spender",
- "storageLocation": "default",
- "type": "address",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "address"
- },
- "id": 296,
- "name": "ElementaryTypeName",
- "src": "1315:7:0"
- }
- ],
- "id": 297,
- "name": "VariableDeclaration",
- "src": "1315:16:0"
- }
- ],
- "id": 298,
- "name": "ParameterList",
- "src": "1298:34:0"
- },
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "name": "",
- "storageLocation": "default",
- "type": "uint256",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "uint"
- },
- "id": 299,
- "name": "ElementaryTypeName",
- "src": "1351:4:0"
- }
- ],
- "id": 300,
- "name": "VariableDeclaration",
- "src": "1351:4:0"
- }
- ],
- "id": 301,
- "name": "ParameterList",
- "src": "1350:6:0"
- },
- {
- "children": [
- {
- "children": [
- {
- "attributes": {
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => uint256)"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => mapping(address => uint256))",
- "value": "allowed"
- },
- "id": 302,
- "name": "Identifier",
- "src": "1374:7:0"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_owner"
- },
- "id": 303,
- "name": "Identifier",
- "src": "1382:6:0"
- }
- ],
- "id": 304,
- "name": "IndexAccess",
- "src": "1374:15:0"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_spender"
- },
- "id": 305,
- "name": "Identifier",
- "src": "1390:8:0"
- }
- ],
- "id": 306,
- "name": "IndexAccess",
- "src": "1374:25:0"
- }
- ],
- "id": 307,
- "name": "Return",
- "src": "1367:32:0"
- }
- ],
- "id": 308,
- "name": "Block",
- "src": "1357:49:0"
- }
- ],
- "id": 309,
- "name": "FunctionDefinition",
- "src": "1280:126:0"
- },
- {
- "attributes": {
- "constant": false,
- "name": "balances",
- "storageLocation": "default",
- "type": "mapping(address => uint256)",
- "visibility": "internal"
- },
- "children": [
- {
- "children": [
- {
- "attributes": {
- "name": "address"
- },
- "id": 310,
- "name": "ElementaryTypeName",
- "src": "1421:7:0"
- },
- {
- "attributes": {
- "name": "uint"
- },
- "id": 311,
- "name": "ElementaryTypeName",
- "src": "1432:4:0"
- }
- ],
- "id": 312,
- "name": "Mapping",
- "src": "1412:25:0"
- }
- ],
- "id": 313,
- "name": "VariableDeclaration",
- "src": "1412:34:0"
- },
- {
- "attributes": {
- "constant": false,
- "name": "allowed",
- "storageLocation": "default",
- "type": "mapping(address => mapping(address => uint256))",
- "visibility": "internal"
- },
- "children": [
- {
- "children": [
- {
- "attributes": {
- "name": "address"
- },
- "id": 314,
- "name": "ElementaryTypeName",
- "src": "1461:7:0"
- },
- {
- "children": [
- {
- "attributes": {
- "name": "address"
- },
- "id": 315,
- "name": "ElementaryTypeName",
- "src": "1481:7:0"
- },
- {
- "attributes": {
- "name": "uint"
- },
- "id": 316,
- "name": "ElementaryTypeName",
- "src": "1492:4:0"
- }
- ],
- "id": 317,
- "name": "Mapping",
- "src": "1472:25:0"
- }
- ],
- "id": 318,
- "name": "Mapping",
- "src": "1452:46:0"
- }
- ],
- "id": 319,
- "name": "VariableDeclaration",
- "src": "1452:54:0"
- },
- {
- "attributes": {
- "constant": false,
- "name": "totalSupply",
- "storageLocation": "default",
- "type": "uint256",
- "visibility": "public"
- },
- "children": [
- {
- "attributes": {
- "name": "uint"
- },
- "id": 320,
- "name": "ElementaryTypeName",
- "src": "1512:4:0"
- }
- ],
- "id": 321,
- "name": "VariableDeclaration",
- "src": "1512:23:0"
- }
- ],
- "id": 322,
- "name": "ContractDefinition",
- "src": "86:1452:0"
- }
- ],
- "name": "SourceUnit"
- }
- },
- "1.0.0/Token/Token_v1.sol": {
- "id": 1,
- "legacyAST": {
- "children": [
- {
- "attributes": {
- "literals": [
- "solidity",
- "^",
- "0.4",
- ".11"
- ]
- },
- "id": 324,
- "name": "PragmaDirective",
- "src": "0:24:1"
- },
- {
- "attributes": {
- "fullyImplemented": true,
- "isLibrary": false,
- "linearizedBaseContracts": [
- 397
- ],
- "name": "Token_v1"
- },
- "children": [
- {
- "attributes": {
- "constant": true,
- "name": "totalSupply",
- "payable": false,
- "visibility": "public"
- },
- "children": [
- {
- "children": [],
- "id": 325,
- "name": "ParameterList",
- "src": "110:2:1"
- },
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "name": "supply",
- "storageLocation": "default",
- "type": "uint256",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "uint"
- },
- "id": 326,
- "name": "ElementaryTypeName",
- "src": "131:4:1"
- }
- ],
- "id": 327,
- "name": "VariableDeclaration",
- "src": "131:11:1"
- }
- ],
- "id": 328,
- "name": "ParameterList",
- "src": "130:13:1"
- },
- {
- "children": [],
- "id": 329,
- "name": "Block",
- "src": "144:2:1"
- }
- ],
- "id": 330,
- "name": "FunctionDefinition",
- "src": "90:56:1"
- },
- {
- "attributes": {
- "constant": true,
- "name": "balanceOf",
- "payable": false,
- "visibility": "public"
- },
- "children": [
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "name": "_owner",
- "storageLocation": "default",
- "type": "address",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "address"
- },
- "id": 331,
- "name": "ElementaryTypeName",
- "src": "274:7:1"
- }
- ],
- "id": 332,
- "name": "VariableDeclaration",
- "src": "274:14:1"
- }
- ],
- "id": 333,
- "name": "ParameterList",
- "src": "273:16:1"
- },
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "name": "balance",
- "storageLocation": "default",
- "type": "uint256",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "uint"
- },
- "id": 334,
- "name": "ElementaryTypeName",
- "src": "308:4:1"
- }
- ],
- "id": 335,
- "name": "VariableDeclaration",
- "src": "308:12:1"
- }
- ],
- "id": 336,
- "name": "ParameterList",
- "src": "307:14:1"
- },
- {
- "children": [],
- "id": 337,
- "name": "Block",
- "src": "322:2:1"
- }
- ],
- "id": 338,
- "name": "FunctionDefinition",
- "src": "255:69:1"
- },
- {
- "attributes": {
- "constant": false,
- "name": "transfer",
- "payable": false,
- "visibility": "public"
- },
- "children": [
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "name": "_to",
- "storageLocation": "default",
- "type": "address",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "address"
- },
- "id": 339,
- "name": "ElementaryTypeName",
- "src": "578:7:1"
- }
- ],
- "id": 340,
- "name": "VariableDeclaration",
- "src": "578:11:1"
- },
- {
- "attributes": {
- "constant": false,
- "name": "_value",
- "storageLocation": "default",
- "type": "uint256",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "uint"
- },
- "id": 341,
- "name": "ElementaryTypeName",
- "src": "591:4:1"
- }
- ],
- "id": 342,
- "name": "VariableDeclaration",
- "src": "591:11:1"
- }
- ],
- "id": 343,
- "name": "ParameterList",
- "src": "577:26:1"
- },
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "name": "success",
- "storageLocation": "default",
- "type": "bool",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "bool"
- },
- "id": 344,
- "name": "ElementaryTypeName",
- "src": "613:4:1"
- }
- ],
- "id": 345,
- "name": "VariableDeclaration",
- "src": "613:12:1"
- }
- ],
- "id": 346,
- "name": "ParameterList",
- "src": "612:14:1"
- },
- {
- "children": [],
- "id": 347,
- "name": "Block",
- "src": "627:2:1"
- }
- ],
- "id": 348,
- "name": "FunctionDefinition",
- "src": "560:69:1"
- },
- {
- "attributes": {
- "constant": false,
- "name": "transferFrom",
- "payable": false,
- "visibility": "public"
- },
- "children": [
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "name": "_from",
- "storageLocation": "default",
- "type": "address",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "address"
- },
- "id": 349,
- "name": "ElementaryTypeName",
- "src": "972:7:1"
- }
- ],
- "id": 350,
- "name": "VariableDeclaration",
- "src": "972:13:1"
- },
- {
- "attributes": {
- "constant": false,
- "name": "_to",
- "storageLocation": "default",
- "type": "address",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "address"
- },
- "id": 351,
- "name": "ElementaryTypeName",
- "src": "987:7:1"
- }
- ],
- "id": 352,
- "name": "VariableDeclaration",
- "src": "987:11:1"
- },
- {
- "attributes": {
- "constant": false,
- "name": "_value",
- "storageLocation": "default",
- "type": "uint256",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "uint"
- },
- "id": 353,
- "name": "ElementaryTypeName",
- "src": "1000:4:1"
- }
- ],
- "id": 354,
- "name": "VariableDeclaration",
- "src": "1000:11:1"
- }
- ],
- "id": 355,
- "name": "ParameterList",
- "src": "971:41:1"
- },
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "name": "success",
- "storageLocation": "default",
- "type": "bool",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "bool"
- },
- "id": 356,
- "name": "ElementaryTypeName",
- "src": "1022:4:1"
- }
- ],
- "id": 357,
- "name": "VariableDeclaration",
- "src": "1022:12:1"
- }
- ],
- "id": 358,
- "name": "ParameterList",
- "src": "1021:14:1"
- },
- {
- "children": [],
- "id": 359,
- "name": "Block",
- "src": "1036:2:1"
- }
- ],
- "id": 360,
- "name": "FunctionDefinition",
- "src": "950:88:1"
- },
- {
- "attributes": {
- "constant": false,
- "name": "approve",
- "payable": false,
- "visibility": "public"
- },
- "children": [
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "name": "_spender",
- "storageLocation": "default",
- "type": "address",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "address"
- },
- "id": 361,
- "name": "ElementaryTypeName",
- "src": "1338:7:1"
- }
- ],
- "id": 362,
- "name": "VariableDeclaration",
- "src": "1338:16:1"
- },
- {
- "attributes": {
- "constant": false,
- "name": "_value",
- "storageLocation": "default",
- "type": "uint256",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "uint"
- },
- "id": 363,
- "name": "ElementaryTypeName",
- "src": "1356:4:1"
- }
- ],
- "id": 364,
- "name": "VariableDeclaration",
- "src": "1356:11:1"
- }
- ],
- "id": 365,
- "name": "ParameterList",
- "src": "1337:31:1"
- },
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "name": "success",
- "storageLocation": "default",
- "type": "bool",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "bool"
- },
- "id": 366,
- "name": "ElementaryTypeName",
- "src": "1378:4:1"
- }
- ],
- "id": 367,
- "name": "VariableDeclaration",
- "src": "1378:12:1"
- }
- ],
- "id": 368,
- "name": "ParameterList",
- "src": "1377:14:1"
- },
- {
- "children": [],
- "id": 369,
- "name": "Block",
- "src": "1392:2:1"
- }
- ],
- "id": 370,
- "name": "FunctionDefinition",
- "src": "1321:73:1"
- },
- {
- "attributes": {
- "constant": true,
- "name": "allowance",
- "payable": false,
- "visibility": "public"
- },
- "children": [
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "name": "_owner",
- "storageLocation": "default",
- "type": "address",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "address"
- },
- "id": 371,
- "name": "ElementaryTypeName",
- "src": "1621:7:1"
- }
- ],
- "id": 372,
- "name": "VariableDeclaration",
- "src": "1621:14:1"
- },
- {
- "attributes": {
- "constant": false,
- "name": "_spender",
- "storageLocation": "default",
- "type": "address",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "address"
- },
- "id": 373,
- "name": "ElementaryTypeName",
- "src": "1637:7:1"
- }
- ],
- "id": 374,
- "name": "VariableDeclaration",
- "src": "1637:16:1"
- }
- ],
- "id": 375,
- "name": "ParameterList",
- "src": "1620:34:1"
- },
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "name": "remaining",
- "storageLocation": "default",
- "type": "uint256",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "uint"
- },
- "id": 376,
- "name": "ElementaryTypeName",
- "src": "1673:4:1"
- }
- ],
- "id": 377,
- "name": "VariableDeclaration",
- "src": "1673:14:1"
- }
- ],
- "id": 378,
- "name": "ParameterList",
- "src": "1672:16:1"
- },
- {
- "children": [],
- "id": 379,
- "name": "Block",
- "src": "1689:2:1"
- }
- ],
- "id": 380,
- "name": "FunctionDefinition",
- "src": "1602:89:1"
- },
- {
- "attributes": {
- "name": "Transfer"
- },
- "children": [
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "indexed": true,
- "name": "_from",
- "storageLocation": "default",
- "type": "address",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "address"
- },
- "id": 381,
- "name": "ElementaryTypeName",
- "src": "1712:7:1"
- }
- ],
- "id": 382,
- "name": "VariableDeclaration",
- "src": "1712:21:1"
- },
- {
- "attributes": {
- "constant": false,
- "indexed": true,
- "name": "_to",
- "storageLocation": "default",
- "type": "address",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "address"
- },
- "id": 383,
- "name": "ElementaryTypeName",
- "src": "1735:7:1"
- }
- ],
- "id": 384,
- "name": "VariableDeclaration",
- "src": "1735:19:1"
- },
- {
- "attributes": {
- "constant": false,
- "indexed": false,
- "name": "_value",
- "storageLocation": "default",
- "type": "uint256",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "uint"
- },
- "id": 385,
- "name": "ElementaryTypeName",
- "src": "1756:4:1"
- }
- ],
- "id": 386,
- "name": "VariableDeclaration",
- "src": "1756:11:1"
- }
- ],
- "id": 387,
- "name": "ParameterList",
- "src": "1711:57:1"
- }
- ],
- "id": 388,
- "name": "EventDefinition",
- "src": "1697:72:1"
- },
- {
- "attributes": {
- "name": "Approval"
- },
- "children": [
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "indexed": true,
- "name": "_owner",
- "storageLocation": "default",
- "type": "address",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "address"
- },
- "id": 389,
- "name": "ElementaryTypeName",
- "src": "1789:7:1"
- }
- ],
- "id": 390,
- "name": "VariableDeclaration",
- "src": "1789:22:1"
- },
- {
- "attributes": {
- "constant": false,
- "indexed": true,
- "name": "_spender",
- "storageLocation": "default",
- "type": "address",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "address"
- },
- "id": 391,
- "name": "ElementaryTypeName",
- "src": "1813:7:1"
- }
- ],
- "id": 392,
- "name": "VariableDeclaration",
- "src": "1813:24:1"
- },
- {
- "attributes": {
- "constant": false,
- "indexed": false,
- "name": "_value",
- "storageLocation": "default",
- "type": "uint256",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "uint"
- },
- "id": 393,
- "name": "ElementaryTypeName",
- "src": "1839:4:1"
- }
- ],
- "id": 394,
- "name": "VariableDeclaration",
- "src": "1839:11:1"
- }
- ],
- "id": 395,
- "name": "ParameterList",
- "src": "1788:63:1"
- }
- ],
- "id": 396,
- "name": "EventDefinition",
- "src": "1774:78:1"
- }
- ],
- "id": 397,
- "name": "ContractDefinition",
- "src": "26:1828:1"
- }
- ],
- "name": "SourceUnit"
- }
- },
- "1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol": {
- "id": 2,
- "legacyAST": {
- "children": [
- {
- "attributes": {
- "literals": [
- "solidity",
- "^",
- "0.4",
- ".11"
- ]
- },
- "id": 33,
- "name": "PragmaDirective",
- "src": "580:24:2"
- },
- {
- "attributes": {
- "file": "../ERC20Token/ERC20Token_v1.sol"
- },
- "id": 35,
- "name": "ImportDirective",
- "src": "606:78:2"
- },
- {
- "attributes": {
- "fullyImplemented": true,
- "isLibrary": false,
- "linearizedBaseContracts": [
- 124,
- 322,
- 397
- ],
- "name": "UnlimitedAllowanceToken_v1"
- },
- "children": [
- {
- "children": [
- {
- "attributes": {
- "name": "ERC20Token"
- },
- "id": 36,
- "name": "UserDefinedTypeName",
- "src": "725:10:2"
- }
- ],
- "id": 37,
- "name": "InheritanceSpecifier",
- "src": "725:10:2"
- },
- {
- "attributes": {
- "constant": true,
- "name": "MAX_UINT",
- "storageLocation": "default",
- "type": "uint256",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "uint"
- },
- "id": 38,
- "name": "ElementaryTypeName",
- "src": "743:4:2"
- },
- {
- "attributes": {
- "operator": "-",
- "type": "int_const 115792089237316195423570985008687907853269984665640564039457584007913129639935"
- },
- "children": [
- {
- "attributes": {
- "operator": "**",
- "type": "int_const 115792089237316195423570985008687907853269984665640564039457584007913129639936"
- },
- "children": [
- {
- "attributes": {
- "hexvalue": "32",
- "subdenomination": null,
- "token": null,
- "type": "int_const 2",
- "value": "2"
- },
- "id": 39,
- "name": "Literal",
- "src": "768:1:2"
- },
- {
- "attributes": {
- "hexvalue": "323536",
- "subdenomination": null,
- "token": null,
- "type": "int_const 256",
- "value": "256"
- },
- "id": 40,
- "name": "Literal",
- "src": "771:3:2"
- }
- ],
- "id": 41,
- "name": "BinaryOperation",
- "src": "768:6:2"
- },
- {
- "attributes": {
- "hexvalue": "31",
- "subdenomination": null,
- "token": null,
- "type": "int_const 1",
- "value": "1"
- },
- "id": 42,
- "name": "Literal",
- "src": "777:1:2"
- }
- ],
- "id": 43,
- "name": "BinaryOperation",
- "src": "768:10:2"
- }
- ],
- "id": 44,
- "name": "VariableDeclaration",
- "src": "743:35:2"
- },
- {
- "attributes": {
- "constant": false,
- "name": "transferFrom",
- "payable": false,
- "visibility": "public"
- },
- "children": [
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "name": "_from",
- "storageLocation": "default",
- "type": "address",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "address"
- },
- "id": 45,
- "name": "ElementaryTypeName",
- "src": "1088:7:2"
- }
- ],
- "id": 46,
- "name": "VariableDeclaration",
- "src": "1088:13:2"
- },
- {
- "attributes": {
- "constant": false,
- "name": "_to",
- "storageLocation": "default",
- "type": "address",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "address"
- },
- "id": 47,
- "name": "ElementaryTypeName",
- "src": "1103:7:2"
- }
- ],
- "id": 48,
- "name": "VariableDeclaration",
- "src": "1103:11:2"
- },
- {
- "attributes": {
- "constant": false,
- "name": "_value",
- "storageLocation": "default",
- "type": "uint256",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "uint"
- },
- "id": 49,
- "name": "ElementaryTypeName",
- "src": "1116:4:2"
- }
- ],
- "id": 50,
- "name": "VariableDeclaration",
- "src": "1116:11:2"
- }
- ],
- "id": 51,
- "name": "ParameterList",
- "src": "1087:41:2"
- },
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "name": "",
- "storageLocation": "default",
- "type": "bool",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "bool"
- },
- "id": 52,
- "name": "ElementaryTypeName",
- "src": "1161:4:2"
- }
- ],
- "id": 53,
- "name": "VariableDeclaration",
- "src": "1161:4:2"
- }
- ],
- "id": 54,
- "name": "ParameterList",
- "src": "1160:6:2"
- },
- {
- "children": [
- {
- "children": [
- {
- "attributes": {
- "constant": false,
- "name": "allowance",
- "storageLocation": "default",
- "type": "uint256",
- "visibility": "internal"
- },
- "children": [
- {
- "attributes": {
- "name": "uint"
- },
- "id": 55,
- "name": "ElementaryTypeName",
- "src": "1181:4:2"
- }
- ],
- "id": 56,
- "name": "VariableDeclaration",
- "src": "1181:14:2"
- },
- {
- "attributes": {
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => uint256)"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => mapping(address => uint256))",
- "value": "allowed"
- },
- "id": 57,
- "name": "Identifier",
- "src": "1198:7:2"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_from"
- },
- "id": 58,
- "name": "Identifier",
- "src": "1206:5:2"
- }
- ],
- "id": 59,
- "name": "IndexAccess",
- "src": "1198:14:2"
- },
- {
- "attributes": {
- "member_name": "sender",
- "type": "address"
- },
- "children": [
- {
- "attributes": {
- "type": "msg",
- "value": "msg"
- },
- "id": 60,
- "name": "Identifier",
- "src": "1213:3:2"
- }
- ],
- "id": 61,
- "name": "MemberAccess",
- "src": "1213:10:2"
- }
- ],
- "id": 62,
- "name": "IndexAccess",
- "src": "1198:26:2"
- }
- ],
- "id": 63,
- "name": "VariableDeclarationStatement",
- "src": "1181:43:2"
- },
- {
- "children": [
- {
- "attributes": {
- "operator": "&&",
- "type": "bool"
- },
- "children": [
- {
- "attributes": {
- "operator": "&&",
- "type": "bool"
- },
- "children": [
- {
- "attributes": {
- "operator": ">=",
- "type": "bool"
- },
- "children": [
- {
- "attributes": {
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => uint256)",
- "value": "balances"
- },
- "id": 64,
- "name": "Identifier",
- "src": "1238:8:2"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_from"
- },
- "id": 65,
- "name": "Identifier",
- "src": "1247:5:2"
- }
- ],
- "id": 66,
- "name": "IndexAccess",
- "src": "1238:15:2"
- },
- {
- "attributes": {
- "type": "uint256",
- "value": "_value"
- },
- "id": 67,
- "name": "Identifier",
- "src": "1257:6:2"
- }
- ],
- "id": 68,
- "name": "BinaryOperation",
- "src": "1238:25:2"
- },
- {
- "attributes": {
- "operator": ">=",
- "type": "bool"
- },
- "children": [
- {
- "attributes": {
- "type": "uint256",
- "value": "allowance"
- },
- "id": 69,
- "name": "Identifier",
- "src": "1279:9:2"
- },
- {
- "attributes": {
- "type": "uint256",
- "value": "_value"
- },
- "id": 70,
- "name": "Identifier",
- "src": "1292:6:2"
- }
- ],
- "id": 71,
- "name": "BinaryOperation",
- "src": "1279:19:2"
- }
- ],
- "id": 72,
- "name": "BinaryOperation",
- "src": "1238:60:2"
- },
- {
- "attributes": {
- "operator": ">=",
- "type": "bool"
- },
- "children": [
- {
- "attributes": {
- "operator": "+",
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => uint256)",
- "value": "balances"
- },
- "id": 73,
- "name": "Identifier",
- "src": "1314:8:2"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_to"
- },
- "id": 74,
- "name": "Identifier",
- "src": "1323:3:2"
- }
- ],
- "id": 75,
- "name": "IndexAccess",
- "src": "1314:13:2"
- },
- {
- "attributes": {
- "type": "uint256",
- "value": "_value"
- },
- "id": 76,
- "name": "Identifier",
- "src": "1330:6:2"
- }
- ],
- "id": 77,
- "name": "BinaryOperation",
- "src": "1314:22:2"
- },
- {
- "attributes": {
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => uint256)",
- "value": "balances"
- },
- "id": 78,
- "name": "Identifier",
- "src": "1340:8:2"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_to"
- },
- "id": 79,
- "name": "Identifier",
- "src": "1349:3:2"
- }
- ],
- "id": 80,
- "name": "IndexAccess",
- "src": "1340:13:2"
- }
- ],
- "id": 81,
- "name": "BinaryOperation",
- "src": "1314:39:2"
- }
- ],
- "id": 82,
- "name": "BinaryOperation",
- "src": "1238:115:2"
- },
- {
- "children": [
- {
- "children": [
- {
- "attributes": {
- "operator": "+=",
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => uint256)",
- "value": "balances"
- },
- "id": 83,
- "name": "Identifier",
- "src": "1378:8:2"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_to"
- },
- "id": 84,
- "name": "Identifier",
- "src": "1387:3:2"
- }
- ],
- "id": 85,
- "name": "IndexAccess",
- "src": "1378:13:2"
- },
- {
- "attributes": {
- "type": "uint256",
- "value": "_value"
- },
- "id": 86,
- "name": "Identifier",
- "src": "1395:6:2"
- }
- ],
- "id": 87,
- "name": "Assignment",
- "src": "1378:23:2"
- }
- ],
- "id": 88,
- "name": "ExpressionStatement",
- "src": "1378:23:2"
- },
- {
- "children": [
- {
- "attributes": {
- "operator": "-=",
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => uint256)",
- "value": "balances"
- },
- "id": 89,
- "name": "Identifier",
- "src": "1415:8:2"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_from"
- },
- "id": 90,
- "name": "Identifier",
- "src": "1424:5:2"
- }
- ],
- "id": 91,
- "name": "IndexAccess",
- "src": "1415:15:2"
- },
- {
- "attributes": {
- "type": "uint256",
- "value": "_value"
- },
- "id": 92,
- "name": "Identifier",
- "src": "1434:6:2"
- }
- ],
- "id": 93,
- "name": "Assignment",
- "src": "1415:25:2"
- }
- ],
- "id": 94,
- "name": "ExpressionStatement",
- "src": "1415:25:2"
- },
- {
- "children": [
- {
- "attributes": {
- "operator": "<",
- "type": "bool"
- },
- "children": [
- {
- "attributes": {
- "type": "uint256",
- "value": "allowance"
- },
- "id": 95,
- "name": "Identifier",
- "src": "1458:9:2"
- },
- {
- "attributes": {
- "type": "uint256",
- "value": "MAX_UINT"
- },
- "id": 96,
- "name": "Identifier",
- "src": "1470:8:2"
- }
- ],
- "id": 97,
- "name": "BinaryOperation",
- "src": "1458:20:2"
- },
- {
- "children": [
- {
- "children": [
- {
- "attributes": {
- "operator": "-=",
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => uint256)"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => mapping(address => uint256))",
- "value": "allowed"
- },
- "id": 98,
- "name": "Identifier",
- "src": "1498:7:2"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_from"
- },
- "id": 99,
- "name": "Identifier",
- "src": "1506:5:2"
- }
- ],
- "id": 102,
- "name": "IndexAccess",
- "src": "1498:14:2"
- },
- {
- "attributes": {
- "member_name": "sender",
- "type": "address"
- },
- "children": [
- {
- "attributes": {
- "type": "msg",
- "value": "msg"
- },
- "id": 100,
- "name": "Identifier",
- "src": "1513:3:2"
- }
- ],
- "id": 101,
- "name": "MemberAccess",
- "src": "1513:10:2"
- }
- ],
- "id": 103,
- "name": "IndexAccess",
- "src": "1498:26:2"
- },
- {
- "attributes": {
- "type": "uint256",
- "value": "_value"
- },
- "id": 104,
- "name": "Identifier",
- "src": "1528:6:2"
- }
- ],
- "id": 105,
- "name": "Assignment",
- "src": "1498:36:2"
- }
- ],
- "id": 106,
- "name": "ExpressionStatement",
- "src": "1498:36:2"
- }
- ],
- "id": 107,
- "name": "Block",
- "src": "1480:69:2"
- }
- ],
- "id": 108,
- "name": "IfStatement",
- "src": "1454:95:2"
- },
- {
- "children": [
- {
- "attributes": {
- "type": "tuple()",
- "type_conversion": false
- },
- "children": [
- {
- "attributes": {
- "type": "function (address,address,uint256) constant",
- "value": "Transfer"
- },
- "id": 109,
- "name": "Identifier",
- "src": "1562:8:2"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_from"
- },
- "id": 110,
- "name": "Identifier",
- "src": "1571:5:2"
- },
- {
- "attributes": {
- "type": "address",
- "value": "_to"
- },
- "id": 111,
- "name": "Identifier",
- "src": "1578:3:2"
- },
- {
- "attributes": {
- "type": "uint256",
- "value": "_value"
- },
- "id": 112,
- "name": "Identifier",
- "src": "1583:6:2"
- }
- ],
- "id": 113,
- "name": "FunctionCall",
- "src": "1562:28:2"
- }
- ],
- "id": 114,
- "name": "ExpressionStatement",
- "src": "1562:28:2"
- },
- {
- "children": [
- {
- "attributes": {
- "hexvalue": "74727565",
- "subdenomination": null,
- "token": "true",
- "type": "bool",
- "value": "true"
- },
- "id": 115,
- "name": "Literal",
- "src": "1611:4:2"
- }
- ],
- "id": 116,
- "name": "Return",
- "src": "1604:11:2"
- }
- ],
- "id": 117,
- "name": "Block",
- "src": "1364:262:2"
- },
- {
- "children": [
- {
- "children": [
- {
- "attributes": {
- "hexvalue": "66616c7365",
- "subdenomination": null,
- "token": "false",
- "type": "bool",
- "value": "false"
- },
- "id": 118,
- "name": "Literal",
- "src": "1653:5:2"
- }
- ],
- "id": 119,
- "name": "Return",
- "src": "1646:12:2"
- }
- ],
- "id": 120,
- "name": "Block",
- "src": "1632:37:2"
- }
- ],
- "id": 121,
- "name": "IfStatement",
- "src": "1234:435:2"
- }
- ],
- "id": 122,
- "name": "Block",
- "src": "1171:504:2"
- }
- ],
- "id": 123,
- "name": "FunctionDefinition",
- "src": "1066:609:2"
- }
- ],
- "id": 124,
- "name": "ContractDefinition",
- "src": "686:991:2"
- }
- ],
- "name": "SourceUnit"
- }
- },
- "2.0.0/tokens/ZRXToken/ZRXToken.sol": {
- "id": 3,
- "legacyAST": {
- "children": [
- {
- "attributes": {
- "literals": [
- "solidity",
- "0.4",
- ".11"
- ]
- },
- "id": 1,
- "name": "PragmaDirective",
- "src": "580:23:3"
- },
- {
- "attributes": {
- "file": "../../../1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol"
- },
- "id": 3,
- "name": "ImportDirective",
- "src": "650:142:3"
- },
- {
- "attributes": {
- "fullyImplemented": true,
- "isLibrary": false,
- "linearizedBaseContracts": [
- 31,
- 124,
- 322,
- 397
- ],
- "name": "ZRXToken"
- },
- "children": [
- {
- "children": [
- {
- "attributes": {
- "name": "UnlimitedAllowanceToken"
- },
- "id": 4,
- "name": "UserDefinedTypeName",
- "src": "821:23:3"
- }
- ],
- "id": 5,
- "name": "InheritanceSpecifier",
- "src": "821:23:3"
- },
- {
- "attributes": {
- "constant": true,
- "name": "decimals",
- "storageLocation": "default",
- "type": "uint8",
- "visibility": "public"
- },
- "children": [
- {
- "attributes": {
- "name": "uint8"
- },
- "id": 6,
- "name": "ElementaryTypeName",
- "src": "896:5:3"
- },
- {
- "attributes": {
- "hexvalue": "3138",
- "subdenomination": null,
- "token": null,
- "type": "int_const 18",
- "value": "18"
- },
- "id": 7,
- "name": "Literal",
- "src": "929:2:3"
- }
- ],
- "id": 8,
- "name": "VariableDeclaration",
- "src": "896:35:3"
- },
- {
- "attributes": {
- "constant": false,
- "name": "totalSupply",
- "storageLocation": "default",
- "type": "uint256",
- "visibility": "public"
- },
- "children": [
- {
- "attributes": {
- "name": "uint256"
- },
- "id": 9,
- "name": "ElementaryTypeName",
- "src": "937:7:3"
- },
- {
- "attributes": {
- "operator": "**",
- "type": "int_const 1000000000000000000000000000"
- },
- "children": [
- {
- "attributes": {
- "hexvalue": "3130",
- "subdenomination": null,
- "token": null,
- "type": "int_const 10",
- "value": "10"
- },
- "id": 10,
- "name": "Literal",
- "src": "966:2:3"
- },
- {
- "attributes": {
- "hexvalue": "3237",
- "subdenomination": null,
- "token": null,
- "type": "int_const 27",
- "value": "27"
- },
- "id": 11,
- "name": "Literal",
- "src": "970:2:3"
- }
- ],
- "id": 12,
- "name": "BinaryOperation",
- "src": "966:6:3"
- }
- ],
- "id": 13,
- "name": "VariableDeclaration",
- "src": "937:35:3"
- },
- {
- "attributes": {
- "constant": true,
- "name": "name",
- "storageLocation": "default",
- "type": "string memory",
- "visibility": "public"
- },
- "children": [
- {
- "attributes": {
- "name": "string"
- },
- "id": 14,
- "name": "ElementaryTypeName",
- "src": "1017:6:3"
- },
- {
- "attributes": {
- "hexvalue": "30782050726f746f636f6c20546f6b656e",
- "subdenomination": null,
- "token": null,
- "type": "literal_string \"0x Protocol Token\"",
- "value": "0x Protocol Token"
- },
- "id": 15,
- "name": "Literal",
- "src": "1047:19:3"
- }
- ],
- "id": 16,
- "name": "VariableDeclaration",
- "src": "1017:49:3"
- },
- {
- "attributes": {
- "constant": true,
- "name": "symbol",
- "storageLocation": "default",
- "type": "string memory",
- "visibility": "public"
- },
- "children": [
- {
- "attributes": {
- "name": "string"
- },
- "id": 17,
- "name": "ElementaryTypeName",
- "src": "1072:6:3"
- },
- {
- "attributes": {
- "hexvalue": "5a5258",
- "subdenomination": null,
- "token": null,
- "type": "literal_string \"ZRX\"",
- "value": "ZRX"
- },
- "id": 18,
- "name": "Literal",
- "src": "1104:5:3"
- }
- ],
- "id": 19,
- "name": "VariableDeclaration",
- "src": "1072:37:3"
- },
- {
- "attributes": {
- "constant": false,
- "name": "ZRXToken",
- "payable": false,
- "visibility": "public"
- },
- "children": [
- {
- "children": [],
- "id": 20,
- "name": "ParameterList",
- "src": "1175:2:3"
- },
- {
- "children": [],
- "id": 21,
- "name": "ParameterList",
- "src": "1197:0:3"
- },
- {
- "children": [
- {
- "children": [
- {
- "attributes": {
- "operator": "=",
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "uint256"
- },
- "children": [
- {
- "attributes": {
- "type": "mapping(address => uint256)",
- "value": "balances"
- },
- "id": 22,
- "name": "Identifier",
- "src": "1207:8:3"
- },
- {
- "attributes": {
- "member_name": "sender",
- "type": "address"
- },
- "children": [
- {
- "attributes": {
- "type": "msg",
- "value": "msg"
- },
- "id": 23,
- "name": "Identifier",
- "src": "1216:3:3"
- }
- ],
- "id": 24,
- "name": "MemberAccess",
- "src": "1216:10:3"
- }
- ],
- "id": 25,
- "name": "IndexAccess",
- "src": "1207:20:3"
- },
- {
- "attributes": {
- "type": "uint256",
- "value": "totalSupply"
- },
- "id": 26,
- "name": "Identifier",
- "src": "1230:11:3"
- }
- ],
- "id": 27,
- "name": "Assignment",
- "src": "1207:34:3"
- }
- ],
- "id": 28,
- "name": "ExpressionStatement",
- "src": "1207:34:3"
- }
- ],
- "id": 29,
- "name": "Block",
- "src": "1197:51:3"
- }
- ],
- "id": 30,
- "name": "FunctionDefinition",
- "src": "1158:90:3"
- }
- ],
- "id": 31,
- "name": "ContractDefinition",
- "src": "795:455:3"
- }
- ],
- "name": "SourceUnit"
- }
- }
- },
- "sourceCodes": {
- "1.0.0/ERC20Token/ERC20Token_v1.sol": "pragma solidity ^0.4.11;\n\nimport { Token_v1 as Token } from \"../Token/Token_v1.sol\";\n\ncontract ERC20Token_v1 is Token {\n\n function transfer(address _to, uint _value) returns (bool) {\n //Default assumes totalSupply can't be over max (2^256 - 1).\n if (balances[msg.sender] >= _value && balances[_to] + _value >= balances[_to]) {\n balances[msg.sender] -= _value;\n balances[_to] += _value;\n Transfer(msg.sender, _to, _value);\n return true;\n } else { return false; }\n }\n\n function transferFrom(address _from, address _to, uint _value) returns (bool) {\n if (balances[_from] >= _value && allowed[_from][msg.sender] >= _value && balances[_to] + _value >= balances[_to]) {\n balances[_to] += _value;\n balances[_from] -= _value;\n allowed[_from][msg.sender] -= _value;\n Transfer(_from, _to, _value);\n return true;\n } else { return false; }\n }\n\n function balanceOf(address _owner) constant returns (uint) {\n return balances[_owner];\n }\n\n function approve(address _spender, uint _value) returns (bool) {\n allowed[msg.sender][_spender] = _value;\n Approval(msg.sender, _spender, _value);\n return true;\n }\n\n function allowance(address _owner, address _spender) constant returns (uint) {\n return allowed[_owner][_spender];\n }\n\n mapping (address => uint) balances;\n mapping (address => mapping (address => uint)) allowed;\n uint public totalSupply;\n}\n",
- "1.0.0/Token/Token_v1.sol": "pragma solidity ^0.4.11;\n\ncontract Token_v1 {\n\n /// @return total amount of tokens\n function totalSupply() constant returns (uint supply) {}\n\n /// @param _owner The address from which the balance will be retrieved\n /// @return The balance\n function balanceOf(address _owner) constant returns (uint balance) {}\n\n /// @notice send `_value` token to `_to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return Whether the transfer was successful or not\n function transfer(address _to, uint _value) returns (bool success) {}\n\n /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return Whether the transfer was successful or not\n function transferFrom(address _from, address _to, uint _value) returns (bool success) {}\n\n /// @notice `msg.sender` approves `_addr` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Whether the approval was successful or not\n function approve(address _spender, uint _value) returns (bool success) {}\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender) constant returns (uint remaining) {}\n\n event Transfer(address indexed _from, address indexed _to, uint _value);\n event Approval(address indexed _owner, address indexed _spender, uint _value);\n}\n\n",
- "1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.4.11;\n\nimport { ERC20Token_v1 as ERC20Token } from \"../ERC20Token/ERC20Token_v1.sol\";\n\ncontract UnlimitedAllowanceToken_v1 is ERC20Token {\n\n uint constant MAX_UINT = 2**256 - 1;\n\n /// @dev ERC20 transferFrom, modified such that an allowance of MAX_UINT represents an unlimited allowance.\n /// @param _from Address to transfer from.\n /// @param _to Address to transfer to.\n /// @param _value Amount to transfer.\n /// @return Success of transfer.\n function transferFrom(address _from, address _to, uint _value)\n public\n returns (bool)\n {\n uint allowance = allowed[_from][msg.sender];\n if (balances[_from] >= _value\n && allowance >= _value\n && balances[_to] + _value >= balances[_to]\n ) {\n balances[_to] += _value;\n balances[_from] -= _value;\n if (allowance < MAX_UINT) {\n allowed[_from][msg.sender] -= _value;\n }\n Transfer(_from, _to, _value);\n return true;\n } else {\n return false;\n }\n }\n}\n",
- "2.0.0/tokens/ZRXToken/ZRXToken.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity 0.4.11;\n\n// solhint-disable-next-line max-line-length\nimport { UnlimitedAllowanceToken_v1 as UnlimitedAllowanceToken } from \"../../../1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol\";\n\n\ncontract ZRXToken is \n UnlimitedAllowanceToken\n{\n\n // solhint-disable const-name-snakecase\n uint8 constant public decimals = 18;\n uint256 public totalSupply = 10**27; // 1 billion tokens, 18 decimal places\n string constant public name = \"0x Protocol Token\";\n string constant public symbol = \"ZRX\";\n // solhint-enableconst-name-snakecase\n\n function ZRXToken()\n public\n {\n balances[msg.sender] = totalSupply;\n }\n}\n"
- },
- "sourceTreeHashHex": "0xe3fb14114a377d3b5f004168d4f43cb29ab930b3277425645bdbd609bf974317",
- "compiler": {
- "name": "solc",
- "version": "soljson-v0.4.11+commit.68ef5810.js",
- "settings": {
- "optimizer": {
- "enabled": true,
- "runs": 1000000
- },
- "outputSelection": {
- "*": {
- "*": [
- "abi",
- "evm.bytecode.object",
- "evm.bytecode.sourceMap",
- "evm.deployedBytecode.object",
- "evm.deployedBytecode.sourceMap"
- ]
- }
- }
- }
- },
- "networks": {
- "1": {
- "address": "0xe41d2489571d322189246dafa5ebde1f4699f498",
- "links": {},
- "constructorArgs": "[]"
- },
- "3": {
- "address": "0xff67881f8d12f372d91baae9752eb3631ff0ed00",
- "links": {},
- "constructorArgs": "[\"0x Protocol Token\",\"ZRX\",\"18\",\"1000000000000000000000000000\"]"
- },
- "42": {
- "address": "0x2002d3812f58e35f0ea1ffbf80a75a38c32175fa",
- "links": {},
- "constructorArgs": "[\"0x Protocol Token\",\"ZRX\",\"18\",\"1000000000000000000000000000\"]"
- },
- "50": {
- "address": "0x871dd7c2b4b25e1aa18728e9d5f2af4c4e431f5c",
- "links": {},
- "constructorArgs": "[]"
- }
- }
-}
diff --git a/packages/migrations/compiler.json b/packages/migrations/compiler.json
deleted file mode 100644
index 493a73d46..000000000
--- a/packages/migrations/compiler.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "contractsDir": "../contracts/src/",
- "compilerSettings": {
- "optimizer": {
- "enabled": true,
- "runs": 1000000
- },
- "outputSelection": {
- "*": {
- "*": [
- "abi",
- "evm.bytecode.object",
- "evm.bytecode.sourceMap",
- "evm.deployedBytecode.object",
- "evm.deployedBytecode.sourceMap"
- ]
- }
- }
- }
-}
diff --git a/packages/migrations/package.json b/packages/migrations/package.json
index 2d1b7bfc2..d8c5fb6c2 100644
--- a/packages/migrations/package.json
+++ b/packages/migrations/package.json
@@ -1,6 +1,6 @@
{
- "name": "@0xproject/migrations",
- "version": "1.0.14",
+ "name": "@0x/migrations",
+ "version": "2.0.1",
"engines": {
"node": ">=6.12"
},
@@ -8,35 +8,19 @@
"main": "lib/index.js",
"types": "lib/index.d.ts",
"scripts": {
- "build": "yarn pre_build && tsc -b",
+ "build": "tsc -b",
"build:ci": "yarn build",
- "pre_build": "run-s copy_artifacts generate_contract_wrappers",
- "copy_artifacts": "copyfiles 'artifacts/**/*' ./lib",
- "clean": "shx rm -rf lib src/1.0.0/contract_wrappers src/2.0.0-testnet/contract_wrappers src/2.0.0/contract_wrappers artifacts/development",
- "lint": "tslint --project . --exclude **/src/v2/contract_wrappers/**/* --exclude **/src/v1/contract_wrappers/**/*",
- "migrate:v1": "run-s build compile:v1 script:migrate:v1",
+ "clean": "shx rm -rf lib",
+ "lint": "tslint --format stylish --project .",
"migrate:v2": "run-s build script:migrate:v2",
- "script:migrate:v1": "node ./lib/migrate.js --contracts-version 1.0.0",
- "script:migrate:v2": "node ./lib/migrate.js --contracts-version 2.0.0",
- "generate_contract_wrappers": "run-p generate_contract_wrappers:*",
- "generate_contract_wrappers:v1": "abi-gen --abis ${npm_package_config_abis_v1} --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/1.0.0/contract_wrappers --backend ethers",
- "generate_contract_wrappers:v2": "abi-gen --abis ${npm_package_config_abis_v2} --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/2.0.0/contract_wrappers --backend ethers",
- "compile:v1": "sol-compiler --artifacts-dir artifacts/1.0.0 --contracts Exchange_v1,DummyERC20Token,ZRXToken,WETH9,TokenTransferProxy_v1,MultiSigWallet,MultiSigWalletWithTimeLock,MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress,TokenRegistry"
- },
- "config": {
- "abis": {
- "v1": "artifacts/1.0.0/@(DummyERC20Token|TokenTransferProxy_v1|Exchange_v1|TokenRegistry|MultiSigWallet|MultiSigWalletWithTimeLock|MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress|TokenRegistry|ZRXToken|WETH9).json",
- "v2": "artifacts/2.0.0/@(ERC20Token|DummyERC20Token|ERC721Token|DummyERC721Token|ERC20Proxy|ERC721Proxy|Exchange|Forwarder|AssetProxyOwner|ZRXToken|WETH9|IWallet|IValidator|OrderValidator).json"
- }
+ "script:migrate:v2": "node ./lib/migrate.js --contracts-version 2.0.0"
},
"license": "Apache-2.0",
"devDependencies": {
- "@0xproject/abi-gen": "^1.0.13",
- "@0xproject/dev-utils": "^1.0.12",
- "@0xproject/tslint-config": "^1.0.8",
- "@0xproject/types": "^1.1.4",
+ "@0x/dev-utils": "^1.0.14",
+ "@0x/tslint-config": "^1.0.10",
+ "@0x/types": "^1.2.1",
"@types/yargs": "^10.0.0",
- "copyfiles": "^2.0.0",
"make-promises-safe": "^1.1.0",
"npm-run-all": "^4.1.2",
"shx": "^0.2.2",
@@ -45,15 +29,18 @@
"yargs": "^10.0.3"
},
"dependencies": {
- "@0xproject/base-contract": "^3.0.1",
- "@0xproject/order-utils": "^1.0.7",
- "@0xproject/sol-compiler": "^1.1.7",
- "@0xproject/subproviders": "^2.0.7",
- "@0xproject/typescript-typings": "^3.0.2",
- "@0xproject/utils": "^2.0.2",
- "@0xproject/web3-wrapper": "^3.0.3",
+ "@0x/abi-gen-wrappers": "^1.0.2",
+ "@0x/base-contract": "^3.0.3",
+ "@0x/contract-addresses": "^1.1.0",
+ "@0x/contract-artifacts": "^1.1.0",
+ "@0x/order-utils": "^2.0.1",
+ "@0x/sol-compiler": "^1.1.9",
+ "@0x/subproviders": "^2.1.1",
+ "@0x/typescript-typings": "^3.0.4",
+ "@0x/utils": "^2.0.4",
+ "@0x/web3-wrapper": "^3.1.1",
"@ledgerhq/hw-app-eth": "^4.3.0",
- "ethereum-types": "^1.0.11",
+ "ethereum-types": "^1.1.2",
"ethers": "~4.0.4",
"lodash": "^4.17.5"
},
diff --git a/packages/migrations/src/1.0.0/artifacts.ts b/packages/migrations/src/1.0.0/artifacts.ts
deleted file mode 100644
index f5226e174..000000000
--- a/packages/migrations/src/1.0.0/artifacts.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import { ContractArtifact } from 'ethereum-types';
-
-import * as DummyERC20Token from '../../artifacts/1.0.0/DummyERC20Token.json';
-import * as Exchange from '../../artifacts/1.0.0/Exchange_v1.json';
-import * as MultiSigWalletWithTimeLock from '../../artifacts/1.0.0/MultiSigWalletWithTimeLock.json';
-import * as MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress from '../../artifacts/1.0.0/MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress.json';
-import * as TokenRegistry from '../../artifacts/1.0.0/TokenRegistry.json';
-import * as TokenTransferProxy from '../../artifacts/1.0.0/TokenTransferProxy_v1.json';
-import * as EtherToken from '../../artifacts/1.0.0/WETH9.json';
-import * as ZRX from '../../artifacts/1.0.0/ZRXToken.json';
-
-export const artifacts = {
- ZRX: (ZRX as any) as ContractArtifact,
- DummyERC20Token: (DummyERC20Token as any) as ContractArtifact,
- Exchange: (Exchange as any) as ContractArtifact,
- EtherToken: (EtherToken as any) as ContractArtifact,
- TokenRegistry: (TokenRegistry as any) as ContractArtifact,
- TokenTransferProxy: (TokenTransferProxy as any) as ContractArtifact,
- MultiSigWalletWithTimeLock: (MultiSigWalletWithTimeLock as any) as ContractArtifact,
- MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress: (MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress as any) as ContractArtifact,
-};
diff --git a/packages/migrations/src/1.0.0/migration.ts b/packages/migrations/src/1.0.0/migration.ts
deleted file mode 100644
index 0a3c25ae1..000000000
--- a/packages/migrations/src/1.0.0/migration.ts
+++ /dev/null
@@ -1,142 +0,0 @@
-import { BigNumber, NULL_BYTES } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
-import { Provider, TxData } from 'ethereum-types';
-
-import { ArtifactWriter } from '../utils/artifact_writer';
-import { erc20TokenInfo } from '../utils/token_info';
-
-import { artifacts } from './artifacts';
-import { DummyERC20TokenContract } from './contract_wrappers/dummy_erc20_token';
-import { Exchange_v1Contract } from './contract_wrappers/exchange_v1';
-import { MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddressContract } from './contract_wrappers/multi_sig_wallet_with_time_lock_except_remove_authorized_address';
-import { TokenRegistryContract } from './contract_wrappers/token_registry';
-import { TokenTransferProxy_v1Contract } from './contract_wrappers/tokentransferproxy_v1';
-import { WETH9Contract } from './contract_wrappers/weth9';
-import { ZRXTokenContract } from './contract_wrappers/zrx_token';
-
-/**
- * Custom migrations should be defined in this function. This will be called with the CLI 'migrate:v1' command.
- * Migrations could be written to run in parallel, but if you want contract addresses to be created deterministically,
- * the migration should be written to run synchronously.
- * @param provider Web3 provider instance.
- * @param artifactsDir The directory with compiler artifact files.
- * @param txDefaults Default transaction values to use when deploying contracts.
- */
-export const runV1MigrationsAsync = async (provider: Provider, artifactsDir: string, txDefaults: Partial<TxData>) => {
- const web3Wrapper = new Web3Wrapper(provider);
- const networkId = await web3Wrapper.getNetworkIdAsync();
- const artifactsWriter = new ArtifactWriter(artifactsDir, networkId);
- const tokenTransferProxy = await TokenTransferProxy_v1Contract.deployFrom0xArtifactAsync(
- artifacts.TokenTransferProxy,
- provider,
- txDefaults,
- );
- artifactsWriter.saveArtifact(tokenTransferProxy);
- const zrxToken = await ZRXTokenContract.deployFrom0xArtifactAsync(artifacts.ZRX, provider, txDefaults);
- artifactsWriter.saveArtifact(zrxToken);
-
- const etherToken = await WETH9Contract.deployFrom0xArtifactAsync(artifacts.EtherToken, provider, txDefaults);
- artifactsWriter.saveArtifact(etherToken);
- const tokenReg = await TokenRegistryContract.deployFrom0xArtifactAsync(
- artifacts.TokenRegistry,
- provider,
- txDefaults,
- );
- artifactsWriter.saveArtifact(tokenReg);
-
- const accounts: string[] = await web3Wrapper.getAvailableAddressesAsync();
- const owners = [accounts[0], accounts[1]];
- const confirmationsRequired = new BigNumber(2);
- const secondsRequired = new BigNumber(0);
- const exchange = await Exchange_v1Contract.deployFrom0xArtifactAsync(
- artifacts.Exchange,
- provider,
- txDefaults,
- zrxToken.address,
- tokenTransferProxy.address,
- );
- artifactsWriter.saveArtifact(exchange);
- const multiSig = await MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddressContract.deployFrom0xArtifactAsync(
- artifacts.MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress,
- provider,
- txDefaults,
- owners,
- confirmationsRequired,
- secondsRequired,
- tokenTransferProxy.address,
- );
- artifactsWriter.saveArtifact(multiSig);
-
- const owner = accounts[0];
-
- await web3Wrapper.awaitTransactionSuccessAsync(
- await tokenTransferProxy.addAuthorizedAddress.sendTransactionAsync(exchange.address, { from: owner }),
- );
- await web3Wrapper.awaitTransactionSuccessAsync(
- await tokenTransferProxy.transferOwnership.sendTransactionAsync(multiSig.address, { from: owner }),
- );
- const addTokenGasEstimate = await tokenReg.addToken.estimateGasAsync(
- zrxToken.address,
- erc20TokenInfo[0].name,
- erc20TokenInfo[0].symbol,
- erc20TokenInfo[0].decimals,
- erc20TokenInfo[0].ipfsHash,
- erc20TokenInfo[0].swarmHash,
- { from: owner },
- );
- const decimals = 18;
- await web3Wrapper.awaitTransactionSuccessAsync(
- await tokenReg.addToken.sendTransactionAsync(
- zrxToken.address,
- '0x Protocol Token',
- 'ZRX',
- decimals,
- NULL_BYTES,
- NULL_BYTES,
- {
- from: owner,
- gas: addTokenGasEstimate,
- },
- ),
- );
- await web3Wrapper.awaitTransactionSuccessAsync(
- await tokenReg.addToken.sendTransactionAsync(
- etherToken.address,
- 'Ether Token',
- 'WETH',
- decimals,
- NULL_BYTES,
- NULL_BYTES,
- {
- from: owner,
- gas: addTokenGasEstimate,
- },
- ),
- );
- for (const token of erc20TokenInfo) {
- const totalSupply = new BigNumber(100000000000000000000);
- const dummyToken = await DummyERC20TokenContract.deployFrom0xArtifactAsync(
- artifacts.DummyERC20Token,
- provider,
- txDefaults,
- token.name,
- token.symbol,
- token.decimals,
- totalSupply,
- );
- await web3Wrapper.awaitTransactionSuccessAsync(
- await tokenReg.addToken.sendTransactionAsync(
- dummyToken.address,
- token.name,
- token.symbol,
- token.decimals,
- token.ipfsHash,
- token.swarmHash,
- {
- from: owner,
- gas: addTokenGasEstimate,
- },
- ),
- );
- }
-};
diff --git a/packages/migrations/src/2.0.0/artifacts.ts b/packages/migrations/src/2.0.0/artifacts.ts
deleted file mode 100644
index e96c555d6..000000000
--- a/packages/migrations/src/2.0.0/artifacts.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-import { ContractArtifact } from 'ethereum-types';
-
-import * as AssetProxyOwner from '../../artifacts/2.0.0/AssetProxyOwner.json';
-import * as DummyERC20Token from '../../artifacts/2.0.0/DummyERC20Token.json';
-import * as DummyERC721Token from '../../artifacts/2.0.0/DummyERC721Token.json';
-import * as ERC20Proxy from '../../artifacts/2.0.0/ERC20Proxy.json';
-import * as ERC721Proxy from '../../artifacts/2.0.0/ERC721Proxy.json';
-import * as Exchange from '../../artifacts/2.0.0/Exchange.json';
-import * as Forwarder from '../../artifacts/2.0.0/Forwarder.json';
-import * as OrderValidator from '../../artifacts/2.0.0/OrderValidator.json';
-import * as WETH9 from '../../artifacts/2.0.0/WETH9.json';
-import * as ZRX from '../../artifacts/2.0.0/ZRXToken.json';
-
-export const artifacts = {
- ZRX: (ZRX as any) as ContractArtifact,
- DummyERC20Token: (DummyERC20Token as any) as ContractArtifact,
- DummyERC721Token: (DummyERC721Token as any) as ContractArtifact,
- AssetProxyOwner: (AssetProxyOwner as any) as ContractArtifact,
- Exchange: (Exchange as any) as ContractArtifact,
- WETH9: (WETH9 as any) as ContractArtifact,
- ERC20Proxy: (ERC20Proxy as any) as ContractArtifact,
- ERC721Proxy: (ERC721Proxy as any) as ContractArtifact,
- Forwarder: (Forwarder as any) as ContractArtifact,
- OrderValidator: (OrderValidator as any) as ContractArtifact,
-};
diff --git a/packages/migrations/src/2.0.0/migration.ts b/packages/migrations/src/2.0.0/migration.ts
deleted file mode 100644
index 1c30fb9ec..000000000
--- a/packages/migrations/src/2.0.0/migration.ts
+++ /dev/null
@@ -1,150 +0,0 @@
-import { assetDataUtils } from '@0xproject/order-utils';
-import { BigNumber } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
-import { Provider, TxData } from 'ethereum-types';
-
-import { ArtifactWriter } from '../utils/artifact_writer';
-import { erc20TokenInfo, erc721TokenInfo } from '../utils/token_info';
-
-import { artifacts } from './artifacts';
-import { AssetProxyOwnerContract } from './contract_wrappers/asset_proxy_owner';
-import { DummyERC20TokenContract } from './contract_wrappers/dummy_erc20_token';
-import { DummyERC721TokenContract } from './contract_wrappers/dummy_erc721_token';
-import { ERC20ProxyContract } from './contract_wrappers/erc20_proxy';
-import { ERC721ProxyContract } from './contract_wrappers/erc721_proxy';
-import { ExchangeContract } from './contract_wrappers/exchange';
-import { ForwarderContract } from './contract_wrappers/forwarder';
-import { OrderValidatorContract } from './contract_wrappers/order_validator';
-import { WETH9Contract } from './contract_wrappers/weth9';
-import { ZRXTokenContract } from './contract_wrappers/zrx_token';
-
-/**
- * Custom migrations should be defined in this function. This will be called with the CLI 'migrate:v2' command.
- * Migrations could be written to run in parallel, but if you want contract addresses to be created deterministically,
- * the migration should be written to run synchronously.
- * @param provider Web3 provider instance.
- * @param artifactsDir The directory with compiler artifact files.
- * @param txDefaults Default transaction values to use when deploying contracts.
- */
-export const runV2MigrationsAsync = async (provider: Provider, artifactsDir: string, txDefaults: Partial<TxData>) => {
- const web3Wrapper = new Web3Wrapper(provider);
- const networkId = await web3Wrapper.getNetworkIdAsync();
- const artifactsWriter = new ArtifactWriter(artifactsDir, networkId);
-
- // Proxies
- const erc20proxy = await ERC20ProxyContract.deployFrom0xArtifactAsync(artifacts.ERC20Proxy, provider, txDefaults);
- artifactsWriter.saveArtifact(erc20proxy);
- const erc721proxy = await ERC721ProxyContract.deployFrom0xArtifactAsync(
- artifacts.ERC721Proxy,
- provider,
- txDefaults,
- );
- artifactsWriter.saveArtifact(erc721proxy);
-
- // ZRX
- const zrxToken = await ZRXTokenContract.deployFrom0xArtifactAsync(artifacts.ZRX, provider, txDefaults);
- artifactsWriter.saveArtifact(zrxToken);
-
- // Ether token
- const etherToken = await WETH9Contract.deployFrom0xArtifactAsync(artifacts.WETH9, provider, txDefaults);
- artifactsWriter.saveArtifact(etherToken);
-
- // Exchange
- const zrxAssetData = assetDataUtils.encodeERC20AssetData(zrxToken.address);
- const exchange = await ExchangeContract.deployFrom0xArtifactAsync(artifacts.Exchange, provider, txDefaults);
- artifactsWriter.saveArtifact(exchange);
-
- // 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];
-
- // AssetProxyOwner
- const assetProxyOwner = await AssetProxyOwnerContract.deployFrom0xArtifactAsync(
- artifacts.AssetProxyOwner,
- provider,
- txDefaults,
- owners,
- [erc20proxy.address, erc721proxy.address],
- confirmationsRequired,
- secondsRequired,
- );
- artifactsWriter.saveArtifact(assetProxyOwner);
-
- await web3Wrapper.awaitTransactionSuccessAsync(
- await erc20proxy.addAuthorizedAddress.sendTransactionAsync(exchange.address, {
- from: owner,
- }),
- );
- await web3Wrapper.awaitTransactionSuccessAsync(
- await erc20proxy.transferOwnership.sendTransactionAsync(assetProxyOwner.address, {
- from: owner,
- }),
- );
- await web3Wrapper.awaitTransactionSuccessAsync(
- await erc721proxy.addAuthorizedAddress.sendTransactionAsync(exchange.address, {
- from: owner,
- }),
- );
- await web3Wrapper.awaitTransactionSuccessAsync(
- await erc721proxy.transferOwnership.sendTransactionAsync(assetProxyOwner.address, {
- from: owner,
- }),
- );
-
- // Register the Asset Proxies to the Exchange
- await web3Wrapper.awaitTransactionSuccessAsync(
- await exchange.registerAssetProxy.sendTransactionAsync(erc20proxy.address),
- );
- 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 DummyERC20TokenContract.deployFrom0xArtifactAsync(
- artifacts.DummyERC20Token,
- provider,
- txDefaults,
- token.name,
- token.symbol,
- token.decimals,
- totalSupply,
- );
- }
-
- // ERC721
- // tslint:disable-next-line:no-unused-variable
- const cryptoKittieToken = await DummyERC721TokenContract.deployFrom0xArtifactAsync(
- artifacts.DummyERC721Token,
- provider,
- txDefaults,
- erc721TokenInfo[0].name,
- erc721TokenInfo[0].symbol,
- );
-
- // Forwarder
- const forwarder = await ForwarderContract.deployFrom0xArtifactAsync(
- artifacts.Forwarder,
- provider,
- txDefaults,
- exchange.address,
- assetDataUtils.encodeERC20AssetData(zrxToken.address),
- assetDataUtils.encodeERC20AssetData(etherToken.address),
- );
- artifactsWriter.saveArtifact(forwarder);
-
- // OrderValidator
- const orderValidator = await OrderValidatorContract.deployFrom0xArtifactAsync(
- artifacts.OrderValidator,
- provider,
- txDefaults,
- exchange.address,
- zrxAssetData,
- );
- artifactsWriter.saveArtifact(orderValidator);
-};
diff --git a/packages/migrations/src/globals.d.ts b/packages/migrations/src/globals.d.ts
deleted file mode 100644
index 94e63a32d..000000000
--- a/packages/migrations/src/globals.d.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-declare module '*.json' {
- const json: any;
- /* tslint:disable */
- export default json;
- /* tslint:enable */
-}
diff --git a/packages/migrations/src/index.ts b/packages/migrations/src/index.ts
index 5354b3501..8f629a24b 100644
--- a/packages/migrations/src/index.ts
+++ b/packages/migrations/src/index.ts
@@ -1,2 +1 @@
-export { runV1MigrationsAsync } from './1.0.0/migration';
-export { runV2MigrationsAsync } from './2.0.0/migration';
+export { runMigrationsAsync, runMigrationsOnceAsync } from './migration';
diff --git a/packages/migrations/src/migrate.ts b/packages/migrations/src/migrate.ts
index 338832feb..d7a76d2f8 100644
--- a/packages/migrations/src/migrate.ts
+++ b/packages/migrations/src/migrate.ts
@@ -1,44 +1,21 @@
#!/usr/bin/env node
-import { devConstants, web3Factory } from '@0xproject/dev-utils';
-import { logUtils } from '@0xproject/utils';
+import { devConstants, web3Factory } from '@0x/dev-utils';
+import { logUtils } from '@0x/utils';
import { Provider } from 'ethereum-types';
-import * as yargs from 'yargs';
-import { runV1MigrationsAsync } from './1.0.0/migration';
-import { runV2MigrationsAsync } from './2.0.0/migration';
-
-enum ContractVersions {
- V1 = '1.0.0',
- V2 = '2.0.0',
-}
-const args = yargs.argv;
+import { runMigrationsAsync } from './migration';
(async () => {
- const contractsVersion = args.contractsVersion;
- const artifactsDir = `artifacts/${contractsVersion}`;
let providerConfigs;
let provider: Provider;
let txDefaults;
- switch (contractsVersion) {
- case ContractVersions.V1:
- providerConfigs = { shouldUseInProcessGanache: false };
- provider = web3Factory.getRpcProvider(providerConfigs);
- txDefaults = {
- from: devConstants.TESTRPC_FIRST_ADDRESS,
- };
- await runV1MigrationsAsync(provider, artifactsDir, txDefaults);
- break;
- case ContractVersions.V2:
- providerConfigs = { shouldUseInProcessGanache: false };
- provider = web3Factory.getRpcProvider(providerConfigs);
- txDefaults = {
- from: devConstants.TESTRPC_FIRST_ADDRESS,
- };
- await runV2MigrationsAsync(provider, artifactsDir, txDefaults);
- break;
- default:
- throw new Error(`Unsupported contract version: ${contractsVersion}`);
- }
+
+ providerConfigs = { shouldUseInProcessGanache: false };
+ provider = web3Factory.getRpcProvider(providerConfigs);
+ txDefaults = {
+ from: devConstants.TESTRPC_FIRST_ADDRESS,
+ };
+ await runMigrationsAsync(provider, txDefaults);
process.exit(0);
})().catch(err => {
logUtils.log(err);
diff --git a/packages/migrations/src/migration.ts b/packages/migrations/src/migration.ts
new file mode 100644
index 000000000..86c76a54b
--- /dev/null
+++ b/packages/migrations/src/migration.ts
@@ -0,0 +1,175 @@
+import * as wrappers from '@0x/abi-gen-wrappers';
+import { ContractAddresses } from '@0x/contract-addresses';
+import * as artifacts from '@0x/contract-artifacts';
+import { assetDataUtils } from '@0x/order-utils';
+import { BigNumber } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
+import { Provider, TxData } from 'ethereum-types';
+import * as _ from 'lodash';
+
+import { erc20TokenInfo, erc721TokenInfo } from './utils/token_info';
+
+/**
+ * Creates and deploys all the contracts that are required for the latest
+ * version of the 0x protocol. Custom migrations can be defined here. This will
+ * be called with the CLI 'migrate:v2' command.
+ * @param provider Web3 provider instance.
+ * @param txDefaults Default transaction values to use when deploying contracts.
+ * @returns The addresses of the contracts that were deployed.
+ */
+export async function runMigrationsAsync(provider: Provider, txDefaults: Partial<TxData>): Promise<ContractAddresses> {
+ const web3Wrapper = new Web3Wrapper(provider);
+
+ // Proxies
+ const erc20Proxy = await wrappers.ERC20ProxyContract.deployFrom0xArtifactAsync(
+ artifacts.ERC20Proxy,
+ provider,
+ txDefaults,
+ );
+ const erc721Proxy = await wrappers.ERC721ProxyContract.deployFrom0xArtifactAsync(
+ artifacts.ERC721Proxy,
+ provider,
+ txDefaults,
+ );
+
+ // ZRX
+ const zrxToken = await wrappers.ZRXTokenContract.deployFrom0xArtifactAsync(
+ artifacts.ZRXToken,
+ provider,
+ txDefaults,
+ );
+
+ // Ether token
+ const etherToken = await wrappers.WETH9Contract.deployFrom0xArtifactAsync(artifacts.WETH9, provider, txDefaults);
+
+ // Exchange
+ const zrxAssetData = assetDataUtils.encodeERC20AssetData(zrxToken.address);
+ const exchange = await wrappers.ExchangeContract.deployFrom0xArtifactAsync(
+ artifacts.Exchange,
+ provider,
+ txDefaults,
+ );
+
+ // 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];
+
+ // AssetProxyOwner
+ const assetProxyOwner = await wrappers.AssetProxyOwnerContract.deployFrom0xArtifactAsync(
+ artifacts.AssetProxyOwner,
+ provider,
+ txDefaults,
+ owners,
+ [erc20Proxy.address, erc721Proxy.address],
+ confirmationsRequired,
+ secondsRequired,
+ );
+
+ await web3Wrapper.awaitTransactionSuccessAsync(
+ await erc20Proxy.addAuthorizedAddress.sendTransactionAsync(exchange.address, {
+ from: owner,
+ }),
+ );
+ await web3Wrapper.awaitTransactionSuccessAsync(
+ await erc20Proxy.transferOwnership.sendTransactionAsync(assetProxyOwner.address, {
+ from: owner,
+ }),
+ );
+ await web3Wrapper.awaitTransactionSuccessAsync(
+ await erc721Proxy.addAuthorizedAddress.sendTransactionAsync(exchange.address, {
+ from: owner,
+ }),
+ );
+ await web3Wrapper.awaitTransactionSuccessAsync(
+ await erc721Proxy.transferOwnership.sendTransactionAsync(assetProxyOwner.address, {
+ from: owner,
+ }),
+ );
+
+ // Register the Asset Proxies to the Exchange
+ await web3Wrapper.awaitTransactionSuccessAsync(
+ await exchange.registerAssetProxy.sendTransactionAsync(erc20Proxy.address),
+ );
+ 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,
+ );
+
+ // Forwarder
+ const forwarder = await wrappers.ForwarderContract.deployFrom0xArtifactAsync(
+ artifacts.Forwarder,
+ provider,
+ txDefaults,
+ exchange.address,
+ assetDataUtils.encodeERC20AssetData(zrxToken.address),
+ assetDataUtils.encodeERC20AssetData(etherToken.address),
+ );
+
+ // OrderValidator
+ const orderValidator = await wrappers.OrderValidatorContract.deployFrom0xArtifactAsync(
+ artifacts.OrderValidator,
+ provider,
+ txDefaults,
+ exchange.address,
+ zrxAssetData,
+ );
+
+ return {
+ erc20Proxy: erc20Proxy.address,
+ erc721Proxy: erc721Proxy.address,
+ zrxToken: zrxToken.address,
+ etherToken: etherToken.address,
+ exchange: exchange.address,
+ assetProxyOwner: assetProxyOwner.address,
+ forwarder: forwarder.address,
+ orderValidator: orderValidator.address,
+ };
+}
+
+let _cachedContractAddresses: ContractAddresses;
+
+/**
+ * Exactly like runMigrationsAsync but will only run the migrations the first
+ * time it is called. Any subsequent calls will return the cached contract
+ * addresses.
+ * @param provider Web3 provider instance.
+ * @param txDefaults Default transaction values to use when deploying contracts.
+ * @returns The addresses of the contracts that were deployed.
+ */
+export async function runMigrationsOnceAsync(
+ provider: Provider,
+ txDefaults: Partial<TxData>,
+): Promise<ContractAddresses> {
+ if (!_.isUndefined(_cachedContractAddresses)) {
+ return _cachedContractAddresses;
+ }
+ _cachedContractAddresses = await runMigrationsAsync(provider, txDefaults);
+ return _cachedContractAddresses;
+}
diff --git a/packages/migrations/src/types.ts b/packages/migrations/src/types.ts
index 65f685797..87e66f356 100644
--- a/packages/migrations/src/types.ts
+++ b/packages/migrations/src/types.ts
@@ -1,4 +1,4 @@
-import { BigNumber } from '@0xproject/utils';
+import { BigNumber } from '@0x/utils';
export interface ERC20Token {
address?: string;
diff --git a/packages/migrations/src/utils/artifact_writer.ts b/packages/migrations/src/utils/artifact_writer.ts
deleted file mode 100644
index ea9c7952d..000000000
--- a/packages/migrations/src/utils/artifact_writer.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-import { BaseContract } from '@0xproject/base-contract';
-import { ContractArtifact } from 'ethereum-types';
-import * as fs from 'fs';
-import * as path from 'path';
-
-export class ArtifactWriter {
- private readonly _artifactsDir: string;
- private readonly _networkId: number;
- constructor(artifactsDir: string, networkId: number) {
- this._artifactsDir = artifactsDir;
- this._networkId = networkId;
- }
- // This updates the artifact file but does not update the `artifacts` module above. It will not
- // contain the saved artifact changes.
- public saveArtifact(contract: BaseContract): void {
- const contractName = contract.contractName;
- const artifactFile = path.join(this._artifactsDir, `${contractName}.json`);
- const artifact: ContractArtifact = JSON.parse(fs.readFileSync(artifactFile).toString());
- artifact.networks[this._networkId] = {
- address: contract.address,
- links: {},
- constructorArgs: JSON.stringify(contract.constructorArgs),
- };
- fs.writeFileSync(artifactFile, JSON.stringify(artifact, null, '\t'));
- }
-}
diff --git a/packages/migrations/src/utils/constants.ts b/packages/migrations/src/utils/constants.ts
index 63898ac02..8b16a0520 100644
--- a/packages/migrations/src/utils/constants.ts
+++ b/packages/migrations/src/utils/constants.ts
@@ -1,4 +1,4 @@
-import { BigNumber } from '@0xproject/utils';
+import { BigNumber } from '@0x/utils';
export const constants = {
ASSET_PROXY_OWNER_OWNERS: [
diff --git a/packages/migrations/src/utils/provider_factory.ts b/packages/migrations/src/utils/provider_factory.ts
index e7e00a039..8017b672a 100644
--- a/packages/migrations/src/utils/provider_factory.ts
+++ b/packages/migrations/src/utils/provider_factory.ts
@@ -1,4 +1,4 @@
-import { LedgerEthereumClient, LedgerSubprovider, RPCSubprovider, Web3ProviderEngine } from '@0xproject/subproviders';
+import { LedgerEthereumClient, LedgerSubprovider, RPCSubprovider, Web3ProviderEngine } from '@0x/subproviders';
import Eth from '@ledgerhq/hw-app-eth';
// tslint:disable:no-implicit-dependencies
import TransportNodeHid from '@ledgerhq/hw-transport-node-hid';
diff --git a/packages/migrations/src/utils/token_info.ts b/packages/migrations/src/utils/token_info.ts
index 200f94896..6e0411f60 100644
--- a/packages/migrations/src/utils/token_info.ts
+++ b/packages/migrations/src/utils/token_info.ts
@@ -1,4 +1,4 @@
-import { BigNumber, NULL_BYTES } from '@0xproject/utils';
+import { BigNumber, NULL_BYTES } from '@0x/utils';
import { ERC20Token, ERC721Token } from '../types';
diff --git a/packages/migrations/tslint.json b/packages/migrations/tslint.json
index ffaefe83a..dd9053357 100644
--- a/packages/migrations/tslint.json
+++ b/packages/migrations/tslint.json
@@ -1,3 +1,3 @@
{
- "extends": ["@0xproject/tslint-config"]
+ "extends": ["@0x/tslint-config"]
}
diff --git a/packages/monorepo-scripts/CHANGELOG.json b/packages/monorepo-scripts/CHANGELOG.json
index 3b8684fab..170a97a33 100644
--- a/packages/monorepo-scripts/CHANGELOG.json
+++ b/packages/monorepo-scripts/CHANGELOG.json
@@ -1,5 +1,22 @@
[
{
+ "version": "1.0.6",
+ "changes": [
+ {
+ "note": "Render date formats in UTC to prevent conflicts when publishing in different timezones.",
+ "pr": 1143
+ },
+ {
+ "note": "Add AssetBuyerError to the IGNORED_EXCESSIVE_TYPES array",
+ "pr": 1139
+ },
+ {
+ "note": "Add ForwarderError to the IGNORED_EXCESSIVE_TYPES array",
+ "pr": 1147
+ }
+ ]
+ },
+ {
"timestamp": 1534210131,
"version": "1.0.5",
"changes": [
diff --git a/packages/monorepo-scripts/README.md b/packages/monorepo-scripts/README.md
index d979e27dc..0673098b5 100644
--- a/packages/monorepo-scripts/README.md
+++ b/packages/monorepo-scripts/README.md
@@ -47,13 +47,13 @@ yarn install
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
```bash
-PKG=@0xproject/monorepo-scripts yarn build
+PKG=@0x/monorepo-scripts yarn build
```
Or continuously rebuild on change:
```bash
-PKG=@0xproject/monorepo-scripts yarn watch
+PKG=@0x/monorepo-scripts yarn watch
```
### Clean
diff --git a/packages/monorepo-scripts/package.json b/packages/monorepo-scripts/package.json
index 83091ae84..a31085014 100644
--- a/packages/monorepo-scripts/package.json
+++ b/packages/monorepo-scripts/package.json
@@ -1,7 +1,7 @@
{
"private": true,
- "name": "@0xproject/monorepo-scripts",
- "version": "1.0.11",
+ "name": "@0x/monorepo-scripts",
+ "version": "1.0.13",
"engines": {
"node": ">=6.12"
},
@@ -11,7 +11,7 @@
"scripts": {
"build": "tsc -b",
"build:ci": "yarn build",
- "lint": "tslint --project .",
+ "lint": "tslint --format stylish --project .",
"clean": "shx rm -rf lib",
"test:publish": "run-s build script:publish",
"find_unused_deps": "run-s build script:find_unused_deps",
@@ -65,7 +65,7 @@
"semver": "5.5.0",
"semver-diff": "^2.1.0",
"semver-sort": "0.0.4",
- "typedoc": "0.12.0",
+ "typedoc": "0.13.0",
"yargs": "^10.0.3"
},
"publishConfig": {
diff --git a/packages/monorepo-scripts/src/doc_gen_configs.ts b/packages/monorepo-scripts/src/doc_gen_configs.ts
index e3ddeddc9..7a14f8664 100644
--- a/packages/monorepo-scripts/src/doc_gen_configs.ts
+++ b/packages/monorepo-scripts/src/doc_gen_configs.ts
@@ -16,8 +16,14 @@ export const docGenConfigs: DocGenConfigs = {
Schema:
'https://github.com/tdegrunt/jsonschema/blob/5c2edd4baba149964aec0f23c87ad12c25a50dfb/lib/index.d.ts#L49',
Uint8Array: 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array',
+ // HACK: CI can handle these without the namespace but some local setups (Jacob) require the namespace prefix
+ // This is duplicated until we can discover the source of the issue.
GanacheOpts: 'https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/ganache-core/index.d.ts#L8',
keystore: 'https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/eth-lightwallet/index.d.ts#L36',
+ 'Ganache.GanacheOpts':
+ 'https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/ganache-core/index.d.ts#L8',
+ 'lightwallet.keystore':
+ 'https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/eth-lightwallet/index.d.ts#L36',
},
// If a 0x package re-exports an external package, we should add a link to it's exported items here
EXTERNAL_EXPORT_TO_LINK: {
@@ -30,6 +36,7 @@ export const docGenConfigs: DocGenConfigs = {
// factory method which instantiates an instance of a class, but we don't want users instantiating it themselves
// and getting confused. Any class name in this list will not have it's constructor rendered in our docs.
CLASSES_WITH_HIDDEN_CONSTRUCTORS: [
+ 'AssetBuyer',
'ERC20ProxyWrapper',
'ERC20TokenWrapper',
'ERC721ProxyWrapper',
@@ -43,7 +50,14 @@ export const docGenConfigs: DocGenConfigs = {
// Some types are not explicitly part of the public interface like params, return values, etc... But we still
// want them exported. E.g error enum types that can be thrown by methods. These must be manually added to this
// config
- IGNORED_EXCESSIVE_TYPES: ['NonceSubproviderErrors', 'Web3WrapperErrors', 'ContractWrappersError', 'OrderError'],
+ IGNORED_EXCESSIVE_TYPES: [
+ 'NonceSubproviderErrors',
+ 'Web3WrapperErrors',
+ 'ContractWrappersError',
+ 'OrderError',
+ 'AssetBuyerError',
+ 'ForwarderWrapperError',
+ ],
// Some libraries only export types. In those cases, we cannot check if the exported types are part of the
// "exported public interface". Thus we add them here and skip those checks.
TYPES_ONLY_LIBRARIES: ['ethereum-types', 'types'],
diff --git a/packages/monorepo-scripts/src/find_unused_dependencies.ts b/packages/monorepo-scripts/src/find_unused_dependencies.ts
index 4bb4b7dc5..42b4b7890 100644
--- a/packages/monorepo-scripts/src/find_unused_dependencies.ts
+++ b/packages/monorepo-scripts/src/find_unused_dependencies.ts
@@ -7,7 +7,7 @@ import { constants } from './constants';
import { utils } from './utils/utils';
// For some reason, `depcheck` hangs on some packages. Add them here.
-const IGNORE_PACKAGES = ['@0xproject/sol-compiler'];
+const IGNORE_PACKAGES = ['@0x/sol-compiler'];
(async () => {
utils.log('*** NOTE: Not all deps listed here are actually not required. ***');
diff --git a/packages/monorepo-scripts/src/prepublish_checks.ts b/packages/monorepo-scripts/src/prepublish_checks.ts
index 683c26094..5f603ebc7 100644
--- a/packages/monorepo-scripts/src/prepublish_checks.ts
+++ b/packages/monorepo-scripts/src/prepublish_checks.ts
@@ -11,7 +11,7 @@ import { utils } from './utils/utils';
async function prepublishChecksAsync(): Promise<void> {
const shouldIncludePrivate = false;
- const updatedPublicPackages = await utils.getUpdatedPackagesAsync(shouldIncludePrivate);
+ const updatedPublicPackages = await utils.getPackagesToPublishAsync(shouldIncludePrivate);
await checkCurrentVersionMatchesLatestPublishedNPMPackageAsync(updatedPublicPackages);
await checkChangelogFormatAsync(updatedPublicPackages);
diff --git a/packages/monorepo-scripts/src/publish.ts b/packages/monorepo-scripts/src/publish.ts
index 646818c58..854a72b86 100644
--- a/packages/monorepo-scripts/src/publish.ts
+++ b/packages/monorepo-scripts/src/publish.ts
@@ -18,7 +18,7 @@ import { DocGenerateAndUploadUtils } from './utils/doc_generate_and_upload_utils
import { publishReleaseNotesAsync } from './utils/github_release_utils';
import { utils } from './utils/utils';
-const NPM_NAMESPACE = '@0xproject/';
+const NPM_NAMESPACE = '@0x/';
const TODAYS_TIMESTAMP = moment().unix();
async function confirmAsync(message: string): Promise<void> {
@@ -34,8 +34,12 @@ async function confirmAsync(message: string): Promise<void> {
(async () => {
// Fetch public, updated Lerna packages
const shouldIncludePrivate = true;
- const allUpdatedPackages = await utils.getUpdatedPackagesAsync(shouldIncludePrivate);
- const packagesWithDocs = getPackagesWithDocs(allUpdatedPackages);
+ const allPackagesToPublish = await utils.getPackagesToPublishAsync(shouldIncludePrivate);
+ if (_.isEmpty(allPackagesToPublish)) {
+ utils.log('No packages need publishing');
+ process.exit(0);
+ }
+ const packagesWithDocs = getPackagesWithDocs(allPackagesToPublish);
if (!configs.IS_LOCAL_PUBLISH) {
await confirmAsync(
@@ -45,12 +49,12 @@ async function confirmAsync(message: string): Promise<void> {
}
// Update CHANGELOGs
- const updatedPublicPackages = _.filter(allUpdatedPackages, pkg => !pkg.packageJson.private);
+ const updatedPublicPackages = _.filter(allPackagesToPublish, pkg => !pkg.packageJson.private);
const updatedPublicPackageNames = _.map(updatedPublicPackages, pkg => pkg.packageJson.name);
utils.log(`Will update CHANGELOGs and publish: \n${updatedPublicPackageNames.join('\n')}\n`);
const packageToNextVersion = await updateChangeLogsAsync(updatedPublicPackages);
- const updatedPrivatePackages = _.filter(allUpdatedPackages, pkg => pkg.packageJson.private);
+ const updatedPrivatePackages = _.filter(allPackagesToPublish, pkg => pkg.packageJson.private);
_.each(updatedPrivatePackages, pkg => {
const currentVersion = pkg.packageJson.version;
const packageName = pkg.packageJson.name;
@@ -96,7 +100,7 @@ function getPackagesWithDocs(allUpdatedPackages: Package[]): Package[] {
const packagesWithDocPages = packagesWithDocPagesStringIfExist.split(' ');
const updatedPackagesWithDocPages: Package[] = [];
_.each(allUpdatedPackages, pkg => {
- const nameWithoutPrefix = pkg.packageJson.name.replace('@0xproject/', '');
+ const nameWithoutPrefix = pkg.packageJson.name.replace('@0x/', '');
if (_.includes(packagesWithDocPages, nameWithoutPrefix)) {
updatedPackagesWithDocPages.push(pkg);
}
@@ -110,7 +114,7 @@ async function generateAndUploadDocJsonsAsync(
shouldUploadDocs: boolean,
): Promise<void> {
for (const pkg of packagesWithDocs) {
- const nameWithoutPrefix = pkg.packageJson.name.replace('@0xproject/', '');
+ const nameWithoutPrefix = pkg.packageJson.name.replace('@0x/', '');
const docGenerateAndUploadUtils = new DocGenerateAndUploadUtils(nameWithoutPrefix, isStaging, shouldUploadDocs);
await docGenerateAndUploadUtils.generateAndUploadDocsAsync();
}
@@ -130,7 +134,7 @@ async function confirmDocPagesRenderAsync(packagesWithDocs: Package[]): Promise<
_.each(packagesWithDocs, pkg => {
const name = pkg.packageJson.name;
- const nameWithoutPrefix = _.startsWith(name, NPM_NAMESPACE) ? name.split('@0xproject/')[1] : name;
+ const nameWithoutPrefix = _.startsWith(name, NPM_NAMESPACE) ? name.split('@0x/')[1] : name;
const link = `${constants.stagingWebsite}/docs/${nameWithoutPrefix}`;
// tslint:disable-next-line:no-floating-promises
opn(link);
diff --git a/packages/monorepo-scripts/src/publish_release_notes.ts b/packages/monorepo-scripts/src/publish_release_notes.ts
index 6090498e0..d2082521c 100644
--- a/packages/monorepo-scripts/src/publish_release_notes.ts
+++ b/packages/monorepo-scripts/src/publish_release_notes.ts
@@ -15,14 +15,14 @@ const args = yargs
'Space-separated list of packages to generated release notes for. If not supplied, it does all `Lerna updated` packages.',
type: 'string',
})
- .example('$0 --isDryRun true --packages "0x.js @0xproject/web3-wrapper"', 'Full usage example').argv;
+ .example('$0 --isDryRun true --packages "0x.js @0x/web3-wrapper"', 'Full usage example').argv;
(async () => {
const isDryRun = args.isDryRun;
let packages;
if (_.isUndefined(args.packages)) {
const shouldIncludePrivate = false;
- packages = await utils.getUpdatedPackagesAsync(shouldIncludePrivate);
+ packages = await utils.getPackagesToPublishAsync(shouldIncludePrivate);
} else {
const packageNames = args.packages.split(' ');
packages = await utils.getPackagesByNameAsync(packageNames);
diff --git a/packages/monorepo-scripts/src/test_installation.ts b/packages/monorepo-scripts/src/test_installation.ts
index be39b1878..96875d0f9 100644
--- a/packages/monorepo-scripts/src/test_installation.ts
+++ b/packages/monorepo-scripts/src/test_installation.ts
@@ -12,12 +12,7 @@ import { Package } from './types';
import { utils } from './utils/utils';
// Packages might not be runnable if they are command-line tools or only run in browsers.
-const UNRUNNABLE_PACKAGES = [
- '@0xproject/abi-gen',
- '@0xproject/sra-report',
- '@0xproject/react-shared',
- '@0xproject/react-docs',
-];
+const UNRUNNABLE_PACKAGES = ['@0x/abi-gen', '@0x/react-shared', '@0x/react-docs'];
const mkdirpAsync = promisify(mkdirp);
const rimrafAsync = promisify(rimraf);
@@ -104,13 +99,10 @@ async function testInstallPackageAsync(
const packageName = installablePackage.packageJson.name;
utils.log(`Testing ${packageName}@${lastChangelogVersion}`);
const packageDirName = path.join(...(packageName + '-test').split('/'));
- const testDirectory = path.join(
- monorepoRootPath,
- 'packages',
- 'monorepo-scripts',
- '.installation-test',
- packageDirName,
- );
+ // NOTE(fabio): The `testDirectory` needs to be somewhere **outside** the monorepo root directory.
+ // Otherwise, it will have access to the hoisted `node_modules` directory and the Typescript missing
+ // type errors will not be caught.
+ const testDirectory = path.join(monorepoRootPath, '..', '.installation-test', packageDirName);
await rimrafAsync(testDirectory);
await mkdirpAsync(testDirectory);
await execAsync('yarn init --yes', { cwd: testDirectory });
@@ -124,7 +116,7 @@ async function testInstallPackageAsync(
await writeFileAsync(indexFilePath, `import * as Package from '${packageName}';\nconsole.log(Package);\n`);
const tsConfig = {
compilerOptions: {
- typeRoots: ['node_modules/@0xproject/typescript-typings/types', 'node_modules/@types'],
+ typeRoots: ['node_modules/@0x/typescript-typings/types', 'node_modules/@types'],
module: 'commonjs',
target: 'es5',
lib: ['es2017', 'dom'],
@@ -132,6 +124,7 @@ async function testInstallPackageAsync(
noImplicitReturns: true,
pretty: true,
strict: true,
+ resolveJsonModule: true,
},
include: ['index.ts'],
};
diff --git a/packages/monorepo-scripts/src/utils/changelog_utils.ts b/packages/monorepo-scripts/src/utils/changelog_utils.ts
index 8058d222b..0b46bf670 100644
--- a/packages/monorepo-scripts/src/utils/changelog_utils.ts
+++ b/packages/monorepo-scripts/src/utils/changelog_utils.ts
@@ -19,7 +19,8 @@ CHANGELOG
export const changelogUtils = {
getChangelogMdTitle(versionChangelog: VersionChangelog): string {
- const date = moment(`${versionChangelog.timestamp}`, 'X').format('MMMM D, YYYY');
+ // Use UTC rather than the local machines time (formatted date time is +0:00)
+ const date = moment.utc(`${versionChangelog.timestamp}`, 'X').format('MMMM D, YYYY');
const title = `\n## v${versionChangelog.version} - _${date}_\n\n`;
return title;
},
diff --git a/packages/monorepo-scripts/src/utils/doc_generate_and_upload_utils.ts b/packages/monorepo-scripts/src/utils/doc_generate_and_upload_utils.ts
index de52b3a47..1a4294e9c 100644
--- a/packages/monorepo-scripts/src/utils/doc_generate_and_upload_utils.ts
+++ b/packages/monorepo-scripts/src/utils/doc_generate_and_upload_utils.ts
@@ -1,4 +1,4 @@
-import { readFileSync, writeFileSync } from 'fs';
+import { existsSync, readFileSync, writeFileSync } from 'fs';
import * as _ from 'lodash';
import * as path from 'path';
import { exec as execAsync } from 'promisify-child-process';
@@ -103,6 +103,9 @@ export class DocGenerateAndUploadUtils {
switch (node.kind) {
case ts.SyntaxKind.ExportDeclaration: {
const exportClause = (node as any).exportClause;
+ if (_.isUndefined(exportClause)) {
+ return;
+ }
const exportPath = exportClause.parent.moduleSpecifier.text;
_.each(exportClause.elements, element => {
const exportItem = element.name.escapedText;
@@ -187,7 +190,11 @@ export class DocGenerateAndUploadUtils {
const typeDocExtraFileIncludes: string[] = this._getTypeDocFileIncludesForPackage();
// In order to avoid TS errors, we need to pass TypeDoc the package's global.d.ts file
- typeDocExtraFileIncludes.push(path.join(this._packagePath, 'src', 'globals.d.ts'));
+ // if it exists.
+ const globalTypeDefinitionsPath = path.join(this._packagePath, 'src', 'globals.d.ts');
+ if (existsSync(globalTypeDefinitionsPath)) {
+ typeDocExtraFileIncludes.push(globalTypeDefinitionsPath);
+ }
utils.log(`GENERATE_UPLOAD_DOCS: Generating Typedoc JSON for ${this._packageName}...`);
const jsonFilePath = path.join(this._packagePath, 'generated_docs', 'index.json');
@@ -324,7 +331,7 @@ export class DocGenerateAndUploadUtils {
throw new Error(
`${this._packageName} package exports BUT does not need: \n${excessiveReferencesExceptIgnored.join(
'\n',
- )} \nin it\'s index.ts. Remove them then try again.`,
+ )} \nin it\'s index.ts. Remove them then try again OR if we still want them exported (e.g error enum types), then add them to the IGNORED_EXCESSIVE_TYPES array.`,
);
}
}
@@ -395,7 +402,7 @@ export class DocGenerateAndUploadUtils {
sanitizedExportPathToExportPath[sanitizedExportPath] = exportPath;
return sanitizedExportPath;
}
- const monorepoPrefix = '@0xproject/';
+ const monorepoPrefix = '@0x/';
if (_.startsWith(exportPath, monorepoPrefix)) {
const sanitizedExportPath = exportPath.split(monorepoPrefix)[1];
sanitizedExportPathToExportPath[sanitizedExportPath] = exportPath;
@@ -471,7 +478,7 @@ export class DocGenerateAndUploadUtils {
});
});
- // @0xproject/types & ethereum-types are examples of packages where their index.ts exports types
+ // @0x/types & ethereum-types are examples of packages where their index.ts exports types
// directly, meaning no internal paths will exist to follow. Other packages also have direct exports
// in their index.ts, so we always add it to the source files passed to TypeDoc
if (typeDocSourceIncludes.size === 0) {
diff --git a/packages/monorepo-scripts/src/utils/github_release_utils.ts b/packages/monorepo-scripts/src/utils/github_release_utils.ts
index 0f3485de0..7434d397e 100644
--- a/packages/monorepo-scripts/src/utils/github_release_utils.ts
+++ b/packages/monorepo-scripts/src/utils/github_release_utils.ts
@@ -12,7 +12,7 @@ import { utils } from './utils';
const publishReleaseAsync = promisify(publishRelease);
// tslint:disable-next-line:completed-docs
-export async function publishReleaseNotesAsync(updatedPublishPackages: Package[], isDryRun: boolean): Promise<void> {
+export async function publishReleaseNotesAsync(packagesToPublish: Package[], isDryRun: boolean): Promise<void> {
// Git push a tag representing this publish (publish-{commit-hash}) (truncate hash)
const result = await execAsync('git log -n 1 --pretty=format:"%H"', { cwd: constants.monorepoRootPath });
const latestGitCommit = result.stdout;
@@ -40,12 +40,8 @@ export async function publishReleaseNotesAsync(updatedPublishPackages: Package[]
let assets: string[] = [];
let aggregateNotes = '';
- _.each(updatedPublishPackages, pkg => {
- const notes = getReleaseNotesForPackage(pkg.packageJson.name, pkg.packageJson.version);
- if (_.isEmpty(notes)) {
- return; // don't include it
- }
- aggregateNotes += `### ${pkg.packageJson.name}@${pkg.packageJson.version}\n${notes}\n\n`;
+ _.each(packagesToPublish, pkg => {
+ aggregateNotes += getReleaseNotesForPackage(pkg.packageJson.name);
const packageAssets = _.get(pkg.packageJson, 'config.postpublish.assets');
if (!_.isUndefined(packageAssets)) {
@@ -92,8 +88,8 @@ function adjustAssetPaths(assets: string[]): string[] {
return finalAssets;
}
-function getReleaseNotesForPackage(packageName: string, version: string): string {
- const packageNameWithoutNamespace = packageName.replace('@0xproject/', '');
+function getReleaseNotesForPackage(packageName: string): string {
+ const packageNameWithoutNamespace = packageName.replace('@0x/', '');
const changelogJSONPath = path.join(
constants.monorepoRootPath,
'packages',
@@ -115,5 +111,9 @@ function getReleaseNotesForPackage(packageName: string, version: string): string
}
notes += `\n`;
});
- return notes;
+ if (_.isEmpty(notes)) {
+ return ''; // don't include it
+ }
+ const releaseNotesSection = `### ${packageName}@${latestLog.version}\n${notes}\n\n`;
+ return releaseNotesSection;
}
diff --git a/packages/monorepo-scripts/src/utils/utils.ts b/packages/monorepo-scripts/src/utils/utils.ts
index 5e2e877c7..44ff971e8 100644
--- a/packages/monorepo-scripts/src/utils/utils.ts
+++ b/packages/monorepo-scripts/src/utils/utils.ts
@@ -61,7 +61,7 @@ export const utils = {
});
return updatedPackages;
},
- async getUpdatedPackagesAsync(shouldIncludePrivate: boolean): Promise<Package[]> {
+ async getPackagesToPublishAsync(shouldIncludePrivate: boolean): Promise<Package[]> {
const updatedPublicPackages = await utils.getLernaUpdatedPackagesAsync(shouldIncludePrivate);
const updatedPackageNames = _.map(updatedPublicPackages, pkg => pkg.name);
diff --git a/packages/order-utils/CHANGELOG.json b/packages/order-utils/CHANGELOG.json
index 5a0c0db47..0ed6117df 100644
--- a/packages/order-utils/CHANGELOG.json
+++ b/packages/order-utils/CHANGELOG.json
@@ -1,5 +1,39 @@
[
{
+ "version": "3.0.0",
+ "changes": [
+ {
+ "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",
+ "pr": 1235
+ },
+ {
+ "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",
+ "pr": 1235
+ }
+ ]
+ },
+ {
+ "version": "2.0.1",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ],
+ "timestamp": 1541740904
+ },
+ {
"version": "2.0.0",
"changes": [
{
@@ -14,8 +48,13 @@
{
"note": "Rename `ecSignOrderHashAsync` to `ecSignHashAsync` removing `SignerType` parameter.",
"pr": 1102
+ },
+ {
+ "note": "Use `AssetData` union type for function return values.",
+ "pr": 1131
}
- ]
+ ],
+ "timestamp": 1539871071
},
{
"version": "1.0.7",
diff --git a/packages/order-utils/CHANGELOG.md b/packages/order-utils/CHANGELOG.md
index 24598883a..31bd02595 100644
--- a/packages/order-utils/CHANGELOG.md
+++ b/packages/order-utils/CHANGELOG.md
@@ -5,6 +5,17 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
+## v2.0.1 - _November 9, 2018_
+
+ * Dependencies updated
+
+## v2.0.0 - _October 18, 2018_
+
+ * Added `ecSignOrderAsync` to first sign an order using `eth_signTypedData` and fallback to `eth_sign`. (#1102)
+ * Added `ecSignTypedDataOrderAsync` to sign an order exclusively using `eth_signTypedData`. (#1102)
+ * Rename `ecSignOrderHashAsync` to `ecSignHashAsync` removing `SignerType` parameter. (#1102)
+ * Use `AssetData` union type for function return values. (#1131)
+
## v1.0.7 - _October 4, 2018_
* Dependencies updated
@@ -52,7 +63,7 @@ CHANGELOG
* Make `sortFeeOrdersByFeeAdjustedRate` in `sortingUtils` generic (#997)
* Update `findFeeOrdersThatCoverFeesForTargetOrders` to round the the nearest integer when calculating required fees (#997)
-## v1.0.1-rc.3 - _August 13, 2018_
+## v1.0.1-rc.3 - _August 14, 2018_
* Update ecSignOrderHashAsync to return signature string with signature type byte. Removes messagePrefixOpts. (#914)
* Added a synchronous `createOrder` method in `orderFactory`, updated public interfaces to support some optional parameters (#936)
diff --git a/packages/order-utils/README.md b/packages/order-utils/README.md
index 33df1d4b0..4a8287098 100644
--- a/packages/order-utils/README.md
+++ b/packages/order-utils/README.md
@@ -1,4 +1,4 @@
-## @0xproject/order-utils
+## @0x/order-utils
0x order-related utilities for those developing on top of 0x protocol.
@@ -7,14 +7,14 @@
## Installation
```bash
-yarn add @0xproject/order-utils
+yarn add @0x/order-utils
```
If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`:
```json
"compilerOptions": {
- "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"],
+ "typeRoots": ["node_modules/@0x/typescript-typings/types", "node_modules/@types"],
}
```
@@ -43,13 +43,13 @@ yarn install
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
```bash
-PKG=@0xproject/order-utils yarn build
+PKG=@0x/order-utils yarn build
```
Or continuously rebuild on change:
```bash
-PKG=@0xproject/order-utils yarn watch
+PKG=@0x/order-utils yarn watch
```
### Clean
diff --git a/packages/order-utils/package.json b/packages/order-utils/package.json
index 6471de9f5..d6fb9892e 100644
--- a/packages/order-utils/package.json
+++ b/packages/order-utils/package.json
@@ -1,6 +1,6 @@
{
- "name": "@0xproject/order-utils",
- "version": "1.0.7",
+ "name": "@0x/order-utils",
+ "version": "2.0.1",
"engines": {
"node": ">=6.12"
},
@@ -8,23 +8,19 @@
"main": "lib/src/index.js",
"types": "lib/src/index.d.ts",
"scripts": {
- "build": "yarn pre_build && tsc -b",
+ "build": "yarn tsc -b",
"build:ci": "yarn build",
- "pre_build": "run-s update_artifacts generate_contract_wrappers",
- "generate_contract_wrappers": "abi-gen --abis 'lib/src/artifacts/@(Exchange|IWallet|IValidator|DummyERC20Token|ERC20Proxy|ERC20Token).json' --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/generated_contract_wrappers --backend ethers",
- "update_artifacts": "for i in ${npm_package_config_contracts_v2}; do copyfiles -u 4 ../migrations/artifacts/2.0.0-trimmed/$i.json lib/src/artifacts; done;",
"test": "yarn run_mocha",
"rebuild_and_test": "run-s build test",
"test:circleci": "yarn test:coverage",
"run_mocha": "mocha --require source-map-support/register --require make-promises-safe lib/test/**/*_test.js --bail --exit",
"test:coverage": "nyc npm run test --all && yarn coverage:report:lcov",
"coverage:report:lcov": "nyc report --reporter=text-lcov > coverage/lcov.info",
- "clean": "shx rm -rf lib lib/src/artifacts src/generated_contract_wrappers generated_docs",
- "lint": "tslint --project . --exclude **/src/generated_contract_wrappers/**/*",
+ "clean": "shx rm -rf lib generated_docs",
+ "lint": "tslint --format stylish --project .",
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --tsconfig typedoc-tsconfig.json --json $JSON_FILE_PATH $PROJECT_FILES"
},
"config": {
- "contracts_v2": "IWallet IValidator Exchange ERC20Proxy ERC20Token DummyERC20Token",
"postpublish": {
"assets": []
}
@@ -39,14 +35,13 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/order-utils/README.md",
"devDependencies": {
- "@0xproject/dev-utils": "^1.0.12",
- "@0xproject/tslint-config": "^1.0.8",
+ "@0x/dev-utils": "^1.0.14",
+ "@0x/tslint-config": "^1.0.10",
"@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",
- "copyfiles": "^2.0.0",
"dirty-chai": "^2.0.1",
"make-promises-safe": "^1.1.0",
"mocha": "^4.1.0",
@@ -54,20 +49,22 @@
"shx": "^0.2.2",
"sinon": "^4.0.0",
"tslint": "5.11.0",
- "typedoc": "0.12.0",
+ "typedoc": "0.13.0",
"typescript": "3.0.1"
},
"dependencies": {
- "@0xproject/assert": "^1.0.13",
- "@0xproject/base-contract": "^3.0.1",
- "@0xproject/json-schemas": "^1.0.7",
- "@0xproject/types": "^1.1.4",
- "@0xproject/typescript-typings": "^3.0.2",
- "@0xproject/utils": "^2.0.2",
- "@0xproject/web3-wrapper": "^3.0.3",
+ "@0x/abi-gen-wrappers": "^1.0.2",
+ "@0x/assert": "^1.0.15",
+ "@0x/base-contract": "^3.0.3",
+ "@0x/contract-artifacts": "^1.1.0",
+ "@0x/json-schemas": "^2.0.1",
+ "@0x/types": "^1.2.1",
+ "@0x/typescript-typings": "^3.0.4",
+ "@0x/utils": "^2.0.4",
+ "@0x/web3-wrapper": "^3.1.1",
"@types/node": "*",
"bn.js": "^4.11.8",
- "ethereum-types": "^1.0.11",
+ "ethereum-types": "^1.1.2",
"ethereumjs-abi": "0.6.5",
"ethereumjs-util": "^5.1.1",
"ethers": "~4.0.4",
diff --git a/packages/order-utils/src/abstract/abstract_balance_and_proxy_allowance_fetcher.ts b/packages/order-utils/src/abstract/abstract_balance_and_proxy_allowance_fetcher.ts
index c7f06abad..13fbf1736 100644
--- a/packages/order-utils/src/abstract/abstract_balance_and_proxy_allowance_fetcher.ts
+++ b/packages/order-utils/src/abstract/abstract_balance_and_proxy_allowance_fetcher.ts
@@ -1,4 +1,4 @@
-import { BigNumber } from '@0xproject/utils';
+import { BigNumber } from '@0x/utils';
/**
* An abstract class to be implemented in order to use OrderStateUtils. The class that
diff --git a/packages/order-utils/src/abstract/abstract_balance_and_proxy_allowance_lazy_store.ts b/packages/order-utils/src/abstract/abstract_balance_and_proxy_allowance_lazy_store.ts
index 38e08b7fe..0a73e92bd 100644
--- a/packages/order-utils/src/abstract/abstract_balance_and_proxy_allowance_lazy_store.ts
+++ b/packages/order-utils/src/abstract/abstract_balance_and_proxy_allowance_lazy_store.ts
@@ -1,4 +1,4 @@
-import { BigNumber } from '@0xproject/utils';
+import { BigNumber } from '@0x/utils';
export abstract class AbstractBalanceAndProxyAllowanceLazyStore {
public abstract async getBalanceAsync(assetData: string, userAddress: string): Promise<BigNumber>;
diff --git a/packages/order-utils/src/abstract/abstract_order_filled_cancelled_fetcher.ts b/packages/order-utils/src/abstract/abstract_order_filled_cancelled_fetcher.ts
index fbc1c4718..9e240f9ef 100644
--- a/packages/order-utils/src/abstract/abstract_order_filled_cancelled_fetcher.ts
+++ b/packages/order-utils/src/abstract/abstract_order_filled_cancelled_fetcher.ts
@@ -1,4 +1,5 @@
-import { BigNumber } from '@0xproject/utils';
+import { SignedOrder } from '@0x/types';
+import { BigNumber } from '@0x/utils';
/**
* An abstract class to be implemented in order to use OrderStateUtils. The class that
@@ -17,6 +18,6 @@ export abstract class AbstractOrderFilledCancelledFetcher {
* @param orderHash OrderHash of order we are interested in
* @return Whether or not the order is cancelled
*/
- public abstract async isOrderCancelledAsync(orderHash: string): Promise<boolean>;
+ public abstract async isOrderCancelledAsync(signedOrder: SignedOrder): Promise<boolean>;
public abstract getZRXAssetData(): string;
}
diff --git a/packages/order-utils/src/abstract/abstract_order_filled_cancelled_lazy_store.ts b/packages/order-utils/src/abstract/abstract_order_filled_cancelled_lazy_store.ts
index 617bcb224..186521401 100644
--- a/packages/order-utils/src/abstract/abstract_order_filled_cancelled_lazy_store.ts
+++ b/packages/order-utils/src/abstract/abstract_order_filled_cancelled_lazy_store.ts
@@ -1,8 +1,9 @@
-import { BigNumber } from '@0xproject/utils';
+import { SignedOrder } from '@0x/types';
+import { BigNumber } from '@0x/utils';
export abstract class AbstractOrderFilledCancelledLazyStore {
public abstract async getFilledTakerAmountAsync(orderHash: string): Promise<BigNumber>;
- public abstract async getIsCancelledAsync(orderHash: string): Promise<boolean>;
+ public abstract async getIsCancelledAsync(signedOrder: SignedOrder): Promise<boolean>;
public abstract setFilledTakerAmount(orderHash: string, balance: BigNumber): void;
public abstract deleteFilledTakerAmount(orderHash: string): void;
public abstract setIsCancelled(orderHash: string, isCancelled: boolean): void;
diff --git a/packages/order-utils/src/artifacts.ts b/packages/order-utils/src/artifacts.ts
deleted file mode 100644
index 735cc2403..000000000
--- a/packages/order-utils/src/artifacts.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { ContractArtifact } from 'ethereum-types';
-
-import * as DummyERC20Token from './artifacts/DummyERC20Token.json';
-import * as ERC20Proxy from './artifacts/ERC20Proxy.json';
-import * as Exchange from './artifacts/Exchange.json';
-import * as IValidator from './artifacts/IValidator.json';
-import * as IWallet from './artifacts/IWallet.json';
-export const artifacts = {
- ERC20Proxy: (ERC20Proxy as any) as ContractArtifact,
- DummyERC20Token: (DummyERC20Token as any) as ContractArtifact,
- Exchange: (Exchange as any) as ContractArtifact,
- IWallet: (IWallet as any) as ContractArtifact,
- IValidator: (IValidator as any) as ContractArtifact,
-};
diff --git a/packages/order-utils/src/assert.ts b/packages/order-utils/src/assert.ts
index f8db7ac63..2f73f58c4 100644
--- a/packages/order-utils/src/assert.ts
+++ b/packages/order-utils/src/assert.ts
@@ -1,10 +1,10 @@
-import { assert as sharedAssert } from '@0xproject/assert';
+import { assert as sharedAssert } from '@0x/assert';
// HACK: We need those two unused imports because they're actually used by sharedAssert which gets injected here
// tslint:disable:no-unused-variable
-import { Schema } from '@0xproject/json-schemas';
-import { ECSignature, SignatureType } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { Schema } from '@0x/json-schemas';
+import { ECSignature, SignatureType } from '@0x/types';
+import { BigNumber } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
// tslint:enable:no-unused-variable
import * as _ from 'lodash';
diff --git a/packages/order-utils/src/asset_data_utils.ts b/packages/order-utils/src/asset_data_utils.ts
index 0c0b59548..9bbef3a23 100644
--- a/packages/order-utils/src/asset_data_utils.ts
+++ b/packages/order-utils/src/asset_data_utils.ts
@@ -1,5 +1,5 @@
-import { AssetProxyId, ERC20AssetData, ERC721AssetData } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
+import { AssetData, AssetProxyId, ERC20AssetData, ERC721AssetData } from '@0x/types';
+import { BigNumber } from '@0x/utils';
import ethAbi = require('ethereumjs-abi');
import ethUtil = require('ethereumjs-util');
@@ -112,7 +112,7 @@ export const assetDataUtils = {
* @param assetData Hex encoded assetData string to decode
* @return Either a ERC20 or ERC721 assetData object
*/
- decodeAssetDataOrThrow(assetData: string): ERC20AssetData | ERC721AssetData {
+ decodeAssetDataOrThrow(assetData: string): AssetData {
const assetProxyId = assetDataUtils.decodeAssetProxyId(assetData);
switch (assetProxyId) {
case AssetProxyId.ERC20:
diff --git a/packages/order-utils/src/constants.ts b/packages/order-utils/src/constants.ts
index 7de20a696..10029dcc3 100644
--- a/packages/order-utils/src/constants.ts
+++ b/packages/order-utils/src/constants.ts
@@ -1,4 +1,4 @@
-import { BigNumber } from '@0xproject/utils';
+import { BigNumber } from '@0x/utils';
export const constants = {
NULL_ADDRESS: '0x0000000000000000000000000000000000000000',
diff --git a/packages/order-utils/src/eip712_utils.ts b/packages/order-utils/src/eip712_utils.ts
index 56f736500..385fda989 100644
--- a/packages/order-utils/src/eip712_utils.ts
+++ b/packages/order-utils/src/eip712_utils.ts
@@ -1,6 +1,6 @@
-import { assert } from '@0xproject/assert';
-import { schemas } from '@0xproject/json-schemas';
-import { EIP712Object, EIP712TypedData, EIP712Types, Order, ZeroExTransaction } from '@0xproject/types';
+import { assert } from '@0x/assert';
+import { schemas } from '@0x/json-schemas';
+import { EIP712Object, EIP712TypedData, EIP712Types, Order, ZeroExTransaction } from '@0x/types';
import * as _ from 'lodash';
import { constants } from './constants';
diff --git a/packages/order-utils/src/exchange_transfer_simulator.ts b/packages/order-utils/src/exchange_transfer_simulator.ts
index 81c849c64..7a38b35df 100644
--- a/packages/order-utils/src/exchange_transfer_simulator.ts
+++ b/packages/order-utils/src/exchange_transfer_simulator.ts
@@ -1,5 +1,5 @@
-import { ExchangeContractErrs } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
+import { ExchangeContractErrs } from '@0x/types';
+import { BigNumber } from '@0x/utils';
import { AbstractBalanceAndProxyAllowanceLazyStore } from './abstract/abstract_balance_and_proxy_allowance_lazy_store';
import { constants } from './constants';
diff --git a/packages/order-utils/src/globals.d.ts b/packages/order-utils/src/globals.d.ts
deleted file mode 100644
index 94e63a32d..000000000
--- a/packages/order-utils/src/globals.d.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-declare module '*.json' {
- const json: any;
- /* tslint:disable */
- export default json;
- /* tslint:enable */
-}
diff --git a/packages/order-utils/src/index.ts b/packages/order-utils/src/index.ts
index dbb782b85..e70d43efb 100644
--- a/packages/order-utils/src/index.ts
+++ b/packages/order-utils/src/index.ts
@@ -18,7 +18,6 @@ export { ExchangeTransferSimulator } from './exchange_transfer_simulator';
export { BalanceAndProxyAllowanceLazyStore } from './store/balance_and_proxy_allowance_lazy_store';
export { OrderFilledCancelledLazyStore } from './store/order_filled_cancelled_lazy_store';
-export { constants } from './constants';
export { eip712Utils } from './eip712_utils';
export {
@@ -35,6 +34,7 @@ export {
OrderRelevantState,
OrderState,
ECSignature,
+ AssetData,
ERC20AssetData,
ERC721AssetData,
AssetProxyId,
@@ -48,7 +48,7 @@ export {
EIP712Object,
EIP712ObjectValue,
ZeroExTransaction,
-} from '@0xproject/types';
+} from '@0x/types';
export {
OrderError,
TradeSide,
diff --git a/packages/order-utils/src/market_utils.ts b/packages/order-utils/src/market_utils.ts
index ed6af7d85..fa32f1413 100644
--- a/packages/order-utils/src/market_utils.ts
+++ b/packages/order-utils/src/market_utils.ts
@@ -1,6 +1,6 @@
-import { schemas } from '@0xproject/json-schemas';
-import { Order } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
+import { schemas } from '@0x/json-schemas';
+import { Order } from '@0x/types';
+import { BigNumber } from '@0x/utils';
import * as _ from 'lodash';
import { assert } from './assert';
diff --git a/packages/order-utils/src/order_factory.ts b/packages/order-utils/src/order_factory.ts
index 0f0cd6046..f7b855bfb 100644
--- a/packages/order-utils/src/order_factory.ts
+++ b/packages/order-utils/src/order_factory.ts
@@ -1,5 +1,5 @@
-import { Order, SignedOrder } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
+import { Order, SignedOrder } from '@0x/types';
+import { BigNumber } from '@0x/utils';
import { Provider } from 'ethereum-types';
import * as _ from 'lodash';
diff --git a/packages/order-utils/src/order_hash.ts b/packages/order-utils/src/order_hash.ts
index b523a3523..c8e9be71e 100644
--- a/packages/order-utils/src/order_hash.ts
+++ b/packages/order-utils/src/order_hash.ts
@@ -1,6 +1,6 @@
-import { schemas, SchemaValidator } from '@0xproject/json-schemas';
-import { Order, SignedOrder } from '@0xproject/types';
-import { signTypedDataUtils } from '@0xproject/utils';
+import { schemas, SchemaValidator } from '@0x/json-schemas';
+import { Order, SignedOrder } from '@0x/types';
+import { signTypedDataUtils } from '@0x/utils';
import * as _ from 'lodash';
import { assert } from './assert';
diff --git a/packages/order-utils/src/order_state_utils.ts b/packages/order-utils/src/order_state_utils.ts
index 9b21ef6e9..fe0d6c773 100644
--- a/packages/order-utils/src/order_state_utils.ts
+++ b/packages/order-utils/src/order_state_utils.ts
@@ -5,8 +5,8 @@ import {
OrderStateInvalid,
OrderStateValid,
SignedOrder,
-} from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
+} from '@0x/types';
+import { BigNumber } from '@0x/utils';
import { AbstractBalanceAndProxyAllowanceFetcher } from './abstract/abstract_balance_and_proxy_allowance_fetcher';
import { AbstractOrderFilledCancelledFetcher } from './abstract/abstract_order_filled_cancelled_fetcher';
@@ -117,7 +117,7 @@ export class OrderStateUtils {
public async getOpenOrderStateAsync(signedOrder: SignedOrder, transactionHash?: string): Promise<OrderState> {
const orderRelevantState = await this.getOpenOrderRelevantStateAsync(signedOrder);
const orderHash = orderHashUtils.getOrderHashHex(signedOrder);
- const isOrderCancelled = await this._orderFilledCancelledFetcher.isOrderCancelledAsync(orderHash);
+ const isOrderCancelled = await this._orderFilledCancelledFetcher.isOrderCancelledAsync(signedOrder);
const sidedOrderRelevantState = {
isMakerSide: true,
traderBalance: orderRelevantState.makerBalance,
@@ -256,7 +256,7 @@ export class OrderStateUtils {
const filledTakerAssetAmount = await this._orderFilledCancelledFetcher.getFilledTakerAmountAsync(orderHash);
const totalMakerAssetAmount = signedOrder.makerAssetAmount;
const totalTakerAssetAmount = signedOrder.takerAssetAmount;
- const isOrderCancelled = await this._orderFilledCancelledFetcher.isOrderCancelledAsync(orderHash);
+ const isOrderCancelled = await this._orderFilledCancelledFetcher.isOrderCancelledAsync(signedOrder);
const remainingTakerAssetAmount = isOrderCancelled
? new BigNumber(0)
: totalTakerAssetAmount.minus(filledTakerAssetAmount);
diff --git a/packages/order-utils/src/order_validation_utils.ts b/packages/order-utils/src/order_validation_utils.ts
index 8227fb07c..ae4291ea8 100644
--- a/packages/order-utils/src/order_validation_utils.ts
+++ b/packages/order-utils/src/order_validation_utils.ts
@@ -1,5 +1,5 @@
-import { RevertReason, SignedOrder } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
+import { ExchangeContractErrs, RevertReason, SignedOrder } from '@0x/types';
+import { BigNumber } from '@0x/utils';
import { Provider } from 'ethereum-types';
import * as _ from 'lodash';
@@ -17,6 +17,7 @@ import { utils } from './utils';
*/
export class OrderValidationUtils {
private readonly _orderFilledCancelledFetcher: AbstractOrderFilledCancelledFetcher;
+ private readonly _provider: Provider;
/**
* A Typescript implementation mirroring the implementation of isRoundingError in the
* Exchange smart contract
@@ -57,65 +58,53 @@ export class OrderValidationUtils {
senderAddress: string,
zrxAssetData: string,
): Promise<void> {
- try {
- const fillMakerTokenAmount = utils.getPartialAmountFloor(
- fillTakerAssetAmount,
- signedOrder.takerAssetAmount,
- signedOrder.makerAssetAmount,
- );
- await exchangeTradeEmulator.transferFromAsync(
- signedOrder.makerAssetData,
- signedOrder.makerAddress,
- senderAddress,
- fillMakerTokenAmount,
- TradeSide.Maker,
- TransferType.Trade,
- );
- await exchangeTradeEmulator.transferFromAsync(
- signedOrder.takerAssetData,
- senderAddress,
- signedOrder.makerAddress,
- fillTakerAssetAmount,
- TradeSide.Taker,
- TransferType.Trade,
- );
- const makerFeeAmount = utils.getPartialAmountFloor(
- fillTakerAssetAmount,
- signedOrder.takerAssetAmount,
- signedOrder.makerFee,
- );
- await exchangeTradeEmulator.transferFromAsync(
- zrxAssetData,
- signedOrder.makerAddress,
- signedOrder.feeRecipientAddress,
- makerFeeAmount,
- TradeSide.Maker,
- TransferType.Fee,
- );
- const takerFeeAmount = utils.getPartialAmountFloor(
- fillTakerAssetAmount,
- signedOrder.takerAssetAmount,
- signedOrder.takerFee,
- );
- await exchangeTradeEmulator.transferFromAsync(
- zrxAssetData,
- senderAddress,
- signedOrder.feeRecipientAddress,
- takerFeeAmount,
- TradeSide.Taker,
- TransferType.Fee,
- );
- } catch (err) {
- throw new Error(RevertReason.TransferFailed);
- }
- }
- private static _validateRemainingFillAmountNotZeroOrThrow(
- takerAssetAmount: BigNumber,
- filledTakerTokenAmount: BigNumber,
- ): void {
- if (takerAssetAmount.eq(filledTakerTokenAmount)) {
- throw new Error(RevertReason.OrderUnfillable);
- }
+ const fillMakerTokenAmount = utils.getPartialAmountFloor(
+ fillTakerAssetAmount,
+ signedOrder.takerAssetAmount,
+ signedOrder.makerAssetAmount,
+ );
+ await exchangeTradeEmulator.transferFromAsync(
+ signedOrder.makerAssetData,
+ signedOrder.makerAddress,
+ senderAddress,
+ fillMakerTokenAmount,
+ TradeSide.Maker,
+ TransferType.Trade,
+ );
+ await exchangeTradeEmulator.transferFromAsync(
+ signedOrder.takerAssetData,
+ senderAddress,
+ signedOrder.makerAddress,
+ fillTakerAssetAmount,
+ TradeSide.Taker,
+ TransferType.Trade,
+ );
+ const makerFeeAmount = utils.getPartialAmountFloor(
+ fillTakerAssetAmount,
+ signedOrder.takerAssetAmount,
+ signedOrder.makerFee,
+ );
+ await exchangeTradeEmulator.transferFromAsync(
+ zrxAssetData,
+ signedOrder.makerAddress,
+ signedOrder.feeRecipientAddress,
+ makerFeeAmount,
+ TradeSide.Maker,
+ TransferType.Fee,
+ );
+ const takerFeeAmount = utils.getPartialAmountFloor(
+ fillTakerAssetAmount,
+ signedOrder.takerAssetAmount,
+ signedOrder.takerFee,
+ );
+ await exchangeTradeEmulator.transferFromAsync(
+ zrxAssetData,
+ senderAddress,
+ signedOrder.feeRecipientAddress,
+ takerFeeAmount,
+ TradeSide.Taker,
+ TransferType.Fee,
+ );
}
private static _validateOrderNotExpiredOrThrow(expirationTimeSeconds: BigNumber): void {
const currentUnixTimestampSec = utils.getCurrentUnixTimestampSec();
@@ -128,9 +117,13 @@ export class OrderValidationUtils {
* @param orderFilledCancelledFetcher A module that implements the AbstractOrderFilledCancelledFetcher
* @return An instance of OrderValidationUtils
*/
- constructor(orderFilledCancelledFetcher: AbstractOrderFilledCancelledFetcher) {
+ constructor(orderFilledCancelledFetcher: AbstractOrderFilledCancelledFetcher, provider: Provider) {
this._orderFilledCancelledFetcher = orderFilledCancelledFetcher;
+ this._provider = provider;
}
+ // TODO(fabio): remove this method once the smart contracts have been refactored
+ // to return helpful revert reasons instead of ORDER_UNFILLABLE. Instruct devs
+ // to make "calls" to validate order fillability + getOrderInfo for fillable amount.
/**
* Validate if the supplied order is fillable, and throw if it isn't
* @param exchangeTradeEmulator ExchangeTradeEmulator instance
@@ -146,12 +139,29 @@ export class OrderValidationUtils {
expectedFillTakerTokenAmount?: BigNumber,
): Promise<void> {
const orderHash = orderHashUtils.getOrderHashHex(signedOrder);
- const filledTakerTokenAmount = await this._orderFilledCancelledFetcher.getFilledTakerAmountAsync(orderHash);
- OrderValidationUtils._validateRemainingFillAmountNotZeroOrThrow(
- signedOrder.takerAssetAmount,
- filledTakerTokenAmount,
+ const isValidSignature = await signatureUtils.isValidSignatureAsync(
+ this._provider,
+ orderHash,
+ signedOrder.signature,
+ signedOrder.makerAddress,
);
- OrderValidationUtils._validateOrderNotExpiredOrThrow(signedOrder.expirationTimeSeconds);
+ if (!isValidSignature) {
+ throw new Error(RevertReason.InvalidOrderSignature);
+ }
+
+ const isCancelled = await this._orderFilledCancelledFetcher.isOrderCancelledAsync(signedOrder);
+ if (isCancelled) {
+ throw new Error('CANCELLED');
+ }
+ const filledTakerTokenAmount = await this._orderFilledCancelledFetcher.getFilledTakerAmountAsync(orderHash);
+ if (signedOrder.takerAssetAmount.eq(filledTakerTokenAmount)) {
+ throw new Error('FULLY_FILLED');
+ }
+ try {
+ OrderValidationUtils._validateOrderNotExpiredOrThrow(signedOrder.expirationTimeSeconds);
+ } catch (err) {
+ throw new Error('EXPIRED');
+ }
let fillTakerAssetAmount = signedOrder.takerAssetAmount.minus(filledTakerTokenAmount);
if (!_.isUndefined(expectedFillTakerTokenAmount)) {
fillTakerAssetAmount = expectedFillTakerTokenAmount;
@@ -198,10 +208,9 @@ export class OrderValidationUtils {
throw new Error(OrderError.InvalidSignature);
}
const filledTakerTokenAmount = await this._orderFilledCancelledFetcher.getFilledTakerAmountAsync(orderHash);
- OrderValidationUtils._validateRemainingFillAmountNotZeroOrThrow(
- signedOrder.takerAssetAmount,
- filledTakerTokenAmount,
- );
+ if (signedOrder.takerAssetAmount.eq(filledTakerTokenAmount)) {
+ throw new Error(RevertReason.OrderUnfillable);
+ }
if (signedOrder.takerAddress !== constants.NULL_ADDRESS && signedOrder.takerAddress !== takerAddress) {
throw new Error(RevertReason.InvalidTaker);
}
@@ -210,13 +219,30 @@ export class OrderValidationUtils {
const desiredFillTakerTokenAmount = remainingTakerTokenAmount.lessThan(fillTakerAssetAmount)
? remainingTakerTokenAmount
: fillTakerAssetAmount;
- await OrderValidationUtils.validateFillOrderBalancesAllowancesThrowIfInvalidAsync(
- exchangeTradeEmulator,
- signedOrder,
- desiredFillTakerTokenAmount,
- takerAddress,
- zrxAssetData,
- );
+ try {
+ await OrderValidationUtils.validateFillOrderBalancesAllowancesThrowIfInvalidAsync(
+ exchangeTradeEmulator,
+ signedOrder,
+ desiredFillTakerTokenAmount,
+ takerAddress,
+ zrxAssetData,
+ );
+ } catch (err) {
+ const transferFailedErrorMessages = [
+ ExchangeContractErrs.InsufficientMakerBalance,
+ ExchangeContractErrs.InsufficientMakerFeeBalance,
+ ExchangeContractErrs.InsufficientTakerBalance,
+ ExchangeContractErrs.InsufficientTakerFeeBalance,
+ ExchangeContractErrs.InsufficientMakerAllowance,
+ ExchangeContractErrs.InsufficientMakerFeeAllowance,
+ ExchangeContractErrs.InsufficientTakerAllowance,
+ ExchangeContractErrs.InsufficientTakerFeeAllowance,
+ ];
+ if (_.includes(transferFailedErrorMessages, err.message)) {
+ throw new Error(RevertReason.TransferFailed);
+ }
+ throw err;
+ }
const wouldRoundingErrorOccur = OrderValidationUtils.isRoundingErrorFloor(
desiredFillTakerTokenAmount,
@@ -228,33 +254,4 @@ export class OrderValidationUtils {
}
return filledTakerTokenAmount;
}
- /**
- * Validate a call to fillOrKillOrder and throw if it would fail
- * @param exchangeTradeEmulator ExchangeTradeEmulator to use
- * @param provider Web3 provider to use for JSON RPC requests
- * @param signedOrder SignedOrder of interest
- * @param fillTakerAssetAmount Amount we'd like to fill the order for
- * @param takerAddress The taker of the order
- * @param zrxAssetData ZRX asset data
- */
- public async validateFillOrKillOrderThrowIfInvalidAsync(
- exchangeTradeEmulator: ExchangeTransferSimulator,
- provider: Provider,
- signedOrder: SignedOrder,
- fillTakerAssetAmount: BigNumber,
- takerAddress: string,
- zrxAssetData: string,
- ): Promise<void> {
- const filledTakerTokenAmount = await this.validateFillOrderThrowIfInvalidAsync(
- exchangeTradeEmulator,
- provider,
- signedOrder,
- fillTakerAssetAmount,
- takerAddress,
- zrxAssetData,
- );
- if (filledTakerTokenAmount !== fillTakerAssetAmount) {
- throw new Error(RevertReason.OrderUnfillable);
- }
- }
}
diff --git a/packages/order-utils/src/parsing_utils.ts b/packages/order-utils/src/parsing_utils.ts
index 232c54b7b..98c6899fe 100644
--- a/packages/order-utils/src/parsing_utils.ts
+++ b/packages/order-utils/src/parsing_utils.ts
@@ -1,4 +1,4 @@
-import { BigNumber } from '@0xproject/utils';
+import { BigNumber } from '@0x/utils';
import * as _ from 'lodash';
export const orderParsingUtils = {
diff --git a/packages/order-utils/src/rate_utils.ts b/packages/order-utils/src/rate_utils.ts
index c9ca72c59..416e00c67 100644
--- a/packages/order-utils/src/rate_utils.ts
+++ b/packages/order-utils/src/rate_utils.ts
@@ -1,6 +1,6 @@
-import { schemas } from '@0xproject/json-schemas';
-import { Order } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
+import { schemas } from '@0x/json-schemas';
+import { Order } from '@0x/types';
+import { BigNumber } from '@0x/utils';
import { assert } from './assert';
import { constants } from './constants';
diff --git a/packages/order-utils/src/remaining_fillable_calculator.ts b/packages/order-utils/src/remaining_fillable_calculator.ts
index 7022aa979..052eafa1d 100644
--- a/packages/order-utils/src/remaining_fillable_calculator.ts
+++ b/packages/order-utils/src/remaining_fillable_calculator.ts
@@ -1,4 +1,4 @@
-import { BigNumber } from '@0xproject/utils';
+import { BigNumber } from '@0x/utils';
export class RemainingFillableCalculator {
private readonly _isTraderAssetZRX: boolean;
diff --git a/packages/order-utils/src/salt.ts b/packages/order-utils/src/salt.ts
index 90a4197c0..ff47ab5d2 100644
--- a/packages/order-utils/src/salt.ts
+++ b/packages/order-utils/src/salt.ts
@@ -1,4 +1,4 @@
-import { BigNumber } from '@0xproject/utils';
+import { BigNumber } from '@0x/utils';
const MAX_DIGITS_IN_UNSIGNED_256_INT = 78;
diff --git a/packages/order-utils/src/signature_utils.ts b/packages/order-utils/src/signature_utils.ts
index 372d210d0..96d90e21a 100644
--- a/packages/order-utils/src/signature_utils.ts
+++ b/packages/order-utils/src/signature_utils.ts
@@ -1,16 +1,14 @@
-import { schemas } from '@0xproject/json-schemas';
-import { ECSignature, Order, SignatureType, SignedOrder, ValidatorSignature } from '@0xproject/types';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { ExchangeContract, IValidatorContract, IWalletContract } from '@0x/abi-gen-wrappers';
+import * as artifacts from '@0x/contract-artifacts';
+import { schemas } from '@0x/json-schemas';
+import { ECSignature, Order, SignatureType, SignedOrder, ValidatorSignature } from '@0x/types';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import { Provider } from 'ethereum-types';
import * as ethUtil from 'ethereumjs-util';
import * as _ from 'lodash';
-import { artifacts } from './artifacts';
import { assert } from './assert';
import { eip712Utils } from './eip712_utils';
-import { ExchangeContract } from './generated_contract_wrappers/exchange';
-import { IValidatorContract } from './generated_contract_wrappers/i_validator';
-import { IWalletContract } from './generated_contract_wrappers/i_wallet';
import { orderHashUtils } from './order_hash';
import { OrderError } from './types';
import { utils } from './utils';
diff --git a/packages/order-utils/src/sorting_utils.ts b/packages/order-utils/src/sorting_utils.ts
index cd5163cf6..1de24264f 100644
--- a/packages/order-utils/src/sorting_utils.ts
+++ b/packages/order-utils/src/sorting_utils.ts
@@ -1,6 +1,6 @@
-import { schemas } from '@0xproject/json-schemas';
-import { Order } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
+import { schemas } from '@0x/json-schemas';
+import { Order } from '@0x/types';
+import { BigNumber } from '@0x/utils';
import * as _ from 'lodash';
import { assert } from './assert';
diff --git a/packages/order-utils/src/store/balance_and_proxy_allowance_lazy_store.ts b/packages/order-utils/src/store/balance_and_proxy_allowance_lazy_store.ts
index 8a65178b0..f42a76d0c 100644
--- a/packages/order-utils/src/store/balance_and_proxy_allowance_lazy_store.ts
+++ b/packages/order-utils/src/store/balance_and_proxy_allowance_lazy_store.ts
@@ -1,5 +1,5 @@
-import { AssetProxyId } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
+import { AssetProxyId } from '@0x/types';
+import { BigNumber } from '@0x/utils';
import * as _ from 'lodash';
import { AbstractBalanceAndProxyAllowanceFetcher } from '../abstract/abstract_balance_and_proxy_allowance_fetcher';
diff --git a/packages/order-utils/src/store/order_filled_cancelled_lazy_store.ts b/packages/order-utils/src/store/order_filled_cancelled_lazy_store.ts
index 6155c2064..afd6f1108 100644
--- a/packages/order-utils/src/store/order_filled_cancelled_lazy_store.ts
+++ b/packages/order-utils/src/store/order_filled_cancelled_lazy_store.ts
@@ -1,8 +1,10 @@
-import { BigNumber } from '@0xproject/utils';
+import { SignedOrder } from '@0x/types';
+import { BigNumber } from '@0x/utils';
import * as _ from 'lodash';
import { AbstractOrderFilledCancelledFetcher } from '../abstract/abstract_order_filled_cancelled_fetcher';
import { AbstractOrderFilledCancelledLazyStore } from '../abstract/abstract_order_filled_cancelled_lazy_store';
+import { orderHashUtils } from '../order_hash';
/**
* Copy on read store for balances/proxyAllowances of tokens/accounts
@@ -58,9 +60,10 @@ export class OrderFilledCancelledLazyStore implements AbstractOrderFilledCancell
* @param orderHash OrderHash from order of interest
* @return Whether the order has been cancelled
*/
- public async getIsCancelledAsync(orderHash: string): Promise<boolean> {
+ public async getIsCancelledAsync(signedOrder: SignedOrder): Promise<boolean> {
+ const orderHash = orderHashUtils.getOrderHashHex(signedOrder);
if (_.isUndefined(this._isCancelled[orderHash])) {
- const isCancelled = await this._orderFilledCancelledFetcher.isOrderCancelledAsync(orderHash);
+ const isCancelled = await this._orderFilledCancelledFetcher.isOrderCancelledAsync(signedOrder);
this.setIsCancelled(orderHash, isCancelled);
}
const cachedIsCancelled = this._isCancelled[orderHash]; // tslint:disable-line:boolean-naming
diff --git a/packages/order-utils/src/types.ts b/packages/order-utils/src/types.ts
index 5b13dd754..55ec553db 100644
--- a/packages/order-utils/src/types.ts
+++ b/packages/order-utils/src/types.ts
@@ -1,8 +1,8 @@
-import { BigNumber } from '@0xproject/utils';
+import { BigNumber } from '@0x/utils';
export enum OrderError {
InvalidSignature = 'INVALID_SIGNATURE',
- InvalidMetamaskSigner = "MetaMask provider must be wrapped in a MetamaskSubprovider (from the '@0xproject/subproviders' package) in order to work with this method.",
+ InvalidMetamaskSigner = "MetaMask provider must be wrapped in a MetamaskSubprovider (from the '@0x/subproviders' package) in order to work with this method.",
}
export enum TradeSide {
@@ -27,7 +27,7 @@ export interface CreateOrderOpts {
/**
* remainingFillableMakerAssetAmount: An array of BigNumbers corresponding to the `orders` parameter.
- * You can use `OrderStateUtils` `@0xproject/order-utils` to perform blockchain lookups for these values.
+ * You can use `OrderStateUtils` `@0x/order-utils` to perform blockchain lookups for these values.
* Defaults to `makerAssetAmount` values from the orders param.
* slippageBufferAmount: An additional amount of makerAsset to be covered by the result in case of trade collisions or partial fills.
* Defaults to 0
@@ -39,10 +39,10 @@ export interface FindOrdersThatCoverMakerAssetFillAmountOpts {
/**
* remainingFillableMakerAssetAmount: An array of BigNumbers corresponding to the `orders` parameter.
- * You can use `OrderStateUtils` `@0xproject/order-utils` to perform blockchain lookups for these values.
+ * You can use `OrderStateUtils` `@0x/order-utils` to perform blockchain lookups for these values.
* Defaults to `makerAssetAmount` values from the orders param.
* remainingFillableFeeAmounts: An array of BigNumbers corresponding to the feeOrders parameter.
- * You can use OrderStateUtils @0xproject/order-utils to perform blockchain lookups for these values.
+ * You can use OrderStateUtils @0x/order-utils to perform blockchain lookups for these values.
* Defaults to `makerAssetAmount` values from the feeOrders param.
* slippageBufferAmount: An additional amount of fee to be covered by the result in case of trade collisions or partial fills.
* Defaults to 0
diff --git a/packages/order-utils/src/utils.ts b/packages/order-utils/src/utils.ts
index 0ff05e8ed..6b2261001 100644
--- a/packages/order-utils/src/utils.ts
+++ b/packages/order-utils/src/utils.ts
@@ -1,4 +1,4 @@
-import { BigNumber } from '@0xproject/utils';
+import { BigNumber } from '@0x/utils';
export const utils = {
getSignatureTypeIndexIfExists(signature: string): number {
diff --git a/packages/order-utils/test/asset_data_utils_test.ts b/packages/order-utils/test/asset_data_utils_test.ts
new file mode 100644
index 000000000..f175b7a38
--- /dev/null
+++ b/packages/order-utils/test/asset_data_utils_test.ts
@@ -0,0 +1,50 @@
+import * as chai from 'chai';
+
+import { ERC20AssetData, ERC721AssetData } from '@0x/types';
+import { BigNumber } from '@0x/utils';
+
+import { assetDataUtils } from '../src/asset_data_utils';
+
+import { chaiSetup } from './utils/chai_setup';
+
+chaiSetup.configure();
+const expect = chai.expect;
+
+const KNOWN_ENCODINGS = [
+ {
+ address: '0x1dc4c1cefef38a777b15aa20260a54e584b16c48',
+ assetData: '0xf47261b00000000000000000000000001dc4c1cefef38a777b15aa20260a54e584b16c48',
+ },
+ {
+ address: '0x1dc4c1cefef38a777b15aa20260a54e584b16c48',
+ tokenId: new BigNumber(1),
+ assetData:
+ '0x025717920000000000000000000000001dc4c1cefef38a777b15aa20260a54e584b16c480000000000000000000000000000000000000000000000000000000000000001',
+ },
+];
+
+const ERC20_ASSET_PROXY_ID = '0xf47261b0';
+const ERC721_ASSET_PROXY_ID = '0x02571792';
+
+describe('assetDataUtils', () => {
+ it('should encode ERC20', () => {
+ const assetData = assetDataUtils.encodeERC20AssetData(KNOWN_ENCODINGS[0].address);
+ expect(assetData).to.equal(KNOWN_ENCODINGS[0].assetData);
+ });
+ it('should decode ERC20', () => {
+ const assetData: ERC20AssetData = assetDataUtils.decodeERC20AssetData(KNOWN_ENCODINGS[0].assetData);
+ expect(assetData.tokenAddress).to.equal(KNOWN_ENCODINGS[0].address);
+ expect(assetData.assetProxyId).to.equal(ERC20_ASSET_PROXY_ID);
+ });
+ it('should encode ERC721', () => {
+ const assetData = assetDataUtils.encodeERC721AssetData(KNOWN_ENCODINGS[1].address, KNOWN_ENCODINGS[1]
+ .tokenId as BigNumber);
+ expect(assetData).to.equal(KNOWN_ENCODINGS[1].assetData);
+ });
+ it('should decode ERC721', () => {
+ const assetData: ERC721AssetData = assetDataUtils.decodeERC721AssetData(KNOWN_ENCODINGS[1].assetData);
+ expect(assetData.tokenAddress).to.equal(KNOWN_ENCODINGS[1].address);
+ expect(assetData.assetProxyId).to.equal(ERC721_ASSET_PROXY_ID);
+ expect(assetData.tokenId).to.be.bignumber.equal(KNOWN_ENCODINGS[1].tokenId);
+ });
+});
diff --git a/packages/order-utils/test/eip712_utils_test.ts b/packages/order-utils/test/eip712_utils_test.ts
index d65cabe9c..a54e49958 100644
--- a/packages/order-utils/test/eip712_utils_test.ts
+++ b/packages/order-utils/test/eip712_utils_test.ts
@@ -1,4 +1,4 @@
-import { BigNumber } from '@0xproject/utils';
+import { BigNumber } from '@0x/utils';
import * as chai from 'chai';
import 'mocha';
diff --git a/packages/order-utils/test/exchange_transfer_simulator_test.ts b/packages/order-utils/test/exchange_transfer_simulator_test.ts
index f5c18cdb9..c26eb1907 100644
--- a/packages/order-utils/test/exchange_transfer_simulator_test.ts
+++ b/packages/order-utils/test/exchange_transfer_simulator_test.ts
@@ -1,15 +1,13 @@
-import { BlockchainLifecycle, devConstants } from '@0xproject/dev-utils';
-import { ExchangeContractErrs } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
+import { DummyERC20TokenContract, ERC20ProxyContract, ERC20TokenContract } from '@0x/abi-gen-wrappers';
+import * as artifacts from '@0x/contract-artifacts';
+import { BlockchainLifecycle, devConstants } from '@0x/dev-utils';
+import { ExchangeContractErrs } from '@0x/types';
+import { BigNumber } from '@0x/utils';
import * as chai from 'chai';
-import { artifacts } from '../src/artifacts';
import { assetDataUtils } from '../src/asset_data_utils';
import { constants } from '../src/constants';
import { ExchangeTransferSimulator } from '../src/exchange_transfer_simulator';
-import { DummyERC20TokenContract } from '../src/generated_contract_wrappers/dummy_erc20_token';
-import { ERC20ProxyContract } from '../src/generated_contract_wrappers/erc20_proxy';
-import { ERC20TokenContract } from '../src/generated_contract_wrappers/erc20_token';
import { BalanceAndProxyAllowanceLazyStore } from '../src/store/balance_and_proxy_allowance_lazy_store';
import { TradeSide, TransferType } from '../src/types';
diff --git a/packages/order-utils/test/market_utils_test.ts b/packages/order-utils/test/market_utils_test.ts
index 31986ba1a..42ea195bb 100644
--- a/packages/order-utils/test/market_utils_test.ts
+++ b/packages/order-utils/test/market_utils_test.ts
@@ -1,4 +1,4 @@
-import { BigNumber } from '@0xproject/utils';
+import { BigNumber } from '@0x/utils';
import * as chai from 'chai';
import 'mocha';
diff --git a/packages/order-utils/test/order_hash_test.ts b/packages/order-utils/test/order_hash_test.ts
index fe44218d6..a85d4c81a 100644
--- a/packages/order-utils/test/order_hash_test.ts
+++ b/packages/order-utils/test/order_hash_test.ts
@@ -1,5 +1,5 @@
-import { Order } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
+import { Order } from '@0x/types';
+import { BigNumber } from '@0x/utils';
import * as chai from 'chai';
import 'mocha';
diff --git a/packages/order-utils/test/order_state_utils_test.ts b/packages/order-utils/test/order_state_utils_test.ts
index ea88027ae..42acd54c6 100644
--- a/packages/order-utils/test/order_state_utils_test.ts
+++ b/packages/order-utils/test/order_state_utils_test.ts
@@ -1,4 +1,5 @@
-import { BigNumber } from '@0xproject/utils';
+import { SignedOrder } from '@0x/types';
+import { BigNumber } from '@0x/utils';
import * as chai from 'chai';
import 'mocha';
@@ -33,7 +34,7 @@ describe('OrderStateUtils', () => {
async getFilledTakerAmountAsync(_orderHash: string): Promise<BigNumber> {
return filledAmount;
},
- async isOrderCancelledAsync(_orderHash: string): Promise<boolean> {
+ async isOrderCancelledAsync(_signedOrder: SignedOrder): Promise<boolean> {
return cancelled;
},
getZRXAssetData(): string {
diff --git a/packages/order-utils/test/order_validation_utils_test.ts b/packages/order-utils/test/order_validation_utils_test.ts
index d3133c0a6..d4d12a6a7 100644
--- a/packages/order-utils/test/order_validation_utils_test.ts
+++ b/packages/order-utils/test/order_validation_utils_test.ts
@@ -1,4 +1,4 @@
-import { BigNumber } from '@0xproject/utils';
+import { BigNumber } from '@0x/utils';
import * as chai from 'chai';
import 'mocha';
diff --git a/packages/order-utils/test/rate_utils_test.ts b/packages/order-utils/test/rate_utils_test.ts
index 2e299c209..b13878bb5 100644
--- a/packages/order-utils/test/rate_utils_test.ts
+++ b/packages/order-utils/test/rate_utils_test.ts
@@ -1,4 +1,4 @@
-import { BigNumber } from '@0xproject/utils';
+import { BigNumber } from '@0x/utils';
import * as chai from 'chai';
import 'mocha';
diff --git a/packages/order-utils/test/remaining_fillable_calculator_test.ts b/packages/order-utils/test/remaining_fillable_calculator_test.ts
index a5a3b7fc6..c55a76def 100644
--- a/packages/order-utils/test/remaining_fillable_calculator_test.ts
+++ b/packages/order-utils/test/remaining_fillable_calculator_test.ts
@@ -1,6 +1,6 @@
-import { SignedOrder } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { SignedOrder } from '@0x/types';
+import { BigNumber } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import * as chai from 'chai';
import 'mocha';
diff --git a/packages/order-utils/test/signature_utils_test.ts b/packages/order-utils/test/signature_utils_test.ts
index f2d6790fb..84e5559a9 100644
--- a/packages/order-utils/test/signature_utils_test.ts
+++ b/packages/order-utils/test/signature_utils_test.ts
@@ -1,5 +1,5 @@
-import { Order, SignatureType } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
+import { Order, SignatureType } from '@0x/types';
+import { BigNumber } from '@0x/utils';
import * as chai from 'chai';
import { JSONRPCErrorCallback, JSONRPCRequestPayload } from 'ethereum-types';
import * as ethUtil from 'ethereumjs-util';
diff --git a/packages/order-utils/test/sorting_utils_test.ts b/packages/order-utils/test/sorting_utils_test.ts
index 016432505..0b8757496 100644
--- a/packages/order-utils/test/sorting_utils_test.ts
+++ b/packages/order-utils/test/sorting_utils_test.ts
@@ -1,4 +1,4 @@
-import { BigNumber } from '@0xproject/utils';
+import { BigNumber } from '@0x/utils';
import * as chai from 'chai';
import 'mocha';
diff --git a/packages/order-utils/test/utils/simple_erc20_balance_and_proxy_allowance_fetcher.ts b/packages/order-utils/test/utils/simple_erc20_balance_and_proxy_allowance_fetcher.ts
index 279a5c0db..d3ea8b456 100644
--- a/packages/order-utils/test/utils/simple_erc20_balance_and_proxy_allowance_fetcher.ts
+++ b/packages/order-utils/test/utils/simple_erc20_balance_and_proxy_allowance_fetcher.ts
@@ -1,9 +1,8 @@
-import { BigNumber } from '@0xproject/utils';
+import { ERC20TokenContract } from '@0x/abi-gen-wrappers';
+import { BigNumber } from '@0x/utils';
import { AbstractBalanceAndProxyAllowanceFetcher } from '../../src/abstract/abstract_balance_and_proxy_allowance_fetcher';
-import { ERC20TokenContract } from '../../src/generated_contract_wrappers/erc20_token';
-
export class SimpleERC20BalanceAndProxyAllowanceFetcher implements AbstractBalanceAndProxyAllowanceFetcher {
private readonly _erc20TokenContract: ERC20TokenContract;
private readonly _erc20ProxyAddress: string;
diff --git a/packages/order-utils/test/utils/test_order_factory.ts b/packages/order-utils/test/utils/test_order_factory.ts
index 69184f129..145332674 100644
--- a/packages/order-utils/test/utils/test_order_factory.ts
+++ b/packages/order-utils/test/utils/test_order_factory.ts
@@ -1,4 +1,4 @@
-import { Order, SignedOrder } from '@0xproject/types';
+import { Order, SignedOrder } from '@0x/types';
import * as _ from 'lodash';
import { constants } from '../../src/constants';
diff --git a/packages/order-utils/test/utils/web3_wrapper.ts b/packages/order-utils/test/utils/web3_wrapper.ts
index ab801fa7f..accfcb7fe 100644
--- a/packages/order-utils/test/utils/web3_wrapper.ts
+++ b/packages/order-utils/test/utils/web3_wrapper.ts
@@ -1,5 +1,5 @@
-import { web3Factory } from '@0xproject/dev-utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { web3Factory } from '@0x/dev-utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import { Provider } from 'ethereum-types';
const provider: Provider = web3Factory.getRpcProvider({ shouldUseInProcessGanache: true });
diff --git a/packages/order-utils/tslint.json b/packages/order-utils/tslint.json
index ffaefe83a..dd9053357 100644
--- a/packages/order-utils/tslint.json
+++ b/packages/order-utils/tslint.json
@@ -1,3 +1,3 @@
{
- "extends": ["@0xproject/tslint-config"]
+ "extends": ["@0x/tslint-config"]
}
diff --git a/packages/order-watcher/.npmignore b/packages/order-watcher/.npmignore
index c5be1b302..ac4ab11f2 100644
--- a/packages/order-watcher/.npmignore
+++ b/packages/order-watcher/.npmignore
@@ -7,4 +7,3 @@ test/
/_bundles/
/generated_docs/
/scripts/
-/lib/src/monorepo_scripts/
diff --git a/packages/order-watcher/CHANGELOG.json b/packages/order-watcher/CHANGELOG.json
index ce56e492c..c662903a3 100644
--- a/packages/order-watcher/CHANGELOG.json
+++ b/packages/order-watcher/CHANGELOG.json
@@ -1,5 +1,29 @@
[
{
+ "version": "2.2.1",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ],
+ "timestamp": 1541740904
+ },
+ {
+ "version": "2.2.0",
+ "changes": [
+ {
+ "note": "Added getStats function and returns a Stats object",
+ "pr": 1118
+ },
+ {
+ "note":
+ "Updated to use new modularized artifacts and the latest version of @0xproject/contract-wrappers. Constructor has a new optional `contractAddresses` parameter.",
+ "pr": 1105
+ }
+ ],
+ "timestamp": 1539871071
+ },
+ {
"version": "2.1.1",
"changes": [
{
diff --git a/packages/order-watcher/CHANGELOG.md b/packages/order-watcher/CHANGELOG.md
index 5fdf5c944..b271956c7 100644
--- a/packages/order-watcher/CHANGELOG.md
+++ b/packages/order-watcher/CHANGELOG.md
@@ -5,6 +5,15 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
+## v2.2.1 - _November 9, 2018_
+
+ * Dependencies updated
+
+## v2.2.0 - _October 18, 2018_
+
+ * Added getStats function and returns a Stats object (#1118)
+ * Updated to use new modularized artifacts and the latest version of @0xproject/contract-wrappers. Constructor has a new optional `contractAddresses` parameter. (#1105)
+
## v2.1.1 - _October 4, 2018_
* Dependencies updated
@@ -48,7 +57,7 @@ CHANGELOG
* Export types: `ExchangeContractErrs`, `OrderRelevantState`, `JSONRPCRequestPayload`, `JSONRPCErrorCallback` and `JSONRPCResponsePayload` (#924)
* Remove exporting types: `BlockParamLiteral`, `BlockParam`, `Order` (#924)
-## v1.0.1-rc.3 - _August 13, 2018_
+## v1.0.1-rc.3 - _August 14, 2018_
* Dependencies updated
diff --git a/packages/order-watcher/README.md b/packages/order-watcher/README.md
index de64a70e7..c0b99b272 100644
--- a/packages/order-watcher/README.md
+++ b/packages/order-watcher/README.md
@@ -9,20 +9,20 @@ An order watcher daemon that watches for order validity.
**Install**
```bash
-npm install @0xproject/order-watcher --save
+npm install @0x/order-watcher --save
```
**Import**
```javascript
-import { OrderWatcher } from '@0xproject/order-watcher';
+import { OrderWatcher } from '@0x/order-watcher';
```
If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`:
```json
"compilerOptions": {
- "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"],
+ "typeRoots": ["node_modules/@0x/typescript-typings/types", "node_modules/@types"],
}
```
@@ -51,13 +51,13 @@ yarn install
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
```bash
-PKG=@0xproject/order-watcher yarn build
+PKG=@0x/order-watcher yarn build
```
Or continuously rebuild on change:
```bash
-PKG=@0xproject/order-watcher yarn watch
+PKG=@0x/order-watcher yarn watch
```
### Clean
diff --git a/packages/order-watcher/package.json b/packages/order-watcher/package.json
index 9bdaef5b1..174e0a3a6 100644
--- a/packages/order-watcher/package.json
+++ b/packages/order-watcher/package.json
@@ -1,6 +1,6 @@
{
- "name": "@0xproject/order-watcher",
- "version": "2.1.1",
+ "name": "@0x/order-watcher",
+ "version": "2.2.1",
"description": "An order watcher daemon that watches for order validity",
"keywords": [
"0x",
@@ -12,28 +12,18 @@
"main": "lib/src/index.js",
"types": "lib/src/index.d.ts",
"scripts": {
- "build": "yarn pre_build && tsc -b",
+ "build": "yarn tsc -b",
"build:ci": "yarn build",
- "pre_build": "run-s update_artifacts copy_artifacts generate_contract_wrappers",
- "lint": "tslint --project . --exclude **/src/generated_contract_wrappers/**/*",
- "generate_contract_wrappers": "abi-gen --abis 'src/artifacts/@(Exchange|Token|TokenTransferProxy|EtherToken).json' --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/generated_contract_wrappers --backend ethers",
+ "lint": "tslint --format stylish --project .",
"test:circleci": "run-s test:coverage",
"test": "yarn run_mocha",
"rebuild_and_test": "run-s build test",
"test:coverage": "nyc npm run test --all && yarn coverage:report:lcov",
"coverage:report:lcov": "nyc report --reporter=text-lcov > coverage/lcov.info",
- "copy_artifacts": "copyfiles -u 2 './src/artifacts/**/*.json' ./lib/src/artifacts",
- "update_artifacts": "for i in ${npm_package_config_contracts_v2}; do copyfiles -u 4 ../migrations/artifacts/2.0.0-trimmed/$i.json src/artifacts; done;",
- "clean": "shx rm -rf _bundles lib test_temp test/artifacts src/generated_contract_wrappers generated_docs",
+ "clean": "shx rm -rf _bundles lib test_temp generated_docs",
"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": {
- "contracts_v2": "AssetProxyOwner ERC20Proxy ERC20Token ERC721Proxy ERC721Token Exchange Forwarder OrderValidator WETH9 ZRXToken",
- "postpublish": {
- "assets": []
- }
- },
"repository": {
"type": "git",
"url": "https://github.com/0xProject/0x-monorepo"
@@ -43,10 +33,9 @@
"node": ">=6.0.0"
},
"devDependencies": {
- "@0xproject/abi-gen": "^1.0.13",
- "@0xproject/dev-utils": "^1.0.12",
- "@0xproject/migrations": "^1.0.14",
- "@0xproject/tslint-config": "^1.0.8",
+ "@0x/dev-utils": "^1.0.14",
+ "@0x/migrations": "^2.0.1",
+ "@0x/tslint-config": "^1.0.10",
"@types/bintrees": "^1.0.2",
"@types/lodash": "4.14.104",
"@types/mocha": "^2.2.42",
@@ -55,7 +44,6 @@
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
"chai-bignumber": "^2.0.1",
- "copyfiles": "^2.0.0",
"dirty-chai": "^2.0.1",
"make-promises-safe": "^1.1.0",
"mocha": "^4.1.0",
@@ -69,18 +57,21 @@
"typescript": "3.0.1"
},
"dependencies": {
- "@0xproject/assert": "^1.0.13",
- "@0xproject/base-contract": "^3.0.1",
- "@0xproject/contract-wrappers": "^2.0.2",
- "@0xproject/fill-scenarios": "^1.0.7",
- "@0xproject/json-schemas": "^1.0.7",
- "@0xproject/order-utils": "^1.0.7",
- "@0xproject/types": "^1.1.4",
- "@0xproject/typescript-typings": "^3.0.2",
- "@0xproject/utils": "^2.0.2",
- "@0xproject/web3-wrapper": "^3.0.3",
+ "@0x/abi-gen-wrappers": "^1.0.2",
+ "@0x/assert": "^1.0.15",
+ "@0x/base-contract": "^3.0.3",
+ "@0x/contract-addresses": "^1.1.0",
+ "@0x/contract-artifacts": "^1.1.0",
+ "@0x/contract-wrappers": "^3.0.1",
+ "@0x/fill-scenarios": "^1.0.9",
+ "@0x/json-schemas": "^2.0.1",
+ "@0x/order-utils": "^2.0.1",
+ "@0x/types": "^1.2.1",
+ "@0x/typescript-typings": "^3.0.4",
+ "@0x/utils": "^2.0.4",
+ "@0x/web3-wrapper": "^3.1.1",
"bintrees": "^1.0.2",
- "ethereum-types": "^1.0.11",
+ "ethereum-types": "^1.1.2",
"ethereumjs-blockstream": "6.0.0",
"ethers": "~4.0.4",
"lodash": "^4.17.5"
diff --git a/packages/order-watcher/src/artifacts.ts b/packages/order-watcher/src/artifacts.ts
deleted file mode 100644
index 520066a24..000000000
--- a/packages/order-watcher/src/artifacts.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { ContractArtifact } from 'ethereum-types';
-
-import * as ERC20Token from './artifacts/ERC20Token.json';
-import * as ERC721Token from './artifacts/ERC721Token.json';
-import * as Exchange from './artifacts/Exchange.json';
-import * as WETH9 from './artifacts/WETH9.json';
-
-export const artifacts = {
- ERC20Token: (ERC20Token as any) as ContractArtifact,
- ERC721Token: (ERC721Token as any) as ContractArtifact,
- Exchange: (Exchange as any) as ContractArtifact,
- EtherToken: (WETH9 as any) as ContractArtifact,
-};
diff --git a/packages/order-watcher/src/globals.d.ts b/packages/order-watcher/src/globals.d.ts
deleted file mode 100644
index 94e63a32d..000000000
--- a/packages/order-watcher/src/globals.d.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-declare module '*.json' {
- const json: any;
- /* tslint:disable */
- export default json;
- /* tslint:enable */
-}
diff --git a/packages/order-watcher/src/index.ts b/packages/order-watcher/src/index.ts
index d2f91eab1..5eeba3e87 100644
--- a/packages/order-watcher/src/index.ts
+++ b/packages/order-watcher/src/index.ts
@@ -7,11 +7,13 @@ export {
OrderState,
ExchangeContractErrs,
OrderRelevantState,
-} from '@0xproject/types';
+ Stats,
+} from '@0x/types';
export { OnOrderStateChangeCallback, OrderWatcherConfig } from './types';
-export { SignedOrder } from '@0xproject/types';
+export { ContractAddresses } from '@0x/contract-addresses';
+export { SignedOrder } from '@0x/types';
export {
JSONRPCRequestPayload,
JSONRPCErrorCallback,
diff --git a/packages/order-watcher/src/order_watcher/collision_resistant_abi_decoder.ts b/packages/order-watcher/src/order_watcher/collision_resistant_abi_decoder.ts
index e13663c7a..2ea796947 100644
--- a/packages/order-watcher/src/order_watcher/collision_resistant_abi_decoder.ts
+++ b/packages/order-watcher/src/order_watcher/collision_resistant_abi_decoder.ts
@@ -1,4 +1,4 @@
-import { AbiDecoder } from '@0xproject/utils';
+import { AbiDecoder } from '@0x/utils';
import { ContractAbi, DecodedLogArgs, LogEntry, LogWithDecodedArgs, RawLog } from 'ethereum-types';
const TOKEN_TYPE_COLLISION = `Token can't be marked as ERC20 and ERC721 at the same time`;
diff --git a/packages/order-watcher/src/order_watcher/dependent_order_hashes_tracker.ts b/packages/order-watcher/src/order_watcher/dependent_order_hashes_tracker.ts
index cc70bd5d7..dbcc25186 100644
--- a/packages/order-watcher/src/order_watcher/dependent_order_hashes_tracker.ts
+++ b/packages/order-watcher/src/order_watcher/dependent_order_hashes_tracker.ts
@@ -1,7 +1,7 @@
// tslint:disable:no-unnecessary-type-assertion
-import { assetDataUtils, orderHashUtils } from '@0xproject/order-utils';
-import { AssetProxyId, ERC20AssetData, ERC721AssetData, SignedOrder } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
+import { assetDataUtils, orderHashUtils } from '@0x/order-utils';
+import { AssetProxyId, ERC20AssetData, ERC721AssetData, SignedOrder } from '@0x/types';
+import { BigNumber } from '@0x/utils';
import * as _ from 'lodash';
export interface OrderHashesByMakerAddress {
diff --git a/packages/order-watcher/src/order_watcher/event_watcher.ts b/packages/order-watcher/src/order_watcher/event_watcher.ts
index 9ea301815..3149d858b 100644
--- a/packages/order-watcher/src/order_watcher/event_watcher.ts
+++ b/packages/order-watcher/src/order_watcher/event_watcher.ts
@@ -1,5 +1,5 @@
-import { intervalUtils, logUtils } from '@0xproject/utils';
-import { marshaller, Web3Wrapper } from '@0xproject/web3-wrapper';
+import { intervalUtils, logUtils } from '@0x/utils';
+import { marshaller, Web3Wrapper } from '@0x/web3-wrapper';
import { BlockParamLiteral, FilterObject, LogEntry, Provider, RawLogEntry } from 'ethereum-types';
import { Block, BlockAndLogStreamer, Log } from 'ethereumjs-blockstream';
import * as _ from 'lodash';
diff --git a/packages/order-watcher/src/order_watcher/expiration_watcher.ts b/packages/order-watcher/src/order_watcher/expiration_watcher.ts
index 6eadf14c7..ad20a6e3f 100644
--- a/packages/order-watcher/src/order_watcher/expiration_watcher.ts
+++ b/packages/order-watcher/src/order_watcher/expiration_watcher.ts
@@ -1,4 +1,4 @@
-import { BigNumber, intervalUtils } from '@0xproject/utils';
+import { BigNumber, intervalUtils } from '@0x/utils';
import { RBTree } from 'bintrees';
import * as _ from 'lodash';
diff --git a/packages/order-watcher/src/order_watcher/order_watcher.ts b/packages/order-watcher/src/order_watcher/order_watcher.ts
index f9a63efe3..96c5ca7b4 100644
--- a/packages/order-watcher/src/order_watcher/order_watcher.ts
+++ b/packages/order-watcher/src/order_watcher/order_watcher.ts
@@ -1,4 +1,6 @@
// tslint:disable:no-unnecessary-type-assertion
+import { ContractAddresses } from '@0x/contract-addresses';
+import * as artifacts from '@0x/contract-artifacts';
import {
AssetBalanceAndProxyAllowanceFetcher,
ContractWrappers,
@@ -21,21 +23,20 @@ import {
WETH9EventArgs,
WETH9Events,
WETH9WithdrawalEventArgs,
-} from '@0xproject/contract-wrappers';
-import { schemas } from '@0xproject/json-schemas';
+} from '@0x/contract-wrappers';
+import { schemas } from '@0x/json-schemas';
import {
assetDataUtils,
BalanceAndProxyAllowanceLazyStore,
OrderFilledCancelledLazyStore,
orderHashUtils,
OrderStateUtils,
-} from '@0xproject/order-utils';
-import { AssetProxyId, ExchangeContractErrs, OrderState, SignedOrder } from '@0xproject/types';
-import { errorUtils, intervalUtils } from '@0xproject/utils';
+} from '@0x/order-utils';
+import { AssetProxyId, ExchangeContractErrs, OrderState, SignedOrder, Stats } from '@0x/types';
+import { errorUtils, intervalUtils } from '@0x/utils';
import { BlockParamLiteral, LogEntryEvent, LogWithDecodedArgs, Provider } from 'ethereum-types';
import * as _ from 'lodash';
-import { artifacts } from '../artifacts';
import { orderWatcherPartialConfigSchema } from '../schemas/order_watcher_partial_config_schema';
import { OnOrderStateChangeCallback, OrderWatcherConfig, OrderWatcherError } from '../types';
import { assert } from '../utils/assert';
@@ -91,11 +92,14 @@ export class OrderWatcher {
* Instantiate a new OrderWatcher
* @param provider Web3 provider to use for JSON RPC calls
* @param networkId NetworkId to watch orders on
+ * @param contractAddresses Optional contract addresses. Defaults to known
+ * addresses based on networkId.
* @param partialConfig Optional configurations
*/
constructor(
provider: Provider,
networkId: number,
+ contractAddresses?: ContractAddresses,
partialConfig: Partial<OrderWatcherConfig> = DEFAULT_ORDER_WATCHER_CONFIG,
) {
assert.isWeb3Provider('provider', provider);
@@ -110,9 +114,14 @@ export class OrderWatcher {
this._collisionResistantAbiDecoder = new CollisionResistanceAbiDecoder(
artifacts.ERC20Token.compilerOutput.abi,
artifacts.ERC721Token.compilerOutput.abi,
- [artifacts.EtherToken.compilerOutput.abi, artifacts.Exchange.compilerOutput.abi],
+ [artifacts.WETH9.compilerOutput.abi, artifacts.Exchange.compilerOutput.abi],
);
- const contractWrappers = new ContractWrappers(provider, { networkId });
+ const contractWrappers = new ContractWrappers(provider, {
+ networkId,
+ // Note(albrow): We let the contract-wrappers package handle
+ // default values for contractAddresses.
+ contractAddresses,
+ });
this._eventWatcher = new EventWatcher(provider, config.eventPollingIntervalMs, STATE_LAYER, config.isVerbose);
const balanceAndProxyAllowanceFetcher = new AssetBalanceAndProxyAllowanceFetcher(
contractWrappers.erc20Token,
@@ -213,6 +222,14 @@ export class OrderWatcher {
this._expirationWatcher.unsubscribe();
intervalUtils.clearAsyncExcludingInterval(this._cleanupJobIntervalIdIfExists);
}
+ /**
+ * Gets statistics of the OrderWatcher Instance.
+ */
+ public getStats(): Stats {
+ return {
+ orderCount: _.size(this._orderByOrderHash),
+ };
+ }
private async _cleanupAsync(): Promise<void> {
for (const orderHash of _.keys(this._orderByOrderHash)) {
this._cleanupOrderRelatedState(orderHash);
diff --git a/packages/order-watcher/src/types.ts b/packages/order-watcher/src/types.ts
index 27d892985..8078dd971 100644
--- a/packages/order-watcher/src/types.ts
+++ b/packages/order-watcher/src/types.ts
@@ -1,4 +1,4 @@
-import { OrderState } from '@0xproject/types';
+import { OrderState } from '@0x/types';
import { LogEntryEvent } from 'ethereum-types';
export enum OrderWatcherError {
diff --git a/packages/order-watcher/src/utils/assert.ts b/packages/order-watcher/src/utils/assert.ts
index e4a1e2c7b..ccfc7325c 100644
--- a/packages/order-watcher/src/utils/assert.ts
+++ b/packages/order-watcher/src/utils/assert.ts
@@ -1,13 +1,13 @@
-import { assert as sharedAssert } from '@0xproject/assert';
+import { assert as sharedAssert } from '@0x/assert';
// HACK: We need those two unused imports because they're actually used by sharedAssert which gets injected here
// tslint:disable:no-unused-variable
-import { Schema } from '@0xproject/json-schemas';
-import { ECSignature } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
+import { Schema } from '@0x/json-schemas';
+import { ECSignature } from '@0x/types';
+import { BigNumber } from '@0x/utils';
// tslint:enable:no-unused-variable
import { Provider } from 'ethereum-types';
-import { signatureUtils } from '@0xproject/order-utils';
+import { signatureUtils } from '@0x/order-utils';
export const assert = {
...sharedAssert,
diff --git a/packages/order-watcher/src/utils/utils.ts b/packages/order-watcher/src/utils/utils.ts
index 087fc635e..a7d10aaf9 100644
--- a/packages/order-watcher/src/utils/utils.ts
+++ b/packages/order-watcher/src/utils/utils.ts
@@ -1,4 +1,4 @@
-import { BigNumber } from '@0xproject/utils';
+import { BigNumber } from '@0x/utils';
export const utils = {
getCurrentUnixTimestampSec(): BigNumber {
diff --git a/packages/order-watcher/test/expiration_watcher_test.ts b/packages/order-watcher/test/expiration_watcher_test.ts
index ea9923487..fb5ea2a27 100644
--- a/packages/order-watcher/test/expiration_watcher_test.ts
+++ b/packages/order-watcher/test/expiration_watcher_test.ts
@@ -1,10 +1,9 @@
-import { ContractWrappers } from '@0xproject/contract-wrappers';
-import { tokenUtils } from '@0xproject/contract-wrappers/lib/test/utils/token_utils';
-import { BlockchainLifecycle, callbackErrorReporter } from '@0xproject/dev-utils';
-import { FillScenarios } from '@0xproject/fill-scenarios';
-import { assetDataUtils, orderHashUtils } from '@0xproject/order-utils';
-import { DoneCallback } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
+import { tokenUtils } from '@0x/contract-wrappers/lib/test/utils/token_utils';
+import { BlockchainLifecycle, callbackErrorReporter } from '@0x/dev-utils';
+import { FillScenarios } from '@0x/fill-scenarios';
+import { assetDataUtils, orderHashUtils } from '@0x/order-utils';
+import { DoneCallback } from '@0x/types';
+import { BigNumber } from '@0x/utils';
import * as chai from 'chai';
import * as _ from 'lodash';
import 'mocha';
@@ -14,7 +13,7 @@ import { ExpirationWatcher } from '../src/order_watcher/expiration_watcher';
import { utils } from '../src/utils/utils';
import { chaiSetup } from './utils/chai_setup';
-import { constants } from './utils/constants';
+import { migrateOnceAsync } from './utils/migrate';
import { provider, web3Wrapper } from './utils/web3_wrapper';
chaiSetup.configure();
@@ -23,14 +22,8 @@ const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
const MILISECONDS_IN_SECOND = 1000;
describe('ExpirationWatcher', () => {
- const config = {
- networkId: constants.TESTRPC_NETWORK_ID,
- };
- const contractWrappers = new ContractWrappers(provider, config);
let userAddresses: string[];
- let zrxTokenAddress: string;
let fillScenarios: FillScenarios;
- const exchangeContractAddress = contractWrappers.exchange.getContractAddress();
let makerAssetData: string;
let takerAssetData: string;
let coinbase: string;
@@ -42,16 +35,16 @@ describe('ExpirationWatcher', () => {
let timer: Sinon.SinonFakeTimers;
let expirationWatcher: ExpirationWatcher;
before(async () => {
+ const contractAddresses = await migrateOnceAsync();
await blockchainLifecycle.startAsync();
userAddresses = await web3Wrapper.getAvailableAddressesAsync();
- zrxTokenAddress = tokenUtils.getProtocolTokenAddress();
fillScenarios = new FillScenarios(
provider,
userAddresses,
- zrxTokenAddress,
- exchangeContractAddress,
- contractWrappers.erc20Proxy.getContractAddress(),
- contractWrappers.erc721Proxy.getContractAddress(),
+ contractAddresses.zrxToken,
+ contractAddresses.exchange,
+ contractAddresses.erc20Proxy,
+ contractAddresses.erc721Proxy,
);
[coinbase, makerAddress, takerAddress, feeRecipient] = userAddresses;
const [makerTokenAddress, takerTokenAddress] = tokenUtils.getDummyERC20TokenAddresses();
diff --git a/packages/order-watcher/test/global_hooks.ts b/packages/order-watcher/test/global_hooks.ts
index 99df04a51..26c37158f 100644
--- a/packages/order-watcher/test/global_hooks.ts
+++ b/packages/order-watcher/test/global_hooks.ts
@@ -1,17 +1,6 @@
-import { devConstants } from '@0xproject/dev-utils';
-import { runV2MigrationsAsync } from '@0xproject/migrations';
-
-import { provider } from './utils/web3_wrapper';
-
-before('migrate contracts', async function(): Promise<void> {
+before('set up mocha', async function(): Promise<void> {
// HACK: Since the migrations take longer then our global mocha timeout limit
// we manually increase it for this before hook.
const mochaTestTimeoutMs = 25000;
this.timeout(mochaTestTimeoutMs); // tslint:disable-line:no-invalid-this
- const txDefaults = {
- gas: devConstants.GAS_LIMIT,
- from: devConstants.TESTRPC_FIRST_ADDRESS,
- };
- const artifactsDir = `src/artifacts`;
- await runV2MigrationsAsync(provider, artifactsDir, txDefaults);
});
diff --git a/packages/order-watcher/test/order_watcher_test.ts b/packages/order-watcher/test/order_watcher_test.ts
index 60d9069e8..271e5dec5 100644
--- a/packages/order-watcher/test/order_watcher_test.ts
+++ b/packages/order-watcher/test/order_watcher_test.ts
@@ -1,9 +1,9 @@
// tslint:disable:no-unnecessary-type-assertion
-import { ContractWrappers } from '@0xproject/contract-wrappers';
-import { tokenUtils } from '@0xproject/contract-wrappers/lib/test/utils/token_utils';
-import { BlockchainLifecycle, callbackErrorReporter } from '@0xproject/dev-utils';
-import { FillScenarios } from '@0xproject/fill-scenarios';
-import { assetDataUtils, orderHashUtils } from '@0xproject/order-utils';
+import { ContractWrappers } from '@0x/contract-wrappers';
+import { tokenUtils } from '@0x/contract-wrappers/lib/test/utils/token_utils';
+import { BlockchainLifecycle, callbackErrorReporter } from '@0x/dev-utils';
+import { FillScenarios } from '@0x/fill-scenarios';
+import { assetDataUtils, orderHashUtils } from '@0x/order-utils';
import {
DoneCallback,
ExchangeContractErrs,
@@ -11,9 +11,9 @@ import {
OrderStateInvalid,
OrderStateValid,
SignedOrder,
-} from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+} from '@0x/types';
+import { BigNumber } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import * as chai from 'chai';
import * as _ from 'lodash';
import 'mocha';
@@ -27,6 +27,7 @@ import { OrderWatcherError } from '../src/types';
import { chaiSetup } from './utils/chai_setup';
import { constants } from './utils/constants';
+import { migrateOnceAsync } from './utils/migrate';
import { provider, web3Wrapper } from './utils/web3_wrapper';
const TIMEOUT_MS = 150;
@@ -36,13 +37,10 @@ const expect = chai.expect;
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
describe('OrderWatcher', () => {
- const networkId = constants.TESTRPC_NETWORK_ID;
- const config = { networkId };
- const contractWrappers = new ContractWrappers(provider, config);
+ let contractWrappers: ContractWrappers;
let fillScenarios: FillScenarios;
let userAddresses: string[];
let zrxTokenAddress: string;
- let exchangeContractAddress: string;
let makerAssetData: string;
let takerAssetData: string;
let makerTokenAddress: string;
@@ -56,17 +54,23 @@ describe('OrderWatcher', () => {
const decimals = constants.ZRX_DECIMALS;
const fillableAmount = Web3Wrapper.toBaseUnitAmount(new BigNumber(5), decimals);
before(async () => {
+ const contractAddresses = await migrateOnceAsync();
await blockchainLifecycle.startAsync();
+ const networkId = constants.TESTRPC_NETWORK_ID;
+ const config = {
+ networkId,
+ contractAddresses,
+ };
+ contractWrappers = new ContractWrappers(provider, config);
userAddresses = await web3Wrapper.getAvailableAddressesAsync();
- zrxTokenAddress = tokenUtils.getProtocolTokenAddress();
- exchangeContractAddress = contractWrappers.exchange.getContractAddress();
+ zrxTokenAddress = contractAddresses.zrxToken;
fillScenarios = new FillScenarios(
provider,
userAddresses,
zrxTokenAddress,
- exchangeContractAddress,
- contractWrappers.erc20Proxy.getContractAddress(),
- contractWrappers.erc721Proxy.getContractAddress(),
+ contractAddresses.exchange,
+ contractAddresses.erc20Proxy,
+ contractAddresses.erc721Proxy,
);
[coinbase, makerAddress, takerAddress, feeRecipient] = userAddresses;
[makerTokenAddress, takerTokenAddress] = tokenUtils.getDummyERC20TokenAddresses();
@@ -75,7 +79,7 @@ describe('OrderWatcher', () => {
assetDataUtils.encodeERC20AssetData(takerTokenAddress),
];
const orderWatcherConfig = {};
- orderWatcher = new OrderWatcher(provider, networkId, orderWatcherConfig);
+ orderWatcher = new OrderWatcher(provider, networkId, contractAddresses, orderWatcherConfig);
});
after(async () => {
await blockchainLifecycle.revertAsync();
@@ -140,6 +144,23 @@ describe('OrderWatcher', () => {
expect(() => orderWatcher.subscribe(_.noop.bind(_))).to.throw(OrderWatcherError.SubscriptionAlreadyPresent);
});
});
+ describe('#getStats', async () => {
+ it('orderCount should increment and decrement with order additions and removals', async () => {
+ signedOrder = await fillScenarios.createFillableSignedOrderAsync(
+ makerAssetData,
+ takerAssetData,
+ makerAddress,
+ takerAddress,
+ fillableAmount,
+ );
+ const orderHash = orderHashUtils.getOrderHashHex(signedOrder);
+ expect(orderWatcher.getStats().orderCount).to.be.eq(0);
+ await orderWatcher.addOrderAsync(signedOrder);
+ expect(orderWatcher.getStats().orderCount).to.be.eq(1);
+ orderWatcher.removeOrder(orderHash);
+ expect(orderWatcher.getStats().orderCount).to.be.eq(0);
+ });
+ });
describe('tests with cleanup', async () => {
afterEach(async () => {
orderWatcher.unsubscribe();
diff --git a/packages/order-watcher/test/utils/migrate.ts b/packages/order-watcher/test/utils/migrate.ts
new file mode 100644
index 000000000..665ce0faa
--- /dev/null
+++ b/packages/order-watcher/test/utils/migrate.ts
@@ -0,0 +1,18 @@
+import { ContractAddresses } from '@0x/contract-addresses';
+import { devConstants } from '@0x/dev-utils';
+import { runMigrationsOnceAsync } from '@0x/migrations';
+
+import { provider } from './web3_wrapper';
+
+/**
+ * Configures and runs the migrations exactly once. Any subsequent times this is
+ * called, it returns the cached addresses.
+ * @returns The addresses of contracts that were deployed during the migrations.
+ */
+export async function migrateOnceAsync(): Promise<ContractAddresses> {
+ const txDefaults = {
+ gas: devConstants.GAS_LIMIT,
+ from: devConstants.TESTRPC_FIRST_ADDRESS,
+ };
+ return runMigrationsOnceAsync(provider, txDefaults);
+}
diff --git a/packages/order-watcher/test/utils/token_utils.ts b/packages/order-watcher/test/utils/token_utils.ts
deleted file mode 100644
index f91b3797f..000000000
--- a/packages/order-watcher/test/utils/token_utils.ts
+++ /dev/null
@@ -1,34 +0,0 @@
-import { Token } from '@0xproject/types';
-import * as _ from 'lodash';
-
-import { InternalOrderWatcherError } from '../../src/types';
-
-const PROTOCOL_TOKEN_SYMBOL = 'ZRX';
-const WETH_TOKEN_SYMBOL = 'WETH';
-
-export class TokenUtils {
- private readonly _tokens: Token[];
- constructor(tokens: Token[]) {
- this._tokens = tokens;
- }
- public getProtocolTokenOrThrow(): Token {
- const zrxToken = _.find(this._tokens, { symbol: PROTOCOL_TOKEN_SYMBOL });
- if (_.isUndefined(zrxToken)) {
- throw new Error(InternalOrderWatcherError.ZrxNotInTokenRegistry);
- }
- return zrxToken;
- }
- public getWethTokenOrThrow(): Token {
- const wethToken = _.find(this._tokens, { symbol: WETH_TOKEN_SYMBOL });
- if (_.isUndefined(wethToken)) {
- throw new Error(InternalOrderWatcherError.WethNotInTokenRegistry);
- }
- return wethToken;
- }
- public getDummyTokens(): Token[] {
- const dummyTokens = _.filter(this._tokens, token => {
- return !_.includes([PROTOCOL_TOKEN_SYMBOL, WETH_TOKEN_SYMBOL], token.symbol);
- });
- return dummyTokens;
- }
-}
diff --git a/packages/order-watcher/test/utils/web3_wrapper.ts b/packages/order-watcher/test/utils/web3_wrapper.ts
index ab801fa7f..accfcb7fe 100644
--- a/packages/order-watcher/test/utils/web3_wrapper.ts
+++ b/packages/order-watcher/test/utils/web3_wrapper.ts
@@ -1,5 +1,5 @@
-import { web3Factory } from '@0xproject/dev-utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { web3Factory } from '@0x/dev-utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import { Provider } from 'ethereum-types';
const provider: Provider = web3Factory.getRpcProvider({ shouldUseInProcessGanache: true });
diff --git a/packages/order-watcher/tslint.json b/packages/order-watcher/tslint.json
index 059573ce7..4ade3b924 100644
--- a/packages/order-watcher/tslint.json
+++ b/packages/order-watcher/tslint.json
@@ -2,5 +2,5 @@
"rules": {
"prefer-readonly": true
},
- "extends": ["@0xproject/tslint-config"]
+ "extends": ["@0x/tslint-config"]
}
diff --git a/packages/react-docs/CHANGELOG.json b/packages/react-docs/CHANGELOG.json
index ac3f22716..228dfab4f 100644
--- a/packages/react-docs/CHANGELOG.json
+++ b/packages/react-docs/CHANGELOG.json
@@ -1,5 +1,23 @@
[
{
+ "version": "1.0.15",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ],
+ "timestamp": 1541740904
+ },
+ {
+ "timestamp": 1539871071,
+ "version": "1.0.14",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
"version": "1.0.13",
"changes": [
{
diff --git a/packages/react-docs/CHANGELOG.md b/packages/react-docs/CHANGELOG.md
index 485bf61a6..991b3a490 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.15 - _November 9, 2018_
+
+ * Dependencies updated
+
+## v1.0.14 - _October 18, 2018_
+
+ * Dependencies updated
+
## v1.0.13 - _October 4, 2018_
* Dependencies updated
@@ -37,7 +45,7 @@ CHANGELOG
* Dependencies updated
-## v1.0.5 - _August 13, 2018_
+## v1.0.5 - _August 14, 2018_
* Dependencies updated
diff --git a/packages/react-docs/README.md b/packages/react-docs/README.md
index 51e949967..19c092e4d 100644
--- a/packages/react-docs/README.md
+++ b/packages/react-docs/README.md
@@ -1,4 +1,4 @@
-## @0xproject/react-docs
+## @0x/react-docs
#### WARNING: Alpha software. Expect things to break when trying to use.
@@ -24,7 +24,7 @@ A full-page React component for rendering beautiful documentation for Solidity a
## Installation
```bash
-yarn add @0xproject/react-docs
+yarn add @0x/react-docs
```
## Usage
@@ -37,7 +37,7 @@ If your project is in [TypeScript](https://www.typescriptlang.org/), add the fol
```json
"compilerOptions": {
- "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"],
+ "typeRoots": ["node_modules/@0x/typescript-typings/types", "node_modules/@types"],
}
```
@@ -74,13 +74,13 @@ yarn install
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
```bash
-PKG=@0xproject/react-docs yarn build
+PKG=@0x/react-docs yarn build
```
Or continuously rebuild on change:
```bash
-PKG=@0xproject/react-docs yarn watch
+PKG=@0x/react-docs yarn watch
```
### Clean
diff --git a/packages/react-docs/package.json b/packages/react-docs/package.json
index 1f8b77e2c..827a54fdb 100644
--- a/packages/react-docs/package.json
+++ b/packages/react-docs/package.json
@@ -1,6 +1,6 @@
{
- "name": "@0xproject/react-docs",
- "version": "1.0.13",
+ "name": "@0x/react-docs",
+ "version": "1.0.15",
"engines": {
"node": ">=6.12"
},
@@ -8,7 +8,7 @@
"main": "lib/index.js",
"types": "lib/index.d.ts",
"scripts": {
- "lint": "tslint --project .",
+ "lint": "tslint --format stylish --project .",
"build": "tsc -b",
"build:ci": "yarn build",
"clean": "shx rm -rf lib"
@@ -24,19 +24,19 @@
"url": "https://github.com/0xProject/0x-monorepo.git"
},
"devDependencies": {
- "@0xproject/dev-utils": "^1.0.12",
- "@0xproject/tslint-config": "^1.0.8",
+ "@0x/dev-utils": "^1.0.14",
+ "@0x/tslint-config": "^1.0.10",
"@types/compare-versions": "^3.0.0",
- "copyfiles": "^2.0.0",
+ "@types/styled-components": "^4.0.0",
"make-promises-safe": "^1.1.0",
"shx": "^0.2.2",
"tslint": "^5.9.1",
"typescript": "3.0.1"
},
"dependencies": {
- "@0xproject/react-shared": "^1.0.15",
- "@0xproject/types": "^1.1.4",
- "@0xproject/utils": "^2.0.2",
+ "@0x/react-shared": "^1.0.18",
+ "@0x/types": "^1.2.1",
+ "@0x/utils": "^2.0.4",
"@types/lodash": "4.14.104",
"@types/material-ui": "^0.20.0",
"@types/node": "*",
@@ -50,9 +50,10 @@
"react": "^16.4.2",
"react-dom": "^16.4.2",
"react-markdown": "^3.2.2",
- "react-scroll": "0xproject/react-scroll#similar-to-pr-330",
+ "react-scroll": "0xproject/react-scroll#pr-330-and-replace-state",
"react-tooltip": "^3.2.7",
- "semver": "5.5.0"
+ "semver": "5.5.0",
+ "styled-components": "^3.3.0"
},
"publishConfig": {
"access": "public"
diff --git a/packages/react-docs/src/components/badge.tsx b/packages/react-docs/src/components/badge.tsx
index d34f8a0fc..e3d5be273 100644
--- a/packages/react-docs/src/components/badge.tsx
+++ b/packages/react-docs/src/components/badge.tsx
@@ -1,4 +1,4 @@
-import { Styles } from '@0xproject/react-shared';
+import { Styles } from '@0x/react-shared';
import * as React from 'react';
const styles: Styles = {
diff --git a/packages/react-docs/src/components/comment.tsx b/packages/react-docs/src/components/comment.tsx
index c3687c510..4d34f711e 100644
--- a/packages/react-docs/src/components/comment.tsx
+++ b/packages/react-docs/src/components/comment.tsx
@@ -1,4 +1,4 @@
-import { MarkdownCodeBlock } from '@0xproject/react-shared';
+import { colors, MarkdownCodeBlock } from '@0x/react-shared';
import * as React from 'react';
import * as ReactMarkdown from 'react-markdown';
@@ -13,7 +13,7 @@ const defaultProps = {
export const Comment: React.SFC<CommentProps> = (props: CommentProps) => {
return (
- <div className={`${props.className} comment`}>
+ <div className={`${props.className} comment`} style={{ color: colors.greyTheme }}>
<ReactMarkdown source={props.comment} renderers={{ code: MarkdownCodeBlock }} />
</div>
);
diff --git a/packages/react-docs/src/components/custom_enum.tsx b/packages/react-docs/src/components/custom_enum.tsx
index fa7c43146..e971a012a 100644
--- a/packages/react-docs/src/components/custom_enum.tsx
+++ b/packages/react-docs/src/components/custom_enum.tsx
@@ -1,8 +1,8 @@
-import { logUtils } from '@0xproject/utils';
+import { logUtils } from '@0x/utils';
import * as _ from 'lodash';
import * as React from 'react';
-import { CustomType } from '@0xproject/types';
+import { CustomType } from '@0x/types';
const STRING_ENUM_CODE_PREFIX = ' strEnum(';
diff --git a/packages/react-docs/src/components/documentation.tsx b/packages/react-docs/src/components/doc_reference.tsx
index a23111297..85547576b 100644
--- a/packages/react-docs/src/components/documentation.tsx
+++ b/packages/react-docs/src/components/doc_reference.tsx
@@ -2,13 +2,13 @@ import {
colors,
constants as sharedConstants,
EtherscanLinkSuffixes,
+ HeaderSizes,
+ Link,
MarkdownSection,
- NestedSidebarMenu,
Networks,
SectionHeader,
- Styles,
utils as sharedUtils,
-} from '@0xproject/react-shared';
+} from '@0x/react-shared';
import {
DocAgnosticFormat,
Event,
@@ -18,9 +18,8 @@ import {
TypeDefinitionByName,
TypescriptFunction,
TypescriptMethod,
-} from '@0xproject/types';
+} from '@0x/types';
import * as _ from 'lodash';
-import CircularProgress from 'material-ui/CircularProgress';
import * as React from 'react';
import * as semver from 'semver';
@@ -42,142 +41,36 @@ const networkNameToColor: { [network: string]: string } = {
[Networks.Rinkeby]: colors.darkYellow,
};
-export interface DocumentationProps {
+export interface DocReferenceProps {
selectedVersion: string;
availableVersions: string[];
docsInfo: DocsInfo;
sourceUrl: string;
- onVersionSelected: (semver: string) => void;
docAgnosticFormat?: DocAgnosticFormat;
- sidebarHeader?: React.ReactNode;
- topBarHeight?: number;
}
-export interface DocumentationState {
- isHoveringSidebar: boolean;
-}
+export interface DocReferenceState {}
-export class Documentation extends React.Component<DocumentationProps, DocumentationState> {
- public static defaultProps: Partial<DocumentationProps> = {
- topBarHeight: 0,
- };
- constructor(props: DocumentationProps) {
- super(props);
- this.state = {
- isHoveringSidebar: false,
- };
- }
- public componentDidMount(): void {
- window.addEventListener('hashchange', this._onHashChanged.bind(this), false);
- }
- public componentWillUnmount(): void {
- window.removeEventListener('hashchange', this._onHashChanged.bind(this), false);
- }
- public componentDidUpdate(prevProps: DocumentationProps, _prevState: DocumentationState): void {
+export class DocReference extends React.Component<DocReferenceProps, DocReferenceState> {
+ public componentDidUpdate(prevProps: DocReferenceProps, _prevState: DocReferenceState): void {
if (!_.isEqual(prevProps.docAgnosticFormat, this.props.docAgnosticFormat)) {
const hash = window.location.hash.slice(1);
sharedUtils.scrollToHash(hash, sharedConstants.SCROLL_CONTAINER_ID);
}
}
public render(): React.ReactNode {
- const styles: Styles = {
- mainContainers: {
- position: 'absolute',
- top: 1,
- left: 0,
- bottom: 0,
- right: 0,
- overflowX: 'hidden',
- overflowY: 'scroll',
- minHeight: `calc(100vh - ${this.props.topBarHeight}px)`,
- WebkitOverflowScrolling: 'touch',
- },
- menuContainer: {
- borderColor: colors.grey300,
- maxWidth: 330,
- marginLeft: 20,
- },
- };
- const menuSubsectionsBySection = this.props.docsInfo.getMenuSubsectionsBySection(this.props.docAgnosticFormat);
- return (
- <div>
- {_.isUndefined(this.props.docAgnosticFormat) ? (
- this._renderLoading(styles.mainContainers)
- ) : (
- <div style={{ width: '100%', height: '100%', backgroundColor: colors.gray40 }}>
- <div
- className="mx-auto max-width-4 flex"
- style={{ color: colors.grey800, height: `calc(100vh - ${this.props.topBarHeight}px)` }}
- >
- <div
- className="relative sm-hide xs-hide"
- style={{ width: '36%', height: `calc(100vh - ${this.props.topBarHeight}px)` }}
- >
- <div
- className="border-right absolute"
- style={{
- ...styles.menuContainer,
- ...styles.mainContainers,
- height: `calc(100vh - ${this.props.topBarHeight}px)`,
- overflow: this.state.isHoveringSidebar ? 'auto' : 'hidden',
- }}
- onMouseEnter={this._onSidebarHover.bind(this)}
- onMouseLeave={this._onSidebarHoverOff.bind(this)}
- >
- <NestedSidebarMenu
- selectedVersion={this.props.selectedVersion}
- versions={this.props.availableVersions}
- sidebarHeader={this.props.sidebarHeader}
- topLevelMenu={this.props.docsInfo.menu}
- menuSubsectionsBySection={menuSubsectionsBySection}
- onVersionSelected={this.props.onVersionSelected}
- />
- </div>
- </div>
- <div
- className="relative col lg-col-9 md-col-9 sm-col-12 col-12"
- style={{ backgroundColor: colors.white }}
- >
- <div
- id={sharedConstants.SCROLL_CONTAINER_ID}
- style={styles.mainContainers}
- className="absolute px1"
- >
- <div id={sharedConstants.SCROLL_TOP_ID} />
- {this._renderDocumentation()}
- </div>
- </div>
- </div>
- </div>
- )}
- </div>
- );
- }
- private _renderLoading(mainContainersStyles: React.CSSProperties): React.ReactNode {
- return (
- <div className="col col-12" style={mainContainersStyles}>
- <div
- className="relative sm-px2 sm-pt2 sm-m1"
- style={{ height: 122, top: '50%', transform: 'translateY(-50%)' }}
- >
- <div className="center pb2">
- <CircularProgress size={40} thickness={5} />
- </div>
- <div className="center pt2" style={{ paddingBottom: 11 }}>
- Loading documentation...
- </div>
- </div>
- </div>
- );
- }
- private _renderDocumentation(): React.ReactNode {
- const subMenus = _.values(this.props.docsInfo.menu);
+ const subMenus = _.values(this.props.docsInfo.markdownMenu);
const orderedSectionNames = _.flatten(subMenus);
const typeDefinitionByName = this.props.docsInfo.getTypeDefinitionsByName(this.props.docAgnosticFormat);
const renderedSections = _.map(orderedSectionNames, this._renderSection.bind(this, typeDefinitionByName));
- return renderedSections;
+ return (
+ <div>
+ <div id={sharedConstants.SCROLL_TOP_ID} />
+ {renderedSections}
+ </div>
+ );
}
private _renderSection(typeDefinitionByName: TypeDefinitionByName, sectionName: string): React.ReactNode {
const markdownVersions = _.keys(this.props.docsInfo.sectionNameToMarkdownByVersion);
@@ -195,11 +88,16 @@ export class Documentation extends React.Component<DocumentationProps, Documenta
const closestVersion = sortedEligibleVersions[0];
const markdownFileIfExists = this.props.docsInfo.sectionNameToMarkdownByVersion[closestVersion][sectionName];
if (!_.isUndefined(markdownFileIfExists)) {
+ // Special-case replace the `introduction` sectionName with the package name
+ const isIntroductionSection = sectionName === 'introduction';
+ const headerSize = isIntroductionSection ? HeaderSizes.H1 : HeaderSizes.H3;
return (
<MarkdownSection
key={`markdown-section-${sectionName}`}
sectionName={sectionName}
+ headerSize={headerSize}
markdownContent={markdownFileIfExists}
+ alternativeSectionTitle={isIntroductionSection ? this.props.docsInfo.displayName : undefined}
/>
);
}
@@ -290,7 +188,9 @@ export class Documentation extends React.Component<DocumentationProps, Documenta
)}
{!_.isEmpty(docSection.functions) && (
<div>
- {!isExportedFunctionSection && <h2 style={headerStyle}>Functions</h2>}
+ {!isExportedFunctionSection && (
+ <div style={{ ...headerStyle, fontSize: '1.5em' }}>Functions</div>
+ )}
<div>{functionDefs}</div>
</div>
)}
@@ -309,6 +209,15 @@ export class Documentation extends React.Component<DocumentationProps, Documenta
<div>{typeDefs}</div>
</div>
)}
+ <div
+ style={{
+ width: '100%',
+ height: 1,
+ backgroundColor: colors.grey300,
+ marginTop: 32,
+ marginBottom: 12,
+ }}
+ />
</div>
);
}
@@ -318,9 +227,9 @@ export class Documentation extends React.Component<DocumentationProps, Documenta
<div className="pt2" key={`external-export-${exportName}`}>
<code className={`hljs ${constants.TYPE_TO_SYNTAX[this.props.docsInfo.type]}`}>
{`import { `}
- <a href={link} target="_blank" style={{ color: colors.lightBlueA700, textDecoration: 'none' }}>
+ <Link to={link} shouldOpenInNewTab={true} fontColor={colors.lightBlueA700}>
{exportName}
- </a>
+ </Link>
{` } from '${this.props.docsInfo.packageName}'`}
</code>
</div>
@@ -349,14 +258,16 @@ export class Documentation extends React.Component<DocumentationProps, Documenta
EtherscanLinkSuffixes.Address,
);
return (
- <a
- key={`badge-${networkName}-${sectionName}`}
- href={linkIfExists}
- target="_blank"
- style={{ color: colors.white, textDecoration: 'none', marginTop: 8 }}
- >
- <Badge title={networkName} backgroundColor={networkNameToColor[networkName]} />
- </a>
+ <div style={{ marginTop: 8 }}>
+ <Link
+ key={`badge-${networkName}-${sectionName}`}
+ to={linkIfExists}
+ shouldOpenInNewTab={true}
+ fontColor={colors.white}
+ >
+ <Badge title={networkName} backgroundColor={networkNameToColor[networkName]} />
+ </Link>
+ </div>
);
},
);
@@ -406,18 +317,4 @@ export class Documentation extends React.Component<DocumentationProps, Documenta
/>
);
}
- private _onSidebarHover(_event: React.FormEvent<HTMLInputElement>): void {
- this.setState({
- isHoveringSidebar: true,
- });
- }
- private _onSidebarHoverOff(): void {
- this.setState({
- isHoveringSidebar: false,
- });
- }
- private _onHashChanged(_event: any): void {
- const hash = window.location.hash.slice(1);
- sharedUtils.scrollToHash(hash, sharedConstants.SCROLL_CONTAINER_ID);
- }
}
diff --git a/packages/react-docs/src/components/event_definition.tsx b/packages/react-docs/src/components/event_definition.tsx
index 37236275b..b76769788 100644
--- a/packages/react-docs/src/components/event_definition.tsx
+++ b/packages/react-docs/src/components/event_definition.tsx
@@ -1,5 +1,5 @@
-import { AnchorTitle, colors, HeaderSizes } from '@0xproject/react-shared';
-import { Event, EventArg } from '@0xproject/types';
+import { AnchorTitle, colors, HeaderSizes } from '@0x/react-shared';
+import { Event, EventArg } from '@0x/types';
import * as _ from 'lodash';
import * as React from 'react';
diff --git a/packages/react-docs/src/components/interface.tsx b/packages/react-docs/src/components/interface.tsx
index cad7d6c46..0df44ca1c 100644
--- a/packages/react-docs/src/components/interface.tsx
+++ b/packages/react-docs/src/components/interface.tsx
@@ -1,7 +1,7 @@
import * as _ from 'lodash';
import * as React from 'react';
-import { CustomType, TypeDefinitionByName } from '@0xproject/types';
+import { CustomType, TypeDefinitionByName } from '@0x/types';
import { DocsInfo } from '../docs_info';
diff --git a/packages/react-docs/src/components/property_block.tsx b/packages/react-docs/src/components/property_block.tsx
index 8434e8682..d0bd84802 100644
--- a/packages/react-docs/src/components/property_block.tsx
+++ b/packages/react-docs/src/components/property_block.tsx
@@ -1,5 +1,5 @@
-import { AnchorTitle, HeaderSizes } from '@0xproject/react-shared';
-import { Property, TypeDefinitionByName } from '@0xproject/types';
+import { AnchorTitle, HeaderSizes } from '@0x/react-shared';
+import { Property, TypeDefinitionByName } from '@0x/types';
import * as React from 'react';
import { DocsInfo } from '../docs_info';
diff --git a/packages/react-docs/src/components/signature.tsx b/packages/react-docs/src/components/signature.tsx
index 1f3dd0ee8..c229999b1 100644
--- a/packages/react-docs/src/components/signature.tsx
+++ b/packages/react-docs/src/components/signature.tsx
@@ -1,7 +1,7 @@
import * as _ from 'lodash';
import * as React from 'react';
-import { Parameter, Type as TypeDef, TypeDefinitionByName, TypeParameter } from '@0xproject/types';
+import { Parameter, Type as TypeDef, TypeDefinitionByName, TypeParameter } from '@0x/types';
import { DocsInfo } from '../docs_info';
diff --git a/packages/react-docs/src/components/signature_block.tsx b/packages/react-docs/src/components/signature_block.tsx
index 5ec82983a..7cdf19bb0 100644
--- a/packages/react-docs/src/components/signature_block.tsx
+++ b/packages/react-docs/src/components/signature_block.tsx
@@ -1,11 +1,5 @@
-import { AnchorTitle, colors, HeaderSizes, Styles } from '@0xproject/react-shared';
-import {
- Parameter,
- SolidityMethod,
- TypeDefinitionByName,
- TypescriptFunction,
- TypescriptMethod,
-} from '@0xproject/types';
+import { AnchorTitle, colors, HeaderSizes, Styles } from '@0x/react-shared';
+import { Parameter, SolidityMethod, TypeDefinitionByName, TypescriptFunction, TypescriptMethod } from '@0x/types';
import * as _ from 'lodash';
import * as React from 'react';
@@ -55,7 +49,7 @@ export class SignatureBlock extends React.Component<SignatureBlockProps, Signatu
<div
id={`${this.props.sectionName}-${method.name}`}
style={{ overflow: 'hidden', width: '100%' }}
- className="pb4"
+ className="pb4 pt2"
onMouseOver={this._setAnchorVisibility.bind(this, true)}
onMouseOut={this._setAnchorVisibility.bind(this, false)}
>
diff --git a/packages/react-docs/src/components/source_link.tsx b/packages/react-docs/src/components/source_link.tsx
index 3096ad8d5..6459824c2 100644
--- a/packages/react-docs/src/components/source_link.tsx
+++ b/packages/react-docs/src/components/source_link.tsx
@@ -1,5 +1,5 @@
-import { colors } from '@0xproject/react-shared';
-import { Source } from '@0xproject/types';
+import { colors, Link } from '@0x/react-shared';
+import { Source } from '@0x/types';
import * as React from 'react';
export interface SourceLinkProps {
@@ -13,9 +13,9 @@ export const SourceLink = (props: SourceLinkProps) => {
const sourceCodeUrl = `${props.sourceUrl}/${src.fileName}#L${src.line}`;
return (
<div className="pt2" style={{ fontSize: 14 }}>
- <a href={sourceCodeUrl} target="_blank" className="underline" style={{ color: colors.grey }}>
- Source
- </a>
+ <Link to={sourceCodeUrl} shouldOpenInNewTab={true} textDecoration="underline" fontColor={colors.grey}>
+ {'Source'}
+ </Link>
</div>
);
};
diff --git a/packages/react-docs/src/components/type.tsx b/packages/react-docs/src/components/type.tsx
index 5c018f5dd..412b99b9d 100644
--- a/packages/react-docs/src/components/type.tsx
+++ b/packages/react-docs/src/components/type.tsx
@@ -1,6 +1,6 @@
-import { colors, constants as sharedConstants, utils as sharedUtils } from '@0xproject/react-shared';
-import { Type as TypeDef, TypeDefinitionByName, TypeDocTypes } from '@0xproject/types';
-import { errorUtils } from '@0xproject/utils';
+import { colors, constants as sharedConstants, Link, utils as sharedUtils } from '@0x/react-shared';
+import { Type as TypeDef, TypeDefinitionByName, TypeDocTypes } from '@0x/types';
+import { errorUtils } from '@0x/utils';
import * as _ from 'lodash';
import * as React from 'react';
import { Link as ScrollLink } from 'react-scroll';
@@ -204,15 +204,12 @@ export const Type: React.SFC<TypeProps> = (props: TypeProps): any => {
const isExportedClassReference = !!props.type.isExportedClassReference;
const typeNameUrlIfExists = !_.isUndefined(props.type.externalLink) ? props.type.externalLink : undefined;
if (!_.isUndefined(typeNameUrlIfExists)) {
- typeName = (
- <a
- href={typeNameUrlIfExists}
- target="_blank"
- className="text-decoration-none"
- style={{ color: colors.lightBlueA700 }}
- >
+ typeName = props.isInPopover ? (
+ <span style={{ color: colors.lightBlueA700, cursor: 'pointer' }}>{typeName}</span>
+ ) : (
+ <Link to={typeNameUrlIfExists} shouldOpenInNewTab={true} fontColor={colors.lightBlueA700}>
{typeName}
- </a>
+ </Link>
);
} else if (
(isReference || isArray) &&
@@ -223,39 +220,41 @@ export const Type: React.SFC<TypeProps> = (props: TypeProps): any => {
? props.type.name
: `${props.docsInfo.typeSectionName}-${typeName}`;
typeName = (
- <ScrollLink
- to={typeDefinitionAnchorId}
- offset={0}
- hashSpy={true}
- duration={sharedConstants.DOCS_SCROLL_DURATION_MS}
- containerId={sharedConstants.DOCS_CONTAINER_ID}
- >
+ <span>
{sharedUtils.isUserOnMobile() || props.isInPopover || isExportedClassReference ? (
<span style={{ color: colors.lightBlueA700, cursor: 'pointer' }}>{typeName}</span>
) : (
- <span
- data-tip={true}
- data-for={id}
- style={{
- color: colors.lightBlueA700,
- cursor: 'pointer',
- display: 'inline-block',
- }}
+ <ScrollLink
+ to={typeDefinitionAnchorId}
+ offset={0}
+ hashSpy={true}
+ duration={sharedConstants.DOCS_SCROLL_DURATION_MS}
+ containerId={sharedConstants.SCROLL_CONTAINER_ID}
>
- {typeName}
- <ReactTooltip type="light" effect="solid" id={id} className="typeTooltip">
- <TypeDefinition
- sectionName={props.sectionName}
- customType={props.typeDefinitionByName[typeName as string]}
- shouldAddId={false}
- docsInfo={props.docsInfo}
- typeDefinitionByName={props.typeDefinitionByName}
- isInPopover={true}
- />
- </ReactTooltip>
- </span>
+ <span
+ data-tip={true}
+ data-for={id}
+ style={{
+ color: colors.lightBlueA700,
+ cursor: 'pointer',
+ display: 'inline-block',
+ }}
+ >
+ {typeName}
+ <ReactTooltip type="light" effect="solid" id={id} className="typeTooltip">
+ <TypeDefinition
+ sectionName={props.sectionName}
+ customType={props.typeDefinitionByName[typeName as string]}
+ shouldAddId={false}
+ docsInfo={props.docsInfo}
+ typeDefinitionByName={props.typeDefinitionByName}
+ isInPopover={true}
+ />
+ </ReactTooltip>
+ </span>
+ </ScrollLink>
)}
- </ScrollLink>
+ </span>
);
}
return (
diff --git a/packages/react-docs/src/components/type_definition.tsx b/packages/react-docs/src/components/type_definition.tsx
index 9a3e50a1b..a1fde51da 100644
--- a/packages/react-docs/src/components/type_definition.tsx
+++ b/packages/react-docs/src/components/type_definition.tsx
@@ -1,6 +1,6 @@
-import { AnchorTitle, colors, HeaderSizes } from '@0xproject/react-shared';
-import { CustomType, CustomTypeChild, TypeDefinitionByName, TypeDocTypes } from '@0xproject/types';
-import { errorUtils } from '@0xproject/utils';
+import { AnchorTitle, colors, HeaderSizes } from '@0x/react-shared';
+import { CustomType, CustomTypeChild, TypeDefinitionByName, TypeDocTypes } from '@0x/types';
+import { errorUtils } from '@0x/utils';
import * as _ from 'lodash';
import * as React from 'react';
@@ -124,6 +124,7 @@ export class TypeDefinition extends React.Component<TypeDefinitionProps, TypeDef
title={`${typePrefix} ${customType.name}`}
id={this.props.shouldAddId ? typeDefinitionAnchorId : ''}
shouldShowAnchor={this.state.shouldShowAnchor}
+ isDisabled={this.props.isInPopover}
/>
<div style={{ fontSize: 16 }}>
<pre>
diff --git a/packages/react-docs/src/docs_info.ts b/packages/react-docs/src/docs_info.ts
index 092a8c266..54b59ef1f 100644
--- a/packages/react-docs/src/docs_info.ts
+++ b/packages/react-docs/src/docs_info.ts
@@ -1,5 +1,5 @@
-import { MenuSubsectionsBySection } from '@0xproject/react-shared';
-import { DocAgnosticFormat, TypeDefinitionByName } from '@0xproject/types';
+import { ALink, utils as sharedUtils } from '@0x/react-shared';
+import { DocAgnosticFormat, ObjectMap, TypeDefinitionByName } from '@0x/types';
import * as _ from 'lodash';
import {
@@ -17,7 +17,7 @@ export class DocsInfo {
public displayName: string;
public packageName: string;
public packageUrl: string;
- public menu: DocsMenu;
+ public markdownMenu: DocsMenu;
public typeSectionName: string;
public sections: SectionsMap;
public sectionNameToMarkdownByVersion: SectionNameToMarkdownByVersion;
@@ -25,7 +25,7 @@ export class DocsInfo {
constructor(config: DocsInfoConfig) {
this.id = config.id;
this.type = config.type;
- this.menu = config.markdownMenu;
+ this.markdownMenu = config.markdownMenu;
this.displayName = config.displayName;
this.packageName = config.packageName;
this.packageUrl = config.packageUrl;
@@ -34,10 +34,31 @@ export class DocsInfo {
this.sectionNameToMarkdownByVersion = config.sectionNameToMarkdownByVersion;
this.contractsByVersionByNetworkId = config.contractsByVersionByNetworkId;
}
- public getMenuSubsectionsBySection(docAgnosticFormat?: DocAgnosticFormat): MenuSubsectionsBySection {
- const menuSubsectionsBySection = {} as MenuSubsectionsBySection;
+ public getTypeDefinitionsByName(docAgnosticFormat: DocAgnosticFormat): ObjectMap<TypeDefinitionByName> {
+ if (_.isUndefined(docAgnosticFormat[this.typeSectionName])) {
+ return {};
+ }
+
+ const section = docAgnosticFormat[this.typeSectionName];
+ const typeDefinitionByName = _.keyBy(section.types, 'name') as any;
+ return typeDefinitionByName;
+ }
+ public getSectionNameToLinks(docAgnosticFormat: DocAgnosticFormat): ObjectMap<ALink[]> {
+ const sectionNameToLinks: ObjectMap<ALink[]> = {};
+ _.each(this.markdownMenu, (linkTitles, sectionName) => {
+ sectionNameToLinks[sectionName] = [];
+ _.each(linkTitles, linkTitle => {
+ const to = sharedUtils.getIdFromName(linkTitle);
+ const links = sectionNameToLinks[sectionName];
+ links.push({
+ title: linkTitle,
+ to,
+ });
+ });
+ });
+
if (_.isUndefined(docAgnosticFormat)) {
- return menuSubsectionsBySection;
+ return sectionNameToLinks;
}
const docSections = _.keys(this.sections);
@@ -58,7 +79,13 @@ export class DocsInfo {
if (sectionName === this.typeSectionName) {
const sortedTypesNames = _.sortBy(docSection.types, 'name');
const typeNames = _.map(sortedTypesNames, t => t.name);
- menuSubsectionsBySection[sectionName] = typeNames;
+ const typeLinks = _.map(typeNames, typeName => {
+ return {
+ to: `${sectionName}-${typeName}`,
+ title: typeName,
+ };
+ });
+ sectionNameToLinks[sectionName] = typeLinks;
} else if (isExportedFunctionSection) {
// Noop so that we don't have the method listed underneath itself.
} else {
@@ -73,23 +100,18 @@ export class DocsInfo {
const methodNames = _.map(methodsSortedByName, m => m.name);
const sortedFunctionNames = _.sortBy(docSection.functions, 'name');
const functionNames = _.map(sortedFunctionNames, m => m.name);
- menuSubsectionsBySection[sectionName] = [
- ...eventNames,
- ...propertyNames,
- ...functionNames,
- ...methodNames,
- ];
+ const names = [...eventNames, ...propertyNames, ...functionNames, ...methodNames];
+
+ const links = _.map(names, name => {
+ return {
+ to: `${sectionName}-${name}`,
+ title: name,
+ };
+ });
+
+ sectionNameToLinks[sectionName] = links;
}
});
- return menuSubsectionsBySection;
- }
- public getTypeDefinitionsByName(docAgnosticFormat: DocAgnosticFormat): { [name: string]: TypeDefinitionByName } {
- if (_.isUndefined(docAgnosticFormat[this.typeSectionName])) {
- return {};
- }
-
- const section = docAgnosticFormat[this.typeSectionName];
- const typeDefinitionByName = _.keyBy(section.types, 'name') as any;
- return typeDefinitionByName;
+ return sectionNameToLinks;
}
}
diff --git a/packages/react-docs/src/index.ts b/packages/react-docs/src/index.ts
index f9382940c..a5ed788b1 100644
--- a/packages/react-docs/src/index.ts
+++ b/packages/react-docs/src/index.ts
@@ -1,11 +1,11 @@
-export { DocAgnosticFormat, GeneratedDocJson } from '@0xproject/types';
+export { DocAgnosticFormat, GeneratedDocJson } from '@0x/types';
// Exported to give users of this library added flexibility if they want to build
// a docs page from scratch using the individual components.
export { Badge } from './components/badge';
export { Comment } from './components/comment';
export { CustomEnum } from './components/custom_enum';
-export { Documentation } from './components/documentation';
+export { DocReference } from './components/doc_reference';
export { Enum } from './components/enum';
export { EventDefinition } from './components/event_definition';
export { Interface } from './components/interface';
diff --git a/packages/react-docs/src/utils/typedoc_utils.ts b/packages/react-docs/src/utils/typedoc_utils.ts
index 19605d497..f74ec3e28 100644
--- a/packages/react-docs/src/utils/typedoc_utils.ts
+++ b/packages/react-docs/src/utils/typedoc_utils.ts
@@ -16,8 +16,8 @@ import {
TypeParameter,
TypescriptFunction,
TypescriptMethod,
-} from '@0xproject/types';
-import { errorUtils } from '@0xproject/utils';
+} from '@0x/types';
+import { errorUtils } from '@0x/utils';
import * as _ from 'lodash';
import { DocsInfo } from '../docs_info';
@@ -95,7 +95,9 @@ export class TypeDocUtils {
if (!_.isEmpty(this._externalExportToLink)) {
this._docsInfo.sections[constants.EXTERNAL_EXPORTS_SECTION_NAME] = constants.EXTERNAL_EXPORTS_SECTION_NAME;
- this._docsInfo.menu[constants.EXTERNAL_EXPORTS_SECTION_NAME] = [constants.EXTERNAL_EXPORTS_SECTION_NAME];
+ this._docsInfo.markdownMenu[constants.EXTERNAL_EXPORTS_SECTION_NAME] = [
+ constants.EXTERNAL_EXPORTS_SECTION_NAME,
+ ];
const docSection: DocSection = {
comment: 'This package also re-exports some third-party libraries for your convenience.',
constructors: [],
@@ -119,7 +121,7 @@ export class TypeDocUtils {
case KindString.ObjectLiteral: {
sectionName = child.name;
this._docsInfo.sections[sectionName] = sectionName;
- this._docsInfo.menu[sectionName] = [sectionName];
+ this._docsInfo.markdownMenu[sectionName] = [sectionName];
const entities = child.children;
const commentObj = child.comment;
const sectionComment = !_.isUndefined(commentObj) ? commentObj.shortText : '';
@@ -136,7 +138,7 @@ export class TypeDocUtils {
case KindString.Function: {
sectionName = child.name;
this._docsInfo.sections[sectionName] = sectionName;
- this._docsInfo.menu[sectionName] = [sectionName];
+ this._docsInfo.markdownMenu[sectionName] = [sectionName];
const entities = [child];
const commentObj = child.comment;
const SectionComment = !_.isUndefined(commentObj) ? commentObj.shortText : '';
@@ -158,7 +160,7 @@ export class TypeDocUtils {
});
if (!_.isEmpty(typeEntities)) {
this._docsInfo.sections[constants.TYPES_SECTION_NAME] = constants.TYPES_SECTION_NAME;
- this._docsInfo.menu[constants.TYPES_SECTION_NAME] = [constants.TYPES_SECTION_NAME];
+ this._docsInfo.markdownMenu[constants.TYPES_SECTION_NAME] = [constants.TYPES_SECTION_NAME];
const docSection = this._convertEntitiesToDocSection(typeEntities, constants.TYPES_SECTION_NAME);
docAgnosticFormat[constants.TYPES_SECTION_NAME] = docSection;
}
diff --git a/packages/react-docs/tslint.json b/packages/react-docs/tslint.json
index c78434416..c3f6d9cae 100644
--- a/packages/react-docs/tslint.json
+++ b/packages/react-docs/tslint.json
@@ -1,5 +1,5 @@
{
- "extends": ["@0xproject/tslint-config"],
+ "extends": ["@0x/tslint-config"],
"rules": {
"no-object-literal-type-assertion": false,
"completed-docs": false,
diff --git a/packages/react-shared/CHANGELOG.json b/packages/react-shared/CHANGELOG.json
index d1907e785..4dd11398b 100644
--- a/packages/react-shared/CHANGELOG.json
+++ b/packages/react-shared/CHANGELOG.json
@@ -1,11 +1,29 @@
[
{
- "timestamp": 1538693146,
- "version": "1.0.15",
+ "version": "1.0.18",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ],
+ "timestamp": 1541740904
+ },
+ {
+ "version": "1.0.17",
"changes": [
{
"note": "Dependencies updated"
}
+ ],
+ "timestamp": 1539871071
+ },
+ {
+ "timestamp": 1538693146,
+ "version": "1.0.16",
+ "changes": [
+ {
+ "note": "Unpublished package"
+ }
]
},
{
diff --git a/packages/react-shared/CHANGELOG.md b/packages/react-shared/CHANGELOG.md
index 20d3e0bf7..54ca77b16 100644
--- a/packages/react-shared/CHANGELOG.md
+++ b/packages/react-shared/CHANGELOG.md
@@ -5,10 +5,18 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
-## v1.0.15 - _October 4, 2018_
+## v1.0.18 - _November 9, 2018_
* Dependencies updated
+## v1.0.17 - _October 18, 2018_
+
+ * Dependencies updated
+
+## v1.0.16 - _October 4, 2018_
+
+ * Unpublished package
+
## v1.0.14 - _October 2, 2018_
* Dependencies updated
@@ -41,7 +49,7 @@ CHANGELOG
* Dependencies updated
-## v1.0.6 - _August 13, 2018_
+## v1.0.6 - _August 14, 2018_
* Dependencies updated
diff --git a/packages/react-shared/README.md b/packages/react-shared/README.md
index 88e6f18ae..7ff9a94d9 100644
--- a/packages/react-shared/README.md
+++ b/packages/react-shared/README.md
@@ -1,18 +1,18 @@
-## @0xproject/react-shared
+## @0x/react-shared
Contains React components & frontend types/utils shared between 0x projects.
## Installation
```bash
-yarn add @0xproject/react-shared
+yarn add @0x/react-shared
```
If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`:
```json
"compilerOptions": {
- "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"],
+ "typeRoots": ["node_modules/@0x/typescript-typings/types", "node_modules/@types"],
}
```
@@ -41,13 +41,13 @@ yarn install
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
```bash
-PKG=@0xproject/react-shared yarn build
+PKG=@0x/react-shared yarn build
```
Or continuously rebuild on change:
```bash
-PKG=@0xproject/react-shared yarn watch
+PKG=@0x/react-shared yarn watch
```
### Clean
diff --git a/packages/react-shared/package.json b/packages/react-shared/package.json
index 5080c8b2c..35a69f105 100644
--- a/packages/react-shared/package.json
+++ b/packages/react-shared/package.json
@@ -1,6 +1,6 @@
{
- "name": "@0xproject/react-shared",
- "version": "1.0.15",
+ "name": "@0x/react-shared",
+ "version": "1.0.18",
"engines": {
"node": ">=6.12"
},
@@ -8,7 +8,7 @@
"main": "lib/index.js",
"types": "lib/index.d.ts",
"scripts": {
- "lint": "tslint --project .",
+ "lint": "tslint --format stylish --project .",
"build": "tsc",
"build:ci": "yarn build",
"watch_without_deps": "tsc -w",
@@ -25,15 +25,15 @@
"url": "https://github.com/0xProject/0x-monorepo.git"
},
"devDependencies": {
- "@0xproject/dev-utils": "^1.0.12",
- "@0xproject/tslint-config": "^1.0.8",
- "copyfiles": "^2.0.0",
+ "@0x/dev-utils": "^1.0.14",
+ "@0x/tslint-config": "^1.0.10",
"make-promises-safe": "^1.1.0",
"shx": "^0.2.2",
"tslint": "^5.9.1",
"typescript": "3.0.1"
},
"dependencies": {
+ "@0x/types": "^1.2.1",
"@material-ui/core": "^3.0.1",
"@types/is-mobile": "0.3.0",
"@types/lodash": "4.14.104",
@@ -41,7 +41,10 @@
"@types/node": "*",
"@types/react": "*",
"@types/react-dom": "*",
+ "@types/react-router-dom": "^4.0.4",
"@types/react-scroll": "1.5.3",
+ "@types/styled-components": "^4.0.0",
+ "@types/valid-url": "^1.0.2",
"basscss": "^8.0.3",
"change-case": "^3.0.2",
"is-mobile": "^0.2.2",
@@ -51,7 +54,10 @@
"react-dom": "^16.4.2",
"react-highlight": "0xproject/react-highlight#2f40a42e0a3f0ad126f9f42d505b97b603fc7162",
"react-markdown": "^3.2.2",
- "react-scroll": "0xproject/react-scroll#similar-to-pr-330"
+ "react-router-dom": "^4.1.1",
+ "react-scroll": "0xproject/react-scroll#pr-330-and-replace-state",
+ "styled-components": "^3.3.0",
+ "valid-url": "^1.0.9"
},
"publishConfig": {
"access": "public"
diff --git a/packages/react-shared/src/components/anchor_title.tsx b/packages/react-shared/src/components/anchor_title.tsx
index 8f7e4af27..bd99edcab 100644
--- a/packages/react-shared/src/components/anchor_title.tsx
+++ b/packages/react-shared/src/components/anchor_title.tsx
@@ -1,7 +1,9 @@
import * as React from 'react';
import { Link as ScrollLink } from 'react-scroll';
+import styled from 'styled-components';
import { HeaderSizes, Styles } from '../types';
+import { colors } from '../utils/colors';
import { constants } from '../utils/constants';
const headerSizeToScrollOffset: { [headerSize: string]: number } = {
@@ -14,20 +16,14 @@ export interface AnchorTitleProps {
id: string;
headerSize: HeaderSizes;
shouldShowAnchor: boolean;
+ isDisabled: boolean;
}
-export interface AnchorTitleState {
- isHovering: boolean;
-}
+export interface AnchorTitleState {}
const styles: Styles = {
- anchor: {
- fontSize: 20,
- transform: 'rotate(45deg)',
- cursor: 'pointer',
- },
h1: {
- fontSize: '1.8em',
+ fontSize: '1.875em',
},
h2: {
fontSize: '1.5em',
@@ -38,18 +34,28 @@ const styles: Styles = {
},
};
+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;
+ `;
+
export class AnchorTitle extends React.Component<AnchorTitleProps, AnchorTitleState> {
- constructor(props: AnchorTitleProps) {
- super(props);
- this.state = {
- isHovering: false,
- };
- }
+ public static defaultProps: Partial<AnchorTitleProps> = {
+ isDisabled: false,
+ };
public render(): React.ReactNode {
- let opacity = 0;
- if (this.props.shouldShowAnchor) {
- opacity = this.state.isHovering ? 0.6 : 1;
- }
return (
<div
className="relative flex"
@@ -63,29 +69,21 @@ export class AnchorTitle extends React.Component<AnchorTitleProps, AnchorTitleSt
} as any
}
>
- <div className="inline-block" style={{ paddingRight: 4 }}>
+ <div className="inline-block" style={{ paddingRight: 4, color: colors.darkestGrey }}>
{this.props.title}
</div>
- <ScrollLink
- to={this.props.id}
- hashSpy={true}
- offset={headerSizeToScrollOffset[this.props.headerSize]}
- duration={constants.DOCS_SCROLL_DURATION_MS}
- containerId={constants.DOCS_CONTAINER_ID}
- >
- <i
- className="zmdi zmdi-link"
- style={{ ...styles.anchor, opacity }}
- onMouseOver={this._setHoverState.bind(this, true)}
- onMouseOut={this._setHoverState.bind(this, false)}
- />
- </ScrollLink>
+ {!this.props.isDisabled && (
+ <ScrollLink
+ to={this.props.id}
+ hashSpy={true}
+ offset={headerSizeToScrollOffset[this.props.headerSize]}
+ duration={constants.DOCS_SCROLL_DURATION_MS}
+ containerId={constants.SCROLL_CONTAINER_ID}
+ >
+ <AnchorIcon className="zmdi zmdi-link" shouldShowAnchor={this.props.shouldShowAnchor} />
+ </ScrollLink>
+ )}
</div>
);
}
- private _setHoverState(isHovering: boolean): void {
- this.setState({
- isHovering,
- });
- }
}
diff --git a/packages/react-shared/src/components/link.tsx b/packages/react-shared/src/components/link.tsx
new file mode 100644
index 000000000..089e6e2ba
--- /dev/null
+++ b/packages/react-shared/src/components/link.tsx
@@ -0,0 +1,145 @@
+import * as _ from 'lodash';
+import * as React from 'react';
+import { Link as ReactRounterLink } from 'react-router-dom';
+import { Link as ScrollLink } from 'react-scroll';
+import * as validUrl from 'valid-url';
+
+import { LinkType } from '../types';
+import { constants } from '../utils/constants';
+
+interface BaseLinkProps {
+ to: string;
+ shouldOpenInNewTab?: boolean;
+ className?: string;
+ onMouseOver?: (event: React.MouseEvent<HTMLElement>) => void;
+ onMouseLeave?: (event: React.MouseEvent<HTMLElement>) => void;
+ onMouseEnter?: (event: React.MouseEvent<HTMLElement>) => void;
+ textDecoration?: string;
+ fontColor?: string;
+}
+
+interface ScrollLinkProps extends BaseLinkProps {
+ onActivityChanged?: (isActive: boolean) => void;
+}
+
+type LinkProps = BaseLinkProps & ScrollLinkProps;
+
+export interface LinkState {}
+
+/**
+ * A generic link component which let's the developer render internal, external and scroll-to-hash links, and
+ * their associated behaviors with a single link component. Many times we want a menu including a combination of
+ * internal, external and scroll links and the abstraction of the differences of rendering each types of link
+ * makes it much easier to do so.
+ */
+export class Link extends React.Component<LinkProps, LinkState> {
+ public static defaultProps: Partial<LinkProps> = {
+ shouldOpenInNewTab: false,
+ className: '',
+ onMouseOver: _.noop.bind(_),
+ onMouseLeave: _.noop.bind(_),
+ onMouseEnter: _.noop.bind(_),
+ textDecoration: 'none',
+ fontColor: 'inherit',
+ };
+ private _outerReactScrollSpan: HTMLSpanElement | null;
+ constructor(props: LinkProps) {
+ super(props);
+ this._outerReactScrollSpan = null;
+ }
+ public render(): React.ReactNode {
+ let type: LinkType;
+ const isReactRoute = _.startsWith(this.props.to, '/');
+ const isExternal = validUrl.isWebUri(this.props.to) || _.startsWith(this.props.to, 'mailto:');
+ if (isReactRoute) {
+ type = LinkType.ReactRoute;
+ } else if (isExternal) {
+ type = LinkType.External;
+ } else {
+ type = LinkType.ReactScroll;
+ }
+
+ if (type === LinkType.ReactScroll && this.props.shouldOpenInNewTab) {
+ throw new Error(`Cannot open LinkType.ReactScroll links in new tab. link.to: ${this.props.to}`);
+ }
+
+ const styleWithDefault = {
+ textDecoration: this.props.textDecoration,
+ cursor: 'pointer',
+ color: this.props.fontColor,
+ };
+
+ switch (type) {
+ case LinkType.External:
+ return (
+ <a
+ target={this.props.shouldOpenInNewTab ? '_blank' : ''}
+ className={this.props.className}
+ style={styleWithDefault}
+ href={this.props.to}
+ onMouseOver={this.props.onMouseOver}
+ onMouseEnter={this.props.onMouseEnter}
+ onMouseLeave={this.props.onMouseLeave}
+ >
+ {this.props.children}
+ </a>
+ );
+ case LinkType.ReactRoute:
+ return (
+ <ReactRounterLink
+ to={this.props.to}
+ className={this.props.className}
+ style={styleWithDefault}
+ target={this.props.shouldOpenInNewTab ? '_blank' : ''}
+ onMouseOver={this.props.onMouseOver}
+ onMouseEnter={this.props.onMouseEnter}
+ onMouseLeave={this.props.onMouseLeave}
+ >
+ {this.props.children}
+ </ReactRounterLink>
+ );
+ case LinkType.ReactScroll:
+ return (
+ <span
+ ref={input => (this._outerReactScrollSpan = input)}
+ onMouseOver={this.props.onMouseOver}
+ onMouseEnter={this.props.onMouseEnter}
+ onMouseLeave={this.props.onMouseLeave}
+ >
+ <ScrollLink
+ to={this.props.to}
+ offset={0}
+ spy={true}
+ hashSpy={true}
+ duration={constants.DOCS_SCROLL_DURATION_MS}
+ containerId={constants.SCROLL_CONTAINER_ID}
+ className={this.props.className}
+ style={styleWithDefault}
+ onSetActive={this._onActivityChanged.bind(this, true)}
+ onSetInactive={this._onActivityChanged.bind(this, false)}
+ >
+ <span onClick={this._onClickPropagateClickEventAroundScrollLink.bind(this)}>
+ {this.props.children}
+ </span>
+ </ScrollLink>
+ </span>
+ );
+ default:
+ throw new Error(`Unrecognized LinkType: ${type}`);
+ }
+ }
+ private _onActivityChanged(isActive: boolean): void {
+ if (this.props.onActivityChanged) {
+ this.props.onActivityChanged(isActive);
+ }
+ }
+ // HACK(fabio): For some reason, the react-scroll link decided to stop the propagation of click events.
+ // We do however rely on these events being propagated in certain scenarios (e.g when the link
+ // is within a dropdown we want to close upon being clicked). Because of this, we register the
+ // click event of an inner span, and pass it around the react-scroll link to an outer span.
+ private _onClickPropagateClickEventAroundScrollLink(): void {
+ if (!_.isNull(this._outerReactScrollSpan)) {
+ this._outerReactScrollSpan.click();
+ }
+ }
+}
diff --git a/packages/react-shared/src/components/markdown_paragraph_block.tsx b/packages/react-shared/src/components/markdown_paragraph_block.tsx
new file mode 100644
index 000000000..eeaef8571
--- /dev/null
+++ b/packages/react-shared/src/components/markdown_paragraph_block.tsx
@@ -0,0 +1,10 @@
+import * as _ from 'lodash';
+import * as React from 'react';
+
+import { colors } from '../utils/colors';
+
+export interface MarkdownParagraphBlockProps {}
+
+export const MarkdownParagraphBlock: React.StatelessComponent<MarkdownParagraphBlockProps> = ({ children }) => {
+ return <span style={{ color: colors.greyTheme, lineHeight: '26px' }}>{children}</span>;
+};
diff --git a/packages/react-shared/src/components/markdown_section.tsx b/packages/react-shared/src/components/markdown_section.tsx
index 09b214548..42c910c11 100644
--- a/packages/react-shared/src/components/markdown_section.tsx
+++ b/packages/react-shared/src/components/markdown_section.tsx
@@ -8,14 +8,17 @@ import { colors } from '../utils/colors';
import { utils } from '../utils/utils';
import { AnchorTitle } from './anchor_title';
+import { Link } from './link';
import { MarkdownCodeBlock } from './markdown_code_block';
import { MarkdownLinkBlock } from './markdown_link_block';
+import { MarkdownParagraphBlock } from './markdown_paragraph_block';
export interface MarkdownSectionProps {
sectionName: string;
markdownContent: string;
headerSize?: HeaderSizes;
githubLink?: string;
+ alternativeSectionTitle?: string;
}
interface DefaultMarkdownSectionProps {
@@ -42,20 +45,23 @@ export class MarkdownSection extends React.Component<MarkdownSectionProps, Markd
const { sectionName, markdownContent, headerSize, githubLink } = this.props as PropsWithDefaults;
const id = utils.getIdFromName(sectionName);
- const finalSectionName = utils.convertCamelCaseToSpaces(sectionName);
+ const formattedSectionName = utils.convertCamelCaseToSpaces(sectionName);
+ const title = !_.isUndefined(this.props.alternativeSectionTitle)
+ ? this.props.alternativeSectionTitle
+ : _.capitalize(formattedSectionName);
return (
<div
className="md-px1 sm-px2 overflow-hidden"
onMouseOver={this._setAnchorVisibility.bind(this, true)}
onMouseOut={this._setAnchorVisibility.bind(this, false)}
>
- <ScrollElement name={id}>
- <div className="clearfix pt3">
+ <ScrollElement name={id} style={{ paddingBottom: 20 }}>
+ <div className="clearfix" style={{ paddingTop: 30, paddingBottom: 20 }}>
<div className="col lg-col-8 md-col-8 sm-col-12">
- <span style={{ textTransform: 'capitalize', color: colors.grey700 }}>
+ <span style={{ color: colors.grey700 }}>
<AnchorTitle
headerSize={headerSize}
- title={finalSectionName}
+ title={title}
id={id}
shouldShowAnchor={this.state.shouldShowAnchor}
/>
@@ -63,23 +69,29 @@ export class MarkdownSection extends React.Component<MarkdownSectionProps, Markd
</div>
<div className="col col-4 sm-hide xs-hide right-align pr3" style={{ height: 28 }}>
{!_.isUndefined(githubLink) && (
- <a
- href={githubLink}
- target="_blank"
- style={{ color: colors.linkBlue, textDecoration: 'none', lineHeight: 2.1 }}
- >
- Edit on Github
- </a>
+ <div style={{ lineHeight: 2.1 }}>
+ <Link to={githubLink} shouldOpenInNewTab={true} fontColor={colors.linkBlue}>
+ Edit on Github
+ </Link>
+ </div>
)}
</div>
</div>
- <hr style={{ border: `1px solid ${colors.lightestGrey}` }} />
<ReactMarkdown
source={markdownContent}
escapeHtml={false}
renderers={{
code: MarkdownCodeBlock,
link: MarkdownLinkBlock,
+ paragraph: MarkdownParagraphBlock,
+ }}
+ />
+ <div
+ style={{
+ width: '100%',
+ height: 1,
+ backgroundColor: colors.grey300,
+ marginTop: 32,
}}
/>
</ScrollElement>
diff --git a/packages/react-shared/src/components/nested_sidebar_menu.tsx b/packages/react-shared/src/components/nested_sidebar_menu.tsx
deleted file mode 100644
index c8bddb59a..000000000
--- a/packages/react-shared/src/components/nested_sidebar_menu.tsx
+++ /dev/null
@@ -1,149 +0,0 @@
-import * as _ from 'lodash';
-import MenuItem from 'material-ui/MenuItem';
-import * as React from 'react';
-import { Link as ScrollLink } from 'react-scroll';
-
-import { MenuSubsectionsBySection, Styles } from '../types';
-import { colors } from '../utils/colors';
-import { constants } from '../utils/constants';
-import { utils } from '../utils/utils';
-
-import { VersionDropDown } from './version_drop_down';
-
-export interface NestedSidebarMenuProps {
- topLevelMenu: { [topLevel: string]: string[] };
- menuSubsectionsBySection: MenuSubsectionsBySection;
- sidebarHeader?: React.ReactNode;
- shouldDisplaySectionHeaders?: boolean;
- onMenuItemClick?: () => void;
- selectedVersion?: string;
- versions?: string[];
- onVersionSelected?: (semver: string) => void;
-}
-
-export interface NestedSidebarMenuState {}
-
-const styles: Styles = {
- menuItemWithHeaders: {
- minHeight: 0,
- },
- menuItemWithoutHeaders: {
- minHeight: 48,
- },
- menuItemInnerDivWithHeaders: {
- color: colors.grey800,
- fontSize: 14,
- lineHeight: 2,
- padding: 0,
- },
-};
-
-export class NestedSidebarMenu extends React.Component<NestedSidebarMenuProps, NestedSidebarMenuState> {
- public static defaultProps: Partial<NestedSidebarMenuProps> = {
- shouldDisplaySectionHeaders: true,
- onMenuItemClick: _.noop.bind(_),
- };
- public render(): React.ReactNode {
- const navigation = _.map(this.props.topLevelMenu, (menuItems: string[], sectionName: string) => {
- const finalSectionName = utils.convertCamelCaseToSpaces(sectionName);
- if (this.props.shouldDisplaySectionHeaders) {
- // tslint:disable-next-line:no-unused-variable
- const id = utils.getIdFromName(sectionName);
- return (
- <div key={`section-${sectionName}`} className="py1" style={{ color: colors.grey800 }}>
- <div style={{ fontWeight: 'bold', fontSize: 15 }} className="py1">
- {finalSectionName.toUpperCase()}
- </div>
- {this._renderMenuItems(menuItems)}
- </div>
- );
- } else {
- return <div key={`section-${sectionName}`}>{this._renderMenuItems(menuItems)}</div>;
- }
- });
- const maxWidthWithScrollbar = 307;
- return (
- <div>
- {this.props.sidebarHeader}
- {!_.isUndefined(this.props.versions) &&
- !_.isUndefined(this.props.selectedVersion) &&
- !_.isUndefined(this.props.onVersionSelected) && (
- <div style={{ maxWidth: maxWidthWithScrollbar }}>
- <VersionDropDown
- selectedVersion={this.props.selectedVersion}
- versions={this.props.versions}
- onVersionSelected={this.props.onVersionSelected}
- />
- </div>
- )}
- <div className="pl1">{navigation}</div>
- </div>
- );
- }
- private _renderMenuItems(menuItemNames: string[]): React.ReactNode[] {
- const menuItemStyles = this.props.shouldDisplaySectionHeaders
- ? styles.menuItemWithHeaders
- : styles.menuItemWithoutHeaders;
- const menuItemInnerDivStyles = this.props.shouldDisplaySectionHeaders ? styles.menuItemInnerDivWithHeaders : {};
- const menuItems = _.map(menuItemNames, menuItemName => {
- const finalMenuItemName = utils.convertDashesToSpaces(menuItemName);
- const id = utils.getIdFromName(menuItemName);
- return (
- <div key={menuItemName}>
- <ScrollLink
- key={`menuItem-${menuItemName}`}
- to={id}
- offset={0}
- hashSpy={true}
- duration={constants.DOCS_SCROLL_DURATION_MS}
- containerId={constants.DOCS_CONTAINER_ID}
- >
- <MenuItem style={menuItemStyles} innerDivStyle={menuItemInnerDivStyles}>
- <span style={{ textTransform: 'capitalize' }}>{finalMenuItemName}</span>
- </MenuItem>
- </ScrollLink>
- {this._renderMenuItemSubsections(menuItemName)}
- </div>
- );
- });
- return menuItems;
- }
- private _renderMenuItemSubsections(menuItemName: string): React.ReactNode {
- if (_.isUndefined(this.props.menuSubsectionsBySection[menuItemName])) {
- return null;
- }
- return this._renderMenuSubsectionsBySection(menuItemName, this.props.menuSubsectionsBySection[menuItemName]);
- }
- private _renderMenuSubsectionsBySection(menuItemName: string, entityNames: string[]): React.ReactNode {
- return (
- <ul style={{ margin: 0, listStyleType: 'none', paddingLeft: 0 }} key={menuItemName}>
- {_.map(entityNames, entityName => {
- const name = `${menuItemName}-${entityName}`;
- const id = utils.getIdFromName(name);
- return (
- <li key={`menuSubsectionItem-${name}`}>
- <ScrollLink
- to={id}
- offset={0}
- hashSpy={true}
- duration={constants.DOCS_SCROLL_DURATION_MS}
- containerId={constants.DOCS_CONTAINER_ID}
- >
- <MenuItem
- style={{ minHeight: 35 }}
- innerDivStyle={{
- paddingLeft: 16,
- fontSize: 14,
- lineHeight: '35px',
- }}
- >
- {entityName}
- </MenuItem>
- </ScrollLink>
- </li>
- );
- })}
- </ul>
- );
- }
-}
diff --git a/packages/react-shared/src/components/version_drop_down.tsx b/packages/react-shared/src/components/version_drop_down.tsx
deleted file mode 100644
index 5ff4bed54..000000000
--- a/packages/react-shared/src/components/version_drop_down.tsx
+++ /dev/null
@@ -1,37 +0,0 @@
-import MenuItem from '@material-ui/core/MenuItem';
-import Select from '@material-ui/core/Select';
-import * as _ from 'lodash';
-import * as React from 'react';
-
-export interface VersionDropDownProps {
- selectedVersion: string;
- versions: string[];
- onVersionSelected: (semver: string) => void;
-}
-
-export interface VersionDropDownState {}
-
-export class VersionDropDown extends React.Component<VersionDropDownProps, VersionDropDownState> {
- public render(): React.ReactNode {
- return (
- <div className="mx-auto" style={{ width: 120 }}>
- <Select value={this.props.selectedVersion} onChange={this._updateSelectedVersion.bind(this)}>
- {this._renderDropDownItems()}
- </Select>
- </div>
- );
- }
- private _renderDropDownItems(): React.ReactNode[] {
- const items = _.map(this.props.versions, version => {
- return (
- <MenuItem key={version} value={version}>
- v{version}
- </MenuItem>
- );
- });
- return items;
- }
- private _updateSelectedVersion(event: React.ChangeEvent<HTMLSelectElement>): void {
- this.props.onVersionSelected(event.target.value);
- }
-}
diff --git a/packages/react-shared/src/index.ts b/packages/react-shared/src/index.ts
index 3b50c0117..a693f2a36 100644
--- a/packages/react-shared/src/index.ts
+++ b/packages/react-shared/src/index.ts
@@ -2,10 +2,10 @@ export { AnchorTitle } from './components/anchor_title';
export { MarkdownLinkBlock } from './components/markdown_link_block';
export { MarkdownCodeBlock } from './components/markdown_code_block';
export { MarkdownSection } from './components/markdown_section';
-export { NestedSidebarMenu } from './components/nested_sidebar_menu';
export { SectionHeader } from './components/section_header';
+export { Link } from './components/link';
-export { HeaderSizes, Styles, MenuSubsectionsBySection, EtherscanLinkSuffixes, Networks } from './types';
+export { HeaderSizes, Styles, EtherscanLinkSuffixes, Networks, ALink } from './types';
export { utils } from './utils/utils';
export { constants } from './utils/constants';
diff --git a/packages/react-shared/src/types.ts b/packages/react-shared/src/types.ts
index 88fadcc09..9e8dcb6b6 100644
--- a/packages/react-shared/src/types.ts
+++ b/packages/react-shared/src/types.ts
@@ -8,10 +8,6 @@ export enum HeaderSizes {
H3 = 'h3',
}
-export interface MenuSubsectionsBySection {
- [section: string]: string[];
-}
-
export enum EtherscanLinkSuffixes {
Address = 'address',
Tx = 'tx',
@@ -23,3 +19,15 @@ export enum Networks {
Ropsten = 'Ropsten',
Rinkeby = 'Rinkeby',
}
+
+export enum LinkType {
+ External = 'EXTERNAL',
+ ReactScroll = 'REACT_SCROLL',
+ ReactRoute = 'REACT_ROUTE',
+}
+
+export interface ALink {
+ title: string;
+ to: string;
+ shouldOpenInNewTab?: boolean;
+}
diff --git a/packages/react-shared/src/utils/colors.ts b/packages/react-shared/src/utils/colors.ts
index 7d047a50e..a4dd7fefa 100644
--- a/packages/react-shared/src/utils/colors.ts
+++ b/packages/react-shared/src/utils/colors.ts
@@ -8,13 +8,17 @@ const baseColors = {
greyishPink: '#E6E5E5',
grey300: '#E0E0E0',
beigeWhite: '#E4E4E4',
- grey350: '#cacaca',
+ lightBgGrey: '#EDEDED',
+ grey325: '#dfdfdf',
+ grey350: '#CACACA',
grey400: '#BDBDBD',
lightGrey: '#BBBBBB',
grey500: '#9E9E9E',
grey: '#A5A5A5',
darkGrey: '#818181',
landingLinkGrey: '#919191',
+ linkSectionGrey: '#999999',
+ greyTheme: '#666666',
grey700: '#616161',
grey750: '#515151',
grey800: '#424242',
@@ -22,10 +26,12 @@ const baseColors = {
heroGrey: '#404040',
projectsGrey: '#343333',
darkestGrey: '#272727',
+ lightestBlue: '#E7F1FD',
lightBlue: '#60A4F4',
lightBlueA700: '#0091EA',
- linkBlue: '#1D5CDE',
+ lightLinkBlue: '#3289F1',
mediumBlue: '#488AEA',
+ linkBlue: '#1D5CDE',
darkBlue: '#4D5481',
lightTurquois: '#aefcdc',
turquois: '#058789',
diff --git a/packages/react-shared/src/utils/constants.ts b/packages/react-shared/src/utils/constants.ts
index 562ab776b..2dca1a078 100644
--- a/packages/react-shared/src/utils/constants.ts
+++ b/packages/react-shared/src/utils/constants.ts
@@ -2,8 +2,7 @@ import { Networks } from '../types';
export const constants = {
DOCS_SCROLL_DURATION_MS: 0,
- DOCS_CONTAINER_ID: 'documentation',
- SCROLL_CONTAINER_ID: 'documentation',
+ SCROLL_CONTAINER_ID: 'scroll_container',
SCROLL_TOP_ID: 'pageScrollTop',
NETWORK_NAME_BY_ID: {
1: Networks.Mainnet,
diff --git a/packages/react-shared/tslint.json b/packages/react-shared/tslint.json
index c78434416..c3f6d9cae 100644
--- a/packages/react-shared/tslint.json
+++ b/packages/react-shared/tslint.json
@@ -1,5 +1,5 @@
{
- "extends": ["@0xproject/tslint-config"],
+ "extends": ["@0x/tslint-config"],
"rules": {
"no-object-literal-type-assertion": false,
"completed-docs": false,
diff --git a/packages/sol-compiler/CHANGELOG.json b/packages/sol-compiler/CHANGELOG.json
index 3b19a253a..724e68a68 100644
--- a/packages/sol-compiler/CHANGELOG.json
+++ b/packages/sol-compiler/CHANGELOG.json
@@ -1,5 +1,23 @@
[
{
+ "version": "1.1.9",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ],
+ "timestamp": 1541740904
+ },
+ {
+ "timestamp": 1539871071,
+ "version": "1.1.8",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
"version": "1.1.7",
"changes": [
{
diff --git a/packages/sol-compiler/CHANGELOG.md b/packages/sol-compiler/CHANGELOG.md
index d436462c9..322313f9e 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
+## v1.1.9 - _November 9, 2018_
+
+ * Dependencies updated
+
+## v1.1.8 - _October 18, 2018_
+
+ * Dependencies updated
+
## v1.1.7 - _October 4, 2018_
* Dependencies updated
@@ -39,7 +47,7 @@ CHANGELOG
* Stop exporting types: `ContractArtifact`, `ContractNetworks` (#924)
* Export types: `CompilerSettings`, `OutputField` (#924)
-## v1.0.5 - _August 13, 2018_
+## v1.0.5 - _August 14, 2018_
* Dependencies updated
diff --git a/packages/sol-compiler/README.md b/packages/sol-compiler/README.md
index 3a6ca130b..445aea315 100644
--- a/packages/sol-compiler/README.md
+++ b/packages/sol-compiler/README.md
@@ -1,4 +1,4 @@
-## @0xproject/sol-compiler
+## @0x/sol-compiler
Sol-compiler is a wrapper around [solc-js](https://www.npmjs.com/package/solc) that adds:
@@ -15,33 +15,33 @@ Sol-compiler is a wrapper around [solc-js](https://www.npmjs.com/package/solc) t
#### CLI Installation
```bash
-yarn global add @0xproject/sol-compiler
+yarn global add @0x/sol-compiler
```
#### API Installation
```bash
-yarn add @0xproject/sol-compiler
+yarn add @0x/sol-compiler
```
If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`:
```json
"compilerOptions": {
- "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"],
+ "typeRoots": ["node_modules/@0x/typescript-typings/types", "node_modules/@types"],
}
```
**Import**
```typescript
-import { Compiler } from '@0xproject/sol-compiler';
+import { Compiler } from '@0x/sol-compiler';
```
or
```javascript
-var Compiler = require('@0xproject/sol-compiler').Compiler;
+var Compiler = require('@0x/sol-compiler').Compiler;
```
## Contributing
@@ -69,13 +69,13 @@ yarn install
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
```bash
-PKG=@0xproject/sol-compiler yarn build
+PKG=@0x/sol-compiler yarn build
```
Or continuously rebuild on change:
```bash
-PKG=@0xproject/sol-compiler yarn watch
+PKG=@0x/sol-compiler yarn watch
```
### Clean
diff --git a/packages/sol-compiler/package.json b/packages/sol-compiler/package.json
index 9ee88a5ef..766c789df 100644
--- a/packages/sol-compiler/package.json
+++ b/packages/sol-compiler/package.json
@@ -1,6 +1,6 @@
{
- "name": "@0xproject/sol-compiler",
- "version": "1.1.7",
+ "name": "@0x/sol-compiler",
+ "version": "1.1.9",
"engines": {
"node": ">=6.12"
},
@@ -19,7 +19,7 @@
"coverage:report:lcov": "nyc report --reporter=text-lcov > coverage/lcov.info",
"clean": "shx rm -rf lib generated_docs",
"migrate": "npm run build; node lib/src/cli.js migrate",
- "lint": "tslint --project .",
+ "lint": "tslint --format stylish --project .",
"test:circleci": "yarn test:coverage",
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --tsconfig typedoc-tsconfig.json --json $JSON_FILE_PATH $PROJECT_FILES"
},
@@ -42,8 +42,8 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/sol-compiler/README.md",
"devDependencies": {
- "@0xproject/dev-utils": "^1.0.12",
- "@0xproject/tslint-config": "^1.0.8",
+ "@0x/dev-utils": "^1.0.14",
+ "@0x/tslint-config": "^1.0.10",
"@types/mkdirp": "^0.5.2",
"@types/require-from-string": "^1.2.0",
"@types/semver": "^5.5.0",
@@ -58,23 +58,23 @@
"nyc": "^11.0.1",
"shx": "^0.2.2",
"tslint": "5.11.0",
- "typedoc": "0.12.0",
+ "typedoc": "0.13.0",
"types-bn": "^0.0.1",
"typescript": "3.0.1",
"web3-typescript-typings": "^0.10.2",
"zeppelin-solidity": "1.8.0"
},
"dependencies": {
- "@0xproject/assert": "^1.0.13",
- "@0xproject/json-schemas": "^1.0.7",
- "@0xproject/sol-resolver": "^1.0.14",
- "@0xproject/types": "^1.1.4",
- "@0xproject/typescript-typings": "^3.0.2",
- "@0xproject/utils": "^2.0.2",
- "@0xproject/web3-wrapper": "^3.0.3",
+ "@0x/assert": "^1.0.15",
+ "@0x/json-schemas": "^2.0.1",
+ "@0x/sol-resolver": "^1.0.16",
+ "@0x/types": "^1.2.1",
+ "@0x/typescript-typings": "^3.0.4",
+ "@0x/utils": "^2.0.4",
+ "@0x/web3-wrapper": "^3.1.1",
"@types/yargs": "^11.0.0",
"chalk": "^2.3.0",
- "ethereum-types": "^1.0.11",
+ "ethereum-types": "^1.1.2",
"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 83dadc7ca..0a9db6e05 100644
--- a/packages/sol-compiler/src/cli.ts
+++ b/packages/sol-compiler/src/cli.ts
@@ -1,7 +1,7 @@
#!/usr/bin/env node
// We need the above pragma since this script will be run as a command-line tool.
-import { logUtils } from '@0xproject/utils';
+import { logUtils } from '@0x/utils';
import * as _ from 'lodash';
import 'source-map-support/register';
import * as yargs from 'yargs';
diff --git a/packages/sol-compiler/src/compiler.ts b/packages/sol-compiler/src/compiler.ts
index 7eefc1474..8ee7fa4a9 100644
--- a/packages/sol-compiler/src/compiler.ts
+++ b/packages/sol-compiler/src/compiler.ts
@@ -1,4 +1,4 @@
-import { assert } from '@0xproject/assert';
+import { assert } from '@0x/assert';
import {
FallthroughResolver,
FSResolver,
@@ -7,8 +7,8 @@ import {
RelativeFSResolver,
Resolver,
URLResolver,
-} from '@0xproject/sol-resolver';
-import { fetchAsync, logUtils } from '@0xproject/utils';
+} from '@0x/sol-resolver';
+import { fetchAsync, logUtils } from '@0x/utils';
import chalk from 'chalk';
import { CompilerOptions, ContractArtifact, ContractVersionData, StandardOutput } from 'ethereum-types';
import * as ethUtil from 'ethereumjs-util';
diff --git a/packages/sol-compiler/src/utils/compiler.ts b/packages/sol-compiler/src/utils/compiler.ts
index c153beb0f..cda67a414 100644
--- a/packages/sol-compiler/src/utils/compiler.ts
+++ b/packages/sol-compiler/src/utils/compiler.ts
@@ -1,5 +1,5 @@
-import { ContractSource } from '@0xproject/sol-resolver';
-import { logUtils } from '@0xproject/utils';
+import { ContractSource } from '@0x/sol-resolver';
+import { logUtils } from '@0x/utils';
import { ContractArtifact } from 'ethereum-types';
import * as _ from 'lodash';
import * as path from 'path';
diff --git a/packages/sol-compiler/src/utils/encoder.ts b/packages/sol-compiler/src/utils/encoder.ts
index 0f2d75691..40b103fd5 100644
--- a/packages/sol-compiler/src/utils/encoder.ts
+++ b/packages/sol-compiler/src/utils/encoder.ts
@@ -1,4 +1,4 @@
-import { AbiDefinition, AbiType, ContractAbi, DataItem } from 'ethereum-types';
+import { AbiDefinition, AbiType, ConstructorAbi, ContractAbi, DataItem } from 'ethereum-types';
import * as _ from 'lodash';
import * as web3Abi from 'web3-eth-abi';
@@ -7,7 +7,9 @@ export const encoder = {
const constructorTypes: string[] = [];
_.each(abi, (element: AbiDefinition) => {
if (element.type === AbiType.Constructor) {
- _.each(element.inputs, (input: DataItem) => {
+ // tslint:disable-next-line:no-unnecessary-type-assertion
+ const constuctorAbi = element as ConstructorAbi;
+ _.each(constuctorAbi.inputs, (input: DataItem) => {
constructorTypes.push(input.type);
});
}
diff --git a/packages/sol-compiler/src/utils/fs_wrapper.ts b/packages/sol-compiler/src/utils/fs_wrapper.ts
index 8d6800276..a52b50963 100644
--- a/packages/sol-compiler/src/utils/fs_wrapper.ts
+++ b/packages/sol-compiler/src/utils/fs_wrapper.ts
@@ -1,4 +1,4 @@
-import { promisify } from '@0xproject/utils';
+import { promisify } from '@0x/utils';
import * as fs from 'fs';
import * as mkdirp from 'mkdirp';
diff --git a/packages/sol-compiler/test/util/constants.ts b/packages/sol-compiler/test/util/constants.ts
index 88d6db550..a74ea1b68 100644
--- a/packages/sol-compiler/test/util/constants.ts
+++ b/packages/sol-compiler/test/util/constants.ts
@@ -1,4 +1,4 @@
-import { BigNumber } from '@0xproject/utils';
+import { BigNumber } from '@0x/utils';
export const constants = {
networkId: 0,
diff --git a/packages/sol-compiler/test/util/provider.ts b/packages/sol-compiler/test/util/provider.ts
index cc372b2eb..4561a1699 100644
--- a/packages/sol-compiler/test/util/provider.ts
+++ b/packages/sol-compiler/test/util/provider.ts
@@ -1,4 +1,4 @@
-import { web3Factory } from '@0xproject/dev-utils';
+import { web3Factory } from '@0x/dev-utils';
import { Provider } from 'ethereum-types';
const providerConfigs = { shouldUseInProcessGanache: true };
diff --git a/packages/sol-compiler/tslint.json b/packages/sol-compiler/tslint.json
index ffaefe83a..dd9053357 100644
--- a/packages/sol-compiler/tslint.json
+++ b/packages/sol-compiler/tslint.json
@@ -1,3 +1,3 @@
{
- "extends": ["@0xproject/tslint-config"]
+ "extends": ["@0x/tslint-config"]
}
diff --git a/packages/sol-cov/CHANGELOG.json b/packages/sol-cov/CHANGELOG.json
index 3ced03e80..e331d608f 100644
--- a/packages/sol-cov/CHANGELOG.json
+++ b/packages/sol-cov/CHANGELOG.json
@@ -1,5 +1,24 @@
[
{
+ "version": "2.1.9",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ],
+ "timestamp": 1541740904
+ },
+ {
+ "version": "2.1.8",
+ "changes": [
+ {
+ "note": "Make @types/solidity-parser-antlr a 'dependency' so it's available to users of the library",
+ "pr": 1105
+ }
+ ],
+ "timestamp": 1539871071
+ },
+ {
"version": "2.1.7",
"changes": [
{
diff --git a/packages/sol-cov/CHANGELOG.md b/packages/sol-cov/CHANGELOG.md
index c019c9e79..e9d9d6952 100644
--- a/packages/sol-cov/CHANGELOG.md
+++ b/packages/sol-cov/CHANGELOG.md
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
+## v2.1.9 - _November 9, 2018_
+
+ * Dependencies updated
+
+## v2.1.8 - _October 18, 2018_
+
+ * Make @types/solidity-parser-antlr a 'dependency' so it's available to users of the library (#1105)
+
## v2.1.7 - _October 4, 2018_
* Dependencies updated
@@ -37,7 +45,7 @@ CHANGELOG
* Export types: `JSONRPCRequestPayload`, `Provider`, `JSONRPCErrorCallback`, `JSONRPCResponsePayload`, `JSONRPCRequestPayloadWithMethod`, `NextCallback`, `ErrorCallback`, `OnNextCompleted` and `Callback` (#924)
-## v2.0.0 - _August 13, 2018_
+## v2.0.0 - _August 14, 2018_
* Fix a bug when eth_call coverage was not computed because of silent schema validation failures (#938)
* Make `TruffleArtifactAdapter` read the `truffle.js` config for `solc` settings (#938)
diff --git a/packages/sol-cov/README.md b/packages/sol-cov/README.md
index 0a63ac06e..31d73dc63 100644
--- a/packages/sol-cov/README.md
+++ b/packages/sol-cov/README.md
@@ -1,4 +1,4 @@
-## @0xproject/sol-cov
+## @0x/sol-cov
A Solidity code coverage tool.
@@ -7,19 +7,19 @@ A Solidity code coverage tool.
## Installation
```bash
-yarn add @0xproject/sol-cov
+yarn add @0x/sol-cov
```
**Import**
```javascript
-import { CoverageSubprovider } from '@0xproject/sol-cov';
+import { CoverageSubprovider } from '@0x/sol-cov';
```
or
```javascript
-var CoverageSubprovider = require('@0xproject/sol-cov').CoverageSubprovider;
+var CoverageSubprovider = require('@0x/sol-cov').CoverageSubprovider;
```
## Contributing
@@ -47,13 +47,13 @@ yarn install
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
```bash
-PKG=@0xproject/sol-cov yarn build
+PKG=@0x/sol-cov yarn build
```
Or continuously rebuild on change:
```bash
-PKG=@0xproject/sol-cov yarn watch
+PKG=@0x/sol-cov yarn watch
```
### Clean
diff --git a/packages/sol-cov/package.json b/packages/sol-cov/package.json
index 3c8d2cf73..34e7a8559 100644
--- a/packages/sol-cov/package.json
+++ b/packages/sol-cov/package.json
@@ -1,6 +1,6 @@
{
- "name": "@0xproject/sol-cov",
- "version": "2.1.7",
+ "name": "@0x/sol-cov",
+ "version": "2.1.9",
"engines": {
"node": ">=6.12"
},
@@ -11,7 +11,7 @@
"build": "yarn pre_build && tsc -b",
"build:ci": "yarn build",
"pre_build": "run-s copy_test_fixtures",
- "lint": "tslint --project .",
+ "lint": "tslint --format stylish --project .",
"test": "run-s compile_test run_mocha",
"rebuild_and_test": "run-s clean build test",
"test:coverage": "nyc npm run test --all && yarn coverage:report:lcov",
@@ -42,13 +42,14 @@
},
"homepage": "https://github.com/0xProject/0x.js/packages/sol-cov/README.md",
"dependencies": {
- "@0xproject/dev-utils": "^1.0.12",
- "@0xproject/sol-compiler": "^1.1.7",
- "@0xproject/subproviders": "^2.0.7",
- "@0xproject/typescript-typings": "^3.0.2",
- "@0xproject/utils": "^2.0.2",
- "@0xproject/web3-wrapper": "^3.0.3",
- "ethereum-types": "^1.0.11",
+ "@0x/dev-utils": "^1.0.14",
+ "@0x/sol-compiler": "^1.1.9",
+ "@0x/subproviders": "^2.1.1",
+ "@0x/typescript-typings": "^3.0.4",
+ "@0x/utils": "^2.0.4",
+ "@0x/web3-wrapper": "^3.1.1",
+ "@types/solidity-parser-antlr": "^0.2.0",
+ "ethereum-types": "^1.1.2",
"ethereumjs-util": "^5.1.1",
"glob": "^7.1.2",
"istanbul": "^0.4.5",
@@ -60,14 +61,13 @@
"solidity-parser-antlr": "^0.2.12"
},
"devDependencies": {
- "@0xproject/tslint-config": "^1.0.8",
+ "@0x/tslint-config": "^1.0.10",
"@types/istanbul": "^0.4.30",
"@types/loglevel": "^1.5.3",
"@types/mkdirp": "^0.5.1",
"@types/mocha": "^2.2.42",
"@types/node": "*",
"@types/rimraf": "^2.0.2",
- "@types/solidity-parser-antlr": "^0.2.0",
"chai": "^4.0.1",
"copyfiles": "^2.0.0",
"dirty-chai": "^2.0.1",
@@ -78,7 +78,7 @@
"shx": "^0.2.2",
"sinon": "^4.0.0",
"tslint": "5.11.0",
- "typedoc": "0.12.0",
+ "typedoc": "0.13.0",
"typescript": "3.0.1"
},
"publishConfig": {
diff --git a/packages/sol-cov/src/artifact_adapters/sol_compiler_artifact_adapter.ts b/packages/sol-cov/src/artifact_adapters/sol_compiler_artifact_adapter.ts
index 8a74022bf..57391abbe 100644
--- a/packages/sol-cov/src/artifact_adapters/sol_compiler_artifact_adapter.ts
+++ b/packages/sol-cov/src/artifact_adapters/sol_compiler_artifact_adapter.ts
@@ -1,4 +1,4 @@
-import { logUtils } from '@0xproject/utils';
+import { logUtils } from '@0x/utils';
import { CompilerOptions, ContractArtifact } from 'ethereum-types';
import * as fs from 'fs';
import * as glob from 'glob';
diff --git a/packages/sol-cov/src/artifact_adapters/truffle_artifact_adapter.ts b/packages/sol-cov/src/artifact_adapters/truffle_artifact_adapter.ts
index b4d1aa7ba..f064911d3 100644
--- a/packages/sol-cov/src/artifact_adapters/truffle_artifact_adapter.ts
+++ b/packages/sol-cov/src/artifact_adapters/truffle_artifact_adapter.ts
@@ -1,4 +1,4 @@
-import { Compiler, CompilerOptions } from '@0xproject/sol-compiler';
+import { Compiler, CompilerOptions } from '@0x/sol-compiler';
import * as fs from 'fs';
import * as glob from 'glob';
import * as path from 'path';
diff --git a/packages/sol-cov/src/index.ts b/packages/sol-cov/src/index.ts
index 612d0869a..348e0fc9b 100644
--- a/packages/sol-cov/src/index.ts
+++ b/packages/sol-cov/src/index.ts
@@ -22,4 +22,4 @@ export {
ErrorCallback,
OnNextCompleted,
Callback,
-} from '@0xproject/subproviders';
+} from '@0x/subproviders';
diff --git a/packages/sol-cov/src/revert_trace.ts b/packages/sol-cov/src/revert_trace.ts
index a78d1afa8..d60c6e7d9 100644
--- a/packages/sol-cov/src/revert_trace.ts
+++ b/packages/sol-cov/src/revert_trace.ts
@@ -1,4 +1,4 @@
-import { logUtils } from '@0xproject/utils';
+import { logUtils } from '@0x/utils';
import { OpCode, StructLog } from 'ethereum-types';
import * as _ from 'lodash';
diff --git a/packages/sol-cov/src/trace.ts b/packages/sol-cov/src/trace.ts
index 635019fc0..b38dbdce0 100644
--- a/packages/sol-cov/src/trace.ts
+++ b/packages/sol-cov/src/trace.ts
@@ -1,4 +1,4 @@
-import { logUtils } from '@0xproject/utils';
+import { logUtils } from '@0x/utils';
import { OpCode, StructLog } from 'ethereum-types';
import * as _ from 'lodash';
diff --git a/packages/sol-cov/src/trace_collection_subprovider.ts b/packages/sol-cov/src/trace_collection_subprovider.ts
index a69bccb07..25e38768d 100644
--- a/packages/sol-cov/src/trace_collection_subprovider.ts
+++ b/packages/sol-cov/src/trace_collection_subprovider.ts
@@ -1,6 +1,6 @@
-import { BlockchainLifecycle } from '@0xproject/dev-utils';
-import { Callback, ErrorCallback, NextCallback, Subprovider } from '@0xproject/subproviders';
-import { CallDataRPC, marshaller, Web3Wrapper } from '@0xproject/web3-wrapper';
+import { BlockchainLifecycle } from '@0x/dev-utils';
+import { Callback, ErrorCallback, NextCallback, Subprovider } from '@0x/subproviders';
+import { CallDataRPC, marshaller, Web3Wrapper } from '@0x/web3-wrapper';
import { JSONRPCRequestPayload, Provider, TxData } from 'ethereum-types';
import * as _ from 'lodash';
import { Lock } from 'semaphore-async-await';
diff --git a/packages/sol-cov/src/trace_collector.ts b/packages/sol-cov/src/trace_collector.ts
index 3e2ae3516..44cffc238 100644
--- a/packages/sol-cov/src/trace_collector.ts
+++ b/packages/sol-cov/src/trace_collector.ts
@@ -1,4 +1,4 @@
-import { promisify } from '@0xproject/utils';
+import { promisify } from '@0x/utils';
import { stripHexPrefix } from 'ethereumjs-util';
import * as fs from 'fs';
import { Collector } from 'istanbul';
diff --git a/packages/sol-cov/src/utils.ts b/packages/sol-cov/src/utils.ts
index b696bd463..d8bc65e73 100644
--- a/packages/sol-cov/src/utils.ts
+++ b/packages/sol-cov/src/utils.ts
@@ -1,4 +1,4 @@
-import { addressUtils, BigNumber } from '@0xproject/utils';
+import { addressUtils, BigNumber } from '@0x/utils';
import { OpCode, StructLog } from 'ethereum-types';
import { addHexPrefix } from 'ethereumjs-util';
import * as _ from 'lodash';
diff --git a/packages/sol-cov/tslint.json b/packages/sol-cov/tslint.json
index 015dce851..631f46bca 100644
--- a/packages/sol-cov/tslint.json
+++ b/packages/sol-cov/tslint.json
@@ -1,5 +1,5 @@
{
- "extends": ["@0xproject/tslint-config"],
+ "extends": ["@0x/tslint-config"],
"rules": {
"completed-docs": false
}
diff --git a/packages/sol-doc/CHANGELOG.json b/packages/sol-doc/CHANGELOG.json
index c0b094ba0..d54569a4d 100644
--- a/packages/sol-doc/CHANGELOG.json
+++ b/packages/sol-doc/CHANGELOG.json
@@ -1,5 +1,23 @@
[
{
+ "version": "1.0.4",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ],
+ "timestamp": 1541740904
+ },
+ {
+ "timestamp": 1539871071,
+ "version": "1.0.3",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
"version": "1.0.2",
"changes": [
{
diff --git a/packages/sol-doc/CHANGELOG.md b/packages/sol-doc/CHANGELOG.md
index 437c2e7be..d44af5d7f 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.4 - _November 9, 2018_
+
+ * Dependencies updated
+
+## v1.0.3 - _October 18, 2018_
+
+ * Dependencies updated
+
## v1.0.2 - _October 4, 2018_
* Dependencies updated
diff --git a/packages/sol-doc/package.json b/packages/sol-doc/package.json
index b9fe9f56d..0eb5d6fd5 100644
--- a/packages/sol-doc/package.json
+++ b/packages/sol-doc/package.json
@@ -1,6 +1,6 @@
{
- "name": "@0xproject/sol-doc",
- "version": "1.0.2",
+ "name": "@0x/sol-doc",
+ "version": "1.0.4",
"description": "Solidity documentation generator",
"main": "lib/src/index.js",
"types": "lib/src/index.d.js",
@@ -11,7 +11,7 @@
"test:circleci": "yarn test:coverage",
"test:coverage": "nyc npm run test --all && yarn coverage:report:lcov",
"coverage:report:lcov": "nyc report --reporter=text-lcov > coverage/lcov.info",
- "lint": "tslint --project . --format stylish",
+ "lint": "tslint --format stylish --project .",
"clean": "shx rm -rf lib",
"generate-v1-protocol-docs": "(cd ../contracts/src/1.0.0; node ../../../../node_modules/.bin/sol-doc --contracts-dir . --contracts Exchange/Exchange_v1.sol TokenRegistry/TokenRegistry.sol TokenTransferProxy/TokenTransferProxy_v1.sol) > v1.0.0.json",
"generate-v2-protocol-docs": "(cd ../contracts/src/2.0.0; node ../../../../node_modules/.bin/sol-doc --contracts-dir . --contracts Exchange/Exchange.sol AssetProxy/ERC20Proxy.sol AssetProxy/ERC721Proxy.sol OrderValidator/OrderValidator.sol Forwarder/Forwarder.sol AssetProxyOwner/AssetProxyOwner.sol) > v2.0.0.json",
@@ -25,16 +25,16 @@
"author": "F. Eugene Aumson",
"license": "Apache-2.0",
"dependencies": {
- "@0xproject/sol-compiler": "^1.1.7",
- "@0xproject/types": "^1.1.4",
- "@0xproject/utils": "^2.0.2",
- "ethereum-types": "^1.0.11",
+ "@0x/sol-compiler": "^1.1.9",
+ "@0x/types": "^1.2.1",
+ "@0x/utils": "^2.0.4",
+ "ethereum-types": "^1.1.2",
"ethereumjs-util": "^5.1.1",
"lodash": "^4.17.10",
"yargs": "^12.0.2"
},
"devDependencies": {
- "@0xproject/tslint-config": "^1.0.8",
+ "@0x/tslint-config": "^1.0.10",
"chai": "^4.1.2",
"chai-as-promised": "^7.1.0",
"chai-bignumber": "^2.0.2",
diff --git a/packages/sol-doc/src/cli.ts b/packages/sol-doc/src/cli.ts
index a1847e868..6da132d56 100644
--- a/packages/sol-doc/src/cli.ts
+++ b/packages/sol-doc/src/cli.ts
@@ -1,7 +1,7 @@
import 'source-map-support/register';
import * as yargs from 'yargs';
-import { logUtils } from '@0xproject/utils';
+import { logUtils } from '@0x/utils';
import { SolDoc } from './sol_doc';
diff --git a/packages/sol-doc/src/sol_doc.ts b/packages/sol-doc/src/sol_doc.ts
index 138882c92..e2cfb39e2 100644
--- a/packages/sol-doc/src/sol_doc.ts
+++ b/packages/sol-doc/src/sol_doc.ts
@@ -14,7 +14,7 @@ import {
import ethUtil = require('ethereumjs-util');
import * as _ from 'lodash';
-import { Compiler, CompilerOptions } from '@0xproject/sol-compiler';
+import { Compiler, CompilerOptions } from '@0x/sol-compiler';
import {
CustomType,
CustomTypeChild,
@@ -27,7 +27,7 @@ import {
SolidityMethod,
Type,
TypeDocTypes,
-} from '@0xproject/types';
+} from '@0x/types';
export class SolDoc {
private _customTypeHashToName: ObjectMap<string> | undefined;
@@ -324,19 +324,25 @@ export class SolDoc {
switch (abiDefinition.type) {
case 'constructor':
docSection.constructors.push(
- this._genConstructorDoc(contractName, abiDefinition, compiledContract.devdoc),
+ // tslint:disable-next-line:no-unnecessary-type-assertion
+ this._genConstructorDoc(contractName, abiDefinition as ConstructorAbi, compiledContract.devdoc),
);
break;
case 'event':
- (docSection.events as Event[]).push(SolDoc._genEventDoc(abiDefinition));
+ // tslint:disable-next-line:no-unnecessary-type-assertion
+ (docSection.events as Event[]).push(SolDoc._genEventDoc(abiDefinition as EventAbi));
// note that we're not sending devdoc to this._genEventDoc().
// that's because the type of the events array doesn't have any fields for documentation!
break;
case 'function':
- docSection.methods.push(this._genMethodDoc(abiDefinition, compiledContract.devdoc));
+ // tslint:disable-next-line:no-unnecessary-type-assertion
+ docSection.methods.push(this._genMethodDoc(abiDefinition as MethodAbi, compiledContract.devdoc));
break;
case 'fallback':
- docSection.methods.push(SolDoc._genFallbackDoc(abiDefinition, compiledContract.devdoc));
+ // tslint:disable-next-line:no-unnecessary-type-assertion
+ docSection.methods.push(
+ SolDoc._genFallbackDoc(abiDefinition as FallbackAbi, compiledContract.devdoc),
+ );
break;
default:
throw new Error(
diff --git a/packages/sol-doc/test/solidity_doc_generator_test.ts b/packages/sol-doc/test/solidity_doc_generator_test.ts
index f166fb143..a49f29d02 100644
--- a/packages/sol-doc/test/solidity_doc_generator_test.ts
+++ b/packages/sol-doc/test/solidity_doc_generator_test.ts
@@ -3,7 +3,7 @@ import * as _ from 'lodash';
import * as chai from 'chai';
import 'mocha';
-import { DocAgnosticFormat, Event, SolidityMethod } from '@0xproject/types';
+import { DocAgnosticFormat, Event, SolidityMethod } from '@0x/types';
import { SolDoc } from '../src/sol_doc';
diff --git a/packages/sol-doc/tslint.json b/packages/sol-doc/tslint.json
index ffaefe83a..dd9053357 100644
--- a/packages/sol-doc/tslint.json
+++ b/packages/sol-doc/tslint.json
@@ -1,3 +1,3 @@
{
- "extends": ["@0xproject/tslint-config"]
+ "extends": ["@0x/tslint-config"]
}
diff --git a/packages/sol-resolver/CHANGELOG.json b/packages/sol-resolver/CHANGELOG.json
index f09870cac..a6ff84237 100644
--- a/packages/sol-resolver/CHANGELOG.json
+++ b/packages/sol-resolver/CHANGELOG.json
@@ -1,5 +1,23 @@
[
{
+ "version": "1.0.16",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ],
+ "timestamp": 1541740904
+ },
+ {
+ "timestamp": 1539871071,
+ "version": "1.0.15",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
"timestamp": 1538693146,
"version": "1.0.14",
"changes": [
diff --git a/packages/sol-resolver/CHANGELOG.md b/packages/sol-resolver/CHANGELOG.md
index ef9033dde..f8c5a7692 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.0.16 - _November 9, 2018_
+
+ * Dependencies updated
+
+## v1.0.15 - _October 18, 2018_
+
+ * Dependencies updated
+
## v1.0.14 - _October 4, 2018_
* Dependencies updated
@@ -41,7 +49,7 @@ CHANGELOG
* Dependencies updated
-## v1.0.5 - _August 13, 2018_
+## v1.0.5 - _August 14, 2018_
* Fix a bug where RelativeFSResolver would crash when trying to read a directory (#909)
* Fix a bug where NpmResolver would crash when trying to read a directory (#961)
diff --git a/packages/sol-resolver/README.md b/packages/sol-resolver/README.md
index 8487947f0..2ab336bc9 100644
--- a/packages/sol-resolver/README.md
+++ b/packages/sol-resolver/README.md
@@ -1,23 +1,23 @@
-## @0xproject/sol-resolver
+## @0x/sol-resolver
A Solidity import resolver used by [sol-compiler](https://github.com/0xProject/0x-monorepo/tree/development/packages/sol-compiler).
## Installation
```bash
-yarn add @0xproject/sol-resolver
+yarn add @0x/sol-resolver
```
**Import**
```javascript
-import { Resolver } from '@0xproject/sol-resolver';
+import { Resolver } from '@0x/sol-resolver';
```
or
```javascript
-var Resolver = require('@0xproject/sol-resolver').Resolver;
+var Resolver = require('@0x/sol-resolver').Resolver;
```
## Contributing
@@ -45,13 +45,13 @@ yarn install
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
```bash
-PKG=@0xproject/sol-resolver yarn build
+PKG=@0x/sol-resolver yarn build
```
Or continuously rebuild on change:
```bash
-PKG=@0xproject/sol-resolver yarn watch
+PKG=@0x/sol-resolver yarn watch
```
### Clean
diff --git a/packages/sol-resolver/package.json b/packages/sol-resolver/package.json
index e708fa1aa..7572072c4 100644
--- a/packages/sol-resolver/package.json
+++ b/packages/sol-resolver/package.json
@@ -1,6 +1,6 @@
{
- "name": "@0xproject/sol-resolver",
- "version": "1.0.14",
+ "name": "@0x/sol-resolver",
+ "version": "1.0.16",
"engines": {
"node": ">=6.12"
},
@@ -11,7 +11,7 @@
"build": "tsc -b",
"build:ci": "yarn build",
"clean": "shx rm -rf lib",
- "lint": "tslint --project ."
+ "lint": "tslint --format stylish --project ."
},
"repository": {
"type": "git",
@@ -23,16 +23,15 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/resolver/README.md",
"devDependencies": {
- "@0xproject/tslint-config": "^1.0.8",
- "copyfiles": "^2.0.0",
+ "@0x/tslint-config": "^1.0.10",
"make-promises-safe": "^1.1.0",
"shx": "^0.2.2",
"tslint": "5.11.0",
"typescript": "3.0.1"
},
"dependencies": {
- "@0xproject/types": "^1.1.4",
- "@0xproject/typescript-typings": "^3.0.2",
+ "@0x/types": "^1.2.1",
+ "@0x/typescript-typings": "^3.0.4",
"lodash": "^4.17.5"
},
"publishConfig": {
diff --git a/packages/sol-resolver/tslint.json b/packages/sol-resolver/tslint.json
index ffaefe83a..dd9053357 100644
--- a/packages/sol-resolver/tslint.json
+++ b/packages/sol-resolver/tslint.json
@@ -1,3 +1,3 @@
{
- "extends": ["@0xproject/tslint-config"]
+ "extends": ["@0x/tslint-config"]
}
diff --git a/packages/sra-report/.npmignore b/packages/sra-report/.npmignore
deleted file mode 100644
index d645458f6..000000000
--- a/packages/sra-report/.npmignore
+++ /dev/null
@@ -1,6 +0,0 @@
-.*
-yarn-error.log
-/src/
-/scripts/
-tsconfig.json
-/lib/monorepo_scripts/
diff --git a/packages/sra-report/CHANGELOG.json b/packages/sra-report/CHANGELOG.json
deleted file mode 100644
index c88854b08..000000000
--- a/packages/sra-report/CHANGELOG.json
+++ /dev/null
@@ -1,289 +0,0 @@
-[
- {
- "version": "1.0.13",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ],
- "timestamp": 1538693146
- },
- {
- "timestamp": 1538157789,
- "version": "1.0.12",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ]
- },
- {
- "timestamp": 1537907159,
- "version": "1.0.11",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ]
- },
- {
- "timestamp": 1537875740,
- "version": "1.0.10",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ]
- },
- {
- "timestamp": 1537541580,
- "version": "1.0.9",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ]
- },
- {
- "timestamp": 1536142250,
- "version": "1.0.8",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ]
- },
- {
- "timestamp": 1535377027,
- "version": "1.0.7",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ]
- },
- {
- "timestamp": 1535133899,
- "version": "1.0.6",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ]
- },
- {
- "timestamp": 1534210131,
- "version": "1.0.5",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ]
- },
- {
- "timestamp": 1532619515,
- "version": "1.0.4",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ]
- },
- {
- "timestamp": 1532614997,
- "version": "1.0.3",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ]
- },
- {
- "timestamp": 1532605697,
- "version": "1.0.2",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ]
- },
- {
- "timestamp": 1532357734,
- "version": "1.0.1",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ]
- },
- {
- "timestamp": 1532043000,
- "version": "1.0.0",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ]
- },
- {
- "timestamp": 1531919263,
- "version": "0.1.6",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ]
- },
- {
- "timestamp": 1531149657,
- "version": "0.1.5",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ]
- },
- {
- "timestamp": 1529397769,
- "version": "0.1.4",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ]
- },
- {
- "timestamp": 1527617805,
- "version": "0.1.3",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ]
- },
- {
- "timestamp": 1527617227,
- "version": "0.1.2",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ]
- },
- {
- "timestamp": 1527616612,
- "version": "0.1.1",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ]
- },
- {
- "version": "0.1.0",
- "changes": [
- {
- "note": "Properly export the executable binary",
- "pr": 588
- }
- ],
- "timestamp": 1527009133
- },
- {
- "timestamp": 1525477860,
- "version": "0.0.14",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ]
- },
- {
- "timestamp": 1525453812,
- "version": "0.0.13",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ]
- },
- {
- "timestamp": 1525428773,
- "version": "0.0.12",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ]
- },
- {
- "timestamp": 1524079658,
- "version": "0.0.11",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ]
- },
- {
- "timestamp": 1524073495,
- "version": "0.0.10",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ]
- },
- {
- "timestamp": 1524044013,
- "version": "0.0.9",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ]
- },
- {
- "timestamp": 1523462196,
- "version": "0.0.8",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ]
- },
- {
- "timestamp": 1522673609,
- "version": "0.0.7",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ]
- },
- {
- "version": "0.0.6",
- "changes": [
- {
- "note": "Added postman collection unit tests",
- "pr": 451
- }
- ],
- "timestamp": 1522658513
- },
- {
- "version": "0.0.2",
- "changes": [
- {
- "note": "Consolidate all `console.log` calls into `logUtils` in the `@0xproject/utils` package",
- "pr": 452
- }
- ],
- "timestamp": 1521298800
- },
- {
- "version": "0.0.1",
- "changes": [],
- "timestamp": 1520434800
- }
-]
diff --git a/packages/sra-report/CHANGELOG.md b/packages/sra-report/CHANGELOG.md
deleted file mode 100644
index 803baae5b..000000000
--- a/packages/sra-report/CHANGELOG.md
+++ /dev/null
@@ -1,132 +0,0 @@
-<!--
-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.13 - _October 4, 2018_
-
- * Dependencies updated
-
-## v1.0.12 - _September 28, 2018_
-
- * Dependencies updated
-
-## v1.0.11 - _September 25, 2018_
-
- * Dependencies updated
-
-## v1.0.10 - _September 25, 2018_
-
- * Dependencies updated
-
-## v1.0.9 - _September 21, 2018_
-
- * Dependencies updated
-
-## v1.0.8 - _September 5, 2018_
-
- * Dependencies updated
-
-## v1.0.7 - _August 27, 2018_
-
- * Dependencies updated
-
-## v1.0.6 - _August 24, 2018_
-
- * Dependencies updated
-
-## v1.0.5 - _August 13, 2018_
-
- * Dependencies updated
-
-## v1.0.4 - _July 26, 2018_
-
- * Dependencies updated
-
-## v1.0.3 - _July 26, 2018_
-
- * Dependencies updated
-
-## v1.0.2 - _July 26, 2018_
-
- * Dependencies updated
-
-## v1.0.1 - _July 23, 2018_
-
- * Dependencies updated
-
-## v1.0.0 - _July 19, 2018_
-
- * Dependencies updated
-
-## v0.1.6 - _July 18, 2018_
-
- * Dependencies updated
-
-## v0.1.5 - _July 9, 2018_
-
- * Dependencies updated
-
-## v0.1.4 - _June 19, 2018_
-
- * Dependencies updated
-
-## v0.1.3 - _May 29, 2018_
-
- * Dependencies updated
-
-## v0.1.2 - _May 29, 2018_
-
- * Dependencies updated
-
-## v0.1.1 - _May 29, 2018_
-
- * Dependencies updated
-
-## v0.1.0 - _May 22, 2018_
-
- * Properly export the executable binary (#588)
-
-## v0.0.14 - _May 4, 2018_
-
- * Dependencies updated
-
-## v0.0.13 - _May 4, 2018_
-
- * Dependencies updated
-
-## v0.0.12 - _May 4, 2018_
-
- * Dependencies updated
-
-## v0.0.11 - _April 18, 2018_
-
- * Dependencies updated
-
-## v0.0.10 - _April 18, 2018_
-
- * Dependencies updated
-
-## v0.0.9 - _April 18, 2018_
-
- * Dependencies updated
-
-## v0.0.8 - _April 11, 2018_
-
- * Dependencies updated
-
-## v0.0.7 - _April 2, 2018_
-
- * Dependencies updated
-
-## v0.0.6 - _April 2, 2018_
-
- * Added postman collection unit tests (#451)
-
-## v0.0.2 - _March 17, 2018_
-
- * Consolidate all `console.log` calls into `logUtils` in the `@0xproject/utils` package (#452)
-
-## v0.0.1 - _March 7, 2018_
diff --git a/packages/sra-report/README.md b/packages/sra-report/README.md
deleted file mode 100644
index d8df36a29..000000000
--- a/packages/sra-report/README.md
+++ /dev/null
@@ -1,138 +0,0 @@
-# SRA Report
-
-This tool allows you to generate reports that detail an endpoint's [standard relayer API HTTP specification](https://github.com/0xProject/standard-relayer-api/blob/master/http/v0.md) compliance. The tool will perform a [Postman collection](https://www.getpostman.com/docs/v6/postman/collections/creating_collections) run and either print a report to the console or save it to disk as a json file. SRA report can also output a Postman collection file and [Postman environment](https://www.getpostman.com/docs/v6/postman/environments_and_globals/manage_environments) file in order to facilitate replication and debugging of collection runs using the [Postman native app](https://www.getpostman.com/docs/v6/postman/launching_postman/installation_and_updates).
-
-The tool currently performs the following checks for each endpoint:
-
-* `application/json` Content-Type header validation
-* JSON schema validation
-* Correct filtering when a query paramater is provided (ex. when querying for a specific maker address, all orders returned have the same maker address that was provided by the query)
-
-Features to come:
-
-* Correct sorting (ex. the `/orderbook` endpoint should return orders in order of price)
-* Tests for pagination
-* Tests for the `POST /order` endpoint
-* Tests for failure cases and errors
-
-## Installation
-
-`yarn add -g @0xproject/sra-report`
-
-## Options
-
-```
-sra-report
-Options:
- --help Show help [boolean]
- --version Show version number [boolean]
- --endpoint-url, -e API endpoint url to test for standard relayer API
- compliance [string] [required]
- --output, -o, --out The relative path to write the report generated by
- the collection run, prints to console by default
- [string]
- --network-id, -n ID of the network that the API is serving orders
- from [number] [default: 1]
- --environment, --env The relative path to a postman environment file
- for the collection run [string]
- --export-collection, --ec The relative path to write the postman collection
- file used by the collection run [string]
- --export-environment, --ee The relative path to write the postman environment
- file used by the collection run [string]
-```
-
-## Example Usage
-
-### Print report to console
-
-```bash
-sra-report --endpoint-url 'http://api.example.com'
-```
-
-### Save a report to disk
-
-```bash
-sra-report --endpoint-url 'http://api.example.com' --output 'path/to/report.json'
-```
-
-### Generate report for an endpoint that serves kovan testnet orders
-
-```bash
-sra-report --endpoint-url 'http://kovan.api.example.com' --network-id 42
-```
-
-### Write Postman collection and environment files for use in the Postman native app
-
-```bash
-sra-report --endpoint-url 'http://.api.example.com' --export-collection 'path/to/collection.json' --export-environment 'path/to/environment.json'
-```
-
-### Run the report using a custom environment
-
-```bash
-sra-report --endpoint-url 'http://.api.example.com' --environment 'path/to/custom/environment.json'
-```
-
-## Custom environments
-
-When testing your standard relayer API endpoint in development, it may be useful to modify the Postman environment file generated by this tool such that specific query parameters are used during the collection run. For example, by default, this tool will grab the first order it can from the `/orders` endpoint and use properties from that order as query parameters for the rest of the run. Another example is the tool will default to the [WETH](https://etherscan.io/address/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2) and [ZRX](https://etherscan.io/address/0xe41d2489571d322189246dafa5ebde1f4699f498) token contracts when querying some endpoints but you may want to specify these.
-
-In order to provide a custom environment to the tool, perform the following steps:
-
-1. Export a Postman environment file using the tool: [example](#Write-Postman-collection-and-environment-files-for-use-in-the-Postman-native-app)
-2. Open the Postman environment file using your favorite text editor or in the Postman native app
-3. Modify the specific values you want
-4. Save the environment file and export it if using the Postman native app
-5. Run the tool and supply a path to your modified environment file: [example](#Run-the-report-using-a-custom-environment)
-
-## Contributing
-
-We welcome improvements and fixes from the wider community! To report bugs within this package, please create an issue in this repository.
-
-Please read our [contribution guidelines](../../CONTRIBUTING.md) before getting started.
-
-### Install dependencies
-
-If you don't have yarn workspaces enabled (Yarn < v1.0) - enable them:
-
-```bash
-yarn config set workspaces-experimental true
-```
-
-Then install dependencies
-
-```bash
-yarn install
-```
-
-### Build
-
-To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
-
-```bash
-PKG=@0xproject/sra-report yarn build
-```
-
-Or continuously rebuild on change:
-
-```bash
-PKG=@0xproject/sra-report yarn watch
-```
-
-### Clean
-
-```bash
-yarn clean
-```
-
-### Lint
-
-```bash
-yarn lint
-```
-
-### Run Tests
-
-```bash
-yarn test
-```
diff --git a/packages/sra-report/bin/sra-report.js b/packages/sra-report/bin/sra-report.js
deleted file mode 100755
index 8d6bdccf8..000000000
--- a/packages/sra-report/bin/sra-report.js
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/usr/bin/env node
-require('../lib/src/index.js')
diff --git a/packages/sra-report/package.json b/packages/sra-report/package.json
deleted file mode 100644
index a822aa61d..000000000
--- a/packages/sra-report/package.json
+++ /dev/null
@@ -1,73 +0,0 @@
-{
- "name": "@0xproject/sra-report",
- "version": "1.0.13",
- "engines": {
- "node": ">=6.12"
- },
- "description": "Generate reports for standard relayer API compliance",
- "main": "lib/src/index.js",
- "types": "lib/src/index.d.ts",
- "scripts": {
- "clean": "shx rm -rf lib",
- "build": "tsc -b",
- "build:ci": "yarn build",
- "lint": "tslint --project .",
- "test:circleci": "yarn test:coverage",
- "test:coverage": "nyc npm run test --all && yarn coverage:report:lcov",
- "coverage:report:lcov": "nyc report --reporter=text-lcov > coverage/lcov.info",
- "test": "run-s copy_test_environments copy_test_fixtures run_mocha",
- "rebuild_and_test": "run-s clean build test",
- "copy_test_fixtures": "copyfiles -u 2 './test/fixtures/**/*.json' ./lib/test/fixtures",
- "copy_test_environments": "copyfiles -u 2 './test/environments/**/*.json' ./lib/test/environments",
- "run_mocha": "mocha --require source-map-support/register --require make-promises-safe lib/test/**/*_test.js --exit"
- },
- "bin": {
- "sra-report": "bin/sra-report.js"
- },
- "repository": {
- "type": "git",
- "url": "https://github.com/0xProject/0x-monorepo.git"
- },
- "license": "Apache-2.0",
- "bugs": {
- "url": "https://github.com/0xProject/0x-monorepo/issues"
- },
- "homepage": "https://github.com/0xProject/0x-monorepo/packages/sra-report/README.md",
- "dependencies": {
- "@0xproject/assert": "^1.0.13",
- "@0xproject/connect": "1.0.4",
- "@0xproject/json-schemas": "^0.8.3",
- "@0xproject/order-utils": "^0.0.9",
- "@0xproject/types": "^0.8.2",
- "@0xproject/typescript-typings": "^3.0.2",
- "@0xproject/utils": "^2.0.2",
- "chalk": "^2.3.0",
- "lodash": "^4.17.5",
- "newman": "^3.9.3",
- "yargs": "^10.0.3"
- },
- "devDependencies": {
- "@0xproject/tslint-config": "^1.0.8",
- "@types/lodash": "4.14.104",
- "@types/mocha": "^2.2.48",
- "@types/newman": "^3.9.0",
- "@types/nock": "^9.1.2",
- "@types/node": "*",
- "@types/yargs": "^10.0.0",
- "chai": "^4.0.1",
- "chai-as-promised": "^7.1.0",
- "copyfiles": "^2.0.0",
- "dirty-chai": "^2.0.1",
- "make-promises-safe": "^1.1.0",
- "mocha": "^4.1.0",
- "nock": "^9.2.3",
- "npm-run-all": "^4.1.2",
- "nyc": "^11.0.1",
- "shx": "^0.2.2",
- "tslint": "5.11.0",
- "typescript": "3.0.1"
- },
- "publishConfig": {
- "access": "public"
- }
-}
diff --git a/packages/sra-report/postman_collections/sra_report.postman_collection.json b/packages/sra-report/postman_collections/sra_report.postman_collection.json
deleted file mode 100644
index 9a8e8e0fa..000000000
--- a/packages/sra-report/postman_collections/sra_report.postman_collection.json
+++ /dev/null
@@ -1,910 +0,0 @@
-{
- "info": {
- "name": "sra_report",
- "_postman_id": "d5828163-ddb9-46a9-ec39-c2b81417b6c0",
- "description":
- "[Standard Relayer API](\nhttps://github.com/0xProject/standard-relayer-api)\n\n\n0x Protocol is an open standard. Because of this, we expect many independent applications to be built that will want to use the protocol. In order to make it easier for anyone to source liquidity that conforms to the 0x order format, relayers can opt-in to implementing a set of standard relayer API endpoints. In doing so, they allow clients of the standard relayer API to access the orders on their orderbook.",
- "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
- },
- "item": [
- {
- "name": "GET /token_pairs",
- "description": "",
- "item": [
- {
- "name": "default request",
- "event": [
- {
- "listen": "test",
- "script": {
- "id": "42cb5e3f-6013-4a7c-b341-0d10cb3f2c9c",
- "type": "text/javascript",
- "exec": [""]
- }
- }
- ],
- "request": {
- "method": "GET",
- "header": [],
- "body": {},
- "url": {
- "raw": "{{url}}/token_pairs",
- "host": ["{{url}}"],
- "path": ["token_pairs"]
- },
- "description": ""
- },
- "response": []
- },
- {
- "name": "tokenA param",
- "event": [
- {
- "listen": "test",
- "script": {
- "id": "0b0712ff-7846-40a3-9253-4bca2551350c",
- "type": "text/javascript",
- "exec": [
- "const filterTokenEnvKey = 'tokenContractAddress1';",
- "const filterTokenAddress = pm.environment.get(filterTokenEnvKey);",
- "const responseJsonData = pm.response.json();",
- "pm.test('Token pairs are properly filtered', function() {",
- " _.forEach(responseJsonData, function(tokenPair) {",
- " const tokenAIsFilterToken = _.get(tokenPair, 'tokenA.address') === filterTokenAddress;",
- " const tokenBIsFilterToken = _.get(tokenPair, 'tokenB.address') === filterTokenAddress;",
- " const condition = tokenAIsFilterToken || tokenBIsFilterToken",
- " pm.expect(condition).to.be.true;",
- " });",
- "});",
- ""
- ]
- }
- }
- ],
- "request": {
- "method": "GET",
- "header": [],
- "body": {},
- "url": {
- "raw": "{{url}}/token_pairs?tokenA={{tokenContractAddress1}}",
- "host": ["{{url}}"],
- "path": ["token_pairs"],
- "query": [
- {
- "key": "tokenA",
- "value": "{{tokenContractAddress1}}",
- "equals": true
- }
- ]
- },
- "description": ""
- },
- "response": []
- },
- {
- "name": "tokenB param",
- "event": [
- {
- "listen": "test",
- "script": {
- "id": "ef0e6be8-06d8-4975-a1c4-2199bc8b5aa6",
- "type": "text/javascript",
- "exec": [
- "const filterTokenEnvKey = 'tokenContractAddress1';",
- "const filterTokenAddress = pm.environment.get(filterTokenEnvKey);",
- "const responseJsonData = pm.response.json();",
- "pm.test('Token pairs are properly filtered', function() {",
- " _.forEach(responseJsonData, function(tokenPair) {",
- " const tokenAIsFilterToken = _.get(tokenPair, 'tokenA.address') === filterTokenAddress;",
- " const tokenBIsFilterToken = _.get(tokenPair, 'tokenB.address') === filterTokenAddress;",
- " const condition = tokenAIsFilterToken || tokenBIsFilterToken",
- " pm.expect(condition).to.be.true;",
- " });",
- "});",
- ""
- ]
- }
- }
- ],
- "request": {
- "method": "GET",
- "header": [],
- "body": {},
- "url": {
- "raw": "{{url}}/token_pairs?tokenB={{tokenContractAddress1}}",
- "host": ["{{url}}"],
- "path": ["token_pairs"],
- "query": [
- {
- "key": "tokenB",
- "value": "{{tokenContractAddress1}}",
- "equals": true
- }
- ]
- },
- "description": ""
- },
- "response": []
- },
- {
- "name": "tokenA and tokenB params",
- "event": [
- {
- "listen": "test",
- "script": {
- "id": "9ca4bed3-b8e0-4a90-96ba-42f0da3a7d68",
- "type": "text/javascript",
- "exec": [
- "const filterTokenAEnvKey = 'tokenContractAddress1';",
- "const filterTokenBEnvKey = 'tokenContractAddress2';",
- "const filterTokenAAddress = pm.environment.get(filterTokenAEnvKey);",
- "const filterTokenBAddress = pm.environment.get(filterTokenBEnvKey);",
- "const responseJsonData = pm.response.json();",
- "pm.test('Token pairs are properly filtered', function() {",
- " _.forEach(responseJsonData, function(tokenPair) {",
- " const tokenAIsFilterTokenA = _.get(tokenPair, 'tokenA.address') === filterTokenAAddress;",
- " const tokenAIsFilterTokenB = _.get(tokenPair, 'tokenA.address') === filterTokenBAddress;",
- " const tokenBIsFilterTokenA = _.get(tokenPair, 'tokenB.address') === filterTokenAAddress;",
- " const tokenBIsFilterTokenB = _.get(tokenPair, 'tokenB.address') === filterTokenBAddress;",
- " const condition = (tokenAIsFilterTokenA && tokenBIsFilterTokenB) || (tokenBIsFilterTokenA && tokenAIsFilterTokenB)",
- " pm.expect(condition).to.be.true;",
- " });",
- "});",
- ""
- ]
- }
- }
- ],
- "request": {
- "method": "GET",
- "header": [],
- "body": {},
- "url": {
- "raw":
- "{{url}}/token_pairs?tokenA={{tokenContractAddress1}}&tokenB={{tokenContractAddress2}}",
- "host": ["{{url}}"],
- "path": ["token_pairs"],
- "query": [
- {
- "key": "tokenA",
- "value": "{{tokenContractAddress1}}",
- "equals": true
- },
- {
- "key": "tokenB",
- "value": "{{tokenContractAddress2}}",
- "equals": true
- }
- ]
- },
- "description": ""
- },
- "response": []
- }
- ],
- "event": [
- {
- "listen": "prerequest",
- "script": {
- "id": "3d032e92-6a17-49f0-8115-bae1c7298b55",
- "type": "text/javascript",
- "exec": [""]
- }
- },
- {
- "listen": "test",
- "script": {
- "id": "25addb38-bd1c-4eb3-a193-5617119dc0d6",
- "type": "text/javascript",
- "exec": [
- "const schema = tv4.getSchema('/RelayerApiTokenPairsResponse');",
- "const responseJsonData = pm.response.json();",
- "",
- "pm.test('Schema is valid', function() {",
- " pm.expect(tv4.validate(responseJsonData, schema)).to.be.true;",
- "});",
- ""
- ]
- }
- }
- ]
- },
- {
- "name": "GET /orders",
- "description": "",
- "item": [
- {
- "name": "default request",
- "event": [
- {
- "listen": "test",
- "script": {
- "id": "118f47dd-1d93-4288-841f-de88783eff3b",
- "type": "text/javascript",
- "exec": [""]
- }
- }
- ],
- "request": {
- "method": "GET",
- "header": [],
- "body": {},
- "url": {
- "raw": "{{url}}/orders",
- "host": ["{{url}}"],
- "path": ["orders"]
- },
- "description":
- "Retrieves a list of orders given query parameters. For querying an entire orderbook snapshot, the orderbook endpoint is recommended.\n\nParameters\n * exchangeContractAddress [string]: returns orders created for this exchange address\n * tokenAddress [string]: returns orders where makerTokenAddress or takerTokenAddress is token address\n * makerTokenAddress [string]: returns orders with specified makerTokenAddress\n * takerTokenAddress [string]: returns orders with specified makerTokenAddress\n * maker [string]: returns orders where maker is maker address\n * taker [string]: returns orders where taker is taker address\n * trader [string]: returns orders where maker or taker is trader address\n * feeRecipient [string]: returns orders where feeRecipient is feeRecipient address\n\nAll parameters are optional."
- },
- "response": []
- },
- {
- "name": "exchangeContract param",
- "event": [
- {
- "listen": "test",
- "script": {
- "id": "374c4b28-5672-400c-8c23-9cb1a3e63117",
- "type": "text/javascript",
- "exec": [
- "const exchangeContractEnvKey = 'exchangeContractAddress';",
- "const requestedExchangeContractAddress = pm.environment.get(exchangeContractEnvKey);",
- "const responseJsonData = pm.response.json();",
- "pm.test('Orders are properly filtered', function() {",
- " _.forEach(responseJsonData, function(order) {",
- " const returnedExchangeContractAddress = _.get(order, 'exchangeContractAddress');",
- " pm.expect(requestedExchangeContractAddress).to.equal(returnedExchangeContractAddress);",
- " });",
- "});",
- ""
- ]
- }
- }
- ],
- "request": {
- "method": "GET",
- "header": [],
- "body": {},
- "url": {
- "raw": "{{url}}/orders?exchangeContractAddress={{exchangeContractAddress}}",
- "host": ["{{url}}"],
- "path": ["orders"],
- "query": [
- {
- "key": "exchangeContractAddress",
- "value": "{{exchangeContractAddress}}",
- "equals": true
- }
- ]
- },
- "description":
- "Retrieves a list of orders given query parameters. For querying an entire orderbook snapshot, the orderbook endpoint is recommended.\n\nParameters\n * exchangeContractAddress [string]: returns orders created for this exchange address\n * tokenAddress [string]: returns orders where makerTokenAddress or takerTokenAddress is token address\n * makerTokenAddress [string]: returns orders with specified makerTokenAddress\n * takerTokenAddress [string]: returns orders with specified makerTokenAddress\n * maker [string]: returns orders where maker is maker address\n * taker [string]: returns orders where taker is taker address\n * trader [string]: returns orders where maker or taker is trader address\n * feeRecipient [string]: returns orders where feeRecipient is feeRecipient address\n\nAll parameters are optional."
- },
- "response": []
- },
- {
- "name": "tokenAddress param",
- "event": [
- {
- "listen": "test",
- "script": {
- "id": "e74a9069-18b9-42d3-b2d0-e18580ad73f2",
- "type": "text/javascript",
- "exec": [
- "const filterTokenEnvKey = 'tokenContractAddress2';",
- "const filterTokenAddress = pm.environment.get(filterTokenEnvKey);",
- "const responseJsonData = pm.response.json();",
- "pm.test('Orders are properly filtered', function() {",
- " _.forEach(responseJsonData, function(order) {",
- " const makerTokenAddress = _.get(order, 'makerTokenAddress');",
- " const takerTokenAddress = _.get(order, 'takerTokenAddress');",
- " const makerTokenAddressIsFilterToken = makerTokenAddress === filterTokenAddress;",
- " const takerTokenAddressIsFilterToken = takerTokenAddress === filterTokenAddress;",
- " const condition = makerTokenAddressIsFilterToken || takerTokenAddressIsFilterToken;",
- " pm.expect(condition).to.be.true;",
- " });",
- "});",
- ""
- ]
- }
- }
- ],
- "request": {
- "method": "GET",
- "header": [],
- "body": {},
- "url": {
- "raw": "{{url}}/orders?tokenAddress={{tokenContractAddress2}}",
- "host": ["{{url}}"],
- "path": ["orders"],
- "query": [
- {
- "key": "tokenAddress",
- "value": "{{tokenContractAddress2}}",
- "equals": true
- }
- ]
- },
- "description":
- "Retrieves a list of orders given query parameters. For querying an entire orderbook snapshot, the orderbook endpoint is recommended.\n\nParameters\n * exchangeContractAddress [string]: returns orders created for this exchange address\n * tokenAddress [string]: returns orders where makerTokenAddress or takerTokenAddress is token address\n * makerTokenAddress [string]: returns orders with specified makerTokenAddress\n * takerTokenAddress [string]: returns orders with specified makerTokenAddress\n * maker [string]: returns orders where maker is maker address\n * taker [string]: returns orders where taker is taker address\n * trader [string]: returns orders where maker or taker is trader address\n * feeRecipient [string]: returns orders where feeRecipient is feeRecipient address\n\nAll parameters are optional."
- },
- "response": []
- },
- {
- "name": "makerTokenAddress param",
- "event": [
- {
- "listen": "test",
- "script": {
- "id": "c539f306-aa03-495d-a90a-0179e1b751aa",
- "type": "text/javascript",
- "exec": [
- "const filterTokenEnvKey = 'tokenContractAddress2';",
- "const filterTokenAddress = pm.environment.get(filterTokenEnvKey);",
- "const responseJsonData = pm.response.json();",
- "pm.test('Orders are properly filtered', function() {",
- " _.forEach(responseJsonData, function(order) {",
- " const makerTokenAddress = _.get(order, 'makerTokenAddress');",
- " pm.expect(makerTokenAddress).to.be.equal(filterTokenAddress);",
- " });",
- "});",
- ""
- ]
- }
- }
- ],
- "request": {
- "method": "GET",
- "header": [],
- "body": {},
- "url": {
- "raw": "{{url}}/orders?makerTokenAddress={{tokenContractAddress2}}",
- "host": ["{{url}}"],
- "path": ["orders"],
- "query": [
- {
- "key": "makerTokenAddress",
- "value": "{{tokenContractAddress2}}",
- "equals": true
- }
- ]
- },
- "description":
- "Retrieves a list of orders given query parameters. For querying an entire orderbook snapshot, the orderbook endpoint is recommended.\n\nParameters\n * exchangeContractAddress [string]: returns orders created for this exchange address\n * tokenAddress [string]: returns orders where makerTokenAddress or takerTokenAddress is token address\n * makerTokenAddress [string]: returns orders with specified makerTokenAddress\n * takerTokenAddress [string]: returns orders with specified makerTokenAddress\n * maker [string]: returns orders where maker is maker address\n * taker [string]: returns orders where taker is taker address\n * trader [string]: returns orders where maker or taker is trader address\n * feeRecipient [string]: returns orders where feeRecipient is feeRecipient address\n\nAll parameters are optional."
- },
- "response": []
- },
- {
- "name": "takerTokenAddress param",
- "event": [
- {
- "listen": "test",
- "script": {
- "id": "49b2fcaf-5fe2-471f-ae10-e48a440d4c6d",
- "type": "text/javascript",
- "exec": [
- "const filterTokenEnvKey = 'tokenContractAddress2';",
- "const filterTokenAddress = pm.environment.get(filterTokenEnvKey);",
- "const responseJsonData = pm.response.json();",
- "pm.test('Orders are properly filtered', function() {",
- " _.forEach(responseJsonData, function(order) {",
- " const takerTokenAddress = _.get(order, 'takerTokenAddress');",
- " pm.expect(takerTokenAddress).to.be.equal(filterTokenAddress);",
- " });",
- "});",
- ""
- ]
- }
- }
- ],
- "request": {
- "method": "GET",
- "header": [],
- "body": {},
- "url": {
- "raw": "{{url}}/orders?takerTokenAddress={{tokenContractAddress2}}",
- "host": ["{{url}}"],
- "path": ["orders"],
- "query": [
- {
- "key": "takerTokenAddress",
- "value": "{{tokenContractAddress2}}",
- "equals": true
- }
- ]
- },
- "description":
- "Retrieves a list of orders given query parameters. For querying an entire orderbook snapshot, the orderbook endpoint is recommended.\n\nParameters\n * exchangeContractAddress [string]: returns orders created for this exchange address\n * tokenAddress [string]: returns orders where makerTokenAddress or takerTokenAddress is token address\n * makerTokenAddress [string]: returns orders with specified makerTokenAddress\n * takerTokenAddress [string]: returns orders with specified makerTokenAddress\n * maker [string]: returns orders where maker is maker address\n * taker [string]: returns orders where taker is taker address\n * trader [string]: returns orders where maker or taker is trader address\n * feeRecipient [string]: returns orders where feeRecipient is feeRecipient address\n\nAll parameters are optional."
- },
- "response": []
- },
- {
- "name": "maker param",
- "event": [
- {
- "listen": "test",
- "script": {
- "id": "1f5960de-117f-44fb-82e0-581626cbf62b",
- "type": "text/javascript",
- "exec": [
- "const orderMakerEnvKey = 'orderMaker';",
- "const referenceOrderMakerAddress = pm.environment.get(orderMakerEnvKey);",
- "const responseJsonData = pm.response.json();",
- "pm.test('Orders are properly filtered', function() {",
- " _.forEach(responseJsonData, function(order) {",
- " const returnedMakerAddress = _.get(order, 'maker');",
- " pm.expect(referenceOrderMakerAddress).to.be.equal(returnedMakerAddress);",
- " });",
- "});",
- ""
- ]
- }
- }
- ],
- "request": {
- "method": "GET",
- "header": [],
- "body": {},
- "url": {
- "raw": "{{url}}/orders?maker={{orderMaker}}",
- "host": ["{{url}}"],
- "path": ["orders"],
- "query": [
- {
- "key": "maker",
- "value": "{{orderMaker}}",
- "equals": true
- }
- ]
- },
- "description":
- "Retrieves a list of orders given query parameters. For querying an entire orderbook snapshot, the orderbook endpoint is recommended.\n\nParameters\n * exchangeContractAddress [string]: returns orders created for this exchange address\n * tokenAddress [string]: returns orders where makerTokenAddress or takerTokenAddress is token address\n * makerTokenAddress [string]: returns orders with specified makerTokenAddress\n * takerTokenAddress [string]: returns orders with specified makerTokenAddress\n * maker [string]: returns orders where maker is maker address\n * taker [string]: returns orders where taker is taker address\n * trader [string]: returns orders where maker or taker is trader address\n * feeRecipient [string]: returns orders where feeRecipient is feeRecipient address\n\nAll parameters are optional."
- },
- "response": []
- },
- {
- "name": "taker param",
- "event": [
- {
- "listen": "test",
- "script": {
- "id": "f23de2eb-b444-49d3-93b7-14ae712d6502",
- "type": "text/javascript",
- "exec": [
- "const orderTakerEnvKey = 'orderTaker';",
- "const referenceOrderTakerAddress = pm.environment.get(orderTakerEnvKey);",
- "const responseJsonData = pm.response.json();",
- "pm.test('Orders are properly filtered', function() {",
- " _.forEach(responseJsonData, function(order) {",
- " const returnedTakerAddress = _.get(order, 'taker');",
- " pm.expect(referenceOrderTakerAddress).to.be.equal(returnedTakerAddress);",
- " });",
- "});",
- ""
- ]
- }
- }
- ],
- "request": {
- "method": "GET",
- "header": [],
- "body": {},
- "url": {
- "raw": "{{url}}/orders?taker={{orderTaker}}",
- "host": ["{{url}}"],
- "path": ["orders"],
- "query": [
- {
- "key": "taker",
- "value": "{{orderTaker}}",
- "equals": true
- }
- ]
- },
- "description":
- "Retrieves a list of orders given query parameters. For querying an entire orderbook snapshot, the orderbook endpoint is recommended.\n\nParameters\n * exchangeContractAddress [string]: returns orders created for this exchange address\n * tokenAddress [string]: returns orders where makerTokenAddress or takerTokenAddress is token address\n * makerTokenAddress [string]: returns orders with specified makerTokenAddress\n * takerTokenAddress [string]: returns orders with specified makerTokenAddress\n * maker [string]: returns orders where maker is maker address\n * taker [string]: returns orders where taker is taker address\n * trader [string]: returns orders where maker or taker is trader address\n * feeRecipient [string]: returns orders where feeRecipient is feeRecipient address\n\nAll parameters are optional."
- },
- "response": []
- },
- {
- "name": "trader param",
- "event": [
- {
- "listen": "test",
- "script": {
- "id": "9689639a-47ce-4c3b-8180-859fd28437be",
- "type": "text/javascript",
- "exec": [
- "const orderTraderEnvKey = 'orderMaker';",
- "const referenceOrderTraderAddress = pm.environment.get(orderTraderEnvKey);",
- "const responseJsonData = pm.response.json();",
- "pm.test('Orders are properly filtered', function() {",
- " _.forEach(responseJsonData, function(order) {",
- " const returnedMakerAddress = _.get(order, 'maker');",
- " const returnedTakerAddress = _.get(order, 'taker');",
- " const condition = (referenceOrderTraderAddress === returnedMakerAddress) || (referenceOrderTraderAddress === returnedTakerAddress);",
- " pm.expect(condition).to.be.true;",
- " });",
- "});",
- ""
- ]
- }
- }
- ],
- "request": {
- "method": "GET",
- "header": [],
- "body": {},
- "url": {
- "raw": "{{url}}/orders?trader={{orderMaker}}",
- "host": ["{{url}}"],
- "path": ["orders"],
- "query": [
- {
- "key": "trader",
- "value": "{{orderMaker}}",
- "equals": true
- }
- ]
- },
- "description":
- "Retrieves a list of orders given query parameters. For querying an entire orderbook snapshot, the orderbook endpoint is recommended.\n\nParameters\n * exchangeContractAddress [string]: returns orders created for this exchange address\n * tokenAddress [string]: returns orders where makerTokenAddress or takerTokenAddress is token address\n * makerTokenAddress [string]: returns orders with specified makerTokenAddress\n * takerTokenAddress [string]: returns orders with specified makerTokenAddress\n * maker [string]: returns orders where maker is maker address\n * taker [string]: returns orders where taker is taker address\n * trader [string]: returns orders where maker or taker is trader address\n * feeRecipient [string]: returns orders where feeRecipient is feeRecipient address\n\nAll parameters are optional."
- },
- "response": []
- },
- {
- "name": "feeRecipient param",
- "event": [
- {
- "listen": "test",
- "script": {
- "id": "010c0cf6-8d5b-4fe3-8b92-b2009ea43a3e",
- "type": "text/javascript",
- "exec": [
- "const orderFeeRecipientEnvKey = 'orderFeeRecipient';",
- "const referenceOrderFeeRecipientAddress = pm.environment.get(orderFeeRecipientEnvKey);",
- "const responseJsonData = pm.response.json();",
- "pm.test('Orders are properly filtered', function() {",
- " _.forEach(responseJsonData, function(order) {",
- " const returnedFeeRecipientAddress = _.get(order, 'feeRecipient');",
- " pm.expect(referenceOrderFeeRecipientAddress).to.be.equal(returnedFeeRecipientAddress);",
- " });",
- "});",
- ""
- ]
- }
- }
- ],
- "request": {
- "method": "GET",
- "header": [],
- "body": {},
- "url": {
- "raw": "{{url}}/orders?feeRecipient={{orderFeeRecipient}}",
- "host": ["{{url}}"],
- "path": ["orders"],
- "query": [
- {
- "key": "feeRecipient",
- "value": "{{orderFeeRecipient}}",
- "equals": true
- }
- ]
- },
- "description":
- "Retrieves a list of orders given query parameters. For querying an entire orderbook snapshot, the orderbook endpoint is recommended.\n\nParameters\n * exchangeContractAddress [string]: returns orders created for this exchange address\n * tokenAddress [string]: returns orders where makerTokenAddress or takerTokenAddress is token address\n * makerTokenAddress [string]: returns orders with specified makerTokenAddress\n * takerTokenAddress [string]: returns orders with specified makerTokenAddress\n * maker [string]: returns orders where maker is maker address\n * taker [string]: returns orders where taker is taker address\n * trader [string]: returns orders where maker or taker is trader address\n * feeRecipient [string]: returns orders where feeRecipient is feeRecipient address\n\nAll parameters are optional."
- },
- "response": []
- }
- ],
- "event": [
- {
- "listen": "prerequest",
- "script": {
- "id": "4eafcc26-fb01-4182-b963-67a0b418fcbc",
- "type": "text/javascript",
- "exec": [""]
- }
- },
- {
- "listen": "test",
- "script": {
- "id": "d28effd1-4a73-4ee8-82cc-21b1ab06928d",
- "type": "text/javascript",
- "exec": [
- "const schema = tv4.getSchema('/signedOrdersSchema');",
- "const responseJsonData = pm.response.json();",
- "",
- "pm.test('Schema is valid', function() {",
- " pm.expect(tv4.validate(responseJsonData, schema)).to.be.true;",
- "});",
- ""
- ]
- }
- }
- ]
- },
- {
- "name": "GET /order",
- "description": "",
- "item": [
- {
- "name": "orderHash param",
- "event": [
- {
- "listen": "test",
- "script": {
- "id": "18876df2-384e-43d5-93a1-7e24571e1308",
- "type": "text/javascript",
- "exec": [
- "const orderEnvKey = 'order';",
- "const referenceOrderString = pm.environment.get(orderEnvKey);",
- "const referenceOrderJson = JSON.parse(referenceOrderString);",
- "const orderPropertyNames = [",
- " 'maker',",
- " 'taker',",
- " 'makerFee',",
- " 'takerFee',",
- " 'makerTokenAmount',",
- " 'takerTokenAmount',",
- " 'makerTokenAddress',",
- " 'takerTokenAddress',",
- " 'salt',",
- " 'feeRecipient',",
- " 'expirationUnixTimestampSec',",
- " 'exchangeContractAddress'",
- "];",
- "const signaturePropertyNames = [",
- " 'v',",
- " 'r',",
- " 's'",
- "];",
- "const returnedOrderJson = pm.response.json();",
- "pm.test('Order is properly retreived', function() {",
- " _.forEach(orderPropertyNames, function(propertyName) {",
- " const returnedProperty = _.get(returnedOrderJson, propertyName);",
- " const referenceProperty = _.get(referenceOrderJson, propertyName);",
- " pm.expect(returnedProperty).to.be.equal(referenceProperty);",
- " });",
- " const returnedSignature = _.get(returnedOrderJson, 'ecSignature');",
- " const referenceSignature = _.get(returnedOrderJson, 'ecSignature');",
- " _.forEach(signaturePropertyNames, function(propertyName) {",
- " const returnedSignatureProperty = _.get(returnedSignature, propertyName);",
- " const referenceSignatureProperty = _.get(referenceSignature, propertyName);",
- " pm.expect(returnedSignatureProperty).to.be.equal(referenceSignatureProperty);",
- " });",
- "});",
- ""
- ]
- }
- }
- ],
- "request": {
- "method": "GET",
- "header": [],
- "body": {},
- "url": {
- "raw": "{{url}}/order/{{orderHash}}",
- "host": ["{{url}}"],
- "path": ["order", "{{orderHash}}"]
- },
- "description": "Retrieves a specific order by orderHash."
- },
- "response": []
- }
- ],
- "event": [
- {
- "listen": "prerequest",
- "script": {
- "id": "e356d2ff-d105-42c1-b679-d9d917dcd68d",
- "type": "text/javascript",
- "exec": [""]
- }
- },
- {
- "listen": "test",
- "script": {
- "id": "8d2d4717-6f76-47ab-8e5a-f383192f6ee4",
- "type": "text/javascript",
- "exec": [
- "const schema = tv4.getSchema('/SignedOrder');",
- "const responseJsonData = pm.response.json();",
- "",
- "pm.test('Schema is valid', function() {",
- " pm.expect(tv4.validate(responseJsonData, schema)).to.be.true;",
- "});",
- ""
- ]
- }
- }
- ]
- },
- {
- "name": "GET /orderbook",
- "description": "",
- "item": [
- {
- "name": "baseTokenAddress and quoteTokenAddress params",
- "event": [
- {
- "listen": "test",
- "script": {
- "id": "9ed05327-1a2f-4e50-b4aa-e21f961dbe78",
- "type": "text/javascript",
- "exec": [
- "const baseTokenEnvKey = 'tokenContractAddress2';",
- "const quoteTokenEnvKey = 'tokenContractAddress1';",
- "const baseTokenAddress = pm.environment.get(baseTokenEnvKey);",
- "const quoteTokenAddress = pm.environment.get(quoteTokenEnvKey);",
- "const responseJsonData = pm.response.json();",
- "pm.test('Orderbook is properly filtered', function() {",
- " const bids = _.get(responseJsonData, 'bids');",
- " const asks = _.get(responseJsonData, 'asks');",
- " _.forEach(bids, function(order) {",
- " const makerTokenAddress = _.get(order, 'makerTokenAddress');",
- " const takerTokenAddress = _.get(order, 'takerTokenAddress');",
- " pm.expect(makerTokenAddress).to.be.equal(quoteTokenAddress);",
- " pm.expect(takerTokenAddress).to.be.equal(baseTokenAddress);",
- " });",
- " _.forEach(asks, function(order) {",
- " const makerTokenAddress = _.get(order, 'makerTokenAddress');",
- " const takerTokenAddress = _.get(order, 'takerTokenAddress');",
- " pm.expect(makerTokenAddress).to.be.equal(baseTokenAddress);",
- " pm.expect(takerTokenAddress).to.be.equal(quoteTokenAddress);",
- " });",
- "});",
- ""
- ]
- }
- }
- ],
- "request": {
- "method": "GET",
- "header": [],
- "body": {},
- "url": {
- "raw":
- "{{url}}/orderbook?baseTokenAddress={{tokenContractAddress2}}&quoteTokenAddress={{tokenContractAddress1}}",
- "host": ["{{url}}"],
- "path": ["orderbook"],
- "query": [
- {
- "key": "baseTokenAddress",
- "value": "{{tokenContractAddress2}}",
- "equals": true
- },
- {
- "key": "quoteTokenAddress",
- "value": "{{tokenContractAddress1}}",
- "equals": true
- }
- ]
- },
- "description":
- "Retrieves a list of orders given query parameters. For querying an entire orderbook snapshot, the orderbook endpoint is recommended.\n\nParameters\n * exchangeContractAddress [string]: returns orders created for this exchange address\n * tokenAddress [string]: returns orders where makerTokenAddress or takerTokenAddress is token address\n * makerTokenAddress [string]: returns orders with specified makerTokenAddress\n * takerTokenAddress [string]: returns orders with specified makerTokenAddress\n * maker [string]: returns orders where maker is maker address\n * taker [string]: returns orders where taker is taker address\n * trader [string]: returns orders where maker or taker is trader address\n * feeRecipient [string]: returns orders where feeRecipient is feeRecipient address\n\nAll parameters are optional."
- },
- "response": []
- }
- ],
- "event": [
- {
- "listen": "prerequest",
- "script": {
- "id": "bdf90dbc-9217-4089-8bc0-351baadddd3e",
- "type": "text/javascript",
- "exec": [""]
- }
- },
- {
- "listen": "test",
- "script": {
- "id": "d5080a34-57c4-4d5d-8e01-5e79599282ec",
- "type": "text/javascript",
- "exec": [
- "const schema = tv4.getSchema('/RelayerApiOrderBookResponse');",
- "const responseJsonData = pm.response.json();",
- "",
- "pm.test('Schema is valid', function() {",
- " pm.expect(tv4.validate(responseJsonData, schema)).to.be.true;",
- "});",
- ""
- ]
- }
- }
- ]
- },
- {
- "name": "POST /fees",
- "description": "",
- "item": [
- {
- "name": "default request",
- "request": {
- "method": "POST",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json"
- }
- ],
- "body": {
- "mode": "raw",
- "raw":
- "{\n \"exchangeContractAddress\": \"0x12459c951127e0c374ff9105dda097662a027093\",\n \"maker\": \"0x9e56625509c2f60af937f23b7b532600390e8c8b\",\n \"taker\": \"0x0000000000000000000000000000000000000000\",\n \"makerTokenAddress\": \"0x323b5d4c32345ced77393b3530b1eed0f346429d\",\n \"takerTokenAddress\": \"0xef7fff64389b814a946f3e92105513705ca6b990\",\n \"makerTokenAmount\": \"10000000000000000\",\n \"takerTokenAmount\": \"20000000000000000\",\n \"expirationUnixTimestampSec\": \"42\",\n \"salt\": \"67006738228878699843088602623665307406148487219438534730168799356281242528500\"\n}"
- },
- "url": {
- "raw": "{{url}}/fees",
- "host": ["{{url}}"],
- "path": ["fees"]
- },
- "description":
- "Given an unsigned order without the fee-related properties, returns the required feeRecipient, makerFee, and takerFee of that order."
- },
- "response": []
- }
- ],
- "event": [
- {
- "listen": "prerequest",
- "script": {
- "id": "75d66506-0fa9-4b0e-982b-ef53bf3310f8",
- "type": "text/javascript",
- "exec": [""]
- }
- },
- {
- "listen": "test",
- "script": {
- "id": "4c5f9f7b-8635-4bdb-9240-a74754a2de4f",
- "type": "text/javascript",
- "exec": [
- "const schema = tv4.getSchema('/RelayerApiFeesResponse');",
- "const responseJsonData = pm.response.json();",
- "",
- "pm.test('Schema is valid', function() {",
- " pm.expect(tv4.validate(responseJsonData, schema)).to.be.true;",
- "});",
- ""
- ]
- }
- }
- ]
- }
- ],
- "event": [
- {
- "listen": "prerequest",
- "script": {
- "id": "da60f639-df79-4f4d-9861-79219f5fc341",
- "type": "text/javascript",
- "exec": [
- "const schemaKeysString = pm.environment.get('schemaKeys');",
- "const schemaKeys = JSON.parse(schemaKeysString);",
- "_.forEach(schemaKeys, function(schemaKey) {",
- " const schemaString = pm.environment.get(schemaKey);",
- " const schema = JSON.parse(schemaString);",
- " tv4.addSchema(schema);",
- "});",
- ""
- ]
- }
- },
- {
- "listen": "test",
- "script": {
- "id": "b4917e72-ac87-421d-b7a5-21b64285ba5b",
- "type": "text/javascript",
- "exec": [
- "pm.test('Has Content-Type header with value application/json', function () {",
- " pm.response.to.have.header('Content-Type');",
- " const contentType = postman.getResponseHeader('Content-Type');",
- " pm.expect(contentType).to.include('application/json');",
- "});",
- ""
- ]
- }
- }
- ]
-}
diff --git a/packages/sra-report/src/contract_addresses/kovan_addresses.ts b/packages/sra-report/src/contract_addresses/kovan_addresses.ts
deleted file mode 100644
index e06568f52..000000000
--- a/packages/sra-report/src/contract_addresses/kovan_addresses.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-export const addresses = {
- WETH: '0xd0a1e359811322d97991e03f863a0c30c2cf029c',
- ZRX: '0x6ff6c0ff1d68b964901f986d4c9fa3ac68346570',
- EXCHANGE: '0x90fe2af704b34e0224bf2299c838e04d4dcf1364',
-};
diff --git a/packages/sra-report/src/contract_addresses/mainnet_addresses.ts b/packages/sra-report/src/contract_addresses/mainnet_addresses.ts
deleted file mode 100644
index e9aa0f167..000000000
--- a/packages/sra-report/src/contract_addresses/mainnet_addresses.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-export const addresses = {
- WETH: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
- ZRX: '0xe41d2489571d322189246dafa5ebde1f4699f498',
- EXCHANGE: '0x12459c951127e0c374ff9105dda097662a027093',
-};
diff --git a/packages/sra-report/src/contract_addresses/rinkeby_addresses.ts b/packages/sra-report/src/contract_addresses/rinkeby_addresses.ts
deleted file mode 100644
index b1e0848d0..000000000
--- a/packages/sra-report/src/contract_addresses/rinkeby_addresses.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-export const addresses = {
- WETH: '0xc778417e063141139fce010982780140aa0cd5ab',
- ZRX: '0x00f58d6d585f84b2d7267940cede30ce2fe6eae8',
- EXCHANGE: '0x1d16ef40fac01cec8adac2ac49427b9384192c05',
-};
diff --git a/packages/sra-report/src/contract_addresses/ropsten_addresses.ts b/packages/sra-report/src/contract_addresses/ropsten_addresses.ts
deleted file mode 100644
index 80e6e5e7e..000000000
--- a/packages/sra-report/src/contract_addresses/ropsten_addresses.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-export const addresses = {
- WETH: '0xc778417e063141139fce010982780140aa0cd5ab',
- ZRX: '0xa8e9fa8f91e5ae138c74648c9c304f1c75003a8d',
- EXCHANGE: '0x479cc461fecd078f766ecc58533d6f69580cf3ac',
-};
diff --git a/packages/sra-report/src/globals.d.ts b/packages/sra-report/src/globals.d.ts
deleted file mode 100644
index 783b92913..000000000
--- a/packages/sra-report/src/globals.d.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-declare module '*.json' {
- const value: any;
- export default value;
-}
diff --git a/packages/sra-report/src/index.ts b/packages/sra-report/src/index.ts
deleted file mode 100644
index b23b6c8d2..000000000
--- a/packages/sra-report/src/index.ts
+++ /dev/null
@@ -1,111 +0,0 @@
-#!/usr/bin/env node
-import { assert } from '@0xproject/assert';
-import { logUtils } from '@0xproject/utils';
-import chalk from 'chalk';
-import * as _ from 'lodash';
-import * as yargs from 'yargs';
-
-import * as sraReportCollectionJSON from '../../postman_collections/sra_report.postman_collection.json';
-
-import { postmanEnvironmentFactory } from './postman_environment_factory';
-import { utils } from './utils';
-
-const DEFAULT_NETWORK_ID = 1;
-const networkNameToId: { [networkName: string]: number } = {
- mainnet: 1,
- ropsten: 3,
- rinkeby: 4,
- kovan: 42,
-};
-const SUPPORTED_NETWORK_IDS = [
- networkNameToId.mainnet,
- networkNameToId.ropsten,
- networkNameToId.rinkeby,
- networkNameToId.kovan,
-];
-
-// extract command line arguments
-const args = yargs
- .option('endpoint-url', {
- alias: ['e'],
- describe: 'API endpoint url to test for standard relayer API compliance',
- type: 'string',
- demandOption: true,
- })
- .option('output', {
- alias: ['o', 'out'],
- describe: 'The relative path to write the report generated by the collection run, prints to console by default',
- type: 'string',
- normalize: true,
- demandOption: false,
- })
- .option('network-id', {
- alias: ['n'],
- describe: 'ID of the network that the API is serving orders from',
- type: 'number',
- default: DEFAULT_NETWORK_ID,
- })
- .option('environment', {
- alias: ['env'],
- describe: 'The relative path to a postman environment file for the collection run',
- type: 'string',
- normalize: true,
- demandOption: false,
- })
- .option('export-collection', {
- alias: ['ec'],
- describe: 'The relative path to write the postman collection file used by the collection run',
- type: 'string',
- normalize: true,
- demandOption: false,
- })
- .option('export-environment', {
- alias: ['ee'],
- describe: 'The relative path to write the postman environment file used by the collection run',
- type: 'string',
- normalize: true,
- demandOption: false,
- })
- .example(
- "$0 --endpoint-url 'http://api.example.com' --out 'path/to/report.json' --network-id 42 --environment 'path/to/custom/environment.json' --export-collection 'path/to/collection.json' --export-environment 'path/to/environment.json'",
- 'Full usage example',
- ).argv;
-// perform extra validation on command line arguments
-try {
- assert.isWebUri('args', args.endpointUrl);
-} catch (err) {
- logUtils.log(`${chalk.red(`Invalid url format:`)} ${args.endpointUrl}`);
- process.exit(1);
-}
-if (!_.includes(SUPPORTED_NETWORK_IDS, args.networkId)) {
- logUtils.log(`${chalk.red(`Unsupported network id:`)} ${args.networkId}`);
- logUtils.log(`${chalk.bold(`Supported network ids:`)} ${SUPPORTED_NETWORK_IDS}`);
- process.exit(1);
-}
-const mainAsync = async () => {
- const newmanReporterOptions = !_.isUndefined(args.output)
- ? {
- reporters: 'json',
- reporter: {
- json: {
- export: args.output,
- },
- },
- }
- : {
- reporters: 'cli',
- };
- const environment = !_.isUndefined(args.environment)
- ? args.environment
- : await postmanEnvironmentFactory.createPostmanEnvironmentAsync(args.endpointUrl, args.networkId);
- const newmanRunOptions = {
- collection: sraReportCollectionJSON,
- environment,
- exportCollection: args.exportCollection,
- exportEnvironment: args.exportEnvironment,
- ...newmanReporterOptions,
- };
- await utils.newmanRunAsync(newmanRunOptions);
-};
-
-mainAsync().catch(logUtils.log.bind(logUtils));
diff --git a/packages/sra-report/src/postman_environment_factory.ts b/packages/sra-report/src/postman_environment_factory.ts
deleted file mode 100644
index 3dcb97829..000000000
--- a/packages/sra-report/src/postman_environment_factory.ts
+++ /dev/null
@@ -1,144 +0,0 @@
-import { HttpClient } from '@0xproject/connect';
-import { Schema, schemas as schemasByName } from '@0xproject/json-schemas';
-import { getOrderHashHex } from '@0xproject/order-utils';
-import { logUtils } from '@0xproject/utils';
-import chalk from 'chalk';
-import * as _ from 'lodash';
-
-import { addresses as kovanAddresses } from './contract_addresses/kovan_addresses';
-import { addresses as mainnetAddresses } from './contract_addresses/mainnet_addresses';
-import { addresses as rinkebyAddresses } from './contract_addresses/rinkeby_addresses';
-import { addresses as ropstenAddresses } from './contract_addresses/ropsten_addresses';
-
-const ENVIRONMENT_NAME = 'SRA Report';
-const networkNameToId: { [networkName: string]: number } = {
- mainnet: 1,
- ropsten: 3,
- rinkeby: 4,
- kovan: 42,
-};
-
-export interface EnvironmentValue {
- key: string;
- value: string;
- enabled: true;
- type: 'text';
-}
-
-export interface Environment {
- name: string;
- values: EnvironmentValue[];
-}
-
-export interface Addresses {
- WETH: string;
- ZRX: string;
- EXCHANGE: string;
-}
-
-export const postmanEnvironmentFactory = {
- /**
- * Dynamically generates a postman environment (https://www.getpostman.com/docs/v6/postman/environments_and_globals/manage_environments)
- * When running the postman collection via newman, we provide it a set of environment variables
- * These variables include:
- * - 0x JSON schemas for response body validation
- * - Contract addresses based on the network id for making specific queries (ex. baseTokenAddress=ZRX_address)
- * - Order properties for making specific queries (ex. maker=orderMaker)
- */
- async createPostmanEnvironmentAsync(url: string, networkId: number): Promise<Environment> {
- const orderEnvironmentValues = await createOrderEnvironmentValuesAsync(url);
- const allEnvironmentValues = _.concat(
- createSchemaEnvironmentValues(),
- createContractAddressEnvironmentValues(networkId),
- orderEnvironmentValues,
- createEnvironmentValue('url', url),
- );
- const environment = {
- name: ENVIRONMENT_NAME,
- values: allEnvironmentValues,
- };
- return environment;
- },
-};
-function createSchemaEnvironmentValues(): EnvironmentValue[] {
- const schemas: Schema[] = _.values(schemasByName);
- const schemaEnvironmentValues = _.compact(
- _.map(schemas, (schema: Schema) => {
- if (_.isUndefined(schema.id)) {
- return undefined;
- } else {
- const schemaKey = convertSchemaIdToKey(schema.id);
- const stringifiedSchema = JSON.stringify(schema);
- const schemaEnvironmentValue = createEnvironmentValue(schemaKey, stringifiedSchema);
- return schemaEnvironmentValue;
- }
- }),
- );
- const schemaKeys = _.map(schemaEnvironmentValues, (environmentValue: EnvironmentValue) => {
- return environmentValue.key;
- });
- const result = _.concat(schemaEnvironmentValues, createEnvironmentValue('schemaKeys', JSON.stringify(schemaKeys)));
- return result;
-}
-function createContractAddressEnvironmentValues(networkId: number): EnvironmentValue[] {
- const contractAddresses = getContractAddresses(networkId);
- return [
- createEnvironmentValue('tokenContractAddress1', contractAddresses.WETH),
- createEnvironmentValue('tokenContractAddress2', contractAddresses.ZRX),
- createEnvironmentValue('exchangeContractAddress', contractAddresses.EXCHANGE),
- ];
-}
-async function createOrderEnvironmentValuesAsync(url: string): Promise<EnvironmentValue[]> {
- const httpClient = new HttpClient(url);
- const orders = await httpClient.getOrdersAsync();
- const orderIfExists = _.head(orders);
- if (!_.isUndefined(orderIfExists)) {
- return [
- createEnvironmentValue('order', JSON.stringify(orderIfExists)),
- createEnvironmentValue('orderMaker', orderIfExists.maker),
- createEnvironmentValue('orderTaker', orderIfExists.taker),
- createEnvironmentValue('orderFeeRecipient', orderIfExists.feeRecipient),
- createEnvironmentValue('orderHash', getOrderHashHex(orderIfExists)),
- ];
- } else {
- logUtils.log(`${chalk.red(`No orders from /orders found`)}`);
- return [
- createEnvironmentValue('order', ''),
- createEnvironmentValue('orderMaker', ''),
- createEnvironmentValue('orderTaker', ''),
- createEnvironmentValue('orderFeeRecipient', ''),
- createEnvironmentValue('orderHash', ''),
- ];
- }
-}
-function getContractAddresses(networkId: number): Addresses {
- switch (networkId) {
- case networkNameToId.mainnet:
- return mainnetAddresses;
- case networkNameToId.ropsten:
- return ropstenAddresses;
- case networkNameToId.rinkeby:
- return rinkebyAddresses;
- case networkNameToId.kovan:
- return kovanAddresses;
- default:
- throw new Error('Unsupported network id');
- }
-}
-function convertSchemaIdToKey(schemaId: string): string {
- let result = schemaId;
- if (_.startsWith(result, '/')) {
- result = result.substr(1);
- }
- result = `${result}Schema`;
- return result;
-}
-
-function createEnvironmentValue(key: string, value: string): EnvironmentValue {
- return {
- key,
- value,
- enabled: true,
- type: 'text',
- };
-}
diff --git a/packages/sra-report/src/utils.ts b/packages/sra-report/src/utils.ts
deleted file mode 100644
index 3a83a7ea0..000000000
--- a/packages/sra-report/src/utils.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-import { promisify } from '@0xproject/utils';
-import { NewmanRunSummary, run as newmanRun } from 'newman';
-
-export const utils = {
- newmanRunAsync: promisify<NewmanRunSummary>(newmanRun),
-};
diff --git a/packages/sra-report/test/environments/postman_environment.json b/packages/sra-report/test/environments/postman_environment.json
deleted file mode 100644
index e26a47e5f..000000000
--- a/packages/sra-report/test/environments/postman_environment.json
+++ /dev/null
@@ -1,223 +0,0 @@
-{
- "id": "f23e415f-99a8-4d47-8796-6400af77d85f",
- "name": "SRA Report",
- "values": [
- {
- "type": "any",
- "value": "{\"id\":\"/Number\",\"type\":\"string\",\"pattern\":\"^\\\\d+(\\\\.\\\\d+)?$\"}",
- "key": "NumberSchema"
- },
- {
- "type": "any",
- "value": "{\"id\":\"/Address\",\"type\":\"string\",\"pattern\":\"^0x[0-9a-f]{40}$\"}",
- "key": "AddressSchema"
- },
- {
- "type": "any",
- "value":
- "{\"id\":\"/ECSignature\",\"properties\":{\"v\":{\"type\":\"number\",\"minimum\":27,\"maximum\":28},\"r\":{\"$ref\":\"/ECSignatureParameter\"},\"s\":{\"$ref\":\"/ECSignatureParameter\"}},\"required\":[\"v\",\"r\",\"s\"],\"type\":\"object\"}",
- "key": "ECSignatureSchema"
- },
- {
- "type": "any",
- "value": "{\"id\":\"/ECSignatureParameter\",\"type\":\"string\",\"pattern\":\"^0[xX][0-9A-Fa-f]{64}$\"}",
- "key": "ECSignatureParameterSchema"
- },
- {
- "type": "any",
- "value":
- "{\"id\":\"/IndexFilterValues\",\"additionalProperties\":{\"oneOf\":[{\"$ref\":\"/Number\"},{\"$ref\":\"/Address\"},{\"$ref\":\"/OrderHashSchema\"}]},\"type\":\"object\"}",
- "key": "IndexFilterValuesSchema"
- },
- {
- "type": "any",
- "value":
- "{\"id\":\"/OrderCancellationRequests\",\"type\":\"array\",\"items\":{\"properties\":{\"order\":{\"$ref\":\"/Order\"},\"takerTokenCancelAmount\":{\"$ref\":\"/Number\"}},\"required\":[\"order\",\"takerTokenCancelAmount\"],\"type\":\"object\"}}",
- "key": "OrderCancellationRequestsSchema"
- },
- {
- "type": "any",
- "value":
- "{\"id\":\"/OrderFillOrKillRequests\",\"type\":\"array\",\"items\":{\"properties\":{\"signedOrder\":{\"$ref\":\"/SignedOrder\"},\"fillTakerAmount\":{\"$ref\":\"/Number\"}},\"required\":[\"signedOrder\",\"fillTakerAmount\"],\"type\":\"object\"}}",
- "key": "OrderFillOrKillRequestsSchema"
- },
- {
- "type": "any",
- "value":
- "{\"id\":\"/OrderFillRequests\",\"type\":\"array\",\"items\":{\"properties\":{\"signedOrder\":{\"$ref\":\"/SignedOrder\"},\"takerTokenFillAmount\":{\"$ref\":\"/Number\"}},\"required\":[\"signedOrder\",\"takerTokenFillAmount\"],\"type\":\"object\"}}",
- "key": "OrderFillRequestsSchema"
- },
- {
- "type": "any",
- "value": "{\"id\":\"/OrderHashSchema\",\"type\":\"string\",\"pattern\":\"^0x[0-9a-fA-F]{64}$\"}",
- "key": "OrderHashSchemaSchema"
- },
- {
- "type": "any",
- "value":
- "{\"id\":\"/Order\",\"properties\":{\"maker\":{\"$ref\":\"/Address\"},\"taker\":{\"$ref\":\"/Address\"},\"makerFee\":{\"$ref\":\"/Number\"},\"takerFee\":{\"$ref\":\"/Number\"},\"makerTokenAmount\":{\"$ref\":\"/Number\"},\"takerTokenAmount\":{\"$ref\":\"/Number\"},\"makerTokenAddress\":{\"$ref\":\"/Address\"},\"takerTokenAddress\":{\"$ref\":\"/Address\"},\"salt\":{\"$ref\":\"/Number\"},\"feeRecipient\":{\"$ref\":\"/Address\"},\"expirationUnixTimestampSec\":{\"$ref\":\"/Number\"},\"exchangeContractAddress\":{\"$ref\":\"/Address\"}},\"required\":[\"maker\",\"taker\",\"makerFee\",\"takerFee\",\"makerTokenAmount\",\"takerTokenAmount\",\"salt\",\"feeRecipient\",\"expirationUnixTimestampSec\",\"exchangeContractAddress\"],\"type\":\"object\"}",
- "key": "OrderSchema"
- },
- {
- "type": "any",
- "value":
- "{\"id\":\"/SignedOrder\",\"allOf\":[{\"$ref\":\"/Order\"},{\"properties\":{\"ecSignature\":{\"$ref\":\"/ECSignature\"}},\"required\":[\"ecSignature\"]}]}",
- "key": "SignedOrderSchema"
- },
- {
- "type": "any",
- "value": "{\"id\":\"/signedOrdersSchema\",\"type\":\"array\",\"items\":{\"$ref\":\"/SignedOrder\"}}",
- "key": "signedOrdersSchemaSchema"
- },
- {
- "type": "any",
- "value":
- "{\"id\":\"/BlockParam\",\"oneOf\":[{\"type\":\"number\"},{\"enum\":[\"latest\",\"earliest\",\"pending\"]}]}",
- "key": "BlockParamSchema"
- },
- {
- "type": "any",
- "value":
- "{\"id\":\"/BlockRange\",\"properties\":{\"fromBlock\":{\"$ref\":\"/BlockParam\"},\"toBlock\":{\"$ref\":\"/BlockParam\"}},\"type\":\"object\"}",
- "key": "BlockRangeSchema"
- },
- {
- "type": "any",
- "value":
- "{\"id\":\"/Token\",\"properties\":{\"name\":{\"type\":\"string\"},\"symbol\":{\"type\":\"string\"},\"decimals\":{\"type\":\"number\"},\"address\":{\"$ref\":\"/Address\"}},\"required\":[\"name\",\"symbol\",\"decimals\",\"address\"],\"type\":\"object\"}",
- "key": "TokenSchema"
- },
- {
- "type": "any",
- "value": "{\"id\":\"/JsNumber\",\"type\":\"number\",\"minimum\":0}",
- "key": "JsNumberSchema"
- },
- {
- "type": "any",
- "value":
- "{\"id\":\"/TxData\",\"properties\":{\"from\":{\"$ref\":\"/Address\"},\"to\":{\"$ref\":\"/Address\"},\"value\":{\"oneOf\":[{\"$ref\":\"/Number\"},{\"$ref\":\"/JsNumber\"}]},\"gas\":{\"oneOf\":[{\"$ref\":\"/Number\"},{\"$ref\":\"/JsNumber\"}]},\"gasPrice\":{\"oneOf\":[{\"$ref\":\"/Number\"},{\"$ref\":\"/JsNumber\"}]},\"data\":{\"type\":\"string\",\"pattern\":\"^0x[0-9a-f]*$\"},\"nonce\":{\"type\":\"number\",\"minimum\":0}},\"required\":[\"from\"],\"type\":\"object\",\"additionalProperties\":false}",
- "key": "TxDataSchema"
- },
- {
- "type": "any",
- "value":
- "{\"id\":\"/RelayerApiErrorResponse\",\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"number\"},\"reason\":{\"type\":\"string\"},\"validationErrors\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"field\":{\"type\":\"string\"},\"code\":{\"type\":\"number\"},\"reason\":{\"type\":\"string\"}},\"required\":[\"field\",\"code\",\"reason\"]}}},\"required\":[\"code\",\"reason\"]}",
- "key": "RelayerApiErrorResponseSchema"
- },
- {
- "type": "any",
- "value":
- "{\"id\":\"/RelayerApiFeesPayload\",\"type\":\"object\",\"properties\":{\"exchangeContractAddress\":{\"$ref\":\"/Address\"},\"maker\":{\"$ref\":\"/Address\"},\"taker\":{\"$ref\":\"/Address\"},\"makerTokenAddress\":{\"$ref\":\"/Address\"},\"takerTokenAddress\":{\"$ref\":\"/Address\"},\"makerTokenAmount\":{\"$ref\":\"/Number\"},\"takerTokenAmount\":{\"$ref\":\"/Number\"},\"expirationUnixTimestampSec\":{\"$ref\":\"/Number\"},\"salt\":{\"$ref\":\"/Number\"}},\"required\":[\"exchangeContractAddress\",\"maker\",\"taker\",\"makerTokenAddress\",\"takerTokenAddress\",\"expirationUnixTimestampSec\",\"salt\"]}",
- "key": "RelayerApiFeesPayloadSchema"
- },
- {
- "type": "any",
- "value":
- "{\"id\":\"/RelayerApiFeesResponse\",\"type\":\"object\",\"properties\":{\"makerFee\":{\"$ref\":\"/Number\"},\"takerFee\":{\"$ref\":\"/Number\"},\"feeRecipient\":{\"$ref\":\"/Address\"}},\"required\":[\"makerFee\",\"takerFee\",\"feeRecipient\"]}",
- "key": "RelayerApiFeesResponseSchema"
- },
- {
- "type": "any",
- "value":
- "{\"id\":\"/RelayerApiOrderBookResponse\",\"type\":\"object\",\"properties\":{\"bids\":{\"$ref\":\"/signedOrdersSchema\"},\"asks\":{\"$ref\":\"/signedOrdersSchema\"}},\"required\":[\"bids\",\"asks\"]}",
- "key": "RelayerApiOrderBookResponseSchema"
- },
- {
- "type": "any",
- "value":
- "{\"id\":\"/RelayerApiTokenPairsResponse\",\"type\":\"array\",\"items\":{\"properties\":{\"tokenA\":{\"$ref\":\"/RelayerApiTokenTradeInfo\"},\"tokenB\":{\"$ref\":\"/RelayerApiTokenTradeInfo\"}},\"required\":[\"tokenA\",\"tokenB\"],\"type\":\"object\"}}",
- "key": "RelayerApiTokenPairsResponseSchema"
- },
- {
- "type": "any",
- "value":
- "{\"id\":\"/RelayerApiTokenTradeInfo\",\"type\":\"object\",\"properties\":{\"address\":{\"$ref\":\"/Address\"},\"minAmount\":{\"$ref\":\"/Number\"},\"maxAmount\":{\"$ref\":\"/Number\"},\"precision\":{\"type\":\"number\"}},\"required\":[\"address\"]}",
- "key": "RelayerApiTokenTradeInfoSchema"
- },
- {
- "type": "any",
- "value":
- "{\"id\":\"/RelayerApiOrderbookChannelSubscribe\",\"type\":\"object\",\"properties\":{\"type\":{\"enum\":[\"subscribe\"]},\"channel\":{\"enum\":[\"orderbook\"]},\"requestId\":{\"type\":\"number\"},\"payload\":{\"$ref\":\"/RelayerApiOrderbookChannelSubscribePayload\"}},\"required\":[\"type\",\"channel\",\"requestId\",\"payload\"]}",
- "key": "RelayerApiOrderbookChannelSubscribeSchema"
- },
- {
- "type": "any",
- "value":
- "{\"id\":\"/RelayerApiOrderbookChannelSubscribePayload\",\"type\":\"object\",\"properties\":{\"baseTokenAddress\":{\"$ref\":\"/Address\"},\"quoteTokenAddress\":{\"$ref\":\"/Address\"},\"snapshot\":{\"type\":\"boolean\"},\"limit\":{\"type\":\"number\"}},\"required\":[\"baseTokenAddress\",\"quoteTokenAddress\"]}",
- "key": "RelayerApiOrderbookChannelSubscribePayloadSchema"
- },
- {
- "type": "any",
- "value":
- "{\"id\":\"/RelayerApiOrderbookChannelUpdate\",\"type\":\"object\",\"properties\":{\"type\":{\"enum\":[\"update\"]},\"channel\":{\"enum\":[\"orderbook\"]},\"requestId\":{\"type\":\"number\"},\"payload\":{\"$ref\":\"/SignedOrder\"}},\"required\":[\"type\",\"channel\",\"requestId\",\"payload\"]}",
- "key": "RelayerApiOrderbookChannelUpdateSchema"
- },
- {
- "type": "any",
- "value":
- "{\"id\":\"/RelayerApiOrderbookChannelSnapshot\",\"type\":\"object\",\"properties\":{\"type\":{\"enum\":[\"snapshot\"]},\"channel\":{\"enum\":[\"orderbook\"]},\"requestId\":{\"type\":\"number\"},\"payload\":{\"$ref\":\"/RelayerApiOrderbookChannelSnapshotPayload\"}},\"required\":[\"type\",\"channel\",\"requestId\",\"payload\"]}",
- "key": "RelayerApiOrderbookChannelSnapshotSchema"
- },
- {
- "type": "any",
- "value":
- "{\"id\":\"/RelayerApiOrderbookChannelSnapshotPayload\",\"type\":\"object\",\"properties\":{\"bids\":{\"$ref\":\"/signedOrdersSchema\"},\"asks\":{\"$ref\":\"/signedOrdersSchema\"}},\"required\":[\"bids\",\"asks\"]}",
- "key": "RelayerApiOrderbookChannelSnapshotPayloadSchema"
- },
- {
- "type": "any",
- "value":
- "[\"NumberSchema\",\"AddressSchema\",\"ECSignatureSchema\",\"ECSignatureParameterSchema\",\"IndexFilterValuesSchema\",\"OrderCancellationRequestsSchema\",\"OrderFillOrKillRequestsSchema\",\"OrderFillRequestsSchema\",\"OrderHashSchemaSchema\",\"OrderSchema\",\"SignedOrderSchema\",\"signedOrdersSchemaSchema\",\"BlockParamSchema\",\"BlockRangeSchema\",\"TokenSchema\",\"JsNumberSchema\",\"TxDataSchema\",\"RelayerApiErrorResponseSchema\",\"RelayerApiFeesPayloadSchema\",\"RelayerApiFeesResponseSchema\",\"RelayerApiOrderBookResponseSchema\",\"RelayerApiTokenPairsResponseSchema\",\"RelayerApiTokenTradeInfoSchema\",\"RelayerApiOrderbookChannelSubscribeSchema\",\"RelayerApiOrderbookChannelSubscribePayloadSchema\",\"RelayerApiOrderbookChannelUpdateSchema\",\"RelayerApiOrderbookChannelSnapshotSchema\",\"RelayerApiOrderbookChannelSnapshotPayloadSchema\"]",
- "key": "schemaKeys"
- },
- {
- "type": "any",
- "value": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "key": "tokenContractAddress1"
- },
- {
- "type": "any",
- "value": "0xe41d2489571d322189246dafa5ebde1f4699f498",
- "key": "tokenContractAddress2"
- },
- {
- "type": "any",
- "value": "0x12459c951127e0c374ff9105dda097662a027093",
- "key": "exchangeContractAddress"
- },
- {
- "type": "any",
- "value":
- "{\"orderHash\":\"0xe91e990bab4c9c6bd60ff3673222390e3da8b7bd9a50eab98a8cb20723b24ee1\",\"exchangeContractAddress\":\"0x12459c951127e0c374ff9105dda097662a027093\",\"maker\":\"0x93690d55b14d701c259ba7960395c095aa52c3a8\",\"taker\":\"0x0000000000000000000000000000000000000000\",\"makerTokenAddress\":\"0x2956356cd2a2bf3202f771f50d3d14a367b48070\",\"takerTokenAddress\":\"0x0abdace70d3790235af448c88547603b945604ea\",\"feeRecipient\":\"0xa258b39954cef5cb142fd567a46cddb31a670124\",\"makerTokenAmount\":\"2926675830000000000\",\"takerTokenAmount\":\"24386933000000000000000\",\"makerFee\":\"18419638100000000000\",\"takerFee\":\"35812978500000000000\",\"expirationUnixTimestampSec\":\"9223372036854775807\",\"salt\":\"89583415499996246176114840147523733506098603782358761236056286417408784066968\",\"ecSignature\":{\"r\":\"0x32eb5bbf713210274ddd885e6b555699bc0189676ff73a4dc98c4cac41d3a6a6\",\"s\":\"0x193eb9440df49dc7817b6142c0be021cd1f9fc0916d86c7b49e9e07a402f3645\",\"v\":28}}",
- "key": "order"
- },
- {
- "type": "any",
- "value": "0x93690d55b14d701c259ba7960395c095aa52c3a8",
- "key": "orderMaker"
- },
- {
- "type": "any",
- "value": "0x0000000000000000000000000000000000000000",
- "key": "orderTaker"
- },
- {
- "type": "any",
- "value": "0xa258b39954cef5cb142fd567a46cddb31a670124",
- "key": "orderFeeRecipient"
- },
- {
- "type": "any",
- "value": "0xe91e990bab4c9c6bd60ff3673222390e3da8b7bd9a50eab98a8cb20723b24ee1",
- "key": "orderHash"
- },
- {
- "type": "any",
- "value": "https://example.com",
- "key": "url"
- }
- ],
- "_postman_variable_scope": "environment",
- "_postman_exported_at": "2018-03-10T23:53:03.913Z",
- "_postman_exported_using": "Newman/3.9.3"
-}
diff --git a/packages/sra-report/test/fixtures/v0/token_pairs/default_request.json b/packages/sra-report/test/fixtures/v0/token_pairs/default_request.json
deleted file mode 100644
index cd19be1e1..000000000
--- a/packages/sra-report/test/fixtures/v0/token_pairs/default_request.json
+++ /dev/null
@@ -1,3698 +0,0 @@
-[
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x01b3ec4aae1b8729529beb4965f27d008788b0eb",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x0371a82e4a9d0a4312f3ee2ac9c6958512891372",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x05f4a42e251f2d52b8ed15e9fedaacfcef1fad27",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x076c97e1c869072ee22f8c91978c99b4bcb02591",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x09d8b66c48424324b25754a873e290cae5dca439",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x0abdace70d3790235af448c88547603b945604ea",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x0cf0ee63788a0849fe5297f3407f701e122cc023",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x0d8775f648430679a709e98d2b0cb6250d2887ef",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x0e0989b1f9b8a38983c2ba8053269ca62ec9b195",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x0f513ffb4926ff82d7f60a05069047aca295c413",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x0f5d2fb29fb7d3cfee444a200298f468908cc942",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x1063ce524265d5a3a624f4914acd573dd89ce988",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x106aa49295b525fcf959aa75ec3f7dcbf5352f1c",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x107c4504cd79c5d2696ea0030a8dd4e92601b82e",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x1183f92a5624d68e85ffb9170f16bf0443b4c242",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x12480e24eb5bec1a9d4369cab6a80cad3c0a377a",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x12b19d3e2ccc14da04fae33e63652ce469b3f2fd",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x12fef5e57bf45873cd9b62e9dbd7bfb99e32d73e",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x168296bb09e24a88805cb9c33356536b980d3fc5",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x1776e1f26f98b1a5df9cd347953a26dd3cb46671",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x177d39ac676ed1c67a2b268ad7f1e58826e5b0af",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x1d462414fe14cf489c7a21cac78509f4bf8cd7c0",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x24692791bc444c5cd0b81e3cbcaba4b04acd1f3b",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x255aa6df07540cb5d3d297f0d0d4d84cb52bc8e6",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x27054b13b1b798b345b591a4d22e6562d47ea75a",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x27695e09149adc738a978e9a678f99e4c39e9eb9",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x27dce1ec4d3f72c3e457cc50354f1f975ddef488",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x27f610bf36eca0939093343ac28b1534a721dbb4",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x2956356cd2a2bf3202f771f50d3d14a367b48070",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x340d2bde5eb28c1eed91b2f790723e3b160613b7",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x3597bfd533a99c9aa083587b074434e61eb0a258",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x3618516f45cd3c913f81f9987af41077932bc40d",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x386467f1f3ddbe832448650418311a479eecfc57",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x3883f5e181fccaf8410fa61e12b59bad963fb645",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x399a0e6fbeb3d74c85357439f4c8aed9678a5cbf",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x39bb259f66e1c59d5abef88375979b4d20d98022",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x3d1ba9be9f66b8ee101911bc36d3fb562eac2244",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x4156d3342d5c385a87d264f90653733592000581",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x419d0d8bdd9af5e606ae2232ed285aff190e711b",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x41e5560054824ea6b0732e656e3ad64e20e94e45",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x42d6622dece394b54999fbd73d108123806f6a18",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x44f588aeeb8c44471439d1270b3603c66a9262f1",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x4ceda7906a5ed2179785cd3a40a69ee8bc99c466",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x4d8fc1453a0f359e99c9675954e656d80d996fbf",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x4df47b4969b2911c966506e3592c41389493953b",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x4df812f6064def1e5e029f1ca858777cc98d2d81",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x514910771af9ca656af840dff83e8264ecf986ca",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x52a7cb918c11a16958be40cba7e31e32a499a465",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x533ef0984b2faa227acc620c67cce12aa39cd8cd",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x554c20b7c486beee439277b4540a434566dc4c02",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x56ba2ee7890461f463f7be02aac3099f6d5811a8",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x5732046a883704404f284ce41ffadd5b007fd668",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x595832f8fc6bf59c85c527fec3740a1b7a361269",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x5af2be193a6abca9c8817001f45744777db30756",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x5b2e4a700dfbc560061e957edec8f6eeeb74a320",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x5bc7e5f0ab8b2e10d2d0a3f21739fce62459aef3",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x5ca9a71b1d01849c0a95490cc00559717fcf0d1d",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x5e3346444010135322268a4630d2ed5f8d09446c",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x607f4c5bb672230e8672085532f7e901544a7375",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x614ea929892ea43d3ea2c5e3311b01cc589bad6c",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x6425c6be902d692ae2db752b3c268afadb099d3b",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x672a1ad4f667fb18a333af13667aa0af1f5b5bdd",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x6781a0f84c7e9e846dcb84a9a5bd49333067b104",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x6810e776880c02933d47db1b9fc05908e5386b96",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x744d70fdbe2ba4cf95131626614a1763df805b9e",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x7654915a1b82d6d2d0afc37c52af556ea8983c7e",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x7b69b78cc7fee48202c208609ae6d1f78ce42e13",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x7d4b8cce0591c9044a22ee543533b72e976e36c3",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x80fb784b7ed66730e8b1dbd9820afd29931aab03",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x814964b1bceaf24e26296d031eadf134a2ca4105",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x865e3707a580f9db89304005cddd050ade8873eb",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x88fcfbc22c6d3dbaa25af478c578978339bde77a",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x8a854288a5976036a725879164ca3e91d30c6a1b",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x8ae4bf2c33a8e667de34b54938b0ccd03eb8cc06",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x8eb24319393716668d768dcec29356ae9cffe285",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x8f8221afbb33998d8584a2b05749ba73c37a938a",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x9214ec02cb71cba0ada6896b8da260736a67ab10",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x923108a439c4e8c2315c4f6521e5ce95b44e9b4c",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x960b236a07cf122663c4303350609a66a7b288c0",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x983f6d60db79ea8ca4eb9968c6aff8cfa04b3c63",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x9992ec3cf6a55b00978cddf2b27bc6882d88d1ec",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x99ea4db9ee77acd40b119bd1dc4e33e1c070b80d",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x9a005c9a89bd72a4bd27721e7a09a3c11d2b03c4",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xa5fd1a791c4dfcaacc963d4f73c6ae5824149ea7",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xa8006c4ca56f24d6836727d106349320db7fef82",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xa87c3ec87eb802aad080df0adb331e504d327e5d",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xab16e0d25c06cb376259cc18c1de4aca57605589",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xac3211a5025414af2866ff09c23fc18bc97e79b1",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xacfa209fb73bf3dd5bbfb1101b9bc999c49062a5",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xb24754be79281553dc1adc160ddf5cd9b74361a4",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xb3bd49e28f8f832b8d1e246106991e546c323502",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xb45a50545beeab73f38f31e5973768c421805e5e",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xb4efd85c19999d84251304bda99e90b92300bd93",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xb5a5f22694352c15b00323844ad545abb2b11028",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xb5c0e43a6330b9eb904ec57ea24d70269ae4652e",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xb62d18dea74045e822352ce4b3ee77319dc5ff2f",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xb64ef51c888972c908cfacf59b47c1afbc0ab8ac",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xb98d4c97425d9908e66e53a6fdf673acca0be986",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xba2184520a1cc49a6159c57e61e1844e085615b6",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xba5f11b16b155792cf3b2e6880e8706859a8aeb6",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xbdc5bac39dbe132b1e030e898ae3830017d7d969",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xbeb9ef514a379b997e0798fdcc901ee474b6d9a1",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xbf2179859fc6d5bee9bf9158632dc51678a4100e",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xc27a2f05fa577a83ba0fdb4c38443c0718356501",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xc438b4c0dfbb1593be6dee03bbd1a84bb3aa6213",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xc66ea802717bfb9833400264dd12c2bceaa34a6d",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xc997d07b0bc607b6d1bcb6fb9d4a5579c466c3e5",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xd0a4b8946cb52f0661273bfbc6fd0e0c75fc6433",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xd26114cd6ee289accf82350c8d8487fedb8a0c07",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xd2d6158683aee4cc838067727209a0aaf4359de3",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xd4c435f5b09f855c3317c8524cb1f586e42795fa",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xd4fa1460f537bb9085d22c7bccb5dd450ef28e3a",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xd8912c10681d8b21fd3742244f44658dba12264e",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xe0b7927c4af23765cb51314a0e0521a9645f0e2a",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xe2e6d4be086c6938b53b22144855eef674281639",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xe41d2489571d322189246dafa5ebde1f4699f498",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xe94327d07fc17907b4db788e5adf2ed424addff6",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xea097a2b1db00627b2fa17460ad260c016016977",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xea1f346faf023f974eb5adaf088bbcdf02d761f4",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xea38eaa3c86c8f9b751533ba2e562deb9acded40",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xeab43193cf0623073ca89db9b712796356fa7414",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xeb2da9fac54284cea731d1f10bb34eecb3c00c14",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xeb7c20027172e5d143fb030d50f91cece2d1485d",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xef2463099360a085f1f10b076ed72ef625497a06",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xf433089366899d83a9f26a773d59ec7ecf30355e",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xf6b55acbbc49f4524aa48d19281a9a77c54de10f",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xf6cfe53d6febaeea051f400ff5fc14f0cbbdaca1",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xf7b098298f7c69fc14610bf71d5e02c60792894c",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xf970b8e36e23f7fc3fd752eea86f8be8d83375a6",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xfec0cf7fe078a500abf15f1284958f22049c2c7e",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x01b3ec4aae1b8729529beb4965f27d008788b0eb",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x0371a82e4a9d0a4312f3ee2ac9c6958512891372",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x05f4a42e251f2d52b8ed15e9fedaacfcef1fad27",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x076c97e1c869072ee22f8c91978c99b4bcb02591",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x09d8b66c48424324b25754a873e290cae5dca439",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x0abdace70d3790235af448c88547603b945604ea",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x0cf0ee63788a0849fe5297f3407f701e122cc023",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x0d8775f648430679a709e98d2b0cb6250d2887ef",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x0e0989b1f9b8a38983c2ba8053269ca62ec9b195",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x0f513ffb4926ff82d7f60a05069047aca295c413",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x0f5d2fb29fb7d3cfee444a200298f468908cc942",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x1063ce524265d5a3a624f4914acd573dd89ce988",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x106aa49295b525fcf959aa75ec3f7dcbf5352f1c",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x107c4504cd79c5d2696ea0030a8dd4e92601b82e",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x1183f92a5624d68e85ffb9170f16bf0443b4c242",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x12480e24eb5bec1a9d4369cab6a80cad3c0a377a",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x12b19d3e2ccc14da04fae33e63652ce469b3f2fd",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x12fef5e57bf45873cd9b62e9dbd7bfb99e32d73e",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x168296bb09e24a88805cb9c33356536b980d3fc5",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x1776e1f26f98b1a5df9cd347953a26dd3cb46671",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x177d39ac676ed1c67a2b268ad7f1e58826e5b0af",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x1d462414fe14cf489c7a21cac78509f4bf8cd7c0",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x24692791bc444c5cd0b81e3cbcaba4b04acd1f3b",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x255aa6df07540cb5d3d297f0d0d4d84cb52bc8e6",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x27054b13b1b798b345b591a4d22e6562d47ea75a",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x27695e09149adc738a978e9a678f99e4c39e9eb9",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x27dce1ec4d3f72c3e457cc50354f1f975ddef488",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x27f610bf36eca0939093343ac28b1534a721dbb4",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x2956356cd2a2bf3202f771f50d3d14a367b48070",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x340d2bde5eb28c1eed91b2f790723e3b160613b7",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x3597bfd533a99c9aa083587b074434e61eb0a258",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x3618516f45cd3c913f81f9987af41077932bc40d",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x386467f1f3ddbe832448650418311a479eecfc57",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x3883f5e181fccaf8410fa61e12b59bad963fb645",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x399a0e6fbeb3d74c85357439f4c8aed9678a5cbf",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x39bb259f66e1c59d5abef88375979b4d20d98022",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x3d1ba9be9f66b8ee101911bc36d3fb562eac2244",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x4156d3342d5c385a87d264f90653733592000581",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x419d0d8bdd9af5e606ae2232ed285aff190e711b",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x41e5560054824ea6b0732e656e3ad64e20e94e45",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x42d6622dece394b54999fbd73d108123806f6a18",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x44f588aeeb8c44471439d1270b3603c66a9262f1",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x4ceda7906a5ed2179785cd3a40a69ee8bc99c466",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x4d8fc1453a0f359e99c9675954e656d80d996fbf",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x4df47b4969b2911c966506e3592c41389493953b",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x4df812f6064def1e5e029f1ca858777cc98d2d81",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x514910771af9ca656af840dff83e8264ecf986ca",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x52a7cb918c11a16958be40cba7e31e32a499a465",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x533ef0984b2faa227acc620c67cce12aa39cd8cd",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x554c20b7c486beee439277b4540a434566dc4c02",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x56ba2ee7890461f463f7be02aac3099f6d5811a8",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x5732046a883704404f284ce41ffadd5b007fd668",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x595832f8fc6bf59c85c527fec3740a1b7a361269",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x5af2be193a6abca9c8817001f45744777db30756",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x5b2e4a700dfbc560061e957edec8f6eeeb74a320",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x5bc7e5f0ab8b2e10d2d0a3f21739fce62459aef3",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x5ca9a71b1d01849c0a95490cc00559717fcf0d1d",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x5e3346444010135322268a4630d2ed5f8d09446c",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x607f4c5bb672230e8672085532f7e901544a7375",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x614ea929892ea43d3ea2c5e3311b01cc589bad6c",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x6425c6be902d692ae2db752b3c268afadb099d3b",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x672a1ad4f667fb18a333af13667aa0af1f5b5bdd",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x6781a0f84c7e9e846dcb84a9a5bd49333067b104",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x6810e776880c02933d47db1b9fc05908e5386b96",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x744d70fdbe2ba4cf95131626614a1763df805b9e",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x7654915a1b82d6d2d0afc37c52af556ea8983c7e",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x7b69b78cc7fee48202c208609ae6d1f78ce42e13",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x7d4b8cce0591c9044a22ee543533b72e976e36c3",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x80fb784b7ed66730e8b1dbd9820afd29931aab03",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x814964b1bceaf24e26296d031eadf134a2ca4105",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x865e3707a580f9db89304005cddd050ade8873eb",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x88fcfbc22c6d3dbaa25af478c578978339bde77a",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x8a854288a5976036a725879164ca3e91d30c6a1b",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x8ae4bf2c33a8e667de34b54938b0ccd03eb8cc06",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x8eb24319393716668d768dcec29356ae9cffe285",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x8f8221afbb33998d8584a2b05749ba73c37a938a",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x9214ec02cb71cba0ada6896b8da260736a67ab10",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x923108a439c4e8c2315c4f6521e5ce95b44e9b4c",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x960b236a07cf122663c4303350609a66a7b288c0",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x983f6d60db79ea8ca4eb9968c6aff8cfa04b3c63",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x9992ec3cf6a55b00978cddf2b27bc6882d88d1ec",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x99ea4db9ee77acd40b119bd1dc4e33e1c070b80d",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x9a005c9a89bd72a4bd27721e7a09a3c11d2b03c4",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xa5fd1a791c4dfcaacc963d4f73c6ae5824149ea7",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xa8006c4ca56f24d6836727d106349320db7fef82",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xa87c3ec87eb802aad080df0adb331e504d327e5d",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xab16e0d25c06cb376259cc18c1de4aca57605589",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xac3211a5025414af2866ff09c23fc18bc97e79b1",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xacfa209fb73bf3dd5bbfb1101b9bc999c49062a5",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xb24754be79281553dc1adc160ddf5cd9b74361a4",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xb3bd49e28f8f832b8d1e246106991e546c323502",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xb45a50545beeab73f38f31e5973768c421805e5e",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xb4efd85c19999d84251304bda99e90b92300bd93",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xb5a5f22694352c15b00323844ad545abb2b11028",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xb5c0e43a6330b9eb904ec57ea24d70269ae4652e",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xb62d18dea74045e822352ce4b3ee77319dc5ff2f",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xb64ef51c888972c908cfacf59b47c1afbc0ab8ac",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xb98d4c97425d9908e66e53a6fdf673acca0be986",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xba2184520a1cc49a6159c57e61e1844e085615b6",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xba5f11b16b155792cf3b2e6880e8706859a8aeb6",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xbdc5bac39dbe132b1e030e898ae3830017d7d969",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xbeb9ef514a379b997e0798fdcc901ee474b6d9a1",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xbf2179859fc6d5bee9bf9158632dc51678a4100e",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xc27a2f05fa577a83ba0fdb4c38443c0718356501",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xc438b4c0dfbb1593be6dee03bbd1a84bb3aa6213",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xc66ea802717bfb9833400264dd12c2bceaa34a6d",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xc997d07b0bc607b6d1bcb6fb9d4a5579c466c3e5",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xd0a4b8946cb52f0661273bfbc6fd0e0c75fc6433",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xd26114cd6ee289accf82350c8d8487fedb8a0c07",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xd2d6158683aee4cc838067727209a0aaf4359de3",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xd4c435f5b09f855c3317c8524cb1f586e42795fa",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xd4fa1460f537bb9085d22c7bccb5dd450ef28e3a",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xd8912c10681d8b21fd3742244f44658dba12264e",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xe0b7927c4af23765cb51314a0e0521a9645f0e2a",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xe2e6d4be086c6938b53b22144855eef674281639",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xe41d2489571d322189246dafa5ebde1f4699f498",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xe94327d07fc17907b4db788e5adf2ed424addff6",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xea097a2b1db00627b2fa17460ad260c016016977",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xea1f346faf023f974eb5adaf088bbcdf02d761f4",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xea38eaa3c86c8f9b751533ba2e562deb9acded40",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xeab43193cf0623073ca89db9b712796356fa7414",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xeb2da9fac54284cea731d1f10bb34eecb3c00c14",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xeb7c20027172e5d143fb030d50f91cece2d1485d",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xef2463099360a085f1f10b076ed72ef625497a06",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xf433089366899d83a9f26a773d59ec7ecf30355e",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xf6b55acbbc49f4524aa48d19281a9a77c54de10f",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xf6cfe53d6febaeea051f400ff5fc14f0cbbdaca1",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xf7b098298f7c69fc14610bf71d5e02c60792894c",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xf970b8e36e23f7fc3fd752eea86f8be8d83375a6",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xfec0cf7fe078a500abf15f1284958f22049c2c7e",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- }
-]
diff --git a/packages/sra-report/test/fixtures/v0/token_pairs/malformed.json b/packages/sra-report/test/fixtures/v0/token_pairs/malformed.json
deleted file mode 100644
index 19e076c41..000000000
--- a/packages/sra-report/test/fixtures/v0/token_pairs/malformed.json
+++ /dev/null
@@ -1,30 +0,0 @@
-[
- {
- "tokenA": {
- "address": "4a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x01b3ec4aae1b8729529beb4965f27d008788b0eb",
- "minAmount": "1",
- "maxAmount": 999999999999999999999,
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenX": {
- "address": "0x0371a82e4a9d0a4312f3ee2ac9c6958512891372",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- }
-]
diff --git a/packages/sra-report/test/fixtures/v0/token_pairs/token_a_and_token_b_params.json b/packages/sra-report/test/fixtures/v0/token_pairs/token_a_and_token_b_params.json
deleted file mode 100644
index cdb9c477b..000000000
--- a/packages/sra-report/test/fixtures/v0/token_pairs/token_a_and_token_b_params.json
+++ /dev/null
@@ -1,16 +0,0 @@
-[
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xe41d2489571d322189246dafa5ebde1f4699f498",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- }
-]
diff --git a/packages/sra-report/test/fixtures/v0/token_pairs/token_a_param.json b/packages/sra-report/test/fixtures/v0/token_pairs/token_a_param.json
deleted file mode 100644
index 7c2e8cb3a..000000000
--- a/packages/sra-report/test/fixtures/v0/token_pairs/token_a_param.json
+++ /dev/null
@@ -1,1864 +0,0 @@
-[
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x01b3ec4aae1b8729529beb4965f27d008788b0eb",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x0371a82e4a9d0a4312f3ee2ac9c6958512891372",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x05f4a42e251f2d52b8ed15e9fedaacfcef1fad27",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x076c97e1c869072ee22f8c91978c99b4bcb02591",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x09d8b66c48424324b25754a873e290cae5dca439",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x0abdace70d3790235af448c88547603b945604ea",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x0cf0ee63788a0849fe5297f3407f701e122cc023",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x0d8775f648430679a709e98d2b0cb6250d2887ef",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x0e0989b1f9b8a38983c2ba8053269ca62ec9b195",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x0f513ffb4926ff82d7f60a05069047aca295c413",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x0f5d2fb29fb7d3cfee444a200298f468908cc942",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x1063ce524265d5a3a624f4914acd573dd89ce988",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x106aa49295b525fcf959aa75ec3f7dcbf5352f1c",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x107c4504cd79c5d2696ea0030a8dd4e92601b82e",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x1183f92a5624d68e85ffb9170f16bf0443b4c242",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x12480e24eb5bec1a9d4369cab6a80cad3c0a377a",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x12b19d3e2ccc14da04fae33e63652ce469b3f2fd",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x12fef5e57bf45873cd9b62e9dbd7bfb99e32d73e",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x168296bb09e24a88805cb9c33356536b980d3fc5",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x1776e1f26f98b1a5df9cd347953a26dd3cb46671",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x177d39ac676ed1c67a2b268ad7f1e58826e5b0af",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x1d462414fe14cf489c7a21cac78509f4bf8cd7c0",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x24692791bc444c5cd0b81e3cbcaba4b04acd1f3b",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x255aa6df07540cb5d3d297f0d0d4d84cb52bc8e6",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x27054b13b1b798b345b591a4d22e6562d47ea75a",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x27695e09149adc738a978e9a678f99e4c39e9eb9",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x27dce1ec4d3f72c3e457cc50354f1f975ddef488",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x27f610bf36eca0939093343ac28b1534a721dbb4",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x2956356cd2a2bf3202f771f50d3d14a367b48070",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x340d2bde5eb28c1eed91b2f790723e3b160613b7",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x3597bfd533a99c9aa083587b074434e61eb0a258",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x3618516f45cd3c913f81f9987af41077932bc40d",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x386467f1f3ddbe832448650418311a479eecfc57",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x3883f5e181fccaf8410fa61e12b59bad963fb645",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x399a0e6fbeb3d74c85357439f4c8aed9678a5cbf",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x39bb259f66e1c59d5abef88375979b4d20d98022",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x3d1ba9be9f66b8ee101911bc36d3fb562eac2244",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x4156d3342d5c385a87d264f90653733592000581",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x419d0d8bdd9af5e606ae2232ed285aff190e711b",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x41e5560054824ea6b0732e656e3ad64e20e94e45",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x42d6622dece394b54999fbd73d108123806f6a18",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x44f588aeeb8c44471439d1270b3603c66a9262f1",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x4ceda7906a5ed2179785cd3a40a69ee8bc99c466",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x4d8fc1453a0f359e99c9675954e656d80d996fbf",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x4df47b4969b2911c966506e3592c41389493953b",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x4df812f6064def1e5e029f1ca858777cc98d2d81",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x514910771af9ca656af840dff83e8264ecf986ca",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x52a7cb918c11a16958be40cba7e31e32a499a465",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x533ef0984b2faa227acc620c67cce12aa39cd8cd",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x554c20b7c486beee439277b4540a434566dc4c02",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x56ba2ee7890461f463f7be02aac3099f6d5811a8",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x5732046a883704404f284ce41ffadd5b007fd668",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x595832f8fc6bf59c85c527fec3740a1b7a361269",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x5af2be193a6abca9c8817001f45744777db30756",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x5b2e4a700dfbc560061e957edec8f6eeeb74a320",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x5bc7e5f0ab8b2e10d2d0a3f21739fce62459aef3",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x5ca9a71b1d01849c0a95490cc00559717fcf0d1d",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x5e3346444010135322268a4630d2ed5f8d09446c",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x607f4c5bb672230e8672085532f7e901544a7375",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x614ea929892ea43d3ea2c5e3311b01cc589bad6c",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x6425c6be902d692ae2db752b3c268afadb099d3b",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x672a1ad4f667fb18a333af13667aa0af1f5b5bdd",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x6781a0f84c7e9e846dcb84a9a5bd49333067b104",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x6810e776880c02933d47db1b9fc05908e5386b96",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x744d70fdbe2ba4cf95131626614a1763df805b9e",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x7654915a1b82d6d2d0afc37c52af556ea8983c7e",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x7b69b78cc7fee48202c208609ae6d1f78ce42e13",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x7d4b8cce0591c9044a22ee543533b72e976e36c3",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x80fb784b7ed66730e8b1dbd9820afd29931aab03",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x814964b1bceaf24e26296d031eadf134a2ca4105",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x865e3707a580f9db89304005cddd050ade8873eb",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x88fcfbc22c6d3dbaa25af478c578978339bde77a",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x8a854288a5976036a725879164ca3e91d30c6a1b",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x8ae4bf2c33a8e667de34b54938b0ccd03eb8cc06",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x8eb24319393716668d768dcec29356ae9cffe285",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x8f8221afbb33998d8584a2b05749ba73c37a938a",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x9214ec02cb71cba0ada6896b8da260736a67ab10",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x923108a439c4e8c2315c4f6521e5ce95b44e9b4c",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x960b236a07cf122663c4303350609a66a7b288c0",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x983f6d60db79ea8ca4eb9968c6aff8cfa04b3c63",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x9992ec3cf6a55b00978cddf2b27bc6882d88d1ec",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x99ea4db9ee77acd40b119bd1dc4e33e1c070b80d",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x9a005c9a89bd72a4bd27721e7a09a3c11d2b03c4",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xa5fd1a791c4dfcaacc963d4f73c6ae5824149ea7",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xa8006c4ca56f24d6836727d106349320db7fef82",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xa87c3ec87eb802aad080df0adb331e504d327e5d",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xab16e0d25c06cb376259cc18c1de4aca57605589",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xac3211a5025414af2866ff09c23fc18bc97e79b1",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xacfa209fb73bf3dd5bbfb1101b9bc999c49062a5",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xb24754be79281553dc1adc160ddf5cd9b74361a4",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xb3bd49e28f8f832b8d1e246106991e546c323502",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xb45a50545beeab73f38f31e5973768c421805e5e",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xb4efd85c19999d84251304bda99e90b92300bd93",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xb5a5f22694352c15b00323844ad545abb2b11028",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xb5c0e43a6330b9eb904ec57ea24d70269ae4652e",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xb62d18dea74045e822352ce4b3ee77319dc5ff2f",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xb64ef51c888972c908cfacf59b47c1afbc0ab8ac",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xb98d4c97425d9908e66e53a6fdf673acca0be986",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xba2184520a1cc49a6159c57e61e1844e085615b6",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xba5f11b16b155792cf3b2e6880e8706859a8aeb6",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xbdc5bac39dbe132b1e030e898ae3830017d7d969",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xbeb9ef514a379b997e0798fdcc901ee474b6d9a1",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xbf2179859fc6d5bee9bf9158632dc51678a4100e",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xc27a2f05fa577a83ba0fdb4c38443c0718356501",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xc438b4c0dfbb1593be6dee03bbd1a84bb3aa6213",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xc66ea802717bfb9833400264dd12c2bceaa34a6d",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xc997d07b0bc607b6d1bcb6fb9d4a5579c466c3e5",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xd0a4b8946cb52f0661273bfbc6fd0e0c75fc6433",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xd26114cd6ee289accf82350c8d8487fedb8a0c07",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xd2d6158683aee4cc838067727209a0aaf4359de3",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xd4c435f5b09f855c3317c8524cb1f586e42795fa",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xd4fa1460f537bb9085d22c7bccb5dd450ef28e3a",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xd8912c10681d8b21fd3742244f44658dba12264e",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xe0b7927c4af23765cb51314a0e0521a9645f0e2a",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xe2e6d4be086c6938b53b22144855eef674281639",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xe41d2489571d322189246dafa5ebde1f4699f498",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xe94327d07fc17907b4db788e5adf2ed424addff6",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xea097a2b1db00627b2fa17460ad260c016016977",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xea1f346faf023f974eb5adaf088bbcdf02d761f4",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xea38eaa3c86c8f9b751533ba2e562deb9acded40",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xeab43193cf0623073ca89db9b712796356fa7414",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xeb2da9fac54284cea731d1f10bb34eecb3c00c14",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xeb7c20027172e5d143fb030d50f91cece2d1485d",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xef2463099360a085f1f10b076ed72ef625497a06",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xf433089366899d83a9f26a773d59ec7ecf30355e",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xf6b55acbbc49f4524aa48d19281a9a77c54de10f",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xf6cfe53d6febaeea051f400ff5fc14f0cbbdaca1",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xf7b098298f7c69fc14610bf71d5e02c60792894c",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xf970b8e36e23f7fc3fd752eea86f8be8d83375a6",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenA": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xfec0cf7fe078a500abf15f1284958f22049c2c7e",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- }
-]
diff --git a/packages/sra-report/test/fixtures/v0/token_pairs/token_b_param.json b/packages/sra-report/test/fixtures/v0/token_pairs/token_b_param.json
deleted file mode 100644
index 1be6cae96..000000000
--- a/packages/sra-report/test/fixtures/v0/token_pairs/token_b_param.json
+++ /dev/null
@@ -1,1864 +0,0 @@
-[
- {
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x01b3ec4aae1b8729529beb4965f27d008788b0eb",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x0371a82e4a9d0a4312f3ee2ac9c6958512891372",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x05f4a42e251f2d52b8ed15e9fedaacfcef1fad27",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x076c97e1c869072ee22f8c91978c99b4bcb02591",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x09d8b66c48424324b25754a873e290cae5dca439",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x0abdace70d3790235af448c88547603b945604ea",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x0cf0ee63788a0849fe5297f3407f701e122cc023",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x0d8775f648430679a709e98d2b0cb6250d2887ef",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x0e0989b1f9b8a38983c2ba8053269ca62ec9b195",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x0f513ffb4926ff82d7f60a05069047aca295c413",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x0f5d2fb29fb7d3cfee444a200298f468908cc942",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x1063ce524265d5a3a624f4914acd573dd89ce988",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x106aa49295b525fcf959aa75ec3f7dcbf5352f1c",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x107c4504cd79c5d2696ea0030a8dd4e92601b82e",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x1183f92a5624d68e85ffb9170f16bf0443b4c242",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x12480e24eb5bec1a9d4369cab6a80cad3c0a377a",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x12b19d3e2ccc14da04fae33e63652ce469b3f2fd",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x12fef5e57bf45873cd9b62e9dbd7bfb99e32d73e",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x168296bb09e24a88805cb9c33356536b980d3fc5",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x1776e1f26f98b1a5df9cd347953a26dd3cb46671",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x177d39ac676ed1c67a2b268ad7f1e58826e5b0af",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x1d462414fe14cf489c7a21cac78509f4bf8cd7c0",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x24692791bc444c5cd0b81e3cbcaba4b04acd1f3b",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x255aa6df07540cb5d3d297f0d0d4d84cb52bc8e6",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x27054b13b1b798b345b591a4d22e6562d47ea75a",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x27695e09149adc738a978e9a678f99e4c39e9eb9",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x27dce1ec4d3f72c3e457cc50354f1f975ddef488",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x27f610bf36eca0939093343ac28b1534a721dbb4",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x2956356cd2a2bf3202f771f50d3d14a367b48070",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x340d2bde5eb28c1eed91b2f790723e3b160613b7",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x3597bfd533a99c9aa083587b074434e61eb0a258",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x3618516f45cd3c913f81f9987af41077932bc40d",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x386467f1f3ddbe832448650418311a479eecfc57",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x3883f5e181fccaf8410fa61e12b59bad963fb645",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x399a0e6fbeb3d74c85357439f4c8aed9678a5cbf",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x39bb259f66e1c59d5abef88375979b4d20d98022",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x3d1ba9be9f66b8ee101911bc36d3fb562eac2244",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x4156d3342d5c385a87d264f90653733592000581",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x419d0d8bdd9af5e606ae2232ed285aff190e711b",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x41e5560054824ea6b0732e656e3ad64e20e94e45",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x42d6622dece394b54999fbd73d108123806f6a18",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x44f588aeeb8c44471439d1270b3603c66a9262f1",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x4ceda7906a5ed2179785cd3a40a69ee8bc99c466",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x4d8fc1453a0f359e99c9675954e656d80d996fbf",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x4df47b4969b2911c966506e3592c41389493953b",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x4df812f6064def1e5e029f1ca858777cc98d2d81",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x514910771af9ca656af840dff83e8264ecf986ca",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x52a7cb918c11a16958be40cba7e31e32a499a465",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x533ef0984b2faa227acc620c67cce12aa39cd8cd",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x554c20b7c486beee439277b4540a434566dc4c02",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x56ba2ee7890461f463f7be02aac3099f6d5811a8",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x5732046a883704404f284ce41ffadd5b007fd668",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x595832f8fc6bf59c85c527fec3740a1b7a361269",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x5af2be193a6abca9c8817001f45744777db30756",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x5b2e4a700dfbc560061e957edec8f6eeeb74a320",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x5bc7e5f0ab8b2e10d2d0a3f21739fce62459aef3",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x5ca9a71b1d01849c0a95490cc00559717fcf0d1d",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x5e3346444010135322268a4630d2ed5f8d09446c",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x607f4c5bb672230e8672085532f7e901544a7375",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x614ea929892ea43d3ea2c5e3311b01cc589bad6c",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x6425c6be902d692ae2db752b3c268afadb099d3b",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x672a1ad4f667fb18a333af13667aa0af1f5b5bdd",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x6781a0f84c7e9e846dcb84a9a5bd49333067b104",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x6810e776880c02933d47db1b9fc05908e5386b96",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x744d70fdbe2ba4cf95131626614a1763df805b9e",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x7654915a1b82d6d2d0afc37c52af556ea8983c7e",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x7b69b78cc7fee48202c208609ae6d1f78ce42e13",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x7d4b8cce0591c9044a22ee543533b72e976e36c3",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x80fb784b7ed66730e8b1dbd9820afd29931aab03",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x814964b1bceaf24e26296d031eadf134a2ca4105",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x865e3707a580f9db89304005cddd050ade8873eb",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x88fcfbc22c6d3dbaa25af478c578978339bde77a",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x8a854288a5976036a725879164ca3e91d30c6a1b",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x8ae4bf2c33a8e667de34b54938b0ccd03eb8cc06",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x8eb24319393716668d768dcec29356ae9cffe285",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x8f8221afbb33998d8584a2b05749ba73c37a938a",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x9214ec02cb71cba0ada6896b8da260736a67ab10",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x923108a439c4e8c2315c4f6521e5ce95b44e9b4c",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x960b236a07cf122663c4303350609a66a7b288c0",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x983f6d60db79ea8ca4eb9968c6aff8cfa04b3c63",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x9992ec3cf6a55b00978cddf2b27bc6882d88d1ec",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x99ea4db9ee77acd40b119bd1dc4e33e1c070b80d",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x9a005c9a89bd72a4bd27721e7a09a3c11d2b03c4",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0xa5fd1a791c4dfcaacc963d4f73c6ae5824149ea7",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0xa8006c4ca56f24d6836727d106349320db7fef82",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0xa87c3ec87eb802aad080df0adb331e504d327e5d",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0xab16e0d25c06cb376259cc18c1de4aca57605589",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0xac3211a5025414af2866ff09c23fc18bc97e79b1",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0xacfa209fb73bf3dd5bbfb1101b9bc999c49062a5",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0xb24754be79281553dc1adc160ddf5cd9b74361a4",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0xb3bd49e28f8f832b8d1e246106991e546c323502",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0xb45a50545beeab73f38f31e5973768c421805e5e",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0xb4efd85c19999d84251304bda99e90b92300bd93",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0xb5a5f22694352c15b00323844ad545abb2b11028",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0xb5c0e43a6330b9eb904ec57ea24d70269ae4652e",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0xb62d18dea74045e822352ce4b3ee77319dc5ff2f",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0xb64ef51c888972c908cfacf59b47c1afbc0ab8ac",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0xb98d4c97425d9908e66e53a6fdf673acca0be986",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0xba2184520a1cc49a6159c57e61e1844e085615b6",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0xba5f11b16b155792cf3b2e6880e8706859a8aeb6",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0xbdc5bac39dbe132b1e030e898ae3830017d7d969",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0xbeb9ef514a379b997e0798fdcc901ee474b6d9a1",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0xbf2179859fc6d5bee9bf9158632dc51678a4100e",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0xc27a2f05fa577a83ba0fdb4c38443c0718356501",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0xc438b4c0dfbb1593be6dee03bbd1a84bb3aa6213",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0xc66ea802717bfb9833400264dd12c2bceaa34a6d",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0xc997d07b0bc607b6d1bcb6fb9d4a5579c466c3e5",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0xd0a4b8946cb52f0661273bfbc6fd0e0c75fc6433",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0xd26114cd6ee289accf82350c8d8487fedb8a0c07",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0xd2d6158683aee4cc838067727209a0aaf4359de3",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0xd4c435f5b09f855c3317c8524cb1f586e42795fa",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0xd4fa1460f537bb9085d22c7bccb5dd450ef28e3a",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0xd8912c10681d8b21fd3742244f44658dba12264e",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0xe0b7927c4af23765cb51314a0e0521a9645f0e2a",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0xe2e6d4be086c6938b53b22144855eef674281639",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0xe41d2489571d322189246dafa5ebde1f4699f498",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0xe94327d07fc17907b4db788e5adf2ed424addff6",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0xea097a2b1db00627b2fa17460ad260c016016977",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0xea1f346faf023f974eb5adaf088bbcdf02d761f4",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0xea38eaa3c86c8f9b751533ba2e562deb9acded40",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0xeab43193cf0623073ca89db9b712796356fa7414",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0xeb2da9fac54284cea731d1f10bb34eecb3c00c14",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0xeb7c20027172e5d143fb030d50f91cece2d1485d",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0xef2463099360a085f1f10b076ed72ef625497a06",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0xf433089366899d83a9f26a773d59ec7ecf30355e",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0xf6b55acbbc49f4524aa48d19281a9a77c54de10f",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0xf6cfe53d6febaeea051f400ff5fc14f0cbbdaca1",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0xf7b098298f7c69fc14610bf71d5e02c60792894c",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0xf970b8e36e23f7fc3fd752eea86f8be8d83375a6",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- },
- {
- "tokenB": {
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- },
- "tokenA": {
- "address": "0xfec0cf7fe078a500abf15f1284958f22049c2c7e",
- "minAmount": "1",
- "maxAmount": "999999999999999999999",
- "precision": 8
- }
- }
-]
diff --git a/packages/sra-report/test/postman_collection_v0_test.ts b/packages/sra-report/test/postman_collection_v0_test.ts
deleted file mode 100644
index dfb16b10d..000000000
--- a/packages/sra-report/test/postman_collection_v0_test.ts
+++ /dev/null
@@ -1,76 +0,0 @@
-import 'mocha';
-import * as nock from 'nock';
-
-import * as defaultRequestTokenPairsResponseJSON from './fixtures/v0/token_pairs/default_request.json';
-import * as malformedTokenPairsResponseJSON from './fixtures/v0/token_pairs/malformed.json';
-import * as tokenAAndTokenBParamsTokenPairsResponseJSON from './fixtures/v0/token_pairs/token_a_and_token_b_params.json';
-import * as tokenAParamTokenPairsResponseJSON from './fixtures/v0/token_pairs/token_a_param.json';
-import * as tokenBParamTokenPairsResponseJSON from './fixtures/v0/token_pairs/token_b_param.json';
-import { testRunner } from './test_runner';
-
-describe('Postman Collection v0', () => {
- const testRelayerUrl = 'https://example.com';
- const nockScope = nock(testRelayerUrl);
- afterEach(() => {
- nock.cleanAll();
- });
- describe('GET /token_pairs', () => {
- const postmanCollectionFolderName = 'GET /token_pairs';
- const resourcePath = '/token_pairs';
- describe('default request', () => {
- const postmanCollectionRequestName = 'default request';
- const nockInterceptor = nockScope.get(resourcePath);
- testRunner.runContentTypeTests(nockInterceptor, postmanCollectionFolderName, postmanCollectionRequestName);
- testRunner.runSchemaTests(
- nockInterceptor,
- postmanCollectionFolderName,
- postmanCollectionRequestName,
- malformedTokenPairsResponseJSON,
- defaultRequestTokenPairsResponseJSON,
- );
- });
- describe('tokenA param', () => {
- const postmanCollectionRequestName = 'tokenA param';
- const nockInterceptor = nockScope.get(resourcePath).query({
- tokenA: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
- });
- testRunner.runContentTypeTests(nockInterceptor, postmanCollectionFolderName, postmanCollectionRequestName);
- testRunner.runSchemaTests(
- nockInterceptor,
- postmanCollectionFolderName,
- postmanCollectionRequestName,
- malformedTokenPairsResponseJSON,
- tokenAParamTokenPairsResponseJSON,
- );
- });
- describe('tokenB param', () => {
- const postmanCollectionRequestName = 'tokenB param';
- const nockInterceptor = nockScope.get(resourcePath).query({
- tokenB: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
- });
- testRunner.runContentTypeTests(nockInterceptor, postmanCollectionFolderName, postmanCollectionRequestName);
- testRunner.runSchemaTests(
- nockInterceptor,
- postmanCollectionFolderName,
- postmanCollectionRequestName,
- malformedTokenPairsResponseJSON,
- tokenBParamTokenPairsResponseJSON,
- );
- });
- describe('tokenA and tokenB params', () => {
- const postmanCollectionRequestName = 'tokenA and tokenB params';
- const nockInterceptor = nockScope.get(resourcePath).query({
- tokenA: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
- tokenB: '0xe41d2489571d322189246dafa5ebde1f4699f498',
- });
- testRunner.runContentTypeTests(nockInterceptor, postmanCollectionFolderName, postmanCollectionRequestName);
- testRunner.runSchemaTests(
- nockInterceptor,
- postmanCollectionFolderName,
- postmanCollectionRequestName,
- malformedTokenPairsResponseJSON,
- tokenAAndTokenBParamsTokenPairsResponseJSON,
- );
- });
- });
-});
diff --git a/packages/sra-report/test/test_runner.ts b/packages/sra-report/test/test_runner.ts
deleted file mode 100644
index 8094018f2..000000000
--- a/packages/sra-report/test/test_runner.ts
+++ /dev/null
@@ -1,143 +0,0 @@
-import * as chai from 'chai';
-import * as chaiAsPromised from 'chai-as-promised';
-import * as dirtyChai from 'dirty-chai';
-import * as _ from 'lodash';
-import 'mocha';
-import {
- NewmanRunExecution,
- NewmanRunExecutionAssertion,
- NewmanRunExecutionAssertionError,
- NewmanRunSummary,
-} from 'newman';
-import * as nock from 'nock';
-
-import * as sraReportCollectionJSON from '../../postman_collections/sra_report.postman_collection.json';
-import { utils } from '../src/utils';
-
-import * as postmanEnvironmentJSON from './environments/postman_environment.json';
-
-chai.config.includeStack = true;
-chai.use(dirtyChai);
-chai.use(chaiAsPromised);
-const expect = chai.expect;
-
-const CONTENT_TYPE_ASSERTION_NAME = 'Has Content-Type header with value application/json';
-const SCHEMA_ASSERTION_NAME = 'Schema is valid';
-const SUCCESS_STATUS = 200;
-const baseNewmanRunOptions = {
- collection: sraReportCollectionJSON,
- environment: postmanEnvironmentJSON,
- reporter: {
- cli: {
- noConsole: true,
- },
- },
-};
-
-export const testRunner = {
- runContentTypeTests(
- nockInterceptor: nock.Interceptor,
- postmanCollectionFolderName: string,
- postmanCollectionRequestName: string,
- ): void {
- const newmanRunOptions = {
- ...baseNewmanRunOptions,
- folder: postmanCollectionFolderName,
- };
- describe(CONTENT_TYPE_ASSERTION_NAME, () => {
- it('fails when there are no headers', async () => {
- nockInterceptor.reply(SUCCESS_STATUS, {});
- const summary = await utils.newmanRunAsync(newmanRunOptions);
- const error = findAssertionErrorIfExists(
- summary,
- postmanCollectionRequestName,
- CONTENT_TYPE_ASSERTION_NAME,
- );
- const errorMessage = _.get(error, 'message');
- expect(error).to.not.be.undefined();
- expect(errorMessage).to.equal(`expected response to have header with key 'Content-Type'`);
- });
- it('fails when Content-Type header exists but not with value application/json', async () => {
- const headers = {
- 'Content-Type': 'text/html',
- };
- nockInterceptor.reply(SUCCESS_STATUS, {}, headers);
- const summary = await utils.newmanRunAsync(newmanRunOptions);
- const error = findAssertionErrorIfExists(
- summary,
- postmanCollectionRequestName,
- CONTENT_TYPE_ASSERTION_NAME,
- );
- const errorMessage = _.get(error, 'message');
- expect(error).to.not.be.undefined();
- expect(errorMessage).to.equal(`expected 'text/html' to include 'application/json'`);
- });
- it('passes when Content-Type header exists with value application/json', async () => {
- const headers = {
- 'Content-Type': 'charset=utf-8; application/json',
- };
- nockInterceptor.reply(SUCCESS_STATUS, {}, headers);
- const summary = await utils.newmanRunAsync(newmanRunOptions);
- const error = findAssertionErrorIfExists(
- summary,
- postmanCollectionRequestName,
- CONTENT_TYPE_ASSERTION_NAME,
- );
- expect(error).to.be.undefined();
- });
- });
- },
- runSchemaTests(
- nockInterceptor: nock.Interceptor,
- postmanCollectionFolderName: string,
- postmanCollectionRequestName: string,
- malformedJson: object,
- correctJson: object,
- ): void {
- const newmanRunOptions = {
- ...baseNewmanRunOptions,
- folder: postmanCollectionFolderName,
- };
- describe(SCHEMA_ASSERTION_NAME, () => {
- it('fails when schema is invalid', async () => {
- nockInterceptor.reply(SUCCESS_STATUS, malformedJson);
- const summary = await utils.newmanRunAsync(newmanRunOptions);
- const error = findAssertionErrorIfExists(summary, postmanCollectionRequestName, SCHEMA_ASSERTION_NAME);
- const errorMessage = _.get(error, 'message');
- expect(error).to.not.be.undefined();
- expect(errorMessage).to.equal('expected false to be true');
- });
- it('passes when schema is valid', async () => {
- nockInterceptor.reply(SUCCESS_STATUS, correctJson);
- const summary = await utils.newmanRunAsync(newmanRunOptions);
- const error = findAssertionErrorIfExists(summary, postmanCollectionRequestName, SCHEMA_ASSERTION_NAME);
- expect(error).to.be.undefined();
- });
- });
- },
-};
-
-function findAssertionErrorIfExists(
- summary: NewmanRunSummary,
- postmanCollectionRequestName: string,
- postmanCollectionAssertionName: string,
-): NewmanRunExecutionAssertionError | undefined {
- const matchingExecutionIfExists = _.find(summary.run.executions, (execution: NewmanRunExecution) => {
- return execution.item.name === postmanCollectionRequestName;
- });
- if (_.isUndefined(matchingExecutionIfExists)) {
- return undefined;
- }
- const matchingAssertionIfExists = _.find(
- matchingExecutionIfExists.assertions,
- (assertion: NewmanRunExecutionAssertion) => {
- return assertion.assertion === postmanCollectionAssertionName;
- },
- );
- if (_.isUndefined(matchingAssertionIfExists)) {
- return undefined;
- } else {
- const error = matchingAssertionIfExists.error;
- return error;
- }
-}
diff --git a/packages/sra-report/tslint.json b/packages/sra-report/tslint.json
deleted file mode 100644
index ffaefe83a..000000000
--- a/packages/sra-report/tslint.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "extends": ["@0xproject/tslint-config"]
-}
diff --git a/packages/sra-spec/CHANGELOG.json b/packages/sra-spec/CHANGELOG.json
index 7657dd9ee..e053b3163 100644
--- a/packages/sra-spec/CHANGELOG.json
+++ b/packages/sra-spec/CHANGELOG.json
@@ -1,5 +1,24 @@
[
{
+ "version": "1.0.8",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ],
+ "timestamp": 1541740904
+ },
+ {
+ "version": "1.0.7",
+ "changes": [
+ {
+ "note": "Make @loopback/openapi-v3-types a 'dependency' so it's available to users of the library",
+ "pr": 1105
+ }
+ ],
+ "timestamp": 1539871071
+ },
+ {
"version": "1.0.6",
"changes": [
{
diff --git a/packages/sra-spec/CHANGELOG.md b/packages/sra-spec/CHANGELOG.md
index 4d27f20df..02d22431f 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.8 - _November 9, 2018_
+
+ * Dependencies updated
+
+## v1.0.7 - _October 18, 2018_
+
+ * Make @loopback/openapi-v3-types a 'dependency' so it's available to users of the library (#1105)
+
## v1.0.6 - _October 4, 2018_
* Dependencies updated
@@ -38,6 +46,6 @@ CHANGELOG
* Add takerAddress to /orders parameters (#974)
-## v1.0.1-rc.4 - _August 13, 2018_
+## v1.0.1-rc.4 - _August 14, 2018_
* Add inital spec for SRA v2 (#916)
diff --git a/packages/sra-spec/README.md b/packages/sra-spec/README.md
index 7eee6396b..4575aaf66 100644
--- a/packages/sra-spec/README.md
+++ b/packages/sra-spec/README.md
@@ -1,4 +1,4 @@
-## @0xproject/sra-spec
+## @0x/sra-spec
Contains the Standard Relayer API [OpenAPI Spec](https://github.com/OAI/OpenAPI-Specification).
@@ -9,7 +9,7 @@ A deployed [ReDoc](https://github.com/Rebilly/ReDoc) static site with the API ca
## Usage
```
-import { api } from '@0xproject/sra-spec';
+import { api } from '@0x/sra-spec';
```
## Installation
@@ -53,13 +53,13 @@ yarn install
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
```bash
-PKG=@0xproject/sra-spec yarn build
+PKG=@0x/sra-spec yarn build
```
Or continuously rebuild on change:
```bash
-PKG=@0xproject/sra-spec yarn watch
+PKG=@0x/sra-spec yarn watch
```
### Static Site
diff --git a/packages/sra-spec/package.json b/packages/sra-spec/package.json
index 6b4157699..e3b6ad979 100644
--- a/packages/sra-spec/package.json
+++ b/packages/sra-spec/package.json
@@ -1,6 +1,6 @@
{
- "name": "@0xproject/sra-spec",
- "version": "1.0.6",
+ "name": "@0x/sra-spec",
+ "version": "1.0.8",
"engines": {
"node": ">=6.12"
},
@@ -10,7 +10,7 @@
"scripts": {
"serve": "redoc-cli serve lib/api.json --watch",
"watch_without_deps": "run-p build:watch serve",
- "lint": "tslint --project .",
+ "lint": "tslint --format stylish --project .",
"test": "swagger-cli validate lib/api.json",
"rebuild_and_test": "run-s clean build test",
"test:coverage": "nyc npm run test --all && yarn coverage:report:lcov",
@@ -35,11 +35,11 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/sra-spec/README.md",
"dependencies": {
- "@0xproject/json-schemas": "^1.0.7"
+ "@0x/json-schemas": "^2.0.1",
+ "@loopback/openapi-v3-types": "^0.8.2"
},
"devDependencies": {
- "@0xproject/tslint-config": "^1.0.8",
- "@loopback/openapi-v3-types": "^0.8.2",
+ "@0x/tslint-config": "^1.0.10",
"@types/mocha": "^2.2.42",
"@types/node": "^10.5.3",
"chai": "^4.0.1",
diff --git a/packages/sra-spec/src/json-schemas.ts b/packages/sra-spec/src/json-schemas.ts
index 173a04bfb..f9342ca9e 100644
--- a/packages/sra-spec/src/json-schemas.ts
+++ b/packages/sra-spec/src/json-schemas.ts
@@ -1,7 +1,8 @@
-import { schemas as jsonSchemas } from '@0xproject/json-schemas';
+import { schemas as jsonSchemas } from '@0x/json-schemas';
// Only include schemas we actually need
const {
+ wholeNumberSchema,
numberSchema,
addressSchema,
hexSchema,
@@ -21,13 +22,14 @@ const {
relayerApiAssetDataPairsResponseSchema,
relayerApiAssetDataTradeInfoSchema,
relayerApiOrdersChannelSubscribeSchema,
- relayerApiOrdersChannelSubscribePayload,
+ relayerApiOrdersChannelSubscribePayloadSchema,
relayerApiOrdersChannelUpdateSchema,
relayerApiOrdersResponseSchema,
relayerApiAssetDataPairsSchema,
} = jsonSchemas;
const usedSchemas = {
+ wholeNumberSchema,
numberSchema,
addressSchema,
hexSchema,
@@ -47,7 +49,7 @@ const usedSchemas = {
relayerApiAssetDataPairsResponseSchema,
relayerApiAssetDataTradeInfoSchema,
relayerApiOrdersChannelSubscribeSchema,
- relayerApiOrdersChannelSubscribePayload,
+ relayerApiOrdersChannelSubscribePayloadSchema,
relayerApiOrdersChannelUpdateSchema,
relayerApiOrdersResponseSchema,
relayerApiAssetDataPairsSchema,
diff --git a/packages/sra-spec/src/md/introduction.md b/packages/sra-spec/src/md/introduction.md
index f27186f41..824df8998 100644
--- a/packages/sra-spec/src/md/introduction.md
+++ b/packages/sra-spec/src/md/introduction.md
@@ -1,7 +1,3 @@
-# Testing
-
-Use the [sra-report](https://github.com/0xProject/0x-monorepo/tree/development/packages/sra-report) command line tool to test your API for SRA compliance.
-
# Schemas
The [JSON schemas](http://json-schema.org/) for the API payloads and responses can be found in [@0xproject/json-schemas](https://github.com/0xProject/0x.js/tree/development/packages/json-schemas). Examples of each payload and response can be found in the library's [test suite](https://github.com/0xProject/0x.js/blob/development/packages/json-schemas/test/schema_test.ts#L1).
diff --git a/packages/sra-spec/tslint.json b/packages/sra-spec/tslint.json
index ffaefe83a..dd9053357 100644
--- a/packages/sra-spec/tslint.json
+++ b/packages/sra-spec/tslint.json
@@ -1,3 +1,3 @@
{
- "extends": ["@0xproject/tslint-config"]
+ "extends": ["@0x/tslint-config"]
}
diff --git a/packages/subproviders/CHANGELOG.json b/packages/subproviders/CHANGELOG.json
index 387207b01..816c776a5 100644
--- a/packages/subproviders/CHANGELOG.json
+++ b/packages/subproviders/CHANGELOG.json
@@ -1,5 +1,14 @@
[
{
+ "version": "2.1.1",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ],
+ "timestamp": 1541740904
+ },
+ {
"version": "2.1.0",
"changes": [
{
@@ -9,8 +18,13 @@
{
"note": "Add support for `eth_signTypedData` in wallets Mnemonic, Private and EthLightWallet",
"pr": 1102
+ },
+ {
+ "note": "Make web3-provider-engine types a 'dependency' so it's available to users of the library",
+ "pr": 1105
}
- ]
+ ],
+ "timestamp": 1539871071
},
{
"version": "2.0.7",
diff --git a/packages/subproviders/CHANGELOG.md b/packages/subproviders/CHANGELOG.md
index 872948ad7..72ac9d1f7 100644
--- a/packages/subproviders/CHANGELOG.md
+++ b/packages/subproviders/CHANGELOG.md
@@ -5,6 +5,16 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
+## v2.1.1 - _November 9, 2018_
+
+ * Dependencies updated
+
+## v2.1.0 - _October 18, 2018_
+
+ * Add `MetamaskSubprovider` to handle inconsistent JSON RPC behaviour (#1102)
+ * Add support for `eth_signTypedData` in wallets Mnemonic, Private and EthLightWallet (#1102)
+ * Make web3-provider-engine types a 'dependency' so it's available to users of the library (#1105)
+
## v2.0.7 - _October 4, 2018_
* Dependencies updated
@@ -37,7 +47,7 @@ CHANGELOG
* Export types: `PartialTxParams`, `JSONRPCRequestPayloadWithMethod`, `ECSignatureString`, `AccountFetchingConfigs`, `LedgerEthereumClientFactoryAsync`, `OnNextCompleted`, `MnemonicWalletSubproviderConfigs`, LedgerGetAddressResult, `JSONRPCRequestPayload`, `Provider`, `JSONRPCResponsePayload` and `JSONRPCErrorCallback` (#924)
-## v1.0.5 - _August 13, 2018_
+## v1.0.5 - _August 14, 2018_
* Dependencies updated
diff --git a/packages/subproviders/README.md b/packages/subproviders/README.md
index 90c9b7bbe..6f97d760e 100644
--- a/packages/subproviders/README.md
+++ b/packages/subproviders/README.md
@@ -1,4 +1,4 @@
-## @0xproject/subproviders
+## @0x/subproviders
A few useful web3 subproviders including a LedgerSubprovider useful for adding Ledger Nano S support.
@@ -9,14 +9,14 @@ We have written up a [Wiki](https://0xproject.com/wiki#Web3-Provider-Examples) a
## Installation
```
-yarn add @0xproject/subproviders
+yarn add @0x/subproviders
```
If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`:
```json
"compilerOptions": {
- "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"],
+ "typeRoots": ["node_modules/@0x/typescript-typings/types", "node_modules/@types"],
}
```
@@ -45,13 +45,13 @@ yarn install
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
```bash
-PKG=@0xproject/subproviders yarn build
+PKG=@0x/subproviders yarn build
```
Or continuously rebuild on change:
```bash
-PKG=@0xproject/subproviders yarn watch
+PKG=@0x/subproviders yarn watch
```
### Clean
diff --git a/packages/subproviders/package.json b/packages/subproviders/package.json
index ff3ab7ed5..1a25b5e32 100644
--- a/packages/subproviders/package.json
+++ b/packages/subproviders/package.json
@@ -1,6 +1,6 @@
{
- "name": "@0xproject/subproviders",
- "version": "2.0.7",
+ "name": "@0x/subproviders",
+ "version": "2.1.1",
"engines": {
"node": ">=6.12"
},
@@ -11,7 +11,7 @@
"build": "tsc -b",
"build:ci": "yarn build",
"clean": "shx rm -rf lib generated_docs",
- "lint": "tslint --project .",
+ "lint": "tslint --format stylish --project .",
"run_mocha_unit": "mocha --require source-map-support/register --require make-promises-safe lib/test/unit/**/*_test.js --timeout 10000 --bail --exit",
"run_mocha_integration": "mocha --require source-map-support/register --require make-promises-safe lib/test/integration/**/*_test.js --timeout 10000 --bail --exit",
"test": "npm run test:unit",
@@ -29,20 +29,21 @@
}
},
"dependencies": {
- "@0xproject/assert": "^1.0.13",
- "@0xproject/types": "^1.1.4",
- "@0xproject/typescript-typings": "^3.0.2",
- "@0xproject/utils": "^2.0.2",
- "@0xproject/web3-wrapper": "^3.0.3",
+ "@0x/assert": "^1.0.15",
+ "@0x/types": "^1.2.1",
+ "@0x/typescript-typings": "^3.0.4",
+ "@0x/utils": "^2.0.4",
+ "@0x/web3-wrapper": "^3.1.1",
"@ledgerhq/hw-app-eth": "^4.3.0",
- "@ledgerhq/hw-transport-u2f": "^4.3.0",
+ "@ledgerhq/hw-transport-u2f": "4.24.0",
"@types/eth-lightwallet": "^3.0.0",
"@types/ganache-core": "^2.1.0",
"@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.0.11",
+ "ethereum-types": "^1.1.2",
"ethereumjs-tx": "^1.3.5",
"ethereumjs-util": "^5.1.1",
"ganache-core": "^2.2.1",
@@ -53,7 +54,7 @@
"web3-provider-engine": "14.0.6"
},
"devDependencies": {
- "@0xproject/tslint-config": "^1.0.8",
+ "@0x/tslint-config": "^1.0.10",
"@types/bip39": "^2.4.0",
"@types/bn.js": "^4.11.0",
"@types/ethereumjs-tx": "^1.0.0",
@@ -62,10 +63,8 @@
"@types/mocha": "^2.2.42",
"@types/node": "*",
"@types/sinon": "^2.2.2",
- "@types/web3-provider-engine": "^14.0.0",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
- "copyfiles": "^2.0.0",
"dirty-chai": "^2.0.1",
"make-promises-safe": "^1.1.0",
"mocha": "^4.1.0",
@@ -74,7 +73,7 @@
"shx": "^0.2.2",
"sinon": "^4.0.0",
"tslint": "5.11.0",
- "typedoc": "0.12.0",
+ "typedoc": "0.13.0",
"typescript": "3.0.1",
"webpack": "^4.20.2"
},
diff --git a/packages/subproviders/src/index.ts b/packages/subproviders/src/index.ts
index 9f4dac58b..050027f96 100644
--- a/packages/subproviders/src/index.ts
+++ b/packages/subproviders/src/index.ts
@@ -48,14 +48,7 @@ export {
LedgerGetAddressResult,
} from './types';
-export {
- ECSignature,
- EIP712Object,
- EIP712ObjectValue,
- EIP712TypedData,
- EIP712Types,
- EIP712Parameter,
-} from '@0xproject/types';
+export { ECSignature, EIP712Object, EIP712ObjectValue, EIP712TypedData, EIP712Types, EIP712Parameter } from '@0x/types';
export {
JSONRPCRequestPayload,
diff --git a/packages/subproviders/src/subproviders/base_wallet_subprovider.ts b/packages/subproviders/src/subproviders/base_wallet_subprovider.ts
index 409a0d330..e9d104074 100644
--- a/packages/subproviders/src/subproviders/base_wallet_subprovider.ts
+++ b/packages/subproviders/src/subproviders/base_wallet_subprovider.ts
@@ -1,5 +1,5 @@
-import { assert } from '@0xproject/assert';
-import { addressUtils } from '@0xproject/utils';
+import { assert } from '@0x/assert';
+import { addressUtils } from '@0x/utils';
import { JSONRPCRequestPayload, JSONRPCResponsePayload } from 'ethereum-types';
import * as _ from 'lodash';
diff --git a/packages/subproviders/src/subproviders/eth_lightwallet_subprovider.ts b/packages/subproviders/src/subproviders/eth_lightwallet_subprovider.ts
index a1d93ac49..15cd713af 100644
--- a/packages/subproviders/src/subproviders/eth_lightwallet_subprovider.ts
+++ b/packages/subproviders/src/subproviders/eth_lightwallet_subprovider.ts
@@ -1,4 +1,4 @@
-import { EIP712TypedData } from '@0xproject/types';
+import { EIP712TypedData } from '@0x/types';
import * as lightwallet from 'eth-lightwallet';
import { PartialTxParams } from '../types';
diff --git a/packages/subproviders/src/subproviders/ledger.ts b/packages/subproviders/src/subproviders/ledger.ts
index ee8edde92..28e348f90 100644
--- a/packages/subproviders/src/subproviders/ledger.ts
+++ b/packages/subproviders/src/subproviders/ledger.ts
@@ -1,5 +1,5 @@
-import { assert } from '@0xproject/assert';
-import { addressUtils } from '@0xproject/utils';
+import { assert } from '@0x/assert';
+import { addressUtils } from '@0x/utils';
import EthereumTx = require('ethereumjs-tx');
import ethUtil = require('ethereumjs-util');
import HDNode = require('hdkey');
diff --git a/packages/subproviders/src/subproviders/metamask_subprovider.ts b/packages/subproviders/src/subproviders/metamask_subprovider.ts
index 46fc2a9cd..ba207d4cc 100644
--- a/packages/subproviders/src/subproviders/metamask_subprovider.ts
+++ b/packages/subproviders/src/subproviders/metamask_subprovider.ts
@@ -1,4 +1,4 @@
-import { marshaller, Web3Wrapper } from '@0xproject/web3-wrapper';
+import { marshaller, Web3Wrapper } from '@0x/web3-wrapper';
import { JSONRPCRequestPayload, Provider } from 'ethereum-types';
import * as ethUtil from 'ethereumjs-util';
diff --git a/packages/subproviders/src/subproviders/mnemonic_wallet.ts b/packages/subproviders/src/subproviders/mnemonic_wallet.ts
index 04a11c7be..140e3d515 100644
--- a/packages/subproviders/src/subproviders/mnemonic_wallet.ts
+++ b/packages/subproviders/src/subproviders/mnemonic_wallet.ts
@@ -1,6 +1,6 @@
-import { assert } from '@0xproject/assert';
-import { EIP712TypedData } from '@0xproject/types';
-import { addressUtils } from '@0xproject/utils';
+import { assert } from '@0x/assert';
+import { EIP712TypedData } from '@0x/types';
+import { addressUtils } from '@0x/utils';
import * as bip39 from 'bip39';
import HDNode = require('hdkey');
import * as _ from 'lodash';
diff --git a/packages/subproviders/src/subproviders/private_key_wallet.ts b/packages/subproviders/src/subproviders/private_key_wallet.ts
index e89c4c186..dca7e6810 100644
--- a/packages/subproviders/src/subproviders/private_key_wallet.ts
+++ b/packages/subproviders/src/subproviders/private_key_wallet.ts
@@ -1,6 +1,6 @@
-import { assert } from '@0xproject/assert';
-import { EIP712TypedData } from '@0xproject/types';
-import { signTypedDataUtils } from '@0xproject/utils';
+import { assert } from '@0x/assert';
+import { EIP712TypedData } from '@0x/types';
+import { signTypedDataUtils } from '@0x/utils';
import EthereumTx = require('ethereumjs-tx');
import * as ethUtil from 'ethereumjs-util';
import * as _ from 'lodash';
diff --git a/packages/subproviders/src/subproviders/redundant_subprovider.ts b/packages/subproviders/src/subproviders/redundant_subprovider.ts
index 59a2986f8..58312f203 100644
--- a/packages/subproviders/src/subproviders/redundant_subprovider.ts
+++ b/packages/subproviders/src/subproviders/redundant_subprovider.ts
@@ -1,4 +1,4 @@
-import { promisify } from '@0xproject/utils';
+import { promisify } from '@0x/utils';
import { JSONRPCRequestPayload } from 'ethereum-types';
import * as _ from 'lodash';
diff --git a/packages/subproviders/src/subproviders/rpc_subprovider.ts b/packages/subproviders/src/subproviders/rpc_subprovider.ts
index 18d6da307..437518e12 100644
--- a/packages/subproviders/src/subproviders/rpc_subprovider.ts
+++ b/packages/subproviders/src/subproviders/rpc_subprovider.ts
@@ -1,6 +1,6 @@
-import { assert } from '@0xproject/assert';
-import { StatusCodes } from '@0xproject/types';
-import { fetchAsync } from '@0xproject/utils';
+import { assert } from '@0x/assert';
+import { StatusCodes } from '@0x/types';
+import { fetchAsync } from '@0x/utils';
import { JSONRPCRequestPayload } from 'ethereum-types';
import JsonRpcError = require('json-rpc-error');
diff --git a/packages/subproviders/src/subproviders/signer.ts b/packages/subproviders/src/subproviders/signer.ts
index eda7db42e..9bd5cbdf1 100644
--- a/packages/subproviders/src/subproviders/signer.ts
+++ b/packages/subproviders/src/subproviders/signer.ts
@@ -1,4 +1,4 @@
-import { marshaller, Web3Wrapper } from '@0xproject/web3-wrapper';
+import { marshaller, Web3Wrapper } from '@0x/web3-wrapper';
import { JSONRPCRequestPayload, Provider } from 'ethereum-types';
import { Callback, ErrorCallback } from '../types';
diff --git a/packages/subproviders/src/subproviders/subprovider.ts b/packages/subproviders/src/subproviders/subprovider.ts
index dcf880c79..cd6780e0c 100644
--- a/packages/subproviders/src/subproviders/subprovider.ts
+++ b/packages/subproviders/src/subproviders/subprovider.ts
@@ -1,4 +1,4 @@
-import { promisify } from '@0xproject/utils';
+import { promisify } from '@0x/utils';
import { JSONRPCRequestPayload, JSONRPCResponsePayload, Provider } from 'ethereum-types';
import { Callback, ErrorCallback, JSONRPCRequestPayloadWithMethod } from '../types';
diff --git a/packages/subproviders/src/types.ts b/packages/subproviders/src/types.ts
index e8a47ad34..ed3aea176 100644
--- a/packages/subproviders/src/types.ts
+++ b/packages/subproviders/src/types.ts
@@ -1,4 +1,4 @@
-import { ECSignature } from '@0xproject/types';
+import { ECSignature } from '@0x/types';
import { JSONRPCRequestPayload } from 'ethereum-types';
import HDNode = require('hdkey');
diff --git a/packages/subproviders/test/integration/ledger_subprovider_test.ts b/packages/subproviders/test/integration/ledger_subprovider_test.ts
index 527ee5b22..b072e611b 100644
--- a/packages/subproviders/test/integration/ledger_subprovider_test.ts
+++ b/packages/subproviders/test/integration/ledger_subprovider_test.ts
@@ -1,5 +1,5 @@
-import { DoneCallback } from '@0xproject/types';
-import { promisify } from '@0xproject/utils';
+import { DoneCallback } from '@0x/types';
+import { promisify } from '@0x/utils';
import Eth from '@ledgerhq/hw-app-eth';
// HACK: This dependency is optional and tslint skips optional dependencies
// tslint:disable-next-line:no-implicit-dependencies
diff --git a/packages/subproviders/test/unit/nonce_tracker_subprovider_test.ts b/packages/subproviders/test/unit/nonce_tracker_subprovider_test.ts
index 05f213cf5..a5cef30dc 100644
--- a/packages/subproviders/test/unit/nonce_tracker_subprovider_test.ts
+++ b/packages/subproviders/test/unit/nonce_tracker_subprovider_test.ts
@@ -1,7 +1,7 @@
import * as chai from 'chai';
import FixtureSubprovider = require('web3-provider-engine/subproviders/fixture');
-import { promisify } from '@0xproject/utils';
+import { promisify } from '@0x/utils';
import EthereumTx = require('ethereumjs-tx');
import { NonceTrackerSubprovider, Web3ProviderEngine } from '../../src';
diff --git a/packages/subproviders/test/unit/redundant_rpc_subprovider_test.ts b/packages/subproviders/test/unit/redundant_rpc_subprovider_test.ts
index e30d2f74e..fb4e43f9e 100644
--- a/packages/subproviders/test/unit/redundant_rpc_subprovider_test.ts
+++ b/packages/subproviders/test/unit/redundant_rpc_subprovider_test.ts
@@ -1,4 +1,4 @@
-import { DoneCallback } from '@0xproject/types';
+import { DoneCallback } from '@0x/types';
import * as chai from 'chai';
import { JSONRPCResponsePayload } from 'ethereum-types';
import * as Sinon from 'sinon';
diff --git a/packages/subproviders/test/utils/report_callback_errors.ts b/packages/subproviders/test/utils/report_callback_errors.ts
index eaefea7c3..6eb7420c3 100644
--- a/packages/subproviders/test/utils/report_callback_errors.ts
+++ b/packages/subproviders/test/utils/report_callback_errors.ts
@@ -1,4 +1,4 @@
-import { DoneCallback } from '@0xproject/types';
+import { DoneCallback } from '@0x/types';
export const reportCallbackErrors = (done: DoneCallback) => {
return (f: (...args: any[]) => void) => {
diff --git a/packages/subproviders/tslint.json b/packages/subproviders/tslint.json
index ffaefe83a..dd9053357 100644
--- a/packages/subproviders/tslint.json
+++ b/packages/subproviders/tslint.json
@@ -1,3 +1,3 @@
{
- "extends": ["@0xproject/tslint-config"]
+ "extends": ["@0x/tslint-config"]
}
diff --git a/packages/testnet-faucets/README.md b/packages/testnet-faucets/README.md
index a92b93fc0..8b85e3517 100644
--- a/packages/testnet-faucets/README.md
+++ b/packages/testnet-faucets/README.md
@@ -1,4 +1,4 @@
-## @0xproject/testnet-faucets
+## @0x/testnet-faucets
This faucet dispenses 0.1 test ether to one recipient per second and 0.1 test ZRX every 5 seconds. It has a max queue size of 1000.
@@ -31,13 +31,13 @@ yarn install
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
```bash
-PKG=@0xproject/testnet-faucets yarn build
+PKG=@0x/testnet-faucets yarn build
```
Or continuously rebuild on change:
```bash
-PKG=@0xproject/testnet-faucets yarn watch
+PKG=@0x/testnet-faucets yarn watch
```
### Clean
diff --git a/packages/testnet-faucets/package.json b/packages/testnet-faucets/package.json
index a113889cc..c46f5465a 100644
--- a/packages/testnet-faucets/package.json
+++ b/packages/testnet-faucets/package.json
@@ -1,7 +1,7 @@
{
"private": true,
- "name": "@0xproject/testnet-faucets",
- "version": "1.0.51",
+ "name": "@0x/testnet-faucets",
+ "version": "1.0.53",
"engines": {
"node": ">=6.12"
},
@@ -12,19 +12,19 @@
"build:ci": "yarn build",
"dev": "node ../../node_modules/gulp/bin/gulp.js run",
"start": "node ./server/server.js",
- "lint": "tslint --project .",
+ "lint": "tslint --format stylish --project .",
"clean": "shx rm -rf server"
},
"author": "Fabio Berger",
"license": "Apache-2.0",
"dependencies": {
- "0x.js": "^1.0.8",
- "@0xproject/subproviders": "^2.0.7",
- "@0xproject/typescript-typings": "^3.0.2",
- "@0xproject/utils": "^2.0.2",
- "@0xproject/web3-wrapper": "^3.0.3",
+ "0x.js": "^2.0.1",
+ "@0x/subproviders": "^2.1.1",
+ "@0x/typescript-typings": "^3.0.4",
+ "@0x/utils": "^2.0.4",
+ "@0x/web3-wrapper": "^3.1.1",
"body-parser": "^1.17.1",
- "ethereum-types": "^1.0.11",
+ "ethereum-types": "^1.1.2",
"ethereumjs-tx": "^1.3.5",
"ethereumjs-util": "^5.1.1",
"express": "^4.15.2",
@@ -32,7 +32,7 @@
"rollbar": "^0.6.5"
},
"devDependencies": {
- "@0xproject/tslint-config": "^1.0.8",
+ "@0x/tslint-config": "^1.0.10",
"@types/body-parser": "^1.16.1",
"@types/express": "^4.0.35",
"@types/lodash": "4.14.104",
diff --git a/packages/testnet-faucets/src/ts/dispatch_queue.ts b/packages/testnet-faucets/src/ts/dispatch_queue.ts
index 0a13df7c9..3d0958fbf 100644
--- a/packages/testnet-faucets/src/ts/dispatch_queue.ts
+++ b/packages/testnet-faucets/src/ts/dispatch_queue.ts
@@ -1,4 +1,4 @@
-import { intervalUtils, logUtils } from '@0xproject/utils';
+import { intervalUtils, logUtils } from '@0x/utils';
import * as _ from 'lodash';
import { errorReporter } from './error_reporter';
diff --git a/packages/testnet-faucets/src/ts/dispense_asset_tasks.ts b/packages/testnet-faucets/src/ts/dispense_asset_tasks.ts
index fa63ab63e..32f5cb623 100644
--- a/packages/testnet-faucets/src/ts/dispense_asset_tasks.ts
+++ b/packages/testnet-faucets/src/ts/dispense_asset_tasks.ts
@@ -1,6 +1,6 @@
import { ERC20TokenWrapper } from '0x.js';
-import { BigNumber, logUtils } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { BigNumber, logUtils } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import * as _ from 'lodash';
import { configs } from './configs';
diff --git a/packages/testnet-faucets/src/ts/error_reporter.ts b/packages/testnet-faucets/src/ts/error_reporter.ts
index 49c37b6eb..d5358aed0 100644
--- a/packages/testnet-faucets/src/ts/error_reporter.ts
+++ b/packages/testnet-faucets/src/ts/error_reporter.ts
@@ -1,4 +1,4 @@
-import { logUtils } from '@0xproject/utils';
+import { logUtils } from '@0x/utils';
import * as express from 'express';
import rollbar = require('rollbar');
diff --git a/packages/testnet-faucets/src/ts/handler.ts b/packages/testnet-faucets/src/ts/handler.ts
index be42ebde8..2dfa3c3af 100644
--- a/packages/testnet-faucets/src/ts/handler.ts
+++ b/packages/testnet-faucets/src/ts/handler.ts
@@ -11,9 +11,9 @@ import {
SignedOrder,
Web3ProviderEngine,
} from '0x.js';
-import { NonceTrackerSubprovider, PrivateKeyWalletSubprovider } from '@0xproject/subproviders';
-import { logUtils } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { NonceTrackerSubprovider, PrivateKeyWalletSubprovider } from '@0x/subproviders';
+import { logUtils } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import * as express from 'express';
import * as _ from 'lodash';
@@ -65,7 +65,10 @@ export class Handler {
const web3Wrapper = new Web3Wrapper(providerObj);
// tslint:disable-next-line:custom-no-magic-numbers
const networkId = parseInt(networkIdString, 10);
- const contractWrappers = new ContractWrappers(providerObj, { networkId });
+ const contractWrappersConfig = {
+ networkId,
+ };
+ const contractWrappers = new ContractWrappers(providerObj, contractWrappersConfig);
const dispatchQueue = new DispatchQueue();
this._networkConfigByNetworkId[networkId] = {
dispatchQueue,
@@ -172,7 +175,7 @@ export class Handler {
makerAssetData,
takerAssetData,
salt: generatePseudoRandomSalt(),
- exchangeAddress: networkConfig.contractWrappers.exchange.getContractAddress(),
+ exchangeAddress: networkConfig.contractWrappers.exchange.address,
feeRecipientAddress: NULL_ADDRESS,
senderAddress: NULL_ADDRESS,
// tslint:disable-next-line:custom-no-magic-numbers
diff --git a/packages/testnet-faucets/src/ts/parameter_transformer.ts b/packages/testnet-faucets/src/ts/parameter_transformer.ts
index 7320b1d1c..bed8eb99e 100644
--- a/packages/testnet-faucets/src/ts/parameter_transformer.ts
+++ b/packages/testnet-faucets/src/ts/parameter_transformer.ts
@@ -1,4 +1,4 @@
-import { addressUtils } from '@0xproject/utils';
+import { addressUtils } from '@0x/utils';
import { NextFunction, Request, Response } from 'express';
import * as _ from 'lodash';
diff --git a/packages/testnet-faucets/tslint.json b/packages/testnet-faucets/tslint.json
index ffaefe83a..dd9053357 100644
--- a/packages/testnet-faucets/tslint.json
+++ b/packages/testnet-faucets/tslint.json
@@ -1,3 +1,3 @@
{
- "extends": ["@0xproject/tslint-config"]
+ "extends": ["@0x/tslint-config"]
}
diff --git a/packages/tslint-config/CHANGELOG.json b/packages/tslint-config/CHANGELOG.json
index 2a9b22922..9f504216c 100644
--- a/packages/tslint-config/CHANGELOG.json
+++ b/packages/tslint-config/CHANGELOG.json
@@ -1,5 +1,23 @@
[
{
+ "version": "1.0.10",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ],
+ "timestamp": 1541740904
+ },
+ {
+ "timestamp": 1539871071,
+ "version": "1.0.9",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
"timestamp": 1538693146,
"version": "1.0.8",
"changes": [
diff --git a/packages/tslint-config/CHANGELOG.md b/packages/tslint-config/CHANGELOG.md
index 0486cb523..f5cacb5d1 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
+## v1.0.10 - _November 9, 2018_
+
+ * Dependencies updated
+
+## v1.0.9 - _October 18, 2018_
+
+ * Dependencies updated
+
## v1.0.8 - _October 4, 2018_
* Dependencies updated
@@ -17,7 +25,7 @@ CHANGELOG
* Dependencies updated
-## v1.0.5 - _August 13, 2018_
+## v1.0.5 - _August 14, 2018_
* Dependencies updated
diff --git a/packages/tslint-config/README.md b/packages/tslint-config/README.md
index d630ec84d..5614e5e54 100644
--- a/packages/tslint-config/README.md
+++ b/packages/tslint-config/README.md
@@ -1,11 +1,11 @@
-## @0xproject/tslint-config
+## @0x/tslint-config
TSLint configuration and custom linter rules used by 0xProject.
## Installation
```bash
-yarn add --dev @0xproject/tslint-config
+yarn add --dev @0x/tslint-config
```
## Usage
@@ -14,7 +14,7 @@ Add the following to your `tslint.json` file
```json
{
- "extends": ["@0xproject/tslint-config"]
+ "extends": ["@0x/tslint-config"]
}
```
@@ -43,13 +43,13 @@ yarn install
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
```bash
-PKG=@0xproject/tslint-config yarn build
+PKG=@0x/tslint-config yarn build
```
Or continuously rebuild on change:
```bash
-PKG=@0xproject/tslint-config yarn watch
+PKG=@0x/tslint-config yarn watch
```
### Clean
diff --git a/packages/tslint-config/package.json b/packages/tslint-config/package.json
index 0c85c98ab..2914f31e2 100644
--- a/packages/tslint-config/package.json
+++ b/packages/tslint-config/package.json
@@ -1,6 +1,6 @@
{
- "name": "@0xproject/tslint-config",
- "version": "1.0.8",
+ "name": "@0x/tslint-config",
+ "version": "1.0.10",
"engines": {
"node": ">=6.12"
},
@@ -10,7 +10,7 @@
"build": "tsc -b",
"build:ci": "yarn build",
"clean": "shx rm -rf lib",
- "lint": "tslint --project ."
+ "lint": "tslint --format stylish --project ."
},
"repository": {
"type": "git",
@@ -34,7 +34,6 @@
"homepage": "https://github.com/0xProject/0x-monorepo/packages/tslint-config/README.md",
"devDependencies": {
"@types/lodash": "4.14.104",
- "copyfiles": "^2.0.0",
"make-promises-safe": "^1.1.0",
"shx": "^0.2.2",
"typescript": "3.0.1"
diff --git a/packages/types/CHANGELOG.json b/packages/types/CHANGELOG.json
index 53e1f3716..6d9f83c57 100644
--- a/packages/types/CHANGELOG.json
+++ b/packages/types/CHANGELOG.json
@@ -1,5 +1,14 @@
[
{
+ "version": "1.2.1",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ],
+ "timestamp": 1541740904
+ },
+ {
"version": "1.2.0",
"changes": [
{
@@ -9,8 +18,13 @@
{
"note": "Added `ZeroExTransaction` type for Exchange executeTransaction",
"pr": 1102
+ },
+ {
+ "note": "Add `AssetData` union type (`type AssetData = ERC20AssetData | ERC721AssetData`)",
+ "pr": 1131
}
- ]
+ ],
+ "timestamp": 1539871071
},
{
"timestamp": 1538693146,
diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md
index aeb056903..556bf1799 100644
--- a/packages/types/CHANGELOG.md
+++ b/packages/types/CHANGELOG.md
@@ -5,6 +5,16 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
+## v1.2.1 - _November 9, 2018_
+
+ * Dependencies updated
+
+## v1.2.0 - _October 18, 2018_
+
+ * Added `EIP712Parameter` `EIP712Types` `EIP712TypedData` for EIP712 signing (#1102)
+ * Added `ZeroExTransaction` type for Exchange executeTransaction (#1102)
+ * Add `AssetData` union type (`type AssetData = ERC20AssetData | ERC721AssetData`) (#1131)
+
## v1.1.4 - _October 4, 2018_
* Dependencies updated
@@ -44,7 +54,7 @@ CHANGELOG
* Add revert reasons for ERC721Token (#933)
-## v1.0.1-rc.4 - _August 13, 2018_
+## v1.0.1-rc.4 - _August 14, 2018_
* Added SignerType to handle different signing prefix scenarios (#914)
diff --git a/packages/types/README.md b/packages/types/README.md
index c091b8302..136eb1940 100644
--- a/packages/types/README.md
+++ b/packages/types/README.md
@@ -1,25 +1,25 @@
-## @0xproject/types
+## @0x/types
Typescript types shared across 0x projects and packages
## Installation
```bash
-yarn add -D @0xproject/types
+yarn add -D @0x/types
```
If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`:
```json
"compilerOptions": {
- "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"],
+ "typeRoots": ["node_modules/@0x/typescript-typings/types", "node_modules/@types"],
}
```
## Usage
```javascript
-import { TransactionReceipt, TxData, TxDataPayable } from '@0xproject/types';
+import { TransactionReceipt, TxData, TxDataPayable } from '@0x/types';
```
## Contributing
@@ -47,13 +47,13 @@ yarn install
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
```bash
-PKG=@0xproject/types yarn build
+PKG=@0x/types yarn build
```
Or continuously rebuild on change:
```bash
-PKG=@0xproject/types yarn watch
+PKG=@0x/types yarn watch
```
### Clean
diff --git a/packages/types/package.json b/packages/types/package.json
index 9710ff8eb..c32e9a6f7 100644
--- a/packages/types/package.json
+++ b/packages/types/package.json
@@ -1,6 +1,6 @@
{
- "name": "@0xproject/types",
- "version": "1.1.4",
+ "name": "@0x/types",
+ "version": "1.2.1",
"engines": {
"node": ">=6.12"
},
@@ -11,7 +11,7 @@
"build": "tsc -b",
"build:ci": "yarn build",
"clean": "shx rm -rf lib",
- "lint": "tslint --project ."
+ "lint": "tslint --format stylish --project ."
},
"license": "Apache-2.0",
"repository": {
@@ -23,8 +23,7 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/types/README.md",
"devDependencies": {
- "@0xproject/tslint-config": "^1.0.8",
- "copyfiles": "^2.0.0",
+ "@0x/tslint-config": "^1.0.10",
"make-promises-safe": "^1.1.0",
"shx": "^0.2.2",
"tslint": "5.11.0",
@@ -33,7 +32,7 @@
"dependencies": {
"@types/node": "*",
"bignumber.js": "~4.1.0",
- "ethereum-types": "^1.0.11"
+ "ethereum-types": "^1.1.2"
},
"publishConfig": {
"access": "public"
diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts
index 6bc966ba1..3c9b6bbc5 100644
--- a/packages/types/src/index.ts
+++ b/packages/types/src/index.ts
@@ -168,6 +168,8 @@ export interface ERC721AssetData {
tokenId: BigNumber;
}
+export type AssetData = ERC20AssetData | ERC721AssetData;
+
// TODO: DRY. These should be extracted from contract code.
export enum RevertReason {
OrderUnfillable = 'ORDER_UNFILLABLE',
@@ -620,3 +622,7 @@ export interface EIP712TypedData {
message: EIP712Object;
primaryType: string;
}
+
+export interface Stats {
+ orderCount: number;
+}
diff --git a/packages/types/tslint.json b/packages/types/tslint.json
index ffaefe83a..dd9053357 100644
--- a/packages/types/tslint.json
+++ b/packages/types/tslint.json
@@ -1,3 +1,3 @@
{
- "extends": ["@0xproject/tslint-config"]
+ "extends": ["@0x/tslint-config"]
}
diff --git a/packages/typescript-typings/CHANGELOG.json b/packages/typescript-typings/CHANGELOG.json
index 4a85fd592..5653b397d 100644
--- a/packages/typescript-typings/CHANGELOG.json
+++ b/packages/typescript-typings/CHANGELOG.json
@@ -1,5 +1,23 @@
[
{
+ "version": "3.0.4",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ],
+ "timestamp": 1541740904
+ },
+ {
+ "timestamp": 1539871071,
+ "version": "3.0.3",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
"timestamp": 1538693146,
"version": "3.0.2",
"changes": [
diff --git a/packages/typescript-typings/CHANGELOG.md b/packages/typescript-typings/CHANGELOG.md
index 71ab1113b..62e6665be 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.4 - _November 9, 2018_
+
+ * Dependencies updated
+
+## v3.0.3 - _October 18, 2018_
+
+ * Dependencies updated
+
## v3.0.2 - _October 4, 2018_
* Dependencies updated
@@ -33,7 +41,7 @@ CHANGELOG
* Dependencies updated
-## v1.0.4 - _August 13, 2018_
+## v1.0.4 - _August 14, 2018_
* Dependencies updated
diff --git a/packages/typescript-typings/README.md b/packages/typescript-typings/README.md
index 439cb6484..e3b4c044f 100644
--- a/packages/typescript-typings/README.md
+++ b/packages/typescript-typings/README.md
@@ -1,11 +1,11 @@
-## @0xproject/typescript-typings
+## @0x/typescript-typings
Type repository for external packages used by 0x. This is like our small version of [DefinitelyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped)
## Installation
```bash
-yarn add -D @0xproject/typescript-typings
+yarn add -D @0x/typescript-typings
```
## Usage
@@ -13,7 +13,7 @@ yarn add -D @0xproject/typescript-typings
Add the following line within an `compilerOptions` section of your `tsconfig.json`
```json
-"typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"]
+"typeRoots": ["node_modules/@0x/typescript-typings/types", "node_modules/@types"]
```
This will allow the TS compiler to first look into that repo and then fallback to DT types.
@@ -43,13 +43,13 @@ yarn install
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
```bash
-PKG=@0xproject/typescript-typings yarn build
+PKG=@0x/typescript-typings yarn build
```
Or continuously rebuild on change:
```bash
-PKG=@0xproject/typescript-typings yarn watch
+PKG=@0x/typescript-typings yarn watch
```
### Clean
diff --git a/packages/typescript-typings/package.json b/packages/typescript-typings/package.json
index 2491362ef..9dbbe1370 100644
--- a/packages/typescript-typings/package.json
+++ b/packages/typescript-typings/package.json
@@ -1,6 +1,6 @@
{
- "name": "@0xproject/typescript-typings",
- "version": "3.0.2",
+ "name": "@0x/typescript-typings",
+ "version": "3.0.4",
"engines": {
"node": ">=6.12"
},
@@ -27,11 +27,10 @@
"@types/bn.js": "^4.11.0",
"@types/react": "*",
"bignumber.js": "~4.1.0",
- "ethereum-types": "^1.0.11",
+ "ethereum-types": "^1.1.2",
"popper.js": "1.14.3"
},
"devDependencies": {
- "copyfiles": "^2.0.0",
"shx": "^0.2.2",
"typescript": "3.0.1"
},
diff --git a/packages/utils/CHANGELOG.json b/packages/utils/CHANGELOG.json
index 237ebeecc..6c9da5f37 100644
--- a/packages/utils/CHANGELOG.json
+++ b/packages/utils/CHANGELOG.json
@@ -1,5 +1,23 @@
[
{
+ "version": "2.0.4",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ],
+ "timestamp": 1541740904
+ },
+ {
+ "timestamp": 1539871071,
+ "version": "2.0.3",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
"timestamp": 1538693146,
"version": "2.0.2",
"changes": [
diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md
index fa731ecf0..4fdd13d9c 100644
--- a/packages/utils/CHANGELOG.md
+++ b/packages/utils/CHANGELOG.md
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
+## v2.0.4 - _November 9, 2018_
+
+ * Dependencies updated
+
+## v2.0.3 - _October 18, 2018_
+
+ * Dependencies updated
+
## v2.0.2 - _October 4, 2018_
* Dependencies updated
@@ -41,7 +49,7 @@ CHANGELOG
* Dependencies updated
-## v1.0.5 - _August 13, 2018_
+## v1.0.5 - _August 14, 2018_
* Increased BigNumber decimal precision from 20 to 78 (#807)
* Store different ABIs for events with same function signature and different amount of indexed arguments (#933)
diff --git a/packages/utils/README.md b/packages/utils/README.md
index c9a2f5846..0b15f00c5 100644
--- a/packages/utils/README.md
+++ b/packages/utils/README.md
@@ -1,25 +1,25 @@
-## @0xproject/utils
+## @0x/utils
Utils to be shared across 0x projects and packages
## Installation
```bash
-yarn add @0xproject/utils
+yarn add @0x/utils
```
If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`:
```json
"compilerOptions": {
- "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"],
+ "typeRoots": ["node_modules/@0x/typescript-typings/types", "node_modules/@types"],
}
```
## Usage
```javascript
-import { addressUtils, bigNumberConfigs, classUtils, intervalUtils, promisify } from '@0xproject/utils';
+import { addressUtils, bigNumberConfigs, classUtils, intervalUtils, promisify } from '@0x/utils';
```
## Troubleshooting
@@ -62,13 +62,13 @@ yarn install
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
```bash
-PKG=@0xproject/utils yarn build
+PKG=@0x/utils yarn build
```
Or continuously rebuild on change:
```bash
-PKG=@0xproject/utils yarn watch
+PKG=@0x/utils yarn watch
```
### Clean
diff --git a/packages/utils/package.json b/packages/utils/package.json
index 20b0f0c86..24c2496b0 100644
--- a/packages/utils/package.json
+++ b/packages/utils/package.json
@@ -1,6 +1,6 @@
{
- "name": "@0xproject/utils",
- "version": "2.0.2",
+ "name": "@0x/utils",
+ "version": "2.0.4",
"engines": {
"node": ">=6.12"
},
@@ -11,7 +11,7 @@
"build": "tsc -b",
"build:ci": "yarn build",
"clean": "shx rm -rf lib",
- "lint": "tslint --project .",
+ "lint": "tslint --format stylish --project .",
"test": "yarn run_mocha",
"test:circleci": "yarn test:coverage",
"run_mocha": "mocha --require source-map-support/register --require make-promises-safe lib/test/**/*_test.js --bail --exit",
@@ -28,12 +28,11 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/utils/README.md",
"devDependencies": {
- "@0xproject/tslint-config": "^1.0.8",
+ "@0x/tslint-config": "^1.0.10",
"@types/detect-node": "2.0.0",
"@types/lodash": "4.14.104",
"@types/mocha": "^2.2.42",
"chai": "^4.0.1",
- "copyfiles": "^2.0.0",
"make-promises-safe": "^1.1.0",
"mocha": "^4.1.0",
"npm-run-all": "^4.1.2",
@@ -42,13 +41,13 @@
"typescript": "3.0.1"
},
"dependencies": {
- "@0xproject/types": "^1.1.4",
- "@0xproject/typescript-typings": "^3.0.2",
+ "@0x/types": "^1.2.1",
+ "@0x/typescript-typings": "^3.0.4",
"@types/node": "*",
"abortcontroller-polyfill": "^1.1.9",
"bignumber.js": "~4.1.0",
"detect-node": "2.0.3",
- "ethereum-types": "^1.0.11",
+ "ethereum-types": "^1.1.2",
"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 ac3e54efb..2da46db35 100644
--- a/packages/utils/src/abi_decoder.ts
+++ b/packages/utils/src/abi_decoder.ts
@@ -9,7 +9,7 @@ import {
RawLog,
SolidityTypes,
} from 'ethereum-types';
-import { ethers } from 'ethers';
+import * as ethers from 'ethers';
import * as _ from 'lodash';
import { addressUtils } from './address_utils';
@@ -99,11 +99,13 @@ export class AbiDecoder {
const ethersInterface = new ethers.utils.Interface(abiArray);
_.map(abiArray, (abi: AbiDefinition) => {
if (abi.type === AbiType.Event) {
- const topic = ethersInterface.events[abi.name].topic;
- const numIndexedArgs = _.reduce(abi.inputs, (sum, input) => (input.indexed ? sum + 1 : sum), 0);
+ // tslint:disable-next-line:no-unnecessary-type-assertion
+ const eventAbi = abi as EventAbi;
+ const topic = ethersInterface.events[eventAbi.name].topic;
+ const numIndexedArgs = _.reduce(eventAbi.inputs, (sum, input) => (input.indexed ? sum + 1 : sum), 0);
this._methodIds[topic] = {
...this._methodIds[topic],
- [numIndexedArgs]: abi,
+ [numIndexedArgs]: eventAbi,
};
}
});
diff --git a/packages/utils/src/configured_bignumber.ts b/packages/utils/src/configured_bignumber.ts
index 2b22b6938..34b57d303 100644
--- a/packages/utils/src/configured_bignumber.ts
+++ b/packages/utils/src/configured_bignumber.ts
@@ -11,4 +11,27 @@ BigNumber.config({
DECIMAL_PLACES: 78,
});
+// Set a debug print function for NodeJS
+// Upstream issue: https://github.com/MikeMcl/bignumber.js/issues/188
+import isNode = require('detect-node');
+if (isNode) {
+ // Dynamically load a NodeJS specific module.
+ // Typescript requires all imports to be global, so we need to use
+ // `const` here and disable the tslint warning.
+ // tslint:disable-next-line: no-var-requires
+ const util = require('util');
+
+ // Set a custom util.inspect function
+ // HACK: We add a function to the BigNumber class by assigning to the
+ // prototype. The function name is a symbol provided by Node.
+ (BigNumber.prototype as any)[util.inspect.custom] = function(): string {
+ // HACK: When executed, `this` will refer to the BigNumber instance.
+ // This is also why we need a function expression instead of an
+ // arrow function, as the latter does not have a `this`.
+ // Return the readable string representation
+ // tslint:disable-next-line: no-invalid-this
+ return this.toString();
+ };
+}
+
export { BigNumber };
diff --git a/packages/utils/src/sign_typed_data_utils.ts b/packages/utils/src/sign_typed_data_utils.ts
index cd5bcb42f..6963b9084 100644
--- a/packages/utils/src/sign_typed_data_utils.ts
+++ b/packages/utils/src/sign_typed_data_utils.ts
@@ -2,7 +2,7 @@ import * as ethUtil from 'ethereumjs-util';
import * as ethers from 'ethers';
import * as _ from 'lodash';
-import { EIP712Object, EIP712ObjectValue, EIP712TypedData, EIP712Types } from '@0xproject/types';
+import { EIP712Object, EIP712ObjectValue, EIP712TypedData, EIP712Types } from '@0x/types';
export const signTypedDataUtils = {
/**
diff --git a/packages/utils/tslint.json b/packages/utils/tslint.json
index ffaefe83a..dd9053357 100644
--- a/packages/utils/tslint.json
+++ b/packages/utils/tslint.json
@@ -1,3 +1,3 @@
{
- "extends": ["@0xproject/tslint-config"]
+ "extends": ["@0x/tslint-config"]
}
diff --git a/packages/web3-wrapper/CHANGELOG.json b/packages/web3-wrapper/CHANGELOG.json
index be5c1fef6..7b21da73a 100644
--- a/packages/web3-wrapper/CHANGELOG.json
+++ b/packages/web3-wrapper/CHANGELOG.json
@@ -1,5 +1,16 @@
[
{
+ "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).",
+ "pr": 1177
+ }
+ ],
+ "timestamp": 1541740904
+ },
+ {
"version": "3.1.0",
"changes": [
{
@@ -11,7 +22,8 @@
"Web3Wrapper now throws when an RPC request contains an error field in the response. Previously errors could be swallowed and undefined returned.",
"pr": 1102
}
- ]
+ ],
+ "timestamp": 1539871071
},
{
"version": "3.0.3",
diff --git a/packages/web3-wrapper/CHANGELOG.md b/packages/web3-wrapper/CHANGELOG.md
index 8f1dc0f3f..ebbef2c48 100644
--- a/packages/web3-wrapper/CHANGELOG.md
+++ b/packages/web3-wrapper/CHANGELOG.md
@@ -5,6 +5,15 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
+## v3.1.1 - _November 9, 2018_
+
+ * Fix bug in `getTransactionByHashAsync` which was causing the return value to have the wrong type (raw fields instead of unmarshalled fields). (#1177)
+
+## v3.1.0 - _October 18, 2018_
+
+ * Add `signTypedData` to perform EIP712 `eth_signTypedData`. (#1102)
+ * Web3Wrapper now throws when an RPC request contains an error field in the response. Previously errors could be swallowed and undefined returned. (#1102)
+
## v3.0.3 - _October 4, 2018_
* Dependencies updated
@@ -40,7 +49,7 @@ CHANGELOG
* Stop exporting types: `CallTxDataBaseRPC` and `AbstractBlockRPC` (#924)
* Export `AbiDecoder` class (#924)
-## v1.2.0 - _August 13, 2018_
+## v1.2.0 - _August 14, 2018_
* Export marshaller to convert between RPC and user-space data formats (#938)
* Export RPC types (#938)
@@ -80,7 +89,7 @@ CHANGELOG
* Dependencies updated
-## v0.7.0 - _June 3, 2018_
+## v0.7.0 - _June 4, 2018_
* Add `web3Wrapper.getContractCodeAsync` (#675)
* Add `web3Wrapper.getTransactionTraceAsync` (#675)
diff --git a/packages/web3-wrapper/README.md b/packages/web3-wrapper/README.md
index 06c788101..4402de19c 100644
--- a/packages/web3-wrapper/README.md
+++ b/packages/web3-wrapper/README.md
@@ -1,4 +1,4 @@
-## @0xproject/web3-wrapper
+## @0x/web3-wrapper
Web3-wrapper is a JSON-RPC client for Ethereum nodes. It is a type-safe alternative to [Web3.js](https://github.com/ethereum/web3.js/) written in TypeScript.
@@ -7,14 +7,14 @@ Web3-wrapper is a JSON-RPC client for Ethereum nodes. It is a type-safe alternat
## Installation
```bash
-yarn add @0xproject/web3-wrapper
+yarn add @0x/web3-wrapper
```
If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`:
```json
"compilerOptions": {
- "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"],
+ "typeRoots": ["node_modules/@0x/typescript-typings/types", "node_modules/@types"],
}
```
@@ -43,13 +43,13 @@ yarn install
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
```bash
-PKG=@0xproject/web3-wrapper yarn build
+PKG=@0x/web3-wrapper yarn build
```
Or continuously rebuild on change:
```bash
-PKG=@0xproject/web3-wrapper yarn watch
+PKG=@0x/web3-wrapper yarn watch
```
### Clean
diff --git a/packages/web3-wrapper/package.json b/packages/web3-wrapper/package.json
index a3f82c87e..2b87cc92a 100644
--- a/packages/web3-wrapper/package.json
+++ b/packages/web3-wrapper/package.json
@@ -1,6 +1,6 @@
{
- "name": "@0xproject/web3-wrapper",
- "version": "3.0.3",
+ "name": "@0x/web3-wrapper",
+ "version": "3.1.1",
"engines": {
"node": ">=6.12"
},
@@ -11,7 +11,7 @@
"build": "tsc -b",
"build:ci": "yarn build",
"clean": "shx rm -rf lib generated_docs",
- "lint": "tslint --project .",
+ "lint": "tslint --format stylish --project .",
"test": "yarn run_mocha",
"rebuild_and_test": "run-s clean build test",
"test:circleci": "yarn test:coverage",
@@ -35,13 +35,12 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/web3-wrapper/README.md",
"devDependencies": {
- "@0xproject/tslint-config": "^1.0.8",
+ "@0x/tslint-config": "^1.0.10",
"@types/ganache-core": "^2.1.0",
"@types/lodash": "4.14.104",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
"chai-bignumber": "^2.0.1",
- "copyfiles": "^2.0.0",
"dirty-chai": "^2.0.1",
"ganache-core": "0xProject/ganache-core#monorepo-dep",
"make-promises-safe": "^1.1.0",
@@ -50,15 +49,15 @@
"nyc": "^11.0.1",
"shx": "^0.2.2",
"tslint": "5.11.0",
- "typedoc": "0.12.0",
+ "typedoc": "0.13.0",
"typescript": "3.0.1"
},
"dependencies": {
- "@0xproject/assert": "^1.0.13",
- "@0xproject/json-schemas": "^1.0.7",
- "@0xproject/typescript-typings": "^3.0.2",
- "@0xproject/utils": "^2.0.2",
- "ethereum-types": "^1.0.11",
+ "@0x/assert": "^1.0.15",
+ "@0x/json-schemas": "^2.0.1",
+ "@0x/typescript-typings": "^3.0.4",
+ "@0x/utils": "^2.0.4",
+ "ethereum-types": "^1.1.2",
"ethereumjs-util": "^5.1.1",
"ethers": "~4.0.4",
"lodash": "^4.17.5"
diff --git a/packages/web3-wrapper/src/index.ts b/packages/web3-wrapper/src/index.ts
index 9bef06fd4..679563a2b 100644
--- a/packages/web3-wrapper/src/index.ts
+++ b/packages/web3-wrapper/src/index.ts
@@ -1,7 +1,7 @@
export { Web3Wrapper } from './web3_wrapper';
export { marshaller } from './marshaller';
-export { AbiDecoder } from '@0xproject/utils';
+export { AbiDecoder } from '@0x/utils';
export {
BlockParam,
diff --git a/packages/web3-wrapper/src/marshaller.ts b/packages/web3-wrapper/src/marshaller.ts
index 572a322d6..299c6a64c 100644
--- a/packages/web3-wrapper/src/marshaller.ts
+++ b/packages/web3-wrapper/src/marshaller.ts
@@ -1,4 +1,4 @@
-import { addressUtils } from '@0xproject/utils';
+import { addressUtils } from '@0x/utils';
import {
BlockParam,
BlockParamLiteral,
diff --git a/packages/web3-wrapper/src/utils.ts b/packages/web3-wrapper/src/utils.ts
index 0b568aac5..c68587632 100644
--- a/packages/web3-wrapper/src/utils.ts
+++ b/packages/web3-wrapper/src/utils.ts
@@ -1,4 +1,4 @@
-import { BigNumber } from '@0xproject/utils';
+import { BigNumber } from '@0x/utils';
import * as _ from 'lodash';
export const utils = {
diff --git a/packages/web3-wrapper/src/web3_wrapper.ts b/packages/web3-wrapper/src/web3_wrapper.ts
index 726246f1a..23204e616 100644
--- a/packages/web3-wrapper/src/web3_wrapper.ts
+++ b/packages/web3-wrapper/src/web3_wrapper.ts
@@ -1,6 +1,6 @@
-import { assert } from '@0xproject/assert';
-import { schemas } from '@0xproject/json-schemas';
-import { AbiDecoder, addressUtils, BigNumber, intervalUtils, promisify } from '@0xproject/utils';
+import { assert } from '@0x/assert';
+import { schemas } from '@0x/json-schemas';
+import { AbiDecoder, addressUtils, BigNumber, intervalUtils, promisify } from '@0x/utils';
import {
BlockParam,
BlockParamLiteral,
@@ -23,7 +23,13 @@ import {
import * as _ from 'lodash';
import { marshaller } from './marshaller';
-import { BlockWithoutTransactionDataRPC, BlockWithTransactionDataRPC, NodeType, Web3WrapperErrors } from './types';
+import {
+ BlockWithoutTransactionDataRPC,
+ BlockWithTransactionDataRPC,
+ NodeType,
+ TransactionRPC,
+ Web3WrapperErrors,
+} from './types';
import { utils } from './utils';
const BASE_TEN = 10;
@@ -145,7 +151,7 @@ export class Web3Wrapper {
if (_.isUndefined((provider as any).sendAsync)) {
// Web3@1.0 provider doesn't support synchronous http requests,
// so it only has an async `send` method, instead of a `send` and `sendAsync` in web3@0.x.x`
- // We re-assign the send method so that Web3@1.0 providers work with @0xproject/web3-wrapper
+ // We re-assign the send method so that Web3@1.0 providers work with @0x/web3-wrapper
(provider as any).sendAsync = (provider as any).send;
}
this.abiDecoder = new AbiDecoder([]);
@@ -228,10 +234,11 @@ export class Web3Wrapper {
*/
public async getTransactionByHashAsync(txHash: string): Promise<Transaction> {
assert.isHexString('txHash', txHash);
- const transaction = await this.sendRawPayloadAsync<Transaction>({
+ const transactionRpc = await this.sendRawPayloadAsync<TransactionRPC>({
method: 'eth_getTransactionByHash',
params: [txHash],
});
+ const transaction = marshaller.unmarshalTransaction(transactionRpc);
return transaction;
}
/**
@@ -526,9 +533,6 @@ export class Web3Wrapper {
method: 'eth_call',
params: [callDataHex, marshalledDefaultBlock],
});
- if (rawCallResult === '0x') {
- throw new Error('Contract call failed (returned null)');
- }
return rawCallResult;
}
/**
diff --git a/packages/web3-wrapper/tslint.json b/packages/web3-wrapper/tslint.json
index ffaefe83a..dd9053357 100644
--- a/packages/web3-wrapper/tslint.json
+++ b/packages/web3-wrapper/tslint.json
@@ -1,3 +1,3 @@
{
- "extends": ["@0xproject/tslint-config"]
+ "extends": ["@0x/tslint-config"]
}
diff --git a/packages/website/README.md b/packages/website/README.md
index 2edc17cd9..d82d045a6 100644
--- a/packages/website/README.md
+++ b/packages/website/README.md
@@ -33,13 +33,13 @@ yarn install
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
```bash
-PKG=@0xproject/website yarn build
+PKG=@0x/website yarn build
```
### Run dev server
```bash
-PKG=@0xproject/website yarn watch
+PKG=@0x/website yarn watch
```
Visit [0xproject.localhost:3572](http://0xproject.localhost:3572) in your browser.
diff --git a/packages/website/less/all.less b/packages/website/less/all.less
index c62db0d20..3747e4860 100644
--- a/packages/website/less/all.less
+++ b/packages/website/less/all.less
@@ -34,17 +34,7 @@ a {
}
}
-#documentation {
- p {
- line-height: 1.5;
- }
-
- .comment {
- p {
- margin: 0px;
- }
- }
-
+#scroll_container {
.typeTooltip {
border: 1px solid lightgray;
opacity: 1;
@@ -83,6 +73,7 @@ a {
code {
border: 1px solid #e3eefe;
+ border-radius: 4px;
font-family: 'Roboto Mono';
background-color: #f2f6ff !important; // lightBlue
}
diff --git a/packages/website/md/docs/asset_buyer/installation.md b/packages/website/md/docs/asset_buyer/installation.md
new file mode 100644
index 000000000..3c0c95068
--- /dev/null
+++ b/packages/website/md/docs/asset_buyer/installation.md
@@ -0,0 +1,17 @@
+#### Install
+
+```bash
+yarn add @0x/asset-buyer
+```
+
+#### Import
+
+```javascript
+import { AssetBuyer } from '@0x/asset-buyer';
+```
+
+or
+
+```javascript
+var AssetBuyer = require('@0x/asset-buyer').AssetBuyer;
+```
diff --git a/packages/website/md/docs/asset_buyer/introduction.md b/packages/website/md/docs/asset_buyer/introduction.md
new file mode 100644
index 000000000..a59539ac6
--- /dev/null
+++ b/packages/website/md/docs/asset_buyer/introduction.md
@@ -0,0 +1 @@
+Welcome to the [asset-buyer](https://github.com/0xProject/0x-monorepo/tree/development/packages/asset-buyer) documentation! AssetBuyer is a library that provides an easy way to buy any asset with ETH in one click, leveraging 0x liquidity and the [Forwarder contract](https://0xproject.com/docs/contracts#Forwarder).
diff --git a/packages/website/md/docs/asset_buyer/usage.md b/packages/website/md/docs/asset_buyer/usage.md
new file mode 100644
index 000000000..209c15062
--- /dev/null
+++ b/packages/website/md/docs/asset_buyer/usage.md
@@ -0,0 +1,39 @@
+#### Construction
+
+Connecting to a standard relayer API compliant url:
+
+```typescript
+const provider = web3.currentProvider;
+const apiUrl = 'https://api.relayer.com/v2';
+const assetBuyer = AssetBuyer.getAssetBuyerForStandardRelayerAPIUrl(provider, apiUrl);
+```
+
+Providing your own orders:
+
+```typescript
+const provider = web3.currentProvider;
+const orders = []; // get these from your own API, a relayer, a friend, from anywhere
+const assetBuyer = AssetBuyer.getAssetBuyerForProvidedOrders(provider, orders);
+```
+
+#### Get a quote
+
+A [BuyQuote](#types-BuyQuote) object contains enough information to display buy information to an end user
+
+```typescript
+const erc20TokenAddress = '0x5fa3c....';
+const amountToBuy = new BigNumber(50000000000000000000);
+const buyQuote = await assetBuyer.getBuyQuoteForERC20TokenAddressAsync(erc20TokenAddress, amountToBuy);
+const quoteInfo = buyQuote.worstCaseQuoteInfo;
+console.log(quoteInfo.ethAmount); // the total amount the user needs to pay to buy the desired amount (including ZRX fees)
+console.log(quoteInfo.feeAmount); // a portion of the total ethAmount above that was used to buy affiliate fees
+console.log(quoteInfo.ethPerAssetPrice); // the rate that this quote provides (e.g. 0.0035ETH / REP)
+```
+
+#### Perform a buy
+
+Pass the [BuyQuote](#types-BuyQuote) object from above back to the assetBuyer in order to initiate the buy transaction
+
+```typescript
+const txHash = await assetBuyer.executeBuyQuoteAsync(buyQuote); // the hash of the transaction submitted to the Ethereum network
+```
diff --git a/packages/website/md/docs/connect/1.0.0/installation.md b/packages/website/md/docs/connect/1/installation.md
index 950bf92ca..950bf92ca 100644
--- a/packages/website/md/docs/connect/1.0.0/installation.md
+++ b/packages/website/md/docs/connect/1/installation.md
diff --git a/packages/website/md/docs/connect/1.0.0/introduction.md b/packages/website/md/docs/connect/1/introduction.md
index 4e3039442..4e3039442 100644
--- a/packages/website/md/docs/connect/1.0.0/introduction.md
+++ b/packages/website/md/docs/connect/1/introduction.md
diff --git a/packages/website/md/docs/connect/2.0.0/introduction.md b/packages/website/md/docs/connect/2/introduction.md
index 8e251b327..8e251b327 100644
--- a/packages/website/md/docs/connect/2.0.0/introduction.md
+++ b/packages/website/md/docs/connect/2/introduction.md
diff --git a/packages/website/md/docs/connect/3/installation.md b/packages/website/md/docs/connect/3/installation.md
new file mode 100644
index 000000000..6797d9633
--- /dev/null
+++ b/packages/website/md/docs/connect/3/installation.md
@@ -0,0 +1,15 @@
+**Install**
+
+```bash
+npm install @0x/connect --save
+```
+
+**Import**
+
+```javascript
+import { HttpClient } from '@0x/connect';
+```
+
+### Wiki
+
+Check out our [0x Connect introduction tutorial](https://0xproject.com/wiki#Intro-Tutorial) for information on how to integrate relayers into your application.
diff --git a/packages/website/md/docs/contract_wrappers/installation.md b/packages/website/md/docs/contract_wrappers/1/installation.md
index d5c7fbdba..d5c7fbdba 100644
--- a/packages/website/md/docs/contract_wrappers/installation.md
+++ b/packages/website/md/docs/contract_wrappers/1/installation.md
diff --git a/packages/website/md/docs/contract_wrappers/introduction.md b/packages/website/md/docs/contract_wrappers/1/introduction.md
index ccc81b373..ccc81b373 100644
--- a/packages/website/md/docs/contract_wrappers/introduction.md
+++ b/packages/website/md/docs/contract_wrappers/1/introduction.md
diff --git a/packages/website/md/docs/contract_wrappers/2/installation.md b/packages/website/md/docs/contract_wrappers/2/installation.md
new file mode 100644
index 000000000..50610550a
--- /dev/null
+++ b/packages/website/md/docs/contract_wrappers/2/installation.md
@@ -0,0 +1,11 @@
+**Install**
+
+```bash
+npm install @0x/contract-wrappers --save
+```
+
+**Import**
+
+```javascript
+import { ContractWrappers } from '@0x/contract-wrappers';
+```
diff --git a/packages/website/md/docs/json_schemas/1.0.0/installation.md b/packages/website/md/docs/json_schemas/1/installation.md
index 50a37bae1..50a37bae1 100644
--- a/packages/website/md/docs/json_schemas/1.0.0/installation.md
+++ b/packages/website/md/docs/json_schemas/1/installation.md
diff --git a/packages/website/md/docs/json_schemas/1.0.0/introduction.md b/packages/website/md/docs/json_schemas/1/introduction.md
index 5b2e90387..5b2e90387 100644
--- a/packages/website/md/docs/json_schemas/1.0.0/introduction.md
+++ b/packages/website/md/docs/json_schemas/1/introduction.md
diff --git a/packages/website/md/docs/json_schemas/1.0.0/schemas.md b/packages/website/md/docs/json_schemas/1/schemas.md
index fcf5d8df6..fcf5d8df6 100644
--- a/packages/website/md/docs/json_schemas/1.0.0/schemas.md
+++ b/packages/website/md/docs/json_schemas/1/schemas.md
diff --git a/packages/website/md/docs/json_schemas/1.0.0/usage.md b/packages/website/md/docs/json_schemas/1/usage.md
index 68b801153..68b801153 100644
--- a/packages/website/md/docs/json_schemas/1.0.0/usage.md
+++ b/packages/website/md/docs/json_schemas/1/usage.md
diff --git a/packages/website/md/docs/json_schemas/2.0.0/schemas.md b/packages/website/md/docs/json_schemas/2.0.0/schemas.md
deleted file mode 100644
index 4f3200b1c..000000000
--- a/packages/website/md/docs/json_schemas/2.0.0/schemas.md
+++ /dev/null
@@ -1,28 +0,0 @@
-0x Protocol Schemas
-
-* [Basic types](https://github.com/0xProject/0x-monorepo/blob/development/packages/json-schemas/schemas/basic_type_schemas.ts) (e.g Ethereum address, number, hex)
-* [Order/SignedOrder](https://github.com/0xProject/0x-monorepo/blob/development/packages/json-schemas/schemas/order_schemas.ts)
-* [OrderHash](https://github.com/0xProject/0x-monorepo/blob/development/packages/json-schemas/schemas/order_hash_schema.ts)
-
-0x.js Schemas
-
-* [BlockRange](https://github.com/0xProject/0x-monorepo/blob/development/packages/json-schemas/schemas/block_range_schema.ts)
-* [IndexFilter Values](https://github.com/0xProject/0x-monorepo/blob/development/packages/json-schemas/schemas/index_filter_values_schema.ts)
-* [OrderFillRequests](https://github.com/0xProject/0x-monorepo/blob/development/packages/json-schemas/schemas/order_fill_requests_schema.ts)
-* [OrderCancellationRequests](https://github.com/0xProject/0x-monorepo/blob/development/packages/json-schemas/schemas/order_cancel_schema.ts)
-* [OrderFillOrKillRequests](https://github.com/0xProject/0x-monorepo/blob/development/packages/json-schemas/schemas/order_fill_or_kill_requests_schema.ts)
-* [SignedOrders](https://github.com/0xProject/0x-monorepo/blob/development/packages/json-schemas/schemas/signed_orders_schema.ts)
-* [Token](https://github.com/0xProject/0x-monorepo/blob/development/packages/json-schemas/schemas/token_schema.ts)
-* [TxData](https://github.com/0xProject/0x-monorepo/blob/development/packages/json-schemas/schemas/tx_data_schema.ts)
-
-Standard Relayer API Schemas
-
-* [Paginated collection](https://github.com/0xProject/0x-monorepo/blob/development/packages/json-schemas/schemas/paginated_collection_schema.ts)
-* [Error response](https://github.com/0xProject/0x-monorepo/blob/development/packages/json-schemas/schemas/relayer_api_error_response_schema.ts)
-* [Order config payload](https://github.com/0xProject/0x-monorepo/blob/development/packages/json-schemas/schemas/relayer_api_order_config_payload_schema.ts)
-* [Order config response](https://github.com/0xProject/0x-monorepo/blob/development/packages/json-schemas/schemas/relayer_api_order_config_response_schema.ts)
-* [Orders channel subscribe](https://github.com/0xProject/0x-monorepo/blob/development/packages/json-schemas/schemas/relayer_api_orders_channel_subscribe_schema.ts)
-* [Orders channel update](https://github.com/0xProject/0x-monorepo/blob/development/packages/json-schemas/schemas/relayer_api_orders_channel_update_response_schema.ts)
-* [Orderbook response](https://github.com/0xProject/0x-monorepo/blob/development/packages/json-schemas/schemas/relayer_api_orderbook_response_schema.ts)
-* [Asset pairs response](https://github.com/0xProject/0x-monorepo/blob/development/packages/json-schemas/schemas/relayer_api_asset_pairs_response_schema.ts)
-* [Fee recipients response](https://github.com/0xProject/0x-monorepo/blob/development/packages/json-schemas/schemas/relayer_api_fee_recipients_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
new file mode 100644
index 000000000..8ea6c8e85
--- /dev/null
+++ b/packages/website/md/docs/json_schemas/2/schemas.md
@@ -0,0 +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)
+
+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)
+
+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)
+
+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)
diff --git a/packages/website/md/docs/json_schemas/3/installation.md b/packages/website/md/docs/json_schemas/3/installation.md
new file mode 100644
index 000000000..a99886113
--- /dev/null
+++ b/packages/website/md/docs/json_schemas/3/installation.md
@@ -0,0 +1,17 @@
+**Install**
+
+```bash
+yarn add @0x/json-schemas
+```
+
+**Import**
+
+```javascript
+import { schemas } from '@0x/json-schemas';
+```
+
+or
+
+```javascript
+var schemas = require('@0x/json-schemas').schemas;
+```
diff --git a/packages/website/md/docs/json_schemas/3/introduction.md b/packages/website/md/docs/json_schemas/3/introduction.md
new file mode 100644
index 000000000..0039d014a
--- /dev/null
+++ b/packages/website/md/docs/json_schemas/3/introduction.md
@@ -0,0 +1,3 @@
+Welcome to the [json-schemas](https://github.com/0xProject/0x-monorepo/tree/development/packages/json-schemas) documentation! This package provides JSON schemas for validating 0x Protocol & Standard Relayer API data structures. It provides both the raw JSON schemas and a schema validator class to interact with them from a JS project.
+
+If you are not using a Javascript-based language for your project, you can use a Javascript environment to render the JSON schemas within this package and use them together with a [JSON Schema](http://json-schema.org/) implementation in your [language of choice](http://json-schema.org/implementations.html) (e.g Python, Haskell, Go, C, C++, Rust, Ruby, Scala, etc...).
diff --git a/packages/website/md/docs/json_schemas/3/schemas.md b/packages/website/md/docs/json_schemas/3/schemas.md
new file mode 100644
index 000000000..99aff7b5a
--- /dev/null
+++ b/packages/website/md/docs/json_schemas/3/schemas.md
@@ -0,0 +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)
+
+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)
+
+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)
+
+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)
diff --git a/packages/website/md/docs/json_schemas/3/usage.md b/packages/website/md/docs/json_schemas/3/usage.md
new file mode 100644
index 000000000..2b72eeaad
--- /dev/null
+++ b/packages/website/md/docs/json_schemas/3/usage.md
@@ -0,0 +1,14 @@
+The following example shows you how to validate a 0x order using the `@0x/json-schemas` package.
+
+```javascript
+import {SchemaValidator, ValidatorResult, schemas} from '@0x/json-schemas';
+
+const {orderSchema} = schemas;
+const validator = new SchemaValidator();
+
+const order = {
+ ...
+};
+const validatorResult: ValidatorResult = validator.validate(order, orderSchema); // Contains all errors
+const isValid: boolean = validator.isValid(order, orderSchema); // Only returns boolean
+```
diff --git a/packages/website/md/docs/order_utils/1.0.0/installation.md b/packages/website/md/docs/order_utils/1/installation.md
index 68a7cf960..68a7cf960 100644
--- a/packages/website/md/docs/order_utils/1.0.0/installation.md
+++ b/packages/website/md/docs/order_utils/1/installation.md
diff --git a/packages/website/md/docs/order_utils/1.0.0/introduction.md b/packages/website/md/docs/order_utils/1/introduction.md
index d5f3f2925..d5f3f2925 100644
--- a/packages/website/md/docs/order_utils/1.0.0/introduction.md
+++ b/packages/website/md/docs/order_utils/1/introduction.md
diff --git a/packages/website/md/docs/order_utils/2/installation.md b/packages/website/md/docs/order_utils/2/installation.md
new file mode 100644
index 000000000..d4bac6a53
--- /dev/null
+++ b/packages/website/md/docs/order_utils/2/installation.md
@@ -0,0 +1,17 @@
+**Install**
+
+```bash
+yarn add @0x/order-utils
+```
+
+**Import**
+
+```javascript
+import { createSignedOrderAsync } from '@0x/order-utils';
+```
+
+or
+
+```javascript
+var createSignedOrderAsync = require('@0x/order-utils').createSignedOrderAsync;
+```
diff --git a/packages/website/md/docs/order_utils/2/introduction.md b/packages/website/md/docs/order_utils/2/introduction.md
new file mode 100644
index 000000000..567896603
--- /dev/null
+++ b/packages/website/md/docs/order_utils/2/introduction.md
@@ -0,0 +1 @@
+Welcome to the [order-utils](https://github.com/0xProject/0x-monorepo/tree/development/packages/order-utils) documentation! Order utils is a set of utils around creating, signing, validating 0x orders.
diff --git a/packages/website/md/docs/order_watcher/installation.md b/packages/website/md/docs/order_watcher/1/installation.md
index 4b28f583d..4b28f583d 100644
--- a/packages/website/md/docs/order_watcher/installation.md
+++ b/packages/website/md/docs/order_watcher/1/installation.md
diff --git a/packages/website/md/docs/order_watcher/introduction.md b/packages/website/md/docs/order_watcher/1/introduction.md
index f922d922f..f922d922f 100644
--- a/packages/website/md/docs/order_watcher/introduction.md
+++ b/packages/website/md/docs/order_watcher/1/introduction.md
diff --git a/packages/website/md/docs/order_watcher/2/installation.md b/packages/website/md/docs/order_watcher/2/installation.md
new file mode 100644
index 000000000..883eb40e5
--- /dev/null
+++ b/packages/website/md/docs/order_watcher/2/installation.md
@@ -0,0 +1,17 @@
+**Install**
+
+```bash
+yarn add @0x/order-watcher
+```
+
+**Import**
+
+```javascript
+import { OrderWatcher } from '@0x/order-watcher';
+```
+
+or
+
+```javascript
+var OrderWatcher = require('@0x/order-utils').OrderWatcher;
+```
diff --git a/packages/website/md/docs/order_watcher/2/introduction.md b/packages/website/md/docs/order_watcher/2/introduction.md
new file mode 100644
index 000000000..b2d574053
--- /dev/null
+++ b/packages/website/md/docs/order_watcher/2/introduction.md
@@ -0,0 +1 @@
+Welcome to the [order-watcher](https://github.com/0xProject/0x-monorepo/tree/development/packages/order-watcher) documentation! OrderWatcher is a daemon that efficiently watches a set of orders, emitting events whenever the validity of an order changes. It can be used by relayers to prune an orderbook, or by traders to keep orders fetched from a Relayer up-to-date.
diff --git a/packages/website/md/docs/smart_contracts/1.0.0/introduction.md b/packages/website/md/docs/smart_contracts/1/introduction.md
index 79a8f00fd..79a8f00fd 100644
--- a/packages/website/md/docs/smart_contracts/1.0.0/introduction.md
+++ b/packages/website/md/docs/smart_contracts/1/introduction.md
diff --git a/packages/website/md/docs/smart_contracts/2.0.0/introduction.md b/packages/website/md/docs/smart_contracts/2/introduction.md
index 4aa31db3d..4aa31db3d 100644
--- a/packages/website/md/docs/smart_contracts/2.0.0/introduction.md
+++ b/packages/website/md/docs/smart_contracts/2/introduction.md
diff --git a/packages/website/md/docs/sol-compiler/installation.md b/packages/website/md/docs/sol-compiler/1/installation.md
index 9c8561d9b..9c8561d9b 100644
--- a/packages/website/md/docs/sol-compiler/installation.md
+++ b/packages/website/md/docs/sol-compiler/1/installation.md
diff --git a/packages/website/md/docs/sol-compiler/introduction.md b/packages/website/md/docs/sol-compiler/1/introduction.md
index fcd80f47b..fcd80f47b 100644
--- a/packages/website/md/docs/sol-compiler/introduction.md
+++ b/packages/website/md/docs/sol-compiler/1/introduction.md
diff --git a/packages/website/md/docs/sol-compiler/usage.md b/packages/website/md/docs/sol-compiler/1/usage.md
index 79c9b32ba..79c9b32ba 100644
--- a/packages/website/md/docs/sol-compiler/usage.md
+++ b/packages/website/md/docs/sol-compiler/1/usage.md
diff --git a/packages/website/md/docs/sol-compiler/2/installation.md b/packages/website/md/docs/sol-compiler/2/installation.md
new file mode 100644
index 000000000..7e7b690fe
--- /dev/null
+++ b/packages/website/md/docs/sol-compiler/2/installation.md
@@ -0,0 +1,23 @@
+#### CLI Installation
+
+```bash
+yarn global add @0x/sol-compiler
+```
+
+#### API Installation
+
+```bash
+yarn add @0x/sol-compiler
+```
+
+**Import**
+
+```typescript
+import { Compiler } from '@0x/sol-compiler';
+```
+
+or
+
+```javascript
+var Compiler = require('@0x/sol-compiler').Compiler;
+```
diff --git a/packages/website/md/docs/sol-compiler/2/usage.md b/packages/website/md/docs/sol-compiler/2/usage.md
new file mode 100644
index 000000000..68e5a988f
--- /dev/null
+++ b/packages/website/md/docs/sol-compiler/2/usage.md
@@ -0,0 +1,24 @@
+#### CLI Usage
+
+```bash
+$ sol-compiler
+Options:
+ --version Show version number [boolean]
+ --contracts-dir path of contracts directory to compile [string]
+ --artifacts-dir path to write contracts artifacts to [string]
+ --contracts comma separated list of contracts to compile
+ [string] [default: "*"]
+ --help Show help [boolean]
+```
+
+#### API Usage
+
+```typescript
+import { Compiler } from '@0x/sol-compiler';
+
+const compiler = new Compiler();
+
+(async () => {
+ await compiler.compileAllAsync();
+})().catch(console.log);
+```
diff --git a/packages/website/md/docs/sol_cov/installation.md b/packages/website/md/docs/sol_cov/1/installation.md
index b9ce25a5f..b9ce25a5f 100644
--- a/packages/website/md/docs/sol_cov/installation.md
+++ b/packages/website/md/docs/sol_cov/1/installation.md
diff --git a/packages/website/md/docs/sol_cov/introduction.md b/packages/website/md/docs/sol_cov/1/introduction.md
index 7064a3554..7064a3554 100644
--- a/packages/website/md/docs/sol_cov/introduction.md
+++ b/packages/website/md/docs/sol_cov/1/introduction.md
diff --git a/packages/website/md/docs/sol_cov/usage.md b/packages/website/md/docs/sol_cov/1/usage.md
index c747005fb..c747005fb 100644
--- a/packages/website/md/docs/sol_cov/usage.md
+++ b/packages/website/md/docs/sol_cov/1/usage.md
diff --git a/packages/website/md/docs/sol_cov/2/installation.md b/packages/website/md/docs/sol_cov/2/installation.md
new file mode 100644
index 000000000..1d4557cf5
--- /dev/null
+++ b/packages/website/md/docs/sol_cov/2/installation.md
@@ -0,0 +1,17 @@
+**Install**
+
+```bash
+yarn add @0x/sol-cov
+```
+
+**Import**
+
+```javascript
+import { CoverageSubprovider } from '@0x/sol-cov';
+```
+
+or
+
+```javascript
+var CoverageSubprovider = require('@0x/sol-cov').CoverageSubprovider;
+```
diff --git a/packages/website/md/docs/sol_cov/2/introduction.md b/packages/website/md/docs/sol_cov/2/introduction.md
new file mode 100644
index 000000000..ac3256845
--- /dev/null
+++ b/packages/website/md/docs/sol_cov/2/introduction.md
@@ -0,0 +1 @@
+Welcome to the [sol-cov](https://github.com/0xProject/0x-monorepo/tree/development/packages/sol-cov) documentation! Sol-cov is a Solidity coverage tool for your smart contract tests.
diff --git a/packages/website/md/docs/sol_cov/2/usage.md b/packages/website/md/docs/sol_cov/2/usage.md
new file mode 100644
index 000000000..d1c76474b
--- /dev/null
+++ b/packages/website/md/docs/sol_cov/2/usage.md
@@ -0,0 +1,62 @@
+Sol-cov 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://0xproject.com/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.
+
+Coverage 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 `CoverageSubprovider` with your favorite framework you need to pass an `artifactsAdapter` to it.
+
+### Sol-compiler
+
+If you are generating your artifacts with [@0x/sol-compiler](https://0xproject.com/docs/sol-compiler) you can use the `SolCompilerArtifactsAdapter` we've implemented for you.
+
+```typescript
+import { SolCompilerArtifactsAdapter } from '@0x/sol-cov';
+const artifactsPath = 'src/artifacts';
+const contractsPath = 'src/contracts';
+const artifactsAdapter = new SolCompilerArtifactsAdapter(artifactsPath, contractsPath);
+```
+
+### Truffle
+
+If your project is using [Truffle](https://truffleframework.com/), we've written a `TruffleArtifactsAdapter`for you.
+
+```typescript
+import { TruffleArtifactAdapter } from '@0x/sol-cov';
+const contractsPath = 'src/contracts';
+const artifactAdapter = new TruffleArtifactAdapter(contractsDir);
+```
+
+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`.
+
+### 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.
+
+### Usage
+
+```typescript
+import { CoverageSubprovider } from '@0x/sol-cov';
+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);
+```
+
+After your test suite is complete (e.g in the Mocha global `after` hook), you'll need to call:
+
+```typescript
+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.
diff --git a/packages/website/md/docs/subproviders/installation.md b/packages/website/md/docs/subproviders/1/installation.md
index a049ff0ec..a049ff0ec 100644
--- a/packages/website/md/docs/subproviders/installation.md
+++ b/packages/website/md/docs/subproviders/1/installation.md
diff --git a/packages/website/md/docs/subproviders/introduction.md b/packages/website/md/docs/subproviders/1/introduction.md
index 835201064..835201064 100644
--- a/packages/website/md/docs/subproviders/introduction.md
+++ b/packages/website/md/docs/subproviders/1/introduction.md
diff --git a/packages/website/md/docs/subproviders/ledger_node_hid.md b/packages/website/md/docs/subproviders/1/ledger_node_hid.md
index 3089817af..3089817af 100644
--- a/packages/website/md/docs/subproviders/ledger_node_hid.md
+++ b/packages/website/md/docs/subproviders/1/ledger_node_hid.md
diff --git a/packages/website/md/docs/subproviders/2/installation.md b/packages/website/md/docs/subproviders/2/installation.md
new file mode 100644
index 000000000..025dd0dee
--- /dev/null
+++ b/packages/website/md/docs/subproviders/2/installation.md
@@ -0,0 +1,15 @@
+```bash
+npm install @0x/subproviders --save
+```
+
+**Import**
+
+```typescript
+import { LedgerSubprovider } from '@0x/subproviders';
+```
+
+or
+
+```javascript
+var LedgerSubprovider = require('@0x/subproviders').LedgerSubprovider;
+```
diff --git a/packages/website/md/docs/web3_wrapper/installation.md b/packages/website/md/docs/web3_wrapper/1/installation.md
index 92794d9b0..92794d9b0 100644
--- a/packages/website/md/docs/web3_wrapper/installation.md
+++ b/packages/website/md/docs/web3_wrapper/1/installation.md
diff --git a/packages/website/md/docs/web3_wrapper/introduction.md b/packages/website/md/docs/web3_wrapper/1/introduction.md
index 17bd316f1..17bd316f1 100644
--- a/packages/website/md/docs/web3_wrapper/introduction.md
+++ b/packages/website/md/docs/web3_wrapper/1/introduction.md
diff --git a/packages/website/md/docs/web3_wrapper/2/installation.md b/packages/website/md/docs/web3_wrapper/2/installation.md
new file mode 100644
index 000000000..14c4f066c
--- /dev/null
+++ b/packages/website/md/docs/web3_wrapper/2/installation.md
@@ -0,0 +1,25 @@
+**Install**
+
+```bash
+npm install @0x/web3-wrapper --save
+```
+
+**Import**
+
+```javascript
+import { Web3Wrapper } from '@0x/web3-wrapper';
+```
+
+or
+
+```javascript
+var Web3Wrapper = require('@0x/web3-wrapper').Web3Wrapper;
+```
+
+If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`:
+
+```
+"include": [
+ "./node_modules/web3-typescript-typings/index.d.ts",
+]
+```
diff --git a/packages/website/package.json b/packages/website/package.json
index 8f69460d6..fd671d85d 100644
--- a/packages/website/package.json
+++ b/packages/website/package.json
@@ -1,41 +1,41 @@
{
- "name": "@0xproject/website",
- "version": "0.0.54",
+ "name": "@0x/website",
+ "version": "0.0.56",
"engines": {
"node": ">=6.12"
},
"private": true,
"description": "Website and 0x portal dapp",
"scripts": {
- "build": "node --max_old_space_size=8192 ../../node_modules/.bin/webpack --mode production",
+ "build": "yarn build:dev",
+ "build:prod": "node --max_old_space_size=8192 ../../node_modules/.bin/webpack --mode production",
"build:dev": "../../node_modules/.bin/webpack --mode development",
"clean": "shx rm -f public/bundle*",
- "lint": "tslint --project . 'ts/**/*.ts' 'ts/**/*.tsx'",
+ "lint": "tslint --format stylish --project . 'ts/**/*.ts' 'ts/**/*.tsx'",
"dev": "webpack-dev-server --mode development --content-base public --https",
- "deploy_dogfood": "npm run build; aws s3 sync ./public/. s3://dogfood.0xproject.com --profile 0xproject --region us-east-1 --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers",
- "deploy_staging": "npm run build; aws s3 sync ./public/. s3://staging-0xproject --profile 0xproject --region us-east-1 --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers",
- "deploy_live": "DEPLOY_ROLLBAR_SOURCEMAPS=true npm run build; aws s3 sync ./public/. s3://0xproject.com --profile 0xproject --region us-east-1 --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --exclude *.map.js"
+ "deploy_dogfood": "npm run build:prod; aws s3 sync ./public/. s3://dogfood.0xproject.com --profile 0xproject --region us-east-1 --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers",
+ "deploy_staging": "npm run build:prod; aws s3 sync ./public/. s3://staging-0xproject --profile 0xproject --region us-east-1 --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers",
+ "deploy_live": "DEPLOY_ROLLBAR_SOURCEMAPS=true npm run build:prod; aws s3 sync ./public/. s3://0xproject.com --profile 0xproject --region us-east-1 --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --exclude *.map.js"
},
"author": "Fabio Berger",
"license": "Apache-2.0",
"dependencies": {
- "0x.js": "^0.38.6",
- "@0xproject/contract-wrappers": "^2.0.2",
- "@0xproject/json-schemas": "^1.0.7",
- "@0xproject/order-utils": "^1.0.7",
- "@0xproject/react-docs": "^1.0.13",
- "@0xproject/react-shared": "^1.0.15",
- "@0xproject/subproviders": "^2.0.7",
- "@0xproject/types": "^1.1.4",
- "@0xproject/typescript-typings": "^3.0.2",
- "@0xproject/utils": "^2.0.2",
- "@0xproject/web3-wrapper": "^3.0.3",
+ "@0x/contract-wrappers": "^3.0.1",
+ "@0x/json-schemas": "^2.0.1",
+ "@0x/order-utils": "^2.0.1",
+ "@0x/react-docs": "^1.0.15",
+ "@0x/react-shared": "^1.0.18",
+ "@0x/subproviders": "^2.1.1",
+ "@0x/types": "^1.2.1",
+ "@0x/typescript-typings": "^3.0.4",
+ "@0x/utils": "^2.0.4",
+ "@0x/web3-wrapper": "^3.1.1",
"accounting": "^0.4.1",
"basscss": "^8.0.3",
"blockies": "^0.0.2",
"bowser": "^1.9.3",
"deep-equal": "^1.0.1",
- "ethereum-types": "^1.0.11",
+ "ethereum-types": "^1.1.2",
"ethereumjs-util": "^5.1.1",
"find-versions": "^2.0.0",
"jsonschema": "^1.2.0",
@@ -53,8 +53,7 @@
"react-helmet": "^5.2.0",
"react-popper": "^1.0.0-beta.6",
"react-redux": "^5.0.3",
- "react-router-dom": "^4.1.1",
- "react-scroll": "0xproject/react-scroll#similar-to-pr-330",
+ "react-scroll": "0xproject/react-scroll#pr-330-and-replace-state",
"react-tooltip": "^3.2.7",
"react-typist": "^2.0.4",
"redux": "^3.6.0",
@@ -83,13 +82,11 @@
"@types/react-dom": "^16.0.7",
"@types/react-helmet": "^5.0.6",
"@types/react-redux": "^4.4.37",
- "@types/react-router-dom": "^4.0.4",
"@types/react-scroll": "1.5.3",
"@types/react-tap-event-plugin": "0.0.30",
"@types/redux": "^3.6.0",
"@types/web3-provider-engine": "^14.0.0",
"awesome-typescript-loader": "^5.2.1",
- "copyfiles": "^2.0.0",
"css-loader": "0.23.x",
"less-loader": "^4.1.0",
"make-promises-safe": "^1.1.0",
diff --git a/packages/website/public/css/basscss_responsive_custom.css b/packages/website/public/css/basscss_responsive_custom.css
index 5f8bd9117..92a681cb1 100644
--- a/packages/website/public/css/basscss_responsive_custom.css
+++ b/packages/website/public/css/basscss_responsive_custom.css
@@ -26,6 +26,10 @@
.sm-right {
float: right;
}
+ .sm-justify-end {
+ ms-flex-pack: end;
+ justify-content: flex-end;
+ }
}
@media (min-width: 52em) {
@@ -54,6 +58,10 @@
.md-right {
float: right;
}
+ .md-justify-end {
+ ms-flex-pack: end;
+ justify-content: flex-end;
+ }
}
@media (min-width: 64em) {
@@ -82,4 +90,8 @@
.lg-right {
float: right;
}
+ .lg-justify-end {
+ ms-flex-pack: end;
+ justify-content: flex-end;
+ }
}
diff --git a/packages/website/public/images/developers/tutorials/0x_order_basics.svg b/packages/website/public/images/developers/tutorials/0x_order_basics.svg
new file mode 100644
index 000000000..57b04dfa5
--- /dev/null
+++ b/packages/website/public/images/developers/tutorials/0x_order_basics.svg
@@ -0,0 +1 @@
+<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 72 72"><defs><style>.cls-1{fill:#3289f1;}.cls-2{fill:#fff;}</style></defs><title>Artboard 1</title><path class="cls-1" d="M62.64,26.77a0,0,0,0,0,0,0A2.44,2.44,0,0,0,62,25.28L48.2,11.43a2.38,2.38,0,0,0-1.53-.71H35.45a16.12,16.12,0,0,1,.44,3.5H45v9.26a5,5,0,0,0,5,5h9.15V65.41A2.16,2.16,0,0,1,57,67.57H21.8a2.16,2.16,0,0,1-2.15-2.16V31.46H19a16.81,16.81,0,0,1-2.86-.24V65.41a5.67,5.67,0,0,0,5.65,5.66H57a5.67,5.67,0,0,0,5.66-5.66V27A1.48,1.48,0,0,0,62.64,26.77ZM50,25a1.49,1.49,0,0,1-1.49-1.49V16.71L56.69,25Z"/><path class="cls-1" d="M48,11.23a1.75,1.75,0,0,0-1.34-.51,2.38,2.38,0,0,1,1.53.71ZM62.14,25.47,62,25.28a2.44,2.44,0,0,1,.69,1.46A1.71,1.71,0,0,0,62.14,25.47Z"/><path class="cls-2" d="M17.26,12.83V13a1.33,1.33,0,0,1,.14-.19Zm0,0V13a1.33,1.33,0,0,1,.14-.19Zm0,0V13a1.33,1.33,0,0,1,.14-.19Zm0,0V13a1.33,1.33,0,0,1,.14-.19Zm0,0V13a1.33,1.33,0,0,1,.14-.19Z"/><path class="cls-2" d="M17.26,12.83V13a1.33,1.33,0,0,1,.14-.19Zm0,0V13a1.33,1.33,0,0,1,.14-.19Zm0,0V13a1.33,1.33,0,0,1,.14-.19Zm0,0V13a1.33,1.33,0,0,1,.14-.19Zm0,0V13a1.33,1.33,0,0,1,.14-.19Z"/><path class="cls-1" d="M32.65,14.21a13.47,13.47,0,0,0-.55-3.5,13.66,13.66,0,1,0-16,17.23,13.47,13.47,0,0,0,2.86.3c.22,0,.43,0,.64,0a13.67,13.67,0,0,0,13-13.64C32.66,14.46,32.66,14.33,32.65,14.21Zm-13,10.51-.64,0a9.94,9.94,0,0,1-2.86-.41A10.15,10.15,0,1,1,28.39,10.71a9.92,9.92,0,0,1,.76,3.5c0,.12,0,.25,0,.37A10.17,10.17,0,0,1,19.65,24.72Z"/><path class="cls-1" d="M25,12.83v3.5H20.76v4.22h-3.5V16.33H13v-3.5h4.22V13a1.33,1.33,0,0,1,.14-.19h-.14V8.61h3.5v4.22Z"/><path class="cls-1" d="M17.4,12.83a1.33,1.33,0,0,0-.14.19v-.19Z"/><path class="cls-1" d="M17.4,12.83a1.33,1.33,0,0,0-.14.19v-.19Z"/><rect class="cls-1" x="27.4" y="35.38" width="22" height="3.5"/><rect class="cls-1" x="27.4" y="55.38" width="22" height="3.5"/><rect class="cls-1" x="27.4" y="45.38" width="16" height="3.5"/></svg> \ No newline at end of file
diff --git a/packages/website/public/images/developers/tutorials/build_a_relayer.svg b/packages/website/public/images/developers/tutorials/build_a_relayer.svg
new file mode 100644
index 000000000..afda40d88
--- /dev/null
+++ b/packages/website/public/images/developers/tutorials/build_a_relayer.svg
@@ -0,0 +1,3 @@
+<svg width="76" height="76" viewBox="0 0 76 76" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M70.0766 46.9825C70.3778 45.294 70.4782 43.6054 70.4782 41.8174C70.4782 30.8913 64.9564 20.8591 55.72 14.8993C54.8164 14.3034 53.712 14.6013 53.1096 15.4953C52.5073 16.3892 52.8085 17.4819 53.6116 18.0778C61.8441 23.3423 66.6631 32.2819 66.6631 41.9168C66.6631 43.208 66.5627 44.4993 66.362 45.7906C65.7596 45.6913 65.0568 45.592 64.4544 45.592C58.1295 45.592 52.9089 50.6577 52.9089 57.0148C52.9089 63.3718 58.0291 68.4376 64.4544 68.4376C70.8798 68.4376 76 63.3718 76 57.0148C76 52.6443 73.5905 48.9691 70.0766 46.9825ZM64.4544 64.6631C60.1374 64.6631 56.7239 61.1866 56.7239 57.0148C56.7239 52.7436 60.2378 49.3664 64.4544 49.3664C68.7715 49.3664 72.1849 52.843 72.1849 57.0148C72.2853 61.1866 68.7715 64.6631 64.4544 64.6631ZM50.3989 67.5436C46.4835 69.4309 42.2668 70.3248 37.9498 70.3248C31.5244 70.3248 25.2999 68.2389 20.2801 64.2658C21.9868 62.2792 23.0912 59.6966 23.0912 56.8161C23.0912 50.5584 17.9709 45.3933 11.5456 45.3933C5.22061 45.3933 6.1277e-06 50.4591 6.1277e-06 56.8161C6.1277e-06 63.1731 5.12022 68.2389 11.5456 68.2389C13.6539 68.2389 15.5614 67.6429 17.2682 66.6497C23.0912 71.4174 30.3197 74 37.8494 74C42.7688 74 47.4875 72.9074 51.9049 70.8215C52.8085 70.4242 53.21 69.2322 52.8085 68.3383C52.5073 67.5436 51.3025 67.1463 50.3989 67.5436ZM3.81505 56.9154C3.81505 52.6443 7.32894 49.2671 11.5456 49.2671C15.7622 49.2671 19.2761 52.7436 19.2761 56.9154C19.2761 61.1866 15.7622 64.5638 11.5456 64.5638C7.32894 64.5638 3.81505 61.1866 3.81505 56.9154ZM7.42933 42.5128C7.42933 42.5128 7.52972 42.5128 7.42933 42.5128C8.53369 42.5128 9.33685 41.7181 9.33685 40.7248C9.63804 31.0899 14.8586 22.349 23.1915 17.3826C24.3963 16.6873 25.6011 16.0913 26.8058 15.5946C28.5126 19.7664 32.6288 22.8456 37.5482 22.8456C43.8732 22.8456 49.0938 17.7799 49.0938 11.4228C49.0938 5.06578 43.9736 1.21251e-05 37.5482 1.21251e-05C31.2233 1.21251e-05 26.0026 5.06578 26.0026 11.4228C26.0026 11.6215 26.0026 11.7208 26.0026 11.9195C24.3963 12.6148 22.79 13.3101 21.1836 14.3034C11.7464 19.9651 5.92339 29.7987 5.5218 40.7248C5.6222 41.6188 6.42536 42.5128 7.42933 42.5128ZM37.5482 3.67516C41.8653 3.67516 45.2787 7.15168 45.2787 11.3235C45.2787 15.5946 41.7649 18.9718 37.5482 18.9718C33.2312 18.9718 29.8177 15.4953 29.8177 11.3235C29.8177 7.15168 33.3316 3.67516 37.5482 3.67516Z" fill="#3289F1"/>
+</svg>
diff --git a/packages/website/public/images/developers/tutorials/build_a_trading_bot.svg b/packages/website/public/images/developers/tutorials/build_a_trading_bot.svg
new file mode 100644
index 000000000..960616bfe
--- /dev/null
+++ b/packages/website/public/images/developers/tutorials/build_a_trading_bot.svg
@@ -0,0 +1,6 @@
+<svg width="72" height="72" viewBox="0 0 72 72" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M72 36.63C72 35.1978 71.4436 33.8243 70.4532 32.8116C69.4628 31.7989 68.1195 31.23 66.7188 31.23H65.6626V23.76C65.6626 21.8504 64.9207 20.0191 63.6002 18.6688C62.2796 17.3186 60.4886 16.56 58.621 16.56H37.7604V1.8C37.7604 1.32261 37.5749 0.864774 37.2448 0.527208C36.9146 0.189643 36.4669 0 36 0C35.5331 0 35.0854 0.189643 34.7552 0.527208C34.4251 0.864774 34.2396 1.32261 34.2396 1.8V16.56H13.379C11.5114 16.56 9.72038 17.3186 8.39983 18.6688C7.07929 20.0191 6.33741 21.8504 6.33741 23.76V31.23H5.28117C3.88052 31.23 2.53723 31.7989 1.54682 32.8116C0.556407 33.8243 3.35768e-07 35.1978 3.35768e-07 36.63V47.25C3.35768e-07 48.6822 0.556407 50.0557 1.54682 51.0684C2.53723 52.0811 3.88052 52.65 5.28117 52.65H6.33741V64.8C6.33741 66.7096 7.07929 68.5409 8.39983 69.8912C9.72038 71.2414 11.5114 72 13.379 72H58.621C60.4886 72 62.2796 71.2414 63.6002 69.8912C64.9207 68.5409 65.6626 66.7096 65.6626 64.8V52.65H66.7188C68.1195 52.65 69.4628 52.0811 70.4532 51.0684C71.4436 50.0557 72 48.6822 72 47.25V36.63ZM68.4792 47.25C68.4792 47.7274 68.2937 48.1852 67.9636 48.5228C67.6335 48.8604 67.1857 49.05 66.7188 49.05H63.9022C63.4353 49.05 62.9876 49.2396 62.6574 49.5772C62.3273 49.9148 62.1418 50.3726 62.1418 50.85V64.8C62.1418 65.7548 61.7709 66.6705 61.1106 67.3456C60.4503 68.0207 59.5548 68.4 58.621 68.4H13.379C12.4452 68.4 11.5497 68.0207 10.8894 67.3456C10.2291 66.6705 9.85819 65.7548 9.85819 64.8V50.85C9.85819 50.3726 9.67272 49.9148 9.34258 49.5772C9.01245 49.2396 8.56468 49.05 8.0978 49.05H5.28117C4.81429 49.05 4.36653 48.8604 4.03639 48.5228C3.70625 48.1852 3.52078 47.7274 3.52078 47.25V36.63C3.52078 36.1526 3.70625 35.6948 4.03639 35.3572C4.36653 35.0196 4.81429 34.83 5.28117 34.83H8.0978C8.56468 34.83 9.01245 34.6404 9.34258 34.3028C9.67272 33.9652 9.85819 33.5074 9.85819 33.03V23.76C9.85819 22.8052 10.2291 21.8895 10.8894 21.2144C11.5497 20.5393 12.4452 20.16 13.379 20.16H58.621C59.5548 20.16 60.4503 20.5393 61.1106 21.2144C61.7709 21.8895 62.1418 22.8052 62.1418 23.76V33.03C62.1418 33.5074 62.3273 33.9652 62.6574 34.3028C62.9876 34.6404 63.4353 34.83 63.9022 34.83H66.7188C67.1857 34.83 67.6335 35.0196 67.9636 35.3572C68.2937 35.6948 68.4792 36.1526 68.4792 36.63V47.25Z" fill="#3289F1"/>
+<path d="M32.2998 38.5204C32.2998 36.9718 31.8507 35.458 31.0092 34.1703C30.1678 32.8827 28.9718 31.8791 27.5726 31.2865C26.1733 30.6938 24.6336 30.5388 23.1481 30.8409C21.6627 31.143 20.2982 31.8887 19.2273 32.9838C18.1563 34.0788 17.427 35.474 17.1315 36.9929C16.836 38.5117 16.9877 40.0861 17.5673 41.5168C18.1469 42.9476 19.1284 44.1705 20.3877 45.0308C21.647 45.8912 23.1275 46.3504 24.6421 46.3504C26.673 46.3504 28.6208 45.5255 30.0569 44.0571C31.493 42.5887 32.2998 40.5971 32.2998 38.5204ZM24.6421 42.7504C24.0988 42.7504 23.5609 42.641 23.0589 42.4284C22.557 42.2159 22.101 41.9043 21.7168 41.5115C21.3327 41.1187 21.028 40.6524 20.8201 40.1392C20.6122 39.626 20.5052 39.0759 20.5052 38.5204C20.5052 37.3986 20.941 36.3226 21.7168 35.5294C22.4927 34.7361 23.5449 34.2904 24.6421 34.2904C25.7393 34.2904 26.7915 34.7361 27.5673 35.5294C28.3431 36.3226 28.779 37.3986 28.779 38.5204C28.779 39.6423 28.3431 40.7182 27.5673 41.5115C26.7915 42.3048 25.7393 42.7504 24.6421 42.7504Z" fill="#3289F1"/>
+<path d="M47.3533 30.6001C45.8177 30.5823 44.3116 31.0316 43.0263 31.8909C41.741 32.7503 40.7345 33.9809 40.1347 35.4264C39.5349 36.8719 39.3689 38.4671 39.6578 40.0093C39.9466 41.5515 40.6773 42.9711 41.757 44.0878C42.8367 45.2045 44.2166 45.9678 45.7215 46.2807C47.2264 46.5937 48.7882 46.4422 50.2087 45.8455C51.6292 45.2487 52.8442 44.2338 53.6992 42.9294C54.5543 41.6251 55.0109 40.0904 55.011 38.5201C55.0226 37.4843 54.8331 36.4565 54.4535 35.4961C54.0739 34.5357 53.5117 33.6618 52.7994 32.9252C52.0872 32.1886 51.2391 31.6037 50.3042 31.2046C49.3694 30.8055 48.3664 30.6001 47.3533 30.6001ZM47.3533 42.7501C46.2561 42.7501 45.2039 42.3045 44.428 41.5112C43.6522 40.7179 43.2164 39.642 43.2164 38.5201C43.2164 37.9646 43.3234 37.4146 43.5313 36.9014C43.7392 36.3882 44.0439 35.9218 44.428 35.5291C44.8122 35.1363 45.2682 34.8247 45.7701 34.6121C46.2721 34.3995 46.81 34.2901 47.3533 34.2901C47.8965 34.2901 48.4345 34.3995 48.9364 34.6121C49.4383 34.8247 49.8944 35.1363 50.2785 35.5291C50.6627 35.9218 50.9674 36.3882 51.1753 36.9014C51.3832 37.4146 51.4902 37.9646 51.4902 38.5201C51.4902 39.642 51.0543 40.7179 50.2785 41.5112C49.5027 42.3045 48.4505 42.7501 47.3533 42.7501Z" fill="#3289F1"/>
+<path d="M46.7424 55.7109H25.2656V59.3109H46.7424V55.7109Z" fill="#3289F1"/>
+</svg>
diff --git a/packages/website/public/images/developers/tutorials/develop_on_ethereum.svg b/packages/website/public/images/developers/tutorials/develop_on_ethereum.svg
new file mode 100644
index 000000000..e2c492ecd
--- /dev/null
+++ b/packages/website/public/images/developers/tutorials/develop_on_ethereum.svg
@@ -0,0 +1,4 @@
+<svg width="76" height="76" viewBox="0 0 76 76" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M14.0349 38.5774C14.0366 38.5844 14.0366 38.5914 14.0383 38.5975C14.0459 38.6273 14.0595 38.6553 14.0688 38.6842C14.079 38.7148 14.085 38.7463 14.0977 38.7761C14.1003 38.7813 14.1045 38.7848 14.1062 38.7901C14.1461 38.8802 14.1979 38.9625 14.2582 39.0387C14.2752 39.0597 14.293 39.0781 14.3109 39.0973C14.3627 39.1534 14.4187 39.2041 14.4816 39.2488C14.4994 39.2619 14.5164 39.2768 14.5351 39.289C14.5436 39.2943 14.5503 39.3013 14.5588 39.3065L36.3144 52.3229C36.4876 52.4262 36.6812 52.4779 36.874 52.4779C36.9173 52.4779 36.9589 52.4656 37.0014 52.4603C37.0439 52.4656 37.0863 52.4779 37.1288 52.4779C37.3224 52.4779 37.5152 52.4262 37.6884 52.3229L59.444 39.3065C59.703 39.1516 59.8898 38.896 59.9645 38.5975C60.0384 38.299 59.9934 37.9821 59.8389 37.7178L38.0859 0.552394C37.8659 0.177746 37.4642 -0.0148298 37.0515 0.014932C36.6065 -0.0594723 36.1564 0.147984 35.9195 0.552394L14.1631 37.7187C14.1487 37.7432 14.1402 37.7703 14.1274 37.7966C14.1087 37.8351 14.0884 37.8718 14.0739 37.9121C14.0629 37.9427 14.0569 37.9751 14.0476 38.0075C14.0366 38.0478 14.0247 38.0881 14.0179 38.1292C14.0128 38.1607 14.0128 38.1931 14.0102 38.2255C14.0068 38.2684 14.0026 38.3104 14.0043 38.3542C14.0051 38.3874 14.0111 38.4198 14.0153 38.4531C14.0213 38.4942 14.0247 38.5354 14.0349 38.5774ZM38.2455 5.27838L56.1991 35.9496L38.2455 27.7826V5.27838ZM38.2455 30.2957L56.3197 38.5179L38.2455 49.3319V30.2957ZM35.759 5.27838V27.6662L17.898 35.7912L35.759 5.27838ZM35.759 30.1802V49.331L17.5744 38.4522L35.759 30.1802Z" fill="#3289F1"/>
+<path d="M58.3132 42.4975L36.9993 55.5568L15.6854 42.4975C15.2327 42.2192 14.651 42.3076 14.2943 42.7076C13.9368 43.1085 13.9011 43.7125 14.2085 44.1546L35.9641 75.5182C36.1772 75.8263 36.5186 75.9996 36.8719 75.9996C36.9144 75.9996 36.9568 75.9839 36.9993 75.9786C37.0418 75.9839 37.0842 75.9996 37.1267 75.9996C37.48 75.9996 37.8205 75.8263 38.0345 75.5182L59.79 44.1546C60.0975 43.7125 60.0609 43.1085 59.7043 42.7076C59.3467 42.3076 58.7659 42.22 58.3132 42.4975ZM35.756 71.2649L19.1145 47.2743L35.756 57.4703V71.2649ZM38.2426 71.2649V57.4703L54.884 47.2743L38.2426 71.2649Z" fill="#3289F1"/>
+</svg>
diff --git a/packages/website/public/images/developers/tutorials/use_shared_liquidity.svg b/packages/website/public/images/developers/tutorials/use_shared_liquidity.svg
new file mode 100644
index 000000000..c402964aa
--- /dev/null
+++ b/packages/website/public/images/developers/tutorials/use_shared_liquidity.svg
@@ -0,0 +1,3 @@
+<svg width="70" height="74" viewBox="0 0 70 74" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M47.5152 52.7109C46.8864 53.3447 46.3452 54.0413 45.8772 54.7779L25.1416 42.092C25.69 40.7084 26.0008 39.2038 26.0008 37.6255C26.0008 36.0472 25.69 34.5426 25.1428 33.159L45.8832 20.5699C48.0132 23.9418 51.7475 26.1889 56.0002 26.1889C62.6169 26.1889 68 20.7634 68 14.0945C68 7.42558 62.6169 2 56.0002 2C49.3835 2 44.0004 7.42558 44.0004 14.0945C44.0004 15.6135 44.292 17.0625 44.8008 18.4025L24.0328 31.0086C21.8872 27.7141 18.1937 25.531 13.9998 25.531C7.3831 25.531 2 30.9566 2 37.6255C2 44.2944 7.3831 49.72 13.9998 49.72C18.1937 49.72 21.886 47.5369 24.0316 44.2424L44.796 56.9452C44.28 58.307 43.9992 59.762 43.9992 61.2629C43.9992 64.4934 45.2472 67.5315 47.514 69.8149C49.8527 72.1721 52.9259 73.3513 55.999 73.3513C59.0722 73.3513 62.1453 72.1721 64.4841 69.8149C66.7508 67.5303 67.9988 64.4934 67.9988 61.2629C67.9988 58.0325 66.7508 54.9944 64.4841 52.7109C59.8054 47.9941 52.1939 47.9941 47.5152 52.7109ZM56.0002 4.41889C61.2933 4.41889 65.6 8.7596 65.6 14.0945C65.6 19.4293 61.2933 23.7701 56.0002 23.7701C50.7071 23.7701 46.4004 19.4293 46.4004 14.0945C46.4004 8.7596 50.7059 4.41889 56.0002 4.41889ZM14.001 47.3011C8.70788 47.3011 4.40116 42.9604 4.40116 37.6255C4.40116 32.2906 8.70788 27.9499 14.001 27.9499C19.2941 27.9499 23.6008 32.2906 23.6008 37.6255C23.6008 42.9604 19.2941 47.3011 14.001 47.3011ZM62.7873 68.1048C59.0446 71.877 52.9547 71.877 49.2119 68.1048C47.3988 66.2773 46.4004 63.8463 46.4004 61.2629C46.4004 58.6795 47.3988 56.2486 49.2119 54.4211C51.0839 52.5343 53.5415 51.5922 56.0002 51.5922C58.459 51.5922 60.9165 52.5343 62.7885 54.4211C64.6017 56.2486 65.6 58.6795 65.6 61.2629C65.6 63.8463 64.6017 66.2773 62.7873 68.1048Z" fill="#3289F1" stroke="#3289F1" stroke-width="0.5"/>
+</svg>
diff --git a/packages/website/public/images/docs_logo.svg b/packages/website/public/images/docs_logo.svg
new file mode 100644
index 000000000..e3c4b628b
--- /dev/null
+++ b/packages/website/public/images/docs_logo.svg
@@ -0,0 +1,24 @@
+<svg width="278" height="72" viewBox="0 0 278 72" fill="none" xmlns="http://www.w3.org/2000/svg">
+<rect width="139" height="35.9999" fill="black" fill-opacity="0" transform="scale(2)"/>
+<rect width="74.0872" height="35.9999" fill="black" fill-opacity="0" transform="scale(2)"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M115.234 33.6875L105.219 40.5522C105.477 44.3244 107.146 46.2101 110.226 46.2101C113.565 46.2101 115.234 43.9618 115.234 39.4642V33.6875ZM105.176 36.8338L115.191 29.9691C115.076 28.0041 114.607 26.5499 113.783 25.6069C112.959 24.6642 111.759 24.1924 110.183 24.1924C108.507 24.1924 107.253 24.7398 106.422 25.8345C105.591 26.9293 105.176 28.6109 105.176 30.8789V36.8338ZM120.394 38.6336C120.394 40.4934 120.16 42.1322 119.695 43.5498C119.229 44.9677 118.559 46.1546 117.686 47.1106C116.812 48.067 115.744 48.7892 114.483 49.277C113.222 49.7647 111.804 50.0089 110.228 50.0089C108.666 50.0089 107.255 49.7647 105.994 49.277C104.733 48.7892 103.662 48.067 102.781 47.1106C101.9 46.1546 101.22 44.9677 100.74 43.5498C100.259 42.1322 100.02 40.4934 100.02 38.6336V31.7491C100.02 29.8895 100.256 28.2511 100.729 26.8332C101.202 25.4156 101.879 24.2285 102.76 23.2721C103.641 22.3161 104.708 21.5941 105.962 21.1059C107.215 20.6182 108.623 20.374 110.185 20.374C111.761 20.374 113.179 20.6182 114.44 21.1059C115.701 21.5941 116.772 22.3161 117.653 23.2721C118.535 24.2285 119.212 25.4156 119.684 26.8332C120.157 28.2511 120.394 29.8895 120.394 31.7491V38.6336Z" fill="black"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M137.01 35.3006L142.385 27.7822H147.925L139.968 38.7311L148.175 50.0084H142.655L137.073 42.2232L131.511 50.0084H125.949L134.156 38.7311L126.199 27.7822H131.719L137.01 35.3006Z" fill="black"/>
+<rect width="36" height="35.9999" fill="black" fill-opacity="0" transform="scale(2)"/>
+<rect width="22.5701" height="11.8348" fill="black" fill-opacity="0" transform="translate(18.0508 48.3301) scale(2)"/>
+<mask id="mask0" mask-type="alpha" maskUnits="userSpaceOnUse" x="18" y="48" width="46" height="24">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M18.0508 71.9997H63.191V48.3301H18.0508V71.9997Z" fill="white"/>
+</mask>
+<g mask="url(#mask0)">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M18.0508 67.1184C22.6601 69.8386 27.9385 71.5522 33.6161 71.9239C41.4577 72.4369 48.8759 70.3221 55.038 66.3361C58.1021 64.354 60.8534 61.9089 63.191 59.0905C61.2524 56.3622 59.1896 53.547 57.0111 50.6788L55.2311 48.3301C52.8884 52.0707 49.5201 55.0686 45.5555 56.9441L39.4742 50.9207L18.0508 67.1184Z" fill="black"/>
+</g>
+<rect width="11.6916" height="22.7346" fill="black" fill-opacity="0" transform="translate(0 18.6299) scale(2)"/>
+<mask id="mask1" mask-type="alpha" maskUnits="userSpaceOnUse" x="0" y="18" width="24" height="47">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M0 18.6299V64.099H23.3833V18.6299L0 18.6299Z" fill="white"/>
+</mask>
+<g mask="url(#mask1)">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M4.72039 18.6299C2.09283 23.2496 0.437543 28.5247 0.0749777 34.193C-0.432648 42.134 1.66198 49.6455 5.60982 55.8826C7.56303 58.9691 9.97065 61.7416 12.7445 64.099C15.4422 62.1375 18.2268 60.0505 21.0641 57.847L23.3833 56.0501C19.6922 53.6805 16.7332 50.2769 14.8817 46.271L20.8743 40.0586L4.72039 18.6299Z" fill="black"/>
+</g>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M54.0006 4.9803C49.4018 2.20541 44.1346 0.455949 38.4679 0.0772542C30.6434 -0.445638 23.2417 1.71125 17.096 5.77624C14.0546 7.78768 11.3231 10.2669 9 13.123C10.9328 15.9011 12.9892 18.7682 15.1602 21.69L16.9306 24.0783C19.2665 20.2759 22.622 17.2279 26.5714 15.3216L26.5759 15.3196L32.2882 21.07L54.0006 4.9803Z" fill="black"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M67.3574 53.7131C69.9376 49.2175 71.5681 44.0992 71.9269 38.5992C72.4342 30.8203 70.3437 23.4613 66.4027 17.3486C64.4432 14.3092 62.0259 11.58 59.2397 9.26074C56.5427 11.1839 53.7595 13.2301 50.9238 15.3915L48.6016 17.1569C52.3061 19.4848 55.2749 22.8335 57.1283 26.7755L57.1639 26.8575L51.3951 32.7948L67.3574 53.7131Z" fill="black"/>
+<path d="M164.041 38.1836C164.041 34.6172 164.886 31.7526 166.576 29.5898C168.266 27.4128 170.479 26.3242 173.215 26.3242C175.936 26.3242 178.092 27.2552 179.682 29.1172V17H183.656V50H180.004L179.811 47.5078C178.221 49.4557 176.008 50.4297 173.172 50.4297C170.479 50.4297 168.281 49.3268 166.576 47.1211C164.886 44.9154 164.041 42.0365 164.041 38.4844V38.1836ZM168.016 38.6348C168.016 41.2702 168.56 43.3327 169.648 44.8223C170.737 46.3118 172.241 47.0566 174.16 47.0566C176.681 47.0566 178.521 45.9251 179.682 43.6621V32.9844C178.493 30.793 176.667 29.6973 174.203 29.6973C172.255 29.6973 170.737 30.4492 169.648 31.9531C168.56 33.457 168.016 35.6842 168.016 38.6348ZM188.791 38.1621C188.791 35.8848 189.235 33.8366 190.123 32.0176C191.025 30.1986 192.271 28.7949 193.861 27.8066C195.465 26.8184 197.292 26.3242 199.34 26.3242C202.505 26.3242 205.062 27.4199 207.01 29.6113C208.972 31.8027 209.953 34.7174 209.953 38.3555V38.6348C209.953 40.8978 209.516 42.9316 208.643 44.7363C207.783 46.5267 206.544 47.9232 204.926 48.9258C203.322 49.9284 201.474 50.4297 199.383 50.4297C196.232 50.4297 193.675 49.334 191.713 47.1426C189.765 44.9512 188.791 42.0508 188.791 38.4414V38.1621ZM192.787 38.6348C192.787 41.2129 193.382 43.2826 194.57 44.8438C195.773 46.4049 197.378 47.1855 199.383 47.1855C201.402 47.1855 203.007 46.3978 204.195 44.8223C205.384 43.2324 205.979 41.0124 205.979 38.1621C205.979 35.6126 205.37 33.5501 204.152 31.9746C202.949 30.3848 201.345 29.5898 199.34 29.5898C197.378 29.5898 195.795 30.3704 194.592 31.9316C193.389 33.4928 192.787 35.7272 192.787 38.6348ZM224.262 47.1855C225.68 47.1855 226.919 46.7559 227.979 45.8965C229.038 45.0371 229.626 43.9629 229.74 42.6738H233.5C233.428 44.0059 232.97 45.2734 232.125 46.4766C231.28 47.6797 230.148 48.6393 228.73 49.3555C227.327 50.0716 225.837 50.4297 224.262 50.4297C221.096 50.4297 218.576 49.377 216.699 47.2715C214.837 45.1517 213.906 42.2585 213.906 38.5918V37.9258C213.906 35.6628 214.322 33.6504 215.152 31.8887C215.983 30.127 217.172 28.7591 218.719 27.7852C220.28 26.8112 222.12 26.3242 224.24 26.3242C226.847 26.3242 229.01 27.1048 230.729 28.666C232.462 30.2272 233.385 32.2539 233.5 34.7461H229.74C229.626 33.2422 229.053 32.0104 228.021 31.0508C227.005 30.0768 225.744 29.5898 224.24 29.5898C222.221 29.5898 220.652 30.3203 219.535 31.7812C218.432 33.2279 217.881 35.3262 217.881 38.0762V38.8281C217.881 41.5065 218.432 43.569 219.535 45.0156C220.638 46.4622 222.214 47.1855 224.262 47.1855ZM251.504 43.834C251.504 42.7598 251.096 41.929 250.279 41.3418C249.477 40.7402 248.066 40.2246 246.047 39.7949C244.042 39.3652 242.445 38.8496 241.256 38.248C240.081 37.6465 239.208 36.9303 238.635 36.0996C238.076 35.2689 237.797 34.2806 237.797 33.1348C237.797 31.2298 238.599 29.6185 240.203 28.3008C241.822 26.9831 243.884 26.3242 246.391 26.3242C249.026 26.3242 251.16 27.0046 252.793 28.3652C254.44 29.7259 255.264 31.4661 255.264 33.5859H251.268C251.268 32.4974 250.802 31.5592 249.871 30.7715C248.954 29.9837 247.794 29.5898 246.391 29.5898C244.944 29.5898 243.812 29.9049 242.996 30.5352C242.18 31.1654 241.771 31.9889 241.771 33.0059C241.771 33.9655 242.151 34.6888 242.91 35.1758C243.669 35.6628 245.037 36.1283 247.014 36.5723C249.005 37.0163 250.616 37.5462 251.848 38.1621C253.079 38.778 253.989 39.5228 254.576 40.3965C255.178 41.2559 255.479 42.3086 255.479 43.5547C255.479 45.6315 254.648 47.3001 252.986 48.5605C251.325 49.8066 249.169 50.4297 246.52 50.4297C244.658 50.4297 243.01 50.1003 241.578 49.4414C240.146 48.7826 239.021 47.8659 238.205 46.6914C237.403 45.5026 237.002 44.2207 237.002 42.8457H240.977C241.048 44.1777 241.578 45.2376 242.566 46.0254C243.569 46.7988 244.887 47.1855 246.52 47.1855C248.023 47.1855 249.227 46.8848 250.129 46.2832C251.046 45.6673 251.504 44.8509 251.504 43.834Z" fill="#666666"/>
+</svg>
diff --git a/packages/website/public/images/landing/0x_homepage.svg b/packages/website/public/images/landing/0x_homepage.svg
index 061ac8939..d2ccef8f4 100644
--- a/packages/website/public/images/landing/0x_homepage.svg
+++ b/packages/website/public/images/landing/0x_homepage.svg
@@ -1,24 +1,18 @@
<svg width="410" height="254" viewBox="0 0 410 254" fill="none" xmlns="http://www.w3.org/2000/svg">
-<rect width="410" height="254" fill="black" fill-opacity="0"/>
-<rect width="410" height="254" fill="black" fill-opacity="0"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M409.979 122.524C410.195 134.531 408.758 137.636 404.251 140.251L210.864 252.464C207.334 254.512 202.985 254.512 199.455 252.464L6.06657 140.251C1.55911 137.635 -1.2295 135.189 0.536218 121.797L409.979 122.524Z" fill="#D0CAFF"/>
-<rect width="98.1672" height="56.8942" fill="black" fill-opacity="0" transform="translate(87.1703 125.679)"/>
<path d="M178.097 125.679L87.1703 178.372" stroke="#C4AED9" stroke-width="1.32046" stroke-linecap="round"/>
<path d="M181.659 127.746L90.732 180.439" stroke="#C4AED9" stroke-width="1.32046" stroke-linecap="round"/>
<path d="M185.338 129.88L94.41 182.573" stroke="#C4AED9" stroke-width="1.32046" stroke-linecap="round"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M199.455 245.823L6.06657 133.61C-1.53963 129.196 -1.53963 118.163 6.06657 113.749L199.453 1.53604C202.984 -0.512014 207.333 -0.512014 210.863 1.53604L404.251 113.75C411.858 118.163 411.858 129.197 404.251 133.611L210.864 245.823C207.334 247.871 202.985 247.871 199.455 245.823Z" fill="#F0EEFF"/>
-<rect width="107.203" height="36.2243" fill="black" fill-opacity="0" transform="translate(79.7358 74.3805)"/>
<path d="M79.7358 107.066L133.382 75.8612C136.304 73.965 139.326 73.974 141.767 75.4102L186.939 101.973" stroke="#DBDBFF" stroke-width="1.32046" stroke-linecap="round"/>
<path d="M82.4662 108.801L134.79 78.5156C136.798 77.3507 139.273 77.3583 141.274 78.5356L184.001 103.681" stroke="#DBDBFF" stroke-width="1.32046" stroke-linecap="round"/>
<path d="M85.1381 110.605L134.534 82.5144C136.541 81.3495 139.017 81.3571 141.017 82.5348L180.403 105.714" stroke="#DBDBFF" stroke-width="1.32046" stroke-linecap="round"/>
-<rect width="100.727" height="37.9813" fill="black" fill-opacity="0" transform="translate(226.643 123.734)"/>
-<path d="M327.37 126.923L270.289 160.234C267.367 162.131 264.345 162.121 261.903 160.685L226.643 140.288" stroke="#DBDBFF" stroke-width="1.32046" stroke-linecap="round"/>
-<path d="M323.336 125.886L268.881 157.58C266.873 158.745 264.398 158.737 262.397 157.56L229.58 138.58" stroke="#DBDBFF" stroke-width="1.32046" stroke-linecap="round"/>
-<path d="M319.925 123.734L269.137 153.581C267.129 154.746 264.654 154.739 262.653 153.561L233.178 136.547" stroke="#DBDBFF" stroke-width="1.32046" stroke-linecap="round"/>
-<path fill-rule="evenodd" clip-rule="evenodd" d="M322.112 124.6C313.477 119.589 313.477 111.465 322.112 106.454C330.747 101.444 344.748 101.444 353.383 106.454C362.018 111.465 362.018 119.589 353.383 124.6C344.748 129.611 330.747 129.611 322.112 124.6Z" stroke="#DBDBFF" stroke-width="2"/>
-<path fill-rule="evenodd" clip-rule="evenodd" d="M50.8048 126.749C42.1698 121.739 42.1698 113.614 50.8048 108.604C59.4403 103.593 73.4409 103.593 82.0764 108.604C90.7115 113.614 90.7115 121.739 82.0764 126.749C73.4409 131.76 59.4403 131.76 50.8048 126.749Z" stroke="#DBDBFF" stroke-width="2"/>
+<path d="M330.5 124L270.289 160.234C267.367 162.131 264.345 162.121 261.903 160.685L226.643 140.288" stroke="#DBDBFF" stroke-width="1.32046" stroke-linecap="round"/>
+<path d="M325.5 123.5L268.881 157.58C266.873 158.745 264.398 158.737 262.397 157.56L229.58 138.58" stroke="#DBDBFF" stroke-width="1.32046" stroke-linecap="round"/>
+<path d="M322.5 122L269.137 153.581C267.129 154.746 264.654 154.739 262.653 153.561L233.178 136.547" stroke="#DBDBFF" stroke-width="1.32046" stroke-linecap="round"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M323.711 121.778C316.096 117.482 316.096 110.517 323.711 106.222C331.327 101.926 343.673 101.926 351.289 106.222C358.904 110.517 358.904 117.482 351.289 121.778C343.673 126.074 331.327 126.074 323.711 121.778Z" stroke="#DBDBFF" stroke-width="2"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M52.7112 125.924C45.0963 121.824 45.0963 115.176 52.7112 111.075C60.3266 106.975 72.6734 106.975 80.2888 111.075C87.9038 115.176 87.9038 121.824 80.2888 125.924C72.6734 130.025 60.3266 130.025 52.7112 125.924Z" stroke="#DBDBFF" stroke-width="2"/>
<g opacity="0.372566">
-<rect width="34.2587" height="23.7724" fill="black" fill-opacity="0" transform="translate(169.644 179.583)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M171.171 194.759L170.656 194.461C170.619 194.439 170.596 194.399 170.596 194.357V192.616C170.596 192.524 170.695 192.466 170.775 192.513L171.29 192.811C171.327 192.833 171.35 192.872 171.35 192.915V194.655C171.35 194.748 171.251 194.805 171.171 194.759Z" fill="#8C87C4"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M172.622 195.59L172.107 195.291C172.07 195.269 172.047 195.23 172.047 195.187V193.447C172.047 193.354 172.146 193.297 172.226 193.343L172.741 193.642C172.778 193.663 172.801 193.703 172.801 193.745V195.486C172.801 195.578 172.702 195.635 172.622 195.59Z" fill="#8C87C4"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M174.073 196.42L173.558 196.122C173.521 196.1 173.499 196.06 173.499 196.018V194.277C173.499 194.185 173.598 194.127 173.677 194.174L174.192 194.472C174.23 194.494 174.252 194.533 174.252 194.576V196.316C174.252 196.409 174.153 196.466 174.073 196.42Z" fill="#8C87C4"/>
@@ -56,7 +50,6 @@
<path fill-rule="evenodd" clip-rule="evenodd" d="M288.178 149.398C288.178 152.004 286.076 154.116 283.483 154.116C280.891 154.116 278.789 152.004 278.789 149.398C278.789 146.792 280.891 144.68 283.483 144.68C286.076 144.68 288.178 146.792 288.178 149.398Z" fill="#8CB6FF"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M302.505 141.805C302.505 144.411 300.403 146.523 297.811 146.523C295.218 146.523 293.116 144.411 293.116 141.805C293.116 139.199 295.218 137.087 297.811 137.087C300.403 137.087 302.505 139.199 302.505 141.805Z" fill="#8CB6FF"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M315.374 133.208C315.374 135.813 313.272 137.926 310.679 137.926C308.086 137.926 305.984 135.813 305.984 133.208C305.984 130.602 308.086 128.489 310.679 128.489C313.272 128.489 315.374 130.602 315.374 133.208Z" fill="#8CB6FF"/>
-<rect width="94.7557" height="54.8453" fill="black" fill-opacity="0" transform="translate(89.638 130.896)"/>
<path d="M177.154 130.896L89.638 182.735" stroke="#DBDBFF" stroke-width="1.32046" stroke-linecap="round"/>
<path d="M180.715 132.963L93.2464 184.097" stroke="#DBDBFF" stroke-width="1.32046" stroke-linecap="round"/>
<path d="M184.394 135.097L96.4554 185.742" stroke="#DBDBFF" stroke-width="1.32046" stroke-linecap="round"/>
@@ -89,7 +82,6 @@
<path fill-rule="evenodd" clip-rule="evenodd" d="M230.792 106.981C229.705 104.573 227.673 102.272 224.657 100.277C220.492 97.5232 215.09 95.7649 209.349 95.0321C206.508 94.6693 203.586 94.5587 200.688 94.7034C200.256 96.2311 199.844 97.8272 199.468 99.4797C199.366 99.9231 199.271 100.376 199.175 100.826C202.597 100.386 206.182 100.522 209.476 101.217L209.48 101.218L209.558 104.945L230.792 106.981Z" fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M210.774 127.184C214.812 126.542 218.668 125.381 222.022 123.674C226.764 121.26 229.793 118.129 231.057 114.802C231.686 113.147 231.878 111.444 231.626 109.757C228.994 109.506 226.244 109.268 223.397 109.051C222.632 108.992 221.851 108.936 221.073 108.881C221.837 110.871 221.602 112.957 220.398 114.873L220.371 114.912L213.699 114.981L210.774 127.184Z" fill="white"/>
<g opacity="0.372566">
-<rect width="57.1535" height="39.6589" fill="black" fill-opacity="0" transform="translate(180.849 191.194)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M183.395 216.512L182.537 216.014C182.475 215.978 182.437 215.912 182.437 215.842V212.937C182.437 212.784 182.603 212.687 182.735 212.764L183.593 213.262C183.655 213.298 183.693 213.364 183.693 213.435V216.34C183.693 216.493 183.527 216.589 183.395 216.512Z" fill="#8C87C4"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M185.816 217.898L184.958 217.399C184.896 217.364 184.858 217.298 184.858 217.227V214.323C184.858 214.169 185.024 214.073 185.156 214.15L186.014 214.648C186.076 214.683 186.114 214.75 186.114 214.821V217.725C186.114 217.879 185.948 217.974 185.816 217.898Z" fill="#8C87C4"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M188.237 219.284L187.379 218.785C187.317 218.75 187.279 218.684 187.279 218.613V215.709C187.279 215.555 187.445 215.459 187.577 215.536L188.435 216.034C188.497 216.069 188.535 216.135 188.535 216.207V219.111C188.535 219.264 188.369 219.36 188.237 219.284Z" fill="#8C87C4"/>
@@ -116,7 +108,6 @@
<path fill-rule="evenodd" clip-rule="evenodd" d="M208.63 225.495L181.646 209.837C180.584 209.221 180.584 207.682 181.646 207.065L208.63 191.408C209.123 191.122 209.73 191.122 210.222 191.408L237.207 207.065C238.268 207.682 238.268 209.221 237.207 209.837L210.222 225.495C209.73 225.781 209.123 225.781 208.63 225.495Z" fill="#A59EF7"/>
</g>
<g opacity="0.327785">
-<rect width="73.5288" height="51.0612" fill="black" fill-opacity="0" transform="translate(200.318 30.1121)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M203.593 62.7101L202.489 62.0689C202.41 62.0228 202.361 61.9378 202.361 61.8468V58.1075C202.361 57.9094 202.574 57.7857 202.744 57.8848L203.848 58.5259C203.927 58.5721 203.976 58.657 203.976 58.7487V62.4879C203.976 62.6855 203.763 62.8085 203.593 62.7101Z" fill="#8C87C4"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M206.707 64.4942L205.603 63.8524C205.524 63.8069 205.475 63.722 205.475 63.6303V59.8916C205.475 59.6935 205.688 59.5698 205.858 59.6689L206.963 60.31C207.042 60.3556 207.09 60.4411 207.09 60.5328V64.2721C207.09 64.4696 206.878 64.5926 206.707 64.4942Z" fill="#8C87C4"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M209.822 66.2782L208.718 65.6365C208.638 65.5909 208.59 65.506 208.59 65.4143V61.6757C208.59 61.4775 208.803 61.3539 208.973 61.4529L210.077 62.0941C210.156 62.1396 210.205 62.2245 210.205 62.3168V66.0555C210.205 66.253 209.992 66.3767 209.822 66.2782Z" fill="#8C87C4"/>
@@ -143,11 +134,10 @@
<path fill-rule="evenodd" clip-rule="evenodd" d="M236.058 74.2755L201.342 54.1153C199.977 53.3227 199.977 51.3408 201.342 50.547L236.058 30.388C236.692 30.0201 237.473 30.0201 238.107 30.388L272.823 50.547C274.188 51.3408 274.188 53.3227 272.823 54.1153L238.107 74.2755C237.473 74.6435 236.692 74.6435 236.058 74.2755Z" fill="#A59EF7"/>
</g>
<g opacity="0.120697">
-<rect width="28.3611" height="20.2117" fill="black" fill-opacity="0" transform="translate(79.9083 149.104)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M81.1767 162.008L80.746 161.754C80.7152 161.736 80.6961 161.702 80.6961 161.666V160.186C80.6961 160.107 80.7792 160.058 80.8455 160.098L81.2762 160.351C81.3072 160.37 81.3261 160.403 81.3261 160.44V161.92C81.3261 161.998 81.243 162.047 81.1767 162.008Z" fill="#8C87C4"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M82.3781 162.714L81.9474 162.46C81.9166 162.442 81.8975 162.408 81.8975 162.372V160.892C81.8975 160.814 81.9806 160.765 82.0469 160.804L82.4776 161.058C82.5084 161.076 82.5275 161.11 82.5275 161.146V162.626C82.5275 162.704 82.4444 162.753 82.3781 162.714Z" fill="#8C87C4"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M83.5795 163.42L83.1488 163.166C83.1178 163.148 83.0989 163.114 83.0989 163.078V161.598C83.0989 161.52 83.182 161.471 83.2483 161.51L83.679 161.764C83.7098 161.782 83.7288 161.815 83.7288 161.852V163.332C83.7288 163.41 83.6458 163.459 83.5795 163.42Z" fill="#8C87C4"/>
-<path fill-rule="evenodd" clip-rule="evenodd" d="M84.7809 164.126L84.3502 163.872C84.3191 163.854 84.3003 163.821 84.3003 163.784V162.304C84.3003 162.226 84.3833 162.177 84.4497 162.216L84.8804 162.47C84.9111 162.488 84.9302 162.522 84.9302 162.558V164.038C84.9302 164.116 84.8472 164.165 84.7809 164.126Z" fill="#8C87C4"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M84.7808 164.126L84.3502 163.872C84.3191 163.854 84.3003 163.821 84.3003 163.784V162.304C84.3003 162.226 84.3833 162.177 84.4497 162.216L84.8803 162.47C84.9111 162.488 84.9302 162.522 84.9302 162.558V164.038C84.9302 164.116 84.8472 164.165 84.7808 164.126Z" fill="#8C87C4"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M85.9823 164.832L85.5516 164.578C85.5205 164.56 85.5017 164.527 85.5017 164.49V163.01C85.5017 162.932 85.5847 162.883 85.6511 162.922L86.0817 163.176C86.1125 163.194 86.1316 163.228 86.1316 163.264V164.744C86.1316 164.822 86.0486 164.871 85.9823 164.832Z" fill="#8C87C4"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M87.1837 165.538L86.753 165.285C86.7219 165.266 86.7031 165.233 86.7031 165.196V163.717C86.7031 163.638 86.7861 163.589 86.8525 163.628L87.2832 163.882C87.3139 163.9 87.333 163.934 87.333 163.97V165.45C87.333 165.529 87.25 165.577 87.1837 165.538Z" fill="#8C87C4"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M88.385 166.245L87.9543 165.991C87.9233 165.972 87.9045 165.939 87.9045 165.903V164.423C87.9045 164.344 87.9875 164.295 88.0538 164.335L88.4845 164.588C88.5153 164.606 88.5344 164.64 88.5344 164.676V166.157C88.5344 166.235 88.4514 166.284 88.385 166.245Z" fill="#8C87C4"/>
@@ -170,7 +160,6 @@
<path fill-rule="evenodd" clip-rule="evenodd" d="M93.6938 166.586L80.3033 158.606C79.7767 158.292 79.7767 157.507 80.3033 157.193L93.6938 149.214C93.9383 149.068 94.2394 149.068 94.4839 149.214L107.874 157.193C108.401 157.507 108.401 158.292 107.874 158.606L94.4839 166.586C94.2396 166.731 93.9383 166.731 93.6938 166.586Z" fill="#A59EF7"/>
</g>
<g opacity="0.120697">
-<rect width="28.3611" height="20.2117" fill="black" fill-opacity="0" transform="translate(99.2107 137.283)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M100.479 150.186L100.048 149.932C100.018 149.914 99.9986 149.88 99.9986 149.844V148.364C99.9986 148.286 100.082 148.237 100.148 148.276L100.579 148.53C100.61 148.548 100.629 148.582 100.629 148.618V150.098C100.629 150.176 100.545 150.225 100.479 150.186Z" fill="#8C87C4"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M101.681 150.892L101.25 150.638C101.219 150.62 101.2 150.587 101.2 150.55V149.07C101.2 148.992 101.283 148.943 101.349 148.982L101.78 149.236C101.811 149.254 101.83 149.288 101.83 149.324V150.804C101.83 150.882 101.747 150.931 101.681 150.892Z" fill="#8C87C4"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M102.882 151.598L102.451 151.344C102.42 151.326 102.401 151.293 102.401 151.256V149.777C102.401 149.698 102.484 149.649 102.551 149.688L102.981 149.942C103.012 149.96 103.031 149.994 103.031 150.03V151.51C103.031 151.588 102.948 151.637 102.882 151.598Z" fill="#8C87C4"/>
@@ -197,7 +186,6 @@
<path fill-rule="evenodd" clip-rule="evenodd" d="M112.996 154.764L99.6058 146.784C99.0791 146.47 99.0791 145.686 99.6058 145.371L112.996 137.392C113.241 137.246 113.542 137.246 113.786 137.392L127.177 145.371C127.703 145.686 127.703 146.47 127.177 146.784L113.786 154.764C113.542 154.91 113.241 154.91 112.996 154.764Z" fill="#A59EF7"/>
</g>
<g opacity="0.120697">
-<rect width="28.3611" height="20.2117" fill="black" fill-opacity="0" transform="translate(268.643 57.7552)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M269.912 70.6586L269.481 70.4048C269.45 70.3865 269.431 70.3529 269.431 70.3169V68.8367C269.431 68.7583 269.514 68.7093 269.581 68.7486L270.011 69.0024C270.042 69.0206 270.061 69.0542 270.061 69.0905V70.5707C270.061 70.6488 269.978 70.6975 269.912 70.6586Z" fill="#8C87C4"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M271.113 71.3648L270.683 71.1108C270.652 71.0927 270.633 71.0591 270.633 71.0228V69.5429C270.633 69.4645 270.716 69.4156 270.782 69.4548L271.213 69.7086C271.243 69.7266 271.263 69.7604 271.263 69.7967V71.2769C271.263 71.355 271.18 71.4038 271.113 71.3648Z" fill="#8C87C4"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M272.315 72.071L271.884 71.8169C271.853 71.7989 271.834 71.7653 271.834 71.729V70.2491C271.834 70.1707 271.917 70.1217 271.983 70.161L272.414 70.4147C272.445 70.4328 272.464 70.4664 272.464 70.5029V71.9828C272.464 72.061 272.381 72.1099 272.315 72.071Z" fill="#8C87C4"/>
@@ -224,7 +212,6 @@
<path fill-rule="evenodd" clip-rule="evenodd" d="M282.429 75.2366L269.038 67.2565C268.512 66.9428 268.512 66.1582 269.038 65.844L282.429 57.8644C282.673 57.7188 282.974 57.7188 283.219 57.8644L296.609 65.844C297.136 66.1582 297.136 66.9428 296.609 67.2565L283.219 75.2366C282.975 75.3822 282.673 75.3822 282.429 75.2366Z" fill="#A59EF7"/>
</g>
<g opacity="0.327785">
-<rect width="49.9817" height="34.933" fill="black" fill-opacity="0" transform="translate(180.671 11.4867)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M182.898 33.788L182.147 33.3494C182.093 33.3176 182.06 33.2598 182.06 33.1975V30.6391C182.06 30.5041 182.205 30.4195 182.32 30.4867L183.071 30.9253C183.125 30.957 183.158 31.0149 183.158 31.0784V33.6362C183.158 33.7712 183.013 33.8552 182.898 33.788Z" fill="#8C87C4"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M185.015 35.0087L184.264 34.57C184.21 34.5383 184.177 34.4798 184.177 34.4176V31.8592C184.177 31.7248 184.322 31.6395 184.438 31.7073L185.188 32.146C185.242 32.1777 185.275 32.2356 185.275 32.2984V34.8562C185.275 34.9919 185.13 35.0759 185.015 35.0087Z" fill="#8C87C4"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M187.132 36.2287L186.381 35.7901C186.327 35.759 186.295 35.7005 186.295 35.6383V33.0798C186.295 32.9448 186.439 32.8602 186.555 32.9274L187.306 33.3667C187.359 33.3978 187.392 33.4563 187.392 33.5191V36.0769C187.392 36.2119 187.247 36.2966 187.132 36.2287Z" fill="#8C87C4"/>
@@ -251,7 +238,6 @@
<path fill-rule="evenodd" clip-rule="evenodd" d="M204.966 41.7003L181.368 27.9082C180.439 27.3656 180.439 26.0092 181.368 25.4673L204.966 11.6752C205.397 11.4238 205.927 11.4238 206.358 11.6752L229.957 25.4673C230.885 26.0099 230.885 27.3656 229.957 27.9082L206.358 41.7003C205.927 41.9517 205.397 41.9517 204.966 41.7003Z" fill="#A59EF7"/>
</g>
<g opacity="0.327785">
-<rect width="34.9717" height="24.8959" fill="black" fill-opacity="0" transform="translate(167.802 36.5651)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M169.36 52.459L168.834 52.1463C168.797 52.1237 168.774 52.0822 168.774 52.0375V50.215C168.774 50.1181 168.875 50.0584 168.956 50.1062L169.482 50.4188C169.52 50.4415 169.543 50.4824 169.543 50.5277V52.3501C169.543 52.4464 169.442 52.5068 169.36 52.459Z" fill="#8C87C4"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M170.842 53.3282L170.316 53.0156C170.278 52.9936 170.255 52.952 170.255 52.9074V51.0849C170.255 50.988 170.357 50.9283 170.437 50.9761L170.963 51.2887C171.001 51.3108 171.024 51.3523 171.024 51.3976V53.22C171.024 53.3163 170.923 53.3767 170.842 53.3282Z" fill="#8C87C4"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M172.323 54.1982L171.797 53.8855C171.76 53.8635 171.737 53.822 171.737 53.7773V51.9542C171.737 51.8573 171.838 51.7976 171.919 51.846L172.445 52.1586C172.483 52.1807 172.505 52.2222 172.505 52.2669V54.09C172.505 54.1862 172.405 54.2466 172.323 54.1982Z" fill="#8C87C4"/>
@@ -277,109 +263,78 @@
<path fill-rule="evenodd" clip-rule="evenodd" d="M167.808 47.5141L167.819 49.6951C167.747 50.0902 167.904 50.5224 168.289 50.7514L184.801 60.5809C185.102 60.7608 185.474 60.7608 185.775 60.5809L202.286 50.752C202.671 50.523 202.828 50.0902 202.757 49.6951L202.768 47.5141" fill="#8B81E6"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M184.801 58.0974L168.289 48.2686C167.64 47.8817 167.64 46.9154 168.289 46.5285L184.801 36.6996C185.102 36.5203 185.473 36.5203 185.775 36.6996L202.287 46.5285C202.936 46.9154 202.936 47.8823 202.287 48.2686L185.775 58.0974C185.474 58.2767 185.102 58.2767 184.801 58.0974Z" fill="#A59EF7"/>
</g>
-<rect width="29.9899" height="49.737" fill="black" fill-opacity="0" transform="translate(189.659 18.6826)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M189.659 43.6672L204.642 52.5638V18.6826L189.659 43.6672Z" fill="#6659FF"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M204.672 18.6826V52.5638L219.649 43.6672L204.672 18.6826Z" fill="#5135E6"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M189.659 46.6247L204.861 68.4196L204.642 55.5213L189.659 46.6247Z" fill="#6659FF"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M204.672 54.7454L204.917 67.4584L219.482 45.55L204.672 54.7454Z" fill="#4259DB"/>
-<rect width="37.5326" height="24.718" fill="black" fill-opacity="0" transform="translate(318.852 99.4725)"/>
-<rect width="37.5326" height="24.2005" fill="black" fill-opacity="0" transform="translate(318.852 99.4725)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M350.888 120.595C343.56 124.699 331.678 124.699 324.349 120.595C317.02 116.492 317.02 109.838 324.349 105.734C331.677 101.631 343.56 101.631 350.888 105.735C358.217 109.838 358.217 116.492 350.888 120.595Z" fill="#7F95EF"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M318.852 112.846H356.385V109.662H318.852V112.846Z" fill="#838DB7"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M350.888 117.411C343.56 121.515 331.678 121.515 324.349 117.411C317.02 113.307 317.02 106.654 324.349 102.55C331.677 98.4465 343.56 98.4465 350.888 102.55C358.217 106.654 358.217 113.307 350.888 117.411Z" fill="#93A8FF"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M326.211 115.967C319.911 112.485 319.911 106.839 326.211 103.358C332.511 99.8757 342.726 99.8757 349.026 103.358C355.326 106.84 355.326 112.485 349.026 115.967C342.726 119.449 332.511 119.449 326.211 115.967Z" fill="#9ABFFF"/>
<g opacity="0.370867">
-<rect width="19.296" height="11.091" fill="black" fill-opacity="0" transform="translate(327.431 104.017)"/>
<g opacity="0.653363">
-<rect width="14.9457" height="5.18221" fill="black" fill-opacity="0" transform="translate(327.431 109.926)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M342.161 110.157C342.497 110.398 342.355 110.571 342.298 110.734C341.315 113.539 336.078 115.549 331.129 115.025C328.909 114.79 327.621 114.016 327.452 112.816C327.266 111.493 328.324 110.596 330.572 110.173C331.906 109.922 333.285 109.901 334.667 109.943C337.204 110.021 339.711 110.353 342.161 110.157Z" fill="#4562DF"/>
</g>
<g opacity="0.653363">
-<rect width="14.909" height="5.19137" fill="black" fill-opacity="0" transform="translate(331.818 104.017)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M331.818 108.942C332.063 106.358 336.216 104.162 340.869 104.029C341.632 104.007 342.397 104.01 343.152 104.108C345.409 104.4 346.637 105.208 346.723 106.465C346.805 107.672 345.734 108.521 343.592 108.934C342.419 109.16 341.201 109.235 339.972 109.201C337.284 109.128 334.63 108.791 331.818 108.942Z" fill="#4562DF"/>
</g>
</g>
-<rect width="37.5326" height="24.718" fill="black" fill-opacity="0" transform="translate(318.852 95.1737)"/>
-<rect width="37.5326" height="24.2005" fill="black" fill-opacity="0" transform="translate(318.852 95.1737)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M350.888 116.296C343.56 120.4 331.678 120.4 324.349 116.296C317.02 112.193 317.02 105.539 324.349 101.436C331.677 97.332 343.56 97.332 350.888 101.436C358.217 105.539 358.217 112.193 350.888 116.296Z" fill="#7F95EF"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M318.852 108.548H356.385V105.363H318.852V108.548Z" fill="#838DB7"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M350.888 113.112C343.56 117.216 331.678 117.216 324.349 113.112C317.02 109.008 317.02 102.355 324.349 98.2514C331.677 94.1478 343.56 94.1478 350.888 98.2515C358.217 102.355 358.217 109.009 350.888 113.112Z" fill="#93A8FF"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M326.211 111.668C319.911 108.186 319.911 102.541 326.211 99.0588C332.511 95.5769 342.726 95.5769 349.026 99.0588C355.326 102.541 355.326 108.186 349.026 111.668C342.726 115.15 332.511 115.15 326.211 111.668Z" fill="#9ABFFF"/>
<g opacity="0.370867">
-<rect width="19.296" height="11.091" fill="black" fill-opacity="0" transform="translate(327.431 99.7187)"/>
<g opacity="0.653363">
-<rect width="14.9457" height="5.18221" fill="black" fill-opacity="0" transform="translate(327.431 105.627)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M342.161 105.859C342.497 106.1 342.355 106.272 342.298 106.435C341.315 109.24 336.078 111.251 331.129 110.726C328.909 110.491 327.621 109.717 327.452 108.517C327.266 107.194 328.324 106.297 330.572 105.874C331.906 105.624 333.285 105.603 334.667 105.644C337.204 105.722 339.711 106.054 342.161 105.859Z" fill="#4562DF"/>
</g>
<g opacity="0.653363">
-<rect width="14.909" height="5.19137" fill="black" fill-opacity="0" transform="translate(331.818 99.7187)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M331.818 104.643C332.063 102.059 336.216 99.8633 340.869 99.7298C341.632 99.7079 342.397 99.7109 343.152 99.8089C345.409 100.102 346.637 100.909 346.723 102.166C346.805 103.373 345.734 104.222 343.592 104.635C342.419 104.861 341.201 104.936 339.972 104.903C337.284 104.829 334.63 104.492 331.818 104.643Z" fill="#4562DF"/>
</g>
</g>
-<rect width="37.5326" height="24.718" fill="black" fill-opacity="0" transform="translate(47.5456 103.771)"/>
-<rect width="37.5326" height="24.2005" fill="black" fill-opacity="0" transform="translate(47.5456 103.771)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M79.5817 124.894C72.253 128.998 60.3709 128.998 53.0422 124.894C45.7135 120.79 45.7134 114.137 53.0421 110.033C60.3708 105.93 72.2529 105.93 79.5816 110.033C86.9103 114.137 86.9104 120.79 79.5817 124.894Z" fill="#61C9A7"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M47.5456 117.145H85.0782V113.961H47.5456V117.145Z" fill="#61C9A7"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M53.0422 121.71C45.7135 117.606 45.7134 110.953 53.0421 106.849C60.3708 102.745 72.2529 102.745 79.5816 106.849C86.9103 110.953 86.9104 117.606 79.5817 121.71C72.253 125.813 60.3709 125.813 53.0422 121.71Z" fill="#86F7D1"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M54.9046 120.265C48.6045 116.784 48.6044 111.138 54.9046 107.656C61.2046 104.174 71.4191 104.174 77.7192 107.656C84.0193 111.138 84.0194 116.784 77.7193 120.266C71.4192 123.747 61.2047 123.747 54.9046 120.265Z" fill="#95FFDA"/>
-<rect width="26.809" height="10.7469" fill="black" fill-opacity="0" transform="translate(52.9074 109.145)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M78.1519 112.724C78.1579 112.71 78.1629 112.697 78.1681 112.684C78.1741 112.687 78.1793 112.69 78.1852 112.692L78.2281 112.712L78.1519 112.724ZM75.2505 115.293C74.8038 115.693 74.3155 116.07 73.7899 116.421C73.5585 116.576 73.3192 116.726 73.0736 116.871C71.4102 116.816 70.5534 116.576 70.1138 116.331C69.5898 116.039 69.6552 115.742 69.6552 115.742C69.6552 115.702 69.6552 115.662 69.6711 115.622C69.6711 115.622 69.6791 115.586 69.7054 115.531C69.7421 115.454 69.8139 115.34 69.9495 115.225C70.1816 115.027 70.6037 114.83 71.3568 114.828H71.3703C71.5698 114.824 71.7692 114.842 71.9367 114.886C72.7345 115.083 72.216 115.45 72.216 115.45C72.2758 115.446 72.3364 115.44 72.3978 115.433C73.3567 115.315 74.4376 114.814 74.2502 113.976C74.2079 113.785 74.0682 113.615 73.8744 113.464C73.3862 113.083 72.5533 112.83 72.0795 112.708C71.8632 112.653 71.7213 112.625 71.7213 112.625C71.7452 112.557 71.7532 112.504 71.7532 112.464C71.7532 112.456 71.7532 112.449 71.7515 112.442C71.7476 112.377 71.7213 112.352 71.7213 112.352C66.7753 110.986 62.9222 111.281 62.9222 111.281L63.8795 111.718C63.8755 111.718 63.8723 111.718 63.8684 111.718C63.7758 111.715 63.6761 111.715 63.5844 111.715C62.2306 111.737 60.9685 111.926 59.8908 112.241C57.7728 112.857 56.3649 113.954 56.3649 115.207C56.3649 115.265 56.3687 115.322 56.3752 115.376C56.3464 115.351 56.3186 115.326 56.2898 115.3C56.1422 115.169 56.0042 115.039 55.875 114.911C54.8969 113.945 54.4 113.097 54.1861 112.662C59.0388 110.884 64.9445 109.989 65.7701 109.872C66.0015 109.905 66.6285 109.999 67.5188 110.155C68.5295 110.333 69.8785 110.592 71.3719 110.935C73.2681 111.372 75.3956 111.944 77.3542 112.66C77.11 113.151 76.5037 114.17 75.2505 115.293ZM67.8363 112.25C69.1517 112.246 70.3396 112.388 71.2092 112.628C71.1812 112.624 70.7249 112.558 70.2615 112.53C70.0221 112.643 69.8147 112.691 69.7509 112.705C69.7429 112.709 69.7349 112.712 69.7349 112.712C68.3389 112.578 67.8363 112.25 67.8363 112.25ZM78.3792 112.23C73.4834 110.339 67.3313 109.373 66.1507 109.199L65.7677 109.145L65.3928 109.198C64.2081 109.373 58.0481 110.34 53.1515 112.233L52.9074 112.327L52.9672 112.482C53.0685 112.733 53.6549 114.058 55.291 115.528C56.3425 116.47 57.6284 117.296 59.1131 117.985C60.9223 118.822 63.0339 119.442 65.3929 119.83L65.7758 119.892L66.0246 119.847L66.1571 119.826C68.5016 119.441 70.6133 118.82 72.4345 117.982C73.9111 117.301 75.197 116.474 76.2572 115.524C77.903 114.049 78.5212 112.682 78.5842 112.468H78.585L78.644 112.316L78.3792 112.23Z" fill="#6CF0D1"/>
<path opacity="0.175894" fill-rule="evenodd" clip-rule="evenodd" d="M78.9765 112.492L78.644 112.548C78.6703 112.485 78.6928 112.425 78.7153 112.369C78.7416 112.382 78.7636 112.392 78.7899 112.405L78.9765 112.492Z" fill="#000CA5"/>
<path opacity="0.175894" fill-rule="evenodd" clip-rule="evenodd" d="M78.7893 112.405C78.7631 112.392 78.7411 112.382 78.7148 112.369C78.6923 112.425 78.6698 112.485 78.644 112.548L78.9759 112.492L78.7893 112.405Z" fill="#000CA5"/>
-<rect width="37.5326" height="24.718" fill="black" fill-opacity="0" transform="translate(47.5456 99.4725)"/>
-<rect width="37.5326" height="24.2005" fill="black" fill-opacity="0" transform="translate(47.5456 99.4725)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M79.5817 120.595C72.253 124.699 60.3709 124.699 53.0422 120.595C45.7135 116.492 45.7134 109.838 53.0421 105.734C60.3708 101.631 72.2529 101.631 79.5816 105.735C86.9103 109.838 86.9104 116.492 79.5817 120.595Z" fill="#61C9A7"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M47.5456 112.846H85.0782V109.662H47.5456V112.846Z" fill="#61C9A7"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M53.0422 117.411C45.7135 113.307 45.7134 106.654 53.0421 102.55C60.3708 98.4465 72.2529 98.4465 79.5816 102.55C86.9103 106.654 86.9104 113.307 79.5817 117.411C72.253 121.515 60.3709 121.515 53.0422 117.411Z" fill="#86F7D1"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M54.9046 115.967C48.6045 112.485 48.6044 106.839 54.9046 103.358C61.2046 99.8757 71.4191 99.8757 77.7192 103.358C84.0193 106.84 84.0194 112.485 77.7193 115.967C71.4192 119.449 61.2047 119.449 54.9046 115.967Z" fill="#95FFDA"/>
-<rect width="26.809" height="10.7469" fill="black" fill-opacity="0" transform="translate(52.9074 104.846)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M78.1519 108.426C78.1579 108.412 78.1629 108.398 78.1681 108.386C78.1741 108.388 78.1793 108.391 78.1852 108.394L78.2281 108.413L78.1519 108.426ZM75.2505 110.994C74.8038 111.395 74.3155 111.771 73.7899 112.122C73.5585 112.277 73.3192 112.427 73.0736 112.572C71.4102 112.517 70.5534 112.277 70.1138 112.032C69.5898 111.741 69.6552 111.443 69.6552 111.443C69.6552 111.403 69.6552 111.363 69.6711 111.323C69.6711 111.323 69.6791 111.288 69.7054 111.232C69.7421 111.155 69.8139 111.041 69.9495 110.926C70.1816 110.729 70.6037 110.532 71.3568 110.529H71.3703C71.5698 110.525 71.7692 110.544 71.9367 110.587C72.7345 110.784 72.216 111.152 72.216 111.152C72.2758 111.147 72.3364 111.142 72.3978 111.134C73.3567 111.016 74.4376 110.516 74.2502 109.677C74.2079 109.487 74.0682 109.316 73.8744 109.165C73.3862 108.784 72.5533 108.531 72.0795 108.41C71.8632 108.354 71.7213 108.326 71.7213 108.326C71.7452 108.258 71.7532 108.205 71.7532 108.165C71.7532 108.157 71.7532 108.15 71.7515 108.143C71.7476 108.078 71.7213 108.053 71.7213 108.053C66.7753 106.688 62.9222 106.983 62.9222 106.983L63.8795 107.42C63.8755 107.42 63.8723 107.419 63.8684 107.419C63.7758 107.416 63.6761 107.416 63.5844 107.416C62.2306 107.438 60.9685 107.627 59.8908 107.942C57.7728 108.558 56.3649 109.656 56.3649 110.908C56.3649 110.966 56.3687 111.023 56.3752 111.077C56.3464 111.052 56.3186 111.027 56.2898 111.002C56.1422 110.87 56.0042 110.74 55.875 110.612C54.8969 109.646 54.4 108.798 54.1861 108.363C59.0388 106.586 64.9445 105.691 65.7701 105.573C66.0015 105.606 66.6285 105.7 67.5188 105.856C68.5295 106.034 69.8785 106.293 71.3719 106.637C73.2681 107.073 75.3956 107.645 77.3542 108.361C77.11 108.852 76.5037 109.871 75.2505 110.994ZM67.8363 107.951C69.1517 107.948 70.3396 108.09 71.2092 108.329C71.1812 108.325 70.7249 108.26 70.2615 108.232C70.0221 108.344 69.8147 108.392 69.7509 108.406C69.7429 108.41 69.7349 108.414 69.7349 108.414C68.3389 108.279 67.8363 107.951 67.8363 107.951ZM78.3792 107.931C73.4834 106.04 67.3313 105.074 66.1507 104.9L65.7677 104.846L65.3928 104.899C64.2081 105.074 58.0481 106.041 53.1515 107.935L52.9074 108.029L52.9672 108.183C53.0685 108.434 53.6549 109.759 55.291 111.229C56.3425 112.171 57.6284 112.997 59.1131 113.686C60.9223 114.523 63.0339 115.144 65.3929 115.531L65.7758 115.593L66.0246 115.548L66.1571 115.527C68.5016 115.142 70.6133 114.522 72.4345 113.683C73.9111 113.002 75.197 112.175 76.2572 111.225C77.903 109.75 78.5212 108.383 78.5842 108.17H78.585L78.644 108.017L78.3792 107.931Z" fill="#6CF0D1"/>
<path opacity="0.175894" fill-rule="evenodd" clip-rule="evenodd" d="M78.9765 108.193L78.644 108.249C78.6703 108.186 78.6928 108.126 78.7153 108.07C78.7416 108.083 78.7636 108.093 78.7899 108.107L78.9765 108.193Z" fill="#000CA5"/>
<path opacity="0.175894" fill-rule="evenodd" clip-rule="evenodd" d="M78.7893 108.107C78.7631 108.094 78.7411 108.083 78.7148 108.07C78.6923 108.126 78.6698 108.186 78.644 108.249L78.9759 108.193L78.7893 108.107Z" fill="#000CA5"/>
-<rect width="37.5326" height="24.718" fill="black" fill-opacity="0" transform="translate(47.5456 95.1737)"/>
-<rect width="37.5326" height="24.2005" fill="black" fill-opacity="0" transform="translate(47.5456 95.1737)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M79.5817 116.296C72.253 120.4 60.3709 120.4 53.0422 116.296C45.7135 112.193 45.7134 105.539 53.0421 101.436C60.3708 97.332 72.2529 97.332 79.5816 101.436C86.9103 105.539 86.9104 112.193 79.5817 116.296Z" fill="#61C9A7"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M47.5456 108.548H85.0782V105.363H47.5456V108.548Z" fill="#61C9A7"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M53.0422 113.112C45.7135 109.008 45.7134 102.355 53.0421 98.2514C60.3708 94.1478 72.2529 94.1478 79.5816 98.2515C86.9103 102.355 86.9104 109.009 79.5817 113.112C72.253 117.216 60.3709 117.216 53.0422 113.112Z" fill="#86F7D1"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M54.9046 111.668C48.6045 108.186 48.6044 102.541 54.9046 99.0588C61.2046 95.5769 71.4191 95.5769 77.7192 99.0588C84.0193 102.541 84.0194 108.186 77.7193 111.668C71.4192 115.15 61.2047 115.15 54.9046 111.668Z" fill="#95FFDA"/>
-<rect width="26.809" height="10.7469" fill="black" fill-opacity="0" transform="translate(52.9074 100.547)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M78.1519 104.127C78.1579 104.113 78.1629 104.099 78.1681 104.087C78.1741 104.09 78.1793 104.092 78.1852 104.095L78.2281 104.114L78.1519 104.127ZM75.2505 106.696C74.8038 107.096 74.3155 107.472 73.7899 107.824C73.5585 107.978 73.3192 108.128 73.0736 108.273C71.4102 108.218 70.5534 107.978 70.1138 107.733C69.5898 107.442 69.6552 107.144 69.6552 107.144C69.6552 107.104 69.6552 107.064 69.6711 107.024C69.6711 107.024 69.6791 106.989 69.7054 106.933C69.7421 106.857 69.8139 106.742 69.9495 106.627C70.1816 106.43 70.6037 106.233 71.3568 106.23H71.3703C71.5698 106.227 71.7692 106.245 71.9367 106.289C72.7345 106.485 72.216 106.853 72.216 106.853C72.2758 106.849 72.3364 106.843 72.3978 106.835C73.3567 106.717 74.4376 106.217 74.2502 105.378C74.2079 105.188 74.0682 105.017 73.8744 104.867C73.3862 104.485 72.5533 104.232 72.0795 104.111C71.8632 104.055 71.7213 104.027 71.7213 104.027C71.7452 103.959 71.7532 103.907 71.7532 103.866C71.7532 103.858 71.7532 103.851 71.7515 103.844C71.7476 103.779 71.7213 103.754 71.7213 103.754C66.7753 102.389 62.9222 102.684 62.9222 102.684L63.8795 103.121C63.8755 103.121 63.8723 103.12 63.8684 103.12C63.7758 103.117 63.6761 103.117 63.5844 103.117C62.2306 103.139 60.9685 103.329 59.8908 103.643C57.7728 104.26 56.3649 105.357 56.3649 106.609C56.3649 106.668 56.3687 106.724 56.3752 106.779C56.3464 106.754 56.3186 106.728 56.2898 106.703C56.1422 106.572 56.0042 106.441 55.875 106.313C54.8969 105.348 54.4 104.5 54.1861 104.065C59.0388 102.287 64.9445 101.392 65.7701 101.275C66.0015 101.307 66.6285 101.401 67.5188 101.558C68.5295 101.735 69.8785 101.994 71.3719 102.338C73.2681 102.774 75.3956 103.347 77.3542 104.062C77.11 104.553 76.5037 105.573 75.2505 106.696ZM67.8363 103.652C69.1517 103.649 70.3396 103.791 71.2092 104.031C71.1812 104.027 70.7249 103.961 70.2615 103.933C70.0221 104.046 69.8147 104.093 69.7509 104.108C69.7429 104.111 69.7349 104.115 69.7349 104.115C68.3389 103.98 67.8363 103.652 67.8363 103.652ZM78.3792 103.632C73.4834 101.741 67.3313 100.775 66.1507 100.601L65.7677 100.547L65.3928 100.601C64.2081 100.775 58.0481 101.742 53.1515 103.636L52.9074 103.73L52.9672 103.884C53.0685 104.135 53.6549 105.46 55.291 106.93C56.3425 107.872 57.6284 108.699 59.1131 109.388C60.9223 110.224 63.0339 110.845 65.3929 111.232L65.7758 111.294L66.0246 111.25L66.1571 111.229C68.5016 110.843 70.6133 110.223 72.4345 109.384C73.9111 108.703 75.197 107.876 76.2572 106.927C77.903 105.451 78.5212 104.084 78.5842 103.871H78.585L78.644 103.718L78.3792 103.632Z" fill="#6CF0D1"/>
<path opacity="0.175894" fill-rule="evenodd" clip-rule="evenodd" d="M78.9765 103.894L78.644 103.95C78.6703 103.887 78.6928 103.827 78.7153 103.771C78.7416 103.784 78.7636 103.794 78.7899 103.808L78.9765 103.894Z" fill="#000CA5"/>
<path opacity="0.175894" fill-rule="evenodd" clip-rule="evenodd" d="M78.7893 103.808C78.7631 103.795 78.7411 103.784 78.7148 103.771C78.6923 103.827 78.6698 103.887 78.644 103.951L78.9759 103.894L78.7893 103.808Z" fill="#000CA5"/>
-<rect width="37.5326" height="24.718" fill="black" fill-opacity="0" transform="translate(47.5456 90.8749)"/>
-<rect width="37.5326" height="24.2005" fill="black" fill-opacity="0" transform="translate(47.5456 90.8749)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M79.5817 111.998C72.253 116.101 60.3709 116.101 53.0422 111.998C45.7135 107.894 45.7134 101.241 53.0421 97.1369C60.3708 93.0333 72.2529 93.0333 79.5816 97.137C86.9103 101.241 86.9104 107.894 79.5817 111.998Z" fill="#61C9A7"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M47.5456 104.249H85.0782V101.065H47.5456V104.249Z" fill="#61C9A7"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M53.0422 108.813C45.7135 104.71 45.7134 98.0563 53.0421 93.9526C60.3708 89.849 72.2529 89.849 79.5816 93.9527C86.9103 98.0564 86.9104 104.71 79.5817 108.813C72.253 112.917 60.3709 112.917 53.0422 108.813Z" fill="#86F7D1"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M54.9046 107.369C48.6045 103.887 48.6044 98.2419 54.9046 94.7601C61.2046 91.2781 71.4191 91.2781 77.7192 94.7601C84.0193 98.242 84.0194 103.887 77.7193 107.369C71.4192 110.851 61.2047 110.851 54.9046 107.369Z" fill="#95FFDA"/>
-<rect width="26.809" height="10.7469" fill="black" fill-opacity="0" transform="translate(52.9074 96.2484)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M78.1519 99.828C78.1579 99.814 78.1629 99.8006 78.1681 99.788C78.1741 99.7909 78.1793 99.7933 78.1852 99.7962L78.2281 99.8156L78.1519 99.828ZM75.2505 102.397C74.8038 102.797 74.3155 103.174 73.7899 103.525C73.5585 103.68 73.3192 103.829 73.0736 103.974C71.4102 103.92 70.5534 103.679 70.1138 103.434C69.5898 103.143 69.6552 102.845 69.6552 102.845C69.6552 102.805 69.6552 102.765 69.6711 102.725C69.6711 102.725 69.6791 102.69 69.7054 102.634C69.7421 102.558 69.8139 102.443 69.9495 102.328C70.1816 102.131 70.6037 101.934 71.3568 101.932H71.3703C71.5698 101.928 71.7692 101.946 71.9367 101.99C72.7345 102.186 72.216 102.554 72.216 102.554C72.2758 102.55 72.3364 102.544 72.3978 102.536C73.3567 102.419 74.4376 101.918 74.2502 101.08C74.2079 100.889 74.0682 100.719 73.8744 100.568C73.3862 100.187 72.5533 99.9333 72.0795 99.812C71.8632 99.7567 71.7213 99.7287 71.7213 99.7287C71.7452 99.6605 71.7532 99.6078 71.7532 99.5673C71.7532 99.5597 71.7532 99.5524 71.7515 99.5455C71.7476 99.4806 71.7213 99.4555 71.7213 99.4555C66.7753 98.0901 62.9222 98.3851 62.9222 98.3851L63.8795 98.822C63.8755 98.822 63.8723 98.8216 63.8684 98.8216C63.7758 98.8183 63.6761 98.8183 63.5844 98.8183C62.2306 98.8405 60.9685 99.0299 59.8908 99.3442C57.7728 99.9609 56.3649 101.058 56.3649 102.31C56.3649 102.369 56.3687 102.425 56.3752 102.48C56.3464 102.455 56.3186 102.43 56.2898 102.404C56.1422 102.273 56.0042 102.142 55.875 102.015C54.8969 101.049 54.4 100.201 54.1861 99.7658C59.0388 97.9881 64.9445 97.0932 65.7701 96.9759C66.0015 97.0086 66.6285 97.1023 67.5188 97.2588C68.5295 97.4365 69.8785 97.6953 71.3719 98.0391C73.2681 98.4754 75.3956 99.0478 77.3542 99.7635C77.11 100.254 76.5037 101.274 75.2505 102.397ZM67.8363 99.3536C69.1517 99.35 70.3396 99.4919 71.2092 99.7319C71.1812 99.7279 70.7249 99.662 70.2615 99.634C70.0221 99.7469 69.8147 99.7942 69.7509 99.8087C69.7429 99.8125 69.7349 99.8161 69.7349 99.8161C68.3389 99.6813 67.8363 99.3536 67.8363 99.3536ZM78.3792 99.3332C73.4834 97.4423 67.3313 96.4767 66.1507 96.3026L65.7677 96.2484L65.3928 96.3019C64.2081 96.4767 58.0481 97.4434 53.1515 99.3371L52.9074 99.4312L52.9672 99.5855C53.0685 99.8364 53.6549 101.161 55.291 102.631C56.3425 103.573 57.6284 104.4 59.1131 105.089C60.9223 105.926 63.0339 106.546 65.3929 106.933L65.7758 106.995L66.0246 106.951L66.1571 106.93C68.5016 106.545 70.6133 105.924 72.4345 105.085C73.9111 104.404 75.197 103.577 76.2572 102.628C77.903 101.153 78.5212 99.7855 78.5842 99.572H78.585L78.644 99.4196L78.3792 99.3332Z" fill="#6CF0D1"/>
<path opacity="0.175894" fill-rule="evenodd" clip-rule="evenodd" d="M78.9765 99.5955L78.644 99.6514C78.6703 99.5885 78.6928 99.5284 78.7153 99.4725C78.7416 99.4854 78.7636 99.4956 78.7899 99.509L78.9765 99.5955Z" fill="#000CA5"/>
<path opacity="0.175894" fill-rule="evenodd" clip-rule="evenodd" d="M78.7893 99.509C78.7631 99.4961 78.7411 99.4854 78.7148 99.4725C78.6923 99.5284 78.6698 99.5885 78.644 99.6519L78.9759 99.5955L78.7893 99.509Z" fill="#000CA5"/>
-<rect width="37.5326" height="24.718" fill="black" fill-opacity="0" transform="translate(47.5456 86.5761)"/>
-<rect width="37.5326" height="24.2005" fill="black" fill-opacity="0" transform="translate(47.5456 86.5761)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M79.5817 107.699C72.253 111.803 60.3709 111.803 53.0422 107.699C45.7135 103.595 45.7134 96.9418 53.0421 92.8381C60.3708 88.7345 72.2529 88.7345 79.5816 92.8382C86.9103 96.9419 86.9104 103.595 79.5817 107.699Z" fill="#61C9A7"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M47.5456 99.9501H85.0782V96.7658H47.5456V99.9501Z" fill="#61C9A7"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M53.0422 104.515C45.7135 100.411 45.7134 93.7575 53.0421 89.6539C60.3708 85.5502 72.2529 85.5502 79.5816 89.6539C86.9103 93.7576 86.9104 100.411 79.5817 104.515C72.253 108.618 60.3709 108.618 53.0422 104.515Z" fill="#86F7D1"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M54.9046 103.07C48.6045 99.5884 48.6044 93.9431 54.9046 90.4613C61.2046 86.9794 71.4191 86.9794 77.7192 90.4613C84.0193 93.9432 84.0194 99.5885 77.7193 103.07C71.4192 106.552 61.2047 106.552 54.9046 103.07Z" fill="#95FFDA"/>
-<rect width="26.809" height="10.7469" fill="black" fill-opacity="0" transform="translate(52.9074 91.9496)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M78.1519 95.5293C78.1579 95.5152 78.1629 95.5018 78.1681 95.4892C78.1741 95.4921 78.1793 95.4945 78.1852 95.4974L78.2281 95.5168L78.1519 95.5293ZM75.2505 98.0981C74.8038 98.4983 74.3155 98.8747 73.7899 99.2261C73.5585 99.3809 73.3192 99.5305 73.0736 99.6755C71.4102 99.6208 70.5534 99.3805 70.1138 99.1355C69.5898 98.8442 69.6552 98.5467 69.6552 98.5467C69.6552 98.5067 69.6552 98.4665 69.6711 98.4266C69.6711 98.4266 69.6791 98.3912 69.7054 98.3355C69.7421 98.259 69.8139 98.1444 69.9495 98.0297C70.1816 97.8323 70.6037 97.6353 71.3568 97.6327H71.3703C71.5698 97.6291 71.7692 97.6473 71.9367 97.6911C72.7345 97.8876 72.216 98.2554 72.216 98.2554C72.2758 98.251 72.3364 98.2452 72.3978 98.2376C73.3567 98.1199 74.4376 97.6193 74.2502 96.7808C74.2079 96.5903 74.0682 96.4199 73.8744 96.2691C73.3862 95.8879 72.5533 95.6345 72.0795 95.5132C71.8632 95.4579 71.7213 95.4299 71.7213 95.4299C71.7452 95.3618 71.7532 95.309 71.7532 95.2685C71.7532 95.2609 71.7532 95.2536 71.7515 95.2467C71.7476 95.1818 71.7213 95.1567 71.7213 95.1567C66.7753 93.7913 62.9222 94.0863 62.9222 94.0863L63.8795 94.5232C63.8755 94.5232 63.8723 94.5228 63.8684 94.5228C63.7758 94.5195 63.6761 94.5195 63.5844 94.5195C62.2306 94.5417 60.9685 94.7311 59.8908 95.0454C57.7728 95.6622 56.3649 96.7592 56.3649 98.0115C56.3649 98.07 56.3687 98.1264 56.3752 98.1811C56.3464 98.1561 56.3186 98.1309 56.2898 98.1053C56.1422 97.974 56.0042 97.8435 55.875 97.7158C54.8969 96.7501 54.4 95.9021 54.1861 95.467C59.0388 93.6893 64.9445 92.7944 65.7701 92.6771C66.0015 92.7099 66.6285 92.8035 67.5188 92.9601C68.5295 93.1377 69.8785 93.3965 71.3719 93.7403C73.2681 94.1766 75.3956 94.749 77.3542 95.4648C77.11 95.9556 76.5037 96.9751 75.2505 98.0981ZM67.8363 95.0548C69.1517 95.0512 70.3396 95.1932 71.2092 95.4331C71.1812 95.4292 70.7249 95.3632 70.2615 95.3352C70.0221 95.4481 69.8147 95.4954 69.7509 95.51C69.7429 95.5137 69.7349 95.5173 69.7349 95.5173C68.3389 95.3825 67.8363 95.0548 67.8363 95.0548ZM78.3792 95.0344C73.4834 93.1435 67.3313 92.1779 66.1507 92.0039L65.7677 91.9496L65.3928 92.0031C64.2081 92.1779 58.0481 93.1446 53.1515 95.0383L52.9074 95.1324L52.9672 95.2867C53.0685 95.5376 53.6549 96.8626 55.291 98.3326C56.3425 99.2745 57.6284 100.101 59.1131 100.79C60.9223 101.627 63.0339 102.247 65.3929 102.635L65.7758 102.697L66.0246 102.652L66.1571 102.631C68.5016 102.246 70.6133 101.625 72.4345 100.786C73.9111 100.106 75.197 99.2786 76.2572 98.329C77.903 96.8539 78.5212 95.4867 78.5842 95.2732H78.585L78.644 95.1208L78.3792 95.0344Z" fill="#6CF0D1"/>
<path opacity="0.175894" fill-rule="evenodd" clip-rule="evenodd" d="M78.9765 95.2967L78.644 95.3526C78.6703 95.2898 78.6928 95.2296 78.7153 95.1737C78.7416 95.1866 78.7636 95.1968 78.7899 95.2102L78.9765 95.2967Z" fill="#000CA5"/>
<path opacity="0.175894" fill-rule="evenodd" clip-rule="evenodd" d="M78.7893 95.2102C78.7631 95.1973 78.7411 95.1866 78.7148 95.1737C78.6923 95.2296 78.6698 95.2898 78.644 95.3532L78.9759 95.2967L78.7893 95.2102Z" fill="#000CA5"/>
-<rect width="37.5326" height="24.718" fill="black" fill-opacity="0" transform="translate(318.852 90.8749)"/>
-<rect width="37.5326" height="24.2005" fill="black" fill-opacity="0" transform="translate(318.852 90.8749)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M350.888 111.998C343.56 116.101 331.678 116.101 324.349 111.998C317.02 107.894 317.02 101.241 324.349 97.1369C331.677 93.0333 343.56 93.0333 350.888 97.137C358.217 101.241 358.217 107.894 350.888 111.998Z" fill="#7F95EF"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M318.852 104.249H356.385V101.065H318.852V104.249Z" fill="#838DB7"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M350.888 108.813C343.56 112.917 331.678 112.917 324.349 108.813C317.02 104.71 317.02 98.0563 324.349 93.9526C331.677 89.849 343.56 89.849 350.888 93.9527C358.217 98.0564 358.217 104.71 350.888 108.813Z" fill="#93A8FF"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M326.211 107.369C319.911 103.887 319.911 98.2419 326.211 94.7601C332.511 91.2781 342.726 91.2781 349.026 94.7601C355.326 98.242 355.326 103.887 349.026 107.369C342.726 110.851 332.511 110.851 326.211 107.369Z" fill="#9ABFFF"/>
<g opacity="0.370867">
-<rect width="19.296" height="11.091" fill="black" fill-opacity="0" transform="translate(327.431 95.4199)"/>
<g opacity="0.653363">
-<rect width="14.9457" height="5.18222" fill="black" fill-opacity="0" transform="translate(327.431 101.329)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M342.161 101.56C342.497 101.801 342.355 101.973 342.298 102.137C341.315 104.941 336.078 106.952 331.129 106.428C328.909 106.192 327.621 105.418 327.452 104.219C327.266 102.896 328.324 101.998 330.572 101.576C331.906 101.325 333.285 101.304 334.667 101.346C337.204 101.423 339.711 101.755 342.161 101.56Z" fill="#4562DF"/>
</g>
<g opacity="0.653363">
-<rect width="14.909" height="5.19137" fill="black" fill-opacity="0" transform="translate(331.818 95.4199)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M331.818 100.345C332.063 97.7602 336.216 95.5645 340.869 95.4311C341.632 95.4091 342.397 95.4121 343.152 95.5101C345.409 95.8029 346.637 96.6105 346.723 97.8673C346.805 99.0741 345.734 99.9235 343.592 100.336C342.419 100.562 341.201 100.637 339.972 100.604C337.284 100.53 334.63 100.194 331.818 100.345Z" fill="#4562DF"/>
</g>
</g>
diff --git a/packages/website/translations/chinese.json b/packages/website/translations/chinese.json
index ed1a6044a..95b9bda62 100644
--- a/packages/website/translations/chinese.json
+++ b/packages/website/translations/chinese.json
@@ -78,5 +78,24 @@
"WEBSITE": "网站",
"DEVELOPERS": "首页",
"HOME": "Rocket.chat",
- "ROCKETCHAT": "开发人员"
+ "ROCKETCHAT": "开发人员",
+ "BUILD_A_RELAYER": "build a relayer",
+ "BUILD_A_RELAYER_DESCRIPTION": "Learn how to build your own 0x relayer from scratch",
+ "DEVELOP_ON_ETHEREUM": "develop on Ethereum",
+ "DEVELOP_ON_ETHEREUM_DESCRIPTION": "Learn more about building applications ontop of Ethereum",
+ "ORDER_BASICS": "0x order basics",
+ "ORDER_BASICS_DESCRIPTION": "Tutorial on how to create, validate and fill an order using 0x",
+ "USE_NETWORKED_LIQUIDITY": "use networked liquidity",
+ "USE_NETWORKED_LIQUIDITY_DESCRIPTION": "Access the shared liquidity pool using the Standard Relayer API",
+ "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",
+ "MORE": "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."
}
diff --git a/packages/website/translations/english.json b/packages/website/translations/english.json
index 9ce458111..465bd49b4 100644
--- a/packages/website/translations/english.json
+++ b/packages/website/translations/english.json
@@ -73,6 +73,7 @@
"WIKI": "wiki",
"WEB3_WRAPPER": "Web3Wrapper",
"ORDER_UTILS": "Order Utils",
+ "ASSET_BUYER": "AssetBuyer",
"FAQ": "FAQ",
"SMART_CONTRACTS": "0x smart contracts",
"STANDARD_RELAYER_API": "standard relayer API",
@@ -82,11 +83,30 @@
"HOME": "home",
"ROCKETCHAT": "rocket.chat",
"TRADE_CALL_TO_ACTION": "trade on 0x",
+ "BUILD_A_RELAYER": "build a relayer",
+ "BUILD_A_RELAYER_DESCRIPTION": "Learn how to build your own 0x relayer from scratch",
+ "DEVELOP_ON_ETHEREUM": "develop on Ethereum",
+ "DEVELOP_ON_ETHEREUM_DESCRIPTION": "Learn more about building applications ontop of Ethereum",
+ "ORDER_BASICS": "0x order basics",
+ "ORDER_BASICS_DESCRIPTION": "Tutorial on how to create, validate and fill an order using 0x",
+ "USE_NETWORKED_LIQUIDITY": "use networked liquidity",
+ "USE_NETWORKED_LIQUIDITY_DESCRIPTION": "Learn how to tap into networked liquidity using the Standard Relayer API",
+ "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",
+ "MORE": "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.",
"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."
+ "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."
}
diff --git a/packages/website/translations/korean.json b/packages/website/translations/korean.json
index 8892f2dee..5485e5583 100644
--- a/packages/website/translations/korean.json
+++ b/packages/website/translations/korean.json
@@ -78,5 +78,24 @@
"WEBSITE": "Website",
"HOME": "홈",
"ROCKETCHAT": "Rocket.chat",
- "DEVELOPERS": "개발자"
+ "DEVELOPERS": "개발자",
+ "BUILD_A_RELAYER": "build a relayer",
+ "BUILD_A_RELAYER_DESCRIPTION": "Learn how to build your own 0x relayer from scratch",
+ "DEVELOP_ON_ETHEREUM": "develop on Ethereum",
+ "DEVELOP_ON_ETHEREUM_DESCRIPTION": "Learn more about building applications ontop of Ethereum",
+ "ORDER_BASICS": "0x order basics",
+ "ORDER_BASICS_DESCRIPTION": "Tutorial on how to create, validate and fill an order using 0x",
+ "USE_NETWORKED_LIQUIDITY": "use networked liquidity",
+ "USE_NETWORKED_LIQUIDITY_DESCRIPTION": "Learn how to tap into networked liquidity using the Standard Relayer API",
+ "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",
+ "MORE": "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."
}
diff --git a/packages/website/translations/russian.json b/packages/website/translations/russian.json
index 41a7a990d..a2e2a8cef 100644
--- a/packages/website/translations/russian.json
+++ b/packages/website/translations/russian.json
@@ -78,5 +78,24 @@
"WEBSITE": "Веб-сайт",
"DEVELOPERS": "Домашняя страница",
"HOME": "Rocket.chat",
- "ROCKETCHAT": "Для разработчиков"
+ "ROCKETCHAT": "Для разработчиков",
+ "BUILD_A_RELAYER": "build a relayer",
+ "BUILD_A_RELAYER_DESCRIPTION": "Learn how to build your own 0x relayer from scratch",
+ "DEVELOP_ON_ETHEREUM": "develop on Ethereum",
+ "DEVELOP_ON_ETHEREUM_DESCRIPTION": "Learn more about building applications ontop of Ethereum",
+ "ORDER_BASICS": "0x order basics",
+ "ORDER_BASICS_DESCRIPTION": "Tutorial on how to create, validate and fill an order using 0x",
+ "USE_NETWORKED_LIQUIDITY": "use networked liquidity",
+ "USE_NETWORKED_LIQUIDITY_DESCRIPTION": "Learn how to tap into networked liquidity using the Standard Relayer API",
+ "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",
+ "MORE": "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."
}
diff --git a/packages/website/translations/spanish.json b/packages/website/translations/spanish.json
index 7780190ac..acbc59c3d 100644
--- a/packages/website/translations/spanish.json
+++ b/packages/website/translations/spanish.json
@@ -79,5 +79,24 @@
"WEBSITE": "website",
"DEVELOPERS": "inicio",
"HOME": "rocket.chat",
- "ROCKETCHAT": "desarrolladores"
+ "ROCKETCHAT": "desarrolladores",
+ "BUILD_A_RELAYER": "build a relayer",
+ "BUILD_A_RELAYER_DESCRIPTION": "Learn how to build your own 0x relayer from scratch",
+ "DEVELOP_ON_ETHEREUM": "develop on Ethereum",
+ "DEVELOP_ON_ETHEREUM_DESCRIPTION": "Learn more about building applications ontop of Ethereum",
+ "ORDER_BASICS": "0x order basics",
+ "ORDER_BASICS_DESCRIPTION": "Tutorial on how to create, validate and fill an order using 0x",
+ "USE_NETWORKED_LIQUIDITY": "use networked liquidity",
+ "USE_NETWORKED_LIQUIDITY_DESCRIPTION": "Learn how to tap into networked liquidity using the Standard Relayer API",
+ "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",
+ "MORE": "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."
}
diff --git a/packages/website/ts/blockchain.ts b/packages/website/ts/blockchain.ts
index b1181e4c6..25430c1c7 100644
--- a/packages/website/ts/blockchain.ts
+++ b/packages/website/ts/blockchain.ts
@@ -1,4 +1,3 @@
-import { ZeroEx } from '0x.js';
import {
BlockRange,
ContractWrappers,
@@ -8,9 +7,9 @@ import {
ExchangeEvents,
ExchangeFillEventArgs,
IndexedFilterValues,
-} from '@0xproject/contract-wrappers';
-import { assetDataUtils, orderHashUtils, signatureUtils } from '@0xproject/order-utils';
-import { EtherscanLinkSuffixes, utils as sharedUtils } from '@0xproject/react-shared';
+} from '@0x/contract-wrappers';
+import { assetDataUtils, orderHashUtils, signatureUtils } from '@0x/order-utils';
+import { EtherscanLinkSuffixes, utils as sharedUtils } from '@0x/react-shared';
import {
ledgerEthereumBrowserClientFactoryAsync,
LedgerSubprovider,
@@ -19,15 +18,15 @@ import {
RPCSubprovider,
SignerSubprovider,
Web3ProviderEngine,
-} from '@0xproject/subproviders';
-import { SignedOrder, Token as ZeroExToken } from '@0xproject/types';
-import { BigNumber, intervalUtils, logUtils, promisify } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+} from '@0x/subproviders';
+import { SignedOrder, Token as ZeroExToken } from '@0x/types';
+import { BigNumber, intervalUtils, logUtils } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import { BlockParam, LogWithDecodedArgs, Provider, TransactionReceiptWithDecodedLogs } from 'ethereum-types';
import * as _ from 'lodash';
import * as moment from 'moment';
import * as React from 'react';
-import contract = require('truffle-contract');
+import contract from 'truffle-contract';
import { BlockchainWatcher } from 'ts/blockchain_watcher';
import { AssetSendCompleted } from 'ts/components/flash_messages/asset_send_completed';
import { TransactionSubmitted } from 'ts/components/flash_messages/transaction_submitted';
@@ -39,9 +38,9 @@ import {
BlockchainErrs,
ContractInstance,
Fill,
+ InjectedProvider,
InjectedProviderObservable,
InjectedProviderUpdate,
- InjectedWeb3,
Providers,
ProviderType,
Side,
@@ -53,11 +52,12 @@ import { backendClient } from 'ts/utils/backend_client';
import { configs } from 'ts/utils/configs';
import { constants } from 'ts/utils/constants';
import { errorReporter } from 'ts/utils/error_reporter';
+import { fakeTokenRegistry } from 'ts/utils/fake_token_registry';
import { tokenAddressOverrides } from 'ts/utils/token_address_overrides';
import { utils } from 'ts/utils/utils';
-import FilterSubprovider = require('web3-provider-engine/subproviders/filters');
+import FilterSubprovider from 'web3-provider-engine/subproviders/filters';
-import * as MintableArtifacts from '../contracts/Mintable.json';
+import MintableArtifacts from '../contracts/Mintable.json';
const BLOCK_NUMBER_BACK_TRACK = 50;
const GWEI_IN_WEI = 1000000000;
@@ -74,7 +74,6 @@ export class Blockchain {
public networkId: number;
public nodeVersion: string;
private _contractWrappers: ContractWrappers;
- private _zeroEx: ZeroEx;
private readonly _dispatcher: Dispatcher;
private _web3Wrapper?: Web3Wrapper;
private _blockchainWatcher?: BlockchainWatcher;
@@ -84,6 +83,7 @@ export class Blockchain {
private _ledgerSubprovider: LedgerSubprovider;
private _defaultGasPrice: BigNumber;
private _watchGasPriceIntervalId: NodeJS.Timer;
+ private _injectedProviderIfExists?: InjectedProvider;
private static _getNameGivenProvider(provider: Provider): string {
const providerType = utils.getProviderType(provider);
const providerNameIfExists = providerToName[providerType];
@@ -92,48 +92,12 @@ export class Blockchain {
}
return providerNameIfExists;
}
- private static _getInjectedWeb3(): InjectedWeb3 {
- const injectedWeb3IfExists = (window as any).web3;
- // Our core assumptions about the injected web3 object is that it has the following
- // properties and methods.
- if (
- _.isUndefined(injectedWeb3IfExists) ||
- _.isUndefined(injectedWeb3IfExists.version) ||
- _.isUndefined(injectedWeb3IfExists.version.getNetwork) ||
- _.isUndefined(injectedWeb3IfExists.currentProvider)
- ) {
- return undefined;
- }
- return injectedWeb3IfExists;
- }
- private static async _getInjectedWeb3ProviderNetworkIdIfExistsAsync(): Promise<number | undefined> {
- // Hack: We need to know the networkId the injectedWeb3 is connected to (if it is defined) in
- // order to properly instantiate the web3Wrapper. Since we must use the async call, we cannot
- // retrieve it from within the web3Wrapper constructor. This is and should remain the only
- // call to a web3 instance outside of web3Wrapper in the entire dapp.
- // In addition, if the user has an injectedWeb3 instance that is disconnected from a backing
- // Ethereum node, this call will throw. We need to handle this case gracefully
- const injectedWeb3IfExists = Blockchain._getInjectedWeb3();
- let networkIdIfExists: number;
- if (!_.isUndefined(injectedWeb3IfExists)) {
- try {
- networkIdIfExists = _.parseInt(
- await promisify<string>(
- injectedWeb3IfExists.version.getNetwork.bind(injectedWeb3IfExists.version),
- )(),
- );
- } catch (err) {
- // Ignore error and proceed with networkId undefined
- }
- }
- return networkIdIfExists;
- }
private static async _getProviderAsync(
- injectedWeb3: InjectedWeb3,
- networkIdIfExists: number,
+ injectedProviderIfExists?: InjectedProvider,
+ networkIdIfExists?: number,
shouldUserLedgerProvider: boolean = false,
): Promise<[Provider, LedgerSubprovider | undefined]> {
- const doesInjectedWeb3Exist = !_.isUndefined(injectedWeb3);
+ const doesInjectedProviderExist = !_.isUndefined(injectedProviderIfExists);
const isNetworkIdAvailable = !_.isUndefined(networkIdIfExists);
const publicNodeUrlsIfExistsForNetworkId = configs.PUBLIC_NODE_URLS_BY_NETWORK_ID[networkIdIfExists];
const isPublicNodeAvailableForNetworkId = !_.isUndefined(publicNodeUrlsIfExistsForNetworkId);
@@ -157,16 +121,16 @@ export class Blockchain {
provider.addProvider(new RedundantSubprovider(rpcSubproviders));
provider.start();
return [provider, ledgerSubprovider];
- } else if (doesInjectedWeb3Exist && isPublicNodeAvailableForNetworkId) {
+ } else if (doesInjectedProviderExist && isPublicNodeAvailableForNetworkId) {
// We catch all requests involving a users account and send it to the injectedWeb3
// instance. All other requests go to the public hosted node.
const provider = new Web3ProviderEngine();
- const providerName = this._getNameGivenProvider(injectedWeb3.currentProvider);
+ const providerName = this._getNameGivenProvider(injectedProviderIfExists);
// Wrap Metamask in a compatability wrapper MetamaskSubprovider (to handle inconsistencies)
const signerSubprovider =
- providerName === Providers.Metamask
- ? new MetamaskSubprovider(injectedWeb3.currentProvider)
- : new SignerSubprovider(injectedWeb3.currentProvider);
+ providerName === constants.PROVIDER_NAME_METAMASK
+ ? new MetamaskSubprovider(injectedProviderIfExists)
+ : new SignerSubprovider(injectedProviderIfExists);
provider.addProvider(signerSubprovider);
provider.addProvider(new FilterSubprovider());
const rpcSubproviders = _.map(publicNodeUrlsIfExistsForNetworkId, publicNodeUrl => {
@@ -175,9 +139,9 @@ export class Blockchain {
provider.addProvider(new RedundantSubprovider(rpcSubproviders));
provider.start();
return [provider, undefined];
- } else if (doesInjectedWeb3Exist) {
+ } else if (doesInjectedProviderExist) {
// Since no public node for this network, all requests go to injectedWeb3 instance
- return [injectedWeb3.currentProvider, undefined];
+ return [injectedProviderIfExists, undefined];
} else {
// If no injectedWeb3 instance, all requests fallback to our public hosted mainnet/testnet node
// We do this so that users can still browse the 0x Portal DApp even if they do not have web3
@@ -228,8 +192,9 @@ export class Blockchain {
}
}
public async isAddressInTokenRegistryAsync(tokenAddress: string): Promise<boolean> {
- utils.assert(!_.isUndefined(this._zeroEx), 'ZeroEx must be instantiated.');
- const tokenIfExists = await this._zeroEx.tokenRegistry.getTokenIfExistsAsync(tokenAddress);
+ const tokens = fakeTokenRegistry[this.networkId];
+ const tokenIfExists = _.find(tokens, { address: tokenAddress });
+
// HACK: Override token addresses on testnets
const tokenSymbolToAddressOverrides = tokenAddressOverrides[this.networkId];
let isTokenAddressInOverrides = false;
@@ -261,7 +226,7 @@ export class Blockchain {
const shouldUserLedgerProvider = false;
this._dispatcher.updateBlockchainIsLoaded(false);
// We don't want to be out of sync with the network the injected provider declares.
- const networkId = await Blockchain._getInjectedWeb3ProviderNetworkIdIfExistsAsync();
+ const networkId = await this._getInjectedProviderNetworkIdIfExistsAsync();
await this._resetOrInitializeAsync(networkId, shouldPollUserAddress, shouldUserLedgerProvider);
}
public async setProxyAllowanceAsync(token: Token, amountInBaseUnits: BigNumber): Promise<void> {
@@ -374,7 +339,7 @@ export class Blockchain {
return unavailableTakerAmount;
}
public getExchangeContractAddressIfExists(): string | undefined {
- return this._contractWrappers.exchange.getContractAddress();
+ return this._contractWrappers.exchange.address;
}
public async validateFillOrderThrowIfInvalidAsync(
signedOrder: SignedOrder,
@@ -611,6 +576,45 @@ export class Blockchain {
this._dispatcher.updateBlockchainIsLoaded(true);
}
+ private async _getInjectedProviderIfExistsAsync(): Promise<InjectedProvider | undefined> {
+ if (!_.isUndefined(this._injectedProviderIfExists)) {
+ return this._injectedProviderIfExists;
+ }
+ let injectedProviderIfExists = (window as any).ethereum;
+ if (!_.isUndefined(injectedProviderIfExists)) {
+ if (!_.isUndefined(injectedProviderIfExists.enable)) {
+ try {
+ await injectedProviderIfExists.enable();
+ } catch (err) {
+ errorReporter.report(err);
+ }
+ }
+ } else {
+ const injectedWeb3IfExists = (window as any).web3;
+ if (!_.isUndefined(injectedWeb3IfExists.currentProvider)) {
+ injectedProviderIfExists = injectedWeb3IfExists.currentProvider;
+ } else {
+ return undefined;
+ }
+ }
+ this._injectedProviderIfExists = injectedProviderIfExists;
+ return injectedProviderIfExists;
+ }
+ private async _getInjectedProviderNetworkIdIfExistsAsync(): Promise<number | undefined> {
+ // If the user has an injectedWeb3 instance that is disconnected from a backing
+ // Ethereum node, this call will throw. We need to handle this case gracefully
+ const injectedProviderIfExists = await this._getInjectedProviderIfExistsAsync();
+ let networkIdIfExists: number;
+ if (!_.isUndefined(injectedProviderIfExists)) {
+ try {
+ const injectedWeb3Wrapper = new Web3Wrapper(injectedProviderIfExists);
+ networkIdIfExists = await injectedWeb3Wrapper.getNetworkIdAsync();
+ } catch (err) {
+ // Ignore error and proceed with networkId undefined
+ }
+ }
+ return networkIdIfExists;
+ }
private async _showEtherScanLinkAndAwaitTransactionMinedAsync(
txHash: string,
): Promise<TransactionReceiptWithDecodedLogs> {
@@ -768,8 +772,7 @@ export class Blockchain {
if (this.networkId === constants.NETWORK_ID_MAINNET) {
tokenRegistryTokens = await backendClient.getTokenInfosAsync();
} else {
- utils.assert(!_.isUndefined(this._zeroEx), 'ZeroEx must be instantiated.');
- tokenRegistryTokens = await this._zeroEx.tokenRegistry.getTokensAsync();
+ tokenRegistryTokens = fakeTokenRegistry[this.networkId];
const tokenSymbolToAddressOverrides = tokenAddressOverrides[this.networkId];
if (!_.isUndefined(tokenAddressOverrides)) {
// HACK: Override token addresses on testnets
@@ -805,17 +808,17 @@ export class Blockchain {
}
private async _onPageLoadInitFireAndForgetAsync(): Promise<void> {
await utils.onPageLoadPromise; // wait for page to load
- const networkIdIfExists = await Blockchain._getInjectedWeb3ProviderNetworkIdIfExistsAsync();
+ const networkIdIfExists = await this._getInjectedProviderNetworkIdIfExistsAsync();
this.networkId = !_.isUndefined(networkIdIfExists) ? networkIdIfExists : constants.NETWORK_ID_MAINNET;
- const injectedWeb3IfExists = Blockchain._getInjectedWeb3();
- if (!_.isUndefined(injectedWeb3IfExists) && !_.isUndefined(injectedWeb3IfExists.currentProvider)) {
- const injectedProviderObservable = injectedWeb3IfExists.currentProvider.publicConfigStore;
+ const injectedProviderIfExists = await this._getInjectedProviderIfExistsAsync();
+ if (!_.isUndefined(injectedProviderIfExists)) {
+ const injectedProviderObservable = injectedProviderIfExists.publicConfigStore;
if (!_.isUndefined(injectedProviderObservable) && _.isUndefined(this._injectedProviderObservable)) {
this._injectedProviderObservable = injectedProviderObservable;
this._injectedProviderObservable.subscribe(this._injectedProviderUpdateHandler);
}
}
- this._updateProviderName(injectedWeb3IfExists);
+ this._updateProviderName(injectedProviderIfExists);
const shouldPollUserAddress = true;
const shouldUseLedgerProvider = false;
this._startWatchingGasPrice();
@@ -852,26 +855,24 @@ export class Blockchain {
}
this._dispatcher.updateUserWeiBalance(undefined);
this.networkId = networkId;
- const injectedWeb3IfExists = Blockchain._getInjectedWeb3();
+ const injectedProviderIfExists = await this._getInjectedProviderIfExistsAsync();
const [provider, ledgerSubproviderIfExists] = await Blockchain._getProviderAsync(
- injectedWeb3IfExists,
+ injectedProviderIfExists,
networkId,
shouldUserLedgerProvider,
);
+ this._web3Wrapper = new Web3Wrapper(provider);
+ this.networkId = await this._web3Wrapper.getNetworkIdAsync();
if (!_.isUndefined(this._contractWrappers)) {
- this._contractWrappers.setProvider(provider, networkId);
- } else {
- this._contractWrappers = new ContractWrappers(provider, { networkId });
- }
- if (!_.isUndefined(this._zeroEx)) {
- this._zeroEx.setProvider(provider, networkId);
- } else {
- this._zeroEx = new ZeroEx(provider, { networkId });
+ this._contractWrappers.unsubscribeAll();
}
+ const contractWrappersConfig = {
+ networkId,
+ };
+ this._contractWrappers = new ContractWrappers(provider, contractWrappersConfig);
if (!_.isUndefined(this._blockchainWatcher)) {
this._blockchainWatcher.destroy();
}
- this._web3Wrapper = new Web3Wrapper(provider);
this._blockchainWatcher = new BlockchainWatcher(this._dispatcher, this._web3Wrapper, shouldPollUserAddress);
if (shouldUserLedgerProvider && !_.isUndefined(ledgerSubproviderIfExists)) {
delete this._userAddressIfExists;
@@ -883,7 +884,7 @@ export class Blockchain {
const userAddresses = await this._web3Wrapper.getAvailableAddressesAsync();
this._userAddressIfExists = userAddresses[0];
this._dispatcher.updateUserAddress(this._userAddressIfExists);
- if (!_.isUndefined(injectedWeb3IfExists)) {
+ if (!_.isUndefined(injectedProviderIfExists)) {
this._dispatcher.updateProviderType(ProviderType.Injected);
}
await this.fetchTokenInformationAsync();
@@ -892,10 +893,10 @@ export class Blockchain {
this._dispatcher.updateNetworkId(networkId);
await this._rehydrateStoreWithContractEventsAsync();
}
- private _updateProviderName(injectedWeb3IfExists: InjectedWeb3): void {
- const doesInjectedWeb3Exist = !_.isUndefined(injectedWeb3IfExists);
- const providerName = doesInjectedWeb3Exist
- ? Blockchain._getNameGivenProvider(injectedWeb3IfExists.currentProvider)
+ private _updateProviderName(injectedProviderIfExists?: InjectedProvider): void {
+ const doesInjectedProviderExist = !_.isUndefined(injectedProviderIfExists);
+ const providerName = doesInjectedProviderExist
+ ? Blockchain._getNameGivenProvider(injectedProviderIfExists)
: constants.PROVIDER_NAME_PUBLIC;
this._dispatcher.updateInjectedProviderName(providerName);
}
diff --git a/packages/website/ts/blockchain_watcher.ts b/packages/website/ts/blockchain_watcher.ts
index 39ed8b08b..835932dcd 100644
--- a/packages/website/ts/blockchain_watcher.ts
+++ b/packages/website/ts/blockchain_watcher.ts
@@ -1,5 +1,5 @@
-import { BigNumber, intervalUtils, logUtils } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { BigNumber, intervalUtils, logUtils } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import * as _ from 'lodash';
import { Dispatcher } from 'ts/redux/dispatcher';
diff --git a/packages/website/ts/components/dialogs/blockchain_err_dialog.tsx b/packages/website/ts/components/dialogs/blockchain_err_dialog.tsx
index 18c060991..a0114d898 100644
--- a/packages/website/ts/components/dialogs/blockchain_err_dialog.tsx
+++ b/packages/website/ts/components/dialogs/blockchain_err_dialog.tsx
@@ -1,4 +1,4 @@
-import { colors, Networks } from '@0xproject/react-shared';
+import { colors, Networks } from '@0x/react-shared';
import Dialog from 'material-ui/Dialog';
import FlatButton from 'material-ui/FlatButton';
import * as React from 'react';
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 f2cfb279a..9b9421f1a 100644
--- a/packages/website/ts/components/dialogs/eth_weth_conversion_dialog.tsx
+++ b/packages/website/ts/components/dialogs/eth_weth_conversion_dialog.tsx
@@ -1,5 +1,5 @@
-import { colors } from '@0xproject/react-shared';
-import { BigNumber } from '@0xproject/utils';
+import { colors } from '@0x/react-shared';
+import { BigNumber } from '@0x/utils';
import * as _ from 'lodash';
import Dialog from 'material-ui/Dialog';
import FlatButton from 'material-ui/FlatButton';
diff --git a/packages/website/ts/components/dialogs/ledger_config_dialog.tsx b/packages/website/ts/components/dialogs/ledger_config_dialog.tsx
index fbc6c868b..e15a2dd94 100644
--- a/packages/website/ts/components/dialogs/ledger_config_dialog.tsx
+++ b/packages/website/ts/components/dialogs/ledger_config_dialog.tsx
@@ -1,13 +1,13 @@
-import { colors, constants as sharedConstants } from '@0xproject/react-shared';
-import { BigNumber, logUtils } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { colors, constants as sharedConstants } from '@0x/react-shared';
+import { BigNumber, logUtils } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import * as _ from 'lodash';
import Dialog from 'material-ui/Dialog';
import FlatButton from 'material-ui/FlatButton';
import { Table, TableBody, TableHeader, TableHeaderColumn, TableRow, TableRowColumn } from 'material-ui/Table';
import TextField from 'material-ui/TextField';
import * as React from 'react';
-import ReactTooltip = require('react-tooltip');
+import ReactTooltip from 'react-tooltip';
import { Blockchain } from 'ts/blockchain';
import { NetworkDropDown } from 'ts/components/dropdowns/network_drop_down';
import { LifeCycleRaisedButton } from 'ts/components/ui/lifecycle_raised_button';
diff --git a/packages/website/ts/components/dialogs/portal_disclaimer_dialog.tsx b/packages/website/ts/components/dialogs/portal_disclaimer_dialog.tsx
index ef295762b..326df2a8c 100644
--- a/packages/website/ts/components/dialogs/portal_disclaimer_dialog.tsx
+++ b/packages/website/ts/components/dialogs/portal_disclaimer_dialog.tsx
@@ -1,4 +1,4 @@
-import { colors } from '@0xproject/react-shared';
+import { colors } from '@0x/react-shared';
import Dialog from 'material-ui/Dialog';
import FlatButton from 'material-ui/FlatButton';
import * as React from 'react';
diff --git a/packages/website/ts/components/dialogs/send_dialog.tsx b/packages/website/ts/components/dialogs/send_dialog.tsx
index 2754b153f..5f6927cef 100644
--- a/packages/website/ts/components/dialogs/send_dialog.tsx
+++ b/packages/website/ts/components/dialogs/send_dialog.tsx
@@ -1,4 +1,4 @@
-import { BigNumber } from '@0xproject/utils';
+import { BigNumber } from '@0x/utils';
import * as _ from 'lodash';
import Dialog from 'material-ui/Dialog';
import FlatButton from 'material-ui/FlatButton';
diff --git a/packages/website/ts/components/dialogs/u2f_not_supported_dialog.tsx b/packages/website/ts/components/dialogs/u2f_not_supported_dialog.tsx
index afbb30b82..bbec1d649 100644
--- a/packages/website/ts/components/dialogs/u2f_not_supported_dialog.tsx
+++ b/packages/website/ts/components/dialogs/u2f_not_supported_dialog.tsx
@@ -1,4 +1,4 @@
-import { colors } from '@0xproject/react-shared';
+import { colors } from '@0x/react-shared';
import Dialog from 'material-ui/Dialog';
import FlatButton from 'material-ui/FlatButton';
import * as React from 'react';
diff --git a/packages/website/ts/components/documentation/docs_logo.tsx b/packages/website/ts/components/documentation/docs_logo.tsx
new file mode 100644
index 000000000..2840d5960
--- /dev/null
+++ b/packages/website/ts/components/documentation/docs_logo.tsx
@@ -0,0 +1,20 @@
+import { Link } from '@0x/react-shared';
+import * as React from 'react';
+import { WebsitePaths } from 'ts/types';
+
+export interface DocsLogoProps {
+ height: number;
+ containerStyle?: React.CSSProperties;
+}
+
+export const DocsLogo: React.StatelessComponent<DocsLogoProps> = props => {
+ return (
+ <Link to={WebsitePaths.Docs}>
+ <img src="/images/docs_logo.svg" height={props.height} />
+ </Link>
+ );
+};
+
+DocsLogo.defaultProps = {
+ containerStyle: {},
+};
diff --git a/packages/website/ts/components/documentation/docs_top_bar.tsx b/packages/website/ts/components/documentation/docs_top_bar.tsx
new file mode 100644
index 000000000..2054d0860
--- /dev/null
+++ b/packages/website/ts/components/documentation/docs_top_bar.tsx
@@ -0,0 +1,108 @@
+import { ALink, colors, Link } from '@0x/react-shared';
+import * as _ from 'lodash';
+import Drawer from 'material-ui/Drawer';
+import * as React from 'react';
+import { DocsLogo } from 'ts/components/documentation/docs_logo';
+import { Container } from 'ts/components/ui/container';
+import { Text } from 'ts/components/ui/text';
+import { Deco, Key, ScreenWidths } from 'ts/types';
+import { constants } from 'ts/utils/constants';
+import { Translate } from 'ts/utils/translate';
+
+export interface DocsTopBarProps {
+ location: Location;
+ screenWidth: ScreenWidths;
+ translate: Translate;
+ sidebar?: React.ReactNode;
+}
+
+interface DocsTopBarState {
+ isDrawerOpen: boolean;
+}
+
+export class DocsTopBar extends React.Component<DocsTopBarProps, DocsTopBarState> {
+ constructor(props: DocsTopBarProps) {
+ super(props);
+ this.state = {
+ isDrawerOpen: false,
+ };
+ }
+ public componentWillReceiveProps(nextProps: DocsTopBarProps): void {
+ if (nextProps.location.pathname !== this.props.location.pathname) {
+ this.setState({
+ isDrawerOpen: false,
+ });
+ }
+ }
+ public render(): React.ReactNode {
+ return (
+ <Container height={80}>
+ <Container
+ className="flex items-center lg-pt3 md-pt3 sm-pt1 lg-mt1 md-mt1 sm-mt0 lg-justify-end md-justify-end sm-justify-start"
+ width="100%"
+ >
+ <Container className="sm-hide xs-hide">
+ <Container className="flex items-center justify-between right" width="300px">
+ {this._renderMenuItems(constants.DEVELOPER_TOPBAR_LINKS)}
+ </Container>
+ </Container>
+ <Container className="lg-hide md-hide">
+ <Container paddingTop="6px">
+ <DocsLogo height={30} />
+ </Container>
+ </Container>
+ <Container className="md-hide lg-hide absolute" right="18px" top="12px">
+ <i
+ className="zmdi zmdi-menu"
+ style={{
+ color: colors.grey700,
+ fontSize: 30,
+ cursor: 'pointer',
+ }}
+ onClick={this._onMenuButtonClick.bind(this)}
+ />
+ </Container>
+ </Container>
+ <Container width={'100%'} height={'1px'} backgroundColor={colors.grey300} marginTop={'13px'} />
+ {this.props.screenWidth === ScreenWidths.Sm && this._renderDrawer()}
+ </Container>
+ );
+ }
+ private _renderMenuItems(menuItemLinks: ALink[]): React.ReactNode {
+ const menuItems = _.map(menuItemLinks, menuItemInfo => {
+ return (
+ <Link
+ key={`menu-item-${menuItemInfo.title}`}
+ to={menuItemInfo.to}
+ shouldOpenInNewTab={menuItemInfo.shouldOpenInNewTab}
+ >
+ <Container className="flex items-center" paddingLeft="4px">
+ <Text fontSize="16px" fontColor={colors.lightLinkBlue} fontWeight="bold">
+ {this.props.translate.get(menuItemInfo.title as Key, Deco.Cap)}
+ </Text>
+ </Container>
+ </Link>
+ );
+ });
+ return menuItems;
+ }
+ private _renderDrawer(): React.ReactNode {
+ return (
+ <Drawer
+ open={this.state.isDrawerOpen}
+ docked={false}
+ openSecondary={true}
+ onRequestChange={this._onMenuButtonClick.bind(this)}
+ >
+ <Container className="clearfix pl1 pt2" onClick={this._onMenuButtonClick.bind(this)}>
+ {this.props.sidebar}
+ </Container>
+ </Drawer>
+ );
+ }
+ private _onMenuButtonClick(): void {
+ this.setState({
+ isDrawerOpen: !this.state.isDrawerOpen,
+ });
+ }
+}
diff --git a/packages/website/ts/components/documentation/overview_content.tsx b/packages/website/ts/components/documentation/overview_content.tsx
new file mode 100644
index 000000000..caabaf874
--- /dev/null
+++ b/packages/website/ts/components/documentation/overview_content.tsx
@@ -0,0 +1,134 @@
+import { colors, Link, MarkdownLinkBlock, utils as sharedUtils } from '@0x/react-shared';
+import { ObjectMap } from '@0x/types';
+import * as _ from 'lodash';
+import * as React from 'react';
+import * as ReactMarkdown from 'react-markdown';
+import { Element as ScrollElement } from 'react-scroll';
+import { TutorialButton } from 'ts/components/documentation/tutorial_button';
+import { Container } from 'ts/components/ui/container';
+import { Text } from 'ts/components/ui/text';
+import { Deco, Key, Package, TutorialInfo } from 'ts/types';
+import { Translate } from 'ts/utils/translate';
+
+export interface OverviewContentProps {
+ translate: Translate;
+ tutorials: TutorialInfo[];
+ categoryToPackages: ObjectMap<Package[]>;
+}
+
+export interface OverviewContentState {}
+
+export class OverviewContent extends React.Component<OverviewContentProps, OverviewContentState> {
+ public render(): React.ReactNode {
+ return (
+ <Container>
+ {this._renderSectionTitle(this.props.translate.get(Key.StartBuildOn0x, Deco.Cap))}
+ <Container paddingTop="12px">
+ {this._renderSectionDescription(this.props.translate.get(Key.StartBuildOn0xDescription, Deco.Cap))}
+ <Container marginTop="36px">
+ {_.map(this.props.tutorials, tutorialInfo => (
+ <ScrollElement
+ name={sharedUtils.getIdFromName(
+ this.props.translate.get(tutorialInfo.link.title as Key, Deco.Cap),
+ )}
+ key={`tutorial-${tutorialInfo.link.title}`}
+ >
+ <TutorialButton translate={this.props.translate} tutorialInfo={tutorialInfo} />
+ </ScrollElement>
+ ))}
+ </Container>
+ </Container>
+ <Container marginTop="32px" paddingBottom="100px">
+ {this._renderSectionTitle(this.props.translate.get(Key.LibrariesAndTools, Deco.CapWords))}
+ <Container paddingTop="12px">
+ {this._renderSectionDescription(
+ this.props.translate.get(Key.LibrariesAndToolsDescription, Deco.Cap),
+ )}
+ <Container marginTop="36px">
+ {_.map(this.props.categoryToPackages, (pkgs, category) =>
+ this._renderPackageCategory(category, pkgs),
+ )}
+ </Container>
+ </Container>
+ </Container>
+ </Container>
+ );
+ }
+ private _renderPackageCategory(category: string, pkgs: Package[]): React.ReactNode {
+ return (
+ <Container key={`category-${category}`}>
+ <Text fontSize="18px">{category}</Text>
+ <Container>{_.map(pkgs, pkg => this._renderPackage(pkg))}</Container>
+ </Container>
+ );
+ }
+ private _renderPackage(pkg: Package): React.ReactNode {
+ const id = sharedUtils.getIdFromName(pkg.link.title);
+ return (
+ <ScrollElement name={id} key={`package-${pkg.link.title}`}>
+ <Container className="pb2">
+ <Container width="100%" height="1px" backgroundColor={colors.grey300} marginTop="11px" />
+ <Container className="clearfix mt2 pt1">
+ <Container className="md-col lg-col md-col-4 lg-col-4">
+ <Link
+ to={pkg.link.to}
+ fontColor={colors.lightLinkBlue}
+ shouldOpenInNewTab={!!pkg.link.shouldOpenInNewTab}
+ >
+ <Text Tag="div" fontColor={colors.lightLinkBlue} fontWeight="bold">
+ {pkg.link.title}
+ </Text>
+ </Link>
+ </Container>
+ <Container className="md-col lg-col md-col-6 lg-col-6 sm-py2">
+ <Text fontColor={colors.grey700}>
+ <ReactMarkdown
+ source={pkg.description}
+ renderers={{
+ link: MarkdownLinkBlock,
+ paragraph: 'span',
+ }}
+ />
+ </Text>
+ </Container>
+ <Container className="md-col lg-col md-col-2 lg-col-2 sm-pb2 relative">
+ <Container position="absolute" right="0px">
+ <Link
+ to={pkg.link.to}
+ fontColor={colors.lightLinkBlue}
+ shouldOpenInNewTab={!!pkg.link.shouldOpenInNewTab}
+ >
+ <Container className="flex">
+ <Container>{this.props.translate.get(Key.More, Deco.Cap)}</Container>
+ <Container paddingTop="1px" paddingLeft="6px">
+ <i
+ className="zmdi zmdi-chevron-right bold"
+ style={{ fontSize: 18, color: colors.lightLinkBlue }}
+ />
+ </Container>
+ </Container>
+ </Link>
+ </Container>
+ </Container>
+ </Container>
+ </Container>
+ </ScrollElement>
+ );
+ }
+ private _renderSectionTitle(text: string): React.ReactNode {
+ return (
+ <Container paddingTop="30px">
+ <Text fontColor={colors.projectsGrey} fontSize="30px" fontWeight="bold">
+ {text}
+ </Text>
+ </Container>
+ );
+ }
+ private _renderSectionDescription(text: string): React.ReactNode {
+ return (
+ <Text fontColor={colors.linkSectionGrey} fontSize="16px" fontFamily="Roboto Mono">
+ {text}
+ </Text>
+ );
+ }
+} // tslint:disable:max-file-line-count
diff --git a/packages/website/ts/components/documentation/sidebar_header.tsx b/packages/website/ts/components/documentation/sidebar_header.tsx
new file mode 100644
index 000000000..fece2704b
--- /dev/null
+++ b/packages/website/ts/components/documentation/sidebar_header.tsx
@@ -0,0 +1,57 @@
+import { colors } from '@0x/react-shared';
+import * as _ from 'lodash';
+import * as React from 'react';
+import { VersionDropDown } from 'ts/components/documentation/version_drop_down';
+import { Container } from 'ts/components/ui/container';
+import { Text } from 'ts/components/ui/text';
+import { ScreenWidths } from 'ts/types';
+
+export interface SidebarHeaderProps {
+ screenWidth: ScreenWidths;
+ title: string;
+ docsVersion?: string;
+ availableDocVersions?: string[];
+ onVersionSelected?: () => void;
+}
+
+export const SidebarHeader: React.StatelessComponent<SidebarHeaderProps> = ({
+ screenWidth,
+ title,
+ docsVersion,
+ availableDocVersions,
+ onVersionSelected,
+}) => {
+ return (
+ <Container>
+ <Container className="flex justify-bottom">
+ <Container className="left pl1" width="150px">
+ <Text
+ fontColor={colors.lightLinkBlue}
+ fontSize={screenWidth === ScreenWidths.Sm ? '20px' : '22px'}
+ fontWeight="bold"
+ >
+ {title}
+ </Text>
+ </Container>
+ {!_.isUndefined(docsVersion) &&
+ !_.isUndefined(availableDocVersions) &&
+ !_.isUndefined(onVersionSelected) && (
+ <div className="right" style={{ alignSelf: 'flex-end' }}>
+ <VersionDropDown
+ selectedVersion={docsVersion}
+ versions={availableDocVersions}
+ onVersionSelected={onVersionSelected}
+ />
+ </div>
+ )}
+ </Container>
+ <Container
+ width={'100%'}
+ height={'1px'}
+ backgroundColor={colors.grey300}
+ marginTop="20px"
+ marginBottom="27px"
+ />
+ </Container>
+ );
+};
diff --git a/packages/website/ts/components/documentation/tutorial_button.tsx b/packages/website/ts/components/documentation/tutorial_button.tsx
new file mode 100644
index 000000000..b747ef598
--- /dev/null
+++ b/packages/website/ts/components/documentation/tutorial_button.tsx
@@ -0,0 +1,59 @@
+import { colors, Link } from '@0x/react-shared';
+import * as _ from 'lodash';
+import * as React from 'react';
+import { Container } from 'ts/components/ui/container';
+import { Text } from 'ts/components/ui/text';
+import { Deco, Key, TutorialInfo } from 'ts/types';
+import { Translate } from 'ts/utils/translate';
+
+import { styled } from 'ts/style/theme';
+
+export interface TutorialButtonProps {
+ className?: string;
+ translate: Translate;
+ tutorialInfo: TutorialInfo;
+}
+
+const PlainTutorialButton: React.StatelessComponent<TutorialButtonProps> = ({ translate, tutorialInfo, className }) => (
+ <Container className={className}>
+ <Link to={tutorialInfo.link.to} shouldOpenInNewTab={tutorialInfo.link.shouldOpenInNewTab}>
+ <div className="flex relative">
+ <div className="col col-1 flex items-center sm-pr3">
+ <img src={tutorialInfo.iconUrl} height={40} />
+ </div>
+ <div className="lg-pl2 md-pl2 sm-pl3 col col-10">
+ <Text Tag="div" fontSize="18" fontColor={colors.lightLinkBlue} fontWeight="bold">
+ {translate.get(tutorialInfo.link.title as Key, Deco.Cap)}
+ </Text>
+ <Text Tag="div" fontColor={colors.grey750} fontSize="16">
+ {translate.get(tutorialInfo.description as Key, Deco.Cap)}
+ </Text>
+ </div>
+ <div className="col col-1 flex items-center justify-end">
+ <div className="right">
+ <i
+ className="zmdi zmdi-chevron-right bold"
+ style={{ fontSize: 26, color: colors.lightLinkBlue }}
+ />
+ </div>
+ </div>
+ </div>
+ </Link>
+ </Container>
+);
+
+export const TutorialButton = styled(PlainTutorialButton)`
+ border-radius: 4px;
+ border: 1px solid ${colors.grey325};
+ background-color: ${colors.white};
+ &:hover {
+ border: 1px solid ${colors.lightLinkBlue};
+ background-color: ${colors.lightestBlue};
+ }
+ padding: 20px;
+ margin-bottom: 15px;
+`;
+
+TutorialButton.defaultProps = {};
+
+TutorialButton.displayName = 'TutorialButton';
diff --git a/packages/website/ts/components/documentation/version_drop_down.tsx b/packages/website/ts/components/documentation/version_drop_down.tsx
new file mode 100644
index 000000000..a1c8b0547
--- /dev/null
+++ b/packages/website/ts/components/documentation/version_drop_down.tsx
@@ -0,0 +1,80 @@
+import { colors } from '@0x/react-shared';
+import * as _ from 'lodash';
+import * as React from 'react';
+import { Button } from 'ts/components/ui/button';
+import { Container } from 'ts/components/ui/container';
+import { DropDown, DropdownMouseEvent } from 'ts/components/ui/drop_down';
+import { Text } from 'ts/components/ui/text';
+import { styled } from 'ts/style/theme';
+
+interface ActiveNodeProps {
+ className?: string;
+ selectedVersion: string;
+}
+
+const PlainActiveNode: React.StatelessComponent<ActiveNodeProps> = ({ className, selectedVersion }) => (
+ <Container className={className}>
+ <Container className="flex justify-center">
+ <Text fontColor={colors.grey700} fontSize="12px">
+ v {selectedVersion}
+ </Text>
+ <Container paddingLeft="6px">
+ <i className="zmdi zmdi-chevron-down" style={{ fontSize: 17, color: 'rgba(153, 153, 153, 0.8)' }} />
+ </Container>
+ </Container>
+ </Container>
+);
+
+const ActiveNode = styled(PlainActiveNode)`
+ cursor: pointer;
+ border: 2px solid ${colors.beigeWhite};
+ border-radius: 4px;
+ padding: 4px 6px 4px 8px;
+`;
+
+interface VersionDropDownProps {
+ selectedVersion: string;
+ versions: string[];
+ onVersionSelected: (semver: string) => void;
+}
+
+interface VersionDropDownState {}
+
+export class VersionDropDown extends React.Component<VersionDropDownProps, VersionDropDownState> {
+ public render(): React.ReactNode {
+ const activeNode = <ActiveNode selectedVersion={this.props.selectedVersion} />;
+ return (
+ <DropDown
+ activateEvent={DropdownMouseEvent.Click}
+ activeNode={activeNode}
+ popoverContent={this._renderDropdownMenu()}
+ anchorOrigin={{ horizontal: 'middle', vertical: 'bottom' }}
+ targetOrigin={{ horizontal: 'middle', vertical: 'top' }}
+ popoverStyle={{ borderRadius: 4 }}
+ />
+ );
+ }
+ private _renderDropdownMenu(): React.ReactNode {
+ const items = _.map(this.props.versions, version => {
+ const isSelected = version === this.props.selectedVersion;
+ return (
+ <Container key={`dropdown-items-${version}`}>
+ <Button
+ borderRadius="0px"
+ padding="0.8em 0em"
+ width="100%"
+ isDisabled={isSelected}
+ onClick={this._onClick.bind(this, version)}
+ >
+ v {version}
+ </Button>
+ </Container>
+ );
+ });
+ const dropdownMenu = <Container width="88px">{items}</Container>;
+ return dropdownMenu;
+ }
+ private _onClick(selectedVersion: string): void {
+ this.props.onVersionSelected(selectedVersion);
+ }
+}
diff --git a/packages/website/ts/components/dropdowns/developers_drop_down.tsx b/packages/website/ts/components/dropdowns/developers_drop_down.tsx
new file mode 100644
index 000000000..6e85c1499
--- /dev/null
+++ b/packages/website/ts/components/dropdowns/developers_drop_down.tsx
@@ -0,0 +1,162 @@
+import { ALink, colors, Link } from '@0x/react-shared';
+import * as _ from 'lodash';
+import * as React from 'react';
+import { Container } from 'ts/components/ui/container';
+import { DropDown } from 'ts/components/ui/drop_down';
+import { Text } from 'ts/components/ui/text';
+import { Deco, Key, WebsitePaths } from 'ts/types';
+import { constants } from 'ts/utils/constants';
+import { Translate } from 'ts/utils/translate';
+
+const gettingStartedKeyToLinkInfo1: ALink[] = [
+ {
+ title: Key.BuildARelayer,
+ to: `${WebsitePaths.Wiki}#Build-A-Relayer`,
+ },
+ {
+ title: Key.OrderBasics,
+ to: `${WebsitePaths.Wiki}#Create,-Validate,-Fill-Order`,
+ },
+];
+const gettingStartedKeyToLinkInfo2: ALink[] = [
+ {
+ title: Key.DevelopOnEthereum,
+ to: `${WebsitePaths.Wiki}#Ethereum-Development`,
+ },
+ {
+ title: Key.UseNetworkedLiquidity,
+ to: `${WebsitePaths.Wiki}#Find,-Submit,-Fill-Order-From-Relayer`,
+ },
+];
+const popularDocsToLinkInfos: ALink[] = [
+ {
+ title: Key.ZeroExJs,
+ to: WebsitePaths.ZeroExJs,
+ },
+ {
+ title: Key.Connect,
+ to: WebsitePaths.Connect,
+ },
+ {
+ title: Key.SmartContract,
+ to: WebsitePaths.SmartContracts,
+ },
+];
+const usefulLinksToLinkInfo: ALink[] = [
+ {
+ title: Key.Wiki,
+ to: WebsitePaths.Wiki,
+ },
+ {
+ title: Key.Github,
+ to: constants.URL_GITHUB_ORG,
+ shouldOpenInNewTab: true,
+ },
+ {
+ title: Key.Whitepaper,
+ to: WebsitePaths.Whitepaper,
+ shouldOpenInNewTab: true,
+ },
+];
+
+interface DevelopersDropDownProps {
+ location: Location;
+ translate: Translate;
+ menuItemStyles: React.CSSProperties;
+ menuIconStyle: React.CSSProperties;
+}
+
+interface DevelopersDropDownState {}
+
+export class DevelopersDropDown extends React.Component<DevelopersDropDownProps, DevelopersDropDownState> {
+ public render(): React.ReactNode {
+ const activeNode = (
+ <Container className="flex relative" paddingRight="10">
+ <Text fontColor={this.props.menuIconStyle.color}>
+ {this.props.translate.get(Key.Developers, Deco.Cap)}
+ </Text>
+ </Container>
+ );
+ return (
+ <DropDown
+ activeNode={activeNode}
+ popoverContent={this._renderDropdownMenu()}
+ anchorOrigin={{ horizontal: 'left', vertical: 'bottom' }}
+ targetOrigin={{ horizontal: 'left', vertical: 'top' }}
+ style={this.props.menuItemStyles}
+ popoverStyle={{ borderRadius: 4, width: 397, height: 373, marginTop: 0 }}
+ />
+ );
+ }
+ private _renderDropdownMenu(): React.ReactNode {
+ const sectionPadding = '28px';
+ const dropdownMenu = (
+ <Container>
+ <Container className="flex" padding={sectionPadding}>
+ <Container paddingRight="45px">
+ {this._renderLinkSection(gettingStartedKeyToLinkInfo1, 'Getting started')}
+ </Container>
+ <Container>{this._renderLinkSection(gettingStartedKeyToLinkInfo2)}</Container>
+ </Container>
+ <Container width="100%" height="1px" backgroundColor={colors.grey300} />
+ <Container className="flex" padding={sectionPadding}>
+ <Container paddingRight="62px">
+ <Container>{this._renderLinkSection(popularDocsToLinkInfos, 'Popular docs')}</Container>
+ </Container>
+ <Container>
+ <Container>{this._renderLinkSection(usefulLinksToLinkInfo, 'Useful links')}</Container>
+ </Container>
+ </Container>
+ <Link to={WebsitePaths.Docs} fontColor={colors.lightBlueA700}>
+ <Container
+ padding="0.9rem"
+ backgroundColor={colors.lightBgGrey}
+ borderBottomLeftRadius={4}
+ borderBottomRightRadius={4}
+ >
+ <Text fontColor={colors.lightBlueA700} fontWeight="bold" fontSize="14px" textAlign="center">
+ {this.props.translate.get(Key.ViewAllDocumentation, Deco.Upper)}
+ </Text>
+ </Container>
+ </Link>
+ </Container>
+ );
+ return dropdownMenu;
+ }
+ private _renderLinkSection(links: ALink[], title: string = ''): React.ReactNode {
+ const numLinks = links.length;
+ let i = 0;
+ const renderLinks = _.map(links, (link: ALink) => {
+ const isWikiLink = _.startsWith(link.to, WebsitePaths.Wiki) && _.includes(link.to, '#');
+ const isOnWiki = this.props.location.pathname === WebsitePaths.Wiki;
+ let to = link.to;
+ if (isWikiLink && isOnWiki) {
+ to = `${link.to.split('#')[1]}`;
+ }
+ i++;
+ const isLast = i === numLinks;
+ const linkText = this.props.translate.get(link.title as Key, Deco.Cap);
+ return (
+ <Container className={`pr1 pt1 ${!isLast && 'pb1'}`} key={`dev-dropdown-link-${link.title}`}>
+ <Link to={to} shouldOpenInNewTab={!!link.shouldOpenInNewTab}>
+ <Text fontFamily="Roboto, Roboto Mono" fontColor={colors.lightBlueA700}>
+ {linkText}
+ </Text>
+ </Link>
+ </Container>
+ );
+ });
+ return (
+ <Container>
+ <Container height="33px">
+ {!_.isEmpty(title) && (
+ <Text letterSpacing={1} fontColor={colors.linkSectionGrey} fontSize="14px" fontWeight={600}>
+ {title.toUpperCase()}
+ </Text>
+ )}
+ </Container>
+ {renderLinks}
+ </Container>
+ );
+ }
+}
diff --git a/packages/website/ts/components/dropdowns/network_drop_down.tsx b/packages/website/ts/components/dropdowns/network_drop_down.tsx
index 2fd2785d1..df2d72edc 100644
--- a/packages/website/ts/components/dropdowns/network_drop_down.tsx
+++ b/packages/website/ts/components/dropdowns/network_drop_down.tsx
@@ -1,4 +1,4 @@
-import { constants as sharedConstants } from '@0xproject/react-shared';
+import { constants as sharedConstants } from '@0x/react-shared';
import * as _ from 'lodash';
import DropDownMenu from 'material-ui/DropDownMenu';
import MenuItem from 'material-ui/MenuItem';
diff --git a/packages/website/ts/components/eth_weth_conversion_button.tsx b/packages/website/ts/components/eth_weth_conversion_button.tsx
index b0091a1c1..536ba924b 100644
--- a/packages/website/ts/components/eth_weth_conversion_button.tsx
+++ b/packages/website/ts/components/eth_weth_conversion_button.tsx
@@ -1,5 +1,5 @@
-import { BigNumber, logUtils } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { BigNumber, logUtils } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import * as _ from 'lodash';
import RaisedButton from 'material-ui/RaisedButton';
import * as React from 'react';
diff --git a/packages/website/ts/components/eth_wrappers.tsx b/packages/website/ts/components/eth_wrappers.tsx
index 0b282b2a1..4a9f3b2fe 100644
--- a/packages/website/ts/components/eth_wrappers.tsx
+++ b/packages/website/ts/components/eth_wrappers.tsx
@@ -1,12 +1,12 @@
-import { colors, EtherscanLinkSuffixes, utils as sharedUtils } from '@0xproject/react-shared';
-import { BigNumber } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { colors, EtherscanLinkSuffixes, utils as sharedUtils } from '@0x/react-shared';
+import { BigNumber } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import * as _ from 'lodash';
import Divider from 'material-ui/Divider';
import { Table, TableBody, TableHeader, TableHeaderColumn, TableRow, TableRowColumn } from 'material-ui/Table';
import * as moment from 'moment';
import * as React from 'react';
-import ReactTooltip = require('react-tooltip');
+import ReactTooltip from 'react-tooltip';
import { Blockchain } from 'ts/blockchain';
import { EthWethConversionButton } from 'ts/components/eth_weth_conversion_button';
import { Dispatcher } from 'ts/redux/dispatcher';
diff --git a/packages/website/ts/components/fill_order.tsx b/packages/website/ts/components/fill_order.tsx
index 3c3155349..3d0203573 100644
--- a/packages/website/ts/components/fill_order.tsx
+++ b/packages/website/ts/components/fill_order.tsx
@@ -1,14 +1,13 @@
-import { assetDataUtils, orderHashUtils } from '@0xproject/order-utils';
-import { colors } from '@0xproject/react-shared';
-import { BigNumber, logUtils } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { assetDataUtils, orderHashUtils } from '@0x/order-utils';
+import { colors, Link } from '@0x/react-shared';
+import { BigNumber, logUtils } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import * as accounting from 'accounting';
import * as _ from 'lodash';
import { Card, CardHeader, CardText } from 'material-ui/Card';
import Divider from 'material-ui/Divider';
import RaisedButton from 'material-ui/RaisedButton';
import * as React from 'react';
-import { Link } from 'react-router-dom';
import { Blockchain } from 'ts/blockchain';
import { TrackTokenConfirmationDialog } from 'ts/components/dialogs/track_token_confirmation_dialog';
import { FillOrderJSON } from 'ts/components/fill_order_json';
@@ -204,7 +203,10 @@ export class FillOrder extends React.Component<FillOrderProps, FillOrderState> {
.tokenAddress;
const makerToken = this.props.tokenByAddress[makerTokenAddress];
const makerAssetToken = {
- amount: orderMakerAmount.times(takerAssetToken.amount).div(orderTakerAmount),
+ amount: orderMakerAmount
+ .times(takerAssetToken.amount)
+ .div(orderTakerAmount)
+ .floor(),
symbol: makerToken.symbol,
};
const fillAssetToken = {
@@ -324,7 +326,7 @@ export class FillOrder extends React.Component<FillOrderProps, FillOrderState> {
return (
<div>
Order successfully filled. See the trade details in your{' '}
- <Link to={`${WebsitePaths.Portal}/trades`} style={{ color: colors.white }}>
+ <Link to={`${WebsitePaths.Portal}/trades`} fontColor={colors.white}>
trade history
</Link>
</div>
diff --git a/packages/website/ts/components/fill_order_json.tsx b/packages/website/ts/components/fill_order_json.tsx
index 1ecc426bd..41413eac2 100644
--- a/packages/website/ts/components/fill_order_json.tsx
+++ b/packages/website/ts/components/fill_order_json.tsx
@@ -1,5 +1,5 @@
-import { generatePseudoRandomSalt } from '@0xproject/order-utils';
-import { BigNumber } from '@0xproject/utils';
+import { generatePseudoRandomSalt } from '@0x/order-utils';
+import { BigNumber } from '@0x/utils';
import * as _ from 'lodash';
import Paper from 'material-ui/Paper';
import TextField from 'material-ui/TextField';
diff --git a/packages/website/ts/components/fill_warning_dialog.tsx b/packages/website/ts/components/fill_warning_dialog.tsx
index 4821aaabe..430abd013 100644
--- a/packages/website/ts/components/fill_warning_dialog.tsx
+++ b/packages/website/ts/components/fill_warning_dialog.tsx
@@ -1,4 +1,4 @@
-import { colors } from '@0xproject/react-shared';
+import { colors } from '@0x/react-shared';
import Dialog from 'material-ui/Dialog';
import FlatButton from 'material-ui/FlatButton';
import * as React from 'react';
diff --git a/packages/website/ts/components/flash_messages/asset_send_completed.tsx b/packages/website/ts/components/flash_messages/asset_send_completed.tsx
index f76e05fe1..b895126dc 100644
--- a/packages/website/ts/components/flash_messages/asset_send_completed.tsx
+++ b/packages/website/ts/components/flash_messages/asset_send_completed.tsx
@@ -1,6 +1,6 @@
-import { colors } from '@0xproject/react-shared';
-import { BigNumber } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { colors } from '@0x/react-shared';
+import { BigNumber } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import * as _ from 'lodash';
import * as React from 'react';
import { utils } from 'ts/utils/utils';
diff --git a/packages/website/ts/components/flash_messages/transaction_submitted.tsx b/packages/website/ts/components/flash_messages/transaction_submitted.tsx
index 2a6d2a64b..b1d909baa 100644
--- a/packages/website/ts/components/flash_messages/transaction_submitted.tsx
+++ b/packages/website/ts/components/flash_messages/transaction_submitted.tsx
@@ -1,4 +1,4 @@
-import { colors } from '@0xproject/react-shared';
+import { colors } from '@0x/react-shared';
import * as _ from 'lodash';
import * as React from 'react';
diff --git a/packages/website/ts/components/footer.tsx b/packages/website/ts/components/footer.tsx
index 6dcb5a0e9..dfedcba55 100644
--- a/packages/website/ts/components/footer.tsx
+++ b/packages/website/ts/components/footer.tsx
@@ -1,31 +1,17 @@
-import { colors } from '@0xproject/react-shared';
+import { ALink, colors, Link } from '@0x/react-shared';
+import { ObjectMap } from '@0x/types';
import * as _ from 'lodash';
import DropDownMenu from 'material-ui/DropDownMenu';
import MenuItem from 'material-ui/MenuItem';
import * as React from 'react';
-import { Link } from 'react-router-dom';
+
import { Dispatcher } from 'ts/redux/dispatcher';
import { Deco, Key, Language, WebsitePaths } from 'ts/types';
import { constants } from 'ts/utils/constants';
import { Translate } from 'ts/utils/translate';
-interface MenuItemsBySection {
- [sectionName: string]: FooterMenuItem[];
-}
-
-interface FooterMenuItem {
- title: string;
- path?: string;
- isExternal?: boolean;
-}
-
const ICON_DIMENSION = 16;
-const linkStyle = {
- color: colors.white,
- cursor: 'pointer',
-};
-
const languageToMenuTitle = {
[Language.English]: 'English',
[Language.Russian]: 'Русский',
@@ -51,76 +37,74 @@ export class Footer extends React.Component<FooterProps, FooterState> {
};
}
public render(): React.ReactNode {
- const menuItemsBySection: MenuItemsBySection = {
+ const sectionNameToLinks: ObjectMap<ALink[]> = {
[Key.Documentation]: [
{
+ title: 'Developer Home',
+ to: WebsitePaths.Docs,
+ },
+ {
title: '0x.js',
- path: WebsitePaths.ZeroExJs,
+ to: WebsitePaths.ZeroExJs,
},
{
title: this.props.translate.get(Key.SmartContracts, Deco.Cap),
- path: WebsitePaths.SmartContracts,
+ to: WebsitePaths.SmartContracts,
},
{
title: this.props.translate.get(Key.Connect, Deco.Cap),
- path: WebsitePaths.Connect,
+ to: WebsitePaths.Connect,
},
{
title: this.props.translate.get(Key.Whitepaper, Deco.Cap),
- path: WebsitePaths.Whitepaper,
- isExternal: true,
+ to: WebsitePaths.Whitepaper,
+ shouldOpenInNewTab: true,
},
{
title: this.props.translate.get(Key.Wiki, Deco.Cap),
- path: WebsitePaths.Wiki,
- },
- {
- title: this.props.translate.get(Key.Faq, Deco.Cap),
- path: WebsitePaths.FAQ,
+ to: WebsitePaths.Wiki,
},
],
[Key.Community]: [
{
title: this.props.translate.get(Key.RocketChat, Deco.Cap),
- isExternal: true,
- path: constants.URL_ZEROEX_CHAT,
+ to: constants.URL_ZEROEX_CHAT,
+ shouldOpenInNewTab: true,
},
{
title: this.props.translate.get(Key.Blog, Deco.Cap),
- isExternal: true,
- path: constants.URL_BLOG,
+ to: constants.URL_BLOG,
+ shouldOpenInNewTab: true,
},
{
title: 'Twitter',
- isExternal: true,
- path: constants.URL_TWITTER,
+ to: constants.URL_TWITTER,
+ shouldOpenInNewTab: true,
},
{
title: 'Reddit',
- isExternal: true,
- path: constants.URL_REDDIT,
+ to: constants.URL_REDDIT,
+ shouldOpenInNewTab: true,
},
{
title: this.props.translate.get(Key.Forum, Deco.Cap),
- isExternal: true,
- path: constants.URL_DISCOURSE_FORUM,
+ to: constants.URL_DISCOURSE_FORUM,
+ shouldOpenInNewTab: true,
},
],
[Key.Organization]: [
{
title: this.props.translate.get(Key.About, Deco.Cap),
- isExternal: false,
- path: WebsitePaths.About,
+ to: WebsitePaths.About,
},
{
title: this.props.translate.get(Key.Careers, Deco.Cap),
- isExternal: false,
- path: WebsitePaths.Careers,
+ to: WebsitePaths.Careers,
},
{
title: this.props.translate.get(Key.Contact, Deco.Cap),
- isExternal: true,
- path: 'mailto:team@0xproject.com',
+ to: 'mailto:team@0xproject.com',
+ shouldOpenInNewTab: true,
},
],
};
@@ -160,19 +144,19 @@ export class Footer extends React.Component<FooterProps, FooterState> {
<div className="col lg-col-4 md-col-4 col-12">
<div className="lg-right md-right sm-center">
{this._renderHeader(Key.Documentation)}
- {_.map(menuItemsBySection[Key.Documentation], this._renderMenuItem.bind(this))}
+ {_.map(sectionNameToLinks[Key.Documentation], this._renderMenuItem.bind(this))}
</div>
</div>
<div className="col lg-col-4 md-col-4 col-12 lg-pr2 md-pr2">
<div className="lg-right md-right sm-center">
{this._renderHeader(Key.Community)}
- {_.map(menuItemsBySection[Key.Community], this._renderMenuItem.bind(this))}
+ {_.map(sectionNameToLinks[Key.Community], this._renderMenuItem.bind(this))}
</div>
</div>
<div className="col lg-col-4 md-col-4 col-12">
<div className="lg-right md-right sm-center">
{this._renderHeader(Key.Organization)}
- {_.map(menuItemsBySection[Key.Organization], this._renderMenuItem.bind(this))}
+ {_.map(sectionNameToLinks[Key.Organization], this._renderMenuItem.bind(this))}
</div>
</div>
</div>
@@ -187,7 +171,7 @@ export class Footer extends React.Component<FooterProps, FooterState> {
</div>
);
}
- private _renderMenuItem(item: FooterMenuItem): React.ReactNode {
+ private _renderMenuItem(link: ALink): React.ReactNode {
const titleToIcon: { [title: string]: string } = {
[this.props.translate.get(Key.RocketChat, Deco.Cap)]: 'rocketchat.png',
[this.props.translate.get(Key.Blog, Deco.Cap)]: 'medium.png',
@@ -195,30 +179,26 @@ export class Footer extends React.Component<FooterProps, FooterState> {
Reddit: 'reddit.png',
[this.props.translate.get(Key.Forum, Deco.Cap)]: 'discourse.png',
};
- const iconIfExists = titleToIcon[item.title];
+ const iconIfExists = titleToIcon[link.title];
return (
- <div key={item.title} className="sm-center" style={{ fontSize: 13, paddingTop: 25 }}>
- {item.isExternal ? (
- <a className="text-decoration-none" style={linkStyle} target="_blank" href={item.path}>
+ <div key={link.title} className="sm-center" style={{ fontSize: 13, paddingTop: 25 }}>
+ <Link
+ to={link.to}
+ shouldOpenInNewTab={link.shouldOpenInNewTab}
+ fontColor={colors.white}
+ className="text-decoration-none"
+ >
+ <div>
{!_.isUndefined(iconIfExists) ? (
<div className="inline-block">
<div className="pr1 table-cell">{this._renderIcon(iconIfExists)}</div>
- <div className="table-cell">{item.title}</div>
+ <div className="table-cell">{link.title}</div>
</div>
) : (
- item.title
+ link.title
)}
- </a>
- ) : (
- <Link to={item.path} style={linkStyle} className="text-decoration-none">
- <div>
- {!_.isUndefined(iconIfExists) && (
- <div className="pr1">{this._renderIcon(iconIfExists)}</div>
- )}
- {item.title}
- </div>
- </Link>
- )}
+ </div>
+ </Link>
</div>
);
}
diff --git a/packages/website/ts/components/forms/subscribe_form.tsx b/packages/website/ts/components/forms/subscribe_form.tsx
index 761db7517..f5560cfa7 100644
--- a/packages/website/ts/components/forms/subscribe_form.tsx
+++ b/packages/website/ts/components/forms/subscribe_form.tsx
@@ -1,4 +1,4 @@
-import { colors } from '@0xproject/react-shared';
+import { colors } from '@0x/react-shared';
import * as _ from 'lodash';
import * as React from 'react';
diff --git a/packages/website/ts/components/generate_order/asset_picker.tsx b/packages/website/ts/components/generate_order/asset_picker.tsx
index 98aad6c62..e6ecd2ec8 100644
--- a/packages/website/ts/components/generate_order/asset_picker.tsx
+++ b/packages/website/ts/components/generate_order/asset_picker.tsx
@@ -3,7 +3,7 @@ import Dialog from 'material-ui/Dialog';
import FlatButton from 'material-ui/FlatButton';
import * as moment from 'moment';
import * as React from 'react';
-import firstBy = require('thenby');
+import firstBy from 'thenby';
import { Blockchain } from 'ts/blockchain';
import { NewTokenForm } from 'ts/components/generate_order/new_token_form';
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 ec153c005..8afbee977 100644
--- a/packages/website/ts/components/generate_order/generate_order_form.tsx
+++ b/packages/website/ts/components/generate_order/generate_order_form.tsx
@@ -1,7 +1,7 @@
-import { assetDataUtils, generatePseudoRandomSalt, orderHashUtils } from '@0xproject/order-utils';
-import { colors } from '@0xproject/react-shared';
-import { Order as ZeroExOrder } from '@0xproject/types';
-import { BigNumber, logUtils } from '@0xproject/utils';
+import { assetDataUtils, generatePseudoRandomSalt, orderHashUtils } from '@0x/order-utils';
+import { colors } from '@0x/react-shared';
+import { Order as ZeroExOrder } from '@0x/types';
+import { BigNumber, logUtils } from '@0x/utils';
import * as _ from 'lodash';
import Dialog from 'material-ui/Dialog';
import Divider from 'material-ui/Divider';
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 3d7eda84c..b8cd88b18 100644
--- a/packages/website/ts/components/generate_order/new_token_form.tsx
+++ b/packages/website/ts/components/generate_order/new_token_form.tsx
@@ -1,4 +1,4 @@
-import { colors } from '@0xproject/react-shared';
+import { colors } from '@0x/react-shared';
import * as _ from 'lodash';
import TextField from 'material-ui/TextField';
import * as moment from 'moment';
diff --git a/packages/website/ts/components/inputs/address_input.tsx b/packages/website/ts/components/inputs/address_input.tsx
index 39ec72f8a..1a71f8081 100644
--- a/packages/website/ts/components/inputs/address_input.tsx
+++ b/packages/website/ts/components/inputs/address_input.tsx
@@ -1,5 +1,5 @@
-import { colors } from '@0xproject/react-shared';
-import { addressUtils } from '@0xproject/utils';
+import { colors } from '@0x/react-shared';
+import { addressUtils } from '@0x/utils';
import * as _ from 'lodash';
import TextField from 'material-ui/TextField';
import * as React from 'react';
diff --git a/packages/website/ts/components/inputs/allowance_state_toggle.tsx b/packages/website/ts/components/inputs/allowance_state_toggle.tsx
index 39d2e3030..5396295d2 100644
--- a/packages/website/ts/components/inputs/allowance_state_toggle.tsx
+++ b/packages/website/ts/components/inputs/allowance_state_toggle.tsx
@@ -1,8 +1,8 @@
-import { colors } from '@0xproject/react-shared';
-import { BigNumber, logUtils } from '@0xproject/utils';
+import { colors } from '@0x/react-shared';
+import { BigNumber, logUtils } from '@0x/utils';
import * as _ from 'lodash';
import * as React from 'react';
-import ReactTooltip = require('react-tooltip');
+import ReactTooltip from 'react-tooltip';
import { Blockchain } from 'ts/blockchain';
import { AllowanceState, AllowanceStateView } from 'ts/components/ui/allowance_state_view';
import { Container } from 'ts/components/ui/container';
diff --git a/packages/website/ts/components/inputs/balance_bounded_input.tsx b/packages/website/ts/components/inputs/balance_bounded_input.tsx
index eb01e3ea6..83f263842 100644
--- a/packages/website/ts/components/inputs/balance_bounded_input.tsx
+++ b/packages/website/ts/components/inputs/balance_bounded_input.tsx
@@ -1,5 +1,5 @@
-import { colors } from '@0xproject/react-shared';
-import { BigNumber } from '@0xproject/utils';
+import { colors } from '@0x/react-shared';
+import { BigNumber } from '@0x/utils';
import * as _ from 'lodash';
import TextField from 'material-ui/TextField';
import * as React from 'react';
diff --git a/packages/website/ts/components/inputs/eth_amount_input.tsx b/packages/website/ts/components/inputs/eth_amount_input.tsx
index 3a7905442..6799e54bf 100644
--- a/packages/website/ts/components/inputs/eth_amount_input.tsx
+++ b/packages/website/ts/components/inputs/eth_amount_input.tsx
@@ -1,5 +1,5 @@
-import { BigNumber } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { BigNumber } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import * as _ from 'lodash';
import * as React from 'react';
import { BalanceBoundedInput } from 'ts/components/inputs/balance_bounded_input';
diff --git a/packages/website/ts/components/inputs/expiration_input.tsx b/packages/website/ts/components/inputs/expiration_input.tsx
index 5417ce715..3e43c1c07 100644
--- a/packages/website/ts/components/inputs/expiration_input.tsx
+++ b/packages/website/ts/components/inputs/expiration_input.tsx
@@ -1,4 +1,4 @@
-import { BigNumber } from '@0xproject/utils';
+import { BigNumber } from '@0x/utils';
import * as _ from 'lodash';
import DatePicker from 'material-ui/DatePicker';
import TimePicker from 'material-ui/TimePicker';
diff --git a/packages/website/ts/components/inputs/hash_input.tsx b/packages/website/ts/components/inputs/hash_input.tsx
index 5125ec4de..7688ffe21 100644
--- a/packages/website/ts/components/inputs/hash_input.tsx
+++ b/packages/website/ts/components/inputs/hash_input.tsx
@@ -1,9 +1,9 @@
-import { assetDataUtils, orderHashUtils } from '@0xproject/order-utils';
-import { Styles } from '@0xproject/react-shared';
-import { Order } from '@0xproject/types';
+import { assetDataUtils, orderHashUtils } from '@0x/order-utils';
+import { Styles } from '@0x/react-shared';
+import { Order } from '@0x/types';
import * as _ from 'lodash';
import * as React from 'react';
-import ReactTooltip = require('react-tooltip');
+import ReactTooltip from 'react-tooltip';
import { Blockchain } from 'ts/blockchain';
import { FakeTextField } from 'ts/components/ui/fake_text_field';
diff --git a/packages/website/ts/components/inputs/token_amount_input.tsx b/packages/website/ts/components/inputs/token_amount_input.tsx
index db093fb68..fded3a9dd 100644
--- a/packages/website/ts/components/inputs/token_amount_input.tsx
+++ b/packages/website/ts/components/inputs/token_amount_input.tsx
@@ -1,9 +1,8 @@
-import { colors } from '@0xproject/react-shared';
-import { BigNumber } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { colors, Link } from '@0x/react-shared';
+import { BigNumber } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import * as _ from 'lodash';
import * as React from 'react';
-import { Link } from 'react-router-dom';
import { Blockchain } from 'ts/blockchain';
import { BalanceBoundedInput } from 'ts/components/inputs/balance_bounded_input';
import { Token, ValidatedBigNumberCallback, WebsitePaths } from 'ts/types';
@@ -112,7 +111,8 @@ export class TokenAmountInput extends React.Component<TokenAmountInputProps, Tok
Insufficient allowance.{' '}
<Link
to={`${WebsitePaths.Portal}/account`}
- style={{ cursor: 'pointer', color: colors.darkestGrey }}
+ textDecoration="underline"
+ fontColor={colors.darkestGrey}
>
Set allowance
</Link>
diff --git a/packages/website/ts/components/inputs/token_input.tsx b/packages/website/ts/components/inputs/token_input.tsx
index 0bd36781e..c3c2d8b37 100644
--- a/packages/website/ts/components/inputs/token_input.tsx
+++ b/packages/website/ts/components/inputs/token_input.tsx
@@ -1,4 +1,4 @@
-import { colors } from '@0xproject/react-shared';
+import { colors } from '@0x/react-shared';
import Paper from 'material-ui/Paper';
import * as React from 'react';
import { Blockchain } from 'ts/blockchain';
diff --git a/packages/website/ts/components/nested_sidebar_menu.tsx b/packages/website/ts/components/nested_sidebar_menu.tsx
new file mode 100644
index 000000000..db7d55261
--- /dev/null
+++ b/packages/website/ts/components/nested_sidebar_menu.tsx
@@ -0,0 +1,92 @@
+import { ALink, colors, Link, utils as sharedUtils } from '@0x/react-shared';
+import { ObjectMap } from '@0x/types';
+import * as _ from 'lodash';
+import * as React from 'react';
+import { Button } from 'ts/components/ui/button';
+import { Text } from 'ts/components/ui/text';
+
+export interface NestedSidebarMenuProps {
+ sectionNameToLinks: ObjectMap<ALink[]>;
+ sidebarHeader?: React.ReactNode;
+ shouldReformatMenuItemNames?: boolean;
+}
+
+export const NestedSidebarMenu = (props: NestedSidebarMenuProps) => {
+ const navigation = _.map(props.sectionNameToLinks, (links: ALink[], sectionName: string) => {
+ const finalSectionName = sharedUtils.convertCamelCaseToSpaces(sectionName);
+ const menuItems = _.map(links, (link, i) => {
+ const menuItemTitle = props.shouldReformatMenuItemNames
+ ? _.capitalize(sharedUtils.convertDashesToSpaces(link.title))
+ : link.title;
+ const finalLink = {
+ ...link,
+ title: menuItemTitle,
+ };
+ return <MenuItem key={`menu-item-${menuItemTitle}`} link={finalLink} />;
+ });
+ // tslint:disable-next-line:no-unused-variable
+ return (
+ <div key={`section-${sectionName}`} className="py1" style={{ color: colors.greyTheme }}>
+ <Text fontSize="14px" letterSpacing="0.5" className="py1 pl1">
+ {finalSectionName.toUpperCase()}
+ </Text>
+ {menuItems}
+ </div>
+ );
+ });
+ return (
+ <div>
+ {props.sidebarHeader}
+ <div>{navigation}</div>
+ </div>
+ );
+};
+
+export interface MenuItemProps {
+ link: ALink;
+}
+
+export interface MenuItemState {
+ isActive: boolean;
+}
+
+export class MenuItem extends React.Component<MenuItemProps, MenuItemState> {
+ constructor(props: MenuItemProps) {
+ super(props);
+ const isActive = window.location.hash.slice(1) === props.link.to;
+ this.state = {
+ isActive,
+ };
+ }
+ public render(): React.ReactNode {
+ const isActive = this.state.isActive;
+ return (
+ <Link
+ to={this.props.link.to}
+ shouldOpenInNewTab={this.props.link.shouldOpenInNewTab}
+ onActivityChanged={this._onActivityChanged.bind(this)}
+ >
+ <Button
+ borderRadius="4px"
+ padding="0.4em 0.375em"
+ width="100%"
+ backgroundColor={isActive ? colors.lightLinkBlue : colors.grey100}
+ fontSize="14px"
+ textAlign="left"
+ >
+ <Text
+ fontWeight={isActive ? 'bold' : 'normal'}
+ fontColor={isActive ? colors.white : colors.grey800}
+ >
+ {this.props.link.title}
+ </Text>
+ </Button>
+ </Link>
+ );
+ }
+ private _onActivityChanged(isActive: boolean): void {
+ this.setState({
+ isActive,
+ });
+ }
+}
diff --git a/packages/website/ts/components/onboarding/add_eth_onboarding_step.tsx b/packages/website/ts/components/onboarding/add_eth_onboarding_step.tsx
index ca71fcd50..1d21e5a85 100644
--- a/packages/website/ts/components/onboarding/add_eth_onboarding_step.tsx
+++ b/packages/website/ts/components/onboarding/add_eth_onboarding_step.tsx
@@ -1,4 +1,4 @@
-import { BigNumber } from '@0xproject/utils';
+import { BigNumber } from '@0x/utils';
import * as React from 'react';
import { Balance } from 'ts/components/ui/balance';
import { Container } from 'ts/components/ui/container';
diff --git a/packages/website/ts/components/onboarding/install_wallet_onboarding_step.tsx b/packages/website/ts/components/onboarding/install_wallet_onboarding_step.tsx
index 1035d4ad9..173ba9a97 100644
--- a/packages/website/ts/components/onboarding/install_wallet_onboarding_step.tsx
+++ b/packages/website/ts/components/onboarding/install_wallet_onboarding_step.tsx
@@ -1,4 +1,4 @@
-import { colors } from '@0xproject/react-shared';
+import { colors } from '@0x/react-shared';
import * as React from 'react';
import { Container } from 'ts/components/ui/container';
import { Image } from 'ts/components/ui/image';
diff --git a/packages/website/ts/components/onboarding/onboarding_card.tsx b/packages/website/ts/components/onboarding/onboarding_card.tsx
index e1b0f304b..384bf7154 100644
--- a/packages/website/ts/components/onboarding/onboarding_card.tsx
+++ b/packages/website/ts/components/onboarding/onboarding_card.tsx
@@ -1,4 +1,4 @@
-import { colors } from '@0xproject/react-shared';
+import { colors } from '@0x/react-shared';
import * as React from 'react';
import * as _ from 'lodash';
diff --git a/packages/website/ts/components/onboarding/portal_onboarding_flow.tsx b/packages/website/ts/components/onboarding/portal_onboarding_flow.tsx
index 522687758..6adcec0b1 100644
--- a/packages/website/ts/components/onboarding/portal_onboarding_flow.tsx
+++ b/packages/website/ts/components/onboarding/portal_onboarding_flow.tsx
@@ -2,7 +2,7 @@ import * as _ from 'lodash';
import * as React from 'react';
import { RouteComponentProps, withRouter } from 'react-router';
-import { BigNumber } from '@0xproject/utils';
+import { BigNumber } from '@0x/utils';
import { Blockchain } from 'ts/blockchain';
import { AddEthOnboardingStep } from 'ts/components/onboarding/add_eth_onboarding_step';
import { CongratsOnboardingStep } from 'ts/components/onboarding/congrats_onboarding_step';
diff --git a/packages/website/ts/components/onboarding/wrap_eth_onboarding_step.tsx b/packages/website/ts/components/onboarding/wrap_eth_onboarding_step.tsx
index e4332de75..37eef867b 100644
--- a/packages/website/ts/components/onboarding/wrap_eth_onboarding_step.tsx
+++ b/packages/website/ts/components/onboarding/wrap_eth_onboarding_step.tsx
@@ -1,5 +1,5 @@
-import { colors } from '@0xproject/react-shared';
-import { BigNumber } from '@0xproject/utils';
+import { colors } from '@0x/react-shared';
+import { BigNumber } from '@0x/utils';
import * as React from 'react';
import { Balance } from 'ts/components/ui/balance';
import { Container } from 'ts/components/ui/container';
diff --git a/packages/website/ts/components/order_json.tsx b/packages/website/ts/components/order_json.tsx
index a2a53a523..f33681835 100644
--- a/packages/website/ts/components/order_json.tsx
+++ b/packages/website/ts/components/order_json.tsx
@@ -1,4 +1,4 @@
-import { BigNumber, fetchAsync, logUtils } from '@0xproject/utils';
+import { BigNumber, fetchAsync, logUtils } from '@0x/utils';
import * as _ from 'lodash';
import Paper from 'material-ui/Paper';
import TextField from 'material-ui/TextField';
diff --git a/packages/website/ts/components/portal/back_button.tsx b/packages/website/ts/components/portal/back_button.tsx
index ca35abc2b..bea69bb95 100644
--- a/packages/website/ts/components/portal/back_button.tsx
+++ b/packages/website/ts/components/portal/back_button.tsx
@@ -1,7 +1,5 @@
-import { Styles } from '@0xproject/react-shared';
+import { Link, Styles } from '@0x/react-shared';
import * as React from 'react';
-import { Link } from 'react-router-dom';
-
import { Island } from 'ts/components/ui/island';
import { colors } from 'ts/style/colors';
@@ -27,7 +25,7 @@ const styles: Styles = {
export const BackButton = (props: BackButtonProps) => {
return (
<div style={{ height: 65, paddingTop: 25 }}>
- <Link to={props.to} style={{ textDecoration: 'none' }}>
+ <Link to={props.to}>
<Island className="flex right" style={styles.backButton}>
<div style={{ marginLeft: 12 }}>
<i style={styles.backButtonIcon} className={`zmdi zmdi-arrow-left`} />
diff --git a/packages/website/ts/components/portal/drawer_menu.tsx b/packages/website/ts/components/portal/drawer_menu.tsx
index a6707e86c..7280a6102 100644
--- a/packages/website/ts/components/portal/drawer_menu.tsx
+++ b/packages/website/ts/components/portal/drawer_menu.tsx
@@ -1,4 +1,4 @@
-import { Styles } from '@0xproject/react-shared';
+import { Styles } from '@0x/react-shared';
import * as _ from 'lodash';
import * as React from 'react';
@@ -39,7 +39,7 @@ export interface DrawerMenuProps {
}
export const DrawerMenu = (props: DrawerMenuProps) => {
const relayerItemEntry = {
- to: `${WebsitePaths.Portal}`,
+ to: WebsitePaths.Portal,
labelText: 'Relayer ecosystem',
iconName: 'zmdi-portable-wifi',
};
diff --git a/packages/website/ts/components/portal/menu.tsx b/packages/website/ts/components/portal/menu.tsx
index 39dab77f5..d59101686 100644
--- a/packages/website/ts/components/portal/menu.tsx
+++ b/packages/website/ts/components/portal/menu.tsx
@@ -1,7 +1,7 @@
-import { Styles } from '@0xproject/react-shared';
+import { Styles } from '@0x/react-shared';
import * as _ from 'lodash';
import * as React from 'react';
-import { MenuItem } from 'ts/components/ui/menu_item';
+import { CustomMenuItem } from 'ts/components/ui/custom_menu_item';
import { colors } from 'ts/style/colors';
import { WebsitePaths } from 'ts/types';
@@ -67,14 +67,14 @@ export const Menu: React.StatelessComponent<MenuProps> = (props: MenuProps) => {
{_.map(props.menuItemEntries, entry => {
const isSelected = entry.to === props.selectedPath;
return (
- <MenuItem key={entry.to} to={entry.to}>
+ <CustomMenuItem key={entry.to} to={entry.to}>
<MenuItemLabel
title={entry.labelText}
iconName={entry.iconName}
selected={isSelected}
theme={props.theme}
/>
- </MenuItem>
+ </CustomMenuItem>
);
})}
</div>
diff --git a/packages/website/ts/components/portal/portal.tsx b/packages/website/ts/components/portal/portal.tsx
index b42954f60..94ab63ac6 100644
--- a/packages/website/ts/components/portal/portal.tsx
+++ b/packages/website/ts/components/portal/portal.tsx
@@ -1,9 +1,9 @@
-import { colors } from '@0xproject/react-shared';
-import { BigNumber } from '@0xproject/utils';
+import { colors, Link } from '@0x/react-shared';
+import { BigNumber } from '@0x/utils';
import * as _ from 'lodash';
import * as React from 'react';
import * as DocumentTitle from 'react-document-title';
-import { Link, Route, RouteComponentProps, Switch } from 'react-router-dom';
+import { Route, RouteComponentProps, Switch } from 'react-router-dom';
import { Blockchain } from 'ts/blockchain';
import { BlockchainErrDialog } from 'ts/components/dialogs/blockchain_err_dialog';
@@ -18,7 +18,7 @@ import { Loading } from 'ts/components/portal/loading';
import { Menu, MenuTheme } from 'ts/components/portal/menu';
import { Section } from 'ts/components/portal/section';
import { TextHeader } from 'ts/components/portal/text_header';
-import { RelayerIndex } from 'ts/components/relayer_index/relayer_index';
+import { RelayerIndex, RelayerIndexCellStyle } from 'ts/components/relayer_index/relayer_index';
import { TokenBalances } from 'ts/components/token_balances';
import { TopBar, TopBarDisplayType } from 'ts/components/top_bar/top_bar';
import { TradeHistory } from 'ts/components/trade_history/trade_history';
@@ -210,12 +210,16 @@ export class Portal extends React.Component<PortalProps, PortalState> {
isLoaded: false,
};
}
- this.setState({
- trackedTokenStateByAddress,
- });
- // Fetch the actual balance/allowance.
- // tslint:disable-next-line:no-floating-promises
- this._fetchBalancesAndAllowancesAsync(newTokenAddresses);
+ this.setState(
+ {
+ trackedTokenStateByAddress,
+ },
+ () => {
+ // Fetch the actual balance/allowance.
+ // tslint:disable-next-line:no-floating-promises
+ this._fetchBalancesAndAllowancesAsync(newTokenAddresses);
+ },
+ );
}
}
public render(): React.ReactNode {
@@ -317,7 +321,7 @@ export class Portal extends React.Component<PortalProps, PortalState> {
};
return (
<Section
- header={<BackButton to={`${WebsitePaths.Portal}`} labelText="back to Relayers" />}
+ header={<BackButton to={WebsitePaths.Portal} labelText="back to Relayers" />}
body={<Menu selectedPath={routeComponentProps.location.pathname} theme={menuTheme} />}
/>
);
@@ -389,9 +393,7 @@ export class Portal extends React.Component<PortalProps, PortalState> {
</Container>
);
return !shouldStartOnboarding ? (
- <Link to={{ pathname: `${WebsitePaths.Portal}/account` }} style={{ textDecoration: 'none' }}>
- {startOnboarding}
- </Link>
+ <Link to={`${WebsitePaths.Portal}/account`}>{startOnboarding}</Link>
) : (
startOnboarding
);
@@ -541,6 +543,7 @@ export class Portal extends React.Component<PortalProps, PortalState> {
}
private _renderRelayerIndexSection(): React.ReactNode {
const isMobile = utils.isMobileWidth(this.props.screenWidth);
+ // TODO(bmillman): revert RelayerIndex cellStyle to Expanded once data pipeline is tracking v2 volume
return (
<Section
header={!isMobile && <TextHeader labelText="0x Relayers" />}
@@ -551,7 +554,11 @@ export class Portal extends React.Component<PortalProps, PortalState> {
{this._renderStartOnboarding()}
</Container>
)}
- <RelayerIndex networkId={this.props.networkId} screenWidth={this.props.screenWidth} />
+ <RelayerIndex
+ networkId={this.props.networkId}
+ screenWidth={this.props.screenWidth}
+ cellStyle={RelayerIndexCellStyle.Minimized}
+ />
</Container>
}
/>
@@ -641,6 +648,9 @@ export class Portal extends React.Component<PortalProps, PortalState> {
}
private async _fetchBalancesAndAllowancesAsync(tokenAddresses: string[]): Promise<void> {
+ if (_.isEmpty(tokenAddresses)) {
+ return;
+ }
const trackedTokenStateByAddress = this.state.trackedTokenStateByAddress;
const userAddressIfExists = _.isEmpty(this.props.userAddress) ? undefined : this.props.userAddress;
const balancesAndAllowances = await Promise.all(
diff --git a/packages/website/ts/components/portal/text_header.tsx b/packages/website/ts/components/portal/text_header.tsx
index 853da3a29..b6045b832 100644
--- a/packages/website/ts/components/portal/text_header.tsx
+++ b/packages/website/ts/components/portal/text_header.tsx
@@ -1,4 +1,4 @@
-import { colors } from '@0xproject/react-shared';
+import { colors } from '@0x/react-shared';
import * as React from 'react';
import { Text } from 'ts/components/ui/text';
diff --git a/packages/website/ts/components/relayer_index/relayer_grid_tile.tsx b/packages/website/ts/components/relayer_index/relayer_grid_tile.tsx
index 193dd237a..7f1b4ebb4 100644
--- a/packages/website/ts/components/relayer_index/relayer_grid_tile.tsx
+++ b/packages/website/ts/components/relayer_index/relayer_grid_tile.tsx
@@ -1,4 +1,4 @@
-import { Styles } from '@0xproject/react-shared';
+import { Styles } from '@0x/react-shared';
import * as _ from 'lodash';
import { GridTile as PlainGridTile } from 'material-ui/GridList';
import * as React from 'react';
@@ -14,9 +14,15 @@ import { styled } from 'ts/style/theme';
import { WebsiteBackendRelayerInfo } from 'ts/types';
import { utils } from 'ts/utils/utils';
+export enum RelayerGridTileStyle {
+ Expanded = 0,
+ Minimized,
+}
+
export interface RelayerGridTileProps {
relayerInfo: WebsiteBackendRelayerInfo;
networkId: number;
+ style: RelayerGridTileStyle;
}
const styles: Styles = {
@@ -30,10 +36,14 @@ const styles: Styles = {
height: '100%',
boxSizing: 'border-box',
},
- header: {
+ expandedHeader: {
height: '50%',
width: '100%',
},
+ minimizedHeader: {
+ height: '100%',
+ width: '100%',
+ },
body: {
height: '50%',
width: '100%',
@@ -75,10 +85,12 @@ export const RelayerGridTile: React.StatelessComponent<RelayerGridTileProps> = (
!_.isUndefined(headerImageUrl) && !_.isUndefined(props.relayerInfo.primaryColor)
? props.relayerInfo.primaryColor
: FALLBACK_PRIMARY_COLOR;
+ const isExpanded = props.style === RelayerGridTileStyle.Expanded;
+ const headerStyle = isExpanded ? styles.expandedHeader : styles.minimizedHeader;
return (
<Island style={styles.root} Component={GridTile}>
<div style={styles.innerDiv} onClick={onClick}>
- <div className="flex items-center" style={{ ...styles.header, backgroundColor: headerBackgroundColor }}>
+ <div className="flex items-center" style={{ ...headerStyle, backgroundColor: headerBackgroundColor }}>
<Image
className="mx-auto"
src={props.relayerInfo.logoImgUrl}
@@ -86,21 +98,23 @@ export const RelayerGridTile: React.StatelessComponent<RelayerGridTileProps> = (
height={RELAYER_ICON_HEIGHT}
/>
</div>
- <div style={styles.body}>
- <div className="pb1" style={styles.relayerNameLabel}>
- {props.relayerInfo.name}
- </div>
- <Section titleText="Weekly Trade Volume">
- {!_.isUndefined(weeklyTxnVolume) && (
- <div style={styles.weeklyTradeVolumeLabel}>{props.relayerInfo.weeklyTxnVolume}</div>
- )}
- </Section>
- <Container marginTop="10px">
- <Section titleText="Top Tokens">
- {!_.isEmpty(topTokens) && <TopTokens tokens={topTokens} networkId={props.networkId} />}
+ {isExpanded && (
+ <div style={styles.body}>
+ <div className="pb1" style={styles.relayerNameLabel}>
+ {props.relayerInfo.name}
+ </div>
+ <Section titleText="Weekly Trade Volume">
+ {!_.isUndefined(weeklyTxnVolume) && (
+ <div style={styles.weeklyTradeVolumeLabel}>{props.relayerInfo.weeklyTxnVolume}</div>
+ )}
</Section>
- </Container>
- </div>
+ <Container marginTop="10px">
+ <Section titleText="Top Tokens">
+ {!_.isEmpty(topTokens) && <TopTokens tokens={topTokens} networkId={props.networkId} />}
+ </Section>
+ </Container>
+ </div>
+ )}
</div>
</Island>
);
diff --git a/packages/website/ts/components/relayer_index/relayer_index.tsx b/packages/website/ts/components/relayer_index/relayer_index.tsx
index 91dbeb27a..e88c20d7e 100644
--- a/packages/website/ts/components/relayer_index/relayer_index.tsx
+++ b/packages/website/ts/components/relayer_index/relayer_index.tsx
@@ -3,14 +3,20 @@ import CircularProgress from 'material-ui/CircularProgress';
import { GridList } from 'material-ui/GridList';
import * as React from 'react';
-import { RelayerGridTile } from 'ts/components/relayer_index/relayer_grid_tile';
+import { RelayerGridTile, RelayerGridTileStyle } from 'ts/components/relayer_index/relayer_grid_tile';
import { Retry } from 'ts/components/ui/retry';
import { ScreenWidths, WebsiteBackendRelayerInfo } from 'ts/types';
import { backendClient } from 'ts/utils/backend_client';
+export enum RelayerIndexCellStyle {
+ Expanded = 0,
+ Minimized,
+}
+
export interface RelayerIndexProps {
networkId: number;
screenWidth: ScreenWidths;
+ cellStyle: RelayerIndexCellStyle;
}
interface RelayerIndexState {
@@ -18,7 +24,8 @@ interface RelayerIndexState {
error?: Error;
}
-const CELL_HEIGHT = 290;
+const CELL_HEIGHT_EXPANDED = 290;
+const CELL_HEIGHT_MINIMIZED = 225;
const NUMBER_OF_COLUMNS_LARGE = 3;
const NUMBER_OF_COLUMNS_MEDIUM = 2;
const NUMBER_OF_COLUMNS_SMALL = 2;
@@ -61,15 +68,23 @@ export class RelayerIndex extends React.Component<RelayerIndexProps, RelayerInde
numberOfRelayers,
this._numberOfColumnsForScreenWidth(this.props.screenWidth),
);
+ const isExpanded = this.props.cellStyle === RelayerIndexCellStyle.Expanded;
+ const cellHeight = isExpanded ? CELL_HEIGHT_EXPANDED : CELL_HEIGHT_MINIMIZED;
+ const gridTileStyle = isExpanded ? RelayerGridTileStyle.Expanded : RelayerGridTileStyle.Minimized;
return (
<GridList
- cellHeight={CELL_HEIGHT}
+ cellHeight={cellHeight}
cols={numberOfColumns}
padding={GRID_PADDING}
style={{ marginTop: -10, marginBottom: 0 }}
>
{this.state.relayerInfos.map((relayerInfo: WebsiteBackendRelayerInfo, index) => (
- <RelayerGridTile key={index} relayerInfo={relayerInfo} networkId={this.props.networkId} />
+ <RelayerGridTile
+ key={index}
+ relayerInfo={relayerInfo}
+ networkId={this.props.networkId}
+ style={gridTileStyle}
+ />
))}
</GridList>
);
diff --git a/packages/website/ts/components/relayer_index/relayer_top_tokens.tsx b/packages/website/ts/components/relayer_index/relayer_top_tokens.tsx
index f3787bd27..558d99855 100644
--- a/packages/website/ts/components/relayer_index/relayer_top_tokens.tsx
+++ b/packages/website/ts/components/relayer_index/relayer_top_tokens.tsx
@@ -1,4 +1,4 @@
-import { colors, EtherscanLinkSuffixes, utils as sharedUtils } from '@0xproject/react-shared';
+import { colors, EtherscanLinkSuffixes, utils as sharedUtils } from '@0x/react-shared';
import * as _ from 'lodash';
import * as React from 'react';
diff --git a/packages/website/ts/components/send_button.tsx b/packages/website/ts/components/send_button.tsx
index 107983dee..27438e5d5 100644
--- a/packages/website/ts/components/send_button.tsx
+++ b/packages/website/ts/components/send_button.tsx
@@ -1,4 +1,4 @@
-import { BigNumber, logUtils } from '@0xproject/utils';
+import { BigNumber, logUtils } from '@0x/utils';
import * as _ from 'lodash';
import RaisedButton from 'material-ui/RaisedButton';
import * as React from 'react';
diff --git a/packages/website/ts/components/sidebar_header.tsx b/packages/website/ts/components/sidebar_header.tsx
deleted file mode 100644
index a14ab54f5..000000000
--- a/packages/website/ts/components/sidebar_header.tsx
+++ /dev/null
@@ -1,35 +0,0 @@
-import { colors } from '@0xproject/react-shared';
-import * as React from 'react';
-
-interface SidebarHeaderProps {
- title: string;
- iconUrl: string;
-}
-
-interface SidebarHeaderState {}
-
-export class SidebarHeader extends React.Component<SidebarHeaderProps, SidebarHeaderState> {
- public render(): React.ReactNode {
- return (
- <div className="pt2 md-px1 sm-px2" style={{ color: colors.black, paddingBottom: 18 }}>
- <div className="flex" style={{ fontSize: 25 }}>
- <div style={{ fontWeight: 'bold', fontFamily: 'Roboto Mono' }}>0x</div>
- <div className="pl2" style={{ lineHeight: 1.4, fontWeight: 300 }}>
- docs
- </div>
- </div>
- <div className="pl1" style={{ color: colors.grey350, paddingBottom: 9, paddingLeft: 10, height: 17 }}>
- |
- </div>
- <div className="flex">
- <div>
- <img src={this.props.iconUrl} width="22" />
- </div>
- <div className="pl1" style={{ fontWeight: 600, fontSize: 20, lineHeight: 1.2 }}>
- {this.props.title}
- </div>
- </div>
- </div>
- );
- }
-}
diff --git a/packages/website/ts/components/token_balances.tsx b/packages/website/ts/components/token_balances.tsx
index 5965ad9bd..92aecf046 100644
--- a/packages/website/ts/components/token_balances.tsx
+++ b/packages/website/ts/components/token_balances.tsx
@@ -4,9 +4,9 @@ import {
Networks,
Styles,
utils as sharedUtils,
-} from '@0xproject/react-shared';
-import { BigNumber, errorUtils, fetchAsync, logUtils } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+} from '@0x/react-shared';
+import { BigNumber, errorUtils, fetchAsync, logUtils } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import * as _ from 'lodash';
import Dialog from 'material-ui/Dialog';
import Divider from 'material-ui/Divider';
@@ -16,8 +16,8 @@ import ContentAdd from 'material-ui/svg-icons/content/add';
import ContentRemove from 'material-ui/svg-icons/content/remove';
import { Table, TableBody, TableHeader, TableHeaderColumn, TableRow, TableRowColumn } from 'material-ui/Table';
import * as React from 'react';
-import ReactTooltip = require('react-tooltip');
-import firstBy = require('thenby');
+import ReactTooltip from 'react-tooltip';
+import firstBy from 'thenby';
import { Blockchain } from 'ts/blockchain';
import { AssetPicker } from 'ts/components/generate_order/asset_picker';
import { SendButton } from 'ts/components/send_button';
diff --git a/packages/website/ts/components/top_bar/provider_display.tsx b/packages/website/ts/components/top_bar/provider_display.tsx
index 806eaeea5..c88c29b8e 100644
--- a/packages/website/ts/components/top_bar/provider_display.tsx
+++ b/packages/website/ts/components/top_bar/provider_display.tsx
@@ -1,4 +1,4 @@
-import { Styles } from '@0xproject/react-shared';
+import { Styles } from '@0x/react-shared';
import * as _ from 'lodash';
import CircularProgress from 'material-ui/CircularProgress';
import ActionAccountBalanceWallet from 'material-ui/svg-icons/action/account-balance-wallet';
diff --git a/packages/website/ts/components/top_bar/top_bar.tsx b/packages/website/ts/components/top_bar/top_bar.tsx
index 7cf3c6ecb..d5967cd1d 100644
--- a/packages/website/ts/components/top_bar/top_bar.tsx
+++ b/packages/website/ts/components/top_bar/top_bar.tsx
@@ -1,23 +1,16 @@
-import { DocsInfo, DocsMenu } from '@0xproject/react-docs';
-import {
- colors,
- constants as sharedConstants,
- MenuSubsectionsBySection,
- NestedSidebarMenu,
- Styles,
-} from '@0xproject/react-shared';
+import { DocsInfo } from '@0x/react-docs';
+import { ALink, colors, Link, Styles } from '@0x/react-shared';
+import { ObjectMap } from '@0x/types';
import * as _ from 'lodash';
import Drawer from 'material-ui/Drawer';
-import Menu from 'material-ui/Menu';
import MenuItem from 'material-ui/MenuItem';
import * as React from 'react';
-import { Link } from 'react-router-dom';
import { Blockchain } from 'ts/blockchain';
+import { DevelopersDropDown } from 'ts/components/dropdowns/developers_drop_down';
import { DrawerMenu } from 'ts/components/portal/drawer_menu';
import { ProviderDisplay } from 'ts/components/top_bar/provider_display';
import { TopBarMenuItem } from 'ts/components/top_bar/top_bar_menu_item';
import { Container } from 'ts/components/ui/container';
-import { DropDown } from 'ts/components/ui/drop_down';
import { Dispatcher } from 'ts/redux/dispatcher';
import { Deco, Key, ProviderType, WebsitePaths } from 'ts/types';
import { constants } from 'ts/utils/constants';
@@ -41,8 +34,7 @@ export interface TopBarProps {
translate: Translate;
docsVersion?: string;
availableDocVersions?: string[];
- menu?: DocsMenu;
- menuSubsectionsBySection?: MenuSubsectionsBySection;
+ sectionNameToLinks?: ObjectMap<ALink[]>;
displayType?: TopBarDisplayType;
docsInfo?: DocsInfo;
style?: React.CSSProperties;
@@ -80,20 +72,6 @@ const styles: Styles = {
},
};
-const DOC_WEBSITE_PATHS_TO_KEY = {
- [WebsitePaths.SolCov]: Key.SolCov,
- [WebsitePaths.SmartContracts]: Key.SmartContracts,
- [WebsitePaths.Web3Wrapper]: Key.Web3Wrapper,
- [WebsitePaths.SolCompiler]: Key.SolCompiler,
- [WebsitePaths.JSONSchemas]: Key.JsonSchemas,
- [WebsitePaths.Subproviders]: Key.Subproviders,
- [WebsitePaths.ContractWrappers]: Key.ContractWrappers,
- [WebsitePaths.Connect]: Key.Connect,
- [WebsitePaths.ZeroExJs]: Key.ZeroExJs,
- [WebsitePaths.OrderUtils]: Key.OrderUtils,
- [WebsitePaths.OrderWatcher]: Key.OrderWatcher,
-};
-
const DEFAULT_HEIGHT = 68;
const EXPANDED_HEIGHT = 75;
@@ -129,111 +107,6 @@ export class TopBar extends React.Component<TopBarProps, TopBarState> {
? 'flex mx-auto items-center max-width-4'
: 'flex mx-auto items-center';
const height = isExpandedDisplayType ? EXPANDED_HEIGHT : DEFAULT_HEIGHT;
- const developerSectionMenuItems = [
- <Link key="subMenuItem-zeroEx" to={WebsitePaths.ZeroExJs} className="text-decoration-none">
- <MenuItem style={{ fontSize: styles.menuItem.fontSize }} primaryText="0x.js" />
- </Link>,
- <Link key="subMenuItem-smartContracts" to={WebsitePaths.SmartContracts} className="text-decoration-none">
- <MenuItem
- style={{ fontSize: styles.menuItem.fontSize }}
- primaryText={this.props.translate.get(Key.SmartContracts, Deco.CapWords)}
- />
- </Link>,
- <Link key="subMenuItem-0xconnect" to={WebsitePaths.Connect} className="text-decoration-none">
- <MenuItem
- style={{ fontSize: styles.menuItem.fontSize }}
- primaryText={this.props.translate.get(Key.Connect, Deco.CapWords)}
- />
- </Link>,
- <a
- key="subMenuItem-standard-relayer-api"
- target="_blank"
- className="text-decoration-none"
- href={constants.URL_STANDARD_RELAYER_API_GITHUB}
- >
- <MenuItem
- style={{ fontSize: styles.menuItem.fontSize }}
- primaryText={this.props.translate.get(Key.StandardRelayerApi, Deco.CapWords)}
- />
- </a>,
- <Link key="subMenuItem-jsonSchema" to={WebsitePaths.JSONSchemas} className="text-decoration-none">
- <MenuItem
- style={{ fontSize: styles.menuItem.fontSize }}
- primaryText={this.props.translate.get(Key.JsonSchemas, Deco.CapWords)}
- />
- </Link>,
- <Link key="subMenuItem-subproviders" to={WebsitePaths.Subproviders} className="text-decoration-none">
- <MenuItem
- style={{ fontSize: styles.menuItem.fontSize }}
- primaryText={this.props.translate.get(Key.Subproviders, Deco.CapWords)}
- />
- </Link>,
- <Link key="subMenuItem-web3Wrapper" to={WebsitePaths.Web3Wrapper} className="text-decoration-none">
- <MenuItem
- style={{ fontSize: styles.menuItem.fontSize }}
- primaryText={this.props.translate.get(Key.Web3Wrapper, Deco.CapWords)}
- />
- </Link>,
- <Link
- key="subMenuItem-contractWrappers"
- to={WebsitePaths.ContractWrappers}
- className="text-decoration-none"
- >
- <MenuItem
- style={{ fontSize: styles.menuItem.fontSize }}
- primaryText={this.props.translate.get(Key.ContractWrappers, Deco.CapWords)}
- />
- </Link>,
- <Link key="subMenuItem-orderUtils" to={WebsitePaths.OrderUtils} className="text-decoration-none">
- <MenuItem
- style={{ fontSize: styles.menuItem.fontSize }}
- primaryText={this.props.translate.get(Key.OrderUtils, Deco.CapWords)}
- />
- </Link>,
- <Link key="subMenuItem-orderWatcher" to={WebsitePaths.OrderWatcher} className="text-decoration-none">
- <MenuItem
- style={{ fontSize: styles.menuItem.fontSize }}
- primaryText={this.props.translate.get(Key.OrderWatcher, Deco.CapWords)}
- />
- </Link>,
- <Link key="subMenuItem-sol-compiler" to={WebsitePaths.SolCompiler} className="text-decoration-none">
- <MenuItem
- style={{ fontSize: styles.menuItem.fontSize }}
- primaryText={this.props.translate.get(Key.SolCompiler, Deco.CapWords)}
- />
- </Link>,
- <Link key="subMenuItem-sol-cov" to={WebsitePaths.SolCov} className="text-decoration-none">
- <MenuItem
- style={{ fontSize: styles.menuItem.fontSize }}
- primaryText={this.props.translate.get(Key.SolCov, Deco.CapWords)}
- />
- </Link>,
- <Link key="subMenuItem-ethereum-types" to={WebsitePaths.EthereumTypes} className="text-decoration-none">
- <MenuItem
- style={{ fontSize: styles.menuItem.fontSize }}
- primaryText={this.props.translate.get(Key.EthereumTypes, Deco.CapWords)}
- />
- </Link>,
- <a
- key="subMenuItem-whitePaper"
- target="_blank"
- className="text-decoration-none"
- href={`${WebsitePaths.Whitepaper}`}
- >
- <MenuItem
- style={{ fontSize: styles.menuItem.fontSize }}
- primaryText={this.props.translate.get(Key.Whitepaper, Deco.CapWords)}
- />
- </a>,
- <a
- key="subMenuItem-github"
- target="_blank"
- className="text-decoration-none"
- href={constants.URL_GITHUB_ORG}
- >
- <MenuItem style={{ fontSize: styles.menuItem.fontSize }} primaryText="GitHub" />
- </a>,
- ];
const bottomBorderStyle = this._shouldDisplayBottomBar() ? styles.bottomBar : {};
const fullWidthClasses = isExpandedDisplayType ? 'pr4' : '';
const logoUrl = isNightVersion ? '/images/protocol_logo_white.png' : '/images/protocol_logo_black.png';
@@ -245,15 +118,6 @@ export class TopBar extends React.Component<TopBarProps, TopBarState> {
color: isNightVersion ? 'white' : 'black',
cursor: 'pointer',
};
- const activeNode = (
- <div className="flex relative" style={{ color: menuIconStyle.color }}>
- <div style={{ paddingRight: 10 }}>{this.props.translate.get(Key.Developers, Deco.Cap)}</div>
- <div className="absolute" style={{ paddingLeft: 3, right: 3, top: -2 }}>
- <i className="zmdi zmdi-caret-right" style={{ fontSize: 22 }} />
- </div>
- </div>
- );
- const popoverContent = <Menu style={{ color: colors.darkGrey }}>{developerSectionMenuItems}</Menu>;
return (
<div
style={{ ...styles.topBar, ...bottomBorderStyle, ...this.props.style, ...{ height } }}
@@ -266,56 +130,45 @@ export class TopBar extends React.Component<TopBarProps, TopBarState> {
paddingLeft={this.props.paddingLeft}
paddingRight={this.props.paddingRight}
>
- <Link to={`${WebsitePaths.Home}`} className="text-decoration-none">
+ <Link to={WebsitePaths.Home}>
<img src={logoUrl} height="30" />
</Link>
<div className="flex-auto" />
{!this._isViewingPortal() && (
<div className={menuClasses}>
<div className="flex items-center justify-between">
- <DropDown
- activeNode={activeNode}
- popoverContent={popoverContent}
- anchorOrigin={{ horizontal: 'middle', vertical: 'bottom' }}
- targetOrigin={{ horizontal: 'middle', vertical: 'top' }}
- style={styles.menuItem}
- />
- <TopBarMenuItem
- title={this.props.translate.get(Key.Wiki, Deco.Cap)}
- path={`${WebsitePaths.Wiki}`}
- style={styles.menuItem}
- isNightVersion={isNightVersion}
- isExternal={false}
+ <DevelopersDropDown
+ location={this.props.location}
+ menuItemStyles={{ ...styles.menuItem, paddingBottom: 12, paddingTop: 12 }}
+ translate={this.props.translate}
+ menuIconStyle={menuIconStyle}
/>
<TopBarMenuItem
title={this.props.translate.get(Key.Blog, Deco.Cap)}
path={constants.URL_BLOG}
style={styles.menuItem}
isNightVersion={isNightVersion}
- isExternal={true}
+ shouldOpenInNewTab={true}
/>
<TopBarMenuItem
title={this.props.translate.get(Key.About, Deco.Cap)}
- path={`${WebsitePaths.About}`}
+ path={WebsitePaths.About}
style={styles.menuItem}
isNightVersion={isNightVersion}
- isExternal={false}
/>
<TopBarMenuItem
title={this.props.translate.get(Key.Careers, Deco.Cap)}
- path={`${WebsitePaths.Careers}`}
+ path={WebsitePaths.Careers}
style={styles.menuItem}
isNightVersion={isNightVersion}
- isExternal={false}
/>
<TopBarMenuItem
title={this.props.translate.get(Key.TradeCallToAction, Deco.Cap)}
- path={`${WebsitePaths.Portal}`}
+ path={WebsitePaths.Portal}
isPrimary={true}
style={styles.menuItem}
className={`${isExpandedDisplayType && 'md-hide'}`}
isNightVersion={isNightVersion}
- isExternal={false}
/>
</div>
</div>
@@ -372,54 +225,35 @@ export class TopBar extends React.Component<TopBarProps, TopBarState> {
onRequestChange={this._onMenuButtonClick.bind(this)}
>
<div className="clearfix">
- {this._renderDocsMenu()}
- {this._renderWiki()}
<div className="pl1 py1 mt3" style={{ backgroundColor: colors.lightGrey }}>
{this.props.translate.get(Key.Website, Deco.Cap)}
</div>
- <Link to={WebsitePaths.Home} className="text-decoration-none">
+ <Link to={WebsitePaths.Home}>
<MenuItem className="py2">{this.props.translate.get(Key.Home, Deco.Cap)}</MenuItem>
</Link>
- <Link to={`${WebsitePaths.Wiki}`} className="text-decoration-none">
- <MenuItem className="py2">{this.props.translate.get(Key.Wiki, Deco.Cap)}</MenuItem>
+ <Link to={WebsitePaths.Docs}>
+ <MenuItem className="py2">{this.props.translate.get(Key.Docs, Deco.Cap)}</MenuItem>
</Link>
- {_.map(DOC_WEBSITE_PATHS_TO_KEY, (key, websitePath) => {
- if (!this._doesUrlInclude(websitePath)) {
- return (
- <Link
- key={`drawer-menu-item-${websitePath}`}
- to={websitePath}
- className="text-decoration-none"
- >
- <MenuItem className="py2">
- {this.props.translate.get(key, Deco.Cap)}{' '}
- {this.props.translate.get(Key.Docs, Deco.Cap)}
- </MenuItem>
- </Link>
- );
- }
- return null;
- })}
{!this._isViewingPortal() && (
- <Link to={`${WebsitePaths.Portal}`} className="text-decoration-none">
+ <Link to={WebsitePaths.Portal}>
<MenuItem className="py2">
{this.props.translate.get(Key.PortalDApp, Deco.CapWords)}
</MenuItem>
</Link>
)}
- <a className="text-decoration-none" target="_blank" href={`${WebsitePaths.Whitepaper}`}>
+ <Link to={WebsitePaths.Whitepaper} shouldOpenInNewTab={true}>
<MenuItem className="py2">{this.props.translate.get(Key.Whitepaper, Deco.Cap)}</MenuItem>
- </a>
- <Link to={`${WebsitePaths.About}`} className="text-decoration-none">
+ </Link>
+ <Link to={WebsitePaths.About}>
<MenuItem className="py2">{this.props.translate.get(Key.About, Deco.Cap)}</MenuItem>
</Link>
- <Link to={`${WebsitePaths.Careers}`} className="text-decoration-none">
+ <Link to={WebsitePaths.Careers}>
<MenuItem className="py2">{this.props.translate.get(Key.Careers, Deco.Cap)}</MenuItem>
</Link>
- <a className="text-decoration-none" target="_blank" href={constants.URL_BLOG}>
+ <Link to={constants.URL_BLOG} shouldOpenInNewTab={true}>
<MenuItem className="py2">{this.props.translate.get(Key.Blog, Deco.Cap)}</MenuItem>
- </a>
- <Link to={`${WebsitePaths.FAQ}`} className="text-decoration-none">
+ </Link>
+ <Link to={WebsitePaths.FAQ}>
<MenuItem className="py2" onClick={this._onMenuButtonClick.bind(this)}>
{this.props.translate.get(Key.Faq, Deco.Cap)}
</MenuItem>
@@ -428,49 +262,6 @@ export class TopBar extends React.Component<TopBarProps, TopBarState> {
</Drawer>
);
}
- private _renderDocsMenu(): React.ReactNode {
- const isViewingDocsPage = _.some(DOC_WEBSITE_PATHS_TO_KEY, (_key, websitePath) => {
- return this._doesUrlInclude(websitePath);
- });
- // HACK: We need to make sure the SCROLL_CONTAINER is loaded before rendering the Sidebar
- // because the sidebar renders `react-scroll` links which depend on the scroll container already
- // being rendered.
- const documentationContainer = document.getElementById(sharedConstants.SCROLL_CONTAINER_ID);
- if (!isViewingDocsPage || _.isUndefined(this.props.menu) || _.isNull(documentationContainer)) {
- return undefined;
- }
- return (
- <div className="lg-hide md-hide">
- <NestedSidebarMenu
- topLevelMenu={this.props.menu}
- menuSubsectionsBySection={this.props.menuSubsectionsBySection}
- sidebarHeader={this.props.sidebarHeader}
- shouldDisplaySectionHeaders={false}
- onMenuItemClick={this._onMenuButtonClick.bind(this)}
- selectedVersion={this.props.docsVersion}
- versions={this.props.availableDocVersions}
- onVersionSelected={this.props.onVersionSelected}
- />
- </div>
- );
- }
- private _renderWiki(): React.ReactNode {
- if (!this._isViewingWiki()) {
- return undefined;
- }
-
- return (
- <div className="lg-hide md-hide">
- <NestedSidebarMenu
- topLevelMenu={this.props.menuSubsectionsBySection}
- menuSubsectionsBySection={this.props.menuSubsectionsBySection}
- sidebarHeader={this.props.sidebarHeader}
- shouldDisplaySectionHeaders={false}
- onMenuItemClick={this._onMenuButtonClick.bind(this)}
- />
- </div>
- );
- }
private _onMenuButtonClick(): void {
this.setState({
isDrawerOpen: !this.state.isDrawerOpen,
@@ -479,28 +270,10 @@ export class TopBar extends React.Component<TopBarProps, TopBarState> {
private _isViewingPortal(): boolean {
return _.includes(this.props.location.pathname, WebsitePaths.Portal);
}
- private _isViewingDocs(): boolean {
- return _.includes(this.props.location.pathname, WebsitePaths.Docs);
- }
private _isViewingFAQ(): boolean {
return _.includes(this.props.location.pathname, WebsitePaths.FAQ);
}
- private _doesUrlInclude(aPath: string): boolean {
- return _.includes(this.props.location.pathname, aPath);
- }
- private _isViewingWiki(): boolean {
- return _.includes(this.props.location.pathname, WebsitePaths.Wiki);
- }
private _shouldDisplayBottomBar(): boolean {
- const isViewingDocsPage = _.some(DOC_WEBSITE_PATHS_TO_KEY, (_key, websitePath) => {
- return this._doesUrlInclude(websitePath);
- });
- return (
- isViewingDocsPage ||
- this._isViewingWiki() ||
- this._isViewingFAQ() ||
- this._isViewingDocs() ||
- this._isViewingPortal()
- );
+ return this._isViewingFAQ() || this._isViewingPortal();
}
} // tslint:disable:max-file-line-count
diff --git a/packages/website/ts/components/top_bar/top_bar_menu_item.tsx b/packages/website/ts/components/top_bar/top_bar_menu_item.tsx
index 25fab2868..9f15cffbb 100644
--- a/packages/website/ts/components/top_bar/top_bar_menu_item.tsx
+++ b/packages/website/ts/components/top_bar/top_bar_menu_item.tsx
@@ -1,7 +1,6 @@
-import { colors } from '@0xproject/react-shared';
+import { colors, Link } from '@0x/react-shared';
import * as _ from 'lodash';
import * as React from 'react';
-import { Link } from 'react-router-dom';
import { CallToAction } from 'ts/components/ui/button';
@@ -13,7 +12,7 @@ interface TopBarMenuItemProps {
title: string;
path?: string;
isPrimary?: boolean;
- isExternal: boolean;
+ shouldOpenInNewTab?: boolean;
style?: React.CSSProperties;
className?: string;
isNightVersion?: boolean;
@@ -26,6 +25,7 @@ export class TopBarMenuItem extends React.Component<TopBarMenuItemProps, TopBarM
isPrimary: false,
style: DEFAULT_STYLE,
className: '',
+ shouldOpenInNewTab: false,
isNightVersion: false,
};
public render(): React.ReactNode {
@@ -38,20 +38,9 @@ export class TopBarMenuItem extends React.Component<TopBarMenuItemProps, TopBarM
);
return (
<div className={`center ${this.props.className}`} style={{ ...this.props.style, color: menuItemColor }}>
- {this.props.isExternal ? (
- <a
- className="text-decoration-none"
- style={{ color: linkColor }}
- target="_blank"
- href={this.props.path}
- >
- {itemContent}
- </a>
- ) : (
- <Link to={this.props.path} className="text-decoration-none" style={{ color: linkColor }}>
- {itemContent}
- </Link>
- )}
+ <Link to={this.props.path} shouldOpenInNewTab={this.props.shouldOpenInNewTab} fontColor={linkColor}>
+ {itemContent}
+ </Link>
</div>
);
}
diff --git a/packages/website/ts/components/track_token_confirmation.tsx b/packages/website/ts/components/track_token_confirmation.tsx
index 294fb8590..e701686b0 100644
--- a/packages/website/ts/components/track_token_confirmation.tsx
+++ b/packages/website/ts/components/track_token_confirmation.tsx
@@ -1,4 +1,4 @@
-import { colors } from '@0xproject/react-shared';
+import { colors } from '@0x/react-shared';
import * as _ from 'lodash';
import * as React from 'react';
import { Party } from 'ts/components/ui/party';
diff --git a/packages/website/ts/components/trade_history/trade_history_item.tsx b/packages/website/ts/components/trade_history/trade_history_item.tsx
index 321a8b0e1..667027dce 100644
--- a/packages/website/ts/components/trade_history/trade_history_item.tsx
+++ b/packages/website/ts/components/trade_history/trade_history_item.tsx
@@ -1,6 +1,6 @@
-import { colors, EtherscanLinkSuffixes } from '@0xproject/react-shared';
-import { BigNumber } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { colors, EtherscanLinkSuffixes } from '@0x/react-shared';
+import { BigNumber } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import * as _ from 'lodash';
import Paper from 'material-ui/Paper';
import * as moment from 'moment';
diff --git a/packages/website/ts/components/ui/alert.tsx b/packages/website/ts/components/ui/alert.tsx
index b571d8c1c..32e0f1be8 100644
--- a/packages/website/ts/components/ui/alert.tsx
+++ b/packages/website/ts/components/ui/alert.tsx
@@ -1,4 +1,4 @@
-import { colors } from '@0xproject/react-shared';
+import { colors } from '@0x/react-shared';
import * as React from 'react';
import { AlertTypes } from 'ts/types';
diff --git a/packages/website/ts/components/ui/allowance_state_view.tsx b/packages/website/ts/components/ui/allowance_state_view.tsx
index 93d6b0ebb..fc754421a 100644
--- a/packages/website/ts/components/ui/allowance_state_view.tsx
+++ b/packages/website/ts/components/ui/allowance_state_view.tsx
@@ -1,4 +1,4 @@
-import { colors } from '@0xproject/react-shared';
+import { colors } from '@0x/react-shared';
import * as React from 'react';
import { Container } from 'ts/components/ui/container';
import { Spinner } from 'ts/components/ui/spinner';
diff --git a/packages/website/ts/components/ui/balance.tsx b/packages/website/ts/components/ui/balance.tsx
index 9e5a256b6..a1a8ff89b 100644
--- a/packages/website/ts/components/ui/balance.tsx
+++ b/packages/website/ts/components/ui/balance.tsx
@@ -1,4 +1,4 @@
-import { BigNumber } from '@0xproject/utils';
+import { BigNumber } from '@0x/utils';
import * as React from 'react';
import { Container } from 'ts/components/ui/container';
import { Text } from 'ts/components/ui/text';
diff --git a/packages/website/ts/components/ui/button.tsx b/packages/website/ts/components/ui/button.tsx
index 75ba7bcff..92f927843 100644
--- a/packages/website/ts/components/ui/button.tsx
+++ b/packages/website/ts/components/ui/button.tsx
@@ -1,4 +1,4 @@
-import { colors } from '@0xproject/react-shared';
+import { colors } from '@0x/react-shared';
import { darken, saturate } from 'polished';
import * as React from 'react';
import { styled } from 'ts/style/theme';
@@ -10,11 +10,13 @@ export interface ButtonProps {
fontFamily?: string;
backgroundColor?: string;
borderColor?: string;
+ borderRadius?: string;
width?: string;
padding?: string;
type?: string;
isDisabled?: boolean;
onClick?: (event: React.MouseEvent<HTMLElement>) => void;
+ textAlign?: string;
}
const PlainButton: React.StatelessComponent<ButtonProps> = ({ children, isDisabled, onClick, type, className }) => (
@@ -29,11 +31,12 @@ export const Button = styled(PlainButton)`
color: ${props => props.fontColor};
transition: background-color, opacity 0.5s ease;
padding: ${props => props.padding};
- border-radius: 6px;
+ border-radius: ${props => props.borderRadius};
font-weight: 500;
outline: none;
font-family: ${props => props.fontFamily};
width: ${props => props.width};
+ text-align: ${props => props.textAlign};
background-color: ${props => props.backgroundColor};
border: ${props => (props.borderColor ? `1px solid ${props.borderColor}` : 'none')};
&:hover {
@@ -52,11 +55,13 @@ export const Button = styled(PlainButton)`
Button.defaultProps = {
fontSize: '12px',
+ borderRadius: '6px',
backgroundColor: colors.white,
width: 'auto',
fontFamily: 'Roboto',
isDisabled: false,
padding: '0.8em 2.2em',
+ textAlign: 'center',
};
Button.displayName = 'Button';
diff --git a/packages/website/ts/components/ui/container.tsx b/packages/website/ts/components/ui/container.tsx
index f2ae68b70..ece077563 100644
--- a/packages/website/ts/components/ui/container.tsx
+++ b/packages/website/ts/components/ui/container.tsx
@@ -15,7 +15,11 @@ export interface ContainerProps {
paddingRight?: StringOrNum;
paddingLeft?: StringOrNum;
backgroundColor?: string;
+ background?: string;
borderRadius?: StringOrNum;
+ borderBottomLeftRadius?: StringOrNum;
+ borderBottomRightRadius?: StringOrNum;
+ borderBottom?: StringOrNum;
maxWidth?: StringOrNum;
maxHeight?: StringOrNum;
width?: StringOrNum;
diff --git a/packages/website/ts/components/ui/copy_icon.tsx b/packages/website/ts/components/ui/copy_icon.tsx
index 0330d1843..403cd4607 100644
--- a/packages/website/ts/components/ui/copy_icon.tsx
+++ b/packages/website/ts/components/ui/copy_icon.tsx
@@ -1,8 +1,8 @@
-import { colors } from '@0xproject/react-shared';
+import { colors } from '@0x/react-shared';
import * as React from 'react';
import * as CopyToClipboard from 'react-copy-to-clipboard';
import * as ReactDOM from 'react-dom';
-import ReactTooltip = require('react-tooltip');
+import ReactTooltip from 'react-tooltip';
interface CopyIconProps {
data: string;
diff --git a/packages/website/ts/components/ui/menu_item.tsx b/packages/website/ts/components/ui/custom_menu_item.tsx
index 0cb4b387c..87ce32126 100644
--- a/packages/website/ts/components/ui/menu_item.tsx
+++ b/packages/website/ts/components/ui/custom_menu_item.tsx
@@ -1,24 +1,23 @@
+import { Link } from '@0x/react-shared';
import * as _ from 'lodash';
import * as React from 'react';
-import { Link } from 'react-router-dom';
-interface MenuItemProps {
+interface CustomMenuItemProps {
to: string;
- style?: React.CSSProperties;
onClick?: () => void;
className?: string;
}
-interface MenuItemState {
+interface CustomMenuItemState {
isHovering: boolean;
}
-export class MenuItem extends React.Component<MenuItemProps, MenuItemState> {
- public static defaultProps: Partial<MenuItemProps> = {
+export class CustomMenuItem extends React.Component<CustomMenuItemProps, CustomMenuItemState> {
+ public static defaultProps: Partial<CustomMenuItemProps> = {
onClick: _.noop.bind(_),
className: '',
};
- public constructor(props: MenuItemProps) {
+ public constructor(props: CustomMenuItemProps) {
super(props);
this.state = {
isHovering: false,
@@ -30,7 +29,7 @@ export class MenuItem extends React.Component<MenuItemProps, MenuItemState> {
opacity: this.state.isHovering ? 0.5 : 1,
};
return (
- <Link to={this.props.to} style={{ textDecoration: 'none', ...this.props.style }}>
+ <Link to={this.props.to}>
<div
onClick={this.props.onClick.bind(this)}
className={`mx-auto ${this.props.className}`}
diff --git a/packages/website/ts/components/ui/drop_down.tsx b/packages/website/ts/components/ui/drop_down.tsx
index 4d5caef08..4138b3fe5 100644
--- a/packages/website/ts/components/ui/drop_down.tsx
+++ b/packages/website/ts/components/ui/drop_down.tsx
@@ -1,3 +1,4 @@
+import * as _ from 'lodash';
import Popover from 'material-ui/Popover';
import * as React from 'react';
import { MaterialUIPosition } from 'ts/types';
@@ -21,6 +22,7 @@ export interface DropDownProps {
zDepth?: number;
activateEvent?: DropdownMouseEvent;
closeEvent?: DropdownMouseEvent;
+ popoverStyle?: React.CSSProperties;
}
interface DropDownState {
@@ -34,6 +36,7 @@ export class DropDown extends React.Component<DropDownProps, DropDownState> {
zDepth: 1,
activateEvent: DropdownMouseEvent.Hover,
closeEvent: DropdownMouseEvent.Hover,
+ popoverStyle: {},
};
private _isHovering: boolean;
private _popoverCloseCheckIntervalId: number;
@@ -73,10 +76,15 @@ export class DropDown extends React.Component<DropDownProps, DropDownState> {
anchorEl={this.state.anchorEl}
anchorOrigin={this.props.anchorOrigin}
targetOrigin={this.props.targetOrigin}
- onRequestClose={this._closePopover.bind(this)}
+ onRequestClose={
+ this.props.closeEvent === DropdownMouseEvent.Click
+ ? this._closePopover.bind(this)
+ : _.noop.bind(_)
+ }
useLayerForClickAway={this.props.closeEvent === DropdownMouseEvent.Click}
animated={false}
zDepth={this.props.zDepth}
+ style={this.props.popoverStyle}
>
<div
onMouseEnter={this._onHover.bind(this)}
@@ -92,7 +100,7 @@ export class DropDown extends React.Component<DropDownProps, DropDownState> {
private _onActiveNodeClick(event: React.FormEvent<HTMLInputElement>): void {
if (this.props.activateEvent === DropdownMouseEvent.Click) {
this.setState({
- isDropDownOpen: true,
+ isDropDownOpen: !this.state.isDropDownOpen,
anchorEl: event.currentTarget,
});
}
diff --git a/packages/website/ts/components/ui/ethereum_address.tsx b/packages/website/ts/components/ui/ethereum_address.tsx
index f449a8e75..12f8636eb 100644
--- a/packages/website/ts/components/ui/ethereum_address.tsx
+++ b/packages/website/ts/components/ui/ethereum_address.tsx
@@ -1,6 +1,6 @@
-import { EtherscanLinkSuffixes } from '@0xproject/react-shared';
+import { EtherscanLinkSuffixes } from '@0x/react-shared';
import * as React from 'react';
-import ReactTooltip = require('react-tooltip');
+import ReactTooltip from 'react-tooltip';
import { EtherScanIcon } from 'ts/components/ui/etherscan_icon';
import { utils } from 'ts/utils/utils';
diff --git a/packages/website/ts/components/ui/etherscan_icon.tsx b/packages/website/ts/components/ui/etherscan_icon.tsx
index 0beb69123..a7fba8a33 100644
--- a/packages/website/ts/components/ui/etherscan_icon.tsx
+++ b/packages/website/ts/components/ui/etherscan_icon.tsx
@@ -1,7 +1,7 @@
-import { colors, EtherscanLinkSuffixes, utils as sharedUtils } from '@0xproject/react-shared';
+import { colors, EtherscanLinkSuffixes, utils as sharedUtils } from '@0x/react-shared';
import * as _ from 'lodash';
import * as React from 'react';
-import ReactTooltip = require('react-tooltip');
+import ReactTooltip from 'react-tooltip';
interface EtherScanIconProps {
addressOrTxHash: string;
diff --git a/packages/website/ts/components/ui/fake_text_field.tsx b/packages/website/ts/components/ui/fake_text_field.tsx
index ac3c30fec..7c3a482a4 100644
--- a/packages/website/ts/components/ui/fake_text_field.tsx
+++ b/packages/website/ts/components/ui/fake_text_field.tsx
@@ -1,4 +1,4 @@
-import { Styles } from '@0xproject/react-shared';
+import { Styles } from '@0x/react-shared';
import * as React from 'react';
import { InputLabel } from 'ts/components/ui/input_label';
diff --git a/packages/website/ts/components/ui/help_tooltip.tsx b/packages/website/ts/components/ui/help_tooltip.tsx
index d827eebb9..831d888f5 100644
--- a/packages/website/ts/components/ui/help_tooltip.tsx
+++ b/packages/website/ts/components/ui/help_tooltip.tsx
@@ -1,5 +1,5 @@
import * as React from 'react';
-import ReactTooltip = require('react-tooltip');
+import ReactTooltip from 'react-tooltip';
interface HelpTooltipProps {
style?: React.CSSProperties;
diff --git a/packages/website/ts/components/ui/icon_button.tsx b/packages/website/ts/components/ui/icon_button.tsx
index 13cd239da..9f469ec69 100644
--- a/packages/website/ts/components/ui/icon_button.tsx
+++ b/packages/website/ts/components/ui/icon_button.tsx
@@ -1,4 +1,4 @@
-import { colors, Styles } from '@0xproject/react-shared';
+import { colors, Styles } from '@0x/react-shared';
import * as _ from 'lodash';
import * as React from 'react';
diff --git a/packages/website/ts/components/ui/identicon.tsx b/packages/website/ts/components/ui/identicon.tsx
index b5b374973..9eca04a5d 100644
--- a/packages/website/ts/components/ui/identicon.tsx
+++ b/packages/website/ts/components/ui/identicon.tsx
@@ -1,4 +1,4 @@
-import blockies = require('blockies');
+import blockies from 'blockies';
import * as _ from 'lodash';
import * as React from 'react';
diff --git a/packages/website/ts/components/ui/input.tsx b/packages/website/ts/components/ui/input.tsx
index e01a71a53..e5f4f6c70 100644
--- a/packages/website/ts/components/ui/input.tsx
+++ b/packages/website/ts/components/ui/input.tsx
@@ -1,4 +1,4 @@
-import { colors } from '@0xproject/react-shared';
+import { colors } from '@0x/react-shared';
import * as React from 'react';
import { styled } from 'ts/style/theme';
diff --git a/packages/website/ts/components/ui/input_label.tsx b/packages/website/ts/components/ui/input_label.tsx
index 8eda45a5d..e7afb5a17 100644
--- a/packages/website/ts/components/ui/input_label.tsx
+++ b/packages/website/ts/components/ui/input_label.tsx
@@ -1,4 +1,4 @@
-import { colors, Styles } from '@0xproject/react-shared';
+import { colors, Styles } from '@0x/react-shared';
import * as React from 'react';
export interface InputLabelProps {
diff --git a/packages/website/ts/components/ui/lifecycle_raised_button.tsx b/packages/website/ts/components/ui/lifecycle_raised_button.tsx
index 0bb99b9d8..a8daf4102 100644
--- a/packages/website/ts/components/ui/lifecycle_raised_button.tsx
+++ b/packages/website/ts/components/ui/lifecycle_raised_button.tsx
@@ -1,5 +1,5 @@
-import { colors } from '@0xproject/react-shared';
-import { errorUtils } from '@0xproject/utils';
+import { colors } from '@0x/react-shared';
+import { errorUtils } from '@0x/utils';
import RaisedButton from 'material-ui/RaisedButton';
import * as React from 'react';
diff --git a/packages/website/ts/components/ui/party.tsx b/packages/website/ts/components/ui/party.tsx
index a25550475..f9e0967d4 100644
--- a/packages/website/ts/components/ui/party.tsx
+++ b/packages/website/ts/components/ui/party.tsx
@@ -1,7 +1,7 @@
-import { colors, EtherscanLinkSuffixes, utils as sharedUtils } from '@0xproject/react-shared';
+import { colors, EtherscanLinkSuffixes, utils as sharedUtils } from '@0x/react-shared';
import * as _ from 'lodash';
import * as React from 'react';
-import ReactTooltip = require('react-tooltip');
+import ReactTooltip from 'react-tooltip';
import { EthereumAddress } from 'ts/components/ui/ethereum_address';
import { Identicon } from 'ts/components/ui/identicon';
diff --git a/packages/website/ts/components/ui/pointer.tsx b/packages/website/ts/components/ui/pointer.tsx
index db0a4188d..c97b1e700 100644
--- a/packages/website/ts/components/ui/pointer.tsx
+++ b/packages/website/ts/components/ui/pointer.tsx
@@ -1,4 +1,4 @@
-import { colors } from '@0xproject/react-shared';
+import { colors } from '@0x/react-shared';
import * as React from 'react';
import { styled } from 'ts/style/theme';
diff --git a/packages/website/ts/components/ui/required_label.tsx b/packages/website/ts/components/ui/required_label.tsx
index 0f96586ec..5080462fa 100644
--- a/packages/website/ts/components/ui/required_label.tsx
+++ b/packages/website/ts/components/ui/required_label.tsx
@@ -1,4 +1,4 @@
-import { colors } from '@0xproject/react-shared';
+import { colors } from '@0x/react-shared';
import * as React from 'react';
export interface RequiredLabelProps {
diff --git a/packages/website/ts/components/ui/simple_menu.tsx b/packages/website/ts/components/ui/simple_menu.tsx
index 8a9349c6d..45ee752e3 100644
--- a/packages/website/ts/components/ui/simple_menu.tsx
+++ b/packages/website/ts/components/ui/simple_menu.tsx
@@ -1,7 +1,7 @@
+import { Link } from '@0x/react-shared';
import * as _ from 'lodash';
import * as React from 'react';
import * as CopyToClipboard from 'react-copy-to-clipboard';
-import { Link } from 'react-router-dom';
import { Container } from 'ts/components/ui/container';
import { Text } from 'ts/components/ui/text';
@@ -72,7 +72,7 @@ export const GoToAccountManagementSimpleMenuItem: React.StatelessComponent<
GoToAccountManagementSimpleMenuItemProps
> = ({ onClick }) => {
return (
- <Link to={`${WebsitePaths.Portal}/account`} style={{ textDecoration: 'none' }}>
+ <Link to={`${WebsitePaths.Portal}/account`}>
<SimpleMenuItem displayText="Manage Account..." onClick={onClick} />
</Link>
);
diff --git a/packages/website/ts/components/ui/spinner.tsx b/packages/website/ts/components/ui/spinner.tsx
index e8670cc3e..dc73e74e3 100644
--- a/packages/website/ts/components/ui/spinner.tsx
+++ b/packages/website/ts/components/ui/spinner.tsx
@@ -1,4 +1,4 @@
-import { colors } from '@0xproject/react-shared';
+import { colors } from '@0x/react-shared';
import * as React from 'react';
import { styled } from 'ts/style/theme';
diff --git a/packages/website/ts/components/ui/swap_icon.tsx b/packages/website/ts/components/ui/swap_icon.tsx
index f1d1ae7d4..406da8fe1 100644
--- a/packages/website/ts/components/ui/swap_icon.tsx
+++ b/packages/website/ts/components/ui/swap_icon.tsx
@@ -1,4 +1,4 @@
-import { colors } from '@0xproject/react-shared';
+import { colors } from '@0x/react-shared';
import * as React from 'react';
interface SwapIconProps {
diff --git a/packages/website/ts/components/ui/text.tsx b/packages/website/ts/components/ui/text.tsx
index cd8f290e3..c13e21913 100644
--- a/packages/website/ts/components/ui/text.tsx
+++ b/packages/website/ts/components/ui/text.tsx
@@ -1,4 +1,4 @@
-import { colors } from '@0xproject/react-shared';
+import { colors } from '@0x/react-shared';
import { darken } from 'polished';
import * as React from 'react';
import { styled } from 'ts/style/theme';
@@ -19,7 +19,9 @@ export interface TextProps {
textDecorationLine?: string;
onClick?: (event: React.MouseEvent<HTMLElement>) => void;
hoverColor?: string;
+ letterSpacing?: string | number;
noWrap?: boolean;
+ textAlign?: string;
display?: string;
}
@@ -34,6 +36,8 @@ export const Text = styled(PlainText)`
font-style: ${props => props.fontStyle};
font-weight: ${props => props.fontWeight};
font-size: ${props => props.fontSize};
+ text-align: ${props => props.textAlign};
+ letter-spacing: ${props => props.letterSpacing};
text-decoration-line: ${props => props.textDecorationLine};
${props => (props.lineHeight ? `line-height: ${props.lineHeight}` : '')};
${props => (props.center ? 'text-align: center' : '')};
diff --git a/packages/website/ts/components/visual_order.tsx b/packages/website/ts/components/visual_order.tsx
index a8d18006e..d723757d2 100644
--- a/packages/website/ts/components/visual_order.tsx
+++ b/packages/website/ts/components/visual_order.tsx
@@ -1,4 +1,4 @@
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import * as _ from 'lodash';
import * as React from 'react';
import { Party } from 'ts/components/ui/party';
diff --git a/packages/website/ts/components/wallet/wallet.tsx b/packages/website/ts/components/wallet/wallet.tsx
index 6abaa840b..d9da0b9d5 100644
--- a/packages/website/ts/components/wallet/wallet.tsx
+++ b/packages/website/ts/components/wallet/wallet.tsx
@@ -1,10 +1,10 @@
-import { EtherscanLinkSuffixes, utils as sharedUtils } from '@0xproject/react-shared';
-import { BigNumber, errorUtils } from '@0xproject/utils';
+import { EtherscanLinkSuffixes, utils as sharedUtils } from '@0x/react-shared';
+import { BigNumber, errorUtils } from '@0x/utils';
import * as _ from 'lodash';
import ActionAccountBalanceWallet from 'material-ui/svg-icons/action/account-balance-wallet';
import * as React from 'react';
-import firstBy = require('thenby');
+import firstBy from 'thenby';
import { Blockchain } from 'ts/blockchain';
import { AccountConnection } from 'ts/components/ui/account_connection';
diff --git a/packages/website/ts/components/wallet/wrap_ether_item.tsx b/packages/website/ts/components/wallet/wrap_ether_item.tsx
index 54ace7ae2..7de3afbf8 100644
--- a/packages/website/ts/components/wallet/wrap_ether_item.tsx
+++ b/packages/website/ts/components/wallet/wrap_ether_item.tsx
@@ -1,6 +1,6 @@
-import { Styles } from '@0xproject/react-shared';
-import { BigNumber, logUtils } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { Styles } from '@0x/react-shared';
+import { BigNumber, logUtils } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import * as _ from 'lodash';
import FlatButton from 'material-ui/FlatButton';
import * as React from 'react';
diff --git a/packages/website/ts/containers/asset_buyer_documentation.ts b/packages/website/ts/containers/asset_buyer_documentation.ts
new file mode 100644
index 000000000..c93b9332d
--- /dev/null
+++ b/packages/website/ts/containers/asset_buyer_documentation.ts
@@ -0,0 +1,71 @@
+import { DocsInfo, DocsInfoConfig, SupportedDocJson } from '@0x/react-docs';
+import * as React from 'react';
+import { connect } from 'react-redux';
+import { Dispatch } from 'redux';
+import { DocPage as DocPageComponent, DocPageProps } from 'ts/pages/documentation/doc_page';
+import { Dispatcher } from 'ts/redux/dispatcher';
+import { State } from 'ts/redux/reducer';
+import { DocPackages, ScreenWidths } from 'ts/types';
+import { Translate } from 'ts/utils/translate';
+
+/* tslint:disable:no-var-requires */
+const IntroMarkdown = require('md/docs/asset_buyer/introduction');
+const InstallationMarkdown = require('md/docs/asset_buyer/installation');
+const UsageMarkdown = require('md/docs/asset_buyer/usage');
+/* tslint:enable:no-var-requires */
+
+const markdownSections = {
+ introduction: 'introduction',
+ installation: 'installation',
+ usage: 'usage',
+};
+
+const docsInfoConfig: DocsInfoConfig = {
+ id: DocPackages.AssetBuyer,
+ packageName: '@0x/asset-buyer',
+ type: SupportedDocJson.TypeDoc,
+ displayName: 'AssetBuyer',
+ packageUrl: 'https://github.com/0xProject/0x-monorepo',
+ markdownMenu: {
+ introduction: [markdownSections.introduction],
+ install: [markdownSections.installation],
+ usage: [markdownSections.usage],
+ },
+ sectionNameToMarkdownByVersion: {
+ '0.0.1': {
+ [markdownSections.introduction]: IntroMarkdown,
+ [markdownSections.installation]: InstallationMarkdown,
+ [markdownSections.usage]: UsageMarkdown,
+ },
+ },
+ markdownSections,
+};
+const docsInfo = new DocsInfo(docsInfoConfig);
+
+interface ConnectedState {
+ docsVersion: string;
+ availableDocVersions: string[];
+ docsInfo: DocsInfo;
+ translate: Translate;
+ screenWidth: ScreenWidths;
+}
+
+interface ConnectedDispatch {
+ dispatcher: Dispatcher;
+}
+
+const mapStateToProps = (state: State, _ownProps: DocPageProps): ConnectedState => ({
+ docsVersion: state.docsVersion,
+ availableDocVersions: state.availableDocVersions,
+ translate: state.translate,
+ docsInfo,
+ screenWidth: state.screenWidth,
+});
+
+const mapDispatchToProps = (dispatch: Dispatch<State>): ConnectedDispatch => ({
+ dispatcher: new Dispatcher(dispatch),
+});
+
+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 a728abe2c..0f11e0809 100644
--- a/packages/website/ts/containers/connect_documentation.ts
+++ b/packages/website/ts/containers/connect_documentation.ts
@@ -1,17 +1,18 @@
-import { DocsInfo, DocsInfoConfig, SupportedDocJson } from '@0xproject/react-docs';
+import { DocsInfo, DocsInfoConfig, SupportedDocJson } from '@0x/react-docs';
import * as React from 'react';
import { connect } from 'react-redux';
import { Dispatch } from 'redux';
import { DocPage as DocPageComponent, DocPageProps } from 'ts/pages/documentation/doc_page';
import { Dispatcher } from 'ts/redux/dispatcher';
import { State } from 'ts/redux/reducer';
-import { DocPackages } from 'ts/types';
+import { DocPackages, ScreenWidths } from 'ts/types';
import { Translate } from 'ts/utils/translate';
/* tslint:disable:no-var-requires */
-const IntroMarkdownV1 = require('md/docs/connect/1.0.0/introduction');
-const IntroMarkdownV2 = require('md/docs/connect/2.0.0/introduction');
-const InstallationMarkdownV1 = require('md/docs/connect/1.0.0/installation');
+const IntroMarkdown1 = require('md/docs/connect/1/introduction');
+const IntroMarkdown2 = require('md/docs/connect/2/introduction');
+const InstallationMarkdown1 = require('md/docs/connect/1/installation');
+const InstallationMarkdown3 = require('md/docs/connect/3/installation');
/* tslint:enable:no-var-requires */
const markdownSections = {
@@ -21,22 +22,25 @@ const markdownSections = {
const docsInfoConfig: DocsInfoConfig = {
id: DocPackages.Connect,
- packageName: '@0xproject/connect',
+ packageName: '@0x/connect',
type: SupportedDocJson.TypeDoc,
displayName: '0x Connect',
packageUrl: 'https://github.com/0xProject/0x-monorepo',
markdownMenu: {
- introduction: [markdownSections.introduction],
- install: [markdownSections.installation],
+ 'getting-started': [markdownSections.introduction, markdownSections.installation],
},
sectionNameToMarkdownByVersion: {
'0.0.1': {
- [markdownSections.introduction]: IntroMarkdownV1,
- [markdownSections.installation]: InstallationMarkdownV1,
+ [markdownSections.introduction]: IntroMarkdown1,
+ [markdownSections.installation]: InstallationMarkdown1,
},
'2.0.0-rc.1': {
- [markdownSections.introduction]: IntroMarkdownV2,
- [markdownSections.installation]: InstallationMarkdownV1,
+ [markdownSections.introduction]: IntroMarkdown2,
+ [markdownSections.installation]: InstallationMarkdown1,
+ },
+ '3.0.2': {
+ [markdownSections.introduction]: IntroMarkdown2,
+ [markdownSections.installation]: InstallationMarkdown3,
},
},
markdownSections,
@@ -48,6 +52,7 @@ interface ConnectedState {
availableDocVersions: string[];
docsInfo: DocsInfo;
translate: Translate;
+ screenWidth: ScreenWidths;
}
interface ConnectedDispatch {
@@ -59,6 +64,7 @@ const mapStateToProps = (state: State, _ownProps: DocPageProps): ConnectedState
availableDocVersions: state.availableDocVersions,
translate: state.translate,
docsInfo,
+ screenWidth: state.screenWidth,
});
const mapDispatchToProps = (dispatch: Dispatch<State>): ConnectedDispatch => ({
diff --git a/packages/website/ts/containers/contract_wrappers_documentation.ts b/packages/website/ts/containers/contract_wrappers_documentation.ts
index 1e1735846..4c05605e3 100644
--- a/packages/website/ts/containers/contract_wrappers_documentation.ts
+++ b/packages/website/ts/containers/contract_wrappers_documentation.ts
@@ -1,16 +1,17 @@
-import { DocsInfo, DocsInfoConfig, SupportedDocJson } from '@0xproject/react-docs';
+import { DocsInfo, DocsInfoConfig, SupportedDocJson } from '@0x/react-docs';
import * as React from 'react';
import { connect } from 'react-redux';
import { Dispatch } from 'redux';
import { DocPage as DocPageComponent, DocPageProps } from 'ts/pages/documentation/doc_page';
import { Dispatcher } from 'ts/redux/dispatcher';
import { State } from 'ts/redux/reducer';
-import { DocPackages } from 'ts/types';
+import { DocPackages, ScreenWidths } from 'ts/types';
import { Translate } from 'ts/utils/translate';
/* tslint:disable:no-var-requires */
-const IntroMarkdown = require('md/docs/contract_wrappers/introduction');
-const InstallMarkdown = require('md/docs/contract_wrappers/installation');
+const IntroMarkdown1 = require('md/docs/contract_wrappers/1/introduction');
+const InstallMarkdownV1 = require('md/docs/contract_wrappers/1/installation');
+const InstallMarkdownV2 = require('md/docs/contract_wrappers/2/installation');
/* tslint:enable:no-var-requires */
const markdownSections = {
@@ -20,18 +21,21 @@ const markdownSections = {
const docsInfoConfig: DocsInfoConfig = {
id: DocPackages.ContractWrappers,
- packageName: '@0xproject/contract-wrappers',
+ packageName: '@0x/contract-wrappers',
type: SupportedDocJson.TypeDoc,
displayName: 'Contract Wrappers',
packageUrl: 'https://github.com/0xProject/0x-monorepo',
markdownMenu: {
- introduction: [markdownSections.introduction],
- install: [markdownSections.installation],
+ 'getting-started': [markdownSections.introduction, markdownSections.installation],
},
sectionNameToMarkdownByVersion: {
'0.0.1': {
- [markdownSections.introduction]: IntroMarkdown,
- [markdownSections.installation]: InstallMarkdown,
+ [markdownSections.introduction]: IntroMarkdown1,
+ [markdownSections.installation]: InstallMarkdownV1,
+ },
+ '3.0.0': {
+ [markdownSections.introduction]: IntroMarkdown1,
+ [markdownSections.installation]: InstallMarkdownV2,
},
},
markdownSections,
@@ -43,6 +47,7 @@ interface ConnectedState {
availableDocVersions: string[];
docsInfo: DocsInfo;
translate: Translate;
+ screenWidth: ScreenWidths;
}
interface ConnectedDispatch {
@@ -54,6 +59,7 @@ const mapStateToProps = (state: State, _ownProps: DocPageProps): ConnectedState
availableDocVersions: state.availableDocVersions,
docsInfo,
translate: state.translate,
+ screenWidth: state.screenWidth,
});
const mapDispatchToProps = (dispatch: Dispatch<State>): ConnectedDispatch => ({
diff --git a/packages/website/ts/containers/docs_home.ts b/packages/website/ts/containers/docs_home.ts
new file mode 100644
index 000000000..e0ca439a6
--- /dev/null
+++ b/packages/website/ts/containers/docs_home.ts
@@ -0,0 +1,31 @@
+import * as _ from 'lodash';
+import * as React from 'react';
+import { connect } from 'react-redux';
+import { Dispatch } from 'redux';
+import { DocsHome as DocsHomeComponent, DocsHomeProps } from 'ts/pages/documentation/docs_home';
+import { Dispatcher } from 'ts/redux/dispatcher';
+import { State } from 'ts/redux/reducer';
+import { ScreenWidths } from 'ts/types';
+import { Translate } from 'ts/utils/translate';
+
+interface ConnectedState {
+ translate: Translate;
+ screenWidth: ScreenWidths;
+}
+
+interface ConnectedDispatch {
+ dispatcher: Dispatcher;
+}
+
+const mapStateToProps = (state: State, _ownProps: DocsHomeProps): ConnectedState => ({
+ translate: state.translate,
+ screenWidth: state.screenWidth,
+});
+
+const mapDispatchToProps = (dispatch: Dispatch<State>): ConnectedDispatch => ({
+ dispatcher: new Dispatcher(dispatch),
+});
+
+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 2b6d6e64d..9d1df1d1f 100644
--- a/packages/website/ts/containers/ethereum_types_documentation.ts
+++ b/packages/website/ts/containers/ethereum_types_documentation.ts
@@ -1,11 +1,11 @@
-import { constants as docConstants, DocsInfo, DocsInfoConfig, SupportedDocJson } from '@0xproject/react-docs';
+import { constants as docConstants, DocsInfo, DocsInfoConfig, SupportedDocJson } from '@0x/react-docs';
import * as React from 'react';
import { connect } from 'react-redux';
import { Dispatch } from 'redux';
import { DocPage as DocPageComponent, DocPageProps } from 'ts/pages/documentation/doc_page';
import { Dispatcher } from 'ts/redux/dispatcher';
import { State } from 'ts/redux/reducer';
-import { DocPackages } from 'ts/types';
+import { DocPackages, ScreenWidths } from 'ts/types';
import { Translate } from 'ts/utils/translate';
/* tslint:disable:no-var-requires */
@@ -26,9 +26,7 @@ const docsInfoConfig: DocsInfoConfig = {
displayName: 'Ethereum Types',
packageUrl: 'https://github.com/0xProject/0x-monorepo/packages/ethereum-types',
markdownMenu: {
- introduction: [markdownSections.introduction],
- install: [markdownSections.installation],
- types: [markdownSections.types],
+ 'getting-started': [markdownSections.introduction, markdownSections.installation],
},
sectionNameToMarkdownByVersion: {
'0.0.1': {
@@ -45,6 +43,7 @@ interface ConnectedState {
availableDocVersions: string[];
docsInfo: DocsInfo;
translate: Translate;
+ screenWidth: ScreenWidths;
}
interface ConnectedDispatch {
@@ -56,6 +55,7 @@ const mapStateToProps = (state: State, _ownProps: DocPageProps): ConnectedState
availableDocVersions: state.availableDocVersions,
translate: state.translate,
docsInfo,
+ screenWidth: state.screenWidth,
});
const mapDispatchToProps = (dispatch: Dispatch<State>): ConnectedDispatch => ({
diff --git a/packages/website/ts/containers/generate_order_form.ts b/packages/website/ts/containers/generate_order_form.ts
index bc9d6f524..98b2831ce 100644
--- a/packages/website/ts/containers/generate_order_form.ts
+++ b/packages/website/ts/containers/generate_order_form.ts
@@ -1,4 +1,4 @@
-import { BigNumber } from '@0xproject/utils';
+import { BigNumber } from '@0x/utils';
import * as React from 'react';
import { connect } from 'react-redux';
import { Blockchain } from 'ts/blockchain';
diff --git a/packages/website/ts/containers/inputs/eth_amount_input.ts b/packages/website/ts/containers/inputs/eth_amount_input.ts
index 9ef903b55..45d3ddebd 100644
--- a/packages/website/ts/containers/inputs/eth_amount_input.ts
+++ b/packages/website/ts/containers/inputs/eth_amount_input.ts
@@ -1,5 +1,5 @@
-import { BigNumber } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { BigNumber } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import * as React from 'react';
import { connect } from 'react-redux';
import { State } from 'ts/redux/reducer';
diff --git a/packages/website/ts/containers/json_schemas_documentation.ts b/packages/website/ts/containers/json_schemas_documentation.ts
index f32a50ea9..9c4bb8e26 100644
--- a/packages/website/ts/containers/json_schemas_documentation.ts
+++ b/packages/website/ts/containers/json_schemas_documentation.ts
@@ -1,54 +1,66 @@
-import { DocsInfo, DocsInfoConfig, SupportedDocJson } from '@0xproject/react-docs';
+import { DocsInfo, DocsInfoConfig, SupportedDocJson } from '@0x/react-docs';
import * as React from 'react';
import { connect } from 'react-redux';
import { Dispatch } from 'redux';
import { DocPage as DocPageComponent, DocPageProps } from 'ts/pages/documentation/doc_page';
import { Dispatcher } from 'ts/redux/dispatcher';
import { State } from 'ts/redux/reducer';
-import { DocPackages } from 'ts/types';
+import { DocPackages, ScreenWidths } from 'ts/types';
import { Translate } from 'ts/utils/translate';
/* tslint:disable:no-var-requires */
-const IntroMarkdownV1 = require('md/docs/json_schemas/1.0.0/introduction');
-const InstallationMarkdownV1 = require('md/docs/json_schemas/1.0.0/installation');
-const UsageMarkdownV1 = require('md/docs/json_schemas/1.0.0/usage');
-const SchemasMarkdownV1 = require('md/docs/json_schemas/1.0.0/schemas');
-const SchemasMarkdownV2 = require('md/docs/json_schemas/2.0.0/schemas');
+const IntroMarkdown1 = require('md/docs/json_schemas/1/introduction');
+const IntroMarkdown3 = require('md/docs/json_schemas/3/introduction');
+const InstallationMarkdown1 = require('md/docs/json_schemas/1/installation');
+const InstallationMarkdown3 = require('md/docs/json_schemas/3/installation');
+const usageMarkdown1 = require('md/docs/json_schemas/1/usage');
+const usageMarkdown3 = require('md/docs/json_schemas/3/usage');
+const SchemasMarkdown1 = require('md/docs/json_schemas/1/schemas');
+const SchemasMarkdown2 = require('md/docs/json_schemas/2/schemas');
+const SchemasMarkdown3 = require('md/docs/json_schemas/3/schemas');
/* tslint:enable:no-var-requires */
const markdownSections = {
introduction: 'introduction',
installation: 'installation',
usage: 'usage',
- schemaValidator: 'schemaValidator',
schemas: 'schemas',
};
const docsInfoConfig: DocsInfoConfig = {
id: DocPackages.JSONSchemas,
- packageName: '@0xproject/json-schemas',
+ packageName: '@0x/json-schemas',
type: SupportedDocJson.TypeDoc,
displayName: 'JSON Schemas',
packageUrl: 'https://github.com/0xProject/0x-monorepo',
markdownMenu: {
- introduction: [markdownSections.introduction],
- install: [markdownSections.installation],
- usage: [markdownSections.usage],
- schemaValidator: [markdownSections.schemaValidator],
+ 'getting-started': [markdownSections.introduction, markdownSections.installation, markdownSections.usage],
schemas: [markdownSections.schemas],
},
sectionNameToMarkdownByVersion: {
'0.0.1': {
- [markdownSections.introduction]: IntroMarkdownV1,
- [markdownSections.installation]: InstallationMarkdownV1,
- [markdownSections.schemas]: SchemasMarkdownV1,
- [markdownSections.usage]: UsageMarkdownV1,
+ [markdownSections.introduction]: IntroMarkdown1,
+ [markdownSections.installation]: InstallationMarkdown1,
+ [markdownSections.schemas]: SchemasMarkdown1,
+ [markdownSections.usage]: usageMarkdown1,
},
'1.0.0': {
- [markdownSections.introduction]: IntroMarkdownV1,
- [markdownSections.installation]: InstallationMarkdownV1,
- [markdownSections.schemas]: SchemasMarkdownV2,
- [markdownSections.usage]: UsageMarkdownV1,
+ [markdownSections.introduction]: IntroMarkdown1,
+ [markdownSections.installation]: InstallationMarkdown1,
+ [markdownSections.schemas]: SchemasMarkdown2,
+ [markdownSections.usage]: usageMarkdown1,
+ },
+ '2.0.0': {
+ [markdownSections.introduction]: IntroMarkdown3,
+ [markdownSections.installation]: InstallationMarkdown3,
+ [markdownSections.schemas]: SchemasMarkdown2,
+ [markdownSections.usage]: usageMarkdown3,
+ },
+ '2.0.1': {
+ [markdownSections.introduction]: IntroMarkdown3,
+ [markdownSections.installation]: InstallationMarkdown3,
+ [markdownSections.schemas]: SchemasMarkdown3,
+ [markdownSections.usage]: usageMarkdown3,
},
},
markdownSections,
@@ -60,6 +72,7 @@ interface ConnectedState {
availableDocVersions: string[];
docsInfo: DocsInfo;
translate: Translate;
+ screenWidth: ScreenWidths;
}
interface ConnectedDispatch {
@@ -71,6 +84,7 @@ const mapStateToProps = (state: State, _ownProps: DocPageProps): ConnectedState
availableDocVersions: state.availableDocVersions,
translate: state.translate,
docsInfo,
+ screenWidth: state.screenWidth,
});
const mapDispatchToProps = (dispatch: Dispatch<State>): ConnectedDispatch => ({
diff --git a/packages/website/ts/containers/order_utils_documentation.ts b/packages/website/ts/containers/order_utils_documentation.ts
index b54c30a1e..f1d794988 100644
--- a/packages/website/ts/containers/order_utils_documentation.ts
+++ b/packages/website/ts/containers/order_utils_documentation.ts
@@ -1,16 +1,18 @@
-import { DocsInfo, DocsInfoConfig, SupportedDocJson } from '@0xproject/react-docs';
+import { DocsInfo, DocsInfoConfig, SupportedDocJson } from '@0x/react-docs';
import * as React from 'react';
import { connect } from 'react-redux';
import { Dispatch } from 'redux';
import { DocPage as DocPageComponent, DocPageProps } from 'ts/pages/documentation/doc_page';
import { Dispatcher } from 'ts/redux/dispatcher';
import { State } from 'ts/redux/reducer';
-import { DocPackages } from 'ts/types';
+import { DocPackages, ScreenWidths } from 'ts/types';
import { Translate } from 'ts/utils/translate';
/* tslint:disable:no-var-requires */
-const IntroMarkdownV1 = require('md/docs/order_utils/1.0.0/introduction');
-const InstallationMarkdownV1 = require('md/docs/order_utils/1.0.0/installation');
+const IntroMarkdown1 = require('md/docs/order_utils/1/introduction');
+const InstallationMarkdown1 = require('md/docs/order_utils/1/installation');
+const IntroMarkdown2 = require('md/docs/order_utils/2/introduction');
+const InstallationMarkdown2 = require('md/docs/order_utils/2/installation');
/* tslint:enable:no-var-requires */
const markdownSections = {
@@ -20,18 +22,21 @@ const markdownSections = {
const docsInfoConfig: DocsInfoConfig = {
id: DocPackages.OrderUtils,
- packageName: '@0xproject/order-utils',
+ packageName: '@0x/order-utils',
type: SupportedDocJson.TypeDoc,
displayName: 'Order utils',
packageUrl: 'https://github.com/0xProject/0x-monorepo',
markdownMenu: {
- introduction: [markdownSections.introduction],
- install: [markdownSections.installation],
+ 'getting-started': [markdownSections.introduction, markdownSections.installation],
},
sectionNameToMarkdownByVersion: {
'0.0.1': {
- [markdownSections.introduction]: IntroMarkdownV1,
- [markdownSections.installation]: InstallationMarkdownV1,
+ [markdownSections.introduction]: IntroMarkdown1,
+ [markdownSections.installation]: InstallationMarkdown1,
+ },
+ '2.0.0': {
+ [markdownSections.introduction]: IntroMarkdown2,
+ [markdownSections.installation]: InstallationMarkdown2,
},
},
markdownSections,
@@ -43,6 +48,7 @@ interface ConnectedState {
availableDocVersions: string[];
docsInfo: DocsInfo;
translate: Translate;
+ screenWidth: ScreenWidths;
}
interface ConnectedDispatch {
@@ -54,6 +60,7 @@ const mapStateToProps = (state: State, _ownProps: DocPageProps): ConnectedState
availableDocVersions: state.availableDocVersions,
translate: state.translate,
docsInfo,
+ screenWidth: state.screenWidth,
});
const mapDispatchToProps = (dispatch: Dispatch<State>): ConnectedDispatch => ({
diff --git a/packages/website/ts/containers/order_watcher_documentation.ts b/packages/website/ts/containers/order_watcher_documentation.ts
index 59a018847..ac92e6a22 100644
--- a/packages/website/ts/containers/order_watcher_documentation.ts
+++ b/packages/website/ts/containers/order_watcher_documentation.ts
@@ -1,16 +1,18 @@
-import { DocsInfo, DocsInfoConfig, SupportedDocJson } from '@0xproject/react-docs';
+import { DocsInfo, DocsInfoConfig, SupportedDocJson } from '@0x/react-docs';
import * as React from 'react';
import { connect } from 'react-redux';
import { Dispatch } from 'redux';
import { DocPage as DocPageComponent, DocPageProps } from 'ts/pages/documentation/doc_page';
import { Dispatcher } from 'ts/redux/dispatcher';
import { State } from 'ts/redux/reducer';
-import { DocPackages } from 'ts/types';
+import { DocPackages, ScreenWidths } from 'ts/types';
import { Translate } from 'ts/utils/translate';
/* tslint:disable:no-var-requires */
-const IntroMarkdown = require('md/docs/order_watcher/introduction');
-const InstallationMarkdown = require('md/docs/order_watcher/installation');
+const IntroMarkdown1 = require('md/docs/order_watcher/1/introduction');
+const InstallationMarkdown1 = require('md/docs/order_watcher/1/installation');
+const IntroMarkdown2 = require('md/docs/order_watcher/2/introduction');
+const InstallationMarkdown2 = require('md/docs/order_watcher/2/installation');
/* tslint:enable:no-var-requires */
const markdownSections = {
@@ -20,18 +22,21 @@ const markdownSections = {
const docsInfoConfig: DocsInfoConfig = {
id: DocPackages.OrderWatcher,
- packageName: '@0xproject/order-watcher',
+ packageName: '@0x/order-watcher',
type: SupportedDocJson.TypeDoc,
displayName: 'OrderWatcher',
packageUrl: 'https://github.com/0xProject/0x-monorepo',
markdownMenu: {
- introduction: [markdownSections.introduction],
- install: [markdownSections.installation],
+ 'getting-started': [markdownSections.introduction, markdownSections.installation],
},
sectionNameToMarkdownByVersion: {
'0.0.1': {
- [markdownSections.introduction]: IntroMarkdown,
- [markdownSections.installation]: InstallationMarkdown,
+ [markdownSections.introduction]: IntroMarkdown1,
+ [markdownSections.installation]: InstallationMarkdown1,
+ },
+ '2.2.0': {
+ [markdownSections.introduction]: IntroMarkdown2,
+ [markdownSections.installation]: InstallationMarkdown2,
},
},
markdownSections,
@@ -43,6 +48,7 @@ interface ConnectedState {
availableDocVersions: string[];
docsInfo: DocsInfo;
translate: Translate;
+ screenWidth: ScreenWidths;
}
interface ConnectedDispatch {
@@ -54,6 +60,7 @@ const mapStateToProps = (state: State, _ownProps: DocPageProps): ConnectedState
availableDocVersions: state.availableDocVersions,
translate: state.translate,
docsInfo,
+ screenWidth: state.screenWidth,
});
const mapDispatchToProps = (dispatch: Dispatch<State>): ConnectedDispatch => ({
diff --git a/packages/website/ts/containers/portal.ts b/packages/website/ts/containers/portal.ts
index 4d7ff2f55..5661e0a97 100644
--- a/packages/website/ts/containers/portal.ts
+++ b/packages/website/ts/containers/portal.ts
@@ -1,4 +1,4 @@
-import { BigNumber } from '@0xproject/utils';
+import { BigNumber } from '@0x/utils';
import * as _ from 'lodash';
import * as React from 'react';
import { connect } from 'react-redux';
diff --git a/packages/website/ts/containers/portal_onboarding_flow.ts b/packages/website/ts/containers/portal_onboarding_flow.ts
index a813205b1..66473733c 100644
--- a/packages/website/ts/containers/portal_onboarding_flow.ts
+++ b/packages/website/ts/containers/portal_onboarding_flow.ts
@@ -1,4 +1,4 @@
-import { BigNumber } from '@0xproject/utils';
+import { BigNumber } from '@0x/utils';
import * as React from 'react';
import { connect } from 'react-redux';
import { Dispatch } from 'redux';
diff --git a/packages/website/ts/containers/smart_contracts_documentation.ts b/packages/website/ts/containers/smart_contracts_documentation.ts
index 05b2a50c3..57c98fa3b 100644
--- a/packages/website/ts/containers/smart_contracts_documentation.ts
+++ b/packages/website/ts/containers/smart_contracts_documentation.ts
@@ -1,17 +1,17 @@
-import { DocsInfo, DocsInfoConfig, SupportedDocJson } from '@0xproject/react-docs';
-import { Networks } from '@0xproject/react-shared';
+import { DocsInfo, DocsInfoConfig, SupportedDocJson } from '@0x/react-docs';
+import { Networks } from '@0x/react-shared';
import * as React from 'react';
import { connect } from 'react-redux';
import { Dispatch } from 'redux';
import { DocPage as DocPageComponent, DocPageProps } from 'ts/pages/documentation/doc_page';
import { Dispatcher } from 'ts/redux/dispatcher';
import { State } from 'ts/redux/reducer';
-import { DocPackages, SmartContractDocSections as Sections } from 'ts/types';
+import { DocPackages, ScreenWidths, SmartContractDocSections as Sections } from 'ts/types';
import { Translate } from 'ts/utils/translate';
/* tslint:disable:no-var-requires */
-const IntroMarkdownV1 = require('md/docs/smart_contracts/1.0.0/introduction');
-const IntroMarkdownV2 = require('md/docs/smart_contracts/2.0.0/introduction');
+const IntroMarkdown1 = require('md/docs/smart_contracts/1/introduction');
+const IntroMarkdown2 = require('md/docs/smart_contracts/2/introduction');
/* tslint:enable:no-var-requires */
const docsInfoConfig: DocsInfoConfig = {
@@ -25,10 +25,10 @@ const docsInfoConfig: DocsInfoConfig = {
},
sectionNameToMarkdownByVersion: {
'0.0.1': {
- [Sections.Introduction]: IntroMarkdownV1,
+ [Sections.Introduction]: IntroMarkdown1,
},
'2.0.0': {
- [Sections.Introduction]: IntroMarkdownV2,
+ [Sections.Introduction]: IntroMarkdown2,
},
},
markdownSections: {
@@ -97,6 +97,7 @@ interface ConnectedState {
docsVersion: string;
availableDocVersions: string[];
translate: Translate;
+ screenWidth: ScreenWidths;
}
interface ConnectedDispatch {
@@ -108,6 +109,7 @@ const mapStateToProps = (state: State, _ownProps: DocPageProps): ConnectedState
docsVersion: state.docsVersion,
availableDocVersions: state.availableDocVersions,
translate: state.translate,
+ screenWidth: state.screenWidth,
});
const mapDispatchToProps = (dispatch: Dispatch<State>): ConnectedDispatch => ({
diff --git a/packages/website/ts/containers/sol_compiler_documentation.ts b/packages/website/ts/containers/sol_compiler_documentation.ts
index 20f26ed1d..f3a793e80 100644
--- a/packages/website/ts/containers/sol_compiler_documentation.ts
+++ b/packages/website/ts/containers/sol_compiler_documentation.ts
@@ -1,17 +1,19 @@
-import { DocsInfo, DocsInfoConfig, SupportedDocJson } from '@0xproject/react-docs';
+import { DocsInfo, DocsInfoConfig, SupportedDocJson } from '@0x/react-docs';
import * as React from 'react';
import { connect } from 'react-redux';
import { Dispatch } from 'redux';
import { DocPage as DocPageComponent, DocPageProps } from 'ts/pages/documentation/doc_page';
import { Dispatcher } from 'ts/redux/dispatcher';
import { State } from 'ts/redux/reducer';
-import { DocPackages } from 'ts/types';
+import { DocPackages, ScreenWidths } from 'ts/types';
import { Translate } from 'ts/utils/translate';
/* tslint:disable:no-var-requires */
-const IntroMarkdownV1 = require('md/docs/sol-compiler/introduction');
-const InstallationMarkdownV1 = require('md/docs/sol-compiler/installation');
-const UsageMarkdown = require('md/docs/sol-compiler/usage');
+const IntroMarkdown1 = require('md/docs/sol-compiler/1/introduction');
+const InstallationMarkdown1 = require('md/docs/sol-compiler/1/installation');
+const InstallationMarkdown2 = require('md/docs/sol-compiler/2/installation');
+const UsageMarkdown1 = require('md/docs/sol-compiler/1/usage');
+const UsageMarkdown2 = require('md/docs/sol-compiler/2/usage');
/* tslint:enable:no-var-requires */
const markdownSections = {
@@ -22,20 +24,23 @@ const markdownSections = {
const docsInfoConfig: DocsInfoConfig = {
id: DocPackages.SolCompiler,
- packageName: '@0xproject/sol-compiler',
+ packageName: '@0x/sol-compiler',
type: SupportedDocJson.TypeDoc,
displayName: 'Solidity Compiler',
packageUrl: 'https://github.com/0xProject/0x-monorepo',
markdownMenu: {
- introduction: [markdownSections.introduction],
- install: [markdownSections.installation],
- usage: [markdownSections.usage],
+ 'getting-started': [markdownSections.introduction, markdownSections.installation, markdownSections.usage],
},
sectionNameToMarkdownByVersion: {
'0.0.1': {
- [markdownSections.introduction]: IntroMarkdownV1,
- [markdownSections.installation]: InstallationMarkdownV1,
- [markdownSections.usage]: UsageMarkdown,
+ [markdownSections.introduction]: IntroMarkdown1,
+ [markdownSections.installation]: InstallationMarkdown1,
+ [markdownSections.usage]: UsageMarkdown1,
+ },
+ '1.1.8': {
+ [markdownSections.introduction]: IntroMarkdown1,
+ [markdownSections.installation]: InstallationMarkdown2,
+ [markdownSections.usage]: UsageMarkdown2,
},
},
markdownSections,
@@ -47,6 +52,7 @@ interface ConnectedState {
availableDocVersions: string[];
docsInfo: DocsInfo;
translate: Translate;
+ screenWidth: ScreenWidths;
}
interface ConnectedDispatch {
@@ -58,6 +64,7 @@ const mapStateToProps = (state: State, _ownProps: DocPageProps): ConnectedState
availableDocVersions: state.availableDocVersions,
translate: state.translate,
docsInfo,
+ screenWidth: state.screenWidth,
});
const mapDispatchToProps = (dispatch: Dispatch<State>): ConnectedDispatch => ({
diff --git a/packages/website/ts/containers/sol_cov_documentation.ts b/packages/website/ts/containers/sol_cov_documentation.ts
index 27efd641e..8944ec70a 100644
--- a/packages/website/ts/containers/sol_cov_documentation.ts
+++ b/packages/website/ts/containers/sol_cov_documentation.ts
@@ -1,17 +1,20 @@
-import { DocsInfo, DocsInfoConfig, SupportedDocJson } from '@0xproject/react-docs';
+import { DocsInfo, DocsInfoConfig, SupportedDocJson } from '@0x/react-docs';
import * as React from 'react';
import { connect } from 'react-redux';
import { Dispatch } from 'redux';
import { DocPage as DocPageComponent, DocPageProps } from 'ts/pages/documentation/doc_page';
import { Dispatcher } from 'ts/redux/dispatcher';
import { State } from 'ts/redux/reducer';
-import { DocPackages } from 'ts/types';
+import { DocPackages, ScreenWidths } from 'ts/types';
import { Translate } from 'ts/utils/translate';
/* tslint:disable:no-var-requires */
-const IntroMarkdownV1 = require('md/docs/sol_cov/introduction');
-const InstallationMarkdownV1 = require('md/docs/sol_cov/installation');
-const UsageMarkdown = require('md/docs/sol_cov/usage');
+const IntroMarkdown1 = require('md/docs/sol_cov/1/introduction');
+const InstallationMarkdown1 = require('md/docs/sol_cov/1/installation');
+const UsageMarkdown1 = require('md/docs/sol_cov/1/usage');
+const IntroMarkdown2 = require('md/docs/sol_cov/2/introduction');
+const InstallationMarkdown2 = require('md/docs/sol_cov/2/installation');
+const UsageMarkdown2 = require('md/docs/sol_cov/2/usage');
/* tslint:enable:no-var-requires */
const markdownSections = {
@@ -22,20 +25,23 @@ const markdownSections = {
const docsInfoConfig: DocsInfoConfig = {
id: DocPackages.SolCov,
- packageName: '@0xproject/sol-cov',
+ packageName: '@0x/sol-cov',
type: SupportedDocJson.TypeDoc,
displayName: 'Sol-cov',
packageUrl: 'https://github.com/0xProject/0x-monorepo',
markdownMenu: {
- introduction: [markdownSections.introduction],
- install: [markdownSections.installation],
- usage: [markdownSections.usage],
+ 'getting-started': [markdownSections.introduction, markdownSections.installation, markdownSections.usage],
},
sectionNameToMarkdownByVersion: {
'0.0.1': {
- [markdownSections.introduction]: IntroMarkdownV1,
- [markdownSections.installation]: InstallationMarkdownV1,
- [markdownSections.usage]: UsageMarkdown,
+ [markdownSections.introduction]: IntroMarkdown1,
+ [markdownSections.installation]: InstallationMarkdown1,
+ [markdownSections.usage]: UsageMarkdown1,
+ },
+ '2.1.8': {
+ [markdownSections.introduction]: IntroMarkdown2,
+ [markdownSections.installation]: InstallationMarkdown2,
+ [markdownSections.usage]: UsageMarkdown2,
},
},
markdownSections,
@@ -47,6 +53,7 @@ interface ConnectedState {
availableDocVersions: string[];
docsInfo: DocsInfo;
translate: Translate;
+ screenWidth: ScreenWidths;
}
interface ConnectedDispatch {
@@ -58,6 +65,7 @@ const mapStateToProps = (state: State, _ownProps: DocPageProps): ConnectedState
availableDocVersions: state.availableDocVersions,
translate: state.translate,
docsInfo,
+ screenWidth: state.screenWidth,
});
const mapDispatchToProps = (dispatch: Dispatch<State>): ConnectedDispatch => ({
diff --git a/packages/website/ts/containers/subproviders_documentation.ts b/packages/website/ts/containers/subproviders_documentation.ts
index 28b2e9508..0e421777b 100644
--- a/packages/website/ts/containers/subproviders_documentation.ts
+++ b/packages/website/ts/containers/subproviders_documentation.ts
@@ -1,17 +1,18 @@
-import { DocsInfo, DocsInfoConfig, SupportedDocJson } from '@0xproject/react-docs';
+import { DocsInfo, DocsInfoConfig, SupportedDocJson } from '@0x/react-docs';
import * as React from 'react';
import { connect } from 'react-redux';
import { Dispatch } from 'redux';
import { DocPage as DocPageComponent, DocPageProps } from 'ts/pages/documentation/doc_page';
import { Dispatcher } from 'ts/redux/dispatcher';
import { State } from 'ts/redux/reducer';
-import { DocPackages } from 'ts/types';
+import { DocPackages, ScreenWidths } from 'ts/types';
import { Translate } from 'ts/utils/translate';
/* tslint:disable:no-var-requires */
-const IntroMarkdownV1 = require('md/docs/subproviders/introduction');
-const InstallationMarkdownV1 = require('md/docs/subproviders/installation');
-const LedgerNodeHidMarkdown = require('md/docs/subproviders/ledger_node_hid');
+const IntroMarkdown1 = require('md/docs/subproviders/1/introduction');
+const InstallationMarkdown1 = require('md/docs/subproviders/1/installation');
+const InstallationMarkdown2 = require('md/docs/subproviders/2/installation');
+const LedgerNodeHidMarkdown1 = require('md/docs/subproviders/1/ledger_node_hid');
/* tslint:enable:no-var-requires */
const docSections = {
@@ -22,20 +23,23 @@ const docSections = {
const docsInfoConfig: DocsInfoConfig = {
id: DocPackages.Subproviders,
- packageName: '@0xproject/subproviders',
+ packageName: '@0x/subproviders',
type: SupportedDocJson.TypeDoc,
displayName: 'Subproviders',
packageUrl: 'https://github.com/0xProject/0x-monorepo',
markdownMenu: {
- introduction: [docSections.introduction],
- install: [docSections.installation],
- ['ledger-node-hid-issue']: [docSections.ledgerNodeHid],
+ 'getting-started': [docSections.introduction, docSections.installation, docSections.ledgerNodeHid],
},
sectionNameToMarkdownByVersion: {
'0.0.1': {
- [docSections.introduction]: IntroMarkdownV1,
- [docSections.installation]: InstallationMarkdownV1,
- [docSections.ledgerNodeHid]: LedgerNodeHidMarkdown,
+ [docSections.introduction]: IntroMarkdown1,
+ [docSections.installation]: InstallationMarkdown1,
+ [docSections.ledgerNodeHid]: LedgerNodeHidMarkdown1,
+ },
+ '2.1.0': {
+ [docSections.introduction]: IntroMarkdown1,
+ [docSections.installation]: InstallationMarkdown2,
+ [docSections.ledgerNodeHid]: LedgerNodeHidMarkdown1,
},
},
markdownSections: docSections,
@@ -47,6 +51,7 @@ interface ConnectedState {
availableDocVersions: string[];
docsInfo: DocsInfo;
translate: Translate;
+ screenWidth: ScreenWidths;
}
interface ConnectedDispatch {
@@ -58,6 +63,7 @@ const mapStateToProps = (state: State, _ownProps: DocPageProps): ConnectedState
availableDocVersions: state.availableDocVersions,
translate: state.translate,
docsInfo,
+ screenWidth: state.screenWidth,
});
const mapDispatchToProps = (dispatch: Dispatch<State>): ConnectedDispatch => ({
diff --git a/packages/website/ts/containers/web3_wrapper_documentation.ts b/packages/website/ts/containers/web3_wrapper_documentation.ts
index dc9d23304..9c8c34621 100644
--- a/packages/website/ts/containers/web3_wrapper_documentation.ts
+++ b/packages/website/ts/containers/web3_wrapper_documentation.ts
@@ -1,40 +1,44 @@
-import { DocsInfo, DocsInfoConfig, SupportedDocJson } from '@0xproject/react-docs';
+import { DocsInfo, DocsInfoConfig, SupportedDocJson } from '@0x/react-docs';
import * as React from 'react';
import { connect } from 'react-redux';
import { Dispatch } from 'redux';
import { DocPage as DocPageComponent, DocPageProps } from 'ts/pages/documentation/doc_page';
import { Dispatcher } from 'ts/redux/dispatcher';
import { State } from 'ts/redux/reducer';
-import { DocPackages } from 'ts/types';
+import { DocPackages, ScreenWidths } from 'ts/types';
import { Translate } from 'ts/utils/translate';
/* tslint:disable:no-var-requires */
-const IntroMarkdownV1 = require('md/docs/web3_wrapper/introduction');
-const InstallationMarkdownV1 = require('md/docs/web3_wrapper/installation');
+const IntroMarkdown1 = require('md/docs/web3_wrapper/1/introduction');
+const InstallationMarkdown1 = require('md/docs/web3_wrapper/1/installation');
+const InstallationMarkdown2 = require('md/docs/web3_wrapper/2/installation');
/* tslint:enable:no-var-requires */
-const docSections = {
+const markdownSections = {
introduction: 'introduction',
installation: 'installation',
};
const docsInfoConfig: DocsInfoConfig = {
id: DocPackages.Web3Wrapper,
- packageName: '@0xproject/web3-wrapper',
+ packageName: '@0x/web3-wrapper',
type: SupportedDocJson.TypeDoc,
displayName: 'Web3Wrapper',
packageUrl: 'https://github.com/0xProject/0x-monorepo',
markdownMenu: {
- introduction: [docSections.introduction],
- install: [docSections.installation],
+ 'getting-started': [markdownSections.introduction, markdownSections.installation],
},
sectionNameToMarkdownByVersion: {
'0.0.1': {
- [docSections.introduction]: IntroMarkdownV1,
- [docSections.installation]: InstallationMarkdownV1,
+ [markdownSections.introduction]: IntroMarkdown1,
+ [markdownSections.installation]: InstallationMarkdown1,
+ },
+ '3.1.0': {
+ [markdownSections.introduction]: IntroMarkdown1,
+ [markdownSections.installation]: InstallationMarkdown2,
},
},
- markdownSections: docSections,
+ markdownSections,
};
const docsInfo = new DocsInfo(docsInfoConfig);
@@ -43,6 +47,7 @@ interface ConnectedState {
availableDocVersions: string[];
docsInfo: DocsInfo;
translate: Translate;
+ screenWidth: ScreenWidths;
}
interface ConnectedDispatch {
@@ -54,6 +59,7 @@ const mapStateToProps = (state: State, _ownProps: DocPageProps): ConnectedState
availableDocVersions: state.availableDocVersions,
translate: state.translate,
docsInfo,
+ screenWidth: state.screenWidth,
});
const mapDispatchToProps = (dispatch: Dispatch<State>): ConnectedDispatch => ({
diff --git a/packages/website/ts/containers/wiki.ts b/packages/website/ts/containers/wiki.ts
index 357f8bbf4..069b0ae54 100644
--- a/packages/website/ts/containers/wiki.ts
+++ b/packages/website/ts/containers/wiki.ts
@@ -4,10 +4,12 @@ import { Dispatch } from 'redux';
import { Wiki as WikiComponent, WikiProps } from 'ts/pages/wiki/wiki';
import { Dispatcher } from 'ts/redux/dispatcher';
import { State } from 'ts/redux/reducer';
+import { ScreenWidths } from 'ts/types';
import { Translate } from 'ts/utils/translate';
interface ConnectedState {
translate: Translate;
+ screenWidth: ScreenWidths;
}
interface ConnectedDispatch {
@@ -16,6 +18,7 @@ interface ConnectedDispatch {
const mapStateToProps = (state: State, _ownProps: WikiProps): ConnectedState => ({
translate: state.translate,
+ screenWidth: state.screenWidth,
});
const mapDispatchToProps = (dispatch: Dispatch<State>): ConnectedDispatch => ({
diff --git a/packages/website/ts/containers/zero_ex_js_documentation.ts b/packages/website/ts/containers/zero_ex_js_documentation.ts
index 2a3afd86c..e0ea6e275 100644
--- a/packages/website/ts/containers/zero_ex_js_documentation.ts
+++ b/packages/website/ts/containers/zero_ex_js_documentation.ts
@@ -1,11 +1,11 @@
-import { DocsInfo, DocsInfoConfig, SupportedDocJson } from '@0xproject/react-docs';
+import { DocsInfo, DocsInfoConfig, SupportedDocJson } from '@0x/react-docs';
import * as React from 'react';
import { connect } from 'react-redux';
import { Dispatch } from 'redux';
import { DocPage as DocPageComponent, DocPageProps } from 'ts/pages/documentation/doc_page';
import { Dispatcher } from 'ts/redux/dispatcher';
import { State } from 'ts/redux/reducer';
-import { DocPackages } from 'ts/types';
+import { DocPackages, ScreenWidths } from 'ts/types';
import { Translate } from 'ts/utils/translate';
/* tslint:disable:no-var-requires */
@@ -15,8 +15,8 @@ const AsyncMarkdownV0 = require('md/docs/0xjs/0.0.1/async');
const ErrorsMarkdownV0 = require('md/docs/0xjs/0.0.1/errors');
const versioningMarkdownV0 = require('md/docs/0xjs/0.0.1/versioning');
-const IntroMarkdownV1 = require('md/docs/0xjs/1.0.1/introduction');
-const InstallationMarkdownV1 = require('md/docs/0xjs/1.0.1/installation');
+const IntroMarkdown1 = require('md/docs/0xjs/1.0.1/introduction');
+const InstallationMarkdown1 = require('md/docs/0xjs/1.0.1/installation');
const AsyncMarkdownV1 = require('md/docs/0xjs/1.0.1/async');
const ErrorsMarkdownV1 = ErrorsMarkdownV0;
const versioningMarkdownV1 = require('md/docs/0xjs/1.0.1/versioning');
@@ -39,9 +39,13 @@ const docsInfoConfig: DocsInfoConfig = {
displayName: '0x.js',
packageUrl: 'https://github.com/0xProject/0x-monorepo',
markdownMenu: {
- introduction: [markdownSections.introduction],
- install: [markdownSections.installation],
- topics: [markdownSections.async, markdownSections.errors, markdownSections.versioning],
+ 'getting-started': [
+ markdownSections.introduction,
+ markdownSections.installation,
+ markdownSections.async,
+ markdownSections.errors,
+ markdownSections.versioning,
+ ],
},
sectionNameToMarkdownByVersion: {
'0.0.1': {
@@ -52,8 +56,15 @@ const docsInfoConfig: DocsInfoConfig = {
[markdownSections.errors]: ErrorsMarkdownV0,
},
'1.0.1': {
- [markdownSections.introduction]: IntroMarkdownV1,
- [markdownSections.installation]: InstallationMarkdownV1,
+ [markdownSections.introduction]: IntroMarkdown1,
+ [markdownSections.installation]: InstallationMarkdown1,
+ [markdownSections.versioning]: versioningMarkdownV1,
+ [markdownSections.async]: AsyncMarkdownV1,
+ [markdownSections.errors]: ErrorsMarkdownV1,
+ },
+ '2.0.0': {
+ [markdownSections.introduction]: IntroMarkdown1,
+ [markdownSections.installation]: InstallationMarkdown1,
[markdownSections.versioning]: versioningMarkdownV1,
[markdownSections.async]: AsyncMarkdownV1,
[markdownSections.errors]: ErrorsMarkdownV1,
@@ -68,6 +79,7 @@ interface ConnectedState {
availableDocVersions: string[];
docsInfo: DocsInfo;
translate: Translate;
+ screenWidth: ScreenWidths;
}
interface ConnectedDispatch {
@@ -79,6 +91,7 @@ const mapStateToProps = (state: State, _ownProps: DocPageProps): ConnectedState
availableDocVersions: state.availableDocVersions,
docsInfo,
translate: state.translate,
+ screenWidth: state.screenWidth,
});
const mapDispatchToProps = (dispatch: Dispatch<State>): ConnectedDispatch => ({
diff --git a/packages/website/ts/index.tsx b/packages/website/ts/index.tsx
index d4a79cc4f..21157e427 100644
--- a/packages/website/ts/index.tsx
+++ b/packages/website/ts/index.tsx
@@ -5,6 +5,7 @@ import { Provider } from 'react-redux';
import { BrowserRouter as Router, Redirect, Route, Switch } from 'react-router-dom';
import { MetaTags } from 'ts/components/meta_tags';
import { About } from 'ts/containers/about';
+import { DocsHome } from 'ts/containers/docs_home';
import { FAQ } from 'ts/containers/faq';
import { Jobs } from 'ts/containers/jobs';
import { Landing } from 'ts/containers/landing';
@@ -68,6 +69,9 @@ const LazyOrderUtilsDocumentation = createLazyComponent('Documentation', async (
const LazyEthereumTypesDocumentation = createLazyComponent('Documentation', async () =>
import(/* webpackChunkName: "ethereumTypesDocs" */ 'ts/containers/ethereum_types_documentation'),
);
+const LazyAssetBuyerDocumentation = createLazyComponent('Documentation', async () =>
+ import(/* webpackChunkName: "assetBuyerDocs" */ 'ts/containers/asset_buyer_documentation'),
+);
const DOCUMENT_TITLE = '0x: The Protocol for Trading Tokens';
const DOCUMENT_DESCRIPTION = 'An Open Protocol For Decentralized Exchange On The Ethereum Blockchain';
@@ -133,7 +137,11 @@ render(
path={`${WebsitePaths.EthereumTypes}/:version?`}
component={LazyEthereumTypesDocumentation}
/>
-
+ <Route
+ path={`${WebsitePaths.AssetBuyer}/:version?`}
+ component={LazyAssetBuyerDocumentation}
+ />
+ <Route path={WebsitePaths.Docs} component={DocsHome as any} />
{/* Legacy endpoints */}
<Route
path={`${WebsiteLegacyPaths.ZeroExJs}/:version?`}
diff --git a/packages/website/ts/local_storage/trade_history_storage.tsx b/packages/website/ts/local_storage/trade_history_storage.tsx
index a9b042820..ef6a0a1aa 100644
--- a/packages/website/ts/local_storage/trade_history_storage.tsx
+++ b/packages/website/ts/local_storage/trade_history_storage.tsx
@@ -1,5 +1,5 @@
-import { BigNumber } from '@0xproject/utils';
-import ethUtil = require('ethereumjs-util');
+import { BigNumber } from '@0x/utils';
+import ethUtil from 'ethereumjs-util';
import * as _ from 'lodash';
import { localStorage } from 'ts/local_storage/local_storage';
import { Fill } from 'ts/types';
diff --git a/packages/website/ts/pages/about/about.tsx b/packages/website/ts/pages/about/about.tsx
index 2629f8632..dfe8926b0 100644
--- a/packages/website/ts/pages/about/about.tsx
+++ b/packages/website/ts/pages/about/about.tsx
@@ -1,8 +1,7 @@
-import { colors, Styles } from '@0xproject/react-shared';
+import { colors, Link, Styles } from '@0x/react-shared';
import * as _ from 'lodash';
import * as React from 'react';
import * as DocumentTitle from 'react-document-title';
-import { Link } from 'react-router-dom';
import { Footer } from 'ts/components/footer';
import { TopBar } from 'ts/components/top_bar/top_bar';
import { Profile } from 'ts/pages/about/profile';
@@ -244,9 +243,10 @@ const teamRow9: ProfileInfo[] = [
{
name: 'Steve Klebanoff',
title: 'Senior Engineer',
- description: ` Full-stack engineer. Previously Staff Software Engineer at Appfolio. Computer Science & Cognitive Psychology at Northeastern University.`,
+ description: ` Full-stack engineer. Previously Staff Software Engineer at AppFolio. Computer Science & Cognitive Psychology at Northeastern University.`,
image: 'images/team/steve.png',
linkedIn: 'https://www.linkedin.com/in/steveklebanoff/',
+ github: 'https://github.com/steveklebanoff',
},
];
@@ -388,7 +388,7 @@ export class About extends React.Component<AboutProps, AboutState> {
}}
>
We are seeking outstanding candidates to{' '}
- <Link to={WebsitePaths.Careers} style={{ color: 'black' }}>
+ <Link to={WebsitePaths.Careers} textDecoration="underline" fontColor="black">
join our team
</Link>
. We value passion, diversity and unique perspectives.
diff --git a/packages/website/ts/pages/about/profile.tsx b/packages/website/ts/pages/about/profile.tsx
index bcbeb0272..2361c6418 100644
--- a/packages/website/ts/pages/about/profile.tsx
+++ b/packages/website/ts/pages/about/profile.tsx
@@ -1,4 +1,4 @@
-import { colors, Styles } from '@0xproject/react-shared';
+import { colors, Styles } from '@0x/react-shared';
import * as _ from 'lodash';
import * as React from 'react';
import { ProfileInfo } from 'ts/types';
diff --git a/packages/website/ts/pages/documentation/developers_page.tsx b/packages/website/ts/pages/documentation/developers_page.tsx
new file mode 100644
index 000000000..89389e488
--- /dev/null
+++ b/packages/website/ts/pages/documentation/developers_page.tsx
@@ -0,0 +1,202 @@
+import { colors, constants as sharedConstants, utils as sharedUtils } from '@0x/react-shared';
+import * as _ from 'lodash';
+import * as React from 'react';
+import DocumentTitle from 'react-document-title';
+import { DocsLogo } from 'ts/components/documentation/docs_logo';
+import { DocsTopBar } from 'ts/components/documentation/docs_top_bar';
+import { Container } from 'ts/components/ui/container';
+import { Dispatcher } from 'ts/redux/dispatcher';
+import { media } from 'ts/style/media';
+import { styled } from 'ts/style/theme';
+import { BrowserType, OperatingSystemType, ScreenWidths } from 'ts/types';
+import { Translate } from 'ts/utils/translate';
+import { utils } from 'ts/utils/utils';
+
+const THROTTLE_TIMEOUT = 100;
+const TOP_BAR_HEIGHT = 80;
+const browserType = utils.getBrowserType();
+let SCROLLBAR_WIDTH;
+switch (browserType) {
+ case BrowserType.Firefox:
+ // HACK: Firefox doesn't allow styling of their scrollbar's.
+ // Source: https://stackoverflow.com/questions/6165472/custom-css-scrollbar-for-firefox
+ const os = utils.getOperatingSystem();
+ SCROLLBAR_WIDTH = os === OperatingSystemType.Windows ? 17 : 15;
+ break;
+
+ case BrowserType.Edge:
+ // Edge's scrollbar is placed outside of the div content and doesn't
+ // need to be accounted for
+ SCROLLBAR_WIDTH = 0;
+ break;
+
+ default:
+ SCROLLBAR_WIDTH = 4;
+}
+const SIDEBAR_PADDING = 22;
+
+export interface DevelopersPageProps {
+ location: Location;
+ translate: Translate;
+ screenWidth: ScreenWidths;
+ dispatcher: Dispatcher;
+ mainContent: React.ReactNode;
+ sidebar: React.ReactNode;
+}
+
+export interface DevelopersPageState {
+ isSidebarScrolling: boolean;
+}
+
+const isUserOnMobile = sharedUtils.isUserOnMobile();
+
+const scrollableContainerStyles = `
+ position: absolute;
+ top: ${TOP_BAR_HEIGHT}px;
+ left: 0px;
+ bottom: 0px;
+ right: 0px;
+ overflow-x: hidden;
+ overflow-y: scroll;
+ -webkit-overflow-scrolling: touch;
+ /* Required for hide/show onHover of scrollbar on Microsoft Edge */
+ -ms-overflow-style: -ms-autohiding-scrollbar;
+`;
+
+interface SidebarContainerProps {
+ className?: string;
+}
+
+const SidebarContainer =
+ styled.div <
+ SidebarContainerProps >
+ `
+ ${scrollableContainerStyles}
+ padding-top: 27px;
+ padding-left: ${SIDEBAR_PADDING}px;
+ padding-right: ${SIDEBAR_PADDING}px;
+ overflow: hidden;
+ &:hover {
+ overflow: auto;
+ padding-right: ${SIDEBAR_PADDING - SCROLLBAR_WIDTH}px;
+ }
+`;
+
+interface MainContentContainerProps {
+ className?: string;
+}
+
+const MainContentContainer =
+ styled.div <
+ MainContentContainerProps >
+ `
+ ${scrollableContainerStyles}
+ padding-top: 0px;
+ padding-left: 50px;
+ padding-right: 50px;
+ overflow: ${isUserOnMobile ? 'auto' : 'hidden'};
+ &:hover {
+ padding-right: ${50 - SCROLLBAR_WIDTH}px;
+ overflow: auto;
+ }
+ ${media.small`
+ padding-left: 20px;
+ padding-right: 20px;
+ &:hover {
+ padding-right: ${20 - SCROLLBAR_WIDTH}px;
+ overflow: auto;
+ }
+ `}
+`;
+
+export class DevelopersPage extends React.Component<DevelopersPageProps, DevelopersPageState> {
+ private readonly _throttledScreenWidthUpdate: () => void;
+ private readonly _throttledSidebarScrolling: () => void;
+ private _sidebarScrollClearingInterval: number;
+ constructor(props: DevelopersPageProps) {
+ super(props);
+ this._throttledScreenWidthUpdate = _.throttle(this._updateScreenWidth.bind(this), THROTTLE_TIMEOUT);
+ this._throttledSidebarScrolling = _.throttle(this._onSidebarScroll.bind(this), THROTTLE_TIMEOUT);
+ this.state = {
+ isSidebarScrolling: false,
+ };
+ }
+ public componentDidMount(): void {
+ window.addEventListener('resize', this._throttledScreenWidthUpdate);
+ window.scrollTo(0, 0);
+ this._sidebarScrollClearingInterval = window.setInterval(() => {
+ this.setState({
+ isSidebarScrolling: false,
+ });
+ }, 1000);
+ }
+ public componentWillUnmount(): void {
+ window.removeEventListener('resize', this._throttledScreenWidthUpdate);
+ window.clearInterval(this._sidebarScrollClearingInterval);
+ }
+ public render(): React.ReactNode {
+ const isSmallScreen = this.props.screenWidth === ScreenWidths.Sm;
+ const mainContentPadding = isSmallScreen ? 20 : 50;
+ return (
+ <Container
+ className="flex items-center overflow-hidden"
+ width="100%"
+ background={`linear-gradient(to right, ${colors.grey100} 0%, ${colors.grey100} 50%, ${
+ colors.white
+ } 50%, ${colors.white} 100%)`}
+ >
+ <DocumentTitle title="0x Docs" />
+ <Container className="flex mx-auto" height="100vh">
+ <Container
+ className="sm-hide xs-hide relative"
+ width={234}
+ paddingLeft={22}
+ paddingRight={22}
+ paddingTop={0}
+ backgroundColor={colors.grey100}
+ >
+ <Container
+ borderBottom={this.state.isSidebarScrolling ? `1px solid ${colors.grey300}` : 'none'}
+ >
+ <Container paddingTop="30px" paddingLeft="10px" paddingBottom="8px">
+ <DocsLogo height={36} />
+ </Container>
+ </Container>
+ <SidebarContainer onWheel={this._throttledSidebarScrolling}>
+ <Container paddingBottom="100px">
+ {this.props.screenWidth !== ScreenWidths.Sm && this.props.sidebar}
+ </Container>
+ </SidebarContainer>
+ </Container>
+ <Container
+ className="relative"
+ width={isSmallScreen ? '100vw' : 786}
+ paddingBottom="100px"
+ backgroundColor={colors.white}
+ >
+ <Container paddingLeft={mainContentPadding} paddingRight={mainContentPadding}>
+ <DocsTopBar
+ location={this.props.location}
+ screenWidth={this.props.screenWidth}
+ translate={this.props.translate}
+ sidebar={this.props.sidebar}
+ />
+ </Container>
+ <MainContentContainer id={sharedConstants.SCROLL_CONTAINER_ID}>
+ {this.props.mainContent}
+ </MainContentContainer>
+ </Container>
+ </Container>
+ </Container>
+ );
+ }
+ private _onSidebarScroll(_event: React.FormEvent<HTMLInputElement>): void {
+ this.setState({
+ isSidebarScrolling: true,
+ });
+ }
+ private _updateScreenWidth(): void {
+ const newScreenWidth = utils.getScreenWidth();
+ this.props.dispatcher.updateScreenWidth(newScreenWidth);
+ }
+} // tslint:disable:max-file-line-count
diff --git a/packages/website/ts/pages/documentation/doc_page.tsx b/packages/website/ts/pages/documentation/doc_page.tsx
index 87a806b2b..8392c90e4 100644
--- a/packages/website/ts/pages/documentation/doc_page.tsx
+++ b/packages/website/ts/pages/documentation/doc_page.tsx
@@ -1,35 +1,30 @@
import {
DocAgnosticFormat,
+ DocReference,
DocsInfo,
- Documentation,
GeneratedDocJson,
SupportedDocJson,
TypeDocUtils,
-} from '@0xproject/react-docs';
-import findVersions = require('find-versions');
+} from '@0x/react-docs';
+import findVersions from 'find-versions';
import * as _ from 'lodash';
+import CircularProgress from 'material-ui/CircularProgress';
import * as React from 'react';
-import DocumentTitle = require('react-document-title');
-import semverSort = require('semver-sort');
-import { SidebarHeader } from 'ts/components/sidebar_header';
-import { TopBar } from 'ts/components/top_bar/top_bar';
+import semverSort from 'semver-sort';
+import { SidebarHeader } from 'ts/components/documentation/sidebar_header';
+import { NestedSidebarMenu } from 'ts/components/nested_sidebar_menu';
+import { Container } from 'ts/components/ui/container';
+import { DevelopersPage } from 'ts/pages/documentation/developers_page';
import { Dispatcher } from 'ts/redux/dispatcher';
-import { DocPackages } from 'ts/types';
+import { DocPackages, ScreenWidths } from 'ts/types';
import { constants } from 'ts/utils/constants';
import { docUtils } from 'ts/utils/doc_utils';
import { Translate } from 'ts/utils/translate';
import { utils } from 'ts/utils/utils';
const isDevelopmentOrStaging = utils.isDevelopment() || utils.isStaging();
-const DEFAULT_ICON = 'docs.png';
const ZERO_EX_JS_VERSION_MISSING_TOPLEVEL_PATH = '0.32.4';
-const idToIcon: { [id: string]: string } = {
- [DocPackages.ZeroExJs]: 'zeroExJs.png',
- [DocPackages.Connect]: 'connect.png',
- [DocPackages.SmartContracts]: 'contracts.png',
-};
-
const docIdToSubpackageName: { [id: string]: string } = {
[DocPackages.ZeroExJs]: '0x.js',
[DocPackages.Connect]: 'connect',
@@ -43,6 +38,7 @@ const docIdToSubpackageName: { [id: string]: string } = {
[DocPackages.OrderUtils]: 'order-utils',
[DocPackages.OrderWatcher]: 'order-watcher',
[DocPackages.EthereumTypes]: 'ethereum-types',
+ [DocPackages.AssetBuyer]: 'asset-buyer',
};
export interface DocPageProps {
@@ -52,6 +48,7 @@ export interface DocPageProps {
availableDocVersions: string[];
docsInfo: DocsInfo;
translate: Translate;
+ screenWidth: ScreenWidths;
}
interface DocPageState {
@@ -79,38 +76,58 @@ export class DocPage extends React.Component<DocPageProps, DocPageState> {
this._isUnmounted = true;
}
public render(): React.ReactNode {
- const menuSubsectionsBySection = _.isUndefined(this.state.docAgnosticFormat)
- ? {}
- : this.props.docsInfo.getMenuSubsectionsBySection(this.state.docAgnosticFormat);
const sourceUrl = this._getSourceUrl();
- const iconFileName = idToIcon[this.props.docsInfo.id] || DEFAULT_ICON;
- const iconUrl = `/images/doc_icons/${iconFileName}`;
+ const sectionNameToLinks = _.isUndefined(this.state.docAgnosticFormat)
+ ? {}
+ : this.props.docsInfo.getSectionNameToLinks(this.state.docAgnosticFormat);
+ const mainContent = _.isUndefined(this.state.docAgnosticFormat) ? (
+ <div className="flex justify-center">{this._renderLoading()}</div>
+ ) : (
+ <DocReference
+ selectedVersion={this.props.docsVersion}
+ availableVersions={this.props.availableDocVersions}
+ docsInfo={this.props.docsInfo}
+ docAgnosticFormat={this.state.docAgnosticFormat}
+ sourceUrl={sourceUrl}
+ />
+ );
+ const sidebar = _.isUndefined(this.state.docAgnosticFormat) ? (
+ <div />
+ ) : (
+ <NestedSidebarMenu sidebarHeader={this._renderSidebarHeader()} sectionNameToLinks={sectionNameToLinks} />
+ );
+ return (
+ <DevelopersPage
+ sidebar={sidebar}
+ mainContent={mainContent}
+ location={this.props.location}
+ screenWidth={this.props.screenWidth}
+ translate={this.props.translate}
+ dispatcher={this.props.dispatcher}
+ />
+ );
+ }
+ private _renderSidebarHeader(): React.ReactNode {
+ return (
+ <SidebarHeader
+ screenWidth={this.props.screenWidth}
+ title={this.props.docsInfo.displayName}
+ docsVersion={this.props.docsVersion}
+ availableDocVersions={this.props.availableDocVersions}
+ onVersionSelected={this._onVersionSelected.bind(this)}
+ />
+ );
+ }
+ private _renderLoading(): React.ReactNode {
return (
- <div>
- <DocumentTitle title={`${this.props.docsInfo.displayName} Documentation`} />
- <TopBar
- blockchainIsLoaded={false}
- location={this.props.location}
- docsVersion={this.props.docsVersion}
- availableDocVersions={this.props.availableDocVersions}
- menu={this.props.docsInfo.menu}
- menuSubsectionsBySection={menuSubsectionsBySection}
- docsInfo={this.props.docsInfo}
- translate={this.props.translate}
- onVersionSelected={this._onVersionSelected.bind(this)}
- sidebarHeader={<SidebarHeader title={this.props.docsInfo.displayName} iconUrl={iconUrl} />}
- />
- <Documentation
- selectedVersion={this.props.docsVersion}
- availableVersions={this.props.availableDocVersions}
- docsInfo={this.props.docsInfo}
- docAgnosticFormat={this.state.docAgnosticFormat}
- sidebarHeader={<SidebarHeader title={this.props.docsInfo.displayName} iconUrl={iconUrl} />}
- sourceUrl={sourceUrl}
- topBarHeight={60}
- onVersionSelected={this._onVersionSelected.bind(this)}
- />
- </div>
+ <Container className="pt4">
+ <Container className="center pb2">
+ <CircularProgress size={40} thickness={5} />
+ </Container>
+ <Container className="center pt2" paddingBottom="11px">
+ Loading documentation...
+ </Container>
+ </Container>
);
}
private async _fetchJSONDocsFireAndForgetAsync(preferredVersionIfExists?: string): Promise<void> {
@@ -145,10 +162,10 @@ export class DocPage extends React.Component<DocPageProps, DocPageState> {
// documenting solidity.
docAgnosticFormat = versionDocObj as DocAgnosticFormat;
// HACK: need to modify docsInfo like convertToDocAgnosticFormat() would do
- this.props.docsInfo.menu.Contracts = [];
+ this.props.docsInfo.markdownMenu.Contracts = [];
_.each(docAgnosticFormat, (_docObj, sectionName) => {
this.props.docsInfo.sections[sectionName] = sectionName;
- this.props.docsInfo.menu.Contracts.push(sectionName);
+ this.props.docsInfo.markdownMenu.Contracts.push(sectionName);
});
}
@@ -164,7 +181,7 @@ export class DocPage extends React.Component<DocPageProps, DocPageState> {
let tagPrefix = pkg;
const packagesWithNamespace = ['connect'];
if (_.includes(packagesWithNamespace, pkg)) {
- tagPrefix = `@0xproject/${pkg}`;
+ tagPrefix = `@0x/${pkg}`;
}
// HACK: The following three lines exist for backward compatibility reasons
// Before exporting types from other packages as part of the 0x.js interface,
diff --git a/packages/website/ts/pages/documentation/docs_home.tsx b/packages/website/ts/pages/documentation/docs_home.tsx
new file mode 100644
index 000000000..bbbee2d2d
--- /dev/null
+++ b/packages/website/ts/pages/documentation/docs_home.tsx
@@ -0,0 +1,385 @@
+import { ALink, colors, Link } from '@0x/react-shared';
+import { ObjectMap } from '@0x/types';
+import * as _ from 'lodash';
+import * as React from 'react';
+import { OverviewContent } from 'ts/components/documentation/overview_content';
+import { NestedSidebarMenu } from 'ts/components/nested_sidebar_menu';
+import { Button } from 'ts/components/ui/button';
+import { DevelopersPage } from 'ts/pages/documentation/developers_page';
+import { Dispatcher } from 'ts/redux/dispatcher';
+import { Categories, Deco, Key, Package, ScreenWidths, TutorialInfo, WebsitePaths } from 'ts/types';
+import { constants } from 'ts/utils/constants';
+import { Translate } from 'ts/utils/translate';
+
+const TUTORIALS: TutorialInfo[] = [
+ {
+ iconUrl: '/images/developers/tutorials/develop_on_ethereum.svg',
+ description: Key.DevelopOnEthereumDescription,
+ link: {
+ title: Key.DevelopOnEthereum,
+ to: `${WebsitePaths.Wiki}#Ethereum-Development`,
+ },
+ },
+ {
+ iconUrl: '/images/developers/tutorials/build_a_relayer.svg',
+ description: Key.BuildARelayerDescription,
+ link: {
+ title: Key.BuildARelayer,
+ to: `${WebsitePaths.Wiki}#Build-A-Relayer`,
+ },
+ },
+ {
+ iconUrl: '/images/developers/tutorials/0x_order_basics.svg',
+ description: Key.OrderBasicsDescription,
+ link: {
+ title: Key.OrderBasics,
+ to: `${WebsitePaths.Wiki}#Create,-Validate,-Fill-Order`,
+ },
+ },
+ {
+ iconUrl: '/images/developers/tutorials/use_shared_liquidity.svg',
+ description: Key.UseNetworkedLiquidityDescription,
+ link: {
+ title: Key.UseNetworkedLiquidity,
+ to: `${WebsitePaths.Wiki}#Find,-Submit,-Fill-Order-From-Relayer`,
+ },
+ },
+];
+
+const CATEGORY_TO_PACKAGES: ObjectMap<Package[]> = {
+ [Categories.ZeroExProtocol]: [
+ {
+ 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://0xproject.com/docs/order-utils) and [contract-wrappers](https://0xproject.com/docs/contract-wrappers).',
+ link: {
+ title: '0x.js',
+ to: WebsitePaths.ZeroExJs,
+ },
+ },
+ {
+ description:
+ 'A Typescript starter project that will walk you through the basics of how to interact with 0x Protocol and trade of an SRA relayer',
+ link: {
+ title: '0x starter project',
+ to: 'https://github.com/0xProject/0x-starter-project',
+ 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',
+ to: WebsitePaths.Connect,
+ },
+ },
+ {
+ description:
+ 'Typescript/Javascript wrappers of the 0x protocol Ethereum smart contracts. Use this library to call methods on the 0x smart contracts, subscribe to contract events and to fetch information stored in contracts.',
+ link: {
+ title: '@0x/contract-wrappers',
+ to: WebsitePaths.ContractWrappers,
+ },
+ },
+ {
+ description:
+ 'A collection of 0x-related JSON-schemas (incl. SRA request/response schemas, 0x order message format schema, etc...)',
+ link: {
+ title: '@0x/json-schemas',
+ to: WebsitePaths.JSONSchemas,
+ },
+ },
+ {
+ description:
+ 'A set of utils for working with 0x orders. It includes utilities for creating, signing, validating 0x orders, encoding/decoding assetData and much more.',
+ link: {
+ title: '@0x/order-utils',
+ to: WebsitePaths.OrderUtils,
+ },
+ },
+ {
+ description:
+ "A daemon that watches a set of 0x orders and emits events when an order's fillability has changed. Can be used by a relayer to prune their orderbook or by a trader to keep their view of the market up-to-date.",
+ link: {
+ title: '@0x/order-watcher',
+ to: WebsitePaths.OrderWatcher,
+ },
+ },
+ {
+ description:
+ 'Contains the Standard Relayer API OpenAPI Spec. The package distributes both a javascript object version and a json version.',
+ link: {
+ title: '@0x/sra-spec',
+ to: 'https://github.com/0xProject/0x-monorepo/tree/development/packages/sra-spec',
+ shouldOpenInNewTab: true,
+ },
+ },
+ {
+ description:
+ 'Convenience package for buying assets represented on the Ethereum blockchain using 0x. In its simplest form, the package helps in the usage of the [0x forwarder contract](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/forwarder-specification.md), which allows users to execute [Wrapped Ether](https://weth.io/) based 0x orders without having to set allowances, wrap Ether or own ZRX, meaning they can buy tokens with Ether alone. Given some liquidity (0x signed orders), it helps estimate the Ether cost of buying a certain asset (giving a range) and then buying that asset.',
+ link: {
+ title: '@0x/asset-buyer',
+ to: WebsitePaths.AssetBuyer,
+ },
+ },
+ ],
+ [Categories.Ethereum]: [
+ {
+ description:
+ "This package allows you to generate TypeScript contract wrappers from ABI files. It's heavily inspired by Geth abigen but takes a different approach. You can write your custom handlebars templates which will allow you to seamlessly integrate the generated code into your existing codebase with existing conventions.",
+ link: {
+ title: 'abi-gen',
+ to: 'https://github.com/0xProject/0x-monorepo/tree/development/packages/abi-gen',
+ shouldOpenInNewTab: true,
+ },
+ },
+ {
+ description:
+ 'A collection of Typescript types that are useful when working on an Ethereum-based project (e.g RawLog, Transaction, TxData, SolidityTypes, etc...).',
+ link: {
+ title: 'ethereum-types',
+ to: WebsitePaths.EthereumTypes,
+ },
+ },
+ {
+ description:
+ 'A wrapper around [solc-js](https://github.com/ethereum/solc-js) that adds smart re-compilation, ability to compile an entire project, Solidity version specific compilation, standard input description support and much more.',
+ link: {
+ title: '@0x/sol-compiler',
+ to: WebsitePaths.SolCompiler,
+ },
+ },
+ {
+ description:
+ 'A Solidity code coverage tool. Sol-cov uses transaction traces to figure out which lines of your code has been covered by your tests.',
+ link: {
+ title: '@0x/sol-cov',
+ to: WebsitePaths.SolCov,
+ },
+ },
+ {
+ description:
+ 'A collection of subproviders to use with [web3-provider-engine](https://www.npmjs.com/package/web3-provider-engine) (e.g subproviders for interfacing with Ledger hardware wallet, Mnemonic wallet, private key wallet, etc...)',
+ link: {
+ title: '@0x/subproviders',
+ to: WebsitePaths.Subproviders,
+ },
+ },
+ {
+ description:
+ 'A raw Ethereum JSON RPC client to simplify interfacing with Ethereum nodes. Also includes some convenience functions for awaiting transactions to be mined, converting between token units, etc...',
+ link: {
+ title: '@0x/web3-wrapper',
+ to: WebsitePaths.Web3Wrapper,
+ },
+ },
+ ],
+ [Categories.CommunityMaintained]: [
+ {
+ description:
+ 'Node.js worker originally built for 0x Tracker which extracts 0x fill events from the Ethereum blockchain and persists them to MongoDB. Support for both V1 and V2 of the 0x protocol is included with events tagged against the protocol version they belong to.',
+ link: {
+ title: '0x Event Extractor',
+ to: 'https://github.com/0xTracker/0x-event-extractor',
+ shouldOpenInNewTab: true,
+ },
+ },
+ {
+ description:
+ 'Node.js worker built for 0x Tracker which performs various ETL tasks related to the 0x protocol trading data and other information used on 0x Tracker.',
+ link: {
+ title: '0x Tracker Worker',
+ to: 'https://github.com/0xTracker/0x-tracker-worker',
+ shouldOpenInNewTab: true,
+ },
+ },
+ {
+ description:
+ "ERCdEX's Javascript SDK for trading on their relayer, as well as other Aquaduct partner relayers",
+ link: {
+ title: 'Aquaduct',
+ to: 'https://www.npmjs.com/package/aqueduct',
+ shouldOpenInNewTab: true,
+ },
+ },
+ {
+ description:
+ 'SDKs for automation using Aqueduct & ERC dEX. Aqueduct Server is a lightweight, portable and secure server that runs locally on any workstation. The server exposes a small number of foundational endpoints that enable working with the decentralized Aqueduct liquidity pool from any context or programming language.',
+ link: {
+ title: 'Aquaduct Server SDK',
+ to: 'https://github.com/ERCdEX/aqueduct-server-sdk',
+ shouldOpenInNewTab: true,
+ },
+ },
+ {
+ description: 'A node.js SDK for trading on the DDEX relayer',
+ link: {
+ to: 'https://www.npmjs.com/package/ddex-api',
+ title: 'DDEX Node.js SDK',
+ shouldOpenInNewTab: true,
+ },
+ },
+ {
+ description: "The ERCdEX Trade Widget let's any website provide token liquidity to it's users",
+ link: {
+ to: 'https://github.com/ERCdEX/widget',
+ title: 'ERCdEX Widget',
+ shouldOpenInNewTab: true,
+ },
+ },
+ {
+ description: "ERCdEX's Java SDK for trading on their relayer, as well as other Aquaduct partner relayers",
+ link: {
+ to: 'https://github.com/ERCdEX/java',
+ title: 'ERCdEX Java SDK',
+ shouldOpenInNewTab: true,
+ },
+ },
+ {
+ description: "ERCdEX's Python SDK for trading on their relayer, as well as other Aquaduct partner relayers",
+ link: {
+ to: 'https://github.com/ERCdEX/python',
+ title: 'ERCdEX Python SDK',
+ shouldOpenInNewTab: true,
+ },
+ },
+ {
+ description:
+ 'A set of command-line tools for creating command-line scripts for interacting with the Ethereum blockchain in general, and 0x in particular',
+ link: {
+ title: 'Massive',
+ to: 'https://github.com/NoteGio/massive',
+ shouldOpenInNewTab: true,
+ },
+ },
+ {
+ description: 'An open-source API-only Relayer written in Go',
+ link: {
+ to: 'https://github.com/NoteGio/openrelay',
+ title: 'OpenRelay',
+ shouldOpenInNewTab: true,
+ },
+ },
+ {
+ description:
+ 'A JavaScript Library for Interacting with OpenRelay.xyz and other 0x Standard Relayer API Implementations',
+ link: {
+ title: 'OpenRelay.js',
+ to: 'https://github.com/NoteGio/openrelay.js',
+ shouldOpenInNewTab: true,
+ },
+ },
+ {
+ description:
+ 'The Radar Relay SDK is a software development kit that simplifies the interactions with Radar Relay’s APIs',
+ link: {
+ title: 'Radar SDK',
+ to: 'https://github.com/RadarRelay/sdk',
+ shouldOpenInNewTab: true,
+ },
+ },
+ {
+ description:
+ 'The Ocean provides a simple REST API, WebSockets API, and JavaScript library to help you integrate decentralized trading into your existing trading strategy.',
+ link: {
+ title: 'The Ocean Javascript SDK',
+ to: 'https://github.com/TheOceanTrade/theoceanx-javascript',
+ shouldOpenInNewTab: true,
+ },
+ },
+ {
+ description: "Tokenlon SDK provides APIs for developers to trade of imToken's relayer",
+ link: {
+ to: 'https://www.npmjs.com/package/tokenlon-sdk',
+ title: 'Tokenlon Javascript SDK',
+ shouldOpenInNewTab: true,
+ },
+ },
+ {
+ description: 'A small library that implements the 0x order assetData encoding/decoding in Java',
+ link: {
+ to: 'https://github.com/wildnothing/asset-data-decoder',
+ title: 'AssetData decoder library in Java',
+ shouldOpenInNewTab: true,
+ },
+ },
+ ],
+};
+
+export interface DocsHomeProps {
+ location: Location;
+ translate: Translate;
+ screenWidth: ScreenWidths;
+ tutorials: TutorialInfo[];
+ categoryToPackages: ObjectMap<Package[]>;
+ dispatcher: Dispatcher;
+}
+
+export interface DocsHomeState {}
+
+export class DocsHome extends React.Component<DocsHomeProps, DocsHomeState> {
+ public render(): React.ReactNode {
+ const sectionNameToLinks: ObjectMap<ALink[]> = {
+ 'Starter guides': _.map(TUTORIALS, tutorialInfo => {
+ return {
+ ...tutorialInfo.link,
+ title: this.props.translate.get(tutorialInfo.link.title as Key, Deco.Cap),
+ };
+ }),
+ [Categories.ZeroExProtocol]: _.map(CATEGORY_TO_PACKAGES[Categories.ZeroExProtocol], pkg => pkg.link),
+ [Categories.Ethereum]: _.map(CATEGORY_TO_PACKAGES[Categories.Ethereum], pkg => pkg.link),
+ [Categories.CommunityMaintained]: _.map(
+ CATEGORY_TO_PACKAGES[Categories.CommunityMaintained],
+ pkg => pkg.link,
+ ),
+ };
+ const mainContent = (
+ <OverviewContent
+ translate={this.props.translate}
+ tutorials={TUTORIALS}
+ categoryToPackages={CATEGORY_TO_PACKAGES}
+ />
+ );
+ const isSmallScreen = this.props.screenWidth === ScreenWidths.Sm;
+ const sidebar = (
+ <NestedSidebarMenu
+ sidebarHeader={isSmallScreen ? this._renderSidebarHeader() : undefined}
+ sectionNameToLinks={sectionNameToLinks}
+ shouldReformatMenuItemNames={false}
+ />
+ );
+ return (
+ <DevelopersPage
+ mainContent={mainContent}
+ sidebar={sidebar}
+ location={this.props.location}
+ screenWidth={this.props.screenWidth}
+ translate={this.props.translate}
+ dispatcher={this.props.dispatcher}
+ />
+ );
+ }
+ private _renderSidebarHeader(): React.ReactNode {
+ const menuItems = _.map(constants.DEVELOPER_TOPBAR_LINKS, menuItemInfo => {
+ return (
+ <Link
+ key={`menu-item-${menuItemInfo.title}`}
+ to={menuItemInfo.to}
+ shouldOpenInNewTab={menuItemInfo.shouldOpenInNewTab}
+ >
+ <Button
+ borderRadius="4px"
+ padding="0.4em 0.375em"
+ width="100%"
+ fontColor={colors.grey800}
+ fontSize="14px"
+ textAlign="left"
+ >
+ {this.props.translate.get(menuItemInfo.title as Key, Deco.Cap)}
+ </Button>
+ </Link>
+ );
+ });
+ return menuItems;
+ }
+}
diff --git a/packages/website/ts/pages/faq/faq.tsx b/packages/website/ts/pages/faq/faq.tsx
index c9295d806..10d91bae8 100644
--- a/packages/website/ts/pages/faq/faq.tsx
+++ b/packages/website/ts/pages/faq/faq.tsx
@@ -1,4 +1,4 @@
-import { colors, Styles } from '@0xproject/react-shared';
+import { colors, Styles } from '@0x/react-shared';
import * as _ from 'lodash';
import * as React from 'react';
import * as DocumentTitle from 'react-document-title';
diff --git a/packages/website/ts/pages/faq/question.tsx b/packages/website/ts/pages/faq/question.tsx
index f80985257..413ffb6ce 100644
--- a/packages/website/ts/pages/faq/question.tsx
+++ b/packages/website/ts/pages/faq/question.tsx
@@ -1,4 +1,4 @@
-import { colors } from '@0xproject/react-shared';
+import { colors } from '@0x/react-shared';
import { Card, CardHeader, CardText } from 'material-ui/Card';
import * as React from 'react';
diff --git a/packages/website/ts/pages/fullscreen_message.tsx b/packages/website/ts/pages/fullscreen_message.tsx
index 6fcf7b32c..675f27a01 100644
--- a/packages/website/ts/pages/fullscreen_message.tsx
+++ b/packages/website/ts/pages/fullscreen_message.tsx
@@ -1,4 +1,4 @@
-import { Styles } from '@0xproject/react-shared';
+import { Styles } from '@0x/react-shared';
import * as React from 'react';
export interface FullscreenMessageProps {
diff --git a/packages/website/ts/pages/jobs/jobs.tsx b/packages/website/ts/pages/jobs/jobs.tsx
index cc4b1f04b..728e17f9e 100644
--- a/packages/website/ts/pages/jobs/jobs.tsx
+++ b/packages/website/ts/pages/jobs/jobs.tsx
@@ -1,4 +1,4 @@
-import { colors, utils as sharedUtils } from '@0xproject/react-shared';
+import { colors, utils as sharedUtils } from '@0x/react-shared';
import * as _ from 'lodash';
import * as React from 'react';
import * as DocumentTitle from 'react-document-title';
diff --git a/packages/website/ts/pages/jobs/join_0x.tsx b/packages/website/ts/pages/jobs/join_0x.tsx
index ec8afbd93..e869cd455 100644
--- a/packages/website/ts/pages/jobs/join_0x.tsx
+++ b/packages/website/ts/pages/jobs/join_0x.tsx
@@ -1,4 +1,4 @@
-import { colors } from '@0xproject/react-shared';
+import { colors } from '@0x/react-shared';
import * as React from 'react';
diff --git a/packages/website/ts/pages/landing/landing.tsx b/packages/website/ts/pages/landing/landing.tsx
index 388e83d51..e2af40c8d 100644
--- a/packages/website/ts/pages/landing/landing.tsx
+++ b/packages/website/ts/pages/landing/landing.tsx
@@ -1,8 +1,7 @@
-import { colors } from '@0xproject/react-shared';
+import { colors, Link } from '@0x/react-shared';
import * as _ from 'lodash';
import * as React from 'react';
-import DocumentTitle = require('react-document-title');
-import { Link } from 'react-router-dom';
+import DocumentTitle from 'react-document-title';
import { Footer } from 'ts/components/footer';
import { SubscribeForm } from 'ts/components/forms/subscribe_form';
import { TopBar } from 'ts/components/top_bar/top_bar';
@@ -213,14 +212,14 @@ export class Landing extends React.Component<LandingProps, LandingState> {
className={`pt3 flex clearfix sm-mx-auto ${isSmallScreen ? 'justify-center' : ''}`}
>
<Container paddingRight="20px">
- <Link to={WebsitePaths.ZeroExJs} className="text-decoration-none">
+ <Link to={WebsitePaths.Docs}>
<CallToAction type="light">
{this.props.translate.get(Key.BuildCallToAction, Deco.Cap)}
</CallToAction>
</Link>
</Container>
<div>
- <Link to={WebsitePaths.Portal} className="text-decoration-none">
+ <Link to={WebsitePaths.Portal}>
<CallToAction>
{this.props.translate.get(Key.TradeCallToAction, Deco.Cap)}
</CallToAction>
@@ -318,11 +317,7 @@ export class Landing extends React.Component<LandingProps, LandingState> {
}}
>
{this.props.translate.get(Key.FullListPrompt)}{' '}
- <Link
- to={WebsitePaths.Portal}
- className="text-decoration-none underline"
- style={{ color: colors.landingLinkGrey }}
- >
+ <Link to={WebsitePaths.Portal} textDecoration="underline" fontColor={colors.landingLinkGrey}>
{this.props.translate.get(Key.FullListLink)}
</Link>
</div>
@@ -603,7 +598,7 @@ export class Landing extends React.Component<LandingProps, LandingState> {
{this.props.translate.get(Key.FinalCallToAction, Deco.Cap)}
</div>
<div className="sm-center sm-pt2 lg-table-cell md-table-cell">
- <Link to={WebsitePaths.ZeroExJs} className="text-decoration-none">
+ <Link to={WebsitePaths.Docs}>
<CallToAction fontSize="15px">
{this.props.translate.get(Key.BuildCallToAction, Deco.Cap)}
</CallToAction>
diff --git a/packages/website/ts/pages/wiki/wiki.tsx b/packages/website/ts/pages/wiki/wiki.tsx
index 55f532b11..c1802b1f8 100644
--- a/packages/website/ts/pages/wiki/wiki.tsx
+++ b/packages/website/ts/pages/wiki/wiki.tsx
@@ -1,27 +1,28 @@
import {
+ ALink,
colors,
constants as sharedConstants,
HeaderSizes,
+ Link,
MarkdownSection,
- NestedSidebarMenu,
- Styles,
utils as sharedUtils,
-} from '@0xproject/react-shared';
+} from '@0x/react-shared';
+import { ObjectMap } from '@0x/types';
import * as _ from 'lodash';
import CircularProgress from 'material-ui/CircularProgress';
-import RaisedButton from 'material-ui/RaisedButton';
import * as React from 'react';
-import DocumentTitle = require('react-document-title');
-import { SidebarHeader } from 'ts/components/sidebar_header';
-import { TopBar } from 'ts/components/top_bar/top_bar';
+import { SidebarHeader } from 'ts/components/documentation/sidebar_header';
+import { NestedSidebarMenu } from 'ts/components/nested_sidebar_menu';
+import { Button } from 'ts/components/ui/button';
+import { Container } from 'ts/components/ui/container';
+import { DevelopersPage } from 'ts/pages/documentation/developers_page';
import { Dispatcher } from 'ts/redux/dispatcher';
-import { Article, ArticlesBySection } from 'ts/types';
+import { Article, ArticlesBySection, Deco, Key, ScreenWidths } from 'ts/types';
import { backendClient } from 'ts/utils/backend_client';
import { constants } from 'ts/utils/constants';
import { Translate } from 'ts/utils/translate';
import { utils } from 'ts/utils/utils';
-const TOP_BAR_HEIGHT = 60;
const WIKI_NOT_READY_BACKOUT_TIMEOUT_MS = 5000;
export interface WikiProps {
@@ -29,6 +30,7 @@ export interface WikiProps {
location: Location;
dispatcher: Dispatcher;
translate: Translate;
+ screenWidth: ScreenWidths;
}
interface WikiState {
@@ -36,24 +38,6 @@ interface WikiState {
isHoveringSidebar: boolean;
}
-const styles: Styles = {
- mainContainers: {
- position: 'absolute',
- top: 1,
- left: 0,
- bottom: 0,
- right: 0,
- overflow: 'hidden',
- height: `calc(100vh - ${TOP_BAR_HEIGHT}px)`,
- WebkitOverflowScrolling: 'touch',
- },
- menuContainer: {
- borderColor: colors.grey300,
- maxWidth: 330,
- backgroundColor: colors.gray40,
- },
-};
-
export class Wiki extends React.Component<WikiProps, WikiState> {
private _wikiBackoffTimeoutId: number;
private _isUnmounted: boolean;
@@ -65,9 +49,6 @@ export class Wiki extends React.Component<WikiProps, WikiState> {
isHoveringSidebar: false,
};
}
- public componentDidMount(): void {
- window.addEventListener('hashchange', this._onHashChanged.bind(this), false);
- }
public componentWillMount(): void {
// tslint:disable-next-line:no-floating-promises
this._fetchArticlesBySectionAsync();
@@ -75,92 +56,79 @@ export class Wiki extends React.Component<WikiProps, WikiState> {
public componentWillUnmount(): void {
this._isUnmounted = true;
clearTimeout(this._wikiBackoffTimeoutId);
- window.removeEventListener('hashchange', this._onHashChanged.bind(this), false);
}
public render(): React.ReactNode {
- const menuSubsectionsBySection = _.isUndefined(this.state.articlesBySection)
+ const sectionNameToLinks = _.isUndefined(this.state.articlesBySection)
? {}
- : this._getMenuSubsectionsBySection(this.state.articlesBySection);
- const mainContainersStyle: React.CSSProperties = {
- ...styles.mainContainers,
- overflow: this.state.isHoveringSidebar ? 'auto' : 'hidden',
- };
- const sidebarHeader = <SidebarHeader title="Wiki" iconUrl="/images/doc_icons/wiki.png" />;
- return (
- <div>
- <DocumentTitle title="0x Protocol Wiki" />
- <TopBar
- blockchainIsLoaded={false}
- location={this.props.location}
- menuSubsectionsBySection={menuSubsectionsBySection}
- translate={this.props.translate}
- sidebarHeader={sidebarHeader}
- />
- {_.isUndefined(this.state.articlesBySection) ? (
- <div className="col col-12" style={mainContainersStyle}>
- <div
- className="relative sm-px2 sm-pt2 sm-m1"
- style={{ height: 122, top: '50%', transform: 'translateY(-50%)' }}
- >
- <div className="center pb2">
- <CircularProgress size={40} thickness={5} />
- </div>
- <div className="center pt2" style={{ paddingBottom: 11 }}>
- Loading wiki...
- </div>
- </div>
- </div>
- ) : (
- <div style={{ width: '100%', height: '100%', backgroundColor: colors.gray40 }}>
- <div
- className="mx-auto max-width-4 flex"
- style={{ color: colors.grey800, height: `calc(100vh - ${TOP_BAR_HEIGHT}px)` }}
- >
- <div
- className="relative lg-pl0 md-pl1 sm-hide xs-hide"
- style={{ height: `calc(100vh - ${TOP_BAR_HEIGHT}px)`, width: '36%' }}
- >
- <div
- className="absolute"
- style={{
- ...styles.menuContainer,
- ...mainContainersStyle,
- height: 'calc(100vh - 76px)',
- }}
- onMouseEnter={this._onSidebarHover.bind(this)}
- onMouseLeave={this._onSidebarHoverOff.bind(this)}
- >
- <NestedSidebarMenu
- topLevelMenu={menuSubsectionsBySection}
- menuSubsectionsBySection={menuSubsectionsBySection}
- sidebarHeader={sidebarHeader}
- />
- </div>
- </div>
- <div
- className="relative"
- style={{
- width: '100%',
- height: `calc(100vh - ${TOP_BAR_HEIGHT}px)`,
- backgroundColor: 'white',
- }}
- >
- <div
- id={sharedConstants.SCROLL_CONTAINER_ID}
- style={{ ...mainContainersStyle, overflow: 'auto' }}
- className="absolute"
- >
- <div id={sharedConstants.SCROLL_TOP_ID} />
- <div id="wiki" style={{ paddingRight: 2 }}>
- {this._renderWikiArticles()}
- </div>
- </div>
- </div>
- </div>
- </div>
- )}
+ : this._getSectionNameToLinks(this.state.articlesBySection);
+
+ const mainContent = _.isUndefined(this.state.articlesBySection) ? (
+ <div className="flex justify-center">{this._renderLoading()}</div>
+ ) : (
+ <div id="wiki" style={{ paddingRight: 2 }}>
+ {this._renderWikiArticles()}
</div>
);
+ const isSmallScreen = this.props.screenWidth === ScreenWidths.Sm;
+ const sidebar = _.isUndefined(this.state.articlesBySection) ? (
+ <div />
+ ) : (
+ <NestedSidebarMenu
+ sidebarHeader={isSmallScreen ? this._renderSidebarHeader() : undefined}
+ sectionNameToLinks={sectionNameToLinks}
+ />
+ );
+ return (
+ <DevelopersPage
+ sidebar={sidebar}
+ mainContent={mainContent}
+ location={this.props.location}
+ screenWidth={this.props.screenWidth}
+ translate={this.props.translate}
+ dispatcher={this.props.dispatcher}
+ />
+ );
+ }
+ private _renderSidebarHeader(): React.ReactNode {
+ const menuItems = _.map(constants.DEVELOPER_TOPBAR_LINKS, menuItemInfo => {
+ return (
+ <Link
+ key={`menu-item-${menuItemInfo.title}`}
+ to={menuItemInfo.to}
+ shouldOpenInNewTab={menuItemInfo.shouldOpenInNewTab}
+ >
+ <Button
+ borderRadius="4px"
+ padding="0.4em 0.375em"
+ width="100%"
+ fontColor={colors.grey800}
+ fontSize="14px"
+ textAlign="left"
+ >
+ {this.props.translate.get(menuItemInfo.title as Key, Deco.Cap)}
+ </Button>
+ </Link>
+ );
+ });
+ const wikiTitle = this.props.translate.get(Key.Wiki, Deco.Cap);
+ return (
+ <Container>
+ <SidebarHeader screenWidth={this.props.screenWidth} title={wikiTitle} />
+ {menuItems}
+ </Container>
+ );
+ }
+ private _renderLoading(): React.ReactNode {
+ return (
+ <Container className="pt4">
+ <Container className="center pb2">
+ <CircularProgress size={40} thickness={5} />
+ </Container>
+ <Container className="center pt2" paddingBottom="11px">
+ Loading wiki...
+ </Container>
+ </Container>
+ );
}
private _renderWikiArticles(): React.ReactNode {
const sectionNames = _.keys(this.state.articlesBySection);
@@ -179,22 +147,10 @@ export class Wiki extends React.Component<WikiProps, WikiState> {
headerSize={HeaderSizes.H2}
githubLink={githubLink}
/>
- <div className="clearfix mb3 mt2 p3 mx-auto lg-flex md-flex sm-pb4" style={{ maxWidth: 390 }}>
- <div className="sm-col sm-col-12 sm-center" style={{ opacity: 0.4, lineHeight: 2.5 }}>
- See a way to improve this article?
- </div>
- <div className="sm-col sm-col-12 lg-col-7 md-col-7 sm-center sm-pt2">
- <RaisedButton href={githubLink} target="_blank" label="Edit on Github" />
- </div>
- </div>
</div>
);
});
- return (
- <div key={`section-${sectionName}`} className="py2 md-px1 sm-px0">
- {renderedArticles}
- </div>
- );
+ return <div key={`section-${sectionName}`}>{renderedArticles}</div>;
}
private async _fetchArticlesBySectionAsync(): Promise<void> {
try {
@@ -223,28 +179,19 @@ export class Wiki extends React.Component<WikiProps, WikiState> {
}
}
}
- private _getMenuSubsectionsBySection(articlesBySection: ArticlesBySection): { [section: string]: string[] } {
+ private _getSectionNameToLinks(articlesBySection: ArticlesBySection): ObjectMap<ALink[]> {
const sectionNames = _.keys(articlesBySection);
- const menuSubsectionsBySection: { [section: string]: string[] } = {};
+ const sectionNameToLinks: ObjectMap<ALink[]> = {};
for (const sectionName of sectionNames) {
const articles = articlesBySection[sectionName];
- const articleNames = _.map(articles, article => article.title);
- menuSubsectionsBySection[sectionName] = articleNames;
+ const articleLinks = _.map(articles, article => {
+ return {
+ to: sharedUtils.getIdFromName(article.title),
+ title: article.title,
+ };
+ });
+ sectionNameToLinks[sectionName] = articleLinks;
}
- return menuSubsectionsBySection;
- }
- private _onSidebarHover(_event: React.FormEvent<HTMLInputElement>): void {
- this.setState({
- isHoveringSidebar: true,
- });
- }
- private _onSidebarHoverOff(): void {
- this.setState({
- isHoveringSidebar: false,
- });
- }
- private _onHashChanged(_event: any): void {
- const hash = window.location.hash.slice(1);
- sharedUtils.scrollToHash(hash, sharedConstants.SCROLL_CONTAINER_ID);
+ return sectionNameToLinks;
}
}
diff --git a/packages/website/ts/redux/dispatcher.ts b/packages/website/ts/redux/dispatcher.ts
index c418cab3f..e85afd3b1 100644
--- a/packages/website/ts/redux/dispatcher.ts
+++ b/packages/website/ts/redux/dispatcher.ts
@@ -1,4 +1,4 @@
-import { BigNumber } from '@0xproject/utils';
+import { BigNumber } from '@0x/utils';
import { Dispatch } from 'redux';
import { State } from 'ts/redux/reducer';
import {
diff --git a/packages/website/ts/redux/reducer.ts b/packages/website/ts/redux/reducer.ts
index f54801639..51c77ba47 100644
--- a/packages/website/ts/redux/reducer.ts
+++ b/packages/website/ts/redux/reducer.ts
@@ -1,5 +1,5 @@
-import { generatePseudoRandomSalt } from '@0xproject/order-utils';
-import { BigNumber } from '@0xproject/utils';
+import { generatePseudoRandomSalt } from '@0x/order-utils';
+import { BigNumber } from '@0x/utils';
import * as _ from 'lodash';
import * as moment from 'moment';
import {
diff --git a/packages/website/ts/schemas/validator.ts b/packages/website/ts/schemas/validator.ts
index 3fd013002..128d943e1 100644
--- a/packages/website/ts/schemas/validator.ts
+++ b/packages/website/ts/schemas/validator.ts
@@ -1,4 +1,4 @@
-import { SchemaValidator } from '@0xproject/json-schemas';
+import { SchemaValidator } from '@0x/json-schemas';
import { orderMetadataSchema } from 'ts/schemas/metadata_schema';
import { portalOrderSchema } from 'ts/schemas/portal_order_schema';
import { portalTokenMetadataSchema } from 'ts/schemas/portal_token_metadata';
diff --git a/packages/website/ts/style/colors.ts b/packages/website/ts/style/colors.ts
index 349845a09..0620bae0f 100644
--- a/packages/website/ts/style/colors.ts
+++ b/packages/website/ts/style/colors.ts
@@ -1,4 +1,4 @@
-import { colors as sharedColors } from '@0xproject/react-shared';
+import { colors as sharedColors } from '@0x/react-shared';
const appColors = {
walletBoxShadow: 'rgba(0, 0, 0, 0.05)',
diff --git a/packages/website/ts/types.ts b/packages/website/ts/types.ts
index 4ec45c46e..ce4b50a58 100644
--- a/packages/website/ts/types.ts
+++ b/packages/website/ts/types.ts
@@ -1,5 +1,6 @@
-import { ObjectMap, SignedOrder } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
+import { ALink } from '@0x/react-shared';
+import { ObjectMap, SignedOrder } from '@0x/types';
+import { BigNumber } from '@0x/utils';
import { Provider } from 'ethereum-types';
import * as React from 'react';
@@ -363,6 +364,7 @@ export enum WebsitePaths {
Subproviders = '/docs/subproviders',
OrderUtils = '/docs/order-utils',
EthereumTypes = '/docs/ethereum-types',
+ AssetBuyer = '/docs/asset-buyer',
Careers = '/careers',
}
@@ -379,6 +381,7 @@ export enum DocPackages {
EthereumTypes = 'ETHEREUM_TYPES',
ContractWrappers = 'CONTRACT_WRAPPERS',
OrderWatcher = 'ORDER_WATCHER',
+ AssetBuyer = 'ASSET_BUYER',
}
export enum Key {
@@ -440,6 +443,7 @@ export enum Key {
ZeroExJs = '0X_JS',
ContractWrappers = 'CONTRACT_WRAPPERS',
OrderWatcher = 'ORDER_WATCHER',
+ AssetBuyer = 'ASSET_BUYER',
Blog = 'BLOG',
Forum = 'FORUM',
Connect = 'CONNECT',
@@ -458,6 +462,23 @@ export enum Key {
RocketChat = 'ROCKETCHAT',
TradeCallToAction = 'TRADE_CALL_TO_ACTION',
OurMissionAndValues = 'OUR_MISSION_AND_VALUES',
+ BuildARelayer = 'BUILD_A_RELAYER',
+ BuildARelayerDescription = 'BUILD_A_RELAYER_DESCRIPTION',
+ DevelopOnEthereum = 'DEVELOP_ON_ETHEREUM',
+ DevelopOnEthereumDescription = 'DEVELOP_ON_ETHEREUM_DESCRIPTION',
+ OrderBasics = 'ORDER_BASICS',
+ OrderBasicsDescription = 'ORDER_BASICS_DESCRIPTION',
+ UseNetworkedLiquidity = 'USE_NETWORKED_LIQUIDITY',
+ UseNetworkedLiquidityDescription = 'USE_NETWORKED_LIQUIDITY_DESCRIPTION',
+ ViewAllDocumentation = 'VIEW_ALL_DOCUMENTATION',
+ Sandbox = 'SANDBOX',
+ Github = 'GITHUB',
+ LiveChat = 'LIVE_CHAT',
+ LibrariesAndTools = 'LIBRARIES_AND_TOOLS',
+ LibrariesAndToolsDescription = 'LIBRARIES_AND_TOOLS_DESCRIPTION',
+ More = 'MORE',
+ StartBuildOn0x = 'START_BUILDING_ON_0X',
+ StartBuildOn0xDescription = 'START_BUILDING_ON_0X_DESCRIPTION',
}
export enum SmartContractDocSections {
@@ -569,6 +590,8 @@ export enum BrowserType {
Chrome = 'Chrome',
Firefox = 'Firefox',
Opera = 'Opera',
+ Safari = 'Safari',
+ Edge = 'Edge',
Other = 'Other',
}
@@ -593,11 +616,20 @@ export interface InjectedProvider extends Provider {
publicConfigStore?: InjectedProviderObservable;
}
-// Minimal expected interface for an injected web3 object
-export interface InjectedWeb3 {
- currentProvider: InjectedProvider;
- version: {
- getNetwork(cd: (err: Error, networkId: string) => void): void;
- };
+export interface TutorialInfo {
+ iconUrl: string;
+ description: string;
+ link: ALink;
+}
+
+export enum Categories {
+ ZeroExProtocol = '0x Protocol',
+ Ethereum = 'Ethereum',
+ CommunityMaintained = 'Community Maintained',
+}
+
+export interface Package {
+ description: string;
+ link: ALink;
}
// tslint:disable:max-file-line-count
diff --git a/packages/website/ts/utils/analytics.ts b/packages/website/ts/utils/analytics.ts
index 3aae317b0..e990b4fc7 100644
--- a/packages/website/ts/utils/analytics.ts
+++ b/packages/website/ts/utils/analytics.ts
@@ -1,5 +1,5 @@
-import { assetDataUtils } from '@0xproject/order-utils';
-import { ObjectMap } from '@0xproject/types';
+import { assetDataUtils } from '@0x/order-utils';
+import { ObjectMap } from '@0x/types';
import * as _ from 'lodash';
import { PortalOrder } from 'ts/types';
import { utils } from 'ts/utils/utils';
diff --git a/packages/website/ts/utils/constants.ts b/packages/website/ts/utils/constants.ts
index 18a4d8100..0a8a86c50 100644
--- a/packages/website/ts/utils/constants.ts
+++ b/packages/website/ts/utils/constants.ts
@@ -1,4 +1,9 @@
-import { BigNumber } from '@0xproject/utils';
+import { ALink } from '@0x/react-shared';
+import { BigNumber } from '@0x/utils';
+import { Key, WebsitePaths } from 'ts/types';
+
+const URL_FORUM = 'https://forum.0xproject.com';
+const URL_ZEROEX_CHAT = 'https://chat.0xproject.com';
export const constants = {
DECIMAL_PLACES_ETH: 18,
@@ -74,6 +79,7 @@ export const constants = {
URL_TESTNET_FAUCET: 'https://faucet.0xproject.com',
URL_GITHUB_ORG: 'https://github.com/0xProject',
URL_GITHUB_WIKI: 'https://github.com/0xProject/wiki',
+ URL_FORUM,
URL_METAMASK_CHROME_STORE: 'https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn',
URL_METAMASK_FIREFOX_STORE: 'https://addons.mozilla.org/en-US/firefox/addon/ether-metamask/',
URL_COINBASE_WALLET_IOS_APP_STORE: 'https://itunes.apple.com/us/app/coinbase-wallet/id1278383455?mt=8',
@@ -84,10 +90,11 @@ export const constants = {
URL_PARITY_CHROME_STORE:
'https://chrome.google.com/webstore/detail/parity-ethereum-integrati/himekenlppkgeaoeddcliojfddemadig',
URL_REDDIT: 'https://reddit.com/r/0xproject',
+ URL_SANDBOX: 'https://codesandbox.io/s/1qmjyp7p5j',
URL_STANDARD_RELAYER_API_GITHUB: 'https://github.com/0xProject/standard-relayer-api/blob/master/README.md',
URL_TWITTER: 'https://twitter.com/0xproject',
URL_WETH_IO: 'https://weth.io/',
- URL_ZEROEX_CHAT: 'https://chat.0xproject.com',
+ URL_ZEROEX_CHAT,
URL_WEB3_DOCS: 'https://github.com/ethereum/wiki/wiki/JavaScript-API',
URL_WEB3_DECODED_LOG_ENTRY_EVENT:
'https://github.com/0xProject/web3-typescript-typings/blob/f5bcb96/index.d.ts#L123',
@@ -95,4 +102,24 @@ export const constants = {
URL_WEB3_PROVIDER_DOCS: 'https://github.com/0xProject/web3-typescript-typings/blob/f5bcb96/index.d.ts#L150',
URL_BIGNUMBERJS_GITHUB: 'http://mikemcl.github.io/bignumber.js',
URL_MISSION_AND_VALUES_BLOG_POST: 'https://blog.0xproject.com/the-0x-mission-and-values-181a58706f9f',
+ DEVELOPER_TOPBAR_LINKS: [
+ {
+ title: Key.Home,
+ to: WebsitePaths.Home,
+ },
+ {
+ title: Key.Wiki,
+ to: WebsitePaths.Wiki,
+ },
+ {
+ title: Key.Forum,
+ to: URL_FORUM,
+ shouldOpenInNewTab: true,
+ },
+ {
+ title: Key.LiveChat,
+ to: URL_ZEROEX_CHAT,
+ shouldOpenInNewTab: true,
+ },
+ ] as ALink[],
};
diff --git a/packages/website/ts/utils/doc_utils.ts b/packages/website/ts/utils/doc_utils.ts
index 0e1d9ea6e..6be164e6e 100644
--- a/packages/website/ts/utils/doc_utils.ts
+++ b/packages/website/ts/utils/doc_utils.ts
@@ -1,8 +1,8 @@
-import { DocAgnosticFormat, GeneratedDocJson } from '@0xproject/react-docs';
-import { fetchAsync, logUtils } from '@0xproject/utils';
+import { DocAgnosticFormat, GeneratedDocJson } from '@0x/react-docs';
+import { fetchAsync, logUtils } from '@0x/utils';
import * as _ from 'lodash';
import { S3FileObject, VersionToFilePath } from 'ts/types';
-import convert = require('xml-js');
+import convert from 'xml-js';
export const docUtils = {
async getVersionToFilePathAsync(s3DocJsonRoot: string, folderName: string): Promise<VersionToFilePath> {
diff --git a/packages/website/ts/utils/error_reporter.ts b/packages/website/ts/utils/error_reporter.ts
index bec92e829..8e24060ac 100644
--- a/packages/website/ts/utils/error_reporter.ts
+++ b/packages/website/ts/utils/error_reporter.ts
@@ -1,5 +1,5 @@
-import { logUtils } from '@0xproject/utils';
-import Rollbar = require('rollbar');
+import { logUtils } from '@0x/utils';
+import Rollbar from 'rollbar';
import { configs } from 'ts/utils/configs';
import { constants } from 'ts/utils/constants';
import { utils } from 'ts/utils/utils';
diff --git a/packages/website/ts/utils/fake_token_registry.ts b/packages/website/ts/utils/fake_token_registry.ts
new file mode 100644
index 000000000..607dd2553
--- /dev/null
+++ b/packages/website/ts/utils/fake_token_registry.ts
@@ -0,0 +1,879 @@
+export interface FakeTokenRegistryEntry {
+ address: string;
+ name: string;
+ symbol: string;
+ decimals: number;
+}
+
+export const fakeTokenRegistry: { [networkId: string]: FakeTokenRegistryEntry[] } = {
+ '1': [
+ {
+ address: '0xe41d2489571d322189246dafa5ebde1f4699f498',
+ name: '0x Protocol Token',
+ symbol: 'ZRX',
+ decimals: 18,
+ },
+ {
+ address: '0x4156d3342d5c385a87d264f90653733592000581',
+ name: 'Salt',
+ symbol: 'SALT',
+ decimals: 8,
+ },
+ {
+ address: '0x05f4a42e251f2d52b8ed15e9fedaacfcef1fad27',
+ name: 'Zilliqa',
+ symbol: 'ZIL',
+ decimals: 12,
+ },
+ {
+ address: '0xe0b7927c4af23765cb51314a0e0521a9645f0e2a',
+ name: 'Digix DAO Token',
+ symbol: 'DGD',
+ decimals: 9,
+ },
+ {
+ address: '0xfa05a73ffe78ef8f1a739473e462c54bae6567d9',
+ name: 'Lunyr',
+ symbol: 'LUN',
+ decimals: 18,
+ },
+ {
+ address: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
+ name: 'Wrapped Ether',
+ symbol: 'WETH',
+ decimals: 18,
+ },
+ {
+ address: '0xbeb9ef514a379b997e0798fdcc901ee474b6d9a1',
+ name: 'Melon Token',
+ symbol: 'MLN',
+ decimals: 18,
+ },
+ {
+ address: '0x9a642d6b3368ddc662ca244badf32cda716005bc',
+ name: 'Qtum',
+ symbol: 'QTUM',
+ decimals: 18,
+ },
+ {
+ address: '0xd26114cd6ee289accf82350c8d8487fedb8a0c07',
+ name: 'OmiseGO',
+ symbol: 'OMG',
+ decimals: 18,
+ },
+ {
+ address: '0xb97048628db6b661d4c2aa833e95dbe1a905b280',
+ name: 'TenXPay',
+ symbol: 'PAY',
+ decimals: 18,
+ },
+ {
+ address: '0x86fa049857e0209aa7d9e616f7eb3b3b78ecfdb0',
+ name: 'Eos',
+ symbol: 'EOS',
+ decimals: 18,
+ },
+ {
+ address: '0x888666ca69e0f178ded6d75b5726cee99a87d698',
+ name: 'Iconomi',
+ symbol: 'ICN',
+ decimals: 18,
+ },
+ {
+ address: '0x744d70fdbe2ba4cf95131626614a1763df805b9e',
+ name: 'StatusNetwork',
+ symbol: 'SNT',
+ decimals: 18,
+ },
+ {
+ address: '0x6810e776880c02933d47db1b9fc05908e5386b96',
+ name: 'Gnosis',
+ symbol: 'GNO',
+ decimals: 18,
+ },
+ {
+ address: '0x0d8775f648430679a709e98d2b0cb6250d2887ef',
+ name: 'Basic Attention Token',
+ symbol: 'BAT',
+ decimals: 18,
+ },
+ {
+ address: '0xb64ef51c888972c908cfacf59b47c1afbc0ab8ac',
+ name: 'Storj',
+ symbol: 'STORJ',
+ decimals: 8,
+ },
+ {
+ address: '0x1f573d6fb3f13d689ff844b4ce37794d79a7ff1c',
+ name: 'Bancor',
+ symbol: 'BNT',
+ decimals: 18,
+ },
+ {
+ address: '0x960b236a07cf122663c4303350609a66a7b288c0',
+ name: 'Aragon',
+ symbol: 'ANT',
+ decimals: 18,
+ },
+ {
+ address: '0x0abdace70d3790235af448c88547603b945604ea',
+ name: 'district0x',
+ symbol: 'DNT',
+ decimals: 18,
+ },
+ {
+ address: '0xaec2e87e0a235266d9c5adc9deb4b2e29b54d009',
+ name: 'SingularDTV',
+ symbol: 'SNGLS',
+ decimals: 0,
+ },
+ {
+ address: '0x419d0d8bdd9af5e606ae2232ed285aff190e711b',
+ name: 'FunFair',
+ symbol: 'FUN',
+ decimals: 8,
+ },
+ {
+ address: '0xaf30d2a7e90d7dc361c8c4585e9bb7d2f6f15bc7',
+ name: 'FirstBlood',
+ symbol: '1ST',
+ decimals: 18,
+ },
+ {
+ address: '0x08711d3b02c8758f2fb3ab4e80228418a7f8e39c',
+ name: 'Edgeless',
+ symbol: 'EDG',
+ decimals: 0,
+ },
+ {
+ address: '0x9992ec3cf6a55b00978cddf2b27bc6882d88d1ec',
+ name: 'Polymath',
+ symbol: 'POLY',
+ decimals: 18,
+ },
+ {
+ address: '0x607f4c5bb672230e8672085532f7e901544a7375',
+ name: 'iExec',
+ symbol: 'RLC',
+ decimals: 9,
+ },
+ {
+ address: '0x667088b212ce3d06a1b553a7221e1fd19000d9af',
+ name: 'Wings',
+ symbol: 'WINGS',
+ decimals: 18,
+ },
+ {
+ address: '0x41e5560054824ea6b0732e656e3ad64e20e94e45',
+ name: 'Civic',
+ symbol: 'CVC',
+ decimals: 8,
+ },
+ {
+ address: '0xb63b606ac810a52cca15e44bb630fd42d8d1d83d',
+ name: 'Monaco',
+ symbol: 'MCO',
+ decimals: 8,
+ },
+ {
+ address: '0xf433089366899d83a9f26a773d59ec7ecf30355e',
+ name: 'Metal',
+ symbol: 'MTL',
+ decimals: 8,
+ },
+ {
+ address: '0x12fef5e57bf45873cd9b62e9dbd7bfb99e32d73e',
+ name: 'Cofoundit',
+ symbol: 'CFI',
+ decimals: 18,
+ },
+ {
+ address: '0xaaaf91d9b90df800df4f55c205fd6989c977e73a',
+ name: 'Monolith TKN',
+ symbol: 'TKN',
+ decimals: 8,
+ },
+ {
+ address: '0xe7775a6e9bcf904eb39da2b68c5efb4f9360e08c',
+ name: 'Token-as-a-Service',
+ symbol: 'TAAS',
+ decimals: 6,
+ },
+ {
+ address: '0x2e071d2966aa7d8decb1005885ba1977d6038a65',
+ name: 'DICE',
+ symbol: 'ROL',
+ decimals: 16,
+ },
+ {
+ address: '0xcb94be6f13a1182e4a4b6140cb7bf2025d28e41b',
+ name: 'Trustcoin',
+ symbol: 'TRST',
+ decimals: 6,
+ },
+ {
+ address: '0x1776e1f26f98b1a5df9cd347953a26dd3cb46671',
+ name: 'Numeraire',
+ symbol: 'NMR',
+ decimals: 18,
+ },
+ {
+ address: '0x7c5a0ce9267ed19b22f8cae653f198e3e8daf098',
+ name: 'Santiment Network Token',
+ symbol: 'SAN',
+ decimals: 18,
+ },
+ {
+ address: '0xdd974d5c2e2928dea5f71b9825b8b646686bd200',
+ name: 'Kyber Network Crystal',
+ symbol: 'KNC',
+ decimals: 18,
+ },
+ {
+ address: '0xb7cb1c96db6b22b0d3d9536e0108d062bd488f74',
+ name: 'Walton',
+ symbol: 'WTC',
+ decimals: 18,
+ },
+ {
+ address: '0xd0d6d6c5fe4a677d343cc433536bb717bae167dd',
+ name: 'adToken',
+ symbol: 'ADT',
+ decimals: 9,
+ },
+ {
+ address: '0x42d6622dece394b54999fbd73d108123806f6a18',
+ name: 'SpankChain',
+ symbol: 'SPANK',
+ decimals: 18,
+ },
+ {
+ address: '0x701c244b988a513c945973defa05de933b23fe1d',
+ name: 'openANX',
+ symbol: 'OAX',
+ decimals: 18,
+ },
+ {
+ address: '0x514910771af9ca656af840dff83e8264ecf986ca',
+ name: 'ChainLink',
+ symbol: 'LINK',
+ decimals: 18,
+ },
+ {
+ address: '0x8f8221afbb33998d8584a2b05749ba73c37a938a',
+ name: 'Request Network',
+ symbol: 'REQ',
+ decimals: 18,
+ },
+ {
+ address: '0x27054b13b1b798b345b591a4d22e6562d47ea75a',
+ name: 'AirSwap',
+ symbol: 'AST',
+ decimals: 4,
+ },
+ {
+ address: '0xf0ee6b27b759c9893ce4f094b49ad28fd15a23e4',
+ name: 'Enigma',
+ symbol: 'ENG',
+ decimals: 8,
+ },
+ {
+ address: '0x818fc6c2ec5986bc6e2cbf00939d90556ab12ce5',
+ name: 'Kin',
+ symbol: 'KIN',
+ decimals: 18,
+ },
+ {
+ address: '0x27dce1ec4d3f72c3e457cc50354f1f975ddef488',
+ name: 'AirToken',
+ symbol: 'AIR',
+ decimals: 8,
+ },
+ {
+ address: '0x12480e24eb5bec1a9d4369cab6a80cad3c0a377a',
+ name: 'Substratum',
+ symbol: 'SUB',
+ decimals: 2,
+ },
+ {
+ address: '0x0e8d6b471e332f140e7d9dbb99e5e3822f728da6',
+ name: 'ABYSS',
+ symbol: 'ABYSS',
+ decimals: 18,
+ },
+ {
+ address: '0x4ceda7906a5ed2179785cd3a40a69ee8bc99c466',
+ name: 'AION',
+ symbol: 'AION',
+ decimals: 8,
+ },
+ {
+ address: '0xd8912c10681d8b21fd3742244f44658dba12264e',
+ name: 'Pluton',
+ symbol: 'PLU',
+ decimals: 18,
+ },
+ {
+ address: '0x1a7a8bd9106f2b8d977e08582dc7d24c723ab0db',
+ name: 'AppCoins',
+ symbol: 'APPC',
+ decimals: 18,
+ },
+ {
+ address: '0xba5f11b16b155792cf3b2e6880e8706859a8aeb6',
+ name: 'Aeron',
+ symbol: 'ARN',
+ decimals: 8,
+ },
+ {
+ address: '0xfec0cf7fe078a500abf15f1284958f22049c2c7e',
+ name: 'Maecenas ART Token',
+ symbol: 'ART',
+ decimals: 18,
+ },
+ {
+ address: '0x0f5d2fb29fb7d3cfee444a200298f468908cc942',
+ name: 'Decentraland',
+ symbol: 'MANA',
+ decimals: 18,
+ },
+ {
+ address: '0x1c4481750daa5ff521a2a7490d9981ed46465dbd',
+ name: 'BlockMason Credit Protocol Token',
+ symbol: 'BCPT',
+ decimals: 18,
+ },
+ {
+ address: '0x55296f69f40ea6d20e478533c15a6b08b654e758',
+ name: 'XY Oracle',
+ symbol: 'XYO',
+ decimals: 18,
+ },
+ {
+ address: '0xd7732e3783b0047aa251928960063f863ad022d8',
+ name: 'BrahmaOS',
+ symbol: 'BRM',
+ decimals: 18,
+ },
+ {
+ address: '0x7d4b8cce0591c9044a22ee543533b72e976e36c3',
+ name: 'Change Coin',
+ symbol: 'CAG',
+ decimals: 18,
+ },
+ {
+ address: '0x1d462414fe14cf489c7a21cac78509f4bf8cd7c0',
+ name: 'CanYaCoin',
+ symbol: 'CAN',
+ decimals: 6,
+ },
+ {
+ address: '0x1234567461d3f8db7496581774bd869c83d51c93',
+ name: 'BitClave',
+ symbol: 'CAT',
+ decimals: 18,
+ },
+ {
+ address: '0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359',
+ name: 'Dai Stablecoin v1.0',
+ symbol: 'DAI',
+ decimals: 18,
+ },
+ {
+ address: '0x0cf0ee63788a0849fe5297f3407f701e122cc023',
+ name: 'Streamr DATAcoin',
+ symbol: 'DATA',
+ decimals: 18,
+ },
+ {
+ address: '0x151202c9c18e495656f372281f493eb7698961d5',
+ name: 'DEBITUM',
+ symbol: 'DEB',
+ decimals: 18,
+ },
+ {
+ address: '0xba2184520a1cc49a6159c57e61e1844e085615b6',
+ name: 'HelloGold Token',
+ symbol: 'HGT',
+ decimals: 8,
+ },
+ {
+ address: '0x13f11c9905a08ca76e3e853be63d4f0944326c72',
+ name: 'Divi Exchange Token',
+ symbol: 'DIVX',
+ decimals: 18,
+ },
+ {
+ address: '0x5b26c5d0772e5bbac8b3182ae9a13f9bb2d03765',
+ name: 'EDU Token',
+ symbol: 'EDU',
+ decimals: 8,
+ },
+ {
+ address: '0xd49ff13661451313ca1553fd6954bd1d9b6e02b9',
+ name: 'ElectrifyAsia',
+ symbol: 'ELEC',
+ decimals: 18,
+ },
+ {
+ address: '0x95daaab98046846bf4b2853e23cba236fa394a31',
+ name: 'EtheremonToken',
+ symbol: 'EMONT',
+ decimals: 8,
+ },
+ {
+ address: '0x5bc7e5f0ab8b2e10d2d0a3f21739fce62459aef3',
+ name: 'Hut34 Entropy Token',
+ symbol: 'ENTR',
+ decimals: 18,
+ },
+ {
+ address: '0x923108a439c4e8c2315c4f6521e5ce95b44e9b4c',
+ name: 'Devery.io',
+ symbol: 'EVE',
+ decimals: 18,
+ },
+ {
+ address: '0xf8e386eda857484f5a12e4b5daa9984e06e73705',
+ name: 'Indorse Token',
+ symbol: 'IND',
+ decimals: 18,
+ },
+ {
+ address: '0x4f4f0db4de903b88f2b1a2847971e231d54f8fd3',
+ name: 'Geens Platform Token',
+ symbol: 'GEE',
+ decimals: 8,
+ },
+ {
+ address: '0x543ff227f64aa17ea132bf9886cab5db55dcaddf',
+ name: 'DAOstack',
+ symbol: 'GEN',
+ decimals: 18,
+ },
+ {
+ address: '0x8a854288a5976036a725879164ca3e91d30c6a1b',
+ name: 'Guaranteed Entrance Token',
+ symbol: 'GET',
+ decimals: 18,
+ },
+ {
+ address: '0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2',
+ name: 'Maker',
+ symbol: 'MKR',
+ decimals: 18,
+ },
+ {
+ address: '0x9af839687f6c94542ac5ece2e317daae355493a1',
+ name: 'Hydro Protocol Token',
+ symbol: 'HOT',
+ decimals: 18,
+ },
+ {
+ address: '0x0d262e5dc4a06a0f1c90ce79c7a60c09dfc884e4',
+ name: 'JET8 Token',
+ symbol: 'J8T',
+ decimals: 8,
+ },
+ {
+ address: '0x8727c112c712c4a03371ac87a74dd6ab104af768',
+ name: 'Jetcoin Institute Token',
+ symbol: 'JET',
+ decimals: 18,
+ },
+ {
+ address: '0xa4e8c3ec456107ea67d3075bf9e3df3a75823db0',
+ name: 'Loom Network Token',
+ symbol: 'LOOM',
+ decimals: 18,
+ },
+ {
+ address: '0x957c30ab0426e0c93cd8241e2c60392d08c6ac8e',
+ name: 'Modum Token',
+ symbol: 'MOD',
+ decimals: 0,
+ },
+ {
+ address: '0x2ef27bf41236bd859a95209e17a43fbd26851f92',
+ name: 'MORPH',
+ symbol: 'MORPH',
+ decimals: 4,
+ },
+ {
+ address: '0x263c618480dbe35c300d8d5ecda19bbb986acaed',
+ name: 'MOT',
+ symbol: 'MOT',
+ decimals: 18,
+ },
+ {
+ address: '0xffe02ee4c69edf1b340fcad64fbd6b37a7b9e265',
+ name: 'NANJCOIN',
+ symbol: 'NANJ',
+ decimals: 8,
+ },
+ {
+ address: '0xc15a399c4ea7815fe36857c9e290ee452a5d6b21',
+ name: 'BoatPilot Token',
+ symbol: 'NAVI',
+ decimals: 18,
+ },
+ {
+ address: '0x9e46a38f5daabe8683e10793b06749eef7d733d1',
+ name: 'PolySwarm Nectar',
+ symbol: 'NCT',
+ decimals: 18,
+ },
+ {
+ address: '0xa54ddc7b3cce7fc8b1e3fa0256d0db80d2c10970',
+ name: 'NEVERDIE Coin',
+ symbol: 'NDC',
+ decimals: 18,
+ },
+ {
+ address: '0xb62132e35a6c13ee1ee0f84dc5d40bad8d815206',
+ name: 'Nexo',
+ symbol: 'NEXO',
+ decimals: 18,
+ },
+ {
+ address: '0x0235fe624e044a05eed7a43e16e3083bc8a4287a',
+ name: 'Original Crypto Coin',
+ symbol: 'OCC',
+ decimals: 18,
+ },
+ {
+ address: '0xb5dbc6d3cf380079df3b27135664b6bcf45d1869',
+ name: 'Omix',
+ symbol: 'OMX',
+ decimals: 8,
+ },
+ {
+ address: '0xfedae5642668f8636a11987ff386bfd215f942ee',
+ name: 'PolicyPal Network Token',
+ symbol: 'PAL',
+ decimals: 18,
+ },
+ {
+ address: '0x2604fa406be957e542beb89e6754fcde6815e83f',
+ name: 'Playkey Token',
+ symbol: 'PKT',
+ decimals: 18,
+ },
+ {
+ address: '0xe477292f1b3268687a29376116b0ed27a9c76170',
+ name: 'Herocoin',
+ symbol: 'PLAY',
+ decimals: 18,
+ },
+ {
+ address: '0x1985365e9f78359a9b6ad760e32412f4a445e862',
+ name: 'Augur',
+ symbol: 'REP',
+ decimals: 18,
+ },
+ {
+ address: '0x408e41876cccdc0f92210600ef50372656052a38',
+ name: 'Republic Protocol',
+ symbol: 'REN',
+ decimals: 18,
+ },
+ {
+ address: '0xd0929d411954c47438dc1d871dd6081f5c5e149c',
+ name: 'Refereum',
+ symbol: 'RFR',
+ decimals: 4,
+ },
+ {
+ address: '0x3d1ba9be9f66b8ee101911bc36d3fb562eac2244',
+ name: 'Rivetz',
+ symbol: 'RVT',
+ decimals: 18,
+ },
+ {
+ address: '0x6888a16ea9792c15a4dcf2f6c623d055c8ede792',
+ name: 'Spectiv Signal Token',
+ symbol: 'SIG',
+ decimals: 18,
+ },
+ {
+ address: '0x20f7a3ddf244dc9299975b4da1c39f8d5d75f05a',
+ name: 'Sapien Network Token',
+ symbol: 'SPN',
+ decimals: 6,
+ },
+ {
+ address: '0xbbff862d906e348e9946bfb2132ecb157da3d4b4',
+ name: 'Sharder',
+ symbol: 'SS',
+ decimals: 18,
+ },
+ {
+ address: '0x12b306fa98f4cbb8d4457fdff3a0a0a56f07ccdf',
+ name: 'Spectre.ai D-Token',
+ symbol: 'SXDT',
+ decimals: 18,
+ },
+ {
+ address: '0xff3519eeeea3e76f1f699ccce5e23ee0bdda41ac',
+ name: 'Blockchain Capital',
+ symbol: 'BCAP',
+ decimals: 0,
+ },
+ {
+ address: '0xced1a8529125d1bd06b54a7b01210df357d00885',
+ name: 'Too Real Badge',
+ symbol: 'TRL',
+ decimals: 0,
+ },
+ {
+ address: '0xc86d054809623432210c107af2e3f619dcfbf652',
+ name: 'SENTINEL PROTOCOL',
+ symbol: 'UPP',
+ decimals: 18,
+ },
+ {
+ address: '0x27f610bf36eca0939093343ac28b1534a721dbb4',
+ name: 'Wand Token',
+ symbol: 'WAND',
+ decimals: 18,
+ },
+ {
+ address: '0x056017c55ae7ae32d12aef7c679df83a85ca75ff',
+ name: 'WyvernToken',
+ symbol: 'WYV',
+ decimals: 18,
+ },
+ {
+ address: '0x5ca9a71b1d01849c0a95490cc00559717fcf0d1d',
+ name: 'Aeternity',
+ symbol: 'AE',
+ decimals: 18,
+ },
+ {
+ address: '0xbc86727e770de68b1060c91f6bb6945c73e10388',
+ name: 'Ink Protocol',
+ symbol: 'XNK',
+ decimals: 18,
+ },
+ {
+ address: '0x0f513ffb4926ff82d7f60a05069047aca295c413',
+ name: 'CrowdstartCoin',
+ symbol: 'XSC',
+ decimals: 18,
+ },
+ {
+ address: '0xb9e7f8568e08d5659f5d29c4997173d84cdf2607',
+ name: 'Swarm City Token',
+ symbol: 'SWT',
+ decimals: 18,
+ },
+ {
+ address: '0x6531f133e6deebe7f2dce5a0441aa7ef330b4e53',
+ name: 'Chronobank TIME',
+ symbol: 'TIME',
+ decimals: 8,
+ },
+ {
+ address: '0xf230b790e05390fc8295f4d3f60332c93bed42e2',
+ name: 'Tronix',
+ symbol: 'TRX',
+ decimals: 6,
+ },
+ {
+ address: '0x5c543e7ae0a1104f78406c340e9c64fd9fce5170',
+ name: 'vSlice',
+ symbol: 'VSL',
+ decimals: 0,
+ },
+ {
+ address: '0x4df812f6064def1e5e029f1ca858777cc98d2d81',
+ name: 'Xaurum',
+ symbol: 'XAUR',
+ decimals: 8,
+ },
+ ],
+ '42': [
+ {
+ address: '0x6ff6c0ff1d68b964901f986d4c9fa3ac68346570',
+ name: '0x Protocol Token',
+ symbol: 'ZRX',
+ decimals: 18,
+ },
+ {
+ address: '0x323b5d4c32345ced77393b3530b1eed0f346429d',
+ name: 'Melon Token',
+ symbol: 'MLN',
+ decimals: 18,
+ },
+ {
+ address: '0x1dad4783cf3fe3085c1426157ab175a6119a04ba',
+ name: 'Maker DAO',
+ symbol: 'MKR',
+ decimals: 18,
+ },
+ {
+ address: '0xeee3870657e4716670f185df08652dd848fe8f7e',
+ name: 'Digix DAO Token',
+ symbol: 'DGD',
+ decimals: 18,
+ },
+ {
+ address: '0xb18845c260f680d5b9d84649638813e342e4f8c9',
+ name: 'Augur Reputation Token',
+ symbol: 'REP',
+ decimals: 18,
+ },
+ {
+ address: '0xef7fff64389b814a946f3e92105513705ca6b990',
+ name: 'Golem Network Token',
+ symbol: 'GNT',
+ decimals: 18,
+ },
+ {
+ address: '0xd0a1e359811322d97991e03f863a0c30c2cf029c',
+ name: 'Wrapped Ether',
+ symbol: 'WETH',
+ decimals: 18,
+ },
+ ],
+ '3': [
+ {
+ address: '0xdf18648f5b4357d6cc1e27f7699af4f77ff44558',
+ name: 'token0',
+ symbol: 'TKN0',
+ decimals: 0,
+ },
+ {
+ address: '0xd7cdcde4302a60c4d74a11eee21fbf455f476021',
+ name: 'token1',
+ symbol: 'TKN1',
+ decimals: 1,
+ },
+ {
+ address: '0xf080f68c2113d40ff6a8528863f431908680900a',
+ name: 'token2',
+ symbol: 'TKN2',
+ decimals: 2,
+ },
+ {
+ address: '0xe982b5c62434c98e27d15fed40447dda6b75c4eb',
+ name: 'token3',
+ symbol: 'TKN3',
+ decimals: 3,
+ },
+ {
+ address: '0x2427d136751c1ca70480d3b2091261d639090a50',
+ name: 'token4',
+ symbol: 'TKN4',
+ decimals: 4,
+ },
+ {
+ address: '0x7d3eca8ec55bb32bd0056edb9485b07a53d3fbfd',
+ name: 'token5',
+ symbol: 'TKN5',
+ decimals: 5,
+ },
+ {
+ address: '0xff3c22e0a9014e9b4b1cf7a54bf39ab3107f6123',
+ name: 'token6',
+ symbol: 'TKN6',
+ decimals: 6,
+ },
+ {
+ address: '0xdec283d9e188397c841ab59d9d9160fd47bc56f8',
+ name: 'token7',
+ symbol: 'TKN7',
+ decimals: 7,
+ },
+ {
+ address: '0xedf5fd2f60d8fefbfa8011f2769b39657c54c3fd',
+ name: 'token8',
+ symbol: 'TKN8',
+ decimals: 8,
+ },
+ {
+ address: '0xcd59fe7fa1a1a0ff536966a599b631d9cd5f2914',
+ name: 'token9',
+ symbol: 'TKN9',
+ decimals: 9,
+ },
+ {
+ address: '0xaece1ee1813d56a5897f19ad50164565203b459f',
+ name: 'token10',
+ symbol: 'TKN10',
+ decimals: 10,
+ },
+ {
+ address: '0xaab3f0619e529b1f1823be291daa7fcd38a15927',
+ name: 'token11',
+ symbol: 'TKN11',
+ decimals: 11,
+ },
+ {
+ address: '0x2c46ad0b19cb1c1f3e51ae90d80654a227b08d30',
+ name: 'token12',
+ symbol: 'TKN12',
+ decimals: 12,
+ },
+ {
+ address: '0x68977f3286a503f2b3930506f1b3a17dafbd9524',
+ name: 'token13',
+ symbol: 'TKN13',
+ decimals: 13,
+ },
+ {
+ address: '0xe5c400b9ee56b823c6193a662041389624609db6',
+ name: 'token14',
+ symbol: 'TKN14',
+ decimals: 14,
+ },
+ {
+ address: '0xf16ea9b23ddbeb6b16d253edf6b595da4009bb8b',
+ name: 'token16',
+ symbol: 'TKN16',
+ decimals: 16,
+ },
+ {
+ address: '0x739a83860971e900c4bbbb92be6cfb9d459ef94a',
+ name: 'token15',
+ symbol: 'TKN15',
+ decimals: 15,
+ },
+ {
+ address: '0x5eba21470cf683fe91b594afe7106039e38f3312',
+ name: 'token17',
+ symbol: 'TKN17',
+ decimals: 17,
+ },
+ {
+ address: '0xc0ddd5df448907bb3f50350f3fe7a1da3fb2a2ee',
+ name: 'token18',
+ symbol: 'TKN18',
+ decimals: 18,
+ },
+ {
+ address: '0x30fa25e53f8031014166fbd5e4bbeac0cd25df74',
+ name: 'token19',
+ symbol: 'TKN19',
+ decimals: 19,
+ },
+ {
+ address: '0xa8e9fa8f91e5ae138c74648c9c304f1c75003a8d',
+ name: '0x Protocol Token',
+ symbol: 'ZRX',
+ decimals: 18,
+ },
+ {
+ address: '0xc778417e063141139fce010982780140aa0cd5ab',
+ name: 'Ether Token',
+ symbol: 'WETH',
+ decimals: 18,
+ },
+ {
+ address: '0x14823db576c11e4a54ca9e01ca0b28b18d3d1187',
+ name: 'b0x Protocol Token',
+ symbol: 'B0X',
+ decimals: 18,
+ },
+ ],
+}; // tslint:disable:max-file-line-count
diff --git a/packages/website/ts/utils/fetch_utils.ts b/packages/website/ts/utils/fetch_utils.ts
index e9a88b6b3..9afc5904d 100644
--- a/packages/website/ts/utils/fetch_utils.ts
+++ b/packages/website/ts/utils/fetch_utils.ts
@@ -1,4 +1,4 @@
-import { fetchAsync, logUtils } from '@0xproject/utils';
+import { fetchAsync, logUtils } from '@0x/utils';
import * as _ from 'lodash';
import * as queryString from 'query-string';
diff --git a/packages/website/ts/utils/mui_theme.ts b/packages/website/ts/utils/mui_theme.ts
index f677b4625..3f32254de 100644
--- a/packages/website/ts/utils/mui_theme.ts
+++ b/packages/website/ts/utils/mui_theme.ts
@@ -1,4 +1,4 @@
-import { colors } from '@0xproject/react-shared';
+import { colors } from '@0x/react-shared';
import { getMuiTheme } from 'material-ui/styles';
export const muiTheme = getMuiTheme({
diff --git a/packages/website/ts/utils/order_parser.ts b/packages/website/ts/utils/order_parser.ts
index 816200e3b..8938fbc53 100644
--- a/packages/website/ts/utils/order_parser.ts
+++ b/packages/website/ts/utils/order_parser.ts
@@ -1,5 +1,5 @@
-import { orderParsingUtils } from '@0xproject/order-utils';
-import { logUtils } from '@0xproject/utils';
+import { orderParsingUtils } from '@0x/order-utils';
+import { logUtils } from '@0x/utils';
import * as _ from 'lodash';
import { portalOrderSchema } from 'ts/schemas/portal_order_schema';
diff --git a/packages/website/ts/utils/token_address_overrides.ts b/packages/website/ts/utils/token_address_overrides.ts
index e7e916273..5e7275964 100644
--- a/packages/website/ts/utils/token_address_overrides.ts
+++ b/packages/website/ts/utils/token_address_overrides.ts
@@ -1,4 +1,4 @@
-import { ObjectMap } from '@0xproject/types';
+import { ObjectMap } from '@0x/types';
import { constants } from 'ts/utils/constants';
// Map of networkId -> tokenSymbol -> tokenAddress
diff --git a/packages/website/ts/utils/translate.ts b/packages/website/ts/utils/translate.ts
index 1ee1a59c5..af5c766a9 100644
--- a/packages/website/ts/utils/translate.ts
+++ b/packages/website/ts/utils/translate.ts
@@ -1,11 +1,11 @@
import * as _ from 'lodash';
import { Deco, Key, Language } from 'ts/types';
-import * as chinese from '../../translations/chinese.json';
-import * as english from '../../translations/english.json';
-import * as korean from '../../translations/korean.json';
-import * as russian from '../../translations/russian.json';
-import * as spanish from '../../translations/spanish.json';
+import chinese from '../../translations/chinese.json';
+import english from '../../translations/english.json';
+import korean from '../../translations/korean.json';
+import russian from '../../translations/russian.json';
+import spanish from '../../translations/spanish.json';
const languageToTranslations = {
[Language.English]: english,
@@ -80,7 +80,12 @@ export class Translate {
case Deco.CapWords:
const words = text.split(' ');
- const capitalizedWords = _.map(words, w => this._capitalize(w));
+ const capitalizedWords = _.map(words, (w: string, i: number) => {
+ if (w.length === 1) {
+ return w;
+ }
+ return this._capitalize(w);
+ });
text = capitalizedWords.join(' ');
break;
diff --git a/packages/website/ts/utils/utils.ts b/packages/website/ts/utils/utils.ts
index d083e0ffc..8cc0061de 100644
--- a/packages/website/ts/utils/utils.ts
+++ b/packages/website/ts/utils/utils.ts
@@ -1,11 +1,11 @@
-import { ContractWrappersError } from '@0xproject/contract-wrappers';
-import { assetDataUtils, OrderError } from '@0xproject/order-utils';
-import { constants as sharedConstants, Networks } from '@0xproject/react-shared';
-import { ExchangeContractErrs } from '@0xproject/types';
-import { BigNumber } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { ContractWrappersError } from '@0x/contract-wrappers';
+import { assetDataUtils, OrderError } from '@0x/order-utils';
+import { constants as sharedConstants, Networks } from '@0x/react-shared';
+import { ExchangeContractErrs } from '@0x/types';
+import { BigNumber } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import * as bowser from 'bowser';
-import deepEqual = require('deep-equal');
+import deepEqual from 'deep-equal';
import * as _ from 'lodash';
import * as moment from 'moment';
import * as numeral from 'numeral';
@@ -231,13 +231,6 @@ export const utils = {
},
zeroExErrToHumanReadableErrMsg(error: ContractWrappersError | ExchangeContractErrs, takerAddress: string): string {
const ContractWrappersErrorToHumanReadableError: { [error: string]: string } = {
- [ContractWrappersError.ExchangeContractDoesNotExist]: 'Exchange contract does not exist',
- [ContractWrappersError.EtherTokenContractDoesNotExist]: 'EtherToken contract does not exist',
- [ContractWrappersError.ERC20ProxyContractDoesNotExist]: 'ERC20 proxy contract des not exist',
- [ContractWrappersError.ERC721ProxyContractDoesNotExist]: 'ERC721 proxy contract des not exist',
- [ContractWrappersError.ERC20TokenContractDoesNotExist]: 'ERC20 token contract does not exist',
- [ContractWrappersError.ERC721TokenContractDoesNotExist]: 'ERC721 token contract does not exist',
- [ContractWrappersError.ZRXContractDoesNotExist]: 'ZRX contract does not exist',
[BlockchainCallErrs.UserHasNoAssociatedAddresses]: 'User has no addresses available',
[OrderError.InvalidSignature]: 'Order signature is not valid',
[ContractWrappersError.ContractNotDeployedOnNetwork]: 'Contract is not deployed on the detected network',
@@ -420,6 +413,10 @@ export const utils = {
return BrowserType.Firefox;
} else if (bowser.opera) {
return BrowserType.Opera;
+ } else if (bowser.msedge) {
+ return BrowserType.Edge;
+ } else if (bowser.safari) {
+ return BrowserType.Safari;
} else {
return BrowserType.Other;
}
diff --git a/packages/website/tsconfig.json b/packages/website/tsconfig.json
index 6421cd459..7d5f31b7f 100644
--- a/packages/website/tsconfig.json
+++ b/packages/website/tsconfig.json
@@ -16,7 +16,9 @@
"composite": false,
"paths": {
"*": ["node_modules/@types/*", "*"]
- }
+ },
+ "module": "esnext",
+ "moduleResolution": "node"
},
"include": ["./ts/**/*"]
}
diff --git a/packages/website/tslint.json b/packages/website/tslint.json
index b55ffe90f..50f5be4f6 100644
--- a/packages/website/tslint.json
+++ b/packages/website/tslint.json
@@ -1,5 +1,5 @@
{
- "extends": ["@0xproject/tslint-config"],
+ "extends": ["@0x/tslint-config"],
"rules": {
"no-implicit-dependencies": false,
"no-object-literal-type-assertion": false,
diff --git a/python-packages/order_utils/LICENSE b/python-packages/order_utils/LICENSE
new file mode 100644
index 000000000..9096fefaa
--- /dev/null
+++ b/python-packages/order_utils/LICENSE
@@ -0,0 +1,13 @@
+Copyright 2017 ZeroEx Inc.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License. \ No newline at end of file
diff --git a/python-packages/order_utils/README.md b/python-packages/order_utils/README.md
new file mode 100644
index 000000000..4c5f7627c
--- /dev/null
+++ b/python-packages/order_utils/README.md
@@ -0,0 +1,45 @@
+## 0x-order-utils
+
+0x order-related utilities for those developing on top of 0x protocol.
+
+Read the [documentation](https://0x.readthedocs.io/projects/order-utils/en/latest/)
+
+## Installing
+
+```bash
+pip install 0x-order-utils
+```
+
+## Contributing
+
+We welcome improvements and fixes from the wider community! To report bugs within this package, please create an issue in this repository.
+
+Please read our [contribution guidelines](../../CONTRIBUTING.md) before getting started.
+
+### Install Code and Dependencies
+
+Ensure that you have installed Python >=3.6 and Docker. Then:
+
+```bash
+pip install -e .[dev]
+```
+
+### Test
+
+Tests depend on a running ganache instance with the 0x contracts deployed in it. For convenience, a docker container is provided that has ganache-cli and a snapshot containing the necessary contracts. A shortcut is provided to run that docker container: `./setup.py ganache`. With that running, the tests can be run with `./setup.py test`.
+
+### Clean
+
+`./setup.py clean --all`
+
+### Lint
+
+`./setup.py lint`
+
+### Build Documentation
+
+`./setup.py build_sphinx`
+
+### More
+
+See `./setup.py --help-commands` for more info.
diff --git a/python-packages/order_utils/setup.py b/python-packages/order_utils/setup.py
index a76d724aa..1b07b612c 100644..100755
--- a/python-packages/order_utils/setup.py
+++ b/python-packages/order_utils/setup.py
@@ -1,13 +1,17 @@
+#!/usr/bin/env python
+
"""setuptools module for order_utils package."""
import subprocess # nosec
from shutil import rmtree
-from os import path, remove, walk
+from os import environ, path
+from pathlib import Path
+from sys import argv
-from distutils.command.clean import clean # type: ignore
-from setuptools import setup # type: ignore
-import setuptools.command.build_py # type: ignore
-from setuptools.command.test import test as TestCommand # type: ignore
+from distutils.command.clean import clean
+import distutils.command.build_py
+from setuptools import find_packages, setup
+from setuptools.command.test import test as TestCommand
class TestCommandExtension(TestCommand):
@@ -15,15 +19,17 @@ class TestCommandExtension(TestCommand):
def run_tests(self):
"""Invoke pytest."""
- import pytest # type: ignore
+ import pytest
- pytest.main()
+ exit(pytest.main())
# pylint: disable=too-many-ancestors
-class LintCommand(setuptools.command.build_py.build_py):
+class LintCommand(distutils.command.build_py.build_py):
"""Custom setuptools command class for running linters."""
+ description = "Run linters"
+
def run(self):
"""Run linter shell commands."""
lint_commands = [
@@ -34,7 +40,7 @@ class LintCommand(setuptools.command.build_py.build_py):
# docstring style checker:
"pydocstyle src test setup.py".split(),
# static type checker:
- "mypy src setup.py".split(),
+ "mypy src test setup.py".split(),
# security issue checker:
"bandit -r src ./setup.py".split(),
# general linter:
@@ -42,6 +48,28 @@ class LintCommand(setuptools.command.build_py.build_py):
# pylint takes relatively long to run, so it runs last, to enable
# fast failures.
]
+
+ # tell mypy where to find interface stubs for 3rd party libs
+ environ["MYPYPATH"] = path.join(
+ path.dirname(path.realpath(argv[0])), "stubs"
+ )
+
+ # HACK(gene): until eth_abi releases
+ # https://github.com/ethereum/eth-abi/pull/107 , we need to simply
+ # create an empty file `py.typed` in the eth_abi package directory.
+ import eth_abi
+
+ eth_abi_dir = path.dirname(path.realpath(eth_abi.__file__))
+ Path(path.join(eth_abi_dir, "py.typed")).touch()
+
+ # HACK(gene): until eth_utils fixes
+ # https://github.com/ethereum/eth-utils/issues/140 , we need to simply
+ # create an empty file `py.typed` in the eth_abi package directory.
+ import eth_utils
+
+ eth_utils_dir = path.dirname(path.realpath(eth_utils.__file__))
+ Path(path.join(eth_utils_dir, "py.typed")).touch()
+
for lint_command in lint_commands:
print(
"Running lint command `", " ".join(lint_command).strip(), "`"
@@ -55,31 +83,84 @@ class CleanCommandExtension(clean):
def run(self):
"""Run the regular clean, followed by our custom commands."""
super().run()
- rmtree("build", ignore_errors=True)
+ rmtree("dist", ignore_errors=True)
rmtree(".mypy_cache", ignore_errors=True)
rmtree(".tox", ignore_errors=True)
rmtree(".pytest_cache", ignore_errors=True)
- rmtree("src/order_utils.egg-info", ignore_errors=True)
- # delete all .pyc files
- for root, _, files in walk("."):
- for file in files:
- (_, extension) = path.splitext(file)
- if extension == ".pyc":
- remove(path.join(root, file))
+ rmtree("src/0x_order_utils.egg-info", ignore_errors=True)
+
+
+# pylint: disable=too-many-ancestors
+class TestPublishCommand(distutils.command.build_py.build_py):
+ """Custom command to publish to test.pypi.org."""
+
+ description = (
+ "Publish dist/* to test.pypi.org. Run sdist & bdist_wheel first."
+ )
+
+ def run(self):
+ """Run twine to upload to test.pypi.org."""
+ subprocess.check_call( # nosec
+ (
+ "twine upload --repository-url https://test.pypi.org/legacy/"
+ + " --verbose dist/*"
+ ).split()
+ )
+
+
+# pylint: disable=too-many-ancestors
+class PublishCommand(distutils.command.build_py.build_py):
+ """Custom command to publish to pypi.org."""
+
+ description = "Publish dist/* to pypi.org. Run sdist & bdist_wheel first."
+
+ def run(self):
+ """Run twine to upload to pypi.org."""
+ subprocess.check_call("twine upload dist/*".split()) # nosec
+
+
+# pylint: disable=too-many-ancestors
+class GanacheCommand(distutils.command.build_py.build_py):
+ """Custom command to publish to pypi.org."""
+
+ description = "Run ganache daemon to support tests."
+
+ def run(self):
+ """Run ganache."""
+ cmd_line = (
+ "docker run -d -p 8545:8545 0xorg/ganache-cli --gasLimit"
+ + " 10000000 --db /snapshot --noVMErrorsOnRPCResponse -p 8545"
+ + " --networkId 50 -m"
+ ).split()
+ cmd_line.append(
+ "concert load couple harbor equip island argue ramp clarify fence"
+ + " smart topic"
+ )
+ subprocess.call(cmd_line) # nosec
+
+
+with open("README.md", "r") as file_handle:
+ README_MD = file_handle.read()
setup(
- name="order_utils",
- version="1.0.0",
+ name="0x-order-utils",
+ version="0.1.0",
description="Order utilities for 0x applications",
+ long_description=README_MD,
+ long_description_content_type="text/markdown",
+ url="https://github.com/0xproject/0x-monorepo/python-packages/order_utils",
author="F. Eugene Aumson",
+ author_email="feuGeneA@users.noreply.github.com",
cmdclass={
"clean": CleanCommandExtension,
"lint": LintCommand,
"test": TestCommandExtension,
+ "test_publish": TestPublishCommand,
+ "publish": PublishCommand,
+ "ganache": GanacheCommand,
},
- include_package_data=True,
- install_requires=["web3"],
+ install_requires=["eth-abi", "eth_utils", "mypy_extensions", "web3"],
extras_require={
"dev": [
"bandit",
@@ -87,24 +168,30 @@ setup(
"coverage",
"coveralls",
"mypy",
+ "mypy_extensions",
"pycodestyle",
"pydocstyle",
"pylint",
"pytest",
"sphinx",
"tox",
+ "twine",
]
},
python_requires=">=3.6, <4",
- package_data={"zero_ex.order_utils": ["py.typed"]},
+ package_data={
+ "zero_ex.order_utils": ["py.typed"],
+ "zero_ex.contract_artifacts": ["artifacts/*"],
+ },
package_dir={"": "src"},
license="Apache 2.0",
keywords=(
"ethereum cryptocurrency 0x decentralized blockchain dex exchange"
),
- packages=["zero_ex.order_utils"],
+ namespace_packages=["zero_ex"],
+ packages=find_packages("src"),
classifiers=[
- "Development Status :: 1 - Planning",
+ "Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Developers",
"Intended Audience :: Financial and Insurance Industry",
"License :: OSI Approved :: Apache Software License",
@@ -114,11 +201,14 @@ setup(
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
+ "Topic :: Internet :: WWW/HTTP",
"Topic :: Office/Business :: Financial",
+ "Topic :: Other/Nonlisted Topic",
+ "Topic :: Security :: Cryptography",
"Topic :: Software Development :: Libraries",
"Topic :: Utilities",
],
- zip_safe=False,
+ zip_safe=False, # required per mypy
command_options={
"build_sphinx": {
"source_dir": ("setup.py", "src"),
diff --git a/python-packages/order_utils/src/conf.py b/python-packages/order_utils/src/conf.py
index f3f15967c..6b6776d01 100644
--- a/python-packages/order_utils/src/conf.py
+++ b/python-packages/order_utils/src/conf.py
@@ -2,14 +2,18 @@
# Reference: http://www.sphinx-doc.org/en/master/config
+from typing import List
+import pkg_resources
+
+
# pylint: disable=invalid-name
# because these variables are not named in upper case, as globals should be.
-project = "order_utils.py"
+project = "0x-order-utils"
# pylint: disable=redefined-builtin
copyright = "2018, ZeroEx, Intl."
author = "F. Eugene Aumson"
-version = "" # The short X.Y version
+version = pkg_resources.get_distribution("0x-order-utils").version
release = "" # The full version, including alpha/beta/rc tags
extensions = [
@@ -29,7 +33,7 @@ master_doc = "index" # The master toctree document.
language = None
-exclude_patterns = [] # type: ignore
+exclude_patterns: List[str] = []
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = None
diff --git a/packages/sra-report/coverage/.gitkeep b/python-packages/order_utils/src/doc_static/.gitkeep
index e69de29bb..e69de29bb 100644
--- a/packages/sra-report/coverage/.gitkeep
+++ b/python-packages/order_utils/src/doc_static/.gitkeep
diff --git a/python-packages/order_utils/src/zero_ex/py.typed b/python-packages/order_utils/src/doc_templates/.gitkeep
index e69de29bb..e69de29bb 100644
--- a/python-packages/order_utils/src/zero_ex/py.typed
+++ b/python-packages/order_utils/src/doc_templates/.gitkeep
diff --git a/python-packages/order_utils/src/index.rst b/python-packages/order_utils/src/index.rst
index cbc4c8409..b99addabd 100644
--- a/python-packages/order_utils/src/index.rst
+++ b/python-packages/order_utils/src/index.rst
@@ -1,7 +1,7 @@
.. source for the sphinx-generated build/docs/web/index.html
-order_utils.py
-==============
+Python zero_ex.order_utils
+==========================
.. toctree::
:maxdepth: 2
@@ -10,9 +10,17 @@ order_utils.py
.. automodule:: zero_ex.order_utils
:members:
-.. automodule:: zero_ex.order_utils.signature_utils
+.. automodule:: zero_ex.order_utils.asset_data_utils
:members:
+.. autoclass:: zero_ex.order_utils.asset_data_utils.ERC20AssetData
+
+.. autoclass:: zero_ex.order_utils.asset_data_utils.ERC721AssetData
+
+See source for class properties. Sphinx does not easily generate class property docs; pull requests welcome.
+
+.. automodule:: zero_ex.order_utils.signature_utils
+ :members:
Indices and tables
==================
diff --git a/python-packages/order_utils/src/zero_ex/__init__.py b/python-packages/order_utils/src/zero_ex/__init__.py
index c3ed1562a..e90d833db 100644
--- a/python-packages/order_utils/src/zero_ex/__init__.py
+++ b/python-packages/order_utils/src/zero_ex/__init__.py
@@ -1 +1,2 @@
"""0x Python API."""
+__import__("pkg_resources").declare_namespace(__name__)
diff --git a/python-packages/order_utils/src/zero_ex/contract_artifacts/__init__.py b/python-packages/order_utils/src/zero_ex/contract_artifacts/__init__.py
new file mode 100644
index 000000000..ed45d2c8e
--- /dev/null
+++ b/python-packages/order_utils/src/zero_ex/contract_artifacts/__init__.py
@@ -0,0 +1 @@
+"""Solc-generated artifacts for 0x smart contracts."""
diff --git a/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts b/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts
new file mode 120000
index 000000000..82d28ba87
--- /dev/null
+++ b/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts
@@ -0,0 +1 @@
+../../../../../packages/contract-artifacts/artifacts \ No newline at end of file
diff --git a/python-packages/order_utils/src/zero_ex/dev_utils/__init__.py b/python-packages/order_utils/src/zero_ex/dev_utils/__init__.py
new file mode 100644
index 000000000..b6a224d2c
--- /dev/null
+++ b/python-packages/order_utils/src/zero_ex/dev_utils/__init__.py
@@ -0,0 +1 @@
+"""Dev utils to be shared across 0x projects and packages."""
diff --git a/python-packages/order_utils/src/zero_ex/dev_utils/abi_utils.py b/python-packages/order_utils/src/zero_ex/dev_utils/abi_utils.py
new file mode 100644
index 000000000..71b6128ca
--- /dev/null
+++ b/python-packages/order_utils/src/zero_ex/dev_utils/abi_utils.py
@@ -0,0 +1,102 @@
+"""Ethereum ABI utilities.
+
+Builds on the eth-abi package, adding some convenience methods like those found
+in npmjs.com/package/ethereumjs-abi. Ideally, all of this code should be
+pushed upstream into eth-abi.
+"""
+
+import re
+from typing import Any, List
+
+from mypy_extensions import TypedDict
+
+from eth_abi import encode_abi
+from web3 import Web3
+
+from .type_assertions import assert_is_string, assert_is_list
+
+
+class MethodSignature(TypedDict, total=False):
+ """Object interface to an ABI method signature."""
+
+ method: str
+ args: List[str]
+
+
+def parse_signature(signature: str) -> MethodSignature:
+ """Parse a method signature into its constituent parts.
+
+ >>> parse_signature("ERC20Token(address)")
+ {'method': 'ERC20Token', 'args': ['address']}
+ """
+ assert_is_string(signature, "signature")
+
+ matches = re.match(r"^(\w+)\((.+)\)$", signature)
+ if matches is None:
+ raise ValueError(f"Invalid method signature {signature}")
+ return {"method": matches[1], "args": matches[2].split(",")}
+
+
+def elementary_name(name: str) -> str:
+ """Convert from short to canonical names; barely implemented.
+
+ Modeled after ethereumjs-abi's ABI.elementaryName(), but only implemented
+ to support our particular use case and a few other simple ones.
+
+ >>> elementary_name("address")
+ 'address'
+ >>> elementary_name("uint")
+ 'uint256'
+ """
+ assert_is_string(name, "name")
+
+ return {
+ "int": "int256",
+ "uint": "uint256",
+ "fixed": "fixed128x128",
+ "ufixed": "ufixed128x128",
+ }.get(name, name)
+
+
+def event_id(name: str, types: List[str]) -> str:
+ """Return the Keccak-256 hash of the given method.
+
+ >>> event_id("ERC20Token", ["address"])
+ '0xf47261b06eedbfce68afd46d0f3c27c60b03faad319eaf33103611cf8f6456ad'
+ """
+ assert_is_string(name, "name")
+ assert_is_list(types, "types")
+
+ signature = f"{name}({','.join(list(map(elementary_name, types)))})"
+ return Web3.sha3(text=signature).hex()
+
+
+def method_id(name: str, types: List[str]) -> str:
+ """Return the 4-byte method identifier.
+
+ >>> method_id("ERC20Token", ["address"])
+ '0xf47261b0'
+ """
+ assert_is_string(name, "name")
+ assert_is_list(types, "types")
+
+ return event_id(name, types)[0:10]
+
+
+def simple_encode(method: str, *args: Any) -> bytes:
+ # docstring considered all one line by pylint: disable=line-too-long
+ r"""Encode a method ABI.
+
+ >>> simple_encode("ERC20Token(address)", "0x1dc4c1cefef38a777b15aa20260a54e584b16c48")
+ b'\xf4ra\xb0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1d\xc4\xc1\xce\xfe\xf3\x8aw{\x15\xaa &\nT\xe5\x84\xb1lH'
+ """ # noqa: E501 (line too long)
+ assert_is_string(method, "method")
+
+ signature: MethodSignature = parse_signature(method)
+
+ return bytes.fromhex(
+ (
+ method_id(signature["method"], signature["args"])
+ + encode_abi(signature["args"], args).hex()
+ )[2:]
+ )
diff --git a/python-packages/order_utils/src/zero_ex/dev_utils/type_assertions.py b/python-packages/order_utils/src/zero_ex/dev_utils/type_assertions.py
new file mode 100644
index 000000000..08c1b0ea5
--- /dev/null
+++ b/python-packages/order_utils/src/zero_ex/dev_utils/type_assertions.py
@@ -0,0 +1,58 @@
+"""Assertions for runtime type checking of function arguments."""
+
+from typing import Any
+
+
+def assert_is_string(value: Any, name: str) -> None:
+ """If :param value: isn't of type str, raise a TypeError.
+
+ >>> try: assert_is_string(123, 'var')
+ ... except TypeError as type_error: print(str(type_error))
+ ...
+ expected variable 'var', with value 123, to have type 'str', not 'int'
+ """
+ if not isinstance(value, str):
+ raise TypeError(
+ f"expected variable '{name}', with value {str(value)}, to have"
+ + f" type 'str', not '{type(value).__name__}'"
+ )
+
+
+def assert_is_list(value: Any, name: str) -> None:
+ """If :param value: isn't of type list, raise a TypeError.
+
+ >>> try: assert_is_list(123, 'var')
+ ... except TypeError as type_error: print(str(type_error))
+ ...
+ expected variable 'var', with value 123, to have type 'list', not 'int'
+ """
+ if not isinstance(value, list):
+ raise TypeError(
+ f"expected variable '{name}', with value {str(value)}, to have"
+ + f" type 'list', not '{type(value).__name__}'"
+ )
+
+
+def assert_is_int(value: Any, name: str) -> None:
+ """If :param value: isn't of type int, raise a TypeError.
+
+ >>> try: assert_is_int('asdf', 'var')
+ ... except TypeError as type_error: print(str(type_error))
+ ...
+ expected variable 'var', with value asdf, to have type 'int', not 'str'
+ """
+ if not isinstance(value, int):
+ raise TypeError(
+ f"expected variable '{name}', with value {str(value)}, to have"
+ + f" type 'int', not '{type(value).__name__}'"
+ )
+
+
+def assert_is_hex_string(value: Any, name: str) -> None:
+ """Assert that :param value: is a string of hex chars.
+
+ If :param value: isn't a str, raise a TypeError. If it is a string but
+ contains non-hex characters ("0x" prefix permitted), raise a ValueError.
+ """
+ assert_is_string(value, name)
+ int(value, 16) # raises a ValueError if value isn't a base-16 str
diff --git a/python-packages/order_utils/src/zero_ex/order_utils/__init__.py b/python-packages/order_utils/src/zero_ex/order_utils/__init__.py
index f014af0f6..80445cb6e 100644
--- a/python-packages/order_utils/src/zero_ex/order_utils/__init__.py
+++ b/python-packages/order_utils/src/zero_ex/order_utils/__init__.py
@@ -1 +1,11 @@
-"""Order utilities for 0x applications."""
+"""Order utilities for 0x applications.
+
+Some methods require the caller to pass in a `Web3.HTTPProvider` object. For
+local testing one may construct such a provider pointing at an instance of
+`ganache-cli <https://www.npmjs.com/package/ganache-cli>`_ which has the 0x
+contracts deployed on it. For convenience, a docker container is provided for
+just this purpose. To start it: ``docker run -d -p 8545:8545 0xorg/ganache-cli
+--gasLimit 10000000 --db /snapshot --noVMErrorsOnRPCResponse -p 8545
+--networkId 50 -m "concert load couple harbor equip island argue ramp clarify
+fence smart topic"``.
+"""
diff --git a/python-packages/order_utils/src/zero_ex/order_utils/asset_data_utils.py b/python-packages/order_utils/src/zero_ex/order_utils/asset_data_utils.py
new file mode 100644
index 000000000..e6f9a07c1
--- /dev/null
+++ b/python-packages/order_utils/src/zero_ex/order_utils/asset_data_utils.py
@@ -0,0 +1,143 @@
+"""Asset data encoding and decoding utilities."""
+
+from mypy_extensions import TypedDict
+
+import eth_abi
+
+from zero_ex.dev_utils import abi_utils
+from zero_ex.dev_utils.type_assertions import assert_is_string, assert_is_int
+
+
+ERC20_ASSET_DATA_BYTE_LENGTH = 36
+ERC721_ASSET_DATA_MINIMUM_BYTE_LENGTH = 53
+SELECTOR_LENGTH = 10
+
+
+class ERC20AssetData(TypedDict):
+ """Object interface to ERC20 asset data."""
+
+ asset_proxy_id: str
+ token_address: str
+
+
+class ERC721AssetData(TypedDict):
+ """Object interface to ERC721 asset data."""
+
+ asset_proxy_id: str
+ token_address: str
+ token_id: int
+
+
+def encode_erc20_asset_data(token_address: str) -> str:
+ """Encode an ERC20 token address into an asset data string.
+
+ :param token_address: the ERC20 token's contract address.
+ :rtype: hex encoded asset data string, usable in the makerAssetData or
+ takerAssetData fields in a 0x order.
+
+ >>> encode_erc20_asset_data('0x1dc4c1cefef38a777b15aa20260a54e584b16c48')
+ '0xf47261b00000000000000000000000001dc4c1cefef38a777b15aa20260a54e584b16c48'
+ """
+ assert_is_string(token_address, "token_address")
+
+ return (
+ "0x"
+ + abi_utils.simple_encode("ERC20Token(address)", token_address).hex()
+ )
+
+
+def decode_erc20_asset_data(asset_data: str) -> ERC20AssetData:
+ # docstring considered all one line by pylint: disable=line-too-long
+ """Decode an ERC20 asset data hex string.
+
+ :param asset_data: String produced by prior call to encode_erc20_asset_data()
+
+ >>> decode_erc20_asset_data("0xf47261b00000000000000000000000001dc4c1cefef38a777b15aa20260a54e584b16c48")
+ {'asset_proxy_id': '0xf47261b0', 'token_address': '0x1dc4c1cefef38a777b15aa20260a54e584b16c48'}
+ """ # noqa: E501 (line too long)
+ assert_is_string(asset_data, "asset_data")
+
+ if len(asset_data) < ERC20_ASSET_DATA_BYTE_LENGTH:
+ raise ValueError(
+ "Could not decode ERC20 Proxy Data. Expected length of encoded"
+ + f" data to be at least {str(ERC20_ASSET_DATA_BYTE_LENGTH)}."
+ + f" Got {str(len(asset_data))}."
+ )
+
+ asset_proxy_id: str = asset_data[0:SELECTOR_LENGTH]
+ if asset_proxy_id != abi_utils.method_id("ERC20Token", ["address"]):
+ raise ValueError(
+ "Could not decode ERC20 Proxy Data. Expected Asset Proxy Id to be"
+ + f" ERC20 ({abi_utils.method_id('ERC20Token', ['address'])})"
+ + f" but got {asset_proxy_id}."
+ )
+
+ # workaround for https://github.com/PyCQA/pylint/issues/1498
+ # pylint: disable=unsubscriptable-object
+ token_address = eth_abi.decode_abi(
+ ["address"], bytes.fromhex(asset_data[SELECTOR_LENGTH:])
+ )[0]
+
+ return {"asset_proxy_id": asset_proxy_id, "token_address": token_address}
+
+
+def encode_erc721_asset_data(token_address: str, token_id: int) -> str:
+ # docstring considered all one line by pylint: disable=line-too-long
+ """Encode an ERC721 asset data hex string.
+
+ :param token_address: the ERC721 token's contract address.
+ :param token_id: the identifier of the asset's instance of the token.
+ :rtype: hex encoded asset data string, usable in the makerAssetData or
+ takerAssetData fields in a 0x order.
+
+ >>> encode_erc721_asset_data('0x1dc4c1cefef38a777b15aa20260a54e584b16c48', 1)
+ '0x025717920000000000000000000000001dc4c1cefef38a777b15aa20260a54e584b16c480000000000000000000000000000000000000000000000000000000000000001'
+ """ # noqa: E501 (line too long)
+ assert_is_string(token_address, "token_address")
+ assert_is_int(token_id, "token_id")
+
+ return (
+ "0x"
+ + abi_utils.simple_encode(
+ "ERC721Token(address,uint256)", token_address, token_id
+ ).hex()
+ )
+
+
+def decode_erc721_asset_data(asset_data: str) -> ERC721AssetData:
+ # docstring considered all one line by pylint: disable=line-too-long
+ """Decode an ERC721 asset data hex string.
+
+ >>> decode_erc721_asset_data('0x025717920000000000000000000000001dc4c1cefef38a777b15aa20260a54e584b16c480000000000000000000000000000000000000000000000000000000000000001')
+ {'asset_proxy_id': '0x02571792', 'token_address': '0x1dc4c1cefef38a777b15aa20260a54e584b16c48', 'token_id': 1}
+ """ # noqa: E501 (line too long)
+ assert_is_string(asset_data, "asset_data")
+
+ if len(asset_data) < ERC721_ASSET_DATA_MINIMUM_BYTE_LENGTH:
+ raise ValueError(
+ "Could not decode ERC721 Asset Data. Expected length of encoded"
+ + f"data to be at least {ERC721_ASSET_DATA_MINIMUM_BYTE_LENGTH}. "
+ + f"Got {len(asset_data)}."
+ )
+
+ asset_proxy_id: str = asset_data[0:SELECTOR_LENGTH]
+ # prefer `black` formatting. pylint: disable=C0330
+ if asset_proxy_id != abi_utils.method_id(
+ "ERC721Token", ["address", "uint256"]
+ ):
+ raise ValueError(
+ "Could not decode ERC721 Asset Data. Expected Asset Proxy Id to be"
+ + f" ERC721 ("
+ + f"{abi_utils.method_id('ERC721Token', ['address', 'uint256'])}"
+ + f"), but got {asset_proxy_id}"
+ )
+
+ (token_address, token_id) = eth_abi.decode_abi(
+ ["address", "uint256"], bytes.fromhex(asset_data[SELECTOR_LENGTH:])
+ )
+
+ return {
+ "asset_proxy_id": asset_proxy_id,
+ "token_address": token_address,
+ "token_id": token_id,
+ }
diff --git a/python-packages/order_utils/src/zero_ex/order_utils/py.typed b/python-packages/order_utils/src/zero_ex/order_utils/py.typed
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/python-packages/order_utils/src/zero_ex/order_utils/py.typed
diff --git a/python-packages/order_utils/src/zero_ex/order_utils/signature_utils.py b/python-packages/order_utils/src/zero_ex/order_utils/signature_utils.py
index 7f4697106..12525ba88 100644
--- a/python-packages/order_utils/src/zero_ex/order_utils/signature_utils.py
+++ b/python-packages/order_utils/src/zero_ex/order_utils/signature_utils.py
@@ -1,13 +1,88 @@
"""Signature utilities."""
+from typing import Dict, Tuple
+import json
+from pkg_resources import resource_string
-def ec_sign_order_hash():
- """Signs an orderHash.
+from eth_utils import is_address, to_checksum_address
+from web3 import Web3
+import web3.exceptions
+from web3.utils import datatypes
- Returns its elliptic curve signature and signature type. This method
- currently supports TestRPC, Geth, and Parity above and below v1.6.6.
+from zero_ex.dev_utils.type_assertions import assert_is_hex_string
- >>> ec_sign_order_hash()
- 'stub return value'
- """
- return "stub return value"
+
+# prefer `black` formatting. pylint: disable=C0330
+EXCHANGE_ABI = json.loads(
+ resource_string("zero_ex.contract_artifacts", "artifacts/Exchange.json")
+)["compilerOutput"]["abi"]
+
+network_to_exchange_addr: Dict[str, str] = {
+ "1": "0x4f833a24e1f95d70f028921e27040ca56e09ab0b",
+ "3": "0x4530c0483a1633c7a1c97d2c53721caff2caaaaf",
+ "42": "0x35dd2932454449b14cee11a94d3674a936d5d7b2",
+ "50": "0x48bacb9266a570d521063ef5dd96e61686dbe788",
+}
+
+
+# prefer `black` formatting. pylint: disable=C0330
+def is_valid_signature(
+ provider: Web3.HTTPProvider, data: str, signature: str, signer_address: str
+) -> Tuple[bool, str]:
+ # docstring considered all one line by pylint: disable=line-too-long
+ """Check the validity of the supplied signature.
+
+ Check if the supplied ``signature`` corresponds to signing ``data`` with
+ the private key corresponding to ``signer_address``.
+
+ :param provider: A Web3 provider able to access the 0x Exchange contract.
+ :param data: The hex encoded data signed by the supplied signature.
+ :param signature: The hex encoded signature.
+ :param signer_address: The hex encoded address that signed the data to
+ produce the supplied signature.
+ :rtype: Boolean indicating whether the given signature is valid.
+
+ >>> is_valid_signature(
+ ... Web3.HTTPProvider("http://127.0.0.1:8545"),
+ ... '0x6927e990021d23b1eb7b8789f6a6feaf98fe104bb0cf8259421b79f9a34222b0',
+ ... '0x1B61a3ed31b43c8780e905a260a35faefcc527be7516aa11c0256729b5b351bc3340349190569279751135161d22529dc25add4f6069af05be04cacbda2ace225403',
+ ... '0x5409ed021d9299bf6814279a6a1411a7e866a631',
+ ... )
+ (True, '')
+ """ # noqa: E501 (line too long)
+ # TODO: make this provider check more flexible. pylint: disable=fixme
+ # https://app.asana.com/0/684263176955174/901300863045491/f
+ if not isinstance(provider, Web3.HTTPProvider):
+ raise TypeError("provider is not a Web3.HTTPProvider")
+ assert_is_hex_string(data, "data")
+ assert_is_hex_string(signature, "signature")
+ assert_is_hex_string(signer_address, "signer_address")
+ if not is_address(signer_address):
+ raise ValueError("signer_address is not a valid address")
+
+ web3_instance = Web3(provider)
+ # false positive from pylint: disable=no-member
+ network_id = web3_instance.net.version
+ contract_address = network_to_exchange_addr[network_id]
+ # false positive from pylint: disable=no-member
+ contract: datatypes.Contract = web3_instance.eth.contract(
+ address=to_checksum_address(contract_address), abi=EXCHANGE_ABI
+ )
+ try:
+ return (
+ contract.call().isValidSignature(
+ data, to_checksum_address(signer_address), signature
+ ),
+ "",
+ )
+ except web3.exceptions.BadFunctionCallOutput as exception:
+ known_revert_reasons = [
+ "LENGTH_GREATER_THAN_0_REQUIRED",
+ "SIGNATURE_UNSUPPORTED",
+ "LENGTH_0_REQUIRED",
+ "LENGTH_65_REQUIRED",
+ ]
+ for known_revert_reason in known_revert_reasons:
+ if known_revert_reason in str(exception):
+ return (False, known_revert_reason)
+ return (False, f"Unknown: {exception}")
diff --git a/python-packages/order_utils/stubs/distutils/__init__.pyi b/python-packages/order_utils/stubs/distutils/__init__.pyi
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/python-packages/order_utils/stubs/distutils/__init__.pyi
diff --git a/python-packages/order_utils/stubs/distutils/command/__init__.pyi b/python-packages/order_utils/stubs/distutils/command/__init__.pyi
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/python-packages/order_utils/stubs/distutils/command/__init__.pyi
diff --git a/python-packages/order_utils/stubs/distutils/command/clean.pyi b/python-packages/order_utils/stubs/distutils/command/clean.pyi
new file mode 100644
index 000000000..46a42ddb1
--- /dev/null
+++ b/python-packages/order_utils/stubs/distutils/command/clean.pyi
@@ -0,0 +1,7 @@
+from distutils.core import Command
+
+class clean(Command):
+ def initialize_options(self: clean) -> None: ...
+ def finalize_options(self: clean) -> None: ...
+ def run(self: clean) -> None: ...
+ ...
diff --git a/python-packages/order_utils/stubs/pytest/__init__.pyi b/python-packages/order_utils/stubs/pytest/__init__.pyi
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/python-packages/order_utils/stubs/pytest/__init__.pyi
diff --git a/python-packages/order_utils/stubs/pytest/raises.pyi b/python-packages/order_utils/stubs/pytest/raises.pyi
new file mode 100644
index 000000000..2e3b29f3d
--- /dev/null
+++ b/python-packages/order_utils/stubs/pytest/raises.pyi
@@ -0,0 +1 @@
+def raises(exception: Exception) -> ExceptionInfo: ...
diff --git a/python-packages/order_utils/stubs/setuptools/__init__.pyi b/python-packages/order_utils/stubs/setuptools/__init__.pyi
new file mode 100644
index 000000000..8ea8d32b7
--- /dev/null
+++ b/python-packages/order_utils/stubs/setuptools/__init__.pyi
@@ -0,0 +1,8 @@
+from distutils.dist import Distribution
+from typing import Any, List
+
+def setup(**attrs: Any) -> Distribution: ...
+
+class Command: ...
+
+def find_packages(where: str) -> List[str]: ...
diff --git a/python-packages/order_utils/stubs/setuptools/command/__init__.pyi b/python-packages/order_utils/stubs/setuptools/command/__init__.pyi
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/python-packages/order_utils/stubs/setuptools/command/__init__.pyi
diff --git a/python-packages/order_utils/stubs/setuptools/command/test.pyi b/python-packages/order_utils/stubs/setuptools/command/test.pyi
new file mode 100644
index 000000000..c5ec770ad
--- /dev/null
+++ b/python-packages/order_utils/stubs/setuptools/command/test.pyi
@@ -0,0 +1,3 @@
+from setuptools import Command
+
+class test(Command): ...
diff --git a/python-packages/order_utils/stubs/web3/__init__.pyi b/python-packages/order_utils/stubs/web3/__init__.pyi
new file mode 100644
index 000000000..fcecc7434
--- /dev/null
+++ b/python-packages/order_utils/stubs/web3/__init__.pyi
@@ -0,0 +1,26 @@
+from typing import Dict, Optional, Union
+
+from web3.utils import datatypes
+
+
+class Web3:
+ class HTTPProvider: ...
+
+ def __init__(self, provider: HTTPProvider) -> None: ...
+
+ @staticmethod
+ def sha3(
+ primitive: Optional[Union[bytes, int, None]] = None,
+ text: Optional[str] = None,
+ hexstr: Optional[str] = None
+ ) -> bytes: ...
+
+ class net:
+ version: str
+ ...
+
+ class eth:
+ @staticmethod
+ def contract(address: str, abi: Dict) -> datatypes.Contract: ...
+ ...
+ ...
diff --git a/python-packages/order_utils/stubs/web3/exceptions.pyi b/python-packages/order_utils/stubs/web3/exceptions.pyi
new file mode 100644
index 000000000..83abf973d
--- /dev/null
+++ b/python-packages/order_utils/stubs/web3/exceptions.pyi
@@ -0,0 +1,2 @@
+class BadFunctionCallOutput(Exception):
+ ...
diff --git a/python-packages/order_utils/stubs/web3/utils/__init__.pyi b/python-packages/order_utils/stubs/web3/utils/__init__.pyi
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/python-packages/order_utils/stubs/web3/utils/__init__.pyi
diff --git a/python-packages/order_utils/stubs/web3/utils/datatypes.pyi b/python-packages/order_utils/stubs/web3/utils/datatypes.pyi
new file mode 100644
index 000000000..70baff372
--- /dev/null
+++ b/python-packages/order_utils/stubs/web3/utils/datatypes.pyi
@@ -0,0 +1,3 @@
+class Contract:
+ def call(self): ...
+ ...
diff --git a/python-packages/order_utils/test/test_abi_utils.py b/python-packages/order_utils/test/test_abi_utils.py
new file mode 100644
index 000000000..49a2a4f20
--- /dev/null
+++ b/python-packages/order_utils/test/test_abi_utils.py
@@ -0,0 +1,53 @@
+"""Tests of 0x.abi_utils."""
+
+import pytest
+
+from zero_ex.dev_utils.abi_utils import (
+ elementary_name,
+ event_id,
+ method_id,
+ parse_signature,
+ simple_encode,
+)
+
+
+def test_parse_signature_type_error():
+ """Test that passing in wrong types raises TypeError."""
+ with pytest.raises(TypeError):
+ parse_signature(123)
+
+
+def test_parse_signature_bad_input():
+ """Test that passing a non-signature string raises a ValueError."""
+ with pytest.raises(ValueError):
+ parse_signature("a string that's not even close to a signature")
+
+
+def test_elementary_name_type_error():
+ """Test that passing in wrong types raises TypeError."""
+ with pytest.raises(TypeError):
+ elementary_name(123)
+
+
+def test_event_id_type_error():
+ """Test that passing in wrong types raises TypeError."""
+ with pytest.raises(TypeError):
+ event_id(123, [])
+
+ with pytest.raises(TypeError):
+ event_id("valid string", 123)
+
+
+def test_method_id_type_error():
+ """Test that passing in wrong types raises TypeError."""
+ with pytest.raises(TypeError):
+ method_id(123, [])
+
+ with pytest.raises(TypeError):
+ method_id("ERC20Token", 123)
+
+
+def test_simple_encode_type_error():
+ """Test that passing in wrong types raises TypeError."""
+ with pytest.raises(TypeError):
+ simple_encode(123)
diff --git a/python-packages/order_utils/test/test_asset_data_utils.py b/python-packages/order_utils/test/test_asset_data_utils.py
new file mode 100644
index 000000000..079368714
--- /dev/null
+++ b/python-packages/order_utils/test/test_asset_data_utils.py
@@ -0,0 +1,72 @@
+"""Tests of 0x.order_utils.asset_data_utils."""
+
+import pytest
+
+from zero_ex.order_utils.asset_data_utils import (
+ decode_erc20_asset_data,
+ decode_erc721_asset_data,
+ encode_erc20_asset_data,
+ encode_erc721_asset_data,
+ ERC20_ASSET_DATA_BYTE_LENGTH,
+ ERC721_ASSET_DATA_MINIMUM_BYTE_LENGTH,
+)
+
+
+def test_encode_erc20_asset_data_type_error():
+ """Test that passing in a non-string raises a TypeError."""
+ with pytest.raises(TypeError):
+ encode_erc20_asset_data(123)
+
+
+def test_decode_erc20_asset_data_type_error():
+ """Test that passing in a non-string raises a TypeError."""
+ with pytest.raises(TypeError):
+ decode_erc20_asset_data(123)
+
+
+def test_decode_erc20_asset_data_too_short():
+ """Test that passing an insufficiently long string raises a ValueError."""
+ with pytest.raises(ValueError):
+ decode_erc20_asset_data(" " * (ERC20_ASSET_DATA_BYTE_LENGTH - 1))
+
+
+def test_decode_erc20_asset_data_invalid_proxy_id():
+ """Test that passing data with an invalid proxy ID raises a ValueError."""
+ with pytest.raises(ValueError):
+ decode_erc20_asset_data(
+ "0xffffffff" + (" " * ERC20_ASSET_DATA_BYTE_LENGTH)
+ )
+
+
+def test_encode_erc721_asset_data_type_error_on_token_address():
+ """Test that passing a non-string for token_address raises a TypeError."""
+ with pytest.raises(TypeError):
+ encode_erc721_asset_data(123, 123)
+
+
+def test_encode_erc721_asset_data_type_error_on_token_id():
+ """Test that passing a non-int for token_id raises a TypeError."""
+ with pytest.raises(TypeError):
+ encode_erc721_asset_data("asdf", "asdf")
+
+
+def test_decode_erc721_asset_data_type_error():
+ """Test that passing a non-string for asset_data raises a TypeError."""
+ with pytest.raises(TypeError):
+ decode_erc721_asset_data(123)
+
+
+def test_decode_erc721_asset_data_with_asset_data_too_short():
+ """Test that passing in too short of a string raises a ValueError."""
+ with pytest.raises(ValueError):
+ decode_erc721_asset_data(
+ " " * (ERC721_ASSET_DATA_MINIMUM_BYTE_LENGTH - 1)
+ )
+
+
+def test_decode_erc721_asset_data_invalid_proxy_id():
+ """Test that passing in too short of a string raises a ValueError."""
+ with pytest.raises(ValueError):
+ decode_erc721_asset_data(
+ "0xffffffff" + " " * (ERC721_ASSET_DATA_MINIMUM_BYTE_LENGTH - 1)
+ )
diff --git a/python-packages/order_utils/test/test_doctest.py b/python-packages/order_utils/test/test_doctest.py
index a0e61f84a..2b0350ac0 100644
--- a/python-packages/order_utils/test/test_doctest.py
+++ b/python-packages/order_utils/test/test_doctest.py
@@ -1,10 +1,18 @@
-"""Exercise doctests for order_utils module."""
+"""Exercise doctests for all of our modules."""
from doctest import testmod
-from zero_ex.order_utils import signature_utils
+import pkgutil
+import zero_ex
-def test_doctest():
- """Invoke doctest on the module."""
- (failure_count, _) = testmod(signature_utils)
- assert failure_count == 0
+
+def test_all_doctests():
+ """Gather zero_ex.* modules and doctest them."""
+ # prefer `black` formatting. pylint: disable=bad-continuation
+ for (importer, modname, _) in pkgutil.walk_packages(
+ path=zero_ex.__path__, prefix="zero_ex."
+ ):
+ module = importer.find_module(modname).load_module(modname)
+ print(module)
+ (failure_count, _) = testmod(module)
+ assert failure_count == 0
diff --git a/python-packages/order_utils/test/test_signature_utils.py b/python-packages/order_utils/test/test_signature_utils.py
index 7e830f9f8..b688e03a1 100644
--- a/python-packages/order_utils/test/test_signature_utils.py
+++ b/python-packages/order_utils/test/test_signature_utils.py
@@ -1,8 +1,128 @@
-"""Tests of 0x.order_utils.signature_utils.*."""
+"""Tests of zero_ex.order_utils.signature_utils."""
-from zero_ex.order_utils.signature_utils import ec_sign_order_hash
+import pytest
+from web3 import Web3
+from zero_ex.order_utils.signature_utils import is_valid_signature
-def test_ec_sign_order_hash():
- """Test the signing of order hashes."""
- assert ec_sign_order_hash() == "stub return value"
+
+def test_is_valid_signature__provider_wrong_type():
+ """Test that giving a non-HTTPProvider raises a TypeError."""
+ with pytest.raises(TypeError):
+ is_valid_signature(
+ 123,
+ "0x6927e990021d23b1eb7b8789f6a6feaf98fe104bb0cf8259421b79f9a34222b"
+ + "0",
+ "0x1B61a3ed31b43c8780e905a260a35faefcc527be7516aa11c0256729b5b351b"
+ + "c3340349190569279751135161d22529dc25add4f6069af05be04cacbda2ace"
+ + "225403",
+ "0x5409ed021d9299bf6814279a6a1411a7e866a631",
+ )
+
+
+def test_is_valid_signature__data_not_string():
+ """Test that giving non-string `data` raises a TypeError."""
+ with pytest.raises(TypeError):
+ is_valid_signature(
+ Web3.HTTPProvider("http://127.0.0.1:8545"),
+ 123,
+ "0x1B61a3ed31b43c8780e905a260a35faefcc527be7516aa11c0256729b5b351b"
+ + "c3340349190569279751135161d22529dc25add4f6069af05be04cacbda2ace"
+ + "225403",
+ "0x5409ed021d9299bf6814279a6a1411a7e866a631",
+ )
+
+
+def test_is_valid_signature__data_not_hex_string():
+ """Test that giving non-hex-string `data` raises a ValueError."""
+ with pytest.raises(ValueError):
+ is_valid_signature(
+ Web3.HTTPProvider("http://127.0.0.1:8545"),
+ "jjj",
+ "0x1B61a3ed31b43c8780e905a260a35faefcc527be7516aa11c0256729b5b351b"
+ + "c3340349190569279751135161d22529dc25add4f6069af05be04cacbda2ace"
+ + "225403",
+ "0x5409ed021d9299bf6814279a6a1411a7e866a631",
+ )
+
+
+def test_is_valid_signature__signature_not_string():
+ """Test that passng a non-string signature raises a TypeError."""
+ with pytest.raises(TypeError):
+ is_valid_signature(
+ Web3.HTTPProvider("http://127.0.0.1:8545"),
+ "0x6927e990021d23b1eb7b8789f6a6feaf98fe104bb0cf8259421b79f9a34222b"
+ + "0",
+ 123,
+ "0x5409ed021d9299bf6814279a6a1411a7e866a631",
+ )
+
+
+def test_is_valid_signature__signature_not_hex_string():
+ """Test that passing a non-hex-string signature raises a ValueError."""
+ with pytest.raises(ValueError):
+ is_valid_signature(
+ Web3.HTTPProvider("http://127.0.0.1:8545"),
+ "0x6927e990021d23b1eb7b8789f6a6feaf98fe104bb0cf8259421b79f9a34222b"
+ + "0",
+ "jjj",
+ "0x5409ed021d9299bf6814279a6a1411a7e866a631",
+ )
+
+
+def test_is_valid_signature__signer_address_not_string():
+ """Test that giving a non-address `signer_address` raises a ValueError."""
+ with pytest.raises(TypeError):
+ is_valid_signature(
+ Web3.HTTPProvider("http://127.0.0.1:8545"),
+ "0x6927e990021d23b1eb7b8789f6a6feaf98fe104bb0cf8259421b79f9a34222b"
+ + "0",
+ "0x1B61a3ed31b43c8780e905a260a35faefcc527be7516aa11c0256729b5b351b"
+ + "c3340349190569279751135161d22529dc25add4f6069af05be04cacbda2ace"
+ + "225403",
+ 123,
+ )
+
+
+def test_is_valid_signature__signer_address_not_hex_string():
+ """Test that giving a non-hex-str `signer_address` raises a ValueError."""
+ with pytest.raises(ValueError):
+ is_valid_signature(
+ Web3.HTTPProvider("http://127.0.0.1:8545"),
+ "0x6927e990021d23b1eb7b8789f6a6feaf98fe104bb0cf8259421b79f9a34222b"
+ + "0",
+ "0x1B61a3ed31b43c8780e905a260a35faefcc527be7516aa11c0256729b5b351b"
+ + "c3340349190569279751135161d22529dc25add4f6069af05be04cacbda2ace"
+ + "225403",
+ "jjj",
+ )
+
+
+def test_is_valid_signature__signer_address_not_valid_address():
+ """Test that giving a non-address for `signer_address` raises an error."""
+ with pytest.raises(ValueError):
+ is_valid_signature(
+ Web3.HTTPProvider("http://127.0.0.1:8545"),
+ "0x6927e990021d23b1eb7b8789f6a6feaf98fe104bb0cf8259421b79f9a34222b"
+ + "0",
+ "0x1B61a3ed31b43c8780e905a260a35faefcc527be7516aa11c0256729b5b351b"
+ + "c3340349190569279751135161d22529dc25add4f6069af05be04cacbda2ace"
+ + "225403",
+ "0xff",
+ )
+
+
+def test_is_valid_signature__unsupported_sig_types():
+ """Test that passing in a sig w/invalid type raises error.
+
+ To induce this error, the last byte of the signature is tweaked from 03 to
+ ff."""
+ (is_valid, reason) = is_valid_signature(
+ Web3.HTTPProvider("http://127.0.0.1:8545"),
+ "0x6927e990021d23b1eb7b8789f6a6feaf98fe104bb0cf8259421b79f9a34222b0",
+ "0x1B61a3ed31b43c8780e905a260a35faefcc527be7516aa11c0256729b5b351bc334"
+ + "0349190569279751135161d22529dc25add4f6069af05be04cacbda2ace2254ff",
+ "0x5409ed021d9299bf6814279a6a1411a7e866a631",
+ )
+ assert is_valid is False
+ assert reason == "SIGNATURE_UNSUPPORTED"
diff --git a/python-packages/order_utils/tox.ini b/python-packages/order_utils/tox.ini
index 1cce32b5f..ba7d55b56 100644
--- a/python-packages/order_utils/tox.ini
+++ b/python-packages/order_utils/tox.ini
@@ -10,3 +10,16 @@ envlist = py37
commands =
pip install -e .[dev]
python setup.py test
+
+[testenv:run_tests_against_test_deployment]
+commands =
+ # install dependencies from real PyPI
+ pip install eth-abi mypy_extensions web3 pytest
+ # install package-under-test from test PyPI
+ pip install --index-url https://test.pypi.org/legacy/ 0x-order-utils
+ pytest test
+
+[testenv:run_tests_against_deployment]
+commands =
+ pip install 0x-order-utils
+ pytest test
diff --git a/readthedocs.yaml b/readthedocs.yaml
new file mode 100644
index 000000000..7023141da
--- /dev/null
+++ b/readthedocs.yaml
@@ -0,0 +1,7 @@
+build:
+ image: latest
+
+python:
+ version: 3.6
+
+requirements_file: requirements.readthedocs.txt
diff --git a/requirements.readthedocs.txt b/requirements.readthedocs.txt
new file mode 100644
index 000000000..4228f6562
--- /dev/null
+++ b/requirements.readthedocs.txt
@@ -0,0 +1 @@
+./python-packages/order_utils
diff --git a/tsconfig.json b/tsconfig.json
index bc71dfb70..bbcb0a6d2 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -8,7 +8,7 @@
"noImplicitReturns": true,
"pretty": true,
"skipLibCheck": true,
- "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"],
+ "typeRoots": ["node_modules/@0x/typescript-typings/types", "node_modules/@types"],
"strict": true,
// These settings are required for TypeScript project references
"composite": true,
@@ -22,10 +22,13 @@
"references": [
{ "path": "./packages/0x.js" },
{ "path": "./packages/abi-gen" },
+ { "path": "./packages/abi-gen-wrappers" },
{ "path": "./packages/assert" },
{ "path": "./packages/asset-buyer" },
{ "path": "./packages/base-contract" },
{ "path": "./packages/connect" },
+ { "path": "./packages/contract-addresses" },
+ { "path": "./packages/contract-artifacts" },
{ "path": "./packages/contract-wrappers" },
{ "path": "./packages/contracts" },
{ "path": "./packages/dev-utils" },
@@ -42,7 +45,6 @@
{ "path": "./packages/sol-compiler" },
{ "path": "./packages/sol-cov" },
{ "path": "./packages/sol-resolver" },
- { "path": "./packages/sra-report" },
{ "path": "./packages/sra-spec" },
{ "path": "./packages/subproviders" },
{ "path": "./packages/testnet-faucets" },
diff --git a/typedoc-tsconfig.json b/typedoc-tsconfig.json
index 588285140..1d3a15a33 100644
--- a/typedoc-tsconfig.json
+++ b/typedoc-tsconfig.json
@@ -8,9 +8,10 @@
"experimentalDecorators": true,
"downlevelIteration": true,
"noImplicitReturns": true,
+ "resolveJsonModule": true,
"pretty": true,
"skipLibCheck": true,
- "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"],
+ "typeRoots": ["node_modules/@0x/typescript-typings/types", "node_modules/@types"],
"strict": true
}
}
diff --git a/yarn.lock b/yarn.lock
index 7338e0d99..9b6af4081 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2,29 +2,6 @@
# yarn lockfile v1
-"0x.js@^0.38.6":
- version "0.38.6"
- resolved "https://registry.yarnpkg.com/0x.js/-/0x.js-0.38.6.tgz#f6cb2b6ef9aea2ff7696c923095e0b794c1d84fc"
- integrity sha1-9ssrbvmuov92lskjCV4LeUwdhPw=
- dependencies:
- "@0xproject/assert" "^0.2.14"
- "@0xproject/base-contract" "^0.3.6"
- "@0xproject/contract-wrappers" "^0.1.1"
- "@0xproject/order-utils" "^0.0.9"
- "@0xproject/order-watcher" "^0.0.8"
- "@0xproject/sol-compiler" "^0.5.4"
- "@0xproject/types" "^0.8.2"
- "@0xproject/typescript-typings" "^0.4.3"
- "@0xproject/utils" "^0.7.3"
- "@0xproject/web3-wrapper" "^0.7.3"
- ethers "3.0.22"
- lodash "4.17.10"
-
-"8fold-marked@0.3.9":
- version "0.3.9"
- resolved "https://registry.yarnpkg.com/8fold-marked/-/8fold-marked-0.3.9.tgz#bb89c645612f8ccfaffac1ca6e3c11f168c9cf59"
- integrity sha512-OmVTXzmvQk/WuVZnOa+sT6wpkLrkPrjYanXS3X0ib1yk6315iwuPmvwKkOOdpqznYmavyT2ZCDOo6MeFe4xSog==
-
"@0x-lerna-fork/add@^3.0.0-beta.22":
version "3.0.0-beta.22"
resolved "https://registry.yarnpkg.com/@0x-lerna-fork/add/-/add-3.0.0-beta.22.tgz#b69d7cbf6a28af6abb3aabb47fb617e7c6c7ac2c"
@@ -539,259 +516,36 @@
npmlog "^4.1.2"
write-file-atomic "^2.3.0"
-"@0xproject/assert@^0.2.14":
- version "0.2.14"
- resolved "https://registry.yarnpkg.com/@0xproject/assert/-/assert-0.2.14.tgz#7d5a373fedc8eb482716b730f4dddf3ef33bfa29"
- integrity sha1-fVo3P+3I60gnFrcw9N3fPvM7+ik=
- dependencies:
- "@0xproject/json-schemas" "^0.8.3"
- "@0xproject/typescript-typings" "^0.4.3"
- "@0xproject/utils" "^0.7.3"
- lodash "4.17.10"
- valid-url "1.0.9"
-
-"@0xproject/base-contract@^0.3.6":
- version "0.3.6"
- resolved "https://registry.yarnpkg.com/@0xproject/base-contract/-/base-contract-0.3.6.tgz#c6d742ce2904bdd9e77524d99ba2438d3aae8a40"
- integrity sha1-xtdCzikEvdnndSTZm6JDjTquikA=
- dependencies:
- "@0xproject/types" "^0.8.2"
- "@0xproject/typescript-typings" "^0.4.3"
- "@0xproject/utils" "^0.7.3"
- "@0xproject/web3-wrapper" "^0.7.3"
- ethers "3.0.22"
- lodash "4.17.10"
-
-"@0xproject/connect@1.0.4":
- version "1.0.4"
- resolved "https://registry.npmjs.org/@0xproject/connect/-/connect-1.0.4.tgz#1d5f27f4aa69920dde50178ed7179240f81d1c54"
- integrity sha1-HV8n9Kppkg3eUBeO1xeSQPgdHFQ=
- dependencies:
- "@0xproject/assert" "^0.2.14"
- "@0xproject/json-schemas" "^0.8.3"
- "@0xproject/types" "^0.8.2"
- "@0xproject/typescript-typings" "^1.0.3"
- "@0xproject/utils" "^1.0.4"
- lodash "^4.17.4"
- query-string "^5.0.1"
- sinon "^4.0.0"
- websocket "^1.0.25"
-
-"@0xproject/contract-wrappers@^0.1.1":
- version "0.1.1"
- resolved "https://registry.yarnpkg.com/@0xproject/contract-wrappers/-/contract-wrappers-0.1.1.tgz#8108d7ec051f202ef0cfa77c91c4ef994bf89881"
- integrity sha1-gQjX7AUfIC7wz6d8kcTvmUv4mIE=
- dependencies:
- "@0xproject/assert" "^0.2.14"
- "@0xproject/base-contract" "^0.3.6"
- "@0xproject/fill-scenarios" "^0.0.6"
- "@0xproject/json-schemas" "^0.8.3"
- "@0xproject/order-utils" "^0.0.9"
- "@0xproject/sol-compiler" "^0.5.4"
- "@0xproject/types" "^0.8.2"
- "@0xproject/typescript-typings" "^0.4.3"
- "@0xproject/utils" "^0.7.3"
- "@0xproject/web3-wrapper" "^0.7.3"
- ethereumjs-blockstream "5.0.0"
- ethereumjs-util "5.1.5"
- ethers "3.0.22"
- js-sha3 "0.7.0"
- lodash "4.17.10"
- uuid "3.2.1"
-
-"@0xproject/fill-scenarios@^0.0.6":
- version "0.0.6"
- resolved "https://registry.yarnpkg.com/@0xproject/fill-scenarios/-/fill-scenarios-0.0.6.tgz#969a2c49122650af5a1bf7fe7c6d286a0e6f2de2"
- integrity sha1-lposSRImUK9aG/f+fG0oag5vLeI=
- dependencies:
- "@0xproject/base-contract" "^0.3.6"
- "@0xproject/order-utils" "^0.0.9"
- "@0xproject/types" "^0.8.2"
- "@0xproject/typescript-typings" "^0.4.3"
- "@0xproject/utils" "^0.7.3"
- "@0xproject/web3-wrapper" "^0.7.3"
- ethers "3.0.22"
- lodash "4.17.10"
-
-"@0xproject/json-schemas@^0.8.3":
- version "0.8.3"
- resolved "https://registry.yarnpkg.com/@0xproject/json-schemas/-/json-schemas-0.8.3.tgz#455e6219a6bd05e990392165192a983a9ab89f26"
- integrity sha1-RV5iGaa9BemQOSFlGSqYOpq4nyY=
- dependencies:
- "@0xproject/typescript-typings" "^0.4.3"
- "@types/node" "9.6.0"
- jsonschema "1.2.2"
- lodash.values "4.3.0"
-
-"@0xproject/order-utils@^0.0.9":
- version "0.0.9"
- resolved "https://registry.yarnpkg.com/@0xproject/order-utils/-/order-utils-0.0.9.tgz#75225dfbd87335d18810abf995d8e077b9a84868"
- integrity sha1-dSJd+9hzNdGIEKv5ldjgd7moSGg=
- dependencies:
- "@0xproject/assert" "^0.2.14"
- "@0xproject/json-schemas" "^0.8.3"
- "@0xproject/types" "^0.8.2"
- "@0xproject/typescript-typings" "^0.4.3"
- "@0xproject/utils" "^0.7.3"
- "@0xproject/web3-wrapper" "^0.7.3"
- "@types/node" "9.6.0"
- bn.js "4.11.7"
- ethereumjs-abi "0.6.5"
- ethereumjs-util "5.1.5"
- lodash "4.17.10"
-
-"@0xproject/order-watcher@^0.0.8":
- version "0.0.8"
- resolved "https://registry.yarnpkg.com/@0xproject/order-watcher/-/order-watcher-0.0.8.tgz#cfba4c39ca8c5d39e076276479383d0aae022c6d"
- integrity sha1-z7pMOcqMXTngdidkeTg9Cq4CLG0=
- dependencies:
- "@0xproject/assert" "^0.2.14"
- "@0xproject/base-contract" "^0.3.6"
- "@0xproject/contract-wrappers" "^0.1.1"
- "@0xproject/fill-scenarios" "^0.0.6"
- "@0xproject/json-schemas" "^0.8.3"
- "@0xproject/order-utils" "^0.0.9"
- "@0xproject/types" "^0.8.2"
- "@0xproject/typescript-typings" "^0.4.3"
- "@0xproject/utils" "^0.7.3"
- "@0xproject/web3-wrapper" "^0.7.3"
- bintrees "1.0.2"
- ethereum-types "^0.0.2"
- ethereumjs-blockstream "5.0.0"
- ethers "3.0.22"
- lodash "4.17.10"
-
-"@0xproject/sol-compiler@^0.5.4":
- version "0.5.4"
- resolved "https://registry.yarnpkg.com/@0xproject/sol-compiler/-/sol-compiler-0.5.4.tgz#3e0b04b0c02c5ec046ebb962b5ed20978c6b4cdd"
- integrity sha512-U82O12IpPjYff1iFIUbea06DiQSEanjFqiPbKEEko23O8WY2ZenIiShxLOQZko9SeaL92vdZ7m9oI6bLYIqMcQ==
- dependencies:
- "@0xproject/json-schemas" "^0.8.3"
- "@0xproject/sol-resolver" "^0.0.8"
- "@0xproject/types" "^0.8.2"
- "@0xproject/typescript-typings" "^0.4.3"
- "@0xproject/utils" "^0.7.3"
- "@0xproject/web3-wrapper" "^0.7.3"
- "@types/yargs" "10.0.2"
- chalk "2.3.2"
- ethereumjs-util "5.1.5"
- isomorphic-fetch "2.2.1"
- lodash "4.17.10"
- mkdirp "0.5.1"
- require-from-string "2.0.1"
- semver "5.5.0"
- solc "0.4.23"
- web3 "0.20.6"
- web3-eth-abi "1.0.0-beta.33"
- yargs "11.1.0"
-
-"@0xproject/sol-resolver@^0.0.8":
- version "0.0.8"
- resolved "https://registry.yarnpkg.com/@0xproject/sol-resolver/-/sol-resolver-0.0.8.tgz#5496ccebc9afa9eedfb5b62104f6478aa852bf66"
- integrity sha1-VJbM68mvqe7ftbYhBPZHiqhSv2Y=
- dependencies:
- "@0xproject/types" "^0.8.2"
- "@0xproject/typescript-typings" "^0.0.3"
- lodash "4.17.10"
-
-"@0xproject/types@^0.5.0":
- version "0.5.0"
- resolved "https://registry.yarnpkg.com/@0xproject/types/-/types-0.5.0.tgz#ba3cfbc11a8c6344b57c9680aa7df2ea84b9bf05"
- integrity sha1-ujz7wRqMY0S1fJaAqn3y6oS5vwU=
- dependencies:
- bignumber.js "~4.1.0"
-
-"@0xproject/types@^0.8.2":
- version "0.8.2"
- resolved "https://registry.yarnpkg.com/@0xproject/types/-/types-0.8.2.tgz#6f936b73bfb6f017b5102002d97da0881da92d1b"
- integrity sha1-b5Nrc7+28Be1ECAC2X2giB2pLRs=
- dependencies:
- "@types/node" "9.6.0"
- bignumber.js "~4.1.0"
-
-"@0xproject/typescript-typings@^0.0.3":
- version "0.0.3"
- resolved "https://registry.yarnpkg.com/@0xproject/typescript-typings/-/typescript-typings-0.0.3.tgz#3272080bde00ade0a970b0d236686b483b08a1d0"
- integrity sha1-MnIIC94AreCpcLDSNmhrSDsIodA=
- dependencies:
- "@0xproject/types" "^0.5.0"
- bignumber.js "~4.1.0"
-
-"@0xproject/typescript-typings@^0.4.3":
- version "0.4.3"
- resolved "https://registry.yarnpkg.com/@0xproject/typescript-typings/-/typescript-typings-0.4.3.tgz#f99f939a43f2764ad7182fcd78a71212a1d76d96"
- integrity sha1-+Z+TmkPydkrXGC/NeKcSEqHXbZY=
- dependencies:
- "@0xproject/types" "^0.8.2"
- bignumber.js "~4.1.0"
- ethereum-types "^0.0.2"
-
-"@0xproject/typescript-typings@^1.0.3":
- version "1.0.5"
- resolved "https://registry.yarnpkg.com/@0xproject/typescript-typings/-/typescript-typings-1.0.5.tgz#a808443419f26a7b90d63d1afd3efbfb48644184"
- integrity sha512-7CX1MXvlIgay3wt6vRYJzEPIzc6+ESP8rY1C7SopjLOKfkkSXSAwlO3xUwn3QEkU5kPMGEn88BO8r5CwAdrk3g==
- dependencies:
- "@types/bn.js" "^4.11.0"
- "@types/react" "*"
- bignumber.js "~4.1.0"
- ethereum-types "^1.0.5"
- popper.js "1.14.3"
-
-"@0xproject/typescript-typings@^2.0.2":
- version "2.0.2"
- resolved "https://registry.yarnpkg.com/@0xproject/typescript-typings/-/typescript-typings-2.0.2.tgz#1812f64e341f1d24c09b8b5a951cbde0e5fff9c2"
- integrity sha512-kfwCwylCVHtOSRiq7llwpOyWbJcH7DpMB5nBE4WE/grnb+fb1RS576WUqvnZ6VTezb4D8TV9rl3KO+/HrJi4+w==
- dependencies:
- "@types/bn.js" "^4.11.0"
- "@types/react" "*"
- bignumber.js "~4.1.0"
- ethereum-types "^1.0.8"
- popper.js "1.14.3"
-
-"@0xproject/utils@^0.7.3":
- version "0.7.3"
- resolved "https://registry.yarnpkg.com/@0xproject/utils/-/utils-0.7.3.tgz#ffa7c6da9bf0dd3e13694f185dcfc48a8981ff05"
- integrity sha1-/6fG2pvw3T4TaU8YXc/EiomB/wU=
+"@0xproject/npm-cli-login@^0.0.11":
+ version "0.0.11"
+ resolved "https://registry.yarnpkg.com/@0xproject/npm-cli-login/-/npm-cli-login-0.0.11.tgz#3f1ec06112ce62aad300ff0575358f68aeecde2e"
+ integrity sha512-0xUHfvJULQH2iAm8YT1pQP0+Xrz+1BdaDhs7MXuJHJm+3ARyxnEbllNDni6cf05qN5kn7E5AGzSeafvsjVlFKw==
dependencies:
- "@0xproject/typescript-typings" "^0.4.3"
- "@types/node" "9.6.0"
- bignumber.js "~4.1.0"
- ethereum-types "^0.0.2"
- ethereumjs-util "^5.1.1"
- ethers "3.0.22"
- js-sha3 "0.7.0"
- lodash "4.17.10"
- web3 "0.20.6"
+ npm-registry-client "7.0.9"
-"@0xproject/utils@^1.0.4":
- version "1.0.11"
- resolved "https://registry.yarnpkg.com/@0xproject/utils/-/utils-1.0.11.tgz#5b53e7d9d4dbe68e219049218c9db04e97c37429"
- integrity sha512-dUJx3OG0D6x+WFeD3moMvmVLUNXnMZCl9+GSLflO/LXDIYvuLu9tdjmQDLCUKppC3w+6LlvzO+zd8SOObIXW9A==
+"@0xproject/react-shared@^1.0.15":
+ version "1.0.15"
+ resolved "https://registry.yarnpkg.com/@0xproject/react-shared/-/react-shared-1.0.15.tgz#b42482fd31feee1b3beecb0fdd9427d2a10e0c93"
+ integrity sha512-QBk/Lhqgy7abPQVQWNo6UFvsMCD5ersNPXqx8yKoxm7wSV9AyB/fdQtoAixRZl4RwjaxpZaGqUBreqiG8Lw+yA==
dependencies:
- "@0xproject/types" "^1.1.1"
- "@0xproject/typescript-typings" "^2.0.2"
+ "@material-ui/core" "^3.0.1"
+ "@types/is-mobile" "0.3.0"
+ "@types/lodash" "4.14.104"
+ "@types/material-ui" "0.18.0"
"@types/node" "*"
- abortcontroller-polyfill "^1.1.9"
- bignumber.js "~4.1.0"
- detect-node "2.0.3"
- ethereum-types "^1.0.8"
- ethereumjs-util "^5.1.1"
- ethers "3.0.22"
- isomorphic-fetch "^2.2.1"
- js-sha3 "^0.7.0"
+ "@types/react" "*"
+ "@types/react-dom" "*"
+ "@types/react-scroll" "1.5.3"
+ basscss "^8.0.3"
+ change-case "^3.0.2"
+ is-mobile "^0.2.2"
lodash "^4.17.5"
-
-"@0xproject/web3-wrapper@^0.7.3":
- version "0.7.3"
- resolved "https://registry.yarnpkg.com/@0xproject/web3-wrapper/-/web3-wrapper-0.7.3.tgz#9bd50b034b92fd505b6766b6e225f014b6d08b08"
- integrity sha1-m9ULA0uS/VBbZ2a24iXwFLbQiwg=
- dependencies:
- "@0xproject/types" "^0.8.2"
- "@0xproject/typescript-typings" "^0.4.3"
- "@0xproject/utils" "^0.7.3"
- ethers "3.0.22"
- lodash "4.17.10"
- web3 "0.20.6"
+ material-ui "^0.20.0"
+ react "^16.4.2"
+ react-dom "^16.4.2"
+ react-highlight "0xproject/react-highlight#2f40a42e0a3f0ad126f9f42d505b97b603fc7162"
+ react-markdown "^3.2.2"
+ react-scroll "0xproject/react-scroll#similar-to-pr-330"
"@babel/code-frame@^7.0.0-beta.35":
version "7.0.0"
@@ -802,7 +556,7 @@
"@babel/helper-annotate-as-pure@^7.0.0":
version "7.0.0"
- resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.0.0.tgz#323d39dd0b50e10c7c06ca7d7638e6864d8c5c32"
+ resolved "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.0.0.tgz#323d39dd0b50e10c7c06ca7d7638e6864d8c5c32"
integrity sha512-3UYcJUj9kvSLbLbUIfQTqzcy5VX7GRZ/CCDrnOaZorFFM01aXp1+GJwuFGV4NDDoAS+mOUyHcO6UD/RfqOks3Q==
dependencies:
"@babel/types" "^7.0.0"
@@ -832,7 +586,7 @@
"@babel/types@^7.0.0":
version "7.1.3"
- resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.1.3.tgz#3a767004567060c2f40fca49a304712c525ee37d"
+ resolved "https://registry.npmjs.org/@babel/types/-/types-7.1.3.tgz#3a767004567060c2f40fca49a304712c525ee37d"
integrity sha512-RpPOVfK+yatXyn8n4PB1NW6k9qjinrXrRR8ugBN8fD6hCy5RXI6PSbVqpOJBO9oSaY7Nom4ohj35feb0UR9hSA==
dependencies:
esutils "^2.0.2"
@@ -841,14 +595,14 @@
"@emotion/is-prop-valid@^0.6.8":
version "0.6.8"
- resolved "https://registry.yarnpkg.com/@emotion/is-prop-valid/-/is-prop-valid-0.6.8.tgz#68ad02831da41213a2089d2cab4e8ac8b30cbd85"
+ resolved "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-0.6.8.tgz#68ad02831da41213a2089d2cab4e8ac8b30cbd85"
integrity sha512-IMSL7ekYhmFlILXcouA6ket3vV7u9BqStlXzbKOF9HBtpUPMMlHU+bBxrLOa2NvleVwNIxeq/zL8LafLbeUXcA==
dependencies:
"@emotion/memoize" "^0.6.6"
"@emotion/memoize@^0.6.6":
version "0.6.6"
- resolved "https://registry.yarnpkg.com/@emotion/memoize/-/memoize-0.6.6.tgz#004b98298d04c7ca3b4f50ca2035d4f60d2eed1b"
+ resolved "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.6.6.tgz#004b98298d04c7ca3b4f50ca2035d4f60d2eed1b"
integrity sha512-h4t4jFjtm1YV7UirAFuSuFGyLa+NNxjdkq6DpFLANNQY5rHueFZHVY+8Cu1HYVP6DrheB0kv4m5xPjo7eKT7yQ==
"@ledgerhq/hw-app-eth@^4.3.0":
@@ -866,14 +620,21 @@
"@ledgerhq/hw-transport" "^4.7.3"
node-hid "^0.7.2"
-"@ledgerhq/hw-transport-u2f@^4.3.0":
- version "4.7.3"
- resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-u2f/-/hw-transport-u2f-4.7.3.tgz#32be84bd2829f0ad0745604355f73a169dceb5e5"
- integrity sha1-Mr6EvSgp8K0HRWBDVfc6Fp3OteU=
+"@ledgerhq/hw-transport-u2f@4.24.0":
+ version "4.24.0"
+ resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-u2f/-/hw-transport-u2f-4.24.0.tgz#d67cfc4abf6d9a900ed45f2e2df7fe06dfdff5c7"
+ integrity sha512-/gFjhkM0sJfZ7iUf8HoIkGufAWgPacrbb1LW0TvWnZwvsATVJ1BZJBtrr90Wo401PKsjVwYtFt3Ce4gOAUv9jQ==
dependencies:
- "@ledgerhq/hw-transport" "^4.7.3"
+ "@ledgerhq/hw-transport" "^4.24.0"
u2f-api "0.2.7"
+"@ledgerhq/hw-transport@^4.24.0":
+ version "4.24.0"
+ resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport/-/hw-transport-4.24.0.tgz#8def925d8c2e1f73d15128d9e27ead729870be58"
+ integrity sha512-L34TG1Ss7goRB+5BxtvBwUuu0CmDSIxS33oUqkpEy6rCs31k7XicV48iUGAnRnt8hNY2DvJ9WFyaOroUE9h6wQ==
+ dependencies:
+ events "^3.0.0"
+
"@ledgerhq/hw-transport@^4.7.3":
version "4.7.3"
resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport/-/hw-transport-4.7.3.tgz#e89cd90d30aaf008adf9fdfa4af317a48fe798ca"
@@ -881,6 +642,22 @@
dependencies:
events "^2.0.0"
+"@lerna/add@^3.4.1":
+ version "3.4.1"
+ resolved "https://registry.yarnpkg.com/@lerna/add/-/add-3.4.1.tgz#d41068317e30f530df48220d256b5e79690b1877"
+ integrity sha512-Vf54B42jlD6G52qnv/cAGH70cVQIa+LX//lfsbkxHvzkhIqBl5J4KsnTOPkA9uq3R+zP58ayicCHB9ReiEWGJg==
+ dependencies:
+ "@lerna/bootstrap" "^3.4.1"
+ "@lerna/command" "^3.3.0"
+ "@lerna/filter-options" "^3.3.2"
+ "@lerna/npm-conf" "^3.4.1"
+ "@lerna/validation-error" "^3.0.0"
+ dedent "^0.7.0"
+ npm-package-arg "^6.0.0"
+ p-map "^1.2.0"
+ pacote "^9.1.0"
+ semver "^5.5.0"
+
"@lerna/batch-packages@^3.0.0-beta.18":
version "3.0.0-beta.18"
resolved "http://registry.yarnpkg.com/@lerna%2fbatch-packages/-/batch-packages-3.0.0-beta.18.tgz#69d5e3f5003e454a1615c38d9f0b65b10853625a"
@@ -890,6 +667,358 @@
"@lerna/validation-error" "^3.0.0-beta.10"
npmlog "^4.1.2"
+"@lerna/batch-packages@^3.1.2":
+ version "3.1.2"
+ resolved "https://registry.yarnpkg.com/@lerna/batch-packages/-/batch-packages-3.1.2.tgz#74b5312a01a8916204cbc71237ffbe93144b99df"
+ integrity sha512-HAkpptrYeUVlBYbLScXgeCgk6BsNVXxDd53HVWgzzTWpXV4MHpbpeKrByyt7viXlNhW0w73jJbipb/QlFsHIhQ==
+ dependencies:
+ "@lerna/package-graph" "^3.1.2"
+ "@lerna/validation-error" "^3.0.0"
+ npmlog "^4.1.2"
+
+"@lerna/bootstrap@^3.4.1":
+ version "3.4.1"
+ resolved "https://registry.yarnpkg.com/@lerna/bootstrap/-/bootstrap-3.4.1.tgz#10635e9b547fb7d685949ac78e0923f73da2f52a"
+ integrity sha512-yZDJgNm/KDoRH2klzmQGmpWMg/XMzWgeWvauXkrfW/mj1wwmufOuh5pN4fBFxVmUUa/RFZdfMeaaJt3+W3PPBw==
+ dependencies:
+ "@lerna/batch-packages" "^3.1.2"
+ "@lerna/command" "^3.3.0"
+ "@lerna/filter-options" "^3.3.2"
+ "@lerna/has-npm-version" "^3.3.0"
+ "@lerna/npm-conf" "^3.4.1"
+ "@lerna/npm-install" "^3.3.0"
+ "@lerna/rimraf-dir" "^3.3.0"
+ "@lerna/run-lifecycle" "^3.4.1"
+ "@lerna/run-parallel-batches" "^3.0.0"
+ "@lerna/symlink-binary" "^3.3.0"
+ "@lerna/symlink-dependencies" "^3.3.0"
+ "@lerna/validation-error" "^3.0.0"
+ dedent "^0.7.0"
+ get-port "^3.2.0"
+ multimatch "^2.1.0"
+ npm-package-arg "^6.0.0"
+ npmlog "^4.1.2"
+ p-finally "^1.0.0"
+ p-map "^1.2.0"
+ p-map-series "^1.0.0"
+ p-waterfall "^1.0.0"
+ read-package-tree "^5.1.6"
+ semver "^5.5.0"
+
+"@lerna/changed@^3.4.1":
+ version "3.4.1"
+ resolved "https://registry.yarnpkg.com/@lerna/changed/-/changed-3.4.1.tgz#84a049359a53b8812c3a07a664bd41b1768f5938"
+ integrity sha512-gT7fhl4zQWyGETDO4Yy5wsFnqNlBSsezncS1nkMW1uO6jwnolwYqcr1KbrMR8HdmsZBn/00Y0mRnbtbpPPey8w==
+ dependencies:
+ "@lerna/collect-updates" "^3.3.2"
+ "@lerna/command" "^3.3.0"
+ "@lerna/listable" "^3.0.0"
+ "@lerna/output" "^3.0.0"
+ "@lerna/version" "^3.4.1"
+
+"@lerna/check-working-tree@^3.3.0":
+ version "3.3.0"
+ resolved "https://registry.yarnpkg.com/@lerna/check-working-tree/-/check-working-tree-3.3.0.tgz#2118f301f28ccb530812e5b27a341b1e6b3c84e2"
+ integrity sha512-oeEP1dNhiiKUaO0pmcIi73YXJpaD0n5JczNctvVNZ8fGZmrALZtEnmC28o6Z7JgQaqq5nd2kO7xbnjoitrC51g==
+ dependencies:
+ "@lerna/describe-ref" "^3.3.0"
+ "@lerna/validation-error" "^3.0.0"
+
+"@lerna/child-process@^3.3.0":
+ version "3.3.0"
+ resolved "https://registry.yarnpkg.com/@lerna/child-process/-/child-process-3.3.0.tgz#71184a763105b6c8ece27f43f166498d90fe680f"
+ integrity sha512-q2d/OPlNX/cBXB6Iz1932RFzOmOHq6ZzPjqebkINNaTojHWuuRpvJJY4Uz3NGpJ3kEtPDvBemkZqUBTSO5wb1g==
+ dependencies:
+ chalk "^2.3.1"
+ execa "^1.0.0"
+ strong-log-transformer "^2.0.0"
+
+"@lerna/clean@^3.3.2":
+ version "3.3.2"
+ resolved "https://registry.yarnpkg.com/@lerna/clean/-/clean-3.3.2.tgz#9a7e8a1e400e580de260fa124945b2939a025069"
+ integrity sha512-mvqusgSp2ou5SGqQgTEoTvGJpGfH4+L6XSeN+Ims+eNFGXuMazmKCf+rz2PZBMFufaHJ/Os+JF0vPCcWI1Fzqg==
+ dependencies:
+ "@lerna/command" "^3.3.0"
+ "@lerna/filter-options" "^3.3.2"
+ "@lerna/prompt" "^3.3.1"
+ "@lerna/rimraf-dir" "^3.3.0"
+ p-map "^1.2.0"
+ p-map-series "^1.0.0"
+ p-waterfall "^1.0.0"
+
+"@lerna/cli@^3.2.0":
+ version "3.2.0"
+ resolved "https://registry.yarnpkg.com/@lerna/cli/-/cli-3.2.0.tgz#3ed25bcbc0b8f0878bc6a102ee0296f01476cfdf"
+ integrity sha512-JdbLyTxHqxUlrkI+Ke+ltXbtyA+MPu9zR6kg/n8Fl6uaez/2fZWtReXzYi8MgLxfUFa7+1OHWJv4eAMZlByJ+Q==
+ dependencies:
+ "@lerna/global-options" "^3.1.3"
+ dedent "^0.7.0"
+ npmlog "^4.1.2"
+ yargs "^12.0.1"
+
+"@lerna/collect-updates@^3.3.2":
+ version "3.3.2"
+ resolved "https://registry.yarnpkg.com/@lerna/collect-updates/-/collect-updates-3.3.2.tgz#54df5ce59ca05e8aa04ff8a9299f89cc253a9304"
+ integrity sha512-9WyBJI2S5sYgEZEScu525Lbi6nknNrdBKop35sCDIC9y6AIGvH6Dr5tkTd+Kg3n1dE+kHwW/xjERkx3+h7th3w==
+ dependencies:
+ "@lerna/child-process" "^3.3.0"
+ "@lerna/describe-ref" "^3.3.0"
+ minimatch "^3.0.4"
+ npmlog "^4.1.2"
+ slash "^1.0.0"
+
+"@lerna/command@^3.3.0":
+ version "3.3.0"
+ resolved "https://registry.yarnpkg.com/@lerna/command/-/command-3.3.0.tgz#e81c4716a676b02dbe9d3f548d5f45b4ba32c25a"
+ integrity sha512-NTOkLEKlWcBLHSvUr9tzVpV7RJ4GROLeOuZ6RfztGOW/31JPSwVVBD2kPifEXNZunldOx5GVWukR+7+NpAWhsg==
+ dependencies:
+ "@lerna/child-process" "^3.3.0"
+ "@lerna/package-graph" "^3.1.2"
+ "@lerna/project" "^3.0.0"
+ "@lerna/validation-error" "^3.0.0"
+ "@lerna/write-log-file" "^3.0.0"
+ dedent "^0.7.0"
+ execa "^1.0.0"
+ is-ci "^1.0.10"
+ lodash "^4.17.5"
+ npmlog "^4.1.2"
+
+"@lerna/conventional-commits@^3.4.1":
+ version "3.4.1"
+ resolved "https://registry.yarnpkg.com/@lerna/conventional-commits/-/conventional-commits-3.4.1.tgz#0b47f9fc0c4a10951883e949d939188da1b527bc"
+ integrity sha512-3NETrA58aUkaEW3RdwdJ766Bg9NVpLzb26mtdlsJQcvB5sQBWH5dJSHIVQH1QsGloBeH2pE/mDUEVY8ZJXuR4w==
+ dependencies:
+ "@lerna/validation-error" "^3.0.0"
+ conventional-changelog-angular "^5.0.1"
+ conventional-changelog-core "^3.1.0"
+ conventional-recommended-bump "^4.0.1"
+ fs-extra "^7.0.0"
+ get-stream "^4.0.0"
+ npm-package-arg "^6.0.0"
+ npmlog "^4.1.2"
+ semver "^5.5.0"
+
+"@lerna/create-symlink@^3.3.0":
+ version "3.3.0"
+ resolved "https://registry.yarnpkg.com/@lerna/create-symlink/-/create-symlink-3.3.0.tgz#91de00fd576018ba4251f0c6a5b4b7f768f22a82"
+ integrity sha512-0lb88Nnq1c/GG+fwybuReOnw3+ah4dB81PuWwWwuqUNPE0n50qUf/M/7FfSb5JEh/93fcdbZI0La8t3iysNW1w==
+ dependencies:
+ cmd-shim "^2.0.2"
+ fs-extra "^7.0.0"
+ npmlog "^4.1.2"
+
+"@lerna/create@^3.4.1":
+ version "3.4.1"
+ resolved "https://registry.yarnpkg.com/@lerna/create/-/create-3.4.1.tgz#7cad78a5701d7666a0f5d0fe0e325acd8d8f5b63"
+ integrity sha512-l+4t2SRO5nvW0MNYY+EWxbaMHsAN8bkWH3nyt7EzhBjs4+TlRAJRIEqd8o9NWznheE3pzwczFz1Qfl3BWbyM5A==
+ dependencies:
+ "@lerna/child-process" "^3.3.0"
+ "@lerna/command" "^3.3.0"
+ "@lerna/npm-conf" "^3.4.1"
+ "@lerna/validation-error" "^3.0.0"
+ camelcase "^4.1.0"
+ dedent "^0.7.0"
+ fs-extra "^7.0.0"
+ globby "^8.0.1"
+ init-package-json "^1.10.3"
+ npm-package-arg "^6.0.0"
+ pify "^3.0.0"
+ semver "^5.5.0"
+ slash "^1.0.0"
+ validate-npm-package-license "^3.0.3"
+ validate-npm-package-name "^3.0.0"
+ whatwg-url "^7.0.0"
+
+"@lerna/describe-ref@^3.3.0":
+ version "3.3.0"
+ resolved "https://registry.yarnpkg.com/@lerna/describe-ref/-/describe-ref-3.3.0.tgz#d373adb530d5428ab91e303ccbfcf51a98374a3a"
+ integrity sha512-4t7M4OupnYMSPNLrLUau8qkS+dgLEi4w+DkRkV0+A+KNYga1W0jVgNLPIIsxta7OHfodPkCNAqZCzNCw/dmAwA==
+ dependencies:
+ "@lerna/child-process" "^3.3.0"
+ npmlog "^4.1.2"
+
+"@lerna/diff@^3.3.0":
+ version "3.3.0"
+ resolved "https://registry.yarnpkg.com/@lerna/diff/-/diff-3.3.0.tgz#c8130a5f508b47fad5fec81404498bc3acdf9cb5"
+ integrity sha512-sIoMjsm3NVxvmt6ofx8Uu/2fxgldQqLl0zmC9X1xW00j831o5hBffx1EoKj9CnmaEvoSP6j/KFjxy2RWjebCIg==
+ dependencies:
+ "@lerna/child-process" "^3.3.0"
+ "@lerna/command" "^3.3.0"
+ "@lerna/validation-error" "^3.0.0"
+ npmlog "^4.1.2"
+
+"@lerna/exec@^3.3.2":
+ version "3.3.2"
+ resolved "https://registry.yarnpkg.com/@lerna/exec/-/exec-3.3.2.tgz#95ecaca617fd85abdb91e9a378ed06ec1763d665"
+ integrity sha512-mN6vGxNir7JOGvWLwKr3DW3LNy1ecCo2ziZj5rO9Mw5Rew3carUu1XLmhF/4judtsvXViUY+rvGIcqHe0vvb+w==
+ dependencies:
+ "@lerna/batch-packages" "^3.1.2"
+ "@lerna/child-process" "^3.3.0"
+ "@lerna/command" "^3.3.0"
+ "@lerna/filter-options" "^3.3.2"
+ "@lerna/run-parallel-batches" "^3.0.0"
+ "@lerna/validation-error" "^3.0.0"
+
+"@lerna/filter-options@^3.3.2":
+ version "3.3.2"
+ resolved "https://registry.yarnpkg.com/@lerna/filter-options/-/filter-options-3.3.2.tgz#ac90702b7876ff4980dcdeaeac049c433dd01773"
+ integrity sha512-0WHqdDgAnt5WKoByi1q+lFw8HWt5tEKP2DnLlGqWv3YFwVF5DsPRlO7xbzjY9sJgvyJtZcnkMtccdBPFhGGyIQ==
+ dependencies:
+ "@lerna/collect-updates" "^3.3.2"
+ "@lerna/filter-packages" "^3.0.0"
+ dedent "^0.7.0"
+
+"@lerna/filter-packages@^3.0.0":
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/@lerna/filter-packages/-/filter-packages-3.0.0.tgz#5eb25ad1610f3e2ab845133d1f8d7d40314e838f"
+ integrity sha512-zwbY1J4uRjWRZ/FgYbtVkq7I3Nduwsg2V2HwLKSzwV2vPglfGqgovYOVkND6/xqe2BHwDX4IyA2+e7OJmLaLSA==
+ dependencies:
+ "@lerna/validation-error" "^3.0.0"
+ multimatch "^2.1.0"
+ npmlog "^4.1.2"
+
+"@lerna/get-npm-exec-opts@^3.0.0":
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/@lerna/get-npm-exec-opts/-/get-npm-exec-opts-3.0.0.tgz#8fc7866e8d8e9a2f2dc385287ba32eb44de8bdeb"
+ integrity sha512-arcYUm+4xS8J3Palhl+5rRJXnZnFHsLFKHBxznkPIxjwGQeAEw7df38uHdVjEQ+HNeFmHnBgSqfbxl1VIw5DHg==
+ dependencies:
+ npmlog "^4.1.2"
+
+"@lerna/global-options@^3.1.3":
+ version "3.1.3"
+ resolved "https://registry.yarnpkg.com/@lerna/global-options/-/global-options-3.1.3.tgz#cf85e24655a91d04d4efc9a80c1f83fc768d08ae"
+ integrity sha512-LVeZU/Zgc0XkHdGMRYn+EmHfDmmYNwYRv3ta59iCVFXLVp7FRFWF7oB1ss/WRa9x/pYU0o6L8as/5DomLUGASA==
+
+"@lerna/has-npm-version@^3.3.0":
+ version "3.3.0"
+ resolved "https://registry.yarnpkg.com/@lerna/has-npm-version/-/has-npm-version-3.3.0.tgz#8a73c2c437a0e1e68a19ccbd0dd3c014d4d39135"
+ integrity sha512-GX7omRep1eBRZHgjZLRw3MpBJSdA5gPZFz95P7rxhpvsiG384Tdrr/cKFMhm0A09yq27Tk/nuYTaZIj7HsVE6g==
+ dependencies:
+ "@lerna/child-process" "^3.3.0"
+ semver "^5.5.0"
+
+"@lerna/import@^3.3.1":
+ version "3.3.1"
+ resolved "https://registry.yarnpkg.com/@lerna/import/-/import-3.3.1.tgz#deca8c93c9cc03c5844b975c6da9937dd7530440"
+ integrity sha512-2OzTQDkYKbBPpyP2iOI1sWfcvMjNLjjHjmREq/uOWJaSIk5J3Ukt71OPpcOHh4V2CBOlXidCcO+Hyb4FVIy8fw==
+ dependencies:
+ "@lerna/child-process" "^3.3.0"
+ "@lerna/command" "^3.3.0"
+ "@lerna/prompt" "^3.3.1"
+ "@lerna/validation-error" "^3.0.0"
+ dedent "^0.7.0"
+ fs-extra "^7.0.0"
+ p-map-series "^1.0.0"
+
+"@lerna/init@^3.3.0":
+ version "3.3.0"
+ resolved "https://registry.yarnpkg.com/@lerna/init/-/init-3.3.0.tgz#998f3497da3d891867c593b808b6db4b8fc4ccb9"
+ integrity sha512-HvgRLkIG6nDIeAO6ix5sUVIVV+W9UMk2rSSmFT66CDOefRi7S028amiyYnFUK1QkIAaUbVUyOnYaErtbJwICuw==
+ dependencies:
+ "@lerna/child-process" "^3.3.0"
+ "@lerna/command" "^3.3.0"
+ fs-extra "^7.0.0"
+ p-map "^1.2.0"
+ write-json-file "^2.3.0"
+
+"@lerna/link@^3.3.0":
+ version "3.3.0"
+ resolved "https://registry.yarnpkg.com/@lerna/link/-/link-3.3.0.tgz#c0c05ff52d0f0c659fcf221627edfcd58e477a5c"
+ integrity sha512-8CeXzGL7okrsVXsy2sHXI2KuBaczw3cblAnA2+FJPUqSKMPNbUTRzeU3bOlCjYtK0LbxC4ngENJTL3jJ8RaYQQ==
+ dependencies:
+ "@lerna/command" "^3.3.0"
+ "@lerna/package-graph" "^3.1.2"
+ "@lerna/symlink-dependencies" "^3.3.0"
+ p-map "^1.2.0"
+ slash "^1.0.0"
+
+"@lerna/list@^3.3.2":
+ version "3.3.2"
+ resolved "https://registry.yarnpkg.com/@lerna/list/-/list-3.3.2.tgz#1412b3cce2a83b1baa4ff6fb962d50b46c28ec98"
+ integrity sha512-XXEVy7w+i/xx8NeJmGirw4upEoEF9OfD6XPLjISNQc24VgQV+frXdVJ02QcP7Y/PkY1rdIVrOjvo3ipKVLUxaQ==
+ dependencies:
+ "@lerna/command" "^3.3.0"
+ "@lerna/filter-options" "^3.3.2"
+ "@lerna/listable" "^3.0.0"
+ "@lerna/output" "^3.0.0"
+
+"@lerna/listable@^3.0.0":
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/@lerna/listable/-/listable-3.0.0.tgz#27209b1382c87abdbc964220e75c247d803d4199"
+ integrity sha512-HX/9hyx1HLg2kpiKXIUc1EimlkK1T58aKQ7ovO7rQdTx9ForpefoMzyLnHE1n4XrUtEszcSWJIICJ/F898M6Ag==
+ dependencies:
+ chalk "^2.3.1"
+ columnify "^1.5.4"
+
+"@lerna/log-packed@^3.0.4":
+ version "3.0.4"
+ resolved "https://registry.yarnpkg.com/@lerna/log-packed/-/log-packed-3.0.4.tgz#6d1f6ce5ca68b9971f2a27f0ecf3c50684be174a"
+ integrity sha512-vVQHgMagE2wnbxhNY9nFkdu+Cx2TsyWalkJfkxbNzmo6gOCrDsxCBDj9vTEV8Q+4aWx0C0Bsc0sB2Eb8y/+ofA==
+ dependencies:
+ byte-size "^4.0.3"
+ columnify "^1.5.4"
+ has-unicode "^2.0.1"
+ npmlog "^4.1.2"
+
+"@lerna/npm-conf@^3.4.1":
+ version "3.4.1"
+ resolved "https://registry.yarnpkg.com/@lerna/npm-conf/-/npm-conf-3.4.1.tgz#859e931b0bc9a5eed86309cc09508810c1e7d121"
+ integrity sha512-i9G6DnbCqiAqxKx2rSXej/n14qxlV/XOebL6QZonxJKzNTB+Q2wglnhTXmfZXTPJfoqimLaY4NfAEtbOXRWOXQ==
+ dependencies:
+ config-chain "^1.1.11"
+ pify "^3.0.0"
+
+"@lerna/npm-dist-tag@^3.3.0":
+ version "3.3.0"
+ resolved "https://registry.yarnpkg.com/@lerna/npm-dist-tag/-/npm-dist-tag-3.3.0.tgz#e1c5ab67674216d901266a16846b21cc81ff6afd"
+ integrity sha512-EtZJXzh3w5tqXEev+EBBPrWKWWn0WgJfxm4FihfS9VgyaAW8udIVZHGkIQ3f+tBtupcAzA9Q8cQNUkGF2efwmA==
+ dependencies:
+ "@lerna/child-process" "^3.3.0"
+ "@lerna/get-npm-exec-opts" "^3.0.0"
+ npmlog "^4.1.2"
+
+"@lerna/npm-install@^3.3.0":
+ version "3.3.0"
+ resolved "https://registry.yarnpkg.com/@lerna/npm-install/-/npm-install-3.3.0.tgz#16d00ffd668d11b2386b3ac68bdac2cf8320e533"
+ integrity sha512-WoVvKdS8ltROTGSNQwo6NDq0YKnjwhvTG4li1okcN/eHKOS3tL9bxbgPx7No0wOq5DKBpdeS9KhAfee6LFAZ5g==
+ dependencies:
+ "@lerna/child-process" "^3.3.0"
+ "@lerna/get-npm-exec-opts" "^3.0.0"
+ fs-extra "^7.0.0"
+ npm-package-arg "^6.0.0"
+ npmlog "^4.1.2"
+ signal-exit "^3.0.2"
+ write-pkg "^3.1.0"
+
+"@lerna/npm-publish@^3.3.1":
+ version "3.3.1"
+ resolved "https://registry.yarnpkg.com/@lerna/npm-publish/-/npm-publish-3.3.1.tgz#30384665d7ee387343332ece62ca231207bbabea"
+ integrity sha512-bVTlWIcBL6Zpyzqvr9C7rxXYcoPw+l7IPz5eqQDNREj1R39Wj18OWB2KTJq8l7LIX7Wf4C2A1uT5hJaEf9BuvA==
+ dependencies:
+ "@lerna/child-process" "^3.3.0"
+ "@lerna/get-npm-exec-opts" "^3.0.0"
+ "@lerna/has-npm-version" "^3.3.0"
+ "@lerna/log-packed" "^3.0.4"
+ fs-extra "^7.0.0"
+ npmlog "^4.1.2"
+ p-map "^1.2.0"
+
+"@lerna/npm-run-script@^3.3.0":
+ version "3.3.0"
+ resolved "https://registry.yarnpkg.com/@lerna/npm-run-script/-/npm-run-script-3.3.0.tgz#3c79601c27c67121155b20e039be53130217db72"
+ integrity sha512-YqDguWZzp4jIomaE4aWMUP7MIAJAFvRAf6ziQLpqwoQskfWLqK5mW0CcszT1oLjhfb3cY3MMfSTFaqwbdKmICg==
+ dependencies:
+ "@lerna/child-process" "^3.3.0"
+ "@lerna/get-npm-exec-opts" "^3.0.0"
+ npmlog "^4.1.2"
+
+"@lerna/output@^3.0.0":
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/@lerna/output/-/output-3.0.0.tgz#4ed4a30ed2f311046b714b3840a090990ba3ce35"
+ integrity sha512-EFxnSbO0zDEVKkTKpoCUAFcZjc3gn3DwPlyTDxbeqPU7neCfxP4rA4+0a6pcOfTlRS5kLBRMx79F2TRCaMM3DA==
+ dependencies:
+ npmlog "^4.1.2"
+
"@lerna/package-graph@^3.0.0-beta.18":
version "3.0.0-beta.18"
resolved "http://registry.yarnpkg.com/@lerna%2fpackage-graph/-/package-graph-3.0.0-beta.18.tgz#8c33a6a10453d310e14fc9d317dc51e845e11963"
@@ -898,6 +1027,162 @@
npm-package-arg "^6.0.0"
semver "^5.5.0"
+"@lerna/package-graph@^3.1.2":
+ version "3.1.2"
+ resolved "https://registry.yarnpkg.com/@lerna/package-graph/-/package-graph-3.1.2.tgz#b70298a3a8c82e12090da33233bf242223a38f20"
+ integrity sha512-9wIWb49I1IJmyjPdEVZQ13IAi9biGfH/OZHOC04U2zXGA0GLiY+B3CAx6FQvqkZ8xEGfqzmXnv3LvZ0bQfc1aQ==
+ dependencies:
+ "@lerna/validation-error" "^3.0.0"
+ npm-package-arg "^6.0.0"
+ semver "^5.5.0"
+
+"@lerna/package@^3.0.0":
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/@lerna/package/-/package-3.0.0.tgz#14afc9a6cb1f7f7b23c1d7c7aa81bdac7d44c0e5"
+ integrity sha512-djzEJxzn212wS8d9znBnlXkeRlPL7GqeAYBykAmsuq51YGvaQK67Umh5ejdO0uxexF/4r7yRwgrlRHpQs8Rfqg==
+ dependencies:
+ npm-package-arg "^6.0.0"
+ write-pkg "^3.1.0"
+
+"@lerna/project@^3.0.0":
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/@lerna/project/-/project-3.0.0.tgz#4320d2a2b4080cabcf95161d9c48475217d8a545"
+ integrity sha512-XhDFVfqj79jG2Speggd15RpYaE8uiR25UKcQBDmumbmqvTS7xf2cvl2pq2UTvDafaJ0YwFF3xkxQZeZnFMwdkw==
+ dependencies:
+ "@lerna/package" "^3.0.0"
+ "@lerna/validation-error" "^3.0.0"
+ cosmiconfig "^5.0.2"
+ dedent "^0.7.0"
+ dot-prop "^4.2.0"
+ glob-parent "^3.1.0"
+ globby "^8.0.1"
+ load-json-file "^4.0.0"
+ npmlog "^4.1.2"
+ p-map "^1.2.0"
+ resolve-from "^4.0.0"
+ write-json-file "^2.3.0"
+
+"@lerna/prompt@^3.3.1":
+ version "3.3.1"
+ resolved "https://registry.yarnpkg.com/@lerna/prompt/-/prompt-3.3.1.tgz#ec53f9034a7a02a671627241682947f65078ab88"
+ integrity sha512-eJhofrUCUaItMIH6et8kI7YqHfhjWqGZoTsE+40NRCfAraOMWx+pDzfRfeoAl3qeRAH2HhNj1bkYn70FbUOxuQ==
+ dependencies:
+ inquirer "^6.2.0"
+ npmlog "^4.1.2"
+
+"@lerna/publish@^3.4.3":
+ version "3.4.3"
+ resolved "https://registry.yarnpkg.com/@lerna/publish/-/publish-3.4.3.tgz#fb956ca2a871729982022889f90d0e8eb8528340"
+ integrity sha512-baeRL8xmOR25p86cAaS9mL0jdRzdv4dUo04PlK2Wes+YlL705F55cSXeC9npNie+9rGwFyLzCTQe18WdbZyLuw==
+ dependencies:
+ "@lerna/batch-packages" "^3.1.2"
+ "@lerna/check-working-tree" "^3.3.0"
+ "@lerna/child-process" "^3.3.0"
+ "@lerna/collect-updates" "^3.3.2"
+ "@lerna/command" "^3.3.0"
+ "@lerna/describe-ref" "^3.3.0"
+ "@lerna/get-npm-exec-opts" "^3.0.0"
+ "@lerna/npm-conf" "^3.4.1"
+ "@lerna/npm-dist-tag" "^3.3.0"
+ "@lerna/npm-publish" "^3.3.1"
+ "@lerna/output" "^3.0.0"
+ "@lerna/prompt" "^3.3.1"
+ "@lerna/run-lifecycle" "^3.4.1"
+ "@lerna/run-parallel-batches" "^3.0.0"
+ "@lerna/validation-error" "^3.0.0"
+ "@lerna/version" "^3.4.1"
+ fs-extra "^7.0.0"
+ libnpmaccess "^3.0.0"
+ npm-package-arg "^6.0.0"
+ npm-registry-fetch "^3.8.0"
+ npmlog "^4.1.2"
+ p-finally "^1.0.0"
+ p-map "^1.2.0"
+ p-pipe "^1.2.0"
+ p-reduce "^1.0.0"
+ semver "^5.5.0"
+
+"@lerna/resolve-symlink@^3.3.0":
+ version "3.3.0"
+ resolved "https://registry.yarnpkg.com/@lerna/resolve-symlink/-/resolve-symlink-3.3.0.tgz#c5d99a60cb17e2ea90b3521a0ba445478d194a44"
+ integrity sha512-KmoPDcFJ2aOK2inYHbrsiO9SodedUj0L1JDvDgirVNIjMUaQe2Q6Vi4Gh+VCJcyB27JtfHioV9R2NxU72Pk2hg==
+ dependencies:
+ fs-extra "^7.0.0"
+ npmlog "^4.1.2"
+ read-cmd-shim "^1.0.1"
+
+"@lerna/rimraf-dir@^3.3.0":
+ version "3.3.0"
+ resolved "https://registry.yarnpkg.com/@lerna/rimraf-dir/-/rimraf-dir-3.3.0.tgz#687e9bb3668a9e540e281302a52d9a573860f5db"
+ integrity sha512-vSqOcZ4kZduiSprbt+y40qziyN3VKYh+ygiCdnbBbsaxpdKB6CfrSMUtrLhVFrqUfBHIZRzHIzgjTdtQex1KLw==
+ dependencies:
+ "@lerna/child-process" "^3.3.0"
+ npmlog "^4.1.2"
+ path-exists "^3.0.0"
+ rimraf "^2.6.2"
+
+"@lerna/run-lifecycle@^3.4.1":
+ version "3.4.1"
+ resolved "https://registry.yarnpkg.com/@lerna/run-lifecycle/-/run-lifecycle-3.4.1.tgz#6d7e44eada31cb4ec78b18ef050da0d86f6c892b"
+ integrity sha512-N/hi2srM9A4BWEkXccP7vCEbf4MmIuALF00DTBMvc0A/ccItwUpl3XNuM7+ADDRK0mkwE3hDw89lJ3A7f8oUQw==
+ dependencies:
+ "@lerna/npm-conf" "^3.4.1"
+ npm-lifecycle "^2.0.0"
+ npmlog "^4.1.2"
+
+"@lerna/run-parallel-batches@^3.0.0":
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/@lerna/run-parallel-batches/-/run-parallel-batches-3.0.0.tgz#468704934084c74991d3124d80607857d4dfa840"
+ integrity sha512-Mj1ravlXF7AkkewKd9YFq9BtVrsStNrvVLedD/b2wIVbNqcxp8lS68vehXVOzoL/VWNEDotvqCQtyDBilCodGw==
+ dependencies:
+ p-map "^1.2.0"
+ p-map-series "^1.0.0"
+
+"@lerna/run@^3.3.2":
+ version "3.3.2"
+ resolved "https://registry.yarnpkg.com/@lerna/run/-/run-3.3.2.tgz#f521f4a22585c90758f34a584cb1871f8bb2a83e"
+ integrity sha512-cruwRGZZWnQ5I0M+AqcoT3Xpq2wj3135iVw4n59/Op6dZu50sMFXZNLiTTTZ15k8rTKjydcccJMdPSpTHbH7/A==
+ dependencies:
+ "@lerna/batch-packages" "^3.1.2"
+ "@lerna/command" "^3.3.0"
+ "@lerna/filter-options" "^3.3.2"
+ "@lerna/npm-run-script" "^3.3.0"
+ "@lerna/output" "^3.0.0"
+ "@lerna/run-parallel-batches" "^3.0.0"
+ "@lerna/validation-error" "^3.0.0"
+ p-map "^1.2.0"
+
+"@lerna/symlink-binary@^3.3.0":
+ version "3.3.0"
+ resolved "https://registry.yarnpkg.com/@lerna/symlink-binary/-/symlink-binary-3.3.0.tgz#99ea570b21baabd61ecab27582eeb1d7b2c5f9cf"
+ integrity sha512-zRo6CimhvH/VJqCFl9T4IC6syjpWyQIxEfO2sBhrapEcfwjtwbhoGgKwucsvt4rIpFazCw63jQ/AXMT27KUIHg==
+ dependencies:
+ "@lerna/create-symlink" "^3.3.0"
+ "@lerna/package" "^3.0.0"
+ fs-extra "^7.0.0"
+ p-map "^1.2.0"
+ read-pkg "^3.0.0"
+
+"@lerna/symlink-dependencies@^3.3.0":
+ version "3.3.0"
+ resolved "https://registry.yarnpkg.com/@lerna/symlink-dependencies/-/symlink-dependencies-3.3.0.tgz#13bcaed3e37986ab01b13498a459c7f609397dc3"
+ integrity sha512-IRngSNCmuD5uBKVv23tHMvr7Mplti0lKHilFKcvhbvhAfu6m/Vclxhkfs/uLyHzG+DeRpl/9o86SQET3h4XDhg==
+ dependencies:
+ "@lerna/create-symlink" "^3.3.0"
+ "@lerna/resolve-symlink" "^3.3.0"
+ "@lerna/symlink-binary" "^3.3.0"
+ fs-extra "^7.0.0"
+ p-finally "^1.0.0"
+ p-map "^1.2.0"
+ p-map-series "^1.0.0"
+
+"@lerna/validation-error@^3.0.0":
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/@lerna/validation-error/-/validation-error-3.0.0.tgz#a27e90051c3ba71995e2a800a43d94ad04b3e3f4"
+ integrity sha512-5wjkd2PszV0kWvH+EOKZJWlHEqCTTKrWsvfHnHhcUaKBe/NagPZFWs+0xlsDPZ3DJt5FNfbAPAnEBQ05zLirFA==
+ dependencies:
+ npmlog "^4.1.2"
+
"@lerna/validation-error@^3.0.0-beta.10":
version "3.0.0-beta.10"
resolved "http://registry.yarnpkg.com/@lerna%2fvalidation-error/-/validation-error-3.0.0-beta.10.tgz#cf5cbc39c4d27b89c6080e326de745f6fb7451ab"
@@ -905,6 +1190,41 @@
dependencies:
npmlog "^4.1.2"
+"@lerna/version@^3.4.1":
+ version "3.4.1"
+ resolved "https://registry.yarnpkg.com/@lerna/version/-/version-3.4.1.tgz#029448cccd3ccefb4d5f666933bd13cfb37edab0"
+ integrity sha512-oefNaQLBJSI2WLZXw5XxDXk4NyF5/ct0V9ys/J308NpgZthPgwRPjk9ZR0o1IOxW1ABi6z3E317W/dxHDjvAkg==
+ dependencies:
+ "@lerna/batch-packages" "^3.1.2"
+ "@lerna/check-working-tree" "^3.3.0"
+ "@lerna/child-process" "^3.3.0"
+ "@lerna/collect-updates" "^3.3.2"
+ "@lerna/command" "^3.3.0"
+ "@lerna/conventional-commits" "^3.4.1"
+ "@lerna/output" "^3.0.0"
+ "@lerna/prompt" "^3.3.1"
+ "@lerna/run-lifecycle" "^3.4.1"
+ "@lerna/validation-error" "^3.0.0"
+ chalk "^2.3.1"
+ dedent "^0.7.0"
+ minimatch "^3.0.4"
+ npmlog "^4.1.2"
+ p-map "^1.2.0"
+ p-pipe "^1.2.0"
+ p-reduce "^1.0.0"
+ p-waterfall "^1.0.0"
+ semver "^5.5.0"
+ slash "^1.0.0"
+ temp-write "^3.4.0"
+
+"@lerna/write-log-file@^3.0.0":
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/@lerna/write-log-file/-/write-log-file-3.0.0.tgz#2f95fee80c6821fe1ee6ccf8173d2b4079debbd2"
+ integrity sha512-SfbPp29lMeEVOb/M16lJwn4nnx5y+TwCdd7Uom9umd7KcZP0NOvpnX0PHehdonl7TyHZ1Xx2maklYuCLbQrd/A==
+ dependencies:
+ npmlog "^4.1.2"
+ write-file-atomic "^2.3.0"
+
"@loopback/dist-util@^0.3.6":
version "0.3.6"
resolved "https://registry.npmjs.org/@loopback/dist-util/-/dist-util-0.3.6.tgz#bd1d5887aa0f2bec41722f1d74fc19319d04e975"
@@ -959,6 +1279,13 @@
call-me-maybe "^1.0.1"
glob-to-regexp "^0.3.0"
+"@samverschueren/stream-to-observable@^0.3.0":
+ version "0.3.0"
+ resolved "https://registry.npmjs.org/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.0.tgz#ecdf48d532c58ea477acfcab80348424f8d0662f"
+ integrity sha512-MI4Xx6LHs4Webyvi6EbspgyAb4D2Q2VtnCQ1blOJcoLS6mVa8lNN2rkIy1CVxfTUpoyIbCTkXES1rLXztFD1lg==
+ dependencies:
+ any-observable "^0.3.0"
+
"@sinonjs/formatio@^2.0.0":
version "2.0.0"
resolved "http://registry.npmjs.org/@sinonjs/formatio/-/formatio-2.0.0.tgz#84db7e9eb5531df18a8c5e0bfb6e449e55e654b2"
@@ -966,6 +1293,23 @@
dependencies:
samsam "1.3.0"
+"@static/discharge@https://github.com/0xProject/discharge.git":
+ version "1.2.2"
+ resolved "https://github.com/0xProject/discharge.git#3aed990822cabbb79b71b52700fdef08cd9eb400"
+ dependencies:
+ aws-sdk "^2.347.0"
+ execa "^1.0.0"
+ glob "^7.1.3"
+ inquirer "^6.2.0"
+ listr "^0.14.2"
+ lodash.differenceby "^4.8.0"
+ lodash.intersectionby "^4.7.0"
+ lodash.intersectionwith "^4.4.0"
+ log-symbols "^2.2.0"
+ meow "^5.0.0"
+ mime "^2.3.1"
+ update-notifier "^2.5.0"
+
"@types/accounting@^0.4.1":
version "0.4.1"
resolved "https://registry.yarnpkg.com/@types/accounting/-/accounting-0.4.1.tgz#865d9f5694fd7c438fba34eb4bc82eec6f34cdd5"
@@ -1163,6 +1507,11 @@
resolved "https://registry.yarnpkg.com/@types/istanbul/-/istanbul-0.4.30.tgz#073159320ab3296b2cfeb481f756a1f8f4c9c8e4"
integrity sha512-+hQU4fh2G96ze78uI5/V6+SRDZD1UnVrFn23i2eDetwfbBq3s0/zYP92xj/3qyvVMM3WnvS88N56zjz+HmL04A==
+"@types/jest@^23.3.5":
+ version "23.3.5"
+ resolved "https://registry.npmjs.org/@types/jest/-/jest-23.3.5.tgz#870a1434208b60603745bfd214fc3fc675142364"
+ integrity sha512-3LI+vUC3Wju28vbjIjsTKakhMB8HC4l+tMz+Z8WRzVK+kmvezE5jcOvKtBpznWSI5KDLFo+FouUhpTKoekadCA==
+
"@types/js-combinatorics@^0.5.29":
version "0.5.29"
resolved "https://registry.yarnpkg.com/@types/js-combinatorics/-/js-combinatorics-0.5.29.tgz#47a7819a0b6925b6dc4bd2c2278a7e6329b29387"
@@ -1255,7 +1604,7 @@
dependencies:
"@types/node" "*"
-"@types/mocha@^2.2.42", "@types/mocha@^2.2.48":
+"@types/mocha@^2.2.42":
version "2.2.48"
resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-2.2.48.tgz#3523b126a0b049482e1c3c11877460f76622ffab"
integrity sha512-nlK/iyETgafGli8Zh9zJVCTicvU3iajSkRwOh3Hhiva598CMqNJ4NcVCGMTGKpGpTYj/9R8RLzS9NAykSSCqGw==
@@ -1265,28 +1614,11 @@
resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-5.2.3.tgz#11f3a5629d67cd444fa6c94536576244e6a52ea9"
integrity sha512-C1wVVr7xhKu6c3Mb27dFzNYR05qvHwgtpN+JOYTGc1pKA7dCEDDYpscn7kul+bCUwa3NoGDbzI1pdznSOa397w==
-"@types/newman@^3.9.0":
- version "3.9.0"
- resolved "https://registry.npmjs.org/@types/newman/-/newman-3.9.0.tgz#f46427e8f633545dd94e8df0c251e22145f88227"
- integrity sha512-FhAcHd0TPyr5uBc5hSgPYHaFcI4TEj0Fw8be+A3nbUz/rB/2ma/X+OW6blarFV5jo4UpCLe/stp/jlFOApZZyQ==
-
-"@types/nock@^9.1.2":
- version "9.1.3"
- resolved "https://registry.yarnpkg.com/@types/nock/-/nock-9.1.3.tgz#1d445679375b9e25afd449dc56585f81729454e8"
- integrity sha512-S8rJ+SaW82ICX87pZP62UcMifrMfjEdqNzSp+llx4YcvKw6bO650Ye6HwTqER1Dar3S40GIZECQisOrAICDCjA==
- dependencies:
- "@types/node" "*"
-
"@types/node@*":
version "9.6.5"
resolved "https://registry.yarnpkg.com/@types/node/-/node-9.6.5.tgz#ee700810fdf49ac1c399fc5980b7559b3e5a381d"
integrity sha512-NOLEgsT6UiDTjnWG5Hd2Mg25LRyz/oe8ql3wbjzgSFeRzRROhPmtlsvIrei4B46UjERF0td9SZ1ZXPLOdcrBHg==
-"@types/node@9.6.0":
- version "9.6.0"
- resolved "https://registry.yarnpkg.com/@types/node/-/node-9.6.0.tgz#d3480ee666df9784b1001a1872a2f6ccefb6c2d7"
- integrity sha512-h3YZbOq2+ZoDFI1z8Zx0Ck/xRWkOESVaLdgLdd/c25mMQ1Y2CAkILu9ny5A15S5f32gGcQdaUIZ2jzYr8D7IFg==
-
"@types/node@^10.3.2":
version "10.9.4"
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.9.4.tgz#0f4cb2dc7c1de6096055357f70179043c33e9897"
@@ -1297,11 +1629,6 @@
resolved "https://registry.npmjs.org/@types/node/-/node-10.5.7.tgz#960d9feb3ade2233bcc9843c918d740b4f78a7cf"
integrity sha512-VkKcfuitP+Nc/TaTFH0B8qNmn+6NbI6crLkQonbedViVz7O2w8QV/GERPlkJ4bg42VGHiEWa31CoTOPs1q6z1w==
-"@types/node@^8.0.53":
- version "8.10.8"
- resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.8.tgz#794cba23cc9f8d9715f6543fa8827433b5f5cd3b"
- integrity sha512-BvcUxNZe9JgiiUVivtiQt3NrPVu9OAQzkxR1Ko9ESftCYU7V6Np5kpDzQwxd+34lsop7SNRdL292Flv52OvCaw==
-
"@types/numeral@^0.0.22":
version "0.0.22"
resolved "https://registry.yarnpkg.com/@types/numeral/-/numeral-0.0.22.tgz#86bef1f0a2d743afdc2ef3168d45f2905e1a0b93"
@@ -1517,9 +1844,17 @@
resolved "https://registry.npmjs.org/@types/solidity-parser-antlr/-/solidity-parser-antlr-0.2.1.tgz#29ff386773a72a06c8a9c40c666d2a1cea53c2ed"
integrity sha512-fGa4xlSextuifvmX/ezhPhmeKrb6rDjSNlTwF4Vp0I5x8Fo6a90fzWpuaiUPqpoWvqYEbrM3N+pBkK+hJGeN6w==
+"@types/styled-components@^4.0.0":
+ version "4.0.3"
+ resolved "https://registry.yarnpkg.com/@types/styled-components/-/styled-components-4.0.3.tgz#8287e54e446302369eecc521243a2f32cf9122ee"
+ integrity sha512-LzntHlOKEOxUxMkVmQPNG88TsldeHO2NlwNkzHnw4wL8qhHQgd7u+u3yw84hZgoFh4ugsLCbFtjYcbP7v5WC5Q==
+ dependencies:
+ "@types/node" "*"
+ "@types/react" "*"
+
"@types/styled-components@^4.0.1":
version "4.0.1"
- resolved "https://registry.yarnpkg.com/@types/styled-components/-/styled-components-4.0.1.tgz#5eb9a5474dbde3becab2bcc8f04e0b8e8dcf8c06"
+ resolved "https://registry.npmjs.org/@types/styled-components/-/styled-components-4.0.1.tgz#5eb9a5474dbde3becab2bcc8f04e0b8e8dcf8c06"
integrity sha512-y6BV+wMRengSgc5GiMi2xwT8VqjgrZFF+x/OForTnIX/VMoYvZY+Kk6mUOeGBscVaUfiAU9PU0YLsKS2y8mP9A==
dependencies:
"@types/node" "*"
@@ -1579,7 +1914,7 @@
"@types/events" "*"
"@types/node" "*"
-"@types/yargs@10.0.2", "@types/yargs@^10.0.0":
+"@types/yargs@^10.0.0":
version "10.0.2"
resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-10.0.2.tgz#cc4ea921877874d1261e2c44b89807bc836e1b12"
integrity sha512-VbsIazac1gy20qTjEZVgDUhs8uuVmGbFkSGcdHpcMoXSC4+0vn/PRHz9YBqpgxKwUi8qoxf3eHff07w7aKNBOg==
@@ -1750,6 +2085,14 @@ JSONStream@^1.0.4:
jsonparse "^1.2.0"
through ">=2.2.7 <3"
+JSONStream@^1.3.4:
+ version "1.3.5"
+ resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0"
+ integrity sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==
+ dependencies:
+ jsonparse "^1.2.0"
+ through ">=2.2.7 <3"
+
abab@^2.0.0:
version "2.0.0"
resolved "https://registry.npmjs.org/abab/-/abab-2.0.0.tgz#aba0ab4c5eee2d4c79d3487d85450fb2376ebb0f"
@@ -1880,13 +2223,20 @@ aes-js@^0.2.3:
resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-0.2.4.tgz#94b881ab717286d015fa219e08fb66709dda5a3d"
integrity sha1-lLiBq3FyhtAV+iGeCPtmcJ3aWj0=
-agent-base@^4.1.0:
+agent-base@4, agent-base@^4.1.0, agent-base@~4.2.0:
version "4.2.1"
resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.1.tgz#d89e5999f797875674c07d87f260fc41e83e8ca9"
integrity sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg==
dependencies:
es6-promisify "^5.0.0"
+agentkeepalive@^3.4.1:
+ version "3.5.1"
+ resolved "https://registry.yarnpkg.com/agentkeepalive/-/agentkeepalive-3.5.1.tgz#4eba75cf2ad258fc09efd506cdb8d8c2971d35a4"
+ integrity sha512-Cte/sTY9/XcygXjJ0q58v//SnEQ7ViWExKyJpLJlLqomDbQyMLh6Is4KuWJ/wmxzhiwkGRple7Gqv1zf6Syz5w==
+ dependencies:
+ humanize-ms "^1.2.1"
+
ajv-errors@^1.0.0:
version "1.0.0"
resolved "https://registry.npmjs.org/ajv-errors/-/ajv-errors-1.0.0.tgz#ecf021fa108fd17dfb5e6b383f2dd233e31ffc59"
@@ -2025,6 +2375,11 @@ antlr4@4.7.0:
resolved "https://registry.yarnpkg.com/antlr4/-/antlr4-4.7.0.tgz#297f956ddc06f83397fc0990ecf2e0cf20bfbbee"
integrity sha1-KX+VbdwG+DOX/AmQ7PLgzyC/u+4=
+any-observable@^0.3.0:
+ version "0.3.0"
+ resolved "https://registry.npmjs.org/any-observable/-/any-observable-0.3.0.tgz#af933475e5806a67d0d7df090dd5e8bef65d119b"
+ integrity sha512-/FQM1EDkTsf63Ub2C6O7GuYFDsSXUwsaZDurV0np41ocwq0jthUAYCmhBX9f+KwlaCgIuWyr/4WlUQUBfKfZog==
+
any-promise@1.3.0, any-promise@^1.0.0, any-promise@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f"
@@ -2065,6 +2420,11 @@ aproba@^1.0.3, aproba@^1.1.1:
resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a"
integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==
+aproba@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/aproba/-/aproba-2.0.0.tgz#52520b8ae5b569215b354efc0caa3fe1e45a8adc"
+ integrity sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==
+
archy@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/archy/-/archy-1.0.0.tgz#f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40"
@@ -2289,18 +2649,18 @@ async@1.x, async@^1.4.0, async@^1.4.2, async@^1.5.2:
resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a"
integrity sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=
-async@2.6.0, async@^2.0.1, async@^2.1.2, async@^2.4.0, async@^2.5.0, async@^2.6.0:
+async@^0.9.0, async@~0.9.0:
+ version "0.9.2"
+ resolved "https://registry.yarnpkg.com/async/-/async-0.9.2.tgz#aea74d5e61c1f899613bf64bda66d4c78f2fd17d"
+ integrity sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0=
+
+async@^2.0.1, async@^2.1.2, async@^2.4.0, async@^2.5.0, async@^2.6.0:
version "2.6.0"
resolved "https://registry.yarnpkg.com/async/-/async-2.6.0.tgz#61a29abb6fcc026fea77e56d1c6ec53a795951f4"
integrity sha512-xAfGg1/NTLBBKlHFmnd7PlmUW9KhVQIUuSrYem9xzFUZy13ScvtyGGejaae9iAVRiRq9+Cx7DPFaAAhCpyxyPw==
dependencies:
lodash "^4.14.0"
-async@^0.9.0, async@~0.9.0:
- version "0.9.2"
- resolved "https://registry.yarnpkg.com/async/-/async-0.9.2.tgz#aea74d5e61c1f899613bf64bda66d4c78f2fd17d"
- integrity sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0=
-
async@^2.1.4:
version "2.6.1"
resolved "https://registry.npmjs.org/async/-/async-2.6.1.tgz#b245a23ca71930044ec53fa46aa00a3e87c6a610"
@@ -2369,6 +2729,21 @@ aws-sdk@^2.127.0:
uuid "3.1.0"
xml2js "0.4.19"
+aws-sdk@^2.347.0:
+ version "2.348.0"
+ resolved "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.348.0.tgz#69c5b6dd77a5eac85b54bf7cc1640c19d762d3ee"
+ integrity sha512-TfguapuOAwk7EG8zhYJPjkCaF4tyGjfgcXLkYbWbuS4O6E8pn0x2K5Yt1KXwLiWxG0fzKCLiiaNA5H7bKAP4YQ==
+ dependencies:
+ buffer "4.9.1"
+ events "1.1.1"
+ ieee754 "1.1.8"
+ jmespath "0.15.0"
+ querystring "0.2.0"
+ sax "1.2.1"
+ url "0.10.3"
+ uuid "3.1.0"
+ xml2js "0.4.19"
+
aws-sign2@~0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.6.0.tgz#14342dd38dbcc94d0e5b87d763cd63612c0e794f"
@@ -2379,11 +2754,6 @@ aws-sign2@~0.7.0:
resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8"
integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=
-aws4@1.6.0:
- version "1.6.0"
- resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e"
- integrity sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=
-
aws4@^1.2.1, aws4@^1.6.0:
version "1.7.0"
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.7.0.tgz#d4d0e9b9dbfca77bf08eeb0a8a471550fe39e289"
@@ -2641,7 +3011,7 @@ babel-plugin-react-svg@^2.1.0:
"babel-plugin-styled-components@>= 1":
version "1.8.0"
- resolved "https://registry.yarnpkg.com/babel-plugin-styled-components/-/babel-plugin-styled-components-1.8.0.tgz#9dd054c8e86825203449a852a5746f29f2dab857"
+ resolved "https://registry.npmjs.org/babel-plugin-styled-components/-/babel-plugin-styled-components-1.8.0.tgz#9dd054c8e86825203449a852a5746f29f2dab857"
integrity sha512-PcrdbXFO/9Plo9JURIj8G0Dsz+Ct8r+NvjoLh6qPt8Y/3EIAj1gHGW1ocPY1IkQbXZLBEZZSRBAxJem1KFdBXg==
dependencies:
"@babel/helper-annotate-as-pure" "^7.0.0"
@@ -3270,7 +3640,7 @@ bindings@^1.2.1, bindings@^1.3.0:
resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.3.0.tgz#b346f6ecf6a95f5a815c5839fc7cdb22502f1ed7"
integrity sha512-DpLh5EzMR2kzvX1KIlVC0VkC3iZtHKTgdtZ0a3pglBZdaQFjt5S9g9xd1lE+YvXyfd6mtCeRnrUfOLYiTMlNSw==
-bintrees@1.0.2, bintrees@^1.0.2:
+bintrees@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/bintrees/-/bintrees-1.0.2.tgz#49f896d6e858a4a499df85c38fb399b9aff840f8"
integrity sha1-SfiW1uhYpKSZ34XDj7OZua/4QPg=
@@ -3358,7 +3728,7 @@ blockies@^0.0.2:
resolved "https://registry.yarnpkg.com/blockies/-/blockies-0.0.2.tgz#22ad58da4f6b382bc79bf4386c5820c70047e4ed"
integrity sha1-Iq1Y2k9rOCvHm/Q4bFggxwBH5O0=
-bluebird@^2.6.2, bluebird@^2.9.24, bluebird@^2.9.34:
+bluebird@^2.9.24, bluebird@^2.9.34:
version "2.11.0"
resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-2.11.0.tgz#534b9033c022c9579c56ba3b3e5a5caafbb650e1"
integrity sha1-U0uQM8AiyVecVro7Plpcqvu2UOE=
@@ -3663,11 +4033,6 @@ bser@^2.0.0:
dependencies:
node-int64 "^0.4.0"
-btoa@1.1.2:
- version "1.1.2"
- resolved "https://registry.yarnpkg.com/btoa/-/btoa-1.1.2.tgz#3e40b81663f81d2dd6596a4cb714a8dc16cfabe0"
- integrity sha1-PkC4FmP4HS3WWWpMtxSo3BbPq+A=
-
buffer-compare@=1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/buffer-compare/-/buffer-compare-1.1.1.tgz#5be7be853af89198d1f4ddc090d1d66a48aef596"
@@ -3782,6 +4147,11 @@ byline@^5.0.0:
resolved "http://registry.yarnpkg.com/byline/-/byline-5.0.0.tgz#741c5216468eadc457b03410118ad77de8c1ddb1"
integrity sha1-dBxSFkaOrcRXsDQQEYrXfejB3bE=
+byte-size@^4.0.3:
+ version "4.0.3"
+ resolved "https://registry.yarnpkg.com/byte-size/-/byte-size-4.0.3.tgz#b7c095efc68eadf82985fccd9a2df43a74fa2ccd"
+ integrity sha512-JGC3EV2bCzJH/ENSh3afyJrH4vwxbHTuO5ljLoI5+2iJOcEpMgP8T782jH9b5qGxf2mSUIp1lfGnfKNrRHpvVg==
+
bytes@3.0.0, bytes@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048"
@@ -3821,7 +4191,7 @@ cacache@^10.0.4:
unique-filename "^1.1.0"
y18n "^4.0.0"
-cacache@^11.0.2, cacache@^11.2.0:
+cacache@^11.0.1, cacache@^11.0.2, cacache@^11.2.0:
version "11.2.0"
resolved "https://registry.yarnpkg.com/cacache/-/cacache-11.2.0.tgz#617bdc0b02844af56310e411c0878941d5739965"
integrity sha512-IFWl6lfK6wSeYCHUXh+N1lY72UDrpyrYQJNIVQf48paDuWbv5RbAtJYf/4gUQFObTCHZwdZ5sI8Iw7nqwP6nlQ==
@@ -4023,16 +4393,7 @@ chain-function@^1.0.0:
resolved "https://registry.yarnpkg.com/chain-function/-/chain-function-1.0.0.tgz#0d4ab37e7e18ead0bdc47b920764118ce58733dc"
integrity sha1-DUqzfn4Y6tC9xHuSB2QRjOWHM9w=
-chalk@2.3.2:
- version "2.3.2"
- resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.2.tgz#250dc96b07491bfd601e648d66ddf5f60c7a5c65"
- integrity sha512-ZM4j2/ld/YZDc3Ma8PgN7gyAk+kHMMMyzLNryCPGhWrsfAuDVeuid5bpRFTDgMH9JBK2lA4dyyAkkZYF/WcqDQ==
- dependencies:
- ansi-styles "^3.2.1"
- escape-string-regexp "^1.0.5"
- supports-color "^5.3.0"
-
-chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3:
+chalk@^1.0.0, chalk@^1.1.1, chalk@^1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98"
integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=
@@ -4110,10 +4471,10 @@ chardet@^0.4.0:
resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2"
integrity sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=
-charset@^1.0.0:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/charset/-/charset-1.0.1.tgz#8d59546c355be61049a8fa9164747793319852bd"
- integrity sha512-6dVyOOYjpfFcL1Y4qChrAoQLRHvj2ziyhcm0QJlhOcAhykL/k1kTUPbeo+87MNRTRdk2OIIsIXbuF3x2wi5EXg==
+chardet@^0.7.0:
+ version "0.7.0"
+ resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e"
+ integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==
check-error@^1.0.1, check-error@^1.0.2:
version "1.0.2"
@@ -4216,11 +4577,6 @@ cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3:
inherits "^2.0.1"
safe-buffer "^5.0.1"
-circular-json@0.3.1:
- version "0.3.1"
- resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.1.tgz#be8b36aefccde8b3ca7aa2d6afc07a37242c0d2d"
- integrity sha1-vos2rvzN6LPKeqLWr8B6NyQsDS0=
-
circular-json@^0.3.1:
version "0.3.3"
resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.3.tgz#815c99ea84f6809529d2f45791bdf82711352d66"
@@ -4286,28 +4642,11 @@ cli-cursor@^2.1.0:
dependencies:
restore-cursor "^2.0.0"
-cli-progress@1.7.0:
- version "1.7.0"
- resolved "https://registry.yarnpkg.com/cli-progress/-/cli-progress-1.7.0.tgz#401cdfeacc1a34afc281b4bdf88829236724c92f"
- integrity sha512-YPymXb0VtiOZf4DwA91JiYT1jDFuoq7iZcA2KpSMqEHnQQDarHJtN1hUOk/oHiDRShw1pWy6SIyHJgb5tqpV9A==
- dependencies:
- colors "^1.1.2"
-
cli-spinners@^0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-0.1.2.tgz#bb764d88e185fb9e1e6a2a1f19772318f605e31c"
integrity sha1-u3ZNiOGF+54eaiofGXcjGPYF4xw=
-cli-table2@0.2.0:
- version "0.2.0"
- resolved "https://registry.yarnpkg.com/cli-table2/-/cli-table2-0.2.0.tgz#2d1ef7f218a0e786e214540562d4bd177fe32d97"
- integrity sha1-LR738hig54biFFQFYtS9F3/jLZc=
- dependencies:
- lodash "^3.10.1"
- string-width "^1.0.1"
- optionalDependencies:
- colors "^1.1.2"
-
cli-truncate@^0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-0.2.1.tgz#9f15cfbb0705005369216c626ac7d05ab90dd574"
@@ -4499,16 +4838,16 @@ colors@1.0.x:
resolved "https://registry.yarnpkg.com/colors/-/colors-1.0.3.tgz#0433f44d809680fdeb60ed260f1b0c262e82a40b"
integrity sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=
-colors@1.1.2, colors@~1.1.2:
- version "1.1.2"
- resolved "https://registry.yarnpkg.com/colors/-/colors-1.1.2.tgz#168a4701756b6a7f51a12ce0c97bfa28c084ed63"
- integrity sha1-FopHAXVran9RoSzgyXv6KMCE7WM=
-
colors@^1.1.2:
version "1.2.1"
resolved "https://registry.yarnpkg.com/colors/-/colors-1.2.1.tgz#f4a3d302976aaf042356ba1ade3b1a2c62d9d794"
integrity sha512-s8+wktIuDSLffCywiwSxQOMqtPxML11a/dtHE17tMn4B1MSWw/C22EKf7M2KGUBcDaVFEGT+S8N02geDXeuNKg==
+colors@~1.1.2:
+ version "1.1.2"
+ resolved "https://registry.yarnpkg.com/colors/-/colors-1.1.2.tgz#168a4701756b6a7f51a12ce0c97bfa28c084ed63"
+ integrity sha1-FopHAXVran9RoSzgyXv6KMCE7WM=
+
columnify@^1.5.4:
version "1.5.4"
resolved "http://registry.yarnpkg.com/columnify/-/columnify-1.5.4.tgz#4737ddf1c7b69a8a7c340570782e947eec8e78bb"
@@ -4529,16 +4868,6 @@ commander@2.11.0:
resolved "https://registry.yarnpkg.com/commander/-/commander-2.11.0.tgz#157152fd1e7a6c8d98a5b715cf376df928004563"
integrity sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==
-commander@2.12.2:
- version "2.12.2"
- resolved "https://registry.yarnpkg.com/commander/-/commander-2.12.2.tgz#0f5946c427ed9ec0d91a46bb9def53e54650e555"
- integrity sha512-BFnaq5ZOGcDN7FlrtBT4xxkgIToalIIxwjxLWVJ8bGTpe1LroqMiqQXdA7ygc7CRvaYS+9zfPGFnJqFSayx+AA==
-
-commander@2.13.0, commander@~2.13.0:
- version "2.13.0"
- resolved "https://registry.yarnpkg.com/commander/-/commander-2.13.0.tgz#6964bca67685df7c1f1430c584f07d7597885b9c"
- integrity sha512-MVuS359B+YzaWqjCL/c+22gfryv+mCBPHAv3zyVI2GN8EY6IRP8VwtasXn8jyyhvvq84R4ImN1OKRtcbIasjYA==
-
commander@2.15.1, commander@^2.12.1, commander@^2.8.1:
version "2.15.1"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f"
@@ -4554,6 +4883,11 @@ commander@^2.15.1, commander@^2.18.0:
resolved "https://registry.yarnpkg.com/commander/-/commander-2.19.0.tgz#f6198aa84e5b83c46054b94ddedbfed5ee9ff12a"
integrity sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==
+commander@~2.13.0:
+ version "2.13.0"
+ resolved "https://registry.yarnpkg.com/commander/-/commander-2.13.0.tgz#6964bca67685df7c1f1430c584f07d7597885b9c"
+ integrity sha512-MVuS359B+YzaWqjCL/c+22gfryv+mCBPHAv3zyVI2GN8EY6IRP8VwtasXn8jyyhvvq84R4ImN1OKRtcbIasjYA==
+
commander@~2.8.1:
version "2.8.1"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.8.1.tgz#06be367febfda0c330aa1e2a072d3dc9762425d4"
@@ -4701,6 +5035,14 @@ conventional-changelog-angular@^1.6.6:
compare-func "^1.3.1"
q "^1.5.1"
+conventional-changelog-angular@^5.0.1:
+ version "5.0.1"
+ resolved "https://registry.yarnpkg.com/conventional-changelog-angular/-/conventional-changelog-angular-5.0.1.tgz#f96431b76de453333a909decd02b15cb5bd2d364"
+ integrity sha512-q4ylJ68fWZDdrFC9z4zKcf97HW6hp7Mo2YlqD4owfXhecFKy/PJCU/1oVFF4TqochchChqmZ0Vb0e0g8/MKNlA==
+ dependencies:
+ compare-func "^1.3.1"
+ q "^1.5.1"
+
conventional-changelog-core@^2.0.5:
version "2.0.11"
resolved "http://registry.yarnpkg.com/conventional-changelog-core/-/conventional-changelog-core-2.0.11.tgz#19b5fbd55a9697773ed6661f4e32030ed7e30287"
@@ -4720,11 +5062,35 @@ conventional-changelog-core@^2.0.5:
read-pkg-up "^1.0.1"
through2 "^2.0.0"
+conventional-changelog-core@^3.1.0:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/conventional-changelog-core/-/conventional-changelog-core-3.1.0.tgz#96a81bb3301b4b2a3dc2851cc54c5fb674ac1942"
+ integrity sha512-bcZkcFXkqVgG2W8m/1wjlp2wn/BKDcrPgw3/mvSEQtzs8Pax8JbAPFpEQReHY92+EKNNXC67wLA8y2xcNx0rDA==
+ dependencies:
+ conventional-changelog-writer "^4.0.0"
+ conventional-commits-parser "^3.0.0"
+ dateformat "^3.0.0"
+ get-pkg-repo "^1.0.0"
+ git-raw-commits "^2.0.0"
+ git-remote-origin-url "^2.0.0"
+ git-semver-tags "^2.0.0"
+ lodash "^4.2.1"
+ normalize-package-data "^2.3.5"
+ q "^1.5.1"
+ read-pkg "^1.1.0"
+ read-pkg-up "^1.0.1"
+ through2 "^2.0.0"
+
conventional-changelog-preset-loader@^1.1.8:
version "1.1.8"
resolved "http://registry.yarnpkg.com/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-1.1.8.tgz#40bb0f142cd27d16839ec6c74ee8db418099b373"
integrity sha512-MkksM4G4YdrMlT2MbTsV2F6LXu/hZR0Tc/yenRrDIKRwBl/SP7ER4ZDlglqJsCzLJi4UonBc52Bkm5hzrOVCcw==
+conventional-changelog-preset-loader@^2.0.1:
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-2.0.1.tgz#d134734e0cc1b91b88b30586c5991f31442029f1"
+ integrity sha512-HiSfhXNzAzG9klIqJaA97MMiNBR4js+53g4Px0k7tgKeCNVXmrDrm+CY+nIqcmG5NVngEPf8rAr7iji1TWW7zg==
+
conventional-changelog-writer@^3.0.9:
version "3.0.9"
resolved "http://registry.yarnpkg.com/conventional-changelog-writer/-/conventional-changelog-writer-3.0.9.tgz#4aecdfef33ff2a53bb0cf3b8071ce21f0e994634"
@@ -4741,6 +5107,22 @@ conventional-changelog-writer@^3.0.9:
split "^1.0.0"
through2 "^2.0.0"
+conventional-changelog-writer@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/conventional-changelog-writer/-/conventional-changelog-writer-4.0.0.tgz#3ed983c8ef6a3aa51fe44e82c9c75e86f1b5aa42"
+ integrity sha512-hMZPe0AQ6Bi05epeK/7hz80xxk59nPA5z/b63TOHq2wigM0/akreOc8N4Jam5b9nFgKWX1e9PdPv2ewgW6bcfg==
+ dependencies:
+ compare-func "^1.3.1"
+ conventional-commits-filter "^2.0.0"
+ dateformat "^3.0.0"
+ handlebars "^4.0.2"
+ json-stringify-safe "^5.0.1"
+ lodash "^4.2.1"
+ meow "^4.0.0"
+ semver "^5.5.0"
+ split "^1.0.0"
+ through2 "^2.0.0"
+
conventional-commits-filter@^1.1.6:
version "1.1.6"
resolved "http://registry.yarnpkg.com/conventional-commits-filter/-/conventional-commits-filter-1.1.6.tgz#4389cd8e58fe89750c0b5fb58f1d7f0cc8ad3831"
@@ -4749,6 +5131,14 @@ conventional-commits-filter@^1.1.6:
is-subset "^0.1.1"
modify-values "^1.0.0"
+conventional-commits-filter@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/conventional-commits-filter/-/conventional-commits-filter-2.0.0.tgz#a0ce1d1ff7a1dd7fab36bee8e8256d348d135651"
+ integrity sha512-Cfl0j1/NquB/TMVx7Wrmyq7uRM+/rPQbtVVGwzfkhZ6/yH6fcMmP0Q/9044TBZPTNdGzm46vXFXL14wbET0/Mg==
+ dependencies:
+ is-subset "^0.1.1"
+ modify-values "^1.0.0"
+
conventional-commits-parser@^2.1.7:
version "2.1.7"
resolved "http://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-2.1.7.tgz#eca45ed6140d72ba9722ee4132674d639e644e8e"
@@ -4762,6 +5152,19 @@ conventional-commits-parser@^2.1.7:
through2 "^2.0.0"
trim-off-newlines "^1.0.0"
+conventional-commits-parser@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-3.0.0.tgz#7f604549a50bd8f60443fbe515484b1c2f06a5c4"
+ integrity sha512-GWh71U26BLWgMykCp+VghZ4s64wVbtseECcKQ/PvcPZR2cUnz+FUc2J9KjxNl7/ZbCxST8R03c9fc+Vi0umS9Q==
+ dependencies:
+ JSONStream "^1.0.4"
+ is-text-path "^1.0.0"
+ lodash "^4.2.1"
+ meow "^4.0.0"
+ split2 "^2.0.0"
+ through2 "^2.0.0"
+ trim-off-newlines "^1.0.0"
+
conventional-recommended-bump@^2.0.6:
version "2.0.9"
resolved "http://registry.yarnpkg.com/conventional-recommended-bump/-/conventional-recommended-bump-2.0.9.tgz#7392421e7d0e3515f3df2040572a23cc73a68a93"
@@ -4776,6 +5179,20 @@ conventional-recommended-bump@^2.0.6:
meow "^4.0.0"
q "^1.5.1"
+conventional-recommended-bump@^4.0.1:
+ version "4.0.1"
+ resolved "https://registry.yarnpkg.com/conventional-recommended-bump/-/conventional-recommended-bump-4.0.1.tgz#304a45a412cfec050a10ea2e7e4a89320eaf3991"
+ integrity sha512-9waJvW01TUs4HQJ3khwGSSlTlKsY+5u7OrxHL+oWEoGNvaNO/0qL6qqnhS3J0Fq9fNKA9bmlf5cOXjCQoW+I4Q==
+ dependencies:
+ concat-stream "^1.6.0"
+ conventional-changelog-preset-loader "^2.0.1"
+ conventional-commits-filter "^2.0.0"
+ conventional-commits-parser "^3.0.0"
+ git-raw-commits "^2.0.0"
+ git-semver-tags "^2.0.0"
+ meow "^4.0.0"
+ q "^1.5.1"
+
convert-source-map@^1.4.0:
version "1.6.0"
resolved "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz#51b537a8c43e0f04dec1993bffcdd504e758ac20"
@@ -4815,9 +5232,9 @@ copy-descriptor@^0.1.0:
resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d"
integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=
-copy-to-clipboard@^3:
+copy-to-clipboard@^3, copy-to-clipboard@^3.0.8:
version "3.0.8"
- resolved "https://registry.yarnpkg.com/copy-to-clipboard/-/copy-to-clipboard-3.0.8.tgz#f4e82f4a8830dce4666b7eb8ded0c9bcc313aba9"
+ resolved "https://registry.npmjs.org/copy-to-clipboard/-/copy-to-clipboard-3.0.8.tgz#f4e82f4a8830dce4666b7eb8ded0c9bcc313aba9"
integrity sha512-c3GdeY8qxCHGezVb1EFQfHYK/8NZRemgcTIzPq7PuxjHAf/raKibn2QdhHPb/y6q74PMgH6yizaDZlRmw6QyKw==
dependencies:
toggle-selection "^1.0.3"
@@ -4836,18 +5253,6 @@ copy-webpack-plugin@^4.5.4:
p-limit "^1.0.0"
serialize-javascript "^1.4.0"
-copyfiles@^1.2.0:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/copyfiles/-/copyfiles-1.2.0.tgz#a8da3ac41aa2220ae29bd3c58b6984294f2c593c"
- integrity sha1-qNo6xBqiIgrim9PFi2mEKU8sWTw=
- dependencies:
- glob "^7.0.5"
- ltcdr "^2.2.1"
- minimatch "^3.0.3"
- mkdirp "^0.5.1"
- noms "0.0.0"
- through2 "^2.0.1"
-
copyfiles@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/copyfiles/-/copyfiles-2.0.0.tgz#bbd78bb78e8fd6db5c67adf54249317b24560f2a"
@@ -5016,16 +5421,16 @@ crypto-browserify@3.12.0, crypto-browserify@^3.11.0:
randombytes "^2.0.0"
randomfill "^1.0.3"
-crypto-js@3.1.9-1, crypto-js@^3.1.9-1:
- version "3.1.9-1"
- resolved "https://registry.yarnpkg.com/crypto-js/-/crypto-js-3.1.9-1.tgz#fda19e761fc077e01ffbfdc6e9fdfc59e8806cd8"
- integrity sha1-/aGedh/Ad+Af+/3G6f38WeiAbNg=
-
crypto-js@^3.1.4, crypto-js@^3.1.5:
version "3.1.8"
resolved "https://registry.yarnpkg.com/crypto-js/-/crypto-js-3.1.8.tgz#715f070bf6014f2ae992a98b3929258b713f08d5"
integrity sha1-cV8HC/YBTyrpkqmLOSkli3E/CNU=
+crypto-js@^3.1.9-1:
+ version "3.1.9-1"
+ resolved "https://registry.yarnpkg.com/crypto-js/-/crypto-js-3.1.9-1.tgz#fda19e761fc077e01ffbfdc6e9fdfc59e8806cd8"
+ integrity sha1-/aGedh/Ad+Af+/3G6f38WeiAbNg=
+
crypto-random-string@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-1.0.0.tgz#a230f64f568310e1498009940790ec99545bca7e"
@@ -5104,7 +5509,7 @@ css-to-react-native@^2.0.3:
css-to-react-native@^2.2.2:
version "2.2.2"
- resolved "https://registry.yarnpkg.com/css-to-react-native/-/css-to-react-native-2.2.2.tgz#c077d0f7bf3e6c915a539e7325821c9dd01f9965"
+ resolved "https://registry.npmjs.org/css-to-react-native/-/css-to-react-native-2.2.2.tgz#c077d0f7bf3e6c915a539e7325821c9dd01f9965"
integrity sha512-w99Fzop1FO8XKm0VpbQp3y5mnTnaS+rtCvS+ylSEOK76YXO5zoHQx/QMB1N54Cp+Ya9jB9922EHrh14ld4xmmw==
dependencies:
css-color-keywords "^1.0.0"
@@ -5219,11 +5624,6 @@ csstype@^2.2.0:
resolved "https://registry.yarnpkg.com/csstype/-/csstype-2.4.2.tgz#158e36c69566bf968da63d0ba14eda1c20e8643a"
integrity sha512-1TnkyZwDy0oUl//6685j2bTMNe61SzntWntijNdmmEzvpYbGmVMZkj204gv4glcQp6z/ypg+YRziT91XVFmOyg==
-csv-parse@1.2.4:
- version "1.2.4"
- resolved "https://registry.yarnpkg.com/csv-parse/-/csv-parse-1.2.4.tgz#cbf676e355226625888c6432400b83f07e75cc2e"
- integrity sha512-Mv4Ly6mshOHEIlnVGB/PZtDCT+vyvyCs5Qae/lLeAIlKNR4W7TkmSGmB10uPm7aJQYcTO/rswLzUcYu6wFlAYg==
-
currently-unhandled@^0.4.1:
version "0.4.1"
resolved "https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea"
@@ -5296,11 +5696,6 @@ dateformat@^3.0.0:
resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae"
integrity sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==
-dbug@~0.4.2:
- version "0.4.2"
- resolved "https://registry.yarnpkg.com/dbug/-/dbug-0.4.2.tgz#32b4b3105e8861043a6f9ac755d80e542d365b31"
- integrity sha1-MrSzEF6IYQQ6b5rHVdgOVC02WzE=
-
debounce@^1.1.0:
version "1.2.0"
resolved "https://registry.npmjs.org/debounce/-/debounce-1.2.0.tgz#44a540abc0ea9943018dc0eaa95cce87f65cd131"
@@ -5453,7 +5848,7 @@ deep-eql@^3.0.0:
dependencies:
type-detect "^4.0.0"
-deep-equal@^1.0.0, deep-equal@^1.0.1, deep-equal@~1.0.1:
+deep-equal@^1.0.1, deep-equal@~1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5"
integrity sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=
@@ -6106,6 +6501,11 @@ enzyme@^3.6.0:
rst-selector-parser "^2.2.3"
string.prototype.trim "^1.1.2"
+err-code@^1.0.0:
+ version "1.1.2"
+ resolved "https://registry.yarnpkg.com/err-code/-/err-code-1.1.2.tgz#06e0116d3028f6aef4806849eb0ea6a748ae6960"
+ integrity sha1-BuARbTAo9q70gGhJ6w6mp0iuaWA=
+
errno@^0.1.1, errno@^0.1.3, errno@~0.1.1, errno@~0.1.7:
version "0.1.7"
resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.7.tgz#4684d71779ad39af177e3f007996f7c67c852618"
@@ -6206,7 +6606,7 @@ es6-symbol@^3.1.1, es6-symbol@~3.1.1:
d "1"
es5-ext "~0.10.14"
-escape-html@1.0.3, escape-html@~1.0.3:
+escape-html@~1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988"
integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=
@@ -6525,14 +6925,6 @@ ethereum-common@^0.0.18:
resolved "https://registry.yarnpkg.com/ethereum-common/-/ethereum-common-0.0.18.tgz#2fdc3576f232903358976eb39da783213ff9523f"
integrity sha1-L9w1dvIykDNYl26znaeDIT/5Uj8=
-ethereum-types@^0.0.2:
- version "0.0.2"
- resolved "https://registry.yarnpkg.com/ethereum-types/-/ethereum-types-0.0.2.tgz#6ef6faf46a24697cbf66b6c8a0ecf2095ce58c38"
- integrity sha1-bvb69GokaXy/ZrbIoOzyCVzljDg=
- dependencies:
- "@types/node" "^8.0.53"
- bignumber.js "~4.1.0"
-
ethereumjs-abi@0.6.5, ethereumjs-abi@^0.6.5:
version "0.6.5"
resolved "https://registry.yarnpkg.com/ethereumjs-abi/-/ethereumjs-abi-0.6.5.tgz#5a637ef16ab43473fa72a29ad90871405b3f5241"
@@ -6578,15 +6970,6 @@ ethereumjs-block@~1.2.2:
ethereumjs-util "^4.0.1"
merkle-patricia-tree "^2.1.2"
-ethereumjs-blockstream@5.0.0:
- version "5.0.0"
- resolved "https://registry.yarnpkg.com/ethereumjs-blockstream/-/ethereumjs-blockstream-5.0.0.tgz#63bfe9185757329a32822d5815562eb1dcd75d71"
- integrity sha512-cbqWSH6YL8hP9l9NIawSbDEXGOVGiEYSOTUPQINoDBsOwOeHAcVAeJF5qy+BJviGHdsPZlqZLyM7c/2lVJXrSw==
- dependencies:
- immutable "3.8.2"
- source-map-support "0.5.6"
- uuid "3.2.1"
-
ethereumjs-blockstream@6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/ethereumjs-blockstream/-/ethereumjs-blockstream-6.0.0.tgz#79d726d1f358935eb65195e91d40344c31e87eff"
@@ -6611,7 +6994,18 @@ ethereumjs-tx@^1.0.0, ethereumjs-tx@^1.1.1, ethereumjs-tx@^1.2.0, ethereumjs-tx@
ethereum-common "^0.0.18"
ethereumjs-util "^5.0.0"
-ethereumjs-util@5.1.5, ethereumjs-util@^5.0.0, ethereumjs-util@^5.0.1, ethereumjs-util@^5.1.1, ethereumjs-util@^5.1.2, ethereumjs-util@^5.1.3, ethereumjs-util@^5.1.5:
+ethereumjs-util@^4.0.1, ethereumjs-util@^4.3.0, ethereumjs-util@^4.4.0:
+ version "4.5.0"
+ resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-4.5.0.tgz#3e9428b317eebda3d7260d854fddda954b1f1bc6"
+ integrity sha1-PpQosxfuvaPXJg2FT93alUsfG8Y=
+ dependencies:
+ bn.js "^4.8.0"
+ create-hash "^1.1.2"
+ keccakjs "^0.2.0"
+ rlp "^2.0.0"
+ secp256k1 "^3.0.1"
+
+ethereumjs-util@^5.0.0, ethereumjs-util@^5.0.1, ethereumjs-util@^5.1.1, ethereumjs-util@^5.1.2, ethereumjs-util@^5.1.3, ethereumjs-util@^5.1.5:
version "5.1.5"
resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-5.1.5.tgz#2f02575852627d45622426f25ee4a0b5f377f27a"
integrity sha512-xPaSEATYJpMTCGowIt0oMZwFP4R1bxd6QsWgkcDvFL0JtXsr39p32WEcD14RscCjfP41YXZPCVWA4yAg0nrJmw==
@@ -6624,17 +7018,6 @@ ethereumjs-util@5.1.5, ethereumjs-util@^5.0.0, ethereumjs-util@^5.0.1, ethereumj
safe-buffer "^5.1.1"
secp256k1 "^3.0.1"
-ethereumjs-util@^4.0.1, ethereumjs-util@^4.3.0, ethereumjs-util@^4.4.0:
- version "4.5.0"
- resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-4.5.0.tgz#3e9428b317eebda3d7260d854fddda954b1f1bc6"
- integrity sha1-PpQosxfuvaPXJg2FT93alUsfG8Y=
- dependencies:
- bn.js "^4.8.0"
- create-hash "^1.1.2"
- keccakjs "^0.2.0"
- rlp "^2.0.0"
- secp256k1 "^3.0.1"
-
ethereumjs-util@^5.2.0:
version "5.2.0"
resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz#3e0c0d1741471acf1036052d048623dee54ad642"
@@ -6695,22 +7078,6 @@ ethereumjs-wallet@0.6.0:
utf8 "^2.1.1"
uuid "^2.0.1"
-ethers@3.0.22:
- version "3.0.22"
- resolved "https://registry.yarnpkg.com/ethers/-/ethers-3.0.22.tgz#7fab1ea16521705837aa43c15831877b2716b436"
- integrity sha512-veXsoCdFL3yAdRohQWANA5/sw/btTCxPVmOruMDdzTtQelzRTrkDPN3CN1Y7TG1mQgayWoWkkfS4ks2t21wNqQ==
- dependencies:
- aes-js "3.0.0"
- bn.js "^4.4.0"
- elliptic "6.3.3"
- hash.js "^1.0.0"
- inherits "2.0.1"
- js-sha3 "0.5.7"
- scrypt-js "2.0.3"
- setimmediate "1.0.4"
- uuid "2.0.1"
- xmlhttprequest "1.8.0"
-
ethers@~4.0.4:
version "4.0.4"
resolved "https://registry.yarnpkg.com/ethers/-/ethers-4.0.4.tgz#d3f85e8b27f4b59537e06526439b0fb15b44dc65"
@@ -6784,11 +7151,6 @@ eventemitter3@1.x.x:
resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-1.2.0.tgz#1c86991d816ad1e504750e73874224ecf3bec508"
integrity sha1-HIaZHYFq0eUEdQ5zh0Ik7PO+xQg=
-eventemitter3@3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.0.0.tgz#fc29ecf233bd19fbd527bb4089bbf665dc90c1e3"
- integrity sha512-62TxCtz4m2LRaOERVEvLJJ4A6rsg8lC9Xm+FLg2y/1fB/v4ZZ9JCOn+/Ppl5KkH6sRih6bhix724PVanmXYZJQ==
-
eventemitter3@^3.0.0:
version "3.1.0"
resolved "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.0.tgz#090b4d6cdbd645ed10bf750d4b5407942d7ba163"
@@ -6804,6 +7166,11 @@ events@^2.0.0:
resolved "https://registry.yarnpkg.com/events/-/events-2.0.0.tgz#cbbb56bf3ab1ac18d71c43bb32c86255062769f2"
integrity sha512-r/M5YkNg9zwI8QbSf7tsDWWJvO3PGwZXyG7GpFAxtMASnHL2eblFd7iHiGPtyGKKFPZ59S63NeX10Ws6WqGDcg==
+events@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/events/-/events-3.0.0.tgz#9a0a0dfaf62893d92b875b8f2698ca4114973e88"
+ integrity sha512-Dc381HFWJzEOhQ+d8pkNon++bk9h6cdAoAj4iE6Q4y6xgTzySWXlKn05/TVNpjnfRqi/X0EpJEJohPjNI3zpVA==
+
eventsource@0.1.6:
version "0.1.6"
resolved "https://registry.yarnpkg.com/eventsource/-/eventsource-0.1.6.tgz#0acede849ed7dd1ccc32c811bb11b944d4f29232"
@@ -6865,6 +7232,19 @@ execa@^0.9.0:
signal-exit "^3.0.0"
strip-eof "^1.0.0"
+execa@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8"
+ integrity sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==
+ dependencies:
+ cross-spawn "^6.0.0"
+ get-stream "^4.0.0"
+ is-stream "^1.1.0"
+ npm-run-path "^2.0.0"
+ p-finally "^1.0.0"
+ signal-exit "^3.0.0"
+ strip-eof "^1.0.0"
+
exenv@^1.2.1:
version "1.2.2"
resolved "https://registry.yarnpkg.com/exenv/-/exenv-1.2.2.tgz#2ae78e85d9894158670b03d47bec1f03bd91bb9d"
@@ -7042,6 +7422,15 @@ external-editor@^2.0.4, external-editor@^2.1.0:
iconv-lite "^0.4.17"
tmp "^0.0.33"
+external-editor@^3.0.0:
+ version "3.0.3"
+ resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.0.3.tgz#5866db29a97826dbe4bf3afd24070ead9ea43a27"
+ integrity sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA==
+ dependencies:
+ chardet "^0.7.0"
+ iconv-lite "^0.4.24"
+ tmp "^0.0.33"
+
extglob@^0.3.1:
version "0.3.2"
resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1"
@@ -7192,7 +7581,7 @@ fetch-ponyfill@^4.0.0:
dependencies:
node-fetch "~1.7.1"
-figgy-pudding@^3.1.0, figgy-pudding@^3.5.1:
+figgy-pudding@^3.1.0, figgy-pudding@^3.2.1, figgy-pudding@^3.4.1, figgy-pudding@^3.5.1:
version "3.5.1"
resolved "https://registry.yarnpkg.com/figgy-pudding/-/figgy-pudding-3.5.1.tgz#862470112901c727a0e495a80744bd5baa1d6790"
integrity sha512-vNKxJHTEKNThjfrdJwHc7brvM6eVevuO5nTj6ez8ZQ1qbXTvGthucRF7S4vf2cr71QVnT70V34v0S1DyQsti0w==
@@ -7220,7 +7609,7 @@ file-entry-cache@^2.0.0:
flat-cache "^1.2.1"
object-assign "^4.0.1"
-file-type@3.9.0, file-type@^3.6.0, file-type@^3.8.0:
+file-type@^3.6.0, file-type@^3.8.0:
version "3.9.0"
resolved "https://registry.yarnpkg.com/file-type/-/file-type-3.9.0.tgz#257a078384d1db8087bc449d107d52a52672b9e9"
integrity sha1-JXoHg4TR24CHvESdEH1SpSZyuek=
@@ -7248,11 +7637,6 @@ fileset@^2.0.2:
glob "^7.0.3"
minimatch "^3.0.3"
-filesize@3.5.11:
- version "3.5.11"
- resolved "https://registry.yarnpkg.com/filesize/-/filesize-3.5.11.tgz#1919326749433bb3cf77368bd158caabcc19e9ee"
- integrity sha512-ZH7loueKBoDb7yG9esn1U+fgq7BzlzW6NRi5/rMdxIZ05dj7GFD/Xc5rq2CDt5Yq86CyfSYVyx4242QQNZbx1g==
-
filesize@^3.5.11, filesize@^3.6.1:
version "3.6.1"
resolved "https://registry.yarnpkg.com/filesize/-/filesize-3.6.1.tgz#090bb3ee01b6f801a8a8be99d31710b3422bb317"
@@ -7772,6 +8156,11 @@ generic-pool@~2.0.4:
resolved "https://registry.yarnpkg.com/generic-pool/-/generic-pool-2.0.4.tgz#f9718deda82fa125ed5c43e341c9a215a766d9a3"
integrity sha1-+XGN7agvoSXtXEPjQcmiFadm2aM=
+genfun@^4.0.1:
+ version "4.0.1"
+ resolved "https://registry.yarnpkg.com/genfun/-/genfun-4.0.1.tgz#ed10041f2e4a7f1b0a38466d17a5c3e27df1dfc1"
+ integrity sha1-7RAEHy5KfxsKOEZtF6XD4n3x38E=
+
get-caller-file@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.2.tgz#f702e63127e7e231c160a80c1554acb70d5047e5"
@@ -7821,6 +8210,13 @@ get-stream@^3.0.0:
resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14"
integrity sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=
+get-stream@^4.0.0:
+ version "4.1.0"
+ resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5"
+ integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==
+ dependencies:
+ pump "^3.0.0"
+
get-value@^2.0.3, get-value@^2.0.6:
version "2.0.6"
resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28"
@@ -7855,6 +8251,17 @@ git-raw-commits@^1.3.6:
split2 "^2.0.0"
through2 "^2.0.0"
+git-raw-commits@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/git-raw-commits/-/git-raw-commits-2.0.0.tgz#d92addf74440c14bcc5c83ecce3fb7f8a79118b5"
+ integrity sha512-w4jFEJFgKXMQJ0H0ikBk2S+4KP2VEjhCvLCNqbNRQC8BgGWgLKNCO7a9K9LI+TVT7Gfoloje502sEnctibffgg==
+ dependencies:
+ dargs "^4.0.1"
+ lodash.template "^4.0.2"
+ meow "^4.0.0"
+ split2 "^2.0.0"
+ through2 "^2.0.0"
+
git-remote-origin-url@^2.0.0:
version "2.0.0"
resolved "http://registry.yarnpkg.com/git-remote-origin-url/-/git-remote-origin-url-2.0.0.tgz#5282659dae2107145a11126112ad3216ec5fa65f"
@@ -7871,6 +8278,14 @@ git-semver-tags@^1.3.6:
meow "^4.0.0"
semver "^5.5.0"
+git-semver-tags@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/git-semver-tags/-/git-semver-tags-2.0.0.tgz#c218fd895bdf8e8e02f6bde555b2c3893ac73cd7"
+ integrity sha512-lSgFc3zQTul31nFje2Q8XdNcTOI6B4I3mJRPCgFzHQQLfxfqdWTYzdtCaynkK5Xmb2wQlSJoKolhXJ1VhKROnQ==
+ dependencies:
+ meow "^4.0.0"
+ semver "^5.5.0"
+
gitconfiglocal@^1.0.0:
version "1.0.0"
resolved "http://registry.yarnpkg.com/gitconfiglocal/-/gitconfiglocal-1.0.0.tgz#41d045f3851a5ea88f03f24ca1c6178114464b9b"
@@ -7993,6 +8408,18 @@ glob@^5.0.15:
once "^1.3.0"
path-is-absolute "^1.0.0"
+glob@^7.1.3:
+ version "7.1.3"
+ resolved "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1"
+ integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==
+ dependencies:
+ fs.realpath "^1.0.0"
+ inflight "^1.0.4"
+ inherits "2"
+ minimatch "^3.0.4"
+ once "^1.3.0"
+ path-is-absolute "^1.0.0"
+
glob@~3.1.21:
version "3.1.21"
resolved "https://registry.yarnpkg.com/glob/-/glob-3.1.21.tgz#d29e0a055dea5138f4d07ed40e8982e83c2066cd"
@@ -8273,7 +8700,7 @@ handle-thing@^1.2.5:
resolved "https://registry.yarnpkg.com/handle-thing/-/handle-thing-1.2.5.tgz#fd7aad726bf1a5fd16dfc29b2f7a6601d27139c4"
integrity sha1-/Xqtcmvxpf0W38KbL3pmAdJxOcQ=
-handlebars@4.0.11, handlebars@^4.0.1, handlebars@^4.0.11, handlebars@^4.0.2, handlebars@^4.0.3, handlebars@^4.0.6:
+handlebars@^4.0.1, handlebars@^4.0.11, handlebars@^4.0.2, handlebars@^4.0.3, handlebars@^4.0.6:
version "4.0.11"
resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.11.tgz#630a35dfe0294bc281edae6ffc5d329fc7982dcc"
integrity sha1-Ywo13+ApS8KB7a5v/F0yn8eYLcw=
@@ -8302,7 +8729,7 @@ har-validator@~4.2.1:
ajv "^4.9.1"
har-schema "^1.0.5"
-har-validator@~5.0.2, har-validator@~5.0.3:
+har-validator@~5.0.3:
version "5.0.3"
resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.0.3.tgz#ba402c266194f15956ef15e0fcf242993f6a7dfd"
integrity sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=
@@ -8369,7 +8796,7 @@ has-to-string-tag-x@^1.2.0:
dependencies:
has-symbol-support-x "^1.4.1"
-has-unicode@^2.0.0:
+has-unicode@^2.0.0, has-unicode@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9"
integrity sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=
@@ -8633,7 +9060,7 @@ html-webpack-plugin@^3.2.0:
toposort "^1.0.0"
util.promisify "1.0.0"
-htmlparser2@^3.9.0, htmlparser2@^3.9.1:
+htmlparser2@^3.9.1:
version "3.9.2"
resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.9.2.tgz#1bdf87acca0f3f9e53fa4fcceb0f4b4cbb00b338"
integrity sha1-G9+HrMoPP55T+k/M6w9LTLsAszg=
@@ -8655,6 +9082,11 @@ htmlparser2@~3.3.0:
domutils "1.1"
readable-stream "1.0"
+http-cache-semantics@^3.8.1:
+ version "3.8.1"
+ resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz#39b0e16add9b605bf0a9ef3d9daaf4843b4cacd2"
+ integrity sha512-5ai2iksyV8ZXmnZhHH4rWPoxxistEexSi5936zIQ1bnNTW5VnA85B6P/VpXiRM017IgRvb2kKo1a//y+0wSp3w==
+
http-deceiver@^1.2.7:
version "1.2.7"
resolved "https://registry.yarnpkg.com/http-deceiver/-/http-deceiver-1.2.7.tgz#fa7168944ab9a519d337cb0bec7284dc3e723d87"
@@ -8690,6 +9122,14 @@ http-parser-js@>=0.4.0:
resolved "https://registry.yarnpkg.com/http-parser-js/-/http-parser-js-0.4.11.tgz#5b720849c650903c27e521633d94696ee95f3529"
integrity sha512-QCR5O2AjjMW8Mo4HyI1ctFcv+O99j/0g367V3YoVnrNw5hkDvAWZD0lWGcc+F4yN3V55USPCVix4efb75HxFfA==
+http-proxy-agent@^2.1.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz#e4821beef5b2142a2026bd73926fe537631c5405"
+ integrity sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg==
+ dependencies:
+ agent-base "4"
+ debug "3.1.0"
+
http-proxy-middleware@~0.18.0:
version "0.18.0"
resolved "http://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.18.0.tgz#0987e6bb5a5606e5a69168d8f967a87f15dd8aab"
@@ -8708,11 +9148,6 @@ http-proxy@^1.16.2:
eventemitter3 "1.x.x"
requires-port "1.x.x"
-http-reasons@0.1.0:
- version "0.1.0"
- resolved "https://registry.yarnpkg.com/http-reasons/-/http-reasons-0.1.0.tgz#a953ca670078669dde142ce899401b9d6e85d3b4"
- integrity sha1-qVPKZwB4Zp3eFCzomUAbnW6F07Q=
-
http-signature@~1.1.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.1.1.tgz#df72e267066cd0ac67fb76adf8e134a8fbcf91bf"
@@ -8731,19 +9166,6 @@ http-signature@~1.2.0:
jsprim "^1.2.2"
sshpk "^1.7.0"
-httpntlm@1.7.5:
- version "1.7.5"
- resolved "https://registry.yarnpkg.com/httpntlm/-/httpntlm-1.7.5.tgz#cd1558ed93125418ece5bf824c1335675feedecc"
- integrity sha1-zRVY7ZMSVBjs5b+CTBM1Z1/u3sw=
- dependencies:
- httpreq ">=0.4.22"
- underscore "~1.7.0"
-
-httpreq@>=0.4.22:
- version "0.4.24"
- resolved "https://registry.yarnpkg.com/httpreq/-/httpreq-0.4.24.tgz#4335ffd82cd969668a39465c929ac61d6393627f"
- integrity sha1-QzX/2CzZaWaKOUZckprGHWOTYn8=
-
https-browserify@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73"
@@ -8757,6 +9179,13 @@ https-proxy-agent@^2.2.1:
agent-base "^4.1.0"
debug "^3.1.0"
+humanize-ms@^1.2.1:
+ version "1.2.1"
+ resolved "https://registry.yarnpkg.com/humanize-ms/-/humanize-ms-1.2.1.tgz#c46e3159a293f6b896da29316d8b6fe8bb79bbed"
+ integrity sha1-xG4xWaKT9riW2ikxbYtv6Lt5u+0=
+ dependencies:
+ ms "^2.0.0"
+
humble-localstorage@^1.4.2:
version "1.4.2"
resolved "https://registry.yarnpkg.com/humble-localstorage/-/humble-localstorage-1.4.2.tgz#d05ab0d526c4edbddbf7c6a60df6ff5805283469"
@@ -8795,9 +9224,9 @@ iconv-lite@0.4.23, iconv-lite@^0.4.4:
dependencies:
safer-buffer ">= 2.1.2 < 3"
-iconv-lite@0.4.24:
+iconv-lite@0.4.24, iconv-lite@^0.4.24:
version "0.4.24"
- resolved "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b"
+ resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b"
integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==
dependencies:
safer-buffer ">= 2.1.2 < 3"
@@ -9024,17 +9453,24 @@ inquirer@^5.1.0:
strip-ansi "^4.0.0"
through "^2.3.6"
-intel@1.2.0:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/intel/-/intel-1.2.0.tgz#11d1147eb6b3f4582bdf5337b37d541584e9e41e"
- integrity sha1-EdEUfraz9Fgr31M3s31UFYTp5B4=
+inquirer@^6.2.0:
+ version "6.2.0"
+ resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.2.0.tgz#51adcd776f661369dc1e894859c2560a224abdd8"
+ integrity sha512-QIEQG4YyQ2UYZGDC4srMZ7BjHOmNk1lR2JQj5UknBapklm6WHA+VVH7N+sUdX3A7NeCfGF8o4X1S3Ao7nAcIeg==
dependencies:
- chalk "^1.1.0"
- dbug "~0.4.2"
- stack-trace "~0.0.9"
- strftime "~0.10.0"
- symbol "~0.3.1"
- utcstring "~0.1.0"
+ ansi-escapes "^3.0.0"
+ chalk "^2.0.0"
+ cli-cursor "^2.1.0"
+ cli-width "^2.0.0"
+ external-editor "^3.0.0"
+ figures "^2.0.0"
+ lodash "^4.17.10"
+ mute-stream "0.0.7"
+ run-async "^2.2.0"
+ rxjs "^6.1.0"
+ string-width "^2.1.0"
+ strip-ansi "^4.0.0"
+ through "^2.3.6"
internal-ip@^3.0.1:
version "3.0.1"
@@ -9091,11 +9527,6 @@ ipaddr.js@^1.5.2:
resolved "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.8.1.tgz#fa4b79fa47fd3def5e3b159825161c0a519c9427"
integrity sha1-+kt5+kf9Pe9eOxWYJRYcClGclCc=
-irregular-plurals@^1.0.0:
- version "1.4.0"
- resolved "https://registry.yarnpkg.com/irregular-plurals/-/irregular-plurals-1.4.0.tgz#2ca9b033651111855412f16be5d77c62a458a766"
- integrity sha1-LKmwM2UREYVUEvFr5dd8YqRYp2Y=
-
is-absolute-url@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/is-absolute-url/-/is-absolute-url-2.1.0.tgz#50530dfb84fcc9aa7dbe7852e83a37b93b9f2aa6"
@@ -9402,6 +9833,13 @@ is-object@^1.0.1:
resolved "https://registry.yarnpkg.com/is-object/-/is-object-1.0.1.tgz#8952688c5ec2ffd6b03ecc85e769e02903083470"
integrity sha1-iVJojF7C/9awPsyF52ngKQMINHA=
+is-observable@^1.1.0:
+ version "1.1.0"
+ resolved "https://registry.npmjs.org/is-observable/-/is-observable-1.1.0.tgz#b3e986c8f44de950867cab5403f5a3465005975e"
+ integrity sha512-NqCa4Sa2d+u7BWc6CukaObG3Fh+CU9bvixbpcXYhy2VvYS7vVGIdAgnIS5Ks3A/cqk4rebLJ9s8zBstT2aKnIA==
+ dependencies:
+ symbol-observable "^1.1.0"
+
is-odd@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/is-odd/-/is-odd-2.0.0.tgz#7646624671fd7ea558ccd9a2795182f2958f1b24"
@@ -10122,16 +10560,16 @@ js-sha3@0.5.7:
resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.5.7.tgz#0d4ffd8002d5333aabaf4a23eed2f6374c9f28e7"
integrity sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=
-js-sha3@0.7.0, js-sha3@^0.7.0:
- version "0.7.0"
- resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.7.0.tgz#0a5c57b36f79882573b2d84051f8bb85dd1bd63a"
- integrity sha512-Wpks3yBDm0UcL5qlVhwW9Jr9n9i4FfeWBFOOXP5puDS/SiudJGhw7DPyBqn3487qD4F0lsC0q3zxink37f7zeA==
-
js-sha3@^0.3.1:
version "0.3.1"
resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.3.1.tgz#86122802142f0828502a0d1dee1d95e253bb0243"
integrity sha1-hhIoAhQvCChQKg0d7h2V4lO7AkM=
+js-sha3@^0.7.0:
+ version "0.7.0"
+ resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.7.0.tgz#0a5c57b36f79882573b2d84051f8bb85dd1bd63a"
+ integrity sha512-Wpks3yBDm0UcL5qlVhwW9Jr9n9i4FfeWBFOOXP5puDS/SiudJGhw7DPyBqn3487qD4F0lsC0q3zxink37f7zeA==
+
js-tokens@^3.0.0, js-tokens@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b"
@@ -10213,7 +10651,7 @@ jsesc@~0.5.0:
resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d"
integrity sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=
-json-parse-better-errors@^1.0.1, json-parse-better-errors@^1.0.2:
+json-parse-better-errors@^1.0.0, json-parse-better-errors@^1.0.1, json-parse-better-errors@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9"
integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==
@@ -10341,11 +10779,6 @@ jsonschema@*, jsonschema@1.2.4, jsonschema@^1.2.0:
resolved "https://registry.yarnpkg.com/jsonschema/-/jsonschema-1.2.4.tgz#a46bac5d3506a254465bc548876e267c6d0d6464"
integrity sha512-lz1nOH69GbsVHeVgEdvyavc/33oymY1AZwtePMiMj4HZPMbP5OIKK3zT9INMWjwua/V4Z4yq7wSlBbSG+g4AEw==
-jsonschema@1.2.2:
- version "1.2.2"
- resolved "https://registry.yarnpkg.com/jsonschema/-/jsonschema-1.2.2.tgz#83ab9c63d65bf4d596f91d81195e78772f6452bc"
- integrity sha512-iX5OFQ6yx9NgbHCwse51ohhKgLuLL7Z5cNOeZOPIlDUtAMrxlruHLzVZxbltdHE5mEDXN+75oFOwq6Gn0MZwsA==
-
jsprim@^1.2.2:
version "1.4.1"
resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2"
@@ -10571,6 +11004,29 @@ left-pad@^1.3.0:
resolved "https://registry.npmjs.org/left-pad/-/left-pad-1.3.0.tgz#5b8a3a7765dfe001261dde915589e782f8c94d1e"
integrity sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA==
+lerna@^3.0.0-beta.25:
+ version "3.4.3"
+ resolved "https://registry.yarnpkg.com/lerna/-/lerna-3.4.3.tgz#501454efb453c65c305802d370ee337f7298787e"
+ integrity sha512-tWq1LvpHqkyB+FaJCmkEweivr88yShDMmauofPVdh0M5gU1cVucszYnIgWafulKYu2LMQ3IfUMUU5Pp3+MvADQ==
+ dependencies:
+ "@lerna/add" "^3.4.1"
+ "@lerna/bootstrap" "^3.4.1"
+ "@lerna/changed" "^3.4.1"
+ "@lerna/clean" "^3.3.2"
+ "@lerna/cli" "^3.2.0"
+ "@lerna/create" "^3.4.1"
+ "@lerna/diff" "^3.3.0"
+ "@lerna/exec" "^3.3.2"
+ "@lerna/import" "^3.3.1"
+ "@lerna/init" "^3.3.0"
+ "@lerna/link" "^3.3.0"
+ "@lerna/list" "^3.3.2"
+ "@lerna/publish" "^3.4.3"
+ "@lerna/run" "^3.3.2"
+ "@lerna/version" "^3.4.1"
+ import-local "^1.0.0"
+ npmlog "^4.1.2"
+
less-loader@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/less-loader/-/less-loader-4.1.0.tgz#2c1352c5b09a4f84101490274fd51674de41363e"
@@ -10690,6 +11146,16 @@ levn@^0.3.0, levn@~0.3.0:
prelude-ls "~1.1.2"
type-check "~0.3.2"
+libnpmaccess@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/libnpmaccess/-/libnpmaccess-3.0.0.tgz#33cc9c8a5cb53e87d06bf2e547c2eba974f619af"
+ integrity sha512-SiE4AZAzMpD7pmmXHfgD7rof8QIQGoKaeyAS8exgx2CKA6tzRTbRljq1xM4Tgj8/tIg+KBJPJWkR0ifqKT3irQ==
+ dependencies:
+ aproba "^2.0.0"
+ get-stream "^4.0.0"
+ npm-package-arg "^6.1.0"
+ npm-registry-fetch "^3.8.0"
+
liftoff@^2.1.0:
version "2.5.0"
resolved "https://registry.yarnpkg.com/liftoff/-/liftoff-2.5.0.tgz#2009291bb31cea861bbf10a7c15a28caf75c31ec"
@@ -10704,11 +11170,6 @@ liftoff@^2.1.0:
rechoir "^0.6.2"
resolve "^1.1.7"
-liquid-json@0.3.1:
- version "0.3.1"
- resolved "https://registry.yarnpkg.com/liquid-json/-/liquid-json-0.3.1.tgz#9155a18136d8a6b2615e5f16f9a2448ab6b50eea"
- integrity sha1-kVWhgTbYprJhXl8W+aJEira1Duo=
-
listr-silent-renderer@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/listr-silent-renderer/-/listr-silent-renderer-1.1.1.tgz#924b5a3757153770bf1a8e3fbf74b8bbf3f9242e"
@@ -10728,6 +11189,20 @@ listr-update-renderer@^0.2.0:
log-update "^1.0.2"
strip-ansi "^3.0.1"
+listr-update-renderer@^0.4.0:
+ version "0.4.0"
+ resolved "https://registry.npmjs.org/listr-update-renderer/-/listr-update-renderer-0.4.0.tgz#344d980da2ca2e8b145ba305908f32ae3f4cc8a7"
+ integrity sha1-NE2YDaLKLosUW6MFkI8yrj9MyKc=
+ dependencies:
+ chalk "^1.1.3"
+ cli-truncate "^0.2.1"
+ elegant-spinner "^1.0.1"
+ figures "^1.7.0"
+ indent-string "^3.0.0"
+ log-symbols "^1.0.2"
+ log-update "^1.0.2"
+ strip-ansi "^3.0.1"
+
listr-verbose-renderer@^0.4.0:
version "0.4.1"
resolved "https://registry.yarnpkg.com/listr-verbose-renderer/-/listr-verbose-renderer-0.4.1.tgz#8206f4cf6d52ddc5827e5fd14989e0e965933a35"
@@ -10760,6 +11235,21 @@ listr@^0.12.0:
stream-to-observable "^0.1.0"
strip-ansi "^3.0.1"
+listr@^0.14.2:
+ version "0.14.2"
+ resolved "https://registry.npmjs.org/listr/-/listr-0.14.2.tgz#cbe44b021100a15376addfc2d79349ee430bfe14"
+ integrity sha512-vmaNJ1KlGuGWShHI35X/F8r9xxS0VTHh9GejVXwSN20fG5xpq3Jh4bJbnumoT6q5EDM/8/YP1z3YMtQbFmhuXw==
+ dependencies:
+ "@samverschueren/stream-to-observable" "^0.3.0"
+ is-observable "^1.1.0"
+ is-promise "^2.1.0"
+ is-stream "^1.1.0"
+ listr-silent-renderer "^1.1.1"
+ listr-update-renderer "^0.4.0"
+ listr-verbose-renderer "^0.4.0"
+ p-map "^1.1.1"
+ rxjs "^6.1.0"
+
load-json-file@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0"
@@ -10943,11 +11433,6 @@ lodash.escape@^4.0.1:
resolved "https://registry.npmjs.org/lodash.escape/-/lodash.escape-4.0.1.tgz#c9044690c21e04294beaa517712fded1fa88de98"
integrity sha1-yQRGkMIeBClL6qUXcS/e0fqI3pg=
-lodash.escaperegexp@^4.1.2:
- version "4.1.2"
- resolved "https://registry.yarnpkg.com/lodash.escaperegexp/-/lodash.escaperegexp-4.1.2.tgz#64762c48618082518ac3df4ccf5d5886dae20347"
- integrity sha1-ZHYsSGGAglGKw99Mz11YhtriA0c=
-
lodash.find@^4.3.0:
version "4.6.0"
resolved "https://registry.npmjs.org/lodash.find/-/lodash.find-4.6.0.tgz#cb0704d47ab71789ffa0de8b97dd926fb88b13b1"
@@ -11095,7 +11580,7 @@ lodash.uniq@^4.5.0:
resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773"
integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=
-lodash.values@4.3.0, lodash.values@^4.3.0:
+lodash.values@^4.3.0:
version "4.3.0"
resolved "https://registry.yarnpkg.com/lodash.values/-/lodash.values-4.3.0.tgz#a3a6c2b0ebecc5c2cba1c17e6e620fe81b53d347"
integrity sha1-o6bCsOvsxcLLocF+bmIP6BtT00c=
@@ -11107,22 +11592,12 @@ lodash.words@^3.0.0:
dependencies:
lodash._root "^3.0.0"
-lodash@4.17.10, lodash@^4.17.10:
- version "4.17.10"
- resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7"
- integrity sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==
-
-lodash@4.17.2:
- version "4.17.2"
- resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.2.tgz#34a3055babe04ce42467b607d700072c7ff6bf42"
- integrity sha1-NKMFW6vgTOQkZ7YH1wAHLH/2v0I=
-
-lodash@4.17.4, lodash@=4.17.4:
+lodash@=4.17.4:
version "4.17.4"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"
integrity sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=
-lodash@^3.10.1, lodash@^3.3.1, lodash@^3.6.0, lodash@^3.7.0:
+lodash@^3.3.1, lodash@^3.6.0, lodash@^3.7.0:
version "3.10.1"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6"
integrity sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=
@@ -11137,6 +11612,11 @@ lodash@^4.14.0, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.1, lodash@^4.3.0, lo
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.5.tgz#99a92d65c0272debe8c96b6057bc8fbfa3bed511"
integrity sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==
+lodash@^4.17.10:
+ version "4.17.10"
+ resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7"
+ integrity sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==
+
lodash@~1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-1.0.2.tgz#8f57560c83b59fc270bd3d561b690043430e2551"
@@ -11259,7 +11739,7 @@ lru-cache@^4.0.1, lru-cache@^4.1.1:
pseudomap "^1.0.2"
yallist "^2.1.2"
-lru-cache@^4.1.3:
+lru-cache@^4.1.2, lru-cache@^4.1.3:
version "4.1.3"
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.3.tgz#a1175cf3496dfc8436c156c334b4955992bce69c"
integrity sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==
@@ -11272,11 +11752,6 @@ lru-cache@~2.2.1:
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-2.2.4.tgz#6c658619becf14031d0d0b594b16042ce4dc063d"
integrity sha1-bGWGGb7PFAMdDQtZSxYELOTcBj0=
-ltcdr@^2.2.1:
- version "2.2.1"
- resolved "https://registry.yarnpkg.com/ltcdr/-/ltcdr-2.2.1.tgz#5ab87ad1d4c1dab8e8c08bbf037ee0c1902287cf"
- integrity sha1-Wrh60dTB2rjowIu/A37gwZAih88=
-
ltgt@^2.1.2, ltgt@~2.2.0:
version "2.2.1"
resolved "https://registry.yarnpkg.com/ltgt/-/ltgt-2.2.1.tgz#f35ca91c493f7b73da0e07495304f17b31f87ee5"
@@ -11314,6 +11789,23 @@ make-error@^1.1.1:
resolved "https://registry.npmjs.org/make-error/-/make-error-1.3.4.tgz#19978ed575f9e9545d2ff8c13e33b5d18a67d535"
integrity sha512-0Dab5btKVPhibSalc9QGXb559ED7G7iLjFXBaj9Wq8O3vorueR5K5jaE3hkG6ZQINyhA/JgG6Qk4qdFQjsYV6g==
+make-fetch-happen@^4.0.1:
+ version "4.0.1"
+ resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-4.0.1.tgz#141497cb878f243ba93136c83d8aba12c216c083"
+ integrity sha512-7R5ivfy9ilRJ1EMKIOziwrns9fGeAD4bAha8EB7BIiBBLHm2KeTUGCrICFt2rbHfzheTLynv50GnNTK1zDTrcQ==
+ dependencies:
+ agentkeepalive "^3.4.1"
+ cacache "^11.0.1"
+ http-cache-semantics "^3.8.1"
+ http-proxy-agent "^2.1.0"
+ https-proxy-agent "^2.2.1"
+ lru-cache "^4.1.2"
+ mississippi "^3.0.0"
+ node-fetch-npm "^2.0.2"
+ promise-retry "^1.1.1"
+ socks-proxy-agent "^4.0.0"
+ ssri "^6.0.0"
+
make-iterator@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/make-iterator/-/make-iterator-1.0.1.tgz#29b33f312aa8f547c4a5e490f56afcec99133ad6"
@@ -11516,6 +12008,21 @@ meow@^4.0.0:
redent "^2.0.0"
trim-newlines "^2.0.0"
+meow@^5.0.0:
+ version "5.0.0"
+ resolved "https://registry.npmjs.org/meow/-/meow-5.0.0.tgz#dfc73d63a9afc714a5e371760eb5c88b91078aa4"
+ integrity sha512-CbTqYU17ABaLefO8vCU153ZZlprKYWDljcndKKDCFcYQITzWCXZAVk4QMFZPgvzrnUQ3uItnIE/LoUOwrT15Ig==
+ dependencies:
+ camelcase-keys "^4.0.0"
+ decamelize-keys "^1.0.0"
+ loud-rejection "^1.0.0"
+ minimist-options "^3.0.1"
+ normalize-package-data "^2.3.4"
+ read-pkg-up "^3.0.0"
+ redent "^2.0.0"
+ trim-newlines "^2.0.0"
+ yargs-parser "^10.0.0"
+
merge-descriptors@1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61"
@@ -11615,30 +12122,11 @@ miller-rabin@^4.0.0:
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.33.0.tgz#a3492050a5cb9b63450541e39d9788d2272783db"
integrity sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==
-mime-db@~1.30.0:
- version "1.30.0"
- resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.30.0.tgz#74c643da2dd9d6a45399963465b26d5ca7d71f01"
- integrity sha1-dMZD2i3Z1qRTmZY0ZbJtXKfXHwE=
-
mime-db@~1.35.0:
version "1.35.0"
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.35.0.tgz#0569d657466491283709663ad379a99b90d9ab47"
integrity sha512-JWT/IcCTsB0Io3AhWUMjRqucrHSPsSf2xKLaRldJVULioggvkJvggZ3VXNNSRkCddE6D+BUI4HEIZIA2OjwIvg==
-mime-format@2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/mime-format/-/mime-format-2.0.0.tgz#e29f8891e284d78270246f0050d6834bdbbe1332"
- integrity sha1-4p+IkeKE14JwJG8AUNaDS9u+EzI=
- dependencies:
- charset "^1.0.0"
-
-mime-types@2.1.17:
- version "2.1.17"
- resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.17.tgz#09d7a393f03e995a79f8af857b70a9e0ab16557a"
- integrity sha1-Cdejk/A+mVp5+K+Fe3Cp4KsWVXo=
- dependencies:
- mime-db "~1.30.0"
-
mime-types@^2.1.12, mime-types@^2.1.16, mime-types@~2.1.17, mime-types@~2.1.18, mime-types@~2.1.7:
version "2.1.18"
resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.18.tgz#6f323f60a83d11146f831ff11fd66e2fe5503bb8"
@@ -11924,6 +12412,11 @@ ms@2.0.0:
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=
+ms@^2.0.0:
+ version "2.1.1"
+ resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a"
+ integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==
+
multicast-dns-service-types@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/multicast-dns-service-types/-/multicast-dns-service-types-1.1.0.tgz#899f11d9686e5e05cb91b35d5f0e63b773cfc901"
@@ -12046,34 +12539,6 @@ neo-async@^2.5.0:
resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.5.1.tgz#acb909e327b1e87ec9ef15f41b8a269512ad41ee"
integrity sha512-3KL3fvuRkZ7s4IFOMfztb7zJp3QaVWnBeGoJlgB38XnCRPj/0tLzzLG5IB8NYOHbJ8g8UGrgZv44GLDk6CxTxA==
-newman@^3.9.3:
- version "3.9.3"
- resolved "https://registry.yarnpkg.com/newman/-/newman-3.9.3.tgz#939356026942474ba15482bd37a15c60bb200ca0"
- integrity sha1-k5NWAmlCR0uhVIK9N6FcYLsgDKA=
- dependencies:
- async "2.6.0"
- cli-progress "1.7.0"
- cli-table2 "0.2.0"
- colors "1.1.2"
- commander "2.13.0"
- csv-parse "1.2.4"
- eventemitter3 "3.0.0"
- filesize "3.5.11"
- handlebars "4.0.11"
- lodash "4.17.2"
- mkdirp "0.5.1"
- parse-json "3.0.0"
- postman-collection "3.0.7"
- postman-collection-transformer "2.5.4"
- postman-request "2.81.1-postman.4"
- postman-runtime "7.1.3"
- pretty-ms "3.1.0"
- semver "5.5.0"
- serialised-error "1.1.2"
- shelljs "0.8.0"
- word-wrap "1.2.3"
- xmlbuilder "9.0.4"
-
next-tick@1:
version "1.0.0"
resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.0.0.tgz#ca86d1fe8828169b0120208e3dc8424b9db8342c"
@@ -12102,21 +12567,6 @@ no-case@^2.2.0, no-case@^2.3.2:
dependencies:
lower-case "^1.1.1"
-nock@^9.2.3:
- version "9.2.5"
- resolved "https://registry.yarnpkg.com/nock/-/nock-9.2.5.tgz#c131fc8d3c4723f386be0269739638be84733f2f"
- integrity sha512-ciCpyEq72Ws6/yhdayDfd0mAb3eQ7/533xKmFlBQZ5CDwrL0/bddtSicfL7R07oyvPAuegQrR+9ctrlPEp0EjQ==
- dependencies:
- chai "^4.1.2"
- debug "^3.1.0"
- deep-equal "^1.0.0"
- json-stringify-safe "^5.0.1"
- lodash "^4.17.5"
- mkdirp "^0.5.0"
- propagate "^1.0.0"
- qs "^6.5.1"
- semver "^5.5.0"
-
node-abi@^2.2.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/node-abi/-/node-abi-2.3.0.tgz#f3d554d6ac72a9ee16f0f4dc9548db7c08de4986"
@@ -12124,6 +12574,15 @@ node-abi@^2.2.0:
dependencies:
semver "^5.4.1"
+node-fetch-npm@^2.0.2:
+ version "2.0.2"
+ resolved "https://registry.yarnpkg.com/node-fetch-npm/-/node-fetch-npm-2.0.2.tgz#7258c9046182dca345b4208eda918daf33697ff7"
+ integrity sha512-nJIxm1QmAj4v3nfCvEeCrYSoVwXyxLnaPBK5W1W5DGEJwjlKuC2VEUycGw5oxk+4zZahRrB84PUJJgEmhFTDFw==
+ dependencies:
+ encoding "^0.1.11"
+ json-parse-better-errors "^1.0.0"
+ safe-buffer "^5.1.1"
+
node-fetch@2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.1.1.tgz#369ca70b82f50c86496104a6c776d274f4e4a2d4"
@@ -12213,13 +12672,6 @@ node-notifier@^5.2.1:
shellwords "^0.1.1"
which "^1.3.0"
-node-oauth1@1.2.2:
- version "1.2.2"
- resolved "https://registry.yarnpkg.com/node-oauth1/-/node-oauth1-1.2.2.tgz#fffb2813a88c2770711332ad0e5487b4927644a4"
- integrity sha512-f2XC7Y68wJq6+s+LJn/yUq5Gqg9Y9zwIz2zY6vUyS8xzawnSWhXKOMJepLwvptjPl8IjVxtWh7iI9dbdKGSw4g==
- dependencies:
- crypto-js "3.1.9-1"
-
node-pre-gyp@^0.10.0:
version "0.10.3"
resolved "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.10.3.tgz#3070040716afdc778747b61b6887bf78880b80fc"
@@ -12253,11 +12705,6 @@ node-pre-gyp@^0.6.39:
tar "^2.2.1"
tar-pack "^3.4.0"
-node-uuid@^1.4.7:
- version "1.4.8"
- resolved "https://registry.yarnpkg.com/node-uuid/-/node-uuid-1.4.8.tgz#b040eb0923968afabf8d32fb1f17f1167fdab907"
- integrity sha1-sEDrCSOWivq/jTL7HxfxFn/auQc=
-
nodemon@^1.11.0:
version "1.17.3"
resolved "https://registry.yarnpkg.com/nodemon/-/nodemon-1.17.3.tgz#3b0bbc2ee05ccb43b1aef15ba05c63c7bc9b8530"
@@ -12317,7 +12764,7 @@ nopt@~1.0.10:
dependencies:
abbrev "1"
-normalize-package-data@^2.0.0, normalize-package-data@^2.3.0, normalize-package-data@^2.3.2, normalize-package-data@^2.3.4, normalize-package-data@^2.3.5, "normalize-package-data@~1.0.1 || ^2.0.0":
+normalize-package-data@^2.0.0, normalize-package-data@^2.3.0, normalize-package-data@^2.3.2, normalize-package-data@^2.3.4, normalize-package-data@^2.3.5, normalize-package-data@^2.4.0, "normalize-package-data@~1.0.1 || ^2.0.0":
version "2.4.0"
resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f"
integrity sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==
@@ -12366,13 +12813,6 @@ npm-bundled@^1.0.1:
resolved "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.3.tgz#7e71703d973af3370a9591bafe3a63aca0be2308"
integrity sha512-ByQ3oJ/5ETLyglU2+8dBObvhfWXX8dtPZDMePCahptliFX2iIuhyEszyFk401PZUNQH20vvdW5MLjJxkwU80Ow==
-npm-cli-login@^0.0.10:
- version "0.0.10"
- resolved "https://registry.yarnpkg.com/npm-cli-login/-/npm-cli-login-0.0.10.tgz#b1e8b5b7405008e0a26ccc170443434a59c5364c"
- integrity sha1-sei1t0BQCOCibMwXBENDSlnFNkw=
- dependencies:
- npm-registry-client "7.0.9"
-
npm-lifecycle@^2.0.0:
version "2.0.3"
resolved "http://registry.yarnpkg.com/npm-lifecycle/-/npm-lifecycle-2.0.3.tgz#696bedf1143371163e9cc16fe872357e25d8d90e"
@@ -12395,7 +12835,7 @@ npm-lifecycle@^2.0.0:
hosted-git-info "^2.1.5"
semver "^5.1.0"
-"npm-package-arg@^4.0.0 || ^5.0.0 || ^6.0.0", npm-package-arg@^6.0.0:
+"npm-package-arg@^4.0.0 || ^5.0.0 || ^6.0.0", npm-package-arg@^6.0.0, npm-package-arg@^6.1.0:
version "6.1.0"
resolved "http://registry.yarnpkg.com/npm-package-arg/-/npm-package-arg-6.1.0.tgz#15ae1e2758a5027efb4c250554b85a737db7fcc1"
integrity sha512-zYbhP2k9DbJhA0Z3HKUePUgdB1x7MfIfKssC+WLPFMKTBZKpZh5m13PgexJjCq6KW7j17r0jHWcCpxEqnnncSA==
@@ -12405,6 +12845,14 @@ npm-lifecycle@^2.0.0:
semver "^5.5.0"
validate-npm-package-name "^3.0.0"
+npm-packlist@^1.1.10:
+ version "1.1.12"
+ resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.1.12.tgz#22bde2ebc12e72ca482abd67afc51eb49377243a"
+ integrity sha512-WJKFOVMeAlsU/pjXuqVdzU0WfgtIBCupkEVwn+1Y0ERAbUfWw8R4GjgVbaKnUjRoD2FoQbHOCbOyT5Mbs9Lw4g==
+ dependencies:
+ ignore-walk "^3.0.1"
+ npm-bundled "^1.0.1"
+
npm-packlist@^1.1.6:
version "1.1.11"
resolved "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.1.11.tgz#84e8c683cbe7867d34b1d357d893ce29e28a02de"
@@ -12413,6 +12861,14 @@ npm-packlist@^1.1.6:
ignore-walk "^3.0.1"
npm-bundled "^1.0.1"
+npm-pick-manifest@^2.1.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/npm-pick-manifest/-/npm-pick-manifest-2.1.0.tgz#dc381bdd670c35d81655e1d5a94aa3dd4d87fce5"
+ integrity sha512-q9zLP8cTr8xKPmMZN3naxp1k/NxVFsjxN6uWuO1tiw9gxg7wZWQ/b5UTfzD0ANw2q1lQxdLKTeCCksq+bPSgbQ==
+ dependencies:
+ npm-package-arg "^6.0.0"
+ semver "^5.4.1"
+
npm-registry-client@7.0.9:
version "7.0.9"
resolved "https://registry.yarnpkg.com/npm-registry-client/-/npm-registry-client-7.0.9.tgz#1baf86ee5285c4e6d38d4556208ded56049231bb"
@@ -12433,6 +12889,18 @@ npm-registry-client@7.0.9:
optionalDependencies:
npmlog "~2.0.0"
+npm-registry-fetch@^3.0.0, npm-registry-fetch@^3.8.0:
+ version "3.8.0"
+ resolved "https://registry.yarnpkg.com/npm-registry-fetch/-/npm-registry-fetch-3.8.0.tgz#aa7d9a7c92aff94f48dba0984bdef4bd131c88cc"
+ integrity sha512-hrw8UMD+Nob3Kl3h8Z/YjmKamb1gf7D1ZZch2otrIXM3uFLB5vjEY6DhMlq80z/zZet6eETLbOXcuQudCB3Zpw==
+ dependencies:
+ JSONStream "^1.3.4"
+ bluebird "^3.5.1"
+ figgy-pudding "^3.4.1"
+ lru-cache "^4.1.3"
+ make-fetch-happen "^4.0.1"
+ npm-package-arg "^6.1.0"
+
npm-run-all@^4.1.2, npm-run-all@^4.1.3:
version "4.1.3"
resolved "https://registry.yarnpkg.com/npm-run-all/-/npm-run-all-4.1.3.tgz#49f15b55a66bb4101664ce270cb18e7103f8f185"
@@ -12571,11 +13039,6 @@ object-copy@^0.1.0:
define-property "^0.2.5"
kind-of "^3.0.3"
-object-hash@^1.1.2:
- version "1.3.0"
- resolved "https://registry.yarnpkg.com/object-hash/-/object-hash-1.3.0.tgz#76d9ba6ff113cf8efc0d996102851fe6723963e2"
- integrity sha512-05KzQ70lSeGSrZJQXE5wNDiTkBJDlUT/myi6RX9dVIvz7a7Qh4oH93BQdiPMn27nldYvVQCKMUaM83AfizZlsQ==
-
object-inspect@^1.6.0:
version "1.6.0"
resolved "https://registry.npmjs.org/object-inspect/-/object-inspect-1.6.0.tgz#c70b6cbf72f274aab4c34c0c82f5167bf82cf15b"
@@ -12961,6 +13424,11 @@ p-map@^1.1.1, p-map@^1.2.0:
resolved "https://registry.yarnpkg.com/p-map/-/p-map-1.2.0.tgz#e4e94f311eabbc8633a1e79908165fca26241b6b"
integrity sha512-r6zKACMNhjPJMTl8KcFH4li//gkrXWfbD6feV8l6doRHlzljFWGJ2AP6iKaCJXyZmAUMOPtvbW7EXkbWO/pLEA==
+p-pipe@^1.2.0:
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/p-pipe/-/p-pipe-1.2.0.tgz#4b1a11399a11520a67790ee5a0c1d5881d6befe9"
+ integrity sha1-SxoROZoRUgpneQ7loMHViB1r7+k=
+
p-reduce@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/p-reduce/-/p-reduce-1.0.0.tgz#18c2b0dd936a4690a529f8231f58a0fdb6a47dfa"
@@ -13000,6 +13468,39 @@ package-json@^4.0.0, package-json@^4.0.1:
registry-url "^3.0.3"
semver "^5.1.0"
+pacote@^9.1.0:
+ version "9.1.0"
+ resolved "https://registry.yarnpkg.com/pacote/-/pacote-9.1.0.tgz#59810859bbd72984dcb267269259375d32f391e5"
+ integrity sha512-AFXaSWhOtQf3jHqEvg+ZYH/dfT8TKq6TKspJ4qEFwVVuh5aGvMIk6SNF8vqfzz+cBceDIs9drOcpBbrPai7i+g==
+ dependencies:
+ bluebird "^3.5.1"
+ cacache "^11.0.2"
+ figgy-pudding "^3.2.1"
+ get-stream "^3.0.0"
+ glob "^7.1.2"
+ lru-cache "^4.1.3"
+ make-fetch-happen "^4.0.1"
+ minimatch "^3.0.4"
+ minipass "^2.3.3"
+ mississippi "^3.0.0"
+ mkdirp "^0.5.1"
+ normalize-package-data "^2.4.0"
+ npm-package-arg "^6.1.0"
+ npm-packlist "^1.1.10"
+ npm-pick-manifest "^2.1.0"
+ npm-registry-fetch "^3.0.0"
+ osenv "^0.1.5"
+ promise-inflight "^1.0.1"
+ promise-retry "^1.1.1"
+ protoduck "^5.0.0"
+ rimraf "^2.6.2"
+ safe-buffer "^5.1.2"
+ semver "^5.5.0"
+ ssri "^6.0.0"
+ tar "^4.4.3"
+ unique-filename "^1.1.0"
+ which "^1.3.0"
+
pako@~1.0.5:
version "1.0.6"
resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.6.tgz#0101211baa70c4bca4a0f63f2206e97b7dfaf258"
@@ -13076,13 +13577,6 @@ parse-headers@^2.0.0:
for-each "^0.3.2"
trim "0.0.1"
-parse-json@3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-3.0.0.tgz#fa6f47b18e23826ead32f263e744d0e1e847fb13"
- integrity sha1-+m9HsY4jgm6tMvJj50TQ4ehH+xM=
- dependencies:
- error-ex "^1.3.1"
-
parse-json@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9"
@@ -13098,11 +13592,6 @@ parse-json@^4.0.0:
error-ex "^1.3.1"
json-parse-better-errors "^1.0.1"
-parse-ms@^1.0.0:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/parse-ms/-/parse-ms-1.0.1.tgz#56346d4749d78f23430ca0c713850aef91aa361d"
- integrity sha1-VjRtR0nXjyNDDKDHE4UK75GqNh0=
-
parse-passwd@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/parse-passwd/-/parse-passwd-1.0.0.tgz#6d5b934a456993b23d37f40a382d6f1666a8e5c6"
@@ -13330,13 +13819,6 @@ pkginfo@0.x.x:
resolved "https://registry.yarnpkg.com/pkginfo/-/pkginfo-0.4.1.tgz#b5418ef0439de5425fc4995042dced14fb2a84ff"
integrity sha1-tUGO8EOd5UJfxJlQQtztFPsqhP8=
-plur@^2.1.2:
- version "2.1.2"
- resolved "https://registry.yarnpkg.com/plur/-/plur-2.1.2.tgz#7482452c1a0f508e3e344eaec312c91c29dc655a"
- integrity sha1-dIJFLBoPUI4+NE6uwxLJHCncZVo=
- dependencies:
- irregular-plurals "^1.0.0"
-
pluralize@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777"
@@ -13663,124 +14145,6 @@ postcss@^6.0.1:
source-map "^0.6.1"
supports-color "^5.3.0"
-postman-collection-transformer@2.5.4:
- version "2.5.4"
- resolved "https://registry.yarnpkg.com/postman-collection-transformer/-/postman-collection-transformer-2.5.4.tgz#4e715a9913340621a9fc0e9a5a0373b22e9a9d9a"
- integrity sha512-inKeyLpxyHoZZEmZySakAWWXvq/QaQWXATVWofNT6KoF+ub6JVJBqeIMF+llcLDaYGES7ZTiDT8h/HwaQf2GJg==
- dependencies:
- commander "2.12.2"
- inherits "2.0.3"
- intel "1.2.0"
- lodash "4.17.4"
- semver "5.4.1"
- strip-json-comments "2.0.1"
-
-postman-collection@3.0.6:
- version "3.0.6"
- resolved "https://registry.yarnpkg.com/postman-collection/-/postman-collection-3.0.6.tgz#3bc2307158a783964a473cac82f20d26ffdf5500"
- integrity sha1-O8IwcVing5ZKRzysgvINJv/fVQA=
- dependencies:
- "8fold-marked" "0.3.9"
- escape-html "1.0.3"
- file-type "3.9.0"
- http-reasons "0.1.0"
- iconv-lite "0.4.19"
- liquid-json "0.3.1"
- lodash "4.17.4"
- mime-format "2.0.0"
- mime-types "2.1.17"
- postman-url-encoder "1.0.1"
- sanitize-html "1.15.0"
- semver "5.4.1"
- uuid "3.1.0"
-
-postman-collection@3.0.7:
- version "3.0.7"
- resolved "https://registry.yarnpkg.com/postman-collection/-/postman-collection-3.0.7.tgz#699496583ff61443da8a4e0314e58ee6d10442a3"
- integrity sha512-gzCnfQPMnxAo90M6YJj/d7xXg+SmPRipiVnO9HK6IU10unYqKYp22ozEdVCQ9opoo7tAA5vHsLZwyD9N3o2t7Q==
- dependencies:
- "8fold-marked" "0.3.9"
- escape-html "1.0.3"
- file-type "3.9.0"
- http-reasons "0.1.0"
- iconv-lite "0.4.19"
- liquid-json "0.3.1"
- lodash "4.17.4"
- mime-format "2.0.0"
- mime-types "2.1.17"
- postman-url-encoder "1.0.1"
- sanitize-html "1.15.0"
- semver "5.4.1"
- uuid "3.1.0"
-
-postman-request@2.81.1-postman.4:
- version "2.81.1-postman.4"
- resolved "https://registry.yarnpkg.com/postman-request/-/postman-request-2.81.1-postman.4.tgz#be8f60541539da13739d77b670b9fca6f1aecf83"
- integrity sha1-vo9gVBU52hNznXe2cLn8pvGuz4M=
- dependencies:
- aws-sign2 "~0.7.0"
- aws4 "^1.2.1"
- caseless "~0.12.0"
- combined-stream "~1.0.5"
- extend "~3.0.0"
- forever-agent "~0.6.1"
- form-data "~2.1.1"
- har-validator "~5.0.2"
- hawk "~3.1.3"
- http-signature "~1.1.0"
- is-typedarray "~1.0.0"
- isstream "~0.1.2"
- json-stringify-safe "~5.0.1"
- mime-types "~2.1.7"
- oauth-sign "~0.8.1"
- performance-now "^0.2.0"
- postman-url-encoder "1.0.1"
- qs "~6.4.0"
- safe-buffer "^5.0.1"
- stream-length "^1.0.2"
- stringstream "~0.0.4"
- tough-cookie "~2.3.3"
- tunnel-agent "^0.6.0"
- uuid "^3.0.0"
-
-postman-runtime@7.1.3:
- version "7.1.3"
- resolved "https://registry.yarnpkg.com/postman-runtime/-/postman-runtime-7.1.3.tgz#e0c5dfc40dd7d39a2f71519705c97afde35d6f8c"
- integrity sha1-4MXfxA3X05ovcVGXBcl6/eNdb4w=
- dependencies:
- async "2.6.0"
- aws4 "1.6.0"
- btoa "1.1.2"
- crypto-js "3.1.9-1"
- eventemitter3 "3.0.0"
- hawk "3.1.3"
- http-reasons "0.1.0"
- httpntlm "1.7.5"
- inherits "2.0.3"
- lodash "4.17.4"
- node-oauth1 "1.2.2"
- postman-collection "3.0.6"
- postman-request "2.81.1-postman.4"
- postman-sandbox "3.0.4"
- resolve-from "4.0.0"
- serialised-error "1.1.2"
- uuid "3.1.0"
-
-postman-sandbox@3.0.4:
- version "3.0.4"
- resolved "https://registry.yarnpkg.com/postman-sandbox/-/postman-sandbox-3.0.4.tgz#d011b50d3ec8a8075405d219e1659dbdec354997"
- integrity sha1-0BG1DT7IqAdUBdIZ4WWdvew1SZc=
- dependencies:
- inherits "2.0.3"
- lodash "4.17.4"
- uuid "3.1.0"
- uvm "1.7.0"
-
-postman-url-encoder@1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/postman-url-encoder/-/postman-url-encoder-1.0.1.tgz#a094a42e9415ff0bbfdce0eaa8e6011d449ee83c"
- integrity sha1-oJSkLpQV/wu/3ODqqOYBHUSe6Dw=
-
prebuild-install@^2.2.2:
version "2.5.3"
resolved "https://registry.yarnpkg.com/prebuild-install/-/prebuild-install-2.5.3.tgz#9f65f242782d370296353710e9bc843490c19f69"
@@ -13863,14 +14227,6 @@ pretty-hrtime@^1.0.0:
resolved "https://registry.yarnpkg.com/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz#b7e3ea42435a4c9b2759d99e0f201eb195802ee1"
integrity sha1-t+PqQkNaTJsnWdmeDyAesZWALuE=
-pretty-ms@3.1.0:
- version "3.1.0"
- resolved "https://registry.yarnpkg.com/pretty-ms/-/pretty-ms-3.1.0.tgz#e9cac9c76bf6ee52fe942dd9c6c4213153b12881"
- integrity sha1-6crJx2v27lL+lC3ZxsQhMVOxKIE=
- dependencies:
- parse-ms "^1.0.0"
- plur "^2.1.2"
-
prismjs@^1.15.0:
version "1.15.0"
resolved "https://registry.npmjs.org/prismjs/-/prismjs-1.15.0.tgz#8801d332e472091ba8def94976c8877ad60398d9"
@@ -13916,6 +14272,14 @@ promise-inflight@^1.0.1:
resolved "https://registry.yarnpkg.com/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3"
integrity sha1-mEcocL8igTL8vdhoEputEsPAKeM=
+promise-retry@^1.1.1:
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/promise-retry/-/promise-retry-1.1.1.tgz#6739e968e3051da20ce6497fb2b50f6911df3d6d"
+ integrity sha1-ZznpaOMFHaIM5kl/srUPaRHfPW0=
+ dependencies:
+ err-code "^1.0.0"
+ retry "^0.10.0"
+
promise-to-callback@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/promise-to-callback/-/promise-to-callback-1.0.0.tgz#5d2a749010bfb67d963598fcd3960746a68feef7"
@@ -13980,16 +14344,18 @@ prop-types@^15.5.4, prop-types@^15.5.6, prop-types@^15.5.7, prop-types@^15.5.8,
loose-envify "^1.3.1"
object-assign "^4.1.1"
-propagate@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/propagate/-/propagate-1.0.0.tgz#00c2daeedda20e87e3782b344adba1cddd6ad709"
- integrity sha1-AMLa7t2iDofjeCs0Stuhzd1q1wk=
-
proto-list@~1.2.1:
version "1.2.4"
resolved "http://registry.yarnpkg.com/proto-list/-/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849"
integrity sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk=
+protoduck@^5.0.0:
+ version "5.0.0"
+ resolved "https://registry.yarnpkg.com/protoduck/-/protoduck-5.0.0.tgz#752145e6be0ad834cb25716f670a713c860dce70"
+ integrity sha512-agsGWD8/RZrS4ga6v82Fxb0RHIS2RZnbsSue6A9/MBRhB/jcqOANAMNrqM9900b8duj+Gx+T/JMy5IowDoO/hQ==
+ dependencies:
+ genfun "^4.0.1"
+
proxy-addr@~2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.3.tgz#355f262505a621646b3130a728eb647e22055341"
@@ -14193,7 +14559,7 @@ q@^1.1.2, q@^1.5.1:
resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7"
integrity sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=
-qs@6.5.1, qs@^6.5.1, qs@~6.5.1:
+qs@6.5.1, qs@~6.5.1:
version "6.5.1"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.1.tgz#349cdf6eef89ec45c12d7d5eb3fc0c870343a6d8"
integrity sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==
@@ -14540,9 +14906,16 @@ react-router@^4.2.0:
prop-types "^15.5.4"
warning "^3.0.0"
+react-scroll@0xproject/react-scroll#pr-330-and-replace-state:
+ version "1.7.11"
+ resolved "https://codeload.github.com/0xproject/react-scroll/tar.gz/d2afc2729dc09980e4113d8c38a1b012ba180d81"
+ dependencies:
+ lodash.throttle "^4.1.1"
+ prop-types "^15.5.8"
+
react-scroll@0xproject/react-scroll#similar-to-pr-330:
version "1.7.10"
- resolved "https://codeload.github.com/0xproject/react-scroll/tar.gz/f28a6c51800152fde11e7362383992aa60a15703"
+ resolved "https://codeload.github.com/0xproject/react-scroll/tar.gz/0f625b270d7e966313cac8b811c0ae807b37e170"
dependencies:
lodash.throttle "^4.1.1"
prop-types "^15.5.8"
@@ -14940,6 +15313,11 @@ redux-devtools-extension@^2.13.2:
resolved "https://registry.yarnpkg.com/redux-devtools-extension/-/redux-devtools-extension-2.13.2.tgz#e0f9a8e8dfca7c17be92c7124958a3b94eb2911d"
integrity sha1-4Pmo6N/KfBe+kscSSVijuU6ykR0=
+redux-devtools-extension@^2.13.5:
+ version "2.13.5"
+ resolved "https://registry.yarnpkg.com/redux-devtools-extension/-/redux-devtools-extension-2.13.5.tgz#3ff34f7227acfeef3964194f5f7fc2765e5c5a39"
+ integrity sha512-QQ9BRy77oURHMdGys9rfQcCQDzXZ1T4oW+eUyE5Cg7DNVau69HJzc4YNDMOmpi0Dzpi1zOQgQ2rUpgJta4Lfqg==
+
redux@*, redux@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/redux/-/redux-4.0.0.tgz#aa698a92b729315d22b34a0553d7e6533555cc03"
@@ -15274,11 +15652,6 @@ require-directory@^2.1.1:
resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42"
integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I=
-require-from-string@2.0.1:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.1.tgz#c545233e9d7da6616e9d59adfb39fc9f588676ff"
- integrity sha1-xUUjPp19pmFunVmt+zn8n1iGdv8=
-
require-from-string@^1.1.0:
version "1.2.1"
resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-1.2.1.tgz#529c9ccef27380adfec9a2f965b649bbee636418"
@@ -15327,11 +15700,6 @@ resolve-dir@^1.0.0, resolve-dir@^1.0.1:
expand-tilde "^2.0.0"
global-modules "^1.0.0"
-resolve-from@4.0.0, resolve-from@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6"
- integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==
-
resolve-from@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226"
@@ -15347,6 +15715,11 @@ resolve-from@^3.0.0:
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748"
integrity sha1-six699nWiBvItuZTM17rywoYh0g=
+resolve-from@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6"
+ integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==
+
resolve-options@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/resolve-options/-/resolve-options-1.1.0.tgz#32bb9e39c06d67338dc9378c0d6d6074566ad131"
@@ -15411,6 +15784,11 @@ ret@~0.1.10:
resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc"
integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==
+retry@^0.10.0:
+ version "0.10.1"
+ resolved "https://registry.yarnpkg.com/retry/-/retry-0.10.1.tgz#e76388d217992c252750241d3d3956fed98d8ff4"
+ integrity sha1-52OI0heZLCUnUCQdPTlW/tmNj/Q=
+
retry@^0.8.0:
version "0.8.0"
resolved "https://registry.yarnpkg.com/retry/-/retry-0.8.0.tgz#2367628dc0edb247b1eab649dc53ac8628ac2d5f"
@@ -15564,6 +15942,13 @@ rxjs@^5.5.2:
dependencies:
symbol-observable "1.0.1"
+rxjs@^6.1.0:
+ version "6.3.3"
+ resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.3.3.tgz#3c6a7fa420e844a81390fb1158a9ec614f4bad55"
+ integrity sha512-JTWmoY9tWCs7zvIk/CvRjhjGaOd+OVBM987mxFo+OW66cGpdKjZcpmc74ES1sB//7Kl/PAe8+wEakuhG4pcgOw==
+ dependencies:
+ tslib "^1.9.0"
+
safe-buffer@5.1.1, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1:
version "5.1.1"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853"
@@ -15607,16 +15992,6 @@ sane@^2.0.0:
optionalDependencies:
fsevents "^1.2.3"
-sanitize-html@1.15.0:
- version "1.15.0"
- resolved "https://registry.yarnpkg.com/sanitize-html/-/sanitize-html-1.15.0.tgz#d101a62c9fe0347486badc6cd6ed72daa0a82ced"
- integrity sha512-1jWLToWx8ZV53Z1Jg+2fHl8dNFsxvQt2Cmrk4o/z1+MUdB5EXSU0QVuzlGGhfp7cQrYbEEfMO/TUWHfkBUqujQ==
- dependencies:
- htmlparser2 "^3.9.0"
- lodash.escaperegexp "^4.1.2"
- srcset "^1.0.0"
- xtend "^4.0.0"
-
sax@1.2.1:
version "1.2.1"
resolved "https://registry.npmjs.org/sax/-/sax-1.2.1.tgz#7b8e656190b228e81a66aea748480d828cd2d37a"
@@ -15664,11 +16039,6 @@ scrypt-async@^1.2.0:
resolved "https://registry.yarnpkg.com/scrypt-async/-/scrypt-async-1.3.1.tgz#a11fd6fac981b4b823ee01dee0221169500ddae9"
integrity sha1-oR/W+smBtLgj7gHe4CIRaVAN2uk=
-scrypt-js@2.0.3:
- version "2.0.3"
- resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-2.0.3.tgz#bb0040be03043da9a012a2cea9fc9f852cfc87d4"
- integrity sha1-uwBAvgMEPamgEqLOqfyfhSz8h9Q=
-
scrypt-js@2.0.4:
version "2.0.4"
resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-2.0.4.tgz#32f8c5149f0797672e551c07e230f834b6af5f16"
@@ -15774,7 +16144,7 @@ semver-sort@0.0.4:
resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.1.tgz#7dfdd8814bdb7cabc7be0fb1d734cfb66c940477"
integrity sha512-PqpAxfrEhlSUWge8dwIp4tZnQ25DIOthpiaHNIthsjEFQD6EvqUKUDM7L8O2rShkFccYo1VjJR0coWfNkCubRw==
-"semver@2 || 3 || 4 || 5", semver@5.4.1, semver@^5.0.3, semver@^5.1.0, semver@^5.3.0, semver@^5.4.1, semver@~5.4.1:
+"semver@2 || 3 || 4 || 5", semver@^5.0.3, semver@^5.1.0, semver@^5.3.0, semver@^5.4.1, semver@~5.4.1:
version "5.4.1"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e"
integrity sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==
@@ -15831,15 +16201,6 @@ sequencify@~0.0.7:
resolved "https://registry.yarnpkg.com/sequencify/-/sequencify-0.0.7.tgz#90cff19d02e07027fd767f5ead3e7b95d1e7380c"
integrity sha1-kM/xnQLgcCf9dn9erT57ldHnOAw=
-serialised-error@1.1.2:
- version "1.1.2"
- resolved "https://registry.yarnpkg.com/serialised-error/-/serialised-error-1.1.2.tgz#b5c3822196f873feb0c76587e1d6dfa6790ade97"
- integrity sha1-tcOCIZb4c/6wx2WH4dbfpnkK3pc=
- dependencies:
- node-uuid "^1.4.7"
- object-hash "^1.1.2"
- stack-trace "0.0.9"
-
serialize-javascript@^1.4.0:
version "1.5.0"
resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-1.5.0.tgz#1aa336162c88a890ddad5384baebc93a655161fe"
@@ -15981,15 +16342,6 @@ shell-quote@^1.4.3, shell-quote@^1.6.1:
array-reduce "~0.0.0"
jsonify "~0.0.0"
-shelljs@0.8.0:
- version "0.8.0"
- resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.0.tgz#12f561c52ec5d0d3315af15616c011a18ff80d59"
- integrity sha512-wb72o5SM27oFRq2mMeNSl70DVkkvwf3ZSgk9rvieRVz7xFMIQp02HYw0oxlZgeAWS+wzGB+jcJWQTF7hH9WIPg==
- dependencies:
- glob "^7.0.0"
- interpret "^1.0.0"
- rechoir "^0.6.2"
-
shelljs@^0.7.3:
version "0.7.8"
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.8.tgz#decbcf874b0d1e5fb72e14b164a9683048e9acb3"
@@ -16108,6 +16460,11 @@ slugify@^1.2.1:
resolved "https://registry.npmjs.org/slugify/-/slugify-1.3.1.tgz#f572127e8535329fbc6c1edb74ab856b61ad7de2"
integrity sha512-6BwyhjF5tG5P8s+0DPNyJmBSBePG6iMyhjvIW5zGdA3tFik9PtK+yNkZgTeiroCRGZYgkHftFA62tGVK1EI9Kw==
+smart-buffer@^4.0.1:
+ version "4.0.1"
+ resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-4.0.1.tgz#07ea1ca8d4db24eb4cac86537d7d18995221ace3"
+ integrity sha512-RFqinRVJVcCAL9Uh1oVqE6FZkqsyLiVOYEZ20TqIOjuX7iFVJ+zsbs4RIghnw/pTs7mZvt8ZHhvm1ZUrR4fykg==
+
snake-case@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/snake-case/-/snake-case-2.1.0.tgz#41bdb1b73f30ec66a04d4e2cad1b76387d4d6d9f"
@@ -16179,16 +16536,21 @@ sockjs@0.3.19:
faye-websocket "^0.10.0"
uuid "^3.0.1"
-solc@0.4.23, solc@^0.4.23:
- version "0.4.23"
- resolved "https://registry.yarnpkg.com/solc/-/solc-0.4.23.tgz#54a0ff4015827b32fddb62c0a418b5247310a58e"
- integrity sha512-AT7anLHY6uIRg2It6N0UlCHeZ7YeecIkUhnlirrCgCPCUevtnoN48BxvgigN/4jJTRljv5oFhAJtI6gvHzT5DQ==
+socks-proxy-agent@^4.0.0:
+ version "4.0.1"
+ resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-4.0.1.tgz#5936bf8b707a993079c6f37db2091821bffa6473"
+ integrity sha512-Kezx6/VBguXOsEe5oU3lXYyKMi4+gva72TwJ7pQY5JfqUx2nMk7NXA6z/mpNqIlfQjWYVfeuNvQjexiTaTn6Nw==
dependencies:
- fs-extra "^0.30.0"
- memorystream "^0.3.1"
- require-from-string "^1.1.0"
- semver "^5.3.0"
- yargs "^4.7.1"
+ agent-base "~4.2.0"
+ socks "~2.2.0"
+
+socks@~2.2.0:
+ version "2.2.1"
+ resolved "https://registry.yarnpkg.com/socks/-/socks-2.2.1.tgz#68ad678b3642fbc5d99c64c165bc561eab0215f9"
+ integrity sha512-0GabKw7n9mI46vcNrVfs0o6XzWzjVa3h6GaSo2UPxtWAROXUWavfJWh1M4PR5tnE0dcnQXZIDFP4yrAysLze/w==
+ dependencies:
+ ip "^1.1.5"
+ smart-buffer "^4.0.1"
solc@0.4.24, solc@^0.4.24:
version "0.4.24"
@@ -16212,6 +16574,17 @@ solc@^0.4.2:
semver "^5.3.0"
yargs "^4.7.1"
+solc@^0.4.23:
+ version "0.4.23"
+ resolved "https://registry.yarnpkg.com/solc/-/solc-0.4.23.tgz#54a0ff4015827b32fddb62c0a418b5247310a58e"
+ integrity sha512-AT7anLHY6uIRg2It6N0UlCHeZ7YeecIkUhnlirrCgCPCUevtnoN48BxvgigN/4jJTRljv5oFhAJtI6gvHzT5DQ==
+ dependencies:
+ fs-extra "^0.30.0"
+ memorystream "^0.3.1"
+ require-from-string "^1.1.0"
+ semver "^5.3.0"
+ yargs "^4.7.1"
+
solhint@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/solhint/-/solhint-1.2.1.tgz#59a1416cef94da38d587f768a73536d6e3403dd3"
@@ -16446,14 +16819,6 @@ sprintf-js@~1.0.2:
resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=
-srcset@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/srcset/-/srcset-1.0.0.tgz#a5669de12b42f3b1d5e83ed03c71046fc48f41ef"
- integrity sha1-pWad4StC87HV6D7QPHEEb8SPQe8=
- dependencies:
- array-uniq "^1.0.2"
- number-is-nan "^1.0.0"
-
sshpk@^1.7.0:
version "1.14.1"
resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.14.1.tgz#130f5975eddad963f1d56f92b9ac6c51fa9f83eb"
@@ -16483,12 +16848,7 @@ ssri@^6.0.0:
dependencies:
figgy-pudding "^3.5.1"
-stack-trace@0.0.9:
- version "0.0.9"
- resolved "https://registry.yarnpkg.com/stack-trace/-/stack-trace-0.0.9.tgz#a8f6eaeca90674c333e7c43953f275b451510695"
- integrity sha1-qPbq7KkGdMMz58Q5U/J1tFFRBpU=
-
-stack-trace@0.0.x, stack-trace@~0.0.9:
+stack-trace@0.0.x:
version "0.0.10"
resolved "https://registry.yarnpkg.com/stack-trace/-/stack-trace-0.0.10.tgz#547c70b347e8d32b4e108ea1a2a159e5fdde19c0"
integrity sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=
@@ -16575,13 +16935,6 @@ stream-http@^2.7.2:
to-arraybuffer "^1.0.0"
xtend "^4.0.0"
-stream-length@^1.0.2:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/stream-length/-/stream-length-1.0.2.tgz#8277f3cbee49a4daabcfdb4e2f4a9b5e9f2c9f00"
- integrity sha1-gnfzy+5JpNqrz9tOL0qbXp8snwA=
- dependencies:
- bluebird "^2.6.2"
-
stream-shift@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.0.tgz#d5c752825e5367e786f78e18e445ea223a155952"
@@ -16600,11 +16953,6 @@ stream-to-pull-stream@^1.7.1:
looper "^3.0.0"
pull-stream "^3.2.3"
-strftime@~0.10.0:
- version "0.10.0"
- resolved "https://registry.yarnpkg.com/strftime/-/strftime-0.10.0.tgz#b3f0fa419295202a5a289f6d6be9f4909a617193"
- integrity sha1-s/D6QZKVICpaKJ9ta+n0kJphcZM=
-
strict-uri-encode@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713"
@@ -16754,7 +17102,7 @@ strip-indent@^2.0.0:
resolved "http://registry.yarnpkg.com/strip-indent/-/strip-indent-2.0.0.tgz#5ef8db295d01e6ed6cbf7aab96998d7822527b68"
integrity sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=
-strip-json-comments@2.0.1, strip-json-comments@~2.0.1:
+strip-json-comments@~2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a"
integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo=
@@ -16770,6 +17118,16 @@ strong-log-transformer@^1.0.6:
moment "^2.6.0"
through "^2.3.4"
+strong-log-transformer@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/strong-log-transformer/-/strong-log-transformer-2.0.0.tgz#fa6d8e0a9e62b3c168c3cad5ae5d00dc97ba26cc"
+ integrity sha512-FQmNqAXJgOX8ygOcvPLlGWBNT41mvNJ9ALoYf0GTwVt9t30mGTqpmp/oJx5gLcu52DXK10kS7dVWhx8aPXDTlg==
+ dependencies:
+ byline "^5.0.0"
+ duplexer "^0.1.1"
+ minimist "^1.2.0"
+ through "^2.3.4"
+
style-loader@0.23.x:
version "0.23.0"
resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-0.23.0.tgz#8377fefab68416a2e05f1cabd8c3a3acfcce74f1"
@@ -16809,21 +17167,6 @@ styled-components@^3.3.3:
stylis-rule-sheet "^0.0.10"
supports-color "^3.2.3"
-styled-components@^3.4.9:
- version "3.4.10"
- resolved "https://registry.npmjs.org/styled-components/-/styled-components-3.4.10.tgz#9a654c50ea2b516c36ade57ddcfa296bf85c96e1"
- integrity sha512-TA8ip8LoILgmSAFd3r326pKtXytUUGu5YWuqZcOQVwVVwB6XqUMn4MHW2IuYJ/HAD81jLrdQed8YWfLSG1LX4Q==
- dependencies:
- buffer "^5.0.3"
- css-to-react-native "^2.0.3"
- fbjs "^0.8.16"
- hoist-non-react-statics "^2.5.0"
- prop-types "^15.5.4"
- react-is "^16.3.1"
- stylis "^3.5.0"
- stylis-rule-sheet "^0.0.10"
- supports-color "^3.2.3"
-
styled-components@^4.0.2:
version "4.0.2"
resolved "https://registry.yarnpkg.com/styled-components/-/styled-components-4.0.2.tgz#7d4409ada019cdd34c25ba68c4577ea95dbcf0c5"
@@ -16981,11 +17324,6 @@ symbol-tree@^3.2.2:
resolved "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6"
integrity sha1-rifbOPZgp64uHDt9G8KQgZuFGeY=
-symbol@~0.3.1:
- version "0.3.1"
- resolved "https://registry.yarnpkg.com/symbol/-/symbol-0.3.1.tgz#b6f9a900d496a57f02408f22198c109dda063041"
- integrity sha1-tvmpANSWpX8CQI8iGYwQndoGMEE=
-
table@4.0.2:
version "4.0.2"
resolved "https://registry.yarnpkg.com/table/-/table-4.0.2.tgz#a33447375391e766ad34d3486e6e2aedc84d2e36"
@@ -17081,9 +17419,9 @@ tar@^2.0.0, tar@^2.1.1, tar@^2.2.1:
fstream "^1.0.2"
inherits "2"
-tar@^4:
+tar@^4, tar@^4.4.3:
version "4.4.6"
- resolved "https://registry.npmjs.org/tar/-/tar-4.4.6.tgz#63110f09c00b4e60ac8bcfe1bf3c8660235fbc9b"
+ resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.6.tgz#63110f09c00b4e60ac8bcfe1bf3c8660235fbc9b"
integrity sha512-tMkTnh9EdzxyfW+6GK6fCahagXsnYk6kE6S9Gr9pjVdys769+laCTbodXDhPAjzVtEBazRgP0gYqOjnk9dQzLg==
dependencies:
chownr "^1.0.1"
@@ -17355,7 +17693,7 @@ to-fast-properties@^1.0.3:
to-fast-properties@^2.0.0:
version "2.0.0"
- resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e"
+ resolved "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e"
integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=
to-no-case@^1.0.0:
@@ -17550,6 +17888,11 @@ ts-node@^7.0.0:
source-map-support "^0.5.6"
yn "^2.0.0"
+ts-optchain@^0.1.1:
+ version "0.1.1"
+ resolved "https://registry.npmjs.org/ts-optchain/-/ts-optchain-0.1.1.tgz#9d45e2c3fc6201c2f9be82edad4c76fefb2a36d9"
+ integrity sha512-WWNaATI+rtNm6C3550HbLzvu32zIg0I0gBkvJZpOQnyeGIoGxg2RZOt96U7bi90ZlQ7bFiI5PCRaXScv4+4Y4A==
+
tslib@1.9.0, tslib@^1.8.0, tslib@^1.8.1:
version "1.9.0"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.0.tgz#e37a86fda8cbbaf23a057f473c9f4dc64e5fc2e8"
@@ -17717,10 +18060,10 @@ typedoc-default-themes@^0.5.0:
resolved "https://registry.yarnpkg.com/typedoc-default-themes/-/typedoc-default-themes-0.5.0.tgz#6dc2433e78ed8bea8e887a3acde2f31785bd6227"
integrity sha1-bcJDPnjti+qOiHo6zeLzF4W9Yic=
-typedoc@0.12.0:
- version "0.12.0"
- resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.12.0.tgz#c5d606f52af29d841658e18d9faa1a72acf0e270"
- integrity sha512-dsdlaYZ7Je8JC+jQ3j2Iroe4uyD0GhqzADNUVyBRgLuytQDP/g0dPkAw5PdM/4drnmmJjRzSWW97FkKo+ITqQg==
+typedoc@0.13.0:
+ version "0.13.0"
+ resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.13.0.tgz#9efdf352bd54873955cd161bd4b75f24a8c59dde"
+ integrity sha512-jQWtvPcV+0fiLZAXFEe70v5gqjDO6pJYJz4mlTtmGJeW2KRoIU/BEfktma6Uj8Xii7UakuZjbxFewl3UYOkU/w==
dependencies:
"@types/fs-extra" "^5.0.3"
"@types/handlebars" "^4.0.38"
@@ -17738,7 +18081,7 @@ typedoc@0.12.0:
progress "^2.0.0"
shelljs "^0.8.2"
typedoc-default-themes "^0.5.0"
- typescript "3.0.x"
+ typescript "3.1.x"
types-bn@^0.0.1:
version "0.0.1"
@@ -17747,11 +18090,16 @@ types-bn@^0.0.1:
dependencies:
bn.js "4.11.7"
-typescript@3.0.1, typescript@3.0.x:
+typescript@3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.0.1.tgz#43738f29585d3a87575520a4b93ab6026ef11fdb"
integrity sha512-zQIMOmC+372pC/CCVLqnQ0zSBiY7HHodU7mpQdjiZddek4GMj31I3dUJ7gAs9o65X7mnRma6OokOkc6f9jjfBg==
+typescript@3.1.x:
+ version "3.1.3"
+ resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.1.3.tgz#01b70247a6d3c2467f70c45795ef5ea18ce191d5"
+ integrity sha512-+81MUSyX+BaSo+u2RbozuQk/UWx6hfG0a5gHu4ANEM4sU96XbuIyAB+rWBW1u70c6a5QuZfuYICn3s2UjuHUpA==
+
typewise-core@^1.2, typewise-core@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/typewise-core/-/typewise-core-1.2.0.tgz#97eb91805c7f55d2f941748fa50d315d991ef195"
@@ -17883,11 +18231,6 @@ underscore@~1.4.4:
resolved "https://registry.npmjs.org/underscore/-/underscore-1.4.4.tgz#61a6a32010622afa07963bf325203cf12239d604"
integrity sha1-YaajIBBiKvoHljvzJSA88SI51gQ=
-underscore@~1.7.0:
- version "1.7.0"
- resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.7.0.tgz#6bbaf0877500d36be34ecaa584e0db9fef035209"
- integrity sha1-a7rwh3UA02vjTsqlhODbn+8DUgk=
-
unherit@^1.0.4:
version "1.1.0"
resolved "https://registry.yarnpkg.com/unherit/-/unherit-1.1.0.tgz#6b9aaedfbf73df1756ad9e316dd981885840cd7d"
@@ -18027,7 +18370,7 @@ upath@^1.0.0:
resolved "https://registry.yarnpkg.com/upath/-/upath-1.0.4.tgz#ee2321ba0a786c50973db043a50b7bcba822361d"
integrity sha512-d4SJySNBXDaQp+DPrziv3xGS6w3d2Xt69FijJr86zMPBy23JEloMCEOUBBzuN7xCtjLCnmB9tI/z7SBCahHBOw==
-update-notifier@^2.3.0:
+update-notifier@^2.3.0, update-notifier@^2.5.0:
version "2.5.0"
resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-2.5.0.tgz#d0744593e13f161e406acb1d9408b72cad08aff6"
integrity sha512-gwMdhgJHGuj/+wHJJs9e6PcCszpxR1b236igrOkUofGhqJuG+amlIKwApH1IW1WWl7ovZxsX49lMBWLxSdm5Dw==
@@ -18128,11 +18471,6 @@ user-home@^1.1.1:
resolved "https://registry.yarnpkg.com/user-home/-/user-home-1.1.1.tgz#2b5be23a32b63a7c9deb8d0f28d485724a3df190"
integrity sha1-K1viOjK2Onyd640PKNSFcko98ZA=
-utcstring@~0.1.0:
- version "0.1.0"
- resolved "https://registry.yarnpkg.com/utcstring/-/utcstring-0.1.0.tgz#430fd510ab7fc95b5d5910c902d79880c208436b"
- integrity sha1-Qw/VEKt/yVtdWRDJAteYgMIIQ2s=
-
utf8@2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/utf8/-/utf8-2.1.1.tgz#2e01db02f7d8d0944f77104f1609eb0c304cf768"
@@ -18190,7 +18528,7 @@ uuid@2.0.1:
resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.1.tgz#c2a30dedb3e535d72ccf82e343941a50ba8533ac"
integrity sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w=
-uuid@3.0.1, uuid@3.0.x, uuid@~3.0.0:
+uuid@3.0.x, uuid@~3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1"
integrity sha1-ZUS7ot/ajBzxfmKaOjBeK7H+5sE=
@@ -18215,16 +18553,6 @@ uuid@^3.3.2:
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131"
integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==
-uvm@1.7.0:
- version "1.7.0"
- resolved "https://registry.yarnpkg.com/uvm/-/uvm-1.7.0.tgz#685d3a149ec7118fb73a73dfdc158ab46b0f0634"
- integrity sha1-aF06FJ7HEY+3OnPf3BWKtGsPBjQ=
- dependencies:
- circular-json "0.3.1"
- inherits "2.0.3"
- lodash "4.17.4"
- uuid "3.0.1"
-
v8-compile-cache@^2.0.2:
version "2.0.2"
resolved "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.0.2.tgz#a428b28bb26790734c4fc8bc9fa106fccebf6a6c"
@@ -18237,7 +18565,7 @@ v8flags@^2.0.2:
dependencies:
user-home "^1.1.1"
-valid-url@1.0.9, valid-url@^1.0.9:
+valid-url@^1.0.9:
version "1.0.9"
resolved "https://registry.yarnpkg.com/valid-url/-/valid-url-1.0.9.tgz#1c14479b40f1397a75782f115e4086447433a200"
integrity sha1-HBRHm0DxOXp1eC8RXkCGRHQzogA=
@@ -18472,15 +18800,6 @@ web3-bzz@1.0.0-beta.34:
swarm-js "0.1.37"
underscore "1.8.3"
-web3-core-helpers@1.0.0-beta.33:
- version "1.0.0-beta.33"
- resolved "https://registry.yarnpkg.com/web3-core-helpers/-/web3-core-helpers-1.0.0-beta.33.tgz#2af733e504db05e7c3648c1dacf577b0ec15dc43"
- integrity sha1-Kvcz5QTbBefDZIwdrPV3sOwV3EM=
- dependencies:
- underscore "1.8.3"
- web3-eth-iban "1.0.0-beta.33"
- web3-utils "1.0.0-beta.33"
-
web3-core-helpers@1.0.0-beta.34:
version "1.0.0-beta.34"
resolved "https://registry.yarnpkg.com/web3-core-helpers/-/web3-core-helpers-1.0.0-beta.34.tgz#b168da00d3e19e156bc15ae203203dd4dfee2d03"
@@ -18539,16 +18858,6 @@ web3-core@1.0.0-beta.34:
web3-core-requestmanager "1.0.0-beta.34"
web3-utils "1.0.0-beta.34"
-web3-eth-abi@1.0.0-beta.33:
- version "1.0.0-beta.33"
- resolved "https://registry.yarnpkg.com/web3-eth-abi/-/web3-eth-abi-1.0.0-beta.33.tgz#2221f7151643660032a4df340f612349168c824a"
- integrity sha1-IiH3FRZDZgAypN80D2EjSRaMgko=
- dependencies:
- bn.js "4.11.6"
- underscore "1.8.3"
- web3-core-helpers "1.0.0-beta.33"
- web3-utils "1.0.0-beta.33"
-
web3-eth-abi@1.0.0-beta.34, web3-eth-abi@^1.0.0-beta.24:
version "1.0.0-beta.34"
resolved "https://registry.yarnpkg.com/web3-eth-abi/-/web3-eth-abi-1.0.0-beta.34.tgz#034533e3aa2f7e59ff31793eaea685c0ed5af67a"
@@ -18589,14 +18898,6 @@ web3-eth-contract@1.0.0-beta.34:
web3-eth-abi "1.0.0-beta.34"
web3-utils "1.0.0-beta.34"
-web3-eth-iban@1.0.0-beta.33:
- version "1.0.0-beta.33"
- resolved "https://registry.yarnpkg.com/web3-eth-iban/-/web3-eth-iban-1.0.0-beta.33.tgz#1d73d0c5288a4565b1754a75b5fb3ea0b77a532f"
- integrity sha1-HXPQxSiKRWWxdUp1tfs+oLd6Uy8=
- dependencies:
- bn.js "4.11.6"
- web3-utils "1.0.0-beta.33"
-
web3-eth-iban@1.0.0-beta.34:
version "1.0.0-beta.34"
resolved "https://registry.yarnpkg.com/web3-eth-iban/-/web3-eth-iban-1.0.0-beta.34.tgz#9af458605867ccf74ea979aaf326b38ba6a5ba0c"
@@ -18738,19 +19039,6 @@ web3-typescript-typings@^0.10.2:
dependencies:
bignumber.js "~4.1.0"
-web3-utils@1.0.0-beta.33:
- version "1.0.0-beta.33"
- resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.0.0-beta.33.tgz#e091b7994f09b714b0198a4057d3ad2eb8cbe238"
- integrity sha1-4JG3mU8JtxSwGYpAV9OtLrjL4jg=
- dependencies:
- bn.js "4.11.6"
- eth-lib "0.1.27"
- ethjs-unit "0.1.6"
- number-to-bn "1.7.0"
- randomhex "0.1.5"
- underscore "1.8.3"
- utf8 "2.1.1"
-
web3-utils@1.0.0-beta.34:
version "1.0.0-beta.34"
resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.0.0-beta.34.tgz#9411fc39aaef39ca4e06169f762297d9ff020970"
@@ -18775,17 +19063,6 @@ web3@0.20.2:
xhr2 "*"
xmlhttprequest "*"
-web3@0.20.6:
- version "0.20.6"
- resolved "https://registry.yarnpkg.com/web3/-/web3-0.20.6.tgz#3e97306ae024fb24e10a3d75c884302562215120"
- integrity sha1-PpcwauAk+yThCj11yIQwJWIhUSA=
- dependencies:
- bignumber.js "git+https://github.com/frozeman/bignumber.js-nolookahead.git"
- crypto-js "^3.1.4"
- utf8 "^2.1.1"
- xhr2 "*"
- xmlhttprequest "*"
-
web3@^0.18.0:
version "0.18.4"
resolved "https://registry.yarnpkg.com/web3/-/web3-0.18.4.tgz#81ec1784145491f2eaa8955b31c06049e07c5e7d"
@@ -18986,8 +19263,8 @@ websocket@^1.0.24, websocket@^1.0.25:
yaeti "^0.0.6"
"websocket@git://github.com/frozeman/WebSocket-Node.git#browserifyCompatible":
- version "1.0.24"
- resolved "git://github.com/frozeman/WebSocket-Node.git#7004c39c42ac98875ab61126e5b4a925430f592c"
+ version "1.0.26"
+ resolved "git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2"
dependencies:
debug "^2.2.0"
nan "^2.3.3"
@@ -19105,11 +19382,6 @@ winston@2.1.x:
pkginfo "0.3.x"
stack-trace "0.0.x"
-word-wrap@1.2.3:
- version "1.2.3"
- resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c"
- integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==
-
wordwrap@0.0.2:
version "0.0.2"
resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f"
@@ -19303,11 +19575,6 @@ xml2js@0.4.19:
sax ">=0.6.0"
xmlbuilder "~9.0.1"
-xmlbuilder@9.0.4:
- version "9.0.4"
- resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.4.tgz#519cb4ca686d005a8420d3496f3f0caeecca580f"
- integrity sha1-UZy0ymhtAFqEINNJbz8MruzKWA8=
-
xmlbuilder@~9.0.1:
version "9.0.7"
resolved "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d"
@@ -19365,7 +19632,7 @@ yallist@^3.0.0, yallist@^3.0.2:
resolved "https://registry.npmjs.org/yallist/-/yallist-3.0.2.tgz#8452b4bb7e83c7c188d8041c1a837c773d6d8bb9"
integrity sha1-hFK0u36Dx8GI2AQcGoN8dz1ti7k=
-yargs-parser@10.x, yargs-parser@^10.1.0:
+yargs-parser@10.x, yargs-parser@^10.0.0, yargs-parser@^10.1.0:
version "10.1.0"
resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-10.1.0.tgz#7202265b89f7e9e9f2e5765e0fe735a905edbaa8"
integrity sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ==